[comp.unix.questions] how to get process path?

mike@delphi.bsd.uchicago.edu (Mike Rimkus) (08/03/90)

I'm writing a program that needs to run another program in the same directory,
whatever directory that may be.  Thus the first program needs to know for
certain the path by which it was executed.

argv[0] cannot be relied upon for this information: a person can set arg0 in
execl() to whatever he wants.  How do I find the path?


If responding to the newsgroup, please Cc: to me, as I don't read the
newsgroup regularly.

gwyn@smoke.BRL.MIL (Doug Gwyn) (08/05/90)

In article <1990Aug2.185051.9324@midway.uchicago.edu> mike@delphi.bsd.uchicago.edu (Mike Rimkus) writes:
>I'm writing a program that needs to run another program in the same directory,
>whatever directory that may be.  Thus the first program needs to know for
>certain the path by which it was executed.

You better tell it when you execute it, then.