All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nora Platiel <nplatiel@gmx.us>
To: Shawn Landden <shawn@git.icu>,
	mtk.manpages@gmail.com, alx.manpages@gmail.com
Cc: linux-man@vger.kernel.org
Subject: Re: execve(2) man page: "absolute pathname" inconsistency
Date: Thu, 15 Jul 2021 18:09:48 +0200	[thread overview]
Message-ID: <trinity-545d117b-65f0-4935-91cb-0ea54b07c375-1626365388128@3c-app-mailcom-bs05> (raw)
In-Reply-To: <1778431625342219@mail.yandex.com>

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

I haven't made sense of the comment on the last added line, but the "visible" 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 already 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 unbounded size).
> Note that there is no way to get the
> .IR argv[0]
> that was passed to the
> .BR execve ()
> call.
> --
> 2.30.2


  parent reply	other threads:[~2021-07-15 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 20:42 execve(2) man page: "absolute pathname" inconsistency Nora Platiel
2021-06-25 10:33 ` AW: " Walter Harms
2021-06-26 23:09   ` Nora Platiel
2021-07-03 18:56 ` Alejandro Colomar (man-pages)
     [not found]   ` <1778431625342219@mail.yandex.com>
2021-07-15 16:09     ` Nora Platiel [this message]
2021-07-17 12:28       ` Alejandro Colomar (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-545d117b-65f0-4935-91cb-0ea54b07c375-1626365388128@3c-app-mailcom-bs05 \
    --to=nplatiel@gmx.us \
    --cc=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=shawn@git.icu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.