OSDN Git Service

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