Re: How to check number of file handles used by process ???

Jarek <jarek@xxxxxxxxxxxxx> writes:

Is there any way to ask system about number of file handles
used by specific process.

From within the process, or from "outside" ?

Some syscall doing something like this:
lsof | grep <process_name> | wc -l

I don't believe any such syscall exist.

but more efficiently ?

If /proc is mounted and you are not looking for a portable solution,
this will probably be more efficient:

ls /proc/<pid>/fd | wc -l

In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.