annotate src/getpagesize.h @ 64:a01e7a40045c r19-16-pre7

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