From 04b8f9d7a34c2bf593cb0b33042061319ffb19f2 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 8 Aug 2026 03:44:27 +0300 Subject: [PATCH] LibC: Fix stdc++ requirement in getpagesize --- userspace/libraries/LibC/unistd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/userspace/libraries/LibC/unistd.cpp b/userspace/libraries/LibC/unistd.cpp index 69ade0ba..89dc4d5c 100644 --- a/userspace/libraries/LibC/unistd.cpp +++ b/userspace/libraries/LibC/unistd.cpp @@ -676,7 +676,9 @@ int chroot(const char* path) int getpagesize(void) { - static int auxv_page_size = getauxval(AT_PAGESZ); + static int auxv_page_size = -1; + if (auxv_page_size == -1) + auxv_page_size = getauxval(AT_PAGESZ); if (auxv_page_size) return auxv_page_size; return PAGE_SIZE;