From 13bc0be2b65b65ab7ac020bbd0a772ed3abe1738 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 28 Dec 1999 10:19:16 +1100 Subject: - Replacement for getpagesize() for systems which lack it --- ChangeLog | 3 +++ bsd-snprintf.c | 19 +++++++++++++++++++ configure.in | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 984e15505..70e1c037a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +19991228 + - Replacement for getpagesize() for systems which lack it + 19991227 - Automatically correct paths in manpages and configuration files. Patch and script from Andre Lucas diff --git a/bsd-snprintf.c b/bsd-snprintf.c index e85d9296a..81a4b284e 100644 --- a/bsd-snprintf.c +++ b/bsd-snprintf.c @@ -54,6 +54,25 @@ static sigjmp_buf bail; #define EXTRABYTES 2 /* XXX: why 2? you don't want to know */ +#ifndef HAVE_GETPAGESIZE +int +getpagesize() +{ +#ifdef EXEC_PAGESIZE + return EXEC_PAGESIZE; +#else /* !EXEC_PAGESIZE */ +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* No CLSIZE */ + return NBPG * CLSIZE; +# else /* !NBPG */ + return NBPC; +# endif /* NBPG */ +#endif /* EXEC_PAGESIZE */ +} +#endif /* HAVE_GETPAGESIZE */ + static char * msetup(str, n) char *str; diff --git a/configure.in b/configure.in index 17b392d8f..57b08a421 100644 --- a/configure.in +++ b/configure.in @@ -114,10 +114,10 @@ if test -z "$no_pam" ; then fi dnl Checks for header files. -AC_CHECK_HEADERS(endian.h lastlog.h login.h maillock.h netgroup.h paths.h poll.h pty.h shadow.h util.h utmp.h utmpx.h sys/bsdtty.h sys/poll.h sys/select.h sys/stropts.h sys/time.h sys/ttcompat.h) +AC_CHECK_HEADERS(endian.h lastlog.h login.h maillock.h netgroup.h paths.h poll.h pty.h shadow.h sys/bsdtty.h sys/poll.h sys/select.h sys/stropts.h sys/time.h sys/ttcompat.h util.h utmp.h utmpx.h) dnl Checks for library functions. -AC_CHECK_FUNCS(arc4random updwtmpx mkdtemp openpty _getpty innetgr setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf) +AC_CHECK_FUNCS(arc4random getpagesize _getpty innetgr mkdtemp openpty setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf) AC_CHECK_FUNC(login, [AC_DEFINE(HAVE_LOGIN)], -- cgit v1.2.3