#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

#367 in Unix APIs

Download history 1198/week @ 2023-10-14 677/week @ 2023-10-21 1629/week @ 2023-10-28 287/week @ 2023-11-04 127/week @ 2023-11-11 135/week @ 2023-11-18 127/week @ 2023-11-25 121/week @ 2023-12-02 174/week @ 2023-12-09 408/week @ 2023-12-16 63/week @ 2023-12-23 230/week @ 2023-12-30 346/week @ 2024-01-06 199/week @ 2024-01-13 149/week @ 2024-01-20 184/week @ 2024-01-27

995 downloads per month
Used in prism-rs

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