From e636991c7867e0b38b3d66c4c6d430e5cc603aa9 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 6 Aug 2025 12:51:34 +0200 Subject: [PATCH] prefer _SC_PAGESIZE over _SC_PAGE_SIZE The POSIX spec says that_SC_PAGE_SIZE is a synonym for _SC_PAGESIZE, and both will have the same value. Let's be consistent in which one we use, and let's use the one that points directly to the authoritative documentation. Acked-by: Lionel Landwerlin Reviewed-by: Eric Engestrom Part-of: --- src/drm-shim/device.c | 2 +- src/util/os_misc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drm-shim/device.c b/src/drm-shim/device.c index c5be29b0f07..7dfe85b6a56 100644 --- a/src/drm-shim/device.c +++ b/src/drm-shim/device.c @@ -103,7 +103,7 @@ drm_shim_device_init(void) * with EINVAL. */ - shim_page_size = sysconf(_SC_PAGE_SIZE); + shim_page_size = sysconf(_SC_PAGESIZE); util_vma_heap_init(&shim_device.mem_heap, shim_page_size, SHIM_MEM_SIZE - shim_page_size); diff --git a/src/util/os_misc.c b/src/util/os_misc.c index 4b7916634b3..0689fec920c 100644 --- a/src/util/os_misc.c +++ b/src/util/os_misc.c @@ -286,7 +286,7 @@ os_get_total_physical_memory(uint64_t *size) { #if DETECT_OS_LINUX || DETECT_OS_CYGWIN || DETECT_OS_SOLARIS || DETECT_OS_HURD || DETECT_OS_MANAGARM const long phys_pages = sysconf(_SC_PHYS_PAGES); - const long page_size = sysconf(_SC_PAGE_SIZE); + const long page_size = sysconf(_SC_PAGESIZE); if (phys_pages <= 0 || page_size <= 0) return false; @@ -413,7 +413,7 @@ bool os_get_page_size(uint64_t *size) { #if DETECT_OS_POSIX_LITE && !DETECT_OS_APPLE && !DETECT_OS_HAIKU - const long page_size = sysconf(_SC_PAGE_SIZE); + const long page_size = sysconf(_SC_PAGESIZE); if (page_size <= 0) return false;