diff --git a/libc/bionic/sysconf.cpp b/libc/bionic/sysconf.cpp index c301b27b3..61039b2af 100644 --- a/libc/bionic/sysconf.cpp +++ b/libc/bionic/sysconf.cpp @@ -98,7 +98,8 @@ long sysconf(int name) { case _SC_IOV_MAX: return UIO_MAXIOV; case _SC_PAGESIZE: // Fall through, PAGESIZE and PAGE_SIZE always hold the same value. - case _SC_PAGE_SIZE: return PAGE_SIZE; + case _SC_PAGE_SIZE: return static_cast(getauxval(AT_PAGESZ)); + case _SC_XOPEN_UNIX: return _XOPEN_UNIX; case _SC_AIO_LISTIO_MAX: return _POSIX_AIO_LISTIO_MAX; // Minimum requirement. case _SC_AIO_MAX: return _POSIX_AIO_MAX; // Minimum requirement. diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index 79c16d7eb..b29c6f314 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -694,6 +694,8 @@ TEST(unistd, sysconf) { VERIFY_SYSCONF_POSITIVE(_SC_IOV_MAX); VERIFY_SYSCONF_POSITIVE(_SC_PAGESIZE); VERIFY_SYSCONF_POSITIVE(_SC_PAGE_SIZE); + VerifySysconf(_SC_PAGE_SIZE, "_SC_PAGE_SIZE", + [](long v){return v == sysconf(_SC_PAGESIZE) && v == getpagesize();}); VERIFY_SYSCONF_POSITIVE(_SC_XOPEN_UNIX); VERIFY_SYSCONF_POSITIVE(_SC_AIO_LISTIO_MAX); VERIFY_SYSCONF_POSITIVE(_SC_AIO_MAX);