~ubuntu-branches/ubuntu/trusty/librep/trusty

« back to all changes in this revision

Viewing changes to src/getpagesize.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2001-11-13 15:06:22 UTC
  • Revision ID: james.westby@ubuntu.com-20011113150622-vgmgmk6srj3kldr3
Tags: upstream-0.15.2
ImportĀ upstreamĀ versionĀ 0.15.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Emulate getpagesize on systems that lack it.  */
 
2
 
 
3
#ifndef HAVE_GETPAGESIZE
 
4
 
 
5
# ifdef VMS
 
6
#  define getpagesize() 512
 
7
# endif
 
8
 
 
9
# ifdef HAVE_UNISTD_H
 
10
#  include <unistd.h>
 
11
# endif
 
12
 
 
13
# ifdef _SC_PAGESIZE
 
14
#  define getpagesize() sysconf(_SC_PAGESIZE)
 
15
# else /* no _SC_PAGESIZE */
 
16
#  ifdef HAVE_SYS_PARAM_H
 
17
#   include <sys/param.h>
 
18
#   ifdef EXEC_PAGESIZE
 
19
#    define getpagesize() EXEC_PAGESIZE
 
20
#   else /* no EXEC_PAGESIZE */
 
21
#    ifdef NBPG
 
22
#     define getpagesize() NBPG * CLSIZE
 
23
#     ifndef CLSIZE
 
24
#      define CLSIZE 1
 
25
#     endif /* no CLSIZE */
 
26
#    else /* no NBPG */
 
27
#     ifdef NBPC
 
28
#      define getpagesize() NBPC
 
29
#     else /* no NBPC */
 
30
#      ifdef PAGESIZE
 
31
#       define getpagesize() PAGESIZE
 
32
#      endif /* PAGESIZE */
 
33
#     endif /* no NBPC */
 
34
#    endif /* no NBPG */
 
35
#   endif /* no EXEC_PAGESIZE */
 
36
#  else /* no HAVE_SYS_PARAM_H */
 
37
#   define getpagesize() 8192   /* punt totally */
 
38
#  endif /* no HAVE_SYS_PARAM_H */
 
39
# endif /* no _SC_PAGESIZE */
 
40
 
 
41
#endif /* no HAVE_GETPAGESIZE */