]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_sigqueue.3
getpt.3: tfix
[thirdparty/man-pages.git] / man3 / pthread_sigqueue.3
CommitLineData
d56af11b
MK
1.\" Copyright (c) 2010 Michael Kerrisk, <mtk.manpages@gmail.com>
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
d56af11b
MK
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.
4b72fb64 23.\" %%%LICENSE_END
d56af11b 24.\"
4b8c67d9 25.TH PTHREAD_SIGQUEUE 3 2017-09-15 "Linux" "Linux Programmer's Manual"
d56af11b
MK
26.SH NAME
27pthread_sigqueue \- queue a signal and data to a thread
28.SH SYNOPSIS
29.nf
d795791f 30.B #include <signal.h>
d56af11b 31.B #include <pthread.h>
f90f031e 32.PP
464e572e 33.BI "int pthread_sigqueue(pthread_t " thread ", int " sig ,
d56af11b
MK
34.BI " const union sigval " value );
35.fi
68e4db0a 36.PP
d56af11b 37Compile and link with \fI\-pthread\fP.
68e4db0a 38.PP
d56af11b
MK
39.in -4n
40Feature Test Macro Requirements for glibc (see
41.BR feature_test_macros (7)):
42.in
68e4db0a 43.PP
d56af11b
MK
44.BR pthread_sigqueue ():
45_GNU_SOURCE
46.SH DESCRIPTION
47The
48.BR pthread_sigqueue ()
49function performs a similar task to
485ab701 50.BR sigqueue (3),
34ef249e
MK
51but, rather than sending a signal to a process,
52it sends a signal to a thread in the same process as the
d56af11b 53calling thread.
847e0d88 54.PP
d56af11b
MK
55The
56.I thread
34ef249e 57argument is the ID of a thread in the same process as the caller.
d56af11b
MK
58The
59.I sig
60argument specifies the signal to be sent.
61The
62.I value
63argument specifies data to accompany the signal; see
485ab701 64.BR sigqueue (3)
d56af11b
MK
65for details.
66.SH RETURN VALUE
67On success,
515bca40 68.BR pthread_sigqueue ()
d56af11b
MK
69returns 0;
70on error, it returns an error number.
71.SH ERRORS
72.TP
73.B EAGAIN
74The limit of signals which may be queued has been reached.
75(See
76.BR signal (7)
77for further information.)
78.TP
79.B EINVAL
80.I sig
81was invalid.
82.TP
83.B ENOSYS
84.BR pthread_sigqueue ()
85is not supported on this system.
86.TP
87.B ESRCH
88.I thread
89is not valid.
90.SH VERSIONS
91The
92.BR pthread_sigqueue ()
93function first appeared in glibc 2.11.
6328c024 94.SH ATTRIBUTES
4ef47cbb
PH
95For an explanation of the terms used in this section, see
96.BR attributes (7).
97.TS
98allbox;
99lb lb lb
100l l l.
101Interface Attribute Value
102T{
6328c024 103.BR pthread_sigqueue ()
4ef47cbb
PH
104T} Thread safety MT-Safe
105.TE
d56af11b
MK
106.SH CONFORMING TO
107This function is a GNU extension.
59526510
MK
108.SH NOTES
109The glibc implementation of
110.BR pthread_sigqueue ()
111gives an error
112.RB ( EINVAL )
113on attempts to send either of the real-time signals
114used internally by the NPTL threading implementation.
115See
116.BR nptl (7)
117for details.
d56af11b 118.SH SEE ALSO
1770a4b9 119.BR rt_tgsigqueueinfo (2),
d56af11b 120.BR sigaction (2),
2bfa8272 121.BR pthread_sigmask (3),
485ab701 122.BR sigqueue (3),
7205993b 123.BR sigwait (3),
d56af11b 124.BR pthreads (7),
356df505 125.BR signal (7)