From: Shawn Landden <shawn@xxxxxxx> The absolute pathname is available in the Linux-specific auxiliary-vector feature. Reported-by: Nora Platiel <nplatiel@xxxxxx> Signed-off-by: Shawn Landden <shawn@xxxxxxx> Reviewed-by: Nora Platiel <nplatiel@xxxxxx> Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx> --- man2/execve.2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/man2/execve.2 b/man2/execve.2 index c18ca5412..7fe12ab42 100644 --- a/man2/execve.2 +++ b/man2/execve.2 @@ -346,7 +346,9 @@ will be invoked with the following arguments: .PP where .I pathname -is the absolute pathname of the file specified as the first argument of +is the absolute 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... @@ -356,6 +358,11 @@ argument of .BR execve (), starting at .IR argv[1] . +The absolute pathname of the script is also available +in the same auxiliary vector the environment and argument variables are in, as +.BR AT_EXECFN . +See +.BR getauxval (3). Note that there is no way to get the .IR argv[0] that was passed to the -- 2.32.0