From 4d96ae56acb3455dcedf9f1d0a65b9c753909e1d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 5 Aug 2024 01:48:24 +0300 Subject: [PATCH] LibC: Add stubs for ungetc(), tcflush() and symlink() --- userspace/libraries/LibC/stdio.cpp | 7 +++++-- userspace/libraries/LibC/termios.cpp | 9 ++++++++- userspace/libraries/LibC/unistd.cpp | 8 ++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/userspace/libraries/LibC/stdio.cpp b/userspace/libraries/LibC/stdio.cpp index 6a68f1136b..452c93a2bb 100644 --- a/userspace/libraries/LibC/stdio.cpp +++ b/userspace/libraries/LibC/stdio.cpp @@ -705,8 +705,11 @@ char* tmpnam(char* storage) return storage; } -// TODO -int ungetc(int, FILE*); +int ungetc(int c, FILE* stream) +{ + dwarnln("FIXME: ungetc({}, {})", c, stream); + ASSERT_NOT_REACHED(); +} int vfprintf(FILE* file, const char* format, va_list arguments) { diff --git a/userspace/libraries/LibC/termios.cpp b/userspace/libraries/LibC/termios.cpp index e2b749ddec..b81c9ecb1b 100644 --- a/userspace/libraries/LibC/termios.cpp +++ b/userspace/libraries/LibC/termios.cpp @@ -1,3 +1,6 @@ +#include +#include + #include #include #include @@ -65,7 +68,11 @@ int tcdrain(int); int tcflow(int, int); -int tcflush(int, int); +int tcflush(int fd, int queue_selector) +{ + dwarnln("FIXME: tcflush({}, {})", fd, queue_selector); + ASSERT_NOT_REACHED(); +} int tcgetattr(int fildes, struct termios* termios) { diff --git a/userspace/libraries/LibC/unistd.cpp b/userspace/libraries/LibC/unistd.cpp index d3afcfbf60..3ae50e085b 100644 --- a/userspace/libraries/LibC/unistd.cpp +++ b/userspace/libraries/LibC/unistd.cpp @@ -1,5 +1,7 @@ #include +#include #include + #include #include #include @@ -534,3 +536,9 @@ unsigned alarm(unsigned seconds) setitimer(ITIMER_REAL, &value, &ovalue); return ovalue.it_value.tv_sec; } + +int symlink(const char* path1, const char* path2) +{ + dwarnln("FIXME: symlink({}, {})", path1, path2); + ASSERT_NOT_REACHED(); +}