Skip to content

Commit

Permalink
y2038: add __kernel_old_timespec and __kernel_old_time_t
Browse files Browse the repository at this point in the history
The 'struct timespec' definition can no longer be part of the uapi headers
because it conflicts with a a now incompatible libc definition. Also,
we really want to remove it in order to prevent new uses from creeping in.

The same namespace conflict exists with time_t, which should also be
removed. __kernel_time_t could be used safely, but adding 'old' in the
name makes it clearer that this should not be used for new interfaces.

Add a replacement __kernel_old_timespec structure and __kernel_old_time_t
along the lines of __kernel_old_timeval.

Acked-by: Deepa Dinamani <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
arndb committed Nov 15, 2019
1 parent 3ca47e9 commit 94c467d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/asm-generic/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ typedef struct {
*/
typedef __kernel_long_t __kernel_off_t;
typedef long long __kernel_loff_t;
typedef __kernel_long_t __kernel_old_time_t;
typedef __kernel_long_t __kernel_time_t;
typedef long long __kernel_time64_t;
typedef __kernel_long_t __kernel_clock_t;
Expand Down
5 changes: 5 additions & 0 deletions include/uapi/linux/time_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ struct __kernel_old_timeval {
};
#endif

struct __kernel_old_timespec {
__kernel_time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};

struct __kernel_sock_timeval {
__s64 tv_sec;
__s64 tv_usec;
Expand Down

0 comments on commit 94c467d

Please sign in to comment.