OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.40.
[linuxjm/LDP_man-pages.git] / po4a / mqueue / po / mqueue.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-05-01 04:38+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man3/mq_close.3:26
21 #, no-wrap
22 msgid "MQ_CLOSE"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/mq_close.3:26 build/C/man3/mq_getattr.3:26 build/C/man2/mq_getsetattr.2:26 build/C/man3/mq_unlink.3:26
27 #, no-wrap
28 msgid "2010-08-29"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/mq_close.3:26 build/C/man3/mq_getattr.3:26 build/C/man2/mq_getsetattr.2:26 build/C/man3/mq_notify.3:26 build/C/man3/mq_open.3:26 build/C/man7/mq_overview.7:26 build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26 build/C/man3/mq_unlink.3:26 build/C/man2/msgctl.2:35 build/C/man2/msgget.2:33 build/C/man2/msgop.2:38
33 #, no-wrap
34 msgid "Linux"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man3/mq_close.3:26 build/C/man3/mq_getattr.3:26 build/C/man2/mq_getsetattr.2:26 build/C/man3/mq_notify.3:26 build/C/man3/mq_open.3:26 build/C/man7/mq_overview.7:26 build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26 build/C/man3/mq_unlink.3:26 build/C/man2/msgctl.2:35 build/C/man2/msgget.2:33 build/C/man2/msgop.2:38
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man3/mq_close.3:27 build/C/man3/mq_getattr.3:27 build/C/man2/mq_getsetattr.2:27 build/C/man3/mq_notify.3:27 build/C/man3/mq_open.3:27 build/C/man7/mq_overview.7:27 build/C/man3/mq_receive.3:27 build/C/man3/mq_send.3:27 build/C/man3/mq_unlink.3:27 build/C/man2/msgctl.2:36 build/C/man2/msgget.2:34 build/C/man2/msgop.2:39
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man3/mq_close.3:29
51 msgid "mq_close - close a message queue descriptor"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man3/mq_close.3:29 build/C/man3/mq_getattr.3:29 build/C/man2/mq_getsetattr.2:29 build/C/man3/mq_notify.3:29 build/C/man3/mq_open.3:29 build/C/man3/mq_receive.3:29 build/C/man3/mq_send.3:29 build/C/man3/mq_unlink.3:29 build/C/man2/msgctl.2:38 build/C/man2/msgget.2:36 build/C/man2/msgop.2:41
56 #, no-wrap
57 msgid "SYNOPSIS"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man3/mq_close.3:32 build/C/man3/mq_getattr.3:32 build/C/man3/mq_notify.3:32 build/C/man3/mq_receive.3:32 build/C/man3/mq_send.3:32 build/C/man3/mq_unlink.3:32
62 #, no-wrap
63 msgid "B<#include E<lt>mqueue.hE<gt>>\n"
64 msgstr ""
65
66 #. type: Plain text
67 #: build/C/man3/mq_close.3:34
68 #, no-wrap
69 msgid "B<int mq_close(mqd_t >I<mqdes>B<);>\n"
70 msgstr ""
71
72 #. type: Plain text
73 #: build/C/man3/mq_close.3:37 build/C/man3/mq_getattr.3:40 build/C/man3/mq_notify.3:37 build/C/man3/mq_open.3:41 build/C/man3/mq_receive.3:45 build/C/man3/mq_send.3:45 build/C/man3/mq_unlink.3:37
74 msgid "Link with I<-lrt>."
75 msgstr ""
76
77 #. type: SH
78 #: build/C/man3/mq_close.3:37 build/C/man3/mq_getattr.3:40 build/C/man2/mq_getsetattr.2:37 build/C/man3/mq_notify.3:37 build/C/man3/mq_open.3:41 build/C/man7/mq_overview.7:29 build/C/man3/mq_receive.3:57 build/C/man3/mq_send.3:57 build/C/man3/mq_unlink.3:37 build/C/man2/msgctl.2:46 build/C/man2/msgget.2:44 build/C/man2/msgop.2:54
79 #, no-wrap
80 msgid "DESCRIPTION"
81 msgstr ""
82
83 #. type: Plain text
84 #: build/C/man3/mq_close.3:41
85 msgid "B<mq_close>()  closes the message queue descriptor I<mqdes>."
86 msgstr ""
87
88 #. type: Plain text
89 #: build/C/man3/mq_close.3:47
90 msgid ""
91 "If the calling process has attached a notification request to this message "
92 "queue via I<mqdes>, then this request is removed, and another process can "
93 "now attach a notification request."
94 msgstr ""
95
96 #. type: SH
97 #: build/C/man3/mq_close.3:47 build/C/man3/mq_getattr.3:118 build/C/man3/mq_notify.3:134 build/C/man3/mq_open.3:123 build/C/man3/mq_receive.3:113 build/C/man3/mq_send.3:119 build/C/man3/mq_unlink.3:44 build/C/man2/msgctl.2:224 build/C/man2/msgget.2:135 build/C/man2/msgop.2:285
98 #, no-wrap
99 msgid "RETURN VALUE"
100 msgstr ""
101
102 #. type: Plain text
103 #: build/C/man3/mq_close.3:53
104 msgid ""
105 "On success B<mq_close>()  returns 0; on error, -1 is returned, with I<errno> "
106 "set to indicate the error."
107 msgstr ""
108
109 #. type: SH
110 #: build/C/man3/mq_close.3:53 build/C/man3/mq_getattr.3:126 build/C/man3/mq_notify.3:140 build/C/man3/mq_open.3:135 build/C/man3/mq_receive.3:122 build/C/man3/mq_send.3:127 build/C/man3/mq_unlink.3:50 build/C/man2/msgctl.2:249 build/C/man2/msgget.2:141 build/C/man2/msgop.2:298
111 #, no-wrap
112 msgid "ERRORS"
113 msgstr ""
114
115 #. type: TP
116 #: build/C/man3/mq_close.3:54 build/C/man3/mq_getattr.3:127 build/C/man3/mq_notify.3:141 build/C/man3/mq_receive.3:129 build/C/man3/mq_send.3:134
117 #, no-wrap
118 msgid "B<EBADF>"
119 msgstr ""
120
121 #. type: Plain text
122 #: build/C/man3/mq_close.3:59 build/C/man3/mq_getattr.3:132 build/C/man3/mq_notify.3:146
123 msgid "The descriptor specified in I<mqdes> is invalid."
124 msgstr ""
125
126 #. type: SH
127 #: build/C/man3/mq_close.3:59 build/C/man3/mq_getattr.3:137 build/C/man2/mq_getsetattr.2:47 build/C/man3/mq_notify.3:174 build/C/man3/mq_open.3:224 build/C/man7/mq_overview.7:263 build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161 build/C/man3/mq_unlink.3:62 build/C/man2/msgctl.2:309 build/C/man2/msgget.2:181 build/C/man2/msgop.2:397
128 #, no-wrap
129 msgid "CONFORMING TO"
130 msgstr ""
131
132 #. type: Plain text
133 #: build/C/man3/mq_close.3:61 build/C/man3/mq_getattr.3:139 build/C/man3/mq_notify.3:176 build/C/man3/mq_open.3:226 build/C/man7/mq_overview.7:265 build/C/man3/mq_receive.3:158 build/C/man3/mq_send.3:163 build/C/man3/mq_unlink.3:64
134 msgid "POSIX.1-2001."
135 msgstr ""
136
137 #. type: SH
138 #: build/C/man3/mq_close.3:61 build/C/man3/mq_getattr.3:139 build/C/man2/mq_getsetattr.2:49 build/C/man7/mq_overview.7:265 build/C/man3/mq_receive.3:158 build/C/man3/mq_send.3:163 build/C/man2/msgctl.2:312 build/C/man2/msgget.2:183 build/C/man2/msgop.2:399
139 #, no-wrap
140 msgid "NOTES"
141 msgstr ""
142
143 #. type: Plain text
144 #: build/C/man3/mq_close.3:65
145 msgid ""
146 "All open message queues are automatically closed on process termination, or "
147 "upon B<execve>(2)."
148 msgstr ""
149
150 #. type: SH
151 #: build/C/man3/mq_close.3:65 build/C/man3/mq_getattr.3:147 build/C/man2/mq_getsetattr.2:53 build/C/man3/mq_notify.3:243 build/C/man3/mq_open.3:230 build/C/man7/mq_overview.7:281 build/C/man3/mq_receive.3:164 build/C/man3/mq_send.3:169 build/C/man3/mq_unlink.3:64 build/C/man2/msgctl.2:337 build/C/man2/msgget.2:215 build/C/man2/msgop.2:431
152 #, no-wrap
153 msgid "SEE ALSO"
154 msgstr ""
155
156 #. type: Plain text
157 #: build/C/man3/mq_close.3:73
158 msgid ""
159 "B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), B<mq_receive>(3), "
160 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
161 msgstr ""
162
163 #. type: SH
164 #: build/C/man3/mq_close.3:73 build/C/man3/mq_getattr.3:155 build/C/man2/mq_getsetattr.2:56 build/C/man3/mq_notify.3:252 build/C/man3/mq_open.3:238 build/C/man7/mq_overview.7:294 build/C/man3/mq_receive.3:173 build/C/man3/mq_send.3:178 build/C/man3/mq_unlink.3:72 build/C/man2/msgctl.2:344 build/C/man2/msgget.2:223 build/C/man2/msgop.2:437
165 #, no-wrap
166 msgid "COLOPHON"
167 msgstr ""
168
169 #. type: Plain text
170 #: build/C/man3/mq_close.3:80 build/C/man3/mq_getattr.3:162 build/C/man2/mq_getsetattr.2:63 build/C/man3/mq_notify.3:259 build/C/man3/mq_open.3:245 build/C/man7/mq_overview.7:301 build/C/man3/mq_receive.3:180 build/C/man3/mq_send.3:185 build/C/man3/mq_unlink.3:79 build/C/man2/msgctl.2:351 build/C/man2/msgget.2:230 build/C/man2/msgop.2:444
171 msgid ""
172 "This page is part of release 3.40 of the Linux I<man-pages> project.  A "
173 "description of the project, and information about reporting bugs, can be "
174 "found at http://www.kernel.org/doc/man-pages/."
175 msgstr ""
176
177 #. type: TH
178 #: build/C/man3/mq_getattr.3:26
179 #, no-wrap
180 msgid "MQ_GETATTR"
181 msgstr ""
182
183 #. type: Plain text
184 #: build/C/man3/mq_getattr.3:29
185 msgid "mq_getattr, mq_setattr - get/set message queue attributes"
186 msgstr ""
187
188 #. type: Plain text
189 #: build/C/man3/mq_getattr.3:34
190 #, no-wrap
191 msgid "B<int mq_getattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<attr>B<);>\n"
192 msgstr ""
193
194 #. type: Plain text
195 #: build/C/man3/mq_getattr.3:37
196 #, no-wrap
197 msgid ""
198 "B<int mq_setattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<newattr>B<,>\n"
199 "B<                 struct mq_attr *>I<oldattr>B<);>\n"
200 msgstr ""
201
202 #. type: Plain text
203 #: build/C/man3/mq_getattr.3:47
204 msgid ""
205 "B<mq_getattr>()  and B<mq_setattr>()  respectively retrieve and modify "
206 "attributes of the message queue referred to by the descriptor I<mqdes>."
207 msgstr ""
208
209 #. type: Plain text
210 #: build/C/man3/mq_getattr.3:54
211 msgid ""
212 "B<mq_getattr>()  returns an I<mq_attr> structure in the buffer pointed by "
213 "I<attr>.  This structure is defined as:"
214 msgstr ""
215
216 #. type: Plain text
217 #: build/C/man3/mq_getattr.3:63
218 #, no-wrap
219 msgid ""
220 "struct mq_attr {\n"
221 "    long mq_flags;       /* Flags: 0 or O_NONBLOCK */\n"
222 "    long mq_maxmsg;      /* Max. # of messages on queue */\n"
223 "    long mq_msgsize;     /* Max. message size (bytes) */\n"
224 "    long mq_curmsgs;     /* # of messages currently in queue */\n"
225 "};\n"
226 msgstr ""
227
228 #. type: Plain text
229 #: build/C/man3/mq_getattr.3:73
230 msgid ""
231 "The I<mq_flags> field contains flags associated with the open message queue "
232 "description.  This field is initialized when the queue is created by "
233 "B<mq_open>(3).  The only flag that can appear in this field is "
234 "B<O_NONBLOCK>."
235 msgstr ""
236
237 #. type: Plain text
238 #: build/C/man3/mq_getattr.3:94
239 msgid ""
240 "The I<mq_maxmsg> and I<mq_msgsize> fields are set when the message queue is "
241 "created by B<mq_open>(3).  The I<mq_maxmsg> field is an upper limit on the "
242 "number of messages that may be placed on the queue using B<mq_send>(3).  The "
243 "I<mq_msgsize> field is an upper limit on the size of messages that may be "
244 "placed on the queue.  Both of these fields must have a value greater than "
245 "zero.  Two I</proc> files that place ceilings on the values for these fields "
246 "are described in B<mq_open>(3)."
247 msgstr ""
248
249 #. type: Plain text
250 #: build/C/man3/mq_getattr.3:98
251 msgid ""
252 "The I<mq_curmsgs> field returns the number of messages currently held in the "
253 "queue."
254 msgstr ""
255
256 #. type: Plain text
257 #: build/C/man3/mq_getattr.3:118
258 msgid ""
259 "B<mq_setattr>()  sets message queue attributes using information supplied in "
260 "the I<mq_attr> structure pointed to by I<newattr>.  The only attribute that "
261 "can be modified is the setting of the B<O_NONBLOCK> flag in I<mq_flags>.  "
262 "The other fields in I<newattr> are ignored.  If the I<oldattr> field is not "
263 "NULL, then the buffer that it points to is used to return an I<mq_attr> "
264 "structure that contains the same information that is returned by "
265 "B<mq_getattr>()."
266 msgstr ""
267
268 #. type: Plain text
269 #: build/C/man3/mq_getattr.3:126
270 msgid ""
271 "On success B<mq_getattr>()  and B<mq_setattr>()  return 0; on error, -1 is "
272 "returned, with I<errno> set to indicate the error."
273 msgstr ""
274
275 #. type: TP
276 #: build/C/man3/mq_getattr.3:132 build/C/man3/mq_notify.3:150 build/C/man3/mq_open.3:156 build/C/man3/mq_receive.3:138 build/C/man3/mq_send.3:143 build/C/man2/msgctl.2:280 build/C/man2/msgop.2:329 build/C/man2/msgop.2:385
277 #, no-wrap
278 msgid "B<EINVAL>"
279 msgstr ""
280
281 #. type: Plain text
282 #: build/C/man3/mq_getattr.3:137
283 msgid "I<newattr-E<gt>mq_flags> contained set bits other than B<O_NONBLOCK>."
284 msgstr ""
285
286 #. type: Plain text
287 #: build/C/man3/mq_getattr.3:147
288 msgid ""
289 "On Linux, B<mq_getattr>()  and B<mq_setattr>()  are library functions "
290 "layered on top of the B<mq_getsetattr>(2)  system call."
291 msgstr ""
292
293 #. type: Plain text
294 #: build/C/man3/mq_getattr.3:155
295 msgid ""
296 "B<mq_close>(3), B<mq_notify>(3), B<mq_open>(3), B<mq_receive>(3), "
297 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
298 msgstr ""
299
300 #. type: TH
301 #: build/C/man2/mq_getsetattr.2:26
302 #, no-wrap
303 msgid "MQ_GETSETATTR"
304 msgstr ""
305
306 #. type: Plain text
307 #: build/C/man2/mq_getsetattr.2:29
308 msgid "mq_getsetattr - get/set message queue attributes"
309 msgstr ""
310
311 #. type: Plain text
312 #: build/C/man2/mq_getsetattr.2:33
313 #, no-wrap
314 msgid ""
315 "B<#include E<lt>sys/types.hE<gt>>\n"
316 "B<#include E<lt>mqueue.hE<gt>>\n"
317 msgstr ""
318
319 #. type: Plain text
320 #: build/C/man2/mq_getsetattr.2:36
321 #, no-wrap
322 msgid ""
323 "B<int mq_getsetattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<newattr>B<,>\n"
324 "B<                 struct mq_attr *>I<oldattr>B<);>\n"
325 msgstr ""
326
327 #. type: Plain text
328 #: build/C/man2/mq_getsetattr.2:39
329 msgid "Do not use this system call."
330 msgstr ""
331
332 #. type: Plain text
333 #: build/C/man2/mq_getsetattr.2:47
334 msgid ""
335 "This is the low-level system call used to implement B<mq_getattr>(3)  and "
336 "B<mq_setattr>(3).  For an explanation of how this system call operates, see "
337 "the description of B<mq_setattr>(3)."
338 msgstr ""
339
340 #. type: Plain text
341 #: build/C/man2/mq_getsetattr.2:49
342 msgid "This interface is nonstandard; avoid its use."
343 msgstr ""
344
345 #. type: Plain text
346 #: build/C/man2/mq_getsetattr.2:53
347 msgid ""
348 "Glibc does not provide a wrapper for this system call; call it using "
349 "B<syscall>(2).  (Actually, never call it unless you are writing a C "
350 "library!)"
351 msgstr ""
352
353 #. type: Plain text
354 #: build/C/man2/mq_getsetattr.2:56
355 msgid "B<mq_getattr>(3), B<mq_overview>(7)"
356 msgstr ""
357
358 #. type: TH
359 #: build/C/man3/mq_notify.3:26
360 #, no-wrap
361 msgid "MQ_NOTIFY"
362 msgstr ""
363
364 #. type: TH
365 #: build/C/man3/mq_notify.3:26
366 #, no-wrap
367 msgid "2010-10-04"
368 msgstr ""
369
370 #. type: Plain text
371 #: build/C/man3/mq_notify.3:29
372 msgid "mq_notify - register for notification when a message is available"
373 msgstr ""
374
375 #. type: Plain text
376 #: build/C/man3/mq_notify.3:34
377 #, no-wrap
378 msgid "B<int mq_notify(mqd_t >I<mqdes>B<, const struct sigevent *>I<sevp>B<);>\n"
379 msgstr ""
380
381 #. type: Plain text
382 #: build/C/man3/mq_notify.3:43
383 msgid ""
384 "B<mq_notify>()  allows the calling process to register or unregister for "
385 "delivery of an asynchronous notification when a new message arrives on the "
386 "empty message queue referred to by the descriptor I<mqdes>."
387 msgstr ""
388
389 #. type: Plain text
390 #: build/C/man3/mq_notify.3:51
391 msgid ""
392 "The I<sevp> argument is a pointer to a I<sigevent> structure.  For the "
393 "definition and general details of this structure, see B<sigevent>(7)."
394 msgstr ""
395
396 #. type: Plain text
397 #: build/C/man3/mq_notify.3:65
398 msgid ""
399 "If I<sevp> is a non-NULL pointer, then B<mq_notify>()  registers the calling "
400 "process to receive message notification.  The I<sigev_notify> field of the "
401 "I<sigevent> structure to which I<sevp> points specifies how notification is "
402 "to be performed.  This field has one of the following values:"
403 msgstr ""
404
405 #. type: TP
406 #: build/C/man3/mq_notify.3:65
407 #, no-wrap
408 msgid "B<SIGEV_NONE>"
409 msgstr ""
410
411 #.  When is SIGEV_NONE useful?
412 #. type: Plain text
413 #: build/C/man3/mq_notify.3:70
414 msgid ""
415 "A \"null\" notification: the calling process is registered as the target for "
416 "notification, but when a message arrives, no notification is sent."
417 msgstr ""
418
419 #. type: TP
420 #: build/C/man3/mq_notify.3:70
421 #, no-wrap
422 msgid "B<SIGEV_SIGNAL>"
423 msgstr ""
424
425 #.  I don't know of other implementations that set
426 #.  si_pid and si_uid -- MTK
427 #. type: Plain text
428 #: build/C/man3/mq_notify.3:90
429 msgid ""
430 "Notify the process by sending the signal specified in I<sigev_signo>.  See "
431 "B<sigevent>(7)  for general details.  The I<si_code> field of the "
432 "I<siginfo_t> structure will be set to B<SI_MESGQ>.  In addition, I<si_pid> "
433 "will be set to the PID of the process that sent the message, and I<si_uid> "
434 "will be set to the real user ID of the sending process."
435 msgstr ""
436
437 #. type: TP
438 #: build/C/man3/mq_notify.3:90
439 #, no-wrap
440 msgid "B<SIGEV_THREAD>"
441 msgstr ""
442
443 #. type: Plain text
444 #: build/C/man3/mq_notify.3:98
445 msgid ""
446 "Upon message delivery, invoke I<sigev_notify_function> as if it were the "
447 "start function of a new thread.  See B<sigevent>(7)  for details."
448 msgstr ""
449
450 #. type: Plain text
451 #: build/C/man3/mq_notify.3:101
452 msgid ""
453 "Only one process can be registered to receive notification from a message "
454 "queue."
455 msgstr ""
456
457 #. type: Plain text
458 #: build/C/man3/mq_notify.3:108
459 msgid ""
460 "If I<sevp> is NULL, and the calling process is currently registered to "
461 "receive notifications for this message queue, then the registration is "
462 "removed; another process can then register to receive a message notification "
463 "for this queue."
464 msgstr ""
465
466 #. type: Plain text
467 #: build/C/man3/mq_notify.3:115
468 msgid ""
469 "Message notification only occurs when a new message arrives and the queue "
470 "was previously empty.  If the queue was not empty at the time B<mq_notify>()  "
471 "was called, then a notification will only occur after the queue is emptied "
472 "and a new message arrives."
473 msgstr ""
474
475 #. type: Plain text
476 #: build/C/man3/mq_notify.3:123
477 msgid ""
478 "If another process or thread is waiting to read a message from an empty "
479 "queue using B<mq_receive>(3), then any message notification registration is "
480 "ignored: the message is delivered to the process or thread calling "
481 "B<mq_receive>(3), and the message notification registration remains in "
482 "effect."
483 msgstr ""
484
485 #. type: Plain text
486 #: build/C/man3/mq_notify.3:134
487 msgid ""
488 "Notification occurs once: after a notification is delivered, the "
489 "notification registration is removed, and another process can register for "
490 "message notification.  If the notified process wishes to receive the next "
491 "notification, it can use B<mq_notify>()  to request a further notification.  "
492 "This should be done before emptying all unread messages from the queue.  "
493 "(Placing the queue in nonblocking mode is useful for emptying the queue of "
494 "messages without blocking once it is empty.)"
495 msgstr ""
496
497 #. type: Plain text
498 #: build/C/man3/mq_notify.3:140
499 msgid ""
500 "On success B<mq_notify>()  returns 0; on error, -1 is returned, with "
501 "I<errno> set to indicate the error."
502 msgstr ""
503
504 #. type: TP
505 #: build/C/man3/mq_notify.3:146
506 #, no-wrap
507 msgid "B<EBUSY>"
508 msgstr ""
509
510 #. type: Plain text
511 #: build/C/man3/mq_notify.3:150
512 msgid ""
513 "Another process has already registered to receive notification for this "
514 "message queue."
515 msgstr ""
516
517 #. type: Plain text
518 #: build/C/man3/mq_notify.3:160
519 msgid ""
520 "I<sevp-E<gt>sigev_notify> is not one of the permitted values; or "
521 "I<sevp-E<gt>sigev_notify> is B<SIGEV_SIGNAL> and I<sevp-E<gt>sigev_signo> is "
522 "not a valid signal number."
523 msgstr ""
524
525 #. type: TP
526 #: build/C/man3/mq_notify.3:160 build/C/man3/mq_open.3:214 build/C/man2/msgget.2:171 build/C/man2/msgop.2:340
527 #, no-wrap
528 msgid "B<ENOMEM>"
529 msgstr ""
530
531 #. type: Plain text
532 #: build/C/man3/mq_notify.3:163 build/C/man3/mq_open.3:217
533 msgid "Insufficient memory."
534 msgstr ""
535
536 #.  Linux does not do this
537 #. type: Plain text
538 #: build/C/man3/mq_notify.3:174
539 msgid ""
540 "POSIX.1-2008 says that an implementation I<may> generate an B<EINVAL> error "
541 "if I<sevp> is NULL, and the caller is not currently registered to receive "
542 "notifications for the queue I<mqdes>."
543 msgstr ""
544
545 #. type: SH
546 #: build/C/man3/mq_notify.3:176 build/C/man7/mq_overview.7:278
547 #, no-wrap
548 msgid "EXAMPLE"
549 msgstr ""
550
551 #. type: Plain text
552 #: build/C/man3/mq_notify.3:182
553 msgid ""
554 "The following program registers a notification request for the message queue "
555 "named in its command-line argument.  Notification is performed by creating a "
556 "thread.  The thread executes a function which reads one message from the "
557 "queue and then terminates the process."
558 msgstr ""
559
560 #. type: Plain text
561 #: build/C/man3/mq_notify.3:189
562 #, no-wrap
563 msgid ""
564 "#include E<lt>pthread.hE<gt>\n"
565 "#include E<lt>mqueue.hE<gt>\n"
566 "#include E<lt>stdio.hE<gt>\n"
567 "#include E<lt>stdlib.hE<gt>\n"
568 "#include E<lt>unistd.hE<gt>\n"
569 msgstr ""
570
571 #. type: Plain text
572 #: build/C/man3/mq_notify.3:192
573 #, no-wrap
574 msgid ""
575 "#define handle_error(msg) \\e\n"
576 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
577 msgstr ""
578
579 #. type: Plain text
580 #: build/C/man3/mq_notify.3:200
581 #, no-wrap
582 msgid ""
583 "static void                     /* Thread start function */\n"
584 "tfunc(union sigval sv)\n"
585 "{\n"
586 "    struct mq_attr attr;\n"
587 "    ssize_t nr;\n"
588 "    void *buf;\n"
589 "    mqd_t mqdes = *((mqd_t *) sv.sival_ptr);\n"
590 msgstr ""
591
592 #. type: Plain text
593 #: build/C/man3/mq_notify.3:202
594 #, no-wrap
595 msgid "    /* Determine max. msg size; allocate buffer to receive msg */\n"
596 msgstr ""
597
598 #. type: Plain text
599 #: build/C/man3/mq_notify.3:208
600 #, no-wrap
601 msgid ""
602 "    if (mq_getattr(mqdes, &attr) == -1)\n"
603 "        handle_error(\"mq_getattr\");\n"
604 "    buf = malloc(attr.mq_msgsize);\n"
605 "    if (buf == NULL)\n"
606 "        handle_error(\"malloc\");\n"
607 msgstr ""
608
609 #. type: Plain text
610 #: build/C/man3/mq_notify.3:212
611 #, no-wrap
612 msgid ""
613 "    nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL);\n"
614 "    if (nr == -1)\n"
615 "        handle_error(\"mq_receive\");\n"
616 msgstr ""
617
618 #. type: Plain text
619 #: build/C/man3/mq_notify.3:217
620 #, no-wrap
621 msgid ""
622 "    printf(\"Read %ld bytes from MQ\\en\", (long) nr);\n"
623 "    free(buf);\n"
624 "    exit(EXIT_SUCCESS);         /* Terminate the process */\n"
625 "}\n"
626 msgstr ""
627
628 #. type: Plain text
629 #: build/C/man3/mq_notify.3:223
630 #, no-wrap
631 msgid ""
632 "int\n"
633 "main(int argc, char *argv[])\n"
634 "{\n"
635 "    mqd_t mqdes;\n"
636 "    struct sigevent sev;\n"
637 msgstr ""
638
639 #. type: Plain text
640 #: build/C/man3/mq_notify.3:228
641 #, no-wrap
642 msgid ""
643 "    if (argc != 2) {\n"
644 "\tfprintf(stderr, \"Usage: %s E<lt>mq-nameE<gt>\\en\", argv[0]);\n"
645 "\texit(EXIT_FAILURE);\n"
646 "    }\n"
647 msgstr ""
648
649 #. type: Plain text
650 #: build/C/man3/mq_notify.3:232
651 #, no-wrap
652 msgid ""
653 "    mqdes = mq_open(argv[1], O_RDONLY);\n"
654 "    if (mqdes == (mqd_t) -1)\n"
655 "        handle_error(\"mq_open\");\n"
656 msgstr ""
657
658 #. type: Plain text
659 #: build/C/man3/mq_notify.3:239
660 #, no-wrap
661 msgid ""
662 "    sev.sigev_notify = SIGEV_THREAD;\n"
663 "    sev.sigev_notify_function = tfunc;\n"
664 "    sev.sigev_notify_attributes = NULL;\n"
665 "    sev.sigev_value.sival_ptr = &mqdes;   /* Arg. to thread func. */\n"
666 "    if (mq_notify(mqdes, &sev) == -1)\n"
667 "        handle_error(\"mq_notify\");\n"
668 msgstr ""
669
670 #. type: Plain text
671 #: build/C/man3/mq_notify.3:242
672 #, no-wrap
673 msgid ""
674 "    pause();    /* Process will be terminated by thread function */\n"
675 "}\n"
676 msgstr ""
677
678 #. type: Plain text
679 #: build/C/man3/mq_notify.3:252
680 msgid ""
681 "B<mq_close>(3), B<mq_getattr>(3), B<mq_open>(3), B<mq_receive>(3), "
682 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<sigevent>(7)"
683 msgstr ""
684
685 #. type: TH
686 #: build/C/man3/mq_open.3:26
687 #, no-wrap
688 msgid "MQ_OPEN"
689 msgstr ""
690
691 #. type: TH
692 #: build/C/man3/mq_open.3:26
693 #, no-wrap
694 msgid "2009-02-20"
695 msgstr ""
696
697 #. type: Plain text
698 #: build/C/man3/mq_open.3:29
699 msgid "mq_open - open a message queue"
700 msgstr ""
701
702 #. type: Plain text
703 #: build/C/man3/mq_open.3:34
704 #, no-wrap
705 msgid ""
706 "B<#include E<lt>fcntl.hE<gt>>           /* For O_* constants */\n"
707 "B<#include E<lt>sys/stat.hE<gt>>        /* For mode constants */\n"
708 "B<#include E<lt>mqueue.hE<gt>>\n"
709 msgstr ""
710
711 #. type: Plain text
712 #: build/C/man3/mq_open.3:38
713 #, no-wrap
714 msgid ""
715 "B<mqd_t mq_open(const char *>I<name>B<, int >I<oflag>B<);>\n"
716 "B<mqd_t mq_open(const char *>I<name>B<, int >I<oflag>B<, mode_t "
717 ">I<mode>B<,>\n"
718 "B<              struct mq_attr *>I<attr>B<);>\n"
719 msgstr ""
720
721 #. type: Plain text
722 #: build/C/man3/mq_open.3:50
723 msgid ""
724 "B<mq_open>()  creates a new POSIX message queue or opens an existing queue.  "
725 "The queue is identified by I<name>.  For details of the construction of "
726 "I<name>, see B<mq_overview>(7)."
727 msgstr ""
728
729 #. type: Plain text
730 #: build/C/man3/mq_open.3:58
731 msgid ""
732 "The I<oflag> argument specifies flags that control the operation of the "
733 "call.  (Definitions of the flags values can be obtained by including "
734 "I<E<lt>fcntl.hE<gt>>.)  Exactly one of the following must be specified in "
735 "I<oflag>:"
736 msgstr ""
737
738 #. type: TP
739 #: build/C/man3/mq_open.3:58
740 #, no-wrap
741 msgid "B<O_RDONLY>"
742 msgstr ""
743
744 #. type: Plain text
745 #: build/C/man3/mq_open.3:61
746 msgid "Open the queue to receive messages only."
747 msgstr ""
748
749 #. type: TP
750 #: build/C/man3/mq_open.3:61
751 #, no-wrap
752 msgid "B<O_WRONLY>"
753 msgstr ""
754
755 #. type: Plain text
756 #: build/C/man3/mq_open.3:64
757 msgid "Open the queue to send messages only."
758 msgstr ""
759
760 #. type: TP
761 #: build/C/man3/mq_open.3:64
762 #, no-wrap
763 msgid "B<O_RDWR>"
764 msgstr ""
765
766 #. type: Plain text
767 #: build/C/man3/mq_open.3:67
768 msgid "Open the queue to both send and receive messages."
769 msgstr ""
770
771 #. type: Plain text
772 #: build/C/man3/mq_open.3:72
773 msgid "Zero or more of the following flags can additionally be I<OR>ed in I<oflag>:"
774 msgstr ""
775
776 #. type: TP
777 #: build/C/man3/mq_open.3:72
778 #, no-wrap
779 msgid "B<O_NONBLOCK>"
780 msgstr ""
781
782 #. type: Plain text
783 #: build/C/man3/mq_open.3:81
784 msgid ""
785 "Open the queue in nonblocking mode.  In circumstances where B<mq_receive>(3)  "
786 "and B<mq_send>(3)  would normally block, these functions instead fail with "
787 "the error B<EAGAIN>."
788 msgstr ""
789
790 #. type: TP
791 #: build/C/man3/mq_open.3:81
792 #, no-wrap
793 msgid "B<O_CREAT>"
794 msgstr ""
795
796 #.  In reality the file system IDs are used on Linux.
797 #. type: Plain text
798 #: build/C/man3/mq_open.3:89
799 msgid ""
800 "Create the message queue if it does not exist.  The owner (user ID) of the "
801 "message queue is set to the effective user ID of the calling process.  The "
802 "group ownership (group ID) is set to the effective group ID of the calling "
803 "process."
804 msgstr ""
805
806 #. type: TP
807 #: build/C/man3/mq_open.3:89
808 #, no-wrap
809 msgid "B<O_EXCL>"
810 msgstr ""
811
812 #. type: Plain text
813 #: build/C/man3/mq_open.3:99
814 msgid ""
815 "If B<O_CREAT> was specified in I<oflag>, and a queue with the given I<name> "
816 "already exists, then fail with the error B<EEXIST>."
817 msgstr ""
818
819 #. type: Plain text
820 #: build/C/man3/mq_open.3:123
821 msgid ""
822 "If B<O_CREAT> is specified in I<oflag>, then two additional arguments must "
823 "be supplied.  The I<mode> argument specifies the permissions to be placed on "
824 "the new queue, as for B<open>(2).  (Symbolic definitions for the permissions "
825 "bits can be obtained by including I<E<lt>sys/stat.hE<gt>>.)  The permissions "
826 "settings are masked against the process umask.  The I<attr> argument "
827 "specifies attributes for the queue.  See B<mq_getattr>(3)  for details.  If "
828 "I<attr> is NULL, then the queue is created with implementation-defined "
829 "default attributes."
830 msgstr ""
831
832 #. type: Plain text
833 #: build/C/man3/mq_open.3:135
834 msgid ""
835 "On success, B<mq_open>()  returns a message queue descriptor for use by "
836 "other message queue functions.  On error, B<mq_open>()  returns I<(mqd_t)\\ "
837 "-1>, with I<errno> set to indicate the error."
838 msgstr ""
839
840 #. type: TP
841 #: build/C/man3/mq_open.3:136 build/C/man3/mq_open.3:140 build/C/man3/mq_unlink.3:51 build/C/man2/msgctl.2:253 build/C/man2/msgget.2:145 build/C/man2/msgop.2:304 build/C/man2/msgop.2:359
842 #, no-wrap
843 msgid "B<EACCES>"
844 msgstr ""
845
846 #. type: Plain text
847 #: build/C/man3/mq_open.3:140
848 msgid ""
849 "The queue exists, but the caller does not have permission to open it in the "
850 "specified mode."
851 msgstr ""
852
853 #.  Note that this isn't consistent with the same case for sem_open()
854 #. type: Plain text
855 #: build/C/man3/mq_open.3:145
856 msgid "I<name> contained more than one slash."
857 msgstr ""
858
859 #. type: TP
860 #: build/C/man3/mq_open.3:145 build/C/man2/msgget.2:153
861 #, no-wrap
862 msgid "B<EEXIST>"
863 msgstr ""
864
865 #. type: Plain text
866 #: build/C/man3/mq_open.3:156
867 msgid ""
868 "Both B<O_CREAT> and B<O_EXCL> were specified in I<oflag>, but a queue with "
869 "this I<name> already exists."
870 msgstr ""
871
872 #. type: Plain text
873 #: build/C/man3/mq_open.3:188
874 msgid ""
875 "B<O_CREAT> was specified in I<oflag>, and I<attr> was not NULL, but "
876 "I<attr-E<gt>mq_maxmsg> or I<attr-E<gt>mq_msqsize> was invalid.  Both of "
877 "these fields must be greater than zero.  In a process that is unprivileged "
878 "(does not have the B<CAP_SYS_RESOURCE> capability), I<attr-E<gt>mq_maxmsg> "
879 "must be less than or equal to the I<msg_max> limit, and "
880 "I<attr-E<gt>mq_msgsize> must be less than or equal to the I<msgsize_max> "
881 "limit.  In addition, even in a privileged process, I<attr-E<gt>mq_maxmsg> "
882 "cannot exceed the B<HARD_MAX> limit.  (See B<mq_overview>(7)  for details of "
883 "these limits.)"
884 msgstr ""
885
886 #. type: TP
887 #: build/C/man3/mq_open.3:188
888 #, no-wrap
889 msgid "B<EMFILE>"
890 msgstr ""
891
892 #. type: Plain text
893 #: build/C/man3/mq_open.3:192
894 msgid "The process already has the maximum number of files and message queues open."
895 msgstr ""
896
897 #. type: TP
898 #: build/C/man3/mq_open.3:192 build/C/man3/mq_unlink.3:54
899 #, no-wrap
900 msgid "B<ENAMETOOLONG>"
901 msgstr ""
902
903 #. type: Plain text
904 #: build/C/man3/mq_open.3:196 build/C/man3/mq_unlink.3:58
905 msgid "I<name> was too long."
906 msgstr ""
907
908 #. type: TP
909 #: build/C/man3/mq_open.3:196
910 #, no-wrap
911 msgid "B<ENFILE>"
912 msgstr ""
913
914 #. type: Plain text
915 #: build/C/man3/mq_open.3:200
916 msgid ""
917 "The system limit on the total number of open files and message queues has "
918 "been reached."
919 msgstr ""
920
921 #. type: TP
922 #: build/C/man3/mq_open.3:200 build/C/man3/mq_open.3:209 build/C/man3/mq_unlink.3:58 build/C/man2/msgget.2:163
923 #, no-wrap
924 msgid "B<ENOENT>"
925 msgstr ""
926
927 #. type: Plain text
928 #: build/C/man3/mq_open.3:209
929 msgid ""
930 "The B<O_CREAT> flag was not specified in I<oflag>, and no queue with this "
931 "I<name> exists."
932 msgstr ""
933
934 #.  Note that this isn't consistent with the same case for sem_open()
935 #. type: Plain text
936 #: build/C/man3/mq_open.3:214
937 msgid "I<name> was just \"/\" followed by no other characters."
938 msgstr ""
939
940 #. type: TP
941 #: build/C/man3/mq_open.3:217 build/C/man2/msgget.2:175
942 #, no-wrap
943 msgid "B<ENOSPC>"
944 msgstr ""
945
946 #. type: Plain text
947 #: build/C/man3/mq_open.3:224
948 msgid ""
949 "Insufficient space for the creation of a new message queue.  This probably "
950 "occurred because the I<queues_max> limit was encountered; see "
951 "B<mq_overview>(7)."
952 msgstr ""
953
954 #. type: SH
955 #: build/C/man3/mq_open.3:226 build/C/man2/msgget.2:209
956 #, no-wrap
957 msgid "BUGS"
958 msgstr ""
959
960 #. type: Plain text
961 #: build/C/man3/mq_open.3:230
962 msgid ""
963 "In kernels before 2.6.14, the process umask was not applied to the "
964 "permissions specified in I<mode>."
965 msgstr ""
966
967 #. type: Plain text
968 #: build/C/man3/mq_open.3:238
969 msgid ""
970 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_receive>(3), "
971 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
972 msgstr ""
973
974 #. type: TH
975 #: build/C/man7/mq_overview.7:26
976 #, no-wrap
977 msgid "MQ_OVERVIEW"
978 msgstr ""
979
980 #. type: TH
981 #: build/C/man7/mq_overview.7:26
982 #, no-wrap
983 msgid "2009-09-27"
984 msgstr ""
985
986 #. type: Plain text
987 #: build/C/man7/mq_overview.7:29
988 msgid "mq_overview - Overview of POSIX message queues"
989 msgstr ""
990
991 #. type: Plain text
992 #: build/C/man7/mq_overview.7:37
993 msgid ""
994 "POSIX message queues allow processes to exchange data in the form of "
995 "messages.  This API is distinct from that provided by System V message "
996 "queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.), but provides "
997 "similar functionality."
998 msgstr ""
999
1000 #. type: Plain text
1001 #: build/C/man7/mq_overview.7:52
1002 msgid ""
1003 "Message queues are created and opened using B<mq_open>(3); this function "
1004 "returns a I<message queue descriptor> (I<mqd_t>), which is used to refer to "
1005 "the open message queue in later calls.  Each message queue is identified by "
1006 "a name of the form I</somename>; that is, a null-terminated string of up to "
1007 "B<NAME_MAX> (i.e., 255) characters consisting of an initial slash, followed "
1008 "by one or more characters, none of which are slashes.  Two processes can "
1009 "operate on the same queue by passing the same name to B<mq_open>(3)."
1010 msgstr ""
1011
1012 #. type: Plain text
1013 #: build/C/man7/mq_overview.7:68
1014 msgid ""
1015 "Messages are transferred to and from a queue using B<mq_send>(3)  and "
1016 "B<mq_receive>(3).  When a process has finished using the queue, it closes it "
1017 "using B<mq_close>(3), and when the queue is no longer required, it can be "
1018 "deleted using B<mq_unlink>(3).  Queue attributes can be retrieved and (in "
1019 "some cases) modified using B<mq_getattr>(3)  and B<mq_setattr>(3).  A "
1020 "process can request asynchronous notification of the arrival of a message on "
1021 "a previously empty queue using B<mq_notify>(3)."
1022 msgstr ""
1023
1024 #. type: Plain text
1025 #: build/C/man7/mq_overview.7:81
1026 msgid ""
1027 "A message queue descriptor is a reference to an I<open message queue "
1028 "description> (cf.  B<open>(2)).  After a B<fork>(2), a child inherits copies "
1029 "of its parent's message queue descriptors, and these descriptors refer to "
1030 "the same open message queue descriptions as the corresponding descriptors in "
1031 "the parent.  Corresponding descriptors in the two processes share the flags "
1032 "(I<mq_flags>)  that are associated with the open message queue description."
1033 msgstr ""
1034
1035 #. type: Plain text
1036 #: build/C/man7/mq_overview.7:94
1037 msgid ""
1038 "Each message has an associated I<priority>, and messages are always "
1039 "delivered to the receiving process highest priority first.  Message "
1040 "priorities range from 0 (low) to I<sysconf(_SC_MQ_PRIO_MAX)\\ -\\ 1> "
1041 "(high).  On Linux, I<sysconf(_SC_MQ_PRIO_MAX)> returns 32768, but "
1042 "POSIX.1-2001 only requires an implementation to support priorities in the "
1043 "range 0 to 31; some implementations only provide this range."
1044 msgstr ""
1045
1046 #. type: Plain text
1047 #: build/C/man7/mq_overview.7:97
1048 msgid ""
1049 "The remainder of this section describes some specific details of the Linux "
1050 "implementation of POSIX message queues."
1051 msgstr ""
1052
1053 #. type: SS
1054 #: build/C/man7/mq_overview.7:97
1055 #, no-wrap
1056 msgid "Library interfaces and system calls"
1057 msgstr ""
1058
1059 #. type: Plain text
1060 #: build/C/man7/mq_overview.7:103
1061 msgid ""
1062 "In most cases the B<mq_*()> library interfaces listed above are implemented "
1063 "on top of underlying system calls of the same name.  Deviations from this "
1064 "scheme are indicated in the following table:"
1065 msgstr ""
1066
1067 #. type: tbl table
1068 #: build/C/man7/mq_overview.7:107
1069 #, no-wrap
1070 msgid "Library interface\tSystem call\n"
1071 msgstr ""
1072
1073 #. type: tbl table
1074 #: build/C/man7/mq_overview.7:108
1075 #, no-wrap
1076 msgid "mq_close(3)\tclose(2)\n"
1077 msgstr ""
1078
1079 #. type: tbl table
1080 #: build/C/man7/mq_overview.7:109
1081 #, no-wrap
1082 msgid "mq_getattr(3)\tmq_getsetattr(2)\n"
1083 msgstr ""
1084
1085 #. type: tbl table
1086 #: build/C/man7/mq_overview.7:110
1087 #, no-wrap
1088 msgid "mq_notify(3)\tmq_notify(2)\n"
1089 msgstr ""
1090
1091 #. type: tbl table
1092 #: build/C/man7/mq_overview.7:111
1093 #, no-wrap
1094 msgid "mq_open(3)\tmq_open(2)\n"
1095 msgstr ""
1096
1097 #. type: tbl table
1098 #: build/C/man7/mq_overview.7:112
1099 #, no-wrap
1100 msgid "mq_receive(3)\tmq_timedreceive(2)\n"
1101 msgstr ""
1102
1103 #. type: tbl table
1104 #: build/C/man7/mq_overview.7:113
1105 #, no-wrap
1106 msgid "mq_send(3)\tmq_timedsend(2)\n"
1107 msgstr ""
1108
1109 #. type: tbl table
1110 #: build/C/man7/mq_overview.7:114
1111 #, no-wrap
1112 msgid "mq_setattr(3)\tmq_getsetattr(2)\n"
1113 msgstr ""
1114
1115 #. type: tbl table
1116 #: build/C/man7/mq_overview.7:115
1117 #, no-wrap
1118 msgid "mq_timedreceive(3)\tmq_timedreceive(2)\n"
1119 msgstr ""
1120
1121 #. type: tbl table
1122 #: build/C/man7/mq_overview.7:116
1123 #, no-wrap
1124 msgid "mq_timedsend(3)\tmq_timedsend(2)\n"
1125 msgstr ""
1126
1127 #. type: tbl table
1128 #: build/C/man7/mq_overview.7:117
1129 #, no-wrap
1130 msgid "mq_unlink(3)\tmq_unlink(2)\n"
1131 msgstr ""
1132
1133 #. type: SS
1134 #: build/C/man7/mq_overview.7:120
1135 #, no-wrap
1136 msgid "Versions"
1137 msgstr ""
1138
1139 #. type: Plain text
1140 #: build/C/man7/mq_overview.7:123
1141 msgid ""
1142 "POSIX message queues have been supported on Linux since kernel 2.6.6.  Glibc "
1143 "support has been provided since version 2.3.4."
1144 msgstr ""
1145
1146 #. type: SS
1147 #: build/C/man7/mq_overview.7:123
1148 #, no-wrap
1149 msgid "Kernel configuration"
1150 msgstr ""
1151
1152 #. type: Plain text
1153 #: build/C/man7/mq_overview.7:128
1154 msgid ""
1155 "Support for POSIX message queues is configurable via the "
1156 "B<CONFIG_POSIX_MQUEUE> kernel configuration option.  This option is enabled "
1157 "by default."
1158 msgstr ""
1159
1160 #. type: SS
1161 #: build/C/man7/mq_overview.7:128
1162 #, no-wrap
1163 msgid "Persistence"
1164 msgstr ""
1165
1166 #. type: Plain text
1167 #: build/C/man7/mq_overview.7:133
1168 msgid ""
1169 "POSIX message queues have kernel persistence: if not removed by "
1170 "B<mq_unlink>(3), a message queue will exist until the system is shut down."
1171 msgstr ""
1172
1173 #. type: SS
1174 #: build/C/man7/mq_overview.7:133
1175 #, no-wrap
1176 msgid "Linking"
1177 msgstr ""
1178
1179 #. type: Plain text
1180 #: build/C/man7/mq_overview.7:138
1181 msgid ""
1182 "Programs using the POSIX message queue API must be compiled with I<cc -lrt> "
1183 "to link against the real-time library, I<librt>."
1184 msgstr ""
1185
1186 #. type: SS
1187 #: build/C/man7/mq_overview.7:138
1188 #, no-wrap
1189 msgid "/proc interfaces"
1190 msgstr ""
1191
1192 #. type: Plain text
1193 #: build/C/man7/mq_overview.7:141
1194 msgid ""
1195 "The following interfaces can be used to limit the amount of kernel memory "
1196 "consumed by POSIX message queues:"
1197 msgstr ""
1198
1199 #. type: TP
1200 #: build/C/man7/mq_overview.7:141
1201 #, no-wrap
1202 msgid "I</proc/sys/fs/mqueue/msg_max>"
1203 msgstr ""
1204
1205 #. type: Plain text
1206 #: build/C/man7/mq_overview.7:162
1207 msgid ""
1208 "This file can be used to view and change the ceiling value for the maximum "
1209 "number of messages in a queue.  This value acts as a ceiling on the "
1210 "I<attr-E<gt>mq_maxmsg> argument given to B<mq_open>(3).  The default value "
1211 "for I<msg_max> is 10.  The minimum value is 1 (10 in kernels before "
1212 "2.6.28).  The upper limit is B<HARD_MAX>: I<(131072\\ /\\ sizeof(void\\ *))> "
1213 "(32768 on Linux/86).  This limit is ignored for privileged processes "
1214 "(B<CAP_SYS_RESOURCE>), but the B<HARD_MAX> ceiling is nevertheless imposed."
1215 msgstr ""
1216
1217 #. type: TP
1218 #: build/C/man7/mq_overview.7:162
1219 #, no-wrap
1220 msgid "I</proc/sys/fs/mqueue/msgsize_max>"
1221 msgstr ""
1222
1223 #. type: Plain text
1224 #: build/C/man7/mq_overview.7:181
1225 msgid ""
1226 "This file can be used to view and change the ceiling on the maximum message "
1227 "size.  This value acts as a ceiling on the I<attr-E<gt>mq_msgsize> argument "
1228 "given to B<mq_open>(3).  The default value for I<msgsize_max> is 8192 "
1229 "bytes.  The minimum value is 128 (8192 in kernels before 2.6.28).  The upper "
1230 "limit for I<msgsize_max> is 1,048,576 (in kernels before 2.6.28, the upper "
1231 "limit was B<INT_MAX>; that is, 2,147,483,647 on Linux/86).  This limit is "
1232 "ignored for privileged processes (B<CAP_SYS_RESOURCE>)."
1233 msgstr ""
1234
1235 #. type: TP
1236 #: build/C/man7/mq_overview.7:181
1237 #, no-wrap
1238 msgid "I</proc/sys/fs/mqueue/queues_max>"
1239 msgstr ""
1240
1241 #. type: Plain text
1242 #: build/C/man7/mq_overview.7:191
1243 msgid ""
1244 "This file can be used to view and change the system-wide limit on the number "
1245 "of message queues that can be created.  Only privileged processes "
1246 "(B<CAP_SYS_RESOURCE>)  can create new message queues once this limit has "
1247 "been reached.  The default value for I<queues_max> is 256; it can be changed "
1248 "to any value in the range 0 to INT_MAX."
1249 msgstr ""
1250
1251 #. type: SS
1252 #: build/C/man7/mq_overview.7:191
1253 #, no-wrap
1254 msgid "Resource limit"
1255 msgstr ""
1256
1257 #. type: Plain text
1258 #: build/C/man7/mq_overview.7:198
1259 msgid ""
1260 "The B<RLIMIT_MSGQUEUE> resource limit, which places a limit on the amount of "
1261 "space that can be consumed by all of the message queues belonging to a "
1262 "process's real user ID, is described in B<getrlimit>(2)."
1263 msgstr ""
1264
1265 #. type: SS
1266 #: build/C/man7/mq_overview.7:198
1267 #, no-wrap
1268 msgid "Mounting the message queue file system"
1269 msgstr ""
1270
1271 #. type: Plain text
1272 #: build/C/man7/mq_overview.7:204
1273 msgid ""
1274 "On Linux, message queues are created in a virtual file system.  (Other "
1275 "implementations may also provide such a feature, but the details are likely "
1276 "to differ.)  This file system can be mounted (by the superuser) using the "
1277 "following commands:"
1278 msgstr ""
1279
1280 #. type: Plain text
1281 #: build/C/man7/mq_overview.7:209
1282 #, no-wrap
1283 msgid ""
1284 "#B< mkdir /dev/mqueue>\n"
1285 "#B< mount -t mqueue none /dev/mqueue>\n"
1286 msgstr ""
1287
1288 #. type: Plain text
1289 #: build/C/man7/mq_overview.7:213
1290 msgid "The sticky bit is automatically enabled on the mount directory."
1291 msgstr ""
1292
1293 #. type: Plain text
1294 #: build/C/man7/mq_overview.7:220
1295 msgid ""
1296 "After the file system has been mounted, the message queues on the system can "
1297 "be viewed and manipulated using the commands usually used for files (e.g., "
1298 "B<ls>(1)  and B<rm>(1))."
1299 msgstr ""
1300
1301 #. type: Plain text
1302 #: build/C/man7/mq_overview.7:223
1303 msgid ""
1304 "The contents of each file in the directory consist of a single line "
1305 "containing information about the queue:"
1306 msgstr ""
1307
1308 #. type: Plain text
1309 #: build/C/man7/mq_overview.7:228
1310 #, no-wrap
1311 msgid ""
1312 "$B< cat /dev/mqueue/mymq>\n"
1313 "QSIZE:129     NOTIFY:2    SIGNO:0    NOTIFY_PID:8260\n"
1314 msgstr ""
1315
1316 #. type: Plain text
1317 #: build/C/man7/mq_overview.7:232
1318 msgid "These fields are as follows:"
1319 msgstr ""
1320
1321 #. type: TP
1322 #: build/C/man7/mq_overview.7:232
1323 #, no-wrap
1324 msgid "B<QSIZE>"
1325 msgstr ""
1326
1327 #. type: Plain text
1328 #: build/C/man7/mq_overview.7:235
1329 msgid "Number of bytes of data in all messages in the queue."
1330 msgstr ""
1331
1332 #. type: TP
1333 #: build/C/man7/mq_overview.7:235
1334 #, no-wrap
1335 msgid "B<NOTIFY_PID>"
1336 msgstr ""
1337
1338 #. type: Plain text
1339 #: build/C/man7/mq_overview.7:241
1340 msgid ""
1341 "If this is nonzero, then the process with this PID has used B<mq_notify>(3)  "
1342 "to register for asynchronous message notification, and the remaining fields "
1343 "describe how notification occurs."
1344 msgstr ""
1345
1346 #. type: TP
1347 #: build/C/man7/mq_overview.7:241
1348 #, no-wrap
1349 msgid "B<NOTIFY>"
1350 msgstr ""
1351
1352 #. type: Plain text
1353 #: build/C/man7/mq_overview.7:251
1354 msgid ""
1355 "Notification method: 0 is B<SIGEV_SIGNAL>; 1 is B<SIGEV_NONE>; and 2 is "
1356 "B<SIGEV_THREAD>."
1357 msgstr ""
1358
1359 #. type: TP
1360 #: build/C/man7/mq_overview.7:251
1361 #, no-wrap
1362 msgid "B<SIGNO>"
1363 msgstr ""
1364
1365 #. type: Plain text
1366 #: build/C/man7/mq_overview.7:255
1367 msgid "Signal number to be used for B<SIGEV_SIGNAL>."
1368 msgstr ""
1369
1370 #. type: SS
1371 #: build/C/man7/mq_overview.7:255
1372 #, no-wrap
1373 msgid "Polling message queue descriptors"
1374 msgstr ""
1375
1376 #. type: Plain text
1377 #: build/C/man7/mq_overview.7:263
1378 msgid ""
1379 "On Linux, a message queue descriptor is actually a file descriptor, and can "
1380 "be monitored using B<select>(2), B<poll>(2), or B<epoll>(7).  This is not "
1381 "portable."
1382 msgstr ""
1383
1384 #. type: Plain text
1385 #: build/C/man7/mq_overview.7:275
1386 msgid ""
1387 "System V message queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.) are "
1388 "an older API for exchanging messages between processes.  POSIX message "
1389 "queues provide a better designed interface than System V message queues; on "
1390 "the other hand POSIX message queues are less widely available (especially on "
1391 "older systems) than System V message queues."
1392 msgstr ""
1393
1394 #. type: Plain text
1395 #: build/C/man7/mq_overview.7:278
1396 msgid ""
1397 "Linux does not currently (2.6.26) support the use of access control lists "
1398 "(ACLs) for POSIX message queues."
1399 msgstr ""
1400
1401 #. type: Plain text
1402 #: build/C/man7/mq_overview.7:281
1403 msgid ""
1404 "An example of the use of various message queue functions is shown in "
1405 "B<mq_notify>(3)."
1406 msgstr ""
1407
1408 #. type: Plain text
1409 #: build/C/man7/mq_overview.7:294
1410 msgid ""
1411 "B<getrlimit>(2), B<mq_getsetattr>(2), B<poll>(2), B<select>(2), "
1412 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1413 "B<mq_receive>(3), B<mq_send>(3), B<mq_unlink>(3), B<epoll>(7)"
1414 msgstr ""
1415
1416 #. type: TH
1417 #: build/C/man3/mq_receive.3:26
1418 #, no-wrap
1419 msgid "MQ_RECEIVE"
1420 msgstr ""
1421
1422 #. type: TH
1423 #: build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26
1424 #, no-wrap
1425 msgid "2010-09-20"
1426 msgstr ""
1427
1428 #. type: Plain text
1429 #: build/C/man3/mq_receive.3:29
1430 msgid "mq_receive, mq_timedreceive - receive a message from a message queue"
1431 msgstr ""
1432
1433 #. type: Plain text
1434 #: build/C/man3/mq_receive.3:35
1435 #, no-wrap
1436 msgid ""
1437 "B<ssize_t mq_receive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
1438 "B<                   size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<);>\n"
1439 msgstr ""
1440
1441 #. type: Plain text
1442 #: build/C/man3/mq_receive.3:38 build/C/man3/mq_send.3:38
1443 #, no-wrap
1444 msgid ""
1445 "B<#include E<lt>time.hE<gt>>\n"
1446 "B<#include E<lt>mqueue.hE<gt>>\n"
1447 msgstr ""
1448
1449 #. type: Plain text
1450 #: build/C/man3/mq_receive.3:42
1451 #, no-wrap
1452 msgid ""
1453 "B<ssize_t mq_timedreceive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
1454 "B<                   size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<,>\n"
1455 "B<                   const struct timespec *>I<abs_timeout>B<);>\n"
1456 msgstr ""
1457
1458 #. type: Plain text
1459 #: build/C/man3/mq_receive.3:50 build/C/man3/mq_send.3:50
1460 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1461 msgstr ""
1462
1463 #. type: Plain text
1464 #: build/C/man3/mq_receive.3:53
1465 msgid "B<mq_timedreceive>():"
1466 msgstr ""
1467
1468 #. type: Plain text
1469 #: build/C/man3/mq_receive.3:55 build/C/man3/mq_send.3:55
1470 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
1471 msgstr ""
1472
1473 #. type: Plain text
1474 #: build/C/man3/mq_receive.3:76
1475 msgid ""
1476 "B<mq_receive>()  removes the oldest message with the highest priority from "
1477 "the message queue referred to by the descriptor I<mqdes>, and places it in "
1478 "the buffer pointed to by I<msg_ptr>.  The I<msg_len> argument specifies the "
1479 "size of the buffer pointed to by I<msg_ptr>; this must be greater than the "
1480 "I<mq_msgsize> attribute of the queue (see B<mq_getattr>(3)).  If I<prio> is "
1481 "not NULL, then the buffer to which it points is used to return the priority "
1482 "associated with the received message."
1483 msgstr ""
1484
1485 #. type: Plain text
1486 #: build/C/man3/mq_receive.3:86
1487 msgid ""
1488 "If the queue is empty, then, by default, B<mq_receive>()  blocks until a "
1489 "message becomes available, or the call is interrupted by a signal handler.  "
1490 "If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
1491 "the call instead fails immediately with the error B<EAGAIN>."
1492 msgstr ""
1493
1494 #. type: Plain text
1495 #: build/C/man3/mq_receive.3:99
1496 msgid ""
1497 "B<mq_timedreceive>()  behaves just like B<mq_receive>(), except that if the "
1498 "queue is empty and the B<O_NONBLOCK> flag is not enabled for the message "
1499 "queue description, then I<abs_timeout> points to a structure which specifies "
1500 "a ceiling on the time for which the call will block.  This ceiling is an "
1501 "absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
1502 "00:00:00 +0000 (UTC), and it is specified in the following structure:"
1503 msgstr ""
1504
1505 #. type: Plain text
1506 #: build/C/man3/mq_receive.3:106 build/C/man3/mq_send.3:112
1507 #, no-wrap
1508 msgid ""
1509 "struct timespec {\n"
1510 "    time_t tv_sec;        /* seconds */\n"
1511 "    long   tv_nsec;       /* nanoseconds */\n"
1512 "};\n"
1513 msgstr ""
1514
1515 #. type: Plain text
1516 #: build/C/man3/mq_receive.3:113
1517 msgid ""
1518 "If no message is available, and the timeout has already expired by the time "
1519 "of the call, B<mq_timedreceive>()  returns immediately."
1520 msgstr ""
1521
1522 #. type: Plain text
1523 #: build/C/man3/mq_receive.3:122
1524 msgid ""
1525 "On success, B<mq_receive>()  and B<mq_timedreceive>()  return the number of "
1526 "bytes in the received message; on error, -1 is returned, with I<errno> set "
1527 "to indicate the error."
1528 msgstr ""
1529
1530 #. type: TP
1531 #: build/C/man3/mq_receive.3:123 build/C/man3/mq_send.3:128 build/C/man2/msgop.2:310 build/C/man2/msgop.2:365
1532 #, no-wrap
1533 msgid "B<EAGAIN>"
1534 msgstr ""
1535
1536 #. type: Plain text
1537 #: build/C/man3/mq_receive.3:129
1538 msgid ""
1539 "The queue was empty, and the B<O_NONBLOCK> flag was set for the message "
1540 "queue description referred to by I<mqdes>."
1541 msgstr ""
1542
1543 #. type: Plain text
1544 #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139
1545 msgid "The descriptor specified in I<mqdes> was invalid."
1546 msgstr ""
1547
1548 #. type: TP
1549 #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139 build/C/man2/msgop.2:326 build/C/man2/msgop.2:380
1550 #, no-wrap
1551 msgid "B<EINTR>"
1552 msgstr ""
1553
1554 #. type: Plain text
1555 #: build/C/man3/mq_receive.3:138 build/C/man3/mq_send.3:143
1556 msgid "The call was interrupted by a signal handler; see B<signal>(7)."
1557 msgstr ""
1558
1559 #. type: Plain text
1560 #: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
1561 msgid ""
1562 "The call would have blocked, and I<abs_timeout> was invalid, either because "
1563 "I<tv_sec> was less than zero, or because I<tv_nsec> was less than zero or "
1564 "greater than 1000 million."
1565 msgstr ""
1566
1567 #. type: TP
1568 #: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
1569 #, no-wrap
1570 msgid "B<EMSGSIZE>"
1571 msgstr ""
1572
1573 #. type: Plain text
1574 #: build/C/man3/mq_receive.3:153
1575 msgid "I<msg_len> was less than the I<mq_msgsize> attribute of the message queue."
1576 msgstr ""
1577
1578 #. type: TP
1579 #: build/C/man3/mq_receive.3:153 build/C/man3/mq_send.3:158
1580 #, no-wrap
1581 msgid "B<ETIMEDOUT>"
1582 msgstr ""
1583
1584 #. type: Plain text
1585 #: build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161
1586 msgid "The call timed out before a message could be transferred."
1587 msgstr ""
1588
1589 #. type: Plain text
1590 #: build/C/man3/mq_receive.3:164
1591 msgid ""
1592 "On Linux, B<mq_timedreceive>()  is a system call, and B<mq_receive>()  is a "
1593 "library function layered on top of that system call."
1594 msgstr ""
1595
1596 #. type: Plain text
1597 #: build/C/man3/mq_receive.3:173
1598 msgid ""
1599 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1600 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
1601 msgstr ""
1602
1603 #. type: TH
1604 #: build/C/man3/mq_send.3:26
1605 #, no-wrap
1606 msgid "MQ_SEND"
1607 msgstr ""
1608
1609 #. type: Plain text
1610 #: build/C/man3/mq_send.3:29
1611 msgid "mq_send, mq_timedsend - send a message to a message queue"
1612 msgstr ""
1613
1614 #. type: Plain text
1615 #: build/C/man3/mq_send.3:35
1616 #, no-wrap
1617 msgid ""
1618 "B<int mq_send(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
1619 "B<              size_t >I<msg_len>B<, unsigned >I<msg_prio>B<);>\n"
1620 msgstr ""
1621
1622 #. type: Plain text
1623 #: build/C/man3/mq_send.3:42
1624 #, no-wrap
1625 msgid ""
1626 "B<int mq_timedsend(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
1627 "B<              size_t >I<msg_len>B<, unsigned >I<msg_prio>B<,>\n"
1628 "B<              const struct timespec *>I<abs_timeout>B<);>\n"
1629 msgstr ""
1630
1631 #. type: Plain text
1632 #: build/C/man3/mq_send.3:53
1633 msgid "B<mq_timedsend>():"
1634 msgstr ""
1635
1636 #. type: Plain text
1637 #: build/C/man3/mq_send.3:71
1638 msgid ""
1639 "B<mq_send>()  adds the message pointed to by I<msg_ptr> to the message queue "
1640 "referred to by the descriptor I<mqdes>.  The I<msg_len> argument specifies "
1641 "the length of the message pointed to by I<msg_ptr>; this length must be less "
1642 "than or equal to the queue's I<mq_msgsize> attribute.  Zero-length messages "
1643 "are allowed."
1644 msgstr ""
1645
1646 #. type: Plain text
1647 #: build/C/man3/mq_send.3:79
1648 msgid ""
1649 "The I<msg_prio> argument is a nonnegative integer that specifies the "
1650 "priority of this message.  Messages are placed on the queue in decreasing "
1651 "order of priority, with newer messages of the same priority being placed "
1652 "after older messages with the same priority."
1653 msgstr ""
1654
1655 #. type: Plain text
1656 #: build/C/man3/mq_send.3:92
1657 msgid ""
1658 "If the message queue is already full (i.e., the number of messages on the "
1659 "queue equals the queue's I<mq_maxmsg> attribute), then, by default, "
1660 "B<mq_send>()  blocks until sufficient space becomes available to allow the "
1661 "message to be queued, or until the call is interrupted by a signal handler.  "
1662 "If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
1663 "the call instead fails immediately with the error B<EAGAIN>."
1664 msgstr ""
1665
1666 #. type: Plain text
1667 #: build/C/man3/mq_send.3:105
1668 msgid ""
1669 "B<mq_timedsend>()  behaves just like B<mq_send>(), except that if the queue "
1670 "is full and the B<O_NONBLOCK> flag is not enabled for the message queue "
1671 "description, then I<abs_timeout> points to a structure which specifies a "
1672 "ceiling on the time for which the call will block.  This ceiling is an "
1673 "absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
1674 "00:00:00 +0000 (UTC), and it is specified in the following structure:"
1675 msgstr ""
1676
1677 #. type: Plain text
1678 #: build/C/man3/mq_send.3:119
1679 msgid ""
1680 "If the message queue is full, and the timeout has already expired by the "
1681 "time of the call, B<mq_timedsend>()  returns immediately."
1682 msgstr ""
1683
1684 #. type: Plain text
1685 #: build/C/man3/mq_send.3:127
1686 msgid ""
1687 "On success, B<mq_send>()  and B<mq_timedsend>()  return zero; on error, -1 "
1688 "is returned, with I<errno> set to indicate the error."
1689 msgstr ""
1690
1691 #. type: Plain text
1692 #: build/C/man3/mq_send.3:134
1693 msgid ""
1694 "The queue was full, and the B<O_NONBLOCK> flag was set for the message queue "
1695 "description referred to by I<mqdes>."
1696 msgstr ""
1697
1698 #. type: Plain text
1699 #: build/C/man3/mq_send.3:158
1700 msgid ""
1701 "I<msg_len> was greater than the I<mq_msgsize> attribute of the message "
1702 "queue."
1703 msgstr ""
1704
1705 #. type: Plain text
1706 #: build/C/man3/mq_send.3:169
1707 msgid ""
1708 "On Linux, B<mq_timedsend>()  is a system call, and B<mq_send>()  is a "
1709 "library function layered on top of that system call."
1710 msgstr ""
1711
1712 #. type: Plain text
1713 #: build/C/man3/mq_send.3:178
1714 msgid ""
1715 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1716 "B<mq_receive>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
1717 msgstr ""
1718
1719 #. type: TH
1720 #: build/C/man3/mq_unlink.3:26
1721 #, no-wrap
1722 msgid "MQ_UNLINK"
1723 msgstr ""
1724
1725 #. type: Plain text
1726 #: build/C/man3/mq_unlink.3:29
1727 msgid "mq_unlink - remove a message queue"
1728 msgstr ""
1729
1730 #. type: Plain text
1731 #: build/C/man3/mq_unlink.3:34
1732 #, no-wrap
1733 msgid "B<int mq_unlink(const char *>I<name>B<);>\n"
1734 msgstr ""
1735
1736 #. type: Plain text
1737 #: build/C/man3/mq_unlink.3:44
1738 msgid ""
1739 "B<mq_unlink>()  removes the specified message queue I<name>.  The message "
1740 "queue name is removed immediately.  The queue itself is destroyed once any "
1741 "other processes that have the queue open close their descriptors referring "
1742 "to the queue."
1743 msgstr ""
1744
1745 #. type: Plain text
1746 #: build/C/man3/mq_unlink.3:50
1747 msgid ""
1748 "On success B<mq_unlink>()  returns 0; on error, -1 is returned, with "
1749 "I<errno> set to indicate the error."
1750 msgstr ""
1751
1752 #. type: Plain text
1753 #: build/C/man3/mq_unlink.3:54
1754 msgid "The caller does not have permission to unlink this message queue."
1755 msgstr ""
1756
1757 #. type: Plain text
1758 #: build/C/man3/mq_unlink.3:62
1759 msgid "There is no message queue with the given I<name>."
1760 msgstr ""
1761
1762 #. type: Plain text
1763 #: build/C/man3/mq_unlink.3:72
1764 msgid ""
1765 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1766 "B<mq_receive>(3), B<mq_send>(3), B<mq_overview>(7)"
1767 msgstr ""
1768
1769 #. type: TH
1770 #: build/C/man2/msgctl.2:35
1771 #, no-wrap
1772 msgid "MSGCTL"
1773 msgstr ""
1774
1775 #. type: TH
1776 #: build/C/man2/msgctl.2:35
1777 #, no-wrap
1778 msgid "2008-08-06"
1779 msgstr ""
1780
1781 #. type: Plain text
1782 #: build/C/man2/msgctl.2:38
1783 msgid "msgctl - message control operations"
1784 msgstr ""
1785
1786 #. type: Plain text
1787 #: build/C/man2/msgctl.2:43 build/C/man2/msgget.2:41 build/C/man2/msgop.2:46
1788 #, no-wrap
1789 msgid ""
1790 "B<#include E<lt>sys/types.hE<gt>>\n"
1791 "B<#include E<lt>sys/ipc.hE<gt>>\n"
1792 "B<#include E<lt>sys/msg.hE<gt>>\n"
1793 msgstr ""
1794
1795 #. type: Plain text
1796 #: build/C/man2/msgctl.2:45
1797 #, no-wrap
1798 msgid "B<int msgctl(int >I<msqid>B<, int >I<cmd>B<, struct msqid_ds *>I<buf>B<);>\n"
1799 msgstr ""
1800
1801 #. type: Plain text
1802 #: build/C/man2/msgctl.2:52
1803 msgid ""
1804 "B<msgctl>()  performs the control operation specified by I<cmd> on the "
1805 "message queue with identifier I<msqid>."
1806 msgstr ""
1807
1808 #. type: Plain text
1809 #: build/C/man2/msgctl.2:56
1810 msgid ""
1811 "The I<msqid_ds> data structure is defined in I<E<lt>sys/msg.hE<gt>> as "
1812 "follows:"
1813 msgstr ""
1814
1815 #. type: Plain text
1816 #: build/C/man2/msgctl.2:73
1817 #, no-wrap
1818 msgid ""
1819 "struct msqid_ds {\n"
1820 "    struct ipc_perm msg_perm;     /* Ownership and permissions */\n"
1821 "    time_t          msg_stime;    /* Time of last msgsnd(2) */\n"
1822 "    time_t          msg_rtime;    /* Time of last msgrcv(2) */\n"
1823 "    time_t          msg_ctime;    /* Time of last change */\n"
1824 "    unsigned long   __msg_cbytes; /* Current number of bytes in\n"
1825 "                                     queue (nonstandard) */\n"
1826 "    msgqnum_t       msg_qnum;     /* Current number of messages\n"
1827 "                                     in queue */\n"
1828 "    msglen_t        msg_qbytes;   /* Maximum number of bytes\n"
1829 "                                     allowed in queue */\n"
1830 "    pid_t           msg_lspid;    /* PID of last msgsnd(2) */\n"
1831 "    pid_t           msg_lrpid;    /* PID of last msgrcv(2) */\n"
1832 "};\n"
1833 msgstr ""
1834
1835 #. type: Plain text
1836 #: build/C/man2/msgctl.2:81
1837 msgid ""
1838 "The I<ipc_perm> structure is defined in I<E<lt>sys/ipc.hE<gt>> as follows "
1839 "(the highlighted fields are settable using B<IPC_SET>):"
1840 msgstr ""
1841
1842 #. type: Plain text
1843 #: build/C/man2/msgctl.2:93
1844 #, no-wrap
1845 msgid ""
1846 "struct ipc_perm {\n"
1847 "    key_t          __key;       /* Key supplied to msgget(2) */\n"
1848 "    uid_t          B<uid>;         /* Effective UID of owner */\n"
1849 "    gid_t          B<gid>;         /* Effective GID of owner */\n"
1850 "    uid_t          cuid;        /* Effective UID of creator */\n"
1851 "    gid_t          cgid;        /* Effective GID of creator */\n"
1852 "    unsigned short B<mode>;        /* Permissions */\n"
1853 "    unsigned short __seq;       /* Sequence number */\n"
1854 "};\n"
1855 msgstr ""
1856
1857 #. type: Plain text
1858 #: build/C/man2/msgctl.2:99
1859 msgid "Valid values for I<cmd> are:"
1860 msgstr ""
1861
1862 #. type: TP
1863 #: build/C/man2/msgctl.2:99
1864 #, no-wrap
1865 msgid "B<IPC_STAT>"
1866 msgstr ""
1867
1868 #. type: Plain text
1869 #: build/C/man2/msgctl.2:108
1870 msgid ""
1871 "Copy information from the kernel data structure associated with I<msqid> "
1872 "into the I<msqid_ds> structure pointed to by I<buf>.  The caller must have "
1873 "read permission on the message queue."
1874 msgstr ""
1875
1876 #. type: TP
1877 #: build/C/man2/msgctl.2:108
1878 #, no-wrap
1879 msgid "B<IPC_SET>"
1880 msgstr ""
1881
1882 #. type: Plain text
1883 #: build/C/man2/msgctl.2:135
1884 msgid ""
1885 "Write the values of some members of the I<msqid_ds> structure pointed to by "
1886 "I<buf> to the kernel data structure associated with this message queue, "
1887 "updating also its I<msg_ctime> member.  The following members of the "
1888 "structure are updated: I<msg_qbytes>, I<msg_perm.uid>, I<msg_perm.gid>, and "
1889 "(the least significant 9 bits of)  I<msg_perm.mode>.  The effective UID of "
1890 "the calling process must match the owner (I<msg_perm.uid>)  or creator "
1891 "(I<msg_perm.cuid>)  of the message queue, or the caller must be privileged.  "
1892 "Appropriate privilege (Linux: the B<CAP_IPC_RESOURCE> capability) is "
1893 "required to raise the I<msg_qbytes> value beyond the system parameter "
1894 "B<MSGMNB>."
1895 msgstr ""
1896
1897 #. type: TP
1898 #: build/C/man2/msgctl.2:135
1899 #, no-wrap
1900 msgid "B<IPC_RMID>"
1901 msgstr ""
1902
1903 #. type: Plain text
1904 #: build/C/man2/msgctl.2:146
1905 msgid ""
1906 "Immediately remove the message queue, awakening all waiting reader and "
1907 "writer processes (with an error return and I<errno> set to B<EIDRM>).  The "
1908 "calling process must have appropriate privileges or its effective user ID "
1909 "must be either that of the creator or owner of the message queue."
1910 msgstr ""
1911
1912 #. type: TP
1913 #: build/C/man2/msgctl.2:146
1914 #, no-wrap
1915 msgid "B<IPC_INFO> (Linux-specific)"
1916 msgstr ""
1917
1918 #. type: Plain text
1919 #: build/C/man2/msgctl.2:159
1920 msgid ""
1921 "Returns information about system-wide message queue limits and parameters in "
1922 "the structure pointed to by I<buf>.  This structure is of type I<msginfo> "
1923 "(thus, a cast is required), defined in I<E<lt>sys/msg.hE<gt>> if the "
1924 "B<_GNU_SOURCE> feature test macro is defined:"
1925 msgstr ""
1926
1927 #. type: Plain text
1928 #: build/C/man2/msgctl.2:183
1929 #, no-wrap
1930 msgid ""
1931 "struct msginfo {\n"
1932 "    int msgpool; /* Size in kibibytes of buffer pool\n"
1933 "                    used to hold message data;\n"
1934 "                    unused within kernel */\n"
1935 "    int msgmap;  /* Maximum number of entries in message\n"
1936 "                    map; unused within kernel */\n"
1937 "    int msgmax;  /* Maximum number of bytes that can be\n"
1938 "                    written in a single message */\n"
1939 "    int msgmnb;  /* Maximum number of bytes that can be\n"
1940 "                    written to queue; used to initialize\n"
1941 "                    msg_qbytes during queue creation\n"
1942 "                    (msgget(2)) */\n"
1943 "    int msgmni;  /* Maximum number of message queues */\n"
1944 "    int msgssz;  /* Message segment size;\n"
1945 "                    unused within kernel */\n"
1946 "    int msgtql;  /* Maximum number of messages on all queues\n"
1947 "                    in system; unused within kernel */\n"
1948 "    unsigned short int msgseg;\n"
1949 "                 /* Maximum number of segments;\n"
1950 "                    unused within kernel */\n"
1951 "};\n"
1952 msgstr ""
1953
1954 #. type: Plain text
1955 #: build/C/man2/msgctl.2:196
1956 msgid ""
1957 "The I<msgmni>, I<msgmax>, and I<msgmnb> settings can be changed via I</proc> "
1958 "files of the same name; see B<proc>(5)  for details."
1959 msgstr ""
1960
1961 #. type: TP
1962 #: build/C/man2/msgctl.2:196
1963 #, no-wrap
1964 msgid "B<MSG_INFO> (Linux-specific)"
1965 msgstr ""
1966
1967 #. type: Plain text
1968 #: build/C/man2/msgctl.2:213
1969 msgid ""
1970 "Returns a I<msginfo> structure containing the same information as for "
1971 "B<IPC_INFO>, except that the following fields are returned with information "
1972 "about system resources consumed by message queues: the I<msgpool> field "
1973 "returns the number of message queues that currently exist on the system; the "
1974 "I<msgmap> field returns the total number of messages in all queues on the "
1975 "system; and the I<msgtql> field returns the total number of bytes in all "
1976 "messages in all queues on the system."
1977 msgstr ""
1978
1979 #. type: TP
1980 #: build/C/man2/msgctl.2:213
1981 #, no-wrap
1982 msgid "B<MSG_STAT> (Linux-specific)"
1983 msgstr ""
1984
1985 #. type: Plain text
1986 #: build/C/man2/msgctl.2:224
1987 msgid ""
1988 "Returns a I<msqid_ds> structure as for B<IPC_STAT>.  However, the I<msqid> "
1989 "argument is not a queue identifier, but instead an index into the kernel's "
1990 "internal array that maintains information about all message queues on the "
1991 "system."
1992 msgstr ""
1993
1994 #. type: Plain text
1995 #: build/C/man2/msgctl.2:245
1996 msgid ""
1997 "On success, B<IPC_STAT>, B<IPC_SET>, and B<IPC_RMID> return 0.  A successful "
1998 "B<IPC_INFO> or B<MSG_INFO> operation returns the index of the highest used "
1999 "entry in the kernel's internal array recording information about all message "
2000 "queues.  (This information can be used with repeated B<MSG_STAT> operations "
2001 "to obtain information about all queues on the system.)  A successful "
2002 "B<MSG_STAT> operation returns the identifier of the queue whose index was "
2003 "given in I<msqid>."
2004 msgstr ""
2005
2006 #. type: Plain text
2007 #: build/C/man2/msgctl.2:249
2008 msgid "On error, -1 is returned with I<errno> indicating the error."
2009 msgstr ""
2010
2011 #. type: Plain text
2012 #: build/C/man2/msgctl.2:253
2013 msgid "On failure, I<errno> is set to one of the following:"
2014 msgstr ""
2015
2016 #. type: Plain text
2017 #: build/C/man2/msgctl.2:266
2018 msgid ""
2019 "The argument I<cmd> is equal to B<IPC_STAT> or B<MSG_STAT>, but the calling "
2020 "process does not have read permission on the message queue I<msqid>, and "
2021 "does not have the B<CAP_IPC_OWNER> capability."
2022 msgstr ""
2023
2024 #. type: TP
2025 #: build/C/man2/msgctl.2:266 build/C/man2/msgop.2:318 build/C/man2/msgop.2:371
2026 #, no-wrap
2027 msgid "B<EFAULT>"
2028 msgstr ""
2029
2030 #. type: Plain text
2031 #: build/C/man2/msgctl.2:277
2032 msgid ""
2033 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_STAT>, but the address "
2034 "pointed to by I<buf> isn't accessible."
2035 msgstr ""
2036
2037 #. type: TP
2038 #: build/C/man2/msgctl.2:277 build/C/man2/msgop.2:323 build/C/man2/msgop.2:376
2039 #, no-wrap
2040 msgid "B<EIDRM>"
2041 msgstr ""
2042
2043 #. type: Plain text
2044 #: build/C/man2/msgctl.2:280 build/C/man2/msgop.2:326
2045 msgid "The message queue was removed."
2046 msgstr ""
2047
2048 #. type: Plain text
2049 #: build/C/man2/msgctl.2:291
2050 msgid ""
2051 "Invalid value for I<cmd> or I<msqid>.  Or: for a B<MSG_STAT> operation, the "
2052 "index value specified in I<msqid> referred to an array slot that is "
2053 "currently unused."
2054 msgstr ""
2055
2056 #. type: TP
2057 #: build/C/man2/msgctl.2:291
2058 #, no-wrap
2059 msgid "B<EPERM>"
2060 msgstr ""
2061
2062 #. type: Plain text
2063 #: build/C/man2/msgctl.2:309
2064 msgid ""
2065 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_RMID>, but the "
2066 "effective user ID of the calling process is not the creator (as found in "
2067 "I<msg_perm.cuid>)  or the owner (as found in I<msg_perm.uid>)  of the "
2068 "message queue, and the process is not privileged (Linux: it does not have "
2069 "the B<CAP_SYS_ADMIN> capability)."
2070 msgstr ""
2071
2072 #. type: Plain text
2073 #: build/C/man2/msgctl.2:312 build/C/man2/msgget.2:183 build/C/man2/msgop.2:399
2074 msgid "SVr4, POSIX.1-2001."
2075 msgstr ""
2076
2077 #. type: Plain text
2078 #: build/C/man2/msgctl.2:323
2079 msgid ""
2080 "The B<IPC_INFO>, B<MSG_STAT> and B<MSG_INFO> operations are used by the "
2081 "B<ipcs>(1)  program to provide information on allocated resources.  In the "
2082 "future these may modified or moved to a /proc file system interface."
2083 msgstr ""
2084
2085 #. type: Plain text
2086 #: build/C/man2/msgctl.2:337
2087 msgid ""
2088 "Various fields in the I<struct msqid_ds> were typed as I<short> under Linux "
2089 "2.2 and have become I<long> under Linux 2.4.  To take advantage of this, a "
2090 "recompilation under glibc-2.1.91 or later should suffice.  (The kernel "
2091 "distinguishes old and new calls by an B<IPC_64> flag in I<cmd>.)"
2092 msgstr ""
2093
2094 #. type: Plain text
2095 #: build/C/man2/msgctl.2:344
2096 msgid ""
2097 "B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<capabilities>(7), "
2098 "B<mq_overview>(7), B<svipc>(7)"
2099 msgstr ""
2100
2101 #. type: TH
2102 #: build/C/man2/msgget.2:33
2103 #, no-wrap
2104 msgid "MSGGET"
2105 msgstr ""
2106
2107 #. type: TH
2108 #: build/C/man2/msgget.2:33
2109 #, no-wrap
2110 msgid "2004-05-27"
2111 msgstr ""
2112
2113 #. type: Plain text
2114 #: build/C/man2/msgget.2:36
2115 msgid "msgget - get a message queue identifier"
2116 msgstr ""
2117
2118 #. type: Plain text
2119 #: build/C/man2/msgget.2:43
2120 #, no-wrap
2121 msgid "B<int msgget(key_t >I<key>B<, int >I<msgflg>B<);>\n"
2122 msgstr ""
2123
2124 #. type: Plain text
2125 #: build/C/man2/msgget.2:65
2126 msgid ""
2127 "The B<msgget>()  system call returns the message queue identifier associated "
2128 "with the value of the I<key> argument.  A new message queue is created if "
2129 "I<key> has the value B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no "
2130 "message queue with the given key I<key> exists, and B<IPC_CREAT> is "
2131 "specified in I<msgflg>."
2132 msgstr ""
2133
2134 #. type: Plain text
2135 #: build/C/man2/msgget.2:84
2136 msgid ""
2137 "If I<msgflg> specifies both B<IPC_CREAT> and B<IPC_EXCL> and a message queue "
2138 "already exists for I<key>, then B<msgget>()  fails with I<errno> set to "
2139 "B<EEXIST>.  (This is analogous to the effect of the combination B<O_CREAT | "
2140 "O_EXCL> for B<open>(2).)"
2141 msgstr ""
2142
2143 #. type: Plain text
2144 #: build/C/man2/msgget.2:94
2145 msgid ""
2146 "Upon creation, the least significant bits of the argument I<msgflg> define "
2147 "the permissions of the message queue.  These permission bits have the same "
2148 "format and semantics as the permissions specified for the I<mode> argument "
2149 "of B<open>(2).  (The execute permissions are not used.)"
2150 msgstr ""
2151
2152 #. type: Plain text
2153 #: build/C/man2/msgget.2:101
2154 msgid ""
2155 "If a new message queue is created, then its associated data structure "
2156 "I<msqid_ds> (see B<msgctl>(2))  is initialized as follows:"
2157 msgstr ""
2158
2159 #. type: Plain text
2160 #: build/C/man2/msgget.2:106
2161 msgid ""
2162 "I<msg_perm.cuid> and I<msg_perm.uid> are set to the effective user ID of the "
2163 "calling process."
2164 msgstr ""
2165
2166 #. type: Plain text
2167 #: build/C/man2/msgget.2:111
2168 msgid ""
2169 "I<msg_perm.cgid> and I<msg_perm.gid> are set to the effective group ID of "
2170 "the calling process."
2171 msgstr ""
2172
2173 #. type: Plain text
2174 #: build/C/man2/msgget.2:116
2175 msgid ""
2176 "The least significant 9 bits of I<msg_perm.mode> are set to the least "
2177 "significant 9 bits of I<msgflg>."
2178 msgstr ""
2179
2180 #. type: Plain text
2181 #: build/C/man2/msgget.2:124
2182 msgid ""
2183 "I<msg_qnum>, I<msg_lspid>, I<msg_lrpid>, I<msg_stime> and I<msg_rtime> are "
2184 "set to 0."
2185 msgstr ""
2186
2187 #. type: Plain text
2188 #: build/C/man2/msgget.2:127
2189 msgid "I<msg_ctime> is set to the current time."
2190 msgstr ""
2191
2192 #. type: Plain text
2193 #: build/C/man2/msgget.2:131
2194 msgid "I<msg_qbytes> is set to the system limit B<MSGMNB>."
2195 msgstr ""
2196
2197 #. type: Plain text
2198 #: build/C/man2/msgget.2:135
2199 msgid ""
2200 "If the message queue already exists the permissions are verified, and a "
2201 "check is made to see if it is marked for destruction."
2202 msgstr ""
2203
2204 #. type: Plain text
2205 #: build/C/man2/msgget.2:141
2206 msgid ""
2207 "If successful, the return value will be the message queue identifier (a "
2208 "nonnegative integer), otherwise -1 with I<errno> indicating the error."
2209 msgstr ""
2210
2211 #. type: Plain text
2212 #: build/C/man2/msgget.2:145
2213 msgid "On failure, I<errno> is set to one of the following values:"
2214 msgstr ""
2215
2216 #. type: Plain text
2217 #: build/C/man2/msgget.2:153
2218 msgid ""
2219 "A message queue exists for I<key>, but the calling process does not have "
2220 "permission to access the queue, and does not have the B<CAP_IPC_OWNER> "
2221 "capability."
2222 msgstr ""
2223
2224 #. type: Plain text
2225 #: build/C/man2/msgget.2:163
2226 msgid ""
2227 "A message queue exists for I<key> and I<msgflg> specified both B<IPC_CREAT> "
2228 "and B<IPC_EXCL>."
2229 msgstr ""
2230
2231 #. type: Plain text
2232 #: build/C/man2/msgget.2:171
2233 msgid ""
2234 "No message queue exists for I<key> and I<msgflg> did not specify "
2235 "B<IPC_CREAT>."
2236 msgstr ""
2237
2238 #. type: Plain text
2239 #: build/C/man2/msgget.2:175
2240 msgid ""
2241 "A message queue has to be created but the system does not have enough memory "
2242 "for the new data structure."
2243 msgstr ""
2244
2245 #. type: Plain text
2246 #: build/C/man2/msgget.2:181
2247 msgid ""
2248 "A message queue has to be created but the system limit for the maximum "
2249 "number of message queues (B<MSGMNI>)  would be exceeded."
2250 msgstr ""
2251
2252 #. type: Plain text
2253 #: build/C/man2/msgget.2:193
2254 msgid ""
2255 "B<IPC_PRIVATE> isn't a flag field but a I<key_t> type.  If this special "
2256 "value is used for I<key>, the system call ignores everything but the least "
2257 "significant 9 bits of I<msgflg> and creates a new message queue (on "
2258 "success)."
2259 msgstr ""
2260
2261 #. type: Plain text
2262 #: build/C/man2/msgget.2:197
2263 msgid ""
2264 "The following is a system limit on message queue resources affecting a "
2265 "B<msgget>()  call:"
2266 msgstr ""
2267
2268 #. type: TP
2269 #: build/C/man2/msgget.2:197
2270 #, no-wrap
2271 msgid "B<MSGMNI>"
2272 msgstr ""
2273
2274 #. type: Plain text
2275 #: build/C/man2/msgget.2:203
2276 msgid ""
2277 "System wide maximum number of message queues: policy dependent (on Linux, "
2278 "this limit can be read and modified via I</proc/sys/kernel/msgmni>)."
2279 msgstr ""
2280
2281 #. type: SS
2282 #: build/C/man2/msgget.2:203
2283 #, no-wrap
2284 msgid "Linux Notes"
2285 msgstr ""
2286
2287 #. type: Plain text
2288 #: build/C/man2/msgget.2:209
2289 msgid ""
2290 "Until version 2.3.20 Linux would return B<EIDRM> for a B<msgget>()  on a "
2291 "message queue scheduled for deletion."
2292 msgstr ""
2293
2294 #. type: Plain text
2295 #: build/C/man2/msgget.2:215
2296 msgid ""
2297 "The name choice B<IPC_PRIVATE> was perhaps unfortunate, B<IPC_NEW> would "
2298 "more clearly show its function."
2299 msgstr ""
2300
2301 #. type: Plain text
2302 #: build/C/man2/msgget.2:223
2303 msgid ""
2304 "B<msgctl>(2), B<msgrcv>(2), B<msgsnd>(2), B<ftok>(3), B<capabilities>(7), "
2305 "B<mq_overview>(7), B<svipc>(7)"
2306 msgstr ""
2307
2308 #. type: TH
2309 #: build/C/man2/msgop.2:38
2310 #, no-wrap
2311 msgid "MSGOP"
2312 msgstr ""
2313
2314 #. type: TH
2315 #: build/C/man2/msgop.2:38
2316 #, no-wrap
2317 msgid "2008-04-23"
2318 msgstr ""
2319
2320 #. type: Plain text
2321 #: build/C/man2/msgop.2:41
2322 msgid "msgrcv, msgsnd - message operations"
2323 msgstr ""
2324
2325 #. type: Plain text
2326 #: build/C/man2/msgop.2:49
2327 #, no-wrap
2328 msgid ""
2329 "B<int msgsnd(int >I<msqid>B<, const void *>I<msgp>B<, size_t >I<msgsz>B<, "
2330 "int >I<msgflg>B<);>\n"
2331 msgstr ""
2332
2333 #. type: Plain text
2334 #: build/C/man2/msgop.2:53
2335 #, no-wrap
2336 msgid ""
2337 "B<ssize_t msgrcv(int >I<msqid>B<, void *>I<msgp>B<, size_t >I<msgsz>B<, long "
2338 ">I<msgtyp>B<,>\n"
2339 "B<               int >I<msgflg>B<);>\n"
2340 msgstr ""
2341
2342 #. type: Plain text
2343 #: build/C/man2/msgop.2:63
2344 msgid ""
2345 "The B<msgsnd>()  and B<msgrcv>()  system calls are used, respectively, to "
2346 "send messages to, and receive messages from, a message queue.  The calling "
2347 "process must have write permission on the message queue in order to send a "
2348 "message, and read permission to receive a message."
2349 msgstr ""
2350
2351 #. type: Plain text
2352 #: build/C/man2/msgop.2:68
2353 msgid ""
2354 "The I<msgp> argument is a pointer to caller-defined structure of the "
2355 "following general form:"
2356 msgstr ""
2357
2358 #. type: Plain text
2359 #: build/C/man2/msgop.2:75
2360 #, no-wrap
2361 msgid ""
2362 "struct msgbuf {\n"
2363 "    long mtype;       /* message type, must be E<gt> 0 */\n"
2364 "    char mtext[1];    /* message data */\n"
2365 "};\n"
2366 msgstr ""
2367
2368 #. type: Plain text
2369 #: build/C/man2/msgop.2:94
2370 msgid ""
2371 "The I<mtext> field is an array (or other structure) whose size is specified "
2372 "by I<msgsz>, a nonnegative integer value.  Messages of zero length (i.e., no "
2373 "I<mtext> field) are permitted.  The I<mtype> field must have a strictly "
2374 "positive integer value.  This value can be used by the receiving process for "
2375 "message selection (see the description of B<msgrcv>()  below)."
2376 msgstr ""
2377
2378 #. type: SS
2379 #: build/C/man2/msgop.2:94
2380 #, no-wrap
2381 msgid "msgsnd()"
2382 msgstr ""
2383
2384 #. type: Plain text
2385 #: build/C/man2/msgop.2:102
2386 msgid ""
2387 "The B<msgsnd>()  system call appends a copy of the message pointed to by "
2388 "I<msgp> to the message queue whose identifier is specified by I<msqid>."
2389 msgstr ""
2390
2391 #. type: Plain text
2392 #: build/C/man2/msgop.2:123
2393 msgid ""
2394 "If sufficient space is available in the queue, B<msgsnd>()  succeeds "
2395 "immediately.  (The queue capacity is defined by the I<msg_qbytes> field in "
2396 "the associated data structure for the message queue.  During queue creation "
2397 "this field is initialized to B<MSGMNB> bytes, but this limit can be modified "
2398 "using B<msgctl>(2).)  If insufficient space is available in the queue, then "
2399 "the default behavior of B<msgsnd>()  is to block until space becomes "
2400 "available.  If B<IPC_NOWAIT> is specified in I<msgflg>, then the call "
2401 "instead fails with the error B<EAGAIN>."
2402 msgstr ""
2403
2404 #. type: Plain text
2405 #: build/C/man2/msgop.2:127
2406 msgid "A blocked B<msgsnd>()  call may also fail if:"
2407 msgstr ""
2408
2409 #. type: IP
2410 #: build/C/man2/msgop.2:127 build/C/man2/msgop.2:134 build/C/man2/msgop.2:196 build/C/man2/msgop.2:201 build/C/man2/msgop.2:215 build/C/man2/msgop.2:254 build/C/man2/msgop.2:256 build/C/man2/msgop.2:262
2411 #, no-wrap
2412 msgid "*"
2413 msgstr ""
2414
2415 #. type: Plain text
2416 #: build/C/man2/msgop.2:134
2417 msgid ""
2418 "the queue is removed, in which case the system call fails with I<errno> set "
2419 "to B<EIDRM>; or"
2420 msgstr ""
2421
2422 #. type: Plain text
2423 #: build/C/man2/msgop.2:146
2424 msgid ""
2425 "a signal is caught, in which case the system call fails with I<errno> set to "
2426 "B<EINTR>;B<see> B<signal>(7).  (B<msgsnd>()  is never automatically "
2427 "restarted after being interrupted by a signal handler, regardless of the "
2428 "setting of the B<SA_RESTART> flag when establishing a signal handler.)"
2429 msgstr ""
2430
2431 #. type: Plain text
2432 #: build/C/man2/msgop.2:149 build/C/man2/msgop.2:276
2433 msgid ""
2434 "Upon successful completion the message queue data structure is updated as "
2435 "follows:"
2436 msgstr ""
2437
2438 #. type: Plain text
2439 #: build/C/man2/msgop.2:152
2440 msgid "I<msg_lspid> is set to the process ID of the calling process."
2441 msgstr ""
2442
2443 #. type: Plain text
2444 #: build/C/man2/msgop.2:155
2445 msgid "I<msg_qnum> is incremented by 1."
2446 msgstr ""
2447
2448 #. type: Plain text
2449 #: build/C/man2/msgop.2:158
2450 msgid "I<msg_stime> is set to the current time."
2451 msgstr ""
2452
2453 #. type: SS
2454 #: build/C/man2/msgop.2:158
2455 #, no-wrap
2456 msgid "msgrcv()"
2457 msgstr ""
2458
2459 #. type: Plain text
2460 #: build/C/man2/msgop.2:166
2461 msgid ""
2462 "The B<msgrcv>()  system call removes a message from the queue specified by "
2463 "I<msqid> and places it in the buffer pointed to by I<msgp>."
2464 msgstr ""
2465
2466 #. type: Plain text
2467 #: build/C/man2/msgop.2:192
2468 msgid ""
2469 "The argument I<msgsz> specifies the maximum size in bytes for the member "
2470 "I<mtext> of the structure pointed to by the I<msgp> argument.  If the "
2471 "message text has length greater than I<msgsz>, then the behavior depends on "
2472 "whether B<MSG_NOERROR> is specified in I<msgflg>.  If B<MSG_NOERROR> is "
2473 "specified, then the message text will be truncated (and the truncated part "
2474 "will be lost); if B<MSG_NOERROR> is not specified, then the message isn't "
2475 "removed from the queue and the system call fails returning -1 with I<errno> "
2476 "set to B<E2BIG>."
2477 msgstr ""
2478
2479 #. type: Plain text
2480 #: build/C/man2/msgop.2:196
2481 msgid "The argument I<msgtyp> specifies the type of message requested as follows:"
2482 msgstr ""
2483
2484 #. type: Plain text
2485 #: build/C/man2/msgop.2:201
2486 msgid "If I<msgtyp> is 0, then the first message in the queue is read."
2487 msgstr ""
2488
2489 #. type: Plain text
2490 #: build/C/man2/msgop.2:215
2491 msgid ""
2492 "If I<msgtyp> is greater than 0, then the first message in the queue of type "
2493 "I<msgtyp> is read, unless B<MSG_EXCEPT> was specified in I<msgflg>, in which "
2494 "case the first message in the queue of type not equal to I<msgtyp> will be "
2495 "read."
2496 msgstr ""
2497
2498 #. type: Plain text
2499 #: build/C/man2/msgop.2:223
2500 msgid ""
2501 "If I<msgtyp> is less than 0, then the first message in the queue with the "
2502 "lowest type less than or equal to the absolute value of I<msgtyp> will be "
2503 "read."
2504 msgstr ""
2505
2506 #. type: Plain text
2507 #: build/C/man2/msgop.2:228
2508 msgid ""
2509 "The I<msgflg> argument is a bit mask constructed by ORing together zero or "
2510 "more of the following flags:"
2511 msgstr ""
2512
2513 #. type: TP
2514 #: build/C/man2/msgop.2:228
2515 #, no-wrap
2516 msgid "B<IPC_NOWAIT>"
2517 msgstr ""
2518
2519 #. type: Plain text
2520 #: build/C/man2/msgop.2:235
2521 msgid ""
2522 "Return immediately if no message of the requested type is in the queue.  The "
2523 "system call fails with I<errno> set to B<ENOMSG>."
2524 msgstr ""
2525
2526 #. type: TP
2527 #: build/C/man2/msgop.2:235
2528 #, no-wrap
2529 msgid "B<MSG_EXCEPT>"
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man2/msgop.2:243
2534 msgid ""
2535 "Used with I<msgtyp> greater than 0 to read the first message in the queue "
2536 "with message type that differs from I<msgtyp>."
2537 msgstr ""
2538
2539 #. type: TP
2540 #: build/C/man2/msgop.2:243
2541 #, no-wrap
2542 msgid "B<MSG_NOERROR>"
2543 msgstr ""
2544
2545 #. type: Plain text
2546 #: build/C/man2/msgop.2:248
2547 msgid "To truncate the message text if longer than I<msgsz> bytes."
2548 msgstr ""
2549
2550 #. type: Plain text
2551 #: build/C/man2/msgop.2:254
2552 msgid ""
2553 "If no message of the requested type is available and B<IPC_NOWAIT> isn't "
2554 "specified in I<msgflg>, the calling process is blocked until one of the "
2555 "following conditions occurs:"
2556 msgstr ""
2557
2558 #. type: Plain text
2559 #: build/C/man2/msgop.2:256
2560 msgid "A message of the desired type is placed in the queue."
2561 msgstr ""
2562
2563 #. type: Plain text
2564 #: build/C/man2/msgop.2:262
2565 msgid ""
2566 "The message queue is removed from the system.  In this case the system call "
2567 "fails with I<errno> set to B<EIDRM>."
2568 msgstr ""
2569
2570 #. type: Plain text
2571 #: build/C/man2/msgop.2:273
2572 msgid ""
2573 "The calling process catches a signal.  In this case the system call fails "
2574 "with I<errno> set to B<EINTR>.  (B<msgrcv>()  is never automatically "
2575 "restarted after being interrupted by a signal handler, regardless of the "
2576 "setting of the B<SA_RESTART> flag when establishing a signal handler.)"
2577 msgstr ""
2578
2579 #. type: Plain text
2580 #: build/C/man2/msgop.2:279
2581 msgid "I<msg_lrpid> is set to the process ID of the calling process."
2582 msgstr ""
2583
2584 #. type: Plain text
2585 #: build/C/man2/msgop.2:282
2586 msgid "I<msg_qnum> is decremented by 1."
2587 msgstr ""
2588
2589 #. type: Plain text
2590 #: build/C/man2/msgop.2:285
2591 msgid "I<msg_rtime> is set to the current time."
2592 msgstr ""
2593
2594 #. type: Plain text
2595 #: build/C/man2/msgop.2:298
2596 msgid ""
2597 "On failure both functions return -1 with I<errno> indicating the error, "
2598 "otherwise B<msgsnd>()  returns 0 and B<msgrcv>()  returns the number of "
2599 "bytes actually copied into the I<mtext> array."
2600 msgstr ""
2601
2602 #. type: Plain text
2603 #: build/C/man2/msgop.2:304
2604 msgid ""
2605 "When B<msgsnd>()  fails, I<errno> will be set to one among the following "
2606 "values:"
2607 msgstr ""
2608
2609 #. type: Plain text
2610 #: build/C/man2/msgop.2:310
2611 msgid ""
2612 "The calling process does not have write permission on the message queue, and "
2613 "does not have the B<CAP_IPC_OWNER> capability."
2614 msgstr ""
2615
2616 #. type: Plain text
2617 #: build/C/man2/msgop.2:318
2618 msgid ""
2619 "The message can't be sent due to the I<msg_qbytes> limit for the queue and "
2620 "B<IPC_NOWAIT> was specified in I<msgflg>."
2621 msgstr ""
2622
2623 #. type: Plain text
2624 #: build/C/man2/msgop.2:323 build/C/man2/msgop.2:376
2625 msgid "The address pointed to by I<msgp> isn't accessible."
2626 msgstr ""
2627
2628 #. type: Plain text
2629 #: build/C/man2/msgop.2:329
2630 msgid "Sleeping on a full message queue condition, the process caught a signal."
2631 msgstr ""
2632
2633 #. type: Plain text
2634 #: build/C/man2/msgop.2:340
2635 msgid ""
2636 "Invalid I<msqid> value, or nonpositive I<mtype> value, or invalid I<msgsz> "
2637 "value (less than 0 or greater than the system value B<MSGMAX>)."
2638 msgstr ""
2639
2640 #. type: Plain text
2641 #: build/C/man2/msgop.2:345
2642 msgid ""
2643 "The system does not have enough memory to make a copy of the message pointed "
2644 "to by I<msgp>."
2645 msgstr ""
2646
2647 #. type: Plain text
2648 #: build/C/man2/msgop.2:351
2649 msgid ""
2650 "When B<msgrcv>()  fails, I<errno> will be set to one among the following "
2651 "values:"
2652 msgstr ""
2653
2654 #. type: TP
2655 #: build/C/man2/msgop.2:351
2656 #, no-wrap
2657 msgid "B<E2BIG>"
2658 msgstr ""
2659
2660 #. type: Plain text
2661 #: build/C/man2/msgop.2:359
2662 msgid ""
2663 "The message text length is greater than I<msgsz> and B<MSG_NOERROR> isn't "
2664 "specified in I<msgflg>."
2665 msgstr ""
2666
2667 #. type: Plain text
2668 #: build/C/man2/msgop.2:365
2669 msgid ""
2670 "The calling process does not have read permission on the message queue, and "
2671 "does not have the B<CAP_IPC_OWNER> capability."
2672 msgstr ""
2673
2674 #. type: Plain text
2675 #: build/C/man2/msgop.2:371
2676 msgid ""
2677 "No message was available in the queue and B<IPC_NOWAIT> was specified in "
2678 "I<msgflg>."
2679 msgstr ""
2680
2681 #. type: Plain text
2682 #: build/C/man2/msgop.2:380
2683 msgid ""
2684 "While the process was sleeping to receive a message, the message queue was "
2685 "removed."
2686 msgstr ""
2687
2688 #. type: Plain text
2689 #: build/C/man2/msgop.2:385
2690 msgid ""
2691 "While the process was sleeping to receive a message, the process caught a "
2692 "signal; see B<signal>(7)."
2693 msgstr ""
2694
2695 #. type: Plain text
2696 #: build/C/man2/msgop.2:391
2697 msgid "I<msgqid> was invalid, or I<msgsz> was less than 0."
2698 msgstr ""
2699
2700 #. type: TP
2701 #: build/C/man2/msgop.2:391
2702 #, no-wrap
2703 msgid "B<ENOMSG>"
2704 msgstr ""
2705
2706 #. type: Plain text
2707 #: build/C/man2/msgop.2:397
2708 msgid ""
2709 "B<IPC_NOWAIT> was specified in I<msgflg> and no message of the requested "
2710 "type existed on the message queue."
2711 msgstr ""
2712
2713 #. type: Plain text
2714 #: build/C/man2/msgop.2:406
2715 msgid ""
2716 "The I<msgp> argument is declared as I<struct msgbuf *> with libc4, libc5, "
2717 "glibc 2.0, glibc 2.1.  It is declared as I<void *> with glibc 2.2 and later, "
2718 "as required by SUSv2 and SUSv3."
2719 msgstr ""
2720
2721 #. type: Plain text
2722 #: build/C/man2/msgop.2:410
2723 msgid ""
2724 "The following limits on message queue resources affect the B<msgsnd>()  "
2725 "call:"
2726 msgstr ""
2727
2728 #. type: TP
2729 #: build/C/man2/msgop.2:410
2730 #, no-wrap
2731 msgid "B<MSGMAX>"
2732 msgstr ""
2733
2734 #. type: Plain text
2735 #: build/C/man2/msgop.2:415
2736 msgid ""
2737 "Maximum size for a message text: 8192 bytes (on Linux, this limit can be "
2738 "read and modified via I</proc/sys/kernel/msgmax>)."
2739 msgstr ""
2740
2741 #. type: TP
2742 #: build/C/man2/msgop.2:415
2743 #, no-wrap
2744 msgid "B<MSGMNB>"
2745 msgstr ""
2746
2747 #. type: Plain text
2748 #: build/C/man2/msgop.2:425
2749 msgid ""
2750 "Default maximum size in bytes of a message queue: 16384 bytes (on Linux, "
2751 "this limit can be read and modified via I</proc/sys/kernel/msgmnb>).  The "
2752 "superuser can increase the size of a message queue beyond B<MSGMNB> by a "
2753 "B<msgctl>(2)  system call."
2754 msgstr ""
2755
2756 #. type: Plain text
2757 #: build/C/man2/msgop.2:431
2758 msgid ""
2759 "The implementation has no intrinsic limits for the system wide maximum "
2760 "number of message headers (B<MSGTQL>)  and for the system wide maximum size "
2761 "in bytes of the message pool (B<MSGPOOL>)."
2762 msgstr ""
2763
2764 #. type: Plain text
2765 #: build/C/man2/msgop.2:437
2766 msgid ""
2767 "B<msgctl>(2), B<msgget>(2), B<capabilities>(7), B<mq_overview>(7), "
2768 "B<svipc>(7)"
2769 msgstr ""