#linux #unix #signal #process

archived signal-child

A little library to easily signal other process with no dependencies

6 stable releases

1.0.5 Feb 3, 2022
1.0.3 Jun 3, 2021

#235 in Unix APIs

Download history 9/week @ 2022-01-23 42/week @ 2022-01-30 18/week @ 2022-02-06 5/week @ 2022-02-13 43/week @ 2022-02-20 4/week @ 2022-02-27 2/week @ 2022-03-06 19/week @ 2022-03-13 21/week @ 2022-03-20 23/week @ 2022-03-27 19/week @ 2022-04-03 5/week @ 2022-04-10 1/week @ 2022-04-17 46/week @ 2022-04-24 45/week @ 2022-05-01 92/week @ 2022-05-08

184 downloads per month

MIT license

17KB
413 lines

signal-child

crates.io docs.rs Minimum Supported Rust Version

A little library to easily signal other process with no dependencies on Unix-like systems.

Example

use std::process::Command;
use signal_child::Signalable;

// Spawn child process
let mut child = Command::new("sleep")
    .arg("1000")
    .spawn()
    .expect("Error spawning sleep process");
// Sing SIGINT to the child.
child.interrupt().expect("Error interrupting child");

Contributing

Please send any and all patches, bugs, and questions to my public inbox ~zethra/public-inbox@lists.sr.ht


lib.rs:

A little library to easily signal other process with no dependencies.

This is essentially a wrapper around kill(3) on Unix-like systems. As such this crate only supports Unix-like systems.

Example

use std::process::Command;
use signal_child::Signalable;

// Spawn child process
let mut child = Command::new("sleep")
    .arg("1000")
    .spawn()
    .expect("Error spawning sleep process");
// Send SIGINT to the child.
child.interrupt().expect("Error interrupting child");
child.wait().ok();

No runtime deps