1999-11-20 23:42:44 +00:00
|
|
|
/* Emulate getpagesize on systems that lack it. */
|
1999-11-20 09:40:28 +00:00
|
|
|
|
2004-03-01 08:37:20 +00:00
|
|
|
/* $FreeBSD$ */
|
1999-11-20 09:40:28 +00:00
|
|
|
|
2004-03-01 08:37:20 +00:00
|
|
|
#ifndef HAVE_GETPAGESIZE
|
2000-01-31 13:26:10 +00:00
|
|
|
|
2004-07-04 10:02:03 +00:00
|
|
|
#if !defined getpagesize && defined __BEOS__
|
|
|
|
# include <OS.h>
|
|
|
|
# define getpagesize() B_PAGE_SIZE
|
|
|
|
#endif
|
|
|
|
|
2000-01-31 13:26:10 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2004-03-01 08:37:20 +00:00
|
|
|
# include <unistd.h>
|
2000-01-31 13:26:10 +00:00
|
|
|
#endif
|
|
|
|
|
2004-03-01 08:37:20 +00:00
|
|
|
#if !defined getpagesize && defined _SC_PAGESIZE
|
|
|
|
# if !(defined VMS && __VMS_VER < 70000000)
|
|
|
|
# define getpagesize() sysconf (_SC_PAGESIZE)
|
|
|
|
# endif
|
|
|
|
#endif
|
1999-11-20 23:42:44 +00:00
|
|
|
|
2004-03-01 08:37:20 +00:00
|
|
|
#if !defined getpagesize && defined VMS
|
|
|
|
# ifdef __ALPHA
|
|
|
|
# define getpagesize() 8192
|
|
|
|
# else
|
|
|
|
# define getpagesize() 512
|
|
|
|
# endif
|
|
|
|
#endif
|
1999-11-20 23:42:44 +00:00
|
|
|
|
2004-03-01 08:37:20 +00:00
|
|
|
#ifndef getpagesize
|
|
|
|
# include <sys/param.h>
|
|
|
|
# ifdef EXEC_PAGESIZE
|
|
|
|
# define getpagesize() EXEC_PAGESIZE
|
|
|
|
# else
|
|
|
|
# ifdef NBPG
|
|
|
|
# ifndef CLSIZE
|
|
|
|
# define CLSIZE 1
|
|
|
|
# endif
|
|
|
|
# define getpagesize() (NBPG * CLSIZE)
|
|
|
|
# else
|
|
|
|
# ifdef NBPC
|
|
|
|
# define getpagesize() NBPC
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#endif
|
1999-11-20 23:42:44 +00:00
|
|
|
|
2000-01-31 13:26:10 +00:00
|
|
|
#endif /* not HAVE_GETPAGESIZE */
|