comparison src/getpagesize.h @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 41ff10fd062f
comparison
equal deleted inserted replaced
-1:000000000000 0:376386a54a3c
1 /* This file is part of XEmacs.
2
3 XEmacs is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 XEmacs is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with XEmacs; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. */
17
18 /* Synched up with: FSF 19.30. */
19
20 /* Emulate getpagesize on systems that lack it. */
21
22 #if 0
23 #ifdef __hpux
24 #include <sys/types.h>
25 static size_t getpagesize() { return( 4096 ); }
26 #define HAVE_GETPAGESIZE
27 #endif
28 #endif
29
30 #ifndef HAVE_GETPAGESIZE
31
32 #ifdef VMS
33 #define getpagesize() 512
34 #endif
35
36 #ifdef HAVE_UNISTD_H
37 #include <unistd.h>
38 #endif
39
40 #ifdef _SC_PAGESIZE
41 #define getpagesize() sysconf(_SC_PAGESIZE)
42 #else
43
44 #include <sys/param.h>
45
46 #ifdef EXEC_PAGESIZE
47 #define getpagesize() EXEC_PAGESIZE
48 #else
49 #ifdef NBPG
50 #define getpagesize() NBPG * CLSIZE
51 #ifndef CLSIZE
52 #define CLSIZE 1
53 #endif /* no CLSIZE */
54 #else /* no NBPG */
55 #if (defined (sparc) && defined (USG)) || defined (SOLARIS2)
56 #define getpagesize() PAGESIZE
57 #else /* not Solaris 2 */
58 #ifdef NBPC
59 #define getpagesize() NBPC
60 #else /* no NBPC */
61 #ifdef PAGESIZE
62 #define getpagesize() PAGESIZE
63 #endif
64 #endif /* NBPC */
65 #endif /* not Solaris 2 */
66 #endif /* no NBPG */
67 #endif /* no EXEC_PAGESIZE */
68 #endif /* _SC_PAGESIZE */
69 #endif /* not HAVE_GETPAGESIZE */
70