Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 1998 06:53:04 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        jdp@polstra.com (John Polstra)
Cc:        hasty@rah.star-gate.com, hackers@FreeBSD.ORG
Subject:   Re: dladdr hax
Message-ID:  <199801180653.XAA07823@usr04.primenet.com>
In-Reply-To: <199801172050.MAA07904@austin.polstra.com> from "John Polstra" at Jan 17, 98 12:50:21 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> If you will come up with (or suggest) a solution to finding the
> pathname of the main program, then I will add that into my version and
> commit it.  And puhleeeze, don't suggest the hack of searching each of
> the directories in $PATH for argv[0].

To be bug-compatible with Solaris, you should simply return argv[0]
*witjout* trying to find it in your PATH.  Yes, this is a kludge.

My initial reaction was to return the name of the file from the
procfs; this fails to satify the java use of the path to determine
a location relative to the java binary (java is why dladdr is
needed, at least initially.  Yes, you can do some neat stuff with
it on top of that, but that's not the point).

The Solaris java kldge is to assume the binary is run via absolute
path from a shell script run by a shell that passes an unmodified
argv[ 0] (ie: doesn't rewrite it or truncate to the terminal component).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801180653.XAA07823>