2016-12-28 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * sysdeps/unix/sysv/linux/alpha/syscalls.list (shmat): Remove.
+ * sysdeps/unix/sysv/linux/arm/syscalls.list (shmat): Likewise.
+ * sysdeps/unix/sysv/linux/generic/syscalls.list (shmat): Likewise.
+ * sysdeps/unix/sysv/linux/hppa/syscalls.list (shmat): Likewise.
+ * sysdeps/unix/sysv/linux/ia64/syscalls.list (shmat): Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/syscalls.list (shmat): Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (shmat):
+ Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (shmat):
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/syscalls.list (shmat): Likewise.
+ * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__NR_shmat):
+ Define to __NR_osf_shmat.
+ * sysdeps/unix/sysv/linux/shmat.c (shmat): Use shmat syscall if it is
+ defined.
+
* sysvipc/Makefile (tests): Add test-sysvsem.
* sysvipc/test-sysvsem.c: New file.
#undef __ASSUME_STATFS64
#define __ASSUME_STATFS64 0
+/* Alpha defines SysV ipc shmat syscall with a different name. */
+#define __NR_shmat __NR_osf_shmat
+
#endif /* _KERNEL_FEATURES_H */
# File name Caller Syscall name # args Strong name Weak names
-shmat - osf_shmat i:ipi __shmat shmat
oldshmctl EXTRA shmctl i:iip __old_shmctl shmctl@GLIBC_2.0
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget
# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
# wrappers (to set __IPC_64).
-shmat - shmat i:ipi __shmat shmat
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget
# SysV APIs
shmget - shmget i:iii __shmget shmget
shmctl - shmctl i:iip __shmctl shmctl
-shmat - shmat i:ipi __shmat shmat
shmdt - shmdt i:s __shmdt shmdt
# Socket APIs
# File name Caller Syscall name # args Strong name Weak names
# semaphore and shm system calls
-shmat - shmat i:ipi __shmat shmat
shmctl - shmctl i:iip __shmctl shmctl
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget
getpriority - getpriority i:ii __getpriority getpriority
# semaphore and shm system calls
-shmat - shmat i:ipi __shmat shmat
shmctl - shmctl i:iip __shmctl shmctl
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget
# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
# wrappers (to set __IPC_64).
-shmat - shmat i:ipi __shmat shmat
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget
# Semaphore and shm system calls. msgctl, shmctl, and semctl have C
# wrappers (to set __IPC_64).
-shmat - shmat i:ipi __shmat shmat
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget
-# File name Caller Syscall name # args Strong name Weak names
+# File name Caller Syscall name # args Strong name Weak names
# semaphore and shm system calls
-shmat - shmat i:ipi __shmat shmat
-shmctl - shmctl i:iip __shmctl shmctl
-shmdt - shmdt i:s __shmdt shmdt
-shmget - shmget i:iii __shmget shmget
+shmctl - shmctl i:iip __shmctl shmctl
+shmdt - shmdt i:s __shmdt shmdt
+shmget - shmget i:iii __shmget shmget
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 <unistd.h>
-#include <sys/syscall.h>
+#include <errno.h>
/* Attach the shared memory segment associated with SHMID to the data
segment of the calling process. SHMADDR and SHMFLG determine how
void *
shmat (int shmid, const void *shmaddr, int shmflg)
{
+#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+ return (void*) INLINE_SYSCALL_CALL (shmat, shmid, shmaddr, shmflg);
+#else
INTERNAL_SYSCALL_DECL(err);
unsigned long resultvar;
void *raddr;
- resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat,
- shmid, shmflg,
- (long int) &raddr,
- (void *) shmaddr);
+ resultvar = INTERNAL_SYSCALL_CALL (ipc, err, IPCOP_shmat, shmid, shmflg,
+ &raddr, shmaddr);
if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (resultvar,
err));
return raddr;
+#endif
}
preadv64 - preadv Ci:ipii preadv64 preadv
pwrite64 - pwrite64 Ci:ipii __libc_pwrite __libc_pwrite64 __pwrite64 pwrite64 __pwrite pwrite
pwritev64 - pwritev Ci:ipii pwritev64 pwritev
-shmat - shmat i:ipi __shmat shmat
shmctl - shmctl i:iip __shmctl shmctl
shmdt - shmdt i:s __shmdt shmdt
shmget - shmget i:iii __shmget shmget