.\" Updated 2008-08-09, Akihiro MOTOKI, LDP v3.05
.\" Updated 2013-05-01, Akihiro MOTOKI <amotoki@gmail.com>
.\"
-.TH MSGOP 2 2014\-03\-17 Linux "Linux Programmer's Manual"
+.TH MSGOP 2 2014\-05\-16 Linux "Linux Programmer's Manual"
.SH 名前
msgrcv, msgsnd \- System V メッセージキュー操作
.SH 書式
\fB int \fP\fImsgflg\fP\fB);\fP
.fi
.SH 説明
-システムコール \fBmsgsnd\fP() と \fBmsgrcv\fP() はそれぞれ、 System V メッセージ・キューへのメッセージの送信と、
+システムコール \fBmsgsnd\fP() と \fBmsgrcv\fP() はそれぞれ、 System\ V メッセージ・キューへのメッセージの送信と、
メッセージの受信に使用される。呼び出し元プロセスは、 メッセージを送信するためにはメッセージ・キューに対する書き込み許可を、
メッセージを受信するためには読み出し許可を持っていなければならない。
.PP
\fBmsgsnd\fP() システムコールは \fImsgp\fP 引き数で指定されたメッセージのコピーを \fImsqid\fP
で指定された識別子を持つメッセージ・キューへ追加する。
.PP
-キューに十分な空き容量がある場合、 \fBmsgsnd\fP() は直ちに成功する。 (キューの容量は、メッセージ・キューのデータ構造体の
-\fImsg_qbytes\fP フィールドで定義される。 キュー作成時にこのフィールドは \fBMSGMNB\fP に初期化されるが、この制限は
-\fBmsgctl\fP(2) を使って変更できる。) キューに十分な空き容量がない場合、 デフォルトでは \fBmsgsnd\fP()
-は空き容量ができるまで停止 (block) する。 \fImsgflg\fP に \fBIPC_NOWAIT\fP が指定された場合は、エラー \fBEAGAIN\fP
-で失敗する。
+If sufficient space is available in the queue, \fBmsgsnd\fP() succeeds
+immediately. The queue capacity is governed by the \fImsg_qbytes\fP field in
+the associated data structure for the message queue. During queue creation
+this field is initialized to \fBMSGMNB\fP bytes, but this limit can be modified
+using \fBmsgctl\fP(2). A message queue is considered to be full if either of
+the following conditions is true:
+.IP * 2
+Adding a new message to the queue would cause the total number of bytes in
+the queue to exceed the queue's maximum size (the \fImsg_qbytes\fP field).
+.IP *
+Adding another message to the queue would cause the total number of messages
+in the queue to exceed the queue's maximum size (the \fImsg_qbytes\fP field).
+This check is necessary to prevent an unlimited number of zero\-length
+messages being placed on the queue. Although such messages contain no data,
+they nevertheless consume (locked) kernel memory.
+.PP
+If insufficient space is available in the queue, then the default behavior
+of \fBmsgsnd\fP() is to block until space becomes available. If \fBIPC_NOWAIT\fP
+is specified in \fImsgflg\fP, then the call instead fails with the error
+\fBEAGAIN\fP.
停止している \fBmsgsnd\fP() は以下の場合にも失敗する。
.IP * 2
のインクルードは必要ない。しかしながら、いくつかの古い実装ではこれらのヘッダファイルのインクルードが必要であり、 SVID
でもこれらのインクルードをするように記載されている。このような古いシステムへの移植性を意図したアプリケーションではこれらのファイルをインクルードする必要があるかもしれない。
-\fImsgp\fP 引き数は、 libc4, libc5, glibc 2.0, glibc 2.1 では \fIstruct msgbuf *\fP
-と宣言されている。glibc 2.2 以降では、 SUSv2 と SUSv3 の要求通り、\fIvoid *\fP と宣言されている。
+\fImsgp\fP 引き数は、 libc4, libc5, glibc 2.0, glibc 2.1 では \fIstruct msgbuf\ *\fP
+と宣言されている。glibc 2.2 以降では、 SUSv2 と SUSv3 の要求通り、\fIvoid\ *\fP と宣言されている。
以下は \fBmsgsnd\fP システムコールに影響するシステム制限である:
.TP
経由で読み出したり変更したりできる)。
.TP
\fBMSGMNB\fP
-バイト単位でのメッセージ・キューのデフォルトの最大サイズ : 16384 バイト。 (Linux では、この制限値は
-\fI/proc/sys/kernel/msgmnb\fP 経由で読み出したり変更したりできる)。 スーパーユーザーは \fBmsgctl\fP(2)
-システムコールでメッセージ・キューのサイズを \fBMSGMNB\fP よりも大きい値に増やすことができる。
+Default maximum size in bytes of a message queue: 16384 bytes (on Linux,
+this limit can be read and modified via \fI/proc/sys/kernel/msgmnb\fP). A
+privileged process (Linux: a process with the \fBCAP_SYS_RESOURCE\fP
+capability) can increase the size of a message queue beyond \fBMSGMNB\fP by a
+\fBmsgctl\fP(2) system call.
.PP
-現在の実装では、システム全体のメッセージ・ヘッダーの最大数 (\fBMSGTQL\fP) と、システム全体のメッセージ・プールの最大バイト数
-(\fBMSGPOOL\fP) に関して実装依存の制限はない。
+The implementation has no intrinsic system\-wide limits on the number of
+message headers (\fBMSGTQL\fP) and the number of bytes in the message pool
+(\fBMSGPOOL\fP).
.SH バグ
.\" FIXME http://marc.info/?l=linux-kernel&m=139048542803605&w=2
.\" commit 4f87dac386cc43d5525da7a939d4b4e7edbea22c
\fBmsgctl\fP(2), \fBmsgget\fP(2), \fBcapabilities\fP(7), \fBmq_overview\fP(7),
\fBsvipc\fP(7)
.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.67 の一部
である。プロジェクトの説明とバグ報告に関する情報は
http://www.kernel.org/doc/man\-pages/ に書かれている。