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 21, 2009"
9 ntp_adjtime \- adjust local clock parameters
13 #include <sys/timex.h>
15 \fBint\fR \fBntp_adjtime\fR(\fBstruct timex *\fR\fItptr\fR);
21 The \fBntp_adjtime()\fR function adjusts the parameters used to discipline the
22 local clock, according to the values in the struct \fBtimex\fR pointed to by
23 \fItptr\fR. Before returning, it fills in the structure with the most recent
24 values kept in the kernel.
27 The adjustment is effected in part by speeding up or slowing down the clock, as
28 necessary, and in part by phase-locking onto a once-per second pulse (PPS)
29 provided by a driver, if available.
34 uint32_t modes; /* clock mode bits (w) */
35 int32_t offset; /* time offset (us) (rw) */
36 int32_t freq; /* frequency offset (scaled ppm) (rw) */
37 int32_t maxerror; /* maximum error (us) (rw) */
38 int32_t esterror; /* estimated error (us) (rw) */
39 int32_t status; /* clock status bits (rw) */
40 int32_t constant; /* pll time constant (rw) */
41 int32_t precision; /* clock precision (us) (r) */
42 int32_t tolerance; /* clock frequency tolerance
44 int32_t ppsfreq; /* pps frequency (scaled ppm) (r) */
45 int32_t jitter; /* pps jitter (us) (r) */
46 int32_t shift; /* interval duration (s) (shift) (r) */
47 int32_t stabil; /* pps stability (scaled ppm) (r) */
48 int32_t jitcnt; /* jitter limit exceeded (r) */
49 int32_t calcnt; /* calibration intervals (r) */
50 int32_t errcnt; /* calibration errors (r) */
51 int32_t stbcnt; /* stability limit exceeded (r) */
59 Upon successful completion, \fBntp_adjtime()\fR returns the current clock state
60 (see <\fBsys/timex.h\fR>). Otherwise, it returns \fB\(mi1\fR and sets
61 \fBerrno\fR to indicate the error.
65 The \fBntp_adjtime()\fR function will fail if:
72 The \fItptr\fR argument is an invalid pointer.
81 The \fBconstant\fR member of the structure pointed to by \fItptr\fR is less
82 than 0 or greater than 30.
91 The {\fBPRIV_SYS_TIME\fR} privilege is not asserted in the effective set of the
98 \fBntp_gettime\fR(2), \fBprivileges\fR(5)
101 See the \fBntpd\fR man page, delivered in the \fBSUNWntpu\fR package (not a