1 /* Some OS-dependent utility code */
6 #include <X11/Xosdefs.h>
7 #include <X11/IntrinsicP.h>
11 #include <unistd.h> /* for sysconf(), and getpagesize() */
15 /* kernel header doesn't work with -ansi */
16 /* #include <asm/page.h> *//* for PAGE_SIZE */
17 #define HAS_GETPAGESIZE
18 #define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
21 #if defined(CSRG_BASED)
22 #define HAS_GETPAGESIZE
26 #define HAS_GETPAGESIZE
32 static int pagesize = -1;
37 /* Try each supported method in the preferred order */
39 #if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE)
40 pagesize = sysconf(_SC_PAGESIZE);
45 pagesize = sysconf(_SC_PAGE_SIZE);
48 #ifdef HAS_GETPAGESIZE
50 pagesize = getpagesize();