KILL(2) DOMAIN/IX SYS5 KILL(2)
NAME
kill - send a signal to a process or a group of processes
USAGE
int kill(pid, sig)
int pid, sig;
DESCRIPTION
Kill sends a signal to the process or group of processes
denoted by pid. The signal is named by sig, and is either
zero or a number denoting one of the signals described on
signal(2). If sig is zero (the null signal), kill performs
error checking, but does not send a signal. A zero signal
is typically used to check the validity of a pid. The real
or effective user ID of the sending process must match the
real or effective user ID of the receiving process, unless
the effective user ID of the sending process is super-user.
The process with a process ID of 1 is a special process, and
is referred to below as proc1. On DOMAIN Workstations,
proc1 is always the Display Manager (DM). On DOMAIN
Servers, proc1 is always the Server Process Manager (SPM).
The behavior of kill varies, as shown below, according to
the value of pid.
⊕ If pid is greater than zero, sig is sent to the process
whose process ID is equal to pid. Pid may equal 1.
⊕ If pid is 0, sig is sent to all processes, except proc1,
whose process group ID is equal to the process group ID
of the sender.
⊕ If pid is -1 and the effective user ID of the sender is
not super-user, sig is sent to all processes excluding
proc1 whose real user ID is equal to the effective user
ID of the sender.
⊕ If pid is -1 and the effective user ID of the sender is
super-user, sig is sent to all processes excluding proc1.
⊕ If pid is negative but not -1, sig is sent to all
processes whose process group ID is equal to the absolute
value of pid.
RETURN VALUE
A successful call returns zero. A failed call returns -1
and sets errno as indicated below.
Printed 12/4/86 KILL-1
KILL(2) DOMAIN/IX SYS5 KILL(2)
ERRORS
Kill will fail without sending a signal if one or more of
the following is true:
[EINVAL] Sig is not a valid signal number.
[EINVAL] Sig is SIGKILL and pid is 1 (proc1).
[ESRCH] No process corresponding to pid can be found.
[EPERM] The user ID of the sending process is not super-
user, and its real or effective user ID does not
match the real or effective user ID of the receiv-
ing process.
RELATED INFORMATION
kill(1), getpid(2), setpgrp(2), signal(2)
KILL-2 Printed 12/4/86