\fBssize_t recvmsg(int \fP\fIsockfd\fP\fB, struct msghdr *\fP\fImsg\fP\fB, int \fP\fIflags\fP\fB);\fP
.fi
.SH 説明
-The \fBrecv\fP(), \fBrecvfrom\fP(), and \fBrecvmsg\fP() calls are used to receive
-messages from a socket. They may be used to receive data on both
-connectionless and connection\-oriented sockets. This page first describes
-common features of all three system calls, and then describes the
-differences between the calls.
+\fBrecv\fP(), \fBrecvfrom\fP(), \fBrecvmsg\fP() コールは、 ソケットからメッセージを受け取るのに使用される。
+これらはコネクションレス型のソケットにも接続指向 (connection\-oriened) 型のソケットにも使用できる。 このページでは、まずこれら 3
+つのシステムコールすべてに共通の機能について説明し、 システムコール間の違いについて説明する。
.PP
これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、
メッセージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。
.PP
アプリケーションは \fBselect\fP(2), \fBpoll\fP(2), \fBepoll\fP(7)
を使って、ソケットにさらにデータが到着しているかを判定することができる。
-.SS "The flags argument"
+.SS フラグ引き数
\fIflags\fP 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指定する:
.TP
\fBMSG_CMSG_CLOEXEC\fP (\fBrecvmsg\fP() のみ; Linux 2.6.23)
このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) するよう要求する。 但し、シグナルを受信したり、エラーや切断
(disconnect) が発生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よりデータが少なくても返ることがある。
.SS recvfrom()
-\fBrecvfrom\fP() places the received message into the buffer \fIbuf\fP. The
-caller must specify the size of the buffer in \fIlen\fP.
+\fBrecvfrom\fP() は受信したメッセージをバッファ \fIbuf\fP に格納する。 呼び出し元はバッファサイズを \fIlen\fP
+で指定しなければならない。
.\" (Note: for datagram sockets in both the UNIX and Internet domains,
.\" .I src_addr
.\" filled in for stream sockets in the Internet domain.)
.\" [The above notes on AF_UNIX and AF_INET sockets apply as at
.\" Kernel 2.4.18. (MTK, 22 Jul 02)]
-If \fIsrc_addr\fP is not NULL, and the underlying protocol provides the source
-address of the message, that source address is placed in the buffer pointed
-to by \fIsrc_addr\fP. In this case, \fIaddrlen\fP is a value\-result argument.
-Before the call, it should be initialized to the size of the buffer
-associated with \fIsrc_addr\fP. Upon return, \fIaddrlen\fP is updated to contain
-the actual size of the source address. The returned address is truncated if
-the buffer provided is too small; in this case, \fIaddrlen\fP will return a
-value greater than was supplied to the call.
+\fIsrc_addr\fP が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが分かる場合、 この送信元アドレスが \fIsrc_addr\fP
+が指すバッファに格納される。 この場合、 \fIaddrlen\fP は入出力両用の引き数となる。 呼び出し前に、呼び出し元は \fIsrc_addr\fP
+に割り当てたバッファの大きさで初期化しておくべきである。 返ってくる時には、 \fIaddrlen\fP
+は送信元アドレスの実際の大きさに変更される。渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められる。この場合には、
+\fIaddrlen\fP では、呼び出し時に渡された値よりも大きな値が返される。
.\"
-If the caller is not interested in the source address, \fIsrc_addr\fP should be
-specified as NULL and \fIaddrlen\fP should be specified as 0.
+呼び出し元が送信元アドレスを必要としない場合は、 \fIsrc_addr\fP には NULL を指定し、 \fIaddrlen\fP には 0
+を指定すべきである。
.SS recv()
\fBrecv\fP() コールは通常 \fI接続済みの (connected)\fP ソケットに対してのみ使用される (\fBconnect\fP(2)
参照)。次の呼び出しと等価である。
ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、
返り値は 0 (昔ながらの "end\-of\-file" の戻り値) となる。
-Datagram sockets in various domains (e.g., the UNIX and Internet domains)
-permit zero\-length datagrams. When such a datagram is received, the return
-value is 0.
+いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメインなど) では、長さ 0 のデータグラムが送信できる。
+このようなデータグラムを受信した場合、 返り値は 0 となる。
-The value 0 may also be returned if the requested number of bytes to receive
-from a stream socket was 0.
+ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返される。
.SH エラー
これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコル・モジュールで生成され、 返されるかもしれない。
それらのマニュアルを参照すること。
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2014-04-13 10:27+0900\n"
-"PO-Revision-Date: 2014-04-14 23:24+0900\n"
+"PO-Revision-Date: 2014-04-17 13:02+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
#. type: Plain text
#: build/C/man2/recv.2:70
-#, fuzzy
-#| msgid ""
-#| "The B<recvfrom>() and B<recvmsg>() calls are used to receive messages "
-#| "from a socket, and may be used to receive data on a socket whether or not "
-#| "it is connection-oriented."
msgid ""
"The B<recv>(), B<recvfrom>(), and B<recvmsg>() calls are used to receive "
"messages from a socket. They may be used to receive data on both "
"connectionless and connection-oriented sockets. This page first describes "
"common features of all three system calls, and then describes the "
"differences between the calls."
-msgstr ""
-"B<recvfrom>() と B<recvmsg>() コールは、ソケットからメッセージを受け取るの"
-"に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
-"接続指向 (connection-oriened) であってもなくてもよい。"
+msgstr "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 (connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら 3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違いについて説明する。"
#. type: Plain text
#: build/C/man2/recv.2:76
#: build/C/man2/recv.2:93
#, no-wrap
msgid "The flags argument"
-msgstr ""
+msgstr "フラグ引き数"
#. type: Plain text
#: build/C/man2/recv.2:97
msgid ""
"B<recvfrom>() places the received message into the buffer I<buf>. The "
"caller must specify the size of the buffer in I<len>."
-msgstr ""
+msgstr "B<recvfrom>() は受信したメッセージをバッファ I<buf> に格納する。 呼び出し元はバッファサイズを I<len> で指定しなければならない。"
#. (Note: for datagram sockets in both the UNIX and Internet domains,
#. .I src_addr
#. Kernel 2.4.18. (MTK, 22 Jul 02)]
#. type: Plain text
#: build/C/man2/recv.2:279
-#, fuzzy
-#| msgid ""
-#| "If I<src_addr> is not NULL, and the underlying protocol provides the "
-#| "source address, this source address is filled in. When I<src_addr> is "
-#| "NULL, nothing is filled in; in this case, I<addrlen> is not used, and "
-#| "should also be NULL. The argument I<addrlen> is a value-result argument, "
-#| "which the caller should initialize before the call to the size of the "
-#| "buffer associated with I<src_addr>, and modified on return to indicate "
-#| "the actual size of the source address. The returned address is truncated "
-#| "if the buffer provided is too small; in this case, I<addrlen> will return "
-#| "a value greater than was supplied to the call."
msgid ""
"If I<src_addr> is not NULL, and the underlying protocol provides the source "
"address of the message, that source address is placed in the buffer pointed "
"the actual size of the source address. The returned address is truncated if "
"the buffer provided is too small; in this case, I<addrlen> will return a "
"value greater than was supplied to the call."
-msgstr ""
-"I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
-"I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
-"合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
-"き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
-"る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
-"期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
-"される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
-"詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
-"な値が返される。"
+msgstr "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが分かる場合、 この送信元アドレスが I<src_addr> が指すバッファに格納される。 この場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元は I<src_addr> に割り当てたバッファの大きさで初期化しておくべきである。 返ってくる時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返される。"
#. type: Plain text
#: build/C/man2/recv.2:286
msgid ""
"If the caller is not interested in the source address, I<src_addr> should be "
"specified as NULL and I<addrlen> should be specified as 0."
-msgstr ""
+msgstr "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> には NULL を指定し、 I<addrlen> には 0 を指定すべきである。"
#. type: SS
#: build/C/man2/recv.2:286
"Datagram sockets in various domains (e.g., the UNIX and Internet domains) "
"permit zero-length datagrams. When such a datagram is received, the return "
"value is 0."
-msgstr ""
+msgstr "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメインなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受信した場合、 返り値は 0 となる。"
#. type: Plain text
#: build/C/man2/recv.2:416
msgid ""
"The value 0 may also be returned if the requested number of bytes to receive "
"from a stream socket was 0."
-msgstr ""
+msgstr "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返される。"
#. type: Plain text
#: build/C/man2/recv.2:421
"The I<timeout> argument specifies the interval that B<select>() should "
"block waiting for a file descriptor to become ready. The call will block "
"until either:"
-msgstr ""
+msgstr "I<timeout> 引き数は、 B<select>() がファイルディスクリプタが ready になるのを待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
#. type: IP
#: build/C/man2/select.2:166 build/C/man2/select.2:168
#. type: Plain text
#: build/C/man2/select.2:168
msgid "a file descriptor becomes ready;"
-msgstr ""
+msgstr "ファイルディスクリプタが利用可能になる。"
#. type: Plain text
#: build/C/man2/select.2:170
-#, fuzzy
-#| msgid ""
-#| "The system call was interrupted by a signal that was caught; see B<signal>"
-#| "(7)."
msgid "the call is interrupted by a signal handler; or"
-msgstr ""
-"捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7) 参照。"
+msgstr "システムコールがシグナルハンドラにより割り込まれた。"
#. type: Plain text
#: build/C/man2/select.2:172
#. type: Plain text
#: build/C/man2/select.2:189
-#, fuzzy
-#| msgid ""
-#| "The I<timeout> argument specifies the interval that B<select>() should "
-#| "block waiting for a file descriptor to become ready. This interval will "
-#| "be rounded up to the system clock granularity, and kernel scheduling "
-#| "delays mean that the blocking interval may overrun by a small amount. If "
-#| "both fields of the I<timeval> structure are zero, then B<select>() "
-#| "returns immediately. (This is useful for polling.) If I<timeout> is "
-#| "NULL (no timeout), B<select>() can block indefinitely."
msgid ""
"Note that the I<timeout> interval will be rounded up to the system clock "
"granularity, and kernel scheduling delays mean that the blocking interval "
"are zero, then B<select>() returns immediately. (This is useful for "
"polling.) If I<timeout> is NULL (no timeout), B<select>() can block "
"indefinitely."
-msgstr ""
-"I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
-"B<select>() が停止する停止時間を指定する\n"
-"(この停止時間はシステムクロックの粒度に切り上げられ、\n"
-"カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
-"I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
-"帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
-"I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
-"期限に停止 (block) する。"
+msgstr "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰する (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) する。"
#. type: Plain text
#: build/C/man2/select.2:199
#. type: Plain text
#: build/C/man2/select.2:317
-#, fuzzy
-#| msgid ""
-#| "On success, B<select>() and B<pselect>() return the number of file "
-#| "descriptors contained in the three returned descriptor sets (that is, the "
-#| "total number of bits that are set in I<readfds>, I<writefds>, "
-#| "I<exceptfds>) which may be zero if the timeout expires before anything "
-#| "interesting happens. On error, -1 is returned, and I<errno> is set "
-#| "appropriately; the sets and I<timeout> become undefined, so do not rely "
-#| "on their contents after an error."
msgid ""
"On success, B<select>() and B<pselect>() return the number of file "
"descriptors contained in the three returned descriptor sets (that is, the "
"happens. On error, -1 is returned, and I<errno> is set to indicate the "
"error; the file descriptor sets are unmodified, and I<timeout> becomes "
"undefined."
-msgstr ""
-"成功した場合、 B<select>() と B<pselect>() は更新された 3 つのディスクリプ"
-"タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
-"I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
-"らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
-"ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
-"義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
+msgstr "成功した場合、 B<select>() と B<pselect>() は更新された 3 つのディスクリプタ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こらずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラーならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディスクリプタ集合は変更されず、 I<timeout> は不定となる。"
#. type: Plain text
#: build/C/man2/select.2:323
#. type: TH
#: build/C/man2/select_tut.2:32
-#, fuzzy, no-wrap
-#| msgid "2013-09-04"
+#, no-wrap
msgid "2013-12-30"
-msgstr "2013-09-04"
+msgstr "2013-12-30"
#. type: Plain text
#: build/C/man2/select_tut.2:52
#. type: Plain text
#: build/C/man2/select_tut.2:584
-#, fuzzy, no-wrap
-#| msgid ""
-#| " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
-#| " perror(\"socket\");\n"
-#| " return -1;\n"
-#| " }\n"
-#| " yes = 1;\n"
-#| " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
-#| " &yes, sizeof(yes)) == -1) {\n"
-#| " perror(\"setsockopt\");\n"
-#| " close(s);\n"
-#| " return -1;\n"
-#| " }\n"
-#| " memset(&a, 0, sizeof(a));\n"
-#| " a.sin_port = htons(listen_port);\n"
-#| " a.sin_family = AF_INET;\n"
-#| " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
-#| " perror(\"bind\");\n"
-#| " close(s);\n"
-#| " return -1;\n"
-#| " }\n"
-#| " printf(\"accepting connections on port %d\\en\", listen_port);\n"
-#| " listen(s, 10);\n"
-#| " return s;\n"
-#| "}\n"
+#, no-wrap
msgid ""
" s = socket(AF_INET, SOCK_STREAM, 0);\n"
" if (s == -1) {\n"
#. type: Plain text
#: build/C/man2/select_tut.2:597
-#, fuzzy, no-wrap
-#| msgid ""
-#| " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
-#| " perror(\"socket\");\n"
-#| " close(s);\n"
-#| " return -1;\n"
-#| " }\n"
+#, no-wrap
msgid ""
" s = socket(AF_INET, SOCK_STREAM, 0);\n"
" if (s == -1) {\n"
" return -1;\n"
" }\n"
msgstr ""
-" if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
+" s = socket(AF_INET, SOCK_STREAM, 0);\n"
+" if (s == -1) {\n"
" perror(\"socket\");\n"
" close(s);\n"
" return -1;\n"
#. type: TH
#: build/C/man2/send.2:40
-#, fuzzy, no-wrap
-#| msgid "2012-12-14"
+#, no-wrap
msgid "2013-12-12"
-msgstr "2012-12-14"
+msgstr "2013-12-12"
#. type: Plain text
#: build/C/man2/send.2:43
#. type: TP
#: build/C/man2/send.2:166
-#, fuzzy, no-wrap
-#| msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
+#, no-wrap
msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
#. type: TP
#: build/C/man2/send.2:203
-#, fuzzy, no-wrap
-#| msgid "B<MSG_MORE> (Since Linux 2.4.4)"
+#, no-wrap
msgid "B<MSG_MORE> (since Linux 2.4.4)"
msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
#. type: Plain text
#: build/C/man2/send.2:280
-#, fuzzy
-#| msgid ""
-#| "On success, these calls return the number of characters sent. On error, "
-#| "-1 is returned, and I<errno> is set appropriately."
msgid ""
"On success, these calls return the number of bytes sent. On error, -1 is "
"returned, and I<errno> is set appropriately."
#. type: TH
#: build/C/man3/sockatmark.3:25
-#, fuzzy, no-wrap
-#| msgid "2007-12-28"
+#, no-wrap
msgid "2014-02-28"
-msgstr "2007-12-28"
+msgstr "2014-02-28"
#. type: Plain text
#: build/C/man3/sockatmark.3:28
#. type: Plain text
#: build/C/man2/socket.2:152
-#, fuzzy
-#| msgid ""
-#| "Some socket types may not be implemented by all protocol families; for "
-#| "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
msgid "Some socket types may not be implemented by all protocol families."
-msgstr ""
-"ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
-"例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
+msgstr "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。"
#. type: Plain text
#: build/C/man2/socket.2:160
#: build/C/man7/socket.7:56
#, no-wrap
msgid "2014-02-21"
-msgstr ""
+msgstr "2014-02-21"
#. type: Plain text
#: build/C/man7/socket.7:59
#. type: Plain text
#: build/C/man7/socket.7:82
-#, fuzzy
-#| msgid ""
-#| "This manual page describes the Linux networking socket layer user "
-#| "interface. The BSD compatible sockets are the uniform interface between "
-#| "the user process and the network protocol stacks in the kernel. The "
-#| "protocol modules are grouped into I<protocol families> like B<AF_INET>, "
-#| "B<AF_IPX>, B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or "
-#| "B<SOCK_DGRAM>. See B<socket>(2) for more information on families and "
-#| "types."
msgid ""
"This manual page describes the Linux networking socket layer user "
"interface. The BSD compatible sockets are the uniform interface between the "
#. commit ef64a54f6e558155b4f149bb10666b9e914b6c54
#. type: Plain text
#: build/C/man7/socket.7:456
-#, fuzzy
-#| msgid ""
-#| "This option, which is currently supported only for B<unix>(7) sockets, "
-#| "sets the value of the \"peek offset\" for the B<recv(2)> system call when "
-#| "used with B<MSG_PEEK> flag."
msgid ""
"This option, which is currently supported only for B<unix>(7) sockets, sets "
"the value of the \"peek offset\" for the B<recv>(2) system call when used "
#. type: Plain text
#: build/C/man7/socket.7:464
-#, fuzzy
-#| msgid ""
-#| "When this option is set to a negative value (it is set to -1 for all new "
-#| "sockets), traditional behavior is provided: B<recv(2)> with the "
-#| "B<MSG_PEEK> flag will peek data from the front of the queue."
msgid ""
"When this option is set to a negative value (it is set to -1 for all new "
"sockets), traditional behavior is provided: B<recv>(2) with the B<MSG_PEEK> "