OSDN Git Service

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