*BSD News Article 39531


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!physiol.su.OZ.AU!john
From: john@physiol.su.OZ.AU (John Mackin)
Subject: Re: How to find the filename of the binary executable...
Message-ID: <1994Dec16.231001.15994@physiol.su.OZ.AU>
Organization: The Land of Summer's Twilight
References: <3c35e2$6sv@shore.shore.net> <VIXIE.94Dec8182530@gw.home.vix.com>
Date: Fri, 16 Dec 1994 23:10:01 GMT
Lines: 19

In article <VIXIE.94Dec8182530@gw.home.vix.com>,
	vixie@gw.home.vix.com (Paul A Vixie) writes:

> You have to grovel kmem like lsof or fstat does.

True.  And unfortunate.  I suggest that people thinking about /proc
and what it should do should really take a look at the design done
at Bell Labs Research, in Unix V8/9/10.  The V10 manual is published.
In that implementation, a PIOCOPENT ("open text") ioctl() on the /proc
file returns a read-only file descriptor on the text file the image came
from.  This seems to me to be the Right Way.  (Of course, this doesn't
100% address the original poster's question; he wanted a way to find
the pathname of the file.  On the other hand, 99.6%+ of the reasons
he's likely to want that are in order to open it, so...)

-- 
John Mackin <john@physiol.su.oz.au>
Knox's box is a 286.                 Fox in Socks does hacks and tricks
Knox's box is hard to fix.           To fix poor Knox's box for kicks.