00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef VMS
00024
00025 #include "config.h"
00026
00027 #include <sys/types.h>
00028 #ifdef HAVE_SYS_PARAM_H
00029 #include <sys/param.h>
00030 #endif
00031
00032 #undef GNU_OUR_PAGESIZE
00033 #if defined (HAVE_SYSCONF) && defined (HAVE_UNISTD_H)
00034 #include <unistd.h>
00035 #ifdef _SC_PAGESIZE
00036 #define GNU_OUR_PAGESIZE sysconf(_SC_PAGESIZE)
00037 #endif
00038 #endif
00039
00040 #ifndef GNU_OUR_PAGESIZE
00041 # ifdef PAGESIZE
00042 # define GNU_OUR_PAGESIZE PAGESIZE
00043 # else
00044 # ifdef EXEC_PAGESIZE
00045 # define GNU_OUR_PAGESIZE EXEC_PAGESIZE
00046 # else
00047 # ifdef NBPG
00048 # define GNU_OUR_PAGESIZE (NBPG * CLSIZE)
00049 # ifndef CLSIZE
00050 # define CLSIZE 1
00051 # endif
00052 # else
00053 # ifdef NBPC
00054 # define GNU_OUR_PAGESIZE NBPC
00055 # else
00056 # define GNU_OUR_PAGESIZE 4096
00057 # endif
00058 # endif
00059 # endif
00060 # endif
00061 #endif
00062
00063 int
00064 getpagesize ()
00065 {
00066 return (GNU_OUR_PAGESIZE);
00067 }
00068
00069 #else
00070
00071 #if 0
00072 #include <syidef.h>
00073 #endif
00074 #ifndef SYI$_PAGE_SIZE
00075 #define SYI$_PAGE_SIZE 4452
00076 #endif
00077 extern unsigned long lib$getsyi(const unsigned short *,...);
00078
00079 int getpagesize ()
00080 {
00081 long pagsiz = 0L;
00082 unsigned short itmcod = SYI$_PAGE_SIZE;
00083
00084 (void) lib$getsyi (&itmcod, (void *) &pagsiz);
00085 if (pagsiz == 0L)
00086 pagsiz = 512L;
00087 return (int) pagsiz;
00088 }
00089
00090 #endif