1ntp_gettime(2) System Calls ntp_gettime(2)
2
3
4
6 ntp_gettime - get local clock values
7
9 #include <sys/timex.h>
10
11 int ntp_gettime(struct ntptimeval *tptr);
12
13
15 The ntp_gettime() function reads the local clock value and dispersion,
16 returning the information in tptr.
17
18
19 The ntptimeval structure contains the following members:
20
21 struct ntptimeval {
22 struct timeval time; /* current time (ro) */
23 int32_t maxerror; /* maximum error (us) (ro) */
24 int32_t esterror; /* estimated error (us) (ro) */
25 };
26
27
29 Upon successful completion, ntp_gettime() returns the current clock
30 state (see <sys/timex.h>). Otherwise, it returns −1 and sets errno to
31 indicate the error.
32
34 The ntp_gettime() function will fail if:
35
36 EFAULT The tptr argument points to an invalid address.
37
38
39
40 The ntp_gettime() function will fail for 32-bit interfaces if:
41
42 EOVERFLOW The size of the time.tv_sec member of the ntptimeval
43 structure pointed to by tptr is too small to contain the
44 correct number of seconds.
45
46
48 ntp_adjtime(2)
49
50
51 See the ntpd man page, delivered in the SUNWntpu package (not a SunOS
52 man page).
53
54
55
56SunOS 5.11 21 May 2009 ntp_gettime(2)