source: git/omalloc/omGetPageSize.h @ 341696

spielwiese
Last change on this file since 341696 was 341696, checked in by Hans Schönemann <hannes@…>, 14 years ago
Adding Id property to all files git-svn-id: file:///usr/local/Singular/svn/trunk@12231 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*******************************************************************
2 *  File:    omGetPageSize.h
3 *  Purpose: figure out how to get the pagesize
4 *  This is adapted from dlmalloc's mechanisms which in fact derived it from
5 *  bsd/gnu getpagesize.h
6 *  Version: $Id$
7 *******************************************************************/
8#include <unistd.h>
9
10#ifndef omalloc_getpagesize
11#  ifdef _SC_PAGESIZE         /* some SVR4 systems omit an underscore */
12#    ifndef _SC_PAGE_SIZE
13#      define _SC_PAGE_SIZE _SC_PAGESIZE
14#    endif
15#  endif
16#  ifdef _SC_PAGE_SIZE
17#    define omalloc_getpagesize sysconf(_SC_PAGE_SIZE)
18#  else
19#    if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
20       extern size_t getpagesize();
21#      define omalloc_getpagesize getpagesize()
22#    else
23#      include <sys/param.h>
24#      ifdef EXEC_PAGESIZE
25#        define omalloc_getpagesize EXEC_PAGESIZE
26#      else
27#        ifdef NBPG
28#          ifndef CLSIZE
29#            define omalloc_getpagesize NBPG
30#          else
31#            define omalloc_getpagesize (NBPG * CLSIZE)
32#          endif
33#        else
34#          ifdef NBPC
35#            define omalloc_getpagesize NBPC
36#          else
37#            ifdef PAGESIZE
38#              define omalloc_getpagesize PAGESIZE
39#            else
40#              define omalloc_getpagesize (4096) /* just guess */
41#            endif
42#          endif
43#        endif
44#      endif
45#    endif
46#  endif
47#endif
Note: See TracBrowser for help on using the repository browser.