EN JA
MQ_GETATTR(2)
MQ_GETATTR(2) FreeBSD System Calls Manual MQ_GETATTR(2)

名称

mq_getattrメッセージキューの属性を取得する (リアルタイム)

ライブラリ

POSIX Real-time Library (librt, -lrt)

書式

#include < mqueue.h>

int
mq_getattr( mqd_t mqdes, struct mq_attr *mqstat);

解説

mq_getattr() システムコールは、メッセージキューの状態情報と属性を取得し、メッセージキュー記述子に関連しているメッセージキューの記述をオープンします。

mqdes 引数は、メッセージキュー記述子を指定します。

結果は、 mqstat 引数によって参照される mq_attr 構造体に返されます。

返るときに、次のメンバは、メッセージキューがオープンされたとき設定され、その後の mq_setattr() 呼び出しで変更される、オープンしているメッセージキュー記述に関連される値があります: mq_flags

メッセージキューの次の属性は、メッセージキューの作成で設定されるように返されます: mq_maxmsg, mq_msgsize

返るときに、 mqstat 引数で参照される mq_attr 構造体中の次のメンバは、メッセージキューの現在の状態に設定されます:

mq_flags
現在のキューのメッセージの数。

戻り値

Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

エラー

mq_getattr() システムコールは、次の場合に失敗します:
[ EBADF]
mqdes 引数が、有効なメッセージキュー記述子ではありません。

規格

mq_getattr() システムコールは、 IEEE Std 1003.1-2004 (“POSIX.1”) に適合しています。

歴史

POSIX メッセージキューのサポートは FreeBSD 7.0 ではじめて登場しました。

COPYRIGHT

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
November 29, 2005 FreeBSD