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