1 .\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" added note on self-signaling, aeb, 2002-06-07
26 .\" added note on CAP_KILL, mtk, 2004-06-16
28 .TH SIGQUEUE 3 2021-03-22 "Linux" "Linux Programmer's Manual"
30 sigqueue \- queue a signal and data to a process
33 .B #include <signal.h>
35 .BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value );
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
45 _POSIX_C_SOURCE >= 199309L
49 sends the signal specified in
51 to the process whose PID is given in
53 The permissions required to send a signal are the same as for
57 the null signal (0) can be used to check if a process with a given
62 argument is used to specify an accompanying item of data (either an integer
63 or a pointer value) to be sent with the signal, and has the following type:
74 If the receiving process has installed a handler for this signal using the
78 then it can obtain this data via the
82 structure passed as the second argument to the handler.
85 field of that structure will be set to
90 returns 0, indicating that the signal was successfully
91 queued to the receiving process.
92 Otherwise, \-1 is returned and
94 is set to indicate the error.
98 The limit of signals which may be queued has been reached.
101 for further information.)
108 The process does not have permission to send the signal
109 to the receiving process.
110 For the required permissions, see
114 No process has a PID matching
119 .BR rt_sigqueueinfo (2)
120 system call first appeared in Linux 2.2.
122 For an explanation of the terms used in this section, see
130 Interface Attribute Value
133 T} Thread safety MT-Safe
139 POSIX.1-2001, POSIX.1-2008.
141 If this function results in the sending of a signal to the process
142 that invoked it, and that signal was not blocked by the calling thread,
143 and no other threads were willing to handle this signal (either by
144 having it unblocked, or by waiting for it using
146 then at least some signal must be delivered to this thread before this
148 .SS C library/kernel differences
151 is implemented using the
152 .BR rt_sigqueueinfo (2)
154 The system call differs in its third argument, which is the
156 structure that will be supplied to the receiving process's
157 signal handler or returned by the receiving process's
162 wrapper, this argument,
164 is initialized as follows:
168 uinfo.si_signo = sig; /* Argument supplied to sigqueue() */
169 uinfo.si_code = SI_QUEUE;
170 uinfo.si_pid = getpid(); /* Process ID of sender */
171 uinfo.si_uid = getuid(); /* Real UID of sender */
172 uinfo.si_value = val; /* Argument supplied to sigqueue() */
177 .BR rt_sigqueueinfo (2),
180 .BR pthread_sigqueue (3),