about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/s390
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/s390
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/s390')
-rw-r--r--sysdeps/unix/sysv/linux/s390/semtimedop.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/semtimedop.c b/sysdeps/unix/sysv/linux/s390/semtimedop.c
index f226953fd3..db43f00dfe 100644
--- a/sysdeps/unix/sysv/linux/s390/semtimedop.c
+++ b/sysdeps/unix/sysv/linux/s390/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,6 +27,10 @@ int
 semtimedop (int semid, struct sembuf *sops, size_t nsops,
 	    const struct timespec *timeout)
 {
-  return INLINE_SYSCALL (ipc, 5, IPCOP_semtimedop,
-			 semid, (int) nsops, timeout, sops);
+  /* The s390 sys_ipc variant has only five parameters instead of six
+     (as for default variant) and the only difference is the handling of
+     SEMTIMEDOP where on s390 the third parameter is used as a pointer
+     to a struct timespec where the generic variant uses fifth parameter.  */
+  return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, timeout,
+			      sops);
 }