diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index 41715a6e15..b5a8b0541b 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -5,7 +5,9 @@ set(LIBC_SOURCES dirent.cpp fcntl.cpp grp.cpp + locale.cpp malloc.cpp + math.cpp netdb.cpp printf_impl.cpp pwd.cpp @@ -25,7 +27,6 @@ set(LIBC_SOURCES termios.cpp time.cpp unistd.cpp - math.cpp icxxabi.cpp ../../../BAN/BAN/Assert.cpp diff --git a/userspace/libraries/LibC/locale.cpp b/userspace/libraries/LibC/locale.cpp new file mode 100644 index 0000000000..c4ba8bbbb3 --- /dev/null +++ b/userspace/libraries/LibC/locale.cpp @@ -0,0 +1,15 @@ +#include +#include + +// FIXME: Actually support locales +char* setlocale(int category, const char* locale) +{ + (void)category; + + static char s_locale[] = "C"; + if (locale == nullptr) + return s_locale; + if (strcmp(locale, "") == 0 || strcmp(locale, "C") == 0 || strcmp(locale, "POSIX") == 0) + return s_locale; + return nullptr; +}