On Wed, Mar 05, 2003 at 06:46:55PM -0500, Ferguson, Neale wrote:
> How do I, within a program, get the full pathname of the program I'm
> executing? argv[0] will have the command name but not necessarily the full
> pathname.

You can also look at /proc/<pid>/exe or if argv[] only has partial
information you can search PATH and match possible applications against
device/inode information from /proc/<pid>/maps.

greetings,

Florian La Roche

Reply via email to