xref: /dflybsd-src/lib/libc/sys/lwp_kill.2 (revision 0d9899e72d0ab73653a47790ac79317a20a1601c)
1f9366a82SSimon Schubert.\" Copyright (c) 2007 The DragonFly Project.  All rights reserved.
2f9366a82SSimon Schubert.\"
3f9366a82SSimon Schubert.\" This code is derived from software contributed to The DragonFly Project
4f9366a82SSimon Schubert.\" by Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
5f9366a82SSimon Schubert.\"
6f9366a82SSimon Schubert.\" Redistribution and use in source and binary forms, with or without
7f9366a82SSimon Schubert.\" modification, are permitted provided that the following conditions
8f9366a82SSimon Schubert.\" are met:
9f9366a82SSimon Schubert.\"
10f9366a82SSimon Schubert.\" 1. Redistributions of source code must retain the above copyright
11f9366a82SSimon Schubert.\"    notice, this list of conditions and the following disclaimer.
12f9366a82SSimon Schubert.\" 2. Redistributions in binary form must reproduce the above copyright
13f9366a82SSimon Schubert.\"    notice, this list of conditions and the following disclaimer in
14f9366a82SSimon Schubert.\"    the documentation and/or other materials provided with the
15f9366a82SSimon Schubert.\"    distribution.
16f9366a82SSimon Schubert.\" 3. Neither the name of The DragonFly Project nor the names of its
17f9366a82SSimon Schubert.\"    contributors may be used to endorse or promote products derived
18f9366a82SSimon Schubert.\"    from this software without specific, prior written permission.
19f9366a82SSimon Schubert.\"
20f9366a82SSimon Schubert.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21f9366a82SSimon Schubert.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22f9366a82SSimon Schubert.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23f9366a82SSimon Schubert.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24f9366a82SSimon Schubert.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25f9366a82SSimon Schubert.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26f9366a82SSimon Schubert.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27f9366a82SSimon Schubert.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28f9366a82SSimon Schubert.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29f9366a82SSimon Schubert.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30f9366a82SSimon Schubert.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31f9366a82SSimon Schubert.\" SUCH DAMAGE.
32f9366a82SSimon Schubert.\"
33d78fd03bSSascha Wildner.\" $DragonFly: src/lib/libc/sys/lwp_kill.2,v 1.2 2007/03/16 22:02:02 swildner Exp $
34f9366a82SSimon Schubert.\"
35f9366a82SSimon Schubert.Dd March 12, 2007
36f9366a82SSimon Schubert.Dt LWP_KILL 2
37f9366a82SSimon Schubert.Os
38f9366a82SSimon Schubert.Sh NAME
39f9366a82SSimon Schubert.Nm lwp_kill
40f9366a82SSimon Schubert.Nd send signal to a lwp
41f9366a82SSimon Schubert.Sh LIBRARY
42f9366a82SSimon Schubert.Lb libc
43f9366a82SSimon Schubert.Sh SYNOPSIS
44f9366a82SSimon Schubert.In sys/types.h
45*0d9899e7SSepherosa Ziehau.In sys/lwp.h
46f9366a82SSimon Schubert.In signal.h
47f9366a82SSimon Schubert.Ft int
48f9366a82SSimon Schubert.Fn lwp_kill "pid_t pid" "lwpid_t tid" "int sig"
49f9366a82SSimon Schubert.Sh DESCRIPTION
50f9366a82SSimon SchubertThe
51f9366a82SSimon Schubert.Fn lwp_kill
52d78fd03bSSascha Wildnerfunction sends the signal
53f9366a82SSimon Schubert.Fa sig
54f9366a82SSimon Schubertto the lwp specified by
55f9366a82SSimon Schubert.Fa pid
56f9366a82SSimon Schubertand
57f9366a82SSimon Schubert.Fa tid .
58f9366a82SSimon SchubertIf
59f9366a82SSimon Schubert.Fa pid
60d78fd03bSSascha Wildneris -1, the signal will be sent to the current process.
61d78fd03bSSascha WildnerPermission checking and signal behavior is exactly like in
62f9366a82SSimon Schubert.Xr kill 2 .
63f9366a82SSimon Schubert.Sh RETURN VALUES
64d78fd03bSSascha Wildner.Rv -std
65f9366a82SSimon Schubert.Sh ERRORS
66f9366a82SSimon Schubert.Fn Lwp_kill
67f9366a82SSimon Schubertwill fail and no signal will be sent if:
68f9366a82SSimon Schubert.Bl -tag -width Er
69f9366a82SSimon Schubert.It Bq Er EINVAL
70d78fd03bSSascha Wildner.Fa sig
71f9366a82SSimon Schubertis not a valid signal number.
72f9366a82SSimon Schubert.It Bq Er ESRCH
73d78fd03bSSascha Wildnerno lwp corresponding to
74f9366a82SSimon Schubert.Fa pid
75f9366a82SSimon Schubertand
76d78fd03bSSascha Wildner.Fa tid
77d78fd03bSSascha Wildnercan be found.
78f9366a82SSimon Schubert.It Bq Er EPERM
79d78fd03bSSascha Wildnerthe sending process is not the super-user and its effective
80f9366a82SSimon Schubertuser id does not match the effective user-id of the receiving process.
81f9366a82SSimon Schubert.El
82f9366a82SSimon Schubert.Sh SEE ALSO
83f9366a82SSimon Schubert.Xr kill 2 ,
84f9366a82SSimon Schubert.Xr lwp_create 2 ,
854041d919SSascha Wildner.Xr raise 3
86f9366a82SSimon Schubert.Sh HISTORY
87f9366a82SSimon SchubertThe
88f9366a82SSimon Schubert.Fn lwp_kill
89f9366a82SSimon Schubertfunction first appeared in
90f9366a82SSimon Schubert.Dx 1.9 .
91