github.com/vorner/signal-hook ↗

Rust library allowing to register multiple handlers for the same signal

An animated visualization of vorner/signal-hook's Git history from June 2018 to December 2020, built by 10 contributors. The codebase reached 490 lines, mostly Rust. The video runs 1 minute 6 seconds.

Render your own repo

Turn any GitHub repository into a video like this — free sample in seconds.

Visualize your own →

Open this visualization on its own page →

Language

Rust

Contributors

10

Lines of Code

490

From

2018-06-13

To

2020-12-26

Advertisement

About vorner/signal-hook

Signal-hook is a Rust library that provides safe and correct Unix signal handling by maintaining a global registry where applications can register multiple handlers for the same signal. Unix signals are notoriously difficult to handle correctly because they are a global resource shared across all libraries in a process, can interrupt execution from any thread at unpredictable times, and are constrained by POSIX restrictions on which functions are safe to call within a signal handler context.

The library solves these problems by allowing developers to register and later remove individual signal actions without disturbing handlers from other libraries or losing the ability to chain with previously installed handlers. It abstracts away the complexity of async-signal-safety by providing a global action registry that isolates signal handling logic from the unsafe constraints of raw signal handlers, making common signal handling patterns accessible from safe Rust code.

The library is dual-licensed under Apache 2.0 and MIT licenses, comes with comprehensive documentation, and includes support for common use cases through built-in helper actions beyond basic arbitrary action registration.

Advertisement

Share this video