From owner-freebsd-questions Sat Mar 9 06:31:46 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA27604 for questions-outgoing; Sat, 9 Mar 1996 06:31:46 -0800 (PST) Received: from fslg8.fsl.noaa.gov (fslg8.fsl.noaa.gov [137.75.131.171]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA27599 for ; Sat, 9 Mar 1996 06:31:44 -0800 (PST) Received: by fslg8.fsl.noaa.gov (5.57/Ultrix3.0-C) id AA26294; Sat, 9 Mar 96 14:31:43 GMT Received: by emu.fsl.noaa.gov (1.38.193.4/SMI-4.1 (1.38.193.4)) id AA26599; Sat, 9 Mar 1996 07:31:43 -0700 Date: Sat, 9 Mar 1996 07:31:43 -0700 Message-Id: <9603091431.AA26599@emu.fsl.noaa.gov> From: Sean Kelly To: gavin@linux1.dlsu.edu.ph Cc: questions@freebsd.org In-Reply-To: (message from Gavin Chan Lim on Sat, 9 Mar 1996 16:01:02 +0800 (GMT+0800)) Subject: Re: Weird problem. Sender: owner-questions@freebsd.org X-Loop: owner-questions@FreeBSD.ORG Precedence: bulk (Redirected to questions.) >>>>> "Gavin" == Gavin Chan Lim 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 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/