.\" Copyright 1993 Giorgio Ciucci <giorgio@crcc.it>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" 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.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified Tue Oct 22 16:40:11 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Mon Jul 10 21:09:59 2000 by aeb
.\" Added notes on /proc files
.\" FIXME . Add example programs to this page.
.\"
-.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
-.\" all rights reserved.
-.\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Modified 2000-09-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Updated 2002-11-26, Kentaro Shirakata <argrath@ub32.org>
-.\" Updated 2005-03-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2006-03-05, Akihiro MOTOKI, LDP v2.25
-.\" Updated 2008-08-09, Akihiro MOTOKI, LDP v3.05
+.\"*******************************************************************
.\"
-.\"WORD: message メッセージ
-.\"WORD: operation 操作
-.\"WORD: queue キュー
-.\"WORD: process プロセス
-.\"WORD: catch 捕獲(catch)
-.\"WORD: signal シグナル
-.\"WORD: suspend 停止(suspend)
-.\"WORD: sleep 停止(sleep)
-.\"WORD: block 停止(block)
-.\"WORD: process-ID プロセスID
-.\"WORD: type 型
-.\"WORD: policy 方針
-.\"WORD: super-user スーパー・ユーザー
-.\"WORD: current time 現在時刻
-.\"WORD: implement 実装
+.\" This file was generated with po4a. Translate the source file.
.\"
-.TH MSGOP 2 2008-04-23 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH MSGOP 2 2012\-05\-31 Linux "Linux Programmer's Manual"
.SH 名前
-.\"O msgrcv, msgsnd \- message operations
-msgrcv, msgsnd \- メッセージ操作
-.\"O .SH SYNOPSIS
+msgrcv, msgsnd \- System V メッセージキュー操作
.SH 書式
.nf
-.B #include <sys/types.h>
-.B #include <sys/ipc.h>
-.B #include <sys/msg.h>
+\fB#include <sys/types.h>\fP
+\fB#include <sys/ipc.h>\fP
+\fB#include <sys/msg.h>\fP
.sp
-.BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \
-", int " msgflg );
+\fBint msgsnd(int \fP\fImsqid\fP\fB, const void *\fP\fImsgp\fP\fB, size_t \fP\fImsgsz\fP\fB, int \fP\fImsgflg\fP\fB);\fP
.sp
-.BI "ssize_t msgrcv(int " msqid ", void *" msgp ", size_t " msgsz \
-", long " msgtyp ,
-.BI " int " msgflg );
+\fBssize_t msgrcv(int \fP\fImsqid\fP\fB, void *\fP\fImsgp\fP\fB, size_t \fP\fImsgsz\fP\fB, long \fP\fImsgtyp\fP\fB,\fP
+\fB int \fP\fImsgflg\fP\fB);\fP
.fi
-.\"O .SH DESCRIPTION
.SH 説明
-.\"O The
-.\"O .BR msgsnd ()
-.\"O and
-.\"O .BR msgrcv ()
-.\"O system calls are used, respectively, to send messages to,
-.\"O and receive messages from, a message queue.
-.\"O The calling process must have write permission on the message queue
-.\"O in order to send a message, and read permission to receive a message.
-システムコール
-.BR msgsnd ()
-と
-.BR msgrcv ()
-はそれぞれ、メッセージ・キューへのメッセージの送信と、
-メッセージの受信に使用される。呼び出し元プロセスは、
-メッセージを送信するためにはメッセージ・キューに対する書き込み許可を、
+システムコール \fBmsgsnd\fP() と \fBmsgrcv\fP() はそれぞれ、 System V メッセージ・キューへのメッセージの送信と、
+メッセージの受信に使用される。呼び出し元プロセスは、 メッセージを送信するためにはメッセージ・キューに対する書き込み許可を、
メッセージを受信するためには読み出し許可を持っていなければならない。
.PP
-.\"O The
-.\"O .I msgp
-.\"O argument is a pointer to caller-defined structure
-.\"O of the following general form:
-呼び出し元プロセスは以下に示す構造体を用意し、この構造体への
-ポインタを
-.msgp
-引き数として渡す。
+呼び出し元プロセスは以下に示す構造体を用意し、この構造体への ポインタを \fImsgp\fP 引き数として渡す。
.in +4n
.nf
.fi
.in
.PP
-.\"O The
-.\"O .I mtext
-.\"O field is an array (or other structure) whose size is specified by
-.\"O .IR msgsz ,
-.\"O a nonnegative integer value.
-.I mtext
-フィールドは配列 (または他の構造体) で、その大きさは
-非負の整数である
-.I msgsz
-で指定される。
-.\"O Messages of zero length (i.e., no
-.\"O .I mtext
-.\"O field) are permitted.
-長さ 0 のメッセージ (つまり
-.I mtext
-フィールドがないメッセージ) も認められている。
-.\"O The
-.\"O .I mtype
-.\"O field must have a strictly positive integer value.
-.\"O This value can be
-.\"O used by the receiving process for message selection
-.\"O (see the description of
-.\"O .BR msgrcv ()
-.\"O below).
-.B mtype
-フィールドは厳密に正の整数でなければならない。
-この値は、メッセージを受信するプロセスでメッセージを選択するために
-使用される (下記の
-.BR msgrcv ()
-の説明を参照のこと)。
+\fImtext\fP フィールドは配列 (または他の構造体) で、その大きさは 非負の整数である \fImsgsz\fP で指定される。 長さ 0 のメッセージ
+(つまり \fImtext\fP フィールドがないメッセージ) も認められている。 \fBmtype\fP フィールドは厳密に正の整数でなければならない。
+この値は、メッセージを受信するプロセスでメッセージを選択するために 使用される (下記の \fBmsgrcv\fP() の説明を参照のこと)。
.SS msgsnd()
-.\"O The
-.\"O .BR msgsnd ()
-.\"O system call appends a copy of the message pointed to by
-.\"O .I msgp
-.\"O to the message queue whose identifier is specified
-.\"O by
-.\"O .IR msqid .
-.BR msgsnd ()
-システムコールは
-.I msgp
-引き数で指定されたメッセージのコピーを
-.I msqid
+\fBmsgsnd\fP() システムコールは \fImsgp\fP 引き数で指定されたメッセージのコピーを \fImsqid\fP
で指定された識別子を持つメッセージ・キューへ追加する。
.PP
-.\"O If sufficient space is available in the queue,
-.\"O .BR msgsnd ()
-.\"O succeeds immediately.
-キューに十分な空き容量がある場合、
-.BR msgsnd ()
-は直ちに成功する。
-.\"O (The queue capacity is defined by the
-.\"O .I msg_qbytes
-.\"O field in the associated data structure for the message queue.
-.\"O During queue creation this field is initialized to
-.\"O .B MSGMNB
-.\"O bytes, but this limit can be modified using
-.\"O .BR msgctl (2).)
-(キューの容量は、メッセージ・キューのデータ構造体の
-.I msg_qbytes
-フィールドで定義される。
-キュー作成時にこのフィールドは
-.B MSGMNB
-に初期化されるが、この制限は
-.BR msgctl (2)
-を使って変更できる。)
-.\"O If insufficient space is available in the queue, then the default
-.\"O behavior of
-.\"O .BR msgsnd ()
-.\"O is to block until space becomes available.
-キューに十分な空き容量がない場合、
-デフォルトでは
-.BR msgsnd ()
-は空き容量ができるまで停止 (block) する。
-.\"O If
-.\"O .B IPC_NOWAIT
-.\"O is specified in
-.\"O .IR msgflg ,
-.\"O then the call instead fails with the error
-.\"O .BR EAGAIN .
-.I msgflg
-に
-.B IPC_NOWAIT
-が指定された場合は、エラー
-.B EAGAIN
+キューに十分な空き容量がある場合、 \fBmsgsnd\fP() は直ちに成功する。 (キューの容量は、メッセージ・キューのデータ構造体の
+\fImsg_qbytes\fP フィールドで定義される。 キュー作成時にこのフィールドは \fBMSGMNB\fP に初期化されるが、この制限は
+\fBmsgctl\fP(2) を使って変更できる。) キューに十分な空き容量がない場合、 デフォルトでは \fBmsgsnd\fP()
+は空き容量ができるまで停止 (block) する。 \fImsgflg\fP に \fBIPC_NOWAIT\fP が指定された場合は、エラー \fBEAGAIN\fP
で失敗する。
-.\"O A blocked
-.\"O .BR msgsnd ()
-.\"O call may also fail if:
-停止している
-.BR msgsnd ()
-は以下の場合にも失敗する。
+停止している \fBmsgsnd\fP() は以下の場合にも失敗する。
.IP * 2
-.\"O the queue is removed,
-.\"O in which case the system call fails with
-.\"O .I errno
-.\"O set to
-.\"O .BR EIDRM ;
-.\"O or
-キューが削除された。
-この場合、
-.I errno
-は
-.B EIDRM
-に設定される。
+キューが削除された。 この場合、 \fIerrno\fP は \fBEIDRM\fP に設定される。
.IP *
-.\"O a signal is caught, in which case the system call fails
-.\"O with
-.\"O .I errno
-.\"O set to
-.\"O .BR EINTR ; see
-.\"O .BR signal (7).
-シグナルが捕捉された。
-この場合、
-.I errno
-は
-.BR EINTR
-に設定される。
-.BR signal (7)
-参照。
-.\"O .RB ( msgsnd ()
-.\"O is never automatically restarted after being interrupted by a
-.\"O signal handler, regardless of the setting of the
-.\"O .B SA_RESTART
-.\"O flag when establishing a signal handler.)
-.RB ( msgsnd ()
-は、たとえシグナルハンドラの設定時に
-.B SA_RESTART
-を指定していたとしても、シグナルハンドラによって割り込まれた後で
+シグナルが捕捉された。 この場合、 \fIerrno\fP は \fBEINTR\fP に設定される。 \fBsignal\fP(7) 参照。 (\fBmsgsnd\fP()
+は、たとえシグナルハンドラの設定時に \fBSA_RESTART\fP を指定していたとしても、シグナルハンドラによって割り込まれた後で
自動的に再スタートすることは決してない。)
.PP
-.\"O Upon successful completion the message queue data structure is updated
-.\"O as follows:
-正常に終了した場合、メッセージ・キューのデータ構造体は以下のように
-更新される:
+正常に終了した場合、メッセージ・キューのデータ構造体は以下のように 更新される:
.IP
-.\"O .I msg_lspid
-.\"O is set to the process ID of the calling process.
-.I msg_lspid
-には呼び出し元プロセスのプロセス ID が設定される。
+\fImsg_lspid\fP には呼び出し元プロセスのプロセス ID が設定される。
.IP
-.\"O .I msg_qnum
-.\"O is incremented by 1.
-.I msg_qnum
-は 1 増加する。
+\fImsg_qnum\fP は 1 増加する。
.IP
-.\"O .I msg_stime
-.\"O is set to the current time.
-.I msg_stime
-には現在時刻が設定される。
+\fImsg_stime\fP には現在時刻が設定される。
.SS msgrcv()
-.\"O The
-.\"O .BR msgrcv ()
-.\"O system call removes a message from the queue specified by
-.\"O .I msqid
-.\"O and places it in the buffer
-.\"O pointed to by
-.\"O .IR msgp .
-.BR msgrcv ()
-システムコールは
-.I msqid
-で指定されたキューからメッセージを削除し、
-.I msgp
+\fBmsgrcv\fP() システムコールは \fImsqid\fP で指定されたキューからメッセージを削除し、 \fImsgp\fP
で指定されたバッファにそのメッセージを格納する。
.PP
-.\"O The argument
-.\"O .I msgsz
-.\"O specifies the maximum size in bytes for the member
-.\"O .I mtext
-.\"O of the structure pointed to by the
-.\"O .I msgp
-.\"O argument.
-.I msgsz
-引き数には
-.I msgp
-引き数で指定された構造体の
-.I mtext
-メンバーの最大のバイト数を指定する。
-.\"O If the message text has length greater than
-.\"O .IR msgsz ,
-.\"O then the behavior depends on whether
-.\"O .B MSG_NOERROR
-.\"O is specified in
-.\"O .IR msgflg .
-.\"O If
-.\"O .B MSG_NOERROR
-.\"O is specified, then
-.\"O the message text will be truncated (and the truncated part will be
-.\"O lost); if
-.\"O .B MSG_NOERROR
-.\"O is not specified, then
-.\"O the message isn't removed from the queue and
-.\"O the system call fails returning \-1 with
-.\"O .I errno
-.\"O set to
-.\"O .BR E2BIG .
-メッセージのテキストの長さが
-.I msgsz
-より大きい場合の動作は、
-.I msgflg
-に
-.B MSG_NOERROR
-が指定されているかどうかで決まる。
-.B MSG_NOERROR
-が指定されていれば、メッセージのテキストは切り詰められる
-(切り捨てられた部分は失われる)。
-.B MSG_NOERROR
-が指定されていなければ、メッセージはキューから削除されず、
-システムコールは \-1 を返して失敗し、
-.I errno
-に
-.B E2BIG
-が設定される。
+\fImsgsz\fP 引き数には \fImsgp\fP 引き数で指定された構造体の \fImtext\fP メンバーの最大のバイト数を指定する。
+メッセージのテキストの長さが \fImsgsz\fP より大きい場合の動作は、 \fImsgflg\fP に \fBMSG_NOERROR\fP
+が指定されているかどうかで決まる。 \fBMSG_NOERROR\fP が指定されていれば、メッセージのテキストは切り詰められる
+(切り捨てられた部分は失われる)。 \fBMSG_NOERROR\fP が指定されていなければ、メッセージはキューから削除されず、 システムコールは \-1
+を返して失敗し、 \fIerrno\fP に \fBE2BIG\fP が設定される。
.PP
-.\"O The argument
-.\"O .I msgtyp
-.\"O specifies the type of message requested as follows:
-.I msgtyp
-引き数には要求するメッセージの型を指定する。
-型は以下のように指定する:
+\fImsgtyp\fP 引き数には要求するメッセージの型を指定する。 型は以下のように指定する:
.IP * 2
-.\"O If
-.\"O .I msgtyp
-.\"O is 0,
-.\"O then the first message in the queue is read.
-.I msgtyp
-が 0 ならば、キューの最初にあるメッセージが読み込まれる。
+\fImsgtyp\fP が 0 ならば、キューの最初にあるメッセージが読み込まれる。
.IP *
-.\"O If
-.\"O .I msgtyp
-.\"O is greater than 0,
-.\"O then the first message in the queue of type
-.\"O .I msgtyp
-.\"O is read, unless
-.\"O .B MSG_EXCEPT
-.\"O was specified in
-.\"O .IR msgflg ,
-.\"O in which case
-.\"O the first message in the queue of type not equal to
-.\"O .I msgtyp
-.\"O will be read.
-.I msgtyp
-が 0 より大きい場合、
-.I msgflg
-に
-.B MSG_EXCEPT
-が指定されていなければ、
-.I msgtyp
-型のキューの最初のメッセージが読み込まれる。
-.B MSG_EXCEPT
-が指定された場合は、
-.I msgtyp
+\fImsgtyp\fP が 0 より大きい場合、 \fImsgflg\fP に \fBMSG_EXCEPT\fP が指定されていなければ、 \fImsgtyp\fP
+型のキューの最初のメッセージが読み込まれる。 \fBMSG_EXCEPT\fP が指定された場合は、 \fImsgtyp\fP
型以外のキューの最初のメッセージが読み込まれる。
.IP *
-.\"O If
-.\"O .I msgtyp
-.\"O is less than 0,
-.\"O then the first message in the queue with the lowest type less than or
-.\"O equal to the absolute value of
-.\"O .I msgtyp
-.\"O will be read.
-.I msgtyp
-が 0 より小さければ、
-.I msgtyp
-の絶対値以下で最も小さい型を持つキューの最初のメッセージが読み込まれる。
+\fImsgtyp\fP が 0 より小さければ、 \fImsgtyp\fP の絶対値以下で最も小さい型を持つキューの最初のメッセージが読み込まれる。
.PP
-.\"O The
-.\"O .I msgflg
-.\"O argument is a bit mask constructed by ORing together zero or more
-.\"O of the following flags:
-.I msgflg
-引き数には、以下のフラグを任意の数だけ (0個も可)、これらの OR で指定する:
-.TP
-.B IPC_NOWAIT
-.\"O Return immediately if no message of the requested type is in the queue.
-.\"O The system call fails with
-.\"O .I errno
-.\"O set to
-.\"O .BR ENOMSG .
-キューに要求された型のメッセージがない場合には直ちに返る。
-システムコールは失敗し、
-.I errno
-には
-.B ENOMSG
-が設定される。
-.TP
-.B MSG_EXCEPT
-.\"O Used with
-.\"O .I msgtyp
-.\"O greater than 0
-.\"O to read the first message in the queue with message type that differs
-.\"O from
-.\"O .IR msgtyp .
-0 より大きな
-.I msgtyp
-と一緒に使用して、
-.I msgtyp
-以外のキューの最初のメッセージを読み込む。
-.TP
-.B MSG_NOERROR
-.\"O To truncate the message text if longer than
-.\"O .I msgsz
-.\"O bytes.
-.I msgsz
-バイトよりも長かった場合はメッセージのテキストを切り詰める。
+\fImsgflg\fP 引き数には、以下のフラグを任意の数だけ (0個も可)、これらの OR で指定する:
+.TP
+\fBIPC_NOWAIT\fP
+キューに要求された型のメッセージがない場合には直ちに返る。 システムコールは失敗し、 \fIerrno\fP には \fBENOMSG\fP が設定される。
+.TP
+\fBMSG_EXCEPT\fP
+0 より大きな \fImsgtyp\fP と一緒に使用して、 \fImsgtyp\fP 以外のキューの最初のメッセージを読み込む。
+.TP
+\fBMSG_NOERROR\fP
+\fImsgsz\fP バイトよりも長かった場合はメッセージのテキストを切り詰める。
.PP
-.\"O If no message of the requested type is available and
-.\"O .B IPC_NOWAIT
-.\"O isn't specified in
-.\"O .IR msgflg ,
-.\"O the calling process is blocked until one of the following conditions occurs:
-要求された型のメッセージが存在せず、
-.I msgflg
-に
-.B IPC_NOWAIT
-が指定されていなかった場合、呼び出し元プロセスは
+要求された型のメッセージが存在せず、 \fImsgflg\fP に \fBIPC_NOWAIT\fP が指定されていなかった場合、呼び出し元プロセスは
以下のいずれかの状況になるまで停止 (block) される:
.IP * 2
-.\"O A message of the desired type is placed in the queue.
要求している型のメッセージがキューへ入れられた。
.IP *
-.\"O The message queue is removed from the system.
-.\"O In this case the system call fails with
-.\"O .I errno
-.\"O set to
-.\"O .BR EIDRM .
-メッセージ・キューがシステムから削除された。
-この場合、システムコールは失敗し、
-.I errno
-に
-.B EIDRM
-が設定される。
+メッセージ・キューがシステムから削除された。 この場合、システムコールは失敗し、 \fIerrno\fP に \fBEIDRM\fP が設定される。
.IP *
-.\"O The calling process catches a signal.
-.\"O In this case the system call fails with
-.\"O .I errno
-.\"O set to
-.\"O .BR EINTR .
-呼び出し元プロセスがシグナルを捕獲した。
-この場合、システムコールは失敗し、
-.I errno
-に
-.B EINTR
-が設定される。
-.\"O .RB ( msgrcv ()
-.\"O is never automatically restarted after being interrupted by a
-.\"O signal handler, regardless of the setting of the
-.\"O .B SA_RESTART
-.\"O flag when establishing a signal handler.)
-.RB ( msgrcv ()
-は、たとえシグナルハンドラの設定時に
-.B SA_RESTART
-を指定していたとしても、シグナルハンドラによって割り込まれた後で
-自動的に再スタートすることは決してない。)
+呼び出し元プロセスがシグナルを捕獲した。 この場合、システムコールは失敗し、 \fIerrno\fP に \fBEINTR\fP が設定される。
+(\fBmsgrcv\fP() は、たとえシグナルハンドラの設定時に \fBSA_RESTART\fP
+を指定していたとしても、シグナルハンドラによって割り込まれた後で 自動的に再スタートすることは決してない。)
.PP
-.\"O Upon successful completion the message queue data structure is updated
-.\"O as follows:
-実行に成功した場合、メッセージ・キューのデータ構造体は以下のように
-更新される:
+正常に終了した場合、メッセージ・キューのデータ構造体は以下のように 更新される:
.IP
-.\"O .I msg_lrpid
-.\"O is set to the process ID of the calling process.
-.I msg_lrpid
-には呼び出し元プロセスのプロセス ID が設定される。
+\fImsg_lrpid\fP には呼び出し元プロセスのプロセス ID が設定される。
.IP
-.\"O .I msg_qnum
-.\"O is decremented by 1.
-.I msg_qnum
-は 1 減算される。
+\fImsg_qnum\fP は 1 減算される。
.IP
-.\"O .I msg_rtime
-.\"O is set to the current time.
-.I msg_rtime
-には現在の時刻が設定される。
-.\"O .SH "RETURN VALUE"
+\fImsg_rtime\fP には現在の時刻が設定される。
.SH 返り値
-.\"O On failure both functions return \-1
-.\"O with
-.\"O .I errno
-.\"O indicating the error,
-.\"O otherwise
-.\"O .BR msgsnd ()
-.\"O returns 0
-.\"O and
-.\"O .BR msgrcv ()
-.\"O returns the number of bytes actually copied into the
-.\"O .I mtext
-.\"O array.
-失敗した場合は、どちらの関数も \-1 を返し、エラーを
-.I errno
-に表示する。成功した場合、
-.BR msgsnd ()
-は 0 を返し、
-.BR msgrcv ()
-は
-.I mtext
-配列に実際にコピーしたバイト数を返す。
-.\"O .SH ERRORS
+失敗した場合は、どちらの関数も \-1 を返し、エラーを \fIerrno\fP に表示する。成功した場合、 \fBmsgsnd\fP() は 0 を返し、
+\fBmsgrcv\fP() は \fImtext\fP 配列に実際にコピーしたバイト数を返す。
.SH エラー
-.\"O When
-.\"O .BR msgsnd ()
-.\"O fails,
-.\"O .I errno
-.\"O will be set to one among the following values:
-.BR msgsnd ()
-が失敗した場合、
-.B errno
-に以下の値のいずれかが設定される:
-.TP
-.B EACCES
-.\"O The calling process does not have write permission on the message queue,
-.\"O and does not have the
-.\"O .B CAP_IPC_OWNER
-.\"O capability.
-呼び出し元プロセスにはメッセージ・キューに対する書き込み許可がなく、
-.B CAP_IPC_OWNER
-ケーパビリティもない。
-.TP
-.B EAGAIN
-.\"O The message can't be sent due to the
-.\"O .I msg_qbytes
-.\"O limit for the queue and
-.\"O .B IPC_NOWAIT
-.\"O was specified in
-.\"O .IR msgflg .
-.I msg_qbytes
-がキューの制限を超えていたため、メッセージを送ることができず、かつ
-.I msgflg
-に
-.B IPC_NOWAIT
+\fBmsgsnd\fP() が失敗した場合、 \fBerrno\fP に以下の値のいずれかが設定される:
+.TP
+\fBEACCES\fP
+呼び出し元プロセスにはメッセージ・キューに対する書き込み許可がなく、 \fBCAP_IPC_OWNER\fP ケーパビリティもない。
+.TP
+\fBEAGAIN\fP
+\fImsg_qbytes\fP がキューの制限を超えていたため、メッセージを送ることができず、かつ \fImsgflg\fP に \fBIPC_NOWAIT\fP
が指定されていた。
-.TP
-.B EFAULT
-.\"O The address pointed to by
-.\"O .I msgp
-.\"O isn't accessible.
-.I msgp
-が指しているアドレスがアクセス可能でない。
-.TP
-.B EIDRM
-.\"O The message queue was removed.
+.TP
+\fBEFAULT\fP
+\fImsgp\fP が指しているアドレスがアクセス可能でない。
+.TP
+\fBEIDRM\fP
メッセージ・キューが削除された。
-.TP
-.B EINTR
-.\"O Sleeping on a full message queue condition, the process caught a signal.
-メッセージ・キューが要求した条件を満たすまで停止している時に、
-プロセスがシグナルを捕獲した。
-.TP
-.B EINVAL
-.\"O Invalid
-.\"O .I msqid
-.\"O value, or nonpositive
-.\"O .I mtype
-.\"O value, or
-.\"O invalid
-.\"O .I msgsz
-.\"O value (less than 0 or greater than the system value
-.\"O .BR MSGMAX ).
-.I msqid
-が不適切な値であるか、
-.I mtype
-が正の値でないか、
-.I msgsz
-が不適切な値 (0 以下か、システムで決まる値
-.B MSGMAX
-よりも大きい値) である。
-.TP
-.B ENOMEM
-.\"O The system does not have enough memory to make a copy of the
-.\"O message pointed to by
-.\"O .IR msgp .
-.I msgp
-が指すメッセージのコピーを作成するのに十分なメモリがシステムに存在しない。
+.TP
+\fBEINTR\fP
+メッセージ・キューが要求した条件を満たすまで停止している時に、 プロセスがシグナルを捕獲した。
+.TP
+\fBEINVAL\fP
+\fImsqid\fP が不適切な値であるか、 \fImtype\fP が正の値でないか、 \fImsgsz\fP が不適切な値 (0 以下か、システムで決まる値
+\fBMSGMAX\fP よりも大きい値) である。
+.TP
+\fBENOMEM\fP
+\fImsgp\fP が指すメッセージのコピーを作成するのに十分なメモリがシステムに存在しない。
.PP
-.\"O When
-.\"O .BR msgrcv ()
-.\"O fails,
-.\"O .I errno
-.\"O will be set to one among the following values:
-.BR msgrcv ()
-が失敗した場合には
-.I errno
-に以下の値のいずれかが設定される:
-.TP
-.B E2BIG
-.\"O The message text length is greater than
-.\"O .I msgsz
-.\"O and
-.\"O .B MSG_NOERROR
-.\"O isn't specified in
-.\"O .IR msgflg .
-メッセージのテキストの長さが
-.I msgsz
-よりも大きく、
-.I msgflg
-に
-.B MSG_NOERROR
-が設定されていなかった。
-.TP
-.B EACCES
-.\"O The calling process does not have read permission on the message queue,
-.\"O and does not have the
-.\"O .B CAP_IPC_OWNER
-.\"O capability.
-呼び出し元プロセスにはメッセージ・キューに対する読み込み許可がなく、
-.B CAP_IPC_OWNER
-ケーパビリティもない。
-.TP
-.B EAGAIN
-.\"O No message was available in the queue and
-.\"O .B IPC_NOWAIT
-.\"O was specified in
-.\"O .IR msgflg .
-キューにはメッセージがなく、
-.I msgflg
-に
-.B IPC_NOWAIT
-が指定された。
-.TP
-.B EFAULT
-.\"O The address pointed to by
-.\"O .I msgp
-.\"O isn't accessible.
-.I msgp
-が指しているアドレスがアクセス可能でない。
-.TP
-.B EIDRM
-.\"O While the process was sleeping to receive a message,
-.\"O the message queue was removed.
-メッセージを受信するためにプロセスが停止している間に、
-メッセージ・キューが削除された。
-.TP
-.B EINTR
-.\"O While the process was sleeping to receive a message,
-.\"O the process caught a signal; see
-.\"O .BR signal (7).
-メッセージを受けるためにプロセスが停止している間に、
-プロセスがシグナルを捕獲した。
-.BR signal (7)
-参照。
-.TP
-.B EINVAL
-.\"O .I msgqid
-.\"O was invalid, or
-.\"O .I msgsz
-.\"O was less than 0.
-.I msgqid
-が不正か、
-.I msgsz
-が 0 より小さい。
-.TP
-.B ENOMSG
-.\"O .B IPC_NOWAIT
-.\"O was specified in
-.\"O .I msgflg
-.\"O and no message of the requested type existed on the message queue.
-.I msgflg
-に
-.B IPC_NOWAIT
-が設定されており、
-メッセージ・キューに要求された型のメッセージが存在しなかった。
-.\"O .SH "CONFORMING TO"
+\fBmsgrcv\fP() が失敗した場合には \fIerrno\fP に以下の値のいずれかが設定される:
+.TP
+\fBE2BIG\fP
+メッセージのテキストの長さが \fImsgsz\fP よりも大きく、 \fImsgflg\fP に \fBMSG_NOERROR\fP が設定されていなかった。
+.TP
+\fBEACCES\fP
+呼び出し元プロセスにはメッセージ・キューに対する読み込み許可がなく、 \fBCAP_IPC_OWNER\fP ケーパビリティもない。
+.TP
+\fBEAGAIN\fP
+キューにはメッセージがなく、 \fImsgflg\fP に \fBIPC_NOWAIT\fP が指定された。
+.TP
+\fBEFAULT\fP
+\fImsgp\fP が指しているアドレスがアクセス可能でない。
+.TP
+\fBEIDRM\fP
+メッセージを受信するためにプロセスが停止している間に、 メッセージ・キューが削除された。
+.TP
+\fBEINTR\fP
+メッセージを受けるためにプロセスが停止している間に、 プロセスがシグナルを捕獲した。 \fBsignal\fP(7) 参照。
+.TP
+\fBEINVAL\fP
+\fImsgqid\fP が不正か、 \fImsgsz\fP が 0 より小さい。
+.TP
+\fBENOMSG\fP
+\fImsgflg\fP に \fBIPC_NOWAIT\fP が設定されており、 メッセージ・キューに要求された型のメッセージが存在しなかった。
.SH 準拠
-SVr4, POSIX.1-2001.
-.\"O .SH NOTES
+SVr4, POSIX.1\-2001.
.SH 注意
-.\"O The
-.\"O .I msgp
-.\"O argument is declared as \fIstruct msgbuf *\fP with
-.\"O libc4, libc5, glibc 2.0, glibc 2.1.
-.\"O It is declared as \fIvoid *\fP
-.\"O with glibc 2.2 and later, as required by SUSv2 and SUSv3.
-.I msgp
-引き数は、 libc4, libc5, glibc 2.0, glibc 2.1 では
-\fIstruct msgbuf *\fP と宣言されている。glibc 2.2 以降では、
-SUSv2 と SUSv3 の要求通り、\fIvoid *\fP と宣言されている。
+.\" Like Linux, the FreeBSD man pages still document
+.\" the inclusion of these header files.
+Linux や POSIX の全てのバージョンでは、 \fI<sys/types.h>\fP と \fI<sys/ipc.h>\fP
+のインクルードは必要ない。しかしながら、いくつかの古い実装ではこれらのヘッダファイルのインクルードが必要であり、 SVID
+でもこれらのインクルードをするように記載されている。このような古いシステムへの移植性を意図したアプリケーションではこれらのファイルをインクルードする必要があるかもしれない。
-.\"O The following limits on message queue resources affect the
-.\"O .BR msgsnd ()
-.\"O call:
-以下は
-.B msgsnd
-システムコールに影響するシステム制限である:
-.TP
-.B MSGMAX
-.\"O Maximum size for a message text: 8192 bytes
-.\"O (on Linux, this limit can be read and modified via
-.\"O .IR /proc/sys/kernel/msgmax ).
-メッセージのテキストの最大サイズ: 8192 バイト
-(Linux では、この制限値は
-.I /proc/sys/kernel/msgmax
-経由で読み出したり変更したりできる)。
-.TP
-.B MSGMNB
-.\"O Default maximum size in bytes of a message queue: 16384 bytes
-.\"O (on Linux, this limit can be read and modified via
-.\"O .IR /proc/sys/kernel/msgmnb ).
-.\"O The superuser can increase the size of a message queue beyond
-.\"O .B MSGMNB
-.\"O by a
-.\"O .BR msgctl (2)
-.\"O system call.
-バイト単位でのメッセージ・キューのデフォルトの最大サイズ : 16384 バイト。
-(Linux では、この制限値は
-.I /proc/sys/kernel/msgmnb
+\fImsgp\fP 引き数は、 libc4, libc5, glibc 2.0, glibc 2.1 では \fIstruct msgbuf *\fP
+と宣言されている。glibc 2.2 以降では、 SUSv2 と SUSv3 の要求通り、\fIvoid *\fP と宣言されている。
+
+以下は \fBmsgsnd\fP システムコールに影響するシステム制限である:
+.TP
+\fBMSGMAX\fP
+メッセージのテキストの最大サイズ: 8192 バイト (Linux では、この制限値は \fI/proc/sys/kernel/msgmax\fP
経由で読み出したり変更したりできる)。
-スーパーユーザーは
-.BR msgctl (2)
-ã\82·ã\82¹ã\83\86ã\83 ã\82³ã\83¼ã\83«ã\81§ã\83¡ã\83\83ã\82»ã\83¼ã\82¸ã\83»ã\82ã\83¥ã\83¼ã\81®ã\82µã\82¤ã\82ºã\82\92
-.B MSGMNB
-よりも大きい値に増やすことができる。
+.TP
+\fBMSGMNB\fP
+ã\83\90ã\82¤ã\83\88å\8d\98ä½\8dã\81§ã\81®ã\83¡ã\83\83ã\82»ã\83¼ã\82¸ã\83»ã\82ã\83¥ã\83¼ã\81®ã\83\87ã\83\95ã\82©ã\83«ã\83\88ã\81®æ\9c\80大ã\82µã\82¤ã\82º : 16384 ã\83\90ã\82¤ã\83\88ã\80\82 (Linux ã\81§ã\81¯ã\80\81ã\81\93ã\81®å\88¶é\99\90å\80¤ã\81¯
+\fI/proc/sys/kernel/msgmnb\fP 経由で読み出したり変更したりできる)。 スーパーユーザーは \fBmsgctl\fP(2)
+ã\82·ã\82¹ã\83\86ã\83 ã\82³ã\83¼ã\83«ã\81§ã\83¡ã\83\83ã\82»ã\83¼ã\82¸ã\83»ã\82ã\83¥ã\83¼ã\81®ã\82µã\82¤ã\82ºã\82\92 \fBMSGMNB\fP ã\82\88ã\82\8aã\82\82大ã\81\8dã\81\84å\80¤ã\81«å¢\97ã\82\84ã\81\99ã\81\93ã\81¨ã\81\8cã\81§ã\81\8dã\82\8bã\80\82
.PP
-.\"O The implementation has no intrinsic limits for the system wide maximum
-.\"O number of message headers
-.\"O .RB ( MSGTQL )
-.\"O and for the system wide maximum size in bytes of the message pool
-.\"O .RB ( MSGPOOL ).
-現在の実装では、システム全体のメッセージ・ヘッダーの最大数
-.RB ( MSGTQL )
-と、システム全体のメッセージ・プールの最大バイト数
-.RB ( MSGPOOL )
-に関して実装依存の制限はない。
-.\"O .SH "SEE ALSO"
+現在の実装では、システム全体のメッセージ・ヘッダーの最大数 (\fBMSGTQL\fP) と、システム全体のメッセージ・プールの最大バイト数
+(\fBMSGPOOL\fP) に関して実装依存の制限はない。
.SH 関連項目
-.BR msgctl (2),
-.BR msgget (2),
-.BR capabilities (7),
-.BR mq_overview (7),
-.BR svipc (7)
+\fBmsgctl\fP(2), \fBmsgget\fP(2), \fBcapabilities\fP(7), \fBmq_overview\fP(7),
+\fBsvipc\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。