From 38cee35b0c30b4eba605f8402a21251d3da1f512 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 26 Oct 2016 17:51:37 -0200 Subject: Consolidate Linux semtimedop implementation This patch consolidates the semtimedop Linux implementation in only one default file, sysdeps/unix/sysv/linux/semtimedop.c. If tries to use the direct syscall if it is supported, otherwise will use the old ipc multiplex mechanism. Checked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/alpha/syscalls.list (semtimedop): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (semtimedop): Likewise. * sysdeps/unix/sysv/linux/m68k/semtimedop.S: Remove file. * sysdeps/unix/sysv/linux/s390/semtimedop.c: Reorganize headers and add a comment about s390 syscall difference from default one. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Use semtimedop syscall if it is defined. --- sysdeps/unix/sysv/linux/semtimedop.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sysdeps/unix/sysv/linux/semtimedop.c') diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c index 30ee7fe39e..4216dda930 100644 --- a/sysdeps/unix/sysv/linux/semtimedop.c +++ b/sysdeps/unix/sysv/linux/semtimedop.c @@ -16,12 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include #include #include - #include -#include +#include /* Perform user-defined atomical operation of array of semaphores. */ @@ -29,7 +27,10 @@ int semtimedop (int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout) { - return INLINE_SYSCALL (ipc, 6, IPCOP_semtimedop, - semid, (int) nsops, 0, sops, - timeout); +#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + return INLINE_SYSCALL_CALL (semtimedop, semid, sops, nsops, timeout); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, 0, sops, + timeout); +#endif } -- cgit v1.2.1