4 * ntp_syscall.h - various ways to perform the ntp_adjtime() and ntp_gettime()
15 #ifdef HAVE_SYS_TIMEX_H
16 # include <sys/timex.h>
19 #ifndef NTP_SYSCALLS_LIBC
20 #ifdef NTP_SYSCALLS_STD
21 # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
22 # define ntp_gettime(t) syscall(SYS_ntp_gettime, (t))
23 #else /* !NTP_SYSCALLS_STD */
24 # ifdef HAVE___ADJTIMEX
25 extern int __adjtimex (struct timex
*);
27 # define ntp_adjtime(t) __adjtimex((t))
29 #ifndef HAVE_STRUCT_NTPTIMEVAL
32 struct timeval time
; /* current time (ro) */
33 long int maxerror
; /* maximum error (us) (ro) */
34 long int esterror
; /* estimated error (us) (ro) */
40 struct ntptimeval
*ntv
47 result
= __adjtimex (&tntx
);
48 ntv
->time
= tntx
.time
;
49 ntv
->maxerror
= tntx
.maxerror
;
50 ntv
->esterror
= tntx
.esterror
;
58 # else /* !HAVE__ADJTIMEX */
59 # ifdef HAVE___NTP_GETTIME
60 # define ntp_gettime(t) __ntp_gettime((t))
62 # endif /* !HAVE_ADJTIMEX */
63 #endif /* !NTP_SYSCALLS_STD */
64 #endif /* !NTP_SYSCALLS_LIBC */
66 #endif /* NTP_SYSCALL_H */