From: Akihiro MOTOKI Date: Thu, 17 Apr 2014 04:03:20 +0000 (+0900) Subject: (split) LDP: Update translation (socket) X-Git-Tag: LDP-3.63-final X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=refs%2Ftags%2FLDP-3.63-final;p=linuxjm%2FLDP_man-pages.git (split) LDP: Update translation (socket) --- diff --git a/draft/man2/recv.2 b/draft/man2/recv.2 index c7ed629d..8603334c 100644 --- a/draft/man2/recv.2 +++ b/draft/man2/recv.2 @@ -80,11 +80,9 @@ recv, recvfrom, recvmsg \- ソケットからメッセージを受け取る \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 これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。 @@ -96,7 +94,7 @@ differences between the calls. .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) @@ -180,8 +178,8 @@ Internet ストリームソケットでの利用については \fBtcp\fP(7) このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (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 @@ -191,18 +189,15 @@ caller must specify the size of the buffer in \fIlen\fP. .\" 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) 参照)。次の呼び出しと等価である。 @@ -282,12 +277,10 @@ struct cmsghdr { ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、 返り値は 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 エラー これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照すること。 diff --git a/draft/man2/select.2 b/draft/man2/select.2 index b007b942..71b3923c 100644 --- a/draft/man2/select.2 +++ b/draft/man2/select.2 @@ -129,22 +129,19 @@ glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参 .PP \fInfds\fP は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したものである。 .PP -The \fItimeout\fP argument specifies the interval that \fBselect\fP() should -block waiting for a file descriptor to become ready. The call will block -until either: +\fItimeout\fP 引き数は、 \fBselect\fP() がファイルディスクリプタが ready になるのを待って停止する時間を指定する。 +呼び出しは以下のいずれかになるまで停止する。 .IP * 3 -a file descriptor becomes ready; +ファイルディスクリプタが利用可能になる。 .IP * -the call is interrupted by a signal handler; or +システムコールがシグナルハンドラにより割り込まれた。 .IP * タイムアウト時間が満了した。 .PP -Note that the \fItimeout\fP 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 \fItimeval\fP structure -are zero, then \fBselect\fP() returns immediately. (This is useful for -polling.) If \fItimeout\fP is NULL (no timeout), \fBselect\fP() can block -indefinitely. +この \fItimeout\fP 時間はシステムクロックの粒度に切り上げられ、 +カーネルのスケジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 \fItimeval\fP 構造体の両方のフィールドが 0 の場合、 +\fBselect\fP() はすぐに復帰する (この機能はポーリング (polling) を行うのに便利である)。 \fItimeout\fP に NULL +(タイムアウトなし) が指定されると、 \fBselect\fP() は無期限に停止 (block) する。 .PP \fIsigmask\fP は、シグナルマスク (\fBsigprocmask\fP(2) を参照) へのポインタである。 \fIsigmask\fP が NULL でない場合、 \fBpselect\fP() は \fIsigmask\fP が指しているシグナルマスクで現在のシグナルマスクを置き換えてから、 "select" @@ -210,13 +207,10 @@ Linux では、 \fBselect\fP() は \fItimeout\fP を変更し、残りの停止 構造体を初期化せずにそのまま再利用して \fBselect\fP() を複数回行なっているコードを Linux へ移植する場合にも、問題が起こる。 \fBselect\fP() から復帰した後は \fItimeout\fP は未定義であると考えるべきである。 .SH 返り値 -On success, \fBselect\fP() and \fBpselect\fP() return the number of file -descriptors contained in the three returned descriptor sets (that is, the -total number of bits that are set in \fIreadfds\fP, \fIwritefds\fP, \fIexceptfds\fP) -which may be zero if the timeout expires before anything interesting -happens. On error, \-1 is returned, and \fIerrno\fP is set to indicate the -error; the file descriptor sets are unmodified, and \fItimeout\fP becomes -undefined. +成功した場合、 \fBselect\fP() と \fBpselect\fP() は更新された 3 つのディスクリプタ集合に含まれている +ファイルディスクリプタの数 (つまり、 \fIreadfds\fP, \fIwritefds\fP, \fIexceptfds\fP 中の 1 になっているビットの総数) +を返す。 何も起こらずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラーならば \-1 を返し、 \fIerrno\fP +にエラーを示す値が設定される; ファイルディスクリプタ集合は変更されず、 \fItimeout\fP は不定となる。 .SH エラー .TP \fBEBADF\fP diff --git a/draft/man2/select_tut.2 b/draft/man2/select_tut.2 index 70005caa..553ccb4b 100644 --- a/draft/man2/select_tut.2 +++ b/draft/man2/select_tut.2 @@ -352,8 +352,7 @@ listen_socket(int listen_port) int s; int yes; - s = socket(AF_INET, SOCK_STREAM, 0); - if (s == \-1) { + if ((s = socket(AF_INET, SOCK_STREAM, 0)) == \-1) { perror("socket"); return \-1; } diff --git a/draft/man2/send.2 b/draft/man2/send.2 index 9d7278f3..47d51c2f 100644 --- a/draft/man2/send.2 +++ b/draft/man2/send.2 @@ -109,7 +109,7 @@ NULL と 0 でない場合は \fBEISCONN\fP エラーも返される)。 また .\" FIXME ? document MSG_PROXY (which went away in 2.3.15) \fIflags\fP 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったものを指定する。 .TP -\fBMSG_CONFIRM\fP (since Linux 2.3.15) +\fBMSG_CONFIRM\fP (Linux 2.3.15 以降) 転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャスト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 \fBSOCK_DGRAM\fP と \fBSOCK_RAW\fP のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装されている。 詳しくは \fBarp\fP(7) 参照のこと。 @@ -126,7 +126,7 @@ NULL と 0 でない場合は \fBEISCONN\fP エラーも返される)。 また \fBMSG_EOR\fP (Linux 2.2 以降) レコードの終了を指示する (\fBSOCK_SEQPACKET\fP のようにこの概念に対応しているソケット種別のときに有効)。 .TP -\fBMSG_MORE\fP (since Linux 2.4.4) +\fBMSG_MORE\fP (Linux 2.4.4 以降) 呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとともに使用され、 \fBTCP_CORK\fP ソケットオプションと同じ効果が得られる (\fBtcp\fP(7) を参照)。 \fBTCP_CORK\fP との違いは、このフラグを使うと呼び出し単位で この機能を有効にできる点である。 @@ -168,8 +168,7 @@ struct msghdr { カーネルが処理できる制御バッファのソケットあたりの最大長は、 \fI/proc/sys/net/core/optmem_max\fP の値に制限されている。 \fBsocket\fP(7) を参照。 .SH 返り値 -On success, these calls return the number of bytes sent. On error, \-1 is -returned, and \fIerrno\fP is set appropriately. +成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場合、 \-1 を返し、 \fIerrno\fP を適切に設定にする。 .SH エラー これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、それぞれのマニュアルを参照すること。 diff --git a/draft/man2/socket.2 b/draft/man2/socket.2 index 3e0fb857..53c04828 100644 --- a/draft/man2/socket.2 +++ b/draft/man2/socket.2 @@ -155,7 +155,7 @@ T} \fBSOCK_PACKET\fP 廃止されており新しいプログラムで使用してはいけない。 \fBpacket\fP(7) を参照すること .PP -Some socket types may not be implemented by all protocol families. +ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 .PP Linux 2.6.27 以降では、 \fItype\fP 引数は二つ目の目的にも使用される。 ソケットの型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定することで、 \fBsocket\fP() の振舞いを変更することができる。 diff --git a/draft/man7/socket.7 b/draft/man7/socket.7 index adcf9b76..bd1bf1fa 100644 --- a/draft/man7/socket.7 +++ b/draft/man7/socket.7 @@ -81,13 +81,11 @@ socket \- Linux のソケットインターフェース \fIsockfd\fP\fB = socket(int \fP\fIsocket_family\fP\fB, int \fP\fIsocket_type\fP\fB, int \fP\fIprotocol\fP\fB);\fP .SH 説明 -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 \fIprotocol families\fP such as \fBAF_INET\fP, \fBAF_IPX\fP, -and \fBAF_PACKET\fP, and \fIsocket types\fP such as \fBSOCK_STREAM\fP or -\fBSOCK_DGRAM\fP. See \fBsocket\fP(2) for more information on families and -types. +このマニュアルページは Linux ネットワークのソケット層に対する ユーザインターフェースを記述するものである。 BSD +互換ソケットは、ユーザプロセスとカーネル内部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提供するものである。 +プロトコルモジュールは \fIプロトコルファミリー (protocol familiy)\fP (例: \fBAF_INET\fP, \fBAF_IPX\fP, +\fBAF_PACKET\fP) と \fIソケットタイプ (socket types)\fP (例: \fBSOCK_STREAM\fP, +\fBSOCK_DGRAM\fP) に分類できる。 これらに関するより詳しい情報は \fBsocket\fP(2) を参照のこと。 .SS ソケット層の関数群 これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を 行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。 @@ -289,13 +287,12 @@ struct linger { .TP \fBSO_PEEK_OFF\fP (Linux 3.4 以降) .\" commit ef64a54f6e558155b4f149bb10666b9e914b6c54 -This option, which is currently supported only for \fBunix\fP(7) sockets, sets -the value of the "peek offset" for the \fBrecv\fP(2) system call when used -with \fBMSG_PEEK\fP flag. +\fBMSG_PEEK\fP フラグと一緒に使用された場合 \fBrecv\fP(2) システムコールの "peek offset" +にこのオプションの値が設定される。現在のところ、このオプションは \fBunix\fP(7) ソケットでのみサポートされている。 -When this option is set to a negative value (it is set to \-1 for all new -sockets), traditional behavior is provided: \fBrecv\fP(2) with the \fBMSG_PEEK\fP -flag will peek data from the front of the queue. +このオプションが負の値に設定された場合、従来の動作となる。 つまり \fBMSG_PEEK\fP フラグが指定された \fBrecv\fP(2) +は、キューの先頭のデータに対して peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 +新規のソケットではこのオプションの値は必ず \-1 に設定される。 このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプション値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時に、 "peek offset" がキューから peek 処理されたバイト数だけ加算される。したがって、次の peek diff --git a/po4a/socket/po/ja.po b/po4a/socket/po/ja.po index 8d08ac6c..f3ef9199 100644 --- a/po4a/socket/po/ja.po +++ b/po4a/socket/po/ja.po @@ -7,7 +7,7 @@ msgid "" 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 \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -3168,21 +3168,13 @@ msgstr "BIB<, struct msghdr *>IB<, int >I() and B() 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(), B(), and B() 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() と B() コールは、ソケットからメッセージを受け取るの" -"に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは" -"接続指向 (connection-oriened) であってもなくてもよい。" +msgstr "B(), B(), B() コールは、 ソケットからメッセージを受け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 (connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら 3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違いについて説明する。" #. type: Plain text #: build/C/man2/recv.2:76 @@ -3220,7 +3212,7 @@ msgstr "アプリケーションは B() should " "block waiting for a file descriptor to become ready. The call will block " "until either:" -msgstr "" +msgstr "I 引き数は、 B() 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 structure are zero, then B() can block indefinitely." msgid "" "Note that the I interval will be rounded up to the system clock " "granularity, and kernel scheduling delays mean that the blocking interval " @@ -4620,15 +4578,7 @@ msgid "" "are zero, then B() can block " "indefinitely." -msgstr "" -"I 引き数で、ファイルディスクリプタが ready になるのを待って\n" -"B() はすぐに復\n" -"帰する (この機能はポーリング (polling) を行うのに便利である)。\n" -"I に NULL (タイムアウトなし) が指定されると、 B() はすぐに復帰する (この機能はポーリング (polling) を行うのに便利である)。 I に NULL (タイムアウトなし) が指定されると、 B() and B() 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, I, " -#| "I) which may be zero if the timeout expires before anything " -#| "interesting happens. On error, -1 is returned, and I is set " -#| "appropriately; the sets and I become undefined, so do not rely " -#| "on their contents after an error." msgid "" "On success, B() と B() は更新された 3 つのディスクリプ" -"タ集合に含まれている ファイルディスクリプタの数 (つまり、 I, " -"I, I 中の 1 になっているビットの総数) を返す。 何も起こ" -"らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー" -"ならば -1 を返し、 I に適切な値が設定される; 集合と I は未定" -"義となるので、エラーが起こった後はそれらの内容を信頼してはならない。" +msgstr "成功した場合、 B