1 diff -up ntp-4.2.6p1/html/ntpd.html.mlock ntp-4.2.6p1/html/ntpd.html
2 --- ntp-4.2.6p1/html/ntpd.html.mlock 2010-03-04 16:06:38.000000000 +0100
3 +++ ntp-4.2.6p1/html/ntpd.html 2010-03-04 16:07:42.000000000 +0100
7 <h4 id="synop">Synopsis</h4>
8 - <tt>ntpd [ -46aAbdDgLnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -I <i>iface</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt>
9 + <tt>ntpd [ -46aAbdDgLmnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -I <i>iface</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt>
10 <h4 id="descr">Description</h4>
11 <p>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 <a href="assoc.html">Association Management</a> page, and with both symmetric key and public key cryptography, as described on the <a href="manyopt.html">Authentication Options</a> page.</p>
12 <p>The <tt>ntpd</tt> program ordinarily requires a configuration file as desccribe 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 <a href="manyopt.html">Automatic Server Discovery</a> page.</p>
14 <dd>Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd>
16 <dd>Raise scheduler precision to its maximum (1 msec) using timeBeginPeriod. (Windows only)</dd>
22 diff -up ntp-4.2.6p1/ntpd/ntpd-opts.c.mlock ntp-4.2.6p1/ntpd/ntpd-opts.c
23 --- ntp-4.2.6p1/ntpd/ntpd-opts.c.mlock 2010-02-09 11:27:18.000000000 +0100
24 +++ ntp-4.2.6p1/ntpd/ntpd-opts.c 2010-03-04 16:09:12.000000000 +0100
29 - * This file was produced by an AutoOpts template. AutoOpts is a
30 + * This file was produced by an AutoOpts template. AutoOpts is
31 * copyrighted work. This source file is not encumbered by AutoOpts
32 * licensing, but is provided under the licensing terms chosen by the
33 * ntpd author or copyright holder. AutoOpts is licensed under
34 @@ -284,6 +284,15 @@ tSCC zNice_Name[] = "ni
35 #define NICE_FLAGS (OPTST_DISABLED)
38 + * Mlock option description:
42 +tSCC zMlock_NAME[] = "MLOCK";
43 +tSCC zMlock_Name[] = "mlock";
44 +#define MLOCK_FLAGS (OPTST_DISABLED)
47 * Pidfile option description:
50 @@ -911,6 +920,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
51 /* desc, NAME, name */ zPccfreqText, zPccfreq_NAME, zPccfreq_Name,
52 /* disablement strs */ NULL, NULL },
54 + { /* entry idx, value */ 32, VALUE_OPT_MLOCK,
55 + /* equiv idx, value */ 32, VALUE_OPT_MLOCK,
56 + /* equivalenced to */ NO_EQUIVALENT,
57 + /* min, max, act ct */ 0, 1, 0,
58 + /* opt state flags */ MLOCK_FLAGS, 0,
59 + /* last opt argumnt */ { NULL },
60 + /* arg list/cookie */ NULL,
61 + /* must/cannot opts */ NULL, NULL,
62 + /* option proc */ NULL,
63 + /* desc, NAME, name */ zMlockText, zMlock_NAME, zMlock_Name,
64 + /* disablement strs */ NULL, NULL },
66 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
67 /* equiv idx value */ NO_EQUIVALENT, 0,
68 /* equivalenced to */ NO_EQUIVALENT,
69 @@ -1005,7 +1026,7 @@ tOptions ntpdOptions = {
70 NO_EQUIVALENT, /* '-#' option index */
71 NO_EQUIVALENT /* index of default opt */
73 - 35 /* full option count */, 32 /* user option count */,
74 + 36 /* full option count */, 33 /* user option count */,
75 ntpd_full_usage, ntpd_short_usage,
78 diff -up ntp-4.2.6p1/ntpd/ntpd-opts.h.mlock ntp-4.2.6p1/ntpd/ntpd-opts.h
79 --- ntp-4.2.6p1/ntpd/ntpd-opts.h.mlock 2010-02-09 11:27:18.000000000 +0100
80 +++ ntp-4.2.6p1/ntpd/ntpd-opts.h 2010-03-04 16:10:16.000000000 +0100
81 @@ -84,12 +84,13 @@ typedef enum {
83 INDEX_OPT_USEPCC = 30,
84 INDEX_OPT_PCCFREQ = 31,
85 - INDEX_OPT_VERSION = 32,
86 - INDEX_OPT_HELP = 33,
87 - INDEX_OPT_MORE_HELP = 34
88 + INDEX_OPT_MLOCK = 32,
89 + INDEX_OPT_VERSION = 33,
90 + INDEX_OPT_HELP = 34,
91 + INDEX_OPT_MORE_HELP = 35
96 #define NTPD_VERSION "4.2.6p1"
97 #define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.6p1"
99 @@ -182,6 +183,10 @@ typedef enum {
100 # warning undefining MODIFYMMTIMER due to option name conflict
101 # undef MODIFYMMTIMER
104 +# warning undefining MLOCK due to option name conflict
108 # warning undefining NOFORK due to option name conflict
110 @@ -263,6 +268,7 @@ typedef enum {
113 # undef MODIFYMMTIMER
118 @@ -301,6 +307,7 @@ typedef enum {
119 #define VALUE_OPT_LOGFILE 'l'
120 #define VALUE_OPT_NOVIRTUALIPS 'L'
121 #define VALUE_OPT_MODIFYMMTIMER 'M'
122 +#define VALUE_OPT_MLOCK 'm'
123 #define VALUE_OPT_NOFORK 'n'
124 #define VALUE_OPT_NICE 'N'
125 #define VALUE_OPT_PIDFILE 'p'
126 diff -up ntp-4.2.6p1/ntpd/ntpd.c.mlock ntp-4.2.6p1/ntpd/ntpd.c
127 --- ntp-4.2.6p1/ntpd/ntpd.c.mlock 2010-02-09 11:02:27.000000000 +0100
128 +++ ntp-4.2.6p1/ntpd/ntpd.c 2010-03-04 16:11:42.000000000 +0100
129 @@ -724,7 +724,8 @@ ntpdmain(
133 -#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE)
134 +#if defined(MCL_CURRENT) && defined(MCL_FUTURE)
135 + if (HAVE_OPT( MLOCK )) {
136 # ifdef HAVE_SETRLIMIT
138 * Set the stack limit to something smaller, so that we don't lock a lot
139 @@ -750,7 +751,7 @@ ntpdmain(
140 * fail if we drop root privlege. To be useful the value
141 * has to be larger than the largest ntpd resident set size.
143 - rl.rlim_cur = rl.rlim_max = 32*1024*1024;
144 + rl.rlim_cur = rl.rlim_max = 64*1024*1024;
145 if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1) {
146 msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m");
148 @@ -762,6 +763,7 @@ ntpdmain(
150 if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
151 msyslog(LOG_ERR, "mlockall(): %m");
153 #else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */