summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/pselect.c
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2022-11-08 12:49:46 +0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-11-17 14:35:13 -0300
commita9acb7b39ed21386142b963aeecc35e0b468c0de (patch)
tree0c77b1e8f3dcc46a1a0e13d8938bac571e636be2 /sysdeps/unix/sysv/linux/pselect.c
parent94628de77888c3292fc103840731ff85f283368e (diff)
downloadglibc-a9acb7b39ed21386142b963aeecc35e0b468c0de.tar
glibc-a9acb7b39ed21386142b963aeecc35e0b468c0de.tar.gz
glibc-a9acb7b39ed21386142b963aeecc35e0b468c0de.tar.bz2
glibc-a9acb7b39ed21386142b963aeecc35e0b468c0de.zip
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>
Diffstat (limited to 'sysdeps/unix/sysv/linux/pselect.c')
-rw-r--r--sysdeps/unix/sysv/linux/pselect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/pselect.c b/sysdeps/unix/sysv/linux/pselect.c
index eba1c111f8..23fd0dfad6 100644
--- a/sysdeps/unix/sysv/linux/pselect.c
+++ b/sysdeps/unix/sysv/linux/pselect.c
@@ -56,7 +56,7 @@ __pselect64 (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
return pselect64_syscall (nfds, readfds, writefds, exceptfds, timeout,
sigmask);
#else
- bool need_time64 = timeout != NULL && !in_time_t_range (timeout->tv_sec);
+ bool need_time64 = timeout != NULL && !in_int32_t_range (timeout->tv_sec);
if (need_time64)
{
int r = pselect64_syscall (nfds, readfds, writefds, exceptfds, timeout,