OSDN Git Service

(split) LDP: Update original to LDP v3.65
[linuxjm/LDP_man-pages.git] / original / man3 / pthread_kill.3
index 674168f..b472fac 100644 (file)
@@ -23,7 +23,7 @@
 .\" 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
@@ -34,6 +34,18 @@ pthread_kill \- send a signal to a thread
 .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 ()
@@ -47,8 +59,7 @@ The signal is asynchronously directed to
 
 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 ()
@@ -58,13 +69,8 @@ on error, it returns an error number, and no signal is sent.
 .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,
@@ -72,6 +78,19 @@ the handler will be invoked in the thread
 .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),
@@ -81,3 +100,11 @@ this action will affect the whole process.
 .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/.