time.h 1.0 KB

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