2 .\" Copyright (c) David L. Mills 1992, 1993, 1994, 1995, 1996, 1997
3 .\" Portions Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
5 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH NTP_ADJTIME 2 "May 13, 2017"
9 ntp_adjtime \- adjust local clock parameters
13 #include <sys/timex.h>
15 \fBint\fR \fBntp_adjtime\fR(\fBstruct timex *\fR\fItptr\fR);
20 The \fBntp_adjtime()\fR function adjusts the parameters used to discipline the
21 local clock, according to the values in the struct \fBtimex\fR pointed to by
22 \fItptr\fR. Before returning, it fills in the structure with the most recent
23 values kept in the kernel.
26 The adjustment is effected in part by speeding up or slowing down the clock, as
27 necessary, and in part by phase-locking onto a once-per second pulse (PPS)
28 provided by a driver, if available.
33 uint32_t modes; /* clock mode bits (w) */
34 int32_t offset; /* time offset (us) (rw) */
35 int32_t freq; /* frequency offset (scaled ppm) (rw) */
36 int32_t maxerror; /* maximum error (us) (rw) */
37 int32_t esterror; /* estimated error (us) (rw) */
38 int32_t status; /* clock status bits (rw) */
39 int32_t constant; /* pll time constant (rw) */
40 int32_t precision; /* clock precision (us) (r) */
41 int32_t tolerance; /* clock frequency tolerance
43 int32_t ppsfreq; /* pps frequency (scaled ppm) (r) */
44 int32_t jitter; /* pps jitter (us) (r) */
45 int32_t shift; /* interval duration (s) (shift) (r) */
46 int32_t stabil; /* pps stability (scaled ppm) (r) */
47 int32_t jitcnt; /* jitter limit exceeded (r) */
48 int32_t calcnt; /* calibration intervals (r) */
49 int32_t errcnt; /* calibration errors (r) */
50 int32_t stbcnt; /* stability limit exceeded (r) */
57 Upon successful completion, \fBntp_adjtime()\fR returns the current clock state
58 (see <\fBsys/timex.h\fR>). Otherwise, it returns \fB\(mi1\fR and sets
59 \fBerrno\fR to indicate the error.
62 The \fBntp_adjtime()\fR function will fail if:
69 The \fItptr\fR argument is an invalid pointer.
78 The \fBconstant\fR member of the structure pointed to by \fItptr\fR is less
79 than 0 or greater than 30.
88 The {\fBPRIV_SYS_TIME\fR} privilege is not asserted in the effective set of the
94 \fBntp_gettime\fR(2), \fBprivileges\fR(5)