2 * ntp_syscall.h - various ways to perform the ntp_adjtime() and ntp_gettime()
9 #ifdef HAVE_SYS_TIMEX_H
10 # include <sys/timex.h>
13 #ifndef NTP_SYSCALLS_LIBC
14 # ifdef NTP_SYSCALLS_STD
15 # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
16 # define ntp_gettime(t) syscall(SYS_ntp_gettime, (t))
17 # else /* !NTP_SYSCALLS_STD */
18 # ifdef HAVE_NTP_ADJTIME
19 extern int ntp_adjtime (struct timex *);
21 # ifndef HAVE_STRUCT_NTPTIMEVAL
24 struct timeval time; /* current time (ro) */
25 long int maxerror; /* maximum error (us) (ro) */
26 long int esterror; /* estimated error (us) (ro) */
30 # ifndef HAVE_NTP_GETTIME
33 struct ntptimeval *ntv
40 result = ntp_adjtime(&tntx);
41 ntv->time = tntx.time;
42 ntv->maxerror = tntx.maxerror;
43 ntv->esterror = tntx.esterror;
51 # endif /* !HAVE_NTP_GETTIME */
52 # endif /* !HAVE_NTP_ADJTIME */
53 # endif /* !NTP_SYSCALLS_STD */
54 #endif /* !NTP_SYSCALLS_LIBC */
56 #endif /* NTP_SYSCALL_H */