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/file.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/user/lib/stdio/file.c') diff --git a/src/user/lib/stdio/file.c b/src/user/lib/stdio/file.c index 63b004d..8c0fc57 100644 --- a/src/user/lib/stdio/file.c +++ b/src/user/lib/stdio/file.c @@ -1,11 +1,12 @@ #include "file.h" -#include #include +#include #include #include #include #include #include +#include static FILE _stdin_null = { .fd = STDIN_FILENO }; static FILE _stdout_null = { .fd = STDOUT_FILENO }; @@ -124,6 +125,13 @@ int pclose(FILE *f) { return -1; } +// TODO tmpfile() +FILE *tmpfile(void) { + errno = ENOSYS; + return NULL; +} + + int fextflags(FILE *f, int extflags) { int old = f->extflags; f->extflags = extflags; @@ -227,6 +235,12 @@ int fputc(int c, FILE *f) { } int putc(int c, FILE *f) { return fputc(c, f); } +// TODO ungetc +int ungetc(int c, FILE *f) { + (void)c; (void)f; + __libc_panic("unimplemented"); +} + int fseek(FILE *f, long offset, int whence) { return fseeko(f, offset, whence); } -- cgit v1.2.3