From 3c2423ee69788a01e3db65ec979e3f61bd4d2894 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 13 Jun 2019 21:50:56 +0200 Subject: [PATCH] exec.3: Minor tweaks to Matthew Kenigsberg's patch Signed-off-by: Michael Kerrisk --- man3/exec.3 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/man3/exec.3 b/man3/exec.3 index a0d582bed6..842e12b455 100644 --- a/man3/exec.3 +++ b/man3/exec.3 @@ -80,7 +80,8 @@ for further details about the replacement of the current process image.) The initial argument for these functions is the name of a file that is to be executed. .PP -The functions can be grouped based on the letters following exec. +The functions can be grouped based on the letters following the "exec" prefix. +.\" .SS l - execl(), execlp(), execle() .PP The @@ -99,6 +100,10 @@ The list of arguments be terminated by a null pointer, and, since these are variadic functions, this pointer must be cast .IR "(char\ *) NULL" . +.PP +By contrast with the 'l' functions, the 'v' functions (below) specify the +command-line arguments of the executed program as a vector. +.\" .SS v - execv(), execvp(), execvpe() .PP The @@ -121,7 +126,8 @@ argument is an array of pointers to null-terminated strings and be terminated by a null pointer. All other .BR exec () -functions take the environment for the new process +functions (which do not include 'e' in the suffix) +take the environment for the new process image from the external variable .I environ in the calling process. @@ -166,6 +172,12 @@ these functions will execute the shell .RI ( /bin/sh ) with the path of the file as its first argument. (If this attempt fails, no further searching is done.) +.PP +All other +.BR exec () +functions (which do not include 'p' in the suffix) +take as their first argument a (relative or absolute) pathname +that identifies the program to be executed. .SH RETURN VALUE The .BR exec () -- 2.39.2