From: Marcus Holland-Moritz Date: Sun, 12 Aug 2007 13:16:52 +0000 (+0200) Subject: Use sysconf/getpagesize/page.h to determine page size on Linux, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b57863ed0a63d5542d95689d8dfafc42a3c5f522;p=p5sagit%2Fp5-mst-13.2.git 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 --- 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