我想知道为什么“man select”为 nfds > FD_SETSIZE 提供 EINVAL。
但我使用示例代码来测试它。FD_SETSIZE=1024,但 select(4096, ...) 不返回 EINVAL。
任何人都知道在哪里可以找到 select() 实现的源代码?
我使用这个命令找到了类似的功能,但它与'select'并不完全相同
$ find . -name '*.c' -exec grep -n 'select[(]int' {} /dev/null \;
./fs/select.c:396:int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
./fs/select.c:518:int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
./fs/select.c:617:static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp,
我在 glibc 源的 syscalls.list 文件中 grep 'select'
grep select ./sysdeps/unix/syscalls.list
select - select Ci:iPPPP __select __libc_select select
我仍然不明白如何在 glibc/linux 内核代码中找到系统调用 select() 的来源。