aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-05 13:01:24 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-06 11:45:35 -0300
commit4b93a93e407308000ee6a1c3fec3715127c2c4c5 (patch)
treeaecac9ff7417d1bb041f5241f2005498e50aebca
parent1c46663a70d7225102b9c7adda542d3782353db6 (diff)
downloadglibc-4b93a93e407308000ee6a1c3fec3715127c2c4c5.zip
glibc-4b93a93e407308000ee6a1c3fec3715127c2c4c5.tar.gz
glibc-4b93a93e407308000ee6a1c3fec3715127c2c4c5.tar.bz2
linux: Consolidate Linux setsockopt implementation
This patch consolidates the setsockopt implementation on sysdeps/unix/sysv/linux/getsockopt.c. The changes are: 1. Remove it from auto-generation syscalls.list on all architectures. 2. Add __ASSUME_SETSOCKOPT_SYSCALL as default and undef if for specific kernel versions on some architectures. This also fix a potential issue where 32-bit time_t ABI should use the linux setsockopt which overrides the underlying SO_* constants used for socket timestamping for _TIME_BITS=64. Checked on x86_64-linux-gnu and i686-linux-gnu.
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/generic/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/i386/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/s390/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list1
15 files changed, 5 insertions, 14 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 0a39d08..cbfd125 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -9,7 +9,6 @@ bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
listen - listen i:ii __listen listen
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index b530057..10c3ae9 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -26,7 +26,6 @@ bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
listen - listen i:ii __listen listen
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index 7397797..f573f27 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -7,5 +7,4 @@ bind - bind i:ipi __bind bind
listen - listen i:ii __listen listen
getsockname - getsockname i:ipp __getsockname getsockname
getpeername - getpeername i:ipp __getpeername getpeername
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
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 2451cc9..043d884 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -5,7 +5,6 @@ bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
listen - listen i:ii __listen listen
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index a6eca40..8327f82 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -23,7 +23,6 @@
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
@@ -41,6 +40,7 @@
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
# undef __ASSUME_GETSOCKOPT_SYSCALL
+# undef __ASSUME_SETSOCKOPT_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 c0e9ea2..8aa85fc 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -7,7 +7,6 @@ bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
listen - listen i:ii __listen listen
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 913c3fc..3930e14 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -78,6 +78,7 @@
#define __ASSUME_RECVMMSG_SYSCALL 1
#define __ASSUME_SENDMMSG_SYSCALL 1
#define __ASSUME_GETSOCKOPT_SYSCALL 1
+#define __ASSUME_SETSOCKOPT_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 e1fa35c..70f1154 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -23,7 +23,6 @@
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
@@ -43,6 +42,7 @@
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
# undef __ASSUME_GETSOCKOPT_SYSCALL
+# undef __ASSUME_SETSOCKOPT_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 a09a9ea..a8fbc67 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -28,7 +28,6 @@
#define __ASSUME_SEND_SYSCALL 1
#define __ASSUME_RECV_SYSCALL 1
#define __ASSUME_SHUTDOWN_SYSCALL 1
-#define __ASSUME_SETSOCKOPT_SYSCALL 1
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
index 07e07de..d995047 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -16,7 +16,6 @@ bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
listen - listen i:ii __listen listen
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index 769ef13..6c04e18 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -28,7 +28,6 @@
#define __ASSUME_SEND_SYSCALL 1
#define __ASSUME_RECV_SYSCALL 1
#define __ASSUME_SHUTDOWN_SYSCALL 1
-#define __ASSUME_SETSOCKOPT_SYSCALL 1
/* Define this if your 32-bit syscall API requires 64-bit register
pairs to start with an even-number register. */
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index 0221a0e..4757e9e 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -23,7 +23,6 @@
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
@@ -43,6 +42,7 @@
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
# undef __ASSUME_GETSOCKOPT_SYSCALL
+# undef __ASSUME_SETSOCKOPT_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 3b0c385..15f5cc2 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -33,7 +33,6 @@
#define __ASSUME_SEND_SYSCALL 1
#define __ASSUME_RECV_SYSCALL 1
#define __ASSUME_SHUTDOWN_SYSCALL 1
-#define __ASSUME_SETSOCKOPT_SYSCALL 1
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 0b105eb..2c28393 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -39,6 +39,7 @@
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
# undef __ASSUME_GETSOCKOPT_SYSCALL
+# undef __ASSUME_SETSOCKOPT_SYSCALL
#else
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
@@ -49,7 +50,6 @@
#if __LINUX_KERNEL_VERSION >= 0x040400
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_SETSOCKOPT_SYSCALL 1
#endif
#ifdef __arch64__
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index fceb6d2..4ce5913 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -10,7 +10,6 @@ bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
listen - listen i:ii __listen listen
-setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
socket - socket i:iii __socket socket
socketpair - socketpair i:iiif __socketpair socketpair