Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI_LINUX_TIME_H
0003 #define _UAPI_LINUX_TIME_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/time_types.h>
0007 
0008 #ifndef __KERNEL__
0009 #ifndef _STRUCT_TIMESPEC
0010 #define _STRUCT_TIMESPEC
0011 struct timespec {
0012     __kernel_old_time_t tv_sec;     /* seconds */
0013     long            tv_nsec;    /* nanoseconds */
0014 };
0015 #endif
0016 
0017 struct timeval {
0018     __kernel_old_time_t tv_sec;     /* seconds */
0019     __kernel_suseconds_t    tv_usec;    /* microseconds */
0020 };
0021 
0022 struct itimerspec {
0023     struct timespec it_interval;/* timer period */
0024     struct timespec it_value;   /* timer expiration */
0025 };
0026 
0027 struct itimerval {
0028     struct timeval it_interval;/* timer interval */
0029     struct timeval it_value;    /* current value */
0030 };
0031 #endif
0032 
0033 struct timezone {
0034     int tz_minuteswest; /* minutes west of Greenwich */
0035     int tz_dsttime; /* type of dst correction */
0036 };
0037 
0038 /*
0039  * Names of the interval timers, and structure
0040  * defining a timer setting:
0041  */
0042 #define ITIMER_REAL     0
0043 #define ITIMER_VIRTUAL      1
0044 #define ITIMER_PROF     2
0045 
0046 /*
0047  * The IDs of the various system clocks (for POSIX.1b interval timers):
0048  */
0049 #define CLOCK_REALTIME          0
0050 #define CLOCK_MONOTONIC         1
0051 #define CLOCK_PROCESS_CPUTIME_ID    2
0052 #define CLOCK_THREAD_CPUTIME_ID     3
0053 #define CLOCK_MONOTONIC_RAW     4
0054 #define CLOCK_REALTIME_COARSE       5
0055 #define CLOCK_MONOTONIC_COARSE      6
0056 #define CLOCK_BOOTTIME          7
0057 #define CLOCK_REALTIME_ALARM        8
0058 #define CLOCK_BOOTTIME_ALARM        9
0059 /*
0060  * The driver implementing this got removed. The clock ID is kept as a
0061  * place holder. Do not reuse!
0062  */
0063 #define CLOCK_SGI_CYCLE         10
0064 #define CLOCK_TAI           11
0065 
0066 #define MAX_CLOCKS          16
0067 #define CLOCKS_MASK         (CLOCK_REALTIME | CLOCK_MONOTONIC)
0068 #define CLOCKS_MONO         CLOCK_MONOTONIC
0069 
0070 /*
0071  * The various flags for setting POSIX.1b interval timers:
0072  */
0073 #define TIMER_ABSTIME           0x01
0074 
0075 #endif /* _UAPI_LINUX_TIME_H */