[Toybox] The "kill" command.
Rob Landley
rob at landley.net
Thu Feb 23 07:32:05 PST 2012
On 02/22/2012 09:27 AM, Eduardo Tongson wrote:
>> (It _seems_ that what -l is doing is in ubuntu's implementation is
>> converting a signal number to name or vice versa. How you get that from
>> the above standard snippet, I can't even _guess_...)
>>
>> Rob
>
> That is if you take the exit status of wait(). See the manpage of wait.
>
> $ sleep 500&
> [1] 26975
> $ kill -9 26975
> $ wait 26975
> $ kill -l $?
> KILL
Ah, the return code of the shell "wait" command is the return code of
wait() and needs to be fed through WEXITSTATUS() to mask off the high
bits that WIFEXITED() and such test.
Which means if you feed an _actual_ signal number into it, without the
high bits set, you get the signal name anyway. Which is what I was seeing.
Ok. Thanks.
Rob
1330011125.0
More information about the Toybox
mailing list