#child-process #process #signal #linux-process #unix #linux #unix-command

signal-child

A little library to easily signal other process with no dependencies

7 stable releases

1.0.6 Aug 31, 2024
1.0.5 Feb 3, 2022
1.0.3 Jun 3, 2021

#158 in Unix APIs

Download history 25/week @ 2024-11-21 61/week @ 2024-11-28 66/week @ 2024-12-05 65/week @ 2024-12-12 13/week @ 2024-12-19 6/week @ 2024-12-26 168/week @ 2025-01-02 306/week @ 2025-01-09 239/week @ 2025-01-16 227/week @ 2025-01-23 183/week @ 2025-01-30 208/week @ 2025-02-06 269/week @ 2025-02-13 253/week @ 2025-02-20 200/week @ 2025-02-27 439/week @ 2025-03-06

1,175 downloads per month
Used in prism-rs

MIT license

18KB
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