xref: /netbsd-src/lib/libpthread/pthread_kill.3 (revision 9c4ae7f5c2fef0e300beb637a5dd6fc26ce31b37)
1*9c4ae7f5Sjruoho.\" $NetBSD: pthread_kill.3,v 1.9 2010/07/09 08:51:28 jruoho Exp $
255818196Snathanw.\"
355818196Snathanw.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
455818196Snathanw.\" All rights reserved.
555818196Snathanw.\" Redistribution and use in source and binary forms, with or without
655818196Snathanw.\" modification, are permitted provided that the following conditions
755818196Snathanw.\" are met:
855818196Snathanw.\" 1. Redistributions of source code must retain the above copyright
955818196Snathanw.\"    notice, this list of conditions and the following disclaimer.
1055818196Snathanw.\" 2. Redistributions in binary form must reproduce the above copyright
1155818196Snathanw.\"    notice, this list of conditions and the following disclaimer in the
1255818196Snathanw.\"    documentation and/or other materials provided with the distribution.
1355818196Snathanw.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1455818196Snathanw.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1555818196Snathanw.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1655818196Snathanw.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
1755818196Snathanw.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1855818196Snathanw.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1955818196Snathanw.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2055818196Snathanw.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2155818196Snathanw.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2255818196Snathanw.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2355818196Snathanw.\" POSSIBILITY OF SUCH DAMAGE.
2455818196Snathanw.\"
2555818196Snathanw.\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>.
2655818196Snathanw.\" All rights reserved.
2755818196Snathanw.\"
2855818196Snathanw.\" Redistribution and use in source and binary forms, with or without
2955818196Snathanw.\" modification, are permitted provided that the following conditions
3055818196Snathanw.\" are met:
3155818196Snathanw.\" 1. Redistributions of source code must retain the above copyright
3255818196Snathanw.\"    notice(s), this list of conditions and the following disclaimer as
3355818196Snathanw.\"    the first lines of this file unmodified other than the possible
3455818196Snathanw.\"    addition of one or more copyright notices.
3555818196Snathanw.\" 2. Redistributions in binary form must reproduce the above copyright
3655818196Snathanw.\"    notice(s), this list of conditions and the following disclaimer in
3755818196Snathanw.\"    the documentation and/or other materials provided with the
3855818196Snathanw.\"    distribution.
3955818196Snathanw.\"
4055818196Snathanw.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
4155818196Snathanw.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4255818196Snathanw.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
4355818196Snathanw.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
4455818196Snathanw.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
4555818196Snathanw.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
4655818196Snathanw.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
4755818196Snathanw.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
4855818196Snathanw.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
4955818196Snathanw.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
5055818196Snathanw.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5155818196Snathanw.\"
5255818196Snathanw.\" $FreeBSD: src/lib/libpthread/man/pthread_kill.3,v 1.9 2002/09/16 19:29:28 mini Exp $
53*9c4ae7f5Sjruoho.Dd July 9, 2010
5455818196Snathanw.Dt PTHREAD_KILL 3
5555818196Snathanw.Os
5655818196Snathanw.Sh NAME
5755818196Snathanw.Nm pthread_kill
5855818196Snathanw.Nd send a signal to a specified thread
5955818196Snathanw.Sh LIBRARY
6055818196Snathanw.Lb libpthread
6155818196Snathanw.Sh SYNOPSIS
6255818196Snathanw.In pthread.h
6355818196Snathanw.In signal.h
6455818196Snathanw.Ft int
6555818196Snathanw.Fn pthread_kill "pthread_t thread" "int sig"
6655818196Snathanw.Sh DESCRIPTION
6755818196SnathanwThe
6855818196Snathanw.Fn pthread_kill
6955818196Snathanwfunction sends a signal, specified by
7055818196Snathanw.Fa sig ,
7155818196Snathanwto a thread, specified by
7255818196Snathanw.Fa thread .
7355818196SnathanwThe signal will be handled in the context of
7455818196Snathanw.Fa thread ,
7555818196Snathanwbut the signal action may alter the process as a whole.
7655818196SnathanwIf
7755818196Snathanw.Fa sig
7855818196Snathanwis 0, error checking is performed, but no signal is actually sent.
7955818196Snathanw.Sh RETURN VALUES
8055818196SnathanwIf successful,
8155818196Snathanw.Fn pthread_kill
8255818196Snathanwreturns 0.
8355818196SnathanwOtherwise, an error number is returned.
8455818196Snathanw.Sh ERRORS
8555818196Snathanw.Fn pthread_kill
8655818196Snathanwshall fail if:
8755818196Snathanw.Bl -tag -width Er
8855818196Snathanw.It Bq Er EINVAL
8955818196Snathanw.Fa sig
9055818196Snathanwis an invalid or unsupported signal number.
9159046993Swiz.It Bq Er ESRCH
9259046993Swiz.Fa thread
9359046993Swizis an invalid thread ID.
9455818196Snathanw.El
9555818196Snathanw.Sh SEE ALSO
9655818196Snathanw.Xr kill 2 ,
97bc81ecacSwiz.Xr sigwait 2 ,
9855818196Snathanw.Xr pthread_self 3 ,
99bc81ecacSwiz.Xr raise 3
10055818196Snathanw.Sh STANDARDS
101*9c4ae7f5SjruohoThe function conforms to
102*9c4ae7f5Sjruoho.St -p1003.1-2001 .
103