Date: Sat, 9 Mar 1996 07:31:43 -0700 From: Sean Kelly <kelly@fsl.noaa.gov> To: gavin@linux1.dlsu.edu.ph Cc: questions@freebsd.org Subject: Re: Weird problem. Message-ID: <9603091431.AA26599@emu.fsl.noaa.gov> In-Reply-To: <Pine.LNX.3.91.960309155828.24018C-100000@ccslinux.dlsu.edu.ph> (message from Gavin Chan Lim on Sat, 9 Mar 1996 16:01:02 %2B0800 (GMT%2B0800))
next in thread | previous in thread | raw e-mail | index | archive | help
(Redirected to questions.)
>>>>> "Gavin" == Gavin Chan Lim <gavin@linux1.dlsu.edu.ph> writes:
Gavin> Given the pid of a process, is there any way of finding the
Gavin> executable file (including complete path) of this process?
If fstat were working correctly, you could just run
fstat -p <pid>
then look for the line which contains the word ``text'', then use find
on the listed mount point to find the listed inode number.
But fstat seems broken.
The man page claims that you'll get a list of the open file table for
the process identified by number, plus special entries `wd' for the
current working directory, `tr' for trace file, etc., plus `text' for
the open executable file, which is what you want. But with 2.1R I
can't get any `text' entries to appear to matter what I try.
--
Sean Kelly
NOAA Forecast Systems Laboratory kelly@fsl.noaa.gov
Boulder Colorado USA http://www-sdd.fsl.noaa.gov/~kelly/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9603091431.AA26599>
