]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/nolibc/poll: use kernel types for system call invocations
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 20 Dec 2025 13:55:45 +0000 (14:55 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Sun, 4 Jan 2026 09:28:57 +0000 (10:28 +0100)
The system calls expect 'struct __kernel_old_timespec'.
While currently 'struct __kernel_old_timespec' and 'struct timespec' are
compatible, this is confusing. Especially as future patches will change
the definition of 'struct timespec'.

Use the correct kernel type instead.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/lkml/fbca1d3e-12e4-4c4e-8091-87464035fe39@app.fastmail.com/
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20251220-nolibc-uapi-types-v3-1-c662992f75d7@weissschuh.net
tools/include/nolibc/poll.h
tools/include/nolibc/sys/select.h

index 0d053f93ea99b0363b4bdfd2c400d6df2f932684..df952bcf09055fb2b9d5d909538b560763797561 100644 (file)
@@ -24,7 +24,7 @@ static __attribute__((unused))
 int sys_poll(struct pollfd *fds, int nfds, int timeout)
 {
 #if defined(__NR_ppoll)
-       struct timespec t;
+       struct __kernel_old_timespec t;
 
        if (timeout >= 0) {
                t.tv_sec  = timeout / 1000;
index 2a5619c012779bf9c0328996115e4f5d9eb863ba..9a29e5b98a3cef0e9096b273a24275913f711088 100644 (file)
@@ -75,7 +75,7 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva
 #elif defined(__NR_select)
        return my_syscall5(__NR_select, nfds, rfds, wfds, efds, timeout);
 #elif defined(__NR_pselect6)
-       struct timespec t;
+       struct __kernel_old_timespec t;
 
        if (timeout) {
                t.tv_sec  = timeout->tv_sec;