1
0

time.h 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _SYS_TIME_H_
  2. #define _SYS_TIME_H_
  3. #include <time.h>
  4. #include <sys/types.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #ifndef _TIMEVAL_DEFINED
  9. #define _TIMEVAL_DEFINED
  10. /*
  11. * Structure returned by gettimeofday(2) system call,
  12. * and used in other calls.
  13. */
  14. struct timeval {
  15. long tv_sec; /* seconds */
  16. long tv_usec; /* and microseconds */
  17. };
  18. #endif /* _TIMEVAL_DEFINED */
  19. #ifndef _TIMESPEC_DEFINED
  20. #define _TIMESPEC_DEFINED
  21. /*
  22. * Structure defined by POSIX.1b to be like a timeval.
  23. */
  24. struct timespec {
  25. time_t tv_sec; /* seconds */
  26. long tv_nsec; /* and nanoseconds */
  27. };
  28. #endif /* _TIMESPEC_DEFINED */
  29. struct timezone {
  30. int tz_minuteswest; /* minutes west of Greenwich */
  31. int tz_dsttime; /* type of dst correction */
  32. };
  33. int gettimeofday(struct timeval *tp, void *ignore);
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #endif /* _SYS_TIME_H_ */