fa3bfd
This patch is from the upstream release/2.20/master branch, which is a
fa3bfd
backport containing only the syscalls.list changes in commit 016495b8 in
fa3bfd
master.
fa3bfd
fa3bfd
commit adba20cf74bc6ea3910afe57d40ed755c92c2ddb
fa3bfd
Author: Stefan Liebler <stli@linux.vnet.ibm.com>
fa3bfd
Date:   Thu Mar 3 08:24:18 2016 +0100
fa3bfd
fa3bfd
    S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682]
fa3bfd
    
fa3bfd
    Beginning with Linux 4.3, the kernel headers contain direct
fa3bfd
    system call numbers __NR_socket etc. on s390x. On older kernels,
fa3bfd
    the socket-multiplexer syscall __NR_socketcall was used.
fa3bfd
    
fa3bfd
    To enable these new syscalls, the patch
fa3bfd
    "S390: Call direct system calls for socket operations."
fa3bfd
    (https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5)
fa3bfd
    was applied upstream.
fa3bfd
    
fa3bfd
    If glibc 2.23 is configured with --enable-kernel=4.3 and newer,
fa3bfd
    the direct socket syscalls are used.
fa3bfd
    For older kernels, the socket-multiplexer syscall is used instead.
fa3bfd
    
fa3bfd
    In glibc 2.22 and earlier, this patch is not applied.
fa3bfd
    If you build glibc on a kernel < 4.3, the socket-multiplexer
fa3bfd
    syscall is used. But if you build glibc on kernel >= 4.3, the
fa3bfd
    direct socket-syscalls are used. If you install this glibc on a
fa3bfd
    kernel < 4.3, all socket operations will fail.
fa3bfd
    See "Bug 19682 - s390x: Incorrect syscall definitions cause
fa3bfd
    breakage with Linux 4.3 headers"
fa3bfd
    (https://sourceware.org/bugzilla/show_bug.cgi?id=19682)
fa3bfd
    The configure switch --enable-kernel does not influence this
fa3bfd
    behaviour on older glibc-releases.
fa3bfd
    
fa3bfd
    The solution is to remove the direct socket-syscalls in
fa3bfd
    sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
fa3bfd
    (this patch) on older glibc-releases as it was done by the
fa3bfd
    upstream patch, too. These entries were never used on s390x,
fa3bfd
    but the c-files in sysdeps/unix/sysv/linux/.
fa3bfd
    After this removal, the behaviour of the socket functions are
fa3bfd
    not changed compared to the original glibc release version
fa3bfd
    and the socket-multiplexer-syscall is always used.
fa3bfd
fa3bfd
Index: b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
fa3bfd
===================================================================
fa3bfd
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
fa3bfd
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
fa3bfd
@@ -14,22 +14,3 @@ shmget		-	shmget		i:iii	__shmget	shmget
fa3bfd
 semop		-	semop		i:ipi	__semop		semop
fa3bfd
 semget		-	semget		i:iii	__semget	semget
fa3bfd
 semctl		-	semctl		i:iiii	__semctl	semctl
fa3bfd
-
fa3bfd
-# proper socket implementations:
fa3bfd
-accept		-	accept		Ci:iBN	__libc_accept	__accept accept
fa3bfd
-bind		-	bind		i:ipi	__bind		bind
fa3bfd
-connect		-	connect		Ci:ipi	__libc_connect	__connect connect
fa3bfd
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
fa3bfd
-getsockname	-	getsockname	i:ipp	__getsockname	getsockname
fa3bfd
-getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
fa3bfd
-listen		-	listen		i:ii	__listen	listen
fa3bfd
-recv		-	recv		Ci:ibni	__libc_recv	__recv recv
fa3bfd
-recvfrom	-	recvfrom	Ci:ibniBN	__libc_recvfrom	__recvfrom recvfrom
fa3bfd
-recvmsg		-	recvmsg		Ci:ipi	__libc_recvmsg	__recvmsg recvmsg
fa3bfd
-send		-	send		Ci:ibni	__libc_send	__send send
fa3bfd
-sendmsg		-	sendmsg		Ci:ipi	__libc_sendmsg	__sendmsg sendmsg
fa3bfd
-sendto		-	sendto		Ci:ibnibn	__libc_sendto	__sendto sendto
fa3bfd
-setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
fa3bfd
-shutdown	-	shutdown	i:ii	__shutdown	shutdown
fa3bfd
-socket		-	socket		i:iii	__socket	socket
fa3bfd
-socketpair	-	socketpair	i:iiif	__socketpair	socketpair