[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bizzare Problem...



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 ?