Xref: utzoo comp.lang.c:12575 comp.unix.questions:9197 Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!mailrus!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: how many file descriptors? Message-ID: <757@proxftl.UUCP> Date: 14 Sep 88 02:11:12 GMT References: <24889@teknowledge-vaxc.ARPA> Reply-To: bill@proxftl.UUCP (T. William Wells) Organization: Proximity Technology, Ft. Lauderdale Lines: 15 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <24889@teknowledge-vaxc.ARPA> mkhaw@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