On Apr 28, 2007, at 1:10 AM, subbukk wrote:
The specific part is: The value in argv[0] should point to a filename that is associated with the process being started by one of the exec functions
You haven't understood the standard.
The 'should point to' in the above sentence does not say 'shall point to'. The former is absolutely *not* a requirement for compliance with the standard; the latter absolutely *is*.
Look further down the same page at their execve() example, which clearly contradicts what you claim.
Regardless, it's the caller that sets up argv[] for the child in execv*(). Bash empirically (read the source code) preserves precisely the command name typed by the user; it makes no attempt to rewrite argv[0] to include dir information inferred from searching PATH. The experiment is a trivial (3-line) program and neither BSD nor Linux nor Darwin behave any differently than implied by the 'ls' example in the standard. Dir information gathered from searching PATH is not passed to the child during the execve().
Cheers, Ian