Ticket #1147: mlockall-autoconf-03.patch

File mlockall-autoconf-03.patch, 1018 bytes (added by ioerror, 10 years ago)

This is a minimal but still functional patch - please test it

  • configure.in

    diff --git a/configure.in b/configure.in
    index 7ffa578..32f28b5 100644
    a b if test x$tcmalloc = xyes ; then 
    628628   LDFLAGS="-ltcmalloc $LDFLAGS"
    629629fi
    630630
     631# By default, we're going to assume we don't have mlockall()
     632# bionic and other platforms have various broken mlockall subsystems
     633# some of systems don't have a working mlockall, some aren't linkable
     634AC_CHECK_FUNCS(mlockall)
     635
    631636# Allow user to specify an alternate syslog facility
    632637AC_ARG_WITH(syslog-facility,
    633638[  --with-syslog-facility=LOG syslog facility to use (default=LOG_DAEMON)],
  • src/common/compat.c

    diff --git a/src/common/compat.c b/src/common/compat.c
    index 9e5dca3..96012e2 100644
    a b tor_mlockall(void) 
    22732273   * http://msdn.microsoft.com/en-us/library/aa366895(VS.85).aspx
    22742274   */
    22752275
    2276 #ifdef HAVE_SYS_MMAN_H
     2276#ifdef HAVE_MLOCKALL
    22772277  ret = tor_set_max_memlock();
    22782278  if (ret == 0) {
    22792279    /* Perhaps we only want to log this if we're in a verbose mode? */