Lines Matching +full:fuzz +full:- +full:seconds

2  * systime -- routines to fiddle a UNIX clock.
30 int allow_panic = FALSE; /* allow panic correction (-g) */
50 * predicted, the low-order unused portion of the time below the minimum
51 * time to read the clock is filled with an unbiased random fuzz.
54 * seconds, for stepping clocks, defined as those which return times
56 * use a high-resolution counter such that each clock reading is always
80 double measured_tick; /* non-overridable sys_tick (s) */
118 /* [Bug 3450] ensure nsec fuzz >= sys_fuzz to reduce chance of
119 * short-falling fuzz advance
152 tsp->tv_sec = tv.tv_sec;
153 tsp->tv_nsec = tv.tv_usec * 1000;
162 ticks = (long)((tsp->tv_nsec * 1e-9) / sys_tick);
163 tsp->tv_nsec = (long)(ticks * 1e9 * sys_tick);
169 * get_systime - return system time in NTP timestamp format.
179 struct timespec ts; /* seconds and nanoseconds */
194 * tolerance -- being too sharp can hurt here. (This is intented
220 1e-9 * ts_lam.tv_nsec);
229 /* convert from timespec to l_fp fixed-point */
233 * Add in the fuzz. 'ntp_random()' returns [0..2**31-1] so we
282 * adj_systime - adjust system time by the argument.
316 * in microsecond quanta, but some adjust in 10-ms quanta. We
323 dtemp = -dtemp;
326 dtemp -= adjtv.tv_sec;
330 quant = 1e-6;
335 * note: sign comes later, all numbers non-negative here.
339 adjtv.tv_usec -= 1000000;
340 dtemp -= 1.;
343 sys_residual = dtemp - adjtv.tv_usec * 1.e-6;
346 * Convert to signed seconds and microseconds for the Unix
351 adjtv.tv_sec = -adjtv.tv_sec;
352 adjtv.tv_usec = -adjtv.tv_usec;
353 sys_residual = -sys_residual;
512 * step_systime - step the system clock.
528 * scratch. And we're not in the time-critical path yet.
534 * 1969-12-31/23:59:59 UTC and gives us additional two years,
548 /* ---> time-critical path starts ---> */
550 /* get the current time as l_fp (without fuzz) and as struct timeval */
564 msyslog(LOG_ERR, "step-systime: %m");
571 /* <--- time-critical path ended with 'ntp_set_tod()' <--- */
605 secs = time_to_vint64(&ptv->tv_sec);
610 "%04hu-%02hu-%02hu/%02hu:%02hu:%02hu.%06u",
613 (u_int)ptv->tv_usec);
630 /* ---> time-critical path starts ---> */
632 /* get the current time as l_fp (without fuzz) and as struct timeval */
637 tvlast.tv_usec -= 1000000;
644 msyslog(LOG_ERR, "clamp-systime: %m");
649 "clamp-systime: clock (%s) in allowed range",
654 /* <--- time-critical path ended with 'ntp_set_tod()' <--- */
670 "clamp-systime: clock stepped from %s to %s!",