From e6584db26da34572fb13aa236e16e19f71c8e976 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 26 Aug 2022 14:16:16 +0200 Subject: user/libc: prepare for OpenED port --- src/user/lib/unistd.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/user/lib/unistd.c') 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; -- cgit v1.2.3