]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix compilation with with bionic libc.
authorJacob Appelbaum <jacob@appelbaum.net>
Sat, 14 Nov 2009 21:43:22 +0000 (16:43 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 14 Nov 2009 21:45:14 +0000 (16:45 -0500)
This fixes bug 1147:

 bionic doesn't have an actual implementation of mlockall();
 mlockall() is merely in the headers but not actually in the library.
 This prevents Tor compilation with the bionic libc for Android handsets.

configure.in
src/common/compat.c

index 7ffa578d694a1e6312336a32e96f7adb3edaed41..32f28b5661c023340cf2751b624156e90ed71156 100644 (file)
@@ -628,6 +628,11 @@ if test x$tcmalloc = xyes ; then
    LDFLAGS="-ltcmalloc $LDFLAGS"
 fi
 
+# By default, we're going to assume we don't have mlockall()
+# bionic and other platforms have various broken mlockall subsystems
+# some of systems don't have a working mlockall, some aren't linkable
+AC_CHECK_FUNCS(mlockall)
+
 # Allow user to specify an alternate syslog facility
 AC_ARG_WITH(syslog-facility,
 [  --with-syslog-facility=LOG syslog facility to use (default=LOG_DAEMON)],
index 9e5dca3525ec5bf593f83e80fe6c24e300576f64..96012e2e0172ff83956fa0d079a39e276e756b01 100644 (file)
@@ -2273,7 +2273,7 @@ tor_mlockall(void)
    * http://msdn.microsoft.com/en-us/library/aa366895(VS.85).aspx
    */
 
-#ifdef HAVE_SYS_MMAN_H
+#ifdef HAVE_MLOCKALL
   ret = tor_set_max_memlock();
   if (ret == 0) {
     /* Perhaps we only want to log this if we're in a verbose mode? */