[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bizzare Problem...
- To: misc@openbsd.org
- Subject: Re: Bizzare Problem...
- From: Philipp Buehler <pb@openbsd.de>
- Date: Mon, 2 Jun 2003 15:41:31 +0200
- Mail-Followup-To: misc@openbsd.org
- References: <200305310119.h4V1Jb9Y001939@escii.org> <001801c32715$70ac4380$0202a8c0@bci.waw.pl>
On 31/05/2003, zbyszekk <zbyszek@bci.waw.pl> wrote To misc@openbsd.org:
> > How can i find out the FILENAMES that a certain pid has open.
> > Speed is an issue , i've allready tryed ncheck_ffs with inodes
> > and its way to slow.
> >
> man fstat
First read again. fstat doesnt report a name, it reports the inode
*number*.
The point is looking up the path/filename for this inode *fast*, got it? :)
lsof can do so:
# lsof -p `cat /var/run/syslog.pid`
Please note that lsof uses the namei cache of the kernel here, which speeds
up the lookup. (see -C for a different output)
Of course this has "problems", since it's not guaranteed the file/inode
would be in the namei cache.. *shrug* after all, it's not an easy task :)
ciao
--
Philipp Buehler, aka fips | sysfive.com GmbH | BOfH | NUCH | <double-p>
#1: Break the clue barrier!
#2: Already had buzzword confuseritis ?