]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/nolibc: don't define new syscall number
authorThomas Weißschuh <linux@weissschuh.net>
Sun, 17 Sep 2023 15:36:18 +0000 (17:36 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Thu, 12 Oct 2023 19:14:12 +0000 (21:14 +0200)
All symbols created by nolibc are also visible to user code.
Syscall constants are expected to come from the kernel headers and
should not be made up by nolibc.

Refactor the logic to avoid defining syscall numbers.
Also the new code is easier to understand.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-3-03863d509b9a@weissschuh.net
tools/include/nolibc/sys.h

index 8389820e19287a19c14dd9118bb9722c145f7c0f..f05144e46b675eb35095967d0e7861b85f4a3989 100644 (file)
@@ -938,11 +938,10 @@ 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__newselect) || defined(__NR_select)
-#ifndef __NR__newselect
-#define __NR__newselect __NR_select
-#endif
+#elif defined(__NR__newselect)
        return my_syscall5(__NR__newselect, nfds, rfds, wfds, efds, timeout);
+#elif defined(__NR_select)
+       return my_syscall5(__NR_select, nfds, rfds, wfds, efds, timeout);
 #else
        return __nolibc_enosys(__func__, nfds, rfds, wfds, efds, timeout);
 #endif