# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2012-05-01 04:38+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: TH
#: build/C/man3/mq_close.3:26
#, no-wrap
msgid "MQ_CLOSE"
msgstr ""

#. type: TH
#: 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
#, no-wrap
msgid "2010-08-29"
msgstr ""

#. type: TH
#: 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
#, no-wrap
msgid "Linux"
msgstr ""

#. type: TH
#: 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
#, no-wrap
msgid "Linux Programmer's Manual"
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "NAME"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:29
msgid "mq_close - close a message queue descriptor"
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "SYNOPSIS"
msgstr ""

#. type: Plain text
#: 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
#, no-wrap
msgid "B<#include E<lt>mqueue.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:34
#, no-wrap
msgid "B<int mq_close(mqd_t >I<mqdes>B<);>\n"
msgstr ""

#. type: Plain text
#: 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
msgid "Link with I<-lrt>."
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "DESCRIPTION"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:41
msgid "B<mq_close>()  closes the message queue descriptor I<mqdes>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:47
msgid ""
"If the calling process has attached a notification request to this message "
"queue via I<mqdes>, then this request is removed, and another process can "
"now attach a notification request."
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "RETURN VALUE"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:53
msgid ""
"On success B<mq_close>()  returns 0; on error, -1 is returned, with I<errno> "
"set to indicate the error."
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "ERRORS"
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<EBADF>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:59 build/C/man3/mq_getattr.3:132 build/C/man3/mq_notify.3:146
msgid "The descriptor specified in I<mqdes> is invalid."
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "CONFORMING TO"
msgstr ""

#. type: Plain text
#: 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
msgid "POSIX.1-2001."
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "NOTES"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:65
msgid ""
"All open message queues are automatically closed on process termination, or "
"upon B<execve>(2)."
msgstr ""

#. type: SH
#: 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
#, no-wrap
msgid "SEE ALSO"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:73
msgid ""
"B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), B<mq_receive>(3), "
"B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
msgstr ""

#. type: SH
#: build/C/man3/mq_close.3:73 build/C/man3/mq_getattr.3:155 build/C/man2/mq_getsetattr.2:56 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:344 build/C/man2/msgget.2:223 build/C/man2/msgop.2:437
#, no-wrap
msgid "COLOPHON"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_close.3:80 build/C/man3/mq_getattr.3:162 build/C/man2/mq_getsetattr.2:63 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:351 build/C/man2/msgget.2:230 build/C/man2/msgop.2:444
msgid ""
"This page is part of release 3.40 of the Linux I<man-pages> project.  A "
"description of the project, and information about reporting bugs, can be "
"found at http://www.kernel.org/doc/man-pages/."
msgstr ""

#. type: TH
#: build/C/man3/mq_getattr.3:26
#, no-wrap
msgid "MQ_GETATTR"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:29
msgid "mq_getattr, mq_setattr - get/set message queue attributes"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:34
#, no-wrap
msgid "B<int mq_getattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<attr>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:37
#, no-wrap
msgid ""
"B<int mq_setattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<newattr>B<,>\n"
"B<                 struct mq_attr *>I<oldattr>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:47
msgid ""
"B<mq_getattr>()  and B<mq_setattr>()  respectively retrieve and modify "
"attributes of the message queue referred to by the descriptor I<mqdes>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:54
msgid ""
"B<mq_getattr>()  returns an I<mq_attr> structure in the buffer pointed by "
"I<attr>.  This structure is defined as:"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:63
#, no-wrap
msgid ""
"struct mq_attr {\n"
"    long mq_flags;       /* Flags: 0 or O_NONBLOCK */\n"
"    long mq_maxmsg;      /* Max. # of messages on queue */\n"
"    long mq_msgsize;     /* Max. message size (bytes) */\n"
"    long mq_curmsgs;     /* # of messages currently in queue */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:73
msgid ""
"The I<mq_flags> field contains flags associated with the open message queue "
"description.  This field is initialized when the queue is created by "
"B<mq_open>(3).  The only flag that can appear in this field is "
"B<O_NONBLOCK>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:94
msgid ""
"The I<mq_maxmsg> and I<mq_msgsize> fields are set when the message queue is "
"created by B<mq_open>(3).  The I<mq_maxmsg> field is an upper limit on the "
"number of messages that may be placed on the queue using B<mq_send>(3).  The "
"I<mq_msgsize> field is an upper limit on the size of messages that may be "
"placed on the queue.  Both of these fields must have a value greater than "
"zero.  Two I</proc> files that place ceilings on the values for these fields "
"are described in B<mq_open>(3)."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:98
msgid ""
"The I<mq_curmsgs> field returns the number of messages currently held in the "
"queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:118
msgid ""
"B<mq_setattr>()  sets message queue attributes using information supplied in "
"the I<mq_attr> structure pointed to by I<newattr>.  The only attribute that "
"can be modified is the setting of the B<O_NONBLOCK> flag in I<mq_flags>.  "
"The other fields in I<newattr> are ignored.  If the I<oldattr> field is not "
"NULL, then the buffer that it points to is used to return an I<mq_attr> "
"structure that contains the same information that is returned by "
"B<mq_getattr>()."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:126
msgid ""
"On success B<mq_getattr>()  and B<mq_setattr>()  return 0; on error, -1 is "
"returned, with I<errno> set to indicate the error."
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<EINVAL>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:137
msgid "I<newattr-E<gt>mq_flags> contained set bits other than B<O_NONBLOCK>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:147
msgid ""
"On Linux, B<mq_getattr>()  and B<mq_setattr>()  are library functions "
"layered on top of the B<mq_getsetattr>(2)  system call."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_getattr.3:155
msgid ""
"B<mq_close>(3), B<mq_notify>(3), B<mq_open>(3), B<mq_receive>(3), "
"B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
msgstr ""

#. type: TH
#: build/C/man2/mq_getsetattr.2:26
#, no-wrap
msgid "MQ_GETSETATTR"
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:29
msgid "mq_getsetattr - get/set message queue attributes"
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:33
#, no-wrap
msgid ""
"B<#include E<lt>sys/types.hE<gt>>\n"
"B<#include E<lt>mqueue.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:36
#, no-wrap
msgid ""
"B<int mq_getsetattr(mqd_t >I<mqdes>B<, struct mq_attr *>I<newattr>B<,>\n"
"B<                 struct mq_attr *>I<oldattr>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:39
msgid "Do not use this system call."
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:47
msgid ""
"This is the low-level system call used to implement B<mq_getattr>(3)  and "
"B<mq_setattr>(3).  For an explanation of how this system call operates, see "
"the description of B<mq_setattr>(3)."
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:49
msgid "This interface is nonstandard; avoid its use."
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:53
msgid ""
"Glibc does not provide a wrapper for this system call; call it using "
"B<syscall>(2).  (Actually, never call it unless you are writing a C "
"library!)"
msgstr ""

#. type: Plain text
#: build/C/man2/mq_getsetattr.2:56
msgid "B<mq_getattr>(3), B<mq_overview>(7)"
msgstr ""

#. type: TH
#: build/C/man3/mq_notify.3:26
#, no-wrap
msgid "MQ_NOTIFY"
msgstr ""

#. type: TH
#: build/C/man3/mq_notify.3:26
#, no-wrap
msgid "2010-10-04"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:29
msgid "mq_notify - register for notification when a message is available"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:34
#, no-wrap
msgid "B<int mq_notify(mqd_t >I<mqdes>B<, const struct sigevent *>I<sevp>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:43
msgid ""
"B<mq_notify>()  allows the calling process to register or unregister for "
"delivery of an asynchronous notification when a new message arrives on the "
"empty message queue referred to by the descriptor I<mqdes>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:51
msgid ""
"The I<sevp> argument is a pointer to a I<sigevent> structure.  For the "
"definition and general details of this structure, see B<sigevent>(7)."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:65
msgid ""
"If I<sevp> is a non-NULL pointer, then B<mq_notify>()  registers the calling "
"process to receive message notification.  The I<sigev_notify> field of the "
"I<sigevent> structure to which I<sevp> points specifies how notification is "
"to be performed.  This field has one of the following values:"
msgstr ""

#. type: TP
#: build/C/man3/mq_notify.3:65
#, no-wrap
msgid "B<SIGEV_NONE>"
msgstr ""

#.  When is SIGEV_NONE useful?
#. type: Plain text
#: build/C/man3/mq_notify.3:70
msgid ""
"A \"null\" notification: the calling process is registered as the target for "
"notification, but when a message arrives, no notification is sent."
msgstr ""

#. type: TP
#: build/C/man3/mq_notify.3:70
#, no-wrap
msgid "B<SIGEV_SIGNAL>"
msgstr ""

#.  I don't know of other implementations that set
#.  si_pid and si_uid -- MTK
#. type: Plain text
#: build/C/man3/mq_notify.3:90
msgid ""
"Notify the process by sending the signal specified in I<sigev_signo>.  See "
"B<sigevent>(7)  for general details.  The I<si_code> field of the "
"I<siginfo_t> structure will be set to B<SI_MESGQ>.  In addition, I<si_pid> "
"will be set to the PID of the process that sent the message, and I<si_uid> "
"will be set to the real user ID of the sending process."
msgstr ""

#. type: TP
#: build/C/man3/mq_notify.3:90
#, no-wrap
msgid "B<SIGEV_THREAD>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:98
msgid ""
"Upon message delivery, invoke I<sigev_notify_function> as if it were the "
"start function of a new thread.  See B<sigevent>(7)  for details."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:101
msgid ""
"Only one process can be registered to receive notification from a message "
"queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:108
msgid ""
"If I<sevp> is NULL, and the calling process is currently registered to "
"receive notifications for this message queue, then the registration is "
"removed; another process can then register to receive a message notification "
"for this queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:115
msgid ""
"Message notification only occurs when a new message arrives and the queue "
"was previously empty.  If the queue was not empty at the time B<mq_notify>()  "
"was called, then a notification will only occur after the queue is emptied "
"and a new message arrives."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:123
msgid ""
"If another process or thread is waiting to read a message from an empty "
"queue using B<mq_receive>(3), then any message notification registration is "
"ignored: the message is delivered to the process or thread calling "
"B<mq_receive>(3), and the message notification registration remains in "
"effect."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:134
msgid ""
"Notification occurs once: after a notification is delivered, the "
"notification registration is removed, and another process can register for "
"message notification.  If the notified process wishes to receive the next "
"notification, it can use B<mq_notify>()  to request a further notification.  "
"This should be done before emptying all unread messages from the queue.  "
"(Placing the queue in nonblocking mode is useful for emptying the queue of "
"messages without blocking once it is empty.)"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:140
msgid ""
"On success B<mq_notify>()  returns 0; on error, -1 is returned, with "
"I<errno> set to indicate the error."
msgstr ""

#. type: TP
#: build/C/man3/mq_notify.3:146
#, no-wrap
msgid "B<EBUSY>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:150
msgid ""
"Another process has already registered to receive notification for this "
"message queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:160
msgid ""
"I<sevp-E<gt>sigev_notify> is not one of the permitted values; or "
"I<sevp-E<gt>sigev_notify> is B<SIGEV_SIGNAL> and I<sevp-E<gt>sigev_signo> is "
"not a valid signal number."
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<ENOMEM>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:163 build/C/man3/mq_open.3:217
msgid "Insufficient memory."
msgstr ""

#.  Linux does not do this
#. type: Plain text
#: build/C/man3/mq_notify.3:174
msgid ""
"POSIX.1-2008 says that an implementation I<may> generate an B<EINVAL> error "
"if I<sevp> is NULL, and the caller is not currently registered to receive "
"notifications for the queue I<mqdes>."
msgstr ""

#. type: SH
#: build/C/man3/mq_notify.3:176 build/C/man7/mq_overview.7:278
#, no-wrap
msgid "EXAMPLE"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:182
msgid ""
"The following program registers a notification request for the message queue "
"named in its command-line argument.  Notification is performed by creating a "
"thread.  The thread executes a function which reads one message from the "
"queue and then terminates the process."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:189
#, no-wrap
msgid ""
"#include E<lt>pthread.hE<gt>\n"
"#include E<lt>mqueue.hE<gt>\n"
"#include E<lt>stdio.hE<gt>\n"
"#include E<lt>stdlib.hE<gt>\n"
"#include E<lt>unistd.hE<gt>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:192
#, no-wrap
msgid ""
"#define handle_error(msg) \\e\n"
"    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:200
#, no-wrap
msgid ""
"static void                     /* Thread start function */\n"
"tfunc(union sigval sv)\n"
"{\n"
"    struct mq_attr attr;\n"
"    ssize_t nr;\n"
"    void *buf;\n"
"    mqd_t mqdes = *((mqd_t *) sv.sival_ptr);\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:202
#, no-wrap
msgid "    /* Determine max. msg size; allocate buffer to receive msg */\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:208
#, no-wrap
msgid ""
"    if (mq_getattr(mqdes, &attr) == -1)\n"
"        handle_error(\"mq_getattr\");\n"
"    buf = malloc(attr.mq_msgsize);\n"
"    if (buf == NULL)\n"
"        handle_error(\"malloc\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:212
#, no-wrap
msgid ""
"    nr = mq_receive(mqdes, buf, attr.mq_msgsize, NULL);\n"
"    if (nr == -1)\n"
"        handle_error(\"mq_receive\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:217
#, no-wrap
msgid ""
"    printf(\"Read %ld bytes from MQ\\en\", (long) nr);\n"
"    free(buf);\n"
"    exit(EXIT_SUCCESS);         /* Terminate the process */\n"
"}\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:223
#, no-wrap
msgid ""
"int\n"
"main(int argc, char *argv[])\n"
"{\n"
"    mqd_t mqdes;\n"
"    struct sigevent sev;\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:228
#, no-wrap
msgid ""
"    if (argc != 2) {\n"
"\tfprintf(stderr, \"Usage: %s E<lt>mq-nameE<gt>\\en\", argv[0]);\n"
"\texit(EXIT_FAILURE);\n"
"    }\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:232
#, no-wrap
msgid ""
"    mqdes = mq_open(argv[1], O_RDONLY);\n"
"    if (mqdes == (mqd_t) -1)\n"
"        handle_error(\"mq_open\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:239
#, no-wrap
msgid ""
"    sev.sigev_notify = SIGEV_THREAD;\n"
"    sev.sigev_notify_function = tfunc;\n"
"    sev.sigev_notify_attributes = NULL;\n"
"    sev.sigev_value.sival_ptr = &mqdes;   /* Arg. to thread func. */\n"
"    if (mq_notify(mqdes, &sev) == -1)\n"
"        handle_error(\"mq_notify\");\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:242
#, no-wrap
msgid ""
"    pause();    /* Process will be terminated by thread function */\n"
"}\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_notify.3:252
msgid ""
"B<mq_close>(3), B<mq_getattr>(3), B<mq_open>(3), B<mq_receive>(3), "
"B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<sigevent>(7)"
msgstr ""

#. type: TH
#: build/C/man3/mq_open.3:26
#, no-wrap
msgid "MQ_OPEN"
msgstr ""

#. type: TH
#: build/C/man3/mq_open.3:26
#, no-wrap
msgid "2009-02-20"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:29
msgid "mq_open - open a message queue"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:34
#, no-wrap
msgid ""
"B<#include E<lt>fcntl.hE<gt>>           /* For O_* constants */\n"
"B<#include E<lt>sys/stat.hE<gt>>        /* For mode constants */\n"
"B<#include E<lt>mqueue.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:38
#, no-wrap
msgid ""
"B<mqd_t mq_open(const char *>I<name>B<, int >I<oflag>B<);>\n"
"B<mqd_t mq_open(const char *>I<name>B<, int >I<oflag>B<, mode_t "
">I<mode>B<,>\n"
"B<              struct mq_attr *>I<attr>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:50
msgid ""
"B<mq_open>()  creates a new POSIX message queue or opens an existing queue.  "
"The queue is identified by I<name>.  For details of the construction of "
"I<name>, see B<mq_overview>(7)."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:58
msgid ""
"The I<oflag> argument specifies flags that control the operation of the "
"call.  (Definitions of the flags values can be obtained by including "
"I<E<lt>fcntl.hE<gt>>.)  Exactly one of the following must be specified in "
"I<oflag>:"
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:58
#, no-wrap
msgid "B<O_RDONLY>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:61
msgid "Open the queue to receive messages only."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:61
#, no-wrap
msgid "B<O_WRONLY>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:64
msgid "Open the queue to send messages only."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:64
#, no-wrap
msgid "B<O_RDWR>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:67
msgid "Open the queue to both send and receive messages."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:72
msgid "Zero or more of the following flags can additionally be I<OR>ed in I<oflag>:"
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:72
#, no-wrap
msgid "B<O_NONBLOCK>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:81
msgid ""
"Open the queue in nonblocking mode.  In circumstances where B<mq_receive>(3)  "
"and B<mq_send>(3)  would normally block, these functions instead fail with "
"the error B<EAGAIN>."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:81
#, no-wrap
msgid "B<O_CREAT>"
msgstr ""

#.  In reality the file system IDs are used on Linux.
#. type: Plain text
#: build/C/man3/mq_open.3:89
msgid ""
"Create the message queue if it does not exist.  The owner (user ID) of the "
"message queue is set to the effective user ID of the calling process.  The "
"group ownership (group ID) is set to the effective group ID of the calling "
"process."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:89
#, no-wrap
msgid "B<O_EXCL>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:99
msgid ""
"If B<O_CREAT> was specified in I<oflag>, and a queue with the given I<name> "
"already exists, then fail with the error B<EEXIST>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:123
msgid ""
"If B<O_CREAT> is specified in I<oflag>, then two additional arguments must "
"be supplied.  The I<mode> argument specifies the permissions to be placed on "
"the new queue, as for B<open>(2).  (Symbolic definitions for the permissions "
"bits can be obtained by including I<E<lt>sys/stat.hE<gt>>.)  The permissions "
"settings are masked against the process umask.  The I<attr> argument "
"specifies attributes for the queue.  See B<mq_getattr>(3)  for details.  If "
"I<attr> is NULL, then the queue is created with implementation-defined "
"default attributes."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:135
msgid ""
"On success, B<mq_open>()  returns a message queue descriptor for use by "
"other message queue functions.  On error, B<mq_open>()  returns I<(mqd_t)\\ "
"-1>, with I<errno> set to indicate the error."
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<EACCES>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:140
msgid ""
"The queue exists, but the caller does not have permission to open it in the "
"specified mode."
msgstr ""

#.  Note that this isn't consistent with the same case for sem_open()
#. type: Plain text
#: build/C/man3/mq_open.3:145
msgid "I<name> contained more than one slash."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:145 build/C/man2/msgget.2:153
#, no-wrap
msgid "B<EEXIST>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:156
msgid ""
"Both B<O_CREAT> and B<O_EXCL> were specified in I<oflag>, but a queue with "
"this I<name> already exists."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:188
msgid ""
"B<O_CREAT> was specified in I<oflag>, and I<attr> was not NULL, but "
"I<attr-E<gt>mq_maxmsg> or I<attr-E<gt>mq_msqsize> was invalid.  Both of "
"these fields must be greater than zero.  In a process that is unprivileged "
"(does not have the B<CAP_SYS_RESOURCE> capability), I<attr-E<gt>mq_maxmsg> "
"must be less than or equal to the I<msg_max> limit, and "
"I<attr-E<gt>mq_msgsize> must be less than or equal to the I<msgsize_max> "
"limit.  In addition, even in a privileged process, I<attr-E<gt>mq_maxmsg> "
"cannot exceed the B<HARD_MAX> limit.  (See B<mq_overview>(7)  for details of "
"these limits.)"
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:188
#, no-wrap
msgid "B<EMFILE>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:192
msgid "The process already has the maximum number of files and message queues open."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:192 build/C/man3/mq_unlink.3:54
#, no-wrap
msgid "B<ENAMETOOLONG>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:196 build/C/man3/mq_unlink.3:58
msgid "I<name> was too long."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:196
#, no-wrap
msgid "B<ENFILE>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:200
msgid ""
"The system limit on the total number of open files and message queues has "
"been reached."
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<ENOENT>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:209
msgid ""
"The B<O_CREAT> flag was not specified in I<oflag>, and no queue with this "
"I<name> exists."
msgstr ""

#.  Note that this isn't consistent with the same case for sem_open()
#. type: Plain text
#: build/C/man3/mq_open.3:214
msgid "I<name> was just \"/\" followed by no other characters."
msgstr ""

#. type: TP
#: build/C/man3/mq_open.3:217 build/C/man2/msgget.2:175
#, no-wrap
msgid "B<ENOSPC>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:224
msgid ""
"Insufficient space for the creation of a new message queue.  This probably "
"occurred because the I<queues_max> limit was encountered; see "
"B<mq_overview>(7)."
msgstr ""

#. type: SH
#: build/C/man3/mq_open.3:226 build/C/man2/msgget.2:209
#, no-wrap
msgid "BUGS"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:230
msgid ""
"In kernels before 2.6.14, the process umask was not applied to the "
"permissions specified in I<mode>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_open.3:238
msgid ""
"B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_receive>(3), "
"B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7)"
msgstr ""

#. type: TH
#: build/C/man7/mq_overview.7:26
#, no-wrap
msgid "MQ_OVERVIEW"
msgstr ""

#. type: TH
#: build/C/man7/mq_overview.7:26
#, no-wrap
msgid "2009-09-27"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:29
msgid "mq_overview - Overview of POSIX message queues"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:37
msgid ""
"POSIX message queues allow processes to exchange data in the form of "
"messages.  This API is distinct from that provided by System V message "
"queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.), but provides "
"similar functionality."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:52
msgid ""
"Message queues are created and opened using B<mq_open>(3); this function "
"returns a I<message queue descriptor> (I<mqd_t>), which is used to refer to "
"the open message queue in later calls.  Each message queue is identified by "
"a name of the form I</somename>; that is, a null-terminated string of up to "
"B<NAME_MAX> (i.e., 255) characters consisting of an initial slash, followed "
"by one or more characters, none of which are slashes.  Two processes can "
"operate on the same queue by passing the same name to B<mq_open>(3)."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:68
msgid ""
"Messages are transferred to and from a queue using B<mq_send>(3)  and "
"B<mq_receive>(3).  When a process has finished using the queue, it closes it "
"using B<mq_close>(3), and when the queue is no longer required, it can be "
"deleted using B<mq_unlink>(3).  Queue attributes can be retrieved and (in "
"some cases) modified using B<mq_getattr>(3)  and B<mq_setattr>(3).  A "
"process can request asynchronous notification of the arrival of a message on "
"a previously empty queue using B<mq_notify>(3)."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:81
msgid ""
"A message queue descriptor is a reference to an I<open message queue "
"description> (cf.  B<open>(2)).  After a B<fork>(2), a child inherits copies "
"of its parent's message queue descriptors, and these descriptors refer to "
"the same open message queue descriptions as the corresponding descriptors in "
"the parent.  Corresponding descriptors in the two processes share the flags "
"(I<mq_flags>)  that are associated with the open message queue description."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:94
msgid ""
"Each message has an associated I<priority>, and messages are always "
"delivered to the receiving process highest priority first.  Message "
"priorities range from 0 (low) to I<sysconf(_SC_MQ_PRIO_MAX)\\ -\\ 1> "
"(high).  On Linux, I<sysconf(_SC_MQ_PRIO_MAX)> returns 32768, but "
"POSIX.1-2001 only requires an implementation to support priorities in the "
"range 0 to 31; some implementations only provide this range."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:97
msgid ""
"The remainder of this section describes some specific details of the Linux "
"implementation of POSIX message queues."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:97
#, no-wrap
msgid "Library interfaces and system calls"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:103
msgid ""
"In most cases the B<mq_*()> library interfaces listed above are implemented "
"on top of underlying system calls of the same name.  Deviations from this "
"scheme are indicated in the following table:"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:107
#, no-wrap
msgid "Library interface\tSystem call\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:108
#, no-wrap
msgid "mq_close(3)\tclose(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:109
#, no-wrap
msgid "mq_getattr(3)\tmq_getsetattr(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:110
#, no-wrap
msgid "mq_notify(3)\tmq_notify(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:111
#, no-wrap
msgid "mq_open(3)\tmq_open(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:112
#, no-wrap
msgid "mq_receive(3)\tmq_timedreceive(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:113
#, no-wrap
msgid "mq_send(3)\tmq_timedsend(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:114
#, no-wrap
msgid "mq_setattr(3)\tmq_getsetattr(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:115
#, no-wrap
msgid "mq_timedreceive(3)\tmq_timedreceive(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:116
#, no-wrap
msgid "mq_timedsend(3)\tmq_timedsend(2)\n"
msgstr ""

#. type: tbl table
#: build/C/man7/mq_overview.7:117
#, no-wrap
msgid "mq_unlink(3)\tmq_unlink(2)\n"
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:120
#, no-wrap
msgid "Versions"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:123
msgid ""
"POSIX message queues have been supported on Linux since kernel 2.6.6.  Glibc "
"support has been provided since version 2.3.4."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:123
#, no-wrap
msgid "Kernel configuration"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:128
msgid ""
"Support for POSIX message queues is configurable via the "
"B<CONFIG_POSIX_MQUEUE> kernel configuration option.  This option is enabled "
"by default."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:128
#, no-wrap
msgid "Persistence"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:133
msgid ""
"POSIX message queues have kernel persistence: if not removed by "
"B<mq_unlink>(3), a message queue will exist until the system is shut down."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:133
#, no-wrap
msgid "Linking"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:138
msgid ""
"Programs using the POSIX message queue API must be compiled with I<cc -lrt> "
"to link against the real-time library, I<librt>."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:138
#, no-wrap
msgid "/proc interfaces"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:141
msgid ""
"The following interfaces can be used to limit the amount of kernel memory "
"consumed by POSIX message queues:"
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:141
#, no-wrap
msgid "I</proc/sys/fs/mqueue/msg_max>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:162
msgid ""
"This file can be used to view and change the ceiling value for the maximum "
"number of messages in a queue.  This value acts as a ceiling on the "
"I<attr-E<gt>mq_maxmsg> argument given to B<mq_open>(3).  The default value "
"for I<msg_max> is 10.  The minimum value is 1 (10 in kernels before "
"2.6.28).  The upper limit is B<HARD_MAX>: I<(131072\\ /\\ sizeof(void\\ *))> "
"(32768 on Linux/86).  This limit is ignored for privileged processes "
"(B<CAP_SYS_RESOURCE>), but the B<HARD_MAX> ceiling is nevertheless imposed."
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:162
#, no-wrap
msgid "I</proc/sys/fs/mqueue/msgsize_max>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:181
msgid ""
"This file can be used to view and change the ceiling on the maximum message "
"size.  This value acts as a ceiling on the I<attr-E<gt>mq_msgsize> argument "
"given to B<mq_open>(3).  The default value for I<msgsize_max> is 8192 "
"bytes.  The minimum value is 128 (8192 in kernels before 2.6.28).  The upper "
"limit for I<msgsize_max> is 1,048,576 (in kernels before 2.6.28, the upper "
"limit was B<INT_MAX>; that is, 2,147,483,647 on Linux/86).  This limit is "
"ignored for privileged processes (B<CAP_SYS_RESOURCE>)."
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:181
#, no-wrap
msgid "I</proc/sys/fs/mqueue/queues_max>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:191
msgid ""
"This file can be used to view and change the system-wide limit on the number "
"of message queues that can be created.  Only privileged processes "
"(B<CAP_SYS_RESOURCE>)  can create new message queues once this limit has "
"been reached.  The default value for I<queues_max> is 256; it can be changed "
"to any value in the range 0 to INT_MAX."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:191
#, no-wrap
msgid "Resource limit"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:198
msgid ""
"The B<RLIMIT_MSGQUEUE> resource limit, which places a limit on the amount of "
"space that can be consumed by all of the message queues belonging to a "
"process's real user ID, is described in B<getrlimit>(2)."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:198
#, no-wrap
msgid "Mounting the message queue file system"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:204
msgid ""
"On Linux, message queues are created in a virtual file system.  (Other "
"implementations may also provide such a feature, but the details are likely "
"to differ.)  This file system can be mounted (by the superuser) using the "
"following commands:"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:209
#, no-wrap
msgid ""
"#B< mkdir /dev/mqueue>\n"
"#B< mount -t mqueue none /dev/mqueue>\n"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:213
msgid "The sticky bit is automatically enabled on the mount directory."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:220
msgid ""
"After the file system has been mounted, the message queues on the system can "
"be viewed and manipulated using the commands usually used for files (e.g., "
"B<ls>(1)  and B<rm>(1))."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:223
msgid ""
"The contents of each file in the directory consist of a single line "
"containing information about the queue:"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:228
#, no-wrap
msgid ""
"$B< cat /dev/mqueue/mymq>\n"
"QSIZE:129     NOTIFY:2    SIGNO:0    NOTIFY_PID:8260\n"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:232
msgid "These fields are as follows:"
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:232
#, no-wrap
msgid "B<QSIZE>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:235
msgid "Number of bytes of data in all messages in the queue."
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:235
#, no-wrap
msgid "B<NOTIFY_PID>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:241
msgid ""
"If this is nonzero, then the process with this PID has used B<mq_notify>(3)  "
"to register for asynchronous message notification, and the remaining fields "
"describe how notification occurs."
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:241
#, no-wrap
msgid "B<NOTIFY>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:251
msgid ""
"Notification method: 0 is B<SIGEV_SIGNAL>; 1 is B<SIGEV_NONE>; and 2 is "
"B<SIGEV_THREAD>."
msgstr ""

#. type: TP
#: build/C/man7/mq_overview.7:251
#, no-wrap
msgid "B<SIGNO>"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:255
msgid "Signal number to be used for B<SIGEV_SIGNAL>."
msgstr ""

#. type: SS
#: build/C/man7/mq_overview.7:255
#, no-wrap
msgid "Polling message queue descriptors"
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:263
msgid ""
"On Linux, a message queue descriptor is actually a file descriptor, and can "
"be monitored using B<select>(2), B<poll>(2), or B<epoll>(7).  This is not "
"portable."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:275
msgid ""
"System V message queues (B<msgget>(2), B<msgsnd>(2), B<msgrcv>(2), etc.) are "
"an older API for exchanging messages between processes.  POSIX message "
"queues provide a better designed interface than System V message queues; on "
"the other hand POSIX message queues are less widely available (especially on "
"older systems) than System V message queues."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:278
msgid ""
"Linux does not currently (2.6.26) support the use of access control lists "
"(ACLs) for POSIX message queues."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:281
msgid ""
"An example of the use of various message queue functions is shown in "
"B<mq_notify>(3)."
msgstr ""

#. type: Plain text
#: build/C/man7/mq_overview.7:294
msgid ""
"B<getrlimit>(2), B<mq_getsetattr>(2), B<poll>(2), B<select>(2), "
"B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
"B<mq_receive>(3), B<mq_send>(3), B<mq_unlink>(3), B<epoll>(7)"
msgstr ""

#. type: TH
#: build/C/man3/mq_receive.3:26
#, no-wrap
msgid "MQ_RECEIVE"
msgstr ""

#. type: TH
#: build/C/man3/mq_receive.3:26 build/C/man3/mq_send.3:26
#, no-wrap
msgid "2010-09-20"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:29
msgid "mq_receive, mq_timedreceive - receive a message from a message queue"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:35
#, no-wrap
msgid ""
"B<ssize_t mq_receive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
"B<                   size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:38 build/C/man3/mq_send.3:38
#, no-wrap
msgid ""
"B<#include E<lt>time.hE<gt>>\n"
"B<#include E<lt>mqueue.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:42
#, no-wrap
msgid ""
"B<ssize_t mq_timedreceive(mqd_t >I<mqdes>B<, char *>I<msg_ptr>B<,>\n"
"B<                   size_t >I<msg_len>B<, unsigned *>I<msg_prio>B<,>\n"
"B<                   const struct timespec *>I<abs_timeout>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:50 build/C/man3/mq_send.3:50
msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:53
msgid "B<mq_timedreceive>():"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:55 build/C/man3/mq_send.3:55
msgid "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:76
msgid ""
"B<mq_receive>()  removes the oldest message with the highest priority from "
"the message queue referred to by the descriptor I<mqdes>, and places it in "
"the buffer pointed to by I<msg_ptr>.  The I<msg_len> argument specifies the "
"size of the buffer pointed to by I<msg_ptr>; this must be greater than the "
"I<mq_msgsize> attribute of the queue (see B<mq_getattr>(3)).  If I<prio> is "
"not NULL, then the buffer to which it points is used to return the priority "
"associated with the received message."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:86
msgid ""
"If the queue is empty, then, by default, B<mq_receive>()  blocks until a "
"message becomes available, or the call is interrupted by a signal handler.  "
"If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
"the call instead fails immediately with the error B<EAGAIN>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:99
msgid ""
"B<mq_timedreceive>()  behaves just like B<mq_receive>(), except that if the "
"queue is empty and the B<O_NONBLOCK> flag is not enabled for the message "
"queue description, then I<abs_timeout> points to a structure which specifies "
"a ceiling on the time for which the call will block.  This ceiling is an "
"absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
"00:00:00 +0000 (UTC), and it is specified in the following structure:"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:106 build/C/man3/mq_send.3:112
#, no-wrap
msgid ""
"struct timespec {\n"
"    time_t tv_sec;        /* seconds */\n"
"    long   tv_nsec;       /* nanoseconds */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:113
msgid ""
"If no message is available, and the timeout has already expired by the time "
"of the call, B<mq_timedreceive>()  returns immediately."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:122
msgid ""
"On success, B<mq_receive>()  and B<mq_timedreceive>()  return the number of "
"bytes in the received message; on error, -1 is returned, with I<errno> set "
"to indicate the error."
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<EAGAIN>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:129
msgid ""
"The queue was empty, and the B<O_NONBLOCK> flag was set for the message "
"queue description referred to by I<mqdes>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139
msgid "The descriptor specified in I<mqdes> was invalid."
msgstr ""

#. type: TP
#: 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
#, no-wrap
msgid "B<EINTR>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:138 build/C/man3/mq_send.3:143
msgid "The call was interrupted by a signal handler; see B<signal>(7)."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
msgid ""
"The call would have blocked, and I<abs_timeout> was invalid, either because "
"I<tv_sec> was less than zero, or because I<tv_nsec> was less than zero or "
"greater than 1000 million."
msgstr ""

#. type: TP
#: build/C/man3/mq_receive.3:147 build/C/man3/mq_send.3:152
#, no-wrap
msgid "B<EMSGSIZE>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:153
msgid "I<msg_len> was less than the I<mq_msgsize> attribute of the message queue."
msgstr ""

#. type: TP
#: build/C/man3/mq_receive.3:153 build/C/man3/mq_send.3:158
#, no-wrap
msgid "B<ETIMEDOUT>"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161
msgid "The call timed out before a message could be transferred."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:164
msgid ""
"On Linux, B<mq_timedreceive>()  is a system call, and B<mq_receive>()  is a "
"library function layered on top of that system call."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_receive.3:173
msgid ""
"B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
"B<mq_send>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
msgstr ""

#. type: TH
#: build/C/man3/mq_send.3:26
#, no-wrap
msgid "MQ_SEND"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:29
msgid "mq_send, mq_timedsend - send a message to a message queue"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:35
#, no-wrap
msgid ""
"B<int mq_send(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
"B<              size_t >I<msg_len>B<, unsigned >I<msg_prio>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:42
#, no-wrap
msgid ""
"B<int mq_timedsend(mqd_t >I<mqdes>B<, const char *>I<msg_ptr>B<,>\n"
"B<              size_t >I<msg_len>B<, unsigned >I<msg_prio>B<,>\n"
"B<              const struct timespec *>I<abs_timeout>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:53
msgid "B<mq_timedsend>():"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:71
msgid ""
"B<mq_send>()  adds the message pointed to by I<msg_ptr> to the message queue "
"referred to by the descriptor I<mqdes>.  The I<msg_len> argument specifies "
"the length of the message pointed to by I<msg_ptr>; this length must be less "
"than or equal to the queue's I<mq_msgsize> attribute.  Zero-length messages "
"are allowed."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:79
msgid ""
"The I<msg_prio> argument is a nonnegative integer that specifies the "
"priority of this message.  Messages are placed on the queue in decreasing "
"order of priority, with newer messages of the same priority being placed "
"after older messages with the same priority."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:92
msgid ""
"If the message queue is already full (i.e., the number of messages on the "
"queue equals the queue's I<mq_maxmsg> attribute), then, by default, "
"B<mq_send>()  blocks until sufficient space becomes available to allow the "
"message to be queued, or until the call is interrupted by a signal handler.  "
"If the B<O_NONBLOCK> flag is enabled for the message queue description, then "
"the call instead fails immediately with the error B<EAGAIN>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:105
msgid ""
"B<mq_timedsend>()  behaves just like B<mq_send>(), except that if the queue "
"is full and the B<O_NONBLOCK> flag is not enabled for the message queue "
"description, then I<abs_timeout> points to a structure which specifies a "
"ceiling on the time for which the call will block.  This ceiling is an "
"absolute timeout in seconds and nanoseconds since the Epoch, 1970-01-01 "
"00:00:00 +0000 (UTC), and it is specified in the following structure:"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:119
msgid ""
"If the message queue is full, and the timeout has already expired by the "
"time of the call, B<mq_timedsend>()  returns immediately."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:127
msgid ""
"On success, B<mq_send>()  and B<mq_timedsend>()  return zero; on error, -1 "
"is returned, with I<errno> set to indicate the error."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:134
msgid ""
"The queue was full, and the B<O_NONBLOCK> flag was set for the message queue "
"description referred to by I<mqdes>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:158
msgid ""
"I<msg_len> was greater than the I<mq_msgsize> attribute of the message "
"queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:169
msgid ""
"On Linux, B<mq_timedsend>()  is a system call, and B<mq_send>()  is a "
"library function layered on top of that system call."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_send.3:178
msgid ""
"B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
"B<mq_receive>(3), B<mq_unlink>(3), B<mq_overview>(7), B<time>(7)"
msgstr ""

#. type: TH
#: build/C/man3/mq_unlink.3:26
#, no-wrap
msgid "MQ_UNLINK"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:29
msgid "mq_unlink - remove a message queue"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:34
#, no-wrap
msgid "B<int mq_unlink(const char *>I<name>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:44
msgid ""
"B<mq_unlink>()  removes the specified message queue I<name>.  The message "
"queue name is removed immediately.  The queue itself is destroyed once any "
"other processes that have the queue open close their descriptors referring "
"to the queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:50
msgid ""
"On success B<mq_unlink>()  returns 0; on error, -1 is returned, with "
"I<errno> set to indicate the error."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:54
msgid "The caller does not have permission to unlink this message queue."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:62
msgid "There is no message queue with the given I<name>."
msgstr ""

#. type: Plain text
#: build/C/man3/mq_unlink.3:72
msgid ""
"B<mq_close>(3), B<mq_getattr>(3), B<mq_notify>(3), B<mq_open>(3), "
"B<mq_receive>(3), B<mq_send>(3), B<mq_overview>(7)"
msgstr ""

#. type: TH
#: build/C/man2/msgctl.2:35
#, no-wrap
msgid "MSGCTL"
msgstr ""

#. type: TH
#: build/C/man2/msgctl.2:35
#, no-wrap
msgid "2008-08-06"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:38
msgid "msgctl - message control operations"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:43 build/C/man2/msgget.2:41 build/C/man2/msgop.2:46
#, no-wrap
msgid ""
"B<#include E<lt>sys/types.hE<gt>>\n"
"B<#include E<lt>sys/ipc.hE<gt>>\n"
"B<#include E<lt>sys/msg.hE<gt>>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:45
#, no-wrap
msgid "B<int msgctl(int >I<msqid>B<, int >I<cmd>B<, struct msqid_ds *>I<buf>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:52
msgid ""
"B<msgctl>()  performs the control operation specified by I<cmd> on the "
"message queue with identifier I<msqid>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:56
msgid ""
"The I<msqid_ds> data structure is defined in I<E<lt>sys/msg.hE<gt>> as "
"follows:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:73
#, no-wrap
msgid ""
"struct msqid_ds {\n"
"    struct ipc_perm msg_perm;     /* Ownership and permissions */\n"
"    time_t          msg_stime;    /* Time of last msgsnd(2) */\n"
"    time_t          msg_rtime;    /* Time of last msgrcv(2) */\n"
"    time_t          msg_ctime;    /* Time of last change */\n"
"    unsigned long   __msg_cbytes; /* Current number of bytes in\n"
"                                     queue (nonstandard) */\n"
"    msgqnum_t       msg_qnum;     /* Current number of messages\n"
"                                     in queue */\n"
"    msglen_t        msg_qbytes;   /* Maximum number of bytes\n"
"                                     allowed in queue */\n"
"    pid_t           msg_lspid;    /* PID of last msgsnd(2) */\n"
"    pid_t           msg_lrpid;    /* PID of last msgrcv(2) */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:81
msgid ""
"The I<ipc_perm> structure is defined in I<E<lt>sys/ipc.hE<gt>> as follows "
"(the highlighted fields are settable using B<IPC_SET>):"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:93
#, no-wrap
msgid ""
"struct ipc_perm {\n"
"    key_t          __key;       /* Key supplied to msgget(2) */\n"
"    uid_t          B<uid>;         /* Effective UID of owner */\n"
"    gid_t          B<gid>;         /* Effective GID of owner */\n"
"    uid_t          cuid;        /* Effective UID of creator */\n"
"    gid_t          cgid;        /* Effective GID of creator */\n"
"    unsigned short B<mode>;        /* Permissions */\n"
"    unsigned short __seq;       /* Sequence number */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:99
msgid "Valid values for I<cmd> are:"
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:99
#, no-wrap
msgid "B<IPC_STAT>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:108
msgid ""
"Copy information from the kernel data structure associated with I<msqid> "
"into the I<msqid_ds> structure pointed to by I<buf>.  The caller must have "
"read permission on the message queue."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:108
#, no-wrap
msgid "B<IPC_SET>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:135
msgid ""
"Write the values of some members of the I<msqid_ds> structure pointed to by "
"I<buf> to the kernel data structure associated with this message queue, "
"updating also its I<msg_ctime> member.  The following members of the "
"structure are updated: I<msg_qbytes>, I<msg_perm.uid>, I<msg_perm.gid>, and "
"(the least significant 9 bits of)  I<msg_perm.mode>.  The effective UID of "
"the calling process must match the owner (I<msg_perm.uid>)  or creator "
"(I<msg_perm.cuid>)  of the message queue, or the caller must be privileged.  "
"Appropriate privilege (Linux: the B<CAP_IPC_RESOURCE> capability) is "
"required to raise the I<msg_qbytes> value beyond the system parameter "
"B<MSGMNB>."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:135
#, no-wrap
msgid "B<IPC_RMID>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:146
msgid ""
"Immediately remove the message queue, awakening all waiting reader and "
"writer processes (with an error return and I<errno> set to B<EIDRM>).  The "
"calling process must have appropriate privileges or its effective user ID "
"must be either that of the creator or owner of the message queue."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:146
#, no-wrap
msgid "B<IPC_INFO> (Linux-specific)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:159
msgid ""
"Returns information about system-wide message queue limits and parameters in "
"the structure pointed to by I<buf>.  This structure is of type I<msginfo> "
"(thus, a cast is required), defined in I<E<lt>sys/msg.hE<gt>> if the "
"B<_GNU_SOURCE> feature test macro is defined:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:183
#, no-wrap
msgid ""
"struct msginfo {\n"
"    int msgpool; /* Size in kibibytes of buffer pool\n"
"                    used to hold message data;\n"
"                    unused within kernel */\n"
"    int msgmap;  /* Maximum number of entries in message\n"
"                    map; unused within kernel */\n"
"    int msgmax;  /* Maximum number of bytes that can be\n"
"                    written in a single message */\n"
"    int msgmnb;  /* Maximum number of bytes that can be\n"
"                    written to queue; used to initialize\n"
"                    msg_qbytes during queue creation\n"
"                    (msgget(2)) */\n"
"    int msgmni;  /* Maximum number of message queues */\n"
"    int msgssz;  /* Message segment size;\n"
"                    unused within kernel */\n"
"    int msgtql;  /* Maximum number of messages on all queues\n"
"                    in system; unused within kernel */\n"
"    unsigned short int msgseg;\n"
"                 /* Maximum number of segments;\n"
"                    unused within kernel */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:196
msgid ""
"The I<msgmni>, I<msgmax>, and I<msgmnb> settings can be changed via I</proc> "
"files of the same name; see B<proc>(5)  for details."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:196
#, no-wrap
msgid "B<MSG_INFO> (Linux-specific)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:213
msgid ""
"Returns a I<msginfo> structure containing the same information as for "
"B<IPC_INFO>, except that the following fields are returned with information "
"about system resources consumed by message queues: the I<msgpool> field "
"returns the number of message queues that currently exist on the system; the "
"I<msgmap> field returns the total number of messages in all queues on the "
"system; and the I<msgtql> field returns the total number of bytes in all "
"messages in all queues on the system."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:213
#, no-wrap
msgid "B<MSG_STAT> (Linux-specific)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:224
msgid ""
"Returns a I<msqid_ds> structure as for B<IPC_STAT>.  However, the I<msqid> "
"argument is not a queue identifier, but instead an index into the kernel's "
"internal array that maintains information about all message queues on the "
"system."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:245
msgid ""
"On success, B<IPC_STAT>, B<IPC_SET>, and B<IPC_RMID> return 0.  A successful "
"B<IPC_INFO> or B<MSG_INFO> operation returns the index of the highest used "
"entry in the kernel's internal array recording information about all message "
"queues.  (This information can be used with repeated B<MSG_STAT> operations "
"to obtain information about all queues on the system.)  A successful "
"B<MSG_STAT> operation returns the identifier of the queue whose index was "
"given in I<msqid>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:249
msgid "On error, -1 is returned with I<errno> indicating the error."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:253
msgid "On failure, I<errno> is set to one of the following:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:266
msgid ""
"The argument I<cmd> is equal to B<IPC_STAT> or B<MSG_STAT>, but the calling "
"process does not have read permission on the message queue I<msqid>, and "
"does not have the B<CAP_IPC_OWNER> capability."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:266 build/C/man2/msgop.2:318 build/C/man2/msgop.2:371
#, no-wrap
msgid "B<EFAULT>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:277
msgid ""
"The argument I<cmd> has the value B<IPC_SET> or B<IPC_STAT>, but the address "
"pointed to by I<buf> isn't accessible."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:277 build/C/man2/msgop.2:323 build/C/man2/msgop.2:376
#, no-wrap
msgid "B<EIDRM>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:280 build/C/man2/msgop.2:326
msgid "The message queue was removed."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:291
msgid ""
"Invalid value for I<cmd> or I<msqid>.  Or: for a B<MSG_STAT> operation, the "
"index value specified in I<msqid> referred to an array slot that is "
"currently unused."
msgstr ""

#. type: TP
#: build/C/man2/msgctl.2:291
#, no-wrap
msgid "B<EPERM>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:309
msgid ""
"The argument I<cmd> has the value B<IPC_SET> or B<IPC_RMID>, but the "
"effective user ID of the calling process is not the creator (as found in "
"I<msg_perm.cuid>)  or the owner (as found in I<msg_perm.uid>)  of the "
"message queue, and the process is not privileged (Linux: it does not have "
"the B<CAP_SYS_ADMIN> capability)."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:312 build/C/man2/msgget.2:183 build/C/man2/msgop.2:399
msgid "SVr4, POSIX.1-2001."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:323
msgid ""
"The B<IPC_INFO>, B<MSG_STAT> and B<MSG_INFO> operations are used by the "
"B<ipcs>(1)  program to provide information on allocated resources.  In the "
"future these may modified or moved to a /proc file system interface."
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:337
msgid ""
"Various fields in the I<struct msqid_ds> were typed as I<short> under Linux "
"2.2 and have become I<long> under Linux 2.4.  To take advantage of this, a "
"recompilation under glibc-2.1.91 or later should suffice.  (The kernel "
"distinguishes old and new calls by an B<IPC_64> flag in I<cmd>.)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgctl.2:344
msgid ""
"B<msgget>(2), B<msgrcv>(2), B<msgsnd>(2), B<capabilities>(7), "
"B<mq_overview>(7), B<svipc>(7)"
msgstr ""

#. type: TH
#: build/C/man2/msgget.2:33
#, no-wrap
msgid "MSGGET"
msgstr ""

#. type: TH
#: build/C/man2/msgget.2:33
#, no-wrap
msgid "2004-05-27"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:36
msgid "msgget - get a message queue identifier"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:43
#, no-wrap
msgid "B<int msgget(key_t >I<key>B<, int >I<msgflg>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:65
msgid ""
"The B<msgget>()  system call returns the message queue identifier associated "
"with the value of the I<key> argument.  A new message queue is created if "
"I<key> has the value B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no "
"message queue with the given key I<key> exists, and B<IPC_CREAT> is "
"specified in I<msgflg>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:84
msgid ""
"If I<msgflg> specifies both B<IPC_CREAT> and B<IPC_EXCL> and a message queue "
"already exists for I<key>, then B<msgget>()  fails with I<errno> set to "
"B<EEXIST>.  (This is analogous to the effect of the combination B<O_CREAT | "
"O_EXCL> for B<open>(2).)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:94
msgid ""
"Upon creation, the least significant bits of the argument I<msgflg> define "
"the permissions of the message queue.  These permission bits have the same "
"format and semantics as the permissions specified for the I<mode> argument "
"of B<open>(2).  (The execute permissions are not used.)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:101
msgid ""
"If a new message queue is created, then its associated data structure "
"I<msqid_ds> (see B<msgctl>(2))  is initialized as follows:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:106
msgid ""
"I<msg_perm.cuid> and I<msg_perm.uid> are set to the effective user ID of the "
"calling process."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:111
msgid ""
"I<msg_perm.cgid> and I<msg_perm.gid> are set to the effective group ID of "
"the calling process."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:116
msgid ""
"The least significant 9 bits of I<msg_perm.mode> are set to the least "
"significant 9 bits of I<msgflg>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:124
msgid ""
"I<msg_qnum>, I<msg_lspid>, I<msg_lrpid>, I<msg_stime> and I<msg_rtime> are "
"set to 0."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:127
msgid "I<msg_ctime> is set to the current time."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:131
msgid "I<msg_qbytes> is set to the system limit B<MSGMNB>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:135
msgid ""
"If the message queue already exists the permissions are verified, and a "
"check is made to see if it is marked for destruction."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:141
msgid ""
"If successful, the return value will be the message queue identifier (a "
"nonnegative integer), otherwise -1 with I<errno> indicating the error."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:145
msgid "On failure, I<errno> is set to one of the following values:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:153
msgid ""
"A message queue exists for I<key>, but the calling process does not have "
"permission to access the queue, and does not have the B<CAP_IPC_OWNER> "
"capability."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:163
msgid ""
"A message queue exists for I<key> and I<msgflg> specified both B<IPC_CREAT> "
"and B<IPC_EXCL>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:171
msgid ""
"No message queue exists for I<key> and I<msgflg> did not specify "
"B<IPC_CREAT>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:175
msgid ""
"A message queue has to be created but the system does not have enough memory "
"for the new data structure."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:181
msgid ""
"A message queue has to be created but the system limit for the maximum "
"number of message queues (B<MSGMNI>)  would be exceeded."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:193
msgid ""
"B<IPC_PRIVATE> isn't a flag field but a I<key_t> type.  If this special "
"value is used for I<key>, the system call ignores everything but the least "
"significant 9 bits of I<msgflg> and creates a new message queue (on "
"success)."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:197
msgid ""
"The following is a system limit on message queue resources affecting a "
"B<msgget>()  call:"
msgstr ""

#. type: TP
#: build/C/man2/msgget.2:197
#, no-wrap
msgid "B<MSGMNI>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:203
msgid ""
"System wide maximum number of message queues: policy dependent (on Linux, "
"this limit can be read and modified via I</proc/sys/kernel/msgmni>)."
msgstr ""

#. type: SS
#: build/C/man2/msgget.2:203
#, no-wrap
msgid "Linux Notes"
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:209
msgid ""
"Until version 2.3.20 Linux would return B<EIDRM> for a B<msgget>()  on a "
"message queue scheduled for deletion."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:215
msgid ""
"The name choice B<IPC_PRIVATE> was perhaps unfortunate, B<IPC_NEW> would "
"more clearly show its function."
msgstr ""

#. type: Plain text
#: build/C/man2/msgget.2:223
msgid ""
"B<msgctl>(2), B<msgrcv>(2), B<msgsnd>(2), B<ftok>(3), B<capabilities>(7), "
"B<mq_overview>(7), B<svipc>(7)"
msgstr ""

#. type: TH
#: build/C/man2/msgop.2:38
#, no-wrap
msgid "MSGOP"
msgstr ""

#. type: TH
#: build/C/man2/msgop.2:38
#, no-wrap
msgid "2008-04-23"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:41
msgid "msgrcv, msgsnd - message operations"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:49
#, no-wrap
msgid ""
"B<int msgsnd(int >I<msqid>B<, const void *>I<msgp>B<, size_t >I<msgsz>B<, "
"int >I<msgflg>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:53
#, no-wrap
msgid ""
"B<ssize_t msgrcv(int >I<msqid>B<, void *>I<msgp>B<, size_t >I<msgsz>B<, long "
">I<msgtyp>B<,>\n"
"B<               int >I<msgflg>B<);>\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:63
msgid ""
"The B<msgsnd>()  and B<msgrcv>()  system calls are used, respectively, to "
"send messages to, and receive messages from, a message queue.  The calling "
"process must have write permission on the message queue in order to send a "
"message, and read permission to receive a message."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:68
msgid ""
"The I<msgp> argument is a pointer to caller-defined structure of the "
"following general form:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:75
#, no-wrap
msgid ""
"struct msgbuf {\n"
"    long mtype;       /* message type, must be E<gt> 0 */\n"
"    char mtext[1];    /* message data */\n"
"};\n"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:94
msgid ""
"The I<mtext> field is an array (or other structure) whose size is specified "
"by I<msgsz>, a nonnegative integer value.  Messages of zero length (i.e., no "
"I<mtext> field) are permitted.  The I<mtype> field must have a strictly "
"positive integer value.  This value can be used by the receiving process for "
"message selection (see the description of B<msgrcv>()  below)."
msgstr ""

#. type: SS
#: build/C/man2/msgop.2:94
#, no-wrap
msgid "msgsnd()"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:102
msgid ""
"The B<msgsnd>()  system call appends a copy of the message pointed to by "
"I<msgp> to the message queue whose identifier is specified by I<msqid>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:123
msgid ""
"If sufficient space is available in the queue, B<msgsnd>()  succeeds "
"immediately.  (The queue capacity is defined by the I<msg_qbytes> field in "
"the associated data structure for the message queue.  During queue creation "
"this field is initialized to B<MSGMNB> bytes, but this limit can be modified "
"using B<msgctl>(2).)  If insufficient space is available in the queue, then "
"the default behavior of B<msgsnd>()  is to block until space becomes "
"available.  If B<IPC_NOWAIT> is specified in I<msgflg>, then the call "
"instead fails with the error B<EAGAIN>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:127
msgid "A blocked B<msgsnd>()  call may also fail if:"
msgstr ""

#. type: IP
#: 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
#, no-wrap
msgid "*"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:134
msgid ""
"the queue is removed, in which case the system call fails with I<errno> set "
"to B<EIDRM>; or"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:146
msgid ""
"a signal is caught, in which case the system call fails with I<errno> set to "
"B<EINTR>;B<see> B<signal>(7).  (B<msgsnd>()  is never automatically "
"restarted after being interrupted by a signal handler, regardless of the "
"setting of the B<SA_RESTART> flag when establishing a signal handler.)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:149 build/C/man2/msgop.2:276
msgid ""
"Upon successful completion the message queue data structure is updated as "
"follows:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:152
msgid "I<msg_lspid> is set to the process ID of the calling process."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:155
msgid "I<msg_qnum> is incremented by 1."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:158
msgid "I<msg_stime> is set to the current time."
msgstr ""

#. type: SS
#: build/C/man2/msgop.2:158
#, no-wrap
msgid "msgrcv()"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:166
msgid ""
"The B<msgrcv>()  system call removes a message from the queue specified by "
"I<msqid> and places it in the buffer pointed to by I<msgp>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:192
msgid ""
"The argument I<msgsz> specifies the maximum size in bytes for the member "
"I<mtext> of the structure pointed to by the I<msgp> argument.  If the "
"message text has length greater than I<msgsz>, then the behavior depends on "
"whether B<MSG_NOERROR> is specified in I<msgflg>.  If B<MSG_NOERROR> is "
"specified, then the message text will be truncated (and the truncated part "
"will be lost); if B<MSG_NOERROR> is not specified, then the message isn't "
"removed from the queue and the system call fails returning -1 with I<errno> "
"set to B<E2BIG>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:196
msgid "The argument I<msgtyp> specifies the type of message requested as follows:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:201
msgid "If I<msgtyp> is 0, then the first message in the queue is read."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:215
msgid ""
"If I<msgtyp> is greater than 0, then the first message in the queue of type "
"I<msgtyp> is read, unless B<MSG_EXCEPT> was specified in I<msgflg>, in which "
"case the first message in the queue of type not equal to I<msgtyp> will be "
"read."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:223
msgid ""
"If I<msgtyp> is less than 0, then the first message in the queue with the "
"lowest type less than or equal to the absolute value of I<msgtyp> will be "
"read."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:228
msgid ""
"The I<msgflg> argument is a bit mask constructed by ORing together zero or "
"more of the following flags:"
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:228
#, no-wrap
msgid "B<IPC_NOWAIT>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:235
msgid ""
"Return immediately if no message of the requested type is in the queue.  The "
"system call fails with I<errno> set to B<ENOMSG>."
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:235
#, no-wrap
msgid "B<MSG_EXCEPT>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:243
msgid ""
"Used with I<msgtyp> greater than 0 to read the first message in the queue "
"with message type that differs from I<msgtyp>."
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:243
#, no-wrap
msgid "B<MSG_NOERROR>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:248
msgid "To truncate the message text if longer than I<msgsz> bytes."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:254
msgid ""
"If no message of the requested type is available and B<IPC_NOWAIT> isn't "
"specified in I<msgflg>, the calling process is blocked until one of the "
"following conditions occurs:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:256
msgid "A message of the desired type is placed in the queue."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:262
msgid ""
"The message queue is removed from the system.  In this case the system call "
"fails with I<errno> set to B<EIDRM>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:273
msgid ""
"The calling process catches a signal.  In this case the system call fails "
"with I<errno> set to B<EINTR>.  (B<msgrcv>()  is never automatically "
"restarted after being interrupted by a signal handler, regardless of the "
"setting of the B<SA_RESTART> flag when establishing a signal handler.)"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:279
msgid "I<msg_lrpid> is set to the process ID of the calling process."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:282
msgid "I<msg_qnum> is decremented by 1."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:285
msgid "I<msg_rtime> is set to the current time."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:298
msgid ""
"On failure both functions return -1 with I<errno> indicating the error, "
"otherwise B<msgsnd>()  returns 0 and B<msgrcv>()  returns the number of "
"bytes actually copied into the I<mtext> array."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:304
msgid ""
"When B<msgsnd>()  fails, I<errno> will be set to one among the following "
"values:"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:310
msgid ""
"The calling process does not have write permission on the message queue, and "
"does not have the B<CAP_IPC_OWNER> capability."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:318
msgid ""
"The message can't be sent due to the I<msg_qbytes> limit for the queue and "
"B<IPC_NOWAIT> was specified in I<msgflg>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:323 build/C/man2/msgop.2:376
msgid "The address pointed to by I<msgp> isn't accessible."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:329
msgid "Sleeping on a full message queue condition, the process caught a signal."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:340
msgid ""
"Invalid I<msqid> value, or nonpositive I<mtype> value, or invalid I<msgsz> "
"value (less than 0 or greater than the system value B<MSGMAX>)."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:345
msgid ""
"The system does not have enough memory to make a copy of the message pointed "
"to by I<msgp>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:351
msgid ""
"When B<msgrcv>()  fails, I<errno> will be set to one among the following "
"values:"
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:351
#, no-wrap
msgid "B<E2BIG>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:359
msgid ""
"The message text length is greater than I<msgsz> and B<MSG_NOERROR> isn't "
"specified in I<msgflg>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:365
msgid ""
"The calling process does not have read permission on the message queue, and "
"does not have the B<CAP_IPC_OWNER> capability."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:371
msgid ""
"No message was available in the queue and B<IPC_NOWAIT> was specified in "
"I<msgflg>."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:380
msgid ""
"While the process was sleeping to receive a message, the message queue was "
"removed."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:385
msgid ""
"While the process was sleeping to receive a message, the process caught a "
"signal; see B<signal>(7)."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:391
msgid "I<msgqid> was invalid, or I<msgsz> was less than 0."
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:391
#, no-wrap
msgid "B<ENOMSG>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:397
msgid ""
"B<IPC_NOWAIT> was specified in I<msgflg> and no message of the requested "
"type existed on the message queue."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:406
msgid ""
"The I<msgp> argument is declared as I<struct msgbuf *> with libc4, libc5, "
"glibc 2.0, glibc 2.1.  It is declared as I<void *> with glibc 2.2 and later, "
"as required by SUSv2 and SUSv3."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:410
msgid ""
"The following limits on message queue resources affect the B<msgsnd>()  "
"call:"
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:410
#, no-wrap
msgid "B<MSGMAX>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:415
msgid ""
"Maximum size for a message text: 8192 bytes (on Linux, this limit can be "
"read and modified via I</proc/sys/kernel/msgmax>)."
msgstr ""

#. type: TP
#: build/C/man2/msgop.2:415
#, no-wrap
msgid "B<MSGMNB>"
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:425
msgid ""
"Default maximum size in bytes of a message queue: 16384 bytes (on Linux, "
"this limit can be read and modified via I</proc/sys/kernel/msgmnb>).  The "
"superuser can increase the size of a message queue beyond B<MSGMNB> by a "
"B<msgctl>(2)  system call."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:431
msgid ""
"The implementation has no intrinsic limits for the system wide maximum "
"number of message headers (B<MSGTQL>)  and for the system wide maximum size "
"in bytes of the message pool (B<MSGPOOL>)."
msgstr ""

#. type: Plain text
#: build/C/man2/msgop.2:437
msgid ""
"B<msgctl>(2), B<msgget>(2), B<capabilities>(7), B<mq_overview>(7), "
"B<svipc>(7)"
msgstr ""
