Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.wizards Subject: Re: Getting path to executed program file Message-ID: <1990Jul25.155213.9844@athena.mit.edu> Date: 25 Jul 90 15:52:13 GMT References: <9995@pt.cs.cmu.edu> <1990Jul25.064956.22757@mintaka.lcs.mit.edu> <10004@pt.cs.cmu.edu> Sender: daemon@athena.mit.edu (Mr Background) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 19 In article <10004@pt.cs.cmu.edu>, tgl@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710