[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-man
Subject:    Re: execve(2) man page: "absolute pathname" inconsistency
From:       Nora Platiel <nplatiel () gmx ! us>
Date:       2021-07-15 16:09:48
Message-ID: trinity-545d117b-65f0-4935-91cb-0ea54b07c375-1626365388128 () 3c-app-mailcom-bs05
[Download RAW message or body]

On 2021-07-03 21:58, Shawn Landden wrote:
> The absolute pathname is available in the Linux-specific auxiliary-vecto=
r
> feature. Here is a suggested patch:

I haven't made sense of the comment on the last added line, but the "visib=
le" part looks good to me.
Thanks,
NP

> diff --git a/man2/execve.2 b/man2/execve.2
> index c18ca5412..66a18af27 100644
> --- a/man2/execve.2
> +++ b/man2/execve.2
> @@ -344,20 +344,27 @@ will be invoked with the following arguments:
> .EE
> .in
> .PP
> where
> .I pathname
> -is the absolute pathname of the file specified as the first argument of
> +is the pathname of the file specified (may be relative to
> +.Br getcwd (3)
> +of the caller) as the first argument of
> .BR execve (),
> and
> .I arg...
> is the series of words pointed to by the
> .I argv
> argument of
> .BR execve (),
> starting at
> .IR argv[1] .
> +The absolute pathname of the script is also available in same auxiliary=
 vector the environment and argument variables are in, as
> +.BR AT_EXECFN .
> +See
> +.BR getauxval (3).
> +,\" I am not sure if this claim is as clear as it can be, but we are al=
ready wasting so much memory for these so.....it would be possible to copy=
 what is needed out of the environment, and then move the stack back into =
the massive environment vector Linux passes (and which has an almost unbou=
nded size).
> Note that there is no way to get the
> .IR argv[0]
> that was passed to the
> .BR execve ()
> call.
> --
> 2.30.2

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic