1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)kill.2 6.5 (Berkeley) 5/14/86
7 .TH KILL 2 "May 14, 1986"
10 kill \- send signal to a process
14 #include <sys/types.h>
17 int kill(pid_t \fIpid\fP, int \fIsig\fP)
22 sends the signal \fIsig\fP
23 to a process, specified by the process number
26 may be one of the signals specified in
28 or it may be 0, in which case
29 error checking is performed but no
30 signal is actually sent.
31 This can be used to check the validity of
34 The sending and receiving processes must
35 have the same effective user ID, otherwise
36 this call is restricted to the super-user.
38 A single exception is the signal SIGCONT, which may always be sent
39 to any descendant of the current process.
42 If the process number is 0,
43 the signal is sent to all processes in the
44 sender's process group.
46 If the process number is \-1
47 and the user is the super-user,
48 the signal is broadcast universally
51 and the process sending the signal.
52 If the process number is \-1
53 and the user is not the super-user,
54 the signal is broadcast universally to
55 all processes with the same uid as the user
56 except the process sending the signal.
57 No error is returned if any process could be signaled.
59 If the process number is negative but not \-1,
60 the signal is sent to all processes whose process group ID
61 is equal to the absolute value of the process number.
63 Processes may send signals to themselves.
65 Upon successful completion, a value of 0 is returned.
66 Otherwise, a value of \-1 is returned and
68 is set to indicate the error.
71 will fail and no signal will be sent if any of the following
75 \fISig\fP is not a valid signal number.
78 No process can be found corresponding to that specified by \fIpid\fP.
81 The process id was given as 0
82 but the sending process does not have a process group.
85 The sending process is not the super-user and its effective
86 user id does not match the effective user-id of the receiving process.
87 When signaling a process group, this error was returned if any members
88 of the group could not be signaled.