Expand description
Library for creating a new process detached from the controlling terminal (daemon).
Example:
use fork::{daemon, Fork};
use std::process::Command;
if let Ok(Fork::Child) = daemon(false, false) {
Command::new("sleep")
.arg("3")
.output()
.expect("failed to execute process");
}
Enums§
- Fork
- Fork result
Functions§
- chdir
- Change dir to
/
see chdir(2) - close_
fd - Close file descriptors stdin,stdout,stderr
- daemon
- The daemon function is for programs wishing to detach themselves from the controlling terminal and run in the background as system daemons.
- fork
- Create a new child process see fork(2)
- getpgrp
- The process group of the current process see getgrp(2)
- setsid
- Create session and set process group ID see setsid(2)
- waitpid
- Wait for process to change status see wait(2)