| @@ -1,159 +1,157 @@ | | | @@ -1,159 +1,157 @@ |
1 | .\" $NetBSD: sigqueue.2,v 1.1 2011/01/10 04:41:27 christos Exp $ | | 1 | .\" $NetBSD: sigqueue.2,v 1.2 2011/01/10 06:26:30 wiz Exp $ |
2 | .\" Copyright (c) 2005 David Xu <davidxu@FreeBSD.org> | | 2 | .\" Copyright (c) 2005 David Xu <davidxu@FreeBSD.org> |
3 | .\" All rights reserved. | | 3 | .\" All rights reserved. |
4 | .\" | | 4 | .\" |
5 | .\" Redistribution and use in source and binary forms, with or without | | 5 | .\" Redistribution and use in source and binary forms, with or without |
6 | .\" modification, are permitted provided that the following conditions | | 6 | .\" modification, are permitted provided that the following conditions |
7 | .\" are met: | | 7 | .\" are met: |
8 | .\" 1. Redistributions of source code must retain the above copyright | | 8 | .\" 1. Redistributions of source code must retain the above copyright |
9 | .\" notice(s), this list of conditions and the following disclaimer as | | 9 | .\" notice(s), this list of conditions and the following disclaimer as |
10 | .\" the first lines of this file unmodified other than the possible | | 10 | .\" the first lines of this file unmodified other than the possible |
11 | .\" addition of one or more copyright notices. | | 11 | .\" addition of one or more copyright notices. |
12 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 12 | .\" 2. Redistributions in binary form must reproduce the above copyright |
13 | .\" notice(s), this list of conditions and the following disclaimer in | | 13 | .\" notice(s), this list of conditions and the following disclaimer in |
14 | .\" the documentation and/or other materials provided with the | | 14 | .\" the documentation and/or other materials provided with the |
15 | .\" distribution. | | 15 | .\" distribution. |
16 | .\" | | 16 | .\" |
17 | .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY | | 17 | .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY |
18 | .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 18 | .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 19 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
20 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE | | 20 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE |
21 | .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 21 | .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
22 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 22 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
23 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | | 23 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
24 | .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | | 24 | .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
25 | .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | | 25 | .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
26 | .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | | 26 | .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
27 | .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 27 | .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | .\" | | 28 | .\" |
29 | .\" $FreeBSD: src/lib/libc/sys/sigqueue.2,v 1.8 2006/09/17 21:27:34 ru Exp $ | | 29 | .\" $FreeBSD: src/lib/libc/sys/sigqueue.2,v 1.8 2006/09/17 21:27:34 ru Exp $ |
30 | .\" | | 30 | .\" |
31 | .Dd January 9, 2011 | | 31 | .Dd January 9, 2011 |
32 | .Dt SIGQUEUE 2 | | 32 | .Dt SIGQUEUE 2 |
33 | .Os | | 33 | .Os |
34 | .Sh NAME | | 34 | .Sh NAME |
35 | .Nm sigqueue | | 35 | .Nm sigqueue |
36 | .Nd "queue a signal to a process (REALTIME)" | | 36 | .Nd queue a signal to a process (REALTIME) |
37 | .Sh LIBRARY | | 37 | .Sh LIBRARY |
38 | .Lb libc | | 38 | .Lb libc |
39 | .Sh SYNOPSIS | | 39 | .Sh SYNOPSIS |
40 | .In signal.h | | 40 | .In signal.h |
41 | .Ft int | | 41 | .Ft int |
42 | .Fn sigqueue "pid_t pid" "int signo" "const union sigval value" | | 42 | .Fn sigqueue "pid_t pid" "int signo" "const union sigval value" |
43 | .Ft int | | 43 | .Ft int |
44 | .Fn sigqueueinfo "pid_t pid" "const siginfo_t *info" | | 44 | .Fn sigqueueinfo "pid_t pid" "const siginfo_t *info" |
45 | .Sh DESCRIPTION | | 45 | .Sh DESCRIPTION |
46 | The | | 46 | The |
47 | .Fn sigqueue | | 47 | .Fn sigqueue |
48 | system call causes the signal specified by | | 48 | system call causes the signal specified by |
49 | .Fa signo | | 49 | .Fa signo |
50 | to be sent with the value specified by | | 50 | to be sent with the value specified by |
51 | .Fa value | | 51 | .Fa value |
52 | to the process specified by | | 52 | to the process specified by |
53 | .Fa pid . | | 53 | .Fa pid . |
54 | If | | 54 | If |
55 | .Fa signo | | 55 | .Fa signo |
56 | is zero (the null signal), error checking is performed but | | 56 | is zero (the null signal), error checking is performed but |
57 | no signal is actually sent. | | 57 | no signal is actually sent. |
58 | The null signal can be used to check the | | 58 | The null signal can be used to check the |
59 | validity of PID. | | 59 | validity of PID. |
60 | .Pp | | 60 | .Pp |
61 | The conditions required for a process to have permission to queue a | | 61 | The conditions required for a process to have permission to queue a |
62 | signal to another process are the same as for the | | 62 | signal to another process are the same as for the |
63 | .Xr kill 2 | | 63 | .Xr kill 2 |
64 | system call. | | 64 | system call. |
65 | The | | 65 | The |
66 | .Fn sigqueue | | 66 | .Fn sigqueue |
67 | system call queues a signal to a single process specified by the | | 67 | system call queues a signal to a single process specified by the |
68 | .Fa pid | | 68 | .Fa pid |
69 | argument. | | 69 | argument. |
70 | .Pp | | 70 | .Pp |
71 | The | | 71 | The |
72 | .Fn sigqueue | | 72 | .Fn sigqueue |
73 | system call is implemented using | | 73 | system call is implemented using |
74 | .Fn sigqueueinfo | | 74 | .Fn sigqueueinfo |
75 | and passing the appropriate information in the | | 75 | and passing the appropriate information in the |
76 | .Fa info | | 76 | .Fa info |
77 | argument. | | 77 | argument. |
78 | .Pp | | 78 | .Pp |
79 | The | | 79 | The |
80 | .Fn sigqueue | | 80 | .Fn sigqueue |
81 | system call returns immediately. | | 81 | system call returns immediately. |
82 | If the resources were | | 82 | If the resources were |
83 | available to queue the signal, the signal will be queued and sent to | | 83 | available to queue the signal, the signal will be queued and sent to |
84 | the receiving process. | | 84 | the receiving process. |
85 | .Pp | | 85 | .Pp |
86 | If the value of | | 86 | If the value of |
87 | .Fa pid | | 87 | .Fa pid |
88 | causes | | 88 | causes |
89 | .Fa signo | | 89 | .Fa signo |
90 | to be generated for the sending process, and if | | 90 | to be generated for the sending process, and if |
91 | .Fa signo | | 91 | .Fa signo |
92 | is not blocked for the calling thread and if no other thread has | | 92 | is not blocked for the calling thread and if no other thread has |
93 | .Fa signo | | 93 | .Fa signo |
94 | unblocked or is waiting in a | | 94 | unblocked or is waiting in a |
95 | .Fn sigwait | | 95 | .Fn sigwait |
96 | system call for | | 96 | system call for |
97 | .Fa signo , | | 97 | .Fa signo , |
98 | either | | 98 | either |
99 | .Fa signo | | 99 | .Fa signo |
100 | or at least the pending, unblocked signal will be delivered to the | | 100 | or at least the pending, unblocked signal will be delivered to the |
101 | calling thread before | | 101 | calling thread before |
102 | .Fn sigqueue | | 102 | .Fn sigqueue |
103 | returns. | | 103 | returns. |
104 | Should any multiple pending signals in the range | | 104 | Should any multiple pending signals in the range |
105 | .Dv SIGRTMIN | | 105 | .Dv SIGRTMIN |
106 | to | | 106 | to |
107 | .Dv SIGRTMAX | | 107 | .Dv SIGRTMAX |
108 | be selected for delivery, it is the lowest numbered | | 108 | be selected for delivery, it is the lowest numbered |
109 | one. | | 109 | one. |
110 | The selection order between realtime and non-realtime signals, or | | 110 | The selection order between realtime and non-realtime signals, or |
111 | between multiple pending non-realtime signals, is unspecified. | | 111 | between multiple pending non-realtime signals, is unspecified. |
112 | .Sh RETURN VALUES | | 112 | .Sh RETURN VALUES |
113 | .Rv -std | | 113 | .Rv -std |
114 | .Sh ERRORS | | 114 | .Sh ERRORS |
115 | The | | 115 | The |
116 | .Fn sigqueue | | 116 | .Fn sigqueue |
117 | system call | | 117 | system call |
118 | will fail if: | | 118 | will fail if: |
119 | .Bl -tag -width Er | | 119 | .Bl -tag -width Er |
120 | .It Bq Er EAGAIN | | 120 | .It Bq Er EAGAIN |
121 | No resources are available to queue the signal. | | 121 | No resources are available to queue the signal. |
122 | The process has already | | 122 | The process has already queued |
123 | queued | | | |
124 | .Brq Dv SIGQUEUE_MAX | | 123 | .Brq Dv SIGQUEUE_MAX |
125 | signals that are still pending at the receiver(s), | | 124 | signals that are still pending at the receiver(s), |
126 | or a system-wide resource limit has been exceeded. | | 125 | or a system-wide resource limit has been exceeded. |
| | | 126 | .It Bq Er EEPERM |
| | | 127 | The process does not have the appropriate privilege to send the signal |
| | | 128 | to the receiving process. |
127 | .It Bq Er EINVAL | | 129 | .It Bq Er EINVAL |
128 | The value of the | | 130 | The value of the |
129 | .Fa signo | | 131 | .Fa signo |
130 | argument is an invalid or unsupported signal number. | | 132 | argument is an invalid or unsupported signal number. |
131 | .It Bq Er EEPERM | | | |
132 | The process does not have the appropriate privilege to send the signal | | | |
133 | to the receiving process. | | | |
134 | .It Bq Er ESRCH | | 133 | .It Bq Er ESRCH |
135 | The process | | 134 | The process |
136 | .Fa pid | | 135 | .Fa pid |
137 | does not exist. | | 136 | does not exist. |
138 | .El | | 137 | .El |
139 | .Sh SEE ALSO | | 138 | .Sh SEE ALSO |
140 | .Xr sigaction 2 , | | 139 | .Xr sigaction 2 , |
| | | 140 | .Xr siginfo 2 , |
141 | .Xr sigpending 2 , | | 141 | .Xr sigpending 2 , |
142 | .Xr sigqueue 2 , | | | |
143 | .Xr sigsuspend 2 , | | 142 | .Xr sigsuspend 2 , |
144 | .Xr sigtimedwait 2 , | | 143 | .Xr sigtimedwait 2 , |
145 | .Xr sigwait 2 , | | 144 | .Xr sigwait 2 , |
146 | .Xr sigwaitinfo 2 , | | 145 | .Xr sigwaitinfo 2 , |
147 | .Xr pause 3 , | | 146 | .Xr pause 3 , |
148 | .Xr pthread_sigmask 3 , | | 147 | .Xr pthread_sigmask 3 |
149 | .Xr siginfo 3 | | | |
150 | .Sh STANDARDS | | 148 | .Sh STANDARDS |
151 | The | | 149 | The |
152 | .Fn sigqueue | | 150 | .Fn sigqueue |
153 | system call conforms to | | 151 | system call conforms to |
154 | .St -p1003.1-2004 | | 152 | .St -p1003.1-2004 . |
155 | .Sh HISTORY | | 153 | .Sh HISTORY |
156 | Support for | | 154 | Support for |
157 | .Tn POSIX | | 155 | .Tn POSIX |
158 | realtime signal queue first appeared in | | 156 | realtime signal queue first appeared in |
159 | .Nx 6.0 . | | 157 | .Nx 6.0 . |