1 diff -up ntp-4.2.4p8/html/ntpd.html.mlock ntp-4.2.4p8/html/ntpd.html
2 --- ntp-4.2.4p8/html/ntpd.html.mlock 2009-12-08 17:56:35.000000000 +0100
3 +++ ntp-4.2.4p8/html/ntpd.html 2009-12-08 17:56:35.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 which sets and maintains the system time of day in synchronism with Internet standard time servers. 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. <tt>ntpd</tt> does most computations in 64-bit floating point arithmetic and does relatively clumsy 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 picoseconds. While the ultimate precision is not achievable with ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs.</p>
12 <h4 id="op">How NTP Operates</h4>
14 <dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> configuration command.
16 <dd>Do not listen to virtual IPs. The default is to listen.
22 diff -up ntp-4.2.4p8/ntpd/ntpd-opts.c.mlock ntp-4.2.4p8/ntpd/ntpd-opts.c
23 --- ntp-4.2.4p8/ntpd/ntpd-opts.c.mlock 2009-12-08 14:13:09.000000000 +0100
24 +++ ntp-4.2.4p8/ntpd/ntpd-opts.c 2009-12-08 17:56:35.000000000 +0100
25 @@ -264,6 +264,15 @@ tSCC zNice_Name[] = "ni
26 #define NICE_FLAGS (OPTST_DISABLED)
29 + * Mlock option description:
33 +tSCC zMlock_NAME[] = "MLOCK";
34 +tSCC zMlock_Name[] = "mlock";
35 +#define MLOCK_FLAGS (OPTST_DISABLED)
38 * Pidfile option description:
41 @@ -789,6 +798,18 @@ static tOptDesc optDesc[ OPTION_CT ] = {
42 OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT
45 + { /* entry idx, value */ 29, VALUE_OPT_MLOCK,
46 + /* equiv idx, value */ 29, VALUE_OPT_MLOCK,
47 + /* equivalenced to */ NO_EQUIVALENT,
48 + /* min, max, act ct */ 0, 1, 0,
49 + /* opt state flags */ MLOCK_FLAGS, 0,
50 + /* last opt argumnt */ { NULL },
51 + /* arg list/cookie */ NULL,
52 + /* must/cannot opts */ NULL, NULL,
53 + /* option proc */ NULL,
54 + /* desc, NAME, name */ zMlockText, zMlock_NAME, zMlock_Name,
55 + /* disablement strs */ NULL, NULL },
57 { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
58 /* equiv idx value */ NO_EQUIVALENT, 0,
59 /* equivalenced to */ NO_EQUIVALENT,
60 @@ -881,7 +902,7 @@ tOptions ntpdOptions = {
61 NO_EQUIVALENT /* index of '-#' option */,
62 NO_EQUIVALENT /* index of default opt */
64 - 32 /* full option count */, 29 /* user option count */
65 + 33 /* full option count */, 30 /* user option count */
69 diff -up ntp-4.2.4p8/ntpd/ntpd-opts.h.mlock ntp-4.2.4p8/ntpd/ntpd-opts.h
70 --- ntp-4.2.4p8/ntpd/ntpd-opts.h.mlock 2009-12-08 14:13:09.000000000 +0100
71 +++ ntp-4.2.4p8/ntpd/ntpd-opts.h 2009-12-08 17:56:35.000000000 +0100
72 @@ -81,12 +81,13 @@ typedef enum {
76 - INDEX_OPT_VERSION = 29,
77 - INDEX_OPT_HELP = 30,
78 - INDEX_OPT_MORE_HELP = 31
79 + INDEX_OPT_MLOCK = 29,
80 + INDEX_OPT_VERSION = 30,
81 + INDEX_OPT_HELP = 31,
82 + INDEX_OPT_MORE_HELP = 32
87 #define NTPD_VERSION "4.2.4p8"
88 #define NTPD_FULL_VERSION "ntpd - NTP daemon program - Ver. 4.2.4p8"
90 @@ -179,6 +180,10 @@ typedef enum {
91 # warning undefining MODIFYMMTIMER due to option name conflict
95 +# warning undefining MLOCK due to option name conflict
99 # warning undefining NOFORK due to option name conflict
101 @@ -248,6 +253,7 @@ typedef enum {
104 # undef MODIFYMMTIMER
109 @@ -290,6 +296,7 @@ typedef enum {
111 #define VALUE_OPT_MODIFYMMTIMER 'M'
112 #endif /* SYS_WINNT */
113 +#define VALUE_OPT_MLOCK 'm'
114 #define VALUE_OPT_NOFORK 'n'
115 #define VALUE_OPT_NICE 'N'
116 #define VALUE_OPT_PIDFILE 'p'
117 diff -up ntp-4.2.4p8/ntpd/ntpd.c.mlock ntp-4.2.4p8/ntpd/ntpd.c
118 --- ntp-4.2.4p8/ntpd/ntpd.c.mlock 2009-12-08 17:56:35.000000000 +0100
119 +++ ntp-4.2.4p8/ntpd/ntpd.c 2009-12-08 17:56:35.000000000 +0100
120 @@ -691,7 +691,8 @@ ntpdmain(
124 -#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && defined(MCL_FUTURE)
125 +#if defined(MCL_CURRENT) && defined(MCL_FUTURE)
126 + if (HAVE_OPT( MLOCK )) {
127 # ifdef HAVE_SETRLIMIT
129 * Set the stack limit to something smaller, so that we don't lock a lot
130 @@ -717,7 +718,7 @@ ntpdmain(
131 * fail if we drop root privlege. To be useful the value
132 * has to be larger than the largest ntpd resident set size.
134 - rl.rlim_cur = rl.rlim_max = 32*1024*1024;
135 + rl.rlim_cur = rl.rlim_max = 64*1024*1024;
136 if (setrlimit(RLIMIT_MEMLOCK, &rl) == -1) {
137 msyslog(LOG_ERR, "Cannot set RLIMIT_MEMLOCK: %m");
139 @@ -729,6 +730,7 @@ ntpdmain(
141 if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
142 msyslog(LOG_ERR, "mlockall(): %m");
144 #else /* not (HAVE_MLOCKALL && MCL_CURRENT && MCL_FUTURE) */