timex.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* Copyright (C) 1995-2016 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _SYS_TIMEX_H
  15. #define _SYS_TIMEX_H 1
  16. #include <features.h>
  17. #include <sys/time.h>
  18. /* These definitions from linux/timex.h as of 2.6.30. */
  19. #include <bits/timex.h>
  20. #define NTP_API 4 /* NTP API version */
  21. struct ntptimeval
  22. {
  23. struct timeval time; /* current time (ro) */
  24. long int maxerror; /* maximum error (us) (ro) */
  25. long int esterror; /* estimated error (us) (ro) */
  26. long int tai; /* TAI offset (ro) */
  27. long int __glibc_reserved1;
  28. long int __glibc_reserved2;
  29. long int __glibc_reserved3;
  30. long int __glibc_reserved4;
  31. };
  32. /* Clock states (time_state) */
  33. #define TIME_OK 0 /* clock synchronized, no leap second */
  34. #define TIME_INS 1 /* insert leap second */
  35. #define TIME_DEL 2 /* delete leap second */
  36. #define TIME_OOP 3 /* leap second in progress */
  37. #define TIME_WAIT 4 /* leap second has occurred */
  38. #define TIME_ERROR 5 /* clock not synchronized */
  39. #define TIME_BAD TIME_ERROR /* bw compat */
  40. /* Maximum time constant of the PLL. */
  41. #define MAXTC 6
  42. __BEGIN_DECLS
  43. extern int __adjtimex (struct timex *__ntx) __THROW;
  44. extern int adjtimex (struct timex *__ntx) __THROW;
  45. #ifdef __REDIRECT_NTH
  46. extern int __REDIRECT_NTH (ntp_gettime, (struct ntptimeval *__ntv),
  47. ntp_gettimex);
  48. #else
  49. extern int ntp_gettimex (struct ntptimeval *__ntv) __THROW;
  50. # define ntp_gettime ntp_gettimex
  51. #endif
  52. extern int ntp_adjtime (struct timex *__tntx) __THROW;
  53. __END_DECLS
  54. #endif /* sys/timex.h */