timeout(1), SIGCHLD race closed, stopped command bounded
hn-timeout is timeout(1) of the base system, usr.bin/timeout/timeout.c
revision 1.26, with the signals it waits for blocked before it forks the
command instead of after. In the base utility, a command that exits
between the fork and that block has its SIGCHLD handled outside
sigsuspend(2): timeout then sleeps until the duration runs out, and a
probe that took a millisecond is reported after its whole deadline.
Measured on OpenBSD 7.9: 3 runs of "timeout 3 /usr/bin/true" out of
4000 waited the 3 seconds, none out of 8000 with this change.

A stopped command stays bounded: hn-timeout does not wait for a stopped
child, and it sends SIGCONT after the signal of the timeout, so that the
signal takes effect. The base utility waits for the child whose stop
raised SIGCHLD, the signals blocked, and never returns.

Options, duration format and exit statuses are those of timeout(1).
The fork goes away once the base system carries the fix.

Maintainer: Jean-Gerard Pailloncy <j-g@pailloncy.com>
