Commit c766d147 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds

y2038: hide timeval/timespec/itimerval/itimerspec types

There are no in-kernel users remaining, but there may still be users that
include linux/time.h instead of sys/time.h from user space, so leave the
types available to user space while hiding them from kernel space.

Only the __kernel_old_* versions of these types remain now.

Link: http://lkml.kernel.org/r/20200110154232.4104492-4-arnd@arndb.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Deepa Dinamani <deepa.kernel@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 412c53a6
...@@ -87,7 +87,9 @@ typedef struct { ...@@ -87,7 +87,9 @@ typedef struct {
typedef __kernel_long_t __kernel_off_t; typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t; typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t; typedef __kernel_long_t __kernel_old_time_t;
#ifndef __KERNEL__
typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_time_t;
#endif
typedef long long __kernel_time64_t; typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t; typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t; typedef int __kernel_timer_t;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/time_types.h> #include <linux/time_types.h>
#ifndef __KERNEL__
#ifndef _STRUCT_TIMESPEC #ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC #define _STRUCT_TIMESPEC
struct timespec { struct timespec {
...@@ -18,6 +19,17 @@ struct timeval { ...@@ -18,6 +19,17 @@ struct timeval {
__kernel_suseconds_t tv_usec; /* microseconds */ __kernel_suseconds_t tv_usec; /* microseconds */
}; };
struct itimerspec {
struct timespec it_interval;/* timer period */
struct timespec it_value; /* timer expiration */
};
struct itimerval {
struct timeval it_interval;/* timer interval */
struct timeval it_value; /* current value */
};
#endif
struct timezone { struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */ int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */ int tz_dsttime; /* type of dst correction */
...@@ -31,16 +43,6 @@ struct timezone { ...@@ -31,16 +43,6 @@ struct timezone {
#define ITIMER_VIRTUAL 1 #define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2 #define ITIMER_PROF 2
struct itimerspec {
struct timespec it_interval; /* timer period */
struct timespec it_value; /* timer expiration */
};
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
/* /*
* The IDs of the various system clocks (for POSIX.1b interval timers): * The IDs of the various system clocks (for POSIX.1b interval timers):
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment