File: omGetPageSize.h

package info (click to toggle)
singular 1%3A4.0.3-p3%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 33,040 kB
  • ctags: 19,347
  • sloc: cpp: 271,589; ansic: 13,500; lisp: 4,242; yacc: 1,656; lex: 1,377; makefile: 1,264; perl: 632; sh: 467; python: 233; xml: 182
file content (46 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*******************************************************************
 *  File:    omGetPageSize.h
 *  Purpose: figure out how to get the pagesize
 *  This is adapted from dlmalloc's mechanisms which in fact derived it from
 *  bsd/gnu getpagesize.h
 *******************************************************************/
#include <unistd.h>

#ifndef omalloc_getpagesize
#  ifdef _SC_PAGESIZE         /* some SVR4 systems omit an underscore */
#    ifndef _SC_PAGE_SIZE
#      define _SC_PAGE_SIZE _SC_PAGESIZE
#    endif
#  endif
#  ifdef _SC_PAGE_SIZE
#    define omalloc_getpagesize sysconf(_SC_PAGE_SIZE)
#  else
#    if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
       extern size_t getpagesize();
#      define omalloc_getpagesize getpagesize()
#    else
#      include <sys/param.h>
#      ifdef EXEC_PAGESIZE
#        define omalloc_getpagesize EXEC_PAGESIZE
#      else
#        ifdef NBPG
#          ifndef CLSIZE
#            define omalloc_getpagesize NBPG
#          else
#            define omalloc_getpagesize (NBPG * CLSIZE)
#          endif
#        else
#          ifdef NBPC
#            define omalloc_getpagesize NBPC
#          else
#            ifdef PAGESIZE
#              define omalloc_getpagesize PAGESIZE
#            else
#              define omalloc_getpagesize (4096) /* just guess */
#            endif
#          endif
#        endif
#      endif
#    endif
#  endif
#endif