From: Harlan Stenn Date: Mon, 5 Oct 2015 06:26:46 +0000 (+0000) Subject: [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccc31b966aea10e5fcc6a55836d2b3b100327323;p=thirdparty%2Fntp.git [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn. bk: 56121826z-c24tV9UZsWb5LXzMgDfA --- diff --git a/ChangeLog b/ChangeLog index 675e81226..ae4fca08b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ * [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov. * [Bug 2906] make check needs better support for pthreads. Harlan Stenn. * [Bug 2907] dist* build targets require our libevent/ to be enabled. HStenn. +* [Bug 2912] no munlockall() under Windows. David Taylor, Harlan Stenn. * libntp/emalloc.c: Remove explicit include of stdint.h. Harlan Stenn. * Put Unity CPPFLAGS items in unity_config.h. Harlan Stenn. * tests/ntpd/g_leapsec.cpp typo fix. Harlan Stenn. diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 85a8265f8..1c754bd16 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -2623,19 +2623,23 @@ config_rlimit( case T_Memlock: /* What if we HAVE_OPT(SAVECONFIGQUIT) ? */ if (rlimit_av->value.i == -1) { +# if defined(HAVE_MLOCKALL) if (cur_memlock != 0) { if (-1 == munlockall()) { msyslog(LOG_ERR, "munlockall() failed: %m"); } } cur_memlock = 0; +# endif /* HAVE_MLOCKALL */ } else if (rlimit_av->value.i >= 0) { #if defined(RLIMIT_MEMLOCK) +# if defined(HAVE_MLOCKALL) if (cur_memlock != 1) { if (-1 == mlockall(MCL_CURRENT|MCL_FUTURE)) { msyslog(LOG_ERR, "mlockall() failed: %m"); } } +# endif /* HAVE_MLOCKALL */ ntp_rlimit(RLIMIT_MEMLOCK, (rlim_t)(rlimit_av->value.i * 1024 * 1024), 1024 * 1024,