Enum pty::fork::Fork
[−]
[src]
pub enum Fork { Parent(pid_t, Master), Child(Slave), }
Variants
Parent(pid_t, Master)
Child(Slave)
Methods
impl Fork
[src]
fn new(path: &'static str) -> Result<Self>
The constructor function new
forks the program
and returns the current pid.
fn from_ptmx() -> Result<Self>
The constructor function from_ptmx
forks the program
and returns the current pid for a default PTMX's path.
fn wait(&self) -> Result<pid_t>
Waits until it's terminated.
fn is_parent(&self) -> Result<Master>
The function is_parent
returns the pid or parent
or none.
fn is_child(&self) -> Result<&Slave>
The function is_child
returns the pid or child
or none.