diff --git a/include/unistd.h b/include/unistd.h index 0f132f4df01..c4460ebb7fb 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -274,6 +274,7 @@ #define link(p1, p2) symlink((p1), (p2)) #define fdatasync(f) fsync(f) #define getdtablesize(f) ((int)sysconf(_SC_OPEN_MAX)) +#define getpagesize(f) ((int)sysconf(_SC_PAGESIZE)) /**************************************************************************** * Public Data diff --git a/libs/libc/unistd/lib_sysconf.c b/libs/libc/unistd/lib_sysconf.c index 6da23940f9e..aebedc34c3d 100644 --- a/libs/libc/unistd/lib_sysconf.c +++ b/libs/libc/unistd/lib_sysconf.c @@ -241,6 +241,14 @@ long sysconf(int name) return 1; #endif + case _SC_PAGESIZE: +#ifdef CONFIG_MM_PGSIZE + return CONFIG_MM_PGSIZE; +#else +#define PAGESIZE 4096 + return PAGESIZE; +#endif + default: #if 0 /* Assume valid but not implemented for the time being */ errcode = EINVAL;