Go to file
kre a3be5e86c2 Make arg parsing in kill POSIX compatible with POSIX (XBD 2.12) by
parsing the way getopt(3) would, if only it could handle the (required)
-signumber and -signame options.  This adds two "features" to kill,
-ssigname and -lstatus now work (ie: one word with all of the '-', the
option letter, and its value) and "--" also now works (kill -- -pid1 pid2
will not attempt to send the pid1 signal to pid2, but rather SIGTERM
to the pid1 process group and pid2).  It is still the case that (apart
from --) at most 1 option is permitted (-l, -s, -signame, or -signumber.)

Note that we now have an ambiguity, -sname might mean "-s name" or
send the signal "sname" - if one of those turns out to be valid, that
will be accepted, otherwise the error message will indicate that "sname"
is not a valid signal name, not that "name" is not.   Keeping the "-s"
and signal name as separate words avoids this issue.

Also caution: should someone be weird enough to define a new signal
name (as in the part after SIG) which is almost the same name as an
existing name that starts with 'S' by adding an extra 'S' prepended
(eg: adding a SIGSSYS) then the ambiguity problem becomes much worse.
In that case "kill -ssys" will be resolved in favour of the "-s"
flag being used (the more modern syntax) and would send a SIGSYS, rather
that a SIGSSYS.    So don't do that.

While here, switch to using signalname(3) (bye bye NSIG, et. al.), add
some constipation, and show a little pride in formatting the signal names
for "kill -l" (and in the usage when appropriate -- same routine.)   Respect
COLUMNS (POSIX XBD 8.3) as primary specification of the width (terminal width,
not number of columns to print) for kill -l, a very small value for COLUMNS
will cause kill -l output to list signals one per line, a very large
value will cause them all to be listed on one line.) (eg: "COLUMNS=1 kill -l")

TODO: the signal printing for "trap -l" and that for "kill -l"
should be switched to use a common routine (for the sh builtin versions.)

All changes of relevance here are to bin/kill - the (minor) changes to bin/sh
are only to properly expose the builtin version of getenv(3) so the builtin
version of kill can use it (ie: make its prototype available.)
2017-06-26 22:09:16 +00:00
bin Make arg parsing in kill POSIX compatible with POSIX (XBD 2.12) by 2017-06-26 22:09:16 +00:00
common Comment alignment. No functional change. 2017-04-13 07:49:52 +00:00
compat Don't mix abis in any CRUNCHEDPROG 2017-01-05 21:28:42 +00:00
crypto If we've authenticated, we are already in the child and we don't need the 2017-06-26 17:10:39 +00:00
dist/pf PR 50709 David Binderman: memory leak 2016-05-30 17:21:07 +00:00
distrib spelling (DEC called it "TURBOchannel") 2017-06-22 16:46:52 +00:00
doc new expat 2017-06-17 22:06:54 +00:00
etc Add GENERIC_USB to vax kernel sets, but not to sysinst (yet), as bootloader 2017-06-26 17:45:56 +00:00
external Honor HOST_CXX. 2017-06-26 17:38:10 +00:00
extsrc
games another one 2017-06-13 17:18:00 +00:00
include Add the new signalname/signalnext/signalnumber interface to libc. 2017-05-09 11:14:16 +00:00
lib Correct misleading indentation. NFC 2017-06-22 12:43:43 +00:00
libexec Remove old assert that only two segments exist. The rest of the code has 2017-06-23 15:29:21 +00:00
regress Remove regress lseek tests, obsoleted by ATF 2017-05-14 04:26:40 +00:00
rescue Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
sbin Remove unnecessary Pp. 2017-06-19 09:46:33 +00:00
share Add vax. 2017-06-23 15:24:35 +00:00
sys Add first channel of mcs7720. 2017-06-26 20:36:01 +00:00
tests Drop RTF_UP from a routing message of a deleted ARP/NDP entry 2017-06-26 06:59:56 +00:00
tools Update for new libfdt location 2017-06-08 17:16:44 +00:00
usr.bin Improve description of -V. Can probably be improved further. 2017-06-22 13:42:09 +00:00
usr.sbin Fix usage of routing messages on arp -d and ndp -d 2017-06-26 03:13:40 +00:00
BUILDING regen 2017-05-21 15:30:20 +00:00
Makefile don't descend into gnu 2017-04-11 14:04:15 +00:00
Makefile.inc
UPDATING New dhcpcd does not like update builds from previous versions. 2017-04-03 09:37:58 +00:00
build.sh - Allow all other targets (like kernel=) to obey mkrepro (-P) 2017-04-08 18:22:35 +00:00