Define in_int32_t_range to check if the 64 bit time_t syscall should be used
commita9acb7b39ed21386142b963aeecc35e0b468c0de
authorYunQiang Su <yunqiang.su@cipunited.com>
Tue, 8 Nov 2022 04:49:46 +0000 (8 12:49 +0800)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 17 Nov 2022 17:35:13 +0000 (17 14:35 -0300)
tree0c77b1e8f3dcc46a1a0e13d8938bac571e636be2
parent94628de77888c3292fc103840731ff85f283368e
Define in_int32_t_range to check if the 64 bit time_t syscall should be used

Currently glibc uses in_time_t_range to detects time_t overflow,
and if it occurs fallbacks to 64 bit syscall version.

The function name is confusing because internally time_t might be
either 32 bits or 64 bits (depending on __TIMESIZE).

This patch refactors the in_time_t_range by replacing it with
in_int32_t_range for the case to check if the 64 bit time_t syscall
should be used.

The in_time_t range is used to detect overflow of the
syscall return value.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
18 files changed:
include/time.h
nptl/futex-internal.c
sysdeps/unix/sysv/linux/clock_adjtime.c
sysdeps/unix/sysv/linux/clock_nanosleep.c
sysdeps/unix/sysv/linux/clock_settime.c
sysdeps/unix/sysv/linux/mq_timedreceive.c
sysdeps/unix/sysv/linux/mq_timedsend.c
sysdeps/unix/sysv/linux/ppoll.c
sysdeps/unix/sysv/linux/pselect.c
sysdeps/unix/sysv/linux/recvmmsg.c
sysdeps/unix/sysv/linux/select.c
sysdeps/unix/sysv/linux/semtimedop.c
sysdeps/unix/sysv/linux/setitimer.c
sysdeps/unix/sysv/linux/setsockopt.c
sysdeps/unix/sysv/linux/sigtimedwait.c
sysdeps/unix/sysv/linux/timer_settime.c
sysdeps/unix/sysv/linux/timerfd_settime.c
sysdeps/unix/sysv/linux/utimensat.c