unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v8 0/2] Support semctl_syscall() for __TIMESIZE==64
@ 2020-05-13 15:22 Alistair Francis via Libc-alpha
  2020-05-13 15:22 ` [PATCH v8 1/2] sysv: linux: Define the __semid_ds32 struct Alistair Francis via Libc-alpha
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alistair Francis via Libc-alpha @ 2020-05-13 15:22 UTC (permalink / raw)
  To: libc-alpha; +Cc: stepan, Alistair Francis

This series supports the semctl calls on a system with __TIMESIZE==64
and __WORDSIZE==32 while not breaking current architectures. This is a
step towards full y2038 support, but does not get us there yet.

See: https://sourceware.org/pipermail/libc-alpha/2020-May/113774.html
for more details on what is still required.

This series adds a new __semid_ds32 that is passed to the kernel
(as part of a union) when running on 32-bit systems. If we are doing an
IPC_STAT/SEM_STAT command then the 32-bit sem_{c,o}time{_high} values
are combined to create a 64-bit value.

The semctl_syscall() function passes a union semun to the kernel. The
union includes struct semid_ds as a member. On 32-bit architectures the
Linux kernel provides a *_high version of the 32-bit sem_otime and
sem_ctime values. These can be combined to get a 64-bit version of the
time.

This patch adjusts the struct semid_ds to support the *_high versions
of sem_otime and sem_ctime. For 32-bit systems with a 64-bit time_t
this can be used to get a 64-bit time from the two 32-bit values.

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 9 test failures.

v8:
 - Revert back to v6-ish and only support __TIMESIZE==64
v7:
 - Re-write based on code from Adhemerval.
v6:
 - Update the 3rd patch to pass a temp buffer to the kernel
v5:
 - Address v4 review comments
 - Set the semid_ds struct from a temp struct
v4:
 - Remove the __IPC_TIME64 macro
    - It was only used once and doesn't work if __IPC_64 is 0 (which is
      usually is)
 - Address failures pointed out by Vineet Gupta

Alistair Francis (2):
  sysv: linux: Define the __semid_ds32 struct
  sysv: linux: Pass 64-bit version of semctl syscall

 .../unix/sysv/linux/hppa/struct__semid_ds32.h | 30 +++++++++++
 sysdeps/unix/sysv/linux/ipc_priv.h            |  4 ++
 .../unix/sysv/linux/mips/struct__semid_ds32.h | 28 +++++++++++
 .../sysv/linux/powerpc/struct__semid_ds32.h   | 30 +++++++++++
 sysdeps/unix/sysv/linux/semctl.c              | 50 +++++++++++++++++--
 .../sysv/linux/sparc/struct__semid_ds32.h     | 30 +++++++++++
 sysdeps/unix/sysv/linux/struct__semid_ds32.h  | 30 +++++++++++
 .../unix/sysv/linux/x86/struct__semid_ds32.h  | 30 +++++++++++
 8 files changed, 228 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/hppa/struct__semid_ds32.h
 create mode 100644 sysdeps/unix/sysv/linux/mips/struct__semid_ds32.h
 create mode 100644 sysdeps/unix/sysv/linux/powerpc/struct__semid_ds32.h
 create mode 100644 sysdeps/unix/sysv/linux/sparc/struct__semid_ds32.h
 create mode 100644 sysdeps/unix/sysv/linux/struct__semid_ds32.h
 create mode 100644 sysdeps/unix/sysv/linux/x86/struct__semid_ds32.h

-- 
2.26.2


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

end of thread, other threads:[~2020-06-01  1:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 15:22 [PATCH v8 0/2] Support semctl_syscall() for __TIMESIZE==64 Alistair Francis via Libc-alpha
2020-05-13 15:22 ` [PATCH v8 1/2] sysv: linux: Define the __semid_ds32 struct Alistair Francis via Libc-alpha
2020-05-13 15:22 ` [PATCH v8 2/2] sysv: linux: Pass 64-bit version of semctl syscall Alistair Francis via Libc-alpha
2020-05-27 15:38   ` Andreas Schwab
2020-06-01  1:44     ` Alistair Francis via Libc-alpha
2020-05-27  1:42 ` [PATCH v8 0/2] Support semctl_syscall() for __TIMESIZE==64 Vineet Gupta via Libc-alpha

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).