+.\"-
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" SUCH DAMAGE.
.\"
.\" @(#)kill.1 8.2 (Berkeley) 4/28/95
-.\" $FreeBSD: src/bin/kill/kill.1,v 1.11.2.2 2002/07/14 21:41:26 keramida Exp $
-.\" $DragonFly: src/bin/kill/kill.1,v 1.4 2008/05/02 02:05:03 swildner Exp $
+.\" $FreeBSD: src/bin/kill/kill.1,v 1.22 2010/12/21 22:47:34 jilles Exp $
.\"
.Dd April 28, 1995
.Dt KILL 1
.Sh SYNOPSIS
.Nm
.Op Fl s Ar signal_name
-.Ar pid
-\&...
+.Ar pid ...
.Nm
.Fl l
.Op Ar exit_status
.Nm
.Fl Ar signal_name
-.Ar pid
-\&...
+.Ar pid ...
.Nm
.Fl Ar signal_number
-.Ar pid
-\&...
+.Ar pid ...
.Sh DESCRIPTION
The
.Nm
utility sends a signal to the processes specified by the
.Ar pid
-operand(s).
+operands.
.Pp
Only the super-user may send signals to other users' processes.
.Pp
The options are as follows:
-.Bl -tag -width Ds
+.Bl -tag -width indent
.It Fl s Ar signal_name
A symbolic signal name specifying the signal to be sent instead of the
default
.Dv TERM .
.El
.Pp
-The following pids have special meanings:
-.Bl -tag -width Ds -compact
+The following PIDs have special meanings:
+.Bl -tag -width indent
.It -1
If superuser, broadcast the signal to all processes; otherwise broadcast
to all processes belonging to the user.
.El
.Pp
Some of the more commonly used signals:
-.Bl -tag -width Ds -compact
+.Pp
+.Bl -tag -width indent -compact
.It 1
HUP (hang up)
.It 2
.Ex -std
.Sh EXAMPLES
Terminate
-the processes with pids 142 and 157:
+the processes with PIDs 142 and 157:
.Pp
.Dl "kill 142 157"
.Pp
Send the hangup signal
.Pq Dv SIGHUP
-to the process with pid 507:
+to the process with PID 507:
.Pp
.Dl "kill -s HUP 507"
.Pp
-Terminate the process group with pgid 117:
+Terminate the process group with PGID 117:
.Pp
.Dl "kill -- -117"
.Sh SEE ALSO
.Sh STANDARDS
The
.Nm
-function is expected to be
+utility is expected to be
.St -p1003.2
compatible.
.Sh HISTORY
-/*
+/*-
* Copyright (c) 1988, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
*
* @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved.
* @(#)kill.c 8.4 (Berkeley) 4/28/95
- * $FreeBSD: src/bin/kill/kill.c,v 1.11.2.2 2002/07/28 10:19:57 tjr Exp $
- * $DragonFly: src/bin/kill/kill.c,v 1.7 2005/03/05 19:41:38 liamfoy Exp $
+ * $FreeBSD: src/bin/kill/kill.c,v 1.24 2011/02/04 16:40:50 jilles Exp $
*/
#include <ctype.h>
numsig = strtol(*argv, &ep, 10);
if (**argv == '\0' || *ep != '\0')
errx(2, "illegal signal number: %s", *argv);
- if (numsig < 0 || numsig >= sys_nsig)
+ if (numsig < 0)
nosig(*argv);
} else
nosig(*argv);
#endif
{
pid = (pid_t)strtol(*argv, &ep, 10);
- if (**argv == '\0' || *ep != '\0') {
- warnx("illegal process id: %s", *argv);
- errors = 1;
- }
+ if (**argv == '\0' || *ep != '\0')
+ errx(2, "illegal process id: %s", *argv);
}
if (kill(pid, numsig) == -1) {
warn("%s", *argv);
{
int n;
- if (strncasecmp(sig, "sig", 3) == 0)
+ if (strncasecmp(sig, "SIG", 3) == 0)
sig += 3;
for (n = 1; n < sys_nsig; n++) {
if (strcasecmp(sys_signame[n], sig) == 0)