Re: How to report a death by signal ?

From: Laurent Bercot <>
Date: Wed, 18 Feb 2015 15:20:20 +0100

On 18/02/2015 14:55, Olivier Brunel wrote:
> But isn't the whole anything >= 128 will be reported as 128, and
> anything higher is actually 128+signum also a convention that both needs
> to agree upon?

  Sure, but most commands exit <128 so that's reliable enough, and it's
a lot easier to follow than the whole pipe shebang. It's much, much
simpler to exit with a given code than to write stuff to a pipe (what
do you do if it blocks ? what do you do if you're fd-constrained ?
what do you do if setting up the plumbing in the parent fails for
whatever reason ? etc. etc.)

> Noting that shells do not actually clamp the exit code to 128.

  Indeed, but it comes at the price of uncertainty - you get
accurate information if you're lucky, and complete misinformation
if you're not. It works for shells most of the time because you
don't manually nest shells - it's much riskier for execline.

> Just the difference shall probably be pointed out/documented.)


Received on Wed Feb 18 2015 - 14:20:20 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC