Blame SOURCES/ntp-4.2.6p5-mlock.patch

2b78f7
diff -up ntp-4.2.6p5/html/ntpd.html.mlock ntp-4.2.6p5/html/ntpd.html
2b78f7
--- ntp-4.2.6p5/html/ntpd.html.mlock	2012-11-23 14:58:15.401693701 +0100
2b78f7
+++ ntp-4.2.6p5/html/ntpd.html	2012-11-23 14:58:15.415693714 +0100
2b78f7
@@ -32,7 +32,7 @@
2b78f7
 		
2b78f7
 		
2b78f7
 		

Synopsis

2b78f7
-		<tt>ntpd [ -46aAbdDgLnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I iface ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ]</tt>
2b78f7
+		<tt>ntpd [ -46aAbdDgLmnNqx ] [ -c conffile ] [ -f driftfile ] [ -i jaildir ] [ -I iface ] [ -k keyfile ] [ -l logfile ] [ -p pidfile ] [ -P priority ] [ -r broadcastdelay ] [ -s statsdir ] [ -t key ] [ -u user[:group] ] [ -U interface_update_interval ] [ -v variable ] [ -V variable ]</tt>
2b78f7
 		

Description

2b78f7
 		

The <tt>ntpd</tt> program is an operating system daemon that synchronises the system clock with remote NTP time servers or local reference clocks. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. The program can operate in any of several modes, as described on the Association Management page, and with both symmetric key and public key cryptography, as described on the Authentication Options page.

2b78f7
 		

The <tt>ntpd</tt> program ordinarily requires a configuration file as described on the Configuration Commands and Options collection above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the Automatic Server Discovery page.

2b78f7
@@ -123,6 +123,8 @@
2b78f7
 			
Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file interface command, which is more versatile.
2b78f7
 			
<tt>-M</tt>
2b78f7
 			
Raise scheduler precision to its maximum (1 msec) using timeBeginPeriod. (Windows only)
2b78f7
+			
<tt>-m</tt>
2b78f7
+			
Lock memory.
2b78f7
 			
<tt>-n</tt>
2b78f7
 			
Don't fork.
2b78f7
 			
<tt>-N</tt>
2b78f7
diff -up ntp-4.2.6p5/ntpd/ntpd.c.mlock ntp-4.2.6p5/ntpd/ntpd.c
2b78f7
--- ntp-4.2.6p5/ntpd/ntpd.c.mlock	2012-11-23 14:58:15.369693666 +0100
2b78f7
+++ ntp-4.2.6p5/ntpd/ntpd.c	2012-11-23 14:58:15.416693715 +0100
2b78f7
@@ -723,7 +723,8 @@ ntpdmain(
2b78f7
 	}
2b78f7
 #endif
2b78f7
 
2b78f7
-#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE)
2b78f7
+#if defined(MCL_CURRENT) && defined(MCL_FUTURE)
2b78f7
+    if (HAVE_OPT( MLOCK )) {
2b78f7
 # ifdef HAVE_SETRLIMIT
2b78f7
 	/*
2b78f7
 	 * Set the stack limit to something smaller, so that we don't lock a lot
2b78f7
@@ -749,7 +750,7 @@ ntpdmain(
2b78f7
 	     * fail if we drop root privlege.  To be useful the value
2b78f7
 	     * has to be larger than the largest ntpd resident set size.
2b78f7
 	     */
2b78f7
-	    rl.rlim_cur = rl.rlim_max = 32*1024*1024;
2b78f7
+	    rl.rlim_cur = rl.rlim_max = 128*1024*1024;
2b78f7
 	    if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1) {
2b78f7
 		msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m");
2b78f7
 	    }
2b78f7
@@ -761,6 +762,7 @@ ntpdmain(
2b78f7
 	 */
2b78f7
 	if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
2b78f7
 		msyslog(LOG_ERR, "mlockall(): %m");
2b78f7
+    }
2b78f7
 #else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */
2b78f7
 # ifdef HAVE_PLOCK
2b78f7
 #  ifdef PROCLOCK
2b78f7
diff -up ntp-4.2.6p5/ntpd/ntpdbase-opts.def.mlock ntp-4.2.6p5/ntpd/ntpdbase-opts.def
2b78f7
--- ntp-4.2.6p5/ntpd/ntpdbase-opts.def.mlock	2009-12-09 08:36:35.000000000 +0100
2b78f7
+++ ntp-4.2.6p5/ntpd/ntpdbase-opts.def	2012-11-23 15:07:16.960261421 +0100
2b78f7
@@ -226,6 +226,14 @@ flag = {
2b78f7
 };
2b78f7
 
2b78f7
 flag = {
2b78f7
+    name      = mlock;
2b78f7
+    value     = m;
2b78f7
+    descrip   = "Lock memory";
2b78f7
+    doc = <<-  _EndOfDoc_
2b78f7
+	_EndOfDoc_;
2b78f7
+};
2b78f7
+
2b78f7
+flag = {
2b78f7
     ifdef     = SYS_WINNT;
2b78f7
     name      = modifymmtimer;
2b78f7
     value     = M;