OSDN Git Service

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