Skip to content

Commit e7b28f2

Browse files
committed
tools/nolibc: don't define new syscall number
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 <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 535b70c commit e7b28f2

File tree

1 file changed

+3
-4
lines changed
  • tools/include/nolibc

1 file changed

+3
-4
lines changed

tools/include/nolibc/sys.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,11 +938,10 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva
938938
t.tv_nsec = timeout->tv_usec * 1000;
939939
}
940940
return my_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL);
941-
#elif defined(__NR__newselect) || defined(__NR_select)
942-
#ifndef __NR__newselect
943-
#define __NR__newselect __NR_select
944-
#endif
941+
#elif defined(__NR__newselect)
945942
return my_syscall5(__NR__newselect, nfds, rfds, wfds, efds, timeout);
943+
#elif defined(__NR_select)
944+
return my_syscall5(__NR_select, nfds, rfds, wfds, efds, timeout);
946945
#else
947946
return __nolibc_enosys(__func__, nfds, rfds, wfds, efds, timeout);
948947
#endif

0 commit comments

Comments
 (0)