Commit | Line | Data |
---|---|---|
b3ae7a0a | 1 | /* Emulate getpagesize on systems that lack it. |
ba318903 | 2 | Copyright (C) 1986, 1992, 1995, 2001-2014 Free Software Foundation, |
ab422c4d | 3 | Inc. |
b3ae7a0a GM |
4 | |
5 | This file is part of GNU Emacs. | |
6 | ||
b9b1cc14 | 7 | GNU Emacs is free software: you can redistribute it and/or modify |
b3ae7a0a | 8 | it under the terms of the GNU General Public License as published by |
b9b1cc14 GM |
9 | the Free Software Foundation, either version 3 of the License, or |
10 | (at your option) any later version. | |
b3ae7a0a GM |
11 | |
12 | GNU Emacs is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
b9b1cc14 | 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
bac7913a RM |
19 | |
20 | #ifndef HAVE_GETPAGESIZE | |
21 | ||
4004364e | 22 | # include <unistd.h> |
bac7913a | 23 | |
eb93fe6a | 24 | # ifdef _SC_PAGESIZE |
5e617bc2 | 25 | # define getpagesize() sysconf (_SC_PAGESIZE) |
4b45d671 DM |
26 | # else /* no _SC_PAGESIZE */ |
27 | # ifdef HAVE_SYS_PARAM_H | |
28 | # include <sys/param.h> | |
29 | # ifdef EXEC_PAGESIZE | |
30 | # define getpagesize() EXEC_PAGESIZE | |
31 | # else /* no EXEC_PAGESIZE */ | |
32 | # ifdef NBPG | |
33 | # define getpagesize() NBPG * CLSIZE | |
34 | # ifndef CLSIZE | |
35 | # define CLSIZE 1 | |
36 | # endif /* no CLSIZE */ | |
37 | # else /* no NBPG */ | |
4b45d671 DM |
38 | # ifdef PAGESIZE |
39 | # define getpagesize() PAGESIZE | |
40 | # endif /* PAGESIZE */ | |
4b45d671 DM |
41 | # endif /* no NBPG */ |
42 | # endif /* no EXEC_PAGESIZE */ | |
43 | # else /* no HAVE_SYS_PARAM_H */ | |
44 | # define getpagesize() 8192 /* punt totally */ | |
45 | # endif /* no HAVE_SYS_PARAM_H */ | |
eb93fe6a | 46 | # endif /* no _SC_PAGESIZE */ |
bac7913a | 47 | |
eb93fe6a | 48 | #endif /* no HAVE_GETPAGESIZE */ |
ab5796a9 | 49 |