Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/kill.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)kill.2 8.3 (Berkeley) 4/19/94 | .\" @(#)kill.2 8.3 (Berkeley) 4/19/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd December 1, 2017 | .Dd December 1, 2019 | ||||
.Dt KILL 2 | .Dt KILL 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm kill | .Nm kill | ||||
.Nd send signal to a process | .Nd send signal to a process | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
(with | (with | ||||
.Dv P_SYSTEM | .Dv P_SYSTEM | ||||
flag set), | flag set), | ||||
process with ID 1 | process with ID 1 | ||||
(usually | (usually | ||||
.Xr init 8 ) , | .Xr init 8 ) , | ||||
and the process sending the signal. | and the process sending the signal. | ||||
If the user is not the super user, the signal is sent to all processes | If the user is not the super user, the signal is sent to all processes | ||||
with the same uid as the user excluding the process sending the signal. | which the caller has permissions to, excluding the process sending the signal. | ||||
No error is returned if any process could be signaled. | No error is returned if any process could be signaled. | ||||
.El | .El | ||||
.Pp | .Pp | ||||
For compatibility with System V, | If the process number is negative but not -1, | ||||
if the process number is negative but not -1, | |||||
the signal is sent to all processes whose process group ID | the signal is sent to all processes whose process group ID | ||||
is equal to the absolute value of the process number. | is equal to the absolute value of the process number. | ||||
This is a variant of | This is a variant of | ||||
.Xr killpg 2 . | .Xr killpg 2 . | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Rv -std kill | .Rv -std kill | ||||
.Sh ERRORS | .Sh ERRORS | ||||
The | The | ||||
.Fn kill | .Fn kill | ||||
system call | system call | ||||
will fail and no signal will be sent if: | will fail and no signal will be sent if: | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
.It Bq Er EINVAL | .It Bq Er EINVAL | ||||
The | The | ||||
.Fa sig | .Fa sig | ||||
argument | argument | ||||
is not a valid signal number. | is not a valid signal number. | ||||
.It Bq Er ESRCH | .It Bq Er ESRCH | ||||
No process or process group can be found corresponding to that specified by | No process or process group can be found corresponding to that specified by | ||||
.Fa pid . | .Fa pid . | ||||
.It Bq Er EPERM | .It Bq Er EPERM | ||||
The sending process does not have permission to send | The sending process does not have permission to send | ||||
.Va sig | .Va sig | ||||
to the receiving process. | to any receiving process. | ||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr getpgrp 2 , | .Xr getpgrp 2 , | ||||
.Xr getpid 2 , | .Xr getpid 2 , | ||||
.Xr killpg 2 , | .Xr killpg 2 , | ||||
.Xr sigaction 2 , | .Xr sigaction 2 , | ||||
.Xr sigqueue 2 , | .Xr sigqueue 2 , | ||||
.Xr raise 3 , | .Xr raise 3 , | ||||
Show All 15 Lines |