# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2013-03-22 01:06+0900\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \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/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:37 build/C/man2/msgget.2:35 build/C/man2/msgop.2:40 #, 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:37 build/C/man2/msgget.2:35 build/C/man2/msgop.2:40 #, 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:38 build/C/man2/msgget.2:36 build/C/man2/msgop.2:41 #, 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:40 build/C/man2/msgget.2:38 build/C/man2/msgop.2:43 #, 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 Emqueue.hE>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_close.3:34 #, no-wrap msgid "BIB<);>\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:40 build/C/man3/mq_notify.3:37 build/C/man3/mq_open.3:41 build/C/man7/mq_overview.7:29 build/C/man3/mq_receive.3:57 build/C/man3/mq_send.3:57 build/C/man3/mq_unlink.3:37 build/C/man2/msgctl.2:48 build/C/man2/msgget.2:46 build/C/man2/msgop.2:56 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: build/C/man3/mq_close.3:41 msgid "B() closes the message queue descriptor I." 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, 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:226 build/C/man2/msgget.2:137 build/C/man2/msgop.2:287 #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: build/C/man3/mq_close.3:53 msgid "" "On success B() returns 0; on error, -1 is returned, with I " "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:251 build/C/man2/msgget.2:143 build/C/man2/msgop.2:300 #, 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" 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 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:50 build/C/man3/mq_notify.3:174 build/C/man3/mq_open.3:224 build/C/man7/mq_overview.7:263 build/C/man3/mq_receive.3:156 build/C/man3/mq_send.3:161 build/C/man3/mq_unlink.3:62 build/C/man2/msgctl.2:311 build/C/man2/msgget.2:183 build/C/man2/msgop.2:399 #, 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:52 build/C/man7/mq_overview.7:265 build/C/man3/mq_receive.3:158 build/C/man3/mq_send.3:163 build/C/man2/msgctl.2:314 build/C/man2/msgget.2:185 build/C/man2/msgop.2:401 #, 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(2)." msgstr "" #. type: SH #: build/C/man3/mq_close.3:65 build/C/man3/mq_getattr.3:147 build/C/man2/mq_getsetattr.2:56 build/C/man3/mq_notify.3:243 build/C/man3/mq_open.3:230 build/C/man7/mq_overview.7:281 build/C/man3/mq_receive.3:164 build/C/man3/mq_send.3:169 build/C/man3/mq_unlink.3:64 build/C/man2/msgctl.2:352 build/C/man2/msgget.2:230 build/C/man2/msgop.2:446 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: build/C/man3/mq_close.3:73 msgid "" "B(3), B(3), B(3), B(3), " "B(3), B(3), B(7)" msgstr "" #. type: SH #: build/C/man3/mq_close.3:73 build/C/man3/mq_getattr.3:155 build/C/man2/mq_getsetattr.2:59 build/C/man3/mq_notify.3:252 build/C/man3/mq_open.3:238 build/C/man7/mq_overview.7:294 build/C/man3/mq_receive.3:173 build/C/man3/mq_send.3:178 build/C/man3/mq_unlink.3:72 build/C/man2/msgctl.2:359 build/C/man2/msgget.2:238 build/C/man2/msgop.2:452 #, 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:66 build/C/man3/mq_notify.3:259 build/C/man3/mq_open.3:245 build/C/man7/mq_overview.7:301 build/C/man3/mq_receive.3:180 build/C/man3/mq_send.3:185 build/C/man3/mq_unlink.3:79 build/C/man2/msgctl.2:366 build/C/man2/msgget.2:245 build/C/man2/msgop.2:459 msgid "" "This page is part of release 3.50 of the Linux I 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 "BIB<, struct mq_attr *>IB<);>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:37 #, no-wrap msgid "" "BIB<, struct mq_attr *>IB<,>\n" "B< struct mq_attr *>IB<);>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:47 msgid "" "B() and B() respectively retrieve and modify " "attributes of the message queue referred to by the descriptor I." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:54 msgid "" "B() returns an I structure in the buffer pointed by " "I. 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 field contains flags associated with the open message queue " "description. This field is initialized when the queue is created by " "B(3). The only flag that can appear in this field is " "B." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:94 msgid "" "The I and I fields are set when the message queue is " "created by B(3). The I field is an upper limit on the " "number of messages that may be placed on the queue using B(3). The " "I 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 files that place ceilings on the values for these fields " "are described in B(3)." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:98 msgid "" "The I field returns the number of messages currently held in the " "queue." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:118 msgid "" "B() sets message queue attributes using information supplied in " "the I structure pointed to by I. The only attribute that " "can be modified is the setting of the B flag in I. " "The other fields in I are ignored. If the I field is not " "NULL, then the buffer that it points to is used to return an I " "structure that contains the same information that is returned by " "B()." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:126 msgid "" "On success B() and B() return 0; on error, -1 is " "returned, with I 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:282 build/C/man2/msgop.2:331 build/C/man2/msgop.2:387 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:137 msgid "Imq_flags> contained set bits other than B." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:147 msgid "" "On Linux, B() and B() are library functions " "layered on top of the B(2) system call." msgstr "" #. type: Plain text #: build/C/man3/mq_getattr.3:155 msgid "" "B(3), B(3), B(3), B(3), " "B(3), B(3), B(7)" msgstr "" #. type: TH #: build/C/man2/mq_getsetattr.2:26 #, no-wrap msgid "MQ_GETSETATTR" msgstr "" #. type: TH #: build/C/man2/mq_getsetattr.2:26 #, no-wrap msgid "2012-07-13" 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 Esys/types.hE>\n" "B<#include Emqueue.hE>\n" msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:36 #, no-wrap msgid "" "BIB<, struct mq_attr *>IB<,>\n" "B< struct mq_attr *>IB<);>\n" msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:40 msgid "I: There is no glibc wrapper for this system call; see NOTES." msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:42 msgid "Do not use this system call." msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:50 msgid "" "This is the low-level system call used to implement B(3) and " "B(3). For an explanation of how this system call operates, see " "the description of B(3)." msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:52 msgid "This interface is nonstandard; avoid its use." msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:56 msgid "" "Glibc does not provide a wrapper for this system call; call it using " "B(2). (Actually, never call it unless you are writing a C " "library!)" msgstr "" #. type: Plain text #: build/C/man2/mq_getsetattr.2:59 msgid "B(3), B(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 "BIB<, const struct sigevent *>IB<);>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_notify.3:43 msgid "" "B() 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." msgstr "" #. type: Plain text #: build/C/man3/mq_notify.3:51 msgid "" "The I argument is a pointer to a I structure. For the " "definition and general details of this structure, see B(7)." msgstr "" #. type: Plain text #: build/C/man3/mq_notify.3:65 msgid "" "If I is a non-NULL pointer, then B() registers the calling " "process to receive message notification. The I field of the " "I structure to which I 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" 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" 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. See " "B(7) for general details. The I field of the " "I structure will be set to B. In addition, I " "will be set to the PID of the process that sent the message, and I " "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" msgstr "" #. type: Plain text #: build/C/man3/mq_notify.3:98 msgid "" "Upon message delivery, invoke I as if it were the " "start function of a new thread. See B(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 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() " "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(3), then any message notification registration is " "ignored: the message is delivered to the process or thread calling " "B(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() 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() returns 0; on error, -1 is returned, with " "I set to indicate the error." msgstr "" #. type: TP #: build/C/man3/mq_notify.3:146 #, no-wrap msgid "B" 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 "" "Isigev_notify> is not one of the permitted values; or " "Isigev_notify> is B and Isigev_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:173 build/C/man2/msgop.2:342 #, no-wrap msgid "B" 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 generate an B error " "if I is NULL, and the caller is not currently registered to receive " "notifications for the queue I." 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 Epthread.hE\n" "#include Emqueue.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\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 Emq-nameE\\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(3), B(3), B(3), B(3), " "B(3), B(3), B(7), B(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 Efcntl.hE> /* For O_* constants */\n" "B<#include Esys/stat.hE> /* For mode constants */\n" "B<#include Emqueue.hE>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:38 #, no-wrap msgid "" "BIB<, int >IB<);>\n" "BIB<, int >IB<, mode_t " ">IB<,>\n" "B< struct mq_attr *>IB<);>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:50 msgid "" "B() creates a new POSIX message queue or opens an existing queue. " "The queue is identified by I. For details of the construction of " "I, see B(7)." msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:58 msgid "" "The I argument specifies flags that control the operation of the " "call. (Definitions of the flags values can be obtained by including " "Ifcntl.hE>.) Exactly one of the following must be specified in " "I:" msgstr "" #. type: TP #: build/C/man3/mq_open.3:58 #, no-wrap msgid "B" 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" 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" 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 Ied in I:" msgstr "" #. type: TP #: build/C/man3/mq_open.3:72 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:81 msgid "" "Open the queue in nonblocking mode. In circumstances where B(3) " "and B(3) would normally block, these functions instead fail with " "the error B." msgstr "" #. type: TP #: build/C/man3/mq_open.3:81 #, no-wrap msgid "B" 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" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:99 msgid "" "If B was specified in I, and a queue with the given I " "already exists, then fail with the error B." msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:123 msgid "" "If B is specified in I, then two additional arguments must " "be supplied. The I argument specifies the permissions to be placed on " "the new queue, as for B(2). (Symbolic definitions for the permissions " "bits can be obtained by including Isys/stat.hE>.) The permissions " "settings are masked against the process umask. The I argument " "specifies attributes for the queue. See B(3) for details. If " "I 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() returns a message queue descriptor for use by " "other message queue functions. On error, B() returns I<(mqd_t)\\ " "-1>, with I 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:255 build/C/man2/msgget.2:147 build/C/man2/msgop.2:306 build/C/man2/msgop.2:361 #, no-wrap msgid "B" 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 contained more than one slash." msgstr "" #. type: TP #: build/C/man3/mq_open.3:145 build/C/man2/msgget.2:155 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:156 msgid "" "Both B and B were specified in I, but a queue with " "this I already exists." msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:188 msgid "" "B was specified in I, and I was not NULL, but " "Imq_maxmsg> or Imq_msqsize> was invalid. Both of " "these fields must be greater than zero. In a process that is unprivileged " "(does not have the B capability), Imq_maxmsg> " "must be less than or equal to the I limit, and " "Imq_msgsize> must be less than or equal to the I " "limit. In addition, even in a privileged process, Imq_maxmsg> " "cannot exceed the B limit. (See B(7) for details of " "these limits.)" msgstr "" #. type: TP #: build/C/man3/mq_open.3:188 #, no-wrap msgid "B" 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" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:196 build/C/man3/mq_unlink.3:58 msgid "I was too long." msgstr "" #. type: TP #: build/C/man3/mq_open.3:196 #, no-wrap msgid "B" 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:165 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:209 msgid "" "The B flag was not specified in I, and no queue with this " "I 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 was just \"/\" followed by no other characters." msgstr "" #. type: TP #: build/C/man3/mq_open.3:217 build/C/man2/msgget.2:177 #, no-wrap msgid "B" 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 limit was encountered; see " "B(7)." msgstr "" #. type: SH #: build/C/man3/mq_open.3:226 build/C/man2/msgget.2:224 #, 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." msgstr "" #. type: Plain text #: build/C/man3/mq_open.3:238 msgid "" "B(3), B(3), B(3), B(3), " "B(3), B(3), B(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(2), B(2), B(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(3); this function " "returns a I (I), 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; that is, a null-terminated string of up to " "B (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(3)." msgstr "" #. type: Plain text #: build/C/man7/mq_overview.7:68 msgid "" "Messages are transferred to and from a queue using B(3) and " "B(3). When a process has finished using the queue, it closes it " "using B(3), and when the queue is no longer required, it can be " "deleted using B(3). Queue attributes can be retrieved and (in " "some cases) modified using B(3) and B(3). A " "process can request asynchronous notification of the arrival of a message on " "a previously empty queue using B(3)." msgstr "" #. type: Plain text #: build/C/man7/mq_overview.7:81 msgid "" "A message queue descriptor is a reference to an I (cf. B(2)). After a B(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) 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, and messages are always " "delivered to the receiving process highest priority first. Message " "priorities range from 0 (low) to I " "(high). On Linux, I 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 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 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(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 " "to link against the real-time library, I." 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" 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 " "Imq_maxmsg> argument given to B(3). The default value " "for I is 10. The minimum value is 1 (10 in kernels before " "2.6.28). The upper limit is B: I<(131072\\ /\\ sizeof(void\\ *))> " "(32768 on Linux/86). This limit is ignored for privileged processes " "(B), but the B ceiling is nevertheless imposed." msgstr "" #. type: TP #: build/C/man7/mq_overview.7:162 #, no-wrap msgid "I" 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 Imq_msgsize> argument " "given to B(3). The default value for I is 8192 " "bytes. The minimum value is 128 (8192 in kernels before 2.6.28). The upper " "limit for I is 1,048,576 (in kernels before 2.6.28, the upper " "limit was B; that is, 2,147,483,647 on Linux/86). This limit is " "ignored for privileged processes (B)." msgstr "" #. type: TP #: build/C/man7/mq_overview.7:181 #, no-wrap msgid "I" 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) can create new message queues once this limit has " "been reached. The default value for I 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 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(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(1) and B(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" 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" 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(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" msgstr "" #. type: Plain text #: build/C/man7/mq_overview.7:251 msgid "" "Notification method: 0 is B; 1 is B; and 2 is " "B." msgstr "" #. type: TP #: build/C/man7/mq_overview.7:251 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: build/C/man7/mq_overview.7:255 msgid "Signal number to be used for B." 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(2), " "B(3), B(3), B(3), B(3), " "B(3), B(3), B(3), B(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 "" "BIB<, char *>IB<,>\n" "B< size_t >IB<, unsigned *>IB<);>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:38 build/C/man3/mq_send.3:38 #, no-wrap msgid "" "B<#include Etime.hE>\n" "B<#include Emqueue.hE>\n" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:42 #, no-wrap msgid "" "BIB<, char *>IB<,>\n" "B< size_t >IB<, unsigned *>IB<,>\n" "B< const struct timespec *>IB<);>\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(7)):" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:53 msgid "B():" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:55 build/C/man3/mq_send.3:55 msgid "_XOPEN_SOURCE\\ E=\\ 600 || _POSIX_C_SOURCE\\ E=\\ 200112L" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:76 msgid "" "B() removes the oldest message with the highest priority from " "the message queue referred to by the descriptor I, and places it in " "the buffer pointed to by I. The I argument specifies the " "size of the buffer pointed to by I; this must be greater than the " "I attribute of the queue (see B(3)). If I " "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() blocks until a " "message becomes available, or the call is interrupted by a signal handler. " "If the B flag is enabled for the message queue description, then " "the call instead fails immediately with the error B." msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:99 msgid "" "B() behaves just like B(), except that if the " "queue is empty and the B flag is not enabled for the message " "queue description, then I 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() returns immediately." msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:122 msgid "" "On success, B() and B() return the number of " "bytes in the received message; on error, -1 is returned, with I 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:312 build/C/man2/msgop.2:367 #, no-wrap msgid "B" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:129 msgid "" "The queue was empty, and the B flag was set for the message " "queue description referred to by I." msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139 msgid "The descriptor specified in I was invalid." msgstr "" #. type: TP #: build/C/man3/mq_receive.3:134 build/C/man3/mq_send.3:139 build/C/man2/msgop.2:328 build/C/man2/msgop.2:382 #, no-wrap msgid "B" 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(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 was invalid, either because " "I was less than zero, or because I 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" msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:153 msgid "I was less than the I 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" 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() is a system call, and B() is a " "library function layered on top of that system call." msgstr "" #. type: Plain text #: build/C/man3/mq_receive.3:173 msgid "" "B(3), B(3), B(3), B(3), " "B(3), B(3), B(7), B