|
|
#include <sys/types.h> #include <signal.h>int kill (pid, signo) pid_t pid; int signo;
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 processes with a process ID of 0 and a process ID of 1 are special processes and are referred to below as proc0 and proc1, respectively.
If pid is greater than zero, signo is sent to the process whose process ID is equal to pid. pid may equal 1.
If pid is 0, signo is sent to all processes excluding proc0 and 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, signo is sent to all processes excluding proc0 and 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, signo is sent to all processes excluding proc0 and proc1.
If pid is negative but not -1, signo is sent to all processes whose process group ID is equal to the absolute value of pid.
The kill system call fails and no signal is sent if one or more of the following is true:
X/Open Portability Guide, Issue 3, 1989
;
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2)
;
IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1)
;
and
NIST FIPS 151-1
.