Rechercher une page de manuel
ntp_adjtime
Langue: en
Version: 133927 (ubuntu - 01/05/08)
Section: 2 (Appels système)
BSD mandoc
NAME
ntp_adjtime - NTP daemon application interfaceSYNOPSIS
In sys/types.h In sys/timex.h Ft int Fn ntp_adjtime struct timex *tpDESCRIPTION
The Fn ntp_adjtime system call is used as a kernel interface for the Network Time Protocol daemon, ntpd(8). Certain fields of the Vt timex structure are interpreted in either microseconds or nanoseconds, according to the state of the STA_NANO bit in the status word.In the Fx kernel, the Fn ntp_adjtime and ntp_gettime2 system calls can be used to determine which resolution is in use, and to select either one at any time. The resolution selected affects the scaling of certain fields in the Fn ntp_gettime and Fn ntp_adjtime system calls.
Take note that this API is extremely complex and stateful. Users should not attempt modification without first reviewing the ntpd(8) sources in depth.
/* * NTP daemon interface (ntp_adjtime()) - used to discipline CPU clock * oscillator and determine status. * * Note: The offset, precision and jitter members are in microseconds if * STA_NANO is zero and nanoseconds if not. */ struct timex { unsigned int modes; /* clock mode bits (wo) */ long offset; /* time offset (ns/us) (rw) */ long freq; /* frequency offset (scaled PPM) (rw) */ long maxerror; /* maximum error (us) (rw) */ long esterror; /* estimated error (us) (rw) */ int status; /* clock status bits (rw) */ long constant; /* poll interval (log2 s) (rw) */ long precision; /* clock precision (ns/us) (ro) */ long tolerance; /* clock frequency tolerance (scaled * PPM) (ro) */ /* * The following read-only structure members are implemented * only if the PPS signal discipline is configured in the * kernel. They are included in all configurations to insure * portability. */ long ppsfreq; /* PPS frequency (scaled PPM) (ro) */ long jitter; /* PPS jitter (ns/us) (ro) */ int shift; /* interval duration (s) (shift) (ro) */ long stabil; /* PPS stability (scaled PPM) (ro) */ long jitcnt; /* jitter limit exceeded (ro) */ long calcnt; /* calibration intervals (ro) */ long errcnt; /* calibration errors (ro) */ long stbcnt; /* stability limit exceeded (ro) */ };
Upon successful completion, Fn ntp_adjtime will fill the Fa tp argument with the current clock state.
RETURN VALUES
Upon successful completion the clock state is returned. Otherwise a -1 is returned and the global variable errno is set to indicate the error.Possible states of the clock are:
- TIME_OK
- Everything okay, no leap second warning.
- TIME_INS
- insert leap second warning.
- TIME_DEL
- delete leap second warning.
- TIME_OOP
- Leap second in progress.
- TIME_WAIT
- Leap second has occurred.
- TIME_ERROR
- Clock not synchronized.
ERRORS
The Fn ntp_gettime system call may return Er EPERM if the caller does not have sufficient permissions.SEE ALSO
ntp_gettime2, ntpd(8)AUTHORS
This manual page was written by An Tom Rhodes Aq trhodes@FreeBSD.org .Visual Basic indépendant
-- Jayce - VB, _la_ référence --
Contenus ©2006-2008 Benjamin Poulain
Design ©2006-2008 Maxime Vantorre