Re: How do I ask: How many processes have this file open now?

Aaron M. Ucko (
23 May 1998 14:56:56 -0500

David Woodhouse <> writes:

> said:
> > Is there a system call for a user program that will, given a filename
> > (or fd), return the number of processes with that file open?
> Not AFAIK.
> fuser(1) does it by parsing all the cwd, fd, maps etc. entries in /proc

You might also want to take a look at lsof(1), which does everything
fuser does and more, all in user space (taking full advantage of
/proc; I don't think it has to resort to kmem on Linux.). Note that
Red Hat ships fuser but not lsof, so you may need to track it down.

Aaron M. Ucko <> (finger [Stark raving sane]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to