1 /* Emulate getpagesize on systems that lack it.
2 Copyright (C) 1986, 1992, 1995, 2001 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 2, or (at your option)
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; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #ifndef HAVE_GETPAGESIZE
24 # define getpagesize() 512
32 # define getpagesize() sysconf(_SC_PAGESIZE)
33 # else /* no _SC_PAGESIZE */
34 # ifdef HAVE_SYS_PARAM_H
35 # include <sys/param.h>
37 # define getpagesize() EXEC_PAGESIZE
38 # else /* no EXEC_PAGESIZE */
40 # define getpagesize() NBPG * CLSIZE
43 # endif /* no CLSIZE */
46 # define getpagesize() NBPC
49 # define getpagesize() PAGESIZE
50 # endif /* PAGESIZE */
53 # endif /* no EXEC_PAGESIZE */
54 # else /* no HAVE_SYS_PARAM_H */
55 # define getpagesize() 8192 /* punt totally */
56 # endif /* no HAVE_SYS_PARAM_H */
57 # endif /* no _SC_PAGESIZE */
59 #endif /* no HAVE_GETPAGESIZE */