diff options
author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2025-04-11 11:00:41 +0200 |
---|---|---|
committer | Thomas Weißschuh <linux@weissschuh.net> | 2025-04-22 10:56:25 +0200 |
commit | 4de88a88bcbe4cf89477d8c6a9145fdfd929bc96 (patch) | |
tree | f69fc55347861601b7896df3473bc418d809d87b | |
parent | 248ddc80b145515286bfb75d08034ad4c0fdb08e (diff) |
tools/nolibc: use ppoll_time64 if available
riscv32 does not have any of the older poll systemcalls.
Use ppoll_time64 instead.
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 2f33efc3c5ee..aa0d0871b251 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -772,6 +772,14 @@ int sys_poll(struct pollfd *fds, int nfds, int timeout) t.tv_nsec = (timeout % 1000) * 1000000; } return my_syscall5(__NR_ppoll, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0); +#elif defined(__NR_ppoll_time64) + struct __kernel_timespec t; + + if (timeout >= 0) { + t.tv_sec = timeout / 1000; + t.tv_nsec = (timeout % 1000) * 1000000; + } + return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0); #elif defined(__NR_poll) return my_syscall3(__NR_poll, fds, nfds, timeout); #else |