1SIGQUEUE(3)                Linux Programmer's Manual               SIGQUEUE(3)
2
3
4

NAME

6       sigqueue - queue a signal and data to a process
7

SYNOPSIS

9       #include <signal.h>
10
11       int sigqueue(pid_t pid, int sig, const union sigval value);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       sigqueue(): _POSIX_C_SOURCE >= 199309L
16

DESCRIPTION

18       sigqueue()  sends  the signal specified in sig to the process whose PID
19       is given in pid.  The permissions required to send  a  signal  are  the
20       same  as for kill(2).  As with kill(2), the null signal (0) can be used
21       to check if a process with a given PID exists.
22
23       The value argument is used to specify an accompanying item of data (ei‐
24       ther an integer or a pointer value) to be sent with the signal, and has
25       the following type:
26
27           union sigval {
28               int   sival_int;
29               void *sival_ptr;
30           };
31
32       If the receiving process has installed a handler for this signal  using
33       the  SA_SIGINFO  flag to sigaction(2), then it can obtain this data via
34       the si_value field of the siginfo_t structure passed as the second  ar‐
35       gument  to  the handler.  Furthermore, the si_code field of that struc‐
36       ture will be set to SI_QUEUE.
37

RETURN VALUE

39       On success, sigqueue() returns 0, indicating that the signal  was  suc‐
40       cessfully  queued  to the receiving process.  Otherwise, -1 is returned
41       and errno is set to indicate the error.
42

ERRORS

44       EAGAIN The limit of signals which may be queued has been reached.  (See
45              signal(7) for further information.)
46
47       EINVAL sig was invalid.
48
49       EPERM  The  process  does not have permission to send the signal to the
50              receiving process.  For the required permissions, see kill(2).
51
52       ESRCH  No process has a PID matching pid.
53

VERSIONS

55       sigqueue() and the underlying rt_sigqueueinfo() system call  first  ap‐
56       peared in Linux 2.2.
57

ATTRIBUTES

59       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
60       tributes(7).
61
62       ┌───────────┬───────────────┬─────────┐
63Interface  Attribute     Value   
64       ├───────────┼───────────────┼─────────┤
65sigqueue() │ Thread safety │ MT-Safe │
66       └───────────┴───────────────┴─────────┘

CONFORMING TO

68       POSIX.1-2001, POSIX.1-2008.
69

NOTES

71       If this function results in the sending of a signal to the process that
72       invoked  it, and that signal was not blocked by the calling thread, and
73       no other threads