memcached-1.1.9-snapshot

Brion Vibber brion@pobox.com
Mon, 11 Aug 2003 01:24:55 -0700


This is a multi-part message in MIME format.
--------------000201060400080008040004
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I wrote:

> If I comment out the mlockall() call, it compiles and works fine so 
> far, though without the ability to lock the memory. This can probably 
> be sensibly #ifdef'd out. 

If there is such a thing as the opposite of an autoconf guru, that's me. 
Thanks to Google, I did figure out how to add a macro to the configure 
script to check for mlockall. However I'm not sure exactly what arcane 
series of commands is required to make it regenerate all the scripts and 
not give a bunch of errors about "./depcomp: ./depcomp: No such file or 
directory"

I did manage to make a working binary on FreeBSD. On Linux, I got it to 
go through the configure script and agree that, yes, mlockall is 
supported, but the make dies looking for depcomp.

Steps to reproduce:
* apply attached patch
* autoconf
* automake
* run one or more of the above commands over and over as it bitches at 
you that your versions are wrong and you should run aclocal then run it 
again
* give up and hope configure works
* ./configure (on FreeBSD, ./configure --with-event=/usr/local)
* make
* #^&*%$!
* automake
* make
* if you're lucky, you might have a binary now.

-- brion vibber (brion @ pobox.com)

--------------000201060400080008040004
Content-Type: text/plain;
 name="mlockall-ac.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mlockall-ac.diff"

--- plain/configure.ac	Sun Aug 10 23:42:39 2003
+++ configure.ac	Mon Aug 11 01:10:11 2003
@@ -56,5 +56,7 @@
 	AC_MSG_RESULT(yes)
 fi
 
+AC_CHECK_FUNCS(mlockall)
+
 AC_CONFIG_FILES(Makefile)
 AC_OUTPUT
--- plain/memcached.c	Sun Aug 10 23:45:08 2003
+++ memcached.c	Mon Aug 11 01:10:30 2003
@@ -1296,7 +1296,9 @@
 
     /* lock paged memory if needed */
     if (lock_memory) {
+#ifdef HAVE_MLOCKALL
         mlockall(MCL_CURRENT | MCL_FUTURE);
+#endif
     }
 
     /* create the listening socket and bind it */

--------------000201060400080008040004--