Skip to content

Commit

Permalink
y2038: hide timeval/timespec/itimerval/itimerspec types
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Cc: Deepa Dinamani <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
arndb authored and torvalds committed Feb 21, 2020
1 parent 412c53a commit c766d14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 2 additions & 0 deletions include/uapi/asm-generic/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ typedef struct {
typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
#ifndef __KERNEL__
typedef __kernel_long_t __kernel_time_t;
#endif
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
typedef int __kernel_timer_t;
Expand Down
22 changes: 12 additions & 10 deletions include/uapi/linux/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <linux/types.h>
#include <linux/time_types.h>

#ifndef __KERNEL__
#ifndef _STRUCT_TIMESPEC
#define _STRUCT_TIMESPEC
struct timespec {
Expand All @@ -18,6 +19,17 @@ struct timeval {
__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 {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
Expand All @@ -31,16 +43,6 @@ struct timezone {
#define ITIMER_VIRTUAL 1
#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):
*/
Expand Down

0 comments on commit c766d14

Please sign in to comment.