ntp_gettime (3) - Linux Manuals
ntp_gettime: get time parameters (NTP daemon interface)
NAME
ntp_gettime, ntp_gettimex - get time parameters (NTP daemon interface)
SYNOPSIS
#include <sys/timex.h> int ntp_gettime(struct ntptimeval *ntv); int ntp_gettimex(struct ntptimeval *ntv);
DESCRIPTION
Both of these APIs return information to the caller via the ntv argument, a structure of the following type:
struct ntptimeval {
The fields of this structure are as follows:
ntp_gettime()
returns an
ntptimeval
structure in which the
time,
maxerror,
and
esterror
fields are filled in.
ntp_gettimex()
performs the same task as
ntp_gettime(),
but also returns information in the
tai
field.
RETURN VALUE
The return values for
ntp_gettime()
and
ntp_gettimex()
are as for
adjtimex(2).
Given a correct pointer argument, these functions always succeed.
VERSIONS
The
ntp_gettime()
function is available since glibc 2.1.
The
ntp_gettimex()
function is available since glibc 2.12.
ATTRIBUTES
For an explanation of the terms used in this section, see
attributes(7).
Interface Attribute Value
ntp_gettime(),
ntp_gettimex()
Thread safety MT-Safe CONFORMING TO
ntp_gettime()
is described in the NTP Kernel Application Program Interface.
ntp_gettimex()
is a GNU extension.
COLOPHON
This page is part of release 5.10 of the Linux
man-pages
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
https://www.kernel.org/doc/man-pages/.