Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

y2038: add __kernel_old_timespec and __kernel_old_time_t

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 <deepa.kernel@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+6
+1
include/uapi/asm-generic/posix_types.h
··· 86 86 */ 87 87 typedef __kernel_long_t __kernel_off_t; 88 88 typedef long long __kernel_loff_t; 89 + typedef __kernel_long_t __kernel_old_time_t; 89 90 typedef __kernel_long_t __kernel_time_t; 90 91 typedef long long __kernel_time64_t; 91 92 typedef __kernel_long_t __kernel_clock_t;
+5
include/uapi/linux/time_types.h
··· 28 28 }; 29 29 #endif 30 30 31 + struct __kernel_old_timespec { 32 + __kernel_time_t tv_sec; /* seconds */ 33 + long tv_nsec; /* nanoseconds */ 34 + }; 35 + 31 36 struct __kernel_sock_timeval { 32 37 __s64 tv_sec; 33 38 __s64 tv_usec;