jerenkrantz 02/04/28 00:49:34
Modified: . configure.in CHANGES
Log:
Not all platforms can mmap /dev/zero, so we need to do an explicit check
for that. If that were to fail, then make it appear as /dev/zero never
existed in the first place.
PR: 8537
Revision Changes Path
1.436 +32 -1 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.435
retrieving revision 1.436
diff -u -r1.435 -r1.436
--- configure.in 24 Apr 2002 20:13:52 -0000 1.435
+++ configure.in 28 Apr 2002 07:49:34 -0000 1.436
@@ -591,6 +591,38 @@
AC_CHECK_FUNCS(create_area)
AC_CHECK_HEADERS(os2.h)
+dnl Not all systems can mmap /dev/zero (such as HP-UX). Check for that.
+if test "$ac_cv_func_mmap" = "yes" &&
+ test "$ac_cv_file__dev_zero" = "yes"; then
+ AC_MSG_CHECKING(for mmap that can map /dev/zero)
+ AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+ int main()
+ {
+ int fd;
+ void *m;
+ fd = open("/dev/zero", O_RDWR);
+ if (fd < 0) {
+ return 1;
+ }
+ m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+ if (m < 0) { /* aka MAP_FAILED */
+ return 2;
+ }
+ if (munmap(m, sizeof(void*)) < 0) {
+ return 3;
+ }
+ return 0;
+ }], [], [ac_cv_file__dev_zero=no])
+
+ AC_MSG_RESULT($ac_cv_file__dev_zero)
+fi
+
dnl Now we determine which one is our anonymous shmem preference.
haveshmgetanon="0"
havemmapzero="0"
@@ -1245,7 +1277,6 @@
echo $ac_n "${nl}Checking for Locking...${nl}"
AC_CHECK_FUNCS(semget semctl flock)
-APR_CHECK_FILE(/dev/zero)
AC_CHECK_HEADERS(semaphore.h)
AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait)
1.268 +3 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.267
retrieving revision 1.268
diff -u -r1.267 -r1.268
--- CHANGES 25 Apr 2002 18:27:31 -0000 1.267
+++ CHANGES 28 Apr 2002 07:49:34 -0000 1.268
@@ -1,5 +1,8 @@
Changes with APR b1
+ *) Don't try to use /dev/zero and mmap on platforms that don't
+ support that (such as HP-UX). PR 8537. [Justin Erenkrantz]
+
*) Reduce the number of apr_sendfile calls on AIX and OS/390 by
remembering when the kernel tells us the next one will block.
[Jeff Trawick]