An initial revision of "kill -l [exitstatus]"

Mats Erik Andersson mats.andersson64 at comhem.se
Sun Apr 29 14:17:21 PDT 2007


sön 2007-04-29 klockan 16:35 +0200 skrev Denis Vlasenko:
> I was thinking of making shared code for entire kill,
> not just kill -l. This way we can save much more on code size.
> 
> I am attaching my proposal. Please test & report whereever I goof up
> (a lot of subtle error cases there - kill_main must be very careful now
> to not exit, but return to caller!)

The trick of using a space character to parse job numbers is a
good one, I did not find a work around in order to do the full
program of integrating both modes of operation into one code.

In a first test run I could not uncover any errors, but I cannot
agree an the output for the full listing case "kill -l". The SUSv3
specification gives the implementor his freedom, but I dislike
a long listing that include explicit numbers like 7, 16, and 22--31,
which do not correspond to named signals. I attach a patch to 
correct this. Unfortunately it adds, in its present form, 16 bytes.
That "kill -l 7" outputs "7", instead of silence like bash does, is
not particularly concerning to me, since SUSv3 leaves it as one
of the undefined cases, and error/exception handling is equally
well left to the script author,

Regards		Mats E A


P.S.

In the process of testing this, I made a strange observation how
my Debian Sarge is behaving. See it as a warning to be observant
when revising and improving on Busybox!

Outputs from Sarge with bash:

$ kill -l 16
                    # My addition: signal does not exist!
$ /bin/kill -l 16
STKFLT
$ kill -l 29
IO
$ /bin/kill -l 29
POLL





-------------- next part --------------
A non-text attachment was scrubbed...
Name: only_existing_signals.diff
Type: text/x-patch
Size: 445 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070429/970095e2/attachment.bin 


More information about the busybox mailing list