time.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _SYS_TIME_H
  2. #define _SYS_TIME_H
  3. #include <features.h>
  4. #include <linux/types.h>
  5. #include <linux/time.h>
  6. #define DST_NONE 0 /* not on dst */
  7. #define DST_USA 1 /* USA style dst */
  8. #define DST_AUST 2 /* Australian style dst */
  9. #define DST_WET 3 /* Western European dst */
  10. #define DST_MET 4 /* Middle European dst */
  11. #define DST_EET 5 /* Eastern European dst */
  12. #define DST_CAN 6 /* Canada */
  13. #define DST_GB 7 /* Great Britain and Eire */
  14. #define DST_RUM 8 /* Rumania */
  15. #define DST_TUR 9 /* Turkey */
  16. #define DST_AUSTALT 10 /* Australian style with shift in 1986 */
  17. #ifdef __SVR4_I386_ABI_L1__
  18. typedef struct timestruc {
  19. time_t tv_sec;
  20. long tv_nsec;
  21. } timestruc_t;
  22. #endif /* __SVR4_I386_ABI_L1__ */
  23. /*
  24. * Operations on timevals.
  25. *
  26. * NB: timercmp does not work for >= or <=.
  27. *
  28. */
  29. #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
  30. #define timercmp(tvp, uvp, cmp) \
  31. (((tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) \
  32. || (tvp)->tv_sec cmp (uvp)->tv_sec)
  33. #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
  34. #include <time.h>
  35. #include <sys/types.h>
  36. __BEGIN_DECLS
  37. extern int __gettimeofday __P ((struct timeval * __tp,
  38. struct timezone * __tz));
  39. extern int gettimeofday __P ((struct timeval * __tp,
  40. struct timezone * __tz));
  41. extern int __settimeofday __P ((__const struct timeval *__tv,
  42. __const struct timezone *__tz));
  43. extern int settimeofday __P ((__const struct timeval *__tv,
  44. __const struct timezone *__tz));
  45. extern int __select __P ((int __width, fd_set * __readfds,
  46. fd_set * __writefds, fd_set * __exceptfds,
  47. struct timeval * __timeout));
  48. extern int select __P ((int __width, fd_set * __readfds,
  49. fd_set * __writefds, fd_set * __exceptfds,
  50. struct timeval * __timeout));
  51. extern int __getitimer __P ((int __which,
  52. struct itimerval *__value));
  53. extern int getitimer __P ((int __which,
  54. struct itimerval *__value));
  55. extern int __setitimer __P ((int __which,
  56. __const struct itimerval *__value,
  57. struct itimerval *__ovalue));
  58. extern int setitimer __P ((int __which,
  59. __const struct itimerval *__value,
  60. struct itimerval *__ovalue));
  61. extern int __adjtime __P ((struct timeval * __itv,
  62. struct timeval * __otv));
  63. extern int adjtime __P ((struct timeval * __itv,
  64. struct timeval * __otv));
  65. extern int __utimes __P((char *__path, struct timeval *tvp));
  66. extern int utimes __P((char *__path, struct timeval *tvp));
  67. __END_DECLS
  68. #endif /*_SYS_TIME_H*/