*** empty log message ***
[bpt/emacs.git] / src / getpagesize.h
CommitLineData
b3ae7a0a
GM
1/* Emulate getpagesize on systems that lack it.
2 Copyright (C) 1986, 1992, 1995, 2001 Free Software Foundation, Inc.
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
bac7913a
RM
20
21#ifndef HAVE_GETPAGESIZE
22
eb93fe6a
DM
23# ifdef VMS
24# define getpagesize() 512
25# endif
bac7913a 26
eb93fe6a
DM
27# ifdef HAVE_UNISTD_H
28# include <unistd.h>
29# endif
bac7913a 30
eb93fe6a
DM
31# ifdef _SC_PAGESIZE
32# define getpagesize() sysconf(_SC_PAGESIZE)
4b45d671
DM
33# else /* no _SC_PAGESIZE */
34# ifdef HAVE_SYS_PARAM_H
35# include <sys/param.h>
36# ifdef EXEC_PAGESIZE
37# define getpagesize() EXEC_PAGESIZE
38# else /* no EXEC_PAGESIZE */
39# ifdef NBPG
40# define getpagesize() NBPG * CLSIZE
41# ifndef CLSIZE
42# define CLSIZE 1
43# endif /* no CLSIZE */
44# else /* no NBPG */
45# ifdef NBPC
46# define getpagesize() NBPC
47# else /* no NBPC */
48# ifdef PAGESIZE
49# define getpagesize() PAGESIZE
50# endif /* PAGESIZE */
51# endif /* no NBPC */
52# endif /* no NBPG */
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 */
eb93fe6a 57# endif /* no _SC_PAGESIZE */
bac7913a 58
eb93fe6a 59#endif /* no HAVE_GETPAGESIZE */