diff options
author | dzwdz | 2022-08-26 14:16:16 +0200 |
---|---|---|
committer | dzwdz | 2022-08-26 14:16:16 +0200 |
commit | e6584db26da34572fb13aa236e16e19f71c8e976 (patch) | |
tree | 055c528765e986bc8ed6706cec84289e50b46ed6 /src/user/lib/unistd.c | |
parent | ffdf0e8d93f8e98ed9d5a8270feb2a19eb9659e3 (diff) |
user/libc: prepare for OpenED port
Diffstat (limited to 'src/user/lib/unistd.c')
-rw-r--r-- | src/user/lib/unistd.c | 19 |
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; |