1SIGQUEUE(2)                Linux Programmer's Manual               SIGQUEUE(2)
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

DESCRIPTION

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

RETURN VALUE

35       On success, sigqueue() returns 0, indicating that the signal  was  suc‐
36       cessfully  queued  to  the receiving process.  Otherwise -1 is returned
37       and errno is set to indicate the error.
38

ERRORS

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

NOTES

51       If this function results in the sending of a signal to the process that
52       invoked  it, and that signal was not blocked by the calling thread, and
53       no other threads were willing to handle this signal (either  by  having
54       it  unblocked,  or  by  waiting for it using sigwait(3)), then at least
55       some signal must be delivered  to  this  thread  before  this  function
56       returns.
57

CONFORMING TO

59       POSIX.1-2001
60

SEE ALSO

62       kill(2), sigaction(2), signal(2), sigwait(3), signal(7)
63
64
65
66Linux 2.6.7                       2004-06-16                       SIGQUEUE(2)
Impressum