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 2017-09-15 "Linux" "Linux Programmer's Manual"
30 sigqueue \- queue a signal and data to a process
32 .B #include <signal.h>
34 .BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value );
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
42 _POSIX_C_SOURCE\ >=\ 199309L
45 sends the signal specified in
47 to the process whose PID is given in
49 The permissions required to send a signal are the same as for
53 the null signal (0) can be used to check if a process with a given
58 argument is used to specify an accompanying item of data (either an integer
59 or a pointer value) to be sent with the signal, and has the following type:
70 If the receiving process has installed a handler for this signal using the
74 then it can obtain this data via the
78 structure passed as the second argument to the handler.
81 field of that structure will be set to
86 returns 0, indicating that the signal was successfully
87 queued to the receiving process.
88 Otherwise, \-1 is returned and
90 is set to indicate the error.
94 The limit of signals which may be queued has been reached.
97 for further information.)
104 The process does not have permission to send the signal
105 to the receiving process.
106 For the required permissions, see
110 No process has a PID matching
115 .BR rt_sigqueueinfo ()
116 system call first appeared in Linux 2.2.
118 For an explanation of the terms used in this section, see
124 Interface Attribute Value
127 T} Thread safety MT-Safe
130 POSIX.1-2001, POSIX.1-2008.
132 If this function results in the sending of a signal to the process
133 that invoked it, and that signal was not blocked by the calling thread,
134 and no other threads were willing to handle this signal (either by
135 having it unblocked, or by waiting for it using
137 then at least some signal must be delivered to this thread before this
139 .SS C library/kernel differences
142 is implemented using the
143 .BR rt_sigqueueinfo (2)
145 The system call differs in its third argument, which is the
147 structure that will be supplied to the receiving process's
148 signal handler or returned by the receiving process's
153 wrapper, this argument,
155 is initialized as follows:
159 uinfo.si_signo = sig; /* Argument supplied to sigqueue() */
160 uinfo.si_code = SI_QUEUE;
161 uinfo.si_pid = getpid(); /* Process ID of sender */
162 uinfo.si_uid = getuid(); /* Real UID of sender */
163 uinfo.si_value = val; /* Argument supplied to sigqueue() */
168 .BR rt_sigqueueinfo (2),
171 .BR pthread_sigqueue (3),