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