mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-29 16:21:07 +00:00
4c3df0eba5
For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall if the provided timeout fits in a 32-bit one. The 64-bit usage should be rare since the timeout is a relative one. This also avoids the need to use supports_time64() (which breaks the usage case of live migration like CRIU or similar). It also fixes an issue on 32-bit select call for !__ASSUME_PSELECT (microblase with older kernels only) where the expected timeout is a 'struct timeval' instead of 'struct timespec'. Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel (with and without --enable-kernel=5.1) and on x86_64-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
#ifndef _SYS_SELECT_H
|
|
#include <misc/sys/select.h>
|
|
|
|
#ifndef _ISOMAC
|
|
/* Now define the internal interfaces. */
|
|
# if __TIMESIZE == 64
|
|
# define __pselect64 __pselect
|
|
# define __select64 __select
|
|
#else
|
|
# include <struct___timespec64.h>
|
|
# include <struct___timeval64.h>
|
|
|
|
extern int __pselect64 (int __nfds, fd_set *__readfds,
|
|
fd_set *__writefds, fd_set *__exceptfds,
|
|
const struct __timespec64 *__timeout,
|
|
const __sigset_t *__sigmask);
|
|
libc_hidden_proto (__pselect64)
|
|
|
|
extern int __pselect32 (int __nfds, fd_set *__readfds,
|
|
fd_set *__writefds, fd_set *__exceptfds,
|
|
const struct __timespec64 *__timeout,
|
|
const __sigset_t *__sigmask)
|
|
attribute_hidden;
|
|
extern int __select32 (int __nfds, fd_set *__readfds,
|
|
fd_set *__writefds, fd_set *__exceptfds,
|
|
const struct __timespec64 *ts64,
|
|
struct __timeval64 *timeout)
|
|
attribute_hidden;
|
|
|
|
extern int __select64 (int __nfds, fd_set *__readfds,
|
|
fd_set *__writefds, fd_set *__exceptfds,
|
|
struct __timeval64 *__timeout);
|
|
libc_hidden_proto (__select64)
|
|
#endif
|
|
extern int __pselect (int __nfds, fd_set *__readfds,
|
|
fd_set *__writefds, fd_set *__exceptfds,
|
|
const struct timespec *__timeout,
|
|
const __sigset_t *__sigmask);
|
|
|
|
extern int __select (int __nfds, fd_set *__restrict __readfds,
|
|
fd_set *__restrict __writefds,
|
|
fd_set *__restrict __exceptfds,
|
|
struct timeval *__restrict __timeout);
|
|
libc_hidden_proto (__select)
|
|
|
|
#endif
|
|
#endif
|