[comp.bugs.4bsd] getdtablesize

flee@psuvax1.cs.psu.edu (Felix Lee) (06/12/90)

>Modern Unixes have a call to tell you the # of file descriptors:
>	count = getdtablesize();

Mmph.  Note that under SunOS 4.1, getdtablesize() can return something
that's less than the number of open files.  File descriptors are now a
resource affected by getrlimit/setrlimit.  getdtablesize returns the
current soft limit on number of file descriptors.  To ensure that all
file descriptors get closed, you should use the hard limit instead.
--
Felix Lee	flee@cs.psu.edu