nix::unistd

Function fexecve

source
pub fn fexecve<SA: AsRef<CStr>, SE: AsRef<CStr>>(
    fd: RawFd,
    args: &[SA],
    env: &[SE],
) -> Result<Infallible>
Expand description

Replace the current process image with a new one (see fexecve(2)).

The fexecve function allows for another process to be “called” which will replace the current process image. That is, this process becomes the new command that is run. On success, this function will not return. Instead, the new program will run until it exits.

This function is similar to execve, except that the program to be executed is referenced as a file descriptor instead of a path.