1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Use semop syscall for Linux implementation

This patch add a direct call to semop syscall if it is supported by
kernel headers.

Checked on x86_64, i686, powerpc64le, aarch64, and armhf.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list (semop): Remove.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/generic/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/ia64/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (semop):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (semop):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (semop): Likewise.
	* sysdeps/unix/sysv/linux/semop.c (semop): Use semop syscall if it is
	defined.
This commit is contained in:
Adhemerval Zanella
2016-10-26 17:01:43 -02:00
parent d29f6bcdcc
commit 0f97184020
11 changed files with 20 additions and 13 deletions

View File

@ -16,17 +16,19 @@
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. */
int
semop (int semid, struct sembuf *sops, size_t nsops)
{
return INLINE_SYSCALL (ipc, 5, IPCOP_semop, semid, (int) nsops, 0, sops);
#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
}