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.
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2013-03-22 01: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"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man3/mq_close.3:26
26 #: build/C/man3/mq_close.3:26 build/C/man3/mq_getattr.3:26 build/C/man3/mq_unlink.3:26
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
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
40 msgid "Linux Programmer's Manual"
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
50 #: build/C/man3/mq_close.3:29
51 msgid "mq_close - close a message queue descriptor"
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
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
63 msgid "B<#include E<lt>mqueue.hE<gt>>\n"
67 #: build/C/man3/mq_close.3:34
69 msgid "B<int mq_close(mqd_t >I<mqdes>B<);>\n"
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>."
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
84 #: build/C/man3/mq_close.3:41
85 msgid "B<mq_close>() closes the message queue descriptor I<mqdes>."
89 #: build/C/man3/mq_close.3:47
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."
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
103 #: build/C/man3/mq_close.3:53
105 "On success B<mq_close>() returns 0; on error, -1 is returned, with I<errno> "
106 "set to indicate the error."
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
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
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."
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
129 msgid "CONFORMING TO"
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."
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
144 #: build/C/man3/mq_close.3:65
146 "All open message queues are automatically closed on process termination, or "
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:352 build/C/man2/msgget.2:230 build/C/man2/msgop.2:446
157 #: build/C/man3/mq_close.3:73
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)"
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:359 build/C/man2/msgget.2:238 build/C/man2/msgop.2:452
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:366 build/C/man2/msgget.2:245 build/C/man2/msgop.2:459
172 "This page is part of release 3.50 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/."
178 #: build/C/man3/mq_getattr.3:26
184 #: build/C/man3/mq_getattr.3:29
185 msgid "mq_getattr, mq_setattr - get/set message queue attributes"
189 #: build/C/man3/mq_getattr.3:34
191 msgid "B<int mq_getattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<attr>B<);>\n"
195 #: build/C/man3/mq_getattr.3:37
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"
203 #: build/C/man3/mq_getattr.3:47
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>."
210 #: build/C/man3/mq_getattr.3:54
212 "B<mq_getattr>() returns an I<mq_attr> structure in the buffer pointed by "
213 "I<attr>. This structure is defined as:"
217 #: build/C/man3/mq_getattr.3:63
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"
229 #: build/C/man3/mq_getattr.3:73
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 "
238 #: build/C/man3/mq_getattr.3:94
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)."
250 #: build/C/man3/mq_getattr.3:98
252 "The I<mq_curmsgs> field returns the number of messages currently held in the "
257 #: build/C/man3/mq_getattr.3:118
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 "
269 #: build/C/man3/mq_getattr.3:126
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."
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
282 #: build/C/man3/mq_getattr.3:137
283 msgid "I<newattr-E<gt>mq_flags> contained set bits other than B<O_NONBLOCK>."
287 #: build/C/man3/mq_getattr.3:147
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."
294 #: build/C/man3/mq_getattr.3:155
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)"
301 #: build/C/man2/mq_getsetattr.2:26
303 msgid "MQ_GETSETATTR"
307 #: build/C/man2/mq_getsetattr.2:26
313 #: build/C/man2/mq_getsetattr.2:29
314 msgid "mq_getsetattr - get/set message queue attributes"
318 #: build/C/man2/mq_getsetattr.2:33
321 "B<#include E<lt>sys/types.hE<gt>>\n"
322 "B<#include E<lt>mqueue.hE<gt>>\n"
326 #: build/C/man2/mq_getsetattr.2:36
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"
334 #: build/C/man2/mq_getsetattr.2:40
335 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
339 #: build/C/man2/mq_getsetattr.2:42
340 msgid "Do not use this system call."
344 #: build/C/man2/mq_getsetattr.2:50
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)."
352 #: build/C/man2/mq_getsetattr.2:52
353 msgid "This interface is nonstandard; avoid its use."
357 #: build/C/man2/mq_getsetattr.2:56
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 "
365 #: build/C/man2/mq_getsetattr.2:59
366 msgid "B<mq_getattr>(3), B<mq_overview>(7)"
370 #: build/C/man3/mq_notify.3:26
376 #: build/C/man3/mq_notify.3:26
382 #: build/C/man3/mq_notify.3:29
383 msgid "mq_notify - register for notification when a message is available"
387 #: build/C/man3/mq_notify.3:34
389 msgid "B<int mq_notify(mqd_t >I<mqdes>B<, const struct sigevent *>I<sevp>B<);>\n"
393 #: build/C/man3/mq_notify.3:43
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>."
401 #: build/C/man3/mq_notify.3:51
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)."
408 #: build/C/man3/mq_notify.3:65
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:"
417 #: build/C/man3/mq_notify.3:65
419 msgid "B<SIGEV_NONE>"
422 #. When is SIGEV_NONE useful?
424 #: build/C/man3/mq_notify.3:70
426 "A \"null\" notification: the calling process is registered as the target for "
427 "notification, but when a message arrives, no notification is sent."
431 #: build/C/man3/mq_notify.3:70
433 msgid "B<SIGEV_SIGNAL>"
436 #. I don't know of other implementations that set
437 #. si_pid and si_uid -- MTK
439 #: build/C/man3/mq_notify.3:90
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."
449 #: build/C/man3/mq_notify.3:90
451 msgid "B<SIGEV_THREAD>"
455 #: build/C/man3/mq_notify.3:98
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."
462 #: build/C/man3/mq_notify.3:101
464 "Only one process can be registered to receive notification from a message "
469 #: build/C/man3/mq_notify.3:108
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 "
478 #: build/C/man3/mq_notify.3:115
480 "Message notification only occurs 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 only occur after the queue is emptied "
483 "and a new message arrives."
487 #: build/C/man3/mq_notify.3:123
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 "
497 #: build/C/man3/mq_notify.3:134
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.)"
509 #: build/C/man3/mq_notify.3:140
511 "On success B<mq_notify>() returns 0; on error, -1 is returned, with "
512 "I<errno> set to indicate the error."
516 #: build/C/man3/mq_notify.3:146
522 #: build/C/man3/mq_notify.3:150
524 "Another process has already registered to receive notification for this "
529 #: build/C/man3/mq_notify.3:160
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."
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
543 #: build/C/man3/mq_notify.3:163 build/C/man3/mq_open.3:217
544 msgid "Insufficient memory."
547 #. Linux does not do this
549 #: build/C/man3/mq_notify.3:174
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>."
557 #: build/C/man3/mq_notify.3:176 build/C/man7/mq_overview.7:278
563 #: build/C/man3/mq_notify.3:182
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."
572 #: build/C/man3/mq_notify.3:189
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"
583 #: build/C/man3/mq_notify.3:192
586 "#define handle_error(msg) \\e\n"
587 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
591 #: build/C/man3/mq_notify.3:200
594 "static void /* Thread start function */\n"
595 "tfunc(union sigval sv)\n"
597 " struct mq_attr attr;\n"
600 " mqd_t mqdes = *((mqd_t *) sv.sival_ptr);\n"
604 #: build/C/man3/mq_notify.3:202
606 msgid " /* Determine max. msg size; allocate buffer to receive msg */\n"
610 #: build/C/man3/mq_notify.3:208
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"
621 #: build/C/man3/mq_notify.3:212
624 " nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL);\n"
626 " handle_error(\"mq_receive\");\n"
630 #: build/C/man3/mq_notify.3:217
633 " printf(\"Read %ld bytes from MQ\\en\", (long) nr);\n"
635 " exit(EXIT_SUCCESS); /* Terminate the process */\n"
640 #: build/C/man3/mq_notify.3:223
644 "main(int argc, char *argv[])\n"
647 " struct sigevent sev;\n"
651 #: build/C/man3/mq_notify.3:228
654 " if (argc != 2) {\n"
655 "\tfprintf(stderr, \"Usage: %s E<lt>mq-nameE<gt>\\en\", argv[0]);\n"
656 "\texit(EXIT_FAILURE);\n"
661 #: build/C/man3/mq_notify.3:232
664 " mqdes = mq_open(argv[1], O_RDONLY);\n"
665 " if (mqdes == (mqd_t) -1)\n"
666 " handle_error(\"mq_open\");\n"
670 #: build/C/man3/mq_notify.3:239
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"
682 #: build/C/man3/mq_notify.3:242
685 " pause(); /* Process will be terminated by thread function */\n"
690 #: build/C/man3/mq_notify.3:252
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)"
697 #: build/C/man3/mq_open.3:26
703 #: build/C/man3/mq_open.3:26
709 #: build/C/man3/mq_open.3:29
710 msgid "mq_open - open a message queue"
714 #: build/C/man3/mq_open.3:34
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"
723 #: build/C/man3/mq_open.3:38
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 "
729 "B< struct mq_attr *>I<attr>B<);>\n"
733 #: build/C/man3/mq_open.3:50
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)."
741 #: build/C/man3/mq_open.3:58
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 "
750 #: build/C/man3/mq_open.3:58
756 #: build/C/man3/mq_open.3:61
757 msgid "Open the queue to receive messages only."
761 #: build/C/man3/mq_open.3:61
767 #: build/C/man3/mq_open.3:64
768 msgid "Open the queue to send messages only."
772 #: build/C/man3/mq_open.3:64
778 #: build/C/man3/mq_open.3:67
779 msgid "Open the queue to both send and receive messages."
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>:"
788 #: build/C/man3/mq_open.3:72
790 msgid "B<O_NONBLOCK>"
794 #: build/C/man3/mq_open.3:81
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>."
802 #: build/C/man3/mq_open.3:81
807 #. In reality the file system IDs are used on Linux.
809 #: build/C/man3/mq_open.3:89
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 "
818 #: build/C/man3/mq_open.3:89
824 #: build/C/man3/mq_open.3:99
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>."
831 #: build/C/man3/mq_open.3:123
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."
844 #: build/C/man3/mq_open.3:135
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."
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
858 #: build/C/man3/mq_open.3:140
860 "The queue exists, but the caller does not have permission to open it in the "
864 #. Note that this isn't consistent with the same case for sem_open()
866 #: build/C/man3/mq_open.3:145
867 msgid "I<name> contained more than one slash."
871 #: build/C/man3/mq_open.3:145 build/C/man2/msgget.2:155
877 #: build/C/man3/mq_open.3:156
879 "Both B<O_CREAT> and B<O_EXCL> were specified in I<oflag>, but a queue with "
880 "this I<name> already exists."
884 #: build/C/man3/mq_open.3:188
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 "
898 #: build/C/man3/mq_open.3:188
904 #: build/C/man3/mq_open.3:192
905 msgid "The process already has the maximum number of files and message queues open."
909 #: build/C/man3/mq_open.3:192 build/C/man3/mq_unlink.3:54
911 msgid "B<ENAMETOOLONG>"
915 #: build/C/man3/mq_open.3:196 build/C/man3/mq_unlink.3:58
916 msgid "I<name> was too long."
920 #: build/C/man3/mq_open.3:196
926 #: build/C/man3/mq_open.3:200
928 "The system limit on the total number of open files and message queues has "
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
939 #: build/C/man3/mq_open.3:209
941 "The B<O_CREAT> flag was not specified in I<oflag>, and no queue with this "
945 #. Note that this isn't consistent with the same case for sem_open()
947 #: build/C/man3/mq_open.3:214
948 msgid "I<name> was just \"/\" followed by no other characters."
952 #: build/C/man3/mq_open.3:217 build/C/man2/msgget.2:177
958 #: build/C/man3/mq_open.3:224
960 "Insufficient space for the creation of a new message queue. This probably "
961 "occurred because the I<queues_max> limit was encountered; see "
966 #: build/C/man3/mq_open.3:226 build/C/man2/msgget.2:224
972 #: build/C/man3/mq_open.3:230
974 "In kernels before 2.6.14, the process umask was not applied to the "
975 "permissions specified in I<mode>."
979 #: build/C/man3/mq_open.3:238
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)"
986 #: build/C/man7/mq_overview.7:26
992 #: build/C/man7/mq_overview.7:26
998 #: build/C/man7/mq_overview.7:29
999 msgid "mq_overview - overview of POSIX message queues"
1003 #: build/C/man7/mq_overview.7:37
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."
1012 #: build/C/man7/mq_overview.7:52
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)."
1024 #: build/C/man7/mq_overview.7:68
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)."
1036 #: build/C/man7/mq_overview.7:81
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."
1047 #: build/C/man7/mq_overview.7:94
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 only requires an implementation to support priorities in the "
1054 "range 0 to 31; some implementations only provide this range."
1058 #: build/C/man7/mq_overview.7:97
1060 "The remainder of this section describes some specific details of the Linux "
1061 "implementation of POSIX message queues."
1065 #: build/C/man7/mq_overview.7:97
1067 msgid "Library interfaces and system calls"
1071 #: build/C/man7/mq_overview.7:103
1073 "In most cases the B<mq_*()> library interfaces listed above are implemented "
1074 "on top of underlying system calls of the same name. Deviations from this "
1075 "scheme are indicated in the following table:"
1079 #: build/C/man7/mq_overview.7:107
1081 msgid "Library interface\tSystem call\n"
1085 #: build/C/man7/mq_overview.7:108
1087 msgid "mq_close(3)\tclose(2)\n"
1091 #: build/C/man7/mq_overview.7:109
1093 msgid "mq_getattr(3)\tmq_getsetattr(2)\n"
1097 #: build/C/man7/mq_overview.7:110
1099 msgid "mq_notify(3)\tmq_notify(2)\n"
1103 #: build/C/man7/mq_overview.7:111
1105 msgid "mq_open(3)\tmq_open(2)\n"
1109 #: build/C/man7/mq_overview.7:112
1111 msgid "mq_receive(3)\tmq_timedreceive(2)\n"
1115 #: build/C/man7/mq_overview.7:113
1117 msgid "mq_send(3)\tmq_timedsend(2)\n"
1121 #: build/C/man7/mq_overview.7:114
1123 msgid "mq_setattr(3)\tmq_getsetattr(2)\n"
1127 #: build/C/man7/mq_overview.7:115
1129 msgid "mq_timedreceive(3)\tmq_timedreceive(2)\n"
1133 #: build/C/man7/mq_overview.7:116
1135 msgid "mq_timedsend(3)\tmq_timedsend(2)\n"
1139 #: build/C/man7/mq_overview.7:117
1141 msgid "mq_unlink(3)\tmq_unlink(2)\n"
1145 #: build/C/man7/mq_overview.7:120
1151 #: build/C/man7/mq_overview.7:123
1153 "POSIX message queues have been supported on Linux since kernel 2.6.6. Glibc "
1154 "support has been provided since version 2.3.4."
1158 #: build/C/man7/mq_overview.7:123
1160 msgid "Kernel configuration"
1164 #: build/C/man7/mq_overview.7:128
1166 "Support for POSIX message queues is configurable via the "
1167 "B<CONFIG_POSIX_MQUEUE> kernel configuration option. This option is enabled "
1172 #: build/C/man7/mq_overview.7:128
1178 #: build/C/man7/mq_overview.7:133
1180 "POSIX message queues have kernel persistence: if not removed by "
1181 "B<mq_unlink>(3), a message queue will exist until the system is shut down."
1185 #: build/C/man7/mq_overview.7:133
1191 #: build/C/man7/mq_overview.7:138
1193 "Programs using the POSIX message queue API must be compiled with I<cc -lrt> "
1194 "to link against the real-time library, I<librt>."
1198 #: build/C/man7/mq_overview.7:138
1200 msgid "/proc interfaces"
1204 #: build/C/man7/mq_overview.7:141
1206 "The following interfaces can be used to limit the amount of kernel memory "
1207 "consumed by POSIX message queues:"
1211 #: build/C/man7/mq_overview.7:141
1213 msgid "I</proc/sys/fs/mqueue/msg_max>"
1217 #: build/C/man7/mq_overview.7:162
1219 "This file can be used to view and change the ceiling value for the maximum "
1220 "number of messages in a queue. This value acts as a ceiling on the "
1221 "I<attr-E<gt>mq_maxmsg> argument given to B<mq_open>(3). The default value "
1222 "for I<msg_max> is 10. The minimum value is 1 (10 in kernels before "
1223 "2.6.28). The upper limit is B<HARD_MAX>: I<(131072\\ /\\ sizeof(void\\ *))> "
1224 "(32768 on Linux/86). This limit is ignored for privileged processes "
1225 "(B<CAP_SYS_RESOURCE>), but the B<HARD_MAX> ceiling is nevertheless imposed."
1229 #: build/C/man7/mq_overview.7:162
1231 msgid "I</proc/sys/fs/mqueue/msgsize_max>"
1235 #: build/C/man7/mq_overview.7:181
1237 "This file can be used to view and change the ceiling on the maximum message "
1238 "size. This value acts as a ceiling on the I<attr-E<gt>mq_msgsize> argument "
1239 "given to B<mq_open>(3). The default value for I<msgsize_max> is 8192 "
1240 "bytes. The minimum value is 128 (8192 in kernels before 2.6.28). The upper "
1241 "limit for I<msgsize_max> is 1,048,576 (in kernels before 2.6.28, the upper "
1242 "limit was B<INT_MAX>; that is, 2,147,483,647 on Linux/86). This limit is "
1243 "ignored for privileged processes (B<CAP_SYS_RESOURCE>)."
1247 #: build/C/man7/mq_overview.7:181
1249 msgid "I</proc/sys/fs/mqueue/queues_max>"
1253 #: build/C/man7/mq_overview.7:191
1255 "This file can be used to view and change the system-wide limit on the number "
1256 "of message queues that can be created. Only privileged processes "
1257 "(B<CAP_SYS_RESOURCE>) can create new message queues once this limit has "
1258 "been reached. The default value for I<queues_max> is 256; it can be changed "
1259 "to any value in the range 0 to INT_MAX."
1263 #: build/C/man7/mq_overview.7:191
1265 msgid "Resource limit"
1269 #: build/C/man7/mq_overview.7:198
1271 "The B<RLIMIT_MSGQUEUE> resource limit, which places a limit on the amount of "
1272 "space that can be consumed by all of the message queues belonging to a "
1273 "process's real user ID, is described in B<getrlimit>(2)."
1277 #: build/C/man7/mq_overview.7:198
1279 msgid "Mounting the message queue file system"
1283 #: build/C/man7/mq_overview.7:204
1285 "On Linux, message queues are created in a virtual file system. (Other "
1286 "implementations may also provide such a feature, but the details are likely "
1287 "to differ.) This file system can be mounted (by the superuser) using the "
1288 "following commands:"
1292 #: build/C/man7/mq_overview.7:209
1295 "#B< mkdir /dev/mqueue>\n"
1296 "#B< mount -t mqueue none /dev/mqueue>\n"
1300 #: build/C/man7/mq_overview.7:213
1301 msgid "The sticky bit is automatically enabled on the mount directory."
1305 #: build/C/man7/mq_overview.7:220
1307 "After the file system has been mounted, the message queues on the system can "
1308 "be viewed and manipulated using the commands usually used for files (e.g., "
1309 "B<ls>(1) and B<rm>(1))."
1313 #: build/C/man7/mq_overview.7:223
1315 "The contents of each file in the directory consist of a single line "
1316 "containing information about the queue:"
1320 #: build/C/man7/mq_overview.7:228
1323 "$B< cat /dev/mqueue/mymq>\n"
1324 "QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260\n"
1328 #: build/C/man7/mq_overview.7:232
1329 msgid "These fields are as follows:"
1333 #: build/C/man7/mq_overview.7:232
1339 #: build/C/man7/mq_overview.7:235
1340 msgid "Number of bytes of data in all messages in the queue."
1344 #: build/C/man7/mq_overview.7:235
1346 msgid "B<NOTIFY_PID>"
1350 #: build/C/man7/mq_overview.7:241
1352 "If this is nonzero, then the process with this PID has used B<mq_notify>(3) "
1353 "to register for asynchronous message notification, and the remaining fields "
1354 "describe how notification occurs."
1358 #: build/C/man7/mq_overview.7:241
1364 #: build/C/man7/mq_overview.7:251
1366 "Notification method: 0 is B<SIGEV_SIGNAL>; 1 is B<SIGEV_NONE>; and 2 is "
1371 #: build/C/man7/mq_overview.7:251
1377 #: build/C/man7/mq_overview.7:255
1378 msgid "Signal number to be used for B<SIGEV_SIGNAL>."
1382 #: build/C/man7/mq_overview.7:255
1384 msgid "Polling message queue descriptors"
1388 #: build/C/man7/mq_overview.7:263
1390 "On Linux, a message queue descriptor is actually a file descriptor, and can "
1391 "be monitored using B<select>(2), B<poll>(2), or B<epoll>(7). This is not "
1396 #: build/C/man7/mq_overview.7:275
1398 "System V message queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.) are "
1399 "an older API for exchanging messages between processes. POSIX message "
1400 "queues provide a better designed interface than System V message queues; on "
1401 "the other hand POSIX message queues are less widely available (especially on "
1402 "older systems) than System V message queues."
1406 #: build/C/man7/mq_overview.7:278
1408 "Linux does not currently (2.6.26) support the use of access control lists "
1409 "(ACLs) for POSIX message queues."
1413 #: build/C/man7/mq_overview.7:281
1415 "An example of the use of various message queue functions is shown in "
1420 #: build/C/man7/mq_overview.7:294
1422 "B<getrlimit>(2), B<mq_getsetattr>(2), B<poll>(2), B<select>(2), "
1423 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1424 "B<mq_receive>(3), B<mq_send>(3), B<mq_unlink>(3), B<epoll>(7)"
1428 #: build/C/man3/mq_receive.3:26
1434 #: build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26
1440 #: build/C/man3/mq_receive.3:29
1441 msgid "mq_receive, mq_timedreceive - receive a message from a message queue"
1445 #: build/C/man3/mq_receive.3:35
1448 "B<ssize_t mq_receive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
1449 "B< size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<);>\n"
1453 #: build/C/man3/mq_receive.3:38 build/C/man3/mq_send.3:38
1456 "B<#include E<lt>time.hE<gt>>\n"
1457 "B<#include E<lt>mqueue.hE<gt>>\n"
1461 #: build/C/man3/mq_receive.3:42
1464 "B<ssize_t mq_timedreceive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
1465 "B< size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<,>\n"
1466 "B< const struct timespec *>I<abs_timeout>B<);>\n"
1470 #: build/C/man3/mq_receive.3:50 build/C/man3/mq_send.3:50
1471 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1475 #: build/C/man3/mq_receive.3:53
1476 msgid "B<mq_timedreceive>():"
1480 #: build/C/man3/mq_receive.3:55 build/C/man3/mq_send.3:55
1481 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
1485 #: build/C/man3/mq_receive.3:76
1487 "B<mq_receive>() removes the oldest message with the highest priority from "
1488 "the message queue referred to by the descriptor I<mqdes>, and places it in "
1489 "the buffer pointed to by I<msg_ptr>. The I<msg_len> argument specifies the "
1490 "size of the buffer pointed to by I<msg_ptr>; this must be greater than the "
1491 "I<mq_msgsize> attribute of the queue (see B<mq_getattr>(3)). If I<msg_prio> "
1492 "is not NULL, then the buffer to which it points is used to return the "
1493 "priority associated with the received message."
1497 #: build/C/man3/mq_receive.3:86
1499 "If the queue is empty, then, by default, B<mq_receive>() blocks until a "
1500 "message becomes available, or the call is interrupted by a signal handler. "
1501 "If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
1502 "the call instead fails immediately with the error B<EAGAIN>."
1506 #: build/C/man3/mq_receive.3:99
1508 "B<mq_timedreceive>() behaves just like B<mq_receive>(), except that if the "
1509 "queue is empty and the B<O_NONBLOCK> flag is not enabled for the message "
1510 "queue description, then I<abs_timeout> points to a structure which specifies "
1511 "a ceiling on the time for which the call will block. This ceiling is an "
1512 "absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
1513 "00:00:00 +0000 (UTC), and it is specified in the following structure:"
1517 #: build/C/man3/mq_receive.3:106 build/C/man3/mq_send.3:112
1520 "struct timespec {\n"
1521 " time_t tv_sec; /* seconds */\n"
1522 " long tv_nsec; /* nanoseconds */\n"
1527 #: build/C/man3/mq_receive.3:113
1529 "If no message is available, and the timeout has already expired by the time "
1530 "of the call, B<mq_timedreceive>() returns immediately."
1534 #: build/C/man3/mq_receive.3:122
1536 "On success, B<mq_receive>() and B<mq_timedreceive>() return the number of "
1537 "bytes in the received message; on error, -1 is returned, with I<errno> set "
1538 "to indicate the error."
1542 #: 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
1548 #: build/C/man3/mq_receive.3:129
1550 "The queue was empty, and the B<O_NONBLOCK> flag was set for the message "
1551 "queue description referred to by I<mqdes>."
1555 #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139
1556 msgid "The descriptor specified in I<mqdes> was invalid."
1560 #: 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
1566 #: build/C/man3/mq_receive.3:138 build/C/man3/mq_send.3:143
1567 msgid "The call was interrupted by a signal handler; see B<signal>(7)."
1571 #: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
1573 "The call would have blocked, and I<abs_timeout> was invalid, either because "
1574 "I<tv_sec> was less than zero, or because I<tv_nsec> was less than zero or "
1575 "greater than 1000 million."
1579 #: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
1585 #: build/C/man3/mq_receive.3:153
1586 msgid "I<msg_len> was less than the I<mq_msgsize> attribute of the message queue."
1590 #: build/C/man3/mq_receive.3:153 build/C/man3/mq_send.3:158
1592 msgid "B<ETIMEDOUT>"
1596 #: build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161
1597 msgid "The call timed out before a message could be transferred."
1601 #: build/C/man3/mq_receive.3:164
1603 "On Linux, B<mq_timedreceive>() is a system call, and B<mq_receive>() is a "
1604 "library function layered on top of that system call."
1608 #: build/C/man3/mq_receive.3:173
1610 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1611 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
1615 #: build/C/man3/mq_send.3:26
1621 #: build/C/man3/mq_send.3:29
1622 msgid "mq_send, mq_timedsend - send a message to a message queue"
1626 #: build/C/man3/mq_send.3:35
1629 "B<int mq_send(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
1630 "B< size_t >I<msg_len>B<, unsigned >I<msg_prio>B<);>\n"
1634 #: build/C/man3/mq_send.3:42
1637 "B<int mq_timedsend(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
1638 "B< size_t >I<msg_len>B<, unsigned >I<msg_prio>B<,>\n"
1639 "B< const struct timespec *>I<abs_timeout>B<);>\n"
1643 #: build/C/man3/mq_send.3:53
1644 msgid "B<mq_timedsend>():"
1648 #: build/C/man3/mq_send.3:71
1650 "B<mq_send>() adds the message pointed to by I<msg_ptr> to the message queue "
1651 "referred to by the descriptor I<mqdes>. The I<msg_len> argument specifies "
1652 "the length of the message pointed to by I<msg_ptr>; this length must be less "
1653 "than or equal to the queue's I<mq_msgsize> attribute. Zero-length messages "
1658 #: build/C/man3/mq_send.3:79
1660 "The I<msg_prio> argument is a nonnegative integer that specifies the "
1661 "priority of this message. Messages are placed on the queue in decreasing "
1662 "order of priority, with newer messages of the same priority being placed "
1663 "after older messages with the same priority."
1667 #: build/C/man3/mq_send.3:92
1669 "If the message queue is already full (i.e., the number of messages on the "
1670 "queue equals the queue's I<mq_maxmsg> attribute), then, by default, "
1671 "B<mq_send>() blocks until sufficient space becomes available to allow the "
1672 "message to be queued, or until the call is interrupted by a signal handler. "
1673 "If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
1674 "the call instead fails immediately with the error B<EAGAIN>."
1678 #: build/C/man3/mq_send.3:105
1680 "B<mq_timedsend>() behaves just like B<mq_send>(), except that if the queue "
1681 "is full and the B<O_NONBLOCK> flag is not enabled for the message queue "
1682 "description, then I<abs_timeout> points to a structure which specifies a "
1683 "ceiling on the time for which the call will block. This ceiling is an "
1684 "absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
1685 "00:00:00 +0000 (UTC), and it is specified in the following structure:"
1689 #: build/C/man3/mq_send.3:119
1691 "If the message queue is full, and the timeout has already expired by the "
1692 "time of the call, B<mq_timedsend>() returns immediately."
1696 #: build/C/man3/mq_send.3:127
1698 "On success, B<mq_send>() and B<mq_timedsend>() return zero; on error, -1 "
1699 "is returned, with I<errno> set to indicate the error."
1703 #: build/C/man3/mq_send.3:134
1705 "The queue was full, and the B<O_NONBLOCK> flag was set for the message queue "
1706 "description referred to by I<mqdes>."
1710 #: build/C/man3/mq_send.3:158
1712 "I<msg_len> was greater than the I<mq_msgsize> attribute of the message "
1717 #: build/C/man3/mq_send.3:169
1719 "On Linux, B<mq_timedsend>() is a system call, and B<mq_send>() is a "
1720 "library function layered on top of that system call."
1724 #: build/C/man3/mq_send.3:178
1726 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1727 "B<mq_receive>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
1731 #: build/C/man3/mq_unlink.3:26
1737 #: build/C/man3/mq_unlink.3:29
1738 msgid "mq_unlink - remove a message queue"
1742 #: build/C/man3/mq_unlink.3:34
1744 msgid "B<int mq_unlink(const char *>I<name>B<);>\n"
1748 #: build/C/man3/mq_unlink.3:44
1750 "B<mq_unlink>() removes the specified message queue I<name>. The message "
1751 "queue name is removed immediately. The queue itself is destroyed once any "
1752 "other processes that have the queue open close their descriptors referring "
1757 #: build/C/man3/mq_unlink.3:50
1759 "On success B<mq_unlink>() returns 0; on error, -1 is returned, with "
1760 "I<errno> set to indicate the error."
1764 #: build/C/man3/mq_unlink.3:54
1765 msgid "The caller does not have permission to unlink this message queue."
1769 #: build/C/man3/mq_unlink.3:62
1770 msgid "There is no message queue with the given I<name>."
1774 #: build/C/man3/mq_unlink.3:72
1776 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1777 "B<mq_receive>(3), B<mq_send>(3), B<mq_overview>(7)"
1781 #: build/C/man2/msgctl.2:37
1787 #: build/C/man2/msgctl.2:37 build/C/man2/msgget.2:35 build/C/man2/msgop.2:40
1793 #: build/C/man2/msgctl.2:40
1794 msgid "msgctl - message control operations"
1798 #: build/C/man2/msgctl.2:45 build/C/man2/msgget.2:43 build/C/man2/msgop.2:48
1801 "B<#include E<lt>sys/types.hE<gt>>\n"
1802 "B<#include E<lt>sys/ipc.hE<gt>>\n"
1803 "B<#include E<lt>sys/msg.hE<gt>>\n"
1807 #: build/C/man2/msgctl.2:47
1809 msgid "B<int msgctl(int >I<msqid>B<, int >I<cmd>B<, struct msqid_ds *>I<buf>B<);>\n"
1813 #: build/C/man2/msgctl.2:54
1815 "B<msgctl>() performs the control operation specified by I<cmd> on the "
1816 "message queue with identifier I<msqid>."
1820 #: build/C/man2/msgctl.2:58
1822 "The I<msqid_ds> data structure is defined in I<E<lt>sys/msg.hE<gt>> as "
1827 #: build/C/man2/msgctl.2:75
1830 "struct msqid_ds {\n"
1831 " struct ipc_perm msg_perm; /* Ownership and permissions */\n"
1832 " time_t msg_stime; /* Time of last msgsnd(2) */\n"
1833 " time_t msg_rtime; /* Time of last msgrcv(2) */\n"
1834 " time_t msg_ctime; /* Time of last change */\n"
1835 " unsigned long __msg_cbytes; /* Current number of bytes in\n"
1836 " queue (nonstandard) */\n"
1837 " msgqnum_t msg_qnum; /* Current number of messages\n"
1839 " msglen_t msg_qbytes; /* Maximum number of bytes\n"
1840 " allowed in queue */\n"
1841 " pid_t msg_lspid; /* PID of last msgsnd(2) */\n"
1842 " pid_t msg_lrpid; /* PID of last msgrcv(2) */\n"
1847 #: build/C/man2/msgctl.2:83
1849 "The I<ipc_perm> structure is defined as follows (the highlighted fields are "
1850 "settable using B<IPC_SET>):"
1854 #: build/C/man2/msgctl.2:95
1857 "struct ipc_perm {\n"
1858 " key_t __key; /* Key supplied to msgget(2) */\n"
1859 " uid_t B<uid>; /* Effective UID of owner */\n"
1860 " gid_t B<gid>; /* Effective GID of owner */\n"
1861 " uid_t cuid; /* Effective UID of creator */\n"
1862 " gid_t cgid; /* Effective GID of creator */\n"
1863 " unsigned short B<mode>; /* Permissions */\n"
1864 " unsigned short __seq; /* Sequence number */\n"
1869 #: build/C/man2/msgctl.2:101
1870 msgid "Valid values for I<cmd> are:"
1874 #: build/C/man2/msgctl.2:101
1880 #: build/C/man2/msgctl.2:110
1882 "Copy information from the kernel data structure associated with I<msqid> "
1883 "into the I<msqid_ds> structure pointed to by I<buf>. The caller must have "
1884 "read permission on the message queue."
1888 #: build/C/man2/msgctl.2:110
1894 #: build/C/man2/msgctl.2:137
1896 "Write the values of some members of the I<msqid_ds> structure pointed to by "
1897 "I<buf> to the kernel data structure associated with this message queue, "
1898 "updating also its I<msg_ctime> member. The following members of the "
1899 "structure are updated: I<msg_qbytes>, I<msg_perm.uid>, I<msg_perm.gid>, and "
1900 "(the least significant 9 bits of) I<msg_perm.mode>. The effective UID of "
1901 "the calling process must match the owner (I<msg_perm.uid>) or creator "
1902 "(I<msg_perm.cuid>) of the message queue, or the caller must be privileged. "
1903 "Appropriate privilege (Linux: the B<CAP_IPC_RESOURCE> capability) is "
1904 "required to raise the I<msg_qbytes> value beyond the system parameter "
1909 #: build/C/man2/msgctl.2:137
1915 #: build/C/man2/msgctl.2:148
1917 "Immediately remove the message queue, awakening all waiting reader and "
1918 "writer processes (with an error return and I<errno> set to B<EIDRM>). The "
1919 "calling process must have appropriate privileges or its effective user ID "
1920 "must be either that of the creator or owner of the message queue."
1924 #: build/C/man2/msgctl.2:148
1926 msgid "B<IPC_INFO> (Linux-specific)"
1930 #: build/C/man2/msgctl.2:161
1932 "Returns information about system-wide message queue limits and parameters in "
1933 "the structure pointed to by I<buf>. This structure is of type I<msginfo> "
1934 "(thus, a cast is required), defined in I<E<lt>sys/msg.hE<gt>> if the "
1935 "B<_GNU_SOURCE> feature test macro is defined:"
1939 #: build/C/man2/msgctl.2:185
1942 "struct msginfo {\n"
1943 " int msgpool; /* Size in kibibytes of buffer pool\n"
1944 " used to hold message data;\n"
1945 " unused within kernel */\n"
1946 " int msgmap; /* Maximum number of entries in message\n"
1947 " map; unused within kernel */\n"
1948 " int msgmax; /* Maximum number of bytes that can be\n"
1949 " written in a single message */\n"
1950 " int msgmnb; /* Maximum number of bytes that can be\n"
1951 " written to queue; used to initialize\n"
1952 " msg_qbytes during queue creation\n"
1954 " int msgmni; /* Maximum number of message queues */\n"
1955 " int msgssz; /* Message segment size;\n"
1956 " unused within kernel */\n"
1957 " int msgtql; /* Maximum number of messages on all queues\n"
1958 " in system; unused within kernel */\n"
1959 " unsigned short int msgseg;\n"
1960 " /* Maximum number of segments;\n"
1961 " unused within kernel */\n"
1966 #: build/C/man2/msgctl.2:198
1968 "The I<msgmni>, I<msgmax>, and I<msgmnb> settings can be changed via I</proc> "
1969 "files of the same name; see B<proc>(5) for details."
1973 #: build/C/man2/msgctl.2:198
1975 msgid "B<MSG_INFO> (Linux-specific)"
1979 #: build/C/man2/msgctl.2:215
1981 "Returns a I<msginfo> structure containing the same information as for "
1982 "B<IPC_INFO>, except that the following fields are returned with information "
1983 "about system resources consumed by message queues: the I<msgpool> field "
1984 "returns the number of message queues that currently exist on the system; the "
1985 "I<msgmap> field returns the total number of messages in all queues on the "
1986 "system; and the I<msgtql> field returns the total number of bytes in all "
1987 "messages in all queues on the system."
1991 #: build/C/man2/msgctl.2:215
1993 msgid "B<MSG_STAT> (Linux-specific)"
1997 #: build/C/man2/msgctl.2:226
1999 "Returns a I<msqid_ds> structure as for B<IPC_STAT>. However, the I<msqid> "
2000 "argument is not a queue identifier, but instead an index into the kernel's "
2001 "internal array that maintains information about all message queues on the "
2006 #: build/C/man2/msgctl.2:247
2008 "On success, B<IPC_STAT>, B<IPC_SET>, and B<IPC_RMID> return 0. A successful "
2009 "B<IPC_INFO> or B<MSG_INFO> operation returns the index of the highest used "
2010 "entry in the kernel's internal array recording information about all message "
2011 "queues. (This information can be used with repeated B<MSG_STAT> operations "
2012 "to obtain information about all queues on the system.) A successful "
2013 "B<MSG_STAT> operation returns the identifier of the queue whose index was "
2014 "given in I<msqid>."
2018 #: build/C/man2/msgctl.2:251
2019 msgid "On error, -1 is returned with I<errno> indicating the error."
2023 #: build/C/man2/msgctl.2:255
2024 msgid "On failure, I<errno> is set to one of the following:"
2028 #: build/C/man2/msgctl.2:268
2030 "The argument I<cmd> is equal to B<IPC_STAT> or B<MSG_STAT>, but the calling "
2031 "process does not have read permission on the message queue I<msqid>, and "
2032 "does not have the B<CAP_IPC_OWNER> capability."
2036 #: build/C/man2/msgctl.2:268 build/C/man2/msgop.2:320 build/C/man2/msgop.2:373
2042 #: build/C/man2/msgctl.2:279
2044 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_STAT>, but the address "
2045 "pointed to by I<buf> isn't accessible."
2049 #: build/C/man2/msgctl.2:279 build/C/man2/msgop.2:325 build/C/man2/msgop.2:378
2055 #: build/C/man2/msgctl.2:282 build/C/man2/msgop.2:328
2056 msgid "The message queue was removed."
2060 #: build/C/man2/msgctl.2:293
2062 "Invalid value for I<cmd> or I<msqid>. Or: for a B<MSG_STAT> operation, the "
2063 "index value specified in I<msqid> referred to an array slot that is "
2068 #: build/C/man2/msgctl.2:293
2074 #: build/C/man2/msgctl.2:311
2076 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_RMID>, but the "
2077 "effective user ID of the calling process is not the creator (as found in "
2078 "I<msg_perm.cuid>) or the owner (as found in I<msg_perm.uid>) of the "
2079 "message queue, and the process is not privileged (Linux: it does not have "
2080 "the B<CAP_SYS_ADMIN> capability)."
2084 #: build/C/man2/msgctl.2:314 build/C/man2/msgget.2:185 build/C/man2/msgop.2:401
2085 msgid "SVr4, POSIX.1-2001."
2088 #. Like Linux, the FreeBSD man pages still document
2089 #. the inclusion of these header files.
2091 #: build/C/man2/msgctl.2:327 build/C/man2/msgget.2:198 build/C/man2/msgop.2:414
2093 "The inclusion of I<E<lt>sys/types.hE<gt>> and I<E<lt>sys/ipc.hE<gt>> isn't "
2094 "required on Linux or by any version of POSIX. However, some old "
2095 "implementations required the inclusion of these header files, and the SVID "
2096 "also documented their inclusion. Applications intended to be portable to "
2097 "such old systems may need to include these header files."
2101 #: build/C/man2/msgctl.2:338
2103 "The B<IPC_INFO>, B<MSG_STAT> and B<MSG_INFO> operations are used by the "
2104 "B<ipcs>(1) program to provide information on allocated resources. In the "
2105 "future these may modified or moved to a /proc file system interface."
2109 #: build/C/man2/msgctl.2:352
2111 "Various fields in the I<struct msqid_ds> were typed as I<short> under Linux "
2112 "2.2 and have become I<long> under Linux 2.4. To take advantage of this, a "
2113 "recompilation under glibc-2.1.91 or later should suffice. (The kernel "
2114 "distinguishes old and new calls by an B<IPC_64> flag in I<cmd>.)"
2118 #: build/C/man2/msgctl.2:359
2120 "B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<capabilities>(7), "
2121 "B<mq_overview>(7), B<svipc>(7)"
2125 #: build/C/man2/msgget.2:35
2131 #: build/C/man2/msgget.2:38
2132 msgid "msgget - get a message queue identifier"
2136 #: build/C/man2/msgget.2:45
2138 msgid "B<int msgget(key_t >I<key>B<, int >I<msgflg>B<);>\n"
2142 #: build/C/man2/msgget.2:67
2144 "The B<msgget>() system call returns the message queue identifier associated "
2145 "with the value of the I<key> argument. A new message queue is created if "
2146 "I<key> has the value B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no "
2147 "message queue with the given key I<key> exists, and B<IPC_CREAT> is "
2148 "specified in I<msgflg>."
2152 #: build/C/man2/msgget.2:86
2154 "If I<msgflg> specifies both B<IPC_CREAT> and B<IPC_EXCL> and a message queue "
2155 "already exists for I<key>, then B<msgget>() fails with I<errno> set to "
2156 "B<EEXIST>. (This is analogous to the effect of the combination B<O_CREAT | "
2157 "O_EXCL> for B<open>(2).)"
2161 #: build/C/man2/msgget.2:96
2163 "Upon creation, the least significant bits of the argument I<msgflg> define "
2164 "the permissions of the message queue. These permission bits have the same "
2165 "format and semantics as the permissions specified for the I<mode> argument "
2166 "of B<open>(2). (The execute permissions are not used.)"
2170 #: build/C/man2/msgget.2:103
2172 "If a new message queue is created, then its associated data structure "
2173 "I<msqid_ds> (see B<msgctl>(2)) is initialized as follows:"
2177 #: build/C/man2/msgget.2:108
2179 "I<msg_perm.cuid> and I<msg_perm.uid> are set to the effective user ID of the "
2184 #: build/C/man2/msgget.2:113
2186 "I<msg_perm.cgid> and I<msg_perm.gid> are set to the effective group ID of "
2187 "the calling process."
2191 #: build/C/man2/msgget.2:118
2193 "The least significant 9 bits of I<msg_perm.mode> are set to the least "
2194 "significant 9 bits of I<msgflg>."
2198 #: build/C/man2/msgget.2:126
2200 "I<msg_qnum>, I<msg_lspid>, I<msg_lrpid>, I<msg_stime> and I<msg_rtime> are "
2205 #: build/C/man2/msgget.2:129
2206 msgid "I<msg_ctime> is set to the current time."
2210 #: build/C/man2/msgget.2:133
2211 msgid "I<msg_qbytes> is set to the system limit B<MSGMNB>."
2215 #: build/C/man2/msgget.2:137
2217 "If the message queue already exists the permissions are verified, and a "
2218 "check is made to see if it is marked for destruction."
2222 #: build/C/man2/msgget.2:143
2224 "If successful, the return value will be the message queue identifier (a "
2225 "nonnegative integer), otherwise -1 with I<errno> indicating the error."
2229 #: build/C/man2/msgget.2:147
2230 msgid "On failure, I<errno> is set to one of the following values:"
2234 #: build/C/man2/msgget.2:155
2236 "A message queue exists for I<key>, but the calling process does not have "
2237 "permission to access the queue, and does not have the B<CAP_IPC_OWNER> "
2242 #: build/C/man2/msgget.2:165
2244 "A message queue exists for I<key> and I<msgflg> specified both B<IPC_CREAT> "
2249 #: build/C/man2/msgget.2:173
2251 "No message queue exists for I<key> and I<msgflg> did not specify "
2256 #: build/C/man2/msgget.2:177
2258 "A message queue has to be created but the system does not have enough memory "
2259 "for the new data structure."
2263 #: build/C/man2/msgget.2:183
2265 "A message queue has to be created but the system limit for the maximum "
2266 "number of message queues (B<MSGMNI>) would be exceeded."
2270 #: build/C/man2/msgget.2:208
2272 "B<IPC_PRIVATE> isn't a flag field but a I<key_t> type. If this special "
2273 "value is used for I<key>, the system call ignores everything but the least "
2274 "significant 9 bits of I<msgflg> and creates a new message queue (on "
2279 #: build/C/man2/msgget.2:212
2281 "The following is a system limit on message queue resources affecting a "
2286 #: build/C/man2/msgget.2:212
2292 #: build/C/man2/msgget.2:218
2294 "System wide maximum number of message queues: policy dependent (on Linux, "
2295 "this limit can be read and modified via I</proc/sys/kernel/msgmni>)."
2299 #: build/C/man2/msgget.2:218
2305 #: build/C/man2/msgget.2:224
2307 "Until version 2.3.20 Linux would return B<EIDRM> for a B<msgget>() on a "
2308 "message queue scheduled for deletion."
2312 #: build/C/man2/msgget.2:230
2314 "The name choice B<IPC_PRIVATE> was perhaps unfortunate, B<IPC_NEW> would "
2315 "more clearly show its function."
2319 #: build/C/man2/msgget.2:238
2321 "B<msgctl>(2), B<msgrcv>(2), B<msgsnd>(2), B<ftok>(3), B<capabilities>(7), "
2322 "B<mq_overview>(7), B<svipc>(7)"
2326 #: build/C/man2/msgop.2:40
2332 #: build/C/man2/msgop.2:43
2333 msgid "msgrcv, msgsnd - message operations"
2337 #: build/C/man2/msgop.2:51
2340 "B<int msgsnd(int >I<msqid>B<, const void *>I<msgp>B<, size_t >I<msgsz>B<, "
2341 "int >I<msgflg>B<);>\n"
2345 #: build/C/man2/msgop.2:55
2348 "B<ssize_t msgrcv(int >I<msqid>B<, void *>I<msgp>B<, size_t >I<msgsz>B<, long "
2350 "B< int >I<msgflg>B<);>\n"
2354 #: build/C/man2/msgop.2:65
2356 "The B<msgsnd>() and B<msgrcv>() system calls are used, respectively, to "
2357 "send messages to, and receive messages from, a message queue. The calling "
2358 "process must have write permission on the message queue in order to send a "
2359 "message, and read permission to receive a message."
2363 #: build/C/man2/msgop.2:70
2365 "The I<msgp> argument is a pointer to caller-defined structure of the "
2366 "following general form:"
2370 #: build/C/man2/msgop.2:77
2374 " long mtype; /* message type, must be E<gt> 0 */\n"
2375 " char mtext[1]; /* message data */\n"
2380 #: build/C/man2/msgop.2:96
2382 "The I<mtext> field is an array (or other structure) whose size is specified "
2383 "by I<msgsz>, a nonnegative integer value. Messages of zero length (i.e., no "
2384 "I<mtext> field) are permitted. The I<mtype> field must have a strictly "
2385 "positive integer value. This value can be used by the receiving process for "
2386 "message selection (see the description of B<msgrcv>() below)."
2390 #: build/C/man2/msgop.2:96
2396 #: build/C/man2/msgop.2:104
2398 "The B<msgsnd>() system call appends a copy of the message pointed to by "
2399 "I<msgp> to the message queue whose identifier is specified by I<msqid>."
2403 #: build/C/man2/msgop.2:125
2405 "If sufficient space is available in the queue, B<msgsnd>() succeeds "
2406 "immediately. (The queue capacity is defined by the I<msg_qbytes> field in "
2407 "the associated data structure for the message queue. During queue creation "
2408 "this field is initialized to B<MSGMNB> bytes, but this limit can be modified "
2409 "using B<msgctl>(2).) If insufficient space is available in the queue, then "
2410 "the default behavior of B<msgsnd>() is to block until space becomes "
2411 "available. If B<IPC_NOWAIT> is specified in I<msgflg>, then the call "
2412 "instead fails with the error B<EAGAIN>."
2416 #: build/C/man2/msgop.2:129
2417 msgid "A blocked B<msgsnd>() call may also fail if:"
2421 #: 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
2427 #: build/C/man2/msgop.2:136
2429 "the queue is removed, in which case the system call fails with I<errno> set "
2434 #: build/C/man2/msgop.2:148
2436 "a signal is caught, in which case the system call fails with I<errno> set to "
2437 "B<EINTR>;B<see> B<signal>(7). (B<msgsnd>() is never automatically "
2438 "restarted after being interrupted by a signal handler, regardless of the "
2439 "setting of the B<SA_RESTART> flag when establishing a signal handler.)"
2443 #: build/C/man2/msgop.2:151 build/C/man2/msgop.2:278
2445 "Upon successful completion the message queue data structure is updated as "
2450 #: build/C/man2/msgop.2:154
2451 msgid "I<msg_lspid> is set to the process ID of the calling process."
2455 #: build/C/man2/msgop.2:157
2456 msgid "I<msg_qnum> is incremented by 1."
2460 #: build/C/man2/msgop.2:160
2461 msgid "I<msg_stime> is set to the current time."
2465 #: build/C/man2/msgop.2:160
2471 #: build/C/man2/msgop.2:168
2473 "The B<msgrcv>() system call removes a message from the queue specified by "
2474 "I<msqid> and places it in the buffer pointed to by I<msgp>."
2478 #: build/C/man2/msgop.2:194
2480 "The argument I<msgsz> specifies the maximum size in bytes for the member "
2481 "I<mtext> of the structure pointed to by the I<msgp> argument. If the "
2482 "message text has length greater than I<msgsz>, then the behavior depends on "
2483 "whether B<MSG_NOERROR> is specified in I<msgflg>. If B<MSG_NOERROR> is "
2484 "specified, then the message text will be truncated (and the truncated part "
2485 "will be lost); if B<MSG_NOERROR> is not specified, then the message isn't "
2486 "removed from the queue and the system call fails returning -1 with I<errno> "
2491 #: build/C/man2/msgop.2:198
2492 msgid "The argument I<msgtyp> specifies the type of message requested as follows:"
2496 #: build/C/man2/msgop.2:203
2497 msgid "If I<msgtyp> is 0, then the first message in the queue is read."
2501 #: build/C/man2/msgop.2:217
2503 "If I<msgtyp> is greater than 0, then the first message in the queue of type "
2504 "I<msgtyp> is read, unless B<MSG_EXCEPT> was specified in I<msgflg>, in which "
2505 "case the first message in the queue of type not equal to I<msgtyp> will be "
2510 #: build/C/man2/msgop.2:225
2512 "If I<msgtyp> is less than 0, then the first message in the queue with the "
2513 "lowest type less than or equal to the absolute value of I<msgtyp> will be "
2518 #: build/C/man2/msgop.2:230
2520 "The I<msgflg> argument is a bit mask constructed by ORing together zero or "
2521 "more of the following flags:"
2525 #: build/C/man2/msgop.2:230
2527 msgid "B<IPC_NOWAIT>"
2531 #: build/C/man2/msgop.2:237
2533 "Return immediately if no message of the requested type is in the queue. The "
2534 "system call fails with I<errno> set to B<ENOMSG>."
2538 #: build/C/man2/msgop.2:237
2540 msgid "B<MSG_EXCEPT>"
2544 #: build/C/man2/msgop.2:245
2546 "Used with I<msgtyp> greater than 0 to read the first message in the queue "
2547 "with message type that differs from I<msgtyp>."
2551 #: build/C/man2/msgop.2:245
2553 msgid "B<MSG_NOERROR>"
2557 #: build/C/man2/msgop.2:250
2558 msgid "To truncate the message text if longer than I<msgsz> bytes."
2562 #: build/C/man2/msgop.2:256
2564 "If no message of the requested type is available and B<IPC_NOWAIT> isn't "
2565 "specified in I<msgflg>, the calling process is blocked until one of the "
2566 "following conditions occurs:"
2570 #: build/C/man2/msgop.2:258
2571 msgid "A message of the desired type is placed in the queue."
2575 #: build/C/man2/msgop.2:264
2577 "The message queue is removed from the system. In this case the system call "
2578 "fails with I<errno> set to B<EIDRM>."
2582 #: build/C/man2/msgop.2:275
2584 "The calling process catches a signal. In this case the system call fails "
2585 "with I<errno> set to B<EINTR>. (B<msgrcv>() is never automatically "
2586 "restarted after being interrupted by a signal handler, regardless of the "
2587 "setting of the B<SA_RESTART> flag when establishing a signal handler.)"
2591 #: build/C/man2/msgop.2:281
2592 msgid "I<msg_lrpid> is set to the process ID of the calling process."
2596 #: build/C/man2/msgop.2:284
2597 msgid "I<msg_qnum> is decremented by 1."
2601 #: build/C/man2/msgop.2:287
2602 msgid "I<msg_rtime> is set to the current time."
2606 #: build/C/man2/msgop.2:300
2608 "On failure both functions return -1 with I<errno> indicating the error, "
2609 "otherwise B<msgsnd>() returns 0 and B<msgrcv>() returns the number of "
2610 "bytes actually copied into the I<mtext> array."
2614 #: build/C/man2/msgop.2:306
2616 "When B<msgsnd>() fails, I<errno> will be set to one among the following "
2621 #: build/C/man2/msgop.2:312
2623 "The calling process does not have write permission on the message queue, and "
2624 "does not have the B<CAP_IPC_OWNER> capability."
2628 #: build/C/man2/msgop.2:320
2630 "The message can't be sent due to the I<msg_qbytes> limit for the queue and "
2631 "B<IPC_NOWAIT> was specified in I<msgflg>."
2635 #: build/C/man2/msgop.2:325 build/C/man2/msgop.2:378
2636 msgid "The address pointed to by I<msgp> isn't accessible."
2640 #: build/C/man2/msgop.2:331
2641 msgid "Sleeping on a full message queue condition, the process caught a signal."
2645 #: build/C/man2/msgop.2:342
2647 "Invalid I<msqid> value, or nonpositive I<mtype> value, or invalid I<msgsz> "
2648 "value (less than 0 or greater than the system value B<MSGMAX>)."
2652 #: build/C/man2/msgop.2:347
2654 "The system does not have enough memory to make a copy of the message pointed "
2659 #: build/C/man2/msgop.2:353
2661 "When B<msgrcv>() fails, I<errno> will be set to one among the following "
2666 #: build/C/man2/msgop.2:353
2672 #: build/C/man2/msgop.2:361
2674 "The message text length is greater than I<msgsz> and B<MSG_NOERROR> isn't "
2675 "specified in I<msgflg>."
2679 #: build/C/man2/msgop.2:367
2681 "The calling process does not have read permission on the message queue, and "
2682 "does not have the B<CAP_IPC_OWNER> capability."
2686 #: build/C/man2/msgop.2:373
2688 "No message was available in the queue and B<IPC_NOWAIT> was specified in "
2693 #: build/C/man2/msgop.2:382
2695 "While the process was sleeping to receive a message, the message queue was "
2700 #: build/C/man2/msgop.2:387
2702 "While the process was sleeping to receive a message, the process caught a "
2703 "signal; see B<signal>(7)."
2707 #: build/C/man2/msgop.2:393
2708 msgid "I<msgqid> was invalid, or I<msgsz> was less than 0."
2712 #: build/C/man2/msgop.2:393
2718 #: build/C/man2/msgop.2:399
2720 "B<IPC_NOWAIT> was specified in I<msgflg> and no message of the requested "
2721 "type existed on the message queue."
2725 #: build/C/man2/msgop.2:421
2727 "The I<msgp> argument is declared as I<struct msgbuf *> with libc4, libc5, "
2728 "glibc 2.0, glibc 2.1. It is declared as I<void *> with glibc 2.2 and later, "
2729 "as required by SUSv2 and SUSv3."
2733 #: build/C/man2/msgop.2:425
2735 "The following limits on message queue resources affect the B<msgsnd>() "
2740 #: build/C/man2/msgop.2:425
2746 #: build/C/man2/msgop.2:430
2748 "Maximum size for a message text: 8192 bytes (on Linux, this limit can be "
2749 "read and modified via I</proc/sys/kernel/msgmax>)."
2753 #: build/C/man2/msgop.2:430
2759 #: build/C/man2/msgop.2:440
2761 "Default maximum size in bytes of a message queue: 16384 bytes (on Linux, "
2762 "this limit can be read and modified via I</proc/sys/kernel/msgmnb>). The "
2763 "superuser can increase the size of a message queue beyond B<MSGMNB> by a "
2764 "B<msgctl>(2) system call."
2768 #: build/C/man2/msgop.2:446
2770 "The implementation has no intrinsic limits for the system wide maximum "
2771 "number of message headers (B<MSGTQL>) and for the system wide maximum size "
2772 "in bytes of the message pool (B<MSGPOOL>)."
2776 #: build/C/man2/msgop.2:452
2778 "B<msgctl>(2), B<msgget>(2), B<capabilities>(7), B<mq_overview>(7), "