#include <sys/timex.h>
sys/timex.h
macroSTA_RONLY
#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
macroSTA_SUPPORTED
#define STA_SUPPORTED (STA_PLL | STA_FLL | STA_UNSYNC | STA_FREQHOLD | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
structntptimeval
NTP user interface -- ntp_gettime - used to read kernel clock values
| struct timespec | time | current time (ns) (ro) |
| long | maxerror | maximum error (us) (ro) |
| long | esterror | estimated error (us) (ro) |
| long | tai | TAI offset |
| int | time_state | time status |
structtimex
NTP daemon interface -- ntp_adjtime -- used to discipline CPU clock
oscillator and control/determine status.
Note: The offset, precision and jitter members are in microseconds if
STA_NANO is zero and nanoseconds if not.
| 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) |
| long | ppsfreq | The following read-only structure members are used by the PPS signal discipline that is currently not supported. They are included for compatibility. 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) |
functionntp_adjtime
int ntp_adjtime(struct timex *)
functionntp_gettime
int ntp_gettime(struct ntptimeval *)