Here, is a code to find the number of files opened by a process.
rcu_read_lock();
task_lock (t);
fdt = files_fdtable(t->files);
fd_size = fdt? (fdt->max_fds) : 0 ;
for ( i=0 ; i<fd_size ; i++ )
{
if ( FD_ISSET ( i, fdt->open_fds) )
{
open_files++ ;
}
}
task_unlock (t) ;
rcu_read_unlock();
Thanks a lot for all your support.
Thanks and Regards,
Prasad.
On 3/5/07, Avishay Traeger <
atraeger@xxxxxxxxxxxxx
> wrote:
On Mon, 2007-03-05 at 13:47 +0100, Martin Mancuska wrote:
> Hi,
>
> maybe struct task_struct is that what you are looking for.
>
> martin
More specifically, in "struct task_struct", there is a field "struct
files_struct *files", which should have all of the information that
you're looking for.
Avishay
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ