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: 2015-02-04 23:31+0900\n"
10 "PO-Revision-Date: 2015-02-04 23:50+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:41
25 #: build/C/man2/accept.2:41
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:58 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:59
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
74 #: build/C/man2/accept.2:44
75 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:61
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
97 "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
100 "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
104 #: build/C/man2/accept.2:50
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
110 #: build/C/man2/accept.2:53
113 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
116 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
120 #: build/C/man2/accept.2:56
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"
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B< socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:65
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
145 #: build/C/man2/accept.2:72
147 "The B<accept>() system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>). It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket. The newly created socket is not in the listening "
152 "state. The original socket I<sockfd> is unaffected by this call."
154 "B<accept>() システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>) で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイルディスクリプ"
158 "ターを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 も"
159 "ともとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
162 #: build/C/man2/accept.2:81
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
168 "引き数 I<sockfd> は、 B<socket>(2) によって生成され、 B<bind>(2) によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2) を経て接続を待っているソケット"
173 #: build/C/man2/accept.2:99
175 "The argument I<addr> is a pointer to a I<sockaddr> structure. This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer. The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2) and the "
179 "respective protocol man pages). When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインターである。 この構造体には接続"
183 "相手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確"
184 "なフォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2) および"
185 "それぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> "
186 "には何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にし"
190 #: build/C/man2/accept.2:107
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
207 "渡されたバッファーが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
213 #: build/C/man2/accept.2:125
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>() blocks the caller until a connection is "
217 "present. If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>() fails with the error B<EAGAIN> or "
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>() は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>() はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
227 #: build/C/man2/accept.2:139
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2) or B<poll>(2). A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>() to get a socket "
232 "for that connection. Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7) for details."
235 "ソケットへの接続到着を知るには、 B<select>(2) または B<poll>(2) を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>() を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7) を参照のこと。"
242 #: build/C/man2/accept.2:152
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>() can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation. Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket. Currently only DECNet has these "
249 "semantics on Linux."
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>() は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイルディスクリプターに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection) は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
259 #: build/C/man2/accept.2:162
261 "If I<flags> is 0, then B<accept4>() is the same as B<accept>(). The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
265 "I<flags> が 0 の場合、 B<accept4>() は B<accept>() と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2:165
272 msgid "B<SOCK_NONBLOCK>"
273 msgstr "B<SOCK_NONBLOCK>"
276 #: build/C/man2/accept.2:170 build/C/man2/socket.2:173
278 "Set the B<O_NONBLOCK> file status flag on the new open file description. "
279 "Using this flag saves extra calls to B<fcntl>(2) to achieve the same result."
281 "新しく生成されるオープンファイル記述 (open file description) の "
282 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
283 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2) を追加で呼び出す必要がなく"
287 #: build/C/man2/accept.2:170 build/C/man2/socket.2:173
289 msgid "B<SOCK_CLOEXEC>"
290 msgstr "B<SOCK_CLOEXEC>"
293 #: build/C/man2/accept.2:180 build/C/man2/socket.2:183
295 "Set the close-on-exec (B<FD_CLOEXEC>) flag on the new file descriptor. See "
296 "the description of the B<O_CLOEXEC> flag in B<open>(2) for reasons why this "
299 "新しいファイルディスクリプターに対して close-on-exec (B<FD_CLOEXEC>) フラグ"
300 "をセットする。 このフラグが役に立つ理由については、 B<open>(2) の "
301 "B<O_CLOEXEC> フラグの説明を参照のこと。"
304 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
305 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
306 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
307 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
308 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
309 #: build/C/man2/recv.2:408 build/C/man2/recvmmsg.2:148
310 #: build/C/man2/select.2:300 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:294 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:315
313 #: build/C/man2/socketpair.2:69
319 #: build/C/man2/accept.2:187
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket. On error, -1 is returned, and I<errno> "
323 "is set appropriately."
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプターで"
326 "ある非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に"
330 #: build/C/man2/accept.2:187
332 msgid "Error handling"
336 #: build/C/man2/accept.2:214
338 "Linux B<accept>() (and B<accept4>()) passes already-pending network errors "
339 "on the new socket as an error code from B<accept>(). This behavior differs "
340 "from other BSD socket implementations. For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>() and treat them like B<EAGAIN> by retrying. In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
346 "Linux の B<accept>() (と B<accept4>()) は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>() からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>() の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:424 build/C/man2/recvmmsg.2:156
362 #: build/C/man2/select.2:318 build/C/man2/send.2:299
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:320 build/C/man2/socketpair.2:74
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:429 build/C/man2/send.2:315
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
375 #. Actually EAGAIN on Linux
377 #: build/C/man2/accept.2:223
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted. POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:176
391 #: build/C/man2/connect.2:176 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:104
393 #: build/C/man2/recv.2:438 build/C/man2/select.2:319 build/C/man2/send.2:336
394 #: build/C/man3/sockatmark.3:59
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプターが不正。"
405 #: build/C/man2/accept.2:226
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:208
417 #: build/C/man2/connect.2:182 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:447
419 #: build/C/man2/send.2:345 build/C/man2/socketpair.2:78
425 #: build/C/man2/accept.2:234
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザーアドレス空間の書き込み可能領域にない。"
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:210
432 #: build/C/man2/recv.2:451 build/C/man2/select.2:324 build/C/man2/send.2:348
438 #: build/C/man2/accept.2:239
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7) 参照。"
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:180
448 #: build/C/man2/bind.2:185 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:456
450 #: build/C/man2/recvmmsg.2:160 build/C/man2/select.2:328
451 #: build/C/man2/select.2:335 build/C/man2/send.2:352
452 #: build/C/man3/sockatmark.3:63 build/C/man2/socket.2:328
453 #: build/C/man2/socket.2:331
459 #: build/C/man2/accept.2:244
461 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
464 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
468 #: build/C/man2/accept.2:249
469 msgid "(B<accept4>()) invalid value in I<flags>."
470 msgstr "(B<accept4>()) I<flags> に不正な値が指定されている。"
473 #: build/C/man2/accept.2:249 build/C/man2/socket.2:336
474 #: build/C/man2/socketpair.2:83
480 #: build/C/man2/accept.2:252
481 msgid "The per-process limit of open file descriptors has been reached."
482 msgstr "1プロセスがオープンできるファイルディスクリプター数の上限に達した。"
485 #: build/C/man2/accept.2:252 build/C/man2/socket.2:339
486 #: build/C/man2/socketpair.2:86
492 #: build/C/man2/accept.2:255 build/C/man2/socket.2:342
493 #: build/C/man2/socketpair.2:89
494 msgid "The system limit on the total number of open files has been reached."
495 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
498 #: build/C/man2/accept.2:255
500 msgid "B<ENOBUFS>, B<ENOMEM>"
501 msgstr "B<ENOBUFS>, B<ENOMEM>"
504 #: build/C/man2/accept.2:260
506 "Not enough free memory. This often means that the memory allocation is "
507 "limited by the socket buffer limits, not by the system memory."
509 "メモリーが足りない。 多くの場合は、システムメモリーが足りないわけではなく、 "
510 "ソケットバッファーの大きさによるメモリー割り当ての制限である。"
513 #: build/C/man2/accept.2:260 build/C/man2/bind.2:191
514 #: build/C/man2/connect.2:222 build/C/man2/getsockname.2:92
515 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:109
516 #: build/C/man2/recv.2:471 build/C/man2/send.2:381
522 #: build/C/man2/accept.2:263
523 msgid "The descriptor references a file, not a socket."
524 msgstr "ディスクリプターはソケットではなくファイルを参照している。"
527 #: build/C/man2/accept.2:263 build/C/man2/listen.2:114 build/C/man2/send.2:386
528 #: build/C/man2/socketpair.2:89
530 msgid "B<EOPNOTSUPP>"
531 msgstr "B<EOPNOTSUPP>"
534 #: build/C/man2/accept.2:267
535 msgid "The referenced socket is not of type B<SOCK_STREAM>."
536 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
539 #: build/C/man2/accept.2:267
545 #: build/C/man2/accept.2:270
546 msgid "Protocol error."
550 #: build/C/man2/accept.2:274
551 msgid "In addition, Linux B<accept>() may fail if:"
552 msgstr "上記に加えて、Linux の B<accept>() は以下のエラーで失敗する:"
555 #: build/C/man2/accept.2:274
561 #: build/C/man2/accept.2:277
562 msgid "Firewall rules forbid connection."
563 msgstr "ファイアウォールのルールにより接続が禁止された。"
566 #: build/C/man2/accept.2:289
568 "In addition, network errors for the new socket and as defined for the "
569 "protocol may be returned. Various Linux kernels can return other errors "
570 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>. The "
571 "value B<ERESTARTSYS> may be seen during a trace."
573 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
574 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
575 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
576 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>. B<ERESTARTSYS> がトレースの最中に現れるこ"
580 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
581 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:164
582 #: build/C/man2/select.2:343 build/C/man2/sendmmsg.2:145
583 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:915
589 #: build/C/man2/accept.2:294
591 "The B<accept4>() system call is available starting with Linux 2.6.28; "
592 "support in glibc is available starting with version 2.10."
594 "B<accept4>() システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
595 "サポートはバージョン 2.10 以降で利用可能である。"
598 #: build/C/man2/accept.2:294 build/C/man2/bind.2:232
599 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:237
600 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
601 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
602 #: build/C/man3/if_nametoindex.3:92 build/C/man2/listen.2:119
603 #: build/C/man2/recv.2:476 build/C/man2/recvmmsg.2:169
604 #: build/C/man2/select.2:349 build/C/man2/send.2:400
605 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
606 #: build/C/man2/socket.2:353 build/C/man2/socketcall.2:42
607 #: build/C/man2/socketpair.2:95
609 msgid "CONFORMING TO"
612 #. The BSD man page documents five possible error returns
613 #. (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
614 #. POSIX.1-2001 documents errors
615 #. EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
616 #. ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
617 #. In addition, SUSv2 documents EFAULT and ENOSR.
619 #: build/C/man2/accept.2:306
621 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>() first appeared in "
624 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>() は 4.2BSD で初めて実装"
628 #: build/C/man2/accept.2:309
629 msgid "B<accept4>() is a nonstandard Linux extension."
630 msgstr "B<accept4>() は非標準の Linux による拡張である。"
632 #. Some testing seems to show that Tru64 5.1 and HP-UX 11 also
633 #. do not inherit file status flags -- MTK Jun 05
635 #: build/C/man2/accept.2:324
637 "On Linux, the new socket returned by B<accept>() does I<not> inherit file "
638 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
639 "socket. This behavior differs from the canonical BSD sockets "
640 "implementation. Portable programs should not rely on inheritance or "
641 "noninheritance of file status flags and always explicitly set all required "
642 "flags on the socket returned from B<accept>()."
644 "Linux では、 B<accept>() が返す新しいソケットは listen を行っているソケット"
645 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
646 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
647 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に "
648 "B<accept>() が返したソケットに対して全ての必要なフラグを明示的に設定するよう"
652 #: build/C/man2/accept.2:324 build/C/man2/bind.2:244
653 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:253
654 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
655 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:124
656 #: build/C/man2/recv.2:486 build/C/man2/select.2:364
657 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:414
658 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
659 #: build/C/man2/socket.2:367 build/C/man7/socket.7:929
660 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
666 #: build/C/man2/accept.2:330 build/C/man2/bind.2:250
667 #: build/C/man2/connect.2:259 build/C/man2/getsockopt.2:184
668 #: build/C/man2/listen.2:150 build/C/man2/socket.2:373
669 #: build/C/man2/socketpair.2:124
671 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
672 "this header file is not required on Linux. However, some historical (BSD) "
673 "implementations required this header file, and portable applications are "
674 "probably wise to include it."
676 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
677 "ず、 Linux ではこのヘッダーファイルは必要ではない。 しかし、歴史的には、いく"
678 "つかの実装 (BSD 系) でこのヘッダーファイルが 必要であり、移植性が必要なアプリ"
679 "ケーションではこのファイルを インクルードするのが賢明であろう。"
682 #: build/C/man2/accept.2:351
684 "There may not always be a connection waiting after a B<SIGIO> is delivered "
685 "or B<select>(2) or B<poll>(2) return a readability event because the "
686 "connection might have been removed by an asynchronous network error or "
687 "another thread before B<accept>() is called. If this happens, then the "
688 "call will block waiting for the next connection to arrive. To ensure that "
689 "B<accept>() never blocks, the passed socket I<sockfd> needs to have the "
690 "B<O_NONBLOCK> flag set (see B<socket>(7))."
692 "B<SIGIO> が届けられた後や、 B<select>(2) または B<poll>(2) が読み込み可能イ"
693 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
694 "続は、 B<accept>() が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
695 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
696 "この場合、その B<accept>() 呼び出しは停止 (block) し、次の接続の到着を待ちつ"
697 "づける。 B<accept>() に停止を行わせないようにするには、引き数に渡すソケット "
698 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7) を"
702 #: build/C/man2/accept.2:351
704 msgid "The socklen_t type"
708 #: build/C/man2/accept.2:361
710 "The third argument of B<accept>() was originally declared as an I<int *> "
711 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
712 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
713 "*>, and that is what it is for SunOS 5. Later POSIX drafts have I<socklen_t "
714 "*>, and so do the Single UNIX Specification and glibc2. Quoting Linus "
717 "B<accept>() の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
718 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
719 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
720 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
721 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
722 "た。 Linus Torvald の発言を引用する:"
724 #. .I fails: only italicizes a single line
726 #: build/C/man2/accept.2:378
728 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int. "
729 "Anything else breaks any BSD socket layer stuff. POSIX initially I<did> "
730 "make it a size_t, and I (and hopefully others, but obviously not too many) "
731 "complained to them very loudly indeed. Making it a size_t is completely "
732 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
733 "bit architectures, for example. And it I<has> to be the same size as \"int"
734 "\" because that's what the BSD socket interface is. Anyway, the POSIX "
735 "people eventually got a clue, and created \"socklen_t\". They shouldn't "
736 "have touched it in the first place, but once they did they felt it had to "
737 "have a named type for some unfathomable reason (probably somebody didn't "
738 "like losing face over having done the original stupid thing, so they "
739 "silently just renamed their blunder).\""
741 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
742 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
743 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
744 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
745 "は完全にいかれてる。 例えば 64 ビットアーキテクチャーでは、 size_t が \"int"
746 "\" と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同"
747 "じでなきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうも"
748 "のなんだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決"
749 "策をなんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 い"
750 "じっちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 "
751 "なんでかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶした"
752 "くなかったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたん"
756 #: build/C/man2/accept.2:378 build/C/man2/bind.2:264
757 #: build/C/man2/connect.2:276 build/C/man3/getifaddrs.3:207
758 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:179
759 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:172
760 #: build/C/man2/select.2:555 build/C/man2/select_tut.2:529
761 #: build/C/man2/send.2:438 build/C/man2/sendmmsg.2:168
762 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:392
768 #: build/C/man2/accept.2:381 build/C/man2/listen.2:182
769 msgid "See B<bind>(2)."
770 msgstr "B<bind>(2) 参照。"
773 #: build/C/man2/accept.2:381 build/C/man2/bind.2:329
774 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:281
775 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
776 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
777 #: build/C/man3/if_nametoindex.3:96 build/C/man2/listen.2:182
778 #: build/C/man2/recv.2:516 build/C/man2/recvmmsg.2:278
779 #: build/C/man2/select.2:592 build/C/man2/select_tut.2:821
780 #: build/C/man2/send.2:443 build/C/man2/sendmmsg.2:236
781 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:397
782 #: build/C/man7/socket.7:960 build/C/man2/socketcall.2:53
783 #: build/C/man2/socketpair.2:124
789 #: build/C/man2/accept.2:388
791 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
798 #: build/C/man2/accept.2:388 build/C/man2/bind.2:342
799 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:288
800 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
801 #: build/C/man2/getsockopt.2:213 build/C/man3/if_nameindex.3:154
802 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:188
803 #: build/C/man2/recv.2:527 build/C/man2/recvmmsg.2:285
804 #: build/C/man2/select.2:607 build/C/man2/select_tut.2:840
805 #: build/C/man2/send.2:458 build/C/man2/sendmmsg.2:241
806 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:426
807 #: build/C/man7/socket.7:972 build/C/man2/socketcall.2:71
808 #: build/C/man2/socketpair.2:131
814 #: build/C/man2/accept.2:396 build/C/man2/bind.2:350
815 #: build/C/man3/bindresvport.3:124 build/C/man2/connect.2:296
816 #: build/C/man3/getifaddrs.3:323 build/C/man2/getsockname.2:129
817 #: build/C/man2/getsockopt.2:221 build/C/man3/if_nameindex.3:162
818 #: build/C/man3/if_nametoindex.3:108 build/C/man2/listen.2:196
819 #: build/C/man2/recv.2:535 build/C/man2/recvmmsg.2:293
820 #: build/C/man2/select.2:615 build/C/man2/select_tut.2:848
821 #: build/C/man2/send.2:466 build/C/man2/sendmmsg.2:249
822 #: build/C/man3/sockatmark.3:152 build/C/man2/socket.2:434
823 #: build/C/man7/socket.7:980 build/C/man2/socketcall.2:79
824 #: build/C/man2/socketpair.2:139
826 "This page is part of release 3.79 of the Linux I<man-pages> project. A "
827 "description of the project, information about reporting bugs, and the latest "
828 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
831 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.79 の一部\n"
832 "である。プロジェクトの説明とバグ報告に関する情報は\n"
833 "http://www.kernel.org/doc/man-pages/ に書かれている。"
836 #: build/C/man2/bind.2:68
842 #: build/C/man2/bind.2:68 build/C/man2/recv.2:41 build/C/man2/send.2:40
848 #: build/C/man2/bind.2:71
849 msgid "bind - bind a name to a socket"
850 msgstr "bind - ソケットに名前をつける"
853 #: build/C/man2/bind.2:78
856 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
857 "B< socklen_t >I<addrlen>B<);>\n"
859 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
860 "B< socklen_t >I<addrlen>B<);>\n"
863 #: build/C/man2/bind.2:92
865 "When a socket is created with B<socket>(2), it exists in a name space "
866 "(address family) but has no address assigned to it. B<bind>() assigns the "
867 "address specified by I<addr> to the socket referred to by the file "
868 "descriptor I<sockfd>. I<addrlen> specifies the size, in bytes, of the "
869 "address structure pointed to by I<addr>. Traditionally, this operation is "
870 "called \\(lqassigning a name to a socket\\(rq."
872 "B<socket>(2) でソケットが作成されたとき、そのソケットは名前空間 (アドレス"
873 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>() は、"
874 "ファイルディスクリプター I<sockfd> で参照されるソケットに I<addr> で指定され"
875 "たアドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズ"
876 "をバイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ば"
880 #: build/C/man2/bind.2:99
882 "It is normally necessary to assign a local address using B<bind>() before a "
883 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
885 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2) を"
886 "参照)、通常その前に B<bind>() を使用してローカルアドレスを割り当てる必要があ"
890 #: build/C/man2/bind.2:130
892 "The rules used in name binding vary between address families. Consult the "
893 "manual entries in Section 7 for detailed information. For B<AF_INET> see "
894 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
895 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
896 "B<AF_X25> see B<x25>(7) and for B<AF_NETLINK> see B<netlink>(7)."
898 "名前付けのルールはアドレスファミリーごとに異なっている。詳細な情報は 第 7 章"
899 "の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7) を、 B<AF_INET6> は "
900 "B<ipv6>(7) を、 B<AF_UNIX> は B<unix>(7) を、 B<AF_APPLETALK> は "
901 "B<ddp>(7) を、 B<AF_PACKET> は B<packet>(7) を、 B<AF_X25> は B<x25>(7) "
902 "を、 B<AF_NETLINK> は B<netlink>(7) を参照。"
905 #: build/C/man2/bind.2:137
907 "The actual structure passed for the I<addr> argument will depend on the "
908 "address family. The I<sockaddr> structure is defined as something like:"
910 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレスファミリーに依"
911 "存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
914 #: build/C/man2/bind.2:144
917 "struct sockaddr {\n"
918 " sa_family_t sa_family;\n"
919 " char sa_data[14];\n"
922 "struct sockaddr {\n"
923 " sa_family_t sa_family;\n"
924 " char sa_data[14];\n"
928 #: build/C/man2/bind.2:152
930 "The only purpose of this structure is to cast the structure pointer passed "
931 "in I<addr> in order to avoid compiler warnings. See EXAMPLE below."
933 "この構造体は、 I<addr> に渡される構造体へのポインターをキャストし、 コンパイ"
934 "ラの警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
937 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
938 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
939 #: build/C/man2/socketpair.2:74
941 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
944 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
948 #: build/C/man2/bind.2:158 build/C/man2/bind.2:199
949 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
950 #: build/C/man2/send.2:304 build/C/man2/socket.2:321
955 #. e.g., privileged port in AF_INET domain
957 #: build/C/man2/bind.2:162
958 msgid "The address is protected, and the user is not the superuser."
959 msgstr "そのアドレスは保護されていて、かつユーザーがスーパーユーザーではない。"
962 #: build/C/man2/bind.2:162 build/C/man2/bind.2:165
963 #: build/C/man3/bindresvport.3:82 build/C/man2/connect.2:148
964 #: build/C/man2/listen.2:88 build/C/man2/listen.2:91
966 msgid "B<EADDRINUSE>"
967 msgstr "B<EADDRINUSE>"
970 #: build/C/man2/bind.2:165
971 msgid "The given address is already in use."
972 msgstr "指定されたアドレスが既に使用中である。"
975 #: build/C/man2/bind.2:175
977 "(Internet domain sockets) The port number was specified as zero in the "
978 "socket address structure, but, upon attempting to bind to an ephemeral port, "
979 "it was determined that all port numbers in the ephemeral port range are "
980 "currently in use. See the discussion of I</proc/sys/net/ipv4/"
981 "ip_local_port_range> B<ip>(7)."
983 "(インターネットドメインソケットの場合) ソケットアドレス構造体でポート番号に "
984 "0 が指定されたが、 一時ポート (ephemeral port) を割り当てようとした際に、 一"
985 "時ポートとして使用する範囲のすべてのポート番号が使用中であった。 B<ip>(7) の "
986 "I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照。"
989 #: build/C/man2/bind.2:180
990 msgid "I<sockfd> is not a valid descriptor."
991 msgstr "I<sockfd> が不正なディスクリプターである。"
993 #. This may change in the future: see
994 #. .I linux/unix/sock.c for details.
996 #: build/C/man2/bind.2:185
997 msgid "The socket is already bound to an address."
998 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
1001 #: build/C/man2/bind.2:191
1003 "I<addrlen> is wrong, or I<addr> is not a valid address for this socket's "
1006 "I<addrlen> が間違っているか、 I<addr> がこのソケットのドメインで有効なアドレ"
1010 #: build/C/man2/bind.2:195
1011 msgid "I<sockfd> is a descriptor for a file, not a socket."
1013 "I<sockfd> がファイルに対するディスクリプターで、ソケットに対するものではな"
1017 #: build/C/man2/bind.2:199
1018 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>) sockets:"
1019 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>) のソケット特有である:"
1022 #: build/C/man2/bind.2:204
1024 "Search permission is denied on a component of the path prefix. (See also "
1025 "B<path_resolution>(7).)"
1027 "パス名の構成要素に検索許可 (search permission) がない "
1028 "(B<path_resolution>(7) も参照すること)。"
1031 #: build/C/man2/bind.2:204 build/C/man2/connect.2:151
1033 msgid "B<EADDRNOTAVAIL>"
1034 msgstr "B<EADDRNOTAVAIL>"
1037 #: build/C/man2/bind.2:208
1039 "A nonexistent interface was requested or the requested address was not local."
1041 "存在しないインターフェースが要求されたか、要求されたアドレスが ローカルではな"
1045 #: build/C/man2/bind.2:212
1046 msgid "I<addr> points outside the user's accessible address space."
1047 msgstr "I<addr> がユーザーのアクセス可能なアドレス空間の外を指している。"
1050 #: build/C/man2/bind.2:212
1056 #: build/C/man2/bind.2:216
1057 msgid "Too many symbolic links were encountered in resolving I<addr>."
1058 msgstr "I<addr> を解決する際に遭遇したシンボリックリンクが多過ぎる。"
1061 #: build/C/man2/bind.2:216
1063 msgid "B<ENAMETOOLONG>"
1064 msgstr "B<ENAMETOOLONG>"
1067 #: build/C/man2/bind.2:220
1068 msgid "I<addr> is too long."
1069 msgstr "I<addr> が長過ぎる。"
1072 #: build/C/man2/bind.2:220
1078 #: build/C/man2/bind.2:223
1079 msgid "The file does not exist."
1080 msgstr "ファイルが存在しない。"
1083 #: build/C/man2/bind.2:223 build/C/man2/recv.2:460 build/C/man2/select.2:340
1084 #: build/C/man2/send.2:375
1090 #: build/C/man2/bind.2:226
1091 msgid "Insufficient kernel memory was available."
1092 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1095 #: build/C/man2/bind.2:226
1101 #: build/C/man2/bind.2:229
1102 msgid "A component of the path prefix is not a directory."
1103 msgstr "パス名の構成要素がディレクトリではない。"
1106 #: build/C/man2/bind.2:229
1112 #: build/C/man2/bind.2:232
1113 msgid "The socket inode would reside on a read-only filesystem."
1114 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1116 #. SVr4 documents an additional
1118 #. general error condition, and
1123 #. UNIX-domain error conditions.
1125 #: build/C/man2/bind.2:244
1126 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>() first appeared in 4.2BSD)."
1127 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>() は 4.2BSD で最初に現われた)。"
1130 #: build/C/man2/bind.2:261
1132 "The third argument of B<bind>() is in reality an I<int> (and this is what 4."
1133 "x BSD and libc4 and libc5 have). Some POSIX confusion resulted in the "
1134 "present I<socklen_t>, also used by glibc. See also B<accept>(2)."
1136 "B<bind>() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1137 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1138 "少し混乱がある。 詳しくは B<accept>(2) を参照のこと。"
1141 #: build/C/man2/bind.2:261 build/C/man2/getsockopt.2:199
1142 #: build/C/man2/recvmmsg.2:267 build/C/man2/select.2:492
1143 #: build/C/man2/send.2:433 build/C/man3/sockatmark.3:100
1144 #: build/C/man7/socket.7:947
1149 #. FIXME Document transparent proxy options
1151 #: build/C/man2/bind.2:264
1152 msgid "The transparent proxy options are not described."
1153 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1156 #: build/C/man2/bind.2:269
1158 "An example of the use of B<bind>() with Internet domain sockets can be "
1159 "found in B<getaddrinfo>(3)."
1161 "インターネットドメインソケットでの B<bind>() の利用例が B<getaddrinfo>(3) "
1164 #. listen.7 refers to this example.
1165 #. accept.7 refers to this example.
1166 #. unix.7 refers to this example.
1168 #: build/C/man2/bind.2:276
1170 "The following example shows how to bind a stream socket in the UNIX "
1171 "(B<AF_UNIX>) domain, and accept connections:"
1173 "以下の例は、UNIX ドメイン (B<AF_UNIX>) でストリームソケットを bind する方法"
1177 #: build/C/man2/bind.2:283
1180 "#include E<lt>sys/socket.hE<gt>\n"
1181 "#include E<lt>sys/un.hE<gt>\n"
1182 "#include E<lt>stdlib.hE<gt>\n"
1183 "#include E<lt>stdio.hE<gt>\n"
1184 "#include E<lt>string.hE<gt>\n"
1186 "#include E<lt>sys/socket.hE<gt>\n"
1187 "#include E<lt>sys/un.hE<gt>\n"
1188 "#include E<lt>stdlib.hE<gt>\n"
1189 "#include E<lt>stdio.hE<gt>\n"
1190 "#include E<lt>string.hE<gt>\n"
1193 #: build/C/man2/bind.2:286
1196 "#define MY_SOCK_PATH \"/somepath\"\n"
1197 "#define LISTEN_BACKLOG 50\n"
1199 "#define MY_SOCK_PATH \"/somepath\"\n"
1200 "#define LISTEN_BACKLOG 50\n"
1203 #: build/C/man2/bind.2:289
1206 "#define handle_error(msg) \\e\n"
1207 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1209 "#define handle_error(msg) \\e\n"
1210 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1213 #: build/C/man2/bind.2:296
1217 "main(int argc, char *argv[])\n"
1220 " struct sockaddr_un my_addr, peer_addr;\n"
1221 " socklen_t peer_addr_size;\n"
1224 "main(int argc, char *argv[])\n"
1227 " struct sockaddr_un my_addr, peer_addr;\n"
1228 " socklen_t peer_addr_size;\n"
1231 #: build/C/man2/bind.2:300
1234 " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1236 " handle_error(\"socket\");\n"
1238 " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1240 " handle_error(\"socket\");\n"
1243 #: build/C/man2/bind.2:306
1246 " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1247 " /* Clear structure */\n"
1248 " my_addr.sun_family = AF_UNIX;\n"
1249 " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1250 " sizeof(my_addr.sun_path) - 1);\n"
1252 " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1253 " /* Clear structure */\n"
1254 " my_addr.sun_family = AF_UNIX;\n"
1255 " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1256 " sizeof(my_addr.sun_path) - 1);\n"
1259 #: build/C/man2/bind.2:310
1262 " if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1263 " sizeof(struct sockaddr_un)) == -1)\n"
1264 " handle_error(\"bind\");\n"
1266 " if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1267 " sizeof(struct sockaddr_un)) == -1)\n"
1268 " handle_error(\"bind\");\n"
1271 #: build/C/man2/bind.2:313
1274 " if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1275 " handle_error(\"listen\");\n"
1277 " if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1278 " handle_error(\"listen\");\n"
1281 #: build/C/man2/bind.2:316
1284 " /* Now we can accept incoming connections one\n"
1285 " at a time using accept(2) */\n"
1287 " /* Now we can accept incoming connections one\n"
1288 " at a time using accept(2) */\n"
1291 #: build/C/man2/bind.2:322
1294 " peer_addr_size = sizeof(struct sockaddr_un);\n"
1295 " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1296 " &peer_addr_size);\n"
1298 " handle_error(\"accept\");\n"
1300 " peer_addr_size = sizeof(struct sockaddr_un);\n"
1301 " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1302 " &peer_addr_size)\n"
1304 " handle_error(\"accept\");\n"
1307 #: build/C/man2/bind.2:324
1309 msgid " /* Code to deal with incoming connection(s)... */\n"
1310 msgstr " /* Code to deal with incoming connection(s)... */\n"
1313 #: build/C/man2/bind.2:328
1316 " /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1317 " should be deleted using unlink(2) or remove(3) */\n"
1320 " /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1321 " should be deleted using unlink(2) or remove(3) */\n"
1325 #: build/C/man2/bind.2:342
1327 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1328 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1329 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1331 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1332 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1333 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1336 #: build/C/man3/bindresvport.3:30
1338 msgid "BINDRESVPORT"
1339 msgstr "BINDRESVPORT"
1342 #: build/C/man3/bindresvport.3:30
1348 #: build/C/man3/bindresvport.3:33
1349 msgid "bindresvport - bind a socket to a privileged IP port"
1350 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1353 #: build/C/man3/bindresvport.3:37
1356 "B<#include E<lt>sys/types.hE<gt>>\n"
1357 "B<#include E<lt>netinet/in.hE<gt>>\n"
1359 "B<#include E<lt>sys/types.hE<gt>>\n"
1360 "B<#include E<lt>netinet/in.hE<gt>>\n"
1363 #: build/C/man3/bindresvport.3:39
1365 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1366 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1368 #. Glibc actually starts searching with a port # in the range 600 to 1023
1370 #: build/C/man3/bindresvport.3:46
1372 "B<bindresvport>() is used to bind a socket descriptor to a privileged "
1373 "anonymous IP port, that is, a port number arbitrarily selected from the "
1374 "range 512 to 1023."
1376 "B<bindresvport>() は、ソケットディスクリプターを特権無名 (privileged "
1377 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1378 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1381 #: build/C/man3/bindresvport.3:56
1383 "If the B<bind>(2) performed by B<bindresvport>() is successful, and I<sin> "
1384 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1387 "B<bindresvport>() によって実行された B<bind>(2) が成功し、 I<sin> が NULL "
1388 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1392 #: build/C/man3/bindresvport.3:67
1394 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1395 "to be B<AF_INET>. However, in this case, B<bindresvport>() has no way to "
1396 "return the port number actually allocated. (This information can later be "
1397 "obtained using B<getsockname>(2).)"
1399 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1400 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 "
1401 "B<bindresvport>() は実際に割り当てられたポート番号を返す手段を持たない (割り"
1402 "当てられたポート番号は、後で B<getsockname>(2) を使って取得できる)。"
1405 #: build/C/man3/bindresvport.3:72
1407 "B<bindresvport>() returns 0 on success; otherwise -1 is returned and "
1408 "I<errno> set to indicate the cause of the error."
1410 "B<bindresvport>() は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1411 "I<errno> にエラーの原因を示す値を設定する。"
1414 #: build/C/man3/bindresvport.3:77
1416 "B<bindresvport>() can fail for any of the same reasons as B<bind>(2). In "
1417 "addition, the following errors may occur:"
1419 "B<bindresvport>() は B<bind>(2) と同じ原因で失敗する可能性がある。 さらに、"
1423 #: build/C/man3/bindresvport.3:82
1425 "The caller did not have superuser privilege (to be precise: the "
1426 "B<CAP_NET_BIND_SERVICE> capability is required)."
1428 "呼び出し元がスーパーユーザーの特権を持っていなかった (より正確に言うと、 "
1429 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1432 #: build/C/man3/bindresvport.3:85
1433 msgid "All privileged ports are in use."
1434 msgstr "全ての特権ポートが使用中である。"
1437 #: build/C/man3/bindresvport.3:85
1439 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1440 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1443 #: build/C/man3/bindresvport.3:92
1444 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1446 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1449 #: build/C/man3/bindresvport.3:92 build/C/man3/if_nametoindex.3:85
1450 #: build/C/man3/sockatmark.3:73
1456 #: build/C/man3/bindresvport.3:93 build/C/man3/if_nametoindex.3:86
1457 #: build/C/man3/sockatmark.3:74
1459 msgid "Multithreading (see pthreads(7))"
1460 msgstr "マルチスレッディング (pthreads(7) 参照)"
1463 #: build/C/man3/bindresvport.3:98
1465 "Before glibc 2.17, the B<bindresvport>() function uses a static variable "
1466 "that is not protected, so it is not thread-safe."
1468 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1469 "静的変数を使用しているため、スレッドセーフではない。"
1471 #. commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1473 #: build/C/man3/bindresvport.3:104
1475 "Since glibc 2.17, the B<bindresvport>() function uses a lock to protect the "
1476 "static variable, so it is thread-safe."
1478 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1482 #: build/C/man3/bindresvport.3:107
1484 "Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other systems."
1486 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1489 #: build/C/man3/bindresvport.3:113
1491 "Unlike some B<bindresvport>() implementations, the glibc implementation "
1492 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1494 "B<bindresvport>() のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1495 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1498 #: build/C/man3/bindresvport.3:116
1499 msgid "B<bind>(2), B<getsockname>(2)"
1500 msgstr "B<bind>(2), B<getsockname>(2)"
1503 #: build/C/man2/connect.2:67
1509 #: build/C/man2/connect.2:67
1515 #: build/C/man2/connect.2:70
1516 msgid "connect - initiate a connection on a socket"
1517 msgstr "connect - ソケットの接続を行う"
1520 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1521 #: build/C/man2/listen.2:51
1523 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */\n"
1524 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */\n"
1527 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1528 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1529 #: build/C/man2/recv.2:51
1531 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1532 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1535 #: build/C/man2/connect.2:78
1538 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1539 "B< socklen_t >I<addrlen>B<);>\n"
1541 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1542 "B< socklen_t >I<addrlen>B<);>\n"
1545 #: build/C/man2/connect.2:97
1547 "The B<connect>() system call connects the socket referred to by the file "
1548 "descriptor I<sockfd> to the address specified by I<addr>. The I<addrlen> "
1549 "argument specifies the size of I<addr>. The format of the address in "
1550 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1551 "B<socket>(2) for further details."
1553 "B<connect>() システムコールは、ファイルディスクリプター I<sockfd> が参照して"
1554 "いるソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1555 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1556 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2) を参照の"
1560 #: build/C/man2/connect.2:113
1562 "If the socket I<sockfd> is of type B<SOCK_DGRAM>, then I<addr> is the "
1563 "address to which datagrams are sent by default, and the only address from "
1564 "which datagrams are received. If the socket is of type B<SOCK_STREAM> or "
1565 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1566 "that is bound to the address specified by I<addr>."
1568 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1569 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1570 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1571 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1575 #: build/C/man2/connect.2:127
1577 "Generally, connection-based protocol sockets may successfully B<connect>() "
1578 "only once; connectionless protocol sockets may use B<connect>() multiple "
1579 "times to change their association. Connectionless sockets may dissolve the "
1580 "association by connecting to an address with the I<sa_family> member of "
1581 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1583 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ "
1584 "B<connect>() が成功する。 コネクションレス (connectionless) プロトコルでは対"
1585 "応を変更するために何度も B<connect>() を使用できる。 非接続ソケットは "
1586 "I<sockaddr> の I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アド"
1587 "レスの対応を解消することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux で"
1591 #: build/C/man2/connect.2:132
1593 "If the connection or binding succeeds, zero is returned. On error, -1 is "
1594 "returned, and I<errno> is set appropriately."
1596 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1600 #: build/C/man2/connect.2:135
1602 "The following are general socket errors only. There may be other domain-"
1603 "specific error codes."
1605 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1609 #: build/C/man2/connect.2:143
1611 "For UNIX domain sockets, which are identified by pathname: Write permission "
1612 "is denied on the socket file, or search permission is denied for one of the "
1613 "directories in the path prefix. (See also B<path_resolution>(7).)"
1615 "UNIX ドメインソケットはパス名で識別される。 ソケットファイルへの書き込み許可"
1616 "がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可が"
1617 "なかった。 (B<path_resolution>(7) も参照のこと)"
1620 #: build/C/man2/connect.2:143
1622 msgid "B<EACCES>, B<EPERM>"
1623 msgstr "B<EACCES>, B<EPERM>"
1626 #: build/C/man2/connect.2:148
1628 "The user tried to connect to a broadcast address without having the socket "
1629 "broadcast flag enabled or the connection request failed because of a local "
1632 "ソケットのブロードキャストフラグが有効になっていないのに ユーザーがブロード"
1633 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1637 #: build/C/man2/connect.2:151
1638 msgid "Local address is already in use."
1639 msgstr "ローカルアドレスが既に使用されている。"
1642 #: build/C/man2/connect.2:164 build/C/man2/listen.2:104
1644 "(Internet domain sockets) The socket referred to by I<sockfd> had not "
1645 "previously been bound to an address and, upon attempting to bind it to an "
1646 "ephemeral port, it was determined that all port numbers in the ephemeral "
1647 "port range are currently in use. See the discussion of I</proc/sys/net/ipv4/"
1648 "ip_local_port_range> in B<ip>(7)."
1650 "(インターネットドメインソケットの場合) I<sockfd> が参照するソケットがそれ以前"
1651 "にアドレスにバインドされておらず、 そのソケットに一時ポートをバインドしようと"
1652 "した際に、 一時ポートとして使用する範囲のポート番号がすべて使用中であった。 "
1653 "B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照のこと。"
1656 #: build/C/man2/connect.2:164 build/C/man2/socket.2:325
1657 #: build/C/man2/socketpair.2:75
1659 msgid "B<EAFNOSUPPORT>"
1660 msgstr "B<EAFNOSUPPORT>"
1663 #: build/C/man2/connect.2:169
1665 "The passed address didn't have the correct address family in its "
1666 "I<sa_family> field."
1668 "渡されたアドレスの I<sa_family> フィールドが正しいアドレスファミリーではな"
1672 #: build/C/man2/connect.2:169 build/C/man2/send.2:323
1678 #: build/C/man2/connect.2:172
1679 msgid "Insufficient entries in the routing cache."
1680 msgstr "ルーティングキャッシュにエントリーが十分にない。"
1683 #: build/C/man2/connect.2:172
1686 msgstr "B<EALREADY>"
1689 #: build/C/man2/connect.2:176
1691 "The socket is nonblocking and a previous connection attempt has not yet been "
1694 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1697 #: build/C/man2/connect.2:179
1698 msgid "The file descriptor is not a valid index in the descriptor table."
1700 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1704 #: build/C/man2/connect.2:179 build/C/man2/recv.2:443
1706 msgid "B<ECONNREFUSED>"
1707 msgstr "B<ECONNREFUSED>"
1710 #: build/C/man2/connect.2:182
1711 msgid "No-one listening on the remote address."
1712 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1715 #: build/C/man2/connect.2:185
1716 msgid "The socket structure address is outside the user's address space."
1717 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1720 #: build/C/man2/connect.2:185
1722 msgid "B<EINPROGRESS>"
1723 msgstr "B<EINPROGRESS>"
1726 #: build/C/man2/connect.2:210
1728 "The socket is nonblocking and the connection cannot be completed "
1729 "immediately. It is possible to B<select>(2) or B<poll>(2) for completion "
1730 "by selecting the socket for writing. After B<select>(2) indicates "
1731 "writability, use B<getsockopt>(2) to read the B<SO_ERROR> option at level "
1732 "B<SOL_SOCKET> to determine whether B<connect>() completed successfully "
1733 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1734 "error codes listed here, explaining the reason for the failure)."
1736 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1737 "できない。その場合、 B<select>(2) や B<poll>(2) を使ってそのソケットが書き"
1738 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2) "
1739 "で書き込み可能になった後に、 B<getsockopt>(2) を使って B<SOL_SOCKET> レベル"
1740 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>() が成功したか、"
1741 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1742 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1745 #. For TCP, the connection will complete asynchronously.
1746 #. See http://lkml.org/lkml/2005/7/12/254
1748 #: build/C/man2/connect.2:216
1750 "The system call was interrupted by a signal that was caught; see "
1753 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7) 参照。"
1756 #: build/C/man2/connect.2:216 build/C/man2/send.2:355
1762 #: build/C/man2/connect.2:219
1763 msgid "The socket is already connected."
1764 msgstr "ソケットは既に接続 (connect) されている。"
1767 #: build/C/man2/connect.2:219
1769 msgid "B<ENETUNREACH>"
1770 msgstr "B<ENETUNREACH>"
1773 #: build/C/man2/connect.2:222
1774 msgid "Network is unreachable."
1775 msgstr "到達できないネットワークである。"
1778 #: build/C/man2/connect.2:225
1779 msgid "The file descriptor is not associated with a socket."
1780 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1783 #: build/C/man2/connect.2:225
1785 msgid "B<EPROTOTYPE>"
1786 msgstr "B<EPROTOTYPE>"
1789 #: build/C/man2/connect.2:230
1791 "The socket type does not support the requested communications protocol. "
1792 "This error can occur, for example, on an attempt to connect a UNIX domain "
1793 "datagram socket to a stream socket."
1795 "ソケットタイプが要求された通信プロトコルではサポートされていない。 このエラー"
1796 "は、 例えば UNIX ドメインデータグラムソケットをストリームソケットに接続しよう"
1800 #: build/C/man2/connect.2:230
1802 msgid "B<ETIMEDOUT>"
1803 msgstr "B<ETIMEDOUT>"
1806 #: build/C/man2/connect.2:237
1808 "Timeout while attempting connection. The server may be too busy to accept "
1809 "new connections. Note that for IP sockets the timeout may be very long when "
1810 "syncookies are enabled on the server."
1812 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1813 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1814 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1817 #. SVr4 documents the additional
1818 #. general error codes
1819 #. .BR EADDRNOTAVAIL ,
1821 #. .BR EAFNOSUPPORT ,
1828 #. documents many additional error conditions not described here.
1830 #: build/C/man2/connect.2:253
1832 "SVr4, 4.4BSD, (the B<connect>() function first appeared in 4.2BSD), "
1835 "SVr4, 4.4BSD, (B<connect>() 関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1838 #: build/C/man2/connect.2:270
1840 "The third argument of B<connect>() is in reality an I<int> (and this is "
1841 "what 4.x BSD and libc4 and libc5 have). Some POSIX confusion resulted in "
1842 "the present I<socklen_t>, also used by glibc. See also B<accept>(2)."
1844 "B<connect>() の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1845 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1846 "glibc でも I<socklen_t> を使っている。 B<accept>(2) も参照のこと。"
1849 #: build/C/man2/connect.2:276
1851 "If B<connect>() fails, consider the state of the socket as unspecified. "
1852 "Portable applications should close the socket and create a new one for "
1855 "B<connect>() が失敗した場合、そのソケットの状態は不定だと考えること。 移植性"
1856 "を考慮したアプリケーションでは、そのソケットをクローズし、再接続用に新しいソ"
1860 #: build/C/man2/connect.2:281
1861 msgid "An example of the use of B<connect>() is shown in B<getaddrinfo>(3)."
1862 msgstr "B<connect>() の利用例が B<getaddrinfo>(3) に記載されている。"
1865 #: build/C/man2/connect.2:288
1867 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1868 "B<path_resolution>(7)"
1870 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1871 "B<path_resolution>(7)"
1874 #: build/C/man3/getifaddrs.3:36
1880 #: build/C/man3/getifaddrs.3:36
1886 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1887 #: build/C/man3/if_nametoindex.3:25
1893 #: build/C/man3/getifaddrs.3:39
1894 msgid "getifaddrs, freeifaddrs - get interface addresses"
1895 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1898 #: build/C/man3/getifaddrs.3:43
1901 "B<#include E<lt>sys/types.hE<gt>>\n"
1902 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1904 "B<#include E<lt>sys/types.hE<gt>>\n"
1905 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1908 #: build/C/man3/getifaddrs.3:45
1910 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1911 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1914 #: build/C/man3/getifaddrs.3:47
1916 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1917 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1920 #: build/C/man3/getifaddrs.3:58
1922 "The B<getifaddrs>() function creates a linked list of structures describing "
1923 "the network interfaces of the local system, and stores the address of the "
1924 "first item of the list in I<*ifap>. The list consists of I<ifaddrs> "
1925 "structures, defined as follows:"
1927 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1928 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1929 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1933 #: build/C/man3/getifaddrs.3:77
1936 "struct ifaddrs {\n"
1937 " struct ifaddrs *ifa_next; /* Next item in list */\n"
1938 " char *ifa_name; /* Name of interface */\n"
1939 " unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */\n"
1940 " struct sockaddr *ifa_addr; /* Address of interface */\n"
1941 " struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1943 " struct sockaddr *ifu_broadaddr;\n"
1944 " /* Broadcast address of interface */\n"
1945 " struct sockaddr *ifu_dstaddr;\n"
1946 " /* Point-to-point destination address */\n"
1948 "#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1949 "#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n"
1950 " void *ifa_data; /* Address-specific data */\n"
1953 "struct ifaddrs {\n"
1954 " struct ifaddrs *ifa_next; /* Next item in list */\n"
1955 " char *ifa_name; /* Name of interface */\n"
1956 " unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */\n"
1957 " struct sockaddr *ifa_addr; /* Address of interface */\n"
1958 " struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1960 " struct sockaddr *ifu_broadaddr;\n"
1961 " /* Broadcast address of interface */\n"
1962 " struct sockaddr *ifu_dstaddr;\n"
1963 " /* Point-to-point destination address */\n"
1965 "#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1966 "#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n"
1967 " void *ifa_data; /* Address-specific data */\n"
1971 #: build/C/man3/getifaddrs.3:84
1973 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1974 "or NULL if this is the last item of the list."
1976 "I<ifa_next> フィールドにはリストの次の構造体へのポインターが格納される。 この"
1977 "要素がリストの最後の場合には NULL が入る。"
1981 #. indicates the maximum length of this field.
1983 #: build/C/man3/getifaddrs.3:91
1984 msgid "The I<ifa_name> points to the null-terminated interface name."
1985 msgstr "I<ifa_name> はヌル終端されたインターフェース名を指す。"
1988 #: build/C/man3/getifaddrs.3:100
1990 "The I<ifa_flags> field contains the interface flags, as returned by the "
1991 "B<SIOCGIFFLAGS> B<ioctl>(2) operation (see B<netdevice>(7) for a list of "
1994 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1995 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1996 "B<netdevice>(7) を参照)。"
1999 #: build/C/man3/getifaddrs.3:109
2001 "The I<ifa_addr> field points to a structure containing the interface "
2002 "address. (The I<sa_family> subfield should be consulted to determine the "
2003 "format of the address structure.) This field may contain a null pointer."
2005 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
2006 "ンターである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判"
2007 "別すべきである)。 このフィールドはヌルポインターとなる場合がある。"
2010 #: build/C/man3/getifaddrs.3:116
2012 "The I<ifa_netmask> field points to a structure containing the netmask "
2013 "associated with I<ifa_addr>, if applicable for the address family. This "
2014 "field may contain a null pointer."
2016 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
2017 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインターが"
2018 "入る。 このフィールドはヌルポインターとなる場合がある。"
2021 #: build/C/man3/getifaddrs.3:131
2023 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
2024 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
2025 "will contain the broadcast address associated with I<ifa_addr> (if "
2026 "applicable for the address family) or I<ifa_dstaddr> will contain the "
2027 "destination address of the point-to-point interface."
2029 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
2030 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
2031 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
2032 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
2033 "point インターフェースの宛先アドレスが入るかが決まる。"
2036 #: build/C/man3/getifaddrs.3:136
2038 "The I<ifa_data> field points to a buffer containing address-family-specific "
2039 "data; this field may be NULL if there is no such data for this interface."
2041 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファーへ"
2042 "のポインターである。 そのインターフェースでこのようなデータがない場合には、 "
2043 "このフィールドは NULL となる。"
2046 #: build/C/man3/getifaddrs.3:142
2048 "The data returned by B<getifaddrs>() is dynamically allocated and should be "
2049 "freed using B<freeifaddrs>() when no longer needed."
2051 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2052 "B<freeifaddrs>() を使って解放すべきである。"
2055 #: build/C/man3/getifaddrs.3:149
2057 "On success, B<getifaddrs>() returns zero; on error, -1 is returned, and "
2058 "I<errno> is set appropriately."
2060 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2064 #: build/C/man3/getifaddrs.3:162
2066 "B<getifaddrs>() may fail and set I<errno> for any of the errors specified "
2067 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), "
2068 "B<sendto>(2), B<malloc>(3), or B<realloc>(3)."
2070 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には "
2071 "B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), "
2072 "B<malloc>(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定され"
2076 #: build/C/man3/getifaddrs.3:170
2078 "The B<getifaddrs>() function first appeared in glibc 2.3, but before glibc "
2079 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2080 "added in glibc 2.3.3. Support of address families other than IPv4 is "
2081 "available only on kernels that support netlink."
2083 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2084 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2085 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2086 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2088 #. , but the BSD-derived documentation generally
2089 #. appears to be confused and obsolete on this point.
2090 #. i.e., commonly it still says one of them will be NULL, even if
2091 #. the ifa_ifu union is already present
2093 #: build/C/man3/getifaddrs.3:190
2095 "Not in POSIX.1-2001. This function first appeared in BSDi and is present on "
2096 "the BSD systems, but with slightly different semantics documented"
2097 "\\(emreturning one entry per interface, not per address. This means "
2098 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2099 "address, and no link-level address is returned if the interface has an IP "
2100 "address assigned. Also, the way of choosing either I<ifa_broadaddr> or "
2101 "I<ifa_dstaddr> differs on various systems."
2103 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2104 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2105 "フェース毎に 1 エントリーを返す。 このことは、 インターフェースがアドレスを持"
2106 "たない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2107 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2108 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2109 "どちらを選択するかを決める方法は、 システムにより異なる。"
2112 #: build/C/man3/getifaddrs.3:207
2114 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2115 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2116 "containing lower-level details about the interface and its physical layer. "
2117 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2118 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2119 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2120 "hE<gt>>), which contains various interface attributes and statistics."
2122 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2123 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2124 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2125 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2126 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2127 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2128 "れる I<struct net_device_stats>) へのポインターが格納される。 この構造体に"
2129 "は、インターフェースの様々な属性や統計情報が入る。"
2132 #: build/C/man3/getifaddrs.3:214
2134 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2135 "and B<getnameinfo>(3). Here is what we see when running this program on one "
2138 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2139 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2142 #: build/C/man3/getifaddrs.3:235
2146 "lo AF_PACKET (17)\n"
2147 " tx_packets = 524; rx_packets = 524\n"
2148 " tx_bytes = 38788; rx_bytes = 38788\n"
2149 "wlp3s0 AF_PACKET (17)\n"
2150 " tx_packets = 108391; rx_packets = 130245\n"
2151 " tx_bytes = 30420659; rx_bytes = 94230014\n"
2152 "em1 AF_PACKET (17)\n"
2153 " tx_packets = 0; rx_packets = 0\n"
2154 " tx_bytes = 0; rx_bytes = 0\n"
2156 " address: E<lt>127.0.0.1E<gt>\n"
2157 "wlp3s0 AF_INET (2)\n"
2158 " address: E<lt>192.168.235.137E<gt>\n"
2159 "lo AF_INET6 (10)\n"
2160 " address: E<lt>::1E<gt>\n"
2161 "wlp3s0 AF_INET6 (10)\n"
2162 " address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2165 "lo AF_PACKET (17)\n"
2166 " tx_packets = 524; rx_packets = 524\n"
2167 " tx_bytes = 38788; rx_bytes = 38788\n"
2168 "wlp3s0 AF_PACKET (17)\n"
2169 " tx_packets = 108391; rx_packets = 130245\n"
2170 " tx_bytes = 30420659; rx_bytes = 94230014\n"
2171 "em1 AF_PACKET (17)\n"
2172 " tx_packets = 0; rx_packets = 0\n"
2173 " tx_bytes = 0; rx_bytes = 0\n"
2175 " address: E<lt>127.0.0.1E<gt>\n"
2176 "wlp3s0 AF_INET (2)\n"
2177 " address: E<lt>192.168.235.137E<gt>\n"
2178 "lo AF_INET6 (10)\n"
2179 " address: E<lt>::1E<gt>\n"
2180 "wlp3s0 AF_INET6 (10)\n"
2181 " address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2184 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2185 #: build/C/man2/recvmmsg.2:205
2187 msgid "Program source"
2191 #: build/C/man3/getifaddrs.3:249
2194 "#define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2195 "#include E<lt>arpa/inet.hE<gt>\n"
2196 "#include E<lt>sys/socket.hE<gt>\n"
2197 "#include E<lt>netdb.hE<gt>\n"
2198 "#include E<lt>ifaddrs.hE<gt>\n"
2199 "#include E<lt>stdio.hE<gt>\n"
2200 "#include E<lt>stdlib.hE<gt>\n"
2201 "#include E<lt>unistd.hE<gt>\n"
2202 "#include E<lt>linux/if_link.hE<gt>\n"
2204 "#define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2205 "#include E<lt>arpa/inet.hE<gt>\n"
2206 "#include E<lt>sys/socket.hE<gt>\n"
2207 "#include E<lt>netdb.hE<gt>\n"
2208 "#include E<lt>ifaddrs.hE<gt>\n"
2209 "#include E<lt>stdio.hE<gt>\n"
2210 "#include E<lt>stdlib.hE<gt>\n"
2211 "#include E<lt>unistd.hE<gt>\n"
2212 "#include E<lt>linux/if_link.hE<gt>\n"
2215 #: build/C/man3/getifaddrs.3:255
2218 "int main(int argc, char *argv[])\n"
2220 " struct ifaddrs *ifaddr, *ifa;\n"
2221 " int family, s, n;\n"
2222 " char host[NI_MAXHOST];\n"
2224 "int main(int argc, char *argv[])\n"
2226 " struct ifaddrs *ifaddr, *ifa;\n"
2227 " int family, s, n;\n"
2228 " char host[NI_MAXHOST];\n"
2231 #: build/C/man3/getifaddrs.3:260
2234 " if (getifaddrs(&ifaddr) == -1) {\n"
2235 " perror(\"getifaddrs\");\n"
2236 " exit(EXIT_FAILURE);\n"
2239 " if (getifaddrs(&ifaddr) == -1) {\n"
2240 " perror(\"getifaddrs\");\n"
2241 " exit(EXIT_FAILURE);\n"
2245 #: build/C/man3/getifaddrs.3:263
2248 " /* Walk through linked list, maintaining head pointer so we\n"
2249 " can free list later */\n"
2251 " /* Walk through linked list, maintaining head pointer so we\n"
2252 " can free list later */\n"
2255 #: build/C/man3/getifaddrs.3:267
2258 " for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2259 " if (ifa-E<gt>ifa_addr == NULL)\n"
2262 " for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2263 " if (ifa-E<gt>ifa_addr == NULL)\n"
2267 #: build/C/man3/getifaddrs.3:269
2269 msgid " family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2270 msgstr " family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2273 #: build/C/man3/getifaddrs.3:272
2276 " /* Display interface name and family (including symbolic\n"
2277 " form of the latter for the common families) */\n"
2279 " /* Display interface name and family (including symbolic\n"
2280 " form of the latter for the common families) */\n"
2283 #: build/C/man3/getifaddrs.3:279
2286 " printf(\"%-8s %s (%d)\\en\",\n"
2287 " ifa-E<gt>ifa_name,\n"
2288 " (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2289 " (family == AF_INET) ? \"AF_INET\" :\n"
2290 " (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2293 " printf(\"%-8s %s (%d)\\en\",\n"
2294 " ifa-E<gt>ifa_name,\n"
2295 " (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2296 " (family == AF_INET) ? \"AF_INET\" :\n"
2297 " (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2301 #: build/C/man3/getifaddrs.3:281
2303 msgid " /* For an AF_INET* interface address, display the address */\n"
2304 msgstr " /* For an AF_INET* interface address, display the address */\n"
2307 #: build/C/man3/getifaddrs.3:292
2310 " if (family == AF_INET || family == AF_INET6) {\n"
2311 " s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2312 " (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2313 " sizeof(struct sockaddr_in6),\n"
2314 " host, NI_MAXHOST,\n"
2315 " NULL, 0, NI_NUMERICHOST);\n"
2317 " printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2318 " exit(EXIT_FAILURE);\n"
2321 " if (family == AF_INET || family == AF_INET6) {\n"
2322 " s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2323 " (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2324 " sizeof(struct sockaddr_in6),\n"
2325 " host, NI_MAXHOST,\n"
2326 " NULL, 0, NI_NUMERICHOST);\n"
2328 " printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2329 " exit(EXIT_FAILURE);\n"
2333 #: build/C/man3/getifaddrs.3:294
2335 msgid " printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2336 msgstr " printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2339 #: build/C/man3/getifaddrs.3:297
2342 " } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2343 " struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2345 " } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2346 " struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2349 #: build/C/man3/getifaddrs.3:304
2352 " printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2353 " \"\\et\\ettx_bytes = %10u; rx_bytes = %10u\\en\",\n"
2354 " stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2355 " stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2359 " printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2360 " \"\\et\\ettx_bytes = %10u; rx_bytes = %10u\\en\",\n"
2361 " stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2362 " stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2367 #: build/C/man3/getifaddrs.3:308
2370 " freeifaddrs(ifaddr);\n"
2371 " exit(EXIT_SUCCESS);\n"
2374 " freeifaddrs(ifaddr);\n"
2375 " exit(EXIT_SUCCESS);\n"
2379 #: build/C/man3/getifaddrs.3:315
2381 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2383 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2386 #: build/C/man2/getsockname.2:40
2389 msgstr "GETSOCKNAME"
2392 #: build/C/man2/getsockname.2:40
2398 #: build/C/man2/getsockname.2:43
2399 msgid "getsockname - get socket name"
2400 msgstr "getsockname - ソケットの名前を取得する"
2403 #: build/C/man2/getsockname.2:49
2405 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2406 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2409 #: build/C/man2/getsockname.2:62
2411 "B<getsockname>() returns the current address to which the socket I<sockfd> "
2412 "is bound, in the buffer pointed to by I<addr>. The I<addrlen> argument "
2413 "should be initialized to indicate the amount of space (in bytes) pointed to "
2414 "by I<addr>. On return it contains the actual size of the socket address."
2416 "B<getsockname>() は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2417 "を、 I<addr> が指すバッファーに格納して返す。 I<addrlen> 引き数は、 I<addr> "
2418 "が指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数"
2419 "が返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が"
2423 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2424 #: build/C/man2/listen.2:109
2425 msgid "The argument I<sockfd> is not a valid descriptor."
2426 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2429 #: build/C/man2/getsockname.2:84
2431 "The I<addr> argument points to memory not in a valid part of the process "
2434 "引き数 I<addr> の指しているメモリーがプロセスのアドレス空間の有効な部分ではな"
2438 #: build/C/man2/getsockname.2:88
2439 msgid "I<addrlen> is invalid (e.g., is negative)."
2440 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2443 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2444 #: build/C/man2/send.2:367
2450 #: build/C/man2/getsockname.2:92
2452 "Insufficient resources were available in the system to perform the operation."
2453 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2456 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2457 msgid "The argument I<sockfd> is a file, not a socket."
2458 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2460 #. SVr4 documents additional ENOMEM
2461 #. and ENOSR error codes.
2463 #: build/C/man2/getsockname.2:103
2465 "SVr4, 4.4BSD (the B<getsockname>() function call appeared in 4.2BSD), "
2468 "SVr4, 4.4BSD (B<getsockname>() 関数は 4.2BSD で追加された), POSIX.1-2001."
2471 #: build/C/man2/getsockname.2:114
2473 "The third argument of B<getsockname>() is in reality an I<int\\ *> (and "
2474 "this is what 4.x BSD and libc4 and libc5 have). Some POSIX confusion "
2475 "resulted in the present I<socklen_t>, also used by glibc. See also "
2478 "B<getsockname>() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2479 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2480 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2) を参照のこと。"
2483 #: build/C/man2/getsockname.2:121
2485 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2488 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2492 #: build/C/man2/getsockopt.2:44
2498 #: build/C/man2/getsockopt.2:44
2504 #: build/C/man2/getsockopt.2:47
2505 msgid "getsockopt, setsockopt - get and set options on sockets"
2506 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2509 #: build/C/man2/getsockopt.2:57
2512 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2513 "B< void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2514 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2515 "B< const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2517 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2518 "B< void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2519 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2520 "B< const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2523 #: build/C/man2/getsockopt.2:67
2525 "B<getsockopt>() and B<setsockopt>() manipulate options for the socket "
2526 "referred to by the file descriptor I<sockfd>. Options may exist at multiple "
2527 "protocol levels; they are always present at the uppermost socket level."
2529 "B<getsockopt>() と B<setsockopt>() は、ファイルディスクリプター I<socket> "
2530 "で参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロ"
2531 "トコル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと"
2535 #: build/C/man2/getsockopt.2:86
2537 "When manipulating socket options, the level at which the option resides and "
2538 "the name of the option must be specified. To manipulate options at the "
2539 "sockets API level, I<level> is specified as B<SOL_SOCKET>. To manipulate "
2540 "options at any other level the protocol number of the appropriate protocol "
2541 "controlling the option is supplied. For example, to indicate that an option "
2542 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2543 "protocol number of B<TCP>; see B<getprotoent>(3)."
2545 "ソケットオプションを操作する際には、オプションの層 (level) と オプションの名"
2546 "前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2547 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2548 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2549 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2550 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2551 "B<getprotoent>(3) を参照すること。"
2554 #: build/C/man2/getsockopt.2:108
2556 "The arguments I<optval> and I<optlen> are used to access option values for "
2557 "B<setsockopt>(). For B<getsockopt>() they identify a buffer in which the "
2558 "value for the requested option(s) are to be returned. For B<getsockopt>(), "
2559 "I<optlen> is a value-result argument, initially containing the size of the "
2560 "buffer pointed to by I<optval>, and modified on return to indicate the "
2561 "actual size of the value returned. If no option value is to be supplied or "
2562 "returned, I<optval> may be NULL."
2564 "I<optval> と I<optlen> 引き数は B<setsockopt>() のオプションの値にアクセスす"
2565 "るために用いられる。 B<getsockopt>() では要求したオプションの値を返すための"
2566 "バッファーを指定する。 B<getsockopt>() では I<optlen> は値と結果両用の引き数"
2567 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2568 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2569 "I<optval> は NULL でも良い。"
2572 #: build/C/man2/getsockopt.2:118
2574 "I<Optname> and any specified options are passed uninterpreted to the "
2575 "appropriate protocol module for interpretation. The include file I<E<lt>sys/"
2576 "socket.hE<gt>> contains definitions for socket level options, described "
2577 "below. Options at other protocol levels vary in format and name; consult "
2578 "the appropriate entries in section 4 of the manual."
2580 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコルモジュー"
2581 "ルに 渡されて解釈される。インクルードファイル I<E<lt>sys/socket.hE<gt>> には"
2582 "後述のソケット層のオプションの定義が含まれている。 他のプロトコル層では名前や"
2583 "形式は異なる。 マニュアルのセクション 4 の適切なエントリーを参照すること。"
2586 #: build/C/man2/getsockopt.2:127
2588 "Most socket-level options utilize an I<int> argument for I<optval>. For "
2589 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2590 "or zero if the option is to be disabled."
2592 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2593 "B<setsockopt>() で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2594 "を指定し、 無効(disable)にするにはゼロを指定する。"
2597 #: build/C/man2/getsockopt.2:131
2599 "For a description of the available socket options see B<socket>(7) and the "
2600 "appropriate protocol man pages."
2602 "利用可能なソケットオプションの説明に関しては、 B<socket>(7) と適切なプロトコ"
2606 #: build/C/man2/getsockopt.2:152
2608 "The address pointed to by I<optval> is not in a valid part of the process "
2609 "address space. For B<getsockopt>(), this error may also be returned if "
2610 "I<optlen> is not in a valid part of the process address space."
2612 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2613 "B<getsockopt>() の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2617 #: build/C/man2/getsockopt.2:163
2619 "I<optlen> invalid in B<setsockopt>(). In some cases this error can also "
2620 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2621 "option described in B<ip>(7))."
2623 "B<setsockopt>() で I<option> が不正である。 I<optval> に無効な値が指定された"
2624 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7) に説明がある "
2625 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2628 #: build/C/man2/getsockopt.2:163
2630 msgid "B<ENOPROTOOPT>"
2631 msgstr "B<ENOPROTOOPT>"
2634 #: build/C/man2/getsockopt.2:166
2635 msgid "The option is unknown at the level indicated."
2636 msgstr "指定された層(level)にはこのオプションは存在しない。"
2638 #. SVr4 documents additional ENOMEM and ENOSR error codes, but does
2640 #. .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2643 #: build/C/man2/getsockopt.2:178
2645 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2647 "SVr4, 4.4BSD (これらのシステムコールは 4.2BSD で最初に現れた), POSIX.1-2001."
2650 #: build/C/man2/getsockopt.2:199
2652 "The I<optlen> argument of B<getsockopt>() and B<setsockopt>() is in "
2653 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have). "
2654 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2655 "glibc. See also B<accept>(2)."
2657 "B<getsockopt>() と B<setsockopt>() の I<optlen> 引き数は実際は I<int [*]> "
2658 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2659 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2660 "る。 B<accept>(2) も参照のこと。"
2663 #: build/C/man2/getsockopt.2:202
2665 "Several of the socket options should be handled at lower levels of the "
2668 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2671 #: build/C/man2/getsockopt.2:213
2673 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2674 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2676 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2677 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2680 #: build/C/man3/if_nameindex.3:26
2682 msgid "IF_NAMEINDEX"
2683 msgstr "IF_NAMEINDEX"
2686 #: build/C/man3/if_nameindex.3:26
2692 #: build/C/man3/if_nameindex.3:29
2694 "if_nameindex, if_freenameindex - get network interface names and indexes"
2696 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2700 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2702 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2703 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2706 #: build/C/man3/if_nameindex.3:35
2709 "B<struct if_nameindex *if_nameindex(void);>\n"
2710 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2712 "B<struct if_nameindex *if_nameindex(void);>\n"
2713 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2716 #: build/C/man3/if_nameindex.3:46
2718 "The B<if_nameindex>() function returns an array of I<if_nameindex> "
2719 "structures, each containing information about one of the network interfaces "
2720 "on the local system. The I<if_nameindex> structure contains at least the "
2721 "following entries:"
2723 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2724 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2725 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2728 #: build/C/man3/if_nameindex.3:51
2731 " unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2732 " char *if_name; /* Null-terminated name (\"eth0\", etc.) */\n"
2734 " unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2735 " char *if_name; /*ヌル終端された名前 (\"eth0\" など) */\n"
2738 #: build/C/man3/if_nameindex.3:65
2740 "The I<if_index> field contains the interface index. The I<ifa_name> field "
2741 "points to the null-terminated interface name. The end of the array is "
2742 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2744 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2745 "フィールドはヌル終端されたインターフェース名を指す。 配列の最後は、 "
2746 "I<if_index> が 0 で I<ifa_name> が NULL のエントリーで示される。"
2749 #: build/C/man3/if_nameindex.3:71
2751 "The data structure returned by B<if_nameindex>() is dynamically allocated "
2752 "and should be freed using B<if_freenameindex>() when no longer needed."
2754 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2755 "は B<if_freenameindex>() で解放すべきである。"
2758 #: build/C/man3/if_nameindex.3:78
2760 "On success, B<if_nameindex>() returns pointer to the array; on error, NULL "
2761 "is returned, and I<errno> is set appropriately."
2763 "成功した場合には B<if_nameindex>() は配列へのポインターを返す。エラー時には "
2764 "NULL が返され、 I<errno> が適切に設定される。"
2767 #: build/C/man3/if_nameindex.3:83
2768 msgid "B<if_nameindex>() may fail and set I<errno> if:"
2769 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2772 #: build/C/man3/if_nameindex.3:86
2773 msgid "Insufficient resources available."
2774 msgstr "利用可能なリソースが十分にない。"
2777 #: build/C/man3/if_nameindex.3:97
2779 "B<if_nameindex>() may also fail for any of the errors specified for "
2780 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2781 "B<sendto>(2), or B<malloc>(3)."
2783 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), "
2784 "B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定され"
2785 "ているエラーのいずれかで失敗する場合がある。"
2788 #: build/C/man3/if_nameindex.3:104
2790 "The B<if_nameindex>() function first appeared in glibc 2.1, but before "
2791 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2792 "addresses. Support of interfaces that don't have IPv4 addresses is "
2793 "available only on kernels that support netlink."
2795 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2796 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2797 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2798 "netlink をサポートするカーネルにおいてのみである。"
2801 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:94
2802 msgid "RFC\\ 3493, POSIX.1-2001."
2803 msgstr "RFC\\ 3493, POSIX.1-2001."
2806 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:96
2807 msgid "This function first appeared in BSDi."
2808 msgstr "この関数は BSDi 初めて登場した。"
2811 #: build/C/man3/if_nameindex.3:112
2813 "The program below demonstrates the use of the functions described on this "
2814 "page. An example of the output this program might produce is the following:"
2816 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2817 "ムが生成する出力は以下のようになる。"
2820 #: build/C/man3/if_nameindex.3:119
2834 #: build/C/man3/if_nameindex.3:127
2837 "#include E<lt>net/if.hE<gt>\n"
2838 "#include E<lt>stdio.hE<gt>\n"
2839 "#include E<lt>stdlib.hE<gt>\n"
2840 "#include E<lt>unistd.hE<gt>\n"
2842 "#include E<lt>net/if.hE<gt>\n"
2843 "#include E<lt>stdio.hE<gt>\n"
2844 "#include E<lt>stdlib.hE<gt>\n"
2845 "#include E<lt>unistd.hE<gt>\n"
2848 #: build/C/man3/if_nameindex.3:132
2852 "main(int argc, char *argv[])\n"
2854 " struct if_nameindex *if_ni, *i;\n"
2857 "main(int argc, char *argv[])\n"
2859 " struct if_nameindex *if_ni, *i;\n"
2862 #: build/C/man3/if_nameindex.3:138
2865 " if_ni = if_nameindex();\n"
2866 " if (if_ni == NULL) {\n"
2867 " perror(\"if_nameindex\");\n"
2868 " exit(EXIT_FAILURE);\n"
2871 " if_ni = if_nameindex();\n"
2872 " if (if_ni == NULL) {\n"
2873 " perror(\"if_nameindex\");\n"
2874 " exit(EXIT_FAILURE);\n"
2878 #: build/C/man3/if_nameindex.3:141
2881 " for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2882 " printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2884 " for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2885 " printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2888 #: build/C/man3/if_nameindex.3:143
2890 msgid " if_freenameindex(if_ni);\n"
2891 msgstr " if_freenameindex(if_ni);\n"
2894 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:591
2897 " exit(EXIT_SUCCESS);\n"
2900 " exit(EXIT_SUCCESS);\n"
2904 #: build/C/man3/if_nameindex.3:154
2906 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2907 "B<if_nametoindex>(3), B<ifconfig>(8)"
2909 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2910 "B<if_nametoindex>(3), B<ifconfig>(8)"
2913 #: build/C/man3/if_nametoindex.3:25
2915 msgid "IF_NAMETOINDEX"
2916 msgstr "IF_NAMETOINDEX"
2919 #: build/C/man3/if_nametoindex.3:25
2925 #: build/C/man3/if_nametoindex.3:29
2927 "if_nametoindex, if_indextoname - mappings between network interface names "
2930 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2934 #: build/C/man3/if_nametoindex.3:34
2936 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2937 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2940 #: build/C/man3/if_nametoindex.3:36
2942 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2943 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2946 #: build/C/man3/if_nametoindex.3:43
2948 "The B<if_nametoindex>() function returns the index of the network interface "
2949 "corresponding to the name I<ifname>."
2951 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2955 #: build/C/man3/if_nametoindex.3:54
2957 "The B<if_indextoname>() function returns the name of the network interface "
2958 "corresponding to the interface index I<ifindex>. The name is placed in the "
2959 "buffer pointed to by I<ifname>. The buffer must allow for the storage of at "
2960 "least B<IF_NAMESIZE> bytes."
2962 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2963 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2964 "ファーに格納される。 バッファーは少なくとも B<IF_NAMESIZE> バイトの領域が必要"
2968 #: build/C/man3/if_nametoindex.3:61
2970 "On success, B<if_nametoindex>() returns the index number of the network "
2971 "interface; on error, 0 is returned and I<errno> is set appropriately."
2973 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2974 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2977 #: build/C/man3/if_nametoindex.3:69
2979 "On success, B<if_indextoname>() returns I<ifname>; on error, NULL is "
2980 "returned and I<errno> is set appropriately."
2982 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2983 "が返され、 I<errno> が適切に設定される。"
2986 #: build/C/man3/if_nametoindex.3:74
2987 msgid "B<if_indextoname>() may fail and set I<errno> if:"
2988 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2991 #: build/C/man3/if_nametoindex.3:74
2997 #: build/C/man3/if_nametoindex.3:77
2998 msgid "No interface found for the index."
2999 msgstr "インデックスに対応するインターフェースがない。"
3002 #: build/C/man3/if_nametoindex.3:85
3004 "B<if_nametoindex>() and B<if_indextoname>() may also fail for any of the "
3005 "errors specified for B<socket>(2) or B<ioctl>(2)."
3007 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
3008 "に対して規定されているエラーのいずれかで失敗する場合がある。"
3011 #: build/C/man3/if_nametoindex.3:92
3013 "The B<if_nametoindex>() and B<if_indextoname>() functions are thread-safe."
3015 "関数 B<if_nametoindex>() と B<if_indextoname>() はスレッドセーフである。"
3018 #: build/C/man3/if_nametoindex.3:100
3019 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3020 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3023 #: build/C/man2/listen.2:45
3029 #: build/C/man2/listen.2:45
3035 #: build/C/man2/listen.2:48
3036 msgid "listen - listen for connections on a socket"
3037 msgstr "listen - ソケット(socket)上の接続を待つ"
3040 #: build/C/man2/listen.2:55
3042 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3043 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3046 #: build/C/man2/listen.2:63
3048 "B<listen>() marks the socket referred to by I<sockfd> as a passive socket, "
3049 "that is, as a socket that will be used to accept incoming connection "
3050 "requests using B<accept>(2)."
3052 "B<listen>() は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3053 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2) を使って到着"
3054 "した接続要求を受け付けるのに使用されるソケットである。"
3057 #: build/C/man2/listen.2:70
3059 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3060 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3062 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3063 "するファイルディスクリプターである。"
3066 #: build/C/man2/listen.2:82
3068 "The I<backlog> argument defines the maximum length to which the queue of "
3069 "pending connections for I<sockfd> may grow. If a connection request arrives "
3070 "when the queue is full, the client may receive an error with an indication "
3071 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3072 "the request may be ignored so that a later reattempt at connection succeeds."
3074 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3075 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3076 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3077 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3081 #: build/C/man2/listen.2:91
3082 msgid "Another socket is already listening on the same port."
3083 msgstr "別のソケットが既に同じポートを listen している。"
3086 #: build/C/man2/listen.2:114 build/C/man2/send.2:386
3087 msgid "The argument I<sockfd> is not a socket."
3088 msgstr "引き数 I<sockfd> はソケットではない。"
3091 #: build/C/man2/listen.2:119
3092 msgid "The socket is not of a type that supports the B<listen>() operation."
3093 msgstr "ソケットは B<listen>() がサポートしている型ではない。"
3096 #: build/C/man2/listen.2:124
3098 "4.4BSD, POSIX.1-2001. The B<listen>() function call first appeared in "
3100 msgstr "4.4BSD, POSIX.1-2001. B<listen>() 関数は 4.2BSDで初めて実装された。"
3103 #: build/C/man2/listen.2:126
3104 msgid "To accept connections, the following steps are performed:"
3105 msgstr "接続を受け付けるには、以下の処理が実行される。"
3108 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:347
3114 #: build/C/man2/listen.2:130
3115 msgid "A socket is created with B<socket>(2)."
3116 msgstr "B<socket>(2) でソケットを作成する。"
3119 #: build/C/man2/listen.2:130 build/C/man2/select_tut.2:356
3125 #: build/C/man2/listen.2:136
3127 "The socket is bound to a local address using B<bind>(2), so that other "
3128 "sockets may be B<connect>(2)ed to it."
3130 "B<bind>(2) を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3131 "のソケットに B<connect>(2) できるようにする。"
3134 #: build/C/man2/listen.2:136 build/C/man2/select_tut.2:360
3140 #: build/C/man2/listen.2:140
3142 "A willingness to accept incoming connections and a queue limit for incoming "
3143 "connections are specified with B<listen>()."
3145 "B<listen>() を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3149 #: build/C/man2/listen.2:140 build/C/man2/select_tut.2:367
3155 #: build/C/man2/listen.2:143
3156 msgid "Connections are accepted with B<accept>(2)."
3157 msgstr "B<accept>(2) を使って接続を受け付ける。"
3160 #: build/C/man2/listen.2:166
3162 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3163 "2.2. Now it specifies the queue length for I<completely> established "
3164 "sockets waiting to be accepted, instead of the number of incomplete "
3165 "connection requests. The maximum length of the queue for incomplete sockets "
3166 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>. When syncookies "
3167 "are enabled there is no logical maximum length and this setting is ignored. "
3168 "See B<tcp>(7) for more information."
3170 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3171 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3172 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3173 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3174 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3175 "論理的な最大長は存在せず、この設定は無視される。"
3177 #. The following is now rather historic information (MTK, Jun 05)
3178 #. Don't rely on this value in portable applications since BSD
3179 #. (and some BSD-derived systems) limit the backlog to 5.
3181 #: build/C/man2/listen.2:179
3183 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3184 "somaxconn>, then it is silently truncated to that value; the default value "
3185 "in this file is 128. In kernels before 2.4.25, this limit was a hard coded "
3186 "value, B<SOMAXCONN>, with the value 128."
3188 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3189 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3190 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3191 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3194 #: build/C/man2/listen.2:188
3195 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3196 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3199 #: build/C/man2/recv.2:41
3205 #: build/C/man2/recv.2:44
3206 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3207 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3210 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3211 #: build/C/man2/select_tut.2:47
3213 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3214 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3217 #: build/C/man2/recv.2:53
3219 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3220 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3223 #: build/C/man2/recv.2:56
3226 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3227 "B< struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3229 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3230 "B< struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3233 #: build/C/man2/recv.2:58
3235 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3236 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3239 #: build/C/man2/recv.2:70
3241 "The B<recv>(), B<recvfrom>(), and B<recvmsg>() calls are used to receive "
3242 "messages from a socket. They may be used to receive data on both "
3243 "connectionless and connection-oriented sockets. This page first describes "
3244 "common features of all three system calls, and then describes the "
3245 "differences between the calls."
3247 "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受"
3248 "け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 "
3249 "(connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら "
3250 "3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違い"
3254 #: build/C/man2/recv.2:76
3256 "All three calls return the length of the message on successful completion. "
3257 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3258 "discarded depending on the type of socket the message is received from."
3260 "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返"
3261 "す。 メッセージが長過ぎて指定されたバッファーに入り切らなかった場合には、 "
3262 "メッセージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれ"
3266 #: build/C/man2/recv.2:86
3268 "If no messages are available at the socket, the receive calls wait for a "
3269 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3270 "which case the value -1 is returned and the external variable I<errno> is "
3271 "set to B<EAGAIN> or B<EWOULDBLOCK>. The receive calls normally return any "
3272 "data available, up to the requested amount, rather than waiting for receipt "
3273 "of the full amount requested."
3275 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3276 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking) に設定されていた"
3277 "場合 (B<fcntl>(2) を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3278 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3279 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3280 "る (受信されるデータの最大サイズは要求したサイズである)。"
3283 #: build/C/man2/recv.2:93
3285 "An application can use B<select>(2), B<poll>(2), or B<epoll>(7) to "
3286 "determine when more data arrives on a socket."
3288 "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットに"
3289 "さらにデータが到着しているかを判定することができる。"
3292 #: build/C/man2/recv.2:93 build/C/man2/send.2:160
3294 msgid "The flags argument"
3298 #: build/C/man2/recv.2:97
3300 "The I<flags> argument is formed by ORing one or more of the following values:"
3302 "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指"
3306 #: build/C/man2/recv.2:97
3308 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3309 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3312 #: build/C/man2/recv.2:108
3314 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3315 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3316 "B<unix>(7)). This flag is useful for the same reasons as the B<O_CLOEXEC> "
3317 "flag of B<open>(2)."
3319 "(B<unix>(7) で説明されている) B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3320 "ファイルディスクリプター経由で受信した ファイルディスクリプターについて "
3321 "close-on-exec フラグをセットする。 このフラグは、 B<open>(2) の "
3322 "B<O_CLOEXEC> フラグと同じ理由で有用である。"
3325 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3327 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3328 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3331 #: build/C/man2/recv.2:118
3333 "Enables nonblocking operation; if the operation would block, the call fails "
3334 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3335 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3337 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3338 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2) の B<F_SETFL> "
3339 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3342 #: build/C/man2/recv.2:118
3344 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3345 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3348 #: build/C/man2/recv.2:137
3350 "This flag specifies that queued errors should be received from the socket "
3351 "error queue. The error is passed in an ancillary message with a type "
3352 "dependent on the protocol (for IPv4 B<IP_RECVERR>). The user should supply "
3353 "a buffer of sufficient size. See B<cmsg>(3) and B<ip>(7) for more "
3354 "information. The payload of the original packet that caused the error is "
3355 "passed as normal data via I<msg_iovec>. The original destination address of "
3356 "the datagram that caused the error is supplied via I<msg_name>."
3358 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3359 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3360 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3361 "ユーザーは十分なサイズのバッファーを用意しなければならない。 補助メッセージに"
3362 "関するより詳細な情報は B<cmsg>(3) および B<ip>(7) を参照のこと。 エラーの原"
3363 "因となったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータ"
3364 "として渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3365 "I<msg_name> 経由で参照できる。"
3368 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3370 "For local errors, no address is passed (this can be checked with the "
3371 "I<cmsg_len> member of the I<cmsghdr>). For error receives, the "
3372 "B<MSG_ERRQUEUE> is set in the I<msghdr>. After an error has been passed, "
3373 "the pending socket error is regenerated based on the next queued error and "
3374 "will be passed on the next socket operation."
3376 "ローカルなエラーの場合はアドレスは渡されない\n"
3377 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3378 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3379 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3380 "処理待ちのソケットエラーが再生成され、次のソケット操作の際に渡される。"
3383 #: build/C/man2/recv.2:153
3384 msgid "The error is supplied in a I<sock_extended_err> structure:"
3385 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3388 #: build/C/man2/recv.2:160
3391 "#define SO_EE_ORIGIN_NONE 0\n"
3392 "#define SO_EE_ORIGIN_LOCAL 1\n"
3393 "#define SO_EE_ORIGIN_ICMP 2\n"
3394 "#define SO_EE_ORIGIN_ICMP6 3\n"
3396 "#define SO_EE_ORIGIN_NONE 0\n"
3397 "#define SO_EE_ORIGIN_LOCAL 1\n"
3398 "#define SO_EE_ORIGIN_ICMP 2\n"
3399 "#define SO_EE_ORIGIN_ICMP6 3\n"
3402 #: build/C/man2/recv.2:172
3405 "struct sock_extended_err\n"
3407 " uint32_t ee_errno; /* error number */\n"
3408 " uint8_t ee_origin; /* where the error originated */\n"
3409 " uint8_t ee_type; /* type */\n"
3410 " uint8_t ee_code; /* code */\n"
3411 " uint8_t ee_pad; /* padding */\n"
3412 " uint32_t ee_info; /* additional information */\n"
3413 " uint32_t ee_data; /* other data */\n"
3414 " /* More data may follow */\n"
3417 "struct sock_extended_err\n"
3419 " uint32_t ee_errno; /* error number */\n"
3420 " uint8_t ee_origin; /* where the error originated */\n"
3421 " uint8_t ee_type; /* type */\n"
3422 " uint8_t ee_code; /* code */\n"
3423 " uint8_t ee_pad; /* padding */\n"
3424 " uint32_t ee_info; /* additional information */\n"
3425 " uint32_t ee_data; /* other data */\n"
3426 " /* More data may follow */\n"
3430 #: build/C/man2/recv.2:174
3432 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3433 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3436 #: build/C/man2/recv.2:198
3438 "I<ee_errno> contains the I<errno> number of the queued error. I<ee_origin> "
3439 "is the origin code of where the error originated. The other fields are "
3440 "protocol-specific. The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3441 "address of the network object where the error originated from given a "
3442 "pointer to the ancillary message. If this address is not known, the "
3443 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3444 "fields of the I<sockaddr> are undefined. The payload of the packet that "
3445 "caused the error is passed as normal data."
3447 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3448 "I<ee_origin> にはエラーが発生した場所のオリジンコード (origin code) が入って"
3449 "いる。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、こ"
3450 "の補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェク"
3451 "トのアドレスへのポインターを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3452 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3453 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3457 #: build/C/man2/recv.2:212 build/C/man2/recv.2:401 build/C/man2/send.2:230
3463 #: build/C/man2/recv.2:219
3465 "This flag requests receipt of out-of-band data that would not be received in "
3466 "the normal data stream. Some protocols place expedited data at the head of "
3467 "the normal data queue, and thus this flag cannot be used with such protocols."
3469 "このフラグは、通常のデータストリームでは受信できない 帯域外 (out-of-band) "
3470 "データの受信を要求する。 プロトコルによっては、 通常のデータキューの先頭に速"
3471 "達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3475 #: build/C/man2/recv.2:219
3478 msgstr "B<MSG_PEEK>"
3481 #: build/C/man2/recv.2:226
3483 "This flag causes the receive operation to return data from the beginning of "
3484 "the receive queue without removing that data from the queue. Thus, a "
3485 "subsequent receive call will return the same data."
3487 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3488 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3492 #: build/C/man2/recv.2:226
3494 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3495 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3498 #: build/C/man2/recv.2:234
3500 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3501 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3502 "return the real length of the packet or datagram, even when it was longer "
3503 "than the passed buffer."
3505 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3506 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3507 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファーよりも長かっ"
3508 "た場合にも、 パケットやデータグラムの実際の長さを返す。"
3511 #: build/C/man2/recv.2:237
3512 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3513 msgstr "Internet ストリームソケットでの利用については B<tcp>(7) を参照。"
3516 #: build/C/man2/recv.2:237
3518 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3519 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3522 #: build/C/man2/recv.2:245
3524 "This flag requests that the operation block until the full request is "
3525 "satisfied. However, the call may still return less data than requested if a "
3526 "signal is caught, an error or disconnect occurs, or the next data to be "
3527 "received is of a different type than that returned."
3529 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3530 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3531 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3532 "りデータが少なくても返ることがある。"
3535 #: build/C/man2/recv.2:245
3541 #: build/C/man2/recv.2:251
3543 "B<recvfrom>() places the received message into the buffer I<buf>. The "
3544 "caller must specify the size of the buffer in I<len>."
3546 "B<recvfrom>() は受信したメッセージをバッファー I<buf> に格納する。 呼び出し元"
3547 "はバッファーサイズを I<len> で指定しなければならない。"
3549 #. (Note: for datagram sockets in both the UNIX and Internet domains,
3553 #. is also filled in for stream sockets in the UNIX domain, but is not
3554 #. filled in for stream sockets in the Internet domain.)
3555 #. [The above notes on AF_UNIX and AF_INET sockets apply as at
3556 #. Kernel 2.4.18. (MTK, 22 Jul 02)]
3558 #: build/C/man2/recv.2:279
3560 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3561 "address of the message, that source address is placed in the buffer pointed "
3562 "to by I<src_addr>. In this case, I<addrlen> is a value-result argument. "
3563 "Before the call, it should be initialized to the size of the buffer "
3564 "associated with I<src_addr>. Upon return, I<addrlen> is updated to contain "
3565 "the actual size of the source address. The returned address is truncated if "
3566 "the buffer provided is too small; in this case, I<addrlen> will return a "
3567 "value greater than was supplied to the call."
3569 "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが"
3570 "分かる場合、 この送信元アドレスが I<src_addr> が指すバッファーに格納される。 "
3571 "この場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元"
3572 "は I<src_addr> に割り当てたバッファーの大きさで初期化しておくべきである。 "
3573 "返ってくる時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡"
3574 "されたバッファーが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められ"
3575 "る。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返"
3579 #: build/C/man2/recv.2:286
3581 "If the caller is not interested in the source address, I<src_addr> and "
3582 "I<addrlen> should be specified as NULL."
3584 "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> と I<addrlen> に"
3588 #: build/C/man2/recv.2:286
3594 #: build/C/man2/recv.2:294
3596 "The B<recv>() call is normally used only on a I<connected> socket (see "
3597 "B<connect>(2)). It is equivalent to the call:"
3599 "B<recv>() コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用さ"
3600 "れる (B<connect>(2) 参照)。次の呼び出しと等価である。"
3603 #: build/C/man2/recv.2:297
3605 msgid " recvfrom(fd, buf, len, flags, NULL, 0));\n"
3606 msgstr " recvfrom(fd, buf, len, flags, NULL, 0));\n"
3609 #: build/C/man2/recv.2:297
3615 #: build/C/man2/recv.2:305
3617 "The B<recvmsg>() call uses a I<msghdr> structure to minimize the number of "
3618 "directly supplied arguments. This structure is defined as follows in "
3619 "I<E<lt>sys/socket.hE<gt>>:"
3621 "B<recvmsg>() コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3622 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3625 #: build/C/man2/recv.2:312
3628 "struct iovec { /* Scatter/gather array items */\n"
3629 " void *iov_base; /* Starting address */\n"
3630 " size_t iov_len; /* Number of bytes to transfer */\n"
3633 "struct iovec { /* Scatter/gather array items */\n"
3634 " void *iov_base; /* Starting address */\n"
3635 " size_t iov_len; /* Number of bytes to transfer */\n"
3639 #: build/C/man2/recv.2:322
3643 " void *msg_name; /* optional address */\n"
3644 " socklen_t msg_namelen; /* size of address */\n"
3645 " struct iovec *msg_iov; /* scatter/gather array */\n"
3646 " size_t msg_iovlen; /* # elements in msg_iov */\n"
3647 " void *msg_control; /* ancillary data, see below */\n"
3648 " size_t msg_controllen; /* ancillary data buffer len */\n"
3649 " int msg_flags; /* flags on received message */\n"
3653 " void *msg_name; /* 追加のアドレス */\n"
3654 " socklen_t msg_namelen; /* アドレスのサイズ */\n"
3655 " struct iovec *msg_iov; /* scatter/gather 配列 */\n"
3656 " size_t msg_iovlen; /* msg_iov の要素数 */\n"
3657 " void *msg_control; /* 補助データ (後述) */\n"
3658 " size_t msg_controllen; /* 補助データバッファー長 */\n"
3659 " int msg_flags; /* 受信メッセージのフラグ */\n"
3663 #: build/C/man2/recv.2:338
3665 "The I<msg_name> field points to a caller-allocated buffer that is used to "
3666 "return the source address if the socket is unconnected. The caller should "
3667 "set I<msg_namelen> to the size of this buffer before this call; upon return "
3668 "from a successful call, I<msg_namelen> will contain the length of the "
3669 "returned address. If the application does not need to know the source "
3670 "address, I<msg_name> can be specified as NULL."
3672 "フィールド I<msg_name> は、 ソケットが接続されていない場合に送信元アドレスを"
3673 "返すのに使用されるバッファーを指す。 このバッファーは呼び出し元が確保する。 "
3674 "呼び出し元は呼び出し前に I<msg_namelen> にこのバッファーの大きさを設定しなけ"
3675 "ればならない。 呼び出しが成功した場合、呼び出しから返って来た際には "
3676 "I<msg_namelen> には返されるアドレスの長さが入っている。 アプリケーションが送"
3677 "信元アドレスを知る必要がない場合には、 I<msg_name> に NULL を指定することがで"
3681 #: build/C/man2/recv.2:345
3683 "The fields I<msg_iov> and I<msg_iovlen> describe scatter-gather locations, "
3684 "as discussed in B<readv>(2)."
3686 "I<msg_iov> と I<msg_iovlen> フィールドは scatter-gather 用の場所を指定する。 "
3687 "B<readv>(2) に説明がある。"
3690 #: build/C/man2/recv.2:360
3692 "The field I<msg_control>, which has length I<msg_controllen>, points to a "
3693 "buffer for other protocol control-related messages or miscellaneous "
3694 "ancillary data. When B<recvmsg>() is called, I<msg_controllen> should "
3695 "contain the length of the available buffer in I<msg_control>; upon return "
3696 "from a successful call it will contain the length of the control message "
3699 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3700 "御メッセージや 種々の補助データのためのバッファーへのポインターである。 "
3701 "B<recvmsg>() を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファー"
3702 "の長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の"
3706 #: build/C/man2/recv.2:362
3707 msgid "The messages are of the form:"
3708 msgstr "メッセージの形式は以下の通り:"
3711 #: build/C/man2/recv.2:372
3714 "struct cmsghdr {\n"
3715 " socklen_t cmsg_len; /* data byte count, including hdr */\n"
3716 " int cmsg_level; /* originating protocol */\n"
3717 " int cmsg_type; /* protocol-specific type */\n"
3719 " unsigned char cmsg_data[]; */\n"
3722 "struct cmsghdr {\n"
3723 " socklen_t cmsg_len; /* data byte count, including hdr */\n"
3724 " int cmsg_level; /* originating protocol */\n"
3725 " int cmsg_type; /* protocol-specific type */\n"
3727 " unsigned char cmsg_data[]; */\n"
3731 #: build/C/man2/recv.2:377
3733 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3735 "補助データは、 B<cmsg>(3) に定義されたマクロ経由でのみアクセスすべきである。"
3738 #: build/C/man2/recv.2:380
3740 "As an example, Linux uses this ancillary data mechanism to pass extended "
3741 "errors, IP options, or file descriptors over UNIX domain sockets."
3743 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3744 "での拡張エラーや IP オプション、 ファイルディスクリプターの受け渡しに利用して"
3748 #: build/C/man2/recv.2:388
3750 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>(). "
3751 "It can contain several flags:"
3753 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>() からのリターン時に設定さ"
3754 "れる。ここにはいくつかのフラグが入る。"
3757 #: build/C/man2/recv.2:388
3763 #: build/C/man2/recv.2:393
3765 "indicates end-of-record; the data returned completed a record (generally "
3766 "used with sockets of type B<SOCK_SEQPACKET>)."
3768 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3769 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3772 #: build/C/man2/recv.2:393
3774 msgid "B<MSG_TRUNC>"
3775 msgstr "B<MSG_TRUNC>"
3778 #: build/C/man2/recv.2:397
3780 "indicates that the trailing portion of a datagram was discarded because the "
3781 "datagram was larger than the buffer supplied."
3783 "データグラムが与えられたバッファーより大きかったために、 データグラムのはみ出"
3787 #: build/C/man2/recv.2:397
3789 msgid "B<MSG_CTRUNC>"
3790 msgstr "B<MSG_CTRUNC>"
3793 #: build/C/man2/recv.2:401
3795 "indicates that some control data were discarded due to lack of space in the "
3796 "buffer for ancillary data."
3798 "補助データのためのバッファーが不足したために、 制御データの一部が捨てられたこ"
3802 #: build/C/man2/recv.2:404
3804 "is returned to indicate that expedited or out-of-band data were received."
3805 msgstr "速達データや帯域外データを受信したことを示す。"
3808 #: build/C/man2/recv.2:404
3810 msgid "B<MSG_ERRQUEUE>"
3811 msgstr "B<MSG_ERRQUEUE>"
3814 #: build/C/man2/recv.2:408
3816 "indicates that no data was received but an extended error from the socket "
3819 "データは受信しなかったが ソケットのエラーキューから拡張エラーを受信したことを"
3823 #: build/C/man2/recv.2:414
3825 "These calls return the number of bytes received, or -1 if an error "
3826 "occurred. In the event of an error, I<errno> is set to indicate the error."
3828 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3832 #: build/C/man2/recv.2:417
3834 "When a stream socket peer has performed an orderly shutdown, the return "
3835 "value will be 0 (the traditional \"end-of-file\" return)."
3837 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3838 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3841 #: build/C/man2/recv.2:421
3843 "Datagram sockets in various domains (e.g., the UNIX and Internet domains) "
3844 "permit zero-length datagrams. When such a datagram is received, the return "
3847 "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメイ"
3848 "ンなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受"
3849 "信した場合、 返り値は 0 となる。"
3852 #: build/C/man2/recv.2:424
3854 "The value 0 may also be returned if the requested number of bytes to receive "
3855 "from a stream socket was 0."
3857 "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返され"
3861 #: build/C/man2/recv.2:429
3863 "These are some standard errors generated by the socket layer. Additional "
3864 "errors may be generated and returned from the underlying protocol modules; "
3865 "see their manual pages."
3867 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3868 "ルモジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照する"
3871 #. Actually EAGAIN on Linux
3873 #: build/C/man2/recv.2:438
3875 "The socket is marked nonblocking and the receive operation would block, or a "
3876 "receive timeout had been set and the timeout expired before data was "
3877 "received. POSIX.1-2001 allows either error to be returned for this case, "
3878 "and does not require these constants to have the same value, so a portable "
3879 "application should check for both possibilities."
3881 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3882 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3883 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3884 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3885 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3888 #: build/C/man2/recv.2:443
3889 msgid "The argument I<sockfd> is an invalid descriptor."
3890 msgstr "引き数 I<sockfd> が不正なディスクリプターである。"
3893 #: build/C/man2/recv.2:447
3895 "A remote host refused to allow the network connection (typically because it "
3896 "is not running the requested service)."
3898 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3899 "たサービスが起動されていないなどがある)。"
3902 #: build/C/man2/recv.2:451
3904 "The receive buffer pointer(s) point outside the process's address space."
3905 msgstr "受信バッファーへのポインターがプロセスのアドレス空間外を指している。"
3908 #: build/C/man2/recv.2:456
3910 "The receive was interrupted by delivery of a signal before any data were "
3911 "available; see B<signal>(7)."
3913 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7) 参照。"
3916 #: build/C/man2/recv.2:460 build/C/man2/send.2:355
3917 msgid "Invalid argument passed."
3918 msgstr "不正な引き数が渡された。"
3921 #: build/C/man2/recv.2:464
3922 msgid "Could not allocate memory for B<recvmsg>()."
3923 msgstr "B<recvmsg>() のためのメモリーが確保できなかった。"
3926 #: build/C/man2/recv.2:464 build/C/man2/send.2:378
3929 msgstr "B<ENOTCONN>"
3932 #: build/C/man2/recv.2:471
3934 "The socket is associated with a connection-oriented protocol and has not "
3935 "been connected (see B<connect>(2) and B<accept>(2))."
3937 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3938 "(B<connect>(2) と B<accept>(2) を参照のこと)。"
3941 #: build/C/man2/recv.2:476
3942 msgid "The argument I<sockfd> does not refer to a socket."
3943 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3946 #: build/C/man2/recv.2:479
3947 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3948 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3951 #: build/C/man2/recv.2:486
3953 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3956 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3960 #: build/C/man2/recv.2:492
3961 msgid "The I<socklen_t> type was invented by POSIX. See also B<accept>(2)."
3962 msgstr "I<socklen_t> 型は POSIX で発案された。 B<accept>(2) も参照。"
3964 #. glibc bug raised 12 Mar 2006
3965 #. http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3966 #. The problem is an underlying kernel issue: the size of the
3967 #. __kernel_size_t type used to type this field varies
3968 #. across architectures, but socklen_t is always 32 bits.
3970 #: build/C/man2/recv.2:506 build/C/man2/send.2:428
3972 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3973 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3976 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3977 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3981 #: build/C/man2/recv.2:511
3983 "See B<recvmmsg>(2) for information about a Linux-specific system call that "
3984 "can be used to receive multiple datagrams in a single call."
3986 "B<recvmmsg>(2) には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3987 "固有の システムコールに関する情報が書かれている。"
3990 #: build/C/man2/recv.2:516
3991 msgid "An example of the use of B<recvfrom>() is shown in B<getaddrinfo>(3)."
3992 msgstr "B<recvfrom>() の利用例が B<getaddrinfo>(3) に記載されている。"
3995 #: build/C/man2/recv.2:527
3997 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3998 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4000 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4001 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4004 #: build/C/man2/recvmmsg.2:31
4010 #: build/C/man2/recvmmsg.2:31
4016 #: build/C/man2/recvmmsg.2:34
4017 msgid "recvmmsg - receive multiple messages on a socket"
4018 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
4021 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
4024 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
4025 "B<#include E<lt>sys/socket.hE<gt>>\n"
4027 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
4028 "B<#include E<lt>sys/socket.hE<gt>>\n"
4031 #: build/C/man2/recvmmsg.2:41
4033 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4034 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4037 #: build/C/man2/recvmmsg.2:43
4039 msgid "B< unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4040 msgstr "B< unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4043 #: build/C/man2/recvmmsg.2:55
4045 "The B<recvmmsg>() system call is an extension of B<recvmsg>(2) that allows "
4046 "the caller to receive multiple messages from a socket using a single system "
4047 "call. (This has performance benefits for some applications.) A further "
4048 "extension over B<recvmsg>(2) is support for a timeout on the receive "
4051 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4052 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4053 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4054 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4057 #: build/C/man2/recvmmsg.2:59
4059 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4062 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプターであ"
4066 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4068 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures. "
4069 "The size of this array is specified in I<vlen>."
4071 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4075 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4076 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4078 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4081 #: build/C/man2/recvmmsg.2:80
4084 "struct mmsghdr {\n"
4085 " struct msghdr msg_hdr; /* Message header */\n"
4086 " unsigned int msg_len; /* Number of received bytes for header */\n"
4089 "struct mmsghdr {\n"
4090 " struct msghdr msg_hdr; /* メッセージヘッダー */\n"
4091 " unsigned int msg_len; /* このヘッダーで受信されたバイト数 */\n"
4095 #: build/C/man2/recvmmsg.2:95
4097 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
4098 "B<recvmsg>(2). The I<msg_len> field is the number of bytes returned for the "
4099 "message in the entry. This field has the same value as the return value of "
4100 "a single B<recvmsg>(2) on the header."
4102 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4103 "る。 I<msg_len> フィールドは、 このエントリーで返されるメッセージのバイト数"
4104 "で、 このヘッダーに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4108 #: build/C/man2/recvmmsg.2:102
4110 "The I<flags> argument contains flags ORed together. The flags are the same "
4111 "as documented for B<recvmsg>(2), with the following addition:"
4113 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4114 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4117 #: build/C/man2/recvmmsg.2:102
4119 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4120 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4123 #: build/C/man2/recvmmsg.2:107
4124 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4125 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4128 #: build/C/man2/recvmmsg.2:122
4130 "The I<timeout> argument points to a I<struct timespec> (see "
4131 "B<clock_gettime>(2)) defining a timeout (seconds plus nanoseconds) for the "
4132 "receive operation (I<but see BUGS!>). (This interval will be rounded up to "
4133 "the system clock granularity, and kernel scheduling delays mean that the "
4134 "blocking interval may overrun by a small amount.) If I<timeout> is NULL, "
4135 "then the operation blocks indefinitely."
4137 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4138 "ターで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (I<ただ"
4139 "し、バグを参照のこと>) (待ち時間はシステムクロックの粒度に切り上げられ、カー"
4140 "ネルのスケジューリング遅延により少しだけ長くなる可能性がある)。 I<timeout>が "
4141 "NULL の場合、 受信操作は無期限に停止 (block) する。"
4144 #: build/C/man2/recvmmsg.2:133
4146 "A blocking B<recvmmsg>() call blocks until I<vlen> messages have been "
4147 "received or until the timeout expires. A nonblocking call reads as many "
4148 "messages as are available (up to the limit specified by I<vlen>) and "
4149 "returns immediately."
4151 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4152 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4153 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4157 #: build/C/man2/recvmmsg.2:148
4159 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4160 "to contain information about each received message: I<msg_len> contains the "
4161 "size of the received message; the subfields of I<msg_hdr> are updated as "
4162 "described in B<recvmsg>(2). The return value of the call indicates the "
4163 "number of elements of I<msgvec> that have been updated."
4165 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4166 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4167 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4168 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4172 #: build/C/man2/recvmmsg.2:156
4174 "On success, B<recvmmsg>() returns the number of messages received in "
4175 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4178 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4179 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4182 #: build/C/man2/recvmmsg.2:160
4184 "Errors are as for B<recvmsg>(2). In addition, the following error can occur:"
4186 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4190 #: build/C/man2/recvmmsg.2:164
4191 msgid "I<timeout> is invalid."
4192 msgstr "I<timeout> が無効である。"
4195 #: build/C/man2/recvmmsg.2:169
4197 "The B<recvmmsg>() system call was added in Linux 2.6.33. Support in glibc "
4198 "was added in version 2.12."
4200 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4201 "はバージョン 2.12 以降で利用可能である。"
4204 #: build/C/man2/recvmmsg.2:172
4205 msgid "B<recvmmsg>() is Linux-specific."
4206 msgstr "B<recvmmsg>() は Linux 固有である。"
4209 #: build/C/man2/recvmmsg.2:180
4211 "The following program uses B<recvmmsg>() to receive multiple messages on a "
4212 "socket and stores them in multiple buffers. The call returns if all buffers "
4213 "are filled or if the timeout specified has expired."
4215 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4216 "し、それらを複数のバッファーに格納する。 呼び出しは、すべてのバッファーにメッ"
4217 "セージが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4220 #: build/C/man2/recvmmsg.2:183
4222 "The following snippet periodically generates UDP datagrams containing a "
4225 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4229 #: build/C/man2/recvmmsg.2:188
4232 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4233 "B<sleep 0.25; done>\n"
4235 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4236 "B<sleep 0.25; done>\n"
4239 #: build/C/man2/recvmmsg.2:193
4241 "These datagrams are read by the example application, which can give the "
4244 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4248 #: build/C/man2/recvmmsg.2:203
4252 "5 messages received\n"
4260 "5 messages received\n"
4268 #: build/C/man2/recvmmsg.2:214
4271 "#define _GNU_SOURCE\n"
4272 "#include E<lt>netinet/ip.hE<gt>\n"
4273 "#include E<lt>stdio.hE<gt>\n"
4274 "#include E<lt>stdlib.hE<gt>\n"
4275 "#include E<lt>string.hE<gt>\n"
4276 "#include E<lt>sys/socket.hE<gt>\n"
4278 "#define _GNU_SOURCE\n"
4279 "#include E<lt>netinet/ip.hE<gt>\n"
4280 "#include E<lt>stdio.hE<gt>\n"
4281 "#include E<lt>stdlib.hE<gt>\n"
4282 "#include E<lt>string.hE<gt>\n"
4283 "#include E<lt>sys/socket.hE<gt>\n"
4286 #: build/C/man2/recvmmsg.2:227
4293 "#define BUFSIZE 200\n"
4294 "#define TIMEOUT 1\n"
4295 " int sockfd, retval, i;\n"
4296 " struct sockaddr_in sa;\n"
4297 " struct mmsghdr msgs[VLEN];\n"
4298 " struct iovec iovecs[VLEN];\n"
4299 " char bufs[VLEN][BUFSIZE+1];\n"
4300 " struct timespec timeout;\n"
4306 "#define BUFSIZE 200\n"
4307 "#define TIMEOUT 1\n"
4308 " int sockfd, retval, i;\n"
4309 " struct sockaddr_in sa;\n"
4310 " struct mmsghdr msgs[VLEN];\n"
4311 " struct iovec iovecs[VLEN];\n"
4312 " char bufs[VLEN][BUFSIZE+1];\n"
4313 " struct timespec timeout;\n"
4316 #: build/C/man2/recvmmsg.2:233 build/C/man2/sendmmsg.2:201
4319 " sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4320 " if (sockfd == -1) {\n"
4321 " perror(\"socket()\");\n"
4322 " exit(EXIT_FAILURE);\n"
4325 " sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4326 " if (sockfd == -1) {\n"
4327 " perror(\"socket()\");\n"
4328 " exit(EXIT_FAILURE);\n"
4332 #: build/C/man2/recvmmsg.2:241
4335 " sa.sin_family = AF_INET;\n"
4336 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4337 " sa.sin_port = htons(1234);\n"
4338 " if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4339 " perror(\"bind()\");\n"
4340 " exit(EXIT_FAILURE);\n"
4343 " sa.sin_family = AF_INET;\n"
4344 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4345 " sa.sin_port = htons(1234);\n"
4346 " if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4347 " perror(\"bind()\");\n"
4348 " exit(EXIT_FAILURE);\n"
4352 #: build/C/man2/recvmmsg.2:249
4355 " memset(msgs, 0, sizeof(msgs));\n"
4356 " for (i = 0; i E<lt> VLEN; i++) {\n"
4357 " iovecs[i].iov_base = bufs[i];\n"
4358 " iovecs[i].iov_len = BUFSIZE;\n"
4359 " msgs[i].msg_hdr.msg_iov = &iovecs[i];\n"
4360 " msgs[i].msg_hdr.msg_iovlen = 1;\n"
4363 " memset(msgs, 0, sizeof(msgs));\n"
4364 " for (i = 0; i E<lt> VLEN; i++) {\n"
4365 " iovecs[i].iov_base = bufs[i];\n"
4366 " iovecs[i].iov_len = BUFSIZE;\n"
4367 " msgs[i].msg_hdr.msg_iov = &iovecs[i];\n"
4368 " msgs[i].msg_hdr.msg_iovlen = 1;\n"
4372 #: build/C/man2/recvmmsg.2:252
4375 " timeout.tv_sec = TIMEOUT;\n"
4376 " timeout.tv_nsec = 0;\n"
4378 " timeout.tv_sec = TIMEOUT;\n"
4379 " timeout.tv_nsec = 0;\n"
4382 #: build/C/man2/recvmmsg.2:258
4385 " retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4386 " if (retval == -1) {\n"
4387 " perror(\"recvmmsg()\");\n"
4388 " exit(EXIT_FAILURE);\n"
4391 " retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4392 " if (retval == -1) {\n"
4393 " perror(\"recvmmsg()\");\n"
4394 " exit(EXIT_FAILURE);\n"
4398 #: build/C/man2/recvmmsg.2:266
4401 " printf(\"%d messages received\\en\", retval);\n"
4402 " for (i = 0; i E<lt> retval; i++) {\n"
4403 " bufs[i][msgs[i].msg_len] = 0;\n"
4404 " printf(\"%d %s\", i+1, bufs[i]);\n"
4406 " exit(EXIT_SUCCESS);\n"
4409 " printf(\"%d messages received\\en\", retval);\n"
4410 " for (i = 0; i E<lt> retval; i++) {\n"
4411 " bufs[i][msgs[i].msg_len] = 0;\n"
4412 " printf(\"%d %s\", i+1, bufs[i]);\n"
4414 " exit(EXIT_SUCCESS);\n"
4417 #. FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=75371
4418 #. http://thread.gmane.org/gmane.linux.man/5677
4420 #: build/C/man2/recvmmsg.2:278
4422 "The I<timeout> argument does not work as intended. The timeout is checked "
4423 "only after the receipt of each datagram, so that if up to I<vlen-1> "
4424 "datagrams are received before the timeout expires, but then no further "
4425 "datagrams are received, the call will block forever."
4427 "I<timeout> 引き数は意図した通りには動作しない。 タイムアウトは各データグラム"
4428 "の受信後にのみチェックされる。 そのため、 タイムアウトが満了する前に "
4429 "I<vlen-1> 個のデータグラムを受信し、 その後全くデータグラムを受信しなかった場"
4430 "合、 呼び出しはずっと停止し続けてしまう。"
4433 #: build/C/man2/recvmmsg.2:285
4435 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4436 "B<socket>(2), B<socket>(7)"
4438 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4439 "B<socket>(2), B<socket>(7)"
4442 #: build/C/man2/select.2:38
4448 #: build/C/man2/select.2:38
4454 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4456 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4458 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4461 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4463 msgid "/* According to POSIX.1-2001 */\n"
4464 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4467 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4468 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4470 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4471 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4474 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4476 msgid "/* According to earlier standards */\n"
4477 msgstr "/* 以前の規格に従う場合 */\n"
4480 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4482 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4483 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4486 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4488 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4489 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4492 #: build/C/man2/select.2:58
4495 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4496 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4498 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4499 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4502 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4504 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4505 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4508 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4510 msgid "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4511 msgstr "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4514 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4516 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4517 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4520 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4522 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4523 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4526 #: build/C/man2/select.2:72
4529 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4530 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4531 "B< const sigset_t *>I<sigmask>B<);>\n"
4533 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4534 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4535 "B< const sigset_t *>I<sigmask>B<);>\n"
4538 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4539 #: build/C/man3/sockatmark.3:36
4541 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4542 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
4545 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4547 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4550 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4554 #: build/C/man2/select.2:93
4556 "B<select>() and B<pselect>() allow a program to monitor multiple file "
4557 "descriptors, waiting until one or more of the file descriptors become \"ready"
4558 "\" for some class of I/O operation (e.g., input possible). A file "
4559 "descriptor is considered ready if it is possible to perform a corresponding "
4560 "I/O operation (e.g., B<read>(2) without blocking, or a sufficiently small "
4563 "B<select>() や B<pselect>() を使うと、プログラムで複数のファイルディスクリ"
4564 "プターを監視し、 一つ以上のファイルディスクリプターがある種の I/O 操作の "
4565 "「ready (準備ができた)」状態 (例えば、読み込み可能になった状態) になるまで待"
4566 "つことができる。 ファイルディスクリプターが ready (準備ができた) とは、 "
4567 "(B<read>(2) などの) 対応する I/O 操作が停止 (block) なしに実行したり、 十分"
4568 "小さな B<write>(2) を実行したりできる状態にあることを意味する。"
4571 #: build/C/man2/select.2:99
4573 "The operation of B<select>() and B<pselect>() is identical, other than "
4574 "these three differences:"
4576 "B<select>() と B<pselect>() の動作は同じであるが、以下の 3 点が異なる:"
4579 #: build/C/man2/select.2:99
4585 #: build/C/man2/select.2:109
4587 "B<select>() uses a timeout that is a I<struct timeval> (with seconds and "
4588 "microseconds), while B<pselect>() uses a I<struct timespec> (with seconds "
4591 "B<select>() では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4592 "クロ秒単位) を用いる。 一方、 B<pselect>() 関数では、構造体 I<struct "
4593 "timespec> (秒・ナノ秒単位) を用いる。"
4596 #: build/C/man2/select.2:109
4602 #: build/C/man2/select.2:117
4604 "B<select>() may update the I<timeout> argument to indicate how much time "
4605 "was left. B<pselect>() does not change this argument."
4607 "B<select>() は残り時間を示す I<timeout> 引き数を更新することがある。 "
4608 "B<pselect>() はこの引き数を変更しない。"
4611 #: build/C/man2/select.2:117
4617 #: build/C/man2/select.2:126
4619 "B<select>() has no I<sigmask> argument, and behaves as B<pselect>() called "
4620 "with NULL I<sigmask>."
4622 "B<select>() は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4623 "指定した場合の B<pselect>() と同じである。"
4626 #: build/C/man2/select.2:144
4628 "Three independent sets of file descriptors are watched. Those listed in "
4629 "I<readfds> will be watched to see if characters become available for reading "
4630 "(more precisely, to see if a read will not block; in particular, a file "
4631 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4632 "watched to see if space is available for write (though a large write may "
4633 "still block), and those in I<exceptfds> will be watched for exceptions. On "
4634 "exit, the sets are modified in place to indicate which file descriptors "
4635 "actually changed status. Each of the three file descriptor sets may be "
4636 "specified as NULL if no file descriptors are to be watched for the "
4637 "corresponding class of events."
4639 "3 つの独立したファイルディスクリプター集合の監視を行う。 I<readfds> に入れら"
4640 "れたディスクリプターについては、読み込みが可能かどうかを 監視する (より正確に"
4641 "いうと、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-"
4642 "of-file) の場合も、 ファイルディスクリプターは読み込み可能として扱われる)。 "
4643 "I<writefds> に入れられたディスクリプターについては、書き込み用に利用可能な領"
4644 "域があるかを監視する (ただし、大きな書き込みの場合には停止する可能性はあ"
4645 "る)。 I<exceptfds> にあるものについては、例外の監視を行なう。システムコール終"
4646 "了時に、 どのファイルディスクリプターの状態が実際に変化したか示すために、 集"
4647 "合の内容が変更される。 ある種別のイベントを監視したいファイルディスクリプター"
4648 "が一つもない場合には、 対応するファイルディスクリプター集合に NULL を指定する"
4652 #: build/C/man2/select.2:157
4654 "Four macros are provided to manipulate the sets. B<FD_ZERO>() clears a "
4655 "set. B<FD_SET>() and B<FD_CLR>() respectively add and remove a given file "
4656 "descriptor from a set. B<FD_ISSET>() tests to see if a file descriptor is "
4657 "part of the set; this is useful after B<select>() returns."
4659 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>() は集合を消"
4660 "去する。 B<FD_SET>() と B<FD_CLR>() はそれぞれ指定したファイルディスクリプ"
4661 "ターの集合への追加、削除を行う。 B<FD_ISSET>() は集合にファイルディスクリプ"
4662 "ターがあるかどうか調べる; このマクロは B<select>() が終了した後に使うと便利"
4666 #: build/C/man2/select.2:160
4668 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4671 "I<nfds> は 3 つの集合に含まれるファイルディスクリプターの最大値に 1 を足した"
4675 #: build/C/man2/select.2:167
4677 "The I<timeout> argument specifies the interval that B<select>() should "
4678 "block waiting for a file descriptor to become ready. The call will block "
4681 "I<timeout> 引き数は、 B<select>() がファイルディスクリプターが ready になるの"
4682 "を待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
4685 #: build/C/man2/select.2:167 build/C/man2/select.2:169
4686 #: build/C/man2/select.2:171
4692 #: build/C/man2/select.2:169
4693 msgid "a file descriptor becomes ready;"
4694 msgstr "ファイルディスクリプターが利用可能になる。"
4697 #: build/C/man2/select.2:171
4698 msgid "the call is interrupted by a signal handler; or"
4699 msgstr "システムコールがシグナルハンドラーにより割り込まれた。"
4702 #: build/C/man2/select.2:173
4703 msgid "the timeout expires."
4704 msgstr "タイムアウト時間が満了した。"
4707 #: build/C/man2/select.2:190
4709 "Note that the I<timeout> interval will be rounded up to the system clock "
4710 "granularity, and kernel scheduling delays mean that the blocking interval "
4711 "may overrun by a small amount. If both fields of the I<timeval> structure "
4712 "are zero, then B<select>() returns immediately. (This is useful for "
4713 "polling.) If I<timeout> is NULL (no timeout), B<select>() can block "
4716 "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケ"
4717 "ジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 "
4718 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰す"
4719 "る (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に "
4720 "NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) "
4724 #: build/C/man2/select.2:200
4726 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4727 "not NULL, then B<pselect>() first replaces the current signal mask by the "
4728 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4729 "restores the original signal mask."
4731 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2) を参照) へのポインターであ"
4732 "る。 I<sigmask> が NULL でない場合、 B<pselect>() は I<sigmask> が指している"
4733 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4734 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4737 #: build/C/man2/select.2:206
4739 "Other than the difference in the precision of the I<timeout> argument, the "
4740 "following B<pselect>() call:"
4742 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>() の呼び出しは、"
4745 #: build/C/man2/select.2:210
4748 " ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4749 " timeout, &sigmask);\n"
4751 " ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4752 " timeout, &sigmask);\n"
4755 #: build/C/man2/select.2:215
4756 msgid "is equivalent to I<atomically> executing the following calls:"
4757 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4760 #: build/C/man2/select.2:218
4762 msgid " sigset_t origmask;\n"
4763 msgstr " sigset_t origmask;\n"
4766 #: build/C/man2/select.2:222
4769 " pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4770 " ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4771 " pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4773 " pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4774 " ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4775 " pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4778 #: build/C/man2/select.2:243
4780 "The reason that B<pselect>() is needed is that if one wants to wait for "
4781 "either a signal or for a file descriptor to become ready, then an atomic "
4782 "test is needed to prevent race conditions. (Suppose the signal handler sets "
4783 "a global flag and returns. Then a test of this global flag followed by a "
4784 "call of B<select>() could hang indefinitely if the signal arrived just "
4785 "after the test but just before the call. By contrast, B<pselect>() allows "
4786 "one to first block signals, handle the signals that have come in, then call "
4787 "B<pselect>() with the desired I<sigmask>, avoiding the race.)"
4789 "B<pselect>() が必要になる理由は、シグナルやファイルディスクリプターの状態変"
4790 "化を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる か"
4791 "らである。 (シグナルハンドラーが大域フラグを設定して戻る場合を考えてみよう。 "
4792 "この大域フラグのテストに続けて B<select>() を呼び出すと、 シグナルがテストの"
4793 "直後かつ呼び出しの直前に届いた時には B<select>() は永久にハングしてしまうか"
4794 "もしれない。 一方、 B<pselect>() を使うと、まずシグナルを禁止 (block) して、"
4795 "入ってくるシグナルを操作し、 望みの I<sigmask> で B<pselect>() を呼び出すこ"
4796 "とで、前記の競合を避けることができる。)"
4799 #: build/C/man2/select.2:243
4805 #: build/C/man2/select.2:247
4807 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4810 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4813 #: build/C/man2/select.2:254
4816 "struct timeval {\n"
4817 " long tv_sec; /* seconds */\n"
4818 " long tv_usec; /* microseconds */\n"
4821 "struct timeval {\n"
4822 " long tv_sec; /* 秒 */\n"
4823 " long tv_usec; /* マイクロ秒 */\n"
4827 #: build/C/man2/select.2:258
4832 #: build/C/man2/select.2:265
4835 "struct timespec {\n"
4836 " long tv_sec; /* seconds */\n"
4837 " long tv_nsec; /* nanoseconds */\n"
4840 "struct timespec {\n"
4841 " long tv_sec; /* 秒 */\n"
4842 " long tv_nsec; /* ナノ秒 */\n"
4846 #: build/C/man2/select.2:269
4847 msgid "(However, see below on the POSIX.1-2001 versions.)"
4849 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4853 #: build/C/man2/select.2:277
4855 "Some code calls B<select>() with all three sets empty, I<nfds> zero, and a "
4856 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4859 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4860 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>() を"
4861 "呼び出すという方法を使っているコードもある。"
4863 #. .PP - it is rumored that:
4864 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
4865 #. - it is certainly true that:
4866 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4868 #: build/C/man2/select.2:300
4870 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
4871 "slept; most other implementations do not do this. (POSIX.1-2001 permits "
4872 "either behavior.) This causes problems both when Linux code which reads "
4873 "I<timeout> is ported to other operating systems, and when code is ported to "
4874 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4875 "without reinitializing it. Consider I<timeout> to be undefined after "
4876 "B<select>() returns."
4878 "Linux では、 B<select>() は I<timeout> を変更し、残りの停止時間を反映するよ"
4879 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4880 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4881 "いる Linux のコードを他のオペレーティングシステムへ 移植する場合、問題が起こ"
4882 "る。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4883 "B<select>() を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4884 "こる。 B<select>() から復帰した後は I<timeout> は未定義であると考えるべきで"
4888 #: build/C/man2/select.2:318
4890 "On success, B<select>() and B<pselect>() return the number of file "
4891 "descriptors contained in the three returned descriptor sets (that is, the "
4892 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>) "
4893 "which may be zero if the timeout expires before anything interesting "
4894 "happens. On error, -1 is returned, and I<errno> is set to indicate the "
4895 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4898 "成功した場合、 B<select>() と B<pselect>() は更新された 3 つのディスクリプ"
4899 "ター集合に含まれている ファイルディスクリプターの数 (つまり、 I<readfds>, "
4900 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4901 "らずに時間切れになった場合、 ディスクリプターの数は 0 になることもある。 エ"
4902 "ラーならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディス"
4903 "クリプター集合は変更されず、 I<timeout> は不定となる。"
4906 #: build/C/man2/select.2:324
4908 "An invalid file descriptor was given in one of the sets. (Perhaps a file "
4909 "descriptor that was already closed, or one on which an error has occurred.)"
4911 "いずれかの集合に無効なファイルディスクリプターが指定された (おそらくは、すで"
4912 "にクローズされたファイルディスクリプターか、 エラーが発生したファイルディスク"
4916 #: build/C/man2/select.2:328
4917 msgid "A signal was caught; see B<signal>(7)."
4921 #: build/C/man2/select.2:335
4923 "I<nfds> is negative or exceeds the B<RLIMIT_NOFILE> resource limit (see "
4926 "I<nfds> が負、 またはリソース上限 B<RLIMIT_NOFILE> (B<getrlimit>(2) 参照) よ"
4930 #: build/C/man2/select.2:340
4931 msgid "the value contained within I<timeout> is invalid."
4932 msgstr "I<timeout> に入っている値が不正である。"
4935 #: build/C/man2/select.2:343
4936 msgid "unable to allocate memory for internal tables."
4937 msgstr "内部テーブルにメモリーを割り当てることができなかった。"
4940 #: build/C/man2/select.2:349
4942 "B<pselect>() was added to Linux in kernel 2.6.16. Prior to this, "
4943 "B<pselect>() was emulated in glibc (but see BUGS)."
4945 "B<pselect>() はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4946 "B<pselect>() は glibc でエミュレートされていた (「バグ」の章を参照)。"
4949 #: build/C/man2/select.2:360
4951 "B<select>() conforms to POSIX.1-2001 and 4.4BSD (B<select>() first "
4952 "appeared in 4.2BSD). Generally portable to/from non-BSD systems supporting "
4953 "clones of the BSD socket layer (including System\\ V variants). However, "
4954 "note that the System\\ V variant typically sets the timeout variable before "
4955 "exit, but the BSD variant does not."
4957 "B<select>() は POSIX.1-2001 と 4.4BSD (B<select>() は 4.2BSD で最初に登場し"
4958 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4959 "(System\\ V 系も含む) との間でだいたい移植性がある。しかし System\\ V 系では "
4960 "たいがい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注"
4964 #: build/C/man2/select.2:364
4965 msgid "B<pselect>() is defined in POSIX.1g, and in POSIX.1-2001."
4966 msgstr "B<pselect>() は POSIX.1g と POSIX.1-2001 で定義されている。"
4969 #: build/C/man2/select.2:381
4971 "An I<fd_set> is a fixed size buffer. Executing B<FD_CLR>() or B<FD_SET>() "
4972 "with a value of I<fd> that is negative or is equal to or larger than "
4973 "B<FD_SETSIZE> will result in undefined behavior. Moreover, POSIX requires "
4974 "I<fd> to be a valid file descriptor."
4976 "I<fd_set> は固定サイズのバッファーである。 負や B<FD_SETSIZE> 以上の値を持つ "
4977 "I<fd> に対して B<FD_CLR>() や B<FD_SET>() を実行した場合、 どのような動作を"
4978 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4979 "プターでなければならないと規定されている。"
4982 #: build/C/man2/select.2:390
4984 "Concerning the types involved, the classical situation is that the two "
4985 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4986 "the structure is defined in I<E<lt>sys/time.hE<gt>>. The POSIX.1-2001 "
4989 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4990 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4991 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4994 #: build/C/man2/select.2:397
4997 "struct timeval {\n"
4998 " time_t tv_sec; /* seconds */\n"
4999 " suseconds_t tv_usec; /* microseconds */\n"
5002 "struct timeval {\n"
5003 "\t time_t tv_sec; /* 秒 */\n"
5004 "\t suseconds_t tv_usec; /* マイクロ秒 */\n"
5008 #: build/C/man2/select.2:408
5010 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
5011 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
5013 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
5014 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
5017 #: build/C/man2/select.2:420
5019 "Concerning prototypes, the classical situation is that one should include "
5020 "I<E<lt>time.hE<gt>> for B<select>(). The POSIX.1-2001 situation is that one "
5021 "should include I<E<lt>sys/select.hE<gt>> for B<select>() and B<pselect>()."
5023 "プロトタイプに関しては、昔ながらの状況で B<select>() を使いたい場合は、 "
5024 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
5025 "B<select>() と B<pselect>() を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
5029 #: build/C/man2/select.2:431
5031 "Under glibc 2.0, I<E<lt>sys/select.hE<gt>> gives the wrong prototype for "
5032 "B<pselect>(). Under glibc 2.1 to 2.2.1, it gives B<pselect>() when "
5033 "B<_GNU_SOURCE> is defined. Since glibc 2.2.2, the requirements are as shown "
5036 "glibc 2.0 では I<E<lt>sys/select.hE<gt>> が提供する B<pselect>() のプロトタ"
5037 "イプが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されてい"
5038 "る場合に、 B<pselect>() が提供される。 glibc 2.2.2 以降では、 B<pselect>() "
5039 "を使用するには、「書式」に記載された要件を満たす必要がある。"
5042 #: build/C/man2/select.2:431
5044 msgid "Multithreaded applications"
5045 msgstr "マルチスレッドアプリケーション"
5048 #: build/C/man2/select.2:448
5050 "If a file descriptor being monitored by B<select>() is closed in another "
5051 "thread, the result is unspecified. On some UNIX systems, B<select>() "
5052 "unblocks and returns, with an indication that the file descriptor is ready "
5053 "(a subsequent I/O operation will likely fail with an error, unless another "
5054 "the file descriptor reopened between the time B<select>() returned and the "
5055 "I/O operations was performed). On Linux (and some other systems), closing "
5056 "the file descriptor in another thread has no effect on B<select>(). In "
5057 "summary, any application that relies on a particular behavior in this "
5058 "scenario must be considered buggy."
5060 "B<select>() で監視中のファイルディスクリプターが別のスレッドでクローズされた"
5061 "場合、どのような結果になるかは規定されていない。いくつかの UNIX システムで"
5062 "は、 B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプターが "
5063 "ready だと報告される (B<select>() が返ってから I/O 操作が実行されるまでの間"
5064 "に、 別のファイルディスクリプターが再度オープンされない限り、 それ以降の I/O "
5065 "操作はおそらく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別の"
5066 "スレッドでファイルディスクリプターがクローズされても B<select>() には影響を与"
5067 "えない。 まとめると、このような場合に特定の動作に依存しているアプリケーション"
5068 "は「バグっている」と考えなければならない。"
5071 #: build/C/man2/select.2:448
5073 msgid "C library/kernel ABI differences"
5074 msgstr "C ライブラリとカーネル ABI の違い"
5077 #: build/C/man2/select.2:456
5079 "The B<pselect>() interface described in this page is implemented by glibc. "
5080 "The underlying Linux system call is named B<pselect6>(). This system call "
5081 "has somewhat different behavior from the glibc wrapper function."
5083 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5084 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5085 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5089 #: build/C/man2/select.2:471
5091 "The Linux B<pselect6>() system call modifies its I<timeout> argument. "
5092 "However, the glibc wrapper function hides this behavior by using a local "
5093 "variable for the timeout argument that is passed to the system call. Thus, "
5094 "the glibc B<pselect>() function does not modify its I<timeout> argument; "
5095 "this is the behavior required by POSIX.1-2001."
5097 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5098 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5099 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5100 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5101 "これが POSIX.1-2001 が要求している動作である。"
5104 #: build/C/man2/select.2:477
5106 "The final argument of the B<pselect6>() system call is not a I<sigset_t\\ "
5107 "*> pointer, but is instead a structure of the form:"
5109 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5110 "ポインターではなく、以下に示す構造体である。"
5113 #: build/C/man2/select.2:485
5117 " const sigset_t *ss; /* Pointer to signal set */\n"
5118 " size_t ss_len; /* Size (in bytes) of object pointed\n"
5123 " const sigset_t *ss; /* シグナル集合へのポインター */\n"
5124 " size_t ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5129 #: build/C/man2/select.2:492
5131 "This allows the system call to obtain both a pointer to the signal set and "
5132 "its size, while allowing for the fact that most architectures support a "
5133 "maximum of 6 arguments to a system call."
5135 "このようにすることで、ほとんどのアーキテクチャーがサポートしている\n"
5136 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5137 "B<pselect6>() システムコールがシグナル集合へのポインターとシグナル集合\n"
5138 "のサイズの両方を取得することができるのである。"
5141 #: build/C/man2/select.2:498
5143 "Glibc 2.0 provided a version of B<pselect>() that did not take a I<sigmask> "
5146 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>() が提供"
5150 #: build/C/man2/select.2:511
5152 "Starting with version 2.1, glibc provided an emulation of B<pselect>() that "
5153 "was implemented using B<sigprocmask>(2) and B<select>(). This "
5154 "implementation remained vulnerable to the very race condition that "
5155 "B<pselect>() was designed to prevent. Modern versions of glibc use the "
5156 "(race-free) B<pselect>() system call on kernels where it is provided."
5158 "バージョン 2.1 以降の glibc では、 B<pselect>() は B<sigprocmask>(2) と "
5159 "B<select>() を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5160 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5161 "B<pselect>() は設計されたのである。 最近のバージョンの glibc では、カーネル"
5162 "がサポートしている場合には、 (競合が起こらない) B<pselect>() システムコール"
5166 #: build/C/man2/select.2:524
5168 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5169 "trapping can be achieved using the self-pipe trick. In this technique, a "
5170 "signal handler writes a byte to a pipe whose other end is monitored by "
5171 "B<select>() in the main program. (To avoid possibly blocking when writing "
5172 "to a pipe that may be full or reading from a pipe that may be empty, "
5173 "nonblocking I/O is used when reading from and writing to the pipe.)"
5175 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5176 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5177 "この方法では、シグナルハンドラーはパイプへ 1 バイトのデータを書き込み、\n"
5178 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5179 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5180 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5181 "(nonblocking) I/O を使用するとよい)。"
5183 #. Stevens discusses a case where accept can block after select
5184 #. returns successfully because of an intervening RST from the client.
5185 #. Maybe the kernel should have returned EIO in such a situation?
5187 #: build/C/man2/select.2:540
5189 "Under Linux, B<select>() may report a socket file descriptor as \"ready for "
5190 "reading\", while nevertheless a subsequent read blocks. This could for "
5191 "example happen when data has arrived but upon examination has wrong checksum "
5192 "and is discarded. There may be other circumstances in which a file "
5193 "descriptor is spuriously reported as ready. Thus it may be safer to use "
5194 "B<O_NONBLOCK> on sockets that should not block."
5196 "Linux では、 B<select>() がソケットファイルディスクリプターで \"読み込みの準"
5197 "備ができた\" と報告した場合でも、 この後で read を行うと停止 (block) すること"
5198 "がある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常"
5199 "が見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプターが準備"
5200 "できたと間違って 報告される状況が起こるかもしれない。 したがって、停止すべき"
5201 "ではないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5204 #: build/C/man2/select.2:555
5206 "On Linux, B<select>() also modifies I<timeout> if the call is interrupted "
5207 "by a signal handler (i.e., the B<EINTR> error return). This is not "
5208 "permitted by POSIX.1-2001. The Linux B<pselect>() system call has the same "
5209 "behavior, but the glibc wrapper hides this behavior by internally copying "
5210 "the I<timeout> to a local variable and passing that variable to the system "
5213 "Linux では、 B<select>() がシグナルハンドラーにより割り込まれた場合 (つまり "
5214 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5215 "認められていない挙動である。 Linux の B<pselect>() システムコールも同じ挙動"
5216 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5217 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5221 #: build/C/man2/select.2:562
5224 "#include E<lt>stdio.hE<gt>\n"
5225 "#include E<lt>stdlib.hE<gt>\n"
5226 "#include E<lt>sys/time.hE<gt>\n"
5227 "#include E<lt>sys/types.hE<gt>\n"
5228 "#include E<lt>unistd.hE<gt>\n"
5230 "#include E<lt>stdio.hE<gt>\n"
5231 "#include E<lt>stdlib.hE<gt>\n"
5232 "#include E<lt>sys/time.hE<gt>\n"
5233 "#include E<lt>sys/types.hE<gt>\n"
5234 "#include E<lt>unistd.hE<gt>\n"
5237 #: build/C/man2/select.2:569
5244 " struct timeval tv;\n"
5251 " struct timeval tv;\n"
5255 #: build/C/man2/select.2:573
5258 " /* Watch stdin (fd 0) to see when it has input. */\n"
5259 " FD_ZERO(&rfds);\n"
5260 " FD_SET(0, &rfds);\n"
5262 " /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5263 " FD_ZERO(&rfds);\n"
5264 " FD_SET(0, &rfds);\n"
5267 #: build/C/man2/select.2:577
5270 " /* Wait up to five seconds. */\n"
5272 " tv.tv_usec = 0;\n"
5276 " tv.tv_usec = 0;\n"
5279 #: build/C/man2/select.2:580
5282 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
5283 " /* Don't rely on the value of tv now! */\n"
5285 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
5286 " /* この時点での tv の値を信頼してはならない。*/\n"
5289 #: build/C/man2/select.2:588
5292 " if (retval == -1)\n"
5293 " perror(\"select()\");\n"
5294 " else if (retval)\n"
5295 " printf(\"Data is available now.\\en\");\n"
5296 " /* FD_ISSET(0, &rfds) will be true. */\n"
5298 " printf(\"No data within five seconds.\\en\");\n"
5300 " if (retval == -1)\n"
5301 "\tperror(\"select()\");\n"
5302 " else if (retval)\n"
5303 " printf(\"今、データが取得できました。\\en\");\n"
5304 " /* FD_ISSET(0, &rfds) が true になる。*/\n"
5306 " printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5309 #: build/C/man2/select.2:604
5311 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
5312 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
5313 "B<epoll>(7), B<time>(7)"
5315 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
5316 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
5317 "B<epoll>(7), B<time>(7)"
5320 #: build/C/man2/select.2:607
5321 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5323 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2) がある。"
5326 #: build/C/man2/select_tut.2:32
5332 #: build/C/man2/select_tut.2:32
5338 #: build/C/man2/select_tut.2:52
5341 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5342 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5344 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5345 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5348 #: build/C/man2/select_tut.2:66
5351 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5352 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5353 "B< const sigset_t *>I<sigmask>B<);>\n"
5355 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5356 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5357 "B< const sigset_t *>I<sigmask>B<);>\n"
5360 #: build/C/man2/select_tut.2:83
5362 "B<select>() (or B<pselect>()) is used to efficiently monitor multiple file "
5363 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5364 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5365 "occurred on any of the descriptors."
5367 "B<select>() (や B<pselect>()) を使うと、効率的に複数のファイルディスクリプ"
5368 "ターを監視し、 そのファイルディスクリプターのいずれかが 「ready (準備ができ"
5369 "た)」状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプ"
5370 "ターのいずれかが 「例外状態 (exceptional condition)」が発生したか、を調べるこ"
5374 #: build/C/man2/select_tut.2:108
5376 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5377 "I<writefds>, and I<exceptfds>. Each set is declared as type I<fd_set>, and "
5378 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5379 "B<FD_SET>(), and B<FD_ZERO>(). A newly declared set should first be cleared "
5380 "using B<FD_ZERO>(). B<select>() modifies the contents of the sets "
5381 "according to the rules described below; after calling B<select>() you can "
5382 "test if a file descriptor is still present in a set with the B<FD_ISSET>() "
5383 "macro. B<FD_ISSET>() returns nonzero if a specified file descriptor is "
5384 "present in a set and zero if it is not. B<FD_CLR>() removes a file "
5385 "descriptor from a set."
5387 "この関数の主要な引き数は、3種類のファイルディスクリプターの「集合」 "
5388 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5389 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>() "
5390 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5391 "B<FD_ZERO>() を使ってクリアすべきである。 B<select>() はこれらの集合の内容"
5392 "を、以降に述べる規則に従って修正する。 B<select>() を呼んだ後、ファイルディ"
5393 "スクリプターがまだ集合に存在しているかどうかは、 B<FD_ISSET>() マクロによっ"
5394 "て調べることができる。 B<FD_ISSET>() は指定されたディスクリプターが集合に存"
5395 "在していれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>() は集合"
5396 "からのファイルディスクリプターの削除を行う。"
5399 #: build/C/man2/select_tut.2:108
5405 #: build/C/man2/select_tut.2:109
5411 #: build/C/man2/select_tut.2:118
5413 "This set is watched to see if data is available for reading from any of its "
5414 "file descriptors. After B<select>() has returned, I<readfds> will be "
5415 "cleared of all file descriptors except for those that are immediately "
5416 "available for reading."
5418 "この集合に含まれるいずれかのファイルディスクリプターで、 データの読み込みが可"
5419 "能になったかどうかを監視する。 B<select>() から戻る時に、I<readfds> のう"
5420 "ち、 直ちに読み込み可能なファイルディスクリプター以外は 集合から削除される。"
5423 #: build/C/man2/select_tut.2:118
5426 msgstr "I<writefds>"
5429 #: build/C/man2/select_tut.2:127
5431 "This set is watched to see if there is space to write data to any of its "
5432 "file descriptors. After B<select>() has returned, I<writefds> will be "
5433 "cleared of all file descriptors except for those that are immediately "
5434 "available for writing."
5436 "この集合に含まれるいずれかのファイルディスクリプターで、 データを書き込むス"
5437 "ペースがあるかどうかを監視する。 B<select>() から戻る時に、I<writefds> のう"
5438 "ち、 直ちに書き込み可能なファイルディスクリプター以外は 集合から削除される。"
5441 #: build/C/man2/select_tut.2:127
5443 msgid "I<exceptfds>"
5444 msgstr "I<exceptfds>"
5447 #: build/C/man2/select_tut.2:149
5449 "This set is watched for \"exceptional conditions\". In practice, only one "
5450 "such exceptional condition is common: the availability of I<out-of-band> "
5451 "(OOB) data for reading from a TCP socket. See B<recv>(2), B<send>(2), and "
5452 "B<tcp>(7) for more details about OOB data. (One other less common case "
5453 "where B<select>(2) indicates an exceptional condition occurs with "
5454 "pseudoterminals in packet mode; see B<tty_ioctl>(4).) After B<select>() "
5455 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5456 "for those for which an exceptional condition has occurred."
5458 "この集合に含まれるいずれかのファイルディスクリプターで、 「例外状態 "
5459 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5460 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5461 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5462 "は、 B<recv>(2), B<send>(2), B<tcp>(7) を参照のこと。 (これ以外では、まれな"
5463 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>() が例外"
5464 "状態を示すことがある。) B<select>() が返る時に、I<exceptfds> のうち、 例外"
5465 "状態が発生したディスクリプター以外は集合から削除される。"
5468 #: build/C/man2/select_tut.2:149
5474 #: build/C/man2/select_tut.2:156
5476 "This is an integer one more than the maximum of any file descriptor in any "
5477 "of the sets. In other words, while adding file descriptors to each of the "
5478 "sets, you must calculate the maximum integer value of all of them, then "
5479 "increment this value by one, and then pass this as I<nfds>."
5481 "全ての集合に含まれるファイルディスクリプターのうち、 値が最大のものに 1 を足"
5482 "した整数である。 すなわち、ファイルディスクリプターを各集合に加える作業の途中"
5483 "で、 全てのファイルディスクリプターを見て最大値を求め、 それに 1 を加えて "
5484 "I<nfds> として渡さないといけない、ということだ。"
5487 #: build/C/man2/select_tut.2:156
5490 msgstr "I<utimeout>"
5493 #: build/C/man2/select_tut.2:169
5495 "This is the longest time B<select>() may wait before returning, even if "
5496 "nothing interesting happened. If this value is passed as NULL, then "
5497 "B<select>() blocks indefinitely waiting for a file descriptor to become "
5498 "ready. I<utimeout> can be set to zero seconds, which causes B<select>() to "
5499 "return immediately, with information about the readiness of file descriptors "
5500 "at the time of the call. The structure I<struct timeval> is defined as:"
5502 "(何も起こらなかった場合に) B<select>() が戻る前に待つ最大時間である。 この"
5503 "値に NULL を渡すと、 B<select>() はファイルディスクリプターのいずれかが "
5504 "ready (準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> "
5505 "は 0 秒にすることもでき、 この場合 B<select>() は直ちに返り、呼び出し時点の"
5506 "ファイルディスクリプターの状態に 関する情報が返される。 構造体 I<struct "
5507 "timeval> は次のように定義されている:"
5510 #: build/C/man2/select_tut.2:176
5513 "struct timeval {\n"
5514 " time_t tv_sec; /* seconds */\n"
5515 " long tv_usec; /* microseconds */\n"
5518 "struct timeval {\n"
5519 " time_t tv_sec; /* seconds */\n"
5520 " long tv_usec; /* microseconds */\n"
5524 #: build/C/man2/select_tut.2:178
5527 msgstr "I<ntimeout>"
5530 #: build/C/man2/select_tut.2:187
5532 "This argument for B<pselect>() has the same meaning as I<utimeout>, but "
5533 "I<struct timespec> has nanosecond precision as follows:"
5535 "B<pselect>() のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5536 "timespec> は次に示すようにナノ秒の精度を持つ。"
5539 #: build/C/man2/select_tut.2:194
5542 "struct timespec {\n"
5543 " long tv_sec; /* seconds */\n"
5544 " long tv_nsec; /* nanoseconds */\n"
5547 "struct timespec {\n"
5548 " long tv_sec; /* seconds */\n"
5549 " long tv_nsec; /* nanoseconds */\n"
5553 #: build/C/man2/select_tut.2:196
5559 #: build/C/man2/select_tut.2:213
5561 "This argument holds a set of signals that the kernel should unblock (i.e., "
5562 "remove from the signal mask of the calling thread), while the caller is "
5563 "blocked inside the B<pselect>() call (see B<sigaddset>(3) and "
5564 "B<sigprocmask>(2)). It may be NULL, in which case the call does not modify "
5565 "the signal mask on entry and exit to the function. In this case, "
5566 "B<pselect>() will then behave just like B<select>()."
5568 "この引き数は、呼び出し側が B<pselect>() 内部で停止している間に、カーネルが通"
5569 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5570 "削除すべきシグナル集合) を保持する (B<sigaddset>(3) と B<sigprocmask>(2) "
5571 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5572 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>() は "
5573 "B<select>() と全く同じ動作となる。"
5576 #: build/C/man2/select_tut.2:213
5578 msgid "Combining signal and data events"
5579 msgstr "シグナルとデータイベントを組み合わせる"
5582 #: build/C/man2/select_tut.2:257
5585 #| "B<pselect>() is useful if you are waiting for a signal as well as for "
5586 #| "file descriptor(s) to become ready for I/O. Programs that receive "
5587 #| "signals normally use the signal handler only to raise a global flag. The "
5588 #| "global flag will indicate that the event must be processed in the main "
5589 #| "loop of the program. A signal will cause the B<select>() (or "
5590 #| "B<pselect>()) call to return with I<errno> set to B<EINTR>. This "
5591 #| "behavior is essential so that signals can be processed in the main loop "
5592 #| "of the program, otherwise B<select>() would block indefinitely. Now, "
5593 #| "somewhere in the main loop will be a conditional to check the global "
5594 #| "flag. So we must ask: what if a signal arrives after the conditional, "
5595 #| "but before the B<select>() call? The answer is that B<select>() would "
5596 #| "block indefinitely, even though an event is actually pending. This race "
5597 #| "condition is solved by the B<pselect>() call. This call can be used to "
5598 #| "set the signal mask to a set of signals that are only to be received "
5599 #| "within the B<pselect>() call. For instance, let us say that the event "
5600 #| "in question was the exit of a child process. Before the start of the "
5601 #| "main loop, we would block B<SIGCHLD> using B<sigprocmask>(2). Our "
5602 #| "B<pselect>() call would enable B<SIGCHLD> by using an empty signal "
5603 #| "mask. Our program would look like:"
5605 "B<pselect>() is useful if you are waiting for a signal as well as for file "
5606 "descriptor(s) to become ready for I/O. Programs that receive signals "
5607 "normally use the signal handler only to raise a global flag. The global "
5608 "flag will indicate that the event must be processed in the main loop of the "
5609 "program. A signal will cause the B<select>() (or B<pselect>()) call to "
5610 "return with I<errno> set to B<EINTR>. This behavior is essential so that "
5611 "signals can be processed in the main loop of the program, otherwise "
5612 "B<select>() would block indefinitely. Now, somewhere in the main loop will "
5613 "be a conditional to check the global flag. So we must ask: what if a signal "
5614 "arrives after the conditional, but before the B<select>() call? The answer "
5615 "is that B<select>() would block indefinitely, even though an event is "
5616 "actually pending. This race condition is solved by the B<pselect>() call. "
5617 "This call can be used to set the signal mask to a set of signals that are to "
5618 "be received only within the B<pselect>() call. For instance, let us say "
5619 "that the event in question was the exit of a child process. Before the "
5620 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2). "
5621 "Our B<pselect>() call would enable B<SIGCHLD> by using an empty signal "
5622 "mask. Our program would look like:"
5624 "ファイルディスクリプターが I/O 可能な状態になるのと同時に シグナルも待ちたい"
5625 "場合には、 B<pselect>() が便利である。 シグナルを受信するプログラムは、通常"
5626 "は、 シグナルハンドラーをグローバルなフラグを立てるためだけに使う。 このグ"
5627 "ローバルなフラグは、 そのイベントをプログラムのメインループで 処理しなければ"
5628 "ならないことを示す。 シグナルを受けると B<select>() (や B<pselect>()) は "
5629 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5630 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>() は"
5631 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5632 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5633 "「シグナルが条件文の後、しかし B<select>() コールの前に到着したら どうなるの"
5634 "か?」 答えは「その B<select>() は、たとえ解決待ちのイベントがあったとして"
5635 "も、 永遠に停止する」である。 この競合状態は B<pselect>() コールによって解決"
5636 "できる。 このコールを使うと、 B<pselect>() で受信したいシグナルの集合だけを"
5637 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5638 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5639 "B<sigprocmask>(2) でブロックする。 B<pselect>() コールでは B<SIGCHLD> を、"
5640 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5644 #: build/C/man2/select_tut.2:260
5646 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5647 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5650 #: build/C/man2/select_tut.2:266
5654 "child_sig_handler(int sig)\n"
5656 " got_SIGCHLD = 1;\n"
5660 "child_sig_handler(int sig)\n"
5662 " got_SIGCHLD = 1;\n"
5666 #: build/C/man2/select_tut.2:274
5670 "main(int argc, char *argv[])\n"
5672 " sigset_t sigmask, empty_mask;\n"
5673 " struct sigaction sa;\n"
5674 " fd_set readfds, writefds, exceptfds;\n"
5678 "main(int argc, char *argv[])\n"
5680 " sigset_t sigmask, empty_mask;\n"
5681 " struct sigaction sa;\n"
5682 " fd_set readfds, writefds, exceptfds;\n"
5686 #: build/C/man2/select_tut.2:281
5689 " sigemptyset(&sigmask);\n"
5690 " sigaddset(&sigmask, SIGCHLD);\n"
5691 " if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5692 " perror(\"sigprocmask\");\n"
5693 " exit(EXIT_FAILURE);\n"
5696 " sigemptyset(&sigmask);\n"
5697 " sigaddset(&sigmask, SIGCHLD);\n"
5698 " if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5699 " perror(\"sigprocmask\");\n"
5700 " exit(EXIT_FAILURE);\n"
5704 #: build/C/man2/select_tut.2:289
5707 " sa.sa_flags = 0;\n"
5708 " sa.sa_handler = child_sig_handler;\n"
5709 " sigemptyset(&sa.sa_mask);\n"
5710 " if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5711 " perror(\"sigaction\");\n"
5712 " exit(EXIT_FAILURE);\n"
5715 " sa.sa_flags = 0;\n"
5716 " sa.sa_handler = child_sig_handler;\n"
5717 " sigemptyset(&sa.sa_mask);\n"
5718 " if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5719 " perror(\"sigaction\");\n"
5720 " exit(EXIT_FAILURE);\n"
5724 #: build/C/man2/select_tut.2:291
5726 msgid " sigemptyset(&empty_mask);\n"
5727 msgstr " sigemptyset(&empty_mask);\n"
5730 #: build/C/man2/select_tut.2:295
5733 " for (;;) { /* main loop */\n"
5734 " /* Initialize readfds, writefds, and exceptfds\n"
5735 " before the pselect() call. (Code omitted.) */\n"
5737 " for (;;) { /* main loop */\n"
5738 " /* Initialize readfds, writefds, and exceptfds\n"
5739 " before the pselect() call. (Code omitted.) */\n"
5742 #: build/C/man2/select_tut.2:301
5745 " r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5746 " NULL, &empty_mask);\n"
5747 " if (r == -1 && errno != EINTR) {\n"
5748 " /* Handle error */\n"
5751 " r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5752 " NULL, &empty_mask);\n"
5753 " if (r == -1 && errno != EINTR) {\n"
5754 " /* Handle error */\n"
5758 #: build/C/man2/select_tut.2:304
5761 " if (got_SIGCHLD) {\n"
5762 " got_SIGCHLD = 0;\n"
5764 " if (got_SIGCHLD) {\n"
5765 " got_SIGCHLD = 0;\n"
5768 #: build/C/man2/select_tut.2:308
5771 " /* Handle signalled event here; e.g., wait() for all\n"
5772 " terminated children. (Code omitted.) */\n"
5775 " /* Handle signalled event here; e.g., wait() for all\n"
5776 " terminated children. (Code omitted.) */\n"
5780 #: build/C/man2/select_tut.2:312
5783 " /* main body of program */\n"
5787 " /* main body of program */\n"
5792 #: build/C/man2/select_tut.2:313
5798 #: build/C/man2/select_tut.2:334
5800 "So what is the point of B<select>()? Can't I just read and write to my "
5801 "descriptors whenever I want? The point of B<select>() is that it watches "
5802 "multiple descriptors at the same time and properly puts the process to sleep "
5803 "if there is no activity. UNIX programmers often find themselves in a "
5804 "position where they have to handle I/O from more than one file descriptor "
5805 "where the data flow may be intermittent. If you were to merely create a "
5806 "sequence of B<read>(2) and B<write>(2) calls, you would find that one of "
5807 "your calls may block waiting for data from/to a file descriptor, while "
5808 "another file descriptor is unused though ready for I/O. B<select>() "
5809 "efficiently copes with this situation."
5811 "実際のところ B<select>() の大事な点は何なのか? ディスクリプターは好きなとき"
5812 "に読み書きできるんじゃないの? B<select>() の重要なところは、複数のディスク"
5813 "リプターを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に"
5814 "移行するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプター"
5815 "の入出力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況"
5816 "によく出会う。 単に B<read>(2) や B<write>(2) コールのシーケンスを作るだけ"
5817 "では、それらのコールのどれかが ファイルディスクリプターからのデータを待ってブ"
5818 "ロックしており、 別のファイルディスクリプターには I/O が可能なのに使えない、 "
5819 "ということになってしまうだろう。 B<select>() を使うとこの状況に効果的に対処"
5823 #: build/C/man2/select_tut.2:334
5829 #: build/C/man2/select_tut.2:347
5831 "Many people who try to use B<select>() come across behavior that is "
5832 "difficult to understand and produces nonportable or borderline results. For "
5833 "instance, the above program is carefully written not to block at any point, "
5834 "even though it does not set its file descriptors to nonblocking mode. It is "
5835 "easy to introduce subtle errors that will remove the advantage of using "
5836 "B<select>(), so here is a list of essentials to watch for when using "
5839 "B<select>() を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5840 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5841 "記のプログラムは、 集合に含まれるファイルディスクリプターを非停止 "
5842 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5843 "れている。 微妙な間違いによって、 B<select>() を使う利点は簡単に失われてしま"
5844 "う。 そこで、 B<select>() コールを使うときに注意すべき重要事項を列挙しておく"
5848 #: build/C/man2/select_tut.2:356
5850 "You should always try to use B<select>() without a timeout. Your program "
5851 "should have nothing to do if there is no data available. Code that depends "
5852 "on timeouts is not usually portable and is difficult to debug."
5854 "B<select>() を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5855 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5856 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5859 #: build/C/man2/select_tut.2:360
5861 "The value I<nfds> must be properly calculated for efficiency as explained "
5864 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5868 #: build/C/man2/select_tut.2:367
5870 "No file descriptor must be added to any set if you do not intend to check "
5871 "its result after the B<select>() call, and respond appropriately. See next "
5874 "B<select>() コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5875 "ファイルディスクリプターは、 どの集合にも加えてはならない。 次のルールも参"
5879 #: build/C/man2/select_tut.2:373
5881 "After B<select>() returns, all file descriptors in all sets should be "
5882 "checked to see if they are ready."
5884 "B<select>() から返った後には、全ての集合の全てのファイルディスクリプターにつ"
5885 "いて 読み書き可能な状態になっているかをチェックすべきである。"
5888 #: build/C/man2/select_tut.2:373
5894 #: build/C/man2/select_tut.2:388
5896 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) do I<not> "
5897 "necessarily read/write the full amount of data that you have requested. If "
5898 "they do read/write the full amount, it's because you have a low traffic load "
5899 "and a fast stream. This is not always going to be the case. You should "
5900 "cope with the case of your functions managing to send or receive only a "
5903 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) といった関数は、こちらが要求"
5904 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5905 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5906 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5907 "うな場合も 考慮に入れてやらなければならない。"
5910 #: build/C/man2/select_tut.2:388
5916 #: build/C/man2/select_tut.2:396
5918 "Never read/write only in single bytes at a time unless you are really sure "
5919 "that you have a small amount of data to process. It is extremely "
5920 "inefficient not to read/write as much data as you can buffer each time. The "
5921 "buffers in the example below are 1024 bytes although they could easily be "
5924 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5925 "バイトずつ読み書きするようなことはしてはならない。 バッファーの許すかぎりの"
5926 "データをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファー"
5927 "は 1024 バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5930 #: build/C/man2/select_tut.2:396
5935 #. Nonetheless, you should still cope with these errors for completeness.
5937 #: build/C/man2/select_tut.2:418
5939 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) as well "
5940 "as the B<select>() call can return -1 with I<errno> set to B<EINTR>, or "
5941 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>). These results must be "
5942 "properly managed (not done properly above). If your program is not going to "
5943 "receive any signals, then it is unlikely you will get B<EINTR>. If your "
5944 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5946 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) などの関数や B<select>() "
5947 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>) にして -1 を返す"
5948 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5949 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5950 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5951 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5954 #: build/C/man2/select_tut.2:418
5960 #: build/C/man2/select_tut.2:427
5962 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2) with a buffer "
5965 "決して、引き数に長さ 0 のバッファーを指定して B<read>(2), B<recv>(2), "
5966 "B<write>(2), B<send>(2) を呼び出してはならない。"
5969 #: build/C/man2/select_tut.2:427
5975 #: build/C/man2/select_tut.2:443
5977 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) fail "
5978 "with errors other than those listed in B<7.>, or one of the input functions "
5979 "returns 0, indicating end of file, then you should I<not> pass that "
5980 "descriptor to B<select>() again. In the example below, I close the "
5981 "descriptor immediately, and then set it to -1 to prevent it being included "
5984 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) が B<7.> に示した以外のエ"
5985 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5986 "は、 そのディスクリプターをもう一度 select に渡してはI<ならない>。 下記の例で"
5987 "は、そのディスクリプターをただちにクローズし、 そこには -1 をセットして、 そ"
5988 "れが集合に含まれ続けるのを許さないようにしている。"
5991 #: build/C/man2/select_tut.2:443
5997 #: build/C/man2/select_tut.2:450
5999 "The timeout value must be initialized with each new call to B<select>(), "
6000 "since some operating systems modify the structure. B<pselect>() however "
6001 "does not modify its timeout structure."
6003 "タイムアウトの値は B<select>() を呼ぶたびに初期化すべきである。 OS によって"
6004 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>() は自"
6005 "分の timeout 構造体を変更することはない。"
6008 #: build/C/man2/select_tut.2:450
6013 #. "I have heard" does not fill me with confidence, and doesn't
6014 #. belong in a man page, so I've commented this point out.
6017 #. I have heard that the Windows socket layer does not cope with OOB data
6019 #. It also does not cope with
6021 #. calls when no file descriptors are set at all.
6022 #. Having no file descriptors set is a useful
6023 #. way to sleep the process with subsecond precision by using the timeout.
6024 #. (See further on.)
6026 #: build/C/man2/select_tut.2:469
6028 "Since B<select>() modifies its file descriptor sets, if the call is being "
6029 "used in a loop, then the sets must be reinitialized before each call."
6031 "B<select>() はファイルディスクリプター集合を変更するので、 B<select>() が"
6032 "ループの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプター集"
6036 #: build/C/man2/select_tut.2:469
6038 msgid "Usleep emulation"
6039 msgstr "usleep エミュレーション"
6042 #: build/C/man2/select_tut.2:476
6044 "On systems that do not have a B<usleep>(3) function, you can call "
6045 "B<select>() with a finite timeout and no file descriptors as follows:"
6047 "B<usleep>(3) 関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
6048 "ルディスクリプターを全くセットせずに B<select>() を呼び出すことで、これを代"
6052 #: build/C/man2/select_tut.2:482
6055 " struct timeval tv;\n"
6057 " tv.tv_usec = 200000; /* 0.2 seconds */\n"
6058 " select(0, NULL, NULL, NULL, &tv);\n"
6060 " struct timeval tv;\n"
6062 " tv.tv_usec = 200000; /* 0.2 seconds */\n"
6063 " select(0, NULL, NULL, NULL, &tv);\n"
6066 #: build/C/man2/select_tut.2:485
6067 msgid "This is guaranteed to work only on UNIX systems, however."
6068 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6071 #: build/C/man2/select_tut.2:490
6073 "On success, B<select>() returns the total number of file descriptors still "
6074 "present in the file descriptor sets."
6076 "成功すると、 B<select>() はファイルディスクリプター集合に残っている ファイル"
6080 #: build/C/man2/select_tut.2:496
6082 "If B<select>() timed out, then the return value will be zero. The file "
6083 "descriptors set should be all empty (but may not be on some systems)."
6085 "B<select>() がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6086 "クリプター集合はすべて空である (しかしそうならないシステムもある)。"
6089 #: build/C/man2/select_tut.2:503
6091 "A return value of -1 indicates an error, with I<errno> being set "
6092 "appropriately. In the case of an error, the contents of the returned sets "
6093 "and the I<struct timeout> contents are undefined and should not be used. "
6094 "B<pselect>() however never modifies I<ntimeout>."
6096 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6097 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6098 "なっており、使用すべきではない。 しかし B<pselect>() は決して I<ntimeout> を"
6102 #: build/C/man2/select_tut.2:512
6104 "Generally speaking, all operating systems that support sockets also support "
6105 "B<select>(). B<select>() can be used to solve many problems in a portable "
6106 "and efficient way that naive programmers try to solve in a more complicated "
6107 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6109 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6110 "B<select>() もサポートしている。 B<select>() を使うと、プログラマがスレッ"
6111 "ド、フォーク、IPC、シグナル、メモリー共有、 等々を使ってもっと複雑な方法で解"
6112 "決しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6115 #: build/C/man2/select_tut.2:521
6117 "The B<poll>(2) system call has the same functionality as B<select>(), and "
6118 "is somewhat more efficient when monitoring sparse file descriptor sets. It "
6119 "is nowadays widely available, but historically was less portable than "
6122 "B<poll>(2) システムコールは B<select>() と同じ機能を持っており、 まばらな"
6123 "ファイルディスクリプター集合を監視する場合に いくらか効率がよい。 現在では広"
6124 "く利用可能であるが、以前は B<select>() より移植性の面で劣っていた。"
6127 #: build/C/man2/select_tut.2:529
6129 "The Linux-specific B<epoll>(7) API provides an interface that is more "
6130 "efficient than B<select>(2) and B<poll>(2) when monitoring large numbers "
6131 "of file descriptors."
6133 "Linux 独自の B<epoll>(7) API は、多数のファイルディスクリプターを監視する場"
6134 "合に B<select>(2) や B<poll>(2) よりも効率的なインターフェースを提供してい"
6138 #: build/C/man2/select_tut.2:534
6140 "Here is an example that better demonstrates the true utility of "
6141 "B<select>(). The listing below is a TCP forwarding program that forwards "
6142 "from one TCP port to another."
6144 "B<select>() の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6145 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6148 #: build/C/man2/select_tut.2:547
6151 "#include E<lt>stdlib.hE<gt>\n"
6152 "#include E<lt>stdio.hE<gt>\n"
6153 "#include E<lt>unistd.hE<gt>\n"
6154 "#include E<lt>sys/time.hE<gt>\n"
6155 "#include E<lt>sys/types.hE<gt>\n"
6156 "#include E<lt>string.hE<gt>\n"
6157 "#include E<lt>signal.hE<gt>\n"
6158 "#include E<lt>sys/socket.hE<gt>\n"
6159 "#include E<lt>netinet/in.hE<gt>\n"
6160 "#include E<lt>arpa/inet.hE<gt>\n"
6161 "#include E<lt>errno.hE<gt>\n"
6163 "#include E<lt>stdlib.hE<gt>\n"
6164 "#include E<lt>stdio.hE<gt>\n"
6165 "#include E<lt>unistd.hE<gt>\n"
6166 "#include E<lt>sys/time.hE<gt>\n"
6167 "#include E<lt>sys/types.hE<gt>\n"
6168 "#include E<lt>string.hE<gt>\n"
6169 "#include E<lt>signal.hE<gt>\n"
6170 "#include E<lt>sys/socket.hE<gt>\n"
6171 "#include E<lt>netinet/in.hE<gt>\n"
6172 "#include E<lt>arpa/inet.hE<gt>\n"
6173 "#include E<lt>errno.hE<gt>\n"
6176 #: build/C/man2/select_tut.2:549
6178 msgid "static int forward_port;\n"
6179 msgstr "static int forward_port;\n"
6182 #: build/C/man2/select_tut.2:552
6186 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6189 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6192 #: build/C/man2/select_tut.2:559
6196 "listen_socket(int listen_port)\n"
6198 " struct sockaddr_in a;\n"
6203 "listen_socket(int listen_port)\n"
6205 " struct sockaddr_in a;\n"
6210 #: build/C/man2/select_tut.2:584
6213 " s = socket(AF_INET, SOCK_STREAM, 0);\n"
6215 " perror(\"socket\");\n"
6219 " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6220 " &yes, sizeof(yes)) == -1) {\n"
6221 " perror(\"setsockopt\");\n"
6225 " memset(&a, 0, sizeof(a));\n"
6226 " a.sin_port = htons(listen_port);\n"
6227 " a.sin_family = AF_INET;\n"
6228 " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6229 " perror(\"bind\");\n"
6233 " printf(\"accepting connections on port %d\\en\", listen_port);\n"
6238 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6239 " perror(\"socket\");\n"
6243 " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6244 " &yes, sizeof(yes)) == -1) {\n"
6245 " perror(\"setsockopt\");\n"
6249 " memset(&a, 0, sizeof(a));\n"
6250 " a.sin_port = htons(listen_port);\n"
6251 " a.sin_family = AF_INET;\n"
6252 " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6253 " perror(\"bind\");\n"
6257 " printf(\"accepting connections on port %d\\en\", listen_port);\n"
6263 #: build/C/man2/select_tut.2:590
6267 "connect_socket(int connect_port, char *address)\n"
6269 " struct sockaddr_in a;\n"
6273 "connect_socket(int connect_port, char *address)\n"
6275 " struct sockaddr_in a;\n"
6279 #: build/C/man2/select_tut.2:597
6282 " s = socket(AF_INET, SOCK_STREAM, 0);\n"
6284 " perror(\"socket\");\n"
6289 " s = socket(AF_INET, SOCK_STREAM, 0);\n"
6291 " perror(\"socket\");\n"
6297 #: build/C/man2/select_tut.2:601
6300 " memset(&a, 0, sizeof(a));\n"
6301 " a.sin_port = htons(connect_port);\n"
6302 " a.sin_family = AF_INET;\n"
6304 " memset(&a, 0, sizeof(a));\n"
6305 " a.sin_port = htons(connect_port);\n"
6306 " a.sin_family = AF_INET;\n"
6309 #: build/C/man2/select_tut.2:607
6312 " if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6313 " perror(\"bad IP address format\");\n"
6318 " if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6319 " perror(\"bad IP address format\");\n"
6325 #: build/C/man2/select_tut.2:616
6328 " if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6329 " perror(\"connect()\");\n"
6330 " shutdown(s, SHUT_RDWR);\n"
6337 " if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6338 " perror(\"connect()\");\n"
6339 " shutdown(s, SHUT_RDWR);\n"
6347 #: build/C/man2/select_tut.2:624
6350 "#define SHUT_FD1 do { \\e\n"
6351 " if (fd1 E<gt>= 0) { \\e\n"
6352 " shutdown(fd1, SHUT_RDWR); \\e\n"
6353 " close(fd1); \\e\n"
6358 "#define SHUT_FD1 do { \\e\n"
6359 " if (fd1 E<gt>= 0) { \\e\n"
6360 " shutdown(fd1, SHUT_RDWR); \\e\n"
6361 " close(fd1); \\e\n"
6367 #: build/C/man2/select_tut.2:632
6370 "#define SHUT_FD2 do { \\e\n"
6371 " if (fd2 E<gt>= 0) { \\e\n"
6372 " shutdown(fd2, SHUT_RDWR); \\e\n"
6373 " close(fd2); \\e\n"
6378 "#define SHUT_FD2 do { \\e\n"
6379 " if (fd2 E<gt>= 0) { \\e\n"
6380 " shutdown(fd2, SHUT_RDWR); \\e\n"
6381 " close(fd2); \\e\n"
6387 #: build/C/man2/select_tut.2:634
6389 msgid "#define BUF_SIZE 1024\n"
6390 msgstr "#define BUF_SIZE 1024\n"
6393 #: build/C/man2/select_tut.2:643
6397 "main(int argc, char *argv[])\n"
6400 " int fd1 = -1, fd2 = -1;\n"
6401 " char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6402 " int buf1_avail, buf1_written;\n"
6403 " int buf2_avail, buf2_written;\n"
6406 "main(int argc, char *argv[])\n"
6409 " int fd1 = -1, fd2 = -1;\n"
6410 " char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6411 " int buf1_avail, buf1_written;\n"
6412 " int buf2_avail, buf2_written;\n"
6415 #: build/C/man2/select_tut.2:649
6418 " if (argc != 4) {\n"
6419 " fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6420 " \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6421 " exit(EXIT_FAILURE);\n"
6424 " if (argc != 4) {\n"
6425 " fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6426 " \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6427 " exit(EXIT_FAILURE);\n"
6431 #: build/C/man2/select_tut.2:651
6433 msgid " signal(SIGPIPE, SIG_IGN);\n"
6434 msgstr " signal(SIGPIPE, SIG_IGN);\n"
6437 #: build/C/man2/select_tut.2:653
6439 msgid " forward_port = atoi(argv[2]);\n"
6440 msgstr " forward_port = atoi(argv[2]);\n"
6443 #: build/C/man2/select_tut.2:657
6446 " h = listen_socket(atoi(argv[1]));\n"
6448 " exit(EXIT_FAILURE);\n"
6450 " h = listen_socket(atoi(argv[1]));\n"
6452 " exit(EXIT_FAILURE);\n"
6455 #: build/C/man2/select_tut.2:661
6459 " int r, nfds = 0;\n"
6460 " fd_set rd, wr, er;\n"
6463 " int r, nfds = 0;\n"
6464 " fd_set rd, wr, er;\n"
6467 #: build/C/man2/select_tut.2:691
6473 " FD_SET(h, &rd);\n"
6474 " nfds = max(nfds, h);\n"
6475 " if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6476 " FD_SET(fd1, &rd);\n"
6477 " nfds = max(nfds, fd1);\n"
6479 " if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6480 " FD_SET(fd2, &rd);\n"
6481 " nfds = max(nfds, fd2);\n"
6483 " if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6484 " FD_SET(fd1, &wr);\n"
6485 " nfds = max(nfds, fd1);\n"
6487 " if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6488 " FD_SET(fd2, &wr);\n"
6489 " nfds = max(nfds, fd2);\n"
6491 " if (fd1 E<gt> 0) {\n"
6492 " FD_SET(fd1, &er);\n"
6493 " nfds = max(nfds, fd1);\n"
6495 " if (fd2 E<gt> 0) {\n"
6496 " FD_SET(fd2, &er);\n"
6497 " nfds = max(nfds, fd2);\n"
6503 " FD_SET(h, &rd);\n"
6504 " nfds = max(nfds, h);\n"
6505 " if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6506 " FD_SET(fd1, &rd);\n"
6507 " nfds = max(nfds, fd1);\n"
6509 " if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6510 " FD_SET(fd2, &rd);\n"
6511 " nfds = max(nfds, fd2);\n"
6513 " if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6514 " FD_SET(fd1, &wr);\n"
6515 " nfds = max(nfds, fd1);\n"
6517 " if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6518 " FD_SET(fd2, &wr);\n"
6519 " nfds = max(nfds, fd2);\n"
6521 " if (fd1 E<gt> 0) {\n"
6522 " FD_SET(fd1, &er);\n"
6523 " nfds = max(nfds, fd1);\n"
6525 " if (fd2 E<gt> 0) {\n"
6526 " FD_SET(fd2, &er);\n"
6527 " nfds = max(nfds, fd2);\n"
6531 #: build/C/man2/select_tut.2:693
6533 msgid " r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6534 msgstr " r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6537 #: build/C/man2/select_tut.2:696
6540 " if (r == -1 && errno == EINTR)\n"
6543 " if (r == -1 && errno == EINTR)\n"
6547 #: build/C/man2/select_tut.2:701
6551 " perror(\"select()\");\n"
6552 " exit(EXIT_FAILURE);\n"
6556 " perror(\"select()\");\n"
6557 " exit(EXIT_FAILURE);\n"
6561 #: build/C/man2/select_tut.2:705
6564 " if (FD_ISSET(h, &rd)) {\n"
6565 " unsigned int l;\n"
6566 " struct sockaddr_in client_address;\n"
6568 " if (FD_ISSET(h, &rd)) {\n"
6569 " unsigned int l;\n"
6570 " struct sockaddr_in client_address;\n"
6573 #: build/C/man2/select_tut.2:724
6576 " memset(&client_address, 0, l = sizeof(client_address));\n"
6577 " r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6579 " perror(\"accept()\");\n"
6583 " buf1_avail = buf1_written = 0;\n"
6584 " buf2_avail = buf2_written = 0;\n"
6586 " fd2 = connect_socket(forward_port, argv[3]);\n"
6590 " printf(\"connect from %s\\en\",\n"
6591 " inet_ntoa(client_address.sin_addr));\n"
6595 " memset(&client_address, 0, l = sizeof(client_address));\n"
6596 " r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6598 " perror(\"accept()\");\n"
6602 " buf1_avail = buf1_written = 0;\n"
6603 " buf2_avail = buf2_written = 0;\n"
6605 " fd2 = connect_socket(forward_port, argv[3]);\n"
6609 " printf(\"connect from %s\\en\",\n"
6610 " inet_ntoa(client_address.sin_addr));\n"
6615 #: build/C/man2/select_tut.2:726
6617 msgid " /* NB: read oob data before normal reads */\n"
6618 msgstr " /* NB: read oob data before normal reads */\n"
6621 #: build/C/man2/select_tut.2:730
6624 " if (fd1 E<gt> 0)\n"
6625 " if (FD_ISSET(fd1, &er)) {\n"
6628 " if (fd1 E<gt> 0)\n"
6629 " if (FD_ISSET(fd1, &er)) {\n"
6633 #: build/C/man2/select_tut.2:740
6636 " r = recv(fd1, &c, 1, MSG_OOB);\n"
6640 " send(fd2, &c, 1, MSG_OOB);\n"
6642 " if (fd2 E<gt> 0)\n"
6643 " if (FD_ISSET(fd2, &er)) {\n"
6646 " r = recv(fd1, &c, 1, MSG_OOB);\n"
6650 " send(fd2, &c, 1, MSG_OOB);\n"
6652 " if (fd2 E<gt> 0)\n"
6653 " if (FD_ISSET(fd2, &er)) {\n"
6657 #: build/C/man2/select_tut.2:783
6660 " r = recv(fd2, &c, 1, MSG_OOB);\n"
6664 " send(fd1, &c, 1, MSG_OOB);\n"
6666 " if (fd1 E<gt> 0)\n"
6667 " if (FD_ISSET(fd1, &rd)) {\n"
6668 " r = read(fd1, buf1 + buf1_avail,\n"
6669 " BUF_SIZE - buf1_avail);\n"
6673 " buf1_avail += r;\n"
6675 " if (fd2 E<gt> 0)\n"
6676 " if (FD_ISSET(fd2, &rd)) {\n"
6677 " r = read(fd2, buf2 + buf2_avail,\n"
6678 " BUF_SIZE - buf2_avail);\n"
6682 " buf2_avail += r;\n"
6684 " if (fd1 E<gt> 0)\n"
6685 " if (FD_ISSET(fd1, &wr)) {\n"
6686 " r = write(fd1, buf2 + buf2_written,\n"
6687 " buf2_avail - buf2_written);\n"
6691 " buf2_written += r;\n"
6693 " if (fd2 E<gt> 0)\n"
6694 " if (FD_ISSET(fd2, &wr)) {\n"
6695 " r = write(fd2, buf1 + buf1_written,\n"
6696 " buf1_avail - buf1_written);\n"
6700 " buf1_written += r;\n"
6703 " r = recv(fd2, &c, 1, MSG_OOB);\n"
6707 " send(fd1, &c, 1, MSG_OOB);\n"
6709 " if (fd1 E<gt> 0)\n"
6710 " if (FD_ISSET(fd1, &rd)) {\n"
6711 " r = read(fd1, buf1 + buf1_avail,\n"
6712 " BUF_SIZE - buf1_avail);\n"
6716 " buf1_avail += r;\n"
6718 " if (fd2 E<gt> 0)\n"
6719 " if (FD_ISSET(fd2, &rd)) {\n"
6720 " r = read(fd2, buf2 + buf2_avail,\n"
6721 " BUF_SIZE - buf2_avail);\n"
6725 " buf2_avail += r;\n"
6727 " if (fd1 E<gt> 0)\n"
6728 " if (FD_ISSET(fd1, &wr)) {\n"
6729 " r = write(fd1, buf2 + buf2_written,\n"
6730 " buf2_avail - buf2_written);\n"
6734 " buf2_written += r;\n"
6736 " if (fd2 E<gt> 0)\n"
6737 " if (FD_ISSET(fd2, &wr)) {\n"
6738 " r = write(fd2, buf1 + buf1_written,\n"
6739 " buf1_avail - buf1_written);\n"
6743 " buf1_written += r;\n"
6747 #: build/C/man2/select_tut.2:785
6749 msgid " /* check if write data has caught read data */\n"
6750 msgstr " /* check if write data has caught read data */\n"
6753 #: build/C/man2/select_tut.2:790
6756 " if (buf1_written == buf1_avail)\n"
6757 " buf1_written = buf1_avail = 0;\n"
6758 " if (buf2_written == buf2_avail)\n"
6759 " buf2_written = buf2_avail = 0;\n"
6761 " if (buf1_written == buf1_avail)\n"
6762 " buf1_written = buf1_avail = 0;\n"
6763 " if (buf2_written == buf2_avail)\n"
6764 " buf2_written = buf2_avail = 0;\n"
6767 #: build/C/man2/select_tut.2:793
6770 " /* one side has closed the connection, keep\n"
6771 " writing to the other side until empty */\n"
6773 " /* one side has closed the connection, keep\n"
6774 " writing to the other side until empty */\n"
6777 #: build/C/man2/select_tut.2:801
6780 " if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6782 " if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6785 " exit(EXIT_SUCCESS);\n"
6788 " if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6790 " if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6793 " exit(EXIT_SUCCESS);\n"
6797 #: build/C/man2/select_tut.2:815
6799 "The above program properly forwards most kinds of TCP connections including "
6800 "OOB signal data transmitted by B<telnet> servers. It handles the tricky "
6801 "problem of having data flow in both directions simultaneously. You might "
6802 "think it more efficient to use a B<fork>(2) call and devote a thread to "
6803 "each stream. This becomes more tricky than you might suspect. Another idea "
6804 "is to set nonblocking I/O using B<fcntl>(2). This also has its problems "
6805 "because you end up using inefficient timeouts."
6807 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6808 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6809 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 "
6810 "B<fork>(2) コールを使って、各ストリームごとに専用のスレッドを用いるほうが効"
6811 "率的だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこ"
6812 "しい。 あるいは、 B<fcntl>(2) を使って非ブロック I/O をセットすれば良い、と"
6813 "いうアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的"
6817 #: build/C/man2/select_tut.2:821
6819 "The program does not handle more than one simultaneous connection at a time, "
6820 "although it could easily be extended to do this with a linked list of buffers"
6821 "\\(emone for each connection. At the moment, new connections cause the "
6822 "current connection to be dropped."
6824 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6825 "張するのは簡単で、バッファーのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6826 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6829 #. This man page was written by Paul Sheer.
6831 #: build/C/man2/select_tut.2:840
6833 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6834 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6835 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6836 "B<sigismember>(3), B<epoll>(7)"
6838 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6839 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6840 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6841 "B<sigismember>(3), B<epoll>(7)"
6844 #: build/C/man2/send.2:40
6850 #: build/C/man2/send.2:43
6851 msgid "send, sendto, sendmsg - send a message on a socket"
6852 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6855 #: build/C/man2/send.2:47
6858 "B<#include E<lt>sys/types.hE<gt>>\n"
6859 "B<#include E<lt>sys/socket.hE<gt>>\n"
6861 "B<#include E<lt>sys/types.hE<gt>>\n"
6862 "B<#include E<lt>sys/socket.hE<gt>>\n"
6865 #: build/C/man2/send.2:50
6867 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6868 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6871 #: build/C/man2/send.2:54
6874 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6875 "B< const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6877 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6878 "B< const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6881 #: build/C/man2/send.2:57
6883 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6884 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6887 #: build/C/man2/send.2:65
6889 "The system calls B<send>(), B<sendto>(), and B<sendmsg>() are used to "
6890 "transmit a message to another socket."
6892 "システムコール B<send>(), B<sendto>(), B<sendmsg>() は、もう一方のソケットへ"
6893 "メッセージを転送するのに使用される。"
6896 #: build/C/man2/send.2:84
6898 "The B<send>() call may be used only when the socket is in a I<connected> "
6899 "state (so that the intended recipient is known). The only difference "
6900 "between B<send>() and B<write>(2) is the presence of I<flags>. With a "
6901 "zero I<flags> argument, B<send>() is equivalent to B<write>(2). Also, the "
6904 "B<send>() は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6905 "できる (つまり、どの相手に送信するかは既知である)。 B<send>() と "
6906 "B<write>(2) の違いは、引き数に I<flags> があるかどうかだけである。 引き数 "
6907 "I<flags> にフラグが指定されない場合、 B<send>() は B<write>(2) と等価であ"
6911 #: build/C/man2/send.2:86
6913 msgid " send(sockfd, buf, len, flags);\n"
6914 msgstr " send(sockfd, buf, len, flags);\n"
6917 #: build/C/man2/send.2:88
6918 msgid "is equivalent to"
6922 #: build/C/man2/send.2:90
6924 msgid " sendto(sockfd, buf, len, flags, NULL, 0);\n"
6925 msgstr " sendto(sockfd, buf, len, flags, NULL, 0);\n"
6928 #: build/C/man2/send.2:94
6929 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6931 "引き数 I<sockfd> は、データを送信するパケットのファイルディスクリプターであ"
6935 #: build/C/man2/send.2:122
6937 "If B<sendto>() is used on a connection-mode (B<SOCK_STREAM>, "
6938 "B<SOCK_SEQPACKET>) socket, the arguments I<dest_addr> and I<addrlen> are "
6939 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6940 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6941 "connected. Otherwise, the address of the target is given by I<dest_addr> "
6942 "with I<addrlen> specifying its size. For B<sendmsg>(), the address of the "
6943 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6946 "B<sendto>() は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6947 "B<SOCK_SEQPACKET>) で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6948 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6949 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6950 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6951 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 "
6952 "B<sendmsg>() では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズ"
6953 "は I<msg.msg_namelen> で指定される。"
6956 #: build/C/man2/send.2:138
6958 "For B<send>() and B<sendto>(), the message is found in I<buf> and has "
6959 "length I<len>. For B<sendmsg>(), the message is pointed to by the elements "
6960 "of the array I<msg.msg_iov>. The B<sendmsg>() call also allows sending "
6961 "ancillary data (also known as control information)."
6963 "B<send>() と B<sendto>() では、メッセージは I<buf> に格納されており、その長"
6964 "さは I<len> であると解釈される。 B<sendmsg>() では、メッセージは 配列 I<msg."
6965 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>() では、補助データ "
6966 "(制御情報とも呼ばれる) を送信することもできる。"
6969 #: build/C/man2/send.2:143
6971 "If the message is too long to pass atomically through the underlying "
6972 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6975 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6976 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6977 "ラーが返され、そのメッセージは転送されない。"
6980 #: build/C/man2/send.2:147
6982 "No indication of failure to deliver is implicit in a B<send>(). Locally "
6983 "detected errors are indicated by a return value of -1."
6985 "B<send>() では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6986 "出された場合は、返り値 -1 として通知される。"
6989 #: build/C/man2/send.2:160
6991 "When the message does not fit into the send buffer of the socket, B<send>() "
6992 "normally blocks, unless the socket has been placed in nonblocking I/O mode. "
6993 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6994 "in this case. The B<select>(2) call may be used to determine when it is "
6995 "possible to send more data."
6997 "メッセージがソケットの送信バッファーに入れることができない場合、 B<send>() "
6998 "は通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6999 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
7000 "つデータをさらに送信できるようになるかを知るために、 B<select>(2) コールを使"
7003 #. FIXME . ? document MSG_PROXY (which went away in 2.3.15)
7005 #: build/C/man2/send.2:166
7007 "The I<flags> argument is the bitwise OR of zero or more of the following "
7010 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
7014 #: build/C/man2/send.2:166
7016 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
7017 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
7020 #: build/C/man2/send.2:180
7022 "Tell the link layer that forward progress happened: you got a successful "
7023 "reply from the other side. If the link layer doesn't get this it will "
7024 "regularly reprobe the neighbor (e.g., via a unicast ARP). Only valid on "
7025 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
7026 "IPv4 and IPv6. See B<arp>(7) for details."
7028 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
7029 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
7030 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
7031 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
7032 "されている。 詳しくは B<arp>(7) 参照のこと。"
7035 #: build/C/man2/send.2:180
7037 msgid "B<MSG_DONTROUTE>"
7038 msgstr "B<MSG_DONTROUTE>"
7041 #: build/C/man2/send.2:188
7043 "Don't use a gateway to send out the packet, send to hosts only on directly "
7044 "connected networks. This is usually used only by diagnostic or routing "
7045 "programs. This is defined only for protocol families that route; packet "
7048 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
7049 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティングプロ"
7050 "グラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコルファ"
7051 "ミリー に対してのみ定義されている。パケットソケットには定義されていない。"
7054 #: build/C/man2/send.2:199
7056 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
7057 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
7058 "flag with the B<F_SETFL> B<fcntl>(2))."
7060 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
7061 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2) の B<F_SETFL> で "
7062 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
7065 #: build/C/man2/send.2:199
7067 msgid "B<MSG_EOR> (since Linux 2.2)"
7068 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7071 #: build/C/man2/send.2:203
7073 "Terminates a record (when this notion is supported, as for sockets of type "
7074 "B<SOCK_SEQPACKET>)."
7076 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7080 #: build/C/man2/send.2:203
7082 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7083 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7086 #: build/C/man2/send.2:212
7088 "The caller has more data to send. This flag is used with TCP sockets to "
7089 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7090 "with the difference that this flag can be set on a per-call basis."
7092 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7093 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる "
7094 "(B<tcp>(7) を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位"
7095 "で この機能を有効にできる点である。"
7098 #: build/C/man2/send.2:221
7100 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7101 "the kernel to package all of the data sent in calls with this flag set into "
7102 "a single datagram which is transmitted only when a call is performed that "
7103 "does not specify this flag. (See also the B<UDP_CORK> socket option "
7104 "described in B<udp>(7).)"
7106 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7107 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7108 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7109 "のシステムコールが実行された際に初めて送信される (B<udp>(7) に記載されている"
7110 "ソケットオプション B<UDP_CORK> も参照)。"
7113 #: build/C/man2/send.2:221
7115 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7116 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7119 #: build/C/man2/send.2:230
7121 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7122 "the other end breaks the connection. The B<EPIPE> error is still returned."
7124 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7125 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7128 #: build/C/man2/send.2:239
7130 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7131 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7134 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7135 "B<SOCK_STREAM>) で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7139 #: build/C/man2/send.2:239
7145 #: build/C/man2/send.2:245
7147 "The definition of the I<msghdr> structure employed by B<sendmsg>() is as "
7149 msgstr "B<sendmsg>() で利用されている I<msghdr> 構造体は以下の通り。"
7152 #: build/C/man2/send.2:257
7156 " void *msg_name; /* optional address */\n"
7157 " socklen_t msg_namelen; /* size of address */\n"
7158 " struct iovec *msg_iov; /* scatter/gather array */\n"
7159 " size_t msg_iovlen; /* # elements in msg_iov */\n"
7160 " void *msg_control; /* ancillary data, see below */\n"
7161 " size_t msg_controllen; /* ancillary data buffer len */\n"
7162 " int msg_flags; /* flags (unused) */\n"
7166 " void *msg_name; /* 追加のアドレス */\n"
7167 " socklen_t msg_namelen; /* アドレスのサイズ */\n"
7168 " struct iovec *msg_iov; /* scatter/gather 配列 */\n"
7169 " size_t msg_iovlen; /* msg_iov の要素数 */\n"
7170 " void *msg_control; /* 補助データ (後述) */\n"
7171 " size_t msg_controllen; /* 補助データバッファー長 */\n"
7172 " int msg_flags; /* フラグ (未使用) */\n"
7176 #: build/C/man2/send.2:269
7178 "The I<msg_name> field is used on an unconnected socket to specify the target "
7179 "address for a datagram. It points to a buffer containing the address; the "
7180 "I<msg_namelen> field should be set to the size of the address. For a "
7181 "connected socket, these fields should be specified as NULL and 0, "
7184 "フィールド I<msg_name> は、 未接続のソケットでデータグラムの宛先アドレスを指"
7185 "定するのに使用される。 このフィールドはアドレスを格納したバッファーを指す。 "
7186 "フィールド I<msg_namelen> にはアドレスの大きさを設定しなければならない。 接続"
7187 "済のソケットについては、これらのフィールドにはそれぞれ NULL と 0 を指定しなけ"
7191 #: build/C/man2/send.2:276
7193 "The I<msg_iov> and I<msg_iovlen> fields specify scatter-gather locations, as "
7196 "フィールド B<msg_iov> と I<msg_iovlen> は scatter-gather 用の場所を指定す"
7197 "る。 B<writev>(2) と同じ。"
7200 #: build/C/man2/send.2:287
7202 "You may send control information using the I<msg_control> and "
7203 "I<msg_controllen> members. The maximum control buffer length the kernel can "
7204 "process is limited per socket by the value in I</proc/sys/net/core/"
7205 "optmem_max>; see B<socket>(7)."
7207 "フィールド I<msg_control> と I<msg_controllen> を使用して制御情報を送信するこ"
7208 "とができる。 カーネルが処理できる制御バッファーのソケットあたりの最大長は、 "
7209 "I</proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7) を参"
7212 #. Still to be documented:
7213 #. Send file descriptors and user credentials using the
7214 #. msg_control* fields.
7216 #: build/C/man2/send.2:294
7217 msgid "The I<msg_flags> field is ignored."
7218 msgstr "フィールド I<msg_flags> は無視される。"
7221 #: build/C/man2/send.2:299
7223 "On success, these calls return the number of bytes sent. On error, -1 is "
7224 "returned, and I<errno> is set appropriately."
7226 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7227 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7230 #: build/C/man2/send.2:304
7232 "These are some standard errors generated by the socket layer. Additional "
7233 "errors may be generated and returned from the underlying protocol modules; "
7234 "see their respective manual pages."
7236 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7237 "ルモジュールで生成されたエラーが返されるかもしれない。 これらについては、それ"
7241 #: build/C/man2/send.2:312
7243 "(For UNIX domain sockets, which are identified by pathname) Write "
7244 "permission is denied on the destination socket file, or search permission is "
7245 "denied for one of the directories the path prefix. (See "
7246 "B<path_resolution>(7).)"
7248 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7250 "ソケットファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7251 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7252 "(B<path_resolution>(7) も参照のこと)"
7255 #: build/C/man2/send.2:315
7257 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7258 "as though it was a unicast address."
7260 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7261 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7263 #. Actually EAGAIN on Linux
7265 #: build/C/man2/send.2:323
7267 "The socket is marked nonblocking and the requested operation would block. "
7268 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7269 "require these constants to have the same value, so a portable application "
7270 "should check for both possibilities."
7272 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7273 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7274 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7278 #: build/C/man2/send.2:336
7280 "(Internet domain datagram sockets) The socket referred to by I<sockfd> had "
7281 "not previously been bound to an address and, upon attempting to bind it to "
7282 "an ephemeral port, it was determined that all port numbers in the ephemeral "
7283 "port range are currently in use. See the discussion of I</proc/sys/net/ipv4/"
7284 "ip_local_port_range> in B<ip>(7)."
7286 "(インターネットドメインデータグラムソケットの場合) I<sockfd> が参照するソケッ"
7287 "トがそれ以前にアドレスにバインドされておらず、 そのソケットに一時ポートをバイ"
7288 "ンドしようとした際に、 一時ポートとして使用する範囲のポート番号がすべて使用中"
7289 "であった。 B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照"
7293 #: build/C/man2/send.2:339
7294 msgid "An invalid descriptor was specified."
7295 msgstr "無効なディスクリプターが指定された。"
7298 #: build/C/man2/send.2:339
7300 msgid "B<ECONNRESET>"
7301 msgstr "B<ECONNRESET>"
7304 #: build/C/man2/send.2:342
7305 msgid "Connection reset by peer."
7306 msgstr "接続が接続相手によりリセットされた。"
7309 #: build/C/man2/send.2:342
7311 msgid "B<EDESTADDRREQ>"
7312 msgstr "B<EDESTADDRREQ>"
7315 #: build/C/man2/send.2:345
7316 msgid "The socket is not connection-mode, and no peer address is set."
7318 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7322 #: build/C/man2/send.2:348
7323 msgid "An invalid user space address was specified for an argument."
7324 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7327 #: build/C/man2/send.2:352
7328 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7329 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7) 参照。"
7332 #: build/C/man2/send.2:361
7334 "The connection-mode socket was connected already but a recipient was "
7335 "specified. (Now either this error is returned, or the recipient "
7336 "specification is ignored.)"
7338 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7339 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7343 #: build/C/man2/send.2:361
7346 msgstr "B<EMSGSIZE>"
7348 #. (e.g., SOCK_DGRAM )
7350 #: build/C/man2/send.2:367
7352 "The socket type requires that message be sent atomically, and the size of "
7353 "the message to be sent made this impossible."
7355 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7356 "るが、 メッセージが大き過ぎるため送信することができない。"
7359 #: build/C/man2/send.2:375
7361 "The output queue for a network interface was full. This generally indicates "
7362 "that the interface has stopped sending, but may be caused by transient "
7363 "congestion. (Normally, this does not occur in Linux. Packets are just "
7364 "silently dropped when a device queue overflows.)"
7366 "ネットワークインターフェースの出力キューが一杯である。 一般的には、一時的な輻"
7367 "輳 (congestion) のためにインターフェースが 送信を止めていることを意味する。 "
7368 "(通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバーフ"
7369 "ローした場合にはパケットは黙って捨てられる)"
7372 #: build/C/man2/send.2:378
7373 msgid "No memory available."
7377 #: build/C/man2/send.2:381
7378 msgid "The socket is not connected, and no target has been given."
7379 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7382 #: build/C/man2/send.2:391
7383 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7385 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7389 #: build/C/man2/send.2:391
7395 #: build/C/man2/send.2:400
7397 "The local end has been shut down on a connection oriented socket. In this "
7398 "case, the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7401 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7402 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7405 #: build/C/man2/send.2:403
7406 msgid "4.4BSD, SVr4, POSIX.1-2001. These function calls appeared in 4.2BSD."
7408 "4.4BSD, SVr4, POSIX.1-2001. (これらの関数コールは 4.2BSD で最初に登場した)。"
7411 #: build/C/man2/send.2:414
7413 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags. "
7414 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>. The B<MSG_CONFIRM> "
7415 "flag is a Linux extension."
7417 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7418 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7419 "ラグは Linux での拡張である。"
7422 #: build/C/man2/send.2:433
7424 "See B<sendmmsg>(2) for information about a Linux-specific system call that "
7425 "can be used to transmit multiple datagrams in a single call."
7427 "B<sendmmsg>(2) には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7429 "Linux 固有の システムコールに関する情報が書かれている。"
7432 #: build/C/man2/send.2:438
7433 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7434 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7437 #: build/C/man2/send.2:443
7438 msgid "An example of the use of B<sendto>() is shown in B<getaddrinfo>(3)."
7439 msgstr "B<sendto>() の利用例が B<getaddrinfo>(3) に記載されている。"
7442 #: build/C/man2/send.2:458
7444 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7445 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7446 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7448 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7449 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7450 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7453 #: build/C/man2/sendmmsg.2:28
7459 #: build/C/man2/sendmmsg.2:28 build/C/man7/socket.7:58
7465 #: build/C/man2/sendmmsg.2:31
7466 msgid "sendmmsg - send multiple messages on a socket"
7467 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7470 #: build/C/man2/sendmmsg.2:39
7473 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7474 "B< unsigned int >I<flags>B<);>\n"
7476 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7477 "B< unsigned int >I<flags>B<);>\n"
7479 #. See commit 228e548e602061b08ee8e8966f567c12aa079682
7481 #: build/C/man2/sendmmsg.2:49
7483 "The B<sendmmsg>() system call is an extension of B<sendmsg>(2) that allows "
7484 "the caller to transmit multiple messages on a socket using a single system "
7485 "call. (This has performance benefits for some applications.)"
7487 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7488 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7489 "ンによっては性能上のメリットがある)。"
7492 #: build/C/man2/sendmmsg.2:54
7494 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7495 "to be transmitted."
7497 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプターであ"
7501 #: build/C/man2/sendmmsg.2:75
7504 "struct mmsghdr {\n"
7505 " struct msghdr msg_hdr; /* Message header */\n"
7506 " unsigned int msg_len; /* Number of bytes transmitted */\n"
7509 "struct mmsghdr {\n"
7510 " struct msghdr msg_hdr; /* メッセージヘッダー */\n"
7511 " unsigned int msg_len; /* 送信されたバイト数 */\n"
7515 #: build/C/man2/sendmmsg.2:91
7517 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
7518 "B<sendmsg>(2). The I<msg_len> field is used to return the number of bytes "
7519 "sent from the message in I<msg_hdr> (i.e., the same as the return value from "
7520 "a single B<sendmsg>(2) call)."
7522 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7523 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7524 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダーに対して呼び出した"
7528 #: build/C/man2/sendmmsg.2:97
7530 "The I<flags> argument contains flags ORed together. The flags are the same "
7531 "as for B<sendmsg>(2)."
7533 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7534 "B<sendmsg>(2) と同じである。"
7537 #: build/C/man2/sendmmsg.2:107
7539 "A blocking B<sendmmsg>() call blocks until I<vlen> messages have been "
7540 "sent. A nonblocking call sends as many messages as possible (up to the "
7541 "limit specified by I<vlen>) and returns immediately."
7543 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7544 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7545 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7548 #: build/C/man2/sendmmsg.2:119
7550 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7551 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7552 "corresponding I<msg_hdr>. The return value of the call indicates the number "
7553 "of elements of I<msgvec> that have been updated."
7555 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7556 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7557 "しの返り値は、更新された I<msgvec> の要素数である。"
7560 #: build/C/man2/sendmmsg.2:129
7562 "On success, B<sendmmsg>() returns the number of messages sent from "
7563 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7564 "B<sendmmsg>() call to send the remaining messages."
7566 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7567 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7568 "て残りのメッセージを送信することができる。"
7571 #: build/C/man2/sendmmsg.2:133
7572 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7573 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7576 #. commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7577 #. ... only return an error if no datagrams could be sent.
7578 #. If less than the requested number of messages were sent, the application
7579 #. must retry starting at the first failed one and if the problem is
7580 #. persistent the error will be returned.
7581 #. This matches the behavior of other syscalls like read/write - it
7582 #. is not an error if less than the requested number of elements are sent.
7584 #: build/C/man2/sendmmsg.2:145
7586 "Errors are as for B<sendmsg>(2). An error is returned only if no datagrams "
7589 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7593 #: build/C/man2/sendmmsg.2:150
7595 "The B<sendmmsg>() system call was added in Linux 3.0. Support in glibc was "
7596 "added in version 2.14."
7598 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7599 "バージョン 2.14 で追加された。"
7602 #: build/C/man2/sendmmsg.2:153
7603 msgid "B<sendmmsg>() is Linux-specific."
7604 msgstr "B<sendmmsg>() は Linux 固有である。"
7608 #. commit 98382f419f32d2c12d021943b87dea555677144b
7609 #. net: Cap number of elements for sendmmsg
7610 #. To limit the amount of time we can spend in sendmmsg, cap the
7611 #. number of elements to UIO_MAXIOV (currently 1024).
7612 #. For error handling an application using sendmmsg needs to retry at
7613 #. the first unsent message, so capping is simpler and requires less
7614 #. application logic than returning EINVAL.
7616 #: build/C/man2/sendmmsg.2:168
7617 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7618 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7621 #: build/C/man2/sendmmsg.2:177
7623 "The example below uses B<sendmmsg>() to send I<onetwo> and I<three> in two "
7624 "distinct UDP datagrams using one system call. The contents of the first "
7625 "datagram originates from a pair of buffers."
7627 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7628 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7629 "の内容は、二つのバッファーから取得される。"
7632 #: build/C/man2/sendmmsg.2:186
7635 "#define _GNU_SOURCE\n"
7636 "#include E<lt>netinet/ip.hE<gt>\n"
7637 "#include E<lt>stdio.hE<gt>\n"
7638 "#include E<lt>stdlib.hE<gt>\n"
7639 "#include E<lt>string.hE<gt>\n"
7640 "#include E<lt>sys/types.hE<gt>\n"
7641 "#include E<lt>sys/socket.hE<gt>\n"
7643 "#define _GNU_SOURCE\n"
7644 "#include E<lt>netinet/ip.hE<gt>\n"
7645 "#include E<lt>stdio.hE<gt>\n"
7646 "#include E<lt>stdlib.hE<gt>\n"
7647 "#include E<lt>string.hE<gt>\n"
7648 "#include E<lt>sys/types.hE<gt>\n"
7649 "#include E<lt>sys/socket.hE<gt>\n"
7652 #: build/C/man2/sendmmsg.2:195
7659 " struct sockaddr_in sa;\n"
7660 " struct mmsghdr msg[2];\n"
7661 " struct iovec msg1[2], msg2;\n"
7668 " struct sockaddr_in sa;\n"
7669 " struct mmsghdr msg[2];\n"
7670 " struct iovec msg1[2], msg2;\n"
7674 #: build/C/man2/sendmmsg.2:209
7677 " sa.sin_family = AF_INET;\n"
7678 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7679 " sa.sin_port = htons(1234);\n"
7680 " if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7681 " perror(\"connect()\");\n"
7682 " exit(EXIT_FAILURE);\n"
7685 " sa.sin_family = AF_INET;\n"
7686 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7687 " sa.sin_port = htons(1234);\n"
7688 " if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7689 " perror(\"connect()\");\n"
7690 " exit(EXIT_FAILURE);\n"
7694 #: build/C/man2/sendmmsg.2:215
7697 " memset(msg1, 0, sizeof(msg1));\n"
7698 " msg1[0].iov_base = \"one\";\n"
7699 " msg1[0].iov_len = 3;\n"
7700 " msg1[1].iov_base = \"two\";\n"
7701 " msg1[1].iov_len = 3;\n"
7703 " memset(msg1, 0, sizeof(msg1));\n"
7704 " msg1[0].iov_base = \"one\";\n"
7705 " msg1[0].iov_len = 3;\n"
7706 " msg1[1].iov_base = \"two\";\n"
7707 " msg1[1].iov_len = 3;\n"
7710 #: build/C/man2/sendmmsg.2:219
7713 " memset(&msg2, 0, sizeof(msg2));\n"
7714 " msg2.iov_base = \"three\";\n"
7715 " msg2.iov_len = 5;\n"
7717 " memset(&msg2, 0, sizeof(msg2));\n"
7718 " msg2.iov_base = \"three\";\n"
7719 " msg2.iov_len = 5;\n"
7722 #: build/C/man2/sendmmsg.2:223
7725 " memset(msg, 0, sizeof(msg));\n"
7726 " msg[0].msg_hdr.msg_iov = msg1;\n"
7727 " msg[0].msg_hdr.msg_iovlen = 2;\n"
7729 " memset(msg, 0, sizeof(msg));\n"
7730 " msg[0].msg_hdr.msg_iov = msg1;\n"
7731 " msg[0].msg_hdr.msg_iovlen = 2;\n"
7734 #: build/C/man2/sendmmsg.2:226
7737 " msg[1].msg_hdr.msg_iov = &msg2;\n"
7738 " msg[1].msg_hdr.msg_iovlen = 1;\n"
7740 " msg[1].msg_hdr.msg_iov = &msg2;\n"
7741 " msg[1].msg_hdr.msg_iovlen = 1;\n"
7744 #: build/C/man2/sendmmsg.2:232
7747 " retval = sendmmsg(sockfd, msg, 2, 0);\n"
7748 " if (retval == -1)\n"
7749 " perror(\"sendmmsg()\");\n"
7751 " printf(\"%d messages sent\\en\", retval);\n"
7753 " retval = sendmmsg(sockfd, msg, 2, 0);\n"
7754 " if (retval == -1)\n"
7755 " perror(\"sendmmsg()\");\n"
7757 " printf(\"%d messages sent\\en\", retval);\n"
7760 #: build/C/man2/sendmmsg.2:235
7770 #: build/C/man2/sendmmsg.2:241
7771 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7772 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7775 #: build/C/man3/sockatmark.3:25
7781 #: build/C/man3/sockatmark.3:25
7787 #: build/C/man3/sockatmark.3:28
7788 msgid "sockatmark - determine whether socket is at out-of-band mark"
7790 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7794 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7795 #: build/C/man7/socket.7:63 build/C/man2/socketpair.2:49
7796 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7797 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7800 #: build/C/man3/sockatmark.3:32
7801 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7802 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7805 #: build/C/man3/sockatmark.3:41
7807 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7810 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7814 #: build/C/man3/sockatmark.3:51
7816 "B<sockatmark>() returns a value indicating whether or not the socket "
7817 "referred to by the file descriptor I<sockfd> is at the out-of-band mark. If "
7818 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7819 "mark, 0 is returned. This function does not remove the out-of-band mark."
7821 "B<sockatmark>() はファイルディスクリプター I<sockfd> で参照されるソケットに"
7822 "帯域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場"
7823 "合は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返され"
7824 "る。 この関数は帯域外マークを削除しない。"
7827 #: build/C/man3/sockatmark.3:58
7829 "A successful call to B<sockatmark>() returns 1 if the socket is at the out-"
7830 "of-band mark, or 0 if it is not. On error, -1 is returned and I<errno> is "
7831 "set to indicate the error."
7833 "B<sockatmark>() の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7834 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7835 "れ、エラーを表す I<errno> が設定される。"
7838 #: build/C/man3/sockatmark.3:63
7839 msgid "I<sockfd> is not a valid file descriptor."
7840 msgstr "I<sockfd> が有効なファイルディスクリプターでない。"
7842 #. POSIX.1 says ENOTTY for this case
7844 #: build/C/man3/sockatmark.3:70
7846 "I<sockfd> is not a file descriptor to which B<sockatmark>() can be applied."
7848 "I<sockfd> は B<sockatmark>() が適用できないファイルディスクリプターである。"
7851 #: build/C/man3/sockatmark.3:73
7852 msgid "B<sockatmark>() was added to glibc in version 2.2.4."
7853 msgstr "B<sockatmark>() は glibc バージョン 2.2.4 で追加された。"
7856 #: build/C/man3/sockatmark.3:78
7857 msgid "The B<sockatmark>() function is thread-safe."
7858 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7861 #: build/C/man3/sockatmark.3:80
7862 msgid "POSIX.1-2001."
7863 msgstr "POSIX.1-2001."
7866 #: build/C/man3/sockatmark.3:87
7868 "If B<sockatmark>() returns 1, then the out-of-band data can be read using "
7869 "the B<MSG_OOB> flag of B<recv>(2)."
7871 "B<sockatmark>() が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7872 "B<recv>(2) で読み込むことができる。"
7875 #: build/C/man3/sockatmark.3:89
7876 msgid "Out-of-band data is supported only on some stream socket protocols."
7878 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7882 #: build/C/man3/sockatmark.3:94
7884 "B<sockatmark>() can safely be called from a handler for the B<SIGURG> "
7887 "B<sockatmark>() は B<SIGURG> シグナルのハンドラーから安全に呼び出すことがで"
7891 #: build/C/man3/sockatmark.3:100
7893 "B<sockatmark>() is implemented using the B<SIOCATMARK> B<ioctl>(2) "
7896 "B<sockatmark>() は B<SIOCATMARK> B<ioctl>(2) 操作を使って実装されている。"
7899 #: build/C/man3/sockatmark.3:104
7900 msgid "Prior to glibc 2.4, B<sockatmark>() did not work."
7901 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>() は動作しない。"
7904 #: build/C/man3/sockatmark.3:109
7906 "The following code can be used after receipt of a B<SIGURG> signal to read "
7907 "(and discard) all data up to the mark, and then read the byte of data at the "
7910 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7911 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7914 #: build/C/man3/sockatmark.3:114
7917 " char buf[BUF_LEN];\n"
7921 " char buf[BUF_LEN];\n"
7926 #: build/C/man3/sockatmark.3:121
7930 " atmark = sockatmark(sockfd);\n"
7931 " if (atmark == -1) {\n"
7932 " perror(\"sockatmark\");\n"
7937 " atmark = sockatmark(sockfd);\n"
7938 " if (atmark == -1) {\n"
7939 " perror(\"sockatmark\");\n"
7944 #: build/C/man3/sockatmark.3:124
7954 #: build/C/man3/sockatmark.3:131
7957 " s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7959 " perror(\"read\");\n"
7960 " if (s E<lt>= 0)\n"
7964 " s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7966 " perror(\"read\");\n"
7967 " if (s E<lt>= 0)\n"
7972 #: build/C/man3/sockatmark.3:138
7975 " if (atmark == 1) {\n"
7976 " if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7977 " perror(\"recv\");\n"
7982 " if (atmark == 1) {\n"
7983 " if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7984 " perror(\"recv\");\n"
7990 #: build/C/man3/sockatmark.3:144
7991 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7992 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7995 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
8001 #: build/C/man2/socket.2:43
8003 #| msgid "2015-01-22"
8008 #: build/C/man2/socket.2:46
8009 msgid "socket - create an endpoint for communication"
8010 msgstr "socket - 通信のための端点(endpoint)を作成する"
8013 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
8014 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
8015 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
8018 #: build/C/man2/socket.2:52
8019 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8020 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8023 #: build/C/man2/socket.2:55
8025 "B<socket>() creates an endpoint for communication and returns a descriptor."
8027 "B<socket>() は通信のための端点(endpoint)を作成し、ディスクリプター"
8031 #: build/C/man2/socket.2:63
8033 "The I<domain> argument specifies a communication domain; this selects the "
8034 "protocol family which will be used for communication. These families are "
8035 "defined in I<E<lt>sys/socket.hE<gt>>. The currently understood formats "
8038 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコルファミ"
8039 "リー(protocol family)を通信に使用するかを指定する。 これらのファミリーは "
8040 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
8044 #: build/C/man2/socket.2:66
8046 msgid "Name:Purpose:Man page\n"
8047 msgstr "名前:目的:マニュアル\n"
8050 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
8051 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
8052 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
8053 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8054 #: build/C/man2/socket.2:119
8060 #: build/C/man2/socket.2:68
8062 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8063 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8066 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8067 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8068 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8069 #: build/C/man2/socket.2:121 build/C/man7/socket.7:194
8075 #: build/C/man2/socket.2:70
8077 msgid "Local communication\n"
8081 #: build/C/man2/socket.2:72
8083 msgid "B<unix>(7)\n"
8084 msgstr "B<unix>(7)\n"
8087 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8088 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8089 #: build/C/man2/socket.2:118 build/C/man2/socket.2:123
8090 #: build/C/man7/socket.7:173 build/C/man7/socket.7:177
8091 #: build/C/man7/socket.7:180 build/C/man7/socket.7:186
8092 #: build/C/man7/socket.7:189 build/C/man7/socket.7:198
8093 #: build/C/man7/socket.7:205
8099 #: build/C/man2/socket.2:75
8101 msgid "B<AF_INET>\n"
8102 msgstr "B<AF_INET>\n"
8105 #: build/C/man2/socket.2:76
8107 msgid "T}:IPv4 Internet protocols:T{\n"
8108 msgstr "T}:IPv4 インターネットプロトコル:T{\n"
8111 #: build/C/man2/socket.2:77
8117 #: build/C/man2/socket.2:80
8119 msgid "B<AF_INET6>\n"
8120 msgstr "B<AF_INET6>\n"
8123 #: build/C/man2/socket.2:81
8125 msgid "T}:IPv6 Internet protocols:T{\n"
8126 msgstr "T}:IPv6 インターネットプロトコル:T{\n"
8129 #: build/C/man2/socket.2:82
8131 msgid "B<ipv6>(7)\n"
8132 msgstr "B<ipv6>(7)\n"
8135 #: build/C/man2/socket.2:85
8138 msgstr "B<AF_IPX>\n"
8141 #: build/C/man2/socket.2:86
8143 msgid "T}:IPX - Novell protocols:\n"
8144 msgstr "T}:IPX - Novell プロトコル:\n"
8147 #: build/C/man2/socket.2:88
8149 msgid "B<AF_NETLINK>\n"
8150 msgstr "B<AF_NETLINK>\n"
8153 #: build/C/man2/socket.2:90
8155 msgid "Kernel user interface device\n"
8156 msgstr "カーネルユーザーインターフェースデバイス\n"
8159 #: build/C/man2/socket.2:92
8161 msgid "B<netlink>(7)\n"
8162 msgstr "B<netlink>(7)\n"
8165 #: build/C/man2/socket.2:95
8168 msgstr "B<AF_X25>\n"
8171 #: build/C/man2/socket.2:96
8173 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8174 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8177 #: build/C/man2/socket.2:97
8180 msgstr "B<x25>(7)\n"
8183 #: build/C/man2/socket.2:100
8185 msgid "B<AF_AX25>\n"
8186 msgstr "B<AF_AX25>\n"
8189 #: build/C/man2/socket.2:102
8191 msgid "Amateur radio AX.25 protocol\n"
8192 msgstr "アマチュア無線 AX.25 プロトコル\n"
8195 #: build/C/man2/socket.2:103
8201 #: build/C/man2/socket.2:105
8203 msgid "B<AF_ATMPVC>\n"
8204 msgstr "B<AF_ATMPVC>\n"
8207 #: build/C/man2/socket.2:106
8209 msgid "T}:Access to raw ATM PVCs:\n"
8210 msgstr "T}:生の ATM PVC にアクセスする:\n"
8213 #: build/C/man2/socket.2:108
8215 msgid "B<AF_APPLETALK>\n"
8216 msgstr "B<AF_APPLETALK>\n"
8219 #: build/C/man2/socket.2:109
8221 msgid "T}:AppleTalk:T{\n"
8222 msgstr "T}:AppleTalk:T{\n"
8225 #: build/C/man2/socket.2:110
8228 msgstr "B<ddp>(7)\n"
8231 #: build/C/man2/socket.2:113
8233 msgid "B<AF_PACKET>\n"
8234 msgstr "B<AF_PACKET>\n"
8237 #: build/C/man2/socket.2:115
8239 msgid "Low level packet interface\n"
8240 msgstr "低レベルのパケットインターフェース\n"
8243 #: build/C/man2/socket.2:117
8245 msgid "B<packet>(7)\n"
8246 msgstr "B<packet>(7)\n"
8249 #: build/C/man2/socket.2:120
8251 #| msgid "B<AF_AX25>\n"
8253 msgstr "B<AF_AX25>\n"
8256 #: build/C/man2/socket.2:122
8258 msgid "Interface to kernel crypto API\n"
8262 #: build/C/man2/socket.2:131
8264 "The socket has the indicated I<type>, which specifies the communication "
8265 "semantics. Currently defined types are:"
8267 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8268 "る。 定義されている型は現在以下の通り。"
8271 #: build/C/man2/socket.2:131
8273 msgid "B<SOCK_STREAM>"
8274 msgstr "B<SOCK_STREAM>"
8277 #: build/C/man2/socket.2:135
8279 "Provides sequenced, reliable, two-way, connection-based byte streams. An "
8280 "out-of-band data transmission mechanism may be supported."
8282 "順序性と信頼性があり、双方向の、接続された バイトストリーム(byte stream)を提"
8283 "供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8286 #: build/C/man2/socket.2:135
8288 msgid "B<SOCK_DGRAM>"
8289 msgstr "B<SOCK_DGRAM>"
8292 #: build/C/man2/socket.2:139
8294 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8297 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8301 #: build/C/man2/socket.2:139
8303 msgid "B<SOCK_SEQPACKET>"
8304 msgstr "B<SOCK_SEQPACKET>"
8307 #: build/C/man2/socket.2:144
8309 "Provides a sequenced, reliable, two-way connection-based data transmission "
8310 "path for datagrams of fixed maximum length; a consumer is required to read "
8311 "an entire packet with each input system call."
8313 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8314 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システムコールでパケット"
8318 #: build/C/man2/socket.2:144
8321 msgstr "B<SOCK_RAW>"
8324 #: build/C/man2/socket.2:147
8325 msgid "Provides raw network protocol access."
8326 msgstr "生のネットワークプロトコルへのアクセスを提供する。"
8329 #: build/C/man2/socket.2:147
8332 msgstr "B<SOCK_RDM>"
8335 #: build/C/man2/socket.2:150
8336 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8337 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8340 #: build/C/man2/socket.2:150
8342 msgid "B<SOCK_PACKET>"
8343 msgstr "B<SOCK_PACKET>"
8346 #: build/C/man2/socket.2:155
8347 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8349 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7) を参照する"
8353 #: build/C/man2/socket.2:157
8354 msgid "Some socket types may not be implemented by all protocol families."
8356 "ある種のソケット型が全てのプロトコルファミリーで実装されているわけではない。"
8359 #: build/C/man2/socket.2:165
8361 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8362 "addition to specifying a socket type, it may include the bitwise OR of any "
8363 "of the following values, to modify the behavior of B<socket>():"
8365 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8366 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8367 "ることで、 B<socket>() の振舞いを変更することができる。"
8370 #: build/C/man2/socket.2:199
8372 "The I<protocol> specifies a particular protocol to be used with the socket. "
8373 "Normally only a single protocol exists to support a particular socket type "
8374 "within a given protocol family, in which case I<protocol> can be specified "
8375 "as 0. However, it is possible that many protocols may exist, in which case "
8376 "a particular protocol must be specified in this manner. The protocol number "
8377 "to use is specific to the ``communication domain'' in which communication is "
8378 "to take place; see B<protocols>(5). See B<getprotoent>(3) on how to map "
8379 "protocol name strings to protocol numbers."
8381 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8382 "ぞれの ソケットは、与えられたプロトコルファミリーの種類ごとに一つのプロトコル"
8383 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8384 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8385 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8386 "イン''に 固有である; B<protocols>(5) を参照すること。 プロトコル名をどうやっ"
8387 "てプロトコル番号に対応させるかについては B<getprotoent>(3) を参照すること。"
8390 #: build/C/man2/socket.2:229
8392 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams. They do not "
8393 "preserve record boundaries. A stream socket must be in a I<connected> state "
8394 "before any data may be sent or received on it. A connection to another "
8395 "socket is created with a B<connect>(2) call. Once connected, data may be "
8396 "transferred using B<read>(2) and B<write>(2) calls or some variant of the "
8397 "B<send>(2) and B<recv>(2) calls. When a session has been completed a "
8398 "B<close>(2) may be performed. Out-of-band data may also be transmitted as "
8399 "described in B<send>(2) and received as described in B<recv>(2)."
8401 "B<SOCK_STREAM> 型のソケットは全二重バイトストリームである。 これらはレコード"
8402 "境界を保存しない。 ストリームは、ソケットがデータを送ったり受けたりする前に "
8403 "I<接続された> 状態になってなければならない。他のソケットへの接続は "
8404 "B<connect>(2) コールによって行なわれる。一度接続したらデータは B<read>(2) "
8405 "と B<write>(2) コールや B<send>(2) と B<recv>(2) コールの変種を使用して転"
8406 "送できる。 セッションが完了したら B<close>(2) が行なわれる。帯域外データの転"
8407 "送も B<send>(2) に記述されており、 受信も B<recv>(2) に記述されている。"
8410 #: build/C/man2/socket.2:255
8412 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8413 "data is not lost or duplicated. If a piece of data for which the peer "
8414 "protocol has buffer space cannot be successfully transmitted within a "
8415 "reasonable length of time, then the connection is considered to be dead. "
8416 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8417 "protocol-specific manner if the other end is still alive. A B<SIGPIPE> "
8418 "signal is raised if a process sends or receives on a broken stream; this "
8419 "causes naive processes, which do not handle the signal, to exit. "
8420 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8421 "sockets. The only difference is that B<read>(2) calls will return only the "
8422 "amount of data requested, and any data remaining in the arriving packet will "
8423 "be discarded. Also all message boundaries in incoming datagrams are "
8426 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8427 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8428 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8429 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8430 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8431 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8432 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8433 "トと同じシステムコールを使用する。 唯一の違いは B<read>(2) コールが要求され"
8434 "た量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8435 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8438 #: build/C/man2/socket.2:265
8440 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8441 "correspondents named in B<sendto>(2) calls. Datagrams are generally "
8442 "received with B<recvfrom>(2), which returns the next datagram along with the "
8443 "address of its sender."
8445 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2) コールで指定された相手"
8446 "へデータグラムを送ることが許されている。 データグラムは一般に "
8447 "B<recvfrom>(2) で受けとり、 このコールは次のデータグラムを送信者のアドレスと"
8451 #: build/C/man2/socket.2:272
8453 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8454 "from the device driver. Use B<packet>(7) instead."
8456 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8457 "接受信するためのものである。 今は代わりに B<packet>(7) を用いること。"
8460 #: build/C/man2/socket.2:295
8462 "An B<fcntl>(2) B<F_SETOWN> operation can be used to specify a process or "
8463 "process group to receive a B<SIGURG> signal when the out-of-band data "
8464 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8465 "unexpectedly. This operation may also be used to set the process or process "
8466 "group that receives the I/O and asynchronous notification of I/O events via "
8467 "B<SIGIO>. Using B<F_SETOWN> is equivalent to an B<ioctl>(2) call with the "
8468 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8470 "B<fcntl>(2) の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8471 "受けとるプロセスグループを指定できる。 B<SIGURG> シグナルは帯域外データが到着"
8472 "した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時に"
8473 "送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8474 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセスグループを設"
8475 "定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8476 "B<SIOCSPGRP> の引数で B<ioctl>(2) を使用することと等価である。"
8479 #: build/C/man2/socket.2:305
8481 "When the network signals an error condition to the protocol module (e.g., "
8482 "using a ICMP message for IP) the pending error flag is set for the socket. "
8483 "The next operation on this socket will return the error code of the pending "
8484 "error. For some protocols it is possible to enable a per-socket error queue "
8485 "to retrieve detailed information about the error; see B<IP_RECVERR> in "
8488 "ネットワークがプロトコルモジュールにエラー状態を伝えた場合 (例えば、IP の "
8489 "ICMP メッセージを使用して)には、ソケットの ペンディングエラーフラグが設定され"
8490 "る。次にこのソケットを操作した 時にペンディングされていたエラーコードが返され"
8491 "る。プロトコルによっては エラーについてのより詳しい情報を受け取るためにソケッ"
8492 "トごとのエラーキューを 受け取ることが可能である。 B<ip>(7) の B<IP_RECVERR> "
8496 #: build/C/man2/socket.2:315
8498 "The operation of sockets is controlled by socket level I<options>. These "
8499 "options are defined in I<E<lt>sys/socket.hE<gt>>. The functions "
8500 "B<setsockopt>(2) and B<getsockopt>(2) are used to set and get options, "
8503 "ソケットの操作はソケットレベル I<options> によって制御される。 これらのオプ"
8504 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2) と "
8505 "B<getsockopt>(2) 関数はそれぞれオプションの設定と取得を行なう。"
8508 #: build/C/man2/socket.2:320
8510 "On success, a file descriptor for the new socket is returned. On error, -1 "
8511 "is returned, and I<errno> is set appropriately."
8513 "成功した場合、新しいソケットのファイルディスクリプターを返す。 エラーが発生し"
8514 "た場合は -1 を返し、 I<errno> を適切に設定する。"
8517 #: build/C/man2/socket.2:325
8519 "Permission to create a socket of the specified type and/or protocol is "
8522 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8525 #: build/C/man2/socket.2:328
8526 msgid "The implementation does not support the specified address family."
8527 msgstr "指定されたアドレスファミリーがサポートされていない。"
8530 #: build/C/man2/socket.2:331
8531 msgid "Unknown protocol, or protocol family not available."
8532 msgstr "知らないプロトコル、または利用できないプロトコルファミリーである。"
8534 #. Since Linux 2.6.27
8536 #: build/C/man2/socket.2:336
8537 msgid "Invalid flags in I<type>."
8538 msgstr "I<type> に無効なフラグが指定されている。"
8541 #: build/C/man2/socket.2:339
8542 msgid "Process file table overflow."
8543 msgstr "プロセスのファイルテーブルが溢れている。"
8546 #: build/C/man2/socket.2:342
8548 msgid "B<ENOBUFS> or B<ENOMEM>"
8549 msgstr "B<ENOBUFS> または B<ENOMEM>"
8552 #: build/C/man2/socket.2:347
8554 "Insufficient memory is available. The socket cannot be created until "
8555 "sufficient resources are freed."
8557 "十分なメモリーがない。十分な資源が解放されるまではソケットを 作成することはで"
8561 #: build/C/man2/socket.2:347 build/C/man2/socketpair.2:92
8563 msgid "B<EPROTONOSUPPORT>"
8564 msgstr "B<EPROTONOSUPPORT>"
8567 #: build/C/man2/socket.2:351
8569 "The protocol type or the specified protocol is not supported within this "
8572 "このドメインでは指定されたプロトコルまたはプロトコルタイプが サポートされてい"
8576 #: build/C/man2/socket.2:353
8577 msgid "Other errors may be generated by the underlying protocol modules."
8578 msgstr "下位のプロトコルモジュールから他のエラーが生成されるかもしれない。"
8581 #: build/C/man2/socket.2:355
8582 msgid "4.4BSD, POSIX.1-2001."
8583 msgstr "4.4BSD, POSIX.1-2001."
8586 #: build/C/man2/socket.2:361
8587 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8588 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8591 #: build/C/man2/socket.2:367
8593 "B<socket>() appeared in 4.2BSD. It is generally portable to/from non-BSD "
8594 "systems supporting clones of the BSD socket layer (including System\\ V "
8597 "B<socket>() は 4.2BSD で登場した。一般に、(System\\ V の変種を含めて) BSD "
8598 "のソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD "
8602 #: build/C/man2/socket.2:386
8604 "The manifest constants used under 4.x BSD for protocol families are "
8605 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8606 "are used for address families. However, already the BSD man page promises: "
8607 "\"The protocol family generally is the same as the address family\", and "
8608 "subsequent standards use AF_* everywhere."
8610 "4.x BSD において定数を使用する場合、プロトコルファミリーには\n"
8611 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレスファミリーには\n"
8612 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8613 "しかしながら BSD のマニュアルでは 「一般にプロトコルファミリーは\n"
8614 "アドレスファミリーと同じものである。」 と保証している。\n"
8615 "それ以外の規格では全ての場所で AF_* が使用されている。"
8618 #: build/C/man2/socket.2:392
8620 "The B<AF_ALG> protocol type was added in Linux 2.6.38. More information on "
8621 "this interface is provided in the kernel source file, I<Documentation/crypto/"
8622 "crypto-API-userspace.txt>."
8626 #: build/C/man2/socket.2:397
8627 msgid "An example of the use of B<socket>() is shown in B<getaddrinfo>(3)."
8628 msgstr "B<socket>() の利用例が B<getaddrinfo>(3) に記載されている。"
8631 #: build/C/man2/socket.2:420
8633 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8634 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8635 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8636 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8637 "B<udp>(7), B<unix>(7)"
8639 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8640 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8641 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8642 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8643 "B<udp>(7), B<unix>(7)"
8646 #: build/C/man2/socket.2:426
8648 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8649 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8650 "Programmer's Supplementary Documents Volume 1.>"
8652 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8653 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8654 "Supplementary Documents Volume 1.> として再版された)"
8657 #: build/C/man7/socket.7:61
8658 msgid "socket - Linux socket interface"
8659 msgstr "socket - Linux のソケットインターフェース"
8662 #: build/C/man7/socket.7:65
8664 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8667 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8671 #: build/C/man7/socket.7:84
8673 "This manual page describes the Linux networking socket layer user "
8674 "interface. The BSD compatible sockets are the uniform interface between the "
8675 "user process and the network protocol stacks in the kernel. The protocol "
8676 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8677 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8678 "B<SOCK_DGRAM>. See B<socket>(2) for more information on families and types."
8680 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザーイン"
8681 "ターフェースを記述するものである。 BSD 互換ソケットは、ユーザープロセスとカー"
8682 "ネル内部の ネットワークプロトコルスタック群との間に、 統一的なインターフェー"
8683 "スを提供するものである。 プロトコルモジュールは I<プロトコルファミリー "
8684 "(protocol familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>) と I<ソケット"
8685 "タイプ (socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>) に分類できる。 "
8686 "これらに関するより詳しい情報は B<socket>(2) を参照のこと。"
8689 #: build/C/man7/socket.7:84
8691 msgid "Socket-layer functions"
8695 #: build/C/man7/socket.7:88
8697 "These functions are used by the user process to send or receive packets and "
8698 "to do other socket operations. For more information see their respective "
8701 "これらの関数はユーザープロセスがパケットを送受信したり、その他のソケット操作"
8702 "を 行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほし"
8706 #: build/C/man7/socket.7:104
8708 "B<socket>(2) creates a socket, B<connect>(2) connects a socket to a remote "
8709 "socket address, the B<bind>(2) function binds a socket to a local socket "
8710 "address, B<listen>(2) tells the socket that new connections shall be "
8711 "accepted, and B<accept>(2) is used to get a new socket with a new incoming "
8712 "connection. B<socketpair>(2) returns two connected anonymous sockets "
8713 "(implemented only for a few local families like B<AF_UNIX>)"
8715 "B<socket>(2) はソケットを生成する。 B<connect>(2) はソケットをリモートのソ"
8716 "ケットアドレスに接続する。 B<bind>(2) はソケットをローカルのソケットアドレス"
8717 "にバインドする。 B<listen>(2) はソケットに新しい接続が来たら受信するように伝"
8718 "え、 B<accept>(2) は外部からやってきた接続に対して新しいソケットを得るために"
8719 "用いられる。 B<socketpair>(2) は互いに接続された二つの名前無しソケット "
8720 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8724 #: build/C/man7/socket.7:126
8726 "B<send>(2), B<sendto>(2), and B<sendmsg>(2) send data over a socket, and "
8727 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2) receive data from a socket. "
8728 "B<poll>(2) and B<select>(2) wait for arriving data or a readiness to send "
8729 "data. In addition, the standard I/O operations like B<write>(2), "
8730 "B<writev>(2), B<sendfile>(2), B<read>(2), and B<readv>(2) can be used to "
8731 "read and write data."
8733 "B<send>(2), B<sendto>(2), B<sendmsg>(2) はソケットを通してデータを送信し、 "
8734 "B<recv>(2) B<recvfrom>(2), B<recvmsg>(2) はソケットからデータを受信する。 "
8735 "B<poll>(2) と B<select>(2) はデータの到着を待ったり、データ送信の準備ができ"
8736 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8737 "B<read>(2), B<readv>(2) のような標準的な I/O 操作もデータの読み書きに用いる"
8741 #: build/C/man7/socket.7:137
8743 "B<getsockname>(2) returns the local socket address and B<getpeername>(2) "
8744 "returns the remote socket address. B<getsockopt>(2) and B<setsockopt>(2) "
8745 "are used to set or get socket layer or protocol options. B<ioctl>(2) can "
8746 "be used to set or read some other options."
8748 "B<getsockbyname>(2) はローカルのソケットアドレスを返し、 B<getpeername>(2) "
8749 "はリモートのソケットアドレスを返す。 B<getsockopt>(2) と B<setsockopt>(2) "
8750 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8751 "いくつかのオプションの取得・設定には B<ioctl>(2) を使うことができる。"
8754 #: build/C/man7/socket.7:142
8756 "B<close>(2) is used to close a socket. B<shutdown>(2) closes parts of a "
8757 "full-duplex socket connection."
8759 "B<close>(2) はソケットをクローズする。 B<shutdown>(2) は全二重なソケット接"
8763 #: build/C/man7/socket.7:148
8765 "Seeking, or calling B<pread>(2) or B<pwrite>(2) with a nonzero position is "
8766 "not supported on sockets."
8768 "シーク動作や、 0 以外の位置に対する B<pread>(2) や B<pwrite>(2) はソケット"
8772 #: build/C/man7/socket.7:165
8774 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8775 "flag on a socket file descriptor using B<fcntl>(2). Then all operations "
8776 "that would block will (usually) return with B<EAGAIN> (operation should be "
8777 "retried later); B<connect>(2) will return B<EINPROGRESS> error. The user "
8778 "can then wait for various events via B<poll>(2) or B<select>(2)."
8780 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2) を使ってソ"
8781 "ケットのファイルディスクリプターに B<O_NONBLOCK> フラグをセットすれば良い。 "
8782 "こうするとブロックされる操作は、 (通常) B<EAGAIN> エラーで戻ることになる (後"
8783 "で処理が再試行されることが期待されている)。 B<connect>(2) では "
8784 "B<EINPROGRESS> エラーが返される。 この場合、ユーザーはさまざまなイベントを "
8785 "B<poll>(2) や B<select>(2) を使って待つことができる。"
8788 #: build/C/man7/socket.7:169
8790 msgid "I/O events\n"
8794 #: build/C/man7/socket.7:170
8796 msgid "Event:Poll flag:Occurrence\n"
8797 msgstr "イベント:poll フラグ:内容\n"
8800 #: build/C/man7/socket.7:171 build/C/man7/socket.7:174
8802 msgid "Read:POLLIN:T{\n"
8803 msgstr "Read:POLLIN:T{\n"
8806 #: build/C/man7/socket.7:172
8808 msgid "New data arrived.\n"
8809 msgstr "新しいデータが到着した。\n"
8812 #: build/C/man7/socket.7:175
8814 msgid "A connection setup has been completed\n"
8815 msgstr "(接続志向のソケットで)\n"
8818 #: build/C/man7/socket.7:176
8820 msgid "(for connection-oriented sockets)\n"
8821 msgstr "接続の設定が終了した。\n"
8824 #: build/C/man7/socket.7:178 build/C/man7/socket.7:181
8826 msgid "Read:POLLHUP:T{\n"
8827 msgstr "Read:POLLHUP:T{\n"
8830 #: build/C/man7/socket.7:179
8832 msgid "A disconnection request has been initiated by the other end.\n"
8833 msgstr "接続先で切断要求が生成された。\n"
8836 #: build/C/man7/socket.7:182
8838 msgid "A connection is broken (only for connection-oriented protocols).\n"
8839 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8842 #: build/C/man7/socket.7:183
8844 msgid "When the socket is written\n"
8845 msgstr "この場合、ソケットに書き込みが行われると\n"
8848 #: build/C/man7/socket.7:184
8850 msgid "B<SIGPIPE>\n"
8851 msgstr "B<SIGPIPE>\n"
8854 #: build/C/man7/socket.7:185
8856 msgid "is also sent.\n"
8860 #: build/C/man7/socket.7:187
8862 msgid "Write:POLLOUT:T{\n"
8863 msgstr "Write:POLLOUT:T{\n"
8866 #: build/C/man7/socket.7:188
8868 msgid "Socket has enough send buffer space for writing new data.\n"
8869 msgstr "ソケットには新しいデータを書き込むのに十分なバッファーがある。\n"
8872 #: build/C/man7/socket.7:190
8874 msgid "Read/Write:T{\n"
8875 msgstr "Read/Write:T{\n"
8878 #: build/C/man7/socket.7:191
8884 #: build/C/man7/socket.7:192
8890 #: build/C/man7/socket.7:193
8896 #: build/C/man7/socket.7:195
8898 msgid "An outgoing\n"
8902 #: build/C/man7/socket.7:196
8904 msgid "B<connect>(2)\n"
8905 msgstr "B<connect>(2)\n"
8908 #: build/C/man7/socket.7:197
8914 #: build/C/man7/socket.7:199
8916 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8917 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8920 #: build/C/man7/socket.7:200
8922 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8923 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8926 #: build/C/man7/socket.7:201
8928 msgid "Exception:POLLPRI:T{\n"
8929 msgstr "Exception:POLLPRI:T{\n"
8932 #: build/C/man7/socket.7:202
8934 msgid "Urgent data arrived.\n"
8935 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8938 #: build/C/man7/socket.7:203
8941 msgstr "B<SIGURG>\n"
8944 #: build/C/man7/socket.7:204
8946 msgid "is sent then.\n"
8950 #: build/C/man7/socket.7:233
8952 "An alternative to B<poll>(2) and B<select>(2) is to let the kernel inform "
8953 "the application about events via a B<SIGIO> signal. For that the B<O_ASYNC> "
8954 "flag must be set on a socket file descriptor via B<fcntl>(2) and a valid "
8955 "signal handler for B<SIGIO> must be installed via B<sigaction>(2). See the "
8956 "I<Signals> discussion below."
8958 "B<poll>(2) や B<select>(2) を使う代わりに、カーネルからアプリケーションに "
8959 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8960 "は、 B<fcntl>(2) を用いてソケットのファイルディスクリプターに B<O_ASYNC> フ"
8961 "ラグをセットし、 B<SIGIO> に対する有効なシグナルハンドラーを "
8962 "B<sigaction>(2) によって設定しておく必要がある。 後述の I<シグナル> に関する"
8966 #: build/C/man7/socket.7:233
8968 msgid "Socket address structures"
8969 msgstr "ソケットアドレス構造体"
8972 #: build/C/man7/socket.7:249
8974 "Each socket domain has its own format for socket addresses, with a domain-"
8975 "specific address structure. Each of these structures begins with an integer "
8976 "\"family\" field (typed as I<sa_family_t>) that indicates the type of the "
8977 "address structure. This allows the various system calls (e.g., "
8978 "B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8979 "B<getpeername>(2)), which are generic to all socket domains, to determine "
8980 "the domain of a particular socket address."
8982 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8983 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8984 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8985 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8986 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8987 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8991 #: build/C/man7/socket.7:259
8993 "To allow any type of socket address to be passed to interfaces in the "
8994 "sockets API, the type I<struct sockaddr> is defined. The purpose of this "
8995 "type is purely to allow casting of domain-specific socket address types to a "
8996 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8997 "calls to the sockets API."
8999 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
9000 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
9001 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
9002 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
9006 #: build/C/man7/socket.7:269
9008 "In addition, the sockets API provides the data type I<struct "
9009 "sockaddr_storage>. This type is suitable to accommodate all supported "
9010 "domain-specific socket address structures; it is large enough and is aligned "
9011 "properly. (In particular, it is large enough to hold IPv6 socket "
9012 "addresses.) The structure includes the following field, which can be used "
9013 "to identify the type of socket address actually stored in the structure:"
9015 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
9016 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
9017 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリー境界"
9018 "への) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するの"
9019 "にも十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールド"
9020 "を使って、 この構造体に実際に格納されているソケットアドレスの型を特定すること"
9024 #: build/C/man7/socket.7:273
9026 msgid " sa_family_t ss_family;\n"
9027 msgstr " sa_family_t ss_family;\n"
9030 #: build/C/man7/socket.7:281
9032 "The I<sockaddr_storage> structure is useful in programs that must handle "
9033 "socket addresses in a generic way (e.g., programs that must deal with both "
9034 "IPv4 and IPv6 socket addresses)."
9036 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
9037 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
9041 #: build/C/man7/socket.7:281
9043 msgid "Socket options"
9047 #. In the list below, the text used to describe argument types
9048 #. for each socket option should be more consistent
9049 #. SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
9050 #. W R Stevens, UNPv1
9052 #: build/C/man7/socket.7:299
9054 "The socket options listed below can be set by using B<setsockopt>(2) and "
9055 "read with B<getsockopt>(2) with the socket level set to B<SOL_SOCKET> for "
9056 "all sockets. Unless otherwise noted, I<optval> is a pointer to an I<int>."
9058 "これらのソケットオプションは、 B<setsockopt>(2) を用いれば設定でき、 "
9059 "B<getsockopt>(2) を用いれば取得できる。 但し、どのソケットの場合も ソケット"
9060 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
9061 "I<int> へのポインターである。"
9064 #: build/C/man7/socket.7:299
9066 msgid "B<SO_ACCEPTCONN>"
9067 msgstr "B<SO_ACCEPTCONN>"
9070 #: build/C/man7/socket.7:307
9072 "Returns a value indicating whether or not this socket has been marked to "
9073 "accept connections with B<listen>(2). The value 0 indicates that this is "
9074 "not a listening socket, the value 1 indicates that this is a listening "
9075 "socket. This socket option is read-only."
9077 "このソケットが B<listen>(2) によって接続待ち受け状態に設定されているかどうか"
9078 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9079 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9082 #: build/C/man7/socket.7:307
9084 msgid "B<SO_BINDTODEVICE>"
9085 msgstr "B<SO_BINDTODEVICE>"
9088 #: build/C/man7/socket.7:326
9090 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9091 "the passed interface name. If the name is an empty string or the option "
9092 "length is zero, the socket device binding is removed. The passed option is "
9093 "a variable-length null-terminated interface name string with the maximum "
9094 "size of B<IFNAMSIZ>. If a socket is bound to an interface, only packets "
9095 "received from that particular interface are processed by the socket. Note "
9096 "that this works only for some socket types, particularly B<AF_INET> "
9097 "sockets. It is not supported for packet sockets (use normal B<bind>(2) "
9100 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9101 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9102 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9103 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9104 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9105 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9106 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9107 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9108 "B<bind>(2) を使うこと)。"
9111 #: build/C/man7/socket.7:340
9113 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9114 "with B<getsockopt>(2). Since Linux 3.8, it is readable. The I<optlen> "
9115 "argument should contain the buffer size available to receive the device name "
9116 "and is recommended to be B<IFNAMSZ> bytes. The real device name length is "
9117 "reported back in the I<optlen> argument."
9119 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9120 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9121 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9122 "バッファーサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 "
9123 "実際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9126 #: build/C/man7/socket.7:340
9128 msgid "B<SO_BROADCAST>"
9129 msgstr "B<SO_BROADCAST>"
9132 #: build/C/man7/socket.7:346
9134 "Set or get the broadcast flag. When enabled, datagram sockets are allowed "
9135 "to send packets to a broadcast address. This option has no effect on stream-"
9138 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9139 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9140 "ストリーム指向のソケットには何の効果もない。"
9143 #: build/C/man7/socket.7:346
9145 msgid "B<SO_BSDCOMPAT>"
9146 msgstr "B<SO_BSDCOMPAT>"
9149 #: build/C/man7/socket.7:358
9151 "Enable BSD bug-to-bug compatibility. This is used by the UDP protocol "
9152 "module in Linux 2.0 and 2.2. If enabled, ICMP errors received for a UDP "
9153 "socket will not be passed to the user program. In later kernel versions, "
9154 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9155 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9156 "option. Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9157 "header changing, skipping of the broadcast flag) for raw sockets with this "
9158 "option, but that was removed in Linux 2.2."
9160 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9161 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9162 "UDP ソケットで受信された ICMP エラーは ユーザープログラムに渡されない。 これ"
9163 "以降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されて"
9164 "きた。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラ"
9165 "ムがこのオプションを使用すると (printk() を使って) カーネルの警告メッセージ"
9166 "が出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにお"
9167 "いても BSD のバグ (ランダムヘッダー変更、 ブロードキャストフラグのスキップ) "
9168 "に対する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除され"
9172 #: build/C/man7/socket.7:358
9175 msgstr "B<SO_DEBUG>"
9178 #: build/C/man7/socket.7:364
9180 "Enable socket debugging. Only allowed for processes with the "
9181 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9183 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9184 "実効ユーザー ID が 0 のプロセスでしか 利用できない。"
9187 #: build/C/man7/socket.7:364
9189 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9190 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9193 #: build/C/man7/socket.7:372
9195 "Retrieves the socket domain as an integer, returning a value such as "
9196 "B<AF_INET6>. See B<socket>(2) for details. This socket option is read-"
9199 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9200 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9203 #: build/C/man7/socket.7:372
9206 msgstr "B<SO_ERROR>"
9209 #: build/C/man7/socket.7:377
9211 "Get and clear the pending socket error. This socket option is read-only. "
9212 "Expects an integer."
9214 "保留になっていたソケットエラーを取得してクリアする。\n"
9215 "このソケットオプションは読み込み専用である。整数値をとる。"
9218 #: build/C/man7/socket.7:377
9220 msgid "B<SO_DONTROUTE>"
9221 msgstr "B<SO_DONTROUTE>"
9224 #: build/C/man7/socket.7:386
9226 "Don't send via a gateway, send only to directly connected hosts. The same "
9227 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9228 "B<send>(2) operation. Expects an integer boolean flag."
9230 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2) "
9231 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9235 #: build/C/man7/socket.7:386
9237 msgid "B<SO_KEEPALIVE>"
9238 msgstr "B<SO_KEEPALIVE>"
9241 #: build/C/man7/socket.7:390
9243 "Enable sending of keep-alive messages on connection-oriented sockets. "
9244 "Expects an integer boolean flag."
9246 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9250 #: build/C/man7/socket.7:390
9252 msgid "B<SO_LINGER>"
9253 msgstr "B<SO_LINGER>"
9256 #: build/C/man7/socket.7:398
9258 "Sets or gets the B<SO_LINGER> option. The argument is a I<linger> structure."
9260 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9263 #: build/C/man7/socket.7:405
9267 " int l_onoff; /* linger active */\n"
9268 " int l_linger; /* how many seconds to linger for */\n"
9272 " int l_onoff; /* linger active */\n"
9273 " int l_linger; /* how many seconds to linger for */\n"
9277 #: build/C/man7/socket.7:419
9279 "When enabled, a B<close>(2) or B<shutdown>(2) will not return until all "
9280 "queued messages for the socket have been successfully sent or the linger "
9281 "timeout has been reached. Otherwise, the call returns immediately and the "
9282 "closing is done in the background. When the socket is closed as part of "
9283 "B<exit>(2), it always lingers in the background."
9285 "有効になっていると、 B<close>(2) や B<shutdown>(2) は、そのソケットにキュー"
9286 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9287 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9288 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2) の一部と"
9289 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9293 #: build/C/man7/socket.7:419
9295 msgid "B<SO_MARK> (since Linux 2.6.25)"
9296 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9298 #. commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9299 #. and 914a9ab386a288d0f22252fc268ecbc048cdcbd5
9301 #: build/C/man7/socket.7:430
9303 "Set the mark for each packet sent through this socket (similar to the "
9304 "netfilter MARK target but socket-based). Changing the mark can be used for "
9305 "mark-based routing without netfilter or for packet filtering. Setting this "
9306 "option requires the B<CAP_NET_ADMIN> capability."
9308 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9309 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9310 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9311 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9315 #: build/C/man7/socket.7:430
9317 msgid "B<SO_OOBINLINE>"
9318 msgstr "B<SO_OOBINLINE>"
9320 #. don't document it because it can do too much harm.
9323 #: build/C/man7/socket.7:439
9325 "If this option is enabled, out-of-band data is directly placed into the "
9326 "receive data stream. Otherwise, out-of-band data is passed only when the "
9327 "B<MSG_OOB> flag is set during receiving."
9329 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9330 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9331 "ラグがセットされている場合に限って渡される。"
9334 #: build/C/man7/socket.7:439
9336 msgid "B<SO_PASSCRED>"
9337 msgstr "B<SO_PASSCRED>"
9339 #. FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9340 #. in the 2.6.18 ChangeLog
9342 #: build/C/man7/socket.7:448
9344 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message. "
9345 "For more information see B<unix>(7)."
9347 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7) "
9351 #: build/C/man7/socket.7:448
9353 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9354 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9356 #. commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9358 #: build/C/man7/socket.7:458
9360 "This option, which is currently supported only for B<unix>(7) sockets, sets "
9361 "the value of the \"peek offset\" for the B<recv>(2) system call when used "
9362 "with B<MSG_PEEK> flag."
9364 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9365 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9366 "B<unix>(7) ソケットでのみサポートされている。"
9369 #: build/C/man7/socket.7:466
9371 "When this option is set to a negative value (it is set to -1 for all new "
9372 "sockets), traditional behavior is provided: B<recv>(2) with the B<MSG_PEEK> "
9373 "flag will peek data from the front of the queue."
9375 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9376 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9377 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9378 "のソケットではこのオプションの値は必ず -1 に設定される。"
9381 #: build/C/man7/socket.7:473
9383 "When the option is set to a value greater than or equal to zero, then the "
9384 "next peek at data queued in the socket will occur at the byte offset "
9385 "specified by the option value. At the same time, the \"peek offset\" will "
9386 "be incremented by the number of bytes that were peeked from the queue, so "
9387 "that a subsequent peek will return the next data in the queue."
9389 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9390 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9391 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9392 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9395 #: build/C/man7/socket.7:485
9397 "If data is removed from the front of the queue via a call to B<recv>(2) (or "
9398 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9399 "by the number of bytes removed. In other words, receiving data without the "
9400 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9401 "the correct relative position in the queued data, so that a subsequent peek "
9402 "will retrieve the data that would have been retrieved had the data not been "
9405 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9406 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9407 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9408 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9409 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9413 #: build/C/man7/socket.7:490
9415 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9416 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9418 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9419 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9422 #: build/C/man7/socket.7:494
9424 "The following example serves to illustrate the use of B<SO_PEEK_OFF>. "
9425 "Suppose a stream socket has the following queued input data:"
9427 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9428 "以下の入力データが入っているものとする。"
9431 #: build/C/man7/socket.7:496
9433 msgid " aabbccddeeff\n"
9434 msgstr " aabbccddeeff\n"
9437 #: build/C/man7/socket.7:501
9439 "The following sequence of B<recv>(2) calls would have the effect noted in "
9442 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9445 #: build/C/man7/socket.7:506
9448 "int ov = 4; // Set peek offset to 4\n"
9449 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9451 "int ov = 4; // Set peek offset to 4\n"
9452 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9455 #: build/C/man7/socket.7:511
9458 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"cc\"; offset set to 6\n"
9459 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"dd\"; offset set to 8\n"
9460 "recv(fd, buf, 2, 0); // Reads \"aa\"; offset set to 6\n"
9461 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"ee\"; offset set to 8\n"
9463 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"cc\"; offset set to 6\n"
9464 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"dd\"; offset set to 8\n"
9465 "recv(fd, buf, 2, 0); // Reads \"aa\"; offset set to 6\n"
9466 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"ee\"; offset set to 8\n"
9469 #: build/C/man7/socket.7:513
9471 msgid "B<SO_PEERCRED>"
9472 msgstr "B<SO_PEERCRED>"
9475 #: build/C/man7/socket.7:536
9477 "Return the credentials of the foreign process connected to this socket. "
9478 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9479 "stream and datagram socket pairs created using B<socketpair>(2); see "
9480 "B<unix>(7). The returned credentials are those that were in effect at the "
9481 "time of the call to B<connect>(2) or B<socketpair>(2). The argument is a "
9482 "I<ucred> structure; define the B<_GNU_SOURCE> feature test macro to obtain "
9483 "the definition of that structure from I<E<lt>sys/socket.hE<gt>>. This "
9484 "socket option is read-only."
9486 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9487 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9488 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9489 "トとデータグラムソケットのペアだけである。 B<unix>(7) を参照のこと。 "
9490 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9491 "る。 引き数は I<ucred> 構造体である。この構造体の定義を I<E<lt>sys/socket."
9492 "hE<gt>> を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義すること。 このソ"
9493 "ケットオプションは読み込み専用である。"
9496 #: build/C/man7/socket.7:536
9498 msgid "B<SO_PRIORITY>"
9499 msgstr "B<SO_PRIORITY>"
9502 #: build/C/man7/socket.7:549
9504 "Set the protocol-defined priority for all packets to be sent on this "
9505 "socket. Linux uses this value to order the networking queues: packets with "
9506 "a higher priority may be processed first depending on the selected device "
9507 "queueing discipline. For B<ip>(7), this also sets the IP type-of-service "
9508 "(TOS) field for outgoing packets. Setting a priority outside the range 0 to "
9509 "6 requires the B<CAP_NET_ADMIN> capability."
9511 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9512 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9513 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9514 "方に依存する。 B<ip>(7) では、外向けパケットの IP type-of-service (TOS) "
9515 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9516 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9519 #: build/C/man7/socket.7:549
9521 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9522 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9525 #: build/C/man7/socket.7:557
9527 "Retrieves the socket protocol as an integer, returning a value such as "
9528 "B<IPPROTO_SCTP>. See B<socket>(2) for details. This socket option is read-"
9531 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9533 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9536 #: build/C/man7/socket.7:557
9538 msgid "B<SO_RCVBUF>"
9539 msgstr "B<SO_RCVBUF>"
9541 #. Most (all?) other implementations do not do this -- MTK, Dec 05
9542 #. The following thread on LMKL is quite informative:
9543 #. getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behavior
9545 #. http://thread.gmane.org/gmane.linux.kernel/1328935
9547 #: build/C/man7/socket.7:576
9549 "Sets or gets the maximum socket receive buffer in bytes. The kernel doubles "
9550 "this value (to allow space for bookkeeping overhead) when it is set using "
9551 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2). "
9552 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9553 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9554 "file. The minimum (doubled) value for this option is 256."
9556 "ソケットの受信バッファーの最大サイズを設定・取得する (バイト単位)。 "
9557 "B<setsockopt>(2) を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9558 "保するために) カーネルはこの値を 2倍し、 B<getsockopt>(2) はこの 2倍された"
9559 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9560 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9561 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9564 #: build/C/man7/socket.7:576
9566 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9567 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9570 #: build/C/man7/socket.7:585
9572 "Using this socket option, a privileged (B<CAP_NET_ADMIN>) process can "
9573 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9576 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9577 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9581 #: build/C/man7/socket.7:585
9583 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9584 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9586 #. See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9587 #. Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9589 #: build/C/man7/socket.7:614
9591 "Specify the minimum number of bytes in the buffer until the socket layer "
9592 "will pass the data to the protocol (B<SO_SNDLOWAT>) or the user on "
9593 "receiving (B<SO_RCVLOWAT>). These two values are initialized to 1. "
9594 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2) fails with the "
9595 "error B<ENOPROTOOPT>). B<SO_RCVLOWAT> is changeable only since Linux 2.4. "
9596 "The B<select>(2) and B<poll>(2) system calls currently do not respect the "
9597 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9598 "single byte of data is available. A subsequent read from the socket will "
9599 "block until B<SO_RCVLOWAT> bytes are available."
9601 "バッファー中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9602 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9603 "ユーザーに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9604 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2) は "
9605 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9606 "可能である。 現状、Linux ではシステムコール B<select>(2) と B<poll>(2) は "
9607 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9608 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9609 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9613 #: build/C/man7/socket.7:614
9615 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9616 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9618 #. Not implemented in 2.0.
9619 #. Implemented in 2.1.11 for getsockopt: always return a zero struct.
9620 #. Implemented in 2.3.41 for setsockopt, and actually used.
9621 #. in fact to EAGAIN
9623 #: build/C/man7/socket.7:649
9625 "Specify the receiving or sending timeouts until reporting an error. The "
9626 "argument is a I<struct timeval>. If an input or output function blocks for "
9627 "this period of time, and data has been sent or received, the return value of "
9628 "that function will be the amount of data transferred; if no data has been "
9629 "transferred and the timeout has been reached, then -1 is returned with "
9630 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9631 "B<connect>(2)) just as if the socket was specified to be nonblocking. If "
9632 "the timeout is set to zero (the default), then the operation will never "
9633 "timeout. Timeouts only have effect for system calls that perform socket I/O "
9634 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9635 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9637 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9638 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9639 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9640 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9641 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> "
9642 "(B<connect>(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定さ"
9643 "れたように見える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操"
9644 "作は決してタイムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット "
9645 "I/O を実行するシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), "
9646 "B<send>(2), B<sendmsg>(2)) である。 B<select>(2), B<poll>(2), "
9647 "B<epoll_wait>(2) などにはタイムアウトは影響を及ぼさない。"
9650 #: build/C/man7/socket.7:649
9652 msgid "B<SO_REUSEADDR>"
9653 msgstr "B<SO_REUSEADDR>"
9656 #: build/C/man7/socket.7:664
9658 "Indicates that the rules used in validating addresses supplied in a "
9659 "B<bind>(2) call should allow reuse of local addresses. For B<AF_INET> "
9660 "sockets this means that a socket may bind, except when there is an active "
9661 "listening socket bound to the address. When the listening socket is bound "
9662 "to B<INADDR_ANY> with a specific port then it is not possible to bind to "
9663 "this port for any local address. Argument is an integer boolean flag."
9665 "B<bind>(2) コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9666 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9667 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9668 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9669 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9670 "ドできない。 引き数はブール整数のフラグである。"
9673 #: build/C/man7/socket.7:664
9675 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9676 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9678 #. commit 3b885787ea4112eaa80945999ea0901bf742707f
9680 #: build/C/man7/socket.7:671
9682 "Indicates that an unsigned 32-bit value ancillary message (cmsg) should be "
9683 "attached to received skbs indicating the number of packets dropped by the "
9684 "socket between the last received packet and this received packet."
9686 "最後の受信パケットとこの受信パケットの間にそのソケットで捨てられた (ドロップ"
9687 "された) パケット数を示す、unsigned 32 ビット値の補助メッセージ (cmsg) を受信"
9688 "した skb に付与することを指示する。"
9691 #: build/C/man7/socket.7:671
9693 msgid "B<SO_SNDBUF>"
9694 msgstr "B<SO_SNDBUF>"
9696 #. Most (all?) other implementations do not do this -- MTK, Dec 05
9697 #. See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9699 #: build/C/man7/socket.7:687
9701 "Sets or gets the maximum socket send buffer in bytes. The kernel doubles "
9702 "this value (to allow space for bookkeeping overhead) when it is set using "
9703 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2). "
9704 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9705 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9706 "file. The minimum (doubled) value for this option is 2048."
9708 "ソケットの送信バッファーの最大サイズを設定・取得する (バイト単位)。 "
9709 "B<setsockopt>(2) を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9710 "保するために) カーネルはこの値を 2倍し、 B<getsockopt>(2) はこの 2倍された"
9711 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9712 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9713 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9716 #: build/C/man7/socket.7:687
9718 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9719 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9722 #: build/C/man7/socket.7:696
9724 "Using this socket option, a privileged (B<CAP_NET_ADMIN>) process can "
9725 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9728 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9729 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9733 #: build/C/man7/socket.7:696
9735 msgid "B<SO_TIMESTAMP>"
9736 msgstr "B<SO_TIMESTAMP>"
9739 #: build/C/man7/socket.7:712
9741 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message. The "
9742 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9743 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9744 "the last packet passed to the user in this call. See B<cmsg>(3) for "
9745 "details on control messages."
9747 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9748 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9749 "ステムコールでユーザーに渡した 最後のパケットの受信時刻を示す I<struct "
9750 "timeval> である。 制御メッセージの詳細については B<cmsg>(3) を参照。"
9753 #: build/C/man7/socket.7:712
9759 #: build/C/man7/socket.7:717
9761 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>). This socket "
9762 "option is read-only."
9764 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9765 "このソケットオプションは読み出し専用である。"
9768 #: build/C/man7/socket.7:717
9770 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9771 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9774 #: build/C/man7/socket.7:726
9776 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9777 "when there is no data. Increasing this value requires B<CAP_NET_ADMIN>. "
9778 "The default for this option is controlled by the I</proc/sys/net/core/"
9781 "データがなかった際にブロッキング受信での busy polling のおおよその時間をマイ"
9782 "クロ秒単位で設定する。 この値を増やすには B<CAP_NET_ADMIN> ケーパビリティが必"
9783 "要である。 このオプションのデフォルト値は I</proc/sys/net/core/busy_read> で"
9787 #: build/C/man7/socket.7:736
9789 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9790 "B<select>(2) and B<poll>(2) will busy poll when they operate on sockets "
9791 "with B<SO_BUSY_POLL> set and no events to report are found."
9793 "I</proc/sys/net/core/busy_poll> の値により、 B<SO_BUSY_POLL> がセットされたソ"
9794 "ケットに対して B<select>(2) や B<poll>(2) を行い、報告すべきイベントがない場"
9795 "合に、 B<select>(2) や B<poll>(2) が busy polling をどのくらいの時間行うかが"
9799 #: build/C/man7/socket.7:740
9801 "In both cases, busy polling will only be done when the socket last received "
9802 "data from a network device that supports this option."
9804 "どちらの場合も、busy polling は、そのソケットが最後にデータを受信したネット"
9805 "ワークデバイスがこのオプションに対応している場合のみ行われる。"
9808 #: build/C/man7/socket.7:744
9810 "While busy polling may improve latency of some applications, care must be "
9811 "taken when using it since this will increase both CPU utilization and power "
9814 "busy polling により遅延が改善されるはアプリケーションもあるが、 busy polling "
9815 "は CPU 使用率と電力使用量をともに増加させることになるので、使用する際は注意し"
9819 #: build/C/man7/socket.7:744
9825 #: build/C/man7/socket.7:755
9827 "When writing onto a connection-oriented socket that has been shut down (by "
9828 "the local or the remote end) B<SIGPIPE> is sent to the writing process and "
9829 "B<EPIPE> is returned. The signal is not sent when the write call specified "
9830 "the B<MSG_NOSIGNAL> flag."
9832 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9833 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9834 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9835 "していた場合はシグナルは送られない。"
9838 #: build/C/man7/socket.7:780
9840 "When requested with the B<FIOSETOWN> B<fcntl>(2) or B<SIOCSPGRP> "
9841 "B<ioctl>(2), B<SIGIO> is sent when an I/O event occurs. It is possible to "
9842 "use B<poll>(2) or B<select>(2) in the signal handler to find out which "
9843 "socket the event occurred on. An alternative (in Linux 2.2) is to set a "
9844 "real-time signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real "
9845 "time signal will be called with the file descriptor in the I<si_fd> field of "
9846 "its I<siginfo_t>. See B<fcntl>(2) for more information."
9848 "B<FIOSETOWN> B<fcntl>(2) や B<SIOCSPGRP> B<ioctl>(2) をプロセスまたはプロセ"
9849 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9850 "る。 B<poll>(2) や B<select>(2) をシグナルハンドラー内で用いれば、どのソ"
9851 "ケットでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方"
9852 "法としては、 B<F_SETSIG> B<fcntl>(2) を用いてリアルタイムシグナルを設定する"
9853 "やり方もある。 リアルタイムシグナルのハンドラーは、 I<siginfo_t> の I<si_fd> "
9854 "フィールドにファイルディスクリプターが入った状態で呼び出される。 詳細は "
9855 "B<fcntl>(2) を参照のこと。"
9857 #. .SS Ancillary messages
9859 #: build/C/man7/socket.7:788
9861 "Under some circumstances (e.g., multiple processes accessing a single "
9862 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9863 "when the process reacts to the signal. If this happens, the process should "
9864 "wait again because Linux will resend the signal later."
9866 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9867 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9868 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9869 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9872 #: build/C/man7/socket.7:788
9874 msgid "/proc interfaces"
9875 msgstr "/proc インターフェース"
9878 #: build/C/man7/socket.7:792
9880 "The core socket networking parameters can be accessed via files in the "
9881 "directory I</proc/sys/net/core/>."
9883 "core のソケットのネットワーキングパラメーターには、 I</proc/sys/net/core/> "
9884 "ディレクトリ内のファイルを通してアクセスできる。"
9887 #: build/C/man7/socket.7:792
9889 msgid "I<rmem_default>"
9890 msgstr "I<rmem_default>"
9893 #: build/C/man7/socket.7:795
9894 msgid "contains the default setting in bytes of the socket receive buffer."
9895 msgstr "ソケットの受信バッファーサイズのデフォルト値 (バイト単位)。"
9898 #: build/C/man7/socket.7:795
9901 msgstr "I<rmem_max>"
9904 #: build/C/man7/socket.7:801
9906 "contains the maximum socket receive buffer size in bytes which a user may "
9907 "set by using the B<SO_RCVBUF> socket option."
9909 "B<SO_RCVBUF> ソケットオプションを用いてユーザーが設定できる ソケットの受信"
9910 "バッファーサイズの最大値 (バイト単位)。"
9913 #: build/C/man7/socket.7:801
9915 msgid "I<wmem_default>"
9916 msgstr "I<wmem_default>"
9919 #: build/C/man7/socket.7:804
9920 msgid "contains the default setting in bytes of the socket send buffer."
9921 msgstr "ソケットの送信バッファーサイズのデフォルト値 (バイト単位)。"
9924 #: build/C/man7/socket.7:804
9927 msgstr "I<wmem_max>"
9930 #: build/C/man7/socket.7:810
9932 "contains the maximum socket send buffer size in bytes which a user may set "
9933 "by using the B<SO_SNDBUF> socket option."
9935 "B<SO_SNDBUF> ソケットオプションを用いてユーザーが設定できる ソケットの送信"
9936 "バッファーサイズの最大値 (バイト単位)。"
9939 #: build/C/man7/socket.7:810
9941 msgid "I<message_cost> and I<message_burst>"
9942 msgstr "I<message_cost> と I<message_burst>"
9945 #: build/C/man7/socket.7:814
9947 "configure the token bucket filter used to load limit warning messages caused "
9948 "by external network events."
9950 "トークンバケットフィルターを設定する。 これは外部のネットワークイベントによっ"
9951 "て引き起こされた 負荷限界の警告メッセージに用いられる。"
9954 #: build/C/man7/socket.7:814
9956 msgid "I<netdev_max_backlog>"
9957 msgstr "I<netdev_max_backlog>"
9960 #: build/C/man7/socket.7:817
9961 msgid "Maximum number of packets in the global input queue."
9962 msgstr "グローバルな入力キューにおける最大のパケット数。"
9965 #: build/C/man7/socket.7:817
9967 msgid "I<optmem_max>"
9968 msgstr "I<optmem_max>"
9970 #. netdev_fastroute is not documented because it is experimental
9972 #: build/C/man7/socket.7:822
9974 "Maximum length of ancillary data and user control data like the iovecs per "
9977 "ソケットあたりの、補助データ (ancillary data) とユーザー制御データ (iovecs の"
9981 #: build/C/man7/socket.7:822
9987 #: build/C/man7/socket.7:825
9988 msgid "These operations can be accessed using B<ioctl>(2):"
9989 msgstr "以下に示す操作には B<ioctl>(2) を用いてアクセスできる。"
9992 #: build/C/man7/socket.7:829
9994 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9995 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9998 #: build/C/man7/socket.7:831
10000 msgid "B<SIOCGSTAMP>"
10001 msgstr "B<SIOCGSTAMP>"
10003 #. type: Plain text
10004 #: build/C/man7/socket.7:855
10006 "Return a I<struct timeval> with the receive timestamp of the last packet "
10007 "passed to the user. This is useful for accurate round trip time "
10008 "measurements. See B<setitimer>(2) for a description of I<struct timeval>. "
10009 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
10010 "set on the socket. Otherwise, it returns the timestamp of the last packet "
10011 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
10012 "packet has been received, (i.e., B<ioctl>(2) returns -1 with I<errno> set "
10015 "最後にユーザーに渡されたパケットの受信タイムスタンプを I<struct timeval> に入"
10016 "れて返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
10017 "timeval> の説明は B<setitimer>(2) を見てほしい。 この ioctl は、ソケットオプ"
10018 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
10019 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
10020 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
10021 "には失敗する (つまり、 B<ioctl>(2) は -1 を返し、 I<errno> に B<ENOENT> を"
10025 #: build/C/man7/socket.7:855
10027 msgid "B<SIOCSPGRP>"
10028 msgstr "B<SIOCSPGRP>"
10030 #. type: Plain text
10031 #: build/C/man7/socket.7:874
10033 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
10034 "when an asynchronous I/O operation has finished or urgent data is "
10035 "available. The argument is a pointer to a I<pid_t>. If the argument is "
10036 "positive, send the signals to that process. If the argument is negative, "
10037 "send the signals to the process group with the ID of the absolute value of "
10038 "the argument. The process may only choose itself or its own process group "
10039 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
10042 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
10043 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポイン"
10044 "ターである。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き"
10045 "数の絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先に"
10046 "は、自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但"
10047 "し、 B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザー ID が 0 の"
10048 "プロセスの場合は この限りではない。"
10051 #: build/C/man7/socket.7:874
10053 msgid "B<FIOASYNC>"
10054 msgstr "B<FIOASYNC>"
10056 #. type: Plain text
10057 #: build/C/man7/socket.7:884
10059 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
10060 "socket. Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
10061 "set with B<F_SETSIG> is raised when a new I/O event occurs."
10063 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
10064 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
10065 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナルセットが発行される。"
10067 #. type: Plain text
10068 #: build/C/man7/socket.7:892
10070 "Argument is an integer boolean flag. (This operation is synonymous with the "
10071 "use of B<fcntl>(2) to set the B<O_ASYNC> flag.)"
10073 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2) を使って "
10074 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10077 #: build/C/man7/socket.7:892
10079 msgid "B<SIOCGPGRP>"
10080 msgstr "B<SIOCGPGRP>"
10082 #. type: Plain text
10083 #: build/C/man7/socket.7:901
10085 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10086 "signals, or 0 when none is set."
10088 "B<SIGIO> や B<SIGURG> を受信したカレントプロセスかプロセスグループを取得す"
10091 #. type: Plain text
10092 #: build/C/man7/socket.7:905
10093 msgid "Valid B<fcntl>(2) operations:"
10094 msgstr "有効な B<fcntl>(2) 操作:"
10097 #: build/C/man7/socket.7:905
10099 msgid "B<FIOGETOWN>"
10100 msgstr "B<FIOGETOWN>"
10102 #. type: Plain text
10103 #: build/C/man7/socket.7:910
10104 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10105 msgstr "B<SIOCGPGRP> B<ioctl>(2) と同じ。"
10108 #: build/C/man7/socket.7:910
10110 msgid "B<FIOSETOWN>"
10111 msgstr "B<FIOSETOWN>"
10113 #. type: Plain text
10114 #: build/C/man7/socket.7:915
10115 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10116 msgstr "B<SIOCSPGRP> B<ioctl>(2) と同じ。"
10118 #. type: Plain text
10119 #: build/C/man7/socket.7:929
10121 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30. B<SO_PASSCRED> is new in "
10122 "Linux 2.2. The I</proc> interfaces was introduced in Linux 2.2. "
10123 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41. "
10124 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10125 "be read or written."
10127 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10128 "2.2 で登場した。 I</proc> インターフェースは Linux 2.2 で導入された。 "
10129 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10130 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10133 #. type: Plain text
10134 #: build/C/man7/socket.7:934
10136 "Linux assumes that half of the send/receive buffer is used for internal "
10137 "kernel structures; thus the values in the corresponding I</proc> files are "
10138 "twice what can be observed on the wire."
10140 "Linux は、送受信バッファーの半分を内部のカーネル構造体で用いると仮定してい"
10141 "る。 したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの "
10144 #. type: Plain text
10145 #: build/C/man7/socket.7:947
10148 #| "Linux will only allow port reuse with the B<SO_REUSEADDR> option when "
10149 #| "this option was set both in the previous program that performed a "
10150 #| "B<bind>(2) to the port and in the program that wants to reuse the port. "
10151 #| "This differs from some implementations (e.g., FreeBSD) where only the "
10152 #| "later program needs to set the B<SO_REUSEADDR> option. Typically this "
10153 #| "difference is invisible, since, for example, a server program is designed "
10154 #| "to always set this option."
10156 "Linux will allow port reuse only with the B<SO_REUSEADDR> option when this "
10157 "option was set both in the previous program that performed a B<bind>(2) to "
10158 "the port and in the program that wants to reuse the port. This differs from "
10159 "some implementations (e.g., FreeBSD) where only the later program needs to "
10160 "set the B<SO_REUSEADDR> option. Typically this difference is invisible, "
10161 "since, for example, a server program is designed to always set this option."
10163 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10164 "のポートに対して B<bind>(2) を前に実行したプログラムとそのポートを再利用 し"
10165 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10166 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10167 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10168 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10169 "このオプションをセットするように設計されるからである。"
10171 #. FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10173 #. This man page was written by Andi Kleen.
10174 #. type: Plain text
10175 #: build/C/man7/socket.7:960
10177 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10178 "B<SO_DETACH_FILTER> are not documented. The suggested interface to use them "
10179 "is via the libpcap library."
10181 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10182 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10185 #. type: Plain text
10186 #: build/C/man7/socket.7:972
10188 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10189 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10192 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10193 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10197 #: build/C/man2/socketcall.2:25
10200 msgstr "SOCKETCALL"
10203 #: build/C/man2/socketcall.2:25
10206 msgstr "2012-10-16"
10208 #. type: Plain text
10209 #: build/C/man2/socketcall.2:28
10210 msgid "socketcall - socket system calls"
10211 msgstr "socketcall - ソケットシステムコール"
10213 #. type: Plain text
10214 #: build/C/man2/socketcall.2:30
10215 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10216 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10218 #. type: Plain text
10219 #: build/C/man2/socketcall.2:38
10221 "B<socketcall>() is a common kernel entry point for the socket system "
10222 "calls. I<call> determines which socket function to invoke. I<args> points "
10223 "to a block containing the actual arguments, which are passed through to the "
10224 "appropriate call."
10226 "B<socketcall>() はソケットシステムコールのための共通のカーネルエントリー ポ"
10227 "イント(kernel entry point)である。 I<call> はどのソケット関数を呼び出すかを指"
10228 "定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブロックを"
10231 #. type: Plain text
10232 #: build/C/man2/socketcall.2:42
10234 "User programs should call the appropriate functions by their usual names. "
10235 "Only standard library implementors and kernel hackers need to know about "
10238 "ユーザープログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標準"
10239 "ライブラリの実装者やカーネルハッカーのみが B<socketcall>() について知る必要"
10242 #. type: Plain text
10243 #: build/C/man2/socketcall.2:45
10245 "This call is specific to Linux, and should not be used in programs intended "
10248 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10251 #. type: Plain text
10252 #: build/C/man2/socketcall.2:53
10254 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10255 "B<socketcall>() system call; instead B<socket>(2), B<accept>(2), "
10256 "B<bind>(2), and so on really are implemented as separate system calls."
10258 "いくつかのアーキテクチャー\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システ"
10259 "ムコール B<socketcall>() が存在しない。実際には、その代わりに B<socket>(2), "
10260 "B<accept>(2), B<bind>(2) などが独立したシステムコールとして実装されている。"
10262 #. type: Plain text
10263 #: build/C/man2/socketcall.2:71
10265 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10266 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10267 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10268 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10270 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10271 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10272 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10273 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10276 #: build/C/man2/socketpair.2:42
10279 msgstr "SOCKETPAIR"
10282 #: build/C/man2/socketpair.2:42
10285 msgstr "2008-10-11"
10287 #. type: Plain text
10288 #: build/C/man2/socketpair.2:45
10289 msgid "socketpair - create a pair of connected sockets"
10290 msgstr "socketpair - 接続されたソケットのペアを作成する"
10292 #. type: Plain text
10293 #: build/C/man2/socketpair.2:52
10295 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10298 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10301 #. type: Plain text
10302 #: build/C/man2/socketpair.2:63
10304 "The B<socketpair>() call creates an unnamed pair of connected sockets in "
10305 "the specified I<domain>, of the specified I<type>, and using the optionally "
10306 "specified I<protocol>. For further details of these arguments, see "
10309 "B<socketpair>() は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10310 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10311 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2) を参照のこと。"
10313 #. type: Plain text
10314 #: build/C/man2/socketpair.2:69
10316 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10317 "and I<sv>[1]. The two sockets are indistinguishable."
10319 "新しいソケットの参照に使用するディスクリプター (descriptor) が I<sv>[0] と "
10320 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10322 #. type: Plain text
10323 #: build/C/man2/socketpair.2:78
10324 msgid "The specified address family is not supported on this machine."
10325 msgstr "このマシンでは指定されたアドレスファミリーがサポートされていない。"
10327 #. type: Plain text
10328 #: build/C/man2/socketpair.2:83
10330 "The address I<sv> does not specify a valid part of the process address space."
10331 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10333 #. type: Plain text
10334 #: build/C/man2/socketpair.2:86
10335 msgid "Too many descriptors are in use by this process."
10336 msgstr "このプロセスが使用しているディスクリプターの数が多すぎる。"
10338 #. type: Plain text
10339 #: build/C/man2/socketpair.2:92
10340 msgid "The specified protocol does not support creation of socket pairs."
10341 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10343 #. type: Plain text
10344 #: build/C/man2/socketpair.2:95
10345 msgid "The specified protocol is not supported on this machine."
10346 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10348 #. type: Plain text
10349 #: build/C/man2/socketpair.2:103
10351 "4.4BSD, POSIX.1-2001. The B<socketpair>() function call appeared in "
10352 "4.2BSD. It is generally portable to/from non-BSD systems supporting clones "
10353 "of the BSD socket layer (including System\\ V variants)."
10355 "4.4BSD, POSIX.1-2001. B<socketpair>() 関数コールは 4.2BSD で現われた。一般"
10356 "に (System\\ V の変種を含めて) BSD のソケット層のクローンをサポートしてい"
10357 "る、BSD 以外のシステムと、 互いに移植性がある。"
10359 #. type: Plain text
10360 #: build/C/man2/socketpair.2:109
10362 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10363 "synonymously, B<AF_LOCAL>). (Most implementations have the same "
10366 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10367 "ある B<AF_LOCAL>) だけである。 (ほとんどの実装で同じ制限がある)"
10369 #. type: Plain text
10370 #: build/C/man2/socketpair.2:118
10372 "Since Linux 2.6.27, B<socketpair>() supports the B<SOCK_NONBLOCK> and "
10373 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10375 "Linux 2.6.27 以降では、 B<socketpair>() は、フラグ B<SOCK_NONBLOCK> と "
10376 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2) を参照のこと。"
10378 #. type: Plain text
10379 #: build/C/man2/socketpair.2:131
10381 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10383 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10385 #~ msgid "2013-12-31"
10386 #~ msgstr "2013-12-31"