1/* $NetBSD: getpagesize.h,v 1.1.1.1 2016/01/10 21:36:20 christos Exp $ */ 2 3/* Emulate getpagesize on systems that lack it. */ 4 5#ifndef HAVE_GETPAGESIZE 6 7#if !defined getpagesize && defined __BEOS__ 8# include <OS.h> 9# define getpagesize() B_PAGE_SIZE 10#endif 11 12#ifdef HAVE_UNISTD_H 13# include <unistd.h> 14#endif 15 16#if !defined getpagesize && defined _SC_PAGESIZE 17# if !(defined VMS && __VMS_VER < 70000000) 18# define getpagesize() sysconf (_SC_PAGESIZE) 19# endif 20#endif 21 22#if !defined getpagesize && defined VMS 23# ifdef __ALPHA 24# define getpagesize() 8192 25# else 26# define getpagesize() 512 27# endif 28#endif 29 30#ifndef getpagesize 31# include <sys/param.h> 32# ifdef EXEC_PAGESIZE 33# define getpagesize() EXEC_PAGESIZE 34# else 35# ifdef NBPG 36# ifndef CLSIZE 37# define CLSIZE 1 38# endif 39# define getpagesize() (NBPG * CLSIZE) 40# else 41# ifdef NBPC 42# define getpagesize() NBPC 43# endif 44# endif 45# endif 46#endif 47 48#endif /* not HAVE_GETPAGESIZE */ 49