xref: /minix3/lib/libc/sys/sigqueue.2 (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc.\" $NetBSD: sigqueue.2,v 1.3 2013/02/14 09:31:48 wiz Exp $
22fe8fb19SBen Gras.\" Copyright (c) 2005 David Xu <davidxu@FreeBSD.org>
32fe8fb19SBen Gras.\" All rights reserved.
42fe8fb19SBen Gras.\"
52fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without
62fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions
72fe8fb19SBen Gras.\" are met:
82fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright
92fe8fb19SBen Gras.\"    notice(s), this list of conditions and the following disclaimer as
102fe8fb19SBen Gras.\"    the first lines of this file unmodified other than the possible
112fe8fb19SBen Gras.\"    addition of one or more copyright notices.
122fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright
132fe8fb19SBen Gras.\"    notice(s), this list of conditions and the following disclaimer in
142fe8fb19SBen Gras.\"    the documentation and/or other materials provided with the
152fe8fb19SBen Gras.\"    distribution.
162fe8fb19SBen Gras.\"
172fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
182fe8fb19SBen Gras.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
192fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
202fe8fb19SBen Gras.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
212fe8fb19SBen Gras.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
222fe8fb19SBen Gras.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
232fe8fb19SBen Gras.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
242fe8fb19SBen Gras.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
252fe8fb19SBen Gras.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
262fe8fb19SBen Gras.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
272fe8fb19SBen Gras.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282fe8fb19SBen Gras.\"
292fe8fb19SBen Gras.\" $FreeBSD: src/lib/libc/sys/sigqueue.2,v 1.8 2006/09/17 21:27:34 ru Exp $
302fe8fb19SBen Gras.\"
312fe8fb19SBen Gras.Dd January 9, 2011
322fe8fb19SBen Gras.Dt SIGQUEUE 2
332fe8fb19SBen Gras.Os
342fe8fb19SBen Gras.Sh NAME
352fe8fb19SBen Gras.Nm sigqueue
362fe8fb19SBen Gras.Nd queue a signal to a process (REALTIME)
372fe8fb19SBen Gras.Sh LIBRARY
382fe8fb19SBen Gras.Lb libc
392fe8fb19SBen Gras.Sh SYNOPSIS
402fe8fb19SBen Gras.In signal.h
412fe8fb19SBen Gras.Ft int
422fe8fb19SBen Gras.Fn sigqueue "pid_t pid" "int signo" "const union sigval value"
432fe8fb19SBen Gras.Ft int
442fe8fb19SBen Gras.Fn sigqueueinfo "pid_t pid" "const siginfo_t *info"
452fe8fb19SBen Gras.Sh DESCRIPTION
462fe8fb19SBen GrasThe
472fe8fb19SBen Gras.Fn sigqueue
482fe8fb19SBen Grassystem call causes the signal specified by
492fe8fb19SBen Gras.Fa signo
502fe8fb19SBen Grasto be sent with the value specified by
512fe8fb19SBen Gras.Fa value
522fe8fb19SBen Grasto the process specified by
532fe8fb19SBen Gras.Fa pid .
542fe8fb19SBen GrasIf
552fe8fb19SBen Gras.Fa signo
562fe8fb19SBen Grasis zero (the null signal), error checking is performed but
572fe8fb19SBen Grasno signal is actually sent.
582fe8fb19SBen GrasThe null signal can be used to check the
592fe8fb19SBen Grasvalidity of PID.
602fe8fb19SBen Gras.Pp
612fe8fb19SBen GrasThe conditions required for a process to have permission to queue a
622fe8fb19SBen Grassignal to another process are the same as for the
632fe8fb19SBen Gras.Xr kill 2
642fe8fb19SBen Grassystem call.
652fe8fb19SBen GrasThe
662fe8fb19SBen Gras.Fn sigqueue
672fe8fb19SBen Grassystem call queues a signal to a single process specified by the
682fe8fb19SBen Gras.Fa pid
692fe8fb19SBen Grasargument.
702fe8fb19SBen Gras.Pp
712fe8fb19SBen GrasThe
722fe8fb19SBen Gras.Fn sigqueue
732fe8fb19SBen Grassystem call is implemented using
742fe8fb19SBen Gras.Fn sigqueueinfo
752fe8fb19SBen Grasand passing the appropriate information in the
762fe8fb19SBen Gras.Fa info
772fe8fb19SBen Grasargument.
782fe8fb19SBen Gras.Pp
792fe8fb19SBen GrasThe
802fe8fb19SBen Gras.Fn sigqueue
812fe8fb19SBen Grassystem call returns immediately.
822fe8fb19SBen GrasIf the resources were
832fe8fb19SBen Grasavailable to queue the signal, the signal will be queued and sent to
842fe8fb19SBen Grasthe receiving process.
852fe8fb19SBen Gras.Pp
862fe8fb19SBen GrasIf the value of
872fe8fb19SBen Gras.Fa pid
882fe8fb19SBen Grascauses
892fe8fb19SBen Gras.Fa signo
902fe8fb19SBen Grasto be generated for the sending process, and if
912fe8fb19SBen Gras.Fa signo
922fe8fb19SBen Grasis not blocked for the calling thread and if no other thread has
932fe8fb19SBen Gras.Fa signo
942fe8fb19SBen Grasunblocked or is waiting in a
952fe8fb19SBen Gras.Fn sigwait
962fe8fb19SBen Grassystem call for
972fe8fb19SBen Gras.Fa signo ,
982fe8fb19SBen Graseither
992fe8fb19SBen Gras.Fa signo
1002fe8fb19SBen Grasor at least the pending, unblocked signal will be delivered to the
1012fe8fb19SBen Grascalling thread before
1022fe8fb19SBen Gras.Fn sigqueue
1032fe8fb19SBen Grasreturns.
1042fe8fb19SBen GrasShould any multiple pending signals in the range
1052fe8fb19SBen Gras.Dv SIGRTMIN
1062fe8fb19SBen Grasto
1072fe8fb19SBen Gras.Dv SIGRTMAX
1082fe8fb19SBen Grasbe selected for delivery, it is the lowest numbered
1092fe8fb19SBen Grasone.
1102fe8fb19SBen GrasThe selection order between realtime and non-realtime signals, or
1112fe8fb19SBen Grasbetween multiple pending non-realtime signals, is unspecified.
1122fe8fb19SBen Gras.Sh RETURN VALUES
1132fe8fb19SBen Gras.Rv -std
1142fe8fb19SBen Gras.Sh ERRORS
1152fe8fb19SBen GrasThe
1162fe8fb19SBen Gras.Fn sigqueue
1172fe8fb19SBen Grassystem call
1182fe8fb19SBen Graswill fail if:
1192fe8fb19SBen Gras.Bl -tag -width Er
1202fe8fb19SBen Gras.It Bq Er EAGAIN
1212fe8fb19SBen GrasNo resources are available to queue the signal.
1222fe8fb19SBen GrasThe process has already queued
1232fe8fb19SBen Gras.Brq Dv SIGQUEUE_MAX
1242fe8fb19SBen Grassignals that are still pending at the receiver(s),
1252fe8fb19SBen Grasor a system-wide resource limit has been exceeded.
1262fe8fb19SBen Gras.It Bq Er EINVAL
1272fe8fb19SBen GrasThe value of the
1282fe8fb19SBen Gras.Fa signo
1292fe8fb19SBen Grasargument is an invalid or unsupported signal number.
130*84d9c625SLionel Sambuc.It Bq Er EPERM
131*84d9c625SLionel SambucThe process does not have the appropriate privilege to send the signal
132*84d9c625SLionel Sambucto the receiving process.
1332fe8fb19SBen Gras.It Bq Er ESRCH
1342fe8fb19SBen GrasThe process
1352fe8fb19SBen Gras.Fa pid
1362fe8fb19SBen Grasdoes not exist.
1372fe8fb19SBen Gras.El
1382fe8fb19SBen Gras.Sh SEE ALSO
1392fe8fb19SBen Gras.Xr sigaction 2 ,
1402fe8fb19SBen Gras.Xr siginfo 2 ,
1412fe8fb19SBen Gras.Xr sigpending 2 ,
1422fe8fb19SBen Gras.Xr sigsuspend 2 ,
1432fe8fb19SBen Gras.Xr sigtimedwait 2 ,
1442fe8fb19SBen Gras.Xr sigwait 2 ,
1452fe8fb19SBen Gras.Xr sigwaitinfo 2 ,
1462fe8fb19SBen Gras.Xr pause 3 ,
1472fe8fb19SBen Gras.Xr pthread_sigmask 3
1482fe8fb19SBen Gras.Sh STANDARDS
1492fe8fb19SBen GrasThe
1502fe8fb19SBen Gras.Fn sigqueue
1512fe8fb19SBen Grassystem call conforms to
1522fe8fb19SBen Gras.St -p1003.1-2004 .
1532fe8fb19SBen Gras.Sh HISTORY
1542fe8fb19SBen GrasSupport for
1552fe8fb19SBen Gras.Tn POSIX
1562fe8fb19SBen Grasrealtime signal queue first appeared in
1572fe8fb19SBen Gras.Nx 6.0 .
158