1 /* $NetBSD: compat_ntp_gettime.c,v 1.2 2009/01/11 02:46:26 christos Exp $ */
4 #if defined(LIBC_SCCS) && !defined(lint)
5 __RCSID("$NetBSD: compat_ntp_gettime.c,v 1.2 2009/01/11 02:46:26 christos Exp $");
6 #endif /* LIBC_SCCS and not lint */
8 #define __LIBC12_SOURCE__
11 #include <sys/timex.h>
12 #include <compat/sys/timex.h>
14 __warn_references(ntp_gettime
,
15 "warning: reference to compatibility ntp_gettime(); include <sys/timex.h> for correct reference")
18 ntp_gettime(struct ntptimeval30
*ontvp
)
20 struct ntptimeval ntv
;
23 res
= __ntp_gettime50(&ntv
);
24 ontvp
->time
.tv_sec
= (int32_t)ntv
.time
.tv_sec
;
25 ontvp
->time
.tv_usec
= ntv
.time
.tv_nsec
/ 1000;
26 ontvp
->maxerror
= ntv
.maxerror
;
27 ontvp
->esterror
= ntv
.esterror
;