From b57863ed0a63d5542d95689d8dfafc42a3c5f522 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sun, 12 Aug 2007 15:16:52 +0200 Subject: [PATCH] Use sysconf/getpagesize/page.h to determine page size on Linux, in that order. Subject: Re: [PATCH] Various Gentoo Patches Message-Id: <20070812131652.16ca5444@r2d2> p4raw-id: //depot/perl@31702 --- ext/IPC/SysV/SysV.xs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/IPC/SysV/SysV.xs b/ext/IPC/SysV/SysV.xs index d2b1ecb..1126711 100644 --- a/ext/IPC/SysV/SysV.xs +++ b/ext/IPC/SysV/SysV.xs @@ -3,9 +3,6 @@ #include "XSUB.h" #include -#ifdef __linux__ -# include -#endif #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM) #ifndef HAS_SEM # include @@ -21,9 +18,14 @@ # ifndef HAS_SHMAT_PROTOTYPE extern Shmat_t shmat (int, char *, int); # endif -# if defined(__sparc__) && (defined(__NetBSD__) || defined(__OpenBSD__)) +# if defined(HAS_SYSCONF) && defined(_SC_PAGESIZE) +# undef SHMLBA /* not static: determined at boot time */ +# define SHMLBA sysconf(_SC_PAGESIZE) +# elif defined(HAS_GETPAGESIZE) # undef SHMLBA /* not static: determined at boot time */ # define SHMLBA getpagesize() +# elif defined(__linux__) +# include # endif # endif #endif -- 2.7.4