summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/semtimedop.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-10-26 17:51:37 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-12-28 20:31:04 -0200
commit38cee35b0c30b4eba605f8402a21251d3da1f512 (patch)
treecbb920db8649fdf09967b48941e54fb4f69ad69e /sysdeps/unix/sysv/linux/semtimedop.c
parent0f971840201bcb27247a8d8f53621197396262cd (diff)
downloadglibc-38cee35b0c30b4eba605f8402a21251d3da1f512.tar.gz
glibc-38cee35b0c30b4eba605f8402a21251d3da1f512.tar.xz
glibc-38cee35b0c30b4eba605f8402a21251d3da1f512.zip
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.
Diffstat (limited to 'sysdeps/unix/sysv/linux/semtimedop.c')
-rw-r--r--sysdeps/unix/sysv/linux/semtimedop.c13
1 files changed, 7 insertions, 6 deletions
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
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
 #include <sys/sem.h>
 #include <ipc_priv.h>
-
 #include <sysdep.h>
-#include <sys/syscall.h>
+#include <errno.h>
 
 /* 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
 }