sigqueue(2P4)
NAME
sigqueue − queue a signal to a process
SYNOPSIS
#include <sys/types.h>
#include <sys/signal.h>
int sigqueue(pid, signo, value)
pid_t pid;
int signo;
const union sigval value;
DESCRIPTION
The sigqueue function causes the signal specified by signo to be sent with the value specified by value to the process specified by pid. If signo is zero (the null signal), error checking is performed but no signal is actually sent. The null signal can be used to check the validity of pid.
The real or effective user ID of the sending process must match the real or effective user ID of the receiving process, unless the effective user ID of the sending process is super-user, or sig is SIGCONT and the sending process has the same session ID as the receiving process.
If the signal specified in signo is currently blocked for the receiving process, sigqueue returns immediately and the signal is left pending and queued, if resources were available to queue the signal.
If the value of pid causes signo to be generated for the sending process, and if signo is not blocked, either signo or at least one pending unblocked signal will be delivered to the sending process before the sigqueue function returns.
The value is available to the receiving process if the receiving process has defined a signal-catching function for that signal and used the SA_SIGINFO flag with sigaction(2). The value is presented in the si_value of the siginfo_t argument to the signal-catching function. The si_code value presented to the signal-catching function will be SI_QUEUE.
RETURN VALUE
Upon successful completion, the sigqueue function returns a value of 0 indicating that the specified signal has been queued. Otherwise a value of −1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occur, the sigqueue function will return −1 and set errno to the corresponding value:
EAGAIN No resources available to queue the signal.
EINVAL The value of the sig argument is an invalid or unsupported signal number.
EPERM The user ID of the sending process is not super-user, and its real or effective user ID does not match the real or effective user ID of the receiving process, and the calling process is not sending SIGCONT to a process that shares the same session.
ESRCH The process pid does not exist.
FILES
Use of this function requires that the library /usr/lib/libposix4.a be linked with the application.
SEE ALSO
kill(2), killpg(2), sigaction(2), signal(5).
kill(1) in the CX/UX User’s Reference Manual.
WARNING
The interface to sigqueue is based on IEEE Draft Standard P1003.4/D12. This is an unapproved draft, subject to change. Use of information contained in this unapproved draft is at your own risk. This interface will change to reflect any changes made by future drafts of POSIX 1003.4.
CX/UX Programmer’s Reference Manual