OSDN Git Service

(split) LDP: Support po4a.
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
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.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2012-03-19 23:50+0900\n"
10 "PO-Revision-Date: 2012-03-22 02:01+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:39
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:39
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:39 build/C/man2/bind.2:66 build/C/man2/connect.2:65
32 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
33 #: build/C/man2/listen.2:43 build/C/man2/recv.2:39 build/C/man2/recvmmsg.2:24
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:30
35 #: build/C/man2/send.2:38 build/C/man3/sockatmark.3:23
36 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
37 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:40
38 #, no-wrap
39 msgid "Linux"
40 msgstr "Linux"
41
42 #. type: TH
43 #: build/C/man2/accept.2:39 build/C/man2/bind.2:66
44 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
45 #: build/C/man3/getifaddrs.3:33 build/C/man2/getsockname.2:38
46 #: build/C/man2/getsockopt.2:42 build/C/man2/listen.2:43
47 #: build/C/man2/recv.2:39 build/C/man2/recvmmsg.2:24 build/C/man2/select.2:38
48 #: build/C/man2/select_tut.2:30 build/C/man2/send.2:38
49 #: build/C/man3/sockatmark.3:23 build/C/man2/socket.2:41
50 #: build/C/man7/socket.7:26 build/C/man2/socketcall.2:26
51 #: build/C/man2/socketpair.2:40
52 #, no-wrap
53 msgid "Linux Programmer's Manual"
54 msgstr "Linux Programmer's Manual"
55
56 #. type: SH
57 #: build/C/man2/accept.2:40 build/C/man2/bind.2:67
58 #: build/C/man3/bindresvport.3:28 build/C/man2/connect.2:66
59 #: build/C/man3/getifaddrs.3:34 build/C/man2/getsockname.2:39
60 #: build/C/man2/getsockopt.2:43 build/C/man2/listen.2:44
61 #: build/C/man2/recv.2:40 build/C/man2/recvmmsg.2:25 build/C/man2/select.2:39
62 #: build/C/man2/select_tut.2:31 build/C/man2/send.2:39
63 #: build/C/man3/sockatmark.3:24 build/C/man2/socket.2:42
64 #: build/C/man7/socket.7:27 build/C/man2/socketcall.2:27
65 #: build/C/man2/socketpair.2:41
66 #, no-wrap
67 msgid "NAME"
68 msgstr "名前"
69
70 #. type: Plain text
71 #: build/C/man2/accept.2:42
72 msgid "accept - accept a connection on a socket"
73 msgstr "accept - ソケットへの接続を受ける"
74
75 #. type: SH
76 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
77 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:68
78 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:41
79 #: build/C/man2/getsockopt.2:45 build/C/man2/listen.2:46
80 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:27 build/C/man2/select.2:42
81 #: build/C/man2/select_tut.2:34 build/C/man2/send.2:41
82 #: build/C/man3/sockatmark.3:26 build/C/man2/socket.2:44
83 #: build/C/man7/socket.7:29 build/C/man2/socketcall.2:29
84 #: build/C/man2/socketpair.2:43
85 #, no-wrap
86 msgid "SYNOPSIS"
87 msgstr "書式"
88
89 #. type: Plain text
90 #: build/C/man2/accept.2:46 build/C/man2/bind.2:73
91 #, no-wrap
92 msgid ""
93 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
94 "B<#include E<lt>sys/socket.hE<gt>>\n"
95 msgstr ""
96 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
97 "B<#include E<lt>sys/socket.hE<gt>>\n"
98
99 #. type: Plain text
100 #: build/C/man2/accept.2:48
101 #, no-wrap
102 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
103 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
104
105 #. type: Plain text
106 #: build/C/man2/accept.2:51
107 #, no-wrap
108 msgid ""
109 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
110 "B<#include E<lt>sys/socket.hE<gt>>\n"
111 msgstr ""
112 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
113 "B<#include E<lt>sys/socket.hE<gt>>\n"
114
115 #. type: Plain text
116 #: build/C/man2/accept.2:54
117 #, no-wrap
118 msgid ""
119 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
120 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
121 msgstr ""
122 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
123 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
124
125 #. type: SH
126 #: build/C/man2/accept.2:55 build/C/man2/bind.2:77
127 #: build/C/man3/bindresvport.3:37 build/C/man2/connect.2:77
128 #: build/C/man3/getifaddrs.3:45 build/C/man2/getsockname.2:48
129 #: build/C/man2/getsockopt.2:56 build/C/man2/listen.2:54
130 #: build/C/man2/recv.2:57 build/C/man2/recvmmsg.2:37 build/C/man2/select.2:81
131 #: build/C/man2/select_tut.2:73 build/C/man2/send.2:56
132 #: build/C/man3/sockatmark.3:40 build/C/man2/socket.2:50
133 #: build/C/man7/socket.7:33 build/C/man2/socketcall.2:31
134 #: build/C/man2/socketpair.2:50
135 #, no-wrap
136 msgid "DESCRIPTION"
137 msgstr "説明"
138
139 #. type: Plain text
140 #: build/C/man2/accept.2:70
141 msgid ""
142 "The B<accept>()  system call is used with connection-based socket types "
143 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
144 "request on the queue of pending connections for the listening socket, "
145 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
146 "referring to that socket.  The newly created socket is not in the listening "
147 "state.  The original socket I<sockfd> is unaffected by this call."
148 msgstr ""
149 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
150 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
151 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
152 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
153 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
154 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
155
156 #. type: Plain text
157 #: build/C/man2/accept.2:79
158 msgid ""
159 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
160 "bound to a local address with B<bind>(2), and is listening for connections "
161 "after a B<listen>(2)."
162 msgstr ""
163 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
164 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
165 "である。"
166
167 #. type: Plain text
168 #: build/C/man2/accept.2:97
169 msgid ""
170 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
171 "structure is filled in with the address of the peer socket, as known to the "
172 "communications layer.  The exact format of the address returned I<addr> is "
173 "determined by the socket's address family (see B<socket>(2)  and the "
174 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
175 "in this case, I<addrlen> is not used, and should also be NULL."
176 msgstr ""
177 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
178 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
179 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
180 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
181 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
182 "おくべきである。"
183
184 #. type: Plain text
185 #: build/C/man2/accept.2:105
186 msgid ""
187 "The I<addrlen> argument is a value-result argument: the caller must "
188 "initialize it to contain the size (in bytes) of the structure pointed to by "
189 "I<addr>; on return it will contain the actual size of the peer address."
190 msgstr ""
191 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
192 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
193 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
194
195 #. type: Plain text
196 #: build/C/man2/accept.2:110 build/C/man2/getsockname.2:65
197 msgid ""
198 "The returned address is truncated if the buffer provided is too small; in "
199 "this case, I<addrlen> will return a value greater than was supplied to the "
200 "call."
201 msgstr ""
202 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
203 "る。\n"
204 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
205 "される。"
206
207 #. type: Plain text
208 #: build/C/man2/accept.2:123
209 msgid ""
210 "If no pending connections are present on the queue, and the socket is not "
211 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
212 "present.  If the socket is marked nonblocking and no pending connections are "
213 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
214 "B<EWOULDBLOCK>."
215 msgstr ""
216 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
217 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
218 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
219 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
220
221 #. type: Plain text
222 #: build/C/man2/accept.2:137
223 msgid ""
224 "In order to be notified of incoming connections on a socket, you can use "
225 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
226 "connection is attempted and you may then call B<accept>()  to get a socket "
227 "for that connection.  Alternatively, you can set the socket to deliver "
228 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
229 msgstr ""
230 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
231 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
232 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
233 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
234 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
235
236 #. type: Plain text
237 #: build/C/man2/accept.2:150
238 msgid ""
239 "For certain protocols which require an explicit confirmation, such as "
240 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
241 "connection request and not implying confirmation.  Confirmation can be "
242 "implied by a normal read or write on the new file descriptor, and rejection "
243 "can be implied by closing the new socket.  Currently only DECNet has these "
244 "semantics on Linux."
245 msgstr ""
246 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
247 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
248 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
249 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
250 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
251 "セマンティクスを持つのは DECNet だけである。"
252
253 #. type: Plain text
254 #: build/C/man2/accept.2:160
255 msgid ""
256 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
257 "following values can be bitwise ORed in I<flags> to obtain different "
258 "behavior:"
259 msgstr ""
260 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
261 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
262 "できる。"
263
264 #. type: TP
265 #: build/C/man2/accept.2:160 build/C/man2/socket.2:162
266 #, no-wrap
267 msgid "B<SOCK_NONBLOCK>"
268 msgstr "B<SOCK_NONBLOCK>"
269
270 #. type: Plain text
271 #: build/C/man2/accept.2:168 build/C/man2/socket.2:170
272 msgid ""
273 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
274 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
275 msgstr ""
276 "新しく生成されるオープンファイル記述 (open file description) の "
277 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
278 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
279 "なる。"
280
281 #. type: TP
282 #: build/C/man2/accept.2:168 build/C/man2/socket.2:170
283 #, no-wrap
284 msgid "B<SOCK_CLOEXEC>"
285 msgstr "B<SOCK_CLOEXEC>"
286
287 #. type: Plain text
288 #: build/C/man2/accept.2:178 build/C/man2/socket.2:180
289 msgid ""
290 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
291 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
292 "may be useful."
293 msgstr ""
294 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
295 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
296 "B<O_CLOEXEC> フラグの説明を参照のこと。"
297
298 #. type: SH
299 #: build/C/man2/accept.2:178 build/C/man2/bind.2:150
300 #: build/C/man3/bindresvport.3:64 build/C/man2/connect.2:125
301 #: build/C/man2/getsockname.2:65 build/C/man2/getsockopt.2:129
302 #: build/C/man2/listen.2:80 build/C/man2/recv.2:386
303 #: build/C/man2/recvmmsg.2:139 build/C/man2/select.2:285
304 #: build/C/man2/select_tut.2:483 build/C/man2/send.2:273
305 #: build/C/man3/sockatmark.3:49 build/C/man2/socket.2:312
306 #: build/C/man2/socketpair.2:67
307 #, no-wrap
308 msgid "RETURN VALUE"
309 msgstr "返り値"
310
311 #. type: Plain text
312 #: build/C/man2/accept.2:185
313 msgid ""
314 "On success, these system calls return a nonnegative integer that is a "
315 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
316 "is set appropriately."
317 msgstr ""
318 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
319 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
320 "定する。"
321
322 #. type: SS
323 #: build/C/man2/accept.2:185
324 #, no-wrap
325 msgid "Error Handling"
326 msgstr "エラー処理"
327
328 #. type: Plain text
329 #: build/C/man2/accept.2:212
330 msgid ""
331 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
332 "on the new socket as an error code from B<accept>().  This behavior differs "
333 "from other BSD socket implementations.  For reliable operation the "
334 "application should detect the network errors defined for the protocol after "
335 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In case of TCP/IP "
336 "these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, "
337 "B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
338 msgstr ""
339 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
340 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
341 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
342 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
343 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
344 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
345 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
346 "B<ENETUNREACH>"
347
348 #. type: SH
349 #: build/C/man2/accept.2:212 build/C/man2/bind.2:155
350 #: build/C/man3/bindresvport.3:69 build/C/man2/connect.2:130
351 #: build/C/man3/getifaddrs.3:144 build/C/man2/getsockname.2:70
352 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
353 #: build/C/man2/recv.2:391 build/C/man2/recvmmsg.2:147
354 #: build/C/man2/select.2:302 build/C/man2/send.2:278
355 #: build/C/man3/sockatmark.3:54 build/C/man2/socket.2:317
356 #: build/C/man2/socketpair.2:72
357 #, no-wrap
358 msgid "ERRORS"
359 msgstr "エラー"
360
361 #. type: TP
362 #: build/C/man2/accept.2:213 build/C/man2/recv.2:396 build/C/man2/send.2:291
363 #, no-wrap
364 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
365 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
366
367 #.  Actually EAGAIN on Linux
368 #. type: Plain text
369 #: build/C/man2/accept.2:221
370 msgid ""
371 "The socket is marked nonblocking and no connections are present to be "
372 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
373 "and does not require these constants to have the same value, so a portable "
374 "application should check for both possibilities."
375 msgstr ""
376 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
377 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
378 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
379 "ションでは、両方の可能性を 確認すべきである。"
380
381 #. type: TP
382 #: build/C/man2/accept.2:221 build/C/man2/bind.2:163
383 #: build/C/man2/connect.2:167 build/C/man2/getsockname.2:71
384 #: build/C/man2/getsockopt.2:135 build/C/man2/listen.2:89
385 #: build/C/man2/recv.2:405 build/C/man2/select.2:303 build/C/man2/send.2:299
386 #: build/C/man3/sockatmark.3:55
387 #, no-wrap
388 msgid "B<EBADF>"
389 msgstr "B<EBADF>"
390
391 #. type: Plain text
392 #: build/C/man2/accept.2:224
393 msgid "The descriptor is invalid."
394 msgstr "ディスクリプタが不正。"
395
396 #. type: TP
397 #: build/C/man2/accept.2:224
398 #, no-wrap
399 msgid "B<ECONNABORTED>"
400 msgstr "B<ECONNABORTED>"
401
402 #. type: Plain text
403 #: build/C/man2/accept.2:227
404 msgid "A connection has been aborted."
405 msgstr "接続が中止された。"
406
407 #. type: TP
408 #: build/C/man2/accept.2:227 build/C/man2/bind.2:189
409 #: build/C/man2/connect.2:173 build/C/man2/getsockname.2:76
410 #: build/C/man2/getsockopt.2:140 build/C/man2/recv.2:414
411 #: build/C/man2/send.2:308 build/C/man2/socketpair.2:76
412 #, no-wrap
413 msgid "B<EFAULT>"
414 msgstr "B<EFAULT>"
415
416 #. type: Plain text
417 #: build/C/man2/accept.2:232
418 msgid ""
419 "The I<addr> argument is not in a writable part of the user address space."
420 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
421
422 #. type: TP
423 #: build/C/man2/accept.2:232 build/C/man2/connect.2:201
424 #: build/C/man2/recv.2:418 build/C/man2/select.2:308 build/C/man2/send.2:311
425 #, no-wrap
426 msgid "B<EINTR>"
427 msgstr "B<EINTR>"
428
429 #. type: Plain text
430 #: build/C/man2/accept.2:237
431 msgid ""
432 "The system call was interrupted by a signal that was caught before a valid "
433 "connection arrived; see B<signal>(7)."
434 msgstr ""
435 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
436 "た。 B<signal>(7)  参照。"
437
438 #. type: TP
439 #: build/C/man2/accept.2:237 build/C/man2/accept.2:242 build/C/man2/bind.2:167
440 #: build/C/man2/bind.2:193 build/C/man2/getsockname.2:82
441 #: build/C/man2/getsockopt.2:150 build/C/man2/recv.2:423
442 #: build/C/man2/recvmmsg.2:151 build/C/man2/select.2:312
443 #: build/C/man2/send.2:315 build/C/man3/sockatmark.3:59
444 #: build/C/man2/socket.2:325 build/C/man2/socket.2:328
445 #, no-wrap
446 msgid "B<EINVAL>"
447 msgstr "B<EINVAL>"
448
449 #. type: Plain text
450 #: build/C/man2/accept.2:242
451 msgid ""
452 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
453 "negative)."
454 msgstr ""
455 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
456 "負の場合など)。"
457
458 #. type: Plain text
459 #: build/C/man2/accept.2:247
460 msgid "(B<accept4>())  invalid value in I<flags>."
461 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
462
463 #. type: TP
464 #: build/C/man2/accept.2:247 build/C/man2/socket.2:333
465 #: build/C/man2/socketpair.2:81
466 #, no-wrap
467 msgid "B<EMFILE>"
468 msgstr "B<EMFILE>"
469
470 #. type: Plain text
471 #: build/C/man2/accept.2:250
472 msgid "The per-process limit of open file descriptors has been reached."
473 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
474
475 #. type: TP
476 #: build/C/man2/accept.2:250 build/C/man2/socket.2:336
477 #: build/C/man2/socketpair.2:84
478 #, no-wrap
479 msgid "B<ENFILE>"
480 msgstr "B<ENFILE>"
481
482 #. type: Plain text
483 #: build/C/man2/accept.2:253 build/C/man2/socket.2:339
484 #: build/C/man2/socketpair.2:87
485 msgid "The system limit on the total number of open files has been reached."
486 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
487
488 #. type: TP
489 #: build/C/man2/accept.2:253
490 #, no-wrap
491 msgid "B<ENOBUFS>, B<ENOMEM>"
492 msgstr "B<ENOBUFS>, B<ENOMEM>"
493
494 #. type: Plain text
495 #: build/C/man2/accept.2:258
496 msgid ""
497 "Not enough free memory.  This often means that the memory allocation is "
498 "limited by the socket buffer limits, not by the system memory."
499 msgstr ""
500 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
501 "ケットバッファの大きさによるメモリ割り当ての制限である。"
502
503 #. type: TP
504 #: build/C/man2/accept.2:258 build/C/man2/bind.2:172
505 #: build/C/man2/connect.2:213 build/C/man2/getsockname.2:90
506 #: build/C/man2/getsockopt.2:164 build/C/man2/listen.2:94
507 #: build/C/man2/recv.2:438 build/C/man2/send.2:344
508 #, no-wrap
509 msgid "B<ENOTSOCK>"
510 msgstr "B<ENOTSOCK>"
511
512 #. type: Plain text
513 #: build/C/man2/accept.2:261
514 msgid "The descriptor references a file, not a socket."
515 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
516
517 #. type: TP
518 #: build/C/man2/accept.2:261 build/C/man2/listen.2:99 build/C/man2/send.2:349
519 #: build/C/man2/socketpair.2:87
520 #, no-wrap
521 msgid "B<EOPNOTSUPP>"
522 msgstr "B<EOPNOTSUPP>"
523
524 #. type: Plain text
525 #: build/C/man2/accept.2:265
526 msgid "The referenced socket is not of type B<SOCK_STREAM>."
527 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
528
529 #. type: TP
530 #: build/C/man2/accept.2:265
531 #, no-wrap
532 msgid "B<EPROTO>"
533 msgstr "B<EPROTO>"
534
535 #. type: Plain text
536 #: build/C/man2/accept.2:268
537 msgid "Protocol error."
538 msgstr "プロトコル・エラー。"
539
540 #. type: Plain text
541 #: build/C/man2/accept.2:272
542 msgid "In addition, Linux B<accept>()  may fail if:"
543 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
544
545 #. type: TP
546 #: build/C/man2/accept.2:272
547 #, no-wrap
548 msgid "B<EPERM>"
549 msgstr "B<EPERM>"
550
551 #. type: Plain text
552 #: build/C/man2/accept.2:275
553 msgid "Firewall rules forbid connection."
554 msgstr "ファイアウォールのルールにより接続が禁止された。"
555
556 #. type: Plain text
557 #: build/C/man2/accept.2:287
558 msgid ""
559 "In addition, network errors for the new socket and as defined for the "
560 "protocol may be returned.  Various Linux kernels can return other errors "
561 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
562 "value B<ERESTARTSYS> may be seen during a trace."
563 msgstr ""
564 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
565 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
566 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
567 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
568 "ともある。"
569
570 #. type: SH
571 #: build/C/man2/accept.2:287 build/C/man3/getifaddrs.3:157
572 #: build/C/man2/recvmmsg.2:155 build/C/man2/select.2:321
573 #: build/C/man3/sockatmark.3:66 build/C/man7/socket.7:697
574 #, no-wrap
575 msgid "VERSIONS"
576 msgstr "バージョン"
577
578 #. type: Plain text
579 #: build/C/man2/accept.2:292
580 msgid ""
581 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
582 "support in glibc is available starting with version 2.10."
583 msgstr ""
584 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
585 "サポートはバージョン 2.10 以降で利用可能である。"
586
587 #. type: SH
588 #: build/C/man2/accept.2:292 build/C/man2/bind.2:220
589 #: build/C/man3/bindresvport.3:89 build/C/man2/connect.2:223
590 #: build/C/man3/getifaddrs.3:165 build/C/man2/getsockname.2:95
591 #: build/C/man2/getsockopt.2:169 build/C/man2/listen.2:104
592 #: build/C/man2/recv.2:443 build/C/man2/recvmmsg.2:160
593 #: build/C/man2/select.2:327 build/C/man2/send.2:363
594 #: build/C/man3/sockatmark.3:69 build/C/man2/socket.2:350
595 #: build/C/man2/socketcall.2:43 build/C/man2/socketpair.2:93
596 #, no-wrap
597 msgid "CONFORMING TO"
598 msgstr "準拠"
599
600 #.  The BSD man page documents five possible error returns
601 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
602 #.  POSIX.1-2001 documents errors
603 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
604 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
605 #.  In addition, SUSv2 documents EFAULT and ENOSR.
606 #. type: Plain text
607 #: build/C/man2/accept.2:304
608 msgid ""
609 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
610 "4.2BSD)."
611 msgstr ""
612 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
613 "された)."
614
615 #. type: Plain text
616 #: build/C/man2/accept.2:307
617 msgid "B<accept4>()  is a nonstandard Linux extension."
618 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
619
620 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
621 #.  do not inherit file status flags -- MTK Jun 05
622 #. type: Plain text
623 #: build/C/man2/accept.2:322
624 msgid ""
625 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
626 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
627 "socket.  This behavior differs from the canonical BSD sockets "
628 "implementation.  Portable programs should not rely on inheritance or "
629 "noninheritance of file status flags and always explicitly set all required "
630 "flags on the socket returned from B<accept>()."
631 msgstr ""
632 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
633 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
634 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
635 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
636 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
637 "である。"
638
639 #. type: SH
640 #: build/C/man2/accept.2:322 build/C/man2/bind.2:232
641 #: build/C/man3/bindresvport.3:92 build/C/man2/connect.2:239
642 #: build/C/man3/getifaddrs.3:185 build/C/man2/getsockname.2:101
643 #: build/C/man2/getsockopt.2:176 build/C/man2/listen.2:109
644 #: build/C/man2/recv.2:453 build/C/man2/select.2:342
645 #: build/C/man2/select_tut.2:501 build/C/man2/send.2:377
646 #: build/C/man3/sockatmark.3:71 build/C/man2/socket.2:364
647 #: build/C/man7/socket.7:711 build/C/man2/socketcall.2:46
648 #: build/C/man2/socketpair.2:101
649 #, no-wrap
650 msgid "NOTES"
651 msgstr "注意"
652
653 #. type: Plain text
654 #: build/C/man2/accept.2:328 build/C/man2/bind.2:238
655 #: build/C/man2/connect.2:245 build/C/man2/getsockopt.2:182
656 #: build/C/man2/listen.2:135 build/C/man2/socket.2:370
657 #: build/C/man2/socketpair.2:122
658 msgid ""
659 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
660 "this header file is not required on Linux.  However, some historical (BSD) "
661 "implementations required this header file, and portable applications are "
662 "probably wise to include it."
663 msgstr ""
664 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
665 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
666 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
667 "ションではこのファイルを インクルードするのが賢明であろう。"
668
669 #. type: Plain text
670 #: build/C/man2/accept.2:349
671 msgid ""
672 "There may not always be a connection waiting after a B<SIGIO> is delivered "
673 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
674 "connection might have been removed by an asynchronous network error or "
675 "another thread before B<accept>()  is called.  If this happens then the call "
676 "will block waiting for the next connection to arrive.  To ensure that "
677 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
678 "B<O_NONBLOCK> flag set (see B<socket>(7))."
679 msgstr ""
680 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
681 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
682 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
683 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
684 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
685 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
686 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
687 "見よ)。"
688
689 #. type: SS
690 #: build/C/man2/accept.2:349
691 #, no-wrap
692 msgid "The socklen_t type"
693 msgstr "socklen_t 型"
694
695 #. type: Plain text
696 #: build/C/man2/accept.2:359
697 msgid ""
698 "The third argument of B<accept>()  was originally declared as an I<int *> "
699 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
700 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
701 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
702 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
703 "Torvalds:"
704 msgstr ""
705 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
706 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
707 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
708 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
709 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
710 "た。 Linus Torvald の発言を引用する:"
711
712 #.  .I fails: only italicizes a single line
713 #. type: Plain text
714 #: build/C/man2/accept.2:376
715 msgid ""
716 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
717 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
718 "make it a size_t, and I (and hopefully others, but obviously not too many) "
719 "complained to them very loudly indeed.  Making it a size_t is completely "
720 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
721 "bit architectures, for example.  And it I<has> to be the same size as \"int"
722 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
723 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
724 "have touched it in the first place, but once they did they felt it had to "
725 "have a named type for some unfathomable reason (probably somebody didn't "
726 "like losing face over having done the original stupid thing, so they "
727 "silently just renamed their blunder).\""
728 msgstr ""
729 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
730 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
731 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
732 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
733 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
734 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
735 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
736 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
737 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
738 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
739 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
740 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
741 "う)。」"
742
743 #. type: SH
744 #: build/C/man2/accept.2:376 build/C/man2/bind.2:252
745 #: build/C/man2/connect.2:256 build/C/man3/getifaddrs.3:198
746 #: build/C/man2/listen.2:164 build/C/man2/recv.2:488 build/C/man2/select.2:482
747 #: build/C/man2/select_tut.2:527 build/C/man2/send.2:409
748 #: build/C/man3/sockatmark.3:95 build/C/man2/socket.2:382
749 #, no-wrap
750 msgid "EXAMPLE"
751 msgstr "例"
752
753 #. type: Plain text
754 #: build/C/man2/accept.2:379 build/C/man2/listen.2:167
755 msgid "See B<bind>(2)."
756 msgstr "B<bind>(2)  参照。"
757
758 #. type: SH
759 #: build/C/man2/accept.2:379 build/C/man2/bind.2:317
760 #: build/C/man3/bindresvport.3:98 build/C/man2/connect.2:261
761 #: build/C/man3/getifaddrs.3:281 build/C/man2/getsockname.2:110
762 #: build/C/man2/getsockopt.2:200 build/C/man2/listen.2:167
763 #: build/C/man2/recv.2:493 build/C/man2/recvmmsg.2:163
764 #: build/C/man2/select.2:519 build/C/man2/select_tut.2:817
765 #: build/C/man2/send.2:414 build/C/man3/sockatmark.3:130
766 #: build/C/man2/socket.2:387 build/C/man7/socket.7:742
767 #: build/C/man2/socketcall.2:54 build/C/man2/socketpair.2:122
768 #, no-wrap
769 msgid "SEE ALSO"
770 msgstr "関連項目"
771
772 #. type: Plain text
773 #: build/C/man2/accept.2:386
774 msgid ""
775 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
776 "B<socket>(7)"
777 msgstr ""
778 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
779 "B<socket>(7)"
780
781 #. type: SH
782 #: build/C/man2/accept.2:386 build/C/man2/bind.2:330
783 #: build/C/man3/bindresvport.3:101 build/C/man2/connect.2:268
784 #: build/C/man3/getifaddrs.3:287 build/C/man2/getsockname.2:117
785 #: build/C/man2/getsockopt.2:208 build/C/man2/listen.2:173
786 #: build/C/man2/recv.2:504 build/C/man2/recvmmsg.2:170
787 #: build/C/man2/select.2:534 build/C/man2/select_tut.2:836
788 #: build/C/man2/send.2:428 build/C/man3/sockatmark.3:135
789 #: build/C/man2/socket.2:418 build/C/man7/socket.7:753
790 #: build/C/man2/socketcall.2:72 build/C/man2/socketpair.2:129
791 #, no-wrap
792 msgid "COLOPHON"
793 msgstr ""
794
795 #. type: Plain text
796 #: build/C/man2/accept.2:393 build/C/man2/bind.2:337
797 #: build/C/man3/bindresvport.3:108 build/C/man2/connect.2:275
798 #: build/C/man3/getifaddrs.3:294 build/C/man2/getsockname.2:124
799 #: build/C/man2/getsockopt.2:215 build/C/man2/listen.2:180
800 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:177
801 #: build/C/man2/select.2:541 build/C/man2/select_tut.2:843
802 #: build/C/man2/send.2:435 build/C/man3/sockatmark.3:142
803 #: build/C/man2/socket.2:425 build/C/man7/socket.7:760
804 #: build/C/man2/socketcall.2:79 build/C/man2/socketpair.2:136
805 msgid ""
806 "This page is part of release 3.35 of the Linux I<man-pages> project.  A "
807 "description of the project, and information about reporting bugs, can be "
808 "found at http://man7.org/linux/man-pages/."
809 msgstr ""
810
811 #. type: TH
812 #: build/C/man2/bind.2:66
813 #, no-wrap
814 msgid "BIND"
815 msgstr "BIND"
816
817 #. type: TH
818 #: build/C/man2/bind.2:66
819 #, no-wrap
820 msgid "2007-12-28"
821 msgstr "2007-12-28"
822
823 #. type: Plain text
824 #: build/C/man2/bind.2:69
825 msgid "bind - bind a name to a socket"
826 msgstr "bind - ソケットに名前をつける"
827
828 #. type: Plain text
829 #: build/C/man2/bind.2:76
830 #, no-wrap
831 msgid ""
832 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
833 "B<         socklen_t >I<addrlen>B<);>\n"
834 msgstr ""
835 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
836 "B<         socklen_t >I<addrlen>B<);>\n"
837
838 #. type: Plain text
839 #: build/C/man2/bind.2:90
840 msgid ""
841 "When a socket is created with B<socket>(2), it exists in a name space "
842 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
843 "address specified to by I<addr> to the socket referred to by the file "
844 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
845 "address structure pointed to by I<addr>.  Traditionally, this operation is "
846 "called \\(lqassigning a name to a socket\\(rq."
847 msgstr ""
848 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
849 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
850 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
851 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
852 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
853 "る。"
854
855 #. type: Plain text
856 #: build/C/man2/bind.2:97
857 msgid ""
858 "It is normally necessary to assign a local address using B<bind>()  before a "
859 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
860 msgstr ""
861 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
862 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
863 "る。"
864
865 #. type: Plain text
866 #: build/C/man2/bind.2:128
867 msgid ""
868 "The rules used in name binding vary between address families.  Consult the "
869 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
870 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
871 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
872 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
873 msgstr ""
874 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
875 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
876 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
877 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
878 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
879
880 #. type: Plain text
881 #: build/C/man2/bind.2:135
882 msgid ""
883 "The actual structure passed for the I<addr> argument will depend on the "
884 "address family.  The I<sockaddr> structure is defined as something like:"
885 msgstr ""
886 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
887 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
888
889 #. type: Plain text
890 #: build/C/man2/bind.2:142
891 #, no-wrap
892 msgid ""
893 "struct sockaddr {\n"
894 "    sa_family_t sa_family;\n"
895 "    char        sa_data[14];\n"
896 "}\n"
897 msgstr ""
898 "struct sockaddr {\n"
899 "    sa_family_t sa_family;\n"
900 "    char        sa_data[14];\n"
901 "}\n"
902
903 #. type: Plain text
904 #: build/C/man2/bind.2:150
905 msgid ""
906 "The only purpose of this structure is to cast the structure pointer passed "
907 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
908 msgstr ""
909 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
910 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
911
912 #. type: Plain text
913 #: build/C/man2/bind.2:155 build/C/man2/getsockname.2:70
914 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
915 #: build/C/man2/socketpair.2:72
916 msgid ""
917 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
918 "appropriately."
919 msgstr ""
920 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
921 "設定される。"
922
923 #. type: TP
924 #: build/C/man2/bind.2:156 build/C/man2/bind.2:180
925 #: build/C/man3/bindresvport.3:74 build/C/man2/connect.2:133
926 #: build/C/man2/send.2:283 build/C/man2/socket.2:318
927 #, no-wrap
928 msgid "B<EACCES>"
929 msgstr "B<EACCES>"
930
931 #.  e.g., privileged port in AF_INET domain
932 #. type: Plain text
933 #: build/C/man2/bind.2:160
934 msgid "The address is protected, and the user is not the superuser."
935 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
936
937 #. type: TP
938 #: build/C/man2/bind.2:160 build/C/man3/bindresvport.3:79
939 #: build/C/man2/connect.2:146 build/C/man2/listen.2:86
940 #, no-wrap
941 msgid "B<EADDRINUSE>"
942 msgstr "B<EADDRINUSE>"
943
944 #. type: Plain text
945 #: build/C/man2/bind.2:163
946 msgid "The given address is already in use."
947 msgstr "指定されたアドレスが既に使用中である。"
948
949 #. type: Plain text
950 #: build/C/man2/bind.2:167
951 msgid "I<sockfd> is not a valid descriptor."
952 msgstr "I<sockfd> が不正なディスクリプタである。"
953
954 #.  This may change in the future: see
955 #.  .I linux/unix/sock.c for details.
956 #. type: Plain text
957 #: build/C/man2/bind.2:172
958 msgid "The socket is already bound to an address."
959 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
960
961 #. type: Plain text
962 #: build/C/man2/bind.2:176
963 msgid "I<sockfd> is a descriptor for a file, not a socket."
964 msgstr ""
965 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
966
967 #. type: Plain text
968 #: build/C/man2/bind.2:180
969 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
970 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
971
972 #. type: Plain text
973 #: build/C/man2/bind.2:185
974 msgid ""
975 "Search permission is denied on a component of the path prefix.  (See also "
976 "B<path_resolution>(7).)"
977 msgstr ""
978 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
979 "(7)  も参照すること)。"
980
981 #. type: TP
982 #: build/C/man2/bind.2:185
983 #, no-wrap
984 msgid "B<EADDRNOTAVAIL>"
985 msgstr "B<EADDRNOTAVAIL>"
986
987 #. type: Plain text
988 #: build/C/man2/bind.2:189
989 msgid ""
990 "A nonexistent interface was requested or the requested address was not local."
991 msgstr ""
992 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
993 "かった。"
994
995 #. type: Plain text
996 #: build/C/man2/bind.2:193
997 msgid "I<addr> points outside the user's accessible address space."
998 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
999
1000 #. type: Plain text
1001 #: build/C/man2/bind.2:200
1002 msgid ""
1003 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1004 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1005
1006 #. type: TP
1007 #: build/C/man2/bind.2:200
1008 #, no-wrap
1009 msgid "B<ELOOP>"
1010 msgstr "B<ELOOP>"
1011
1012 #. type: Plain text
1013 #: build/C/man2/bind.2:204
1014 msgid "Too many symbolic links were encountered in resolving I<addr>."
1015 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1016
1017 #. type: TP
1018 #: build/C/man2/bind.2:204
1019 #, no-wrap
1020 msgid "B<ENAMETOOLONG>"
1021 msgstr "B<ENAMETOOLONG>"
1022
1023 #. type: Plain text
1024 #: build/C/man2/bind.2:208
1025 msgid "I<addr> is too long."
1026 msgstr "I<addr> が長過ぎる。"
1027
1028 #. type: TP
1029 #: build/C/man2/bind.2:208
1030 #, no-wrap
1031 msgid "B<ENOENT>"
1032 msgstr "B<ENOENT>"
1033
1034 #. type: Plain text
1035 #: build/C/man2/bind.2:211
1036 msgid "The file does not exist."
1037 msgstr "ファイルが存在しない。"
1038
1039 #. type: TP
1040 #: build/C/man2/bind.2:211 build/C/man2/recv.2:427 build/C/man2/select.2:318
1041 #: build/C/man2/send.2:338
1042 #, no-wrap
1043 msgid "B<ENOMEM>"
1044 msgstr "B<ENOMEM>"
1045
1046 #. type: Plain text
1047 #: build/C/man2/bind.2:214
1048 msgid "Insufficient kernel memory was available."
1049 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1050
1051 #. type: TP
1052 #: build/C/man2/bind.2:214
1053 #, no-wrap
1054 msgid "B<ENOTDIR>"
1055 msgstr "B<ENOTDIR>"
1056
1057 #. type: Plain text
1058 #: build/C/man2/bind.2:217
1059 msgid "A component of the path prefix is not a directory."
1060 msgstr "パス名の構成要素がディレクトリではない。"
1061
1062 #. type: TP
1063 #: build/C/man2/bind.2:217
1064 #, no-wrap
1065 msgid "B<EROFS>"
1066 msgstr "B<EROFS>"
1067
1068 #. type: Plain text
1069 #: build/C/man2/bind.2:220
1070 msgid "The socket inode would reside on a read-only file system."
1071 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1072
1073 #.  SVr4 documents an additional
1074 #.  .B ENOSR
1075 #.  general error condition, and
1076 #.  additional
1077 #.  .B EIO
1078 #.  and
1079 #.  .B EISDIR
1080 #.  UNIX-domain error conditions.
1081 #. type: Plain text
1082 #: build/C/man2/bind.2:232
1083 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1084 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1085
1086 #. type: Plain text
1087 #: build/C/man2/bind.2:249
1088 msgid ""
1089 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1090 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1091 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1092 msgstr ""
1093 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1094 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1095 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1096
1097 #. type: SH
1098 #: build/C/man2/bind.2:249 build/C/man2/getsockopt.2:197
1099 #: build/C/man2/select.2:423 build/C/man2/send.2:404
1100 #: build/C/man3/sockatmark.3:91 build/C/man7/socket.7:729
1101 #, no-wrap
1102 msgid "BUGS"
1103 msgstr "バグ"
1104
1105 #.  FIXME What *are* transparent proxy options?
1106 #. type: Plain text
1107 #: build/C/man2/bind.2:252
1108 msgid "The transparent proxy options are not described."
1109 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1110
1111 #. type: Plain text
1112 #: build/C/man2/bind.2:257
1113 msgid ""
1114 "An example of the use of B<bind>()  with Internet domain sockets can be "
1115 "found in B<getaddrinfo>(3)."
1116 msgstr ""
1117 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1118 "(3)  に記載されている。"
1119
1120 #.  listen.7 refers to this example.
1121 #.  accept.7 refers to this example.
1122 #.  unix.7 refers to this example.
1123 #. type: Plain text
1124 #: build/C/man2/bind.2:264
1125 msgid ""
1126 "The following example shows how to bind a stream socket in the UNIX "
1127 "(B<AF_UNIX>)  domain, and accept connections:"
1128 msgstr ""
1129 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1130 "を示したものである。"
1131
1132 #. type: Plain text
1133 #: build/C/man2/bind.2:271
1134 #, no-wrap
1135 msgid ""
1136 "#include E<lt>sys/socket.hE<gt>\n"
1137 "#include E<lt>sys/un.hE<gt>\n"
1138 "#include E<lt>stdlib.hE<gt>\n"
1139 "#include E<lt>stdio.hE<gt>\n"
1140 "#include E<lt>string.hE<gt>\n"
1141 msgstr ""
1142 "#include E<lt>sys/socket.hE<gt>\n"
1143 "#include E<lt>sys/un.hE<gt>\n"
1144 "#include E<lt>stdlib.hE<gt>\n"
1145 "#include E<lt>stdio.hE<gt>\n"
1146 "#include E<lt>string.hE<gt>\n"
1147
1148 #. type: Plain text
1149 #: build/C/man2/bind.2:274
1150 #, no-wrap
1151 msgid ""
1152 "#define MY_SOCK_PATH \"/somepath\"\n"
1153 "#define LISTEN_BACKLOG 50\n"
1154 msgstr ""
1155 "#define MY_SOCK_PATH \"/somepath\"\n"
1156 "#define LISTEN_BACKLOG 50\n"
1157
1158 #. type: Plain text
1159 #: build/C/man2/bind.2:277
1160 #, no-wrap
1161 msgid ""
1162 "#define handle_error(msg) \\e\n"
1163 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1164 msgstr ""
1165 "#define handle_error(msg) \\e\n"
1166 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1167
1168 #. type: Plain text
1169 #: build/C/man2/bind.2:284
1170 #, no-wrap
1171 msgid ""
1172 "int\n"
1173 "main(int argc, char *argv[])\n"
1174 "{\n"
1175 "    int sfd, cfd;\n"
1176 "    struct sockaddr_un my_addr, peer_addr;\n"
1177 "    socklen_t peer_addr_size;\n"
1178 msgstr ""
1179 "int\n"
1180 "main(int argc, char *argv[])\n"
1181 "{\n"
1182 "    int sfd, cfd;\n"
1183 "    struct sockaddr_un my_addr, peer_addr;\n"
1184 "    socklen_t peer_addr_size;\n"
1185
1186 #. type: Plain text
1187 #: build/C/man2/bind.2:288
1188 #, no-wrap
1189 msgid ""
1190 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1191 "    if (sfd == -1)\n"
1192 "        handle_error(\"socket\");\n"
1193 msgstr ""
1194 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1195 "    if (sfd == -1)\n"
1196 "        handle_error(\"socket\");\n"
1197
1198 #. type: Plain text
1199 #: build/C/man2/bind.2:294
1200 #, no-wrap
1201 msgid ""
1202 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1203 "                        /* Clear structure */\n"
1204 "    my_addr.sun_family = AF_UNIX;\n"
1205 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1206 "            sizeof(my_addr.sun_path) - 1);\n"
1207 msgstr ""
1208 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1209 "                        /* Clear structure */\n"
1210 "    my_addr.sun_family = AF_UNIX;\n"
1211 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1212 "            sizeof(my_addr.sun_path) - 1);\n"
1213
1214 #. type: Plain text
1215 #: build/C/man2/bind.2:298
1216 #, no-wrap
1217 msgid ""
1218 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1219 "            sizeof(struct sockaddr_un)) == -1)\n"
1220 "        handle_error(\"bind\");\n"
1221 msgstr ""
1222 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1223 "            sizeof(struct sockaddr_un)) == -1)\n"
1224 "        handle_error(\"bind\");\n"
1225
1226 #. type: Plain text
1227 #: build/C/man2/bind.2:301
1228 #, no-wrap
1229 msgid ""
1230 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1231 "        handle_error(\"listen\");\n"
1232 msgstr ""
1233 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1234 "        handle_error(\"listen\");\n"
1235
1236 #. type: Plain text
1237 #: build/C/man2/bind.2:304
1238 #, no-wrap
1239 msgid ""
1240 "    /* Now we can accept incoming connections one\n"
1241 "       at a time using accept(2) */\n"
1242 msgstr ""
1243 "    /* Now we can accept incoming connections one\n"
1244 "       at a time using accept(2) */\n"
1245
1246 #. type: Plain text
1247 #: build/C/man2/bind.2:310
1248 #, no-wrap
1249 msgid ""
1250 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1251 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1252 "                 &peer_addr_size);\n"
1253 "    if (cfd == -1)\n"
1254 "        handle_error(\"accept\");\n"
1255 msgstr ""
1256 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1257 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1258 "                 &peer_addr_size)\n"
1259 "    if (cfd == -1)\n"
1260 "        handle_error(\"accept\");\n"
1261
1262 #. type: Plain text
1263 #: build/C/man2/bind.2:312
1264 #, no-wrap
1265 msgid "    /* Code to deal with incoming connection(s)... */\n"
1266 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1267
1268 #. type: Plain text
1269 #: build/C/man2/bind.2:316
1270 #, no-wrap
1271 msgid ""
1272 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1273 "       should be deleted using unlink(2) or remove(3) */\n"
1274 "}\n"
1275 msgstr ""
1276 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1277 "       should be deleted using unlink(2) or remove(3) */\n"
1278 "}\n"
1279
1280 #. type: Plain text
1281 #: build/C/man2/bind.2:330
1282 msgid ""
1283 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1284 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1285 "(7), B<socket>(7), B<unix>(7)"
1286 msgstr ""
1287 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1288 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1289 "(7), B<socket>(7), B<unix>(7)"
1290
1291 #. type: TH
1292 #: build/C/man3/bindresvport.3:27
1293 #, no-wrap
1294 msgid "BINDRESVPORT"
1295 msgstr "BINDRESVPORT"
1296
1297 #. type: TH
1298 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
1299 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
1300 #: build/C/man3/sockatmark.3:23
1301 #, no-wrap
1302 msgid "2008-12-03"
1303 msgstr "2008-12-03"
1304
1305 #. type: Plain text
1306 #: build/C/man3/bindresvport.3:30
1307 msgid "bindresvport - bind a socket to a privileged IP port"
1308 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1309
1310 #. type: Plain text
1311 #: build/C/man3/bindresvport.3:34
1312 #, no-wrap
1313 msgid ""
1314 "B<#include E<lt>sys/types.hE<gt>>\n"
1315 "B<#include E<lt>netinet/in.hE<gt>>\n"
1316 msgstr ""
1317 "B<#include E<lt>sys/types.hE<gt>>\n"
1318 "B<#include E<lt>netinet/in.hE<gt>>\n"
1319
1320 #. type: Plain text
1321 #: build/C/man3/bindresvport.3:36
1322 #, no-wrap
1323 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1324 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1325
1326 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1327 #. type: Plain text
1328 #: build/C/man3/bindresvport.3:43
1329 msgid ""
1330 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1331 "anonymous IP port, that is, a port number arbitrarily selected from the "
1332 "range 512 to 1023."
1333 msgstr ""
1334 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1335 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1336 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1337
1338 #. type: Plain text
1339 #: build/C/man3/bindresvport.3:53
1340 msgid ""
1341 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1342 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1343 "allocated."
1344 msgstr ""
1345 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1346 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1347 "される。"
1348
1349 #. type: Plain text
1350 #: build/C/man3/bindresvport.3:64
1351 msgid ""
1352 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1353 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1354 "return the port number actually allocated.  (This information can later be "
1355 "obtained using B<getsockname>(2).)"
1356 msgstr ""
1357 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1358 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1359 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1360 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1361
1362 #. type: Plain text
1363 #: build/C/man3/bindresvport.3:69
1364 msgid ""
1365 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1366 "I<errno> set to indicate the cause of the error."
1367 msgstr ""
1368 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1369 "I<errno> にエラーの原因を示す値を設定する。"
1370
1371 #. type: Plain text
1372 #: build/C/man3/bindresvport.3:74
1373 msgid ""
1374 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1375 "addition, the following errors may occur:"
1376 msgstr ""
1377 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1378 "以下のエラーが発生することがある:"
1379
1380 #. type: Plain text
1381 #: build/C/man3/bindresvport.3:79
1382 msgid ""
1383 "The caller did not have superuser privilege (to be precise: the "
1384 "B<CAP_NET_BIND_SERVICE> capability is required)."
1385 msgstr ""
1386 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1387 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1388
1389 #. type: Plain text
1390 #: build/C/man3/bindresvport.3:82
1391 msgid "All privileged ports are in use."
1392 msgstr "全ての特権ポートが使用中である。"
1393
1394 #. type: TP
1395 #: build/C/man3/bindresvport.3:82
1396 #, no-wrap
1397 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1398 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1399
1400 #. type: Plain text
1401 #: build/C/man3/bindresvport.3:89
1402 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1403 msgstr ""
1404 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1405
1406 #. type: Plain text
1407 #: build/C/man3/bindresvport.3:92
1408 msgid ""
1409 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1410 msgstr ""
1411 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1412
1413 #. type: Plain text
1414 #: build/C/man3/bindresvport.3:98
1415 msgid ""
1416 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1417 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1418 msgstr ""
1419 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1420 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1421
1422 #. type: Plain text
1423 #: build/C/man3/bindresvport.3:101
1424 msgid "B<bind>(2), B<getsockname>(2)"
1425 msgstr "B<bind>(2), B<getsockname>(2)"
1426
1427 #. type: TH
1428 #: build/C/man2/connect.2:65
1429 #, no-wrap
1430 msgid "CONNECT"
1431 msgstr "CONNECT"
1432
1433 #. type: Plain text
1434 #: build/C/man2/connect.2:68
1435 msgid "connect - initiate a connection on a socket"
1436 msgstr "connect - ソケットの接続を行う"
1437
1438 #. type: Plain text
1439 #: build/C/man2/connect.2:71 build/C/man2/getsockopt.2:48
1440 #: build/C/man2/listen.2:49
1441 #, no-wrap
1442 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1443 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1444
1445 #. type: Plain text
1446 #: build/C/man2/connect.2:73 build/C/man2/getsockname.2:44
1447 #: build/C/man2/getsockopt.2:50 build/C/man2/listen.2:51
1448 #: build/C/man2/recv.2:49
1449 #, no-wrap
1450 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1451 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1452
1453 #. type: Plain text
1454 #: build/C/man2/connect.2:76
1455 #, no-wrap
1456 msgid ""
1457 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1458 "B<            socklen_t >I<addrlen>B<);>\n"
1459 msgstr ""
1460 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1461 "B<            socklen_t >I<addrlen>B<);>\n"
1462
1463 #. type: Plain text
1464 #: build/C/man2/connect.2:95
1465 msgid ""
1466 "The B<connect>()  system call connects the socket referred to by the file "
1467 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1468 "argument specifies the size of I<addr>.  The format of the address in "
1469 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1470 "B<socket>(2)  for further details."
1471 msgstr ""
1472 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1473 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1474 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1475 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1476 "こと。"
1477
1478 #. type: Plain text
1479 #: build/C/man2/connect.2:111
1480 msgid ""
1481 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1482 "to which datagrams are sent by default, and the only address from which "
1483 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1484 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1485 "that is bound to the address specified by I<addr>."
1486 msgstr ""
1487 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1488 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1489 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1490 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1491 "に対する接続の 作成を試みる。"
1492
1493 #. type: Plain text
1494 #: build/C/man2/connect.2:125
1495 msgid ""
1496 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1497 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1498 "times to change their association.  Connectionless sockets may dissolve the "
1499 "association by connecting to an address with the I<sa_family> member of "
1500 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1501 msgstr ""
1502 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1503 "()  が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1504 "度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1505 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1506 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1507
1508 #. type: Plain text
1509 #: build/C/man2/connect.2:130
1510 msgid ""
1511 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1512 "returned, and I<errno> is set appropriately."
1513 msgstr ""
1514 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1515 "適切な値を設定する。"
1516
1517 #. type: Plain text
1518 #: build/C/man2/connect.2:133
1519 msgid ""
1520 "The following are general socket errors only.  There may be other domain-"
1521 "specific error codes."
1522 msgstr ""
1523 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1524 "する可能性がある。"
1525
1526 #. type: Plain text
1527 #: build/C/man2/connect.2:141
1528 msgid ""
1529 "For UNIX domain sockets, which are identified by pathname: Write permission "
1530 "is denied on the socket file, or search permission is denied for one of the "
1531 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1532 msgstr ""
1533 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1534 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1535 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1536
1537 #. type: TP
1538 #: build/C/man2/connect.2:141
1539 #, no-wrap
1540 msgid "B<EACCES>, B<EPERM>"
1541 msgstr "B<EACCES>, B<EPERM>"
1542
1543 #. type: Plain text
1544 #: build/C/man2/connect.2:146
1545 msgid ""
1546 "The user tried to connect to a broadcast address without having the socket "
1547 "broadcast flag enabled or the connection request failed because of a local "
1548 "firewall rule."
1549 msgstr ""
1550 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1551 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1552 "要求が失敗した。"
1553
1554 #. type: Plain text
1555 #: build/C/man2/connect.2:149
1556 msgid "Local address is already in use."
1557 msgstr "ローカルアドレスが既に使用されている。"
1558
1559 #. type: TP
1560 #: build/C/man2/connect.2:149 build/C/man2/socket.2:322
1561 #: build/C/man2/socketpair.2:73
1562 #, no-wrap
1563 msgid "B<EAFNOSUPPORT>"
1564 msgstr "B<EAFNOSUPPORT>"
1565
1566 #. type: Plain text
1567 #: build/C/man2/connect.2:154
1568 msgid ""
1569 "The passed address didn't have the correct address family in its "
1570 "I<sa_family> field."
1571 msgstr ""
1572 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1573 "い。"
1574
1575 #. type: TP
1576 #: build/C/man2/connect.2:154
1577 #, no-wrap
1578 msgid "B<EAGAIN>"
1579 msgstr "B<EAGAIN>"
1580
1581 #. type: Plain text
1582 #: build/C/man2/connect.2:163
1583 msgid ""
1584 "No more free local ports or insufficient entries in the routing cache.  For "
1585 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1586 "B<ip>(7)  for information on how to increase the number of local ports."
1587 msgstr ""
1588 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1589 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1590 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1591
1592 #. type: TP
1593 #: build/C/man2/connect.2:163
1594 #, no-wrap
1595 msgid "B<EALREADY>"
1596 msgstr "B<EALREADY>"
1597
1598 #. type: Plain text
1599 #: build/C/man2/connect.2:167
1600 msgid ""
1601 "The socket is nonblocking and a previous connection attempt has not yet been "
1602 "completed."
1603 msgstr ""
1604 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1605
1606 #. type: Plain text
1607 #: build/C/man2/connect.2:170
1608 msgid "The file descriptor is not a valid index in the descriptor table."
1609 msgstr ""
1610 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1611 "い。"
1612
1613 #. type: TP
1614 #: build/C/man2/connect.2:170 build/C/man2/recv.2:410
1615 #, no-wrap
1616 msgid "B<ECONNREFUSED>"
1617 msgstr "B<ECONNREFUSED>"
1618
1619 #. type: Plain text
1620 #: build/C/man2/connect.2:173
1621 msgid "No-one listening on the remote address."
1622 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1623
1624 #. type: Plain text
1625 #: build/C/man2/connect.2:176
1626 msgid "The socket structure address is outside the user's address space."
1627 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1628
1629 #. type: TP
1630 #: build/C/man2/connect.2:176
1631 #, no-wrap
1632 msgid "B<EINPROGRESS>"
1633 msgstr "B<EINPROGRESS>"
1634
1635 #. type: Plain text
1636 #: build/C/man2/connect.2:201
1637 msgid ""
1638 "The socket is nonblocking and the connection cannot be completed "
1639 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1640 "by selecting the socket for writing.  After B<select>(2)  indicates "
1641 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1642 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1643 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1644 "error codes listed here, explaining the reason for the failure)."
1645 msgstr ""
1646 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1647 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1648 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1649 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1650 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1651 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1652 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1653 "の原因が分かる。"
1654
1655 #.  For TCP, the connection will complete asynchronously.
1656 #.  See http://lkml.org/lkml/2005/7/12/254
1657 #. type: Plain text
1658 #: build/C/man2/connect.2:207
1659 msgid ""
1660 "The system call was interrupted by a signal that was caught; see B<signal>"
1661 "(7)."
1662 msgstr ""
1663 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1664
1665 #. type: TP
1666 #: build/C/man2/connect.2:207 build/C/man2/send.2:318
1667 #, no-wrap
1668 msgid "B<EISCONN>"
1669 msgstr "B<EISCONN>"
1670
1671 #. type: Plain text
1672 #: build/C/man2/connect.2:210
1673 msgid "The socket is already connected."
1674 msgstr "ソケットは既に接続 (connect) されている。"
1675
1676 #. type: TP
1677 #: build/C/man2/connect.2:210
1678 #, no-wrap
1679 msgid "B<ENETUNREACH>"
1680 msgstr "B<ENETUNREACH>"
1681
1682 #. type: Plain text
1683 #: build/C/man2/connect.2:213
1684 msgid "Network is unreachable."
1685 msgstr "到達できないネットワークである。"
1686
1687 #. type: Plain text
1688 #: build/C/man2/connect.2:216
1689 msgid "The file descriptor is not associated with a socket."
1690 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1691
1692 #. type: TP
1693 #: build/C/man2/connect.2:216
1694 #, no-wrap
1695 msgid "B<ETIMEDOUT>"
1696 msgstr "B<ETIMEDOUT>"
1697
1698 #. type: Plain text
1699 #: build/C/man2/connect.2:223
1700 msgid ""
1701 "Timeout while attempting connection.  The server may be too busy to accept "
1702 "new connections.  Note that for IP sockets the timeout may be very long when "
1703 "syncookies are enabled on the server."
1704 msgstr ""
1705 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1706 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1707 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1708 "ること。"
1709
1710 #.  SVr4 documents the additional
1711 #.  general error codes
1712 #.  .BR EADDRNOTAVAIL ,
1713 #.  .BR EINVAL ,
1714 #.  .BR EAFNOSUPPORT ,
1715 #.  .BR EALREADY ,
1716 #.  .BR EINTR ,
1717 #.  .BR EPROTOTYPE ,
1718 #.  and
1719 #.  .BR ENOSR .
1720 #.  It also
1721 #.  documents many additional error conditions not described here.
1722 #. type: Plain text
1723 #: build/C/man2/connect.2:239
1724 msgid ""
1725 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1726 "POSIX.1-2001."
1727 msgstr ""
1728 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1729
1730 #. type: Plain text
1731 #: build/C/man2/connect.2:256
1732 msgid ""
1733 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1734 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1735 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1736 msgstr ""
1737 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1738 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1739 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1740
1741 #. type: Plain text
1742 #: build/C/man2/connect.2:261
1743 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1744 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1745
1746 #. type: Plain text
1747 #: build/C/man2/connect.2:268
1748 msgid ""
1749 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1750 "B<path_resolution>(7)"
1751 msgstr ""
1752 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1753 "B<path_resolution>(7)"
1754
1755 #. type: TH
1756 #: build/C/man3/getifaddrs.3:33
1757 #, no-wrap
1758 msgid "GETIFADDRS"
1759 msgstr "GETIFADDRS"
1760
1761 #. type: TH
1762 #: build/C/man3/getifaddrs.3:33
1763 #, no-wrap
1764 msgid "2010-10-06"
1765 msgstr "2010-10-06"
1766
1767 #. type: TH
1768 #: build/C/man3/getifaddrs.3:33
1769 #, no-wrap
1770 msgid "GNU"
1771 msgstr "GNU"
1772
1773 #. type: Plain text
1774 #: build/C/man3/getifaddrs.3:36
1775 msgid "getifaddrs, freeifaddrs - get interface addresses"
1776 msgstr "getifaddrs, freeifaddrs - get interface addresses"
1777
1778 #. type: Plain text
1779 #: build/C/man3/getifaddrs.3:40
1780 #, no-wrap
1781 msgid ""
1782 "B<#include E<lt>sys/types.hE<gt>>\n"
1783 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1784 msgstr ""
1785 "B<#include E<lt>sys/types.hE<gt>>\n"
1786 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1787
1788 #. type: Plain text
1789 #: build/C/man3/getifaddrs.3:42
1790 #, no-wrap
1791 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1792 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1793
1794 #. type: Plain text
1795 #: build/C/man3/getifaddrs.3:44
1796 #, no-wrap
1797 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1798 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1799
1800 #. type: Plain text
1801 #: build/C/man3/getifaddrs.3:55
1802 msgid ""
1803 "The B<getifaddrs>()  function creates a linked list of structures describing "
1804 "the network interfaces of the local system, and stores the address of the "
1805 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1806 "structures, defined as follows:"
1807 msgstr ""
1808 "The B<getifaddrs>()  function creates a linked list of structures describing "
1809 "the network interfaces of the local system, and stores the address of the "
1810 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1811 "structures, defined as follows:"
1812
1813 #. type: Plain text
1814 #: build/C/man3/getifaddrs.3:74
1815 #, no-wrap
1816 msgid ""
1817 "struct ifaddrs {\n"
1818 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1819 "    char            *ifa_name;    /* Name of interface */\n"
1820 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1821 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1822 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1823 "    union {\n"
1824 "        struct sockaddr *ifu_broadaddr;\n"
1825 "                         /* Broadcast address of interface */\n"
1826 "        struct sockaddr *ifu_dstaddr;\n"
1827 "                         /* Point-to-point destination address */\n"
1828 "    } ifa_ifu;\n"
1829 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1830 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1831 "    void            *ifa_data;    /* Address-specific data */\n"
1832 "};\n"
1833 msgstr ""
1834 "struct ifaddrs {\n"
1835 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1836 "    char            *ifa_name;    /* Name of interface */\n"
1837 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1838 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1839 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1840 "    union {\n"
1841 "        struct sockaddr *ifu_broadaddr;\n"
1842 "                         /* Broadcast address of interface */\n"
1843 "        struct sockaddr *ifu_dstaddr;\n"
1844 "                         /* Point-to-point destination address */\n"
1845 "    } ifa_ifu;\n"
1846 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1847 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1848 "    void            *ifa_data;    /* Address-specific data */\n"
1849 "};\n"
1850
1851 #. type: Plain text
1852 #: build/C/man3/getifaddrs.3:81
1853 msgid ""
1854 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1855 "or NULL if this is the last item of the list."
1856 msgstr ""
1857 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1858 "or NULL if this is the last item of the list."
1859
1860 #.  The constant
1861 #.  .B IF NAMESIZE
1862 #.  indicates the maximum length of this field.
1863 #. type: Plain text
1864 #: build/C/man3/getifaddrs.3:88
1865 msgid "The I<ifa_name> points to the null-terminated interface name."
1866 msgstr "The I<ifa_name> points to the null-terminated interface name."
1867
1868 #. type: Plain text
1869 #: build/C/man3/getifaddrs.3:97
1870 msgid ""
1871 "The I<ifa_flags> field contains the interface flags, as returned by the "
1872 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1873 "these flags)."
1874 msgstr ""
1875 "The I<ifa_flags> field contains the interface flags, as returned by the "
1876 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1877 "these flags)."
1878
1879 #. type: Plain text
1880 #: build/C/man3/getifaddrs.3:105
1881 msgid ""
1882 "The I<ifa_addr> field points to a structure containing the interface "
1883 "address.  (The I<sa_family> subfield should be consulted to determine the "
1884 "format of the address structure.)"
1885 msgstr ""
1886 "The I<ifa_addr> field points to a structure containing the interface "
1887 "address.  (The I<sa_family> subfield should be consulted to determine the "
1888 "format of the address structure.)"
1889
1890 #. type: Plain text
1891 #: build/C/man3/getifaddrs.3:111
1892 msgid ""
1893 "The I<ifa_netmask> field points to a structure containing the netmask "
1894 "associated with I<ifa_addr>, if applicable for the address family."
1895 msgstr ""
1896 "The I<ifa_netmask> field points to a structure containing the netmask "
1897 "associated with I<ifa_addr>, if applicable for the address family."
1898
1899 #. type: Plain text
1900 #: build/C/man3/getifaddrs.3:126
1901 msgid ""
1902 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1903 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1904 "will contain the broadcast address associated with I<ifa_addr> (if "
1905 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1906 "destination address of the point-to-point interface."
1907 msgstr ""
1908 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1909 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1910 "will contain the broadcast address associated with I<ifa_addr> (if "
1911 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1912 "destination address of the point-to-point interface."
1913
1914 #. type: Plain text
1915 #: build/C/man3/getifaddrs.3:131
1916 msgid ""
1917 "The I<ifa_data> field points to a buffer containing address-family-specific "
1918 "data; this field may be NULL if there is no such data for this interface."
1919 msgstr ""
1920 "The I<ifa_data> field points to a buffer containing address-family-specific "
1921 "data; this field may be NULL if there is no such data for this interface."
1922
1923 #. type: Plain text
1924 #: build/C/man3/getifaddrs.3:137
1925 msgid ""
1926 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1927 "freed using B<freeifaddrs>()  when no longer needed."
1928 msgstr ""
1929 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1930 "freed using B<freeifaddrs>()  when no longer needed."
1931
1932 #. type: SH
1933 #: build/C/man3/getifaddrs.3:137
1934 #, no-wrap
1935 msgid "RETURN VALUES"
1936 msgstr "RETURN VALUES"
1937
1938 #. type: Plain text
1939 #: build/C/man3/getifaddrs.3:144
1940 msgid ""
1941 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1942 "I<errno> is set appropriately."
1943 msgstr ""
1944 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1945 "I<errno> is set appropriately."
1946
1947 #. type: Plain text
1948 #: build/C/man3/getifaddrs.3:157
1949 msgid ""
1950 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1951 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1952 "(2), B<malloc>(3), or B<realloc>(3)."
1953 msgstr ""
1954 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1955 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1956 "(2), B<malloc>(3), or B<realloc>(3)."
1957
1958 #. type: Plain text
1959 #: build/C/man3/getifaddrs.3:165
1960 msgid ""
1961 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1962 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1963 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1964 "available on kernels that support netlink."
1965 msgstr ""
1966 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1967 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1968 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1969 "available on kernels that support netlink."
1970
1971 #.  , but the BSD-derived documentation generally
1972 #.  appears to be confused and obsolete on this point.
1973 #.  i.e., commonly it still says one of them will be NULL, even if
1974 #.  the ifa_ifu union is already present
1975 #. type: Plain text
1976 #: build/C/man3/getifaddrs.3:185
1977 msgid ""
1978 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1979 "the BSD systems, but with slightly different semantics documented"
1980 "\\(emreturning one entry per interface, not per address.  This means "
1981 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1982 "address, and no link-level address is returned if the interface has an IP "
1983 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1984 "I<ifa_dstaddr> differs on various systems."
1985 msgstr ""
1986 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1987 "the BSD systems, but with slightly different semantics documented"
1988 "\\(emreturning one entry per interface, not per address.  This means "
1989 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1990 "address, and no link-level address is returned if the interface has an IP "
1991 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1992 "I<ifa_dstaddr> differs on various systems."
1993
1994 #. type: Plain text
1995 #: build/C/man3/getifaddrs.3:198
1996 msgid ""
1997 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
1998 "assigned to the interface, but also one B<AF_PACKET> address per interface "
1999 "containing lower-level details about the interface and its physical layer.  "
2000 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2001 "net_device_stats>, defined in I<E<lt>linux/netdevice.hE<gt>>, which contains "
2002 "various interface attributes and statistics."
2003 msgstr ""
2004 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2005 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2006 "containing lower-level details about the interface and its physical layer.  "
2007 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2008 "net_device_stats>, defined in I<E<lt>linux/netdevice.hE<gt>>, which contains "
2009 "various interface attributes and statistics."
2010
2011 #. type: Plain text
2012 #: build/C/man3/getifaddrs.3:205
2013 msgid ""
2014 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2015 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2016 "system:"
2017 msgstr ""
2018 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2019 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2020 "system:"
2021
2022 #. type: Plain text
2023 #: build/C/man3/getifaddrs.3:219
2024 #, no-wrap
2025 msgid ""
2026 "$ B<./a.out>\n"
2027 "lo      address family: 17 (AF_PACKET)\n"
2028 "eth0    address family: 17 (AF_PACKET)\n"
2029 "lo      address family: 2 (AF_INET)\n"
2030 "        address: E<lt>127.0.0.1E<gt>\n"
2031 "eth0    address family: 2 (AF_INET)\n"
2032 "        address: E<lt>10.1.1.4E<gt>\n"
2033 "lo      address family: 10 (AF_INET6)\n"
2034 "        address: E<lt>::1E<gt>\n"
2035 "eth0    address family: 10 (AF_INET6)\n"
2036 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2037 msgstr ""
2038 "$ B<./a.out>\n"
2039 "lo      address family: 17 (AF_PACKET)\n"
2040 "eth0    address family: 17 (AF_PACKET)\n"
2041 "lo      address family: 2 (AF_INET)\n"
2042 "        address: E<lt>127.0.0.1E<gt>\n"
2043 "eth0    address family: 2 (AF_INET)\n"
2044 "        address: E<lt>10.1.1.4E<gt>\n"
2045 "lo      address family: 10 (AF_INET6)\n"
2046 "        address: E<lt>::1E<gt>\n"
2047 "eth0    address family: 10 (AF_INET6)\n"
2048 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2049
2050 #. type: SS
2051 #: build/C/man3/getifaddrs.3:221
2052 #, no-wrap
2053 msgid "Program source"
2054 msgstr "Program source"
2055
2056 #. type: Plain text
2057 #: build/C/man3/getifaddrs.3:231
2058 #, no-wrap
2059 msgid ""
2060 "#include E<lt>arpa/inet.hE<gt>\n"
2061 "#include E<lt>sys/socket.hE<gt>\n"
2062 "#include E<lt>netdb.hE<gt>\n"
2063 "#include E<lt>ifaddrs.hE<gt>\n"
2064 "#include E<lt>stdio.hE<gt>\n"
2065 "#include E<lt>stdlib.hE<gt>\n"
2066 "#include E<lt>unistd.hE<gt>\n"
2067 msgstr ""
2068 "#include E<lt>arpa/inet.hE<gt>\n"
2069 "#include E<lt>sys/socket.hE<gt>\n"
2070 "#include E<lt>netdb.hE<gt>\n"
2071 "#include E<lt>ifaddrs.hE<gt>\n"
2072 "#include E<lt>stdio.hE<gt>\n"
2073 "#include E<lt>stdlib.hE<gt>\n"
2074 "#include E<lt>unistd.hE<gt>\n"
2075
2076 #. type: Plain text
2077 #: build/C/man3/getifaddrs.3:238
2078 #, no-wrap
2079 msgid ""
2080 "int\n"
2081 "main(int argc, char *argv[])\n"
2082 "{\n"
2083 "    struct ifaddrs *ifaddr, *ifa;\n"
2084 "    int family, s;\n"
2085 "    char host[NI_MAXHOST];\n"
2086 msgstr ""
2087 "int\n"
2088 "main(int argc, char *argv[])\n"
2089 "{\n"
2090 "    struct ifaddrs *ifaddr, *ifa;\n"
2091 "    int family, s;\n"
2092 "    char host[NI_MAXHOST];\n"
2093
2094 #. type: Plain text
2095 #: build/C/man3/getifaddrs.3:243
2096 #, no-wrap
2097 msgid ""
2098 "    if (getifaddrs(&ifaddr) == -1) {\n"
2099 "        perror(\"getifaddrs\");\n"
2100 "        exit(EXIT_FAILURE);\n"
2101 "    }\n"
2102 msgstr ""
2103 "    if (getifaddrs(&ifaddr) == -1) {\n"
2104 "        perror(\"getifaddrs\");\n"
2105 "        exit(EXIT_FAILURE);\n"
2106 "    }\n"
2107
2108 #. type: Plain text
2109 #: build/C/man3/getifaddrs.3:246
2110 #, no-wrap
2111 msgid ""
2112 "    /* Walk through linked list, maintaining head pointer so we\n"
2113 "       can free list later */\n"
2114 msgstr ""
2115 "    /* Walk through linked list, maintaining head pointer so we\n"
2116 "       can free list later */\n"
2117
2118 #. type: Plain text
2119 #: build/C/man3/getifaddrs.3:250
2120 #, no-wrap
2121 msgid ""
2122 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2123 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2124 "            continue;\n"
2125 msgstr ""
2126 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2127 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2128 "            continue;\n"
2129
2130 #. type: Plain text
2131 #: build/C/man3/getifaddrs.3:252
2132 #, no-wrap
2133 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2134 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2135
2136 #. type: Plain text
2137 #: build/C/man3/getifaddrs.3:255
2138 #, no-wrap
2139 msgid ""
2140 "        /* Display interface name and family (including symbolic\n"
2141 "           form of the latter for the common families) */\n"
2142 msgstr ""
2143 "        /* Display interface name and family (including symbolic\n"
2144 "           form of the latter for the common families) */\n"
2145
2146 #. type: Plain text
2147 #: build/C/man3/getifaddrs.3:261
2148 #, no-wrap
2149 msgid ""
2150 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2151 "                ifa-E<gt>ifa_name, family,\n"
2152 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2153 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2154 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2155 msgstr ""
2156 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2157 "                ifa-E<gt>ifa_name, family,\n"
2158 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2159 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2160 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2161
2162 #. type: Plain text
2163 #: build/C/man3/getifaddrs.3:263
2164 #, no-wrap
2165 msgid "        /* For an AF_INET* interface address, display the address */\n"
2166 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2167
2168 #. type: Plain text
2169 #: build/C/man3/getifaddrs.3:276
2170 #, no-wrap
2171 msgid ""
2172 "        if (family == AF_INET || family == AF_INET6) {\n"
2173 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2174 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2175 "                                          sizeof(struct sockaddr_in6),\n"
2176 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2177 "            if (s != 0) {\n"
2178 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2179 "                exit(EXIT_FAILURE);\n"
2180 "            }\n"
2181 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2182 "        }\n"
2183 "    }\n"
2184 msgstr ""
2185 "        if (family == AF_INET || family == AF_INET6) {\n"
2186 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2187 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2188 "                                          sizeof(struct sockaddr_in6),\n"
2189 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2190 "            if (s != 0) {\n"
2191 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2192 "                exit(EXIT_FAILURE);\n"
2193 "            }\n"
2194 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2195 "        }\n"
2196 "    }\n"
2197
2198 #. type: Plain text
2199 #: build/C/man3/getifaddrs.3:280
2200 #, no-wrap
2201 msgid ""
2202 "    freeifaddrs(ifaddr);\n"
2203 "    exit(EXIT_SUCCESS);\n"
2204 "}\n"
2205 msgstr ""
2206 "    freeifaddrs(ifaddr);\n"
2207 "    exit(EXIT_SUCCESS);\n"
2208 "}\n"
2209
2210 #. type: Plain text
2211 #: build/C/man3/getifaddrs.3:287
2212 msgid ""
2213 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2214 msgstr ""
2215 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2216
2217 #. type: TH
2218 #: build/C/man2/getsockname.2:38
2219 #, no-wrap
2220 msgid "GETSOCKNAME"
2221 msgstr "GETSOCKNAME"
2222
2223 #. type: Plain text
2224 #: build/C/man2/getsockname.2:41
2225 msgid "getsockname - get socket name"
2226 msgstr "getsockname - ソケットの名前を取得する"
2227
2228 #. type: Plain text
2229 #: build/C/man2/getsockname.2:47
2230 #, no-wrap
2231 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2232 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2233
2234 #. type: Plain text
2235 #: build/C/man2/getsockname.2:60
2236 msgid ""
2237 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2238 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2239 "should be initialized to indicate the amount of space (in bytes) pointed to "
2240 "by I<addr>.  On return it contains the actual size of the socket address."
2241 msgstr ""
2242 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2243 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2244 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2245 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2246 "納される。"
2247
2248 #. type: Plain text
2249 #: build/C/man2/getsockname.2:76 build/C/man2/getsockopt.2:140
2250 #: build/C/man2/listen.2:94
2251 msgid "The argument I<sockfd> is not a valid descriptor."
2252 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2253
2254 #. type: Plain text
2255 #: build/C/man2/getsockname.2:82
2256 msgid ""
2257 "The I<addr> argument points to memory not in a valid part of the process "
2258 "address space."
2259 msgstr ""
2260 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2261 "い。"
2262
2263 #. type: Plain text
2264 #: build/C/man2/getsockname.2:86
2265 msgid "I<addrlen> is invalid (e.g., is negative)."
2266 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2267
2268 #. type: TP
2269 #: build/C/man2/getsockname.2:86 build/C/man2/send.2:330
2270 #, no-wrap
2271 msgid "B<ENOBUFS>"
2272 msgstr "B<ENOBUFS>"
2273
2274 #. type: Plain text
2275 #: build/C/man2/getsockname.2:90
2276 msgid ""
2277 "Insufficient resources were available in the system to perform the operation."
2278 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2279
2280 #. type: Plain text
2281 #: build/C/man2/getsockname.2:95 build/C/man2/getsockopt.2:169
2282 msgid "The argument I<sockfd> is a file, not a socket."
2283 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2284
2285 #.  SVr4 documents additional ENOMEM
2286 #.  and ENOSR error codes.
2287 #. type: Plain text
2288 #: build/C/man2/getsockname.2:101
2289 msgid ""
2290 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2291 "POSIX.1-2001."
2292 msgstr ""
2293 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2294
2295 #. type: Plain text
2296 #: build/C/man2/getsockname.2:110
2297 msgid ""
2298 "The third argument of B<getsockname>()  is in reality an I<int *> (and this "
2299 "is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
2300 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
2301 msgstr ""
2302 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2303 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2304 "POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2305
2306 #. type: Plain text
2307 #: build/C/man2/getsockname.2:117
2308 msgid ""
2309 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2310 "(7)"
2311 msgstr ""
2312 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2313 "(7)"
2314
2315 #. type: TH
2316 #: build/C/man2/getsockopt.2:42
2317 #, no-wrap
2318 msgid "GETSOCKOPT"
2319 msgstr "GETSOCKOPT"
2320
2321 #. type: Plain text
2322 #: build/C/man2/getsockopt.2:45
2323 msgid "getsockopt, setsockopt - get and set options on sockets"
2324 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2325
2326 #. type: Plain text
2327 #: build/C/man2/getsockopt.2:55
2328 #, no-wrap
2329 msgid ""
2330 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2331 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2332 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2333 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2334 msgstr ""
2335 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2336 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2337 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2338 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2339
2340 #. type: Plain text
2341 #: build/C/man2/getsockopt.2:65
2342 msgid ""
2343 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2344 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2345 "protocol levels; they are always present at the uppermost socket level."
2346 msgstr ""
2347 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2348 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2349 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2350 "定される。"
2351
2352 #. type: Plain text
2353 #: build/C/man2/getsockopt.2:84
2354 msgid ""
2355 "When manipulating socket options, the level at which the option resides and "
2356 "the name of the option must be specified.  To manipulate options at the "
2357 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2358 "options at any other level the protocol number of the appropriate protocol "
2359 "controlling the option is supplied.  For example, to indicate that an option "
2360 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2361 "protocol number of B<TCP>; see B<getprotoent>(3)."
2362 msgstr ""
2363 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2364 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2365 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2366 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2367 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2368 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2369 "B<getprotoent>(3)  を参照すること。"
2370
2371 #. type: Plain text
2372 #: build/C/man2/getsockopt.2:106
2373 msgid ""
2374 "The arguments I<optval> and I<optlen> are used to access option values for "
2375 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2376 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2377 "I<optlen> is a value-result argument, initially containing the size of the "
2378 "buffer pointed to by I<optval>, and modified on return to indicate the "
2379 "actual size of the value returned.  If no option value is to be supplied or "
2380 "returned, I<optval> may be NULL."
2381 msgstr ""
2382 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2383 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2384 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2385 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2386 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2387 "I<optval> は NULL でも良い。"
2388
2389 #. type: Plain text
2390 #: build/C/man2/getsockopt.2:116
2391 msgid ""
2392 "I<Optname> and any specified options are passed uninterpreted to the "
2393 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2394 "socket.hE<gt>> contains definitions for socket level options, described "
2395 "below.  Options at other protocol levels vary in format and name; consult "
2396 "the appropriate entries in section 4 of the manual."
2397 msgstr ""
2398 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2399 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2400 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2401 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2402 "ること。"
2403
2404 #. type: Plain text
2405 #: build/C/man2/getsockopt.2:125
2406 msgid ""
2407 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2408 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2409 "or zero if the option is to be disabled."
2410 msgstr ""
2411 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2412 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2413 "を指定し、 無効(disable)にするにはゼロを指定する。"
2414
2415 #. type: Plain text
2416 #: build/C/man2/getsockopt.2:129
2417 msgid ""
2418 "For a description of the available socket options see B<socket>(7)  and the "
2419 "appropriate protocol man pages."
2420 msgstr ""
2421 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2422 "ルの man ページを参照のこと。"
2423
2424 #. type: Plain text
2425 #: build/C/man2/getsockopt.2:150
2426 msgid ""
2427 "The address pointed to by I<optval> is not in a valid part of the process "
2428 "address space.  For B<getsockopt>(), this error may also be returned if "
2429 "I<optlen> is not in a valid part of the process address space."
2430 msgstr ""
2431 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2432 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2433 "い場合にもこのエラーが返される。"
2434
2435 #. type: Plain text
2436 #: build/C/man2/getsockopt.2:161
2437 msgid ""
2438 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2439 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2440 "option described in B<ip>(7))."
2441 msgstr ""
2442 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2443 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2444 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2445
2446 #. type: TP
2447 #: build/C/man2/getsockopt.2:161
2448 #, no-wrap
2449 msgid "B<ENOPROTOOPT>"
2450 msgstr "B<ENOPROTOOPT>"
2451
2452 #. type: Plain text
2453 #: build/C/man2/getsockopt.2:164
2454 msgid "The option is unknown at the level indicated."
2455 msgstr "指定された層(level)にはこのオプションは存在しない。"
2456
2457 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2458 #.  not document the
2459 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2460 #.  options
2461 #. type: Plain text
2462 #: build/C/man2/getsockopt.2:176
2463 msgid ""
2464 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2465 msgstr ""
2466 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2467 "POSIX.1-2001."
2468
2469 #. type: Plain text
2470 #: build/C/man2/getsockopt.2:197
2471 msgid ""
2472 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2473 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2474 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2475 "glibc.  See also B<accept>(2)."
2476 msgstr ""
2477 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2478 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2479 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2480 "る。 B<accept>(2)  も参照のこと。"
2481
2482 #. type: Plain text
2483 #: build/C/man2/getsockopt.2:200
2484 msgid ""
2485 "Several of the socket options should be handled at lower levels of the "
2486 "system."
2487 msgstr ""
2488 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2489
2490 #. type: Plain text
2491 #: build/C/man2/getsockopt.2:208
2492 msgid ""
2493 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2494 "B<tcp>(7), B<unix>(7)"
2495 msgstr ""
2496 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2497 "B<tcp>(7), B<unix>(7)"
2498
2499 #. type: TH
2500 #: build/C/man2/listen.2:43
2501 #, no-wrap
2502 msgid "LISTEN"
2503 msgstr "LISTEN"
2504
2505 #. type: TH
2506 #: build/C/man2/listen.2:43
2507 #, no-wrap
2508 msgid "2008-11-20"
2509 msgstr "2008-11-20"
2510
2511 #. type: Plain text
2512 #: build/C/man2/listen.2:46
2513 msgid "listen - listen for connections on a socket"
2514 msgstr "listen - ソケット(socket)上の接続を待つ"
2515
2516 #. type: Plain text
2517 #: build/C/man2/listen.2:53
2518 #, no-wrap
2519 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2520 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2521
2522 #. type: Plain text
2523 #: build/C/man2/listen.2:61
2524 msgid ""
2525 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2526 "that is, as a socket that will be used to accept incoming connection "
2527 "requests using B<accept>(2)."
2528 msgstr ""
2529 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2530 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2531 "した接続要求を受け付けるのに使用されるソケットである。"
2532
2533 #. type: Plain text
2534 #: build/C/man2/listen.2:68
2535 msgid ""
2536 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2537 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2538 msgstr ""
2539 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2540 "するファイルディスクリプタである。"
2541
2542 #. type: Plain text
2543 #: build/C/man2/listen.2:80
2544 msgid ""
2545 "The I<backlog> argument defines the maximum length to which the queue of "
2546 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2547 "when the queue is full, the client may receive an error with an indication "
2548 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2549 "the request may be ignored so that a later reattempt at connection succeeds."
2550 msgstr ""
2551 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2552 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2553 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2554 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2555 "い。"
2556
2557 #. type: Plain text
2558 #: build/C/man2/listen.2:89
2559 msgid "Another socket is already listening on the same port."
2560 msgstr "別のソケットが既に同じポートを listen している。"
2561
2562 #. type: Plain text
2563 #: build/C/man2/listen.2:99 build/C/man2/send.2:349
2564 msgid "The argument I<sockfd> is not a socket."
2565 msgstr "引き数 I<sockfd> はソケットではない。"
2566
2567 #. type: Plain text
2568 #: build/C/man2/listen.2:104
2569 msgid "The socket is not of a type that supports the B<listen>()  operation."
2570 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2571
2572 #. type: Plain text
2573 #: build/C/man2/listen.2:109
2574 msgid ""
2575 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2576 "4.2BSD."
2577 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2578
2579 #. type: Plain text
2580 #: build/C/man2/listen.2:111
2581 msgid "To accept connections, the following steps are performed:"
2582 msgstr "接続を受け付けるには、以下の処理が実行される。"
2583
2584 #. type: TP
2585 #: build/C/man2/listen.2:112 build/C/man2/select_tut.2:345
2586 #, no-wrap
2587 msgid "1."
2588 msgstr "1."
2589
2590 #. type: Plain text
2591 #: build/C/man2/listen.2:115
2592 msgid "A socket is created with B<socket>(2)."
2593 msgstr "B<socket>(2)  でソケットを作成する。"
2594
2595 #. type: TP
2596 #: build/C/man2/listen.2:115 build/C/man2/select_tut.2:354
2597 #, no-wrap
2598 msgid "2."
2599 msgstr "2."
2600
2601 #. type: Plain text
2602 #: build/C/man2/listen.2:121
2603 msgid ""
2604 "The socket is bound to a local address using B<bind>(2), so that other "
2605 "sockets may be B<connect>(2)ed to it."
2606 msgstr ""
2607 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2608 "のソケットに B<connect>(2)  できるようにする。"
2609
2610 #. type: TP
2611 #: build/C/man2/listen.2:121 build/C/man2/select_tut.2:358
2612 #, no-wrap
2613 msgid "3."
2614 msgstr "3."
2615
2616 #. type: Plain text
2617 #: build/C/man2/listen.2:125
2618 msgid ""
2619 "A willingness to accept incoming connections and a queue limit for incoming "
2620 "connections are specified with B<listen>()."
2621 msgstr ""
2622 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2623 "定する。"
2624
2625 #. type: TP
2626 #: build/C/man2/listen.2:125 build/C/man2/select_tut.2:365
2627 #, no-wrap
2628 msgid "4."
2629 msgstr "4."
2630
2631 #. type: Plain text
2632 #: build/C/man2/listen.2:128
2633 msgid "Connections are accepted with B<accept>(2)."
2634 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2635
2636 #. type: Plain text
2637 #: build/C/man2/listen.2:151
2638 msgid ""
2639 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2640 "2.2.  Now it specifies the queue length for I<completely> established "
2641 "sockets waiting to be accepted, instead of the number of incomplete "
2642 "connection requests.  The maximum length of the queue for incomplete sockets "
2643 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2644 "are enabled there is no logical maximum length and this setting is ignored.  "
2645 "See B<tcp>(7)  for more information."
2646 msgstr ""
2647 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2648 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2649 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2650 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2651 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2652 "論理的な最大長は存在せず、この設定は無視される。"
2653
2654 #.  The following is now rather historic information (MTK, Jun 05)
2655 #.  Don't rely on this value in portable applications since BSD
2656 #.  (and some BSD-derived systems) limit the backlog to 5.
2657 #. type: Plain text
2658 #: build/C/man2/listen.2:164
2659 msgid ""
2660 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2661 "somaxconn>, then it is silently truncated to that value; the default value "
2662 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
2663 "value, B<SOMAXCONN>, with the value 128."
2664 msgstr ""
2665 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2666 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2667 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2668 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2669
2670 #. type: Plain text
2671 #: build/C/man2/listen.2:173
2672 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2673 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2674
2675 #. type: TH
2676 #: build/C/man2/recv.2:39
2677 #, no-wrap
2678 msgid "RECV"
2679 msgstr "RECV"
2680
2681 #. type: TH
2682 #: build/C/man2/recv.2:39
2683 #, no-wrap
2684 msgid "2011-09-16"
2685 msgstr "2011-09-16"
2686
2687 #. type: Plain text
2688 #: build/C/man2/recv.2:42
2689 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
2690 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
2691
2692 #. type: Plain text
2693 #: build/C/man2/recv.2:47 build/C/man2/select.2:53
2694 #: build/C/man2/select_tut.2:45
2695 #, no-wrap
2696 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
2697 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
2698
2699 #. type: Plain text
2700 #: build/C/man2/recv.2:51
2701 #, no-wrap
2702 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2703 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2704
2705 #. type: Plain text
2706 #: build/C/man2/recv.2:54
2707 #, no-wrap
2708 msgid ""
2709 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2710 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2711 msgstr ""
2712 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2713 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2714
2715 #. type: Plain text
2716 #: build/C/man2/recv.2:56
2717 #, no-wrap
2718 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2719 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2720
2721 #. type: Plain text
2722 #: build/C/man2/recv.2:64
2723 msgid ""
2724 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
2725 "a socket, and may be used to receive data on a socket whether or not it is "
2726 "connection-oriented."
2727 msgstr ""
2728 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
2729 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
2730 "接続指向 (connection-oriened) であってもなくてもよい。"
2731
2732 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
2733 #.  .I src_addr
2734 #.  is filled in.
2735 #.  .I src_addr
2736 #.  is also filled in for stream sockets in the UNIX domain, but is not
2737 #.  filled in for stream sockets in the Internet domain.)
2738 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
2739 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
2740 #. type: Plain text
2741 #: build/C/man2/recv.2:93
2742 msgid ""
2743 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
2744 "address, this source address is filled in.  When I<src_addr> is NULL, "
2745 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
2746 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
2747 "caller should initialize before the call to the size of the buffer "
2748 "associated with I<src_addr>, and modified on return to indicate the actual "
2749 "size of the source address.  The returned address is truncated if the buffer "
2750 "provided is too small; in this case, I<addrlen> will return a value greater "
2751 "than was supplied to the call."
2752 msgstr ""
2753 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
2754 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
2755 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
2756 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
2757 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
2758 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
2759 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
2760 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
2761 "な値が返される。"
2762
2763 #. type: Plain text
2764 #: build/C/man2/recv.2:105
2765 msgid ""
2766 "The B<recv>()  call is normally used only on a I<connected> socket (see "
2767 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
2768 "argument."
2769 msgstr ""
2770 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
2771 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
2772 "()  と等価である。"
2773
2774 #. type: Plain text
2775 #: build/C/man2/recv.2:111
2776 msgid ""
2777 "All three routines return the length of the message on successful "
2778 "completion.  If a message is too long to fit in the supplied buffer, excess "
2779 "bytes may be discarded depending on the type of socket the message is "
2780 "received from."
2781 msgstr ""
2782 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
2783 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
2784 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
2785
2786 #. type: Plain text
2787 #: build/C/man2/recv.2:121
2788 msgid ""
2789 "If no messages are available at the socket, the receive calls wait for a "
2790 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
2791 "which case the value -1 is returned and the external variable I<errno> is "
2792 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
2793 "data available, up to the requested amount, rather than waiting for receipt "
2794 "of the full amount requested."
2795 msgstr ""
2796 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
2797 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
2798 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
2799 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
2800 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
2801 "る (受信されるデータの最大サイズは要求したサイズである)。"
2802
2803 #. type: Plain text
2804 #: build/C/man2/recv.2:127
2805 msgid ""
2806 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
2807 "data arrives."
2808 msgstr ""
2809 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
2810 "る。"
2811
2812 #. type: Plain text
2813 #: build/C/man2/recv.2:133
2814 msgid ""
2815 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
2816 "the following values:"
2817 msgstr ""
2818 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
2819 "和 を取ったものを指定する:"
2820
2821 #. type: TP
2822 #: build/C/man2/recv.2:133
2823 #, no-wrap
2824 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
2825 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
2826
2827 #. type: Plain text
2828 #: build/C/man2/recv.2:144
2829 msgid ""
2830 "Set the close-on-exec flag for the file descriptor received via a UNIX "
2831 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
2832 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
2833 "flag of B<open>(2)."
2834 msgstr ""
2835 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
2836 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
2837 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
2838 "同じ理由で有用である。"
2839
2840 #. type: TP
2841 #: build/C/man2/recv.2:144 build/C/man2/send.2:186
2842 #, no-wrap
2843 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
2844 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
2845
2846 #. type: Plain text
2847 #: build/C/man2/recv.2:154
2848 msgid ""
2849 "Enables nonblocking operation; if the operation would block, the call fails "
2850 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
2851 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
2852 msgstr ""
2853 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
2854 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
2855 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
2856
2857 #. type: TP
2858 #: build/C/man2/recv.2:154
2859 #, no-wrap
2860 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
2861 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
2862
2863 #. type: Plain text
2864 #: build/C/man2/recv.2:173
2865 msgid ""
2866 "This flag specifies that queued errors should be received from the socket "
2867 "error queue.  The error is passed in an ancillary message with a type "
2868 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
2869 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
2870 "information.  The payload of the original packet that caused the error is "
2871 "passed as normal data via I<msg_iovec>.  The original destination address of "
2872 "the datagram that caused the error is supplied via I<msg_name>."
2873 msgstr ""
2874 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
2875 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
2876 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
2877 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
2878 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
2879 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
2880 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
2881 "I<msg_name> 経由で参照できる。"
2882
2883 #. type: Plain text
2884 #: build/C/man2/recv.2:185 build/C/man2/recv.2:248
2885 msgid ""
2886 "For local errors, no address is passed (this can be checked with the "
2887 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
2888 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
2889 "the pending socket error is regenerated based on the next queued error and "
2890 "will be passed on the next socket operation."
2891 msgstr ""
2892 "ローカルなエラーの場合はアドレスは渡されない\n"
2893 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
2894 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
2895 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
2896 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
2897
2898 #. type: Plain text
2899 #: build/C/man2/recv.2:189
2900 msgid "The error is supplied in a I<sock_extended_err> structure:"
2901 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
2902
2903 #. type: Plain text
2904 #: build/C/man2/recv.2:196
2905 #, no-wrap
2906 msgid ""
2907 "#define SO_EE_ORIGIN_NONE    0\n"
2908 "#define SO_EE_ORIGIN_LOCAL   1\n"
2909 "#define SO_EE_ORIGIN_ICMP    2\n"
2910 "#define SO_EE_ORIGIN_ICMP6   3\n"
2911 msgstr ""
2912 "#define SO_EE_ORIGIN_NONE    0\n"
2913 "#define SO_EE_ORIGIN_LOCAL   1\n"
2914 "#define SO_EE_ORIGIN_ICMP    2\n"
2915 "#define SO_EE_ORIGIN_ICMP6   3\n"
2916
2917 #. type: Plain text
2918 #: build/C/man2/recv.2:208
2919 #, no-wrap
2920 msgid ""
2921 "struct sock_extended_err\n"
2922 "{\n"
2923 "    uint32_t ee_errno;   /* error number */\n"
2924 "    uint8_t  ee_origin;  /* where the error originated */\n"
2925 "    uint8_t  ee_type;    /* type */\n"
2926 "    uint8_t  ee_code;    /* code */\n"
2927 "    uint8_t  ee_pad;     /* padding */\n"
2928 "    uint32_t ee_info;    /* additional information */\n"
2929 "    uint32_t ee_data;    /* other data */\n"
2930 "    /* More data may follow */\n"
2931 "};\n"
2932 msgstr ""
2933 "struct sock_extended_err\n"
2934 "{\n"
2935 "    uint32_t ee_errno;   /* error number */\n"
2936 "    uint8_t  ee_origin;  /* where the error originated */\n"
2937 "    uint8_t  ee_type;    /* type */\n"
2938 "    uint8_t  ee_code;    /* code */\n"
2939 "    uint8_t  ee_pad;     /* padding */\n"
2940 "    uint32_t ee_info;    /* additional information */\n"
2941 "    uint32_t ee_data;    /* other data */\n"
2942 "    /* More data may follow */\n"
2943 "};\n"
2944
2945 #. type: Plain text
2946 #: build/C/man2/recv.2:210
2947 #, no-wrap
2948 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2949 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2950
2951 #. type: Plain text
2952 #: build/C/man2/recv.2:234
2953 msgid ""
2954 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
2955 "is the origin code of where the error originated.  The other fields are "
2956 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
2957 "address of the network object where the error originated from given a "
2958 "pointer to the ancillary message.  If this address is not known, the "
2959 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
2960 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
2961 "caused the error is passed as normal data."
2962 msgstr ""
2963 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
2964 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
2965 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
2966 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
2967 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
2968 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
2969 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
2970 "される。"
2971
2972 #. type: TP
2973 #: build/C/man2/recv.2:248 build/C/man2/recv.2:379 build/C/man2/send.2:228
2974 #, no-wrap
2975 msgid "B<MSG_OOB>"
2976 msgstr "B<MSG_OOB>"
2977
2978 #. type: Plain text
2979 #: build/C/man2/recv.2:255
2980 msgid ""
2981 "This flag requests receipt of out-of-band data that would not be received in "
2982 "the normal data stream.  Some protocols place expedited data at the head of "
2983 "the normal data queue, and thus this flag cannot be used with such protocols."
2984 msgstr ""
2985 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
2986 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
2987 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
2988 "い。"
2989
2990 #. type: TP
2991 #: build/C/man2/recv.2:255
2992 #, no-wrap
2993 msgid "B<MSG_PEEK>"
2994 msgstr "B<MSG_PEEK>"
2995
2996 #. type: Plain text
2997 #: build/C/man2/recv.2:262
2998 msgid ""
2999 "This flag causes the receive operation to return data from the beginning of "
3000 "the receive queue without removing that data from the queue.  Thus, a "
3001 "subsequent receive call will return the same data."
3002 msgstr ""
3003 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3004 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3005 "が返ることになる。"
3006
3007 #. type: TP
3008 #: build/C/man2/recv.2:262
3009 #, no-wrap
3010 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3011 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3012
3013 #. type: Plain text
3014 #: build/C/man2/recv.2:273
3015 msgid ""
3016 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), and "
3017 "netlink (since Linux 2.6.22) sockets: return the real length of the packet "
3018 "or datagram, even when it was longer than the passed buffer.  Not "
3019 "implemented for UNIX domain (B<unix>(7))  sockets."
3020 msgstr ""
3021 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3022 "以降)、 netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの"
3023 "長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長"
3024 "さを返す。 UNIX ドメインソケット (B<unix>(7))  ソケットについては実装されてい"
3025 "ない。"
3026
3027 #. type: Plain text
3028 #: build/C/man2/recv.2:276
3029 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3030 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3031
3032 #. type: TP
3033 #: build/C/man2/recv.2:276
3034 #, no-wrap
3035 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3036 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3037
3038 #. type: Plain text
3039 #: build/C/man2/recv.2:283
3040 msgid ""
3041 "This flag requests that the operation block until the full request is "
3042 "satisfied.  However, the call may still return less data than requested if a "
3043 "signal is caught, an error or disconnect occurs, or the next data to be "
3044 "received is of a different type than that returned."
3045 msgstr ""
3046 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3047 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3048 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3049 "りデータが少なくても返ることがある。"
3050
3051 #. type: Plain text
3052 #: build/C/man2/recv.2:291
3053 msgid ""
3054 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3055 "directly supplied arguments.  This structure is defined as follows in "
3056 "I<E<lt>sys/socket.hE<gt>>:"
3057 msgstr ""
3058 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3059 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3060
3061 #. type: Plain text
3062 #: build/C/man2/recv.2:298
3063 #, no-wrap
3064 msgid ""
3065 "struct iovec {                    /* Scatter/gather array items */\n"
3066 "    void  *iov_base;              /* Starting address */\n"
3067 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3068 "};\n"
3069 msgstr ""
3070 "struct iovec {                    /* Scatter/gather array items */\n"
3071 "    void  *iov_base;              /* Starting address */\n"
3072 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3073 "};\n"
3074
3075 #. type: Plain text
3076 #: build/C/man2/recv.2:308 build/C/man2/send.2:256
3077 #, no-wrap
3078 msgid ""
3079 "struct msghdr {\n"
3080 "    void         *msg_name;       /* optional address */\n"
3081 "    socklen_t     msg_namelen;    /* size of address */\n"
3082 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3083 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3084 "    void         *msg_control;    /* ancillary data, see below */\n"
3085 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3086 "    int           msg_flags;      /* flags on received message */\n"
3087 "};\n"
3088 msgstr ""
3089 "struct msghdr {\n"
3090 "    void         *msg_name;       /* 追加のアドレス */\n"
3091 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3092 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3093 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3094 "    void         *msg_control;    /* 補助データ (後述) */\n"
3095 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3096 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3097 "};\n"
3098
3099 #. type: Plain text
3100 #: build/C/man2/recv.2:338
3101 msgid ""
3102 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3103 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3104 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3105 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3106 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3107 "other protocol control-related messages or miscellaneous ancillary data.  "
3108 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3109 "the available buffer in I<msg_control>; upon return from a successful call "
3110 "it will contain the length of the control message sequence."
3111 msgstr ""
3112 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3113 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3114 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3115 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3116 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3117 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3118 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3119 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3120 "さが入っている。"
3121
3122 #. type: Plain text
3123 #: build/C/man2/recv.2:340
3124 msgid "The messages are of the form:"
3125 msgstr "メッセージの形式は以下の通り:"
3126
3127 #. type: Plain text
3128 #: build/C/man2/recv.2:350
3129 #, no-wrap
3130 msgid ""
3131 "struct cmsghdr {\n"
3132 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3133 "    int           cmsg_level;   /* originating protocol */\n"
3134 "    int           cmsg_type;    /* protocol-specific type */\n"
3135 "/* followed by\n"
3136 "    unsigned char cmsg_data[]; */\n"
3137 "};\n"
3138 msgstr ""
3139 "struct cmsghdr {\n"
3140 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3141 "    int           cmsg_level;   /* originating protocol */\n"
3142 "    int           cmsg_type;    /* protocol-specific type */\n"
3143 "/* followed by\n"
3144 "    unsigned char cmsg_data[]; */\n"
3145 "};\n"
3146
3147 #. type: Plain text
3148 #: build/C/man2/recv.2:355
3149 msgid ""
3150 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3151 msgstr ""
3152 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3153
3154 #. type: Plain text
3155 #: build/C/man2/recv.2:358
3156 msgid ""
3157 "As an example, Linux uses this ancillary data mechanism to pass extended "
3158 "errors, IP options, or file descriptors over UNIX domain sockets."
3159 msgstr ""
3160 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3161 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3162 "いる。"
3163
3164 #. type: Plain text
3165 #: build/C/man2/recv.2:366
3166 msgid ""
3167 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3168 "It can contain several flags:"
3169 msgstr ""
3170 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3171 "れる。ここにはいくつかのフラグが入る。"
3172
3173 #. type: TP
3174 #: build/C/man2/recv.2:366
3175 #, no-wrap
3176 msgid "B<MSG_EOR>"
3177 msgstr "B<MSG_EOR>"
3178
3179 #. type: Plain text
3180 #: build/C/man2/recv.2:371
3181 msgid ""
3182 "indicates end-of-record; the data returned completed a record (generally "
3183 "used with sockets of type B<SOCK_SEQPACKET>)."
3184 msgstr ""
3185 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3186 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3187
3188 #. type: TP
3189 #: build/C/man2/recv.2:371
3190 #, no-wrap
3191 msgid "B<MSG_TRUNC>"
3192 msgstr "B<MSG_TRUNC>"
3193
3194 #. type: Plain text
3195 #: build/C/man2/recv.2:375
3196 msgid ""
3197 "indicates that the trailing portion of a datagram was discarded because the "
3198 "datagram was larger than the buffer supplied."
3199 msgstr ""
3200 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3201 "た部分が捨てられたことを示す。"
3202
3203 #. type: TP
3204 #: build/C/man2/recv.2:375
3205 #, no-wrap
3206 msgid "B<MSG_CTRUNC>"
3207 msgstr "B<MSG_CTRUNC>"
3208
3209 #. type: Plain text
3210 #: build/C/man2/recv.2:379
3211 msgid ""
3212 "indicates that some control data were discarded due to lack of space in the "
3213 "buffer for ancillary data."
3214 msgstr ""
3215 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3216 "を示す。"
3217
3218 #. type: Plain text
3219 #: build/C/man2/recv.2:382
3220 msgid ""
3221 "is returned to indicate that expedited or out-of-band data were received."
3222 msgstr "速達データや帯域外データを受信したことを示す。"
3223
3224 #. type: TP
3225 #: build/C/man2/recv.2:382
3226 #, no-wrap
3227 msgid "B<MSG_ERRQUEUE>"
3228 msgstr "B<MSG_ERRQUEUE>"
3229
3230 #. type: Plain text
3231 #: build/C/man2/recv.2:386
3232 msgid ""
3233 "indicates that no data was received but an extended error from the socket "
3234 "error queue."
3235 msgstr ""
3236 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3237 "を示す。"
3238
3239 #. type: Plain text
3240 #: build/C/man2/recv.2:391
3241 msgid ""
3242 "These calls return the number of bytes received, or -1 if an error "
3243 "occurred.  The return value will be 0 when the peer has performed an orderly "
3244 "shutdown."
3245 msgstr ""
3246 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3247 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3248
3249 #. type: Plain text
3250 #: build/C/man2/recv.2:396
3251 msgid ""
3252 "These are some standard errors generated by the socket layer.  Additional "
3253 "errors may be generated and returned from the underlying protocol modules; "
3254 "see their manual pages."
3255 msgstr ""
3256 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3257 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3258 "ること。"
3259
3260 #.  Actually EAGAIN on Linux
3261 #. type: Plain text
3262 #: build/C/man2/recv.2:405
3263 msgid ""
3264 "The socket is marked nonblocking and the receive operation would block, or a "
3265 "receive timeout had been set and the timeout expired before data was "
3266 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3267 "and does not require these constants to have the same value, so a portable "
3268 "application should check for both possibilities."
3269 msgstr ""
3270 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3271 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3272 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3273 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3274 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3275
3276 #. type: Plain text
3277 #: build/C/man2/recv.2:410
3278 msgid "The argument I<sockfd> is an invalid descriptor."
3279 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3280
3281 #. type: Plain text
3282 #: build/C/man2/recv.2:414
3283 msgid ""
3284 "A remote host refused to allow the network connection (typically because it "
3285 "is not running the requested service)."
3286 msgstr ""
3287 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3288 "たサービスが起動されていないなどがある)。"
3289
3290 #. type: Plain text
3291 #: build/C/man2/recv.2:418
3292 msgid ""
3293 "The receive buffer pointer(s) point outside the process's address space."
3294 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3295
3296 #. type: Plain text
3297 #: build/C/man2/recv.2:423
3298 msgid ""
3299 "The receive was interrupted by delivery of a signal before any data were "
3300 "available; see B<signal>(7)."
3301 msgstr ""
3302 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3303
3304 #. type: Plain text
3305 #: build/C/man2/recv.2:427 build/C/man2/send.2:318
3306 msgid "Invalid argument passed."
3307 msgstr "不正な引き数が渡された。"
3308
3309 #. type: Plain text
3310 #: build/C/man2/recv.2:431
3311 msgid "Could not allocate memory for B<recvmsg>()."
3312 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3313
3314 #. type: TP
3315 #: build/C/man2/recv.2:431 build/C/man2/send.2:341
3316 #, no-wrap
3317 msgid "B<ENOTCONN>"
3318 msgstr "B<ENOTCONN>"
3319
3320 #. type: Plain text
3321 #: build/C/man2/recv.2:438
3322 msgid ""
3323 "The socket is associated with a connection-oriented protocol and has not "
3324 "been connected (see B<connect>(2)  and B<accept>(2))."
3325 msgstr ""
3326 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3327 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3328
3329 #. type: Plain text
3330 #: build/C/man2/recv.2:443
3331 msgid "The argument I<sockfd> does not refer to a socket."
3332 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3333
3334 #. type: Plain text
3335 #: build/C/man2/recv.2:446
3336 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3337 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3338
3339 #. type: Plain text
3340 #: build/C/man2/recv.2:453
3341 msgid ""
3342 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3343 "flags."
3344 msgstr ""
3345 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3346 "されている。"
3347
3348 #. type: Plain text
3349 #: build/C/man2/recv.2:469
3350 msgid ""
3351 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3352 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3353 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3354 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3355 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3356 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3357 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3358 msgstr ""
3359 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3360 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3361 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3362 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3363 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3364 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3365 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3366
3367 #.  glibc bug raised 12 Mar 2006
3368 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3369 #.  The problem is an underlying kernel issue: the size of the
3370 #.  __kernel_size_t type used to type this field varies
3371 #.  across architectures, but socklen_t is always 32 bits.
3372 #. type: Plain text
3373 #: build/C/man2/recv.2:483 build/C/man2/send.2:404
3374 msgid ""
3375 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3376 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3377 "I<size_t>."
3378 msgstr ""
3379 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3380 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3381 "ある。"
3382
3383 #. type: Plain text
3384 #: build/C/man2/recv.2:488
3385 msgid ""
3386 "See B<recvmmsg(2)> for information about a Linux-specific system call that "
3387 "can be used to receive multiple datagrams in a single call."
3388 msgstr ""
3389 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3390 "固有の システムコールに関する情報が書かれている。"
3391
3392 #. type: Plain text
3393 #: build/C/man2/recv.2:493
3394 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3395 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3396
3397 #. type: Plain text
3398 #: build/C/man2/recv.2:504
3399 msgid ""
3400 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3401 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3402 msgstr ""
3403 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3404 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3405
3406 #. type: TH
3407 #: build/C/man2/recvmmsg.2:24
3408 #, no-wrap
3409 msgid "RECVMMSG"
3410 msgstr "RECVMMSG"
3411
3412 #. type: TH
3413 #: build/C/man2/recvmmsg.2:24
3414 #, no-wrap
3415 msgid "2011-10-04"
3416 msgstr "2011-10-04"
3417
3418 #. type: Plain text
3419 #: build/C/man2/recvmmsg.2:27
3420 msgid "recvmmsg - receive multiple messages on a socket"
3421 msgstr "recvmmsg - receive multiple messages on a socket"
3422
3423 #. type: Plain text
3424 #: build/C/man2/recvmmsg.2:31
3425 #, no-wrap
3426 msgid ""
3427 "B<#define _GNU_SOURCE>\n"
3428 "B<#include E<lt>sys/socket.hE<gt>>\n"
3429 msgstr ""
3430 "B<#define _GNU_SOURCE>\n"
3431 "B<#include E<lt>sys/socket.hE<gt>>\n"
3432
3433 #. type: Plain text
3434 #: build/C/man2/recvmmsg.2:34
3435 #, no-wrap
3436 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3437 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3438
3439 #. type: Plain text
3440 #: build/C/man2/recvmmsg.2:36
3441 #, no-wrap
3442 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3443 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3444
3445 #. type: Plain text
3446 #: build/C/man2/recvmmsg.2:48
3447 msgid ""
3448 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3449 "the caller to receive multiple messages from a socket using a single system "
3450 "call.  (This has performance benefits for some applications.)  A further "
3451 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3452 "operation."
3453 msgstr ""
3454 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3455 "the caller to receive multiple messages from a socket using a single system "
3456 "call.  (This has performance benefits for some applications.)  A further "
3457 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3458 "operation."
3459
3460 #. type: Plain text
3461 #: build/C/man2/recvmmsg.2:52
3462 msgid ""
3463 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3464 "from."
3465 msgstr ""
3466 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3467 "from."
3468
3469 #. type: Plain text
3470 #: build/C/man2/recvmmsg.2:60
3471 msgid ""
3472 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3473 "The size of this array is specified in I<vlen>."
3474 msgstr ""
3475 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3476 "The size of this array is specified in I<vlen>."
3477
3478 #. type: Plain text
3479 #: build/C/man2/recvmmsg.2:66
3480 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3481 msgstr "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3482
3483 #. type: Plain text
3484 #: build/C/man2/recvmmsg.2:73
3485 #, no-wrap
3486 msgid ""
3487 "struct mmsghdr {\n"
3488 "    struct msghdr msg_hdr;  /* Message header */\n"
3489 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3490 "};\n"
3491 msgstr ""
3492 "struct mmsghdr {\n"
3493 "    struct msghdr msg_hdr;  /* Message header */\n"
3494 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3495 "};\n"
3496
3497 #. type: Plain text
3498 #: build/C/man2/recvmmsg.2:88
3499 msgid ""
3500 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3501 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3502 "in the entry.  This field has the same value as the return value of a single "
3503 "B<recvmsg>(2)  on the header."
3504 msgstr ""
3505 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3506 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3507 "in the entry.  This field has the same value as the return value of a single "
3508 "B<recvmsg>(2)  on the header."
3509
3510 #. type: Plain text
3511 #: build/C/man2/recvmmsg.2:95
3512 msgid ""
3513 "The I<flags> argument contains flags ORed together.  The flags are the same "
3514 "as documented for B<recvmsg>(2), with the following addition:"
3515 msgstr ""
3516 "The I<flags> argument contains flags ORed together.  The flags are the same "
3517 "as documented for B<recvmsg>(2), with the following addition:"
3518
3519 #. type: TP
3520 #: build/C/man2/recvmmsg.2:95
3521 #, no-wrap
3522 msgid "B<MSG_WAITFORONE>"
3523 msgstr "B<MSG_WAITFORONE>"
3524
3525 #. type: Plain text
3526 #: build/C/man2/recvmmsg.2:100
3527 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3528 msgstr "Turns on B<MSG_DONTWAIT> after the first message has been received."
3529
3530 #. type: Plain text
3531 #: build/C/man2/recvmmsg.2:113
3532 msgid ""
3533 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3534 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3535 "operation.  If I<timeout> is I<NULL> then the operation blocks indefinitely."
3536 msgstr ""
3537 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3538 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3539 "operation.  If I<timeout> is I<NULL> then the operation blocks indefinitely."
3540
3541 #. type: Plain text
3542 #: build/C/man2/recvmmsg.2:124
3543 msgid ""
3544 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3545 "received or until the timeout expires.  A nonblocking call reads as many "
3546 "messages as are available (up to the limit specified by I<vlen>)  and "
3547 "returns immediately."
3548 msgstr ""
3549 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3550 "received or until the timeout expires.  A nonblocking call reads as many "
3551 "messages as are available (up to the limit specified by I<vlen>)  and "
3552 "returns immediately."
3553
3554 #. type: Plain text
3555 #: build/C/man2/recvmmsg.2:139
3556 msgid ""
3557 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3558 "to contain information about each received message: I<msg_len> contains the "
3559 "size of the received message; the subfields of I<msg_hdr> are updated as "
3560 "described in B<recvmsg>(2).  The return value of the call indicates the "
3561 "number of elements of I<msgvec> that have been updated."
3562 msgstr ""
3563 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3564 "to contain information about each received message: I<msg_len> contains the "
3565 "size of the received message; the subfields of I<msg_hdr> are updated as "
3566 "described in B<recvmsg>(2).  The return value of the call indicates the "
3567 "number of elements of I<msgvec> that have been updated."
3568
3569 #. type: Plain text
3570 #: build/C/man2/recvmmsg.2:147
3571 msgid ""
3572 "On success, B<recvmmsg>()  returns the number of messages received in "
3573 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3574 "error."
3575 msgstr ""
3576 "On success, B<recvmmsg>()  returns the number of messages received in "
3577 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3578 "error."
3579
3580 #. type: Plain text
3581 #: build/C/man2/recvmmsg.2:151
3582 msgid ""
3583 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3584 msgstr ""
3585 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3586
3587 #. type: Plain text
3588 #: build/C/man2/recvmmsg.2:155
3589 msgid "I<timeout> is invalid."
3590 msgstr "I<timeout> is invalid."
3591
3592 #. type: Plain text
3593 #: build/C/man2/recvmmsg.2:160
3594 msgid ""
3595 "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in glibc "
3596 "was added in version 2.12."
3597 msgstr ""
3598 "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in glibc "
3599 "was added in version 2.12."
3600
3601 #. type: Plain text
3602 #: build/C/man2/recvmmsg.2:163
3603 msgid "B<recvmmsg>()  is Linux-specific."
3604 msgstr "B<recvmmsg>()  is Linux-specific."
3605
3606 #. type: Plain text
3607 #: build/C/man2/recvmmsg.2:170
3608 msgid ""
3609 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3610 "(2), B<socket>(7)"
3611 msgstr ""
3612 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3613 "(2), B<socket>(7)"
3614
3615 #. type: TH
3616 #: build/C/man2/select.2:38
3617 #, no-wrap
3618 msgid "SELECT"
3619 msgstr "SELECT"
3620
3621 #. type: TH
3622 #: build/C/man2/select.2:38
3623 #, no-wrap
3624 msgid "2010-08-31"
3625 msgstr "2010-08-31"
3626
3627 #. type: Plain text
3628 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:34
3629 msgid ""
3630 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
3631 "multiplexing"
3632 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
3633
3634 #. type: Plain text
3635 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:37
3636 #, no-wrap
3637 msgid "/* According to POSIX.1-2001 */\n"
3638 msgstr "/* POSIX.1-2001 に従う場合 */\n"
3639
3640 #. type: Plain text
3641 #: build/C/man2/select.2:47 build/C/man2/select.2:68
3642 #: build/C/man2/select_tut.2:39 build/C/man2/select_tut.2:60
3643 #, no-wrap
3644 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
3645 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
3646
3647 #. type: Plain text
3648 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:41
3649 #, no-wrap
3650 msgid "/* According to earlier standards */\n"
3651 msgstr "/* 以前の規格に従う場合 */\n"
3652
3653 #. type: Plain text
3654 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:43
3655 #, no-wrap
3656 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
3657 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
3658
3659 #. type: Plain text
3660 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:47
3661 #, no-wrap
3662 msgid "B<#include E<lt>unistd.hE<gt>>\n"
3663 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
3664
3665 #. type: Plain text
3666 #: build/C/man2/select.2:58
3667 #, no-wrap
3668 msgid ""
3669 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3670 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3671 msgstr ""
3672 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3673 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3674
3675 #. type: Plain text
3676 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:52
3677 #, no-wrap
3678 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3679 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3680
3681 #. type: Plain text
3682 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:54
3683 #, no-wrap
3684 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3685 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3686
3687 #. type: Plain text
3688 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:56
3689 #, no-wrap
3690 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3691 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3692
3693 #. type: Plain text
3694 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:58
3695 #, no-wrap
3696 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3697 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3698
3699 #. type: Plain text
3700 #: build/C/man2/select.2:72
3701 #, no-wrap
3702 msgid ""
3703 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3704 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3705 "B<            const sigset_t *>I<sigmask>B<);>\n"
3706 msgstr ""
3707 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3708 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3709 "B<            const sigset_t *>I<sigmask>B<);>\n"
3710
3711 #. type: Plain text
3712 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:69
3713 #: build/C/man3/sockatmark.3:34
3714 msgid ""
3715 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3716 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3717
3718 #. type: Plain text
3719 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:73
3720 msgid ""
3721 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3722 "600"
3723 msgstr ""
3724 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3725 "600"
3726
3727 #. type: Plain text
3728 #: build/C/man2/select.2:92
3729 msgid ""
3730 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
3731 "descriptors, waiting until one or more of the file descriptors become \"ready"
3732 "\" for some class of I/O operation (e.g., input possible).  A file "
3733 "descriptor is considered ready if it is possible to perform the "
3734 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
3735 msgstr ""
3736 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
3737 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
3738 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
3739 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
3740 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
3741 "意味する。"
3742
3743 #. type: Plain text
3744 #: build/C/man2/select.2:98
3745 msgid ""
3746 "The operation of B<select>()  and B<pselect>()  is identical, with three "
3747 "differences:"
3748 msgstr ""
3749 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
3750
3751 #. type: TP
3752 #: build/C/man2/select.2:98
3753 #, no-wrap
3754 msgid "(i)"
3755 msgstr "(i)"
3756
3757 #. type: Plain text
3758 #: build/C/man2/select.2:108
3759 msgid ""
3760 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
3761 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
3762 "and nanoseconds)."
3763 msgstr ""
3764 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
3765 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
3766 "timespec> (秒・ナノ秒単位) を用いる。"
3767
3768 #. type: TP
3769 #: build/C/man2/select.2:108
3770 #, no-wrap
3771 msgid "(ii)"
3772 msgstr "(ii)"
3773
3774 #. type: Plain text
3775 #: build/C/man2/select.2:116
3776 msgid ""
3777 "B<select>()  may update the I<timeout> argument to indicate how much time "
3778 "was left.  B<pselect>()  does not change this argument."
3779 msgstr ""
3780 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
3781 "B<pselect>()  はこの引き数を変更しない。"
3782
3783 #. type: TP
3784 #: build/C/man2/select.2:116
3785 #, no-wrap
3786 msgid "(iii)"
3787 msgstr "(iii)"
3788
3789 #. type: Plain text
3790 #: build/C/man2/select.2:125
3791 msgid ""
3792 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
3793 "with NULL I<sigmask>."
3794 msgstr ""
3795 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
3796 "指定した場合の B<pselect>()  と同じである。"
3797
3798 #. type: Plain text
3799 #: build/C/man2/select.2:143
3800 msgid ""
3801 "Three independent sets of file descriptors are watched.  Those listed in "
3802 "I<readfds> will be watched to see if characters become available for reading "
3803 "(more precisely, to see if a read will not block; in particular, a file "
3804 "descriptor is also ready on end-of-file), those in I<writefds> will be "
3805 "watched to see if a write will not block, and those in I<exceptfds> will be "
3806 "watched for exceptions.  On exit, the sets are modified in place to indicate "
3807 "which file descriptors actually changed status.  Each of the three file "
3808 "descriptor sets may be specified as NULL if no file descriptors are to be "
3809 "watched for the corresponding class of events."
3810 msgstr ""
3811 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
3812 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
3813 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
3814 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
3815 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
3816 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
3817 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
3818 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
3819 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
3820 "指定することができる。"
3821
3822 #. type: Plain text
3823 #: build/C/man2/select.2:156
3824 msgid ""
3825 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
3826 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
3827 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
3828 "part of the set; this is useful after B<select>()  returns."
3829 msgstr ""
3830 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
3831 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
3832 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
3833 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
3834 "る。"
3835
3836 #. type: Plain text
3837 #: build/C/man2/select.2:159
3838 msgid ""
3839 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
3840 "plus 1."
3841 msgstr ""
3842 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
3843 "のである。"
3844
3845 #. type: Plain text
3846 #: build/C/man2/select.2:175
3847 msgid ""
3848 "I<timeout> is an upper bound on the amount of time elapsed before B<select>"
3849 "()  returns.  If both fields of the I<timeval> structure are zero, then "
3850 "B<select>()  returns immediately.  (This is useful for polling.)  If "
3851 "I<timeout> is NULL (no timeout), B<select>()  can block indefinitely."
3852 msgstr ""
3853 "I<timeout> は B<select>()  が復帰するまでの経過時間の上限である。 I<timeval> "
3854 "構造体の両方のフィールドが 0 の場合、 B<select>()  はすぐに復帰する (この機能"
3855 "はポーリング (polling) を行うのに便利である)。 I<timeout> に NULL (タイムアウ"
3856 "トなし)  が指定されると、 B<select>()  は無期限に停止 (block) する。"
3857
3858 #. type: Plain text
3859 #: build/C/man2/select.2:185
3860 msgid ""
3861 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
3862 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
3863 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
3864 "restores the original signal mask."
3865 msgstr ""
3866 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
3867 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
3868 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
3869 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
3870
3871 #. type: Plain text
3872 #: build/C/man2/select.2:191
3873 msgid ""
3874 "Other than the difference in the precision of the I<timeout> argument, the "
3875 "following B<pselect>()  call:"
3876 msgstr ""
3877 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
3878
3879 #. type: Plain text
3880 #: build/C/man2/select.2:195
3881 #, no-wrap
3882 msgid ""
3883 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3884 "                    timeout, &sigmask);\n"
3885 msgstr ""
3886 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3887 "                    timeout, &sigmask);\n"
3888
3889 #. type: Plain text
3890 #: build/C/man2/select.2:200
3891 msgid "is equivalent to I<atomically> executing the following calls:"
3892 msgstr "次のコールを I<atomic> に実行するのと等価である。"
3893
3894 #. type: Plain text
3895 #: build/C/man2/select.2:203
3896 #, no-wrap
3897 msgid "    sigset_t origmask;\n"
3898 msgstr "    sigset_t origmask;\n"
3899
3900 #. type: Plain text
3901 #: build/C/man2/select.2:207
3902 #, no-wrap
3903 msgid ""
3904 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3905 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3906 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3907 msgstr ""
3908 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3909 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3910 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3911
3912 #. type: Plain text
3913 #: build/C/man2/select.2:228
3914 msgid ""
3915 "The reason that B<pselect>()  is needed is that if one wants to wait for "
3916 "either a signal or for a file descriptor to become ready, then an atomic "
3917 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
3918 "a global flag and returns.  Then a test of this global flag followed by a "
3919 "call of B<select>()  could hang indefinitely if the signal arrived just "
3920 "after the test but just before the call.  By contrast, B<pselect>()  allows "
3921 "one to first block signals, handle the signals that have come in, then call "
3922 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
3923 msgstr ""
3924 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
3925 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
3926 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
3927 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
3928 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
3929 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
3930 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
3931 "で、前記の競合を避けることができる。)"
3932
3933 #. type: SS
3934 #: build/C/man2/select.2:228
3935 #, no-wrap
3936 msgid "The timeout"
3937 msgstr "タイムアウト"
3938
3939 #. type: Plain text
3940 #: build/C/man2/select.2:232
3941 msgid ""
3942 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
3943 "like"
3944 msgstr ""
3945 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
3946
3947 #. type: Plain text
3948 #: build/C/man2/select.2:239
3949 #, no-wrap
3950 msgid ""
3951 "struct timeval {\n"
3952 "    long    tv_sec;         /* seconds */\n"
3953 "    long    tv_usec;        /* microseconds */\n"
3954 "};\n"
3955 msgstr ""
3956 "struct timeval {\n"
3957 "    long    tv_sec;         /* 秒 */\n"
3958 "    long    tv_usec;        /* マイクロ秒 */\n"
3959 "};\n"
3960
3961 #. type: Plain text
3962 #: build/C/man2/select.2:243
3963 msgid "and"
3964 msgstr "や"
3965
3966 #. type: Plain text
3967 #: build/C/man2/select.2:250
3968 #, no-wrap
3969 msgid ""
3970 "struct timespec {\n"
3971 "    long    tv_sec;         /* seconds */\n"
3972 "    long    tv_nsec;        /* nanoseconds */\n"
3973 "};\n"
3974 msgstr ""
3975 "struct timespec {\n"
3976 "    long    tv_sec;         /* 秒 */\n"
3977 "    long    tv_nsec;        /* ナノ秒 */\n"
3978 "};\n"
3979
3980 #. type: Plain text
3981 #: build/C/man2/select.2:254
3982 msgid "(However, see below on the POSIX.1-2001 versions.)"
3983 msgstr ""
3984 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
3985 "照)"
3986
3987 #. type: Plain text
3988 #: build/C/man2/select.2:262
3989 msgid ""
3990 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
3991 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
3992 "precision."
3993 msgstr ""
3994 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
3995 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
3996 "呼び出すという方法を使っているコードもある。"
3997
3998 #.  .PP - it is rumored that:
3999 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4000 #.  - it is certainly true that:
4001 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4002 #. type: Plain text
4003 #: build/C/man2/select.2:285
4004 msgid ""
4005 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4006 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4007 "either behavior.)  This causes problems both when Linux code which reads "
4008 "I<timeout> is ported to other operating systems, and when code is ported to "
4009 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4010 "without reinitializing it.  Consider I<timeout> to be undefined after "
4011 "B<select>()  returns."
4012 msgstr ""
4013 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4014 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4015 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4016 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4017 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4018 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4019 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4020 "ある。"
4021
4022 #. type: Plain text
4023 #: build/C/man2/select.2:302
4024 msgid ""
4025 "On success, B<select>()  and B<pselect>()  return the number of file "
4026 "descriptors contained in the three returned descriptor sets (that is, the "
4027 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4028 "which may be zero if the timeout expires before anything interesting "
4029 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4030 "sets and I<timeout> become undefined, so do not rely on their contents after "
4031 "an error."
4032 msgstr ""
4033 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4034 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4035 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4036 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4037 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4038 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4039
4040 #. type: Plain text
4041 #: build/C/man2/select.2:308
4042 msgid ""
4043 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4044 "descriptor that was already closed, or one on which an error has occurred.)"
4045 msgstr ""
4046 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4047 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4048 "タが指定された)。"
4049
4050 #. type: Plain text
4051 #: build/C/man2/select.2:312
4052 msgid "A signal was caught; see B<signal>(7)."
4053 msgstr "シグナルを受信した。"
4054
4055 #. type: Plain text
4056 #: build/C/man2/select.2:318
4057 msgid ""
4058 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4059 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4060
4061 #. type: Plain text
4062 #: build/C/man2/select.2:321
4063 msgid "unable to allocate memory for internal tables."
4064 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4065
4066 #. type: Plain text
4067 #: build/C/man2/select.2:327
4068 msgid ""
4069 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4070 "()  was emulated in glibc (but see BUGS)."
4071 msgstr ""
4072 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4073 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4074
4075 #. type: Plain text
4076 #: build/C/man2/select.2:338
4077 msgid ""
4078 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4079 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4080 "clones of the BSD socket layer (including System V variants).  However, note "
4081 "that the System V variant typically sets the timeout variable before exit, "
4082 "but the BSD variant does not."
4083 msgstr ""
4084 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4085 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4086 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4087 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4088 "ること。"
4089
4090 #. type: Plain text
4091 #: build/C/man2/select.2:342
4092 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4093 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4094
4095 #. type: Plain text
4096 #: build/C/man2/select.2:359
4097 msgid ""
4098 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4099 "with a value of I<fd> that is negative or is equal to or larger than "
4100 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4101 "I<fd> to be a valid file descriptor."
4102 msgstr ""
4103 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4104 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4105 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4106 "プタでなければならないと規定されている。"
4107
4108 #. type: Plain text
4109 #: build/C/man2/select.2:368
4110 msgid ""
4111 "Concerning the types involved, the classical situation is that the two "
4112 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4113 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4114 "situation is"
4115 msgstr ""
4116 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4117 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4118 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4119
4120 #. type: Plain text
4121 #: build/C/man2/select.2:375
4122 #, no-wrap
4123 msgid ""
4124 "struct timeval {\n"
4125 "    time_t         tv_sec;     /* seconds */\n"
4126 "    suseconds_t    tv_usec;    /* microseconds */\n"
4127 "};\n"
4128 msgstr ""
4129 "struct timeval {\n"
4130 "\t time_t         tv_sec;     /* 秒 */\n"
4131 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4132 "};\n"
4133
4134 #. type: Plain text
4135 #: build/C/man2/select.2:386
4136 msgid ""
4137 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4138 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4139 msgstr ""
4140 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4141 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4142
4143 #. type: Plain text
4144 #: build/C/man2/select.2:398
4145 msgid ""
4146 "Concerning prototypes, the classical situation is that one should include "
4147 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4148 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4149 msgstr ""
4150 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4151 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4152 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4153 "インクルードすればよい。"
4154
4155 #. type: Plain text
4156 #: build/C/man2/select.2:410
4157 msgid ""
4158 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4159 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4160 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4161 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4162 "requirements are as shown in the SYNOPSIS."
4163 msgstr ""
4164 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4165 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4166 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4167 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4168 "使用するには、「書式」に記載された要件を満たす必要がある。"
4169
4170 #. type: SS
4171 #: build/C/man2/select.2:410
4172 #, no-wrap
4173 msgid "Linux Notes"
4174 msgstr "Linux での注意"
4175
4176 #. type: Plain text
4177 #: build/C/man2/select.2:423
4178 msgid ""
4179 "The Linux B<pselect>()  system call modifies its I<timeout> argument.  "
4180 "However, the glibc wrapper function hides this behavior by using a local "
4181 "variable for the timeout argument that is passed to the system call.  Thus, "
4182 "the glibc B<pselect>()  function does not modify its timeout argument; this "
4183 "is the behavior required by POSIX.1-2001."
4184 msgstr ""
4185 "Linux の B<pselect>()  システムコールは I<timeout> 引き数を変更する。 しか"
4186 "し、 glibc のラッパー関数は、システムコールに渡す timeout 引き数 としてローカ"
4187 "ル変数を使うことでこの動作を隠蔽している。 このため、glibc の B<pselect>()  "
4188 "関数は timeout 引き数を変更しない。 これが POSIX.1-2001 が要求している動作で"
4189 "ある。"
4190
4191 #. type: Plain text
4192 #: build/C/man2/select.2:429
4193 msgid ""
4194 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4195 "argument."
4196 msgstr ""
4197 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4198 "されていた。"
4199
4200 #. type: Plain text
4201 #: build/C/man2/select.2:442
4202 msgid ""
4203 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4204 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4205 "implementation remained vulnerable to the very race condition that B<pselect>"
4206 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4207 "B<pselect>()  system call on kernels where it is provided."
4208 msgstr ""
4209 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4210 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4211 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4212 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4213 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4214 "が使用される。"
4215
4216 #. type: Plain text
4217 #: build/C/man2/select.2:451
4218 msgid ""
4219 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4220 "trapping can be achieved using the self-pipe trick (where a signal handler "
4221 "writes a byte to a pipe whose other end is monitored by B<select>()  in the "
4222 "main program.)"
4223 msgstr ""
4224 "B<pselect>()  がないシステムにおいて、 シグナルの捕捉を信頼性があり (移植性も"
4225 "高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい (シグナル"
4226 "ハンドラはパイプへ 1 バイトのデータを書き込み、同じパイプのもう一端をメインプ"
4227 "ログラムの B<select>()  で監視するという方法である)。"
4228
4229 #.  Stevens discusses a case where accept can block after select
4230 #.  returns successfully because of an intervening RST from the client.
4231 #.  Maybe the kernel should have returned EIO in such a situation?
4232 #. type: Plain text
4233 #: build/C/man2/select.2:467
4234 msgid ""
4235 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4236 "reading\", while nevertheless a subsequent read blocks.  This could for "
4237 "example happen when data has arrived but upon examination has wrong checksum "
4238 "and is discarded.  There may be other circumstances in which a file "
4239 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4240 "B<O_NONBLOCK> on sockets that should not block."
4241 msgstr ""
4242 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4243 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4244 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4245 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4246 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4247 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4248
4249 #. type: Plain text
4250 #: build/C/man2/select.2:482
4251 msgid ""
4252 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4253 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4254 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4255 "behavior, but the glibc wrapper hides this behavior by internally copying "
4256 "the I<timeout> to a local variable and passing that variable to the system "
4257 "call."
4258 msgstr ""
4259 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4260 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4261 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4262 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4263 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4264 "数をシステムコールに渡している。"
4265
4266 #. type: Plain text
4267 #: build/C/man2/select.2:489
4268 #, no-wrap
4269 msgid ""
4270 "#include E<lt>stdio.hE<gt>\n"
4271 "#include E<lt>stdlib.hE<gt>\n"
4272 "#include E<lt>sys/time.hE<gt>\n"
4273 "#include E<lt>sys/types.hE<gt>\n"
4274 "#include E<lt>unistd.hE<gt>\n"
4275 msgstr ""
4276 "#include E<lt>stdio.hE<gt>\n"
4277 "#include E<lt>stdlib.hE<gt>\n"
4278 "#include E<lt>sys/time.hE<gt>\n"
4279 "#include E<lt>sys/types.hE<gt>\n"
4280 "#include E<lt>unistd.hE<gt>\n"
4281
4282 #. type: Plain text
4283 #: build/C/man2/select.2:496
4284 #, no-wrap
4285 msgid ""
4286 "int\n"
4287 "main(void)\n"
4288 "{\n"
4289 "    fd_set rfds;\n"
4290 "    struct timeval tv;\n"
4291 "    int retval;\n"
4292 msgstr ""
4293 "int\n"
4294 "main(void)\n"
4295 "{\n"
4296 "    fd_set rfds;\n"
4297 "    struct timeval tv;\n"
4298 "    int retval;\n"
4299
4300 #. type: Plain text
4301 #: build/C/man2/select.2:500
4302 #, no-wrap
4303 msgid ""
4304 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4305 "    FD_ZERO(&rfds);\n"
4306 "    FD_SET(0, &rfds);\n"
4307 msgstr ""
4308 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4309 "    FD_ZERO(&rfds);\n"
4310 "    FD_SET(0, &rfds);\n"
4311
4312 #. type: Plain text
4313 #: build/C/man2/select.2:504
4314 #, no-wrap
4315 msgid ""
4316 "    /* Wait up to five seconds. */\n"
4317 "    tv.tv_sec = 5;\n"
4318 "    tv.tv_usec = 0;\n"
4319 msgstr ""
4320 "    /* 5 秒間監視する。*/\n"
4321 "    tv.tv_sec = 5;\n"
4322 "    tv.tv_usec = 0;\n"
4323
4324 #. type: Plain text
4325 #: build/C/man2/select.2:507
4326 #, no-wrap
4327 msgid ""
4328 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4329 "    /* Don't rely on the value of tv now! */\n"
4330 msgstr ""
4331 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4332 "    /* この時点での tv の値を信頼してはならない。*/\n"
4333
4334 #. type: Plain text
4335 #: build/C/man2/select.2:515
4336 #, no-wrap
4337 msgid ""
4338 "    if (retval == -1)\n"
4339 "        perror(\"select()\");\n"
4340 "    else if (retval)\n"
4341 "        printf(\"Data is available now.\\en\");\n"
4342 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4343 "    else\n"
4344 "        printf(\"No data within five seconds.\\en\");\n"
4345 msgstr ""
4346 "    if (retval == -1)\n"
4347 "\tperror(\"select()\");\n"
4348 "    else if (retval)\n"
4349 "        printf(\"今、データが取得できました。\\en\");\n"
4350 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4351 "    else\n"
4352 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4353
4354 #. type: Plain text
4355 #: build/C/man2/select.2:518
4356 #, no-wrap
4357 msgid ""
4358 "    exit(EXIT_SUCCESS);\n"
4359 "}\n"
4360 msgstr ""
4361 "    exit(EXIT_SUCCESS);\n"
4362 "}\n"
4363
4364 #. type: Plain text
4365 #: build/C/man2/select.2:522
4366 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4367 msgstr ""
4368 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
4369
4370 #. type: Plain text
4371 #: build/C/man2/select.2:534
4372 msgid ""
4373 "For vaguely related stuff, see B<accept>(2), B<connect>(2), B<poll>(2), "
4374 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4375 "(7), B<time>(7)"
4376 msgstr ""
4377 "関係がありそうなものを挙げておく: B<accept>(2), B<connect>(2), B<poll>(2), "
4378 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4379 "(7), B<time>(7)"
4380
4381 #. type: TH
4382 #: build/C/man2/select_tut.2:30
4383 #, no-wrap
4384 msgid "SELECT_TUT"
4385 msgstr "SELECT_TUT"
4386
4387 #. type: TH
4388 #: build/C/man2/select_tut.2:30
4389 #, no-wrap
4390 msgid "2010-06-10"
4391 msgstr "2010-06-10"
4392
4393 #. type: Plain text
4394 #: build/C/man2/select_tut.2:50
4395 #, no-wrap
4396 msgid ""
4397 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4398 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4399 msgstr ""
4400 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4401 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4402
4403 #. type: Plain text
4404 #: build/C/man2/select_tut.2:64
4405 #, no-wrap
4406 msgid ""
4407 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4408 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4409 "B<            const sigset_t *>I<sigmask>B<);>\n"
4410 msgstr ""
4411 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4412 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4413 "B<            const sigset_t *>I<sigmask>B<);>\n"
4414
4415 #. type: Plain text
4416 #: build/C/man2/select_tut.2:81
4417 msgid ""
4418 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
4419 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
4420 "see whether I/O becomes possible, or an \"exceptional condition\" has "
4421 "occurred on any of the descriptors."
4422 msgstr ""
4423 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
4424 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
4425 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
4426 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
4427 "る。"
4428
4429 #. type: Plain text
4430 #: build/C/man2/select_tut.2:106
4431 msgid ""
4432 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
4433 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
4434 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
4435 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
4436 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
4437 "according to the rules described below; after calling B<select>()  you can "
4438 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
4439 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
4440 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
4441 "descriptor from a set."
4442 msgstr ""
4443 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
4444 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
4445 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
4446 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
4447 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
4448 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
4449 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
4450 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
4451 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
4452 "のファイルディスクリプタの削除を行う。"
4453
4454 #. type: SS
4455 #: build/C/man2/select_tut.2:106
4456 #, no-wrap
4457 msgid "Arguments"
4458 msgstr "引き数"
4459
4460 #. type: TP
4461 #: build/C/man2/select_tut.2:107
4462 #, no-wrap
4463 msgid "I<readfds>"
4464 msgstr "I<readfds>"
4465
4466 #. type: Plain text
4467 #: build/C/man2/select_tut.2:116
4468 msgid ""
4469 "This set is watched to see if data is available for reading from any of its "
4470 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
4471 "cleared of all file descriptors except for those that are immediately "
4472 "available for reading."
4473 msgstr ""
4474 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
4475 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
4476 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
4477
4478 #. type: TP
4479 #: build/C/man2/select_tut.2:116
4480 #, no-wrap
4481 msgid "I<writefds>"
4482 msgstr "I<writefds>"
4483
4484 #. type: Plain text
4485 #: build/C/man2/select_tut.2:125
4486 msgid ""
4487 "This set is watched to see if there is space to write data to any of its "
4488 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
4489 "cleared of all file descriptors except for those that are immediately "
4490 "available for writing."
4491 msgstr ""
4492 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
4493 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
4494 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
4495
4496 #. type: TP
4497 #: build/C/man2/select_tut.2:125
4498 #, no-wrap
4499 msgid "I<exceptfds>"
4500 msgstr "I<exceptfds>"
4501
4502 #. type: Plain text
4503 #: build/C/man2/select_tut.2:147
4504 msgid ""
4505 "This set is watched for \"exceptional conditions\".  In practice, only one "
4506 "such exceptional condition is common: the availability of I<out-of-band> "
4507 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
4508 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
4509 "where B<select>(2)  indicates an exceptional condition occurs with "
4510 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
4511 "has returned, I<exceptfds> will be cleared of all file descriptors except "
4512 "for those for which an exceptional condition has occurred."
4513 msgstr ""
4514 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
4515 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
4516 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
4517 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
4518 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
4519 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
4520 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
4521 "状態が発生したディスクリプタ以外は集合から削除される。"
4522
4523 #. type: TP
4524 #: build/C/man2/select_tut.2:147
4525 #, no-wrap
4526 msgid "I<nfds>"
4527 msgstr "I<nfds>"
4528
4529 #. type: Plain text
4530 #: build/C/man2/select_tut.2:154
4531 msgid ""
4532 "This is an integer one more than the maximum of any file descriptor in any "
4533 "of the sets.  In other words, while adding file descriptors to each of the "
4534 "sets, you must calculate the maximum integer value of all of them, then "
4535 "increment this value by one, and then pass this as I<nfds>."
4536 msgstr ""
4537 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
4538 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
4539 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
4540 "I<nfds> として渡さないといけない、ということだ。"
4541
4542 #. type: TP
4543 #: build/C/man2/select_tut.2:154
4544 #, no-wrap
4545 msgid "I<utimeout>"
4546 msgstr "I<utimeout>"
4547
4548 #. type: Plain text
4549 #: build/C/man2/select_tut.2:167
4550 msgid ""
4551 "This is the longest time B<select>()  may wait before returning, even if "
4552 "nothing interesting happened.  If this value is passed as NULL, then "
4553 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
4554 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
4555 "return immediately, with information about the readiness of file descriptors "
4556 "at the time of the call.  The structure I<struct timeval> is defined as:"
4557 msgstr ""
4558 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
4559 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
4560 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
4561 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
4562 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
4563 "ように定義されている:"
4564
4565 #. type: Plain text
4566 #: build/C/man2/select_tut.2:174
4567 #, no-wrap
4568 msgid ""
4569 "struct timeval {\n"
4570 "    time_t tv_sec;    /* seconds */\n"
4571 "    long tv_usec;     /* microseconds */\n"
4572 "};\n"
4573 msgstr ""
4574 "struct timeval {\n"
4575 "    time_t tv_sec;    /* seconds */\n"
4576 "    long tv_usec;     /* microseconds */\n"
4577 "};\n"
4578
4579 #. type: TP
4580 #: build/C/man2/select_tut.2:176
4581 #, no-wrap
4582 msgid "I<ntimeout>"
4583 msgstr "I<ntimeout>"
4584
4585 #. type: Plain text
4586 #: build/C/man2/select_tut.2:185
4587 msgid ""
4588 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
4589 "I<struct timespec> has nanosecond precision as follows:"
4590 msgstr ""
4591 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
4592 "timespec> は次に示すようにナノ秒の精度を持つ。"
4593
4594 #. type: Plain text
4595 #: build/C/man2/select_tut.2:192
4596 #, no-wrap
4597 msgid ""
4598 "struct timespec {\n"
4599 "    long tv_sec;    /* seconds */\n"
4600 "    long tv_nsec;   /* nanoseconds */\n"
4601 "};\n"
4602 msgstr ""
4603 "struct timespec {\n"
4604 "    long tv_sec;    /* seconds */\n"
4605 "    long tv_nsec;   /* nanoseconds */\n"
4606 "};\n"
4607
4608 #. type: TP
4609 #: build/C/man2/select_tut.2:194
4610 #, no-wrap
4611 msgid "I<sigmask>"
4612 msgstr "I<sigmask>"
4613
4614 #. type: Plain text
4615 #: build/C/man2/select_tut.2:211
4616 msgid ""
4617 "This argument holds a set of signals that the kernel should unblock (i.e., "
4618 "remove from the signal mask of the calling thread), while the caller is "
4619 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
4620 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
4621 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
4622 "()  will then behave just like B<select>()."
4623 msgstr ""
4624 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
4625 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
4626 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
4627 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
4628 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
4629 "()  と全く同じ動作となる。"
4630
4631 #. type: SS
4632 #: build/C/man2/select_tut.2:211
4633 #, no-wrap
4634 msgid "Combining Signal and Data Events"
4635 msgstr "シグナルとデータイベントを組み合わせる"
4636
4637 #. type: Plain text
4638 #: build/C/man2/select_tut.2:255
4639 msgid ""
4640 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
4641 "descriptor(s) to become ready for I/O.  Programs that receive signals "
4642 "normally use the signal handler only to raise a global flag.  The global "
4643 "flag will indicate that the event must be processed in the main loop of the "
4644 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
4645 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
4646 "signals can be processed in the main loop of the program, otherwise B<select>"
4647 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
4648 "conditional to check the global flag.  So we must ask: what if a signal "
4649 "arrives after the conditional, but before the B<select>()  call? The answer "
4650 "is that B<select>()  would block indefinitely, even though an event is "
4651 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
4652 "This call can be used to set the signal mask to a set of signals that are "
4653 "only to be received within the B<pselect>()  call.  For instance, let us say "
4654 "that the event in question was the exit of a child process.  Before the "
4655 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
4656 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
4657 "mask.  Our program would look like:"
4658 msgstr ""
4659 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
4660 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
4661 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
4662 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
4663 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
4664 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
4665 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
4666 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
4667 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
4668 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
4669 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
4670 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
4671 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
4672 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
4673 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
4674 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
4675 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
4676 "る。"
4677
4678 #. type: Plain text
4679 #: build/C/man2/select_tut.2:258
4680 #, no-wrap
4681 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4682 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4683
4684 #. type: Plain text
4685 #: build/C/man2/select_tut.2:264
4686 #, no-wrap
4687 msgid ""
4688 "static void\n"
4689 "child_sig_handler(int sig)\n"
4690 "{\n"
4691 "    got_SIGCHLD = 1;\n"
4692 "}\n"
4693 msgstr ""
4694 "static void\n"
4695 "child_sig_handler(int sig)\n"
4696 "{\n"
4697 "    got_SIGCHLD = 1;\n"
4698 "}\n"
4699
4700 #. type: Plain text
4701 #: build/C/man2/select_tut.2:272
4702 #, no-wrap
4703 msgid ""
4704 "int\n"
4705 "main(int argc, char *argv[])\n"
4706 "{\n"
4707 "    sigset_t sigmask, empty_mask;\n"
4708 "    struct sigaction sa;\n"
4709 "    fd_set readfds, writefds, exceptfds;\n"
4710 "    int r;\n"
4711 msgstr ""
4712 "int\n"
4713 "main(int argc, char *argv[])\n"
4714 "{\n"
4715 "    sigset_t sigmask, empty_mask;\n"
4716 "    struct sigaction sa;\n"
4717 "    fd_set readfds, writefds, exceptfds;\n"
4718 "    int r;\n"
4719
4720 #. type: Plain text
4721 #: build/C/man2/select_tut.2:279
4722 #, no-wrap
4723 msgid ""
4724 "    sigemptyset(&sigmask);\n"
4725 "    sigaddset(&sigmask, SIGCHLD);\n"
4726 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4727 "        perror(\"sigprocmask\");\n"
4728 "        exit(EXIT_FAILURE);\n"
4729 "    }\n"
4730 msgstr ""
4731 "    sigemptyset(&sigmask);\n"
4732 "    sigaddset(&sigmask, SIGCHLD);\n"
4733 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4734 "        perror(\"sigprocmask\");\n"
4735 "        exit(EXIT_FAILURE);\n"
4736 "    }\n"
4737
4738 #. type: Plain text
4739 #: build/C/man2/select_tut.2:287
4740 #, no-wrap
4741 msgid ""
4742 "    sa.sa_flags = 0;\n"
4743 "    sa.sa_handler = child_sig_handler;\n"
4744 "    sigemptyset(&sa.sa_mask);\n"
4745 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4746 "        perror(\"sigaction\");\n"
4747 "        exit(EXIT_FAILURE);\n"
4748 "    }\n"
4749 msgstr ""
4750 "    sa.sa_flags = 0;\n"
4751 "    sa.sa_handler = child_sig_handler;\n"
4752 "    sigemptyset(&sa.sa_mask);\n"
4753 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4754 "        perror(\"sigaction\");\n"
4755 "        exit(EXIT_FAILURE);\n"
4756 "    }\n"
4757
4758 #. type: Plain text
4759 #: build/C/man2/select_tut.2:289
4760 #, no-wrap
4761 msgid "    sigemptyset(&empty_mask);\n"
4762 msgstr "    sigemptyset(&empty_mask);\n"
4763
4764 #. type: Plain text
4765 #: build/C/man2/select_tut.2:293
4766 #, no-wrap
4767 msgid ""
4768 "    for (;;) {          /* main loop */\n"
4769 "        /* Initialize readfds, writefds, and exceptfds\n"
4770 "           before the pselect() call. (Code omitted.) */\n"
4771 msgstr ""
4772 "    for (;;) {          /* main loop */\n"
4773 "        /* Initialize readfds, writefds, and exceptfds\n"
4774 "           before the pselect() call. (Code omitted.) */\n"
4775
4776 #. type: Plain text
4777 #: build/C/man2/select_tut.2:299
4778 #, no-wrap
4779 msgid ""
4780 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4781 "                    NULL, &empty_mask);\n"
4782 "        if (r == -1 && errno != EINTR) {\n"
4783 "            /* Handle error */\n"
4784 "        }\n"
4785 msgstr ""
4786 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4787 "                    NULL, &empty_mask);\n"
4788 "        if (r == -1 && errno != EINTR) {\n"
4789 "            /* Handle error */\n"
4790 "        }\n"
4791
4792 #. type: Plain text
4793 #: build/C/man2/select_tut.2:302
4794 #, no-wrap
4795 msgid ""
4796 "        if (got_SIGCHLD) {\n"
4797 "            got_SIGCHLD = 0;\n"
4798 msgstr ""
4799 "        if (got_SIGCHLD) {\n"
4800 "            got_SIGCHLD = 0;\n"
4801
4802 #. type: Plain text
4803 #: build/C/man2/select_tut.2:306
4804 #, no-wrap
4805 msgid ""
4806 "            /* Handle signalled event here; e.g., wait() for all\n"
4807 "               terminated children. (Code omitted.) */\n"
4808 "        }\n"
4809 msgstr ""
4810 "            /* Handle signalled event here; e.g., wait() for all\n"
4811 "               terminated children. (Code omitted.) */\n"
4812 "        }\n"
4813
4814 #. type: Plain text
4815 #: build/C/man2/select_tut.2:310
4816 #, no-wrap
4817 msgid ""
4818 "        /* main body of program */\n"
4819 "    }\n"
4820 "}\n"
4821 msgstr ""
4822 "        /* main body of program */\n"
4823 "    }\n"
4824 "}\n"
4825
4826 #. type: SS
4827 #: build/C/man2/select_tut.2:311
4828 #, no-wrap
4829 msgid "Practical"
4830 msgstr "実例"
4831
4832 #. type: Plain text
4833 #: build/C/man2/select_tut.2:332
4834 msgid ""
4835 "So what is the point of B<select>()? Can't I just read and write to my "
4836 "descriptors whenever I want? The point of B<select>()  is that it watches "
4837 "multiple descriptors at the same time and properly puts the process to sleep "
4838 "if there is no activity.  UNIX programmers often find themselves in a "
4839 "position where they have to handle I/O from more than one file descriptor "
4840 "where the data flow may be intermittent.  If you were to merely create a "
4841 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
4842 "your calls may block waiting for data from/to a file descriptor, while "
4843 "another file descriptor is unused though ready for I/O.  B<select>()  "
4844 "efficiently copes with this situation."
4845 msgstr ""
4846 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
4847 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
4848 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
4849 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
4850 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
4851 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
4852 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
4853 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
4854 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
4855
4856 #. type: SS
4857 #: build/C/man2/select_tut.2:332
4858 #, no-wrap
4859 msgid "Select Law"
4860 msgstr "SELECT の掟"
4861
4862 #. type: Plain text
4863 #: build/C/man2/select_tut.2:345
4864 msgid ""
4865 "Many people who try to use B<select>()  come across behavior that is "
4866 "difficult to understand and produces nonportable or borderline results.  For "
4867 "instance, the above program is carefully written not to block at any point, "
4868 "even though it does not set its file descriptors to nonblocking mode.  It is "
4869 "easy to introduce subtle errors that will remove the advantage of using "
4870 "B<select>(), so here is a list of essentials to watch for when using "
4871 "B<select>()."
4872 msgstr ""
4873 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
4874 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
4875 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
4876 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
4877 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
4878 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
4879 "ことにする。"
4880
4881 #. type: Plain text
4882 #: build/C/man2/select_tut.2:354
4883 msgid ""
4884 "You should always try to use B<select>()  without a timeout.  Your program "
4885 "should have nothing to do if there is no data available.  Code that depends "
4886 "on timeouts is not usually portable and is difficult to debug."
4887 msgstr ""
4888 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
4889 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
4890 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
4891
4892 #. type: Plain text
4893 #: build/C/man2/select_tut.2:358
4894 msgid ""
4895 "The value I<nfds> must be properly calculated for efficiency as explained "
4896 "above."
4897 msgstr ""
4898 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
4899 "えなければならない。"
4900
4901 #. type: Plain text
4902 #: build/C/man2/select_tut.2:365
4903 msgid ""
4904 "No file descriptor must be added to any set if you do not intend to check "
4905 "its result after the B<select>()  call, and respond appropriately.  See next "
4906 "rule."
4907 msgstr ""
4908 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
4909 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
4910
4911 #. type: Plain text
4912 #: build/C/man2/select_tut.2:371
4913 msgid ""
4914 "After B<select>()  returns, all file descriptors in all sets should be "
4915 "checked to see if they are ready."
4916 msgstr ""
4917 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
4918 "て 読み書き可能な状態になっているかをチェックすべきである。"
4919
4920 #. type: TP
4921 #: build/C/man2/select_tut.2:371
4922 #, no-wrap
4923 msgid "5."
4924 msgstr "5."
4925
4926 #. type: Plain text
4927 #: build/C/man2/select_tut.2:386
4928 msgid ""
4929 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
4930 "necessarily read/write the full amount of data that you have requested.  If "
4931 "they do read/write the full amount, it's because you have a low traffic load "
4932 "and a fast stream.  This is not always going to be the case.  You should "
4933 "cope with the case of your functions only managing to send or receive a "
4934 "single byte."
4935 msgstr ""
4936 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
4937 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
4938 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
4939 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
4940 "うな場合も 考慮に入れてやらなければならない。"
4941
4942 #. type: TP
4943 #: build/C/man2/select_tut.2:386
4944 #, no-wrap
4945 msgid "6."
4946 msgstr "6."
4947
4948 #. type: Plain text
4949 #: build/C/man2/select_tut.2:394
4950 msgid ""
4951 "Never read/write only in single bytes at a time unless you are really sure "
4952 "that you have a small amount of data to process.  It is extremely "
4953 "inefficient not to read/write as much data as you can buffer each time.  The "
4954 "buffers in the example below are 1024 bytes although they could easily be "
4955 "made larger."
4956 msgstr ""
4957 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
4958 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
4959 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
4960 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
4961
4962 #. type: TP
4963 #: build/C/man2/select_tut.2:394
4964 #, no-wrap
4965 msgid "7."
4966 msgstr "7."
4967
4968 #.  Nonetheless, you should still cope with these errors for completeness.
4969 #. type: Plain text
4970 #: build/C/man2/select_tut.2:416
4971 msgid ""
4972 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
4973 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
4974 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
4975 "properly managed (not done properly above).  If your program is not going to "
4976 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
4977 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
4978 msgstr ""
4979 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
4980 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
4981 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
4982 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
4983 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
4984 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
4985
4986 #. type: TP
4987 #: build/C/man2/select_tut.2:416
4988 #, no-wrap
4989 msgid "8."
4990 msgstr "8."
4991
4992 #. type: Plain text
4993 #: build/C/man2/select_tut.2:425
4994 msgid ""
4995 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
4996 "length of zero."
4997 msgstr ""
4998 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
4999 "(2), B<send>(2)  を呼び出してはならない。"
5000
5001 #. type: TP
5002 #: build/C/man2/select_tut.2:425
5003 #, no-wrap
5004 msgid "9."
5005 msgstr "9."
5006
5007 #. type: Plain text
5008 #: build/C/man2/select_tut.2:441
5009 msgid ""
5010 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5011 "with errors other than those listed in B<7.>, or one of the input functions "
5012 "returns 0, indicating end of file, then you should I<not> pass that "
5013 "descriptor to B<select>()  again.  In the example below, I close the "
5014 "descriptor immediately, and then set it to -1 to prevent it being included "
5015 "in a set."
5016 msgstr ""
5017 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5018 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5019 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5020 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5021 "が集合に含まれ続けるのを許さないようにしている。"
5022
5023 #. type: TP
5024 #: build/C/man2/select_tut.2:441
5025 #, no-wrap
5026 msgid "10."
5027 msgstr "10."
5028
5029 #. type: Plain text
5030 #: build/C/man2/select_tut.2:448
5031 msgid ""
5032 "The timeout value must be initialized with each new call to B<select>(), "
5033 "since some operating systems modify the structure.  B<pselect>()  however "
5034 "does not modify its timeout structure."
5035 msgstr ""
5036 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5037 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5038 "分の timeout 構造体を変更することはない。"
5039
5040 #. type: TP
5041 #: build/C/man2/select_tut.2:448
5042 #, no-wrap
5043 msgid "11."
5044 msgstr "11."
5045
5046 #.  "I have heard" does not fill me with confidence, and doesn't
5047 #.  belong in a man page, so I've commented this point out.
5048 #.  .TP
5049 #.  11.
5050 #.  I have heard that the Windows socket layer does not cope with OOB data
5051 #.  properly.
5052 #.  It also does not cope with
5053 #.  .BR select ()
5054 #.  calls when no file descriptors are set at all.
5055 #.  Having no file descriptors set is a useful
5056 #.  way to sleep the process with subsecond precision by using the timeout.
5057 #.  (See further on.)
5058 #. type: Plain text
5059 #: build/C/man2/select_tut.2:467
5060 msgid ""
5061 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5062 "used in a loop, then the sets must be reinitialized before each call."
5063 msgstr ""
5064 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5065 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5066 "期化し直さなければならない。"
5067
5068 #. type: SS
5069 #: build/C/man2/select_tut.2:467
5070 #, no-wrap
5071 msgid "Usleep Emulation"
5072 msgstr "usleep エミュレーション"
5073
5074 #. type: Plain text
5075 #: build/C/man2/select_tut.2:474
5076 msgid ""
5077 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5078 "()  with a finite timeout and no file descriptors as follows:"
5079 msgstr ""
5080 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5081 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5082 "できる。 以下のようにする。"
5083
5084 #. type: Plain text
5085 #: build/C/man2/select_tut.2:480
5086 #, no-wrap
5087 msgid ""
5088 "    struct timeval tv;\n"
5089 "    tv.tv_sec = 0;\n"
5090 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5091 "    select(0, NULL, NULL, NULL, &tv);\n"
5092 msgstr ""
5093 "    struct timeval tv;\n"
5094 "    tv.tv_sec = 0;\n"
5095 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5096 "    select(0, NULL, NULL, NULL, &tv);\n"
5097
5098 #. type: Plain text
5099 #: build/C/man2/select_tut.2:483
5100 msgid "This is only guaranteed to work on UNIX systems, however."
5101 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5102
5103 #. type: Plain text
5104 #: build/C/man2/select_tut.2:488
5105 msgid ""
5106 "On success, B<select>()  returns the total number of file descriptors still "
5107 "present in the file descriptor sets."
5108 msgstr ""
5109 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5110 "ディスクリプタの総数を返す。"
5111
5112 #. type: Plain text
5113 #: build/C/man2/select_tut.2:494
5114 msgid ""
5115 "If B<select>()  timed out, then the return value will be zero.  The file "
5116 "descriptors set should be all empty (but may not be on some systems)."
5117 msgstr ""
5118 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5119 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5120
5121 #. type: Plain text
5122 #: build/C/man2/select_tut.2:501
5123 msgid ""
5124 "A return value of -1 indicates an error, with I<errno> being set "
5125 "appropriately.  In the case of an error, the contents of the returned sets "
5126 "and the I<struct timeout> contents are undefined and should not be used.  "
5127 "B<pselect>()  however never modifies I<ntimeout>."
5128 msgstr ""
5129 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5130 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5131 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5132 "変更しない。"
5133
5134 #. type: Plain text
5135 #: build/C/man2/select_tut.2:510
5136 msgid ""
5137 "Generally speaking, all operating systems that support sockets also support "
5138 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5139 "and efficient way that naive programmers try to solve in a more complicated "
5140 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5141 msgstr ""
5142 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5143 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5144 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5145 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5146
5147 #. type: Plain text
5148 #: build/C/man2/select_tut.2:519
5149 msgid ""
5150 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5151 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5152 "is nowadays widely available, but historically was less portable than "
5153 "B<select>()."
5154 msgstr ""
5155 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5156 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5157 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5158
5159 #. type: Plain text
5160 #: build/C/man2/select_tut.2:527
5161 msgid ""
5162 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5163 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5164 "of file descriptors."
5165 msgstr ""
5166 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5167 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5168
5169 #. type: Plain text
5170 #: build/C/man2/select_tut.2:532
5171 msgid ""
5172 "Here is an example that better demonstrates the true utility of B<select>"
5173 "().  The listing below is a TCP forwarding program that forwards from one "
5174 "TCP port to another."
5175 msgstr ""
5176 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5177 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5178
5179 #. type: Plain text
5180 #: build/C/man2/select_tut.2:545
5181 #, no-wrap
5182 msgid ""
5183 "#include E<lt>stdlib.hE<gt>\n"
5184 "#include E<lt>stdio.hE<gt>\n"
5185 "#include E<lt>unistd.hE<gt>\n"
5186 "#include E<lt>sys/time.hE<gt>\n"
5187 "#include E<lt>sys/types.hE<gt>\n"
5188 "#include E<lt>string.hE<gt>\n"
5189 "#include E<lt>signal.hE<gt>\n"
5190 "#include E<lt>sys/socket.hE<gt>\n"
5191 "#include E<lt>netinet/in.hE<gt>\n"
5192 "#include E<lt>arpa/inet.hE<gt>\n"
5193 "#include E<lt>errno.hE<gt>\n"
5194 msgstr ""
5195 "#include E<lt>stdlib.hE<gt>\n"
5196 "#include E<lt>stdio.hE<gt>\n"
5197 "#include E<lt>unistd.hE<gt>\n"
5198 "#include E<lt>sys/time.hE<gt>\n"
5199 "#include E<lt>sys/types.hE<gt>\n"
5200 "#include E<lt>string.hE<gt>\n"
5201 "#include E<lt>signal.hE<gt>\n"
5202 "#include E<lt>sys/socket.hE<gt>\n"
5203 "#include E<lt>netinet/in.hE<gt>\n"
5204 "#include E<lt>arpa/inet.hE<gt>\n"
5205 "#include E<lt>errno.hE<gt>\n"
5206
5207 #. type: Plain text
5208 #: build/C/man2/select_tut.2:547
5209 #, no-wrap
5210 msgid "static int forward_port;\n"
5211 msgstr "static int forward_port;\n"
5212
5213 #. type: Plain text
5214 #: build/C/man2/select_tut.2:550
5215 #, no-wrap
5216 msgid ""
5217 "#undef max\n"
5218 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5219 msgstr ""
5220 "#undef max\n"
5221 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5222
5223 #. type: Plain text
5224 #: build/C/man2/select_tut.2:557
5225 #, no-wrap
5226 msgid ""
5227 "static int\n"
5228 "listen_socket(int listen_port)\n"
5229 "{\n"
5230 "    struct sockaddr_in a;\n"
5231 "    int s;\n"
5232 "    int yes;\n"
5233 msgstr ""
5234 "static int\n"
5235 "listen_socket(int listen_port)\n"
5236 "{\n"
5237 "    struct sockaddr_in a;\n"
5238 "    int s;\n"
5239 "    int yes;\n"
5240
5241 #. type: Plain text
5242 #: build/C/man2/select_tut.2:581
5243 #, no-wrap
5244 msgid ""
5245 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5246 "        perror(\"socket\");\n"
5247 "        return -1;\n"
5248 "    }\n"
5249 "    yes = 1;\n"
5250 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5251 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5252 "        perror(\"setsockopt\");\n"
5253 "        close(s);\n"
5254 "        return -1;\n"
5255 "    }\n"
5256 "    memset(&a, 0, sizeof(a));\n"
5257 "    a.sin_port = htons(listen_port);\n"
5258 "    a.sin_family = AF_INET;\n"
5259 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5260 "        perror(\"bind\");\n"
5261 "        close(s);\n"
5262 "        return -1;\n"
5263 "    }\n"
5264 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5265 "    listen(s, 10);\n"
5266 "    return s;\n"
5267 "}\n"
5268 msgstr ""
5269 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5270 "        perror(\"socket\");\n"
5271 "        return -1;\n"
5272 "    }\n"
5273 "    yes = 1;\n"
5274 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5275 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5276 "        perror(\"setsockopt\");\n"
5277 "        close(s);\n"
5278 "        return -1;\n"
5279 "    }\n"
5280 "    memset(&a, 0, sizeof(a));\n"
5281 "    a.sin_port = htons(listen_port);\n"
5282 "    a.sin_family = AF_INET;\n"
5283 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5284 "        perror(\"bind\");\n"
5285 "        close(s);\n"
5286 "        return -1;\n"
5287 "    }\n"
5288 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5289 "    listen(s, 10);\n"
5290 "    return s;\n"
5291 "}\n"
5292
5293 #. type: Plain text
5294 #: build/C/man2/select_tut.2:587
5295 #, no-wrap
5296 msgid ""
5297 "static int\n"
5298 "connect_socket(int connect_port, char *address)\n"
5299 "{\n"
5300 "    struct sockaddr_in a;\n"
5301 "    int s;\n"
5302 msgstr ""
5303 "static int\n"
5304 "connect_socket(int connect_port, char *address)\n"
5305 "{\n"
5306 "    struct sockaddr_in a;\n"
5307 "    int s;\n"
5308
5309 #. type: Plain text
5310 #: build/C/man2/select_tut.2:593
5311 #, no-wrap
5312 msgid ""
5313 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5314 "        perror(\"socket\");\n"
5315 "        close(s);\n"
5316 "        return -1;\n"
5317 "    }\n"
5318 msgstr ""
5319 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5320 "        perror(\"socket\");\n"
5321 "        close(s);\n"
5322 "        return -1;\n"
5323 "    }\n"
5324
5325 #. type: Plain text
5326 #: build/C/man2/select_tut.2:597
5327 #, no-wrap
5328 msgid ""
5329 "    memset(&a, 0, sizeof(a));\n"
5330 "    a.sin_port = htons(connect_port);\n"
5331 "    a.sin_family = AF_INET;\n"
5332 msgstr ""
5333 "    memset(&a, 0, sizeof(a));\n"
5334 "    a.sin_port = htons(connect_port);\n"
5335 "    a.sin_family = AF_INET;\n"
5336
5337 #. type: Plain text
5338 #: build/C/man2/select_tut.2:603
5339 #, no-wrap
5340 msgid ""
5341 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5342 "        perror(\"bad IP address format\");\n"
5343 "        close(s);\n"
5344 "        return -1;\n"
5345 "    }\n"
5346 msgstr ""
5347 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5348 "        perror(\"bad IP address format\");\n"
5349 "        close(s);\n"
5350 "        return -1;\n"
5351 "    }\n"
5352
5353 #. type: Plain text
5354 #: build/C/man2/select_tut.2:612
5355 #, no-wrap
5356 msgid ""
5357 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5358 "        perror(\"connect()\");\n"
5359 "        shutdown(s, SHUT_RDWR);\n"
5360 "        close(s);\n"
5361 "        return -1;\n"
5362 "    }\n"
5363 "    return s;\n"
5364 "}\n"
5365 msgstr ""
5366 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5367 "        perror(\"connect()\");\n"
5368 "        shutdown(s, SHUT_RDWR);\n"
5369 "        close(s);\n"
5370 "        return -1;\n"
5371 "    }\n"
5372 "    return s;\n"
5373 "}\n"
5374
5375 #. type: Plain text
5376 #: build/C/man2/select_tut.2:620
5377 #, no-wrap
5378 msgid ""
5379 "#define SHUT_FD1 do {                                \\e\n"
5380 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5381 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5382 "                         close(fd1);                 \\e\n"
5383 "                         fd1 = -1;                   \\e\n"
5384 "                     }                               \\e\n"
5385 "                 } while (0)\n"
5386 msgstr ""
5387 "#define SHUT_FD1 do {                                \\e\n"
5388 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5389 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5390 "                         close(fd1);                 \\e\n"
5391 "                         fd1 = -1;                   \\e\n"
5392 "                     }                               \\e\n"
5393 "                 } while (0)\n"
5394
5395 #. type: Plain text
5396 #: build/C/man2/select_tut.2:628
5397 #, no-wrap
5398 msgid ""
5399 "#define SHUT_FD2 do {                                \\e\n"
5400 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5401 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5402 "                         close(fd2);                 \\e\n"
5403 "                         fd2 = -1;                   \\e\n"
5404 "                     }                               \\e\n"
5405 "                 } while (0)\n"
5406 msgstr ""
5407 "#define SHUT_FD2 do {                                \\e\n"
5408 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5409 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5410 "                         close(fd2);                 \\e\n"
5411 "                         fd2 = -1;                   \\e\n"
5412 "                     }                               \\e\n"
5413 "                 } while (0)\n"
5414
5415 #. type: Plain text
5416 #: build/C/man2/select_tut.2:630
5417 #, no-wrap
5418 msgid "#define BUF_SIZE 1024\n"
5419 msgstr "#define BUF_SIZE 1024\n"
5420
5421 #. type: Plain text
5422 #: build/C/man2/select_tut.2:639
5423 #, no-wrap
5424 msgid ""
5425 "int\n"
5426 "main(int argc, char *argv[])\n"
5427 "{\n"
5428 "    int h;\n"
5429 "    int fd1 = -1, fd2 = -1;\n"
5430 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5431 "    int buf1_avail, buf1_written;\n"
5432 "    int buf2_avail, buf2_written;\n"
5433 msgstr ""
5434 "int\n"
5435 "main(int argc, char *argv[])\n"
5436 "{\n"
5437 "    int h;\n"
5438 "    int fd1 = -1, fd2 = -1;\n"
5439 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5440 "    int buf1_avail, buf1_written;\n"
5441 "    int buf2_avail, buf2_written;\n"
5442
5443 #. type: Plain text
5444 #: build/C/man2/select_tut.2:645
5445 #, no-wrap
5446 msgid ""
5447 "    if (argc != 4) {\n"
5448 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5449 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5450 "        exit(EXIT_FAILURE);\n"
5451 "    }\n"
5452 msgstr ""
5453 "    if (argc != 4) {\n"
5454 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5455 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5456 "        exit(EXIT_FAILURE);\n"
5457 "    }\n"
5458
5459 #. type: Plain text
5460 #: build/C/man2/select_tut.2:647
5461 #, no-wrap
5462 msgid "    signal(SIGPIPE, SIG_IGN);\n"
5463 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
5464
5465 #. type: Plain text
5466 #: build/C/man2/select_tut.2:649
5467 #, no-wrap
5468 msgid "    forward_port = atoi(argv[2]);\n"
5469 msgstr "    forward_port = atoi(argv[2]);\n"
5470
5471 #. type: Plain text
5472 #: build/C/man2/select_tut.2:653
5473 #, no-wrap
5474 msgid ""
5475 "    h = listen_socket(atoi(argv[1]));\n"
5476 "    if (h == -1)\n"
5477 "        exit(EXIT_FAILURE);\n"
5478 msgstr ""
5479 "    h = listen_socket(atoi(argv[1]));\n"
5480 "    if (h == -1)\n"
5481 "        exit(EXIT_FAILURE);\n"
5482
5483 #. type: Plain text
5484 #: build/C/man2/select_tut.2:657
5485 #, no-wrap
5486 msgid ""
5487 "    for (;;) {\n"
5488 "        int r, nfds = 0;\n"
5489 "        fd_set rd, wr, er;\n"
5490 msgstr ""
5491 "    for (;;) {\n"
5492 "        int r, nfds = 0;\n"
5493 "        fd_set rd, wr, er;\n"
5494
5495 #. type: Plain text
5496 #: build/C/man2/select_tut.2:687
5497 #, no-wrap
5498 msgid ""
5499 "        FD_ZERO(&rd);\n"
5500 "        FD_ZERO(&wr);\n"
5501 "        FD_ZERO(&er);\n"
5502 "        FD_SET(h, &rd);\n"
5503 "        nfds = max(nfds, h);\n"
5504 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5505 "            FD_SET(fd1, &rd);\n"
5506 "            nfds = max(nfds, fd1);\n"
5507 "        }\n"
5508 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5509 "            FD_SET(fd2, &rd);\n"
5510 "            nfds = max(nfds, fd2);\n"
5511 "        }\n"
5512 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5513 "            FD_SET(fd1, &wr);\n"
5514 "            nfds = max(nfds, fd1);\n"
5515 "        }\n"
5516 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5517 "            FD_SET(fd2, &wr);\n"
5518 "            nfds = max(nfds, fd2);\n"
5519 "        }\n"
5520 "        if (fd1 E<gt> 0) {\n"
5521 "            FD_SET(fd1, &er);\n"
5522 "            nfds = max(nfds, fd1);\n"
5523 "        }\n"
5524 "        if (fd2 E<gt> 0) {\n"
5525 "            FD_SET(fd2, &er);\n"
5526 "            nfds = max(nfds, fd2);\n"
5527 "        }\n"
5528 msgstr ""
5529 "        FD_ZERO(&rd);\n"
5530 "        FD_ZERO(&wr);\n"
5531 "        FD_ZERO(&er);\n"
5532 "        FD_SET(h, &rd);\n"
5533 "        nfds = max(nfds, h);\n"
5534 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5535 "            FD_SET(fd1, &rd);\n"
5536 "            nfds = max(nfds, fd1);\n"
5537 "        }\n"
5538 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5539 "            FD_SET(fd2, &rd);\n"
5540 "            nfds = max(nfds, fd2);\n"
5541 "        }\n"
5542 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5543 "            FD_SET(fd1, &wr);\n"
5544 "            nfds = max(nfds, fd1);\n"
5545 "        }\n"
5546 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5547 "            FD_SET(fd2, &wr);\n"
5548 "            nfds = max(nfds, fd2);\n"
5549 "        }\n"
5550 "        if (fd1 E<gt> 0) {\n"
5551 "            FD_SET(fd1, &er);\n"
5552 "            nfds = max(nfds, fd1);\n"
5553 "        }\n"
5554 "        if (fd2 E<gt> 0) {\n"
5555 "            FD_SET(fd2, &er);\n"
5556 "            nfds = max(nfds, fd2);\n"
5557 "        }\n"
5558
5559 #. type: Plain text
5560 #: build/C/man2/select_tut.2:689
5561 #, no-wrap
5562 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5563 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5564
5565 #. type: Plain text
5566 #: build/C/man2/select_tut.2:692
5567 #, no-wrap
5568 msgid ""
5569 "        if (r == -1 && errno == EINTR)\n"
5570 "            continue;\n"
5571 msgstr ""
5572 "        if (r == -1 && errno == EINTR)\n"
5573 "            continue;\n"
5574
5575 #. type: Plain text
5576 #: build/C/man2/select_tut.2:697
5577 #, no-wrap
5578 msgid ""
5579 "        if (r == -1) {\n"
5580 "            perror(\"select()\");\n"
5581 "            exit(EXIT_FAILURE);\n"
5582 "        }\n"
5583 msgstr ""
5584 "        if (r == -1) {\n"
5585 "            perror(\"select()\");\n"
5586 "            exit(EXIT_FAILURE);\n"
5587 "        }\n"
5588
5589 #. type: Plain text
5590 #: build/C/man2/select_tut.2:701
5591 #, no-wrap
5592 msgid ""
5593 "        if (FD_ISSET(h, &rd)) {\n"
5594 "            unsigned int l;\n"
5595 "            struct sockaddr_in client_address;\n"
5596 msgstr ""
5597 "        if (FD_ISSET(h, &rd)) {\n"
5598 "            unsigned int l;\n"
5599 "            struct sockaddr_in client_address;\n"
5600
5601 #. type: Plain text
5602 #: build/C/man2/select_tut.2:720
5603 #, no-wrap
5604 msgid ""
5605 "            memset(&client_address, 0, l = sizeof(client_address));\n"
5606 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5607 "            if (r == -1) {\n"
5608 "                perror(\"accept()\");\n"
5609 "            } else {\n"
5610 "                SHUT_FD1;\n"
5611 "                SHUT_FD2;\n"
5612 "                buf1_avail = buf1_written = 0;\n"
5613 "                buf2_avail = buf2_written = 0;\n"
5614 "                fd1 = r;\n"
5615 "                fd2 = connect_socket(forward_port, argv[3]);\n"
5616 "                if (fd2 == -1)\n"
5617 "                    SHUT_FD1;\n"
5618 "                else\n"
5619 "                    printf(\"connect from %s\\en\",\n"
5620 "                            inet_ntoa(client_address.sin_addr));\n"
5621 "            }\n"
5622 "        }\n"
5623 msgstr ""
5624 "            memset(&client_address, 0, l = sizeof(client_address));\n"
5625 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5626 "            if (r == -1) {\n"
5627 "                perror(\"accept()\");\n"
5628 "            } else {\n"
5629 "                SHUT_FD1;\n"
5630 "                SHUT_FD2;\n"
5631 "                buf1_avail = buf1_written = 0;\n"
5632 "                buf2_avail = buf2_written = 0;\n"
5633 "                fd1 = r;\n"
5634 "                fd2 = connect_socket(forward_port, argv[3]);\n"
5635 "                if (fd2 == -1)\n"
5636 "                    SHUT_FD1;\n"
5637 "                else\n"
5638 "                    printf(\"connect from %s\\en\",\n"
5639 "                            inet_ntoa(client_address.sin_addr));\n"
5640 "            }\n"
5641 "        }\n"
5642
5643 #. type: Plain text
5644 #: build/C/man2/select_tut.2:722
5645 #, no-wrap
5646 msgid "        /* NB: read oob data before normal reads */\n"
5647 msgstr "        /* NB: read oob data before normal reads */\n"
5648
5649 #. type: Plain text
5650 #: build/C/man2/select_tut.2:726
5651 #, no-wrap
5652 msgid ""
5653 "        if (fd1 E<gt> 0)\n"
5654 "            if (FD_ISSET(fd1, &er)) {\n"
5655 "                char c;\n"
5656 msgstr ""
5657 "        if (fd1 E<gt> 0)\n"
5658 "            if (FD_ISSET(fd1, &er)) {\n"
5659 "                char c;\n"
5660
5661 #. type: Plain text
5662 #: build/C/man2/select_tut.2:736
5663 #, no-wrap
5664 msgid ""
5665 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
5666 "                if (r E<lt> 1)\n"
5667 "                    SHUT_FD1;\n"
5668 "                else\n"
5669 "                    send(fd2, &c, 1, MSG_OOB);\n"
5670 "            }\n"
5671 "        if (fd2 E<gt> 0)\n"
5672 "            if (FD_ISSET(fd2, &er)) {\n"
5673 "                char c;\n"
5674 msgstr ""
5675 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
5676 "                if (r E<lt> 1)\n"
5677 "                    SHUT_FD1;\n"
5678 "                else\n"
5679 "                    send(fd2, &c, 1, MSG_OOB);\n"
5680 "            }\n"
5681 "        if (fd2 E<gt> 0)\n"
5682 "            if (FD_ISSET(fd2, &er)) {\n"
5683 "                char c;\n"
5684
5685 #. type: Plain text
5686 #: build/C/man2/select_tut.2:779
5687 #, no-wrap
5688 msgid ""
5689 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
5690 "                if (r E<lt> 1)\n"
5691 "                    SHUT_FD2;\n"
5692 "                else\n"
5693 "                    send(fd1, &c, 1, MSG_OOB);\n"
5694 "            }\n"
5695 "        if (fd1 E<gt> 0)\n"
5696 "            if (FD_ISSET(fd1, &rd)) {\n"
5697 "                r = read(fd1, buf1 + buf1_avail,\n"
5698 "                          BUF_SIZE - buf1_avail);\n"
5699 "                if (r E<lt> 1)\n"
5700 "                    SHUT_FD1;\n"
5701 "                else\n"
5702 "                    buf1_avail += r;\n"
5703 "            }\n"
5704 "        if (fd2 E<gt> 0)\n"
5705 "            if (FD_ISSET(fd2, &rd)) {\n"
5706 "                r = read(fd2, buf2 + buf2_avail,\n"
5707 "                          BUF_SIZE - buf2_avail);\n"
5708 "                if (r E<lt> 1)\n"
5709 "                    SHUT_FD2;\n"
5710 "                else\n"
5711 "                    buf2_avail += r;\n"
5712 "            }\n"
5713 "        if (fd1 E<gt> 0)\n"
5714 "            if (FD_ISSET(fd1, &wr)) {\n"
5715 "                r = write(fd1, buf2 + buf2_written,\n"
5716 "                           buf2_avail - buf2_written);\n"
5717 "                if (r E<lt> 1)\n"
5718 "                    SHUT_FD1;\n"
5719 "                else\n"
5720 "                    buf2_written += r;\n"
5721 "            }\n"
5722 "        if (fd2 E<gt> 0)\n"
5723 "            if (FD_ISSET(fd2, &wr)) {\n"
5724 "                r = write(fd2, buf1 + buf1_written,\n"
5725 "                           buf1_avail - buf1_written);\n"
5726 "                if (r E<lt> 1)\n"
5727 "                    SHUT_FD2;\n"
5728 "                else\n"
5729 "                    buf1_written += r;\n"
5730 "            }\n"
5731 msgstr ""
5732 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
5733 "                if (r E<lt> 1)\n"
5734 "                    SHUT_FD2;\n"
5735 "                else\n"
5736 "                    send(fd1, &c, 1, MSG_OOB);\n"
5737 "            }\n"
5738 "        if (fd1 E<gt> 0)\n"
5739 "            if (FD_ISSET(fd1, &rd)) {\n"
5740 "                r = read(fd1, buf1 + buf1_avail,\n"
5741 "                          BUF_SIZE - buf1_avail);\n"
5742 "                if (r E<lt> 1)\n"
5743 "                    SHUT_FD1;\n"
5744 "                else\n"
5745 "                    buf1_avail += r;\n"
5746 "            }\n"
5747 "        if (fd2 E<gt> 0)\n"
5748 "            if (FD_ISSET(fd2, &rd)) {\n"
5749 "                r = read(fd2, buf2 + buf2_avail,\n"
5750 "                          BUF_SIZE - buf2_avail);\n"
5751 "                if (r E<lt> 1)\n"
5752 "                    SHUT_FD2;\n"
5753 "                else\n"
5754 "                    buf2_avail += r;\n"
5755 "            }\n"
5756 "        if (fd1 E<gt> 0)\n"
5757 "            if (FD_ISSET(fd1, &wr)) {\n"
5758 "                r = write(fd1, buf2 + buf2_written,\n"
5759 "                           buf2_avail - buf2_written);\n"
5760 "                if (r E<lt> 1)\n"
5761 "                    SHUT_FD1;\n"
5762 "                else\n"
5763 "                    buf2_written += r;\n"
5764 "            }\n"
5765 "        if (fd2 E<gt> 0)\n"
5766 "            if (FD_ISSET(fd2, &wr)) {\n"
5767 "                r = write(fd2, buf1 + buf1_written,\n"
5768 "                           buf1_avail - buf1_written);\n"
5769 "                if (r E<lt> 1)\n"
5770 "                    SHUT_FD2;\n"
5771 "                else\n"
5772 "                    buf1_written += r;\n"
5773 "            }\n"
5774
5775 #. type: Plain text
5776 #: build/C/man2/select_tut.2:781
5777 #, no-wrap
5778 msgid "        /* check if write data has caught read data */\n"
5779 msgstr "        /* check if write data has caught read data */\n"
5780
5781 #. type: Plain text
5782 #: build/C/man2/select_tut.2:786
5783 #, no-wrap
5784 msgid ""
5785 "        if (buf1_written == buf1_avail)\n"
5786 "            buf1_written = buf1_avail = 0;\n"
5787 "        if (buf2_written == buf2_avail)\n"
5788 "            buf2_written = buf2_avail = 0;\n"
5789 msgstr ""
5790 "        if (buf1_written == buf1_avail)\n"
5791 "            buf1_written = buf1_avail = 0;\n"
5792 "        if (buf2_written == buf2_avail)\n"
5793 "            buf2_written = buf2_avail = 0;\n"
5794
5795 #. type: Plain text
5796 #: build/C/man2/select_tut.2:789
5797 #, no-wrap
5798 msgid ""
5799 "        /* one side has closed the connection, keep\n"
5800 "           writing to the other side until empty */\n"
5801 msgstr ""
5802 "        /* one side has closed the connection, keep\n"
5803 "           writing to the other side until empty */\n"
5804
5805 #. type: Plain text
5806 #: build/C/man2/select_tut.2:797
5807 #, no-wrap
5808 msgid ""
5809 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5810 "            SHUT_FD2;\n"
5811 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5812 "            SHUT_FD1;\n"
5813 "    }\n"
5814 "    exit(EXIT_SUCCESS);\n"
5815 "}\n"
5816 msgstr ""
5817 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5818 "            SHUT_FD2;\n"
5819 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5820 "            SHUT_FD1;\n"
5821 "    }\n"
5822 "    exit(EXIT_SUCCESS);\n"
5823 "}\n"
5824
5825 #. type: Plain text
5826 #: build/C/man2/select_tut.2:811
5827 msgid ""
5828 "The above program properly forwards most kinds of TCP connections including "
5829 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
5830 "problem of having data flow in both directions simultaneously.  You might "
5831 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
5832 "each stream.  This becomes more tricky than you might suspect.  Another idea "
5833 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
5834 "because you end up using inefficient timeouts."
5835 msgstr ""
5836 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
5837 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
5838 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
5839 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
5840 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
5841 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
5842 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
5843 "起こってしまう。"
5844
5845 #. type: Plain text
5846 #: build/C/man2/select_tut.2:817
5847 msgid ""
5848 "The program does not handle more than one simultaneous connection at a time, "
5849 "although it could easily be extended to do this with a linked list of buffers"
5850 "\\(emone for each connection.  At the moment, new connections cause the "
5851 "current connection to be dropped."
5852 msgstr ""
5853 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
5854 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
5855 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
5856
5857 #.  .SH AUTHORS
5858 #.  This man page was written by Paul Sheer.
5859 #. type: Plain text
5860 #: build/C/man2/select_tut.2:836
5861 msgid ""
5862 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5863 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5864 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5865 "(3), B<epoll>(7)"
5866 msgstr ""
5867 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5868 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5869 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5870 "(3), B<epoll>(7)"
5871
5872 #. type: TH
5873 #: build/C/man2/send.2:38
5874 #, no-wrap
5875 msgid "SEND"
5876 msgstr "SEND"
5877
5878 #. type: TH
5879 #: build/C/man2/send.2:38
5880 #, no-wrap
5881 msgid "2011-10-01"
5882 msgstr "2011-10-01"
5883
5884 #. type: Plain text
5885 #: build/C/man2/send.2:41
5886 msgid "send, sendto, sendmsg - send a message on a socket"
5887 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
5888
5889 #. type: Plain text
5890 #: build/C/man2/send.2:45
5891 #, no-wrap
5892 msgid ""
5893 "B<#include E<lt>sys/types.hE<gt>>\n"
5894 "B<#include E<lt>sys/socket.hE<gt>>\n"
5895 msgstr ""
5896 "B<#include E<lt>sys/types.hE<gt>>\n"
5897 "B<#include E<lt>sys/socket.hE<gt>>\n"
5898
5899 #. type: Plain text
5900 #: build/C/man2/send.2:48
5901 #, no-wrap
5902 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5903 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5904
5905 #. type: Plain text
5906 #: build/C/man2/send.2:52
5907 #, no-wrap
5908 msgid ""
5909 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5910 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5911 msgstr ""
5912 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5913 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5914
5915 #. type: Plain text
5916 #: build/C/man2/send.2:55
5917 #, no-wrap
5918 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5919 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5920
5921 #. type: Plain text
5922 #: build/C/man2/send.2:63
5923 msgid ""
5924 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
5925 "transmit a message to another socket."
5926 msgstr ""
5927 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
5928 "メッセージを転送するのに使用される。"
5929
5930 #. type: Plain text
5931 #: build/C/man2/send.2:82
5932 msgid ""
5933 "The B<send>()  call may be used only when the socket is in a I<connected> "
5934 "state (so that the intended recipient is known).  The only difference "
5935 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
5936 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
5937 "following call"
5938 msgstr ""
5939 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
5940 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
5941 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
5942 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
5943
5944 #. type: Plain text
5945 #: build/C/man2/send.2:84
5946 #, no-wrap
5947 msgid "    send(sockfd, buf, len, flags);\n"
5948 msgstr "    send(sockfd, buf, len, flags);\n"
5949
5950 #. type: Plain text
5951 #: build/C/man2/send.2:86
5952 msgid "is equivalent to"
5953 msgstr "は以下と等価である。"
5954
5955 #. type: Plain text
5956 #: build/C/man2/send.2:88
5957 #, no-wrap
5958 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
5959 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
5960
5961 #. type: Plain text
5962 #: build/C/man2/send.2:92
5963 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
5964 msgstr ""
5965 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
5966 "る。"
5967
5968 #. type: Plain text
5969 #: build/C/man2/send.2:120
5970 msgid ""
5971 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
5972 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
5973 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
5974 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
5975 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
5976 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
5977 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
5978 "size."
5979 msgstr ""
5980 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
5981 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
5982 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
5983 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
5984 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
5985 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
5986 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
5987 "msg_namelen> で指定される。"
5988
5989 #. type: Plain text
5990 #: build/C/man2/send.2:136
5991 msgid ""
5992 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
5993 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
5994 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
5995 "ancillary data (also known as control information)."
5996 msgstr ""
5997 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
5998 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
5999 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6000 "(制御情報とも呼ばれる) を送信することもできる。"
6001
6002 #. type: Plain text
6003 #: build/C/man2/send.2:141
6004 msgid ""
6005 "If the message is too long to pass atomically through the underlying "
6006 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6007 "transmitted."
6008 msgstr ""
6009 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6010 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6011 "ラーが返され、そのメッセージは転送されない。"
6012
6013 #. type: Plain text
6014 #: build/C/man2/send.2:145
6015 msgid ""
6016 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6017 "detected errors are indicated by a return value of -1."
6018 msgstr ""
6019 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6020 "出された場合は、返り値 -1 として通知される。"
6021
6022 #. type: Plain text
6023 #: build/C/man2/send.2:158
6024 msgid ""
6025 "When the message does not fit into the send buffer of the socket, B<send>()  "
6026 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6027 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6028 "in this case.  The B<select>(2)  call may be used to determine when it is "
6029 "possible to send more data."
6030 msgstr ""
6031 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6032 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6033 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6034 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6035 "用することができる。"
6036
6037 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6038 #. type: Plain text
6039 #: build/C/man2/send.2:164
6040 msgid ""
6041 "The I<flags> argument is the bitwise OR of zero or more of the following "
6042 "flags."
6043 msgstr ""
6044 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6045 "のを指定する。"
6046
6047 #. type: TP
6048 #: build/C/man2/send.2:164
6049 #, no-wrap
6050 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6051 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6052
6053 #. type: Plain text
6054 #: build/C/man2/send.2:178
6055 msgid ""
6056 "Tell the link layer that forward progress happened: you got a successful "
6057 "reply from the other side.  If the link layer doesn't get this it will "
6058 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6059 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
6060 "IPv4 and IPv6.  See B<arp>(7)  for details."
6061 msgstr ""
6062 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6063 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6064 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6065 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6066 "されている。 詳しくは B<arp>(7)  参照のこと。"
6067
6068 #. type: TP
6069 #: build/C/man2/send.2:178
6070 #, no-wrap
6071 msgid "B<MSG_DONTROUTE>"
6072 msgstr "B<MSG_DONTROUTE>"
6073
6074 #. type: Plain text
6075 #: build/C/man2/send.2:186
6076 msgid ""
6077 "Don't use a gateway to send out the packet, only send to hosts on directly "
6078 "connected networks.  This is usually used only by diagnostic or routing "
6079 "programs.  This is only defined for protocol families that route; packet "
6080 "sockets don't."
6081 msgstr ""
6082 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6083 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6084 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6085 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6086
6087 #. type: Plain text
6088 #: build/C/man2/send.2:197
6089 msgid ""
6090 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6091 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6092 "flag with the B<F_SETFL> B<fcntl>(2))."
6093 msgstr ""
6094 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6095 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6096 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6097
6098 #. type: TP
6099 #: build/C/man2/send.2:197
6100 #, no-wrap
6101 msgid "B<MSG_EOR> (since Linux 2.2)"
6102 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6103
6104 #. type: Plain text
6105 #: build/C/man2/send.2:201
6106 msgid ""
6107 "Terminates a record (when this notion is supported, as for sockets of type "
6108 "B<SOCK_SEQPACKET>)."
6109 msgstr ""
6110 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6111 "ケット種別のときに有効)。"
6112
6113 #. type: TP
6114 #: build/C/man2/send.2:201
6115 #, no-wrap
6116 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6117 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6118
6119 #. type: Plain text
6120 #: build/C/man2/send.2:210
6121 msgid ""
6122 "The caller has more data to send.  This flag is used with TCP sockets to "
6123 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6124 "with the difference that this flag can be set on a per-call basis."
6125 msgstr ""
6126 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6127 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6128 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6129 "機能を有効にできる点である。"
6130
6131 #. type: Plain text
6132 #: build/C/man2/send.2:219
6133 msgid ""
6134 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6135 "the kernel to package all of the data sent in calls with this flag set into "
6136 "a single datagram which is only transmitted when a call is performed that "
6137 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6138 "described in B<udp>(7).)"
6139 msgstr ""
6140 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6141 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6142 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6143 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6144 "ソケットオプション B<UDP_CORK> も参照)。"
6145
6146 #. type: TP
6147 #: build/C/man2/send.2:219
6148 #, no-wrap
6149 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6150 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6151
6152 #. type: Plain text
6153 #: build/C/man2/send.2:228
6154 msgid ""
6155 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6156 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6157 msgstr ""
6158 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6159 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6160
6161 #. type: Plain text
6162 #: build/C/man2/send.2:237
6163 msgid ""
6164 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6165 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6166 "data."
6167 msgstr ""
6168 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6169 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6170 "をサポートしている必要がある。"
6171
6172 #. type: Plain text
6173 #: build/C/man2/send.2:244
6174 msgid ""
6175 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6176 "below for an exact description of its fields."
6177 msgstr ""
6178 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6179 "B<recv>(2)  と以下の説明を参照すること。"
6180
6181 #.  Still to be documented:
6182 #.   Send file descriptors and user credentials using the
6183 #.   msg_control* fields.
6184 #.   The flags returned in msg_flags.
6185 #. type: Plain text
6186 #: build/C/man2/send.2:273
6187 msgid ""
6188 "You may send control information using the I<msg_control> and "
6189 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6190 "process is limited per socket by the value in I</proc/sys/net/core/"
6191 "optmem_max>; see B<socket>(7)."
6192 msgstr ""
6193 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6194 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6195 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6196
6197 #. type: Plain text
6198 #: build/C/man2/send.2:278
6199 msgid ""
6200 "On success, these calls return the number of characters sent.  On error, -1 "
6201 "is returned, and I<errno> is set appropriately."
6202 msgstr ""
6203 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6204 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6205
6206 #. type: Plain text
6207 #: build/C/man2/send.2:283
6208 msgid ""
6209 "These are some standard errors generated by the socket layer.  Additional "
6210 "errors may be generated and returned from the underlying protocol modules; "
6211 "see their respective manual pages."
6212 msgstr ""
6213 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6214 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6215 "れぞれのマニュアルを参照すること。"
6216
6217 #. type: Plain text
6218 #: build/C/man2/send.2:291
6219 msgid ""
6220 "(For UNIX domain sockets, which are identified by pathname)  Write "
6221 "permission is denied on the destination socket file, or search permission is "
6222 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6223 "(7).)"
6224 msgstr ""
6225 "(UNIX ドメインソケットはパス名で識別される。)  ソケット・ファイルへの書き込み"
6226 "許可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許"
6227 "可がなかった。 (B<path_resolution>(7)  も参照のこと)"
6228
6229 #.  Actually EAGAIN on Linux
6230 #. type: Plain text
6231 #: build/C/man2/send.2:299
6232 msgid ""
6233 "The socket is marked nonblocking and the requested operation would block.  "
6234 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6235 "require these constants to have the same value, so a portable application "
6236 "should check for both possibilities."
6237 msgstr ""
6238 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6239 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6240 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6241 "両方の可能性を 確認すべきである。"
6242
6243 #. type: Plain text
6244 #: build/C/man2/send.2:302
6245 msgid "An invalid descriptor was specified."
6246 msgstr "無効なディスクリプターが指定された。"
6247
6248 #. type: TP
6249 #: build/C/man2/send.2:302
6250 #, no-wrap
6251 msgid "B<ECONNRESET>"
6252 msgstr "B<ECONNRESET>"
6253
6254 #. type: Plain text
6255 #: build/C/man2/send.2:305
6256 msgid "Connection reset by peer."
6257 msgstr "接続が接続相手によりリセットされた。"
6258
6259 #. type: TP
6260 #: build/C/man2/send.2:305
6261 #, no-wrap
6262 msgid "B<EDESTADDRREQ>"
6263 msgstr "B<EDESTADDRREQ>"
6264
6265 #. type: Plain text
6266 #: build/C/man2/send.2:308
6267 msgid "The socket is not connection-mode, and no peer address is set."
6268 msgstr ""
6269 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6270 "ていない。"
6271
6272 #. type: Plain text
6273 #: build/C/man2/send.2:311
6274 msgid "An invalid user space address was specified for an argument."
6275 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6276
6277 #. type: Plain text
6278 #: build/C/man2/send.2:315
6279 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6280 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6281
6282 #. type: Plain text
6283 #: build/C/man2/send.2:324
6284 msgid ""
6285 "The connection-mode socket was connected already but a recipient was "
6286 "specified.  (Now either this error is returned, or the recipient "
6287 "specification is ignored.)"
6288 msgstr ""
6289 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6290 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6291 "いずれかとなる)"
6292
6293 #. type: TP
6294 #: build/C/man2/send.2:324
6295 #, no-wrap
6296 msgid "B<EMSGSIZE>"
6297 msgstr "B<EMSGSIZE>"
6298
6299 #.  (e.g., SOCK_DGRAM )
6300 #. type: Plain text
6301 #: build/C/man2/send.2:330
6302 msgid ""
6303 "The socket type requires that message be sent atomically, and the size of "
6304 "the message to be sent made this impossible."
6305 msgstr ""
6306 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6307 "るが、 メッセージが大き過ぎるため送信することができない。"
6308
6309 #. type: Plain text
6310 #: build/C/man2/send.2:338
6311 msgid ""
6312 "The output queue for a network interface was full.  This generally indicates "
6313 "that the interface has stopped sending, but may be caused by transient "
6314 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6315 "silently dropped when a device queue overflows.)"
6316 msgstr ""
6317 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6318 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6319 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6320 "フローした場合にはパケットは黙って捨てられる)"
6321
6322 #. type: Plain text
6323 #: build/C/man2/send.2:341
6324 msgid "No memory available."
6325 msgstr "メモリが足りない。"
6326
6327 #. type: Plain text
6328 #: build/C/man2/send.2:344
6329 msgid "The socket is not connected, and no target has been given."
6330 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6331
6332 #. type: Plain text
6333 #: build/C/man2/send.2:354
6334 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6335 msgstr ""
6336 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6337 "る。"
6338
6339 #. type: TP
6340 #: build/C/man2/send.2:354
6341 #, no-wrap
6342 msgid "B<EPIPE>"
6343 msgstr "B<EPIPE>"
6344
6345 #. type: Plain text
6346 #: build/C/man2/send.2:363
6347 msgid ""
6348 "The local end has been shut down on a connection oriented socket.  In this "
6349 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6350 "set."
6351 msgstr ""
6352 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6353 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6354
6355 #. type: Plain text
6356 #: build/C/man2/send.2:366
6357 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
6358 msgstr ""
6359 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
6360
6361 #. type: Plain text
6362 #: build/C/man2/send.2:377
6363 msgid ""
6364 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags.  "
6365 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
6366 "flag is a Linux extension."
6367 msgstr ""
6368 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
6369 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
6370 "ラグは Linux での拡張である。"
6371
6372 #. type: Plain text
6373 #: build/C/man2/send.2:390
6374 msgid ""
6375 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
6376 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
6377 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
6378 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
6379 "and libc5.  See also B<accept>(2)."
6380 msgstr ""
6381 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
6382 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
6383 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
6384 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
6385 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
6386
6387 #. type: Plain text
6388 #: build/C/man2/send.2:409
6389 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
6390 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
6391
6392 #. type: Plain text
6393 #: build/C/man2/send.2:414
6394 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
6395 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
6396
6397 #. type: Plain text
6398 #: build/C/man2/send.2:428
6399 msgid ""
6400 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6401 "B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>(7), B<socket>"
6402 "(7), B<tcp>(7), B<udp>(7)"
6403 msgstr ""
6404 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6405 "B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>(7), B<socket>"
6406 "(7), B<tcp>(7), B<udp>(7)"
6407
6408 #. type: TH
6409 #: build/C/man3/sockatmark.3:23
6410 #, no-wrap
6411 msgid "SOCKATMARK"
6412 msgstr "SOCKATMARK"
6413
6414 #. type: Plain text
6415 #: build/C/man3/sockatmark.3:26
6416 msgid "sockatmark - determine whether socket is at out-of-band mark"
6417 msgstr ""
6418 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
6419 "べる"
6420
6421 #. type: Plain text
6422 #: build/C/man3/sockatmark.3:28 build/C/man2/socket.2:48
6423 #: build/C/man7/socket.7:31 build/C/man2/socketpair.2:47
6424 msgid "B<#include E<lt>sys/socket.hE<gt>>"
6425 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
6426
6427 #. type: Plain text
6428 #: build/C/man3/sockatmark.3:30
6429 msgid "B<int sockatmark(int >I<sockfd>B<);>"
6430 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
6431
6432 #. type: Plain text
6433 #: build/C/man3/sockatmark.3:39
6434 msgid ""
6435 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6436 "\\ 600"
6437 msgstr ""
6438 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6439 "\\ 600"
6440
6441 #. type: Plain text
6442 #: build/C/man3/sockatmark.3:49
6443 msgid ""
6444 "B<sockatmark>()  returns a value indicating whether or not the socket "
6445 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
6446 "the socket is at the mark, then 1 is returned; if the socket is not at the "
6447 "mark, 0 is returned.  This function does not remove the out-of-band mark."
6448 msgstr ""
6449 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
6450 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
6451 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
6452 "この関数は帯域外マークを削除しない。"
6453
6454 #. type: Plain text
6455 #: build/C/man3/sockatmark.3:54
6456 msgid ""
6457 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
6458 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
6459 "set to indicate the error."
6460 msgstr ""
6461 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
6462 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
6463 "れ、エラーを表す I<errno> が設定される。"
6464
6465 #. type: Plain text
6466 #: build/C/man3/sockatmark.3:59
6467 msgid "I<sockfd> is not a valid file descriptor."
6468 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
6469
6470 #.  POSIX.1 says ENOTTY for this case
6471 #. type: Plain text
6472 #: build/C/man3/sockatmark.3:66
6473 msgid ""
6474 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
6475 msgstr ""
6476 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
6477
6478 #. type: Plain text
6479 #: build/C/man3/sockatmark.3:69
6480 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
6481 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
6482
6483 #. type: Plain text
6484 #: build/C/man3/sockatmark.3:71
6485 msgid "POSIX.1-2001."
6486 msgstr "POSIX.1-2001."
6487
6488 #. type: Plain text
6489 #: build/C/man3/sockatmark.3:78
6490 msgid ""
6491 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
6492 "the B<MSG_OOB> flag of B<recv>(2)."
6493 msgstr ""
6494 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
6495 "B<recv>(2)  で読み込むことができる。"
6496
6497 #. type: Plain text
6498 #: build/C/man3/sockatmark.3:80
6499 msgid "Out-of-band data is only supported on some stream socket protocols."
6500 msgstr ""
6501 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
6502 "ない。"
6503
6504 #. type: Plain text
6505 #: build/C/man3/sockatmark.3:85
6506 msgid ""
6507 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
6508 "signal."
6509 msgstr ""
6510 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
6511 "る。"
6512
6513 #. type: Plain text
6514 #: build/C/man3/sockatmark.3:91
6515 msgid ""
6516 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
6517 "operation."
6518 msgstr ""
6519 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
6520
6521 #. type: Plain text
6522 #: build/C/man3/sockatmark.3:95
6523 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
6524 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
6525
6526 #. type: Plain text
6527 #: build/C/man3/sockatmark.3:100
6528 msgid ""
6529 "The following code can be used after receipt of a B<SIGURG> signal to read "
6530 "(and discard) all data up to the mark, and then read the byte of data at the "
6531 "mark:"
6532 msgstr ""
6533 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
6534 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
6535
6536 #. type: Plain text
6537 #: build/C/man3/sockatmark.3:105
6538 #, no-wrap
6539 msgid ""
6540 "    char buf[BUF_LEN];\n"
6541 "    char oobdata;\n"
6542 "    int atmark, s;\n"
6543 msgstr ""
6544 "    char buf[BUF_LEN];\n"
6545 "    char oobdata;\n"
6546 "    int atmark, s;\n"
6547
6548 #. type: Plain text
6549 #: build/C/man3/sockatmark.3:112
6550 #, no-wrap
6551 msgid ""
6552 "    for (;;) {\n"
6553 "        atmark = sockatmark(sockfd);\n"
6554 "        if (atmark == -1) {\n"
6555 "            perror(\"sockatmark\");\n"
6556 "            break;\n"
6557 "        }\n"
6558 msgstr ""
6559 "    for (;;) {\n"
6560 "        atmark = sockatmark(sockfd);\n"
6561 "        if (atmark == -1) {\n"
6562 "            perror(\"sockatmark\");\n"
6563 "            break;\n"
6564 "        }\n"
6565
6566 #. type: Plain text
6567 #: build/C/man3/sockatmark.3:115
6568 #, no-wrap
6569 msgid ""
6570 "        if (atmark)\n"
6571 "            break;\n"
6572 msgstr ""
6573 "        if (atmark)\n"
6574 "            break;\n"
6575
6576 #. type: Plain text
6577 #: build/C/man3/sockatmark.3:122
6578 #, no-wrap
6579 msgid ""
6580 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6581 "        if (s == -1)\n"
6582 "            perror(\"read\");\n"
6583 "        if (s E<lt>= 0)\n"
6584 "            break;\n"
6585 "    }\n"
6586 msgstr ""
6587 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6588 "        if (s == -1)\n"
6589 "            perror(\"read\");\n"
6590 "        if (s E<lt>= 0)\n"
6591 "            break;\n"
6592 "    }\n"
6593
6594 #. type: Plain text
6595 #: build/C/man3/sockatmark.3:129
6596 #, no-wrap
6597 msgid ""
6598 "    if (atmark == 1) {\n"
6599 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6600 "            perror(\"recv\");\n"
6601 "            ...\n"
6602 "        }\n"
6603 "    }\n"
6604 msgstr ""
6605 "    if (atmark == 1) {\n"
6606 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6607 "            perror(\"recv\");\n"
6608 "            ...\n"
6609 "        }\n"
6610 "    }\n"
6611
6612 #. type: Plain text
6613 #: build/C/man3/sockatmark.3:135
6614 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6615 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6616
6617 #. type: TH
6618 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
6619 #, no-wrap
6620 msgid "SOCKET"
6621 msgstr "SOCKET"
6622
6623 #. type: TH
6624 #: build/C/man2/socket.2:41
6625 #, no-wrap
6626 msgid "2009-01-19"
6627 msgstr "2009-01-19"
6628
6629 #. type: Plain text
6630 #: build/C/man2/socket.2:44
6631 msgid "socket - create an endpoint for communication"
6632 msgstr "socket - 通信のための端点(endpoint)を作成する"
6633
6634 #. type: Plain text
6635 #: build/C/man2/socket.2:46 build/C/man2/socketpair.2:45
6636 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
6637 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
6638
6639 #. type: Plain text
6640 #: build/C/man2/socket.2:50
6641 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6642 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6643
6644 #. type: Plain text
6645 #: build/C/man2/socket.2:53
6646 msgid ""
6647 "B<socket>()  creates an endpoint for communication and returns a descriptor."
6648 msgstr ""
6649 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
6650 "(descriptor)を返す。"
6651
6652 #. type: Plain text
6653 #: build/C/man2/socket.2:61
6654 msgid ""
6655 "The I<domain> argument specifies a communication domain; this selects the "
6656 "protocol family which will be used for communication.  These families are "
6657 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
6658 "include:"
6659 msgstr ""
6660 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
6661 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
6662 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
6663 "下の通り。"
6664
6665 #. type: tbl table
6666 #: build/C/man2/socket.2:64
6667 #, no-wrap
6668 msgid "Name:Purpose:Man page\n"
6669 msgstr "名前:目的:マニュアル\n"
6670
6671 #. type: tbl table
6672 #: build/C/man2/socket.2:65 build/C/man2/socket.2:72 build/C/man2/socket.2:77
6673 #: build/C/man2/socket.2:82 build/C/man2/socket.2:85 build/C/man2/socket.2:92
6674 #: build/C/man2/socket.2:97 build/C/man2/socket.2:102
6675 #: build/C/man2/socket.2:105 build/C/man2/socket.2:110
6676 #, no-wrap
6677 msgid "T{\n"
6678 msgstr "T{\n"
6679
6680 #. type: tbl table
6681 #: build/C/man2/socket.2:66
6682 #, no-wrap
6683 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
6684 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
6685
6686 #. type: tbl table
6687 #: build/C/man2/socket.2:67 build/C/man2/socket.2:69 build/C/man2/socket.2:87
6688 #: build/C/man2/socket.2:89 build/C/man2/socket.2:99 build/C/man2/socket.2:112
6689 #: build/C/man2/socket.2:114 build/C/man7/socket.7:162
6690 #, no-wrap
6691 msgid "T}:T{\n"
6692 msgstr "T}:T{\n"
6693
6694 #. type: tbl table
6695 #: build/C/man2/socket.2:68
6696 #, no-wrap
6697 msgid "Local communication\n"
6698 msgstr "ローカル通信\n"
6699
6700 #. type: tbl table
6701 #: build/C/man2/socket.2:70
6702 #, no-wrap
6703 msgid "B<unix>(7)\n"
6704 msgstr "B<unix>(7)\n"
6705
6706 #. type: tbl table
6707 #: build/C/man2/socket.2:71 build/C/man2/socket.2:76 build/C/man2/socket.2:81
6708 #: build/C/man2/socket.2:91 build/C/man2/socket.2:96 build/C/man2/socket.2:109
6709 #: build/C/man2/socket.2:116 build/C/man7/socket.7:141
6710 #: build/C/man7/socket.7:145 build/C/man7/socket.7:148
6711 #: build/C/man7/socket.7:154 build/C/man7/socket.7:157
6712 #: build/C/man7/socket.7:166 build/C/man7/socket.7:173
6713 #, no-wrap
6714 msgid "T}\n"
6715 msgstr "T}\n"
6716
6717 #. type: tbl table
6718 #: build/C/man2/socket.2:73
6719 #, no-wrap
6720 msgid "B<AF_INET>\n"
6721 msgstr "B<AF_INET>\n"
6722
6723 #. type: tbl table
6724 #: build/C/man2/socket.2:74
6725 #, no-wrap
6726 msgid "T}:IPv4 Internet protocols:T{\n"
6727 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
6728
6729 #. type: tbl table
6730 #: build/C/man2/socket.2:75
6731 #, no-wrap
6732 msgid "B<ip>(7)\n"
6733 msgstr "B<ip>(7)\n"
6734
6735 #. type: tbl table
6736 #: build/C/man2/socket.2:78
6737 #, no-wrap
6738 msgid "B<AF_INET6>\n"
6739 msgstr "B<AF_INET6>\n"
6740
6741 #. type: tbl table
6742 #: build/C/man2/socket.2:79
6743 #, no-wrap
6744 msgid "T}:IPv6 Internet protocols:T{\n"
6745 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
6746
6747 #. type: tbl table
6748 #: build/C/man2/socket.2:80
6749 #, no-wrap
6750 msgid "B<ipv6>(7)\n"
6751 msgstr "B<ipv6>(7)\n"
6752
6753 #. type: tbl table
6754 #: build/C/man2/socket.2:83
6755 #, no-wrap
6756 msgid "B<AF_IPX>\n"
6757 msgstr "B<AF_IPX>\n"
6758
6759 #. type: tbl table
6760 #: build/C/man2/socket.2:84
6761 #, no-wrap
6762 msgid "T}:IPX - Novell protocols:\n"
6763 msgstr "T}:IPX - Novell プロトコル:\n"
6764
6765 #. type: tbl table
6766 #: build/C/man2/socket.2:86
6767 #, no-wrap
6768 msgid "B<AF_NETLINK>\n"
6769 msgstr "B<AF_NETLINK>\n"
6770
6771 #. type: tbl table
6772 #: build/C/man2/socket.2:88
6773 #, no-wrap
6774 msgid "Kernel user interface device\n"
6775 msgstr "カーネル・ユーザ・デバイス\n"
6776
6777 #. type: tbl table
6778 #: build/C/man2/socket.2:90
6779 #, no-wrap
6780 msgid "B<netlink>(7)\n"
6781 msgstr "B<netlink>(7)\n"
6782
6783 #. type: tbl table
6784 #: build/C/man2/socket.2:93
6785 #, no-wrap
6786 msgid "B<AF_X25>\n"
6787 msgstr "B<AF_X25>\n"
6788
6789 #. type: tbl table
6790 #: build/C/man2/socket.2:94
6791 #, no-wrap
6792 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
6793 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
6794
6795 #. type: tbl table
6796 #: build/C/man2/socket.2:95
6797 #, no-wrap
6798 msgid "B<x25>(7)\n"
6799 msgstr "B<x25>(7)\n"
6800
6801 #. type: tbl table
6802 #: build/C/man2/socket.2:98
6803 #, no-wrap
6804 msgid "B<AF_AX25>\n"
6805 msgstr "B<AF_AX25>\n"
6806
6807 #. type: tbl table
6808 #: build/C/man2/socket.2:100
6809 #, no-wrap
6810 msgid "Amateur radio AX.25 protocol\n"
6811 msgstr "アマチュア無線 AX.25 プロトコル\n"
6812
6813 #. type: tbl table
6814 #: build/C/man2/socket.2:101
6815 #, no-wrap
6816 msgid "T}:\n"
6817 msgstr "T}:\n"
6818
6819 #. type: tbl table
6820 #: build/C/man2/socket.2:103
6821 #, no-wrap
6822 msgid "B<AF_ATMPVC>\n"
6823 msgstr "B<AF_ATMPVC>\n"
6824
6825 #. type: tbl table
6826 #: build/C/man2/socket.2:104
6827 #, no-wrap
6828 msgid "T}:Access to raw ATM PVCs:\n"
6829 msgstr "T}:生の ATM PVC にアクセスする:\n"
6830
6831 #. type: tbl table
6832 #: build/C/man2/socket.2:106
6833 #, no-wrap
6834 msgid "B<AF_APPLETALK>\n"
6835 msgstr "B<AF_APPLETALK>\n"
6836
6837 #. type: tbl table
6838 #: build/C/man2/socket.2:107
6839 #, no-wrap
6840 msgid "T}:Appletalk:T{\n"
6841 msgstr "T}:アップルトーク:T{\n"
6842
6843 #. type: tbl table
6844 #: build/C/man2/socket.2:108
6845 #, no-wrap
6846 msgid "B<ddp>(7)\n"
6847 msgstr "B<ddp>(7)\n"
6848
6849 #. type: tbl table
6850 #: build/C/man2/socket.2:111
6851 #, no-wrap
6852 msgid "B<AF_PACKET>\n"
6853 msgstr "B<AF_PACKET>\n"
6854
6855 #. type: tbl table
6856 #: build/C/man2/socket.2:113
6857 #, no-wrap
6858 msgid "Low level packet interface\n"
6859 msgstr "低レベルのパケットインターフェース\n"
6860
6861 #. type: tbl table
6862 #: build/C/man2/socket.2:115
6863 #, no-wrap
6864 msgid "B<packet>(7)\n"
6865 msgstr "B<packet>(7)\n"
6866
6867 #. type: Plain text
6868 #: build/C/man2/socket.2:124
6869 msgid ""
6870 "The socket has the indicated I<type>, which specifies the communication "
6871 "semantics.  Currently defined types are:"
6872 msgstr ""
6873 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
6874 "る。 定義されている型は現在以下の通り。"
6875
6876 #. type: TP
6877 #: build/C/man2/socket.2:124
6878 #, no-wrap
6879 msgid "B<SOCK_STREAM>"
6880 msgstr "B<SOCK_STREAM>"
6881
6882 #. type: Plain text
6883 #: build/C/man2/socket.2:128
6884 msgid ""
6885 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
6886 "out-of-band data transmission mechanism may be supported."
6887 msgstr ""
6888 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
6889 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
6890
6891 #. type: TP
6892 #: build/C/man2/socket.2:128
6893 #, no-wrap
6894 msgid "B<SOCK_DGRAM>"
6895 msgstr "B<SOCK_DGRAM>"
6896
6897 #. type: Plain text
6898 #: build/C/man2/socket.2:132
6899 msgid ""
6900 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
6901 "length)."
6902 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ)  をサポートする。"
6903
6904 #. type: TP
6905 #: build/C/man2/socket.2:132
6906 #, no-wrap
6907 msgid "B<SOCK_SEQPACKET>"
6908 msgstr "B<SOCK_SEQPACKET>"
6909
6910 #. type: Plain text
6911 #: build/C/man2/socket.2:137
6912 msgid ""
6913 "Provides a sequenced, reliable, two-way connection-based data transmission "
6914 "path for datagrams of fixed maximum length; a consumer is required to read "
6915 "an entire packet with each input system call."
6916 msgstr ""
6917 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
6918 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
6919 "ト全体を読み取ることが要求される。"
6920
6921 #. type: TP
6922 #: build/C/man2/socket.2:137
6923 #, no-wrap
6924 msgid "B<SOCK_RAW>"
6925 msgstr "B<SOCK_RAW>"
6926
6927 #. type: Plain text
6928 #: build/C/man2/socket.2:140
6929 msgid "Provides raw network protocol access."
6930 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
6931
6932 #. type: TP
6933 #: build/C/man2/socket.2:140
6934 #, no-wrap
6935 msgid "B<SOCK_RDM>"
6936 msgstr "B<SOCK_RDM>"
6937
6938 #. type: Plain text
6939 #: build/C/man2/socket.2:143
6940 msgid "Provides a reliable datagram layer that does not guarantee ordering."
6941 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
6942
6943 #. type: TP
6944 #: build/C/man2/socket.2:143
6945 #, no-wrap
6946 msgid "B<SOCK_PACKET>"
6947 msgstr "B<SOCK_PACKET>"
6948
6949 #. type: Plain text
6950 #: build/C/man2/socket.2:148
6951 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
6952 msgstr ""
6953 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
6954 "こと"
6955
6956 #. type: Plain text
6957 #: build/C/man2/socket.2:154
6958 msgid ""
6959 "Some socket types may not be implemented by all protocol families; for "
6960 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
6961 msgstr ""
6962 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
6963 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
6964
6965 #. type: Plain text
6966 #: build/C/man2/socket.2:162
6967 msgid ""
6968 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
6969 "addition to specifying a socket type, it may include the bitwise OR of any "
6970 "of the following values, to modify the behavior of B<socket>():"
6971 msgstr ""
6972 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
6973 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
6974 "ることで、 B<socket>()  の振舞いを変更することができる。"
6975
6976 #. type: Plain text
6977 #: build/C/man2/socket.2:196
6978 msgid ""
6979 "The I<protocol> specifies a particular protocol to be used with the socket.  "
6980 "Normally only a single protocol exists to support a particular socket type "
6981 "within a given protocol family, in which case I<protocol> can be specified "
6982 "as 0.  However, it is possible that many protocols may exist, in which case "
6983 "a particular protocol must be specified in this manner.  The protocol number "
6984 "to use is specific to the ``communication domain'' in which communication is "
6985 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
6986 "protocol name strings to protocol numbers."
6987 msgstr ""
6988 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
6989 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
6990 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
6991 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
6992 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
6993 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
6994 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
6995
6996 #. type: Plain text
6997 #: build/C/man2/socket.2:226
6998 msgid ""
6999 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7000 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7001 "a I<connected> state before any data may be sent or received on it.  A "
7002 "connection to another socket is created with a B<connect>(2)  call.  Once "
7003 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7004 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7005 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7006 "also be transmitted as described in B<send>(2)  and received as described in "
7007 "B<recv>(2)."
7008 msgstr ""
7009 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7010 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7011 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7012 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7013 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7014 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7015 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7016
7017 #. type: Plain text
7018 #: build/C/man2/socket.2:252
7019 msgid ""
7020 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7021 "data is not lost or duplicated.  If a piece of data for which the peer "
7022 "protocol has buffer space cannot be successfully transmitted within a "
7023 "reasonable length of time, then the connection is considered to be dead.  "
7024 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7025 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
7026 "signal is raised if a process sends or receives on a broken stream; this "
7027 "causes naive processes, which do not handle the signal, to exit.  "
7028 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7029 "sockets.  The only difference is that B<read>(2)  calls will return only the "
7030 "amount of data requested, and any data remaining in the arriving packet will "
7031 "be discarded.  Also all message boundaries in incoming datagrams are "
7032 "preserved."
7033 msgstr ""
7034 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7035 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7036 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7037 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7038 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7039 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7040 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7041 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
7042 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
7043 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
7044
7045 #. type: Plain text
7046 #: build/C/man2/socket.2:262
7047 msgid ""
7048 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
7049 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
7050 "received with B<recvfrom>(2), which returns the next datagram along with the "
7051 "address of its sender."
7052 msgstr ""
7053 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
7054 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
7055 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
7056 "す。"
7057
7058 #. type: Plain text
7059 #: build/C/man2/socket.2:269
7060 msgid ""
7061 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
7062 "from the device driver.  Use B<packet>(7)  instead."
7063 msgstr ""
7064 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
7065 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
7066
7067 #. type: Plain text
7068 #: build/C/man2/socket.2:292
7069 msgid ""
7070 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
7071 "process group to receive a B<SIGURG> signal when the out-of-band data "
7072 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
7073 "unexpectedly.  This operation may also be used to set the process or process "
7074 "group that receives the I/O and asynchronous notification of I/O events via "
7075 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
7076 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
7077 msgstr ""
7078 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
7079 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
7080 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
7081 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
7082 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
7083 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
7084 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
7085
7086 #. type: Plain text
7087 #: build/C/man2/socket.2:302
7088 msgid ""
7089 "When the network signals an error condition to the protocol module (e.g., "
7090 "using a ICMP message for IP) the pending error flag is set for the socket.  "
7091 "The next operation on this socket will return the error code of the pending "
7092 "error.  For some protocols it is possible to enable a per-socket error queue "
7093 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
7094 "(7)."
7095 msgstr ""
7096 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
7097 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
7098 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
7099 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
7100 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
7101 "B<IP_RECVERR> を参照すること。"
7102
7103 #. type: Plain text
7104 #: build/C/man2/socket.2:312
7105 msgid ""
7106 "The operation of sockets is controlled by socket level I<options>.  These "
7107 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
7108 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
7109 "respectively."
7110 msgstr ""
7111 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
7112 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
7113 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
7114
7115 #. type: Plain text
7116 #: build/C/man2/socket.2:317
7117 msgid ""
7118 "On success, a file descriptor for the new socket is returned.  On error, -1 "
7119 "is returned, and I<errno> is set appropriately."
7120 msgstr ""
7121 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
7122 "した場合は -1 を返し、 I<errno> を適切に設定する。"
7123
7124 #. type: Plain text
7125 #: build/C/man2/socket.2:322
7126 msgid ""
7127 "Permission to create a socket of the specified type and/or protocol is "
7128 "denied."
7129 msgstr ""
7130 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
7131
7132 #. type: Plain text
7133 #: build/C/man2/socket.2:325
7134 msgid "The implementation does not support the specified address family."
7135 msgstr "指定されたアドレスファミリーがサポートされていない。"
7136
7137 #. type: Plain text
7138 #: build/C/man2/socket.2:328
7139 msgid "Unknown protocol, or protocol family not available."
7140 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
7141
7142 #.  Since Linux 2.6.27
7143 #. type: Plain text
7144 #: build/C/man2/socket.2:333
7145 msgid "Invalid flags in I<type>."
7146 msgstr "I<type> に無効なフラグが指定されている。"
7147
7148 #. type: Plain text
7149 #: build/C/man2/socket.2:336
7150 msgid "Process file table overflow."
7151 msgstr "プロセスのファイルテーブルが溢れている。"
7152
7153 #. type: TP
7154 #: build/C/man2/socket.2:339
7155 #, no-wrap
7156 msgid "B<ENOBUFS> or B<ENOMEM>"
7157 msgstr "B<ENOBUFS> または B<ENOMEM>"
7158
7159 #. type: Plain text
7160 #: build/C/man2/socket.2:344
7161 msgid ""
7162 "Insufficient memory is available.  The socket cannot be created until "
7163 "sufficient resources are freed."
7164 msgstr ""
7165 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
7166 "ない。"
7167
7168 #. type: TP
7169 #: build/C/man2/socket.2:344 build/C/man2/socketpair.2:90
7170 #, no-wrap
7171 msgid "B<EPROTONOSUPPORT>"
7172 msgstr "B<EPROTONOSUPPORT>"
7173
7174 #. type: Plain text
7175 #: build/C/man2/socket.2:348
7176 msgid ""
7177 "The protocol type or the specified protocol is not supported within this "
7178 "domain."
7179 msgstr ""
7180 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
7181 "いない。"
7182
7183 #. type: Plain text
7184 #: build/C/man2/socket.2:350
7185 msgid "Other errors may be generated by the underlying protocol modules."
7186 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
7187
7188 #. type: Plain text
7189 #: build/C/man2/socket.2:352
7190 msgid "4.4BSD, POSIX.1-2001."
7191 msgstr "4.4BSD, POSIX.1-2001."
7192
7193 #. type: Plain text
7194 #: build/C/man2/socket.2:358
7195 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
7196 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
7197
7198 #. type: Plain text
7199 #: build/C/man2/socket.2:364
7200 msgid ""
7201 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
7202 "systems supporting clones of the BSD socket layer (including System V "
7203 "variants)."
7204 msgstr ""
7205 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
7206 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
7207 "外のシステムからの移植ができる。"
7208
7209 #. type: Plain text
7210 #: build/C/man2/socket.2:382
7211 msgid ""
7212 "The manifest constants used under 4.x BSD for protocol families are "
7213 "B<PF_UNIX>, B<PF_INET>, etc., while B<AF_UNIX> etc. are used for address "
7214 "families.  However, already the BSD man page promises: \"The protocol family "
7215 "generally is the same as the address family\", and subsequent standards use "
7216 "AF_* everywhere."
7217 msgstr ""
7218 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには B<PF_UNIX>, "
7219 "B<PF_INET> 等を使用している。一方でアドレス・ファミリーには B<AF_UNIX> 等が使"
7220 "用されている。しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミ"
7221 "リーはアドレス・ファミリーと同じものである。」 と保証している。それでそれ以外"
7222 "の規格では全ての場所で AF_* が使用されている。"
7223
7224 #. type: Plain text
7225 #: build/C/man2/socket.2:387
7226 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
7227 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7228
7229 #. type: Plain text
7230 #: build/C/man2/socket.2:410
7231 msgid ""
7232 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7233 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7234 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7235 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7236 "(7), B<unix>(7)"
7237 msgstr ""
7238 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7239 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7240 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7241 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7242 "(7), B<unix>(7)"
7243
7244 #. type: Plain text
7245 #: build/C/man2/socket.2:414
7246 msgid ""
7247 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq is "
7248 "reprinted in I<UNIX Programmer's Supplementary Documents Volume 1.>"
7249 msgstr ""
7250 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq は "
7251 "I<UNIX Programmer's Supplementary Documents Volume 1> として再版された。"
7252
7253 #. type: Plain text
7254 #: build/C/man2/socket.2:418
7255 msgid ""
7256 "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
7257 "Programmer's Supplementary Documents Volume 1.>"
7258 msgstr ""
7259 "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
7260 "Supplementary Documents Volume 1> として再版された。"
7261
7262 #. type: TH
7263 #: build/C/man7/socket.7:26
7264 #, fuzzy, no-wrap
7265 #| msgid "2010-06-10"
7266 msgid "2010-06-13"
7267 msgstr "2010-06-10"
7268
7269 #. type: Plain text
7270 #: build/C/man7/socket.7:29
7271 msgid "socket - Linux socket interface"
7272 msgstr "socket - Linux のソケットインターフェース"
7273
7274 #. type: Plain text
7275 #: build/C/man7/socket.7:33
7276 msgid ""
7277 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7278 ">I<protocol>B<);>"
7279 msgstr ""
7280 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7281 ">I<protocol>B<);>"
7282
7283 #. type: Plain text
7284 #: build/C/man7/socket.7:52
7285 msgid ""
7286 "This manual page describes the Linux networking socket layer user "
7287 "interface.  The BSD compatible sockets are the uniform interface between the "
7288 "user process and the network protocol stacks in the kernel.  The protocol "
7289 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
7290 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
7291 "B<socket>(2)  for more information on families and types."
7292 msgstr ""
7293 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
7294 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
7295 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
7296 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
7297 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
7298 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
7299 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
7300
7301 #. type: SS
7302 #: build/C/man7/socket.7:52
7303 #, no-wrap
7304 msgid "Socket Layer Functions"
7305 msgstr "ソケット層の関数群"
7306
7307 #. type: Plain text
7308 #: build/C/man7/socket.7:56
7309 msgid ""
7310 "These functions are used by the user process to send or receive packets and "
7311 "to do other socket operations.  For more information see their respective "
7312 "manual pages."
7313 msgstr ""
7314 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
7315 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
7316
7317 #. type: Plain text
7318 #: build/C/man7/socket.7:72
7319 msgid ""
7320 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
7321 "socket address, the B<bind>(2)  function binds a socket to a local socket "
7322 "address, B<listen>(2)  tells the socket that new connections shall be "
7323 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
7324 "connection.  B<socketpair>(2)  returns two connected anonymous sockets (only "
7325 "implemented for a few local families like B<AF_UNIX>)"
7326 msgstr ""
7327 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
7328 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
7329 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
7330 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
7331 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
7332 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
7333 "リーでしか実装されていない)。"
7334
7335 #. type: Plain text
7336 #: build/C/man7/socket.7:94
7337 msgid ""
7338 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
7339 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
7340 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
7341 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
7342 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
7343 "write data."
7344 msgstr ""
7345 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
7346 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
7347 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
7348 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
7349 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
7350 "ことができる。"
7351
7352 #. type: Plain text
7353 #: build/C/man7/socket.7:105
7354 msgid ""
7355 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
7356 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
7357 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
7358 "be used to set or read some other options."
7359 msgstr ""
7360 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
7361 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
7362 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
7363 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
7364
7365 #. type: Plain text
7366 #: build/C/man7/socket.7:110
7367 msgid ""
7368 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
7369 "full-duplex socket connection."
7370 msgstr ""
7371 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
7372 "続を部分的にクローズする。"
7373
7374 #. type: Plain text
7375 #: build/C/man7/socket.7:116
7376 msgid ""
7377 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
7378 "not supported on sockets."
7379 msgstr ""
7380 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
7381 "ではサポートされていない。"
7382
7383 #. type: Plain text
7384 #: build/C/man7/socket.7:133
7385 msgid ""
7386 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
7387 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
7388 "that would block will (usually)  return with B<EAGAIN> (operation should be "
7389 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
7390 "can then wait for various events via B<poll>(2)  or B<select>(2)."
7391 msgstr ""
7392 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
7393 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
7394 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
7395 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
7396 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
7397 "B<select>(2)  を使って待つことができる。"
7398
7399 #. type: tbl table
7400 #: build/C/man7/socket.7:137
7401 #, no-wrap
7402 msgid "I/O events\n"
7403 msgstr "I/O イベント\n"
7404
7405 #. type: tbl table
7406 #: build/C/man7/socket.7:138
7407 #, no-wrap
7408 msgid "Event:Poll flag:Occurrence\n"
7409 msgstr "イベント:poll フラグ:内容\n"
7410
7411 #. type: tbl table
7412 #: build/C/man7/socket.7:139 build/C/man7/socket.7:142
7413 #, no-wrap
7414 msgid "Read:POLLIN:T{\n"
7415 msgstr "Read:POLLIN:T{\n"
7416
7417 #. type: tbl table
7418 #: build/C/man7/socket.7:140
7419 #, no-wrap
7420 msgid "New data arrived.\n"
7421 msgstr "新しいデータが到着した。\n"
7422
7423 #. type: tbl table
7424 #: build/C/man7/socket.7:143
7425 #, no-wrap
7426 msgid "A connection setup has been completed\n"
7427 msgstr "(接続志向のソケットで)\n"
7428
7429 #. type: tbl table
7430 #: build/C/man7/socket.7:144
7431 #, no-wrap
7432 msgid "(for connection-oriented sockets)\n"
7433 msgstr "接続の設定が終了した。\n"
7434
7435 #. type: tbl table
7436 #: build/C/man7/socket.7:146 build/C/man7/socket.7:149
7437 #, no-wrap
7438 msgid "Read:POLLHUP:T{\n"
7439 msgstr "Read:POLLHUP:T{\n"
7440
7441 #. type: tbl table
7442 #: build/C/man7/socket.7:147
7443 #, no-wrap
7444 msgid "A disconnection request has been initiated by the other end.\n"
7445 msgstr "接続先で切断要求が生成された。\n"
7446
7447 #. type: tbl table
7448 #: build/C/man7/socket.7:150
7449 #, no-wrap
7450 msgid "A connection is broken (only for connection-oriented protocols).\n"
7451 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
7452
7453 #. type: tbl table
7454 #: build/C/man7/socket.7:151
7455 #, no-wrap
7456 msgid "When the socket is written\n"
7457 msgstr "この場合、ソケットに書き込みが行われると\n"
7458
7459 #. type: tbl table
7460 #: build/C/man7/socket.7:152
7461 #, no-wrap
7462 msgid "B<SIGPIPE>\n"
7463 msgstr "B<SIGPIPE>\n"
7464
7465 #. type: tbl table
7466 #: build/C/man7/socket.7:153
7467 #, no-wrap
7468 msgid "is also sent.\n"
7469 msgstr "も送信される。\n"
7470
7471 #. type: tbl table
7472 #: build/C/man7/socket.7:155
7473 #, no-wrap
7474 msgid "Write:POLLOUT:T{\n"
7475 msgstr "Write:POLLOUT:T{\n"
7476
7477 #. type: tbl table
7478 #: build/C/man7/socket.7:156
7479 #, no-wrap
7480 msgid "Socket has enough send buffer space for writing new data.\n"
7481 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
7482
7483 #. type: tbl table
7484 #: build/C/man7/socket.7:158
7485 #, no-wrap
7486 msgid "Read/Write:T{\n"
7487 msgstr "Read/Write:T{\n"
7488
7489 #. type: tbl table
7490 #: build/C/man7/socket.7:159
7491 #, no-wrap
7492 msgid "POLLIN|\n"
7493 msgstr "POLLIN|\n"
7494
7495 #. type: tbl table
7496 #: build/C/man7/socket.7:160
7497 #, no-wrap
7498 msgid ".br\n"
7499 msgstr ".br\n"
7500
7501 #. type: tbl table
7502 #: build/C/man7/socket.7:161
7503 #, no-wrap
7504 msgid "POLLOUT\n"
7505 msgstr "POLLOUT\n"
7506
7507 #. type: tbl table
7508 #: build/C/man7/socket.7:163
7509 #, no-wrap
7510 msgid "An outgoing\n"
7511 msgstr "外部向けの\n"
7512
7513 #. type: tbl table
7514 #: build/C/man7/socket.7:164
7515 #, no-wrap
7516 msgid "B<connect>(2)\n"
7517 msgstr "B<connect>(2)\n"
7518
7519 #. type: tbl table
7520 #: build/C/man7/socket.7:165
7521 #, no-wrap
7522 msgid "finished.\n"
7523 msgstr "が終了した。\n"
7524
7525 #. type: tbl table
7526 #: build/C/man7/socket.7:167
7527 #, no-wrap
7528 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
7529 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
7530
7531 #. type: tbl table
7532 #: build/C/man7/socket.7:168
7533 #, no-wrap
7534 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
7535 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
7536
7537 #. type: tbl table
7538 #: build/C/man7/socket.7:169
7539 #, no-wrap
7540 msgid "Exception:POLLPRI:T{\n"
7541 msgstr "Exception:POLLPRI:T{\n"
7542
7543 #. type: tbl table
7544 #: build/C/man7/socket.7:170
7545 #, no-wrap
7546 msgid "Urgent data arrived.\n"
7547 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
7548
7549 #. type: tbl table
7550 #: build/C/man7/socket.7:171
7551 #, no-wrap
7552 msgid "B<SIGURG>\n"
7553 msgstr "B<SIGURG>\n"
7554
7555 #. type: tbl table
7556 #: build/C/man7/socket.7:172
7557 #, no-wrap
7558 msgid "is sent then.\n"
7559 msgstr "が送信される。\n"
7560
7561 #. type: Plain text
7562 #: build/C/man7/socket.7:202
7563 msgid ""
7564 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
7565 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
7566 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
7567 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
7568 "I<Signals> discussion below."
7569 msgstr ""
7570 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
7571 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
7572 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
7573 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
7574 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
7575 "と。"
7576
7577 #. type: SS
7578 #: build/C/man7/socket.7:202
7579 #, no-wrap
7580 msgid "Socket Options"
7581 msgstr "ソケットオプション"
7582
7583 #.  FIXME
7584 #.  In the list below, the text used to describe argument types
7585 #.  for each socket option should be more consistent
7586 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
7587 #.  W R Stevens, UNPv1
7588 #. type: Plain text
7589 #: build/C/man7/socket.7:216
7590 msgid ""
7591 "These socket options can be set by using B<setsockopt>(2)  and read with "
7592 "B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for all sockets:"
7593 msgstr ""
7594 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
7595 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
7596 "レベルには B<SOL_SOCKET> を指定すること。"
7597
7598 #. type: TP
7599 #: build/C/man7/socket.7:216
7600 #, no-wrap
7601 msgid "B<SO_ACCEPTCONN>"
7602 msgstr "B<SO_ACCEPTCONN>"
7603
7604 #. type: Plain text
7605 #: build/C/man7/socket.7:224
7606 #, fuzzy
7607 #| msgid ""
7608 #| "Returns a value indicating whether or not this socket has been marked to "
7609 #| "accept connections with B<listen>(2).  The value 0 indicates that this is "
7610 #| "not a listening socket, the value 1 indicates that this is a listening "
7611 #| "socket.  Can only be read with B<getsockopt>(2)."
7612 msgid ""
7613 "Returns a value indicating whether or not this socket has been marked to "
7614 "accept connections with B<listen>(2).  The value 0 indicates that this is "
7615 "not a listening socket, the value 1 indicates that this is a listening "
7616 "socket.  This socket option is read-only."
7617 msgstr ""
7618 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
7619 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
7620 "状態のソケットであることを示す。 B<getsockopt>(2)  からのみ読み出し可能であ"
7621 "る。"
7622
7623 #. type: TP
7624 #: build/C/man7/socket.7:224
7625 #, no-wrap
7626 msgid "B<SO_BINDTODEVICE>"
7627 msgstr "B<SO_BINDTODEVICE>"
7628
7629 #. type: Plain text
7630 #: build/C/man7/socket.7:243
7631 #, fuzzy
7632 #| msgid ""
7633 #| "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified "
7634 #| "in the passed interface name.  If the name is an empty string or the "
7635 #| "option length is zero, the socket device binding is removed.  The passed "
7636 #| "option is a variable-length null-terminated interface name string with "
7637 #| "the maximum size of B<IFNAMSIZ>.  If a socket is bound to an interface, "
7638 #| "only packets received from that particular interface are processed by the "
7639 #| "socket.  Note that this only works for some socket types, particularly "
7640 #| "B<AF_INET> sockets.  It is not supported for packet sockets (use normal "
7641 #| "B<bind>(8)  there)."
7642 msgid ""
7643 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
7644 "the passed interface name.  If the name is an empty string or the option "
7645 "length is zero, the socket device binding is removed.  The passed option is "
7646 "a variable-length null-terminated interface name string with the maximum "
7647 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
7648 "received from that particular interface are processed by the socket.  Note "
7649 "that this only works for some socket types, particularly B<AF_INET> "
7650 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
7651 "there)."
7652 msgstr ""
7653 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
7654 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
7655 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。渡すオプショ"
7656 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
7657 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
7658 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
7659 "る。 このオプションはいくつかのソケットタイプ、特に B<AF_INET> に対してのみ動"
7660 "作する点に注意すること。 パケットソケットではサポートされていない (通常の "
7661 "B<bind>(8)  を使うこと)。"
7662
7663 #. type: TP
7664 #: build/C/man7/socket.7:243
7665 #, no-wrap
7666 msgid "B<SO_BROADCAST>"
7667 msgstr "B<SO_BROADCAST>"
7668
7669 #. type: Plain text
7670 #: build/C/man7/socket.7:250
7671 msgid ""
7672 "Set or get the broadcast flag.  When enabled, datagram sockets receive "
7673 "packets sent to a broadcast address and they are allowed to send packets to "
7674 "a broadcast address.  This option has no effect on stream-oriented sockets."
7675 msgstr ""
7676 "ブロードキャストフラグを設定・取得する。有効になっていると、 データグラムソ"
7677 "ケットはブロードキャストアドレスに送られたパケットを受信したり、 ブロードキャ"
7678 "ストアドレスにパケットを送信したりできるようになる。 ストリーム指向のソケット"
7679 "には何の効果もない。"
7680
7681 #. type: TP
7682 #: build/C/man7/socket.7:250
7683 #, no-wrap
7684 msgid "B<SO_BSDCOMPAT>"
7685 msgstr "B<SO_BSDCOMPAT>"
7686
7687 #. type: Plain text
7688 #: build/C/man7/socket.7:262
7689 msgid ""
7690 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
7691 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
7692 "socket will not be passed to the user program.  In later kernel versions, "
7693 "support for this option has been phased out: Linux 2.4 silently ignores it, "
7694 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
7695 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
7696 "header changing, skipping of the broadcast flag) for raw sockets with this "
7697 "option, but that was removed in Linux 2.2."
7698 msgstr ""
7699 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
7700 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
7701 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
7702 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
7703 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
7704 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
7705 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
7706 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
7707 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
7708
7709 #. type: TP
7710 #: build/C/man7/socket.7:262
7711 #, no-wrap
7712 msgid "B<SO_DEBUG>"
7713 msgstr "B<SO_DEBUG>"
7714
7715 #. type: Plain text
7716 #: build/C/man7/socket.7:268
7717 msgid ""
7718 "Enable socket debugging.  Only allowed for processes with the "
7719 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
7720 msgstr ""
7721 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
7722 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
7723
7724 #. type: TP
7725 #: build/C/man7/socket.7:268
7726 #, fuzzy, no-wrap
7727 #| msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
7728 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
7729 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
7730
7731 #. type: Plain text
7732 #: build/C/man7/socket.7:276
7733 msgid ""
7734 "Retrieves the socket domain as an integer, returning a value such as "
7735 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
7736 "only."
7737 msgstr ""
7738
7739 #. type: TP
7740 #: build/C/man7/socket.7:276
7741 #, no-wrap
7742 msgid "B<SO_ERROR>"
7743 msgstr "B<SO_ERROR>"
7744
7745 #. type: Plain text
7746 #: build/C/man7/socket.7:281
7747 #, fuzzy
7748 #| msgid ""
7749 #| "Get and clear the pending socket error.  Only valid as a B<getsockopt>"
7750 #| "(2).  Expects an integer."
7751 msgid ""
7752 "Get and clear the pending socket error.  This socket option is read-only.  "
7753 "Expects an integer."
7754 msgstr ""
7755 "保留になっていたソケットエラーを取得してクリアする。 B<getsockopt>(2)  でのみ"
7756 "用いることができる。 整数値をとる。"
7757
7758 #. type: TP
7759 #: build/C/man7/socket.7:281
7760 #, no-wrap
7761 msgid "B<SO_DONTROUTE>"
7762 msgstr "B<SO_DONTROUTE>"
7763
7764 #. type: Plain text
7765 #: build/C/man7/socket.7:290
7766 msgid ""
7767 "Don't send via a gateway, only send to directly connected hosts.  The same "
7768 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
7769 "B<send>(2)  operation.  Expects an integer boolean flag."
7770 msgstr ""
7771 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2)  操作"
7772 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
7773 "フラグを取る。"
7774
7775 #. type: TP
7776 #: build/C/man7/socket.7:290
7777 #, no-wrap
7778 msgid "B<SO_KEEPALIVE>"
7779 msgstr "B<SO_KEEPALIVE>"
7780
7781 #. type: Plain text
7782 #: build/C/man7/socket.7:294
7783 msgid ""
7784 "Enable sending of keep-alive messages on connection-oriented sockets.  "
7785 "Expects an integer boolean flag."
7786 msgstr ""
7787 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
7788 "の整数フラグをとる。"
7789
7790 #. type: TP
7791 #: build/C/man7/socket.7:294
7792 #, no-wrap
7793 msgid "B<SO_LINGER>"
7794 msgstr "B<SO_LINGER>"
7795
7796 #. type: Plain text
7797 #: build/C/man7/socket.7:302
7798 msgid ""
7799 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
7800 msgstr ""
7801 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
7802
7803 #. type: Plain text
7804 #: build/C/man7/socket.7:309
7805 #, no-wrap
7806 msgid ""
7807 "struct linger {\n"
7808 "    int l_onoff;    /* linger active */\n"
7809 "    int l_linger;   /* how many seconds to linger for */\n"
7810 "};\n"
7811 msgstr ""
7812 "struct linger {\n"
7813 "    int l_onoff;    /* linger active */\n"
7814 "    int l_linger;   /* how many seconds to linger for */\n"
7815 "};\n"
7816
7817 #. type: Plain text
7818 #: build/C/man7/socket.7:323
7819 msgid ""
7820 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
7821 "queued messages for the socket have been successfully sent or the linger "
7822 "timeout has been reached.  Otherwise, the call returns immediately and the "
7823 "closing is done in the background.  When the socket is closed as part of "
7824 "B<exit>(2), it always lingers in the background."
7825 msgstr ""
7826 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
7827 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
7828 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
7829 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
7830 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
7831 "送られる。"
7832
7833 #. type: TP
7834 #: build/C/man7/socket.7:323
7835 #, no-wrap
7836 msgid "B<SO_OOBINLINE>"
7837 msgstr "B<SO_OOBINLINE>"
7838
7839 #.  don't document it because it can do too much harm.
7840 #. .B SO_NO_CHECK
7841 #. type: Plain text
7842 #: build/C/man7/socket.7:332
7843 msgid ""
7844 "If this option is enabled, out-of-band data is directly placed into the "
7845 "receive data stream.  Otherwise out-of-band data is only passed when the "
7846 "B<MSG_OOB> flag is set during receiving."
7847 msgstr ""
7848 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
7849 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
7850 "ラグがセットされている場合に限って渡される。"
7851
7852 #. type: TP
7853 #: build/C/man7/socket.7:332
7854 #, no-wrap
7855 msgid "B<SO_PASSCRED>"
7856 msgstr "B<SO_PASSCRED>"
7857
7858 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
7859 #.  in the 2.6.18 ChangeLog
7860 #. type: Plain text
7861 #: build/C/man7/socket.7:341
7862 msgid ""
7863 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
7864 "For more information see B<unix>(7)."
7865 msgstr ""
7866 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
7867 "を参照のこと。"
7868
7869 #. type: TP
7870 #: build/C/man7/socket.7:341
7871 #, no-wrap
7872 msgid "B<SO_PEERCRED>"
7873 msgstr "B<SO_PEERCRED>"
7874
7875 #. type: Plain text
7876 #: build/C/man7/socket.7:361
7877 #, fuzzy
7878 #| msgid ""
7879 #| "Return the credentials of the foreign process connected to this socket.  "
7880 #| "This is only possible for connected B<AF_UNIX> stream sockets and "
7881 #| "B<AF_UNIX> stream and datagram socket pairs created using B<socketpair>"
7882 #| "(2); see B<unix>(7).  The returned credentials are those that were in "
7883 #| "effect at the time of the call to B<connect>(2)  or B<socketpair>(2).  "
7884 #| "Argument is a I<ucred> structure.  Only valid as a B<getsockopt>(2)."
7885 msgid ""
7886 "Return the credentials of the foreign process connected to this socket.  "
7887 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
7888 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
7889 "(7).  The returned credentials are those that were in effect at the time of "
7890 "the call to B<connect>(2)  or B<socketpair>(2).  Argument is a I<ucred> "
7891 "structure.  This socket option is read-only."
7892 msgstr ""
7893 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。 このソ"
7894 "ケットオプションが利用できるのは、 接続された B<AF_UNIX> ストリームソケット"
7895 "間、および B<socketpair>(2)  を使って作成された B<AF_UNIX> のストリームソケッ"
7896 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
7897 "B<connect>(2)  や B<socketpair>(2)  が呼ばれた時に有効であった信任状が返され"
7898 "る。 引き数は I<ucred> 構造体である。 B<getsockopt>(2)  でのみ用いることがで"
7899 "きる。"
7900
7901 #. type: TP
7902 #: build/C/man7/socket.7:361
7903 #, no-wrap
7904 msgid "B<SO_PRIORITY>"
7905 msgstr "B<SO_PRIORITY>"
7906
7907 #. type: Plain text
7908 #: build/C/man7/socket.7:374
7909 msgid ""
7910 "Set the protocol-defined priority for all packets to be sent on this "
7911 "socket.  Linux uses this value to order the networking queues: packets with "
7912 "a higher priority may be processed first depending on the selected device "
7913 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
7914 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
7915 "6 requires the B<CAP_NET_ADMIN> capability."
7916 msgstr ""
7917 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
7918 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
7919 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
7920 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
7921 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
7922 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
7923
7924 #. type: TP
7925 #: build/C/man7/socket.7:374
7926 #, fuzzy, no-wrap
7927 #| msgid "B<MSG_TRUNC> (since Linux 2.2)"
7928 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
7929 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
7930
7931 #. type: Plain text
7932 #: build/C/man7/socket.7:382
7933 msgid ""
7934 "Retrieves the socket protocol as an integer, returning a value such as "
7935 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
7936 "only."
7937 msgstr ""
7938
7939 #. type: TP
7940 #: build/C/man7/socket.7:382
7941 #, no-wrap
7942 msgid "B<SO_RCVBUF>"
7943 msgstr "B<SO_RCVBUF>"
7944
7945 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
7946 #. type: Plain text
7947 #: build/C/man7/socket.7:397
7948 msgid ""
7949 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
7950 "this value (to allow space for bookkeeping overhead)  when it is set using "
7951 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
7952 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
7953 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
7954 "file.  The minimum (doubled) value for this option is 256."
7955 msgstr ""
7956 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
7957 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
7958 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
7959 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
7960 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
7961 "る。 このオプションの最小値は (2倍した値で) 256 である。"
7962
7963 #. type: TP
7964 #: build/C/man7/socket.7:397
7965 #, no-wrap
7966 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
7967 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
7968
7969 #. type: Plain text
7970 #: build/C/man7/socket.7:406
7971 msgid ""
7972 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
7973 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
7974 "overridden."
7975 msgstr ""
7976 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
7977 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
7978 "きすることができる。"
7979
7980 #. type: TP
7981 #: build/C/man7/socket.7:406
7982 #, no-wrap
7983 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
7984 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
7985
7986 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
7987 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
7988 #. type: Plain text
7989 #: build/C/man7/socket.7:435
7990 msgid ""
7991 "Specify the minimum number of bytes in the buffer until the socket layer "
7992 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
7993 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
7994 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
7995 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
7996 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
7997 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
7998 "single byte of data is available.  A subsequent read from the socket will "
7999 "block until B<SO_RCVLOWAT> bytes are available."
8000 msgstr ""
8001 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
8002 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
8003 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
8004 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
8005 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
8006 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
8007 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
8008 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
8009 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
8010 "してしまう。"
8011
8012 #. type: TP
8013 #: build/C/man7/socket.7:435
8014 #, no-wrap
8015 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
8016 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
8017
8018 #.  Not implemented in 2.0.
8019 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
8020 #.  Implemented in 2.3.41 for setsockopt, and actually used.
8021 #.  in fact to EAGAIN
8022 #. type: Plain text
8023 #: build/C/man7/socket.7:466
8024 msgid ""
8025 "Specify the receiving or sending timeouts until reporting an error.  The "
8026 "argument is a I<struct timeval>.  If an input or output function blocks for "
8027 "this period of time, and data has been sent or received, the return value of "
8028 "that function will be the amount of data transferred; if no data has been "
8029 "transferred and the timeout has been reached then -1 is returned with "
8030 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket was "
8031 "specified to be nonblocking.  If the timeout is set to zero (the default)  "
8032 "then the operation will never timeout.  Timeouts only have effect for system "
8033 "calls that perform socket I/O (e.g., B<read>(2), B<recvmsg>(2), B<send>(2), "
8034 "B<sendmsg>(2)); timeouts have no effect for B<select>(2), B<poll>(2), "
8035 "B<epoll_wait>(2), etc."
8036 msgstr ""
8037 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
8038 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
8039 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
8040 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
8041 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> を設定され、 あたかもソケットに"
8042 "非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値であ"
8043 "る) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響"
8044 "を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), "
8045 "B<recvmsg>(2), B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>"
8046 "(2), B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
8047
8048 #. type: TP
8049 #: build/C/man7/socket.7:466
8050 #, no-wrap
8051 msgid "B<SO_REUSEADDR>"
8052 msgstr "B<SO_REUSEADDR>"
8053
8054 #. type: Plain text
8055 #: build/C/man7/socket.7:481
8056 msgid ""
8057 "Indicates that the rules used in validating addresses supplied in a B<bind>"
8058 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
8059 "this means that a socket may bind, except when there is an active listening "
8060 "socket bound to the address.  When the listening socket is bound to "
8061 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
8062 "port for any local address.  Argument is an integer boolean flag."
8063 msgstr ""
8064 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
8065 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
8066 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
8067 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
8068 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
8069 "ドできない。 引き数はブール整数のフラグである。"
8070
8071 #. type: TP
8072 #: build/C/man7/socket.7:481
8073 #, no-wrap
8074 msgid "B<SO_SNDBUF>"
8075 msgstr "B<SO_SNDBUF>"
8076
8077 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8078 #. type: Plain text
8079 #: build/C/man7/socket.7:496
8080 msgid ""
8081 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
8082 "this value (to allow space for bookkeeping overhead)  when it is set using "
8083 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8084 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
8085 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
8086 "file.  The minimum (doubled) value for this option is 2048."
8087 msgstr ""
8088 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
8089 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8090 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8091 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
8092 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
8093 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
8094
8095 #. type: TP
8096 #: build/C/man7/socket.7:496
8097 #, no-wrap
8098 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
8099 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
8100
8101 #. type: Plain text
8102 #: build/C/man7/socket.7:505
8103 msgid ""
8104 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8105 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
8106 "overridden."
8107 msgstr ""
8108 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8109 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
8110 "きすることができる。"
8111
8112 #. type: TP
8113 #: build/C/man7/socket.7:505
8114 #, no-wrap
8115 msgid "B<SO_TIMESTAMP>"
8116 msgstr "B<SO_TIMESTAMP>"
8117
8118 #. type: Plain text
8119 #: build/C/man7/socket.7:521
8120 msgid ""
8121 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
8122 "timestamp control message is sent with level B<SOL_SOCKET> and the "
8123 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
8124 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
8125 "details on control messages."
8126 msgstr ""
8127 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
8128 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
8129 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
8130 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
8131
8132 #. type: TP
8133 #: build/C/man7/socket.7:521
8134 #, no-wrap
8135 msgid "B<SO_TYPE>"
8136 msgstr "B<SO_TYPE>"
8137
8138 #. type: Plain text
8139 #: build/C/man7/socket.7:526
8140 #, fuzzy
8141 #| msgid ""
8142 #| "Gets the socket type as an integer (like B<SOCK_STREAM>).  Can only be "
8143 #| "read with B<getsockopt>(2)."
8144 msgid ""
8145 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
8146 "option is read-only."
8147 msgstr ""
8148 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。 B<getsockopt>(2)  か"
8149 "らのみ読み出し可能である。"
8150
8151 #. type: SS
8152 #: build/C/man7/socket.7:526
8153 #, no-wrap
8154 msgid "Signals"
8155 msgstr "シグナル"
8156
8157 #. type: Plain text
8158 #: build/C/man7/socket.7:537
8159 msgid ""
8160 "When writing onto a connection-oriented socket that has been shut down (by "
8161 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
8162 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
8163 "the B<MSG_NOSIGNAL> flag."
8164 msgstr ""
8165 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
8166 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
8167 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
8168 "していた場合はシグナルは送られない。"
8169
8170 #. type: Plain text
8171 #: build/C/man7/socket.7:562
8172 msgid ""
8173 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
8174 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
8175 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
8176 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
8177 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
8178 "signal will be called with the file descriptor in the I<si_fd> field of its "
8179 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
8180 msgstr ""
8181 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
8182 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
8183 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
8184 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
8185 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
8186 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
8187 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
8188 "を参照のこと。"
8189
8190 #.  .SS Ancillary Messages
8191 #. type: Plain text
8192 #: build/C/man7/socket.7:570
8193 msgid ""
8194 "Under some circumstances (e.g., multiple processes accessing a single "
8195 "socket), the condition that caused the B<SIGIO> may have already disappeared "
8196 "when the process reacts to the signal.  If this happens, the process should "
8197 "wait again because Linux will resend the signal later."
8198 msgstr ""
8199 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
8200 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
8201 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
8202 "すべきである。 Linux は同じシグナルを後で再送するからである。"
8203
8204 #. type: SS
8205 #: build/C/man7/socket.7:570
8206 #, no-wrap
8207 msgid "/proc interfaces"
8208 msgstr "/proc インタフェース"
8209
8210 #. type: Plain text
8211 #: build/C/man7/socket.7:574
8212 msgid ""
8213 "The core socket networking parameters can be accessed via files in the "
8214 "directory I</proc/sys/net/core/>."
8215 msgstr ""
8216 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
8217 "レクトリ内のファイルを通してアクセスできる。"
8218
8219 #. type: TP
8220 #: build/C/man7/socket.7:574
8221 #, no-wrap
8222 msgid "I<rmem_default>"
8223 msgstr "I<rmem_default>"
8224
8225 #. type: Plain text
8226 #: build/C/man7/socket.7:577
8227 msgid "contains the default setting in bytes of the socket receive buffer."
8228 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
8229
8230 #. type: TP
8231 #: build/C/man7/socket.7:577
8232 #, no-wrap
8233 msgid "I<rmem_max>"
8234 msgstr "I<rmem_max>"
8235
8236 #. type: Plain text
8237 #: build/C/man7/socket.7:583
8238 msgid ""
8239 "contains the maximum socket receive buffer size in bytes which a user may "
8240 "set by using the B<SO_RCVBUF> socket option."
8241 msgstr ""
8242 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
8243 "ファサイズの最大値 (バイト単位)。"
8244
8245 #. type: TP
8246 #: build/C/man7/socket.7:583
8247 #, no-wrap
8248 msgid "I<wmem_default>"
8249 msgstr "I<wmem_default>"
8250
8251 #. type: Plain text
8252 #: build/C/man7/socket.7:586
8253 msgid "contains the default setting in bytes of the socket send buffer."
8254 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
8255
8256 #. type: TP
8257 #: build/C/man7/socket.7:586
8258 #, no-wrap
8259 msgid "I<wmem_max>"
8260 msgstr "I<wmem_max>"
8261
8262 #. type: Plain text
8263 #: build/C/man7/socket.7:592
8264 msgid ""
8265 "contains the maximum socket send buffer size in bytes which a user may set "
8266 "by using the B<SO_SNDBUF> socket option."
8267 msgstr ""
8268 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
8269 "ファサイズの最大値 (バイト単位)。"
8270
8271 #. type: TP
8272 #: build/C/man7/socket.7:592
8273 #, no-wrap
8274 msgid "I<message_cost> and I<message_burst>"
8275 msgstr "I<message_cost> と I<message_burst>"
8276
8277 #. type: Plain text
8278 #: build/C/man7/socket.7:596
8279 msgid ""
8280 "configure the token bucket filter used to load limit warning messages caused "
8281 "by external network events."
8282 msgstr ""
8283 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
8284 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
8285
8286 #. type: TP
8287 #: build/C/man7/socket.7:596
8288 #, no-wrap
8289 msgid "I<netdev_max_backlog>"
8290 msgstr "I<netdev_max_backlog>"
8291
8292 #. type: Plain text
8293 #: build/C/man7/socket.7:599
8294 msgid "Maximum number of packets in the global input queue."
8295 msgstr "グローバルな入力キューにおける最大のパケット数。"
8296
8297 #. type: TP
8298 #: build/C/man7/socket.7:599
8299 #, no-wrap
8300 msgid "I<optmem_max>"
8301 msgstr "I<optmem_max>"
8302
8303 #.  netdev_fastroute is not documented because it is experimental
8304 #. type: Plain text
8305 #: build/C/man7/socket.7:604
8306 msgid ""
8307 "Maximum length of ancillary data and user control data like the iovecs per "
8308 "socket."
8309 msgstr ""
8310 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
8311 "うなもの) との和の最大長。"
8312
8313 #. type: SS
8314 #: build/C/man7/socket.7:604
8315 #, no-wrap
8316 msgid "Ioctls"
8317 msgstr "ioctl"
8318
8319 #. type: Plain text
8320 #: build/C/man7/socket.7:607
8321 msgid "These operations can be accessed using B<ioctl>(2):"
8322 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
8323
8324 #. type: Plain text
8325 #: build/C/man7/socket.7:611
8326 #, no-wrap
8327 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8328 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8329
8330 #. type: TP
8331 #: build/C/man7/socket.7:613
8332 #, no-wrap
8333 msgid "B<SIOCGSTAMP>"
8334 msgstr "B<SIOCGSTAMP>"
8335
8336 #. type: Plain text
8337 #: build/C/man7/socket.7:637
8338 msgid ""
8339 "Return a I<struct timeval> with the receive timestamp of the last packet "
8340 "passed to the user.  This is useful for accurate round trip time "
8341 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
8342 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
8343 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
8344 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
8345 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
8346 "to B<ENOENT>)."
8347 msgstr ""
8348 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
8349 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
8350 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
8351 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
8352 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
8353 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
8354 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
8355 "セットする)。"
8356
8357 #. type: TP
8358 #: build/C/man7/socket.7:637
8359 #, no-wrap
8360 msgid "B<SIOCSPGRP>"
8361 msgstr "B<SIOCSPGRP>"
8362
8363 #. type: Plain text
8364 #: build/C/man7/socket.7:656
8365 msgid ""
8366 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
8367 "when an asynchronous I/O operation has finished or urgent data is "
8368 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
8369 "positive, send the signals to that process.  If the argument is negative, "
8370 "send the signals to the process group with the ID of the absolute value of "
8371 "the argument.  The process may only choose itself or its own process group "
8372 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
8373 "UID of 0."
8374 msgstr ""
8375 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
8376 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
8377 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
8378 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
8379 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
8380 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
8381 "の場合は この限りではない。"
8382
8383 #. type: TP
8384 #: build/C/man7/socket.7:656
8385 #, no-wrap
8386 msgid "B<FIOASYNC>"
8387 msgstr "B<FIOASYNC>"
8388
8389 #. type: Plain text
8390 #: build/C/man7/socket.7:666
8391 msgid ""
8392 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
8393 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
8394 "set with B<F_SETSIG> is raised when a new I/O event occurs."
8395 msgstr ""
8396 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
8397 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
8398 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
8399
8400 #. type: Plain text
8401 #: build/C/man7/socket.7:674
8402 msgid ""
8403 "Argument is an integer boolean flag.  (This operation is synonymous with the "
8404 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
8405 msgstr ""
8406 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
8407 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
8408
8409 #. type: TP
8410 #: build/C/man7/socket.7:674
8411 #, no-wrap
8412 msgid "B<SIOCGPGRP>"
8413 msgstr "B<SIOCGPGRP>"
8414
8415 #. type: Plain text
8416 #: build/C/man7/socket.7:683
8417 msgid ""
8418 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
8419 "signals, or 0 when none is set."
8420 msgstr ""
8421 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
8422 "る。 ない場合は 0 が返る。"
8423
8424 #. type: Plain text
8425 #: build/C/man7/socket.7:687
8426 msgid "Valid B<fcntl>(2)  operations:"
8427 msgstr "有効な B<fcntl>(2)  操作:"
8428
8429 #. type: TP
8430 #: build/C/man7/socket.7:687
8431 #, no-wrap
8432 msgid "B<FIOGETOWN>"
8433 msgstr "B<FIOGETOWN>"
8434
8435 #. type: Plain text
8436 #: build/C/man7/socket.7:692
8437 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
8438 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
8439
8440 #. type: TP
8441 #: build/C/man7/socket.7:692
8442 #, no-wrap
8443 msgid "B<FIOSETOWN>"
8444 msgstr "B<FIOSETOWN>"
8445
8446 #. type: Plain text
8447 #: build/C/man7/socket.7:697
8448 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
8449 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
8450
8451 #. type: Plain text
8452 #: build/C/man7/socket.7:711
8453 msgid ""
8454 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
8455 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
8456 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
8457 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
8458 "be read or written."
8459 msgstr ""
8460 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
8461 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
8462 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
8463 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
8464 "はできなかった。"
8465
8466 #. type: Plain text
8467 #: build/C/man7/socket.7:716
8468 msgid ""
8469 "Linux assumes that half of the send/receive buffer is used for internal "
8470 "kernel structures; thus the values in the corresponding I</proc> files are "
8471 "twice what can be observed on the wire."
8472 msgstr ""
8473 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
8474 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
8475 "なる。"
8476
8477 #. type: Plain text
8478 #: build/C/man7/socket.7:729
8479 msgid ""
8480 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
8481 "option was set both in the previous program that performed a B<bind>(2)  to "
8482 "the port and in the program that wants to reuse the port.  This differs from "
8483 "some implementations (e.g., FreeBSD)  where only the later program needs to "
8484 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
8485 "since, for example, a server program is designed to always set this option."
8486 msgstr ""
8487 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
8488 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
8489 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
8490 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
8491 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
8492 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
8493 "このオプションをセットするように設計されるからである。"
8494
8495 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
8496 #.  .SH AUTHORS
8497 #.  This man page was written by Andi Kleen.
8498 #. type: Plain text
8499 #: build/C/man7/socket.7:742
8500 msgid ""
8501 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
8502 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
8503 "is via the libpcap library."
8504 msgstr ""
8505 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
8506 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
8507 "して 用いる方が良い。"
8508
8509 #. type: Plain text
8510 #: build/C/man7/socket.7:753
8511 msgid ""
8512 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8513 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8514 msgstr ""
8515 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8516 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8517
8518 #. type: TH
8519 #: build/C/man2/socketcall.2:26
8520 #, no-wrap
8521 msgid "SOCKETCALL"
8522 msgstr "SOCKETCALL"
8523
8524 #. type: TH
8525 #: build/C/man2/socketcall.2:26
8526 #, no-wrap
8527 msgid "2007-06-28"
8528 msgstr "2007-06-28"
8529
8530 #. type: Plain text
8531 #: build/C/man2/socketcall.2:29
8532 msgid "socketcall - socket system calls"
8533 msgstr "socketcall - ソケット・システムコール"
8534
8535 #. type: Plain text
8536 #: build/C/man2/socketcall.2:31
8537 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8538 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8539
8540 #. type: Plain text
8541 #: build/C/man2/socketcall.2:39
8542 msgid ""
8543 "B<socketcall>()  is a common kernel entry point for the socket system "
8544 "calls.  I<call> determines which socket function to invoke.  I<args> points "
8545 "to a block containing the actual arguments, which are passed through to the "
8546 "appropriate call."
8547 msgstr ""
8548 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
8549 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
8550 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
8551 "ロックを指す。"
8552
8553 #. type: Plain text
8554 #: build/C/man2/socketcall.2:43
8555 msgid ""
8556 "User programs should call the appropriate functions by their usual names.  "
8557 "Only standard library implementors and kernel hackers need to know about "
8558 "B<socketcall>()."
8559 msgstr ""
8560 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
8561 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
8562 "必要がある。"
8563
8564 #. type: Plain text
8565 #: build/C/man2/socketcall.2:46
8566 msgid ""
8567 "This call is specific to Linux, and should not be used in programs intended "
8568 "to be portable."
8569 msgstr ""
8570 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
8571 "い。"
8572
8573 #. type: Plain text
8574 #: build/C/man2/socketcall.2:54
8575 msgid ""
8576 "On a few architectures, for example ia64, there is no B<socketcall>()  "
8577 "system call; instead B<socket>(2), B<accept>(2), B<bind>(2), and so on "
8578 "really are implemented as separate system calls."
8579 msgstr ""
8580 "ia64 などのいくつかのアーキテクチャでは、システムコール B<socketcall>()  が存"
8581 "在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2)  など"
8582 "が独立したシステムコールとして実装されている。"
8583
8584 #. type: Plain text
8585 #: build/C/man2/socketcall.2:72
8586 msgid ""
8587 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8588 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8589 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8590 "(2), B<socket>(2), B<socketpair>(2)"
8591 msgstr ""
8592 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8593 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8594 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8595 "(2), B<socket>(2), B<socketpair>(2)"
8596
8597 #. type: TH
8598 #: build/C/man2/socketpair.2:40
8599 #, no-wrap
8600 msgid "SOCKETPAIR"
8601 msgstr "SOCKETPAIR"
8602
8603 #. type: TH
8604 #: build/C/man2/socketpair.2:40
8605 #, no-wrap
8606 msgid "2008-10-11"
8607 msgstr "2008-10-11"
8608
8609 #. type: Plain text
8610 #: build/C/man2/socketpair.2:43
8611 msgid "socketpair - create a pair of connected sockets"
8612 msgstr "socketpair - 接続されたソケットのペアを作成する"
8613
8614 #. type: Plain text
8615 #: build/C/man2/socketpair.2:50
8616 msgid ""
8617 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8618 ">I<sv>B<[2]);>"
8619 msgstr ""
8620 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8621 ">I<sv>B<[2]);>"
8622
8623 #. type: Plain text
8624 #: build/C/man2/socketpair.2:61
8625 msgid ""
8626 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
8627 "the specified I<domain>, of the specified I<type>, and using the optionally "
8628 "specified I<protocol>.  For further details of these arguments, see B<socket>"
8629 "(2)."
8630 msgstr ""
8631 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
8632 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
8633 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
8634
8635 #. type: Plain text
8636 #: build/C/man2/socketpair.2:67
8637 msgid ""
8638 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
8639 "and I<sv>[1].  The two sockets are indistinguishable."
8640 msgstr ""
8641 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
8642 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
8643
8644 #. type: Plain text
8645 #: build/C/man2/socketpair.2:76
8646 msgid "The specified address family is not supported on this machine."
8647 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
8648
8649 #. type: Plain text
8650 #: build/C/man2/socketpair.2:81
8651 msgid ""
8652 "The address I<sv> does not specify a valid part of the process address space."
8653 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
8654
8655 #. type: Plain text
8656 #: build/C/man2/socketpair.2:84
8657 msgid "Too many descriptors are in use by this process."
8658 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
8659
8660 #. type: Plain text
8661 #: build/C/man2/socketpair.2:90
8662 msgid "The specified protocol does not support creation of socket pairs."
8663 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
8664
8665 #. type: Plain text
8666 #: build/C/man2/socketpair.2:93
8667 msgid "The specified protocol is not supported on this machine."
8668 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
8669
8670 #. type: Plain text
8671 #: build/C/man2/socketpair.2:101
8672 msgid ""
8673 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
8674 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
8675 "of the BSD socket layer (including System V variants)."
8676 msgstr ""
8677 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
8678 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
8679 "BSD 以外のシステムと、 互いに移植性がある。"
8680
8681 #. type: Plain text
8682 #: build/C/man2/socketpair.2:107
8683 msgid ""
8684 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
8685 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
8686 "restriction.)"
8687 msgstr ""
8688 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
8689 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
8690
8691 #. type: Plain text
8692 #: build/C/man2/socketpair.2:116
8693 msgid ""
8694 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
8695 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
8696 msgstr ""
8697 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
8698 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
8699
8700 #. type: Plain text
8701 #: build/C/man2/socketpair.2:129
8702 msgid ""
8703 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8704 msgstr ""
8705 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"