Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/kill Note that negative pid args are permitted (indicati...



details:   https://anonhg.NetBSD.org/src/rev/dbb5430d5b5c
branches:  trunk
changeset: 943309:dbb5430d5b5c
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Aug 30 19:41:39 2020 +0000

description:
Note that negative pid args are permitted (indicating to send to the pgrp
abs(pid)) and indicate that -- is (strictly) needed if the first pid arg
(there often is only one) is negative - though this implementation works
without it if a signal to send has been explicitly given, but whereas
'kill 1234" is valid (send SIGTERM to pid 1234) "kill -1234" will generate
a usage error from the attempt to send signal 1234 to nothing, to send
SIGTERM to pgrp 1234 it needs to be "kill -- -1234" (or "kill -s term -1234").

While here do a couple of markup improvements, and allow for the
possibility that users might be running the builtin kill from some
shell other than csh or sh.

diffstat:

 bin/kill/kill.1 |  30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diffs (66 lines):

diff -r ee807ecac0ae -r dbb5430d5b5c bin/kill/kill.1
--- a/bin/kill/kill.1   Sun Aug 30 19:35:09 2020 +0000
+++ b/bin/kill/kill.1   Sun Aug 30 19:41:39 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: kill.1,v 1.31 2020/08/30 16:10:40 kre Exp $
+.\"    $NetBSD: kill.1,v 1.32 2020/08/30 19:41:39 kre Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"    @(#)kill.1      8.2 (Berkeley) 4/28/95
 .\"
-.Dd May 6, 2020
+.Dd August 30, 2020
 .Dt KILL 1
 .Os
 .Sh NAME
@@ -95,7 +95,9 @@
 .Dv TERM .
 .El
 .Pp
-The following pids have special meanings:
+The following
+.Ar pid Ns s
+have special meanings:
 .Bl -tag -width Ds -compact
 .It -1
 If superuser, broadcast the signal to all processes; otherwise broadcast
@@ -104,6 +106,24 @@
 Broadcast the signal to all processes in the current process group
 belonging to the user.
 .El
+Any other negative
+.Ar pid
+is interpreted as the negative of a process group identifier,
+and the signal is sent to all members of that group.
+.Pp
+Note that while not required by this implementation,
+if the first
+.Ar pid
+operand is negative, it should be preceded by the
+.Dq \&--
+end of options indicator, to avoid the
+.Ar pid
+being treated as yet more options.
+That is always required if no specific signal is specified
+and the first
+.Ar pid
+is negative, or that pid would be treated as the
+.Ar signal_number .
 .Pp
 Some of the more commonly used signals:
 .Bl -tag -width Ds -compact
@@ -143,9 +163,9 @@
 .Nm
 arguments.
 See
-.Xr csh 1
-or
+.Xr csh 1 ,
 .Xr sh 1
+or the man page for the shell in use
 for details.
 .Sh DIAGNOSTICS
 .Ex -std



Home | Main Index | Thread Index | Old Index