diff options
author | dzwdz | 2022-08-29 13:57:47 +0200 |
---|---|---|
committer | dzwdz | 2022-08-29 13:58:02 +0200 |
commit | 4ae57a7fb13e68c5e6f1c1246a867555dbd986db (patch) | |
tree | 3bee7f7eee21e9f2ed3b9f07dd1671a1c230cf66 /src/user/lib/stdio/misc.c | |
parent | edb7fc07bf93e4a1883cccf45ad7a4b2cbf390d9 (diff) |
user/lua: implement the bare minimum for it to link and "run"
Diffstat (limited to 'src/user/lib/stdio/misc.c')
-rw-r--r-- | src/user/lib/stdio/misc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/user/lib/stdio/misc.c b/src/user/lib/stdio/misc.c index 8f872ec..d74c197 100644 --- a/src/user/lib/stdio/misc.c +++ b/src/user/lib/stdio/misc.c @@ -1,5 +1,7 @@ #include <errno.h> #include <stdio.h> +#include <string.h> +#include <unistd.h> void perror(const char *s) { if (s) fprintf(stderr, "%s: ", s); @@ -23,3 +25,22 @@ off_t lseek(int fd, off_t off, int whence) { errno = ENOSYS; return -1; } + +int remove(const char *path) { + return unlink(path); +} + +// TODO! VFSOP_MOVE +int rename(const char *old, const char *new) { + (void)old; (void)new; + errno = ENOSYS; + return -1; +} + +// TODO tmpnam +char *tmpnam(char *s) { + static char buf[L_tmpnam]; + if (!s) s = buf; + strcpy(s, "/tmp/tmpnam"); + return s; +} |