time.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _SYS_TIME_H_
  2. #define _SYS_TIME_H_
  3. #include <sys/types.h>
  4. typedef long time_t;
  5. /*
  6. * Structure returned by gettimeofday(2) system call,
  7. * and used in other calls.
  8. */
  9. struct timeval {
  10. long tv_sec; /* seconds */
  11. long tv_usec; /* and microseconds */
  12. };
  13. /*
  14. * Structure defined by POSIX.1b to be like a timeval.
  15. */
  16. struct timespec {
  17. time_t tv_sec; /* seconds */
  18. long tv_nsec; /* and nanoseconds */
  19. };
  20. struct timezone {
  21. int tz_minuteswest; /* minutes west of Greenwich */
  22. int tz_dsttime; /* type of dst correction */
  23. };
  24. struct tm {
  25. int tm_sec; /* Seconds. [0-60] (1 leap second) */
  26. int tm_min; /* Minutes. [0-59] */
  27. int tm_hour; /* Hours. [0-23] */
  28. int tm_mday; /* Day. [1-31] */
  29. int tm_mon; /* Month. [0-11] */
  30. int tm_year; /* Year - 1900. */
  31. int tm_wday; /* Day of week. [0-6] */
  32. int tm_yday; /* Days in year.[0-365] */
  33. int tm_isdst; /* DST. [-1/0/1]*/
  34. long int tm_gmtoff; /* Seconds east of UTC. */
  35. const char *tm_zone; /* Timezone abbreviation. */
  36. };
  37. int gettimeofday(struct timeval *tp, void *ignore);
  38. #endif