[08/28] linux: Assume getpeername support

Message ID 20201118195552.2687336-9-adhemerval.zanella@linaro.org
State New
Headers show
Series
  • More Linux syscall refactor
Related show

Commit Message

Michael Hudson-Doyle via Libc-alpha Nov. 18, 2020, 7:55 p.m.
Checked with build for the affected ABI.
---
 sysdeps/unix/syscalls.list                           | 1 -
 sysdeps/unix/sysv/linux/alpha/syscalls.list          | 1 -
 sysdeps/unix/sysv/linux/arm/syscalls.list            | 1 -
 sysdeps/unix/sysv/linux/generic/syscalls.list        | 1 -
 sysdeps/unix/sysv/linux/hppa/syscalls.list           | 1 -
 sysdeps/unix/sysv/linux/i386/kernel-features.h       | 2 +-
 sysdeps/unix/sysv/linux/ia64/syscalls.list           | 1 -
 sysdeps/unix/sysv/linux/kernel-features.h            | 1 +
 sysdeps/unix/sysv/linux/m68k/kernel-features.h       | 2 +-
 sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 -
 sysdeps/unix/sysv/linux/mips/syscalls.list           | 1 -
 sysdeps/unix/sysv/linux/powerpc/kernel-features.h    | 1 -
 sysdeps/unix/sysv/linux/s390/kernel-features.h       | 2 +-
 sysdeps/unix/sysv/linux/sh/kernel-features.h         | 1 -
 sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list  | 1 -
 sysdeps/unix/sysv/linux/x86_64/syscalls.list         | 1 -
 16 files changed, 4 insertions(+), 15 deletions(-)

-- 
2.25.1

Comments

Michael Hudson-Doyle via Libc-alpha Nov. 19, 2020, 12:55 p.m. | #1
On 18/11/2020 16:55, Adhemerval Zanella wrote:
> Checked with build for the affected ABI.

> ---

>  sysdeps/unix/syscalls.list                           | 1 -

>  sysdeps/unix/sysv/linux/alpha/syscalls.list          | 1 -

>  sysdeps/unix/sysv/linux/arm/syscalls.list            | 1 -

>  sysdeps/unix/sysv/linux/generic/syscalls.list        | 1 -

>  sysdeps/unix/sysv/linux/hppa/syscalls.list           | 1 -

>  sysdeps/unix/sysv/linux/i386/kernel-features.h       | 2 +-

>  sysdeps/unix/sysv/linux/ia64/syscalls.list           | 1 -

>  sysdeps/unix/sysv/linux/kernel-features.h            | 1 +

>  sysdeps/unix/sysv/linux/m68k/kernel-features.h       | 2 +-

>  sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 -

>  sysdeps/unix/sysv/linux/mips/syscalls.list           | 1 -

>  sysdeps/unix/sysv/linux/powerpc/kernel-features.h    | 1 -

>  sysdeps/unix/sysv/linux/s390/kernel-features.h       | 2 +-

>  sysdeps/unix/sysv/linux/sh/kernel-features.h         | 1 -

>  sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list  | 1 -

>  sysdeps/unix/sysv/linux/x86_64/syscalls.list         | 1 -

>  16 files changed, 4 insertions(+), 15 deletions(-)

> 

> diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list

> index 7209c24110..6d1a2ad441 100644

> --- a/sysdeps/unix/syscalls.list

> +++ b/sysdeps/unix/syscalls.list

> @@ -25,7 +25,6 @@ getgid		-	getgid		Ei:	__getgid	getgid

>  getgroups	-	getgroups	i:ip	__getgroups	getgroups

>  gethostid	-	gethostid	i:	gethostid

>  gethostname	-	gethostname	i:bn	__gethostname	gethostname

> -getpeername	-	getpeername	i:ibN	__getpeername	getpeername

>  getpid		-	getpid		Ei:	__getpid	getpid

>  getpriority	-	getpriority	i:ii	__getpriority	getpriority

>  getrlimit	-	getrlimit	i:ip	__getrlimit	getrlimit

> diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list

> index a4e432c50c..62d79edd56 100644

> --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list

> @@ -5,7 +5,6 @@ sigstack	-	sigstack	2	sigstack

>  getpriority	-	getpriority	i:ii	__getpriority	getpriority

>  

>  # proper socket implementations:

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  listen		-	listen		i:ii	__listen	listen

> diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list

> index 5982889636..87e6c6c88d 100644

> --- a/sysdeps/unix/sysv/linux/arm/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list

> @@ -20,7 +20,6 @@ prlimit64	EXTRA	prlimit64	i:iipp	prlimit64

>  fanotify_mark	EXTRA	fanotify_mark	i:iiiiis	fanotify_mark

>  

>  # proper socket implementations:

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  listen		-	listen		i:ii	__listen	listen

> diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list

> index 98984cf59d..3af1893c80 100644

> --- a/sysdeps/unix/sysv/linux/generic/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list

> @@ -5,7 +5,6 @@ socket		-	socket		i:iii	__socket	socket

>  socketpair	-	socketpair	i:iiif	__socketpair	socketpair

>  listen		-	listen		i:ii	__listen	listen

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  shutdown	-	shutdown	i:ii	__shutdown	shutdown

> diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list

> index 0f54c50eba..0d4e9d5e1c 100644

> --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list

> @@ -1,7 +1,6 @@

>  # File name	Caller	Syscall name	# args	Strong name	Weak names

>  

>  # proper socket implementations:

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  listen		-	listen		i:ii	__listen	listen

> diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h

> index 46c5334385..53e9890819 100644

> --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h

> @@ -25,7 +25,6 @@

>  # define __ASSUME_GETSOCKOPT_SYSCALL         1

>  # define __ASSUME_SETSOCKOPT_SYSCALL         1

>  # define __ASSUME_GETSOCKNAME_SYSCALL        1

> -# define __ASSUME_GETPEERNAME_SYSCALL        1

>  # define __ASSUME_SHUTDOWN_SYSCALL           1

>  #endif

>  

> @@ -41,6 +40,7 @@

>  # undef __ASSUME_CONNECT_SYSCALL

>  # undef __ASSUME_RECVFROM_SYSCALL

>  # undef __ASSUME_SENDTO_SYSCALL

> +# undef __ASSUME_GETPEERNAME_SYSCALL

>  #endif

>  

>  /* i686 only supports ipc syscall before 5.1.  */

> diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list

> index 5a77f18ada..5bb62003d0 100644

> --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list

> @@ -3,7 +3,6 @@

>  getpriority	-	getpriority	i:ii	__getpriority	getpriority

>  

>  # proper socket implementations:

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  listen		-	listen		i:ii	__listen	listen

> diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h

> index 71a2631fc0..9945f4388b 100644

> --- a/sysdeps/unix/sysv/linux/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/kernel-features.h

> @@ -78,6 +78,7 @@

>  #define __ASSUME_ACCEPT4_SYSCALL	1

>  #define __ASSUME_RECVMMSG_SYSCALL	1

>  #define __ASSUME_SENDMMSG_SYSCALL	1

> +#define __ASSUME_GETPEERNAME_SYSCALL    1

>  

>  /* Support for SysV IPC through wired syscalls.  All supported architectures

>     either support ipc syscall and/or all the ipc correspondent syscalls.  */

> diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h

> index 06457d3761..e321895ae8 100644

> --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h

> @@ -25,7 +25,6 @@

>  # define __ASSUME_GETSOCKOPT_SYSCALL         1

>  # define __ASSUME_SETSOCKOPT_SYSCALL         1

>  # define __ASSUME_GETSOCKNAME_SYSCALL        1

> -# define __ASSUME_GETPEERNAME_SYSCALL        1

>  # define __ASSUME_SHUTDOWN_SYSCALL           1

>  #endif

>  

> @@ -43,6 +42,7 @@

>  # undef __ASSUME_CONNECT_SYSCALL

>  # undef __ASSUME_RECVFROM_SYSCALL

>  # undef __ASSUME_SENDTO_SYSCALL

> +# undef __ASSUME_GETPEERNAME_SYSCALL

>  #endif

>  

>  /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */

> diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> index 2facec8c4c..13eba077d6 100644

> --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h

> @@ -22,7 +22,6 @@

>  #define __ASSUME_CONNECT_SYSCALL	1

>  #define __ASSUME_LISTEN_SYSCALL		1

>  #define __ASSUME_GETSOCKNAME_SYSCALL	1

> -#define __ASSUME_GETPEERNAME_SYSCALL	1

>  #define __ASSUME_SOCKETPAIR_SYSCALL	1

>  #define __ASSUME_SEND_SYSCALL		1

>  #define __ASSUME_RECV_SYSCALL		1

> diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list

> index 0415d40ee8..a9dff10271 100644

> --- a/sysdeps/unix/sysv/linux/mips/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list

> @@ -12,7 +12,6 @@ sysmips		-	sysmips		i:iiii	__sysmips	sysmips

>  # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper;

>  # it's provided for compatibility, though.

>  #

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  listen		-	listen		i:ii	__listen	listen

> diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h

> index c7079a4507..ed7d75e0a4 100644

> --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h

> @@ -22,7 +22,6 @@

>  #define __ASSUME_CONNECT_SYSCALL	1

>  #define __ASSUME_LISTEN_SYSCALL		1

>  #define __ASSUME_GETSOCKNAME_SYSCALL	1

> -#define __ASSUME_GETPEERNAME_SYSCALL	1

>  #define __ASSUME_SOCKETPAIR_SYSCALL	1

>  #define __ASSUME_SEND_SYSCALL		1

>  #define __ASSUME_RECV_SYSCALL		1

> diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h

> index 549ecc994d..7a7b22ed01 100644

> --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h

> @@ -25,7 +25,6 @@

>  # define __ASSUME_GETSOCKOPT_SYSCALL         1

>  # define __ASSUME_SETSOCKOPT_SYSCALL         1

>  # define __ASSUME_GETSOCKNAME_SYSCALL        1

> -# define __ASSUME_GETPEERNAME_SYSCALL        1

>  # define __ASSUME_SHUTDOWN_SYSCALL           1

>  #endif

>  

> @@ -43,6 +42,7 @@

>  # undef __ASSUME_CONNECT_SYSCALL

>  # undef __ASSUME_RECVFROM_SYSCALL

>  # undef __ASSUME_SENDTO_SYSCALL

> +# undef __ASSUME_GETPEERNAME_SYSCALL

>  #endif

>  

>  /* s390 only supports ipc syscall before 5.1.  */

> diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h

> index 04ecd02ecd..34109ae859 100644

> --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h

> +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h

> @@ -27,7 +27,6 @@

>  #define __ASSUME_CONNECT_SYSCALL	1

>  #define __ASSUME_LISTEN_SYSCALL		1

>  #define __ASSUME_GETSOCKNAME_SYSCALL	1

> -#define __ASSUME_GETPEERNAME_SYSCALL	1

>  #define __ASSUME_SOCKETPAIR_SYSCALL	1

>  #define __ASSUME_SEND_SYSCALL		1

>  #define __ASSUME_RECV_SYSCALL		1

> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list

> index d30d7f2b96..2acc8a1437 100644

> --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list

> @@ -1,6 +1,5 @@

>  # File name	Caller	Syscall name	# args	Strong name	Weak names

>  

> -getpeername	-	getpeername	3	__getpeername	getpeername

>  getsockname	-	getsockname	3	__getsockname	getsockname

>  getsockopt	-	getsockopt	5	__getsockopt	getsockopt

>  shutdown	-	shutdown	2	__shutdown	shutdown


It also requires to disable for sparc32 targeting kernel lower than 4.4:

diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 8f7348d9ad..6429aaf8c2 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -38,6 +38,7 @@
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
 # undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #else
 # define __ASSUME_SOCKET_SYSCALL             1
 # define __ASSUME_SOCKETPAIR_SYSCALL         1


> diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list

> index a6a725e198..f7612e6545 100644

> --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list

> +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list

> @@ -6,7 +6,6 @@ syscall_clock_gettime	EXTRA	clock_gettime	Ei:ip		__syscall_clock_gettime

>  

>  

>  # proper socket implementations:

> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

>  getsockname	-	getsockname	i:ipp	__getsockname	getsockname

>  getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt

>  listen		-	listen		i:ii	__listen	listen

>

Patch

diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
index 7209c24110..6d1a2ad441 100644
--- a/sysdeps/unix/syscalls.list
+++ b/sysdeps/unix/syscalls.list
@@ -25,7 +25,6 @@  getgid		-	getgid		Ei:	__getgid	getgid
 getgroups	-	getgroups	i:ip	__getgroups	getgroups
 gethostid	-	gethostid	i:	gethostid
 gethostname	-	gethostname	i:bn	__gethostname	gethostname
-getpeername	-	getpeername	i:ibN	__getpeername	getpeername
 getpid		-	getpid		Ei:	__getpid	getpid
 getpriority	-	getpriority	i:ii	__getpriority	getpriority
 getrlimit	-	getrlimit	i:ip	__getrlimit	getrlimit
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index a4e432c50c..62d79edd56 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -5,7 +5,6 @@  sigstack	-	sigstack	2	sigstack
 getpriority	-	getpriority	i:ii	__getpriority	getpriority
 
 # proper socket implementations:
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index 5982889636..87e6c6c88d 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -20,7 +20,6 @@  prlimit64	EXTRA	prlimit64	i:iipp	prlimit64
 fanotify_mark	EXTRA	fanotify_mark	i:iiiiis	fanotify_mark
 
 # proper socket implementations:
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index 98984cf59d..3af1893c80 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -5,7 +5,6 @@  socket		-	socket		i:iii	__socket	socket
 socketpair	-	socketpair	i:iiif	__socketpair	socketpair
 listen		-	listen		i:ii	__listen	listen
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index 0f54c50eba..0d4e9d5e1c 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -1,7 +1,6 @@ 
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
 # proper socket implementations:
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index 46c5334385..53e9890819 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -25,7 +25,6 @@ 
 # define __ASSUME_GETSOCKOPT_SYSCALL         1
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
 # define __ASSUME_GETSOCKNAME_SYSCALL        1
-# define __ASSUME_GETPEERNAME_SYSCALL        1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
 
@@ -41,6 +40,7 @@ 
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
 # undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* i686 only supports ipc syscall before 5.1.  */
diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
index 5a77f18ada..5bb62003d0 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -3,7 +3,6 @@ 
 getpriority	-	getpriority	i:ii	__getpriority	getpriority
 
 # proper socket implementations:
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 71a2631fc0..9945f4388b 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -78,6 +78,7 @@ 
 #define __ASSUME_ACCEPT4_SYSCALL	1
 #define __ASSUME_RECVMMSG_SYSCALL	1
 #define __ASSUME_SENDMMSG_SYSCALL	1
+#define __ASSUME_GETPEERNAME_SYSCALL    1
 
 /* Support for SysV IPC through wired syscalls.  All supported architectures
    either support ipc syscall and/or all the ipc correspondent syscalls.  */
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 06457d3761..e321895ae8 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -25,7 +25,6 @@ 
 # define __ASSUME_GETSOCKOPT_SYSCALL         1
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
 # define __ASSUME_GETSOCKNAME_SYSCALL        1
-# define __ASSUME_GETPEERNAME_SYSCALL        1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
 
@@ -43,6 +42,7 @@ 
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
 # undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index 2facec8c4c..13eba077d6 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -22,7 +22,6 @@ 
 #define __ASSUME_CONNECT_SYSCALL	1
 #define __ASSUME_LISTEN_SYSCALL		1
 #define __ASSUME_GETSOCKNAME_SYSCALL	1
-#define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
index 0415d40ee8..a9dff10271 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -12,7 +12,6 @@  sysmips		-	sysmips		i:iiii	__sysmips	sysmips
 # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper;
 # it's provided for compatibility, though.
 #
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index c7079a4507..ed7d75e0a4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -22,7 +22,6 @@ 
 #define __ASSUME_CONNECT_SYSCALL	1
 #define __ASSUME_LISTEN_SYSCALL		1
 #define __ASSUME_GETSOCKNAME_SYSCALL	1
-#define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index 549ecc994d..7a7b22ed01 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -25,7 +25,6 @@ 
 # define __ASSUME_GETSOCKOPT_SYSCALL         1
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
 # define __ASSUME_GETSOCKNAME_SYSCALL        1
-# define __ASSUME_GETPEERNAME_SYSCALL        1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
 
@@ -43,6 +42,7 @@ 
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
 # undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* s390 only supports ipc syscall before 5.1.  */
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index 04ecd02ecd..34109ae859 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -27,7 +27,6 @@ 
 #define __ASSUME_CONNECT_SYSCALL	1
 #define __ASSUME_LISTEN_SYSCALL		1
 #define __ASSUME_GETSOCKNAME_SYSCALL	1
-#define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index d30d7f2b96..2acc8a1437 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -1,6 +1,5 @@ 
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
-getpeername	-	getpeername	3	__getpeername	getpeername
 getsockname	-	getsockname	3	__getsockname	getsockname
 getsockopt	-	getsockopt	5	__getsockopt	getsockopt
 shutdown	-	shutdown	2	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index a6a725e198..f7612e6545 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -6,7 +6,6 @@  syscall_clock_gettime	EXTRA	clock_gettime	Ei:ip		__syscall_clock_gettime
 
 
 # proper socket implementations:
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
 getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen