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

名称

mq_closeメッセージキュー (リアルタイム) をクローズします

ライブラリ

POSIX Real-time Library (librt, -lrt)

書式

#include < mqueue.h>

int
mq_close( mqd_t mqdes);

解説

mq_close() システムコールは、メッセージキュー記述子 mqdes と、そのメッセージキューとの関連を取り除きます。この mq_close() からの返りが成功したの後にメッセージキュー記述子を使用する結果と、その後の mq_open() からのこのメッセージキュー記述子が返るまで、未定義です。

プロセスが、この mqdes を通して通知要求のメッセージキューのアタッチに成功したなら、このアタッチは、取り除かれ、メッセージキューは、別のプロセスが通知のためにアタッチすることができるようになります。

戻り値

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

関連項目

mq_open(2), mq_unlink(2)

規格

mq_close() システムコールは、 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