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