[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reflection and /proc
Hi,
Dominik Kubla:
> On Mon, Mar 01, 1999 at 09:51:40AM +0100, Davide Bolcioni wrote:
> > I harbor the impression that the Linux/Unix system call API provides an
> > adequate "set" interface but not the corresponding "get" interface: for
> > example, how do I get the number of files currently open in my process ?
> > One way could be to loop from 0 to getdtablesize() - 1 and
> > fcntl(F_GETFL), counting successes. Well, not much of an example.
>
> Right, because the correct answer to your question is getrusage(2).
>
getrusage() doesn't tell me how many files are open, nor does it tell me
the maximum number of files I ever had open at the same time. Both might be
good to know sometimes, but OTOH you can count them for yourself quite
easily...
--
Matthias Urlichs | noris network GmbH | smurf@noris.de | ICQ: 20193661
The quote was selected randomly. Really. | http://www.noris.de/~smurf/
--
Christians do it with grace
-
Linux-future: thinking about the future of the Linux kernel
Archive: http://humbolt.nl.linux.org/lists/
Wish list: http://users.ox.ac.uk/~mert0236/linux-future.html