KILL(2) DOMAIN/IX Reference Manual (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 a process or a group of processes,
denoted by pid. The signal is named by Sig names the signal
that kill sends, and is either zero, or a number denoting
one of the signals given in the list in signal(2). If sig
is zero (the null signal), kill performs error checking, but
does not send a signal. This can be used to check the vali-
dity of pid.
The real or effective user ID of the sending process must
match the real or effective user ID of the receiving pro-
cess, 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.
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
Kill returns zero on successful execution. Otherwise, it
returns -1 and sets errno to indicate the error.
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.
Printed 5/10/85 KILL-1
KILL(2) DOMAIN/IX Reference Manual (SYS5) KILL(2)
[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 receiving process.
RELATED INFORMATION
kill(1), getpid(2), setpgrp(2), signal(2)
KILL-2 Printed 5/10/85