This is a BSD-ism... read the man page on "getrlimit" (get resource
limit). You are interested in the RLIMIT_NOFILE resource specification
from getrlimit().
I thought I made a patch for this, but on further inspection, I cannot
find it. The modification is only about 4 lines of code (a variable
declaration of the appropriate structure, the changed call from
getdtablesize() to getrlimit(), and a new assignment).
If you can't make it work, let me know and I'll spend a little time on
putting a patch together for you.
--douglas
/****************************************************************************
* Eric W. Douglas Internet: eric_douglas@csufresno.edu
* CCMS/CSci, California Voice: +1 209 278 3923
* State University Fresno Logic joke: if p->q and not q then not p, NOT!
****************************************************************************/