2 .\" Copyright (c) David L. Mills 1992, 1993, 1994, 1995, 1996, 1997
3 .\" Portions Copyright (c) 1997, 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_GETTIME 2 "May 21, 2009"
9 ntp_gettime \- get local clock values
13 #include <sys/timex.h>
15 \fBint\fR \fBntp_gettime\fR(\fBstruct ntptimeval *\fR\fItptr\fR);
21 The \fBntp_gettime()\fR function reads the local clock value and dispersion,
22 returning the information in \fItptr\fR.
25 The \fBntptimeval\fR structure contains the following members:
30 struct timeval time; /* current time (ro) */
31 int32_t maxerror; /* maximum error (us) (ro) */
32 int32_t esterror; /* estimated error (us) (ro) */
40 Upon successful completion, \fBntp_gettime()\fR returns the current clock state
41 (see <\fBsys/timex.h\fR>). Otherwise, it returns \fB\(mi1\fR and sets
42 \fBerrno\fR to indicate the error.
46 The \fBntp_gettime()\fR function will fail if:
53 The \fItptr\fR argument points to an invalid address.
58 The \fBntp_gettime()\fR function will fail for 32-bit interfaces if:
65 The size of the \fBtime.tv_sec\fR member of the \fBntptimeval\fR structure
66 pointed to by \fItptr\fR is too small to contain the correct number of seconds.
75 See the \fBntpd\fR man page, delivered in the \fBSUNWntpu\fR package (not a