OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / mq_getattr.3
1 '\" t
2 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\"
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
27 .\" Translated 2006-04-23, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13
29 .\"
30 .TH MQ_GETATTR 3 2010-08-29 "Linux" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH Ì¾Á°
33 .\"O mq_getattr, mq_setattr \- get/set message queue attributes
34 mq_getattr, mq_setattr \- ¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄê/¼èÆÀ¤¹¤ë
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #include <mqueue.h>
39 .sp
40 .BI "int mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr );
41
42 .BI "int mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr ","
43 .BI "                 struct mq_attr *" oldattr );
44 .fi
45 .sp
46 .\"O Link with \fI\-lrt\fP.
47 \fI\-lrt\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
48 .\"O .SH DESCRIPTION
49 .SH ÀâÌÀ
50 .\"O .BR mq_getattr ()
51 .\"O and
52 .\"O .BR mq_setattr ()
53 .\"O respectively retrieve and modify attributes of the message queue
54 .\"O referred to by the descriptor
55 .\"O .IR mqdes .
56 .BR mq_getattr ()
57 ¤È
58 .BR mq_setattr ()
59 ¤Ï¡¢µ­½Ò»Ò
60 .I mqdes
61 ¤Ç»²¾È¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤Î¼èÆÀ¤ÈÊѹ¹¤ò¤½¤ì¤¾¤ì¹Ô¤¦¡£
62
63 .\"O .BR mq_getattr ()
64 .\"O returns an
65 .\"O .I mq_attr
66 .\"O structure in the buffer pointed by
67 .\"O .IR attr .
68 .\"O This structure is defined as:
69 .BR mq_getattr ()
70 ¤Ï¡¢
71 .I attr
72 ¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë
73 .I mq_attr
74 ¹½Â¤ÂΤò³ÊǼ¤·¤ÆÊÖ¤¹¡£¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
75 .in +4n
76 .nf
77
78 struct mq_attr {
79 .\"O     long mq_flags;       /* Flags: 0 or O_NONBLOCK */
80 .\"O     long mq_maxmsg;      /* Max. # of messages on queue */
81 .\"O     long mq_msgsize;     /* Max. message size (bytes) */
82 .\"O     long mq_curmsgs;     /* # of messages currently in queue */
83     long mq_flags;       /* ¥Õ¥é¥°: 0 ¤« O_NONBLOCK */
84     long mq_maxmsg;      /* ¥­¥å¡¼¤ÎºÇÂç¥á¥Ã¥»¡¼¥¸¿ô */
85     long mq_msgsize;     /* ºÇÂç¥á¥Ã¥»¡¼¥¸¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) */
86     long mq_curmsgs;     /* ¥­¥å¡¼¤Ë¸½ºßÆþ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô */
87 };
88 .fi
89 .in
90 .PP
91 .\"O The
92 .\"O .I mq_flags
93 .\"O field contains flags associated with the open message queue description.
94 .\"O This field is initialized when the queue is created by
95 .\"O .BR mq_open (3).
96 .\"O The only flag that can appear in this field is
97 .\"O .BR O_NONBLOCK .
98 .I mq_flags
99 ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢¥ª¡¼¥×¥ó¥á¥Ã¥»¡¼¥¸¥­¥å¡¼µ­½Ò (open message queue
100 description) ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤¬³ÊǼ¤µ¤ì¤ë¡£
101 ¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï
102 .BR mq_open (3)
103 ¤Ç¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ëºÝ¤Ë½é´ü²½¤µ¤ì¤ë¡£
104 ¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¸½¤ì¤ë¥Õ¥é¥°¤Ï
105 .B O_NONBLOCK
106 ¤À¤±¤Ç¤¢¤ë¡£
107
108 .\"O The
109 .\"O .I mq_maxmsg
110 .\"O and
111 .\"O .I mq_msgsize
112 .\"O fields are set when the message queue is created by
113 .\"O .BR mq_open (3).
114 .I mq_maxmsg
115 ¤È
116 .I mq_msgsize
117 ¥Õ¥£¡¼¥ë¥É¤Ï
118 .BR mq_open (3)
119 ¤Ç¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤¬ºîÀ®¤µ¤ì¤ëºÝ¤Ë¥»¥Ã¥È¤µ¤ì¤ë¡£
120 .\"O The
121 .\"O .I mq_maxmsg
122 .\"O field is an upper limit on the number of messages
123 .\"O that may be placed on the queue using
124 .\"O .BR mq_send (3).
125 .I mq_maxmsg
126 ¥Õ¥£¡¼¥ë¥É¤Ï¡¢
127 .BR mq_send (3)
128 ¤ò»È¤Ã¤Æ¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¿ô¤Î¾å¸Â¤Ç¤¢¤ë¡£
129 .\"O The
130 .\"O .I mq_msgsize
131 .\"O field is an upper limit on the size of messages
132 .\"O that may be placed on the queue.
133 .I mq_msgsize
134 ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥­¥å¡¼¤ËÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¥á¥Ã¥»¡¼¥¸¤Î
135 ¾å¸Â¥µ¥¤¥º¤Ç¤¢¤ë¡£
136 .\"O Both of these fields must have a value greater than zero.
137 .\"O Two
138 .\"O .I /proc
139 .\"O files that place ceilings on the values for these fields are described in
140 .\"O .BR mq_open (3).
141 ¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¤É¤Á¤é¤â 0 ¤è¤êÂ礭¤ÊÃͤǤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
142 ¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ËÀßÄê¤Ç¤­¤ëÃͤξå¸Â¤Ï
143 .I /proc
144 ¥Õ¥¡¥¤¥ë¤Ë¤è¤ê·è¤Þ¤ë¡£
145 .I /proc
146 ¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤Ï
147 .BR mq_open (3)
148 ¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£
149
150 .\"O The
151 .\"O .I mq_curmsgs
152 .\"O field returns the number of messages currently held in the queue.
153 .I mq_curmsgs
154 ¥Õ¥£¡¼¥ë¥É¤Ï¥­¥å¡¼¤Ë¸½ºß³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¿ô¤òÊÖ¤¹¡£
155
156 .\"O .BR mq_setattr ()
157 .\"O sets message queue attributes using information supplied in the
158 .\"O .I mq_attr
159 .\"O structure pointed to by
160 .\"O .IR newattr .
161 .BR mq_setattr ()
162 ¤Ï¡¢
163 .I newattr
164 ¤¬»Ø¤¹
165 .I mq_attr
166 ¹½Â¤ÂΤÇÍ¿¤¨¤é¤ì¤¿¾ðÊó¤ò»È¤Ã¤Æ¡¢¥á¥Ã¥»¡¼¥¸¥­¥å¡¼¤Î°À­¤òÀßÄꤹ¤ë¡£
167 .\"O The only attribute that can be modified is the setting of the
168 .\"O .B O_NONBLOCK
169 .\"O flag in
170 .\"O .IR mq_flags .
171 .\"O The other fields in
172 .\"O .I newattr
173 .\"O are ignored.
174 Êѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë°À­¤Ï¡¢
175 .I mq_flags
176 ¤Î
177 .B O_NONBLOCK
178 ¥Õ¥é¥°¤ÎÀßÄê¤À¤±¤Ç¤¢¤ë¡£
179 .I newattr
180 ¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¤ë¡£
181 .\"O If the
182 .\"O .I oldattr
183 .\"O field is not NULL,
184 .\"O then the buffer that it points to is used to return an
185 .\"O .I mq_attr
186 .\"O structure that contains the same information that is returned by
187 .\"O .BR mq_getattr ().
188 .I oldattr
189 ¥Õ¥£¡¼¥ë¥É¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢
190 .BR mq_getattr ()
191 ¤¬ÊÖ¤¹¤Î¤ÈƱ¤¸¾ðÊó¤ò³ÊǼ¤·¤¿
192 .I mq_attr
193 ¹½Â¤ÂΤò
194 .I oldattr
195 ¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤ËÆþ¤ì¤ÆÊÖ¤¹¡£
196 .\"O .SH RETURN VALUE
197 .SH ÊÖ¤êÃÍ
198 .\"O On success
199 .\"O .BR mq_getattr ()
200 .\"O and
201 .\"O .BR mq_setattr ()
202 .\"O return 0; on error, \-1 is returned, with
203 .\"O .I errno
204 .\"O set to indicate the error.
205 À®¸ù¤¹¤ë¤È¡¢
206 .I mq_getattr ()
207 ¤È
208 .I mq_setattr ()
209 ¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
210 .I errno
211 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
212 .\"O .SH ERRORS
213 .SH ¥¨¥é¡¼
214 .TP
215 .B EBADF
216 .\"O The descriptor specified in
217 .\"O .I mqdes
218 .\"O is invalid.
219 .I mqdes
220 ¤Ç»ØÄꤵ¤ì¤¿µ­½Ò»Ò¤¬ÉÔÀµ¤Ç¤¢¤ë¡£
221 .TP
222 .B EINVAL
223 .\"O .I newattr\->mq_flags
224 .\"O contained set bits other than
225 .\"O .BR O_NONBLOCK .
226 .I newattr\->mq_flags
227 ¤Ë
228 .B O_NONBLOCK
229 °Ê³°¤Î¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤¿¡£
230 .\"O .SH CONFORMING TO
231 .SH ½àµò
232 POSIX.1-2001.
233 .\"O .SH NOTES
234 .SH Ãí°Õ
235 .\"O On Linux,
236 .\"O .BR mq_getattr ()
237 .\"O and
238 .\"O .BR mq_setattr ()
239 .\"O are library functions layered on top of the
240 .\"O .BR mq_getsetattr (2)
241 .\"O system call.
242 Linux ¤Ç¤Ï¡¢
243 .BR mq_getattr ()
244 ¤È
245 .BR mq_setattr ()
246 ¤Ï¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¤¢¤ê¡¢
247 .BR mq_getsetattr (2)
248 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
249 .\"O .SH "SEE ALSO"
250 .SH ´ØÏ¢¹àÌÜ
251 .BR mq_close (3),
252 .BR mq_notify (3),
253 .BR mq_open (3),
254 .BR mq_receive (3),
255 .BR mq_send (3),
256 .BR mq_unlink (3),
257 .BR mq_overview (7)