]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
tools/nolibc: use pselect6_time64 if available
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Fri, 11 Apr 2025 09:00:40 +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 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>
tools/include/nolibc/sys.h

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