summaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-10-25 22:46:48 +0200
committerArnd Bergmann <arnd@arndb.de>2019-11-15 14:38:29 +0100
commitbdd565f817a74b9e30edec108f7cb1dbc762b8a6 (patch)
treece401e7b12bc0c3c77af23ba8e1fd18f223ee040 /include/uapi
parenty2038: uapi: change __kernel_time_t to __kernel_old_time_t (diff)
downloadlinux-bdd565f817a74b9e30edec108f7cb1dbc762b8a6.tar.xz
linux-bdd565f817a74b9e30edec108f7cb1dbc762b8a6.zip
y2038: rusage: use __kernel_old_timeval
There are two 'struct timeval' fields in 'struct rusage'. Unfortunately the definition of timeval is now ambiguous when used in user space with a libc that has a 64-bit time_t, and this also changes the 'rusage' definition in user space in a way that is incompatible with the system call interface. While there is no good solution to avoid all ambiguity here, change the definition in the kernel headers to be compatible with the kernel ABI, using __kernel_old_timeval as an unambiguous base type. In previous discussions, there was also a plan to add a replacement for rusage based on 64-bit timestamps and nanosecond resolution, i.e. 'struct __kernel_timespec'. I have patches for that as well, if anyone thinks we should do that. Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/resource.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
index cc00fd079631..74ef57b38f9f 100644
--- a/include/uapi/linux/resource.h
+++ b/include/uapi/linux/resource.h
@@ -22,8 +22,8 @@
#define RUSAGE_THREAD 1 /* only the calling thread */
struct rusage {
- struct timeval ru_utime; /* user time used */
- struct timeval ru_stime; /* system time used */
+ struct __kernel_old_timeval ru_utime; /* user time used */
+ struct __kernel_old_timeval ru_stime; /* system time used */
__kernel_long_t ru_maxrss; /* maximum resident set size */
__kernel_long_t ru_ixrss; /* integral shared memory size */
__kernel_long_t ru_idrss; /* integral unshared data size */