how many file descriptors?

T. William Wells bill at proxftl.UUCP
Wed Sep 14 12:11:12 AEST 1988


In article <24889 at teknowledge-vaxc.ARPA> mkhaw at teknowledge-vaxc.UUCP (Mike Khaw) writes:
: How can a SunView program tell how many file descriptors it has in use,
: especially if it opens&closes /dev/fb several times and creates&destroys
: frames several times while it's running?

Here is one way:

Call getdtablesize to determine the number of fd's that are in
the per-process file table.  Then call fcntl for each fd to
retrieve some property of each file.  Each fcntl failure
represents an available fd.

---
Bill
novavax!proxftl!bill



More information about the Comp.unix.questions mailing list