This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v3 0/3] Support y2038 semctl_syscall()
- 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, 4 Mar 2020 17:26:02 -0800
- Subject: [PATCH v3 0/3] Support y2038 semctl_syscall()
- Ironport-sdr: mTrklt24zMAQcgqhSN7kBJS3ESXA2YKRA2TAGATZpWLVz57N7pCbQmXsXn8ecRIBK4ZTA83Hr/ En8P44e4nP8RJQsbiDGXBUWm4fj/Y1NrlbE6vBubIxxKrLaXl/Kiz6E1C8qZUgo9BFIiOMguhK 9nFXTbiPUfhNDXXw16BOEQBYSQ92uOsRu9Kck0PWeXPuhhspuyySf8uqVHTKjX767WG1lIgcqI ukHVaC2qN+6hSaipLbI9knw4XaMb3lDKjts08sOlpFRFIP1yhwSZKKNKzbgWVKtTHMAkJXFN+K duI=
- Ironport-sdr: QSDYC6j14/k9hoB3Z0mK3rwKJnT1UG/aixk2yxb8trpRgJVvRBT1u6S+DNmxBCW+z1qJFiy3Xb cmJqeRo9AjnJEJcV22KreFLKEniSxgeMhJrRzuWiU/S7V9/gxeEk2TCFAnrOBxCHUHshnHC2HS JwzN7G6CQuAQUWRU9SISqJUYwLSbIJSUwmwdLCm9o7VllLDRHnQBsikKVhUlnxBy59axxPTLHy yCqsyn5UB5gjPbNHyfEDn9zC0/k9HhGNzVX5vNsVix3HMcCC25vYVwkKwrzyArE1Q4va8O5tzg 4hTziXzy+m+spGc1Hd1hZrFV
- Ironport-sdr: aFBTK0fXMinD77naUnjjzNpw5lrZ7jurrxmjNqu5E0oV2czT+6YbjPuKcAZI6nCXkSw1Ka5Q9i ulnw4doJodpByBE3LKkIdasd2oKOqvN3G3mYXTwkPqrutXgQorvn2EENW20zAvziGNdwXNmyyj UfkgfK25l5aN1W0AxmmBq/x0QhZkm8aW3JGgdLWDRwCFGl3jwha58b/gcoX2sa8bHB7L3hH8WP 8WtcFNMIvCzxxyLnNMKWiz7AWI3HooAzwPbjiy0sJI23G6UNCpn+xmULMPYXW5lRS5L+JZbKJO y54=
- Wdcironportexception: Internal
This series does three things:
1. Creates a bits/semid_ds_t.h file (in every arch) that specifies
struct semid_ds so we no longer have to use macros defined in
sem-pad.h.
2. Removes the sem-pad.h file as it is no longer needed.
3. Adds a new __semid_ds32 that is passed to the kernel (as part of
a union) when running on 32-bit systems. If we then support
__IPC_TIME64 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.
We protect this new code via the __IPC_TIME64 marco, which is only true
for 32-bit architectures with a 64-bit time_t.
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.
Alistair Francis (3):
bits/sem.h: Split out struct semid_ds
semctl: Remove the sem-pad.h file
sysv: linux: Pass 64-bit version of semctl syscall
bits/ipc.h | 6 +-
sysdeps/gnu/bits/ipc.h | 6 +-
sysdeps/unix/sysv/linux/Makefile | 2 +-
sysdeps/unix/sysv/linux/bits/ipc.h | 6 +-
sysdeps/unix/sysv/linux/bits/sem-pad.h | 33 ----------
sysdeps/unix/sysv/linux/bits/sem.h | 26 +-------
sysdeps/unix/sysv/linux/bits/semid_ds_t.h | 61 +++++++++++++++++++
sysdeps/unix/sysv/linux/hppa/bits/sem-pad.h | 26 --------
.../unix/sysv/linux/hppa/bits/semid_ds_t.h | 61 +++++++++++++++++++
sysdeps/unix/sysv/linux/mips/bits/sem-pad.h | 24 --------
.../unix/sysv/linux/mips/bits/semid_ds_t.h | 45 ++++++++++++++
.../unix/sysv/linux/powerpc/bits/sem-pad.h | 26 --------
.../unix/sysv/linux/powerpc/bits/semid_ds_t.h | 61 +++++++++++++++++++
sysdeps/unix/sysv/linux/semctl.c | 25 ++++++--
sysdeps/unix/sysv/linux/sparc/bits/sem-pad.h | 26 --------
.../unix/sysv/linux/sparc/bits/semid_ds_t.h | 61 +++++++++++++++++++
sysdeps/unix/sysv/linux/x86/bits/sem-pad.h | 24 --------
sysdeps/unix/sysv/linux/x86/bits/semid_ds_t.h | 49 +++++++++++++++
18 files changed, 377 insertions(+), 191 deletions(-)
delete mode 100644 sysdeps/unix/sysv/linux/bits/sem-pad.h
create mode 100644 sysdeps/unix/sysv/linux/bits/semid_ds_t.h
delete mode 100644 sysdeps/unix/sysv/linux/hppa/bits/sem-pad.h
create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/semid_ds_t.h
delete mode 100644 sysdeps/unix/sysv/linux/mips/bits/sem-pad.h
create mode 100644 sysdeps/unix/sysv/linux/mips/bits/semid_ds_t.h
delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/sem-pad.h
create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/semid_ds_t.h
delete mode 100644 sysdeps/unix/sysv/linux/sparc/bits/sem-pad.h
create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/semid_ds_t.h
delete mode 100644 sysdeps/unix/sysv/linux/x86/bits/sem-pad.h
create mode 100644 sysdeps/unix/sysv/linux/x86/bits/semid_ds_t.h
--
2.25.1