summaryrefslogtreecommitdiff
path: root/src/user/lib/unistd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/lib/unistd.c')
-rw-r--r--src/user/lib/unistd.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/user/lib/unistd.c b/src/user/lib/unistd.c
index 9d0c479..f40b876 100644
--- a/src/user/lib/unistd.c
+++ b/src/user/lib/unistd.c
@@ -20,6 +20,20 @@ int close(handle_t h) {
_Noreturn void exit(int c) {
_syscall_exit(c);
}
+_Noreturn void _exit(int c) { exit(c); };
+
+// TODO unlink
+int unlink(const char *path) {
+ (void)path;
+ errno = ENOSYS;
+ return -1;
+}
+
+// TODO isatty
+int isatty(int fd) {
+ return fd <= 2 ? 1 : 0;
+}
+
int execv(const char *path, char *const argv[]) {
FILE *file = fopen(path, "r");
@@ -48,11 +62,6 @@ int execv(const char *path, char *const argv[]) {
return -1;
}
-// stdlib.h
-_Noreturn void abort(void) {
- _syscall_exit(1);
-}
-
static const char *__initialcwd;
static char *cwd = NULL, *cwd2 = NULL;