.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH NTP_GETTIME 3 2016-10-08 "Linux" "Linux Programmer's Manual"
+.TH NTP_GETTIME 3 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
ntp_gettime, ntp_gettimex \- get time parameters (NTP daemon interface)
.SH SYNOPSIS
.nf
.B #include <sys/timex.h>
-
+.PP
.BI "int ntp_gettime(struct ntptimeval *" ntv );
-
+.PP
.BI "int ntp_gettimex(struct ntptimeval *" ntv );
.fi
.SH DESCRIPTION
Both of these APIs return information to the caller via the
.I ntv
argument, a structure of the following type:
-
+.PP
.in +4n
-.nf
+.EX
struct ntptimeval {
struct timeval time; /* Current time */
long int maxerror; /* Maximum error */
/* Further padding bytes allowing for future expansion */
};
-.fi
+.EE
.in
-
+.PP
The fields of this structure are as follows:
.TP
.I time
The current time, expressed as a
.I timeval
structure:
-
+.IP
.in +4n
-.nf
+.EX
struct timeval {
time_t tv_sec; /* Seconds since the Epoch */
suseconds_t tv_usec; /* Microseconds */
};
-
-.fi
+.EE
.in
+.IP
.TP
.I maxerror
Maximum error, in microseconds.
.BR ntp_gettimex ()
is a GNU extension.
.SH SEE ALSO
-.BR adjtimex (2)
+.BR adjtimex (2),
.BR ntp_adjtime (3),
.BR time (7)
-
+.PP
.ad l
.UR http://www.slac.stanford.edu/comp/unix/\:package/\:rtems/\:src/\:ssrlApps/\:ntpNanoclock/\:api.htm
NTP "Kernel Application Program Interface"