Before both 0 and sys_nsig would be successfully returned by parse_signal()
although being invalid signal numbers.
PR: Alexandre Perrin <alex@kaworu.ch>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3990
timeout previously collected only one child status with wait(2). If this
was one of the grandchildren timeout would return to sigsuspend and wait
until the timeout expired. Instead, loop for all children.
PR: kern/197608
Reviewed by: bapt, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
When not using the --foreground option timeout(1) is supported to signal all
command children hierarchy, timeout(1) now acquire the reaper to ensure this
really happens and no children process can escaper from timeout(1) control
According to the coreutils regression testsuite for timeout(1)
It is expect to exit with a status being:
125 in case an invalid duration or signal is passed in arguments
126 in case an invalid command is passed in arguments
127 in case the command passed in arguments does not exists.
While here document this behaviour in the man page
it fully passes the GNU timeout regression tests, it is written in a mostly
portable way (only signal parsing is relying on non portable structures)
Phabric: D377