[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [tor/master] Fix compilation with with bionic libc.
Author: Jacob Appelbaum <jacob@xxxxxxxxxxxxx>
Date: Sat, 14 Nov 2009 16:43:22 -0500
Subject: Fix compilation with with bionic libc.
Commit: 6f1fe7e941b8f6d62829852059862b00beed5a6e
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 | 5 +++++
src/common/compat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index 7ffa578..32f28b5 100644
--- a/configure.in
+++ b/configure.in
@@ -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)],
diff --git a/src/common/compat.c b/src/common/compat.c
index 9e5dca3..96012e2 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -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? */
--
1.5.6.5