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