[libc-commits] [libc] libc: Introduce calls to sysconf to get page size. (PR #163462)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Tue Oct 14 15:21:34 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);
----------------
michaelrj-google wrote:
you need to call the sysconf in the LLVM-libc namespace.
```suggestion
const size_t PAGE_SIZE = LIBC_NAMESPACE::sysconf(_SC_PAGESIZE);
```
https://github.com/llvm/llvm-project/pull/163462
More information about the libc-commits
mailing list