Path: utzoo!attcan!uunet!virtech!cpcahil
From: cpcahil@virtech.UUCP (Conor P. Cahill)
Newsgroups: comp.lang.c
Subject: Re: Contents of argv[0]
Keywords: start-up code, argv specifications
Message-ID: <1022@virtech.UUCP>
Date: 16 Aug 89 02:25:24 GMT
References: <9002@attctc.Dallas.TX.US> <1017@virtech.UUCP> <10094@csli.Stanford.EDU>
Organization: Virtual Technologies Inc
Lines: 20

In article <10094@csli.Stanford.EDU>, gandalf@csli.Stanford.EDU (Juergen Wagner) writes:
> The first argument to aqn execl is the path name of the program to be
> executed. The arguments starting with the second are what the program will
> get as an argv[]. This effectively means that in general, argv[0] cannot
> be treated as a reliable source for the path name! [RTFM]
> 
I did RTFM many times for many flavors of unix for many of the past years.
What I ment to say was "argv[0] will NORMALLY contain the path".  The example
was not meant to say that argv[0] would have the first argument of the execl().
The example "the first argument to an execl()" was an example for the path 
used to execute the program..

> You have to distinguish between features provided by UNIX (in general) and
> some UNIX (in particular). The execve system call makes it quite clear that
> there doesn't have to be any relation whatsoever between the pathname of the
> program being invoked and the argument vector argv[]. Check the man page for
> execve().

My intent was to say that argv[0] will normally contain a path, but to be
portable the code should handle anything (hence the sample for MSC).