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 2013-12-16 "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
113 This system call first appeared in Linux 2.2.
115 .SS Multithreading (see pthreads(7))
118 function is thread-safe.
122 If this function results in the sending of a signal to the process
123 that invoked it, and that signal was not blocked by the calling thread,
124 and no other threads were willing to handle this signal (either by
125 having it unblocked, or by waiting for it using
127 then at least some signal must be delivered to this thread before this
130 On Linux, this function is implemented using the
131 .BR rt_sigqueueinfo (2)
133 The system call differs in its third argument, which is the
135 structure that will be supplied to the receiving process's
136 signal handler or returned by the receiving process's
141 wrapper, this argument,
143 is initialized as follows:
147 uinfo.si_signo = sig; /* Argument supplied to sigqueue() */
148 uinfo.si_code = SI_QUEUE;
149 uinfo.si_pid = getpid(); /* Process ID of sender */
150 uinfo.si_uid = getuid(); /* Real UID of sender */
151 uinfo.si_value = val; /* Argument supplied to sigqueue() */
156 .BR rt_sigqueueinfo (2),
159 .BR pthread_sigqueue (3),