aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-05 13:44:26 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-06 11:45:35 -0300
commit1c46663a70d7225102b9c7adda542d3782353db6 (patch)
tree5fa77bf1de1cf2bec11954a68d7cb0e63f37b7bd /sysdeps
parentb156c5f0a72eca8b28e1e5a5e51f29cf5ffb3bfb (diff)
downloadglibc-1c46663a70d7225102b9c7adda542d3782353db6.zip
glibc-1c46663a70d7225102b9c7adda542d3782353db6.tar.gz
glibc-1c46663a70d7225102b9c7adda542d3782353db6.tar.bz2
linux: Consolidate Linux getsockopt implementation
This patch consolidates the getsockopt Linux syscall 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_GETSOCKOPT_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 getsockopt which overrides the underlying SO_* constants used for socket timestamping for _TIME_BITS=64. Checked on x86_64-linux-gnu and i686-linux-gnu.
Diffstat (limited to 'sysdeps')
-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 c848fcb..0a39d08 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -8,7 +8,6 @@ getpriority - getpriority i:ii __getpriority getpriority
bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
-getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index 13441f7..b530057 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -25,7 +25,6 @@ personality EXTRA personality Ei:i __personality personality
bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
-getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index ed8b216..7397797 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -8,5 +8,4 @@ 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 cd37573..2451cc9 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -4,7 +4,6 @@
bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
-getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index 923fa0b..a6eca40 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_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
@@ -41,6 +40,7 @@
# undef __ASSUME_CONNECT_SYSCALL
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETSOCKOPT_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 bd39441..c0e9ea2 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -6,7 +6,6 @@ getpriority - getpriority i:ii __getpriority getpriority
bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
-getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 1680b10..913c3fc 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -77,6 +77,7 @@
#define __ASSUME_ACCEPT4_SYSCALL 1
#define __ASSUME_RECVMMSG_SYSCALL 1
#define __ASSUME_SENDMMSG_SYSCALL 1
+#define __ASSUME_GETSOCKOPT_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 46bb9d8..e1fa35c 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_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
@@ -43,6 +42,7 @@
# undef __ASSUME_CONNECT_SYSCALL
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETSOCKOPT_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 69d8cca..a09a9ea 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_GETSOCKOPT_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 f3621cd..07e07de 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -15,7 +15,6 @@ sysmips - sysmips i:iiii __sysmips sysmips
bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
-getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index c205695..769ef13 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_GETSOCKOPT_SYSCALL 1
#define __ASSUME_SETSOCKOPT_SYSCALL 1
/* Define this if your 32-bit syscall API requires 64-bit register
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index 724f207..0221a0e 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_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
# define __ASSUME_GETSOCKNAME_SYSCALL 1
# define __ASSUME_GETPEERNAME_SYSCALL 1
@@ -43,6 +42,7 @@
# undef __ASSUME_CONNECT_SYSCALL
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETSOCKOPT_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 334e69b..3b0c385 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_GETSOCKOPT_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 7ffafc9..0b105eb 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -38,10 +38,10 @@
# undef __ASSUME_CONNECT_SYSCALL
# undef __ASSUME_RECVFROM_SYSCALL
# undef __ASSUME_SENDTO_SYSCALL
+# undef __ASSUME_GETSOCKOPT_SYSCALL
#else
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
-# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SHUTDOWN_SYSCALL 1
#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index d46524e..fceb6d2 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -9,7 +9,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
bind - bind i:ipi __bind bind
getpeername - getpeername i:ipp __getpeername getpeername
getsockname - getsockname i:ipp __getsockname getsockname
-getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
listen - listen i:ii __listen listen
setsockopt - setsockopt i:iiibn __setsockopt setsockopt
shutdown - shutdown i:ii __shutdown shutdown