[8/8] socket: Add time64 alias for setsockopt

Message ID f1497c80f495f31be394d7471134071922870701.1626708388.git.fweimer@redhat.com
State Committed
Headers
Series Additional time64 system call wrappers |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit fail Patch caused testsuite regressions

Commit Message

Florian Weimer July 19, 2021, 3:29 p.m. UTC
  ---
 socket/sys/socket.h                                 | 13 +++++++++++++
 sysdeps/unix/sysv/linux/Versions                    |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist           |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist           |  1 +
 sysdeps/unix/sysv/linux/hppa/syscalls.list          |  2 +-
 sysdeps/unix/sysv/linux/i386/libc.abilist           |  1 +
 sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/microblaze/be/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/microblaze/le/libc.abilist  |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist    |  1 +
 .../unix/sysv/linux/mips/mips32/nofpu/libc.abilist  |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/nios2/libc.abilist          |  1 +
 .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc32/nofpu/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/setsockopt.c                |  3 +++
 sysdeps/unix/sysv/linux/sh/be/libc.abilist          |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist          |  1 +
 sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist  |  1 +
 23 files changed, 37 insertions(+), 1 deletion(-)
  

Comments

Adhemerval Zanella Netto July 21, 2021, 8:18 p.m. UTC | #1
LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

On 19/07/2021 12:29, Florian Weimer via Libc-alpha wrote:
> ---
>  socket/sys/socket.h                                 | 13 +++++++++++++
>  sysdeps/unix/sysv/linux/Versions                    |  1 +
>  sysdeps/unix/sysv/linux/arm/be/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/arm/le/libc.abilist         |  1 +
>  sysdeps/unix/sysv/linux/csky/libc.abilist           |  1 +
>  sysdeps/unix/sysv/linux/hppa/libc.abilist           |  1 +
>  sysdeps/unix/sysv/linux/hppa/syscalls.list          |  2 +-
>  sysdeps/unix/sysv/linux/i386/libc.abilist           |  1 +
>  sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/microblaze/be/libc.abilist  |  1 +
>  sysdeps/unix/sysv/linux/microblaze/le/libc.abilist  |  1 +
>  .../unix/sysv/linux/mips/mips32/fpu/libc.abilist    |  1 +
>  .../unix/sysv/linux/mips/mips32/nofpu/libc.abilist  |  1 +
>  .../unix/sysv/linux/mips/mips64/n32/libc.abilist    |  1 +
>  sysdeps/unix/sysv/linux/nios2/libc.abilist          |  1 +
>  .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist   |  1 +
>  .../sysv/linux/powerpc/powerpc32/nofpu/libc.abilist |  1 +
>  sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist   |  1 +
>  sysdeps/unix/sysv/linux/setsockopt.c                |  3 +++
>  sysdeps/unix/sysv/linux/sh/be/libc.abilist          |  1 +
>  sysdeps/unix/sysv/linux/sh/le/libc.abilist          |  1 +
>  sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist  |  1 +
>  23 files changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/socket/sys/socket.h b/socket/sys/socket.h
> index b37c87e7df..bd14e7e3a5 100644
> --- a/socket/sys/socket.h
> +++ b/socket/sys/socket.h
> @@ -273,8 +273,21 @@ extern int __getsockopt64 (int __fd, int __level, int __optname,
>  /* Set socket FD's option OPTNAME at protocol level LEVEL
>     to *OPTVAL (which is OPTLEN bytes long).
>     Returns 0 on success, -1 for errors.  */
> +#ifndef __USE_TIME_BITS64
>  extern int setsockopt (int __fd, int __level, int __optname,
>  		       const void *__optval, socklen_t __optlen) __THROW;
> +#else
> +# ifdef __REDIRECT
> +extern int __REDIRECT_NTH (setsockopt,
> +			   (int __fd, int __level, int __optname,
> +			    const void *__optval, socklen_t __optlen),
> +			   __setsockopt64);
> +# else
> +extern int __setsockopt64 (int __fd, int __level, int __optname,
> +			   const void *__optval, socklen_t __optlen) __THROW;
> +#  define setsockopt __setsockopt64
> +# endif
> +#endif
>  
>  
>  /* Prepare to accept connections on socket FD.

Ok.

> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index 5ff450f476..26452f3f17 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -270,6 +270,7 @@ libc {
>      __sendmmsg64;
>      __sendmsg64;
>      __setitimer64;
> +    __setsockopt64;
>      __settimeofday64;
>      __shmctl64;
>      __sigtimedwait64;


Ok.

> diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> index cb5615f428..f44b16f3de 100644
> --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
> @@ -271,6 +271,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> index 88c3db4560..6217997baa 100644
> --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
> @@ -268,6 +268,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
> index e90ad23a66..b7676eb372 100644
> --- a/sysdeps/unix/sysv/linux/csky/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
> @@ -2427,6 +2427,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> index ea727e1956..f8ff5e747b 100644
> --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
> @@ -2378,6 +2378,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
> index 043d884bf9..2e8fb29bb8 100644
> --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
> @@ -1,5 +1,5 @@
>  # File name	Caller	Syscall name	# args	Strong name	Weak names
> -
> +soc
>  # proper socket implementations:
>  bind		-	bind		i:ipi	__bind		bind
>  getpeername	-	getpeername	i:ipp	__getpeername	getpeername

Lukasz already point this out.

> diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
> index f53a44f7ca..8e707af79a 100644
> --- a/sysdeps/unix/sysv/linux/i386/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
> @@ -2562,6 +2562,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> index c86910563a..2e88a2a996 100644
> --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
> @@ -272,6 +272,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> index c7fe3b31e7..1794c76cd4 100644
> --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
> @@ -2505,6 +2505,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> index 3c8ed8d962..1a297fbf9e 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
> @@ -2478,6 +2478,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> index cc3a28054d..36cf30deb5 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
> @@ -2475,6 +2475,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> index 49bc91ab6a..34ea962247 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
> @@ -2470,6 +2470,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> index 853a61f3db..22354c5799 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
> @@ -2468,6 +2468,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> index 28917895bd..b7d6d9414e 100644
> --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
> @@ -2476,6 +2476,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> index e4d4ea4d26..7bb0ec4ed6 100644
> --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
> @@ -2517,6 +2517,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> index 22b7f8604d..5e9087079d 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
> @@ -2532,6 +2532,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> index 8b49bcfe32..0c9cc83df3 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
> @@ -2565,6 +2565,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> index 97939a88ee..cb15385c69 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
> @@ -2530,6 +2530,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
> index bb3017f89c..7cefbc2b48 100644
> --- a/sysdeps/unix/sysv/linux/setsockopt.c
> +++ b/sysdeps/unix/sysv/linux/setsockopt.c
> @@ -103,3 +103,6 @@ __setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
>  }
>  libc_hidden_def (__setsockopt)
>  weak_alias (__setsockopt, setsockopt)
> +#if __TIMESIZE != 64
> +weak_alias (__setsockopt, __setsockopt64)
> +#endif

Ok.

> diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> index a56b7ddd00..c8f397c8fa 100644
> --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
> @@ -2385,6 +2385,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> index c043e9b58f..e78accd62c 100644
> --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
> @@ -2382,6 +2382,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> index ebd2acd9e4..a7d2467635 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
> @@ -2525,6 +2525,7 @@ GLIBC_2.34 __semtimedop64 F
>  GLIBC_2.34 __sendmmsg64 F
>  GLIBC_2.34 __sendmsg64 F
>  GLIBC_2.34 __setitimer64 F
> +GLIBC_2.34 __setsockopt64 F
>  GLIBC_2.34 __settimeofday64 F
>  GLIBC_2.34 __shmctl64 F
>  GLIBC_2.34 __sigtimedwait64 F
> 

Ok.
  

Patch

diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index b37c87e7df..bd14e7e3a5 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -273,8 +273,21 @@  extern int __getsockopt64 (int __fd, int __level, int __optname,
 /* Set socket FD's option OPTNAME at protocol level LEVEL
    to *OPTVAL (which is OPTLEN bytes long).
    Returns 0 on success, -1 for errors.  */
+#ifndef __USE_TIME_BITS64
 extern int setsockopt (int __fd, int __level, int __optname,
 		       const void *__optval, socklen_t __optlen) __THROW;
+#else
+# ifdef __REDIRECT
+extern int __REDIRECT_NTH (setsockopt,
+			   (int __fd, int __level, int __optname,
+			    const void *__optval, socklen_t __optlen),
+			   __setsockopt64);
+# else
+extern int __setsockopt64 (int __fd, int __level, int __optname,
+			   const void *__optval, socklen_t __optlen) __THROW;
+#  define setsockopt __setsockopt64
+# endif
+#endif
 
 
 /* Prepare to accept connections on socket FD.
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 5ff450f476..26452f3f17 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -270,6 +270,7 @@  libc {
     __sendmmsg64;
     __sendmsg64;
     __setitimer64;
+    __setsockopt64;
     __settimeofday64;
     __shmctl64;
     __sigtimedwait64;
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index cb5615f428..f44b16f3de 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -271,6 +271,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 88c3db4560..6217997baa 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -268,6 +268,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index e90ad23a66..b7676eb372 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2427,6 +2427,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index ea727e1956..f8ff5e747b 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2378,6 +2378,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index 043d884bf9..2e8fb29bb8 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -1,5 +1,5 @@ 
 # File name	Caller	Syscall name	# args	Strong name	Weak names
-
+soc
 # proper socket implementations:
 bind		-	bind		i:ipi	__bind		bind
 getpeername	-	getpeername	i:ipp	__getpeername	getpeername
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index f53a44f7ca..8e707af79a 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -2562,6 +2562,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index c86910563a..2e88a2a996 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -272,6 +272,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index c7fe3b31e7..1794c76cd4 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2505,6 +2505,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 3c8ed8d962..1a297fbf9e 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2478,6 +2478,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index cc3a28054d..36cf30deb5 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2475,6 +2475,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 49bc91ab6a..34ea962247 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2470,6 +2470,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 853a61f3db..22354c5799 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2468,6 +2468,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index 28917895bd..b7d6d9414e 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2476,6 +2476,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist
index e4d4ea4d26..7bb0ec4ed6 100644
--- a/sysdeps/unix/sysv/linux/nios2/libc.abilist
+++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist
@@ -2517,6 +2517,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 22b7f8604d..5e9087079d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -2532,6 +2532,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 8b49bcfe32..0c9cc83df3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -2565,6 +2565,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 97939a88ee..cb15385c69 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -2530,6 +2530,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
index bb3017f89c..7cefbc2b48 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.c
+++ b/sysdeps/unix/sysv/linux/setsockopt.c
@@ -103,3 +103,6 @@  __setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
 }
 libc_hidden_def (__setsockopt)
 weak_alias (__setsockopt, setsockopt)
+#if __TIMESIZE != 64
+weak_alias (__setsockopt, __setsockopt64)
+#endif
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index a56b7ddd00..c8f397c8fa 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2385,6 +2385,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index c043e9b58f..e78accd62c 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2382,6 +2382,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index ebd2acd9e4..a7d2467635 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -2525,6 +2525,7 @@  GLIBC_2.34 __semtimedop64 F
 GLIBC_2.34 __sendmmsg64 F
 GLIBC_2.34 __sendmsg64 F
 GLIBC_2.34 __setitimer64 F
+GLIBC_2.34 __setsockopt64 F
 GLIBC_2.34 __settimeofday64 F
 GLIBC_2.34 __shmctl64 F
 GLIBC_2.34 __sigtimedwait64 F