From 1a8351eae0f5124100dfbb4fc607c17856ac9a86 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 5 Aug 2026 05:41:31 +0300 Subject: [PATCH] LibC: Cache page size in getpagesize --- userspace/libraries/LibC/unistd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/userspace/libraries/LibC/unistd.cpp b/userspace/libraries/LibC/unistd.cpp index 80052449..69ade0ba 100644 --- a/userspace/libraries/LibC/unistd.cpp +++ b/userspace/libraries/LibC/unistd.cpp @@ -676,8 +676,9 @@ int chroot(const char* path) int getpagesize(void) { - if (auto value = getauxval(AT_PAGESZ)) - return value; + static int auxv_page_size = getauxval(AT_PAGESZ); + if (auxv_page_size) + return auxv_page_size; return PAGE_SIZE; }