Registry / networking / signal-hook

signal-hook

JSON →
library0.4.4rscratesunverified

Unix signal handling library for Rust.

# Cargo.toml [dependencies] signal-hook = "0.4.4"
INSTALL
IMPORT
SIG · SIGNAL-HOOK
S
signal-hook
networkingrustv0.4.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Signals
use signal_hook::iterator::Signals;

Listens for SIGTERM and prints each received signal.

use signal_hook::iterator::Signals; use std::error::Error; fn main() -> Result<(), Box<dyn Error>> { let mut signals = Signals::new(&[signal_hook::consts::SIGTERM])?; for sig in signals.forever() { println!("Received signal {:?}", sig); } Ok(()) }
Debug
Known issues
breakingNot available on Windows; Unix-only.
fix
Use conditional compilation or alternative crate for cross-platform support.
affects: >=0.1.0
Upgrade
Version history
0.4.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
signal-hook — cargo add signal-hook · libregistry