1ntp_adjtime(2)                   System Calls                   ntp_adjtime(2)
2
3
4

NAME

6       ntp_adjtime - adjust local clock parameters
7

SYNOPSIS

9       #include <sys/timex.h>
10
11       int ntp_adjtime(struct timex *tptr);
12
13

DESCRIPTION

15       The  ntp_adjtime()  function  adjusts the parameters used to discipline
16       the local clock, according to the values in the struct timex pointed to
17       by   tptr.  Before  returning,  it fills in the structure with the most
18       recent values kept in the kernel.
19
20
21       The adjustment is effected in part by speeding up or slowing  down  the
22       clock,  as necessary, and in part by phase-locking onto a once-per sec‐
23       ond pulse (PPS) provided by a driver, if available.
24
25         struct timex {
26             uint32_t modes;        /* clock mode bits (w) */
27             int32_t  offset;       /* time offset (us) (rw) */
28             int32_t  freq;         /* frequency offset (scaled ppm) (rw) */
29             int32_t  maxerror;     /* maximum error (us) (rw) */
30             int32_t  esterror;     /* estimated error (us) (rw) */
31             int32_t  status;       /* clock status bits (rw) */
32             int32_t  constant;     /* pll time constant (rw) */
33             int32_t  precision;    /* clock precision (us) (r) */
34             int32_t  tolerance;    /* clock frequency tolerance
35                                       (scaled ppm) (r) */
36             int32_t  ppsfreq;      /* pps frequency (scaled ppm) (r) */
37             int32_t  jitter;       /* pps jitter (us) (r) */
38             int32_t  shift;        /* interval duration (s) (shift) (r) */
39             int32_t  stabil;       /* pps stability (scaled ppm) (r) */
40             int32_t  jitcnt;       /* jitter limit exceeded (r) */
41             int32_t  calcnt;       /* calibration intervals (r) */
42             int32_t  errcnt;       /* calibration errors (r) */
43             int32_t  stbcnt;       /* stability limit exceeded (r) */
44         };
45
46

RETURN VALUES

48       Upon successful completion, ntp_adjtime()  returns  the  current  clock
49       state  (see  <sys/timex.h>). Otherwise, it returns −1 and sets errno to
50       indicate the error.
51

ERRORS

53       The ntp_adjtime() function will fail if:
54
55       EFAULT    The  tptr argument is an invalid pointer.
56
57
58       EINVAL    The constant member of the structure pointed to  by  tptr  is
59                 less than 0 or greater than 30.
60
61
62       EPERM     The  {PRIV_SYS_TIME}  privilege is not asserted in the effec‐
63                 tive set of the calling process.
64
65

SEE ALSO

67       ntp_gettime(2), privileges(5)
68
69
70       See the ntpd man page, delivered in the SUNWntpu package (not  a  SunOS
71       man page).
72
73
74
75SunOS 5.11                        21 May 2009                   ntp_adjtime(2)
Impressum