devela::_dep::nc::call

Function fork

pub unsafe fn fork() -> Result<i32, i32> 
Available on crate feature dep_nc only.
Expand description

Create a child process.

§Examples

let pid = unsafe { nc::fork() };
assert!(pid.is_ok());
let pid = pid.unwrap();
if pid == 0 {
  println!("child process");
} else {
  println!("parent process");
}