diff options
Diffstat (limited to 'src/user/lib/stdlib.c')
-rw-r--r-- | src/user/lib/stdlib.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/user/lib/stdlib.c b/src/user/lib/stdlib.c index 6018d16..38e87ad 100644 --- a/src/user/lib/stdlib.c +++ b/src/user/lib/stdlib.c @@ -1,7 +1,8 @@ -#include <camellia/syscalls.h> #include <camellia/flags.h> +#include <camellia/syscalls.h> #include <errno.h> #include <string.h> +#include <user/lib/panic.h> _Noreturn void abort(void) { _syscall_exit(1); @@ -30,3 +31,16 @@ int system(const char *cmd) { errno = ENOSYS; return -1; } + +int abs(int i) { + return i < 0 ? -i : i; +} + +int atoi(const char *s) { + return strtol(s, NULL, 10); +} + +double atof(const char *s) { + (void)s; + __libc_panic("unimplemented"); +} |