summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-28 10:19:16 +1100
committerDamien Miller <djm@mindrot.org>1999-12-28 10:19:16 +1100
commit13bc0be2b65b65ab7ac020bbd0a772ed3abe1738 (patch)
tree721e717913d8eda07e1fde46d1fdde31b9f2743c
parent68e45de53b72087a77069a61c4e789e2012cd706 (diff)
- Replacement for getpagesize() for systems which lack it
-rw-r--r--ChangeLog3
-rw-r--r--bsd-snprintf.c19
-rw-r--r--configure.in4
3 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 984e1550..70e1c037 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 <andre.lucas@dial.pipex.com>
diff --git a/bsd-snprintf.c b/bsd-snprintf.c
index e85d9296..81a4b284 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 17b392d8..57b08a42 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)],