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 <[email protected]> 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(-)
From b48b51533b4be49fd397ec03ceb4e1aa36ceb6d9 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Mon, 10 Jun 2019 08:20:40 -0700
Subject: [PATCH] kill: add trivial -l tests.

(`kill -l HUP` and `kill -l 1` both said "HUP" instead of giving you
back the one you didn't provide, before my real-time signal patch.)
---
 tests/kill.test | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 tests/kill.test

diff --git a/tests/kill.test b/tests/kill.test
new file mode 100644
index 00000000..a91dd55a
--- /dev/null
+++ b/tests/kill.test
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+[ -f testing.sh ] && . testing.sh
+
+#testing "name" "command" "result" "infile" "stdin"
+
+testing "-l HUP" "kill -l HUP" "1\n" "" ""
+testing "-l 1" "kill -l 1" "HUP\n" "" ""
-- 
2.22.0.rc2.383.gf4fbbf30c2-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to