0
|
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 HAVE_UNISTD_H
|
|
33 #include <unistd.h>
|
|
34 #endif
|
|
35
|
|
36 #ifdef _SC_PAGESIZE
|
|
37 #define getpagesize() sysconf(_SC_PAGESIZE)
|
|
38 #else
|
|
39
|
|
40 #include <sys/param.h>
|
|
41
|
|
42 #ifdef EXEC_PAGESIZE
|
|
43 #define getpagesize() EXEC_PAGESIZE
|
|
44 #else
|
|
45 #ifdef NBPG
|
|
46 #define getpagesize() NBPG * CLSIZE
|
|
47 #ifndef CLSIZE
|
|
48 #define CLSIZE 1
|
|
49 #endif /* no CLSIZE */
|
|
50 #else /* no NBPG */
|
|
51 #if (defined (sparc) && defined (USG)) || defined (SOLARIS2)
|
|
52 #define getpagesize() PAGESIZE
|
|
53 #else /* not Solaris 2 */
|
|
54 #ifdef NBPC
|
|
55 #define getpagesize() NBPC
|
|
56 #else /* no NBPC */
|
|
57 #ifdef PAGESIZE
|
|
58 #define getpagesize() PAGESIZE
|
|
59 #endif
|
|
60 #endif /* NBPC */
|
|
61 #endif /* not Solaris 2 */
|
|
62 #endif /* no NBPG */
|
|
63 #endif /* no EXEC_PAGESIZE */
|
|
64 #endif /* _SC_PAGESIZE */
|
|
65 #endif /* not HAVE_GETPAGESIZE */
|
|
66
|