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

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



Relevant Pages

  • Re: avoid write down the argument of linked DSO has symbol in another DSO file
    ... Now I want compile a.elf, ... A portable solution is to create a "stub" ... libb.so that exports "dummy" b_1, ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.apps)
  • MIPS Recursion Help
    ... we're stuck on how to do it using recursion. ... beq $t3, $zero, endLen ...
    (comp.programming)
  • Re: Undefined SysCall
    ... int 0x80;syscall with undefined code ... My x86_64 box only has syscall numbers up to 0x117, ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.system)
  • Re: Makefile question
    ... foo1 foo2: bar ... that is a portable solution. ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)