lkml.org 
[lkml]   [1998]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: How do I ask: How many processes have this file open now?
From
Date
David Woodhouse <Dave@imladris.demon.co.uk> writes:

> russ@taylor.digex.net 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 <amu@mit.edu> (finger amu@monk.mit.edu) [Stark raving sane]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:2.010 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site