2000-11-26 20:01:27

by Tigran Aivazian

[permalink] [raw]
Subject: number of open fds?

Hi,

The kernel/exit.c:put_files_struct() and close_files() are very nice as
they show how to walk open fds (and close them) and how to free the fd
array/sets in one go. But is there a _very fast_ way of getting the number
of fds currently open (without having to walk the sets and test the bits)?

Regards,
Tigran


2000-11-27 10:50:29

by Tigran Aivazian

[permalink] [raw]
Subject: Re: number of open fds?

never mind this question:

a) I found count_open_files()

b) for what I needed it for, close_files() is easily enhanceable to return
this number as well, without having to walk the sets twice

Regards,
Tigran

On Sun, 26 Nov 2000, Tigran Aivazian wrote:

> Hi,
>
> The kernel/exit.c:put_files_struct() and close_files() are very nice as
> they show how to walk open fds (and close them) and how to free the fd
> array/sets in one go. But is there a _very fast_ way of getting the number
> of fds currently open (without having to walk the sets and test the bits)?
>
> Regards,
> Tigran
>
>