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: 2014-04-13 10:27+0900\n"
10 "PO-Revision-Date: 2014-04-14 23:24+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:56 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:56
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:57
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:59
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:63
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:160
272 msgid "B<SOCK_NONBLOCK>"
273 msgstr "B<SOCK_NONBLOCK>"
276 #: build/C/man2/accept.2:170 build/C/man2/socket.2:168
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:168
289 msgid "B<SOCK_CLOEXEC>"
290 msgstr "B<SOCK_CLOEXEC>"
293 #: build/C/man2/accept.2:180 build/C/man2/socket.2:178
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:400 build/C/man2/recvmmsg.2:149
310 #: build/C/man2/select.2:299 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:310
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:416 build/C/man2/recvmmsg.2:157
362 #: build/C/man2/select.2:317 build/C/man2/send.2:280
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:315 build/C/man2/socketpair.2:74
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:421 build/C/man2/send.2:296
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:165
391 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
393 #: build/C/man2/recv.2:430 build/C/man2/select.2:318 build/C/man2/send.2:304
394 #: build/C/man3/sockatmark.3:59
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
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:191
417 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:439
419 #: build/C/man2/send.2:313 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:203
432 #: build/C/man2/recv.2:443 build/C/man2/select.2:323 build/C/man2/send.2:316
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:169
448 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:448
450 #: build/C/man2/recvmmsg.2:161 build/C/man2/select.2:327
451 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:63
452 #: build/C/man2/socket.2:323 build/C/man2/socket.2:326
458 #: build/C/man2/accept.2:244
460 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
463 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
467 #: build/C/man2/accept.2:249
468 msgid "(B<accept4>()) invalid value in I<flags>."
469 msgstr "(B<accept4>()) I<flags> に不正な値が指定されている。"
472 #: build/C/man2/accept.2:249 build/C/man2/socket.2:331
473 #: build/C/man2/socketpair.2:83
479 #: build/C/man2/accept.2:252
480 msgid "The per-process limit of open file descriptors has been reached."
481 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
484 #: build/C/man2/accept.2:252 build/C/man2/socket.2:334
485 #: build/C/man2/socketpair.2:86
491 #: build/C/man2/accept.2:255 build/C/man2/socket.2:337
492 #: build/C/man2/socketpair.2:89
493 msgid "The system limit on the total number of open files has been reached."
494 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
497 #: build/C/man2/accept.2:255
499 msgid "B<ENOBUFS>, B<ENOMEM>"
500 msgstr "B<ENOBUFS>, B<ENOMEM>"
503 #: build/C/man2/accept.2:260
505 "Not enough free memory. This often means that the memory allocation is "
506 "limited by the socket buffer limits, not by the system memory."
508 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
509 "ケットバッファの大きさによるメモリ割り当ての制限である。"
512 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
513 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
515 #: build/C/man2/recv.2:463 build/C/man2/send.2:349
521 #: build/C/man2/accept.2:263
522 msgid "The descriptor references a file, not a socket."
523 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
526 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
527 #: build/C/man2/socketpair.2:89
529 msgid "B<EOPNOTSUPP>"
530 msgstr "B<EOPNOTSUPP>"
533 #: build/C/man2/accept.2:267
534 msgid "The referenced socket is not of type B<SOCK_STREAM>."
535 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
538 #: build/C/man2/accept.2:267
544 #: build/C/man2/accept.2:270
545 msgid "Protocol error."
549 #: build/C/man2/accept.2:274
550 msgid "In addition, Linux B<accept>() may fail if:"
551 msgstr "上記に加えて、Linux の B<accept>() は以下のエラーで失敗する:"
554 #: build/C/man2/accept.2:274
560 #: build/C/man2/accept.2:277
561 msgid "Firewall rules forbid connection."
562 msgstr "ファイアウォールのルールにより接続が禁止された。"
565 #: build/C/man2/accept.2:289
567 "In addition, network errors for the new socket and as defined for the "
568 "protocol may be returned. Various Linux kernels can return other errors "
569 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>. The "
570 "value B<ERESTARTSYS> may be seen during a trace."
572 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
573 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
574 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
575 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>. B<ERESTARTSYS> がトレースの最中に現れるこ"
579 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
580 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:165
581 #: build/C/man2/select.2:336 build/C/man2/sendmmsg.2:145
582 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:913
588 #: build/C/man2/accept.2:294
590 "The B<accept4>() system call is available starting with Linux 2.6.28; "
591 "support in glibc is available starting with version 2.10."
593 "B<accept4>() システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
594 "サポートはバージョン 2.10 以降で利用可能である。"
597 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:225
599 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
600 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
601 #: build/C/man3/if_nametoindex.3:85 build/C/man2/listen.2:106
602 #: build/C/man2/recv.2:468 build/C/man2/recvmmsg.2:170
603 #: build/C/man2/select.2:342 build/C/man2/send.2:368
604 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
605 #: build/C/man2/socket.2:348 build/C/man2/socketcall.2:42
606 #: build/C/man2/socketpair.2:95
608 msgid "CONFORMING TO"
611 #. The BSD man page documents five possible error returns
612 #. (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
613 #. POSIX.1-2001 documents errors
614 #. EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
615 #. ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
616 #. In addition, SUSv2 documents EFAULT and ENOSR.
618 #: build/C/man2/accept.2:306
620 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>() first appeared in "
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>() は 4.2BSD で初めて実装"
627 #: build/C/man2/accept.2:309
628 msgid "B<accept4>() is a nonstandard Linux extension."
629 msgstr "B<accept4>() は非標準の Linux による拡張である。"
631 #. Some testing seems to show that Tru64 5.1 and HP-UX 11 also
632 #. do not inherit file status flags -- MTK Jun 05
634 #: build/C/man2/accept.2:324
636 "On Linux, the new socket returned by B<accept>() does I<not> inherit file "
637 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
638 "socket. This behavior differs from the canonical BSD sockets "
639 "implementation. Portable programs should not rely on inheritance or "
640 "noninheritance of file status flags and always explicitly set all required "
641 "flags on the socket returned from B<accept>()."
643 "Linux では、 B<accept>() が返す新しいソケットは listen を行っているソケット"
644 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
645 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
646 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
647 "() が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:241
653 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
654 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
655 #: build/C/man2/recv.2:478 build/C/man2/select.2:357
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
657 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
658 #: build/C/man2/socket.2:362 build/C/man7/socket.7:927
659 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
665 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
666 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:137 build/C/man2/socket.2:368
668 #: build/C/man2/socketpair.2:124
670 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
671 "this header file is not required on Linux. However, some historical (BSD) "
672 "implementations required this header file, and portable applications are "
673 "probably wise to include it."
675 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
676 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
677 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
678 "ションではこのファイルを インクルードするのが賢明であろう。"
681 #: build/C/man2/accept.2:351
683 "There may not always be a connection waiting after a B<SIGIO> is delivered "
684 "or B<select>(2) or B<poll>(2) return a readability event because the "
685 "connection might have been removed by an asynchronous network error or "
686 "another thread before B<accept>() is called. If this happens, then the "
687 "call will block waiting for the next connection to arrive. To ensure that "
688 "B<accept>() never blocks, the passed socket I<sockfd> needs to have the "
689 "B<O_NONBLOCK> flag set (see B<socket>(7))."
691 "B<SIGIO> が届けられた後や、 B<select>(2) または B<poll>(2) が読み込み可能イ"
692 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
693 "続は、 B<accept>() が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
694 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
695 "この場合、その B<accept>() 呼び出しは停止 (block) し、次の接続の到着を待ちつ"
696 "づける。 B<accept>() に停止を行わせないようにするには、引き数に渡すソケット "
697 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7) を"
701 #: build/C/man2/accept.2:351
703 msgid "The socklen_t type"
707 #: build/C/man2/accept.2:361
709 "The third argument of B<accept>() was originally declared as an I<int *> "
710 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
711 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
712 "*>, and that is what it is for SunOS 5. Later POSIX drafts have I<socklen_t "
713 "*>, and so do the Single UNIX Specification and glibc2. Quoting Linus "
716 "B<accept>() の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
717 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
718 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
719 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
720 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
721 "た。 Linus Torvald の発言を引用する:"
723 #. .I fails: only italicizes a single line
725 #: build/C/man2/accept.2:378
727 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int. "
728 "Anything else breaks any BSD socket layer stuff. POSIX initially I<did> "
729 "make it a size_t, and I (and hopefully others, but obviously not too many) "
730 "complained to them very loudly indeed. Making it a size_t is completely "
731 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
732 "bit architectures, for example. And it I<has> to be the same size as \"int"
733 "\" because that's what the BSD socket interface is. Anyway, the POSIX "
734 "people eventually got a clue, and created \"socklen_t\". They shouldn't "
735 "have touched it in the first place, but once they did they felt it had to "
736 "have a named type for some unfathomable reason (probably somebody didn't "
737 "like losing face over having done the original stupid thing, so they "
738 "silently just renamed their blunder).\""
740 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
741 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
742 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
743 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
744 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
745 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
746 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
747 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
748 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
749 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
750 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
751 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
755 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
756 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
757 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
758 #: build/C/man2/recv.2:513 build/C/man2/recvmmsg.2:173
759 #: build/C/man2/select.2:548 build/C/man2/select_tut.2:529
760 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
761 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:381
767 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
768 msgid "See B<bind>(2)."
769 msgstr "B<bind>(2) 参照。"
772 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
773 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:263
774 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
775 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
776 #: build/C/man3/if_nametoindex.3:89 build/C/man2/listen.2:169
777 #: build/C/man2/recv.2:518 build/C/man2/recvmmsg.2:268
778 #: build/C/man2/select.2:585 build/C/man2/select_tut.2:821
779 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
780 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:386
781 #: build/C/man7/socket.7:958 build/C/man2/socketcall.2:53
782 #: build/C/man2/socketpair.2:124
788 #: build/C/man2/accept.2:388
790 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
797 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
798 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:270
799 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
800 #: build/C/man2/getsockopt.2:212 build/C/man3/if_nameindex.3:154
801 #: build/C/man3/if_nametoindex.3:93 build/C/man2/listen.2:175
802 #: build/C/man2/recv.2:529 build/C/man2/recvmmsg.2:275
803 #: build/C/man2/select.2:599 build/C/man2/select_tut.2:840
804 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
805 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:415
806 #: build/C/man7/socket.7:970 build/C/man2/socketcall.2:71
807 #: build/C/man2/socketpair.2:131
813 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
814 #: build/C/man3/bindresvport.3:123 build/C/man2/connect.2:277
815 #: build/C/man3/getifaddrs.3:322 build/C/man2/getsockname.2:128
816 #: build/C/man2/getsockopt.2:219 build/C/man3/if_nameindex.3:161
817 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:182
818 #: build/C/man2/recv.2:536 build/C/man2/recvmmsg.2:282
819 #: build/C/man2/select.2:606 build/C/man2/select_tut.2:847
820 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
821 #: build/C/man3/sockatmark.3:151 build/C/man2/socket.2:422
822 #: build/C/man7/socket.7:977 build/C/man2/socketcall.2:78
823 #: build/C/man2/socketpair.2:138
825 "This page is part of release 3.63 of the Linux I<man-pages> project. A "
826 "description of the project, and information about reporting bugs, can be "
827 "found at \\%http://www.kernel.org/doc/man-pages/."
829 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.63 の一部\n"
830 "である。プロジェクトの説明とバグ報告に関する情報は\n"
831 "http://www.kernel.org/doc/man-pages/ に書かれている。"
834 #: build/C/man2/bind.2:68
840 #: build/C/man2/bind.2:68
846 #: build/C/man2/bind.2:71
847 msgid "bind - bind a name to a socket"
848 msgstr "bind - ソケットに名前をつける"
851 #: build/C/man2/bind.2:78
854 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
855 "B< socklen_t >I<addrlen>B<);>\n"
857 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
858 "B< socklen_t >I<addrlen>B<);>\n"
861 #: build/C/man2/bind.2:92
863 "When a socket is created with B<socket>(2), it exists in a name space "
864 "(address family) but has no address assigned to it. B<bind>() assigns the "
865 "address specified by I<addr> to the socket referred to by the file "
866 "descriptor I<sockfd>. I<addrlen> specifies the size, in bytes, of the "
867 "address structure pointed to by I<addr>. Traditionally, this operation is "
868 "called \\(lqassigning a name to a socket\\(rq."
870 "B<socket>(2) でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
871 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>() は、"
872 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
873 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
874 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
878 #: build/C/man2/bind.2:99
880 "It is normally necessary to assign a local address using B<bind>() before a "
881 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
883 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2) を"
884 "参照)、通常その前に B<bind>() を使用してローカルアドレスを割り当てる必要があ"
888 #: build/C/man2/bind.2:130
890 "The rules used in name binding vary between address families. Consult the "
891 "manual entries in Section 7 for detailed information. For B<AF_INET> see "
892 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
893 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
894 "B<AF_X25> see B<x25>(7) and for B<AF_NETLINK> see B<netlink>(7)."
896 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
897 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7) を、 B<AF_INET6> は "
898 "B<ipv6>(7) を、 B<AF_UNIX> は B<unix>(7) を、 B<AF_APPLETALK> は B<ddp>"
899 "(7) を、 B<AF_PACKET> は B<packet>(7) を、 B<AF_X25> は B<x25>(7) を、 "
900 "B<AF_NETLINK> は B<netlink>(7) を参照。"
903 #: build/C/man2/bind.2:137
905 "The actual structure passed for the I<addr> argument will depend on the "
906 "address family. The I<sockaddr> structure is defined as something like:"
908 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
909 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
912 #: build/C/man2/bind.2:144
915 "struct sockaddr {\n"
916 " sa_family_t sa_family;\n"
917 " char sa_data[14];\n"
920 "struct sockaddr {\n"
921 " sa_family_t sa_family;\n"
922 " char sa_data[14];\n"
926 #: build/C/man2/bind.2:152
928 "The only purpose of this structure is to cast the structure pointer passed "
929 "in I<addr> in order to avoid compiler warnings. See EXAMPLE below."
931 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
932 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
935 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
936 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
937 #: build/C/man2/socketpair.2:74
939 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
942 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
946 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
947 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
948 #: build/C/man2/send.2:285 build/C/man2/socket.2:316
953 #. e.g., privileged port in AF_INET domain
955 #: build/C/man2/bind.2:162
956 msgid "The address is protected, and the user is not the superuser."
957 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
960 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
961 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
963 msgid "B<EADDRINUSE>"
964 msgstr "B<EADDRINUSE>"
967 #: build/C/man2/bind.2:165
968 msgid "The given address is already in use."
969 msgstr "指定されたアドレスが既に使用中である。"
972 #: build/C/man2/bind.2:169
973 msgid "I<sockfd> is not a valid descriptor."
974 msgstr "I<sockfd> が不正なディスクリプタである。"
976 #. This may change in the future: see
977 #. .I linux/unix/sock.c for details.
979 #: build/C/man2/bind.2:174
980 msgid "The socket is already bound to an address."
981 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
984 #: build/C/man2/bind.2:178
985 msgid "I<sockfd> is a descriptor for a file, not a socket."
987 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
990 #: build/C/man2/bind.2:182
991 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>) sockets:"
992 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>) のソケット特有である:"
995 #: build/C/man2/bind.2:187
997 "Search permission is denied on a component of the path prefix. (See also "
998 "B<path_resolution>(7).)"
1000 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1004 #: build/C/man2/bind.2:187
1006 msgid "B<EADDRNOTAVAIL>"
1007 msgstr "B<EADDRNOTAVAIL>"
1010 #: build/C/man2/bind.2:191
1012 "A nonexistent interface was requested or the requested address was not local."
1014 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1018 #: build/C/man2/bind.2:195
1019 msgid "I<addr> points outside the user's accessible address space."
1020 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1023 #: build/C/man2/bind.2:202
1025 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1026 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1029 #: build/C/man2/bind.2:202
1035 #: build/C/man2/bind.2:206
1036 msgid "Too many symbolic links were encountered in resolving I<addr>."
1037 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1040 #: build/C/man2/bind.2:206
1042 msgid "B<ENAMETOOLONG>"
1043 msgstr "B<ENAMETOOLONG>"
1046 #: build/C/man2/bind.2:210
1047 msgid "I<addr> is too long."
1048 msgstr "I<addr> が長過ぎる。"
1051 #: build/C/man2/bind.2:210
1057 #: build/C/man2/bind.2:213
1058 msgid "The file does not exist."
1059 msgstr "ファイルが存在しない。"
1062 #: build/C/man2/bind.2:213 build/C/man2/recv.2:452 build/C/man2/select.2:333
1063 #: build/C/man2/send.2:343
1069 #: build/C/man2/bind.2:216
1070 msgid "Insufficient kernel memory was available."
1071 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1074 #: build/C/man2/bind.2:216
1080 #: build/C/man2/bind.2:219
1081 msgid "A component of the path prefix is not a directory."
1082 msgstr "パス名の構成要素がディレクトリではない。"
1085 #: build/C/man2/bind.2:219
1091 #: build/C/man2/bind.2:222
1092 msgid "The socket inode would reside on a read-only filesystem."
1093 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1095 #. SVr4 documents an additional
1097 #. general error condition, and
1102 #. UNIX-domain error conditions.
1104 #: build/C/man2/bind.2:234
1105 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>() first appeared in 4.2BSD)."
1106 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>() は 4.2BSD で最初に現われた)。"
1109 #: build/C/man2/bind.2:251
1111 "The third argument of B<bind>() is in reality an I<int> (and this is what 4."
1112 "x BSD and libc4 and libc5 have). Some POSIX confusion resulted in the "
1113 "present I<socklen_t>, also used by glibc. See also B<accept>(2)."
1115 "B<bind>() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1116 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1117 "少し混乱がある。 詳しくは B<accept>(2) を参照のこと。"
1120 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1121 #: build/C/man2/select.2:485 build/C/man2/send.2:414
1122 #: build/C/man3/sockatmark.3:100 build/C/man7/socket.7:945
1127 #. FIXME What *are* transparent proxy options?
1129 #: build/C/man2/bind.2:254
1130 msgid "The transparent proxy options are not described."
1131 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1134 #: build/C/man2/bind.2:259
1136 "An example of the use of B<bind>() with Internet domain sockets can be "
1137 "found in B<getaddrinfo>(3)."
1139 "インターネット・ドメイン・ソケットでの B<bind>() の利用例が B<getaddrinfo>"
1142 #. listen.7 refers to this example.
1143 #. accept.7 refers to this example.
1144 #. unix.7 refers to this example.
1146 #: build/C/man2/bind.2:266
1148 "The following example shows how to bind a stream socket in the UNIX "
1149 "(B<AF_UNIX>) domain, and accept connections:"
1151 "以下の例は、UNIX ドメイン (B<AF_UNIX>) でストリームソケットを bind する方法"
1155 #: build/C/man2/bind.2:273
1158 "#include E<lt>sys/socket.hE<gt>\n"
1159 "#include E<lt>sys/un.hE<gt>\n"
1160 "#include E<lt>stdlib.hE<gt>\n"
1161 "#include E<lt>stdio.hE<gt>\n"
1162 "#include E<lt>string.hE<gt>\n"
1164 "#include E<lt>sys/socket.hE<gt>\n"
1165 "#include E<lt>sys/un.hE<gt>\n"
1166 "#include E<lt>stdlib.hE<gt>\n"
1167 "#include E<lt>stdio.hE<gt>\n"
1168 "#include E<lt>string.hE<gt>\n"
1171 #: build/C/man2/bind.2:276
1174 "#define MY_SOCK_PATH \"/somepath\"\n"
1175 "#define LISTEN_BACKLOG 50\n"
1177 "#define MY_SOCK_PATH \"/somepath\"\n"
1178 "#define LISTEN_BACKLOG 50\n"
1181 #: build/C/man2/bind.2:279
1184 "#define handle_error(msg) \\e\n"
1185 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1187 "#define handle_error(msg) \\e\n"
1188 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1191 #: build/C/man2/bind.2:286
1195 "main(int argc, char *argv[])\n"
1198 " struct sockaddr_un my_addr, peer_addr;\n"
1199 " socklen_t peer_addr_size;\n"
1202 "main(int argc, char *argv[])\n"
1205 " struct sockaddr_un my_addr, peer_addr;\n"
1206 " socklen_t peer_addr_size;\n"
1209 #: build/C/man2/bind.2:290
1212 " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1214 " handle_error(\"socket\");\n"
1216 " sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1218 " handle_error(\"socket\");\n"
1221 #: build/C/man2/bind.2:296
1224 " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1225 " /* Clear structure */\n"
1226 " my_addr.sun_family = AF_UNIX;\n"
1227 " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1228 " sizeof(my_addr.sun_path) - 1);\n"
1230 " memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1231 " /* Clear structure */\n"
1232 " my_addr.sun_family = AF_UNIX;\n"
1233 " strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1234 " sizeof(my_addr.sun_path) - 1);\n"
1237 #: build/C/man2/bind.2:300
1240 " if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1241 " sizeof(struct sockaddr_un)) == -1)\n"
1242 " handle_error(\"bind\");\n"
1244 " if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1245 " sizeof(struct sockaddr_un)) == -1)\n"
1246 " handle_error(\"bind\");\n"
1249 #: build/C/man2/bind.2:303
1252 " if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1253 " handle_error(\"listen\");\n"
1255 " if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1256 " handle_error(\"listen\");\n"
1259 #: build/C/man2/bind.2:306
1262 " /* Now we can accept incoming connections one\n"
1263 " at a time using accept(2) */\n"
1265 " /* Now we can accept incoming connections one\n"
1266 " at a time using accept(2) */\n"
1269 #: build/C/man2/bind.2:312
1272 " peer_addr_size = sizeof(struct sockaddr_un);\n"
1273 " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1274 " &peer_addr_size);\n"
1276 " handle_error(\"accept\");\n"
1278 " peer_addr_size = sizeof(struct sockaddr_un);\n"
1279 " cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1280 " &peer_addr_size)\n"
1282 " handle_error(\"accept\");\n"
1285 #: build/C/man2/bind.2:314
1287 msgid " /* Code to deal with incoming connection(s)... */\n"
1288 msgstr " /* Code to deal with incoming connection(s)... */\n"
1291 #: build/C/man2/bind.2:318
1294 " /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1295 " should be deleted using unlink(2) or remove(3) */\n"
1298 " /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1299 " should be deleted using unlink(2) or remove(3) */\n"
1303 #: build/C/man2/bind.2:332
1305 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1306 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1307 "(7), B<socket>(7), B<unix>(7)"
1309 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1310 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1311 "(7), B<socket>(7), B<unix>(7)"
1314 #: build/C/man3/bindresvport.3:30
1316 msgid "BINDRESVPORT"
1317 msgstr "BINDRESVPORT"
1320 #: build/C/man3/bindresvport.3:30
1326 #: build/C/man3/bindresvport.3:33
1327 msgid "bindresvport - bind a socket to a privileged IP port"
1328 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1331 #: build/C/man3/bindresvport.3:37
1334 "B<#include E<lt>sys/types.hE<gt>>\n"
1335 "B<#include E<lt>netinet/in.hE<gt>>\n"
1337 "B<#include E<lt>sys/types.hE<gt>>\n"
1338 "B<#include E<lt>netinet/in.hE<gt>>\n"
1341 #: build/C/man3/bindresvport.3:39
1343 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1344 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1346 #. Glibc actually starts searching with a port # in the range 600 to 1023
1348 #: build/C/man3/bindresvport.3:46
1350 "B<bindresvport>() is used to bind a socket descriptor to a privileged "
1351 "anonymous IP port, that is, a port number arbitrarily selected from the "
1352 "range 512 to 1023."
1354 "B<bindresvport>() は、ソケット・ディスクリプタを特権無名 (privileged "
1355 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1356 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1359 #: build/C/man3/bindresvport.3:56
1361 "If the B<bind>(2) performed by B<bindresvport>() is successful, and I<sin> "
1362 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1365 "B<bindresvport>() によって実行された B<bind>(2) が成功し、 I<sin> が NULL "
1366 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1370 #: build/C/man3/bindresvport.3:67
1372 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1373 "to be B<AF_INET>. However, in this case, B<bindresvport>() has no way to "
1374 "return the port number actually allocated. (This information can later be "
1375 "obtained using B<getsockname>(2).)"
1377 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1378 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1379 "() は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1380 "ト番号は、後で B<getsockname>(2) を使って取得できる)。"
1383 #: build/C/man3/bindresvport.3:72
1385 "B<bindresvport>() returns 0 on success; otherwise -1 is returned and "
1386 "I<errno> set to indicate the cause of the error."
1388 "B<bindresvport>() は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1389 "I<errno> にエラーの原因を示す値を設定する。"
1392 #: build/C/man3/bindresvport.3:77
1394 "B<bindresvport>() can fail for any of the same reasons as B<bind>(2). In "
1395 "addition, the following errors may occur:"
1397 "B<bindresvport>() は B<bind>(2) と同じ原因で失敗する可能性がある。 さらに、"
1401 #: build/C/man3/bindresvport.3:82
1403 "The caller did not have superuser privilege (to be precise: the "
1404 "B<CAP_NET_BIND_SERVICE> capability is required)."
1406 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1407 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1410 #: build/C/man3/bindresvport.3:85
1411 msgid "All privileged ports are in use."
1412 msgstr "全ての特権ポートが使用中である。"
1415 #: build/C/man3/bindresvport.3:85
1417 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1418 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1421 #: build/C/man3/bindresvport.3:92
1422 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1424 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1427 #: build/C/man3/bindresvport.3:92 build/C/man3/sockatmark.3:73
1433 #: build/C/man3/bindresvport.3:93 build/C/man3/sockatmark.3:74
1435 msgid "Multithreading (see pthreads(7))"
1436 msgstr "マルチスレッディング (pthreads(7) 参照)"
1439 #: build/C/man3/bindresvport.3:98
1441 "Before glibc 2.17, the B<bindresvport>() function uses a static variable "
1442 "that is not protected, so it is not thread-safe."
1444 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1445 "静的変数を使用しているため、スレッドセーフではない。"
1447 #. commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1449 #: build/C/man3/bindresvport.3:104
1451 "Since glibc 2.17, the B<bindresvport>() function uses a lock to protect "
1452 "static variable, so it is thread-safe."
1454 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1458 #: build/C/man3/bindresvport.3:107
1460 "Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other systems."
1462 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1465 #: build/C/man3/bindresvport.3:113
1467 "Unlike some B<bindresvport>() implementations, the glibc implementation "
1468 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1470 "B<bindresvport>() のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1471 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1474 #: build/C/man3/bindresvport.3:116
1475 msgid "B<bind>(2), B<getsockname>(2)"
1476 msgstr "B<bind>(2), B<getsockname>(2)"
1479 #: build/C/man2/connect.2:67
1485 #: build/C/man2/connect.2:67 build/C/man2/getsockname.2:40
1491 #: build/C/man2/connect.2:70
1492 msgid "connect - initiate a connection on a socket"
1493 msgstr "connect - ソケットの接続を行う"
1496 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1497 #: build/C/man2/listen.2:51
1499 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */\n"
1500 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */\n"
1503 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1504 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1505 #: build/C/man2/recv.2:51
1507 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1508 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1511 #: build/C/man2/connect.2:78
1514 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1515 "B< socklen_t >I<addrlen>B<);>\n"
1517 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1518 "B< socklen_t >I<addrlen>B<);>\n"
1521 #: build/C/man2/connect.2:97
1523 "The B<connect>() system call connects the socket referred to by the file "
1524 "descriptor I<sockfd> to the address specified by I<addr>. The I<addrlen> "
1525 "argument specifies the size of I<addr>. The format of the address in "
1526 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1527 "B<socket>(2) for further details."
1529 "B<connect>() システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1530 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1531 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1532 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2) を参照の"
1536 #: build/C/man2/connect.2:113
1538 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1539 "to which datagrams are sent by default, and the only address from which "
1540 "datagrams are received. If the socket is of type B<SOCK_STREAM> or "
1541 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1542 "that is bound to the address specified by I<addr>."
1544 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1545 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1546 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1547 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1551 #: build/C/man2/connect.2:127
1553 "Generally, connection-based protocol sockets may successfully B<connect>() "
1554 "only once; connectionless protocol sockets may use B<connect>() multiple "
1555 "times to change their association. Connectionless sockets may dissolve the "
1556 "association by connecting to an address with the I<sa_family> member of "
1557 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1559 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1560 "() が成功する。 コネクションレス (connectionless) プロトコルでは対応を変更す"
1561 "るために何度も B<connect>() を使用できる。 非接続ソケットは I<sockaddr> の "
1562 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1563 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1566 #: build/C/man2/connect.2:132
1568 "If the connection or binding succeeds, zero is returned. On error, -1 is "
1569 "returned, and I<errno> is set appropriately."
1571 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1575 #: build/C/man2/connect.2:135
1577 "The following are general socket errors only. There may be other domain-"
1578 "specific error codes."
1580 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1584 #: build/C/man2/connect.2:143
1586 "For UNIX domain sockets, which are identified by pathname: Write permission "
1587 "is denied on the socket file, or search permission is denied for one of the "
1588 "directories in the path prefix. (See also B<path_resolution>(7).)"
1590 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1591 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1592 "がなかった。 (B<path_resolution>(7) も参照のこと)"
1595 #: build/C/man2/connect.2:143
1597 msgid "B<EACCES>, B<EPERM>"
1598 msgstr "B<EACCES>, B<EPERM>"
1601 #: build/C/man2/connect.2:148
1603 "The user tried to connect to a broadcast address without having the socket "
1604 "broadcast flag enabled or the connection request failed because of a local "
1607 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1608 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1612 #: build/C/man2/connect.2:151
1613 msgid "Local address is already in use."
1614 msgstr "ローカルアドレスが既に使用されている。"
1617 #: build/C/man2/connect.2:151 build/C/man2/socket.2:320
1618 #: build/C/man2/socketpair.2:75
1620 msgid "B<EAFNOSUPPORT>"
1621 msgstr "B<EAFNOSUPPORT>"
1624 #: build/C/man2/connect.2:156
1626 "The passed address didn't have the correct address family in its "
1627 "I<sa_family> field."
1629 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1633 #: build/C/man2/connect.2:156
1639 #: build/C/man2/connect.2:165
1641 "No more free local ports or insufficient entries in the routing cache. For "
1642 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1643 "B<ip>(7) for information on how to increase the number of local ports."
1645 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1646 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1647 "(7) の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1650 #: build/C/man2/connect.2:165
1653 msgstr "B<EALREADY>"
1656 #: build/C/man2/connect.2:169
1658 "The socket is nonblocking and a previous connection attempt has not yet been "
1661 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1664 #: build/C/man2/connect.2:172
1665 msgid "The file descriptor is not a valid index in the descriptor table."
1667 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1671 #: build/C/man2/connect.2:172 build/C/man2/recv.2:435
1673 msgid "B<ECONNREFUSED>"
1674 msgstr "B<ECONNREFUSED>"
1677 #: build/C/man2/connect.2:175
1678 msgid "No-one listening on the remote address."
1679 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1682 #: build/C/man2/connect.2:178
1683 msgid "The socket structure address is outside the user's address space."
1684 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1687 #: build/C/man2/connect.2:178
1689 msgid "B<EINPROGRESS>"
1690 msgstr "B<EINPROGRESS>"
1693 #: build/C/man2/connect.2:203
1695 "The socket is nonblocking and the connection cannot be completed "
1696 "immediately. It is possible to B<select>(2) or B<poll>(2) for completion "
1697 "by selecting the socket for writing. After B<select>(2) indicates "
1698 "writability, use B<getsockopt>(2) to read the B<SO_ERROR> option at level "
1699 "B<SOL_SOCKET> to determine whether B<connect>() completed successfully "
1700 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1701 "error codes listed here, explaining the reason for the failure)."
1703 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1704 "できない。その場合、 B<select>(2) や B<poll>(2) を使ってそのソケットが書き"
1705 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2) "
1706 "で書き込み可能になった後に、 B<getsockopt>(2) を使って B<SOL_SOCKET> レベル"
1707 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>() が成功したか、"
1708 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1709 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1712 #. For TCP, the connection will complete asynchronously.
1713 #. See http://lkml.org/lkml/2005/7/12/254
1715 #: build/C/man2/connect.2:209
1717 "The system call was interrupted by a signal that was caught; see B<signal>"
1720 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7) 参照。"
1723 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1729 #: build/C/man2/connect.2:212
1730 msgid "The socket is already connected."
1731 msgstr "ソケットは既に接続 (connect) されている。"
1734 #: build/C/man2/connect.2:212
1736 msgid "B<ENETUNREACH>"
1737 msgstr "B<ENETUNREACH>"
1740 #: build/C/man2/connect.2:215
1741 msgid "Network is unreachable."
1742 msgstr "到達できないネットワークである。"
1745 #: build/C/man2/connect.2:218
1746 msgid "The file descriptor is not associated with a socket."
1747 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1750 #: build/C/man2/connect.2:218
1752 msgid "B<ETIMEDOUT>"
1753 msgstr "B<ETIMEDOUT>"
1756 #: build/C/man2/connect.2:225
1758 "Timeout while attempting connection. The server may be too busy to accept "
1759 "new connections. Note that for IP sockets the timeout may be very long when "
1760 "syncookies are enabled on the server."
1762 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1763 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1764 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1767 #. SVr4 documents the additional
1768 #. general error codes
1769 #. .BR EADDRNOTAVAIL ,
1771 #. .BR EAFNOSUPPORT ,
1778 #. documents many additional error conditions not described here.
1780 #: build/C/man2/connect.2:241
1782 "SVr4, 4.4BSD, (the B<connect>() function first appeared in 4.2BSD), "
1785 "SVr4, 4.4BSD, (B<connect>() 関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1788 #: build/C/man2/connect.2:258
1790 "The third argument of B<connect>() is in reality an I<int> (and this is "
1791 "what 4.x BSD and libc4 and libc5 have). Some POSIX confusion resulted in "
1792 "the present I<socklen_t>, also used by glibc. See also B<accept>(2)."
1794 "B<connect>() の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1795 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1796 "glibc でも I<socklen_t> を使っている。 B<accept>(2) も参照のこと。"
1799 #: build/C/man2/connect.2:263
1800 msgid "An example of the use of B<connect>() is shown in B<getaddrinfo>(3)."
1801 msgstr "B<connect>() の利用例が B<getaddrinfo>(3) に記載されている。"
1804 #: build/C/man2/connect.2:270
1806 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1807 "B<path_resolution>(7)"
1809 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1810 "B<path_resolution>(7)"
1813 #: build/C/man3/getifaddrs.3:36
1819 #: build/C/man3/getifaddrs.3:36
1825 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1826 #: build/C/man3/if_nametoindex.3:25
1832 #: build/C/man3/getifaddrs.3:39
1833 msgid "getifaddrs, freeifaddrs - get interface addresses"
1834 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1837 #: build/C/man3/getifaddrs.3:43
1840 "B<#include E<lt>sys/types.hE<gt>>\n"
1841 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1843 "B<#include E<lt>sys/types.hE<gt>>\n"
1844 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1847 #: build/C/man3/getifaddrs.3:45
1849 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1850 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1853 #: build/C/man3/getifaddrs.3:47
1855 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1856 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1859 #: build/C/man3/getifaddrs.3:58
1861 "The B<getifaddrs>() function creates a linked list of structures describing "
1862 "the network interfaces of the local system, and stores the address of the "
1863 "first item of the list in I<*ifap>. The list consists of I<ifaddrs> "
1864 "structures, defined as follows:"
1866 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1867 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1868 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1872 #: build/C/man3/getifaddrs.3:77
1875 "struct ifaddrs {\n"
1876 " struct ifaddrs *ifa_next; /* Next item in list */\n"
1877 " char *ifa_name; /* Name of interface */\n"
1878 " unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */\n"
1879 " struct sockaddr *ifa_addr; /* Address of interface */\n"
1880 " struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1882 " struct sockaddr *ifu_broadaddr;\n"
1883 " /* Broadcast address of interface */\n"
1884 " struct sockaddr *ifu_dstaddr;\n"
1885 " /* Point-to-point destination address */\n"
1887 "#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1888 "#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n"
1889 " void *ifa_data; /* Address-specific data */\n"
1892 "struct ifaddrs {\n"
1893 " struct ifaddrs *ifa_next; /* Next item in list */\n"
1894 " char *ifa_name; /* Name of interface */\n"
1895 " unsigned int ifa_flags; /* Flags from SIOCGIFFLAGS */\n"
1896 " struct sockaddr *ifa_addr; /* Address of interface */\n"
1897 " struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1899 " struct sockaddr *ifu_broadaddr;\n"
1900 " /* Broadcast address of interface */\n"
1901 " struct sockaddr *ifu_dstaddr;\n"
1902 " /* Point-to-point destination address */\n"
1904 "#define ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1905 "#define ifa_dstaddr ifa_ifu.ifu_dstaddr\n"
1906 " void *ifa_data; /* Address-specific data */\n"
1910 #: build/C/man3/getifaddrs.3:84
1912 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1913 "or NULL if this is the last item of the list."
1915 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1916 "素がリストの最後の場合には NULL が入る。"
1920 #. indicates the maximum length of this field.
1922 #: build/C/man3/getifaddrs.3:91
1923 msgid "The I<ifa_name> points to the null-terminated interface name."
1924 msgstr "I<ifa_name> は NULL 終端されたインターフェース名を指す。"
1927 #: build/C/man3/getifaddrs.3:100
1929 "The I<ifa_flags> field contains the interface flags, as returned by the "
1930 "B<SIOCGIFFLAGS> B<ioctl>(2) operation (see B<netdevice>(7) for a list of "
1933 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1934 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1935 "B<netdevice>(7) を参照)。"
1938 #: build/C/man3/getifaddrs.3:109
1940 "The I<ifa_addr> field points to a structure containing the interface "
1941 "address. (The I<sa_family> subfield should be consulted to determine the "
1942 "format of the address structure.) This field may contain a null pointer."
1944 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
1945 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
1946 "すべきである)。 このフィールドは NULL ポインタとなる場合がある。"
1949 #: build/C/man3/getifaddrs.3:116
1951 "The I<ifa_netmask> field points to a structure containing the netmask "
1952 "associated with I<ifa_addr>, if applicable for the address family. This "
1953 "field may contain a null pointer."
1955 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
1956 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
1957 "る。 このフィールドは NULL ポインタとなる場合がある。"
1960 #: build/C/man3/getifaddrs.3:131
1962 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1963 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1964 "will contain the broadcast address associated with I<ifa_addr> (if "
1965 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1966 "destination address of the point-to-point interface."
1968 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
1969 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
1970 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
1971 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
1972 "point インターフェースの宛先アドレスが入るかが決まる。"
1975 #: build/C/man3/getifaddrs.3:136
1977 "The I<ifa_data> field points to a buffer containing address-family-specific "
1978 "data; this field may be NULL if there is no such data for this interface."
1980 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
1981 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
1985 #: build/C/man3/getifaddrs.3:142
1987 "The data returned by B<getifaddrs>() is dynamically allocated and should be "
1988 "freed using B<freeifaddrs>() when no longer needed."
1990 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
1991 "B<freeifaddrs>() を使って解放すべきである。"
1994 #: build/C/man3/getifaddrs.3:149
1996 "On success, B<getifaddrs>() returns zero; on error, -1 is returned, and "
1997 "I<errno> is set appropriately."
1999 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2003 #: build/C/man3/getifaddrs.3:162
2005 "B<getifaddrs>() may fail and set I<errno> for any of the errors specified "
2006 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
2007 "(2), B<malloc>(3), or B<realloc>(3)."
2009 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には B<socket>"
2010 "(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>"
2011 "(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定される。"
2014 #: build/C/man3/getifaddrs.3:170
2016 "The B<getifaddrs>() function first appeared in glibc 2.3, but before glibc "
2017 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2018 "added in glibc 2.3.3. Support of address families other than IPv4 is "
2019 "available only on kernels that support netlink."
2021 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2022 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2023 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2024 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2026 #. , but the BSD-derived documentation generally
2027 #. appears to be confused and obsolete on this point.
2028 #. i.e., commonly it still says one of them will be NULL, even if
2029 #. the ifa_ifu union is already present
2031 #: build/C/man3/getifaddrs.3:190
2033 "Not in POSIX.1-2001. This function first appeared in BSDi and is present on "
2034 "the BSD systems, but with slightly different semantics documented"
2035 "\\(emreturning one entry per interface, not per address. This means "
2036 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2037 "address, and no link-level address is returned if the interface has an IP "
2038 "address assigned. Also, the way of choosing either I<ifa_broadaddr> or "
2039 "I<ifa_dstaddr> differs on various systems."
2041 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2042 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2043 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2044 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2045 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2046 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2047 "どちらを選択するかを決める方法は、 システムにより異なる。"
2050 #: build/C/man3/getifaddrs.3:207
2052 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2053 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2054 "containing lower-level details about the interface and its physical layer. "
2055 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2056 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2057 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2058 "hE<gt>>), which contains various interface attributes and statistics."
2060 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2061 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2062 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2063 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2064 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2065 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2066 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2067 "インターフェースの様々な属性や統計情報が入る。"
2070 #: build/C/man3/getifaddrs.3:214
2072 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2073 "and B<getnameinfo>(3). Here is what we see when running this program on one "
2076 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2077 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2080 #: build/C/man3/getifaddrs.3:235
2084 "lo AF_PACKET (17)\n"
2085 " tx_packets = 524; rx_packets = 524\n"
2086 " tx_bytes = 38788; rx_bytes = 38788\n"
2087 "wlp3s0 AF_PACKET (17)\n"
2088 " tx_packets = 108391; rx_packets = 130245\n"
2089 " tx_bytes = 30420659; rx_bytes = 94230014\n"
2090 "em1 AF_PACKET (17)\n"
2091 " tx_packets = 0; rx_packets = 0\n"
2092 " tx_bytes = 0; rx_bytes = 0\n"
2094 " address: E<lt>127.0.0.1E<gt>\n"
2095 "wlp3s0 AF_INET (2)\n"
2096 " address: E<lt>192.168.235.137E<gt>\n"
2097 "lo AF_INET6 (10)\n"
2098 " address: E<lt>::1E<gt>\n"
2099 "wlp3s0 AF_INET6 (10)\n"
2100 " address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2103 "lo AF_PACKET (17)\n"
2104 " tx_packets = 524; rx_packets = 524\n"
2105 " tx_bytes = 38788; rx_bytes = 38788\n"
2106 "wlp3s0 AF_PACKET (17)\n"
2107 " tx_packets = 108391; rx_packets = 130245\n"
2108 " tx_bytes = 30420659; rx_bytes = 94230014\n"
2109 "em1 AF_PACKET (17)\n"
2110 " tx_packets = 0; rx_packets = 0\n"
2111 " tx_bytes = 0; rx_bytes = 0\n"
2113 " address: E<lt>127.0.0.1E<gt>\n"
2114 "wlp3s0 AF_INET (2)\n"
2115 " address: E<lt>192.168.235.137E<gt>\n"
2116 "lo AF_INET6 (10)\n"
2117 " address: E<lt>::1E<gt>\n"
2118 "wlp3s0 AF_INET6 (10)\n"
2119 " address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2122 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2123 #: build/C/man2/recvmmsg.2:206
2125 msgid "Program source"
2129 #: build/C/man3/getifaddrs.3:249
2132 "#define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2133 "#include E<lt>arpa/inet.hE<gt>\n"
2134 "#include E<lt>sys/socket.hE<gt>\n"
2135 "#include E<lt>netdb.hE<gt>\n"
2136 "#include E<lt>ifaddrs.hE<gt>\n"
2137 "#include E<lt>stdio.hE<gt>\n"
2138 "#include E<lt>stdlib.hE<gt>\n"
2139 "#include E<lt>unistd.hE<gt>\n"
2140 "#include E<lt>linux/if_link.hE<gt>\n"
2142 "#define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2143 "#include E<lt>arpa/inet.hE<gt>\n"
2144 "#include E<lt>sys/socket.hE<gt>\n"
2145 "#include E<lt>netdb.hE<gt>\n"
2146 "#include E<lt>ifaddrs.hE<gt>\n"
2147 "#include E<lt>stdio.hE<gt>\n"
2148 "#include E<lt>stdlib.hE<gt>\n"
2149 "#include E<lt>unistd.hE<gt>\n"
2150 "#include E<lt>linux/if_link.hE<gt>\n"
2153 #: build/C/man3/getifaddrs.3:255
2156 "int main(int argc, char *argv[])\n"
2158 " struct ifaddrs *ifaddr, *ifa;\n"
2159 " int family, s, n;\n"
2160 " char host[NI_MAXHOST];\n"
2162 "int main(int argc, char *argv[])\n"
2164 " struct ifaddrs *ifaddr, *ifa;\n"
2165 " int family, s, n;\n"
2166 " char host[NI_MAXHOST];\n"
2169 #: build/C/man3/getifaddrs.3:260
2172 " if (getifaddrs(&ifaddr) == -1) {\n"
2173 " perror(\"getifaddrs\");\n"
2174 " exit(EXIT_FAILURE);\n"
2177 " if (getifaddrs(&ifaddr) == -1) {\n"
2178 " perror(\"getifaddrs\");\n"
2179 " exit(EXIT_FAILURE);\n"
2183 #: build/C/man3/getifaddrs.3:263
2186 " /* Walk through linked list, maintaining head pointer so we\n"
2187 " can free list later */\n"
2189 " /* Walk through linked list, maintaining head pointer so we\n"
2190 " can free list later */\n"
2193 #: build/C/man3/getifaddrs.3:267
2196 " for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2197 " if (ifa-E<gt>ifa_addr == NULL)\n"
2200 " for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2201 " if (ifa-E<gt>ifa_addr == NULL)\n"
2205 #: build/C/man3/getifaddrs.3:269
2207 msgid " family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2208 msgstr " family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2211 #: build/C/man3/getifaddrs.3:272
2214 " /* Display interface name and family (including symbolic\n"
2215 " form of the latter for the common families) */\n"
2217 " /* Display interface name and family (including symbolic\n"
2218 " form of the latter for the common families) */\n"
2221 #: build/C/man3/getifaddrs.3:279
2224 " printf(\"%-8s %s (%d)\\en\",\n"
2225 " ifa-E<gt>ifa_name,\n"
2226 " (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2227 " (family == AF_INET) ? \"AF_INET\" :\n"
2228 " (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2231 " printf(\"%-8s %s (%d)\\en\",\n"
2232 " ifa-E<gt>ifa_name,\n"
2233 " (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2234 " (family == AF_INET) ? \"AF_INET\" :\n"
2235 " (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2239 #: build/C/man3/getifaddrs.3:281
2241 msgid " /* For an AF_INET* interface address, display the address */\n"
2242 msgstr " /* For an AF_INET* interface address, display the address */\n"
2245 #: build/C/man3/getifaddrs.3:292
2248 " if (family == AF_INET || family == AF_INET6) {\n"
2249 " s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2250 " (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2251 " sizeof(struct sockaddr_in6),\n"
2252 " host, NI_MAXHOST,\n"
2253 " NULL, 0, NI_NUMERICHOST);\n"
2255 " printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2256 " exit(EXIT_FAILURE);\n"
2259 " if (family == AF_INET || family == AF_INET6) {\n"
2260 " s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2261 " (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2262 " sizeof(struct sockaddr_in6),\n"
2263 " host, NI_MAXHOST,\n"
2264 " NULL, 0, NI_NUMERICHOST);\n"
2266 " printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2267 " exit(EXIT_FAILURE);\n"
2271 #: build/C/man3/getifaddrs.3:294
2273 msgid " printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2274 msgstr " printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2277 #: build/C/man3/getifaddrs.3:297
2280 " } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2281 " struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2283 " } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2284 " struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2287 #: build/C/man3/getifaddrs.3:304
2290 " printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2291 " \"\\et\\ettx_bytes = %10u; rx_bytes = %10u\\en\",\n"
2292 " stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2293 " stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2297 " printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2298 " \"\\et\\ettx_bytes = %10u; rx_bytes = %10u\\en\",\n"
2299 " stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2300 " stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2305 #: build/C/man3/getifaddrs.3:308
2308 " freeifaddrs(ifaddr);\n"
2309 " exit(EXIT_SUCCESS);\n"
2312 " freeifaddrs(ifaddr);\n"
2313 " exit(EXIT_SUCCESS);\n"
2317 #: build/C/man3/getifaddrs.3:315
2319 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2321 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2324 #: build/C/man2/getsockname.2:40
2327 msgstr "GETSOCKNAME"
2330 #: build/C/man2/getsockname.2:43
2331 msgid "getsockname - get socket name"
2332 msgstr "getsockname - ソケットの名前を取得する"
2335 #: build/C/man2/getsockname.2:49
2337 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2338 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2341 #: build/C/man2/getsockname.2:62
2343 "B<getsockname>() returns the current address to which the socket I<sockfd> "
2344 "is bound, in the buffer pointed to by I<addr>. The I<addrlen> argument "
2345 "should be initialized to indicate the amount of space (in bytes) pointed to "
2346 "by I<addr>. On return it contains the actual size of the socket address."
2348 "B<getsockname>() は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2349 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2350 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2351 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2355 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2356 #: build/C/man2/listen.2:96
2357 msgid "The argument I<sockfd> is not a valid descriptor."
2358 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2361 #: build/C/man2/getsockname.2:84
2363 "The I<addr> argument points to memory not in a valid part of the process "
2366 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2370 #: build/C/man2/getsockname.2:88
2371 msgid "I<addrlen> is invalid (e.g., is negative)."
2372 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2375 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2376 #: build/C/man2/send.2:335
2382 #: build/C/man2/getsockname.2:92
2384 "Insufficient resources were available in the system to perform the operation."
2385 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2388 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2389 msgid "The argument I<sockfd> is a file, not a socket."
2390 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2392 #. SVr4 documents additional ENOMEM
2393 #. and ENOSR error codes.
2395 #: build/C/man2/getsockname.2:103
2397 "SVr4, 4.4BSD (the B<getsockname>() function call appeared in 4.2BSD), "
2400 "SVr4, 4.4BSD (B<getsockname>() 関数は 4.2BSD で追加された), POSIX.1-2001."
2403 #: build/C/man2/getsockname.2:114
2405 "The third argument of B<getsockname>() is in reality an I<int\\ *> (and "
2406 "this is what 4.x BSD and libc4 and libc5 have). Some POSIX confusion "
2407 "resulted in the present I<socklen_t>, also used by glibc. See also B<accept>"
2410 "B<getsockname>() の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2411 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2412 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2) を参照のこと。"
2415 #: build/C/man2/getsockname.2:121
2417 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2420 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2424 #: build/C/man2/getsockopt.2:44
2430 #: build/C/man2/getsockopt.2:44
2436 #: build/C/man2/getsockopt.2:47
2437 msgid "getsockopt, setsockopt - get and set options on sockets"
2438 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2441 #: build/C/man2/getsockopt.2:57
2444 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2445 "B< void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2446 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2447 "B< const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2449 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2450 "B< void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2451 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2452 "B< const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2455 #: build/C/man2/getsockopt.2:67
2457 "B<getsockopt>() and B<setsockopt>() manipulate options for the socket "
2458 "referred to by the file descriptor I<sockfd>. Options may exist at multiple "
2459 "protocol levels; they are always present at the uppermost socket level."
2461 "B<getsockopt>() と B<setsockopt>() は、ファイルディスクリプタ I<socket> で"
2462 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2463 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2467 #: build/C/man2/getsockopt.2:86
2469 "When manipulating socket options, the level at which the option resides and "
2470 "the name of the option must be specified. To manipulate options at the "
2471 "sockets API level, I<level> is specified as B<SOL_SOCKET>. To manipulate "
2472 "options at any other level the protocol number of the appropriate protocol "
2473 "controlling the option is supplied. For example, to indicate that an option "
2474 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2475 "protocol number of B<TCP>; see B<getprotoent>(3)."
2477 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2478 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2479 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2480 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2481 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2482 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2483 "B<getprotoent>(3) を参照すること。"
2486 #: build/C/man2/getsockopt.2:108
2488 "The arguments I<optval> and I<optlen> are used to access option values for "
2489 "B<setsockopt>(). For B<getsockopt>() they identify a buffer in which the "
2490 "value for the requested option(s) are to be returned. For B<getsockopt>(), "
2491 "I<optlen> is a value-result argument, initially containing the size of the "
2492 "buffer pointed to by I<optval>, and modified on return to indicate the "
2493 "actual size of the value returned. If no option value is to be supplied or "
2494 "returned, I<optval> may be NULL."
2496 "I<optval> と I<optlen> 引き数は B<setsockopt>() のオプションの値にアクセスす"
2497 "るために用いられる。 B<getsockopt>() では要求したオプションの値を返すための"
2498 "バッファーを指定する。 B<getsockopt>() では I<optlen> は値と結果両用の引き数"
2499 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2500 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2501 "I<optval> は NULL でも良い。"
2504 #: build/C/man2/getsockopt.2:118
2506 "I<Optname> and any specified options are passed uninterpreted to the "
2507 "appropriate protocol module for interpretation. The include file I<E<lt>sys/"
2508 "socket.hE<gt>> contains definitions for socket level options, described "
2509 "below. Options at other protocol levels vary in format and name; consult "
2510 "the appropriate entries in section 4 of the manual."
2512 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2513 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2514 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2515 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2519 #: build/C/man2/getsockopt.2:127
2521 "Most socket-level options utilize an I<int> argument for I<optval>. For "
2522 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2523 "or zero if the option is to be disabled."
2525 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2526 "B<setsockopt>() で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2527 "を指定し、 無効(disable)にするにはゼロを指定する。"
2530 #: build/C/man2/getsockopt.2:131
2532 "For a description of the available socket options see B<socket>(7) and the "
2533 "appropriate protocol man pages."
2535 "利用可能なソケットオプションの説明に関しては、 B<socket>(7) と適切なプロトコ"
2539 #: build/C/man2/getsockopt.2:152
2541 "The address pointed to by I<optval> is not in a valid part of the process "
2542 "address space. For B<getsockopt>(), this error may also be returned if "
2543 "I<optlen> is not in a valid part of the process address space."
2545 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2546 "B<getsockopt>() の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2550 #: build/C/man2/getsockopt.2:163
2552 "I<optlen> invalid in B<setsockopt>(). In some cases this error can also "
2553 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2554 "option described in B<ip>(7))."
2556 "B<setsockopt>() で I<option> が不正である。 I<optval> に無効な値が指定された"
2557 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7) に説明がある "
2558 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2561 #: build/C/man2/getsockopt.2:163
2563 msgid "B<ENOPROTOOPT>"
2564 msgstr "B<ENOPROTOOPT>"
2567 #: build/C/man2/getsockopt.2:166
2568 msgid "The option is unknown at the level indicated."
2569 msgstr "指定された層(level)にはこのオプションは存在しない。"
2571 #. SVr4 documents additional ENOMEM and ENOSR error codes, but does
2573 #. .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2576 #: build/C/man2/getsockopt.2:178
2578 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2580 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2584 #: build/C/man2/getsockopt.2:199
2586 "The I<optlen> argument of B<getsockopt>() and B<setsockopt>() is in "
2587 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have). "
2588 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2589 "glibc. See also B<accept>(2)."
2591 "B<getsockopt>() と B<setsockopt>() の I<optlen> 引き数は実際は I<int [*]> "
2592 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2593 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2594 "る。 B<accept>(2) も参照のこと。"
2597 #: build/C/man2/getsockopt.2:202
2599 "Several of the socket options should be handled at lower levels of the "
2602 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2605 #: build/C/man2/getsockopt.2:212
2607 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2608 "B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2609 msgstr "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2612 #: build/C/man3/if_nameindex.3:26
2614 msgid "IF_NAMEINDEX"
2615 msgstr "IF_NAMEINDEX"
2618 #: build/C/man3/if_nameindex.3:26
2624 #: build/C/man3/if_nameindex.3:29
2626 "if_nameindex, if_freenameindex - get network interface names and indexes"
2628 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2632 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2634 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2635 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2638 #: build/C/man3/if_nameindex.3:35
2641 "B<struct if_nameindex *if_nameindex(void);>\n"
2642 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2644 "B<struct if_nameindex *if_nameindex(void);>\n"
2645 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2648 #: build/C/man3/if_nameindex.3:46
2650 "The B<if_nameindex>() function returns an array of I<if_nameindex> "
2651 "structures, each containing information about one of the network interfaces "
2652 "on the local system. The I<if_nameindex> structure contains at least the "
2653 "following entries:"
2655 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2656 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2657 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2660 #: build/C/man3/if_nameindex.3:51
2663 " unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2664 " char *if_name; /* Null-terminated name (\"eth0\", etc.) */\n"
2666 " unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2667 " char *if_name; /* NULL 終端された名前 (\"eth0\" など) */\n"
2670 #: build/C/man3/if_nameindex.3:65
2672 "The I<if_index> field contains the interface index. The I<ifa_name> field "
2673 "points to the null-terminated interface name. The end of the array is "
2674 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2676 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2677 "フィールドは NULL 終端されたインターフェース名を指す。 配列の最後は、 "
2678 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2681 #: build/C/man3/if_nameindex.3:71
2683 "The data structure returned by B<if_nameindex>() is dynamically allocated "
2684 "and should be freed using B<if_freenameindex>() when no longer needed."
2686 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2687 "は B<if_freenameindex>() で解放すべきである。"
2690 #: build/C/man3/if_nameindex.3:78
2692 "On success, B<if_nameindex>() returns pointer to the array; on error, NULL "
2693 "is returned, and I<errno> is set appropriately."
2695 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2696 "NULL が返され、 I<errno> が適切に設定される。"
2699 #: build/C/man3/if_nameindex.3:83
2700 msgid "B<if_nameindex>() may fail and set I<errno> if:"
2701 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2704 #: build/C/man3/if_nameindex.3:86
2705 msgid "Insufficient resources available."
2706 msgstr "利用可能なリソースが十分にない。"
2709 #: build/C/man3/if_nameindex.3:97
2711 "B<if_nameindex>() may also fail for any of the errors specified for "
2712 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2713 "B<sendto>(2), or B<malloc>(3)."
2715 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>"
2716 "(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定されているエラーの"
2720 #: build/C/man3/if_nameindex.3:104
2722 "The B<if_nameindex>() function first appeared in glibc 2.1, but before "
2723 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2724 "addresses. Support of interfaces that don't have IPv4 addresses is "
2725 "available only on kernels that support netlink."
2727 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2728 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2729 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2730 "netlink をサポートするカーネルにおいてのみである。"
2733 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2734 msgid "RFC\\ 3493, POSIX.1-2001."
2735 msgstr "RFC\\ 3493, POSIX.1-2001."
2738 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2739 msgid "This function first appeared in BSDi."
2740 msgstr "この関数は BSDi 初めて登場した。"
2743 #: build/C/man3/if_nameindex.3:112
2745 "The program below demonstrates the use of the functions described on this "
2746 "page. An example of the output this program might produce is the following:"
2748 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2749 "ムが生成する出力は以下のようになる。"
2752 #: build/C/man3/if_nameindex.3:119
2766 #: build/C/man3/if_nameindex.3:127
2769 "#include E<lt>net/if.hE<gt>\n"
2770 "#include E<lt>stdio.hE<gt>\n"
2771 "#include E<lt>stdlib.hE<gt>\n"
2772 "#include E<lt>unistd.hE<gt>\n"
2774 "#include E<lt>net/if.hE<gt>\n"
2775 "#include E<lt>stdio.hE<gt>\n"
2776 "#include E<lt>stdlib.hE<gt>\n"
2777 "#include E<lt>unistd.hE<gt>\n"
2780 #: build/C/man3/if_nameindex.3:132
2784 "main(int argc, char *argv[])\n"
2786 " struct if_nameindex *if_ni, *i;\n"
2789 "main(int argc, char *argv[])\n"
2791 " struct if_nameindex *if_ni, *i;\n"
2794 #: build/C/man3/if_nameindex.3:138
2797 " if_ni = if_nameindex();\n"
2798 " if (if_ni == NULL) {\n"
2799 " perror(\"if_nameindex\");\n"
2800 " exit(EXIT_FAILURE);\n"
2803 " if_ni = if_nameindex();\n"
2804 " if (if_ni == NULL) {\n"
2805 " perror(\"if_nameindex\");\n"
2806 " exit(EXIT_FAILURE);\n"
2810 #: build/C/man3/if_nameindex.3:141
2813 " for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2814 " printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2816 " for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2817 " printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2820 #: build/C/man3/if_nameindex.3:143
2822 msgid " if_freenameindex(if_ni);\n"
2823 msgstr " if_freenameindex(if_ni);\n"
2826 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:584
2829 " exit(EXIT_SUCCESS);\n"
2832 " exit(EXIT_SUCCESS);\n"
2836 #: build/C/man3/if_nameindex.3:154
2838 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2839 "B<if_nametoindex>(3), B<ifconfig>(8)"
2841 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2842 "B<if_nametoindex>(3), B<ifconfig>(8)"
2845 #: build/C/man3/if_nametoindex.3:25
2847 msgid "IF_NAMETOINDEX"
2848 msgstr "IF_NAMETOINDEX"
2851 #: build/C/man3/if_nametoindex.3:25
2857 #: build/C/man3/if_nametoindex.3:29
2859 "if_nametoindex, if_indextoname - mappings between network interface names "
2862 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2866 #: build/C/man3/if_nametoindex.3:34
2868 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2869 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2872 #: build/C/man3/if_nametoindex.3:36
2874 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2875 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2878 #: build/C/man3/if_nametoindex.3:43
2880 "The B<if_nametoindex>() function returns the index of the network interface "
2881 "corresponding to the name I<ifname>."
2883 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2887 #: build/C/man3/if_nametoindex.3:54
2889 "The B<if_indextoname>() function returns the name of the network interface "
2890 "corresponding to the interface index I<ifindex>. The name is placed in the "
2891 "buffer pointed to by I<ifname>. The buffer must allow for the storage of at "
2892 "least B<IF_NAMESIZE> bytes."
2894 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2895 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2896 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2900 #: build/C/man3/if_nametoindex.3:61
2902 "On success, B<if_nametoindex>() returns the index number of the network "
2903 "interface; on error, 0 is returned and I<errno> is set appropriately."
2905 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2906 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2909 #: build/C/man3/if_nametoindex.3:69
2911 "On success, B<if_indextoname>() returns I<ifname>; on error, NULL is "
2912 "returned and I<errno> is set appropriately."
2914 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2915 "が返され、 I<errno> が適切に設定される。"
2918 #: build/C/man3/if_nametoindex.3:74
2919 msgid "B<if_indextoname>() may fail and set I<errno> if:"
2920 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2923 #: build/C/man3/if_nametoindex.3:74
2929 #: build/C/man3/if_nametoindex.3:77
2930 msgid "No interface found for the index."
2931 msgstr "インデックスに対応するインターフェースがない。"
2934 #: build/C/man3/if_nametoindex.3:85
2936 "B<if_nametoindex>() and B<if_indextoname>() may also fail for any of the "
2937 "errors specified for B<socket>(2) or B<ioctl>(2)."
2939 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2940 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2943 #: build/C/man3/if_nametoindex.3:93
2944 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2945 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2948 #: build/C/man2/listen.2:45
2954 #: build/C/man2/listen.2:45
2960 #: build/C/man2/listen.2:48
2961 msgid "listen - listen for connections on a socket"
2962 msgstr "listen - ソケット(socket)上の接続を待つ"
2965 #: build/C/man2/listen.2:55
2967 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2968 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2971 #: build/C/man2/listen.2:63
2973 "B<listen>() marks the socket referred to by I<sockfd> as a passive socket, "
2974 "that is, as a socket that will be used to accept incoming connection "
2975 "requests using B<accept>(2)."
2977 "B<listen>() は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2978 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2) を使って到着"
2979 "した接続要求を受け付けるのに使用されるソケットである。"
2982 #: build/C/man2/listen.2:70
2984 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2985 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2987 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2991 #: build/C/man2/listen.2:82
2993 "The I<backlog> argument defines the maximum length to which the queue of "
2994 "pending connections for I<sockfd> may grow. If a connection request arrives "
2995 "when the queue is full, the client may receive an error with an indication "
2996 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2997 "the request may be ignored so that a later reattempt at connection succeeds."
2999 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3000 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3001 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3002 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3006 #: build/C/man2/listen.2:91
3007 msgid "Another socket is already listening on the same port."
3008 msgstr "別のソケットが既に同じポートを listen している。"
3011 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
3012 msgid "The argument I<sockfd> is not a socket."
3013 msgstr "引き数 I<sockfd> はソケットではない。"
3016 #: build/C/man2/listen.2:106
3017 msgid "The socket is not of a type that supports the B<listen>() operation."
3018 msgstr "ソケットは B<listen>() がサポートしている型ではない。"
3021 #: build/C/man2/listen.2:111
3023 "4.4BSD, POSIX.1-2001. The B<listen>() function call first appeared in "
3025 msgstr "4.4BSD, POSIX.1-2001. B<listen>() 関数は 4.2BSDで初めて実装された。"
3028 #: build/C/man2/listen.2:113
3029 msgid "To accept connections, the following steps are performed:"
3030 msgstr "接続を受け付けるには、以下の処理が実行される。"
3033 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
3039 #: build/C/man2/listen.2:117
3040 msgid "A socket is created with B<socket>(2)."
3041 msgstr "B<socket>(2) でソケットを作成する。"
3044 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
3050 #: build/C/man2/listen.2:123
3052 "The socket is bound to a local address using B<bind>(2), so that other "
3053 "sockets may be B<connect>(2)ed to it."
3055 "B<bind>(2) を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3056 "のソケットに B<connect>(2) できるようにする。"
3059 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
3065 #: build/C/man2/listen.2:127
3067 "A willingness to accept incoming connections and a queue limit for incoming "
3068 "connections are specified with B<listen>()."
3070 "B<listen>() を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3074 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
3080 #: build/C/man2/listen.2:130
3081 msgid "Connections are accepted with B<accept>(2)."
3082 msgstr "B<accept>(2) を使って接続を受け付ける。"
3085 #: build/C/man2/listen.2:153
3087 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3088 "2.2. Now it specifies the queue length for I<completely> established "
3089 "sockets waiting to be accepted, instead of the number of incomplete "
3090 "connection requests. The maximum length of the queue for incomplete sockets "
3091 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>. When syncookies "
3092 "are enabled there is no logical maximum length and this setting is ignored. "
3093 "See B<tcp>(7) for more information."
3095 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3096 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3097 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3098 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3099 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3100 "論理的な最大長は存在せず、この設定は無視される。"
3102 #. The following is now rather historic information (MTK, Jun 05)
3103 #. Don't rely on this value in portable applications since BSD
3104 #. (and some BSD-derived systems) limit the backlog to 5.
3106 #: build/C/man2/listen.2:166
3108 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3109 "somaxconn>, then it is silently truncated to that value; the default value "
3110 "in this file is 128. In kernels before 2.4.25, this limit was a hard coded "
3111 "value, B<SOMAXCONN>, with the value 128."
3113 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3114 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3115 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3116 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3119 #: build/C/man2/listen.2:175
3120 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3121 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3124 #: build/C/man2/recv.2:41
3130 #: build/C/man2/recv.2:41
3136 #: build/C/man2/recv.2:44
3137 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3138 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3141 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3142 #: build/C/man2/select_tut.2:47
3144 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3145 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3148 #: build/C/man2/recv.2:53
3150 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3151 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3154 #: build/C/man2/recv.2:56
3157 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3158 "B< struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3160 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3161 "B< struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3164 #: build/C/man2/recv.2:58
3166 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3167 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3170 #: build/C/man2/recv.2:70
3173 #| "The B<recvfrom>() and B<recvmsg>() calls are used to receive messages "
3174 #| "from a socket, and may be used to receive data on a socket whether or not "
3175 #| "it is connection-oriented."
3177 "The B<recv>(), B<recvfrom>(), and B<recvmsg>() calls are used to receive "
3178 "messages from a socket. They may be used to receive data on both "
3179 "connectionless and connection-oriented sockets. This page first describes "
3180 "common features of all three system calls, and then describes the "
3181 "differences between the calls."
3183 "B<recvfrom>() と B<recvmsg>() コールは、ソケットからメッセージを受け取るの"
3184 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3185 "接続指向 (connection-oriened) であってもなくてもよい。"
3188 #: build/C/man2/recv.2:76
3190 "All three calls return the length of the message on successful completion. "
3191 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3192 "discarded depending on the type of socket the message is received from."
3193 msgstr "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3196 #: build/C/man2/recv.2:86
3198 "If no messages are available at the socket, the receive calls wait for a "
3199 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3200 "which case the value -1 is returned and the external variable I<errno> is "
3201 "set to B<EAGAIN> or B<EWOULDBLOCK>. The receive calls normally return any "
3202 "data available, up to the requested amount, rather than waiting for receipt "
3203 "of the full amount requested."
3205 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3206 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking) に設定されていた"
3207 "場合 (B<fcntl>(2) を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3208 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3209 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3210 "る (受信されるデータの最大サイズは要求したサイズである)。"
3213 #: build/C/man2/recv.2:93
3215 "An application can used B<select>(2), B<poll>(2), or B<epoll>(7) to "
3216 "determine when more data arrives on a socket."
3217 msgstr "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットにさらにデータが到着しているかを判定することができる。"
3220 #: build/C/man2/recv.2:93
3222 msgid "The flags argument"
3226 #: build/C/man2/recv.2:97
3228 "The I<flags> argument is formed by ORing one or more of the following values:"
3229 msgstr "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指定する:"
3232 #: build/C/man2/recv.2:97
3234 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3235 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3238 #: build/C/man2/recv.2:108
3240 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3241 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3242 "B<unix>(7)). This flag is useful for the same reasons as the B<O_CLOEXEC> "
3243 "flag of B<open>(2)."
3245 "(B<unix>(7) で説明されている) B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3246 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3247 "exec フラグをセットする。 このフラグは、 B<open>(2) の B<O_CLOEXEC> フラグと"
3251 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3253 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3254 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3257 #: build/C/man2/recv.2:118
3259 "Enables nonblocking operation; if the operation would block, the call fails "
3260 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3261 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3263 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3264 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2) の B<F_SETFL> "
3265 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3268 #: build/C/man2/recv.2:118
3270 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3271 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3274 #: build/C/man2/recv.2:137
3276 "This flag specifies that queued errors should be received from the socket "
3277 "error queue. The error is passed in an ancillary message with a type "
3278 "dependent on the protocol (for IPv4 B<IP_RECVERR>). The user should supply "
3279 "a buffer of sufficient size. See B<cmsg>(3) and B<ip>(7) for more "
3280 "information. The payload of the original packet that caused the error is "
3281 "passed as normal data via I<msg_iovec>. The original destination address of "
3282 "the datagram that caused the error is supplied via I<msg_name>."
3284 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3285 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3286 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3287 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3288 "るより詳細な情報は B<cmsg>(3) および B<ip>(7) を参照のこと。 エラーの原因と"
3289 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3290 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3291 "I<msg_name> 経由で参照できる。"
3294 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3296 "For local errors, no address is passed (this can be checked with the "
3297 "I<cmsg_len> member of the I<cmsghdr>). For error receives, the "
3298 "B<MSG_ERRQUEUE> is set in the I<msghdr>. After an error has been passed, "
3299 "the pending socket error is regenerated based on the next queued error and "
3300 "will be passed on the next socket operation."
3302 "ローカルなエラーの場合はアドレスは渡されない\n"
3303 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3304 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3305 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3306 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3309 #: build/C/man2/recv.2:153
3310 msgid "The error is supplied in a I<sock_extended_err> structure:"
3311 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3314 #: build/C/man2/recv.2:160
3317 "#define SO_EE_ORIGIN_NONE 0\n"
3318 "#define SO_EE_ORIGIN_LOCAL 1\n"
3319 "#define SO_EE_ORIGIN_ICMP 2\n"
3320 "#define SO_EE_ORIGIN_ICMP6 3\n"
3322 "#define SO_EE_ORIGIN_NONE 0\n"
3323 "#define SO_EE_ORIGIN_LOCAL 1\n"
3324 "#define SO_EE_ORIGIN_ICMP 2\n"
3325 "#define SO_EE_ORIGIN_ICMP6 3\n"
3328 #: build/C/man2/recv.2:172
3331 "struct sock_extended_err\n"
3333 " uint32_t ee_errno; /* error number */\n"
3334 " uint8_t ee_origin; /* where the error originated */\n"
3335 " uint8_t ee_type; /* type */\n"
3336 " uint8_t ee_code; /* code */\n"
3337 " uint8_t ee_pad; /* padding */\n"
3338 " uint32_t ee_info; /* additional information */\n"
3339 " uint32_t ee_data; /* other data */\n"
3340 " /* More data may follow */\n"
3343 "struct sock_extended_err\n"
3345 " uint32_t ee_errno; /* error number */\n"
3346 " uint8_t ee_origin; /* where the error originated */\n"
3347 " uint8_t ee_type; /* type */\n"
3348 " uint8_t ee_code; /* code */\n"
3349 " uint8_t ee_pad; /* padding */\n"
3350 " uint32_t ee_info; /* additional information */\n"
3351 " uint32_t ee_data; /* other data */\n"
3352 " /* More data may follow */\n"
3356 #: build/C/man2/recv.2:174
3358 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3359 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3362 #: build/C/man2/recv.2:198
3364 "I<ee_errno> contains the I<errno> number of the queued error. I<ee_origin> "
3365 "is the origin code of where the error originated. The other fields are "
3366 "protocol-specific. The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3367 "address of the network object where the error originated from given a "
3368 "pointer to the ancillary message. If this address is not known, the "
3369 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3370 "fields of the I<sockaddr> are undefined. The payload of the packet that "
3371 "caused the error is passed as normal data."
3373 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3374 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3375 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3376 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3377 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3378 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3379 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3383 #: build/C/man2/recv.2:212 build/C/man2/recv.2:393 build/C/man2/send.2:230
3389 #: build/C/man2/recv.2:219
3391 "This flag requests receipt of out-of-band data that would not be received in "
3392 "the normal data stream. Some protocols place expedited data at the head of "
3393 "the normal data queue, and thus this flag cannot be used with such protocols."
3395 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3396 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3397 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3401 #: build/C/man2/recv.2:219
3404 msgstr "B<MSG_PEEK>"
3407 #: build/C/man2/recv.2:226
3409 "This flag causes the receive operation to return data from the beginning of "
3410 "the receive queue without removing that data from the queue. Thus, a "
3411 "subsequent receive call will return the same data."
3413 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3414 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3418 #: build/C/man2/recv.2:226
3420 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3421 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3424 #: build/C/man2/recv.2:234
3426 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3427 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3428 "return the real length of the packet or datagram, even when it was longer "
3429 "than the passed buffer."
3430 msgstr "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux 3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長さを返す。"
3433 #: build/C/man2/recv.2:237
3434 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3435 msgstr "Internet ストリームソケットでの利用については B<tcp>(7) を参照。"
3438 #: build/C/man2/recv.2:237
3440 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3441 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3444 #: build/C/man2/recv.2:245
3446 "This flag requests that the operation block until the full request is "
3447 "satisfied. However, the call may still return less data than requested if a "
3448 "signal is caught, an error or disconnect occurs, or the next data to be "
3449 "received is of a different type than that returned."
3451 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3452 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3453 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3454 "りデータが少なくても返ることがある。"
3457 #: build/C/man2/recv.2:245
3463 #: build/C/man2/recv.2:251
3465 "B<recvfrom>() places the received message into the buffer I<buf>. The "
3466 "caller must specify the size of the buffer in I<len>."
3469 #. (Note: for datagram sockets in both the UNIX and Internet domains,
3473 #. is also filled in for stream sockets in the UNIX domain, but is not
3474 #. filled in for stream sockets in the Internet domain.)
3475 #. [The above notes on AF_UNIX and AF_INET sockets apply as at
3476 #. Kernel 2.4.18. (MTK, 22 Jul 02)]
3478 #: build/C/man2/recv.2:279
3481 #| "If I<src_addr> is not NULL, and the underlying protocol provides the "
3482 #| "source address, this source address is filled in. When I<src_addr> is "
3483 #| "NULL, nothing is filled in; in this case, I<addrlen> is not used, and "
3484 #| "should also be NULL. The argument I<addrlen> is a value-result argument, "
3485 #| "which the caller should initialize before the call to the size of the "
3486 #| "buffer associated with I<src_addr>, and modified on return to indicate "
3487 #| "the actual size of the source address. The returned address is truncated "
3488 #| "if the buffer provided is too small; in this case, I<addrlen> will return "
3489 #| "a value greater than was supplied to the call."
3491 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3492 "address of the message, that source address is placed in the buffer pointed "
3493 "to by I<src_addr>. In this case, I<addrlen> is a value-result argument. "
3494 "Before the call, it should be initialized to the size of the buffer "
3495 "associated with I<src_addr>. Upon return, I<addrlen> is updated to contain "
3496 "the actual size of the source address. The returned address is truncated if "
3497 "the buffer provided is too small; in this case, I<addrlen> will return a "
3498 "value greater than was supplied to the call."
3500 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3501 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3502 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3503 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3504 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3505 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3506 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3507 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3511 #: build/C/man2/recv.2:286
3513 "If the caller is not interested in the source address, I<src_addr> should be "
3514 "specified as NULL and I<addrlen> should be specified as 0."
3518 #: build/C/man2/recv.2:286
3524 #: build/C/man2/recv.2:294
3526 "The B<recv>() call is normally used only on a I<connected> socket (see "
3527 "B<connect>(2)). It is equivalent to the call:"
3528 msgstr "B<recv>() コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用される (B<connect>(2) 参照)。次の呼び出しと等価である。"
3531 #: build/C/man2/recv.2:297
3533 msgid " recvfrom(fd, buf, len, flags, NULL, 0));\n"
3534 msgstr " recvfrom(fd, buf, len, flags, NULL, 0));\n"
3537 #: build/C/man2/recv.2:297
3543 #: build/C/man2/recv.2:305
3545 "The B<recvmsg>() call uses a I<msghdr> structure to minimize the number of "
3546 "directly supplied arguments. This structure is defined as follows in "
3547 "I<E<lt>sys/socket.hE<gt>>:"
3549 "B<recvmsg>() コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3550 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3553 #: build/C/man2/recv.2:312
3556 "struct iovec { /* Scatter/gather array items */\n"
3557 " void *iov_base; /* Starting address */\n"
3558 " size_t iov_len; /* Number of bytes to transfer */\n"
3561 "struct iovec { /* Scatter/gather array items */\n"
3562 " void *iov_base; /* Starting address */\n"
3563 " size_t iov_len; /* Number of bytes to transfer */\n"
3567 #: build/C/man2/recv.2:322 build/C/man2/send.2:258
3571 " void *msg_name; /* optional address */\n"
3572 " socklen_t msg_namelen; /* size of address */\n"
3573 " struct iovec *msg_iov; /* scatter/gather array */\n"
3574 " size_t msg_iovlen; /* # elements in msg_iov */\n"
3575 " void *msg_control; /* ancillary data, see below */\n"
3576 " size_t msg_controllen; /* ancillary data buffer len */\n"
3577 " int msg_flags; /* flags on received message */\n"
3581 " void *msg_name; /* 追加のアドレス */\n"
3582 " socklen_t msg_namelen; /* アドレスのサイズ */\n"
3583 " struct iovec *msg_iov; /* scatter/gather 配列 */\n"
3584 " size_t msg_iovlen; /* msg_iov の要素数 */\n"
3585 " void *msg_control; /* 補助データ (後述) */\n"
3586 " size_t msg_controllen; /* 補助データバッファ長 */\n"
3587 " int msg_flags; /* 受信メッセージのフラグ */\n"
3591 #: build/C/man2/recv.2:352
3593 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3594 "is unconnected; I<msg_name> may be given as a null pointer if no names are "
3595 "desired or required. The fields I<msg_iov> and I<msg_iovlen> describe "
3596 "scatter-gather locations, as discussed in B<readv>(2). The field "
3597 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3598 "other protocol control-related messages or miscellaneous ancillary data. "
3599 "When B<recvmsg>() is called, I<msg_controllen> should contain the length of "
3600 "the available buffer in I<msg_control>; upon return from a successful call "
3601 "it will contain the length of the control message sequence."
3603 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3604 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3605 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2) に記述されている"
3606 "ような分解/結合用のベクトル (scatter-gather locations) を指定する。 "
3607 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3608 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3609 "B<recvmsg>() を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3610 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3614 #: build/C/man2/recv.2:354
3615 msgid "The messages are of the form:"
3616 msgstr "メッセージの形式は以下の通り:"
3619 #: build/C/man2/recv.2:364
3622 "struct cmsghdr {\n"
3623 " socklen_t cmsg_len; /* data byte count, including hdr */\n"
3624 " int cmsg_level; /* originating protocol */\n"
3625 " int cmsg_type; /* protocol-specific type */\n"
3627 " unsigned char cmsg_data[]; */\n"
3630 "struct cmsghdr {\n"
3631 " socklen_t cmsg_len; /* data byte count, including hdr */\n"
3632 " int cmsg_level; /* originating protocol */\n"
3633 " int cmsg_type; /* protocol-specific type */\n"
3635 " unsigned char cmsg_data[]; */\n"
3639 #: build/C/man2/recv.2:369
3641 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3643 "補助データは、 B<cmsg>(3) に定義されたマクロ経由でのみアクセスすべきである。"
3646 #: build/C/man2/recv.2:372
3648 "As an example, Linux uses this ancillary data mechanism to pass extended "
3649 "errors, IP options, or file descriptors over UNIX domain sockets."
3651 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3652 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3656 #: build/C/man2/recv.2:380
3658 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>(). "
3659 "It can contain several flags:"
3661 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>() からのリターン時に設定さ"
3662 "れる。ここにはいくつかのフラグが入る。"
3665 #: build/C/man2/recv.2:380
3671 #: build/C/man2/recv.2:385
3673 "indicates end-of-record; the data returned completed a record (generally "
3674 "used with sockets of type B<SOCK_SEQPACKET>)."
3676 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3677 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3680 #: build/C/man2/recv.2:385
3682 msgid "B<MSG_TRUNC>"
3683 msgstr "B<MSG_TRUNC>"
3686 #: build/C/man2/recv.2:389
3688 "indicates that the trailing portion of a datagram was discarded because the "
3689 "datagram was larger than the buffer supplied."
3691 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3695 #: build/C/man2/recv.2:389
3697 msgid "B<MSG_CTRUNC>"
3698 msgstr "B<MSG_CTRUNC>"
3701 #: build/C/man2/recv.2:393
3703 "indicates that some control data were discarded due to lack of space in the "
3704 "buffer for ancillary data."
3706 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3710 #: build/C/man2/recv.2:396
3712 "is returned to indicate that expedited or out-of-band data were received."
3713 msgstr "速達データや帯域外データを受信したことを示す。"
3716 #: build/C/man2/recv.2:396
3718 msgid "B<MSG_ERRQUEUE>"
3719 msgstr "B<MSG_ERRQUEUE>"
3722 #: build/C/man2/recv.2:400
3724 "indicates that no data was received but an extended error from the socket "
3727 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3731 #: build/C/man2/recv.2:406
3733 "These calls return the number of bytes received, or -1 if an error "
3734 "occurred. In the event of an error, I<errno> is set to indicate the error."
3735 msgstr "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> にエラーを示す値を設定する。"
3738 #: build/C/man2/recv.2:409
3740 "When a stream socket peer has performed an orderly shutdown, the return "
3741 "value will be 0 (the traditional \"end-of-file\" return)."
3743 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3744 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3747 #: build/C/man2/recv.2:413
3749 "Datagram sockets in various domains (e.g., the UNIX and Internet domains) "
3750 "permit zero-length datagrams. When such a datagram is received, the return "
3755 #: build/C/man2/recv.2:416
3757 "The value 0 may also be returned if the requested number of bytes to receive "
3758 "from a stream socket was 0."
3762 #: build/C/man2/recv.2:421
3764 "These are some standard errors generated by the socket layer. Additional "
3765 "errors may be generated and returned from the underlying protocol modules; "
3766 "see their manual pages."
3768 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3769 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3772 #. Actually EAGAIN on Linux
3774 #: build/C/man2/recv.2:430
3776 "The socket is marked nonblocking and the receive operation would block, or a "
3777 "receive timeout had been set and the timeout expired before data was "
3778 "received. POSIX.1-2001 allows either error to be returned for this case, "
3779 "and does not require these constants to have the same value, so a portable "
3780 "application should check for both possibilities."
3782 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3783 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3784 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3785 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3786 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3789 #: build/C/man2/recv.2:435
3790 msgid "The argument I<sockfd> is an invalid descriptor."
3791 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3794 #: build/C/man2/recv.2:439
3796 "A remote host refused to allow the network connection (typically because it "
3797 "is not running the requested service)."
3799 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3800 "たサービスが起動されていないなどがある)。"
3803 #: build/C/man2/recv.2:443
3805 "The receive buffer pointer(s) point outside the process's address space."
3806 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3809 #: build/C/man2/recv.2:448
3811 "The receive was interrupted by delivery of a signal before any data were "
3812 "available; see B<signal>(7)."
3814 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7) 参照。"
3817 #: build/C/man2/recv.2:452 build/C/man2/send.2:323
3818 msgid "Invalid argument passed."
3819 msgstr "不正な引き数が渡された。"
3822 #: build/C/man2/recv.2:456
3823 msgid "Could not allocate memory for B<recvmsg>()."
3824 msgstr "B<recvmsg>() のためのメモリが確保できなかった。"
3827 #: build/C/man2/recv.2:456 build/C/man2/send.2:346
3830 msgstr "B<ENOTCONN>"
3833 #: build/C/man2/recv.2:463
3835 "The socket is associated with a connection-oriented protocol and has not "
3836 "been connected (see B<connect>(2) and B<accept>(2))."
3838 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3839 "(B<connect>(2) と B<accept>(2) を参照のこと)。"
3842 #: build/C/man2/recv.2:468
3843 msgid "The argument I<sockfd> does not refer to a socket."
3844 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3847 #: build/C/man2/recv.2:471
3848 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3849 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3852 #: build/C/man2/recv.2:478
3854 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3857 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3861 #: build/C/man2/recv.2:494
3863 "The prototypes given above follow glibc2. The Single UNIX Specification "
3864 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3865 "and libc4 and libc5 all have I<int>). The I<flags> argument is I<int> in 4."
3866 "x BSD, but I<unsigned int> in libc4 and libc5. The I<len> argument is "
3867 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5. The I<addrlen> "
3868 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5. The present I<socklen_t"
3869 "\\ *> was invented by POSIX. See also B<accept>(2)."
3871 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3872 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3873 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3874 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3875 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3876 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3877 "POSIX で発案された。 B<accept>(2) も参照すること。"
3879 #. glibc bug raised 12 Mar 2006
3880 #. http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3881 #. The problem is an underlying kernel issue: the size of the
3882 #. __kernel_size_t type used to type this field varies
3883 #. across architectures, but socklen_t is always 32 bits.
3885 #: build/C/man2/recv.2:508 build/C/man2/send.2:409
3887 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3888 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3891 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3892 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3896 #: build/C/man2/recv.2:513
3898 "See B<recvmmsg>(2) for information about a Linux-specific system call that "
3899 "can be used to receive multiple datagrams in a single call."
3901 "B<recvmmsg>(2) には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3902 "固有の システムコールに関する情報が書かれている。"
3905 #: build/C/man2/recv.2:518
3906 msgid "An example of the use of B<recvfrom>() is shown in B<getaddrinfo>(3)."
3907 msgstr "B<recvfrom>() の利用例が B<getaddrinfo>(3) に記載されている。"
3910 #: build/C/man2/recv.2:529
3912 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3913 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3915 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3916 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3919 #: build/C/man2/recvmmsg.2:31
3925 #: build/C/man2/recvmmsg.2:31
3931 #: build/C/man2/recvmmsg.2:34
3932 msgid "recvmmsg - receive multiple messages on a socket"
3933 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
3936 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3939 "B<#define _GNU_SOURCE>\n"
3940 "B<#include E<lt>sys/socket.hE<gt>>\n"
3942 "B<#define _GNU_SOURCE>\n"
3943 "B<#include E<lt>sys/socket.hE<gt>>\n"
3946 #: build/C/man2/recvmmsg.2:41
3948 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3949 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3952 #: build/C/man2/recvmmsg.2:43
3954 msgid "B< unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3955 msgstr "B< unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3958 #: build/C/man2/recvmmsg.2:55
3960 "The B<recvmmsg>() system call is an extension of B<recvmsg>(2) that allows "
3961 "the caller to receive multiple messages from a socket using a single system "
3962 "call. (This has performance benefits for some applications.) A further "
3963 "extension over B<recvmsg>(2) is support for a timeout on the receive "
3966 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
3967 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
3968 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
3969 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
3972 #: build/C/man2/recvmmsg.2:59
3974 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3977 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
3980 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
3982 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures. "
3983 "The size of this array is specified in I<vlen>."
3985 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
3989 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
3990 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3992 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
3995 #: build/C/man2/recvmmsg.2:80
3998 "struct mmsghdr {\n"
3999 " struct msghdr msg_hdr; /* Message header */\n"
4000 " unsigned int msg_len; /* Number of received bytes for header */\n"
4003 "struct mmsghdr {\n"
4004 " struct msghdr msg_hdr; /* メッセージヘッダ */\n"
4005 " unsigned int msg_len; /* このヘッダで受信されたバイト数 */\n"
4009 #: build/C/man2/recvmmsg.2:95
4011 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
4012 "(2). The I<msg_len> field is the number of bytes returned for the message "
4013 "in the entry. This field has the same value as the return value of a single "
4014 "B<recvmsg>(2) on the header."
4016 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4017 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4018 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4022 #: build/C/man2/recvmmsg.2:102
4024 "The I<flags> argument contains flags ORed together. The flags are the same "
4025 "as documented for B<recvmsg>(2), with the following addition:"
4027 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4028 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4031 #: build/C/man2/recvmmsg.2:102
4033 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4034 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4037 #: build/C/man2/recvmmsg.2:107
4038 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4039 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4042 #: build/C/man2/recvmmsg.2:123
4044 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
4045 "(2)) defining a timeout (seconds plus nanoseconds) for the receive "
4046 "operation. (This interval will be rounded up to the system clock "
4047 "granularity, and kernel scheduling delays mean that the blocking interval "
4048 "may overrun by a small amount.) If I<timeout> is I<NULL> then the operation "
4049 "blocks indefinitely."
4051 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4052 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (待ち時間は"
4053 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延により少"
4054 "しだけ長くなる可能性がある)。 I<timeout>が I<NULL> の場合、 受信操作は無期限"
4058 #: build/C/man2/recvmmsg.2:134
4060 "A blocking B<recvmmsg>() call blocks until I<vlen> messages have been "
4061 "received or until the timeout expires. A nonblocking call reads as many "
4062 "messages as are available (up to the limit specified by I<vlen>) and "
4063 "returns immediately."
4065 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4066 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4067 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4071 #: build/C/man2/recvmmsg.2:149
4073 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4074 "to contain information about each received message: I<msg_len> contains the "
4075 "size of the received message; the subfields of I<msg_hdr> are updated as "
4076 "described in B<recvmsg>(2). The return value of the call indicates the "
4077 "number of elements of I<msgvec> that have been updated."
4079 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4080 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4081 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4082 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4086 #: build/C/man2/recvmmsg.2:157
4088 "On success, B<recvmmsg>() returns the number of messages received in "
4089 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4092 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4093 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4096 #: build/C/man2/recvmmsg.2:161
4098 "Errors are as for B<recvmsg>(2). In addition, the following error can occur:"
4100 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4104 #: build/C/man2/recvmmsg.2:165
4105 msgid "I<timeout> is invalid."
4106 msgstr "I<timeout> が無効である。"
4109 #: build/C/man2/recvmmsg.2:170
4111 "The B<recvmmsg>() system call was added in Linux 2.6.33. Support in glibc "
4112 "was added in version 2.12."
4114 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4115 "はバージョン 2.12 以降で利用可能である。"
4118 #: build/C/man2/recvmmsg.2:173
4119 msgid "B<recvmmsg>() is Linux-specific."
4120 msgstr "B<recvmmsg>() は Linux 固有である。"
4123 #: build/C/man2/recvmmsg.2:181
4125 "The following program uses B<recvmmsg>() to receive multiple messages on a "
4126 "socket and stores them in multiple buffers. The call returns if all buffers "
4127 "are filled or if the timeout specified has expired."
4129 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4130 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4131 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4134 #: build/C/man2/recvmmsg.2:184
4136 "The following snippet periodically generates UDP datagrams containing a "
4139 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4143 #: build/C/man2/recvmmsg.2:189
4146 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4147 "B<sleep 0.25; done>\n"
4149 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4150 "B<sleep 0.25; done>\n"
4153 #: build/C/man2/recvmmsg.2:194
4155 "These datagrams are read by the example application, which can give the "
4158 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4162 #: build/C/man2/recvmmsg.2:204
4166 "5 messages received\n"
4174 "5 messages received\n"
4182 #: build/C/man2/recvmmsg.2:215
4185 "#define _GNU_SOURCE\n"
4186 "#include E<lt>netinet/ip.hE<gt>\n"
4187 "#include E<lt>stdio.hE<gt>\n"
4188 "#include E<lt>stdlib.hE<gt>\n"
4189 "#include E<lt>string.hE<gt>\n"
4190 "#include E<lt>sys/socket.hE<gt>\n"
4192 "#define _GNU_SOURCE\n"
4193 "#include E<lt>netinet/ip.hE<gt>\n"
4194 "#include E<lt>stdio.hE<gt>\n"
4195 "#include E<lt>stdlib.hE<gt>\n"
4196 "#include E<lt>string.hE<gt>\n"
4197 "#include E<lt>sys/socket.hE<gt>\n"
4200 #: build/C/man2/recvmmsg.2:228
4207 "#define BUFSIZE 200\n"
4208 "#define TIMEOUT 1\n"
4209 " int sockfd, retval, i;\n"
4210 " struct sockaddr_in sa;\n"
4211 " struct mmsghdr msgs[VLEN];\n"
4212 " struct iovec iovecs[VLEN];\n"
4213 " char bufs[VLEN][BUFSIZE+1];\n"
4214 " struct timespec timeout;\n"
4220 "#define BUFSIZE 200\n"
4221 "#define TIMEOUT 1\n"
4222 " int sockfd, retval, i;\n"
4223 " struct sockaddr_in sa;\n"
4224 " struct mmsghdr msgs[VLEN];\n"
4225 " struct iovec iovecs[VLEN];\n"
4226 " char bufs[VLEN][BUFSIZE+1];\n"
4227 " struct timespec timeout;\n"
4230 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4233 " sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4234 " if (sockfd == -1) {\n"
4235 " perror(\"socket()\");\n"
4236 " exit(EXIT_FAILURE);\n"
4239 " sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4240 " if (sockfd == -1) {\n"
4241 " perror(\"socket()\");\n"
4242 " exit(EXIT_FAILURE);\n"
4246 #: build/C/man2/recvmmsg.2:242
4249 " sa.sin_family = AF_INET;\n"
4250 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4251 " sa.sin_port = htons(1234);\n"
4252 " if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4253 " perror(\"bind()\");\n"
4254 " exit(EXIT_FAILURE);\n"
4257 " sa.sin_family = AF_INET;\n"
4258 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4259 " sa.sin_port = htons(1234);\n"
4260 " if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4261 " perror(\"bind()\");\n"
4262 " exit(EXIT_FAILURE);\n"
4266 #: build/C/man2/recvmmsg.2:250
4269 " memset(msgs, 0, sizeof(msgs));\n"
4270 " for (i = 0; i E<lt> VLEN; i++) {\n"
4271 " iovecs[i].iov_base = bufs[i];\n"
4272 " iovecs[i].iov_len = BUFSIZE;\n"
4273 " msgs[i].msg_hdr.msg_iov = &iovecs[i];\n"
4274 " msgs[i].msg_hdr.msg_iovlen = 1;\n"
4277 " memset(msgs, 0, sizeof(msgs));\n"
4278 " for (i = 0; i E<lt> VLEN; i++) {\n"
4279 " iovecs[i].iov_base = bufs[i];\n"
4280 " iovecs[i].iov_len = BUFSIZE;\n"
4281 " msgs[i].msg_hdr.msg_iov = &iovecs[i];\n"
4282 " msgs[i].msg_hdr.msg_iovlen = 1;\n"
4286 #: build/C/man2/recvmmsg.2:253
4289 " timeout.tv_sec = TIMEOUT;\n"
4290 " timeout.tv_nsec = 0;\n"
4292 " timeout.tv_sec = TIMEOUT;\n"
4293 " timeout.tv_nsec = 0;\n"
4296 #: build/C/man2/recvmmsg.2:259
4299 " retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4300 " if (retval == -1) {\n"
4301 " perror(\"recvmmsg()\");\n"
4302 " exit(EXIT_FAILURE);\n"
4305 " retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4306 " if (retval == -1) {\n"
4307 " perror(\"recvmmsg()\");\n"
4308 " exit(EXIT_FAILURE);\n"
4312 #: build/C/man2/recvmmsg.2:267
4315 " printf(\"%d messages received\\en\", retval);\n"
4316 " for (i = 0; i E<lt> retval; i++) {\n"
4317 " bufs[i][msgs[i].msg_len] = 0;\n"
4318 " printf(\"%d %s\", i+1, bufs[i]);\n"
4320 " exit(EXIT_SUCCESS);\n"
4323 " printf(\"%d messages received\\en\", retval);\n"
4324 " for (i = 0; i E<lt> retval; i++) {\n"
4325 " bufs[i][msgs[i].msg_len] = 0;\n"
4326 " printf(\"%d %s\", i+1, bufs[i]);\n"
4328 " exit(EXIT_SUCCESS);\n"
4332 #: build/C/man2/recvmmsg.2:275
4334 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4337 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4341 #: build/C/man2/select.2:38
4347 #: build/C/man2/select.2:38
4353 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4355 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4357 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4360 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4362 msgid "/* According to POSIX.1-2001 */\n"
4363 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4366 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4367 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4369 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4370 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4373 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4375 msgid "/* According to earlier standards */\n"
4376 msgstr "/* 以前の規格に従う場合 */\n"
4379 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4381 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4382 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4385 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4387 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4388 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4391 #: build/C/man2/select.2:58
4394 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4395 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4397 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4398 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4401 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4403 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4404 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4407 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4409 msgid "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4410 msgstr "B<int FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4413 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4415 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4416 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4419 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4421 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4422 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4425 #: build/C/man2/select.2:72
4428 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4429 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4430 "B< const sigset_t *>I<sigmask>B<);>\n"
4432 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4433 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4434 "B< const sigset_t *>I<sigmask>B<);>\n"
4437 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4438 #: build/C/man3/sockatmark.3:36
4440 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4441 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
4444 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4446 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4449 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4453 #: build/C/man2/select.2:92
4455 "B<select>() and B<pselect>() allow a program to monitor multiple file "
4456 "descriptors, waiting until one or more of the file descriptors become \"ready"
4457 "\" for some class of I/O operation (e.g., input possible). A file "
4458 "descriptor is considered ready if it is possible to perform the "
4459 "corresponding I/O operation (e.g., B<read>(2)) without blocking."
4461 "B<select>() や B<pselect>() を使うと、プログラムで複数のファイルディスクリ"
4462 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4463 "(準備ができた)」状態 (例えば、読み込み可能になった状態) になるまで待つことが"
4464 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4465 "作 (例えば B<read>(2) など) が停止 (block) なしに実行可能な状態にあることを"
4469 #: build/C/man2/select.2:98
4471 "The operation of B<select>() and B<pselect>() is identical, other than "
4472 "these three differences:"
4474 "B<select>() と B<pselect>() の動作は同じであるが、以下の 3 点が異なる:"
4477 #: build/C/man2/select.2:98
4483 #: build/C/man2/select.2:108
4485 "B<select>() uses a timeout that is a I<struct timeval> (with seconds and "
4486 "microseconds), while B<pselect>() uses a I<struct timespec> (with seconds "
4489 "B<select>() では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4490 "クロ秒単位) を用いる。 一方、 B<pselect>() 関数では、構造体 I<struct "
4491 "timespec> (秒・ナノ秒単位) を用いる。"
4494 #: build/C/man2/select.2:108
4500 #: build/C/man2/select.2:116
4502 "B<select>() may update the I<timeout> argument to indicate how much time "
4503 "was left. B<pselect>() does not change this argument."
4505 "B<select>() は残り時間を示す I<timeout> 引き数を更新することがある。 "
4506 "B<pselect>() はこの引き数を変更しない。"
4509 #: build/C/man2/select.2:116
4515 #: build/C/man2/select.2:125
4517 "B<select>() has no I<sigmask> argument, and behaves as B<pselect>() called "
4518 "with NULL I<sigmask>."
4520 "B<select>() は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4521 "指定した場合の B<pselect>() と同じである。"
4524 #: build/C/man2/select.2:143
4526 "Three independent sets of file descriptors are watched. Those listed in "
4527 "I<readfds> will be watched to see if characters become available for reading "
4528 "(more precisely, to see if a read will not block; in particular, a file "
4529 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4530 "watched to see if a write will not block, and those in I<exceptfds> will be "
4531 "watched for exceptions. On exit, the sets are modified in place to indicate "
4532 "which file descriptors actually changed status. Each of the three file "
4533 "descriptor sets may be specified as NULL if no file descriptors are to be "
4534 "watched for the corresponding class of events."
4536 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4537 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4538 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4539 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4540 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4541 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4542 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4543 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4544 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4548 #: build/C/man2/select.2:156
4550 "Four macros are provided to manipulate the sets. B<FD_ZERO>() clears a "
4551 "set. B<FD_SET>() and B<FD_CLR>() respectively add and remove a given file "
4552 "descriptor from a set. B<FD_ISSET>() tests to see if a file descriptor is "
4553 "part of the set; this is useful after B<select>() returns."
4555 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>() は集合を消"
4556 "去する。 B<FD_SET>() と B<FD_CLR>() はそれぞれ指定したファイルディスクリプ"
4557 "タの集合への追加、削除を行う。 B<FD_ISSET>() は集合にファイルディスクリプタ"
4558 "があるかどうか調べる; このマクロは B<select>() が終了した後に使うと便利であ"
4562 #: build/C/man2/select.2:159
4564 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4567 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4571 #: build/C/man2/select.2:166
4573 "The I<timeout> argument specifies the interval that B<select>() should "
4574 "block waiting for a file descriptor to become ready. The call will block "
4579 #: build/C/man2/select.2:166 build/C/man2/select.2:168
4580 #: build/C/man2/select.2:170
4586 #: build/C/man2/select.2:168
4587 msgid "a file descriptor becomes ready;"
4591 #: build/C/man2/select.2:170
4594 #| "The system call was interrupted by a signal that was caught; see B<signal>"
4596 msgid "the call is interrupted by a signal handler; or"
4598 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7) 参照。"
4601 #: build/C/man2/select.2:172
4602 msgid "the timeout expires."
4603 msgstr "タイムアウト時間が満了した。"
4606 #: build/C/man2/select.2:189
4609 #| "The I<timeout> argument specifies the interval that B<select>() should "
4610 #| "block waiting for a file descriptor to become ready. This interval will "
4611 #| "be rounded up to the system clock granularity, and kernel scheduling "
4612 #| "delays mean that the blocking interval may overrun by a small amount. If "
4613 #| "both fields of the I<timeval> structure are zero, then B<select>() "
4614 #| "returns immediately. (This is useful for polling.) If I<timeout> is "
4615 #| "NULL (no timeout), B<select>() can block indefinitely."
4617 "Note that the I<timeout> interval will be rounded up to the system clock "
4618 "granularity, and kernel scheduling delays mean that the blocking interval "
4619 "may overrun by a small amount. If both fields of the I<timeval> structure "
4620 "are zero, then B<select>() returns immediately. (This is useful for "
4621 "polling.) If I<timeout> is NULL (no timeout), B<select>() can block "
4624 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4625 "B<select>() が停止する停止時間を指定する\n"
4626 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4627 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4628 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4629 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4630 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4634 #: build/C/man2/select.2:199
4636 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4637 "not NULL, then B<pselect>() first replaces the current signal mask by the "
4638 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4639 "restores the original signal mask."
4641 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2) を参照) へのポインタであ"
4642 "る。 I<sigmask> が NULL でない場合、 B<pselect>() は I<sigmask> が指している"
4643 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4644 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4647 #: build/C/man2/select.2:205
4649 "Other than the difference in the precision of the I<timeout> argument, the "
4650 "following B<pselect>() call:"
4652 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>() の呼び出しは、"
4655 #: build/C/man2/select.2:209
4658 " ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4659 " timeout, &sigmask);\n"
4661 " ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4662 " timeout, &sigmask);\n"
4665 #: build/C/man2/select.2:214
4666 msgid "is equivalent to I<atomically> executing the following calls:"
4667 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4670 #: build/C/man2/select.2:217
4672 msgid " sigset_t origmask;\n"
4673 msgstr " sigset_t origmask;\n"
4676 #: build/C/man2/select.2:221
4679 " pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4680 " ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4681 " pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4683 " pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4684 " ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4685 " pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4688 #: build/C/man2/select.2:242
4690 "The reason that B<pselect>() is needed is that if one wants to wait for "
4691 "either a signal or for a file descriptor to become ready, then an atomic "
4692 "test is needed to prevent race conditions. (Suppose the signal handler sets "
4693 "a global flag and returns. Then a test of this global flag followed by a "
4694 "call of B<select>() could hang indefinitely if the signal arrived just "
4695 "after the test but just before the call. By contrast, B<pselect>() allows "
4696 "one to first block signals, handle the signals that have come in, then call "
4697 "B<pselect>() with the desired I<sigmask>, avoiding the race.)"
4699 "B<pselect>() が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4700 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4701 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4702 "大域フラグのテストに続けて B<select>() を呼び出すと、 シグナルがテストの直後"
4703 "かつ呼び出しの直前に届いた時には B<select>() は永久にハングしてしまうかもし"
4704 "れない。 一方、 B<pselect>() を使うと、まずシグナルを禁止 (block) して、入っ"
4705 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>() を呼び出すこと"
4706 "で、前記の競合を避けることができる。)"
4709 #: build/C/man2/select.2:242
4715 #: build/C/man2/select.2:246
4717 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4720 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4723 #: build/C/man2/select.2:253
4726 "struct timeval {\n"
4727 " long tv_sec; /* seconds */\n"
4728 " long tv_usec; /* microseconds */\n"
4731 "struct timeval {\n"
4732 " long tv_sec; /* 秒 */\n"
4733 " long tv_usec; /* マイクロ秒 */\n"
4737 #: build/C/man2/select.2:257
4742 #: build/C/man2/select.2:264
4745 "struct timespec {\n"
4746 " long tv_sec; /* seconds */\n"
4747 " long tv_nsec; /* nanoseconds */\n"
4750 "struct timespec {\n"
4751 " long tv_sec; /* 秒 */\n"
4752 " long tv_nsec; /* ナノ秒 */\n"
4756 #: build/C/man2/select.2:268
4757 msgid "(However, see below on the POSIX.1-2001 versions.)"
4759 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4763 #: build/C/man2/select.2:276
4765 "Some code calls B<select>() with all three sets empty, I<nfds> zero, and a "
4766 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4769 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4770 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>() を"
4771 "呼び出すという方法を使っているコードもある。"
4773 #. .PP - it is rumored that:
4774 #. On BSD, when a timeout occurs, the file descriptor bits are not changed.
4775 #. - it is certainly true that:
4776 #. Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4778 #: build/C/man2/select.2:299
4780 "On Linux, B<select>() modifies I<timeout> to reflect the amount of time not "
4781 "slept; most other implementations do not do this. (POSIX.1-2001 permits "
4782 "either behavior.) This causes problems both when Linux code which reads "
4783 "I<timeout> is ported to other operating systems, and when code is ported to "
4784 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4785 "without reinitializing it. Consider I<timeout> to be undefined after "
4786 "B<select>() returns."
4788 "Linux では、 B<select>() は I<timeout> を変更し、残りの停止時間を反映するよ"
4789 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4790 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4791 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4792 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4793 "B<select>() を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4794 "こる。 B<select>() から復帰した後は I<timeout> は未定義であると考えるべきで"
4798 #: build/C/man2/select.2:317
4801 #| "On success, B<select>() and B<pselect>() return the number of file "
4802 #| "descriptors contained in the three returned descriptor sets (that is, the "
4803 #| "total number of bits that are set in I<readfds>, I<writefds>, "
4804 #| "I<exceptfds>) which may be zero if the timeout expires before anything "
4805 #| "interesting happens. On error, -1 is returned, and I<errno> is set "
4806 #| "appropriately; the sets and I<timeout> become undefined, so do not rely "
4807 #| "on their contents after an error."
4809 "On success, B<select>() and B<pselect>() return the number of file "
4810 "descriptors contained in the three returned descriptor sets (that is, the "
4811 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>) "
4812 "which may be zero if the timeout expires before anything interesting "
4813 "happens. On error, -1 is returned, and I<errno> is set to indicate the "
4814 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4817 "成功した場合、 B<select>() と B<pselect>() は更新された 3 つのディスクリプ"
4818 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4819 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4820 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4821 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4822 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4825 #: build/C/man2/select.2:323
4827 "An invalid file descriptor was given in one of the sets. (Perhaps a file "
4828 "descriptor that was already closed, or one on which an error has occurred.)"
4830 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4831 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4835 #: build/C/man2/select.2:327
4836 msgid "A signal was caught; see B<signal>(7)."
4840 #: build/C/man2/select.2:333
4842 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4843 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4846 #: build/C/man2/select.2:336
4847 msgid "unable to allocate memory for internal tables."
4848 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4851 #: build/C/man2/select.2:342
4853 "B<pselect>() was added to Linux in kernel 2.6.16. Prior to this, B<pselect>"
4854 "() was emulated in glibc (but see BUGS)."
4856 "B<pselect>() はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4857 "B<pselect>() は glibc でエミュレートされていた (「バグ」の章を参照)。"
4860 #: build/C/man2/select.2:353
4862 "B<select>() conforms to POSIX.1-2001 and 4.4BSD (B<select>() first "
4863 "appeared in 4.2BSD). Generally portable to/from non-BSD systems supporting "
4864 "clones of the BSD socket layer (including System V variants). However, note "
4865 "that the System V variant typically sets the timeout variable before exit, "
4866 "but the BSD variant does not."
4868 "B<select>() は POSIX.1-2001 と 4.4BSD (B<select>() は 4.2BSD で最初に登場し"
4869 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4870 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4871 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4875 #: build/C/man2/select.2:357
4876 msgid "B<pselect>() is defined in POSIX.1g, and in POSIX.1-2001."
4877 msgstr "B<pselect>() は POSIX.1g と POSIX.1-2001 で定義されている。"
4880 #: build/C/man2/select.2:374
4882 "An I<fd_set> is a fixed size buffer. Executing B<FD_CLR>() or B<FD_SET>() "
4883 "with a value of I<fd> that is negative or is equal to or larger than "
4884 "B<FD_SETSIZE> will result in undefined behavior. Moreover, POSIX requires "
4885 "I<fd> to be a valid file descriptor."
4887 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4888 "I<fd> に対して B<FD_CLR>() や B<FD_SET>() を実行した場合、 どのような動作を"
4889 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4890 "プタでなければならないと規定されている。"
4893 #: build/C/man2/select.2:383
4895 "Concerning the types involved, the classical situation is that the two "
4896 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4897 "the structure is defined in I<E<lt>sys/time.hE<gt>>. The POSIX.1-2001 "
4900 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4901 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4902 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4905 #: build/C/man2/select.2:390
4908 "struct timeval {\n"
4909 " time_t tv_sec; /* seconds */\n"
4910 " suseconds_t tv_usec; /* microseconds */\n"
4913 "struct timeval {\n"
4914 "\t time_t tv_sec; /* 秒 */\n"
4915 "\t suseconds_t tv_usec; /* マイクロ秒 */\n"
4919 #: build/C/man2/select.2:401
4921 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4922 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4924 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4925 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4928 #: build/C/man2/select.2:413
4930 "Concerning prototypes, the classical situation is that one should include "
4931 "I<E<lt>time.hE<gt>> for B<select>(). The POSIX.1-2001 situation is that one "
4932 "should include I<E<lt>sys/select.hE<gt>> for B<select>() and B<pselect>()."
4934 "プロトタイプに関しては、昔ながらの状況で B<select>() を使いたい場合は、 "
4935 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4936 "B<select>() と B<pselect>() を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4940 #: build/C/man2/select.2:425
4942 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4943 "2.0 and later this header exists. Under glibc 2.0 it unconditionally gives "
4944 "the wrong prototype for B<pselect>(). Under glibc 2.1 to 2.2.1 it gives "
4945 "B<pselect>() when B<_GNU_SOURCE> is defined. Since glibc 2.2.2 the "
4946 "requirements are as shown in the SYNOPSIS."
4948 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4949 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>() のプロトタイ"
4950 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4951 "場合に、 B<pselect>() が提供される。 glibc 2.2.2 以降では、 B<pselect>() を"
4952 "使用するには、「書式」に記載された要件を満たす必要がある。"
4955 #: build/C/man2/select.2:425
4957 msgid "Multithreaded applications"
4958 msgstr "マルチスレッド・アプリケーション"
4961 #: build/C/man2/select.2:441
4963 "If a file descriptor being monitored by B<select>() is closed in another "
4964 "thread, the result is unspecified. On some UNIX systems, B<select>() "
4965 "unblocks and returns, with an indication that the file descriptor is ready "
4966 "(a subsequent I/O operation will likely fail with an error, unless another "
4967 "the file descriptor reopened between the time B<select>() returned and the "
4968 "I/O operations was performed). On Linux (and some other systems), closing "
4969 "the file descriptor in another thread has no effect on B<select>(). In "
4970 "summary, any application that relies on a particular behavior in this "
4971 "scenario must be considered buggy."
4973 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
4974 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
4975 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
4976 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
4977 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
4978 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
4979 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
4980 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
4984 #: build/C/man2/select.2:441
4990 #: build/C/man2/select.2:449
4992 "The B<pselect>() interface described in this page is implemented by glibc. "
4993 "The underlying Linux system call is named B<pselect6>(). This system call "
4994 "has somewhat different behavior from the glibc wrapper function."
4996 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4997 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
4998 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5002 #: build/C/man2/select.2:464
5004 "The Linux B<pselect6>() system call modifies its I<timeout> argument. "
5005 "However, the glibc wrapper function hides this behavior by using a local "
5006 "variable for the timeout argument that is passed to the system call. Thus, "
5007 "the glibc B<pselect>() function does not modify its I<timeout> argument; "
5008 "this is the behavior required by POSIX.1-2001."
5010 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5011 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5012 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5013 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5014 "これが POSIX.1-2001 が要求している動作である。"
5017 #: build/C/man2/select.2:470
5019 "The final argument of the B<pselect6>() system call is not a I<sigset_t\\ "
5020 "*> pointer, but is instead a structure of the form:"
5022 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5023 "ポインタではなく、以下に示す構造体である。"
5026 #: build/C/man2/select.2:478
5030 " const sigset_t *ss; /* Pointer to signal set */\n"
5031 " size_t ss_len; /* Size (in bytes) of object pointed\n"
5036 " const sigset_t *ss; /* シグナル集合へのポインタ */\n"
5037 " size_t ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5042 #: build/C/man2/select.2:485
5044 "This allows the system call to obtain both a pointer to the signal set and "
5045 "its size, while allowing for the fact that most architectures support a "
5046 "maximum of 6 arguments to a system call."
5048 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5049 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5050 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5051 "のサイズの両方を取得することができるのである。"
5054 #: build/C/man2/select.2:491
5056 "Glibc 2.0 provided a version of B<pselect>() that did not take a I<sigmask> "
5059 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>() が提供"
5063 #: build/C/man2/select.2:504
5065 "Starting with version 2.1, glibc provided an emulation of B<pselect>() that "
5066 "was implemented using B<sigprocmask>(2) and B<select>(). This "
5067 "implementation remained vulnerable to the very race condition that B<pselect>"
5068 "() was designed to prevent. Modern versions of glibc use the (race-free) "
5069 "B<pselect>() system call on kernels where it is provided."
5071 "バージョン 2.1 以降の glibc では、 B<pselect>() は B<sigprocmask>(2) と "
5072 "B<select>() を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5073 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5074 "B<pselect>() は設計されたのである。 最近のバージョンの glibc では、カーネル"
5075 "がサポートしている場合には、 (競合が起こらない) B<pselect>() システムコール"
5079 #: build/C/man2/select.2:517
5081 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5082 "trapping can be achieved using the self-pipe trick. In this technique, a "
5083 "signal handler writes a byte to a pipe whose other end is monitored by "
5084 "B<select>() in the main program. (To avoid possibly blocking when writing "
5085 "to a pipe that may be full or reading from a pipe that may be empty, "
5086 "nonblocking I/O is used when reading from and writing to the pipe.)"
5088 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5089 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5090 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5091 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5092 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5093 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5094 "(nonblocking) I/O を使用するとよい)。"
5096 #. Stevens discusses a case where accept can block after select
5097 #. returns successfully because of an intervening RST from the client.
5098 #. Maybe the kernel should have returned EIO in such a situation?
5100 #: build/C/man2/select.2:533
5102 "Under Linux, B<select>() may report a socket file descriptor as \"ready for "
5103 "reading\", while nevertheless a subsequent read blocks. This could for "
5104 "example happen when data has arrived but upon examination has wrong checksum "
5105 "and is discarded. There may be other circumstances in which a file "
5106 "descriptor is spuriously reported as ready. Thus it may be safer to use "
5107 "B<O_NONBLOCK> on sockets that should not block."
5109 "Linux では、 B<select>() がソケットファイルディスクリプタで \"読み込みの準備"
5110 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5111 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5112 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5113 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5114 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5117 #: build/C/man2/select.2:548
5119 "On Linux, B<select>() also modifies I<timeout> if the call is interrupted "
5120 "by a signal handler (i.e., the B<EINTR> error return). This is not "
5121 "permitted by POSIX.1-2001. The Linux B<pselect>() system call has the same "
5122 "behavior, but the glibc wrapper hides this behavior by internally copying "
5123 "the I<timeout> to a local variable and passing that variable to the system "
5126 "Linux では、 B<select>() がシグナルハンドラにより割り込まれた場合 (つまり "
5127 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5128 "認められていない挙動である。 Linux の B<pselect>() システムコールも同じ挙動"
5129 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5130 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5134 #: build/C/man2/select.2:555
5137 "#include E<lt>stdio.hE<gt>\n"
5138 "#include E<lt>stdlib.hE<gt>\n"
5139 "#include E<lt>sys/time.hE<gt>\n"
5140 "#include E<lt>sys/types.hE<gt>\n"
5141 "#include E<lt>unistd.hE<gt>\n"
5143 "#include E<lt>stdio.hE<gt>\n"
5144 "#include E<lt>stdlib.hE<gt>\n"
5145 "#include E<lt>sys/time.hE<gt>\n"
5146 "#include E<lt>sys/types.hE<gt>\n"
5147 "#include E<lt>unistd.hE<gt>\n"
5150 #: build/C/man2/select.2:562
5157 " struct timeval tv;\n"
5164 " struct timeval tv;\n"
5168 #: build/C/man2/select.2:566
5171 " /* Watch stdin (fd 0) to see when it has input. */\n"
5172 " FD_ZERO(&rfds);\n"
5173 " FD_SET(0, &rfds);\n"
5175 " /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5176 " FD_ZERO(&rfds);\n"
5177 " FD_SET(0, &rfds);\n"
5180 #: build/C/man2/select.2:570
5183 " /* Wait up to five seconds. */\n"
5185 " tv.tv_usec = 0;\n"
5189 " tv.tv_usec = 0;\n"
5192 #: build/C/man2/select.2:573
5195 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
5196 " /* Don't rely on the value of tv now! */\n"
5198 " retval = select(1, &rfds, NULL, NULL, &tv);\n"
5199 " /* この時点での tv の値を信頼してはならない。*/\n"
5202 #: build/C/man2/select.2:581
5205 " if (retval == -1)\n"
5206 " perror(\"select()\");\n"
5207 " else if (retval)\n"
5208 " printf(\"Data is available now.\\en\");\n"
5209 " /* FD_ISSET(0, &rfds) will be true. */\n"
5211 " printf(\"No data within five seconds.\\en\");\n"
5213 " if (retval == -1)\n"
5214 "\tperror(\"select()\");\n"
5215 " else if (retval)\n"
5216 " printf(\"今、データが取得できました。\\en\");\n"
5217 " /* FD_ISSET(0, &rfds) が true になる。*/\n"
5219 " printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5222 #: build/C/man2/select.2:596
5224 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5225 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5227 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5228 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5231 #: build/C/man2/select.2:599
5232 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5234 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2) がある。"
5237 #: build/C/man2/select_tut.2:32
5243 #: build/C/man2/select_tut.2:32
5245 #| msgid "2013-09-04"
5250 #: build/C/man2/select_tut.2:52
5253 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5254 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5256 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5257 "B< fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5260 #: build/C/man2/select_tut.2:66
5263 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5264 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5265 "B< const sigset_t *>I<sigmask>B<);>\n"
5267 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5268 "B< fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5269 "B< const sigset_t *>I<sigmask>B<);>\n"
5272 #: build/C/man2/select_tut.2:83
5274 "B<select>() (or B<pselect>()) is used to efficiently monitor multiple file "
5275 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5276 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5277 "occurred on any of the descriptors."
5279 "B<select>() (や B<pselect>()) を使うと、効率的に複数のファイルディスクリプ"
5280 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5281 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5282 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5286 #: build/C/man2/select_tut.2:108
5288 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5289 "I<writefds>, and I<exceptfds>. Each set is declared as type I<fd_set>, and "
5290 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5291 "B<FD_SET>(), and B<FD_ZERO>(). A newly declared set should first be cleared "
5292 "using B<FD_ZERO>(). B<select>() modifies the contents of the sets "
5293 "according to the rules described below; after calling B<select>() you can "
5294 "test if a file descriptor is still present in a set with the B<FD_ISSET>() "
5295 "macro. B<FD_ISSET>() returns nonzero if a specified file descriptor is "
5296 "present in a set and zero if it is not. B<FD_CLR>() removes a file "
5297 "descriptor from a set."
5299 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5300 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5301 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>() "
5302 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5303 "B<FD_ZERO>() を使ってクリアすべきである。 B<select>() はこれらの集合の内容"
5304 "を、以降に述べる規則に従って修正する。 B<select>() を呼んだ後、ファイルディ"
5305 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>() マクロによって"
5306 "調べることができる。 B<FD_ISSET>() は指定されたディスクリプタが集合に存在し"
5307 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>() は集合から"
5308 "のファイルディスクリプタの削除を行う。"
5311 #: build/C/man2/select_tut.2:108
5317 #: build/C/man2/select_tut.2:109
5323 #: build/C/man2/select_tut.2:118
5325 "This set is watched to see if data is available for reading from any of its "
5326 "file descriptors. After B<select>() has returned, I<readfds> will be "
5327 "cleared of all file descriptors except for those that are immediately "
5328 "available for reading."
5330 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5331 "になったかどうかを監視する。 B<select>() から戻る時に、I<readfds> のうち、 "
5332 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5335 #: build/C/man2/select_tut.2:118
5338 msgstr "I<writefds>"
5341 #: build/C/man2/select_tut.2:127
5343 "This set is watched to see if there is space to write data to any of its "
5344 "file descriptors. After B<select>() has returned, I<writefds> will be "
5345 "cleared of all file descriptors except for those that are immediately "
5346 "available for writing."
5348 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5349 "スがあるかどうかを監視する。 B<select>() から戻る時に、I<writefds> のうち、 "
5350 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5353 #: build/C/man2/select_tut.2:127
5355 msgid "I<exceptfds>"
5356 msgstr "I<exceptfds>"
5359 #: build/C/man2/select_tut.2:149
5361 "This set is watched for \"exceptional conditions\". In practice, only one "
5362 "such exceptional condition is common: the availability of I<out-of-band> "
5363 "(OOB) data for reading from a TCP socket. See B<recv>(2), B<send>(2), and "
5364 "B<tcp>(7) for more details about OOB data. (One other less common case "
5365 "where B<select>(2) indicates an exceptional condition occurs with "
5366 "pseudoterminals in packet mode; see B<tty_ioctl>(4).) After B<select>() "
5367 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5368 "for those for which an exceptional condition has occurred."
5370 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5371 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5372 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5373 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5374 "は、 B<recv>(2), B<send>(2), B<tcp>(7) を参照のこと。 (これ以外では、まれな"
5375 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>() が例外"
5376 "状態を示すことがある。) B<select>() が返る時に、I<exceptfds> のうち、 例外"
5377 "状態が発生したディスクリプタ以外は集合から削除される。"
5380 #: build/C/man2/select_tut.2:149
5386 #: build/C/man2/select_tut.2:156
5388 "This is an integer one more than the maximum of any file descriptor in any "
5389 "of the sets. In other words, while adding file descriptors to each of the "
5390 "sets, you must calculate the maximum integer value of all of them, then "
5391 "increment this value by one, and then pass this as I<nfds>."
5393 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5394 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5395 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5396 "I<nfds> として渡さないといけない、ということだ。"
5399 #: build/C/man2/select_tut.2:156
5402 msgstr "I<utimeout>"
5405 #: build/C/man2/select_tut.2:169
5407 "This is the longest time B<select>() may wait before returning, even if "
5408 "nothing interesting happened. If this value is passed as NULL, then "
5409 "B<select>() blocks indefinitely waiting for a file descriptor to become "
5410 "ready. I<utimeout> can be set to zero seconds, which causes B<select>() to "
5411 "return immediately, with information about the readiness of file descriptors "
5412 "at the time of the call. The structure I<struct timeval> is defined as:"
5414 "(何も起こらなかった場合に) B<select>() が戻る前に待つ最大時間である。 この"
5415 "値に NULL を渡すと、 B<select>() はファイルディスクリプタのいずれかが ready "
5416 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5417 "にすることもでき、 この場合 B<select>() は直ちに返り、呼び出し時点のファイル"
5418 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5422 #: build/C/man2/select_tut.2:176
5425 "struct timeval {\n"
5426 " time_t tv_sec; /* seconds */\n"
5427 " long tv_usec; /* microseconds */\n"
5430 "struct timeval {\n"
5431 " time_t tv_sec; /* seconds */\n"
5432 " long tv_usec; /* microseconds */\n"
5436 #: build/C/man2/select_tut.2:178
5439 msgstr "I<ntimeout>"
5442 #: build/C/man2/select_tut.2:187
5444 "This argument for B<pselect>() has the same meaning as I<utimeout>, but "
5445 "I<struct timespec> has nanosecond precision as follows:"
5447 "B<pselect>() のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5448 "timespec> は次に示すようにナノ秒の精度を持つ。"
5451 #: build/C/man2/select_tut.2:194
5454 "struct timespec {\n"
5455 " long tv_sec; /* seconds */\n"
5456 " long tv_nsec; /* nanoseconds */\n"
5459 "struct timespec {\n"
5460 " long tv_sec; /* seconds */\n"
5461 " long tv_nsec; /* nanoseconds */\n"
5465 #: build/C/man2/select_tut.2:196
5471 #: build/C/man2/select_tut.2:213
5473 "This argument holds a set of signals that the kernel should unblock (i.e., "
5474 "remove from the signal mask of the calling thread), while the caller is "
5475 "blocked inside the B<pselect>() call (see B<sigaddset>(3) and "
5476 "B<sigprocmask>(2)). It may be NULL, in which case the call does not modify "
5477 "the signal mask on entry and exit to the function. In this case, B<pselect>"
5478 "() will then behave just like B<select>()."
5480 "この引き数は、呼び出し側が B<pselect>() 内部で停止している間に、カーネルが通"
5481 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5482 "削除すべきシグナル集合) を保持する (B<sigaddset>(3) と B<sigprocmask>(2) "
5483 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5484 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>() は B<select>"
5488 #: build/C/man2/select_tut.2:213
5490 msgid "Combining signal and data events"
5491 msgstr "シグナルとデータイベントを組み合わせる"
5494 #: build/C/man2/select_tut.2:257
5496 "B<pselect>() is useful if you are waiting for a signal as well as for file "
5497 "descriptor(s) to become ready for I/O. Programs that receive signals "
5498 "normally use the signal handler only to raise a global flag. The global "
5499 "flag will indicate that the event must be processed in the main loop of the "
5500 "program. A signal will cause the B<select>() (or B<pselect>()) call to "
5501 "return with I<errno> set to B<EINTR>. This behavior is essential so that "
5502 "signals can be processed in the main loop of the program, otherwise B<select>"
5503 "() would block indefinitely. Now, somewhere in the main loop will be a "
5504 "conditional to check the global flag. So we must ask: what if a signal "
5505 "arrives after the conditional, but before the B<select>() call? The answer "
5506 "is that B<select>() would block indefinitely, even though an event is "
5507 "actually pending. This race condition is solved by the B<pselect>() call. "
5508 "This call can be used to set the signal mask to a set of signals that are "
5509 "only to be received within the B<pselect>() call. For instance, let us say "
5510 "that the event in question was the exit of a child process. Before the "
5511 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2). "
5512 "Our B<pselect>() call would enable B<SIGCHLD> by using an empty signal "
5513 "mask. Our program would look like:"
5515 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5516 "合には、 B<pselect>() が便利である。 シグナルを受信するプログラムは、通常"
5517 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5518 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5519 "ないことを示す。 シグナルを受けると B<select>() (や B<pselect>()) は "
5520 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5521 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>() は"
5522 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5523 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5524 "「シグナルが条件文の後、しかし B<select>() コールの前に到着したら どうなるの"
5525 "か?」 答えは「その B<select>() は、たとえ解決待ちのイベントがあったとして"
5526 "も、 永遠に停止する」である。 この競合状態は B<pselect>() コールによって解決"
5527 "できる。 このコールを使うと、 B<pselect>() で受信したいシグナルの集合だけを"
5528 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5529 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5530 "B<sigprocmask>(2) でブロックする。 B<pselect>() コールでは B<SIGCHLD> を、"
5531 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5535 #: build/C/man2/select_tut.2:260
5537 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5538 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5541 #: build/C/man2/select_tut.2:266
5545 "child_sig_handler(int sig)\n"
5547 " got_SIGCHLD = 1;\n"
5551 "child_sig_handler(int sig)\n"
5553 " got_SIGCHLD = 1;\n"
5557 #: build/C/man2/select_tut.2:274
5561 "main(int argc, char *argv[])\n"
5563 " sigset_t sigmask, empty_mask;\n"
5564 " struct sigaction sa;\n"
5565 " fd_set readfds, writefds, exceptfds;\n"
5569 "main(int argc, char *argv[])\n"
5571 " sigset_t sigmask, empty_mask;\n"
5572 " struct sigaction sa;\n"
5573 " fd_set readfds, writefds, exceptfds;\n"
5577 #: build/C/man2/select_tut.2:281
5580 " sigemptyset(&sigmask);\n"
5581 " sigaddset(&sigmask, SIGCHLD);\n"
5582 " if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5583 " perror(\"sigprocmask\");\n"
5584 " exit(EXIT_FAILURE);\n"
5587 " sigemptyset(&sigmask);\n"
5588 " sigaddset(&sigmask, SIGCHLD);\n"
5589 " if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5590 " perror(\"sigprocmask\");\n"
5591 " exit(EXIT_FAILURE);\n"
5595 #: build/C/man2/select_tut.2:289
5598 " sa.sa_flags = 0;\n"
5599 " sa.sa_handler = child_sig_handler;\n"
5600 " sigemptyset(&sa.sa_mask);\n"
5601 " if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5602 " perror(\"sigaction\");\n"
5603 " exit(EXIT_FAILURE);\n"
5606 " sa.sa_flags = 0;\n"
5607 " sa.sa_handler = child_sig_handler;\n"
5608 " sigemptyset(&sa.sa_mask);\n"
5609 " if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5610 " perror(\"sigaction\");\n"
5611 " exit(EXIT_FAILURE);\n"
5615 #: build/C/man2/select_tut.2:291
5617 msgid " sigemptyset(&empty_mask);\n"
5618 msgstr " sigemptyset(&empty_mask);\n"
5621 #: build/C/man2/select_tut.2:295
5624 " for (;;) { /* main loop */\n"
5625 " /* Initialize readfds, writefds, and exceptfds\n"
5626 " before the pselect() call. (Code omitted.) */\n"
5628 " for (;;) { /* main loop */\n"
5629 " /* Initialize readfds, writefds, and exceptfds\n"
5630 " before the pselect() call. (Code omitted.) */\n"
5633 #: build/C/man2/select_tut.2:301
5636 " r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5637 " NULL, &empty_mask);\n"
5638 " if (r == -1 && errno != EINTR) {\n"
5639 " /* Handle error */\n"
5642 " r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5643 " NULL, &empty_mask);\n"
5644 " if (r == -1 && errno != EINTR) {\n"
5645 " /* Handle error */\n"
5649 #: build/C/man2/select_tut.2:304
5652 " if (got_SIGCHLD) {\n"
5653 " got_SIGCHLD = 0;\n"
5655 " if (got_SIGCHLD) {\n"
5656 " got_SIGCHLD = 0;\n"
5659 #: build/C/man2/select_tut.2:308
5662 " /* Handle signalled event here; e.g., wait() for all\n"
5663 " terminated children. (Code omitted.) */\n"
5666 " /* Handle signalled event here; e.g., wait() for all\n"
5667 " terminated children. (Code omitted.) */\n"
5671 #: build/C/man2/select_tut.2:312
5674 " /* main body of program */\n"
5678 " /* main body of program */\n"
5683 #: build/C/man2/select_tut.2:313
5689 #: build/C/man2/select_tut.2:334
5691 "So what is the point of B<select>()? Can't I just read and write to my "
5692 "descriptors whenever I want? The point of B<select>() is that it watches "
5693 "multiple descriptors at the same time and properly puts the process to sleep "
5694 "if there is no activity. UNIX programmers often find themselves in a "
5695 "position where they have to handle I/O from more than one file descriptor "
5696 "where the data flow may be intermittent. If you were to merely create a "
5697 "sequence of B<read>(2) and B<write>(2) calls, you would find that one of "
5698 "your calls may block waiting for data from/to a file descriptor, while "
5699 "another file descriptor is unused though ready for I/O. B<select>() "
5700 "efficiently copes with this situation."
5702 "実際のところ B<select>() の大事な点は何なのか? ディスクリプタは好きなときに"
5703 "読み書きできるんじゃないの? B<select>() の重要なところは、複数のディスクリ"
5704 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5705 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5706 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5707 "出会う。 単に B<read>(2) や B<write>(2) コールのシーケンスを作るだけでは、"
5708 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5709 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5710 "になってしまうだろう。 B<select>() を使うとこの状況に効果的に対処できる。"
5713 #: build/C/man2/select_tut.2:334
5719 #: build/C/man2/select_tut.2:347
5721 "Many people who try to use B<select>() come across behavior that is "
5722 "difficult to understand and produces nonportable or borderline results. For "
5723 "instance, the above program is carefully written not to block at any point, "
5724 "even though it does not set its file descriptors to nonblocking mode. It is "
5725 "easy to introduce subtle errors that will remove the advantage of using "
5726 "B<select>(), so here is a list of essentials to watch for when using "
5729 "B<select>() を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5730 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5731 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5732 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5733 "れている。 微妙な間違いによって、 B<select>() を使う利点は簡単に失われてしま"
5734 "う。 そこで、 B<select>() コールを使うときに注意すべき重要事項を列挙しておく"
5738 #: build/C/man2/select_tut.2:356
5740 "You should always try to use B<select>() without a timeout. Your program "
5741 "should have nothing to do if there is no data available. Code that depends "
5742 "on timeouts is not usually portable and is difficult to debug."
5744 "B<select>() を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5745 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5746 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5749 #: build/C/man2/select_tut.2:360
5751 "The value I<nfds> must be properly calculated for efficiency as explained "
5754 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5758 #: build/C/man2/select_tut.2:367
5760 "No file descriptor must be added to any set if you do not intend to check "
5761 "its result after the B<select>() call, and respond appropriately. See next "
5764 "B<select>() コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5765 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5768 #: build/C/man2/select_tut.2:373
5770 "After B<select>() returns, all file descriptors in all sets should be "
5771 "checked to see if they are ready."
5773 "B<select>() から返った後には、全ての集合の全てのファイルディスクリプタについ"
5774 "て 読み書き可能な状態になっているかをチェックすべきである。"
5777 #: build/C/man2/select_tut.2:373
5783 #: build/C/man2/select_tut.2:388
5785 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) do I<not> "
5786 "necessarily read/write the full amount of data that you have requested. If "
5787 "they do read/write the full amount, it's because you have a low traffic load "
5788 "and a fast stream. This is not always going to be the case. You should "
5789 "cope with the case of your functions managing to send or receive only a "
5792 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) といった関数は、こちらが要求"
5793 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5794 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5795 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5796 "うな場合も 考慮に入れてやらなければならない。"
5799 #: build/C/man2/select_tut.2:388
5805 #: build/C/man2/select_tut.2:396
5807 "Never read/write only in single bytes at a time unless you are really sure "
5808 "that you have a small amount of data to process. It is extremely "
5809 "inefficient not to read/write as much data as you can buffer each time. The "
5810 "buffers in the example below are 1024 bytes although they could easily be "
5813 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5814 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5815 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5816 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5819 #: build/C/man2/select_tut.2:396
5824 #. Nonetheless, you should still cope with these errors for completeness.
5826 #: build/C/man2/select_tut.2:418
5828 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) as well "
5829 "as the B<select>() call can return -1 with I<errno> set to B<EINTR>, or "
5830 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>). These results must be "
5831 "properly managed (not done properly above). If your program is not going to "
5832 "receive any signals, then it is unlikely you will get B<EINTR>. If your "
5833 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5835 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) などの関数や B<select>() "
5836 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>) にして -1 を返す"
5837 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5838 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5839 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5840 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5843 #: build/C/man2/select_tut.2:418
5849 #: build/C/man2/select_tut.2:427
5851 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2) with a buffer "
5854 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5855 "(2), B<send>(2) を呼び出してはならない。"
5858 #: build/C/man2/select_tut.2:427
5864 #: build/C/man2/select_tut.2:443
5866 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2) fail "
5867 "with errors other than those listed in B<7.>, or one of the input functions "
5868 "returns 0, indicating end of file, then you should I<not> pass that "
5869 "descriptor to B<select>() again. In the example below, I close the "
5870 "descriptor immediately, and then set it to -1 to prevent it being included "
5873 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2) が B<7.> に示した以外のエ"
5874 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5875 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5876 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5877 "が集合に含まれ続けるのを許さないようにしている。"
5880 #: build/C/man2/select_tut.2:443
5886 #: build/C/man2/select_tut.2:450
5888 "The timeout value must be initialized with each new call to B<select>(), "
5889 "since some operating systems modify the structure. B<pselect>() however "
5890 "does not modify its timeout structure."
5892 "タイムアウトの値は B<select>() を呼ぶたびに初期化すべきである。 OS によって"
5893 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>() は自"
5894 "分の timeout 構造体を変更することはない。"
5897 #: build/C/man2/select_tut.2:450
5902 #. "I have heard" does not fill me with confidence, and doesn't
5903 #. belong in a man page, so I've commented this point out.
5906 #. I have heard that the Windows socket layer does not cope with OOB data
5908 #. It also does not cope with
5910 #. calls when no file descriptors are set at all.
5911 #. Having no file descriptors set is a useful
5912 #. way to sleep the process with subsecond precision by using the timeout.
5913 #. (See further on.)
5915 #: build/C/man2/select_tut.2:469
5917 "Since B<select>() modifies its file descriptor sets, if the call is being "
5918 "used in a loop, then the sets must be reinitialized before each call."
5920 "B<select>() はファイルディスクリプタ集合を変更するので、 B<select>() がルー"
5921 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5925 #: build/C/man2/select_tut.2:469
5927 msgid "Usleep emulation"
5928 msgstr "usleep エミュレーション"
5931 #: build/C/man2/select_tut.2:476
5933 "On systems that do not have a B<usleep>(3) function, you can call B<select>"
5934 "() with a finite timeout and no file descriptors as follows:"
5936 "B<usleep>(3) 関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5937 "ルディスクリプタを全くセットせずに B<select>() を呼び出すことで、これを代用"
5941 #: build/C/man2/select_tut.2:482
5944 " struct timeval tv;\n"
5946 " tv.tv_usec = 200000; /* 0.2 seconds */\n"
5947 " select(0, NULL, NULL, NULL, &tv);\n"
5949 " struct timeval tv;\n"
5951 " tv.tv_usec = 200000; /* 0.2 seconds */\n"
5952 " select(0, NULL, NULL, NULL, &tv);\n"
5955 #: build/C/man2/select_tut.2:485
5956 msgid "This is guaranteed to work only on UNIX systems, however."
5957 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5960 #: build/C/man2/select_tut.2:490
5962 "On success, B<select>() returns the total number of file descriptors still "
5963 "present in the file descriptor sets."
5965 "成功すると、 B<select>() はファイルディスクリプタ集合に残っている ファイル"
5969 #: build/C/man2/select_tut.2:496
5971 "If B<select>() timed out, then the return value will be zero. The file "
5972 "descriptors set should be all empty (but may not be on some systems)."
5974 "B<select>() がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5975 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5978 #: build/C/man2/select_tut.2:503
5980 "A return value of -1 indicates an error, with I<errno> being set "
5981 "appropriately. In the case of an error, the contents of the returned sets "
5982 "and the I<struct timeout> contents are undefined and should not be used. "
5983 "B<pselect>() however never modifies I<ntimeout>."
5985 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5986 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5987 "なっており、使用すべきではない。 しかし B<pselect>() は決して I<ntimeout> を"
5991 #: build/C/man2/select_tut.2:512
5993 "Generally speaking, all operating systems that support sockets also support "
5994 "B<select>(). B<select>() can be used to solve many problems in a portable "
5995 "and efficient way that naive programmers try to solve in a more complicated "
5996 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5998 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5999 "B<select>() もサポートしている。 B<select>() を使うと、プログラマがスレッ"
6000 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6001 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6004 #: build/C/man2/select_tut.2:521
6006 "The B<poll>(2) system call has the same functionality as B<select>(), and "
6007 "is somewhat more efficient when monitoring sparse file descriptor sets. It "
6008 "is nowadays widely available, but historically was less portable than "
6011 "B<poll>(2) システムコールは B<select>() と同じ機能を持っており、 まばらな"
6012 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6013 "利用可能であるが、以前は B<select>() より移植性の面で劣っていた。"
6016 #: build/C/man2/select_tut.2:529
6018 "The Linux-specific B<epoll>(7) API provides an interface that is more "
6019 "efficient than B<select>(2) and B<poll>(2) when monitoring large numbers "
6020 "of file descriptors."
6022 "Linux 独自の B<epoll>(7) API は、多数のファイルディスクリプタを監視する場合"
6023 "に B<select>(2) や B<poll>(2) よりも効率的なインタフェースを提供している。"
6026 #: build/C/man2/select_tut.2:534
6028 "Here is an example that better demonstrates the true utility of B<select>"
6029 "(). The listing below is a TCP forwarding program that forwards from one "
6030 "TCP port to another."
6032 "B<select>() の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6033 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6036 #: build/C/man2/select_tut.2:547
6039 "#include E<lt>stdlib.hE<gt>\n"
6040 "#include E<lt>stdio.hE<gt>\n"
6041 "#include E<lt>unistd.hE<gt>\n"
6042 "#include E<lt>sys/time.hE<gt>\n"
6043 "#include E<lt>sys/types.hE<gt>\n"
6044 "#include E<lt>string.hE<gt>\n"
6045 "#include E<lt>signal.hE<gt>\n"
6046 "#include E<lt>sys/socket.hE<gt>\n"
6047 "#include E<lt>netinet/in.hE<gt>\n"
6048 "#include E<lt>arpa/inet.hE<gt>\n"
6049 "#include E<lt>errno.hE<gt>\n"
6051 "#include E<lt>stdlib.hE<gt>\n"
6052 "#include E<lt>stdio.hE<gt>\n"
6053 "#include E<lt>unistd.hE<gt>\n"
6054 "#include E<lt>sys/time.hE<gt>\n"
6055 "#include E<lt>sys/types.hE<gt>\n"
6056 "#include E<lt>string.hE<gt>\n"
6057 "#include E<lt>signal.hE<gt>\n"
6058 "#include E<lt>sys/socket.hE<gt>\n"
6059 "#include E<lt>netinet/in.hE<gt>\n"
6060 "#include E<lt>arpa/inet.hE<gt>\n"
6061 "#include E<lt>errno.hE<gt>\n"
6064 #: build/C/man2/select_tut.2:549
6066 msgid "static int forward_port;\n"
6067 msgstr "static int forward_port;\n"
6070 #: build/C/man2/select_tut.2:552
6074 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6077 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6080 #: build/C/man2/select_tut.2:559
6084 "listen_socket(int listen_port)\n"
6086 " struct sockaddr_in a;\n"
6091 "listen_socket(int listen_port)\n"
6093 " struct sockaddr_in a;\n"
6098 #: build/C/man2/select_tut.2:584
6101 #| " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6102 #| " perror(\"socket\");\n"
6106 #| " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6107 #| " &yes, sizeof(yes)) == -1) {\n"
6108 #| " perror(\"setsockopt\");\n"
6112 #| " memset(&a, 0, sizeof(a));\n"
6113 #| " a.sin_port = htons(listen_port);\n"
6114 #| " a.sin_family = AF_INET;\n"
6115 #| " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6116 #| " perror(\"bind\");\n"
6120 #| " printf(\"accepting connections on port %d\\en\", listen_port);\n"
6121 #| " listen(s, 10);\n"
6125 " s = socket(AF_INET, SOCK_STREAM, 0);\n"
6127 " perror(\"socket\");\n"
6131 " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6132 " &yes, sizeof(yes)) == -1) {\n"
6133 " perror(\"setsockopt\");\n"
6137 " memset(&a, 0, sizeof(a));\n"
6138 " a.sin_port = htons(listen_port);\n"
6139 " a.sin_family = AF_INET;\n"
6140 " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6141 " perror(\"bind\");\n"
6145 " printf(\"accepting connections on port %d\\en\", listen_port);\n"
6150 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6151 " perror(\"socket\");\n"
6155 " if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6156 " &yes, sizeof(yes)) == -1) {\n"
6157 " perror(\"setsockopt\");\n"
6161 " memset(&a, 0, sizeof(a));\n"
6162 " a.sin_port = htons(listen_port);\n"
6163 " a.sin_family = AF_INET;\n"
6164 " if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6165 " perror(\"bind\");\n"
6169 " printf(\"accepting connections on port %d\\en\", listen_port);\n"
6175 #: build/C/man2/select_tut.2:590
6179 "connect_socket(int connect_port, char *address)\n"
6181 " struct sockaddr_in a;\n"
6185 "connect_socket(int connect_port, char *address)\n"
6187 " struct sockaddr_in a;\n"
6191 #: build/C/man2/select_tut.2:597
6194 #| " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6195 #| " perror(\"socket\");\n"
6200 " s = socket(AF_INET, SOCK_STREAM, 0);\n"
6202 " perror(\"socket\");\n"
6207 " if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6208 " perror(\"socket\");\n"
6214 #: build/C/man2/select_tut.2:601
6217 " memset(&a, 0, sizeof(a));\n"
6218 " a.sin_port = htons(connect_port);\n"
6219 " a.sin_family = AF_INET;\n"
6221 " memset(&a, 0, sizeof(a));\n"
6222 " a.sin_port = htons(connect_port);\n"
6223 " a.sin_family = AF_INET;\n"
6226 #: build/C/man2/select_tut.2:607
6229 " if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6230 " perror(\"bad IP address format\");\n"
6235 " if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6236 " perror(\"bad IP address format\");\n"
6242 #: build/C/man2/select_tut.2:616
6245 " if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6246 " perror(\"connect()\");\n"
6247 " shutdown(s, SHUT_RDWR);\n"
6254 " if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6255 " perror(\"connect()\");\n"
6256 " shutdown(s, SHUT_RDWR);\n"
6264 #: build/C/man2/select_tut.2:624
6267 "#define SHUT_FD1 do { \\e\n"
6268 " if (fd1 E<gt>= 0) { \\e\n"
6269 " shutdown(fd1, SHUT_RDWR); \\e\n"
6270 " close(fd1); \\e\n"
6275 "#define SHUT_FD1 do { \\e\n"
6276 " if (fd1 E<gt>= 0) { \\e\n"
6277 " shutdown(fd1, SHUT_RDWR); \\e\n"
6278 " close(fd1); \\e\n"
6284 #: build/C/man2/select_tut.2:632
6287 "#define SHUT_FD2 do { \\e\n"
6288 " if (fd2 E<gt>= 0) { \\e\n"
6289 " shutdown(fd2, SHUT_RDWR); \\e\n"
6290 " close(fd2); \\e\n"
6295 "#define SHUT_FD2 do { \\e\n"
6296 " if (fd2 E<gt>= 0) { \\e\n"
6297 " shutdown(fd2, SHUT_RDWR); \\e\n"
6298 " close(fd2); \\e\n"
6304 #: build/C/man2/select_tut.2:634
6306 msgid "#define BUF_SIZE 1024\n"
6307 msgstr "#define BUF_SIZE 1024\n"
6310 #: build/C/man2/select_tut.2:643
6314 "main(int argc, char *argv[])\n"
6317 " int fd1 = -1, fd2 = -1;\n"
6318 " char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6319 " int buf1_avail, buf1_written;\n"
6320 " int buf2_avail, buf2_written;\n"
6323 "main(int argc, char *argv[])\n"
6326 " int fd1 = -1, fd2 = -1;\n"
6327 " char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6328 " int buf1_avail, buf1_written;\n"
6329 " int buf2_avail, buf2_written;\n"
6332 #: build/C/man2/select_tut.2:649
6335 " if (argc != 4) {\n"
6336 " fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6337 " \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6338 " exit(EXIT_FAILURE);\n"
6341 " if (argc != 4) {\n"
6342 " fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6343 " \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6344 " exit(EXIT_FAILURE);\n"
6348 #: build/C/man2/select_tut.2:651
6350 msgid " signal(SIGPIPE, SIG_IGN);\n"
6351 msgstr " signal(SIGPIPE, SIG_IGN);\n"
6354 #: build/C/man2/select_tut.2:653
6356 msgid " forward_port = atoi(argv[2]);\n"
6357 msgstr " forward_port = atoi(argv[2]);\n"
6360 #: build/C/man2/select_tut.2:657
6363 " h = listen_socket(atoi(argv[1]));\n"
6365 " exit(EXIT_FAILURE);\n"
6367 " h = listen_socket(atoi(argv[1]));\n"
6369 " exit(EXIT_FAILURE);\n"
6372 #: build/C/man2/select_tut.2:661
6376 " int r, nfds = 0;\n"
6377 " fd_set rd, wr, er;\n"
6380 " int r, nfds = 0;\n"
6381 " fd_set rd, wr, er;\n"
6384 #: build/C/man2/select_tut.2:691
6390 " FD_SET(h, &rd);\n"
6391 " nfds = max(nfds, h);\n"
6392 " if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6393 " FD_SET(fd1, &rd);\n"
6394 " nfds = max(nfds, fd1);\n"
6396 " if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6397 " FD_SET(fd2, &rd);\n"
6398 " nfds = max(nfds, fd2);\n"
6400 " if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6401 " FD_SET(fd1, &wr);\n"
6402 " nfds = max(nfds, fd1);\n"
6404 " if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6405 " FD_SET(fd2, &wr);\n"
6406 " nfds = max(nfds, fd2);\n"
6408 " if (fd1 E<gt> 0) {\n"
6409 " FD_SET(fd1, &er);\n"
6410 " nfds = max(nfds, fd1);\n"
6412 " if (fd2 E<gt> 0) {\n"
6413 " FD_SET(fd2, &er);\n"
6414 " nfds = max(nfds, fd2);\n"
6420 " FD_SET(h, &rd);\n"
6421 " nfds = max(nfds, h);\n"
6422 " if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6423 " FD_SET(fd1, &rd);\n"
6424 " nfds = max(nfds, fd1);\n"
6426 " if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6427 " FD_SET(fd2, &rd);\n"
6428 " nfds = max(nfds, fd2);\n"
6430 " if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6431 " FD_SET(fd1, &wr);\n"
6432 " nfds = max(nfds, fd1);\n"
6434 " if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6435 " FD_SET(fd2, &wr);\n"
6436 " nfds = max(nfds, fd2);\n"
6438 " if (fd1 E<gt> 0) {\n"
6439 " FD_SET(fd1, &er);\n"
6440 " nfds = max(nfds, fd1);\n"
6442 " if (fd2 E<gt> 0) {\n"
6443 " FD_SET(fd2, &er);\n"
6444 " nfds = max(nfds, fd2);\n"
6448 #: build/C/man2/select_tut.2:693
6450 msgid " r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6451 msgstr " r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6454 #: build/C/man2/select_tut.2:696
6457 " if (r == -1 && errno == EINTR)\n"
6460 " if (r == -1 && errno == EINTR)\n"
6464 #: build/C/man2/select_tut.2:701
6468 " perror(\"select()\");\n"
6469 " exit(EXIT_FAILURE);\n"
6473 " perror(\"select()\");\n"
6474 " exit(EXIT_FAILURE);\n"
6478 #: build/C/man2/select_tut.2:705
6481 " if (FD_ISSET(h, &rd)) {\n"
6482 " unsigned int l;\n"
6483 " struct sockaddr_in client_address;\n"
6485 " if (FD_ISSET(h, &rd)) {\n"
6486 " unsigned int l;\n"
6487 " struct sockaddr_in client_address;\n"
6490 #: build/C/man2/select_tut.2:724
6493 " memset(&client_address, 0, l = sizeof(client_address));\n"
6494 " r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6496 " perror(\"accept()\");\n"
6500 " buf1_avail = buf1_written = 0;\n"
6501 " buf2_avail = buf2_written = 0;\n"
6503 " fd2 = connect_socket(forward_port, argv[3]);\n"
6507 " printf(\"connect from %s\\en\",\n"
6508 " inet_ntoa(client_address.sin_addr));\n"
6512 " memset(&client_address, 0, l = sizeof(client_address));\n"
6513 " r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6515 " perror(\"accept()\");\n"
6519 " buf1_avail = buf1_written = 0;\n"
6520 " buf2_avail = buf2_written = 0;\n"
6522 " fd2 = connect_socket(forward_port, argv[3]);\n"
6526 " printf(\"connect from %s\\en\",\n"
6527 " inet_ntoa(client_address.sin_addr));\n"
6532 #: build/C/man2/select_tut.2:726
6534 msgid " /* NB: read oob data before normal reads */\n"
6535 msgstr " /* NB: read oob data before normal reads */\n"
6538 #: build/C/man2/select_tut.2:730
6541 " if (fd1 E<gt> 0)\n"
6542 " if (FD_ISSET(fd1, &er)) {\n"
6545 " if (fd1 E<gt> 0)\n"
6546 " if (FD_ISSET(fd1, &er)) {\n"
6550 #: build/C/man2/select_tut.2:740
6553 " r = recv(fd1, &c, 1, MSG_OOB);\n"
6557 " send(fd2, &c, 1, MSG_OOB);\n"
6559 " if (fd2 E<gt> 0)\n"
6560 " if (FD_ISSET(fd2, &er)) {\n"
6563 " r = recv(fd1, &c, 1, MSG_OOB);\n"
6567 " send(fd2, &c, 1, MSG_OOB);\n"
6569 " if (fd2 E<gt> 0)\n"
6570 " if (FD_ISSET(fd2, &er)) {\n"
6574 #: build/C/man2/select_tut.2:783
6577 " r = recv(fd2, &c, 1, MSG_OOB);\n"
6581 " send(fd1, &c, 1, MSG_OOB);\n"
6583 " if (fd1 E<gt> 0)\n"
6584 " if (FD_ISSET(fd1, &rd)) {\n"
6585 " r = read(fd1, buf1 + buf1_avail,\n"
6586 " BUF_SIZE - buf1_avail);\n"
6590 " buf1_avail += r;\n"
6592 " if (fd2 E<gt> 0)\n"
6593 " if (FD_ISSET(fd2, &rd)) {\n"
6594 " r = read(fd2, buf2 + buf2_avail,\n"
6595 " BUF_SIZE - buf2_avail);\n"
6599 " buf2_avail += r;\n"
6601 " if (fd1 E<gt> 0)\n"
6602 " if (FD_ISSET(fd1, &wr)) {\n"
6603 " r = write(fd1, buf2 + buf2_written,\n"
6604 " buf2_avail - buf2_written);\n"
6608 " buf2_written += r;\n"
6610 " if (fd2 E<gt> 0)\n"
6611 " if (FD_ISSET(fd2, &wr)) {\n"
6612 " r = write(fd2, buf1 + buf1_written,\n"
6613 " buf1_avail - buf1_written);\n"
6617 " buf1_written += r;\n"
6620 " r = recv(fd2, &c, 1, MSG_OOB);\n"
6624 " send(fd1, &c, 1, MSG_OOB);\n"
6626 " if (fd1 E<gt> 0)\n"
6627 " if (FD_ISSET(fd1, &rd)) {\n"
6628 " r = read(fd1, buf1 + buf1_avail,\n"
6629 " BUF_SIZE - buf1_avail);\n"
6633 " buf1_avail += r;\n"
6635 " if (fd2 E<gt> 0)\n"
6636 " if (FD_ISSET(fd2, &rd)) {\n"
6637 " r = read(fd2, buf2 + buf2_avail,\n"
6638 " BUF_SIZE - buf2_avail);\n"
6642 " buf2_avail += r;\n"
6644 " if (fd1 E<gt> 0)\n"
6645 " if (FD_ISSET(fd1, &wr)) {\n"
6646 " r = write(fd1, buf2 + buf2_written,\n"
6647 " buf2_avail - buf2_written);\n"
6651 " buf2_written += r;\n"
6653 " if (fd2 E<gt> 0)\n"
6654 " if (FD_ISSET(fd2, &wr)) {\n"
6655 " r = write(fd2, buf1 + buf1_written,\n"
6656 " buf1_avail - buf1_written);\n"
6660 " buf1_written += r;\n"
6664 #: build/C/man2/select_tut.2:785
6666 msgid " /* check if write data has caught read data */\n"
6667 msgstr " /* check if write data has caught read data */\n"
6670 #: build/C/man2/select_tut.2:790
6673 " if (buf1_written == buf1_avail)\n"
6674 " buf1_written = buf1_avail = 0;\n"
6675 " if (buf2_written == buf2_avail)\n"
6676 " buf2_written = buf2_avail = 0;\n"
6678 " if (buf1_written == buf1_avail)\n"
6679 " buf1_written = buf1_avail = 0;\n"
6680 " if (buf2_written == buf2_avail)\n"
6681 " buf2_written = buf2_avail = 0;\n"
6684 #: build/C/man2/select_tut.2:793
6687 " /* one side has closed the connection, keep\n"
6688 " writing to the other side until empty */\n"
6690 " /* one side has closed the connection, keep\n"
6691 " writing to the other side until empty */\n"
6694 #: build/C/man2/select_tut.2:801
6697 " if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6699 " if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6702 " exit(EXIT_SUCCESS);\n"
6705 " if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6707 " if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6710 " exit(EXIT_SUCCESS);\n"
6714 #: build/C/man2/select_tut.2:815
6716 "The above program properly forwards most kinds of TCP connections including "
6717 "OOB signal data transmitted by B<telnet> servers. It handles the tricky "
6718 "problem of having data flow in both directions simultaneously. You might "
6719 "think it more efficient to use a B<fork>(2) call and devote a thread to "
6720 "each stream. This becomes more tricky than you might suspect. Another idea "
6721 "is to set nonblocking I/O using B<fcntl>(2). This also has its problems "
6722 "because you end up using inefficient timeouts."
6724 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6725 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6726 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6727 "(2) コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6728 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6729 "い。 あるいは、 B<fcntl>(2) を使って非ブロック I/O をセットすれば良い、とい"
6730 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6734 #: build/C/man2/select_tut.2:821
6736 "The program does not handle more than one simultaneous connection at a time, "
6737 "although it could easily be extended to do this with a linked list of buffers"
6738 "\\(emone for each connection. At the moment, new connections cause the "
6739 "current connection to be dropped."
6741 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6742 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6743 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6746 #. This man page was written by Paul Sheer.
6748 #: build/C/man2/select_tut.2:840
6750 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6751 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6752 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6755 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6756 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6757 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6761 #: build/C/man2/send.2:40
6767 #: build/C/man2/send.2:40
6769 #| msgid "2012-12-14"
6774 #: build/C/man2/send.2:43
6775 msgid "send, sendto, sendmsg - send a message on a socket"
6776 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6779 #: build/C/man2/send.2:47
6782 "B<#include E<lt>sys/types.hE<gt>>\n"
6783 "B<#include E<lt>sys/socket.hE<gt>>\n"
6785 "B<#include E<lt>sys/types.hE<gt>>\n"
6786 "B<#include E<lt>sys/socket.hE<gt>>\n"
6789 #: build/C/man2/send.2:50
6791 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6792 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6795 #: build/C/man2/send.2:54
6798 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6799 "B< const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6801 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6802 "B< const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6805 #: build/C/man2/send.2:57
6807 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6808 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6811 #: build/C/man2/send.2:65
6813 "The system calls B<send>(), B<sendto>(), and B<sendmsg>() are used to "
6814 "transmit a message to another socket."
6816 "システムコール B<send>(), B<sendto>(), B<sendmsg>() は、もう一方のソケットへ"
6817 "メッセージを転送するのに使用される。"
6820 #: build/C/man2/send.2:84
6822 "The B<send>() call may be used only when the socket is in a I<connected> "
6823 "state (so that the intended recipient is known). The only difference "
6824 "between B<send>() and B<write>(2) is the presence of I<flags>. With a "
6825 "zero I<flags> argument, B<send>() is equivalent to B<write>(2). Also, the "
6828 "B<send>() は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6829 "できる (つまり、どの相手に送信するかは既知である)。 B<send>() と B<write>"
6830 "(2) の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6831 "にフラグが指定されない場合、 B<send>() は B<write>(2) と等価である。 また、"
6834 #: build/C/man2/send.2:86
6836 msgid " send(sockfd, buf, len, flags);\n"
6837 msgstr " send(sockfd, buf, len, flags);\n"
6840 #: build/C/man2/send.2:88
6841 msgid "is equivalent to"
6845 #: build/C/man2/send.2:90
6847 msgid " sendto(sockfd, buf, len, flags, NULL, 0);\n"
6848 msgstr " sendto(sockfd, buf, len, flags, NULL, 0);\n"
6851 #: build/C/man2/send.2:94
6852 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6854 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6858 #: build/C/man2/send.2:122
6860 "If B<sendto>() is used on a connection-mode (B<SOCK_STREAM>, "
6861 "B<SOCK_SEQPACKET>) socket, the arguments I<dest_addr> and I<addrlen> are "
6862 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6863 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6864 "connected. Otherwise, the address of the target is given by I<dest_addr> "
6865 "with I<addrlen> specifying its size. For B<sendmsg>(), the address of the "
6866 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6869 "B<sendto>() は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6870 "B<SOCK_SEQPACKET>) で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6871 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6872 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6873 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6874 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6875 "() では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6876 "msg_namelen> で指定される。"
6879 #: build/C/man2/send.2:138
6881 "For B<send>() and B<sendto>(), the message is found in I<buf> and has "
6882 "length I<len>. For B<sendmsg>(), the message is pointed to by the elements "
6883 "of the array I<msg.msg_iov>. The B<sendmsg>() call also allows sending "
6884 "ancillary data (also known as control information)."
6886 "B<send>() と B<sendto>() では、メッセージは I<buf> に格納されており、その長"
6887 "さは I<len> であると解釈される。 B<sendmsg>() では、メッセージは 配列 I<msg."
6888 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>() では、補助データ "
6889 "(制御情報とも呼ばれる) を送信することもできる。"
6892 #: build/C/man2/send.2:143
6894 "If the message is too long to pass atomically through the underlying "
6895 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6898 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6899 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6900 "ラーが返され、そのメッセージは転送されない。"
6903 #: build/C/man2/send.2:147
6905 "No indication of failure to deliver is implicit in a B<send>(). Locally "
6906 "detected errors are indicated by a return value of -1."
6908 "B<send>() では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6909 "出された場合は、返り値 -1 として通知される。"
6912 #: build/C/man2/send.2:160
6914 "When the message does not fit into the send buffer of the socket, B<send>() "
6915 "normally blocks, unless the socket has been placed in nonblocking I/O mode. "
6916 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6917 "in this case. The B<select>(2) call may be used to determine when it is "
6918 "possible to send more data."
6920 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>() は"
6921 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6922 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6923 "つデータをさらに送信できるようになるかを知るために、 B<select>(2) コールを使"
6926 #. FIXME ? document MSG_PROXY (which went away in 2.3.15)
6928 #: build/C/man2/send.2:166
6930 "The I<flags> argument is the bitwise OR of zero or more of the following "
6933 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6937 #: build/C/man2/send.2:166
6939 #| msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6940 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
6941 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6944 #: build/C/man2/send.2:180
6946 "Tell the link layer that forward progress happened: you got a successful "
6947 "reply from the other side. If the link layer doesn't get this it will "
6948 "regularly reprobe the neighbor (e.g., via a unicast ARP). Only valid on "
6949 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
6950 "IPv4 and IPv6. See B<arp>(7) for details."
6952 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6953 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6954 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6955 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6956 "されている。 詳しくは B<arp>(7) 参照のこと。"
6959 #: build/C/man2/send.2:180
6961 msgid "B<MSG_DONTROUTE>"
6962 msgstr "B<MSG_DONTROUTE>"
6965 #: build/C/man2/send.2:188
6967 "Don't use a gateway to send out the packet, send to hosts only on directly "
6968 "connected networks. This is usually used only by diagnostic or routing "
6969 "programs. This is defined only for protocol families that route; packet "
6972 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6973 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6974 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6975 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6978 #: build/C/man2/send.2:199
6980 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6981 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6982 "flag with the B<F_SETFL> B<fcntl>(2))."
6984 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6985 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2) の B<F_SETFL> で "
6986 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6989 #: build/C/man2/send.2:199
6991 msgid "B<MSG_EOR> (since Linux 2.2)"
6992 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6995 #: build/C/man2/send.2:203
6997 "Terminates a record (when this notion is supported, as for sockets of type "
6998 "B<SOCK_SEQPACKET>)."
7000 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7004 #: build/C/man2/send.2:203
7006 #| msgid "B<MSG_MORE> (Since Linux 2.4.4)"
7007 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7008 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7011 #: build/C/man2/send.2:212
7013 "The caller has more data to send. This flag is used with TCP sockets to "
7014 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7015 "with the difference that this flag can be set on a per-call basis."
7017 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7018 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
7019 "(7) を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
7023 #: build/C/man2/send.2:221
7025 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7026 "the kernel to package all of the data sent in calls with this flag set into "
7027 "a single datagram which is transmitted only when a call is performed that "
7028 "does not specify this flag. (See also the B<UDP_CORK> socket option "
7029 "described in B<udp>(7).)"
7031 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7032 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7033 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7034 "のシステムコールが実行された際に初めて送信される (B<udp>(7) に記載されている"
7035 "ソケットオプション B<UDP_CORK> も参照)。"
7038 #: build/C/man2/send.2:221
7040 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7041 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7044 #: build/C/man2/send.2:230
7046 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7047 "the other end breaks the connection. The B<EPIPE> error is still returned."
7049 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7050 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7053 #: build/C/man2/send.2:239
7055 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7056 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7059 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7060 "B<SOCK_STREAM>) で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7064 #: build/C/man2/send.2:246
7066 "The definition of the I<msghdr> structure follows. See B<recv>(2) and "
7067 "below for an exact description of its fields."
7069 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
7070 "B<recv>(2) と以下の説明を参照すること。"
7072 #. Still to be documented:
7073 #. Send file descriptors and user credentials using the
7074 #. msg_control* fields.
7075 #. The flags returned in msg_flags.
7077 #: build/C/man2/send.2:275
7079 "You may send control information using the I<msg_control> and "
7080 "I<msg_controllen> members. The maximum control buffer length the kernel can "
7081 "process is limited per socket by the value in I</proc/sys/net/core/"
7082 "optmem_max>; see B<socket>(7)."
7084 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
7085 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7086 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7) を参照。"
7089 #: build/C/man2/send.2:280
7092 #| "On success, these calls return the number of characters sent. On error, "
7093 #| "-1 is returned, and I<errno> is set appropriately."
7095 "On success, these calls return the number of bytes sent. On error, -1 is "
7096 "returned, and I<errno> is set appropriately."
7098 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7099 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7102 #: build/C/man2/send.2:285
7104 "These are some standard errors generated by the socket layer. Additional "
7105 "errors may be generated and returned from the underlying protocol modules; "
7106 "see their respective manual pages."
7108 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7109 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7113 #: build/C/man2/send.2:293
7115 "(For UNIX domain sockets, which are identified by pathname) Write "
7116 "permission is denied on the destination socket file, or search permission is "
7117 "denied for one of the directories the path prefix. (See B<path_resolution>"
7120 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7122 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7123 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7124 "(B<path_resolution>(7) も参照のこと)"
7127 #: build/C/man2/send.2:296
7129 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7130 "as though it was a unicast address."
7132 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7133 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7135 #. Actually EAGAIN on Linux
7137 #: build/C/man2/send.2:304
7139 "The socket is marked nonblocking and the requested operation would block. "
7140 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7141 "require these constants to have the same value, so a portable application "
7142 "should check for both possibilities."
7144 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7145 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7146 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7150 #: build/C/man2/send.2:307
7151 msgid "An invalid descriptor was specified."
7152 msgstr "無効なディスクリプターが指定された。"
7155 #: build/C/man2/send.2:307
7157 msgid "B<ECONNRESET>"
7158 msgstr "B<ECONNRESET>"
7161 #: build/C/man2/send.2:310
7162 msgid "Connection reset by peer."
7163 msgstr "接続が接続相手によりリセットされた。"
7166 #: build/C/man2/send.2:310
7168 msgid "B<EDESTADDRREQ>"
7169 msgstr "B<EDESTADDRREQ>"
7172 #: build/C/man2/send.2:313
7173 msgid "The socket is not connection-mode, and no peer address is set."
7175 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7179 #: build/C/man2/send.2:316
7180 msgid "An invalid user space address was specified for an argument."
7181 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7184 #: build/C/man2/send.2:320
7185 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7186 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7) 参照。"
7189 #: build/C/man2/send.2:329
7191 "The connection-mode socket was connected already but a recipient was "
7192 "specified. (Now either this error is returned, or the recipient "
7193 "specification is ignored.)"
7195 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7196 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7200 #: build/C/man2/send.2:329
7203 msgstr "B<EMSGSIZE>"
7205 #. (e.g., SOCK_DGRAM )
7207 #: build/C/man2/send.2:335
7209 "The socket type requires that message be sent atomically, and the size of "
7210 "the message to be sent made this impossible."
7212 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7213 "るが、 メッセージが大き過ぎるため送信することができない。"
7216 #: build/C/man2/send.2:343
7218 "The output queue for a network interface was full. This generally indicates "
7219 "that the interface has stopped sending, but may be caused by transient "
7220 "congestion. (Normally, this does not occur in Linux. Packets are just "
7221 "silently dropped when a device queue overflows.)"
7223 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7224 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7225 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7226 "フローした場合にはパケットは黙って捨てられる)"
7229 #: build/C/man2/send.2:346
7230 msgid "No memory available."
7234 #: build/C/man2/send.2:349
7235 msgid "The socket is not connected, and no target has been given."
7236 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7239 #: build/C/man2/send.2:359
7240 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7242 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7246 #: build/C/man2/send.2:359
7252 #: build/C/man2/send.2:368
7254 "The local end has been shut down on a connection oriented socket. In this "
7255 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7258 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7259 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7262 #: build/C/man2/send.2:371
7263 msgid "4.4BSD, SVr4, POSIX.1-2001. These function calls appeared in 4.2BSD."
7265 "4.4BSD, SVr4, POSIX.1-2001. (これらの関数コールは 4.2BSD で最初に登場した)。"
7268 #: build/C/man2/send.2:382
7270 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags. "
7271 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>. The B<MSG_CONFIRM> "
7272 "flag is a Linux extension."
7274 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7275 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7276 "ラグは Linux での拡張である。"
7279 #: build/C/man2/send.2:395
7281 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7282 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7283 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7284 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7285 "and libc5. See also B<accept>(2)."
7287 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7288 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7289 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7290 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7291 "libc5 では I<int> である。 B<accept>(2) も参照すること。"
7294 #: build/C/man2/send.2:414
7296 "See B<sendmmsg>(2) for information about a Linux-specific system call that "
7297 "can be used to transmit multiple datagrams in a single call."
7299 "B<sendmmsg>(2) には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7301 "Linux 固有の システムコールに関する情報が書かれている。"
7304 #: build/C/man2/send.2:419
7305 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7306 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7309 #: build/C/man2/send.2:424
7310 msgid "An example of the use of B<sendto>() is shown in B<getaddrinfo>(3)."
7311 msgstr "B<sendto>() の利用例が B<getaddrinfo>(3) に記載されている。"
7314 #: build/C/man2/send.2:439
7316 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7317 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7318 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7320 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7321 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7322 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7325 #: build/C/man2/sendmmsg.2:28
7331 #: build/C/man2/sendmmsg.2:28
7337 #: build/C/man2/sendmmsg.2:31
7338 msgid "sendmmsg - send multiple messages on a socket"
7339 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7342 #: build/C/man2/sendmmsg.2:39
7345 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7346 "B< unsigned int >I<flags>B<);>\n"
7348 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7349 "B< unsigned int >I<flags>B<);>\n"
7351 #. See commit 228e548e602061b08ee8e8966f567c12aa079682
7353 #: build/C/man2/sendmmsg.2:49
7355 "The B<sendmmsg>() system call is an extension of B<sendmsg>(2) that allows "
7356 "the caller to transmit multiple messages on a socket using a single system "
7357 "call. (This has performance benefits for some applications.)"
7359 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7360 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7361 "ンによっては性能上のメリットがある)。"
7364 #: build/C/man2/sendmmsg.2:54
7366 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7367 "to be transmitted."
7369 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7372 #: build/C/man2/sendmmsg.2:75
7375 "struct mmsghdr {\n"
7376 " struct msghdr msg_hdr; /* Message header */\n"
7377 " unsigned int msg_len; /* Number of bytes transmitted */\n"
7380 "struct mmsghdr {\n"
7381 " struct msghdr msg_hdr; /* メッセージヘッダ */\n"
7382 " unsigned int msg_len; /* 送信されたバイト数 */\n"
7386 #: build/C/man2/sendmmsg.2:91
7388 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7389 "(2). The I<msg_len> field is used to return the number of bytes sent from "
7390 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7391 "B<sendmsg>(2) call)."
7393 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7394 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7395 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7399 #: build/C/man2/sendmmsg.2:97
7401 "The I<flags> argument contains flags ORed together. The flags are the same "
7402 "as for B<sendmsg>(2)."
7404 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7405 "B<sendmsg>(2) と同じである。"
7408 #: build/C/man2/sendmmsg.2:107
7410 "A blocking B<sendmmsg>() call blocks until I<vlen> messages have been "
7411 "sent. A nonblocking call sends as many messages as possible (up to the "
7412 "limit specified by I<vlen>) and returns immediately."
7414 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7415 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7416 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7419 #: build/C/man2/sendmmsg.2:119
7421 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7422 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7423 "corresponding I<msg_hdr>. The return value of the call indicates the number "
7424 "of elements of I<msgvec> that have been updated."
7426 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7427 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7428 "しの返り値は、更新された I<msgvec> の要素数である。"
7431 #: build/C/man2/sendmmsg.2:129
7433 "On success, B<sendmmsg>() returns the number of messages sent from "
7434 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7435 "B<sendmmsg>() call to send the remaining messages."
7437 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7438 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7439 "て残りのメッセージを送信することができる。"
7442 #: build/C/man2/sendmmsg.2:133
7443 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7444 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7447 #. commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7448 #. ... only return an error if no datagrams could be sent.
7449 #. If less than the requested number of messages were sent, the application
7450 #. must retry starting at the first failed one and if the problem is
7451 #. persistent the error will be returned.
7452 #. This matches the behaviour of other syscalls like read/write - it
7453 #. is not an error if less than the requested number of elements are sent.
7455 #: build/C/man2/sendmmsg.2:145
7457 "Errors are as for B<sendmsg>(2). An error is returned only if no datagrams "
7460 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7464 #: build/C/man2/sendmmsg.2:150
7466 "The B<sendmmsg>() system call was added in Linux 3.0. Support in glibc was "
7467 "added in version 2.14."
7469 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7470 "バージョン 2.14 で追加された。"
7473 #: build/C/man2/sendmmsg.2:153
7474 msgid "B<sendmmsg>() is Linux-specific."
7475 msgstr "B<sendmmsg>() は Linux 固有である。"
7479 #. commit 98382f419f32d2c12d021943b87dea555677144b
7480 #. net: Cap number of elements for sendmmsg
7481 #. To limit the amount of time we can spend in sendmmsg, cap the
7482 #. number of elements to UIO_MAXIOV (currently 1024).
7483 #. For error handling an application using sendmmsg needs to retry at
7484 #. the first unsent message, so capping is simpler and requires less
7485 #. application logic than returning EINVAL.
7487 #: build/C/man2/sendmmsg.2:168
7488 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7489 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7492 #: build/C/man2/sendmmsg.2:177
7494 "The example below uses B<sendmmsg>() to send I<onetwo> and I<three> in two "
7495 "distinct UDP datagrams using one system call. The contents of the first "
7496 "datagram originates from a pair of buffers."
7498 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7499 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7500 "の内容は、二つのバッファから取得される。"
7503 #: build/C/man2/sendmmsg.2:186
7506 "#define _GNU_SOURCE\n"
7507 "#include E<lt>netinet/ip.hE<gt>\n"
7508 "#include E<lt>stdio.hE<gt>\n"
7509 "#include E<lt>stdlib.hE<gt>\n"
7510 "#include E<lt>string.hE<gt>\n"
7511 "#include E<lt>sys/types.hE<gt>\n"
7512 "#include E<lt>sys/socket.hE<gt>\n"
7514 "#define _GNU_SOURCE\n"
7515 "#include E<lt>netinet/ip.hE<gt>\n"
7516 "#include E<lt>stdio.hE<gt>\n"
7517 "#include E<lt>stdlib.hE<gt>\n"
7518 "#include E<lt>string.hE<gt>\n"
7519 "#include E<lt>sys/types.hE<gt>\n"
7520 "#include E<lt>sys/socket.hE<gt>\n"
7523 #: build/C/man2/sendmmsg.2:195
7530 " struct sockaddr_in sa;\n"
7531 " struct mmsghdr msg[2];\n"
7532 " struct iovec msg1[2], msg2;\n"
7539 " struct sockaddr_in sa;\n"
7540 " struct mmsghdr msg[2];\n"
7541 " struct iovec msg1[2], msg2;\n"
7545 #: build/C/man2/sendmmsg.2:209
7548 " sa.sin_family = AF_INET;\n"
7549 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7550 " sa.sin_port = htons(1234);\n"
7551 " if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7552 " perror(\"connect()\");\n"
7553 " exit(EXIT_FAILURE);\n"
7556 " sa.sin_family = AF_INET;\n"
7557 " sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7558 " sa.sin_port = htons(1234);\n"
7559 " if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7560 " perror(\"connect()\");\n"
7561 " exit(EXIT_FAILURE);\n"
7565 #: build/C/man2/sendmmsg.2:215
7568 " memset(msg1, 0, sizeof(msg1));\n"
7569 " msg1[0].iov_base = \"one\";\n"
7570 " msg1[0].iov_len = 3;\n"
7571 " msg1[1].iov_base = \"two\";\n"
7572 " msg1[1].iov_len = 3;\n"
7574 " memset(msg1, 0, sizeof(msg1));\n"
7575 " msg1[0].iov_base = \"one\";\n"
7576 " msg1[0].iov_len = 3;\n"
7577 " msg1[1].iov_base = \"two\";\n"
7578 " msg1[1].iov_len = 3;\n"
7581 #: build/C/man2/sendmmsg.2:219
7584 " memset(&msg2, 0, sizeof(msg2));\n"
7585 " msg2.iov_base = \"three\";\n"
7586 " msg2.iov_len = 5;\n"
7588 " memset(&msg2, 0, sizeof(msg2));\n"
7589 " msg2.iov_base = \"three\";\n"
7590 " msg2.iov_len = 5;\n"
7593 #: build/C/man2/sendmmsg.2:223
7596 " memset(msg, 0, sizeof(msg));\n"
7597 " msg[0].msg_hdr.msg_iov = msg1;\n"
7598 " msg[0].msg_hdr.msg_iovlen = 2;\n"
7600 " memset(msg, 0, sizeof(msg));\n"
7601 " msg[0].msg_hdr.msg_iov = msg1;\n"
7602 " msg[0].msg_hdr.msg_iovlen = 2;\n"
7605 #: build/C/man2/sendmmsg.2:226
7608 " msg[1].msg_hdr.msg_iov = &msg2;\n"
7609 " msg[1].msg_hdr.msg_iovlen = 1;\n"
7611 " msg[1].msg_hdr.msg_iov = &msg2;\n"
7612 " msg[1].msg_hdr.msg_iovlen = 1;\n"
7615 #: build/C/man2/sendmmsg.2:232
7618 " retval = sendmmsg(sockfd, msg, 2, 0);\n"
7619 " if (retval == -1)\n"
7620 " perror(\"sendmmsg()\");\n"
7622 " printf(\"%d messages sent\\en\", retval);\n"
7624 " retval = sendmmsg(sockfd, msg, 2, 0);\n"
7625 " if (retval == -1)\n"
7626 " perror(\"sendmmsg()\");\n"
7628 " printf(\"%d messages sent\\en\", retval);\n"
7631 #: build/C/man2/sendmmsg.2:235
7641 #: build/C/man2/sendmmsg.2:241
7642 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7643 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7646 #: build/C/man3/sockatmark.3:25
7652 #: build/C/man3/sockatmark.3:25
7654 #| msgid "2007-12-28"
7659 #: build/C/man3/sockatmark.3:28
7660 msgid "sockatmark - determine whether socket is at out-of-band mark"
7662 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7666 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7667 #: build/C/man7/socket.7:61 build/C/man2/socketpair.2:49
7668 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7669 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7672 #: build/C/man3/sockatmark.3:32
7673 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7674 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7677 #: build/C/man3/sockatmark.3:41
7679 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7682 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7686 #: build/C/man3/sockatmark.3:51
7688 "B<sockatmark>() returns a value indicating whether or not the socket "
7689 "referred to by the file descriptor I<sockfd> is at the out-of-band mark. If "
7690 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7691 "mark, 0 is returned. This function does not remove the out-of-band mark."
7693 "B<sockatmark>() はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7694 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7695 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7696 "この関数は帯域外マークを削除しない。"
7699 #: build/C/man3/sockatmark.3:58
7701 "A successful call to B<sockatmark>() returns 1 if the socket is at the out-"
7702 "of-band mark, or 0 if it is not. On error, -1 is returned and I<errno> is "
7703 "set to indicate the error."
7705 "B<sockatmark>() の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7706 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7707 "れ、エラーを表す I<errno> が設定される。"
7710 #: build/C/man3/sockatmark.3:63
7711 msgid "I<sockfd> is not a valid file descriptor."
7712 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7714 #. POSIX.1 says ENOTTY for this case
7716 #: build/C/man3/sockatmark.3:70
7718 "I<sockfd> is not a file descriptor to which B<sockatmark>() can be applied."
7720 "I<sockfd> は B<sockatmark>() が適用できないファイルディスクリプタである。"
7723 #: build/C/man3/sockatmark.3:73
7724 msgid "B<sockatmark>() was added to glibc in version 2.2.4."
7725 msgstr "B<sockatmark>() は glibc バージョン 2.2.4 で追加された。"
7728 #: build/C/man3/sockatmark.3:78
7729 msgid "The B<sockatmark>() function is thread-safe."
7730 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7733 #: build/C/man3/sockatmark.3:80
7734 msgid "POSIX.1-2001."
7735 msgstr "POSIX.1-2001."
7738 #: build/C/man3/sockatmark.3:87
7740 "If B<sockatmark>() returns 1, then the out-of-band data can be read using "
7741 "the B<MSG_OOB> flag of B<recv>(2)."
7743 "B<sockatmark>() が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7744 "B<recv>(2) で読み込むことができる。"
7747 #: build/C/man3/sockatmark.3:89
7748 msgid "Out-of-band data is supported only on some stream socket protocols."
7750 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7754 #: build/C/man3/sockatmark.3:94
7756 "B<sockatmark>() can safely be called from a handler for the B<SIGURG> "
7759 "B<sockatmark>() は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7763 #: build/C/man3/sockatmark.3:100
7765 "B<sockatmark>() is implemented using the B<SIOCATMARK> B<ioctl>(2) "
7768 "B<sockatmark>() は B<SIOCATMARK> B<ioctl>(2) 操作を使って実装されている。"
7771 #: build/C/man3/sockatmark.3:104
7772 msgid "Prior to glibc 2.4, B<sockatmark>() did not work."
7773 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>() は動作しない。"
7776 #: build/C/man3/sockatmark.3:109
7778 "The following code can be used after receipt of a B<SIGURG> signal to read "
7779 "(and discard) all data up to the mark, and then read the byte of data at the "
7782 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7783 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7786 #: build/C/man3/sockatmark.3:114
7789 " char buf[BUF_LEN];\n"
7793 " char buf[BUF_LEN];\n"
7798 #: build/C/man3/sockatmark.3:121
7802 " atmark = sockatmark(sockfd);\n"
7803 " if (atmark == -1) {\n"
7804 " perror(\"sockatmark\");\n"
7809 " atmark = sockatmark(sockfd);\n"
7810 " if (atmark == -1) {\n"
7811 " perror(\"sockatmark\");\n"
7816 #: build/C/man3/sockatmark.3:124
7826 #: build/C/man3/sockatmark.3:131
7829 " s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7831 " perror(\"read\");\n"
7832 " if (s E<lt>= 0)\n"
7836 " s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7838 " perror(\"read\");\n"
7839 " if (s E<lt>= 0)\n"
7844 #: build/C/man3/sockatmark.3:138
7847 " if (atmark == 1) {\n"
7848 " if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7849 " perror(\"recv\");\n"
7854 " if (atmark == 1) {\n"
7855 " if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7856 " perror(\"recv\");\n"
7862 #: build/C/man3/sockatmark.3:144
7863 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7864 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7867 #: build/C/man2/socket.2:43 build/C/man7/socket.7:56
7873 #: build/C/man2/socket.2:43
7879 #: build/C/man2/socket.2:46
7880 msgid "socket - create an endpoint for communication"
7881 msgstr "socket - 通信のための端点(endpoint)を作成する"
7884 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7885 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7886 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7889 #: build/C/man2/socket.2:52
7890 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7891 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7894 #: build/C/man2/socket.2:55
7896 "B<socket>() creates an endpoint for communication and returns a descriptor."
7898 "B<socket>() は通信のための端点(endpoint)を作成し、ディスクリプター"
7902 #: build/C/man2/socket.2:63
7904 "The I<domain> argument specifies a communication domain; this selects the "
7905 "protocol family which will be used for communication. These families are "
7906 "defined in I<E<lt>sys/socket.hE<gt>>. The currently understood formats "
7909 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7910 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7911 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7915 #: build/C/man2/socket.2:66
7917 msgid "Name:Purpose:Man page\n"
7918 msgstr "名前:目的:マニュアル\n"
7921 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7922 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7923 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7924 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7930 #: build/C/man2/socket.2:68
7932 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7933 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7936 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7937 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7938 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7939 #: build/C/man7/socket.7:192
7945 #: build/C/man2/socket.2:70
7947 msgid "Local communication\n"
7951 #: build/C/man2/socket.2:72
7953 msgid "B<unix>(7)\n"
7954 msgstr "B<unix>(7)\n"
7957 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7958 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7959 #: build/C/man2/socket.2:118 build/C/man7/socket.7:171
7960 #: build/C/man7/socket.7:175 build/C/man7/socket.7:178
7961 #: build/C/man7/socket.7:184 build/C/man7/socket.7:187
7962 #: build/C/man7/socket.7:196 build/C/man7/socket.7:203
7968 #: build/C/man2/socket.2:75
7970 msgid "B<AF_INET>\n"
7971 msgstr "B<AF_INET>\n"
7974 #: build/C/man2/socket.2:76
7976 msgid "T}:IPv4 Internet protocols:T{\n"
7977 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7980 #: build/C/man2/socket.2:77
7986 #: build/C/man2/socket.2:80
7988 msgid "B<AF_INET6>\n"
7989 msgstr "B<AF_INET6>\n"
7992 #: build/C/man2/socket.2:81
7994 msgid "T}:IPv6 Internet protocols:T{\n"
7995 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7998 #: build/C/man2/socket.2:82
8000 msgid "B<ipv6>(7)\n"
8001 msgstr "B<ipv6>(7)\n"
8004 #: build/C/man2/socket.2:85
8007 msgstr "B<AF_IPX>\n"
8010 #: build/C/man2/socket.2:86
8012 msgid "T}:IPX - Novell protocols:\n"
8013 msgstr "T}:IPX - Novell プロトコル:\n"
8016 #: build/C/man2/socket.2:88
8018 msgid "B<AF_NETLINK>\n"
8019 msgstr "B<AF_NETLINK>\n"
8022 #: build/C/man2/socket.2:90
8024 msgid "Kernel user interface device\n"
8025 msgstr "カーネル・ユーザ・デバイス\n"
8028 #: build/C/man2/socket.2:92
8030 msgid "B<netlink>(7)\n"
8031 msgstr "B<netlink>(7)\n"
8034 #: build/C/man2/socket.2:95
8037 msgstr "B<AF_X25>\n"
8040 #: build/C/man2/socket.2:96
8042 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8043 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8046 #: build/C/man2/socket.2:97
8049 msgstr "B<x25>(7)\n"
8052 #: build/C/man2/socket.2:100
8054 msgid "B<AF_AX25>\n"
8055 msgstr "B<AF_AX25>\n"
8058 #: build/C/man2/socket.2:102
8060 msgid "Amateur radio AX.25 protocol\n"
8061 msgstr "アマチュア無線 AX.25 プロトコル\n"
8064 #: build/C/man2/socket.2:103
8070 #: build/C/man2/socket.2:105
8072 msgid "B<AF_ATMPVC>\n"
8073 msgstr "B<AF_ATMPVC>\n"
8076 #: build/C/man2/socket.2:106
8078 msgid "T}:Access to raw ATM PVCs:\n"
8079 msgstr "T}:生の ATM PVC にアクセスする:\n"
8082 #: build/C/man2/socket.2:108
8084 msgid "B<AF_APPLETALK>\n"
8085 msgstr "B<AF_APPLETALK>\n"
8088 #: build/C/man2/socket.2:109
8090 msgid "T}:Appletalk:T{\n"
8091 msgstr "T}:アップルトーク:T{\n"
8094 #: build/C/man2/socket.2:110
8097 msgstr "B<ddp>(7)\n"
8100 #: build/C/man2/socket.2:113
8102 msgid "B<AF_PACKET>\n"
8103 msgstr "B<AF_PACKET>\n"
8106 #: build/C/man2/socket.2:115
8108 msgid "Low level packet interface\n"
8109 msgstr "低レベルのパケットインターフェース\n"
8112 #: build/C/man2/socket.2:117
8114 msgid "B<packet>(7)\n"
8115 msgstr "B<packet>(7)\n"
8118 #: build/C/man2/socket.2:126
8120 "The socket has the indicated I<type>, which specifies the communication "
8121 "semantics. Currently defined types are:"
8123 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8124 "る。 定義されている型は現在以下の通り。"
8127 #: build/C/man2/socket.2:126
8129 msgid "B<SOCK_STREAM>"
8130 msgstr "B<SOCK_STREAM>"
8133 #: build/C/man2/socket.2:130
8135 "Provides sequenced, reliable, two-way, connection-based byte streams. An "
8136 "out-of-band data transmission mechanism may be supported."
8138 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8139 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8142 #: build/C/man2/socket.2:130
8144 msgid "B<SOCK_DGRAM>"
8145 msgstr "B<SOCK_DGRAM>"
8148 #: build/C/man2/socket.2:134
8150 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8153 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8157 #: build/C/man2/socket.2:134
8159 msgid "B<SOCK_SEQPACKET>"
8160 msgstr "B<SOCK_SEQPACKET>"
8163 #: build/C/man2/socket.2:139
8165 "Provides a sequenced, reliable, two-way connection-based data transmission "
8166 "path for datagrams of fixed maximum length; a consumer is required to read "
8167 "an entire packet with each input system call."
8169 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8170 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8174 #: build/C/man2/socket.2:139
8177 msgstr "B<SOCK_RAW>"
8180 #: build/C/man2/socket.2:142
8181 msgid "Provides raw network protocol access."
8182 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8185 #: build/C/man2/socket.2:142
8188 msgstr "B<SOCK_RDM>"
8191 #: build/C/man2/socket.2:145
8192 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8193 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8196 #: build/C/man2/socket.2:145
8198 msgid "B<SOCK_PACKET>"
8199 msgstr "B<SOCK_PACKET>"
8202 #: build/C/man2/socket.2:150
8203 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8205 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7) を参照する"
8209 #: build/C/man2/socket.2:152
8212 #| "Some socket types may not be implemented by all protocol families; for "
8213 #| "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
8214 msgid "Some socket types may not be implemented by all protocol families."
8216 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
8217 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
8220 #: build/C/man2/socket.2:160
8222 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8223 "addition to specifying a socket type, it may include the bitwise OR of any "
8224 "of the following values, to modify the behavior of B<socket>():"
8226 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8227 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8228 "ることで、 B<socket>() の振舞いを変更することができる。"
8231 #: build/C/man2/socket.2:194
8233 "The I<protocol> specifies a particular protocol to be used with the socket. "
8234 "Normally only a single protocol exists to support a particular socket type "
8235 "within a given protocol family, in which case I<protocol> can be specified "
8236 "as 0. However, it is possible that many protocols may exist, in which case "
8237 "a particular protocol must be specified in this manner. The protocol number "
8238 "to use is specific to the ``communication domain'' in which communication is "
8239 "to take place; see B<protocols>(5). See B<getprotoent>(3) on how to map "
8240 "protocol name strings to protocol numbers."
8242 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8243 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8244 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8245 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8246 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8247 "イン''に 固有である; B<protocols>(5) を参照すること。 プロトコル名をどうやっ"
8248 "てプロトコル番号に対応させるかについては B<getprotoent>(3) を参照すること。"
8251 #: build/C/man2/socket.2:224
8253 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8254 "pipes. They do not preserve record boundaries. A stream socket must be in "
8255 "a I<connected> state before any data may be sent or received on it. A "
8256 "connection to another socket is created with a B<connect>(2) call. Once "
8257 "connected, data may be transferred using B<read>(2) and B<write>(2) calls "
8258 "or some variant of the B<send>(2) and B<recv>(2) calls. When a session "
8259 "has been completed a B<close>(2) may be performed. Out-of-band data may "
8260 "also be transmitted as described in B<send>(2) and received as described in "
8263 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8264 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8265 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8266 "続は B<connect>(2) コールによって行なわれる。一度接続したらデータは B<read>"
8267 "(2) と B<write>(2) コールや B<send>(2) と B<recv>(2) コールの変種を使用し"
8268 "て転送できる。 セッションが完了したら B<close>(2) が行なわれる。帯域外データ"
8269 "の転送も B<send>(2) に記述されており、 受信も B<recv>(2) に記述されている。"
8272 #: build/C/man2/socket.2:250
8274 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8275 "data is not lost or duplicated. If a piece of data for which the peer "
8276 "protocol has buffer space cannot be successfully transmitted within a "
8277 "reasonable length of time, then the connection is considered to be dead. "
8278 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8279 "protocol-specific manner if the other end is still alive. A B<SIGPIPE> "
8280 "signal is raised if a process sends or receives on a broken stream; this "
8281 "causes naive processes, which do not handle the signal, to exit. "
8282 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8283 "sockets. The only difference is that B<read>(2) calls will return only the "
8284 "amount of data requested, and any data remaining in the arriving packet will "
8285 "be discarded. Also all message boundaries in incoming datagrams are "
8288 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8289 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8290 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8291 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8292 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8293 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8294 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8295 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2) コールが要求さ"
8296 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8297 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8300 #: build/C/man2/socket.2:260
8302 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8303 "correspondents named in B<sendto>(2) calls. Datagrams are generally "
8304 "received with B<recvfrom>(2), which returns the next datagram along with the "
8305 "address of its sender."
8307 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2) コールで指定された相手"
8308 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8309 "(2) で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8313 #: build/C/man2/socket.2:267
8315 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8316 "from the device driver. Use B<packet>(7) instead."
8318 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8319 "接受信するためのものである。 今は代わりに B<packet>(7) を用いること。"
8322 #: build/C/man2/socket.2:290
8324 "An B<fcntl>(2) B<F_SETOWN> operation can be used to specify a process or "
8325 "process group to receive a B<SIGURG> signal when the out-of-band data "
8326 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8327 "unexpectedly. This operation may also be used to set the process or process "
8328 "group that receives the I/O and asynchronous notification of I/O events via "
8329 "B<SIGIO>. Using B<F_SETOWN> is equivalent to an B<ioctl>(2) call with the "
8330 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8332 "B<fcntl>(2) の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8333 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8334 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8335 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8336 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8337 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8338 "B<SIOCSPGRP> の引数で B<ioctl>(2) を使用することと等価である。"
8341 #: build/C/man2/socket.2:300
8343 "When the network signals an error condition to the protocol module (e.g., "
8344 "using a ICMP message for IP) the pending error flag is set for the socket. "
8345 "The next operation on this socket will return the error code of the pending "
8346 "error. For some protocols it is possible to enable a per-socket error queue "
8347 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8350 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8351 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8352 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8353 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8354 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7) の "
8355 "B<IP_RECVERR> を参照すること。"
8358 #: build/C/man2/socket.2:310
8360 "The operation of sockets is controlled by socket level I<options>. These "
8361 "options are defined in I<E<lt>sys/socket.hE<gt>>. The functions "
8362 "B<setsockopt>(2) and B<getsockopt>(2) are used to set and get options, "
8365 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8366 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2) と "
8367 "B<getsockopt>(2) 関数はそれぞれオプションの設定と取得を行なう。"
8370 #: build/C/man2/socket.2:315
8372 "On success, a file descriptor for the new socket is returned. On error, -1 "
8373 "is returned, and I<errno> is set appropriately."
8375 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8376 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8379 #: build/C/man2/socket.2:320
8381 "Permission to create a socket of the specified type and/or protocol is "
8384 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8387 #: build/C/man2/socket.2:323
8388 msgid "The implementation does not support the specified address family."
8389 msgstr "指定されたアドレスファミリーがサポートされていない。"
8392 #: build/C/man2/socket.2:326
8393 msgid "Unknown protocol, or protocol family not available."
8394 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8396 #. Since Linux 2.6.27
8398 #: build/C/man2/socket.2:331
8399 msgid "Invalid flags in I<type>."
8400 msgstr "I<type> に無効なフラグが指定されている。"
8403 #: build/C/man2/socket.2:334
8404 msgid "Process file table overflow."
8405 msgstr "プロセスのファイルテーブルが溢れている。"
8408 #: build/C/man2/socket.2:337
8410 msgid "B<ENOBUFS> or B<ENOMEM>"
8411 msgstr "B<ENOBUFS> または B<ENOMEM>"
8414 #: build/C/man2/socket.2:342
8416 "Insufficient memory is available. The socket cannot be created until "
8417 "sufficient resources are freed."
8419 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8423 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8425 msgid "B<EPROTONOSUPPORT>"
8426 msgstr "B<EPROTONOSUPPORT>"
8429 #: build/C/man2/socket.2:346
8431 "The protocol type or the specified protocol is not supported within this "
8434 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8438 #: build/C/man2/socket.2:348
8439 msgid "Other errors may be generated by the underlying protocol modules."
8440 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8443 #: build/C/man2/socket.2:350
8444 msgid "4.4BSD, POSIX.1-2001."
8445 msgstr "4.4BSD, POSIX.1-2001."
8448 #: build/C/man2/socket.2:356
8449 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8450 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8453 #: build/C/man2/socket.2:362
8455 "B<socket>() appeared in 4.2BSD. It is generally portable to/from non-BSD "
8456 "systems supporting clones of the BSD socket layer (including System V "
8459 "B<socket>() は 4.2BSD で登場した。一般に、(System V の変種を含めて) BSD の"
8460 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8464 #: build/C/man2/socket.2:381
8466 "The manifest constants used under 4.x BSD for protocol families are "
8467 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8468 "are used for address families. However, already the BSD man page promises: "
8469 "\"The protocol family generally is the same as the address family\", and "
8470 "subsequent standards use AF_* everywhere."
8472 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8473 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8474 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8475 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8476 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8477 "それ以外の規格では全ての場所で AF_* が使用されている。"
8480 #: build/C/man2/socket.2:386
8481 msgid "An example of the use of B<socket>() is shown in B<getaddrinfo>(3)."
8482 msgstr "B<socket>() の利用例が B<getaddrinfo>(3) に記載されている。"
8485 #: build/C/man2/socket.2:409
8487 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8488 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8489 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8490 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8493 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8494 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8495 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8496 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8500 #: build/C/man2/socket.2:415
8502 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8503 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8504 "Programmer's Supplementary Documents Volume 1.>"
8506 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8507 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8508 "Supplementary Documents Volume 1.> として再版された)"
8511 #: build/C/man7/socket.7:56
8517 #: build/C/man7/socket.7:59
8518 msgid "socket - Linux socket interface"
8519 msgstr "socket - Linux のソケットインターフェース"
8522 #: build/C/man7/socket.7:63
8524 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8527 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8531 #: build/C/man7/socket.7:82
8534 #| "This manual page describes the Linux networking socket layer user "
8535 #| "interface. The BSD compatible sockets are the uniform interface between "
8536 #| "the user process and the network protocol stacks in the kernel. The "
8537 #| "protocol modules are grouped into I<protocol families> like B<AF_INET>, "
8538 #| "B<AF_IPX>, B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or "
8539 #| "B<SOCK_DGRAM>. See B<socket>(2) for more information on families and "
8542 "This manual page describes the Linux networking socket layer user "
8543 "interface. The BSD compatible sockets are the uniform interface between the "
8544 "user process and the network protocol stacks in the kernel. The protocol "
8545 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8546 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8547 "B<SOCK_DGRAM>. See B<socket>(2) for more information on families and types."
8549 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8550 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8551 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8552 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8553 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>) と I<ソケットタイプ "
8554 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>) に分類できる。 これらに"
8555 "関するより詳しい情報は B<socket>(2) を参照のこと。"
8558 #: build/C/man7/socket.7:82
8560 msgid "Socket-layer functions"
8564 #: build/C/man7/socket.7:86
8566 "These functions are used by the user process to send or receive packets and "
8567 "to do other socket operations. For more information see their respective "
8570 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8571 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8574 #: build/C/man7/socket.7:102
8576 "B<socket>(2) creates a socket, B<connect>(2) connects a socket to a remote "
8577 "socket address, the B<bind>(2) function binds a socket to a local socket "
8578 "address, B<listen>(2) tells the socket that new connections shall be "
8579 "accepted, and B<accept>(2) is used to get a new socket with a new incoming "
8580 "connection. B<socketpair>(2) returns two connected anonymous sockets "
8581 "(implemented only for a few local families like B<AF_UNIX>)"
8583 "B<socket>(2) はソケットを生成する。 B<connect>(2) はソケットをリモートのソ"
8584 "ケットアドレスに接続する。 B<bind>(2) はソケットをローカルのソケットアドレス"
8585 "にバインドする。 B<listen>(2) はソケットに新しい接続が来たら受信するように伝"
8586 "え、 B<accept>(2) は外部からやってきた接続に対して新しいソケットを得るために"
8587 "用いられる。 B<socketpair>(2) は互いに接続された二つの名前無しソケット "
8588 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8592 #: build/C/man7/socket.7:124
8594 "B<send>(2), B<sendto>(2), and B<sendmsg>(2) send data over a socket, and "
8595 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2) receive data from a socket. "
8596 "B<poll>(2) and B<select>(2) wait for arriving data or a readiness to send "
8597 "data. In addition, the standard I/O operations like B<write>(2), B<writev>"
8598 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2) can be used to read and "
8601 "B<send>(2), B<sendto>(2), B<sendmsg>(2) はソケットを通してデータを送信し、 "
8602 "B<recv>(2) B<recvfrom>(2), B<recvmsg>(2) はソケットからデータを受信する。 "
8603 "B<poll>(2) と B<select>(2) はデータの到着を待ったり、データ送信の準備ができ"
8604 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8605 "B<read>(2), B<readv>(2) のような標準的な I/O 操作もデータの読み書きに用いる"
8609 #: build/C/man7/socket.7:135
8611 "B<getsockname>(2) returns the local socket address and B<getpeername>(2) "
8612 "returns the remote socket address. B<getsockopt>(2) and B<setsockopt>(2) "
8613 "are used to set or get socket layer or protocol options. B<ioctl>(2) can "
8614 "be used to set or read some other options."
8616 "B<getsockbyname>(2) はローカルのソケットアドレスを返し、 B<getpeername>(2) "
8617 "はリモートのソケットアドレスを返す。 B<getsockopt>(2) と B<setsockopt>(2) "
8618 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8619 "いくつかのオプションの取得・設定には B<ioctl>(2) を使うことができる。"
8622 #: build/C/man7/socket.7:140
8624 "B<close>(2) is used to close a socket. B<shutdown>(2) closes parts of a "
8625 "full-duplex socket connection."
8627 "B<close>(2) はソケットをクローズする。 B<shutdown>(2) は全二重なソケット接"
8631 #: build/C/man7/socket.7:146
8633 "Seeking, or calling B<pread>(2) or B<pwrite>(2) with a nonzero position is "
8634 "not supported on sockets."
8636 "シーク動作や、 0 以外の位置に対する B<pread>(2) や B<pwrite>(2) はソケット"
8640 #: build/C/man7/socket.7:163
8642 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8643 "flag on a socket file descriptor using B<fcntl>(2). Then all operations "
8644 "that would block will (usually) return with B<EAGAIN> (operation should be "
8645 "retried later); B<connect>(2) will return B<EINPROGRESS> error. The user "
8646 "can then wait for various events via B<poll>(2) or B<select>(2)."
8648 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2) を使ってソ"
8649 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8650 "うするとブロックされる操作は、 (通常) B<EAGAIN> エラーで戻ることになる (後で"
8651 "処理が再試行されることが期待されている)。 B<connect>(2) では B<EINPROGRESS> "
8652 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2) や "
8653 "B<select>(2) を使って待つことができる。"
8656 #: build/C/man7/socket.7:167
8658 msgid "I/O events\n"
8662 #: build/C/man7/socket.7:168
8664 msgid "Event:Poll flag:Occurrence\n"
8665 msgstr "イベント:poll フラグ:内容\n"
8668 #: build/C/man7/socket.7:169 build/C/man7/socket.7:172
8670 msgid "Read:POLLIN:T{\n"
8671 msgstr "Read:POLLIN:T{\n"
8674 #: build/C/man7/socket.7:170
8676 msgid "New data arrived.\n"
8677 msgstr "新しいデータが到着した。\n"
8680 #: build/C/man7/socket.7:173
8682 msgid "A connection setup has been completed\n"
8683 msgstr "(接続志向のソケットで)\n"
8686 #: build/C/man7/socket.7:174
8688 msgid "(for connection-oriented sockets)\n"
8689 msgstr "接続の設定が終了した。\n"
8692 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
8694 msgid "Read:POLLHUP:T{\n"
8695 msgstr "Read:POLLHUP:T{\n"
8698 #: build/C/man7/socket.7:177
8700 msgid "A disconnection request has been initiated by the other end.\n"
8701 msgstr "接続先で切断要求が生成された。\n"
8704 #: build/C/man7/socket.7:180
8706 msgid "A connection is broken (only for connection-oriented protocols).\n"
8707 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8710 #: build/C/man7/socket.7:181
8712 msgid "When the socket is written\n"
8713 msgstr "この場合、ソケットに書き込みが行われると\n"
8716 #: build/C/man7/socket.7:182
8718 msgid "B<SIGPIPE>\n"
8719 msgstr "B<SIGPIPE>\n"
8722 #: build/C/man7/socket.7:183
8724 msgid "is also sent.\n"
8728 #: build/C/man7/socket.7:185
8730 msgid "Write:POLLOUT:T{\n"
8731 msgstr "Write:POLLOUT:T{\n"
8734 #: build/C/man7/socket.7:186
8736 msgid "Socket has enough send buffer space for writing new data.\n"
8737 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8740 #: build/C/man7/socket.7:188
8742 msgid "Read/Write:T{\n"
8743 msgstr "Read/Write:T{\n"
8746 #: build/C/man7/socket.7:189
8752 #: build/C/man7/socket.7:190
8758 #: build/C/man7/socket.7:191
8764 #: build/C/man7/socket.7:193
8766 msgid "An outgoing\n"
8770 #: build/C/man7/socket.7:194
8772 msgid "B<connect>(2)\n"
8773 msgstr "B<connect>(2)\n"
8776 #: build/C/man7/socket.7:195
8782 #: build/C/man7/socket.7:197
8784 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8785 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8788 #: build/C/man7/socket.7:198
8790 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8791 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8794 #: build/C/man7/socket.7:199
8796 msgid "Exception:POLLPRI:T{\n"
8797 msgstr "Exception:POLLPRI:T{\n"
8800 #: build/C/man7/socket.7:200
8802 msgid "Urgent data arrived.\n"
8803 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8806 #: build/C/man7/socket.7:201
8809 msgstr "B<SIGURG>\n"
8812 #: build/C/man7/socket.7:202
8814 msgid "is sent then.\n"
8818 #: build/C/man7/socket.7:231
8820 "An alternative to B<poll>(2) and B<select>(2) is to let the kernel inform "
8821 "the application about events via a B<SIGIO> signal. For that the B<O_ASYNC> "
8822 "flag must be set on a socket file descriptor via B<fcntl>(2) and a valid "
8823 "signal handler for B<SIGIO> must be installed via B<sigaction>(2). See the "
8824 "I<Signals> discussion below."
8826 "B<poll>(2) や B<select>(2) を使う代わりに、カーネルからアプリケーションに "
8827 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8828 "は、 B<fcntl>(2) を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8829 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2) に"
8830 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8834 #: build/C/man7/socket.7:231
8836 msgid "Socket address structures"
8837 msgstr "ソケットアドレス構造体"
8840 #: build/C/man7/socket.7:247
8842 "Each socket domain has its own format for socket addresses, with a domain-"
8843 "specific address structure. Each of these structures begins with an integer "
8844 "\"family\" field (typed as I<sa_family_t>) that indicates the type of the "
8845 "address structure. This allows the various system calls (e.g., B<connect>"
8846 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8847 "are generic to all socket domains, to determine the domain of a particular "
8850 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8851 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8852 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8853 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8854 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8855 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8859 #: build/C/man7/socket.7:257
8861 "To allow any type of socket address to be passed to interfaces in the "
8862 "sockets API, the type I<struct sockaddr> is defined. The purpose of this "
8863 "type is purely to allow casting of domain-specific socket address types to a "
8864 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8865 "calls to the sockets API."
8867 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8868 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8869 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8870 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8874 #: build/C/man7/socket.7:267
8876 "In addition, the sockets API provides the data type I<struct "
8877 "sockaddr_storage>. This type is suitable to accommodate all supported "
8878 "domain-specific socket address structures; it is large enough and is aligned "
8879 "properly. (In particular, it is large enough to hold IPv6 socket "
8880 "addresses.) The structure includes the following field, which can be used "
8881 "to identify the type of socket address actually stored in the structure:"
8883 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8884 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8885 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8886 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8887 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8888 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8892 #: build/C/man7/socket.7:271
8894 msgid " sa_family_t ss_family;\n"
8895 msgstr " sa_family_t ss_family;\n"
8898 #: build/C/man7/socket.7:279
8900 "The I<sockaddr_storage> structure is useful in programs that must handle "
8901 "socket addresses in a generic way (e.g., programs that must deal with both "
8902 "IPv4 and IPv6 socket addresses)."
8904 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8905 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8909 #: build/C/man7/socket.7:279
8911 msgid "Socket options"
8915 #. In the list below, the text used to describe argument types
8916 #. for each socket option should be more consistent
8917 #. SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8918 #. W R Stevens, UNPv1
8920 #: build/C/man7/socket.7:297
8922 "The socket options listed below can be set by using B<setsockopt>(2) and "
8923 "read with B<getsockopt>(2) with the socket level set to B<SOL_SOCKET> for "
8924 "all sockets. Unless otherwise noted, I<optval> is a pointer to an I<int>."
8926 "これらのソケットオプションは、 B<setsockopt>(2) を用いれば設定でき、 "
8927 "B<getsockopt>(2) を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8928 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
8932 #: build/C/man7/socket.7:297
8934 msgid "B<SO_ACCEPTCONN>"
8935 msgstr "B<SO_ACCEPTCONN>"
8938 #: build/C/man7/socket.7:305
8940 "Returns a value indicating whether or not this socket has been marked to "
8941 "accept connections with B<listen>(2). The value 0 indicates that this is "
8942 "not a listening socket, the value 1 indicates that this is a listening "
8943 "socket. This socket option is read-only."
8945 "このソケットが B<listen>(2) によって接続待ち受け状態に設定されているかどうか"
8946 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8947 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8950 #: build/C/man7/socket.7:305
8952 msgid "B<SO_BINDTODEVICE>"
8953 msgstr "B<SO_BINDTODEVICE>"
8956 #: build/C/man7/socket.7:324
8958 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8959 "the passed interface name. If the name is an empty string or the option "
8960 "length is zero, the socket device binding is removed. The passed option is "
8961 "a variable-length null-terminated interface name string with the maximum "
8962 "size of B<IFNAMSIZ>. If a socket is bound to an interface, only packets "
8963 "received from that particular interface are processed by the socket. Note "
8964 "that this works only for some socket types, particularly B<AF_INET> "
8965 "sockets. It is not supported for packet sockets (use normal B<bind>(2) "
8968 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
8969 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
8970 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
8971 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
8972 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
8973 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
8974 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
8975 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
8976 "B<bind>(2) を使うこと)。"
8979 #: build/C/man7/socket.7:338
8981 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8982 "with B<getsockopt>(2). Since Linux 3.8, it is readable. The I<optlen> "
8983 "argument should contain the buffer size available to receive the device name "
8984 "and is recommended to be B<IFNAMSZ> bytes. The real device name length is "
8985 "reported back in the I<optlen> argument."
8987 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
8988 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
8989 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
8990 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
8991 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
8994 #: build/C/man7/socket.7:338
8996 msgid "B<SO_BROADCAST>"
8997 msgstr "B<SO_BROADCAST>"
9000 #: build/C/man7/socket.7:344
9002 "Set or get the broadcast flag. When enabled, datagram sockets are allowed "
9003 "to send packets to a broadcast address. This option has no effect on stream-"
9006 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9007 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9008 "ストリーム指向のソケットには何の効果もない。"
9011 #: build/C/man7/socket.7:344
9013 msgid "B<SO_BSDCOMPAT>"
9014 msgstr "B<SO_BSDCOMPAT>"
9017 #: build/C/man7/socket.7:356
9019 "Enable BSD bug-to-bug compatibility. This is used by the UDP protocol "
9020 "module in Linux 2.0 and 2.2. If enabled ICMP errors received for a UDP "
9021 "socket will not be passed to the user program. In later kernel versions, "
9022 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9023 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9024 "option. Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9025 "header changing, skipping of the broadcast flag) for raw sockets with this "
9026 "option, but that was removed in Linux 2.2."
9028 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9029 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9030 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
9031 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
9032 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
9033 "がこのオプションを使用すると (printk() を使って) カーネルの警告メッセージが"
9034 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
9035 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ) に対"
9036 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
9039 #: build/C/man7/socket.7:356
9042 msgstr "B<SO_DEBUG>"
9045 #: build/C/man7/socket.7:362
9047 "Enable socket debugging. Only allowed for processes with the "
9048 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9050 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9051 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9054 #: build/C/man7/socket.7:362
9056 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9057 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9060 #: build/C/man7/socket.7:370
9062 "Retrieves the socket domain as an integer, returning a value such as "
9063 "B<AF_INET6>. See B<socket>(2) for details. This socket option is read-"
9066 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9067 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9070 #: build/C/man7/socket.7:370
9073 msgstr "B<SO_ERROR>"
9076 #: build/C/man7/socket.7:375
9078 "Get and clear the pending socket error. This socket option is read-only. "
9079 "Expects an integer."
9081 "保留になっていたソケットエラーを取得してクリアする。\n"
9082 "このソケットオプションは読み込み専用である。整数値をとる。"
9085 #: build/C/man7/socket.7:375
9087 msgid "B<SO_DONTROUTE>"
9088 msgstr "B<SO_DONTROUTE>"
9091 #: build/C/man7/socket.7:384
9093 "Don't send via a gateway, send only to directly connected hosts. The same "
9094 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9095 "B<send>(2) operation. Expects an integer boolean flag."
9097 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2) "
9098 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9102 #: build/C/man7/socket.7:384
9104 msgid "B<SO_KEEPALIVE>"
9105 msgstr "B<SO_KEEPALIVE>"
9108 #: build/C/man7/socket.7:388
9110 "Enable sending of keep-alive messages on connection-oriented sockets. "
9111 "Expects an integer boolean flag."
9113 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9117 #: build/C/man7/socket.7:388
9119 msgid "B<SO_LINGER>"
9120 msgstr "B<SO_LINGER>"
9123 #: build/C/man7/socket.7:396
9125 "Sets or gets the B<SO_LINGER> option. The argument is a I<linger> structure."
9127 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9130 #: build/C/man7/socket.7:403
9134 " int l_onoff; /* linger active */\n"
9135 " int l_linger; /* how many seconds to linger for */\n"
9139 " int l_onoff; /* linger active */\n"
9140 " int l_linger; /* how many seconds to linger for */\n"
9144 #: build/C/man7/socket.7:417
9146 "When enabled, a B<close>(2) or B<shutdown>(2) will not return until all "
9147 "queued messages for the socket have been successfully sent or the linger "
9148 "timeout has been reached. Otherwise, the call returns immediately and the "
9149 "closing is done in the background. When the socket is closed as part of "
9150 "B<exit>(2), it always lingers in the background."
9152 "有効になっていると、 B<close>(2) や B<shutdown>(2) は、そのソケットにキュー"
9153 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9154 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9155 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2) の一部と"
9156 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9160 #: build/C/man7/socket.7:417
9162 msgid "B<SO_MARK> (since Linux 2.6.25)"
9163 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9165 #. commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9166 #. and 914a9ab386a288d0f22252fc268ecbc048cdcbd5
9168 #: build/C/man7/socket.7:428
9170 "Set the mark for each packet sent through this socket (similar to the "
9171 "netfilter MARK target but socket-based). Changing the mark can be used for "
9172 "mark-based routing without netfilter or for packet filtering. Setting this "
9173 "option requires the B<CAP_NET_ADMIN> capability."
9175 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9176 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9177 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9178 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9182 #: build/C/man7/socket.7:428
9184 msgid "B<SO_OOBINLINE>"
9185 msgstr "B<SO_OOBINLINE>"
9187 #. don't document it because it can do too much harm.
9190 #: build/C/man7/socket.7:437
9192 "If this option is enabled, out-of-band data is directly placed into the "
9193 "receive data stream. Otherwise out-of-band data is passed only when the "
9194 "B<MSG_OOB> flag is set during receiving."
9196 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9197 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9198 "ラグがセットされている場合に限って渡される。"
9201 #: build/C/man7/socket.7:437
9203 msgid "B<SO_PASSCRED>"
9204 msgstr "B<SO_PASSCRED>"
9206 #. FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9207 #. in the 2.6.18 ChangeLog
9209 #: build/C/man7/socket.7:446
9211 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message. "
9212 "For more information see B<unix>(7)."
9214 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7) "
9218 #: build/C/man7/socket.7:446
9220 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9221 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9223 #. commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9225 #: build/C/man7/socket.7:456
9228 #| "This option, which is currently supported only for B<unix>(7) sockets, "
9229 #| "sets the value of the \"peek offset\" for the B<recv(2)> system call when "
9230 #| "used with B<MSG_PEEK> flag."
9232 "This option, which is currently supported only for B<unix>(7) sockets, sets "
9233 "the value of the \"peek offset\" for the B<recv>(2) system call when used "
9234 "with B<MSG_PEEK> flag."
9236 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9237 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9238 "B<unix>(7) ソケットでのみサポートされている。"
9241 #: build/C/man7/socket.7:464
9244 #| "When this option is set to a negative value (it is set to -1 for all new "
9245 #| "sockets), traditional behavior is provided: B<recv(2)> with the "
9246 #| "B<MSG_PEEK> flag will peek data from the front of the queue."
9248 "When this option is set to a negative value (it is set to -1 for all new "
9249 "sockets), traditional behavior is provided: B<recv>(2) with the B<MSG_PEEK> "
9250 "flag will peek data from the front of the queue."
9252 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9253 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9254 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9255 "のソケットではこのオプションの値は必ず -1 に設定される。"
9258 #: build/C/man7/socket.7:471
9260 "When the option is set to a value greater than or equal to zero, then the "
9261 "next peek at data queued in the socket will occur at the byte offset "
9262 "specified by the option value. At the same time, the \"peek offset\" will "
9263 "be incremented by the number of bytes that were peeked from the queue, so "
9264 "that a subsequent peek will return the next data in the queue."
9266 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9267 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9268 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9269 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9272 #: build/C/man7/socket.7:483
9274 "If data is removed from the front of the queue via a call to B<recv>(2) (or "
9275 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9276 "by the number of bytes removed. In other words, receiving data without the "
9277 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9278 "the correct relative position in the queued data, so that a subsequent peek "
9279 "will retrieve the data that would have been retrieved had the data not been "
9282 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9283 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9284 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9285 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9286 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9290 #: build/C/man7/socket.7:488
9292 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9293 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9295 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9296 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9299 #: build/C/man7/socket.7:492
9301 "The following example serves to illustrate the use of B<SO_PEEK_OFF>. "
9302 "Suppose a stream socket has the following queued input data:"
9304 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9305 "以下の入力データが入っているものとする。"
9308 #: build/C/man7/socket.7:494
9310 msgid " aabbccddeeff\n"
9311 msgstr " aabbccddeeff\n"
9314 #: build/C/man7/socket.7:499
9316 "The following sequence of B<recv>(2) calls would have the effect noted in "
9319 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9322 #: build/C/man7/socket.7:504
9325 "int ov = 4; // Set peek offset to 4\n"
9326 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9328 "int ov = 4; // Set peek offset to 4\n"
9329 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9332 #: build/C/man7/socket.7:509
9335 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"cc\"; offset set to 6\n"
9336 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"dd\"; offset set to 8\n"
9337 "recv(fd, buf, 2, 0); // Reads \"aa\"; offset set to 6\n"
9338 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"ee\"; offset set to 8\n"
9340 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"cc\"; offset set to 6\n"
9341 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"dd\"; offset set to 8\n"
9342 "recv(fd, buf, 2, 0); // Reads \"aa\"; offset set to 6\n"
9343 "recv(fd, buf, 2, MSG_PEEK); // Peeks \"ee\"; offset set to 8\n"
9346 #: build/C/man7/socket.7:511
9348 msgid "B<SO_PEERCRED>"
9349 msgstr "B<SO_PEERCRED>"
9352 #: build/C/man7/socket.7:534
9354 "Return the credentials of the foreign process connected to this socket. "
9355 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9356 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
9357 "(7). The returned credentials are those that were in effect at the time of "
9358 "the call to B<connect>(2) or B<socketpair>(2). The argument is a I<ucred> "
9359 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
9360 "definition of that structure from I<E<lt>sys/socket.hE<gt>>. This socket "
9361 "option is read-only."
9363 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9364 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9365 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9366 "トとデータグラムソケットのペアだけである。 B<unix>(7) を参照のこと。 "
9367 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9368 "る。引き数は I<ucred> 構造体である。このソケットオプションは読み込み専用であ"
9372 #: build/C/man7/socket.7:534
9374 msgid "B<SO_PRIORITY>"
9375 msgstr "B<SO_PRIORITY>"
9378 #: build/C/man7/socket.7:547
9380 "Set the protocol-defined priority for all packets to be sent on this "
9381 "socket. Linux uses this value to order the networking queues: packets with "
9382 "a higher priority may be processed first depending on the selected device "
9383 "queueing discipline. For B<ip>(7), this also sets the IP type-of-service "
9384 "(TOS) field for outgoing packets. Setting a priority outside the range 0 to "
9385 "6 requires the B<CAP_NET_ADMIN> capability."
9387 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9388 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9389 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9390 "方に依存する。 B<ip>(7) では、外向けパケットの IP type-of-service (TOS) "
9391 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9392 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9395 #: build/C/man7/socket.7:547
9397 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9398 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9401 #: build/C/man7/socket.7:555
9403 "Retrieves the socket protocol as an integer, returning a value such as "
9404 "B<IPPROTO_SCTP>. See B<socket>(2) for details. This socket option is read-"
9407 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9409 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9412 #: build/C/man7/socket.7:555
9414 msgid "B<SO_RCVBUF>"
9415 msgstr "B<SO_RCVBUF>"
9417 #. Most (all?) other implementations do not do this -- MTK, Dec 05
9418 #. The following thread on LMKL is quite informative:
9419 #. getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9421 #. http://thread.gmane.org/gmane.linux.kernel/1328935
9423 #: build/C/man7/socket.7:574
9425 "Sets or gets the maximum socket receive buffer in bytes. The kernel doubles "
9426 "this value (to allow space for bookkeeping overhead) when it is set using "
9427 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2). "
9428 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9429 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9430 "file. The minimum (doubled) value for this option is 256."
9432 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9433 "B<setsockopt>(2) を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9434 "保するために) カーネルはこの値を 2倍し、 B<getsockopt>(2) はこの 2倍された"
9435 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9436 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9437 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9440 #: build/C/man7/socket.7:574
9442 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9443 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9446 #: build/C/man7/socket.7:583
9448 "Using this socket option, a privileged (B<CAP_NET_ADMIN>) process can "
9449 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9452 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9453 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9457 #: build/C/man7/socket.7:583
9459 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9460 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9462 #. See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9463 #. Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9465 #: build/C/man7/socket.7:612
9467 "Specify the minimum number of bytes in the buffer until the socket layer "
9468 "will pass the data to the protocol (B<SO_SNDLOWAT>) or the user on "
9469 "receiving (B<SO_RCVLOWAT>). These two values are initialized to 1. "
9470 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2) fails with the "
9471 "error B<ENOPROTOOPT>). B<SO_RCVLOWAT> is changeable only since Linux 2.4. "
9472 "The B<select>(2) and B<poll>(2) system calls currently do not respect the "
9473 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9474 "single byte of data is available. A subsequent read from the socket will "
9475 "block until B<SO_RCVLOWAT> bytes are available."
9477 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9478 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9479 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9480 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2) は "
9481 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9482 "可能である。 現状、Linux ではシステムコール B<select>(2) と B<poll>(2) は "
9483 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9484 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9485 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9489 #: build/C/man7/socket.7:612
9491 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9492 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9494 #. Not implemented in 2.0.
9495 #. Implemented in 2.1.11 for getsockopt: always return a zero struct.
9496 #. Implemented in 2.3.41 for setsockopt, and actually used.
9497 #. in fact to EAGAIN
9499 #: build/C/man7/socket.7:647
9501 "Specify the receiving or sending timeouts until reporting an error. The "
9502 "argument is a I<struct timeval>. If an input or output function blocks for "
9503 "this period of time, and data has been sent or received, the return value of "
9504 "that function will be the amount of data transferred; if no data has been "
9505 "transferred and the timeout has been reached then -1 is returned with "
9506 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9507 "B<connect>(2)) just as if the socket was specified to be nonblocking. If "
9508 "the timeout is set to zero (the default) then the operation will never "
9509 "timeout. Timeouts only have effect for system calls that perform socket I/O "
9510 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9511 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9513 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9514 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9515 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9516 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9517 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>"
9518 "(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見"
9519 "える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタ"
9520 "イムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行す"
9521 "るシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), "
9522 "B<sendmsg>(2)) である。 B<select>(2), B<poll>(2), B<epoll_wait>(2) などには"
9526 #: build/C/man7/socket.7:647
9528 msgid "B<SO_REUSEADDR>"
9529 msgstr "B<SO_REUSEADDR>"
9532 #: build/C/man7/socket.7:662
9534 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9535 "(2) call should allow reuse of local addresses. For B<AF_INET> sockets "
9536 "this means that a socket may bind, except when there is an active listening "
9537 "socket bound to the address. When the listening socket is bound to "
9538 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9539 "port for any local address. Argument is an integer boolean flag."
9541 "B<bind>(2) コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9542 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9543 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9544 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9545 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9546 "ドできない。 引き数はブール整数のフラグである。"
9549 #: build/C/man7/socket.7:662
9551 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9552 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9554 #. commit 3b885787ea4112eaa80945999ea0901bf742707f
9556 #: build/C/man7/socket.7:669
9558 "Indicates that an unsigned 32-bit value ancilliary msg (cmsg) should be "
9559 "attached to received skbs indicating the number of packets dropped by the "
9560 "socket between the last received packet and this received packet"
9564 #: build/C/man7/socket.7:669
9566 msgid "B<SO_SNDBUF>"
9567 msgstr "B<SO_SNDBUF>"
9569 #. Most (all?) other implementations do not do this -- MTK, Dec 05
9570 #. See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9572 #: build/C/man7/socket.7:685
9574 "Sets or gets the maximum socket send buffer in bytes. The kernel doubles "
9575 "this value (to allow space for bookkeeping overhead) when it is set using "
9576 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2). "
9577 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9578 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9579 "file. The minimum (doubled) value for this option is 2048."
9581 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9582 "B<setsockopt>(2) を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9583 "保するために) カーネルはこの値を 2倍し、 B<getsockopt>(2) はこの 2倍された"
9584 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9585 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9586 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9589 #: build/C/man7/socket.7:685
9591 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9592 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9595 #: build/C/man7/socket.7:694
9597 "Using this socket option, a privileged (B<CAP_NET_ADMIN>) process can "
9598 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9601 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9602 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9606 #: build/C/man7/socket.7:694
9608 msgid "B<SO_TIMESTAMP>"
9609 msgstr "B<SO_TIMESTAMP>"
9612 #: build/C/man7/socket.7:710
9614 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message. The "
9615 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9616 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9617 "the last packet passed to the user in this call. See B<cmsg>(3) for "
9618 "details on control messages."
9620 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9621 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9622 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9623 "timeval> である。 制御メッセージの詳細については B<cmsg>(3) を参照。"
9626 #: build/C/man7/socket.7:710
9632 #: build/C/man7/socket.7:715
9634 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>). This socket "
9635 "option is read-only."
9637 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9638 "このソケットオプションは読み出し専用である。"
9641 #: build/C/man7/socket.7:715
9643 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9644 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9647 #: build/C/man7/socket.7:724
9649 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9650 "when there is no data. Increasing this value requires B<CAP_NET_ADMIN>. "
9651 "The default for this option is controlled by the I</proc/sys/net/core/"
9656 #: build/C/man7/socket.7:734
9658 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9659 "B<select>(2) and B<poll>(2) will busy poll when they operate on sockets "
9660 "with B<SO_BUSY_POLL> set and no events to report are found."
9664 #: build/C/man7/socket.7:738
9666 "In both cases, busy polling will only be done when the socket last received "
9667 "data from a network device that supports this option."
9671 #: build/C/man7/socket.7:742
9673 "While busy polling may improve latency of some applications, care must be "
9674 "taken when using it since this will increase both CPU utilization and power "
9679 #: build/C/man7/socket.7:742
9685 #: build/C/man7/socket.7:753
9687 "When writing onto a connection-oriented socket that has been shut down (by "
9688 "the local or the remote end) B<SIGPIPE> is sent to the writing process and "
9689 "B<EPIPE> is returned. The signal is not sent when the write call specified "
9690 "the B<MSG_NOSIGNAL> flag."
9692 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9693 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9694 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9695 "していた場合はシグナルは送られない。"
9698 #: build/C/man7/socket.7:778
9700 "When requested with the B<FIOSETOWN> B<fcntl>(2) or B<SIOCSPGRP> B<ioctl>"
9701 "(2), B<SIGIO> is sent when an I/O event occurs. It is possible to use "
9702 "B<poll>(2) or B<select>(2) in the signal handler to find out which socket "
9703 "the event occurred on. An alternative (in Linux 2.2) is to set a real-time "
9704 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9705 "signal will be called with the file descriptor in the I<si_fd> field of its "
9706 "I<siginfo_t>. See B<fcntl>(2) for more information."
9708 "B<FIOSETOWN> B<fcntl>(2) や B<SIOCSPGRP> B<ioctl>(2) をプロセスまたはプロセ"
9709 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9710 "る。 B<poll>(2) や B<select>(2) をシグナルハンドラ内で用いれば、どのソケッ"
9711 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9712 "しては、 B<F_SETSIG> B<fcntl>(2) を用いてリアルタイムシグナルを設定するやり"
9713 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9714 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2) "
9717 #. .SS Ancillary messages
9719 #: build/C/man7/socket.7:786
9721 "Under some circumstances (e.g., multiple processes accessing a single "
9722 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9723 "when the process reacts to the signal. If this happens, the process should "
9724 "wait again because Linux will resend the signal later."
9726 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9727 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9728 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9729 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9732 #: build/C/man7/socket.7:786
9734 msgid "/proc interfaces"
9735 msgstr "/proc インタフェース"
9738 #: build/C/man7/socket.7:790
9740 "The core socket networking parameters can be accessed via files in the "
9741 "directory I</proc/sys/net/core/>."
9743 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9744 "レクトリ内のファイルを通してアクセスできる。"
9747 #: build/C/man7/socket.7:790
9749 msgid "I<rmem_default>"
9750 msgstr "I<rmem_default>"
9753 #: build/C/man7/socket.7:793
9754 msgid "contains the default setting in bytes of the socket receive buffer."
9755 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9758 #: build/C/man7/socket.7:793
9761 msgstr "I<rmem_max>"
9764 #: build/C/man7/socket.7:799
9766 "contains the maximum socket receive buffer size in bytes which a user may "
9767 "set by using the B<SO_RCVBUF> socket option."
9769 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9770 "ファサイズの最大値 (バイト単位)。"
9773 #: build/C/man7/socket.7:799
9775 msgid "I<wmem_default>"
9776 msgstr "I<wmem_default>"
9779 #: build/C/man7/socket.7:802
9780 msgid "contains the default setting in bytes of the socket send buffer."
9781 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9784 #: build/C/man7/socket.7:802
9787 msgstr "I<wmem_max>"
9790 #: build/C/man7/socket.7:808
9792 "contains the maximum socket send buffer size in bytes which a user may set "
9793 "by using the B<SO_SNDBUF> socket option."
9795 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9796 "ファサイズの最大値 (バイト単位)。"
9799 #: build/C/man7/socket.7:808
9801 msgid "I<message_cost> and I<message_burst>"
9802 msgstr "I<message_cost> と I<message_burst>"
9805 #: build/C/man7/socket.7:812
9807 "configure the token bucket filter used to load limit warning messages caused "
9808 "by external network events."
9810 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9811 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9814 #: build/C/man7/socket.7:812
9816 msgid "I<netdev_max_backlog>"
9817 msgstr "I<netdev_max_backlog>"
9820 #: build/C/man7/socket.7:815
9821 msgid "Maximum number of packets in the global input queue."
9822 msgstr "グローバルな入力キューにおける最大のパケット数。"
9825 #: build/C/man7/socket.7:815
9827 msgid "I<optmem_max>"
9828 msgstr "I<optmem_max>"
9830 #. netdev_fastroute is not documented because it is experimental
9832 #: build/C/man7/socket.7:820
9834 "Maximum length of ancillary data and user control data like the iovecs per "
9837 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9841 #: build/C/man7/socket.7:820
9847 #: build/C/man7/socket.7:823
9848 msgid "These operations can be accessed using B<ioctl>(2):"
9849 msgstr "以下に示す操作には B<ioctl>(2) を用いてアクセスできる。"
9852 #: build/C/man7/socket.7:827
9854 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9855 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9858 #: build/C/man7/socket.7:829
9860 msgid "B<SIOCGSTAMP>"
9861 msgstr "B<SIOCGSTAMP>"
9864 #: build/C/man7/socket.7:853
9866 "Return a I<struct timeval> with the receive timestamp of the last packet "
9867 "passed to the user. This is useful for accurate round trip time "
9868 "measurements. See B<setitimer>(2) for a description of I<struct timeval>. "
9869 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9870 "set on the socket. Otherwise, it returns the timestamp of the last packet "
9871 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9872 "packet has been received, (i.e., B<ioctl>(2) returns -1 with I<errno> set "
9875 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9876 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9877 "timeval> の説明は B<setitimer>(2) を見てほしい。 この ioctl は、ソケットオプ"
9878 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9879 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9880 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9881 "には失敗する (つまり、 B<ioctl>(2) は -1 を返し、 I<errno> に B<ENOENT> を"
9885 #: build/C/man7/socket.7:853
9887 msgid "B<SIOCSPGRP>"
9888 msgstr "B<SIOCSPGRP>"
9891 #: build/C/man7/socket.7:872
9893 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9894 "when an asynchronous I/O operation has finished or urgent data is "
9895 "available. The argument is a pointer to a I<pid_t>. If the argument is "
9896 "positive, send the signals to that process. If the argument is negative, "
9897 "send the signals to the process group with the ID of the absolute value of "
9898 "the argument. The process may only choose itself or its own process group "
9899 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9902 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9903 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9904 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9905 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9906 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9907 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9911 #: build/C/man7/socket.7:872
9914 msgstr "B<FIOASYNC>"
9917 #: build/C/man7/socket.7:882
9919 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9920 "socket. Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9921 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9923 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9924 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9925 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9928 #: build/C/man7/socket.7:890
9930 "Argument is an integer boolean flag. (This operation is synonymous with the "
9931 "use of B<fcntl>(2) to set the B<O_ASYNC> flag.)"
9933 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2) を使って "
9934 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9937 #: build/C/man7/socket.7:890
9939 msgid "B<SIOCGPGRP>"
9940 msgstr "B<SIOCGPGRP>"
9943 #: build/C/man7/socket.7:899
9945 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9946 "signals, or 0 when none is set."
9948 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9952 #: build/C/man7/socket.7:903
9953 msgid "Valid B<fcntl>(2) operations:"
9954 msgstr "有効な B<fcntl>(2) 操作:"
9957 #: build/C/man7/socket.7:903
9959 msgid "B<FIOGETOWN>"
9960 msgstr "B<FIOGETOWN>"
9963 #: build/C/man7/socket.7:908
9964 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9965 msgstr "B<SIOCGPGRP> B<ioctl>(2) と同じ。"
9968 #: build/C/man7/socket.7:908
9970 msgid "B<FIOSETOWN>"
9971 msgstr "B<FIOSETOWN>"
9974 #: build/C/man7/socket.7:913
9975 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9976 msgstr "B<SIOCSPGRP> B<ioctl>(2) と同じ。"
9979 #: build/C/man7/socket.7:927
9981 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30. B<SO_PASSCRED> is new in "
9982 "Linux 2.2. The I</proc> interfaces was introduced in Linux 2.2. "
9983 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41. "
9984 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9985 "be read or written."
9987 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9988 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9989 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9990 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9994 #: build/C/man7/socket.7:932
9996 "Linux assumes that half of the send/receive buffer is used for internal "
9997 "kernel structures; thus the values in the corresponding I</proc> files are "
9998 "twice what can be observed on the wire."
10000 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
10001 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
10004 #. type: Plain text
10005 #: build/C/man7/socket.7:945
10007 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
10008 "option was set both in the previous program that performed a B<bind>(2) to "
10009 "the port and in the program that wants to reuse the port. This differs from "
10010 "some implementations (e.g., FreeBSD) where only the later program needs to "
10011 "set the B<SO_REUSEADDR> option. Typically this difference is invisible, "
10012 "since, for example, a server program is designed to always set this option."
10014 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10015 "のポートに対して B<bind>(2) を前に実行したプログラムとそのポートを再利用 し"
10016 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10017 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10018 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10019 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10020 "このオプションをセットするように設計されるからである。"
10022 #. FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10024 #. This man page was written by Andi Kleen.
10025 #. type: Plain text
10026 #: build/C/man7/socket.7:958
10028 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10029 "B<SO_DETACH_FILTER> are not documented. The suggested interface to use them "
10030 "is via the libpcap library."
10032 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10033 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10036 #. type: Plain text
10037 #: build/C/man7/socket.7:970
10039 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10040 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10042 msgstr "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
10045 #: build/C/man2/socketcall.2:25
10048 msgstr "SOCKETCALL"
10051 #: build/C/man2/socketcall.2:25
10054 msgstr "2012-10-16"
10056 #. type: Plain text
10057 #: build/C/man2/socketcall.2:28
10058 msgid "socketcall - socket system calls"
10059 msgstr "socketcall - ソケット・システムコール"
10061 #. type: Plain text
10062 #: build/C/man2/socketcall.2:30
10063 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10064 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10066 #. type: Plain text
10067 #: build/C/man2/socketcall.2:38
10069 "B<socketcall>() is a common kernel entry point for the socket system "
10070 "calls. I<call> determines which socket function to invoke. I<args> points "
10071 "to a block containing the actual arguments, which are passed through to the "
10072 "appropriate call."
10074 "B<socketcall>() はソケット・システムコールのための共通のカーネル・エント"
10075 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10076 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10079 #. type: Plain text
10080 #: build/C/man2/socketcall.2:42
10082 "User programs should call the appropriate functions by their usual names. "
10083 "Only standard library implementors and kernel hackers need to know about "
10086 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10087 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>() について知る"
10090 #. type: Plain text
10091 #: build/C/man2/socketcall.2:45
10093 "This call is specific to Linux, and should not be used in programs intended "
10096 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10099 #. type: Plain text
10100 #: build/C/man2/socketcall.2:53
10102 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10103 "B<socketcall>() system call; instead B<socket>(2), B<accept>(2), B<bind>"
10104 "(2), and so on really are implemented as separate system calls."
10106 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10107 "コール B<socketcall>() が存在しない。実際には、その代わりに B<socket>(2), "
10108 "B<accept>(2), B<bind>(2) などが独立したシステムコールとして実装されている。"
10110 #. type: Plain text
10111 #: build/C/man2/socketcall.2:71
10113 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10114 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10115 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10116 "(2), B<socket>(2), B<socketpair>(2)"
10118 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10119 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10120 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10121 "(2), B<socket>(2), B<socketpair>(2)"
10124 #: build/C/man2/socketpair.2:42
10127 msgstr "SOCKETPAIR"
10130 #: build/C/man2/socketpair.2:42
10133 msgstr "2008-10-11"
10135 #. type: Plain text
10136 #: build/C/man2/socketpair.2:45
10137 msgid "socketpair - create a pair of connected sockets"
10138 msgstr "socketpair - 接続されたソケットのペアを作成する"
10140 #. type: Plain text
10141 #: build/C/man2/socketpair.2:52
10143 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10146 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10149 #. type: Plain text
10150 #: build/C/man2/socketpair.2:63
10152 "The B<socketpair>() call creates an unnamed pair of connected sockets in "
10153 "the specified I<domain>, of the specified I<type>, and using the optionally "
10154 "specified I<protocol>. For further details of these arguments, see B<socket>"
10157 "B<socketpair>() は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10158 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10159 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2) を参照のこと。"
10161 #. type: Plain text
10162 #: build/C/man2/socketpair.2:69
10164 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10165 "and I<sv>[1]. The two sockets are indistinguishable."
10167 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10168 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10170 #. type: Plain text
10171 #: build/C/man2/socketpair.2:78
10172 msgid "The specified address family is not supported on this machine."
10173 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10175 #. type: Plain text
10176 #: build/C/man2/socketpair.2:83
10178 "The address I<sv> does not specify a valid part of the process address space."
10179 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10181 #. type: Plain text
10182 #: build/C/man2/socketpair.2:86
10183 msgid "Too many descriptors are in use by this process."
10184 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10186 #. type: Plain text
10187 #: build/C/man2/socketpair.2:92
10188 msgid "The specified protocol does not support creation of socket pairs."
10189 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10191 #. type: Plain text
10192 #: build/C/man2/socketpair.2:95
10193 msgid "The specified protocol is not supported on this machine."
10194 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10196 #. type: Plain text
10197 #: build/C/man2/socketpair.2:103
10199 "4.4BSD, POSIX.1-2001. The B<socketpair>() function call appeared in "
10200 "4.2BSD. It is generally portable to/from non-BSD systems supporting clones "
10201 "of the BSD socket layer (including System V variants)."
10203 "4.4BSD, POSIX.1-2001. B<socketpair>() 関数コールは 4.2BSD で現われた。一般"
10204 "に (System V の変種を含めて) BSD のソケット層のクローンをサポートしている、"
10205 "BSD 以外のシステムと、 互いに移植性がある。"
10207 #. type: Plain text
10208 #: build/C/man2/socketpair.2:109
10210 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10211 "synonymously, B<AF_LOCAL>). (Most implementations have the same "
10214 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10215 "ある B<AF_LOCAL>) だけである。 (ほとんどの実装で同じ制限がある)"
10217 #. type: Plain text
10218 #: build/C/man2/socketpair.2:118
10220 "Since Linux 2.6.27, B<socketpair>() supports the B<SOCK_NONBLOCK> and "
10221 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10223 "Linux 2.6.27 以降では、 B<socketpair>() は、フラグ B<SOCK_NONBLOCK> と "
10224 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2) を参照のこと。"
10226 #. type: Plain text
10227 #: build/C/man2/socketpair.2:131
10229 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10231 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"