On Nov 12, 2007 11:00 PM, Arthur de Jong <email@example.com> wrote:
> Anyone have a better way to detect the highest open file descriptor
> (preferably something that also works inside a chroot jail that does not
> have /proc mounted)? NetBSD seems to have fcntl(F_MAXFD) that should do
> the trick, but it's unavailable on Linux.
If we do find a method that works, it seems sensibile to make a simple
LD_PRELOAD library you can set that will spit out warnings whenever
extra file descriptiors are left open. The FD_CLOEXEC flag exists for
a reason and most cases to probably bugs.
Have a nice day,
Martijn van Oosterhout <firstname.lastname@example.org> http://svana.org/kleptog/