diff options
author | Stefan Liebler <stli@linux.vnet.ibm.com> | 2015-11-09 16:14:49 +0100 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-11-09 16:14:49 +0100 |
commit | 016495b818cb61df7d0d10e6db54074271b3e3a5 (patch) | |
tree | f03b894ace447f55bd43c2719a2d3bf9b31b88e3 /sysdeps/unix/sysv/linux/s390/kernel-features.h | |
parent | 2eecc8afd02d8c65cf098cbae4de87f332dc21bd (diff) | |
download | glibc-016495b818cb61df7d0d10e6db54074271b3e3a5.tar.gz glibc-016495b818cb61df7d0d10e6db54074271b3e3a5.tar.xz glibc-016495b818cb61df7d0d10e6db54074271b3e3a5.zip |
S390: Call direct system calls for socket operations.
this patch calls direct system calls for socket operations in the same way as power does. The system calls were introduced in kernel commit https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=977108f89c989b1eeb5c8d938e1e71913391eb5f. There are no direct recv, send, accept syscalls available on s390. Thus recvfrom, sendto, accept4 are called instead of the socketcall by defining __ASSUME_*_FOR_*_SYSCALL macros. See recv.c, send.c, accept.c in sysdeps/unix/sysv/linux/ folder. The socketcalls in syscalls.list for s390-64 are removed. They were never used on s390x. ChangeLog: * sysdeps/unix/sysv/linux/s390/kernel-features.h: (__ASSUME_*_SYSCALL) Define new macros. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Remove socketcall syscalls. * sysdeps/unix/sysv/linux/accept.c (__libc_accept): Use accept4 if defined __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL. * sysdeps/unix/sysv/linux/recv.c (__libc_recv): Use recvfrom if defined __ASSUME_RECVFROM_FOR_RECV_SYSCALL. * sysdeps/unix/sysv/linux/send.c (__libc_send): Use sendto if defined __ASSUME_SENDTO_FOR_SEND_SYSCALL.
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390/kernel-features.h')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/kernel-features.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 96f73ef959..eaa348361b 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -20,4 +20,28 @@ /* S/390 uses socketcall. */ #define __ASSUME_SOCKETCALL 1 +/* Direct socketcalls available with kernel 4.3. */ +#if __LINUX_KERNEL_VERSION >= 0x040300 +# define __ASSUME_RECVMMSG_SYSCALL 1 +# define __ASSUME_SENDMMSG_SYSCALL 1 +# define __ASSUME_SOCKET_SYSCALL 1 +# define __ASSUME_SOCKETPAIR_SYSCALL 1 +# define __ASSUME_BIND_SYSCALL 1 +# define __ASSUME_CONNECT_SYSCALL 1 +# define __ASSUME_LISTEN_SYSCALL 1 +# define __ASSUME_ACCEPT4_SYSCALL 1 +# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1 +# define __ASSUME_GETSOCKOPT_SYSCALL 1 +# define __ASSUME_SETSOCKOPT_SYSCALL 1 +# define __ASSUME_GETSOCKNAME_SYSCALL 1 +# define __ASSUME_GETPEERNAME_SYSCALL 1 +# define __ASSUME_SENDTO_SYSCALL 1 +# define __ASSUME_SENDTO_FOR_SEND_SYSCALL 1 +# define __ASSUME_SENDMSG_SYSCALL 1 +# define __ASSUME_RECVFROM_SYSCALL 1 +# define __ASSUME_RECVFROM_FOR_RECV_SYSCALL 1 +# define __ASSUME_RECVMSG_SYSCALL 1 +# define __ASSUME_SHUTDOWN_SYSCALL 1 +#endif + #include_next <kernel-features.h> |