aboutsummaryrefslogtreecommitdiffstats
path: root/man/man3/pthread_kill.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-04-26 15:06:49 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-02 01:24:19 +0200
commitdcde2f70372b49ec43efc5db864c9ff585d0a2dd (patch)
tree78b9b7425130e4a5858e4c01a524d802423879ed /man/man3/pthread_kill.3
parent12aca537ce78a41bbcdaf485209691e10f8002d7 (diff)
downloadman-pages-dcde2f70372b49ec43efc5db864c9ff585d0a2dd.tar.gz
man/, share/mk/: Move man*/ to man/
This is a scripted change: $ mkdir man/; $ mv man* man/; $ ln -st . man/man*; $ find share/mk/ -type f \ | xargs grep -l '^MANDIR *:=' \ | xargs sed -i '/^MANDIR *:=/s,$,/man,'; $ find share/mk/dist/ -type f \ | xargs grep -l man \ | xargs sed -i 's,man%,man/%,g'; Link: <https://lore.kernel.org/linux-man/YxcV4h+Xn7cd6+q2@pevik/T/> Cc: Petr Vorel <pvorel@suse.cz> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man3/pthread_kill.3')
-rw-r--r--man/man3/pthread_kill.3108
1 files changed, 108 insertions, 0 deletions
diff --git a/man/man3/pthread_kill.3 b/man/man3/pthread_kill.3
new file mode 100644
index 0000000000..5f158293e4
--- /dev/null
+++ b/man/man3/pthread_kill.3
@@ -0,0 +1,108 @@
+'\" t
+.\" Copyright (c) 2009 Linux Foundation, written by Michael Kerrisk
+.\" <mtk.manpages@gmail.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH pthread_kill 3 (date) "Linux man-pages (unreleased)"
+.SH NAME
+pthread_kill \- send a signal to a thread
+.SH LIBRARY
+POSIX threads library
+.RI ( libpthread ", " \-lpthread )
+.SH SYNOPSIS
+.nf
+.B #include <signal.h>
+.P
+.BI "int pthread_kill(pthread_t " thread ", int " sig );
+.fi
+.P
+.RS -4
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.RE
+.P
+.BR pthread_kill ():
+.nf
+ _POSIX_C_SOURCE >= 199506L || _XOPEN_SOURCE >= 500
+.fi
+.SH DESCRIPTION
+The
+.BR pthread_kill ()
+function sends the signal
+.I sig
+to
+.IR thread ,
+a thread in the same process as the caller.
+The signal is asynchronously directed to
+.IR thread .
+.P
+If
+.I sig
+is 0, then no signal is sent, but error checking is still performed.
+.SH RETURN VALUE
+On success,
+.BR pthread_kill ()
+returns 0;
+on error, it returns an error number, and no signal is sent.
+.SH ERRORS
+.TP
+.B EINVAL
+An invalid signal was specified.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR pthread_kill ()
+T} Thread safety MT-Safe
+.TE
+.SH VERSIONS
+The glibc implementation of
+.BR pthread_kill ()
+gives an error
+.RB ( EINVAL )
+on attempts to send either of the real-time signals
+used internally by the NPTL threading implementation.
+See
+.BR nptl (7)
+for details.
+.P
+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 STANDARDS
+POSIX.1-2008.
+.SH HISTORY
+POSIX.1-2001.
+.SH NOTES
+Signal dispositions are process-wide:
+if a signal handler is installed,
+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.
+.SH SEE ALSO
+.BR kill (2),
+.BR sigaction (2),
+.BR sigpending (2),
+.BR pthread_self (3),
+.BR pthread_sigmask (3),
+.BR raise (3),
+.BR pthreads (7),
+.BR signal (7)