diff options
author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-04-11 12:00:40 +0300 |
---|---|---|
committer | Thomas Weißschuh <linux@weissschuh.net> | 2025-04-22 11:56:25 +0300 |
commit | 248ddc80b145515286bfb75d08034ad4c0fdb08e (patch) | |
tree | d38944fdf6622ad9956146e4abcaf8656fd66f6d | |
parent | e5407c0820ea5fa7117b85ed32b724af73156d63 (diff) | |
download | linux-248ddc80b145515286bfb75d08034ad4c0fdb08e.tar.xz |
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>
-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 |