devela::_dep::nc

Function execve

pub unsafe fn execve<P>(filename: P, argv: &[P], env: &[P]) -> Result<(), i32> 
where P: AsRef<Path>,
Available on crate feature dep_nc only.
Expand description

Execute a new program.

§Examples

let args = ["ls", "-l", "-a"];
let env = ["DISPLAY=:0"];
let ret = unsafe { nc::execve("/bin/ls", &args, &env) };
assert!(ret.is_ok());