[v4,4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
Commit Message
On y2038 safe 32-bit systems the Linux kernel expects itimerval
and rusage to use a 32-bit time_t, even though the other time_t's
are 64-bit.
There are also other occurances where the time passed to the kernel via
timeval doesn't match the wordsize.
To handle these cases let's define a new macro
__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64. This macro specifies if the
kernel's old_timeval matches the new timeval64. This should be true for
64-bit architectures (expect for Alpha) and x32.
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---
bits/typesizes.h | 6 ++++++
sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 3 +++
sysdeps/unix/sysv/linux/generic/bits/typesizes.h | 6 ++++++
sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 6 ++++++
sysdeps/unix/sysv/linux/sparc/bits/typesizes.h | 6 ++++++
sysdeps/unix/sysv/linux/x86/bits/typesizes.h | 3 +++
6 files changed, 30 insertions(+)
@@ -76,10 +76,16 @@
/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
# define __STATFS_MATCHES_STATFS64 1
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
#else
# define __RLIM_T_MATCHES_RLIM64_T 0
# define __STATFS_MATCHES_STATFS64 0
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
@@ -73,6 +73,9 @@
/* Not for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
# define __STATFS_MATCHES_STATFS64 0
+/* And for getitimer, setitimer and rusage */
+#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
+
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
@@ -77,11 +77,17 @@
/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
# define __STATFS_MATCHES_STATFS64 1
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
#else
# define __RLIM_T_MATCHES_RLIM64_T 0
# define __STATFS_MATCHES_STATFS64 0
+
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
#endif
+
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
@@ -82,10 +82,16 @@
/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
# define __STATFS_MATCHES_STATFS64 1
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
#else
# define __RLIM_T_MATCHES_RLIM64_T 0
# define __STATFS_MATCHES_STATFS64 0
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
@@ -76,10 +76,16 @@
/* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */
# define __STATFS_MATCHES_STATFS64 1
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
#else
# define __RLIM_T_MATCHES_RLIM64_T 0
# define __STATFS_MATCHES_STATFS64 0
+
+/* And for getitimer, setitimer and rusage */
+# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0
#endif
/* Number of descriptors that can fit in an `fd_set'. */
@@ -94,6 +94,9 @@
# define __STATFS_MATCHES_STATFS64 0
#endif
+/* And for getitimer, setitimer and rusage */
+#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1
+
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024