1 .\" Copyright 1993 Giorgio Ciucci <giorgio@crcc.it>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Modified Tue Oct 22 16:40:11 1996 by Eric S. Raymond <esr@thyrsus.com>
24 .\" Modified Mon Jul 10 21:09:59 2000 by aeb
25 .\" Modified 1 Jun 2002, Michael Kerrisk <mtk.manpages@gmail.com>
26 .\" Language clean-ups.
27 .\" Enhanced and corrected information on msg_qbytes, MSGMNB and MSGMAX
28 .\" Added note on restart behavior of msgsnd() and msgrcv()
29 .\" Formatting clean-ups (argument and field names marked as .I
31 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
32 .\" Added notes on capability requirements
33 .\" Modified, 11 Nov 2004, Michael Kerrisk <mtk.manpages@gmail.com>
34 .\" Language and formatting clean-ups
35 .\" Added notes on /proc files
36 .\" FIXME . Add example programs to this page.
38 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
39 .\" all rights reserved.
40 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
41 .\" Modified 2000-09-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
42 .\" Updated 2002-11-26, Kentaro Shirakata <argrath@ub32.org>
43 .\" Updated 2005-03-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
44 .\" Updated 2006-03-05, Akihiro MOTOKI, LDP v2.25
45 .\" Updated 2008-08-09, Akihiro MOTOKI, LDP v3.05
47 .\"WORD: message ¥á¥Ã¥»¡¼¥¸
48 .\"WORD: operation Áàºî
50 .\"WORD: process ¥×¥í¥»¥¹
51 .\"WORD: catch Êá³Í(catch)
52 .\"WORD: signal ¥·¥°¥Ê¥ë
53 .\"WORD: suspend Ää»ß(suspend)
54 .\"WORD: sleep Ää»ß(sleep)
55 .\"WORD: block Ää»ß(block)
56 .\"WORD: process-ID ¥×¥í¥»¥¹ID
59 .\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
60 .\"WORD: current time ¸½ºß»þ¹ï
61 .\"WORD: implement ¼ÂÁõ
63 .TH MSGOP 2 2008-04-23 "Linux" "Linux Programmer's Manual"
66 .\"O msgrcv, msgsnd \- message operations
67 msgrcv, msgsnd \- ¥á¥Ã¥»¡¼¥¸Áàºî
71 .B #include <sys/types.h>
72 .B #include <sys/ipc.h>
73 .B #include <sys/msg.h>
75 .BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \
78 .BI "ssize_t msgrcv(int " msqid ", void *" msgp ", size_t " msgsz \
88 .\"O system calls are used, respectively, to send messages to,
89 .\"O and receive messages from, a message queue.
90 .\"O The calling process must have write permission on the message queue
91 .\"O in order to send a message, and read permission to receive a message.
96 ¤Ï¤½¤ì¤¾¤ì¡¢¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤Ø¤Î¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤È¡¢
97 ¥á¥Ã¥»¡¼¥¸¤Î¼õ¿®¤Ë»ÈÍѤµ¤ì¤ë¡£¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï¡¢
98 ¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤ËÂФ¹¤ë½ñ¤¹þ¤ßµö²Ä¤ò¡¢
99 ¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¤ÏÆɤ߽Ф·µö²Ä¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
103 .\"O argument is a pointer to caller-defined structure
104 .\"O of the following general form:
105 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï°Ê²¼¤Ë¼¨¤¹¹½Â¤ÂΤòÍÑ°Õ¤·¡¢¤³¤Î¹½Â¤ÂΤؤÎ
113 long mtype; /* message type, must be > 0 */
114 char mtext[1]; /* message data */
121 .\"O field is an array (or other structure) whose size is specified by
123 .\"O a nonnegative integer value.
125 ¥Õ¥£¡¼¥ë¥É¤ÏÇÛÎó (¤Þ¤¿¤Ï¾¤Î¹½Â¤ÂÎ) ¤Ç¡¢¤½¤ÎÂ礤µ¤Ï
129 .\"O Messages of zero length (i.e., no
131 .\"O field) are permitted.
132 Ťµ 0 ¤Î¥á¥Ã¥»¡¼¥¸ (¤Ä¤Þ¤ê
134 ¥Õ¥£¡¼¥ë¥É¤¬¤Ê¤¤¥á¥Ã¥»¡¼¥¸) ¤âǧ¤á¤é¤ì¤Æ¤¤¤ë¡£
137 .\"O field must have a strictly positive integer value.
138 .\"O This value can be
139 .\"O used by the receiving process for message selection
140 .\"O (see the description of
144 ¥Õ¥£¡¼¥ë¥É¤Ï¸·Ì©¤ËÀµ¤ÎÀ°¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
145 ¤³¤ÎÃͤϡ¢¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¥×¥í¥»¥¹¤Ç¥á¥Ã¥»¡¼¥¸¤òÁªÂò¤¹¤ë¤¿¤á¤Ë
148 ¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È)¡£
152 .\"O system call appends a copy of the message pointed to by
154 .\"O to the message queue whose identifier is specified
160 °ú¤¿ô¤Ç»ØÄꤵ¤ì¤¿¥á¥Ã¥»¡¼¥¸¤Î¥³¥Ô¡¼¤ò
162 ¤Ç»ØÄꤵ¤ì¤¿¼±Ê̻Ҥò»ý¤Ä¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤ØÄɲ乤롣
164 .\"O If sufficient space is available in the queue,
166 .\"O succeeds immediately.
167 ¥¥å¡¼¤Ë½½Ê¬¤Ê¶õ¤ÍÆÎ̤¬¤¢¤ë¾ì¹ç¡¢
170 .\"O (The queue capacity is defined by the
172 .\"O field in the associated data structure for the message queue.
173 .\"O During queue creation this field is initialized to
175 .\"O bytes, but this limit can be modified using
176 .\"O .BR msgctl (2).)
177 (¥¥å¡¼¤ÎÍÆÎ̤ϡ¢¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤÎ
179 ¥Õ¥£¡¼¥ë¥É¤ÇÄêµÁ¤µ¤ì¤ë¡£
180 ¥¥å¡¼ºîÀ®»þ¤Ë¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï
182 ¤Ë½é´ü²½¤µ¤ì¤ë¤¬¡¢¤³¤ÎÀ©¸Â¤Ï
184 ¤ò»È¤Ã¤ÆÊѹ¹¤Ç¤¤ë¡£)
185 .\"O If insufficient space is available in the queue, then the default
188 .\"O is to block until space becomes available.
189 ¥¥å¡¼¤Ë½½Ê¬¤Ê¶õ¤ÍÆÎ̤¬¤Ê¤¤¾ì¹ç¡¢
192 ¤Ï¶õ¤ÍÆÎ̤¬¤Ç¤¤ë¤Þ¤ÇÄä»ß (block) ¤¹¤ë¡£
197 .\"O then the call instead fails with the error
202 ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¥¨¥é¡¼
208 .\"O call may also fail if:
211 ¤Ï°Ê²¼¤Î¾ì¹ç¤Ë¤â¼ºÇÔ¤¹¤ë¡£
213 .\"O the queue is removed,
214 .\"O in which case the system call fails with
226 .\"O a signal is caught, in which case the system call fails
232 ¥·¥°¥Ê¥ë¤¬Ê᪤µ¤ì¤¿¡£
241 .\"O is never automatically restarted after being interrupted by a
242 .\"O signal handler, regardless of the setting of the
244 .\"O flag when establishing a signal handler.)
246 ¤Ï¡¢¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë
248 ¤ò»ØÄꤷ¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ç
249 ¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£)
251 .\"O Upon successful completion the message queue data structure is updated
253 Àµ¾ï¤Ë½ªÎ»¤·¤¿¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ë
257 .\"O is set to the process ID of the calling process.
259 ¤Ë¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£
262 .\"O is incremented by 1.
267 .\"O is set to the current time.
269 ¤Ë¤Ï¸½ºß»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£
273 .\"O system call removes a message from the queue specified by
275 .\"O and places it in the buffer
281 ¤Ç»ØÄꤵ¤ì¤¿¥¥å¡¼¤«¤é¥á¥Ã¥»¡¼¥¸¤òºï½ü¤·¡¢
283 ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë¤½¤Î¥á¥Ã¥»¡¼¥¸¤ò³ÊǼ¤¹¤ë¡£
287 .\"O specifies the maximum size in bytes for the member
289 .\"O of the structure pointed to by the
295 °ú¤¿ô¤Ç»ØÄꤵ¤ì¤¿¹½Â¤ÂΤÎ
297 ¥á¥ó¥Ð¡¼¤ÎºÇÂç¤Î¥Ð¥¤¥È¿ô¤ò»ØÄꤹ¤ë¡£
298 .\"O If the message text has length greater than
300 .\"O then the behavior depends on whether
306 .\"O is specified, then
307 .\"O the message text will be truncated (and the truncated part will be
310 .\"O is not specified, then
311 .\"O the message isn't removed from the queue and
312 .\"O the system call fails returning \-1 with
316 ¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥¥¹¥È¤ÎŤµ¤¬
318 ¤è¤êÂ礤¤¾ì¹ç¤ÎÆ°ºî¤Ï¡¢
322 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ç·è¤Þ¤ë¡£
324 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥¥¹¥È¤ÏÀÚ¤êµÍ¤á¤é¤ì¤ë
325 (ÀÚ¤ê¼Î¤Æ¤é¤ì¤¿Éôʬ¤Ï¼º¤ï¤ì¤ë)¡£
327 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥á¥Ã¥»¡¼¥¸¤Ï¥¥å¡¼¤«¤éºï½ü¤µ¤ì¤º¡¢
328 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï \-1 ¤òÊÖ¤·¤Æ¼ºÇÔ¤·¡¢
336 .\"O specifies the type of message requested as follows:
338 °ú¤¿ô¤Ë¤ÏÍ׵᤹¤ë¥á¥Ã¥»¡¼¥¸¤Î·¿¤ò»ØÄꤹ¤ë¡£
339 ·¿¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤹ¤ë:
344 .\"O then the first message in the queue is read.
346 ¤¬ 0 ¤Ê¤é¤Ð¡¢¥¥å¡¼¤ÎºÇ½é¤Ë¤¢¤ë¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£
350 .\"O is greater than 0,
351 .\"O then the first message in the queue of type
355 .\"O was specified in
358 .\"O the first message in the queue of type not equal to
362 ¤¬ 0 ¤è¤êÂ礤¤¾ì¹ç¡¢
366 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
368 ·¿¤Î¥¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£
372 ·¿°Ê³°¤Î¥¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£
377 .\"O then the first message in the queue with the lowest type less than or
378 .\"O equal to the absolute value of
382 ¤¬ 0 ¤è¤ê¾®¤µ¤±¤ì¤Ð¡¢
384 ¤ÎÀäÂÐÃͰʲ¼¤ÇºÇ¤â¾®¤µ¤¤·¿¤ò»ý¤Ä¥¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤ë¡£
388 .\"O argument is a bit mask constructed by ORing together zero or more
389 .\"O of the following flags:
391 °ú¤¿ô¤Ë¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤òǤ°Õ¤Î¿ô¤À¤± (0¸Ä¤â²Ä)¡¢¤³¤ì¤é¤Î OR ¤Ç»ØÄꤹ¤ë:
394 .\"O Return immediately if no message of the requested type is in the queue.
395 .\"O The system call fails with
399 ¥¥å¡¼¤ËÍ׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ïľ¤Á¤ËÊ֤롣
400 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢
410 .\"O to read the first message in the queue with message type that differs
417 °Ê³°¤Î¥¥å¡¼¤ÎºÇ½é¤Î¥á¥Ã¥»¡¼¥¸¤òÆɤ߹þ¤à¡£
420 .\"O To truncate the message text if longer than
424 ¥Ð¥¤¥È¤è¤ê¤âŤ«¤Ã¤¿¾ì¹ç¤Ï¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥¥¹¥È¤òÀÚ¤êµÍ¤á¤ë¡£
426 .\"O If no message of the requested type is available and
428 .\"O isn't specified in
430 .\"O the calling process is blocked until one of the following conditions occurs:
431 Í׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤»¤º¡¢
435 ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ï
436 °Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾õ¶·¤Ë¤Ê¤ë¤Þ¤ÇÄä»ß (block) ¤µ¤ì¤ë:
438 .\"O A message of the desired type is placed in the queue.
439 Í׵ᤷ¤Æ¤¤¤ë·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬¥¥å¡¼¤ØÆþ¤ì¤é¤ì¤¿¡£
441 .\"O The message queue is removed from the system.
442 .\"O In this case the system call fails with
446 ¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤¬¥·¥¹¥Æ¥à¤«¤éºï½ü¤µ¤ì¤¿¡£
447 ¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢
453 .\"O The calling process catches a signal.
454 .\"O In this case the system call fails with
458 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£
459 ¤³¤Î¾ì¹ç¡¢¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼ºÇÔ¤·¡¢
465 .\"O is never automatically restarted after being interrupted by a
466 .\"O signal handler, regardless of the setting of the
468 .\"O flag when establishing a signal handler.)
470 ¤Ï¡¢¤¿¤È¤¨¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤ÎÀßÄê»þ¤Ë
472 ¤ò»ØÄꤷ¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢¥·¥°¥Ê¥ë¥Ï¥ó¥É¥é¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¤¿¸å¤Ç
473 ¼«Æ°Åª¤ËºÆ¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ï·è¤·¤Æ¤Ê¤¤¡£)
475 .\"O Upon successful completion the message queue data structure is updated
477 ¼Â¹Ô¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤Î¥Ç¡¼¥¿¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤Ë
481 .\"O is set to the process ID of the calling process.
483 ¤Ë¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ ID ¤¬ÀßÄꤵ¤ì¤ë¡£
486 .\"O is decremented by 1.
491 .\"O is set to the current time.
493 ¤Ë¤Ï¸½ºß¤Î»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¡£
494 .\"O .SH "RETURN VALUE"
496 .\"O On failure both functions return \-1
499 .\"O indicating the error,
505 .\"O returns the number of bytes actually copied into the
508 ¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢¤É¤Á¤é¤Î´Ø¿ô¤â \-1 ¤òÊÖ¤·¡¢¥¨¥é¡¼¤ò
510 ¤Ëɽ¼¨¤¹¤ë¡£À®¸ù¤·¤¿¾ì¹ç¡¢
516 ÇÛÎó¤Ë¼ÂºÝ¤Ë¥³¥Ô¡¼¤·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
523 .\"O will be set to one among the following values:
527 ¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë:
530 .\"O The calling process does not have write permission on the message queue,
531 .\"O and does not have the
532 .\"O .B CAP_IPC_OWNER
534 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤ËÂФ¹¤ë½ñ¤¹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢
536 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£
539 .\"O The message can't be sent due to the
541 .\"O limit for the queue and
543 .\"O was specified in
546 ¤¬¥¥å¡¼¤ÎÀ©¸Â¤òĶ¤¨¤Æ¤¤¤¿¤¿¤á¡¢¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë¤³¤È¤¬¤Ç¤¤º¡¢¤«¤Ä
553 .\"O The address pointed to by
555 .\"O isn't accessible.
557 ¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£
560 .\"O The message queue was removed.
561 ¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£
564 .\"O Sleeping on a full message queue condition, the process caught a signal.
565 ¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤¬Í׵ᤷ¤¿¾ò·ï¤òËþ¤¿¤¹¤Þ¤ÇÄä»ß¤·¤Æ¤¤¤ë»þ¤Ë¡¢
566 ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£
571 .\"O value, or nonpositive
576 .\"O value (less than 0 or greater than the system value
579 ¤¬ÉÔŬÀÚ¤ÊÃͤǤ¢¤ë¤«¡¢
583 ¤¬ÉÔŬÀÚ¤ÊÃÍ (0 °Ê²¼¤«¡¢¥·¥¹¥Æ¥à¤Ç·è¤Þ¤ëÃÍ
585 ¤è¤ê¤âÂ礤¤ÃÍ) ¤Ç¤¢¤ë¡£
588 .\"O The system does not have enough memory to make a copy of the
589 .\"O message pointed to by
592 ¤¬»Ø¤¹¥á¥Ã¥»¡¼¥¸¤Î¥³¥Ô¡¼¤òºîÀ®¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£
598 .\"O will be set to one among the following values:
602 ¤Ë°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë:
605 .\"O The message text length is greater than
609 .\"O isn't specified in
611 ¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥¥¹¥È¤ÎŤµ¤¬
617 ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
620 .\"O The calling process does not have read permission on the message queue,
621 .\"O and does not have the
622 .\"O .B CAP_IPC_OWNER
624 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤ËÂФ¹¤ëÆɤ߹þ¤ßµö²Ä¤¬¤Ê¤¯¡¢
626 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤â¤Ê¤¤¡£
629 .\"O No message was available in the queue and
631 .\"O was specified in
633 ¥¥å¡¼¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¯¡¢
640 .\"O The address pointed to by
642 .\"O isn't accessible.
644 ¤¬»Ø¤·¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤¬¥¢¥¯¥»¥¹²Äǽ¤Ç¤Ê¤¤¡£
647 .\"O While the process was sleeping to receive a message,
648 .\"O the message queue was removed.
649 ¥á¥Ã¥»¡¼¥¸¤ò¼õ¿®¤¹¤ë¤¿¤á¤Ë¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢
650 ¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤¬ºï½ü¤µ¤ì¤¿¡£
653 .\"O While the process was sleeping to receive a message,
654 .\"O the process caught a signal; see
656 ¥á¥Ã¥»¡¼¥¸¤ò¼õ¤±¤ë¤¿¤á¤Ë¥×¥í¥»¥¹¤¬Ää»ß¤·¤Æ¤¤¤ë´Ö¤Ë¡¢
657 ¥×¥í¥»¥¹¤¬¥·¥°¥Ê¥ë¤òÊá³Í¤·¤¿¡£
665 .\"O was less than 0.
673 .\"O was specified in
675 .\"O and no message of the requested type existed on the message queue.
680 ¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤ËÍ׵ᤵ¤ì¤¿·¿¤Î¥á¥Ã¥»¡¼¥¸¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¡£
681 .\"O .SH "CONFORMING TO"
688 .\"O argument is declared as \fIstruct msgbuf *\fP with
689 .\"O libc4, libc5, glibc 2.0, glibc 2.1.
690 .\"O It is declared as \fIvoid *\fP
691 .\"O with glibc 2.2 and later, as required by SUSv2 and SUSv3.
693 °ú¤¿ô¤Ï¡¢ libc4, libc5, glibc 2.0, glibc 2.1 ¤Ç¤Ï
694 \fIstruct msgbuf *\fP ¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£glibc 2.2 °Ê¹ß¤Ç¤Ï¡¢
695 SUSv2 ¤È SUSv3 ¤ÎÍ×µáÄ̤ꡢ\fIvoid *\fP ¤ÈÀë¸À¤µ¤ì¤Æ¤¤¤ë¡£
697 .\"O The following limits on message queue resources affect the
702 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë±Æ¶Á¤¹¤ë¥·¥¹¥Æ¥àÀ©¸Â¤Ç¤¢¤ë:
705 .\"O Maximum size for a message text: 8192 bytes
706 .\"O (on Linux, this limit can be read and modified via
707 .\"O .IR /proc/sys/kernel/msgmax ).
708 ¥á¥Ã¥»¡¼¥¸¤Î¥Æ¥¥¹¥È¤ÎºÇÂ祵¥¤¥º: 8192 ¥Ð¥¤¥È
709 (Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃͤÏ
710 .I /proc/sys/kernel/msgmax
711 ·Ðͳ¤ÇÆɤ߽Ф·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤¤ë)¡£
714 .\"O Default maximum size in bytes of a message queue: 16384 bytes
715 .\"O (on Linux, this limit can be read and modified via
716 .\"O .IR /proc/sys/kernel/msgmnb ).
717 .\"O The superuser can increase the size of a message queue beyond
722 ¥Ð¥¤¥Èñ°Ì¤Ç¤Î¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤ÎºÇÂ祵¥¤¥º : 16384 ¥Ð¥¤¥È¡£
723 (Linux ¤Ç¤Ï¡¢¤³¤ÎÀ©¸ÂÃͤÏ
724 .I /proc/sys/kernel/msgmnb
725 ·Ðͳ¤ÇÆɤ߽Ф·¤¿¤êÊѹ¹¤·¤¿¤ê¤Ç¤¤ë)¡£
728 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¥á¥Ã¥»¡¼¥¸¡¦¥¥å¡¼¤Î¥µ¥¤¥º¤ò
730 ¤è¤ê¤âÂ礤¤ÃͤËÁý¤ä¤¹¤³¤È¤¬¤Ç¤¤ë¡£
732 .\"O The implementation has no intrinsic limits for the system wide maximum
733 .\"O number of message headers
735 .\"O and for the system wide maximum size in bytes of the message pool
736 .\"O .RB ( MSGPOOL ).
737 ¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥Ø¥Ã¥À¡¼¤ÎºÇÂç¿ô
739 ¤È¡¢¥·¥¹¥Æ¥àÁ´ÂΤΥá¥Ã¥»¡¼¥¸¡¦¥×¡¼¥ë¤ÎºÇÂç¥Ð¥¤¥È¿ô
741 ¤Ë´Ø¤·¤Æ¼ÂÁõ°Í¸¤ÎÀ©¸Â¤Ï¤Ê¤¤¡£
746 .BR capabilities (7),