The NetBSD Project

CVS log for src/bin/kill/kill.c

[BACK] Up to [] / src / bin / kill

Request diff between arbitrary revisions

Default branch: MAIN
Current tag: MAIN

Revision 1.30 / (download) - annotate - [select for diffs], Wed Dec 12 20:22:43 2018 UTC (18 months, 3 weeks ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp, HEAD
Changes since 1.29: +4 -2 lines
Diff to previous 1.29 (colored)

Reverse a decision made when the printsignals() routines from
kill and sh were merged so that the shell (for trap -l) and
kill (for kill -l) can use the same routine, and site that function
in the shell, rather than in kill (use the code that is in kill as
the basis for that routine).   This allows access to sh internals,
and in particular to the posix option, so the builtin kill can
operate in posix mode where the standard requires just a single
character (space of newline) between successive signal names (and
we prefer nicely aligned columns instead)..

In a SMALL shell, use the ancient sh printsignals routine instead,
it is smaller (and very much dumber).

/bin/kill still uses the routine that is in its source, and is
not posix compliant.   A task for some other day...

Revision 1.29 / (download) - annotate - [select for diffs], Sun Oct 28 18:26:52 2018 UTC (20 months, 1 week ago) by kre
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.28: +16 -9 lines
Diff to previous 1.28 (colored)

Switch from using two printsignals() functions, one in trap.c
and one in (the included from bin/kill) kill.c and use just
the one in kill.c (which is amended slightly so it can work
the way that trap.c needs it to work).    This one is chosen as
it was a much nicer implementation, and because while kill is
always built into the shell, kill also exists without the shell.

Leave the old implementation #if 0'd in trap.c (but updated to
match the calling convention of the one in kill.c) - for now.

Delete references of sys_signame[] from sh/trap.c and along with
that several uses of NSIG (unfortunately, there are still more)
and replace them with the newer libc functional interfaces.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jun 26 22:09:16 2017 UTC (3 years ago) by kre
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.27: +150 -92 lines
Diff to previous 1.27 (colored)

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.)

Revision 1.27 / (download) - annotate - [select for diffs], Mon Aug 29 14:51:18 2011 UTC (8 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, netbsd-8-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, localcount-20160914, khorben-n900, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, agc-symver-base, agc-symver
Branch point for: netbsd-8
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

Use __dead

Revision 1.26 / (download) - annotate - [select for diffs], Thu Oct 1 09:24:38 2009 UTC (10 years, 9 months ago) by spz
Branch: MAIN
CVS Tags: matt-premerge-20091211, matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.25: +22 -12 lines
Diff to previous 1.25 (colored)

Make sure that numerical signals and pids are in range for their types.
Fixes PR bin/42143

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jul 20 00:52:40 2008 UTC (11 years, 11 months ago) by lukem
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, netbsd-5-base, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Branch point for: netbsd-5, matt-nb5-mips64
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

Remove the \n and tabs from the __COPYRIGHT() strings.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Mar 17 22:30:11 2006 UTC (14 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: wrstuden-revivesa, netbsd-4
Changes since 1.23: +12 -12 lines
Diff to previous 1.23 (colored)

Coverity CID 2356: Remove bogus test !*argv; also cleanup string usage.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Aug 7 09:05:13 2003 UTC (16 years, 11 months ago) by agc
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.22: +3 -7 lines
Diff to previous 1.22 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Aug 4 22:31:24 2003 UTC (16 years, 11 months ago) by jschauma
Branch: MAIN
Changes since 1.21: +12 -6 lines
Diff to previous 1.21 (colored)

As discusses a little while back on tech-userlevel:

If stdout is a tty, use vis(3) to print any filenames to prevent garbage
from being printed if the filename contains control- or other non-printable

While here, sprinkle some EXIT_FAILURE and NOTREACHED where appropriate.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Nov 25 14:23:07 2002 UTC (17 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.20: +8 -2 lines
Diff to previous 1.20 (colored)

sent cont to jobs so that they can exit without an fg when killed.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Nov 24 22:35:44 2002 UTC (17 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.19: +68 -26 lines
Diff to previous 1.19 (colored)

Fixes from David Laight:
- ansification
- format of output of jobs command (etc)
- job identiers %+, %- etc
- $? and $(...)
- correct quoting of output of set, export -p and readonly -p
- differentiation between nornal and 'posix special' builtins
- correct behaviour (posix) for errors on builtins and special builtins
- builtin printf and kill
- set -o debug (if compiled with DEBUG)
- cd src obj (as ksh - too useful to do without)
- unset -e name, remove non-readonly variable from export list.
  (so I could unset -e PS1 before running the test shell...)

Revision 1.19 / (download) - annotate - [select for diffs], Sun Sep 16 13:55:09 2001 UTC (18 years, 9 months ago) by wiz
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.18: +8 -6 lines
Diff to previous 1.18 (colored)

Use {g,s}etprogname. Patch by Petri Koistinen.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Jul 29 22:46:36 2001 UTC (18 years, 11 months ago) by wiz
Branch: MAIN
Changes since 1.17: +16 -21 lines
Diff to previous 1.17 (colored)

ANSIfy, some style improvements. Some parts from #13593 by Petri Koistinen.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Nov 4 18:14:15 1998 UTC (21 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.16: +5 -5 lines
Diff to previous 1.16 (colored)

unsigned char casts for is*()

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jul 28 11:41:49 1998 UTC (21 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.15: +2 -4 lines
Diff to previous 1.15 (colored)

Be more retentive about use of NOTREACHED and noreturn.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jul 28 05:31:24 1998 UTC (21 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.14: +6 -2 lines
Diff to previous 1.14 (colored)


Revision 1.14 / (download) - annotate - [select for diffs], Tue Jul 28 05:15:47 1998 UTC (21 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.13: +4 -3 lines
Diff to previous 1.13 (colored)


Revision 1.13 / (download) - annotate - [select for diffs], Sun Jul 20 17:36:22 1997 UTC (22 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3
Changes since 1.12: +6 -5 lines
Diff to previous 1.12 (colored)


Revision 1.12 / (download) - annotate - [select for diffs], Sat Feb 22 01:45:41 1997 UTC (23 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Fix a typo that caused lack of argument to be misinterpreted as "0".
From Arne H. Juul <>, PR #3236.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Sep 7 06:30:27 1995 UTC (24 years, 10 months ago) by jtc
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Sync with 4.4lite2

Revision 1.10 / (download) - annotate - [select for diffs], Tue Mar 21 09:06:01 1995 UTC (25 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.9: +7 -2 lines
Diff to previous 1.9 (colored)

convert to new RCS id conventions.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Mar 17 05:48:48 1995 UTC (25 years, 3 months ago) by jtc
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Changed to accept ``kill -0 pid'' (PR #842).

Revision 1.8 / (download) - annotate - [select for diffs], Sun Dec 4 07:11:48 1994 UTC (25 years, 7 months ago) by cgd
Branch: MAIN
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored)

from James Jegers <>: quiet -Wall, and squelch
some of the worst style errors.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Sep 22 09:25:27 1994 UTC (25 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.6: +73 -91 lines
Diff to previous 1.6 (colored)

Merge 4.4-Lite version.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Aug 6 21:25:21 1993 UTC (26 years, 11 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.5: +15 -34 lines
Diff to previous 1.5 (colored)

Use sys_signame[].

Revision 1.5 / (download) - annotate - [select for diffs], Sun Aug 1 18:59:35 1993 UTC (26 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Add RCS identifiers.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 22 16:42:18 1993 UTC (26 years, 11 months ago) by jtc
Branch: MAIN
Changes since 1.3: +107 -32 lines
Diff to previous 1.3 (colored)

Make POSIX 1003.2 (D11.2) compliant.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Mar 23 00:25:54 1993 UTC (27 years, 3 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-alpha-1, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, netbsd-0-8
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored)

changed "Id" to "Header" for rcsids

Revision 1.2 / (download) - annotate - [select for diffs], Mon Mar 22 08:04:00 1993 UTC (27 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

added rcs ids to all files

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (27 years, 3 months ago) by cgd
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

CVSweb <>