Home | History | Annotate | Line # | Download | only in sys
      1  1.2  christos /*	$NetBSD: timex.h,v 1.2 2009/01/11 02:45:50 christos Exp $	*/
      2  1.1  drochner 
      3  1.2  christos /*-
      4  1.2  christos  ***********************************************************************
      5  1.2  christos  *								       *
      6  1.2  christos  * Copyright (c) David L. Mills 1993-2001			       *
      7  1.2  christos  *								       *
      8  1.2  christos  * Permission to use, copy, modify, and distribute this software and   *
      9  1.2  christos  * its documentation for any purpose and without fee is hereby	       *
     10  1.2  christos  * granted, provided that the above copyright notice appears in all    *
     11  1.2  christos  * copies and that both the copyright notice and this permission       *
     12  1.2  christos  * notice appear in supporting documentation, and that the name        *
     13  1.2  christos  * University of Delaware not be used in advertising or publicity      *
     14  1.2  christos  * pertaining to distribution of the software without specific,	       *
     15  1.2  christos  * written prior permission. The University of Delaware makes no       *
     16  1.2  christos  * representations about the suitability this software for any	       *
     17  1.2  christos  * purpose. It is provided "as is" without express or implied	       *
     18  1.2  christos  * warranty.							       *
     19  1.2  christos  *								       *
     20  1.2  christos  **********************************************************************/
     21  1.2  christos #ifndef _COMPAT_SYS_TIMEX_H_
     22  1.2  christos #define _COMPAT_SYS_TIMEX_H_ 1
     23  1.2  christos 
     24  1.2  christos #include <compat/sys/time.h>
     25  1.2  christos /*
     26  1.2  christos  * NTP user interface (ntp_gettime()) - used to read kernel clock values
     27  1.2  christos  *
     28  1.2  christos  * Note: The time member is in microseconds if STA_NANO is zero and
     29  1.2  christos  * nanoseconds if not.
     30  1.2  christos  */
     31  1.2  christos struct ntptimeval50 {
     32  1.2  christos 	struct timespec50 time;	/* current time (ns) (ro) */
     33  1.2  christos 	long maxerror;		/* maximum error (us) (ro) */
     34  1.2  christos 	long esterror;		/* estimated error (us) (ro) */
     35  1.2  christos 	long tai;		/* TAI offset */
     36  1.2  christos 	int time_state;		/* time status */
     37  1.2  christos };
     38  1.1  drochner 
     39  1.1  drochner struct ntptimeval30 {
     40  1.2  christos 	struct timeval50 time;	/* current time (ro) */
     41  1.1  drochner 	long maxerror;		/* maximum error (us) (ro) */
     42  1.1  drochner 	long esterror;		/* estimated error (us) (ro) */
     43  1.1  drochner };
     44  1.1  drochner 
     45  1.1  drochner #ifndef _KERNEL
     46  1.2  christos #include <sys/cdefs.h>
     47  1.2  christos __BEGIN_DECLS
     48  1.2  christos int	ntp_gettime(struct ntptimeval30 *);
     49  1.2  christos int	__ntp_gettime30(struct ntptimeval50 *);
     50  1.2  christos int	__ntp_gettime50(struct ntptimeval *);
     51  1.2  christos __END_DECLS
     52  1.2  christos #endif /* !_KERNEL */
     53  1.2  christos 
     54  1.2  christos #endif /* _COMPAT_SYS_TIMEX_H_ */
     55