PopenExt

Trait PopenExt 

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

Unix-specific extension methods for Popen

Required Methods§

Source

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

Send the specified signal to the child process.

The signal numbers are best obtained from the libc crate.

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 setpgid set to true, 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§