'\" t .\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 2006 Michael Kerrisk .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. .\" Translated 2006-04-23, Akihiro MOTOKI .\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13 .\" .TH MQ_GETATTR 3 2010-08-29 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O mq_getattr, mq_setattr \- get/set message queue attributes mq_getattr, mq_setattr \- メッセージキューの属性を設定/取得する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int mq_getattr(mqd_t " mqdes ", struct mq_attr *" attr ); .BI "int mq_setattr(mqd_t " mqdes ", struct mq_attr *" newattr "," .BI " struct mq_attr *" oldattr ); .fi .sp .\"O Link with \fI\-lrt\fP. \fI\-lrt\fP でリンクする。 .\"O .SH DESCRIPTION .SH 説明 .\"O .BR mq_getattr () .\"O and .\"O .BR mq_setattr () .\"O respectively retrieve and modify attributes of the message queue .\"O referred to by the descriptor .\"O .IR mqdes . .BR mq_getattr () と .BR mq_setattr () は、記述子 .I mqdes で参照されるメッセージキューの属性の取得と変更をそれぞれ行う。 .\"O .BR mq_getattr () .\"O returns an .\"O .I mq_attr .\"O structure in the buffer pointed by .\"O .IR attr . .\"O This structure is defined as: .BR mq_getattr () は、 .I attr が指すバッファに .I mq_attr 構造体を格納して返す。この構造体は以下のように定義されている: .in +4n .nf struct mq_attr { .\"O long mq_flags; /* Flags: 0 or O_NONBLOCK */ .\"O long mq_maxmsg; /* Max. # of messages on queue */ .\"O long mq_msgsize; /* Max. message size (bytes) */ .\"O long mq_curmsgs; /* # of messages currently in queue */ long mq_flags; /* フラグ: 0 か O_NONBLOCK */ long mq_maxmsg; /* キューの最大メッセージ数 */ long mq_msgsize; /* 最大メッセージサイズ (バイト単位) */ long mq_curmsgs; /* キューに現在入っているメッセージ数 */ }; .fi .in .PP .\"O The .\"O .I mq_flags .\"O field contains flags associated with the open message queue description. .\"O This field is initialized when the queue is created by .\"O .BR mq_open (3). .\"O The only flag that can appear in this field is .\"O .BR O_NONBLOCK . .I mq_flags フィールドには、オープンメッセージキュー記述 (open message queue description) に関連付けられているフラグが格納される。 このフィールドは .BR mq_open (3) でキューが作成される際に初期化される。 このフィールドに現れるフラグは .B O_NONBLOCK だけである。 .\"O The .\"O .I mq_maxmsg .\"O and .\"O .I mq_msgsize .\"O fields are set when the message queue is created by .\"O .BR mq_open (3). .I mq_maxmsg と .I mq_msgsize フィールドは .BR mq_open (3) でメッセージキューが作成される際にセットされる。 .\"O The .\"O .I mq_maxmsg .\"O field is an upper limit on the number of messages .\"O that may be placed on the queue using .\"O .BR mq_send (3). .I mq_maxmsg フィールドは、 .BR mq_send (3) を使ってキューに入れることができるメッセージ数の上限である。 .\"O The .\"O .I mq_msgsize .\"O field is an upper limit on the size of messages .\"O that may be placed on the queue. .I mq_msgsize フィールドは、キューに入れることができるメッセージの 上限サイズである。 .\"O Both of these fields must have a value greater than zero. .\"O Two .\"O .I /proc .\"O files that place ceilings on the values for these fields are described in .\"O .BR mq_open (3). これらのフィールドはどちらも 0 より大きな値でなければならない。 これらのフィールドに設定できる値の上限は .I /proc ファイルにより決まる。 .I /proc ファイルの詳細は .BR mq_open (3) に説明されている。 .\"O The .\"O .I mq_curmsgs .\"O field returns the number of messages currently held in the queue. .I mq_curmsgs フィールドはキューに現在格納されているメッセージ数を返す。 .\"O .BR mq_setattr () .\"O sets message queue attributes using information supplied in the .\"O .I mq_attr .\"O structure pointed to by .\"O .IR newattr . .BR mq_setattr () は、 .I newattr が指す .I mq_attr 構造体で与えられた情報を使って、メッセージキューの属性を設定する。 .\"O The only attribute that can be modified is the setting of the .\"O .B O_NONBLOCK .\"O flag in .\"O .IR mq_flags . .\"O The other fields in .\"O .I newattr .\"O are ignored. 変更することができる属性は、 .I mq_flags の .B O_NONBLOCK フラグの設定だけである。 .I newattr の他のフィールドは無視される。 .\"O If the .\"O .I oldattr .\"O field is not NULL, .\"O then the buffer that it points to is used to return an .\"O .I mq_attr .\"O structure that contains the same information that is returned by .\"O .BR mq_getattr (). .I oldattr フィールドが NULL 以外の場合、 .BR mq_getattr () が返すのと同じ情報を格納した .I mq_attr 構造体を .I oldattr が指すバッファに入れて返す。 .\"O .SH RETURN VALUE .SH 返り値 .\"O On success .\"O .BR mq_getattr () .\"O and .\"O .BR mq_setattr () .\"O return 0; on error, \-1 is returned, with .\"O .I errno .\"O set to indicate the error. 成功すると、 .I mq_getattr () と .I mq_setattr () は 0 を返す。エラーの場合、\-1 を返し、 .I errno にエラーを示す値を設定する。 .\"O .SH ERRORS .SH エラー .TP .B EBADF .\"O The descriptor specified in .\"O .I mqdes .\"O is invalid. .I mqdes で指定された記述子が不正である。 .TP .B EINVAL .\"O .I newattr\->mq_flags .\"O contained set bits other than .\"O .BR O_NONBLOCK . .I newattr\->mq_flags に .B O_NONBLOCK 以外のビットがセットされていた。 .\"O .SH CONFORMING TO .SH 準拠 POSIX.1-2001. .\"O .SH NOTES .SH 注意 .\"O On Linux, .\"O .BR mq_getattr () .\"O and .\"O .BR mq_setattr () .\"O are library functions layered on top of the .\"O .BR mq_getsetattr (2) .\"O system call. Linux では、 .BR mq_getattr () と .BR mq_setattr () はライブラリ関数であり、 .BR mq_getsetattr (2) システムコールを用いて実装されている。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR mq_close (3), .BR mq_notify (3), .BR mq_open (3), .BR mq_receive (3), .BR mq_send (3), .BR mq_unlink (3), .BR mq_overview (7)