.\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" added note on self-signaling, aeb, 2002-06-07
.\" added note on CAP_KILL, mtk, 2004-06-16
.\"
-.TH SIGQUEUE 3 2012-03-25 "Linux" "Linux Programmer's Manual"
+.TH SIGQUEUE 3 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
sigqueue \- queue a signal and data to a process
.SH SYNOPSIS
.B #include <signal.h>
-.sp
+.PP
.BI "int sigqueue(pid_t " pid ", int " sig ", const union sigval " value );
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.BR sigqueue ():
_POSIX_C_SOURCE\ >=\ 199309L
.SH DESCRIPTION
.I value
argument is used to specify an accompanying item of data (either an integer
or a pointer value) to be sent with the signal, and has the following type:
-.sp
+.PP
.in +4n
-.nf
+.EX
union sigval {
int sival_int;
void *sival_ptr;
};
-.fi
+.EE
.in
-
+.PP
If the receiving process has installed a handler for this signal using the
.B SA_SIGINFO
flag to
.I si_code
field of that structure will be set to
.BR SI_QUEUE .
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success,
.BR sigqueue ()
returns 0, indicating that the signal was successfully
queued to the receiving process.
-Otherwise \-1 is returned and
+Otherwise, \-1 is returned and
.I errno
is set to indicate the error.
.SH ERRORS
No process has a PID matching
.IR pid .
.SH VERSIONS
-This system call first appeared in Linux 2.2.
-.SH "CONFORMING TO"
-POSIX.1-2001.
+.BR sigqueue ()
+and the underlying
+.BR rt_sigqueueinfo ()
+system call first appeared in Linux 2.2.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR sigqueue ()
+T} Thread safety MT-Safe
+.TE
+.SH CONFORMING TO
+POSIX.1-2001, POSIX.1-2008.
.SH NOTES
If this function results in the sending of a signal to the process
that invoked it, and that signal was not blocked by the calling thread,
.BR sigwait (3)),
then at least some signal must be delivered to this thread before this
function returns.
-
-On Linux, this function is implemented using the
+.SS C library/kernel differences
+On Linux,
+.BR sigqueue ()
+is implemented using the
.BR rt_sigqueueinfo (2)
system call.
The system call differs in its third argument, which is the
wrapper, this argument,
.IR uinfo ,
is initialized as follows:
+.PP
.in +4n
-.nf
-
-uinfo.si_signo = sig; /* argument supplied to sigqueue() */
+.EX
+uinfo.si_signo = sig; /* Argument supplied to sigqueue() */
uinfo.si_code = SI_QUEUE;
uinfo.si_pid = getpid(); /* Process ID of sender */
uinfo.si_uid = getuid(); /* Real UID of sender */
-uinfo.si_value = val; /* argument supplied to sigqueue() */
-.fi
+uinfo.si_value = val; /* Argument supplied to sigqueue() */
+.EE
.in
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR kill (2),
.BR rt_sigqueueinfo (2),
.BR sigaction (2),