1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

Use shmdt syscall for linux implementation

this patch add a direct call to shmdt syscall if it is supported by
kernel features.

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

	* sysdeps/unix/sysv/linux/alpha/syscalls.list (shmdt): Remove.
	* sysdeps/unix/sysv/linux/arm/syscalls.list (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/generic/syscalls.list (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/ia64/syscalls.list (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/syscalls.list (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (shmdt):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (shmdt):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (shmdt): Likewise.
	* sysdeps/unix/sysv/linux/shmdt.c (shmdt): Use shmdt syscall if it is
	defined.
This commit is contained in:
Adhemerval Zanella
2016-10-26 18:23:11 -02:00
parent e01f79e412
commit 214f017fdf
11 changed files with 21 additions and 14 deletions

View File

@ -16,12 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sys/shm.h>
#include <sys/msg.h>
#include <ipc_priv.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <errno.h>
/* Detach shared memory segment starting at address specified by SHMADDR
from the caller's data segment. */
@ -29,5 +27,9 @@
int
shmdt (const void *shmaddr)
{
return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, (void *) shmaddr);
#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
return INLINE_SYSCALL_CALL (shmdt, shmaddr);
#else
return INLINE_SYSCALL_CALL (ipc, IPCOP_shmdt, 0, 0, 0, shmaddr);
#endif
}