[Toybox] [PATCH] Improve signal name<->number conversions.

enh enh at google.com
Mon Jun 10 08:23:30 PDT 2019


ping?

-*-

i did think of a way we could maybe add a test for the real-time
signals: collect the value from `kill -l SIGRTMAX` and check that
`kill -l SIGRTMAX-1` is `$((sigrtmax - 1))`. (you might think that
SIGRTMIN/SIGRTMAX are constants, but SIGRTMIN varies based on how many
real-time signals the libc implementation has taken for itself, and on
MIPS at least SIGRTMAX is different. i think the BSDs differ from
Linux too.)

SIGHUP is probably (?) the same everywhere so we could have similar
for `kill -l HUP` and `kill -l 1`.

given that `kill -l` was broken even for the easy cases before my
patch, i've at least attached the trivial HUP/1 test...

On Fri, Jun 7, 2019 at 11:16 PM enh <enh at google.com> wrote:
>
> Include all the signals, not just the POSIX ones.
>
> In particular, improve support for real-time signals. My attempt to
> switch AOSP builds over to toybox timeout got reverted when I broke the
> ART build bots which use SIGRTMIN+2.
>
> Also fix `kill -l 3` to show "QUIT" and `kill -l QUIT` to show "3".
>
> Also make the `kill -l` output include numbers and names, and format it
> to look better on a 80x24 tty, because it's always August 1978 somewhere.
> ---
>  lib/lib.c          | 81 +++++++++++++++++++++++++++++++++++++---------
>  lib/lib.h          |  2 ++
>  toys/lsb/killall.c |  2 +-
>  toys/posix/kill.c  |  5 +--
>  4 files changed, 71 insertions(+), 19 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-kill-add-trivial-l-tests.patch
Type: text/x-patch
Size: 809 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20190610/8c3c2189/attachment-0003.bin>


More information about the Toybox mailing list