OSDN Git Service

6f2be233d50db85c5c205d8ada54a0bbab15b065
[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: 2013-03-22 01:06+0900\n"
10 "PO-Revision-Date: 2013-03-24 01:08+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:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:48 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:48
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:49
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 #, fuzzy
76 #| msgid "accept - accept a connection on a socket"
77 msgid "accept, accept4 - accept a connection on a socket"
78 msgstr "accept - ソケットへの接続を受ける"
79
80 #. type: SH
81 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
82 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
83 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
84 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
85 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
86 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
87 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
88 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
89 #: build/C/man2/socket.2:46 build/C/man7/socket.7:51
90 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
91 #, no-wrap
92 msgid "SYNOPSIS"
93 msgstr "書式"
94
95 #. type: Plain text
96 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
97 #, no-wrap
98 msgid ""
99 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
100 "B<#include E<lt>sys/socket.hE<gt>>\n"
101 msgstr ""
102 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
103 "B<#include E<lt>sys/socket.hE<gt>>\n"
104
105 #. type: Plain text
106 #: build/C/man2/accept.2:50
107 #, no-wrap
108 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
109 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
110
111 #. type: Plain text
112 #: build/C/man2/accept.2:53
113 #, no-wrap
114 msgid ""
115 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
116 "B<#include E<lt>sys/socket.hE<gt>>\n"
117 msgstr ""
118 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
119 "B<#include E<lt>sys/socket.hE<gt>>\n"
120
121 #. type: Plain text
122 #: build/C/man2/accept.2:56
123 #, no-wrap
124 msgid ""
125 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
126 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
127 msgstr ""
128 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
129 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
130
131 #. type: SH
132 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
133 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
134 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
135 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
136 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
137 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
138 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
139 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
140 #: build/C/man2/socket.2:52 build/C/man7/socket.7:55
141 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
142 #, no-wrap
143 msgid "DESCRIPTION"
144 msgstr "説明"
145
146 #. type: Plain text
147 #: build/C/man2/accept.2:72
148 msgid ""
149 "The B<accept>()  system call is used with connection-based socket types "
150 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
151 "request on the queue of pending connections for the listening socket, "
152 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
153 "referring to that socket.  The newly created socket is not in the listening "
154 "state.  The original socket I<sockfd> is unaffected by this call."
155 msgstr ""
156 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
157 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
158 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
159 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
160 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
161 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
162
163 #. type: Plain text
164 #: build/C/man2/accept.2:81
165 msgid ""
166 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
167 "bound to a local address with B<bind>(2), and is listening for connections "
168 "after a B<listen>(2)."
169 msgstr ""
170 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
171 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
172 "である。"
173
174 #. type: Plain text
175 #: build/C/man2/accept.2:99
176 msgid ""
177 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
178 "structure is filled in with the address of the peer socket, as known to the "
179 "communications layer.  The exact format of the address returned I<addr> is "
180 "determined by the socket's address family (see B<socket>(2)  and the "
181 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
182 "in this case, I<addrlen> is not used, and should also be NULL."
183 msgstr ""
184 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
185 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
186 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
187 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
188 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
189 "おくべきである。"
190
191 #. type: Plain text
192 #: build/C/man2/accept.2:107
193 msgid ""
194 "The I<addrlen> argument is a value-result argument: the caller must "
195 "initialize it to contain the size (in bytes) of the structure pointed to by "
196 "I<addr>; on return it will contain the actual size of the peer address."
197 msgstr ""
198 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
199 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
200 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
201
202 #. type: Plain text
203 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
204 msgid ""
205 "The returned address is truncated if the buffer provided is too small; in "
206 "this case, I<addrlen> will return a value greater than was supplied to the "
207 "call."
208 msgstr ""
209 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
210 "る。\n"
211 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
212 "される。"
213
214 #. type: Plain text
215 #: build/C/man2/accept.2:125
216 msgid ""
217 "If no pending connections are present on the queue, and the socket is not "
218 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
219 "present.  If the socket is marked nonblocking and no pending connections are "
220 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
221 "B<EWOULDBLOCK>."
222 msgstr ""
223 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
224 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
225 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
226 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
227
228 #. type: Plain text
229 #: build/C/man2/accept.2:139
230 msgid ""
231 "In order to be notified of incoming connections on a socket, you can use "
232 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
233 "connection is attempted and you may then call B<accept>()  to get a socket "
234 "for that connection.  Alternatively, you can set the socket to deliver "
235 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
236 msgstr ""
237 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
238 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
239 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
240 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
241 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
242
243 #. type: Plain text
244 #: build/C/man2/accept.2:152
245 msgid ""
246 "For certain protocols which require an explicit confirmation, such as "
247 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
248 "connection request and not implying confirmation.  Confirmation can be "
249 "implied by a normal read or write on the new file descriptor, and rejection "
250 "can be implied by closing the new socket.  Currently only DECNet has these "
251 "semantics on Linux."
252 msgstr ""
253 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
254 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
255 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
256 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
257 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
258 "セマンティクスを持つのは DECNet だけである。"
259
260 #. type: Plain text
261 #: build/C/man2/accept.2:162
262 msgid ""
263 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
264 "following values can be bitwise ORed in I<flags> to obtain different "
265 "behavior:"
266 msgstr ""
267 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
268 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
269 "できる。"
270
271 #. type: TP
272 #: build/C/man2/accept.2:162 build/C/man2/socket.2:164
273 #, no-wrap
274 msgid "B<SOCK_NONBLOCK>"
275 msgstr "B<SOCK_NONBLOCK>"
276
277 #. type: Plain text
278 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
279 msgid ""
280 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
281 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
282 msgstr ""
283 "新しく生成されるオープンファイル記述 (open file description) の "
284 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
285 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
286 "なる。"
287
288 #. type: TP
289 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
290 #, no-wrap
291 msgid "B<SOCK_CLOEXEC>"
292 msgstr "B<SOCK_CLOEXEC>"
293
294 #. type: Plain text
295 #: build/C/man2/accept.2:180 build/C/man2/socket.2:182
296 msgid ""
297 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
298 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
299 "may be useful."
300 msgstr ""
301 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
302 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
303 "B<O_CLOEXEC> フラグの説明を参照のこと。"
304
305 #. type: SH
306 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
307 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
308 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
309 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
310 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
311 #: build/C/man2/recv.2:388 build/C/man2/recvmmsg.2:149
312 #: build/C/man2/select.2:289 build/C/man2/select_tut.2:485
313 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
314 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:314
315 #: build/C/man2/socketpair.2:69
316 #, no-wrap
317 msgid "RETURN VALUE"
318 msgstr "返り値"
319
320 #. type: Plain text
321 #: build/C/man2/accept.2:187
322 msgid ""
323 "On success, these system calls return a nonnegative integer that is a "
324 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
325 "is set appropriately."
326 msgstr ""
327 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
328 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
329 "定する。"
330
331 #. type: SS
332 #: build/C/man2/accept.2:187
333 #, fuzzy, no-wrap
334 #| msgid "Error Handling"
335 msgid "Error handling"
336 msgstr "エラー処理"
337
338 #. type: Plain text
339 #: build/C/man2/accept.2:214
340 msgid ""
341 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
342 "on the new socket as an error code from B<accept>().  This behavior differs "
343 "from other BSD socket implementations.  For reliable operation the "
344 "application should detect the network errors defined for the protocol after "
345 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
346 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
347 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
348 msgstr ""
349 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
350 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
351 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
352 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
353 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
354 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
355 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
356 "B<ENETUNREACH>"
357
358 #. type: SH
359 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
360 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
361 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
362 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
363 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
364 #: build/C/man2/recv.2:393 build/C/man2/recvmmsg.2:157
365 #: build/C/man2/select.2:306 build/C/man2/send.2:280
366 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:56
367 #: build/C/man2/socket.2:319 build/C/man2/socketpair.2:74
368 #, no-wrap
369 msgid "ERRORS"
370 msgstr "エラー"
371
372 #. type: TP
373 #: build/C/man2/accept.2:215 build/C/man2/recv.2:398 build/C/man2/send.2:296
374 #, no-wrap
375 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
376 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
377
378 #.  Actually EAGAIN on Linux
379 #. type: Plain text
380 #: build/C/man2/accept.2:223
381 msgid ""
382 "The socket is marked nonblocking and no connections are present to be "
383 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
384 "and does not require these constants to have the same value, so a portable "
385 "application should check for both possibilities."
386 msgstr ""
387 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
388 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
389 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
390 "ションでは、両方の可能性を 確認すべきである。"
391
392 #. type: TP
393 #: build/C/man2/accept.2:223 build/C/man2/bind.2:165
394 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
395 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
396 #: build/C/man2/recv.2:407 build/C/man2/select.2:307 build/C/man2/send.2:304
397 #: build/C/man3/sockatmark.3:57
398 #, no-wrap
399 msgid "B<EBADF>"
400 msgstr "B<EBADF>"
401
402 #. type: Plain text
403 #: build/C/man2/accept.2:226
404 msgid "The descriptor is invalid."
405 msgstr "ディスクリプタが不正。"
406
407 #. type: TP
408 #: build/C/man2/accept.2:226
409 #, no-wrap
410 msgid "B<ECONNABORTED>"
411 msgstr "B<ECONNABORTED>"
412
413 #. type: Plain text
414 #: build/C/man2/accept.2:229
415 msgid "A connection has been aborted."
416 msgstr "接続が中止された。"
417
418 #. type: TP
419 #: build/C/man2/accept.2:229 build/C/man2/bind.2:191
420 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
421 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:416
422 #: build/C/man2/send.2:313 build/C/man2/socketpair.2:78
423 #, no-wrap
424 msgid "B<EFAULT>"
425 msgstr "B<EFAULT>"
426
427 #. type: Plain text
428 #: build/C/man2/accept.2:234
429 msgid ""
430 "The I<addr> argument is not in a writable part of the user address space."
431 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
432
433 #. type: TP
434 #: build/C/man2/accept.2:234 build/C/man2/connect.2:203
435 #: build/C/man2/recv.2:420 build/C/man2/select.2:312 build/C/man2/send.2:316
436 #, no-wrap
437 msgid "B<EINTR>"
438 msgstr "B<EINTR>"
439
440 #. type: Plain text
441 #: build/C/man2/accept.2:239
442 msgid ""
443 "The system call was interrupted by a signal that was caught before a valid "
444 "connection arrived; see B<signal>(7)."
445 msgstr ""
446 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
447 "た。 B<signal>(7)  参照。"
448
449 #. type: TP
450 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:169
451 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
452 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:425
453 #: build/C/man2/recvmmsg.2:161 build/C/man2/select.2:316
454 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:61
455 #: build/C/man2/socket.2:327 build/C/man2/socket.2:330
456 #, no-wrap
457 msgid "B<EINVAL>"
458 msgstr "B<EINVAL>"
459
460 #. type: Plain text
461 #: build/C/man2/accept.2:244
462 msgid ""
463 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
464 "negative)."
465 msgstr ""
466 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
467 "負の場合など)。"
468
469 #. type: Plain text
470 #: build/C/man2/accept.2:249
471 msgid "(B<accept4>())  invalid value in I<flags>."
472 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
473
474 #. type: TP
475 #: build/C/man2/accept.2:249 build/C/man2/socket.2:335
476 #: build/C/man2/socketpair.2:83
477 #, no-wrap
478 msgid "B<EMFILE>"
479 msgstr "B<EMFILE>"
480
481 #. type: Plain text
482 #: build/C/man2/accept.2:252
483 msgid "The per-process limit of open file descriptors has been reached."
484 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
485
486 #. type: TP
487 #: build/C/man2/accept.2:252 build/C/man2/socket.2:338
488 #: build/C/man2/socketpair.2:86
489 #, no-wrap
490 msgid "B<ENFILE>"
491 msgstr "B<ENFILE>"
492
493 #. type: Plain text
494 #: build/C/man2/accept.2:255 build/C/man2/socket.2:341
495 #: build/C/man2/socketpair.2:89
496 msgid "The system limit on the total number of open files has been reached."
497 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
498
499 #. type: TP
500 #: build/C/man2/accept.2:255
501 #, no-wrap
502 msgid "B<ENOBUFS>, B<ENOMEM>"
503 msgstr "B<ENOBUFS>, B<ENOMEM>"
504
505 #. type: Plain text
506 #: build/C/man2/accept.2:260
507 msgid ""
508 "Not enough free memory.  This often means that the memory allocation is "
509 "limited by the socket buffer limits, not by the system memory."
510 msgstr ""
511 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
512 "ケットバッファの大きさによるメモリ割り当ての制限である。"
513
514 #. type: TP
515 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
516 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
517 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
518 #: build/C/man2/recv.2:440 build/C/man2/send.2:349
519 #, no-wrap
520 msgid "B<ENOTSOCK>"
521 msgstr "B<ENOTSOCK>"
522
523 #. type: Plain text
524 #: build/C/man2/accept.2:263
525 msgid "The descriptor references a file, not a socket."
526 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
527
528 #. type: TP
529 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
530 #: build/C/man2/socketpair.2:89
531 #, no-wrap
532 msgid "B<EOPNOTSUPP>"
533 msgstr "B<EOPNOTSUPP>"
534
535 #. type: Plain text
536 #: build/C/man2/accept.2:267
537 msgid "The referenced socket is not of type B<SOCK_STREAM>."
538 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
539
540 #. type: TP
541 #: build/C/man2/accept.2:267
542 #, no-wrap
543 msgid "B<EPROTO>"
544 msgstr "B<EPROTO>"
545
546 #. type: Plain text
547 #: build/C/man2/accept.2:270
548 msgid "Protocol error."
549 msgstr "プロトコル・エラー。"
550
551 #. type: Plain text
552 #: build/C/man2/accept.2:274
553 msgid "In addition, Linux B<accept>()  may fail if:"
554 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
555
556 #. type: TP
557 #: build/C/man2/accept.2:274
558 #, no-wrap
559 msgid "B<EPERM>"
560 msgstr "B<EPERM>"
561
562 #. type: Plain text
563 #: build/C/man2/accept.2:277
564 msgid "Firewall rules forbid connection."
565 msgstr "ファイアウォールのルールにより接続が禁止された。"
566
567 #. type: Plain text
568 #: build/C/man2/accept.2:289
569 msgid ""
570 "In addition, network errors for the new socket and as defined for the "
571 "protocol may be returned.  Various Linux kernels can return other errors "
572 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
573 "value B<ERESTARTSYS> may be seen during a trace."
574 msgstr ""
575 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
576 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
577 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
578 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
579 "ともある。"
580
581 #. type: SH
582 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
583 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:165
584 #: build/C/man2/select.2:325 build/C/man2/sendmmsg.2:145
585 #: build/C/man3/sockatmark.3:68 build/C/man7/socket.7:802
586 #, no-wrap
587 msgid "VERSIONS"
588 msgstr "バージョン"
589
590 #. type: Plain text
591 #: build/C/man2/accept.2:294
592 msgid ""
593 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
594 "support in glibc is available starting with version 2.10."
595 msgstr ""
596 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
597 "サポートはバージョン 2.10 以降で利用可能である。"
598
599 #. type: SH
600 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
601 #: build/C/man3/bindresvport.3:92 build/C/man2/connect.2:225
602 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
603 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
604 #: build/C/man3/if_nametoindex.3:85 build/C/man2/listen.2:106
605 #: build/C/man2/recv.2:445 build/C/man2/recvmmsg.2:170
606 #: build/C/man2/select.2:331 build/C/man2/send.2:368
607 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:71
608 #: build/C/man2/socket.2:352 build/C/man2/socketcall.2:42
609 #: build/C/man2/socketpair.2:95
610 #, no-wrap
611 msgid "CONFORMING TO"
612 msgstr "準拠"
613
614 #.  The BSD man page documents five possible error returns
615 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
616 #.  POSIX.1-2001 documents errors
617 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
618 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
619 #.  In addition, SUSv2 documents EFAULT and ENOSR.
620 #. type: Plain text
621 #: build/C/man2/accept.2:306
622 msgid ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
624 "4.2BSD)."
625 msgstr ""
626 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
627 "された)."
628
629 #. type: Plain text
630 #: build/C/man2/accept.2:309
631 msgid "B<accept4>()  is a nonstandard Linux extension."
632 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
633
634 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
635 #.  do not inherit file status flags -- MTK Jun 05
636 #. type: Plain text
637 #: build/C/man2/accept.2:324
638 msgid ""
639 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
640 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
641 "socket.  This behavior differs from the canonical BSD sockets "
642 "implementation.  Portable programs should not rely on inheritance or "
643 "noninheritance of file status flags and always explicitly set all required "
644 "flags on the socket returned from B<accept>()."
645 msgstr ""
646 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
647 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
648 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
649 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
650 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
651 "である。"
652
653 #. type: SH
654 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
655 #: build/C/man3/bindresvport.3:95 build/C/man2/connect.2:241
656 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
657 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
658 #: build/C/man2/recv.2:455 build/C/man2/select.2:346
659 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
660 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:73
661 #: build/C/man2/socket.2:366 build/C/man7/socket.7:816
662 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
663 #, no-wrap
664 msgid "NOTES"
665 msgstr "注意"
666
667 #. type: Plain text
668 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
669 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
670 #: build/C/man2/listen.2:137 build/C/man2/socket.2:372
671 #: build/C/man2/socketpair.2:124
672 msgid ""
673 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
674 "this header file is not required on Linux.  However, some historical (BSD) "
675 "implementations required this header file, and portable applications are "
676 "probably wise to include it."
677 msgstr ""
678 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
679 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
680 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
681 "ションではこのファイルを インクルードするのが賢明であろう。"
682
683 #. type: Plain text
684 #: build/C/man2/accept.2:351
685 msgid ""
686 "There may not always be a connection waiting after a B<SIGIO> is delivered "
687 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
688 "connection might have been removed by an asynchronous network error or "
689 "another thread before B<accept>()  is called.  If this happens then the call "
690 "will block waiting for the next connection to arrive.  To ensure that "
691 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
692 "B<O_NONBLOCK> flag set (see B<socket>(7))."
693 msgstr ""
694 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
695 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
696 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
697 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
698 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
699 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
700 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
701 "見よ)。"
702
703 #. type: SS
704 #: build/C/man2/accept.2:351
705 #, no-wrap
706 msgid "The socklen_t type"
707 msgstr "socklen_t 型"
708
709 #. type: Plain text
710 #: build/C/man2/accept.2:361
711 msgid ""
712 "The third argument of B<accept>()  was originally declared as an I<int *> "
713 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
714 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
715 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
716 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
717 "Torvalds:"
718 msgstr ""
719 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
720 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
721 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
722 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
723 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
724 "た。 Linus Torvald の発言を引用する:"
725
726 #.  .I fails: only italicizes a single line
727 #. type: Plain text
728 #: build/C/man2/accept.2:378
729 msgid ""
730 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
731 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
732 "make it a size_t, and I (and hopefully others, but obviously not too many) "
733 "complained to them very loudly indeed.  Making it a size_t is completely "
734 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
735 "bit architectures, for example.  And it I<has> to be the same size as \"int"
736 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
737 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
738 "have touched it in the first place, but once they did they felt it had to "
739 "have a named type for some unfathomable reason (probably somebody didn't "
740 "like losing face over having done the original stupid thing, so they "
741 "silently just renamed their blunder).\""
742 msgstr ""
743 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
744 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
745 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
746 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
747 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
748 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
749 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
750 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
751 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
752 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
753 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
754 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
755 "う)。」"
756
757 #. type: SH
758 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
759 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
760 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
761 #: build/C/man2/recv.2:490 build/C/man2/recvmmsg.2:173
762 #: build/C/man2/select.2:537 build/C/man2/select_tut.2:529
763 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
764 #: build/C/man3/sockatmark.3:97 build/C/man2/socket.2:385
765 #, no-wrap
766 msgid "EXAMPLE"
767 msgstr "例"
768
769 #. type: Plain text
770 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
771 msgid "See B<bind>(2)."
772 msgstr "B<bind>(2)  参照。"
773
774 #. type: SH
775 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
776 #: build/C/man3/bindresvport.3:101 build/C/man2/connect.2:263
777 #: build/C/man3/getifaddrs.3:290 build/C/man2/getsockname.2:112
778 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:146
779 #: build/C/man3/if_nametoindex.3:89 build/C/man2/listen.2:169
780 #: build/C/man2/recv.2:495 build/C/man2/recvmmsg.2:268
781 #: build/C/man2/select.2:574 build/C/man2/select_tut.2:819
782 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
783 #: build/C/man3/sockatmark.3:132 build/C/man2/socket.2:390
784 #: build/C/man7/socket.7:847 build/C/man2/socketcall.2:53
785 #: build/C/man2/socketpair.2:124
786 #, no-wrap
787 msgid "SEE ALSO"
788 msgstr "関連項目"
789
790 #. type: Plain text
791 #: build/C/man2/accept.2:388
792 msgid ""
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<socket>(7)"
795 msgstr ""
796 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
797 "B<socket>(7)"
798
799 #. type: SH
800 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
801 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:270
802 #: build/C/man3/getifaddrs.3:296 build/C/man2/getsockname.2:119
803 #: build/C/man2/getsockopt.2:210 build/C/man3/if_nameindex.3:153
804 #: build/C/man3/if_nametoindex.3:93 build/C/man2/listen.2:175
805 #: build/C/man2/recv.2:506 build/C/man2/recvmmsg.2:275
806 #: build/C/man2/select.2:588 build/C/man2/select_tut.2:838
807 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
808 #: build/C/man3/sockatmark.3:137 build/C/man2/socket.2:419
809 #: build/C/man7/socket.7:859 build/C/man2/socketcall.2:71
810 #: build/C/man2/socketpair.2:131
811 #, no-wrap
812 msgid "COLOPHON"
813 msgstr "この文書について"
814
815 #. type: Plain text
816 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
817 #: build/C/man3/bindresvport.3:111 build/C/man2/connect.2:277
818 #: build/C/man3/getifaddrs.3:303 build/C/man2/getsockname.2:126
819 #: build/C/man2/getsockopt.2:217 build/C/man3/if_nameindex.3:160
820 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:182
821 #: build/C/man2/recv.2:513 build/C/man2/recvmmsg.2:282
822 #: build/C/man2/select.2:595 build/C/man2/select_tut.2:845
823 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
824 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:426
825 #: build/C/man7/socket.7:866 build/C/man2/socketcall.2:78
826 #: build/C/man2/socketpair.2:138
827 msgid ""
828 "This page is part of release 3.50 of the Linux I<man-pages> project.  A "
829 "description of the project, and information about reporting bugs, can be "
830 "found at http://www.kernel.org/doc/man-pages/."
831 msgstr ""
832 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.50 の一部\n"
833 "である。プロジェクトの説明とバグ報告に関する情報は\n"
834 "http://www.kernel.org/doc/man-pages/ に書かれている。"
835
836 #. type: TH
837 #: build/C/man2/bind.2:68
838 #, no-wrap
839 msgid "BIND"
840 msgstr "BIND"
841
842 #. type: TH
843 #: build/C/man2/bind.2:68
844 #, no-wrap
845 msgid "2007-12-28"
846 msgstr "2007-12-28"
847
848 #. type: Plain text
849 #: build/C/man2/bind.2:71
850 msgid "bind - bind a name to a socket"
851 msgstr "bind - ソケットに名前をつける"
852
853 #. type: Plain text
854 #: build/C/man2/bind.2:78
855 #, no-wrap
856 msgid ""
857 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
858 "B<         socklen_t >I<addrlen>B<);>\n"
859 msgstr ""
860 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
861 "B<         socklen_t >I<addrlen>B<);>\n"
862
863 #. type: Plain text
864 #: build/C/man2/bind.2:92
865 msgid ""
866 "When a socket is created with B<socket>(2), it exists in a name space "
867 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
868 "address specified by I<addr> to the socket referred to by the file "
869 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
870 "address structure pointed to by I<addr>.  Traditionally, this operation is "
871 "called \\(lqassigning a name to a socket\\(rq."
872 msgstr ""
873 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
874 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
875 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
876 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
877 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
878 "る。"
879
880 #. type: Plain text
881 #: build/C/man2/bind.2:99
882 msgid ""
883 "It is normally necessary to assign a local address using B<bind>()  before a "
884 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
885 msgstr ""
886 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
887 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
888 "る。"
889
890 #. type: Plain text
891 #: build/C/man2/bind.2:130
892 msgid ""
893 "The rules used in name binding vary between address families.  Consult the "
894 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
895 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
896 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
897 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
898 msgstr ""
899 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
900 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
901 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
902 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
903 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
904
905 #. type: Plain text
906 #: build/C/man2/bind.2:137
907 msgid ""
908 "The actual structure passed for the I<addr> argument will depend on the "
909 "address family.  The I<sockaddr> structure is defined as something like:"
910 msgstr ""
911 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
912 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
913
914 #. type: Plain text
915 #: build/C/man2/bind.2:144
916 #, no-wrap
917 msgid ""
918 "struct sockaddr {\n"
919 "    sa_family_t sa_family;\n"
920 "    char        sa_data[14];\n"
921 "}\n"
922 msgstr ""
923 "struct sockaddr {\n"
924 "    sa_family_t sa_family;\n"
925 "    char        sa_data[14];\n"
926 "}\n"
927
928 #. type: Plain text
929 #: build/C/man2/bind.2:152
930 msgid ""
931 "The only purpose of this structure is to cast the structure pointer passed "
932 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
933 msgstr ""
934 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
935 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
936
937 #. type: Plain text
938 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
939 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
940 #: build/C/man2/socketpair.2:74
941 msgid ""
942 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
943 "appropriately."
944 msgstr ""
945 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
946 "設定される。"
947
948 #. type: TP
949 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
950 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
951 #: build/C/man2/send.2:285 build/C/man2/socket.2:320
952 #, no-wrap
953 msgid "B<EACCES>"
954 msgstr "B<EACCES>"
955
956 #.  e.g., privileged port in AF_INET domain
957 #. type: Plain text
958 #: build/C/man2/bind.2:162
959 msgid "The address is protected, and the user is not the superuser."
960 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
961
962 #. type: TP
963 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
964 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
965 #, no-wrap
966 msgid "B<EADDRINUSE>"
967 msgstr "B<EADDRINUSE>"
968
969 #. type: Plain text
970 #: build/C/man2/bind.2:165
971 msgid "The given address is already in use."
972 msgstr "指定されたアドレスが既に使用中である。"
973
974 #. type: Plain text
975 #: build/C/man2/bind.2:169
976 msgid "I<sockfd> is not a valid descriptor."
977 msgstr "I<sockfd> が不正なディスクリプタである。"
978
979 #.  This may change in the future: see
980 #.  .I linux/unix/sock.c for details.
981 #. type: Plain text
982 #: build/C/man2/bind.2:174
983 msgid "The socket is already bound to an address."
984 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
985
986 #. type: Plain text
987 #: build/C/man2/bind.2:178
988 msgid "I<sockfd> is a descriptor for a file, not a socket."
989 msgstr ""
990 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
991
992 #. type: Plain text
993 #: build/C/man2/bind.2:182
994 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
995 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
996
997 #. type: Plain text
998 #: build/C/man2/bind.2:187
999 msgid ""
1000 "Search permission is denied on a component of the path prefix.  (See also "
1001 "B<path_resolution>(7).)"
1002 msgstr ""
1003 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1004 "(7)  も参照すること)。"
1005
1006 #. type: TP
1007 #: build/C/man2/bind.2:187
1008 #, no-wrap
1009 msgid "B<EADDRNOTAVAIL>"
1010 msgstr "B<EADDRNOTAVAIL>"
1011
1012 #. type: Plain text
1013 #: build/C/man2/bind.2:191
1014 msgid ""
1015 "A nonexistent interface was requested or the requested address was not local."
1016 msgstr ""
1017 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1018 "かった。"
1019
1020 #. type: Plain text
1021 #: build/C/man2/bind.2:195
1022 msgid "I<addr> points outside the user's accessible address space."
1023 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1024
1025 #. type: Plain text
1026 #: build/C/man2/bind.2:202
1027 msgid ""
1028 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1029 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1030
1031 #. type: TP
1032 #: build/C/man2/bind.2:202
1033 #, no-wrap
1034 msgid "B<ELOOP>"
1035 msgstr "B<ELOOP>"
1036
1037 #. type: Plain text
1038 #: build/C/man2/bind.2:206
1039 msgid "Too many symbolic links were encountered in resolving I<addr>."
1040 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1041
1042 #. type: TP
1043 #: build/C/man2/bind.2:206
1044 #, no-wrap
1045 msgid "B<ENAMETOOLONG>"
1046 msgstr "B<ENAMETOOLONG>"
1047
1048 #. type: Plain text
1049 #: build/C/man2/bind.2:210
1050 msgid "I<addr> is too long."
1051 msgstr "I<addr> が長過ぎる。"
1052
1053 #. type: TP
1054 #: build/C/man2/bind.2:210
1055 #, no-wrap
1056 msgid "B<ENOENT>"
1057 msgstr "B<ENOENT>"
1058
1059 #. type: Plain text
1060 #: build/C/man2/bind.2:213
1061 msgid "The file does not exist."
1062 msgstr "ファイルが存在しない。"
1063
1064 #. type: TP
1065 #: build/C/man2/bind.2:213 build/C/man2/recv.2:429 build/C/man2/select.2:322
1066 #: build/C/man2/send.2:343
1067 #, no-wrap
1068 msgid "B<ENOMEM>"
1069 msgstr "B<ENOMEM>"
1070
1071 #. type: Plain text
1072 #: build/C/man2/bind.2:216
1073 msgid "Insufficient kernel memory was available."
1074 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1075
1076 #. type: TP
1077 #: build/C/man2/bind.2:216
1078 #, no-wrap
1079 msgid "B<ENOTDIR>"
1080 msgstr "B<ENOTDIR>"
1081
1082 #. type: Plain text
1083 #: build/C/man2/bind.2:219
1084 msgid "A component of the path prefix is not a directory."
1085 msgstr "パス名の構成要素がディレクトリではない。"
1086
1087 #. type: TP
1088 #: build/C/man2/bind.2:219
1089 #, no-wrap
1090 msgid "B<EROFS>"
1091 msgstr "B<EROFS>"
1092
1093 #. type: Plain text
1094 #: build/C/man2/bind.2:222
1095 msgid "The socket inode would reside on a read-only file system."
1096 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1097
1098 #.  SVr4 documents an additional
1099 #.  .B ENOSR
1100 #.  general error condition, and
1101 #.  additional
1102 #.  .B EIO
1103 #.  and
1104 #.  .B EISDIR
1105 #.  UNIX-domain error conditions.
1106 #. type: Plain text
1107 #: build/C/man2/bind.2:234
1108 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1109 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1110
1111 #. type: Plain text
1112 #: build/C/man2/bind.2:251
1113 msgid ""
1114 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1115 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1116 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1117 msgstr ""
1118 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1119 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1120 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1121
1122 #. type: SH
1123 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1124 #: build/C/man2/select.2:474 build/C/man2/send.2:414
1125 #: build/C/man3/sockatmark.3:93 build/C/man7/socket.7:834
1126 #, no-wrap
1127 msgid "BUGS"
1128 msgstr "バグ"
1129
1130 #.  FIXME What *are* transparent proxy options?
1131 #. type: Plain text
1132 #: build/C/man2/bind.2:254
1133 msgid "The transparent proxy options are not described."
1134 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1135
1136 #. type: Plain text
1137 #: build/C/man2/bind.2:259
1138 msgid ""
1139 "An example of the use of B<bind>()  with Internet domain sockets can be "
1140 "found in B<getaddrinfo>(3)."
1141 msgstr ""
1142 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1143 "(3)  に記載されている。"
1144
1145 #.  listen.7 refers to this example.
1146 #.  accept.7 refers to this example.
1147 #.  unix.7 refers to this example.
1148 #. type: Plain text
1149 #: build/C/man2/bind.2:266
1150 msgid ""
1151 "The following example shows how to bind a stream socket in the UNIX "
1152 "(B<AF_UNIX>)  domain, and accept connections:"
1153 msgstr ""
1154 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1155 "を示したものである。"
1156
1157 #. type: Plain text
1158 #: build/C/man2/bind.2:273
1159 #, no-wrap
1160 msgid ""
1161 "#include E<lt>sys/socket.hE<gt>\n"
1162 "#include E<lt>sys/un.hE<gt>\n"
1163 "#include E<lt>stdlib.hE<gt>\n"
1164 "#include E<lt>stdio.hE<gt>\n"
1165 "#include E<lt>string.hE<gt>\n"
1166 msgstr ""
1167 "#include E<lt>sys/socket.hE<gt>\n"
1168 "#include E<lt>sys/un.hE<gt>\n"
1169 "#include E<lt>stdlib.hE<gt>\n"
1170 "#include E<lt>stdio.hE<gt>\n"
1171 "#include E<lt>string.hE<gt>\n"
1172
1173 #. type: Plain text
1174 #: build/C/man2/bind.2:276
1175 #, no-wrap
1176 msgid ""
1177 "#define MY_SOCK_PATH \"/somepath\"\n"
1178 "#define LISTEN_BACKLOG 50\n"
1179 msgstr ""
1180 "#define MY_SOCK_PATH \"/somepath\"\n"
1181 "#define LISTEN_BACKLOG 50\n"
1182
1183 #. type: Plain text
1184 #: build/C/man2/bind.2:279
1185 #, no-wrap
1186 msgid ""
1187 "#define handle_error(msg) \\e\n"
1188 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1189 msgstr ""
1190 "#define handle_error(msg) \\e\n"
1191 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1192
1193 #. type: Plain text
1194 #: build/C/man2/bind.2:286
1195 #, no-wrap
1196 msgid ""
1197 "int\n"
1198 "main(int argc, char *argv[])\n"
1199 "{\n"
1200 "    int sfd, cfd;\n"
1201 "    struct sockaddr_un my_addr, peer_addr;\n"
1202 "    socklen_t peer_addr_size;\n"
1203 msgstr ""
1204 "int\n"
1205 "main(int argc, char *argv[])\n"
1206 "{\n"
1207 "    int sfd, cfd;\n"
1208 "    struct sockaddr_un my_addr, peer_addr;\n"
1209 "    socklen_t peer_addr_size;\n"
1210
1211 #. type: Plain text
1212 #: build/C/man2/bind.2:290
1213 #, no-wrap
1214 msgid ""
1215 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1216 "    if (sfd == -1)\n"
1217 "        handle_error(\"socket\");\n"
1218 msgstr ""
1219 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1220 "    if (sfd == -1)\n"
1221 "        handle_error(\"socket\");\n"
1222
1223 #. type: Plain text
1224 #: build/C/man2/bind.2:296
1225 #, no-wrap
1226 msgid ""
1227 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1228 "                        /* Clear structure */\n"
1229 "    my_addr.sun_family = AF_UNIX;\n"
1230 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1231 "            sizeof(my_addr.sun_path) - 1);\n"
1232 msgstr ""
1233 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1234 "                        /* Clear structure */\n"
1235 "    my_addr.sun_family = AF_UNIX;\n"
1236 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1237 "            sizeof(my_addr.sun_path) - 1);\n"
1238
1239 #. type: Plain text
1240 #: build/C/man2/bind.2:300
1241 #, no-wrap
1242 msgid ""
1243 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1244 "            sizeof(struct sockaddr_un)) == -1)\n"
1245 "        handle_error(\"bind\");\n"
1246 msgstr ""
1247 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1248 "            sizeof(struct sockaddr_un)) == -1)\n"
1249 "        handle_error(\"bind\");\n"
1250
1251 #. type: Plain text
1252 #: build/C/man2/bind.2:303
1253 #, no-wrap
1254 msgid ""
1255 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1256 "        handle_error(\"listen\");\n"
1257 msgstr ""
1258 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1259 "        handle_error(\"listen\");\n"
1260
1261 #. type: Plain text
1262 #: build/C/man2/bind.2:306
1263 #, no-wrap
1264 msgid ""
1265 "    /* Now we can accept incoming connections one\n"
1266 "       at a time using accept(2) */\n"
1267 msgstr ""
1268 "    /* Now we can accept incoming connections one\n"
1269 "       at a time using accept(2) */\n"
1270
1271 #. type: Plain text
1272 #: build/C/man2/bind.2:312
1273 #, no-wrap
1274 msgid ""
1275 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1276 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1277 "                 &peer_addr_size);\n"
1278 "    if (cfd == -1)\n"
1279 "        handle_error(\"accept\");\n"
1280 msgstr ""
1281 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1282 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1283 "                 &peer_addr_size)\n"
1284 "    if (cfd == -1)\n"
1285 "        handle_error(\"accept\");\n"
1286
1287 #. type: Plain text
1288 #: build/C/man2/bind.2:314
1289 #, no-wrap
1290 msgid "    /* Code to deal with incoming connection(s)... */\n"
1291 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1292
1293 #. type: Plain text
1294 #: build/C/man2/bind.2:318
1295 #, no-wrap
1296 msgid ""
1297 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1298 "       should be deleted using unlink(2) or remove(3) */\n"
1299 "}\n"
1300 msgstr ""
1301 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1302 "       should be deleted using unlink(2) or remove(3) */\n"
1303 "}\n"
1304
1305 #. type: Plain text
1306 #: build/C/man2/bind.2:332
1307 msgid ""
1308 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1309 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1310 "(7), B<socket>(7), B<unix>(7)"
1311 msgstr ""
1312 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1313 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1314 "(7), B<socket>(7), B<unix>(7)"
1315
1316 #. type: TH
1317 #: build/C/man3/bindresvport.3:30
1318 #, no-wrap
1319 msgid "BINDRESVPORT"
1320 msgstr "BINDRESVPORT"
1321
1322 #. type: TH
1323 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
1324 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
1325 #: build/C/man3/sockatmark.3:25
1326 #, no-wrap
1327 msgid "2008-12-03"
1328 msgstr "2008-12-03"
1329
1330 #. type: Plain text
1331 #: build/C/man3/bindresvport.3:33
1332 msgid "bindresvport - bind a socket to a privileged IP port"
1333 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1334
1335 #. type: Plain text
1336 #: build/C/man3/bindresvport.3:37
1337 #, no-wrap
1338 msgid ""
1339 "B<#include E<lt>sys/types.hE<gt>>\n"
1340 "B<#include E<lt>netinet/in.hE<gt>>\n"
1341 msgstr ""
1342 "B<#include E<lt>sys/types.hE<gt>>\n"
1343 "B<#include E<lt>netinet/in.hE<gt>>\n"
1344
1345 #. type: Plain text
1346 #: build/C/man3/bindresvport.3:39
1347 #, no-wrap
1348 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1349 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1350
1351 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1352 #. type: Plain text
1353 #: build/C/man3/bindresvport.3:46
1354 msgid ""
1355 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1356 "anonymous IP port, that is, a port number arbitrarily selected from the "
1357 "range 512 to 1023."
1358 msgstr ""
1359 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1360 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1361 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1362
1363 #. type: Plain text
1364 #: build/C/man3/bindresvport.3:56
1365 msgid ""
1366 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1367 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1368 "allocated."
1369 msgstr ""
1370 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1371 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1372 "される。"
1373
1374 #. type: Plain text
1375 #: build/C/man3/bindresvport.3:67
1376 msgid ""
1377 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1378 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1379 "return the port number actually allocated.  (This information can later be "
1380 "obtained using B<getsockname>(2).)"
1381 msgstr ""
1382 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1383 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1384 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1385 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1386
1387 #. type: Plain text
1388 #: build/C/man3/bindresvport.3:72
1389 msgid ""
1390 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1391 "I<errno> set to indicate the cause of the error."
1392 msgstr ""
1393 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1394 "I<errno> にエラーの原因を示す値を設定する。"
1395
1396 #. type: Plain text
1397 #: build/C/man3/bindresvport.3:77
1398 msgid ""
1399 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1400 "addition, the following errors may occur:"
1401 msgstr ""
1402 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1403 "以下のエラーが発生することがある:"
1404
1405 #. type: Plain text
1406 #: build/C/man3/bindresvport.3:82
1407 msgid ""
1408 "The caller did not have superuser privilege (to be precise: the "
1409 "B<CAP_NET_BIND_SERVICE> capability is required)."
1410 msgstr ""
1411 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1412 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1413
1414 #. type: Plain text
1415 #: build/C/man3/bindresvport.3:85
1416 msgid "All privileged ports are in use."
1417 msgstr "全ての特権ポートが使用中である。"
1418
1419 #. type: TP
1420 #: build/C/man3/bindresvport.3:85
1421 #, no-wrap
1422 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1423 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1424
1425 #. type: Plain text
1426 #: build/C/man3/bindresvport.3:92
1427 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1428 msgstr ""
1429 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1430
1431 #. type: Plain text
1432 #: build/C/man3/bindresvport.3:95
1433 msgid ""
1434 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1435 msgstr ""
1436 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1437
1438 #. type: Plain text
1439 #: build/C/man3/bindresvport.3:101
1440 msgid ""
1441 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1442 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1443 msgstr ""
1444 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1445 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1446
1447 #. type: Plain text
1448 #: build/C/man3/bindresvport.3:104
1449 msgid "B<bind>(2), B<getsockname>(2)"
1450 msgstr "B<bind>(2), B<getsockname>(2)"
1451
1452 #. type: TH
1453 #: build/C/man2/connect.2:67
1454 #, no-wrap
1455 msgid "CONNECT"
1456 msgstr "CONNECT"
1457
1458 #. type: Plain text
1459 #: build/C/man2/connect.2:70
1460 msgid "connect - initiate a connection on a socket"
1461 msgstr "connect - ソケットの接続を行う"
1462
1463 #. type: Plain text
1464 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1465 #: build/C/man2/listen.2:51
1466 #, no-wrap
1467 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1468 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1469
1470 #. type: Plain text
1471 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1472 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1473 #: build/C/man2/recv.2:51
1474 #, no-wrap
1475 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1476 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1477
1478 #. type: Plain text
1479 #: build/C/man2/connect.2:78
1480 #, no-wrap
1481 msgid ""
1482 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1483 "B<            socklen_t >I<addrlen>B<);>\n"
1484 msgstr ""
1485 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1486 "B<            socklen_t >I<addrlen>B<);>\n"
1487
1488 #. type: Plain text
1489 #: build/C/man2/connect.2:97
1490 msgid ""
1491 "The B<connect>()  system call connects the socket referred to by the file "
1492 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1493 "argument specifies the size of I<addr>.  The format of the address in "
1494 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1495 "B<socket>(2)  for further details."
1496 msgstr ""
1497 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1498 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1499 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1500 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1501 "こと。"
1502
1503 #. type: Plain text
1504 #: build/C/man2/connect.2:113
1505 msgid ""
1506 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1507 "to which datagrams are sent by default, and the only address from which "
1508 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1509 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1510 "that is bound to the address specified by I<addr>."
1511 msgstr ""
1512 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1513 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1514 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1515 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1516 "に対する接続の 作成を試みる。"
1517
1518 #. type: Plain text
1519 #: build/C/man2/connect.2:127
1520 msgid ""
1521 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1522 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1523 "times to change their association.  Connectionless sockets may dissolve the "
1524 "association by connecting to an address with the I<sa_family> member of "
1525 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1526 msgstr ""
1527 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1528 "()  が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1529 "度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1530 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1531 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1532
1533 #. type: Plain text
1534 #: build/C/man2/connect.2:132
1535 msgid ""
1536 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1537 "returned, and I<errno> is set appropriately."
1538 msgstr ""
1539 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1540 "適切な値を設定する。"
1541
1542 #. type: Plain text
1543 #: build/C/man2/connect.2:135
1544 msgid ""
1545 "The following are general socket errors only.  There may be other domain-"
1546 "specific error codes."
1547 msgstr ""
1548 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1549 "する可能性がある。"
1550
1551 #. type: Plain text
1552 #: build/C/man2/connect.2:143
1553 msgid ""
1554 "For UNIX domain sockets, which are identified by pathname: Write permission "
1555 "is denied on the socket file, or search permission is denied for one of the "
1556 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1557 msgstr ""
1558 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1559 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1560 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1561
1562 #. type: TP
1563 #: build/C/man2/connect.2:143
1564 #, no-wrap
1565 msgid "B<EACCES>, B<EPERM>"
1566 msgstr "B<EACCES>, B<EPERM>"
1567
1568 #. type: Plain text
1569 #: build/C/man2/connect.2:148
1570 msgid ""
1571 "The user tried to connect to a broadcast address without having the socket "
1572 "broadcast flag enabled or the connection request failed because of a local "
1573 "firewall rule."
1574 msgstr ""
1575 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1576 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1577 "要求が失敗した。"
1578
1579 #. type: Plain text
1580 #: build/C/man2/connect.2:151
1581 msgid "Local address is already in use."
1582 msgstr "ローカルアドレスが既に使用されている。"
1583
1584 #. type: TP
1585 #: build/C/man2/connect.2:151 build/C/man2/socket.2:324
1586 #: build/C/man2/socketpair.2:75
1587 #, no-wrap
1588 msgid "B<EAFNOSUPPORT>"
1589 msgstr "B<EAFNOSUPPORT>"
1590
1591 #. type: Plain text
1592 #: build/C/man2/connect.2:156
1593 msgid ""
1594 "The passed address didn't have the correct address family in its "
1595 "I<sa_family> field."
1596 msgstr ""
1597 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1598 "い。"
1599
1600 #. type: TP
1601 #: build/C/man2/connect.2:156
1602 #, no-wrap
1603 msgid "B<EAGAIN>"
1604 msgstr "B<EAGAIN>"
1605
1606 #. type: Plain text
1607 #: build/C/man2/connect.2:165
1608 msgid ""
1609 "No more free local ports or insufficient entries in the routing cache.  For "
1610 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1611 "B<ip>(7)  for information on how to increase the number of local ports."
1612 msgstr ""
1613 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1614 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1615 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1616
1617 #. type: TP
1618 #: build/C/man2/connect.2:165
1619 #, no-wrap
1620 msgid "B<EALREADY>"
1621 msgstr "B<EALREADY>"
1622
1623 #. type: Plain text
1624 #: build/C/man2/connect.2:169
1625 msgid ""
1626 "The socket is nonblocking and a previous connection attempt has not yet been "
1627 "completed."
1628 msgstr ""
1629 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1630
1631 #. type: Plain text
1632 #: build/C/man2/connect.2:172
1633 msgid "The file descriptor is not a valid index in the descriptor table."
1634 msgstr ""
1635 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1636 "い。"
1637
1638 #. type: TP
1639 #: build/C/man2/connect.2:172 build/C/man2/recv.2:412
1640 #, no-wrap
1641 msgid "B<ECONNREFUSED>"
1642 msgstr "B<ECONNREFUSED>"
1643
1644 #. type: Plain text
1645 #: build/C/man2/connect.2:175
1646 msgid "No-one listening on the remote address."
1647 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1648
1649 #. type: Plain text
1650 #: build/C/man2/connect.2:178
1651 msgid "The socket structure address is outside the user's address space."
1652 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1653
1654 #. type: TP
1655 #: build/C/man2/connect.2:178
1656 #, no-wrap
1657 msgid "B<EINPROGRESS>"
1658 msgstr "B<EINPROGRESS>"
1659
1660 #. type: Plain text
1661 #: build/C/man2/connect.2:203
1662 msgid ""
1663 "The socket is nonblocking and the connection cannot be completed "
1664 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1665 "by selecting the socket for writing.  After B<select>(2)  indicates "
1666 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1667 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1668 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1669 "error codes listed here, explaining the reason for the failure)."
1670 msgstr ""
1671 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1672 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1673 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1674 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1675 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1676 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1677 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1678 "の原因が分かる。"
1679
1680 #.  For TCP, the connection will complete asynchronously.
1681 #.  See http://lkml.org/lkml/2005/7/12/254
1682 #. type: Plain text
1683 #: build/C/man2/connect.2:209
1684 msgid ""
1685 "The system call was interrupted by a signal that was caught; see B<signal>"
1686 "(7)."
1687 msgstr ""
1688 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1689
1690 #. type: TP
1691 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1692 #, no-wrap
1693 msgid "B<EISCONN>"
1694 msgstr "B<EISCONN>"
1695
1696 #. type: Plain text
1697 #: build/C/man2/connect.2:212
1698 msgid "The socket is already connected."
1699 msgstr "ソケットは既に接続 (connect) されている。"
1700
1701 #. type: TP
1702 #: build/C/man2/connect.2:212
1703 #, no-wrap
1704 msgid "B<ENETUNREACH>"
1705 msgstr "B<ENETUNREACH>"
1706
1707 #. type: Plain text
1708 #: build/C/man2/connect.2:215
1709 msgid "Network is unreachable."
1710 msgstr "到達できないネットワークである。"
1711
1712 #. type: Plain text
1713 #: build/C/man2/connect.2:218
1714 msgid "The file descriptor is not associated with a socket."
1715 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1716
1717 #. type: TP
1718 #: build/C/man2/connect.2:218
1719 #, no-wrap
1720 msgid "B<ETIMEDOUT>"
1721 msgstr "B<ETIMEDOUT>"
1722
1723 #. type: Plain text
1724 #: build/C/man2/connect.2:225
1725 msgid ""
1726 "Timeout while attempting connection.  The server may be too busy to accept "
1727 "new connections.  Note that for IP sockets the timeout may be very long when "
1728 "syncookies are enabled on the server."
1729 msgstr ""
1730 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1731 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1732 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1733 "ること。"
1734
1735 #.  SVr4 documents the additional
1736 #.  general error codes
1737 #.  .BR EADDRNOTAVAIL ,
1738 #.  .BR EINVAL ,
1739 #.  .BR EAFNOSUPPORT ,
1740 #.  .BR EALREADY ,
1741 #.  .BR EINTR ,
1742 #.  .BR EPROTOTYPE ,
1743 #.  and
1744 #.  .BR ENOSR .
1745 #.  It also
1746 #.  documents many additional error conditions not described here.
1747 #. type: Plain text
1748 #: build/C/man2/connect.2:241
1749 msgid ""
1750 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1751 "POSIX.1-2001."
1752 msgstr ""
1753 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1754
1755 #. type: Plain text
1756 #: build/C/man2/connect.2:258
1757 msgid ""
1758 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1759 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1760 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1761 msgstr ""
1762 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1763 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1764 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1765
1766 #. type: Plain text
1767 #: build/C/man2/connect.2:263
1768 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1769 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1770
1771 #. type: Plain text
1772 #: build/C/man2/connect.2:270
1773 msgid ""
1774 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1775 "B<path_resolution>(7)"
1776 msgstr ""
1777 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1778 "B<path_resolution>(7)"
1779
1780 #. type: TH
1781 #: build/C/man3/getifaddrs.3:36
1782 #, no-wrap
1783 msgid "GETIFADDRS"
1784 msgstr "GETIFADDRS"
1785
1786 #. type: TH
1787 #: build/C/man3/getifaddrs.3:36
1788 #, fuzzy, no-wrap
1789 #| msgid "2011-10-01"
1790 msgid "2012-11-11"
1791 msgstr "2011-10-01"
1792
1793 #. type: TH
1794 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1795 #: build/C/man3/if_nametoindex.3:25
1796 #, no-wrap
1797 msgid "GNU"
1798 msgstr "GNU"
1799
1800 #. type: Plain text
1801 #: build/C/man3/getifaddrs.3:39
1802 msgid "getifaddrs, freeifaddrs - get interface addresses"
1803 msgstr ""
1804
1805 #. type: Plain text
1806 #: build/C/man3/getifaddrs.3:43
1807 #, no-wrap
1808 msgid ""
1809 "B<#include E<lt>sys/types.hE<gt>>\n"
1810 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1811 msgstr ""
1812 "B<#include E<lt>sys/types.hE<gt>>\n"
1813 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1814
1815 #. type: Plain text
1816 #: build/C/man3/getifaddrs.3:45
1817 #, no-wrap
1818 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1819 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1820
1821 #. type: Plain text
1822 #: build/C/man3/getifaddrs.3:47
1823 #, no-wrap
1824 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1825 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1826
1827 #. type: Plain text
1828 #: build/C/man3/getifaddrs.3:58
1829 msgid ""
1830 "The B<getifaddrs>()  function creates a linked list of structures describing "
1831 "the network interfaces of the local system, and stores the address of the "
1832 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1833 "structures, defined as follows:"
1834 msgstr ""
1835
1836 #. type: Plain text
1837 #: build/C/man3/getifaddrs.3:77
1838 #, no-wrap
1839 msgid ""
1840 "struct ifaddrs {\n"
1841 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1842 "    char            *ifa_name;    /* Name of interface */\n"
1843 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1844 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1845 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1846 "    union {\n"
1847 "        struct sockaddr *ifu_broadaddr;\n"
1848 "                         /* Broadcast address of interface */\n"
1849 "        struct sockaddr *ifu_dstaddr;\n"
1850 "                         /* Point-to-point destination address */\n"
1851 "    } ifa_ifu;\n"
1852 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1853 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1854 "    void            *ifa_data;    /* Address-specific data */\n"
1855 "};\n"
1856 msgstr ""
1857 "struct ifaddrs {\n"
1858 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1859 "    char            *ifa_name;    /* Name of interface */\n"
1860 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1861 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1862 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1863 "    union {\n"
1864 "        struct sockaddr *ifu_broadaddr;\n"
1865 "                         /* Broadcast address of interface */\n"
1866 "        struct sockaddr *ifu_dstaddr;\n"
1867 "                         /* Point-to-point destination address */\n"
1868 "    } ifa_ifu;\n"
1869 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1870 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1871 "    void            *ifa_data;    /* Address-specific data */\n"
1872 "};\n"
1873
1874 #. type: Plain text
1875 #: build/C/man3/getifaddrs.3:84
1876 msgid ""
1877 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1878 "or NULL if this is the last item of the list."
1879 msgstr ""
1880
1881 #.  The constant
1882 #.  .B IF NAMESIZE
1883 #.  indicates the maximum length of this field.
1884 #. type: Plain text
1885 #: build/C/man3/getifaddrs.3:91
1886 msgid "The I<ifa_name> points to the null-terminated interface name."
1887 msgstr ""
1888
1889 #. type: Plain text
1890 #: build/C/man3/getifaddrs.3:100
1891 msgid ""
1892 "The I<ifa_flags> field contains the interface flags, as returned by the "
1893 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1894 "these flags)."
1895 msgstr ""
1896
1897 #. type: Plain text
1898 #: build/C/man3/getifaddrs.3:109
1899 msgid ""
1900 "The I<ifa_addr> field points to a structure containing the interface "
1901 "address.  (The I<sa_family> subfield should be consulted to determine the "
1902 "format of the address structure.)  This field may contain a NULL pointer."
1903 msgstr ""
1904
1905 #. type: Plain text
1906 #: build/C/man3/getifaddrs.3:116
1907 msgid ""
1908 "The I<ifa_netmask> field points to a structure containing the netmask "
1909 "associated with I<ifa_addr>, if applicable for the address family.  This "
1910 "field may contain a NULL pointer."
1911 msgstr ""
1912
1913 #. type: Plain text
1914 #: build/C/man3/getifaddrs.3:131
1915 msgid ""
1916 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1917 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1918 "will contain the broadcast address associated with I<ifa_addr> (if "
1919 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1920 "destination address of the point-to-point interface."
1921 msgstr ""
1922
1923 #. type: Plain text
1924 #: build/C/man3/getifaddrs.3:136
1925 msgid ""
1926 "The I<ifa_data> field points to a buffer containing address-family-specific "
1927 "data; this field may be NULL if there is no such data for this interface."
1928 msgstr ""
1929
1930 #. type: Plain text
1931 #: build/C/man3/getifaddrs.3:142
1932 msgid ""
1933 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1934 "freed using B<freeifaddrs>()  when no longer needed."
1935 msgstr ""
1936
1937 #. type: Plain text
1938 #: build/C/man3/getifaddrs.3:149
1939 msgid ""
1940 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1941 "I<errno> is set appropriately."
1942 msgstr ""
1943
1944 #. type: Plain text
1945 #: build/C/man3/getifaddrs.3:162
1946 msgid ""
1947 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1948 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1949 "(2), B<malloc>(3), or B<realloc>(3)."
1950 msgstr ""
1951
1952 #. type: Plain text
1953 #: build/C/man3/getifaddrs.3:170
1954 msgid ""
1955 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1956 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1957 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1958 "available on kernels that support netlink."
1959 msgstr ""
1960
1961 #.  , but the BSD-derived documentation generally
1962 #.  appears to be confused and obsolete on this point.
1963 #.  i.e., commonly it still says one of them will be NULL, even if
1964 #.  the ifa_ifu union is already present
1965 #. type: Plain text
1966 #: build/C/man3/getifaddrs.3:190
1967 msgid ""
1968 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1969 "the BSD systems, but with slightly different semantics documented"
1970 "\\(emreturning one entry per interface, not per address.  This means "
1971 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1972 "address, and no link-level address is returned if the interface has an IP "
1973 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1974 "I<ifa_dstaddr> differs on various systems."
1975 msgstr ""
1976
1977 #. type: Plain text
1978 #: build/C/man3/getifaddrs.3:207
1979 msgid ""
1980 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
1981 "assigned to the interface, but also one B<AF_PACKET> address per interface "
1982 "containing lower-level details about the interface and its physical layer.  "
1983 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
1984 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
1985 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
1986 "hE<gt>>), which contains various interface attributes and statistics."
1987 msgstr ""
1988
1989 #. type: Plain text
1990 #: build/C/man3/getifaddrs.3:214
1991 msgid ""
1992 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
1993 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
1994 "system:"
1995 msgstr ""
1996
1997 #. type: Plain text
1998 #: build/C/man3/getifaddrs.3:228
1999 #, no-wrap
2000 msgid ""
2001 "$ B<./a.out>\n"
2002 "lo      address family: 17 (AF_PACKET)\n"
2003 "eth0    address family: 17 (AF_PACKET)\n"
2004 "lo      address family: 2 (AF_INET)\n"
2005 "        address: E<lt>127.0.0.1E<gt>\n"
2006 "eth0    address family: 2 (AF_INET)\n"
2007 "        address: E<lt>10.1.1.4E<gt>\n"
2008 "lo      address family: 10 (AF_INET6)\n"
2009 "        address: E<lt>::1E<gt>\n"
2010 "eth0    address family: 10 (AF_INET6)\n"
2011 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2012 msgstr ""
2013 "$ B<./a.out>\n"
2014 "lo      address family: 17 (AF_PACKET)\n"
2015 "eth0    address family: 17 (AF_PACKET)\n"
2016 "lo      address family: 2 (AF_INET)\n"
2017 "        address: E<lt>127.0.0.1E<gt>\n"
2018 "eth0    address family: 2 (AF_INET)\n"
2019 "        address: E<lt>10.1.1.4E<gt>\n"
2020 "lo      address family: 10 (AF_INET6)\n"
2021 "        address: E<lt>::1E<gt>\n"
2022 "eth0    address family: 10 (AF_INET6)\n"
2023 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2024
2025 #. type: SS
2026 #: build/C/man3/getifaddrs.3:230 build/C/man3/if_nameindex.3:120
2027 #: build/C/man2/recvmmsg.2:206
2028 #, no-wrap
2029 msgid "Program source"
2030 msgstr ""
2031
2032 #. type: Plain text
2033 #: build/C/man3/getifaddrs.3:240
2034 #, no-wrap
2035 msgid ""
2036 "#include E<lt>arpa/inet.hE<gt>\n"
2037 "#include E<lt>sys/socket.hE<gt>\n"
2038 "#include E<lt>netdb.hE<gt>\n"
2039 "#include E<lt>ifaddrs.hE<gt>\n"
2040 "#include E<lt>stdio.hE<gt>\n"
2041 "#include E<lt>stdlib.hE<gt>\n"
2042 "#include E<lt>unistd.hE<gt>\n"
2043 msgstr ""
2044 "#include E<lt>arpa/inet.hE<gt>\n"
2045 "#include E<lt>sys/socket.hE<gt>\n"
2046 "#include E<lt>netdb.hE<gt>\n"
2047 "#include E<lt>ifaddrs.hE<gt>\n"
2048 "#include E<lt>stdio.hE<gt>\n"
2049 "#include E<lt>stdlib.hE<gt>\n"
2050 "#include E<lt>unistd.hE<gt>\n"
2051
2052 #. type: Plain text
2053 #: build/C/man3/getifaddrs.3:247
2054 #, no-wrap
2055 msgid ""
2056 "int\n"
2057 "main(int argc, char *argv[])\n"
2058 "{\n"
2059 "    struct ifaddrs *ifaddr, *ifa;\n"
2060 "    int family, s;\n"
2061 "    char host[NI_MAXHOST];\n"
2062 msgstr ""
2063 "int\n"
2064 "main(int argc, char *argv[])\n"
2065 "{\n"
2066 "    struct ifaddrs *ifaddr, *ifa;\n"
2067 "    int family, s;\n"
2068 "    char host[NI_MAXHOST];\n"
2069
2070 #. type: Plain text
2071 #: build/C/man3/getifaddrs.3:252
2072 #, no-wrap
2073 msgid ""
2074 "    if (getifaddrs(&ifaddr) == -1) {\n"
2075 "        perror(\"getifaddrs\");\n"
2076 "        exit(EXIT_FAILURE);\n"
2077 "    }\n"
2078 msgstr ""
2079 "    if (getifaddrs(&ifaddr) == -1) {\n"
2080 "        perror(\"getifaddrs\");\n"
2081 "        exit(EXIT_FAILURE);\n"
2082 "    }\n"
2083
2084 #. type: Plain text
2085 #: build/C/man3/getifaddrs.3:255
2086 #, no-wrap
2087 msgid ""
2088 "    /* Walk through linked list, maintaining head pointer so we\n"
2089 "       can free list later */\n"
2090 msgstr ""
2091 "    /* Walk through linked list, maintaining head pointer so we\n"
2092 "       can free list later */\n"
2093
2094 #. type: Plain text
2095 #: build/C/man3/getifaddrs.3:259
2096 #, no-wrap
2097 msgid ""
2098 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2099 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2100 "            continue;\n"
2101 msgstr ""
2102 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2103 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2104 "            continue;\n"
2105
2106 #. type: Plain text
2107 #: build/C/man3/getifaddrs.3:261
2108 #, no-wrap
2109 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2110 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2111
2112 #. type: Plain text
2113 #: build/C/man3/getifaddrs.3:264
2114 #, no-wrap
2115 msgid ""
2116 "        /* Display interface name and family (including symbolic\n"
2117 "           form of the latter for the common families) */\n"
2118 msgstr ""
2119 "        /* Display interface name and family (including symbolic\n"
2120 "           form of the latter for the common families) */\n"
2121
2122 #. type: Plain text
2123 #: build/C/man3/getifaddrs.3:270
2124 #, no-wrap
2125 msgid ""
2126 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2127 "                ifa-E<gt>ifa_name, family,\n"
2128 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2129 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2130 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2131 msgstr ""
2132 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2133 "                ifa-E<gt>ifa_name, family,\n"
2134 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2135 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2136 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2137
2138 #. type: Plain text
2139 #: build/C/man3/getifaddrs.3:272
2140 #, no-wrap
2141 msgid "        /* For an AF_INET* interface address, display the address */\n"
2142 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2143
2144 #. type: Plain text
2145 #: build/C/man3/getifaddrs.3:285
2146 #, no-wrap
2147 msgid ""
2148 "        if (family == AF_INET || family == AF_INET6) {\n"
2149 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2150 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2151 "                                          sizeof(struct sockaddr_in6),\n"
2152 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2153 "            if (s != 0) {\n"
2154 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2155 "                exit(EXIT_FAILURE);\n"
2156 "            }\n"
2157 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2158 "        }\n"
2159 "    }\n"
2160 msgstr ""
2161 "        if (family == AF_INET || family == AF_INET6) {\n"
2162 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2163 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2164 "                                          sizeof(struct sockaddr_in6),\n"
2165 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2166 "            if (s != 0) {\n"
2167 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2168 "                exit(EXIT_FAILURE);\n"
2169 "            }\n"
2170 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2171 "        }\n"
2172 "    }\n"
2173
2174 #. type: Plain text
2175 #: build/C/man3/getifaddrs.3:289
2176 #, no-wrap
2177 msgid ""
2178 "    freeifaddrs(ifaddr);\n"
2179 "    exit(EXIT_SUCCESS);\n"
2180 "}\n"
2181 msgstr ""
2182 "    freeifaddrs(ifaddr);\n"
2183 "    exit(EXIT_SUCCESS);\n"
2184 "}\n"
2185
2186 #. type: Plain text
2187 #: build/C/man3/getifaddrs.3:296
2188 msgid ""
2189 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2190 msgstr ""
2191 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2192
2193 #. type: TH
2194 #: build/C/man2/getsockname.2:40
2195 #, no-wrap
2196 msgid "GETSOCKNAME"
2197 msgstr "GETSOCKNAME"
2198
2199 #. type: Plain text
2200 #: build/C/man2/getsockname.2:43
2201 msgid "getsockname - get socket name"
2202 msgstr "getsockname - ソケットの名前を取得する"
2203
2204 #. type: Plain text
2205 #: build/C/man2/getsockname.2:49
2206 #, no-wrap
2207 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2208 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2209
2210 #. type: Plain text
2211 #: build/C/man2/getsockname.2:62
2212 msgid ""
2213 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2214 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2215 "should be initialized to indicate the amount of space (in bytes) pointed to "
2216 "by I<addr>.  On return it contains the actual size of the socket address."
2217 msgstr ""
2218 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2219 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2220 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2221 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2222 "納される。"
2223
2224 #. type: Plain text
2225 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2226 #: build/C/man2/listen.2:96
2227 msgid "The argument I<sockfd> is not a valid descriptor."
2228 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2229
2230 #. type: Plain text
2231 #: build/C/man2/getsockname.2:84
2232 msgid ""
2233 "The I<addr> argument points to memory not in a valid part of the process "
2234 "address space."
2235 msgstr ""
2236 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2237 "い。"
2238
2239 #. type: Plain text
2240 #: build/C/man2/getsockname.2:88
2241 msgid "I<addrlen> is invalid (e.g., is negative)."
2242 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2243
2244 #. type: TP
2245 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2246 #: build/C/man2/send.2:335
2247 #, no-wrap
2248 msgid "B<ENOBUFS>"
2249 msgstr "B<ENOBUFS>"
2250
2251 #. type: Plain text
2252 #: build/C/man2/getsockname.2:92
2253 msgid ""
2254 "Insufficient resources were available in the system to perform the operation."
2255 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2256
2257 #. type: Plain text
2258 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2259 msgid "The argument I<sockfd> is a file, not a socket."
2260 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2261
2262 #.  SVr4 documents additional ENOMEM
2263 #.  and ENOSR error codes.
2264 #. type: Plain text
2265 #: build/C/man2/getsockname.2:103
2266 msgid ""
2267 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2268 "POSIX.1-2001."
2269 msgstr ""
2270 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2271
2272 #. type: Plain text
2273 #: build/C/man2/getsockname.2:112
2274 msgid ""
2275 "The third argument of B<getsockname>()  is in reality an I<int *> (and this "
2276 "is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
2277 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
2278 msgstr ""
2279 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2280 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2281 "POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2282
2283 #. type: Plain text
2284 #: build/C/man2/getsockname.2:119
2285 msgid ""
2286 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2287 "(7)"
2288 msgstr ""
2289 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2290 "(7)"
2291
2292 #. type: TH
2293 #: build/C/man2/getsockopt.2:44
2294 #, no-wrap
2295 msgid "GETSOCKOPT"
2296 msgstr "GETSOCKOPT"
2297
2298 #. type: Plain text
2299 #: build/C/man2/getsockopt.2:47
2300 msgid "getsockopt, setsockopt - get and set options on sockets"
2301 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2302
2303 #. type: Plain text
2304 #: build/C/man2/getsockopt.2:57
2305 #, no-wrap
2306 msgid ""
2307 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2308 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2309 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2310 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2311 msgstr ""
2312 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2313 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2314 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2315 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2316
2317 #. type: Plain text
2318 #: build/C/man2/getsockopt.2:67
2319 msgid ""
2320 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2321 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2322 "protocol levels; they are always present at the uppermost socket level."
2323 msgstr ""
2324 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2325 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2326 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2327 "定される。"
2328
2329 #. type: Plain text
2330 #: build/C/man2/getsockopt.2:86
2331 msgid ""
2332 "When manipulating socket options, the level at which the option resides and "
2333 "the name of the option must be specified.  To manipulate options at the "
2334 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2335 "options at any other level the protocol number of the appropriate protocol "
2336 "controlling the option is supplied.  For example, to indicate that an option "
2337 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2338 "protocol number of B<TCP>; see B<getprotoent>(3)."
2339 msgstr ""
2340 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2341 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2342 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2343 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2344 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2345 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2346 "B<getprotoent>(3)  を参照すること。"
2347
2348 #. type: Plain text
2349 #: build/C/man2/getsockopt.2:108
2350 msgid ""
2351 "The arguments I<optval> and I<optlen> are used to access option values for "
2352 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2353 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2354 "I<optlen> is a value-result argument, initially containing the size of the "
2355 "buffer pointed to by I<optval>, and modified on return to indicate the "
2356 "actual size of the value returned.  If no option value is to be supplied or "
2357 "returned, I<optval> may be NULL."
2358 msgstr ""
2359 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2360 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2361 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2362 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2363 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2364 "I<optval> は NULL でも良い。"
2365
2366 #. type: Plain text
2367 #: build/C/man2/getsockopt.2:118
2368 msgid ""
2369 "I<Optname> and any specified options are passed uninterpreted to the "
2370 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2371 "socket.hE<gt>> contains definitions for socket level options, described "
2372 "below.  Options at other protocol levels vary in format and name; consult "
2373 "the appropriate entries in section 4 of the manual."
2374 msgstr ""
2375 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2376 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2377 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2378 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2379 "ること。"
2380
2381 #. type: Plain text
2382 #: build/C/man2/getsockopt.2:127
2383 msgid ""
2384 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2385 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2386 "or zero if the option is to be disabled."
2387 msgstr ""
2388 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2389 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2390 "を指定し、 無効(disable)にするにはゼロを指定する。"
2391
2392 #. type: Plain text
2393 #: build/C/man2/getsockopt.2:131
2394 msgid ""
2395 "For a description of the available socket options see B<socket>(7)  and the "
2396 "appropriate protocol man pages."
2397 msgstr ""
2398 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2399 "ルの man ページを参照のこと。"
2400
2401 #. type: Plain text
2402 #: build/C/man2/getsockopt.2:152
2403 msgid ""
2404 "The address pointed to by I<optval> is not in a valid part of the process "
2405 "address space.  For B<getsockopt>(), this error may also be returned if "
2406 "I<optlen> is not in a valid part of the process address space."
2407 msgstr ""
2408 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2409 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2410 "い場合にもこのエラーが返される。"
2411
2412 #. type: Plain text
2413 #: build/C/man2/getsockopt.2:163
2414 msgid ""
2415 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2416 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2417 "option described in B<ip>(7))."
2418 msgstr ""
2419 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2420 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2421 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2422
2423 #. type: TP
2424 #: build/C/man2/getsockopt.2:163
2425 #, no-wrap
2426 msgid "B<ENOPROTOOPT>"
2427 msgstr "B<ENOPROTOOPT>"
2428
2429 #. type: Plain text
2430 #: build/C/man2/getsockopt.2:166
2431 msgid "The option is unknown at the level indicated."
2432 msgstr "指定された層(level)にはこのオプションは存在しない。"
2433
2434 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2435 #.  not document the
2436 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2437 #.  options
2438 #. type: Plain text
2439 #: build/C/man2/getsockopt.2:178
2440 msgid ""
2441 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2442 msgstr ""
2443 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2444 "POSIX.1-2001."
2445
2446 #. type: Plain text
2447 #: build/C/man2/getsockopt.2:199
2448 msgid ""
2449 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2450 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2451 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2452 "glibc.  See also B<accept>(2)."
2453 msgstr ""
2454 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2455 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2456 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2457 "る。 B<accept>(2)  も参照のこと。"
2458
2459 #. type: Plain text
2460 #: build/C/man2/getsockopt.2:202
2461 msgid ""
2462 "Several of the socket options should be handled at lower levels of the "
2463 "system."
2464 msgstr ""
2465 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2466
2467 #. type: Plain text
2468 #: build/C/man2/getsockopt.2:210
2469 msgid ""
2470 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2471 "B<tcp>(7), B<unix>(7)"
2472 msgstr ""
2473 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2474 "B<tcp>(7), B<unix>(7)"
2475
2476 #. type: TH
2477 #: build/C/man3/if_nameindex.3:26
2478 #, no-wrap
2479 msgid "IF_NAMEINDEX"
2480 msgstr ""
2481
2482 #. type: TH
2483 #: build/C/man3/if_nameindex.3:26
2484 #, fuzzy, no-wrap
2485 #| msgid "2008-11-20"
2486 msgid "2012-11-21"
2487 msgstr "2008-11-20"
2488
2489 #. type: Plain text
2490 #: build/C/man3/if_nameindex.3:29
2491 msgid ""
2492 "if_nameindex, if_freenameindex - get network interface names and indexes"
2493 msgstr ""
2494
2495 #. type: Plain text
2496 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2497 #, fuzzy, no-wrap
2498 #| msgid "B<#include E<lt>unistd.hE<gt>>\n"
2499 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2500 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
2501
2502 #. type: Plain text
2503 #: build/C/man3/if_nameindex.3:35
2504 #, no-wrap
2505 msgid ""
2506 "B<struct if_nameindex *if_nameindex(void);>\n"
2507 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2508 msgstr ""
2509
2510 #. type: Plain text
2511 #: build/C/man3/if_nameindex.3:46
2512 msgid ""
2513 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2514 "structures, each containing information about one of the network interfaces "
2515 "on the local system.  The I<if_nameindex> structure contains at least the "
2516 "following entries:"
2517 msgstr ""
2518
2519 #. type: Plain text
2520 #: build/C/man3/if_nameindex.3:51
2521 #, no-wrap
2522 msgid ""
2523 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2524 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2525 msgstr ""
2526
2527 #. type: Plain text
2528 #: build/C/man3/if_nameindex.3:65
2529 msgid ""
2530 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2531 "points to the null-terminated interface name.  The end of the array is "
2532 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2533 msgstr ""
2534
2535 #. type: Plain text
2536 #: build/C/man3/if_nameindex.3:71
2537 msgid ""
2538 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2539 "and should be freed using B<if_freenameindex>()  when no longer needed."
2540 msgstr ""
2541
2542 #. type: Plain text
2543 #: build/C/man3/if_nameindex.3:78
2544 #, fuzzy
2545 #| msgid ""
2546 #| "On success, zero is returned.  On error, -1 is returned, and I<errno> is "
2547 #| "set appropriately."
2548 msgid ""
2549 "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2550 "NULL pointer is returned, and I<errno> is set appropriately."
2551 msgstr ""
2552 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
2553 "設定される。"
2554
2555 #. type: Plain text
2556 #: build/C/man3/if_nameindex.3:83
2557 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2558 msgstr ""
2559
2560 #. type: Plain text
2561 #: build/C/man3/if_nameindex.3:86
2562 #, fuzzy
2563 #| msgid "Insufficient kernel memory was available."
2564 msgid "Insufficient resources available."
2565 msgstr "カーネルに、利用可能なメモリーが十分にない。"
2566
2567 #. type: Plain text
2568 #: build/C/man3/if_nameindex.3:97
2569 msgid ""
2570 "B<if_nameindex>()  may also fail for any of the errors specified for "
2571 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2572 "B<sendto>(2), or B<malloc>(3)."
2573 msgstr ""
2574
2575 #. type: Plain text
2576 #: build/C/man3/if_nameindex.3:104
2577 msgid ""
2578 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2579 "glibc 2.3.4, the implementation only supported interfaces with IPv4 "
2580 "addresses.  Support of interfaces that don't have IPv4 addresses is only "
2581 "available on kernels that support netlink."
2582 msgstr ""
2583
2584 #. type: Plain text
2585 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2586 #, fuzzy
2587 #| msgid "4.4BSD, POSIX.1-2001."
2588 msgid "RFC\\ 3493, POSIX.1-2001."
2589 msgstr "4.4BSD, POSIX.1-2001."
2590
2591 #. type: Plain text
2592 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2593 #, fuzzy
2594 #| msgid ""
2595 #| "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
2596 msgid "This function first appeared in BSDi."
2597 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
2598
2599 #. type: Plain text
2600 #: build/C/man3/if_nameindex.3:112
2601 msgid ""
2602 "The program below demonstrates the use of the functions described on this "
2603 "page.  An example of the output this program might produce is the following:"
2604 msgstr ""
2605
2606 #. type: Plain text
2607 #: build/C/man3/if_nameindex.3:118
2608 #, no-wrap
2609 msgid ""
2610 "$ B<./a.out>I<\n"
2611 "1: lo\n"
2612 "2: wlan0\n"
2613 "3: em1>\n"
2614 msgstr ""
2615
2616 #. type: Plain text
2617 #: build/C/man3/if_nameindex.3:126
2618 #, fuzzy, no-wrap
2619 #| msgid ""
2620 #| "#include E<lt>stdio.hE<gt>\n"
2621 #| "#include E<lt>stdlib.hE<gt>\n"
2622 #| "#include E<lt>sys/time.hE<gt>\n"
2623 #| "#include E<lt>sys/types.hE<gt>\n"
2624 #| "#include E<lt>unistd.hE<gt>\n"
2625 msgid ""
2626 "#include E<lt>net/if.hE<gt>\n"
2627 "#include E<lt>stdio.hE<gt>\n"
2628 "#include E<lt>stdlib.hE<gt>\n"
2629 "#include E<lt>unistd.hE<gt>\n"
2630 msgstr ""
2631 "#include E<lt>stdio.hE<gt>\n"
2632 "#include E<lt>stdlib.hE<gt>\n"
2633 "#include E<lt>sys/time.hE<gt>\n"
2634 "#include E<lt>sys/types.hE<gt>\n"
2635 "#include E<lt>unistd.hE<gt>\n"
2636
2637 #. type: Plain text
2638 #: build/C/man3/if_nameindex.3:131
2639 #, fuzzy, no-wrap
2640 #| msgid ""
2641 #| "int\n"
2642 #| "main(int argc, char *argv[])\n"
2643 #| "{\n"
2644 #| "    struct ifaddrs *ifaddr, *ifa;\n"
2645 #| "    int family, s;\n"
2646 #| "    char host[NI_MAXHOST];\n"
2647 msgid ""
2648 "int\n"
2649 "main(int argc, char *argv[])\n"
2650 "{\n"
2651 "    struct if_nameindex *if_ni, *i;\n"
2652 msgstr ""
2653 "int\n"
2654 "main(int argc, char *argv[])\n"
2655 "{\n"
2656 "    struct ifaddrs *ifaddr, *ifa;\n"
2657 "    int family, s;\n"
2658 "    char host[NI_MAXHOST];\n"
2659
2660 #. type: Plain text
2661 #: build/C/man3/if_nameindex.3:137
2662 #, fuzzy, no-wrap
2663 #| msgid ""
2664 #| "    if (getifaddrs(&ifaddr) == -1) {\n"
2665 #| "        perror(\"getifaddrs\");\n"
2666 #| "        exit(EXIT_FAILURE);\n"
2667 #| "    }\n"
2668 msgid ""
2669 "    if_ni = if_nameindex();\n"
2670 "    if (if_ni == NULL) {\n"
2671 "        perror(\"if_nameindex\");\n"
2672 "        exit(EXIT_FAILURE);\n"
2673 "    }\n"
2674 msgstr ""
2675 "    if (getifaddrs(&ifaddr) == -1) {\n"
2676 "        perror(\"getifaddrs\");\n"
2677 "        exit(EXIT_FAILURE);\n"
2678 "    }\n"
2679
2680 #. type: Plain text
2681 #: build/C/man3/if_nameindex.3:140
2682 #, no-wrap
2683 msgid ""
2684 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2685 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2686 msgstr ""
2687
2688 #. type: Plain text
2689 #: build/C/man3/if_nameindex.3:142
2690 #, no-wrap
2691 msgid "    if_freenameindex(if_ni);\n"
2692 msgstr ""
2693
2694 #. type: Plain text
2695 #: build/C/man3/if_nameindex.3:145 build/C/man2/select.2:573
2696 #, no-wrap
2697 msgid ""
2698 "    exit(EXIT_SUCCESS);\n"
2699 "}\n"
2700 msgstr ""
2701 "    exit(EXIT_SUCCESS);\n"
2702 "}\n"
2703
2704 #. type: Plain text
2705 #: build/C/man3/if_nameindex.3:153
2706 #, fuzzy
2707 #| msgid ""
2708 #| "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2709 #| "B<unix>(7)"
2710 msgid ""
2711 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2712 "B<if_nametoindex>(3), B<ifconfig>(8)"
2713 msgstr ""
2714 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2715 "(7)"
2716
2717 #. type: TH
2718 #: build/C/man3/if_nametoindex.3:25
2719 #, no-wrap
2720 msgid "IF_NAMETOINDEX"
2721 msgstr ""
2722
2723 #. type: TH
2724 #: build/C/man3/if_nametoindex.3:25
2725 #, fuzzy, no-wrap
2726 #| msgid "2012-02-27"
2727 msgid "2012-12-14"
2728 msgstr "2012-02-27"
2729
2730 #. type: Plain text
2731 #: build/C/man3/if_nametoindex.3:29
2732 msgid ""
2733 "if_nametoindex, if_indextoname - mappings between network interface names "
2734 "and indexes"
2735 msgstr ""
2736
2737 #. type: Plain text
2738 #: build/C/man3/if_nametoindex.3:34
2739 #, no-wrap
2740 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2741 msgstr ""
2742
2743 #. type: Plain text
2744 #: build/C/man3/if_nametoindex.3:36
2745 #, no-wrap
2746 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2747 msgstr ""
2748
2749 #. type: Plain text
2750 #: build/C/man3/if_nametoindex.3:43
2751 msgid ""
2752 "The B<if_nametoindex>()  function returns the index of the network interface "
2753 "corresponding to the name I<ifname>."
2754 msgstr ""
2755
2756 #. type: Plain text
2757 #: build/C/man3/if_nametoindex.3:54
2758 msgid ""
2759 "The B<if_indextoname>()  function returns the name of the network interface "
2760 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2761 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2762 "least B<IF_NAMESIZE> bytes."
2763 msgstr ""
2764
2765 #. type: Plain text
2766 #: build/C/man3/if_nametoindex.3:61
2767 #, fuzzy
2768 #| msgid ""
2769 #| "On success, these calls return the number of characters sent.  On error, "
2770 #| "-1 is returned, and I<errno> is set appropriately."
2771 msgid ""
2772 "On success, B<if_nametoindex>()  returns the index number of the network "
2773 "interface; on error, 0 is returned and I<errno> is set appropriately."
2774 msgstr ""
2775 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
2776 "合、 -1 を返し、 I<errno> を適切に設定にする。"
2777
2778 #. type: Plain text
2779 #: build/C/man3/if_nametoindex.3:69
2780 #, fuzzy
2781 #| msgid ""
2782 #| "On success, zero is returned.  On error, -1 is returned, and I<errno> is "
2783 #| "set appropriately."
2784 msgid ""
2785 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2786 "returned and I<errno> is set appropriately."
2787 msgstr ""
2788 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
2789 "設定される。"
2790
2791 #. type: Plain text
2792 #: build/C/man3/if_nametoindex.3:74
2793 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2794 msgstr ""
2795
2796 #. type: TP
2797 #: build/C/man3/if_nametoindex.3:74
2798 #, fuzzy, no-wrap
2799 #| msgid "B<ENFILE>"
2800 msgid "B<ENXIO>"
2801 msgstr "B<ENFILE>"
2802
2803 #. type: Plain text
2804 #: build/C/man3/if_nametoindex.3:77
2805 msgid "No interface found for the index."
2806 msgstr ""
2807
2808 #. type: Plain text
2809 #: build/C/man3/if_nametoindex.3:85
2810 msgid ""
2811 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2812 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2813 msgstr ""
2814
2815 #. type: Plain text
2816 #: build/C/man3/if_nametoindex.3:93
2817 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2818 msgstr ""
2819
2820 #. type: TH
2821 #: build/C/man2/listen.2:45
2822 #, no-wrap
2823 msgid "LISTEN"
2824 msgstr "LISTEN"
2825
2826 #. type: TH
2827 #: build/C/man2/listen.2:45
2828 #, no-wrap
2829 msgid "2008-11-20"
2830 msgstr "2008-11-20"
2831
2832 #. type: Plain text
2833 #: build/C/man2/listen.2:48
2834 msgid "listen - listen for connections on a socket"
2835 msgstr "listen - ソケット(socket)上の接続を待つ"
2836
2837 #. type: Plain text
2838 #: build/C/man2/listen.2:55
2839 #, no-wrap
2840 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2841 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2842
2843 #. type: Plain text
2844 #: build/C/man2/listen.2:63
2845 msgid ""
2846 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2847 "that is, as a socket that will be used to accept incoming connection "
2848 "requests using B<accept>(2)."
2849 msgstr ""
2850 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2851 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2852 "した接続要求を受け付けるのに使用されるソケットである。"
2853
2854 #. type: Plain text
2855 #: build/C/man2/listen.2:70
2856 msgid ""
2857 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2858 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2859 msgstr ""
2860 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2861 "するファイルディスクリプタである。"
2862
2863 #. type: Plain text
2864 #: build/C/man2/listen.2:82
2865 msgid ""
2866 "The I<backlog> argument defines the maximum length to which the queue of "
2867 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2868 "when the queue is full, the client may receive an error with an indication "
2869 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2870 "the request may be ignored so that a later reattempt at connection succeeds."
2871 msgstr ""
2872 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2873 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2874 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2875 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2876 "い。"
2877
2878 #. type: Plain text
2879 #: build/C/man2/listen.2:91
2880 msgid "Another socket is already listening on the same port."
2881 msgstr "別のソケットが既に同じポートを listen している。"
2882
2883 #. type: Plain text
2884 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
2885 msgid "The argument I<sockfd> is not a socket."
2886 msgstr "引き数 I<sockfd> はソケットではない。"
2887
2888 #. type: Plain text
2889 #: build/C/man2/listen.2:106
2890 msgid "The socket is not of a type that supports the B<listen>()  operation."
2891 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2892
2893 #. type: Plain text
2894 #: build/C/man2/listen.2:111
2895 msgid ""
2896 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2897 "4.2BSD."
2898 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2899
2900 #. type: Plain text
2901 #: build/C/man2/listen.2:113
2902 msgid "To accept connections, the following steps are performed:"
2903 msgstr "接続を受け付けるには、以下の処理が実行される。"
2904
2905 #. type: TP
2906 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
2907 #, no-wrap
2908 msgid "1."
2909 msgstr "1."
2910
2911 #. type: Plain text
2912 #: build/C/man2/listen.2:117
2913 msgid "A socket is created with B<socket>(2)."
2914 msgstr "B<socket>(2)  でソケットを作成する。"
2915
2916 #. type: TP
2917 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
2918 #, no-wrap
2919 msgid "2."
2920 msgstr "2."
2921
2922 #. type: Plain text
2923 #: build/C/man2/listen.2:123
2924 msgid ""
2925 "The socket is bound to a local address using B<bind>(2), so that other "
2926 "sockets may be B<connect>(2)ed to it."
2927 msgstr ""
2928 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2929 "のソケットに B<connect>(2)  できるようにする。"
2930
2931 #. type: TP
2932 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
2933 #, no-wrap
2934 msgid "3."
2935 msgstr "3."
2936
2937 #. type: Plain text
2938 #: build/C/man2/listen.2:127
2939 msgid ""
2940 "A willingness to accept incoming connections and a queue limit for incoming "
2941 "connections are specified with B<listen>()."
2942 msgstr ""
2943 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2944 "定する。"
2945
2946 #. type: TP
2947 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
2948 #, no-wrap
2949 msgid "4."
2950 msgstr "4."
2951
2952 #. type: Plain text
2953 #: build/C/man2/listen.2:130
2954 msgid "Connections are accepted with B<accept>(2)."
2955 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2956
2957 #. type: Plain text
2958 #: build/C/man2/listen.2:153
2959 msgid ""
2960 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2961 "2.2.  Now it specifies the queue length for I<completely> established "
2962 "sockets waiting to be accepted, instead of the number of incomplete "
2963 "connection requests.  The maximum length of the queue for incomplete sockets "
2964 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2965 "are enabled there is no logical maximum length and this setting is ignored.  "
2966 "See B<tcp>(7)  for more information."
2967 msgstr ""
2968 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2969 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2970 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2971 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2972 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2973 "論理的な最大長は存在せず、この設定は無視される。"
2974
2975 #.  The following is now rather historic information (MTK, Jun 05)
2976 #.  Don't rely on this value in portable applications since BSD
2977 #.  (and some BSD-derived systems) limit the backlog to 5.
2978 #. type: Plain text
2979 #: build/C/man2/listen.2:166
2980 msgid ""
2981 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2982 "somaxconn>, then it is silently truncated to that value; the default value "
2983 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
2984 "value, B<SOMAXCONN>, with the value 128."
2985 msgstr ""
2986 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2987 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2988 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2989 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2990
2991 #. type: Plain text
2992 #: build/C/man2/listen.2:175
2993 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2994 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2995
2996 #. type: TH
2997 #: build/C/man2/recv.2:41
2998 #, no-wrap
2999 msgid "RECV"
3000 msgstr "RECV"
3001
3002 #. type: TH
3003 #: build/C/man2/recv.2:41
3004 #, fuzzy, no-wrap
3005 #| msgid "2012-02-27"
3006 msgid "2012-12-21"
3007 msgstr "2012-02-27"
3008
3009 #. type: Plain text
3010 #: build/C/man2/recv.2:44
3011 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3012 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3013
3014 #. type: Plain text
3015 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3016 #: build/C/man2/select_tut.2:47
3017 #, no-wrap
3018 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3019 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3020
3021 #. type: Plain text
3022 #: build/C/man2/recv.2:53
3023 #, no-wrap
3024 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3025 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3026
3027 #. type: Plain text
3028 #: build/C/man2/recv.2:56
3029 #, no-wrap
3030 msgid ""
3031 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3032 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3033 msgstr ""
3034 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3035 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3036
3037 #. type: Plain text
3038 #: build/C/man2/recv.2:58
3039 #, no-wrap
3040 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3041 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3042
3043 #. type: Plain text
3044 #: build/C/man2/recv.2:66
3045 msgid ""
3046 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
3047 "a socket, and may be used to receive data on a socket whether or not it is "
3048 "connection-oriented."
3049 msgstr ""
3050 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3051 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3052 "接続指向 (connection-oriened) であってもなくてもよい。"
3053
3054 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3055 #.  .I src_addr
3056 #.  is filled in.
3057 #.  .I src_addr
3058 #.  is also filled in for stream sockets in the UNIX domain, but is not
3059 #.  filled in for stream sockets in the Internet domain.)
3060 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3061 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3062 #. type: Plain text
3063 #: build/C/man2/recv.2:95
3064 msgid ""
3065 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3066 "address, this source address is filled in.  When I<src_addr> is NULL, "
3067 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
3068 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
3069 "caller should initialize before the call to the size of the buffer "
3070 "associated with I<src_addr>, and modified on return to indicate the actual "
3071 "size of the source address.  The returned address is truncated if the buffer "
3072 "provided is too small; in this case, I<addrlen> will return a value greater "
3073 "than was supplied to the call."
3074 msgstr ""
3075 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3076 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3077 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3078 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3079 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3080 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3081 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3082 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3083 "な値が返される。"
3084
3085 #. type: Plain text
3086 #: build/C/man2/recv.2:107
3087 msgid ""
3088 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3089 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
3090 "argument."
3091 msgstr ""
3092 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3093 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3094 "()  と等価である。"
3095
3096 #. type: Plain text
3097 #: build/C/man2/recv.2:113
3098 msgid ""
3099 "All three routines return the length of the message on successful "
3100 "completion.  If a message is too long to fit in the supplied buffer, excess "
3101 "bytes may be discarded depending on the type of socket the message is "
3102 "received from."
3103 msgstr ""
3104 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3105 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3106 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3107
3108 #. type: Plain text
3109 #: build/C/man2/recv.2:123
3110 msgid ""
3111 "If no messages are available at the socket, the receive calls wait for a "
3112 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3113 "which case the value -1 is returned and the external variable I<errno> is "
3114 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3115 "data available, up to the requested amount, rather than waiting for receipt "
3116 "of the full amount requested."
3117 msgstr ""
3118 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3119 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3120 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3121 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3122 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3123 "る (受信されるデータの最大サイズは要求したサイズである)。"
3124
3125 #. type: Plain text
3126 #: build/C/man2/recv.2:129
3127 msgid ""
3128 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3129 "data arrives."
3130 msgstr ""
3131 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3132 "る。"
3133
3134 #. type: Plain text
3135 #: build/C/man2/recv.2:135
3136 msgid ""
3137 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
3138 "the following values:"
3139 msgstr ""
3140 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3141 "和 を取ったものを指定する:"
3142
3143 #. type: TP
3144 #: build/C/man2/recv.2:135
3145 #, no-wrap
3146 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3147 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3148
3149 #. type: Plain text
3150 #: build/C/man2/recv.2:146
3151 msgid ""
3152 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3153 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3154 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3155 "flag of B<open>(2)."
3156 msgstr ""
3157 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3158 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3159 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3160 "同じ理由で有用である。"
3161
3162 #. type: TP
3163 #: build/C/man2/recv.2:146 build/C/man2/send.2:188
3164 #, no-wrap
3165 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3166 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3167
3168 #. type: Plain text
3169 #: build/C/man2/recv.2:156
3170 msgid ""
3171 "Enables nonblocking operation; if the operation would block, the call fails "
3172 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3173 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3174 msgstr ""
3175 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3176 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3177 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3178
3179 #. type: TP
3180 #: build/C/man2/recv.2:156
3181 #, no-wrap
3182 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3183 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3184
3185 #. type: Plain text
3186 #: build/C/man2/recv.2:175
3187 msgid ""
3188 "This flag specifies that queued errors should be received from the socket "
3189 "error queue.  The error is passed in an ancillary message with a type "
3190 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3191 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3192 "information.  The payload of the original packet that caused the error is "
3193 "passed as normal data via I<msg_iovec>.  The original destination address of "
3194 "the datagram that caused the error is supplied via I<msg_name>."
3195 msgstr ""
3196 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3197 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3198 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3199 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3200 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3201 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3202 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3203 "I<msg_name> 経由で参照できる。"
3204
3205 #. type: Plain text
3206 #: build/C/man2/recv.2:187 build/C/man2/recv.2:250
3207 msgid ""
3208 "For local errors, no address is passed (this can be checked with the "
3209 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3210 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3211 "the pending socket error is regenerated based on the next queued error and "
3212 "will be passed on the next socket operation."
3213 msgstr ""
3214 "ローカルなエラーの場合はアドレスは渡されない\n"
3215 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3216 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3217 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3218 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3219
3220 #. type: Plain text
3221 #: build/C/man2/recv.2:191
3222 msgid "The error is supplied in a I<sock_extended_err> structure:"
3223 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3224
3225 #. type: Plain text
3226 #: build/C/man2/recv.2:198
3227 #, no-wrap
3228 msgid ""
3229 "#define SO_EE_ORIGIN_NONE    0\n"
3230 "#define SO_EE_ORIGIN_LOCAL   1\n"
3231 "#define SO_EE_ORIGIN_ICMP    2\n"
3232 "#define SO_EE_ORIGIN_ICMP6   3\n"
3233 msgstr ""
3234 "#define SO_EE_ORIGIN_NONE    0\n"
3235 "#define SO_EE_ORIGIN_LOCAL   1\n"
3236 "#define SO_EE_ORIGIN_ICMP    2\n"
3237 "#define SO_EE_ORIGIN_ICMP6   3\n"
3238
3239 #. type: Plain text
3240 #: build/C/man2/recv.2:210
3241 #, no-wrap
3242 msgid ""
3243 "struct sock_extended_err\n"
3244 "{\n"
3245 "    uint32_t ee_errno;   /* error number */\n"
3246 "    uint8_t  ee_origin;  /* where the error originated */\n"
3247 "    uint8_t  ee_type;    /* type */\n"
3248 "    uint8_t  ee_code;    /* code */\n"
3249 "    uint8_t  ee_pad;     /* padding */\n"
3250 "    uint32_t ee_info;    /* additional information */\n"
3251 "    uint32_t ee_data;    /* other data */\n"
3252 "    /* More data may follow */\n"
3253 "};\n"
3254 msgstr ""
3255 "struct sock_extended_err\n"
3256 "{\n"
3257 "    uint32_t ee_errno;   /* error number */\n"
3258 "    uint8_t  ee_origin;  /* where the error originated */\n"
3259 "    uint8_t  ee_type;    /* type */\n"
3260 "    uint8_t  ee_code;    /* code */\n"
3261 "    uint8_t  ee_pad;     /* padding */\n"
3262 "    uint32_t ee_info;    /* additional information */\n"
3263 "    uint32_t ee_data;    /* other data */\n"
3264 "    /* More data may follow */\n"
3265 "};\n"
3266
3267 #. type: Plain text
3268 #: build/C/man2/recv.2:212
3269 #, no-wrap
3270 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3271 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3272
3273 #. type: Plain text
3274 #: build/C/man2/recv.2:236
3275 msgid ""
3276 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3277 "is the origin code of where the error originated.  The other fields are "
3278 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3279 "address of the network object where the error originated from given a "
3280 "pointer to the ancillary message.  If this address is not known, the "
3281 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3282 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3283 "caused the error is passed as normal data."
3284 msgstr ""
3285 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3286 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3287 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3288 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3289 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3290 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3291 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3292 "される。"
3293
3294 #. type: TP
3295 #: build/C/man2/recv.2:250 build/C/man2/recv.2:381 build/C/man2/send.2:230
3296 #, no-wrap
3297 msgid "B<MSG_OOB>"
3298 msgstr "B<MSG_OOB>"
3299
3300 #. type: Plain text
3301 #: build/C/man2/recv.2:257
3302 msgid ""
3303 "This flag requests receipt of out-of-band data that would not be received in "
3304 "the normal data stream.  Some protocols place expedited data at the head of "
3305 "the normal data queue, and thus this flag cannot be used with such protocols."
3306 msgstr ""
3307 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3308 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3309 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3310 "い。"
3311
3312 #. type: TP
3313 #: build/C/man2/recv.2:257
3314 #, no-wrap
3315 msgid "B<MSG_PEEK>"
3316 msgstr "B<MSG_PEEK>"
3317
3318 #. type: Plain text
3319 #: build/C/man2/recv.2:264
3320 msgid ""
3321 "This flag causes the receive operation to return data from the beginning of "
3322 "the receive queue without removing that data from the queue.  Thus, a "
3323 "subsequent receive call will return the same data."
3324 msgstr ""
3325 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3326 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3327 "が返ることになる。"
3328
3329 #. type: TP
3330 #: build/C/man2/recv.2:264
3331 #, no-wrap
3332 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3333 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3334
3335 #. type: Plain text
3336 #: build/C/man2/recv.2:275
3337 #, fuzzy
3338 #| msgid ""
3339 #| "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), and "
3340 #| "netlink (since Linux 2.6.22) sockets: return the real length of the "
3341 #| "packet or datagram, even when it was longer than the passed buffer.  Not "
3342 #| "implemented for UNIX domain (B<unix>(7))  sockets."
3343 msgid ""
3344 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3345 "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3346 "return the real length of the packet or datagram, even when it was longer "
3347 "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3348 "sockets."
3349 msgstr ""
3350 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3351 "以降)、 netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの"
3352 "長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長"
3353 "さを返す。 UNIX ドメインソケット (B<unix>(7))  ソケットについては実装されてい"
3354 "ない。"
3355
3356 #. type: Plain text
3357 #: build/C/man2/recv.2:278
3358 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3359 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3360
3361 #. type: TP
3362 #: build/C/man2/recv.2:278
3363 #, no-wrap
3364 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3365 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3366
3367 #. type: Plain text
3368 #: build/C/man2/recv.2:285
3369 msgid ""
3370 "This flag requests that the operation block until the full request is "
3371 "satisfied.  However, the call may still return less data than requested if a "
3372 "signal is caught, an error or disconnect occurs, or the next data to be "
3373 "received is of a different type than that returned."
3374 msgstr ""
3375 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3376 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3377 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3378 "りデータが少なくても返ることがある。"
3379
3380 #. type: Plain text
3381 #: build/C/man2/recv.2:293
3382 msgid ""
3383 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3384 "directly supplied arguments.  This structure is defined as follows in "
3385 "I<E<lt>sys/socket.hE<gt>>:"
3386 msgstr ""
3387 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3388 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3389
3390 #. type: Plain text
3391 #: build/C/man2/recv.2:300
3392 #, no-wrap
3393 msgid ""
3394 "struct iovec {                    /* Scatter/gather array items */\n"
3395 "    void  *iov_base;              /* Starting address */\n"
3396 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3397 "};\n"
3398 msgstr ""
3399 "struct iovec {                    /* Scatter/gather array items */\n"
3400 "    void  *iov_base;              /* Starting address */\n"
3401 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3402 "};\n"
3403
3404 #. type: Plain text
3405 #: build/C/man2/recv.2:310 build/C/man2/send.2:258
3406 #, no-wrap
3407 msgid ""
3408 "struct msghdr {\n"
3409 "    void         *msg_name;       /* optional address */\n"
3410 "    socklen_t     msg_namelen;    /* size of address */\n"
3411 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3412 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3413 "    void         *msg_control;    /* ancillary data, see below */\n"
3414 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3415 "    int           msg_flags;      /* flags on received message */\n"
3416 "};\n"
3417 msgstr ""
3418 "struct msghdr {\n"
3419 "    void         *msg_name;       /* 追加のアドレス */\n"
3420 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3421 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3422 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3423 "    void         *msg_control;    /* 補助データ (後述) */\n"
3424 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3425 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3426 "};\n"
3427
3428 #. type: Plain text
3429 #: build/C/man2/recv.2:340
3430 msgid ""
3431 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3432 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3433 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3434 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3435 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3436 "other protocol control-related messages or miscellaneous ancillary data.  "
3437 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3438 "the available buffer in I<msg_control>; upon return from a successful call "
3439 "it will contain the length of the control message sequence."
3440 msgstr ""
3441 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3442 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3443 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3444 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3445 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3446 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3447 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3448 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3449 "さが入っている。"
3450
3451 #. type: Plain text
3452 #: build/C/man2/recv.2:342
3453 msgid "The messages are of the form:"
3454 msgstr "メッセージの形式は以下の通り:"
3455
3456 #. type: Plain text
3457 #: build/C/man2/recv.2:352
3458 #, no-wrap
3459 msgid ""
3460 "struct cmsghdr {\n"
3461 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3462 "    int           cmsg_level;   /* originating protocol */\n"
3463 "    int           cmsg_type;    /* protocol-specific type */\n"
3464 "/* followed by\n"
3465 "    unsigned char cmsg_data[]; */\n"
3466 "};\n"
3467 msgstr ""
3468 "struct cmsghdr {\n"
3469 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3470 "    int           cmsg_level;   /* originating protocol */\n"
3471 "    int           cmsg_type;    /* protocol-specific type */\n"
3472 "/* followed by\n"
3473 "    unsigned char cmsg_data[]; */\n"
3474 "};\n"
3475
3476 #. type: Plain text
3477 #: build/C/man2/recv.2:357
3478 msgid ""
3479 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3480 msgstr ""
3481 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3482
3483 #. type: Plain text
3484 #: build/C/man2/recv.2:360
3485 msgid ""
3486 "As an example, Linux uses this ancillary data mechanism to pass extended "
3487 "errors, IP options, or file descriptors over UNIX domain sockets."
3488 msgstr ""
3489 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3490 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3491 "いる。"
3492
3493 #. type: Plain text
3494 #: build/C/man2/recv.2:368
3495 msgid ""
3496 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3497 "It can contain several flags:"
3498 msgstr ""
3499 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3500 "れる。ここにはいくつかのフラグが入る。"
3501
3502 #. type: TP
3503 #: build/C/man2/recv.2:368
3504 #, no-wrap
3505 msgid "B<MSG_EOR>"
3506 msgstr "B<MSG_EOR>"
3507
3508 #. type: Plain text
3509 #: build/C/man2/recv.2:373
3510 msgid ""
3511 "indicates end-of-record; the data returned completed a record (generally "
3512 "used with sockets of type B<SOCK_SEQPACKET>)."
3513 msgstr ""
3514 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3515 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3516
3517 #. type: TP
3518 #: build/C/man2/recv.2:373
3519 #, no-wrap
3520 msgid "B<MSG_TRUNC>"
3521 msgstr "B<MSG_TRUNC>"
3522
3523 #. type: Plain text
3524 #: build/C/man2/recv.2:377
3525 msgid ""
3526 "indicates that the trailing portion of a datagram was discarded because the "
3527 "datagram was larger than the buffer supplied."
3528 msgstr ""
3529 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3530 "た部分が捨てられたことを示す。"
3531
3532 #. type: TP
3533 #: build/C/man2/recv.2:377
3534 #, no-wrap
3535 msgid "B<MSG_CTRUNC>"
3536 msgstr "B<MSG_CTRUNC>"
3537
3538 #. type: Plain text
3539 #: build/C/man2/recv.2:381
3540 msgid ""
3541 "indicates that some control data were discarded due to lack of space in the "
3542 "buffer for ancillary data."
3543 msgstr ""
3544 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3545 "を示す。"
3546
3547 #. type: Plain text
3548 #: build/C/man2/recv.2:384
3549 msgid ""
3550 "is returned to indicate that expedited or out-of-band data were received."
3551 msgstr "速達データや帯域外データを受信したことを示す。"
3552
3553 #. type: TP
3554 #: build/C/man2/recv.2:384
3555 #, no-wrap
3556 msgid "B<MSG_ERRQUEUE>"
3557 msgstr "B<MSG_ERRQUEUE>"
3558
3559 #. type: Plain text
3560 #: build/C/man2/recv.2:388
3561 msgid ""
3562 "indicates that no data was received but an extended error from the socket "
3563 "error queue."
3564 msgstr ""
3565 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3566 "を示す。"
3567
3568 #. type: Plain text
3569 #: build/C/man2/recv.2:393
3570 msgid ""
3571 "These calls return the number of bytes received, or -1 if an error "
3572 "occurred.  The return value will be 0 when the peer has performed an orderly "
3573 "shutdown."
3574 msgstr ""
3575 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3576 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3577
3578 #. type: Plain text
3579 #: build/C/man2/recv.2:398
3580 msgid ""
3581 "These are some standard errors generated by the socket layer.  Additional "
3582 "errors may be generated and returned from the underlying protocol modules; "
3583 "see their manual pages."
3584 msgstr ""
3585 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3586 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3587 "ること。"
3588
3589 #.  Actually EAGAIN on Linux
3590 #. type: Plain text
3591 #: build/C/man2/recv.2:407
3592 msgid ""
3593 "The socket is marked nonblocking and the receive operation would block, or a "
3594 "receive timeout had been set and the timeout expired before data was "
3595 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3596 "and does not require these constants to have the same value, so a portable "
3597 "application should check for both possibilities."
3598 msgstr ""
3599 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3600 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3601 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3602 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3603 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3604
3605 #. type: Plain text
3606 #: build/C/man2/recv.2:412
3607 msgid "The argument I<sockfd> is an invalid descriptor."
3608 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3609
3610 #. type: Plain text
3611 #: build/C/man2/recv.2:416
3612 msgid ""
3613 "A remote host refused to allow the network connection (typically because it "
3614 "is not running the requested service)."
3615 msgstr ""
3616 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3617 "たサービスが起動されていないなどがある)。"
3618
3619 #. type: Plain text
3620 #: build/C/man2/recv.2:420
3621 msgid ""
3622 "The receive buffer pointer(s) point outside the process's address space."
3623 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3624
3625 #. type: Plain text
3626 #: build/C/man2/recv.2:425
3627 msgid ""
3628 "The receive was interrupted by delivery of a signal before any data were "
3629 "available; see B<signal>(7)."
3630 msgstr ""
3631 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3632
3633 #. type: Plain text
3634 #: build/C/man2/recv.2:429 build/C/man2/send.2:323
3635 msgid "Invalid argument passed."
3636 msgstr "不正な引き数が渡された。"
3637
3638 #. type: Plain text
3639 #: build/C/man2/recv.2:433
3640 msgid "Could not allocate memory for B<recvmsg>()."
3641 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3642
3643 #. type: TP
3644 #: build/C/man2/recv.2:433 build/C/man2/send.2:346
3645 #, no-wrap
3646 msgid "B<ENOTCONN>"
3647 msgstr "B<ENOTCONN>"
3648
3649 #. type: Plain text
3650 #: build/C/man2/recv.2:440
3651 msgid ""
3652 "The socket is associated with a connection-oriented protocol and has not "
3653 "been connected (see B<connect>(2)  and B<accept>(2))."
3654 msgstr ""
3655 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3656 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3657
3658 #. type: Plain text
3659 #: build/C/man2/recv.2:445
3660 msgid "The argument I<sockfd> does not refer to a socket."
3661 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3662
3663 #. type: Plain text
3664 #: build/C/man2/recv.2:448
3665 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3666 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3667
3668 #. type: Plain text
3669 #: build/C/man2/recv.2:455
3670 msgid ""
3671 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3672 "flags."
3673 msgstr ""
3674 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3675 "されている。"
3676
3677 #. type: Plain text
3678 #: build/C/man2/recv.2:471
3679 msgid ""
3680 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3681 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3682 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3683 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3684 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3685 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3686 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3687 msgstr ""
3688 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3689 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3690 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3691 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3692 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3693 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3694 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3695
3696 #.  glibc bug raised 12 Mar 2006
3697 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3698 #.  The problem is an underlying kernel issue: the size of the
3699 #.  __kernel_size_t type used to type this field varies
3700 #.  across architectures, but socklen_t is always 32 bits.
3701 #. type: Plain text
3702 #: build/C/man2/recv.2:485 build/C/man2/send.2:409
3703 msgid ""
3704 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3705 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3706 "I<size_t>."
3707 msgstr ""
3708 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3709 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3710 "ある。"
3711
3712 #. type: Plain text
3713 #: build/C/man2/recv.2:490
3714 #, fuzzy
3715 #| msgid ""
3716 #| "See B<recvmmsg(2)> for information about a Linux-specific system call "
3717 #| "that can be used to receive multiple datagrams in a single call."
3718 msgid ""
3719 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3720 "can be used to receive multiple datagrams in a single call."
3721 msgstr ""
3722 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3723 "固有の システムコールに関する情報が書かれている。"
3724
3725 #. type: Plain text
3726 #: build/C/man2/recv.2:495
3727 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3728 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3729
3730 #. type: Plain text
3731 #: build/C/man2/recv.2:506
3732 msgid ""
3733 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3734 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3735 msgstr ""
3736 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3737 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3738
3739 #. type: TH
3740 #: build/C/man2/recvmmsg.2:31
3741 #, no-wrap
3742 msgid "RECVMMSG"
3743 msgstr "RECVMMSG"
3744
3745 #. type: TH
3746 #: build/C/man2/recvmmsg.2:31
3747 #, fuzzy, no-wrap
3748 #| msgid "2012-02-27"
3749 msgid "2012-12-24"
3750 msgstr "2012-02-27"
3751
3752 #. type: Plain text
3753 #: build/C/man2/recvmmsg.2:34
3754 msgid "recvmmsg - receive multiple messages on a socket"
3755 msgstr ""
3756
3757 #. type: Plain text
3758 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3759 #, no-wrap
3760 msgid ""
3761 "B<#define _GNU_SOURCE>\n"
3762 "B<#include E<lt>sys/socket.hE<gt>>\n"
3763 msgstr ""
3764 "B<#define _GNU_SOURCE>\n"
3765 "B<#include E<lt>sys/socket.hE<gt>>\n"
3766
3767 #. type: Plain text
3768 #: build/C/man2/recvmmsg.2:41
3769 #, no-wrap
3770 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3771 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3772
3773 #. type: Plain text
3774 #: build/C/man2/recvmmsg.2:43
3775 #, no-wrap
3776 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3777 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3778
3779 #. type: Plain text
3780 #: build/C/man2/recvmmsg.2:55
3781 msgid ""
3782 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3783 "the caller to receive multiple messages from a socket using a single system "
3784 "call.  (This has performance benefits for some applications.)  A further "
3785 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3786 "operation."
3787 msgstr ""
3788
3789 #. type: Plain text
3790 #: build/C/man2/recvmmsg.2:59
3791 msgid ""
3792 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3793 "from."
3794 msgstr ""
3795
3796 #. type: Plain text
3797 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
3798 msgid ""
3799 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3800 "The size of this array is specified in I<vlen>."
3801 msgstr ""
3802
3803 #. type: Plain text
3804 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
3805 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3806 msgstr ""
3807
3808 #. type: Plain text
3809 #: build/C/man2/recvmmsg.2:80
3810 #, no-wrap
3811 msgid ""
3812 "struct mmsghdr {\n"
3813 "    struct msghdr msg_hdr;  /* Message header */\n"
3814 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3815 "};\n"
3816 msgstr ""
3817 "struct mmsghdr {\n"
3818 "    struct msghdr msg_hdr;  /* Message header */\n"
3819 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3820 "};\n"
3821
3822 #. type: Plain text
3823 #: build/C/man2/recvmmsg.2:95
3824 msgid ""
3825 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3826 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3827 "in the entry.  This field has the same value as the return value of a single "
3828 "B<recvmsg>(2)  on the header."
3829 msgstr ""
3830
3831 #. type: Plain text
3832 #: build/C/man2/recvmmsg.2:102
3833 msgid ""
3834 "The I<flags> argument contains flags ORed together.  The flags are the same "
3835 "as documented for B<recvmsg>(2), with the following addition:"
3836 msgstr ""
3837
3838 #. type: TP
3839 #: build/C/man2/recvmmsg.2:102
3840 #, fuzzy, no-wrap
3841 #| msgid "B<MSG_MORE> (Since Linux 2.4.4)"
3842 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
3843 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
3844
3845 #. type: Plain text
3846 #: build/C/man2/recvmmsg.2:107
3847 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3848 msgstr ""
3849
3850 #. type: Plain text
3851 #: build/C/man2/recvmmsg.2:123
3852 msgid ""
3853 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3854 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3855 "operation.  (This interval will be rounded up to the system clock "
3856 "granularity, and kernel scheduling delays mean that the blocking interval "
3857 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
3858 "blocks indefinitely."
3859 msgstr ""
3860
3861 #. type: Plain text
3862 #: build/C/man2/recvmmsg.2:134
3863 msgid ""
3864 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3865 "received or until the timeout expires.  A nonblocking call reads as many "
3866 "messages as are available (up to the limit specified by I<vlen>)  and "
3867 "returns immediately."
3868 msgstr ""
3869
3870 #. type: Plain text
3871 #: build/C/man2/recvmmsg.2:149
3872 msgid ""
3873 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3874 "to contain information about each received message: I<msg_len> contains the "
3875 "size of the received message; the subfields of I<msg_hdr> are updated as "
3876 "described in B<recvmsg>(2).  The return value of the call indicates the "
3877 "number of elements of I<msgvec> that have been updated."
3878 msgstr ""
3879
3880 #. type: Plain text
3881 #: build/C/man2/recvmmsg.2:157
3882 msgid ""
3883 "On success, B<recvmmsg>()  returns the number of messages received in "
3884 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3885 "error."
3886 msgstr ""
3887
3888 #. type: Plain text
3889 #: build/C/man2/recvmmsg.2:161
3890 msgid ""
3891 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3892 msgstr ""
3893
3894 #. type: Plain text
3895 #: build/C/man2/recvmmsg.2:165
3896 msgid "I<timeout> is invalid."
3897 msgstr ""
3898
3899 #. type: Plain text
3900 #: build/C/man2/recvmmsg.2:170
3901 #, fuzzy
3902 #| msgid ""
3903 #| "The B<accept4>()  system call is available starting with Linux 2.6.28; "
3904 #| "support in glibc is available starting with version 2.10."
3905 msgid ""
3906 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
3907 "was added in version 2.12."
3908 msgstr ""
3909 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
3910 "サポートはバージョン 2.10 以降で利用可能である。"
3911
3912 #. type: Plain text
3913 #: build/C/man2/recvmmsg.2:173
3914 msgid "B<recvmmsg>()  is Linux-specific."
3915 msgstr ""
3916
3917 #. type: Plain text
3918 #: build/C/man2/recvmmsg.2:181
3919 msgid ""
3920 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
3921 "socket and stores them in multiple buffers.  The call returns if all buffers "
3922 "are filled or if the timeout specified has expired."
3923 msgstr ""
3924
3925 #. type: Plain text
3926 #: build/C/man2/recvmmsg.2:184
3927 msgid ""
3928 "The following snippet periodically generates UDP datagrams containing a "
3929 "random number:"
3930 msgstr ""
3931
3932 #. type: Plain text
3933 #: build/C/man2/recvmmsg.2:189
3934 #, no-wrap
3935 msgid ""
3936 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
3937 "B<sleep 0.25; done>\n"
3938 msgstr ""
3939
3940 #. type: Plain text
3941 #: build/C/man2/recvmmsg.2:194
3942 msgid ""
3943 "These datagrams are read by the example application, which can give the "
3944 "following output:"
3945 msgstr ""
3946
3947 #. type: Plain text
3948 #: build/C/man2/recvmmsg.2:204
3949 #, no-wrap
3950 msgid ""
3951 "$B< ./a.out>\n"
3952 "5 messages received\n"
3953 "1 11782\n"
3954 "2 11345\n"
3955 "3 304\n"
3956 "4 13514\n"
3957 "5 28421\n"
3958 msgstr ""
3959
3960 #. type: Plain text
3961 #: build/C/man2/recvmmsg.2:215
3962 #, fuzzy, no-wrap
3963 #| msgid ""
3964 #| "#include E<lt>sys/socket.hE<gt>\n"
3965 #| "#include E<lt>sys/un.hE<gt>\n"
3966 #| "#include E<lt>stdlib.hE<gt>\n"
3967 #| "#include E<lt>stdio.hE<gt>\n"
3968 #| "#include E<lt>string.hE<gt>\n"
3969 msgid ""
3970 "#define _GNU_SOURCE\n"
3971 "#include E<lt>netinet/ip.hE<gt>\n"
3972 "#include E<lt>stdio.hE<gt>\n"
3973 "#include E<lt>stdlib.hE<gt>\n"
3974 "#include E<lt>string.hE<gt>\n"
3975 "#include E<lt>sys/socket.hE<gt>\n"
3976 msgstr ""
3977 "#include E<lt>sys/socket.hE<gt>\n"
3978 "#include E<lt>sys/un.hE<gt>\n"
3979 "#include E<lt>stdlib.hE<gt>\n"
3980 "#include E<lt>stdio.hE<gt>\n"
3981 "#include E<lt>string.hE<gt>\n"
3982
3983 #. type: Plain text
3984 #: build/C/man2/recvmmsg.2:228
3985 #, no-wrap
3986 msgid ""
3987 "int\n"
3988 "main(void)\n"
3989 "{\n"
3990 "#define VLEN 10\n"
3991 "#define BUFSIZE 200\n"
3992 "#define TIMEOUT 1\n"
3993 "    int sockfd, retval, i;\n"
3994 "    struct sockaddr_in sa;\n"
3995 "    struct mmsghdr msgs[VLEN];\n"
3996 "    struct iovec iovecs[VLEN];\n"
3997 "    char bufs[VLEN][BUFSIZE+1];\n"
3998 "    struct timespec timeout;\n"
3999 msgstr ""
4000
4001 #. type: Plain text
4002 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4003 #, fuzzy, no-wrap
4004 #| msgid ""
4005 #| "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
4006 #| "    if (sfd == -1)\n"
4007 #| "        handle_error(\"socket\");\n"
4008 msgid ""
4009 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4010 "    if (sockfd == -1) {\n"
4011 "        perror(\"socket()\");\n"
4012 "        exit(EXIT_FAILURE);\n"
4013 "    }\n"
4014 msgstr ""
4015 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
4016 "    if (sfd == -1)\n"
4017 "        handle_error(\"socket\");\n"
4018
4019 #. type: Plain text
4020 #: build/C/man2/recvmmsg.2:242
4021 #, fuzzy, no-wrap
4022 #| msgid ""
4023 #| "    sa.sa_flags = 0;\n"
4024 #| "    sa.sa_handler = child_sig_handler;\n"
4025 #| "    sigemptyset(&sa.sa_mask);\n"
4026 #| "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4027 #| "        perror(\"sigaction\");\n"
4028 #| "        exit(EXIT_FAILURE);\n"
4029 #| "    }\n"
4030 msgid ""
4031 "    sa.sin_family = AF_INET;\n"
4032 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4033 "    sa.sin_port = htons(1234);\n"
4034 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4035 "        perror(\"bind()\");\n"
4036 "        exit(EXIT_FAILURE);\n"
4037 "    }\n"
4038 msgstr ""
4039 "    sa.sa_flags = 0;\n"
4040 "    sa.sa_handler = child_sig_handler;\n"
4041 "    sigemptyset(&sa.sa_mask);\n"
4042 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4043 "        perror(\"sigaction\");\n"
4044 "        exit(EXIT_FAILURE);\n"
4045 "    }\n"
4046
4047 #. type: Plain text
4048 #: build/C/man2/recvmmsg.2:250
4049 #, no-wrap
4050 msgid ""
4051 "    memset(msgs, 0, sizeof(msgs));\n"
4052 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4053 "        iovecs[i].iov_base         = bufs[i];\n"
4054 "        iovecs[i].iov_len          = BUFSIZE;\n"
4055 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4056 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4057 "    }\n"
4058 msgstr ""
4059
4060 #. type: Plain text
4061 #: build/C/man2/recvmmsg.2:253
4062 #, fuzzy, no-wrap
4063 #| msgid ""
4064 #| "    /* Wait up to five seconds. */\n"
4065 #| "    tv.tv_sec = 5;\n"
4066 #| "    tv.tv_usec = 0;\n"
4067 msgid ""
4068 "    timeout.tv_sec = TIMEOUT;\n"
4069 "    timeout.tv_nsec = 0;\n"
4070 msgstr ""
4071 "    /* 5 秒間監視する。*/\n"
4072 "    tv.tv_sec = 5;\n"
4073 "    tv.tv_usec = 0;\n"
4074
4075 #. type: Plain text
4076 #: build/C/man2/recvmmsg.2:259
4077 #, fuzzy, no-wrap
4078 #| msgid ""
4079 #| "        if (r == -1) {\n"
4080 #| "            perror(\"select()\");\n"
4081 #| "            exit(EXIT_FAILURE);\n"
4082 #| "        }\n"
4083 msgid ""
4084 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4085 "    if (retval == -1) {\n"
4086 "        perror(\"recvmmsg()\");\n"
4087 "        exit(EXIT_FAILURE);\n"
4088 "    }\n"
4089 msgstr ""
4090 "        if (r == -1) {\n"
4091 "            perror(\"select()\");\n"
4092 "            exit(EXIT_FAILURE);\n"
4093 "        }\n"
4094
4095 #. type: Plain text
4096 #: build/C/man2/recvmmsg.2:267
4097 #, no-wrap
4098 msgid ""
4099 "    printf(\"%d messages received\\en\", retval);\n"
4100 "    for (i = 0; i E<lt> retval; i++) {\n"
4101 "        bufs[i][msgs[i].msg_len] = 0;\n"
4102 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4103 "    }\n"
4104 "    exit(EXIT_SUCCESS);\n"
4105 "}\n"
4106 msgstr ""
4107
4108 #. type: Plain text
4109 #: build/C/man2/recvmmsg.2:275
4110 msgid ""
4111 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4112 "(2), B<socket>(7)"
4113 msgstr ""
4114 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4115 "(2), B<socket>(7)"
4116
4117 #. type: TH
4118 #: build/C/man2/select.2:38
4119 #, no-wrap
4120 msgid "SELECT"
4121 msgstr "SELECT"
4122
4123 #. type: TH
4124 #: build/C/man2/select.2:38
4125 #, fuzzy, no-wrap
4126 #| msgid "2012-02-27"
4127 msgid "2012-08-17"
4128 msgstr "2012-02-27"
4129
4130 #. type: Plain text
4131 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4132 msgid ""
4133 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4134 "multiplexing"
4135 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4136
4137 #. type: Plain text
4138 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4139 #, no-wrap
4140 msgid "/* According to POSIX.1-2001 */\n"
4141 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4142
4143 #. type: Plain text
4144 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4145 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4146 #, no-wrap
4147 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4148 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4149
4150 #. type: Plain text
4151 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4152 #, no-wrap
4153 msgid "/* According to earlier standards */\n"
4154 msgstr "/* 以前の規格に従う場合 */\n"
4155
4156 #. type: Plain text
4157 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4158 #, no-wrap
4159 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4160 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4161
4162 #. type: Plain text
4163 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4164 #, no-wrap
4165 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4166 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4167
4168 #. type: Plain text
4169 #: build/C/man2/select.2:58
4170 #, no-wrap
4171 msgid ""
4172 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4173 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4174 msgstr ""
4175 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4176 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4177
4178 #. type: Plain text
4179 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4180 #, no-wrap
4181 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4182 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4183
4184 #. type: Plain text
4185 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4186 #, no-wrap
4187 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4188 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4189
4190 #. type: Plain text
4191 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4192 #, no-wrap
4193 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4194 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4195
4196 #. type: Plain text
4197 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4198 #, no-wrap
4199 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4200 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4201
4202 #. type: Plain text
4203 #: build/C/man2/select.2:72
4204 #, no-wrap
4205 msgid ""
4206 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4207 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4208 "B<            const sigset_t *>I<sigmask>B<);>\n"
4209 msgstr ""
4210 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4211 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4212 "B<            const sigset_t *>I<sigmask>B<);>\n"
4213
4214 #. type: Plain text
4215 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4216 #: build/C/man3/sockatmark.3:36
4217 msgid ""
4218 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4219 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4220
4221 #. type: Plain text
4222 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4223 msgid ""
4224 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4225 "600"
4226 msgstr ""
4227 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4228 "600"
4229
4230 #. type: Plain text
4231 #: build/C/man2/select.2:92
4232 msgid ""
4233 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4234 "descriptors, waiting until one or more of the file descriptors become \"ready"
4235 "\" for some class of I/O operation (e.g., input possible).  A file "
4236 "descriptor is considered ready if it is possible to perform the "
4237 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4238 msgstr ""
4239 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4240 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4241 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4242 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4243 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4244 "意味する。"
4245
4246 #. type: Plain text
4247 #: build/C/man2/select.2:98
4248 #, fuzzy
4249 #| msgid ""
4250 #| "The operation of B<select>()  and B<pselect>()  is identical, with three "
4251 #| "differences:"
4252 msgid ""
4253 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4254 "these three differences:"
4255 msgstr ""
4256 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4257
4258 #. type: TP
4259 #: build/C/man2/select.2:98
4260 #, no-wrap
4261 msgid "(i)"
4262 msgstr "(i)"
4263
4264 #. type: Plain text
4265 #: build/C/man2/select.2:108
4266 msgid ""
4267 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4268 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4269 "and nanoseconds)."
4270 msgstr ""
4271 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4272 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4273 "timespec> (秒・ナノ秒単位) を用いる。"
4274
4275 #. type: TP
4276 #: build/C/man2/select.2:108
4277 #, no-wrap
4278 msgid "(ii)"
4279 msgstr "(ii)"
4280
4281 #. type: Plain text
4282 #: build/C/man2/select.2:116
4283 msgid ""
4284 "B<select>()  may update the I<timeout> argument to indicate how much time "
4285 "was left.  B<pselect>()  does not change this argument."
4286 msgstr ""
4287 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4288 "B<pselect>()  はこの引き数を変更しない。"
4289
4290 #. type: TP
4291 #: build/C/man2/select.2:116
4292 #, no-wrap
4293 msgid "(iii)"
4294 msgstr "(iii)"
4295
4296 #. type: Plain text
4297 #: build/C/man2/select.2:125
4298 msgid ""
4299 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4300 "with NULL I<sigmask>."
4301 msgstr ""
4302 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4303 "指定した場合の B<pselect>()  と同じである。"
4304
4305 #. type: Plain text
4306 #: build/C/man2/select.2:143
4307 msgid ""
4308 "Three independent sets of file descriptors are watched.  Those listed in "
4309 "I<readfds> will be watched to see if characters become available for reading "
4310 "(more precisely, to see if a read will not block; in particular, a file "
4311 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4312 "watched to see if a write will not block, and those in I<exceptfds> will be "
4313 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4314 "which file descriptors actually changed status.  Each of the three file "
4315 "descriptor sets may be specified as NULL if no file descriptors are to be "
4316 "watched for the corresponding class of events."
4317 msgstr ""
4318 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4319 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4320 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4321 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4322 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4323 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4324 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4325 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4326 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4327 "指定することができる。"
4328
4329 #. type: Plain text
4330 #: build/C/man2/select.2:156
4331 msgid ""
4332 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4333 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4334 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4335 "part of the set; this is useful after B<select>()  returns."
4336 msgstr ""
4337 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4338 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4339 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4340 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4341 "る。"
4342
4343 #. type: Plain text
4344 #: build/C/man2/select.2:159
4345 msgid ""
4346 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4347 "plus 1."
4348 msgstr ""
4349 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4350 "のである。"
4351
4352 #. type: Plain text
4353 #: build/C/man2/select.2:179
4354 msgid ""
4355 "The I<timeout> argument specifies the minimum interval that B<select>()  "
4356 "should block waiting for a file descriptor to become ready.  (This interval "
4357 "will be rounded up to the system clock granularity, and kernel scheduling "
4358 "delays mean that the blocking interval may overrun by a small amount.)  If "
4359 "both fields of the I<timeval> structure are zero, then B<select>()  returns "
4360 "immediately.  (This is useful for polling.)  If I<timeout> is NULL (no "
4361 "timeout), B<select>()  can block indefinitely."
4362 msgstr ""
4363 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4364 "B<select>() が停止する最小の停止時間を指定する\n"
4365 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4366 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4367 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4368 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4369 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4370 "期限に停止 (block) する。"
4371
4372 #. type: Plain text
4373 #: build/C/man2/select.2:189
4374 msgid ""
4375 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4376 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4377 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4378 "restores the original signal mask."
4379 msgstr ""
4380 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4381 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4382 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4383 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4384
4385 #. type: Plain text
4386 #: build/C/man2/select.2:195
4387 msgid ""
4388 "Other than the difference in the precision of the I<timeout> argument, the "
4389 "following B<pselect>()  call:"
4390 msgstr ""
4391 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4392
4393 #. type: Plain text
4394 #: build/C/man2/select.2:199
4395 #, no-wrap
4396 msgid ""
4397 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4398 "                    timeout, &sigmask);\n"
4399 msgstr ""
4400 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4401 "                    timeout, &sigmask);\n"
4402
4403 #. type: Plain text
4404 #: build/C/man2/select.2:204
4405 msgid "is equivalent to I<atomically> executing the following calls:"
4406 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4407
4408 #. type: Plain text
4409 #: build/C/man2/select.2:207
4410 #, no-wrap
4411 msgid "    sigset_t origmask;\n"
4412 msgstr "    sigset_t origmask;\n"
4413
4414 #. type: Plain text
4415 #: build/C/man2/select.2:211
4416 #, fuzzy, no-wrap
4417 #| msgid ""
4418 #| "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
4419 #| "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4420 #| "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
4421 msgid ""
4422 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4423 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4424 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4425 msgstr ""
4426 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
4427 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4428 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
4429
4430 #. type: Plain text
4431 #: build/C/man2/select.2:232
4432 msgid ""
4433 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4434 "either a signal or for a file descriptor to become ready, then an atomic "
4435 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4436 "a global flag and returns.  Then a test of this global flag followed by a "
4437 "call of B<select>()  could hang indefinitely if the signal arrived just "
4438 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4439 "one to first block signals, handle the signals that have come in, then call "
4440 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4441 msgstr ""
4442 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4443 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4444 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4445 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4446 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4447 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4448 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4449 "で、前記の競合を避けることができる。)"
4450
4451 #. type: SS
4452 #: build/C/man2/select.2:232
4453 #, no-wrap
4454 msgid "The timeout"
4455 msgstr "タイムアウト"
4456
4457 #. type: Plain text
4458 #: build/C/man2/select.2:236
4459 msgid ""
4460 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4461 "like"
4462 msgstr ""
4463 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4464
4465 #. type: Plain text
4466 #: build/C/man2/select.2:243
4467 #, no-wrap
4468 msgid ""
4469 "struct timeval {\n"
4470 "    long    tv_sec;         /* seconds */\n"
4471 "    long    tv_usec;        /* microseconds */\n"
4472 "};\n"
4473 msgstr ""
4474 "struct timeval {\n"
4475 "    long    tv_sec;         /* 秒 */\n"
4476 "    long    tv_usec;        /* マイクロ秒 */\n"
4477 "};\n"
4478
4479 #. type: Plain text
4480 #: build/C/man2/select.2:247
4481 msgid "and"
4482 msgstr "や"
4483
4484 #. type: Plain text
4485 #: build/C/man2/select.2:254
4486 #, no-wrap
4487 msgid ""
4488 "struct timespec {\n"
4489 "    long    tv_sec;         /* seconds */\n"
4490 "    long    tv_nsec;        /* nanoseconds */\n"
4491 "};\n"
4492 msgstr ""
4493 "struct timespec {\n"
4494 "    long    tv_sec;         /* 秒 */\n"
4495 "    long    tv_nsec;        /* ナノ秒 */\n"
4496 "};\n"
4497
4498 #. type: Plain text
4499 #: build/C/man2/select.2:258
4500 msgid "(However, see below on the POSIX.1-2001 versions.)"
4501 msgstr ""
4502 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4503 "照)"
4504
4505 #. type: Plain text
4506 #: build/C/man2/select.2:266
4507 msgid ""
4508 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4509 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4510 "precision."
4511 msgstr ""
4512 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4513 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4514 "呼び出すという方法を使っているコードもある。"
4515
4516 #.  .PP - it is rumored that:
4517 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4518 #.  - it is certainly true that:
4519 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4520 #. type: Plain text
4521 #: build/C/man2/select.2:289
4522 msgid ""
4523 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4524 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4525 "either behavior.)  This causes problems both when Linux code which reads "
4526 "I<timeout> is ported to other operating systems, and when code is ported to "
4527 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4528 "without reinitializing it.  Consider I<timeout> to be undefined after "
4529 "B<select>()  returns."
4530 msgstr ""
4531 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4532 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4533 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4534 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4535 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4536 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4537 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4538 "ある。"
4539
4540 #. type: Plain text
4541 #: build/C/man2/select.2:306
4542 msgid ""
4543 "On success, B<select>()  and B<pselect>()  return the number of file "
4544 "descriptors contained in the three returned descriptor sets (that is, the "
4545 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4546 "which may be zero if the timeout expires before anything interesting "
4547 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4548 "sets and I<timeout> become undefined, so do not rely on their contents after "
4549 "an error."
4550 msgstr ""
4551 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4552 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4553 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4554 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4555 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4556 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4557
4558 #. type: Plain text
4559 #: build/C/man2/select.2:312
4560 msgid ""
4561 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4562 "descriptor that was already closed, or one on which an error has occurred.)"
4563 msgstr ""
4564 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4565 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4566 "タが指定された)。"
4567
4568 #. type: Plain text
4569 #: build/C/man2/select.2:316
4570 msgid "A signal was caught; see B<signal>(7)."
4571 msgstr "シグナルを受信した。"
4572
4573 #. type: Plain text
4574 #: build/C/man2/select.2:322
4575 msgid ""
4576 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4577 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4578
4579 #. type: Plain text
4580 #: build/C/man2/select.2:325
4581 msgid "unable to allocate memory for internal tables."
4582 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4583
4584 #. type: Plain text
4585 #: build/C/man2/select.2:331
4586 msgid ""
4587 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4588 "()  was emulated in glibc (but see BUGS)."
4589 msgstr ""
4590 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4591 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4592
4593 #. type: Plain text
4594 #: build/C/man2/select.2:342
4595 msgid ""
4596 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4597 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4598 "clones of the BSD socket layer (including System V variants).  However, note "
4599 "that the System V variant typically sets the timeout variable before exit, "
4600 "but the BSD variant does not."
4601 msgstr ""
4602 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4603 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4604 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4605 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4606 "ること。"
4607
4608 #. type: Plain text
4609 #: build/C/man2/select.2:346
4610 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4611 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4612
4613 #. type: Plain text
4614 #: build/C/man2/select.2:363
4615 msgid ""
4616 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4617 "with a value of I<fd> that is negative or is equal to or larger than "
4618 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4619 "I<fd> to be a valid file descriptor."
4620 msgstr ""
4621 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4622 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4623 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4624 "プタでなければならないと規定されている。"
4625
4626 #. type: Plain text
4627 #: build/C/man2/select.2:372
4628 msgid ""
4629 "Concerning the types involved, the classical situation is that the two "
4630 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4631 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4632 "situation is"
4633 msgstr ""
4634 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4635 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4636 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4637
4638 #. type: Plain text
4639 #: build/C/man2/select.2:379
4640 #, no-wrap
4641 msgid ""
4642 "struct timeval {\n"
4643 "    time_t         tv_sec;     /* seconds */\n"
4644 "    suseconds_t    tv_usec;    /* microseconds */\n"
4645 "};\n"
4646 msgstr ""
4647 "struct timeval {\n"
4648 "\t time_t         tv_sec;     /* 秒 */\n"
4649 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4650 "};\n"
4651
4652 #. type: Plain text
4653 #: build/C/man2/select.2:390
4654 msgid ""
4655 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4656 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4657 msgstr ""
4658 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4659 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4660
4661 #. type: Plain text
4662 #: build/C/man2/select.2:402
4663 msgid ""
4664 "Concerning prototypes, the classical situation is that one should include "
4665 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4666 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4667 msgstr ""
4668 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4669 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4670 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4671 "インクルードすればよい。"
4672
4673 #. type: Plain text
4674 #: build/C/man2/select.2:414
4675 msgid ""
4676 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4677 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4678 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4679 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4680 "requirements are as shown in the SYNOPSIS."
4681 msgstr ""
4682 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4683 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4684 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4685 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4686 "使用するには、「書式」に記載された要件を満たす必要がある。"
4687
4688 #. type: SS
4689 #: build/C/man2/select.2:414
4690 #, no-wrap
4691 msgid "Multithreaded applications"
4692 msgstr ""
4693
4694 #. type: Plain text
4695 #: build/C/man2/select.2:430
4696 msgid ""
4697 "If a file descriptor being monitored by B<select>()  is closed in another "
4698 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
4699 "unblocks and returns, with an indication that the file descriptor is ready "
4700 "(a subsequent I/O operation will likely fail with an error, unless another "
4701 "the file descriptor reopened between the time B<select>()  returned and the "
4702 "I/O operations was performed).  On Linux (and some other systems), closing "
4703 "the file descriptor in another thread has no effect on B<select>().  In "
4704 "summary, any application that relies on a particular behavior in this "
4705 "scenario must be considered buggy."
4706 msgstr ""
4707
4708 #. type: SS
4709 #: build/C/man2/select.2:430
4710 #, fuzzy, no-wrap
4711 #| msgid "Linux Notes"
4712 msgid "Linux notes"
4713 msgstr "Linux での注意"
4714
4715 #. type: Plain text
4716 #: build/C/man2/select.2:438
4717 #, fuzzy
4718 #| msgid ""
4719 #| "The B<pselect>()  interface described in this page is implemented by "
4720 #| "glibc.  The underlying Linux system call is named B<pselect6>().  This "
4721 #| "system call has somewhat different behavior from the gibc wrapper "
4722 #| "function."
4723 msgid ""
4724 "The B<pselect>()  interface described in this page is implemented by glibc.  "
4725 "The underlying Linux system call is named B<pselect6>().  This system call "
4726 "has somewhat different behavior from the glibc wrapper function."
4727 msgstr ""
4728 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4729 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
4730 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
4731 "関数とは少し違った動作をする。"
4732
4733 #. type: Plain text
4734 #: build/C/man2/select.2:453
4735 msgid ""
4736 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
4737 "However, the glibc wrapper function hides this behavior by using a local "
4738 "variable for the timeout argument that is passed to the system call.  Thus, "
4739 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
4740 "this is the behavior required by POSIX.1-2001."
4741 msgstr ""
4742 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
4743 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
4744 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
4745 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
4746 "これが POSIX.1-2001 が要求している動作である。"
4747
4748 #. type: Plain text
4749 #: build/C/man2/select.2:459
4750 #, fuzzy
4751 #| msgid ""
4752 #| "The final argument of the B<pselect6()> system call is not a I<sigset_t\\ "
4753 #| "*> pointer, but is instead a structure of the form:"
4754 msgid ""
4755 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
4756 "*> pointer, but is instead a structure of the form:"
4757 msgstr ""
4758 "B<pselect6>() システムコールの最後の引き数はI<sigset_t\\ *> 型の\n"
4759 "ポインタではなく、以下に示す構造体である。"
4760
4761 #. type: Plain text
4762 #: build/C/man2/select.2:467
4763 #, no-wrap
4764 msgid ""
4765 "struct {\n"
4766 "    const sigset_t *ss;     /* Pointer to signal set */\n"
4767 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
4768 "                               to by 'ss' */\n"
4769 "};\n"
4770 msgstr ""
4771 "struct {\n"
4772 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
4773 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
4774 "                               (バイト数) */\n"
4775 "};\n"
4776
4777 #. type: Plain text
4778 #: build/C/man2/select.2:474
4779 msgid ""
4780 "This allows the system call to obtain both a pointer to the signal set and "
4781 "its size, while allowing for the fact that most architectures support a "
4782 "maximum of 6 arguments to a system call."
4783 msgstr ""
4784 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
4785 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
4786 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
4787 "のサイズの両方を取得することができるのである。"
4788
4789 #. type: Plain text
4790 #: build/C/man2/select.2:480
4791 msgid ""
4792 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4793 "argument."
4794 msgstr ""
4795 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4796 "されていた。"
4797
4798 #. type: Plain text
4799 #: build/C/man2/select.2:493
4800 msgid ""
4801 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4802 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4803 "implementation remained vulnerable to the very race condition that B<pselect>"
4804 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4805 "B<pselect>()  system call on kernels where it is provided."
4806 msgstr ""
4807 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4808 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4809 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4810 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4811 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4812 "が使用される。"
4813
4814 #. type: Plain text
4815 #: build/C/man2/select.2:506
4816 msgid ""
4817 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4818 "trapping can be achieved using the self-pipe trick.  In this technique, a "
4819 "signal handler writes a byte to a pipe whose other end is monitored by "
4820 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
4821 "to a pipe that may be full or reading from a pipe that may be empty, "
4822 "nonblocking I/O is used when reading from and writing to the pipe.)"
4823 msgstr ""
4824 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
4825 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
4826 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
4827 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
4828 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
4829 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
4830 "(nonblocking) I/O を使用するとよい)。"
4831
4832 #.  Stevens discusses a case where accept can block after select
4833 #.  returns successfully because of an intervening RST from the client.
4834 #.  Maybe the kernel should have returned EIO in such a situation?
4835 #. type: Plain text
4836 #: build/C/man2/select.2:522
4837 msgid ""
4838 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4839 "reading\", while nevertheless a subsequent read blocks.  This could for "
4840 "example happen when data has arrived but upon examination has wrong checksum "
4841 "and is discarded.  There may be other circumstances in which a file "
4842 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4843 "B<O_NONBLOCK> on sockets that should not block."
4844 msgstr ""
4845 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4846 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4847 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4848 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4849 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4850 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4851
4852 #. type: Plain text
4853 #: build/C/man2/select.2:537
4854 msgid ""
4855 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4856 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4857 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4858 "behavior, but the glibc wrapper hides this behavior by internally copying "
4859 "the I<timeout> to a local variable and passing that variable to the system "
4860 "call."
4861 msgstr ""
4862 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4863 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4864 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4865 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4866 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4867 "数をシステムコールに渡している。"
4868
4869 #. type: Plain text
4870 #: build/C/man2/select.2:544
4871 #, no-wrap
4872 msgid ""
4873 "#include E<lt>stdio.hE<gt>\n"
4874 "#include E<lt>stdlib.hE<gt>\n"
4875 "#include E<lt>sys/time.hE<gt>\n"
4876 "#include E<lt>sys/types.hE<gt>\n"
4877 "#include E<lt>unistd.hE<gt>\n"
4878 msgstr ""
4879 "#include E<lt>stdio.hE<gt>\n"
4880 "#include E<lt>stdlib.hE<gt>\n"
4881 "#include E<lt>sys/time.hE<gt>\n"
4882 "#include E<lt>sys/types.hE<gt>\n"
4883 "#include E<lt>unistd.hE<gt>\n"
4884
4885 #. type: Plain text
4886 #: build/C/man2/select.2:551
4887 #, no-wrap
4888 msgid ""
4889 "int\n"
4890 "main(void)\n"
4891 "{\n"
4892 "    fd_set rfds;\n"
4893 "    struct timeval tv;\n"
4894 "    int retval;\n"
4895 msgstr ""
4896 "int\n"
4897 "main(void)\n"
4898 "{\n"
4899 "    fd_set rfds;\n"
4900 "    struct timeval tv;\n"
4901 "    int retval;\n"
4902
4903 #. type: Plain text
4904 #: build/C/man2/select.2:555
4905 #, no-wrap
4906 msgid ""
4907 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4908 "    FD_ZERO(&rfds);\n"
4909 "    FD_SET(0, &rfds);\n"
4910 msgstr ""
4911 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4912 "    FD_ZERO(&rfds);\n"
4913 "    FD_SET(0, &rfds);\n"
4914
4915 #. type: Plain text
4916 #: build/C/man2/select.2:559
4917 #, no-wrap
4918 msgid ""
4919 "    /* Wait up to five seconds. */\n"
4920 "    tv.tv_sec = 5;\n"
4921 "    tv.tv_usec = 0;\n"
4922 msgstr ""
4923 "    /* 5 秒間監視する。*/\n"
4924 "    tv.tv_sec = 5;\n"
4925 "    tv.tv_usec = 0;\n"
4926
4927 #. type: Plain text
4928 #: build/C/man2/select.2:562
4929 #, no-wrap
4930 msgid ""
4931 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4932 "    /* Don't rely on the value of tv now! */\n"
4933 msgstr ""
4934 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4935 "    /* この時点での tv の値を信頼してはならない。*/\n"
4936
4937 #. type: Plain text
4938 #: build/C/man2/select.2:570
4939 #, no-wrap
4940 msgid ""
4941 "    if (retval == -1)\n"
4942 "        perror(\"select()\");\n"
4943 "    else if (retval)\n"
4944 "        printf(\"Data is available now.\\en\");\n"
4945 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4946 "    else\n"
4947 "        printf(\"No data within five seconds.\\en\");\n"
4948 msgstr ""
4949 "    if (retval == -1)\n"
4950 "\tperror(\"select()\");\n"
4951 "    else if (retval)\n"
4952 "        printf(\"今、データが取得できました。\\en\");\n"
4953 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4954 "    else\n"
4955 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4956
4957 #. type: Plain text
4958 #: build/C/man2/select.2:585
4959 #, fuzzy
4960 #| msgid ""
4961 #| "For vaguely related stuff, see B<accept>(2), B<connect>(2), B<poll>(2), "
4962 #| "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
4963 #| "B<epoll>(7), B<time>(7)"
4964 msgid ""
4965 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
4966 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
4967 msgstr ""
4968 "関係がありそうなものを挙げておく: B<accept>(2), B<connect>(2), B<poll>(2), "
4969 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4970 "(7), B<time>(7)"
4971
4972 #. type: Plain text
4973 #: build/C/man2/select.2:588
4974 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4975 msgstr ""
4976 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
4977
4978 #. type: TH
4979 #: build/C/man2/select_tut.2:32
4980 #, no-wrap
4981 msgid "SELECT_TUT"
4982 msgstr "SELECT_TUT"
4983
4984 #. type: TH
4985 #: build/C/man2/select_tut.2:32
4986 #, fuzzy, no-wrap
4987 #| msgid "2012-05-02"
4988 msgid "2012-08-03"
4989 msgstr "2012-05-02"
4990
4991 #. type: Plain text
4992 #: build/C/man2/select_tut.2:52
4993 #, no-wrap
4994 msgid ""
4995 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4996 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4997 msgstr ""
4998 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4999 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5000
5001 #. type: Plain text
5002 #: build/C/man2/select_tut.2:66
5003 #, no-wrap
5004 msgid ""
5005 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5006 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5007 "B<            const sigset_t *>I<sigmask>B<);>\n"
5008 msgstr ""
5009 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5010 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5011 "B<            const sigset_t *>I<sigmask>B<);>\n"
5012
5013 #. type: Plain text
5014 #: build/C/man2/select_tut.2:83
5015 msgid ""
5016 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5017 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5018 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5019 "occurred on any of the descriptors."
5020 msgstr ""
5021 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5022 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5023 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5024 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5025 "る。"
5026
5027 #. type: Plain text
5028 #: build/C/man2/select_tut.2:108
5029 msgid ""
5030 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5031 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5032 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5033 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5034 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5035 "according to the rules described below; after calling B<select>()  you can "
5036 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5037 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5038 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5039 "descriptor from a set."
5040 msgstr ""
5041 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5042 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5043 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5044 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5045 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5046 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5047 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5048 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5049 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5050 "のファイルディスクリプタの削除を行う。"
5051
5052 #. type: SS
5053 #: build/C/man2/select_tut.2:108
5054 #, no-wrap
5055 msgid "Arguments"
5056 msgstr "引き数"
5057
5058 #. type: TP
5059 #: build/C/man2/select_tut.2:109
5060 #, no-wrap
5061 msgid "I<readfds>"
5062 msgstr "I<readfds>"
5063
5064 #. type: Plain text
5065 #: build/C/man2/select_tut.2:118
5066 msgid ""
5067 "This set is watched to see if data is available for reading from any of its "
5068 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5069 "cleared of all file descriptors except for those that are immediately "
5070 "available for reading."
5071 msgstr ""
5072 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5073 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5074 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5075
5076 #. type: TP
5077 #: build/C/man2/select_tut.2:118
5078 #, no-wrap
5079 msgid "I<writefds>"
5080 msgstr "I<writefds>"
5081
5082 #. type: Plain text
5083 #: build/C/man2/select_tut.2:127
5084 msgid ""
5085 "This set is watched to see if there is space to write data to any of its "
5086 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5087 "cleared of all file descriptors except for those that are immediately "
5088 "available for writing."
5089 msgstr ""
5090 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5091 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5092 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5093
5094 #. type: TP
5095 #: build/C/man2/select_tut.2:127
5096 #, no-wrap
5097 msgid "I<exceptfds>"
5098 msgstr "I<exceptfds>"
5099
5100 #. type: Plain text
5101 #: build/C/man2/select_tut.2:149
5102 msgid ""
5103 "This set is watched for \"exceptional conditions\".  In practice, only one "
5104 "such exceptional condition is common: the availability of I<out-of-band> "
5105 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5106 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5107 "where B<select>(2)  indicates an exceptional condition occurs with "
5108 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5109 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5110 "for those for which an exceptional condition has occurred."
5111 msgstr ""
5112 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5113 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5114 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5115 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5116 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5117 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5118 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5119 "状態が発生したディスクリプタ以外は集合から削除される。"
5120
5121 #. type: TP
5122 #: build/C/man2/select_tut.2:149
5123 #, no-wrap
5124 msgid "I<nfds>"
5125 msgstr "I<nfds>"
5126
5127 #. type: Plain text
5128 #: build/C/man2/select_tut.2:156
5129 msgid ""
5130 "This is an integer one more than the maximum of any file descriptor in any "
5131 "of the sets.  In other words, while adding file descriptors to each of the "
5132 "sets, you must calculate the maximum integer value of all of them, then "
5133 "increment this value by one, and then pass this as I<nfds>."
5134 msgstr ""
5135 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5136 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5137 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5138 "I<nfds> として渡さないといけない、ということだ。"
5139
5140 #. type: TP
5141 #: build/C/man2/select_tut.2:156
5142 #, no-wrap
5143 msgid "I<utimeout>"
5144 msgstr "I<utimeout>"
5145
5146 #. type: Plain text
5147 #: build/C/man2/select_tut.2:169
5148 msgid ""
5149 "This is the longest time B<select>()  may wait before returning, even if "
5150 "nothing interesting happened.  If this value is passed as NULL, then "
5151 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5152 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5153 "return immediately, with information about the readiness of file descriptors "
5154 "at the time of the call.  The structure I<struct timeval> is defined as:"
5155 msgstr ""
5156 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5157 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5158 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5159 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5160 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5161 "ように定義されている:"
5162
5163 #. type: Plain text
5164 #: build/C/man2/select_tut.2:176
5165 #, no-wrap
5166 msgid ""
5167 "struct timeval {\n"
5168 "    time_t tv_sec;    /* seconds */\n"
5169 "    long tv_usec;     /* microseconds */\n"
5170 "};\n"
5171 msgstr ""
5172 "struct timeval {\n"
5173 "    time_t tv_sec;    /* seconds */\n"
5174 "    long tv_usec;     /* microseconds */\n"
5175 "};\n"
5176
5177 #. type: TP
5178 #: build/C/man2/select_tut.2:178
5179 #, no-wrap
5180 msgid "I<ntimeout>"
5181 msgstr "I<ntimeout>"
5182
5183 #. type: Plain text
5184 #: build/C/man2/select_tut.2:187
5185 msgid ""
5186 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5187 "I<struct timespec> has nanosecond precision as follows:"
5188 msgstr ""
5189 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5190 "timespec> は次に示すようにナノ秒の精度を持つ。"
5191
5192 #. type: Plain text
5193 #: build/C/man2/select_tut.2:194
5194 #, no-wrap
5195 msgid ""
5196 "struct timespec {\n"
5197 "    long tv_sec;    /* seconds */\n"
5198 "    long tv_nsec;   /* nanoseconds */\n"
5199 "};\n"
5200 msgstr ""
5201 "struct timespec {\n"
5202 "    long tv_sec;    /* seconds */\n"
5203 "    long tv_nsec;   /* nanoseconds */\n"
5204 "};\n"
5205
5206 #. type: TP
5207 #: build/C/man2/select_tut.2:196
5208 #, no-wrap
5209 msgid "I<sigmask>"
5210 msgstr "I<sigmask>"
5211
5212 #. type: Plain text
5213 #: build/C/man2/select_tut.2:213
5214 msgid ""
5215 "This argument holds a set of signals that the kernel should unblock (i.e., "
5216 "remove from the signal mask of the calling thread), while the caller is "
5217 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5218 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5219 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5220 "()  will then behave just like B<select>()."
5221 msgstr ""
5222 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5223 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5224 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5225 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5226 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5227 "()  と全く同じ動作となる。"
5228
5229 #. type: SS
5230 #: build/C/man2/select_tut.2:213
5231 #, fuzzy, no-wrap
5232 #| msgid "Combining Signal and Data Events"
5233 msgid "Combining signal and data events"
5234 msgstr "シグナルとデータイベントを組み合わせる"
5235
5236 #. type: Plain text
5237 #: build/C/man2/select_tut.2:257
5238 msgid ""
5239 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5240 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5241 "normally use the signal handler only to raise a global flag.  The global "
5242 "flag will indicate that the event must be processed in the main loop of the "
5243 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5244 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5245 "signals can be processed in the main loop of the program, otherwise B<select>"
5246 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5247 "conditional to check the global flag.  So we must ask: what if a signal "
5248 "arrives after the conditional, but before the B<select>()  call? The answer "
5249 "is that B<select>()  would block indefinitely, even though an event is "
5250 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5251 "This call can be used to set the signal mask to a set of signals that are "
5252 "only to be received within the B<pselect>()  call.  For instance, let us say "
5253 "that the event in question was the exit of a child process.  Before the "
5254 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5255 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5256 "mask.  Our program would look like:"
5257 msgstr ""
5258 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5259 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5260 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5261 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5262 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5263 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5264 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5265 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5266 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5267 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5268 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5269 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5270 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5271 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5272 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5273 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5274 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5275 "る。"
5276
5277 #. type: Plain text
5278 #: build/C/man2/select_tut.2:260
5279 #, no-wrap
5280 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5281 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5282
5283 #. type: Plain text
5284 #: build/C/man2/select_tut.2:266
5285 #, no-wrap
5286 msgid ""
5287 "static void\n"
5288 "child_sig_handler(int sig)\n"
5289 "{\n"
5290 "    got_SIGCHLD = 1;\n"
5291 "}\n"
5292 msgstr ""
5293 "static void\n"
5294 "child_sig_handler(int sig)\n"
5295 "{\n"
5296 "    got_SIGCHLD = 1;\n"
5297 "}\n"
5298
5299 #. type: Plain text
5300 #: build/C/man2/select_tut.2:274
5301 #, no-wrap
5302 msgid ""
5303 "int\n"
5304 "main(int argc, char *argv[])\n"
5305 "{\n"
5306 "    sigset_t sigmask, empty_mask;\n"
5307 "    struct sigaction sa;\n"
5308 "    fd_set readfds, writefds, exceptfds;\n"
5309 "    int r;\n"
5310 msgstr ""
5311 "int\n"
5312 "main(int argc, char *argv[])\n"
5313 "{\n"
5314 "    sigset_t sigmask, empty_mask;\n"
5315 "    struct sigaction sa;\n"
5316 "    fd_set readfds, writefds, exceptfds;\n"
5317 "    int r;\n"
5318
5319 #. type: Plain text
5320 #: build/C/man2/select_tut.2:281
5321 #, no-wrap
5322 msgid ""
5323 "    sigemptyset(&sigmask);\n"
5324 "    sigaddset(&sigmask, SIGCHLD);\n"
5325 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5326 "        perror(\"sigprocmask\");\n"
5327 "        exit(EXIT_FAILURE);\n"
5328 "    }\n"
5329 msgstr ""
5330 "    sigemptyset(&sigmask);\n"
5331 "    sigaddset(&sigmask, SIGCHLD);\n"
5332 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5333 "        perror(\"sigprocmask\");\n"
5334 "        exit(EXIT_FAILURE);\n"
5335 "    }\n"
5336
5337 #. type: Plain text
5338 #: build/C/man2/select_tut.2:289
5339 #, no-wrap
5340 msgid ""
5341 "    sa.sa_flags = 0;\n"
5342 "    sa.sa_handler = child_sig_handler;\n"
5343 "    sigemptyset(&sa.sa_mask);\n"
5344 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5345 "        perror(\"sigaction\");\n"
5346 "        exit(EXIT_FAILURE);\n"
5347 "    }\n"
5348 msgstr ""
5349 "    sa.sa_flags = 0;\n"
5350 "    sa.sa_handler = child_sig_handler;\n"
5351 "    sigemptyset(&sa.sa_mask);\n"
5352 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5353 "        perror(\"sigaction\");\n"
5354 "        exit(EXIT_FAILURE);\n"
5355 "    }\n"
5356
5357 #. type: Plain text
5358 #: build/C/man2/select_tut.2:291
5359 #, no-wrap
5360 msgid "    sigemptyset(&empty_mask);\n"
5361 msgstr "    sigemptyset(&empty_mask);\n"
5362
5363 #. type: Plain text
5364 #: build/C/man2/select_tut.2:295
5365 #, no-wrap
5366 msgid ""
5367 "    for (;;) {          /* main loop */\n"
5368 "        /* Initialize readfds, writefds, and exceptfds\n"
5369 "           before the pselect() call. (Code omitted.) */\n"
5370 msgstr ""
5371 "    for (;;) {          /* main loop */\n"
5372 "        /* Initialize readfds, writefds, and exceptfds\n"
5373 "           before the pselect() call. (Code omitted.) */\n"
5374
5375 #. type: Plain text
5376 #: build/C/man2/select_tut.2:301
5377 #, no-wrap
5378 msgid ""
5379 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5380 "                    NULL, &empty_mask);\n"
5381 "        if (r == -1 && errno != EINTR) {\n"
5382 "            /* Handle error */\n"
5383 "        }\n"
5384 msgstr ""
5385 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5386 "                    NULL, &empty_mask);\n"
5387 "        if (r == -1 && errno != EINTR) {\n"
5388 "            /* Handle error */\n"
5389 "        }\n"
5390
5391 #. type: Plain text
5392 #: build/C/man2/select_tut.2:304
5393 #, no-wrap
5394 msgid ""
5395 "        if (got_SIGCHLD) {\n"
5396 "            got_SIGCHLD = 0;\n"
5397 msgstr ""
5398 "        if (got_SIGCHLD) {\n"
5399 "            got_SIGCHLD = 0;\n"
5400
5401 #. type: Plain text
5402 #: build/C/man2/select_tut.2:308
5403 #, no-wrap
5404 msgid ""
5405 "            /* Handle signalled event here; e.g., wait() for all\n"
5406 "               terminated children. (Code omitted.) */\n"
5407 "        }\n"
5408 msgstr ""
5409 "            /* Handle signalled event here; e.g., wait() for all\n"
5410 "               terminated children. (Code omitted.) */\n"
5411 "        }\n"
5412
5413 #. type: Plain text
5414 #: build/C/man2/select_tut.2:312
5415 #, no-wrap
5416 msgid ""
5417 "        /* main body of program */\n"
5418 "    }\n"
5419 "}\n"
5420 msgstr ""
5421 "        /* main body of program */\n"
5422 "    }\n"
5423 "}\n"
5424
5425 #. type: SS
5426 #: build/C/man2/select_tut.2:313
5427 #, no-wrap
5428 msgid "Practical"
5429 msgstr "実例"
5430
5431 #. type: Plain text
5432 #: build/C/man2/select_tut.2:334
5433 msgid ""
5434 "So what is the point of B<select>()? Can't I just read and write to my "
5435 "descriptors whenever I want? The point of B<select>()  is that it watches "
5436 "multiple descriptors at the same time and properly puts the process to sleep "
5437 "if there is no activity.  UNIX programmers often find themselves in a "
5438 "position where they have to handle I/O from more than one file descriptor "
5439 "where the data flow may be intermittent.  If you were to merely create a "
5440 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5441 "your calls may block waiting for data from/to a file descriptor, while "
5442 "another file descriptor is unused though ready for I/O.  B<select>()  "
5443 "efficiently copes with this situation."
5444 msgstr ""
5445 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5446 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5447 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5448 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5449 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5450 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5451 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5452 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5453 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5454
5455 #. type: SS
5456 #: build/C/man2/select_tut.2:334
5457 #, fuzzy, no-wrap
5458 #| msgid "Select Law"
5459 msgid "Select law"
5460 msgstr "SELECT の掟"
5461
5462 #. type: Plain text
5463 #: build/C/man2/select_tut.2:347
5464 msgid ""
5465 "Many people who try to use B<select>()  come across behavior that is "
5466 "difficult to understand and produces nonportable or borderline results.  For "
5467 "instance, the above program is carefully written not to block at any point, "
5468 "even though it does not set its file descriptors to nonblocking mode.  It is "
5469 "easy to introduce subtle errors that will remove the advantage of using "
5470 "B<select>(), so here is a list of essentials to watch for when using "
5471 "B<select>()."
5472 msgstr ""
5473 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5474 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5475 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5476 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5477 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5478 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5479 "ことにする。"
5480
5481 #. type: Plain text
5482 #: build/C/man2/select_tut.2:356
5483 msgid ""
5484 "You should always try to use B<select>()  without a timeout.  Your program "
5485 "should have nothing to do if there is no data available.  Code that depends "
5486 "on timeouts is not usually portable and is difficult to debug."
5487 msgstr ""
5488 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5489 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5490 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5491
5492 #. type: Plain text
5493 #: build/C/man2/select_tut.2:360
5494 msgid ""
5495 "The value I<nfds> must be properly calculated for efficiency as explained "
5496 "above."
5497 msgstr ""
5498 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5499 "えなければならない。"
5500
5501 #. type: Plain text
5502 #: build/C/man2/select_tut.2:367
5503 msgid ""
5504 "No file descriptor must be added to any set if you do not intend to check "
5505 "its result after the B<select>()  call, and respond appropriately.  See next "
5506 "rule."
5507 msgstr ""
5508 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5509 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5510
5511 #. type: Plain text
5512 #: build/C/man2/select_tut.2:373
5513 msgid ""
5514 "After B<select>()  returns, all file descriptors in all sets should be "
5515 "checked to see if they are ready."
5516 msgstr ""
5517 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5518 "て 読み書き可能な状態になっているかをチェックすべきである。"
5519
5520 #. type: TP
5521 #: build/C/man2/select_tut.2:373
5522 #, no-wrap
5523 msgid "5."
5524 msgstr "5."
5525
5526 #. type: Plain text
5527 #: build/C/man2/select_tut.2:388
5528 msgid ""
5529 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5530 "necessarily read/write the full amount of data that you have requested.  If "
5531 "they do read/write the full amount, it's because you have a low traffic load "
5532 "and a fast stream.  This is not always going to be the case.  You should "
5533 "cope with the case of your functions only managing to send or receive a "
5534 "single byte."
5535 msgstr ""
5536 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5537 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5538 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5539 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5540 "うな場合も 考慮に入れてやらなければならない。"
5541
5542 #. type: TP
5543 #: build/C/man2/select_tut.2:388
5544 #, no-wrap
5545 msgid "6."
5546 msgstr "6."
5547
5548 #. type: Plain text
5549 #: build/C/man2/select_tut.2:396
5550 msgid ""
5551 "Never read/write only in single bytes at a time unless you are really sure "
5552 "that you have a small amount of data to process.  It is extremely "
5553 "inefficient not to read/write as much data as you can buffer each time.  The "
5554 "buffers in the example below are 1024 bytes although they could easily be "
5555 "made larger."
5556 msgstr ""
5557 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5558 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5559 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5560 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5561
5562 #. type: TP
5563 #: build/C/man2/select_tut.2:396
5564 #, no-wrap
5565 msgid "7."
5566 msgstr "7."
5567
5568 #.  Nonetheless, you should still cope with these errors for completeness.
5569 #. type: Plain text
5570 #: build/C/man2/select_tut.2:418
5571 msgid ""
5572 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5573 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5574 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5575 "properly managed (not done properly above).  If your program is not going to "
5576 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5577 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5578 msgstr ""
5579 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5580 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5581 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5582 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5583 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5584 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5585
5586 #. type: TP
5587 #: build/C/man2/select_tut.2:418
5588 #, no-wrap
5589 msgid "8."
5590 msgstr "8."
5591
5592 #. type: Plain text
5593 #: build/C/man2/select_tut.2:427
5594 msgid ""
5595 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5596 "length of zero."
5597 msgstr ""
5598 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5599 "(2), B<send>(2)  を呼び出してはならない。"
5600
5601 #. type: TP
5602 #: build/C/man2/select_tut.2:427
5603 #, no-wrap
5604 msgid "9."
5605 msgstr "9."
5606
5607 #. type: Plain text
5608 #: build/C/man2/select_tut.2:443
5609 msgid ""
5610 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5611 "with errors other than those listed in B<7.>, or one of the input functions "
5612 "returns 0, indicating end of file, then you should I<not> pass that "
5613 "descriptor to B<select>()  again.  In the example below, I close the "
5614 "descriptor immediately, and then set it to -1 to prevent it being included "
5615 "in a set."
5616 msgstr ""
5617 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5618 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5619 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5620 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5621 "が集合に含まれ続けるのを許さないようにしている。"
5622
5623 #. type: TP
5624 #: build/C/man2/select_tut.2:443
5625 #, no-wrap
5626 msgid "10."
5627 msgstr "10."
5628
5629 #. type: Plain text
5630 #: build/C/man2/select_tut.2:450
5631 msgid ""
5632 "The timeout value must be initialized with each new call to B<select>(), "
5633 "since some operating systems modify the structure.  B<pselect>()  however "
5634 "does not modify its timeout structure."
5635 msgstr ""
5636 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5637 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5638 "分の timeout 構造体を変更することはない。"
5639
5640 #. type: TP
5641 #: build/C/man2/select_tut.2:450
5642 #, no-wrap
5643 msgid "11."
5644 msgstr "11."
5645
5646 #.  "I have heard" does not fill me with confidence, and doesn't
5647 #.  belong in a man page, so I've commented this point out.
5648 #.  .TP
5649 #.  11.
5650 #.  I have heard that the Windows socket layer does not cope with OOB data
5651 #.  properly.
5652 #.  It also does not cope with
5653 #.  .BR select ()
5654 #.  calls when no file descriptors are set at all.
5655 #.  Having no file descriptors set is a useful
5656 #.  way to sleep the process with subsecond precision by using the timeout.
5657 #.  (See further on.)
5658 #. type: Plain text
5659 #: build/C/man2/select_tut.2:469
5660 msgid ""
5661 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5662 "used in a loop, then the sets must be reinitialized before each call."
5663 msgstr ""
5664 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5665 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5666 "期化し直さなければならない。"
5667
5668 #. type: SS
5669 #: build/C/man2/select_tut.2:469
5670 #, fuzzy, no-wrap
5671 #| msgid "Usleep Emulation"
5672 msgid "Usleep emulation"
5673 msgstr "usleep エミュレーション"
5674
5675 #. type: Plain text
5676 #: build/C/man2/select_tut.2:476
5677 msgid ""
5678 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5679 "()  with a finite timeout and no file descriptors as follows:"
5680 msgstr ""
5681 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5682 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5683 "できる。 以下のようにする。"
5684
5685 #. type: Plain text
5686 #: build/C/man2/select_tut.2:482
5687 #, no-wrap
5688 msgid ""
5689 "    struct timeval tv;\n"
5690 "    tv.tv_sec = 0;\n"
5691 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5692 "    select(0, NULL, NULL, NULL, &tv);\n"
5693 msgstr ""
5694 "    struct timeval tv;\n"
5695 "    tv.tv_sec = 0;\n"
5696 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5697 "    select(0, NULL, NULL, NULL, &tv);\n"
5698
5699 #. type: Plain text
5700 #: build/C/man2/select_tut.2:485
5701 msgid "This is only guaranteed to work on UNIX systems, however."
5702 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5703
5704 #. type: Plain text
5705 #: build/C/man2/select_tut.2:490
5706 msgid ""
5707 "On success, B<select>()  returns the total number of file descriptors still "
5708 "present in the file descriptor sets."
5709 msgstr ""
5710 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5711 "ディスクリプタの総数を返す。"
5712
5713 #. type: Plain text
5714 #: build/C/man2/select_tut.2:496
5715 msgid ""
5716 "If B<select>()  timed out, then the return value will be zero.  The file "
5717 "descriptors set should be all empty (but may not be on some systems)."
5718 msgstr ""
5719 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5720 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5721
5722 #. type: Plain text
5723 #: build/C/man2/select_tut.2:503
5724 msgid ""
5725 "A return value of -1 indicates an error, with I<errno> being set "
5726 "appropriately.  In the case of an error, the contents of the returned sets "
5727 "and the I<struct timeout> contents are undefined and should not be used.  "
5728 "B<pselect>()  however never modifies I<ntimeout>."
5729 msgstr ""
5730 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5731 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5732 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5733 "変更しない。"
5734
5735 #. type: Plain text
5736 #: build/C/man2/select_tut.2:512
5737 msgid ""
5738 "Generally speaking, all operating systems that support sockets also support "
5739 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5740 "and efficient way that naive programmers try to solve in a more complicated "
5741 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5742 msgstr ""
5743 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5744 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5745 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5746 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5747
5748 #. type: Plain text
5749 #: build/C/man2/select_tut.2:521
5750 msgid ""
5751 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5752 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5753 "is nowadays widely available, but historically was less portable than "
5754 "B<select>()."
5755 msgstr ""
5756 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5757 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5758 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5759
5760 #. type: Plain text
5761 #: build/C/man2/select_tut.2:529
5762 msgid ""
5763 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5764 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5765 "of file descriptors."
5766 msgstr ""
5767 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5768 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5769
5770 #. type: Plain text
5771 #: build/C/man2/select_tut.2:534
5772 msgid ""
5773 "Here is an example that better demonstrates the true utility of B<select>"
5774 "().  The listing below is a TCP forwarding program that forwards from one "
5775 "TCP port to another."
5776 msgstr ""
5777 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5778 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5779
5780 #. type: Plain text
5781 #: build/C/man2/select_tut.2:547
5782 #, no-wrap
5783 msgid ""
5784 "#include E<lt>stdlib.hE<gt>\n"
5785 "#include E<lt>stdio.hE<gt>\n"
5786 "#include E<lt>unistd.hE<gt>\n"
5787 "#include E<lt>sys/time.hE<gt>\n"
5788 "#include E<lt>sys/types.hE<gt>\n"
5789 "#include E<lt>string.hE<gt>\n"
5790 "#include E<lt>signal.hE<gt>\n"
5791 "#include E<lt>sys/socket.hE<gt>\n"
5792 "#include E<lt>netinet/in.hE<gt>\n"
5793 "#include E<lt>arpa/inet.hE<gt>\n"
5794 "#include E<lt>errno.hE<gt>\n"
5795 msgstr ""
5796 "#include E<lt>stdlib.hE<gt>\n"
5797 "#include E<lt>stdio.hE<gt>\n"
5798 "#include E<lt>unistd.hE<gt>\n"
5799 "#include E<lt>sys/time.hE<gt>\n"
5800 "#include E<lt>sys/types.hE<gt>\n"
5801 "#include E<lt>string.hE<gt>\n"
5802 "#include E<lt>signal.hE<gt>\n"
5803 "#include E<lt>sys/socket.hE<gt>\n"
5804 "#include E<lt>netinet/in.hE<gt>\n"
5805 "#include E<lt>arpa/inet.hE<gt>\n"
5806 "#include E<lt>errno.hE<gt>\n"
5807
5808 #. type: Plain text
5809 #: build/C/man2/select_tut.2:549
5810 #, no-wrap
5811 msgid "static int forward_port;\n"
5812 msgstr "static int forward_port;\n"
5813
5814 #. type: Plain text
5815 #: build/C/man2/select_tut.2:552
5816 #, no-wrap
5817 msgid ""
5818 "#undef max\n"
5819 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5820 msgstr ""
5821 "#undef max\n"
5822 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5823
5824 #. type: Plain text
5825 #: build/C/man2/select_tut.2:559
5826 #, no-wrap
5827 msgid ""
5828 "static int\n"
5829 "listen_socket(int listen_port)\n"
5830 "{\n"
5831 "    struct sockaddr_in a;\n"
5832 "    int s;\n"
5833 "    int yes;\n"
5834 msgstr ""
5835 "static int\n"
5836 "listen_socket(int listen_port)\n"
5837 "{\n"
5838 "    struct sockaddr_in a;\n"
5839 "    int s;\n"
5840 "    int yes;\n"
5841
5842 #. type: Plain text
5843 #: build/C/man2/select_tut.2:583
5844 #, fuzzy, no-wrap
5845 #| msgid ""
5846 #| "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5847 #| "        perror(\"socket\");\n"
5848 #| "        return -1;\n"
5849 #| "    }\n"
5850 #| "    yes = 1;\n"
5851 #| "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5852 #| "            (char *) &yes, sizeof(yes)) == -1) {\n"
5853 #| "        perror(\"setsockopt\");\n"
5854 #| "        close(s);\n"
5855 #| "        return -1;\n"
5856 #| "    }\n"
5857 #| "    memset(&a, 0, sizeof(a));\n"
5858 #| "    a.sin_port = htons(listen_port);\n"
5859 #| "    a.sin_family = AF_INET;\n"
5860 #| "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5861 #| "        perror(\"bind\");\n"
5862 #| "        close(s);\n"
5863 #| "        return -1;\n"
5864 #| "    }\n"
5865 #| "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5866 #| "    listen(s, 10);\n"
5867 #| "    return s;\n"
5868 #| "}\n"
5869 msgid ""
5870 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5871 "        perror(\"socket\");\n"
5872 "        return -1;\n"
5873 "    }\n"
5874 "    yes = 1;\n"
5875 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5876 "            &yes, sizeof(yes)) == -1) {\n"
5877 "        perror(\"setsockopt\");\n"
5878 "        close(s);\n"
5879 "        return -1;\n"
5880 "    }\n"
5881 "    memset(&a, 0, sizeof(a));\n"
5882 "    a.sin_port = htons(listen_port);\n"
5883 "    a.sin_family = AF_INET;\n"
5884 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5885 "        perror(\"bind\");\n"
5886 "        close(s);\n"
5887 "        return -1;\n"
5888 "    }\n"
5889 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5890 "    listen(s, 10);\n"
5891 "    return s;\n"
5892 "}\n"
5893 msgstr ""
5894 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5895 "        perror(\"socket\");\n"
5896 "        return -1;\n"
5897 "    }\n"
5898 "    yes = 1;\n"
5899 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5900 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5901 "        perror(\"setsockopt\");\n"
5902 "        close(s);\n"
5903 "        return -1;\n"
5904 "    }\n"
5905 "    memset(&a, 0, sizeof(a));\n"
5906 "    a.sin_port = htons(listen_port);\n"
5907 "    a.sin_family = AF_INET;\n"
5908 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5909 "        perror(\"bind\");\n"
5910 "        close(s);\n"
5911 "        return -1;\n"
5912 "    }\n"
5913 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5914 "    listen(s, 10);\n"
5915 "    return s;\n"
5916 "}\n"
5917
5918 #. type: Plain text
5919 #: build/C/man2/select_tut.2:589
5920 #, no-wrap
5921 msgid ""
5922 "static int\n"
5923 "connect_socket(int connect_port, char *address)\n"
5924 "{\n"
5925 "    struct sockaddr_in a;\n"
5926 "    int s;\n"
5927 msgstr ""
5928 "static int\n"
5929 "connect_socket(int connect_port, char *address)\n"
5930 "{\n"
5931 "    struct sockaddr_in a;\n"
5932 "    int s;\n"
5933
5934 #. type: Plain text
5935 #: build/C/man2/select_tut.2:595
5936 #, no-wrap
5937 msgid ""
5938 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5939 "        perror(\"socket\");\n"
5940 "        close(s);\n"
5941 "        return -1;\n"
5942 "    }\n"
5943 msgstr ""
5944 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5945 "        perror(\"socket\");\n"
5946 "        close(s);\n"
5947 "        return -1;\n"
5948 "    }\n"
5949
5950 #. type: Plain text
5951 #: build/C/man2/select_tut.2:599
5952 #, no-wrap
5953 msgid ""
5954 "    memset(&a, 0, sizeof(a));\n"
5955 "    a.sin_port = htons(connect_port);\n"
5956 "    a.sin_family = AF_INET;\n"
5957 msgstr ""
5958 "    memset(&a, 0, sizeof(a));\n"
5959 "    a.sin_port = htons(connect_port);\n"
5960 "    a.sin_family = AF_INET;\n"
5961
5962 #. type: Plain text
5963 #: build/C/man2/select_tut.2:605
5964 #, no-wrap
5965 msgid ""
5966 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5967 "        perror(\"bad IP address format\");\n"
5968 "        close(s);\n"
5969 "        return -1;\n"
5970 "    }\n"
5971 msgstr ""
5972 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5973 "        perror(\"bad IP address format\");\n"
5974 "        close(s);\n"
5975 "        return -1;\n"
5976 "    }\n"
5977
5978 #. type: Plain text
5979 #: build/C/man2/select_tut.2:614
5980 #, no-wrap
5981 msgid ""
5982 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5983 "        perror(\"connect()\");\n"
5984 "        shutdown(s, SHUT_RDWR);\n"
5985 "        close(s);\n"
5986 "        return -1;\n"
5987 "    }\n"
5988 "    return s;\n"
5989 "}\n"
5990 msgstr ""
5991 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5992 "        perror(\"connect()\");\n"
5993 "        shutdown(s, SHUT_RDWR);\n"
5994 "        close(s);\n"
5995 "        return -1;\n"
5996 "    }\n"
5997 "    return s;\n"
5998 "}\n"
5999
6000 #. type: Plain text
6001 #: build/C/man2/select_tut.2:622
6002 #, no-wrap
6003 msgid ""
6004 "#define SHUT_FD1 do {                                \\e\n"
6005 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6006 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6007 "                         close(fd1);                 \\e\n"
6008 "                         fd1 = -1;                   \\e\n"
6009 "                     }                               \\e\n"
6010 "                 } while (0)\n"
6011 msgstr ""
6012 "#define SHUT_FD1 do {                                \\e\n"
6013 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6014 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6015 "                         close(fd1);                 \\e\n"
6016 "                         fd1 = -1;                   \\e\n"
6017 "                     }                               \\e\n"
6018 "                 } while (0)\n"
6019
6020 #. type: Plain text
6021 #: build/C/man2/select_tut.2:630
6022 #, no-wrap
6023 msgid ""
6024 "#define SHUT_FD2 do {                                \\e\n"
6025 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6026 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6027 "                         close(fd2);                 \\e\n"
6028 "                         fd2 = -1;                   \\e\n"
6029 "                     }                               \\e\n"
6030 "                 } while (0)\n"
6031 msgstr ""
6032 "#define SHUT_FD2 do {                                \\e\n"
6033 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6034 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6035 "                         close(fd2);                 \\e\n"
6036 "                         fd2 = -1;                   \\e\n"
6037 "                     }                               \\e\n"
6038 "                 } while (0)\n"
6039
6040 #. type: Plain text
6041 #: build/C/man2/select_tut.2:632
6042 #, no-wrap
6043 msgid "#define BUF_SIZE 1024\n"
6044 msgstr "#define BUF_SIZE 1024\n"
6045
6046 #. type: Plain text
6047 #: build/C/man2/select_tut.2:641
6048 #, no-wrap
6049 msgid ""
6050 "int\n"
6051 "main(int argc, char *argv[])\n"
6052 "{\n"
6053 "    int h;\n"
6054 "    int fd1 = -1, fd2 = -1;\n"
6055 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6056 "    int buf1_avail, buf1_written;\n"
6057 "    int buf2_avail, buf2_written;\n"
6058 msgstr ""
6059 "int\n"
6060 "main(int argc, char *argv[])\n"
6061 "{\n"
6062 "    int h;\n"
6063 "    int fd1 = -1, fd2 = -1;\n"
6064 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6065 "    int buf1_avail, buf1_written;\n"
6066 "    int buf2_avail, buf2_written;\n"
6067
6068 #. type: Plain text
6069 #: build/C/man2/select_tut.2:647
6070 #, no-wrap
6071 msgid ""
6072 "    if (argc != 4) {\n"
6073 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6074 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6075 "        exit(EXIT_FAILURE);\n"
6076 "    }\n"
6077 msgstr ""
6078 "    if (argc != 4) {\n"
6079 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6080 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6081 "        exit(EXIT_FAILURE);\n"
6082 "    }\n"
6083
6084 #. type: Plain text
6085 #: build/C/man2/select_tut.2:649
6086 #, no-wrap
6087 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6088 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6089
6090 #. type: Plain text
6091 #: build/C/man2/select_tut.2:651
6092 #, no-wrap
6093 msgid "    forward_port = atoi(argv[2]);\n"
6094 msgstr "    forward_port = atoi(argv[2]);\n"
6095
6096 #. type: Plain text
6097 #: build/C/man2/select_tut.2:655
6098 #, no-wrap
6099 msgid ""
6100 "    h = listen_socket(atoi(argv[1]));\n"
6101 "    if (h == -1)\n"
6102 "        exit(EXIT_FAILURE);\n"
6103 msgstr ""
6104 "    h = listen_socket(atoi(argv[1]));\n"
6105 "    if (h == -1)\n"
6106 "        exit(EXIT_FAILURE);\n"
6107
6108 #. type: Plain text
6109 #: build/C/man2/select_tut.2:659
6110 #, no-wrap
6111 msgid ""
6112 "    for (;;) {\n"
6113 "        int r, nfds = 0;\n"
6114 "        fd_set rd, wr, er;\n"
6115 msgstr ""
6116 "    for (;;) {\n"
6117 "        int r, nfds = 0;\n"
6118 "        fd_set rd, wr, er;\n"
6119
6120 #. type: Plain text
6121 #: build/C/man2/select_tut.2:689
6122 #, no-wrap
6123 msgid ""
6124 "        FD_ZERO(&rd);\n"
6125 "        FD_ZERO(&wr);\n"
6126 "        FD_ZERO(&er);\n"
6127 "        FD_SET(h, &rd);\n"
6128 "        nfds = max(nfds, h);\n"
6129 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6130 "            FD_SET(fd1, &rd);\n"
6131 "            nfds = max(nfds, fd1);\n"
6132 "        }\n"
6133 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6134 "            FD_SET(fd2, &rd);\n"
6135 "            nfds = max(nfds, fd2);\n"
6136 "        }\n"
6137 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6138 "            FD_SET(fd1, &wr);\n"
6139 "            nfds = max(nfds, fd1);\n"
6140 "        }\n"
6141 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6142 "            FD_SET(fd2, &wr);\n"
6143 "            nfds = max(nfds, fd2);\n"
6144 "        }\n"
6145 "        if (fd1 E<gt> 0) {\n"
6146 "            FD_SET(fd1, &er);\n"
6147 "            nfds = max(nfds, fd1);\n"
6148 "        }\n"
6149 "        if (fd2 E<gt> 0) {\n"
6150 "            FD_SET(fd2, &er);\n"
6151 "            nfds = max(nfds, fd2);\n"
6152 "        }\n"
6153 msgstr ""
6154 "        FD_ZERO(&rd);\n"
6155 "        FD_ZERO(&wr);\n"
6156 "        FD_ZERO(&er);\n"
6157 "        FD_SET(h, &rd);\n"
6158 "        nfds = max(nfds, h);\n"
6159 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6160 "            FD_SET(fd1, &rd);\n"
6161 "            nfds = max(nfds, fd1);\n"
6162 "        }\n"
6163 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6164 "            FD_SET(fd2, &rd);\n"
6165 "            nfds = max(nfds, fd2);\n"
6166 "        }\n"
6167 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6168 "            FD_SET(fd1, &wr);\n"
6169 "            nfds = max(nfds, fd1);\n"
6170 "        }\n"
6171 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6172 "            FD_SET(fd2, &wr);\n"
6173 "            nfds = max(nfds, fd2);\n"
6174 "        }\n"
6175 "        if (fd1 E<gt> 0) {\n"
6176 "            FD_SET(fd1, &er);\n"
6177 "            nfds = max(nfds, fd1);\n"
6178 "        }\n"
6179 "        if (fd2 E<gt> 0) {\n"
6180 "            FD_SET(fd2, &er);\n"
6181 "            nfds = max(nfds, fd2);\n"
6182 "        }\n"
6183
6184 #. type: Plain text
6185 #: build/C/man2/select_tut.2:691
6186 #, no-wrap
6187 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6188 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6189
6190 #. type: Plain text
6191 #: build/C/man2/select_tut.2:694
6192 #, no-wrap
6193 msgid ""
6194 "        if (r == -1 && errno == EINTR)\n"
6195 "            continue;\n"
6196 msgstr ""
6197 "        if (r == -1 && errno == EINTR)\n"
6198 "            continue;\n"
6199
6200 #. type: Plain text
6201 #: build/C/man2/select_tut.2:699
6202 #, no-wrap
6203 msgid ""
6204 "        if (r == -1) {\n"
6205 "            perror(\"select()\");\n"
6206 "            exit(EXIT_FAILURE);\n"
6207 "        }\n"
6208 msgstr ""
6209 "        if (r == -1) {\n"
6210 "            perror(\"select()\");\n"
6211 "            exit(EXIT_FAILURE);\n"
6212 "        }\n"
6213
6214 #. type: Plain text
6215 #: build/C/man2/select_tut.2:703
6216 #, no-wrap
6217 msgid ""
6218 "        if (FD_ISSET(h, &rd)) {\n"
6219 "            unsigned int l;\n"
6220 "            struct sockaddr_in client_address;\n"
6221 msgstr ""
6222 "        if (FD_ISSET(h, &rd)) {\n"
6223 "            unsigned int l;\n"
6224 "            struct sockaddr_in client_address;\n"
6225
6226 #. type: Plain text
6227 #: build/C/man2/select_tut.2:722
6228 #, no-wrap
6229 msgid ""
6230 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6231 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6232 "            if (r == -1) {\n"
6233 "                perror(\"accept()\");\n"
6234 "            } else {\n"
6235 "                SHUT_FD1;\n"
6236 "                SHUT_FD2;\n"
6237 "                buf1_avail = buf1_written = 0;\n"
6238 "                buf2_avail = buf2_written = 0;\n"
6239 "                fd1 = r;\n"
6240 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6241 "                if (fd2 == -1)\n"
6242 "                    SHUT_FD1;\n"
6243 "                else\n"
6244 "                    printf(\"connect from %s\\en\",\n"
6245 "                            inet_ntoa(client_address.sin_addr));\n"
6246 "            }\n"
6247 "        }\n"
6248 msgstr ""
6249 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6250 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6251 "            if (r == -1) {\n"
6252 "                perror(\"accept()\");\n"
6253 "            } else {\n"
6254 "                SHUT_FD1;\n"
6255 "                SHUT_FD2;\n"
6256 "                buf1_avail = buf1_written = 0;\n"
6257 "                buf2_avail = buf2_written = 0;\n"
6258 "                fd1 = r;\n"
6259 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6260 "                if (fd2 == -1)\n"
6261 "                    SHUT_FD1;\n"
6262 "                else\n"
6263 "                    printf(\"connect from %s\\en\",\n"
6264 "                            inet_ntoa(client_address.sin_addr));\n"
6265 "            }\n"
6266 "        }\n"
6267
6268 #. type: Plain text
6269 #: build/C/man2/select_tut.2:724
6270 #, no-wrap
6271 msgid "        /* NB: read oob data before normal reads */\n"
6272 msgstr "        /* NB: read oob data before normal reads */\n"
6273
6274 #. type: Plain text
6275 #: build/C/man2/select_tut.2:728
6276 #, no-wrap
6277 msgid ""
6278 "        if (fd1 E<gt> 0)\n"
6279 "            if (FD_ISSET(fd1, &er)) {\n"
6280 "                char c;\n"
6281 msgstr ""
6282 "        if (fd1 E<gt> 0)\n"
6283 "            if (FD_ISSET(fd1, &er)) {\n"
6284 "                char c;\n"
6285
6286 #. type: Plain text
6287 #: build/C/man2/select_tut.2:738
6288 #, no-wrap
6289 msgid ""
6290 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6291 "                if (r E<lt> 1)\n"
6292 "                    SHUT_FD1;\n"
6293 "                else\n"
6294 "                    send(fd2, &c, 1, MSG_OOB);\n"
6295 "            }\n"
6296 "        if (fd2 E<gt> 0)\n"
6297 "            if (FD_ISSET(fd2, &er)) {\n"
6298 "                char c;\n"
6299 msgstr ""
6300 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6301 "                if (r E<lt> 1)\n"
6302 "                    SHUT_FD1;\n"
6303 "                else\n"
6304 "                    send(fd2, &c, 1, MSG_OOB);\n"
6305 "            }\n"
6306 "        if (fd2 E<gt> 0)\n"
6307 "            if (FD_ISSET(fd2, &er)) {\n"
6308 "                char c;\n"
6309
6310 #. type: Plain text
6311 #: build/C/man2/select_tut.2:781
6312 #, no-wrap
6313 msgid ""
6314 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6315 "                if (r E<lt> 1)\n"
6316 "                    SHUT_FD2;\n"
6317 "                else\n"
6318 "                    send(fd1, &c, 1, MSG_OOB);\n"
6319 "            }\n"
6320 "        if (fd1 E<gt> 0)\n"
6321 "            if (FD_ISSET(fd1, &rd)) {\n"
6322 "                r = read(fd1, buf1 + buf1_avail,\n"
6323 "                          BUF_SIZE - buf1_avail);\n"
6324 "                if (r E<lt> 1)\n"
6325 "                    SHUT_FD1;\n"
6326 "                else\n"
6327 "                    buf1_avail += r;\n"
6328 "            }\n"
6329 "        if (fd2 E<gt> 0)\n"
6330 "            if (FD_ISSET(fd2, &rd)) {\n"
6331 "                r = read(fd2, buf2 + buf2_avail,\n"
6332 "                          BUF_SIZE - buf2_avail);\n"
6333 "                if (r E<lt> 1)\n"
6334 "                    SHUT_FD2;\n"
6335 "                else\n"
6336 "                    buf2_avail += r;\n"
6337 "            }\n"
6338 "        if (fd1 E<gt> 0)\n"
6339 "            if (FD_ISSET(fd1, &wr)) {\n"
6340 "                r = write(fd1, buf2 + buf2_written,\n"
6341 "                           buf2_avail - buf2_written);\n"
6342 "                if (r E<lt> 1)\n"
6343 "                    SHUT_FD1;\n"
6344 "                else\n"
6345 "                    buf2_written += r;\n"
6346 "            }\n"
6347 "        if (fd2 E<gt> 0)\n"
6348 "            if (FD_ISSET(fd2, &wr)) {\n"
6349 "                r = write(fd2, buf1 + buf1_written,\n"
6350 "                           buf1_avail - buf1_written);\n"
6351 "                if (r E<lt> 1)\n"
6352 "                    SHUT_FD2;\n"
6353 "                else\n"
6354 "                    buf1_written += r;\n"
6355 "            }\n"
6356 msgstr ""
6357 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6358 "                if (r E<lt> 1)\n"
6359 "                    SHUT_FD2;\n"
6360 "                else\n"
6361 "                    send(fd1, &c, 1, MSG_OOB);\n"
6362 "            }\n"
6363 "        if (fd1 E<gt> 0)\n"
6364 "            if (FD_ISSET(fd1, &rd)) {\n"
6365 "                r = read(fd1, buf1 + buf1_avail,\n"
6366 "                          BUF_SIZE - buf1_avail);\n"
6367 "                if (r E<lt> 1)\n"
6368 "                    SHUT_FD1;\n"
6369 "                else\n"
6370 "                    buf1_avail += r;\n"
6371 "            }\n"
6372 "        if (fd2 E<gt> 0)\n"
6373 "            if (FD_ISSET(fd2, &rd)) {\n"
6374 "                r = read(fd2, buf2 + buf2_avail,\n"
6375 "                          BUF_SIZE - buf2_avail);\n"
6376 "                if (r E<lt> 1)\n"
6377 "                    SHUT_FD2;\n"
6378 "                else\n"
6379 "                    buf2_avail += r;\n"
6380 "            }\n"
6381 "        if (fd1 E<gt> 0)\n"
6382 "            if (FD_ISSET(fd1, &wr)) {\n"
6383 "                r = write(fd1, buf2 + buf2_written,\n"
6384 "                           buf2_avail - buf2_written);\n"
6385 "                if (r E<lt> 1)\n"
6386 "                    SHUT_FD1;\n"
6387 "                else\n"
6388 "                    buf2_written += r;\n"
6389 "            }\n"
6390 "        if (fd2 E<gt> 0)\n"
6391 "            if (FD_ISSET(fd2, &wr)) {\n"
6392 "                r = write(fd2, buf1 + buf1_written,\n"
6393 "                           buf1_avail - buf1_written);\n"
6394 "                if (r E<lt> 1)\n"
6395 "                    SHUT_FD2;\n"
6396 "                else\n"
6397 "                    buf1_written += r;\n"
6398 "            }\n"
6399
6400 #. type: Plain text
6401 #: build/C/man2/select_tut.2:783
6402 #, no-wrap
6403 msgid "        /* check if write data has caught read data */\n"
6404 msgstr "        /* check if write data has caught read data */\n"
6405
6406 #. type: Plain text
6407 #: build/C/man2/select_tut.2:788
6408 #, no-wrap
6409 msgid ""
6410 "        if (buf1_written == buf1_avail)\n"
6411 "            buf1_written = buf1_avail = 0;\n"
6412 "        if (buf2_written == buf2_avail)\n"
6413 "            buf2_written = buf2_avail = 0;\n"
6414 msgstr ""
6415 "        if (buf1_written == buf1_avail)\n"
6416 "            buf1_written = buf1_avail = 0;\n"
6417 "        if (buf2_written == buf2_avail)\n"
6418 "            buf2_written = buf2_avail = 0;\n"
6419
6420 #. type: Plain text
6421 #: build/C/man2/select_tut.2:791
6422 #, no-wrap
6423 msgid ""
6424 "        /* one side has closed the connection, keep\n"
6425 "           writing to the other side until empty */\n"
6426 msgstr ""
6427 "        /* one side has closed the connection, keep\n"
6428 "           writing to the other side until empty */\n"
6429
6430 #. type: Plain text
6431 #: build/C/man2/select_tut.2:799
6432 #, no-wrap
6433 msgid ""
6434 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6435 "            SHUT_FD2;\n"
6436 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6437 "            SHUT_FD1;\n"
6438 "    }\n"
6439 "    exit(EXIT_SUCCESS);\n"
6440 "}\n"
6441 msgstr ""
6442 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6443 "            SHUT_FD2;\n"
6444 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6445 "            SHUT_FD1;\n"
6446 "    }\n"
6447 "    exit(EXIT_SUCCESS);\n"
6448 "}\n"
6449
6450 #. type: Plain text
6451 #: build/C/man2/select_tut.2:813
6452 msgid ""
6453 "The above program properly forwards most kinds of TCP connections including "
6454 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6455 "problem of having data flow in both directions simultaneously.  You might "
6456 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6457 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6458 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6459 "because you end up using inefficient timeouts."
6460 msgstr ""
6461 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6462 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6463 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6464 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6465 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6466 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6467 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6468 "起こってしまう。"
6469
6470 #. type: Plain text
6471 #: build/C/man2/select_tut.2:819
6472 msgid ""
6473 "The program does not handle more than one simultaneous connection at a time, "
6474 "although it could easily be extended to do this with a linked list of buffers"
6475 "\\(emone for each connection.  At the moment, new connections cause the "
6476 "current connection to be dropped."
6477 msgstr ""
6478 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6479 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6480 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6481
6482 #.  .SH AUTHORS
6483 #.  This man page was written by Paul Sheer.
6484 #. type: Plain text
6485 #: build/C/man2/select_tut.2:838
6486 msgid ""
6487 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6488 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6489 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6490 "(3), B<epoll>(7)"
6491 msgstr ""
6492 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6493 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6494 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6495 "(3), B<epoll>(7)"
6496
6497 #. type: TH
6498 #: build/C/man2/send.2:40
6499 #, no-wrap
6500 msgid "SEND"
6501 msgstr "SEND"
6502
6503 #. type: TH
6504 #: build/C/man2/send.2:40
6505 #, no-wrap
6506 msgid "2012-04-23"
6507 msgstr "2012-04-23"
6508
6509 #. type: Plain text
6510 #: build/C/man2/send.2:43
6511 msgid "send, sendto, sendmsg - send a message on a socket"
6512 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6513
6514 #. type: Plain text
6515 #: build/C/man2/send.2:47
6516 #, no-wrap
6517 msgid ""
6518 "B<#include E<lt>sys/types.hE<gt>>\n"
6519 "B<#include E<lt>sys/socket.hE<gt>>\n"
6520 msgstr ""
6521 "B<#include E<lt>sys/types.hE<gt>>\n"
6522 "B<#include E<lt>sys/socket.hE<gt>>\n"
6523
6524 #. type: Plain text
6525 #: build/C/man2/send.2:50
6526 #, no-wrap
6527 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6528 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6529
6530 #. type: Plain text
6531 #: build/C/man2/send.2:54
6532 #, no-wrap
6533 msgid ""
6534 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6535 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6536 msgstr ""
6537 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6538 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6539
6540 #. type: Plain text
6541 #: build/C/man2/send.2:57
6542 #, no-wrap
6543 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6544 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6545
6546 #. type: Plain text
6547 #: build/C/man2/send.2:65
6548 msgid ""
6549 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6550 "transmit a message to another socket."
6551 msgstr ""
6552 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6553 "メッセージを転送するのに使用される。"
6554
6555 #. type: Plain text
6556 #: build/C/man2/send.2:84
6557 msgid ""
6558 "The B<send>()  call may be used only when the socket is in a I<connected> "
6559 "state (so that the intended recipient is known).  The only difference "
6560 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6561 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6562 "following call"
6563 msgstr ""
6564 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6565 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6566 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6567 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6568
6569 #. type: Plain text
6570 #: build/C/man2/send.2:86
6571 #, no-wrap
6572 msgid "    send(sockfd, buf, len, flags);\n"
6573 msgstr "    send(sockfd, buf, len, flags);\n"
6574
6575 #. type: Plain text
6576 #: build/C/man2/send.2:88
6577 msgid "is equivalent to"
6578 msgstr "は以下と等価である。"
6579
6580 #. type: Plain text
6581 #: build/C/man2/send.2:90
6582 #, no-wrap
6583 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6584 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6585
6586 #. type: Plain text
6587 #: build/C/man2/send.2:94
6588 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6589 msgstr ""
6590 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6591 "る。"
6592
6593 #. type: Plain text
6594 #: build/C/man2/send.2:122
6595 msgid ""
6596 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6597 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6598 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6599 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6600 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6601 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6602 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6603 "size."
6604 msgstr ""
6605 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6606 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6607 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6608 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6609 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6610 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6611 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6612 "msg_namelen> で指定される。"
6613
6614 #. type: Plain text
6615 #: build/C/man2/send.2:138
6616 msgid ""
6617 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6618 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6619 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6620 "ancillary data (also known as control information)."
6621 msgstr ""
6622 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6623 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6624 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6625 "(制御情報とも呼ばれる) を送信することもできる。"
6626
6627 #. type: Plain text
6628 #: build/C/man2/send.2:143
6629 msgid ""
6630 "If the message is too long to pass atomically through the underlying "
6631 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6632 "transmitted."
6633 msgstr ""
6634 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6635 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6636 "ラーが返され、そのメッセージは転送されない。"
6637
6638 #. type: Plain text
6639 #: build/C/man2/send.2:147
6640 msgid ""
6641 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6642 "detected errors are indicated by a return value of -1."
6643 msgstr ""
6644 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6645 "出された場合は、返り値 -1 として通知される。"
6646
6647 #. type: Plain text
6648 #: build/C/man2/send.2:160
6649 msgid ""
6650 "When the message does not fit into the send buffer of the socket, B<send>()  "
6651 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6652 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6653 "in this case.  The B<select>(2)  call may be used to determine when it is "
6654 "possible to send more data."
6655 msgstr ""
6656 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6657 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6658 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6659 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6660 "用することができる。"
6661
6662 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6663 #. type: Plain text
6664 #: build/C/man2/send.2:166
6665 msgid ""
6666 "The I<flags> argument is the bitwise OR of zero or more of the following "
6667 "flags."
6668 msgstr ""
6669 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6670 "のを指定する。"
6671
6672 #. type: TP
6673 #: build/C/man2/send.2:166
6674 #, no-wrap
6675 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6676 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6677
6678 #. type: Plain text
6679 #: build/C/man2/send.2:180
6680 msgid ""
6681 "Tell the link layer that forward progress happened: you got a successful "
6682 "reply from the other side.  If the link layer doesn't get this it will "
6683 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6684 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
6685 "IPv4 and IPv6.  See B<arp>(7)  for details."
6686 msgstr ""
6687 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6688 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6689 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6690 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6691 "されている。 詳しくは B<arp>(7)  参照のこと。"
6692
6693 #. type: TP
6694 #: build/C/man2/send.2:180
6695 #, no-wrap
6696 msgid "B<MSG_DONTROUTE>"
6697 msgstr "B<MSG_DONTROUTE>"
6698
6699 #. type: Plain text
6700 #: build/C/man2/send.2:188
6701 msgid ""
6702 "Don't use a gateway to send out the packet, only send to hosts on directly "
6703 "connected networks.  This is usually used only by diagnostic or routing "
6704 "programs.  This is only defined for protocol families that route; packet "
6705 "sockets don't."
6706 msgstr ""
6707 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6708 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6709 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6710 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6711
6712 #. type: Plain text
6713 #: build/C/man2/send.2:199
6714 msgid ""
6715 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6716 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6717 "flag with the B<F_SETFL> B<fcntl>(2))."
6718 msgstr ""
6719 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6720 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6721 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6722
6723 #. type: TP
6724 #: build/C/man2/send.2:199
6725 #, no-wrap
6726 msgid "B<MSG_EOR> (since Linux 2.2)"
6727 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6728
6729 #. type: Plain text
6730 #: build/C/man2/send.2:203
6731 msgid ""
6732 "Terminates a record (when this notion is supported, as for sockets of type "
6733 "B<SOCK_SEQPACKET>)."
6734 msgstr ""
6735 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6736 "ケット種別のときに有効)。"
6737
6738 #. type: TP
6739 #: build/C/man2/send.2:203
6740 #, no-wrap
6741 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6742 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6743
6744 #. type: Plain text
6745 #: build/C/man2/send.2:212
6746 msgid ""
6747 "The caller has more data to send.  This flag is used with TCP sockets to "
6748 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6749 "with the difference that this flag can be set on a per-call basis."
6750 msgstr ""
6751 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6752 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6753 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6754 "機能を有効にできる点である。"
6755
6756 #. type: Plain text
6757 #: build/C/man2/send.2:221
6758 msgid ""
6759 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6760 "the kernel to package all of the data sent in calls with this flag set into "
6761 "a single datagram which is only transmitted when a call is performed that "
6762 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6763 "described in B<udp>(7).)"
6764 msgstr ""
6765 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6766 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6767 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6768 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6769 "ソケットオプション B<UDP_CORK> も参照)。"
6770
6771 #. type: TP
6772 #: build/C/man2/send.2:221
6773 #, no-wrap
6774 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6775 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6776
6777 #. type: Plain text
6778 #: build/C/man2/send.2:230
6779 msgid ""
6780 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6781 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6782 msgstr ""
6783 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6784 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6785
6786 #. type: Plain text
6787 #: build/C/man2/send.2:239
6788 msgid ""
6789 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6790 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6791 "data."
6792 msgstr ""
6793 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6794 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6795 "をサポートしている必要がある。"
6796
6797 #. type: Plain text
6798 #: build/C/man2/send.2:246
6799 msgid ""
6800 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6801 "below for an exact description of its fields."
6802 msgstr ""
6803 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6804 "B<recv>(2)  と以下の説明を参照すること。"
6805
6806 #.  Still to be documented:
6807 #.   Send file descriptors and user credentials using the
6808 #.   msg_control* fields.
6809 #.   The flags returned in msg_flags.
6810 #. type: Plain text
6811 #: build/C/man2/send.2:275
6812 msgid ""
6813 "You may send control information using the I<msg_control> and "
6814 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6815 "process is limited per socket by the value in I</proc/sys/net/core/"
6816 "optmem_max>; see B<socket>(7)."
6817 msgstr ""
6818 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6819 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6820 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6821
6822 #. type: Plain text
6823 #: build/C/man2/send.2:280
6824 msgid ""
6825 "On success, these calls return the number of characters sent.  On error, -1 "
6826 "is returned, and I<errno> is set appropriately."
6827 msgstr ""
6828 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6829 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6830
6831 #. type: Plain text
6832 #: build/C/man2/send.2:285
6833 msgid ""
6834 "These are some standard errors generated by the socket layer.  Additional "
6835 "errors may be generated and returned from the underlying protocol modules; "
6836 "see their respective manual pages."
6837 msgstr ""
6838 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6839 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6840 "れぞれのマニュアルを参照すること。"
6841
6842 #. type: Plain text
6843 #: build/C/man2/send.2:293
6844 msgid ""
6845 "(For UNIX domain sockets, which are identified by pathname)  Write "
6846 "permission is denied on the destination socket file, or search permission is "
6847 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6848 "(7).)"
6849 msgstr ""
6850 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6851 "\n"
6852 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6853 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6854 "(B<path_resolution>(7) も参照のこと)"
6855
6856 #. type: Plain text
6857 #: build/C/man2/send.2:296
6858 msgid ""
6859 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6860 "as though it was a unicast address."
6861 msgstr ""
6862 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6863 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6864
6865 #.  Actually EAGAIN on Linux
6866 #. type: Plain text
6867 #: build/C/man2/send.2:304
6868 msgid ""
6869 "The socket is marked nonblocking and the requested operation would block.  "
6870 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6871 "require these constants to have the same value, so a portable application "
6872 "should check for both possibilities."
6873 msgstr ""
6874 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6875 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6876 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6877 "両方の可能性を 確認すべきである。"
6878
6879 #. type: Plain text
6880 #: build/C/man2/send.2:307
6881 msgid "An invalid descriptor was specified."
6882 msgstr "無効なディスクリプターが指定された。"
6883
6884 #. type: TP
6885 #: build/C/man2/send.2:307
6886 #, no-wrap
6887 msgid "B<ECONNRESET>"
6888 msgstr "B<ECONNRESET>"
6889
6890 #. type: Plain text
6891 #: build/C/man2/send.2:310
6892 msgid "Connection reset by peer."
6893 msgstr "接続が接続相手によりリセットされた。"
6894
6895 #. type: TP
6896 #: build/C/man2/send.2:310
6897 #, no-wrap
6898 msgid "B<EDESTADDRREQ>"
6899 msgstr "B<EDESTADDRREQ>"
6900
6901 #. type: Plain text
6902 #: build/C/man2/send.2:313
6903 msgid "The socket is not connection-mode, and no peer address is set."
6904 msgstr ""
6905 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6906 "ていない。"
6907
6908 #. type: Plain text
6909 #: build/C/man2/send.2:316
6910 msgid "An invalid user space address was specified for an argument."
6911 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6912
6913 #. type: Plain text
6914 #: build/C/man2/send.2:320
6915 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6916 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6917
6918 #. type: Plain text
6919 #: build/C/man2/send.2:329
6920 msgid ""
6921 "The connection-mode socket was connected already but a recipient was "
6922 "specified.  (Now either this error is returned, or the recipient "
6923 "specification is ignored.)"
6924 msgstr ""
6925 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6926 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6927 "いずれかとなる)"
6928
6929 #. type: TP
6930 #: build/C/man2/send.2:329
6931 #, no-wrap
6932 msgid "B<EMSGSIZE>"
6933 msgstr "B<EMSGSIZE>"
6934
6935 #.  (e.g., SOCK_DGRAM )
6936 #. type: Plain text
6937 #: build/C/man2/send.2:335
6938 msgid ""
6939 "The socket type requires that message be sent atomically, and the size of "
6940 "the message to be sent made this impossible."
6941 msgstr ""
6942 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6943 "るが、 メッセージが大き過ぎるため送信することができない。"
6944
6945 #. type: Plain text
6946 #: build/C/man2/send.2:343
6947 msgid ""
6948 "The output queue for a network interface was full.  This generally indicates "
6949 "that the interface has stopped sending, but may be caused by transient "
6950 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6951 "silently dropped when a device queue overflows.)"
6952 msgstr ""
6953 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6954 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6955 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6956 "フローした場合にはパケットは黙って捨てられる)"
6957
6958 #. type: Plain text
6959 #: build/C/man2/send.2:346
6960 msgid "No memory available."
6961 msgstr "メモリが足りない。"
6962
6963 #. type: Plain text
6964 #: build/C/man2/send.2:349
6965 msgid "The socket is not connected, and no target has been given."
6966 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6967
6968 #. type: Plain text
6969 #: build/C/man2/send.2:359
6970 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6971 msgstr ""
6972 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6973 "る。"
6974
6975 #. type: TP
6976 #: build/C/man2/send.2:359
6977 #, no-wrap
6978 msgid "B<EPIPE>"
6979 msgstr "B<EPIPE>"
6980
6981 #. type: Plain text
6982 #: build/C/man2/send.2:368
6983 msgid ""
6984 "The local end has been shut down on a connection oriented socket.  In this "
6985 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6986 "set."
6987 msgstr ""
6988 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6989 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6990
6991 #. type: Plain text
6992 #: build/C/man2/send.2:371
6993 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
6994 msgstr ""
6995 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
6996
6997 #. type: Plain text
6998 #: build/C/man2/send.2:382
6999 msgid ""
7000 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags.  "
7001 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7002 "flag is a Linux extension."
7003 msgstr ""
7004 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7005 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7006 "ラグは Linux での拡張である。"
7007
7008 #. type: Plain text
7009 #: build/C/man2/send.2:395
7010 msgid ""
7011 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7012 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7013 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7014 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7015 "and libc5.  See also B<accept>(2)."
7016 msgstr ""
7017 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7018 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7019 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7020 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7021 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7022
7023 #. type: Plain text
7024 #: build/C/man2/send.2:414
7025 #, fuzzy
7026 #| msgid ""
7027 #| "See B<sendmmsg(2)> for information about a Linux-specific system call "
7028 #| "that can be used to transmit multiple datagrams in a single call."
7029 msgid ""
7030 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7031 "can be used to transmit multiple datagrams in a single call."
7032 msgstr ""
7033 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7034 "る\n"
7035 "Linux 固有の システムコールに関する情報が書かれている。"
7036
7037 #. type: Plain text
7038 #: build/C/man2/send.2:419
7039 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7040 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7041
7042 #. type: Plain text
7043 #: build/C/man2/send.2:424
7044 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7045 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7046
7047 #. type: Plain text
7048 #: build/C/man2/send.2:439
7049 msgid ""
7050 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7051 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7052 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7053 msgstr ""
7054 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7055 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7056 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7057
7058 #. type: TH
7059 #: build/C/man2/sendmmsg.2:28
7060 #, no-wrap
7061 msgid "SENDMMSG"
7062 msgstr "SENDMMSG"
7063
7064 #. type: TH
7065 #: build/C/man2/sendmmsg.2:28
7066 #, fuzzy, no-wrap
7067 #| msgid "2012-02-27"
7068 msgid "2012-12-16"
7069 msgstr "2012-02-27"
7070
7071 #. type: Plain text
7072 #: build/C/man2/sendmmsg.2:31
7073 msgid "sendmmsg - send multiple messages on a socket"
7074 msgstr ""
7075
7076 #. type: Plain text
7077 #: build/C/man2/sendmmsg.2:39
7078 #, no-wrap
7079 msgid ""
7080 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7081 "B<             unsigned int >I<flags>B<);>\n"
7082 msgstr ""
7083 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7084 "B<             unsigned int >I<flags>B<);>\n"
7085
7086 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7087 #. type: Plain text
7088 #: build/C/man2/sendmmsg.2:49
7089 msgid ""
7090 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7091 "the caller to transmit multiple messages on a socket using a single system "
7092 "call.  (This has performance benefits for some applications.)"
7093 msgstr ""
7094
7095 #. type: Plain text
7096 #: build/C/man2/sendmmsg.2:54
7097 msgid ""
7098 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7099 "to be transmitted."
7100 msgstr ""
7101
7102 #. type: Plain text
7103 #: build/C/man2/sendmmsg.2:75
7104 #, no-wrap
7105 msgid ""
7106 "struct mmsghdr {\n"
7107 "    struct msghdr msg_hdr;  /* Message header */\n"
7108 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7109 "};\n"
7110 msgstr ""
7111
7112 #. type: Plain text
7113 #: build/C/man2/sendmmsg.2:91
7114 msgid ""
7115 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7116 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7117 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7118 "B<sendmsg>(2)  call)."
7119 msgstr ""
7120
7121 #. type: Plain text
7122 #: build/C/man2/sendmmsg.2:97
7123 msgid ""
7124 "The I<flags> argument contains flags ORed together.  The flags are the same "
7125 "as for B<sendmsg>(2)."
7126 msgstr ""
7127
7128 #. type: Plain text
7129 #: build/C/man2/sendmmsg.2:107
7130 msgid ""
7131 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7132 "sent.  A nonblocking call sends as many messages as possible (up to the "
7133 "limit specified by I<vlen>)  and returns immediately."
7134 msgstr ""
7135
7136 #. type: Plain text
7137 #: build/C/man2/sendmmsg.2:119
7138 msgid ""
7139 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7140 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7141 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7142 "of elements of I<msgvec> that have been updated."
7143 msgstr ""
7144
7145 #. type: Plain text
7146 #: build/C/man2/sendmmsg.2:129
7147 msgid ""
7148 "On success, B<sendmmsg>()  returns the number of messages sent from "
7149 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7150 "B<sendmmsg>()  call to send the remaining messages."
7151 msgstr ""
7152
7153 #. type: Plain text
7154 #: build/C/man2/sendmmsg.2:133
7155 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7156 msgstr ""
7157
7158 #
7159 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7160 #.      ... only return an error if no datagrams could be sent.
7161 #.      If less than the requested number of messages were sent, the application
7162 #.      must retry starting at the first failed one and if the problem is
7163 #.      persistent the error will be returned.
7164 #.      This matches the behaviour of other syscalls like read/write - it
7165 #.      is not an error if less than the requested number of elements are sent.
7166 #. type: Plain text
7167 #: build/C/man2/sendmmsg.2:145
7168 msgid ""
7169 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7170 "could be sent."
7171 msgstr ""
7172
7173 #. type: Plain text
7174 #: build/C/man2/sendmmsg.2:150
7175 msgid ""
7176 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7177 "added in version 2.14."
7178 msgstr ""
7179
7180 #. type: Plain text
7181 #: build/C/man2/sendmmsg.2:153
7182 msgid "B<sendmmsg>()  is Linux-specific."
7183 msgstr ""
7184
7185 #
7186 #
7187 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7188 #.      net: Cap number of elements for sendmmsg
7189 #.      To limit the amount of time we can spend in sendmmsg, cap the
7190 #.      number of elements to UIO_MAXIOV (currently 1024).
7191 #.      For error handling an application using sendmmsg needs to retry at
7192 #.      the first unsent message, so capping is simpler and requires less
7193 #.      application logic than returning EINVAL.
7194 #. type: Plain text
7195 #: build/C/man2/sendmmsg.2:168
7196 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7197 msgstr ""
7198
7199 #. type: Plain text
7200 #: build/C/man2/sendmmsg.2:177
7201 msgid ""
7202 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7203 "distinct UDP datagrams using one system call.  The contents of the first "
7204 "datagram originates from a pair of buffers."
7205 msgstr ""
7206
7207 #. type: Plain text
7208 #: build/C/man2/sendmmsg.2:186
7209 #, fuzzy, no-wrap
7210 #| msgid ""
7211 #| "#include E<lt>stdio.hE<gt>\n"
7212 #| "#include E<lt>stdlib.hE<gt>\n"
7213 #| "#include E<lt>sys/time.hE<gt>\n"
7214 #| "#include E<lt>sys/types.hE<gt>\n"
7215 #| "#include E<lt>unistd.hE<gt>\n"
7216 msgid ""
7217 "#define _GNU_SOURCE\n"
7218 "#include E<lt>netinet/ip.hE<gt>\n"
7219 "#include E<lt>stdio.hE<gt>\n"
7220 "#include E<lt>stdlib.hE<gt>\n"
7221 "#include E<lt>string.hE<gt>\n"
7222 "#include E<lt>sys/types.hE<gt>\n"
7223 "#include E<lt>sys/socket.hE<gt>\n"
7224 msgstr ""
7225 "#include E<lt>stdio.hE<gt>\n"
7226 "#include E<lt>stdlib.hE<gt>\n"
7227 "#include E<lt>sys/time.hE<gt>\n"
7228 "#include E<lt>sys/types.hE<gt>\n"
7229 "#include E<lt>unistd.hE<gt>\n"
7230
7231 #. type: Plain text
7232 #: build/C/man2/sendmmsg.2:195
7233 #, fuzzy, no-wrap
7234 #| msgid ""
7235 #| "int\n"
7236 #| "main(void)\n"
7237 #| "{\n"
7238 #| "    fd_set rfds;\n"
7239 #| "    struct timeval tv;\n"
7240 #| "    int retval;\n"
7241 msgid ""
7242 "int\n"
7243 "main(void)\n"
7244 "{\n"
7245 "    int sockfd;\n"
7246 "    struct sockaddr_in sa;\n"
7247 "    struct mmsghdr msg[2];\n"
7248 "    struct iovec msg1[2], msg2;\n"
7249 "    int retval;\n"
7250 msgstr ""
7251 "int\n"
7252 "main(void)\n"
7253 "{\n"
7254 "    fd_set rfds;\n"
7255 "    struct timeval tv;\n"
7256 "    int retval;\n"
7257
7258 #. type: Plain text
7259 #: build/C/man2/sendmmsg.2:209
7260 #, fuzzy, no-wrap
7261 #| msgid ""
7262 #| "    sa.sa_flags = 0;\n"
7263 #| "    sa.sa_handler = child_sig_handler;\n"
7264 #| "    sigemptyset(&sa.sa_mask);\n"
7265 #| "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
7266 #| "        perror(\"sigaction\");\n"
7267 #| "        exit(EXIT_FAILURE);\n"
7268 #| "    }\n"
7269 msgid ""
7270 "    sa.sin_family = AF_INET;\n"
7271 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7272 "    sa.sin_port = htons(1234);\n"
7273 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7274 "        perror(\"connect()\");\n"
7275 "        exit(EXIT_FAILURE);\n"
7276 "    }\n"
7277 msgstr ""
7278 "    sa.sa_flags = 0;\n"
7279 "    sa.sa_handler = child_sig_handler;\n"
7280 "    sigemptyset(&sa.sa_mask);\n"
7281 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
7282 "        perror(\"sigaction\");\n"
7283 "        exit(EXIT_FAILURE);\n"
7284 "    }\n"
7285
7286 #. type: Plain text
7287 #: build/C/man2/sendmmsg.2:215
7288 #, no-wrap
7289 msgid ""
7290 "    memset(msg1, 0, sizeof(msg1));\n"
7291 "    msg1[0].iov_base = \"one\";\n"
7292 "    msg1[0].iov_len = 3;\n"
7293 "    msg1[1].iov_base = \"two\";\n"
7294 "    msg1[1].iov_len = 3;\n"
7295 msgstr ""
7296
7297 #. type: Plain text
7298 #: build/C/man2/sendmmsg.2:219
7299 #, fuzzy, no-wrap
7300 #| msgid ""
7301 #| "    memset(&a, 0, sizeof(a));\n"
7302 #| "    a.sin_port = htons(connect_port);\n"
7303 #| "    a.sin_family = AF_INET;\n"
7304 msgid ""
7305 "    memset(&msg2, 0, sizeof(msg2));\n"
7306 "    msg2.iov_base = \"three\";\n"
7307 "    msg2.iov_len = 5;\n"
7308 msgstr ""
7309 "    memset(&a, 0, sizeof(a));\n"
7310 "    a.sin_port = htons(connect_port);\n"
7311 "    a.sin_family = AF_INET;\n"
7312
7313 #. type: Plain text
7314 #: build/C/man2/sendmmsg.2:223
7315 #, no-wrap
7316 msgid ""
7317 "    memset(msg, 0, sizeof(msg));\n"
7318 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7319 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7320 msgstr ""
7321
7322 #. type: Plain text
7323 #: build/C/man2/sendmmsg.2:226
7324 #, no-wrap
7325 msgid ""
7326 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7327 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7328 msgstr ""
7329
7330 #. type: Plain text
7331 #: build/C/man2/sendmmsg.2:232
7332 #, no-wrap
7333 msgid ""
7334 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7335 "    if (retval == -1)\n"
7336 "        perror(\"sendmmsg()\");\n"
7337 "    else\n"
7338 "        printf(\"%d messages sent\\en\", retval);\n"
7339 msgstr ""
7340
7341 #. type: Plain text
7342 #: build/C/man2/sendmmsg.2:235
7343 #, fuzzy, no-wrap
7344 #| msgid ""
7345 #| "    exit(EXIT_SUCCESS);\n"
7346 #| "}\n"
7347 msgid ""
7348 "    exit(0);\n"
7349 "}\n"
7350 msgstr ""
7351 "    exit(EXIT_SUCCESS);\n"
7352 "}\n"
7353
7354 #. type: Plain text
7355 #: build/C/man2/sendmmsg.2:241
7356 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7357 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7358
7359 #. type: TH
7360 #: build/C/man3/sockatmark.3:25
7361 #, no-wrap
7362 msgid "SOCKATMARK"
7363 msgstr "SOCKATMARK"
7364
7365 #. type: Plain text
7366 #: build/C/man3/sockatmark.3:28
7367 msgid "sockatmark - determine whether socket is at out-of-band mark"
7368 msgstr ""
7369 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7370 "べる"
7371
7372 #. type: Plain text
7373 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7374 #: build/C/man7/socket.7:53 build/C/man2/socketpair.2:49
7375 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7376 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7377
7378 #. type: Plain text
7379 #: build/C/man3/sockatmark.3:32
7380 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7381 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7382
7383 #. type: Plain text
7384 #: build/C/man3/sockatmark.3:41
7385 msgid ""
7386 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7387 "\\ 600"
7388 msgstr ""
7389 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7390 "\\ 600"
7391
7392 #. type: Plain text
7393 #: build/C/man3/sockatmark.3:51
7394 msgid ""
7395 "B<sockatmark>()  returns a value indicating whether or not the socket "
7396 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7397 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7398 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7399 msgstr ""
7400 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7401 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7402 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7403 "この関数は帯域外マークを削除しない。"
7404
7405 #. type: Plain text
7406 #: build/C/man3/sockatmark.3:56
7407 msgid ""
7408 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7409 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7410 "set to indicate the error."
7411 msgstr ""
7412 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7413 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7414 "れ、エラーを表す I<errno> が設定される。"
7415
7416 #. type: Plain text
7417 #: build/C/man3/sockatmark.3:61
7418 msgid "I<sockfd> is not a valid file descriptor."
7419 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7420
7421 #.  POSIX.1 says ENOTTY for this case
7422 #. type: Plain text
7423 #: build/C/man3/sockatmark.3:68
7424 msgid ""
7425 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7426 msgstr ""
7427 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7428
7429 #. type: Plain text
7430 #: build/C/man3/sockatmark.3:71
7431 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7432 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7433
7434 #. type: Plain text
7435 #: build/C/man3/sockatmark.3:73
7436 msgid "POSIX.1-2001."
7437 msgstr "POSIX.1-2001."
7438
7439 #. type: Plain text
7440 #: build/C/man3/sockatmark.3:80
7441 msgid ""
7442 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7443 "the B<MSG_OOB> flag of B<recv>(2)."
7444 msgstr ""
7445 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7446 "B<recv>(2)  で読み込むことができる。"
7447
7448 #. type: Plain text
7449 #: build/C/man3/sockatmark.3:82
7450 msgid "Out-of-band data is only supported on some stream socket protocols."
7451 msgstr ""
7452 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7453 "ない。"
7454
7455 #. type: Plain text
7456 #: build/C/man3/sockatmark.3:87
7457 msgid ""
7458 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7459 "signal."
7460 msgstr ""
7461 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7462 "る。"
7463
7464 #. type: Plain text
7465 #: build/C/man3/sockatmark.3:93
7466 msgid ""
7467 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7468 "operation."
7469 msgstr ""
7470 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7471
7472 #. type: Plain text
7473 #: build/C/man3/sockatmark.3:97
7474 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7475 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7476
7477 #. type: Plain text
7478 #: build/C/man3/sockatmark.3:102
7479 msgid ""
7480 "The following code can be used after receipt of a B<SIGURG> signal to read "
7481 "(and discard) all data up to the mark, and then read the byte of data at the "
7482 "mark:"
7483 msgstr ""
7484 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7485 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7486
7487 #. type: Plain text
7488 #: build/C/man3/sockatmark.3:107
7489 #, no-wrap
7490 msgid ""
7491 "    char buf[BUF_LEN];\n"
7492 "    char oobdata;\n"
7493 "    int atmark, s;\n"
7494 msgstr ""
7495 "    char buf[BUF_LEN];\n"
7496 "    char oobdata;\n"
7497 "    int atmark, s;\n"
7498
7499 #. type: Plain text
7500 #: build/C/man3/sockatmark.3:114
7501 #, no-wrap
7502 msgid ""
7503 "    for (;;) {\n"
7504 "        atmark = sockatmark(sockfd);\n"
7505 "        if (atmark == -1) {\n"
7506 "            perror(\"sockatmark\");\n"
7507 "            break;\n"
7508 "        }\n"
7509 msgstr ""
7510 "    for (;;) {\n"
7511 "        atmark = sockatmark(sockfd);\n"
7512 "        if (atmark == -1) {\n"
7513 "            perror(\"sockatmark\");\n"
7514 "            break;\n"
7515 "        }\n"
7516
7517 #. type: Plain text
7518 #: build/C/man3/sockatmark.3:117
7519 #, no-wrap
7520 msgid ""
7521 "        if (atmark)\n"
7522 "            break;\n"
7523 msgstr ""
7524 "        if (atmark)\n"
7525 "            break;\n"
7526
7527 #. type: Plain text
7528 #: build/C/man3/sockatmark.3:124
7529 #, no-wrap
7530 msgid ""
7531 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7532 "        if (s == -1)\n"
7533 "            perror(\"read\");\n"
7534 "        if (s E<lt>= 0)\n"
7535 "            break;\n"
7536 "    }\n"
7537 msgstr ""
7538 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7539 "        if (s == -1)\n"
7540 "            perror(\"read\");\n"
7541 "        if (s E<lt>= 0)\n"
7542 "            break;\n"
7543 "    }\n"
7544
7545 #. type: Plain text
7546 #: build/C/man3/sockatmark.3:131
7547 #, no-wrap
7548 msgid ""
7549 "    if (atmark == 1) {\n"
7550 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7551 "            perror(\"recv\");\n"
7552 "            ...\n"
7553 "        }\n"
7554 "    }\n"
7555 msgstr ""
7556 "    if (atmark == 1) {\n"
7557 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7558 "            perror(\"recv\");\n"
7559 "            ...\n"
7560 "        }\n"
7561 "    }\n"
7562
7563 #. type: Plain text
7564 #: build/C/man3/sockatmark.3:137
7565 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7566 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7567
7568 #. type: TH
7569 #: build/C/man2/socket.2:43 build/C/man7/socket.7:48
7570 #, no-wrap
7571 msgid "SOCKET"
7572 msgstr "SOCKET"
7573
7574 #. type: TH
7575 #: build/C/man2/socket.2:43
7576 #, no-wrap
7577 msgid "2009-01-19"
7578 msgstr "2009-01-19"
7579
7580 #. type: Plain text
7581 #: build/C/man2/socket.2:46
7582 msgid "socket - create an endpoint for communication"
7583 msgstr "socket - 通信のための端点(endpoint)を作成する"
7584
7585 #. type: Plain text
7586 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7587 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7588 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7589
7590 #. type: Plain text
7591 #: build/C/man2/socket.2:52
7592 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7593 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7594
7595 #. type: Plain text
7596 #: build/C/man2/socket.2:55
7597 msgid ""
7598 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7599 msgstr ""
7600 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7601 "(descriptor)を返す。"
7602
7603 #. type: Plain text
7604 #: build/C/man2/socket.2:63
7605 msgid ""
7606 "The I<domain> argument specifies a communication domain; this selects the "
7607 "protocol family which will be used for communication.  These families are "
7608 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7609 "include:"
7610 msgstr ""
7611 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7612 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7613 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7614 "下の通り。"
7615
7616 #. type: tbl table
7617 #: build/C/man2/socket.2:66
7618 #, no-wrap
7619 msgid "Name:Purpose:Man page\n"
7620 msgstr "名前:目的:マニュアル\n"
7621
7622 #. type: tbl table
7623 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7624 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7625 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7626 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7627 #, no-wrap
7628 msgid "T{\n"
7629 msgstr "T{\n"
7630
7631 #. type: tbl table
7632 #: build/C/man2/socket.2:68
7633 #, no-wrap
7634 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7635 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7636
7637 #. type: tbl table
7638 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7639 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7640 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7641 #: build/C/man7/socket.7:184
7642 #, no-wrap
7643 msgid "T}:T{\n"
7644 msgstr "T}:T{\n"
7645
7646 #. type: tbl table
7647 #: build/C/man2/socket.2:70
7648 #, no-wrap
7649 msgid "Local communication\n"
7650 msgstr "ローカル通信\n"
7651
7652 #. type: tbl table
7653 #: build/C/man2/socket.2:72
7654 #, no-wrap
7655 msgid "B<unix>(7)\n"
7656 msgstr "B<unix>(7)\n"
7657
7658 #. type: tbl table
7659 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7660 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7661 #: build/C/man2/socket.2:118 build/C/man7/socket.7:163
7662 #: build/C/man7/socket.7:167 build/C/man7/socket.7:170
7663 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
7664 #: build/C/man7/socket.7:188 build/C/man7/socket.7:195
7665 #, no-wrap
7666 msgid "T}\n"
7667 msgstr "T}\n"
7668
7669 #. type: tbl table
7670 #: build/C/man2/socket.2:75
7671 #, no-wrap
7672 msgid "B<AF_INET>\n"
7673 msgstr "B<AF_INET>\n"
7674
7675 #. type: tbl table
7676 #: build/C/man2/socket.2:76
7677 #, no-wrap
7678 msgid "T}:IPv4 Internet protocols:T{\n"
7679 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7680
7681 #. type: tbl table
7682 #: build/C/man2/socket.2:77
7683 #, no-wrap
7684 msgid "B<ip>(7)\n"
7685 msgstr "B<ip>(7)\n"
7686
7687 #. type: tbl table
7688 #: build/C/man2/socket.2:80
7689 #, no-wrap
7690 msgid "B<AF_INET6>\n"
7691 msgstr "B<AF_INET6>\n"
7692
7693 #. type: tbl table
7694 #: build/C/man2/socket.2:81
7695 #, no-wrap
7696 msgid "T}:IPv6 Internet protocols:T{\n"
7697 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7698
7699 #. type: tbl table
7700 #: build/C/man2/socket.2:82
7701 #, no-wrap
7702 msgid "B<ipv6>(7)\n"
7703 msgstr "B<ipv6>(7)\n"
7704
7705 #. type: tbl table
7706 #: build/C/man2/socket.2:85
7707 #, no-wrap
7708 msgid "B<AF_IPX>\n"
7709 msgstr "B<AF_IPX>\n"
7710
7711 #. type: tbl table
7712 #: build/C/man2/socket.2:86
7713 #, no-wrap
7714 msgid "T}:IPX - Novell protocols:\n"
7715 msgstr "T}:IPX - Novell プロトコル:\n"
7716
7717 #. type: tbl table
7718 #: build/C/man2/socket.2:88
7719 #, no-wrap
7720 msgid "B<AF_NETLINK>\n"
7721 msgstr "B<AF_NETLINK>\n"
7722
7723 #. type: tbl table
7724 #: build/C/man2/socket.2:90
7725 #, no-wrap
7726 msgid "Kernel user interface device\n"
7727 msgstr "カーネル・ユーザ・デバイス\n"
7728
7729 #. type: tbl table
7730 #: build/C/man2/socket.2:92
7731 #, no-wrap
7732 msgid "B<netlink>(7)\n"
7733 msgstr "B<netlink>(7)\n"
7734
7735 #. type: tbl table
7736 #: build/C/man2/socket.2:95
7737 #, no-wrap
7738 msgid "B<AF_X25>\n"
7739 msgstr "B<AF_X25>\n"
7740
7741 #. type: tbl table
7742 #: build/C/man2/socket.2:96
7743 #, no-wrap
7744 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
7745 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
7746
7747 #. type: tbl table
7748 #: build/C/man2/socket.2:97
7749 #, no-wrap
7750 msgid "B<x25>(7)\n"
7751 msgstr "B<x25>(7)\n"
7752
7753 #. type: tbl table
7754 #: build/C/man2/socket.2:100
7755 #, no-wrap
7756 msgid "B<AF_AX25>\n"
7757 msgstr "B<AF_AX25>\n"
7758
7759 #. type: tbl table
7760 #: build/C/man2/socket.2:102
7761 #, no-wrap
7762 msgid "Amateur radio AX.25 protocol\n"
7763 msgstr "アマチュア無線 AX.25 プロトコル\n"
7764
7765 #. type: tbl table
7766 #: build/C/man2/socket.2:103
7767 #, no-wrap
7768 msgid "T}:\n"
7769 msgstr "T}:\n"
7770
7771 #. type: tbl table
7772 #: build/C/man2/socket.2:105
7773 #, no-wrap
7774 msgid "B<AF_ATMPVC>\n"
7775 msgstr "B<AF_ATMPVC>\n"
7776
7777 #. type: tbl table
7778 #: build/C/man2/socket.2:106
7779 #, no-wrap
7780 msgid "T}:Access to raw ATM PVCs:\n"
7781 msgstr "T}:生の ATM PVC にアクセスする:\n"
7782
7783 #. type: tbl table
7784 #: build/C/man2/socket.2:108
7785 #, no-wrap
7786 msgid "B<AF_APPLETALK>\n"
7787 msgstr "B<AF_APPLETALK>\n"
7788
7789 #. type: tbl table
7790 #: build/C/man2/socket.2:109
7791 #, no-wrap
7792 msgid "T}:Appletalk:T{\n"
7793 msgstr "T}:アップルトーク:T{\n"
7794
7795 #. type: tbl table
7796 #: build/C/man2/socket.2:110
7797 #, no-wrap
7798 msgid "B<ddp>(7)\n"
7799 msgstr "B<ddp>(7)\n"
7800
7801 #. type: tbl table
7802 #: build/C/man2/socket.2:113
7803 #, no-wrap
7804 msgid "B<AF_PACKET>\n"
7805 msgstr "B<AF_PACKET>\n"
7806
7807 #. type: tbl table
7808 #: build/C/man2/socket.2:115
7809 #, no-wrap
7810 msgid "Low level packet interface\n"
7811 msgstr "低レベルのパケットインターフェース\n"
7812
7813 #. type: tbl table
7814 #: build/C/man2/socket.2:117
7815 #, no-wrap
7816 msgid "B<packet>(7)\n"
7817 msgstr "B<packet>(7)\n"
7818
7819 #. type: Plain text
7820 #: build/C/man2/socket.2:126
7821 msgid ""
7822 "The socket has the indicated I<type>, which specifies the communication "
7823 "semantics.  Currently defined types are:"
7824 msgstr ""
7825 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7826 "る。 定義されている型は現在以下の通り。"
7827
7828 #. type: TP
7829 #: build/C/man2/socket.2:126
7830 #, no-wrap
7831 msgid "B<SOCK_STREAM>"
7832 msgstr "B<SOCK_STREAM>"
7833
7834 #. type: Plain text
7835 #: build/C/man2/socket.2:130
7836 msgid ""
7837 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
7838 "out-of-band data transmission mechanism may be supported."
7839 msgstr ""
7840 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7841 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7842
7843 #. type: TP
7844 #: build/C/man2/socket.2:130
7845 #, no-wrap
7846 msgid "B<SOCK_DGRAM>"
7847 msgstr "B<SOCK_DGRAM>"
7848
7849 #. type: Plain text
7850 #: build/C/man2/socket.2:134
7851 msgid ""
7852 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7853 "length)."
7854 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ)  をサポートする。"
7855
7856 #. type: TP
7857 #: build/C/man2/socket.2:134
7858 #, no-wrap
7859 msgid "B<SOCK_SEQPACKET>"
7860 msgstr "B<SOCK_SEQPACKET>"
7861
7862 #. type: Plain text
7863 #: build/C/man2/socket.2:139
7864 msgid ""
7865 "Provides a sequenced, reliable, two-way connection-based data transmission "
7866 "path for datagrams of fixed maximum length; a consumer is required to read "
7867 "an entire packet with each input system call."
7868 msgstr ""
7869 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7870 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7871 "ト全体を読み取ることが要求される。"
7872
7873 #. type: TP
7874 #: build/C/man2/socket.2:139
7875 #, no-wrap
7876 msgid "B<SOCK_RAW>"
7877 msgstr "B<SOCK_RAW>"
7878
7879 #. type: Plain text
7880 #: build/C/man2/socket.2:142
7881 msgid "Provides raw network protocol access."
7882 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7883
7884 #. type: TP
7885 #: build/C/man2/socket.2:142
7886 #, no-wrap
7887 msgid "B<SOCK_RDM>"
7888 msgstr "B<SOCK_RDM>"
7889
7890 #. type: Plain text
7891 #: build/C/man2/socket.2:145
7892 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7893 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7894
7895 #. type: TP
7896 #: build/C/man2/socket.2:145
7897 #, no-wrap
7898 msgid "B<SOCK_PACKET>"
7899 msgstr "B<SOCK_PACKET>"
7900
7901 #. type: Plain text
7902 #: build/C/man2/socket.2:150
7903 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7904 msgstr ""
7905 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7906 "こと"
7907
7908 #. type: Plain text
7909 #: build/C/man2/socket.2:156
7910 msgid ""
7911 "Some socket types may not be implemented by all protocol families; for "
7912 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7913 msgstr ""
7914 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7915 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7916
7917 #. type: Plain text
7918 #: build/C/man2/socket.2:164
7919 msgid ""
7920 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7921 "addition to specifying a socket type, it may include the bitwise OR of any "
7922 "of the following values, to modify the behavior of B<socket>():"
7923 msgstr ""
7924 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7925 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7926 "ることで、 B<socket>()  の振舞いを変更することができる。"
7927
7928 #. type: Plain text
7929 #: build/C/man2/socket.2:198
7930 msgid ""
7931 "The I<protocol> specifies a particular protocol to be used with the socket.  "
7932 "Normally only a single protocol exists to support a particular socket type "
7933 "within a given protocol family, in which case I<protocol> can be specified "
7934 "as 0.  However, it is possible that many protocols may exist, in which case "
7935 "a particular protocol must be specified in this manner.  The protocol number "
7936 "to use is specific to the ``communication domain'' in which communication is "
7937 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
7938 "protocol name strings to protocol numbers."
7939 msgstr ""
7940 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7941 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7942 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7943 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7944 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7945 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
7946 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
7947
7948 #. type: Plain text
7949 #: build/C/man2/socket.2:228
7950 msgid ""
7951 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7952 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7953 "a I<connected> state before any data may be sent or received on it.  A "
7954 "connection to another socket is created with a B<connect>(2)  call.  Once "
7955 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7956 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7957 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7958 "also be transmitted as described in B<send>(2)  and received as described in "
7959 "B<recv>(2)."
7960 msgstr ""
7961 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7962 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7963 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7964 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7965 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7966 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7967 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7968
7969 #. type: Plain text
7970 #: build/C/man2/socket.2:254
7971 msgid ""
7972 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7973 "data is not lost or duplicated.  If a piece of data for which the peer "
7974 "protocol has buffer space cannot be successfully transmitted within a "
7975 "reasonable length of time, then the connection is considered to be dead.  "
7976 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7977 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
7978 "signal is raised if a process sends or receives on a broken stream; this "
7979 "causes naive processes, which do not handle the signal, to exit.  "
7980 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7981 "sockets.  The only difference is that B<read>(2)  calls will return only the "
7982 "amount of data requested, and any data remaining in the arriving packet will "
7983 "be discarded.  Also all message boundaries in incoming datagrams are "
7984 "preserved."
7985 msgstr ""
7986 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7987 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7988 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7989 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7990 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7991 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7992 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7993 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
7994 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
7995 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
7996
7997 #. type: Plain text
7998 #: build/C/man2/socket.2:264
7999 msgid ""
8000 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8001 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8002 "received with B<recvfrom>(2), which returns the next datagram along with the "
8003 "address of its sender."
8004 msgstr ""
8005 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8006 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8007 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8008 "す。"
8009
8010 #. type: Plain text
8011 #: build/C/man2/socket.2:271
8012 msgid ""
8013 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8014 "from the device driver.  Use B<packet>(7)  instead."
8015 msgstr ""
8016 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8017 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8018
8019 #. type: Plain text
8020 #: build/C/man2/socket.2:294
8021 msgid ""
8022 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8023 "process group to receive a B<SIGURG> signal when the out-of-band data "
8024 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8025 "unexpectedly.  This operation may also be used to set the process or process "
8026 "group that receives the I/O and asynchronous notification of I/O events via "
8027 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8028 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8029 msgstr ""
8030 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8031 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8032 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8033 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8034 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8035 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8036 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8037
8038 #. type: Plain text
8039 #: build/C/man2/socket.2:304
8040 msgid ""
8041 "When the network signals an error condition to the protocol module (e.g., "
8042 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8043 "The next operation on this socket will return the error code of the pending "
8044 "error.  For some protocols it is possible to enable a per-socket error queue "
8045 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8046 "(7)."
8047 msgstr ""
8048 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8049 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8050 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8051 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8052 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8053 "B<IP_RECVERR> を参照すること。"
8054
8055 #. type: Plain text
8056 #: build/C/man2/socket.2:314
8057 msgid ""
8058 "The operation of sockets is controlled by socket level I<options>.  These "
8059 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8060 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8061 "respectively."
8062 msgstr ""
8063 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8064 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8065 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8066
8067 #. type: Plain text
8068 #: build/C/man2/socket.2:319
8069 msgid ""
8070 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8071 "is returned, and I<errno> is set appropriately."
8072 msgstr ""
8073 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8074 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8075
8076 #. type: Plain text
8077 #: build/C/man2/socket.2:324
8078 msgid ""
8079 "Permission to create a socket of the specified type and/or protocol is "
8080 "denied."
8081 msgstr ""
8082 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8083
8084 #. type: Plain text
8085 #: build/C/man2/socket.2:327
8086 msgid "The implementation does not support the specified address family."
8087 msgstr "指定されたアドレスファミリーがサポートされていない。"
8088
8089 #. type: Plain text
8090 #: build/C/man2/socket.2:330
8091 msgid "Unknown protocol, or protocol family not available."
8092 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8093
8094 #.  Since Linux 2.6.27
8095 #. type: Plain text
8096 #: build/C/man2/socket.2:335
8097 msgid "Invalid flags in I<type>."
8098 msgstr "I<type> に無効なフラグが指定されている。"
8099
8100 #. type: Plain text
8101 #: build/C/man2/socket.2:338
8102 msgid "Process file table overflow."
8103 msgstr "プロセスのファイルテーブルが溢れている。"
8104
8105 #. type: TP
8106 #: build/C/man2/socket.2:341
8107 #, no-wrap
8108 msgid "B<ENOBUFS> or B<ENOMEM>"
8109 msgstr "B<ENOBUFS> または B<ENOMEM>"
8110
8111 #. type: Plain text
8112 #: build/C/man2/socket.2:346
8113 msgid ""
8114 "Insufficient memory is available.  The socket cannot be created until "
8115 "sufficient resources are freed."
8116 msgstr ""
8117 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8118 "ない。"
8119
8120 #. type: TP
8121 #: build/C/man2/socket.2:346 build/C/man2/socketpair.2:92
8122 #, no-wrap
8123 msgid "B<EPROTONOSUPPORT>"
8124 msgstr "B<EPROTONOSUPPORT>"
8125
8126 #. type: Plain text
8127 #: build/C/man2/socket.2:350
8128 msgid ""
8129 "The protocol type or the specified protocol is not supported within this "
8130 "domain."
8131 msgstr ""
8132 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8133 "いない。"
8134
8135 #. type: Plain text
8136 #: build/C/man2/socket.2:352
8137 msgid "Other errors may be generated by the underlying protocol modules."
8138 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8139
8140 #. type: Plain text
8141 #: build/C/man2/socket.2:354
8142 msgid "4.4BSD, POSIX.1-2001."
8143 msgstr "4.4BSD, POSIX.1-2001."
8144
8145 #. type: Plain text
8146 #: build/C/man2/socket.2:360
8147 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8148 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8149
8150 #. type: Plain text
8151 #: build/C/man2/socket.2:366
8152 msgid ""
8153 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8154 "systems supporting clones of the BSD socket layer (including System V "
8155 "variants)."
8156 msgstr ""
8157 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8158 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8159 "外のシステムからの移植ができる。"
8160
8161 #. type: Plain text
8162 #: build/C/man2/socket.2:385
8163 #, fuzzy
8164 #| msgid ""
8165 #| "The manifest constants used under 4.x BSD for protocol families are "
8166 #| "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<PF_INET>, and so "
8167 #| "on are used for address families.  However, already the BSD man page "
8168 #| "promises: \"The protocol family generally is the same as the address "
8169 #| "family\", and subsequent standards use AF_* everywhere."
8170 msgid ""
8171 "The manifest constants used under 4.x BSD for protocol families are "
8172 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8173 "are used for address families.  However, already the BSD man page promises: "
8174 "\"The protocol family generally is the same as the address family\", and "
8175 "subsequent standards use AF_* everywhere."
8176 msgstr ""
8177 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8178 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8179 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8180 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8181 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8182 "それ以外の規格では全ての場所で AF_* が使用されている。"
8183
8184 #. type: Plain text
8185 #: build/C/man2/socket.2:390
8186 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8187 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8188
8189 #. type: Plain text
8190 #: build/C/man2/socket.2:413
8191 msgid ""
8192 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8193 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8194 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8195 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8196 "(7), B<unix>(7)"
8197 msgstr ""
8198 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8199 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8200 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8201 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8202 "(7), B<unix>(7)"
8203
8204 #. type: Plain text
8205 #: build/C/man2/socket.2:419
8206 #, fuzzy
8207 #| msgid ""
8208 #| "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq is "
8209 #| "reprinted in I<UNIX Programmer's Supplementary Documents Volume 1.>"
8210 msgid ""
8211 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8212 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8213 "Programmer's Supplementary Documents Volume 1.>"
8214 msgstr ""
8215 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq は "
8216 "I<UNIX Programmer's Supplementary Documents Volume 1> として再版された。"
8217
8218 #. type: TH
8219 #: build/C/man7/socket.7:48
8220 #, no-wrap
8221 msgid "2013-03-15"
8222 msgstr ""
8223
8224 #. type: Plain text
8225 #: build/C/man7/socket.7:51
8226 msgid "socket - Linux socket interface"
8227 msgstr "socket - Linux のソケットインターフェース"
8228
8229 #. type: Plain text
8230 #: build/C/man7/socket.7:55
8231 msgid ""
8232 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8233 ">I<protocol>B<);>"
8234 msgstr ""
8235 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8236 ">I<protocol>B<);>"
8237
8238 #. type: Plain text
8239 #: build/C/man7/socket.7:74
8240 msgid ""
8241 "This manual page describes the Linux networking socket layer user "
8242 "interface.  The BSD compatible sockets are the uniform interface between the "
8243 "user process and the network protocol stacks in the kernel.  The protocol "
8244 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
8245 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
8246 "B<socket>(2)  for more information on families and types."
8247 msgstr ""
8248 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8249 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8250 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8251 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8252 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8253 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8254 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8255
8256 #. type: SS
8257 #: build/C/man7/socket.7:74
8258 #, fuzzy, no-wrap
8259 #| msgid "Socket Layer Functions"
8260 msgid "Socket-layer functions"
8261 msgstr "ソケット層の関数群"
8262
8263 #. type: Plain text
8264 #: build/C/man7/socket.7:78
8265 msgid ""
8266 "These functions are used by the user process to send or receive packets and "
8267 "to do other socket operations.  For more information see their respective "
8268 "manual pages."
8269 msgstr ""
8270 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8271 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8272
8273 #. type: Plain text
8274 #: build/C/man7/socket.7:94
8275 msgid ""
8276 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8277 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8278 "address, B<listen>(2)  tells the socket that new connections shall be "
8279 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8280 "connection.  B<socketpair>(2)  returns two connected anonymous sockets (only "
8281 "implemented for a few local families like B<AF_UNIX>)"
8282 msgstr ""
8283 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8284 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8285 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8286 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8287 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8288 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8289 "リーでしか実装されていない)。"
8290
8291 #. type: Plain text
8292 #: build/C/man7/socket.7:116
8293 msgid ""
8294 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8295 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8296 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8297 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8298 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8299 "write data."
8300 msgstr ""
8301 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8302 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8303 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8304 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8305 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8306 "ことができる。"
8307
8308 #. type: Plain text
8309 #: build/C/man7/socket.7:127
8310 msgid ""
8311 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8312 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8313 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8314 "be used to set or read some other options."
8315 msgstr ""
8316 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8317 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8318 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8319 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8320
8321 #. type: Plain text
8322 #: build/C/man7/socket.7:132
8323 msgid ""
8324 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8325 "full-duplex socket connection."
8326 msgstr ""
8327 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8328 "続を部分的にクローズする。"
8329
8330 #. type: Plain text
8331 #: build/C/man7/socket.7:138
8332 msgid ""
8333 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8334 "not supported on sockets."
8335 msgstr ""
8336 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8337 "ではサポートされていない。"
8338
8339 #. type: Plain text
8340 #: build/C/man7/socket.7:155
8341 msgid ""
8342 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8343 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8344 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8345 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8346 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8347 msgstr ""
8348 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8349 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8350 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8351 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8352 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8353 "B<select>(2)  を使って待つことができる。"
8354
8355 #. type: tbl table
8356 #: build/C/man7/socket.7:159
8357 #, no-wrap
8358 msgid "I/O events\n"
8359 msgstr "I/O イベント\n"
8360
8361 #. type: tbl table
8362 #: build/C/man7/socket.7:160
8363 #, no-wrap
8364 msgid "Event:Poll flag:Occurrence\n"
8365 msgstr "イベント:poll フラグ:内容\n"
8366
8367 #. type: tbl table
8368 #: build/C/man7/socket.7:161 build/C/man7/socket.7:164
8369 #, no-wrap
8370 msgid "Read:POLLIN:T{\n"
8371 msgstr "Read:POLLIN:T{\n"
8372
8373 #. type: tbl table
8374 #: build/C/man7/socket.7:162
8375 #, no-wrap
8376 msgid "New data arrived.\n"
8377 msgstr "新しいデータが到着した。\n"
8378
8379 #. type: tbl table
8380 #: build/C/man7/socket.7:165
8381 #, no-wrap
8382 msgid "A connection setup has been completed\n"
8383 msgstr "(接続志向のソケットで)\n"
8384
8385 #. type: tbl table
8386 #: build/C/man7/socket.7:166
8387 #, no-wrap
8388 msgid "(for connection-oriented sockets)\n"
8389 msgstr "接続の設定が終了した。\n"
8390
8391 #. type: tbl table
8392 #: build/C/man7/socket.7:168 build/C/man7/socket.7:171
8393 #, no-wrap
8394 msgid "Read:POLLHUP:T{\n"
8395 msgstr "Read:POLLHUP:T{\n"
8396
8397 #. type: tbl table
8398 #: build/C/man7/socket.7:169
8399 #, no-wrap
8400 msgid "A disconnection request has been initiated by the other end.\n"
8401 msgstr "接続先で切断要求が生成された。\n"
8402
8403 #. type: tbl table
8404 #: build/C/man7/socket.7:172
8405 #, no-wrap
8406 msgid "A connection is broken (only for connection-oriented protocols).\n"
8407 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8408
8409 #. type: tbl table
8410 #: build/C/man7/socket.7:173
8411 #, no-wrap
8412 msgid "When the socket is written\n"
8413 msgstr "この場合、ソケットに書き込みが行われると\n"
8414
8415 #. type: tbl table
8416 #: build/C/man7/socket.7:174
8417 #, no-wrap
8418 msgid "B<SIGPIPE>\n"
8419 msgstr "B<SIGPIPE>\n"
8420
8421 #. type: tbl table
8422 #: build/C/man7/socket.7:175
8423 #, no-wrap
8424 msgid "is also sent.\n"
8425 msgstr "も送信される。\n"
8426
8427 #. type: tbl table
8428 #: build/C/man7/socket.7:177
8429 #, no-wrap
8430 msgid "Write:POLLOUT:T{\n"
8431 msgstr "Write:POLLOUT:T{\n"
8432
8433 #. type: tbl table
8434 #: build/C/man7/socket.7:178
8435 #, no-wrap
8436 msgid "Socket has enough send buffer space for writing new data.\n"
8437 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
8438
8439 #. type: tbl table
8440 #: build/C/man7/socket.7:180
8441 #, no-wrap
8442 msgid "Read/Write:T{\n"
8443 msgstr "Read/Write:T{\n"
8444
8445 #. type: tbl table
8446 #: build/C/man7/socket.7:181
8447 #, no-wrap
8448 msgid "POLLIN|\n"
8449 msgstr "POLLIN|\n"
8450
8451 #. type: tbl table
8452 #: build/C/man7/socket.7:182
8453 #, no-wrap
8454 msgid ".br\n"
8455 msgstr ".br\n"
8456
8457 #. type: tbl table
8458 #: build/C/man7/socket.7:183
8459 #, no-wrap
8460 msgid "POLLOUT\n"
8461 msgstr "POLLOUT\n"
8462
8463 #. type: tbl table
8464 #: build/C/man7/socket.7:185
8465 #, no-wrap
8466 msgid "An outgoing\n"
8467 msgstr "外部向けの\n"
8468
8469 #. type: tbl table
8470 #: build/C/man7/socket.7:186
8471 #, no-wrap
8472 msgid "B<connect>(2)\n"
8473 msgstr "B<connect>(2)\n"
8474
8475 #. type: tbl table
8476 #: build/C/man7/socket.7:187
8477 #, no-wrap
8478 msgid "finished.\n"
8479 msgstr "が終了した。\n"
8480
8481 #. type: tbl table
8482 #: build/C/man7/socket.7:189
8483 #, no-wrap
8484 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8485 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8486
8487 #. type: tbl table
8488 #: build/C/man7/socket.7:190
8489 #, no-wrap
8490 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8491 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8492
8493 #. type: tbl table
8494 #: build/C/man7/socket.7:191
8495 #, no-wrap
8496 msgid "Exception:POLLPRI:T{\n"
8497 msgstr "Exception:POLLPRI:T{\n"
8498
8499 #. type: tbl table
8500 #: build/C/man7/socket.7:192
8501 #, no-wrap
8502 msgid "Urgent data arrived.\n"
8503 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8504
8505 #. type: tbl table
8506 #: build/C/man7/socket.7:193
8507 #, no-wrap
8508 msgid "B<SIGURG>\n"
8509 msgstr "B<SIGURG>\n"
8510
8511 #. type: tbl table
8512 #: build/C/man7/socket.7:194
8513 #, no-wrap
8514 msgid "is sent then.\n"
8515 msgstr "が送信される。\n"
8516
8517 #. type: Plain text
8518 #: build/C/man7/socket.7:223
8519 msgid ""
8520 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8521 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8522 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8523 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8524 "I<Signals> discussion below."
8525 msgstr ""
8526 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8527 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8528 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8529 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8530 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8531 "と。"
8532
8533 #. type: SS
8534 #: build/C/man7/socket.7:223
8535 #, no-wrap
8536 msgid "Socket address structures"
8537 msgstr ""
8538
8539 #. type: Plain text
8540 #: build/C/man7/socket.7:239
8541 msgid ""
8542 "Each socket domain has its own format for socket addresses, with a domain-"
8543 "specific address structure.  Each of these structures begins with an integer "
8544 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8545 "address structure.  This allows the various system calls (e.g., B<connect>"
8546 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8547 "are generic to all socket domains, to determine the domain of a particular "
8548 "socket address."
8549 msgstr ""
8550
8551 #. type: Plain text
8552 #: build/C/man7/socket.7:249
8553 msgid ""
8554 "To allow any type of socket address to be passed to interfaces in the "
8555 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8556 "type is purely to allow casting of domain-specific socket address types to a "
8557 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8558 "calls to the sockets API."
8559 msgstr ""
8560
8561 #. type: Plain text
8562 #: build/C/man7/socket.7:259
8563 msgid ""
8564 "In addition, the sockets API provides the data type I<struct "
8565 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8566 "domain-specific socket address structures; it is large enough and is aligned "
8567 "properly.  (In particular, it is large enough to hold IPv6 socket "
8568 "addresses.)  The structure includes the following field, which can be used "
8569 "to identify the type of socket address actually stored in the structure:"
8570 msgstr ""
8571
8572 #. type: Plain text
8573 #: build/C/man7/socket.7:263
8574 #, no-wrap
8575 msgid "    sa_family_t ss_family;\n"
8576 msgstr ""
8577
8578 #. type: Plain text
8579 #: build/C/man7/socket.7:271
8580 msgid ""
8581 "The I<sockaddr_storage> structure is useful in programs that must handle "
8582 "socket addresses in a generic way (e.g., programs that must deal with both "
8583 "IPv4 and IPv6 socket addresses)."
8584 msgstr ""
8585
8586 #. type: SS
8587 #: build/C/man7/socket.7:271
8588 #, fuzzy, no-wrap
8589 #| msgid "Socket Options"
8590 msgid "Socket options"
8591 msgstr "ソケットオプション"
8592
8593 #.  FIXME
8594 #.  In the list below, the text used to describe argument types
8595 #.  for each socket option should be more consistent
8596 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8597 #.  W R Stevens, UNPv1
8598 #. type: Plain text
8599 #: build/C/man7/socket.7:285
8600 msgid ""
8601 "These socket options can be set by using B<setsockopt>(2)  and read with "
8602 "B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for all sockets:"
8603 msgstr ""
8604 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
8605 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8606 "レベルには B<SOL_SOCKET> を指定すること。"
8607
8608 #. type: TP
8609 #: build/C/man7/socket.7:285
8610 #, no-wrap
8611 msgid "B<SO_ACCEPTCONN>"
8612 msgstr "B<SO_ACCEPTCONN>"
8613
8614 #. type: Plain text
8615 #: build/C/man7/socket.7:293
8616 msgid ""
8617 "Returns a value indicating whether or not this socket has been marked to "
8618 "accept connections with B<listen>(2).  The value 0 indicates that this is "
8619 "not a listening socket, the value 1 indicates that this is a listening "
8620 "socket.  This socket option is read-only."
8621 msgstr ""
8622 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
8623 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8624 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8625
8626 #. type: TP
8627 #: build/C/man7/socket.7:293
8628 #, no-wrap
8629 msgid "B<SO_BINDTODEVICE>"
8630 msgstr "B<SO_BINDTODEVICE>"
8631
8632 #. type: Plain text
8633 #: build/C/man7/socket.7:312
8634 msgid ""
8635 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8636 "the passed interface name.  If the name is an empty string or the option "
8637 "length is zero, the socket device binding is removed.  The passed option is "
8638 "a variable-length null-terminated interface name string with the maximum "
8639 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
8640 "received from that particular interface are processed by the socket.  Note "
8641 "that this only works for some socket types, particularly B<AF_INET> "
8642 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
8643 "there)."
8644 msgstr ""
8645 "このソケットを、引き数で渡したインターフェース名で指定される\n"
8646 "(\\(lqeth0\\(rq のような) 特定のデバイスにバインドする。\n"
8647 "名前が空文字列だったり、オプションの長さ (optlen) が 0 の場合には、\n"
8648 "ソケットのバインドが削除される。渡すオプションは、インターフェース名が\n"
8649 "入ったヌル文字で終端された可変長の文字列である。\n"
8650 "文字列の最大のサイズは B<IFNAMSIX> である。\n"
8651 "ソケットがインターフェースにバインドされると、その特定のインターフェース\n"
8652 "から受信されたパケットだけを処理する。\n"
8653 "このオプションはいくつかのソケットタイプ、\n"
8654 "特に B<AF_INET> に対してのみ動作する点に注意すること。\n"
8655 "パケットソケットではサポートされていない (通常の B<bind>(2) を使うこと)。"
8656
8657 #. type: Plain text
8658 #: build/C/man7/socket.7:326
8659 msgid ""
8660 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8661 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
8662 "argument should contain the buffer size available to receive the device name "
8663 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
8664 "reported back in the I<optlen> argument."
8665 msgstr ""
8666
8667 #. type: TP
8668 #: build/C/man7/socket.7:326
8669 #, no-wrap
8670 msgid "B<SO_BROADCAST>"
8671 msgstr "B<SO_BROADCAST>"
8672
8673 #. type: Plain text
8674 #: build/C/man7/socket.7:332
8675 msgid ""
8676 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
8677 "to send packets to a broadcast address.  This option has no effect on stream-"
8678 "oriented sockets."
8679 msgstr ""
8680 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
8681 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
8682 "ストリーム指向のソケットには何の効果もない。"
8683
8684 #. type: TP
8685 #: build/C/man7/socket.7:332
8686 #, no-wrap
8687 msgid "B<SO_BSDCOMPAT>"
8688 msgstr "B<SO_BSDCOMPAT>"
8689
8690 #. type: Plain text
8691 #: build/C/man7/socket.7:344
8692 msgid ""
8693 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
8694 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
8695 "socket will not be passed to the user program.  In later kernel versions, "
8696 "support for this option has been phased out: Linux 2.4 silently ignores it, "
8697 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
8698 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
8699 "header changing, skipping of the broadcast flag) for raw sockets with this "
8700 "option, but that was removed in Linux 2.2."
8701 msgstr ""
8702 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
8703 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
8704 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
8705 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
8706 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
8707 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
8708 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
8709 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
8710 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
8711
8712 #. type: TP
8713 #: build/C/man7/socket.7:344
8714 #, no-wrap
8715 msgid "B<SO_DEBUG>"
8716 msgstr "B<SO_DEBUG>"
8717
8718 #. type: Plain text
8719 #: build/C/man7/socket.7:350
8720 msgid ""
8721 "Enable socket debugging.  Only allowed for processes with the "
8722 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
8723 msgstr ""
8724 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
8725 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
8726
8727 #. type: TP
8728 #: build/C/man7/socket.7:350
8729 #, no-wrap
8730 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8731 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8732
8733 #. type: Plain text
8734 #: build/C/man7/socket.7:358
8735 msgid ""
8736 "Retrieves the socket domain as an integer, returning a value such as "
8737 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
8738 "only."
8739 msgstr ""
8740 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
8741 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8742
8743 #. type: TP
8744 #: build/C/man7/socket.7:358
8745 #, no-wrap
8746 msgid "B<SO_ERROR>"
8747 msgstr "B<SO_ERROR>"
8748
8749 #. type: Plain text
8750 #: build/C/man7/socket.7:363
8751 msgid ""
8752 "Get and clear the pending socket error.  This socket option is read-only.  "
8753 "Expects an integer."
8754 msgstr ""
8755 "保留になっていたソケットエラーを取得してクリアする。\n"
8756 "このソケットオプションは読み込み専用である。整数値をとる。"
8757
8758 #. type: TP
8759 #: build/C/man7/socket.7:363
8760 #, no-wrap
8761 msgid "B<SO_DONTROUTE>"
8762 msgstr "B<SO_DONTROUTE>"
8763
8764 #. type: Plain text
8765 #: build/C/man7/socket.7:372
8766 msgid ""
8767 "Don't send via a gateway, only send to directly connected hosts.  The same "
8768 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
8769 "B<send>(2)  operation.  Expects an integer boolean flag."
8770 msgstr ""
8771 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2)  操作"
8772 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
8773 "フラグを取る。"
8774
8775 #. type: TP
8776 #: build/C/man7/socket.7:372
8777 #, no-wrap
8778 msgid "B<SO_KEEPALIVE>"
8779 msgstr "B<SO_KEEPALIVE>"
8780
8781 #. type: Plain text
8782 #: build/C/man7/socket.7:376
8783 msgid ""
8784 "Enable sending of keep-alive messages on connection-oriented sockets.  "
8785 "Expects an integer boolean flag."
8786 msgstr ""
8787 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
8788 "の整数フラグをとる。"
8789
8790 #. type: TP
8791 #: build/C/man7/socket.7:376
8792 #, no-wrap
8793 msgid "B<SO_LINGER>"
8794 msgstr "B<SO_LINGER>"
8795
8796 #. type: Plain text
8797 #: build/C/man7/socket.7:384
8798 msgid ""
8799 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
8800 msgstr ""
8801 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
8802
8803 #. type: Plain text
8804 #: build/C/man7/socket.7:391
8805 #, no-wrap
8806 msgid ""
8807 "struct linger {\n"
8808 "    int l_onoff;    /* linger active */\n"
8809 "    int l_linger;   /* how many seconds to linger for */\n"
8810 "};\n"
8811 msgstr ""
8812 "struct linger {\n"
8813 "    int l_onoff;    /* linger active */\n"
8814 "    int l_linger;   /* how many seconds to linger for */\n"
8815 "};\n"
8816
8817 #. type: Plain text
8818 #: build/C/man7/socket.7:405
8819 msgid ""
8820 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
8821 "queued messages for the socket have been successfully sent or the linger "
8822 "timeout has been reached.  Otherwise, the call returns immediately and the "
8823 "closing is done in the background.  When the socket is closed as part of "
8824 "B<exit>(2), it always lingers in the background."
8825 msgstr ""
8826 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
8827 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
8828 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
8829 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
8830 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
8831 "送られる。"
8832
8833 #. type: TP
8834 #: build/C/man7/socket.7:405
8835 #, fuzzy, no-wrap
8836 #| msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8837 msgid "B<SO_MARK> (since Linux 2.6.25)"
8838 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8839
8840 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
8841 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
8842 #. type: Plain text
8843 #: build/C/man7/socket.7:416
8844 msgid ""
8845 "Set the mark for each packet sent through this socket (similar to the "
8846 "netfilter MARK target but socket-based).  Changing the mark can be used for "
8847 "mark-based routing without netfilter or for packet filtering.  Setting this "
8848 "option requires the B<CAP_NET_ADMIN> capability."
8849 msgstr ""
8850
8851 #. type: TP
8852 #: build/C/man7/socket.7:416
8853 #, no-wrap
8854 msgid "B<SO_OOBINLINE>"
8855 msgstr "B<SO_OOBINLINE>"
8856
8857 #.  don't document it because it can do too much harm.
8858 #. .B SO_NO_CHECK
8859 #. type: Plain text
8860 #: build/C/man7/socket.7:425
8861 msgid ""
8862 "If this option is enabled, out-of-band data is directly placed into the "
8863 "receive data stream.  Otherwise out-of-band data is only passed when the "
8864 "B<MSG_OOB> flag is set during receiving."
8865 msgstr ""
8866 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
8867 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
8868 "ラグがセットされている場合に限って渡される。"
8869
8870 #. type: TP
8871 #: build/C/man7/socket.7:425
8872 #, no-wrap
8873 msgid "B<SO_PASSCRED>"
8874 msgstr "B<SO_PASSCRED>"
8875
8876 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8877 #.  in the 2.6.18 ChangeLog
8878 #. type: Plain text
8879 #: build/C/man7/socket.7:434
8880 msgid ""
8881 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
8882 "For more information see B<unix>(7)."
8883 msgstr ""
8884 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
8885 "を参照のこと。"
8886
8887 #. type: TP
8888 #: build/C/man7/socket.7:434
8889 #, no-wrap
8890 msgid "B<SO_PEERCRED>"
8891 msgstr "B<SO_PEERCRED>"
8892
8893 #. type: Plain text
8894 #: build/C/man7/socket.7:457
8895 #, fuzzy
8896 #| msgid ""
8897 #| "Return the credentials of the foreign process connected to this socket.  "
8898 #| "This is only possible for connected B<AF_UNIX> stream sockets and "
8899 #| "B<AF_UNIX> stream and datagram socket pairs created using B<socketpair>"
8900 #| "(2); see B<unix>(7).  The returned credentials are those that were in "
8901 #| "effect at the time of the call to B<connect>(2)  or B<socketpair>(2).  "
8902 #| "Argument is a I<ucred> structure.  This socket option is read-only."
8903 msgid ""
8904 "Return the credentials of the foreign process connected to this socket.  "
8905 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
8906 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
8907 "(7).  The returned credentials are those that were in effect at the time of "
8908 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
8909 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
8910 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
8911 "option is read-only."
8912 msgstr ""
8913 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。\n"
8914 "このソケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソ"
8915 "ケット間、\n"
8916 "および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケット"
8917 "と\n"
8918 "データグラムソケットのペアだけである。\n"
8919 "B<unix>(7)  を参照のこと。\n"
8920 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
8921 "る。\n"
8922 "引き数は I<ucred> 構造体である。\n"
8923 "このソケットオプションは読み込み専用である。"
8924
8925 #. type: TP
8926 #: build/C/man7/socket.7:457
8927 #, no-wrap
8928 msgid "B<SO_PRIORITY>"
8929 msgstr "B<SO_PRIORITY>"
8930
8931 #. type: Plain text
8932 #: build/C/man7/socket.7:470
8933 msgid ""
8934 "Set the protocol-defined priority for all packets to be sent on this "
8935 "socket.  Linux uses this value to order the networking queues: packets with "
8936 "a higher priority may be processed first depending on the selected device "
8937 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
8938 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
8939 "6 requires the B<CAP_NET_ADMIN> capability."
8940 msgstr ""
8941 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
8942 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
8943 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
8944 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
8945 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
8946 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
8947
8948 #. type: TP
8949 #: build/C/man7/socket.7:470
8950 #, no-wrap
8951 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
8952 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
8953
8954 #. type: Plain text
8955 #: build/C/man7/socket.7:478
8956 msgid ""
8957 "Retrieves the socket protocol as an integer, returning a value such as "
8958 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
8959 "only."
8960 msgstr ""
8961 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
8962 "る。\n"
8963 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8964
8965 #. type: TP
8966 #: build/C/man7/socket.7:478
8967 #, no-wrap
8968 msgid "B<SO_RCVBUF>"
8969 msgstr "B<SO_RCVBUF>"
8970
8971 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8972 #.  The following thread on LMKL is quite informative:
8973 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
8974 #.  17 July 2012
8975 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
8976 #. type: Plain text
8977 #: build/C/man7/socket.7:497
8978 msgid ""
8979 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
8980 "this value (to allow space for bookkeeping overhead)  when it is set using "
8981 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8982 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
8983 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
8984 "file.  The minimum (doubled) value for this option is 256."
8985 msgstr ""
8986 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
8987 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8988 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8989 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
8990 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
8991 "る。 このオプションの最小値は (2倍した値で) 256 である。"
8992
8993 #. type: TP
8994 #: build/C/man7/socket.7:497
8995 #, no-wrap
8996 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
8997 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
8998
8999 #. type: Plain text
9000 #: build/C/man7/socket.7:506
9001 msgid ""
9002 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9003 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9004 "overridden."
9005 msgstr ""
9006 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9007 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9008 "きすることができる。"
9009
9010 #. type: TP
9011 #: build/C/man7/socket.7:506
9012 #, no-wrap
9013 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9014 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9015
9016 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9017 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9018 #. type: Plain text
9019 #: build/C/man7/socket.7:535
9020 msgid ""
9021 "Specify the minimum number of bytes in the buffer until the socket layer "
9022 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9023 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9024 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9025 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9026 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9027 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9028 "single byte of data is available.  A subsequent read from the socket will "
9029 "block until B<SO_RCVLOWAT> bytes are available."
9030 msgstr ""
9031 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9032 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9033 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9034 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9035 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9036 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9037 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9038 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9039 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9040 "してしまう。"
9041
9042 #. type: TP
9043 #: build/C/man7/socket.7:535
9044 #, no-wrap
9045 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9046 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9047
9048 #.  Not implemented in 2.0.
9049 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9050 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9051 #.  in fact to EAGAIN
9052 #. type: Plain text
9053 #: build/C/man7/socket.7:570
9054 #, fuzzy
9055 #| msgid ""
9056 #| "Specify the receiving or sending timeouts until reporting an error.  The "
9057 #| "argument is a I<struct timeval>.  If an input or output function blocks "
9058 #| "for this period of time, and data has been sent or received, the return "
9059 #| "value of that function will be the amount of data transferred; if no data "
9060 #| "has been transferred and the timeout has been reached then -1 is returned "
9061 #| "with I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket "
9062 #| "was specified to be nonblocking.  If the timeout is set to zero (the "
9063 #| "default)  then the operation will never timeout.  Timeouts only have "
9064 #| "effect for system calls that perform socket I/O (e.g., B<read>(2), "
9065 #| "B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have no effect for "
9066 #| "B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9067 msgid ""
9068 "Specify the receiving or sending timeouts until reporting an error.  The "
9069 "argument is a I<struct timeval>.  If an input or output function blocks for "
9070 "this period of time, and data has been sent or received, the return value of "
9071 "that function will be the amount of data transferred; if no data has been "
9072 "transferred and the timeout has been reached then -1 is returned with "
9073 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9074 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9075 "the timeout is set to zero (the default)  then the operation will never "
9076 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9077 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9078 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9079 msgstr ""
9080 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9081 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9082 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9083 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9084 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> を設定され、 あたかもソケットに"
9085 "非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値であ"
9086 "る) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響"
9087 "を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), "
9088 "B<recvmsg>(2), B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>"
9089 "(2), B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
9090
9091 #. type: TP
9092 #: build/C/man7/socket.7:570
9093 #, no-wrap
9094 msgid "B<SO_REUSEADDR>"
9095 msgstr "B<SO_REUSEADDR>"
9096
9097 #. type: Plain text
9098 #: build/C/man7/socket.7:585
9099 msgid ""
9100 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9101 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9102 "this means that a socket may bind, except when there is an active listening "
9103 "socket bound to the address.  When the listening socket is bound to "
9104 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9105 "port for any local address.  Argument is an integer boolean flag."
9106 msgstr ""
9107 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9108 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9109 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9110 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9111 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9112 "ドできない。 引き数はブール整数のフラグである。"
9113
9114 #. type: TP
9115 #: build/C/man7/socket.7:585
9116 #, no-wrap
9117 msgid "B<SO_SNDBUF>"
9118 msgstr "B<SO_SNDBUF>"
9119
9120 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9121 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9122 #. type: Plain text
9123 #: build/C/man7/socket.7:601
9124 msgid ""
9125 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9126 "this value (to allow space for bookkeeping overhead)  when it is set using "
9127 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9128 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9129 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9130 "file.  The minimum (doubled) value for this option is 2048."
9131 msgstr ""
9132 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9133 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9134 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9135 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9136 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9137 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9138
9139 #. type: TP
9140 #: build/C/man7/socket.7:601
9141 #, no-wrap
9142 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9143 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9144
9145 #. type: Plain text
9146 #: build/C/man7/socket.7:610
9147 msgid ""
9148 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9149 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9150 "overridden."
9151 msgstr ""
9152 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9153 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9154 "きすることができる。"
9155
9156 #. type: TP
9157 #: build/C/man7/socket.7:610
9158 #, no-wrap
9159 msgid "B<SO_TIMESTAMP>"
9160 msgstr "B<SO_TIMESTAMP>"
9161
9162 #. type: Plain text
9163 #: build/C/man7/socket.7:626
9164 msgid ""
9165 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9166 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9167 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9168 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9169 "details on control messages."
9170 msgstr ""
9171 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9172 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9173 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9174 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9175
9176 #. type: TP
9177 #: build/C/man7/socket.7:626
9178 #, no-wrap
9179 msgid "B<SO_TYPE>"
9180 msgstr "B<SO_TYPE>"
9181
9182 #. type: Plain text
9183 #: build/C/man7/socket.7:631
9184 msgid ""
9185 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9186 "option is read-only."
9187 msgstr ""
9188 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9189 "このソケットオプションは読み出し専用である。"
9190
9191 #. type: SS
9192 #: build/C/man7/socket.7:631
9193 #, no-wrap
9194 msgid "Signals"
9195 msgstr "シグナル"
9196
9197 #. type: Plain text
9198 #: build/C/man7/socket.7:642
9199 msgid ""
9200 "When writing onto a connection-oriented socket that has been shut down (by "
9201 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9202 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9203 "the B<MSG_NOSIGNAL> flag."
9204 msgstr ""
9205 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9206 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9207 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9208 "していた場合はシグナルは送られない。"
9209
9210 #. type: Plain text
9211 #: build/C/man7/socket.7:667
9212 msgid ""
9213 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9214 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9215 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9216 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9217 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9218 "signal will be called with the file descriptor in the I<si_fd> field of its "
9219 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9220 msgstr ""
9221 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9222 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9223 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9224 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9225 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9226 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9227 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9228 "を参照のこと。"
9229
9230 #.  .SS Ancillary messages
9231 #. type: Plain text
9232 #: build/C/man7/socket.7:675
9233 msgid ""
9234 "Under some circumstances (e.g., multiple processes accessing a single "
9235 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9236 "when the process reacts to the signal.  If this happens, the process should "
9237 "wait again because Linux will resend the signal later."
9238 msgstr ""
9239 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9240 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9241 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9242 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9243
9244 #. type: SS
9245 #: build/C/man7/socket.7:675
9246 #, no-wrap
9247 msgid "/proc interfaces"
9248 msgstr "/proc インタフェース"
9249
9250 #. type: Plain text
9251 #: build/C/man7/socket.7:679
9252 msgid ""
9253 "The core socket networking parameters can be accessed via files in the "
9254 "directory I</proc/sys/net/core/>."
9255 msgstr ""
9256 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9257 "レクトリ内のファイルを通してアクセスできる。"
9258
9259 #. type: TP
9260 #: build/C/man7/socket.7:679
9261 #, no-wrap
9262 msgid "I<rmem_default>"
9263 msgstr "I<rmem_default>"
9264
9265 #. type: Plain text
9266 #: build/C/man7/socket.7:682
9267 msgid "contains the default setting in bytes of the socket receive buffer."
9268 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9269
9270 #. type: TP
9271 #: build/C/man7/socket.7:682
9272 #, no-wrap
9273 msgid "I<rmem_max>"
9274 msgstr "I<rmem_max>"
9275
9276 #. type: Plain text
9277 #: build/C/man7/socket.7:688
9278 msgid ""
9279 "contains the maximum socket receive buffer size in bytes which a user may "
9280 "set by using the B<SO_RCVBUF> socket option."
9281 msgstr ""
9282 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9283 "ファサイズの最大値 (バイト単位)。"
9284
9285 #. type: TP
9286 #: build/C/man7/socket.7:688
9287 #, no-wrap
9288 msgid "I<wmem_default>"
9289 msgstr "I<wmem_default>"
9290
9291 #. type: Plain text
9292 #: build/C/man7/socket.7:691
9293 msgid "contains the default setting in bytes of the socket send buffer."
9294 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9295
9296 #. type: TP
9297 #: build/C/man7/socket.7:691
9298 #, no-wrap
9299 msgid "I<wmem_max>"
9300 msgstr "I<wmem_max>"
9301
9302 #. type: Plain text
9303 #: build/C/man7/socket.7:697
9304 msgid ""
9305 "contains the maximum socket send buffer size in bytes which a user may set "
9306 "by using the B<SO_SNDBUF> socket option."
9307 msgstr ""
9308 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9309 "ファサイズの最大値 (バイト単位)。"
9310
9311 #. type: TP
9312 #: build/C/man7/socket.7:697
9313 #, no-wrap
9314 msgid "I<message_cost> and I<message_burst>"
9315 msgstr "I<message_cost> と I<message_burst>"
9316
9317 #. type: Plain text
9318 #: build/C/man7/socket.7:701
9319 msgid ""
9320 "configure the token bucket filter used to load limit warning messages caused "
9321 "by external network events."
9322 msgstr ""
9323 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9324 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9325
9326 #. type: TP
9327 #: build/C/man7/socket.7:701
9328 #, no-wrap
9329 msgid "I<netdev_max_backlog>"
9330 msgstr "I<netdev_max_backlog>"
9331
9332 #. type: Plain text
9333 #: build/C/man7/socket.7:704
9334 msgid "Maximum number of packets in the global input queue."
9335 msgstr "グローバルな入力キューにおける最大のパケット数。"
9336
9337 #. type: TP
9338 #: build/C/man7/socket.7:704
9339 #, no-wrap
9340 msgid "I<optmem_max>"
9341 msgstr "I<optmem_max>"
9342
9343 #.  netdev_fastroute is not documented because it is experimental
9344 #. type: Plain text
9345 #: build/C/man7/socket.7:709
9346 msgid ""
9347 "Maximum length of ancillary data and user control data like the iovecs per "
9348 "socket."
9349 msgstr ""
9350 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9351 "うなもの) との和の最大長。"
9352
9353 #. type: SS
9354 #: build/C/man7/socket.7:709
9355 #, no-wrap
9356 msgid "Ioctls"
9357 msgstr "ioctl"
9358
9359 #. type: Plain text
9360 #: build/C/man7/socket.7:712
9361 msgid "These operations can be accessed using B<ioctl>(2):"
9362 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9363
9364 #. type: Plain text
9365 #: build/C/man7/socket.7:716
9366 #, no-wrap
9367 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9368 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9369
9370 #. type: TP
9371 #: build/C/man7/socket.7:718
9372 #, no-wrap
9373 msgid "B<SIOCGSTAMP>"
9374 msgstr "B<SIOCGSTAMP>"
9375
9376 #. type: Plain text
9377 #: build/C/man7/socket.7:742
9378 msgid ""
9379 "Return a I<struct timeval> with the receive timestamp of the last packet "
9380 "passed to the user.  This is useful for accurate round trip time "
9381 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9382 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
9383 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9384 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9385 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9386 "to B<ENOENT>)."
9387 msgstr ""
9388 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9389 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9390 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9391 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9392 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9393 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9394 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9395 "セットする)。"
9396
9397 #. type: TP
9398 #: build/C/man7/socket.7:742
9399 #, no-wrap
9400 msgid "B<SIOCSPGRP>"
9401 msgstr "B<SIOCSPGRP>"
9402
9403 #. type: Plain text
9404 #: build/C/man7/socket.7:761
9405 msgid ""
9406 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9407 "when an asynchronous I/O operation has finished or urgent data is "
9408 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9409 "positive, send the signals to that process.  If the argument is negative, "
9410 "send the signals to the process group with the ID of the absolute value of "
9411 "the argument.  The process may only choose itself or its own process group "
9412 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9413 "UID of 0."
9414 msgstr ""
9415 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9416 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9417 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9418 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9419 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9420 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9421 "の場合は この限りではない。"
9422
9423 #. type: TP
9424 #: build/C/man7/socket.7:761
9425 #, no-wrap
9426 msgid "B<FIOASYNC>"
9427 msgstr "B<FIOASYNC>"
9428
9429 #. type: Plain text
9430 #: build/C/man7/socket.7:771
9431 msgid ""
9432 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9433 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9434 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9435 msgstr ""
9436 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9437 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9438 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9439
9440 #. type: Plain text
9441 #: build/C/man7/socket.7:779
9442 msgid ""
9443 "Argument is an integer boolean flag.  (This operation is synonymous with the "
9444 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
9445 msgstr ""
9446 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
9447 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9448
9449 #. type: TP
9450 #: build/C/man7/socket.7:779
9451 #, no-wrap
9452 msgid "B<SIOCGPGRP>"
9453 msgstr "B<SIOCGPGRP>"
9454
9455 #. type: Plain text
9456 #: build/C/man7/socket.7:788
9457 msgid ""
9458 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9459 "signals, or 0 when none is set."
9460 msgstr ""
9461 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9462 "る。 ない場合は 0 が返る。"
9463
9464 #. type: Plain text
9465 #: build/C/man7/socket.7:792
9466 msgid "Valid B<fcntl>(2)  operations:"
9467 msgstr "有効な B<fcntl>(2)  操作:"
9468
9469 #. type: TP
9470 #: build/C/man7/socket.7:792
9471 #, no-wrap
9472 msgid "B<FIOGETOWN>"
9473 msgstr "B<FIOGETOWN>"
9474
9475 #. type: Plain text
9476 #: build/C/man7/socket.7:797
9477 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9478 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
9479
9480 #. type: TP
9481 #: build/C/man7/socket.7:797
9482 #, no-wrap
9483 msgid "B<FIOSETOWN>"
9484 msgstr "B<FIOSETOWN>"
9485
9486 #. type: Plain text
9487 #: build/C/man7/socket.7:802
9488 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9489 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
9490
9491 #. type: Plain text
9492 #: build/C/man7/socket.7:816
9493 msgid ""
9494 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
9495 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
9496 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
9497 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9498 "be read or written."
9499 msgstr ""
9500 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9501 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9502 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9503 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9504 "はできなかった。"
9505
9506 #. type: Plain text
9507 #: build/C/man7/socket.7:821
9508 msgid ""
9509 "Linux assumes that half of the send/receive buffer is used for internal "
9510 "kernel structures; thus the values in the corresponding I</proc> files are "
9511 "twice what can be observed on the wire."
9512 msgstr ""
9513 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
9514 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
9515 "なる。"
9516
9517 #. type: Plain text
9518 #: build/C/man7/socket.7:834
9519 msgid ""
9520 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
9521 "option was set both in the previous program that performed a B<bind>(2)  to "
9522 "the port and in the program that wants to reuse the port.  This differs from "
9523 "some implementations (e.g., FreeBSD)  where only the later program needs to "
9524 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
9525 "since, for example, a server program is designed to always set this option."
9526 msgstr ""
9527 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
9528 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
9529 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
9530 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
9531 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
9532 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
9533 "このオプションをセットするように設計されるからである。"
9534
9535 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
9536 #.  .SH AUTHORS
9537 #.  This man page was written by Andi Kleen.
9538 #. type: Plain text
9539 #: build/C/man7/socket.7:847
9540 msgid ""
9541 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
9542 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
9543 "is via the libpcap library."
9544 msgstr ""
9545 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
9546 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
9547 "して 用いる方が良い。"
9548
9549 #. type: Plain text
9550 #: build/C/man7/socket.7:859
9551 #, fuzzy
9552 #| msgid ""
9553 #| "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), "
9554 #| "B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
9555 msgid ""
9556 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9557 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9558 "B<unix>(7)"
9559 msgstr ""
9560 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
9561 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
9562
9563 #. type: TH
9564 #: build/C/man2/socketcall.2:25
9565 #, no-wrap
9566 msgid "SOCKETCALL"
9567 msgstr "SOCKETCALL"
9568
9569 #. type: TH
9570 #: build/C/man2/socketcall.2:25
9571 #, fuzzy, no-wrap
9572 #| msgid "2010-10-06"
9573 msgid "2012-10-16"
9574 msgstr "2010-10-06"
9575
9576 #. type: Plain text
9577 #: build/C/man2/socketcall.2:28
9578 msgid "socketcall - socket system calls"
9579 msgstr "socketcall - ソケット・システムコール"
9580
9581 #. type: Plain text
9582 #: build/C/man2/socketcall.2:30
9583 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9584 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9585
9586 #. type: Plain text
9587 #: build/C/man2/socketcall.2:38
9588 msgid ""
9589 "B<socketcall>()  is a common kernel entry point for the socket system "
9590 "calls.  I<call> determines which socket function to invoke.  I<args> points "
9591 "to a block containing the actual arguments, which are passed through to the "
9592 "appropriate call."
9593 msgstr ""
9594 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
9595 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
9596 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
9597 "ロックを指す。"
9598
9599 #. type: Plain text
9600 #: build/C/man2/socketcall.2:42
9601 msgid ""
9602 "User programs should call the appropriate functions by their usual names.  "
9603 "Only standard library implementors and kernel hackers need to know about "
9604 "B<socketcall>()."
9605 msgstr ""
9606 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
9607 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
9608 "必要がある。"
9609
9610 #. type: Plain text
9611 #: build/C/man2/socketcall.2:45
9612 msgid ""
9613 "This call is specific to Linux, and should not be used in programs intended "
9614 "to be portable."
9615 msgstr ""
9616 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
9617 "い。"
9618
9619 #. type: Plain text
9620 #: build/C/man2/socketcall.2:53
9621 #, fuzzy
9622 #| msgid ""
9623 #| "On a few architectures, for example ia64, there is no B<socketcall>()  "
9624 #| "system call; instead B<socket>(2), B<accept>(2), B<bind>(2), and so on "
9625 #| "really are implemented as separate system calls."
9626 msgid ""
9627 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
9628 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
9629 "(2), and so on really are implemented as separate system calls."
9630 msgstr ""
9631 "ia64 などのいくつかのアーキテクチャでは、システムコール B<socketcall>()  が存"
9632 "在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2)  など"
9633 "が独立したシステムコールとして実装されている。"
9634
9635 #. type: Plain text
9636 #: build/C/man2/socketcall.2:71
9637 msgid ""
9638 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9639 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9640 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9641 "(2), B<socket>(2), B<socketpair>(2)"
9642 msgstr ""
9643 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9644 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9645 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9646 "(2), B<socket>(2), B<socketpair>(2)"
9647
9648 #. type: TH
9649 #: build/C/man2/socketpair.2:42
9650 #, no-wrap
9651 msgid "SOCKETPAIR"
9652 msgstr "SOCKETPAIR"
9653
9654 #. type: TH
9655 #: build/C/man2/socketpair.2:42
9656 #, no-wrap
9657 msgid "2008-10-11"
9658 msgstr "2008-10-11"
9659
9660 #. type: Plain text
9661 #: build/C/man2/socketpair.2:45
9662 msgid "socketpair - create a pair of connected sockets"
9663 msgstr "socketpair - 接続されたソケットのペアを作成する"
9664
9665 #. type: Plain text
9666 #: build/C/man2/socketpair.2:52
9667 msgid ""
9668 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9669 ">I<sv>B<[2]);>"
9670 msgstr ""
9671 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9672 ">I<sv>B<[2]);>"
9673
9674 #. type: Plain text
9675 #: build/C/man2/socketpair.2:63
9676 msgid ""
9677 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
9678 "the specified I<domain>, of the specified I<type>, and using the optionally "
9679 "specified I<protocol>.  For further details of these arguments, see B<socket>"
9680 "(2)."
9681 msgstr ""
9682 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
9683 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
9684 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
9685
9686 #. type: Plain text
9687 #: build/C/man2/socketpair.2:69
9688 msgid ""
9689 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
9690 "and I<sv>[1].  The two sockets are indistinguishable."
9691 msgstr ""
9692 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
9693 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
9694
9695 #. type: Plain text
9696 #: build/C/man2/socketpair.2:78
9697 msgid "The specified address family is not supported on this machine."
9698 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
9699
9700 #. type: Plain text
9701 #: build/C/man2/socketpair.2:83
9702 msgid ""
9703 "The address I<sv> does not specify a valid part of the process address space."
9704 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
9705
9706 #. type: Plain text
9707 #: build/C/man2/socketpair.2:86
9708 msgid "Too many descriptors are in use by this process."
9709 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
9710
9711 #. type: Plain text
9712 #: build/C/man2/socketpair.2:92
9713 msgid "The specified protocol does not support creation of socket pairs."
9714 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
9715
9716 #. type: Plain text
9717 #: build/C/man2/socketpair.2:95
9718 msgid "The specified protocol is not supported on this machine."
9719 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
9720
9721 #. type: Plain text
9722 #: build/C/man2/socketpair.2:103
9723 msgid ""
9724 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
9725 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
9726 "of the BSD socket layer (including System V variants)."
9727 msgstr ""
9728 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
9729 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
9730 "BSD 以外のシステムと、 互いに移植性がある。"
9731
9732 #. type: Plain text
9733 #: build/C/man2/socketpair.2:109
9734 msgid ""
9735 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
9736 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
9737 "restriction.)"
9738 msgstr ""
9739 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
9740 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
9741
9742 #. type: Plain text
9743 #: build/C/man2/socketpair.2:118
9744 msgid ""
9745 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
9746 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
9747 msgstr ""
9748 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
9749 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
9750
9751 #. type: Plain text
9752 #: build/C/man2/socketpair.2:131
9753 msgid ""
9754 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9755 msgstr ""
9756 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9757
9758 #~ msgid "2011-09-16"
9759 #~ msgstr "2011-09-16"
9760
9761 #~ msgid "B<MSG_WAITFORONE>"
9762 #~ msgstr "B<MSG_WAITFORONE>"
9763
9764 #~ msgid "2010-06-10"
9765 #~ msgstr "2010-06-10"
9766
9767 #~ msgid ""
9768 #~ "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
9769 #~ "Programmer's Supplementary Documents Volume 1.>"
9770 #~ msgstr ""
9771 #~ "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
9772 #~ "Supplementary Documents Volume 1> として再版された。"
9773
9774 #~ msgid "2007-06-28"
9775 #~ msgstr "2007-06-28"
9776
9777 #~ msgid "2011-10-04"
9778 #~ msgstr "2011-10-04"
9779
9780 #~ msgid "2010-08-31"
9781 #~ msgstr "2010-08-31"
9782
9783 #~ msgid "2010-06-13"
9784 #~ msgstr "2010-06-13"
9785
9786 #~ msgid "RETURN VALUES"
9787 #~ msgstr "RETURN VALUES"