]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
tools/nolibc: use ppoll_time64 if available
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Fri, 11 Apr 2025 09:00:41 +0000 (11:00 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Tue, 22 Apr 2025 08:56:25 +0000 (10:56 +0200)
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>
tools/include/nolibc/sys.h

index 2f33efc3c5ee548056ae8bf8b56010782cdad285..aa0d0871b251067df97ccc04ca955c710e9f1aaa 100644 (file)
@@ -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