summaryrefslogtreecommitdiff
path: root/libc/test/src/sys/mman/linux/msync_test.cpp
diff options
context:
space:
mode:
authorMichael Jones <michaelrj@google.com>2025-10-06 15:44:48 -0700
committerGitHub <noreply@github.com>2025-10-06 15:44:48 -0700
commit3b9ec9543695c04c3793e5adfa1a6d19af3a2eb3 (patch)
treefaeae1fa9de0e1abbaf51ae744360d35d6f6f362 /libc/test/src/sys/mman/linux/msync_test.cpp
parent4f63a60e5c99cdb866bae1300447e9c0c466aebc (diff)
[libc] Simplify mman tests (#161748)
Previously they called sysconf and capget. Those were blocking adding bazel rules for those tests since sysconf isn't done.
Diffstat (limited to 'libc/test/src/sys/mman/linux/msync_test.cpp')
-rw-r--r--libc/test/src/sys/mman/linux/msync_test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/test/src/sys/mman/linux/msync_test.cpp b/libc/test/src/sys/mman/linux/msync_test.cpp
index b4eedb3baeac..764a67d02e3b 100644
--- a/libc/test/src/sys/mman/linux/msync_test.cpp
+++ b/libc/test/src/sys/mman/linux/msync_test.cpp
@@ -11,11 +11,13 @@
#include "src/sys/mman/msync.h"
#include "src/sys/mman/munlock.h"
#include "src/sys/mman/munmap.h"
-#include "src/unistd/sysconf.h"
#include "test/UnitTest/ErrnoCheckingTest.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
+// TODO: Replace with sysconf call once the function is properly implemented.
+constexpr size_t PAGE_SIZE = 4096;
+
using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
using LlvmLibcMsyncTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
@@ -24,7 +26,7 @@ struct PageHolder {
void *addr;
PageHolder()
- : size(LIBC_NAMESPACE::sysconf(_SC_PAGESIZE)),
+ : size(PAGE_SIZE),
addr(LIBC_NAMESPACE::mmap(nullptr, size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)) {}
~PageHolder() {