// #include version.def
flag = {
- value = n;
- arg-type = number;
- arg-name = num-tries;
- descrip = "Number of times to check ntpd";
- doc = <<- _EndOfDoc_
+ value = n;
+ arg-type = number;
+ arg-name = "num-tries";
+ arg-default = 100;
+ descrip = "Number of times to check ntpd";
+ doc = <<- _EndOfDoc_
The maximum number of times we will check ntpd to see if it
has been able to synchronize and stabilize the system clock.
-
- The default is 100 times.
_EndOfDoc_;
};
flag = {
- value = s;
- arg-type = number;
- arg-name = secs-between-tries;
- descrip = "How long to sleep between tries";
- doc = <<- _EndOfDoc_
- We will sleep for secs-between-tries after each query of ntpd
+ value = s;
+ arg-type = number;
+ arg-name = "secs-between-tries";
+ arg-default = 6;
+ descrip = "How long to sleep between tries";
+ doc = <<- _EndOfDoc_
+ We will sleep for @file{secs-between-tries} after each query of ntpd
that returns "the time is not yet stable".
-
- The default is 6 seconds.
_EndOfDoc_;
};
flag = {
- value = v;
- descrip = "Be verbose";
- doc = <<- _EndOfDoc_
+ value = v;
+ descrip = "Be verbose";
+ doc = <<- _EndOfDoc_
By default, ntp-wait is silent. With this option, ntp-wait
will provide status information.
_EndOfDoc_;
char * ts_str;
double offset;
double precision;
- double root_dispersion;
+ double synch_distance;
char * p_SNTP_PRETEND_TIME;
time_t pretend_time;
#if SIZEOF_TIME_T == 8
}
offset_calculation(rpkt, rpktl, &tv_dst, &offset,
- &precision, &root_dispersion);
+ &precision, &synch_distance);
time_derived = TRUE;
for (digits = 0; (precision *= 10.) < 1.; ++digits)
if (0 == stratum)
stratum = 16;
- if (root_dispersion > 0) {
+ if (synch_distance > 0) {
cnt = snprintf(disptxt, sizeof(disptxt),
- " +/- %f", root_dispersion);
+ " +/- %f", synch_distance);
if (cnt >= sizeof(disptxt))
snprintf(disptxt, sizeof(disptxt),
"ERROR %d >= %d", cnt,
struct timeval *tv_dst,
double *offset,
double *precision,
- double *root_dispersion
+ double *synch_distance
)
{
l_fp p_rec, p_xmt, p_ref, p_org, tmp, dst;
*precision = LOGTOD(rpkt->precision);
TRACE(3, ("offset_calculation: precision: %f\n", *precision));
- *root_dispersion = FPTOD(p_rdsp);
+ *synch_distance = (FPTOD(p_rdly) + FPTOD(p_rdsp))/2.0;
#ifdef DEBUG
if (debug > 2) {
printf("sntp rootdelay: %f\n", FPTOD(p_rdly));
- printf("sntp rootdisp: %f\n", *root_dispersion);
+ printf("sntp rootdisp: %f\n", FPTOD(p_rdsp));
+ printf("sntp syncdist: %f\n", *synch_distance);
pkt_output(rpkt, rpktl, stdout);
if (labs((long)diff.tv_sec) < 3600) {
/* older libevent2 using monotonic */
timeval_sub(&offset, &systemt, &mono);
- msyslog(LOG_NOTICE,
- "Offsetting CLOCK_MONOTONIC times by %+ld.%06ld\n",
- (long)offset.tv_sec, offset.tv_usec);
+ TRACE(1, ("%s: Offsetting libevent CLOCK_MONOTONIC times by %.6f\n", progname, offset));
}
}
offset_ready = TRUE;