From 4508e099ff07dd8df1f33a8b00afb122eda27256 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 2 Dec 2024 04:01:51 +0200 Subject: [PATCH] LibC: Implement getpagesize --- userspace/libraries/LibC/include/unistd.h | 2 ++ userspace/libraries/LibC/unistd.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/userspace/libraries/LibC/include/unistd.h b/userspace/libraries/LibC/include/unistd.h index fed6cadd..ad854514 100644 --- a/userspace/libraries/LibC/include/unistd.h +++ b/userspace/libraries/LibC/include/unistd.h @@ -233,6 +233,8 @@ int unlinkat(int fd, const char* path, int flag); int usleep(useconds_t usec); ssize_t write(int fildes, const void* buf, size_t nbyte); +int getpagesize(void); + extern char* optarg; extern int opterr, optind, optopt; diff --git a/userspace/libraries/LibC/unistd.cpp b/userspace/libraries/LibC/unistd.cpp index 48c04bad..da59d044 100644 --- a/userspace/libraries/LibC/unistd.cpp +++ b/userspace/libraries/LibC/unistd.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -448,6 +449,11 @@ int getopt(int argc, char* const argv[], const char* optstring) return '?'; } +int getpagesize(void) +{ + return PAGE_SIZE; +} + pid_t getpid(void) { return syscall(SYS_GET_PID);