Skip to main content

ProcessExt

Trait ProcessExt 

Source
pub trait ProcessExt {
    // Required methods
    fn send_signal(&self, signal: i32) -> Result<()>;
    fn send_signal_group(&self, signal: i32) -> Result<()>;
}
Expand description

Unix-specific extension methods for Process.

Required Methods§

Source

fn send_signal(&self, signal: i32) -> Result<()>

Send the specified signal to the child process.

If the child process is known to have finished (due to e.g. a previous call to wait or poll), this will do nothing and return Ok.

Source

fn send_signal_group(&self, signal: i32) -> Result<()>

Send the specified signal to the child’s process group.

This is useful for terminating a tree of processes spawned by the child. For this to work correctly, the child should be started with ExecExt::setpgid set, which places the child in a new process group with PGID equal to its PID.

If the child process is known to have finished, this will do nothing and return Ok.

Implementors§