This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v3 4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
- From: Alistair Francis <alistair dot francis at wdc dot com>
- To: libc-alpha at sourceware dot org
- Cc: alistair23 at gmail dot com, Alistair Francis <alistair dot francis at wdc dot com>
- Date: Fri, 14 Feb 2020 08:31:30 -0800
- Subject: [PATCH v3 4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
- Ironport-sdr: vyBzTzUxSLvXw2EvRfxxoVRkSQN4fDxBgGiT9Y5myezdAqIfQe8xOhfPoab5j+viw4fN4R3vCw FoTMMxQMl7QlY+wVVLnK++8HYiqaw5UUANTz2X2n0j/cd0tPZTFZoV3IOlsN3bDV5pz57f0FzU V8oCMquI6fyo4fH5EpQxxPNIgL5vj5wRMEWdEybe+m0OjkL1Gj9zIW6YeCts4SoNMUfedi2lpg EThzYPqWKix5Giia6foakpj4MVNlmvjcJXFmqgOEYuzNfywOYHuthj9v8GnF/QTRlOPS1LCdo7 en4=
- Ironport-sdr: qwHBBJTnk+lD24vjgF1D3uF9cQX85NHDDK/M5V8U8n3/yeBzfRPXJasrHNDXpsphoT8Yp5yfR1 BFnjQFtdT7eRL7Yh/Iy53yMXSi40DPVdu6TOwG73ZnUkgCiufWl9nJeqn+O4ANKu01jNsapPZF ukanMeQiL8NwnLYbEG72UtJK6XW4Tzfz0hCfXsl5ngr+z7BDjBJAJUlZKwEdEhRiODazRxKHsn BH8VEWw2AWANmPjx1+6mO7kMNzM4ARigyyD4/2rsBrUup38oXTP1ykFKT4hgyB61n9iujZMSB2 LUOLhBUUJAXkHWNGAh57++E6
- Ironport-sdr: MVXoruu6PsuFR5hEugPWBPfpb35PQcCrGYd+k7rO0faKi1ts4dL1s/BmUh1kfHq34I01cpXppX txUfbfGMFTzdo9cXNxnAhFu8M+r4UluVgASoDlRosRtePQaJ+AVdo8y3x20ayWLI7pCOpMT+md jNBm8oEpsvfwmB8FCkx7JMiT0sAGfFeSW1QMEKhq6sV0ihDbb3loNgwjiX5XWZ0I8sr7//lU7n UY7cYFg+TSZ5FzsKjAfbYtS+zpLfEuGqy0b8Rtu9YpzWAYiWYX1ovDnYNBwqt+sEFHKahDuws8 dNk=
- References: <20200214163134.31601-1-alistair.francis@wdc.com>
- Wdcironportexception: Internal
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.
---
bits/typesizes.h | 6 ++++++
sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 3 +++
sysdeps/unix/sysv/linux/generic/bits/typesizes.h | 7 +++++++
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, 31 insertions(+)
diff --git a/bits/typesizes.h b/bits/typesizes.h
index 599408973e..8f16903a21 100644
--- a/bits/typesizes.h
+++ b/bits/typesizes.h
@@ -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'. */
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
index 28ee3e5920..e5d7774468 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
index 7c963e523e..48727c1da7 100644
--- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h
@@ -77,11 +77,18 @@
/* 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'. */
#define __FD_SETSIZE 1024
diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
index e775e460bb..2bc87c1079 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h
@@ -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'. */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
index ac48c23e37..288a902b5f 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
@@ -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'. */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
index 87c50a4f32..f68dfecc90 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h
@@ -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
--
2.25.0