public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v5 0/8] Always use 32-bit time_t for certain syscalls
@ 2020-03-03 18:01 Alistair Francis
  2020-03-03 18:01 ` [PATCH v5 6/8] resource: Add a __rusage64 struct Alistair Francis
                   ` (8 more replies)
  0 siblings, 9 replies; 42+ messages in thread
From: Alistair Francis @ 2020-03-03 18:01 UTC (permalink / raw)
  To: libc-alpha; +Cc: adhemerval.zanella, Alistair Francis

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?

v5:
 - Rebase on master

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                                |  67 ++++++++++
 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, 536 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.1

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2020-04-06 18:21 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 18:01 [PATCH v5 0/8] Always use 32-bit time_t for certain syscalls Alistair Francis
2020-03-03 18:01 ` [PATCH v5 6/8] resource: Add a __rusage64 struct Alistair Francis
2020-03-27 18:14   ` Adhemerval Zanella
2020-03-03 18:01 ` [PATCH v5 7/8] linux: Use long time_t for wait4/getrusage Alistair Francis
2020-03-27 18:31   ` Adhemerval Zanella
2020-03-27 18:42     ` Alistair Francis
2020-04-04 14:52   ` Andreas Schwab
2020-03-03 18:01 ` [PATCH v5 2/8] time: Add a timeval with a 32-bit tv_sec and tv_usec Alistair Francis
2020-03-27 17:00   ` Adhemerval Zanella
2020-03-03 18:01 ` [PATCH v5 5/8] linux: Use long time_t __getitimer/__setitimer Alistair Francis
2020-03-27 18:09   ` Adhemerval Zanella
2020-03-27 18:21     ` Alistair Francis
2020-03-03 18:01 ` [PATCH v5 1/8] sysv/linux: Rename alpha functions to be alpha specific Alistair Francis
2020-03-05  9:51   ` Lukasz Majewski
2020-03-05 21:38     ` Zack Weinberg
2020-03-09 22:16       ` Alistair Francis
2020-03-12 18:45         ` Alistair Francis
2020-03-18 19:46           ` Alistair Francis
2020-03-24  7:33             ` Lukasz Majewski
2020-03-24 23:58               ` Alistair Francis
2020-03-27 16:15                 ` Adhemerval Zanella
2020-03-27 16:25                   ` Alistair Francis
2020-03-27 16:46   ` Adhemerval Zanella
2020-03-03 18:01 ` [PATCH v5 3/8] time: Add a __itimerval64 struct Alistair Francis
2020-03-27 17:01   ` Adhemerval Zanella
2020-03-03 18:01 ` [PATCH v5 8/8] sysv/alpha: Use generic __timeval32 and helpers Alistair Francis
2020-04-01 16:57   ` Adhemerval Zanella
2020-04-01 16:54     ` Alistair Francis
2020-03-03 18:01 ` [PATCH v5 4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 Alistair Francis
2020-03-27 17:58   ` Adhemerval Zanella
2020-03-27 18:36     ` Alistair Francis
2020-04-04 13:58 ` [PATCH v5 0/8] Always use 32-bit time_t for certain syscalls Andreas Schwab
2020-04-06 13:24   ` Adhemerval Zanella
2020-04-06 14:03     ` Andreas Schwab
2020-04-06 16:16       ` Adhemerval Zanella
2020-04-06 17:07         ` Andreas Schwab
2020-04-06 17:34           ` Adhemerval Zanella
2020-04-06 17:43             ` Adhemerval Zanella
2020-04-06 17:48             ` Andreas Schwab
2020-04-06 17:45               ` Alistair Francis
2020-04-06 18:02                 ` Alistair Francis
2020-04-06 18:21                   ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).