1PTHREAD_KILL(3P)           POSIX Programmer's Manual          PTHREAD_KILL(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       pthread_kill — send a signal to a thread
14

SYNOPSIS

16       #include <signal.h>
17
18       int pthread_kill(pthread_t thread, int sig);
19

DESCRIPTION

21       The pthread_kill() function shall request that a signal be delivered to
22       the specified thread.
23
24       As  in kill(), if sig is zero, error checking shall be performed but no
25       signal shall actually be sent.
26

RETURN VALUE

28       Upon successful completion, the function shall return a value of  zero.
29       Otherwise,   the   function  shall  return  an  error  number.  If  the
30       pthread_kill() function fails, no signal shall be sent.
31

ERRORS

33       The pthread_kill() function shall fail if:
34
35       EINVAL The value of the sig argument is an invalid or unsupported  sig‐
36              nal number.
37
38       The pthread_kill() function shall not return an error code of [EINTR].
39
40       The following sections are informative.
41

EXAMPLES

43       None.
44

APPLICATION USAGE

46       The  pthread_kill()  function  provides  a mechanism for asynchronously
47       directing a signal at a thread in the calling process.  This  could  be
48       used, for example, by one thread to affect broadcast delivery of a sig‐
49       nal to a set of threads.
50
51       Note that pthread_kill() only causes the signal to be  handled  in  the
52       context  of  the  given thread; the signal action (termination or stop‐
53       ping) affects the process as a whole.
54

RATIONALE

56       If an implementation detects use of a thread ID after the  end  of  its
57       lifetime, it is recommended that the function should fail and report an
58       [ESRCH] error.
59

FUTURE DIRECTIONS

61       None.
62

SEE ALSO

64       kill(), pthread_self(), raise()
65
66       The Base Definitions volume of POSIX.1‐2008, <signal.h>
67
69       Portions of this text are reprinted and reproduced in  electronic  form
70       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
71       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
72       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
73       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
74       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
75       event of any discrepancy between this version and the original IEEE and
76       The  Open Group Standard, the original IEEE and The Open Group Standard
77       is the referee document. The original Standard can be  obtained  online
78       at http://www.unix.org/online.html .
79
80       Any  typographical  or  formatting  errors that appear in this page are
81       most likely to have been introduced during the conversion of the source
82       files  to  man page format. To report such errors, see https://www.ker
83       nel.org/doc/man-pages/reporting_bugs.html .
84
85
86
87IEEE/The Open Group                  2013                     PTHREAD_KILL(3P)
Impressum