diff options
author | 2025-04-11 11:00:40 +0200 | |
---|---|---|
committer | 2025-04-22 10:56:25 +0200 | |
commit | 248ddc80b145515286bfb75d08034ad4c0fdb08e (patch) | |
tree | d38944fdf6622ad9956146e4abcaf8656fd66f6d /tools/include/nolibc | |
parent | tools/nolibc: use intmax definitions from compiler (diff) | |
download | wireguard-linux-248ddc80b145515286bfb75d08034ad4c0fdb08e.tar.xz wireguard-linux-248ddc80b145515286bfb75d08034ad4c0fdb08e.zip |
tools/nolibc: use pselect6_time64 if available
riscv32 does not have any of the older select systemcalls.
Use pselect6_time64 instead.
poll() is also used to implement sleep().
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'tools/include/nolibc')
-rw-r--r-- | tools/include/nolibc/sys.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index d07456d6e572..2f33efc3c5ee 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -902,6 +902,14 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva t.tv_nsec = timeout->tv_usec * 1000; } return my_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL); +#elif defined(__NR_pselect6_time64) + struct __kernel_timespec t; + + if (timeout) { + t.tv_sec = timeout->tv_sec; + t.tv_nsec = timeout->tv_usec * 1000; + } + return my_syscall6(__NR_pselect6_time64, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL); #else return __nolibc_enosys(__func__, nfds, rfds, wfds, efds, timeout); #endif |