File descriptors open info

Doug Gwyn gwyn at smoke.brl.mil
Thu Feb 28 08:21:40 AEST 1991


In article <1991Feb26.213145.26540 at batcomputer.tn.cornell.edu> hurf at theory.tn.cornell.edu (Hurf Sheldon) writes:
>	is there a Unix system call (or some other method) for
>	finding out how many file descriptors a process has
>	open?

This is another one of the "why would you possibly care?" category
of questions.  There is no direct support for this, but something
of possible use would be to see what value dup(0) returns (then
close() the duplicate FD).  You will get the lowest available FD
number, which may be sufficient.  By elaborating on this idea you
could also count the FDs initially in use, but why would you want to?



More information about the Comp.unix.questions mailing list