xref: /linux/include/uapi/linux/time_types.h (revision 8dd06ef34b6e2f41b29fbf5fc1663780f2524285)
1ca5e9abaSDeepa Dinamani /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2ca5e9abaSDeepa Dinamani #ifndef _UAPI_LINUX_TIME_TYPES_H
3ca5e9abaSDeepa Dinamani #define _UAPI_LINUX_TIME_TYPES_H
4ca5e9abaSDeepa Dinamani 
5ca5e9abaSDeepa Dinamani #include <linux/types.h>
6ca5e9abaSDeepa Dinamani 
7ca5e9abaSDeepa Dinamani struct __kernel_timespec {
8ca5e9abaSDeepa Dinamani 	__kernel_time64_t       tv_sec;                 /* seconds */
9ca5e9abaSDeepa Dinamani 	long long               tv_nsec;                /* nanoseconds */
10ca5e9abaSDeepa Dinamani };
11ca5e9abaSDeepa Dinamani 
12ca5e9abaSDeepa Dinamani struct __kernel_itimerspec {
13ca5e9abaSDeepa Dinamani 	struct __kernel_timespec it_interval;    /* timer period */
14ca5e9abaSDeepa Dinamani 	struct __kernel_timespec it_value;       /* timer expiration */
15ca5e9abaSDeepa Dinamani };
16ca5e9abaSDeepa Dinamani 
17ca5e9abaSDeepa Dinamani /*
18ca5e9abaSDeepa Dinamani  * legacy timeval structure, only embedded in structures that
19ca5e9abaSDeepa Dinamani  * traditionally used 'timeval' to pass time intervals (not absolute
20ca5e9abaSDeepa Dinamani  * times). Do not add new users. If user space fails to compile
21ca5e9abaSDeepa Dinamani  * here, this is probably because it is not y2038 safe and needs to
22ca5e9abaSDeepa Dinamani  * be changed to use another interface.
23ca5e9abaSDeepa Dinamani  */
24ca5e9abaSDeepa Dinamani #ifndef __kernel_old_timeval
25ca5e9abaSDeepa Dinamani struct __kernel_old_timeval {
26ca5e9abaSDeepa Dinamani 	__kernel_long_t tv_sec;
27ca5e9abaSDeepa Dinamani 	__kernel_long_t tv_usec;
28ca5e9abaSDeepa Dinamani };
29ca5e9abaSDeepa Dinamani #endif
30ca5e9abaSDeepa Dinamani 
3194c467ddSArnd Bergmann struct __kernel_old_timespec {
322a785996SArnd Bergmann 	__kernel_old_time_t	tv_sec;		/* seconds */
3394c467ddSArnd Bergmann 	long			tv_nsec;	/* nanoseconds */
3494c467ddSArnd Bergmann };
3594c467ddSArnd Bergmann 
36*4f9fbd89SArnd Bergmann struct __kernel_old_itimerval {
37*4f9fbd89SArnd Bergmann 	struct __kernel_old_timeval it_interval;/* timer interval */
38*4f9fbd89SArnd Bergmann 	struct __kernel_old_timeval it_value;	/* current value */
39*4f9fbd89SArnd Bergmann };
40*4f9fbd89SArnd Bergmann 
41ca5e9abaSDeepa Dinamani struct __kernel_sock_timeval {
42ca5e9abaSDeepa Dinamani 	__s64 tv_sec;
43ca5e9abaSDeepa Dinamani 	__s64 tv_usec;
44ca5e9abaSDeepa Dinamani };
45ca5e9abaSDeepa Dinamani 
46ca5e9abaSDeepa Dinamani #endif /* _UAPI_LINUX_TIME_TYPES_H */
47