*BSD News Article 39084


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!uwm.edu!lll-winken.llnl.gov!noc.near.net!shore.shore.net!rwwa.com!witr
From: witr@rwwa.com (Robert Withrow)
Newsgroups: comp.os.386bsd.development
Subject: Re: How to find the filename of the binary executable...
Date: 8 Dec 1994 01:58:18 GMT
Organization: North Shore Access/Eco Software, Inc; (info@shore.net)
Lines: 20
Distribution: world
Message-ID: <3c5p7q$693@shore.shore.net>
References: <3c35e2$6sv@shore.shore.net> <3c3d5b$kor@dagny.galt.com>
Reply-To: witr@rwwa.com
NNTP-Posting-Host: rwwa.com

In article <3c3d5b$kor@dagny.galt.com>, alex@pc.cc.cmu.edu (alex wetmore) writes:
|> Robert Withrow (witr@rwwa.com) wrote:

|> > Can someone tell me how to find the filename of the *binary*
|> > file being executed (on, say, FreeBSD 1.1.5.1, or sunos.recent)?

|> The real question is: why do you need to know this?

To support dynlinking with shebang interpreted (#!/usr/bin/a.out)
programs.  I need access to the reloc info in the a.out.

> You can't do this.  What if you have the same executable with two names
> (through hard links).

Any path would do.  But inverting the directory tree to map an inode
on it so I can open() it seems--uhh--nasty.

-- 
 Robert Withrow, Tel: +1 617 598 4480, Fax: +1 617 598 4430
 R.W. Withrow Associates, 319 Lynnway, Lynn MA 01901 USA, Net: witr@rwwa.COM