1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2012-05-28 07:17+0900\n"
10 "PO-Revision-Date: 2012-05-04 03:38+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
19 #: build/C/man2/accept.2:39
25 #: build/C/man2/accept.2:39
31 #: build/C/man2/accept.2:39 build/C/man2/bind.2:66 build/C/man2/connect.2:65
32 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
33 #: build/C/man2/listen.2:43 build/C/man2/recv.2:39 build/C/man2/recvmmsg.2:26
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:30
35 #: build/C/man2/send.2:38 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:23 build/C/man2/socket.2:41
37 #: build/C/man7/socket.7:26 build/C/man2/socketcall.2:26
38 #: build/C/man2/socketpair.2:40
44 #: build/C/man2/accept.2:39 build/C/man2/bind.2:66
45 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
46 #: build/C/man3/getifaddrs.3:33 build/C/man2/getsockname.2:38
47 #: build/C/man2/getsockopt.2:42 build/C/man2/listen.2:43
48 #: build/C/man2/recv.2:39 build/C/man2/recvmmsg.2:26 build/C/man2/select.2:38
49 #: build/C/man2/select_tut.2:30 build/C/man2/send.2:38
50 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:23
51 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
52 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:40
54 msgid "Linux Programmer's Manual"
55 msgstr "Linux Programmer's Manual"
58 #: build/C/man2/accept.2:40 build/C/man2/bind.2:67
59 #: build/C/man3/bindresvport.3:28 build/C/man2/connect.2:66
60 #: build/C/man3/getifaddrs.3:34 build/C/man2/getsockname.2:39
61 #: build/C/man2/getsockopt.2:43 build/C/man2/listen.2:44
62 #: build/C/man2/recv.2:40 build/C/man2/recvmmsg.2:27 build/C/man2/select.2:39
63 #: build/C/man2/select_tut.2:31 build/C/man2/send.2:39
64 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:24
65 #: build/C/man2/socket.2:42 build/C/man7/socket.7:27
66 #: build/C/man2/socketcall.2:27 build/C/man2/socketpair.2:41
72 #: build/C/man2/accept.2:42
73 msgid "accept - accept a connection on a socket"
74 msgstr "accept - ソケットへの接続を受ける"
77 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
78 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:68
79 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:41
80 #: build/C/man2/getsockopt.2:45 build/C/man2/listen.2:46
81 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:29 build/C/man2/select.2:42
82 #: build/C/man2/select_tut.2:34 build/C/man2/send.2:41
83 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:26
84 #: build/C/man2/socket.2:44 build/C/man7/socket.7:29
85 #: build/C/man2/socketcall.2:29 build/C/man2/socketpair.2:43
91 #: build/C/man2/accept.2:46 build/C/man2/bind.2:73
94 "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */\n"
95 "B<#include E<lt>sys/socket.hE<gt>>\n"
97 "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
101 #: build/C/man2/accept.2:48
103 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
104 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 #: build/C/man2/accept.2:51
110 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
111 "B<#include E<lt>sys/socket.hE<gt>>\n"
113 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
117 #: build/C/man2/accept.2:54
120 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
121 "B< socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B< socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
127 #: build/C/man2/accept.2:55 build/C/man2/bind.2:77
128 #: build/C/man3/bindresvport.3:37 build/C/man2/connect.2:77
129 #: build/C/man3/getifaddrs.3:45 build/C/man2/getsockname.2:48
130 #: build/C/man2/getsockopt.2:56 build/C/man2/listen.2:54
131 #: build/C/man2/recv.2:57 build/C/man2/recvmmsg.2:39 build/C/man2/select.2:81
132 #: build/C/man2/select_tut.2:73 build/C/man2/send.2:56
133 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:40
134 #: build/C/man2/socket.2:50 build/C/man7/socket.7:33
135 #: build/C/man2/socketcall.2:31 build/C/man2/socketpair.2:50
141 #: build/C/man2/accept.2:70
143 "The B<accept>() system call is used with connection-based socket types "
144 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>). It extracts the first connection "
145 "request on the queue of pending connections for the listening socket, "
146 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
147 "referring to that socket. The newly created socket is not in the listening "
148 "state. The original socket I<sockfd> is unaffected by this call."
150 "B<accept>() システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
151 "B<SOCK_SEQPACKET>) で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
152 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
153 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
154 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
155 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
158 #: build/C/man2/accept.2:79
160 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
161 "bound to a local address with B<bind>(2), and is listening for connections "
162 "after a B<listen>(2)."
164 "引き数 I<sockfd> は、 B<socket>(2) によって生成され、 B<bind>(2) によって"
165 "ローカルアドレスにバインドされ、 B<listen>(2) を経て接続を待っているソケット"
169 #: build/C/man2/accept.2:97
171 "The argument I<addr> is a pointer to a I<sockaddr> structure. This "
172 "structure is filled in with the address of the peer socket, as known to the "
173 "communications layer. The exact format of the address returned I<addr> is "
174 "determined by the socket's address family (see B<socket>(2) and the "
175 "respective protocol man pages). When I<addr> is NULL, nothing is filled in; "
176 "in this case, I<addrlen> is not used, and should also be NULL."
178 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
179 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
180 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2) およびそ"
181 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
182 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
186 #: build/C/man2/accept.2:105
188 "The I<addrlen> argument is a value-result argument: the caller must "
189 "initialize it to contain the size (in bytes) of the structure pointed to by "
190 "I<addr>; on return it will contain the actual size of the peer address."
192 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
193 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
194 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
197 #: build/C/man2/accept.2:110 build/C/man2/getsockname.2:65
199 "The returned address is truncated if the buffer provided is too small; in "
200 "this case, I<addrlen> will return a value greater than was supplied to the "
203 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
205 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
209 #: build/C/man2/accept.2:123
211 "If no pending connections are present on the queue, and the socket is not "
212 "marked as nonblocking, B<accept>() blocks the caller until a connection is "
213 "present. If the socket is marked nonblocking and no pending connections are "
214 "present on the queue, B<accept>() fails with the error B<EAGAIN> or "
217 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
218 "きは、 B<accept>() は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
219 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
220 "B<accept>() はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
223 #: build/C/man2/accept.2:137
225 "In order to be notified of incoming connections on a socket, you can use "
226 "B<select>(2) or B<poll>(2). A readable event will be delivered when a new "
227 "connection is attempted and you may then call B<accept>() to get a socket "
228 "for that connection. Alternatively, you can set the socket to deliver "
229 "B<SIGIO> when activity occurs on a socket; see B<socket>(7) for details."
231 "ソケットへの接続到着を知るには、 B<select>(2) または B<poll>(2) を用いれば"
232 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
233 "B<accept>() を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
234 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
235 "(deliver) させるようにすることもできる。詳細は B<socket>(7) を参照のこと。"
238 #: build/C/man2/accept.2:150
240 "For certain protocols which require an explicit confirmation, such as "
241 "DECNet, B<accept>() can be thought of as merely dequeuing the next "
242 "connection request and not implying confirmation. Confirmation can be "
243 "implied by a normal read or write on the new file descriptor, and rejection "
244 "can be implied by closing the new socket. Currently only DECNet has these "
245 "semantics on Linux."
247 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
248 "は、 B<accept>() は単に次の接続要求をキューから取り出すだけであり、 接続確認"
249 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
250 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection) は新しいソ"
251 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
252 "セマンティクスを持つのは DECNet だけである。"
255 #: build/C/man2/accept.2:160
257 "If I<flags> is 0, then B<accept4>() is the same as B<accept>(). The "
258 "following values can be bitwise ORed in I<flags> to obtain different "
261 "I<flags> が 0 の場合、 B<accept4>() は B<accept>() と同じである。 I<flags> "
262 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
266 #: build/C/man2/accept.2:160 build/C/man2/socket.2:162
268 msgid "B<SOCK_NONBLOCK>"
269 msgstr "B<SOCK_NONBLOCK>"
272 #: build/C/man2/accept.2:168 build/C/man2/socket.2:170
274 "Set the B<O_NONBLOCK> file status flag on the new open file description. "
275 "Using this flag saves extra calls to B<fcntl>(2) to achieve the same result."
277 "新しく生成されるオープンファイル記述 (open file description) の "
278 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
279 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2) を追加で呼び出す必要がなく"
283 #: build/C/man2/accept.2:168 build/C/man2/socket.2:170
285 msgid "B<SOCK_CLOEXEC>"
286 msgstr "B<SOCK_CLOEXEC>"
289 #: build/C/man2/accept.2:178 build/C/man2/socket.2:180
291 "Set the close-on-exec (B<FD_CLOEXEC>) flag on the new file descriptor. See "
292 "the description of the B<O_CLOEXEC> flag in B<open>(2) for reasons why this "
295 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>) フラグを"
296 "セットする。 このフラグが役に立つ理由については、 B<open>(2) の "
297 "B<O_CLOEXEC> フラグの説明を参照のこと。"
300 #: build/C/man2/accept.2:178 build/C/man2/bind.2:150
301 #: build/C/man3/bindresvport.3:64 build/C/man2/connect.2:125
302 #: build/C/man3/getifaddrs.3:137 build/C/man2/getsockname.2:65
303 #: build/C/man2/getsockopt.2:129 build/C/man2/listen.2:80
304 #: build/C/man2/recv.2:386 build/C/man2/recvmmsg.2:144
305 #: build/C/man2/select.2:289 build/C/man2/select_tut.2:483
306 #: build/C/man2/send.2:273 build/C/man2/sendmmsg.2:119
307 #: build/C/man3/sockatmark.3:49 build/C/man2/socket.2:312
308 #: build/C/man2/socketpair.2:67
314 #: build/C/man2/accept.2:185
316 "On success, these system calls return a nonnegative integer that is a "
317 "descriptor for the accepted socket. On error, -1 is returned, and I<errno> "
318 "is set appropriately."
320 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
321 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
325 #: build/C/man2/accept.2:185
327 msgid "Error Handling"
331 #: build/C/man2/accept.2:212
334 #| "Linux B<accept>() (and B<accept4>()) passes already-pending network "
335 #| "errors on the new socket as an error code from B<accept>(). This "
336 #| "behavior differs from other BSD socket implementations. For reliable "
337 #| "operation the application should detect the network errors defined for "
338 #| "the protocol after B<accept>() and treat them like B<EAGAIN> by "
339 #| "retrying. In case of TCP/IP these are B<ENETDOWN>, B<EPROTO>, "
340 #| "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
341 #| "and B<ENETUNREACH>."
343 "Linux B<accept>() (and B<accept4>()) passes already-pending network errors "
344 "on the new socket as an error code from B<accept>(). This behavior differs "
345 "from other BSD socket implementations. For reliable operation the "
346 "application should detect the network errors defined for the protocol after "
347 "B<accept>() and treat them like B<EAGAIN> by retrying. In the case of TCP/"
348 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
349 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
351 "Linux の B<accept>() (と B<accept4>()) は、新しいソケットにおける、発生済み"
352 "のネットワークエラーを B<accept>() からのエラーコードとして渡す。 この振舞い"
353 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
354 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>() の"
355 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
356 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
357 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
361 #: build/C/man2/accept.2:212 build/C/man2/bind.2:155
362 #: build/C/man3/bindresvport.3:69 build/C/man2/connect.2:130
363 #: build/C/man3/getifaddrs.3:144 build/C/man2/getsockname.2:70
364 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
365 #: build/C/man2/recv.2:391 build/C/man2/recvmmsg.2:152
366 #: build/C/man2/select.2:306 build/C/man2/send.2:278
367 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:54
368 #: build/C/man2/socket.2:317 build/C/man2/socketpair.2:72
374 #: build/C/man2/accept.2:213 build/C/man2/recv.2:396 build/C/man2/send.2:294
376 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
377 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
379 #. Actually EAGAIN on Linux
381 #: build/C/man2/accept.2:221
383 "The socket is marked nonblocking and no connections are present to be "
384 "accepted. POSIX.1-2001 allows either error to be returned for this case, "
385 "and does not require these constants to have the same value, so a portable "
386 "application should check for both possibilities."
388 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
389 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
390 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
391 "ションでは、両方の可能性を 確認すべきである。"
394 #: build/C/man2/accept.2:221 build/C/man2/bind.2:163
395 #: build/C/man2/connect.2:167 build/C/man2/getsockname.2:71
396 #: build/C/man2/getsockopt.2:135 build/C/man2/listen.2:89
397 #: build/C/man2/recv.2:405 build/C/man2/select.2:307 build/C/man2/send.2:302
398 #: build/C/man3/sockatmark.3:55
404 #: build/C/man2/accept.2:224
405 msgid "The descriptor is invalid."
409 #: build/C/man2/accept.2:224
411 msgid "B<ECONNABORTED>"
412 msgstr "B<ECONNABORTED>"
415 #: build/C/man2/accept.2:227
416 msgid "A connection has been aborted."
420 #: build/C/man2/accept.2:227 build/C/man2/bind.2:189
421 #: build/C/man2/connect.2:173 build/C/man2/getsockname.2:76
422 #: build/C/man2/getsockopt.2:140 build/C/man2/recv.2:414
423 #: build/C/man2/send.2:311 build/C/man2/socketpair.2:76
429 #: build/C/man2/accept.2:232
431 "The I<addr> argument is not in a writable part of the user address space."
432 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
435 #: build/C/man2/accept.2:232 build/C/man2/connect.2:201
436 #: build/C/man2/recv.2:418 build/C/man2/select.2:312 build/C/man2/send.2:314
442 #: build/C/man2/accept.2:237
444 "The system call was interrupted by a signal that was caught before a valid "
445 "connection arrived; see B<signal>(7)."
447 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
448 "た。 B<signal>(7) 参照。"
451 #: build/C/man2/accept.2:237 build/C/man2/accept.2:242 build/C/man2/bind.2:167
452 #: build/C/man2/bind.2:193 build/C/man2/getsockname.2:82
453 #: build/C/man2/getsockopt.2:150 build/C/man2/recv.2:423
454 #: build/C/man2/recvmmsg.2:156 build/C/man2/select.2:316
455 #: build/C/man2/send.2:318 build/C/man3/sockatmark.3:59
456 #: build/C/man2/socket.2:325 build/C/man2/socket.2:328
462 #: build/C/man2/accept.2:242
464 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
467 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
471 #: build/C/man2/accept.2:247
472 msgid "(B<accept4>()) invalid value in I<flags>."
473 msgstr "(B<accept4>()) I<flags> に不正な値が指定されている。"
476 #: build/C/man2/accept.2:247 build/C/man2/socket.2:333
477 #: build/C/man2/socketpair.2:81
483 #: build/C/man2/accept.2:250
484 msgid "The per-process limit of open file descriptors has been reached."
485 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
488 #: build/C/man2/accept.2:250 build/C/man2/socket.2:336
489 #: build/C/man2/socketpair.2:84
495 #: build/C/man2/accept.2:253 build/C/man2/socket.2:339
496 #: build/C/man2/socketpair.2:87
497 msgid "The system limit on the total number of open files has been reached."
498 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
501 #: build/C/man2/accept.2:253
503 msgid "B<ENOBUFS>, B<ENOMEM>"
504 msgstr "B<ENOBUFS>, B<ENOMEM>"
507 #: build/C/man2/accept.2:258
509 "Not enough free memory. This often means that the memory allocation is "
510 "limited by the socket buffer limits, not by the system memory."
512 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
513 "ケットバッファの大きさによるメモリ割り当ての制限である。"
516 #: build/C/man2/accept.2:258 build/C/man2/bind.2:172
517 #: build/C/man2/connect.2:213 build/C/man2/getsockname.2:90
518 #: build/C/man2/getsockopt.2:164 build/C/man2/listen.2:94
519 #: build/C/man2/recv.2:438 build/C/man2/send.2:347
525 #: build/C/man2/accept.2:261
526 msgid "The descriptor references a file, not a socket."
527 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
530 #: build/C/man2/accept.2:261 build/C/man2/listen.2:99 build/C/man2/send.2:352
531 #: build/C/man2/socketpair.2:87
533 msgid "B<EOPNOTSUPP>"
534 msgstr "B<EOPNOTSUPP>"
537 #: build/C/man2/accept.2:265
538 msgid "The referenced socket is not of type B<SOCK_STREAM>."
539 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
542 #: build/C/man2/accept.2:265
548 #: build/C/man2/accept.2:268
549 msgid "Protocol error."
553 #: build/C/man2/accept.2:272
554 msgid "In addition, Linux B<accept>() may fail if:"
555 msgstr "上記に加えて、Linux の B<accept>() は以下のエラーで失敗する:"
558 #: build/C/man2/accept.2:272
564 #: build/C/man2/accept.2:275
565 msgid "Firewall rules forbid connection."
566 msgstr "ファイアウォールのルールにより接続が禁止された。"
569 #: build/C/man2/accept.2:287
571 "In addition, network errors for the new socket and as defined for the "
572 "protocol may be returned. Various Linux kernels can return other errors "
573 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>. The "
574 "value B<ERESTARTSYS> may be seen during a trace."
576 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
577 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
578 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
579 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>. B<ERESTARTSYS> がトレースの最中に現れるこ"
583 #: build/C/man2/accept.2:287 build/C/man3/getifaddrs.3:157
584 #: build/C/man2/recvmmsg.2:160 build/C/man2/select.2:325
585 #: build/C/man2/sendmmsg.2:145 build/C/man3/sockatmark.3:66
586 #: build/C/man7/socket.7:696
592 #: build/C/man2/accept.2:292
594 "The B<accept4>() system call is available starting with Linux 2.6.28; "
595 "support in glibc is available starting with version 2.10."
597 "B<accept4>() システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
598 "サポートはバージョン 2.10 以降で利用可能である。"
601 #: build/C/man2/accept.2:292 build/C/man2/bind.2:220
602 #: build/C/man3/bindresvport.3:89 build/C/man2/connect.2:223
603 #: build/C/man3/getifaddrs.3:165 build/C/man2/getsockname.2:95
604 #: build/C/man2/getsockopt.2:169 build/C/man2/listen.2:104
605 #: build/C/man2/recv.2:443 build/C/man2/recvmmsg.2:165
606 #: build/C/man2/select.2:331 build/C/man2/send.2:366
607 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:69
608 #: build/C/man2/socket.2:350 build/C/man2/socketcall.2:43
609 #: build/C/man2/socketpair.2:93
611 msgid "CONFORMING TO"
614 #. The BSD man page documents five possible error returns
615 #. (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
616 #. POSIX.1-2001 documents errors
617 #. EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
618 #. ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
619 #. In addition, SUSv2 documents EFAULT and ENOSR.
621 #: build/C/man2/accept.2:304
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>() first appeared in "
626 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>() は 4.2BSD で初めて実装"
630 #: build/C/man2/accept.2:307
631 msgid "B<accept4>() is a nonstandard Linux extension."
632 msgstr "B<accept4>() は非標準の Linux による拡張である。"
634 #. Some testing seems to show that Tru64 5.1 and HP-UX 11 also
635 #. do not inherit file status flags -- MTK Jun 05
637 #: build/C/man2/accept.2:322
639 "On Linux, the new socket returned by B<accept>() does I<not> inherit file "
640 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
641 "socket. This behavior differs from the canonical BSD sockets "
642 "implementation. Portable programs should not rely on inheritance or "
643 "noninheritance of file status flags and always explicitly set all required "
644 "flags on the socket returned from B<accept>()."
646 "Linux では、 B<accept>() が返す新しいソケットは listen を行っているソケット"
647 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
648 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
649 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
650 "() が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
654 #: build/C/man2/accept.2:322 build/C/man2/bind.2:232
655 #: build/C/man3/bindresvport.3:92 build/C/man2/connect.2:239
656 #: build/C/man3/getifaddrs.3:185 build/C/man2/getsockname.2:101
657 #: build/C/man2/getsockopt.2:176 build/C/man2/listen.2:109
658 #: build/C/man2/recv.2:453 build/C/man2/select.2:346
659 #: build/C/man2/select_tut.2:501 build/C/man2/send.2:380
660 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:71
661 #: build/C/man2/socket.2:364 build/C/man7/socket.7:710
662 #: build/C/man2/socketcall.2:46 build/C/man2/socketpair.2:101
668 #: build/C/man2/accept.2:328 build/C/man2/bind.2:238
669 #: build/C/man2/connect.2:245 build/C/man2/getsockopt.2:182
670 #: build/C/man2/listen.2:135 build/C/man2/socket.2:370
671 #: build/C/man2/socketpair.2:122
673 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
674 "this header file is not required on Linux. However, some historical (BSD) "
675 "implementations required this header file, and portable applications are "
676 "probably wise to include it."
678 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
679 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
680 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
681 "ションではこのファイルを インクルードするのが賢明であろう。"
684 #: build/C/man2/accept.2:349
686 "There may not always be a connection waiting after a B<SIGIO> is delivered "
687 "or B<select>(2) or B<poll>(2) return a readability event because the "
688 "connection might have been removed by an asynchronous network error or "
689 "another thread before B<accept>() is called. If this happens then the call "
690 "will block waiting for the next connection to arrive. To ensure that "
691 "B<accept>() never blocks, the passed socket I<sockfd> needs to have the "
692 "B<O_NONBLOCK> flag set (see B<socket>(7))."
694 "B<SIGIO> が届けられた後や、 B<select>(2) または B<poll>(2) が読み込み可能イ"
695 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
696 "続は、 B<accept>() が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
697 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
698 "この場合、その B<accept>() 呼び出しは停止 (block) し、次の接続の到着を待ちつ"
699 "づける。 B<accept>() に停止を行わせないようにするには、引き数に渡すソケット "
700 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7) を"
704 #: build/C/man2/accept.2:349
706 msgid "The socklen_t type"
710 #: build/C/man2/accept.2:359
712 "The third argument of B<accept>() was originally declared as an I<int *> "
713 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
714 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
715 "*>, and that is what it is for SunOS 5. Later POSIX drafts have I<socklen_t "
716 "*>, and so do the Single UNIX Specification and glibc2. Quoting Linus "
719 "B<accept>() の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
720 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
721 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
722 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
723 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
724 "た。 Linus Torvald の発言を引用する:"
726 #. .I fails: only italicizes a single line
728 #: build/C/man2/accept.2:376
730 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int. "
731 "Anything else breaks any BSD socket layer stuff. POSIX initially I<did> "
732 "make it a size_t, and I (and hopefully others, but obviously not too many) "
733 "complained to them very loudly indeed. Making it a size_t is completely "
734 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
735 "bit architectures, for example. And it I<has> to be the same size as \"int"
736 "\" because that's what the BSD socket interface is. Anyway, the POSIX "
737 "people eventually got a clue, and created \"socklen_t\". They shouldn't "
738 "have touched it in the first place, but once they did they felt it had to "
739 "have a named type for some unfathomable reason (probably somebody didn't "
740 "like losing face over having done the original stupid thing, so they "
741 "silently just renamed their blunder).\""
743 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
744 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
745 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
746 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
747 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
748 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
749 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
750 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
751 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
752 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
753 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
754 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
758 #: build/C/man2/accept.2:376 build/C/man2/bind.2:252
759 #: build/C/man2/connect.2:256 build/C/man3/getifaddrs.3:198
760 #: build/C/man2/listen.2:164 build/C/man2/recv.2:488 build/C/man2/select.2:521
761 #: build/C/man2/select_tut.2:527 build/C/man2/send.2:417
762 #: build/C/man3/sockatmark.3:95 build/C/man2/socket.2:383
768 #: build/C/man2/accept.2:379 build/C/man2/listen.2:167
769 msgid "See B<bind>(2)."
770 msgstr "B<bind>(2) 参照。"
773 #: build/C/man2/accept.2:379 build/C/man2/bind.2:317
774 #: build/C/man3/bindresvport.3:98 build/C/man2/connect.2:261
775 #: build/C/man3/getifaddrs.3:281 build/C/man2/getsockname.2:110
776 #: build/C/man2/getsockopt.2:200 build/C/man2/listen.2:167
777 #: build/C/man2/recv.2:493 build/C/man2/recvmmsg.2:168
778 #: build/C/man2/select.2:558 build/C/man2/select_tut.2:817
779 #: build/C/man2/send.2:422 build/C/man2/sendmmsg.2:168
780 #: build/C/man3/sockatmark.3:130 build/C/man2/socket.2:388
781 #: build/C/man7/socket.7:741 build/C/man2/socketcall.2:54
782 #: build/C/man2/socketpair.2:122
788 #: build/C/man2/accept.2:386
790 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
797 #: build/C/man2/accept.2:386 build/C/man2/bind.2:330
798 #: build/C/man3/bindresvport.3:101 build/C/man2/connect.2:268
799 #: build/C/man3/getifaddrs.3:287 build/C/man2/getsockname.2:117
800 #: build/C/man2/getsockopt.2:208 build/C/man2/listen.2:173
801 #: build/C/man2/recv.2:504 build/C/man2/recvmmsg.2:175
802 #: build/C/man2/select.2:573 build/C/man2/select_tut.2:836
803 #: build/C/man2/send.2:437 build/C/man2/sendmmsg.2:173
804 #: build/C/man3/sockatmark.3:135 build/C/man2/socket.2:419
805 #: build/C/man7/socket.7:752 build/C/man2/socketcall.2:72
806 #: build/C/man2/socketpair.2:129
812 #: build/C/man2/accept.2:393 build/C/man2/bind.2:337
813 #: build/C/man3/bindresvport.3:108 build/C/man2/connect.2:275
814 #: build/C/man3/getifaddrs.3:294 build/C/man2/getsockname.2:124
815 #: build/C/man2/getsockopt.2:215 build/C/man2/listen.2:180
816 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:182
817 #: build/C/man2/select.2:580 build/C/man2/select_tut.2:843
818 #: build/C/man2/send.2:444 build/C/man2/sendmmsg.2:180
819 #: build/C/man3/sockatmark.3:142 build/C/man2/socket.2:426
820 #: build/C/man7/socket.7:759 build/C/man2/socketcall.2:79
821 #: build/C/man2/socketpair.2:136
824 #| "This page is part of release 3.40 of the Linux I<man-pages> project. A "
825 #| "description of the project, and information about reporting bugs, can be "
826 #| "found at http://www.kernel.org/doc/man-pages/."
828 "This page is part of release 3.41 of the Linux I<man-pages> project. A "
829 "description of the project, and information about reporting bugs, can be "
830 "found at http://www.kernel.org/doc/man-pages/."
832 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.40 の一部\n"
833 "である。プロジェクトの説明とバグ報告に関する情報は\n"
834 "http://www.kernel.org/doc/man-pages/ に書かれている。"
837 #: build/C/man2/bind.2:66
843 #: build/C/man2/bind.2:66
849 #: build/C/man2/bind.2:69
850 msgid "bind - bind a name to a socket"
851 msgstr "bind - ソケットに名前をつける"
854 #: build/C/man2/bind.2:76
857 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
858 "B< socklen_t >I<addrlen>B<);>\n"
860 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
861 "B< socklen_t >I<addrlen>B<);>\n"
864 #: build/C/man2/bind.2:90
866 "When a socket is created with B<socket>(2), it exists in a name space "
867 "(address family) but has no address assigned to it. B<bind>() assigns the "
868 "address specified by I<addr> to the socket referred to by the file "
869 "descriptor I<sockfd>. I<addrlen> specifies the size, in bytes, of the "
870 "address structure pointed to by I<addr>. Traditionally, this operation is "
871 "called \\(lqassigning a name to a socket\\(rq."
873 "B<socket>(2) でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
874 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>() は、"
875 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
876 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
877 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
881 #: build/C/man2/bind.2:97
883 "It is normally necessary to assign a local address using B<bind>() before a "
884 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
886 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2) を"
887 "参照)、通常その前に B<bind>() を使用してローカルアドレスを割り当てる必要があ"
891 #: build/C/man2/bind.2:128
893 "The rules used in name binding vary between address families. Consult the "
894 "manual entries in Section 7 for detailed information. For B<AF_INET> see "
895 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
896 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
897 "B<AF_X25> see B<x25>(7) and for B<AF_NETLINK> see B<netlink>(7)."
899 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
900 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7) を、 B<AF_INET6> は "
901 "B<ipv6>(7) を、 B<AF_UNIX> は B<unix>(7) を、 B<AF_APPLETALK> は B<ddp>"
902 "(7) を、 B<AF_PACKET> は B<packet>(7) を、 B<AF_X25> は B<x25>(7) を、 "
903 "B<AF_NETLINK> は B<netlink>(7) を参照。"
906 #: build/C/man2/bind.2:135
908 "The actual structure passed for the I<addr> argument will depend on the "
909 "address family. The I<sockaddr> structure is defined as something like:"
911 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
912 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
915 #: build/C/man2/bind.2:142
918 "struct sockaddr {\n"
919 " sa_family_t sa_family;\n"
920 " char sa_data[14];\n"
923 "struct sockaddr {\n"
924 " sa_family_t sa_family;\n"
925 " char sa_data[14];\n"
929 #: build/C/man2/bind.2:150
931 "The only purpose of this structure is to cast the structure pointer passed "
932 "in I<addr> in order to avoid compiler warnings. See EXAMPLE below."
934 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
935 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
938 #: build/C/man2/bind.2:155 build/C/man2/getsockname.2:70
939 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
940 #: build/C/man2/socketpair.2:72
942 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
945 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
949 #: build/C/man2/bind.2:156 build/C/man2/bind.2:180
950 #: build/C/man3/bindresvport.3:74 build/C/man2/connect.2:133
951 #: build/C/man2/send.2:283 build/C/man2/socket.2:318
956 #. e.g., privileged port in AF_INET domain
958 #: build/C/man2/bind.2:160
959 msgid "The address is protected, and the user is not the superuser."
960 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
963 #: build/C/man2/bind.2:160 build/C/man3/bindresvport.3:79
964 #: build/C/man2/connect.2:146 build/C/man2/listen.2:86
966 msgid "B<EADDRINUSE>"
967 msgstr "B<EADDRINUSE>"
970 #: build/C/man2/bind.2:163
971 msgid "The given address is already in use."
972 msgstr "指定されたアドレスが既に使用中である。"
975 #: build/C/man2/bind.2:167
976 msgid "I<sockfd> is not a valid descriptor."
977 msgstr "I<sockfd> が不正なディスクリプタである。"
979 #. This may change in the future: see
980 #. .I linux/unix/sock.c for details.
982 #: build/C/man2/bind.2:172
983 msgid "The socket is already bound to an address."
984 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
987 #: build/C/man2/bind.2:176
988 msgid "I<sockfd> is a descriptor for a file, not a socket."
990 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
993 #: build/C/man2/bind.2:180
994 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>) sockets:"
995 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>) のソケット特有である:"
998 #: build/C/man2/bind.2:185
1000 "Search permission is denied on a component of the path prefix. (See also "
1001 "B<path_resolution>(7).)"
1003 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1007 #: build/C/man2/bind.2:185
1009 msgid "B<EADDRNOTAVAIL>"
1010 msgstr "B<EADDRNOTAVAIL>"
1013 #: build/C/man2/bind.2:189
1015 "A nonexistent interface was requested or the requested address was not local."
1017 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1021 #: build/C/man2/bind.2:193
1022 msgid "I<addr> points outside the user's accessible address space."
1023 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1026 #: build/C/man2/bind.2:200
1028 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1029 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1032 #: build/C/man2/bind.2:200
1038 #: build/C/man2/bind.2:204
1039 msgid "Too many symbolic links were encountered in resolving I<addr>."
1040 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1043 #: build/C/man2/bind.2:204
1045 msgid "B<ENAMETOOLONG>"
1046 msgstr "B<ENAMETOOLONG>"
1049 #: build/C/man2/bind.2:208
1050 msgid "I<addr> is too long."
1051 msgstr "I<addr> が長過ぎる。"
1054 #: build/C/man2/bind.2:208
1060 #: build/C/man2/bind.2:211
1061 msgid "The file does not exist."
1062 msgstr "ファイルが存在しない。"
1065 #: build/C/man2/bind.2:211 build/C/man2/recv.2:427 build/C/man2/select.2:322
1066 #: build/C/man2/send.2:341
1072 #: build/C/man2/bind.2:214
1073 msgid "Insufficient kernel memory was available."
1074 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1077 #: build/C/man2/bind.2:214
1083 #: build/C/man2/bind.2:217
1084 msgid "A component of the path prefix is not a directory."
1085 msgstr "パス名の構成要素がディレクトリではない。"
1088 #: build/C/man2/bind.2:217
1094 #: build/C/man2/bind.2:220
1095 msgid "The socket inode would reside on a read-only file system."
1096 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1098 #. SVr4 documents an additional
1100 #. general error condition, and
1105 #. UNIX-domain error conditions.
1107 #: build/C/man2/bind.2:232
1108 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>() first appeared in 4.2BSD)."
1109 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>() は 4.2BSD で最初に現われた)。"
1112 #: build/C/man2/bind.2:249
1114 "The third argument of B<bind>() is in reality an I<int> (and this is what 4."
1115 "x BSD and libc4 and libc5 have). Some POSIX confusion resulted in the "
1116 "present I<socklen_t>, also used by glibc. See also B<accept>(2)."
1118 "B<bind>() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1119 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1120 "少し混乱がある。 詳しくは B<accept>(2) を参照のこと。"
1123 #: build/C/man2/bind.2:249 build/C/man2/getsockopt.2:197
1124 #: build/C/man2/select.2:458 build/C/man2/send.2:412
1125 #: build/C/man3/sockatmark.3:91 build/C/man7/socket.7:728
1130 #. FIXME What *are* transparent proxy options?
1132 #: build/C/man2/bind.2:252
1133 msgid "The transparent proxy options are not described."
1134 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1137 #: build/C/man2/bind.2:257
1139 "An example of the use of B<bind>() with Internet domain sockets can be "
1140 "found in B<getaddrinfo>(3)."
1142 "インターネット・ドメイン・ソケットでの B<bind>() の利用例が B<getaddrinfo>"
1145 #. listen.7 refers to this example.
1146 #. accept.7 refers to this example.
1147 #. unix.7 refers to this example.
1149 #: build/C/man2/bind.2:264
1151 "The following example shows how to bind a stream socket in the UNIX "
1152 "(B<AF_UNIX>) domain, and accept connections:"
1154 "以下の例は、UNIX ドメイン (B<AF_UNIX>) でストリームソケットを bind する方法"
1158 #: build/C/man2/bind.2:271
1161 "#include E<lt>sys/socket.hE<gt>\n"
1162 "#include E<lt>sys/un.hE<gt>\n"
1163 "#include E<lt>stdlib.hE<gt>\n"
1164 "#include E<lt>stdio.hE<gt>\n"
1165 "#include E<lt>string.hE<gt>\n"
1167 "#include E<lt>sys/socket.hE<gt>\n"
1168 "#include E<lt>sys/un.hE<gt>\n"
1169 "#include E<lt>stdlib.hE<gt>\n"
1170 "#include E<lt>stdio.hE<gt>\n"
1171 "#include E<lt>string.hE<gt>\n"
1174 #: build/C/man2/bind.2:274
1177 "#define MY_SOCK_PATH \"/somepath\"\n"
1178 "#define LISTEN_BACKLOG 50\n"
1180 "#define MY_SOCK_PATH \"/somepath\"\n"
1181 "#define LISTEN_BACKLOG 50\n"
1184 #: build/C/man2/bind.2:277
1187 "#define handle_error(msg) \\e\n"
1188 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1190 "#define handle_error(msg) \\e\n"
1191 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1194 #: build/C/man2/bind.2:284
1198 "main(int argc, char *argv[])\n"
1201 " struct sockaddr_un my_addr, peer_addr;\n"
1202 " socklen_t peer_addr_size;\n"
1205 "main(int argc, char *argv[])\n"
1208 " struct sockaddr_un my_addr, peer_addr;\n"
1209 " socklen_t peer_addr_size;\n"
1212 #: build/C/man2/bind.2:288
1215 " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1217 " handle_error(\"socket\");\n"
1219 " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1221 " handle_error(\"socket\");\n"
1224 #: build/C/man2/bind.2:294
1227 " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1228 " /* Clear structure */\n"
1229 " my_addr.sun_family = AF_UNIX;\n"
1230 " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1231 " sizeof(my_addr.sun_path) - 1);\n"
1233 " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1234 " /* Clear structure */\n"
1235 " my_addr.sun_family = AF_UNIX;\n"
1236 " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1237 " sizeof(my_addr.sun_path) - 1);\n"
1240 #: build/C/man2/bind.2:298
1243 " if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1244 " sizeof(struct sockaddr_un)) == -1)\n"
1245 " handle_error(\"bind\");\n"
1247 " if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1248 " sizeof(struct sockaddr_un)) == -1)\n"
1249 " handle_error(\"bind\");\n"
1252 #: build/C/man2/bind.2:301
1255 " if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1256 " handle_error(\"listen\");\n"
1258 " if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1259 " handle_error(\"listen\");\n"
1262 #: build/C/man2/bind.2:304
1265 " /* Now we can accept incoming connections one\n"
1266 " at a time using accept(2) */\n"
1268 " /* Now we can accept incoming connections one\n"
1269 " at a time using accept(2) */\n"
1272 #: build/C/man2/bind.2:310
1275 " peer_addr_size = sizeof(struct sockaddr_un);\n"
1276 " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1277 " &peer_addr_size);\n"
1279 " handle_error(\"accept\");\n"
1281 " peer_addr_size = sizeof(struct sockaddr_un);\n"
1282 " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1283 " &peer_addr_size)\n"
1285 " handle_error(\"accept\");\n"
1288 #: build/C/man2/bind.2:312
1290 msgid " /* Code to deal with incoming connection(s)... */\n"
1291 msgstr " /* Code to deal with incoming connection(s)... */\n"
1294 #: build/C/man2/bind.2:316
1297 " /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1298 " should be deleted using unlink(2) or remove(3) */\n"
1301 " /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1302 " should be deleted using unlink(2) or remove(3) */\n"
1306 #: build/C/man2/bind.2:330
1308 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1309 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1310 "(7), B<socket>(7), B<unix>(7)"
1312 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1313 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1314 "(7), B<socket>(7), B<unix>(7)"
1317 #: build/C/man3/bindresvport.3:27
1319 msgid "BINDRESVPORT"
1320 msgstr "BINDRESVPORT"
1323 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
1324 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
1325 #: build/C/man3/sockatmark.3:23
1331 #: build/C/man3/bindresvport.3:30
1332 msgid "bindresvport - bind a socket to a privileged IP port"
1333 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1336 #: build/C/man3/bindresvport.3:34
1339 "B<#include E<lt>sys/types.hE<gt>>\n"
1340 "B<#include E<lt>netinet/in.hE<gt>>\n"
1342 "B<#include E<lt>sys/types.hE<gt>>\n"
1343 "B<#include E<lt>netinet/in.hE<gt>>\n"
1346 #: build/C/man3/bindresvport.3:36
1348 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1349 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1351 #. Glibc actually starts searching with a port # in the range 600 to 1023
1353 #: build/C/man3/bindresvport.3:43
1355 "B<bindresvport>() is used to bind a socket descriptor to a privileged "
1356 "anonymous IP port, that is, a port number arbitrarily selected from the "
1357 "range 512 to 1023."
1359 "B<bindresvport>() は、ソケット・ディスクリプタを特権無名 (privileged "
1360 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1361 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1364 #: build/C/man3/bindresvport.3:53
1366 "If the B<bind>(2) performed by B<bindresvport>() is successful, and I<sin> "
1367 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1370 "B<bindresvport>() によって実行された B<bind>(2) が成功し、 I<sin> が NULL "
1371 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1375 #: build/C/man3/bindresvport.3:64
1377 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1378 "to be B<AF_INET>. However, in this case, B<bindresvport>() has no way to "
1379 "return the port number actually allocated. (This information can later be "
1380 "obtained using B<getsockname>(2).)"
1382 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1383 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1384 "() は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1385 "ト番号は、後で B<getsockname>(2) を使って取得できる)。"
1388 #: build/C/man3/bindresvport.3:69
1390 "B<bindresvport>() returns 0 on success; otherwise -1 is returned and "
1391 "I<errno> set to indicate the cause of the error."
1393 "B<bindresvport>() は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1394 "I<errno> にエラーの原因を示す値を設定する。"
1397 #: build/C/man3/bindresvport.3:74
1399 "B<bindresvport>() can fail for any of the same reasons as B<bind>(2). In "
1400 "addition, the following errors may occur:"
1402 "B<bindresvport>() は B<bind>(2) と同じ原因で失敗する可能性がある。 さらに、"
1406 #: build/C/man3/bindresvport.3:79
1408 "The caller did not have superuser privilege (to be precise: the "
1409 "B<CAP_NET_BIND_SERVICE> capability is required)."
1411 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1412 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1415 #: build/C/man3/bindresvport.3:82
1416 msgid "All privileged ports are in use."
1417 msgstr "全ての特権ポートが使用中である。"
1420 #: build/C/man3/bindresvport.3:82
1422 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1423 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1426 #: build/C/man3/bindresvport.3:89
1427 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1429 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1432 #: build/C/man3/bindresvport.3:92
1434 "Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other systems."
1436 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1439 #: build/C/man3/bindresvport.3:98
1441 "Unlike some B<bindresvport>() implementations, the glibc implementation "
1442 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1444 "B<bindresvport>() のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1445 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1448 #: build/C/man3/bindresvport.3:101
1449 msgid "B<bind>(2), B<getsockname>(2)"
1450 msgstr "B<bind>(2), B<getsockname>(2)"
1453 #: build/C/man2/connect.2:65
1459 #: build/C/man2/connect.2:68
1460 msgid "connect - initiate a connection on a socket"
1461 msgstr "connect - ソケットの接続を行う"
1464 #: build/C/man2/connect.2:71 build/C/man2/getsockopt.2:48
1465 #: build/C/man2/listen.2:49
1467 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */\n"
1468 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */\n"
1471 #: build/C/man2/connect.2:73 build/C/man2/getsockname.2:44
1472 #: build/C/man2/getsockopt.2:50 build/C/man2/listen.2:51
1473 #: build/C/man2/recv.2:49
1475 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1476 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1479 #: build/C/man2/connect.2:76
1482 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1483 "B< socklen_t >I<addrlen>B<);>\n"
1485 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1486 "B< socklen_t >I<addrlen>B<);>\n"
1489 #: build/C/man2/connect.2:95
1491 "The B<connect>() system call connects the socket referred to by the file "
1492 "descriptor I<sockfd> to the address specified by I<addr>. The I<addrlen> "
1493 "argument specifies the size of I<addr>. The format of the address in "
1494 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1495 "B<socket>(2) for further details."
1497 "B<connect>() システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1498 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1499 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1500 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2) を参照の"
1504 #: build/C/man2/connect.2:111
1506 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1507 "to which datagrams are sent by default, and the only address from which "
1508 "datagrams are received. If the socket is of type B<SOCK_STREAM> or "
1509 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1510 "that is bound to the address specified by I<addr>."
1512 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1513 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1514 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1515 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1519 #: build/C/man2/connect.2:125
1521 "Generally, connection-based protocol sockets may successfully B<connect>() "
1522 "only once; connectionless protocol sockets may use B<connect>() multiple "
1523 "times to change their association. Connectionless sockets may dissolve the "
1524 "association by connecting to an address with the I<sa_family> member of "
1525 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1527 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1528 "() が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1529 "度も B<connect>() を使用できる。 非接続ソケットは I<sockaddr> の "
1530 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1531 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1534 #: build/C/man2/connect.2:130
1536 "If the connection or binding succeeds, zero is returned. On error, -1 is "
1537 "returned, and I<errno> is set appropriately."
1539 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1543 #: build/C/man2/connect.2:133
1545 "The following are general socket errors only. There may be other domain-"
1546 "specific error codes."
1548 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1552 #: build/C/man2/connect.2:141
1554 "For UNIX domain sockets, which are identified by pathname: Write permission "
1555 "is denied on the socket file, or search permission is denied for one of the "
1556 "directories in the path prefix. (See also B<path_resolution>(7).)"
1558 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1559 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1560 "がなかった。 (B<path_resolution>(7) も参照のこと)"
1563 #: build/C/man2/connect.2:141
1565 msgid "B<EACCES>, B<EPERM>"
1566 msgstr "B<EACCES>, B<EPERM>"
1569 #: build/C/man2/connect.2:146
1571 "The user tried to connect to a broadcast address without having the socket "
1572 "broadcast flag enabled or the connection request failed because of a local "
1575 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1576 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1580 #: build/C/man2/connect.2:149
1581 msgid "Local address is already in use."
1582 msgstr "ローカルアドレスが既に使用されている。"
1585 #: build/C/man2/connect.2:149 build/C/man2/socket.2:322
1586 #: build/C/man2/socketpair.2:73
1588 msgid "B<EAFNOSUPPORT>"
1589 msgstr "B<EAFNOSUPPORT>"
1592 #: build/C/man2/connect.2:154
1594 "The passed address didn't have the correct address family in its "
1595 "I<sa_family> field."
1597 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1601 #: build/C/man2/connect.2:154
1607 #: build/C/man2/connect.2:163
1609 "No more free local ports or insufficient entries in the routing cache. For "
1610 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1611 "B<ip>(7) for information on how to increase the number of local ports."
1613 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1614 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1615 "(7) の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1618 #: build/C/man2/connect.2:163
1621 msgstr "B<EALREADY>"
1624 #: build/C/man2/connect.2:167
1626 "The socket is nonblocking and a previous connection attempt has not yet been "
1629 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1632 #: build/C/man2/connect.2:170
1633 msgid "The file descriptor is not a valid index in the descriptor table."
1635 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1639 #: build/C/man2/connect.2:170 build/C/man2/recv.2:410
1641 msgid "B<ECONNREFUSED>"
1642 msgstr "B<ECONNREFUSED>"
1645 #: build/C/man2/connect.2:173
1646 msgid "No-one listening on the remote address."
1647 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1650 #: build/C/man2/connect.2:176
1651 msgid "The socket structure address is outside the user's address space."
1652 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1655 #: build/C/man2/connect.2:176
1657 msgid "B<EINPROGRESS>"
1658 msgstr "B<EINPROGRESS>"
1661 #: build/C/man2/connect.2:201
1663 "The socket is nonblocking and the connection cannot be completed "
1664 "immediately. It is possible to B<select>(2) or B<poll>(2) for completion "
1665 "by selecting the socket for writing. After B<select>(2) indicates "
1666 "writability, use B<getsockopt>(2) to read the B<SO_ERROR> option at level "
1667 "B<SOL_SOCKET> to determine whether B<connect>() completed successfully "
1668 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1669 "error codes listed here, explaining the reason for the failure)."
1671 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1672 "できない。その場合、 B<select>(2) や B<poll>(2) を使ってそのソケットが書き"
1673 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2) "
1674 "で書き込み可能になった後に、 B<getsockopt>(2) を使って B<SOL_SOCKET> レベル"
1675 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>() が成功したか、"
1676 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1677 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1680 #. For TCP, the connection will complete asynchronously.
1681 #. See http://lkml.org/lkml/2005/7/12/254
1683 #: build/C/man2/connect.2:207
1685 "The system call was interrupted by a signal that was caught; see B<signal>"
1688 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7) 参照。"
1691 #: build/C/man2/connect.2:207 build/C/man2/send.2:321
1697 #: build/C/man2/connect.2:210
1698 msgid "The socket is already connected."
1699 msgstr "ソケットは既に接続 (connect) されている。"
1702 #: build/C/man2/connect.2:210
1704 msgid "B<ENETUNREACH>"
1705 msgstr "B<ENETUNREACH>"
1708 #: build/C/man2/connect.2:213
1709 msgid "Network is unreachable."
1710 msgstr "到達できないネットワークである。"
1713 #: build/C/man2/connect.2:216
1714 msgid "The file descriptor is not associated with a socket."
1715 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1718 #: build/C/man2/connect.2:216
1720 msgid "B<ETIMEDOUT>"
1721 msgstr "B<ETIMEDOUT>"
1724 #: build/C/man2/connect.2:223
1726 "Timeout while attempting connection. The server may be too busy to accept "
1727 "new connections. Note that for IP sockets the timeout may be very long when "
1728 "syncookies are enabled on the server."
1730 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1731 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1732 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1735 #. SVr4 documents the additional
1736 #. general error codes
1737 #. .BR EADDRNOTAVAIL ,
1739 #. .BR EAFNOSUPPORT ,
1746 #. documents many additional error conditions not described here.
1748 #: build/C/man2/connect.2:239
1750 "SVr4, 4.4BSD, (the B<connect>() function first appeared in 4.2BSD), "
1753 "SVr4, 4.4BSD, (B<connect>() 関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1756 #: build/C/man2/connect.2:256
1758 "The third argument of B<connect>() is in reality an I<int> (and this is "
1759 "what 4.x BSD and libc4 and libc5 have). Some POSIX confusion resulted in "
1760 "the present I<socklen_t>, also used by glibc. See also B<accept>(2)."
1762 "B<connect>() の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1763 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1764 "glibc でも I<socklen_t> を使っている。 B<accept>(2) も参照のこと。"
1767 #: build/C/man2/connect.2:261
1768 msgid "An example of the use of B<connect>() is shown in B<getaddrinfo>(3)."
1769 msgstr "B<connect>() の利用例が B<getaddrinfo>(3) に記載されている。"
1772 #: build/C/man2/connect.2:268
1774 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1775 "B<path_resolution>(7)"
1777 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1778 "B<path_resolution>(7)"
1781 #: build/C/man3/getifaddrs.3:33
1787 #: build/C/man3/getifaddrs.3:33
1793 #: build/C/man3/getifaddrs.3:33
1799 #: build/C/man3/getifaddrs.3:36
1800 msgid "getifaddrs, freeifaddrs - get interface addresses"
1804 #: build/C/man3/getifaddrs.3:40
1807 "B<#include E<lt>sys/types.hE<gt>>\n"
1808 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1810 "B<#include E<lt>sys/types.hE<gt>>\n"
1811 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1814 #: build/C/man3/getifaddrs.3:42
1816 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1817 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1820 #: build/C/man3/getifaddrs.3:44
1822 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1823 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1826 #: build/C/man3/getifaddrs.3:55
1828 "The B<getifaddrs>() function creates a linked list of structures describing "
1829 "the network interfaces of the local system, and stores the address of the "
1830 "first item of the list in I<*ifap>. The list consists of I<ifaddrs> "
1831 "structures, defined as follows:"
1835 #: build/C/man3/getifaddrs.3:74
1838 "struct ifaddrs {\n"
1839 " struct ifaddrs *ifa_next; /* Next item in list */\n"
1840 " char *ifa_name; /* Name of interface */\n"
1841 " unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */\n"
1842 " struct sockaddr *ifa_addr; /* Address of interface */\n"
1843 " struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1845 " struct sockaddr *ifu_broadaddr;\n"
1846 " /* Broadcast address of interface */\n"
1847 " struct sockaddr *ifu_dstaddr;\n"
1848 " /* Point-to-point destination address */\n"
1850 "#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1851 "#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n"
1852 " void *ifa_data; /* Address-specific data */\n"
1855 "struct ifaddrs {\n"
1856 " struct ifaddrs *ifa_next; /* Next item in list */\n"
1857 " char *ifa_name; /* Name of interface */\n"
1858 " unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */\n"
1859 " struct sockaddr *ifa_addr; /* Address of interface */\n"
1860 " struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1862 " struct sockaddr *ifu_broadaddr;\n"
1863 " /* Broadcast address of interface */\n"
1864 " struct sockaddr *ifu_dstaddr;\n"
1865 " /* Point-to-point destination address */\n"
1867 "#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1868 "#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n"
1869 " void *ifa_data; /* Address-specific data */\n"
1873 #: build/C/man3/getifaddrs.3:81
1875 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1876 "or NULL if this is the last item of the list."
1881 #. indicates the maximum length of this field.
1883 #: build/C/man3/getifaddrs.3:88
1884 msgid "The I<ifa_name> points to the null-terminated interface name."
1888 #: build/C/man3/getifaddrs.3:97
1890 "The I<ifa_flags> field contains the interface flags, as returned by the "
1891 "B<SIOCGIFFLAGS> B<ioctl>(2) operation (see B<netdevice>(7) for a list of "
1896 #: build/C/man3/getifaddrs.3:105
1898 "The I<ifa_addr> field points to a structure containing the interface "
1899 "address. (The I<sa_family> subfield should be consulted to determine the "
1900 "format of the address structure.)"
1904 #: build/C/man3/getifaddrs.3:111
1906 "The I<ifa_netmask> field points to a structure containing the netmask "
1907 "associated with I<ifa_addr>, if applicable for the address family."
1911 #: build/C/man3/getifaddrs.3:126
1913 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1914 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1915 "will contain the broadcast address associated with I<ifa_addr> (if "
1916 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1917 "destination address of the point-to-point interface."
1921 #: build/C/man3/getifaddrs.3:131
1923 "The I<ifa_data> field points to a buffer containing address-family-specific "
1924 "data; this field may be NULL if there is no such data for this interface."
1928 #: build/C/man3/getifaddrs.3:137
1930 "The data returned by B<getifaddrs>() is dynamically allocated and should be "
1931 "freed using B<freeifaddrs>() when no longer needed."
1935 #: build/C/man3/getifaddrs.3:144
1937 "On success, B<getifaddrs>() returns zero; on error, -1 is returned, and "
1938 "I<errno> is set appropriately."
1942 #: build/C/man3/getifaddrs.3:157
1944 "B<getifaddrs>() may fail and set I<errno> for any of the errors specified "
1945 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1946 "(2), B<malloc>(3), or B<realloc>(3)."
1950 #: build/C/man3/getifaddrs.3:165
1952 "The B<getifaddrs>() function first appeared in glibc 2.3, but before glibc "
1953 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1954 "added in glibc 2.3.3. Support of address families other than IPv4 is only "
1955 "available on kernels that support netlink."
1958 #. , but the BSD-derived documentation generally
1959 #. appears to be confused and obsolete on this point.
1960 #. i.e., commonly it still says one of them will be NULL, even if
1961 #. the ifa_ifu union is already present
1963 #: build/C/man3/getifaddrs.3:185
1965 "Not in POSIX.1-2001. This function first appeared in BSDi and is present on "
1966 "the BSD systems, but with slightly different semantics documented"
1967 "\\(emreturning one entry per interface, not per address. This means "
1968 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1969 "address, and no link-level address is returned if the interface has an IP "
1970 "address assigned. Also, the way of choosing either I<ifa_broadaddr> or "
1971 "I<ifa_dstaddr> differs on various systems."
1975 #: build/C/man3/getifaddrs.3:198
1977 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
1978 "assigned to the interface, but also one B<AF_PACKET> address per interface "
1979 "containing lower-level details about the interface and its physical layer. "
1980 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
1981 "net_device_stats>, defined in I<E<lt>linux/netdevice.hE<gt>>, which contains "
1982 "various interface attributes and statistics."
1986 #: build/C/man3/getifaddrs.3:205
1988 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
1989 "and B<getnameinfo>(3). Here is what we see when running this program on one "
1994 #: build/C/man3/getifaddrs.3:219
1998 "lo address family: 17 (AF_PACKET)\n"
1999 "eth0 address family: 17 (AF_PACKET)\n"
2000 "lo address family: 2 (AF_INET)\n"
2001 " address: E<lt>127.0.0.1E<gt>\n"
2002 "eth0 address family: 2 (AF_INET)\n"
2003 " address: E<lt>10.1.1.4E<gt>\n"
2004 "lo address family: 10 (AF_INET6)\n"
2005 " address: E<lt>::1E<gt>\n"
2006 "eth0 address family: 10 (AF_INET6)\n"
2007 " address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2010 "lo address family: 17 (AF_PACKET)\n"
2011 "eth0 address family: 17 (AF_PACKET)\n"
2012 "lo address family: 2 (AF_INET)\n"
2013 " address: E<lt>127.0.0.1E<gt>\n"
2014 "eth0 address family: 2 (AF_INET)\n"
2015 " address: E<lt>10.1.1.4E<gt>\n"
2016 "lo address family: 10 (AF_INET6)\n"
2017 " address: E<lt>::1E<gt>\n"
2018 "eth0 address family: 10 (AF_INET6)\n"
2019 " address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2022 #: build/C/man3/getifaddrs.3:221
2024 msgid "Program source"
2028 #: build/C/man3/getifaddrs.3:231
2031 "#include E<lt>arpa/inet.hE<gt>\n"
2032 "#include E<lt>sys/socket.hE<gt>\n"
2033 "#include E<lt>netdb.hE<gt>\n"
2034 "#include E<lt>ifaddrs.hE<gt>\n"
2035 "#include E<lt>stdio.hE<gt>\n"
2036 "#include E<lt>stdlib.hE<gt>\n"
2037 "#include E<lt>unistd.hE<gt>\n"
2039 "#include E<lt>arpa/inet.hE<gt>\n"
2040 "#include E<lt>sys/socket.hE<gt>\n"
2041 "#include E<lt>netdb.hE<gt>\n"
2042 "#include E<lt>ifaddrs.hE<gt>\n"
2043 "#include E<lt>stdio.hE<gt>\n"
2044 "#include E<lt>stdlib.hE<gt>\n"
2045 "#include E<lt>unistd.hE<gt>\n"
2048 #: build/C/man3/getifaddrs.3:238
2052 "main(int argc, char *argv[])\n"
2054 " struct ifaddrs *ifaddr, *ifa;\n"
2056 " char host[NI_MAXHOST];\n"
2059 "main(int argc, char *argv[])\n"
2061 " struct ifaddrs *ifaddr, *ifa;\n"
2063 " char host[NI_MAXHOST];\n"
2066 #: build/C/man3/getifaddrs.3:243
2069 " if (getifaddrs(&ifaddr) == -1) {\n"
2070 " perror(\"getifaddrs\");\n"
2071 " exit(EXIT_FAILURE);\n"
2074 " if (getifaddrs(&ifaddr) == -1) {\n"
2075 " perror(\"getifaddrs\");\n"
2076 " exit(EXIT_FAILURE);\n"
2080 #: build/C/man3/getifaddrs.3:246
2083 " /* Walk through linked list, maintaining head pointer so we\n"
2084 " can free list later */\n"
2086 " /* Walk through linked list, maintaining head pointer so we\n"
2087 " can free list later */\n"
2090 #: build/C/man3/getifaddrs.3:250
2093 " for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2094 " if (ifa-E<gt>ifa_addr == NULL)\n"
2097 " for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2098 " if (ifa-E<gt>ifa_addr == NULL)\n"
2102 #: build/C/man3/getifaddrs.3:252
2104 msgid " family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2105 msgstr " family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2108 #: build/C/man3/getifaddrs.3:255
2111 " /* Display interface name and family (including symbolic\n"
2112 " form of the latter for the common families) */\n"
2114 " /* Display interface name and family (including symbolic\n"
2115 " form of the latter for the common families) */\n"
2118 #: build/C/man3/getifaddrs.3:261
2121 " printf(\"%s\\t address family: %d%s\\en\",\n"
2122 " ifa-E<gt>ifa_name, family,\n"
2123 " (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2124 " (family == AF_INET) ? \" (AF_INET)\" :\n"
2125 " (family == AF_INET6) ? \" (AF_INET6)\" : \"\");\n"
2127 " printf(\"%s\\t address family: %d%s\\en\",\n"
2128 " ifa-E<gt>ifa_name, family,\n"
2129 " (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2130 " (family == AF_INET) ? \" (AF_INET)\" :\n"
2131 " (family == AF_INET6) ? \" (AF_INET6)\" : \"\");\n"
2134 #: build/C/man3/getifaddrs.3:263
2136 msgid " /* For an AF_INET* interface address, display the address */\n"
2137 msgstr " /* For an AF_INET* interface address, display the address */\n"
2140 #: build/C/man3/getifaddrs.3:276
2143 " if (family == AF_INET || family == AF_INET6) {\n"
2144 " s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2145 " (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2146 " sizeof(struct sockaddr_in6),\n"
2147 " host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2149 " printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2150 " exit(EXIT_FAILURE);\n"
2152 " printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2156 " if (family == AF_INET || family == AF_INET6) {\n"
2157 " s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2158 " (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2159 " sizeof(struct sockaddr_in6),\n"
2160 " host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2162 " printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2163 " exit(EXIT_FAILURE);\n"
2165 " printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2170 #: build/C/man3/getifaddrs.3:280
2173 " freeifaddrs(ifaddr);\n"
2174 " exit(EXIT_SUCCESS);\n"
2177 " freeifaddrs(ifaddr);\n"
2178 " exit(EXIT_SUCCESS);\n"
2182 #: build/C/man3/getifaddrs.3:287
2184 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2186 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2189 #: build/C/man2/getsockname.2:38
2192 msgstr "GETSOCKNAME"
2195 #: build/C/man2/getsockname.2:41
2196 msgid "getsockname - get socket name"
2197 msgstr "getsockname - ソケットの名前を取得する"
2200 #: build/C/man2/getsockname.2:47
2202 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2203 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2206 #: build/C/man2/getsockname.2:60
2208 "B<getsockname>() returns the current address to which the socket I<sockfd> "
2209 "is bound, in the buffer pointed to by I<addr>. The I<addrlen> argument "
2210 "should be initialized to indicate the amount of space (in bytes) pointed to "
2211 "by I<addr>. On return it contains the actual size of the socket address."
2213 "B<getsockname>() は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2214 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2215 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2216 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2220 #: build/C/man2/getsockname.2:76 build/C/man2/getsockopt.2:140
2221 #: build/C/man2/listen.2:94
2222 msgid "The argument I<sockfd> is not a valid descriptor."
2223 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2226 #: build/C/man2/getsockname.2:82
2228 "The I<addr> argument points to memory not in a valid part of the process "
2231 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2235 #: build/C/man2/getsockname.2:86
2236 msgid "I<addrlen> is invalid (e.g., is negative)."
2237 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2240 #: build/C/man2/getsockname.2:86 build/C/man2/send.2:333
2246 #: build/C/man2/getsockname.2:90
2248 "Insufficient resources were available in the system to perform the operation."
2249 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2252 #: build/C/man2/getsockname.2:95 build/C/man2/getsockopt.2:169
2253 msgid "The argument I<sockfd> is a file, not a socket."
2254 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2256 #. SVr4 documents additional ENOMEM
2257 #. and ENOSR error codes.
2259 #: build/C/man2/getsockname.2:101
2261 "SVr4, 4.4BSD (the B<getsockname>() function call appeared in 4.2BSD), "
2264 "SVr4, 4.4BSD (B<getsockname>() 関数は 4.2BSD で追加された), POSIX.1-2001."
2267 #: build/C/man2/getsockname.2:110
2269 "The third argument of B<getsockname>() is in reality an I<int *> (and this "
2270 "is what 4.x BSD and libc4 and libc5 have). Some POSIX confusion resulted in "
2271 "the present I<socklen_t>, also used by glibc. See also B<accept>(2)."
2273 "B<getsockname>() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2274 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2275 "POSIX には少し混乱がある。 詳しくは B<accept>(2) を参照のこと。"
2278 #: build/C/man2/getsockname.2:117
2280 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2283 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2287 #: build/C/man2/getsockopt.2:42
2293 #: build/C/man2/getsockopt.2:45
2294 msgid "getsockopt, setsockopt - get and set options on sockets"
2295 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2298 #: build/C/man2/getsockopt.2:55
2301 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2302 "B< void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2303 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2304 "B< const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2306 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2307 "B< void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2308 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2309 "B< const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2312 #: build/C/man2/getsockopt.2:65
2314 "B<getsockopt>() and B<setsockopt>() manipulate options for the socket "
2315 "referred to by the file descriptor I<sockfd>. Options may exist at multiple "
2316 "protocol levels; they are always present at the uppermost socket level."
2318 "B<getsockopt>() と B<setsockopt>() は、ファイルディスクリプタ I<socket> で"
2319 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2320 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2324 #: build/C/man2/getsockopt.2:84
2326 "When manipulating socket options, the level at which the option resides and "
2327 "the name of the option must be specified. To manipulate options at the "
2328 "sockets API level, I<level> is specified as B<SOL_SOCKET>. To manipulate "
2329 "options at any other level the protocol number of the appropriate protocol "
2330 "controlling the option is supplied. For example, to indicate that an option "
2331 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2332 "protocol number of B<TCP>; see B<getprotoent>(3)."
2334 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2335 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2336 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2337 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2338 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2339 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2340 "B<getprotoent>(3) を参照すること。"
2343 #: build/C/man2/getsockopt.2:106
2345 "The arguments I<optval> and I<optlen> are used to access option values for "
2346 "B<setsockopt>(). For B<getsockopt>() they identify a buffer in which the "
2347 "value for the requested option(s) are to be returned. For B<getsockopt>(), "
2348 "I<optlen> is a value-result argument, initially containing the size of the "
2349 "buffer pointed to by I<optval>, and modified on return to indicate the "
2350 "actual size of the value returned. If no option value is to be supplied or "
2351 "returned, I<optval> may be NULL."
2353 "I<optval> と I<optlen> 引き数は B<setsockopt>() のオプションの値にアクセスす"
2354 "るために用いられる。 B<getsockopt>() では要求したオプションの値を返すための"
2355 "バッファーを指定する。 B<getsockopt>() では I<optlen> は値と結果両用の引き数"
2356 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2357 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2358 "I<optval> は NULL でも良い。"
2361 #: build/C/man2/getsockopt.2:116
2363 "I<Optname> and any specified options are passed uninterpreted to the "
2364 "appropriate protocol module for interpretation. The include file I<E<lt>sys/"
2365 "socket.hE<gt>> contains definitions for socket level options, described "
2366 "below. Options at other protocol levels vary in format and name; consult "
2367 "the appropriate entries in section 4 of the manual."
2369 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2370 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2371 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2372 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2376 #: build/C/man2/getsockopt.2:125
2378 "Most socket-level options utilize an I<int> argument for I<optval>. For "
2379 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2380 "or zero if the option is to be disabled."
2382 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2383 "B<setsockopt>() で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2384 "を指定し、 無効(disable)にするにはゼロを指定する。"
2387 #: build/C/man2/getsockopt.2:129
2389 "For a description of the available socket options see B<socket>(7) and the "
2390 "appropriate protocol man pages."
2392 "利用可能なソケットオプションの説明に関しては、 B<socket>(7) と適切なプロトコ"
2396 #: build/C/man2/getsockopt.2:150
2398 "The address pointed to by I<optval> is not in a valid part of the process "
2399 "address space. For B<getsockopt>(), this error may also be returned if "
2400 "I<optlen> is not in a valid part of the process address space."
2402 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2403 "B<getsockopt>() の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2407 #: build/C/man2/getsockopt.2:161
2409 "I<optlen> invalid in B<setsockopt>(). In some cases this error can also "
2410 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2411 "option described in B<ip>(7))."
2413 "B<setsockopt>() で I<option> が不正である。 I<optval> に無効な値が指定された"
2414 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7) に説明がある "
2415 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2418 #: build/C/man2/getsockopt.2:161
2420 msgid "B<ENOPROTOOPT>"
2421 msgstr "B<ENOPROTOOPT>"
2424 #: build/C/man2/getsockopt.2:164
2425 msgid "The option is unknown at the level indicated."
2426 msgstr "指定された層(level)にはこのオプションは存在しない。"
2428 #. SVr4 documents additional ENOMEM and ENOSR error codes, but does
2430 #. .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2433 #: build/C/man2/getsockopt.2:176
2435 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2437 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2441 #: build/C/man2/getsockopt.2:197
2443 "The I<optlen> argument of B<getsockopt>() and B<setsockopt>() is in "
2444 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have). "
2445 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2446 "glibc. See also B<accept>(2)."
2448 "B<getsockopt>() と B<setsockopt>() の I<optlen> 引き数は実際は I<int [*]> "
2449 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2450 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2451 "る。 B<accept>(2) も参照のこと。"
2454 #: build/C/man2/getsockopt.2:200
2456 "Several of the socket options should be handled at lower levels of the "
2459 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2462 #: build/C/man2/getsockopt.2:208
2464 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2465 "B<tcp>(7), B<unix>(7)"
2467 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2468 "B<tcp>(7), B<unix>(7)"
2471 #: build/C/man2/listen.2:43
2477 #: build/C/man2/listen.2:43
2483 #: build/C/man2/listen.2:46
2484 msgid "listen - listen for connections on a socket"
2485 msgstr "listen - ソケット(socket)上の接続を待つ"
2488 #: build/C/man2/listen.2:53
2490 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2491 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2494 #: build/C/man2/listen.2:61
2496 "B<listen>() marks the socket referred to by I<sockfd> as a passive socket, "
2497 "that is, as a socket that will be used to accept incoming connection "
2498 "requests using B<accept>(2)."
2500 "B<listen>() は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2501 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2) を使って到着"
2502 "した接続要求を受け付けるのに使用されるソケットである。"
2505 #: build/C/man2/listen.2:68
2507 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2508 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2510 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2514 #: build/C/man2/listen.2:80
2516 "The I<backlog> argument defines the maximum length to which the queue of "
2517 "pending connections for I<sockfd> may grow. If a connection request arrives "
2518 "when the queue is full, the client may receive an error with an indication "
2519 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2520 "the request may be ignored so that a later reattempt at connection succeeds."
2522 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2523 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2524 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2525 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2529 #: build/C/man2/listen.2:89
2530 msgid "Another socket is already listening on the same port."
2531 msgstr "別のソケットが既に同じポートを listen している。"
2534 #: build/C/man2/listen.2:99 build/C/man2/send.2:352
2535 msgid "The argument I<sockfd> is not a socket."
2536 msgstr "引き数 I<sockfd> はソケットではない。"
2539 #: build/C/man2/listen.2:104
2540 msgid "The socket is not of a type that supports the B<listen>() operation."
2541 msgstr "ソケットは B<listen>() がサポートしている型ではない。"
2544 #: build/C/man2/listen.2:109
2546 "4.4BSD, POSIX.1-2001. The B<listen>() function call first appeared in "
2548 msgstr "4.4BSD, POSIX.1-2001. B<listen>() 関数は 4.2BSDで初めて実装された。"
2551 #: build/C/man2/listen.2:111
2552 msgid "To accept connections, the following steps are performed:"
2553 msgstr "接続を受け付けるには、以下の処理が実行される。"
2556 #: build/C/man2/listen.2:112 build/C/man2/select_tut.2:345
2562 #: build/C/man2/listen.2:115
2563 msgid "A socket is created with B<socket>(2)."
2564 msgstr "B<socket>(2) でソケットを作成する。"
2567 #: build/C/man2/listen.2:115 build/C/man2/select_tut.2:354
2573 #: build/C/man2/listen.2:121
2575 "The socket is bound to a local address using B<bind>(2), so that other "
2576 "sockets may be B<connect>(2)ed to it."
2578 "B<bind>(2) を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2579 "のソケットに B<connect>(2) できるようにする。"
2582 #: build/C/man2/listen.2:121 build/C/man2/select_tut.2:358
2588 #: build/C/man2/listen.2:125
2590 "A willingness to accept incoming connections and a queue limit for incoming "
2591 "connections are specified with B<listen>()."
2593 "B<listen>() を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2597 #: build/C/man2/listen.2:125 build/C/man2/select_tut.2:365
2603 #: build/C/man2/listen.2:128
2604 msgid "Connections are accepted with B<accept>(2)."
2605 msgstr "B<accept>(2) を使って接続を受け付ける。"
2608 #: build/C/man2/listen.2:151
2610 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2611 "2.2. Now it specifies the queue length for I<completely> established "
2612 "sockets waiting to be accepted, instead of the number of incomplete "
2613 "connection requests. The maximum length of the queue for incomplete sockets "
2614 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>. When syncookies "
2615 "are enabled there is no logical maximum length and this setting is ignored. "
2616 "See B<tcp>(7) for more information."
2618 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2619 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2620 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2621 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2622 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2623 "論理的な最大長は存在せず、この設定は無視される。"
2625 #. The following is now rather historic information (MTK, Jun 05)
2626 #. Don't rely on this value in portable applications since BSD
2627 #. (and some BSD-derived systems) limit the backlog to 5.
2629 #: build/C/man2/listen.2:164
2631 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2632 "somaxconn>, then it is silently truncated to that value; the default value "
2633 "in this file is 128. In kernels before 2.4.25, this limit was a hard coded "
2634 "value, B<SOMAXCONN>, with the value 128."
2636 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2637 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2638 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2639 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2642 #: build/C/man2/listen.2:173
2643 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2644 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2647 #: build/C/man2/recv.2:39
2653 #: build/C/man2/recv.2:39
2659 #: build/C/man2/recv.2:42
2660 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
2661 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
2664 #: build/C/man2/recv.2:47 build/C/man2/select.2:53
2665 #: build/C/man2/select_tut.2:45
2667 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
2668 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
2671 #: build/C/man2/recv.2:51
2673 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2674 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2677 #: build/C/man2/recv.2:54
2680 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2681 "B< struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2683 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2684 "B< struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2687 #: build/C/man2/recv.2:56
2689 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2690 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2693 #: build/C/man2/recv.2:64
2695 "The B<recvfrom>() and B<recvmsg>() calls are used to receive messages from "
2696 "a socket, and may be used to receive data on a socket whether or not it is "
2697 "connection-oriented."
2699 "B<recvfrom>() と B<recvmsg>() コールは、ソケットからメッセージを受け取るの"
2700 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
2701 "接続指向 (connection-oriened) であってもなくてもよい。"
2703 #. (Note: for datagram sockets in both the UNIX and Internet domains,
2707 #. is also filled in for stream sockets in the UNIX domain, but is not
2708 #. filled in for stream sockets in the Internet domain.)
2709 #. [The above notes on AF_UNIX and AF_INET sockets apply as at
2710 #. Kernel 2.4.18. (MTK, 22 Jul 02)]
2712 #: build/C/man2/recv.2:93
2714 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
2715 "address, this source address is filled in. When I<src_addr> is NULL, "
2716 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
2717 "be NULL. The argument I<addrlen> is a value-result argument, which the "
2718 "caller should initialize before the call to the size of the buffer "
2719 "associated with I<src_addr>, and modified on return to indicate the actual "
2720 "size of the source address. The returned address is truncated if the buffer "
2721 "provided is too small; in this case, I<addrlen> will return a value greater "
2722 "than was supplied to the call."
2724 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
2725 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
2726 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
2727 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
2728 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
2729 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
2730 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
2731 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
2735 #: build/C/man2/recv.2:105
2737 "The B<recv>() call is normally used only on a I<connected> socket (see "
2738 "B<connect>(2)) and is identical to B<recvfrom>() with a NULL I<src_addr> "
2741 "B<recv>() コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2) を"
2742 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
2746 #: build/C/man2/recv.2:111
2748 "All three routines return the length of the message on successful "
2749 "completion. If a message is too long to fit in the supplied buffer, excess "
2750 "bytes may be discarded depending on the type of socket the message is "
2753 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
2754 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
2755 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
2758 #: build/C/man2/recv.2:121
2760 "If no messages are available at the socket, the receive calls wait for a "
2761 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
2762 "which case the value -1 is returned and the external variable I<errno> is "
2763 "set to B<EAGAIN> or B<EWOULDBLOCK>. The receive calls normally return any "
2764 "data available, up to the requested amount, rather than waiting for receipt "
2765 "of the full amount requested."
2767 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
2768 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking) に設定されていた"
2769 "場合 (B<fcntl>(2) を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
2770 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
2771 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
2772 "る (受信されるデータの最大サイズは要求したサイズである)。"
2775 #: build/C/man2/recv.2:127
2777 "The B<select>(2) or B<poll>(2) call may be used to determine when more "
2780 "B<select>(2) や B<poll>(2) コールを使って、次のデータがいつ届くかを判断でき"
2784 #: build/C/man2/recv.2:133
2786 "The I<flags> argument to a B<recv>() call is formed by ORing one or more of "
2787 "the following values:"
2789 "B<recv>() コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
2793 #: build/C/man2/recv.2:133
2795 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
2796 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
2799 #: build/C/man2/recv.2:144
2801 "Set the close-on-exec flag for the file descriptor received via a UNIX "
2802 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
2803 "B<unix>(7)). This flag is useful for the same reasons as the B<O_CLOEXEC> "
2804 "flag of B<open>(2)."
2806 "(B<unix>(7) で説明されている) B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
2807 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
2808 "exec フラグをセットする。 このフラグは、 B<open>(2) の B<O_CLOEXEC> フラグと"
2812 #: build/C/man2/recv.2:144 build/C/man2/send.2:186
2814 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
2815 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
2818 #: build/C/man2/recv.2:154
2820 "Enables nonblocking operation; if the operation would block, the call fails "
2821 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
2822 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
2824 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
2825 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2) の B<F_SETFL> "
2826 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
2829 #: build/C/man2/recv.2:154
2831 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
2832 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
2835 #: build/C/man2/recv.2:173
2837 "This flag specifies that queued errors should be received from the socket "
2838 "error queue. The error is passed in an ancillary message with a type "
2839 "dependent on the protocol (for IPv4 B<IP_RECVERR>). The user should supply "
2840 "a buffer of sufficient size. See B<cmsg>(3) and B<ip>(7) for more "
2841 "information. The payload of the original packet that caused the error is "
2842 "passed as normal data via I<msg_iovec>. The original destination address of "
2843 "the datagram that caused the error is supplied via I<msg_name>."
2845 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
2846 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
2847 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
2848 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
2849 "るより詳細な情報は B<cmsg>(3) および B<ip>(7) を参照のこと。 エラーの原因と"
2850 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
2851 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
2852 "I<msg_name> 経由で参照できる。"
2855 #: build/C/man2/recv.2:185 build/C/man2/recv.2:248
2857 "For local errors, no address is passed (this can be checked with the "
2858 "I<cmsg_len> member of the I<cmsghdr>). For error receives, the "
2859 "B<MSG_ERRQUEUE> is set in the I<msghdr>. After an error has been passed, "
2860 "the pending socket error is regenerated based on the next queued error and "
2861 "will be passed on the next socket operation."
2863 "ローカルなエラーの場合はアドレスは渡されない\n"
2864 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
2865 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
2866 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
2867 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
2870 #: build/C/man2/recv.2:189
2871 msgid "The error is supplied in a I<sock_extended_err> structure:"
2872 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
2875 #: build/C/man2/recv.2:196
2878 "#define SO_EE_ORIGIN_NONE 0\n"
2879 "#define SO_EE_ORIGIN_LOCAL 1\n"
2880 "#define SO_EE_ORIGIN_ICMP 2\n"
2881 "#define SO_EE_ORIGIN_ICMP6 3\n"
2883 "#define SO_EE_ORIGIN_NONE 0\n"
2884 "#define SO_EE_ORIGIN_LOCAL 1\n"
2885 "#define SO_EE_ORIGIN_ICMP 2\n"
2886 "#define SO_EE_ORIGIN_ICMP6 3\n"
2889 #: build/C/man2/recv.2:208
2892 "struct sock_extended_err\n"
2894 " uint32_t ee_errno; /* error number */\n"
2895 " uint8_t ee_origin; /* where the error originated */\n"
2896 " uint8_t ee_type; /* type */\n"
2897 " uint8_t ee_code; /* code */\n"
2898 " uint8_t ee_pad; /* padding */\n"
2899 " uint32_t ee_info; /* additional information */\n"
2900 " uint32_t ee_data; /* other data */\n"
2901 " /* More data may follow */\n"
2904 "struct sock_extended_err\n"
2906 " uint32_t ee_errno; /* error number */\n"
2907 " uint8_t ee_origin; /* where the error originated */\n"
2908 " uint8_t ee_type; /* type */\n"
2909 " uint8_t ee_code; /* code */\n"
2910 " uint8_t ee_pad; /* padding */\n"
2911 " uint32_t ee_info; /* additional information */\n"
2912 " uint32_t ee_data; /* other data */\n"
2913 " /* More data may follow */\n"
2917 #: build/C/man2/recv.2:210
2919 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2920 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2923 #: build/C/man2/recv.2:234
2925 "I<ee_errno> contains the I<errno> number of the queued error. I<ee_origin> "
2926 "is the origin code of where the error originated. The other fields are "
2927 "protocol-specific. The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
2928 "address of the network object where the error originated from given a "
2929 "pointer to the ancillary message. If this address is not known, the "
2930 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
2931 "fields of the I<sockaddr> are undefined. The payload of the packet that "
2932 "caused the error is passed as normal data."
2934 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
2935 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
2936 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
2937 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
2938 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
2939 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
2940 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
2944 #: build/C/man2/recv.2:248 build/C/man2/recv.2:379 build/C/man2/send.2:228
2950 #: build/C/man2/recv.2:255
2952 "This flag requests receipt of out-of-band data that would not be received in "
2953 "the normal data stream. Some protocols place expedited data at the head of "
2954 "the normal data queue, and thus this flag cannot be used with such protocols."
2956 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
2957 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
2958 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
2962 #: build/C/man2/recv.2:255
2965 msgstr "B<MSG_PEEK>"
2968 #: build/C/man2/recv.2:262
2970 "This flag causes the receive operation to return data from the beginning of "
2971 "the receive queue without removing that data from the queue. Thus, a "
2972 "subsequent receive call will return the same data."
2974 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
2975 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
2979 #: build/C/man2/recv.2:262
2981 msgid "B<MSG_TRUNC> (since Linux 2.2)"
2982 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
2985 #: build/C/man2/recv.2:273
2987 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), and "
2988 "netlink (since Linux 2.6.22) sockets: return the real length of the packet "
2989 "or datagram, even when it was longer than the passed buffer. Not "
2990 "implemented for UNIX domain (B<unix>(7)) sockets."
2992 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
2993 "以降)、 netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの"
2994 "長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長"
2995 "さを返す。 UNIX ドメインソケット (B<unix>(7)) ソケットについては実装されてい"
2999 #: build/C/man2/recv.2:276
3000 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3001 msgstr "Internet ストリームソケットでの利用については B<tcp>(7) を参照。"
3004 #: build/C/man2/recv.2:276
3006 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3007 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3010 #: build/C/man2/recv.2:283
3012 "This flag requests that the operation block until the full request is "
3013 "satisfied. However, the call may still return less data than requested if a "
3014 "signal is caught, an error or disconnect occurs, or the next data to be "
3015 "received is of a different type than that returned."
3017 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3018 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3019 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3020 "りデータが少なくても返ることがある。"
3023 #: build/C/man2/recv.2:291
3025 "The B<recvmsg>() call uses a I<msghdr> structure to minimize the number of "
3026 "directly supplied arguments. This structure is defined as follows in "
3027 "I<E<lt>sys/socket.hE<gt>>:"
3029 "B<recvmsg>() コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3030 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3033 #: build/C/man2/recv.2:298
3036 "struct iovec { /* Scatter/gather array items */\n"
3037 " void *iov_base; /* Starting address */\n"
3038 " size_t iov_len; /* Number of bytes to transfer */\n"
3041 "struct iovec { /* Scatter/gather array items */\n"
3042 " void *iov_base; /* Starting address */\n"
3043 " size_t iov_len; /* Number of bytes to transfer */\n"
3047 #: build/C/man2/recv.2:308 build/C/man2/send.2:256
3051 " void *msg_name; /* optional address */\n"
3052 " socklen_t msg_namelen; /* size of address */\n"
3053 " struct iovec *msg_iov; /* scatter/gather array */\n"
3054 " size_t msg_iovlen; /* # elements in msg_iov */\n"
3055 " void *msg_control; /* ancillary data, see below */\n"
3056 " size_t msg_controllen; /* ancillary data buffer len */\n"
3057 " int msg_flags; /* flags on received message */\n"
3061 " void *msg_name; /* 追加のアドレス */\n"
3062 " socklen_t msg_namelen; /* アドレスのサイズ */\n"
3063 " struct iovec *msg_iov; /* scatter/gather 配列 */\n"
3064 " size_t msg_iovlen; /* msg_iov の要素数 */\n"
3065 " void *msg_control; /* 補助データ (後述) */\n"
3066 " size_t msg_controllen; /* 補助データバッファ長 */\n"
3067 " int msg_flags; /* 受信メッセージのフラグ */\n"
3071 #: build/C/man2/recv.2:338
3073 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3074 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3075 "desired or required. The fields I<msg_iov> and I<msg_iovlen> describe "
3076 "scatter-gather locations, as discussed in B<readv>(2). The field "
3077 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3078 "other protocol control-related messages or miscellaneous ancillary data. "
3079 "When B<recvmsg>() is called, I<msg_controllen> should contain the length of "
3080 "the available buffer in I<msg_control>; upon return from a successful call "
3081 "it will contain the length of the control message sequence."
3083 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3084 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3085 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2) に記述されている"
3086 "ような分解/結合用のベクトル (scatter-gather locations) を指定する。 "
3087 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3088 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3089 "B<recvmsg>() を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3090 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3094 #: build/C/man2/recv.2:340
3095 msgid "The messages are of the form:"
3096 msgstr "メッセージの形式は以下の通り:"
3099 #: build/C/man2/recv.2:350
3102 "struct cmsghdr {\n"
3103 " socklen_t cmsg_len; /* data byte count, including hdr */\n"
3104 " int cmsg_level; /* originating protocol */\n"
3105 " int cmsg_type; /* protocol-specific type */\n"
3107 " unsigned char cmsg_data[]; */\n"
3110 "struct cmsghdr {\n"
3111 " socklen_t cmsg_len; /* data byte count, including hdr */\n"
3112 " int cmsg_level; /* originating protocol */\n"
3113 " int cmsg_type; /* protocol-specific type */\n"
3115 " unsigned char cmsg_data[]; */\n"
3119 #: build/C/man2/recv.2:355
3121 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3123 "補助データは、 B<cmsg>(3) に定義されたマクロ経由でのみアクセスすべきである。"
3126 #: build/C/man2/recv.2:358
3128 "As an example, Linux uses this ancillary data mechanism to pass extended "
3129 "errors, IP options, or file descriptors over UNIX domain sockets."
3131 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3132 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3136 #: build/C/man2/recv.2:366
3138 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>(). "
3139 "It can contain several flags:"
3141 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>() からのリターン時に設定さ"
3142 "れる。ここにはいくつかのフラグが入る。"
3145 #: build/C/man2/recv.2:366
3151 #: build/C/man2/recv.2:371
3153 "indicates end-of-record; the data returned completed a record (generally "
3154 "used with sockets of type B<SOCK_SEQPACKET>)."
3156 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3157 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3160 #: build/C/man2/recv.2:371
3162 msgid "B<MSG_TRUNC>"
3163 msgstr "B<MSG_TRUNC>"
3166 #: build/C/man2/recv.2:375
3168 "indicates that the trailing portion of a datagram was discarded because the "
3169 "datagram was larger than the buffer supplied."
3171 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3175 #: build/C/man2/recv.2:375
3177 msgid "B<MSG_CTRUNC>"
3178 msgstr "B<MSG_CTRUNC>"
3181 #: build/C/man2/recv.2:379
3183 "indicates that some control data were discarded due to lack of space in the "
3184 "buffer for ancillary data."
3186 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3190 #: build/C/man2/recv.2:382
3192 "is returned to indicate that expedited or out-of-band data were received."
3193 msgstr "速達データや帯域外データを受信したことを示す。"
3196 #: build/C/man2/recv.2:382
3198 msgid "B<MSG_ERRQUEUE>"
3199 msgstr "B<MSG_ERRQUEUE>"
3202 #: build/C/man2/recv.2:386
3204 "indicates that no data was received but an extended error from the socket "
3207 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3211 #: build/C/man2/recv.2:391
3213 "These calls return the number of bytes received, or -1 if an error "
3214 "occurred. The return value will be 0 when the peer has performed an orderly "
3217 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3218 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3221 #: build/C/man2/recv.2:396
3223 "These are some standard errors generated by the socket layer. Additional "
3224 "errors may be generated and returned from the underlying protocol modules; "
3225 "see their manual pages."
3227 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3228 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3231 #. Actually EAGAIN on Linux
3233 #: build/C/man2/recv.2:405
3235 "The socket is marked nonblocking and the receive operation would block, or a "
3236 "receive timeout had been set and the timeout expired before data was "
3237 "received. POSIX.1-2001 allows either error to be returned for this case, "
3238 "and does not require these constants to have the same value, so a portable "
3239 "application should check for both possibilities."
3241 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3242 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3243 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3244 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3245 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3248 #: build/C/man2/recv.2:410
3249 msgid "The argument I<sockfd> is an invalid descriptor."
3250 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3253 #: build/C/man2/recv.2:414
3255 "A remote host refused to allow the network connection (typically because it "
3256 "is not running the requested service)."
3258 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3259 "たサービスが起動されていないなどがある)。"
3262 #: build/C/man2/recv.2:418
3264 "The receive buffer pointer(s) point outside the process's address space."
3265 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3268 #: build/C/man2/recv.2:423
3270 "The receive was interrupted by delivery of a signal before any data were "
3271 "available; see B<signal>(7)."
3273 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7) 参照。"
3276 #: build/C/man2/recv.2:427 build/C/man2/send.2:321
3277 msgid "Invalid argument passed."
3278 msgstr "不正な引き数が渡された。"
3281 #: build/C/man2/recv.2:431
3282 msgid "Could not allocate memory for B<recvmsg>()."
3283 msgstr "B<recvmsg>() のためのメモリが確保できなかった。"
3286 #: build/C/man2/recv.2:431 build/C/man2/send.2:344
3289 msgstr "B<ENOTCONN>"
3292 #: build/C/man2/recv.2:438
3294 "The socket is associated with a connection-oriented protocol and has not "
3295 "been connected (see B<connect>(2) and B<accept>(2))."
3297 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3298 "(B<connect>(2) と B<accept>(2) を参照のこと)。"
3301 #: build/C/man2/recv.2:443
3302 msgid "The argument I<sockfd> does not refer to a socket."
3303 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3306 #: build/C/man2/recv.2:446
3307 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3308 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3311 #: build/C/man2/recv.2:453
3313 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3316 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3320 #: build/C/man2/recv.2:469
3322 "The prototypes given above follow glibc2. The Single UNIX Specification "
3323 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3324 "and libc4 and libc5 all have I<int>). The I<flags> argument is I<int> in 4."
3325 "x BSD, but I<unsigned int> in libc4 and libc5. The I<len> argument is "
3326 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5. The I<addrlen> "
3327 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5. The present I<socklen_t"
3328 "\\ *> was invented by POSIX. See also B<accept>(2)."
3330 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3331 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3332 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3333 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3334 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3335 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3336 "POSIX で発案された。 B<accept>(2) も参照すること。"
3338 #. glibc bug raised 12 Mar 2006
3339 #. http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3340 #. The problem is an underlying kernel issue: the size of the
3341 #. __kernel_size_t type used to type this field varies
3342 #. across architectures, but socklen_t is always 32 bits.
3344 #: build/C/man2/recv.2:483 build/C/man2/send.2:407
3346 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3347 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3350 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3351 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3355 #: build/C/man2/recv.2:488
3357 "See B<recvmmsg(2)> for information about a Linux-specific system call that "
3358 "can be used to receive multiple datagrams in a single call."
3360 "B<recvmmsg>(2) には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3361 "固有の システムコールに関する情報が書かれている。"
3364 #: build/C/man2/recv.2:493
3365 msgid "An example of the use of B<recvfrom>() is shown in B<getaddrinfo>(3)."
3366 msgstr "B<recvfrom>() の利用例が B<getaddrinfo>(3) に記載されている。"
3369 #: build/C/man2/recv.2:504
3371 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3372 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3374 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3375 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3378 #: build/C/man2/recvmmsg.2:26
3384 #: build/C/man2/recvmmsg.2:26 build/C/man2/select.2:38
3386 #| msgid "2012-04-23"
3391 #: build/C/man2/recvmmsg.2:29
3392 msgid "recvmmsg - receive multiple messages on a socket"
3396 #: build/C/man2/recvmmsg.2:33 build/C/man2/sendmmsg.2:35
3399 "B<#define _GNU_SOURCE>\n"
3400 "B<#include E<lt>sys/socket.hE<gt>>\n"
3402 "B<#define _GNU_SOURCE>\n"
3403 "B<#include E<lt>sys/socket.hE<gt>>\n"
3406 #: build/C/man2/recvmmsg.2:36
3408 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3409 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3412 #: build/C/man2/recvmmsg.2:38
3414 msgid "B< unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3415 msgstr "B< unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3418 #: build/C/man2/recvmmsg.2:50
3420 "The B<recvmmsg>() system call is an extension of B<recvmsg>(2) that allows "
3421 "the caller to receive multiple messages from a socket using a single system "
3422 "call. (This has performance benefits for some applications.) A further "
3423 "extension over B<recvmsg>(2) is support for a timeout on the receive "
3428 #: build/C/man2/recvmmsg.2:54
3430 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3435 #: build/C/man2/recvmmsg.2:62 build/C/man2/sendmmsg.2:62
3437 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures. "
3438 "The size of this array is specified in I<vlen>."
3442 #: build/C/man2/recvmmsg.2:68 build/C/man2/sendmmsg.2:68
3443 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3447 #: build/C/man2/recvmmsg.2:75
3450 "struct mmsghdr {\n"
3451 " struct msghdr msg_hdr; /* Message header */\n"
3452 " unsigned int msg_len; /* Number of received bytes for header */\n"
3455 "struct mmsghdr {\n"
3456 " struct msghdr msg_hdr; /* Message header */\n"
3457 " unsigned int msg_len; /* Number of received bytes for header */\n"
3461 #: build/C/man2/recvmmsg.2:90
3463 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3464 "(2). The I<msg_len> field is the number of bytes returned for the message "
3465 "in the entry. This field has the same value as the return value of a single "
3466 "B<recvmsg>(2) on the header."
3470 #: build/C/man2/recvmmsg.2:97
3472 "The I<flags> argument contains flags ORed together. The flags are the same "
3473 "as documented for B<recvmsg>(2), with the following addition:"
3477 #: build/C/man2/recvmmsg.2:97
3479 msgid "B<MSG_WAITFORONE>"
3480 msgstr "B<MSG_WAITFORONE>"
3483 #: build/C/man2/recvmmsg.2:102
3484 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3488 #: build/C/man2/recvmmsg.2:118
3490 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3491 "(2)) defining a timeout (seconds plus nanoseconds) for the receive "
3492 "operation. (This interval will be rounded up to the system clock "
3493 "granularity, and kernel scheduling delays mean that the blocking interval "
3494 "may overrun by a small amount.) If I<timeout> is I<NULL> then the operation "
3495 "blocks indefinitely."
3499 #: build/C/man2/recvmmsg.2:129
3501 "A blocking B<recvmmsg>() call blocks until I<vlen> messages have been "
3502 "received or until the timeout expires. A nonblocking call reads as many "
3503 "messages as are available (up to the limit specified by I<vlen>) and "
3504 "returns immediately."
3508 #: build/C/man2/recvmmsg.2:144
3510 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3511 "to contain information about each received message: I<msg_len> contains the "
3512 "size of the received message; the subfields of I<msg_hdr> are updated as "
3513 "described in B<recvmsg>(2). The return value of the call indicates the "
3514 "number of elements of I<msgvec> that have been updated."
3518 #: build/C/man2/recvmmsg.2:152
3520 "On success, B<recvmmsg>() returns the number of messages received in "
3521 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3526 #: build/C/man2/recvmmsg.2:156
3528 "Errors are as for B<recvmsg>(2). In addition, the following error can occur:"
3532 #: build/C/man2/recvmmsg.2:160
3533 msgid "I<timeout> is invalid."
3537 #: build/C/man2/recvmmsg.2:165
3539 "The B<recvmmsg>() system call was added in Linux 2.6.32. Support in glibc "
3540 "was added in version 2.12."
3544 #: build/C/man2/recvmmsg.2:168
3545 msgid "B<recvmmsg>() is Linux-specific."
3549 #: build/C/man2/recvmmsg.2:175
3551 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3554 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3558 #: build/C/man2/select.2:38
3564 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:34
3566 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
3568 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
3571 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:37
3573 msgid "/* According to POSIX.1-2001 */\n"
3574 msgstr "/* POSIX.1-2001 に従う場合 */\n"
3577 #: build/C/man2/select.2:47 build/C/man2/select.2:68
3578 #: build/C/man2/select_tut.2:39 build/C/man2/select_tut.2:60
3580 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
3581 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
3584 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:41
3586 msgid "/* According to earlier standards */\n"
3587 msgstr "/* 以前の規格に従う場合 */\n"
3590 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:43
3592 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
3593 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
3596 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:47
3598 msgid "B<#include E<lt>unistd.hE<gt>>\n"
3599 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
3602 #: build/C/man2/select.2:58
3605 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3606 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3608 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3609 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3612 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:52
3614 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3615 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3618 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:54
3620 msgid "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3621 msgstr "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3624 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:56
3626 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3627 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3630 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:58
3632 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3633 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3636 #: build/C/man2/select.2:72
3639 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3640 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3641 "B< const sigset_t *>I<sigmask>B<);>\n"
3643 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3644 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3645 "B< const sigset_t *>I<sigmask>B<);>\n"
3648 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:69
3649 #: build/C/man3/sockatmark.3:34
3651 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3652 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
3655 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:73
3657 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3660 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3664 #: build/C/man2/select.2:92
3666 "B<select>() and B<pselect>() allow a program to monitor multiple file "
3667 "descriptors, waiting until one or more of the file descriptors become \"ready"
3668 "\" for some class of I/O operation (e.g., input possible). A file "
3669 "descriptor is considered ready if it is possible to perform the "
3670 "corresponding I/O operation (e.g., B<read>(2)) without blocking."
3672 "B<select>() や B<pselect>() を使うと、プログラムで複数のファイルディスクリ"
3673 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
3674 "(準備ができた)」状態 (例えば、読み込み可能になった状態) になるまで待つことが"
3675 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
3676 "作 (例えば B<read>(2) など) が停止 (block) なしに実行可能な状態にあることを"
3680 #: build/C/man2/select.2:98
3682 "The operation of B<select>() and B<pselect>() is identical, with three "
3685 "B<select>() と B<pselect>() の動作は同じであるが、以下の 3 点が異なる:"
3688 #: build/C/man2/select.2:98
3694 #: build/C/man2/select.2:108
3696 "B<select>() uses a timeout that is a I<struct timeval> (with seconds and "
3697 "microseconds), while B<pselect>() uses a I<struct timespec> (with seconds "
3700 "B<select>() では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
3701 "クロ秒単位) を用いる。 一方、 B<pselect>() 関数では、構造体 I<struct "
3702 "timespec> (秒・ナノ秒単位) を用いる。"
3705 #: build/C/man2/select.2:108
3711 #: build/C/man2/select.2:116
3713 "B<select>() may update the I<timeout> argument to indicate how much time "
3714 "was left. B<pselect>() does not change this argument."
3716 "B<select>() は残り時間を示す I<timeout> 引き数を更新することがある。 "
3717 "B<pselect>() はこの引き数を変更しない。"
3720 #: build/C/man2/select.2:116
3726 #: build/C/man2/select.2:125
3728 "B<select>() has no I<sigmask> argument, and behaves as B<pselect>() called "
3729 "with NULL I<sigmask>."
3731 "B<select>() は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
3732 "指定した場合の B<pselect>() と同じである。"
3735 #: build/C/man2/select.2:143
3737 "Three independent sets of file descriptors are watched. Those listed in "
3738 "I<readfds> will be watched to see if characters become available for reading "
3739 "(more precisely, to see if a read will not block; in particular, a file "
3740 "descriptor is also ready on end-of-file), those in I<writefds> will be "
3741 "watched to see if a write will not block, and those in I<exceptfds> will be "
3742 "watched for exceptions. On exit, the sets are modified in place to indicate "
3743 "which file descriptors actually changed status. Each of the three file "
3744 "descriptor sets may be specified as NULL if no file descriptors are to be "
3745 "watched for the corresponding class of events."
3747 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
3748 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
3749 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
3750 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
3751 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
3752 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
3753 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
3754 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
3755 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
3759 #: build/C/man2/select.2:156
3761 "Four macros are provided to manipulate the sets. B<FD_ZERO>() clears a "
3762 "set. B<FD_SET>() and B<FD_CLR>() respectively add and remove a given file "
3763 "descriptor from a set. B<FD_ISSET>() tests to see if a file descriptor is "
3764 "part of the set; this is useful after B<select>() returns."
3766 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>() は集合を消"
3767 "去する。 B<FD_SET>() と B<FD_CLR>() はそれぞれ指定したファイルディスクリプ"
3768 "タの集合への追加、削除を行う。 B<FD_ISSET>() は集合にファイルディスクリプタ"
3769 "があるかどうか調べる; このマクロは B<select>() が終了した後に使うと便利であ"
3773 #: build/C/man2/select.2:159
3775 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
3778 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
3782 #: build/C/man2/select.2:179
3785 #| "I<timeout> is an upper bound on the amount of time elapsed before "
3786 #| "B<select>() returns. If both fields of the I<timeval> structure are "
3787 #| "zero, then B<select>() returns immediately. (This is useful for "
3788 #| "polling.) If I<timeout> is NULL (no timeout), B<select>() can block "
3791 "The I<timeout> argument specifies the minimum interval that B<select>() "
3792 "should block waiting for a file descriptor to become ready. (This interval "
3793 "will be rounded up to the system clock granularity, and kernel scheduling "
3794 "delays mean that the blocking interval may overrun by a small amount.) If "
3795 "both fields of the I<timeval> structure are zero, then B<select>() returns "
3796 "immediately. (This is useful for polling.) If I<timeout> is NULL (no "
3797 "timeout), B<select>() can block indefinitely."
3799 "I<timeout> は B<select>() が復帰するまでの経過時間の上限である。 I<timeval> "
3800 "構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰する (この機能"
3801 "はポーリング (polling) を行うのに便利である)。 I<timeout> に NULL (タイムアウ"
3802 "トなし) が指定されると、 B<select>() は無期限に停止 (block) する。"
3805 #: build/C/man2/select.2:189
3807 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
3808 "not NULL, then B<pselect>() first replaces the current signal mask by the "
3809 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
3810 "restores the original signal mask."
3812 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2) を参照) へのポインタであ"
3813 "る。 I<sigmask> が NULL でない場合、 B<pselect>() は I<sigmask> が指している"
3814 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
3815 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
3818 #: build/C/man2/select.2:195
3820 "Other than the difference in the precision of the I<timeout> argument, the "
3821 "following B<pselect>() call:"
3823 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>() の呼び出しは、"
3826 #: build/C/man2/select.2:199
3829 " ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3830 " timeout, &sigmask);\n"
3832 " ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3833 " timeout, &sigmask);\n"
3836 #: build/C/man2/select.2:204
3837 msgid "is equivalent to I<atomically> executing the following calls:"
3838 msgstr "次のコールを I<atomic> に実行するのと等価である。"
3841 #: build/C/man2/select.2:207
3843 msgid " sigset_t origmask;\n"
3844 msgstr " sigset_t origmask;\n"
3847 #: build/C/man2/select.2:211
3850 " sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3851 " ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3852 " sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3854 " sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3855 " ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3856 " sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3859 #: build/C/man2/select.2:232
3861 "The reason that B<pselect>() is needed is that if one wants to wait for "
3862 "either a signal or for a file descriptor to become ready, then an atomic "
3863 "test is needed to prevent race conditions. (Suppose the signal handler sets "
3864 "a global flag and returns. Then a test of this global flag followed by a "
3865 "call of B<select>() could hang indefinitely if the signal arrived just "
3866 "after the test but just before the call. By contrast, B<pselect>() allows "
3867 "one to first block signals, handle the signals that have come in, then call "
3868 "B<pselect>() with the desired I<sigmask>, avoiding the race.)"
3870 "B<pselect>() が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
3871 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
3872 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
3873 "大域フラグのテストに続けて B<select>() を呼び出すと、 シグナルがテストの直後"
3874 "かつ呼び出しの直前に届いた時には B<select>() は永久にハングしてしまうかもし"
3875 "れない。 一方、 B<pselect>() を使うと、まずシグナルを禁止 (block) して、入っ"
3876 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>() を呼び出すこと"
3877 "で、前記の競合を避けることができる。)"
3880 #: build/C/man2/select.2:232
3886 #: build/C/man2/select.2:236
3888 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
3891 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
3894 #: build/C/man2/select.2:243
3897 "struct timeval {\n"
3898 " long tv_sec; /* seconds */\n"
3899 " long tv_usec; /* microseconds */\n"
3902 "struct timeval {\n"
3903 " long tv_sec; /* 秒 */\n"
3904 " long tv_usec; /* マイクロ秒 */\n"
3908 #: build/C/man2/select.2:247
3913 #: build/C/man2/select.2:254
3916 "struct timespec {\n"
3917 " long tv_sec; /* seconds */\n"
3918 " long tv_nsec; /* nanoseconds */\n"
3921 "struct timespec {\n"
3922 " long tv_sec; /* 秒 */\n"
3923 " long tv_nsec; /* ナノ秒 */\n"
3927 #: build/C/man2/select.2:258
3928 msgid "(However, see below on the POSIX.1-2001 versions.)"
3930 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
3934 #: build/C/man2/select.2:266
3936 "Some code calls B<select>() with all three sets empty, I<nfds> zero, and a "
3937 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
3940 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
3941 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>() を"
3942 "呼び出すという方法を使っているコードもある。"
3944 #. .PP - it is rumored that:
3945 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
3946 #. - it is certainly true that:
3947 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
3949 #: build/C/man2/select.2:289
3951 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
3952 "slept; most other implementations do not do this. (POSIX.1-2001 permits "
3953 "either behavior.) This causes problems both when Linux code which reads "
3954 "I<timeout> is ported to other operating systems, and when code is ported to "
3955 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
3956 "without reinitializing it. Consider I<timeout> to be undefined after "
3957 "B<select>() returns."
3959 "Linux では、 B<select>() は I<timeout> を変更し、残りの停止時間を反映するよ"
3960 "うになっているが、 他のほとんどの実装ではこのようになっていない "
3961 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
3962 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
3963 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
3964 "B<select>() を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
3965 "こる。 B<select>() から復帰した後は I<timeout> は未定義であると考えるべきで"
3969 #: build/C/man2/select.2:306
3971 "On success, B<select>() and B<pselect>() return the number of file "
3972 "descriptors contained in the three returned descriptor sets (that is, the "
3973 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>) "
3974 "which may be zero if the timeout expires before anything interesting "
3975 "happens. On error, -1 is returned, and I<errno> is set appropriately; the "
3976 "sets and I<timeout> become undefined, so do not rely on their contents after "
3979 "成功した場合、 B<select>() と B<pselect>() は更新された 3 つのディスクリプ"
3980 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
3981 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
3982 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
3983 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
3984 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
3987 #: build/C/man2/select.2:312
3989 "An invalid file descriptor was given in one of the sets. (Perhaps a file "
3990 "descriptor that was already closed, or one on which an error has occurred.)"
3992 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
3993 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
3997 #: build/C/man2/select.2:316
3998 msgid "A signal was caught; see B<signal>(7)."
4002 #: build/C/man2/select.2:322
4004 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4005 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4008 #: build/C/man2/select.2:325
4009 msgid "unable to allocate memory for internal tables."
4010 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4013 #: build/C/man2/select.2:331
4015 "B<pselect>() was added to Linux in kernel 2.6.16. Prior to this, B<pselect>"
4016 "() was emulated in glibc (but see BUGS)."
4018 "B<pselect>() はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4019 "B<pselect>() は glibc でエミュレートされていた (「バグ」の章を参照)。"
4022 #: build/C/man2/select.2:342
4024 "B<select>() conforms to POSIX.1-2001 and 4.4BSD (B<select>() first "
4025 "appeared in 4.2BSD). Generally portable to/from non-BSD systems supporting "
4026 "clones of the BSD socket layer (including System V variants). However, note "
4027 "that the System V variant typically sets the timeout variable before exit, "
4028 "but the BSD variant does not."
4030 "B<select>() は POSIX.1-2001 と 4.4BSD (B<select>() は 4.2BSD で最初に登場し"
4031 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4032 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4033 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4037 #: build/C/man2/select.2:346
4038 msgid "B<pselect>() is defined in POSIX.1g, and in POSIX.1-2001."
4039 msgstr "B<pselect>() は POSIX.1g と POSIX.1-2001 で定義されている。"
4042 #: build/C/man2/select.2:363
4044 "An I<fd_set> is a fixed size buffer. Executing B<FD_CLR>() or B<FD_SET>() "
4045 "with a value of I<fd> that is negative or is equal to or larger than "
4046 "B<FD_SETSIZE> will result in undefined behavior. Moreover, POSIX requires "
4047 "I<fd> to be a valid file descriptor."
4049 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4050 "I<fd> に対して B<FD_CLR>() や B<FD_SET>() を実行した場合、 どのような動作を"
4051 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4052 "プタでなければならないと規定されている。"
4055 #: build/C/man2/select.2:372
4057 "Concerning the types involved, the classical situation is that the two "
4058 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4059 "the structure is defined in I<E<lt>sys/time.hE<gt>>. The POSIX.1-2001 "
4062 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4063 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4064 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4067 #: build/C/man2/select.2:379
4070 "struct timeval {\n"
4071 " time_t tv_sec; /* seconds */\n"
4072 " suseconds_t tv_usec; /* microseconds */\n"
4075 "struct timeval {\n"
4076 "\t time_t tv_sec; /* 秒 */\n"
4077 "\t suseconds_t tv_usec; /* マイクロ秒 */\n"
4081 #: build/C/man2/select.2:390
4083 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4084 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4086 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4087 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4090 #: build/C/man2/select.2:402
4092 "Concerning prototypes, the classical situation is that one should include "
4093 "I<E<lt>time.hE<gt>> for B<select>(). The POSIX.1-2001 situation is that one "
4094 "should include I<E<lt>sys/select.hE<gt>> for B<select>() and B<pselect>()."
4096 "プロトタイプに関しては、昔ながらの状況で B<select>() を使いたい場合は、 "
4097 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4098 "B<select>() と B<pselect>() を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4102 #: build/C/man2/select.2:414
4104 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4105 "2.0 and later this header exists. Under glibc 2.0 it unconditionally gives "
4106 "the wrong prototype for B<pselect>(). Under glibc 2.1 to 2.2.1 it gives "
4107 "B<pselect>() when B<_GNU_SOURCE> is defined. Since glibc 2.2.2 the "
4108 "requirements are as shown in the SYNOPSIS."
4110 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4111 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>() のプロトタイ"
4112 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4113 "場合に、 B<pselect>() が提供される。 glibc 2.2.2 以降では、 B<pselect>() を"
4114 "使用するには、「書式」に記載された要件を満たす必要がある。"
4117 #: build/C/man2/select.2:414
4123 #: build/C/man2/select.2:422
4125 "The B<pselect>() interface described in this page is implemented by glibc. "
4126 "The underlying Linux system call is named B<pselect6>(). This system call "
4127 "has somewhat different behavior from the gibc wrapper function."
4131 #: build/C/man2/select.2:437
4134 #| "The Linux B<pselect>() system call modifies its I<timeout> argument. "
4135 #| "However, the glibc wrapper function hides this behavior by using a local "
4136 #| "variable for the timeout argument that is passed to the system call. "
4137 #| "Thus, the glibc B<pselect>() function does not modify its I<timeout> "
4138 #| "argument; this is the behavior required by POSIX.1-2001."
4140 "The Linux B<pselect6>() system call modifies its I<timeout> argument. "
4141 "However, the glibc wrapper function hides this behavior by using a local "
4142 "variable for the timeout argument that is passed to the system call. Thus, "
4143 "the glibc B<pselect>() function does not modify its I<timeout> argument; "
4144 "this is the behavior required by POSIX.1-2001."
4146 "Linux の B<pselect>() システムコールは I<timeout> 引き数を変更する。 しか"
4148 "glibc のラッパー関数は、システムコールに渡す timeout 引き数 としてローカル変"
4150 "を使うことでこの動作を隠蔽している。 このため、glibc の B<pselect>() 関数は\n"
4151 "I<timeout> 引き数を変更しない。 これが POSIX.1-2001 が要求している動作であ"
4155 #: build/C/man2/select.2:443
4157 "The final argument of the B<pselect6()> system call is not a I<sigset_t\\ *> "
4158 "pointer, but is instead a structure of the form:"
4162 #: build/C/man2/select.2:451
4166 " const sigset_t *ss; /* Pointer to signal set */\n"
4167 " size_t ss_len; /* Size (in bytes) of object pointed\n"
4173 #: build/C/man2/select.2:458
4175 "This allows the system call to obtain both a pointer to the signal set and "
4176 "its size, while allowing for the fact that most architectures support a "
4177 "maximum of 6 arguments to a system call."
4181 #: build/C/man2/select.2:464
4183 "Glibc 2.0 provided a version of B<pselect>() that did not take a I<sigmask> "
4186 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>() が提供"
4190 #: build/C/man2/select.2:477
4192 "Starting with version 2.1, glibc provided an emulation of B<pselect>() that "
4193 "was implemented using B<sigprocmask>(2) and B<select>(). This "
4194 "implementation remained vulnerable to the very race condition that B<pselect>"
4195 "() was designed to prevent. Modern versions of glibc use the (race-free) "
4196 "B<pselect>() system call on kernels where it is provided."
4198 "バージョン 2.1 以降の glibc では、 B<pselect>() は B<sigprocmask>(2) と "
4199 "B<select>() を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4200 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4201 "B<pselect>() は設計されたのである。 最近のバージョンの glibc では、カーネル"
4202 "がサポートしている場合には、 (競合が起こらない) B<pselect>() システムコール"
4206 #: build/C/man2/select.2:490
4209 #| "On systems that lack B<pselect>(), reliable (and more portable) signal "
4210 #| "trapping can be achieved using the self-pipe trick (where a signal "
4211 #| "handler writes a byte to a pipe whose other end is monitored by B<select>"
4212 #| "() in the main program.)"
4214 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4215 "trapping can be achieved using the self-pipe trick. In this technique, a "
4216 "signal handler writes a byte to a pipe whose other end is monitored by "
4217 "B<select>() in the main program. (To avoid possibly blocking when writing "
4218 "to a pipe that may be full or reading from a pipe that may be empty, "
4219 "nonblocking I/O is used when reading from and writing to the pipe.)"
4221 "B<pselect>() がないシステムにおいて、 シグナルの捕捉を信頼性があり (移植性も"
4222 "高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい (シグナル"
4223 "ハンドラはパイプへ 1 バイトのデータを書き込み、同じパイプのもう一端をメインプ"
4224 "ログラムの B<select>() で監視するという方法である)。"
4226 #. Stevens discusses a case where accept can block after select
4227 #. returns successfully because of an intervening RST from the client.
4228 #. Maybe the kernel should have returned EIO in such a situation?
4230 #: build/C/man2/select.2:506
4232 "Under Linux, B<select>() may report a socket file descriptor as \"ready for "
4233 "reading\", while nevertheless a subsequent read blocks. This could for "
4234 "example happen when data has arrived but upon examination has wrong checksum "
4235 "and is discarded. There may be other circumstances in which a file "
4236 "descriptor is spuriously reported as ready. Thus it may be safer to use "
4237 "B<O_NONBLOCK> on sockets that should not block."
4239 "Linux では、 B<select>() がソケットファイルディスクリプタで \"読み込みの準備"
4240 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4241 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4242 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4243 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4244 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4247 #: build/C/man2/select.2:521
4249 "On Linux, B<select>() also modifies I<timeout> if the call is interrupted "
4250 "by a signal handler (i.e., the B<EINTR> error return). This is not "
4251 "permitted by POSIX.1-2001. The Linux B<pselect>() system call has the same "
4252 "behavior, but the glibc wrapper hides this behavior by internally copying "
4253 "the I<timeout> to a local variable and passing that variable to the system "
4256 "Linux では、 B<select>() がシグナルハンドラにより割り込まれた場合 (つまり "
4257 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4258 "認められていない挙動である。 Linux の B<pselect>() システムコールも同じ挙動"
4259 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4260 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4264 #: build/C/man2/select.2:528
4267 "#include E<lt>stdio.hE<gt>\n"
4268 "#include E<lt>stdlib.hE<gt>\n"
4269 "#include E<lt>sys/time.hE<gt>\n"
4270 "#include E<lt>sys/types.hE<gt>\n"
4271 "#include E<lt>unistd.hE<gt>\n"
4273 "#include E<lt>stdio.hE<gt>\n"
4274 "#include E<lt>stdlib.hE<gt>\n"
4275 "#include E<lt>sys/time.hE<gt>\n"
4276 "#include E<lt>sys/types.hE<gt>\n"
4277 "#include E<lt>unistd.hE<gt>\n"
4280 #: build/C/man2/select.2:535
4287 " struct timeval tv;\n"
4294 " struct timeval tv;\n"
4298 #: build/C/man2/select.2:539
4301 " /* Watch stdin (fd 0) to see when it has input. */\n"
4302 " FD_ZERO(&rfds);\n"
4303 " FD_SET(0, &rfds);\n"
4305 " /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4306 " FD_ZERO(&rfds);\n"
4307 " FD_SET(0, &rfds);\n"
4310 #: build/C/man2/select.2:543
4313 " /* Wait up to five seconds. */\n"
4315 " tv.tv_usec = 0;\n"
4319 " tv.tv_usec = 0;\n"
4322 #: build/C/man2/select.2:546
4325 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
4326 " /* Don't rely on the value of tv now! */\n"
4328 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
4329 " /* この時点での tv の値を信頼してはならない。*/\n"
4332 #: build/C/man2/select.2:554
4335 " if (retval == -1)\n"
4336 " perror(\"select()\");\n"
4337 " else if (retval)\n"
4338 " printf(\"Data is available now.\\en\");\n"
4339 " /* FD_ISSET(0, &rfds) will be true. */\n"
4341 " printf(\"No data within five seconds.\\en\");\n"
4343 " if (retval == -1)\n"
4344 "\tperror(\"select()\");\n"
4345 " else if (retval)\n"
4346 " printf(\"今、データが取得できました。\\en\");\n"
4347 " /* FD_ISSET(0, &rfds) が true になる。*/\n"
4349 " printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4352 #: build/C/man2/select.2:557
4355 " exit(EXIT_SUCCESS);\n"
4358 " exit(EXIT_SUCCESS);\n"
4362 #: build/C/man2/select.2:561
4363 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4365 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2) がある。"
4368 #: build/C/man2/select.2:573
4370 "For vaguely related stuff, see B<accept>(2), B<connect>(2), B<poll>(2), "
4371 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4374 "関係がありそうなものを挙げておく: B<accept>(2), B<connect>(2), B<poll>(2), "
4375 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4379 #: build/C/man2/select_tut.2:30
4385 #: build/C/man2/select_tut.2:30
4391 #: build/C/man2/select_tut.2:50
4394 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4395 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4397 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4398 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4401 #: build/C/man2/select_tut.2:64
4404 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4405 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4406 "B< const sigset_t *>I<sigmask>B<);>\n"
4408 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4409 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4410 "B< const sigset_t *>I<sigmask>B<);>\n"
4413 #: build/C/man2/select_tut.2:81
4415 "B<select>() (or B<pselect>()) is used to efficiently monitor multiple file "
4416 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
4417 "see whether I/O becomes possible, or an \"exceptional condition\" has "
4418 "occurred on any of the descriptors."
4420 "B<select>() (や B<pselect>()) を使うと、効率的に複数のファイルディスクリプ"
4421 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
4422 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
4423 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
4427 #: build/C/man2/select_tut.2:106
4429 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
4430 "I<writefds>, and I<exceptfds>. Each set is declared as type I<fd_set>, and "
4431 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
4432 "B<FD_SET>(), and B<FD_ZERO>(). A newly declared set should first be cleared "
4433 "using B<FD_ZERO>(). B<select>() modifies the contents of the sets "
4434 "according to the rules described below; after calling B<select>() you can "
4435 "test if a file descriptor is still present in a set with the B<FD_ISSET>() "
4436 "macro. B<FD_ISSET>() returns nonzero if a specified file descriptor is "
4437 "present in a set and zero if it is not. B<FD_CLR>() removes a file "
4438 "descriptor from a set."
4440 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
4441 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
4442 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>() "
4443 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
4444 "B<FD_ZERO>() を使ってクリアすべきである。 B<select>() はこれらの集合の内容"
4445 "を、以降に述べる規則に従って修正する。 B<select>() を呼んだ後、ファイルディ"
4446 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>() マクロによって"
4447 "調べることができる。 B<FD_ISSET>() は指定されたディスクリプタが集合に存在し"
4448 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>() は集合から"
4449 "のファイルディスクリプタの削除を行う。"
4452 #: build/C/man2/select_tut.2:106
4458 #: build/C/man2/select_tut.2:107
4464 #: build/C/man2/select_tut.2:116
4466 "This set is watched to see if data is available for reading from any of its "
4467 "file descriptors. After B<select>() has returned, I<readfds> will be "
4468 "cleared of all file descriptors except for those that are immediately "
4469 "available for reading."
4471 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
4472 "になったかどうかを監視する。 B<select>() から戻る時に、I<readfds> のうち、 "
4473 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
4476 #: build/C/man2/select_tut.2:116
4479 msgstr "I<writefds>"
4482 #: build/C/man2/select_tut.2:125
4484 "This set is watched to see if there is space to write data to any of its "
4485 "file descriptors. After B<select>() has returned, I<writefds> will be "
4486 "cleared of all file descriptors except for those that are immediately "
4487 "available for writing."
4489 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
4490 "スがあるかどうかを監視する。 B<select>() から戻る時に、I<writefds> のうち、 "
4491 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
4494 #: build/C/man2/select_tut.2:125
4496 msgid "I<exceptfds>"
4497 msgstr "I<exceptfds>"
4500 #: build/C/man2/select_tut.2:147
4502 "This set is watched for \"exceptional conditions\". In practice, only one "
4503 "such exceptional condition is common: the availability of I<out-of-band> "
4504 "(OOB) data for reading from a TCP socket. See B<recv>(2), B<send>(2), and "
4505 "B<tcp>(7) for more details about OOB data. (One other less common case "
4506 "where B<select>(2) indicates an exceptional condition occurs with "
4507 "pseudoterminals in packet mode; see B<tty_ioctl>(4).) After B<select>() "
4508 "has returned, I<exceptfds> will be cleared of all file descriptors except "
4509 "for those for which an exceptional condition has occurred."
4511 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
4512 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
4513 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
4514 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
4515 "は、 B<recv>(2), B<send>(2), B<tcp>(7) を参照のこと。 (これ以外では、まれな"
4516 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>() が例外"
4517 "状態を示すことがある。) B<select>() が返る時に、I<exceptfds> のうち、 例外"
4518 "状態が発生したディスクリプタ以外は集合から削除される。"
4521 #: build/C/man2/select_tut.2:147
4527 #: build/C/man2/select_tut.2:154
4529 "This is an integer one more than the maximum of any file descriptor in any "
4530 "of the sets. In other words, while adding file descriptors to each of the "
4531 "sets, you must calculate the maximum integer value of all of them, then "
4532 "increment this value by one, and then pass this as I<nfds>."
4534 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
4535 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
4536 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
4537 "I<nfds> として渡さないといけない、ということだ。"
4540 #: build/C/man2/select_tut.2:154
4543 msgstr "I<utimeout>"
4546 #: build/C/man2/select_tut.2:167
4548 "This is the longest time B<select>() may wait before returning, even if "
4549 "nothing interesting happened. If this value is passed as NULL, then "
4550 "B<select>() blocks indefinitely waiting for a file descriptor to become "
4551 "ready. I<utimeout> can be set to zero seconds, which causes B<select>() to "
4552 "return immediately, with information about the readiness of file descriptors "
4553 "at the time of the call. The structure I<struct timeval> is defined as:"
4555 "(何も起こらなかった場合に) B<select>() が戻る前に待つ最大時間である。 この"
4556 "値に NULL を渡すと、 B<select>() はファイルディスクリプタのいずれかが ready "
4557 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
4558 "にすることもでき、 この場合 B<select>() は直ちに返り、呼び出し時点のファイル"
4559 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
4563 #: build/C/man2/select_tut.2:174
4566 "struct timeval {\n"
4567 " time_t tv_sec; /* seconds */\n"
4568 " long tv_usec; /* microseconds */\n"
4571 "struct timeval {\n"
4572 " time_t tv_sec; /* seconds */\n"
4573 " long tv_usec; /* microseconds */\n"
4577 #: build/C/man2/select_tut.2:176
4580 msgstr "I<ntimeout>"
4583 #: build/C/man2/select_tut.2:185
4585 "This argument for B<pselect>() has the same meaning as I<utimeout>, but "
4586 "I<struct timespec> has nanosecond precision as follows:"
4588 "B<pselect>() のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
4589 "timespec> は次に示すようにナノ秒の精度を持つ。"
4592 #: build/C/man2/select_tut.2:192
4595 "struct timespec {\n"
4596 " long tv_sec; /* seconds */\n"
4597 " long tv_nsec; /* nanoseconds */\n"
4600 "struct timespec {\n"
4601 " long tv_sec; /* seconds */\n"
4602 " long tv_nsec; /* nanoseconds */\n"
4606 #: build/C/man2/select_tut.2:194
4612 #: build/C/man2/select_tut.2:211
4614 "This argument holds a set of signals that the kernel should unblock (i.e., "
4615 "remove from the signal mask of the calling thread), while the caller is "
4616 "blocked inside the B<pselect>() call (see B<sigaddset>(3) and "
4617 "B<sigprocmask>(2)). It may be NULL, in which case the call does not modify "
4618 "the signal mask on entry and exit to the function. In this case, B<pselect>"
4619 "() will then behave just like B<select>()."
4621 "この引き数は、呼び出し側が B<pselect>() 内部で停止している間に、カーネルが通"
4622 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
4623 "削除すべきシグナル集合) を保持する (B<sigaddset>(3) と B<sigprocmask>(2) "
4624 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
4625 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>() は B<select>"
4629 #: build/C/man2/select_tut.2:211
4631 msgid "Combining Signal and Data Events"
4632 msgstr "シグナルとデータイベントを組み合わせる"
4635 #: build/C/man2/select_tut.2:255
4637 "B<pselect>() is useful if you are waiting for a signal as well as for file "
4638 "descriptor(s) to become ready for I/O. Programs that receive signals "
4639 "normally use the signal handler only to raise a global flag. The global "
4640 "flag will indicate that the event must be processed in the main loop of the "
4641 "program. A signal will cause the B<select>() (or B<pselect>()) call to "
4642 "return with I<errno> set to B<EINTR>. This behavior is essential so that "
4643 "signals can be processed in the main loop of the program, otherwise B<select>"
4644 "() would block indefinitely. Now, somewhere in the main loop will be a "
4645 "conditional to check the global flag. So we must ask: what if a signal "
4646 "arrives after the conditional, but before the B<select>() call? The answer "
4647 "is that B<select>() would block indefinitely, even though an event is "
4648 "actually pending. This race condition is solved by the B<pselect>() call. "
4649 "This call can be used to set the signal mask to a set of signals that are "
4650 "only to be received within the B<pselect>() call. For instance, let us say "
4651 "that the event in question was the exit of a child process. Before the "
4652 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2). "
4653 "Our B<pselect>() call would enable B<SIGCHLD> by using an empty signal "
4654 "mask. Our program would look like:"
4656 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
4657 "合には、 B<pselect>() が便利である。 シグナルを受信するプログラムは、通常"
4658 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
4659 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
4660 "ないことを示す。 シグナルを受けると B<select>() (や B<pselect>()) は "
4661 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
4662 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>() は"
4663 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
4664 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
4665 "「シグナルが条件文の後、しかし B<select>() コールの前に到着したら どうなるの"
4666 "か?」 答えは「その B<select>() は、たとえ解決待ちのイベントがあったとして"
4667 "も、 永遠に停止する」である。 この競合状態は B<pselect>() コールによって解決"
4668 "できる。 このコールを使うと、 B<pselect>() で受信したいシグナルの集合だけを"
4669 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
4670 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
4671 "B<sigprocmask>(2) でブロックする。 B<pselect>() コールでは B<SIGCHLD> を、"
4672 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
4676 #: build/C/man2/select_tut.2:258
4678 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4679 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4682 #: build/C/man2/select_tut.2:264
4686 "child_sig_handler(int sig)\n"
4688 " got_SIGCHLD = 1;\n"
4692 "child_sig_handler(int sig)\n"
4694 " got_SIGCHLD = 1;\n"
4698 #: build/C/man2/select_tut.2:272
4702 "main(int argc, char *argv[])\n"
4704 " sigset_t sigmask, empty_mask;\n"
4705 " struct sigaction sa;\n"
4706 " fd_set readfds, writefds, exceptfds;\n"
4710 "main(int argc, char *argv[])\n"
4712 " sigset_t sigmask, empty_mask;\n"
4713 " struct sigaction sa;\n"
4714 " fd_set readfds, writefds, exceptfds;\n"
4718 #: build/C/man2/select_tut.2:279
4721 " sigemptyset(&sigmask);\n"
4722 " sigaddset(&sigmask, SIGCHLD);\n"
4723 " if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4724 " perror(\"sigprocmask\");\n"
4725 " exit(EXIT_FAILURE);\n"
4728 " sigemptyset(&sigmask);\n"
4729 " sigaddset(&sigmask, SIGCHLD);\n"
4730 " if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4731 " perror(\"sigprocmask\");\n"
4732 " exit(EXIT_FAILURE);\n"
4736 #: build/C/man2/select_tut.2:287
4739 " sa.sa_flags = 0;\n"
4740 " sa.sa_handler = child_sig_handler;\n"
4741 " sigemptyset(&sa.sa_mask);\n"
4742 " if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4743 " perror(\"sigaction\");\n"
4744 " exit(EXIT_FAILURE);\n"
4747 " sa.sa_flags = 0;\n"
4748 " sa.sa_handler = child_sig_handler;\n"
4749 " sigemptyset(&sa.sa_mask);\n"
4750 " if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4751 " perror(\"sigaction\");\n"
4752 " exit(EXIT_FAILURE);\n"
4756 #: build/C/man2/select_tut.2:289
4758 msgid " sigemptyset(&empty_mask);\n"
4759 msgstr " sigemptyset(&empty_mask);\n"
4762 #: build/C/man2/select_tut.2:293
4765 " for (;;) { /* main loop */\n"
4766 " /* Initialize readfds, writefds, and exceptfds\n"
4767 " before the pselect() call. (Code omitted.) */\n"
4769 " for (;;) { /* main loop */\n"
4770 " /* Initialize readfds, writefds, and exceptfds\n"
4771 " before the pselect() call. (Code omitted.) */\n"
4774 #: build/C/man2/select_tut.2:299
4777 " r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4778 " NULL, &empty_mask);\n"
4779 " if (r == -1 && errno != EINTR) {\n"
4780 " /* Handle error */\n"
4783 " r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4784 " NULL, &empty_mask);\n"
4785 " if (r == -1 && errno != EINTR) {\n"
4786 " /* Handle error */\n"
4790 #: build/C/man2/select_tut.2:302
4793 " if (got_SIGCHLD) {\n"
4794 " got_SIGCHLD = 0;\n"
4796 " if (got_SIGCHLD) {\n"
4797 " got_SIGCHLD = 0;\n"
4800 #: build/C/man2/select_tut.2:306
4803 " /* Handle signalled event here; e.g., wait() for all\n"
4804 " terminated children. (Code omitted.) */\n"
4807 " /* Handle signalled event here; e.g., wait() for all\n"
4808 " terminated children. (Code omitted.) */\n"
4812 #: build/C/man2/select_tut.2:310
4815 " /* main body of program */\n"
4819 " /* main body of program */\n"
4824 #: build/C/man2/select_tut.2:311
4830 #: build/C/man2/select_tut.2:332
4832 "So what is the point of B<select>()? Can't I just read and write to my "
4833 "descriptors whenever I want? The point of B<select>() is that it watches "
4834 "multiple descriptors at the same time and properly puts the process to sleep "
4835 "if there is no activity. UNIX programmers often find themselves in a "
4836 "position where they have to handle I/O from more than one file descriptor "
4837 "where the data flow may be intermittent. If you were to merely create a "
4838 "sequence of B<read>(2) and B<write>(2) calls, you would find that one of "
4839 "your calls may block waiting for data from/to a file descriptor, while "
4840 "another file descriptor is unused though ready for I/O. B<select>() "
4841 "efficiently copes with this situation."
4843 "実際のところ B<select>() の大事な点は何なのか? ディスクリプタは好きなときに"
4844 "読み書きできるんじゃないの? B<select>() の重要なところは、複数のディスクリ"
4845 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
4846 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
4847 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
4848 "出会う。 単に B<read>(2) や B<write>(2) コールのシーケンスを作るだけでは、"
4849 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
4850 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
4851 "になってしまうだろう。 B<select>() を使うとこの状況に効果的に対処できる。"
4854 #: build/C/man2/select_tut.2:332
4860 #: build/C/man2/select_tut.2:345
4862 "Many people who try to use B<select>() come across behavior that is "
4863 "difficult to understand and produces nonportable or borderline results. For "
4864 "instance, the above program is carefully written not to block at any point, "
4865 "even though it does not set its file descriptors to nonblocking mode. It is "
4866 "easy to introduce subtle errors that will remove the advantage of using "
4867 "B<select>(), so here is a list of essentials to watch for when using "
4870 "B<select>() を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
4871 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
4872 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
4873 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
4874 "れている。 微妙な間違いによって、 B<select>() を使う利点は簡単に失われてしま"
4875 "う。 そこで、 B<select>() コールを使うときに注意すべき重要事項を列挙しておく"
4879 #: build/C/man2/select_tut.2:354
4881 "You should always try to use B<select>() without a timeout. Your program "
4882 "should have nothing to do if there is no data available. Code that depends "
4883 "on timeouts is not usually portable and is difficult to debug."
4885 "B<select>() を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
4886 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
4887 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
4890 #: build/C/man2/select_tut.2:358
4892 "The value I<nfds> must be properly calculated for efficiency as explained "
4895 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
4899 #: build/C/man2/select_tut.2:365
4901 "No file descriptor must be added to any set if you do not intend to check "
4902 "its result after the B<select>() call, and respond appropriately. See next "
4905 "B<select>() コールの終了後に結果をチェックして、 適切に対応するつもりのない"
4906 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
4909 #: build/C/man2/select_tut.2:371
4911 "After B<select>() returns, all file descriptors in all sets should be "
4912 "checked to see if they are ready."
4914 "B<select>() から返った後には、全ての集合の全てのファイルディスクリプタについ"
4915 "て 読み書き可能な状態になっているかをチェックすべきである。"
4918 #: build/C/man2/select_tut.2:371
4924 #: build/C/man2/select_tut.2:386
4926 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) do I<not> "
4927 "necessarily read/write the full amount of data that you have requested. If "
4928 "they do read/write the full amount, it's because you have a low traffic load "
4929 "and a fast stream. This is not always going to be the case. You should "
4930 "cope with the case of your functions only managing to send or receive a "
4933 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) といった関数は、こちらが要求"
4934 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
4935 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
4936 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
4937 "うな場合も 考慮に入れてやらなければならない。"
4940 #: build/C/man2/select_tut.2:386
4946 #: build/C/man2/select_tut.2:394
4948 "Never read/write only in single bytes at a time unless you are really sure "
4949 "that you have a small amount of data to process. It is extremely "
4950 "inefficient not to read/write as much data as you can buffer each time. The "
4951 "buffers in the example below are 1024 bytes although they could easily be "
4954 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
4955 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
4956 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
4957 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
4960 #: build/C/man2/select_tut.2:394
4965 #. Nonetheless, you should still cope with these errors for completeness.
4967 #: build/C/man2/select_tut.2:416
4969 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) as well "
4970 "as the B<select>() call can return -1 with I<errno> set to B<EINTR>, or "
4971 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>). These results must be "
4972 "properly managed (not done properly above). If your program is not going to "
4973 "receive any signals, then it is unlikely you will get B<EINTR>. If your "
4974 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
4976 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) などの関数や B<select>() "
4977 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>) にして -1 を返す"
4978 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
4979 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
4980 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
4981 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
4984 #: build/C/man2/select_tut.2:416
4990 #: build/C/man2/select_tut.2:425
4992 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2) with a buffer "
4995 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
4996 "(2), B<send>(2) を呼び出してはならない。"
4999 #: build/C/man2/select_tut.2:425
5005 #: build/C/man2/select_tut.2:441
5007 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) fail "
5008 "with errors other than those listed in B<7.>, or one of the input functions "
5009 "returns 0, indicating end of file, then you should I<not> pass that "
5010 "descriptor to B<select>() again. In the example below, I close the "
5011 "descriptor immediately, and then set it to -1 to prevent it being included "
5014 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) が B<7.> に示した以外のエ"
5015 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5016 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5017 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5018 "が集合に含まれ続けるのを許さないようにしている。"
5021 #: build/C/man2/select_tut.2:441
5027 #: build/C/man2/select_tut.2:448
5029 "The timeout value must be initialized with each new call to B<select>(), "
5030 "since some operating systems modify the structure. B<pselect>() however "
5031 "does not modify its timeout structure."
5033 "タイムアウトの値は B<select>() を呼ぶたびに初期化すべきである。 OS によって"
5034 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>() は自"
5035 "分の timeout 構造体を変更することはない。"
5038 #: build/C/man2/select_tut.2:448
5043 #. "I have heard" does not fill me with confidence, and doesn't
5044 #. belong in a man page, so I've commented this point out.
5047 #. I have heard that the Windows socket layer does not cope with OOB data
5049 #. It also does not cope with
5051 #. calls when no file descriptors are set at all.
5052 #. Having no file descriptors set is a useful
5053 #. way to sleep the process with subsecond precision by using the timeout.
5054 #. (See further on.)
5056 #: build/C/man2/select_tut.2:467
5058 "Since B<select>() modifies its file descriptor sets, if the call is being "
5059 "used in a loop, then the sets must be reinitialized before each call."
5061 "B<select>() はファイルディスクリプタ集合を変更するので、 B<select>() がルー"
5062 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5066 #: build/C/man2/select_tut.2:467
5068 msgid "Usleep Emulation"
5069 msgstr "usleep エミュレーション"
5072 #: build/C/man2/select_tut.2:474
5074 "On systems that do not have a B<usleep>(3) function, you can call B<select>"
5075 "() with a finite timeout and no file descriptors as follows:"
5077 "B<usleep>(3) 関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5078 "ルディスクリプタを全くセットせずに B<select>() を呼び出すことで、これを代用"
5082 #: build/C/man2/select_tut.2:480
5085 " struct timeval tv;\n"
5087 " tv.tv_usec = 200000; /* 0.2 seconds */\n"
5088 " select(0, NULL, NULL, NULL, &tv);\n"
5090 " struct timeval tv;\n"
5092 " tv.tv_usec = 200000; /* 0.2 seconds */\n"
5093 " select(0, NULL, NULL, NULL, &tv);\n"
5096 #: build/C/man2/select_tut.2:483
5097 msgid "This is only guaranteed to work on UNIX systems, however."
5098 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5101 #: build/C/man2/select_tut.2:488
5103 "On success, B<select>() returns the total number of file descriptors still "
5104 "present in the file descriptor sets."
5106 "成功すると、 B<select>() はファイルディスクリプタ集合に残っている ファイル"
5110 #: build/C/man2/select_tut.2:494
5112 "If B<select>() timed out, then the return value will be zero. The file "
5113 "descriptors set should be all empty (but may not be on some systems)."
5115 "B<select>() がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5116 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5119 #: build/C/man2/select_tut.2:501
5121 "A return value of -1 indicates an error, with I<errno> being set "
5122 "appropriately. In the case of an error, the contents of the returned sets "
5123 "and the I<struct timeout> contents are undefined and should not be used. "
5124 "B<pselect>() however never modifies I<ntimeout>."
5126 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5127 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5128 "なっており、使用すべきではない。 しかし B<pselect>() は決して I<ntimeout> を"
5132 #: build/C/man2/select_tut.2:510
5134 "Generally speaking, all operating systems that support sockets also support "
5135 "B<select>(). B<select>() can be used to solve many problems in a portable "
5136 "and efficient way that naive programmers try to solve in a more complicated "
5137 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5139 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5140 "B<select>() もサポートしている。 B<select>() を使うと、プログラマがスレッ"
5141 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5142 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5145 #: build/C/man2/select_tut.2:519
5147 "The B<poll>(2) system call has the same functionality as B<select>(), and "
5148 "is somewhat more efficient when monitoring sparse file descriptor sets. It "
5149 "is nowadays widely available, but historically was less portable than "
5152 "B<poll>(2) システムコールは B<select>() と同じ機能を持っており、 まばらな"
5153 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5154 "利用可能であるが、以前は B<select>() より移植性の面で劣っていた。"
5157 #: build/C/man2/select_tut.2:527
5159 "The Linux-specific B<epoll>(7) API provides an interface that is more "
5160 "efficient than B<select>(2) and B<poll>(2) when monitoring large numbers "
5161 "of file descriptors."
5163 "Linux 独自の B<epoll>(7) API は、多数のファイルディスクリプタを監視する場合"
5164 "に B<select>(2) や B<poll>(2) よりも効率的なインタフェースを提供している。"
5167 #: build/C/man2/select_tut.2:532
5169 "Here is an example that better demonstrates the true utility of B<select>"
5170 "(). The listing below is a TCP forwarding program that forwards from one "
5171 "TCP port to another."
5173 "B<select>() の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5174 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5177 #: build/C/man2/select_tut.2:545
5180 "#include E<lt>stdlib.hE<gt>\n"
5181 "#include E<lt>stdio.hE<gt>\n"
5182 "#include E<lt>unistd.hE<gt>\n"
5183 "#include E<lt>sys/time.hE<gt>\n"
5184 "#include E<lt>sys/types.hE<gt>\n"
5185 "#include E<lt>string.hE<gt>\n"
5186 "#include E<lt>signal.hE<gt>\n"
5187 "#include E<lt>sys/socket.hE<gt>\n"
5188 "#include E<lt>netinet/in.hE<gt>\n"
5189 "#include E<lt>arpa/inet.hE<gt>\n"
5190 "#include E<lt>errno.hE<gt>\n"
5192 "#include E<lt>stdlib.hE<gt>\n"
5193 "#include E<lt>stdio.hE<gt>\n"
5194 "#include E<lt>unistd.hE<gt>\n"
5195 "#include E<lt>sys/time.hE<gt>\n"
5196 "#include E<lt>sys/types.hE<gt>\n"
5197 "#include E<lt>string.hE<gt>\n"
5198 "#include E<lt>signal.hE<gt>\n"
5199 "#include E<lt>sys/socket.hE<gt>\n"
5200 "#include E<lt>netinet/in.hE<gt>\n"
5201 "#include E<lt>arpa/inet.hE<gt>\n"
5202 "#include E<lt>errno.hE<gt>\n"
5205 #: build/C/man2/select_tut.2:547
5207 msgid "static int forward_port;\n"
5208 msgstr "static int forward_port;\n"
5211 #: build/C/man2/select_tut.2:550
5215 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5218 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5221 #: build/C/man2/select_tut.2:557
5225 "listen_socket(int listen_port)\n"
5227 " struct sockaddr_in a;\n"
5232 "listen_socket(int listen_port)\n"
5234 " struct sockaddr_in a;\n"
5239 #: build/C/man2/select_tut.2:581
5242 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5243 " perror(\"socket\");\n"
5247 " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5248 " (char *) &yes, sizeof(yes)) == -1) {\n"
5249 " perror(\"setsockopt\");\n"
5253 " memset(&a, 0, sizeof(a));\n"
5254 " a.sin_port = htons(listen_port);\n"
5255 " a.sin_family = AF_INET;\n"
5256 " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5257 " perror(\"bind\");\n"
5261 " printf(\"accepting connections on port %d\\en\", listen_port);\n"
5266 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5267 " perror(\"socket\");\n"
5271 " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5272 " (char *) &yes, sizeof(yes)) == -1) {\n"
5273 " perror(\"setsockopt\");\n"
5277 " memset(&a, 0, sizeof(a));\n"
5278 " a.sin_port = htons(listen_port);\n"
5279 " a.sin_family = AF_INET;\n"
5280 " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5281 " perror(\"bind\");\n"
5285 " printf(\"accepting connections on port %d\\en\", listen_port);\n"
5291 #: build/C/man2/select_tut.2:587
5295 "connect_socket(int connect_port, char *address)\n"
5297 " struct sockaddr_in a;\n"
5301 "connect_socket(int connect_port, char *address)\n"
5303 " struct sockaddr_in a;\n"
5307 #: build/C/man2/select_tut.2:593
5310 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5311 " perror(\"socket\");\n"
5316 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5317 " perror(\"socket\");\n"
5323 #: build/C/man2/select_tut.2:597
5326 " memset(&a, 0, sizeof(a));\n"
5327 " a.sin_port = htons(connect_port);\n"
5328 " a.sin_family = AF_INET;\n"
5330 " memset(&a, 0, sizeof(a));\n"
5331 " a.sin_port = htons(connect_port);\n"
5332 " a.sin_family = AF_INET;\n"
5335 #: build/C/man2/select_tut.2:603
5338 " if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5339 " perror(\"bad IP address format\");\n"
5344 " if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5345 " perror(\"bad IP address format\");\n"
5351 #: build/C/man2/select_tut.2:612
5354 " if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5355 " perror(\"connect()\");\n"
5356 " shutdown(s, SHUT_RDWR);\n"
5363 " if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5364 " perror(\"connect()\");\n"
5365 " shutdown(s, SHUT_RDWR);\n"
5373 #: build/C/man2/select_tut.2:620
5376 "#define SHUT_FD1 do { \\e\n"
5377 " if (fd1 E<gt>= 0) { \\e\n"
5378 " shutdown(fd1, SHUT_RDWR); \\e\n"
5379 " close(fd1); \\e\n"
5384 "#define SHUT_FD1 do { \\e\n"
5385 " if (fd1 E<gt>= 0) { \\e\n"
5386 " shutdown(fd1, SHUT_RDWR); \\e\n"
5387 " close(fd1); \\e\n"
5393 #: build/C/man2/select_tut.2:628
5396 "#define SHUT_FD2 do { \\e\n"
5397 " if (fd2 E<gt>= 0) { \\e\n"
5398 " shutdown(fd2, SHUT_RDWR); \\e\n"
5399 " close(fd2); \\e\n"
5404 "#define SHUT_FD2 do { \\e\n"
5405 " if (fd2 E<gt>= 0) { \\e\n"
5406 " shutdown(fd2, SHUT_RDWR); \\e\n"
5407 " close(fd2); \\e\n"
5413 #: build/C/man2/select_tut.2:630
5415 msgid "#define BUF_SIZE 1024\n"
5416 msgstr "#define BUF_SIZE 1024\n"
5419 #: build/C/man2/select_tut.2:639
5423 "main(int argc, char *argv[])\n"
5426 " int fd1 = -1, fd2 = -1;\n"
5427 " char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5428 " int buf1_avail, buf1_written;\n"
5429 " int buf2_avail, buf2_written;\n"
5432 "main(int argc, char *argv[])\n"
5435 " int fd1 = -1, fd2 = -1;\n"
5436 " char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5437 " int buf1_avail, buf1_written;\n"
5438 " int buf2_avail, buf2_written;\n"
5441 #: build/C/man2/select_tut.2:645
5444 " if (argc != 4) {\n"
5445 " fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5446 " \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5447 " exit(EXIT_FAILURE);\n"
5450 " if (argc != 4) {\n"
5451 " fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5452 " \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5453 " exit(EXIT_FAILURE);\n"
5457 #: build/C/man2/select_tut.2:647
5459 msgid " signal(SIGPIPE, SIG_IGN);\n"
5460 msgstr " signal(SIGPIPE, SIG_IGN);\n"
5463 #: build/C/man2/select_tut.2:649
5465 msgid " forward_port = atoi(argv[2]);\n"
5466 msgstr " forward_port = atoi(argv[2]);\n"
5469 #: build/C/man2/select_tut.2:653
5472 " h = listen_socket(atoi(argv[1]));\n"
5474 " exit(EXIT_FAILURE);\n"
5476 " h = listen_socket(atoi(argv[1]));\n"
5478 " exit(EXIT_FAILURE);\n"
5481 #: build/C/man2/select_tut.2:657
5485 " int r, nfds = 0;\n"
5486 " fd_set rd, wr, er;\n"
5489 " int r, nfds = 0;\n"
5490 " fd_set rd, wr, er;\n"
5493 #: build/C/man2/select_tut.2:687
5499 " FD_SET(h, &rd);\n"
5500 " nfds = max(nfds, h);\n"
5501 " if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5502 " FD_SET(fd1, &rd);\n"
5503 " nfds = max(nfds, fd1);\n"
5505 " if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5506 " FD_SET(fd2, &rd);\n"
5507 " nfds = max(nfds, fd2);\n"
5509 " if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5510 " FD_SET(fd1, &wr);\n"
5511 " nfds = max(nfds, fd1);\n"
5513 " if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5514 " FD_SET(fd2, &wr);\n"
5515 " nfds = max(nfds, fd2);\n"
5517 " if (fd1 E<gt> 0) {\n"
5518 " FD_SET(fd1, &er);\n"
5519 " nfds = max(nfds, fd1);\n"
5521 " if (fd2 E<gt> 0) {\n"
5522 " FD_SET(fd2, &er);\n"
5523 " nfds = max(nfds, fd2);\n"
5529 " FD_SET(h, &rd);\n"
5530 " nfds = max(nfds, h);\n"
5531 " if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5532 " FD_SET(fd1, &rd);\n"
5533 " nfds = max(nfds, fd1);\n"
5535 " if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5536 " FD_SET(fd2, &rd);\n"
5537 " nfds = max(nfds, fd2);\n"
5539 " if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5540 " FD_SET(fd1, &wr);\n"
5541 " nfds = max(nfds, fd1);\n"
5543 " if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5544 " FD_SET(fd2, &wr);\n"
5545 " nfds = max(nfds, fd2);\n"
5547 " if (fd1 E<gt> 0) {\n"
5548 " FD_SET(fd1, &er);\n"
5549 " nfds = max(nfds, fd1);\n"
5551 " if (fd2 E<gt> 0) {\n"
5552 " FD_SET(fd2, &er);\n"
5553 " nfds = max(nfds, fd2);\n"
5557 #: build/C/man2/select_tut.2:689
5559 msgid " r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5560 msgstr " r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5563 #: build/C/man2/select_tut.2:692
5566 " if (r == -1 && errno == EINTR)\n"
5569 " if (r == -1 && errno == EINTR)\n"
5573 #: build/C/man2/select_tut.2:697
5577 " perror(\"select()\");\n"
5578 " exit(EXIT_FAILURE);\n"
5582 " perror(\"select()\");\n"
5583 " exit(EXIT_FAILURE);\n"
5587 #: build/C/man2/select_tut.2:701
5590 " if (FD_ISSET(h, &rd)) {\n"
5591 " unsigned int l;\n"
5592 " struct sockaddr_in client_address;\n"
5594 " if (FD_ISSET(h, &rd)) {\n"
5595 " unsigned int l;\n"
5596 " struct sockaddr_in client_address;\n"
5599 #: build/C/man2/select_tut.2:720
5602 " memset(&client_address, 0, l = sizeof(client_address));\n"
5603 " r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5605 " perror(\"accept()\");\n"
5609 " buf1_avail = buf1_written = 0;\n"
5610 " buf2_avail = buf2_written = 0;\n"
5612 " fd2 = connect_socket(forward_port, argv[3]);\n"
5616 " printf(\"connect from %s\\en\",\n"
5617 " inet_ntoa(client_address.sin_addr));\n"
5621 " memset(&client_address, 0, l = sizeof(client_address));\n"
5622 " r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5624 " perror(\"accept()\");\n"
5628 " buf1_avail = buf1_written = 0;\n"
5629 " buf2_avail = buf2_written = 0;\n"
5631 " fd2 = connect_socket(forward_port, argv[3]);\n"
5635 " printf(\"connect from %s\\en\",\n"
5636 " inet_ntoa(client_address.sin_addr));\n"
5641 #: build/C/man2/select_tut.2:722
5643 msgid " /* NB: read oob data before normal reads */\n"
5644 msgstr " /* NB: read oob data before normal reads */\n"
5647 #: build/C/man2/select_tut.2:726
5650 " if (fd1 E<gt> 0)\n"
5651 " if (FD_ISSET(fd1, &er)) {\n"
5654 " if (fd1 E<gt> 0)\n"
5655 " if (FD_ISSET(fd1, &er)) {\n"
5659 #: build/C/man2/select_tut.2:736
5662 " r = recv(fd1, &c, 1, MSG_OOB);\n"
5666 " send(fd2, &c, 1, MSG_OOB);\n"
5668 " if (fd2 E<gt> 0)\n"
5669 " if (FD_ISSET(fd2, &er)) {\n"
5672 " r = recv(fd1, &c, 1, MSG_OOB);\n"
5676 " send(fd2, &c, 1, MSG_OOB);\n"
5678 " if (fd2 E<gt> 0)\n"
5679 " if (FD_ISSET(fd2, &er)) {\n"
5683 #: build/C/man2/select_tut.2:779
5686 " r = recv(fd2, &c, 1, MSG_OOB);\n"
5690 " send(fd1, &c, 1, MSG_OOB);\n"
5692 " if (fd1 E<gt> 0)\n"
5693 " if (FD_ISSET(fd1, &rd)) {\n"
5694 " r = read(fd1, buf1 + buf1_avail,\n"
5695 " BUF_SIZE - buf1_avail);\n"
5699 " buf1_avail += r;\n"
5701 " if (fd2 E<gt> 0)\n"
5702 " if (FD_ISSET(fd2, &rd)) {\n"
5703 " r = read(fd2, buf2 + buf2_avail,\n"
5704 " BUF_SIZE - buf2_avail);\n"
5708 " buf2_avail += r;\n"
5710 " if (fd1 E<gt> 0)\n"
5711 " if (FD_ISSET(fd1, &wr)) {\n"
5712 " r = write(fd1, buf2 + buf2_written,\n"
5713 " buf2_avail - buf2_written);\n"
5717 " buf2_written += r;\n"
5719 " if (fd2 E<gt> 0)\n"
5720 " if (FD_ISSET(fd2, &wr)) {\n"
5721 " r = write(fd2, buf1 + buf1_written,\n"
5722 " buf1_avail - buf1_written);\n"
5726 " buf1_written += r;\n"
5729 " r = recv(fd2, &c, 1, MSG_OOB);\n"
5733 " send(fd1, &c, 1, MSG_OOB);\n"
5735 " if (fd1 E<gt> 0)\n"
5736 " if (FD_ISSET(fd1, &rd)) {\n"
5737 " r = read(fd1, buf1 + buf1_avail,\n"
5738 " BUF_SIZE - buf1_avail);\n"
5742 " buf1_avail += r;\n"
5744 " if (fd2 E<gt> 0)\n"
5745 " if (FD_ISSET(fd2, &rd)) {\n"
5746 " r = read(fd2, buf2 + buf2_avail,\n"
5747 " BUF_SIZE - buf2_avail);\n"
5751 " buf2_avail += r;\n"
5753 " if (fd1 E<gt> 0)\n"
5754 " if (FD_ISSET(fd1, &wr)) {\n"
5755 " r = write(fd1, buf2 + buf2_written,\n"
5756 " buf2_avail - buf2_written);\n"
5760 " buf2_written += r;\n"
5762 " if (fd2 E<gt> 0)\n"
5763 " if (FD_ISSET(fd2, &wr)) {\n"
5764 " r = write(fd2, buf1 + buf1_written,\n"
5765 " buf1_avail - buf1_written);\n"
5769 " buf1_written += r;\n"
5773 #: build/C/man2/select_tut.2:781
5775 msgid " /* check if write data has caught read data */\n"
5776 msgstr " /* check if write data has caught read data */\n"
5779 #: build/C/man2/select_tut.2:786
5782 " if (buf1_written == buf1_avail)\n"
5783 " buf1_written = buf1_avail = 0;\n"
5784 " if (buf2_written == buf2_avail)\n"
5785 " buf2_written = buf2_avail = 0;\n"
5787 " if (buf1_written == buf1_avail)\n"
5788 " buf1_written = buf1_avail = 0;\n"
5789 " if (buf2_written == buf2_avail)\n"
5790 " buf2_written = buf2_avail = 0;\n"
5793 #: build/C/man2/select_tut.2:789
5796 " /* one side has closed the connection, keep\n"
5797 " writing to the other side until empty */\n"
5799 " /* one side has closed the connection, keep\n"
5800 " writing to the other side until empty */\n"
5803 #: build/C/man2/select_tut.2:797
5806 " if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5808 " if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5811 " exit(EXIT_SUCCESS);\n"
5814 " if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5816 " if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5819 " exit(EXIT_SUCCESS);\n"
5823 #: build/C/man2/select_tut.2:811
5825 "The above program properly forwards most kinds of TCP connections including "
5826 "OOB signal data transmitted by B<telnet> servers. It handles the tricky "
5827 "problem of having data flow in both directions simultaneously. You might "
5828 "think it more efficient to use a B<fork>(2) call and devote a thread to "
5829 "each stream. This becomes more tricky than you might suspect. Another idea "
5830 "is to set nonblocking I/O using B<fcntl>(2). This also has its problems "
5831 "because you end up using inefficient timeouts."
5833 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
5834 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
5835 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
5836 "(2) コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
5837 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
5838 "い。 あるいは、 B<fcntl>(2) を使って非ブロック I/O をセットすれば良い、とい"
5839 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
5843 #: build/C/man2/select_tut.2:817
5845 "The program does not handle more than one simultaneous connection at a time, "
5846 "although it could easily be extended to do this with a linked list of buffers"
5847 "\\(emone for each connection. At the moment, new connections cause the "
5848 "current connection to be dropped."
5850 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
5851 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
5852 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
5855 #. This man page was written by Paul Sheer.
5857 #: build/C/man2/select_tut.2:836
5859 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5860 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5861 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5864 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5865 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5866 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5870 #: build/C/man2/send.2:38
5876 #: build/C/man2/send.2:38 build/C/man7/socket.7:26
5882 #: build/C/man2/send.2:41
5883 msgid "send, sendto, sendmsg - send a message on a socket"
5884 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
5887 #: build/C/man2/send.2:45
5890 "B<#include E<lt>sys/types.hE<gt>>\n"
5891 "B<#include E<lt>sys/socket.hE<gt>>\n"
5893 "B<#include E<lt>sys/types.hE<gt>>\n"
5894 "B<#include E<lt>sys/socket.hE<gt>>\n"
5897 #: build/C/man2/send.2:48
5899 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5900 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5903 #: build/C/man2/send.2:52
5906 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5907 "B< const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5909 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5910 "B< const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5913 #: build/C/man2/send.2:55
5915 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5916 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5919 #: build/C/man2/send.2:63
5921 "The system calls B<send>(), B<sendto>(), and B<sendmsg>() are used to "
5922 "transmit a message to another socket."
5924 "システムコール B<send>(), B<sendto>(), B<sendmsg>() は、もう一方のソケットへ"
5925 "メッセージを転送するのに使用される。"
5928 #: build/C/man2/send.2:82
5930 "The B<send>() call may be used only when the socket is in a I<connected> "
5931 "state (so that the intended recipient is known). The only difference "
5932 "between B<send>() and B<write>(2) is the presence of I<flags>. With a "
5933 "zero I<flags> argument, B<send>() is equivalent to B<write>(2). Also, the "
5936 "B<send>() は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
5937 "できる (つまり、どの相手に送信するかは既知である)。 B<send>() と B<write>"
5938 "(2) の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
5939 "にフラグが指定されない場合、 B<send>() は B<write>(2) と等価である。 また、"
5942 #: build/C/man2/send.2:84
5944 msgid " send(sockfd, buf, len, flags);\n"
5945 msgstr " send(sockfd, buf, len, flags);\n"
5948 #: build/C/man2/send.2:86
5949 msgid "is equivalent to"
5953 #: build/C/man2/send.2:88
5955 msgid " sendto(sockfd, buf, len, flags, NULL, 0);\n"
5956 msgstr " sendto(sockfd, buf, len, flags, NULL, 0);\n"
5959 #: build/C/man2/send.2:92
5960 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
5962 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
5966 #: build/C/man2/send.2:120
5968 "If B<sendto>() is used on a connection-mode (B<SOCK_STREAM>, "
5969 "B<SOCK_SEQPACKET>) socket, the arguments I<dest_addr> and I<addrlen> are "
5970 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
5971 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
5972 "connected. Otherwise, the address of the target is given by I<dest_addr> "
5973 "with I<addrlen> specifying its size. For B<sendmsg>(), the address of the "
5974 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
5977 "B<sendto>() は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
5978 "B<SOCK_SEQPACKET>) で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
5979 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
5980 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
5981 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
5982 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
5983 "() では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
5984 "msg_namelen> で指定される。"
5987 #: build/C/man2/send.2:136
5989 "For B<send>() and B<sendto>(), the message is found in I<buf> and has "
5990 "length I<len>. For B<sendmsg>(), the message is pointed to by the elements "
5991 "of the array I<msg.msg_iov>. The B<sendmsg>() call also allows sending "
5992 "ancillary data (also known as control information)."
5994 "B<send>() と B<sendto>() では、メッセージは I<buf> に格納されており、その長"
5995 "さは I<len> であると解釈される。 B<sendmsg>() では、メッセージは 配列 I<msg."
5996 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>() では、補助データ "
5997 "(制御情報とも呼ばれる) を送信することもできる。"
6000 #: build/C/man2/send.2:141
6002 "If the message is too long to pass atomically through the underlying "
6003 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6006 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6007 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6008 "ラーが返され、そのメッセージは転送されない。"
6011 #: build/C/man2/send.2:145
6013 "No indication of failure to deliver is implicit in a B<send>(). Locally "
6014 "detected errors are indicated by a return value of -1."
6016 "B<send>() では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6017 "出された場合は、返り値 -1 として通知される。"
6020 #: build/C/man2/send.2:158
6022 "When the message does not fit into the send buffer of the socket, B<send>() "
6023 "normally blocks, unless the socket has been placed in nonblocking I/O mode. "
6024 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6025 "in this case. The B<select>(2) call may be used to determine when it is "
6026 "possible to send more data."
6028 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>() は"
6029 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6030 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6031 "つデータをさらに送信できるようになるかを知るために、 B<select>(2) コールを使"
6034 #. FIXME ? document MSG_PROXY (which went away in 2.3.15)
6036 #: build/C/man2/send.2:164
6038 "The I<flags> argument is the bitwise OR of zero or more of the following "
6041 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6045 #: build/C/man2/send.2:164
6047 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6048 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6051 #: build/C/man2/send.2:178
6053 "Tell the link layer that forward progress happened: you got a successful "
6054 "reply from the other side. If the link layer doesn't get this it will "
6055 "regularly reprobe the neighbor (e.g., via a unicast ARP). Only valid on "
6056 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
6057 "IPv4 and IPv6. See B<arp>(7) for details."
6059 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6060 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6061 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6062 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6063 "されている。 詳しくは B<arp>(7) 参照のこと。"
6066 #: build/C/man2/send.2:178
6068 msgid "B<MSG_DONTROUTE>"
6069 msgstr "B<MSG_DONTROUTE>"
6072 #: build/C/man2/send.2:186
6074 "Don't use a gateway to send out the packet, only send to hosts on directly "
6075 "connected networks. This is usually used only by diagnostic or routing "
6076 "programs. This is only defined for protocol families that route; packet "
6079 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6080 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6081 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6082 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6085 #: build/C/man2/send.2:197
6087 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6088 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6089 "flag with the B<F_SETFL> B<fcntl>(2))."
6091 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6092 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2) の B<F_SETFL> で "
6093 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6096 #: build/C/man2/send.2:197
6098 msgid "B<MSG_EOR> (since Linux 2.2)"
6099 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6102 #: build/C/man2/send.2:201
6104 "Terminates a record (when this notion is supported, as for sockets of type "
6105 "B<SOCK_SEQPACKET>)."
6107 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6111 #: build/C/man2/send.2:201
6113 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6114 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6117 #: build/C/man2/send.2:210
6119 "The caller has more data to send. This flag is used with TCP sockets to "
6120 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6121 "with the difference that this flag can be set on a per-call basis."
6123 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6124 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6125 "(7) を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6129 #: build/C/man2/send.2:219
6131 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6132 "the kernel to package all of the data sent in calls with this flag set into "
6133 "a single datagram which is only transmitted when a call is performed that "
6134 "does not specify this flag. (See also the B<UDP_CORK> socket option "
6135 "described in B<udp>(7).)"
6137 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6138 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6139 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6140 "のシステムコールが実行された際に初めて送信される (B<udp>(7) に記載されている"
6141 "ソケットオプション B<UDP_CORK> も参照)。"
6144 #: build/C/man2/send.2:219
6146 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6147 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6150 #: build/C/man2/send.2:228
6152 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6153 "the other end breaks the connection. The B<EPIPE> error is still returned."
6155 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6156 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6159 #: build/C/man2/send.2:237
6161 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6162 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6165 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6166 "B<SOCK_STREAM>) で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6170 #: build/C/man2/send.2:244
6172 "The definition of the I<msghdr> structure follows. See B<recv>(2) and "
6173 "below for an exact description of its fields."
6175 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6176 "B<recv>(2) と以下の説明を参照すること。"
6178 #. Still to be documented:
6179 #. Send file descriptors and user credentials using the
6180 #. msg_control* fields.
6181 #. The flags returned in msg_flags.
6183 #: build/C/man2/send.2:273
6185 "You may send control information using the I<msg_control> and "
6186 "I<msg_controllen> members. The maximum control buffer length the kernel can "
6187 "process is limited per socket by the value in I</proc/sys/net/core/"
6188 "optmem_max>; see B<socket>(7)."
6190 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6191 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6192 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7) を参照。"
6195 #: build/C/man2/send.2:278
6197 "On success, these calls return the number of characters sent. On error, -1 "
6198 "is returned, and I<errno> is set appropriately."
6200 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6201 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6204 #: build/C/man2/send.2:283
6206 "These are some standard errors generated by the socket layer. Additional "
6207 "errors may be generated and returned from the underlying protocol modules; "
6208 "see their respective manual pages."
6210 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6211 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6215 #: build/C/man2/send.2:291
6217 "(For UNIX domain sockets, which are identified by pathname) Write "
6218 "permission is denied on the destination socket file, or search permission is "
6219 "denied for one of the directories the path prefix. (See B<path_resolution>"
6222 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6224 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6225 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6226 "(B<path_resolution>(7) も参照のこと)"
6229 #: build/C/man2/send.2:294
6231 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6232 "as though it was a unicast address."
6234 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6235 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6237 #. Actually EAGAIN on Linux
6239 #: build/C/man2/send.2:302
6241 "The socket is marked nonblocking and the requested operation would block. "
6242 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6243 "require these constants to have the same value, so a portable application "
6244 "should check for both possibilities."
6246 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6247 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6248 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6252 #: build/C/man2/send.2:305
6253 msgid "An invalid descriptor was specified."
6254 msgstr "無効なディスクリプターが指定された。"
6257 #: build/C/man2/send.2:305
6259 msgid "B<ECONNRESET>"
6260 msgstr "B<ECONNRESET>"
6263 #: build/C/man2/send.2:308
6264 msgid "Connection reset by peer."
6265 msgstr "接続が接続相手によりリセットされた。"
6268 #: build/C/man2/send.2:308
6270 msgid "B<EDESTADDRREQ>"
6271 msgstr "B<EDESTADDRREQ>"
6274 #: build/C/man2/send.2:311
6275 msgid "The socket is not connection-mode, and no peer address is set."
6277 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6281 #: build/C/man2/send.2:314
6282 msgid "An invalid user space address was specified for an argument."
6283 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6286 #: build/C/man2/send.2:318
6287 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6288 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7) 参照。"
6291 #: build/C/man2/send.2:327
6293 "The connection-mode socket was connected already but a recipient was "
6294 "specified. (Now either this error is returned, or the recipient "
6295 "specification is ignored.)"
6297 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6298 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6302 #: build/C/man2/send.2:327
6305 msgstr "B<EMSGSIZE>"
6307 #. (e.g., SOCK_DGRAM )
6309 #: build/C/man2/send.2:333
6311 "The socket type requires that message be sent atomically, and the size of "
6312 "the message to be sent made this impossible."
6314 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6315 "るが、 メッセージが大き過ぎるため送信することができない。"
6318 #: build/C/man2/send.2:341
6320 "The output queue for a network interface was full. This generally indicates "
6321 "that the interface has stopped sending, but may be caused by transient "
6322 "congestion. (Normally, this does not occur in Linux. Packets are just "
6323 "silently dropped when a device queue overflows.)"
6325 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6326 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6327 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6328 "フローした場合にはパケットは黙って捨てられる)"
6331 #: build/C/man2/send.2:344
6332 msgid "No memory available."
6336 #: build/C/man2/send.2:347
6337 msgid "The socket is not connected, and no target has been given."
6338 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6341 #: build/C/man2/send.2:357
6342 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6344 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6348 #: build/C/man2/send.2:357
6354 #: build/C/man2/send.2:366
6356 "The local end has been shut down on a connection oriented socket. In this "
6357 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6360 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6361 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6364 #: build/C/man2/send.2:369
6365 msgid "4.4BSD, SVr4, POSIX.1-2001. These function calls appeared in 4.2BSD."
6367 "4.4BSD, SVr4, POSIX.1-2001. (これらの関数コールは 4.2BSD で最初に登場した)。"
6370 #: build/C/man2/send.2:380
6372 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags. "
6373 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>. The B<MSG_CONFIRM> "
6374 "flag is a Linux extension."
6376 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
6377 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
6378 "ラグは Linux での拡張である。"
6381 #: build/C/man2/send.2:393
6383 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
6384 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
6385 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
6386 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
6387 "and libc5. See also B<accept>(2)."
6389 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
6390 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
6391 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
6392 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
6393 "libc5 では I<int> である。 B<accept>(2) も参照すること。"
6396 #: build/C/man2/send.2:412
6398 "See B<sendmmsg(2)> for information about a Linux-specific system call that "
6399 "can be used to transmit multiple datagrams in a single call."
6401 "B<sendmmsg>(2) には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
6403 "Linux 固有の システムコールに関する情報が書かれている。"
6406 #: build/C/man2/send.2:417
6407 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
6408 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
6411 #: build/C/man2/send.2:422
6412 msgid "An example of the use of B<sendto>() is shown in B<getaddrinfo>(3)."
6413 msgstr "B<sendto>() の利用例が B<getaddrinfo>(3) に記載されている。"
6416 #: build/C/man2/send.2:437
6418 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6419 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6420 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6422 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6423 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6424 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6427 #: build/C/man2/sendmmsg.2:28
6433 #: build/C/man2/sendmmsg.2:28
6439 #: build/C/man2/sendmmsg.2:31
6440 msgid "sendmmsg - send multiple messages on a socket"
6444 #: build/C/man2/sendmmsg.2:39
6447 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6448 "B< unsigned int >I<flags>B<);>\n"
6450 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6451 "B< unsigned int >I<flags>B<);>\n"
6453 #. See commit 228e548e602061b08ee8e8966f567c12aa079682
6455 #: build/C/man2/sendmmsg.2:49
6457 "The B<sendmmsg>() system call is an extension of B<sendmsg>(2) that allows "
6458 "the caller to transmit multiple messages on a socket using a single system "
6459 "call. (This has performance benefits for some applications.)"
6463 #: build/C/man2/sendmmsg.2:54
6465 "The I<sockfd> argument is the file descriptor of the socket on which data is "
6466 "to be transmitted."
6470 #: build/C/man2/sendmmsg.2:75
6473 "struct mmsghdr {\n"
6474 " struct msghdr msg_hdr; /* Message header */\n"
6475 " unsigned int msg_len; /* Number of bytes transmitted */\n"
6480 #: build/C/man2/sendmmsg.2:91
6482 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
6483 "(2). The I<msg_len> field is used to return the number of bytes sent from "
6484 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
6485 "B<sendmsg>(2) call)."
6489 #: build/C/man2/sendmmsg.2:97
6491 "The I<flags> argument contains flags ORed together. The flags are the same "
6492 "as for B<sendmsg>(2)."
6496 #: build/C/man2/sendmmsg.2:107
6498 "A blocking B<sendmmsg>() call blocks until I<vlen> messages have been "
6499 "sent. A nonblocking call sends as many messages as possible (up to the "
6500 "limit specified by I<vlen>) and returns immediately."
6504 #: build/C/man2/sendmmsg.2:119
6506 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
6507 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
6508 "corresponding I<msg_hdr>. The return value of the call indicates the number "
6509 "of elements of I<msgvec> that have been updated."
6513 #: build/C/man2/sendmmsg.2:129
6515 "On success, B<sendmmsg>() returns the number of messages sent from "
6516 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
6517 "B<sendmmsg>() call to send the remaining messages."
6521 #: build/C/man2/sendmmsg.2:133
6522 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
6526 #. commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
6527 #. ... only return an error if no datagrams could be sent.
6528 #. If less than the requested number of messages were sent, the application
6529 #. must retry starting at the first failed one and if the problem is
6530 #. persistent the error will be returned.
6531 #. This matches the behaviour of other syscalls like read/write - it
6532 #. is not an error if less than the requested number of elements are sent.
6534 #: build/C/man2/sendmmsg.2:145
6536 "Errors are as for B<sendmsg>(2). An error is returned only if no datagrams "
6541 #: build/C/man2/sendmmsg.2:150
6543 "The B<sendmmsg>() system call was added in Linux 3.0. Support in glibc was "
6544 "added in version 2.14."
6548 #: build/C/man2/sendmmsg.2:153
6549 msgid "B<sendmmsg>() is Linux-specific."
6554 #. commit 98382f419f32d2c12d021943b87dea555677144b
6555 #. net: Cap number of elements for sendmmsg
6556 #. To limit the amount of time we can spend in sendmmsg, cap the
6557 #. number of elements to UIO_MAXIOV (currently 1024).
6558 #. For error handling an application using sendmmsg needs to retry at
6559 #. the first unsent message, so capping is simpler and requires less
6560 #. application logic than returning EINVAL.
6562 #: build/C/man2/sendmmsg.2:168
6563 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
6567 #: build/C/man2/sendmmsg.2:173
6568 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
6569 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
6572 #: build/C/man3/sockatmark.3:23
6578 #: build/C/man3/sockatmark.3:26
6579 msgid "sockatmark - determine whether socket is at out-of-band mark"
6581 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
6585 #: build/C/man3/sockatmark.3:28 build/C/man2/socket.2:48
6586 #: build/C/man7/socket.7:31 build/C/man2/socketpair.2:47
6587 msgid "B<#include E<lt>sys/socket.hE<gt>>"
6588 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
6591 #: build/C/man3/sockatmark.3:30
6592 msgid "B<int sockatmark(int >I<sockfd>B<);>"
6593 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
6596 #: build/C/man3/sockatmark.3:39
6598 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6601 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6605 #: build/C/man3/sockatmark.3:49
6607 "B<sockatmark>() returns a value indicating whether or not the socket "
6608 "referred to by the file descriptor I<sockfd> is at the out-of-band mark. If "
6609 "the socket is at the mark, then 1 is returned; if the socket is not at the "
6610 "mark, 0 is returned. This function does not remove the out-of-band mark."
6612 "B<sockatmark>() はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
6613 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
6614 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
6615 "この関数は帯域外マークを削除しない。"
6618 #: build/C/man3/sockatmark.3:54
6620 "A successful call to B<sockatmark>() returns 1 if the socket is at the out-"
6621 "of-band mark, or 0 if it is not. On error, -1 is returned and I<errno> is "
6622 "set to indicate the error."
6624 "B<sockatmark>() の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
6625 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
6626 "れ、エラーを表す I<errno> が設定される。"
6629 #: build/C/man3/sockatmark.3:59
6630 msgid "I<sockfd> is not a valid file descriptor."
6631 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
6633 #. POSIX.1 says ENOTTY for this case
6635 #: build/C/man3/sockatmark.3:66
6637 "I<sockfd> is not a file descriptor to which B<sockatmark>() can be applied."
6639 "I<sockfd> は B<sockatmark>() が適用できないファイルディスクリプタである。"
6642 #: build/C/man3/sockatmark.3:69
6643 msgid "B<sockatmark>() was added to glibc in version 2.2.4."
6644 msgstr "B<sockatmark>() は glibc バージョン 2.2.4 で追加された。"
6647 #: build/C/man3/sockatmark.3:71
6648 msgid "POSIX.1-2001."
6649 msgstr "POSIX.1-2001."
6652 #: build/C/man3/sockatmark.3:78
6654 "If B<sockatmark>() returns 1, then the out-of-band data can be read using "
6655 "the B<MSG_OOB> flag of B<recv>(2)."
6657 "B<sockatmark>() が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
6658 "B<recv>(2) で読み込むことができる。"
6661 #: build/C/man3/sockatmark.3:80
6662 msgid "Out-of-band data is only supported on some stream socket protocols."
6664 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
6668 #: build/C/man3/sockatmark.3:85
6670 "B<sockatmark>() can safely be called from a handler for the B<SIGURG> "
6673 "B<sockatmark>() は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
6677 #: build/C/man3/sockatmark.3:91
6679 "B<sockatmark>() is implemented using the B<SIOCATMARK> B<ioctl>(2) "
6682 "B<sockatmark>() は B<SIOCATMARK> B<ioctl>(2) 操作を使って実装されている。"
6685 #: build/C/man3/sockatmark.3:95
6686 msgid "Prior to glibc 2.4, B<sockatmark>() did not work."
6687 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>() は動作しない。"
6690 #: build/C/man3/sockatmark.3:100
6692 "The following code can be used after receipt of a B<SIGURG> signal to read "
6693 "(and discard) all data up to the mark, and then read the byte of data at the "
6696 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
6697 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
6700 #: build/C/man3/sockatmark.3:105
6703 " char buf[BUF_LEN];\n"
6707 " char buf[BUF_LEN];\n"
6712 #: build/C/man3/sockatmark.3:112
6716 " atmark = sockatmark(sockfd);\n"
6717 " if (atmark == -1) {\n"
6718 " perror(\"sockatmark\");\n"
6723 " atmark = sockatmark(sockfd);\n"
6724 " if (atmark == -1) {\n"
6725 " perror(\"sockatmark\");\n"
6730 #: build/C/man3/sockatmark.3:115
6740 #: build/C/man3/sockatmark.3:122
6743 " s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6745 " perror(\"read\");\n"
6746 " if (s E<lt>= 0)\n"
6750 " s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6752 " perror(\"read\");\n"
6753 " if (s E<lt>= 0)\n"
6758 #: build/C/man3/sockatmark.3:129
6761 " if (atmark == 1) {\n"
6762 " if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6763 " perror(\"recv\");\n"
6768 " if (atmark == 1) {\n"
6769 " if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6770 " perror(\"recv\");\n"
6776 #: build/C/man3/sockatmark.3:135
6777 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6778 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6781 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
6787 #: build/C/man2/socket.2:41
6793 #: build/C/man2/socket.2:44
6794 msgid "socket - create an endpoint for communication"
6795 msgstr "socket - 通信のための端点(endpoint)を作成する"
6798 #: build/C/man2/socket.2:46 build/C/man2/socketpair.2:45
6799 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
6800 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
6803 #: build/C/man2/socket.2:50
6804 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6805 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6808 #: build/C/man2/socket.2:53
6810 "B<socket>() creates an endpoint for communication and returns a descriptor."
6812 "B<socket>() は通信のための端点(endpoint)を作成し、ディスクリプター"
6816 #: build/C/man2/socket.2:61
6818 "The I<domain> argument specifies a communication domain; this selects the "
6819 "protocol family which will be used for communication. These families are "
6820 "defined in I<E<lt>sys/socket.hE<gt>>. The currently understood formats "
6823 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
6824 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
6825 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
6829 #: build/C/man2/socket.2:64
6831 msgid "Name:Purpose:Man page\n"
6832 msgstr "名前:目的:マニュアル\n"
6835 #: build/C/man2/socket.2:65 build/C/man2/socket.2:72 build/C/man2/socket.2:77
6836 #: build/C/man2/socket.2:82 build/C/man2/socket.2:85 build/C/man2/socket.2:92
6837 #: build/C/man2/socket.2:97 build/C/man2/socket.2:102
6838 #: build/C/man2/socket.2:105 build/C/man2/socket.2:110
6844 #: build/C/man2/socket.2:66
6846 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
6847 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
6850 #: build/C/man2/socket.2:67 build/C/man2/socket.2:69 build/C/man2/socket.2:87
6851 #: build/C/man2/socket.2:89 build/C/man2/socket.2:99 build/C/man2/socket.2:112
6852 #: build/C/man2/socket.2:114 build/C/man7/socket.7:162
6858 #: build/C/man2/socket.2:68
6860 msgid "Local communication\n"
6864 #: build/C/man2/socket.2:70
6866 msgid "B<unix>(7)\n"
6867 msgstr "B<unix>(7)\n"
6870 #: build/C/man2/socket.2:71 build/C/man2/socket.2:76 build/C/man2/socket.2:81
6871 #: build/C/man2/socket.2:91 build/C/man2/socket.2:96 build/C/man2/socket.2:109
6872 #: build/C/man2/socket.2:116 build/C/man7/socket.7:141
6873 #: build/C/man7/socket.7:145 build/C/man7/socket.7:148
6874 #: build/C/man7/socket.7:154 build/C/man7/socket.7:157
6875 #: build/C/man7/socket.7:166 build/C/man7/socket.7:173
6881 #: build/C/man2/socket.2:73
6883 msgid "B<AF_INET>\n"
6884 msgstr "B<AF_INET>\n"
6887 #: build/C/man2/socket.2:74
6889 msgid "T}:IPv4 Internet protocols:T{\n"
6890 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
6893 #: build/C/man2/socket.2:75
6899 #: build/C/man2/socket.2:78
6901 msgid "B<AF_INET6>\n"
6902 msgstr "B<AF_INET6>\n"
6905 #: build/C/man2/socket.2:79
6907 msgid "T}:IPv6 Internet protocols:T{\n"
6908 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
6911 #: build/C/man2/socket.2:80
6913 msgid "B<ipv6>(7)\n"
6914 msgstr "B<ipv6>(7)\n"
6917 #: build/C/man2/socket.2:83
6920 msgstr "B<AF_IPX>\n"
6923 #: build/C/man2/socket.2:84
6925 msgid "T}:IPX - Novell protocols:\n"
6926 msgstr "T}:IPX - Novell プロトコル:\n"
6929 #: build/C/man2/socket.2:86
6931 msgid "B<AF_NETLINK>\n"
6932 msgstr "B<AF_NETLINK>\n"
6935 #: build/C/man2/socket.2:88
6937 msgid "Kernel user interface device\n"
6938 msgstr "カーネル・ユーザ・デバイス\n"
6941 #: build/C/man2/socket.2:90
6943 msgid "B<netlink>(7)\n"
6944 msgstr "B<netlink>(7)\n"
6947 #: build/C/man2/socket.2:93
6950 msgstr "B<AF_X25>\n"
6953 #: build/C/man2/socket.2:94
6955 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
6956 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
6959 #: build/C/man2/socket.2:95
6962 msgstr "B<x25>(7)\n"
6965 #: build/C/man2/socket.2:98
6967 msgid "B<AF_AX25>\n"
6968 msgstr "B<AF_AX25>\n"
6971 #: build/C/man2/socket.2:100
6973 msgid "Amateur radio AX.25 protocol\n"
6974 msgstr "アマチュア無線 AX.25 プロトコル\n"
6977 #: build/C/man2/socket.2:101
6983 #: build/C/man2/socket.2:103
6985 msgid "B<AF_ATMPVC>\n"
6986 msgstr "B<AF_ATMPVC>\n"
6989 #: build/C/man2/socket.2:104
6991 msgid "T}:Access to raw ATM PVCs:\n"
6992 msgstr "T}:生の ATM PVC にアクセスする:\n"
6995 #: build/C/man2/socket.2:106
6997 msgid "B<AF_APPLETALK>\n"
6998 msgstr "B<AF_APPLETALK>\n"
7001 #: build/C/man2/socket.2:107
7003 msgid "T}:Appletalk:T{\n"
7004 msgstr "T}:アップルトーク:T{\n"
7007 #: build/C/man2/socket.2:108
7010 msgstr "B<ddp>(7)\n"
7013 #: build/C/man2/socket.2:111
7015 msgid "B<AF_PACKET>\n"
7016 msgstr "B<AF_PACKET>\n"
7019 #: build/C/man2/socket.2:113
7021 msgid "Low level packet interface\n"
7022 msgstr "低レベルのパケットインターフェース\n"
7025 #: build/C/man2/socket.2:115
7027 msgid "B<packet>(7)\n"
7028 msgstr "B<packet>(7)\n"
7031 #: build/C/man2/socket.2:124
7033 "The socket has the indicated I<type>, which specifies the communication "
7034 "semantics. Currently defined types are:"
7036 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7037 "る。 定義されている型は現在以下の通り。"
7040 #: build/C/man2/socket.2:124
7042 msgid "B<SOCK_STREAM>"
7043 msgstr "B<SOCK_STREAM>"
7046 #: build/C/man2/socket.2:128
7048 "Provides sequenced, reliable, two-way, connection-based byte streams. An "
7049 "out-of-band data transmission mechanism may be supported."
7051 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7052 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7055 #: build/C/man2/socket.2:128
7057 msgid "B<SOCK_DGRAM>"
7058 msgstr "B<SOCK_DGRAM>"
7061 #: build/C/man2/socket.2:132
7063 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7065 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ) をサポートする。"
7068 #: build/C/man2/socket.2:132
7070 msgid "B<SOCK_SEQPACKET>"
7071 msgstr "B<SOCK_SEQPACKET>"
7074 #: build/C/man2/socket.2:137
7076 "Provides a sequenced, reliable, two-way connection-based data transmission "
7077 "path for datagrams of fixed maximum length; a consumer is required to read "
7078 "an entire packet with each input system call."
7080 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7081 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7085 #: build/C/man2/socket.2:137
7088 msgstr "B<SOCK_RAW>"
7091 #: build/C/man2/socket.2:140
7092 msgid "Provides raw network protocol access."
7093 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7096 #: build/C/man2/socket.2:140
7099 msgstr "B<SOCK_RDM>"
7102 #: build/C/man2/socket.2:143
7103 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7104 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7107 #: build/C/man2/socket.2:143
7109 msgid "B<SOCK_PACKET>"
7110 msgstr "B<SOCK_PACKET>"
7113 #: build/C/man2/socket.2:148
7114 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7116 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7) を参照する"
7120 #: build/C/man2/socket.2:154
7122 "Some socket types may not be implemented by all protocol families; for "
7123 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7125 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7126 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7129 #: build/C/man2/socket.2:162
7131 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7132 "addition to specifying a socket type, it may include the bitwise OR of any "
7133 "of the following values, to modify the behavior of B<socket>():"
7135 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7136 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7137 "ることで、 B<socket>() の振舞いを変更することができる。"
7140 #: build/C/man2/socket.2:196
7142 "The I<protocol> specifies a particular protocol to be used with the socket. "
7143 "Normally only a single protocol exists to support a particular socket type "
7144 "within a given protocol family, in which case I<protocol> can be specified "
7145 "as 0. However, it is possible that many protocols may exist, in which case "
7146 "a particular protocol must be specified in this manner. The protocol number "
7147 "to use is specific to the ``communication domain'' in which communication is "
7148 "to take place; see B<protocols>(5). See B<getprotoent>(3) on how to map "
7149 "protocol name strings to protocol numbers."
7151 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7152 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7153 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7154 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7155 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7156 "イン''に 固有である; B<protocols>(5) を参照すること。 プロトコル名をどうやっ"
7157 "てプロトコル番号に対応させるかについては B<getprotoent>(3) を参照すること。"
7160 #: build/C/man2/socket.2:226
7162 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7163 "pipes. They do not preserve record boundaries. A stream socket must be in "
7164 "a I<connected> state before any data may be sent or received on it. A "
7165 "connection to another socket is created with a B<connect>(2) call. Once "
7166 "connected, data may be transferred using B<read>(2) and B<write>(2) calls "
7167 "or some variant of the B<send>(2) and B<recv>(2) calls. When a session "
7168 "has been completed a B<close>(2) may be performed. Out-of-band data may "
7169 "also be transmitted as described in B<send>(2) and received as described in "
7172 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7173 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7174 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7175 "続は B<connect>(2) コールによって行なわれる。一度接続したらデータは B<read>"
7176 "(2) と B<write>(2) コールや B<send>(2) と B<recv>(2) コールの変種を使用し"
7177 "て転送できる。 セッションが完了したら B<close>(2) が行なわれる。帯域外データ"
7178 "の転送も B<send>(2) に記述されており、 受信も B<recv>(2) に記述されている。"
7181 #: build/C/man2/socket.2:252
7183 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7184 "data is not lost or duplicated. If a piece of data for which the peer "
7185 "protocol has buffer space cannot be successfully transmitted within a "
7186 "reasonable length of time, then the connection is considered to be dead. "
7187 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7188 "protocol-specific manner if the other end is still alive. A B<SIGPIPE> "
7189 "signal is raised if a process sends or receives on a broken stream; this "
7190 "causes naive processes, which do not handle the signal, to exit. "
7191 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7192 "sockets. The only difference is that B<read>(2) calls will return only the "
7193 "amount of data requested, and any data remaining in the arriving packet will "
7194 "be discarded. Also all message boundaries in incoming datagrams are "
7197 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7198 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7199 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7200 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7201 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7202 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7203 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7204 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2) コールが要求さ"
7205 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
7206 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
7209 #: build/C/man2/socket.2:262
7211 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
7212 "correspondents named in B<sendto>(2) calls. Datagrams are generally "
7213 "received with B<recvfrom>(2), which returns the next datagram along with the "
7214 "address of its sender."
7216 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2) コールで指定された相手"
7217 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
7218 "(2) で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
7222 #: build/C/man2/socket.2:269
7224 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
7225 "from the device driver. Use B<packet>(7) instead."
7227 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
7228 "接受信するためのものである。 今は代わりに B<packet>(7) を用いること。"
7231 #: build/C/man2/socket.2:292
7233 "An B<fcntl>(2) B<F_SETOWN> operation can be used to specify a process or "
7234 "process group to receive a B<SIGURG> signal when the out-of-band data "
7235 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
7236 "unexpectedly. This operation may also be used to set the process or process "
7237 "group that receives the I/O and asynchronous notification of I/O events via "
7238 "B<SIGIO>. Using B<F_SETOWN> is equivalent to an B<ioctl>(2) call with the "
7239 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
7241 "B<fcntl>(2) の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
7242 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
7243 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
7244 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
7245 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
7246 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
7247 "B<SIOCSPGRP> の引数で B<ioctl>(2) を使用することと等価である。"
7250 #: build/C/man2/socket.2:302
7252 "When the network signals an error condition to the protocol module (e.g., "
7253 "using a ICMP message for IP) the pending error flag is set for the socket. "
7254 "The next operation on this socket will return the error code of the pending "
7255 "error. For some protocols it is possible to enable a per-socket error queue "
7256 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
7259 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
7260 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
7261 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
7262 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
7263 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7) の "
7264 "B<IP_RECVERR> を参照すること。"
7267 #: build/C/man2/socket.2:312
7269 "The operation of sockets is controlled by socket level I<options>. These "
7270 "options are defined in I<E<lt>sys/socket.hE<gt>>. The functions "
7271 "B<setsockopt>(2) and B<getsockopt>(2) are used to set and get options, "
7274 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
7275 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2) と "
7276 "B<getsockopt>(2) 関数はそれぞれオプションの設定と取得を行なう。"
7279 #: build/C/man2/socket.2:317
7281 "On success, a file descriptor for the new socket is returned. On error, -1 "
7282 "is returned, and I<errno> is set appropriately."
7284 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
7285 "した場合は -1 を返し、 I<errno> を適切に設定する。"
7288 #: build/C/man2/socket.2:322
7290 "Permission to create a socket of the specified type and/or protocol is "
7293 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
7296 #: build/C/man2/socket.2:325
7297 msgid "The implementation does not support the specified address family."
7298 msgstr "指定されたアドレスファミリーがサポートされていない。"
7301 #: build/C/man2/socket.2:328
7302 msgid "Unknown protocol, or protocol family not available."
7303 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
7305 #. Since Linux 2.6.27
7307 #: build/C/man2/socket.2:333
7308 msgid "Invalid flags in I<type>."
7309 msgstr "I<type> に無効なフラグが指定されている。"
7312 #: build/C/man2/socket.2:336
7313 msgid "Process file table overflow."
7314 msgstr "プロセスのファイルテーブルが溢れている。"
7317 #: build/C/man2/socket.2:339
7319 msgid "B<ENOBUFS> or B<ENOMEM>"
7320 msgstr "B<ENOBUFS> または B<ENOMEM>"
7323 #: build/C/man2/socket.2:344
7325 "Insufficient memory is available. The socket cannot be created until "
7326 "sufficient resources are freed."
7328 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
7332 #: build/C/man2/socket.2:344 build/C/man2/socketpair.2:90
7334 msgid "B<EPROTONOSUPPORT>"
7335 msgstr "B<EPROTONOSUPPORT>"
7338 #: build/C/man2/socket.2:348
7340 "The protocol type or the specified protocol is not supported within this "
7343 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
7347 #: build/C/man2/socket.2:350
7348 msgid "Other errors may be generated by the underlying protocol modules."
7349 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
7352 #: build/C/man2/socket.2:352
7353 msgid "4.4BSD, POSIX.1-2001."
7354 msgstr "4.4BSD, POSIX.1-2001."
7357 #: build/C/man2/socket.2:358
7358 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
7359 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
7362 #: build/C/man2/socket.2:364
7364 "B<socket>() appeared in 4.2BSD. It is generally portable to/from non-BSD "
7365 "systems supporting clones of the BSD socket layer (including System V "
7368 "B<socket>() は 4.2BSD で登場した。一般に、(System V の変種を含めて) BSD の"
7369 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
7373 #: build/C/man2/socket.2:383
7376 #| "The manifest constants used under 4.x BSD for protocol families are "
7377 #| "B<PF_UNIX>, B<PF_INET>, etc., while B<AF_UNIX> etc. are used for address "
7378 #| "families. However, already the BSD man page promises: \"The protocol "
7379 #| "family generally is the same as the address family\", and subsequent "
7380 #| "standards use AF_* everywhere."
7382 "The manifest constants used under 4.x BSD for protocol families are "
7383 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<PF_INET>, and so on "
7384 "are used for address families. However, already the BSD man page promises: "
7385 "\"The protocol family generally is the same as the address family\", and "
7386 "subsequent standards use AF_* everywhere."
7388 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには B<PF_UNIX>, "
7389 "B<PF_INET> 等を使用している。一方でアドレス・ファミリーには B<AF_UNIX> 等が使"
7390 "用されている。しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミ"
7391 "リーはアドレス・ファミリーと同じものである。」 と保証している。それでそれ以外"
7392 "の規格では全ての場所で AF_* が使用されている。"
7395 #: build/C/man2/socket.2:388
7396 msgid "An example of the use of B<socket>() is shown in B<getaddrinfo>(3)."
7397 msgstr "B<socket>() の利用例が B<getaddrinfo>(3) に記載されている。"
7400 #: build/C/man2/socket.2:411
7402 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7403 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7404 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7405 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7408 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7409 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7410 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7411 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7415 #: build/C/man2/socket.2:415
7417 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq is "
7418 "reprinted in I<UNIX Programmer's Supplementary Documents Volume 1.>"
7420 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq は "
7421 "I<UNIX Programmer's Supplementary Documents Volume 1> として再版された。"
7424 #: build/C/man2/socket.2:419
7426 "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
7427 "Programmer's Supplementary Documents Volume 1.>"
7429 "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
7430 "Supplementary Documents Volume 1> として再版された。"
7433 #: build/C/man7/socket.7:29
7434 msgid "socket - Linux socket interface"
7435 msgstr "socket - Linux のソケットインターフェース"
7438 #: build/C/man7/socket.7:33
7440 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7443 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7447 #: build/C/man7/socket.7:52
7449 "This manual page describes the Linux networking socket layer user "
7450 "interface. The BSD compatible sockets are the uniform interface between the "
7451 "user process and the network protocol stacks in the kernel. The protocol "
7452 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
7453 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>. See "
7454 "B<socket>(2) for more information on families and types."
7456 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
7457 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
7458 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
7459 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
7460 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>) と I<ソケットタイプ "
7461 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>) に分類できる。 これらに"
7462 "関するより詳しい情報は B<socket>(2) を参照のこと。"
7465 #: build/C/man7/socket.7:52
7467 msgid "Socket Layer Functions"
7471 #: build/C/man7/socket.7:56
7473 "These functions are used by the user process to send or receive packets and "
7474 "to do other socket operations. For more information see their respective "
7477 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
7478 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
7481 #: build/C/man7/socket.7:72
7483 "B<socket>(2) creates a socket, B<connect>(2) connects a socket to a remote "
7484 "socket address, the B<bind>(2) function binds a socket to a local socket "
7485 "address, B<listen>(2) tells the socket that new connections shall be "
7486 "accepted, and B<accept>(2) is used to get a new socket with a new incoming "
7487 "connection. B<socketpair>(2) returns two connected anonymous sockets (only "
7488 "implemented for a few local families like B<AF_UNIX>)"
7490 "B<socket>(2) はソケットを生成する。 B<connect>(2) はソケットをリモートのソ"
7491 "ケットアドレスに接続する。 B<bind>(2) はソケットをローカルのソケットアドレス"
7492 "にバインドする。 B<listen>(2) はソケットに新しい接続が来たら受信するように伝"
7493 "え、 B<accept>(2) は外部からやってきた接続に対して新しいソケットを得るために"
7494 "用いられる。 B<socketpair>(2) は互いに接続された二つの名前無しソケット "
7495 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
7499 #: build/C/man7/socket.7:94
7501 "B<send>(2), B<sendto>(2), and B<sendmsg>(2) send data over a socket, and "
7502 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2) receive data from a socket. "
7503 "B<poll>(2) and B<select>(2) wait for arriving data or a readiness to send "
7504 "data. In addition, the standard I/O operations like B<write>(2), B<writev>"
7505 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2) can be used to read and "
7508 "B<send>(2), B<sendto>(2), B<sendmsg>(2) はソケットを通してデータを送信し、 "
7509 "B<recv>(2) B<recvfrom>(2), B<recvmsg>(2) はソケットからデータを受信する。 "
7510 "B<poll>(2) と B<select>(2) はデータの到着を待ったり、データ送信の準備ができ"
7511 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
7512 "B<read>(2), B<readv>(2) のような標準的な I/O 操作もデータの読み書きに用いる"
7516 #: build/C/man7/socket.7:105
7518 "B<getsockname>(2) returns the local socket address and B<getpeername>(2) "
7519 "returns the remote socket address. B<getsockopt>(2) and B<setsockopt>(2) "
7520 "are used to set or get socket layer or protocol options. B<ioctl>(2) can "
7521 "be used to set or read some other options."
7523 "B<getsockbyname>(2) はローカルのソケットアドレスを返し、 B<getpeername>(2) "
7524 "はリモートのソケットアドレスを返す。 B<getsockopt>(2) と B<setsockopt>(2) "
7525 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
7526 "いくつかのオプションの取得・設定には B<ioctl>(2) を使うことができる。"
7529 #: build/C/man7/socket.7:110
7531 "B<close>(2) is used to close a socket. B<shutdown>(2) closes parts of a "
7532 "full-duplex socket connection."
7534 "B<close>(2) はソケットをクローズする。 B<shutdown>(2) は全二重なソケット接"
7538 #: build/C/man7/socket.7:116
7540 "Seeking, or calling B<pread>(2) or B<pwrite>(2) with a nonzero position is "
7541 "not supported on sockets."
7543 "シーク動作や、 0 以外の位置に対する B<pread>(2) や B<pwrite>(2) はソケット"
7547 #: build/C/man7/socket.7:133
7549 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
7550 "flag on a socket file descriptor using B<fcntl>(2). Then all operations "
7551 "that would block will (usually) return with B<EAGAIN> (operation should be "
7552 "retried later); B<connect>(2) will return B<EINPROGRESS> error. The user "
7553 "can then wait for various events via B<poll>(2) or B<select>(2)."
7555 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2) を使ってソ"
7556 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
7557 "うするとブロックされる操作は、 (通常) B<EAGAIN> エラーで戻ることになる (後で"
7558 "処理が再試行されることが期待されている)。 B<connect>(2) では B<EINPROGRESS> "
7559 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2) や "
7560 "B<select>(2) を使って待つことができる。"
7563 #: build/C/man7/socket.7:137
7565 msgid "I/O events\n"
7569 #: build/C/man7/socket.7:138
7571 msgid "Event:Poll flag:Occurrence\n"
7572 msgstr "イベント:poll フラグ:内容\n"
7575 #: build/C/man7/socket.7:139 build/C/man7/socket.7:142
7577 msgid "Read:POLLIN:T{\n"
7578 msgstr "Read:POLLIN:T{\n"
7581 #: build/C/man7/socket.7:140
7583 msgid "New data arrived.\n"
7584 msgstr "新しいデータが到着した。\n"
7587 #: build/C/man7/socket.7:143
7589 msgid "A connection setup has been completed\n"
7590 msgstr "(接続志向のソケットで)\n"
7593 #: build/C/man7/socket.7:144
7595 msgid "(for connection-oriented sockets)\n"
7596 msgstr "接続の設定が終了した。\n"
7599 #: build/C/man7/socket.7:146 build/C/man7/socket.7:149
7601 msgid "Read:POLLHUP:T{\n"
7602 msgstr "Read:POLLHUP:T{\n"
7605 #: build/C/man7/socket.7:147
7607 msgid "A disconnection request has been initiated by the other end.\n"
7608 msgstr "接続先で切断要求が生成された。\n"
7611 #: build/C/man7/socket.7:150
7613 msgid "A connection is broken (only for connection-oriented protocols).\n"
7614 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
7617 #: build/C/man7/socket.7:151
7619 msgid "When the socket is written\n"
7620 msgstr "この場合、ソケットに書き込みが行われると\n"
7623 #: build/C/man7/socket.7:152
7625 msgid "B<SIGPIPE>\n"
7626 msgstr "B<SIGPIPE>\n"
7629 #: build/C/man7/socket.7:153
7631 msgid "is also sent.\n"
7635 #: build/C/man7/socket.7:155
7637 msgid "Write:POLLOUT:T{\n"
7638 msgstr "Write:POLLOUT:T{\n"
7641 #: build/C/man7/socket.7:156
7643 msgid "Socket has enough send buffer space for writing new data.\n"
7644 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
7647 #: build/C/man7/socket.7:158
7649 msgid "Read/Write:T{\n"
7650 msgstr "Read/Write:T{\n"
7653 #: build/C/man7/socket.7:159
7659 #: build/C/man7/socket.7:160
7665 #: build/C/man7/socket.7:161
7671 #: build/C/man7/socket.7:163
7673 msgid "An outgoing\n"
7677 #: build/C/man7/socket.7:164
7679 msgid "B<connect>(2)\n"
7680 msgstr "B<connect>(2)\n"
7683 #: build/C/man7/socket.7:165
7689 #: build/C/man7/socket.7:167
7691 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
7692 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
7695 #: build/C/man7/socket.7:168
7697 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
7698 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
7701 #: build/C/man7/socket.7:169
7703 msgid "Exception:POLLPRI:T{\n"
7704 msgstr "Exception:POLLPRI:T{\n"
7707 #: build/C/man7/socket.7:170
7709 msgid "Urgent data arrived.\n"
7710 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
7713 #: build/C/man7/socket.7:171
7716 msgstr "B<SIGURG>\n"
7719 #: build/C/man7/socket.7:172
7721 msgid "is sent then.\n"
7725 #: build/C/man7/socket.7:202
7727 "An alternative to B<poll>(2) and B<select>(2) is to let the kernel inform "
7728 "the application about events via a B<SIGIO> signal. For that the B<O_ASYNC> "
7729 "flag must be set on a socket file descriptor via B<fcntl>(2) and a valid "
7730 "signal handler for B<SIGIO> must be installed via B<sigaction>(2). See the "
7731 "I<Signals> discussion below."
7733 "B<poll>(2) や B<select>(2) を使う代わりに、カーネルからアプリケーションに "
7734 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
7735 "は、 B<fcntl>(2) を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
7736 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2) に"
7737 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
7741 #: build/C/man7/socket.7:202
7743 msgid "Socket Options"
7747 #. In the list below, the text used to describe argument types
7748 #. for each socket option should be more consistent
7749 #. SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
7750 #. W R Stevens, UNPv1
7752 #: build/C/man7/socket.7:216
7754 "These socket options can be set by using B<setsockopt>(2) and read with "
7755 "B<getsockopt>(2) with the socket level set to B<SOL_SOCKET> for all sockets:"
7757 "これらのソケットオプションは、 B<setsockopt>(2) を用いれば設定でき、 "
7758 "B<getsockopt>(2) を用いれば取得できる。 但し、どのソケットの場合も ソケット"
7759 "レベルには B<SOL_SOCKET> を指定すること。"
7762 #: build/C/man7/socket.7:216
7764 msgid "B<SO_ACCEPTCONN>"
7765 msgstr "B<SO_ACCEPTCONN>"
7768 #: build/C/man7/socket.7:224
7770 "Returns a value indicating whether or not this socket has been marked to "
7771 "accept connections with B<listen>(2). The value 0 indicates that this is "
7772 "not a listening socket, the value 1 indicates that this is a listening "
7773 "socket. This socket option is read-only."
7775 "このソケットが B<listen>(2) によって接続待ち受け状態に設定されているかどうか"
7776 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
7777 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
7780 #: build/C/man7/socket.7:224
7782 msgid "B<SO_BINDTODEVICE>"
7783 msgstr "B<SO_BINDTODEVICE>"
7786 #: build/C/man7/socket.7:243
7788 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
7789 "the passed interface name. If the name is an empty string or the option "
7790 "length is zero, the socket device binding is removed. The passed option is "
7791 "a variable-length null-terminated interface name string with the maximum "
7792 "size of B<IFNAMSIZ>. If a socket is bound to an interface, only packets "
7793 "received from that particular interface are processed by the socket. Note "
7794 "that this only works for some socket types, particularly B<AF_INET> "
7795 "sockets. It is not supported for packet sockets (use normal B<bind>(2) "
7798 "このソケットを、引き数で渡したインターフェース名で指定される\n"
7799 "(\\(lqeth0\\(rq のような) 特定のデバイスにバインドする。\n"
7800 "名前が空文字列だったり、オプションの長さ (optlen) が 0 の場合には、\n"
7801 "ソケットのバインドが削除される。渡すオプションは、インターフェース名が\n"
7802 "入ったヌル文字で終端された可変長の文字列である。\n"
7803 "文字列の最大のサイズは B<IFNAMSIX> である。\n"
7804 "ソケットがインターフェースにバインドされると、その特定のインターフェース\n"
7805 "から受信されたパケットだけを処理する。\n"
7806 "このオプションはいくつかのソケットタイプ、\n"
7807 "特に B<AF_INET> に対してのみ動作する点に注意すること。\n"
7808 "パケットソケットではサポートされていない (通常の B<bind>(2) を使うこと)。"
7811 #: build/C/man7/socket.7:243
7813 msgid "B<SO_BROADCAST>"
7814 msgstr "B<SO_BROADCAST>"
7817 #: build/C/man7/socket.7:249
7819 "Set or get the broadcast flag. When enabled, datagram sockets are allowed "
7820 "to send packets to a broadcast address. This option has no effect on stream-"
7823 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
7824 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
7825 "ストリーム指向のソケットには何の効果もない。"
7828 #: build/C/man7/socket.7:249
7830 msgid "B<SO_BSDCOMPAT>"
7831 msgstr "B<SO_BSDCOMPAT>"
7834 #: build/C/man7/socket.7:261
7836 "Enable BSD bug-to-bug compatibility. This is used by the UDP protocol "
7837 "module in Linux 2.0 and 2.2. If enabled ICMP errors received for a UDP "
7838 "socket will not be passed to the user program. In later kernel versions, "
7839 "support for this option has been phased out: Linux 2.4 silently ignores it, "
7840 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
7841 "option. Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
7842 "header changing, skipping of the broadcast flag) for raw sockets with this "
7843 "option, but that was removed in Linux 2.2."
7845 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
7846 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
7847 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
7848 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
7849 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
7850 "がこのオプションを使用すると (printk() を使って) カーネルの警告メッセージが"
7851 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
7852 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ) に対"
7853 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
7856 #: build/C/man7/socket.7:261
7859 msgstr "B<SO_DEBUG>"
7862 #: build/C/man7/socket.7:267
7864 "Enable socket debugging. Only allowed for processes with the "
7865 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
7867 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
7868 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
7871 #: build/C/man7/socket.7:267
7873 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
7874 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
7877 #: build/C/man7/socket.7:275
7879 "Retrieves the socket domain as an integer, returning a value such as "
7880 "B<AF_INET6>. See B<socket>(2) for details. This socket option is read-"
7883 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
7884 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
7887 #: build/C/man7/socket.7:275
7890 msgstr "B<SO_ERROR>"
7893 #: build/C/man7/socket.7:280
7895 "Get and clear the pending socket error. This socket option is read-only. "
7896 "Expects an integer."
7898 "保留になっていたソケットエラーを取得してクリアする。\n"
7899 "このソケットオプションは読み込み専用である。整数値をとる。"
7902 #: build/C/man7/socket.7:280
7904 msgid "B<SO_DONTROUTE>"
7905 msgstr "B<SO_DONTROUTE>"
7908 #: build/C/man7/socket.7:289
7910 "Don't send via a gateway, only send to directly connected hosts. The same "
7911 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
7912 "B<send>(2) operation. Expects an integer boolean flag."
7914 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2) 操作"
7915 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
7919 #: build/C/man7/socket.7:289
7921 msgid "B<SO_KEEPALIVE>"
7922 msgstr "B<SO_KEEPALIVE>"
7925 #: build/C/man7/socket.7:293
7927 "Enable sending of keep-alive messages on connection-oriented sockets. "
7928 "Expects an integer boolean flag."
7930 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
7934 #: build/C/man7/socket.7:293
7936 msgid "B<SO_LINGER>"
7937 msgstr "B<SO_LINGER>"
7940 #: build/C/man7/socket.7:301
7942 "Sets or gets the B<SO_LINGER> option. The argument is a I<linger> structure."
7944 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
7947 #: build/C/man7/socket.7:308
7951 " int l_onoff; /* linger active */\n"
7952 " int l_linger; /* how many seconds to linger for */\n"
7956 " int l_onoff; /* linger active */\n"
7957 " int l_linger; /* how many seconds to linger for */\n"
7961 #: build/C/man7/socket.7:322
7963 "When enabled, a B<close>(2) or B<shutdown>(2) will not return until all "
7964 "queued messages for the socket have been successfully sent or the linger "
7965 "timeout has been reached. Otherwise, the call returns immediately and the "
7966 "closing is done in the background. When the socket is closed as part of "
7967 "B<exit>(2), it always lingers in the background."
7969 "有効になっていると、 B<close>(2) や B<shutdown>(2) は、そのソケットにキュー"
7970 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
7971 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
7972 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2) の一部と"
7973 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
7977 #: build/C/man7/socket.7:322
7979 msgid "B<SO_OOBINLINE>"
7980 msgstr "B<SO_OOBINLINE>"
7982 #. don't document it because it can do too much harm.
7985 #: build/C/man7/socket.7:331
7987 "If this option is enabled, out-of-band data is directly placed into the "
7988 "receive data stream. Otherwise out-of-band data is only passed when the "
7989 "B<MSG_OOB> flag is set during receiving."
7991 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
7992 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
7993 "ラグがセットされている場合に限って渡される。"
7996 #: build/C/man7/socket.7:331
7998 msgid "B<SO_PASSCRED>"
7999 msgstr "B<SO_PASSCRED>"
8001 #. FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8002 #. in the 2.6.18 ChangeLog
8004 #: build/C/man7/socket.7:340
8006 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message. "
8007 "For more information see B<unix>(7)."
8009 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7) "
8013 #: build/C/man7/socket.7:340
8015 msgid "B<SO_PEERCRED>"
8016 msgstr "B<SO_PEERCRED>"
8019 #: build/C/man7/socket.7:360
8021 "Return the credentials of the foreign process connected to this socket. "
8022 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
8023 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
8024 "(7). The returned credentials are those that were in effect at the time of "
8025 "the call to B<connect>(2) or B<socketpair>(2). Argument is a I<ucred> "
8026 "structure. This socket option is read-only."
8028 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。\n"
8029 "このソケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソ"
8031 "および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケット"
8033 "データグラムソケットのペアだけである。\n"
8034 "B<unix>(7) を参照のこと。\n"
8035 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
8037 "引き数は I<ucred> 構造体である。\n"
8038 "このソケットオプションは読み込み専用である。"
8041 #: build/C/man7/socket.7:360
8043 msgid "B<SO_PRIORITY>"
8044 msgstr "B<SO_PRIORITY>"
8047 #: build/C/man7/socket.7:373
8049 "Set the protocol-defined priority for all packets to be sent on this "
8050 "socket. Linux uses this value to order the networking queues: packets with "
8051 "a higher priority may be processed first depending on the selected device "
8052 "queueing discipline. For B<ip>(7), this also sets the IP type-of-service "
8053 "(TOS) field for outgoing packets. Setting a priority outside the range 0 to "
8054 "6 requires the B<CAP_NET_ADMIN> capability."
8056 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
8057 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
8058 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
8059 "方に依存する。 B<ip>(7) では、外向けパケットの IP type-of-service (TOS) "
8060 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
8061 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
8064 #: build/C/man7/socket.7:373
8066 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
8067 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
8070 #: build/C/man7/socket.7:381
8072 "Retrieves the socket protocol as an integer, returning a value such as "
8073 "B<IPPROTO_SCTP>. See B<socket>(2) for details. This socket option is read-"
8076 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
8078 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8081 #: build/C/man7/socket.7:381
8083 msgid "B<SO_RCVBUF>"
8084 msgstr "B<SO_RCVBUF>"
8086 #. Most (all?) other implementations do not do this -- MTK, Dec 05
8088 #: build/C/man7/socket.7:396
8090 "Sets or gets the maximum socket receive buffer in bytes. The kernel doubles "
8091 "this value (to allow space for bookkeeping overhead) when it is set using "
8092 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2). "
8093 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
8094 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
8095 "file. The minimum (doubled) value for this option is 256."
8097 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
8098 "B<setsockopt>(2) を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8099 "保するために) カーネルはこの値を 2倍し、 B<getsockopt>(2) はこの 2倍された"
8100 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
8101 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
8102 "る。 このオプションの最小値は (2倍した値で) 256 である。"
8105 #: build/C/man7/socket.7:396
8107 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
8108 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
8111 #: build/C/man7/socket.7:405
8113 "Using this socket option, a privileged (B<CAP_NET_ADMIN>) process can "
8114 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
8117 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8118 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
8122 #: build/C/man7/socket.7:405
8124 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
8125 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
8127 #. See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
8128 #. Tested on kernel 2.6.14 -- mtk, 30 Nov 05
8130 #: build/C/man7/socket.7:434
8132 "Specify the minimum number of bytes in the buffer until the socket layer "
8133 "will pass the data to the protocol (B<SO_SNDLOWAT>) or the user on "
8134 "receiving (B<SO_RCVLOWAT>). These two values are initialized to 1. "
8135 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2) fails with the "
8136 "error B<ENOPROTOOPT>). B<SO_RCVLOWAT> is changeable only since Linux 2.4. "
8137 "The B<select>(2) and B<poll>(2) system calls currently do not respect the "
8138 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
8139 "single byte of data is available. A subsequent read from the socket will "
8140 "block until B<SO_RCVLOWAT> bytes are available."
8142 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
8143 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
8144 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
8145 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2) は "
8146 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
8147 "可能である。 現状、Linux ではシステムコール B<select>(2) と B<poll>(2) は "
8148 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
8149 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
8150 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
8154 #: build/C/man7/socket.7:434
8156 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
8157 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
8159 #. Not implemented in 2.0.
8160 #. Implemented in 2.1.11 for getsockopt: always return a zero struct.
8161 #. Implemented in 2.3.41 for setsockopt, and actually used.
8162 #. in fact to EAGAIN
8164 #: build/C/man7/socket.7:465
8167 #| "Specify the receiving or sending timeouts until reporting an error. The "
8168 #| "argument is a I<struct timeval>. If an input or output function blocks "
8169 #| "for this period of time, and data has been sent or received, the return "
8170 #| "value of that function will be the amount of data transferred; if no data "
8171 #| "has been transferred and the timeout has been reached then -1 is returned "
8172 #| "with I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket "
8173 #| "was specified to be nonblocking. If the timeout is set to zero (the "
8174 #| "default) then the operation will never timeout. Timeouts only have "
8175 #| "effect for system calls that perform socket I/O (e.g., B<read>(2), "
8176 #| "B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have no effect for "
8177 #| "B<select>(2), B<poll>(2), B<epoll_wait>(2), etc."
8179 "Specify the receiving or sending timeouts until reporting an error. The "
8180 "argument is a I<struct timeval>. If an input or output function blocks for "
8181 "this period of time, and data has been sent or received, the return value of "
8182 "that function will be the amount of data transferred; if no data has been "
8183 "transferred and the timeout has been reached then -1 is returned with "
8184 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket was "
8185 "specified to be nonblocking. If the timeout is set to zero (the default) "
8186 "then the operation will never timeout. Timeouts only have effect for system "
8187 "calls that perform socket I/O (e.g., B<read>(2), B<recvmsg>(2), B<send>(2), "
8188 "B<sendmsg>(2)); timeouts have no effect for B<select>(2), B<poll>(2), "
8189 "B<epoll_wait>(2), and so on."
8191 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
8192 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
8193 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
8194 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
8195 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> を設定され、 あたかもソケットに"
8196 "非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値であ"
8197 "る) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響"
8198 "を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), "
8199 "B<recvmsg>(2), B<send>(2), B<sendmsg>(2)) である。 B<select>(2), B<poll>"
8200 "(2), B<epoll_wait>(2) などにはタイムアウトは影響を及ぼさない。"
8203 #: build/C/man7/socket.7:465
8205 msgid "B<SO_REUSEADDR>"
8206 msgstr "B<SO_REUSEADDR>"
8209 #: build/C/man7/socket.7:480
8211 "Indicates that the rules used in validating addresses supplied in a B<bind>"
8212 "(2) call should allow reuse of local addresses. For B<AF_INET> sockets "
8213 "this means that a socket may bind, except when there is an active listening "
8214 "socket bound to the address. When the listening socket is bound to "
8215 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
8216 "port for any local address. Argument is an integer boolean flag."
8218 "B<bind>(2) コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
8219 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
8220 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
8221 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
8222 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
8223 "ドできない。 引き数はブール整数のフラグである。"
8226 #: build/C/man7/socket.7:480
8228 msgid "B<SO_SNDBUF>"
8229 msgstr "B<SO_SNDBUF>"
8231 #. Most (all?) other implementations do not do this -- MTK, Dec 05
8233 #: build/C/man7/socket.7:495
8235 "Sets or gets the maximum socket send buffer in bytes. The kernel doubles "
8236 "this value (to allow space for bookkeeping overhead) when it is set using "
8237 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2). "
8238 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
8239 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
8240 "file. The minimum (doubled) value for this option is 2048."
8242 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
8243 "B<setsockopt>(2) を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8244 "保するために) カーネルはこの値を 2倍し、 B<getsockopt>(2) はこの 2倍された"
8245 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
8246 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
8247 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
8250 #: build/C/man7/socket.7:495
8252 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
8253 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
8256 #: build/C/man7/socket.7:504
8258 "Using this socket option, a privileged (B<CAP_NET_ADMIN>) process can "
8259 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
8262 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8263 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
8267 #: build/C/man7/socket.7:504
8269 msgid "B<SO_TIMESTAMP>"
8270 msgstr "B<SO_TIMESTAMP>"
8273 #: build/C/man7/socket.7:520
8275 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message. The "
8276 "timestamp control message is sent with level B<SOL_SOCKET> and the "
8277 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
8278 "the last packet passed to the user in this call. See B<cmsg>(3) for "
8279 "details on control messages."
8281 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
8282 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
8283 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
8284 "timeval> である。 制御メッセージの詳細については B<cmsg>(3) を参照。"
8287 #: build/C/man7/socket.7:520
8293 #: build/C/man7/socket.7:525
8295 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>). This socket "
8296 "option is read-only."
8298 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
8299 "このソケットオプションは読み出し専用である。"
8302 #: build/C/man7/socket.7:525
8308 #: build/C/man7/socket.7:536
8310 "When writing onto a connection-oriented socket that has been shut down (by "
8311 "the local or the remote end) B<SIGPIPE> is sent to the writing process and "
8312 "B<EPIPE> is returned. The signal is not sent when the write call specified "
8313 "the B<MSG_NOSIGNAL> flag."
8315 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
8316 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
8317 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
8318 "していた場合はシグナルは送られない。"
8321 #: build/C/man7/socket.7:561
8323 "When requested with the B<FIOSETOWN> B<fcntl>(2) or B<SIOCSPGRP> B<ioctl>"
8324 "(2), B<SIGIO> is sent when an I/O event occurs. It is possible to use "
8325 "B<poll>(2) or B<select>(2) in the signal handler to find out which socket "
8326 "the event occurred on. An alternative (in Linux 2.2) is to set a real-time "
8327 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
8328 "signal will be called with the file descriptor in the I<si_fd> field of its "
8329 "I<siginfo_t>. See B<fcntl>(2) for more information."
8331 "B<FIOSETOWN> B<fcntl>(2) や B<SIOCSPGRP> B<ioctl>(2) をプロセスまたはプロセ"
8332 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
8333 "る。 B<poll>(2) や B<select>(2) をシグナルハンドラ内で用いれば、どのソケッ"
8334 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
8335 "しては、 B<F_SETSIG> B<fcntl>(2) を用いてリアルタイムシグナルを設定するやり"
8336 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
8337 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2) "
8340 #. .SS Ancillary Messages
8342 #: build/C/man7/socket.7:569
8344 "Under some circumstances (e.g., multiple processes accessing a single "
8345 "socket), the condition that caused the B<SIGIO> may have already disappeared "
8346 "when the process reacts to the signal. If this happens, the process should "
8347 "wait again because Linux will resend the signal later."
8349 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
8350 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
8351 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
8352 "すべきである。 Linux は同じシグナルを後で再送するからである。"
8355 #: build/C/man7/socket.7:569
8357 msgid "/proc interfaces"
8358 msgstr "/proc インタフェース"
8361 #: build/C/man7/socket.7:573
8363 "The core socket networking parameters can be accessed via files in the "
8364 "directory I</proc/sys/net/core/>."
8366 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
8367 "レクトリ内のファイルを通してアクセスできる。"
8370 #: build/C/man7/socket.7:573
8372 msgid "I<rmem_default>"
8373 msgstr "I<rmem_default>"
8376 #: build/C/man7/socket.7:576
8377 msgid "contains the default setting in bytes of the socket receive buffer."
8378 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
8381 #: build/C/man7/socket.7:576
8384 msgstr "I<rmem_max>"
8387 #: build/C/man7/socket.7:582
8389 "contains the maximum socket receive buffer size in bytes which a user may "
8390 "set by using the B<SO_RCVBUF> socket option."
8392 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
8393 "ファサイズの最大値 (バイト単位)。"
8396 #: build/C/man7/socket.7:582
8398 msgid "I<wmem_default>"
8399 msgstr "I<wmem_default>"
8402 #: build/C/man7/socket.7:585
8403 msgid "contains the default setting in bytes of the socket send buffer."
8404 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
8407 #: build/C/man7/socket.7:585
8410 msgstr "I<wmem_max>"
8413 #: build/C/man7/socket.7:591
8415 "contains the maximum socket send buffer size in bytes which a user may set "
8416 "by using the B<SO_SNDBUF> socket option."
8418 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
8419 "ファサイズの最大値 (バイト単位)。"
8422 #: build/C/man7/socket.7:591
8424 msgid "I<message_cost> and I<message_burst>"
8425 msgstr "I<message_cost> と I<message_burst>"
8428 #: build/C/man7/socket.7:595
8430 "configure the token bucket filter used to load limit warning messages caused "
8431 "by external network events."
8433 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
8434 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
8437 #: build/C/man7/socket.7:595
8439 msgid "I<netdev_max_backlog>"
8440 msgstr "I<netdev_max_backlog>"
8443 #: build/C/man7/socket.7:598
8444 msgid "Maximum number of packets in the global input queue."
8445 msgstr "グローバルな入力キューにおける最大のパケット数。"
8448 #: build/C/man7/socket.7:598
8450 msgid "I<optmem_max>"
8451 msgstr "I<optmem_max>"
8453 #. netdev_fastroute is not documented because it is experimental
8455 #: build/C/man7/socket.7:603
8457 "Maximum length of ancillary data and user control data like the iovecs per "
8460 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
8464 #: build/C/man7/socket.7:603
8470 #: build/C/man7/socket.7:606
8471 msgid "These operations can be accessed using B<ioctl>(2):"
8472 msgstr "以下に示す操作には B<ioctl>(2) を用いてアクセスできる。"
8475 #: build/C/man7/socket.7:610
8477 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8478 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8481 #: build/C/man7/socket.7:612
8483 msgid "B<SIOCGSTAMP>"
8484 msgstr "B<SIOCGSTAMP>"
8487 #: build/C/man7/socket.7:636
8489 "Return a I<struct timeval> with the receive timestamp of the last packet "
8490 "passed to the user. This is useful for accurate round trip time "
8491 "measurements. See B<setitimer>(2) for a description of I<struct timeval>. "
8492 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
8493 "set on the socket. Otherwise, it returns the timestamp of the last packet "
8494 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
8495 "packet has been received, (i.e., B<ioctl>(2) returns -1 with I<errno> set "
8498 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
8499 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
8500 "timeval> の説明は B<setitimer>(2) を見てほしい。 この ioctl は、ソケットオプ"
8501 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
8502 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
8503 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
8504 "には失敗する (つまり、 B<ioctl>(2) は -1 を返し、 I<errno> に B<ENOENT> を"
8508 #: build/C/man7/socket.7:636
8510 msgid "B<SIOCSPGRP>"
8511 msgstr "B<SIOCSPGRP>"
8514 #: build/C/man7/socket.7:655
8516 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
8517 "when an asynchronous I/O operation has finished or urgent data is "
8518 "available. The argument is a pointer to a I<pid_t>. If the argument is "
8519 "positive, send the signals to that process. If the argument is negative, "
8520 "send the signals to the process group with the ID of the absolute value of "
8521 "the argument. The process may only choose itself or its own process group "
8522 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
8525 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
8526 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
8527 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
8528 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
8529 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
8530 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
8534 #: build/C/man7/socket.7:655
8537 msgstr "B<FIOASYNC>"
8540 #: build/C/man7/socket.7:665
8542 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
8543 "socket. Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
8544 "set with B<F_SETSIG> is raised when a new I/O event occurs."
8546 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
8547 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
8548 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
8551 #: build/C/man7/socket.7:673
8553 "Argument is an integer boolean flag. (This operation is synonymous with the "
8554 "use of B<fcntl>(2) to set the B<O_ASYNC> flag.)"
8556 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2) を使って "
8557 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
8560 #: build/C/man7/socket.7:673
8562 msgid "B<SIOCGPGRP>"
8563 msgstr "B<SIOCGPGRP>"
8566 #: build/C/man7/socket.7:682
8568 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
8569 "signals, or 0 when none is set."
8571 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
8575 #: build/C/man7/socket.7:686
8576 msgid "Valid B<fcntl>(2) operations:"
8577 msgstr "有効な B<fcntl>(2) 操作:"
8580 #: build/C/man7/socket.7:686
8582 msgid "B<FIOGETOWN>"
8583 msgstr "B<FIOGETOWN>"
8586 #: build/C/man7/socket.7:691
8587 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
8588 msgstr "B<SIOCGPGRP> B<ioctl>(2) と同じ。"
8591 #: build/C/man7/socket.7:691
8593 msgid "B<FIOSETOWN>"
8594 msgstr "B<FIOSETOWN>"
8597 #: build/C/man7/socket.7:696
8598 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
8599 msgstr "B<SIOCSPGRP> B<ioctl>(2) と同じ。"
8602 #: build/C/man7/socket.7:710
8604 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30. B<SO_PASSCRED> is new in "
8605 "Linux 2.2. The I</proc> interfaces was introduced in Linux 2.2. "
8606 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41. "
8607 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
8608 "be read or written."
8610 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
8611 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
8612 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
8613 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
8617 #: build/C/man7/socket.7:715
8619 "Linux assumes that half of the send/receive buffer is used for internal "
8620 "kernel structures; thus the values in the corresponding I</proc> files are "
8621 "twice what can be observed on the wire."
8623 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
8624 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
8628 #: build/C/man7/socket.7:728
8630 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
8631 "option was set both in the previous program that performed a B<bind>(2) to "
8632 "the port and in the program that wants to reuse the port. This differs from "
8633 "some implementations (e.g., FreeBSD) where only the later program needs to "
8634 "set the B<SO_REUSEADDR> option. Typically this difference is invisible, "
8635 "since, for example, a server program is designed to always set this option."
8637 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
8638 "のポートに対して B<bind>(2) を前に実行したプログラムとそのポートを再利用 し"
8639 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
8640 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
8641 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
8642 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
8643 "このオプションをセットするように設計されるからである。"
8645 #. FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
8647 #. This man page was written by Andi Kleen.
8649 #: build/C/man7/socket.7:741
8651 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
8652 "B<SO_DETACH_FILTER> are not documented. The suggested interface to use them "
8653 "is via the libpcap library."
8655 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
8656 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
8660 #: build/C/man7/socket.7:752
8662 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8663 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8665 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8666 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8669 #: build/C/man2/socketcall.2:26
8675 #: build/C/man2/socketcall.2:26
8681 #: build/C/man2/socketcall.2:29
8682 msgid "socketcall - socket system calls"
8683 msgstr "socketcall - ソケット・システムコール"
8686 #: build/C/man2/socketcall.2:31
8687 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8688 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8691 #: build/C/man2/socketcall.2:39
8693 "B<socketcall>() is a common kernel entry point for the socket system "
8694 "calls. I<call> determines which socket function to invoke. I<args> points "
8695 "to a block containing the actual arguments, which are passed through to the "
8698 "B<socketcall>() はソケット・システムコールのための共通のカーネル・エント"
8699 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
8700 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
8704 #: build/C/man2/socketcall.2:43
8706 "User programs should call the appropriate functions by their usual names. "
8707 "Only standard library implementors and kernel hackers need to know about "
8710 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
8711 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>() について知る"
8715 #: build/C/man2/socketcall.2:46
8717 "This call is specific to Linux, and should not be used in programs intended "
8720 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
8724 #: build/C/man2/socketcall.2:54
8726 "On a few architectures, for example ia64, there is no B<socketcall>() "
8727 "system call; instead B<socket>(2), B<accept>(2), B<bind>(2), and so on "
8728 "really are implemented as separate system calls."
8730 "ia64 などのいくつかのアーキテクチャでは、システムコール B<socketcall>() が存"
8731 "在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2) など"
8732 "が独立したシステムコールとして実装されている。"
8735 #: build/C/man2/socketcall.2:72
8737 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8738 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8739 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8740 "(2), B<socket>(2), B<socketpair>(2)"
8742 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8743 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8744 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8745 "(2), B<socket>(2), B<socketpair>(2)"
8748 #: build/C/man2/socketpair.2:40
8754 #: build/C/man2/socketpair.2:40
8760 #: build/C/man2/socketpair.2:43
8761 msgid "socketpair - create a pair of connected sockets"
8762 msgstr "socketpair - 接続されたソケットのペアを作成する"
8765 #: build/C/man2/socketpair.2:50
8767 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8770 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8774 #: build/C/man2/socketpair.2:61
8776 "The B<socketpair>() call creates an unnamed pair of connected sockets in "
8777 "the specified I<domain>, of the specified I<type>, and using the optionally "
8778 "specified I<protocol>. For further details of these arguments, see B<socket>"
8781 "B<socketpair>() は、指定されたドメイン I<domain> に指定された種類 I<type> で"
8782 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
8783 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2) を参照のこと。"
8786 #: build/C/man2/socketpair.2:67
8788 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
8789 "and I<sv>[1]. The two sockets are indistinguishable."
8791 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
8792 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
8795 #: build/C/man2/socketpair.2:76
8796 msgid "The specified address family is not supported on this machine."
8797 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
8800 #: build/C/man2/socketpair.2:81
8802 "The address I<sv> does not specify a valid part of the process address space."
8803 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
8806 #: build/C/man2/socketpair.2:84
8807 msgid "Too many descriptors are in use by this process."
8808 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
8811 #: build/C/man2/socketpair.2:90
8812 msgid "The specified protocol does not support creation of socket pairs."
8813 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
8816 #: build/C/man2/socketpair.2:93
8817 msgid "The specified protocol is not supported on this machine."
8818 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
8821 #: build/C/man2/socketpair.2:101
8823 "4.4BSD, POSIX.1-2001. The B<socketpair>() function call appeared in "
8824 "4.2BSD. It is generally portable to/from non-BSD systems supporting clones "
8825 "of the BSD socket layer (including System V variants)."
8827 "4.4BSD, POSIX.1-2001. B<socketpair>() 関数コールは 4.2BSD で現われた。一般"
8828 "に (System V の変種を含めて) BSD のソケット層のクローンをサポートしている、"
8829 "BSD 以外のシステムと、 互いに移植性がある。"
8832 #: build/C/man2/socketpair.2:107
8834 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
8835 "synonymously, B<AF_LOCAL>). (Most implementations have the same "
8838 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
8839 "ある B<AF_LOCAL>) だけである。 (ほとんどの実装で同じ制限がある)"
8842 #: build/C/man2/socketpair.2:116
8844 "Since Linux 2.6.27, B<socketpair>() supports the B<SOCK_NONBLOCK> and "
8845 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
8847 "Linux 2.6.27 以降では、 B<socketpair>() は、フラグ B<SOCK_NONBLOCK> と "
8848 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2) を参照のこと。"
8851 #: build/C/man2/socketpair.2:129
8853 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8855 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8857 #~ msgid "2011-10-04"
8858 #~ msgstr "2011-10-04"
8860 #~ msgid "2010-08-31"
8861 #~ msgstr "2010-08-31"
8863 #~ msgid "2010-06-13"
8864 #~ msgstr "2010-06-13"
8866 #~ msgid "RETURN VALUES"
8867 #~ msgstr "RETURN VALUES"
8869 #~ msgid "2011-10-01"
8870 #~ msgstr "2011-10-01"