From 2797fe116f9e17434ca8e7c66ae499291482f8bc Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 9 Aug 2024 17:01:41 +0300 Subject: [PATCH] LibC: Add stubs for some functions in {dlfcn,ftw,utime,wchar}.h --- userspace/libraries/LibC/CMakeLists.txt | 4 ++++ userspace/libraries/LibC/dlfcn.cpp | 23 +++++++++++++++++++++++ userspace/libraries/LibC/ftw.cpp | 13 +++++++++++++ userspace/libraries/LibC/utime.cpp | 8 ++++++++ userspace/libraries/LibC/wchar.cpp | 8 ++++++++ 5 files changed, 56 insertions(+) create mode 100644 userspace/libraries/LibC/dlfcn.cpp create mode 100644 userspace/libraries/LibC/ftw.cpp create mode 100644 userspace/libraries/LibC/utime.cpp create mode 100644 userspace/libraries/LibC/wchar.cpp diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index 5105a70b..8f4f73f5 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -3,7 +3,9 @@ set(LIBC_SOURCES assert.cpp ctype.cpp dirent.cpp + dlfcn.cpp fcntl.cpp + ftw.cpp grp.cpp inttypes.cpp locale.cpp @@ -31,6 +33,8 @@ set(LIBC_SOURCES termios.cpp time.cpp unistd.cpp + utime.cpp + wchar.cpp icxxabi.cpp arch/${BANAN_ARCH}/setjmp.S diff --git a/userspace/libraries/LibC/dlfcn.cpp b/userspace/libraries/LibC/dlfcn.cpp new file mode 100644 index 00000000..e1dc052c --- /dev/null +++ b/userspace/libraries/LibC/dlfcn.cpp @@ -0,0 +1,23 @@ +#include + +#include + +int dlclose(void*) +{ + ASSERT_NOT_REACHED(); +} + +char* dlerror(void) +{ + ASSERT_NOT_REACHED(); +} + +void* dlopen(const char*, int) +{ + ASSERT_NOT_REACHED(); +} + +void* dlsym(void* __restrict, const char* __restrict) +{ + ASSERT_NOT_REACHED(); +} diff --git a/userspace/libraries/LibC/ftw.cpp b/userspace/libraries/LibC/ftw.cpp new file mode 100644 index 00000000..ca428ffd --- /dev/null +++ b/userspace/libraries/LibC/ftw.cpp @@ -0,0 +1,13 @@ +#include + +#include + +int ftw(const char*, int (*)(const char*, const struct stat*, int), int) +{ + ASSERT_NOT_REACHED(); +} + +int nftw(const char*, int (*)(const char*, const struct stat*, int, struct FTW*), int, int) +{ + ASSERT_NOT_REACHED(); +} diff --git a/userspace/libraries/LibC/utime.cpp b/userspace/libraries/LibC/utime.cpp new file mode 100644 index 00000000..9112603b --- /dev/null +++ b/userspace/libraries/LibC/utime.cpp @@ -0,0 +1,8 @@ +#include + +#include + +int utime(const char*, const struct utimbuf*) +{ + ASSERT_NOT_REACHED(); +} diff --git a/userspace/libraries/LibC/wchar.cpp b/userspace/libraries/LibC/wchar.cpp new file mode 100644 index 00000000..81d42fc3 --- /dev/null +++ b/userspace/libraries/LibC/wchar.cpp @@ -0,0 +1,8 @@ +#include + +#include + +size_t mbrtowc(wchar_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict) +{ + ASSERT_NOT_REACHED(); +}