From 4ae57a7fb13e68c5e6f1c1246a867555dbd986db Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 29 Aug 2022 13:57:47 +0200 Subject: user/lua: implement the bare minimum for it to link and "run" --- src/user/lib/stdio/misc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/user/lib/stdio/misc.c') 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 #include +#include +#include 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; +} -- cgit v1.2.3