[libc-commits] [libc] libc: Introduce calls to sysconf to get page size. (PR #163462)

Peter Collingbourne via libc-commits libc-commits at lists.llvm.org
Tue Oct 14 17:04:21 PDT 2025


================
@@ -16,12 +16,13 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
+#include <unistd.h>
+
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
 using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
 using LlvmLibcMincoreTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
 
-// TODO: Replace with sysconf call once the function is properly implemented.
-constexpr size_t PAGE_SIZE = 4096;
+const size_t PAGE_SIZE = sysconf(_SC_PAGESIZE);
----------------
pcc wrote:

Done

https://github.com/llvm/llvm-project/pull/163462


More information about the libc-commits mailing list