diff --git a/include/unistd.h b/include/unistd.h index 0f132f4df0..c4460ebb7f 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 6da23940f9..0c3b613818 100644 --- a/libs/libc/unistd/lib_sysconf.c +++ b/libs/libc/unistd/lib_sysconf.c @@ -241,6 +241,13 @@ long sysconf(int name) return 1; #endif + case _SC_PAGESIZE: +#ifdef CONFIG_MM_PGSIZE + return CONFIG_MM_PGSIZE; +#else + return 1; +#endif + default: #if 0 /* Assume valid but not implemented for the time being */ errcode = EINVAL;