Getting path to executed program file
Jonathan I. Kamens
jik at athena.mit.edu
Thu Jul 26 01:52:13 AEST 1990
In article <10004 at pt.cs.cmu.edu>, tgl at zog.cs.cmu.edu (Tom Lane) writes:
|> [lists the assumptions that the code I posted makes]
|>
|> In practice these problems probably don't materialize often, so Greg's
|> code probably gets the right answer 99% of the time. Still, I would
|> like to know if it is possible to avoid these assumptions.
As I said in my original message, the code I posted "says just about
all there is to say about this question." In other words, no, there is
no portable way to avaoid these assumptions, and indeed most systems
don't even have a non-portable way to avoid them, unless you consider
making your executable setuid root or setgid kmem and grovelling through
kernel memory to figure out how the process was started to be a
reasonable way to do things :-).
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik at Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8495 Home: 617-782-0710
More information about the Comp.unix.wizards
mailing list