]> sourceware.org Git - glibc.git/commit
linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 7 Sep 2020 17:13:58 +0000 (14:13 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 14 Jun 2021 21:00:06 +0000 (18:00 -0300)
commit8dfb169c80b56cf25494d052ddf410dc55f2f5a3
tree47ef6107ecb9e9323c8703e5424b77676a27f743
parent5767b0ddcb592546fe8d978dd8f06904756373dd
linux: Add fallback for 64-bit time_t SO_{RCV,SND}TIMEO

The constant values will be changed for __TIMESIZE=64, so binaries built
with 64-bit time support might fail to work properly on old kernels.
Both {get,set}sockopt will retry the syscall with the old constant
values and the timeout value adjusted when kernel returns ENOTPROTOPT.

It also adds an internal only SO_{RCV,SND}TIMEO where
COMPAT_SO_{RCV,SND}TIMEO_OLD indicates pre 32-bit time support and
COMPAT_SO_{RCV,SND}TIMEO_NEW indicates time64 support.  It allows to
refer to constant independently of the time_t ABI and kernel version
used.

Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15
kernel).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/getsockopt.c
sysdeps/unix/sysv/linux/hppa/socket-constants-time64.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/mips/socket-constants-time64.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/socket-constants-time64.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/setsockopt.c
sysdeps/unix/sysv/linux/socket-constants-time64.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/socket-constants-time64.h [new file with mode: 0644]
This page took 0.053673 seconds and 5 git commands to generate.