This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v4 0/8] Always use 32-bit time_t for certain syscalls
- 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: Wed, 19 Feb 2020 10:10:49 -0800
- Subject: [PATCH v4 0/8] Always use 32-bit time_t for certain syscalls
- Ironport-sdr: 9cwbwLEdgaTsYnwouCfAUK890ZhiyFrbsH+M1/NfLBfrEjIvxQaWyW/6t5HR1AaVOkW1zm465O vZbgwTfwaE3ER2Dj6Mja9eUrjjbe+kh7y5DuIytLQtmrUM7TSNClSXF9vBbF3bE7hD1ZZlkDeM vxCU9hsh3TJ2UPMdJIt8U70ZzNZnMtOOcbzJP7TRMF59weII1g3wZ0hTpwdkUVmEHpiltxrij1 xihrv8PafEruYIACL5OY1TQ1gKIqb9UENNODEC3zURYzGrxIYv07qjjuzJ5pCVPxkkskGL6bjV vqU=
- Ironport-sdr: soHp06360F7Vmjy6hLLbPJg8jYmZuhxjysJiV/mSyYIBt+aWX1MY88LxqEhNWS0N71ygtLQU/Z W7glN1++zJgwwP1j/kR9SfLmzgix85yY/3p4yBgRAxxCV+Di+PuMEbh4+6xISkYFWQiheBLWTn qtbmzmXdgmwRs7budFgyb+KIAMgbsmJHfeKWZl+8bc6LBASqFijvBu25iZAZSQFSNgTzagl6wr GJvt1R5yo7rA5xnmgoNjlZC0KA+7NddB3Bwci4Pc2PeArTBncjxmvcDdZRXCxaUHB6S4FDlG6j etH+HY1awjRJz3qKREzXX4ri
- Ironport-sdr: y9bPCOUkhOoYmj2FwHQRbySJUR9dy7i9+NP9ORQNWMFK69KwKcfHRnML08YrdtqsF91LdqO+ch 9zBLiFa+fqohg5H8K6qkzZM2PbNSVOtPZvMCslgkmBPOoQqrvARpERYuA9Zj+DzJhuyKIAQ9td ayagdpvDkebZ7NJVuA4he1ZshaUiLMiXjZjBVAUWkXbF64+ifNvu3g5qOYEpz444O7O9IkFKxj TOJWhBqw1CkUsz0Jjzh6Ch7qWDns7mQt8RIw6xaNc8EjbQnIf77n3rQMEESVnRPe9NMMhVEU6l rw4=
- 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.
This series converts getitimer, setitimer, getrusage and wait4 to be
both y2038 safe and pass a 32-bit time_t based on the
__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 macro. On 32-bit systems
we will pass a 32-bit time to the kernel (no matter the time_t size). This is
no change for most 64-bit architectures or 32-bit architectures with a 32-bit time_t.
We can also remove the old Alpha functions as this is now handled genericly.
This follows the standard y2038 conversion so that we don't break
backwards compatibility but we expose a 64-bit version for y2038 safe
architectrures (like RV32).
This series was tested by running:
./scripts/build-many-glibcs.py ... compilers
./scripts/build-many-glibcs.py ... glibcs
on my x86_64 machine.
I also ran make check on RV32 and I only see a total of 10 test failures.
I don't have a way to test this on Alpha, would someone mind testing it for me?
Alistair Francis (8):
sysv/linux: Rename alpha functions to be alpha specific
time: Add a timeval with a 32-bit tv_sec and tv_usec
time: Add a __itimerval64 struct
sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
linux: Use long time_t __getitimer/__setitimer
resource: Add a __rusage64 struct
linux: Use long time_t for wait4/getrusage
sysv/alpha: Use generic __timeval32 and helpers
bits/typesizes.h | 6 +
include/sys/resource.h | 121 ++++++++++++++++++
include/time.h | 71 ++++++++++
sysdeps/unix/syscalls.list | 3 -
.../unix/sysv/linux/alpha/bits/typesizes.h | 3 +
sysdeps/unix/sysv/linux/alpha/osf_adjtime.c | 7 +-
sysdeps/unix/sysv/linux/alpha/osf_getitimer.c | 3 +-
sysdeps/unix/sysv/linux/alpha/osf_getrusage.c | 8 +-
.../unix/sysv/linux/alpha/osf_gettimeofday.c | 4 +-
sysdeps/unix/sysv/linux/alpha/osf_setitimer.c | 5 +-
.../unix/sysv/linux/alpha/osf_settimeofday.c | 4 +-
sysdeps/unix/sysv/linux/alpha/osf_utimes.c | 4 +-
sysdeps/unix/sysv/linux/alpha/osf_wait4.c | 8 +-
.../unix/sysv/linux/generic/bits/typesizes.h | 6 +
sysdeps/unix/sysv/linux/getitimer.c | 59 +++++++++
sysdeps/unix/sysv/linux/getrusage.c | 58 +++++++++
sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 6 +
sysdeps/unix/sysv/linux/setitimer.c | 95 ++++++++++++++
.../unix/sysv/linux/sparc/bits/typesizes.h | 6 +
.../unix/sysv/linux/{alpha => }/tv32-compat.h | 90 +++++--------
sysdeps/unix/sysv/linux/wait4.c | 50 +++++++-
sysdeps/unix/sysv/linux/x86/bits/typesizes.h | 3 +
22 files changed, 540 insertions(+), 80 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/getitimer.c
create mode 100644 sysdeps/unix/sysv/linux/getrusage.c
create mode 100644 sysdeps/unix/sysv/linux/setitimer.c
rename sysdeps/unix/sysv/linux/{alpha => }/tv32-compat.h (56%)
--
2.25.0