An initial revision of "kill -l [exitstatus]"
Tito
farmatito at tiscali.it
Sat Apr 28 13:47:15 PDT 2007
On Saturday 28 April 2007 15:42:09 Mats Erik Andersson wrote:
> Hi there,
>
> let me return to the subject of "kill -l", as it is present
> in an ash builtin and as an applet. Luciano M. F. Rocha had
> an important point earlier on, when observing that the ash
> builtin command must supply a functionality "kill -9 %1",
> which the applet "kill" can never do. Therefore I have as a
> first step, in response to Denis Vlasenko's challenge to
> integrate the two kill commands into a single code,
> concentrated on a partial task:
>
> 1) Make a shared code for "kill -l [exitstatus]".
>
> 2) Conform to all parts of SUSv3 for "kill -l [exitstatus]"
>
> Both these are accomplished using the two attached files. They are not
> intended to immediately be applied to the source tree, since they have
> two macros
> ENABLE_FEATURE_KILL_STRICTLY_SUSV3
> and
> ENABLE_FEATURE_KILL_MANY_SIGNALS
>
> defined internally, but they are functional on my testing system
> and they save 235 bytes, in addition to complying to SUSv3, which both
> the earlier kill-instances fail to do. I would like comments on these
> snippets. My implementation presently touches upon the files
>
> libbb/signallist.c (new builtin/shared functionality)
> libbb/Kbuild
> include/libbb.h
> procps/kill.c
> shell/ash.c
>
>
> Our earlier discussion on "kill -l exitstatus" did not properly fathom
> what the standard intends with this. I have been studying this and
> believe I know their intention. SUSv3 would like this functionality:
>
> $ cat > /dev/null
> <Ctrl-C>
> $ echo "Died of SIG$(kill -l $?)"
> Died of SIGINT
> $
>
> The actual value of "$?" is 130 when evaluated in the above situation.
> My code correctly delivers this functionality, where both the previous
> kill-instances aborted with an error, since 130 is not an allowed signal
> in their implementation.
>
> As a minimal extension on SUSv3, my code allows a bidirectional
> conversion, where SUSv3 is uni-directional:
>
> $ kill -l 3 # Required by SUSv3
> QUIT
> $ kill -l QUIT
> 3
>
>
> I hope to hear your views and criticism in due time.
>
> Best regards, Mats E Andersson
>
Hi, maybe this is a typo?
signallist.c
/* If a previous printing was performed on this line, add a space character. */
if (col != 0)
putchar(' '), col++;
Shouldn't it be:
/* If a previous printing was performed on this line, add a space character. */
if (col != 0) {
putchar(' ');
col++;
}
Just my 2 cents.
Ciao,
Tito
More information about the busybox
mailing list