xref: /minix3/lib/libc/compat/sys/compat___ntp_gettime30.c (revision 2fe8fb192fe7e8720e3e7a77f928da545e872a6a)
1*2fe8fb19SBen Gras /* $NetBSD: compat___ntp_gettime30.c,v 1.2 2009/01/11 02:46:26 christos Exp $ */
2*2fe8fb19SBen Gras 
3*2fe8fb19SBen Gras #include <sys/cdefs.h>
4*2fe8fb19SBen Gras #if defined(LIBC_SCCS) && !defined(lint)
5*2fe8fb19SBen Gras __RCSID("$NetBSD: compat___ntp_gettime30.c,v 1.2 2009/01/11 02:46:26 christos Exp $");
6*2fe8fb19SBen Gras #endif /* LIBC_SCCS and not lint */
7*2fe8fb19SBen Gras 
8*2fe8fb19SBen Gras #define __LIBC12_SOURCE__
9*2fe8fb19SBen Gras 
10*2fe8fb19SBen Gras #include <sys/time.h>
11*2fe8fb19SBen Gras #include <sys/timex.h>
12*2fe8fb19SBen Gras #include <compat/sys/timex.h>
13*2fe8fb19SBen Gras 
14*2fe8fb19SBen Gras __warn_references(__ntp_gettime30,
15*2fe8fb19SBen Gras     "warning: reference to compatibility __ntp_gettime30(); include <sys/timex.h> for correct reference")
16*2fe8fb19SBen Gras 
17*2fe8fb19SBen Gras int
__ntp_gettime30(struct ntptimeval50 * ontvp)18*2fe8fb19SBen Gras __ntp_gettime30(struct ntptimeval50 *ontvp)
19*2fe8fb19SBen Gras {
20*2fe8fb19SBen Gras 	struct ntptimeval ntv;
21*2fe8fb19SBen Gras 	int res;
22*2fe8fb19SBen Gras 
23*2fe8fb19SBen Gras 	res = __ntp_gettime50(&ntv);
24*2fe8fb19SBen Gras 	ontvp->time.tv_sec = (int32_t)ntv.time.tv_sec;
25*2fe8fb19SBen Gras 	ontvp->time.tv_nsec = ntv.time.tv_nsec;
26*2fe8fb19SBen Gras 	ontvp->maxerror = ntv.maxerror;
27*2fe8fb19SBen Gras 	ontvp->esterror = ntv.esterror;
28*2fe8fb19SBen Gras 
29*2fe8fb19SBen Gras 	return (res);
30*2fe8fb19SBen Gras }
31