2 .\" Hey Emacs! This file is -*- nroff -*- source.
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
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
30 .TH MQ_GETATTR 3 2010-08-29 "Linux" "Linux Programmer's Manual"
33 .\"O mq_getattr, mq_setattr \- get/set message queue attributes
34 mq_getattr, mq_setattr \- メッセージキューの属性を設定/取得する
38 .B #include <mqueue.h>
40 .BI "int mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr );
42 .BI "int mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr ","
43 .BI " struct mq_attr *" oldattr );
46 .\"O Link with \fI\-lrt\fP.
50 .\"O .BR mq_getattr ()
52 .\"O .BR mq_setattr ()
53 .\"O respectively retrieve and modify attributes of the message queue
54 .\"O referred to by the descriptor
61 で参照されるメッセージキューの属性の取得と変更をそれぞれ行う。
63 .\"O .BR mq_getattr ()
66 .\"O structure in the buffer pointed by
68 .\"O This structure is defined as:
74 構造体を格納して返す。この構造体は以下のように定義されている:
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; /* キューに現在入っているメッセージ数 */
93 .\"O field contains flags associated with the open message queue description.
94 .\"O This field is initialized when the queue is created by
96 .\"O The only flag that can appear in this field is
99 フィールドには、オープンメッセージキュー記述 (open message queue
100 description) に関連付けられているフラグが格納される。
112 .\"O fields are set when the message queue is created by
113 .\"O .BR mq_open (3).
119 でメッセージキューが作成される際にセットされる。
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).
128 を使ってキューに入れることができるメッセージ数の上限である。
131 .\"O field is an upper limit on the size of messages
132 .\"O that may be placed on the queue.
134 フィールドは、キューに入れることができるメッセージの
136 .\"O Both of these fields must have a value greater than zero.
139 .\"O files that place ceilings on the values for these fields are described in
140 .\"O .BR mq_open (3).
141 これらのフィールドはどちらも 0 より大きな値でなければならない。
152 .\"O field returns the number of messages currently held in the queue.
154 フィールドはキューに現在格納されているメッセージ数を返す。
156 .\"O .BR mq_setattr ()
157 .\"O sets message queue attributes using information supplied in the
159 .\"O structure pointed to by
166 構造体で与えられた情報を使って、メッセージキューの属性を設定する。
167 .\"O The only attribute that can be modified is the setting of the
171 .\"O The other fields in
183 .\"O field is not NULL,
184 .\"O then the buffer that it points to is used to return an
186 .\"O structure that contains the same information that is returned by
187 .\"O .BR mq_getattr ().
196 .\"O .SH RETURN VALUE
199 .\"O .BR mq_getattr ()
201 .\"O .BR mq_setattr ()
202 .\"O return 0; on error, \-1 is returned, with
204 .\"O set to indicate the error.
209 は 0 を返す。エラーの場合、\-1 を返し、
216 .\"O The descriptor specified in
223 .\"O .I newattr\->mq_flags
224 .\"O contained set bits other than
225 .\"O .BR O_NONBLOCK .
226 .I newattr\->mq_flags
230 .\"O .SH CONFORMING TO
236 .\"O .BR mq_getattr ()
238 .\"O .BR mq_setattr ()
239 .\"O are library functions layered on top of the
240 .\"O .BR mq_getsetattr (2)
247 .BR mq_getsetattr (2)