Partially sync files.el from XEmacs 21.5 for wildcard support.
[sxemacs] / src / ui / getpagesize.h
1 /*
2 This file is part of SXEmacs
3
4 SXEmacs is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 SXEmacs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 /* Synched up with: FSF 19.30. */
19
20 #ifndef INCLUDED_getpagesize_h_
21 #define INCLUDED_getpagesize_h_
22
23 /* Emulate getpagesize on systems that lack it.  */
24
25 #if 0
26 #ifdef __hpux
27 #include <sys/types.h>
28 static size_t getpagesize()
29 {
30         return (4096);
31 }
32
33 #define HAVE_GETPAGESIZE
34 #endif
35 #endif
36
37 #ifndef HAVE_GETPAGESIZE
38
39 #ifdef HAVE_UNISTD_H
40 #include <unistd.h>
41 #endif
42
43 #ifdef _SC_PAGESIZE
44 #define getpagesize() sysconf(_SC_PAGESIZE)
45 #else
46
47 #include <sys/param.h>
48
49 #ifdef EXEC_PAGESIZE
50 #define getpagesize() EXEC_PAGESIZE
51 #else
52 #ifdef NBPG
53 #define getpagesize() NBPG * CLSIZE
54 #ifndef CLSIZE
55 #define CLSIZE 1
56 #endif                          /* no CLSIZE */
57 #else                           /* no NBPG */
58 #if (defined (sparc) && defined (USG)) || defined (SOLARIS2)
59 #define getpagesize() PAGESIZE
60 #else                           /* not Solaris 2 */
61 #ifdef NBPC
62 #define getpagesize() NBPC
63 #else                           /* no NBPC */
64 #ifdef PAGESIZE
65 #define getpagesize() PAGESIZE
66 #endif
67 #endif                          /* NBPC */
68 #endif                          /* not Solaris 2 */
69 #endif                          /* no NBPG */
70 #endif                          /* no EXEC_PAGESIZE */
71 #endif                          /* _SC_PAGESIZE */
72 #endif                          /* not HAVE_GETPAGESIZE */
73
74 #endif                          /* INCLUDED_getpagesize_h_ */