about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-10-11 11:39:04 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-10-17 11:05:40 -0300
commit765cdd0bffd77960ae852104fc4ea5edcdb8aed3 (patch)
tree84fcbd5898b0a53b29af09ea49e07c28e21d6bd0 /sysdeps
parent06436acf819d9e6ada7be3ca977d5c0a23d3f138 (diff)
downloadglibc-765cdd0bffd77960ae852104fc4ea5edcdb8aed3.tar.gz
glibc-765cdd0bffd77960ae852104fc4ea5edcdb8aed3.tar.xz
glibc-765cdd0bffd77960ae852104fc4ea5edcdb8aed3.zip
sysvipc: Implement semop based on semtimedop
Besides semop being a subset of semtimedop, new 32-bit architectures
on Linux are not expected to provide the syscall (only the 64-bit time
semtimedop).

Also, Linux 5.1 only wired-up semtimedop for the 64-bit architectures
that missed it (powerpc, s390, and sparc).  This simplifies the code
to support it.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/semop.c6
-rw-r--r--sysdeps/unix/sysv/linux/semtimedop.c5
2 files changed, 4 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c
index 687fdcb805..e111b9aa3d 100644
--- a/sysdeps/unix/sysv/linux/semop.c
+++ b/sysdeps/unix/sysv/linux/semop.c
@@ -26,9 +26,5 @@
 int
 semop (int semid, struct sembuf *sops, size_t nsops)
 {
-#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
-  return INLINE_SYSCALL_CALL (semop, semid, sops, nsops);
-#else
-  return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops);
-#endif
+  return __semtimedop (semid, sops, nsops, NULL);
 }
diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c
index f34a7fb920..09c18d9781 100644
--- a/sysdeps/unix/sysv/linux/semtimedop.c
+++ b/sysdeps/unix/sysv/linux/semtimedop.c
@@ -24,8 +24,8 @@
 /* Perform user-defined atomical operation of array of semaphores.  */
 
 int
-semtimedop (int semid, struct sembuf *sops, size_t nsops,
-	    const struct timespec *timeout)
+__semtimedop (int semid, struct sembuf *sops, size_t nsops,
+	      const struct timespec *timeout)
 {
 #ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
   return INLINE_SYSCALL_CALL (semtimedop, semid, sops, nsops, timeout);
@@ -34,3 +34,4 @@ semtimedop (int semid, struct sembuf *sops, size_t nsops,
 			      SEMTIMEDOP_IPC_ARGS (nsops, sops, timeout));
 #endif
 }
+weak_alias (__semtimedop, semtimedop)