getdtablesize/_rpc_dtablesize and Linux kernel
H . J . Lu
hjl@valinux.com
Fri Mar 31 15:22:00 GMT 2000
getdtablesize/_rpc_dtablesize in glibc is a mess as far as Linux
kernel is concerned. We have 2 values here:
1. The number of open fds the kernel permits, which getdtablesize ()
will return at the runtime.
2. The number of open fds glibc supports, mainly the size of
fd_set used by glibc.
#1 can be increased by changing NR_OPEN/INR_OPEN in kernel and
recompiling it. However, glibc uses _rpc_dtablesize () which
calls getdtablesize () on the functions, like select (), which
use fd_set. It won't work when _rpc_dtablesize () returns a
value larger than size of fd_set at the runtime. I think glibc
should use the size of fd_set for functions which use it.
BTW, does glibc check NR_OPEN in the kernel source during the build?
--
H.J. Lu (hjl@gnu.org)
More information about the Libc-hacker
mailing list