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: 2012-04-25 05:36+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
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/man2/mq_getsetattr.2: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:35 build/C/man2/msgget.2:33 build/C/man2/msgop.2:38
38 #: build/C/man3/mq_close.3:26 build/C/man3/mq_getattr.3:26 build/C/man2/mq_getsetattr.2:26 build/C/man3/mq_notify.3:26 build/C/man3/mq_open.3:26 build/C/man7/mq_overview.7:26 build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26 build/C/man3/mq_unlink.3:26 build/C/man2/msgctl.2:35 build/C/man2/msgget.2:33 build/C/man2/msgop.2:38
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:36 build/C/man2/msgget.2:34 build/C/man2/msgop.2:39
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:38 build/C/man2/msgget.2:36 build/C/man2/msgop.2:41
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:37 build/C/man3/mq_notify.3:37 build/C/man3/mq_open.3:41 build/C/man7/mq_overview.7:29 build/C/man3/mq_receive.3:57 build/C/man3/mq_send.3:57 build/C/man3/mq_unlink.3:37 build/C/man2/msgctl.2:46 build/C/man2/msgget.2:44 build/C/man2/msgop.2:54
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:224 build/C/man2/msgget.2:135 build/C/man2/msgop.2:285
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:249 build/C/man2/msgget.2:141 build/C/man2/msgop.2:298
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:47 build/C/man3/mq_notify.3:174 build/C/man3/mq_open.3:224 build/C/man7/mq_overview.7:263 build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161 build/C/man3/mq_unlink.3:62 build/C/man2/msgctl.2:309 build/C/man2/msgget.2:181 build/C/man2/msgop.2:397
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:49 build/C/man7/mq_overview.7:265 build/C/man3/mq_receive.3:158 build/C/man3/mq_send.3:163 build/C/man2/msgctl.2:312 build/C/man2/msgget.2:183 build/C/man2/msgop.2:399
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:53 build/C/man3/mq_notify.3:243 build/C/man3/mq_open.3:230 build/C/man7/mq_overview.7:281 build/C/man3/mq_receive.3:164 build/C/man3/mq_send.3:169 build/C/man3/mq_unlink.3:64 build/C/man2/msgctl.2:337 build/C/man2/msgget.2:215 build/C/man2/msgop.2:431
157 #: build/C/man3/mq_close.3:72
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_getattr.3:26
170 #: build/C/man3/mq_getattr.3:29
171 msgid "mq_getattr, mq_setattr - get/set message queue attributes"
175 #: build/C/man3/mq_getattr.3:34
177 msgid "B<int mq_getattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<attr>B<);>\n"
181 #: build/C/man3/mq_getattr.3:37
184 "B<int mq_setattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<newattr>B<,>\n"
185 "B< struct mq_attr *>I<oldattr>B<);>\n"
189 #: build/C/man3/mq_getattr.3:47
191 "B<mq_getattr>() and B<mq_setattr>() respectively retrieve and modify "
192 "attributes of the message queue referred to by the descriptor I<mqdes>."
196 #: build/C/man3/mq_getattr.3:54
198 "B<mq_getattr>() returns an I<mq_attr> structure in the buffer pointed by "
199 "I<attr>. This structure is defined as:"
203 #: build/C/man3/mq_getattr.3:63
207 " long mq_flags; /* Flags: 0 or O_NONBLOCK */\n"
208 " long mq_maxmsg; /* Max. # of messages on queue */\n"
209 " long mq_msgsize; /* Max. message size (bytes) */\n"
210 " long mq_curmsgs; /* # of messages currently in queue */\n"
215 #: build/C/man3/mq_getattr.3:73
217 "The I<mq_flags> field contains flags associated with the open message queue "
218 "description. This field is initialized when the queue is created by "
219 "B<mq_open>(3). The only flag that can appear in this field is "
224 #: build/C/man3/mq_getattr.3:94
226 "The I<mq_maxmsg> and I<mq_msgsize> fields are set when the message queue is "
227 "created by B<mq_open>(3). The I<mq_maxmsg> field is an upper limit on the "
228 "number of messages that may be placed on the queue using B<mq_send>(3). The "
229 "I<mq_msgsize> field is an upper limit on the size of messages that may be "
230 "placed on the queue. Both of these fields must have a value greater than "
231 "zero. Two I</proc> files that place ceilings on the values for these fields "
232 "are described in B<mq_open>(3)."
236 #: build/C/man3/mq_getattr.3:98
238 "The I<mq_curmsgs> field returns the number of messages currently held in the "
243 #: build/C/man3/mq_getattr.3:118
245 "B<mq_setattr>() sets message queue attributes using information supplied in "
246 "the I<mq_attr> structure pointed to by I<newattr>. The only attribute that "
247 "can be modified is the setting of the B<O_NONBLOCK> flag in I<mq_flags>. "
248 "The other fields in I<newattr> are ignored. If the I<oldattr> field is not "
249 "NULL, then the buffer that it points to is used to return an I<mq_attr> "
250 "structure that contains the same information that is returned by "
255 #: build/C/man3/mq_getattr.3:126
257 "On success B<mq_getattr>() and B<mq_setattr>() return 0; on error, -1 is "
258 "returned, with I<errno> set to indicate the error."
262 #: build/C/man3/mq_getattr.3:132 build/C/man3/mq_notify.3:150 build/C/man3/mq_open.3:156 build/C/man3/mq_receive.3:138 build/C/man3/mq_send.3:143 build/C/man2/msgctl.2:280 build/C/man2/msgop.2:329 build/C/man2/msgop.2:385
268 #: build/C/man3/mq_getattr.3:137
269 msgid "I<newattr-E<gt>mq_flags> contained set bits other than B<O_NONBLOCK>."
273 #: build/C/man3/mq_getattr.3:147
275 "On Linux, B<mq_getattr>() and B<mq_setattr>() are library functions "
276 "layered on top of the B<mq_getsetattr>(2) system call."
280 #: build/C/man3/mq_getattr.3:154
282 "B<mq_close>(3), B<mq_notify>(3), B<mq_open>(3), B<mq_receive>(3), "
283 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
287 #: build/C/man2/mq_getsetattr.2:26
289 msgid "MQ_GETSETATTR"
293 #: build/C/man2/mq_getsetattr.2:29
294 msgid "mq_getsetattr - get/set message queue attributes"
298 #: build/C/man2/mq_getsetattr.2:33
301 "B<#include E<lt>sys/types.hE<gt>>\n"
302 "B<#include E<lt>mqueue.hE<gt>>\n"
306 #: build/C/man2/mq_getsetattr.2:36
309 "B<int mq_getsetattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<newattr>B<,>\n"
310 "B< struct mq_attr *>I<oldattr>B<);>\n"
314 #: build/C/man2/mq_getsetattr.2:39
315 msgid "Do not use this system call."
319 #: build/C/man2/mq_getsetattr.2:47
321 "This is the low-level system call used to implement B<mq_getattr>(3) and "
322 "B<mq_setattr>(3). For an explanation of how this system call operates, see "
323 "the description of B<mq_setattr>(3)."
327 #: build/C/man2/mq_getsetattr.2:49
328 msgid "This interface is nonstandard; avoid its use."
332 #: build/C/man2/mq_getsetattr.2:53
334 "Glibc does not provide a wrapper for this system call; call it using "
335 "B<syscall>(2). (Actually, never call it unless you are writing a C "
340 #: build/C/man2/mq_getsetattr.2:55
341 msgid "B<mq_getattr>(3), B<mq_overview>(7)"
345 #: build/C/man3/mq_notify.3:26
351 #: build/C/man3/mq_notify.3:26
357 #: build/C/man3/mq_notify.3:29
358 msgid "mq_notify - register for notification when a message is available"
362 #: build/C/man3/mq_notify.3:34
364 msgid "B<int mq_notify(mqd_t >I<mqdes>B<, const struct sigevent *>I<sevp>B<);>\n"
368 #: build/C/man3/mq_notify.3:43
370 "B<mq_notify>() allows the calling process to register or unregister for "
371 "delivery of an asynchronous notification when a new message arrives on the "
372 "empty message queue referred to by the descriptor I<mqdes>."
376 #: build/C/man3/mq_notify.3:51
378 "The I<sevp> argument is a pointer to a I<sigevent> structure. For the "
379 "definition and general details of this structure, see B<sigevent>(7)."
383 #: build/C/man3/mq_notify.3:65
385 "If I<sevp> is a non-NULL pointer, then B<mq_notify>() registers the calling "
386 "process to receive message notification. The I<sigev_notify> field of the "
387 "I<sigevent> structure to which I<sevp> points specifies how notification is "
388 "to be performed. This field has one of the following values:"
392 #: build/C/man3/mq_notify.3:65
394 msgid "B<SIGEV_NONE>"
397 #. When is SIGEV_NONE useful?
399 #: build/C/man3/mq_notify.3:70
401 "A \"null\" notification: the calling process is registered as the target for "
402 "notification, but when a message arrives, no notification is sent."
406 #: build/C/man3/mq_notify.3:70
408 msgid "B<SIGEV_SIGNAL>"
411 #. I don't know of other implementations that set
412 #. si_pid and si_uid -- MTK
414 #: build/C/man3/mq_notify.3:90
416 "Notify the process by sending the signal specified in I<sigev_signo>. See "
417 "B<sigevent>(7) for general details. The I<si_code> field of the "
418 "I<siginfo_t> structure will be set to B<SI_MESGQ>. In addition, I<si_pid> "
419 "will be set to the PID of the process that sent the message, and I<si_uid> "
420 "will be set to the real user ID of the sending process."
424 #: build/C/man3/mq_notify.3:90
426 msgid "B<SIGEV_THREAD>"
430 #: build/C/man3/mq_notify.3:98
432 "Upon message delivery, invoke I<sigev_notify_function> as if it were the "
433 "start function of a new thread. See B<sigevent>(7) for details."
437 #: build/C/man3/mq_notify.3:101
439 "Only one process can be registered to receive notification from a message "
444 #: build/C/man3/mq_notify.3:108
446 "If I<sevp> is NULL, and the calling process is currently registered to "
447 "receive notifications for this message queue, then the registration is "
448 "removed; another process can then register to receive a message notification "
453 #: build/C/man3/mq_notify.3:115
455 "Message notification only occurs when a new message arrives and the queue "
456 "was previously empty. If the queue was not empty at the time B<mq_notify>() "
457 "was called, then a notification will only occur after the queue is emptied "
458 "and a new message arrives."
462 #: build/C/man3/mq_notify.3:123
464 "If another process or thread is waiting to read a message from an empty "
465 "queue using B<mq_receive>(3), then any message notification registration is "
466 "ignored: the message is delivered to the process or thread calling "
467 "B<mq_receive>(3), and the message notification registration remains in "
472 #: build/C/man3/mq_notify.3:134
474 "Notification occurs once: after a notification is delivered, the "
475 "notification registration is removed, and another process can register for "
476 "message notification. If the notified process wishes to receive the next "
477 "notification, it can use B<mq_notify>() to request a further notification. "
478 "This should be done before emptying all unread messages from the queue. "
479 "(Placing the queue in nonblocking mode is useful for emptying the queue of "
480 "messages without blocking once it is empty.)"
484 #: build/C/man3/mq_notify.3:140
486 "On success B<mq_notify>() returns 0; on error, -1 is returned, with "
487 "I<errno> set to indicate the error."
491 #: build/C/man3/mq_notify.3:146
497 #: build/C/man3/mq_notify.3:150
499 "Another process has already registered to receive notification for this "
504 #: build/C/man3/mq_notify.3:160
506 "I<sevp-E<gt>sigev_notify> is not one of the permitted values; or "
507 "I<sevp-E<gt>sigev_notify> is B<SIGEV_SIGNAL> and I<sevp-E<gt>sigev_signo> is "
508 "not a valid signal number."
512 #: build/C/man3/mq_notify.3:160 build/C/man3/mq_open.3:214 build/C/man2/msgget.2:171 build/C/man2/msgop.2:340
518 #: build/C/man3/mq_notify.3:163 build/C/man3/mq_open.3:217
519 msgid "Insufficient memory."
522 #. Linux does not do this
524 #: build/C/man3/mq_notify.3:174
526 "POSIX.1-2008 says that an implementation I<may> generate an B<EINVAL> error "
527 "if I<sevp> is NULL, and the caller is not currently registered to receive "
528 "notifications for the queue I<mqdes>."
532 #: build/C/man3/mq_notify.3:176 build/C/man7/mq_overview.7:278
538 #: build/C/man3/mq_notify.3:182
540 "The following program registers a notification request for the message queue "
541 "named in its command-line argument. Notification is performed by creating a "
542 "thread. The thread executes a function which reads one message from the "
543 "queue and then terminates the process."
547 #: build/C/man3/mq_notify.3:189
550 "#include E<lt>pthread.hE<gt>\n"
551 "#include E<lt>mqueue.hE<gt>\n"
552 "#include E<lt>stdio.hE<gt>\n"
553 "#include E<lt>stdlib.hE<gt>\n"
554 "#include E<lt>unistd.hE<gt>\n"
558 #: build/C/man3/mq_notify.3:192
561 "#define handle_error(msg) \\e\n"
562 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
566 #: build/C/man3/mq_notify.3:200
569 "static void /* Thread start function */\n"
570 "tfunc(union sigval sv)\n"
572 " struct mq_attr attr;\n"
575 " mqd_t mqdes = *((mqd_t *) sv.sival_ptr);\n"
579 #: build/C/man3/mq_notify.3:202
581 msgid " /* Determine max. msg size; allocate buffer to receive msg */\n"
585 #: build/C/man3/mq_notify.3:208
588 " if (mq_getattr(mqdes, &attr) == -1)\n"
589 " handle_error(\"mq_getattr\");\n"
590 " buf = malloc(attr.mq_msgsize);\n"
591 " if (buf == NULL)\n"
592 " handle_error(\"malloc\");\n"
596 #: build/C/man3/mq_notify.3:212
599 " nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL);\n"
601 " handle_error(\"mq_receive\");\n"
605 #: build/C/man3/mq_notify.3:217
608 " printf(\"Read %ld bytes from MQ\\en\", (long) nr);\n"
610 " exit(EXIT_SUCCESS); /* Terminate the process */\n"
615 #: build/C/man3/mq_notify.3:223
619 "main(int argc, char *argv[])\n"
622 " struct sigevent sev;\n"
626 #: build/C/man3/mq_notify.3:228
629 " if (argc != 2) {\n"
630 "\tfprintf(stderr, \"Usage: %s E<lt>mq-nameE<gt>\\en\", argv[0]);\n"
631 "\texit(EXIT_FAILURE);\n"
636 #: build/C/man3/mq_notify.3:232
639 " mqdes = mq_open(argv[1], O_RDONLY);\n"
640 " if (mqdes == (mqd_t) -1)\n"
641 " handle_error(\"mq_open\");\n"
645 #: build/C/man3/mq_notify.3:239
648 " sev.sigev_notify = SIGEV_THREAD;\n"
649 " sev.sigev_notify_function = tfunc;\n"
650 " sev.sigev_notify_attributes = NULL;\n"
651 " sev.sigev_value.sival_ptr = &mqdes; /* Arg. to thread func. */\n"
652 " if (mq_notify(mqdes, &sev) == -1)\n"
653 " handle_error(\"mq_notify\");\n"
657 #: build/C/man3/mq_notify.3:242
660 " pause(); /* Process will be terminated by thread function */\n"
665 #: build/C/man3/mq_notify.3:251
667 "B<mq_close>(3), B<mq_getattr>(3), B<mq_open>(3), B<mq_receive>(3), "
668 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<sigevent>(7)"
672 #: build/C/man3/mq_open.3:26
678 #: build/C/man3/mq_open.3:26
684 #: build/C/man3/mq_open.3:29
685 msgid "mq_open - open a message queue"
689 #: build/C/man3/mq_open.3:34
692 "B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */\n"
693 "B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */\n"
694 "B<#include E<lt>mqueue.hE<gt>>\n"
698 #: build/C/man3/mq_open.3:38
701 "B<mqd_t mq_open(const char *>I<name>B<, int >I<oflag>B<);>\n"
702 "B<mqd_t mq_open(const char *>I<name>B<, int >I<oflag>B<, mode_t "
704 "B< struct mq_attr *>I<attr>B<);>\n"
708 #: build/C/man3/mq_open.3:50
710 "B<mq_open>() creates a new POSIX message queue or opens an existing queue. "
711 "The queue is identified by I<name>. For details of the construction of "
712 "I<name>, see B<mq_overview>(7)."
716 #: build/C/man3/mq_open.3:58
718 "The I<oflag> argument specifies flags that control the operation of the "
719 "call. (Definitions of the flags values can be obtained by including "
720 "I<E<lt>fcntl.hE<gt>>.) Exactly one of the following must be specified in "
725 #: build/C/man3/mq_open.3:58
731 #: build/C/man3/mq_open.3:61
732 msgid "Open the queue to receive messages only."
736 #: build/C/man3/mq_open.3:61
742 #: build/C/man3/mq_open.3:64
743 msgid "Open the queue to send messages only."
747 #: build/C/man3/mq_open.3:64
753 #: build/C/man3/mq_open.3:67
754 msgid "Open the queue to both send and receive messages."
758 #: build/C/man3/mq_open.3:72
759 msgid "Zero or more of the following flags can additionally be I<OR>ed in I<oflag>:"
763 #: build/C/man3/mq_open.3:72
765 msgid "B<O_NONBLOCK>"
769 #: build/C/man3/mq_open.3:81
771 "Open the queue in nonblocking mode. In circumstances where B<mq_receive>(3) "
772 "and B<mq_send>(3) would normally block, these functions instead fail with "
773 "the error B<EAGAIN>."
777 #: build/C/man3/mq_open.3:81
782 #. In reality the file system IDs are used on Linux.
784 #: build/C/man3/mq_open.3:89
786 "Create the message queue if it does not exist. The owner (user ID) of the "
787 "message queue is set to the effective user ID of the calling process. The "
788 "group ownership (group ID) is set to the effective group ID of the calling "
793 #: build/C/man3/mq_open.3:89
799 #: build/C/man3/mq_open.3:99
801 "If B<O_CREAT> was specified in I<oflag>, and a queue with the given I<name> "
802 "already exists, then fail with the error B<EEXIST>."
806 #: build/C/man3/mq_open.3:123
808 "If B<O_CREAT> is specified in I<oflag>, then two additional arguments must "
809 "be supplied. The I<mode> argument specifies the permissions to be placed on "
810 "the new queue, as for B<open>(2). (Symbolic definitions for the permissions "
811 "bits can be obtained by including I<E<lt>sys/stat.hE<gt>>.) The permissions "
812 "settings are masked against the process umask. The I<attr> argument "
813 "specifies attributes for the queue. See B<mq_getattr>(3) for details. If "
814 "I<attr> is NULL, then the queue is created with implementation-defined "
815 "default attributes."
819 #: build/C/man3/mq_open.3:135
821 "On success, B<mq_open>() returns a message queue descriptor for use by "
822 "other message queue functions. On error, B<mq_open>() returns I<(mqd_t)\\ "
823 "-1>, with I<errno> set to indicate the error."
827 #: build/C/man3/mq_open.3:136 build/C/man3/mq_open.3:140 build/C/man3/mq_unlink.3:51 build/C/man2/msgctl.2:253 build/C/man2/msgget.2:145 build/C/man2/msgop.2:304 build/C/man2/msgop.2:359
833 #: build/C/man3/mq_open.3:140
835 "The queue exists, but the caller does not have permission to open it in the "
839 #. Note that this isn't consistent with the same case for sem_open()
841 #: build/C/man3/mq_open.3:145
842 msgid "I<name> contained more than one slash."
846 #: build/C/man3/mq_open.3:145 build/C/man2/msgget.2:153
852 #: build/C/man3/mq_open.3:156
854 "Both B<O_CREAT> and B<O_EXCL> were specified in I<oflag>, but a queue with "
855 "this I<name> already exists."
859 #: build/C/man3/mq_open.3:188
861 "B<O_CREAT> was specified in I<oflag>, and I<attr> was not NULL, but "
862 "I<attr-E<gt>mq_maxmsg> or I<attr-E<gt>mq_msqsize> was invalid. Both of "
863 "these fields must be greater than zero. In a process that is unprivileged "
864 "(does not have the B<CAP_SYS_RESOURCE> capability), I<attr-E<gt>mq_maxmsg> "
865 "must be less than or equal to the I<msg_max> limit, and "
866 "I<attr-E<gt>mq_msgsize> must be less than or equal to the I<msgsize_max> "
867 "limit. In addition, even in a privileged process, I<attr-E<gt>mq_maxmsg> "
868 "cannot exceed the B<HARD_MAX> limit. (See B<mq_overview>(7) for details of "
873 #: build/C/man3/mq_open.3:188
879 #: build/C/man3/mq_open.3:192
880 msgid "The process already has the maximum number of files and message queues open."
884 #: build/C/man3/mq_open.3:192 build/C/man3/mq_unlink.3:54
886 msgid "B<ENAMETOOLONG>"
890 #: build/C/man3/mq_open.3:196 build/C/man3/mq_unlink.3:58
891 msgid "I<name> was too long."
895 #: build/C/man3/mq_open.3:196
901 #: build/C/man3/mq_open.3:200
903 "The system limit on the total number of open files and message queues has "
908 #: build/C/man3/mq_open.3:200 build/C/man3/mq_open.3:209 build/C/man3/mq_unlink.3:58 build/C/man2/msgget.2:163
914 #: build/C/man3/mq_open.3:209
916 "The B<O_CREAT> flag was not specified in I<oflag>, and no queue with this "
920 #. Note that this isn't consistent with the same case for sem_open()
922 #: build/C/man3/mq_open.3:214
923 msgid "I<name> was just \"/\" followed by no other characters."
927 #: build/C/man3/mq_open.3:217 build/C/man2/msgget.2:175
933 #: build/C/man3/mq_open.3:224
935 "Insufficient space for the creation of a new message queue. This probably "
936 "occurred because the I<queues_max> limit was encountered; see "
941 #: build/C/man3/mq_open.3:226 build/C/man2/msgget.2:209
947 #: build/C/man3/mq_open.3:230
949 "In kernels before 2.6.14, the process umask was not applied to the "
950 "permissions specified in I<mode>."
954 #: build/C/man3/mq_open.3:237
956 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_receive>(3), "
957 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
961 #: build/C/man7/mq_overview.7:26
967 #: build/C/man7/mq_overview.7:26
973 #: build/C/man7/mq_overview.7:29
974 msgid "mq_overview - Overview of POSIX message queues"
978 #: build/C/man7/mq_overview.7:37
980 "POSIX message queues allow processes to exchange data in the form of "
981 "messages. This API is distinct from that provided by System V message "
982 "queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.), but provides "
983 "similar functionality."
987 #: build/C/man7/mq_overview.7:52
989 "Message queues are created and opened using B<mq_open>(3); this function "
990 "returns a I<message queue descriptor> (I<mqd_t>), which is used to refer to "
991 "the open message queue in later calls. Each message queue is identified by "
992 "a name of the form I</somename>; that is, a null-terminated string of up to "
993 "B<NAME_MAX> (i.e., 255) characters consisting of an initial slash, followed "
994 "by one or more characters, none of which are slashes. Two processes can "
995 "operate on the same queue by passing the same name to B<mq_open>(3)."
999 #: build/C/man7/mq_overview.7:68
1001 "Messages are transferred to and from a queue using B<mq_send>(3) and "
1002 "B<mq_receive>(3). When a process has finished using the queue, it closes it "
1003 "using B<mq_close>(3), and when the queue is no longer required, it can be "
1004 "deleted using B<mq_unlink>(3). Queue attributes can be retrieved and (in "
1005 "some cases) modified using B<mq_getattr>(3) and B<mq_setattr>(3). A "
1006 "process can request asynchronous notification of the arrival of a message on "
1007 "a previously empty queue using B<mq_notify>(3)."
1011 #: build/C/man7/mq_overview.7:81
1013 "A message queue descriptor is a reference to an I<open message queue "
1014 "description> (cf. B<open>(2)). After a B<fork>(2), a child inherits copies "
1015 "of its parent's message queue descriptors, and these descriptors refer to "
1016 "the same open message queue descriptions as the corresponding descriptors in "
1017 "the parent. Corresponding descriptors in the two processes share the flags "
1018 "(I<mq_flags>) that are associated with the open message queue description."
1022 #: build/C/man7/mq_overview.7:94
1024 "Each message has an associated I<priority>, and messages are always "
1025 "delivered to the receiving process highest priority first. Message "
1026 "priorities range from 0 (low) to I<sysconf(_SC_MQ_PRIO_MAX)\\ -\\ 1> "
1027 "(high). On Linux, I<sysconf(_SC_MQ_PRIO_MAX)> returns 32768, but "
1028 "POSIX.1-2001 only requires an implementation to support priorities in the "
1029 "range 0 to 31; some implementations only provide this range."
1033 #: build/C/man7/mq_overview.7:97
1035 "The remainder of this section describes some specific details of the Linux "
1036 "implementation of POSIX message queues."
1040 #: build/C/man7/mq_overview.7:97
1042 msgid "Library interfaces and system calls"
1046 #: build/C/man7/mq_overview.7:103
1048 "In most cases the B<mq_*()> library interfaces listed above are implemented "
1049 "on top of underlying system calls of the same name. Deviations from this "
1050 "scheme are indicated in the following table:"
1054 #: build/C/man7/mq_overview.7:107
1056 msgid "Library interface\tSystem call\n"
1060 #: build/C/man7/mq_overview.7:108
1062 msgid "mq_close(3)\tclose(2)\n"
1066 #: build/C/man7/mq_overview.7:109
1068 msgid "mq_getattr(3)\tmq_getsetattr(2)\n"
1072 #: build/C/man7/mq_overview.7:110
1074 msgid "mq_notify(3)\tmq_notify(2)\n"
1078 #: build/C/man7/mq_overview.7:111
1080 msgid "mq_open(3)\tmq_open(2)\n"
1084 #: build/C/man7/mq_overview.7:112
1086 msgid "mq_receive(3)\tmq_timedreceive(2)\n"
1090 #: build/C/man7/mq_overview.7:113
1092 msgid "mq_send(3)\tmq_timedsend(2)\n"
1096 #: build/C/man7/mq_overview.7:114
1098 msgid "mq_setattr(3)\tmq_getsetattr(2)\n"
1102 #: build/C/man7/mq_overview.7:115
1104 msgid "mq_timedreceive(3)\tmq_timedreceive(2)\n"
1108 #: build/C/man7/mq_overview.7:116
1110 msgid "mq_timedsend(3)\tmq_timedsend(2)\n"
1114 #: build/C/man7/mq_overview.7:117
1116 msgid "mq_unlink(3)\tmq_unlink(2)\n"
1120 #: build/C/man7/mq_overview.7:120
1126 #: build/C/man7/mq_overview.7:123
1128 "POSIX message queues have been supported on Linux since kernel 2.6.6. Glibc "
1129 "support has been provided since version 2.3.4."
1133 #: build/C/man7/mq_overview.7:123
1135 msgid "Kernel configuration"
1139 #: build/C/man7/mq_overview.7:128
1141 "Support for POSIX message queues is configurable via the "
1142 "B<CONFIG_POSIX_MQUEUE> kernel configuration option. This option is enabled "
1147 #: build/C/man7/mq_overview.7:128
1153 #: build/C/man7/mq_overview.7:133
1155 "POSIX message queues have kernel persistence: if not removed by "
1156 "B<mq_unlink>(3), a message queue will exist until the system is shut down."
1160 #: build/C/man7/mq_overview.7:133
1166 #: build/C/man7/mq_overview.7:138
1168 "Programs using the POSIX message queue API must be compiled with I<cc -lrt> "
1169 "to link against the real-time library, I<librt>."
1173 #: build/C/man7/mq_overview.7:138
1175 msgid "/proc interfaces"
1179 #: build/C/man7/mq_overview.7:141
1181 "The following interfaces can be used to limit the amount of kernel memory "
1182 "consumed by POSIX message queues:"
1186 #: build/C/man7/mq_overview.7:141
1188 msgid "I</proc/sys/fs/mqueue/msg_max>"
1192 #: build/C/man7/mq_overview.7:162
1194 "This file can be used to view and change the ceiling value for the maximum "
1195 "number of messages in a queue. This value acts as a ceiling on the "
1196 "I<attr-E<gt>mq_maxmsg> argument given to B<mq_open>(3). The default value "
1197 "for I<msg_max> is 10. The minimum value is 1 (10 in kernels before "
1198 "2.6.28). The upper limit is B<HARD_MAX>: I<(131072\\ /\\ sizeof(void\\ *))> "
1199 "(32768 on Linux/86). This limit is ignored for privileged processes "
1200 "(B<CAP_SYS_RESOURCE>), but the B<HARD_MAX> ceiling is nevertheless imposed."
1204 #: build/C/man7/mq_overview.7:162
1206 msgid "I</proc/sys/fs/mqueue/msgsize_max>"
1210 #: build/C/man7/mq_overview.7:181
1212 "This file can be used to view and change the ceiling on the maximum message "
1213 "size. This value acts as a ceiling on the I<attr-E<gt>mq_msgsize> argument "
1214 "given to B<mq_open>(3). The default value for I<msgsize_max> is 8192 "
1215 "bytes. The minimum value is 128 (8192 in kernels before 2.6.28). The upper "
1216 "limit for I<msgsize_max> is 1,048,576 (in kernels before 2.6.28, the upper "
1217 "limit was B<INT_MAX>; that is, 2,147,483,647 on Linux/86). This limit is "
1218 "ignored for privileged processes (B<CAP_SYS_RESOURCE>)."
1222 #: build/C/man7/mq_overview.7:181
1224 msgid "I</proc/sys/fs/mqueue/queues_max>"
1228 #: build/C/man7/mq_overview.7:191
1230 "This file can be used to view and change the system-wide limit on the number "
1231 "of message queues that can be created. Only privileged processes "
1232 "(B<CAP_SYS_RESOURCE>) can create new message queues once this limit has "
1233 "been reached. The default value for I<queues_max> is 256; it can be changed "
1234 "to any value in the range 0 to INT_MAX."
1238 #: build/C/man7/mq_overview.7:191
1240 msgid "Resource limit"
1244 #: build/C/man7/mq_overview.7:198
1246 "The B<RLIMIT_MSGQUEUE> resource limit, which places a limit on the amount of "
1247 "space that can be consumed by all of the message queues belonging to a "
1248 "process's real user ID, is described in B<getrlimit>(2)."
1252 #: build/C/man7/mq_overview.7:198
1254 msgid "Mounting the message queue file system"
1258 #: build/C/man7/mq_overview.7:204
1260 "On Linux, message queues are created in a virtual file system. (Other "
1261 "implementations may also provide such a feature, but the details are likely "
1262 "to differ.) This file system can be mounted (by the superuser) using the "
1263 "following commands:"
1267 #: build/C/man7/mq_overview.7:209
1270 "#B< mkdir /dev/mqueue>\n"
1271 "#B< mount -t mqueue none /dev/mqueue>\n"
1275 #: build/C/man7/mq_overview.7:213
1276 msgid "The sticky bit is automatically enabled on the mount directory."
1280 #: build/C/man7/mq_overview.7:220
1282 "After the file system has been mounted, the message queues on the system can "
1283 "be viewed and manipulated using the commands usually used for files (e.g., "
1284 "B<ls>(1) and B<rm>(1))."
1288 #: build/C/man7/mq_overview.7:223
1290 "The contents of each file in the directory consist of a single line "
1291 "containing information about the queue:"
1295 #: build/C/man7/mq_overview.7:228
1298 "$B< cat /dev/mqueue/mymq>\n"
1299 "QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260\n"
1303 #: build/C/man7/mq_overview.7:232
1304 msgid "These fields are as follows:"
1308 #: build/C/man7/mq_overview.7:232
1314 #: build/C/man7/mq_overview.7:235
1315 msgid "Number of bytes of data in all messages in the queue."
1319 #: build/C/man7/mq_overview.7:235
1321 msgid "B<NOTIFY_PID>"
1325 #: build/C/man7/mq_overview.7:241
1327 "If this is nonzero, then the process with this PID has used B<mq_notify>(3) "
1328 "to register for asynchronous message notification, and the remaining fields "
1329 "describe how notification occurs."
1333 #: build/C/man7/mq_overview.7:241
1339 #: build/C/man7/mq_overview.7:251
1341 "Notification method: 0 is B<SIGEV_SIGNAL>; 1 is B<SIGEV_NONE>; and 2 is "
1346 #: build/C/man7/mq_overview.7:251
1352 #: build/C/man7/mq_overview.7:255
1353 msgid "Signal number to be used for B<SIGEV_SIGNAL>."
1357 #: build/C/man7/mq_overview.7:255
1359 msgid "Polling message queue descriptors"
1363 #: build/C/man7/mq_overview.7:263
1365 "On Linux, a message queue descriptor is actually a file descriptor, and can "
1366 "be monitored using B<select>(2), B<poll>(2), or B<epoll>(7). This is not "
1371 #: build/C/man7/mq_overview.7:275
1373 "System V message queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.) are "
1374 "an older API for exchanging messages between processes. POSIX message "
1375 "queues provide a better designed interface than System V message queues; on "
1376 "the other hand POSIX message queues are less widely available (especially on "
1377 "older systems) than System V message queues."
1381 #: build/C/man7/mq_overview.7:278
1383 "Linux does not currently (2.6.26) support the use of access control lists "
1384 "(ACLs) for POSIX message queues."
1388 #: build/C/man7/mq_overview.7:281
1390 "An example of the use of various message queue functions is shown in "
1395 #: build/C/man7/mq_overview.7:293
1397 "B<getrlimit>(2), B<mq_getsetattr>(2), B<poll>(2), B<select>(2), "
1398 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1399 "B<mq_receive>(3), B<mq_send>(3), B<mq_unlink>(3), B<epoll>(7)"
1403 #: build/C/man3/mq_receive.3:26
1409 #: build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26
1415 #: build/C/man3/mq_receive.3:29
1416 msgid "mq_receive, mq_timedreceive - receive a message from a message queue"
1420 #: build/C/man3/mq_receive.3:35
1423 "B<ssize_t mq_receive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
1424 "B< size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<);>\n"
1428 #: build/C/man3/mq_receive.3:38 build/C/man3/mq_send.3:38
1431 "B<#include E<lt>time.hE<gt>>\n"
1432 "B<#include E<lt>mqueue.hE<gt>>\n"
1436 #: build/C/man3/mq_receive.3:42
1439 "B<ssize_t mq_timedreceive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
1440 "B< size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<,>\n"
1441 "B< const struct timespec *>I<abs_timeout>B<);>\n"
1445 #: build/C/man3/mq_receive.3:50 build/C/man3/mq_send.3:50
1446 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1450 #: build/C/man3/mq_receive.3:53
1451 msgid "B<mq_timedreceive>():"
1455 #: build/C/man3/mq_receive.3:55 build/C/man3/mq_send.3:55
1456 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
1460 #: build/C/man3/mq_receive.3:76
1462 "B<mq_receive>() removes the oldest message with the highest priority from "
1463 "the message queue referred to by the descriptor I<mqdes>, and places it in "
1464 "the buffer pointed to by I<msg_ptr>. The I<msg_len> argument specifies the "
1465 "size of the buffer pointed to by I<msg_ptr>; this must be greater than the "
1466 "I<mq_msgsize> attribute of the queue (see B<mq_getattr>(3)). If I<prio> is "
1467 "not NULL, then the buffer to which it points is used to return the priority "
1468 "associated with the received message."
1472 #: build/C/man3/mq_receive.3:86
1474 "If the queue is empty, then, by default, B<mq_receive>() blocks until a "
1475 "message becomes available, or the call is interrupted by a signal handler. "
1476 "If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
1477 "the call instead fails immediately with the error B<EAGAIN>."
1481 #: build/C/man3/mq_receive.3:99
1483 "B<mq_timedreceive>() behaves just like B<mq_receive>(), except that if the "
1484 "queue is empty and the B<O_NONBLOCK> flag is not enabled for the message "
1485 "queue description, then I<abs_timeout> points to a structure which specifies "
1486 "a ceiling on the time for which the call will block. This ceiling is an "
1487 "absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
1488 "00:00:00 +0000 (UTC), and it is specified in the following structure:"
1492 #: build/C/man3/mq_receive.3:106 build/C/man3/mq_send.3:112
1495 "struct timespec {\n"
1496 " time_t tv_sec; /* seconds */\n"
1497 " long tv_nsec; /* nanoseconds */\n"
1502 #: build/C/man3/mq_receive.3:113
1504 "If no message is available, and the timeout has already expired by the time "
1505 "of the call, B<mq_timedreceive>() returns immediately."
1509 #: build/C/man3/mq_receive.3:122
1511 "On success, B<mq_receive>() and B<mq_timedreceive>() return the number of "
1512 "bytes in the received message; on error, -1 is returned, with I<errno> set "
1513 "to indicate the error."
1517 #: build/C/man3/mq_receive.3:123 build/C/man3/mq_send.3:128 build/C/man2/msgop.2:310 build/C/man2/msgop.2:365
1523 #: build/C/man3/mq_receive.3:129
1525 "The queue was empty, and the B<O_NONBLOCK> flag was set for the message "
1526 "queue description referred to by I<mqdes>."
1530 #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139
1531 msgid "The descriptor specified in I<mqdes> was invalid."
1535 #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139 build/C/man2/msgop.2:326 build/C/man2/msgop.2:380
1541 #: build/C/man3/mq_receive.3:138 build/C/man3/mq_send.3:143
1542 msgid "The call was interrupted by a signal handler; see B<signal>(7)."
1546 #: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
1548 "The call would have blocked, and I<abs_timeout> was invalid, either because "
1549 "I<tv_sec> was less than zero, or because I<tv_nsec> was less than zero or "
1550 "greater than 1000 million."
1554 #: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
1560 #: build/C/man3/mq_receive.3:153
1561 msgid "I<msg_len> was less than the I<mq_msgsize> attribute of the message queue."
1565 #: build/C/man3/mq_receive.3:153 build/C/man3/mq_send.3:158
1567 msgid "B<ETIMEDOUT>"
1571 #: build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161
1572 msgid "The call timed out before a message could be transferred."
1576 #: build/C/man3/mq_receive.3:164
1578 "On Linux, B<mq_timedreceive>() is a system call, and B<mq_receive>() is a "
1579 "library function layered on top of that system call."
1583 #: build/C/man3/mq_receive.3:172
1585 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1586 "B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
1590 #: build/C/man3/mq_send.3:26
1596 #: build/C/man3/mq_send.3:29
1597 msgid "mq_send, mq_timedsend - send a message to a message queue"
1601 #: build/C/man3/mq_send.3:35
1604 "B<int mq_send(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
1605 "B< size_t >I<msg_len>B<, unsigned >I<msg_prio>B<);>\n"
1609 #: build/C/man3/mq_send.3:42
1612 "B<int mq_timedsend(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
1613 "B< size_t >I<msg_len>B<, unsigned >I<msg_prio>B<,>\n"
1614 "B< const struct timespec *>I<abs_timeout>B<);>\n"
1618 #: build/C/man3/mq_send.3:53
1619 msgid "B<mq_timedsend>():"
1623 #: build/C/man3/mq_send.3:71
1625 "B<mq_send>() adds the message pointed to by I<msg_ptr> to the message queue "
1626 "referred to by the descriptor I<mqdes>. The I<msg_len> argument specifies "
1627 "the length of the message pointed to by I<msg_ptr>; this length must be less "
1628 "than or equal to the queue's I<mq_msgsize> attribute. Zero-length messages "
1633 #: build/C/man3/mq_send.3:79
1635 "The I<msg_prio> argument is a nonnegative integer that specifies the "
1636 "priority of this message. Messages are placed on the queue in decreasing "
1637 "order of priority, with newer messages of the same priority being placed "
1638 "after older messages with the same priority."
1642 #: build/C/man3/mq_send.3:92
1644 "If the message queue is already full (i.e., the number of messages on the "
1645 "queue equals the queue's I<mq_maxmsg> attribute), then, by default, "
1646 "B<mq_send>() blocks until sufficient space becomes available to allow the "
1647 "message to be queued, or until the call is interrupted by a signal handler. "
1648 "If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
1649 "the call instead fails immediately with the error B<EAGAIN>."
1653 #: build/C/man3/mq_send.3:105
1655 "B<mq_timedsend>() behaves just like B<mq_send>(), except that if the queue "
1656 "is full and the B<O_NONBLOCK> flag is not enabled for the message queue "
1657 "description, then I<abs_timeout> points to a structure which specifies a "
1658 "ceiling on the time for which the call will block. This ceiling is an "
1659 "absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
1660 "00:00:00 +0000 (UTC), and it is specified in the following structure:"
1664 #: build/C/man3/mq_send.3:119
1666 "If the message queue is full, and the timeout has already expired by the "
1667 "time of the call, B<mq_timedsend>() returns immediately."
1671 #: build/C/man3/mq_send.3:127
1673 "On success, B<mq_send>() and B<mq_timedsend>() return zero; on error, -1 "
1674 "is returned, with I<errno> set to indicate the error."
1678 #: build/C/man3/mq_send.3:134
1680 "The queue was full, and the B<O_NONBLOCK> flag was set for the message queue "
1681 "description referred to by I<mqdes>."
1685 #: build/C/man3/mq_send.3:158
1687 "I<msg_len> was greater than the I<mq_msgsize> attribute of the message "
1692 #: build/C/man3/mq_send.3:169
1694 "On Linux, B<mq_timedsend>() is a system call, and B<mq_send>() is a "
1695 "library function layered on top of that system call."
1699 #: build/C/man3/mq_send.3:177
1701 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1702 "B<mq_receive>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
1706 #: build/C/man3/mq_unlink.3:26
1712 #: build/C/man3/mq_unlink.3:29
1713 msgid "mq_unlink - remove a message queue"
1717 #: build/C/man3/mq_unlink.3:34
1719 msgid "B<int mq_unlink(const char *>I<name>B<);>\n"
1723 #: build/C/man3/mq_unlink.3:44
1725 "B<mq_unlink>() removes the specified message queue I<name>. The message "
1726 "queue name is removed immediately. The queue itself is destroyed once any "
1727 "other processes that have the queue open close their descriptors referring "
1732 #: build/C/man3/mq_unlink.3:50
1734 "On success B<mq_unlink>() returns 0; on error, -1 is returned, with "
1735 "I<errno> set to indicate the error."
1739 #: build/C/man3/mq_unlink.3:54
1740 msgid "The caller does not have permission to unlink this message queue."
1744 #: build/C/man3/mq_unlink.3:62
1745 msgid "There is no message queue with the given I<name>."
1749 #: build/C/man3/mq_unlink.3:71
1751 "B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
1752 "B<mq_receive>(3), B<mq_send>(3), B<mq_overview>(7)"
1756 #: build/C/man2/msgctl.2:35
1762 #: build/C/man2/msgctl.2:35
1768 #: build/C/man2/msgctl.2:38
1769 msgid "msgctl - message control operations"
1773 #: build/C/man2/msgctl.2:43 build/C/man2/msgget.2:41 build/C/man2/msgop.2:46
1776 "B<#include E<lt>sys/types.hE<gt>>\n"
1777 "B<#include E<lt>sys/ipc.hE<gt>>\n"
1778 "B<#include E<lt>sys/msg.hE<gt>>\n"
1782 #: build/C/man2/msgctl.2:45
1784 msgid "B<int msgctl(int >I<msqid>B<, int >I<cmd>B<, struct msqid_ds *>I<buf>B<);>\n"
1788 #: build/C/man2/msgctl.2:52
1790 "B<msgctl>() performs the control operation specified by I<cmd> on the "
1791 "message queue with identifier I<msqid>."
1795 #: build/C/man2/msgctl.2:56
1797 "The I<msqid_ds> data structure is defined in I<E<lt>sys/msg.hE<gt>> as "
1802 #: build/C/man2/msgctl.2:73
1805 "struct msqid_ds {\n"
1806 " struct ipc_perm msg_perm; /* Ownership and permissions */\n"
1807 " time_t msg_stime; /* Time of last msgsnd(2) */\n"
1808 " time_t msg_rtime; /* Time of last msgrcv(2) */\n"
1809 " time_t msg_ctime; /* Time of last change */\n"
1810 " unsigned long __msg_cbytes; /* Current number of bytes in\n"
1811 " queue (nonstandard) */\n"
1812 " msgqnum_t msg_qnum; /* Current number of messages\n"
1814 " msglen_t msg_qbytes; /* Maximum number of bytes\n"
1815 " allowed in queue */\n"
1816 " pid_t msg_lspid; /* PID of last msgsnd(2) */\n"
1817 " pid_t msg_lrpid; /* PID of last msgrcv(2) */\n"
1822 #: build/C/man2/msgctl.2:81
1824 "The I<ipc_perm> structure is defined in I<E<lt>sys/ipc.hE<gt>> as follows "
1825 "(the highlighted fields are settable using B<IPC_SET>):"
1829 #: build/C/man2/msgctl.2:93
1832 "struct ipc_perm {\n"
1833 " key_t __key; /* Key supplied to msgget(2) */\n"
1834 " uid_t B<uid>; /* Effective UID of owner */\n"
1835 " gid_t B<gid>; /* Effective GID of owner */\n"
1836 " uid_t cuid; /* Effective UID of creator */\n"
1837 " gid_t cgid; /* Effective GID of creator */\n"
1838 " unsigned short B<mode>; /* Permissions */\n"
1839 " unsigned short __seq; /* Sequence number */\n"
1844 #: build/C/man2/msgctl.2:99
1845 msgid "Valid values for I<cmd> are:"
1849 #: build/C/man2/msgctl.2:99
1855 #: build/C/man2/msgctl.2:108
1857 "Copy information from the kernel data structure associated with I<msqid> "
1858 "into the I<msqid_ds> structure pointed to by I<buf>. The caller must have "
1859 "read permission on the message queue."
1863 #: build/C/man2/msgctl.2:108
1869 #: build/C/man2/msgctl.2:135
1871 "Write the values of some members of the I<msqid_ds> structure pointed to by "
1872 "I<buf> to the kernel data structure associated with this message queue, "
1873 "updating also its I<msg_ctime> member. The following members of the "
1874 "structure are updated: I<msg_qbytes>, I<msg_perm.uid>, I<msg_perm.gid>, and "
1875 "(the least significant 9 bits of) I<msg_perm.mode>. The effective UID of "
1876 "the calling process must match the owner (I<msg_perm.uid>) or creator "
1877 "(I<msg_perm.cuid>) of the message queue, or the caller must be privileged. "
1878 "Appropriate privilege (Linux: the B<CAP_IPC_RESOURCE> capability) is "
1879 "required to raise the I<msg_qbytes> value beyond the system parameter "
1884 #: build/C/man2/msgctl.2:135
1890 #: build/C/man2/msgctl.2:146
1892 "Immediately remove the message queue, awakening all waiting reader and "
1893 "writer processes (with an error return and I<errno> set to B<EIDRM>). The "
1894 "calling process must have appropriate privileges or its effective user ID "
1895 "must be either that of the creator or owner of the message queue."
1899 #: build/C/man2/msgctl.2:146
1901 msgid "B<IPC_INFO> (Linux-specific)"
1905 #: build/C/man2/msgctl.2:159
1907 "Returns information about system-wide message queue limits and parameters in "
1908 "the structure pointed to by I<buf>. This structure is of type I<msginfo> "
1909 "(thus, a cast is required), defined in I<E<lt>sys/msg.hE<gt>> if the "
1910 "B<_GNU_SOURCE> feature test macro is defined:"
1914 #: build/C/man2/msgctl.2:183
1917 "struct msginfo {\n"
1918 " int msgpool; /* Size in kibibytes of buffer pool\n"
1919 " used to hold message data;\n"
1920 " unused within kernel */\n"
1921 " int msgmap; /* Maximum number of entries in message\n"
1922 " map; unused within kernel */\n"
1923 " int msgmax; /* Maximum number of bytes that can be\n"
1924 " written in a single message */\n"
1925 " int msgmnb; /* Maximum number of bytes that can be\n"
1926 " written to queue; used to initialize\n"
1927 " msg_qbytes during queue creation\n"
1929 " int msgmni; /* Maximum number of message queues */\n"
1930 " int msgssz; /* Message segment size;\n"
1931 " unused within kernel */\n"
1932 " int msgtql; /* Maximum number of messages on all queues\n"
1933 " in system; unused within kernel */\n"
1934 " unsigned short int msgseg;\n"
1935 " /* Maximum number of segments;\n"
1936 " unused within kernel */\n"
1941 #: build/C/man2/msgctl.2:196
1943 "The I<msgmni>, I<msgmax>, and I<msgmnb> settings can be changed via I</proc> "
1944 "files of the same name; see B<proc>(5) for details."
1948 #: build/C/man2/msgctl.2:196
1950 msgid "B<MSG_INFO> (Linux-specific)"
1954 #: build/C/man2/msgctl.2:213
1956 "Returns a I<msginfo> structure containing the same information as for "
1957 "B<IPC_INFO>, except that the following fields are returned with information "
1958 "about system resources consumed by message queues: the I<msgpool> field "
1959 "returns the number of message queues that currently exist on the system; the "
1960 "I<msgmap> field returns the total number of messages in all queues on the "
1961 "system; and the I<msgtql> field returns the total number of bytes in all "
1962 "messages in all queues on the system."
1966 #: build/C/man2/msgctl.2:213
1968 msgid "B<MSG_STAT> (Linux-specific)"
1972 #: build/C/man2/msgctl.2:224
1974 "Returns a I<msqid_ds> structure as for B<IPC_STAT>. However, the I<msqid> "
1975 "argument is not a queue identifier, but instead an index into the kernel's "
1976 "internal array that maintains information about all message queues on the "
1981 #: build/C/man2/msgctl.2:245
1983 "On success, B<IPC_STAT>, B<IPC_SET>, and B<IPC_RMID> return 0. A successful "
1984 "B<IPC_INFO> or B<MSG_INFO> operation returns the index of the highest used "
1985 "entry in the kernel's internal array recording information about all message "
1986 "queues. (This information can be used with repeated B<MSG_STAT> operations "
1987 "to obtain information about all queues on the system.) A successful "
1988 "B<MSG_STAT> operation returns the identifier of the queue whose index was "
1989 "given in I<msqid>."
1993 #: build/C/man2/msgctl.2:249
1994 msgid "On error, -1 is returned with I<errno> indicating the error."
1998 #: build/C/man2/msgctl.2:253
1999 msgid "On failure, I<errno> is set to one of the following:"
2003 #: build/C/man2/msgctl.2:266
2005 "The argument I<cmd> is equal to B<IPC_STAT> or B<MSG_STAT>, but the calling "
2006 "process does not have read permission on the message queue I<msqid>, and "
2007 "does not have the B<CAP_IPC_OWNER> capability."
2011 #: build/C/man2/msgctl.2:266 build/C/man2/msgop.2:318 build/C/man2/msgop.2:371
2017 #: build/C/man2/msgctl.2:277
2019 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_STAT>, but the address "
2020 "pointed to by I<buf> isn't accessible."
2024 #: build/C/man2/msgctl.2:277 build/C/man2/msgop.2:323 build/C/man2/msgop.2:376
2030 #: build/C/man2/msgctl.2:280 build/C/man2/msgop.2:326
2031 msgid "The message queue was removed."
2035 #: build/C/man2/msgctl.2:291
2037 "Invalid value for I<cmd> or I<msqid>. Or: for a B<MSG_STAT> operation, the "
2038 "index value specified in I<msqid> referred to an array slot that is "
2043 #: build/C/man2/msgctl.2:291
2049 #: build/C/man2/msgctl.2:309
2051 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_RMID>, but the "
2052 "effective user ID of the calling process is not the creator (as found in "
2053 "I<msg_perm.cuid>) or the owner (as found in I<msg_perm.uid>) of the "
2054 "message queue, and the process is not privileged (Linux: it does not have "
2055 "the B<CAP_SYS_ADMIN> capability)."
2059 #: build/C/man2/msgctl.2:312 build/C/man2/msgget.2:183 build/C/man2/msgop.2:399
2060 msgid "SVr4, POSIX.1-2001."
2064 #: build/C/man2/msgctl.2:323
2066 "The B<IPC_INFO>, B<MSG_STAT> and B<MSG_INFO> operations are used by the "
2067 "B<ipcs>(1) program to provide information on allocated resources. In the "
2068 "future these may modified or moved to a /proc file system interface."
2072 #: build/C/man2/msgctl.2:337
2074 "Various fields in the I<struct msqid_ds> were typed as I<short> under Linux "
2075 "2.2 and have become I<long> under Linux 2.4. To take advantage of this, a "
2076 "recompilation under glibc-2.1.91 or later should suffice. (The kernel "
2077 "distinguishes old and new calls by an B<IPC_64> flag in I<cmd>.)"
2081 #: build/C/man2/msgctl.2:343
2083 "B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<capabilities>(7), "
2084 "B<mq_overview>(7), B<svipc>(7)"
2088 #: build/C/man2/msgget.2:33
2094 #: build/C/man2/msgget.2:33
2100 #: build/C/man2/msgget.2:36
2101 msgid "msgget - get a message queue identifier"
2105 #: build/C/man2/msgget.2:43
2107 msgid "B<int msgget(key_t >I<key>B<, int >I<msgflg>B<);>\n"
2111 #: build/C/man2/msgget.2:65
2113 "The B<msgget>() system call returns the message queue identifier associated "
2114 "with the value of the I<key> argument. A new message queue is created if "
2115 "I<key> has the value B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no "
2116 "message queue with the given key I<key> exists, and B<IPC_CREAT> is "
2117 "specified in I<msgflg>."
2121 #: build/C/man2/msgget.2:84
2123 "If I<msgflg> specifies both B<IPC_CREAT> and B<IPC_EXCL> and a message queue "
2124 "already exists for I<key>, then B<msgget>() fails with I<errno> set to "
2125 "B<EEXIST>. (This is analogous to the effect of the combination B<O_CREAT | "
2126 "O_EXCL> for B<open>(2).)"
2130 #: build/C/man2/msgget.2:94
2132 "Upon creation, the least significant bits of the argument I<msgflg> define "
2133 "the permissions of the message queue. These permission bits have the same "
2134 "format and semantics as the permissions specified for the I<mode> argument "
2135 "of B<open>(2). (The execute permissions are not used.)"
2139 #: build/C/man2/msgget.2:101
2141 "If a new message queue is created, then its associated data structure "
2142 "I<msqid_ds> (see B<msgctl>(2)) is initialized as follows:"
2146 #: build/C/man2/msgget.2:106
2148 "I<msg_perm.cuid> and I<msg_perm.uid> are set to the effective user ID of the "
2153 #: build/C/man2/msgget.2:111
2155 "I<msg_perm.cgid> and I<msg_perm.gid> are set to the effective group ID of "
2156 "the calling process."
2160 #: build/C/man2/msgget.2:116
2162 "The least significant 9 bits of I<msg_perm.mode> are set to the least "
2163 "significant 9 bits of I<msgflg>."
2167 #: build/C/man2/msgget.2:124
2169 "I<msg_qnum>, I<msg_lspid>, I<msg_lrpid>, I<msg_stime> and I<msg_rtime> are "
2174 #: build/C/man2/msgget.2:127
2175 msgid "I<msg_ctime> is set to the current time."
2179 #: build/C/man2/msgget.2:131
2180 msgid "I<msg_qbytes> is set to the system limit B<MSGMNB>."
2184 #: build/C/man2/msgget.2:135
2186 "If the message queue already exists the permissions are verified, and a "
2187 "check is made to see if it is marked for destruction."
2191 #: build/C/man2/msgget.2:141
2193 "If successful, the return value will be the message queue identifier (a "
2194 "nonnegative integer), otherwise -1 with I<errno> indicating the error."
2198 #: build/C/man2/msgget.2:145
2199 msgid "On failure, I<errno> is set to one of the following values:"
2203 #: build/C/man2/msgget.2:153
2205 "A message queue exists for I<key>, but the calling process does not have "
2206 "permission to access the queue, and does not have the B<CAP_IPC_OWNER> "
2211 #: build/C/man2/msgget.2:163
2213 "A message queue exists for I<key> and I<msgflg> specified both B<IPC_CREAT> "
2218 #: build/C/man2/msgget.2:171
2220 "No message queue exists for I<key> and I<msgflg> did not specify "
2225 #: build/C/man2/msgget.2:175
2227 "A message queue has to be created but the system does not have enough memory "
2228 "for the new data structure."
2232 #: build/C/man2/msgget.2:181
2234 "A message queue has to be created but the system limit for the maximum "
2235 "number of message queues (B<MSGMNI>) would be exceeded."
2239 #: build/C/man2/msgget.2:193
2241 "B<IPC_PRIVATE> isn't a flag field but a I<key_t> type. If this special "
2242 "value is used for I<key>, the system call ignores everything but the least "
2243 "significant 9 bits of I<msgflg> and creates a new message queue (on "
2248 #: build/C/man2/msgget.2:197
2250 "The following is a system limit on message queue resources affecting a "
2255 #: build/C/man2/msgget.2:197
2261 #: build/C/man2/msgget.2:203
2263 "System wide maximum number of message queues: policy dependent (on Linux, "
2264 "this limit can be read and modified via I</proc/sys/kernel/msgmni>)."
2268 #: build/C/man2/msgget.2:203
2274 #: build/C/man2/msgget.2:209
2276 "Until version 2.3.20 Linux would return B<EIDRM> for a B<msgget>() on a "
2277 "message queue scheduled for deletion."
2281 #: build/C/man2/msgget.2:215
2283 "The name choice B<IPC_PRIVATE> was perhaps unfortunate, B<IPC_NEW> would "
2284 "more clearly show its function."
2288 #: build/C/man2/msgget.2:222
2290 "B<msgctl>(2), B<msgrcv>(2), B<msgsnd>(2), B<ftok>(3), B<capabilities>(7), "
2291 "B<mq_overview>(7), B<svipc>(7)"
2295 #: build/C/man2/msgop.2:38
2301 #: build/C/man2/msgop.2:38
2307 #: build/C/man2/msgop.2:41
2308 msgid "msgrcv, msgsnd - message operations"
2312 #: build/C/man2/msgop.2:49
2315 "B<int msgsnd(int >I<msqid>B<, const void *>I<msgp>B<, size_t >I<msgsz>B<, "
2316 "int >I<msgflg>B<);>\n"
2320 #: build/C/man2/msgop.2:53
2323 "B<ssize_t msgrcv(int >I<msqid>B<, void *>I<msgp>B<, size_t >I<msgsz>B<, long "
2325 "B< int >I<msgflg>B<);>\n"
2329 #: build/C/man2/msgop.2:63
2331 "The B<msgsnd>() and B<msgrcv>() system calls are used, respectively, to "
2332 "send messages to, and receive messages from, a message queue. The calling "
2333 "process must have write permission on the message queue in order to send a "
2334 "message, and read permission to receive a message."
2338 #: build/C/man2/msgop.2:68
2340 "The I<msgp> argument is a pointer to caller-defined structure of the "
2341 "following general form:"
2345 #: build/C/man2/msgop.2:75
2349 " long mtype; /* message type, must be E<gt> 0 */\n"
2350 " char mtext[1]; /* message data */\n"
2355 #: build/C/man2/msgop.2:94
2357 "The I<mtext> field is an array (or other structure) whose size is specified "
2358 "by I<msgsz>, a nonnegative integer value. Messages of zero length (i.e., no "
2359 "I<mtext> field) are permitted. The I<mtype> field must have a strictly "
2360 "positive integer value. This value can be used by the receiving process for "
2361 "message selection (see the description of B<msgrcv>() below)."
2365 #: build/C/man2/msgop.2:94
2371 #: build/C/man2/msgop.2:102
2373 "The B<msgsnd>() system call appends a copy of the message pointed to by "
2374 "I<msgp> to the message queue whose identifier is specified by I<msqid>."
2378 #: build/C/man2/msgop.2:123
2380 "If sufficient space is available in the queue, B<msgsnd>() succeeds "
2381 "immediately. (The queue capacity is defined by the I<msg_qbytes> field in "
2382 "the associated data structure for the message queue. During queue creation "
2383 "this field is initialized to B<MSGMNB> bytes, but this limit can be modified "
2384 "using B<msgctl>(2).) If insufficient space is available in the queue, then "
2385 "the default behavior of B<msgsnd>() is to block until space becomes "
2386 "available. If B<IPC_NOWAIT> is specified in I<msgflg>, then the call "
2387 "instead fails with the error B<EAGAIN>."
2391 #: build/C/man2/msgop.2:127
2392 msgid "A blocked B<msgsnd>() call may also fail if:"
2396 #: build/C/man2/msgop.2:127 build/C/man2/msgop.2:134 build/C/man2/msgop.2:196 build/C/man2/msgop.2:201 build/C/man2/msgop.2:215 build/C/man2/msgop.2:254 build/C/man2/msgop.2:256 build/C/man2/msgop.2:262
2402 #: build/C/man2/msgop.2:134
2404 "the queue is removed, in which case the system call fails with I<errno> set "
2409 #: build/C/man2/msgop.2:146
2411 "a signal is caught, in which case the system call fails with I<errno> set to "
2412 "B<EINTR>;B<see> B<signal>(7). (B<msgsnd>() is never automatically "
2413 "restarted after being interrupted by a signal handler, regardless of the "
2414 "setting of the B<SA_RESTART> flag when establishing a signal handler.)"
2418 #: build/C/man2/msgop.2:149 build/C/man2/msgop.2:276
2420 "Upon successful completion the message queue data structure is updated as "
2425 #: build/C/man2/msgop.2:152
2426 msgid "I<msg_lspid> is set to the process ID of the calling process."
2430 #: build/C/man2/msgop.2:155
2431 msgid "I<msg_qnum> is incremented by 1."
2435 #: build/C/man2/msgop.2:158
2436 msgid "I<msg_stime> is set to the current time."
2440 #: build/C/man2/msgop.2:158
2446 #: build/C/man2/msgop.2:166
2448 "The B<msgrcv>() system call removes a message from the queue specified by "
2449 "I<msqid> and places it in the buffer pointed to by I<msgp>."
2453 #: build/C/man2/msgop.2:192
2455 "The argument I<msgsz> specifies the maximum size in bytes for the member "
2456 "I<mtext> of the structure pointed to by the I<msgp> argument. If the "
2457 "message text has length greater than I<msgsz>, then the behavior depends on "
2458 "whether B<MSG_NOERROR> is specified in I<msgflg>. If B<MSG_NOERROR> is "
2459 "specified, then the message text will be truncated (and the truncated part "
2460 "will be lost); if B<MSG_NOERROR> is not specified, then the message isn't "
2461 "removed from the queue and the system call fails returning -1 with I<errno> "
2466 #: build/C/man2/msgop.2:196
2467 msgid "The argument I<msgtyp> specifies the type of message requested as follows:"
2471 #: build/C/man2/msgop.2:201
2472 msgid "If I<msgtyp> is 0, then the first message in the queue is read."
2476 #: build/C/man2/msgop.2:215
2478 "If I<msgtyp> is greater than 0, then the first message in the queue of type "
2479 "I<msgtyp> is read, unless B<MSG_EXCEPT> was specified in I<msgflg>, in which "
2480 "case the first message in the queue of type not equal to I<msgtyp> will be "
2485 #: build/C/man2/msgop.2:223
2487 "If I<msgtyp> is less than 0, then the first message in the queue with the "
2488 "lowest type less than or equal to the absolute value of I<msgtyp> will be "
2493 #: build/C/man2/msgop.2:228
2495 "The I<msgflg> argument is a bit mask constructed by ORing together zero or "
2496 "more of the following flags:"
2500 #: build/C/man2/msgop.2:228
2502 msgid "B<IPC_NOWAIT>"
2506 #: build/C/man2/msgop.2:235
2508 "Return immediately if no message of the requested type is in the queue. The "
2509 "system call fails with I<errno> set to B<ENOMSG>."
2513 #: build/C/man2/msgop.2:235
2515 msgid "B<MSG_EXCEPT>"
2519 #: build/C/man2/msgop.2:243
2521 "Used with I<msgtyp> greater than 0 to read the first message in the queue "
2522 "with message type that differs from I<msgtyp>."
2526 #: build/C/man2/msgop.2:243
2528 msgid "B<MSG_NOERROR>"
2532 #: build/C/man2/msgop.2:248
2533 msgid "To truncate the message text if longer than I<msgsz> bytes."
2537 #: build/C/man2/msgop.2:254
2539 "If no message of the requested type is available and B<IPC_NOWAIT> isn't "
2540 "specified in I<msgflg>, the calling process is blocked until one of the "
2541 "following conditions occurs:"
2545 #: build/C/man2/msgop.2:256
2546 msgid "A message of the desired type is placed in the queue."
2550 #: build/C/man2/msgop.2:262
2552 "The message queue is removed from the system. In this case the system call "
2553 "fails with I<errno> set to B<EIDRM>."
2557 #: build/C/man2/msgop.2:273
2559 "The calling process catches a signal. In this case the system call fails "
2560 "with I<errno> set to B<EINTR>. (B<msgrcv>() is never automatically "
2561 "restarted after being interrupted by a signal handler, regardless of the "
2562 "setting of the B<SA_RESTART> flag when establishing a signal handler.)"
2566 #: build/C/man2/msgop.2:279
2567 msgid "I<msg_lrpid> is set to the process ID of the calling process."
2571 #: build/C/man2/msgop.2:282
2572 msgid "I<msg_qnum> is decremented by 1."
2576 #: build/C/man2/msgop.2:285
2577 msgid "I<msg_rtime> is set to the current time."
2581 #: build/C/man2/msgop.2:298
2583 "On failure both functions return -1 with I<errno> indicating the error, "
2584 "otherwise B<msgsnd>() returns 0 and B<msgrcv>() returns the number of "
2585 "bytes actually copied into the I<mtext> array."
2589 #: build/C/man2/msgop.2:304
2591 "When B<msgsnd>() fails, I<errno> will be set to one among the following "
2596 #: build/C/man2/msgop.2:310
2598 "The calling process does not have write permission on the message queue, and "
2599 "does not have the B<CAP_IPC_OWNER> capability."
2603 #: build/C/man2/msgop.2:318
2605 "The message can't be sent due to the I<msg_qbytes> limit for the queue and "
2606 "B<IPC_NOWAIT> was specified in I<msgflg>."
2610 #: build/C/man2/msgop.2:323 build/C/man2/msgop.2:376
2611 msgid "The address pointed to by I<msgp> isn't accessible."
2615 #: build/C/man2/msgop.2:329
2616 msgid "Sleeping on a full message queue condition, the process caught a signal."
2620 #: build/C/man2/msgop.2:340
2622 "Invalid I<msqid> value, or nonpositive I<mtype> value, or invalid I<msgsz> "
2623 "value (less than 0 or greater than the system value B<MSGMAX>)."
2627 #: build/C/man2/msgop.2:345
2629 "The system does not have enough memory to make a copy of the message pointed "
2634 #: build/C/man2/msgop.2:351
2636 "When B<msgrcv>() fails, I<errno> will be set to one among the following "
2641 #: build/C/man2/msgop.2:351
2647 #: build/C/man2/msgop.2:359
2649 "The message text length is greater than I<msgsz> and B<MSG_NOERROR> isn't "
2650 "specified in I<msgflg>."
2654 #: build/C/man2/msgop.2:365
2656 "The calling process does not have read permission on the message queue, and "
2657 "does not have the B<CAP_IPC_OWNER> capability."
2661 #: build/C/man2/msgop.2:371
2663 "No message was available in the queue and B<IPC_NOWAIT> was specified in "
2668 #: build/C/man2/msgop.2:380
2670 "While the process was sleeping to receive a message, the message queue was "
2675 #: build/C/man2/msgop.2:385
2677 "While the process was sleeping to receive a message, the process caught a "
2678 "signal; see B<signal>(7)."
2682 #: build/C/man2/msgop.2:391
2683 msgid "I<msgqid> was invalid, or I<msgsz> was less than 0."
2687 #: build/C/man2/msgop.2:391
2693 #: build/C/man2/msgop.2:397
2695 "B<IPC_NOWAIT> was specified in I<msgflg> and no message of the requested "
2696 "type existed on the message queue."
2700 #: build/C/man2/msgop.2:406
2702 "The I<msgp> argument is declared as I<struct msgbuf *> with libc4, libc5, "
2703 "glibc 2.0, glibc 2.1. It is declared as I<void *> with glibc 2.2 and later, "
2704 "as required by SUSv2 and SUSv3."
2708 #: build/C/man2/msgop.2:410
2710 "The following limits on message queue resources affect the B<msgsnd>() "
2715 #: build/C/man2/msgop.2:410
2721 #: build/C/man2/msgop.2:415
2723 "Maximum size for a message text: 8192 bytes (on Linux, this limit can be "
2724 "read and modified via I</proc/sys/kernel/msgmax>)."
2728 #: build/C/man2/msgop.2:415
2734 #: build/C/man2/msgop.2:425
2736 "Default maximum size in bytes of a message queue: 16384 bytes (on Linux, "
2737 "this limit can be read and modified via I</proc/sys/kernel/msgmnb>). The "
2738 "superuser can increase the size of a message queue beyond B<MSGMNB> by a "
2739 "B<msgctl>(2) system call."
2743 #: build/C/man2/msgop.2:431
2745 "The implementation has no intrinsic limits for the system wide maximum "
2746 "number of message headers (B<MSGTQL>) and for the system wide maximum size "
2747 "in bytes of the message pool (B<MSGPOOL>)."
2751 #: build/C/man2/msgop.2:436
2753 "B<msgctl>(2), B<msgget>(2), B<capabilities>(7), B<mq_overview>(7), "