not all systems have _SC_PAGESIZE

This commit is contained in:
Bill Currie 2003-07-21 20:51:03 +00:00
parent d68c6c0d5b
commit ff6e0ab1b3
2 changed files with 12 additions and 1 deletions

View file

@ -189,6 +189,17 @@ AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM
if test "$ac_cv_header_unistd_h" = yes; then
AC_MSG_CHECKING(for _SC_PAGESIZE)
AC_TRY_COMPILE(
[#include <unistd.h>],
[int foo = _SC_PAGESIZE;],
AC_DEFINE(HAVE__SC_PAGESIZE,1,[Define this if you have _SC_PAGESIZE])
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
fi
AC_MSG_CHECKING(for __attribute__)
AC_TRY_COMPILE(
[static __attribute__ ((unused)) const char *foo = "bar";],

View file

@ -340,7 +340,7 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
# ifdef HAVE_MPROTECT
int r;
unsigned long endaddr = startaddr + length;
# ifdef HAVE_UNISTD_H
# ifdef HAVE__SC_PAGESIZE
long psize = sysconf (_SC_PAGESIZE);
startaddr &= ~(psize - 1);