OSDN Git Service

e2db8327d2aecd048680ef4f06268694710a7090
[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-08-15 19:32+0900\n"
10 "PO-Revision-Date: 2013-07-31 01:09+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:45 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:45
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:46
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 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
77
78 #. type: SH
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:48
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
89 #, no-wrap
90 msgid "SYNOPSIS"
91 msgstr "書式"
92
93 #. type: Plain text
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
95 #, no-wrap
96 msgid ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
102
103 #. type: Plain text
104 #: build/C/man2/accept.2:50
105 #, no-wrap
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
108
109 #. type: Plain text
110 #: build/C/man2/accept.2:53
111 #, no-wrap
112 msgid ""
113 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115 msgstr ""
116 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
118
119 #. type: Plain text
120 #: build/C/man2/accept.2:56
121 #, no-wrap
122 msgid ""
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
125 msgstr ""
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
128
129 #. type: SH
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:52
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "説明"
143
144 #. type: Plain text
145 #: build/C/man2/accept.2:72
146 msgid ""
147 "The B<accept>()  system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket.  The newly created socket is not in the listening "
152 "state.  The original socket I<sockfd> is unaffected by this call."
153 msgstr ""
154 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
158 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
159 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
160
161 #. type: Plain text
162 #: build/C/man2/accept.2:81
163 msgid ""
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
167 msgstr ""
168 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
170 "である。"
171
172 #. type: Plain text
173 #: build/C/man2/accept.2:99
174 msgid ""
175 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer.  The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2)  and the "
179 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
181 msgstr ""
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
183 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
184 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
185 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
186 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
187 "おくべきである。"
188
189 #. type: Plain text
190 #: build/C/man2/accept.2:107
191 msgid ""
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
195 msgstr ""
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
199
200 #. type: Plain text
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
202 msgid ""
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
205 "call."
206 msgstr ""
207 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
208 "る。\n"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
210 "される。"
211
212 #. type: Plain text
213 #: build/C/man2/accept.2:125
214 msgid ""
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
217 "present.  If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
219 "B<EWOULDBLOCK>."
220 msgstr ""
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
225
226 #. type: Plain text
227 #: build/C/man2/accept.2:139
228 msgid ""
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>()  to get a socket "
232 "for that connection.  Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
234 msgstr ""
235 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
240
241 #. type: Plain text
242 #: build/C/man2/accept.2:152
243 msgid ""
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation.  Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket.  Currently only DECNet has these "
249 "semantics on Linux."
250 msgstr ""
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
257
258 #. type: Plain text
259 #: build/C/man2/accept.2:162
260 msgid ""
261 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
263 "behavior:"
264 msgstr ""
265 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
267 "できる。"
268
269 #. type: TP
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2:164
271 #, no-wrap
272 msgid "B<SOCK_NONBLOCK>"
273 msgstr "B<SOCK_NONBLOCK>"
274
275 #. type: Plain text
276 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
277 msgid ""
278 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
279 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
280 msgstr ""
281 "新しく生成されるオープンファイル記述 (open file description) の "
282 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
283 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
284 "なる。"
285
286 #. type: TP
287 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
288 #, no-wrap
289 msgid "B<SOCK_CLOEXEC>"
290 msgstr "B<SOCK_CLOEXEC>"
291
292 #. type: Plain text
293 #: build/C/man2/accept.2:180 build/C/man2/socket.2:182
294 msgid ""
295 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
296 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
297 "may be useful."
298 msgstr ""
299 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
300 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
301 "B<O_CLOEXEC> フラグの説明を参照のこと。"
302
303 #. type: SH
304 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
305 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
306 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
307 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
308 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
309 #: build/C/man2/recv.2:388 build/C/man2/recvmmsg.2:149
310 #: build/C/man2/select.2:289 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:314
313 #: build/C/man2/socketpair.2:69
314 #, no-wrap
315 msgid "RETURN VALUE"
316 msgstr "返り値"
317
318 #. type: Plain text
319 #: build/C/man2/accept.2:187
320 msgid ""
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
323 "is set appropriately."
324 msgstr ""
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
326 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
327 "定する。"
328
329 #. type: SS
330 #: build/C/man2/accept.2:187
331 #, no-wrap
332 msgid "Error handling"
333 msgstr "エラー処理"
334
335 #. type: Plain text
336 #: build/C/man2/accept.2:214
337 msgid ""
338 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
339 "on the new socket as an error code from B<accept>().  This behavior differs "
340 "from other BSD socket implementations.  For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
345 msgstr ""
346 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
353 "B<ENETUNREACH>"
354
355 #. type: SH
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:396 build/C/man2/recvmmsg.2:157
362 #: build/C/man2/select.2:306 build/C/man2/send.2:280
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:319 build/C/man2/socketpair.2:74
365 #, no-wrap
366 msgid "ERRORS"
367 msgstr "エラー"
368
369 #. type: TP
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:401 build/C/man2/send.2:296
371 #, no-wrap
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
374
375 #.  Actually EAGAIN on Linux
376 #. type: Plain text
377 #: build/C/man2/accept.2:223
378 msgid ""
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
383 msgstr ""
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
388
389 #. type: TP
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:165
391 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
393 #: build/C/man2/recv.2:410 build/C/man2/select.2:307 build/C/man2/send.2:304
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプタが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:191
417 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:419
419 #: build/C/man2/send.2:313 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:203
432 #: build/C/man2/recv.2:423 build/C/man2/select.2:312 build/C/man2/send.2:316
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:169
448 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:428
450 #: build/C/man2/recvmmsg.2:161 build/C/man2/select.2:316
451 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:63
452 #: build/C/man2/socket.2:327 build/C/man2/socket.2:330
453 #, no-wrap
454 msgid "B<EINVAL>"
455 msgstr "B<EINVAL>"
456
457 #. type: Plain text
458 #: build/C/man2/accept.2:244
459 msgid ""
460 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
461 "negative)."
462 msgstr ""
463 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
464 "負の場合など)。"
465
466 #. type: Plain text
467 #: build/C/man2/accept.2:249
468 msgid "(B<accept4>())  invalid value in I<flags>."
469 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
470
471 #. type: TP
472 #: build/C/man2/accept.2:249 build/C/man2/socket.2:335
473 #: build/C/man2/socketpair.2:83
474 #, no-wrap
475 msgid "B<EMFILE>"
476 msgstr "B<EMFILE>"
477
478 #. type: Plain text
479 #: build/C/man2/accept.2:252
480 msgid "The per-process limit of open file descriptors has been reached."
481 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
482
483 #. type: TP
484 #: build/C/man2/accept.2:252 build/C/man2/socket.2:338
485 #: build/C/man2/socketpair.2:86
486 #, no-wrap
487 msgid "B<ENFILE>"
488 msgstr "B<ENFILE>"
489
490 #. type: Plain text
491 #: build/C/man2/accept.2:255 build/C/man2/socket.2:341
492 #: build/C/man2/socketpair.2:89
493 msgid "The system limit on the total number of open files has been reached."
494 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
495
496 #. type: TP
497 #: build/C/man2/accept.2:255
498 #, no-wrap
499 msgid "B<ENOBUFS>, B<ENOMEM>"
500 msgstr "B<ENOBUFS>, B<ENOMEM>"
501
502 #. type: Plain text
503 #: build/C/man2/accept.2:260
504 msgid ""
505 "Not enough free memory.  This often means that the memory allocation is "
506 "limited by the socket buffer limits, not by the system memory."
507 msgstr ""
508 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
509 "ケットバッファの大きさによるメモリ割り当ての制限である。"
510
511 #. type: TP
512 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
513 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
515 #: build/C/man2/recv.2:443 build/C/man2/send.2:349
516 #, no-wrap
517 msgid "B<ENOTSOCK>"
518 msgstr "B<ENOTSOCK>"
519
520 #. type: Plain text
521 #: build/C/man2/accept.2:263
522 msgid "The descriptor references a file, not a socket."
523 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
524
525 #. type: TP
526 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
527 #: build/C/man2/socketpair.2:89
528 #, no-wrap
529 msgid "B<EOPNOTSUPP>"
530 msgstr "B<EOPNOTSUPP>"
531
532 #. type: Plain text
533 #: build/C/man2/accept.2:267
534 msgid "The referenced socket is not of type B<SOCK_STREAM>."
535 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
536
537 #. type: TP
538 #: build/C/man2/accept.2:267
539 #, no-wrap
540 msgid "B<EPROTO>"
541 msgstr "B<EPROTO>"
542
543 #. type: Plain text
544 #: build/C/man2/accept.2:270
545 msgid "Protocol error."
546 msgstr "プロトコル・エラー。"
547
548 #. type: Plain text
549 #: build/C/man2/accept.2:274
550 msgid "In addition, Linux B<accept>()  may fail if:"
551 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
552
553 #. type: TP
554 #: build/C/man2/accept.2:274
555 #, no-wrap
556 msgid "B<EPERM>"
557 msgstr "B<EPERM>"
558
559 #. type: Plain text
560 #: build/C/man2/accept.2:277
561 msgid "Firewall rules forbid connection."
562 msgstr "ファイアウォールのルールにより接続が禁止された。"
563
564 #. type: Plain text
565 #: build/C/man2/accept.2:289
566 msgid ""
567 "In addition, network errors for the new socket and as defined for the "
568 "protocol may be returned.  Various Linux kernels can return other errors "
569 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
570 "value B<ERESTARTSYS> may be seen during a trace."
571 msgstr ""
572 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
573 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
574 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
575 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
576 "ともある。"
577
578 #. type: SH
579 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
580 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:165
581 #: build/C/man2/select.2:325 build/C/man2/sendmmsg.2:145
582 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:868
583 #, no-wrap
584 msgid "VERSIONS"
585 msgstr "バージョン"
586
587 #. type: Plain text
588 #: build/C/man2/accept.2:294
589 msgid ""
590 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
591 "support in glibc is available starting with version 2.10."
592 msgstr ""
593 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
594 "サポートはバージョン 2.10 以降で利用可能である。"
595
596 #. type: SH
597 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:225
599 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
600 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
601 #: build/C/man3/if_nametoindex.3:85 build/C/man2/listen.2:106
602 #: build/C/man2/recv.2:448 build/C/man2/recvmmsg.2:170
603 #: build/C/man2/select.2:331 build/C/man2/send.2:368
604 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:73
605 #: build/C/man2/socket.2:352 build/C/man2/socketcall.2:42
606 #: build/C/man2/socketpair.2:95
607 #, no-wrap
608 msgid "CONFORMING TO"
609 msgstr "準拠"
610
611 #.  The BSD man page documents five possible error returns
612 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
613 #.  POSIX.1-2001 documents errors
614 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
615 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
616 #.  In addition, SUSv2 documents EFAULT and ENOSR.
617 #. type: Plain text
618 #: build/C/man2/accept.2:306
619 msgid ""
620 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
621 "4.2BSD)."
622 msgstr ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
624 "された)."
625
626 #. type: Plain text
627 #: build/C/man2/accept.2:309
628 msgid "B<accept4>()  is a nonstandard Linux extension."
629 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
630
631 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
632 #.  do not inherit file status flags -- MTK Jun 05
633 #. type: Plain text
634 #: build/C/man2/accept.2:324
635 msgid ""
636 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
637 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
638 "socket.  This behavior differs from the canonical BSD sockets "
639 "implementation.  Portable programs should not rely on inheritance or "
640 "noninheritance of file status flags and always explicitly set all required "
641 "flags on the socket returned from B<accept>()."
642 msgstr ""
643 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
644 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
645 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
646 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
647 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
648 "である。"
649
650 #. type: SH
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:241
653 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
654 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
655 #: build/C/man2/recv.2:458 build/C/man2/select.2:346
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
657 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:75
658 #: build/C/man2/socket.2:366 build/C/man7/socket.7:882
659 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
660 #, no-wrap
661 msgid "NOTES"
662 msgstr "注意"
663
664 #. type: Plain text
665 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
666 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:137 build/C/man2/socket.2:372
668 #: build/C/man2/socketpair.2:124
669 msgid ""
670 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
671 "this header file is not required on Linux.  However, some historical (BSD) "
672 "implementations required this header file, and portable applications are "
673 "probably wise to include it."
674 msgstr ""
675 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
676 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
677 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
678 "ションではこのファイルを インクルードするのが賢明であろう。"
679
680 #. type: Plain text
681 #: build/C/man2/accept.2:351
682 msgid ""
683 "There may not always be a connection waiting after a B<SIGIO> is delivered "
684 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
685 "connection might have been removed by an asynchronous network error or "
686 "another thread before B<accept>()  is called.  If this happens then the call "
687 "will block waiting for the next connection to arrive.  To ensure that "
688 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
689 "B<O_NONBLOCK> flag set (see B<socket>(7))."
690 msgstr ""
691 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
692 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
693 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
694 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
695 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
696 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
697 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
698 "見よ)。"
699
700 #. type: SS
701 #: build/C/man2/accept.2:351
702 #, no-wrap
703 msgid "The socklen_t type"
704 msgstr "socklen_t 型"
705
706 #. type: Plain text
707 #: build/C/man2/accept.2:361
708 msgid ""
709 "The third argument of B<accept>()  was originally declared as an I<int *> "
710 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
711 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
712 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
713 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
714 "Torvalds:"
715 msgstr ""
716 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
717 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
718 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
719 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
720 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
721 "た。 Linus Torvald の発言を引用する:"
722
723 #.  .I fails: only italicizes a single line
724 #. type: Plain text
725 #: build/C/man2/accept.2:378
726 msgid ""
727 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
728 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
729 "make it a size_t, and I (and hopefully others, but obviously not too many) "
730 "complained to them very loudly indeed.  Making it a size_t is completely "
731 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
732 "bit architectures, for example.  And it I<has> to be the same size as \"int"
733 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
734 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
735 "have touched it in the first place, but once they did they felt it had to "
736 "have a named type for some unfathomable reason (probably somebody didn't "
737 "like losing face over having done the original stupid thing, so they "
738 "silently just renamed their blunder).\""
739 msgstr ""
740 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
741 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
742 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
743 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
744 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
745 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
746 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
747 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
748 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
749 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
750 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
751 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
752 "う)。」"
753
754 #. type: SH
755 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
756 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
757 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
758 #: build/C/man2/recv.2:493 build/C/man2/recvmmsg.2:173
759 #: build/C/man2/select.2:537 build/C/man2/select_tut.2:529
760 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
761 #: build/C/man3/sockatmark.3:99 build/C/man2/socket.2:385
762 #, no-wrap
763 msgid "EXAMPLE"
764 msgstr "例"
765
766 #. type: Plain text
767 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
768 msgid "See B<bind>(2)."
769 msgstr "B<bind>(2)  参照。"
770
771 #. type: SH
772 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
773 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:263
774 #: build/C/man3/getifaddrs.3:290 build/C/man2/getsockname.2:114
775 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:146
776 #: build/C/man3/if_nametoindex.3:89 build/C/man2/listen.2:169
777 #: build/C/man2/recv.2:498 build/C/man2/recvmmsg.2:268
778 #: build/C/man2/select.2:574 build/C/man2/select_tut.2:819
779 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
780 #: build/C/man3/sockatmark.3:134 build/C/man2/socket.2:390
781 #: build/C/man7/socket.7:913 build/C/man2/socketcall.2:53
782 #: build/C/man2/socketpair.2:124
783 #, no-wrap
784 msgid "SEE ALSO"
785 msgstr "関連項目"
786
787 #. type: Plain text
788 #: build/C/man2/accept.2:388
789 msgid ""
790 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
791 "B<socket>(7)"
792 msgstr ""
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<socket>(7)"
795
796 #. type: SH
797 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
798 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:270
799 #: build/C/man3/getifaddrs.3:296 build/C/man2/getsockname.2:121
800 #: build/C/man2/getsockopt.2:210 build/C/man3/if_nameindex.3:153
801 #: build/C/man3/if_nametoindex.3:93 build/C/man2/listen.2:175
802 #: build/C/man2/recv.2:509 build/C/man2/recvmmsg.2:275
803 #: build/C/man2/select.2:588 build/C/man2/select_tut.2:838
804 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
805 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:419
806 #: build/C/man7/socket.7:925 build/C/man2/socketcall.2:71
807 #: build/C/man2/socketpair.2:131
808 #, no-wrap
809 msgid "COLOPHON"
810 msgstr "この文書について"
811
812 #. type: Plain text
813 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
814 #: build/C/man3/bindresvport.3:123 build/C/man2/connect.2:277
815 #: build/C/man3/getifaddrs.3:303 build/C/man2/getsockname.2:128
816 #: build/C/man2/getsockopt.2:217 build/C/man3/if_nameindex.3:160
817 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:182
818 #: build/C/man2/recv.2:516 build/C/man2/recvmmsg.2:282
819 #: build/C/man2/select.2:595 build/C/man2/select_tut.2:845
820 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
821 #: build/C/man3/sockatmark.3:146 build/C/man2/socket.2:426
822 #: build/C/man7/socket.7:932 build/C/man2/socketcall.2:78
823 #: build/C/man2/socketpair.2:138
824 #, fuzzy
825 #| msgid ""
826 #| "This page is part of release 3.52 of the Linux I<man-pages> project.  A "
827 #| "description of the project, and information about reporting bugs, can be "
828 #| "found at \\%http://www.kernel.org/doc/man-pages/."
829 msgid ""
830 "This page is part of release 3.53 of the Linux I<man-pages> project.  A "
831 "description of the project, and information about reporting bugs, can be "
832 "found at \\%http://www.kernel.org/doc/man-pages/."
833 msgstr ""
834 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.52 の一部\n"
835 "である。プロジェクトの説明とバグ報告に関する情報は\n"
836 "http://www.kernel.org/doc/man-pages/ に書かれている。"
837
838 #. type: TH
839 #: build/C/man2/bind.2:68
840 #, no-wrap
841 msgid "BIND"
842 msgstr "BIND"
843
844 #. type: TH
845 #: build/C/man2/bind.2:68
846 #, no-wrap
847 msgid "2007-12-28"
848 msgstr "2007-12-28"
849
850 #. type: Plain text
851 #: build/C/man2/bind.2:71
852 msgid "bind - bind a name to a socket"
853 msgstr "bind - ソケットに名前をつける"
854
855 #. type: Plain text
856 #: build/C/man2/bind.2:78
857 #, no-wrap
858 msgid ""
859 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
860 "B<         socklen_t >I<addrlen>B<);>\n"
861 msgstr ""
862 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
863 "B<         socklen_t >I<addrlen>B<);>\n"
864
865 #. type: Plain text
866 #: build/C/man2/bind.2:92
867 msgid ""
868 "When a socket is created with B<socket>(2), it exists in a name space "
869 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
870 "address specified by I<addr> to the socket referred to by the file "
871 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
872 "address structure pointed to by I<addr>.  Traditionally, this operation is "
873 "called \\(lqassigning a name to a socket\\(rq."
874 msgstr ""
875 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
876 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
877 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
878 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
879 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
880 "る。"
881
882 #. type: Plain text
883 #: build/C/man2/bind.2:99
884 msgid ""
885 "It is normally necessary to assign a local address using B<bind>()  before a "
886 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
887 msgstr ""
888 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
889 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
890 "る。"
891
892 #. type: Plain text
893 #: build/C/man2/bind.2:130
894 msgid ""
895 "The rules used in name binding vary between address families.  Consult the "
896 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
897 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
898 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
899 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
900 msgstr ""
901 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
902 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
903 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
904 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
905 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
906
907 #. type: Plain text
908 #: build/C/man2/bind.2:137
909 msgid ""
910 "The actual structure passed for the I<addr> argument will depend on the "
911 "address family.  The I<sockaddr> structure is defined as something like:"
912 msgstr ""
913 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
914 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
915
916 #. type: Plain text
917 #: build/C/man2/bind.2:144
918 #, no-wrap
919 msgid ""
920 "struct sockaddr {\n"
921 "    sa_family_t sa_family;\n"
922 "    char        sa_data[14];\n"
923 "}\n"
924 msgstr ""
925 "struct sockaddr {\n"
926 "    sa_family_t sa_family;\n"
927 "    char        sa_data[14];\n"
928 "}\n"
929
930 #. type: Plain text
931 #: build/C/man2/bind.2:152
932 msgid ""
933 "The only purpose of this structure is to cast the structure pointer passed "
934 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
935 msgstr ""
936 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
937 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
938
939 #. type: Plain text
940 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
941 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
942 #: build/C/man2/socketpair.2:74
943 msgid ""
944 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
945 "appropriately."
946 msgstr ""
947 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
948 "設定される。"
949
950 #. type: TP
951 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
952 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
953 #: build/C/man2/send.2:285 build/C/man2/socket.2:320
954 #, no-wrap
955 msgid "B<EACCES>"
956 msgstr "B<EACCES>"
957
958 #.  e.g., privileged port in AF_INET domain
959 #. type: Plain text
960 #: build/C/man2/bind.2:162
961 msgid "The address is protected, and the user is not the superuser."
962 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
963
964 #. type: TP
965 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
966 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
967 #, no-wrap
968 msgid "B<EADDRINUSE>"
969 msgstr "B<EADDRINUSE>"
970
971 #. type: Plain text
972 #: build/C/man2/bind.2:165
973 msgid "The given address is already in use."
974 msgstr "指定されたアドレスが既に使用中である。"
975
976 #. type: Plain text
977 #: build/C/man2/bind.2:169
978 msgid "I<sockfd> is not a valid descriptor."
979 msgstr "I<sockfd> が不正なディスクリプタである。"
980
981 #.  This may change in the future: see
982 #.  .I linux/unix/sock.c for details.
983 #. type: Plain text
984 #: build/C/man2/bind.2:174
985 msgid "The socket is already bound to an address."
986 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
987
988 #. type: Plain text
989 #: build/C/man2/bind.2:178
990 msgid "I<sockfd> is a descriptor for a file, not a socket."
991 msgstr ""
992 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
993
994 #. type: Plain text
995 #: build/C/man2/bind.2:182
996 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
997 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
998
999 #. type: Plain text
1000 #: build/C/man2/bind.2:187
1001 msgid ""
1002 "Search permission is denied on a component of the path prefix.  (See also "
1003 "B<path_resolution>(7).)"
1004 msgstr ""
1005 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1006 "(7)  も参照すること)。"
1007
1008 #. type: TP
1009 #: build/C/man2/bind.2:187
1010 #, no-wrap
1011 msgid "B<EADDRNOTAVAIL>"
1012 msgstr "B<EADDRNOTAVAIL>"
1013
1014 #. type: Plain text
1015 #: build/C/man2/bind.2:191
1016 msgid ""
1017 "A nonexistent interface was requested or the requested address was not local."
1018 msgstr ""
1019 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1020 "かった。"
1021
1022 #. type: Plain text
1023 #: build/C/man2/bind.2:195
1024 msgid "I<addr> points outside the user's accessible address space."
1025 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1026
1027 #. type: Plain text
1028 #: build/C/man2/bind.2:202
1029 msgid ""
1030 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1031 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1032
1033 #. type: TP
1034 #: build/C/man2/bind.2:202
1035 #, no-wrap
1036 msgid "B<ELOOP>"
1037 msgstr "B<ELOOP>"
1038
1039 #. type: Plain text
1040 #: build/C/man2/bind.2:206
1041 msgid "Too many symbolic links were encountered in resolving I<addr>."
1042 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1043
1044 #. type: TP
1045 #: build/C/man2/bind.2:206
1046 #, no-wrap
1047 msgid "B<ENAMETOOLONG>"
1048 msgstr "B<ENAMETOOLONG>"
1049
1050 #. type: Plain text
1051 #: build/C/man2/bind.2:210
1052 msgid "I<addr> is too long."
1053 msgstr "I<addr> が長過ぎる。"
1054
1055 #. type: TP
1056 #: build/C/man2/bind.2:210
1057 #, no-wrap
1058 msgid "B<ENOENT>"
1059 msgstr "B<ENOENT>"
1060
1061 #. type: Plain text
1062 #: build/C/man2/bind.2:213
1063 msgid "The file does not exist."
1064 msgstr "ファイルが存在しない。"
1065
1066 #. type: TP
1067 #: build/C/man2/bind.2:213 build/C/man2/recv.2:432 build/C/man2/select.2:322
1068 #: build/C/man2/send.2:343
1069 #, no-wrap
1070 msgid "B<ENOMEM>"
1071 msgstr "B<ENOMEM>"
1072
1073 #. type: Plain text
1074 #: build/C/man2/bind.2:216
1075 msgid "Insufficient kernel memory was available."
1076 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1077
1078 #. type: TP
1079 #: build/C/man2/bind.2:216
1080 #, no-wrap
1081 msgid "B<ENOTDIR>"
1082 msgstr "B<ENOTDIR>"
1083
1084 #. type: Plain text
1085 #: build/C/man2/bind.2:219
1086 msgid "A component of the path prefix is not a directory."
1087 msgstr "パス名の構成要素がディレクトリではない。"
1088
1089 #. type: TP
1090 #: build/C/man2/bind.2:219
1091 #, no-wrap
1092 msgid "B<EROFS>"
1093 msgstr "B<EROFS>"
1094
1095 #. type: Plain text
1096 #: build/C/man2/bind.2:222
1097 msgid "The socket inode would reside on a read-only file system."
1098 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1099
1100 #.  SVr4 documents an additional
1101 #.  .B ENOSR
1102 #.  general error condition, and
1103 #.  additional
1104 #.  .B EIO
1105 #.  and
1106 #.  .B EISDIR
1107 #.  UNIX-domain error conditions.
1108 #. type: Plain text
1109 #: build/C/man2/bind.2:234
1110 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1111 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1112
1113 #. type: Plain text
1114 #: build/C/man2/bind.2:251
1115 msgid ""
1116 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1117 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1118 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1119 msgstr ""
1120 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1121 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1122 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1123
1124 #. type: SH
1125 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1126 #: build/C/man2/select.2:474 build/C/man2/send.2:414
1127 #: build/C/man3/sockatmark.3:95 build/C/man7/socket.7:900
1128 #, no-wrap
1129 msgid "BUGS"
1130 msgstr "バグ"
1131
1132 #.  FIXME What *are* transparent proxy options?
1133 #. type: Plain text
1134 #: build/C/man2/bind.2:254
1135 msgid "The transparent proxy options are not described."
1136 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1137
1138 #. type: Plain text
1139 #: build/C/man2/bind.2:259
1140 msgid ""
1141 "An example of the use of B<bind>()  with Internet domain sockets can be "
1142 "found in B<getaddrinfo>(3)."
1143 msgstr ""
1144 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1145 "(3)  に記載されている。"
1146
1147 #.  listen.7 refers to this example.
1148 #.  accept.7 refers to this example.
1149 #.  unix.7 refers to this example.
1150 #. type: Plain text
1151 #: build/C/man2/bind.2:266
1152 msgid ""
1153 "The following example shows how to bind a stream socket in the UNIX "
1154 "(B<AF_UNIX>)  domain, and accept connections:"
1155 msgstr ""
1156 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1157 "を示したものである。"
1158
1159 #. type: Plain text
1160 #: build/C/man2/bind.2:273
1161 #, no-wrap
1162 msgid ""
1163 "#include E<lt>sys/socket.hE<gt>\n"
1164 "#include E<lt>sys/un.hE<gt>\n"
1165 "#include E<lt>stdlib.hE<gt>\n"
1166 "#include E<lt>stdio.hE<gt>\n"
1167 "#include E<lt>string.hE<gt>\n"
1168 msgstr ""
1169 "#include E<lt>sys/socket.hE<gt>\n"
1170 "#include E<lt>sys/un.hE<gt>\n"
1171 "#include E<lt>stdlib.hE<gt>\n"
1172 "#include E<lt>stdio.hE<gt>\n"
1173 "#include E<lt>string.hE<gt>\n"
1174
1175 #. type: Plain text
1176 #: build/C/man2/bind.2:276
1177 #, no-wrap
1178 msgid ""
1179 "#define MY_SOCK_PATH \"/somepath\"\n"
1180 "#define LISTEN_BACKLOG 50\n"
1181 msgstr ""
1182 "#define MY_SOCK_PATH \"/somepath\"\n"
1183 "#define LISTEN_BACKLOG 50\n"
1184
1185 #. type: Plain text
1186 #: build/C/man2/bind.2:279
1187 #, no-wrap
1188 msgid ""
1189 "#define handle_error(msg) \\e\n"
1190 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1191 msgstr ""
1192 "#define handle_error(msg) \\e\n"
1193 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1194
1195 #. type: Plain text
1196 #: build/C/man2/bind.2:286
1197 #, no-wrap
1198 msgid ""
1199 "int\n"
1200 "main(int argc, char *argv[])\n"
1201 "{\n"
1202 "    int sfd, cfd;\n"
1203 "    struct sockaddr_un my_addr, peer_addr;\n"
1204 "    socklen_t peer_addr_size;\n"
1205 msgstr ""
1206 "int\n"
1207 "main(int argc, char *argv[])\n"
1208 "{\n"
1209 "    int sfd, cfd;\n"
1210 "    struct sockaddr_un my_addr, peer_addr;\n"
1211 "    socklen_t peer_addr_size;\n"
1212
1213 #. type: Plain text
1214 #: build/C/man2/bind.2:290
1215 #, no-wrap
1216 msgid ""
1217 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1218 "    if (sfd == -1)\n"
1219 "        handle_error(\"socket\");\n"
1220 msgstr ""
1221 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1222 "    if (sfd == -1)\n"
1223 "        handle_error(\"socket\");\n"
1224
1225 #. type: Plain text
1226 #: build/C/man2/bind.2:296
1227 #, no-wrap
1228 msgid ""
1229 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1230 "                        /* Clear structure */\n"
1231 "    my_addr.sun_family = AF_UNIX;\n"
1232 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1233 "            sizeof(my_addr.sun_path) - 1);\n"
1234 msgstr ""
1235 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1236 "                        /* Clear structure */\n"
1237 "    my_addr.sun_family = AF_UNIX;\n"
1238 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1239 "            sizeof(my_addr.sun_path) - 1);\n"
1240
1241 #. type: Plain text
1242 #: build/C/man2/bind.2:300
1243 #, no-wrap
1244 msgid ""
1245 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1246 "            sizeof(struct sockaddr_un)) == -1)\n"
1247 "        handle_error(\"bind\");\n"
1248 msgstr ""
1249 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1250 "            sizeof(struct sockaddr_un)) == -1)\n"
1251 "        handle_error(\"bind\");\n"
1252
1253 #. type: Plain text
1254 #: build/C/man2/bind.2:303
1255 #, no-wrap
1256 msgid ""
1257 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1258 "        handle_error(\"listen\");\n"
1259 msgstr ""
1260 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1261 "        handle_error(\"listen\");\n"
1262
1263 #. type: Plain text
1264 #: build/C/man2/bind.2:306
1265 #, no-wrap
1266 msgid ""
1267 "    /* Now we can accept incoming connections one\n"
1268 "       at a time using accept(2) */\n"
1269 msgstr ""
1270 "    /* Now we can accept incoming connections one\n"
1271 "       at a time using accept(2) */\n"
1272
1273 #. type: Plain text
1274 #: build/C/man2/bind.2:312
1275 #, no-wrap
1276 msgid ""
1277 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1278 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1279 "                 &peer_addr_size);\n"
1280 "    if (cfd == -1)\n"
1281 "        handle_error(\"accept\");\n"
1282 msgstr ""
1283 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1284 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1285 "                 &peer_addr_size)\n"
1286 "    if (cfd == -1)\n"
1287 "        handle_error(\"accept\");\n"
1288
1289 #. type: Plain text
1290 #: build/C/man2/bind.2:314
1291 #, no-wrap
1292 msgid "    /* Code to deal with incoming connection(s)... */\n"
1293 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1294
1295 #. type: Plain text
1296 #: build/C/man2/bind.2:318
1297 #, no-wrap
1298 msgid ""
1299 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1300 "       should be deleted using unlink(2) or remove(3) */\n"
1301 "}\n"
1302 msgstr ""
1303 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1304 "       should be deleted using unlink(2) or remove(3) */\n"
1305 "}\n"
1306
1307 #. type: Plain text
1308 #: build/C/man2/bind.2:332
1309 msgid ""
1310 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1311 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1312 "(7), B<socket>(7), B<unix>(7)"
1313 msgstr ""
1314 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1315 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1316 "(7), B<socket>(7), B<unix>(7)"
1317
1318 #. type: TH
1319 #: build/C/man3/bindresvport.3:30
1320 #, no-wrap
1321 msgid "BINDRESVPORT"
1322 msgstr "BINDRESVPORT"
1323
1324 #. type: TH
1325 #: build/C/man3/bindresvport.3:30 build/C/man7/socket.7:45
1326 #, no-wrap
1327 msgid "2013-06-21"
1328 msgstr "2013-06-21"
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: SH
1432 #: build/C/man3/bindresvport.3:92
1433 #, no-wrap
1434 msgid "ATTRIBUTES"
1435 msgstr "属性"
1436
1437 #. type: SS
1438 #: build/C/man3/bindresvport.3:93
1439 #, no-wrap
1440 msgid "Multithreading (see pthreads(7))"
1441 msgstr "マルチスレッディング (pthreads(7) 参照)"
1442
1443 #. type: Plain text
1444 #: build/C/man3/bindresvport.3:98
1445 msgid ""
1446 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1447 "that is not protected, so it is not thread-safe."
1448 msgstr ""
1449 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1450 "静的変数を使用しているため、スレッドセーフではない。"
1451
1452 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1453 #. type: Plain text
1454 #: build/C/man3/bindresvport.3:104
1455 msgid ""
1456 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1457 "static variable, so it is thread-safe."
1458 msgstr ""
1459 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1460 "ており、スレッドセーフである。"
1461
1462 #. type: Plain text
1463 #: build/C/man3/bindresvport.3:107
1464 msgid ""
1465 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1466 msgstr ""
1467 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1468
1469 #. type: Plain text
1470 #: build/C/man3/bindresvport.3:113
1471 msgid ""
1472 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1473 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1474 msgstr ""
1475 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1476 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1477
1478 #. type: Plain text
1479 #: build/C/man3/bindresvport.3:116
1480 msgid "B<bind>(2), B<getsockname>(2)"
1481 msgstr "B<bind>(2), B<getsockname>(2)"
1482
1483 #. type: TH
1484 #: build/C/man2/connect.2:67
1485 #, no-wrap
1486 msgid "CONNECT"
1487 msgstr "CONNECT"
1488
1489 #. type: TH
1490 #: build/C/man2/connect.2:67 build/C/man2/getsockname.2:40
1491 #: build/C/man2/getsockopt.2:44 build/C/man3/sockatmark.3:25
1492 #, no-wrap
1493 msgid "2008-12-03"
1494 msgstr "2008-12-03"
1495
1496 #. type: Plain text
1497 #: build/C/man2/connect.2:70
1498 msgid "connect - initiate a connection on a socket"
1499 msgstr "connect - ソケットの接続を行う"
1500
1501 #. type: Plain text
1502 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1503 #: build/C/man2/listen.2:51
1504 #, no-wrap
1505 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1506 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1507
1508 #. type: Plain text
1509 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1510 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1511 #: build/C/man2/recv.2:51
1512 #, no-wrap
1513 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1514 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1515
1516 #. type: Plain text
1517 #: build/C/man2/connect.2:78
1518 #, no-wrap
1519 msgid ""
1520 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1521 "B<            socklen_t >I<addrlen>B<);>\n"
1522 msgstr ""
1523 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1524 "B<            socklen_t >I<addrlen>B<);>\n"
1525
1526 #. type: Plain text
1527 #: build/C/man2/connect.2:97
1528 msgid ""
1529 "The B<connect>()  system call connects the socket referred to by the file "
1530 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1531 "argument specifies the size of I<addr>.  The format of the address in "
1532 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1533 "B<socket>(2)  for further details."
1534 msgstr ""
1535 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1536 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1537 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1538 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1539 "こと。"
1540
1541 #. type: Plain text
1542 #: build/C/man2/connect.2:113
1543 msgid ""
1544 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1545 "to which datagrams are sent by default, and the only address from which "
1546 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1547 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1548 "that is bound to the address specified by I<addr>."
1549 msgstr ""
1550 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1551 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1552 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1553 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1554 "に対する接続の 作成を試みる。"
1555
1556 #. type: Plain text
1557 #: build/C/man2/connect.2:127
1558 msgid ""
1559 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1560 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1561 "times to change their association.  Connectionless sockets may dissolve the "
1562 "association by connecting to an address with the I<sa_family> member of "
1563 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1564 msgstr ""
1565 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1566 "()  が成功する。 コネクションレス (connectionless) プロトコルでは対応を変更す"
1567 "るために何度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1568 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1569 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1570
1571 #. type: Plain text
1572 #: build/C/man2/connect.2:132
1573 msgid ""
1574 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1575 "returned, and I<errno> is set appropriately."
1576 msgstr ""
1577 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1578 "適切な値を設定する。"
1579
1580 #. type: Plain text
1581 #: build/C/man2/connect.2:135
1582 msgid ""
1583 "The following are general socket errors only.  There may be other domain-"
1584 "specific error codes."
1585 msgstr ""
1586 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1587 "する可能性がある。"
1588
1589 #. type: Plain text
1590 #: build/C/man2/connect.2:143
1591 msgid ""
1592 "For UNIX domain sockets, which are identified by pathname: Write permission "
1593 "is denied on the socket file, or search permission is denied for one of the "
1594 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1595 msgstr ""
1596 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1597 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1598 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1599
1600 #. type: TP
1601 #: build/C/man2/connect.2:143
1602 #, no-wrap
1603 msgid "B<EACCES>, B<EPERM>"
1604 msgstr "B<EACCES>, B<EPERM>"
1605
1606 #. type: Plain text
1607 #: build/C/man2/connect.2:148
1608 msgid ""
1609 "The user tried to connect to a broadcast address without having the socket "
1610 "broadcast flag enabled or the connection request failed because of a local "
1611 "firewall rule."
1612 msgstr ""
1613 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1614 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1615 "要求が失敗した。"
1616
1617 #. type: Plain text
1618 #: build/C/man2/connect.2:151
1619 msgid "Local address is already in use."
1620 msgstr "ローカルアドレスが既に使用されている。"
1621
1622 #. type: TP
1623 #: build/C/man2/connect.2:151 build/C/man2/socket.2:324
1624 #: build/C/man2/socketpair.2:75
1625 #, no-wrap
1626 msgid "B<EAFNOSUPPORT>"
1627 msgstr "B<EAFNOSUPPORT>"
1628
1629 #. type: Plain text
1630 #: build/C/man2/connect.2:156
1631 msgid ""
1632 "The passed address didn't have the correct address family in its "
1633 "I<sa_family> field."
1634 msgstr ""
1635 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1636 "い。"
1637
1638 #. type: TP
1639 #: build/C/man2/connect.2:156
1640 #, no-wrap
1641 msgid "B<EAGAIN>"
1642 msgstr "B<EAGAIN>"
1643
1644 #. type: Plain text
1645 #: build/C/man2/connect.2:165
1646 msgid ""
1647 "No more free local ports or insufficient entries in the routing cache.  For "
1648 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1649 "B<ip>(7)  for information on how to increase the number of local ports."
1650 msgstr ""
1651 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1652 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1653 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1654
1655 #. type: TP
1656 #: build/C/man2/connect.2:165
1657 #, no-wrap
1658 msgid "B<EALREADY>"
1659 msgstr "B<EALREADY>"
1660
1661 #. type: Plain text
1662 #: build/C/man2/connect.2:169
1663 msgid ""
1664 "The socket is nonblocking and a previous connection attempt has not yet been "
1665 "completed."
1666 msgstr ""
1667 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1668
1669 #. type: Plain text
1670 #: build/C/man2/connect.2:172
1671 msgid "The file descriptor is not a valid index in the descriptor table."
1672 msgstr ""
1673 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1674 "い。"
1675
1676 #. type: TP
1677 #: build/C/man2/connect.2:172 build/C/man2/recv.2:415
1678 #, no-wrap
1679 msgid "B<ECONNREFUSED>"
1680 msgstr "B<ECONNREFUSED>"
1681
1682 #. type: Plain text
1683 #: build/C/man2/connect.2:175
1684 msgid "No-one listening on the remote address."
1685 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1686
1687 #. type: Plain text
1688 #: build/C/man2/connect.2:178
1689 msgid "The socket structure address is outside the user's address space."
1690 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1691
1692 #. type: TP
1693 #: build/C/man2/connect.2:178
1694 #, no-wrap
1695 msgid "B<EINPROGRESS>"
1696 msgstr "B<EINPROGRESS>"
1697
1698 #. type: Plain text
1699 #: build/C/man2/connect.2:203
1700 msgid ""
1701 "The socket is nonblocking and the connection cannot be completed "
1702 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1703 "by selecting the socket for writing.  After B<select>(2)  indicates "
1704 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1705 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1706 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1707 "error codes listed here, explaining the reason for the failure)."
1708 msgstr ""
1709 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1710 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1711 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1712 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1713 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1714 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1715 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1716 "の原因が分かる。"
1717
1718 #.  For TCP, the connection will complete asynchronously.
1719 #.  See http://lkml.org/lkml/2005/7/12/254
1720 #. type: Plain text
1721 #: build/C/man2/connect.2:209
1722 msgid ""
1723 "The system call was interrupted by a signal that was caught; see B<signal>"
1724 "(7)."
1725 msgstr ""
1726 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1727
1728 #. type: TP
1729 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1730 #, no-wrap
1731 msgid "B<EISCONN>"
1732 msgstr "B<EISCONN>"
1733
1734 #. type: Plain text
1735 #: build/C/man2/connect.2:212
1736 msgid "The socket is already connected."
1737 msgstr "ソケットは既に接続 (connect) されている。"
1738
1739 #. type: TP
1740 #: build/C/man2/connect.2:212
1741 #, no-wrap
1742 msgid "B<ENETUNREACH>"
1743 msgstr "B<ENETUNREACH>"
1744
1745 #. type: Plain text
1746 #: build/C/man2/connect.2:215
1747 msgid "Network is unreachable."
1748 msgstr "到達できないネットワークである。"
1749
1750 #. type: Plain text
1751 #: build/C/man2/connect.2:218
1752 msgid "The file descriptor is not associated with a socket."
1753 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1754
1755 #. type: TP
1756 #: build/C/man2/connect.2:218
1757 #, no-wrap
1758 msgid "B<ETIMEDOUT>"
1759 msgstr "B<ETIMEDOUT>"
1760
1761 #. type: Plain text
1762 #: build/C/man2/connect.2:225
1763 msgid ""
1764 "Timeout while attempting connection.  The server may be too busy to accept "
1765 "new connections.  Note that for IP sockets the timeout may be very long when "
1766 "syncookies are enabled on the server."
1767 msgstr ""
1768 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1769 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1770 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1771 "ること。"
1772
1773 #.  SVr4 documents the additional
1774 #.  general error codes
1775 #.  .BR EADDRNOTAVAIL ,
1776 #.  .BR EINVAL ,
1777 #.  .BR EAFNOSUPPORT ,
1778 #.  .BR EALREADY ,
1779 #.  .BR EINTR ,
1780 #.  .BR EPROTOTYPE ,
1781 #.  and
1782 #.  .BR ENOSR .
1783 #.  It also
1784 #.  documents many additional error conditions not described here.
1785 #. type: Plain text
1786 #: build/C/man2/connect.2:241
1787 msgid ""
1788 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1789 "POSIX.1-2001."
1790 msgstr ""
1791 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1792
1793 #. type: Plain text
1794 #: build/C/man2/connect.2:258
1795 msgid ""
1796 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1797 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1798 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1799 msgstr ""
1800 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1801 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1802 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1803
1804 #. type: Plain text
1805 #: build/C/man2/connect.2:263
1806 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1807 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1808
1809 #. type: Plain text
1810 #: build/C/man2/connect.2:270
1811 msgid ""
1812 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1813 "B<path_resolution>(7)"
1814 msgstr ""
1815 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1816 "B<path_resolution>(7)"
1817
1818 #. type: TH
1819 #: build/C/man3/getifaddrs.3:36
1820 #, no-wrap
1821 msgid "GETIFADDRS"
1822 msgstr "GETIFADDRS"
1823
1824 #. type: TH
1825 #: build/C/man3/getifaddrs.3:36
1826 #, no-wrap
1827 msgid "2012-11-11"
1828 msgstr "2012-11-11"
1829
1830 #. type: TH
1831 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1832 #: build/C/man3/if_nametoindex.3:25
1833 #, no-wrap
1834 msgid "GNU"
1835 msgstr "GNU"
1836
1837 #. type: Plain text
1838 #: build/C/man3/getifaddrs.3:39
1839 msgid "getifaddrs, freeifaddrs - get interface addresses"
1840 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1841
1842 #. type: Plain text
1843 #: build/C/man3/getifaddrs.3:43
1844 #, no-wrap
1845 msgid ""
1846 "B<#include E<lt>sys/types.hE<gt>>\n"
1847 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1848 msgstr ""
1849 "B<#include E<lt>sys/types.hE<gt>>\n"
1850 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1851
1852 #. type: Plain text
1853 #: build/C/man3/getifaddrs.3:45
1854 #, no-wrap
1855 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1856 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1857
1858 #. type: Plain text
1859 #: build/C/man3/getifaddrs.3:47
1860 #, no-wrap
1861 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1862 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1863
1864 #. type: Plain text
1865 #: build/C/man3/getifaddrs.3:58
1866 msgid ""
1867 "The B<getifaddrs>()  function creates a linked list of structures describing "
1868 "the network interfaces of the local system, and stores the address of the "
1869 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1870 "structures, defined as follows:"
1871 msgstr ""
1872 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1873 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1874 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1875 "うに定義されている。"
1876
1877 #. type: Plain text
1878 #: build/C/man3/getifaddrs.3:77
1879 #, no-wrap
1880 msgid ""
1881 "struct ifaddrs {\n"
1882 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1883 "    char            *ifa_name;    /* Name of interface */\n"
1884 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1885 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1886 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1887 "    union {\n"
1888 "        struct sockaddr *ifu_broadaddr;\n"
1889 "                         /* Broadcast address of interface */\n"
1890 "        struct sockaddr *ifu_dstaddr;\n"
1891 "                         /* Point-to-point destination address */\n"
1892 "    } ifa_ifu;\n"
1893 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1894 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1895 "    void            *ifa_data;    /* Address-specific data */\n"
1896 "};\n"
1897 msgstr ""
1898 "struct ifaddrs {\n"
1899 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1900 "    char            *ifa_name;    /* Name of interface */\n"
1901 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1902 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1903 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1904 "    union {\n"
1905 "        struct sockaddr *ifu_broadaddr;\n"
1906 "                         /* Broadcast address of interface */\n"
1907 "        struct sockaddr *ifu_dstaddr;\n"
1908 "                         /* Point-to-point destination address */\n"
1909 "    } ifa_ifu;\n"
1910 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1911 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1912 "    void            *ifa_data;    /* Address-specific data */\n"
1913 "};\n"
1914
1915 #. type: Plain text
1916 #: build/C/man3/getifaddrs.3:84
1917 msgid ""
1918 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1919 "or NULL if this is the last item of the list."
1920 msgstr ""
1921 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1922 "素がリストの最後の場合には NULL が入る。"
1923
1924 #.  The constant
1925 #.  .B IF NAMESIZE
1926 #.  indicates the maximum length of this field.
1927 #. type: Plain text
1928 #: build/C/man3/getifaddrs.3:91
1929 msgid "The I<ifa_name> points to the null-terminated interface name."
1930 msgstr "I<ifa_name> は NULL 終端されたインターフェース名を指す。"
1931
1932 #. type: Plain text
1933 #: build/C/man3/getifaddrs.3:100
1934 msgid ""
1935 "The I<ifa_flags> field contains the interface flags, as returned by the "
1936 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1937 "these flags)."
1938 msgstr ""
1939 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1940 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1941 "B<netdevice>(7) を参照)。"
1942
1943 #. type: Plain text
1944 #: build/C/man3/getifaddrs.3:109
1945 msgid ""
1946 "The I<ifa_addr> field points to a structure containing the interface "
1947 "address.  (The I<sa_family> subfield should be consulted to determine the "
1948 "format of the address structure.)  This field may contain a NULL pointer."
1949 msgstr ""
1950 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
1951 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
1952 "すべきである)。 このフィールドは NULL ポインタとなる場合がある。"
1953
1954 #. type: Plain text
1955 #: build/C/man3/getifaddrs.3:116
1956 msgid ""
1957 "The I<ifa_netmask> field points to a structure containing the netmask "
1958 "associated with I<ifa_addr>, if applicable for the address family.  This "
1959 "field may contain a NULL pointer."
1960 msgstr ""
1961 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
1962 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
1963 "る。 このフィールドは NULL ポインタとなる場合がある。"
1964
1965 #. type: Plain text
1966 #: build/C/man3/getifaddrs.3:131
1967 msgid ""
1968 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1969 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1970 "will contain the broadcast address associated with I<ifa_addr> (if "
1971 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1972 "destination address of the point-to-point interface."
1973 msgstr ""
1974 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
1975 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
1976 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
1977 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
1978 "point インターフェースの宛先アドレスが入るかが決まる。"
1979
1980 #. type: Plain text
1981 #: build/C/man3/getifaddrs.3:136
1982 msgid ""
1983 "The I<ifa_data> field points to a buffer containing address-family-specific "
1984 "data; this field may be NULL if there is no such data for this interface."
1985 msgstr ""
1986 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
1987 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
1988 "フィールドは NULL となる。"
1989
1990 #. type: Plain text
1991 #: build/C/man3/getifaddrs.3:142
1992 msgid ""
1993 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1994 "freed using B<freeifaddrs>()  when no longer needed."
1995 msgstr ""
1996 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
1997 "B<freeifaddrs>() を使って解放すべきである。"
1998
1999 #. type: Plain text
2000 #: build/C/man3/getifaddrs.3:149
2001 msgid ""
2002 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2003 "I<errno> is set appropriately."
2004 msgstr ""
2005 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2006 "が適切に設定される。"
2007
2008 #. type: Plain text
2009 #: build/C/man3/getifaddrs.3:162
2010 msgid ""
2011 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2012 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
2013 "(2), B<malloc>(3), or B<realloc>(3)."
2014 msgstr ""
2015 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には B<socket>"
2016 "(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>"
2017 "(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定される。"
2018
2019 #. type: Plain text
2020 #: build/C/man3/getifaddrs.3:170
2021 msgid ""
2022 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2023 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2024 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2025 "available only on kernels that support netlink."
2026 msgstr ""
2027 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2028 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2029 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2030 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2031
2032 #.  , but the BSD-derived documentation generally
2033 #.  appears to be confused and obsolete on this point.
2034 #.  i.e., commonly it still says one of them will be NULL, even if
2035 #.  the ifa_ifu union is already present
2036 #. type: Plain text
2037 #: build/C/man3/getifaddrs.3:190
2038 msgid ""
2039 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2040 "the BSD systems, but with slightly different semantics documented"
2041 "\\(emreturning one entry per interface, not per address.  This means "
2042 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2043 "address, and no link-level address is returned if the interface has an IP "
2044 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2045 "I<ifa_dstaddr> differs on various systems."
2046 msgstr ""
2047 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2048 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2049 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2050 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2051 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2052 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2053 "どちらを選択するかを決める方法は、 システムにより異なる。"
2054
2055 #. type: Plain text
2056 #: build/C/man3/getifaddrs.3:207
2057 msgid ""
2058 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2059 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2060 "containing lower-level details about the interface and its physical layer.  "
2061 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2062 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2063 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2064 "hE<gt>>), which contains various interface attributes and statistics."
2065 msgstr ""
2066 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2067 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2068 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2069 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2070 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2071 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2072 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2073 "インターフェースの様々な属性や統計情報が入る。"
2074
2075 #. type: Plain text
2076 #: build/C/man3/getifaddrs.3:214
2077 msgid ""
2078 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2079 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2080 "system:"
2081 msgstr ""
2082 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2083 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2084
2085 #. type: Plain text
2086 #: build/C/man3/getifaddrs.3:228
2087 #, no-wrap
2088 msgid ""
2089 "$ B<./a.out>\n"
2090 "lo      address family: 17 (AF_PACKET)\n"
2091 "eth0    address family: 17 (AF_PACKET)\n"
2092 "lo      address family: 2 (AF_INET)\n"
2093 "        address: E<lt>127.0.0.1E<gt>\n"
2094 "eth0    address family: 2 (AF_INET)\n"
2095 "        address: E<lt>10.1.1.4E<gt>\n"
2096 "lo      address family: 10 (AF_INET6)\n"
2097 "        address: E<lt>::1E<gt>\n"
2098 "eth0    address family: 10 (AF_INET6)\n"
2099 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2100 msgstr ""
2101 "$ B<./a.out>\n"
2102 "lo      address family: 17 (AF_PACKET)\n"
2103 "eth0    address family: 17 (AF_PACKET)\n"
2104 "lo      address family: 2 (AF_INET)\n"
2105 "        address: E<lt>127.0.0.1E<gt>\n"
2106 "eth0    address family: 2 (AF_INET)\n"
2107 "        address: E<lt>10.1.1.4E<gt>\n"
2108 "lo      address family: 10 (AF_INET6)\n"
2109 "        address: E<lt>::1E<gt>\n"
2110 "eth0    address family: 10 (AF_INET6)\n"
2111 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2112
2113 #. type: SS
2114 #: build/C/man3/getifaddrs.3:230 build/C/man3/if_nameindex.3:120
2115 #: build/C/man2/recvmmsg.2:206
2116 #, no-wrap
2117 msgid "Program source"
2118 msgstr "プログラムのソース"
2119
2120 #. type: Plain text
2121 #: build/C/man3/getifaddrs.3:240
2122 #, no-wrap
2123 msgid ""
2124 "#include E<lt>arpa/inet.hE<gt>\n"
2125 "#include E<lt>sys/socket.hE<gt>\n"
2126 "#include E<lt>netdb.hE<gt>\n"
2127 "#include E<lt>ifaddrs.hE<gt>\n"
2128 "#include E<lt>stdio.hE<gt>\n"
2129 "#include E<lt>stdlib.hE<gt>\n"
2130 "#include E<lt>unistd.hE<gt>\n"
2131 msgstr ""
2132 "#include E<lt>arpa/inet.hE<gt>\n"
2133 "#include E<lt>sys/socket.hE<gt>\n"
2134 "#include E<lt>netdb.hE<gt>\n"
2135 "#include E<lt>ifaddrs.hE<gt>\n"
2136 "#include E<lt>stdio.hE<gt>\n"
2137 "#include E<lt>stdlib.hE<gt>\n"
2138 "#include E<lt>unistd.hE<gt>\n"
2139
2140 #. type: Plain text
2141 #: build/C/man3/getifaddrs.3:247
2142 #, no-wrap
2143 msgid ""
2144 "int\n"
2145 "main(int argc, char *argv[])\n"
2146 "{\n"
2147 "    struct ifaddrs *ifaddr, *ifa;\n"
2148 "    int family, s;\n"
2149 "    char host[NI_MAXHOST];\n"
2150 msgstr ""
2151 "int\n"
2152 "main(int argc, char *argv[])\n"
2153 "{\n"
2154 "    struct ifaddrs *ifaddr, *ifa;\n"
2155 "    int family, s;\n"
2156 "    char host[NI_MAXHOST];\n"
2157
2158 #. type: Plain text
2159 #: build/C/man3/getifaddrs.3:252
2160 #, no-wrap
2161 msgid ""
2162 "    if (getifaddrs(&ifaddr) == -1) {\n"
2163 "        perror(\"getifaddrs\");\n"
2164 "        exit(EXIT_FAILURE);\n"
2165 "    }\n"
2166 msgstr ""
2167 "    if (getifaddrs(&ifaddr) == -1) {\n"
2168 "        perror(\"getifaddrs\");\n"
2169 "        exit(EXIT_FAILURE);\n"
2170 "    }\n"
2171
2172 #. type: Plain text
2173 #: build/C/man3/getifaddrs.3:255
2174 #, no-wrap
2175 msgid ""
2176 "    /* Walk through linked list, maintaining head pointer so we\n"
2177 "       can free list later */\n"
2178 msgstr ""
2179 "    /* Walk through linked list, maintaining head pointer so we\n"
2180 "       can free list later */\n"
2181
2182 #. type: Plain text
2183 #: build/C/man3/getifaddrs.3:259
2184 #, no-wrap
2185 msgid ""
2186 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2187 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2188 "            continue;\n"
2189 msgstr ""
2190 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2191 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2192 "            continue;\n"
2193
2194 #. type: Plain text
2195 #: build/C/man3/getifaddrs.3:261
2196 #, no-wrap
2197 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2198 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2199
2200 #. type: Plain text
2201 #: build/C/man3/getifaddrs.3:264
2202 #, no-wrap
2203 msgid ""
2204 "        /* Display interface name and family (including symbolic\n"
2205 "           form of the latter for the common families) */\n"
2206 msgstr ""
2207 "        /* Display interface name and family (including symbolic\n"
2208 "           form of the latter for the common families) */\n"
2209
2210 #. type: Plain text
2211 #: build/C/man3/getifaddrs.3:270
2212 #, no-wrap
2213 msgid ""
2214 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2215 "                ifa-E<gt>ifa_name, family,\n"
2216 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2217 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2218 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2219 msgstr ""
2220 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2221 "                ifa-E<gt>ifa_name, family,\n"
2222 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2223 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2224 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2225
2226 #. type: Plain text
2227 #: build/C/man3/getifaddrs.3:272
2228 #, no-wrap
2229 msgid "        /* For an AF_INET* interface address, display the address */\n"
2230 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2231
2232 #. type: Plain text
2233 #: build/C/man3/getifaddrs.3:285
2234 #, no-wrap
2235 msgid ""
2236 "        if (family == AF_INET || family == AF_INET6) {\n"
2237 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2238 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2239 "                                          sizeof(struct sockaddr_in6),\n"
2240 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2241 "            if (s != 0) {\n"
2242 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2243 "                exit(EXIT_FAILURE);\n"
2244 "            }\n"
2245 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2246 "        }\n"
2247 "    }\n"
2248 msgstr ""
2249 "        if (family == AF_INET || family == AF_INET6) {\n"
2250 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2251 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2252 "                                          sizeof(struct sockaddr_in6),\n"
2253 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2254 "            if (s != 0) {\n"
2255 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2256 "                exit(EXIT_FAILURE);\n"
2257 "            }\n"
2258 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2259 "        }\n"
2260 "    }\n"
2261
2262 #. type: Plain text
2263 #: build/C/man3/getifaddrs.3:289
2264 #, no-wrap
2265 msgid ""
2266 "    freeifaddrs(ifaddr);\n"
2267 "    exit(EXIT_SUCCESS);\n"
2268 "}\n"
2269 msgstr ""
2270 "    freeifaddrs(ifaddr);\n"
2271 "    exit(EXIT_SUCCESS);\n"
2272 "}\n"
2273
2274 #. type: Plain text
2275 #: build/C/man3/getifaddrs.3:296
2276 msgid ""
2277 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2278 msgstr ""
2279 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2280
2281 #. type: TH
2282 #: build/C/man2/getsockname.2:40
2283 #, no-wrap
2284 msgid "GETSOCKNAME"
2285 msgstr "GETSOCKNAME"
2286
2287 #. type: Plain text
2288 #: build/C/man2/getsockname.2:43
2289 msgid "getsockname - get socket name"
2290 msgstr "getsockname - ソケットの名前を取得する"
2291
2292 #. type: Plain text
2293 #: build/C/man2/getsockname.2:49
2294 #, no-wrap
2295 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2296 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2297
2298 #. type: Plain text
2299 #: build/C/man2/getsockname.2:62
2300 msgid ""
2301 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2302 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2303 "should be initialized to indicate the amount of space (in bytes) pointed to "
2304 "by I<addr>.  On return it contains the actual size of the socket address."
2305 msgstr ""
2306 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2307 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2308 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2309 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2310 "納される。"
2311
2312 #. type: Plain text
2313 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2314 #: build/C/man2/listen.2:96
2315 msgid "The argument I<sockfd> is not a valid descriptor."
2316 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2317
2318 #. type: Plain text
2319 #: build/C/man2/getsockname.2:84
2320 msgid ""
2321 "The I<addr> argument points to memory not in a valid part of the process "
2322 "address space."
2323 msgstr ""
2324 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2325 "い。"
2326
2327 #. type: Plain text
2328 #: build/C/man2/getsockname.2:88
2329 msgid "I<addrlen> is invalid (e.g., is negative)."
2330 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2331
2332 #. type: TP
2333 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2334 #: build/C/man2/send.2:335
2335 #, no-wrap
2336 msgid "B<ENOBUFS>"
2337 msgstr "B<ENOBUFS>"
2338
2339 #. type: Plain text
2340 #: build/C/man2/getsockname.2:92
2341 msgid ""
2342 "Insufficient resources were available in the system to perform the operation."
2343 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2344
2345 #. type: Plain text
2346 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2347 msgid "The argument I<sockfd> is a file, not a socket."
2348 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2349
2350 #.  SVr4 documents additional ENOMEM
2351 #.  and ENOSR error codes.
2352 #. type: Plain text
2353 #: build/C/man2/getsockname.2:103
2354 msgid ""
2355 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2356 "POSIX.1-2001."
2357 msgstr ""
2358 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2359
2360 #. type: Plain text
2361 #: build/C/man2/getsockname.2:114
2362 msgid ""
2363 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2364 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2365 "resulted in the present I<socklen_t>, also used by glibc.  See also B<accept>"
2366 "(2)."
2367 msgstr ""
2368 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2369 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2370 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2371
2372 #. type: Plain text
2373 #: build/C/man2/getsockname.2:121
2374 msgid ""
2375 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2376 "(7)"
2377 msgstr ""
2378 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2379 "(7)"
2380
2381 #. type: TH
2382 #: build/C/man2/getsockopt.2:44
2383 #, no-wrap
2384 msgid "GETSOCKOPT"
2385 msgstr "GETSOCKOPT"
2386
2387 #. type: Plain text
2388 #: build/C/man2/getsockopt.2:47
2389 msgid "getsockopt, setsockopt - get and set options on sockets"
2390 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2391
2392 #. type: Plain text
2393 #: build/C/man2/getsockopt.2:57
2394 #, no-wrap
2395 msgid ""
2396 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2397 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2398 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2399 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2400 msgstr ""
2401 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2402 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2403 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2404 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2405
2406 #. type: Plain text
2407 #: build/C/man2/getsockopt.2:67
2408 msgid ""
2409 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2410 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2411 "protocol levels; they are always present at the uppermost socket level."
2412 msgstr ""
2413 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2414 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2415 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2416 "定される。"
2417
2418 #. type: Plain text
2419 #: build/C/man2/getsockopt.2:86
2420 msgid ""
2421 "When manipulating socket options, the level at which the option resides and "
2422 "the name of the option must be specified.  To manipulate options at the "
2423 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2424 "options at any other level the protocol number of the appropriate protocol "
2425 "controlling the option is supplied.  For example, to indicate that an option "
2426 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2427 "protocol number of B<TCP>; see B<getprotoent>(3)."
2428 msgstr ""
2429 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2430 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2431 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2432 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2433 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2434 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2435 "B<getprotoent>(3)  を参照すること。"
2436
2437 #. type: Plain text
2438 #: build/C/man2/getsockopt.2:108
2439 msgid ""
2440 "The arguments I<optval> and I<optlen> are used to access option values for "
2441 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2442 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2443 "I<optlen> is a value-result argument, initially containing the size of the "
2444 "buffer pointed to by I<optval>, and modified on return to indicate the "
2445 "actual size of the value returned.  If no option value is to be supplied or "
2446 "returned, I<optval> may be NULL."
2447 msgstr ""
2448 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2449 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2450 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2451 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2452 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2453 "I<optval> は NULL でも良い。"
2454
2455 #. type: Plain text
2456 #: build/C/man2/getsockopt.2:118
2457 msgid ""
2458 "I<Optname> and any specified options are passed uninterpreted to the "
2459 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2460 "socket.hE<gt>> contains definitions for socket level options, described "
2461 "below.  Options at other protocol levels vary in format and name; consult "
2462 "the appropriate entries in section 4 of the manual."
2463 msgstr ""
2464 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2465 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2466 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2467 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2468 "ること。"
2469
2470 #. type: Plain text
2471 #: build/C/man2/getsockopt.2:127
2472 msgid ""
2473 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2474 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2475 "or zero if the option is to be disabled."
2476 msgstr ""
2477 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2478 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2479 "を指定し、 無効(disable)にするにはゼロを指定する。"
2480
2481 #. type: Plain text
2482 #: build/C/man2/getsockopt.2:131
2483 msgid ""
2484 "For a description of the available socket options see B<socket>(7)  and the "
2485 "appropriate protocol man pages."
2486 msgstr ""
2487 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2488 "ルの man ページを参照のこと。"
2489
2490 #. type: Plain text
2491 #: build/C/man2/getsockopt.2:152
2492 msgid ""
2493 "The address pointed to by I<optval> is not in a valid part of the process "
2494 "address space.  For B<getsockopt>(), this error may also be returned if "
2495 "I<optlen> is not in a valid part of the process address space."
2496 msgstr ""
2497 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2498 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2499 "い場合にもこのエラーが返される。"
2500
2501 #. type: Plain text
2502 #: build/C/man2/getsockopt.2:163
2503 msgid ""
2504 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2505 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2506 "option described in B<ip>(7))."
2507 msgstr ""
2508 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2509 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2510 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2511
2512 #. type: TP
2513 #: build/C/man2/getsockopt.2:163
2514 #, no-wrap
2515 msgid "B<ENOPROTOOPT>"
2516 msgstr "B<ENOPROTOOPT>"
2517
2518 #. type: Plain text
2519 #: build/C/man2/getsockopt.2:166
2520 msgid "The option is unknown at the level indicated."
2521 msgstr "指定された層(level)にはこのオプションは存在しない。"
2522
2523 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2524 #.  not document the
2525 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2526 #.  options
2527 #. type: Plain text
2528 #: build/C/man2/getsockopt.2:178
2529 msgid ""
2530 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2531 msgstr ""
2532 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2533 "POSIX.1-2001."
2534
2535 #. type: Plain text
2536 #: build/C/man2/getsockopt.2:199
2537 msgid ""
2538 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2539 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2540 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2541 "glibc.  See also B<accept>(2)."
2542 msgstr ""
2543 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2544 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2545 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2546 "る。 B<accept>(2)  も参照のこと。"
2547
2548 #. type: Plain text
2549 #: build/C/man2/getsockopt.2:202
2550 msgid ""
2551 "Several of the socket options should be handled at lower levels of the "
2552 "system."
2553 msgstr ""
2554 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2555
2556 #. type: Plain text
2557 #: build/C/man2/getsockopt.2:210
2558 msgid ""
2559 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2560 "B<tcp>(7), B<unix>(7)"
2561 msgstr ""
2562 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2563 "B<tcp>(7), B<unix>(7)"
2564
2565 #. type: TH
2566 #: build/C/man3/if_nameindex.3:26
2567 #, no-wrap
2568 msgid "IF_NAMEINDEX"
2569 msgstr "IF_NAMEINDEX"
2570
2571 #. type: TH
2572 #: build/C/man3/if_nameindex.3:26
2573 #, no-wrap
2574 msgid "2012-11-21"
2575 msgstr "2012-11-21"
2576
2577 #. type: Plain text
2578 #: build/C/man3/if_nameindex.3:29
2579 msgid ""
2580 "if_nameindex, if_freenameindex - get network interface names and indexes"
2581 msgstr ""
2582 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2583 "クスを取得する"
2584
2585 #. type: Plain text
2586 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2587 #, no-wrap
2588 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2589 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2590
2591 #. type: Plain text
2592 #: build/C/man3/if_nameindex.3:35
2593 #, no-wrap
2594 msgid ""
2595 "B<struct if_nameindex *if_nameindex(void);>\n"
2596 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2597 msgstr ""
2598 "B<struct if_nameindex *if_nameindex(void);>\n"
2599 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2600
2601 #. type: Plain text
2602 #: build/C/man3/if_nameindex.3:46
2603 msgid ""
2604 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2605 "structures, each containing information about one of the network interfaces "
2606 "on the local system.  The I<if_nameindex> structure contains at least the "
2607 "following entries:"
2608 msgstr ""
2609 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2610 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2611 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2612
2613 #. type: Plain text
2614 #: build/C/man3/if_nameindex.3:51
2615 #, no-wrap
2616 msgid ""
2617 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2618 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2619 msgstr ""
2620 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2621 "    char        *if_name;  /* NULL 終端された名前 (\"eth0\" など) */\n"
2622
2623 #. type: Plain text
2624 #: build/C/man3/if_nameindex.3:65
2625 msgid ""
2626 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2627 "points to the null-terminated interface name.  The end of the array is "
2628 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2629 msgstr ""
2630 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2631 "フィールドは NULL 終端されたインターフェース名を指す。 配列の最後は、 "
2632 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2633
2634 #. type: Plain text
2635 #: build/C/man3/if_nameindex.3:71
2636 msgid ""
2637 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2638 "and should be freed using B<if_freenameindex>()  when no longer needed."
2639 msgstr ""
2640 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2641 "は B<if_freenameindex>() で解放すべきである。"
2642
2643 #. type: Plain text
2644 #: build/C/man3/if_nameindex.3:78
2645 msgid ""
2646 "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2647 "NULL pointer is returned, and I<errno> is set appropriately."
2648 msgstr ""
2649 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2650 "NULL ポインタが返され、 I<errno> が適切に設定される。"
2651
2652 #. type: Plain text
2653 #: build/C/man3/if_nameindex.3:83
2654 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2655 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2656
2657 #. type: Plain text
2658 #: build/C/man3/if_nameindex.3:86
2659 msgid "Insufficient resources available."
2660 msgstr "利用可能なリソースが十分にない。"
2661
2662 #. type: Plain text
2663 #: build/C/man3/if_nameindex.3:97
2664 msgid ""
2665 "B<if_nameindex>()  may also fail for any of the errors specified for "
2666 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2667 "B<sendto>(2), or B<malloc>(3)."
2668 msgstr ""
2669 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>"
2670 "(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定されているエラーの"
2671 "いずれかで失敗する場合がある。"
2672
2673 #. type: Plain text
2674 #: build/C/man3/if_nameindex.3:104
2675 msgid ""
2676 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2677 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2678 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2679 "available only on kernels that support netlink."
2680 msgstr ""
2681 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2682 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2683 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2684 "netlink をサポートするカーネルにおいてのみである。"
2685
2686 #. type: Plain text
2687 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2688 msgid "RFC\\ 3493, POSIX.1-2001."
2689 msgstr "RFC\\ 3493, POSIX.1-2001."
2690
2691 #. type: Plain text
2692 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2693 msgid "This function first appeared in BSDi."
2694 msgstr "この関数は BSDi 初めて登場した。"
2695
2696 #. type: Plain text
2697 #: build/C/man3/if_nameindex.3:112
2698 msgid ""
2699 "The program below demonstrates the use of the functions described on this "
2700 "page.  An example of the output this program might produce is the following:"
2701 msgstr ""
2702 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2703 "ムが生成する出力は以下のようになる。"
2704
2705 #. type: Plain text
2706 #: build/C/man3/if_nameindex.3:118
2707 #, no-wrap
2708 msgid ""
2709 "$ B<./a.out>I<\n"
2710 "1: lo\n"
2711 "2: wlan0\n"
2712 "3: em1>\n"
2713 msgstr ""
2714 "$ B<./a.out>I<\n"
2715 "1: lo\n"
2716 "2: wlan0\n"
2717 "3: em1>\n"
2718
2719 #. type: Plain text
2720 #: build/C/man3/if_nameindex.3:126
2721 #, no-wrap
2722 msgid ""
2723 "#include E<lt>net/if.hE<gt>\n"
2724 "#include E<lt>stdio.hE<gt>\n"
2725 "#include E<lt>stdlib.hE<gt>\n"
2726 "#include E<lt>unistd.hE<gt>\n"
2727 msgstr ""
2728 "#include E<lt>net/if.hE<gt>\n"
2729 "#include E<lt>stdio.hE<gt>\n"
2730 "#include E<lt>stdlib.hE<gt>\n"
2731 "#include E<lt>unistd.hE<gt>\n"
2732
2733 #. type: Plain text
2734 #: build/C/man3/if_nameindex.3:131
2735 #, no-wrap
2736 msgid ""
2737 "int\n"
2738 "main(int argc, char *argv[])\n"
2739 "{\n"
2740 "    struct if_nameindex *if_ni, *i;\n"
2741 msgstr ""
2742 "int\n"
2743 "main(int argc, char *argv[])\n"
2744 "{\n"
2745 "    struct if_nameindex *if_ni, *i;\n"
2746
2747 #. type: Plain text
2748 #: build/C/man3/if_nameindex.3:137
2749 #, no-wrap
2750 msgid ""
2751 "    if_ni = if_nameindex();\n"
2752 "    if (if_ni == NULL) {\n"
2753 "        perror(\"if_nameindex\");\n"
2754 "        exit(EXIT_FAILURE);\n"
2755 "    }\n"
2756 msgstr ""
2757 "    if_ni = if_nameindex();\n"
2758 "    if (if_ni == NULL) {\n"
2759 "        perror(\"if_nameindex\");\n"
2760 "        exit(EXIT_FAILURE);\n"
2761 "    }\n"
2762
2763 #. type: Plain text
2764 #: build/C/man3/if_nameindex.3:140
2765 #, no-wrap
2766 msgid ""
2767 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2768 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2769 msgstr ""
2770 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2771 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2772
2773 #. type: Plain text
2774 #: build/C/man3/if_nameindex.3:142
2775 #, no-wrap
2776 msgid "    if_freenameindex(if_ni);\n"
2777 msgstr "    if_freenameindex(if_ni);\n"
2778
2779 #. type: Plain text
2780 #: build/C/man3/if_nameindex.3:145 build/C/man2/select.2:573
2781 #, no-wrap
2782 msgid ""
2783 "    exit(EXIT_SUCCESS);\n"
2784 "}\n"
2785 msgstr ""
2786 "    exit(EXIT_SUCCESS);\n"
2787 "}\n"
2788
2789 #. type: Plain text
2790 #: build/C/man3/if_nameindex.3:153
2791 msgid ""
2792 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2793 "B<if_nametoindex>(3), B<ifconfig>(8)"
2794 msgstr ""
2795 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2796 "B<if_nametoindex>(3), B<ifconfig>(8)"
2797
2798 #. type: TH
2799 #: build/C/man3/if_nametoindex.3:25
2800 #, no-wrap
2801 msgid "IF_NAMETOINDEX"
2802 msgstr "IF_NAMETOINDEX"
2803
2804 #. type: TH
2805 #: build/C/man3/if_nametoindex.3:25
2806 #, no-wrap
2807 msgid "2012-12-14"
2808 msgstr "2012-12-14"
2809
2810 #. type: Plain text
2811 #: build/C/man3/if_nametoindex.3:29
2812 msgid ""
2813 "if_nametoindex, if_indextoname - mappings between network interface names "
2814 "and indexes"
2815 msgstr ""
2816 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2817 "クスのマッピングを行う"
2818
2819 #. type: Plain text
2820 #: build/C/man3/if_nametoindex.3:34
2821 #, no-wrap
2822 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2823 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2824
2825 #. type: Plain text
2826 #: build/C/man3/if_nametoindex.3:36
2827 #, no-wrap
2828 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2829 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2830
2831 #. type: Plain text
2832 #: build/C/man3/if_nametoindex.3:43
2833 msgid ""
2834 "The B<if_nametoindex>()  function returns the index of the network interface "
2835 "corresponding to the name I<ifname>."
2836 msgstr ""
2837 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2838 "のインデックスを返す。"
2839
2840 #. type: Plain text
2841 #: build/C/man3/if_nametoindex.3:54
2842 msgid ""
2843 "The B<if_indextoname>()  function returns the name of the network interface "
2844 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2845 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2846 "least B<IF_NAMESIZE> bytes."
2847 msgstr ""
2848 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2849 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2850 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2851 "る。"
2852
2853 #. type: Plain text
2854 #: build/C/man3/if_nametoindex.3:61
2855 msgid ""
2856 "On success, B<if_nametoindex>()  returns the index number of the network "
2857 "interface; on error, 0 is returned and I<errno> is set appropriately."
2858 msgstr ""
2859 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2860 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2861
2862 #. type: Plain text
2863 #: build/C/man3/if_nametoindex.3:69
2864 msgid ""
2865 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2866 "returned and I<errno> is set appropriately."
2867 msgstr ""
2868 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2869 "が返され、 I<errno> が適切に設定される。"
2870
2871 #. type: Plain text
2872 #: build/C/man3/if_nametoindex.3:74
2873 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2874 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2875
2876 #. type: TP
2877 #: build/C/man3/if_nametoindex.3:74
2878 #, no-wrap
2879 msgid "B<ENXIO>"
2880 msgstr "B<ENXIO>"
2881
2882 #. type: Plain text
2883 #: build/C/man3/if_nametoindex.3:77
2884 msgid "No interface found for the index."
2885 msgstr "インデックスに対応するインターフェースがない。"
2886
2887 #. type: Plain text
2888 #: build/C/man3/if_nametoindex.3:85
2889 msgid ""
2890 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2891 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2892 msgstr ""
2893 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2894 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2895
2896 #. type: Plain text
2897 #: build/C/man3/if_nametoindex.3:93
2898 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2899 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2900
2901 #. type: TH
2902 #: build/C/man2/listen.2:45
2903 #, no-wrap
2904 msgid "LISTEN"
2905 msgstr "LISTEN"
2906
2907 #. type: TH
2908 #: build/C/man2/listen.2:45
2909 #, no-wrap
2910 msgid "2008-11-20"
2911 msgstr "2008-11-20"
2912
2913 #. type: Plain text
2914 #: build/C/man2/listen.2:48
2915 msgid "listen - listen for connections on a socket"
2916 msgstr "listen - ソケット(socket)上の接続を待つ"
2917
2918 #. type: Plain text
2919 #: build/C/man2/listen.2:55
2920 #, no-wrap
2921 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2922 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2923
2924 #. type: Plain text
2925 #: build/C/man2/listen.2:63
2926 msgid ""
2927 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2928 "that is, as a socket that will be used to accept incoming connection "
2929 "requests using B<accept>(2)."
2930 msgstr ""
2931 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2932 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2933 "した接続要求を受け付けるのに使用されるソケットである。"
2934
2935 #. type: Plain text
2936 #: build/C/man2/listen.2:70
2937 msgid ""
2938 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2939 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2940 msgstr ""
2941 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2942 "するファイルディスクリプタである。"
2943
2944 #. type: Plain text
2945 #: build/C/man2/listen.2:82
2946 msgid ""
2947 "The I<backlog> argument defines the maximum length to which the queue of "
2948 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2949 "when the queue is full, the client may receive an error with an indication "
2950 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2951 "the request may be ignored so that a later reattempt at connection succeeds."
2952 msgstr ""
2953 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2954 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2955 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2956 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2957 "い。"
2958
2959 #. type: Plain text
2960 #: build/C/man2/listen.2:91
2961 msgid "Another socket is already listening on the same port."
2962 msgstr "別のソケットが既に同じポートを listen している。"
2963
2964 #. type: Plain text
2965 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
2966 msgid "The argument I<sockfd> is not a socket."
2967 msgstr "引き数 I<sockfd> はソケットではない。"
2968
2969 #. type: Plain text
2970 #: build/C/man2/listen.2:106
2971 msgid "The socket is not of a type that supports the B<listen>()  operation."
2972 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2973
2974 #. type: Plain text
2975 #: build/C/man2/listen.2:111
2976 msgid ""
2977 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2978 "4.2BSD."
2979 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2980
2981 #. type: Plain text
2982 #: build/C/man2/listen.2:113
2983 msgid "To accept connections, the following steps are performed:"
2984 msgstr "接続を受け付けるには、以下の処理が実行される。"
2985
2986 #. type: TP
2987 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
2988 #, no-wrap
2989 msgid "1."
2990 msgstr "1."
2991
2992 #. type: Plain text
2993 #: build/C/man2/listen.2:117
2994 msgid "A socket is created with B<socket>(2)."
2995 msgstr "B<socket>(2)  でソケットを作成する。"
2996
2997 #. type: TP
2998 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
2999 #, no-wrap
3000 msgid "2."
3001 msgstr "2."
3002
3003 #. type: Plain text
3004 #: build/C/man2/listen.2:123
3005 msgid ""
3006 "The socket is bound to a local address using B<bind>(2), so that other "
3007 "sockets may be B<connect>(2)ed to it."
3008 msgstr ""
3009 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3010 "のソケットに B<connect>(2)  できるようにする。"
3011
3012 #. type: TP
3013 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
3014 #, no-wrap
3015 msgid "3."
3016 msgstr "3."
3017
3018 #. type: Plain text
3019 #: build/C/man2/listen.2:127
3020 msgid ""
3021 "A willingness to accept incoming connections and a queue limit for incoming "
3022 "connections are specified with B<listen>()."
3023 msgstr ""
3024 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3025 "定する。"
3026
3027 #. type: TP
3028 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
3029 #, no-wrap
3030 msgid "4."
3031 msgstr "4."
3032
3033 #. type: Plain text
3034 #: build/C/man2/listen.2:130
3035 msgid "Connections are accepted with B<accept>(2)."
3036 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3037
3038 #. type: Plain text
3039 #: build/C/man2/listen.2:153
3040 msgid ""
3041 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3042 "2.2.  Now it specifies the queue length for I<completely> established "
3043 "sockets waiting to be accepted, instead of the number of incomplete "
3044 "connection requests.  The maximum length of the queue for incomplete sockets "
3045 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3046 "are enabled there is no logical maximum length and this setting is ignored.  "
3047 "See B<tcp>(7)  for more information."
3048 msgstr ""
3049 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3050 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3051 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3052 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3053 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3054 "論理的な最大長は存在せず、この設定は無視される。"
3055
3056 #.  The following is now rather historic information (MTK, Jun 05)
3057 #.  Don't rely on this value in portable applications since BSD
3058 #.  (and some BSD-derived systems) limit the backlog to 5.
3059 #. type: Plain text
3060 #: build/C/man2/listen.2:166
3061 msgid ""
3062 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3063 "somaxconn>, then it is silently truncated to that value; the default value "
3064 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3065 "value, B<SOMAXCONN>, with the value 128."
3066 msgstr ""
3067 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3068 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3069 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3070 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3071
3072 #. type: Plain text
3073 #: build/C/man2/listen.2:175
3074 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3075 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3076
3077 #. type: TH
3078 #: build/C/man2/recv.2:41
3079 #, no-wrap
3080 msgid "RECV"
3081 msgstr "RECV"
3082
3083 #. type: TH
3084 #: build/C/man2/recv.2:41
3085 #, no-wrap
3086 msgid "2013-04-19"
3087 msgstr "2013-04-19"
3088
3089 #. type: Plain text
3090 #: build/C/man2/recv.2:44
3091 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3092 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3093
3094 #. type: Plain text
3095 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3096 #: build/C/man2/select_tut.2:47
3097 #, no-wrap
3098 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3099 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3100
3101 #. type: Plain text
3102 #: build/C/man2/recv.2:53
3103 #, no-wrap
3104 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3105 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3106
3107 #. type: Plain text
3108 #: build/C/man2/recv.2:56
3109 #, no-wrap
3110 msgid ""
3111 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3112 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3113 msgstr ""
3114 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3115 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3116
3117 #. type: Plain text
3118 #: build/C/man2/recv.2:58
3119 #, no-wrap
3120 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3121 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3122
3123 #. type: Plain text
3124 #: build/C/man2/recv.2:66
3125 msgid ""
3126 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
3127 "a socket, and may be used to receive data on a socket whether or not it is "
3128 "connection-oriented."
3129 msgstr ""
3130 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3131 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3132 "接続指向 (connection-oriened) であってもなくてもよい。"
3133
3134 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3135 #.  .I src_addr
3136 #.  is filled in.
3137 #.  .I src_addr
3138 #.  is also filled in for stream sockets in the UNIX domain, but is not
3139 #.  filled in for stream sockets in the Internet domain.)
3140 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3141 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3142 #. type: Plain text
3143 #: build/C/man2/recv.2:95
3144 msgid ""
3145 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3146 "address, this source address is filled in.  When I<src_addr> is NULL, "
3147 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
3148 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
3149 "caller should initialize before the call to the size of the buffer "
3150 "associated with I<src_addr>, and modified on return to indicate the actual "
3151 "size of the source address.  The returned address is truncated if the buffer "
3152 "provided is too small; in this case, I<addrlen> will return a value greater "
3153 "than was supplied to the call."
3154 msgstr ""
3155 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3156 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3157 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3158 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3159 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3160 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3161 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3162 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3163 "な値が返される。"
3164
3165 #. type: Plain text
3166 #: build/C/man2/recv.2:107
3167 msgid ""
3168 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3169 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
3170 "argument."
3171 msgstr ""
3172 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3173 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3174 "()  と等価である。"
3175
3176 #. type: Plain text
3177 #: build/C/man2/recv.2:113
3178 msgid ""
3179 "All three routines return the length of the message on successful "
3180 "completion.  If a message is too long to fit in the supplied buffer, excess "
3181 "bytes may be discarded depending on the type of socket the message is "
3182 "received from."
3183 msgstr ""
3184 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3185 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3186 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3187
3188 #. type: Plain text
3189 #: build/C/man2/recv.2:123
3190 msgid ""
3191 "If no messages are available at the socket, the receive calls wait for a "
3192 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3193 "which case the value -1 is returned and the external variable I<errno> is "
3194 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3195 "data available, up to the requested amount, rather than waiting for receipt "
3196 "of the full amount requested."
3197 msgstr ""
3198 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3199 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3200 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3201 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3202 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3203 "る (受信されるデータの最大サイズは要求したサイズである)。"
3204
3205 #. type: Plain text
3206 #: build/C/man2/recv.2:129
3207 msgid ""
3208 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3209 "data arrives."
3210 msgstr ""
3211 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3212 "る。"
3213
3214 #. type: Plain text
3215 #: build/C/man2/recv.2:135
3216 msgid ""
3217 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
3218 "the following values:"
3219 msgstr ""
3220 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3221 "和 を取ったものを指定する:"
3222
3223 #. type: TP
3224 #: build/C/man2/recv.2:135
3225 #, no-wrap
3226 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3227 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3228
3229 #. type: Plain text
3230 #: build/C/man2/recv.2:146
3231 msgid ""
3232 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3233 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3234 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3235 "flag of B<open>(2)."
3236 msgstr ""
3237 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3238 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3239 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3240 "同じ理由で有用である。"
3241
3242 #. type: TP
3243 #: build/C/man2/recv.2:146 build/C/man2/send.2:188
3244 #, no-wrap
3245 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3246 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3247
3248 #. type: Plain text
3249 #: build/C/man2/recv.2:156
3250 msgid ""
3251 "Enables nonblocking operation; if the operation would block, the call fails "
3252 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3253 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3254 msgstr ""
3255 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3256 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3257 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3258
3259 #. type: TP
3260 #: build/C/man2/recv.2:156
3261 #, no-wrap
3262 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3263 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3264
3265 #. type: Plain text
3266 #: build/C/man2/recv.2:175
3267 msgid ""
3268 "This flag specifies that queued errors should be received from the socket "
3269 "error queue.  The error is passed in an ancillary message with a type "
3270 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3271 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3272 "information.  The payload of the original packet that caused the error is "
3273 "passed as normal data via I<msg_iovec>.  The original destination address of "
3274 "the datagram that caused the error is supplied via I<msg_name>."
3275 msgstr ""
3276 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3277 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3278 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3279 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3280 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3281 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3282 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3283 "I<msg_name> 経由で参照できる。"
3284
3285 #. type: Plain text
3286 #: build/C/man2/recv.2:187 build/C/man2/recv.2:250
3287 msgid ""
3288 "For local errors, no address is passed (this can be checked with the "
3289 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3290 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3291 "the pending socket error is regenerated based on the next queued error and "
3292 "will be passed on the next socket operation."
3293 msgstr ""
3294 "ローカルなエラーの場合はアドレスは渡されない\n"
3295 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3296 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3297 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3298 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3299
3300 #. type: Plain text
3301 #: build/C/man2/recv.2:191
3302 msgid "The error is supplied in a I<sock_extended_err> structure:"
3303 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3304
3305 #. type: Plain text
3306 #: build/C/man2/recv.2:198
3307 #, no-wrap
3308 msgid ""
3309 "#define SO_EE_ORIGIN_NONE    0\n"
3310 "#define SO_EE_ORIGIN_LOCAL   1\n"
3311 "#define SO_EE_ORIGIN_ICMP    2\n"
3312 "#define SO_EE_ORIGIN_ICMP6   3\n"
3313 msgstr ""
3314 "#define SO_EE_ORIGIN_NONE    0\n"
3315 "#define SO_EE_ORIGIN_LOCAL   1\n"
3316 "#define SO_EE_ORIGIN_ICMP    2\n"
3317 "#define SO_EE_ORIGIN_ICMP6   3\n"
3318
3319 #. type: Plain text
3320 #: build/C/man2/recv.2:210
3321 #, no-wrap
3322 msgid ""
3323 "struct sock_extended_err\n"
3324 "{\n"
3325 "    uint32_t ee_errno;   /* error number */\n"
3326 "    uint8_t  ee_origin;  /* where the error originated */\n"
3327 "    uint8_t  ee_type;    /* type */\n"
3328 "    uint8_t  ee_code;    /* code */\n"
3329 "    uint8_t  ee_pad;     /* padding */\n"
3330 "    uint32_t ee_info;    /* additional information */\n"
3331 "    uint32_t ee_data;    /* other data */\n"
3332 "    /* More data may follow */\n"
3333 "};\n"
3334 msgstr ""
3335 "struct sock_extended_err\n"
3336 "{\n"
3337 "    uint32_t ee_errno;   /* error number */\n"
3338 "    uint8_t  ee_origin;  /* where the error originated */\n"
3339 "    uint8_t  ee_type;    /* type */\n"
3340 "    uint8_t  ee_code;    /* code */\n"
3341 "    uint8_t  ee_pad;     /* padding */\n"
3342 "    uint32_t ee_info;    /* additional information */\n"
3343 "    uint32_t ee_data;    /* other data */\n"
3344 "    /* More data may follow */\n"
3345 "};\n"
3346
3347 #. type: Plain text
3348 #: build/C/man2/recv.2:212
3349 #, no-wrap
3350 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3351 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3352
3353 #. type: Plain text
3354 #: build/C/man2/recv.2:236
3355 msgid ""
3356 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3357 "is the origin code of where the error originated.  The other fields are "
3358 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3359 "address of the network object where the error originated from given a "
3360 "pointer to the ancillary message.  If this address is not known, the "
3361 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3362 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3363 "caused the error is passed as normal data."
3364 msgstr ""
3365 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3366 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3367 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3368 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3369 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3370 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3371 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3372 "される。"
3373
3374 #. type: TP
3375 #: build/C/man2/recv.2:250 build/C/man2/recv.2:381 build/C/man2/send.2:230
3376 #, no-wrap
3377 msgid "B<MSG_OOB>"
3378 msgstr "B<MSG_OOB>"
3379
3380 #. type: Plain text
3381 #: build/C/man2/recv.2:257
3382 msgid ""
3383 "This flag requests receipt of out-of-band data that would not be received in "
3384 "the normal data stream.  Some protocols place expedited data at the head of "
3385 "the normal data queue, and thus this flag cannot be used with such protocols."
3386 msgstr ""
3387 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3388 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3389 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3390 "い。"
3391
3392 #. type: TP
3393 #: build/C/man2/recv.2:257
3394 #, no-wrap
3395 msgid "B<MSG_PEEK>"
3396 msgstr "B<MSG_PEEK>"
3397
3398 #. type: Plain text
3399 #: build/C/man2/recv.2:264
3400 msgid ""
3401 "This flag causes the receive operation to return data from the beginning of "
3402 "the receive queue without removing that data from the queue.  Thus, a "
3403 "subsequent receive call will return the same data."
3404 msgstr ""
3405 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3406 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3407 "が返ることになる。"
3408
3409 #. type: TP
3410 #: build/C/man2/recv.2:264
3411 #, no-wrap
3412 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3413 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3414
3415 #. type: Plain text
3416 #: build/C/man2/recv.2:275
3417 msgid ""
3418 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3419 "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3420 "return the real length of the packet or datagram, even when it was longer "
3421 "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3422 "sockets."
3423 msgstr ""
3424 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3425 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3426 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3427 "場合にも、 パケットやデータグラムの実際の長さを返す。 UNIX ドメインソケット "
3428 "(B<unix>(7))  ソケットについては実装されていない。"
3429
3430 #. type: Plain text
3431 #: build/C/man2/recv.2:278
3432 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3433 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3434
3435 #. type: TP
3436 #: build/C/man2/recv.2:278
3437 #, no-wrap
3438 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3439 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3440
3441 #. type: Plain text
3442 #: build/C/man2/recv.2:285
3443 msgid ""
3444 "This flag requests that the operation block until the full request is "
3445 "satisfied.  However, the call may still return less data than requested if a "
3446 "signal is caught, an error or disconnect occurs, or the next data to be "
3447 "received is of a different type than that returned."
3448 msgstr ""
3449 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3450 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3451 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3452 "りデータが少なくても返ることがある。"
3453
3454 #. type: Plain text
3455 #: build/C/man2/recv.2:293
3456 msgid ""
3457 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3458 "directly supplied arguments.  This structure is defined as follows in "
3459 "I<E<lt>sys/socket.hE<gt>>:"
3460 msgstr ""
3461 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3462 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3463
3464 #. type: Plain text
3465 #: build/C/man2/recv.2:300
3466 #, no-wrap
3467 msgid ""
3468 "struct iovec {                    /* Scatter/gather array items */\n"
3469 "    void  *iov_base;              /* Starting address */\n"
3470 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3471 "};\n"
3472 msgstr ""
3473 "struct iovec {                    /* Scatter/gather array items */\n"
3474 "    void  *iov_base;              /* Starting address */\n"
3475 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3476 "};\n"
3477
3478 #. type: Plain text
3479 #: build/C/man2/recv.2:310 build/C/man2/send.2:258
3480 #, no-wrap
3481 msgid ""
3482 "struct msghdr {\n"
3483 "    void         *msg_name;       /* optional address */\n"
3484 "    socklen_t     msg_namelen;    /* size of address */\n"
3485 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3486 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3487 "    void         *msg_control;    /* ancillary data, see below */\n"
3488 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3489 "    int           msg_flags;      /* flags on received message */\n"
3490 "};\n"
3491 msgstr ""
3492 "struct msghdr {\n"
3493 "    void         *msg_name;       /* 追加のアドレス */\n"
3494 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3495 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3496 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3497 "    void         *msg_control;    /* 補助データ (後述) */\n"
3498 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3499 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3500 "};\n"
3501
3502 #. type: Plain text
3503 #: build/C/man2/recv.2:340
3504 msgid ""
3505 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3506 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3507 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3508 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3509 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3510 "other protocol control-related messages or miscellaneous ancillary data.  "
3511 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3512 "the available buffer in I<msg_control>; upon return from a successful call "
3513 "it will contain the length of the control message sequence."
3514 msgstr ""
3515 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3516 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3517 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3518 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3519 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3520 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3521 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3522 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3523 "さが入っている。"
3524
3525 #. type: Plain text
3526 #: build/C/man2/recv.2:342
3527 msgid "The messages are of the form:"
3528 msgstr "メッセージの形式は以下の通り:"
3529
3530 #. type: Plain text
3531 #: build/C/man2/recv.2:352
3532 #, no-wrap
3533 msgid ""
3534 "struct cmsghdr {\n"
3535 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3536 "    int           cmsg_level;   /* originating protocol */\n"
3537 "    int           cmsg_type;    /* protocol-specific type */\n"
3538 "/* followed by\n"
3539 "    unsigned char cmsg_data[]; */\n"
3540 "};\n"
3541 msgstr ""
3542 "struct cmsghdr {\n"
3543 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3544 "    int           cmsg_level;   /* originating protocol */\n"
3545 "    int           cmsg_type;    /* protocol-specific type */\n"
3546 "/* followed by\n"
3547 "    unsigned char cmsg_data[]; */\n"
3548 "};\n"
3549
3550 #. type: Plain text
3551 #: build/C/man2/recv.2:357
3552 msgid ""
3553 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3554 msgstr ""
3555 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3556
3557 #. type: Plain text
3558 #: build/C/man2/recv.2:360
3559 msgid ""
3560 "As an example, Linux uses this ancillary data mechanism to pass extended "
3561 "errors, IP options, or file descriptors over UNIX domain sockets."
3562 msgstr ""
3563 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3564 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3565 "いる。"
3566
3567 #. type: Plain text
3568 #: build/C/man2/recv.2:368
3569 msgid ""
3570 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3571 "It can contain several flags:"
3572 msgstr ""
3573 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3574 "れる。ここにはいくつかのフラグが入る。"
3575
3576 #. type: TP
3577 #: build/C/man2/recv.2:368
3578 #, no-wrap
3579 msgid "B<MSG_EOR>"
3580 msgstr "B<MSG_EOR>"
3581
3582 #. type: Plain text
3583 #: build/C/man2/recv.2:373
3584 msgid ""
3585 "indicates end-of-record; the data returned completed a record (generally "
3586 "used with sockets of type B<SOCK_SEQPACKET>)."
3587 msgstr ""
3588 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3589 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3590
3591 #. type: TP
3592 #: build/C/man2/recv.2:373
3593 #, no-wrap
3594 msgid "B<MSG_TRUNC>"
3595 msgstr "B<MSG_TRUNC>"
3596
3597 #. type: Plain text
3598 #: build/C/man2/recv.2:377
3599 msgid ""
3600 "indicates that the trailing portion of a datagram was discarded because the "
3601 "datagram was larger than the buffer supplied."
3602 msgstr ""
3603 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3604 "た部分が捨てられたことを示す。"
3605
3606 #. type: TP
3607 #: build/C/man2/recv.2:377
3608 #, no-wrap
3609 msgid "B<MSG_CTRUNC>"
3610 msgstr "B<MSG_CTRUNC>"
3611
3612 #. type: Plain text
3613 #: build/C/man2/recv.2:381
3614 msgid ""
3615 "indicates that some control data were discarded due to lack of space in the "
3616 "buffer for ancillary data."
3617 msgstr ""
3618 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3619 "を示す。"
3620
3621 #. type: Plain text
3622 #: build/C/man2/recv.2:384
3623 msgid ""
3624 "is returned to indicate that expedited or out-of-band data were received."
3625 msgstr "速達データや帯域外データを受信したことを示す。"
3626
3627 #. type: TP
3628 #: build/C/man2/recv.2:384
3629 #, no-wrap
3630 msgid "B<MSG_ERRQUEUE>"
3631 msgstr "B<MSG_ERRQUEUE>"
3632
3633 #. type: Plain text
3634 #: build/C/man2/recv.2:388
3635 msgid ""
3636 "indicates that no data was received but an extended error from the socket "
3637 "error queue."
3638 msgstr ""
3639 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3640 "を示す。"
3641
3642 #. type: Plain text
3643 #: build/C/man2/recv.2:396
3644 msgid ""
3645 "These calls return the number of bytes received, or -1 if an error "
3646 "occurred.  In the event of an error, I<errno> is set to indicate the error.  "
3647 "The return value will be 0 when the peer has performed an orderly shutdown."
3648 msgstr ""
3649 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3650 "にエラーを示す値を設定する。  接続先が正しくシャットダウンを実行した場合は、"
3651 "返り値は 0 となる。"
3652
3653 #. type: Plain text
3654 #: build/C/man2/recv.2:401
3655 msgid ""
3656 "These are some standard errors generated by the socket layer.  Additional "
3657 "errors may be generated and returned from the underlying protocol modules; "
3658 "see their manual pages."
3659 msgstr ""
3660 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3661 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3662 "ること。"
3663
3664 #.  Actually EAGAIN on Linux
3665 #. type: Plain text
3666 #: build/C/man2/recv.2:410
3667 msgid ""
3668 "The socket is marked nonblocking and the receive operation would block, or a "
3669 "receive timeout had been set and the timeout expired before data was "
3670 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3671 "and does not require these constants to have the same value, so a portable "
3672 "application should check for both possibilities."
3673 msgstr ""
3674 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3675 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3676 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3677 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3678 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3679
3680 #. type: Plain text
3681 #: build/C/man2/recv.2:415
3682 msgid "The argument I<sockfd> is an invalid descriptor."
3683 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3684
3685 #. type: Plain text
3686 #: build/C/man2/recv.2:419
3687 msgid ""
3688 "A remote host refused to allow the network connection (typically because it "
3689 "is not running the requested service)."
3690 msgstr ""
3691 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3692 "たサービスが起動されていないなどがある)。"
3693
3694 #. type: Plain text
3695 #: build/C/man2/recv.2:423
3696 msgid ""
3697 "The receive buffer pointer(s) point outside the process's address space."
3698 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3699
3700 #. type: Plain text
3701 #: build/C/man2/recv.2:428
3702 msgid ""
3703 "The receive was interrupted by delivery of a signal before any data were "
3704 "available; see B<signal>(7)."
3705 msgstr ""
3706 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3707
3708 #. type: Plain text
3709 #: build/C/man2/recv.2:432 build/C/man2/send.2:323
3710 msgid "Invalid argument passed."
3711 msgstr "不正な引き数が渡された。"
3712
3713 #. type: Plain text
3714 #: build/C/man2/recv.2:436
3715 msgid "Could not allocate memory for B<recvmsg>()."
3716 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3717
3718 #. type: TP
3719 #: build/C/man2/recv.2:436 build/C/man2/send.2:346
3720 #, no-wrap
3721 msgid "B<ENOTCONN>"
3722 msgstr "B<ENOTCONN>"
3723
3724 #. type: Plain text
3725 #: build/C/man2/recv.2:443
3726 msgid ""
3727 "The socket is associated with a connection-oriented protocol and has not "
3728 "been connected (see B<connect>(2)  and B<accept>(2))."
3729 msgstr ""
3730 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3731 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3732
3733 #. type: Plain text
3734 #: build/C/man2/recv.2:448
3735 msgid "The argument I<sockfd> does not refer to a socket."
3736 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3737
3738 #. type: Plain text
3739 #: build/C/man2/recv.2:451
3740 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3741 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3742
3743 #. type: Plain text
3744 #: build/C/man2/recv.2:458
3745 msgid ""
3746 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3747 "flags."
3748 msgstr ""
3749 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3750 "されている。"
3751
3752 #. type: Plain text
3753 #: build/C/man2/recv.2:474
3754 msgid ""
3755 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3756 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3757 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3758 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3759 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3760 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3761 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3762 msgstr ""
3763 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3764 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3765 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3766 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3767 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3768 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3769 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3770
3771 #.  glibc bug raised 12 Mar 2006
3772 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3773 #.  The problem is an underlying kernel issue: the size of the
3774 #.  __kernel_size_t type used to type this field varies
3775 #.  across architectures, but socklen_t is always 32 bits.
3776 #. type: Plain text
3777 #: build/C/man2/recv.2:488 build/C/man2/send.2:409
3778 msgid ""
3779 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3780 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3781 "I<size_t>."
3782 msgstr ""
3783 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3784 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3785 "ある。"
3786
3787 #. type: Plain text
3788 #: build/C/man2/recv.2:493
3789 msgid ""
3790 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3791 "can be used to receive multiple datagrams in a single call."
3792 msgstr ""
3793 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3794 "固有の システムコールに関する情報が書かれている。"
3795
3796 #. type: Plain text
3797 #: build/C/man2/recv.2:498
3798 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3799 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3800
3801 #. type: Plain text
3802 #: build/C/man2/recv.2:509
3803 msgid ""
3804 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3805 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3806 msgstr ""
3807 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3808 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3809
3810 #. type: TH
3811 #: build/C/man2/recvmmsg.2:31
3812 #, no-wrap
3813 msgid "RECVMMSG"
3814 msgstr "RECVMMSG"
3815
3816 #. type: TH
3817 #: build/C/man2/recvmmsg.2:31
3818 #, no-wrap
3819 msgid "2012-12-24"
3820 msgstr "2012-12-24"
3821
3822 #. type: Plain text
3823 #: build/C/man2/recvmmsg.2:34
3824 msgid "recvmmsg - receive multiple messages on a socket"
3825 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
3826
3827 #. type: Plain text
3828 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3829 #, no-wrap
3830 msgid ""
3831 "B<#define _GNU_SOURCE>\n"
3832 "B<#include E<lt>sys/socket.hE<gt>>\n"
3833 msgstr ""
3834 "B<#define _GNU_SOURCE>\n"
3835 "B<#include E<lt>sys/socket.hE<gt>>\n"
3836
3837 #. type: Plain text
3838 #: build/C/man2/recvmmsg.2:41
3839 #, no-wrap
3840 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3841 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3842
3843 #. type: Plain text
3844 #: build/C/man2/recvmmsg.2:43
3845 #, no-wrap
3846 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3847 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3848
3849 #. type: Plain text
3850 #: build/C/man2/recvmmsg.2:55
3851 msgid ""
3852 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3853 "the caller to receive multiple messages from a socket using a single system "
3854 "call.  (This has performance benefits for some applications.)  A further "
3855 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3856 "operation."
3857 msgstr ""
3858 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
3859 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
3860 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
3861 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
3862
3863 #. type: Plain text
3864 #: build/C/man2/recvmmsg.2:59
3865 msgid ""
3866 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3867 "from."
3868 msgstr ""
3869 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
3870
3871 #. type: Plain text
3872 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
3873 msgid ""
3874 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3875 "The size of this array is specified in I<vlen>."
3876 msgstr ""
3877 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
3878 "I<vlen> で指定する。"
3879
3880 #. type: Plain text
3881 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
3882 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3883 msgstr ""
3884 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
3885
3886 #. type: Plain text
3887 #: build/C/man2/recvmmsg.2:80
3888 #, no-wrap
3889 msgid ""
3890 "struct mmsghdr {\n"
3891 "    struct msghdr msg_hdr;  /* Message header */\n"
3892 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3893 "};\n"
3894 msgstr ""
3895 "struct mmsghdr {\n"
3896 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
3897 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
3898 "};\n"
3899
3900 #. type: Plain text
3901 #: build/C/man2/recvmmsg.2:95
3902 msgid ""
3903 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3904 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3905 "in the entry.  This field has the same value as the return value of a single "
3906 "B<recvmsg>(2)  on the header."
3907 msgstr ""
3908 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
3909 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
3910 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
3911 "る。"
3912
3913 #. type: Plain text
3914 #: build/C/man2/recvmmsg.2:102
3915 msgid ""
3916 "The I<flags> argument contains flags ORed together.  The flags are the same "
3917 "as documented for B<recvmsg>(2), with the following addition:"
3918 msgstr ""
3919 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
3920 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
3921
3922 #. type: TP
3923 #: build/C/man2/recvmmsg.2:102
3924 #, no-wrap
3925 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
3926 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
3927
3928 #. type: Plain text
3929 #: build/C/man2/recvmmsg.2:107
3930 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3931 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
3932
3933 #. type: Plain text
3934 #: build/C/man2/recvmmsg.2:123
3935 msgid ""
3936 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3937 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3938 "operation.  (This interval will be rounded up to the system clock "
3939 "granularity, and kernel scheduling delays mean that the blocking interval "
3940 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
3941 "blocks indefinitely."
3942 msgstr ""
3943 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
3944 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (待ち時間は"
3945 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延により少"
3946 "しだけ長くなる可能性がある)。 I<timeout>が I<NULL> の場合、 受信操作は無期限"
3947 "に停止 (block) する。"
3948
3949 #. type: Plain text
3950 #: build/C/man2/recvmmsg.2:134
3951 msgid ""
3952 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3953 "received or until the timeout expires.  A nonblocking call reads as many "
3954 "messages as are available (up to the limit specified by I<vlen>)  and "
3955 "returns immediately."
3956 msgstr ""
3957 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
3958 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
3959 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
3960 "すぐに返る。"
3961
3962 #. type: Plain text
3963 #: build/C/man2/recvmmsg.2:149
3964 msgid ""
3965 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3966 "to contain information about each received message: I<msg_len> contains the "
3967 "size of the received message; the subfields of I<msg_hdr> are updated as "
3968 "described in B<recvmsg>(2).  The return value of the call indicates the "
3969 "number of elements of I<msgvec> that have been updated."
3970 msgstr ""
3971 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
3972 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
3973 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
3974 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
3975 "数である。"
3976
3977 #. type: Plain text
3978 #: build/C/man2/recvmmsg.2:157
3979 msgid ""
3980 "On success, B<recvmmsg>()  returns the number of messages received in "
3981 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3982 "error."
3983 msgstr ""
3984 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
3985 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
3986
3987 #. type: Plain text
3988 #: build/C/man2/recvmmsg.2:161
3989 msgid ""
3990 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3991 msgstr ""
3992 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
3993 "がある。"
3994
3995 #. type: Plain text
3996 #: build/C/man2/recvmmsg.2:165
3997 msgid "I<timeout> is invalid."
3998 msgstr "I<timeout> が無効である。"
3999
4000 #. type: Plain text
4001 #: build/C/man2/recvmmsg.2:170
4002 msgid ""
4003 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4004 "was added in version 2.12."
4005 msgstr ""
4006 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4007 "はバージョン 2.12 以降で利用可能である。"
4008
4009 #. type: Plain text
4010 #: build/C/man2/recvmmsg.2:173
4011 msgid "B<recvmmsg>()  is Linux-specific."
4012 msgstr "B<recvmmsg>() は Linux 固有である。"
4013
4014 #. type: Plain text
4015 #: build/C/man2/recvmmsg.2:181
4016 msgid ""
4017 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4018 "socket and stores them in multiple buffers.  The call returns if all buffers "
4019 "are filled or if the timeout specified has expired."
4020 msgstr ""
4021 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4022 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4023 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4024
4025 #. type: Plain text
4026 #: build/C/man2/recvmmsg.2:184
4027 msgid ""
4028 "The following snippet periodically generates UDP datagrams containing a "
4029 "random number:"
4030 msgstr ""
4031 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4032 "る。"
4033
4034 #. type: Plain text
4035 #: build/C/man2/recvmmsg.2:189
4036 #, no-wrap
4037 msgid ""
4038 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4039 "B<sleep 0.25; done>\n"
4040 msgstr ""
4041 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4042 "B<sleep 0.25; done>\n"
4043
4044 #. type: Plain text
4045 #: build/C/man2/recvmmsg.2:194
4046 msgid ""
4047 "These datagrams are read by the example application, which can give the "
4048 "following output:"
4049 msgstr ""
4050 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4051 "が得られる。"
4052
4053 #. type: Plain text
4054 #: build/C/man2/recvmmsg.2:204
4055 #, no-wrap
4056 msgid ""
4057 "$B< ./a.out>\n"
4058 "5 messages received\n"
4059 "1 11782\n"
4060 "2 11345\n"
4061 "3 304\n"
4062 "4 13514\n"
4063 "5 28421\n"
4064 msgstr ""
4065 "$B< ./a.out>\n"
4066 "5 messages received\n"
4067 "1 11782\n"
4068 "2 11345\n"
4069 "3 304\n"
4070 "4 13514\n"
4071 "5 28421\n"
4072
4073 #. type: Plain text
4074 #: build/C/man2/recvmmsg.2:215
4075 #, no-wrap
4076 msgid ""
4077 "#define _GNU_SOURCE\n"
4078 "#include E<lt>netinet/ip.hE<gt>\n"
4079 "#include E<lt>stdio.hE<gt>\n"
4080 "#include E<lt>stdlib.hE<gt>\n"
4081 "#include E<lt>string.hE<gt>\n"
4082 "#include E<lt>sys/socket.hE<gt>\n"
4083 msgstr ""
4084 "#define _GNU_SOURCE\n"
4085 "#include E<lt>netinet/ip.hE<gt>\n"
4086 "#include E<lt>stdio.hE<gt>\n"
4087 "#include E<lt>stdlib.hE<gt>\n"
4088 "#include E<lt>string.hE<gt>\n"
4089 "#include E<lt>sys/socket.hE<gt>\n"
4090
4091 #. type: Plain text
4092 #: build/C/man2/recvmmsg.2:228
4093 #, no-wrap
4094 msgid ""
4095 "int\n"
4096 "main(void)\n"
4097 "{\n"
4098 "#define VLEN 10\n"
4099 "#define BUFSIZE 200\n"
4100 "#define TIMEOUT 1\n"
4101 "    int sockfd, retval, i;\n"
4102 "    struct sockaddr_in sa;\n"
4103 "    struct mmsghdr msgs[VLEN];\n"
4104 "    struct iovec iovecs[VLEN];\n"
4105 "    char bufs[VLEN][BUFSIZE+1];\n"
4106 "    struct timespec timeout;\n"
4107 msgstr ""
4108 "int\n"
4109 "main(void)\n"
4110 "{\n"
4111 "#define VLEN 10\n"
4112 "#define BUFSIZE 200\n"
4113 "#define TIMEOUT 1\n"
4114 "    int sockfd, retval, i;\n"
4115 "    struct sockaddr_in sa;\n"
4116 "    struct mmsghdr msgs[VLEN];\n"
4117 "    struct iovec iovecs[VLEN];\n"
4118 "    char bufs[VLEN][BUFSIZE+1];\n"
4119 "    struct timespec timeout;\n"
4120
4121 #. type: Plain text
4122 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4123 #, no-wrap
4124 msgid ""
4125 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4126 "    if (sockfd == -1) {\n"
4127 "        perror(\"socket()\");\n"
4128 "        exit(EXIT_FAILURE);\n"
4129 "    }\n"
4130 msgstr ""
4131 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4132 "    if (sockfd == -1) {\n"
4133 "        perror(\"socket()\");\n"
4134 "        exit(EXIT_FAILURE);\n"
4135 "    }\n"
4136
4137 #. type: Plain text
4138 #: build/C/man2/recvmmsg.2:242
4139 #, no-wrap
4140 msgid ""
4141 "    sa.sin_family = AF_INET;\n"
4142 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4143 "    sa.sin_port = htons(1234);\n"
4144 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4145 "        perror(\"bind()\");\n"
4146 "        exit(EXIT_FAILURE);\n"
4147 "    }\n"
4148 msgstr ""
4149 "    sa.sin_family = AF_INET;\n"
4150 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4151 "    sa.sin_port = htons(1234);\n"
4152 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4153 "        perror(\"bind()\");\n"
4154 "        exit(EXIT_FAILURE);\n"
4155 "    }\n"
4156
4157 #. type: Plain text
4158 #: build/C/man2/recvmmsg.2:250
4159 #, no-wrap
4160 msgid ""
4161 "    memset(msgs, 0, sizeof(msgs));\n"
4162 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4163 "        iovecs[i].iov_base         = bufs[i];\n"
4164 "        iovecs[i].iov_len          = BUFSIZE;\n"
4165 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4166 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4167 "    }\n"
4168 msgstr ""
4169 "    memset(msgs, 0, sizeof(msgs));\n"
4170 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4171 "        iovecs[i].iov_base         = bufs[i];\n"
4172 "        iovecs[i].iov_len          = BUFSIZE;\n"
4173 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4174 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4175 "    }\n"
4176
4177 #. type: Plain text
4178 #: build/C/man2/recvmmsg.2:253
4179 #, no-wrap
4180 msgid ""
4181 "    timeout.tv_sec = TIMEOUT;\n"
4182 "    timeout.tv_nsec = 0;\n"
4183 msgstr ""
4184 "    timeout.tv_sec = TIMEOUT;\n"
4185 "    timeout.tv_nsec = 0;\n"
4186
4187 #. type: Plain text
4188 #: build/C/man2/recvmmsg.2:259
4189 #, no-wrap
4190 msgid ""
4191 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4192 "    if (retval == -1) {\n"
4193 "        perror(\"recvmmsg()\");\n"
4194 "        exit(EXIT_FAILURE);\n"
4195 "    }\n"
4196 msgstr ""
4197 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4198 "    if (retval == -1) {\n"
4199 "        perror(\"recvmmsg()\");\n"
4200 "        exit(EXIT_FAILURE);\n"
4201 "    }\n"
4202
4203 #. type: Plain text
4204 #: build/C/man2/recvmmsg.2:267
4205 #, no-wrap
4206 msgid ""
4207 "    printf(\"%d messages received\\en\", retval);\n"
4208 "    for (i = 0; i E<lt> retval; i++) {\n"
4209 "        bufs[i][msgs[i].msg_len] = 0;\n"
4210 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4211 "    }\n"
4212 "    exit(EXIT_SUCCESS);\n"
4213 "}\n"
4214 msgstr ""
4215 "    printf(\"%d messages received\\en\", retval);\n"
4216 "    for (i = 0; i E<lt> retval; i++) {\n"
4217 "        bufs[i][msgs[i].msg_len] = 0;\n"
4218 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4219 "    }\n"
4220 "    exit(EXIT_SUCCESS);\n"
4221 "}\n"
4222
4223 #. type: Plain text
4224 #: build/C/man2/recvmmsg.2:275
4225 msgid ""
4226 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4227 "(2), B<socket>(7)"
4228 msgstr ""
4229 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4230 "(2), B<socket>(7)"
4231
4232 #. type: TH
4233 #: build/C/man2/select.2:38
4234 #, no-wrap
4235 msgid "SELECT"
4236 msgstr "SELECT"
4237
4238 #. type: TH
4239 #: build/C/man2/select.2:38
4240 #, no-wrap
4241 msgid "2012-08-17"
4242 msgstr "2012-08-17"
4243
4244 #. type: Plain text
4245 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4246 msgid ""
4247 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4248 "multiplexing"
4249 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4250
4251 #. type: Plain text
4252 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4253 #, no-wrap
4254 msgid "/* According to POSIX.1-2001 */\n"
4255 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4256
4257 #. type: Plain text
4258 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4259 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4260 #, no-wrap
4261 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4262 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4263
4264 #. type: Plain text
4265 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4266 #, no-wrap
4267 msgid "/* According to earlier standards */\n"
4268 msgstr "/* 以前の規格に従う場合 */\n"
4269
4270 #. type: Plain text
4271 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4272 #, no-wrap
4273 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4274 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4275
4276 #. type: Plain text
4277 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4278 #, no-wrap
4279 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4280 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4281
4282 #. type: Plain text
4283 #: build/C/man2/select.2:58
4284 #, no-wrap
4285 msgid ""
4286 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4287 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4288 msgstr ""
4289 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4290 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4291
4292 #. type: Plain text
4293 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4294 #, no-wrap
4295 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4296 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4297
4298 #. type: Plain text
4299 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4300 #, no-wrap
4301 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4302 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4303
4304 #. type: Plain text
4305 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4306 #, no-wrap
4307 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4308 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4309
4310 #. type: Plain text
4311 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4312 #, no-wrap
4313 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4314 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4315
4316 #. type: Plain text
4317 #: build/C/man2/select.2:72
4318 #, no-wrap
4319 msgid ""
4320 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4321 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4322 "B<            const sigset_t *>I<sigmask>B<);>\n"
4323 msgstr ""
4324 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4325 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4326 "B<            const sigset_t *>I<sigmask>B<);>\n"
4327
4328 #. type: Plain text
4329 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4330 #: build/C/man3/sockatmark.3:36
4331 msgid ""
4332 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4333 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4334
4335 #. type: Plain text
4336 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4337 msgid ""
4338 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4339 "600"
4340 msgstr ""
4341 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4342 "600"
4343
4344 #. type: Plain text
4345 #: build/C/man2/select.2:92
4346 msgid ""
4347 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4348 "descriptors, waiting until one or more of the file descriptors become \"ready"
4349 "\" for some class of I/O operation (e.g., input possible).  A file "
4350 "descriptor is considered ready if it is possible to perform the "
4351 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4352 msgstr ""
4353 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4354 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4355 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4356 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4357 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4358 "意味する。"
4359
4360 #. type: Plain text
4361 #: build/C/man2/select.2:98
4362 msgid ""
4363 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4364 "these three differences:"
4365 msgstr ""
4366 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4367
4368 #. type: TP
4369 #: build/C/man2/select.2:98
4370 #, no-wrap
4371 msgid "(i)"
4372 msgstr "(i)"
4373
4374 #. type: Plain text
4375 #: build/C/man2/select.2:108
4376 msgid ""
4377 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4378 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4379 "and nanoseconds)."
4380 msgstr ""
4381 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4382 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4383 "timespec> (秒・ナノ秒単位) を用いる。"
4384
4385 #. type: TP
4386 #: build/C/man2/select.2:108
4387 #, no-wrap
4388 msgid "(ii)"
4389 msgstr "(ii)"
4390
4391 #. type: Plain text
4392 #: build/C/man2/select.2:116
4393 msgid ""
4394 "B<select>()  may update the I<timeout> argument to indicate how much time "
4395 "was left.  B<pselect>()  does not change this argument."
4396 msgstr ""
4397 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4398 "B<pselect>()  はこの引き数を変更しない。"
4399
4400 #. type: TP
4401 #: build/C/man2/select.2:116
4402 #, no-wrap
4403 msgid "(iii)"
4404 msgstr "(iii)"
4405
4406 #. type: Plain text
4407 #: build/C/man2/select.2:125
4408 msgid ""
4409 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4410 "with NULL I<sigmask>."
4411 msgstr ""
4412 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4413 "指定した場合の B<pselect>()  と同じである。"
4414
4415 #. type: Plain text
4416 #: build/C/man2/select.2:143
4417 msgid ""
4418 "Three independent sets of file descriptors are watched.  Those listed in "
4419 "I<readfds> will be watched to see if characters become available for reading "
4420 "(more precisely, to see if a read will not block; in particular, a file "
4421 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4422 "watched to see if a write will not block, and those in I<exceptfds> will be "
4423 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4424 "which file descriptors actually changed status.  Each of the three file "
4425 "descriptor sets may be specified as NULL if no file descriptors are to be "
4426 "watched for the corresponding class of events."
4427 msgstr ""
4428 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4429 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4430 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4431 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4432 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4433 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4434 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4435 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4436 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4437 "指定することができる。"
4438
4439 #. type: Plain text
4440 #: build/C/man2/select.2:156
4441 msgid ""
4442 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4443 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4444 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4445 "part of the set; this is useful after B<select>()  returns."
4446 msgstr ""
4447 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4448 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4449 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4450 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4451 "る。"
4452
4453 #. type: Plain text
4454 #: build/C/man2/select.2:159
4455 msgid ""
4456 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4457 "plus 1."
4458 msgstr ""
4459 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4460 "のである。"
4461
4462 #. type: Plain text
4463 #: build/C/man2/select.2:179
4464 msgid ""
4465 "The I<timeout> argument specifies the minimum interval that B<select>()  "
4466 "should block waiting for a file descriptor to become ready.  (This interval "
4467 "will be rounded up to the system clock granularity, and kernel scheduling "
4468 "delays mean that the blocking interval may overrun by a small amount.)  If "
4469 "both fields of the I<timeval> structure are zero, then B<select>()  returns "
4470 "immediately.  (This is useful for polling.)  If I<timeout> is NULL (no "
4471 "timeout), B<select>()  can block indefinitely."
4472 msgstr ""
4473 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4474 "B<select>() が停止する最小の停止時間を指定する\n"
4475 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4476 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4477 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4478 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4479 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4480 "期限に停止 (block) する。"
4481
4482 #. type: Plain text
4483 #: build/C/man2/select.2:189
4484 msgid ""
4485 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4486 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4487 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4488 "restores the original signal mask."
4489 msgstr ""
4490 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4491 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4492 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4493 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4494
4495 #. type: Plain text
4496 #: build/C/man2/select.2:195
4497 msgid ""
4498 "Other than the difference in the precision of the I<timeout> argument, the "
4499 "following B<pselect>()  call:"
4500 msgstr ""
4501 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4502
4503 #. type: Plain text
4504 #: build/C/man2/select.2:199
4505 #, no-wrap
4506 msgid ""
4507 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4508 "                    timeout, &sigmask);\n"
4509 msgstr ""
4510 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4511 "                    timeout, &sigmask);\n"
4512
4513 #. type: Plain text
4514 #: build/C/man2/select.2:204
4515 msgid "is equivalent to I<atomically> executing the following calls:"
4516 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4517
4518 #. type: Plain text
4519 #: build/C/man2/select.2:207
4520 #, no-wrap
4521 msgid "    sigset_t origmask;\n"
4522 msgstr "    sigset_t origmask;\n"
4523
4524 #. type: Plain text
4525 #: build/C/man2/select.2:211
4526 #, no-wrap
4527 msgid ""
4528 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4529 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4530 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4531 msgstr ""
4532 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4533 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4534 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4535
4536 #. type: Plain text
4537 #: build/C/man2/select.2:232
4538 msgid ""
4539 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4540 "either a signal or for a file descriptor to become ready, then an atomic "
4541 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4542 "a global flag and returns.  Then a test of this global flag followed by a "
4543 "call of B<select>()  could hang indefinitely if the signal arrived just "
4544 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4545 "one to first block signals, handle the signals that have come in, then call "
4546 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4547 msgstr ""
4548 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4549 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4550 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4551 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4552 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4553 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4554 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4555 "で、前記の競合を避けることができる。)"
4556
4557 #. type: SS
4558 #: build/C/man2/select.2:232
4559 #, no-wrap
4560 msgid "The timeout"
4561 msgstr "タイムアウト"
4562
4563 #. type: Plain text
4564 #: build/C/man2/select.2:236
4565 msgid ""
4566 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4567 "like"
4568 msgstr ""
4569 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4570
4571 #. type: Plain text
4572 #: build/C/man2/select.2:243
4573 #, no-wrap
4574 msgid ""
4575 "struct timeval {\n"
4576 "    long    tv_sec;         /* seconds */\n"
4577 "    long    tv_usec;        /* microseconds */\n"
4578 "};\n"
4579 msgstr ""
4580 "struct timeval {\n"
4581 "    long    tv_sec;         /* 秒 */\n"
4582 "    long    tv_usec;        /* マイクロ秒 */\n"
4583 "};\n"
4584
4585 #. type: Plain text
4586 #: build/C/man2/select.2:247
4587 msgid "and"
4588 msgstr "や"
4589
4590 #. type: Plain text
4591 #: build/C/man2/select.2:254
4592 #, no-wrap
4593 msgid ""
4594 "struct timespec {\n"
4595 "    long    tv_sec;         /* seconds */\n"
4596 "    long    tv_nsec;        /* nanoseconds */\n"
4597 "};\n"
4598 msgstr ""
4599 "struct timespec {\n"
4600 "    long    tv_sec;         /* 秒 */\n"
4601 "    long    tv_nsec;        /* ナノ秒 */\n"
4602 "};\n"
4603
4604 #. type: Plain text
4605 #: build/C/man2/select.2:258
4606 msgid "(However, see below on the POSIX.1-2001 versions.)"
4607 msgstr ""
4608 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4609 "照)"
4610
4611 #. type: Plain text
4612 #: build/C/man2/select.2:266
4613 msgid ""
4614 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4615 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4616 "precision."
4617 msgstr ""
4618 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4619 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4620 "呼び出すという方法を使っているコードもある。"
4621
4622 #.  .PP - it is rumored that:
4623 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4624 #.  - it is certainly true that:
4625 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4626 #. type: Plain text
4627 #: build/C/man2/select.2:289
4628 msgid ""
4629 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4630 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4631 "either behavior.)  This causes problems both when Linux code which reads "
4632 "I<timeout> is ported to other operating systems, and when code is ported to "
4633 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4634 "without reinitializing it.  Consider I<timeout> to be undefined after "
4635 "B<select>()  returns."
4636 msgstr ""
4637 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4638 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4639 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4640 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4641 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4642 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4643 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4644 "ある。"
4645
4646 #. type: Plain text
4647 #: build/C/man2/select.2:306
4648 msgid ""
4649 "On success, B<select>()  and B<pselect>()  return the number of file "
4650 "descriptors contained in the three returned descriptor sets (that is, the "
4651 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4652 "which may be zero if the timeout expires before anything interesting "
4653 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4654 "sets and I<timeout> become undefined, so do not rely on their contents after "
4655 "an error."
4656 msgstr ""
4657 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4658 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4659 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4660 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4661 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4662 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4663
4664 #. type: Plain text
4665 #: build/C/man2/select.2:312
4666 msgid ""
4667 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4668 "descriptor that was already closed, or one on which an error has occurred.)"
4669 msgstr ""
4670 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4671 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4672 "タが指定された)。"
4673
4674 #. type: Plain text
4675 #: build/C/man2/select.2:316
4676 msgid "A signal was caught; see B<signal>(7)."
4677 msgstr "シグナルを受信した。"
4678
4679 #. type: Plain text
4680 #: build/C/man2/select.2:322
4681 msgid ""
4682 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4683 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4684
4685 #. type: Plain text
4686 #: build/C/man2/select.2:325
4687 msgid "unable to allocate memory for internal tables."
4688 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4689
4690 #. type: Plain text
4691 #: build/C/man2/select.2:331
4692 msgid ""
4693 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4694 "()  was emulated in glibc (but see BUGS)."
4695 msgstr ""
4696 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4697 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4698
4699 #. type: Plain text
4700 #: build/C/man2/select.2:342
4701 msgid ""
4702 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4703 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4704 "clones of the BSD socket layer (including System V variants).  However, note "
4705 "that the System V variant typically sets the timeout variable before exit, "
4706 "but the BSD variant does not."
4707 msgstr ""
4708 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4709 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4710 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4711 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4712 "ること。"
4713
4714 #. type: Plain text
4715 #: build/C/man2/select.2:346
4716 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4717 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4718
4719 #. type: Plain text
4720 #: build/C/man2/select.2:363
4721 msgid ""
4722 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4723 "with a value of I<fd> that is negative or is equal to or larger than "
4724 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4725 "I<fd> to be a valid file descriptor."
4726 msgstr ""
4727 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4728 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4729 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4730 "プタでなければならないと規定されている。"
4731
4732 #. type: Plain text
4733 #: build/C/man2/select.2:372
4734 msgid ""
4735 "Concerning the types involved, the classical situation is that the two "
4736 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4737 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4738 "situation is"
4739 msgstr ""
4740 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4741 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4742 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4743
4744 #. type: Plain text
4745 #: build/C/man2/select.2:379
4746 #, no-wrap
4747 msgid ""
4748 "struct timeval {\n"
4749 "    time_t         tv_sec;     /* seconds */\n"
4750 "    suseconds_t    tv_usec;    /* microseconds */\n"
4751 "};\n"
4752 msgstr ""
4753 "struct timeval {\n"
4754 "\t time_t         tv_sec;     /* 秒 */\n"
4755 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4756 "};\n"
4757
4758 #. type: Plain text
4759 #: build/C/man2/select.2:390
4760 msgid ""
4761 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4762 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4763 msgstr ""
4764 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4765 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4766
4767 #. type: Plain text
4768 #: build/C/man2/select.2:402
4769 msgid ""
4770 "Concerning prototypes, the classical situation is that one should include "
4771 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4772 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4773 msgstr ""
4774 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4775 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4776 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4777 "インクルードすればよい。"
4778
4779 #. type: Plain text
4780 #: build/C/man2/select.2:414
4781 msgid ""
4782 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4783 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4784 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4785 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4786 "requirements are as shown in the SYNOPSIS."
4787 msgstr ""
4788 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4789 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4790 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4791 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4792 "使用するには、「書式」に記載された要件を満たす必要がある。"
4793
4794 #. type: SS
4795 #: build/C/man2/select.2:414
4796 #, no-wrap
4797 msgid "Multithreaded applications"
4798 msgstr "マルチスレッド・アプリケーション"
4799
4800 #. type: Plain text
4801 #: build/C/man2/select.2:430
4802 msgid ""
4803 "If a file descriptor being monitored by B<select>()  is closed in another "
4804 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
4805 "unblocks and returns, with an indication that the file descriptor is ready "
4806 "(a subsequent I/O operation will likely fail with an error, unless another "
4807 "the file descriptor reopened between the time B<select>()  returned and the "
4808 "I/O operations was performed).  On Linux (and some other systems), closing "
4809 "the file descriptor in another thread has no effect on B<select>().  In "
4810 "summary, any application that relies on a particular behavior in this "
4811 "scenario must be considered buggy."
4812 msgstr ""
4813 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
4814 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
4815 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
4816 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
4817 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
4818 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
4819 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
4820 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
4821 "ている」と考えなければならない。"
4822
4823 #. type: SS
4824 #: build/C/man2/select.2:430
4825 #, no-wrap
4826 msgid "Linux notes"
4827 msgstr "Linux での注意"
4828
4829 #. type: Plain text
4830 #: build/C/man2/select.2:438
4831 msgid ""
4832 "The B<pselect>()  interface described in this page is implemented by glibc.  "
4833 "The underlying Linux system call is named B<pselect6>().  This system call "
4834 "has somewhat different behavior from the glibc wrapper function."
4835 msgstr ""
4836 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4837 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
4838 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
4839 "関数とは少し違った動作をする。"
4840
4841 #. type: Plain text
4842 #: build/C/man2/select.2:453
4843 msgid ""
4844 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
4845 "However, the glibc wrapper function hides this behavior by using a local "
4846 "variable for the timeout argument that is passed to the system call.  Thus, "
4847 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
4848 "this is the behavior required by POSIX.1-2001."
4849 msgstr ""
4850 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
4851 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
4852 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
4853 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
4854 "これが POSIX.1-2001 が要求している動作である。"
4855
4856 #. type: Plain text
4857 #: build/C/man2/select.2:459
4858 msgid ""
4859 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
4860 "*> pointer, but is instead a structure of the form:"
4861 msgstr ""
4862 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
4863 "ポインタではなく、以下に示す構造体である。"
4864
4865 #. type: Plain text
4866 #: build/C/man2/select.2:467
4867 #, no-wrap
4868 msgid ""
4869 "struct {\n"
4870 "    const sigset_t *ss;     /* Pointer to signal set */\n"
4871 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
4872 "                               to by 'ss' */\n"
4873 "};\n"
4874 msgstr ""
4875 "struct {\n"
4876 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
4877 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
4878 "                               (バイト数) */\n"
4879 "};\n"
4880
4881 #. type: Plain text
4882 #: build/C/man2/select.2:474
4883 msgid ""
4884 "This allows the system call to obtain both a pointer to the signal set and "
4885 "its size, while allowing for the fact that most architectures support a "
4886 "maximum of 6 arguments to a system call."
4887 msgstr ""
4888 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
4889 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
4890 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
4891 "のサイズの両方を取得することができるのである。"
4892
4893 #. type: Plain text
4894 #: build/C/man2/select.2:480
4895 msgid ""
4896 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4897 "argument."
4898 msgstr ""
4899 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4900 "されていた。"
4901
4902 #. type: Plain text
4903 #: build/C/man2/select.2:493
4904 msgid ""
4905 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4906 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4907 "implementation remained vulnerable to the very race condition that B<pselect>"
4908 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4909 "B<pselect>()  system call on kernels where it is provided."
4910 msgstr ""
4911 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4912 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4913 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4914 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4915 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4916 "が使用される。"
4917
4918 #. type: Plain text
4919 #: build/C/man2/select.2:506
4920 msgid ""
4921 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4922 "trapping can be achieved using the self-pipe trick.  In this technique, a "
4923 "signal handler writes a byte to a pipe whose other end is monitored by "
4924 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
4925 "to a pipe that may be full or reading from a pipe that may be empty, "
4926 "nonblocking I/O is used when reading from and writing to the pipe.)"
4927 msgstr ""
4928 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
4929 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
4930 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
4931 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
4932 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
4933 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
4934 "(nonblocking) I/O を使用するとよい)。"
4935
4936 #.  Stevens discusses a case where accept can block after select
4937 #.  returns successfully because of an intervening RST from the client.
4938 #.  Maybe the kernel should have returned EIO in such a situation?
4939 #. type: Plain text
4940 #: build/C/man2/select.2:522
4941 msgid ""
4942 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4943 "reading\", while nevertheless a subsequent read blocks.  This could for "
4944 "example happen when data has arrived but upon examination has wrong checksum "
4945 "and is discarded.  There may be other circumstances in which a file "
4946 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4947 "B<O_NONBLOCK> on sockets that should not block."
4948 msgstr ""
4949 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4950 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4951 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4952 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4953 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4954 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4955
4956 #. type: Plain text
4957 #: build/C/man2/select.2:537
4958 msgid ""
4959 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4960 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4961 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4962 "behavior, but the glibc wrapper hides this behavior by internally copying "
4963 "the I<timeout> to a local variable and passing that variable to the system "
4964 "call."
4965 msgstr ""
4966 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4967 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4968 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4969 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4970 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4971 "数をシステムコールに渡している。"
4972
4973 #. type: Plain text
4974 #: build/C/man2/select.2:544
4975 #, no-wrap
4976 msgid ""
4977 "#include E<lt>stdio.hE<gt>\n"
4978 "#include E<lt>stdlib.hE<gt>\n"
4979 "#include E<lt>sys/time.hE<gt>\n"
4980 "#include E<lt>sys/types.hE<gt>\n"
4981 "#include E<lt>unistd.hE<gt>\n"
4982 msgstr ""
4983 "#include E<lt>stdio.hE<gt>\n"
4984 "#include E<lt>stdlib.hE<gt>\n"
4985 "#include E<lt>sys/time.hE<gt>\n"
4986 "#include E<lt>sys/types.hE<gt>\n"
4987 "#include E<lt>unistd.hE<gt>\n"
4988
4989 #. type: Plain text
4990 #: build/C/man2/select.2:551
4991 #, no-wrap
4992 msgid ""
4993 "int\n"
4994 "main(void)\n"
4995 "{\n"
4996 "    fd_set rfds;\n"
4997 "    struct timeval tv;\n"
4998 "    int retval;\n"
4999 msgstr ""
5000 "int\n"
5001 "main(void)\n"
5002 "{\n"
5003 "    fd_set rfds;\n"
5004 "    struct timeval tv;\n"
5005 "    int retval;\n"
5006
5007 #. type: Plain text
5008 #: build/C/man2/select.2:555
5009 #, no-wrap
5010 msgid ""
5011 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5012 "    FD_ZERO(&rfds);\n"
5013 "    FD_SET(0, &rfds);\n"
5014 msgstr ""
5015 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5016 "    FD_ZERO(&rfds);\n"
5017 "    FD_SET(0, &rfds);\n"
5018
5019 #. type: Plain text
5020 #: build/C/man2/select.2:559
5021 #, no-wrap
5022 msgid ""
5023 "    /* Wait up to five seconds. */\n"
5024 "    tv.tv_sec = 5;\n"
5025 "    tv.tv_usec = 0;\n"
5026 msgstr ""
5027 "    /* 5 秒間監視する。*/\n"
5028 "    tv.tv_sec = 5;\n"
5029 "    tv.tv_usec = 0;\n"
5030
5031 #. type: Plain text
5032 #: build/C/man2/select.2:562
5033 #, no-wrap
5034 msgid ""
5035 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5036 "    /* Don't rely on the value of tv now! */\n"
5037 msgstr ""
5038 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5039 "    /* この時点での tv の値を信頼してはならない。*/\n"
5040
5041 #. type: Plain text
5042 #: build/C/man2/select.2:570
5043 #, no-wrap
5044 msgid ""
5045 "    if (retval == -1)\n"
5046 "        perror(\"select()\");\n"
5047 "    else if (retval)\n"
5048 "        printf(\"Data is available now.\\en\");\n"
5049 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5050 "    else\n"
5051 "        printf(\"No data within five seconds.\\en\");\n"
5052 msgstr ""
5053 "    if (retval == -1)\n"
5054 "\tperror(\"select()\");\n"
5055 "    else if (retval)\n"
5056 "        printf(\"今、データが取得できました。\\en\");\n"
5057 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5058 "    else\n"
5059 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5060
5061 #. type: Plain text
5062 #: build/C/man2/select.2:585
5063 msgid ""
5064 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5065 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5066 msgstr ""
5067 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5068 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5069
5070 #. type: Plain text
5071 #: build/C/man2/select.2:588
5072 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5073 msgstr ""
5074 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5075
5076 #. type: TH
5077 #: build/C/man2/select_tut.2:32
5078 #, no-wrap
5079 msgid "SELECT_TUT"
5080 msgstr "SELECT_TUT"
5081
5082 #. type: TH
5083 #: build/C/man2/select_tut.2:32
5084 #, no-wrap
5085 msgid "2012-08-03"
5086 msgstr "2012-08-03"
5087
5088 #. type: Plain text
5089 #: build/C/man2/select_tut.2:52
5090 #, no-wrap
5091 msgid ""
5092 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5093 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5094 msgstr ""
5095 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5096 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5097
5098 #. type: Plain text
5099 #: build/C/man2/select_tut.2:66
5100 #, no-wrap
5101 msgid ""
5102 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5103 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5104 "B<            const sigset_t *>I<sigmask>B<);>\n"
5105 msgstr ""
5106 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5107 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5108 "B<            const sigset_t *>I<sigmask>B<);>\n"
5109
5110 #. type: Plain text
5111 #: build/C/man2/select_tut.2:83
5112 msgid ""
5113 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5114 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5115 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5116 "occurred on any of the descriptors."
5117 msgstr ""
5118 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5119 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5120 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5121 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5122 "る。"
5123
5124 #. type: Plain text
5125 #: build/C/man2/select_tut.2:108
5126 msgid ""
5127 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5128 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5129 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5130 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5131 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5132 "according to the rules described below; after calling B<select>()  you can "
5133 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5134 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5135 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5136 "descriptor from a set."
5137 msgstr ""
5138 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5139 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5140 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5141 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5142 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5143 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5144 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5145 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5146 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5147 "のファイルディスクリプタの削除を行う。"
5148
5149 #. type: SS
5150 #: build/C/man2/select_tut.2:108
5151 #, no-wrap
5152 msgid "Arguments"
5153 msgstr "引き数"
5154
5155 #. type: TP
5156 #: build/C/man2/select_tut.2:109
5157 #, no-wrap
5158 msgid "I<readfds>"
5159 msgstr "I<readfds>"
5160
5161 #. type: Plain text
5162 #: build/C/man2/select_tut.2:118
5163 msgid ""
5164 "This set is watched to see if data is available for reading from any of its "
5165 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5166 "cleared of all file descriptors except for those that are immediately "
5167 "available for reading."
5168 msgstr ""
5169 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5170 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5171 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5172
5173 #. type: TP
5174 #: build/C/man2/select_tut.2:118
5175 #, no-wrap
5176 msgid "I<writefds>"
5177 msgstr "I<writefds>"
5178
5179 #. type: Plain text
5180 #: build/C/man2/select_tut.2:127
5181 msgid ""
5182 "This set is watched to see if there is space to write data to any of its "
5183 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5184 "cleared of all file descriptors except for those that are immediately "
5185 "available for writing."
5186 msgstr ""
5187 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5188 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5189 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5190
5191 #. type: TP
5192 #: build/C/man2/select_tut.2:127
5193 #, no-wrap
5194 msgid "I<exceptfds>"
5195 msgstr "I<exceptfds>"
5196
5197 #. type: Plain text
5198 #: build/C/man2/select_tut.2:149
5199 msgid ""
5200 "This set is watched for \"exceptional conditions\".  In practice, only one "
5201 "such exceptional condition is common: the availability of I<out-of-band> "
5202 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5203 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5204 "where B<select>(2)  indicates an exceptional condition occurs with "
5205 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5206 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5207 "for those for which an exceptional condition has occurred."
5208 msgstr ""
5209 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5210 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5211 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5212 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5213 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5214 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5215 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5216 "状態が発生したディスクリプタ以外は集合から削除される。"
5217
5218 #. type: TP
5219 #: build/C/man2/select_tut.2:149
5220 #, no-wrap
5221 msgid "I<nfds>"
5222 msgstr "I<nfds>"
5223
5224 #. type: Plain text
5225 #: build/C/man2/select_tut.2:156
5226 msgid ""
5227 "This is an integer one more than the maximum of any file descriptor in any "
5228 "of the sets.  In other words, while adding file descriptors to each of the "
5229 "sets, you must calculate the maximum integer value of all of them, then "
5230 "increment this value by one, and then pass this as I<nfds>."
5231 msgstr ""
5232 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5233 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5234 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5235 "I<nfds> として渡さないといけない、ということだ。"
5236
5237 #. type: TP
5238 #: build/C/man2/select_tut.2:156
5239 #, no-wrap
5240 msgid "I<utimeout>"
5241 msgstr "I<utimeout>"
5242
5243 #. type: Plain text
5244 #: build/C/man2/select_tut.2:169
5245 msgid ""
5246 "This is the longest time B<select>()  may wait before returning, even if "
5247 "nothing interesting happened.  If this value is passed as NULL, then "
5248 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5249 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5250 "return immediately, with information about the readiness of file descriptors "
5251 "at the time of the call.  The structure I<struct timeval> is defined as:"
5252 msgstr ""
5253 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5254 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5255 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5256 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5257 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5258 "ように定義されている:"
5259
5260 #. type: Plain text
5261 #: build/C/man2/select_tut.2:176
5262 #, no-wrap
5263 msgid ""
5264 "struct timeval {\n"
5265 "    time_t tv_sec;    /* seconds */\n"
5266 "    long tv_usec;     /* microseconds */\n"
5267 "};\n"
5268 msgstr ""
5269 "struct timeval {\n"
5270 "    time_t tv_sec;    /* seconds */\n"
5271 "    long tv_usec;     /* microseconds */\n"
5272 "};\n"
5273
5274 #. type: TP
5275 #: build/C/man2/select_tut.2:178
5276 #, no-wrap
5277 msgid "I<ntimeout>"
5278 msgstr "I<ntimeout>"
5279
5280 #. type: Plain text
5281 #: build/C/man2/select_tut.2:187
5282 msgid ""
5283 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5284 "I<struct timespec> has nanosecond precision as follows:"
5285 msgstr ""
5286 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5287 "timespec> は次に示すようにナノ秒の精度を持つ。"
5288
5289 #. type: Plain text
5290 #: build/C/man2/select_tut.2:194
5291 #, no-wrap
5292 msgid ""
5293 "struct timespec {\n"
5294 "    long tv_sec;    /* seconds */\n"
5295 "    long tv_nsec;   /* nanoseconds */\n"
5296 "};\n"
5297 msgstr ""
5298 "struct timespec {\n"
5299 "    long tv_sec;    /* seconds */\n"
5300 "    long tv_nsec;   /* nanoseconds */\n"
5301 "};\n"
5302
5303 #. type: TP
5304 #: build/C/man2/select_tut.2:196
5305 #, no-wrap
5306 msgid "I<sigmask>"
5307 msgstr "I<sigmask>"
5308
5309 #. type: Plain text
5310 #: build/C/man2/select_tut.2:213
5311 msgid ""
5312 "This argument holds a set of signals that the kernel should unblock (i.e., "
5313 "remove from the signal mask of the calling thread), while the caller is "
5314 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5315 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5316 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5317 "()  will then behave just like B<select>()."
5318 msgstr ""
5319 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5320 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5321 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5322 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5323 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5324 "()  と全く同じ動作となる。"
5325
5326 #. type: SS
5327 #: build/C/man2/select_tut.2:213
5328 #, no-wrap
5329 msgid "Combining signal and data events"
5330 msgstr "シグナルとデータイベントを組み合わせる"
5331
5332 #. type: Plain text
5333 #: build/C/man2/select_tut.2:257
5334 msgid ""
5335 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5336 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5337 "normally use the signal handler only to raise a global flag.  The global "
5338 "flag will indicate that the event must be processed in the main loop of the "
5339 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5340 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5341 "signals can be processed in the main loop of the program, otherwise B<select>"
5342 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5343 "conditional to check the global flag.  So we must ask: what if a signal "
5344 "arrives after the conditional, but before the B<select>()  call? The answer "
5345 "is that B<select>()  would block indefinitely, even though an event is "
5346 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5347 "This call can be used to set the signal mask to a set of signals that are "
5348 "only to be received within the B<pselect>()  call.  For instance, let us say "
5349 "that the event in question was the exit of a child process.  Before the "
5350 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5351 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5352 "mask.  Our program would look like:"
5353 msgstr ""
5354 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5355 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5356 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5357 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5358 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5359 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5360 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5361 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5362 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5363 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5364 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5365 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5366 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5367 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5368 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5369 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5370 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5371 "る。"
5372
5373 #. type: Plain text
5374 #: build/C/man2/select_tut.2:260
5375 #, no-wrap
5376 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5377 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5378
5379 #. type: Plain text
5380 #: build/C/man2/select_tut.2:266
5381 #, no-wrap
5382 msgid ""
5383 "static void\n"
5384 "child_sig_handler(int sig)\n"
5385 "{\n"
5386 "    got_SIGCHLD = 1;\n"
5387 "}\n"
5388 msgstr ""
5389 "static void\n"
5390 "child_sig_handler(int sig)\n"
5391 "{\n"
5392 "    got_SIGCHLD = 1;\n"
5393 "}\n"
5394
5395 #. type: Plain text
5396 #: build/C/man2/select_tut.2:274
5397 #, no-wrap
5398 msgid ""
5399 "int\n"
5400 "main(int argc, char *argv[])\n"
5401 "{\n"
5402 "    sigset_t sigmask, empty_mask;\n"
5403 "    struct sigaction sa;\n"
5404 "    fd_set readfds, writefds, exceptfds;\n"
5405 "    int r;\n"
5406 msgstr ""
5407 "int\n"
5408 "main(int argc, char *argv[])\n"
5409 "{\n"
5410 "    sigset_t sigmask, empty_mask;\n"
5411 "    struct sigaction sa;\n"
5412 "    fd_set readfds, writefds, exceptfds;\n"
5413 "    int r;\n"
5414
5415 #. type: Plain text
5416 #: build/C/man2/select_tut.2:281
5417 #, no-wrap
5418 msgid ""
5419 "    sigemptyset(&sigmask);\n"
5420 "    sigaddset(&sigmask, SIGCHLD);\n"
5421 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5422 "        perror(\"sigprocmask\");\n"
5423 "        exit(EXIT_FAILURE);\n"
5424 "    }\n"
5425 msgstr ""
5426 "    sigemptyset(&sigmask);\n"
5427 "    sigaddset(&sigmask, SIGCHLD);\n"
5428 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5429 "        perror(\"sigprocmask\");\n"
5430 "        exit(EXIT_FAILURE);\n"
5431 "    }\n"
5432
5433 #. type: Plain text
5434 #: build/C/man2/select_tut.2:289
5435 #, no-wrap
5436 msgid ""
5437 "    sa.sa_flags = 0;\n"
5438 "    sa.sa_handler = child_sig_handler;\n"
5439 "    sigemptyset(&sa.sa_mask);\n"
5440 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5441 "        perror(\"sigaction\");\n"
5442 "        exit(EXIT_FAILURE);\n"
5443 "    }\n"
5444 msgstr ""
5445 "    sa.sa_flags = 0;\n"
5446 "    sa.sa_handler = child_sig_handler;\n"
5447 "    sigemptyset(&sa.sa_mask);\n"
5448 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5449 "        perror(\"sigaction\");\n"
5450 "        exit(EXIT_FAILURE);\n"
5451 "    }\n"
5452
5453 #. type: Plain text
5454 #: build/C/man2/select_tut.2:291
5455 #, no-wrap
5456 msgid "    sigemptyset(&empty_mask);\n"
5457 msgstr "    sigemptyset(&empty_mask);\n"
5458
5459 #. type: Plain text
5460 #: build/C/man2/select_tut.2:295
5461 #, no-wrap
5462 msgid ""
5463 "    for (;;) {          /* main loop */\n"
5464 "        /* Initialize readfds, writefds, and exceptfds\n"
5465 "           before the pselect() call. (Code omitted.) */\n"
5466 msgstr ""
5467 "    for (;;) {          /* main loop */\n"
5468 "        /* Initialize readfds, writefds, and exceptfds\n"
5469 "           before the pselect() call. (Code omitted.) */\n"
5470
5471 #. type: Plain text
5472 #: build/C/man2/select_tut.2:301
5473 #, no-wrap
5474 msgid ""
5475 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5476 "                    NULL, &empty_mask);\n"
5477 "        if (r == -1 && errno != EINTR) {\n"
5478 "            /* Handle error */\n"
5479 "        }\n"
5480 msgstr ""
5481 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5482 "                    NULL, &empty_mask);\n"
5483 "        if (r == -1 && errno != EINTR) {\n"
5484 "            /* Handle error */\n"
5485 "        }\n"
5486
5487 #. type: Plain text
5488 #: build/C/man2/select_tut.2:304
5489 #, no-wrap
5490 msgid ""
5491 "        if (got_SIGCHLD) {\n"
5492 "            got_SIGCHLD = 0;\n"
5493 msgstr ""
5494 "        if (got_SIGCHLD) {\n"
5495 "            got_SIGCHLD = 0;\n"
5496
5497 #. type: Plain text
5498 #: build/C/man2/select_tut.2:308
5499 #, no-wrap
5500 msgid ""
5501 "            /* Handle signalled event here; e.g., wait() for all\n"
5502 "               terminated children. (Code omitted.) */\n"
5503 "        }\n"
5504 msgstr ""
5505 "            /* Handle signalled event here; e.g., wait() for all\n"
5506 "               terminated children. (Code omitted.) */\n"
5507 "        }\n"
5508
5509 #. type: Plain text
5510 #: build/C/man2/select_tut.2:312
5511 #, no-wrap
5512 msgid ""
5513 "        /* main body of program */\n"
5514 "    }\n"
5515 "}\n"
5516 msgstr ""
5517 "        /* main body of program */\n"
5518 "    }\n"
5519 "}\n"
5520
5521 #. type: SS
5522 #: build/C/man2/select_tut.2:313
5523 #, no-wrap
5524 msgid "Practical"
5525 msgstr "実例"
5526
5527 #. type: Plain text
5528 #: build/C/man2/select_tut.2:334
5529 msgid ""
5530 "So what is the point of B<select>()? Can't I just read and write to my "
5531 "descriptors whenever I want? The point of B<select>()  is that it watches "
5532 "multiple descriptors at the same time and properly puts the process to sleep "
5533 "if there is no activity.  UNIX programmers often find themselves in a "
5534 "position where they have to handle I/O from more than one file descriptor "
5535 "where the data flow may be intermittent.  If you were to merely create a "
5536 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5537 "your calls may block waiting for data from/to a file descriptor, while "
5538 "another file descriptor is unused though ready for I/O.  B<select>()  "
5539 "efficiently copes with this situation."
5540 msgstr ""
5541 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5542 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5543 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5544 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5545 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5546 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5547 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5548 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5549 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5550
5551 #. type: SS
5552 #: build/C/man2/select_tut.2:334
5553 #, no-wrap
5554 msgid "Select law"
5555 msgstr "SELECT の掟"
5556
5557 #. type: Plain text
5558 #: build/C/man2/select_tut.2:347
5559 msgid ""
5560 "Many people who try to use B<select>()  come across behavior that is "
5561 "difficult to understand and produces nonportable or borderline results.  For "
5562 "instance, the above program is carefully written not to block at any point, "
5563 "even though it does not set its file descriptors to nonblocking mode.  It is "
5564 "easy to introduce subtle errors that will remove the advantage of using "
5565 "B<select>(), so here is a list of essentials to watch for when using "
5566 "B<select>()."
5567 msgstr ""
5568 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5569 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5570 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5571 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5572 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5573 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5574 "ことにする。"
5575
5576 #. type: Plain text
5577 #: build/C/man2/select_tut.2:356
5578 msgid ""
5579 "You should always try to use B<select>()  without a timeout.  Your program "
5580 "should have nothing to do if there is no data available.  Code that depends "
5581 "on timeouts is not usually portable and is difficult to debug."
5582 msgstr ""
5583 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5584 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5585 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5586
5587 #. type: Plain text
5588 #: build/C/man2/select_tut.2:360
5589 msgid ""
5590 "The value I<nfds> must be properly calculated for efficiency as explained "
5591 "above."
5592 msgstr ""
5593 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5594 "えなければならない。"
5595
5596 #. type: Plain text
5597 #: build/C/man2/select_tut.2:367
5598 msgid ""
5599 "No file descriptor must be added to any set if you do not intend to check "
5600 "its result after the B<select>()  call, and respond appropriately.  See next "
5601 "rule."
5602 msgstr ""
5603 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5604 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5605
5606 #. type: Plain text
5607 #: build/C/man2/select_tut.2:373
5608 msgid ""
5609 "After B<select>()  returns, all file descriptors in all sets should be "
5610 "checked to see if they are ready."
5611 msgstr ""
5612 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5613 "て 読み書き可能な状態になっているかをチェックすべきである。"
5614
5615 #. type: TP
5616 #: build/C/man2/select_tut.2:373
5617 #, no-wrap
5618 msgid "5."
5619 msgstr "5."
5620
5621 #. type: Plain text
5622 #: build/C/man2/select_tut.2:388
5623 msgid ""
5624 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5625 "necessarily read/write the full amount of data that you have requested.  If "
5626 "they do read/write the full amount, it's because you have a low traffic load "
5627 "and a fast stream.  This is not always going to be the case.  You should "
5628 "cope with the case of your functions managing to send or receive only a "
5629 "single byte."
5630 msgstr ""
5631 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5632 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5633 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5634 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5635 "うな場合も 考慮に入れてやらなければならない。"
5636
5637 #. type: TP
5638 #: build/C/man2/select_tut.2:388
5639 #, no-wrap
5640 msgid "6."
5641 msgstr "6."
5642
5643 #. type: Plain text
5644 #: build/C/man2/select_tut.2:396
5645 msgid ""
5646 "Never read/write only in single bytes at a time unless you are really sure "
5647 "that you have a small amount of data to process.  It is extremely "
5648 "inefficient not to read/write as much data as you can buffer each time.  The "
5649 "buffers in the example below are 1024 bytes although they could easily be "
5650 "made larger."
5651 msgstr ""
5652 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5653 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5654 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5655 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5656
5657 #. type: TP
5658 #: build/C/man2/select_tut.2:396
5659 #, no-wrap
5660 msgid "7."
5661 msgstr "7."
5662
5663 #.  Nonetheless, you should still cope with these errors for completeness.
5664 #. type: Plain text
5665 #: build/C/man2/select_tut.2:418
5666 msgid ""
5667 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5668 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5669 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5670 "properly managed (not done properly above).  If your program is not going to "
5671 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5672 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5673 msgstr ""
5674 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5675 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5676 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5677 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5678 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5679 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5680
5681 #. type: TP
5682 #: build/C/man2/select_tut.2:418
5683 #, no-wrap
5684 msgid "8."
5685 msgstr "8."
5686
5687 #. type: Plain text
5688 #: build/C/man2/select_tut.2:427
5689 msgid ""
5690 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5691 "length of zero."
5692 msgstr ""
5693 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5694 "(2), B<send>(2)  を呼び出してはならない。"
5695
5696 #. type: TP
5697 #: build/C/man2/select_tut.2:427
5698 #, no-wrap
5699 msgid "9."
5700 msgstr "9."
5701
5702 #. type: Plain text
5703 #: build/C/man2/select_tut.2:443
5704 msgid ""
5705 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5706 "with errors other than those listed in B<7.>, or one of the input functions "
5707 "returns 0, indicating end of file, then you should I<not> pass that "
5708 "descriptor to B<select>()  again.  In the example below, I close the "
5709 "descriptor immediately, and then set it to -1 to prevent it being included "
5710 "in a set."
5711 msgstr ""
5712 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5713 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5714 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5715 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5716 "が集合に含まれ続けるのを許さないようにしている。"
5717
5718 #. type: TP
5719 #: build/C/man2/select_tut.2:443
5720 #, no-wrap
5721 msgid "10."
5722 msgstr "10."
5723
5724 #. type: Plain text
5725 #: build/C/man2/select_tut.2:450
5726 msgid ""
5727 "The timeout value must be initialized with each new call to B<select>(), "
5728 "since some operating systems modify the structure.  B<pselect>()  however "
5729 "does not modify its timeout structure."
5730 msgstr ""
5731 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5732 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5733 "分の timeout 構造体を変更することはない。"
5734
5735 #. type: TP
5736 #: build/C/man2/select_tut.2:450
5737 #, no-wrap
5738 msgid "11."
5739 msgstr "11."
5740
5741 #.  "I have heard" does not fill me with confidence, and doesn't
5742 #.  belong in a man page, so I've commented this point out.
5743 #.  .TP
5744 #.  11.
5745 #.  I have heard that the Windows socket layer does not cope with OOB data
5746 #.  properly.
5747 #.  It also does not cope with
5748 #.  .BR select ()
5749 #.  calls when no file descriptors are set at all.
5750 #.  Having no file descriptors set is a useful
5751 #.  way to sleep the process with subsecond precision by using the timeout.
5752 #.  (See further on.)
5753 #. type: Plain text
5754 #: build/C/man2/select_tut.2:469
5755 msgid ""
5756 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5757 "used in a loop, then the sets must be reinitialized before each call."
5758 msgstr ""
5759 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5760 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5761 "期化し直さなければならない。"
5762
5763 #. type: SS
5764 #: build/C/man2/select_tut.2:469
5765 #, no-wrap
5766 msgid "Usleep emulation"
5767 msgstr "usleep エミュレーション"
5768
5769 #. type: Plain text
5770 #: build/C/man2/select_tut.2:476
5771 msgid ""
5772 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5773 "()  with a finite timeout and no file descriptors as follows:"
5774 msgstr ""
5775 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5776 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5777 "できる。 以下のようにする。"
5778
5779 #. type: Plain text
5780 #: build/C/man2/select_tut.2:482
5781 #, no-wrap
5782 msgid ""
5783 "    struct timeval tv;\n"
5784 "    tv.tv_sec = 0;\n"
5785 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5786 "    select(0, NULL, NULL, NULL, &tv);\n"
5787 msgstr ""
5788 "    struct timeval tv;\n"
5789 "    tv.tv_sec = 0;\n"
5790 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5791 "    select(0, NULL, NULL, NULL, &tv);\n"
5792
5793 #. type: Plain text
5794 #: build/C/man2/select_tut.2:485
5795 msgid "This is guaranteed to work only on UNIX systems, however."
5796 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5797
5798 #. type: Plain text
5799 #: build/C/man2/select_tut.2:490
5800 msgid ""
5801 "On success, B<select>()  returns the total number of file descriptors still "
5802 "present in the file descriptor sets."
5803 msgstr ""
5804 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5805 "ディスクリプタの総数を返す。"
5806
5807 #. type: Plain text
5808 #: build/C/man2/select_tut.2:496
5809 msgid ""
5810 "If B<select>()  timed out, then the return value will be zero.  The file "
5811 "descriptors set should be all empty (but may not be on some systems)."
5812 msgstr ""
5813 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5814 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5815
5816 #. type: Plain text
5817 #: build/C/man2/select_tut.2:503
5818 msgid ""
5819 "A return value of -1 indicates an error, with I<errno> being set "
5820 "appropriately.  In the case of an error, the contents of the returned sets "
5821 "and the I<struct timeout> contents are undefined and should not be used.  "
5822 "B<pselect>()  however never modifies I<ntimeout>."
5823 msgstr ""
5824 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5825 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5826 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5827 "変更しない。"
5828
5829 #. type: Plain text
5830 #: build/C/man2/select_tut.2:512
5831 msgid ""
5832 "Generally speaking, all operating systems that support sockets also support "
5833 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5834 "and efficient way that naive programmers try to solve in a more complicated "
5835 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5836 msgstr ""
5837 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5838 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5839 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5840 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5841
5842 #. type: Plain text
5843 #: build/C/man2/select_tut.2:521
5844 msgid ""
5845 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5846 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5847 "is nowadays widely available, but historically was less portable than "
5848 "B<select>()."
5849 msgstr ""
5850 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5851 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5852 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5853
5854 #. type: Plain text
5855 #: build/C/man2/select_tut.2:529
5856 msgid ""
5857 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5858 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5859 "of file descriptors."
5860 msgstr ""
5861 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5862 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5863
5864 #. type: Plain text
5865 #: build/C/man2/select_tut.2:534
5866 msgid ""
5867 "Here is an example that better demonstrates the true utility of B<select>"
5868 "().  The listing below is a TCP forwarding program that forwards from one "
5869 "TCP port to another."
5870 msgstr ""
5871 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5872 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5873
5874 #. type: Plain text
5875 #: build/C/man2/select_tut.2:547
5876 #, no-wrap
5877 msgid ""
5878 "#include E<lt>stdlib.hE<gt>\n"
5879 "#include E<lt>stdio.hE<gt>\n"
5880 "#include E<lt>unistd.hE<gt>\n"
5881 "#include E<lt>sys/time.hE<gt>\n"
5882 "#include E<lt>sys/types.hE<gt>\n"
5883 "#include E<lt>string.hE<gt>\n"
5884 "#include E<lt>signal.hE<gt>\n"
5885 "#include E<lt>sys/socket.hE<gt>\n"
5886 "#include E<lt>netinet/in.hE<gt>\n"
5887 "#include E<lt>arpa/inet.hE<gt>\n"
5888 "#include E<lt>errno.hE<gt>\n"
5889 msgstr ""
5890 "#include E<lt>stdlib.hE<gt>\n"
5891 "#include E<lt>stdio.hE<gt>\n"
5892 "#include E<lt>unistd.hE<gt>\n"
5893 "#include E<lt>sys/time.hE<gt>\n"
5894 "#include E<lt>sys/types.hE<gt>\n"
5895 "#include E<lt>string.hE<gt>\n"
5896 "#include E<lt>signal.hE<gt>\n"
5897 "#include E<lt>sys/socket.hE<gt>\n"
5898 "#include E<lt>netinet/in.hE<gt>\n"
5899 "#include E<lt>arpa/inet.hE<gt>\n"
5900 "#include E<lt>errno.hE<gt>\n"
5901
5902 #. type: Plain text
5903 #: build/C/man2/select_tut.2:549
5904 #, no-wrap
5905 msgid "static int forward_port;\n"
5906 msgstr "static int forward_port;\n"
5907
5908 #. type: Plain text
5909 #: build/C/man2/select_tut.2:552
5910 #, no-wrap
5911 msgid ""
5912 "#undef max\n"
5913 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5914 msgstr ""
5915 "#undef max\n"
5916 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5917
5918 #. type: Plain text
5919 #: build/C/man2/select_tut.2:559
5920 #, no-wrap
5921 msgid ""
5922 "static int\n"
5923 "listen_socket(int listen_port)\n"
5924 "{\n"
5925 "    struct sockaddr_in a;\n"
5926 "    int s;\n"
5927 "    int yes;\n"
5928 msgstr ""
5929 "static int\n"
5930 "listen_socket(int listen_port)\n"
5931 "{\n"
5932 "    struct sockaddr_in a;\n"
5933 "    int s;\n"
5934 "    int yes;\n"
5935
5936 #. type: Plain text
5937 #: build/C/man2/select_tut.2:583
5938 #, no-wrap
5939 msgid ""
5940 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5941 "        perror(\"socket\");\n"
5942 "        return -1;\n"
5943 "    }\n"
5944 "    yes = 1;\n"
5945 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5946 "            &yes, sizeof(yes)) == -1) {\n"
5947 "        perror(\"setsockopt\");\n"
5948 "        close(s);\n"
5949 "        return -1;\n"
5950 "    }\n"
5951 "    memset(&a, 0, sizeof(a));\n"
5952 "    a.sin_port = htons(listen_port);\n"
5953 "    a.sin_family = AF_INET;\n"
5954 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5955 "        perror(\"bind\");\n"
5956 "        close(s);\n"
5957 "        return -1;\n"
5958 "    }\n"
5959 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5960 "    listen(s, 10);\n"
5961 "    return s;\n"
5962 "}\n"
5963 msgstr ""
5964 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5965 "        perror(\"socket\");\n"
5966 "        return -1;\n"
5967 "    }\n"
5968 "    yes = 1;\n"
5969 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5970 "            &yes, sizeof(yes)) == -1) {\n"
5971 "        perror(\"setsockopt\");\n"
5972 "        close(s);\n"
5973 "        return -1;\n"
5974 "    }\n"
5975 "    memset(&a, 0, sizeof(a));\n"
5976 "    a.sin_port = htons(listen_port);\n"
5977 "    a.sin_family = AF_INET;\n"
5978 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5979 "        perror(\"bind\");\n"
5980 "        close(s);\n"
5981 "        return -1;\n"
5982 "    }\n"
5983 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5984 "    listen(s, 10);\n"
5985 "    return s;\n"
5986 "}\n"
5987
5988 #. type: Plain text
5989 #: build/C/man2/select_tut.2:589
5990 #, no-wrap
5991 msgid ""
5992 "static int\n"
5993 "connect_socket(int connect_port, char *address)\n"
5994 "{\n"
5995 "    struct sockaddr_in a;\n"
5996 "    int s;\n"
5997 msgstr ""
5998 "static int\n"
5999 "connect_socket(int connect_port, char *address)\n"
6000 "{\n"
6001 "    struct sockaddr_in a;\n"
6002 "    int s;\n"
6003
6004 #. type: Plain text
6005 #: build/C/man2/select_tut.2:595
6006 #, no-wrap
6007 msgid ""
6008 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6009 "        perror(\"socket\");\n"
6010 "        close(s);\n"
6011 "        return -1;\n"
6012 "    }\n"
6013 msgstr ""
6014 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6015 "        perror(\"socket\");\n"
6016 "        close(s);\n"
6017 "        return -1;\n"
6018 "    }\n"
6019
6020 #. type: Plain text
6021 #: build/C/man2/select_tut.2:599
6022 #, no-wrap
6023 msgid ""
6024 "    memset(&a, 0, sizeof(a));\n"
6025 "    a.sin_port = htons(connect_port);\n"
6026 "    a.sin_family = AF_INET;\n"
6027 msgstr ""
6028 "    memset(&a, 0, sizeof(a));\n"
6029 "    a.sin_port = htons(connect_port);\n"
6030 "    a.sin_family = AF_INET;\n"
6031
6032 #. type: Plain text
6033 #: build/C/man2/select_tut.2:605
6034 #, no-wrap
6035 msgid ""
6036 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6037 "        perror(\"bad IP address format\");\n"
6038 "        close(s);\n"
6039 "        return -1;\n"
6040 "    }\n"
6041 msgstr ""
6042 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6043 "        perror(\"bad IP address format\");\n"
6044 "        close(s);\n"
6045 "        return -1;\n"
6046 "    }\n"
6047
6048 #. type: Plain text
6049 #: build/C/man2/select_tut.2:614
6050 #, no-wrap
6051 msgid ""
6052 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6053 "        perror(\"connect()\");\n"
6054 "        shutdown(s, SHUT_RDWR);\n"
6055 "        close(s);\n"
6056 "        return -1;\n"
6057 "    }\n"
6058 "    return s;\n"
6059 "}\n"
6060 msgstr ""
6061 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6062 "        perror(\"connect()\");\n"
6063 "        shutdown(s, SHUT_RDWR);\n"
6064 "        close(s);\n"
6065 "        return -1;\n"
6066 "    }\n"
6067 "    return s;\n"
6068 "}\n"
6069
6070 #. type: Plain text
6071 #: build/C/man2/select_tut.2:622
6072 #, no-wrap
6073 msgid ""
6074 "#define SHUT_FD1 do {                                \\e\n"
6075 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6076 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6077 "                         close(fd1);                 \\e\n"
6078 "                         fd1 = -1;                   \\e\n"
6079 "                     }                               \\e\n"
6080 "                 } while (0)\n"
6081 msgstr ""
6082 "#define SHUT_FD1 do {                                \\e\n"
6083 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6084 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6085 "                         close(fd1);                 \\e\n"
6086 "                         fd1 = -1;                   \\e\n"
6087 "                     }                               \\e\n"
6088 "                 } while (0)\n"
6089
6090 #. type: Plain text
6091 #: build/C/man2/select_tut.2:630
6092 #, no-wrap
6093 msgid ""
6094 "#define SHUT_FD2 do {                                \\e\n"
6095 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6096 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6097 "                         close(fd2);                 \\e\n"
6098 "                         fd2 = -1;                   \\e\n"
6099 "                     }                               \\e\n"
6100 "                 } while (0)\n"
6101 msgstr ""
6102 "#define SHUT_FD2 do {                                \\e\n"
6103 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6104 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6105 "                         close(fd2);                 \\e\n"
6106 "                         fd2 = -1;                   \\e\n"
6107 "                     }                               \\e\n"
6108 "                 } while (0)\n"
6109
6110 #. type: Plain text
6111 #: build/C/man2/select_tut.2:632
6112 #, no-wrap
6113 msgid "#define BUF_SIZE 1024\n"
6114 msgstr "#define BUF_SIZE 1024\n"
6115
6116 #. type: Plain text
6117 #: build/C/man2/select_tut.2:641
6118 #, no-wrap
6119 msgid ""
6120 "int\n"
6121 "main(int argc, char *argv[])\n"
6122 "{\n"
6123 "    int h;\n"
6124 "    int fd1 = -1, fd2 = -1;\n"
6125 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6126 "    int buf1_avail, buf1_written;\n"
6127 "    int buf2_avail, buf2_written;\n"
6128 msgstr ""
6129 "int\n"
6130 "main(int argc, char *argv[])\n"
6131 "{\n"
6132 "    int h;\n"
6133 "    int fd1 = -1, fd2 = -1;\n"
6134 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6135 "    int buf1_avail, buf1_written;\n"
6136 "    int buf2_avail, buf2_written;\n"
6137
6138 #. type: Plain text
6139 #: build/C/man2/select_tut.2:647
6140 #, no-wrap
6141 msgid ""
6142 "    if (argc != 4) {\n"
6143 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6144 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6145 "        exit(EXIT_FAILURE);\n"
6146 "    }\n"
6147 msgstr ""
6148 "    if (argc != 4) {\n"
6149 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6150 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6151 "        exit(EXIT_FAILURE);\n"
6152 "    }\n"
6153
6154 #. type: Plain text
6155 #: build/C/man2/select_tut.2:649
6156 #, no-wrap
6157 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6158 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6159
6160 #. type: Plain text
6161 #: build/C/man2/select_tut.2:651
6162 #, no-wrap
6163 msgid "    forward_port = atoi(argv[2]);\n"
6164 msgstr "    forward_port = atoi(argv[2]);\n"
6165
6166 #. type: Plain text
6167 #: build/C/man2/select_tut.2:655
6168 #, no-wrap
6169 msgid ""
6170 "    h = listen_socket(atoi(argv[1]));\n"
6171 "    if (h == -1)\n"
6172 "        exit(EXIT_FAILURE);\n"
6173 msgstr ""
6174 "    h = listen_socket(atoi(argv[1]));\n"
6175 "    if (h == -1)\n"
6176 "        exit(EXIT_FAILURE);\n"
6177
6178 #. type: Plain text
6179 #: build/C/man2/select_tut.2:659
6180 #, no-wrap
6181 msgid ""
6182 "    for (;;) {\n"
6183 "        int r, nfds = 0;\n"
6184 "        fd_set rd, wr, er;\n"
6185 msgstr ""
6186 "    for (;;) {\n"
6187 "        int r, nfds = 0;\n"
6188 "        fd_set rd, wr, er;\n"
6189
6190 #. type: Plain text
6191 #: build/C/man2/select_tut.2:689
6192 #, no-wrap
6193 msgid ""
6194 "        FD_ZERO(&rd);\n"
6195 "        FD_ZERO(&wr);\n"
6196 "        FD_ZERO(&er);\n"
6197 "        FD_SET(h, &rd);\n"
6198 "        nfds = max(nfds, h);\n"
6199 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6200 "            FD_SET(fd1, &rd);\n"
6201 "            nfds = max(nfds, fd1);\n"
6202 "        }\n"
6203 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6204 "            FD_SET(fd2, &rd);\n"
6205 "            nfds = max(nfds, fd2);\n"
6206 "        }\n"
6207 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6208 "            FD_SET(fd1, &wr);\n"
6209 "            nfds = max(nfds, fd1);\n"
6210 "        }\n"
6211 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6212 "            FD_SET(fd2, &wr);\n"
6213 "            nfds = max(nfds, fd2);\n"
6214 "        }\n"
6215 "        if (fd1 E<gt> 0) {\n"
6216 "            FD_SET(fd1, &er);\n"
6217 "            nfds = max(nfds, fd1);\n"
6218 "        }\n"
6219 "        if (fd2 E<gt> 0) {\n"
6220 "            FD_SET(fd2, &er);\n"
6221 "            nfds = max(nfds, fd2);\n"
6222 "        }\n"
6223 msgstr ""
6224 "        FD_ZERO(&rd);\n"
6225 "        FD_ZERO(&wr);\n"
6226 "        FD_ZERO(&er);\n"
6227 "        FD_SET(h, &rd);\n"
6228 "        nfds = max(nfds, h);\n"
6229 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6230 "            FD_SET(fd1, &rd);\n"
6231 "            nfds = max(nfds, fd1);\n"
6232 "        }\n"
6233 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6234 "            FD_SET(fd2, &rd);\n"
6235 "            nfds = max(nfds, fd2);\n"
6236 "        }\n"
6237 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6238 "            FD_SET(fd1, &wr);\n"
6239 "            nfds = max(nfds, fd1);\n"
6240 "        }\n"
6241 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6242 "            FD_SET(fd2, &wr);\n"
6243 "            nfds = max(nfds, fd2);\n"
6244 "        }\n"
6245 "        if (fd1 E<gt> 0) {\n"
6246 "            FD_SET(fd1, &er);\n"
6247 "            nfds = max(nfds, fd1);\n"
6248 "        }\n"
6249 "        if (fd2 E<gt> 0) {\n"
6250 "            FD_SET(fd2, &er);\n"
6251 "            nfds = max(nfds, fd2);\n"
6252 "        }\n"
6253
6254 #. type: Plain text
6255 #: build/C/man2/select_tut.2:691
6256 #, no-wrap
6257 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6258 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6259
6260 #. type: Plain text
6261 #: build/C/man2/select_tut.2:694
6262 #, no-wrap
6263 msgid ""
6264 "        if (r == -1 && errno == EINTR)\n"
6265 "            continue;\n"
6266 msgstr ""
6267 "        if (r == -1 && errno == EINTR)\n"
6268 "            continue;\n"
6269
6270 #. type: Plain text
6271 #: build/C/man2/select_tut.2:699
6272 #, no-wrap
6273 msgid ""
6274 "        if (r == -1) {\n"
6275 "            perror(\"select()\");\n"
6276 "            exit(EXIT_FAILURE);\n"
6277 "        }\n"
6278 msgstr ""
6279 "        if (r == -1) {\n"
6280 "            perror(\"select()\");\n"
6281 "            exit(EXIT_FAILURE);\n"
6282 "        }\n"
6283
6284 #. type: Plain text
6285 #: build/C/man2/select_tut.2:703
6286 #, no-wrap
6287 msgid ""
6288 "        if (FD_ISSET(h, &rd)) {\n"
6289 "            unsigned int l;\n"
6290 "            struct sockaddr_in client_address;\n"
6291 msgstr ""
6292 "        if (FD_ISSET(h, &rd)) {\n"
6293 "            unsigned int l;\n"
6294 "            struct sockaddr_in client_address;\n"
6295
6296 #. type: Plain text
6297 #: build/C/man2/select_tut.2:722
6298 #, no-wrap
6299 msgid ""
6300 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6301 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6302 "            if (r == -1) {\n"
6303 "                perror(\"accept()\");\n"
6304 "            } else {\n"
6305 "                SHUT_FD1;\n"
6306 "                SHUT_FD2;\n"
6307 "                buf1_avail = buf1_written = 0;\n"
6308 "                buf2_avail = buf2_written = 0;\n"
6309 "                fd1 = r;\n"
6310 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6311 "                if (fd2 == -1)\n"
6312 "                    SHUT_FD1;\n"
6313 "                else\n"
6314 "                    printf(\"connect from %s\\en\",\n"
6315 "                            inet_ntoa(client_address.sin_addr));\n"
6316 "            }\n"
6317 "        }\n"
6318 msgstr ""
6319 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6320 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6321 "            if (r == -1) {\n"
6322 "                perror(\"accept()\");\n"
6323 "            } else {\n"
6324 "                SHUT_FD1;\n"
6325 "                SHUT_FD2;\n"
6326 "                buf1_avail = buf1_written = 0;\n"
6327 "                buf2_avail = buf2_written = 0;\n"
6328 "                fd1 = r;\n"
6329 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6330 "                if (fd2 == -1)\n"
6331 "                    SHUT_FD1;\n"
6332 "                else\n"
6333 "                    printf(\"connect from %s\\en\",\n"
6334 "                            inet_ntoa(client_address.sin_addr));\n"
6335 "            }\n"
6336 "        }\n"
6337
6338 #. type: Plain text
6339 #: build/C/man2/select_tut.2:724
6340 #, no-wrap
6341 msgid "        /* NB: read oob data before normal reads */\n"
6342 msgstr "        /* NB: read oob data before normal reads */\n"
6343
6344 #. type: Plain text
6345 #: build/C/man2/select_tut.2:728
6346 #, no-wrap
6347 msgid ""
6348 "        if (fd1 E<gt> 0)\n"
6349 "            if (FD_ISSET(fd1, &er)) {\n"
6350 "                char c;\n"
6351 msgstr ""
6352 "        if (fd1 E<gt> 0)\n"
6353 "            if (FD_ISSET(fd1, &er)) {\n"
6354 "                char c;\n"
6355
6356 #. type: Plain text
6357 #: build/C/man2/select_tut.2:738
6358 #, no-wrap
6359 msgid ""
6360 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6361 "                if (r E<lt> 1)\n"
6362 "                    SHUT_FD1;\n"
6363 "                else\n"
6364 "                    send(fd2, &c, 1, MSG_OOB);\n"
6365 "            }\n"
6366 "        if (fd2 E<gt> 0)\n"
6367 "            if (FD_ISSET(fd2, &er)) {\n"
6368 "                char c;\n"
6369 msgstr ""
6370 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6371 "                if (r E<lt> 1)\n"
6372 "                    SHUT_FD1;\n"
6373 "                else\n"
6374 "                    send(fd2, &c, 1, MSG_OOB);\n"
6375 "            }\n"
6376 "        if (fd2 E<gt> 0)\n"
6377 "            if (FD_ISSET(fd2, &er)) {\n"
6378 "                char c;\n"
6379
6380 #. type: Plain text
6381 #: build/C/man2/select_tut.2:781
6382 #, no-wrap
6383 msgid ""
6384 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6385 "                if (r E<lt> 1)\n"
6386 "                    SHUT_FD2;\n"
6387 "                else\n"
6388 "                    send(fd1, &c, 1, MSG_OOB);\n"
6389 "            }\n"
6390 "        if (fd1 E<gt> 0)\n"
6391 "            if (FD_ISSET(fd1, &rd)) {\n"
6392 "                r = read(fd1, buf1 + buf1_avail,\n"
6393 "                          BUF_SIZE - buf1_avail);\n"
6394 "                if (r E<lt> 1)\n"
6395 "                    SHUT_FD1;\n"
6396 "                else\n"
6397 "                    buf1_avail += r;\n"
6398 "            }\n"
6399 "        if (fd2 E<gt> 0)\n"
6400 "            if (FD_ISSET(fd2, &rd)) {\n"
6401 "                r = read(fd2, buf2 + buf2_avail,\n"
6402 "                          BUF_SIZE - buf2_avail);\n"
6403 "                if (r E<lt> 1)\n"
6404 "                    SHUT_FD2;\n"
6405 "                else\n"
6406 "                    buf2_avail += r;\n"
6407 "            }\n"
6408 "        if (fd1 E<gt> 0)\n"
6409 "            if (FD_ISSET(fd1, &wr)) {\n"
6410 "                r = write(fd1, buf2 + buf2_written,\n"
6411 "                           buf2_avail - buf2_written);\n"
6412 "                if (r E<lt> 1)\n"
6413 "                    SHUT_FD1;\n"
6414 "                else\n"
6415 "                    buf2_written += r;\n"
6416 "            }\n"
6417 "        if (fd2 E<gt> 0)\n"
6418 "            if (FD_ISSET(fd2, &wr)) {\n"
6419 "                r = write(fd2, buf1 + buf1_written,\n"
6420 "                           buf1_avail - buf1_written);\n"
6421 "                if (r E<lt> 1)\n"
6422 "                    SHUT_FD2;\n"
6423 "                else\n"
6424 "                    buf1_written += r;\n"
6425 "            }\n"
6426 msgstr ""
6427 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6428 "                if (r E<lt> 1)\n"
6429 "                    SHUT_FD2;\n"
6430 "                else\n"
6431 "                    send(fd1, &c, 1, MSG_OOB);\n"
6432 "            }\n"
6433 "        if (fd1 E<gt> 0)\n"
6434 "            if (FD_ISSET(fd1, &rd)) {\n"
6435 "                r = read(fd1, buf1 + buf1_avail,\n"
6436 "                          BUF_SIZE - buf1_avail);\n"
6437 "                if (r E<lt> 1)\n"
6438 "                    SHUT_FD1;\n"
6439 "                else\n"
6440 "                    buf1_avail += r;\n"
6441 "            }\n"
6442 "        if (fd2 E<gt> 0)\n"
6443 "            if (FD_ISSET(fd2, &rd)) {\n"
6444 "                r = read(fd2, buf2 + buf2_avail,\n"
6445 "                          BUF_SIZE - buf2_avail);\n"
6446 "                if (r E<lt> 1)\n"
6447 "                    SHUT_FD2;\n"
6448 "                else\n"
6449 "                    buf2_avail += r;\n"
6450 "            }\n"
6451 "        if (fd1 E<gt> 0)\n"
6452 "            if (FD_ISSET(fd1, &wr)) {\n"
6453 "                r = write(fd1, buf2 + buf2_written,\n"
6454 "                           buf2_avail - buf2_written);\n"
6455 "                if (r E<lt> 1)\n"
6456 "                    SHUT_FD1;\n"
6457 "                else\n"
6458 "                    buf2_written += r;\n"
6459 "            }\n"
6460 "        if (fd2 E<gt> 0)\n"
6461 "            if (FD_ISSET(fd2, &wr)) {\n"
6462 "                r = write(fd2, buf1 + buf1_written,\n"
6463 "                           buf1_avail - buf1_written);\n"
6464 "                if (r E<lt> 1)\n"
6465 "                    SHUT_FD2;\n"
6466 "                else\n"
6467 "                    buf1_written += r;\n"
6468 "            }\n"
6469
6470 #. type: Plain text
6471 #: build/C/man2/select_tut.2:783
6472 #, no-wrap
6473 msgid "        /* check if write data has caught read data */\n"
6474 msgstr "        /* check if write data has caught read data */\n"
6475
6476 #. type: Plain text
6477 #: build/C/man2/select_tut.2:788
6478 #, no-wrap
6479 msgid ""
6480 "        if (buf1_written == buf1_avail)\n"
6481 "            buf1_written = buf1_avail = 0;\n"
6482 "        if (buf2_written == buf2_avail)\n"
6483 "            buf2_written = buf2_avail = 0;\n"
6484 msgstr ""
6485 "        if (buf1_written == buf1_avail)\n"
6486 "            buf1_written = buf1_avail = 0;\n"
6487 "        if (buf2_written == buf2_avail)\n"
6488 "            buf2_written = buf2_avail = 0;\n"
6489
6490 #. type: Plain text
6491 #: build/C/man2/select_tut.2:791
6492 #, no-wrap
6493 msgid ""
6494 "        /* one side has closed the connection, keep\n"
6495 "           writing to the other side until empty */\n"
6496 msgstr ""
6497 "        /* one side has closed the connection, keep\n"
6498 "           writing to the other side until empty */\n"
6499
6500 #. type: Plain text
6501 #: build/C/man2/select_tut.2:799
6502 #, no-wrap
6503 msgid ""
6504 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6505 "            SHUT_FD2;\n"
6506 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6507 "            SHUT_FD1;\n"
6508 "    }\n"
6509 "    exit(EXIT_SUCCESS);\n"
6510 "}\n"
6511 msgstr ""
6512 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6513 "            SHUT_FD2;\n"
6514 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6515 "            SHUT_FD1;\n"
6516 "    }\n"
6517 "    exit(EXIT_SUCCESS);\n"
6518 "}\n"
6519
6520 #. type: Plain text
6521 #: build/C/man2/select_tut.2:813
6522 msgid ""
6523 "The above program properly forwards most kinds of TCP connections including "
6524 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6525 "problem of having data flow in both directions simultaneously.  You might "
6526 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6527 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6528 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6529 "because you end up using inefficient timeouts."
6530 msgstr ""
6531 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6532 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6533 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6534 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6535 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6536 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6537 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6538 "起こってしまう。"
6539
6540 #. type: Plain text
6541 #: build/C/man2/select_tut.2:819
6542 msgid ""
6543 "The program does not handle more than one simultaneous connection at a time, "
6544 "although it could easily be extended to do this with a linked list of buffers"
6545 "\\(emone for each connection.  At the moment, new connections cause the "
6546 "current connection to be dropped."
6547 msgstr ""
6548 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6549 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6550 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6551
6552 #.  .SH AUTHORS
6553 #.  This man page was written by Paul Sheer.
6554 #. type: Plain text
6555 #: build/C/man2/select_tut.2:838
6556 msgid ""
6557 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6558 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6559 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6560 "(3), B<epoll>(7)"
6561 msgstr ""
6562 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6563 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6564 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6565 "(3), B<epoll>(7)"
6566
6567 #. type: TH
6568 #: build/C/man2/send.2:40
6569 #, no-wrap
6570 msgid "SEND"
6571 msgstr "SEND"
6572
6573 #. type: TH
6574 #: build/C/man2/send.2:40
6575 #, no-wrap
6576 msgid "2012-04-23"
6577 msgstr "2012-04-23"
6578
6579 #. type: Plain text
6580 #: build/C/man2/send.2:43
6581 msgid "send, sendto, sendmsg - send a message on a socket"
6582 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6583
6584 #. type: Plain text
6585 #: build/C/man2/send.2:47
6586 #, no-wrap
6587 msgid ""
6588 "B<#include E<lt>sys/types.hE<gt>>\n"
6589 "B<#include E<lt>sys/socket.hE<gt>>\n"
6590 msgstr ""
6591 "B<#include E<lt>sys/types.hE<gt>>\n"
6592 "B<#include E<lt>sys/socket.hE<gt>>\n"
6593
6594 #. type: Plain text
6595 #: build/C/man2/send.2:50
6596 #, no-wrap
6597 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6598 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6599
6600 #. type: Plain text
6601 #: build/C/man2/send.2:54
6602 #, no-wrap
6603 msgid ""
6604 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6605 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6606 msgstr ""
6607 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6608 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6609
6610 #. type: Plain text
6611 #: build/C/man2/send.2:57
6612 #, no-wrap
6613 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6614 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6615
6616 #. type: Plain text
6617 #: build/C/man2/send.2:65
6618 msgid ""
6619 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6620 "transmit a message to another socket."
6621 msgstr ""
6622 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6623 "メッセージを転送するのに使用される。"
6624
6625 #. type: Plain text
6626 #: build/C/man2/send.2:84
6627 msgid ""
6628 "The B<send>()  call may be used only when the socket is in a I<connected> "
6629 "state (so that the intended recipient is known).  The only difference "
6630 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6631 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6632 "following call"
6633 msgstr ""
6634 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6635 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6636 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6637 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6638
6639 #. type: Plain text
6640 #: build/C/man2/send.2:86
6641 #, no-wrap
6642 msgid "    send(sockfd, buf, len, flags);\n"
6643 msgstr "    send(sockfd, buf, len, flags);\n"
6644
6645 #. type: Plain text
6646 #: build/C/man2/send.2:88
6647 msgid "is equivalent to"
6648 msgstr "は以下と等価である。"
6649
6650 #. type: Plain text
6651 #: build/C/man2/send.2:90
6652 #, no-wrap
6653 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6654 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6655
6656 #. type: Plain text
6657 #: build/C/man2/send.2:94
6658 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6659 msgstr ""
6660 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6661 "る。"
6662
6663 #. type: Plain text
6664 #: build/C/man2/send.2:122
6665 msgid ""
6666 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6667 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6668 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6669 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6670 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6671 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6672 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6673 "size."
6674 msgstr ""
6675 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6676 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6677 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6678 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6679 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6680 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6681 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6682 "msg_namelen> で指定される。"
6683
6684 #. type: Plain text
6685 #: build/C/man2/send.2:138
6686 msgid ""
6687 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6688 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6689 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6690 "ancillary data (also known as control information)."
6691 msgstr ""
6692 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6693 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6694 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6695 "(制御情報とも呼ばれる) を送信することもできる。"
6696
6697 #. type: Plain text
6698 #: build/C/man2/send.2:143
6699 msgid ""
6700 "If the message is too long to pass atomically through the underlying "
6701 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6702 "transmitted."
6703 msgstr ""
6704 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6705 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6706 "ラーが返され、そのメッセージは転送されない。"
6707
6708 #. type: Plain text
6709 #: build/C/man2/send.2:147
6710 msgid ""
6711 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6712 "detected errors are indicated by a return value of -1."
6713 msgstr ""
6714 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6715 "出された場合は、返り値 -1 として通知される。"
6716
6717 #. type: Plain text
6718 #: build/C/man2/send.2:160
6719 msgid ""
6720 "When the message does not fit into the send buffer of the socket, B<send>()  "
6721 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6722 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6723 "in this case.  The B<select>(2)  call may be used to determine when it is "
6724 "possible to send more data."
6725 msgstr ""
6726 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6727 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6728 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6729 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6730 "用することができる。"
6731
6732 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6733 #. type: Plain text
6734 #: build/C/man2/send.2:166
6735 msgid ""
6736 "The I<flags> argument is the bitwise OR of zero or more of the following "
6737 "flags."
6738 msgstr ""
6739 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6740 "のを指定する。"
6741
6742 #. type: TP
6743 #: build/C/man2/send.2:166
6744 #, no-wrap
6745 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6746 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6747
6748 #. type: Plain text
6749 #: build/C/man2/send.2:180
6750 msgid ""
6751 "Tell the link layer that forward progress happened: you got a successful "
6752 "reply from the other side.  If the link layer doesn't get this it will "
6753 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6754 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
6755 "IPv4 and IPv6.  See B<arp>(7)  for details."
6756 msgstr ""
6757 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6758 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6759 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6760 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6761 "されている。 詳しくは B<arp>(7)  参照のこと。"
6762
6763 #. type: TP
6764 #: build/C/man2/send.2:180
6765 #, no-wrap
6766 msgid "B<MSG_DONTROUTE>"
6767 msgstr "B<MSG_DONTROUTE>"
6768
6769 #. type: Plain text
6770 #: build/C/man2/send.2:188
6771 msgid ""
6772 "Don't use a gateway to send out the packet, send to hosts only on directly "
6773 "connected networks.  This is usually used only by diagnostic or routing "
6774 "programs.  This is defined only for protocol families that route; packet "
6775 "sockets don't."
6776 msgstr ""
6777 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6778 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6779 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6780 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6781
6782 #. type: Plain text
6783 #: build/C/man2/send.2:199
6784 msgid ""
6785 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6786 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6787 "flag with the B<F_SETFL> B<fcntl>(2))."
6788 msgstr ""
6789 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6790 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6791 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6792
6793 #. type: TP
6794 #: build/C/man2/send.2:199
6795 #, no-wrap
6796 msgid "B<MSG_EOR> (since Linux 2.2)"
6797 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6798
6799 #. type: Plain text
6800 #: build/C/man2/send.2:203
6801 msgid ""
6802 "Terminates a record (when this notion is supported, as for sockets of type "
6803 "B<SOCK_SEQPACKET>)."
6804 msgstr ""
6805 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6806 "ケット種別のときに有効)。"
6807
6808 #. type: TP
6809 #: build/C/man2/send.2:203
6810 #, no-wrap
6811 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6812 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6813
6814 #. type: Plain text
6815 #: build/C/man2/send.2:212
6816 msgid ""
6817 "The caller has more data to send.  This flag is used with TCP sockets to "
6818 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6819 "with the difference that this flag can be set on a per-call basis."
6820 msgstr ""
6821 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6822 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6823 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6824 "機能を有効にできる点である。"
6825
6826 #. type: Plain text
6827 #: build/C/man2/send.2:221
6828 msgid ""
6829 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6830 "the kernel to package all of the data sent in calls with this flag set into "
6831 "a single datagram which is transmitted only when a call is performed that "
6832 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6833 "described in B<udp>(7).)"
6834 msgstr ""
6835 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6836 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6837 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6838 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6839 "ソケットオプション B<UDP_CORK> も参照)。"
6840
6841 #. type: TP
6842 #: build/C/man2/send.2:221
6843 #, no-wrap
6844 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6845 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6846
6847 #. type: Plain text
6848 #: build/C/man2/send.2:230
6849 msgid ""
6850 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6851 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6852 msgstr ""
6853 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6854 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6855
6856 #. type: Plain text
6857 #: build/C/man2/send.2:239
6858 msgid ""
6859 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6860 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6861 "data."
6862 msgstr ""
6863 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6864 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6865 "をサポートしている必要がある。"
6866
6867 #. type: Plain text
6868 #: build/C/man2/send.2:246
6869 msgid ""
6870 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6871 "below for an exact description of its fields."
6872 msgstr ""
6873 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6874 "B<recv>(2)  と以下の説明を参照すること。"
6875
6876 #.  Still to be documented:
6877 #.   Send file descriptors and user credentials using the
6878 #.   msg_control* fields.
6879 #.   The flags returned in msg_flags.
6880 #. type: Plain text
6881 #: build/C/man2/send.2:275
6882 msgid ""
6883 "You may send control information using the I<msg_control> and "
6884 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6885 "process is limited per socket by the value in I</proc/sys/net/core/"
6886 "optmem_max>; see B<socket>(7)."
6887 msgstr ""
6888 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6889 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6890 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6891
6892 #. type: Plain text
6893 #: build/C/man2/send.2:280
6894 msgid ""
6895 "On success, these calls return the number of characters sent.  On error, -1 "
6896 "is returned, and I<errno> is set appropriately."
6897 msgstr ""
6898 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6899 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6900
6901 #. type: Plain text
6902 #: build/C/man2/send.2:285
6903 msgid ""
6904 "These are some standard errors generated by the socket layer.  Additional "
6905 "errors may be generated and returned from the underlying protocol modules; "
6906 "see their respective manual pages."
6907 msgstr ""
6908 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6909 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6910 "れぞれのマニュアルを参照すること。"
6911
6912 #. type: Plain text
6913 #: build/C/man2/send.2:293
6914 msgid ""
6915 "(For UNIX domain sockets, which are identified by pathname)  Write "
6916 "permission is denied on the destination socket file, or search permission is "
6917 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6918 "(7).)"
6919 msgstr ""
6920 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6921 "\n"
6922 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6923 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6924 "(B<path_resolution>(7) も参照のこと)"
6925
6926 #. type: Plain text
6927 #: build/C/man2/send.2:296
6928 msgid ""
6929 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6930 "as though it was a unicast address."
6931 msgstr ""
6932 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6933 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6934
6935 #.  Actually EAGAIN on Linux
6936 #. type: Plain text
6937 #: build/C/man2/send.2:304
6938 msgid ""
6939 "The socket is marked nonblocking and the requested operation would block.  "
6940 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6941 "require these constants to have the same value, so a portable application "
6942 "should check for both possibilities."
6943 msgstr ""
6944 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6945 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6946 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6947 "両方の可能性を 確認すべきである。"
6948
6949 #. type: Plain text
6950 #: build/C/man2/send.2:307
6951 msgid "An invalid descriptor was specified."
6952 msgstr "無効なディスクリプターが指定された。"
6953
6954 #. type: TP
6955 #: build/C/man2/send.2:307
6956 #, no-wrap
6957 msgid "B<ECONNRESET>"
6958 msgstr "B<ECONNRESET>"
6959
6960 #. type: Plain text
6961 #: build/C/man2/send.2:310
6962 msgid "Connection reset by peer."
6963 msgstr "接続が接続相手によりリセットされた。"
6964
6965 #. type: TP
6966 #: build/C/man2/send.2:310
6967 #, no-wrap
6968 msgid "B<EDESTADDRREQ>"
6969 msgstr "B<EDESTADDRREQ>"
6970
6971 #. type: Plain text
6972 #: build/C/man2/send.2:313
6973 msgid "The socket is not connection-mode, and no peer address is set."
6974 msgstr ""
6975 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6976 "ていない。"
6977
6978 #. type: Plain text
6979 #: build/C/man2/send.2:316
6980 msgid "An invalid user space address was specified for an argument."
6981 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6982
6983 #. type: Plain text
6984 #: build/C/man2/send.2:320
6985 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6986 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6987
6988 #. type: Plain text
6989 #: build/C/man2/send.2:329
6990 msgid ""
6991 "The connection-mode socket was connected already but a recipient was "
6992 "specified.  (Now either this error is returned, or the recipient "
6993 "specification is ignored.)"
6994 msgstr ""
6995 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6996 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6997 "いずれかとなる)"
6998
6999 #. type: TP
7000 #: build/C/man2/send.2:329
7001 #, no-wrap
7002 msgid "B<EMSGSIZE>"
7003 msgstr "B<EMSGSIZE>"
7004
7005 #.  (e.g., SOCK_DGRAM )
7006 #. type: Plain text
7007 #: build/C/man2/send.2:335
7008 msgid ""
7009 "The socket type requires that message be sent atomically, and the size of "
7010 "the message to be sent made this impossible."
7011 msgstr ""
7012 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7013 "るが、 メッセージが大き過ぎるため送信することができない。"
7014
7015 #. type: Plain text
7016 #: build/C/man2/send.2:343
7017 msgid ""
7018 "The output queue for a network interface was full.  This generally indicates "
7019 "that the interface has stopped sending, but may be caused by transient "
7020 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7021 "silently dropped when a device queue overflows.)"
7022 msgstr ""
7023 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7024 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7025 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7026 "フローした場合にはパケットは黙って捨てられる)"
7027
7028 #. type: Plain text
7029 #: build/C/man2/send.2:346
7030 msgid "No memory available."
7031 msgstr "メモリが足りない。"
7032
7033 #. type: Plain text
7034 #: build/C/man2/send.2:349
7035 msgid "The socket is not connected, and no target has been given."
7036 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7037
7038 #. type: Plain text
7039 #: build/C/man2/send.2:359
7040 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7041 msgstr ""
7042 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7043 "る。"
7044
7045 #. type: TP
7046 #: build/C/man2/send.2:359
7047 #, no-wrap
7048 msgid "B<EPIPE>"
7049 msgstr "B<EPIPE>"
7050
7051 #. type: Plain text
7052 #: build/C/man2/send.2:368
7053 msgid ""
7054 "The local end has been shut down on a connection oriented socket.  In this "
7055 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7056 "set."
7057 msgstr ""
7058 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7059 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7060
7061 #. type: Plain text
7062 #: build/C/man2/send.2:371
7063 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7064 msgstr ""
7065 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7066
7067 #. type: Plain text
7068 #: build/C/man2/send.2:382
7069 msgid ""
7070 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7071 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7072 "flag is a Linux extension."
7073 msgstr ""
7074 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7075 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7076 "ラグは Linux での拡張である。"
7077
7078 #. type: Plain text
7079 #: build/C/man2/send.2:395
7080 msgid ""
7081 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7082 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7083 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7084 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7085 "and libc5.  See also B<accept>(2)."
7086 msgstr ""
7087 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7088 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7089 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7090 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7091 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7092
7093 #. type: Plain text
7094 #: build/C/man2/send.2:414
7095 msgid ""
7096 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7097 "can be used to transmit multiple datagrams in a single call."
7098 msgstr ""
7099 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7100 "る\n"
7101 "Linux 固有の システムコールに関する情報が書かれている。"
7102
7103 #. type: Plain text
7104 #: build/C/man2/send.2:419
7105 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7106 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7107
7108 #. type: Plain text
7109 #: build/C/man2/send.2:424
7110 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7111 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7112
7113 #. type: Plain text
7114 #: build/C/man2/send.2:439
7115 msgid ""
7116 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7117 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7118 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7119 msgstr ""
7120 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7121 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7122 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7123
7124 #. type: TH
7125 #: build/C/man2/sendmmsg.2:28
7126 #, no-wrap
7127 msgid "SENDMMSG"
7128 msgstr "SENDMMSG"
7129
7130 #. type: TH
7131 #: build/C/man2/sendmmsg.2:28
7132 #, no-wrap
7133 msgid "2012-12-16"
7134 msgstr "2012-12-16"
7135
7136 #. type: Plain text
7137 #: build/C/man2/sendmmsg.2:31
7138 msgid "sendmmsg - send multiple messages on a socket"
7139 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7140
7141 #. type: Plain text
7142 #: build/C/man2/sendmmsg.2:39
7143 #, no-wrap
7144 msgid ""
7145 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7146 "B<             unsigned int >I<flags>B<);>\n"
7147 msgstr ""
7148 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7149 "B<             unsigned int >I<flags>B<);>\n"
7150
7151 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7152 #. type: Plain text
7153 #: build/C/man2/sendmmsg.2:49
7154 msgid ""
7155 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7156 "the caller to transmit multiple messages on a socket using a single system "
7157 "call.  (This has performance benefits for some applications.)"
7158 msgstr ""
7159 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7160 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7161 "ンによっては性能上のメリットがある)。"
7162
7163 #. type: Plain text
7164 #: build/C/man2/sendmmsg.2:54
7165 msgid ""
7166 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7167 "to be transmitted."
7168 msgstr ""
7169 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7170
7171 #. type: Plain text
7172 #: build/C/man2/sendmmsg.2:75
7173 #, no-wrap
7174 msgid ""
7175 "struct mmsghdr {\n"
7176 "    struct msghdr msg_hdr;  /* Message header */\n"
7177 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7178 "};\n"
7179 msgstr ""
7180 "struct mmsghdr {\n"
7181 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7182 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7183 "};\n"
7184
7185 #. type: Plain text
7186 #: build/C/man2/sendmmsg.2:91
7187 msgid ""
7188 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7189 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7190 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7191 "B<sendmsg>(2)  call)."
7192 msgstr ""
7193 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7194 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7195 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7196 "合の返り値と同じである。"
7197
7198 #. type: Plain text
7199 #: build/C/man2/sendmmsg.2:97
7200 msgid ""
7201 "The I<flags> argument contains flags ORed together.  The flags are the same "
7202 "as for B<sendmsg>(2)."
7203 msgstr ""
7204 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7205 "B<sendmsg>(2) と同じである。"
7206
7207 #. type: Plain text
7208 #: build/C/man2/sendmmsg.2:107
7209 msgid ""
7210 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7211 "sent.  A nonblocking call sends as many messages as possible (up to the "
7212 "limit specified by I<vlen>)  and returns immediately."
7213 msgstr ""
7214 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7215 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7216 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7217
7218 #. type: Plain text
7219 #: build/C/man2/sendmmsg.2:119
7220 msgid ""
7221 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7222 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7223 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7224 "of elements of I<msgvec> that have been updated."
7225 msgstr ""
7226 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7227 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7228 "しの返り値は、更新された I<msgvec> の要素数である。"
7229
7230 #. type: Plain text
7231 #: build/C/man2/sendmmsg.2:129
7232 msgid ""
7233 "On success, B<sendmmsg>()  returns the number of messages sent from "
7234 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7235 "B<sendmmsg>()  call to send the remaining messages."
7236 msgstr ""
7237 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7238 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7239 "て残りのメッセージを送信することができる。"
7240
7241 #. type: Plain text
7242 #: build/C/man2/sendmmsg.2:133
7243 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7244 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7245
7246 #
7247 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7248 #.      ... only return an error if no datagrams could be sent.
7249 #.      If less than the requested number of messages were sent, the application
7250 #.      must retry starting at the first failed one and if the problem is
7251 #.      persistent the error will be returned.
7252 #.      This matches the behaviour of other syscalls like read/write - it
7253 #.      is not an error if less than the requested number of elements are sent.
7254 #. type: Plain text
7255 #: build/C/man2/sendmmsg.2:145
7256 msgid ""
7257 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7258 "could be sent."
7259 msgstr ""
7260 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7261 "く送信できなかった場合のみである。"
7262
7263 #. type: Plain text
7264 #: build/C/man2/sendmmsg.2:150
7265 msgid ""
7266 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7267 "added in version 2.14."
7268 msgstr ""
7269 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7270 "バージョン 2.14 で追加された。"
7271
7272 #. type: Plain text
7273 #: build/C/man2/sendmmsg.2:153
7274 msgid "B<sendmmsg>()  is Linux-specific."
7275 msgstr "B<sendmmsg>() は Linux 固有である。"
7276
7277 #
7278 #
7279 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7280 #.      net: Cap number of elements for sendmmsg
7281 #.      To limit the amount of time we can spend in sendmmsg, cap the
7282 #.      number of elements to UIO_MAXIOV (currently 1024).
7283 #.      For error handling an application using sendmmsg needs to retry at
7284 #.      the first unsent message, so capping is simpler and requires less
7285 #.      application logic than returning EINVAL.
7286 #. type: Plain text
7287 #: build/C/man2/sendmmsg.2:168
7288 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7289 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7290
7291 #. type: Plain text
7292 #: build/C/man2/sendmmsg.2:177
7293 msgid ""
7294 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7295 "distinct UDP datagrams using one system call.  The contents of the first "
7296 "datagram originates from a pair of buffers."
7297 msgstr ""
7298 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7299 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7300 "の内容は、二つのバッファから取得される。"
7301
7302 #. type: Plain text
7303 #: build/C/man2/sendmmsg.2:186
7304 #, no-wrap
7305 msgid ""
7306 "#define _GNU_SOURCE\n"
7307 "#include E<lt>netinet/ip.hE<gt>\n"
7308 "#include E<lt>stdio.hE<gt>\n"
7309 "#include E<lt>stdlib.hE<gt>\n"
7310 "#include E<lt>string.hE<gt>\n"
7311 "#include E<lt>sys/types.hE<gt>\n"
7312 "#include E<lt>sys/socket.hE<gt>\n"
7313 msgstr ""
7314 "#define _GNU_SOURCE\n"
7315 "#include E<lt>netinet/ip.hE<gt>\n"
7316 "#include E<lt>stdio.hE<gt>\n"
7317 "#include E<lt>stdlib.hE<gt>\n"
7318 "#include E<lt>string.hE<gt>\n"
7319 "#include E<lt>sys/types.hE<gt>\n"
7320 "#include E<lt>sys/socket.hE<gt>\n"
7321
7322 #. type: Plain text
7323 #: build/C/man2/sendmmsg.2:195
7324 #, no-wrap
7325 msgid ""
7326 "int\n"
7327 "main(void)\n"
7328 "{\n"
7329 "    int sockfd;\n"
7330 "    struct sockaddr_in sa;\n"
7331 "    struct mmsghdr msg[2];\n"
7332 "    struct iovec msg1[2], msg2;\n"
7333 "    int retval;\n"
7334 msgstr ""
7335 "int\n"
7336 "main(void)\n"
7337 "{\n"
7338 "    int sockfd;\n"
7339 "    struct sockaddr_in sa;\n"
7340 "    struct mmsghdr msg[2];\n"
7341 "    struct iovec msg1[2], msg2;\n"
7342 "    int retval;\n"
7343
7344 #. type: Plain text
7345 #: build/C/man2/sendmmsg.2:209
7346 #, no-wrap
7347 msgid ""
7348 "    sa.sin_family = AF_INET;\n"
7349 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7350 "    sa.sin_port = htons(1234);\n"
7351 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7352 "        perror(\"connect()\");\n"
7353 "        exit(EXIT_FAILURE);\n"
7354 "    }\n"
7355 msgstr ""
7356 "    sa.sin_family = AF_INET;\n"
7357 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7358 "    sa.sin_port = htons(1234);\n"
7359 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7360 "        perror(\"connect()\");\n"
7361 "        exit(EXIT_FAILURE);\n"
7362 "    }\n"
7363
7364 #. type: Plain text
7365 #: build/C/man2/sendmmsg.2:215
7366 #, no-wrap
7367 msgid ""
7368 "    memset(msg1, 0, sizeof(msg1));\n"
7369 "    msg1[0].iov_base = \"one\";\n"
7370 "    msg1[0].iov_len = 3;\n"
7371 "    msg1[1].iov_base = \"two\";\n"
7372 "    msg1[1].iov_len = 3;\n"
7373 msgstr ""
7374 "    memset(msg1, 0, sizeof(msg1));\n"
7375 "    msg1[0].iov_base = \"one\";\n"
7376 "    msg1[0].iov_len = 3;\n"
7377 "    msg1[1].iov_base = \"two\";\n"
7378 "    msg1[1].iov_len = 3;\n"
7379
7380 #. type: Plain text
7381 #: build/C/man2/sendmmsg.2:219
7382 #, no-wrap
7383 msgid ""
7384 "    memset(&msg2, 0, sizeof(msg2));\n"
7385 "    msg2.iov_base = \"three\";\n"
7386 "    msg2.iov_len = 5;\n"
7387 msgstr ""
7388 "    memset(&msg2, 0, sizeof(msg2));\n"
7389 "    msg2.iov_base = \"three\";\n"
7390 "    msg2.iov_len = 5;\n"
7391
7392 #. type: Plain text
7393 #: build/C/man2/sendmmsg.2:223
7394 #, no-wrap
7395 msgid ""
7396 "    memset(msg, 0, sizeof(msg));\n"
7397 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7398 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7399 msgstr ""
7400 "    memset(msg, 0, sizeof(msg));\n"
7401 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7402 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7403
7404 #. type: Plain text
7405 #: build/C/man2/sendmmsg.2:226
7406 #, no-wrap
7407 msgid ""
7408 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7409 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7410 msgstr ""
7411 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7412 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7413
7414 #. type: Plain text
7415 #: build/C/man2/sendmmsg.2:232
7416 #, no-wrap
7417 msgid ""
7418 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7419 "    if (retval == -1)\n"
7420 "        perror(\"sendmmsg()\");\n"
7421 "    else\n"
7422 "        printf(\"%d messages sent\\en\", retval);\n"
7423 msgstr ""
7424 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7425 "    if (retval == -1)\n"
7426 "        perror(\"sendmmsg()\");\n"
7427 "    else\n"
7428 "        printf(\"%d messages sent\\en\", retval);\n"
7429
7430 #. type: Plain text
7431 #: build/C/man2/sendmmsg.2:235
7432 #, no-wrap
7433 msgid ""
7434 "    exit(0);\n"
7435 "}\n"
7436 msgstr ""
7437 "    exit(0);\n"
7438 "}\n"
7439
7440 #. type: Plain text
7441 #: build/C/man2/sendmmsg.2:241
7442 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7443 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7444
7445 #. type: TH
7446 #: build/C/man3/sockatmark.3:25
7447 #, no-wrap
7448 msgid "SOCKATMARK"
7449 msgstr "SOCKATMARK"
7450
7451 #. type: Plain text
7452 #: build/C/man3/sockatmark.3:28
7453 msgid "sockatmark - determine whether socket is at out-of-band mark"
7454 msgstr ""
7455 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7456 "べる"
7457
7458 #. type: Plain text
7459 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7460 #: build/C/man7/socket.7:50 build/C/man2/socketpair.2:49
7461 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7462 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7463
7464 #. type: Plain text
7465 #: build/C/man3/sockatmark.3:32
7466 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7467 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7468
7469 #. type: Plain text
7470 #: build/C/man3/sockatmark.3:41
7471 msgid ""
7472 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7473 "\\ 600"
7474 msgstr ""
7475 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7476 "\\ 600"
7477
7478 #. type: Plain text
7479 #: build/C/man3/sockatmark.3:51
7480 msgid ""
7481 "B<sockatmark>()  returns a value indicating whether or not the socket "
7482 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7483 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7484 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7485 msgstr ""
7486 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7487 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7488 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7489 "この関数は帯域外マークを削除しない。"
7490
7491 #. type: Plain text
7492 #: build/C/man3/sockatmark.3:58
7493 msgid ""
7494 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7495 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7496 "set to indicate the error."
7497 msgstr ""
7498 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7499 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7500 "れ、エラーを表す I<errno> が設定される。"
7501
7502 #. type: Plain text
7503 #: build/C/man3/sockatmark.3:63
7504 msgid "I<sockfd> is not a valid file descriptor."
7505 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7506
7507 #.  POSIX.1 says ENOTTY for this case
7508 #. type: Plain text
7509 #: build/C/man3/sockatmark.3:70
7510 msgid ""
7511 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7512 msgstr ""
7513 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7514
7515 #. type: Plain text
7516 #: build/C/man3/sockatmark.3:73
7517 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7518 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7519
7520 #. type: Plain text
7521 #: build/C/man3/sockatmark.3:75
7522 msgid "POSIX.1-2001."
7523 msgstr "POSIX.1-2001."
7524
7525 #. type: Plain text
7526 #: build/C/man3/sockatmark.3:82
7527 msgid ""
7528 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7529 "the B<MSG_OOB> flag of B<recv>(2)."
7530 msgstr ""
7531 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7532 "B<recv>(2)  で読み込むことができる。"
7533
7534 #. type: Plain text
7535 #: build/C/man3/sockatmark.3:84
7536 msgid "Out-of-band data is supported only on some stream socket protocols."
7537 msgstr ""
7538 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7539 "ない。"
7540
7541 #. type: Plain text
7542 #: build/C/man3/sockatmark.3:89
7543 msgid ""
7544 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7545 "signal."
7546 msgstr ""
7547 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7548 "る。"
7549
7550 #. type: Plain text
7551 #: build/C/man3/sockatmark.3:95
7552 msgid ""
7553 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7554 "operation."
7555 msgstr ""
7556 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7557
7558 #. type: Plain text
7559 #: build/C/man3/sockatmark.3:99
7560 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7561 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7562
7563 #. type: Plain text
7564 #: build/C/man3/sockatmark.3:104
7565 msgid ""
7566 "The following code can be used after receipt of a B<SIGURG> signal to read "
7567 "(and discard) all data up to the mark, and then read the byte of data at the "
7568 "mark:"
7569 msgstr ""
7570 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7571 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7572
7573 #. type: Plain text
7574 #: build/C/man3/sockatmark.3:109
7575 #, no-wrap
7576 msgid ""
7577 "    char buf[BUF_LEN];\n"
7578 "    char oobdata;\n"
7579 "    int atmark, s;\n"
7580 msgstr ""
7581 "    char buf[BUF_LEN];\n"
7582 "    char oobdata;\n"
7583 "    int atmark, s;\n"
7584
7585 #. type: Plain text
7586 #: build/C/man3/sockatmark.3:116
7587 #, no-wrap
7588 msgid ""
7589 "    for (;;) {\n"
7590 "        atmark = sockatmark(sockfd);\n"
7591 "        if (atmark == -1) {\n"
7592 "            perror(\"sockatmark\");\n"
7593 "            break;\n"
7594 "        }\n"
7595 msgstr ""
7596 "    for (;;) {\n"
7597 "        atmark = sockatmark(sockfd);\n"
7598 "        if (atmark == -1) {\n"
7599 "            perror(\"sockatmark\");\n"
7600 "            break;\n"
7601 "        }\n"
7602
7603 #. type: Plain text
7604 #: build/C/man3/sockatmark.3:119
7605 #, no-wrap
7606 msgid ""
7607 "        if (atmark)\n"
7608 "            break;\n"
7609 msgstr ""
7610 "        if (atmark)\n"
7611 "            break;\n"
7612
7613 #. type: Plain text
7614 #: build/C/man3/sockatmark.3:126
7615 #, no-wrap
7616 msgid ""
7617 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7618 "        if (s == -1)\n"
7619 "            perror(\"read\");\n"
7620 "        if (s E<lt>= 0)\n"
7621 "            break;\n"
7622 "    }\n"
7623 msgstr ""
7624 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7625 "        if (s == -1)\n"
7626 "            perror(\"read\");\n"
7627 "        if (s E<lt>= 0)\n"
7628 "            break;\n"
7629 "    }\n"
7630
7631 #. type: Plain text
7632 #: build/C/man3/sockatmark.3:133
7633 #, no-wrap
7634 msgid ""
7635 "    if (atmark == 1) {\n"
7636 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7637 "            perror(\"recv\");\n"
7638 "            ...\n"
7639 "        }\n"
7640 "    }\n"
7641 msgstr ""
7642 "    if (atmark == 1) {\n"
7643 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7644 "            perror(\"recv\");\n"
7645 "            ...\n"
7646 "        }\n"
7647 "    }\n"
7648
7649 #. type: Plain text
7650 #: build/C/man3/sockatmark.3:139
7651 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7652 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7653
7654 #. type: TH
7655 #: build/C/man2/socket.2:43 build/C/man7/socket.7:45
7656 #, no-wrap
7657 msgid "SOCKET"
7658 msgstr "SOCKET"
7659
7660 #. type: TH
7661 #: build/C/man2/socket.2:43
7662 #, no-wrap
7663 msgid "2009-01-19"
7664 msgstr "2009-01-19"
7665
7666 #. type: Plain text
7667 #: build/C/man2/socket.2:46
7668 msgid "socket - create an endpoint for communication"
7669 msgstr "socket - 通信のための端点(endpoint)を作成する"
7670
7671 #. type: Plain text
7672 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7673 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7674 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7675
7676 #. type: Plain text
7677 #: build/C/man2/socket.2:52
7678 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7679 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7680
7681 #. type: Plain text
7682 #: build/C/man2/socket.2:55
7683 msgid ""
7684 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7685 msgstr ""
7686 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7687 "(descriptor)を返す。"
7688
7689 #. type: Plain text
7690 #: build/C/man2/socket.2:63
7691 msgid ""
7692 "The I<domain> argument specifies a communication domain; this selects the "
7693 "protocol family which will be used for communication.  These families are "
7694 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7695 "include:"
7696 msgstr ""
7697 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7698 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7699 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7700 "下の通り。"
7701
7702 #. type: tbl table
7703 #: build/C/man2/socket.2:66
7704 #, no-wrap
7705 msgid "Name:Purpose:Man page\n"
7706 msgstr "名前:目的:マニュアル\n"
7707
7708 #. type: tbl table
7709 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7710 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7711 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7712 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7713 #, no-wrap
7714 msgid "T{\n"
7715 msgstr "T{\n"
7716
7717 #. type: tbl table
7718 #: build/C/man2/socket.2:68
7719 #, no-wrap
7720 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7721 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7722
7723 #. type: tbl table
7724 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7725 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7726 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7727 #: build/C/man7/socket.7:181
7728 #, no-wrap
7729 msgid "T}:T{\n"
7730 msgstr "T}:T{\n"
7731
7732 #. type: tbl table
7733 #: build/C/man2/socket.2:70
7734 #, no-wrap
7735 msgid "Local communication\n"
7736 msgstr "ローカル通信\n"
7737
7738 #. type: tbl table
7739 #: build/C/man2/socket.2:72
7740 #, no-wrap
7741 msgid "B<unix>(7)\n"
7742 msgstr "B<unix>(7)\n"
7743
7744 #. type: tbl table
7745 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7746 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7747 #: build/C/man2/socket.2:118 build/C/man7/socket.7:160
7748 #: build/C/man7/socket.7:164 build/C/man7/socket.7:167
7749 #: build/C/man7/socket.7:173 build/C/man7/socket.7:176
7750 #: build/C/man7/socket.7:185 build/C/man7/socket.7:192
7751 #, no-wrap
7752 msgid "T}\n"
7753 msgstr "T}\n"
7754
7755 #. type: tbl table
7756 #: build/C/man2/socket.2:75
7757 #, no-wrap
7758 msgid "B<AF_INET>\n"
7759 msgstr "B<AF_INET>\n"
7760
7761 #. type: tbl table
7762 #: build/C/man2/socket.2:76
7763 #, no-wrap
7764 msgid "T}:IPv4 Internet protocols:T{\n"
7765 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7766
7767 #. type: tbl table
7768 #: build/C/man2/socket.2:77
7769 #, no-wrap
7770 msgid "B<ip>(7)\n"
7771 msgstr "B<ip>(7)\n"
7772
7773 #. type: tbl table
7774 #: build/C/man2/socket.2:80
7775 #, no-wrap
7776 msgid "B<AF_INET6>\n"
7777 msgstr "B<AF_INET6>\n"
7778
7779 #. type: tbl table
7780 #: build/C/man2/socket.2:81
7781 #, no-wrap
7782 msgid "T}:IPv6 Internet protocols:T{\n"
7783 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7784
7785 #. type: tbl table
7786 #: build/C/man2/socket.2:82
7787 #, no-wrap
7788 msgid "B<ipv6>(7)\n"
7789 msgstr "B<ipv6>(7)\n"
7790
7791 #. type: tbl table
7792 #: build/C/man2/socket.2:85
7793 #, no-wrap
7794 msgid "B<AF_IPX>\n"
7795 msgstr "B<AF_IPX>\n"
7796
7797 #. type: tbl table
7798 #: build/C/man2/socket.2:86
7799 #, no-wrap
7800 msgid "T}:IPX - Novell protocols:\n"
7801 msgstr "T}:IPX - Novell プロトコル:\n"
7802
7803 #. type: tbl table
7804 #: build/C/man2/socket.2:88
7805 #, no-wrap
7806 msgid "B<AF_NETLINK>\n"
7807 msgstr "B<AF_NETLINK>\n"
7808
7809 #. type: tbl table
7810 #: build/C/man2/socket.2:90
7811 #, no-wrap
7812 msgid "Kernel user interface device\n"
7813 msgstr "カーネル・ユーザ・デバイス\n"
7814
7815 #. type: tbl table
7816 #: build/C/man2/socket.2:92
7817 #, no-wrap
7818 msgid "B<netlink>(7)\n"
7819 msgstr "B<netlink>(7)\n"
7820
7821 #. type: tbl table
7822 #: build/C/man2/socket.2:95
7823 #, no-wrap
7824 msgid "B<AF_X25>\n"
7825 msgstr "B<AF_X25>\n"
7826
7827 #. type: tbl table
7828 #: build/C/man2/socket.2:96
7829 #, no-wrap
7830 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
7831 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
7832
7833 #. type: tbl table
7834 #: build/C/man2/socket.2:97
7835 #, no-wrap
7836 msgid "B<x25>(7)\n"
7837 msgstr "B<x25>(7)\n"
7838
7839 #. type: tbl table
7840 #: build/C/man2/socket.2:100
7841 #, no-wrap
7842 msgid "B<AF_AX25>\n"
7843 msgstr "B<AF_AX25>\n"
7844
7845 #. type: tbl table
7846 #: build/C/man2/socket.2:102
7847 #, no-wrap
7848 msgid "Amateur radio AX.25 protocol\n"
7849 msgstr "アマチュア無線 AX.25 プロトコル\n"
7850
7851 #. type: tbl table
7852 #: build/C/man2/socket.2:103
7853 #, no-wrap
7854 msgid "T}:\n"
7855 msgstr "T}:\n"
7856
7857 #. type: tbl table
7858 #: build/C/man2/socket.2:105
7859 #, no-wrap
7860 msgid "B<AF_ATMPVC>\n"
7861 msgstr "B<AF_ATMPVC>\n"
7862
7863 #. type: tbl table
7864 #: build/C/man2/socket.2:106
7865 #, no-wrap
7866 msgid "T}:Access to raw ATM PVCs:\n"
7867 msgstr "T}:生の ATM PVC にアクセスする:\n"
7868
7869 #. type: tbl table
7870 #: build/C/man2/socket.2:108
7871 #, no-wrap
7872 msgid "B<AF_APPLETALK>\n"
7873 msgstr "B<AF_APPLETALK>\n"
7874
7875 #. type: tbl table
7876 #: build/C/man2/socket.2:109
7877 #, no-wrap
7878 msgid "T}:Appletalk:T{\n"
7879 msgstr "T}:アップルトーク:T{\n"
7880
7881 #. type: tbl table
7882 #: build/C/man2/socket.2:110
7883 #, no-wrap
7884 msgid "B<ddp>(7)\n"
7885 msgstr "B<ddp>(7)\n"
7886
7887 #. type: tbl table
7888 #: build/C/man2/socket.2:113
7889 #, no-wrap
7890 msgid "B<AF_PACKET>\n"
7891 msgstr "B<AF_PACKET>\n"
7892
7893 #. type: tbl table
7894 #: build/C/man2/socket.2:115
7895 #, no-wrap
7896 msgid "Low level packet interface\n"
7897 msgstr "低レベルのパケットインターフェース\n"
7898
7899 #. type: tbl table
7900 #: build/C/man2/socket.2:117
7901 #, no-wrap
7902 msgid "B<packet>(7)\n"
7903 msgstr "B<packet>(7)\n"
7904
7905 #. type: Plain text
7906 #: build/C/man2/socket.2:126
7907 msgid ""
7908 "The socket has the indicated I<type>, which specifies the communication "
7909 "semantics.  Currently defined types are:"
7910 msgstr ""
7911 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7912 "る。 定義されている型は現在以下の通り。"
7913
7914 #. type: TP
7915 #: build/C/man2/socket.2:126
7916 #, no-wrap
7917 msgid "B<SOCK_STREAM>"
7918 msgstr "B<SOCK_STREAM>"
7919
7920 #. type: Plain text
7921 #: build/C/man2/socket.2:130
7922 msgid ""
7923 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
7924 "out-of-band data transmission mechanism may be supported."
7925 msgstr ""
7926 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7927 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7928
7929 #. type: TP
7930 #: build/C/man2/socket.2:130
7931 #, no-wrap
7932 msgid "B<SOCK_DGRAM>"
7933 msgstr "B<SOCK_DGRAM>"
7934
7935 #. type: Plain text
7936 #: build/C/man2/socket.2:134
7937 msgid ""
7938 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7939 "length)."
7940 msgstr ""
7941 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
7942 "する。"
7943
7944 #. type: TP
7945 #: build/C/man2/socket.2:134
7946 #, no-wrap
7947 msgid "B<SOCK_SEQPACKET>"
7948 msgstr "B<SOCK_SEQPACKET>"
7949
7950 #. type: Plain text
7951 #: build/C/man2/socket.2:139
7952 msgid ""
7953 "Provides a sequenced, reliable, two-way connection-based data transmission "
7954 "path for datagrams of fixed maximum length; a consumer is required to read "
7955 "an entire packet with each input system call."
7956 msgstr ""
7957 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7958 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7959 "ト全体を読み取ることが要求される。"
7960
7961 #. type: TP
7962 #: build/C/man2/socket.2:139
7963 #, no-wrap
7964 msgid "B<SOCK_RAW>"
7965 msgstr "B<SOCK_RAW>"
7966
7967 #. type: Plain text
7968 #: build/C/man2/socket.2:142
7969 msgid "Provides raw network protocol access."
7970 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7971
7972 #. type: TP
7973 #: build/C/man2/socket.2:142
7974 #, no-wrap
7975 msgid "B<SOCK_RDM>"
7976 msgstr "B<SOCK_RDM>"
7977
7978 #. type: Plain text
7979 #: build/C/man2/socket.2:145
7980 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7981 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7982
7983 #. type: TP
7984 #: build/C/man2/socket.2:145
7985 #, no-wrap
7986 msgid "B<SOCK_PACKET>"
7987 msgstr "B<SOCK_PACKET>"
7988
7989 #. type: Plain text
7990 #: build/C/man2/socket.2:150
7991 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7992 msgstr ""
7993 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7994 "こと"
7995
7996 #. type: Plain text
7997 #: build/C/man2/socket.2:156
7998 msgid ""
7999 "Some socket types may not be implemented by all protocol families; for "
8000 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
8001 msgstr ""
8002 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
8003 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
8004
8005 #. type: Plain text
8006 #: build/C/man2/socket.2:164
8007 msgid ""
8008 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8009 "addition to specifying a socket type, it may include the bitwise OR of any "
8010 "of the following values, to modify the behavior of B<socket>():"
8011 msgstr ""
8012 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8013 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8014 "ることで、 B<socket>()  の振舞いを変更することができる。"
8015
8016 #. type: Plain text
8017 #: build/C/man2/socket.2:198
8018 msgid ""
8019 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8020 "Normally only a single protocol exists to support a particular socket type "
8021 "within a given protocol family, in which case I<protocol> can be specified "
8022 "as 0.  However, it is possible that many protocols may exist, in which case "
8023 "a particular protocol must be specified in this manner.  The protocol number "
8024 "to use is specific to the ``communication domain'' in which communication is "
8025 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8026 "protocol name strings to protocol numbers."
8027 msgstr ""
8028 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8029 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8030 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8031 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8032 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8033 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8034 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8035
8036 #. type: Plain text
8037 #: build/C/man2/socket.2:228
8038 msgid ""
8039 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8040 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
8041 "a I<connected> state before any data may be sent or received on it.  A "
8042 "connection to another socket is created with a B<connect>(2)  call.  Once "
8043 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
8044 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
8045 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
8046 "also be transmitted as described in B<send>(2)  and received as described in "
8047 "B<recv>(2)."
8048 msgstr ""
8049 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8050 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8051 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8052 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
8053 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
8054 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
8055 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
8056
8057 #. type: Plain text
8058 #: build/C/man2/socket.2:254
8059 msgid ""
8060 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8061 "data is not lost or duplicated.  If a piece of data for which the peer "
8062 "protocol has buffer space cannot be successfully transmitted within a "
8063 "reasonable length of time, then the connection is considered to be dead.  "
8064 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8065 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8066 "signal is raised if a process sends or receives on a broken stream; this "
8067 "causes naive processes, which do not handle the signal, to exit.  "
8068 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8069 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8070 "amount of data requested, and any data remaining in the arriving packet will "
8071 "be discarded.  Also all message boundaries in incoming datagrams are "
8072 "preserved."
8073 msgstr ""
8074 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8075 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8076 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8077 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8078 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8079 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8080 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8081 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8082 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8083 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8084
8085 #. type: Plain text
8086 #: build/C/man2/socket.2:264
8087 msgid ""
8088 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8089 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8090 "received with B<recvfrom>(2), which returns the next datagram along with the "
8091 "address of its sender."
8092 msgstr ""
8093 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8094 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8095 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8096 "す。"
8097
8098 #. type: Plain text
8099 #: build/C/man2/socket.2:271
8100 msgid ""
8101 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8102 "from the device driver.  Use B<packet>(7)  instead."
8103 msgstr ""
8104 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8105 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8106
8107 #. type: Plain text
8108 #: build/C/man2/socket.2:294
8109 msgid ""
8110 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8111 "process group to receive a B<SIGURG> signal when the out-of-band data "
8112 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8113 "unexpectedly.  This operation may also be used to set the process or process "
8114 "group that receives the I/O and asynchronous notification of I/O events via "
8115 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8116 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8117 msgstr ""
8118 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8119 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8120 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8121 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8122 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8123 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8124 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8125
8126 #. type: Plain text
8127 #: build/C/man2/socket.2:304
8128 msgid ""
8129 "When the network signals an error condition to the protocol module (e.g., "
8130 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8131 "The next operation on this socket will return the error code of the pending "
8132 "error.  For some protocols it is possible to enable a per-socket error queue "
8133 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8134 "(7)."
8135 msgstr ""
8136 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8137 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8138 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8139 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8140 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8141 "B<IP_RECVERR> を参照すること。"
8142
8143 #. type: Plain text
8144 #: build/C/man2/socket.2:314
8145 msgid ""
8146 "The operation of sockets is controlled by socket level I<options>.  These "
8147 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8148 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8149 "respectively."
8150 msgstr ""
8151 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8152 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8153 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8154
8155 #. type: Plain text
8156 #: build/C/man2/socket.2:319
8157 msgid ""
8158 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8159 "is returned, and I<errno> is set appropriately."
8160 msgstr ""
8161 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8162 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8163
8164 #. type: Plain text
8165 #: build/C/man2/socket.2:324
8166 msgid ""
8167 "Permission to create a socket of the specified type and/or protocol is "
8168 "denied."
8169 msgstr ""
8170 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8171
8172 #. type: Plain text
8173 #: build/C/man2/socket.2:327
8174 msgid "The implementation does not support the specified address family."
8175 msgstr "指定されたアドレスファミリーがサポートされていない。"
8176
8177 #. type: Plain text
8178 #: build/C/man2/socket.2:330
8179 msgid "Unknown protocol, or protocol family not available."
8180 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8181
8182 #.  Since Linux 2.6.27
8183 #. type: Plain text
8184 #: build/C/man2/socket.2:335
8185 msgid "Invalid flags in I<type>."
8186 msgstr "I<type> に無効なフラグが指定されている。"
8187
8188 #. type: Plain text
8189 #: build/C/man2/socket.2:338
8190 msgid "Process file table overflow."
8191 msgstr "プロセスのファイルテーブルが溢れている。"
8192
8193 #. type: TP
8194 #: build/C/man2/socket.2:341
8195 #, no-wrap
8196 msgid "B<ENOBUFS> or B<ENOMEM>"
8197 msgstr "B<ENOBUFS> または B<ENOMEM>"
8198
8199 #. type: Plain text
8200 #: build/C/man2/socket.2:346
8201 msgid ""
8202 "Insufficient memory is available.  The socket cannot be created until "
8203 "sufficient resources are freed."
8204 msgstr ""
8205 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8206 "ない。"
8207
8208 #. type: TP
8209 #: build/C/man2/socket.2:346 build/C/man2/socketpair.2:92
8210 #, no-wrap
8211 msgid "B<EPROTONOSUPPORT>"
8212 msgstr "B<EPROTONOSUPPORT>"
8213
8214 #. type: Plain text
8215 #: build/C/man2/socket.2:350
8216 msgid ""
8217 "The protocol type or the specified protocol is not supported within this "
8218 "domain."
8219 msgstr ""
8220 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8221 "いない。"
8222
8223 #. type: Plain text
8224 #: build/C/man2/socket.2:352
8225 msgid "Other errors may be generated by the underlying protocol modules."
8226 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8227
8228 #. type: Plain text
8229 #: build/C/man2/socket.2:354
8230 msgid "4.4BSD, POSIX.1-2001."
8231 msgstr "4.4BSD, POSIX.1-2001."
8232
8233 #. type: Plain text
8234 #: build/C/man2/socket.2:360
8235 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8236 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8237
8238 #. type: Plain text
8239 #: build/C/man2/socket.2:366
8240 msgid ""
8241 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8242 "systems supporting clones of the BSD socket layer (including System V "
8243 "variants)."
8244 msgstr ""
8245 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8246 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8247 "外のシステムからの移植ができる。"
8248
8249 #. type: Plain text
8250 #: build/C/man2/socket.2:385
8251 msgid ""
8252 "The manifest constants used under 4.x BSD for protocol families are "
8253 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8254 "are used for address families.  However, already the BSD man page promises: "
8255 "\"The protocol family generally is the same as the address family\", and "
8256 "subsequent standards use AF_* everywhere."
8257 msgstr ""
8258 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8259 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8260 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8261 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8262 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8263 "それ以外の規格では全ての場所で AF_* が使用されている。"
8264
8265 #. type: Plain text
8266 #: build/C/man2/socket.2:390
8267 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8268 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8269
8270 #. type: Plain text
8271 #: build/C/man2/socket.2:413
8272 msgid ""
8273 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8274 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8275 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8276 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8277 "(7), B<unix>(7)"
8278 msgstr ""
8279 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8280 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8281 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8282 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8283 "(7), B<unix>(7)"
8284
8285 #. type: Plain text
8286 #: build/C/man2/socket.2:419
8287 msgid ""
8288 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8289 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8290 "Programmer's Supplementary Documents Volume 1.>"
8291 msgstr ""
8292 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8293 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8294 "Supplementary Documents Volume 1.> として再版された)"
8295
8296 #. type: Plain text
8297 #: build/C/man7/socket.7:48
8298 msgid "socket - Linux socket interface"
8299 msgstr "socket - Linux のソケットインターフェース"
8300
8301 #. type: Plain text
8302 #: build/C/man7/socket.7:52
8303 msgid ""
8304 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8305 ">I<protocol>B<);>"
8306 msgstr ""
8307 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8308 ">I<protocol>B<);>"
8309
8310 #. type: Plain text
8311 #: build/C/man7/socket.7:71
8312 msgid ""
8313 "This manual page describes the Linux networking socket layer user "
8314 "interface.  The BSD compatible sockets are the uniform interface between the "
8315 "user process and the network protocol stacks in the kernel.  The protocol "
8316 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
8317 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
8318 "B<socket>(2)  for more information on families and types."
8319 msgstr ""
8320 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8321 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8322 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8323 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8324 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8325 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8326 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8327
8328 #. type: SS
8329 #: build/C/man7/socket.7:71
8330 #, no-wrap
8331 msgid "Socket-layer functions"
8332 msgstr "ソケット層の関数群"
8333
8334 #. type: Plain text
8335 #: build/C/man7/socket.7:75
8336 msgid ""
8337 "These functions are used by the user process to send or receive packets and "
8338 "to do other socket operations.  For more information see their respective "
8339 "manual pages."
8340 msgstr ""
8341 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8342 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8343
8344 #. type: Plain text
8345 #: build/C/man7/socket.7:91
8346 msgid ""
8347 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8348 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8349 "address, B<listen>(2)  tells the socket that new connections shall be "
8350 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8351 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8352 "(implemented only for a few local families like B<AF_UNIX>)"
8353 msgstr ""
8354 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8355 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8356 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8357 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8358 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8359 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8360 "リーでしか実装されていない)。"
8361
8362 #. type: Plain text
8363 #: build/C/man7/socket.7:113
8364 msgid ""
8365 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8366 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8367 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8368 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8369 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8370 "write data."
8371 msgstr ""
8372 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8373 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8374 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8375 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8376 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8377 "ことができる。"
8378
8379 #. type: Plain text
8380 #: build/C/man7/socket.7:124
8381 msgid ""
8382 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8383 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8384 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8385 "be used to set or read some other options."
8386 msgstr ""
8387 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8388 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8389 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8390 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8391
8392 #. type: Plain text
8393 #: build/C/man7/socket.7:129
8394 msgid ""
8395 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8396 "full-duplex socket connection."
8397 msgstr ""
8398 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8399 "続を部分的にクローズする。"
8400
8401 #. type: Plain text
8402 #: build/C/man7/socket.7:135
8403 msgid ""
8404 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8405 "not supported on sockets."
8406 msgstr ""
8407 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8408 "ではサポートされていない。"
8409
8410 #. type: Plain text
8411 #: build/C/man7/socket.7:152
8412 msgid ""
8413 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8414 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8415 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8416 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8417 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8418 msgstr ""
8419 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8420 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8421 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8422 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8423 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8424 "B<select>(2)  を使って待つことができる。"
8425
8426 #. type: tbl table
8427 #: build/C/man7/socket.7:156
8428 #, no-wrap
8429 msgid "I/O events\n"
8430 msgstr "I/O イベント\n"
8431
8432 #. type: tbl table
8433 #: build/C/man7/socket.7:157
8434 #, no-wrap
8435 msgid "Event:Poll flag:Occurrence\n"
8436 msgstr "イベント:poll フラグ:内容\n"
8437
8438 #. type: tbl table
8439 #: build/C/man7/socket.7:158 build/C/man7/socket.7:161
8440 #, no-wrap
8441 msgid "Read:POLLIN:T{\n"
8442 msgstr "Read:POLLIN:T{\n"
8443
8444 #. type: tbl table
8445 #: build/C/man7/socket.7:159
8446 #, no-wrap
8447 msgid "New data arrived.\n"
8448 msgstr "新しいデータが到着した。\n"
8449
8450 #. type: tbl table
8451 #: build/C/man7/socket.7:162
8452 #, no-wrap
8453 msgid "A connection setup has been completed\n"
8454 msgstr "(接続志向のソケットで)\n"
8455
8456 #. type: tbl table
8457 #: build/C/man7/socket.7:163
8458 #, no-wrap
8459 msgid "(for connection-oriented sockets)\n"
8460 msgstr "接続の設定が終了した。\n"
8461
8462 #. type: tbl table
8463 #: build/C/man7/socket.7:165 build/C/man7/socket.7:168
8464 #, no-wrap
8465 msgid "Read:POLLHUP:T{\n"
8466 msgstr "Read:POLLHUP:T{\n"
8467
8468 #. type: tbl table
8469 #: build/C/man7/socket.7:166
8470 #, no-wrap
8471 msgid "A disconnection request has been initiated by the other end.\n"
8472 msgstr "接続先で切断要求が生成された。\n"
8473
8474 #. type: tbl table
8475 #: build/C/man7/socket.7:169
8476 #, no-wrap
8477 msgid "A connection is broken (only for connection-oriented protocols).\n"
8478 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8479
8480 #. type: tbl table
8481 #: build/C/man7/socket.7:170
8482 #, no-wrap
8483 msgid "When the socket is written\n"
8484 msgstr "この場合、ソケットに書き込みが行われると\n"
8485
8486 #. type: tbl table
8487 #: build/C/man7/socket.7:171
8488 #, no-wrap
8489 msgid "B<SIGPIPE>\n"
8490 msgstr "B<SIGPIPE>\n"
8491
8492 #. type: tbl table
8493 #: build/C/man7/socket.7:172
8494 #, no-wrap
8495 msgid "is also sent.\n"
8496 msgstr "も送信される。\n"
8497
8498 #. type: tbl table
8499 #: build/C/man7/socket.7:174
8500 #, no-wrap
8501 msgid "Write:POLLOUT:T{\n"
8502 msgstr "Write:POLLOUT:T{\n"
8503
8504 #. type: tbl table
8505 #: build/C/man7/socket.7:175
8506 #, no-wrap
8507 msgid "Socket has enough send buffer space for writing new data.\n"
8508 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8509
8510 #. type: tbl table
8511 #: build/C/man7/socket.7:177
8512 #, no-wrap
8513 msgid "Read/Write:T{\n"
8514 msgstr "Read/Write:T{\n"
8515
8516 #. type: tbl table
8517 #: build/C/man7/socket.7:178
8518 #, no-wrap
8519 msgid "POLLIN|\n"
8520 msgstr "POLLIN|\n"
8521
8522 #. type: tbl table
8523 #: build/C/man7/socket.7:179
8524 #, no-wrap
8525 msgid ".br\n"
8526 msgstr ".br\n"
8527
8528 #. type: tbl table
8529 #: build/C/man7/socket.7:180
8530 #, no-wrap
8531 msgid "POLLOUT\n"
8532 msgstr "POLLOUT\n"
8533
8534 #. type: tbl table
8535 #: build/C/man7/socket.7:182
8536 #, no-wrap
8537 msgid "An outgoing\n"
8538 msgstr "外部向けの\n"
8539
8540 #. type: tbl table
8541 #: build/C/man7/socket.7:183
8542 #, no-wrap
8543 msgid "B<connect>(2)\n"
8544 msgstr "B<connect>(2)\n"
8545
8546 #. type: tbl table
8547 #: build/C/man7/socket.7:184
8548 #, no-wrap
8549 msgid "finished.\n"
8550 msgstr "が終了した。\n"
8551
8552 #. type: tbl table
8553 #: build/C/man7/socket.7:186
8554 #, no-wrap
8555 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8556 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8557
8558 #. type: tbl table
8559 #: build/C/man7/socket.7:187
8560 #, no-wrap
8561 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8562 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8563
8564 #. type: tbl table
8565 #: build/C/man7/socket.7:188
8566 #, no-wrap
8567 msgid "Exception:POLLPRI:T{\n"
8568 msgstr "Exception:POLLPRI:T{\n"
8569
8570 #. type: tbl table
8571 #: build/C/man7/socket.7:189
8572 #, no-wrap
8573 msgid "Urgent data arrived.\n"
8574 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8575
8576 #. type: tbl table
8577 #: build/C/man7/socket.7:190
8578 #, no-wrap
8579 msgid "B<SIGURG>\n"
8580 msgstr "B<SIGURG>\n"
8581
8582 #. type: tbl table
8583 #: build/C/man7/socket.7:191
8584 #, no-wrap
8585 msgid "is sent then.\n"
8586 msgstr "が送信される。\n"
8587
8588 #. type: Plain text
8589 #: build/C/man7/socket.7:220
8590 msgid ""
8591 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8592 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8593 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8594 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8595 "I<Signals> discussion below."
8596 msgstr ""
8597 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8598 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8599 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8600 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8601 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8602 "と。"
8603
8604 #. type: SS
8605 #: build/C/man7/socket.7:220
8606 #, no-wrap
8607 msgid "Socket address structures"
8608 msgstr "ソケットアドレス構造体"
8609
8610 #. type: Plain text
8611 #: build/C/man7/socket.7:236
8612 msgid ""
8613 "Each socket domain has its own format for socket addresses, with a domain-"
8614 "specific address structure.  Each of these structures begins with an integer "
8615 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8616 "address structure.  This allows the various system calls (e.g., B<connect>"
8617 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8618 "are generic to all socket domains, to determine the domain of a particular "
8619 "socket address."
8620 msgstr ""
8621 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8622 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8623 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8624 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8625 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8626 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8627 "できる。"
8628
8629 #. type: Plain text
8630 #: build/C/man7/socket.7:246
8631 msgid ""
8632 "To allow any type of socket address to be passed to interfaces in the "
8633 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8634 "type is purely to allow casting of domain-specific socket address types to a "
8635 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8636 "calls to the sockets API."
8637 msgstr ""
8638 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8639 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8640 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8641 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8642 "告を出すのを避けることができる。"
8643
8644 #. type: Plain text
8645 #: build/C/man7/socket.7:256
8646 msgid ""
8647 "In addition, the sockets API provides the data type I<struct "
8648 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8649 "domain-specific socket address structures; it is large enough and is aligned "
8650 "properly.  (In particular, it is large enough to hold IPv6 socket "
8651 "addresses.)  The structure includes the following field, which can be used "
8652 "to identify the type of socket address actually stored in the structure:"
8653 msgstr ""
8654 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8655 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8656 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8657 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8658 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8659 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8660 "できる。"
8661
8662 #. type: Plain text
8663 #: build/C/man7/socket.7:260
8664 #, no-wrap
8665 msgid "    sa_family_t ss_family;\n"
8666 msgstr "    sa_family_t ss_family;\n"
8667
8668 #. type: Plain text
8669 #: build/C/man7/socket.7:268
8670 msgid ""
8671 "The I<sockaddr_storage> structure is useful in programs that must handle "
8672 "socket addresses in a generic way (e.g., programs that must deal with both "
8673 "IPv4 and IPv6 socket addresses)."
8674 msgstr ""
8675 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8676 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8677 "ログラム) で有用である。"
8678
8679 #. type: SS
8680 #: build/C/man7/socket.7:268
8681 #, no-wrap
8682 msgid "Socket options"
8683 msgstr "ソケットオプション"
8684
8685 #.  FIXME
8686 #.  In the list below, the text used to describe argument types
8687 #.  for each socket option should be more consistent
8688 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8689 #.  W R Stevens, UNPv1
8690 #. type: Plain text
8691 #: build/C/man7/socket.7:286
8692 msgid ""
8693 "The socket options listed below can be set by using B<setsockopt>(2)  and "
8694 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
8695 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
8696 msgstr ""
8697 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
8698 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8699 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
8700 "I<int> へのポインタである。"
8701
8702 #. type: TP
8703 #: build/C/man7/socket.7:286
8704 #, no-wrap
8705 msgid "B<SO_ACCEPTCONN>"
8706 msgstr "B<SO_ACCEPTCONN>"
8707
8708 #. type: Plain text
8709 #: build/C/man7/socket.7:294
8710 msgid ""
8711 "Returns a value indicating whether or not this socket has been marked to "
8712 "accept connections with B<listen>(2).  The value 0 indicates that this is "
8713 "not a listening socket, the value 1 indicates that this is a listening "
8714 "socket.  This socket option is read-only."
8715 msgstr ""
8716 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
8717 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8718 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8719
8720 #. type: TP
8721 #: build/C/man7/socket.7:294
8722 #, no-wrap
8723 msgid "B<SO_BINDTODEVICE>"
8724 msgstr "B<SO_BINDTODEVICE>"
8725
8726 #. type: Plain text
8727 #: build/C/man7/socket.7:313
8728 msgid ""
8729 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8730 "the passed interface name.  If the name is an empty string or the option "
8731 "length is zero, the socket device binding is removed.  The passed option is "
8732 "a variable-length null-terminated interface name string with the maximum "
8733 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
8734 "received from that particular interface are processed by the socket.  Note "
8735 "that this works only for some socket types, particularly B<AF_INET> "
8736 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
8737 "there)."
8738 msgstr ""
8739 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
8740 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
8741 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
8742 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
8743 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
8744 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
8745 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
8746 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
8747 "B<bind>(2) を使うこと)。"
8748
8749 #. type: Plain text
8750 #: build/C/man7/socket.7:327
8751 msgid ""
8752 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8753 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
8754 "argument should contain the buffer size available to receive the device name "
8755 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
8756 "reported back in the I<optlen> argument."
8757 msgstr ""
8758 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
8759 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
8760 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
8761 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
8762 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
8763
8764 #. type: TP
8765 #: build/C/man7/socket.7:327
8766 #, no-wrap
8767 msgid "B<SO_BROADCAST>"
8768 msgstr "B<SO_BROADCAST>"
8769
8770 #. type: Plain text
8771 #: build/C/man7/socket.7:333
8772 msgid ""
8773 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
8774 "to send packets to a broadcast address.  This option has no effect on stream-"
8775 "oriented sockets."
8776 msgstr ""
8777 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
8778 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
8779 "ストリーム指向のソケットには何の効果もない。"
8780
8781 #. type: TP
8782 #: build/C/man7/socket.7:333
8783 #, no-wrap
8784 msgid "B<SO_BSDCOMPAT>"
8785 msgstr "B<SO_BSDCOMPAT>"
8786
8787 #. type: Plain text
8788 #: build/C/man7/socket.7:345
8789 msgid ""
8790 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
8791 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
8792 "socket will not be passed to the user program.  In later kernel versions, "
8793 "support for this option has been phased out: Linux 2.4 silently ignores it, "
8794 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
8795 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
8796 "header changing, skipping of the broadcast flag) for raw sockets with this "
8797 "option, but that was removed in Linux 2.2."
8798 msgstr ""
8799 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
8800 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
8801 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
8802 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
8803 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
8804 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
8805 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
8806 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
8807 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
8808
8809 #. type: TP
8810 #: build/C/man7/socket.7:345
8811 #, no-wrap
8812 msgid "B<SO_DEBUG>"
8813 msgstr "B<SO_DEBUG>"
8814
8815 #. type: Plain text
8816 #: build/C/man7/socket.7:351
8817 msgid ""
8818 "Enable socket debugging.  Only allowed for processes with the "
8819 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
8820 msgstr ""
8821 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
8822 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
8823
8824 #. type: TP
8825 #: build/C/man7/socket.7:351
8826 #, no-wrap
8827 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8828 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8829
8830 #. type: Plain text
8831 #: build/C/man7/socket.7:359
8832 msgid ""
8833 "Retrieves the socket domain as an integer, returning a value such as "
8834 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
8835 "only."
8836 msgstr ""
8837 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
8838 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8839
8840 #. type: TP
8841 #: build/C/man7/socket.7:359
8842 #, no-wrap
8843 msgid "B<SO_ERROR>"
8844 msgstr "B<SO_ERROR>"
8845
8846 #. type: Plain text
8847 #: build/C/man7/socket.7:364
8848 msgid ""
8849 "Get and clear the pending socket error.  This socket option is read-only.  "
8850 "Expects an integer."
8851 msgstr ""
8852 "保留になっていたソケットエラーを取得してクリアする。\n"
8853 "このソケットオプションは読み込み専用である。整数値をとる。"
8854
8855 #. type: TP
8856 #: build/C/man7/socket.7:364
8857 #, no-wrap
8858 msgid "B<SO_DONTROUTE>"
8859 msgstr "B<SO_DONTROUTE>"
8860
8861 #. type: Plain text
8862 #: build/C/man7/socket.7:373
8863 msgid ""
8864 "Don't send via a gateway, send only to directly connected hosts.  The same "
8865 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
8866 "B<send>(2)  operation.  Expects an integer boolean flag."
8867 msgstr ""
8868 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
8869 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
8870 "数のフラグを取る。"
8871
8872 #. type: TP
8873 #: build/C/man7/socket.7:373
8874 #, no-wrap
8875 msgid "B<SO_KEEPALIVE>"
8876 msgstr "B<SO_KEEPALIVE>"
8877
8878 #. type: Plain text
8879 #: build/C/man7/socket.7:377
8880 msgid ""
8881 "Enable sending of keep-alive messages on connection-oriented sockets.  "
8882 "Expects an integer boolean flag."
8883 msgstr ""
8884 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
8885 "の整数フラグをとる。"
8886
8887 #. type: TP
8888 #: build/C/man7/socket.7:377
8889 #, no-wrap
8890 msgid "B<SO_LINGER>"
8891 msgstr "B<SO_LINGER>"
8892
8893 #. type: Plain text
8894 #: build/C/man7/socket.7:385
8895 msgid ""
8896 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
8897 msgstr ""
8898 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
8899
8900 #. type: Plain text
8901 #: build/C/man7/socket.7:392
8902 #, no-wrap
8903 msgid ""
8904 "struct linger {\n"
8905 "    int l_onoff;    /* linger active */\n"
8906 "    int l_linger;   /* how many seconds to linger for */\n"
8907 "};\n"
8908 msgstr ""
8909 "struct linger {\n"
8910 "    int l_onoff;    /* linger active */\n"
8911 "    int l_linger;   /* how many seconds to linger for */\n"
8912 "};\n"
8913
8914 #. type: Plain text
8915 #: build/C/man7/socket.7:406
8916 msgid ""
8917 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
8918 "queued messages for the socket have been successfully sent or the linger "
8919 "timeout has been reached.  Otherwise, the call returns immediately and the "
8920 "closing is done in the background.  When the socket is closed as part of "
8921 "B<exit>(2), it always lingers in the background."
8922 msgstr ""
8923 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
8924 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
8925 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
8926 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
8927 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
8928 "送られる。"
8929
8930 #. type: TP
8931 #: build/C/man7/socket.7:406
8932 #, no-wrap
8933 msgid "B<SO_MARK> (since Linux 2.6.25)"
8934 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
8935
8936 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
8937 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
8938 #. type: Plain text
8939 #: build/C/man7/socket.7:417
8940 msgid ""
8941 "Set the mark for each packet sent through this socket (similar to the "
8942 "netfilter MARK target but socket-based).  Changing the mark can be used for "
8943 "mark-based routing without netfilter or for packet filtering.  Setting this "
8944 "option requires the B<CAP_NET_ADMIN> capability."
8945 msgstr ""
8946 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
8947 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
8948 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
8949 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
8950 "ティが必要である。"
8951
8952 #. type: TP
8953 #: build/C/man7/socket.7:417
8954 #, no-wrap
8955 msgid "B<SO_OOBINLINE>"
8956 msgstr "B<SO_OOBINLINE>"
8957
8958 #.  don't document it because it can do too much harm.
8959 #. .B SO_NO_CHECK
8960 #. type: Plain text
8961 #: build/C/man7/socket.7:426
8962 msgid ""
8963 "If this option is enabled, out-of-band data is directly placed into the "
8964 "receive data stream.  Otherwise out-of-band data is passed only when the "
8965 "B<MSG_OOB> flag is set during receiving."
8966 msgstr ""
8967 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
8968 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
8969 "ラグがセットされている場合に限って渡される。"
8970
8971 #. type: TP
8972 #: build/C/man7/socket.7:426
8973 #, no-wrap
8974 msgid "B<SO_PASSCRED>"
8975 msgstr "B<SO_PASSCRED>"
8976
8977 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8978 #.  in the 2.6.18 ChangeLog
8979 #. type: Plain text
8980 #: build/C/man7/socket.7:435
8981 msgid ""
8982 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
8983 "For more information see B<unix>(7)."
8984 msgstr ""
8985 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
8986 "を参照のこと。"
8987
8988 #. type: TP
8989 #: build/C/man7/socket.7:435
8990 #, no-wrap
8991 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
8992 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
8993
8994 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
8995 #. type: Plain text
8996 #: build/C/man7/socket.7:445
8997 msgid ""
8998 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
8999 "the value of the \"peek offset\" for the B<recv(2)> system call when used "
9000 "with B<MSG_PEEK> flag."
9001 msgstr ""
9002 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9003 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9004 "B<unix>(7) ソケットでのみサポートされている。"
9005
9006 #. type: Plain text
9007 #: build/C/man7/socket.7:453
9008 msgid ""
9009 "When this option is set to a negative value (it is set to -1 for all new "
9010 "sockets), traditional behavior is provided: B<recv(2)> with the B<MSG_PEEK> "
9011 "flag will peek data from the front of the queue."
9012 msgstr ""
9013 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9014 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9015 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9016 "のソケットではこのオプションの値は必ず -1 に設定される。"
9017
9018 #. type: Plain text
9019 #: build/C/man7/socket.7:460
9020 msgid ""
9021 "When the option is set to a value greater than or equal to zero, then the "
9022 "next peek at data queued in the socket will occur at the byte offset "
9023 "specified by the option value.  At the same time, the \"peek offset\" will "
9024 "be incremented by the number of bytes that were peeked from the queue, so "
9025 "that a subsequent peek will return the next data in the queue.i"
9026 msgstr ""
9027 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9028 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9029 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9030 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9031
9032 #. type: Plain text
9033 #: build/C/man7/socket.7:472
9034 msgid ""
9035 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9036 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9037 "by the number of bytes removed.  In other words, receiving data without the "
9038 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9039 "the correct relative position in the queued data, so that a subsequent peek "
9040 "will retrieve the data that would have been retrieved had the data not been "
9041 "removed."
9042 msgstr ""
9043 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9044 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9045 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9046 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9047 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9048 "いうことである。"
9049
9050 #. type: Plain text
9051 #: build/C/man7/socket.7:477
9052 msgid ""
9053 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9054 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9055 msgstr ""
9056 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9057 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9058
9059 #. type: Plain text
9060 #: build/C/man7/socket.7:481
9061 msgid ""
9062 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9063 "Suppose a stream socket has the following queued input data:"
9064 msgstr ""
9065 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9066 "以下の入力データが入っているものとする。"
9067
9068 #. type: Plain text
9069 #: build/C/man7/socket.7:483
9070 #, no-wrap
9071 msgid "    aabbccddeeff\n"
9072 msgstr "    aabbccddeeff\n"
9073
9074 #. type: Plain text
9075 #: build/C/man7/socket.7:488
9076 msgid ""
9077 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9078 "the comments:"
9079 msgstr ""
9080 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9081
9082 #. type: Plain text
9083 #: build/C/man7/socket.7:493
9084 #, no-wrap
9085 msgid ""
9086 "int ov = 4;                  // Set peek offset to 4\n"
9087 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9088 msgstr ""
9089 "int ov = 4;                  // Set peek offset to 4\n"
9090 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9091
9092 #. type: Plain text
9093 #: build/C/man7/socket.7:498
9094 #, no-wrap
9095 msgid ""
9096 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9097 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9098 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9099 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9100 msgstr ""
9101 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9102 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9103 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9104 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9105
9106 #. type: TP
9107 #: build/C/man7/socket.7:500
9108 #, no-wrap
9109 msgid "B<SO_PEERCRED>"
9110 msgstr "B<SO_PEERCRED>"
9111
9112 #. type: Plain text
9113 #: build/C/man7/socket.7:523
9114 msgid ""
9115 "Return the credentials of the foreign process connected to this socket.  "
9116 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9117 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
9118 "(7).  The returned credentials are those that were in effect at the time of "
9119 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
9120 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
9121 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
9122 "option is read-only."
9123 msgstr ""
9124 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9125 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9126 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9127 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9128 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9129 "る。引き数は I<ucred> 構造体である。このソケットオプションは読み込み専用であ"
9130 "る。"
9131
9132 #. type: TP
9133 #: build/C/man7/socket.7:523
9134 #, no-wrap
9135 msgid "B<SO_PRIORITY>"
9136 msgstr "B<SO_PRIORITY>"
9137
9138 #. type: Plain text
9139 #: build/C/man7/socket.7:536
9140 msgid ""
9141 "Set the protocol-defined priority for all packets to be sent on this "
9142 "socket.  Linux uses this value to order the networking queues: packets with "
9143 "a higher priority may be processed first depending on the selected device "
9144 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9145 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9146 "6 requires the B<CAP_NET_ADMIN> capability."
9147 msgstr ""
9148 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9149 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9150 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9151 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9152 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9153 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9154
9155 #. type: TP
9156 #: build/C/man7/socket.7:536
9157 #, no-wrap
9158 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9159 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9160
9161 #. type: Plain text
9162 #: build/C/man7/socket.7:544
9163 msgid ""
9164 "Retrieves the socket protocol as an integer, returning a value such as "
9165 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9166 "only."
9167 msgstr ""
9168 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9169 "る。\n"
9170 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9171
9172 #. type: TP
9173 #: build/C/man7/socket.7:544
9174 #, no-wrap
9175 msgid "B<SO_RCVBUF>"
9176 msgstr "B<SO_RCVBUF>"
9177
9178 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9179 #.  The following thread on LMKL is quite informative:
9180 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9181 #.  17 July 2012
9182 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9183 #. type: Plain text
9184 #: build/C/man7/socket.7:563
9185 msgid ""
9186 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9187 "this value (to allow space for bookkeeping overhead)  when it is set using "
9188 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9189 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9190 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9191 "file.  The minimum (doubled) value for this option is 256."
9192 msgstr ""
9193 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9194 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9195 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9196 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9197 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9198 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9199
9200 #. type: TP
9201 #: build/C/man7/socket.7:563
9202 #, no-wrap
9203 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9204 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9205
9206 #. type: Plain text
9207 #: build/C/man7/socket.7:572
9208 msgid ""
9209 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9210 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9211 "overridden."
9212 msgstr ""
9213 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9214 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9215 "きすることができる。"
9216
9217 #. type: TP
9218 #: build/C/man7/socket.7:572
9219 #, no-wrap
9220 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9221 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9222
9223 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9224 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9225 #. type: Plain text
9226 #: build/C/man7/socket.7:601
9227 msgid ""
9228 "Specify the minimum number of bytes in the buffer until the socket layer "
9229 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9230 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9231 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9232 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9233 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9234 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9235 "single byte of data is available.  A subsequent read from the socket will "
9236 "block until B<SO_RCVLOWAT> bytes are available."
9237 msgstr ""
9238 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9239 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9240 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9241 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9242 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9243 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9244 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9245 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9246 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9247 "してしまう。"
9248
9249 #. type: TP
9250 #: build/C/man7/socket.7:601
9251 #, no-wrap
9252 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9253 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9254
9255 #.  Not implemented in 2.0.
9256 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9257 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9258 #.  in fact to EAGAIN
9259 #. type: Plain text
9260 #: build/C/man7/socket.7:636
9261 msgid ""
9262 "Specify the receiving or sending timeouts until reporting an error.  The "
9263 "argument is a I<struct timeval>.  If an input or output function blocks for "
9264 "this period of time, and data has been sent or received, the return value of "
9265 "that function will be the amount of data transferred; if no data has been "
9266 "transferred and the timeout has been reached then -1 is returned with "
9267 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9268 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9269 "the timeout is set to zero (the default)  then the operation will never "
9270 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9271 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9272 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9273 msgstr ""
9274 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9275 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9276 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9277 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9278 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>"
9279 "(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見"
9280 "える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタ"
9281 "イムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行す"
9282 "るシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), "
9283 "B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), B<epoll_wait>(2)  などには"
9284 "タイムアウトは影響を及ぼさない。"
9285
9286 #. type: TP
9287 #: build/C/man7/socket.7:636
9288 #, no-wrap
9289 msgid "B<SO_REUSEADDR>"
9290 msgstr "B<SO_REUSEADDR>"
9291
9292 #. type: Plain text
9293 #: build/C/man7/socket.7:651
9294 msgid ""
9295 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9296 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9297 "this means that a socket may bind, except when there is an active listening "
9298 "socket bound to the address.  When the listening socket is bound to "
9299 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9300 "port for any local address.  Argument is an integer boolean flag."
9301 msgstr ""
9302 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9303 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9304 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9305 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9306 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9307 "ドできない。 引き数はブール整数のフラグである。"
9308
9309 #. type: TP
9310 #: build/C/man7/socket.7:651
9311 #, no-wrap
9312 msgid "B<SO_SNDBUF>"
9313 msgstr "B<SO_SNDBUF>"
9314
9315 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9316 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9317 #. type: Plain text
9318 #: build/C/man7/socket.7:667
9319 msgid ""
9320 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9321 "this value (to allow space for bookkeeping overhead)  when it is set using "
9322 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9323 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9324 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9325 "file.  The minimum (doubled) value for this option is 2048."
9326 msgstr ""
9327 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9328 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9329 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9330 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9331 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9332 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9333
9334 #. type: TP
9335 #: build/C/man7/socket.7:667
9336 #, no-wrap
9337 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9338 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9339
9340 #. type: Plain text
9341 #: build/C/man7/socket.7:676
9342 msgid ""
9343 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9344 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9345 "overridden."
9346 msgstr ""
9347 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9348 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9349 "きすることができる。"
9350
9351 #. type: TP
9352 #: build/C/man7/socket.7:676
9353 #, no-wrap
9354 msgid "B<SO_TIMESTAMP>"
9355 msgstr "B<SO_TIMESTAMP>"
9356
9357 #. type: Plain text
9358 #: build/C/man7/socket.7:692
9359 msgid ""
9360 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9361 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9362 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9363 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9364 "details on control messages."
9365 msgstr ""
9366 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9367 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9368 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9369 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9370
9371 #. type: TP
9372 #: build/C/man7/socket.7:692
9373 #, no-wrap
9374 msgid "B<SO_TYPE>"
9375 msgstr "B<SO_TYPE>"
9376
9377 #. type: Plain text
9378 #: build/C/man7/socket.7:697
9379 msgid ""
9380 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9381 "option is read-only."
9382 msgstr ""
9383 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9384 "このソケットオプションは読み出し専用である。"
9385
9386 #. type: SS
9387 #: build/C/man7/socket.7:697
9388 #, no-wrap
9389 msgid "Signals"
9390 msgstr "シグナル"
9391
9392 #. type: Plain text
9393 #: build/C/man7/socket.7:708
9394 msgid ""
9395 "When writing onto a connection-oriented socket that has been shut down (by "
9396 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9397 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9398 "the B<MSG_NOSIGNAL> flag."
9399 msgstr ""
9400 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9401 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9402 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9403 "していた場合はシグナルは送られない。"
9404
9405 #. type: Plain text
9406 #: build/C/man7/socket.7:733
9407 msgid ""
9408 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9409 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9410 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9411 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9412 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9413 "signal will be called with the file descriptor in the I<si_fd> field of its "
9414 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9415 msgstr ""
9416 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9417 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9418 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9419 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9420 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9421 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9422 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9423 "を参照のこと。"
9424
9425 #.  .SS Ancillary messages
9426 #. type: Plain text
9427 #: build/C/man7/socket.7:741
9428 msgid ""
9429 "Under some circumstances (e.g., multiple processes accessing a single "
9430 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9431 "when the process reacts to the signal.  If this happens, the process should "
9432 "wait again because Linux will resend the signal later."
9433 msgstr ""
9434 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9435 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9436 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9437 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9438
9439 #. type: SS
9440 #: build/C/man7/socket.7:741
9441 #, no-wrap
9442 msgid "/proc interfaces"
9443 msgstr "/proc インタフェース"
9444
9445 #. type: Plain text
9446 #: build/C/man7/socket.7:745
9447 msgid ""
9448 "The core socket networking parameters can be accessed via files in the "
9449 "directory I</proc/sys/net/core/>."
9450 msgstr ""
9451 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9452 "レクトリ内のファイルを通してアクセスできる。"
9453
9454 #. type: TP
9455 #: build/C/man7/socket.7:745
9456 #, no-wrap
9457 msgid "I<rmem_default>"
9458 msgstr "I<rmem_default>"
9459
9460 #. type: Plain text
9461 #: build/C/man7/socket.7:748
9462 msgid "contains the default setting in bytes of the socket receive buffer."
9463 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9464
9465 #. type: TP
9466 #: build/C/man7/socket.7:748
9467 #, no-wrap
9468 msgid "I<rmem_max>"
9469 msgstr "I<rmem_max>"
9470
9471 #. type: Plain text
9472 #: build/C/man7/socket.7:754
9473 msgid ""
9474 "contains the maximum socket receive buffer size in bytes which a user may "
9475 "set by using the B<SO_RCVBUF> socket option."
9476 msgstr ""
9477 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9478 "ファサイズの最大値 (バイト単位)。"
9479
9480 #. type: TP
9481 #: build/C/man7/socket.7:754
9482 #, no-wrap
9483 msgid "I<wmem_default>"
9484 msgstr "I<wmem_default>"
9485
9486 #. type: Plain text
9487 #: build/C/man7/socket.7:757
9488 msgid "contains the default setting in bytes of the socket send buffer."
9489 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9490
9491 #. type: TP
9492 #: build/C/man7/socket.7:757
9493 #, no-wrap
9494 msgid "I<wmem_max>"
9495 msgstr "I<wmem_max>"
9496
9497 #. type: Plain text
9498 #: build/C/man7/socket.7:763
9499 msgid ""
9500 "contains the maximum socket send buffer size in bytes which a user may set "
9501 "by using the B<SO_SNDBUF> socket option."
9502 msgstr ""
9503 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9504 "ファサイズの最大値 (バイト単位)。"
9505
9506 #. type: TP
9507 #: build/C/man7/socket.7:763
9508 #, no-wrap
9509 msgid "I<message_cost> and I<message_burst>"
9510 msgstr "I<message_cost> と I<message_burst>"
9511
9512 #. type: Plain text
9513 #: build/C/man7/socket.7:767
9514 msgid ""
9515 "configure the token bucket filter used to load limit warning messages caused "
9516 "by external network events."
9517 msgstr ""
9518 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9519 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9520
9521 #. type: TP
9522 #: build/C/man7/socket.7:767
9523 #, no-wrap
9524 msgid "I<netdev_max_backlog>"
9525 msgstr "I<netdev_max_backlog>"
9526
9527 #. type: Plain text
9528 #: build/C/man7/socket.7:770
9529 msgid "Maximum number of packets in the global input queue."
9530 msgstr "グローバルな入力キューにおける最大のパケット数。"
9531
9532 #. type: TP
9533 #: build/C/man7/socket.7:770
9534 #, no-wrap
9535 msgid "I<optmem_max>"
9536 msgstr "I<optmem_max>"
9537
9538 #.  netdev_fastroute is not documented because it is experimental
9539 #. type: Plain text
9540 #: build/C/man7/socket.7:775
9541 msgid ""
9542 "Maximum length of ancillary data and user control data like the iovecs per "
9543 "socket."
9544 msgstr ""
9545 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9546 "うなもの) との和の最大長。"
9547
9548 #. type: SS
9549 #: build/C/man7/socket.7:775
9550 #, no-wrap
9551 msgid "Ioctls"
9552 msgstr "ioctl"
9553
9554 #. type: Plain text
9555 #: build/C/man7/socket.7:778
9556 msgid "These operations can be accessed using B<ioctl>(2):"
9557 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9558
9559 #. type: Plain text
9560 #: build/C/man7/socket.7:782
9561 #, no-wrap
9562 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9563 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9564
9565 #. type: TP
9566 #: build/C/man7/socket.7:784
9567 #, no-wrap
9568 msgid "B<SIOCGSTAMP>"
9569 msgstr "B<SIOCGSTAMP>"
9570
9571 #. type: Plain text
9572 #: build/C/man7/socket.7:808
9573 msgid ""
9574 "Return a I<struct timeval> with the receive timestamp of the last packet "
9575 "passed to the user.  This is useful for accurate round trip time "
9576 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9577 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9578 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9579 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9580 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9581 "to B<ENOENT>)."
9582 msgstr ""
9583 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9584 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9585 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9586 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9587 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9588 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9589 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9590 "セットする)。"
9591
9592 #. type: TP
9593 #: build/C/man7/socket.7:808
9594 #, no-wrap
9595 msgid "B<SIOCSPGRP>"
9596 msgstr "B<SIOCSPGRP>"
9597
9598 #. type: Plain text
9599 #: build/C/man7/socket.7:827
9600 msgid ""
9601 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9602 "when an asynchronous I/O operation has finished or urgent data is "
9603 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9604 "positive, send the signals to that process.  If the argument is negative, "
9605 "send the signals to the process group with the ID of the absolute value of "
9606 "the argument.  The process may only choose itself or its own process group "
9607 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9608 "UID of 0."
9609 msgstr ""
9610 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9611 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9612 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9613 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9614 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9615 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9616 "の場合は この限りではない。"
9617
9618 #. type: TP
9619 #: build/C/man7/socket.7:827
9620 #, no-wrap
9621 msgid "B<FIOASYNC>"
9622 msgstr "B<FIOASYNC>"
9623
9624 #. type: Plain text
9625 #: build/C/man7/socket.7:837
9626 msgid ""
9627 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9628 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9629 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9630 msgstr ""
9631 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9632 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9633 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9634
9635 #. type: Plain text
9636 #: build/C/man7/socket.7:845
9637 msgid ""
9638 "Argument is an integer boolean flag.  (This operation is synonymous with the "
9639 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
9640 msgstr ""
9641 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
9642 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9643
9644 #. type: TP
9645 #: build/C/man7/socket.7:845
9646 #, no-wrap
9647 msgid "B<SIOCGPGRP>"
9648 msgstr "B<SIOCGPGRP>"
9649
9650 #. type: Plain text
9651 #: build/C/man7/socket.7:854
9652 msgid ""
9653 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9654 "signals, or 0 when none is set."
9655 msgstr ""
9656 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9657 "る。 ない場合は 0 が返る。"
9658
9659 #. type: Plain text
9660 #: build/C/man7/socket.7:858
9661 msgid "Valid B<fcntl>(2)  operations:"
9662 msgstr "有効な B<fcntl>(2)  操作:"
9663
9664 #. type: TP
9665 #: build/C/man7/socket.7:858
9666 #, no-wrap
9667 msgid "B<FIOGETOWN>"
9668 msgstr "B<FIOGETOWN>"
9669
9670 #. type: Plain text
9671 #: build/C/man7/socket.7:863
9672 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9673 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
9674
9675 #. type: TP
9676 #: build/C/man7/socket.7:863
9677 #, no-wrap
9678 msgid "B<FIOSETOWN>"
9679 msgstr "B<FIOSETOWN>"
9680
9681 #. type: Plain text
9682 #: build/C/man7/socket.7:868
9683 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9684 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
9685
9686 #. type: Plain text
9687 #: build/C/man7/socket.7:882
9688 msgid ""
9689 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
9690 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
9691 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
9692 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9693 "be read or written."
9694 msgstr ""
9695 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9696 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9697 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9698 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9699 "はできなかった。"
9700
9701 #. type: Plain text
9702 #: build/C/man7/socket.7:887
9703 msgid ""
9704 "Linux assumes that half of the send/receive buffer is used for internal "
9705 "kernel structures; thus the values in the corresponding I</proc> files are "
9706 "twice what can be observed on the wire."
9707 msgstr ""
9708 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
9709 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
9710 "なる。"
9711
9712 #. type: Plain text
9713 #: build/C/man7/socket.7:900
9714 msgid ""
9715 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
9716 "option was set both in the previous program that performed a B<bind>(2)  to "
9717 "the port and in the program that wants to reuse the port.  This differs from "
9718 "some implementations (e.g., FreeBSD)  where only the later program needs to "
9719 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
9720 "since, for example, a server program is designed to always set this option."
9721 msgstr ""
9722 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
9723 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
9724 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
9725 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
9726 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
9727 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
9728 "このオプションをセットするように設計されるからである。"
9729
9730 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
9731 #.  .SH AUTHORS
9732 #.  This man page was written by Andi Kleen.
9733 #. type: Plain text
9734 #: build/C/man7/socket.7:913
9735 msgid ""
9736 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
9737 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
9738 "is via the libpcap library."
9739 msgstr ""
9740 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
9741 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
9742 "して 用いる方が良い。"
9743
9744 #. type: Plain text
9745 #: build/C/man7/socket.7:925
9746 msgid ""
9747 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9748 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9749 "B<unix>(7)"
9750 msgstr ""
9751 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9752 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9753 "B<unix>(7)"
9754
9755 #. type: TH
9756 #: build/C/man2/socketcall.2:25
9757 #, no-wrap
9758 msgid "SOCKETCALL"
9759 msgstr "SOCKETCALL"
9760
9761 #. type: TH
9762 #: build/C/man2/socketcall.2:25
9763 #, no-wrap
9764 msgid "2012-10-16"
9765 msgstr "2012-10-16"
9766
9767 #. type: Plain text
9768 #: build/C/man2/socketcall.2:28
9769 msgid "socketcall - socket system calls"
9770 msgstr "socketcall - ソケット・システムコール"
9771
9772 #. type: Plain text
9773 #: build/C/man2/socketcall.2:30
9774 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9775 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9776
9777 #. type: Plain text
9778 #: build/C/man2/socketcall.2:38
9779 msgid ""
9780 "B<socketcall>()  is a common kernel entry point for the socket system "
9781 "calls.  I<call> determines which socket function to invoke.  I<args> points "
9782 "to a block containing the actual arguments, which are passed through to the "
9783 "appropriate call."
9784 msgstr ""
9785 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
9786 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
9787 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
9788 "ロックを指す。"
9789
9790 #. type: Plain text
9791 #: build/C/man2/socketcall.2:42
9792 msgid ""
9793 "User programs should call the appropriate functions by their usual names.  "
9794 "Only standard library implementors and kernel hackers need to know about "
9795 "B<socketcall>()."
9796 msgstr ""
9797 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
9798 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
9799 "必要がある。"
9800
9801 #. type: Plain text
9802 #: build/C/man2/socketcall.2:45
9803 msgid ""
9804 "This call is specific to Linux, and should not be used in programs intended "
9805 "to be portable."
9806 msgstr ""
9807 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
9808 "い。"
9809
9810 #. type: Plain text
9811 #: build/C/man2/socketcall.2:53
9812 msgid ""
9813 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
9814 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
9815 "(2), and so on really are implemented as separate system calls."
9816 msgstr ""
9817 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
9818 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
9819 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
9820
9821 #. type: Plain text
9822 #: build/C/man2/socketcall.2:71
9823 msgid ""
9824 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9825 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9826 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9827 "(2), B<socket>(2), B<socketpair>(2)"
9828 msgstr ""
9829 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9830 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9831 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9832 "(2), B<socket>(2), B<socketpair>(2)"
9833
9834 #. type: TH
9835 #: build/C/man2/socketpair.2:42
9836 #, no-wrap
9837 msgid "SOCKETPAIR"
9838 msgstr "SOCKETPAIR"
9839
9840 #. type: TH
9841 #: build/C/man2/socketpair.2:42
9842 #, no-wrap
9843 msgid "2008-10-11"
9844 msgstr "2008-10-11"
9845
9846 #. type: Plain text
9847 #: build/C/man2/socketpair.2:45
9848 msgid "socketpair - create a pair of connected sockets"
9849 msgstr "socketpair - 接続されたソケットのペアを作成する"
9850
9851 #. type: Plain text
9852 #: build/C/man2/socketpair.2:52
9853 msgid ""
9854 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9855 ">I<sv>B<[2]);>"
9856 msgstr ""
9857 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9858 ">I<sv>B<[2]);>"
9859
9860 #. type: Plain text
9861 #: build/C/man2/socketpair.2:63
9862 msgid ""
9863 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
9864 "the specified I<domain>, of the specified I<type>, and using the optionally "
9865 "specified I<protocol>.  For further details of these arguments, see B<socket>"
9866 "(2)."
9867 msgstr ""
9868 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
9869 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
9870 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
9871
9872 #. type: Plain text
9873 #: build/C/man2/socketpair.2:69
9874 msgid ""
9875 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
9876 "and I<sv>[1].  The two sockets are indistinguishable."
9877 msgstr ""
9878 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
9879 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
9880
9881 #. type: Plain text
9882 #: build/C/man2/socketpair.2:78
9883 msgid "The specified address family is not supported on this machine."
9884 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
9885
9886 #. type: Plain text
9887 #: build/C/man2/socketpair.2:83
9888 msgid ""
9889 "The address I<sv> does not specify a valid part of the process address space."
9890 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
9891
9892 #. type: Plain text
9893 #: build/C/man2/socketpair.2:86
9894 msgid "Too many descriptors are in use by this process."
9895 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
9896
9897 #. type: Plain text
9898 #: build/C/man2/socketpair.2:92
9899 msgid "The specified protocol does not support creation of socket pairs."
9900 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
9901
9902 #. type: Plain text
9903 #: build/C/man2/socketpair.2:95
9904 msgid "The specified protocol is not supported on this machine."
9905 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
9906
9907 #. type: Plain text
9908 #: build/C/man2/socketpair.2:103
9909 msgid ""
9910 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
9911 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
9912 "of the BSD socket layer (including System V variants)."
9913 msgstr ""
9914 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
9915 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
9916 "BSD 以外のシステムと、 互いに移植性がある。"
9917
9918 #. type: Plain text
9919 #: build/C/man2/socketpair.2:109
9920 msgid ""
9921 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
9922 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
9923 "restriction.)"
9924 msgstr ""
9925 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
9926 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
9927
9928 #. type: Plain text
9929 #: build/C/man2/socketpair.2:118
9930 msgid ""
9931 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
9932 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
9933 msgstr ""
9934 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
9935 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
9936
9937 #. type: Plain text
9938 #: build/C/man2/socketpair.2:131
9939 msgid ""
9940 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9941 msgstr ""
9942 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"