FreeBSD/contrib/ntp/ntpd/ntp_timer.c
/*
 * reinit_timer - reinitialize interval timer after a clock step.
 */
reinitialize interval timer after a clock step.
reinitialize interval timer after a clock step .
void
reinit_timer(void)
{
#if !defined(SYS_WINNT) && !defined(VMS)
	ZERO(itimer);
# ifdef HAVE_TIMER_CREATE
	timer_gettime(timer_id, &itimer);
# else
	getitimer(ITIMER_REAL, &itimer);
# endif
	if (itimer.it_value.tv_sec < 0 ||
	    itimer.it_value.tv_sec > (1 << EVENT_TIMEOUT))
		itimer.it_value.tv_sec = (1 << EVENT_TIMEOUT);
	if (itimer.it_value.itv_frac < 0)
		itimer.it_value.itv_frac = 0;
	if (0 == itimer.it_value.tv_sec &&
	    0 == itimer.it_value.itv_frac)
		itimer.it_value.tv_sec = (1 << EVENT_TIMEOUT);
	itimer.it_interval.tv_sec = (1 << EVENT_TIMEOUT);
	itimer.it_interval.itv_frac = 0;
	set_timer_or_die(&itimer);
# endif 
}
void reinit_timer ( void ) { #if ! defined ( SYS_WINNT ) && ! defined ( VMS ) ZERO ( itimer ) ; # ifdef HAVE_TIMER_CREATE timer_gettime ( timer_id , & itimer ) ; # else getitimer ( ITIMER_REAL , & itimer ) ; # endif if ( itimer . it_value . tv_sec < 0 || itimer . it_value . tv_sec > ( 1 << EVENT_TIMEOUT ) ) itimer . it_value . tv_sec = ( 1 << EVENT_TIMEOUT ) ; if ( itimer . it_value . itv_frac < 0 ) itimer . it_value . itv_frac = 0 ; if ( 0 == itimer . it_value . tv_sec && 0 == itimer . it_value . itv_frac ) itimer . it_value . tv_sec = ( 1 << EVENT_TIMEOUT ) ; itimer . it_interval . tv_sec = ( 1 << EVENT_TIMEOUT ) ; itimer . it_interval . itv_frac = 0 ; set_timer_or_die ( & itimer ) ; # endif }
reinit_timer - reinitialize interval timer after a clock step.
reinit_timer - reinitialize interval timer after a clock step .
/* VMS */