time.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_LINUX_TIME_H
  3. #define _UAPI_LINUX_TIME_H
  4. #include <linux/types.h>
  5. #include <linux/time_types.h>
  6. #ifndef __KERNEL__
  7. #ifndef _STRUCT_TIMESPEC
  8. #define _STRUCT_TIMESPEC
  9. struct timespec {
  10. __kernel_old_time_t tv_sec; /* seconds */
  11. long tv_nsec; /* nanoseconds */
  12. };
  13. #endif
  14. struct timeval {
  15. __kernel_old_time_t tv_sec; /* seconds */
  16. __kernel_suseconds_t tv_usec; /* microseconds */
  17. };
  18. struct itimerspec {
  19. struct timespec it_interval;/* timer period */
  20. struct timespec it_value; /* timer expiration */
  21. };
  22. struct itimerval {
  23. struct timeval it_interval;/* timer interval */
  24. struct timeval it_value; /* current value */
  25. };
  26. #endif
  27. struct timezone {
  28. int tz_minuteswest; /* minutes west of Greenwich */
  29. int tz_dsttime; /* type of dst correction */
  30. };
  31. /*
  32. * Names of the interval timers, and structure
  33. * defining a timer setting:
  34. */
  35. #define ITIMER_REAL 0
  36. #define ITIMER_VIRTUAL 1
  37. #define ITIMER_PROF 2
  38. /*
  39. * The IDs of the various system clocks (for POSIX.1b interval timers):
  40. */
  41. #define CLOCK_REALTIME 0
  42. #define CLOCK_MONOTONIC 1
  43. #define CLOCK_PROCESS_CPUTIME_ID 2
  44. #define CLOCK_THREAD_CPUTIME_ID 3
  45. #define CLOCK_MONOTONIC_RAW 4
  46. #define CLOCK_REALTIME_COARSE 5
  47. #define CLOCK_MONOTONIC_COARSE 6
  48. #define CLOCK_BOOTTIME 7
  49. #define CLOCK_REALTIME_ALARM 8
  50. #define CLOCK_BOOTTIME_ALARM 9
  51. /*
  52. * The driver implementing this got removed. The clock ID is kept as a
  53. * place holder. Do not reuse!
  54. */
  55. #define CLOCK_SGI_CYCLE 10
  56. #define CLOCK_TAI 11
  57. #define MAX_CLOCKS 16
  58. #define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
  59. #define CLOCKS_MONO CLOCK_MONOTONIC
  60. /*
  61. * The various flags for setting POSIX.1b interval timers:
  62. */
  63. #define TIMER_ABSTIME 0x01
  64. #endif /* _UAPI_LINUX_TIME_H */