nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man2 / ntp_gettime.2
blobd3f886a19749bb58a6d7a701434468d01bea06cf
1 '\" te
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 13, 2017"
8 .SH NAME
9 ntp_gettime \- get local clock values
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/timex.h>
15 \fBint\fR \fBntp_gettime\fR(\fBstruct ntptimeval *\fR\fItptr\fR);
16 .fi
18 .SH DESCRIPTION
19 .LP
20 The \fBntp_gettime()\fR function reads the local clock value and dispersion,
21 returning the information in \fItptr\fR.
22 .sp
23 .LP
24 The \fBntptimeval\fR structure contains the following members:
25 .sp
26 .in +2
27 .nf
28 struct ntptimeval {
29     struct timeval   time;       /* current time (ro) */
30     int32_t          maxerror;   /* maximum error (us) (ro) */
31     int32_t          esterror;   /* estimated error (us) (ro) */
33 .fi
34 .in -2
36 .SH RETURN VALUES
37 .LP
38 Upon successful completion, \fBntp_gettime()\fR returns the current clock state
39 (see <\fBsys/timex.h\fR>). Otherwise, it returns \fB\(mi1\fR and sets
40 \fBerrno\fR to indicate the error.
41 .SH ERRORS
42 .LP
43 The \fBntp_gettime()\fR function will fail if:
44 .sp
45 .ne 2
46 .na
47 \fB\fBEFAULT\fR\fR
48 .ad
49 .RS 10n
50 The \fItptr\fR argument points to an invalid address.
51 .RE
53 .sp
54 .LP
55 The \fBntp_gettime()\fR function will fail for 32-bit interfaces if:
56 .sp
57 .ne 2
58 .na
59 \fB\fBEOVERFLOW\fR\fR
60 .ad
61 .RS 13n
62 The size of the \fBtime.tv_sec\fR member of the \fBntptimeval\fR structure
63 pointed to by \fItptr\fR is too small to contain the correct number of seconds.
64 .RE
66 .SH SEE ALSO
67 .LP
68 \fBntp_adjtime\fR(2)