Skip to main content

signal_from_exit_status

Function signal_from_exit_status 

Source
pub const fn signal_from_exit_status(status: i32) -> Option<i32>
Expand description

Recover the signal from a 128 + signo status, or None if it is not in the band.

⚠️ THE PARENT NEEDS THIS BECAUSE THE CHILD CANNOT SEND A REAL SIGNAL STATUS. Without it the classifier’s catch-all treats every non-refusal child exit as unaccounted and reports 125, so making the SIGINT path exit 130 on its own would have moved Ctrl-C from “hermit refused” to “hermit broke” — worse than what it replaced. Emitting the code and recognising the code are one change.

⚠️ IT IS DELIBERATELY A BAND AND NOT A SINGLE VALUE. sigint_instakill is not the only producer: on_container_init_stop_signal already exits 128 + signo for SIGTERM, SIGINT and SIGHUP (143, 130, 129), so keying on 130 alone would leave the other two misreported as internal failures.

The upper bound is SIGRTMAX; above it, a status is a guest’s own number and not a signal this can honestly name.