tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / pthread_sigqueue.3
blobb9c80164aca3502c037f9c024ad58d0676316038
1 '\" t
2 .\" Copyright (c) 2010 Michael Kerrisk, <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH pthread_sigqueue 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 pthread_sigqueue \- queue a signal and data to a thread
9 .SH LIBRARY
10 POSIX threads library
11 .RI ( libpthread ", " \-lpthread )
12 .SH SYNOPSIS
13 .nf
14 .B #include <signal.h>
15 .B #include <pthread.h>
16 .PP
17 .BI "int pthread_sigqueue(pthread_t " thread ", int " sig ,
18 .BI "                     const union sigval " value );
19 .fi
20 .PP
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .PP
26 .BR pthread_sigqueue ():
27 .nf
28     _GNU_SOURCE
29 .fi
30 .SH DESCRIPTION
31 The
32 .BR pthread_sigqueue ()
33 function performs a similar task to
34 .BR sigqueue (3),
35 but, rather than sending a signal to a process,
36 it sends a signal to a thread in the same process as the
37 calling thread.
38 .PP
39 The
40 .I thread
41 argument is the ID of a thread in the same process as the caller.
42 The
43 .I sig
44 argument specifies the signal to be sent.
45 The
46 .I value
47 argument specifies data to accompany the signal; see
48 .BR sigqueue (3)
49 for details.
50 .SH RETURN VALUE
51 On success,
52 .BR pthread_sigqueue ()
53 returns 0;
54 on error, it returns an error number.
55 .SH ERRORS
56 .TP
57 .B EAGAIN
58 The limit of signals which may be queued has been reached.
59 (See
60 .BR signal (7)
61 for further information.)
62 .TP
63 .B EINVAL
64 .I sig
65 was invalid.
66 .TP
67 .B ENOSYS
68 .BR pthread_sigqueue ()
69 is not supported on this system.
70 .TP
71 .B ESRCH
72 .I thread
73 is not valid.
74 .SH VERSIONS
75 The
76 .BR pthread_sigqueue ()
77 function first appeared in glibc 2.11.
78 .SH ATTRIBUTES
79 For an explanation of the terms used in this section, see
80 .BR attributes (7).
81 .ad l
82 .nh
83 .TS
84 allbox;
85 lbx lb lb
86 l l l.
87 Interface       Attribute       Value
89 .BR pthread_sigqueue ()
90 T}      Thread safety   MT-Safe
91 .TE
92 .hy
93 .ad
94 .sp 1
95 .SH STANDARDS
96 This function is a GNU extension.
97 .SH NOTES
98 The glibc implementation of
99 .BR pthread_sigqueue ()
100 gives an error
101 .RB ( EINVAL )
102 on attempts to send either of the real-time signals
103 used internally by the NPTL threading implementation.
105 .BR nptl (7)
106 for details.
107 .SH SEE ALSO
108 .BR rt_tgsigqueueinfo (2),
109 .BR sigaction (2),
110 .BR pthread_sigmask (3),
111 .BR sigqueue (3),
112 .BR sigwait (3),
113 .BR pthreads (7),
114 .BR signal (7)