.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH PTHREAD_KILL 3 2012-08-19 "Linux" "Linux Programmer's Manual"
+.TH PTHREAD_KILL 3 2014-02-04 "Linux" "Linux Programmer's Manual"
.SH NAME
pthread_kill \- send a signal to a thread
.SH SYNOPSIS
.fi
.sp
Compile and link with \fI\-pthread\fP.
+.sp
+.in -4n
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.in
+.sp
+.ad l
+.BR pthread_kill ():
+.RS 4
+_POSIX_C_SOURCE\ >=\ 199506L || _XOPEN_SOURCE\ >=\ 500
+.RE
+.ad b
.SH DESCRIPTION
The
.BR pthread_kill ()
If
.I sig
-is 0, then no signal is sent, but error checking is still performed;
-this can be used to check for the existence of a thread ID.
+is 0, then no signal is sent, but error checking is still performed.
.SH RETURN VALUE
On success,
.BR pthread_kill ()
.TP
.B EINVAL
An invalid signal was specified.
-.TP
-.B ESRCH
-No thread with the ID
-.I thread
-could be found.
.SH CONFORMING TO
-POSIX.1-2001.
+POSIX.1-2008.
.SH NOTES
Signal dispositions are process-wide:
if a signal handler is installed,
.IR thread ,
but if the disposition of the signal is "stop", "continue", or "terminate",
this action will affect the whole process.
+
+POSIX.1-2008 recommends that if an implementation detects the use
+of a thread ID after the end of its lifetime,
+.BR pthread_kill ()
+should return the error
+.BR ESRCH .
+The glibc implementation returns this error in the cases where
+an invalid thread ID can be detected.
+But note also that POSIX says that an attempt to use a thread ID whose
+lifetime has ended produces undefined behavior,
+and an attempt to use an invalid thread ID in a call to
+.BR pthread_kill ()
+can, for example, cause a segmentation fault.
.SH SEE ALSO
.BR kill (2),
.BR sigaction (2),
.BR raise (3),
.BR pthreads (7),
.BR signal (7)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.