lkml.org 
[lkml]   [1998]   [May]   [27]   [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?
Date
From
> 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.
>
> --
>
lsof uses /proc on late 2.1, kmem on everything else.

I really think its a useful program...
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof.tar.gz


--
marty
leisner@sdsp.mc.xerox.com
The Feynman problem solving Algorithm
1) Write down the problem
2) Think real hard
3) Write down the answer
Murray Gell-mann in the NY Times





-
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:0.062 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site