Table of Contents
The family of functions replaces the current process image
with a new process image. The functions described in this manual page are
front-ends for the function (See the manual page for for detailed information
about the replacement of the current process.) The initial argument for
these functions is the pathname of a file which is to be executed. The
and subsequent ellipses in the and functions can be thought of as
..., Together they describe a list of one or more pointers to null-terminated
strings that represent the argument list available to the executed program.
The first argument, by convention, should point to the file name associated
with the file being executed. The list of arguments be terminated by a
pointer. The and functions provide an array of pointers to null-terminated
strings that represent the argument list available to the new program. The
first argument, by convention, should point to the file name associated
with the file begin executed. The array of pointers be terminated by a
pointer. The and functions also specify the environment of the executed
process by following the pointer that terminates the list of arguments
in the parameter list or the pointer to the argv array with an additional
parameter. This additional parameter is an array of pointers to null-terminated
strings and be terminated by a pointer. The other functions take the environment
for the new process image from the external variable in the current process.
Some of these functions have special semantics. The functions and will
duplicate the actions of the shell in searching for an executable file
if the specified file name does not contain a slash character. The search
path is the path specified in the environment by variable. If this variable
isn’t specified, the default path is used. In addition, certain errors are
treated specially. If permission is denied for a file (the attempted returned
these functions will continue searching the rest of the search path. If
no other file is found, however, they will return with the global variable
set to If the header of a file isn’t recognized (the attempted returned
these functions will execute the shell with the path of the file as its
first argument. (If this attempt fails, no further searching is done.) If
the file is currently busy (the attempted returned these functions will
sleep for several seconds, periodically re-attempting to execute the file.
The function executes a file with the program tracing facilities enabled
(see
If any of the functions returns, an error will have
occurred. The return value is -1, and the global variable will be set to
indicate the error.
The shell.
and may fail and set for
any of the errors specified for the library functions and and may
fail and set for any of the errors specified for the library function
Historically, the default path for the and
functions was This was changed to place the current directory last to
enhance system security. The behavior of and when errors occur while
attempting to execute the file is historic practice, but has not traditionally
been documented and is not specified by the standard. Traditionally, the
functions and ignored all errors except for the ones described above
and and upon which they returned. They now return if any error other than
the ones described above occurs.
and conform to
Table of Contents