Skip to main content

on_signal

Function on_signal 

Source
fn on_signal(sig: c_int, h: unsafe extern "C" fn(c_int))
Expand description

Install h for sig, without SA_RESTART.

The flag is omitted because it buys nothing here, not because poll_in needs it: poll(2) is on signal(7)’s list of calls the kernel never restarts whatever the flag says, and the read(2) in the same loop runs under VMIN 0 / VTIME 0, so it returns immediately and is never sitting in a restartable wait either. What makes a resize wake poll_in is installing a handler at all — SIGWINCH’s default disposition is to discard the signal, and a discarded signal interrupts nothing.