mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / pthread_sigqueue.3
blob3bf6f030dc2e21efba8309ae39ea36d4d458f2b0
1 .\" Copyright (c) 2010 Michael Kerrisk, <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH PTHREAD_SIGQUEUE 3 2021-03-22 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 pthread_sigqueue \- queue a signal and data to a thread
28 .SH SYNOPSIS
29 .nf
30 .B #include <signal.h>
31 .B #include <pthread.h>
32 .PP
33 .BI "int pthread_sigqueue(pthread_t " thread ", int " sig ,
34 .BI "                     const union sigval " value );
35 .fi
36 .PP
37 Compile and link with \fI\-pthread\fP.
38 .PP
39 .RS -4
40 Feature Test Macro Requirements for glibc (see
41 .BR feature_test_macros (7)):
42 .RE
43 .PP
44 .BR pthread_sigqueue ():
45 .nf
46     _GNU_SOURCE
47 .fi
48 .SH DESCRIPTION
49 The
50 .BR pthread_sigqueue ()
51 function performs a similar task to
52 .BR sigqueue (3),
53 but, rather than sending a signal to a process,
54 it sends a signal to a thread in the same process as the
55 calling thread.
56 .PP
57 The
58 .I thread
59 argument is the ID of a thread in the same process as the caller.
60 The
61 .I sig
62 argument specifies the signal to be sent.
63 The
64 .I value
65 argument specifies data to accompany the signal; see
66 .BR sigqueue (3)
67 for details.
68 .SH RETURN VALUE
69 On success,
70 .BR pthread_sigqueue ()
71 returns 0;
72 on error, it returns an error number.
73 .SH ERRORS
74 .TP
75 .B EAGAIN
76 The limit of signals which may be queued has been reached.
77 (See
78 .BR signal (7)
79 for further information.)
80 .TP
81 .B EINVAL
82 .I sig
83 was invalid.
84 .TP
85 .B ENOSYS
86 .BR pthread_sigqueue ()
87 is not supported on this system.
88 .TP
89 .B ESRCH
90 .I thread
91 is not valid.
92 .SH VERSIONS
93 The
94 .BR pthread_sigqueue ()
95 function first appeared in glibc 2.11.
96 .SH ATTRIBUTES
97 For an explanation of the terms used in this section, see
98 .BR attributes (7).
99 .ad l
102 allbox;
103 lbx lb lb
104 l l l.
105 Interface       Attribute       Value
107 .BR pthread_sigqueue ()
108 T}      Thread safety   MT-Safe
112 .sp 1
113 .SH CONFORMING TO
114 This function is a GNU extension.
115 .SH NOTES
116 The glibc implementation of
117 .BR pthread_sigqueue ()
118 gives an error
119 .RB ( EINVAL )
120 on attempts to send either of the real-time signals
121 used internally by the NPTL threading implementation.
123 .BR nptl (7)
124 for details.
125 .SH SEE ALSO
126 .BR rt_tgsigqueueinfo (2),
127 .BR sigaction (2),
128 .BR pthread_sigmask (3),
129 .BR sigqueue (3),
130 .BR sigwait (3),
131 .BR pthreads (7),
132 .BR signal (7)