time.h 976 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #if defined ( __ICCARM__ ) && (__VER__ >= 8011002)
  20. #define _TIMESPEC_DEFINED
  21. #endif
  22. #ifndef _TIMESPEC_DEFINED
  23. #define _TIMESPEC_DEFINED
  24. /*
  25. * Structure defined by POSIX.1b to be like a timeval.
  26. */
  27. struct timespec {
  28. time_t tv_sec; /* seconds */
  29. long tv_nsec; /* and nanoseconds */
  30. };
  31. #endif /* _TIMESPEC_DEFINED */
  32. struct timezone {
  33. int tz_minuteswest; /* minutes west of Greenwich */
  34. int tz_dsttime; /* type of dst correction */
  35. };
  36. int gettimeofday(struct timeval *tp, void *ignore);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif /* _SYS_TIME_H_ */