This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v2 0/6] Always use long 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: Mon, 10 Feb 2020 09:43:19 -0800
- Subject: [PATCH v2 0/6] Always use long time_t for certain syscalls
- Ironport-sdr: TvnBhLmnk04pEEh4LA6UlyWtDbg09bMtlBZ4dXwrqreYEEz9hLErUo3YhVqhD6QF8PMJOkal/a C0KxgncBWmYx1ZsWqBelDLhqBnZ07T+PUwbVDoRT5MU6d/MZf9NkNCljRtSM7GXkdbViefZXke Kl75vi2m0Osws9aWT/znSs2F6KMoavYuiuQ9I8mEeFY78ZvwVKfGtagE8Cl5or3957aeoPj7ng NK8Rpifot5i45EkyAO7udWw6olB4DiXoW0FIL5leSspL49TZnZ/TPVOYP2KllOckWM3rN89Hhl Kms=
- Ironport-sdr: S48SZ+tkfy/OKXvdbhzgzme9Q4dk43SJGlxl7NbMFclKcKxfCJYTGE/ZpBrs8O4pv7Fo6CBOVv 7odqNaUNzmnLl9AmYuI/iZcY+qSz4msKvu8NnzLrv/UeiiZzkQwGE/J8OWNY9pn7oMcVGgpVvu Y4UvTztlp2tuiTL+GeucjQEzpMCvzZxsxUfkCayvWs9qWWnA90xDmZYrAT4GnTUL6iZuuSr6xJ 06itm4RHVvcFZz50cYg9brvQcm9Dqe5Nu2fJ77Os8UE6Xxv3/R7Nh+rDeDU/lOqcqQnPOwXNj1 2rvB3Ds9Bw8FcDeCbqgaCx9T
- Ironport-sdr: 22j4GyhpeoF42M7y0R7UWfkx1gvEY3rIz43/IKkuvFpN/vZtRoezAvNPzN0Soxr3hvoAfFsYMW RxGPcnFcKOphCA6BgJlRwNmPUHi9G4WVofwHzR5ebSnDSAiM+KIaE09CA328JpiD/m0OGTKHSx VgorwFl+XcTpdE6l+D5pqUZKQy0pOGh1td+TlelVes9rdYyquaBY8hDst5lUl5mDuEtdJKfDUE ILaXvNBumSJuoJDN+Cag/0VtpsBIY2MZQaJOAF4tLJh0XeH9nNO48Ti54R9lbc7N86+mLgcyAB 05s=
- 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 always pass a long time_t. On 32 and 64-bit systems
we will pass a long time to the kernel (no matter the time_t size). This is
no change for 64-bit architectures or 32-bit architectures with a 32-bit time_t.
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).
Alistair Francis (6):
sysv/linux: Rename alpha functions to be alpha specific
time: Add a timeval with a long tv_sec and tv_usec
time: Add a __itimerval64 struct
linux: Use long time_t __getitimer/__setitimer
resource: Add a __rusage64 struct
linux: Use long time_t for wait4/getrusage
include/sys/resource.h | 120 ++++++++++++++++++
include/time.h | 64 ++++++++++
.../{tv32-compat.h => alpha-tv32-compat.h} | 16 +--
sysdeps/unix/sysv/linux/alpha/osf_adjtime.c | 10 +-
sysdeps/unix/sysv/linux/alpha/osf_getitimer.c | 6 +-
sysdeps/unix/sysv/linux/alpha/osf_getrusage.c | 4 +-
.../unix/sysv/linux/alpha/osf_gettimeofday.c | 4 +-
sysdeps/unix/sysv/linux/alpha/osf_setitimer.c | 10 +-
.../unix/sysv/linux/alpha/osf_settimeofday.c | 4 +-
sysdeps/unix/sysv/linux/alpha/osf_utimes.c | 6 +-
sysdeps/unix/sysv/linux/alpha/osf_wait4.c | 4 +-
sysdeps/unix/sysv/linux/getitimer.c | 54 ++++++++
sysdeps/unix/sysv/linux/getrusage.c | 53 ++++++++
sysdeps/unix/sysv/linux/setitimer.c | 89 +++++++++++++
sysdeps/unix/sysv/linux/tv32-compat.h | 82 ++++++++++++
sysdeps/unix/sysv/linux/wait4.c | 40 +++++-
16 files changed, 530 insertions(+), 36 deletions(-)
rename sysdeps/unix/sysv/linux/alpha/{tv32-compat.h => alpha-tv32-compat.h} (88%)
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
create mode 100644 sysdeps/unix/sysv/linux/tv32-compat.h
--
2.25.0