EXECVEX(2) | System Calls | EXECVEX(2) |
execvex
— execute
a file with flags
#include
<execx.h>
int
execvex
(uintptr_t path,
char *const argv[], char *const
envp[], int flags);
execvex
is an extended version of
execve(2). Like other functions in the
exec(2) family,
execvex
replaces the current process image with a
new one indicated by the path argument.
The following values may be bitwise-ORed together in the flags argument to modify the behavior of the function:
EXEC_DESCRIPTOR
If EXEC_DESCRIPTOR
is not set in
flags, the path argument must be
set to a pointer to a pathname of a file which is executable by the current
process.
The exec(2) family of
functions are implemented in terms of execvex
. A
call to
execve(path, argv, envp)
is equivalent to
execvex((uintptr_t)path, argv, envp,
0)
and a call to
fexecve(filedes, argv,
envp)
is equivalent to
execvex((uintptr_t)filedes, argv,
envp, EXEC_DESCRIPTOR)
If execvex
returns to the calling process
image, an error has occurred; the return value is -1 and
errno is set to indicate the error.
execvex
will fail if:
EINVAL
may also fail for any of the reasons listed
in
exec(2).
January 12, 2024 | OmniOS |