1 #ifdef BSD 2 #ifndef BSD4_1 3 #define HAVE_GETPAGESIZE 4 #endif 5 #endif 6 7 #ifndef HAVE_GETPAGESIZE 8 9 #ifdef VMS 10 #define getpagesize() 512 11 #endif 12 13 #ifdef HAVE_UNISTD_H 14 #include <unistd.h> 15 #endif 16 17 #ifdef _SC_PAGESIZE 18 #define getpagesize() sysconf(_SC_PAGESIZE) 19 #else 20 21 #include <sys/param.h> 22 23 #ifdef EXEC_PAGESIZE 24 #define getpagesize() EXEC_PAGESIZE 25 #else 26 #ifdef NBPG 27 #define getpagesize() NBPG * CLSIZE 28 #ifndef CLSIZE 29 #define CLSIZE 1 30 #endif /* no CLSIZE */ 31 #else /* no NBPG */ 32 #define getpagesize() NBPC 33 #endif /* no NBPG */ 34 #endif /* no EXEC_PAGESIZE */ 35 #endif /* no _SC_PAGESIZE */ 36 37 #endif /* not HAVE_GETPAGESIZE */ 38 39