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