[v3,26/29] Linux: Optimize getpagesize using <sys/pagesize.h>

Message ID a4b61975d55c0ea13d3251391cde52bc9632dbdc.1727624528.git.fweimer@redhat.com
State Under Review
Delegated to: Adhemerval Zanella Netto
Headers
Series Teach glibc about possible page sizes and handle gaps in ld.so |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm fail Test failed

Commit Message

Florian Weimer Sept. 29, 2024, 4:44 p.m. UTC
  ---
 sysdeps/unix/sysv/linux/getpagesize.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/sysdeps/unix/sysv/linux/getpagesize.c b/sysdeps/unix/sysv/linux/getpagesize.c
index dd5e6fcf6c..dec68b3200 100644
--- a/sysdeps/unix/sysv/linux/getpagesize.c
+++ b/sysdeps/unix/sysv/linux/getpagesize.c
@@ -17,6 +17,7 @@ 
 
 #include <assert.h>
 #include <unistd.h>
+#include <sys/pagesize.h>
 #include <sys/param.h>
 
 #include <ldsodefs.h>
@@ -25,8 +26,12 @@ 
 int
 __getpagesize (void)
 {
+#if PAGE_SIZE_MIN == PAGE_SIZE_MAX
+  return PAGE_SIZE_MIN;
+#else
   assert (GLRO(dl_pagesize) != 0);
   return GLRO(dl_pagesize);
+#endif
 }
 libc_hidden_def (__getpagesize)
 weak_alias (__getpagesize, getpagesize)