EXECVEX(2) System Calls EXECVEX(2)

NAME


execvex - execute a file with flags

SYNOPSIS


#include <execx.h>

int
execvex(uintptr_t path, char *const argv[], char *const envp[],
int flags);

DESCRIPTION


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
The path argument is the number of an open file
descriptor in the current process.

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);

RETURN VALUES


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.

ERRORS


execvex will fail if:

EINVAL The flags argument is invalid.

may also fail for any of the reasons listed in exec(2).

INTERFACE STABILITY


Committed

MT-LEVEL
Async-Signal-Safe

SEE ALSO


exec(2)

illumos January 12, 2024 illumos

tribblix@gmail.com :: GitHub :: Privacy