[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] #256109: get rid of SysV SHM altogether



Hello Debian people,

I ran across the problem described in bug #256109, I read the thread, and I have a fix: alter the behavior of libapr's configure script to prefer mmap() over SysV shared memory which as you noticed is, erm, inappropriate for many uses. Stick the attached file under debian/patches/039_mmap_predates_sysvshm and you're done.

Same patch has been sent to upstream maintainers (dev@apr.apache.org).

Regards,

--
Dominique QUATRAVAUX                           Ingénieur senior
01 44 42 00 08                                 IDEALX


Index: configure.in
===================================================================
--- build-tree/apache2/srclib/apr/configure.in	(revision 149267)
+++ build-tree/apache2/srclib/apr/configure.in	(working copy)
@@ -729,6 +729,7 @@
 fi
 
 # Now we determine which one is our anonymous shmem preference.
+# The last APR_DECIDE to execute sets the default.
 haveshmgetanon="0"
 havemmapzero="0"
 havemmapanon="0"
@@ -793,25 +794,26 @@
 AC_SUBST(havemmapanon)
 
 # Now we determine which one is our name-based shmem preference.
+# The last APR_DECIDE to execute sets the default.
 havemmaptmp="0"
 havemmapshm="0"
 haveshmget="0"
 havebeosarea="0"
 haveos2shm="0"
 APR_BEGIN_DECISION([namebased memory allocation method])
-APR_IFALLYES(header:sys/mman.h func:mmap func:munmap,
-             [havemmaptmp="1"
-              APR_DECIDE(USE_SHMEM_MMAP_TMP, 
-                  [Classical mmap() on temporary file])])
+APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
+             func:shmget func:shmat func:shmdt func:shmctl,
+             [haveshmget="1"
+              APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])])
 APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl
              func:shm_unlink,
              [havemmapshm="1"
               APR_DECIDE(USE_SHMEM_MMAP_SHM, 
                   [mmap() via POSIX.1 shm_open() on temporary file])])
-APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl
-             func:shmget func:shmat func:shmdt func:shmctl,
-             [haveshmget="1"
-              APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])])
+APR_IFALLYES(header:sys/mman.h func:mmap func:munmap,
+             [havemmaptmp="1"
+              APR_DECIDE(USE_SHMEM_MMAP_TMP, 
+                  [Classical mmap() on temporary file])])
 APR_IFALLYES(header:kernel/OS.h func:create_area,
              [havebeosshm="1"
               APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])])

Reply to: