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/stdlib.c | |
parent | ffdf0e8d93f8e98ed9d5a8270feb2a19eb9659e3 (diff) |
user/libc: prepare for OpenED port
Diffstat (limited to 'src/user/lib/stdlib.c')
-rw-r--r-- | src/user/lib/stdlib.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/user/lib/stdlib.c b/src/user/lib/stdlib.c new file mode 100644 index 0000000..6018d16 --- /dev/null +++ b/src/user/lib/stdlib.c @@ -0,0 +1,32 @@ +#include <camellia/syscalls.h> +#include <camellia/flags.h> +#include <errno.h> +#include <string.h> + +_Noreturn void abort(void) { + _syscall_exit(1); +} + +int mkstemp(char *template) { + // TODO randomize template + handle_t h = _syscall_open(template, strlen(template), OPEN_CREATE); + if (h < 0) { + errno = -h; + return -1; + } + // TODO truncate + return h; +} + +// TODO process env +char *getenv(const char *name) { + (void)name; + return NULL; +} + +// TODO system() +int system(const char *cmd) { + (void)cmd; + errno = ENOSYS; + return -1; +} |