1 /* Emulate getpagesize on systems that lack it.
2 Copyright (C) 1986, 1992, 1995, 2001-2012 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 #ifndef HAVE_GETPAGESIZE
24 # define getpagesize() sysconf (_SC_PAGESIZE)
25 # else /* no _SC_PAGESIZE */
26 # ifdef HAVE_SYS_PARAM_H
27 # include <sys/param.h>
29 # define getpagesize() EXEC_PAGESIZE
30 # else /* no EXEC_PAGESIZE */
32 # define getpagesize() NBPG * CLSIZE
35 # endif /* no CLSIZE */
38 # define getpagesize() PAGESIZE
39 # endif /* PAGESIZE */
41 # endif /* no EXEC_PAGESIZE */
42 # else /* no HAVE_SYS_PARAM_H */
43 # define getpagesize() 8192 /* punt totally */
44 # endif /* no HAVE_SYS_PARAM_H */
45 # endif /* no _SC_PAGESIZE */
47 #endif /* no HAVE_GETPAGESIZE */