1 1.1 drochner /* $NetBSD: compat_ntp_gettime.c,v 1.1 2006/05/29 10:02:56 drochner Exp $ */ 2 1.1 drochner 3 1.1 drochner #include <sys/cdefs.h> 4 1.1 drochner #if defined(LIBC_SCCS) && !defined(lint) 5 1.1 drochner __RCSID("$NetBSD: compat_ntp_gettime.c,v 1.1 2006/05/29 10:02:56 drochner Exp $"); 6 1.1 drochner #endif /* LIBC_SCCS and not lint */ 7 1.1 drochner 8 1.1 drochner #define __LIBC12_SOURCE__ 9 1.1 drochner 10 1.1 drochner #include <sys/time.h> 11 1.1 drochner #include <sys/timex.h> 12 1.1 drochner #include <compat/sys/timex.h> 13 1.1 drochner 14 1.1 drochner __warn_references(ntp_gettime, 15 1.1 drochner "warning: reference to compatibility ntp_gettime(); include <sys/timex.h> for correct reference") 16 1.1 drochner 17 1.1 drochner int 18 1.1 drochner ntp_gettime(struct ntptimeval30 *ontvp) 19 1.1 drochner { 20 1.1 drochner struct ntptimeval ntv; 21 1.1 drochner int res; 22 1.1 drochner 23 1.1 drochner res = __ntp_gettime30(&ntv); 24 1.1 drochner TIMESPEC_TO_TIMEVAL(&ontvp->time, &ntv.time); 25 1.1 drochner ontvp->maxerror = ntv.maxerror; 26 1.1 drochner ontvp->esterror = ntv.esterror; 27 1.1 drochner 28 1.1 drochner return (res); 29 1.1 drochner } 30