Function nc::setsid

source ·
pub unsafe fn setsid() -> Result<pid_t, Errno>
Expand description

Create a new session if the calling process is not a process group leader.

§Example

let ret = unsafe { nc::setsid() };
assert!(ret.is_ok());
let pid = unsafe { nc::getpid() };
assert_eq!(ret, Ok(pid));