Subject: Re: bug#34488: Add sort --limit, or document workarounds for sort|head error messages

From: Paul Eggert <[email-masked]>
Date: Sun, 24 Feb 2019 10:33:47 -0800

Thanks for doing all that. Although Pádraig is not enthusiastic about a shortcut 
like -p, I'm a bit warmer to it, as it's an important special case to fix a wart 
in POSIX. No big deal either way.

The documentation should mention that SIGCHLD is special, in that 
--ignore-signal=CHLD might have no effect (POSIX says it's unspecified).

The documentation should say what happens if mutually-contradictory options are 
specified, e.g., '--default-signal=INT --ignore-signal=INT'. Presumably they are 
processed left-to-right, as is traditional for 'env' with contradictory operands.

There should be options --block-signal[=SIG], --unblock-signal[=SIG], and 
--setmask-signal[=SIG] that affect the signal mask, which is also inherited by 
the child. These can be implemented via pthread_sigmask.

The documentation should echo this suggestion in 
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html>: "many 
existing applications wrongly assume that they start with certain signals set to 
the default action and/or unblocked.... Therefore, it is best not to block or 
ignore signals across execs without explicit reason to do so, and especially not 
to block signals across execs of arbitrary (not closely cooperating) programs."