time.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef _UAPI_LINUX_TIME_H
  2. #define _UAPI_LINUX_TIME_H
  3. #include <linux/types.h>
  4. #ifndef _STRUCT_TIMESPEC
  5. #define _STRUCT_TIMESPEC
  6. struct timespec {
  7. __kernel_time_t tv_sec; /* seconds */
  8. long tv_nsec; /* nanoseconds */
  9. };
  10. #endif
  11. struct timeval {
  12. __kernel_time_t tv_sec; /* seconds */
  13. __kernel_suseconds_t tv_usec; /* microseconds */
  14. };
  15. struct timezone {
  16. int tz_minuteswest; /* minutes west of Greenwich */
  17. int tz_dsttime; /* type of dst correction */
  18. };
  19. /*
  20. * Names of the interval timers, and structure
  21. * defining a timer setting:
  22. */
  23. #define ITIMER_REAL 0
  24. #define ITIMER_VIRTUAL 1
  25. #define ITIMER_PROF 2
  26. struct itimerspec {
  27. struct timespec it_interval; /* timer period */
  28. struct timespec it_value; /* timer expiration */
  29. };
  30. struct itimerval {
  31. struct timeval it_interval; /* timer interval */
  32. struct timeval it_value; /* current value */
  33. };
  34. /*
  35. * The IDs of the various system clocks (for POSIX.1b interval timers):
  36. */
  37. #define CLOCK_REALTIME 0
  38. #define CLOCK_MONOTONIC 1
  39. #define CLOCK_PROCESS_CPUTIME_ID 2
  40. #define CLOCK_THREAD_CPUTIME_ID 3
  41. #define CLOCK_MONOTONIC_RAW 4
  42. #define CLOCK_REALTIME_COARSE 5
  43. #define CLOCK_MONOTONIC_COARSE 6
  44. #define CLOCK_BOOTTIME 7
  45. #define CLOCK_REALTIME_ALARM 8
  46. #define CLOCK_BOOTTIME_ALARM 9
  47. /*
  48. * The IDs of various hardware clocks:
  49. */
  50. #define CLOCK_SGI_CYCLE 10
  51. #define MAX_CLOCKS 16
  52. #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
  53. #define CLOCKS_MONO CLOCK_MONOTONIC
  54. /*
  55. * The various flags for setting POSIX.1b interval timers:
  56. */
  57. #define TIMER_ABSTIME 0x01
  58. #endif /* _UAPI_LINUX_TIME_H */