Function nix::unistd::execve [] [src]

pub fn execve(path: &CString, args: &[CString], env: &[CString]) -> Result<Void>

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

The execve system call 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.

If an error occurs, this function will return with an indication of the cause of failure. See execve(2)#errors for a list of potential problems that maight cause execv to fail.

::nix::unistd::execv and ::nix::unistd::execve take as arguments a slice of ::std::ffi::CStrings for args and env (for execve). Each element in the args list is an argument to the new process. Each element in the env list should be a string in the form "key=value".