OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.50.
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2013-03-22 01:06+0900\n"
10 "PO-Revision-Date: 2012-05-29 21:31+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:48 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:48
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:49
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 #, fuzzy
76 #| msgid "accept - accept a connection on a socket"
77 msgid "accept, accept4 - accept a connection on a socket"
78 msgstr "accept - ソケットへの接続を受ける"
79
80 #. type: SH
81 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
82 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
83 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
84 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
85 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
86 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
87 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
88 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
89 #: build/C/man2/socket.2:46 build/C/man7/socket.7:51
90 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
91 #, no-wrap
92 msgid "SYNOPSIS"
93 msgstr "書式"
94
95 #. type: Plain text
96 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
97 #, no-wrap
98 msgid ""
99 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
100 "B<#include E<lt>sys/socket.hE<gt>>\n"
101 msgstr ""
102 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
103 "B<#include E<lt>sys/socket.hE<gt>>\n"
104
105 #. type: Plain text
106 #: build/C/man2/accept.2:50
107 #, no-wrap
108 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
109 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
110
111 #. type: Plain text
112 #: build/C/man2/accept.2:53
113 #, no-wrap
114 msgid ""
115 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
116 "B<#include E<lt>sys/socket.hE<gt>>\n"
117 msgstr ""
118 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
119 "B<#include E<lt>sys/socket.hE<gt>>\n"
120
121 #. type: Plain text
122 #: build/C/man2/accept.2:56
123 #, no-wrap
124 msgid ""
125 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
126 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
127 msgstr ""
128 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
129 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
130
131 #. type: SH
132 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
133 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
134 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
135 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
136 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
137 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
138 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
139 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
140 #: build/C/man2/socket.2:52 build/C/man7/socket.7:55
141 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
142 #, no-wrap
143 msgid "DESCRIPTION"
144 msgstr "説明"
145
146 #. type: Plain text
147 #: build/C/man2/accept.2:72
148 msgid ""
149 "The B<accept>()  system call is used with connection-based socket types "
150 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
151 "request on the queue of pending connections for the listening socket, "
152 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
153 "referring to that socket.  The newly created socket is not in the listening "
154 "state.  The original socket I<sockfd> is unaffected by this call."
155 msgstr ""
156 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
157 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
158 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
159 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
160 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
161 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
162
163 #. type: Plain text
164 #: build/C/man2/accept.2:81
165 msgid ""
166 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
167 "bound to a local address with B<bind>(2), and is listening for connections "
168 "after a B<listen>(2)."
169 msgstr ""
170 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
171 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
172 "である。"
173
174 #. type: Plain text
175 #: build/C/man2/accept.2:99
176 msgid ""
177 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
178 "structure is filled in with the address of the peer socket, as known to the "
179 "communications layer.  The exact format of the address returned I<addr> is "
180 "determined by the socket's address family (see B<socket>(2)  and the "
181 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
182 "in this case, I<addrlen> is not used, and should also be NULL."
183 msgstr ""
184 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
185 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
186 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
187 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
188 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
189 "おくべきである。"
190
191 #. type: Plain text
192 #: build/C/man2/accept.2:107
193 msgid ""
194 "The I<addrlen> argument is a value-result argument: the caller must "
195 "initialize it to contain the size (in bytes) of the structure pointed to by "
196 "I<addr>; on return it will contain the actual size of the peer address."
197 msgstr ""
198 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
199 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
200 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
201
202 #. type: Plain text
203 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
204 msgid ""
205 "The returned address is truncated if the buffer provided is too small; in "
206 "this case, I<addrlen> will return a value greater than was supplied to the "
207 "call."
208 msgstr ""
209 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
210 "る。\n"
211 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
212 "される。"
213
214 #. type: Plain text
215 #: build/C/man2/accept.2:125
216 msgid ""
217 "If no pending connections are present on the queue, and the socket is not "
218 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
219 "present.  If the socket is marked nonblocking and no pending connections are "
220 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
221 "B<EWOULDBLOCK>."
222 msgstr ""
223 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
224 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
225 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
226 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
227
228 #. type: Plain text
229 #: build/C/man2/accept.2:139
230 msgid ""
231 "In order to be notified of incoming connections on a socket, you can use "
232 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
233 "connection is attempted and you may then call B<accept>()  to get a socket "
234 "for that connection.  Alternatively, you can set the socket to deliver "
235 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
236 msgstr ""
237 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
238 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
239 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
240 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
241 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
242
243 #. type: Plain text
244 #: build/C/man2/accept.2:152
245 msgid ""
246 "For certain protocols which require an explicit confirmation, such as "
247 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
248 "connection request and not implying confirmation.  Confirmation can be "
249 "implied by a normal read or write on the new file descriptor, and rejection "
250 "can be implied by closing the new socket.  Currently only DECNet has these "
251 "semantics on Linux."
252 msgstr ""
253 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
254 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
255 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
256 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
257 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
258 "セマンティクスを持つのは DECNet だけである。"
259
260 #. type: Plain text
261 #: build/C/man2/accept.2:162
262 msgid ""
263 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
264 "following values can be bitwise ORed in I<flags> to obtain different "
265 "behavior:"
266 msgstr ""
267 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
268 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
269 "できる。"
270
271 #. type: TP
272 #: build/C/man2/accept.2:162 build/C/man2/socket.2:164
273 #, no-wrap
274 msgid "B<SOCK_NONBLOCK>"
275 msgstr "B<SOCK_NONBLOCK>"
276
277 #. type: Plain text
278 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
279 msgid ""
280 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
281 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
282 msgstr ""
283 "新しく生成されるオープンファイル記述 (open file description) の "
284 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
285 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
286 "なる。"
287
288 #. type: TP
289 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
290 #, no-wrap
291 msgid "B<SOCK_CLOEXEC>"
292 msgstr "B<SOCK_CLOEXEC>"
293
294 #. type: Plain text
295 #: build/C/man2/accept.2:180 build/C/man2/socket.2:182
296 msgid ""
297 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
298 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
299 "may be useful."
300 msgstr ""
301 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
302 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
303 "B<O_CLOEXEC> フラグの説明を参照のこと。"
304
305 #. type: SH
306 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
307 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
308 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
309 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
310 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
311 #: build/C/man2/recv.2:388 build/C/man2/recvmmsg.2:149
312 #: build/C/man2/select.2:289 build/C/man2/select_tut.2:485
313 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
314 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:314
315 #: build/C/man2/socketpair.2:69
316 #, no-wrap
317 msgid "RETURN VALUE"
318 msgstr "返り値"
319
320 #. type: Plain text
321 #: build/C/man2/accept.2:187
322 msgid ""
323 "On success, these system calls return a nonnegative integer that is a "
324 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
325 "is set appropriately."
326 msgstr ""
327 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
328 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
329 "定する。"
330
331 #. type: SS
332 #: build/C/man2/accept.2:187
333 #, fuzzy, no-wrap
334 #| msgid "Error Handling"
335 msgid "Error handling"
336 msgstr "エラー処理"
337
338 #. type: Plain text
339 #: build/C/man2/accept.2:214
340 msgid ""
341 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
342 "on the new socket as an error code from B<accept>().  This behavior differs "
343 "from other BSD socket implementations.  For reliable operation the "
344 "application should detect the network errors defined for the protocol after "
345 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
346 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
347 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
348 msgstr ""
349 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
350 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
351 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
352 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
353 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
354 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
355 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
356 "B<ENETUNREACH>"
357
358 #. type: SH
359 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
360 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
361 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
362 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
363 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
364 #: build/C/man2/recv.2:393 build/C/man2/recvmmsg.2:157
365 #: build/C/man2/select.2:306 build/C/man2/send.2:280
366 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:56
367 #: build/C/man2/socket.2:319 build/C/man2/socketpair.2:74
368 #, no-wrap
369 msgid "ERRORS"
370 msgstr "エラー"
371
372 #. type: TP
373 #: build/C/man2/accept.2:215 build/C/man2/recv.2:398 build/C/man2/send.2:296
374 #, no-wrap
375 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
376 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
377
378 #.  Actually EAGAIN on Linux
379 #. type: Plain text
380 #: build/C/man2/accept.2:223
381 msgid ""
382 "The socket is marked nonblocking and no connections are present to be "
383 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
384 "and does not require these constants to have the same value, so a portable "
385 "application should check for both possibilities."
386 msgstr ""
387 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
388 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
389 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
390 "ションでは、両方の可能性を 確認すべきである。"
391
392 #. type: TP
393 #: build/C/man2/accept.2:223 build/C/man2/bind.2:165
394 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
395 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
396 #: build/C/man2/recv.2:407 build/C/man2/select.2:307 build/C/man2/send.2:304
397 #: build/C/man3/sockatmark.3:57
398 #, no-wrap
399 msgid "B<EBADF>"
400 msgstr "B<EBADF>"
401
402 #. type: Plain text
403 #: build/C/man2/accept.2:226
404 msgid "The descriptor is invalid."
405 msgstr "ディスクリプタが不正。"
406
407 #. type: TP
408 #: build/C/man2/accept.2:226
409 #, no-wrap
410 msgid "B<ECONNABORTED>"
411 msgstr "B<ECONNABORTED>"
412
413 #. type: Plain text
414 #: build/C/man2/accept.2:229
415 msgid "A connection has been aborted."
416 msgstr "接続が中止された。"
417
418 #. type: TP
419 #: build/C/man2/accept.2:229 build/C/man2/bind.2:191
420 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
421 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:416
422 #: build/C/man2/send.2:313 build/C/man2/socketpair.2:78
423 #, no-wrap
424 msgid "B<EFAULT>"
425 msgstr "B<EFAULT>"
426
427 #. type: Plain text
428 #: build/C/man2/accept.2:234
429 msgid ""
430 "The I<addr> argument is not in a writable part of the user address space."
431 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
432
433 #. type: TP
434 #: build/C/man2/accept.2:234 build/C/man2/connect.2:203
435 #: build/C/man2/recv.2:420 build/C/man2/select.2:312 build/C/man2/send.2:316
436 #, no-wrap
437 msgid "B<EINTR>"
438 msgstr "B<EINTR>"
439
440 #. type: Plain text
441 #: build/C/man2/accept.2:239
442 msgid ""
443 "The system call was interrupted by a signal that was caught before a valid "
444 "connection arrived; see B<signal>(7)."
445 msgstr ""
446 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
447 "た。 B<signal>(7)  参照。"
448
449 #. type: TP
450 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:169
451 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
452 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:425
453 #: build/C/man2/recvmmsg.2:161 build/C/man2/select.2:316
454 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:61
455 #: build/C/man2/socket.2:327 build/C/man2/socket.2:330
456 #, no-wrap
457 msgid "B<EINVAL>"
458 msgstr "B<EINVAL>"
459
460 #. type: Plain text
461 #: build/C/man2/accept.2:244
462 msgid ""
463 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
464 "negative)."
465 msgstr ""
466 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
467 "負の場合など)。"
468
469 #. type: Plain text
470 #: build/C/man2/accept.2:249
471 msgid "(B<accept4>())  invalid value in I<flags>."
472 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
473
474 #. type: TP
475 #: build/C/man2/accept.2:249 build/C/man2/socket.2:335
476 #: build/C/man2/socketpair.2:83
477 #, no-wrap
478 msgid "B<EMFILE>"
479 msgstr "B<EMFILE>"
480
481 #. type: Plain text
482 #: build/C/man2/accept.2:252
483 msgid "The per-process limit of open file descriptors has been reached."
484 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
485
486 #. type: TP
487 #: build/C/man2/accept.2:252 build/C/man2/socket.2:338
488 #: build/C/man2/socketpair.2:86
489 #, no-wrap
490 msgid "B<ENFILE>"
491 msgstr "B<ENFILE>"
492
493 #. type: Plain text
494 #: build/C/man2/accept.2:255 build/C/man2/socket.2:341
495 #: build/C/man2/socketpair.2:89
496 msgid "The system limit on the total number of open files has been reached."
497 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
498
499 #. type: TP
500 #: build/C/man2/accept.2:255
501 #, no-wrap
502 msgid "B<ENOBUFS>, B<ENOMEM>"
503 msgstr "B<ENOBUFS>, B<ENOMEM>"
504
505 #. type: Plain text
506 #: build/C/man2/accept.2:260
507 msgid ""
508 "Not enough free memory.  This often means that the memory allocation is "
509 "limited by the socket buffer limits, not by the system memory."
510 msgstr ""
511 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
512 "ケットバッファの大きさによるメモリ割り当ての制限である。"
513
514 #. type: TP
515 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
516 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
517 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
518 #: build/C/man2/recv.2:440 build/C/man2/send.2:349
519 #, no-wrap
520 msgid "B<ENOTSOCK>"
521 msgstr "B<ENOTSOCK>"
522
523 #. type: Plain text
524 #: build/C/man2/accept.2:263
525 msgid "The descriptor references a file, not a socket."
526 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
527
528 #. type: TP
529 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
530 #: build/C/man2/socketpair.2:89
531 #, no-wrap
532 msgid "B<EOPNOTSUPP>"
533 msgstr "B<EOPNOTSUPP>"
534
535 #. type: Plain text
536 #: build/C/man2/accept.2:267
537 msgid "The referenced socket is not of type B<SOCK_STREAM>."
538 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
539
540 #. type: TP
541 #: build/C/man2/accept.2:267
542 #, no-wrap
543 msgid "B<EPROTO>"
544 msgstr "B<EPROTO>"
545
546 #. type: Plain text
547 #: build/C/man2/accept.2:270
548 msgid "Protocol error."
549 msgstr "プロトコル・エラー。"
550
551 #. type: Plain text
552 #: build/C/man2/accept.2:274
553 msgid "In addition, Linux B<accept>()  may fail if:"
554 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
555
556 #. type: TP
557 #: build/C/man2/accept.2:274
558 #, no-wrap
559 msgid "B<EPERM>"
560 msgstr "B<EPERM>"
561
562 #. type: Plain text
563 #: build/C/man2/accept.2:277
564 msgid "Firewall rules forbid connection."
565 msgstr "ファイアウォールのルールにより接続が禁止された。"
566
567 #. type: Plain text
568 #: build/C/man2/accept.2:289
569 msgid ""
570 "In addition, network errors for the new socket and as defined for the "
571 "protocol may be returned.  Various Linux kernels can return other errors "
572 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
573 "value B<ERESTARTSYS> may be seen during a trace."
574 msgstr ""
575 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
576 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
577 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
578 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
579 "ともある。"
580
581 #. type: SH
582 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
583 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:165
584 #: build/C/man2/select.2:325 build/C/man2/sendmmsg.2:145
585 #: build/C/man3/sockatmark.3:68 build/C/man7/socket.7:802
586 #, no-wrap
587 msgid "VERSIONS"
588 msgstr "バージョン"
589
590 #. type: Plain text
591 #: build/C/man2/accept.2:294
592 msgid ""
593 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
594 "support in glibc is available starting with version 2.10."
595 msgstr ""
596 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
597 "サポートはバージョン 2.10 以降で利用可能である。"
598
599 #. type: SH
600 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
601 #: build/C/man3/bindresvport.3:92 build/C/man2/connect.2:225
602 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
603 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
604 #: build/C/man3/if_nametoindex.3:85 build/C/man2/listen.2:106
605 #: build/C/man2/recv.2:445 build/C/man2/recvmmsg.2:170
606 #: build/C/man2/select.2:331 build/C/man2/send.2:368
607 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:71
608 #: build/C/man2/socket.2:352 build/C/man2/socketcall.2:42
609 #: build/C/man2/socketpair.2:95
610 #, no-wrap
611 msgid "CONFORMING TO"
612 msgstr "準拠"
613
614 #.  The BSD man page documents five possible error returns
615 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
616 #.  POSIX.1-2001 documents errors
617 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
618 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
619 #.  In addition, SUSv2 documents EFAULT and ENOSR.
620 #. type: Plain text
621 #: build/C/man2/accept.2:306
622 msgid ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
624 "4.2BSD)."
625 msgstr ""
626 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
627 "された)."
628
629 #. type: Plain text
630 #: build/C/man2/accept.2:309
631 msgid "B<accept4>()  is a nonstandard Linux extension."
632 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
633
634 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
635 #.  do not inherit file status flags -- MTK Jun 05
636 #. type: Plain text
637 #: build/C/man2/accept.2:324
638 msgid ""
639 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
640 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
641 "socket.  This behavior differs from the canonical BSD sockets "
642 "implementation.  Portable programs should not rely on inheritance or "
643 "noninheritance of file status flags and always explicitly set all required "
644 "flags on the socket returned from B<accept>()."
645 msgstr ""
646 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
647 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
648 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
649 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
650 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
651 "である。"
652
653 #. type: SH
654 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
655 #: build/C/man3/bindresvport.3:95 build/C/man2/connect.2:241
656 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
657 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
658 #: build/C/man2/recv.2:455 build/C/man2/select.2:346
659 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
660 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:73
661 #: build/C/man2/socket.2:366 build/C/man7/socket.7:816
662 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
663 #, no-wrap
664 msgid "NOTES"
665 msgstr "注意"
666
667 #. type: Plain text
668 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
669 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
670 #: build/C/man2/listen.2:137 build/C/man2/socket.2:372
671 #: build/C/man2/socketpair.2:124
672 msgid ""
673 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
674 "this header file is not required on Linux.  However, some historical (BSD) "
675 "implementations required this header file, and portable applications are "
676 "probably wise to include it."
677 msgstr ""
678 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
679 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
680 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
681 "ションではこのファイルを インクルードするのが賢明であろう。"
682
683 #. type: Plain text
684 #: build/C/man2/accept.2:351
685 msgid ""
686 "There may not always be a connection waiting after a B<SIGIO> is delivered "
687 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
688 "connection might have been removed by an asynchronous network error or "
689 "another thread before B<accept>()  is called.  If this happens then the call "
690 "will block waiting for the next connection to arrive.  To ensure that "
691 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
692 "B<O_NONBLOCK> flag set (see B<socket>(7))."
693 msgstr ""
694 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
695 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
696 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
697 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
698 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
699 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
700 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
701 "見よ)。"
702
703 #. type: SS
704 #: build/C/man2/accept.2:351
705 #, no-wrap
706 msgid "The socklen_t type"
707 msgstr "socklen_t 型"
708
709 #. type: Plain text
710 #: build/C/man2/accept.2:361
711 msgid ""
712 "The third argument of B<accept>()  was originally declared as an I<int *> "
713 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
714 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
715 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
716 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
717 "Torvalds:"
718 msgstr ""
719 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
720 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
721 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
722 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
723 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
724 "た。 Linus Torvald の発言を引用する:"
725
726 #.  .I fails: only italicizes a single line
727 #. type: Plain text
728 #: build/C/man2/accept.2:378
729 msgid ""
730 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
731 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
732 "make it a size_t, and I (and hopefully others, but obviously not too many) "
733 "complained to them very loudly indeed.  Making it a size_t is completely "
734 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
735 "bit architectures, for example.  And it I<has> to be the same size as \"int"
736 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
737 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
738 "have touched it in the first place, but once they did they felt it had to "
739 "have a named type for some unfathomable reason (probably somebody didn't "
740 "like losing face over having done the original stupid thing, so they "
741 "silently just renamed their blunder).\""
742 msgstr ""
743 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
744 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
745 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
746 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
747 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
748 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
749 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
750 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
751 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
752 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
753 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
754 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
755 "う)。」"
756
757 #. type: SH
758 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
759 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
760 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
761 #: build/C/man2/recv.2:490 build/C/man2/recvmmsg.2:173
762 #: build/C/man2/select.2:537 build/C/man2/select_tut.2:529
763 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
764 #: build/C/man3/sockatmark.3:97 build/C/man2/socket.2:385
765 #, no-wrap
766 msgid "EXAMPLE"
767 msgstr "例"
768
769 #. type: Plain text
770 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
771 msgid "See B<bind>(2)."
772 msgstr "B<bind>(2)  参照。"
773
774 #. type: SH
775 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
776 #: build/C/man3/bindresvport.3:101 build/C/man2/connect.2:263
777 #: build/C/man3/getifaddrs.3:290 build/C/man2/getsockname.2:112
778 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:146
779 #: build/C/man3/if_nametoindex.3:89 build/C/man2/listen.2:169
780 #: build/C/man2/recv.2:495 build/C/man2/recvmmsg.2:268
781 #: build/C/man2/select.2:574 build/C/man2/select_tut.2:819
782 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
783 #: build/C/man3/sockatmark.3:132 build/C/man2/socket.2:390
784 #: build/C/man7/socket.7:847 build/C/man2/socketcall.2:53
785 #: build/C/man2/socketpair.2:124
786 #, no-wrap
787 msgid "SEE ALSO"
788 msgstr "関連項目"
789
790 #. type: Plain text
791 #: build/C/man2/accept.2:388
792 msgid ""
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<socket>(7)"
795 msgstr ""
796 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
797 "B<socket>(7)"
798
799 #. type: SH
800 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
801 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:270
802 #: build/C/man3/getifaddrs.3:296 build/C/man2/getsockname.2:119
803 #: build/C/man2/getsockopt.2:210 build/C/man3/if_nameindex.3:153
804 #: build/C/man3/if_nametoindex.3:93 build/C/man2/listen.2:175
805 #: build/C/man2/recv.2:506 build/C/man2/recvmmsg.2:275
806 #: build/C/man2/select.2:588 build/C/man2/select_tut.2:838
807 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
808 #: build/C/man3/sockatmark.3:137 build/C/man2/socket.2:419
809 #: build/C/man7/socket.7:859 build/C/man2/socketcall.2:71
810 #: build/C/man2/socketpair.2:131
811 #, no-wrap
812 msgid "COLOPHON"
813 msgstr "この文書について"
814
815 #. type: Plain text
816 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
817 #: build/C/man3/bindresvport.3:111 build/C/man2/connect.2:277
818 #: build/C/man3/getifaddrs.3:303 build/C/man2/getsockname.2:126
819 #: build/C/man2/getsockopt.2:217 build/C/man3/if_nameindex.3:160
820 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:182
821 #: build/C/man2/recv.2:513 build/C/man2/recvmmsg.2:282
822 #: build/C/man2/select.2:595 build/C/man2/select_tut.2:845
823 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
824 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:426
825 #: build/C/man7/socket.7:866 build/C/man2/socketcall.2:78
826 #: build/C/man2/socketpair.2:138
827 #, fuzzy
828 #| msgid ""
829 #| "This page is part of release 3.41 of the Linux I<man-pages> project.  A "
830 #| "description of the project, and information about reporting bugs, can be "
831 #| "found at http://www.kernel.org/doc/man-pages/."
832 msgid ""
833 "This page is part of release 3.50 of the Linux I<man-pages> project.  A "
834 "description of the project, and information about reporting bugs, can be "
835 "found at http://www.kernel.org/doc/man-pages/."
836 msgstr ""
837 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.41 の一部\n"
838 "である。プロジェクトの説明とバグ報告に関する情報は\n"
839 "http://www.kernel.org/doc/man-pages/ に書かれている。"
840
841 #. type: TH
842 #: build/C/man2/bind.2:68
843 #, no-wrap
844 msgid "BIND"
845 msgstr "BIND"
846
847 #. type: TH
848 #: build/C/man2/bind.2:68
849 #, no-wrap
850 msgid "2007-12-28"
851 msgstr "2007-12-28"
852
853 #. type: Plain text
854 #: build/C/man2/bind.2:71
855 msgid "bind - bind a name to a socket"
856 msgstr "bind - ソケットに名前をつける"
857
858 #. type: Plain text
859 #: build/C/man2/bind.2:78
860 #, no-wrap
861 msgid ""
862 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
863 "B<         socklen_t >I<addrlen>B<);>\n"
864 msgstr ""
865 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
866 "B<         socklen_t >I<addrlen>B<);>\n"
867
868 #. type: Plain text
869 #: build/C/man2/bind.2:92
870 msgid ""
871 "When a socket is created with B<socket>(2), it exists in a name space "
872 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
873 "address specified by I<addr> to the socket referred to by the file "
874 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
875 "address structure pointed to by I<addr>.  Traditionally, this operation is "
876 "called \\(lqassigning a name to a socket\\(rq."
877 msgstr ""
878 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
879 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
880 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
881 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
882 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
883 "る。"
884
885 #. type: Plain text
886 #: build/C/man2/bind.2:99
887 msgid ""
888 "It is normally necessary to assign a local address using B<bind>()  before a "
889 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
890 msgstr ""
891 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
892 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
893 "る。"
894
895 #. type: Plain text
896 #: build/C/man2/bind.2:130
897 msgid ""
898 "The rules used in name binding vary between address families.  Consult the "
899 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
900 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
901 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
902 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
903 msgstr ""
904 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
905 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
906 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
907 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
908 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
909
910 #. type: Plain text
911 #: build/C/man2/bind.2:137
912 msgid ""
913 "The actual structure passed for the I<addr> argument will depend on the "
914 "address family.  The I<sockaddr> structure is defined as something like:"
915 msgstr ""
916 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
917 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
918
919 #. type: Plain text
920 #: build/C/man2/bind.2:144
921 #, no-wrap
922 msgid ""
923 "struct sockaddr {\n"
924 "    sa_family_t sa_family;\n"
925 "    char        sa_data[14];\n"
926 "}\n"
927 msgstr ""
928 "struct sockaddr {\n"
929 "    sa_family_t sa_family;\n"
930 "    char        sa_data[14];\n"
931 "}\n"
932
933 #. type: Plain text
934 #: build/C/man2/bind.2:152
935 msgid ""
936 "The only purpose of this structure is to cast the structure pointer passed "
937 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
938 msgstr ""
939 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
940 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
941
942 #. type: Plain text
943 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
944 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
945 #: build/C/man2/socketpair.2:74
946 msgid ""
947 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
948 "appropriately."
949 msgstr ""
950 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
951 "設定される。"
952
953 #. type: TP
954 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
955 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
956 #: build/C/man2/send.2:285 build/C/man2/socket.2:320
957 #, no-wrap
958 msgid "B<EACCES>"
959 msgstr "B<EACCES>"
960
961 #.  e.g., privileged port in AF_INET domain
962 #. type: Plain text
963 #: build/C/man2/bind.2:162
964 msgid "The address is protected, and the user is not the superuser."
965 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
966
967 #. type: TP
968 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
969 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
970 #, no-wrap
971 msgid "B<EADDRINUSE>"
972 msgstr "B<EADDRINUSE>"
973
974 #. type: Plain text
975 #: build/C/man2/bind.2:165
976 msgid "The given address is already in use."
977 msgstr "指定されたアドレスが既に使用中である。"
978
979 #. type: Plain text
980 #: build/C/man2/bind.2:169
981 msgid "I<sockfd> is not a valid descriptor."
982 msgstr "I<sockfd> が不正なディスクリプタである。"
983
984 #.  This may change in the future: see
985 #.  .I linux/unix/sock.c for details.
986 #. type: Plain text
987 #: build/C/man2/bind.2:174
988 msgid "The socket is already bound to an address."
989 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
990
991 #. type: Plain text
992 #: build/C/man2/bind.2:178
993 msgid "I<sockfd> is a descriptor for a file, not a socket."
994 msgstr ""
995 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
996
997 #. type: Plain text
998 #: build/C/man2/bind.2:182
999 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1000 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1001
1002 #. type: Plain text
1003 #: build/C/man2/bind.2:187
1004 msgid ""
1005 "Search permission is denied on a component of the path prefix.  (See also "
1006 "B<path_resolution>(7).)"
1007 msgstr ""
1008 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1009 "(7)  も参照すること)。"
1010
1011 #. type: TP
1012 #: build/C/man2/bind.2:187
1013 #, no-wrap
1014 msgid "B<EADDRNOTAVAIL>"
1015 msgstr "B<EADDRNOTAVAIL>"
1016
1017 #. type: Plain text
1018 #: build/C/man2/bind.2:191
1019 msgid ""
1020 "A nonexistent interface was requested or the requested address was not local."
1021 msgstr ""
1022 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1023 "かった。"
1024
1025 #. type: Plain text
1026 #: build/C/man2/bind.2:195
1027 msgid "I<addr> points outside the user's accessible address space."
1028 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1029
1030 #. type: Plain text
1031 #: build/C/man2/bind.2:202
1032 msgid ""
1033 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1034 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1035
1036 #. type: TP
1037 #: build/C/man2/bind.2:202
1038 #, no-wrap
1039 msgid "B<ELOOP>"
1040 msgstr "B<ELOOP>"
1041
1042 #. type: Plain text
1043 #: build/C/man2/bind.2:206
1044 msgid "Too many symbolic links were encountered in resolving I<addr>."
1045 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1046
1047 #. type: TP
1048 #: build/C/man2/bind.2:206
1049 #, no-wrap
1050 msgid "B<ENAMETOOLONG>"
1051 msgstr "B<ENAMETOOLONG>"
1052
1053 #. type: Plain text
1054 #: build/C/man2/bind.2:210
1055 msgid "I<addr> is too long."
1056 msgstr "I<addr> が長過ぎる。"
1057
1058 #. type: TP
1059 #: build/C/man2/bind.2:210
1060 #, no-wrap
1061 msgid "B<ENOENT>"
1062 msgstr "B<ENOENT>"
1063
1064 #. type: Plain text
1065 #: build/C/man2/bind.2:213
1066 msgid "The file does not exist."
1067 msgstr "ファイルが存在しない。"
1068
1069 #. type: TP
1070 #: build/C/man2/bind.2:213 build/C/man2/recv.2:429 build/C/man2/select.2:322
1071 #: build/C/man2/send.2:343
1072 #, no-wrap
1073 msgid "B<ENOMEM>"
1074 msgstr "B<ENOMEM>"
1075
1076 #. type: Plain text
1077 #: build/C/man2/bind.2:216
1078 msgid "Insufficient kernel memory was available."
1079 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1080
1081 #. type: TP
1082 #: build/C/man2/bind.2:216
1083 #, no-wrap
1084 msgid "B<ENOTDIR>"
1085 msgstr "B<ENOTDIR>"
1086
1087 #. type: Plain text
1088 #: build/C/man2/bind.2:219
1089 msgid "A component of the path prefix is not a directory."
1090 msgstr "パス名の構成要素がディレクトリではない。"
1091
1092 #. type: TP
1093 #: build/C/man2/bind.2:219
1094 #, no-wrap
1095 msgid "B<EROFS>"
1096 msgstr "B<EROFS>"
1097
1098 #. type: Plain text
1099 #: build/C/man2/bind.2:222
1100 msgid "The socket inode would reside on a read-only file system."
1101 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1102
1103 #.  SVr4 documents an additional
1104 #.  .B ENOSR
1105 #.  general error condition, and
1106 #.  additional
1107 #.  .B EIO
1108 #.  and
1109 #.  .B EISDIR
1110 #.  UNIX-domain error conditions.
1111 #. type: Plain text
1112 #: build/C/man2/bind.2:234
1113 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1114 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1115
1116 #. type: Plain text
1117 #: build/C/man2/bind.2:251
1118 msgid ""
1119 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1120 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1121 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1122 msgstr ""
1123 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1124 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1125 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1126
1127 #. type: SH
1128 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1129 #: build/C/man2/select.2:474 build/C/man2/send.2:414
1130 #: build/C/man3/sockatmark.3:93 build/C/man7/socket.7:834
1131 #, no-wrap
1132 msgid "BUGS"
1133 msgstr "バグ"
1134
1135 #.  FIXME What *are* transparent proxy options?
1136 #. type: Plain text
1137 #: build/C/man2/bind.2:254
1138 msgid "The transparent proxy options are not described."
1139 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1140
1141 #. type: Plain text
1142 #: build/C/man2/bind.2:259
1143 msgid ""
1144 "An example of the use of B<bind>()  with Internet domain sockets can be "
1145 "found in B<getaddrinfo>(3)."
1146 msgstr ""
1147 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1148 "(3)  に記載されている。"
1149
1150 #.  listen.7 refers to this example.
1151 #.  accept.7 refers to this example.
1152 #.  unix.7 refers to this example.
1153 #. type: Plain text
1154 #: build/C/man2/bind.2:266
1155 msgid ""
1156 "The following example shows how to bind a stream socket in the UNIX "
1157 "(B<AF_UNIX>)  domain, and accept connections:"
1158 msgstr ""
1159 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1160 "を示したものである。"
1161
1162 #. type: Plain text
1163 #: build/C/man2/bind.2:273
1164 #, no-wrap
1165 msgid ""
1166 "#include E<lt>sys/socket.hE<gt>\n"
1167 "#include E<lt>sys/un.hE<gt>\n"
1168 "#include E<lt>stdlib.hE<gt>\n"
1169 "#include E<lt>stdio.hE<gt>\n"
1170 "#include E<lt>string.hE<gt>\n"
1171 msgstr ""
1172 "#include E<lt>sys/socket.hE<gt>\n"
1173 "#include E<lt>sys/un.hE<gt>\n"
1174 "#include E<lt>stdlib.hE<gt>\n"
1175 "#include E<lt>stdio.hE<gt>\n"
1176 "#include E<lt>string.hE<gt>\n"
1177
1178 #. type: Plain text
1179 #: build/C/man2/bind.2:276
1180 #, no-wrap
1181 msgid ""
1182 "#define MY_SOCK_PATH \"/somepath\"\n"
1183 "#define LISTEN_BACKLOG 50\n"
1184 msgstr ""
1185 "#define MY_SOCK_PATH \"/somepath\"\n"
1186 "#define LISTEN_BACKLOG 50\n"
1187
1188 #. type: Plain text
1189 #: build/C/man2/bind.2:279
1190 #, no-wrap
1191 msgid ""
1192 "#define handle_error(msg) \\e\n"
1193 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1194 msgstr ""
1195 "#define handle_error(msg) \\e\n"
1196 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1197
1198 #. type: Plain text
1199 #: build/C/man2/bind.2:286
1200 #, no-wrap
1201 msgid ""
1202 "int\n"
1203 "main(int argc, char *argv[])\n"
1204 "{\n"
1205 "    int sfd, cfd;\n"
1206 "    struct sockaddr_un my_addr, peer_addr;\n"
1207 "    socklen_t peer_addr_size;\n"
1208 msgstr ""
1209 "int\n"
1210 "main(int argc, char *argv[])\n"
1211 "{\n"
1212 "    int sfd, cfd;\n"
1213 "    struct sockaddr_un my_addr, peer_addr;\n"
1214 "    socklen_t peer_addr_size;\n"
1215
1216 #. type: Plain text
1217 #: build/C/man2/bind.2:290
1218 #, no-wrap
1219 msgid ""
1220 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1221 "    if (sfd == -1)\n"
1222 "        handle_error(\"socket\");\n"
1223 msgstr ""
1224 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1225 "    if (sfd == -1)\n"
1226 "        handle_error(\"socket\");\n"
1227
1228 #. type: Plain text
1229 #: build/C/man2/bind.2:296
1230 #, no-wrap
1231 msgid ""
1232 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1233 "                        /* Clear structure */\n"
1234 "    my_addr.sun_family = AF_UNIX;\n"
1235 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1236 "            sizeof(my_addr.sun_path) - 1);\n"
1237 msgstr ""
1238 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1239 "                        /* Clear structure */\n"
1240 "    my_addr.sun_family = AF_UNIX;\n"
1241 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1242 "            sizeof(my_addr.sun_path) - 1);\n"
1243
1244 #. type: Plain text
1245 #: build/C/man2/bind.2:300
1246 #, no-wrap
1247 msgid ""
1248 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1249 "            sizeof(struct sockaddr_un)) == -1)\n"
1250 "        handle_error(\"bind\");\n"
1251 msgstr ""
1252 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1253 "            sizeof(struct sockaddr_un)) == -1)\n"
1254 "        handle_error(\"bind\");\n"
1255
1256 #. type: Plain text
1257 #: build/C/man2/bind.2:303
1258 #, no-wrap
1259 msgid ""
1260 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1261 "        handle_error(\"listen\");\n"
1262 msgstr ""
1263 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1264 "        handle_error(\"listen\");\n"
1265
1266 #. type: Plain text
1267 #: build/C/man2/bind.2:306
1268 #, no-wrap
1269 msgid ""
1270 "    /* Now we can accept incoming connections one\n"
1271 "       at a time using accept(2) */\n"
1272 msgstr ""
1273 "    /* Now we can accept incoming connections one\n"
1274 "       at a time using accept(2) */\n"
1275
1276 #. type: Plain text
1277 #: build/C/man2/bind.2:312
1278 #, no-wrap
1279 msgid ""
1280 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1281 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1282 "                 &peer_addr_size);\n"
1283 "    if (cfd == -1)\n"
1284 "        handle_error(\"accept\");\n"
1285 msgstr ""
1286 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1287 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1288 "                 &peer_addr_size)\n"
1289 "    if (cfd == -1)\n"
1290 "        handle_error(\"accept\");\n"
1291
1292 #. type: Plain text
1293 #: build/C/man2/bind.2:314
1294 #, no-wrap
1295 msgid "    /* Code to deal with incoming connection(s)... */\n"
1296 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1297
1298 #. type: Plain text
1299 #: build/C/man2/bind.2:318
1300 #, no-wrap
1301 msgid ""
1302 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1303 "       should be deleted using unlink(2) or remove(3) */\n"
1304 "}\n"
1305 msgstr ""
1306 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1307 "       should be deleted using unlink(2) or remove(3) */\n"
1308 "}\n"
1309
1310 #. type: Plain text
1311 #: build/C/man2/bind.2:332
1312 msgid ""
1313 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1314 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1315 "(7), B<socket>(7), B<unix>(7)"
1316 msgstr ""
1317 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1318 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1319 "(7), B<socket>(7), B<unix>(7)"
1320
1321 #. type: TH
1322 #: build/C/man3/bindresvport.3:30
1323 #, no-wrap
1324 msgid "BINDRESVPORT"
1325 msgstr "BINDRESVPORT"
1326
1327 #. type: TH
1328 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
1329 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
1330 #: build/C/man3/sockatmark.3:25
1331 #, no-wrap
1332 msgid "2008-12-03"
1333 msgstr "2008-12-03"
1334
1335 #. type: Plain text
1336 #: build/C/man3/bindresvport.3:33
1337 msgid "bindresvport - bind a socket to a privileged IP port"
1338 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1339
1340 #. type: Plain text
1341 #: build/C/man3/bindresvport.3:37
1342 #, no-wrap
1343 msgid ""
1344 "B<#include E<lt>sys/types.hE<gt>>\n"
1345 "B<#include E<lt>netinet/in.hE<gt>>\n"
1346 msgstr ""
1347 "B<#include E<lt>sys/types.hE<gt>>\n"
1348 "B<#include E<lt>netinet/in.hE<gt>>\n"
1349
1350 #. type: Plain text
1351 #: build/C/man3/bindresvport.3:39
1352 #, no-wrap
1353 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1354 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1355
1356 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1357 #. type: Plain text
1358 #: build/C/man3/bindresvport.3:46
1359 msgid ""
1360 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1361 "anonymous IP port, that is, a port number arbitrarily selected from the "
1362 "range 512 to 1023."
1363 msgstr ""
1364 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1365 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1366 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1367
1368 #. type: Plain text
1369 #: build/C/man3/bindresvport.3:56
1370 msgid ""
1371 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1372 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1373 "allocated."
1374 msgstr ""
1375 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1376 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1377 "される。"
1378
1379 #. type: Plain text
1380 #: build/C/man3/bindresvport.3:67
1381 msgid ""
1382 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1383 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1384 "return the port number actually allocated.  (This information can later be "
1385 "obtained using B<getsockname>(2).)"
1386 msgstr ""
1387 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1388 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1389 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1390 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1391
1392 #. type: Plain text
1393 #: build/C/man3/bindresvport.3:72
1394 msgid ""
1395 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1396 "I<errno> set to indicate the cause of the error."
1397 msgstr ""
1398 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1399 "I<errno> にエラーの原因を示す値を設定する。"
1400
1401 #. type: Plain text
1402 #: build/C/man3/bindresvport.3:77
1403 msgid ""
1404 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1405 "addition, the following errors may occur:"
1406 msgstr ""
1407 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1408 "以下のエラーが発生することがある:"
1409
1410 #. type: Plain text
1411 #: build/C/man3/bindresvport.3:82
1412 msgid ""
1413 "The caller did not have superuser privilege (to be precise: the "
1414 "B<CAP_NET_BIND_SERVICE> capability is required)."
1415 msgstr ""
1416 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1417 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1418
1419 #. type: Plain text
1420 #: build/C/man3/bindresvport.3:85
1421 msgid "All privileged ports are in use."
1422 msgstr "全ての特権ポートが使用中である。"
1423
1424 #. type: TP
1425 #: build/C/man3/bindresvport.3:85
1426 #, no-wrap
1427 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1428 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1429
1430 #. type: Plain text
1431 #: build/C/man3/bindresvport.3:92
1432 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1433 msgstr ""
1434 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1435
1436 #. type: Plain text
1437 #: build/C/man3/bindresvport.3:95
1438 msgid ""
1439 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1440 msgstr ""
1441 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1442
1443 #. type: Plain text
1444 #: build/C/man3/bindresvport.3:101
1445 msgid ""
1446 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1447 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1448 msgstr ""
1449 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1450 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1451
1452 #. type: Plain text
1453 #: build/C/man3/bindresvport.3:104
1454 msgid "B<bind>(2), B<getsockname>(2)"
1455 msgstr "B<bind>(2), B<getsockname>(2)"
1456
1457 #. type: TH
1458 #: build/C/man2/connect.2:67
1459 #, no-wrap
1460 msgid "CONNECT"
1461 msgstr "CONNECT"
1462
1463 #. type: Plain text
1464 #: build/C/man2/connect.2:70
1465 msgid "connect - initiate a connection on a socket"
1466 msgstr "connect - ソケットの接続を行う"
1467
1468 #. type: Plain text
1469 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1470 #: build/C/man2/listen.2:51
1471 #, no-wrap
1472 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1473 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1474
1475 #. type: Plain text
1476 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1477 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1478 #: build/C/man2/recv.2:51
1479 #, no-wrap
1480 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1481 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1482
1483 #. type: Plain text
1484 #: build/C/man2/connect.2:78
1485 #, no-wrap
1486 msgid ""
1487 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1488 "B<            socklen_t >I<addrlen>B<);>\n"
1489 msgstr ""
1490 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1491 "B<            socklen_t >I<addrlen>B<);>\n"
1492
1493 #. type: Plain text
1494 #: build/C/man2/connect.2:97
1495 msgid ""
1496 "The B<connect>()  system call connects the socket referred to by the file "
1497 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1498 "argument specifies the size of I<addr>.  The format of the address in "
1499 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1500 "B<socket>(2)  for further details."
1501 msgstr ""
1502 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1503 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1504 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1505 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1506 "こと。"
1507
1508 #. type: Plain text
1509 #: build/C/man2/connect.2:113
1510 msgid ""
1511 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1512 "to which datagrams are sent by default, and the only address from which "
1513 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1514 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1515 "that is bound to the address specified by I<addr>."
1516 msgstr ""
1517 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1518 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1519 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1520 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1521 "に対する接続の 作成を試みる。"
1522
1523 #. type: Plain text
1524 #: build/C/man2/connect.2:127
1525 msgid ""
1526 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1527 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1528 "times to change their association.  Connectionless sockets may dissolve the "
1529 "association by connecting to an address with the I<sa_family> member of "
1530 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1531 msgstr ""
1532 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1533 "()  が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1534 "度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1535 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1536 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1537
1538 #. type: Plain text
1539 #: build/C/man2/connect.2:132
1540 msgid ""
1541 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1542 "returned, and I<errno> is set appropriately."
1543 msgstr ""
1544 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1545 "適切な値を設定する。"
1546
1547 #. type: Plain text
1548 #: build/C/man2/connect.2:135
1549 msgid ""
1550 "The following are general socket errors only.  There may be other domain-"
1551 "specific error codes."
1552 msgstr ""
1553 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1554 "する可能性がある。"
1555
1556 #. type: Plain text
1557 #: build/C/man2/connect.2:143
1558 msgid ""
1559 "For UNIX domain sockets, which are identified by pathname: Write permission "
1560 "is denied on the socket file, or search permission is denied for one of the "
1561 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1562 msgstr ""
1563 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1564 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1565 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1566
1567 #. type: TP
1568 #: build/C/man2/connect.2:143
1569 #, no-wrap
1570 msgid "B<EACCES>, B<EPERM>"
1571 msgstr "B<EACCES>, B<EPERM>"
1572
1573 #. type: Plain text
1574 #: build/C/man2/connect.2:148
1575 msgid ""
1576 "The user tried to connect to a broadcast address without having the socket "
1577 "broadcast flag enabled or the connection request failed because of a local "
1578 "firewall rule."
1579 msgstr ""
1580 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1581 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1582 "要求が失敗した。"
1583
1584 #. type: Plain text
1585 #: build/C/man2/connect.2:151
1586 msgid "Local address is already in use."
1587 msgstr "ローカルアドレスが既に使用されている。"
1588
1589 #. type: TP
1590 #: build/C/man2/connect.2:151 build/C/man2/socket.2:324
1591 #: build/C/man2/socketpair.2:75
1592 #, no-wrap
1593 msgid "B<EAFNOSUPPORT>"
1594 msgstr "B<EAFNOSUPPORT>"
1595
1596 #. type: Plain text
1597 #: build/C/man2/connect.2:156
1598 msgid ""
1599 "The passed address didn't have the correct address family in its "
1600 "I<sa_family> field."
1601 msgstr ""
1602 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1603 "い。"
1604
1605 #. type: TP
1606 #: build/C/man2/connect.2:156
1607 #, no-wrap
1608 msgid "B<EAGAIN>"
1609 msgstr "B<EAGAIN>"
1610
1611 #. type: Plain text
1612 #: build/C/man2/connect.2:165
1613 msgid ""
1614 "No more free local ports or insufficient entries in the routing cache.  For "
1615 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1616 "B<ip>(7)  for information on how to increase the number of local ports."
1617 msgstr ""
1618 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1619 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1620 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1621
1622 #. type: TP
1623 #: build/C/man2/connect.2:165
1624 #, no-wrap
1625 msgid "B<EALREADY>"
1626 msgstr "B<EALREADY>"
1627
1628 #. type: Plain text
1629 #: build/C/man2/connect.2:169
1630 msgid ""
1631 "The socket is nonblocking and a previous connection attempt has not yet been "
1632 "completed."
1633 msgstr ""
1634 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1635
1636 #. type: Plain text
1637 #: build/C/man2/connect.2:172
1638 msgid "The file descriptor is not a valid index in the descriptor table."
1639 msgstr ""
1640 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1641 "い。"
1642
1643 #. type: TP
1644 #: build/C/man2/connect.2:172 build/C/man2/recv.2:412
1645 #, no-wrap
1646 msgid "B<ECONNREFUSED>"
1647 msgstr "B<ECONNREFUSED>"
1648
1649 #. type: Plain text
1650 #: build/C/man2/connect.2:175
1651 msgid "No-one listening on the remote address."
1652 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1653
1654 #. type: Plain text
1655 #: build/C/man2/connect.2:178
1656 msgid "The socket structure address is outside the user's address space."
1657 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1658
1659 #. type: TP
1660 #: build/C/man2/connect.2:178
1661 #, no-wrap
1662 msgid "B<EINPROGRESS>"
1663 msgstr "B<EINPROGRESS>"
1664
1665 #. type: Plain text
1666 #: build/C/man2/connect.2:203
1667 msgid ""
1668 "The socket is nonblocking and the connection cannot be completed "
1669 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1670 "by selecting the socket for writing.  After B<select>(2)  indicates "
1671 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1672 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1673 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1674 "error codes listed here, explaining the reason for the failure)."
1675 msgstr ""
1676 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1677 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1678 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1679 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1680 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1681 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1682 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1683 "の原因が分かる。"
1684
1685 #.  For TCP, the connection will complete asynchronously.
1686 #.  See http://lkml.org/lkml/2005/7/12/254
1687 #. type: Plain text
1688 #: build/C/man2/connect.2:209
1689 msgid ""
1690 "The system call was interrupted by a signal that was caught; see B<signal>"
1691 "(7)."
1692 msgstr ""
1693 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1694
1695 #. type: TP
1696 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1697 #, no-wrap
1698 msgid "B<EISCONN>"
1699 msgstr "B<EISCONN>"
1700
1701 #. type: Plain text
1702 #: build/C/man2/connect.2:212
1703 msgid "The socket is already connected."
1704 msgstr "ソケットは既に接続 (connect) されている。"
1705
1706 #. type: TP
1707 #: build/C/man2/connect.2:212
1708 #, no-wrap
1709 msgid "B<ENETUNREACH>"
1710 msgstr "B<ENETUNREACH>"
1711
1712 #. type: Plain text
1713 #: build/C/man2/connect.2:215
1714 msgid "Network is unreachable."
1715 msgstr "到達できないネットワークである。"
1716
1717 #. type: Plain text
1718 #: build/C/man2/connect.2:218
1719 msgid "The file descriptor is not associated with a socket."
1720 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1721
1722 #. type: TP
1723 #: build/C/man2/connect.2:218
1724 #, no-wrap
1725 msgid "B<ETIMEDOUT>"
1726 msgstr "B<ETIMEDOUT>"
1727
1728 #. type: Plain text
1729 #: build/C/man2/connect.2:225
1730 msgid ""
1731 "Timeout while attempting connection.  The server may be too busy to accept "
1732 "new connections.  Note that for IP sockets the timeout may be very long when "
1733 "syncookies are enabled on the server."
1734 msgstr ""
1735 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1736 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1737 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1738 "ること。"
1739
1740 #.  SVr4 documents the additional
1741 #.  general error codes
1742 #.  .BR EADDRNOTAVAIL ,
1743 #.  .BR EINVAL ,
1744 #.  .BR EAFNOSUPPORT ,
1745 #.  .BR EALREADY ,
1746 #.  .BR EINTR ,
1747 #.  .BR EPROTOTYPE ,
1748 #.  and
1749 #.  .BR ENOSR .
1750 #.  It also
1751 #.  documents many additional error conditions not described here.
1752 #. type: Plain text
1753 #: build/C/man2/connect.2:241
1754 msgid ""
1755 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1756 "POSIX.1-2001."
1757 msgstr ""
1758 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1759
1760 #. type: Plain text
1761 #: build/C/man2/connect.2:258
1762 msgid ""
1763 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1764 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1765 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1766 msgstr ""
1767 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1768 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1769 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1770
1771 #. type: Plain text
1772 #: build/C/man2/connect.2:263
1773 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1774 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1775
1776 #. type: Plain text
1777 #: build/C/man2/connect.2:270
1778 msgid ""
1779 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1780 "B<path_resolution>(7)"
1781 msgstr ""
1782 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1783 "B<path_resolution>(7)"
1784
1785 #. type: TH
1786 #: build/C/man3/getifaddrs.3:36
1787 #, no-wrap
1788 msgid "GETIFADDRS"
1789 msgstr "GETIFADDRS"
1790
1791 #. type: TH
1792 #: build/C/man3/getifaddrs.3:36
1793 #, fuzzy, no-wrap
1794 #| msgid "2011-10-01"
1795 msgid "2012-11-11"
1796 msgstr "2011-10-01"
1797
1798 #. type: TH
1799 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1800 #: build/C/man3/if_nametoindex.3:25
1801 #, no-wrap
1802 msgid "GNU"
1803 msgstr "GNU"
1804
1805 #. type: Plain text
1806 #: build/C/man3/getifaddrs.3:39
1807 msgid "getifaddrs, freeifaddrs - get interface addresses"
1808 msgstr ""
1809
1810 #. type: Plain text
1811 #: build/C/man3/getifaddrs.3:43
1812 #, no-wrap
1813 msgid ""
1814 "B<#include E<lt>sys/types.hE<gt>>\n"
1815 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1816 msgstr ""
1817 "B<#include E<lt>sys/types.hE<gt>>\n"
1818 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1819
1820 #. type: Plain text
1821 #: build/C/man3/getifaddrs.3:45
1822 #, no-wrap
1823 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1824 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1825
1826 #. type: Plain text
1827 #: build/C/man3/getifaddrs.3:47
1828 #, no-wrap
1829 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1830 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1831
1832 #. type: Plain text
1833 #: build/C/man3/getifaddrs.3:58
1834 msgid ""
1835 "The B<getifaddrs>()  function creates a linked list of structures describing "
1836 "the network interfaces of the local system, and stores the address of the "
1837 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1838 "structures, defined as follows:"
1839 msgstr ""
1840
1841 #. type: Plain text
1842 #: build/C/man3/getifaddrs.3:77
1843 #, no-wrap
1844 msgid ""
1845 "struct ifaddrs {\n"
1846 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1847 "    char            *ifa_name;    /* Name of interface */\n"
1848 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1849 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1850 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1851 "    union {\n"
1852 "        struct sockaddr *ifu_broadaddr;\n"
1853 "                         /* Broadcast address of interface */\n"
1854 "        struct sockaddr *ifu_dstaddr;\n"
1855 "                         /* Point-to-point destination address */\n"
1856 "    } ifa_ifu;\n"
1857 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1858 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1859 "    void            *ifa_data;    /* Address-specific data */\n"
1860 "};\n"
1861 msgstr ""
1862 "struct ifaddrs {\n"
1863 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1864 "    char            *ifa_name;    /* Name of interface */\n"
1865 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1866 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1867 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1868 "    union {\n"
1869 "        struct sockaddr *ifu_broadaddr;\n"
1870 "                         /* Broadcast address of interface */\n"
1871 "        struct sockaddr *ifu_dstaddr;\n"
1872 "                         /* Point-to-point destination address */\n"
1873 "    } ifa_ifu;\n"
1874 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1875 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1876 "    void            *ifa_data;    /* Address-specific data */\n"
1877 "};\n"
1878
1879 #. type: Plain text
1880 #: build/C/man3/getifaddrs.3:84
1881 msgid ""
1882 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1883 "or NULL if this is the last item of the list."
1884 msgstr ""
1885
1886 #.  The constant
1887 #.  .B IF NAMESIZE
1888 #.  indicates the maximum length of this field.
1889 #. type: Plain text
1890 #: build/C/man3/getifaddrs.3:91
1891 msgid "The I<ifa_name> points to the null-terminated interface name."
1892 msgstr ""
1893
1894 #. type: Plain text
1895 #: build/C/man3/getifaddrs.3:100
1896 msgid ""
1897 "The I<ifa_flags> field contains the interface flags, as returned by the "
1898 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1899 "these flags)."
1900 msgstr ""
1901
1902 #. type: Plain text
1903 #: build/C/man3/getifaddrs.3:109
1904 msgid ""
1905 "The I<ifa_addr> field points to a structure containing the interface "
1906 "address.  (The I<sa_family> subfield should be consulted to determine the "
1907 "format of the address structure.)  This field may contain a NULL pointer."
1908 msgstr ""
1909
1910 #. type: Plain text
1911 #: build/C/man3/getifaddrs.3:116
1912 msgid ""
1913 "The I<ifa_netmask> field points to a structure containing the netmask "
1914 "associated with I<ifa_addr>, if applicable for the address family.  This "
1915 "field may contain a NULL pointer."
1916 msgstr ""
1917
1918 #. type: Plain text
1919 #: build/C/man3/getifaddrs.3:131
1920 msgid ""
1921 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1922 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1923 "will contain the broadcast address associated with I<ifa_addr> (if "
1924 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1925 "destination address of the point-to-point interface."
1926 msgstr ""
1927
1928 #. type: Plain text
1929 #: build/C/man3/getifaddrs.3:136
1930 msgid ""
1931 "The I<ifa_data> field points to a buffer containing address-family-specific "
1932 "data; this field may be NULL if there is no such data for this interface."
1933 msgstr ""
1934
1935 #. type: Plain text
1936 #: build/C/man3/getifaddrs.3:142
1937 msgid ""
1938 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1939 "freed using B<freeifaddrs>()  when no longer needed."
1940 msgstr ""
1941
1942 #. type: Plain text
1943 #: build/C/man3/getifaddrs.3:149
1944 msgid ""
1945 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1946 "I<errno> is set appropriately."
1947 msgstr ""
1948
1949 #. type: Plain text
1950 #: build/C/man3/getifaddrs.3:162
1951 msgid ""
1952 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1953 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1954 "(2), B<malloc>(3), or B<realloc>(3)."
1955 msgstr ""
1956
1957 #. type: Plain text
1958 #: build/C/man3/getifaddrs.3:170
1959 msgid ""
1960 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1961 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1962 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1963 "available on kernels that support netlink."
1964 msgstr ""
1965
1966 #.  , but the BSD-derived documentation generally
1967 #.  appears to be confused and obsolete on this point.
1968 #.  i.e., commonly it still says one of them will be NULL, even if
1969 #.  the ifa_ifu union is already present
1970 #. type: Plain text
1971 #: build/C/man3/getifaddrs.3:190
1972 msgid ""
1973 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1974 "the BSD systems, but with slightly different semantics documented"
1975 "\\(emreturning one entry per interface, not per address.  This means "
1976 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1977 "address, and no link-level address is returned if the interface has an IP "
1978 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1979 "I<ifa_dstaddr> differs on various systems."
1980 msgstr ""
1981
1982 #. type: Plain text
1983 #: build/C/man3/getifaddrs.3:207
1984 msgid ""
1985 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
1986 "assigned to the interface, but also one B<AF_PACKET> address per interface "
1987 "containing lower-level details about the interface and its physical layer.  "
1988 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
1989 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
1990 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
1991 "hE<gt>>), which contains various interface attributes and statistics."
1992 msgstr ""
1993
1994 #. type: Plain text
1995 #: build/C/man3/getifaddrs.3:214
1996 msgid ""
1997 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
1998 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
1999 "system:"
2000 msgstr ""
2001
2002 #. type: Plain text
2003 #: build/C/man3/getifaddrs.3:228
2004 #, no-wrap
2005 msgid ""
2006 "$ B<./a.out>\n"
2007 "lo      address family: 17 (AF_PACKET)\n"
2008 "eth0    address family: 17 (AF_PACKET)\n"
2009 "lo      address family: 2 (AF_INET)\n"
2010 "        address: E<lt>127.0.0.1E<gt>\n"
2011 "eth0    address family: 2 (AF_INET)\n"
2012 "        address: E<lt>10.1.1.4E<gt>\n"
2013 "lo      address family: 10 (AF_INET6)\n"
2014 "        address: E<lt>::1E<gt>\n"
2015 "eth0    address family: 10 (AF_INET6)\n"
2016 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2017 msgstr ""
2018 "$ B<./a.out>\n"
2019 "lo      address family: 17 (AF_PACKET)\n"
2020 "eth0    address family: 17 (AF_PACKET)\n"
2021 "lo      address family: 2 (AF_INET)\n"
2022 "        address: E<lt>127.0.0.1E<gt>\n"
2023 "eth0    address family: 2 (AF_INET)\n"
2024 "        address: E<lt>10.1.1.4E<gt>\n"
2025 "lo      address family: 10 (AF_INET6)\n"
2026 "        address: E<lt>::1E<gt>\n"
2027 "eth0    address family: 10 (AF_INET6)\n"
2028 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2029
2030 #. type: SS
2031 #: build/C/man3/getifaddrs.3:230 build/C/man3/if_nameindex.3:120
2032 #: build/C/man2/recvmmsg.2:206
2033 #, no-wrap
2034 msgid "Program source"
2035 msgstr ""
2036
2037 #. type: Plain text
2038 #: build/C/man3/getifaddrs.3:240
2039 #, no-wrap
2040 msgid ""
2041 "#include E<lt>arpa/inet.hE<gt>\n"
2042 "#include E<lt>sys/socket.hE<gt>\n"
2043 "#include E<lt>netdb.hE<gt>\n"
2044 "#include E<lt>ifaddrs.hE<gt>\n"
2045 "#include E<lt>stdio.hE<gt>\n"
2046 "#include E<lt>stdlib.hE<gt>\n"
2047 "#include E<lt>unistd.hE<gt>\n"
2048 msgstr ""
2049 "#include E<lt>arpa/inet.hE<gt>\n"
2050 "#include E<lt>sys/socket.hE<gt>\n"
2051 "#include E<lt>netdb.hE<gt>\n"
2052 "#include E<lt>ifaddrs.hE<gt>\n"
2053 "#include E<lt>stdio.hE<gt>\n"
2054 "#include E<lt>stdlib.hE<gt>\n"
2055 "#include E<lt>unistd.hE<gt>\n"
2056
2057 #. type: Plain text
2058 #: build/C/man3/getifaddrs.3:247
2059 #, no-wrap
2060 msgid ""
2061 "int\n"
2062 "main(int argc, char *argv[])\n"
2063 "{\n"
2064 "    struct ifaddrs *ifaddr, *ifa;\n"
2065 "    int family, s;\n"
2066 "    char host[NI_MAXHOST];\n"
2067 msgstr ""
2068 "int\n"
2069 "main(int argc, char *argv[])\n"
2070 "{\n"
2071 "    struct ifaddrs *ifaddr, *ifa;\n"
2072 "    int family, s;\n"
2073 "    char host[NI_MAXHOST];\n"
2074
2075 #. type: Plain text
2076 #: build/C/man3/getifaddrs.3:252
2077 #, no-wrap
2078 msgid ""
2079 "    if (getifaddrs(&ifaddr) == -1) {\n"
2080 "        perror(\"getifaddrs\");\n"
2081 "        exit(EXIT_FAILURE);\n"
2082 "    }\n"
2083 msgstr ""
2084 "    if (getifaddrs(&ifaddr) == -1) {\n"
2085 "        perror(\"getifaddrs\");\n"
2086 "        exit(EXIT_FAILURE);\n"
2087 "    }\n"
2088
2089 #. type: Plain text
2090 #: build/C/man3/getifaddrs.3:255
2091 #, no-wrap
2092 msgid ""
2093 "    /* Walk through linked list, maintaining head pointer so we\n"
2094 "       can free list later */\n"
2095 msgstr ""
2096 "    /* Walk through linked list, maintaining head pointer so we\n"
2097 "       can free list later */\n"
2098
2099 #. type: Plain text
2100 #: build/C/man3/getifaddrs.3:259
2101 #, no-wrap
2102 msgid ""
2103 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2104 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2105 "            continue;\n"
2106 msgstr ""
2107 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2108 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2109 "            continue;\n"
2110
2111 #. type: Plain text
2112 #: build/C/man3/getifaddrs.3:261
2113 #, no-wrap
2114 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2115 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2116
2117 #. type: Plain text
2118 #: build/C/man3/getifaddrs.3:264
2119 #, no-wrap
2120 msgid ""
2121 "        /* Display interface name and family (including symbolic\n"
2122 "           form of the latter for the common families) */\n"
2123 msgstr ""
2124 "        /* Display interface name and family (including symbolic\n"
2125 "           form of the latter for the common families) */\n"
2126
2127 #. type: Plain text
2128 #: build/C/man3/getifaddrs.3:270
2129 #, no-wrap
2130 msgid ""
2131 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2132 "                ifa-E<gt>ifa_name, family,\n"
2133 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2134 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2135 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2136 msgstr ""
2137 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2138 "                ifa-E<gt>ifa_name, family,\n"
2139 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2140 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2141 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2142
2143 #. type: Plain text
2144 #: build/C/man3/getifaddrs.3:272
2145 #, no-wrap
2146 msgid "        /* For an AF_INET* interface address, display the address */\n"
2147 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2148
2149 #. type: Plain text
2150 #: build/C/man3/getifaddrs.3:285
2151 #, no-wrap
2152 msgid ""
2153 "        if (family == AF_INET || family == AF_INET6) {\n"
2154 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2155 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2156 "                                          sizeof(struct sockaddr_in6),\n"
2157 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2158 "            if (s != 0) {\n"
2159 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2160 "                exit(EXIT_FAILURE);\n"
2161 "            }\n"
2162 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2163 "        }\n"
2164 "    }\n"
2165 msgstr ""
2166 "        if (family == AF_INET || family == AF_INET6) {\n"
2167 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2168 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2169 "                                          sizeof(struct sockaddr_in6),\n"
2170 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2171 "            if (s != 0) {\n"
2172 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2173 "                exit(EXIT_FAILURE);\n"
2174 "            }\n"
2175 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2176 "        }\n"
2177 "    }\n"
2178
2179 #. type: Plain text
2180 #: build/C/man3/getifaddrs.3:289
2181 #, no-wrap
2182 msgid ""
2183 "    freeifaddrs(ifaddr);\n"
2184 "    exit(EXIT_SUCCESS);\n"
2185 "}\n"
2186 msgstr ""
2187 "    freeifaddrs(ifaddr);\n"
2188 "    exit(EXIT_SUCCESS);\n"
2189 "}\n"
2190
2191 #. type: Plain text
2192 #: build/C/man3/getifaddrs.3:296
2193 msgid ""
2194 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2195 msgstr ""
2196 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2197
2198 #. type: TH
2199 #: build/C/man2/getsockname.2:40
2200 #, no-wrap
2201 msgid "GETSOCKNAME"
2202 msgstr "GETSOCKNAME"
2203
2204 #. type: Plain text
2205 #: build/C/man2/getsockname.2:43
2206 msgid "getsockname - get socket name"
2207 msgstr "getsockname - ソケットの名前を取得する"
2208
2209 #. type: Plain text
2210 #: build/C/man2/getsockname.2:49
2211 #, no-wrap
2212 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2213 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2214
2215 #. type: Plain text
2216 #: build/C/man2/getsockname.2:62
2217 msgid ""
2218 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2219 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2220 "should be initialized to indicate the amount of space (in bytes) pointed to "
2221 "by I<addr>.  On return it contains the actual size of the socket address."
2222 msgstr ""
2223 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2224 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2225 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2226 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2227 "納される。"
2228
2229 #. type: Plain text
2230 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2231 #: build/C/man2/listen.2:96
2232 msgid "The argument I<sockfd> is not a valid descriptor."
2233 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2234
2235 #. type: Plain text
2236 #: build/C/man2/getsockname.2:84
2237 msgid ""
2238 "The I<addr> argument points to memory not in a valid part of the process "
2239 "address space."
2240 msgstr ""
2241 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2242 "い。"
2243
2244 #. type: Plain text
2245 #: build/C/man2/getsockname.2:88
2246 msgid "I<addrlen> is invalid (e.g., is negative)."
2247 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2248
2249 #. type: TP
2250 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2251 #: build/C/man2/send.2:335
2252 #, no-wrap
2253 msgid "B<ENOBUFS>"
2254 msgstr "B<ENOBUFS>"
2255
2256 #. type: Plain text
2257 #: build/C/man2/getsockname.2:92
2258 msgid ""
2259 "Insufficient resources were available in the system to perform the operation."
2260 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2261
2262 #. type: Plain text
2263 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2264 msgid "The argument I<sockfd> is a file, not a socket."
2265 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2266
2267 #.  SVr4 documents additional ENOMEM
2268 #.  and ENOSR error codes.
2269 #. type: Plain text
2270 #: build/C/man2/getsockname.2:103
2271 msgid ""
2272 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2273 "POSIX.1-2001."
2274 msgstr ""
2275 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2276
2277 #. type: Plain text
2278 #: build/C/man2/getsockname.2:112
2279 msgid ""
2280 "The third argument of B<getsockname>()  is in reality an I<int *> (and this "
2281 "is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
2282 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
2283 msgstr ""
2284 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2285 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2286 "POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2287
2288 #. type: Plain text
2289 #: build/C/man2/getsockname.2:119
2290 msgid ""
2291 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2292 "(7)"
2293 msgstr ""
2294 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2295 "(7)"
2296
2297 #. type: TH
2298 #: build/C/man2/getsockopt.2:44
2299 #, no-wrap
2300 msgid "GETSOCKOPT"
2301 msgstr "GETSOCKOPT"
2302
2303 #. type: Plain text
2304 #: build/C/man2/getsockopt.2:47
2305 msgid "getsockopt, setsockopt - get and set options on sockets"
2306 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2307
2308 #. type: Plain text
2309 #: build/C/man2/getsockopt.2:57
2310 #, no-wrap
2311 msgid ""
2312 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2313 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2314 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2315 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2316 msgstr ""
2317 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2318 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2319 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2320 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2321
2322 #. type: Plain text
2323 #: build/C/man2/getsockopt.2:67
2324 msgid ""
2325 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2326 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2327 "protocol levels; they are always present at the uppermost socket level."
2328 msgstr ""
2329 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2330 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2331 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2332 "定される。"
2333
2334 #. type: Plain text
2335 #: build/C/man2/getsockopt.2:86
2336 msgid ""
2337 "When manipulating socket options, the level at which the option resides and "
2338 "the name of the option must be specified.  To manipulate options at the "
2339 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2340 "options at any other level the protocol number of the appropriate protocol "
2341 "controlling the option is supplied.  For example, to indicate that an option "
2342 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2343 "protocol number of B<TCP>; see B<getprotoent>(3)."
2344 msgstr ""
2345 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2346 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2347 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2348 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2349 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2350 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2351 "B<getprotoent>(3)  を参照すること。"
2352
2353 #. type: Plain text
2354 #: build/C/man2/getsockopt.2:108
2355 msgid ""
2356 "The arguments I<optval> and I<optlen> are used to access option values for "
2357 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2358 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2359 "I<optlen> is a value-result argument, initially containing the size of the "
2360 "buffer pointed to by I<optval>, and modified on return to indicate the "
2361 "actual size of the value returned.  If no option value is to be supplied or "
2362 "returned, I<optval> may be NULL."
2363 msgstr ""
2364 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2365 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2366 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2367 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2368 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2369 "I<optval> は NULL でも良い。"
2370
2371 #. type: Plain text
2372 #: build/C/man2/getsockopt.2:118
2373 msgid ""
2374 "I<Optname> and any specified options are passed uninterpreted to the "
2375 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2376 "socket.hE<gt>> contains definitions for socket level options, described "
2377 "below.  Options at other protocol levels vary in format and name; consult "
2378 "the appropriate entries in section 4 of the manual."
2379 msgstr ""
2380 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2381 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2382 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2383 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2384 "ること。"
2385
2386 #. type: Plain text
2387 #: build/C/man2/getsockopt.2:127
2388 msgid ""
2389 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2390 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2391 "or zero if the option is to be disabled."
2392 msgstr ""
2393 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2394 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2395 "を指定し、 無効(disable)にするにはゼロを指定する。"
2396
2397 #. type: Plain text
2398 #: build/C/man2/getsockopt.2:131
2399 msgid ""
2400 "For a description of the available socket options see B<socket>(7)  and the "
2401 "appropriate protocol man pages."
2402 msgstr ""
2403 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2404 "ルの man ページを参照のこと。"
2405
2406 #. type: Plain text
2407 #: build/C/man2/getsockopt.2:152
2408 msgid ""
2409 "The address pointed to by I<optval> is not in a valid part of the process "
2410 "address space.  For B<getsockopt>(), this error may also be returned if "
2411 "I<optlen> is not in a valid part of the process address space."
2412 msgstr ""
2413 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2414 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2415 "い場合にもこのエラーが返される。"
2416
2417 #. type: Plain text
2418 #: build/C/man2/getsockopt.2:163
2419 msgid ""
2420 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2421 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2422 "option described in B<ip>(7))."
2423 msgstr ""
2424 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2425 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2426 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2427
2428 #. type: TP
2429 #: build/C/man2/getsockopt.2:163
2430 #, no-wrap
2431 msgid "B<ENOPROTOOPT>"
2432 msgstr "B<ENOPROTOOPT>"
2433
2434 #. type: Plain text
2435 #: build/C/man2/getsockopt.2:166
2436 msgid "The option is unknown at the level indicated."
2437 msgstr "指定された層(level)にはこのオプションは存在しない。"
2438
2439 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2440 #.  not document the
2441 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2442 #.  options
2443 #. type: Plain text
2444 #: build/C/man2/getsockopt.2:178
2445 msgid ""
2446 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2447 msgstr ""
2448 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2449 "POSIX.1-2001."
2450
2451 #. type: Plain text
2452 #: build/C/man2/getsockopt.2:199
2453 msgid ""
2454 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2455 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2456 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2457 "glibc.  See also B<accept>(2)."
2458 msgstr ""
2459 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2460 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2461 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2462 "る。 B<accept>(2)  も参照のこと。"
2463
2464 #. type: Plain text
2465 #: build/C/man2/getsockopt.2:202
2466 msgid ""
2467 "Several of the socket options should be handled at lower levels of the "
2468 "system."
2469 msgstr ""
2470 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2471
2472 #. type: Plain text
2473 #: build/C/man2/getsockopt.2:210
2474 msgid ""
2475 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2476 "B<tcp>(7), B<unix>(7)"
2477 msgstr ""
2478 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2479 "B<tcp>(7), B<unix>(7)"
2480
2481 #. type: TH
2482 #: build/C/man3/if_nameindex.3:26
2483 #, no-wrap
2484 msgid "IF_NAMEINDEX"
2485 msgstr ""
2486
2487 #. type: TH
2488 #: build/C/man3/if_nameindex.3:26
2489 #, fuzzy, no-wrap
2490 #| msgid "2008-11-20"
2491 msgid "2012-11-21"
2492 msgstr "2008-11-20"
2493
2494 #. type: Plain text
2495 #: build/C/man3/if_nameindex.3:29
2496 msgid ""
2497 "if_nameindex, if_freenameindex - get network interface names and indexes"
2498 msgstr ""
2499
2500 #. type: Plain text
2501 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2502 #, fuzzy, no-wrap
2503 #| msgid "B<#include E<lt>unistd.hE<gt>>\n"
2504 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2505 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
2506
2507 #. type: Plain text
2508 #: build/C/man3/if_nameindex.3:35
2509 #, no-wrap
2510 msgid ""
2511 "B<struct if_nameindex *if_nameindex(void);>\n"
2512 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2513 msgstr ""
2514
2515 #. type: Plain text
2516 #: build/C/man3/if_nameindex.3:46
2517 msgid ""
2518 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2519 "structures, each containing information about one of the network interfaces "
2520 "on the local system.  The I<if_nameindex> structure contains at least the "
2521 "following entries:"
2522 msgstr ""
2523
2524 #. type: Plain text
2525 #: build/C/man3/if_nameindex.3:51
2526 #, no-wrap
2527 msgid ""
2528 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2529 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man3/if_nameindex.3:65
2534 msgid ""
2535 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2536 "points to the null-terminated interface name.  The end of the array is "
2537 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2538 msgstr ""
2539
2540 #. type: Plain text
2541 #: build/C/man3/if_nameindex.3:71
2542 msgid ""
2543 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2544 "and should be freed using B<if_freenameindex>()  when no longer needed."
2545 msgstr ""
2546
2547 #. type: Plain text
2548 #: build/C/man3/if_nameindex.3:78
2549 #, fuzzy
2550 #| msgid ""
2551 #| "On success, zero is returned.  On error, -1 is returned, and I<errno> is "
2552 #| "set appropriately."
2553 msgid ""
2554 "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2555 "NULL pointer is returned, and I<errno> is set appropriately."
2556 msgstr ""
2557 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
2558 "設定される。"
2559
2560 #. type: Plain text
2561 #: build/C/man3/if_nameindex.3:83
2562 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2563 msgstr ""
2564
2565 #. type: Plain text
2566 #: build/C/man3/if_nameindex.3:86
2567 #, fuzzy
2568 #| msgid "Insufficient kernel memory was available."
2569 msgid "Insufficient resources available."
2570 msgstr "カーネルに、利用可能なメモリーが十分にない。"
2571
2572 #. type: Plain text
2573 #: build/C/man3/if_nameindex.3:97
2574 msgid ""
2575 "B<if_nameindex>()  may also fail for any of the errors specified for "
2576 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2577 "B<sendto>(2), or B<malloc>(3)."
2578 msgstr ""
2579
2580 #. type: Plain text
2581 #: build/C/man3/if_nameindex.3:104
2582 msgid ""
2583 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2584 "glibc 2.3.4, the implementation only supported interfaces with IPv4 "
2585 "addresses.  Support of interfaces that don't have IPv4 addresses is only "
2586 "available on kernels that support netlink."
2587 msgstr ""
2588
2589 #. type: Plain text
2590 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2591 #, fuzzy
2592 #| msgid "4.4BSD, POSIX.1-2001."
2593 msgid "RFC\\ 3493, POSIX.1-2001."
2594 msgstr "4.4BSD, POSIX.1-2001."
2595
2596 #. type: Plain text
2597 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2598 #, fuzzy
2599 #| msgid ""
2600 #| "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
2601 msgid "This function first appeared in BSDi."
2602 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
2603
2604 #. type: Plain text
2605 #: build/C/man3/if_nameindex.3:112
2606 msgid ""
2607 "The program below demonstrates the use of the functions described on this "
2608 "page.  An example of the output this program might produce is the following:"
2609 msgstr ""
2610
2611 #. type: Plain text
2612 #: build/C/man3/if_nameindex.3:118
2613 #, no-wrap
2614 msgid ""
2615 "$ B<./a.out>I<\n"
2616 "1: lo\n"
2617 "2: wlan0\n"
2618 "3: em1>\n"
2619 msgstr ""
2620
2621 #. type: Plain text
2622 #: build/C/man3/if_nameindex.3:126
2623 #, fuzzy, no-wrap
2624 #| msgid ""
2625 #| "#include E<lt>stdio.hE<gt>\n"
2626 #| "#include E<lt>stdlib.hE<gt>\n"
2627 #| "#include E<lt>sys/time.hE<gt>\n"
2628 #| "#include E<lt>sys/types.hE<gt>\n"
2629 #| "#include E<lt>unistd.hE<gt>\n"
2630 msgid ""
2631 "#include E<lt>net/if.hE<gt>\n"
2632 "#include E<lt>stdio.hE<gt>\n"
2633 "#include E<lt>stdlib.hE<gt>\n"
2634 "#include E<lt>unistd.hE<gt>\n"
2635 msgstr ""
2636 "#include E<lt>stdio.hE<gt>\n"
2637 "#include E<lt>stdlib.hE<gt>\n"
2638 "#include E<lt>sys/time.hE<gt>\n"
2639 "#include E<lt>sys/types.hE<gt>\n"
2640 "#include E<lt>unistd.hE<gt>\n"
2641
2642 #. type: Plain text
2643 #: build/C/man3/if_nameindex.3:131
2644 #, fuzzy, no-wrap
2645 #| msgid ""
2646 #| "int\n"
2647 #| "main(int argc, char *argv[])\n"
2648 #| "{\n"
2649 #| "    struct ifaddrs *ifaddr, *ifa;\n"
2650 #| "    int family, s;\n"
2651 #| "    char host[NI_MAXHOST];\n"
2652 msgid ""
2653 "int\n"
2654 "main(int argc, char *argv[])\n"
2655 "{\n"
2656 "    struct if_nameindex *if_ni, *i;\n"
2657 msgstr ""
2658 "int\n"
2659 "main(int argc, char *argv[])\n"
2660 "{\n"
2661 "    struct ifaddrs *ifaddr, *ifa;\n"
2662 "    int family, s;\n"
2663 "    char host[NI_MAXHOST];\n"
2664
2665 #. type: Plain text
2666 #: build/C/man3/if_nameindex.3:137
2667 #, fuzzy, no-wrap
2668 #| msgid ""
2669 #| "    if (getifaddrs(&ifaddr) == -1) {\n"
2670 #| "        perror(\"getifaddrs\");\n"
2671 #| "        exit(EXIT_FAILURE);\n"
2672 #| "    }\n"
2673 msgid ""
2674 "    if_ni = if_nameindex();\n"
2675 "    if (if_ni == NULL) {\n"
2676 "        perror(\"if_nameindex\");\n"
2677 "        exit(EXIT_FAILURE);\n"
2678 "    }\n"
2679 msgstr ""
2680 "    if (getifaddrs(&ifaddr) == -1) {\n"
2681 "        perror(\"getifaddrs\");\n"
2682 "        exit(EXIT_FAILURE);\n"
2683 "    }\n"
2684
2685 #. type: Plain text
2686 #: build/C/man3/if_nameindex.3:140
2687 #, no-wrap
2688 msgid ""
2689 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2690 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2691 msgstr ""
2692
2693 #. type: Plain text
2694 #: build/C/man3/if_nameindex.3:142
2695 #, no-wrap
2696 msgid "    if_freenameindex(if_ni);\n"
2697 msgstr ""
2698
2699 #. type: Plain text
2700 #: build/C/man3/if_nameindex.3:145 build/C/man2/select.2:573
2701 #, no-wrap
2702 msgid ""
2703 "    exit(EXIT_SUCCESS);\n"
2704 "}\n"
2705 msgstr ""
2706 "    exit(EXIT_SUCCESS);\n"
2707 "}\n"
2708
2709 #. type: Plain text
2710 #: build/C/man3/if_nameindex.3:153
2711 #, fuzzy
2712 #| msgid ""
2713 #| "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2714 #| "B<unix>(7)"
2715 msgid ""
2716 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2717 "B<if_nametoindex>(3), B<ifconfig>(8)"
2718 msgstr ""
2719 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2720 "(7)"
2721
2722 #. type: TH
2723 #: build/C/man3/if_nametoindex.3:25
2724 #, no-wrap
2725 msgid "IF_NAMETOINDEX"
2726 msgstr ""
2727
2728 #. type: TH
2729 #: build/C/man3/if_nametoindex.3:25
2730 #, fuzzy, no-wrap
2731 #| msgid "2012-02-27"
2732 msgid "2012-12-14"
2733 msgstr "2012-02-27"
2734
2735 #. type: Plain text
2736 #: build/C/man3/if_nametoindex.3:29
2737 msgid ""
2738 "if_nametoindex, if_indextoname - mappings between network interface names "
2739 "and indexes"
2740 msgstr ""
2741
2742 #. type: Plain text
2743 #: build/C/man3/if_nametoindex.3:34
2744 #, no-wrap
2745 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2746 msgstr ""
2747
2748 #. type: Plain text
2749 #: build/C/man3/if_nametoindex.3:36
2750 #, no-wrap
2751 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2752 msgstr ""
2753
2754 #. type: Plain text
2755 #: build/C/man3/if_nametoindex.3:43
2756 msgid ""
2757 "The B<if_nametoindex>()  function returns the index of the network interface "
2758 "corresponding to the name I<ifname>."
2759 msgstr ""
2760
2761 #. type: Plain text
2762 #: build/C/man3/if_nametoindex.3:54
2763 msgid ""
2764 "The B<if_indextoname>()  function returns the name of the network interface "
2765 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2766 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2767 "least B<IF_NAMESIZE> bytes."
2768 msgstr ""
2769
2770 #. type: Plain text
2771 #: build/C/man3/if_nametoindex.3:61
2772 #, fuzzy
2773 #| msgid ""
2774 #| "On success, these calls return the number of characters sent.  On error, "
2775 #| "-1 is returned, and I<errno> is set appropriately."
2776 msgid ""
2777 "On success, B<if_nametoindex>()  returns the index number of the network "
2778 "interface; on error, 0 is returned and I<errno> is set appropriately."
2779 msgstr ""
2780 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
2781 "合、 -1 を返し、 I<errno> を適切に設定にする。"
2782
2783 #. type: Plain text
2784 #: build/C/man3/if_nametoindex.3:69
2785 #, fuzzy
2786 #| msgid ""
2787 #| "On success, zero is returned.  On error, -1 is returned, and I<errno> is "
2788 #| "set appropriately."
2789 msgid ""
2790 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2791 "returned and I<errno> is set appropriately."
2792 msgstr ""
2793 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
2794 "設定される。"
2795
2796 #. type: Plain text
2797 #: build/C/man3/if_nametoindex.3:74
2798 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2799 msgstr ""
2800
2801 #. type: TP
2802 #: build/C/man3/if_nametoindex.3:74
2803 #, fuzzy, no-wrap
2804 #| msgid "B<ENFILE>"
2805 msgid "B<ENXIO>"
2806 msgstr "B<ENFILE>"
2807
2808 #. type: Plain text
2809 #: build/C/man3/if_nametoindex.3:77
2810 msgid "No interface found for the index."
2811 msgstr ""
2812
2813 #. type: Plain text
2814 #: build/C/man3/if_nametoindex.3:85
2815 msgid ""
2816 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2817 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2818 msgstr ""
2819
2820 #. type: Plain text
2821 #: build/C/man3/if_nametoindex.3:93
2822 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2823 msgstr ""
2824
2825 #. type: TH
2826 #: build/C/man2/listen.2:45
2827 #, no-wrap
2828 msgid "LISTEN"
2829 msgstr "LISTEN"
2830
2831 #. type: TH
2832 #: build/C/man2/listen.2:45
2833 #, no-wrap
2834 msgid "2008-11-20"
2835 msgstr "2008-11-20"
2836
2837 #. type: Plain text
2838 #: build/C/man2/listen.2:48
2839 msgid "listen - listen for connections on a socket"
2840 msgstr "listen - ソケット(socket)上の接続を待つ"
2841
2842 #. type: Plain text
2843 #: build/C/man2/listen.2:55
2844 #, no-wrap
2845 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2846 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2847
2848 #. type: Plain text
2849 #: build/C/man2/listen.2:63
2850 msgid ""
2851 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2852 "that is, as a socket that will be used to accept incoming connection "
2853 "requests using B<accept>(2)."
2854 msgstr ""
2855 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2856 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2857 "した接続要求を受け付けるのに使用されるソケットである。"
2858
2859 #. type: Plain text
2860 #: build/C/man2/listen.2:70
2861 msgid ""
2862 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2863 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2864 msgstr ""
2865 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2866 "するファイルディスクリプタである。"
2867
2868 #. type: Plain text
2869 #: build/C/man2/listen.2:82
2870 msgid ""
2871 "The I<backlog> argument defines the maximum length to which the queue of "
2872 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2873 "when the queue is full, the client may receive an error with an indication "
2874 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2875 "the request may be ignored so that a later reattempt at connection succeeds."
2876 msgstr ""
2877 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2878 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2879 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2880 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2881 "い。"
2882
2883 #. type: Plain text
2884 #: build/C/man2/listen.2:91
2885 msgid "Another socket is already listening on the same port."
2886 msgstr "別のソケットが既に同じポートを listen している。"
2887
2888 #. type: Plain text
2889 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
2890 msgid "The argument I<sockfd> is not a socket."
2891 msgstr "引き数 I<sockfd> はソケットではない。"
2892
2893 #. type: Plain text
2894 #: build/C/man2/listen.2:106
2895 msgid "The socket is not of a type that supports the B<listen>()  operation."
2896 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2897
2898 #. type: Plain text
2899 #: build/C/man2/listen.2:111
2900 msgid ""
2901 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2902 "4.2BSD."
2903 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2904
2905 #. type: Plain text
2906 #: build/C/man2/listen.2:113
2907 msgid "To accept connections, the following steps are performed:"
2908 msgstr "接続を受け付けるには、以下の処理が実行される。"
2909
2910 #. type: TP
2911 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
2912 #, no-wrap
2913 msgid "1."
2914 msgstr "1."
2915
2916 #. type: Plain text
2917 #: build/C/man2/listen.2:117
2918 msgid "A socket is created with B<socket>(2)."
2919 msgstr "B<socket>(2)  でソケットを作成する。"
2920
2921 #. type: TP
2922 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
2923 #, no-wrap
2924 msgid "2."
2925 msgstr "2."
2926
2927 #. type: Plain text
2928 #: build/C/man2/listen.2:123
2929 msgid ""
2930 "The socket is bound to a local address using B<bind>(2), so that other "
2931 "sockets may be B<connect>(2)ed to it."
2932 msgstr ""
2933 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2934 "のソケットに B<connect>(2)  できるようにする。"
2935
2936 #. type: TP
2937 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
2938 #, no-wrap
2939 msgid "3."
2940 msgstr "3."
2941
2942 #. type: Plain text
2943 #: build/C/man2/listen.2:127
2944 msgid ""
2945 "A willingness to accept incoming connections and a queue limit for incoming "
2946 "connections are specified with B<listen>()."
2947 msgstr ""
2948 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2949 "定する。"
2950
2951 #. type: TP
2952 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
2953 #, no-wrap
2954 msgid "4."
2955 msgstr "4."
2956
2957 #. type: Plain text
2958 #: build/C/man2/listen.2:130
2959 msgid "Connections are accepted with B<accept>(2)."
2960 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2961
2962 #. type: Plain text
2963 #: build/C/man2/listen.2:153
2964 msgid ""
2965 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2966 "2.2.  Now it specifies the queue length for I<completely> established "
2967 "sockets waiting to be accepted, instead of the number of incomplete "
2968 "connection requests.  The maximum length of the queue for incomplete sockets "
2969 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2970 "are enabled there is no logical maximum length and this setting is ignored.  "
2971 "See B<tcp>(7)  for more information."
2972 msgstr ""
2973 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2974 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2975 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2976 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2977 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2978 "論理的な最大長は存在せず、この設定は無視される。"
2979
2980 #.  The following is now rather historic information (MTK, Jun 05)
2981 #.  Don't rely on this value in portable applications since BSD
2982 #.  (and some BSD-derived systems) limit the backlog to 5.
2983 #. type: Plain text
2984 #: build/C/man2/listen.2:166
2985 msgid ""
2986 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2987 "somaxconn>, then it is silently truncated to that value; the default value "
2988 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
2989 "value, B<SOMAXCONN>, with the value 128."
2990 msgstr ""
2991 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2992 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2993 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2994 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2995
2996 #. type: Plain text
2997 #: build/C/man2/listen.2:175
2998 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2999 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3000
3001 #. type: TH
3002 #: build/C/man2/recv.2:41
3003 #, no-wrap
3004 msgid "RECV"
3005 msgstr "RECV"
3006
3007 #. type: TH
3008 #: build/C/man2/recv.2:41
3009 #, fuzzy, no-wrap
3010 #| msgid "2012-02-27"
3011 msgid "2012-12-21"
3012 msgstr "2012-02-27"
3013
3014 #. type: Plain text
3015 #: build/C/man2/recv.2:44
3016 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3017 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3018
3019 #. type: Plain text
3020 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3021 #: build/C/man2/select_tut.2:47
3022 #, no-wrap
3023 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3024 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3025
3026 #. type: Plain text
3027 #: build/C/man2/recv.2:53
3028 #, no-wrap
3029 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3030 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3031
3032 #. type: Plain text
3033 #: build/C/man2/recv.2:56
3034 #, no-wrap
3035 msgid ""
3036 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3037 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3038 msgstr ""
3039 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3040 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3041
3042 #. type: Plain text
3043 #: build/C/man2/recv.2:58
3044 #, no-wrap
3045 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3046 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3047
3048 #. type: Plain text
3049 #: build/C/man2/recv.2:66
3050 msgid ""
3051 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
3052 "a socket, and may be used to receive data on a socket whether or not it is "
3053 "connection-oriented."
3054 msgstr ""
3055 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3056 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3057 "接続指向 (connection-oriened) であってもなくてもよい。"
3058
3059 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3060 #.  .I src_addr
3061 #.  is filled in.
3062 #.  .I src_addr
3063 #.  is also filled in for stream sockets in the UNIX domain, but is not
3064 #.  filled in for stream sockets in the Internet domain.)
3065 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3066 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3067 #. type: Plain text
3068 #: build/C/man2/recv.2:95
3069 msgid ""
3070 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3071 "address, this source address is filled in.  When I<src_addr> is NULL, "
3072 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
3073 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
3074 "caller should initialize before the call to the size of the buffer "
3075 "associated with I<src_addr>, and modified on return to indicate the actual "
3076 "size of the source address.  The returned address is truncated if the buffer "
3077 "provided is too small; in this case, I<addrlen> will return a value greater "
3078 "than was supplied to the call."
3079 msgstr ""
3080 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3081 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3082 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3083 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3084 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3085 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3086 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3087 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3088 "な値が返される。"
3089
3090 #. type: Plain text
3091 #: build/C/man2/recv.2:107
3092 msgid ""
3093 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3094 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
3095 "argument."
3096 msgstr ""
3097 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3098 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3099 "()  と等価である。"
3100
3101 #. type: Plain text
3102 #: build/C/man2/recv.2:113
3103 msgid ""
3104 "All three routines return the length of the message on successful "
3105 "completion.  If a message is too long to fit in the supplied buffer, excess "
3106 "bytes may be discarded depending on the type of socket the message is "
3107 "received from."
3108 msgstr ""
3109 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3110 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3111 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3112
3113 #. type: Plain text
3114 #: build/C/man2/recv.2:123
3115 msgid ""
3116 "If no messages are available at the socket, the receive calls wait for a "
3117 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3118 "which case the value -1 is returned and the external variable I<errno> is "
3119 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3120 "data available, up to the requested amount, rather than waiting for receipt "
3121 "of the full amount requested."
3122 msgstr ""
3123 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3124 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3125 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3126 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3127 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3128 "る (受信されるデータの最大サイズは要求したサイズである)。"
3129
3130 #. type: Plain text
3131 #: build/C/man2/recv.2:129
3132 msgid ""
3133 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3134 "data arrives."
3135 msgstr ""
3136 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3137 "る。"
3138
3139 #. type: Plain text
3140 #: build/C/man2/recv.2:135
3141 msgid ""
3142 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
3143 "the following values:"
3144 msgstr ""
3145 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3146 "和 を取ったものを指定する:"
3147
3148 #. type: TP
3149 #: build/C/man2/recv.2:135
3150 #, no-wrap
3151 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3152 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3153
3154 #. type: Plain text
3155 #: build/C/man2/recv.2:146
3156 msgid ""
3157 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3158 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3159 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3160 "flag of B<open>(2)."
3161 msgstr ""
3162 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3163 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3164 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3165 "同じ理由で有用である。"
3166
3167 #. type: TP
3168 #: build/C/man2/recv.2:146 build/C/man2/send.2:188
3169 #, no-wrap
3170 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3171 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3172
3173 #. type: Plain text
3174 #: build/C/man2/recv.2:156
3175 msgid ""
3176 "Enables nonblocking operation; if the operation would block, the call fails "
3177 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3178 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3179 msgstr ""
3180 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3181 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3182 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3183
3184 #. type: TP
3185 #: build/C/man2/recv.2:156
3186 #, no-wrap
3187 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3188 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3189
3190 #. type: Plain text
3191 #: build/C/man2/recv.2:175
3192 msgid ""
3193 "This flag specifies that queued errors should be received from the socket "
3194 "error queue.  The error is passed in an ancillary message with a type "
3195 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3196 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3197 "information.  The payload of the original packet that caused the error is "
3198 "passed as normal data via I<msg_iovec>.  The original destination address of "
3199 "the datagram that caused the error is supplied via I<msg_name>."
3200 msgstr ""
3201 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3202 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3203 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3204 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3205 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3206 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3207 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3208 "I<msg_name> 経由で参照できる。"
3209
3210 #. type: Plain text
3211 #: build/C/man2/recv.2:187 build/C/man2/recv.2:250
3212 msgid ""
3213 "For local errors, no address is passed (this can be checked with the "
3214 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3215 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3216 "the pending socket error is regenerated based on the next queued error and "
3217 "will be passed on the next socket operation."
3218 msgstr ""
3219 "ローカルなエラーの場合はアドレスは渡されない\n"
3220 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3221 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3222 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3223 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3224
3225 #. type: Plain text
3226 #: build/C/man2/recv.2:191
3227 msgid "The error is supplied in a I<sock_extended_err> structure:"
3228 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3229
3230 #. type: Plain text
3231 #: build/C/man2/recv.2:198
3232 #, no-wrap
3233 msgid ""
3234 "#define SO_EE_ORIGIN_NONE    0\n"
3235 "#define SO_EE_ORIGIN_LOCAL   1\n"
3236 "#define SO_EE_ORIGIN_ICMP    2\n"
3237 "#define SO_EE_ORIGIN_ICMP6   3\n"
3238 msgstr ""
3239 "#define SO_EE_ORIGIN_NONE    0\n"
3240 "#define SO_EE_ORIGIN_LOCAL   1\n"
3241 "#define SO_EE_ORIGIN_ICMP    2\n"
3242 "#define SO_EE_ORIGIN_ICMP6   3\n"
3243
3244 #. type: Plain text
3245 #: build/C/man2/recv.2:210
3246 #, no-wrap
3247 msgid ""
3248 "struct sock_extended_err\n"
3249 "{\n"
3250 "    uint32_t ee_errno;   /* error number */\n"
3251 "    uint8_t  ee_origin;  /* where the error originated */\n"
3252 "    uint8_t  ee_type;    /* type */\n"
3253 "    uint8_t  ee_code;    /* code */\n"
3254 "    uint8_t  ee_pad;     /* padding */\n"
3255 "    uint32_t ee_info;    /* additional information */\n"
3256 "    uint32_t ee_data;    /* other data */\n"
3257 "    /* More data may follow */\n"
3258 "};\n"
3259 msgstr ""
3260 "struct sock_extended_err\n"
3261 "{\n"
3262 "    uint32_t ee_errno;   /* error number */\n"
3263 "    uint8_t  ee_origin;  /* where the error originated */\n"
3264 "    uint8_t  ee_type;    /* type */\n"
3265 "    uint8_t  ee_code;    /* code */\n"
3266 "    uint8_t  ee_pad;     /* padding */\n"
3267 "    uint32_t ee_info;    /* additional information */\n"
3268 "    uint32_t ee_data;    /* other data */\n"
3269 "    /* More data may follow */\n"
3270 "};\n"
3271
3272 #. type: Plain text
3273 #: build/C/man2/recv.2:212
3274 #, no-wrap
3275 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3276 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3277
3278 #. type: Plain text
3279 #: build/C/man2/recv.2:236
3280 msgid ""
3281 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3282 "is the origin code of where the error originated.  The other fields are "
3283 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3284 "address of the network object where the error originated from given a "
3285 "pointer to the ancillary message.  If this address is not known, the "
3286 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3287 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3288 "caused the error is passed as normal data."
3289 msgstr ""
3290 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3291 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3292 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3293 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3294 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3295 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3296 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3297 "される。"
3298
3299 #. type: TP
3300 #: build/C/man2/recv.2:250 build/C/man2/recv.2:381 build/C/man2/send.2:230
3301 #, no-wrap
3302 msgid "B<MSG_OOB>"
3303 msgstr "B<MSG_OOB>"
3304
3305 #. type: Plain text
3306 #: build/C/man2/recv.2:257
3307 msgid ""
3308 "This flag requests receipt of out-of-band data that would not be received in "
3309 "the normal data stream.  Some protocols place expedited data at the head of "
3310 "the normal data queue, and thus this flag cannot be used with such protocols."
3311 msgstr ""
3312 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3313 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3314 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3315 "い。"
3316
3317 #. type: TP
3318 #: build/C/man2/recv.2:257
3319 #, no-wrap
3320 msgid "B<MSG_PEEK>"
3321 msgstr "B<MSG_PEEK>"
3322
3323 #. type: Plain text
3324 #: build/C/man2/recv.2:264
3325 msgid ""
3326 "This flag causes the receive operation to return data from the beginning of "
3327 "the receive queue without removing that data from the queue.  Thus, a "
3328 "subsequent receive call will return the same data."
3329 msgstr ""
3330 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3331 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3332 "が返ることになる。"
3333
3334 #. type: TP
3335 #: build/C/man2/recv.2:264
3336 #, no-wrap
3337 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3338 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3339
3340 #. type: Plain text
3341 #: build/C/man2/recv.2:275
3342 #, fuzzy
3343 #| msgid ""
3344 #| "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), and "
3345 #| "netlink (since Linux 2.6.22) sockets: return the real length of the "
3346 #| "packet or datagram, even when it was longer than the passed buffer.  Not "
3347 #| "implemented for UNIX domain (B<unix>(7))  sockets."
3348 msgid ""
3349 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3350 "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3351 "return the real length of the packet or datagram, even when it was longer "
3352 "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3353 "sockets."
3354 msgstr ""
3355 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3356 "以降)、 netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの"
3357 "長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長"
3358 "さを返す。 UNIX ドメインソケット (B<unix>(7))  ソケットについては実装されてい"
3359 "ない。"
3360
3361 #. type: Plain text
3362 #: build/C/man2/recv.2:278
3363 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3364 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3365
3366 #. type: TP
3367 #: build/C/man2/recv.2:278
3368 #, no-wrap
3369 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3370 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3371
3372 #. type: Plain text
3373 #: build/C/man2/recv.2:285
3374 msgid ""
3375 "This flag requests that the operation block until the full request is "
3376 "satisfied.  However, the call may still return less data than requested if a "
3377 "signal is caught, an error or disconnect occurs, or the next data to be "
3378 "received is of a different type than that returned."
3379 msgstr ""
3380 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3381 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3382 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3383 "りデータが少なくても返ることがある。"
3384
3385 #. type: Plain text
3386 #: build/C/man2/recv.2:293
3387 msgid ""
3388 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3389 "directly supplied arguments.  This structure is defined as follows in "
3390 "I<E<lt>sys/socket.hE<gt>>:"
3391 msgstr ""
3392 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3393 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3394
3395 #. type: Plain text
3396 #: build/C/man2/recv.2:300
3397 #, no-wrap
3398 msgid ""
3399 "struct iovec {                    /* Scatter/gather array items */\n"
3400 "    void  *iov_base;              /* Starting address */\n"
3401 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3402 "};\n"
3403 msgstr ""
3404 "struct iovec {                    /* Scatter/gather array items */\n"
3405 "    void  *iov_base;              /* Starting address */\n"
3406 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3407 "};\n"
3408
3409 #. type: Plain text
3410 #: build/C/man2/recv.2:310 build/C/man2/send.2:258
3411 #, no-wrap
3412 msgid ""
3413 "struct msghdr {\n"
3414 "    void         *msg_name;       /* optional address */\n"
3415 "    socklen_t     msg_namelen;    /* size of address */\n"
3416 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3417 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3418 "    void         *msg_control;    /* ancillary data, see below */\n"
3419 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3420 "    int           msg_flags;      /* flags on received message */\n"
3421 "};\n"
3422 msgstr ""
3423 "struct msghdr {\n"
3424 "    void         *msg_name;       /* 追加のアドレス */\n"
3425 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3426 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3427 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3428 "    void         *msg_control;    /* 補助データ (後述) */\n"
3429 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3430 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3431 "};\n"
3432
3433 #. type: Plain text
3434 #: build/C/man2/recv.2:340
3435 msgid ""
3436 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3437 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3438 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3439 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3440 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3441 "other protocol control-related messages or miscellaneous ancillary data.  "
3442 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3443 "the available buffer in I<msg_control>; upon return from a successful call "
3444 "it will contain the length of the control message sequence."
3445 msgstr ""
3446 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3447 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3448 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3449 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3450 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3451 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3452 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3453 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3454 "さが入っている。"
3455
3456 #. type: Plain text
3457 #: build/C/man2/recv.2:342
3458 msgid "The messages are of the form:"
3459 msgstr "メッセージの形式は以下の通り:"
3460
3461 #. type: Plain text
3462 #: build/C/man2/recv.2:352
3463 #, no-wrap
3464 msgid ""
3465 "struct cmsghdr {\n"
3466 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3467 "    int           cmsg_level;   /* originating protocol */\n"
3468 "    int           cmsg_type;    /* protocol-specific type */\n"
3469 "/* followed by\n"
3470 "    unsigned char cmsg_data[]; */\n"
3471 "};\n"
3472 msgstr ""
3473 "struct cmsghdr {\n"
3474 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3475 "    int           cmsg_level;   /* originating protocol */\n"
3476 "    int           cmsg_type;    /* protocol-specific type */\n"
3477 "/* followed by\n"
3478 "    unsigned char cmsg_data[]; */\n"
3479 "};\n"
3480
3481 #. type: Plain text
3482 #: build/C/man2/recv.2:357
3483 msgid ""
3484 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3485 msgstr ""
3486 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3487
3488 #. type: Plain text
3489 #: build/C/man2/recv.2:360
3490 msgid ""
3491 "As an example, Linux uses this ancillary data mechanism to pass extended "
3492 "errors, IP options, or file descriptors over UNIX domain sockets."
3493 msgstr ""
3494 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3495 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3496 "いる。"
3497
3498 #. type: Plain text
3499 #: build/C/man2/recv.2:368
3500 msgid ""
3501 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3502 "It can contain several flags:"
3503 msgstr ""
3504 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3505 "れる。ここにはいくつかのフラグが入る。"
3506
3507 #. type: TP
3508 #: build/C/man2/recv.2:368
3509 #, no-wrap
3510 msgid "B<MSG_EOR>"
3511 msgstr "B<MSG_EOR>"
3512
3513 #. type: Plain text
3514 #: build/C/man2/recv.2:373
3515 msgid ""
3516 "indicates end-of-record; the data returned completed a record (generally "
3517 "used with sockets of type B<SOCK_SEQPACKET>)."
3518 msgstr ""
3519 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3520 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3521
3522 #. type: TP
3523 #: build/C/man2/recv.2:373
3524 #, no-wrap
3525 msgid "B<MSG_TRUNC>"
3526 msgstr "B<MSG_TRUNC>"
3527
3528 #. type: Plain text
3529 #: build/C/man2/recv.2:377
3530 msgid ""
3531 "indicates that the trailing portion of a datagram was discarded because the "
3532 "datagram was larger than the buffer supplied."
3533 msgstr ""
3534 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3535 "た部分が捨てられたことを示す。"
3536
3537 #. type: TP
3538 #: build/C/man2/recv.2:377
3539 #, no-wrap
3540 msgid "B<MSG_CTRUNC>"
3541 msgstr "B<MSG_CTRUNC>"
3542
3543 #. type: Plain text
3544 #: build/C/man2/recv.2:381
3545 msgid ""
3546 "indicates that some control data were discarded due to lack of space in the "
3547 "buffer for ancillary data."
3548 msgstr ""
3549 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3550 "を示す。"
3551
3552 #. type: Plain text
3553 #: build/C/man2/recv.2:384
3554 msgid ""
3555 "is returned to indicate that expedited or out-of-band data were received."
3556 msgstr "速達データや帯域外データを受信したことを示す。"
3557
3558 #. type: TP
3559 #: build/C/man2/recv.2:384
3560 #, no-wrap
3561 msgid "B<MSG_ERRQUEUE>"
3562 msgstr "B<MSG_ERRQUEUE>"
3563
3564 #. type: Plain text
3565 #: build/C/man2/recv.2:388
3566 msgid ""
3567 "indicates that no data was received but an extended error from the socket "
3568 "error queue."
3569 msgstr ""
3570 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3571 "を示す。"
3572
3573 #. type: Plain text
3574 #: build/C/man2/recv.2:393
3575 msgid ""
3576 "These calls return the number of bytes received, or -1 if an error "
3577 "occurred.  The return value will be 0 when the peer has performed an orderly "
3578 "shutdown."
3579 msgstr ""
3580 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3581 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3582
3583 #. type: Plain text
3584 #: build/C/man2/recv.2:398
3585 msgid ""
3586 "These are some standard errors generated by the socket layer.  Additional "
3587 "errors may be generated and returned from the underlying protocol modules; "
3588 "see their manual pages."
3589 msgstr ""
3590 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3591 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3592 "ること。"
3593
3594 #.  Actually EAGAIN on Linux
3595 #. type: Plain text
3596 #: build/C/man2/recv.2:407
3597 msgid ""
3598 "The socket is marked nonblocking and the receive operation would block, or a "
3599 "receive timeout had been set and the timeout expired before data was "
3600 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3601 "and does not require these constants to have the same value, so a portable "
3602 "application should check for both possibilities."
3603 msgstr ""
3604 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3605 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3606 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3607 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3608 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3609
3610 #. type: Plain text
3611 #: build/C/man2/recv.2:412
3612 msgid "The argument I<sockfd> is an invalid descriptor."
3613 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3614
3615 #. type: Plain text
3616 #: build/C/man2/recv.2:416
3617 msgid ""
3618 "A remote host refused to allow the network connection (typically because it "
3619 "is not running the requested service)."
3620 msgstr ""
3621 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3622 "たサービスが起動されていないなどがある)。"
3623
3624 #. type: Plain text
3625 #: build/C/man2/recv.2:420
3626 msgid ""
3627 "The receive buffer pointer(s) point outside the process's address space."
3628 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3629
3630 #. type: Plain text
3631 #: build/C/man2/recv.2:425
3632 msgid ""
3633 "The receive was interrupted by delivery of a signal before any data were "
3634 "available; see B<signal>(7)."
3635 msgstr ""
3636 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3637
3638 #. type: Plain text
3639 #: build/C/man2/recv.2:429 build/C/man2/send.2:323
3640 msgid "Invalid argument passed."
3641 msgstr "不正な引き数が渡された。"
3642
3643 #. type: Plain text
3644 #: build/C/man2/recv.2:433
3645 msgid "Could not allocate memory for B<recvmsg>()."
3646 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3647
3648 #. type: TP
3649 #: build/C/man2/recv.2:433 build/C/man2/send.2:346
3650 #, no-wrap
3651 msgid "B<ENOTCONN>"
3652 msgstr "B<ENOTCONN>"
3653
3654 #. type: Plain text
3655 #: build/C/man2/recv.2:440
3656 msgid ""
3657 "The socket is associated with a connection-oriented protocol and has not "
3658 "been connected (see B<connect>(2)  and B<accept>(2))."
3659 msgstr ""
3660 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3661 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3662
3663 #. type: Plain text
3664 #: build/C/man2/recv.2:445
3665 msgid "The argument I<sockfd> does not refer to a socket."
3666 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3667
3668 #. type: Plain text
3669 #: build/C/man2/recv.2:448
3670 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3671 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3672
3673 #. type: Plain text
3674 #: build/C/man2/recv.2:455
3675 msgid ""
3676 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3677 "flags."
3678 msgstr ""
3679 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3680 "されている。"
3681
3682 #. type: Plain text
3683 #: build/C/man2/recv.2:471
3684 msgid ""
3685 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3686 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3687 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3688 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3689 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3690 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3691 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3692 msgstr ""
3693 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3694 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3695 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3696 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3697 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3698 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3699 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3700
3701 #.  glibc bug raised 12 Mar 2006
3702 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3703 #.  The problem is an underlying kernel issue: the size of the
3704 #.  __kernel_size_t type used to type this field varies
3705 #.  across architectures, but socklen_t is always 32 bits.
3706 #. type: Plain text
3707 #: build/C/man2/recv.2:485 build/C/man2/send.2:409
3708 msgid ""
3709 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3710 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3711 "I<size_t>."
3712 msgstr ""
3713 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3714 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3715 "ある。"
3716
3717 #. type: Plain text
3718 #: build/C/man2/recv.2:490
3719 #, fuzzy
3720 #| msgid ""
3721 #| "See B<recvmmsg(2)> for information about a Linux-specific system call "
3722 #| "that can be used to receive multiple datagrams in a single call."
3723 msgid ""
3724 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3725 "can be used to receive multiple datagrams in a single call."
3726 msgstr ""
3727 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3728 "固有の システムコールに関する情報が書かれている。"
3729
3730 #. type: Plain text
3731 #: build/C/man2/recv.2:495
3732 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3733 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3734
3735 #. type: Plain text
3736 #: build/C/man2/recv.2:506
3737 msgid ""
3738 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3739 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3740 msgstr ""
3741 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3742 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3743
3744 #. type: TH
3745 #: build/C/man2/recvmmsg.2:31
3746 #, no-wrap
3747 msgid "RECVMMSG"
3748 msgstr "RECVMMSG"
3749
3750 #. type: TH
3751 #: build/C/man2/recvmmsg.2:31
3752 #, fuzzy, no-wrap
3753 #| msgid "2012-02-27"
3754 msgid "2012-12-24"
3755 msgstr "2012-02-27"
3756
3757 #. type: Plain text
3758 #: build/C/man2/recvmmsg.2:34
3759 msgid "recvmmsg - receive multiple messages on a socket"
3760 msgstr ""
3761
3762 #. type: Plain text
3763 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3764 #, no-wrap
3765 msgid ""
3766 "B<#define _GNU_SOURCE>\n"
3767 "B<#include E<lt>sys/socket.hE<gt>>\n"
3768 msgstr ""
3769 "B<#define _GNU_SOURCE>\n"
3770 "B<#include E<lt>sys/socket.hE<gt>>\n"
3771
3772 #. type: Plain text
3773 #: build/C/man2/recvmmsg.2:41
3774 #, no-wrap
3775 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3776 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3777
3778 #. type: Plain text
3779 #: build/C/man2/recvmmsg.2:43
3780 #, no-wrap
3781 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3782 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3783
3784 #. type: Plain text
3785 #: build/C/man2/recvmmsg.2:55
3786 msgid ""
3787 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3788 "the caller to receive multiple messages from a socket using a single system "
3789 "call.  (This has performance benefits for some applications.)  A further "
3790 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3791 "operation."
3792 msgstr ""
3793
3794 #. type: Plain text
3795 #: build/C/man2/recvmmsg.2:59
3796 msgid ""
3797 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3798 "from."
3799 msgstr ""
3800
3801 #. type: Plain text
3802 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
3803 msgid ""
3804 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3805 "The size of this array is specified in I<vlen>."
3806 msgstr ""
3807
3808 #. type: Plain text
3809 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
3810 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3811 msgstr ""
3812
3813 #. type: Plain text
3814 #: build/C/man2/recvmmsg.2:80
3815 #, no-wrap
3816 msgid ""
3817 "struct mmsghdr {\n"
3818 "    struct msghdr msg_hdr;  /* Message header */\n"
3819 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3820 "};\n"
3821 msgstr ""
3822 "struct mmsghdr {\n"
3823 "    struct msghdr msg_hdr;  /* Message header */\n"
3824 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3825 "};\n"
3826
3827 #. type: Plain text
3828 #: build/C/man2/recvmmsg.2:95
3829 msgid ""
3830 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3831 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3832 "in the entry.  This field has the same value as the return value of a single "
3833 "B<recvmsg>(2)  on the header."
3834 msgstr ""
3835
3836 #. type: Plain text
3837 #: build/C/man2/recvmmsg.2:102
3838 msgid ""
3839 "The I<flags> argument contains flags ORed together.  The flags are the same "
3840 "as documented for B<recvmsg>(2), with the following addition:"
3841 msgstr ""
3842
3843 #. type: TP
3844 #: build/C/man2/recvmmsg.2:102
3845 #, fuzzy, no-wrap
3846 #| msgid "B<MSG_MORE> (Since Linux 2.4.4)"
3847 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
3848 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
3849
3850 #. type: Plain text
3851 #: build/C/man2/recvmmsg.2:107
3852 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3853 msgstr ""
3854
3855 #. type: Plain text
3856 #: build/C/man2/recvmmsg.2:123
3857 msgid ""
3858 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3859 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3860 "operation.  (This interval will be rounded up to the system clock "
3861 "granularity, and kernel scheduling delays mean that the blocking interval "
3862 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
3863 "blocks indefinitely."
3864 msgstr ""
3865
3866 #. type: Plain text
3867 #: build/C/man2/recvmmsg.2:134
3868 msgid ""
3869 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3870 "received or until the timeout expires.  A nonblocking call reads as many "
3871 "messages as are available (up to the limit specified by I<vlen>)  and "
3872 "returns immediately."
3873 msgstr ""
3874
3875 #. type: Plain text
3876 #: build/C/man2/recvmmsg.2:149
3877 msgid ""
3878 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3879 "to contain information about each received message: I<msg_len> contains the "
3880 "size of the received message; the subfields of I<msg_hdr> are updated as "
3881 "described in B<recvmsg>(2).  The return value of the call indicates the "
3882 "number of elements of I<msgvec> that have been updated."
3883 msgstr ""
3884
3885 #. type: Plain text
3886 #: build/C/man2/recvmmsg.2:157
3887 msgid ""
3888 "On success, B<recvmmsg>()  returns the number of messages received in "
3889 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3890 "error."
3891 msgstr ""
3892
3893 #. type: Plain text
3894 #: build/C/man2/recvmmsg.2:161
3895 msgid ""
3896 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3897 msgstr ""
3898
3899 #. type: Plain text
3900 #: build/C/man2/recvmmsg.2:165
3901 msgid "I<timeout> is invalid."
3902 msgstr ""
3903
3904 #. type: Plain text
3905 #: build/C/man2/recvmmsg.2:170
3906 #, fuzzy
3907 #| msgid ""
3908 #| "The B<accept4>()  system call is available starting with Linux 2.6.28; "
3909 #| "support in glibc is available starting with version 2.10."
3910 msgid ""
3911 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
3912 "was added in version 2.12."
3913 msgstr ""
3914 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
3915 "サポートはバージョン 2.10 以降で利用可能である。"
3916
3917 #. type: Plain text
3918 #: build/C/man2/recvmmsg.2:173
3919 msgid "B<recvmmsg>()  is Linux-specific."
3920 msgstr ""
3921
3922 #. type: Plain text
3923 #: build/C/man2/recvmmsg.2:181
3924 msgid ""
3925 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
3926 "socket and stores them in multiple buffers.  The call returns if all buffers "
3927 "are filled or if the timeout specified has expired."
3928 msgstr ""
3929
3930 #. type: Plain text
3931 #: build/C/man2/recvmmsg.2:184
3932 msgid ""
3933 "The following snippet periodically generates UDP datagrams containing a "
3934 "random number:"
3935 msgstr ""
3936
3937 #. type: Plain text
3938 #: build/C/man2/recvmmsg.2:189
3939 #, no-wrap
3940 msgid ""
3941 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
3942 "B<sleep 0.25; done>\n"
3943 msgstr ""
3944
3945 #. type: Plain text
3946 #: build/C/man2/recvmmsg.2:194
3947 msgid ""
3948 "These datagrams are read by the example application, which can give the "
3949 "following output:"
3950 msgstr ""
3951
3952 #. type: Plain text
3953 #: build/C/man2/recvmmsg.2:204
3954 #, no-wrap
3955 msgid ""
3956 "$B< ./a.out>\n"
3957 "5 messages received\n"
3958 "1 11782\n"
3959 "2 11345\n"
3960 "3 304\n"
3961 "4 13514\n"
3962 "5 28421\n"
3963 msgstr ""
3964
3965 #. type: Plain text
3966 #: build/C/man2/recvmmsg.2:215
3967 #, fuzzy, no-wrap
3968 #| msgid ""
3969 #| "#include E<lt>sys/socket.hE<gt>\n"
3970 #| "#include E<lt>sys/un.hE<gt>\n"
3971 #| "#include E<lt>stdlib.hE<gt>\n"
3972 #| "#include E<lt>stdio.hE<gt>\n"
3973 #| "#include E<lt>string.hE<gt>\n"
3974 msgid ""
3975 "#define _GNU_SOURCE\n"
3976 "#include E<lt>netinet/ip.hE<gt>\n"
3977 "#include E<lt>stdio.hE<gt>\n"
3978 "#include E<lt>stdlib.hE<gt>\n"
3979 "#include E<lt>string.hE<gt>\n"
3980 "#include E<lt>sys/socket.hE<gt>\n"
3981 msgstr ""
3982 "#include E<lt>sys/socket.hE<gt>\n"
3983 "#include E<lt>sys/un.hE<gt>\n"
3984 "#include E<lt>stdlib.hE<gt>\n"
3985 "#include E<lt>stdio.hE<gt>\n"
3986 "#include E<lt>string.hE<gt>\n"
3987
3988 #. type: Plain text
3989 #: build/C/man2/recvmmsg.2:228
3990 #, no-wrap
3991 msgid ""
3992 "int\n"
3993 "main(void)\n"
3994 "{\n"
3995 "#define VLEN 10\n"
3996 "#define BUFSIZE 200\n"
3997 "#define TIMEOUT 1\n"
3998 "    int sockfd, retval, i;\n"
3999 "    struct sockaddr_in sa;\n"
4000 "    struct mmsghdr msgs[VLEN];\n"
4001 "    struct iovec iovecs[VLEN];\n"
4002 "    char bufs[VLEN][BUFSIZE+1];\n"
4003 "    struct timespec timeout;\n"
4004 msgstr ""
4005
4006 #. type: Plain text
4007 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4008 #, fuzzy, no-wrap
4009 #| msgid ""
4010 #| "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
4011 #| "    if (sfd == -1)\n"
4012 #| "        handle_error(\"socket\");\n"
4013 msgid ""
4014 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4015 "    if (sockfd == -1) {\n"
4016 "        perror(\"socket()\");\n"
4017 "        exit(EXIT_FAILURE);\n"
4018 "    }\n"
4019 msgstr ""
4020 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
4021 "    if (sfd == -1)\n"
4022 "        handle_error(\"socket\");\n"
4023
4024 #. type: Plain text
4025 #: build/C/man2/recvmmsg.2:242
4026 #, fuzzy, no-wrap
4027 #| msgid ""
4028 #| "    sa.sa_flags = 0;\n"
4029 #| "    sa.sa_handler = child_sig_handler;\n"
4030 #| "    sigemptyset(&sa.sa_mask);\n"
4031 #| "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4032 #| "        perror(\"sigaction\");\n"
4033 #| "        exit(EXIT_FAILURE);\n"
4034 #| "    }\n"
4035 msgid ""
4036 "    sa.sin_family = AF_INET;\n"
4037 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4038 "    sa.sin_port = htons(1234);\n"
4039 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4040 "        perror(\"bind()\");\n"
4041 "        exit(EXIT_FAILURE);\n"
4042 "    }\n"
4043 msgstr ""
4044 "    sa.sa_flags = 0;\n"
4045 "    sa.sa_handler = child_sig_handler;\n"
4046 "    sigemptyset(&sa.sa_mask);\n"
4047 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4048 "        perror(\"sigaction\");\n"
4049 "        exit(EXIT_FAILURE);\n"
4050 "    }\n"
4051
4052 #. type: Plain text
4053 #: build/C/man2/recvmmsg.2:250
4054 #, no-wrap
4055 msgid ""
4056 "    memset(msgs, 0, sizeof(msgs));\n"
4057 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4058 "        iovecs[i].iov_base         = bufs[i];\n"
4059 "        iovecs[i].iov_len          = BUFSIZE;\n"
4060 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4061 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4062 "    }\n"
4063 msgstr ""
4064
4065 #. type: Plain text
4066 #: build/C/man2/recvmmsg.2:253
4067 #, fuzzy, no-wrap
4068 #| msgid ""
4069 #| "    /* Wait up to five seconds. */\n"
4070 #| "    tv.tv_sec = 5;\n"
4071 #| "    tv.tv_usec = 0;\n"
4072 msgid ""
4073 "    timeout.tv_sec = TIMEOUT;\n"
4074 "    timeout.tv_nsec = 0;\n"
4075 msgstr ""
4076 "    /* 5 秒間監視する。*/\n"
4077 "    tv.tv_sec = 5;\n"
4078 "    tv.tv_usec = 0;\n"
4079
4080 #. type: Plain text
4081 #: build/C/man2/recvmmsg.2:259
4082 #, fuzzy, no-wrap
4083 #| msgid ""
4084 #| "        if (r == -1) {\n"
4085 #| "            perror(\"select()\");\n"
4086 #| "            exit(EXIT_FAILURE);\n"
4087 #| "        }\n"
4088 msgid ""
4089 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4090 "    if (retval == -1) {\n"
4091 "        perror(\"recvmmsg()\");\n"
4092 "        exit(EXIT_FAILURE);\n"
4093 "    }\n"
4094 msgstr ""
4095 "        if (r == -1) {\n"
4096 "            perror(\"select()\");\n"
4097 "            exit(EXIT_FAILURE);\n"
4098 "        }\n"
4099
4100 #. type: Plain text
4101 #: build/C/man2/recvmmsg.2:267
4102 #, no-wrap
4103 msgid ""
4104 "    printf(\"%d messages received\\en\", retval);\n"
4105 "    for (i = 0; i E<lt> retval; i++) {\n"
4106 "        bufs[i][msgs[i].msg_len] = 0;\n"
4107 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4108 "    }\n"
4109 "    exit(EXIT_SUCCESS);\n"
4110 "}\n"
4111 msgstr ""
4112
4113 #. type: Plain text
4114 #: build/C/man2/recvmmsg.2:275
4115 msgid ""
4116 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4117 "(2), B<socket>(7)"
4118 msgstr ""
4119 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4120 "(2), B<socket>(7)"
4121
4122 #. type: TH
4123 #: build/C/man2/select.2:38
4124 #, no-wrap
4125 msgid "SELECT"
4126 msgstr "SELECT"
4127
4128 #. type: TH
4129 #: build/C/man2/select.2:38
4130 #, fuzzy, no-wrap
4131 #| msgid "2012-02-27"
4132 msgid "2012-08-17"
4133 msgstr "2012-02-27"
4134
4135 #. type: Plain text
4136 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4137 msgid ""
4138 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4139 "multiplexing"
4140 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4141
4142 #. type: Plain text
4143 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4144 #, no-wrap
4145 msgid "/* According to POSIX.1-2001 */\n"
4146 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4147
4148 #. type: Plain text
4149 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4150 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4151 #, no-wrap
4152 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4153 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4154
4155 #. type: Plain text
4156 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4157 #, no-wrap
4158 msgid "/* According to earlier standards */\n"
4159 msgstr "/* 以前の規格に従う場合 */\n"
4160
4161 #. type: Plain text
4162 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4163 #, no-wrap
4164 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4165 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4166
4167 #. type: Plain text
4168 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4169 #, no-wrap
4170 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4171 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4172
4173 #. type: Plain text
4174 #: build/C/man2/select.2:58
4175 #, no-wrap
4176 msgid ""
4177 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4178 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4179 msgstr ""
4180 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4181 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4182
4183 #. type: Plain text
4184 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4185 #, no-wrap
4186 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4187 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4188
4189 #. type: Plain text
4190 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4191 #, no-wrap
4192 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4193 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4194
4195 #. type: Plain text
4196 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4197 #, no-wrap
4198 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4199 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4200
4201 #. type: Plain text
4202 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4203 #, no-wrap
4204 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4205 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4206
4207 #. type: Plain text
4208 #: build/C/man2/select.2:72
4209 #, no-wrap
4210 msgid ""
4211 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4212 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4213 "B<            const sigset_t *>I<sigmask>B<);>\n"
4214 msgstr ""
4215 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4216 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4217 "B<            const sigset_t *>I<sigmask>B<);>\n"
4218
4219 #. type: Plain text
4220 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4221 #: build/C/man3/sockatmark.3:36
4222 msgid ""
4223 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4224 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4225
4226 #. type: Plain text
4227 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4228 msgid ""
4229 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4230 "600"
4231 msgstr ""
4232 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4233 "600"
4234
4235 #. type: Plain text
4236 #: build/C/man2/select.2:92
4237 msgid ""
4238 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4239 "descriptors, waiting until one or more of the file descriptors become \"ready"
4240 "\" for some class of I/O operation (e.g., input possible).  A file "
4241 "descriptor is considered ready if it is possible to perform the "
4242 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4243 msgstr ""
4244 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4245 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4246 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4247 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4248 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4249 "意味する。"
4250
4251 #. type: Plain text
4252 #: build/C/man2/select.2:98
4253 #, fuzzy
4254 #| msgid ""
4255 #| "The operation of B<select>()  and B<pselect>()  is identical, with three "
4256 #| "differences:"
4257 msgid ""
4258 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4259 "these three differences:"
4260 msgstr ""
4261 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4262
4263 #. type: TP
4264 #: build/C/man2/select.2:98
4265 #, no-wrap
4266 msgid "(i)"
4267 msgstr "(i)"
4268
4269 #. type: Plain text
4270 #: build/C/man2/select.2:108
4271 msgid ""
4272 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4273 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4274 "and nanoseconds)."
4275 msgstr ""
4276 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4277 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4278 "timespec> (秒・ナノ秒単位) を用いる。"
4279
4280 #. type: TP
4281 #: build/C/man2/select.2:108
4282 #, no-wrap
4283 msgid "(ii)"
4284 msgstr "(ii)"
4285
4286 #. type: Plain text
4287 #: build/C/man2/select.2:116
4288 msgid ""
4289 "B<select>()  may update the I<timeout> argument to indicate how much time "
4290 "was left.  B<pselect>()  does not change this argument."
4291 msgstr ""
4292 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4293 "B<pselect>()  はこの引き数を変更しない。"
4294
4295 #. type: TP
4296 #: build/C/man2/select.2:116
4297 #, no-wrap
4298 msgid "(iii)"
4299 msgstr "(iii)"
4300
4301 #. type: Plain text
4302 #: build/C/man2/select.2:125
4303 msgid ""
4304 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4305 "with NULL I<sigmask>."
4306 msgstr ""
4307 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4308 "指定した場合の B<pselect>()  と同じである。"
4309
4310 #. type: Plain text
4311 #: build/C/man2/select.2:143
4312 msgid ""
4313 "Three independent sets of file descriptors are watched.  Those listed in "
4314 "I<readfds> will be watched to see if characters become available for reading "
4315 "(more precisely, to see if a read will not block; in particular, a file "
4316 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4317 "watched to see if a write will not block, and those in I<exceptfds> will be "
4318 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4319 "which file descriptors actually changed status.  Each of the three file "
4320 "descriptor sets may be specified as NULL if no file descriptors are to be "
4321 "watched for the corresponding class of events."
4322 msgstr ""
4323 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4324 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4325 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4326 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4327 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4328 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4329 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4330 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4331 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4332 "指定することができる。"
4333
4334 #. type: Plain text
4335 #: build/C/man2/select.2:156
4336 msgid ""
4337 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4338 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4339 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4340 "part of the set; this is useful after B<select>()  returns."
4341 msgstr ""
4342 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4343 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4344 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4345 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4346 "る。"
4347
4348 #. type: Plain text
4349 #: build/C/man2/select.2:159
4350 msgid ""
4351 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4352 "plus 1."
4353 msgstr ""
4354 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4355 "のである。"
4356
4357 #. type: Plain text
4358 #: build/C/man2/select.2:179
4359 msgid ""
4360 "The I<timeout> argument specifies the minimum interval that B<select>()  "
4361 "should block waiting for a file descriptor to become ready.  (This interval "
4362 "will be rounded up to the system clock granularity, and kernel scheduling "
4363 "delays mean that the blocking interval may overrun by a small amount.)  If "
4364 "both fields of the I<timeval> structure are zero, then B<select>()  returns "
4365 "immediately.  (This is useful for polling.)  If I<timeout> is NULL (no "
4366 "timeout), B<select>()  can block indefinitely."
4367 msgstr ""
4368 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4369 "B<select>() が停止する最小の停止時間を指定する\n"
4370 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4371 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4372 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4373 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4374 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4375 "期限に停止 (block) する。"
4376
4377 #. type: Plain text
4378 #: build/C/man2/select.2:189
4379 msgid ""
4380 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4381 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4382 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4383 "restores the original signal mask."
4384 msgstr ""
4385 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4386 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4387 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4388 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4389
4390 #. type: Plain text
4391 #: build/C/man2/select.2:195
4392 msgid ""
4393 "Other than the difference in the precision of the I<timeout> argument, the "
4394 "following B<pselect>()  call:"
4395 msgstr ""
4396 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4397
4398 #. type: Plain text
4399 #: build/C/man2/select.2:199
4400 #, no-wrap
4401 msgid ""
4402 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4403 "                    timeout, &sigmask);\n"
4404 msgstr ""
4405 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4406 "                    timeout, &sigmask);\n"
4407
4408 #. type: Plain text
4409 #: build/C/man2/select.2:204
4410 msgid "is equivalent to I<atomically> executing the following calls:"
4411 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4412
4413 #. type: Plain text
4414 #: build/C/man2/select.2:207
4415 #, no-wrap
4416 msgid "    sigset_t origmask;\n"
4417 msgstr "    sigset_t origmask;\n"
4418
4419 #. type: Plain text
4420 #: build/C/man2/select.2:211
4421 #, fuzzy, no-wrap
4422 #| msgid ""
4423 #| "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
4424 #| "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4425 #| "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
4426 msgid ""
4427 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4428 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4429 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4430 msgstr ""
4431 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
4432 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4433 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
4434
4435 #. type: Plain text
4436 #: build/C/man2/select.2:232
4437 msgid ""
4438 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4439 "either a signal or for a file descriptor to become ready, then an atomic "
4440 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4441 "a global flag and returns.  Then a test of this global flag followed by a "
4442 "call of B<select>()  could hang indefinitely if the signal arrived just "
4443 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4444 "one to first block signals, handle the signals that have come in, then call "
4445 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4446 msgstr ""
4447 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4448 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4449 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4450 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4451 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4452 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4453 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4454 "で、前記の競合を避けることができる。)"
4455
4456 #. type: SS
4457 #: build/C/man2/select.2:232
4458 #, no-wrap
4459 msgid "The timeout"
4460 msgstr "タイムアウト"
4461
4462 #. type: Plain text
4463 #: build/C/man2/select.2:236
4464 msgid ""
4465 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4466 "like"
4467 msgstr ""
4468 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4469
4470 #. type: Plain text
4471 #: build/C/man2/select.2:243
4472 #, no-wrap
4473 msgid ""
4474 "struct timeval {\n"
4475 "    long    tv_sec;         /* seconds */\n"
4476 "    long    tv_usec;        /* microseconds */\n"
4477 "};\n"
4478 msgstr ""
4479 "struct timeval {\n"
4480 "    long    tv_sec;         /* 秒 */\n"
4481 "    long    tv_usec;        /* マイクロ秒 */\n"
4482 "};\n"
4483
4484 #. type: Plain text
4485 #: build/C/man2/select.2:247
4486 msgid "and"
4487 msgstr "や"
4488
4489 #. type: Plain text
4490 #: build/C/man2/select.2:254
4491 #, no-wrap
4492 msgid ""
4493 "struct timespec {\n"
4494 "    long    tv_sec;         /* seconds */\n"
4495 "    long    tv_nsec;        /* nanoseconds */\n"
4496 "};\n"
4497 msgstr ""
4498 "struct timespec {\n"
4499 "    long    tv_sec;         /* 秒 */\n"
4500 "    long    tv_nsec;        /* ナノ秒 */\n"
4501 "};\n"
4502
4503 #. type: Plain text
4504 #: build/C/man2/select.2:258
4505 msgid "(However, see below on the POSIX.1-2001 versions.)"
4506 msgstr ""
4507 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4508 "照)"
4509
4510 #. type: Plain text
4511 #: build/C/man2/select.2:266
4512 msgid ""
4513 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4514 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4515 "precision."
4516 msgstr ""
4517 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4518 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4519 "呼び出すという方法を使っているコードもある。"
4520
4521 #.  .PP - it is rumored that:
4522 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4523 #.  - it is certainly true that:
4524 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4525 #. type: Plain text
4526 #: build/C/man2/select.2:289
4527 msgid ""
4528 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4529 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4530 "either behavior.)  This causes problems both when Linux code which reads "
4531 "I<timeout> is ported to other operating systems, and when code is ported to "
4532 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4533 "without reinitializing it.  Consider I<timeout> to be undefined after "
4534 "B<select>()  returns."
4535 msgstr ""
4536 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4537 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4538 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4539 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4540 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4541 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4542 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4543 "ある。"
4544
4545 #. type: Plain text
4546 #: build/C/man2/select.2:306
4547 msgid ""
4548 "On success, B<select>()  and B<pselect>()  return the number of file "
4549 "descriptors contained in the three returned descriptor sets (that is, the "
4550 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4551 "which may be zero if the timeout expires before anything interesting "
4552 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4553 "sets and I<timeout> become undefined, so do not rely on their contents after "
4554 "an error."
4555 msgstr ""
4556 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4557 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4558 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4559 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4560 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4561 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4562
4563 #. type: Plain text
4564 #: build/C/man2/select.2:312
4565 msgid ""
4566 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4567 "descriptor that was already closed, or one on which an error has occurred.)"
4568 msgstr ""
4569 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4570 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4571 "タが指定された)。"
4572
4573 #. type: Plain text
4574 #: build/C/man2/select.2:316
4575 msgid "A signal was caught; see B<signal>(7)."
4576 msgstr "シグナルを受信した。"
4577
4578 #. type: Plain text
4579 #: build/C/man2/select.2:322
4580 msgid ""
4581 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4582 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4583
4584 #. type: Plain text
4585 #: build/C/man2/select.2:325
4586 msgid "unable to allocate memory for internal tables."
4587 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4588
4589 #. type: Plain text
4590 #: build/C/man2/select.2:331
4591 msgid ""
4592 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4593 "()  was emulated in glibc (but see BUGS)."
4594 msgstr ""
4595 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4596 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4597
4598 #. type: Plain text
4599 #: build/C/man2/select.2:342
4600 msgid ""
4601 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4602 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4603 "clones of the BSD socket layer (including System V variants).  However, note "
4604 "that the System V variant typically sets the timeout variable before exit, "
4605 "but the BSD variant does not."
4606 msgstr ""
4607 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4608 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4609 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4610 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4611 "ること。"
4612
4613 #. type: Plain text
4614 #: build/C/man2/select.2:346
4615 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4616 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4617
4618 #. type: Plain text
4619 #: build/C/man2/select.2:363
4620 msgid ""
4621 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4622 "with a value of I<fd> that is negative or is equal to or larger than "
4623 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4624 "I<fd> to be a valid file descriptor."
4625 msgstr ""
4626 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4627 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4628 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4629 "プタでなければならないと規定されている。"
4630
4631 #. type: Plain text
4632 #: build/C/man2/select.2:372
4633 msgid ""
4634 "Concerning the types involved, the classical situation is that the two "
4635 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4636 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4637 "situation is"
4638 msgstr ""
4639 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4640 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4641 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4642
4643 #. type: Plain text
4644 #: build/C/man2/select.2:379
4645 #, no-wrap
4646 msgid ""
4647 "struct timeval {\n"
4648 "    time_t         tv_sec;     /* seconds */\n"
4649 "    suseconds_t    tv_usec;    /* microseconds */\n"
4650 "};\n"
4651 msgstr ""
4652 "struct timeval {\n"
4653 "\t time_t         tv_sec;     /* 秒 */\n"
4654 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4655 "};\n"
4656
4657 #. type: Plain text
4658 #: build/C/man2/select.2:390
4659 msgid ""
4660 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4661 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4662 msgstr ""
4663 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4664 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4665
4666 #. type: Plain text
4667 #: build/C/man2/select.2:402
4668 msgid ""
4669 "Concerning prototypes, the classical situation is that one should include "
4670 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4671 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4672 msgstr ""
4673 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4674 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4675 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4676 "インクルードすればよい。"
4677
4678 #. type: Plain text
4679 #: build/C/man2/select.2:414
4680 msgid ""
4681 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4682 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4683 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4684 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4685 "requirements are as shown in the SYNOPSIS."
4686 msgstr ""
4687 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4688 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4689 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4690 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4691 "使用するには、「書式」に記載された要件を満たす必要がある。"
4692
4693 #. type: SS
4694 #: build/C/man2/select.2:414
4695 #, no-wrap
4696 msgid "Multithreaded applications"
4697 msgstr ""
4698
4699 #. type: Plain text
4700 #: build/C/man2/select.2:430
4701 msgid ""
4702 "If a file descriptor being monitored by B<select>()  is closed in another "
4703 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
4704 "unblocks and returns, with an indication that the file descriptor is ready "
4705 "(a subsequent I/O operation will likely fail with an error, unless another "
4706 "the file descriptor reopened between the time B<select>()  returned and the "
4707 "I/O operations was performed).  On Linux (and some other systems), closing "
4708 "the file descriptor in another thread has no effect on B<select>().  In "
4709 "summary, any application that relies on a particular behavior in this "
4710 "scenario must be considered buggy."
4711 msgstr ""
4712
4713 #. type: SS
4714 #: build/C/man2/select.2:430
4715 #, fuzzy, no-wrap
4716 #| msgid "Linux Notes"
4717 msgid "Linux notes"
4718 msgstr "Linux での注意"
4719
4720 #. type: Plain text
4721 #: build/C/man2/select.2:438
4722 #, fuzzy
4723 #| msgid ""
4724 #| "The B<pselect>()  interface described in this page is implemented by "
4725 #| "glibc.  The underlying Linux system call is named B<pselect6>().  This "
4726 #| "system call has somewhat different behavior from the gibc wrapper "
4727 #| "function."
4728 msgid ""
4729 "The B<pselect>()  interface described in this page is implemented by glibc.  "
4730 "The underlying Linux system call is named B<pselect6>().  This system call "
4731 "has somewhat different behavior from the glibc wrapper function."
4732 msgstr ""
4733 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4734 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
4735 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
4736 "関数とは少し違った動作をする。"
4737
4738 #. type: Plain text
4739 #: build/C/man2/select.2:453
4740 msgid ""
4741 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
4742 "However, the glibc wrapper function hides this behavior by using a local "
4743 "variable for the timeout argument that is passed to the system call.  Thus, "
4744 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
4745 "this is the behavior required by POSIX.1-2001."
4746 msgstr ""
4747 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
4748 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
4749 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
4750 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
4751 "これが POSIX.1-2001 が要求している動作である。"
4752
4753 #. type: Plain text
4754 #: build/C/man2/select.2:459
4755 #, fuzzy
4756 #| msgid ""
4757 #| "The final argument of the B<pselect6()> system call is not a I<sigset_t\\ "
4758 #| "*> pointer, but is instead a structure of the form:"
4759 msgid ""
4760 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
4761 "*> pointer, but is instead a structure of the form:"
4762 msgstr ""
4763 "B<pselect6>() システムコールの最後の引き数はI<sigset_t\\ *> 型の\n"
4764 "ポインタではなく、以下に示す構造体である。"
4765
4766 #. type: Plain text
4767 #: build/C/man2/select.2:467
4768 #, no-wrap
4769 msgid ""
4770 "struct {\n"
4771 "    const sigset_t *ss;     /* Pointer to signal set */\n"
4772 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
4773 "                               to by 'ss' */\n"
4774 "};\n"
4775 msgstr ""
4776 "struct {\n"
4777 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
4778 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
4779 "                               (バイト数) */\n"
4780 "};\n"
4781
4782 #. type: Plain text
4783 #: build/C/man2/select.2:474
4784 msgid ""
4785 "This allows the system call to obtain both a pointer to the signal set and "
4786 "its size, while allowing for the fact that most architectures support a "
4787 "maximum of 6 arguments to a system call."
4788 msgstr ""
4789 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
4790 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
4791 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
4792 "のサイズの両方を取得することができるのである。"
4793
4794 #. type: Plain text
4795 #: build/C/man2/select.2:480
4796 msgid ""
4797 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4798 "argument."
4799 msgstr ""
4800 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4801 "されていた。"
4802
4803 #. type: Plain text
4804 #: build/C/man2/select.2:493
4805 msgid ""
4806 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4807 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4808 "implementation remained vulnerable to the very race condition that B<pselect>"
4809 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4810 "B<pselect>()  system call on kernels where it is provided."
4811 msgstr ""
4812 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4813 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4814 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4815 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4816 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4817 "が使用される。"
4818
4819 #. type: Plain text
4820 #: build/C/man2/select.2:506
4821 msgid ""
4822 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4823 "trapping can be achieved using the self-pipe trick.  In this technique, a "
4824 "signal handler writes a byte to a pipe whose other end is monitored by "
4825 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
4826 "to a pipe that may be full or reading from a pipe that may be empty, "
4827 "nonblocking I/O is used when reading from and writing to the pipe.)"
4828 msgstr ""
4829 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
4830 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
4831 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
4832 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
4833 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
4834 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
4835 "(nonblocking) I/O を使用するとよい)。"
4836
4837 #.  Stevens discusses a case where accept can block after select
4838 #.  returns successfully because of an intervening RST from the client.
4839 #.  Maybe the kernel should have returned EIO in such a situation?
4840 #. type: Plain text
4841 #: build/C/man2/select.2:522
4842 msgid ""
4843 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4844 "reading\", while nevertheless a subsequent read blocks.  This could for "
4845 "example happen when data has arrived but upon examination has wrong checksum "
4846 "and is discarded.  There may be other circumstances in which a file "
4847 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4848 "B<O_NONBLOCK> on sockets that should not block."
4849 msgstr ""
4850 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4851 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4852 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4853 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4854 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4855 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4856
4857 #. type: Plain text
4858 #: build/C/man2/select.2:537
4859 msgid ""
4860 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4861 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4862 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4863 "behavior, but the glibc wrapper hides this behavior by internally copying "
4864 "the I<timeout> to a local variable and passing that variable to the system "
4865 "call."
4866 msgstr ""
4867 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4868 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4869 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4870 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4871 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4872 "数をシステムコールに渡している。"
4873
4874 #. type: Plain text
4875 #: build/C/man2/select.2:544
4876 #, no-wrap
4877 msgid ""
4878 "#include E<lt>stdio.hE<gt>\n"
4879 "#include E<lt>stdlib.hE<gt>\n"
4880 "#include E<lt>sys/time.hE<gt>\n"
4881 "#include E<lt>sys/types.hE<gt>\n"
4882 "#include E<lt>unistd.hE<gt>\n"
4883 msgstr ""
4884 "#include E<lt>stdio.hE<gt>\n"
4885 "#include E<lt>stdlib.hE<gt>\n"
4886 "#include E<lt>sys/time.hE<gt>\n"
4887 "#include E<lt>sys/types.hE<gt>\n"
4888 "#include E<lt>unistd.hE<gt>\n"
4889
4890 #. type: Plain text
4891 #: build/C/man2/select.2:551
4892 #, no-wrap
4893 msgid ""
4894 "int\n"
4895 "main(void)\n"
4896 "{\n"
4897 "    fd_set rfds;\n"
4898 "    struct timeval tv;\n"
4899 "    int retval;\n"
4900 msgstr ""
4901 "int\n"
4902 "main(void)\n"
4903 "{\n"
4904 "    fd_set rfds;\n"
4905 "    struct timeval tv;\n"
4906 "    int retval;\n"
4907
4908 #. type: Plain text
4909 #: build/C/man2/select.2:555
4910 #, no-wrap
4911 msgid ""
4912 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4913 "    FD_ZERO(&rfds);\n"
4914 "    FD_SET(0, &rfds);\n"
4915 msgstr ""
4916 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4917 "    FD_ZERO(&rfds);\n"
4918 "    FD_SET(0, &rfds);\n"
4919
4920 #. type: Plain text
4921 #: build/C/man2/select.2:559
4922 #, no-wrap
4923 msgid ""
4924 "    /* Wait up to five seconds. */\n"
4925 "    tv.tv_sec = 5;\n"
4926 "    tv.tv_usec = 0;\n"
4927 msgstr ""
4928 "    /* 5 秒間監視する。*/\n"
4929 "    tv.tv_sec = 5;\n"
4930 "    tv.tv_usec = 0;\n"
4931
4932 #. type: Plain text
4933 #: build/C/man2/select.2:562
4934 #, no-wrap
4935 msgid ""
4936 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4937 "    /* Don't rely on the value of tv now! */\n"
4938 msgstr ""
4939 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4940 "    /* この時点での tv の値を信頼してはならない。*/\n"
4941
4942 #. type: Plain text
4943 #: build/C/man2/select.2:570
4944 #, no-wrap
4945 msgid ""
4946 "    if (retval == -1)\n"
4947 "        perror(\"select()\");\n"
4948 "    else if (retval)\n"
4949 "        printf(\"Data is available now.\\en\");\n"
4950 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4951 "    else\n"
4952 "        printf(\"No data within five seconds.\\en\");\n"
4953 msgstr ""
4954 "    if (retval == -1)\n"
4955 "\tperror(\"select()\");\n"
4956 "    else if (retval)\n"
4957 "        printf(\"今、データが取得できました。\\en\");\n"
4958 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4959 "    else\n"
4960 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4961
4962 #. type: Plain text
4963 #: build/C/man2/select.2:585
4964 #, fuzzy
4965 #| msgid ""
4966 #| "For vaguely related stuff, see B<accept>(2), B<connect>(2), B<poll>(2), "
4967 #| "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
4968 #| "B<epoll>(7), B<time>(7)"
4969 msgid ""
4970 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
4971 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
4972 msgstr ""
4973 "関係がありそうなものを挙げておく: B<accept>(2), B<connect>(2), B<poll>(2), "
4974 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4975 "(7), B<time>(7)"
4976
4977 #. type: Plain text
4978 #: build/C/man2/select.2:588
4979 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4980 msgstr ""
4981 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
4982
4983 #. type: TH
4984 #: build/C/man2/select_tut.2:32
4985 #, no-wrap
4986 msgid "SELECT_TUT"
4987 msgstr "SELECT_TUT"
4988
4989 #. type: TH
4990 #: build/C/man2/select_tut.2:32
4991 #, fuzzy, no-wrap
4992 #| msgid "2012-05-02"
4993 msgid "2012-08-03"
4994 msgstr "2012-05-02"
4995
4996 #. type: Plain text
4997 #: build/C/man2/select_tut.2:52
4998 #, no-wrap
4999 msgid ""
5000 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5001 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5002 msgstr ""
5003 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5004 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5005
5006 #. type: Plain text
5007 #: build/C/man2/select_tut.2:66
5008 #, no-wrap
5009 msgid ""
5010 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5011 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5012 "B<            const sigset_t *>I<sigmask>B<);>\n"
5013 msgstr ""
5014 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5015 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5016 "B<            const sigset_t *>I<sigmask>B<);>\n"
5017
5018 #. type: Plain text
5019 #: build/C/man2/select_tut.2:83
5020 msgid ""
5021 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5022 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5023 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5024 "occurred on any of the descriptors."
5025 msgstr ""
5026 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5027 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5028 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5029 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5030 "る。"
5031
5032 #. type: Plain text
5033 #: build/C/man2/select_tut.2:108
5034 msgid ""
5035 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5036 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5037 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5038 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5039 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5040 "according to the rules described below; after calling B<select>()  you can "
5041 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5042 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5043 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5044 "descriptor from a set."
5045 msgstr ""
5046 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5047 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5048 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5049 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5050 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5051 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5052 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5053 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5054 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5055 "のファイルディスクリプタの削除を行う。"
5056
5057 #. type: SS
5058 #: build/C/man2/select_tut.2:108
5059 #, no-wrap
5060 msgid "Arguments"
5061 msgstr "引き数"
5062
5063 #. type: TP
5064 #: build/C/man2/select_tut.2:109
5065 #, no-wrap
5066 msgid "I<readfds>"
5067 msgstr "I<readfds>"
5068
5069 #. type: Plain text
5070 #: build/C/man2/select_tut.2:118
5071 msgid ""
5072 "This set is watched to see if data is available for reading from any of its "
5073 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5074 "cleared of all file descriptors except for those that are immediately "
5075 "available for reading."
5076 msgstr ""
5077 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5078 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5079 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5080
5081 #. type: TP
5082 #: build/C/man2/select_tut.2:118
5083 #, no-wrap
5084 msgid "I<writefds>"
5085 msgstr "I<writefds>"
5086
5087 #. type: Plain text
5088 #: build/C/man2/select_tut.2:127
5089 msgid ""
5090 "This set is watched to see if there is space to write data to any of its "
5091 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5092 "cleared of all file descriptors except for those that are immediately "
5093 "available for writing."
5094 msgstr ""
5095 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5096 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5097 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5098
5099 #. type: TP
5100 #: build/C/man2/select_tut.2:127
5101 #, no-wrap
5102 msgid "I<exceptfds>"
5103 msgstr "I<exceptfds>"
5104
5105 #. type: Plain text
5106 #: build/C/man2/select_tut.2:149
5107 msgid ""
5108 "This set is watched for \"exceptional conditions\".  In practice, only one "
5109 "such exceptional condition is common: the availability of I<out-of-band> "
5110 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5111 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5112 "where B<select>(2)  indicates an exceptional condition occurs with "
5113 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5114 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5115 "for those for which an exceptional condition has occurred."
5116 msgstr ""
5117 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5118 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5119 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5120 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5121 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5122 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5123 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5124 "状態が発生したディスクリプタ以外は集合から削除される。"
5125
5126 #. type: TP
5127 #: build/C/man2/select_tut.2:149
5128 #, no-wrap
5129 msgid "I<nfds>"
5130 msgstr "I<nfds>"
5131
5132 #. type: Plain text
5133 #: build/C/man2/select_tut.2:156
5134 msgid ""
5135 "This is an integer one more than the maximum of any file descriptor in any "
5136 "of the sets.  In other words, while adding file descriptors to each of the "
5137 "sets, you must calculate the maximum integer value of all of them, then "
5138 "increment this value by one, and then pass this as I<nfds>."
5139 msgstr ""
5140 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5141 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5142 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5143 "I<nfds> として渡さないといけない、ということだ。"
5144
5145 #. type: TP
5146 #: build/C/man2/select_tut.2:156
5147 #, no-wrap
5148 msgid "I<utimeout>"
5149 msgstr "I<utimeout>"
5150
5151 #. type: Plain text
5152 #: build/C/man2/select_tut.2:169
5153 msgid ""
5154 "This is the longest time B<select>()  may wait before returning, even if "
5155 "nothing interesting happened.  If this value is passed as NULL, then "
5156 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5157 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5158 "return immediately, with information about the readiness of file descriptors "
5159 "at the time of the call.  The structure I<struct timeval> is defined as:"
5160 msgstr ""
5161 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5162 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5163 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5164 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5165 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5166 "ように定義されている:"
5167
5168 #. type: Plain text
5169 #: build/C/man2/select_tut.2:176
5170 #, no-wrap
5171 msgid ""
5172 "struct timeval {\n"
5173 "    time_t tv_sec;    /* seconds */\n"
5174 "    long tv_usec;     /* microseconds */\n"
5175 "};\n"
5176 msgstr ""
5177 "struct timeval {\n"
5178 "    time_t tv_sec;    /* seconds */\n"
5179 "    long tv_usec;     /* microseconds */\n"
5180 "};\n"
5181
5182 #. type: TP
5183 #: build/C/man2/select_tut.2:178
5184 #, no-wrap
5185 msgid "I<ntimeout>"
5186 msgstr "I<ntimeout>"
5187
5188 #. type: Plain text
5189 #: build/C/man2/select_tut.2:187
5190 msgid ""
5191 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5192 "I<struct timespec> has nanosecond precision as follows:"
5193 msgstr ""
5194 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5195 "timespec> は次に示すようにナノ秒の精度を持つ。"
5196
5197 #. type: Plain text
5198 #: build/C/man2/select_tut.2:194
5199 #, no-wrap
5200 msgid ""
5201 "struct timespec {\n"
5202 "    long tv_sec;    /* seconds */\n"
5203 "    long tv_nsec;   /* nanoseconds */\n"
5204 "};\n"
5205 msgstr ""
5206 "struct timespec {\n"
5207 "    long tv_sec;    /* seconds */\n"
5208 "    long tv_nsec;   /* nanoseconds */\n"
5209 "};\n"
5210
5211 #. type: TP
5212 #: build/C/man2/select_tut.2:196
5213 #, no-wrap
5214 msgid "I<sigmask>"
5215 msgstr "I<sigmask>"
5216
5217 #. type: Plain text
5218 #: build/C/man2/select_tut.2:213
5219 msgid ""
5220 "This argument holds a set of signals that the kernel should unblock (i.e., "
5221 "remove from the signal mask of the calling thread), while the caller is "
5222 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5223 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5224 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5225 "()  will then behave just like B<select>()."
5226 msgstr ""
5227 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5228 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5229 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5230 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5231 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5232 "()  と全く同じ動作となる。"
5233
5234 #. type: SS
5235 #: build/C/man2/select_tut.2:213
5236 #, fuzzy, no-wrap
5237 #| msgid "Combining Signal and Data Events"
5238 msgid "Combining signal and data events"
5239 msgstr "シグナルとデータイベントを組み合わせる"
5240
5241 #. type: Plain text
5242 #: build/C/man2/select_tut.2:257
5243 msgid ""
5244 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5245 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5246 "normally use the signal handler only to raise a global flag.  The global "
5247 "flag will indicate that the event must be processed in the main loop of the "
5248 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5249 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5250 "signals can be processed in the main loop of the program, otherwise B<select>"
5251 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5252 "conditional to check the global flag.  So we must ask: what if a signal "
5253 "arrives after the conditional, but before the B<select>()  call? The answer "
5254 "is that B<select>()  would block indefinitely, even though an event is "
5255 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5256 "This call can be used to set the signal mask to a set of signals that are "
5257 "only to be received within the B<pselect>()  call.  For instance, let us say "
5258 "that the event in question was the exit of a child process.  Before the "
5259 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5260 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5261 "mask.  Our program would look like:"
5262 msgstr ""
5263 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5264 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5265 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5266 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5267 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5268 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5269 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5270 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5271 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5272 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5273 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5274 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5275 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5276 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5277 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5278 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5279 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5280 "る。"
5281
5282 #. type: Plain text
5283 #: build/C/man2/select_tut.2:260
5284 #, no-wrap
5285 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5286 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5287
5288 #. type: Plain text
5289 #: build/C/man2/select_tut.2:266
5290 #, no-wrap
5291 msgid ""
5292 "static void\n"
5293 "child_sig_handler(int sig)\n"
5294 "{\n"
5295 "    got_SIGCHLD = 1;\n"
5296 "}\n"
5297 msgstr ""
5298 "static void\n"
5299 "child_sig_handler(int sig)\n"
5300 "{\n"
5301 "    got_SIGCHLD = 1;\n"
5302 "}\n"
5303
5304 #. type: Plain text
5305 #: build/C/man2/select_tut.2:274
5306 #, no-wrap
5307 msgid ""
5308 "int\n"
5309 "main(int argc, char *argv[])\n"
5310 "{\n"
5311 "    sigset_t sigmask, empty_mask;\n"
5312 "    struct sigaction sa;\n"
5313 "    fd_set readfds, writefds, exceptfds;\n"
5314 "    int r;\n"
5315 msgstr ""
5316 "int\n"
5317 "main(int argc, char *argv[])\n"
5318 "{\n"
5319 "    sigset_t sigmask, empty_mask;\n"
5320 "    struct sigaction sa;\n"
5321 "    fd_set readfds, writefds, exceptfds;\n"
5322 "    int r;\n"
5323
5324 #. type: Plain text
5325 #: build/C/man2/select_tut.2:281
5326 #, no-wrap
5327 msgid ""
5328 "    sigemptyset(&sigmask);\n"
5329 "    sigaddset(&sigmask, SIGCHLD);\n"
5330 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5331 "        perror(\"sigprocmask\");\n"
5332 "        exit(EXIT_FAILURE);\n"
5333 "    }\n"
5334 msgstr ""
5335 "    sigemptyset(&sigmask);\n"
5336 "    sigaddset(&sigmask, SIGCHLD);\n"
5337 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5338 "        perror(\"sigprocmask\");\n"
5339 "        exit(EXIT_FAILURE);\n"
5340 "    }\n"
5341
5342 #. type: Plain text
5343 #: build/C/man2/select_tut.2:289
5344 #, no-wrap
5345 msgid ""
5346 "    sa.sa_flags = 0;\n"
5347 "    sa.sa_handler = child_sig_handler;\n"
5348 "    sigemptyset(&sa.sa_mask);\n"
5349 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5350 "        perror(\"sigaction\");\n"
5351 "        exit(EXIT_FAILURE);\n"
5352 "    }\n"
5353 msgstr ""
5354 "    sa.sa_flags = 0;\n"
5355 "    sa.sa_handler = child_sig_handler;\n"
5356 "    sigemptyset(&sa.sa_mask);\n"
5357 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5358 "        perror(\"sigaction\");\n"
5359 "        exit(EXIT_FAILURE);\n"
5360 "    }\n"
5361
5362 #. type: Plain text
5363 #: build/C/man2/select_tut.2:291
5364 #, no-wrap
5365 msgid "    sigemptyset(&empty_mask);\n"
5366 msgstr "    sigemptyset(&empty_mask);\n"
5367
5368 #. type: Plain text
5369 #: build/C/man2/select_tut.2:295
5370 #, no-wrap
5371 msgid ""
5372 "    for (;;) {          /* main loop */\n"
5373 "        /* Initialize readfds, writefds, and exceptfds\n"
5374 "           before the pselect() call. (Code omitted.) */\n"
5375 msgstr ""
5376 "    for (;;) {          /* main loop */\n"
5377 "        /* Initialize readfds, writefds, and exceptfds\n"
5378 "           before the pselect() call. (Code omitted.) */\n"
5379
5380 #. type: Plain text
5381 #: build/C/man2/select_tut.2:301
5382 #, no-wrap
5383 msgid ""
5384 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5385 "                    NULL, &empty_mask);\n"
5386 "        if (r == -1 && errno != EINTR) {\n"
5387 "            /* Handle error */\n"
5388 "        }\n"
5389 msgstr ""
5390 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5391 "                    NULL, &empty_mask);\n"
5392 "        if (r == -1 && errno != EINTR) {\n"
5393 "            /* Handle error */\n"
5394 "        }\n"
5395
5396 #. type: Plain text
5397 #: build/C/man2/select_tut.2:304
5398 #, no-wrap
5399 msgid ""
5400 "        if (got_SIGCHLD) {\n"
5401 "            got_SIGCHLD = 0;\n"
5402 msgstr ""
5403 "        if (got_SIGCHLD) {\n"
5404 "            got_SIGCHLD = 0;\n"
5405
5406 #. type: Plain text
5407 #: build/C/man2/select_tut.2:308
5408 #, no-wrap
5409 msgid ""
5410 "            /* Handle signalled event here; e.g., wait() for all\n"
5411 "               terminated children. (Code omitted.) */\n"
5412 "        }\n"
5413 msgstr ""
5414 "            /* Handle signalled event here; e.g., wait() for all\n"
5415 "               terminated children. (Code omitted.) */\n"
5416 "        }\n"
5417
5418 #. type: Plain text
5419 #: build/C/man2/select_tut.2:312
5420 #, no-wrap
5421 msgid ""
5422 "        /* main body of program */\n"
5423 "    }\n"
5424 "}\n"
5425 msgstr ""
5426 "        /* main body of program */\n"
5427 "    }\n"
5428 "}\n"
5429
5430 #. type: SS
5431 #: build/C/man2/select_tut.2:313
5432 #, no-wrap
5433 msgid "Practical"
5434 msgstr "実例"
5435
5436 #. type: Plain text
5437 #: build/C/man2/select_tut.2:334
5438 msgid ""
5439 "So what is the point of B<select>()? Can't I just read and write to my "
5440 "descriptors whenever I want? The point of B<select>()  is that it watches "
5441 "multiple descriptors at the same time and properly puts the process to sleep "
5442 "if there is no activity.  UNIX programmers often find themselves in a "
5443 "position where they have to handle I/O from more than one file descriptor "
5444 "where the data flow may be intermittent.  If you were to merely create a "
5445 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5446 "your calls may block waiting for data from/to a file descriptor, while "
5447 "another file descriptor is unused though ready for I/O.  B<select>()  "
5448 "efficiently copes with this situation."
5449 msgstr ""
5450 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5451 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5452 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5453 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5454 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5455 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5456 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5457 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5458 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5459
5460 #. type: SS
5461 #: build/C/man2/select_tut.2:334
5462 #, fuzzy, no-wrap
5463 #| msgid "Select Law"
5464 msgid "Select law"
5465 msgstr "SELECT の掟"
5466
5467 #. type: Plain text
5468 #: build/C/man2/select_tut.2:347
5469 msgid ""
5470 "Many people who try to use B<select>()  come across behavior that is "
5471 "difficult to understand and produces nonportable or borderline results.  For "
5472 "instance, the above program is carefully written not to block at any point, "
5473 "even though it does not set its file descriptors to nonblocking mode.  It is "
5474 "easy to introduce subtle errors that will remove the advantage of using "
5475 "B<select>(), so here is a list of essentials to watch for when using "
5476 "B<select>()."
5477 msgstr ""
5478 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5479 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5480 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5481 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5482 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5483 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5484 "ことにする。"
5485
5486 #. type: Plain text
5487 #: build/C/man2/select_tut.2:356
5488 msgid ""
5489 "You should always try to use B<select>()  without a timeout.  Your program "
5490 "should have nothing to do if there is no data available.  Code that depends "
5491 "on timeouts is not usually portable and is difficult to debug."
5492 msgstr ""
5493 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5494 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5495 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5496
5497 #. type: Plain text
5498 #: build/C/man2/select_tut.2:360
5499 msgid ""
5500 "The value I<nfds> must be properly calculated for efficiency as explained "
5501 "above."
5502 msgstr ""
5503 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5504 "えなければならない。"
5505
5506 #. type: Plain text
5507 #: build/C/man2/select_tut.2:367
5508 msgid ""
5509 "No file descriptor must be added to any set if you do not intend to check "
5510 "its result after the B<select>()  call, and respond appropriately.  See next "
5511 "rule."
5512 msgstr ""
5513 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5514 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5515
5516 #. type: Plain text
5517 #: build/C/man2/select_tut.2:373
5518 msgid ""
5519 "After B<select>()  returns, all file descriptors in all sets should be "
5520 "checked to see if they are ready."
5521 msgstr ""
5522 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5523 "て 読み書き可能な状態になっているかをチェックすべきである。"
5524
5525 #. type: TP
5526 #: build/C/man2/select_tut.2:373
5527 #, no-wrap
5528 msgid "5."
5529 msgstr "5."
5530
5531 #. type: Plain text
5532 #: build/C/man2/select_tut.2:388
5533 msgid ""
5534 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5535 "necessarily read/write the full amount of data that you have requested.  If "
5536 "they do read/write the full amount, it's because you have a low traffic load "
5537 "and a fast stream.  This is not always going to be the case.  You should "
5538 "cope with the case of your functions only managing to send or receive a "
5539 "single byte."
5540 msgstr ""
5541 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5542 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5543 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5544 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5545 "うな場合も 考慮に入れてやらなければならない。"
5546
5547 #. type: TP
5548 #: build/C/man2/select_tut.2:388
5549 #, no-wrap
5550 msgid "6."
5551 msgstr "6."
5552
5553 #. type: Plain text
5554 #: build/C/man2/select_tut.2:396
5555 msgid ""
5556 "Never read/write only in single bytes at a time unless you are really sure "
5557 "that you have a small amount of data to process.  It is extremely "
5558 "inefficient not to read/write as much data as you can buffer each time.  The "
5559 "buffers in the example below are 1024 bytes although they could easily be "
5560 "made larger."
5561 msgstr ""
5562 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5563 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5564 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5565 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5566
5567 #. type: TP
5568 #: build/C/man2/select_tut.2:396
5569 #, no-wrap
5570 msgid "7."
5571 msgstr "7."
5572
5573 #.  Nonetheless, you should still cope with these errors for completeness.
5574 #. type: Plain text
5575 #: build/C/man2/select_tut.2:418
5576 msgid ""
5577 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5578 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5579 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5580 "properly managed (not done properly above).  If your program is not going to "
5581 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5582 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5583 msgstr ""
5584 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5585 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5586 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5587 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5588 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5589 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5590
5591 #. type: TP
5592 #: build/C/man2/select_tut.2:418
5593 #, no-wrap
5594 msgid "8."
5595 msgstr "8."
5596
5597 #. type: Plain text
5598 #: build/C/man2/select_tut.2:427
5599 msgid ""
5600 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5601 "length of zero."
5602 msgstr ""
5603 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5604 "(2), B<send>(2)  を呼び出してはならない。"
5605
5606 #. type: TP
5607 #: build/C/man2/select_tut.2:427
5608 #, no-wrap
5609 msgid "9."
5610 msgstr "9."
5611
5612 #. type: Plain text
5613 #: build/C/man2/select_tut.2:443
5614 msgid ""
5615 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5616 "with errors other than those listed in B<7.>, or one of the input functions "
5617 "returns 0, indicating end of file, then you should I<not> pass that "
5618 "descriptor to B<select>()  again.  In the example below, I close the "
5619 "descriptor immediately, and then set it to -1 to prevent it being included "
5620 "in a set."
5621 msgstr ""
5622 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5623 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5624 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5625 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5626 "が集合に含まれ続けるのを許さないようにしている。"
5627
5628 #. type: TP
5629 #: build/C/man2/select_tut.2:443
5630 #, no-wrap
5631 msgid "10."
5632 msgstr "10."
5633
5634 #. type: Plain text
5635 #: build/C/man2/select_tut.2:450
5636 msgid ""
5637 "The timeout value must be initialized with each new call to B<select>(), "
5638 "since some operating systems modify the structure.  B<pselect>()  however "
5639 "does not modify its timeout structure."
5640 msgstr ""
5641 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5642 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5643 "分の timeout 構造体を変更することはない。"
5644
5645 #. type: TP
5646 #: build/C/man2/select_tut.2:450
5647 #, no-wrap
5648 msgid "11."
5649 msgstr "11."
5650
5651 #.  "I have heard" does not fill me with confidence, and doesn't
5652 #.  belong in a man page, so I've commented this point out.
5653 #.  .TP
5654 #.  11.
5655 #.  I have heard that the Windows socket layer does not cope with OOB data
5656 #.  properly.
5657 #.  It also does not cope with
5658 #.  .BR select ()
5659 #.  calls when no file descriptors are set at all.
5660 #.  Having no file descriptors set is a useful
5661 #.  way to sleep the process with subsecond precision by using the timeout.
5662 #.  (See further on.)
5663 #. type: Plain text
5664 #: build/C/man2/select_tut.2:469
5665 msgid ""
5666 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5667 "used in a loop, then the sets must be reinitialized before each call."
5668 msgstr ""
5669 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5670 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5671 "期化し直さなければならない。"
5672
5673 #. type: SS
5674 #: build/C/man2/select_tut.2:469
5675 #, fuzzy, no-wrap
5676 #| msgid "Usleep Emulation"
5677 msgid "Usleep emulation"
5678 msgstr "usleep エミュレーション"
5679
5680 #. type: Plain text
5681 #: build/C/man2/select_tut.2:476
5682 msgid ""
5683 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5684 "()  with a finite timeout and no file descriptors as follows:"
5685 msgstr ""
5686 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5687 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5688 "できる。 以下のようにする。"
5689
5690 #. type: Plain text
5691 #: build/C/man2/select_tut.2:482
5692 #, no-wrap
5693 msgid ""
5694 "    struct timeval tv;\n"
5695 "    tv.tv_sec = 0;\n"
5696 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5697 "    select(0, NULL, NULL, NULL, &tv);\n"
5698 msgstr ""
5699 "    struct timeval tv;\n"
5700 "    tv.tv_sec = 0;\n"
5701 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5702 "    select(0, NULL, NULL, NULL, &tv);\n"
5703
5704 #. type: Plain text
5705 #: build/C/man2/select_tut.2:485
5706 msgid "This is only guaranteed to work on UNIX systems, however."
5707 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5708
5709 #. type: Plain text
5710 #: build/C/man2/select_tut.2:490
5711 msgid ""
5712 "On success, B<select>()  returns the total number of file descriptors still "
5713 "present in the file descriptor sets."
5714 msgstr ""
5715 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5716 "ディスクリプタの総数を返す。"
5717
5718 #. type: Plain text
5719 #: build/C/man2/select_tut.2:496
5720 msgid ""
5721 "If B<select>()  timed out, then the return value will be zero.  The file "
5722 "descriptors set should be all empty (but may not be on some systems)."
5723 msgstr ""
5724 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5725 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5726
5727 #. type: Plain text
5728 #: build/C/man2/select_tut.2:503
5729 msgid ""
5730 "A return value of -1 indicates an error, with I<errno> being set "
5731 "appropriately.  In the case of an error, the contents of the returned sets "
5732 "and the I<struct timeout> contents are undefined and should not be used.  "
5733 "B<pselect>()  however never modifies I<ntimeout>."
5734 msgstr ""
5735 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5736 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5737 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5738 "変更しない。"
5739
5740 #. type: Plain text
5741 #: build/C/man2/select_tut.2:512
5742 msgid ""
5743 "Generally speaking, all operating systems that support sockets also support "
5744 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5745 "and efficient way that naive programmers try to solve in a more complicated "
5746 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5747 msgstr ""
5748 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5749 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5750 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5751 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5752
5753 #. type: Plain text
5754 #: build/C/man2/select_tut.2:521
5755 msgid ""
5756 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5757 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5758 "is nowadays widely available, but historically was less portable than "
5759 "B<select>()."
5760 msgstr ""
5761 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5762 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5763 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5764
5765 #. type: Plain text
5766 #: build/C/man2/select_tut.2:529
5767 msgid ""
5768 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5769 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5770 "of file descriptors."
5771 msgstr ""
5772 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5773 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5774
5775 #. type: Plain text
5776 #: build/C/man2/select_tut.2:534
5777 msgid ""
5778 "Here is an example that better demonstrates the true utility of B<select>"
5779 "().  The listing below is a TCP forwarding program that forwards from one "
5780 "TCP port to another."
5781 msgstr ""
5782 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5783 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5784
5785 #. type: Plain text
5786 #: build/C/man2/select_tut.2:547
5787 #, no-wrap
5788 msgid ""
5789 "#include E<lt>stdlib.hE<gt>\n"
5790 "#include E<lt>stdio.hE<gt>\n"
5791 "#include E<lt>unistd.hE<gt>\n"
5792 "#include E<lt>sys/time.hE<gt>\n"
5793 "#include E<lt>sys/types.hE<gt>\n"
5794 "#include E<lt>string.hE<gt>\n"
5795 "#include E<lt>signal.hE<gt>\n"
5796 "#include E<lt>sys/socket.hE<gt>\n"
5797 "#include E<lt>netinet/in.hE<gt>\n"
5798 "#include E<lt>arpa/inet.hE<gt>\n"
5799 "#include E<lt>errno.hE<gt>\n"
5800 msgstr ""
5801 "#include E<lt>stdlib.hE<gt>\n"
5802 "#include E<lt>stdio.hE<gt>\n"
5803 "#include E<lt>unistd.hE<gt>\n"
5804 "#include E<lt>sys/time.hE<gt>\n"
5805 "#include E<lt>sys/types.hE<gt>\n"
5806 "#include E<lt>string.hE<gt>\n"
5807 "#include E<lt>signal.hE<gt>\n"
5808 "#include E<lt>sys/socket.hE<gt>\n"
5809 "#include E<lt>netinet/in.hE<gt>\n"
5810 "#include E<lt>arpa/inet.hE<gt>\n"
5811 "#include E<lt>errno.hE<gt>\n"
5812
5813 #. type: Plain text
5814 #: build/C/man2/select_tut.2:549
5815 #, no-wrap
5816 msgid "static int forward_port;\n"
5817 msgstr "static int forward_port;\n"
5818
5819 #. type: Plain text
5820 #: build/C/man2/select_tut.2:552
5821 #, no-wrap
5822 msgid ""
5823 "#undef max\n"
5824 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5825 msgstr ""
5826 "#undef max\n"
5827 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5828
5829 #. type: Plain text
5830 #: build/C/man2/select_tut.2:559
5831 #, no-wrap
5832 msgid ""
5833 "static int\n"
5834 "listen_socket(int listen_port)\n"
5835 "{\n"
5836 "    struct sockaddr_in a;\n"
5837 "    int s;\n"
5838 "    int yes;\n"
5839 msgstr ""
5840 "static int\n"
5841 "listen_socket(int listen_port)\n"
5842 "{\n"
5843 "    struct sockaddr_in a;\n"
5844 "    int s;\n"
5845 "    int yes;\n"
5846
5847 #. type: Plain text
5848 #: build/C/man2/select_tut.2:583
5849 #, fuzzy, no-wrap
5850 #| msgid ""
5851 #| "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5852 #| "        perror(\"socket\");\n"
5853 #| "        return -1;\n"
5854 #| "    }\n"
5855 #| "    yes = 1;\n"
5856 #| "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5857 #| "            (char *) &yes, sizeof(yes)) == -1) {\n"
5858 #| "        perror(\"setsockopt\");\n"
5859 #| "        close(s);\n"
5860 #| "        return -1;\n"
5861 #| "    }\n"
5862 #| "    memset(&a, 0, sizeof(a));\n"
5863 #| "    a.sin_port = htons(listen_port);\n"
5864 #| "    a.sin_family = AF_INET;\n"
5865 #| "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5866 #| "        perror(\"bind\");\n"
5867 #| "        close(s);\n"
5868 #| "        return -1;\n"
5869 #| "    }\n"
5870 #| "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5871 #| "    listen(s, 10);\n"
5872 #| "    return s;\n"
5873 #| "}\n"
5874 msgid ""
5875 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5876 "        perror(\"socket\");\n"
5877 "        return -1;\n"
5878 "    }\n"
5879 "    yes = 1;\n"
5880 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5881 "            &yes, sizeof(yes)) == -1) {\n"
5882 "        perror(\"setsockopt\");\n"
5883 "        close(s);\n"
5884 "        return -1;\n"
5885 "    }\n"
5886 "    memset(&a, 0, sizeof(a));\n"
5887 "    a.sin_port = htons(listen_port);\n"
5888 "    a.sin_family = AF_INET;\n"
5889 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5890 "        perror(\"bind\");\n"
5891 "        close(s);\n"
5892 "        return -1;\n"
5893 "    }\n"
5894 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5895 "    listen(s, 10);\n"
5896 "    return s;\n"
5897 "}\n"
5898 msgstr ""
5899 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5900 "        perror(\"socket\");\n"
5901 "        return -1;\n"
5902 "    }\n"
5903 "    yes = 1;\n"
5904 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5905 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5906 "        perror(\"setsockopt\");\n"
5907 "        close(s);\n"
5908 "        return -1;\n"
5909 "    }\n"
5910 "    memset(&a, 0, sizeof(a));\n"
5911 "    a.sin_port = htons(listen_port);\n"
5912 "    a.sin_family = AF_INET;\n"
5913 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5914 "        perror(\"bind\");\n"
5915 "        close(s);\n"
5916 "        return -1;\n"
5917 "    }\n"
5918 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5919 "    listen(s, 10);\n"
5920 "    return s;\n"
5921 "}\n"
5922
5923 #. type: Plain text
5924 #: build/C/man2/select_tut.2:589
5925 #, no-wrap
5926 msgid ""
5927 "static int\n"
5928 "connect_socket(int connect_port, char *address)\n"
5929 "{\n"
5930 "    struct sockaddr_in a;\n"
5931 "    int s;\n"
5932 msgstr ""
5933 "static int\n"
5934 "connect_socket(int connect_port, char *address)\n"
5935 "{\n"
5936 "    struct sockaddr_in a;\n"
5937 "    int s;\n"
5938
5939 #. type: Plain text
5940 #: build/C/man2/select_tut.2:595
5941 #, no-wrap
5942 msgid ""
5943 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5944 "        perror(\"socket\");\n"
5945 "        close(s);\n"
5946 "        return -1;\n"
5947 "    }\n"
5948 msgstr ""
5949 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5950 "        perror(\"socket\");\n"
5951 "        close(s);\n"
5952 "        return -1;\n"
5953 "    }\n"
5954
5955 #. type: Plain text
5956 #: build/C/man2/select_tut.2:599
5957 #, no-wrap
5958 msgid ""
5959 "    memset(&a, 0, sizeof(a));\n"
5960 "    a.sin_port = htons(connect_port);\n"
5961 "    a.sin_family = AF_INET;\n"
5962 msgstr ""
5963 "    memset(&a, 0, sizeof(a));\n"
5964 "    a.sin_port = htons(connect_port);\n"
5965 "    a.sin_family = AF_INET;\n"
5966
5967 #. type: Plain text
5968 #: build/C/man2/select_tut.2:605
5969 #, no-wrap
5970 msgid ""
5971 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5972 "        perror(\"bad IP address format\");\n"
5973 "        close(s);\n"
5974 "        return -1;\n"
5975 "    }\n"
5976 msgstr ""
5977 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5978 "        perror(\"bad IP address format\");\n"
5979 "        close(s);\n"
5980 "        return -1;\n"
5981 "    }\n"
5982
5983 #. type: Plain text
5984 #: build/C/man2/select_tut.2:614
5985 #, no-wrap
5986 msgid ""
5987 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5988 "        perror(\"connect()\");\n"
5989 "        shutdown(s, SHUT_RDWR);\n"
5990 "        close(s);\n"
5991 "        return -1;\n"
5992 "    }\n"
5993 "    return s;\n"
5994 "}\n"
5995 msgstr ""
5996 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5997 "        perror(\"connect()\");\n"
5998 "        shutdown(s, SHUT_RDWR);\n"
5999 "        close(s);\n"
6000 "        return -1;\n"
6001 "    }\n"
6002 "    return s;\n"
6003 "}\n"
6004
6005 #. type: Plain text
6006 #: build/C/man2/select_tut.2:622
6007 #, no-wrap
6008 msgid ""
6009 "#define SHUT_FD1 do {                                \\e\n"
6010 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6011 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6012 "                         close(fd1);                 \\e\n"
6013 "                         fd1 = -1;                   \\e\n"
6014 "                     }                               \\e\n"
6015 "                 } while (0)\n"
6016 msgstr ""
6017 "#define SHUT_FD1 do {                                \\e\n"
6018 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6019 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6020 "                         close(fd1);                 \\e\n"
6021 "                         fd1 = -1;                   \\e\n"
6022 "                     }                               \\e\n"
6023 "                 } while (0)\n"
6024
6025 #. type: Plain text
6026 #: build/C/man2/select_tut.2:630
6027 #, no-wrap
6028 msgid ""
6029 "#define SHUT_FD2 do {                                \\e\n"
6030 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6031 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6032 "                         close(fd2);                 \\e\n"
6033 "                         fd2 = -1;                   \\e\n"
6034 "                     }                               \\e\n"
6035 "                 } while (0)\n"
6036 msgstr ""
6037 "#define SHUT_FD2 do {                                \\e\n"
6038 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6039 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6040 "                         close(fd2);                 \\e\n"
6041 "                         fd2 = -1;                   \\e\n"
6042 "                     }                               \\e\n"
6043 "                 } while (0)\n"
6044
6045 #. type: Plain text
6046 #: build/C/man2/select_tut.2:632
6047 #, no-wrap
6048 msgid "#define BUF_SIZE 1024\n"
6049 msgstr "#define BUF_SIZE 1024\n"
6050
6051 #. type: Plain text
6052 #: build/C/man2/select_tut.2:641
6053 #, no-wrap
6054 msgid ""
6055 "int\n"
6056 "main(int argc, char *argv[])\n"
6057 "{\n"
6058 "    int h;\n"
6059 "    int fd1 = -1, fd2 = -1;\n"
6060 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6061 "    int buf1_avail, buf1_written;\n"
6062 "    int buf2_avail, buf2_written;\n"
6063 msgstr ""
6064 "int\n"
6065 "main(int argc, char *argv[])\n"
6066 "{\n"
6067 "    int h;\n"
6068 "    int fd1 = -1, fd2 = -1;\n"
6069 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6070 "    int buf1_avail, buf1_written;\n"
6071 "    int buf2_avail, buf2_written;\n"
6072
6073 #. type: Plain text
6074 #: build/C/man2/select_tut.2:647
6075 #, no-wrap
6076 msgid ""
6077 "    if (argc != 4) {\n"
6078 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6079 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6080 "        exit(EXIT_FAILURE);\n"
6081 "    }\n"
6082 msgstr ""
6083 "    if (argc != 4) {\n"
6084 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6085 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6086 "        exit(EXIT_FAILURE);\n"
6087 "    }\n"
6088
6089 #. type: Plain text
6090 #: build/C/man2/select_tut.2:649
6091 #, no-wrap
6092 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6093 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6094
6095 #. type: Plain text
6096 #: build/C/man2/select_tut.2:651
6097 #, no-wrap
6098 msgid "    forward_port = atoi(argv[2]);\n"
6099 msgstr "    forward_port = atoi(argv[2]);\n"
6100
6101 #. type: Plain text
6102 #: build/C/man2/select_tut.2:655
6103 #, no-wrap
6104 msgid ""
6105 "    h = listen_socket(atoi(argv[1]));\n"
6106 "    if (h == -1)\n"
6107 "        exit(EXIT_FAILURE);\n"
6108 msgstr ""
6109 "    h = listen_socket(atoi(argv[1]));\n"
6110 "    if (h == -1)\n"
6111 "        exit(EXIT_FAILURE);\n"
6112
6113 #. type: Plain text
6114 #: build/C/man2/select_tut.2:659
6115 #, no-wrap
6116 msgid ""
6117 "    for (;;) {\n"
6118 "        int r, nfds = 0;\n"
6119 "        fd_set rd, wr, er;\n"
6120 msgstr ""
6121 "    for (;;) {\n"
6122 "        int r, nfds = 0;\n"
6123 "        fd_set rd, wr, er;\n"
6124
6125 #. type: Plain text
6126 #: build/C/man2/select_tut.2:689
6127 #, no-wrap
6128 msgid ""
6129 "        FD_ZERO(&rd);\n"
6130 "        FD_ZERO(&wr);\n"
6131 "        FD_ZERO(&er);\n"
6132 "        FD_SET(h, &rd);\n"
6133 "        nfds = max(nfds, h);\n"
6134 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6135 "            FD_SET(fd1, &rd);\n"
6136 "            nfds = max(nfds, fd1);\n"
6137 "        }\n"
6138 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6139 "            FD_SET(fd2, &rd);\n"
6140 "            nfds = max(nfds, fd2);\n"
6141 "        }\n"
6142 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6143 "            FD_SET(fd1, &wr);\n"
6144 "            nfds = max(nfds, fd1);\n"
6145 "        }\n"
6146 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6147 "            FD_SET(fd2, &wr);\n"
6148 "            nfds = max(nfds, fd2);\n"
6149 "        }\n"
6150 "        if (fd1 E<gt> 0) {\n"
6151 "            FD_SET(fd1, &er);\n"
6152 "            nfds = max(nfds, fd1);\n"
6153 "        }\n"
6154 "        if (fd2 E<gt> 0) {\n"
6155 "            FD_SET(fd2, &er);\n"
6156 "            nfds = max(nfds, fd2);\n"
6157 "        }\n"
6158 msgstr ""
6159 "        FD_ZERO(&rd);\n"
6160 "        FD_ZERO(&wr);\n"
6161 "        FD_ZERO(&er);\n"
6162 "        FD_SET(h, &rd);\n"
6163 "        nfds = max(nfds, h);\n"
6164 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6165 "            FD_SET(fd1, &rd);\n"
6166 "            nfds = max(nfds, fd1);\n"
6167 "        }\n"
6168 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6169 "            FD_SET(fd2, &rd);\n"
6170 "            nfds = max(nfds, fd2);\n"
6171 "        }\n"
6172 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6173 "            FD_SET(fd1, &wr);\n"
6174 "            nfds = max(nfds, fd1);\n"
6175 "        }\n"
6176 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6177 "            FD_SET(fd2, &wr);\n"
6178 "            nfds = max(nfds, fd2);\n"
6179 "        }\n"
6180 "        if (fd1 E<gt> 0) {\n"
6181 "            FD_SET(fd1, &er);\n"
6182 "            nfds = max(nfds, fd1);\n"
6183 "        }\n"
6184 "        if (fd2 E<gt> 0) {\n"
6185 "            FD_SET(fd2, &er);\n"
6186 "            nfds = max(nfds, fd2);\n"
6187 "        }\n"
6188
6189 #. type: Plain text
6190 #: build/C/man2/select_tut.2:691
6191 #, no-wrap
6192 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6193 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6194
6195 #. type: Plain text
6196 #: build/C/man2/select_tut.2:694
6197 #, no-wrap
6198 msgid ""
6199 "        if (r == -1 && errno == EINTR)\n"
6200 "            continue;\n"
6201 msgstr ""
6202 "        if (r == -1 && errno == EINTR)\n"
6203 "            continue;\n"
6204
6205 #. type: Plain text
6206 #: build/C/man2/select_tut.2:699
6207 #, no-wrap
6208 msgid ""
6209 "        if (r == -1) {\n"
6210 "            perror(\"select()\");\n"
6211 "            exit(EXIT_FAILURE);\n"
6212 "        }\n"
6213 msgstr ""
6214 "        if (r == -1) {\n"
6215 "            perror(\"select()\");\n"
6216 "            exit(EXIT_FAILURE);\n"
6217 "        }\n"
6218
6219 #. type: Plain text
6220 #: build/C/man2/select_tut.2:703
6221 #, no-wrap
6222 msgid ""
6223 "        if (FD_ISSET(h, &rd)) {\n"
6224 "            unsigned int l;\n"
6225 "            struct sockaddr_in client_address;\n"
6226 msgstr ""
6227 "        if (FD_ISSET(h, &rd)) {\n"
6228 "            unsigned int l;\n"
6229 "            struct sockaddr_in client_address;\n"
6230
6231 #. type: Plain text
6232 #: build/C/man2/select_tut.2:722
6233 #, no-wrap
6234 msgid ""
6235 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6236 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6237 "            if (r == -1) {\n"
6238 "                perror(\"accept()\");\n"
6239 "            } else {\n"
6240 "                SHUT_FD1;\n"
6241 "                SHUT_FD2;\n"
6242 "                buf1_avail = buf1_written = 0;\n"
6243 "                buf2_avail = buf2_written = 0;\n"
6244 "                fd1 = r;\n"
6245 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6246 "                if (fd2 == -1)\n"
6247 "                    SHUT_FD1;\n"
6248 "                else\n"
6249 "                    printf(\"connect from %s\\en\",\n"
6250 "                            inet_ntoa(client_address.sin_addr));\n"
6251 "            }\n"
6252 "        }\n"
6253 msgstr ""
6254 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6255 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6256 "            if (r == -1) {\n"
6257 "                perror(\"accept()\");\n"
6258 "            } else {\n"
6259 "                SHUT_FD1;\n"
6260 "                SHUT_FD2;\n"
6261 "                buf1_avail = buf1_written = 0;\n"
6262 "                buf2_avail = buf2_written = 0;\n"
6263 "                fd1 = r;\n"
6264 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6265 "                if (fd2 == -1)\n"
6266 "                    SHUT_FD1;\n"
6267 "                else\n"
6268 "                    printf(\"connect from %s\\en\",\n"
6269 "                            inet_ntoa(client_address.sin_addr));\n"
6270 "            }\n"
6271 "        }\n"
6272
6273 #. type: Plain text
6274 #: build/C/man2/select_tut.2:724
6275 #, no-wrap
6276 msgid "        /* NB: read oob data before normal reads */\n"
6277 msgstr "        /* NB: read oob data before normal reads */\n"
6278
6279 #. type: Plain text
6280 #: build/C/man2/select_tut.2:728
6281 #, no-wrap
6282 msgid ""
6283 "        if (fd1 E<gt> 0)\n"
6284 "            if (FD_ISSET(fd1, &er)) {\n"
6285 "                char c;\n"
6286 msgstr ""
6287 "        if (fd1 E<gt> 0)\n"
6288 "            if (FD_ISSET(fd1, &er)) {\n"
6289 "                char c;\n"
6290
6291 #. type: Plain text
6292 #: build/C/man2/select_tut.2:738
6293 #, no-wrap
6294 msgid ""
6295 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6296 "                if (r E<lt> 1)\n"
6297 "                    SHUT_FD1;\n"
6298 "                else\n"
6299 "                    send(fd2, &c, 1, MSG_OOB);\n"
6300 "            }\n"
6301 "        if (fd2 E<gt> 0)\n"
6302 "            if (FD_ISSET(fd2, &er)) {\n"
6303 "                char c;\n"
6304 msgstr ""
6305 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6306 "                if (r E<lt> 1)\n"
6307 "                    SHUT_FD1;\n"
6308 "                else\n"
6309 "                    send(fd2, &c, 1, MSG_OOB);\n"
6310 "            }\n"
6311 "        if (fd2 E<gt> 0)\n"
6312 "            if (FD_ISSET(fd2, &er)) {\n"
6313 "                char c;\n"
6314
6315 #. type: Plain text
6316 #: build/C/man2/select_tut.2:781
6317 #, no-wrap
6318 msgid ""
6319 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6320 "                if (r E<lt> 1)\n"
6321 "                    SHUT_FD2;\n"
6322 "                else\n"
6323 "                    send(fd1, &c, 1, MSG_OOB);\n"
6324 "            }\n"
6325 "        if (fd1 E<gt> 0)\n"
6326 "            if (FD_ISSET(fd1, &rd)) {\n"
6327 "                r = read(fd1, buf1 + buf1_avail,\n"
6328 "                          BUF_SIZE - buf1_avail);\n"
6329 "                if (r E<lt> 1)\n"
6330 "                    SHUT_FD1;\n"
6331 "                else\n"
6332 "                    buf1_avail += r;\n"
6333 "            }\n"
6334 "        if (fd2 E<gt> 0)\n"
6335 "            if (FD_ISSET(fd2, &rd)) {\n"
6336 "                r = read(fd2, buf2 + buf2_avail,\n"
6337 "                          BUF_SIZE - buf2_avail);\n"
6338 "                if (r E<lt> 1)\n"
6339 "                    SHUT_FD2;\n"
6340 "                else\n"
6341 "                    buf2_avail += r;\n"
6342 "            }\n"
6343 "        if (fd1 E<gt> 0)\n"
6344 "            if (FD_ISSET(fd1, &wr)) {\n"
6345 "                r = write(fd1, buf2 + buf2_written,\n"
6346 "                           buf2_avail - buf2_written);\n"
6347 "                if (r E<lt> 1)\n"
6348 "                    SHUT_FD1;\n"
6349 "                else\n"
6350 "                    buf2_written += r;\n"
6351 "            }\n"
6352 "        if (fd2 E<gt> 0)\n"
6353 "            if (FD_ISSET(fd2, &wr)) {\n"
6354 "                r = write(fd2, buf1 + buf1_written,\n"
6355 "                           buf1_avail - buf1_written);\n"
6356 "                if (r E<lt> 1)\n"
6357 "                    SHUT_FD2;\n"
6358 "                else\n"
6359 "                    buf1_written += r;\n"
6360 "            }\n"
6361 msgstr ""
6362 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6363 "                if (r E<lt> 1)\n"
6364 "                    SHUT_FD2;\n"
6365 "                else\n"
6366 "                    send(fd1, &c, 1, MSG_OOB);\n"
6367 "            }\n"
6368 "        if (fd1 E<gt> 0)\n"
6369 "            if (FD_ISSET(fd1, &rd)) {\n"
6370 "                r = read(fd1, buf1 + buf1_avail,\n"
6371 "                          BUF_SIZE - buf1_avail);\n"
6372 "                if (r E<lt> 1)\n"
6373 "                    SHUT_FD1;\n"
6374 "                else\n"
6375 "                    buf1_avail += r;\n"
6376 "            }\n"
6377 "        if (fd2 E<gt> 0)\n"
6378 "            if (FD_ISSET(fd2, &rd)) {\n"
6379 "                r = read(fd2, buf2 + buf2_avail,\n"
6380 "                          BUF_SIZE - buf2_avail);\n"
6381 "                if (r E<lt> 1)\n"
6382 "                    SHUT_FD2;\n"
6383 "                else\n"
6384 "                    buf2_avail += r;\n"
6385 "            }\n"
6386 "        if (fd1 E<gt> 0)\n"
6387 "            if (FD_ISSET(fd1, &wr)) {\n"
6388 "                r = write(fd1, buf2 + buf2_written,\n"
6389 "                           buf2_avail - buf2_written);\n"
6390 "                if (r E<lt> 1)\n"
6391 "                    SHUT_FD1;\n"
6392 "                else\n"
6393 "                    buf2_written += r;\n"
6394 "            }\n"
6395 "        if (fd2 E<gt> 0)\n"
6396 "            if (FD_ISSET(fd2, &wr)) {\n"
6397 "                r = write(fd2, buf1 + buf1_written,\n"
6398 "                           buf1_avail - buf1_written);\n"
6399 "                if (r E<lt> 1)\n"
6400 "                    SHUT_FD2;\n"
6401 "                else\n"
6402 "                    buf1_written += r;\n"
6403 "            }\n"
6404
6405 #. type: Plain text
6406 #: build/C/man2/select_tut.2:783
6407 #, no-wrap
6408 msgid "        /* check if write data has caught read data */\n"
6409 msgstr "        /* check if write data has caught read data */\n"
6410
6411 #. type: Plain text
6412 #: build/C/man2/select_tut.2:788
6413 #, no-wrap
6414 msgid ""
6415 "        if (buf1_written == buf1_avail)\n"
6416 "            buf1_written = buf1_avail = 0;\n"
6417 "        if (buf2_written == buf2_avail)\n"
6418 "            buf2_written = buf2_avail = 0;\n"
6419 msgstr ""
6420 "        if (buf1_written == buf1_avail)\n"
6421 "            buf1_written = buf1_avail = 0;\n"
6422 "        if (buf2_written == buf2_avail)\n"
6423 "            buf2_written = buf2_avail = 0;\n"
6424
6425 #. type: Plain text
6426 #: build/C/man2/select_tut.2:791
6427 #, no-wrap
6428 msgid ""
6429 "        /* one side has closed the connection, keep\n"
6430 "           writing to the other side until empty */\n"
6431 msgstr ""
6432 "        /* one side has closed the connection, keep\n"
6433 "           writing to the other side until empty */\n"
6434
6435 #. type: Plain text
6436 #: build/C/man2/select_tut.2:799
6437 #, no-wrap
6438 msgid ""
6439 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6440 "            SHUT_FD2;\n"
6441 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6442 "            SHUT_FD1;\n"
6443 "    }\n"
6444 "    exit(EXIT_SUCCESS);\n"
6445 "}\n"
6446 msgstr ""
6447 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6448 "            SHUT_FD2;\n"
6449 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6450 "            SHUT_FD1;\n"
6451 "    }\n"
6452 "    exit(EXIT_SUCCESS);\n"
6453 "}\n"
6454
6455 #. type: Plain text
6456 #: build/C/man2/select_tut.2:813
6457 msgid ""
6458 "The above program properly forwards most kinds of TCP connections including "
6459 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6460 "problem of having data flow in both directions simultaneously.  You might "
6461 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6462 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6463 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6464 "because you end up using inefficient timeouts."
6465 msgstr ""
6466 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6467 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6468 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6469 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6470 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6471 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6472 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6473 "起こってしまう。"
6474
6475 #. type: Plain text
6476 #: build/C/man2/select_tut.2:819
6477 msgid ""
6478 "The program does not handle more than one simultaneous connection at a time, "
6479 "although it could easily be extended to do this with a linked list of buffers"
6480 "\\(emone for each connection.  At the moment, new connections cause the "
6481 "current connection to be dropped."
6482 msgstr ""
6483 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6484 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6485 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6486
6487 #.  .SH AUTHORS
6488 #.  This man page was written by Paul Sheer.
6489 #. type: Plain text
6490 #: build/C/man2/select_tut.2:838
6491 msgid ""
6492 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6493 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6494 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6495 "(3), B<epoll>(7)"
6496 msgstr ""
6497 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6498 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6499 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6500 "(3), B<epoll>(7)"
6501
6502 #. type: TH
6503 #: build/C/man2/send.2:40
6504 #, no-wrap
6505 msgid "SEND"
6506 msgstr "SEND"
6507
6508 #. type: TH
6509 #: build/C/man2/send.2:40
6510 #, no-wrap
6511 msgid "2012-04-23"
6512 msgstr "2012-04-23"
6513
6514 #. type: Plain text
6515 #: build/C/man2/send.2:43
6516 msgid "send, sendto, sendmsg - send a message on a socket"
6517 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6518
6519 #. type: Plain text
6520 #: build/C/man2/send.2:47
6521 #, no-wrap
6522 msgid ""
6523 "B<#include E<lt>sys/types.hE<gt>>\n"
6524 "B<#include E<lt>sys/socket.hE<gt>>\n"
6525 msgstr ""
6526 "B<#include E<lt>sys/types.hE<gt>>\n"
6527 "B<#include E<lt>sys/socket.hE<gt>>\n"
6528
6529 #. type: Plain text
6530 #: build/C/man2/send.2:50
6531 #, no-wrap
6532 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6533 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6534
6535 #. type: Plain text
6536 #: build/C/man2/send.2:54
6537 #, no-wrap
6538 msgid ""
6539 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6540 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6541 msgstr ""
6542 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6543 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6544
6545 #. type: Plain text
6546 #: build/C/man2/send.2:57
6547 #, no-wrap
6548 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6549 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6550
6551 #. type: Plain text
6552 #: build/C/man2/send.2:65
6553 msgid ""
6554 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6555 "transmit a message to another socket."
6556 msgstr ""
6557 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6558 "メッセージを転送するのに使用される。"
6559
6560 #. type: Plain text
6561 #: build/C/man2/send.2:84
6562 msgid ""
6563 "The B<send>()  call may be used only when the socket is in a I<connected> "
6564 "state (so that the intended recipient is known).  The only difference "
6565 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6566 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6567 "following call"
6568 msgstr ""
6569 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6570 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6571 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6572 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6573
6574 #. type: Plain text
6575 #: build/C/man2/send.2:86
6576 #, no-wrap
6577 msgid "    send(sockfd, buf, len, flags);\n"
6578 msgstr "    send(sockfd, buf, len, flags);\n"
6579
6580 #. type: Plain text
6581 #: build/C/man2/send.2:88
6582 msgid "is equivalent to"
6583 msgstr "は以下と等価である。"
6584
6585 #. type: Plain text
6586 #: build/C/man2/send.2:90
6587 #, no-wrap
6588 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6589 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6590
6591 #. type: Plain text
6592 #: build/C/man2/send.2:94
6593 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6594 msgstr ""
6595 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6596 "る。"
6597
6598 #. type: Plain text
6599 #: build/C/man2/send.2:122
6600 msgid ""
6601 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6602 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6603 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6604 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6605 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6606 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6607 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6608 "size."
6609 msgstr ""
6610 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6611 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6612 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6613 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6614 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6615 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6616 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6617 "msg_namelen> で指定される。"
6618
6619 #. type: Plain text
6620 #: build/C/man2/send.2:138
6621 msgid ""
6622 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6623 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6624 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6625 "ancillary data (also known as control information)."
6626 msgstr ""
6627 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6628 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6629 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6630 "(制御情報とも呼ばれる) を送信することもできる。"
6631
6632 #. type: Plain text
6633 #: build/C/man2/send.2:143
6634 msgid ""
6635 "If the message is too long to pass atomically through the underlying "
6636 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6637 "transmitted."
6638 msgstr ""
6639 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6640 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6641 "ラーが返され、そのメッセージは転送されない。"
6642
6643 #. type: Plain text
6644 #: build/C/man2/send.2:147
6645 msgid ""
6646 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6647 "detected errors are indicated by a return value of -1."
6648 msgstr ""
6649 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6650 "出された場合は、返り値 -1 として通知される。"
6651
6652 #. type: Plain text
6653 #: build/C/man2/send.2:160
6654 msgid ""
6655 "When the message does not fit into the send buffer of the socket, B<send>()  "
6656 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6657 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6658 "in this case.  The B<select>(2)  call may be used to determine when it is "
6659 "possible to send more data."
6660 msgstr ""
6661 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6662 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6663 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6664 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6665 "用することができる。"
6666
6667 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6668 #. type: Plain text
6669 #: build/C/man2/send.2:166
6670 msgid ""
6671 "The I<flags> argument is the bitwise OR of zero or more of the following "
6672 "flags."
6673 msgstr ""
6674 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6675 "のを指定する。"
6676
6677 #. type: TP
6678 #: build/C/man2/send.2:166
6679 #, no-wrap
6680 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6681 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6682
6683 #. type: Plain text
6684 #: build/C/man2/send.2:180
6685 msgid ""
6686 "Tell the link layer that forward progress happened: you got a successful "
6687 "reply from the other side.  If the link layer doesn't get this it will "
6688 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6689 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
6690 "IPv4 and IPv6.  See B<arp>(7)  for details."
6691 msgstr ""
6692 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6693 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6694 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6695 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6696 "されている。 詳しくは B<arp>(7)  参照のこと。"
6697
6698 #. type: TP
6699 #: build/C/man2/send.2:180
6700 #, no-wrap
6701 msgid "B<MSG_DONTROUTE>"
6702 msgstr "B<MSG_DONTROUTE>"
6703
6704 #. type: Plain text
6705 #: build/C/man2/send.2:188
6706 msgid ""
6707 "Don't use a gateway to send out the packet, only send to hosts on directly "
6708 "connected networks.  This is usually used only by diagnostic or routing "
6709 "programs.  This is only defined for protocol families that route; packet "
6710 "sockets don't."
6711 msgstr ""
6712 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6713 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6714 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6715 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6716
6717 #. type: Plain text
6718 #: build/C/man2/send.2:199
6719 msgid ""
6720 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6721 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6722 "flag with the B<F_SETFL> B<fcntl>(2))."
6723 msgstr ""
6724 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6725 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6726 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6727
6728 #. type: TP
6729 #: build/C/man2/send.2:199
6730 #, no-wrap
6731 msgid "B<MSG_EOR> (since Linux 2.2)"
6732 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6733
6734 #. type: Plain text
6735 #: build/C/man2/send.2:203
6736 msgid ""
6737 "Terminates a record (when this notion is supported, as for sockets of type "
6738 "B<SOCK_SEQPACKET>)."
6739 msgstr ""
6740 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6741 "ケット種別のときに有効)。"
6742
6743 #. type: TP
6744 #: build/C/man2/send.2:203
6745 #, no-wrap
6746 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6747 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6748
6749 #. type: Plain text
6750 #: build/C/man2/send.2:212
6751 msgid ""
6752 "The caller has more data to send.  This flag is used with TCP sockets to "
6753 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6754 "with the difference that this flag can be set on a per-call basis."
6755 msgstr ""
6756 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6757 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6758 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6759 "機能を有効にできる点である。"
6760
6761 #. type: Plain text
6762 #: build/C/man2/send.2:221
6763 msgid ""
6764 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6765 "the kernel to package all of the data sent in calls with this flag set into "
6766 "a single datagram which is only transmitted when a call is performed that "
6767 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6768 "described in B<udp>(7).)"
6769 msgstr ""
6770 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6771 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6772 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6773 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6774 "ソケットオプション B<UDP_CORK> も参照)。"
6775
6776 #. type: TP
6777 #: build/C/man2/send.2:221
6778 #, no-wrap
6779 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6780 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6781
6782 #. type: Plain text
6783 #: build/C/man2/send.2:230
6784 msgid ""
6785 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6786 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6787 msgstr ""
6788 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6789 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6790
6791 #. type: Plain text
6792 #: build/C/man2/send.2:239
6793 msgid ""
6794 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6795 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6796 "data."
6797 msgstr ""
6798 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6799 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6800 "をサポートしている必要がある。"
6801
6802 #. type: Plain text
6803 #: build/C/man2/send.2:246
6804 msgid ""
6805 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6806 "below for an exact description of its fields."
6807 msgstr ""
6808 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6809 "B<recv>(2)  と以下の説明を参照すること。"
6810
6811 #.  Still to be documented:
6812 #.   Send file descriptors and user credentials using the
6813 #.   msg_control* fields.
6814 #.   The flags returned in msg_flags.
6815 #. type: Plain text
6816 #: build/C/man2/send.2:275
6817 msgid ""
6818 "You may send control information using the I<msg_control> and "
6819 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6820 "process is limited per socket by the value in I</proc/sys/net/core/"
6821 "optmem_max>; see B<socket>(7)."
6822 msgstr ""
6823 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6824 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6825 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6826
6827 #. type: Plain text
6828 #: build/C/man2/send.2:280
6829 msgid ""
6830 "On success, these calls return the number of characters sent.  On error, -1 "
6831 "is returned, and I<errno> is set appropriately."
6832 msgstr ""
6833 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6834 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6835
6836 #. type: Plain text
6837 #: build/C/man2/send.2:285
6838 msgid ""
6839 "These are some standard errors generated by the socket layer.  Additional "
6840 "errors may be generated and returned from the underlying protocol modules; "
6841 "see their respective manual pages."
6842 msgstr ""
6843 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6844 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6845 "れぞれのマニュアルを参照すること。"
6846
6847 #. type: Plain text
6848 #: build/C/man2/send.2:293
6849 msgid ""
6850 "(For UNIX domain sockets, which are identified by pathname)  Write "
6851 "permission is denied on the destination socket file, or search permission is "
6852 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6853 "(7).)"
6854 msgstr ""
6855 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6856 "\n"
6857 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6858 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6859 "(B<path_resolution>(7) も参照のこと)"
6860
6861 #. type: Plain text
6862 #: build/C/man2/send.2:296
6863 msgid ""
6864 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6865 "as though it was a unicast address."
6866 msgstr ""
6867 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6868 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6869
6870 #.  Actually EAGAIN on Linux
6871 #. type: Plain text
6872 #: build/C/man2/send.2:304
6873 msgid ""
6874 "The socket is marked nonblocking and the requested operation would block.  "
6875 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6876 "require these constants to have the same value, so a portable application "
6877 "should check for both possibilities."
6878 msgstr ""
6879 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6880 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6881 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6882 "両方の可能性を 確認すべきである。"
6883
6884 #. type: Plain text
6885 #: build/C/man2/send.2:307
6886 msgid "An invalid descriptor was specified."
6887 msgstr "無効なディスクリプターが指定された。"
6888
6889 #. type: TP
6890 #: build/C/man2/send.2:307
6891 #, no-wrap
6892 msgid "B<ECONNRESET>"
6893 msgstr "B<ECONNRESET>"
6894
6895 #. type: Plain text
6896 #: build/C/man2/send.2:310
6897 msgid "Connection reset by peer."
6898 msgstr "接続が接続相手によりリセットされた。"
6899
6900 #. type: TP
6901 #: build/C/man2/send.2:310
6902 #, no-wrap
6903 msgid "B<EDESTADDRREQ>"
6904 msgstr "B<EDESTADDRREQ>"
6905
6906 #. type: Plain text
6907 #: build/C/man2/send.2:313
6908 msgid "The socket is not connection-mode, and no peer address is set."
6909 msgstr ""
6910 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6911 "ていない。"
6912
6913 #. type: Plain text
6914 #: build/C/man2/send.2:316
6915 msgid "An invalid user space address was specified for an argument."
6916 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6917
6918 #. type: Plain text
6919 #: build/C/man2/send.2:320
6920 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6921 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6922
6923 #. type: Plain text
6924 #: build/C/man2/send.2:329
6925 msgid ""
6926 "The connection-mode socket was connected already but a recipient was "
6927 "specified.  (Now either this error is returned, or the recipient "
6928 "specification is ignored.)"
6929 msgstr ""
6930 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6931 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6932 "いずれかとなる)"
6933
6934 #. type: TP
6935 #: build/C/man2/send.2:329
6936 #, no-wrap
6937 msgid "B<EMSGSIZE>"
6938 msgstr "B<EMSGSIZE>"
6939
6940 #.  (e.g., SOCK_DGRAM )
6941 #. type: Plain text
6942 #: build/C/man2/send.2:335
6943 msgid ""
6944 "The socket type requires that message be sent atomically, and the size of "
6945 "the message to be sent made this impossible."
6946 msgstr ""
6947 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6948 "るが、 メッセージが大き過ぎるため送信することができない。"
6949
6950 #. type: Plain text
6951 #: build/C/man2/send.2:343
6952 msgid ""
6953 "The output queue for a network interface was full.  This generally indicates "
6954 "that the interface has stopped sending, but may be caused by transient "
6955 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6956 "silently dropped when a device queue overflows.)"
6957 msgstr ""
6958 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6959 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6960 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6961 "フローした場合にはパケットは黙って捨てられる)"
6962
6963 #. type: Plain text
6964 #: build/C/man2/send.2:346
6965 msgid "No memory available."
6966 msgstr "メモリが足りない。"
6967
6968 #. type: Plain text
6969 #: build/C/man2/send.2:349
6970 msgid "The socket is not connected, and no target has been given."
6971 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6972
6973 #. type: Plain text
6974 #: build/C/man2/send.2:359
6975 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6976 msgstr ""
6977 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6978 "る。"
6979
6980 #. type: TP
6981 #: build/C/man2/send.2:359
6982 #, no-wrap
6983 msgid "B<EPIPE>"
6984 msgstr "B<EPIPE>"
6985
6986 #. type: Plain text
6987 #: build/C/man2/send.2:368
6988 msgid ""
6989 "The local end has been shut down on a connection oriented socket.  In this "
6990 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6991 "set."
6992 msgstr ""
6993 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6994 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6995
6996 #. type: Plain text
6997 #: build/C/man2/send.2:371
6998 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
6999 msgstr ""
7000 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7001
7002 #. type: Plain text
7003 #: build/C/man2/send.2:382
7004 msgid ""
7005 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags.  "
7006 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7007 "flag is a Linux extension."
7008 msgstr ""
7009 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7010 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7011 "ラグは Linux での拡張である。"
7012
7013 #. type: Plain text
7014 #: build/C/man2/send.2:395
7015 msgid ""
7016 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7017 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7018 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7019 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7020 "and libc5.  See also B<accept>(2)."
7021 msgstr ""
7022 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7023 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7024 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7025 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7026 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7027
7028 #. type: Plain text
7029 #: build/C/man2/send.2:414
7030 #, fuzzy
7031 #| msgid ""
7032 #| "See B<sendmmsg(2)> for information about a Linux-specific system call "
7033 #| "that can be used to transmit multiple datagrams in a single call."
7034 msgid ""
7035 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7036 "can be used to transmit multiple datagrams in a single call."
7037 msgstr ""
7038 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7039 "る\n"
7040 "Linux 固有の システムコールに関する情報が書かれている。"
7041
7042 #. type: Plain text
7043 #: build/C/man2/send.2:419
7044 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7045 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7046
7047 #. type: Plain text
7048 #: build/C/man2/send.2:424
7049 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7050 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7051
7052 #. type: Plain text
7053 #: build/C/man2/send.2:439
7054 msgid ""
7055 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7056 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7057 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7058 msgstr ""
7059 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7060 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7061 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7062
7063 #. type: TH
7064 #: build/C/man2/sendmmsg.2:28
7065 #, no-wrap
7066 msgid "SENDMMSG"
7067 msgstr "SENDMMSG"
7068
7069 #. type: TH
7070 #: build/C/man2/sendmmsg.2:28
7071 #, fuzzy, no-wrap
7072 #| msgid "2012-02-27"
7073 msgid "2012-12-16"
7074 msgstr "2012-02-27"
7075
7076 #. type: Plain text
7077 #: build/C/man2/sendmmsg.2:31
7078 msgid "sendmmsg - send multiple messages on a socket"
7079 msgstr ""
7080
7081 #. type: Plain text
7082 #: build/C/man2/sendmmsg.2:39
7083 #, no-wrap
7084 msgid ""
7085 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7086 "B<             unsigned int >I<flags>B<);>\n"
7087 msgstr ""
7088 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7089 "B<             unsigned int >I<flags>B<);>\n"
7090
7091 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7092 #. type: Plain text
7093 #: build/C/man2/sendmmsg.2:49
7094 msgid ""
7095 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7096 "the caller to transmit multiple messages on a socket using a single system "
7097 "call.  (This has performance benefits for some applications.)"
7098 msgstr ""
7099
7100 #. type: Plain text
7101 #: build/C/man2/sendmmsg.2:54
7102 msgid ""
7103 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7104 "to be transmitted."
7105 msgstr ""
7106
7107 #. type: Plain text
7108 #: build/C/man2/sendmmsg.2:75
7109 #, no-wrap
7110 msgid ""
7111 "struct mmsghdr {\n"
7112 "    struct msghdr msg_hdr;  /* Message header */\n"
7113 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7114 "};\n"
7115 msgstr ""
7116
7117 #. type: Plain text
7118 #: build/C/man2/sendmmsg.2:91
7119 msgid ""
7120 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7121 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7122 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7123 "B<sendmsg>(2)  call)."
7124 msgstr ""
7125
7126 #. type: Plain text
7127 #: build/C/man2/sendmmsg.2:97
7128 msgid ""
7129 "The I<flags> argument contains flags ORed together.  The flags are the same "
7130 "as for B<sendmsg>(2)."
7131 msgstr ""
7132
7133 #. type: Plain text
7134 #: build/C/man2/sendmmsg.2:107
7135 msgid ""
7136 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7137 "sent.  A nonblocking call sends as many messages as possible (up to the "
7138 "limit specified by I<vlen>)  and returns immediately."
7139 msgstr ""
7140
7141 #. type: Plain text
7142 #: build/C/man2/sendmmsg.2:119
7143 msgid ""
7144 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7145 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7146 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7147 "of elements of I<msgvec> that have been updated."
7148 msgstr ""
7149
7150 #. type: Plain text
7151 #: build/C/man2/sendmmsg.2:129
7152 msgid ""
7153 "On success, B<sendmmsg>()  returns the number of messages sent from "
7154 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7155 "B<sendmmsg>()  call to send the remaining messages."
7156 msgstr ""
7157
7158 #. type: Plain text
7159 #: build/C/man2/sendmmsg.2:133
7160 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7161 msgstr ""
7162
7163 #
7164 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7165 #.      ... only return an error if no datagrams could be sent.
7166 #.      If less than the requested number of messages were sent, the application
7167 #.      must retry starting at the first failed one and if the problem is
7168 #.      persistent the error will be returned.
7169 #.      This matches the behaviour of other syscalls like read/write - it
7170 #.      is not an error if less than the requested number of elements are sent.
7171 #. type: Plain text
7172 #: build/C/man2/sendmmsg.2:145
7173 msgid ""
7174 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7175 "could be sent."
7176 msgstr ""
7177
7178 #. type: Plain text
7179 #: build/C/man2/sendmmsg.2:150
7180 msgid ""
7181 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7182 "added in version 2.14."
7183 msgstr ""
7184
7185 #. type: Plain text
7186 #: build/C/man2/sendmmsg.2:153
7187 msgid "B<sendmmsg>()  is Linux-specific."
7188 msgstr ""
7189
7190 #
7191 #
7192 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7193 #.      net: Cap number of elements for sendmmsg
7194 #.      To limit the amount of time we can spend in sendmmsg, cap the
7195 #.      number of elements to UIO_MAXIOV (currently 1024).
7196 #.      For error handling an application using sendmmsg needs to retry at
7197 #.      the first unsent message, so capping is simpler and requires less
7198 #.      application logic than returning EINVAL.
7199 #. type: Plain text
7200 #: build/C/man2/sendmmsg.2:168
7201 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7202 msgstr ""
7203
7204 #. type: Plain text
7205 #: build/C/man2/sendmmsg.2:177
7206 msgid ""
7207 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7208 "distinct UDP datagrams using one system call.  The contents of the first "
7209 "datagram originates from a pair of buffers."
7210 msgstr ""
7211
7212 #. type: Plain text
7213 #: build/C/man2/sendmmsg.2:186
7214 #, fuzzy, no-wrap
7215 #| msgid ""
7216 #| "#include E<lt>stdio.hE<gt>\n"
7217 #| "#include E<lt>stdlib.hE<gt>\n"
7218 #| "#include E<lt>sys/time.hE<gt>\n"
7219 #| "#include E<lt>sys/types.hE<gt>\n"
7220 #| "#include E<lt>unistd.hE<gt>\n"
7221 msgid ""
7222 "#define _GNU_SOURCE\n"
7223 "#include E<lt>netinet/ip.hE<gt>\n"
7224 "#include E<lt>stdio.hE<gt>\n"
7225 "#include E<lt>stdlib.hE<gt>\n"
7226 "#include E<lt>string.hE<gt>\n"
7227 "#include E<lt>sys/types.hE<gt>\n"
7228 "#include E<lt>sys/socket.hE<gt>\n"
7229 msgstr ""
7230 "#include E<lt>stdio.hE<gt>\n"
7231 "#include E<lt>stdlib.hE<gt>\n"
7232 "#include E<lt>sys/time.hE<gt>\n"
7233 "#include E<lt>sys/types.hE<gt>\n"
7234 "#include E<lt>unistd.hE<gt>\n"
7235
7236 #. type: Plain text
7237 #: build/C/man2/sendmmsg.2:195
7238 #, fuzzy, no-wrap
7239 #| msgid ""
7240 #| "int\n"
7241 #| "main(void)\n"
7242 #| "{\n"
7243 #| "    fd_set rfds;\n"
7244 #| "    struct timeval tv;\n"
7245 #| "    int retval;\n"
7246 msgid ""
7247 "int\n"
7248 "main(void)\n"
7249 "{\n"
7250 "    int sockfd;\n"
7251 "    struct sockaddr_in sa;\n"
7252 "    struct mmsghdr msg[2];\n"
7253 "    struct iovec msg1[2], msg2;\n"
7254 "    int retval;\n"
7255 msgstr ""
7256 "int\n"
7257 "main(void)\n"
7258 "{\n"
7259 "    fd_set rfds;\n"
7260 "    struct timeval tv;\n"
7261 "    int retval;\n"
7262
7263 #. type: Plain text
7264 #: build/C/man2/sendmmsg.2:209
7265 #, fuzzy, no-wrap
7266 #| msgid ""
7267 #| "    sa.sa_flags = 0;\n"
7268 #| "    sa.sa_handler = child_sig_handler;\n"
7269 #| "    sigemptyset(&sa.sa_mask);\n"
7270 #| "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
7271 #| "        perror(\"sigaction\");\n"
7272 #| "        exit(EXIT_FAILURE);\n"
7273 #| "    }\n"
7274 msgid ""
7275 "    sa.sin_family = AF_INET;\n"
7276 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7277 "    sa.sin_port = htons(1234);\n"
7278 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7279 "        perror(\"connect()\");\n"
7280 "        exit(EXIT_FAILURE);\n"
7281 "    }\n"
7282 msgstr ""
7283 "    sa.sa_flags = 0;\n"
7284 "    sa.sa_handler = child_sig_handler;\n"
7285 "    sigemptyset(&sa.sa_mask);\n"
7286 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
7287 "        perror(\"sigaction\");\n"
7288 "        exit(EXIT_FAILURE);\n"
7289 "    }\n"
7290
7291 #. type: Plain text
7292 #: build/C/man2/sendmmsg.2:215
7293 #, no-wrap
7294 msgid ""
7295 "    memset(msg1, 0, sizeof(msg1));\n"
7296 "    msg1[0].iov_base = \"one\";\n"
7297 "    msg1[0].iov_len = 3;\n"
7298 "    msg1[1].iov_base = \"two\";\n"
7299 "    msg1[1].iov_len = 3;\n"
7300 msgstr ""
7301
7302 #. type: Plain text
7303 #: build/C/man2/sendmmsg.2:219
7304 #, fuzzy, no-wrap
7305 #| msgid ""
7306 #| "    memset(&a, 0, sizeof(a));\n"
7307 #| "    a.sin_port = htons(connect_port);\n"
7308 #| "    a.sin_family = AF_INET;\n"
7309 msgid ""
7310 "    memset(&msg2, 0, sizeof(msg2));\n"
7311 "    msg2.iov_base = \"three\";\n"
7312 "    msg2.iov_len = 5;\n"
7313 msgstr ""
7314 "    memset(&a, 0, sizeof(a));\n"
7315 "    a.sin_port = htons(connect_port);\n"
7316 "    a.sin_family = AF_INET;\n"
7317
7318 #. type: Plain text
7319 #: build/C/man2/sendmmsg.2:223
7320 #, no-wrap
7321 msgid ""
7322 "    memset(msg, 0, sizeof(msg));\n"
7323 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7324 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7325 msgstr ""
7326
7327 #. type: Plain text
7328 #: build/C/man2/sendmmsg.2:226
7329 #, no-wrap
7330 msgid ""
7331 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7332 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7333 msgstr ""
7334
7335 #. type: Plain text
7336 #: build/C/man2/sendmmsg.2:232
7337 #, no-wrap
7338 msgid ""
7339 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7340 "    if (retval == -1)\n"
7341 "        perror(\"sendmmsg()\");\n"
7342 "    else\n"
7343 "        printf(\"%d messages sent\\en\", retval);\n"
7344 msgstr ""
7345
7346 #. type: Plain text
7347 #: build/C/man2/sendmmsg.2:235
7348 #, fuzzy, no-wrap
7349 #| msgid ""
7350 #| "    exit(EXIT_SUCCESS);\n"
7351 #| "}\n"
7352 msgid ""
7353 "    exit(0);\n"
7354 "}\n"
7355 msgstr ""
7356 "    exit(EXIT_SUCCESS);\n"
7357 "}\n"
7358
7359 #. type: Plain text
7360 #: build/C/man2/sendmmsg.2:241
7361 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7362 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7363
7364 #. type: TH
7365 #: build/C/man3/sockatmark.3:25
7366 #, no-wrap
7367 msgid "SOCKATMARK"
7368 msgstr "SOCKATMARK"
7369
7370 #. type: Plain text
7371 #: build/C/man3/sockatmark.3:28
7372 msgid "sockatmark - determine whether socket is at out-of-band mark"
7373 msgstr ""
7374 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7375 "べる"
7376
7377 #. type: Plain text
7378 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7379 #: build/C/man7/socket.7:53 build/C/man2/socketpair.2:49
7380 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7381 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7382
7383 #. type: Plain text
7384 #: build/C/man3/sockatmark.3:32
7385 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7386 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7387
7388 #. type: Plain text
7389 #: build/C/man3/sockatmark.3:41
7390 msgid ""
7391 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7392 "\\ 600"
7393 msgstr ""
7394 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7395 "\\ 600"
7396
7397 #. type: Plain text
7398 #: build/C/man3/sockatmark.3:51
7399 msgid ""
7400 "B<sockatmark>()  returns a value indicating whether or not the socket "
7401 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7402 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7403 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7404 msgstr ""
7405 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7406 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7407 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7408 "この関数は帯域外マークを削除しない。"
7409
7410 #. type: Plain text
7411 #: build/C/man3/sockatmark.3:56
7412 msgid ""
7413 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7414 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7415 "set to indicate the error."
7416 msgstr ""
7417 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7418 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7419 "れ、エラーを表す I<errno> が設定される。"
7420
7421 #. type: Plain text
7422 #: build/C/man3/sockatmark.3:61
7423 msgid "I<sockfd> is not a valid file descriptor."
7424 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7425
7426 #.  POSIX.1 says ENOTTY for this case
7427 #. type: Plain text
7428 #: build/C/man3/sockatmark.3:68
7429 msgid ""
7430 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7431 msgstr ""
7432 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7433
7434 #. type: Plain text
7435 #: build/C/man3/sockatmark.3:71
7436 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7437 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7438
7439 #. type: Plain text
7440 #: build/C/man3/sockatmark.3:73
7441 msgid "POSIX.1-2001."
7442 msgstr "POSIX.1-2001."
7443
7444 #. type: Plain text
7445 #: build/C/man3/sockatmark.3:80
7446 msgid ""
7447 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7448 "the B<MSG_OOB> flag of B<recv>(2)."
7449 msgstr ""
7450 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7451 "B<recv>(2)  で読み込むことができる。"
7452
7453 #. type: Plain text
7454 #: build/C/man3/sockatmark.3:82
7455 msgid "Out-of-band data is only supported on some stream socket protocols."
7456 msgstr ""
7457 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7458 "ない。"
7459
7460 #. type: Plain text
7461 #: build/C/man3/sockatmark.3:87
7462 msgid ""
7463 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7464 "signal."
7465 msgstr ""
7466 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7467 "る。"
7468
7469 #. type: Plain text
7470 #: build/C/man3/sockatmark.3:93
7471 msgid ""
7472 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7473 "operation."
7474 msgstr ""
7475 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7476
7477 #. type: Plain text
7478 #: build/C/man3/sockatmark.3:97
7479 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7480 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7481
7482 #. type: Plain text
7483 #: build/C/man3/sockatmark.3:102
7484 msgid ""
7485 "The following code can be used after receipt of a B<SIGURG> signal to read "
7486 "(and discard) all data up to the mark, and then read the byte of data at the "
7487 "mark:"
7488 msgstr ""
7489 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7490 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7491
7492 #. type: Plain text
7493 #: build/C/man3/sockatmark.3:107
7494 #, no-wrap
7495 msgid ""
7496 "    char buf[BUF_LEN];\n"
7497 "    char oobdata;\n"
7498 "    int atmark, s;\n"
7499 msgstr ""
7500 "    char buf[BUF_LEN];\n"
7501 "    char oobdata;\n"
7502 "    int atmark, s;\n"
7503
7504 #. type: Plain text
7505 #: build/C/man3/sockatmark.3:114
7506 #, no-wrap
7507 msgid ""
7508 "    for (;;) {\n"
7509 "        atmark = sockatmark(sockfd);\n"
7510 "        if (atmark == -1) {\n"
7511 "            perror(\"sockatmark\");\n"
7512 "            break;\n"
7513 "        }\n"
7514 msgstr ""
7515 "    for (;;) {\n"
7516 "        atmark = sockatmark(sockfd);\n"
7517 "        if (atmark == -1) {\n"
7518 "            perror(\"sockatmark\");\n"
7519 "            break;\n"
7520 "        }\n"
7521
7522 #. type: Plain text
7523 #: build/C/man3/sockatmark.3:117
7524 #, no-wrap
7525 msgid ""
7526 "        if (atmark)\n"
7527 "            break;\n"
7528 msgstr ""
7529 "        if (atmark)\n"
7530 "            break;\n"
7531
7532 #. type: Plain text
7533 #: build/C/man3/sockatmark.3:124
7534 #, no-wrap
7535 msgid ""
7536 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7537 "        if (s == -1)\n"
7538 "            perror(\"read\");\n"
7539 "        if (s E<lt>= 0)\n"
7540 "            break;\n"
7541 "    }\n"
7542 msgstr ""
7543 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7544 "        if (s == -1)\n"
7545 "            perror(\"read\");\n"
7546 "        if (s E<lt>= 0)\n"
7547 "            break;\n"
7548 "    }\n"
7549
7550 #. type: Plain text
7551 #: build/C/man3/sockatmark.3:131
7552 #, no-wrap
7553 msgid ""
7554 "    if (atmark == 1) {\n"
7555 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7556 "            perror(\"recv\");\n"
7557 "            ...\n"
7558 "        }\n"
7559 "    }\n"
7560 msgstr ""
7561 "    if (atmark == 1) {\n"
7562 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7563 "            perror(\"recv\");\n"
7564 "            ...\n"
7565 "        }\n"
7566 "    }\n"
7567
7568 #. type: Plain text
7569 #: build/C/man3/sockatmark.3:137
7570 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7571 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7572
7573 #. type: TH
7574 #: build/C/man2/socket.2:43 build/C/man7/socket.7:48
7575 #, no-wrap
7576 msgid "SOCKET"
7577 msgstr "SOCKET"
7578
7579 #. type: TH
7580 #: build/C/man2/socket.2:43
7581 #, no-wrap
7582 msgid "2009-01-19"
7583 msgstr "2009-01-19"
7584
7585 #. type: Plain text
7586 #: build/C/man2/socket.2:46
7587 msgid "socket - create an endpoint for communication"
7588 msgstr "socket - 通信のための端点(endpoint)を作成する"
7589
7590 #. type: Plain text
7591 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7592 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7593 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7594
7595 #. type: Plain text
7596 #: build/C/man2/socket.2:52
7597 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7598 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7599
7600 #. type: Plain text
7601 #: build/C/man2/socket.2:55
7602 msgid ""
7603 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7604 msgstr ""
7605 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7606 "(descriptor)を返す。"
7607
7608 #. type: Plain text
7609 #: build/C/man2/socket.2:63
7610 msgid ""
7611 "The I<domain> argument specifies a communication domain; this selects the "
7612 "protocol family which will be used for communication.  These families are "
7613 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7614 "include:"
7615 msgstr ""
7616 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7617 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7618 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7619 "下の通り。"
7620
7621 #. type: tbl table
7622 #: build/C/man2/socket.2:66
7623 #, no-wrap
7624 msgid "Name:Purpose:Man page\n"
7625 msgstr "名前:目的:マニュアル\n"
7626
7627 #. type: tbl table
7628 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7629 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7630 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7631 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7632 #, no-wrap
7633 msgid "T{\n"
7634 msgstr "T{\n"
7635
7636 #. type: tbl table
7637 #: build/C/man2/socket.2:68
7638 #, no-wrap
7639 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7640 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7641
7642 #. type: tbl table
7643 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7644 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7645 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7646 #: build/C/man7/socket.7:184
7647 #, no-wrap
7648 msgid "T}:T{\n"
7649 msgstr "T}:T{\n"
7650
7651 #. type: tbl table
7652 #: build/C/man2/socket.2:70
7653 #, no-wrap
7654 msgid "Local communication\n"
7655 msgstr "ローカル通信\n"
7656
7657 #. type: tbl table
7658 #: build/C/man2/socket.2:72
7659 #, no-wrap
7660 msgid "B<unix>(7)\n"
7661 msgstr "B<unix>(7)\n"
7662
7663 #. type: tbl table
7664 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7665 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7666 #: build/C/man2/socket.2:118 build/C/man7/socket.7:163
7667 #: build/C/man7/socket.7:167 build/C/man7/socket.7:170
7668 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
7669 #: build/C/man7/socket.7:188 build/C/man7/socket.7:195
7670 #, no-wrap
7671 msgid "T}\n"
7672 msgstr "T}\n"
7673
7674 #. type: tbl table
7675 #: build/C/man2/socket.2:75
7676 #, no-wrap
7677 msgid "B<AF_INET>\n"
7678 msgstr "B<AF_INET>\n"
7679
7680 #. type: tbl table
7681 #: build/C/man2/socket.2:76
7682 #, no-wrap
7683 msgid "T}:IPv4 Internet protocols:T{\n"
7684 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7685
7686 #. type: tbl table
7687 #: build/C/man2/socket.2:77
7688 #, no-wrap
7689 msgid "B<ip>(7)\n"
7690 msgstr "B<ip>(7)\n"
7691
7692 #. type: tbl table
7693 #: build/C/man2/socket.2:80
7694 #, no-wrap
7695 msgid "B<AF_INET6>\n"
7696 msgstr "B<AF_INET6>\n"
7697
7698 #. type: tbl table
7699 #: build/C/man2/socket.2:81
7700 #, no-wrap
7701 msgid "T}:IPv6 Internet protocols:T{\n"
7702 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7703
7704 #. type: tbl table
7705 #: build/C/man2/socket.2:82
7706 #, no-wrap
7707 msgid "B<ipv6>(7)\n"
7708 msgstr "B<ipv6>(7)\n"
7709
7710 #. type: tbl table
7711 #: build/C/man2/socket.2:85
7712 #, no-wrap
7713 msgid "B<AF_IPX>\n"
7714 msgstr "B<AF_IPX>\n"
7715
7716 #. type: tbl table
7717 #: build/C/man2/socket.2:86
7718 #, no-wrap
7719 msgid "T}:IPX - Novell protocols:\n"
7720 msgstr "T}:IPX - Novell プロトコル:\n"
7721
7722 #. type: tbl table
7723 #: build/C/man2/socket.2:88
7724 #, no-wrap
7725 msgid "B<AF_NETLINK>\n"
7726 msgstr "B<AF_NETLINK>\n"
7727
7728 #. type: tbl table
7729 #: build/C/man2/socket.2:90
7730 #, no-wrap
7731 msgid "Kernel user interface device\n"
7732 msgstr "カーネル・ユーザ・デバイス\n"
7733
7734 #. type: tbl table
7735 #: build/C/man2/socket.2:92
7736 #, no-wrap
7737 msgid "B<netlink>(7)\n"
7738 msgstr "B<netlink>(7)\n"
7739
7740 #. type: tbl table
7741 #: build/C/man2/socket.2:95
7742 #, no-wrap
7743 msgid "B<AF_X25>\n"
7744 msgstr "B<AF_X25>\n"
7745
7746 #. type: tbl table
7747 #: build/C/man2/socket.2:96
7748 #, no-wrap
7749 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
7750 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
7751
7752 #. type: tbl table
7753 #: build/C/man2/socket.2:97
7754 #, no-wrap
7755 msgid "B<x25>(7)\n"
7756 msgstr "B<x25>(7)\n"
7757
7758 #. type: tbl table
7759 #: build/C/man2/socket.2:100
7760 #, no-wrap
7761 msgid "B<AF_AX25>\n"
7762 msgstr "B<AF_AX25>\n"
7763
7764 #. type: tbl table
7765 #: build/C/man2/socket.2:102
7766 #, no-wrap
7767 msgid "Amateur radio AX.25 protocol\n"
7768 msgstr "アマチュア無線 AX.25 プロトコル\n"
7769
7770 #. type: tbl table
7771 #: build/C/man2/socket.2:103
7772 #, no-wrap
7773 msgid "T}:\n"
7774 msgstr "T}:\n"
7775
7776 #. type: tbl table
7777 #: build/C/man2/socket.2:105
7778 #, no-wrap
7779 msgid "B<AF_ATMPVC>\n"
7780 msgstr "B<AF_ATMPVC>\n"
7781
7782 #. type: tbl table
7783 #: build/C/man2/socket.2:106
7784 #, no-wrap
7785 msgid "T}:Access to raw ATM PVCs:\n"
7786 msgstr "T}:生の ATM PVC にアクセスする:\n"
7787
7788 #. type: tbl table
7789 #: build/C/man2/socket.2:108
7790 #, no-wrap
7791 msgid "B<AF_APPLETALK>\n"
7792 msgstr "B<AF_APPLETALK>\n"
7793
7794 #. type: tbl table
7795 #: build/C/man2/socket.2:109
7796 #, no-wrap
7797 msgid "T}:Appletalk:T{\n"
7798 msgstr "T}:アップルトーク:T{\n"
7799
7800 #. type: tbl table
7801 #: build/C/man2/socket.2:110
7802 #, no-wrap
7803 msgid "B<ddp>(7)\n"
7804 msgstr "B<ddp>(7)\n"
7805
7806 #. type: tbl table
7807 #: build/C/man2/socket.2:113
7808 #, no-wrap
7809 msgid "B<AF_PACKET>\n"
7810 msgstr "B<AF_PACKET>\n"
7811
7812 #. type: tbl table
7813 #: build/C/man2/socket.2:115
7814 #, no-wrap
7815 msgid "Low level packet interface\n"
7816 msgstr "低レベルのパケットインターフェース\n"
7817
7818 #. type: tbl table
7819 #: build/C/man2/socket.2:117
7820 #, no-wrap
7821 msgid "B<packet>(7)\n"
7822 msgstr "B<packet>(7)\n"
7823
7824 #. type: Plain text
7825 #: build/C/man2/socket.2:126
7826 msgid ""
7827 "The socket has the indicated I<type>, which specifies the communication "
7828 "semantics.  Currently defined types are:"
7829 msgstr ""
7830 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7831 "る。 定義されている型は現在以下の通り。"
7832
7833 #. type: TP
7834 #: build/C/man2/socket.2:126
7835 #, no-wrap
7836 msgid "B<SOCK_STREAM>"
7837 msgstr "B<SOCK_STREAM>"
7838
7839 #. type: Plain text
7840 #: build/C/man2/socket.2:130
7841 msgid ""
7842 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
7843 "out-of-band data transmission mechanism may be supported."
7844 msgstr ""
7845 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7846 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7847
7848 #. type: TP
7849 #: build/C/man2/socket.2:130
7850 #, no-wrap
7851 msgid "B<SOCK_DGRAM>"
7852 msgstr "B<SOCK_DGRAM>"
7853
7854 #. type: Plain text
7855 #: build/C/man2/socket.2:134
7856 msgid ""
7857 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7858 "length)."
7859 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ)  をサポートする。"
7860
7861 #. type: TP
7862 #: build/C/man2/socket.2:134
7863 #, no-wrap
7864 msgid "B<SOCK_SEQPACKET>"
7865 msgstr "B<SOCK_SEQPACKET>"
7866
7867 #. type: Plain text
7868 #: build/C/man2/socket.2:139
7869 msgid ""
7870 "Provides a sequenced, reliable, two-way connection-based data transmission "
7871 "path for datagrams of fixed maximum length; a consumer is required to read "
7872 "an entire packet with each input system call."
7873 msgstr ""
7874 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7875 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7876 "ト全体を読み取ることが要求される。"
7877
7878 #. type: TP
7879 #: build/C/man2/socket.2:139
7880 #, no-wrap
7881 msgid "B<SOCK_RAW>"
7882 msgstr "B<SOCK_RAW>"
7883
7884 #. type: Plain text
7885 #: build/C/man2/socket.2:142
7886 msgid "Provides raw network protocol access."
7887 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7888
7889 #. type: TP
7890 #: build/C/man2/socket.2:142
7891 #, no-wrap
7892 msgid "B<SOCK_RDM>"
7893 msgstr "B<SOCK_RDM>"
7894
7895 #. type: Plain text
7896 #: build/C/man2/socket.2:145
7897 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7898 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7899
7900 #. type: TP
7901 #: build/C/man2/socket.2:145
7902 #, no-wrap
7903 msgid "B<SOCK_PACKET>"
7904 msgstr "B<SOCK_PACKET>"
7905
7906 #. type: Plain text
7907 #: build/C/man2/socket.2:150
7908 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7909 msgstr ""
7910 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7911 "こと"
7912
7913 #. type: Plain text
7914 #: build/C/man2/socket.2:156
7915 msgid ""
7916 "Some socket types may not be implemented by all protocol families; for "
7917 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7918 msgstr ""
7919 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7920 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7921
7922 #. type: Plain text
7923 #: build/C/man2/socket.2:164
7924 msgid ""
7925 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7926 "addition to specifying a socket type, it may include the bitwise OR of any "
7927 "of the following values, to modify the behavior of B<socket>():"
7928 msgstr ""
7929 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7930 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7931 "ることで、 B<socket>()  の振舞いを変更することができる。"
7932
7933 #. type: Plain text
7934 #: build/C/man2/socket.2:198
7935 msgid ""
7936 "The I<protocol> specifies a particular protocol to be used with the socket.  "
7937 "Normally only a single protocol exists to support a particular socket type "
7938 "within a given protocol family, in which case I<protocol> can be specified "
7939 "as 0.  However, it is possible that many protocols may exist, in which case "
7940 "a particular protocol must be specified in this manner.  The protocol number "
7941 "to use is specific to the ``communication domain'' in which communication is "
7942 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
7943 "protocol name strings to protocol numbers."
7944 msgstr ""
7945 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7946 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7947 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7948 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7949 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7950 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
7951 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
7952
7953 #. type: Plain text
7954 #: build/C/man2/socket.2:228
7955 msgid ""
7956 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7957 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7958 "a I<connected> state before any data may be sent or received on it.  A "
7959 "connection to another socket is created with a B<connect>(2)  call.  Once "
7960 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7961 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7962 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7963 "also be transmitted as described in B<send>(2)  and received as described in "
7964 "B<recv>(2)."
7965 msgstr ""
7966 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7967 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7968 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7969 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7970 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7971 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7972 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7973
7974 #. type: Plain text
7975 #: build/C/man2/socket.2:254
7976 msgid ""
7977 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7978 "data is not lost or duplicated.  If a piece of data for which the peer "
7979 "protocol has buffer space cannot be successfully transmitted within a "
7980 "reasonable length of time, then the connection is considered to be dead.  "
7981 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7982 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
7983 "signal is raised if a process sends or receives on a broken stream; this "
7984 "causes naive processes, which do not handle the signal, to exit.  "
7985 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7986 "sockets.  The only difference is that B<read>(2)  calls will return only the "
7987 "amount of data requested, and any data remaining in the arriving packet will "
7988 "be discarded.  Also all message boundaries in incoming datagrams are "
7989 "preserved."
7990 msgstr ""
7991 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7992 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7993 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7994 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7995 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7996 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7997 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7998 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
7999 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8000 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8001
8002 #. type: Plain text
8003 #: build/C/man2/socket.2:264
8004 msgid ""
8005 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8006 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8007 "received with B<recvfrom>(2), which returns the next datagram along with the "
8008 "address of its sender."
8009 msgstr ""
8010 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8011 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8012 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8013 "す。"
8014
8015 #. type: Plain text
8016 #: build/C/man2/socket.2:271
8017 msgid ""
8018 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8019 "from the device driver.  Use B<packet>(7)  instead."
8020 msgstr ""
8021 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8022 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8023
8024 #. type: Plain text
8025 #: build/C/man2/socket.2:294
8026 msgid ""
8027 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8028 "process group to receive a B<SIGURG> signal when the out-of-band data "
8029 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8030 "unexpectedly.  This operation may also be used to set the process or process "
8031 "group that receives the I/O and asynchronous notification of I/O events via "
8032 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8033 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8034 msgstr ""
8035 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8036 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8037 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8038 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8039 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8040 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8041 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8042
8043 #. type: Plain text
8044 #: build/C/man2/socket.2:304
8045 msgid ""
8046 "When the network signals an error condition to the protocol module (e.g., "
8047 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8048 "The next operation on this socket will return the error code of the pending "
8049 "error.  For some protocols it is possible to enable a per-socket error queue "
8050 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8051 "(7)."
8052 msgstr ""
8053 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8054 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8055 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8056 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8057 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8058 "B<IP_RECVERR> を参照すること。"
8059
8060 #. type: Plain text
8061 #: build/C/man2/socket.2:314
8062 msgid ""
8063 "The operation of sockets is controlled by socket level I<options>.  These "
8064 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8065 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8066 "respectively."
8067 msgstr ""
8068 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8069 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8070 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8071
8072 #. type: Plain text
8073 #: build/C/man2/socket.2:319
8074 msgid ""
8075 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8076 "is returned, and I<errno> is set appropriately."
8077 msgstr ""
8078 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8079 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8080
8081 #. type: Plain text
8082 #: build/C/man2/socket.2:324
8083 msgid ""
8084 "Permission to create a socket of the specified type and/or protocol is "
8085 "denied."
8086 msgstr ""
8087 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8088
8089 #. type: Plain text
8090 #: build/C/man2/socket.2:327
8091 msgid "The implementation does not support the specified address family."
8092 msgstr "指定されたアドレスファミリーがサポートされていない。"
8093
8094 #. type: Plain text
8095 #: build/C/man2/socket.2:330
8096 msgid "Unknown protocol, or protocol family not available."
8097 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8098
8099 #.  Since Linux 2.6.27
8100 #. type: Plain text
8101 #: build/C/man2/socket.2:335
8102 msgid "Invalid flags in I<type>."
8103 msgstr "I<type> に無効なフラグが指定されている。"
8104
8105 #. type: Plain text
8106 #: build/C/man2/socket.2:338
8107 msgid "Process file table overflow."
8108 msgstr "プロセスのファイルテーブルが溢れている。"
8109
8110 #. type: TP
8111 #: build/C/man2/socket.2:341
8112 #, no-wrap
8113 msgid "B<ENOBUFS> or B<ENOMEM>"
8114 msgstr "B<ENOBUFS> または B<ENOMEM>"
8115
8116 #. type: Plain text
8117 #: build/C/man2/socket.2:346
8118 msgid ""
8119 "Insufficient memory is available.  The socket cannot be created until "
8120 "sufficient resources are freed."
8121 msgstr ""
8122 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8123 "ない。"
8124
8125 #. type: TP
8126 #: build/C/man2/socket.2:346 build/C/man2/socketpair.2:92
8127 #, no-wrap
8128 msgid "B<EPROTONOSUPPORT>"
8129 msgstr "B<EPROTONOSUPPORT>"
8130
8131 #. type: Plain text
8132 #: build/C/man2/socket.2:350
8133 msgid ""
8134 "The protocol type or the specified protocol is not supported within this "
8135 "domain."
8136 msgstr ""
8137 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8138 "いない。"
8139
8140 #. type: Plain text
8141 #: build/C/man2/socket.2:352
8142 msgid "Other errors may be generated by the underlying protocol modules."
8143 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8144
8145 #. type: Plain text
8146 #: build/C/man2/socket.2:354
8147 msgid "4.4BSD, POSIX.1-2001."
8148 msgstr "4.4BSD, POSIX.1-2001."
8149
8150 #. type: Plain text
8151 #: build/C/man2/socket.2:360
8152 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8153 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8154
8155 #. type: Plain text
8156 #: build/C/man2/socket.2:366
8157 msgid ""
8158 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8159 "systems supporting clones of the BSD socket layer (including System V "
8160 "variants)."
8161 msgstr ""
8162 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8163 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8164 "外のシステムからの移植ができる。"
8165
8166 #. type: Plain text
8167 #: build/C/man2/socket.2:385
8168 #, fuzzy
8169 #| msgid ""
8170 #| "The manifest constants used under 4.x BSD for protocol families are "
8171 #| "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<PF_INET>, and so "
8172 #| "on are used for address families.  However, already the BSD man page "
8173 #| "promises: \"The protocol family generally is the same as the address "
8174 #| "family\", and subsequent standards use AF_* everywhere."
8175 msgid ""
8176 "The manifest constants used under 4.x BSD for protocol families are "
8177 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8178 "are used for address families.  However, already the BSD man page promises: "
8179 "\"The protocol family generally is the same as the address family\", and "
8180 "subsequent standards use AF_* everywhere."
8181 msgstr ""
8182 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8183 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8184 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8185 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8186 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8187 "それ以外の規格では全ての場所で AF_* が使用されている。"
8188
8189 #. type: Plain text
8190 #: build/C/man2/socket.2:390
8191 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8192 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8193
8194 #. type: Plain text
8195 #: build/C/man2/socket.2:413
8196 msgid ""
8197 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8198 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8199 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8200 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8201 "(7), B<unix>(7)"
8202 msgstr ""
8203 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8204 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8205 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8206 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8207 "(7), B<unix>(7)"
8208
8209 #. type: Plain text
8210 #: build/C/man2/socket.2:419
8211 #, fuzzy
8212 #| msgid ""
8213 #| "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq is "
8214 #| "reprinted in I<UNIX Programmer's Supplementary Documents Volume 1.>"
8215 msgid ""
8216 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8217 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8218 "Programmer's Supplementary Documents Volume 1.>"
8219 msgstr ""
8220 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq は "
8221 "I<UNIX Programmer's Supplementary Documents Volume 1> として再版された。"
8222
8223 #. type: TH
8224 #: build/C/man7/socket.7:48
8225 #, no-wrap
8226 msgid "2013-03-15"
8227 msgstr ""
8228
8229 #. type: Plain text
8230 #: build/C/man7/socket.7:51
8231 msgid "socket - Linux socket interface"
8232 msgstr "socket - Linux のソケットインターフェース"
8233
8234 #. type: Plain text
8235 #: build/C/man7/socket.7:55
8236 msgid ""
8237 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8238 ">I<protocol>B<);>"
8239 msgstr ""
8240 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8241 ">I<protocol>B<);>"
8242
8243 #. type: Plain text
8244 #: build/C/man7/socket.7:74
8245 msgid ""
8246 "This manual page describes the Linux networking socket layer user "
8247 "interface.  The BSD compatible sockets are the uniform interface between the "
8248 "user process and the network protocol stacks in the kernel.  The protocol "
8249 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
8250 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
8251 "B<socket>(2)  for more information on families and types."
8252 msgstr ""
8253 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8254 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8255 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8256 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8257 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8258 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8259 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8260
8261 #. type: SS
8262 #: build/C/man7/socket.7:74
8263 #, fuzzy, no-wrap
8264 #| msgid "Socket Layer Functions"
8265 msgid "Socket-layer functions"
8266 msgstr "ソケット層の関数群"
8267
8268 #. type: Plain text
8269 #: build/C/man7/socket.7:78
8270 msgid ""
8271 "These functions are used by the user process to send or receive packets and "
8272 "to do other socket operations.  For more information see their respective "
8273 "manual pages."
8274 msgstr ""
8275 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8276 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8277
8278 #. type: Plain text
8279 #: build/C/man7/socket.7:94
8280 msgid ""
8281 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8282 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8283 "address, B<listen>(2)  tells the socket that new connections shall be "
8284 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8285 "connection.  B<socketpair>(2)  returns two connected anonymous sockets (only "
8286 "implemented for a few local families like B<AF_UNIX>)"
8287 msgstr ""
8288 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8289 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8290 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8291 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8292 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8293 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8294 "リーでしか実装されていない)。"
8295
8296 #. type: Plain text
8297 #: build/C/man7/socket.7:116
8298 msgid ""
8299 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8300 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8301 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8302 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8303 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8304 "write data."
8305 msgstr ""
8306 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8307 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8308 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8309 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8310 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8311 "ことができる。"
8312
8313 #. type: Plain text
8314 #: build/C/man7/socket.7:127
8315 msgid ""
8316 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8317 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8318 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8319 "be used to set or read some other options."
8320 msgstr ""
8321 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8322 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8323 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8324 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8325
8326 #. type: Plain text
8327 #: build/C/man7/socket.7:132
8328 msgid ""
8329 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8330 "full-duplex socket connection."
8331 msgstr ""
8332 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8333 "続を部分的にクローズする。"
8334
8335 #. type: Plain text
8336 #: build/C/man7/socket.7:138
8337 msgid ""
8338 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8339 "not supported on sockets."
8340 msgstr ""
8341 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8342 "ではサポートされていない。"
8343
8344 #. type: Plain text
8345 #: build/C/man7/socket.7:155
8346 msgid ""
8347 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8348 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8349 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8350 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8351 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8352 msgstr ""
8353 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8354 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8355 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8356 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8357 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8358 "B<select>(2)  を使って待つことができる。"
8359
8360 #. type: tbl table
8361 #: build/C/man7/socket.7:159
8362 #, no-wrap
8363 msgid "I/O events\n"
8364 msgstr "I/O イベント\n"
8365
8366 #. type: tbl table
8367 #: build/C/man7/socket.7:160
8368 #, no-wrap
8369 msgid "Event:Poll flag:Occurrence\n"
8370 msgstr "イベント:poll フラグ:内容\n"
8371
8372 #. type: tbl table
8373 #: build/C/man7/socket.7:161 build/C/man7/socket.7:164
8374 #, no-wrap
8375 msgid "Read:POLLIN:T{\n"
8376 msgstr "Read:POLLIN:T{\n"
8377
8378 #. type: tbl table
8379 #: build/C/man7/socket.7:162
8380 #, no-wrap
8381 msgid "New data arrived.\n"
8382 msgstr "新しいデータが到着した。\n"
8383
8384 #. type: tbl table
8385 #: build/C/man7/socket.7:165
8386 #, no-wrap
8387 msgid "A connection setup has been completed\n"
8388 msgstr "(接続志向のソケットで)\n"
8389
8390 #. type: tbl table
8391 #: build/C/man7/socket.7:166
8392 #, no-wrap
8393 msgid "(for connection-oriented sockets)\n"
8394 msgstr "接続の設定が終了した。\n"
8395
8396 #. type: tbl table
8397 #: build/C/man7/socket.7:168 build/C/man7/socket.7:171
8398 #, no-wrap
8399 msgid "Read:POLLHUP:T{\n"
8400 msgstr "Read:POLLHUP:T{\n"
8401
8402 #. type: tbl table
8403 #: build/C/man7/socket.7:169
8404 #, no-wrap
8405 msgid "A disconnection request has been initiated by the other end.\n"
8406 msgstr "接続先で切断要求が生成された。\n"
8407
8408 #. type: tbl table
8409 #: build/C/man7/socket.7:172
8410 #, no-wrap
8411 msgid "A connection is broken (only for connection-oriented protocols).\n"
8412 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8413
8414 #. type: tbl table
8415 #: build/C/man7/socket.7:173
8416 #, no-wrap
8417 msgid "When the socket is written\n"
8418 msgstr "この場合、ソケットに書き込みが行われると\n"
8419
8420 #. type: tbl table
8421 #: build/C/man7/socket.7:174
8422 #, no-wrap
8423 msgid "B<SIGPIPE>\n"
8424 msgstr "B<SIGPIPE>\n"
8425
8426 #. type: tbl table
8427 #: build/C/man7/socket.7:175
8428 #, no-wrap
8429 msgid "is also sent.\n"
8430 msgstr "も送信される。\n"
8431
8432 #. type: tbl table
8433 #: build/C/man7/socket.7:177
8434 #, no-wrap
8435 msgid "Write:POLLOUT:T{\n"
8436 msgstr "Write:POLLOUT:T{\n"
8437
8438 #. type: tbl table
8439 #: build/C/man7/socket.7:178
8440 #, no-wrap
8441 msgid "Socket has enough send buffer space for writing new data.\n"
8442 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
8443
8444 #. type: tbl table
8445 #: build/C/man7/socket.7:180
8446 #, no-wrap
8447 msgid "Read/Write:T{\n"
8448 msgstr "Read/Write:T{\n"
8449
8450 #. type: tbl table
8451 #: build/C/man7/socket.7:181
8452 #, no-wrap
8453 msgid "POLLIN|\n"
8454 msgstr "POLLIN|\n"
8455
8456 #. type: tbl table
8457 #: build/C/man7/socket.7:182
8458 #, no-wrap
8459 msgid ".br\n"
8460 msgstr ".br\n"
8461
8462 #. type: tbl table
8463 #: build/C/man7/socket.7:183
8464 #, no-wrap
8465 msgid "POLLOUT\n"
8466 msgstr "POLLOUT\n"
8467
8468 #. type: tbl table
8469 #: build/C/man7/socket.7:185
8470 #, no-wrap
8471 msgid "An outgoing\n"
8472 msgstr "外部向けの\n"
8473
8474 #. type: tbl table
8475 #: build/C/man7/socket.7:186
8476 #, no-wrap
8477 msgid "B<connect>(2)\n"
8478 msgstr "B<connect>(2)\n"
8479
8480 #. type: tbl table
8481 #: build/C/man7/socket.7:187
8482 #, no-wrap
8483 msgid "finished.\n"
8484 msgstr "が終了した。\n"
8485
8486 #. type: tbl table
8487 #: build/C/man7/socket.7:189
8488 #, no-wrap
8489 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8490 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8491
8492 #. type: tbl table
8493 #: build/C/man7/socket.7:190
8494 #, no-wrap
8495 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8496 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8497
8498 #. type: tbl table
8499 #: build/C/man7/socket.7:191
8500 #, no-wrap
8501 msgid "Exception:POLLPRI:T{\n"
8502 msgstr "Exception:POLLPRI:T{\n"
8503
8504 #. type: tbl table
8505 #: build/C/man7/socket.7:192
8506 #, no-wrap
8507 msgid "Urgent data arrived.\n"
8508 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8509
8510 #. type: tbl table
8511 #: build/C/man7/socket.7:193
8512 #, no-wrap
8513 msgid "B<SIGURG>\n"
8514 msgstr "B<SIGURG>\n"
8515
8516 #. type: tbl table
8517 #: build/C/man7/socket.7:194
8518 #, no-wrap
8519 msgid "is sent then.\n"
8520 msgstr "が送信される。\n"
8521
8522 #. type: Plain text
8523 #: build/C/man7/socket.7:223
8524 msgid ""
8525 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8526 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8527 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8528 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8529 "I<Signals> discussion below."
8530 msgstr ""
8531 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8532 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8533 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8534 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8535 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8536 "と。"
8537
8538 #. type: SS
8539 #: build/C/man7/socket.7:223
8540 #, no-wrap
8541 msgid "Socket address structures"
8542 msgstr ""
8543
8544 #. type: Plain text
8545 #: build/C/man7/socket.7:239
8546 msgid ""
8547 "Each socket domain has its own format for socket addresses, with a domain-"
8548 "specific address structure.  Each of these structures begins with an integer "
8549 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8550 "address structure.  This allows the various system calls (e.g., B<connect>"
8551 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8552 "are generic to all socket domains, to determine the domain of a particular "
8553 "socket address."
8554 msgstr ""
8555
8556 #. type: Plain text
8557 #: build/C/man7/socket.7:249
8558 msgid ""
8559 "To allow any type of socket address to be passed to interfaces in the "
8560 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8561 "type is purely to allow casting of domain-specific socket address types to a "
8562 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8563 "calls to the sockets API."
8564 msgstr ""
8565
8566 #. type: Plain text
8567 #: build/C/man7/socket.7:259
8568 msgid ""
8569 "In addition, the sockets API provides the data type I<struct "
8570 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8571 "domain-specific socket address structures; it is large enough and is aligned "
8572 "properly.  (In particular, it is large enough to hold IPv6 socket "
8573 "addresses.)  The structure includes the following field, which can be used "
8574 "to identify the type of socket address actually stored in the structure:"
8575 msgstr ""
8576
8577 #. type: Plain text
8578 #: build/C/man7/socket.7:263
8579 #, no-wrap
8580 msgid "    sa_family_t ss_family;\n"
8581 msgstr ""
8582
8583 #. type: Plain text
8584 #: build/C/man7/socket.7:271
8585 msgid ""
8586 "The I<sockaddr_storage> structure is useful in programs that must handle "
8587 "socket addresses in a generic way (e.g., programs that must deal with both "
8588 "IPv4 and IPv6 socket addresses)."
8589 msgstr ""
8590
8591 #. type: SS
8592 #: build/C/man7/socket.7:271
8593 #, fuzzy, no-wrap
8594 #| msgid "Socket Options"
8595 msgid "Socket options"
8596 msgstr "ソケットオプション"
8597
8598 #.  FIXME
8599 #.  In the list below, the text used to describe argument types
8600 #.  for each socket option should be more consistent
8601 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8602 #.  W R Stevens, UNPv1
8603 #. type: Plain text
8604 #: build/C/man7/socket.7:285
8605 msgid ""
8606 "These socket options can be set by using B<setsockopt>(2)  and read with "
8607 "B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for all sockets:"
8608 msgstr ""
8609 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
8610 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8611 "レベルには B<SOL_SOCKET> を指定すること。"
8612
8613 #. type: TP
8614 #: build/C/man7/socket.7:285
8615 #, no-wrap
8616 msgid "B<SO_ACCEPTCONN>"
8617 msgstr "B<SO_ACCEPTCONN>"
8618
8619 #. type: Plain text
8620 #: build/C/man7/socket.7:293
8621 msgid ""
8622 "Returns a value indicating whether or not this socket has been marked to "
8623 "accept connections with B<listen>(2).  The value 0 indicates that this is "
8624 "not a listening socket, the value 1 indicates that this is a listening "
8625 "socket.  This socket option is read-only."
8626 msgstr ""
8627 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
8628 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8629 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8630
8631 #. type: TP
8632 #: build/C/man7/socket.7:293
8633 #, no-wrap
8634 msgid "B<SO_BINDTODEVICE>"
8635 msgstr "B<SO_BINDTODEVICE>"
8636
8637 #. type: Plain text
8638 #: build/C/man7/socket.7:312
8639 msgid ""
8640 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8641 "the passed interface name.  If the name is an empty string or the option "
8642 "length is zero, the socket device binding is removed.  The passed option is "
8643 "a variable-length null-terminated interface name string with the maximum "
8644 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
8645 "received from that particular interface are processed by the socket.  Note "
8646 "that this only works for some socket types, particularly B<AF_INET> "
8647 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
8648 "there)."
8649 msgstr ""
8650 "このソケットを、引き数で渡したインターフェース名で指定される\n"
8651 "(\\(lqeth0\\(rq のような) 特定のデバイスにバインドする。\n"
8652 "名前が空文字列だったり、オプションの長さ (optlen) が 0 の場合には、\n"
8653 "ソケットのバインドが削除される。渡すオプションは、インターフェース名が\n"
8654 "入ったヌル文字で終端された可変長の文字列である。\n"
8655 "文字列の最大のサイズは B<IFNAMSIX> である。\n"
8656 "ソケットがインターフェースにバインドされると、その特定のインターフェース\n"
8657 "から受信されたパケットだけを処理する。\n"
8658 "このオプションはいくつかのソケットタイプ、\n"
8659 "特に B<AF_INET> に対してのみ動作する点に注意すること。\n"
8660 "パケットソケットではサポートされていない (通常の B<bind>(2) を使うこと)。"
8661
8662 #. type: Plain text
8663 #: build/C/man7/socket.7:326
8664 msgid ""
8665 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8666 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
8667 "argument should contain the buffer size available to receive the device name "
8668 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
8669 "reported back in the I<optlen> argument."
8670 msgstr ""
8671
8672 #. type: TP
8673 #: build/C/man7/socket.7:326
8674 #, no-wrap
8675 msgid "B<SO_BROADCAST>"
8676 msgstr "B<SO_BROADCAST>"
8677
8678 #. type: Plain text
8679 #: build/C/man7/socket.7:332
8680 msgid ""
8681 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
8682 "to send packets to a broadcast address.  This option has no effect on stream-"
8683 "oriented sockets."
8684 msgstr ""
8685 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
8686 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
8687 "ストリーム指向のソケットには何の効果もない。"
8688
8689 #. type: TP
8690 #: build/C/man7/socket.7:332
8691 #, no-wrap
8692 msgid "B<SO_BSDCOMPAT>"
8693 msgstr "B<SO_BSDCOMPAT>"
8694
8695 #. type: Plain text
8696 #: build/C/man7/socket.7:344
8697 msgid ""
8698 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
8699 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
8700 "socket will not be passed to the user program.  In later kernel versions, "
8701 "support for this option has been phased out: Linux 2.4 silently ignores it, "
8702 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
8703 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
8704 "header changing, skipping of the broadcast flag) for raw sockets with this "
8705 "option, but that was removed in Linux 2.2."
8706 msgstr ""
8707 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
8708 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
8709 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
8710 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
8711 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
8712 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
8713 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
8714 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
8715 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
8716
8717 #. type: TP
8718 #: build/C/man7/socket.7:344
8719 #, no-wrap
8720 msgid "B<SO_DEBUG>"
8721 msgstr "B<SO_DEBUG>"
8722
8723 #. type: Plain text
8724 #: build/C/man7/socket.7:350
8725 msgid ""
8726 "Enable socket debugging.  Only allowed for processes with the "
8727 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
8728 msgstr ""
8729 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
8730 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
8731
8732 #. type: TP
8733 #: build/C/man7/socket.7:350
8734 #, no-wrap
8735 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8736 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8737
8738 #. type: Plain text
8739 #: build/C/man7/socket.7:358
8740 msgid ""
8741 "Retrieves the socket domain as an integer, returning a value such as "
8742 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
8743 "only."
8744 msgstr ""
8745 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
8746 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8747
8748 #. type: TP
8749 #: build/C/man7/socket.7:358
8750 #, no-wrap
8751 msgid "B<SO_ERROR>"
8752 msgstr "B<SO_ERROR>"
8753
8754 #. type: Plain text
8755 #: build/C/man7/socket.7:363
8756 msgid ""
8757 "Get and clear the pending socket error.  This socket option is read-only.  "
8758 "Expects an integer."
8759 msgstr ""
8760 "保留になっていたソケットエラーを取得してクリアする。\n"
8761 "このソケットオプションは読み込み専用である。整数値をとる。"
8762
8763 #. type: TP
8764 #: build/C/man7/socket.7:363
8765 #, no-wrap
8766 msgid "B<SO_DONTROUTE>"
8767 msgstr "B<SO_DONTROUTE>"
8768
8769 #. type: Plain text
8770 #: build/C/man7/socket.7:372
8771 msgid ""
8772 "Don't send via a gateway, only send to directly connected hosts.  The same "
8773 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
8774 "B<send>(2)  operation.  Expects an integer boolean flag."
8775 msgstr ""
8776 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2)  操作"
8777 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
8778 "フラグを取る。"
8779
8780 #. type: TP
8781 #: build/C/man7/socket.7:372
8782 #, no-wrap
8783 msgid "B<SO_KEEPALIVE>"
8784 msgstr "B<SO_KEEPALIVE>"
8785
8786 #. type: Plain text
8787 #: build/C/man7/socket.7:376
8788 msgid ""
8789 "Enable sending of keep-alive messages on connection-oriented sockets.  "
8790 "Expects an integer boolean flag."
8791 msgstr ""
8792 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
8793 "の整数フラグをとる。"
8794
8795 #. type: TP
8796 #: build/C/man7/socket.7:376
8797 #, no-wrap
8798 msgid "B<SO_LINGER>"
8799 msgstr "B<SO_LINGER>"
8800
8801 #. type: Plain text
8802 #: build/C/man7/socket.7:384
8803 msgid ""
8804 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
8805 msgstr ""
8806 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
8807
8808 #. type: Plain text
8809 #: build/C/man7/socket.7:391
8810 #, no-wrap
8811 msgid ""
8812 "struct linger {\n"
8813 "    int l_onoff;    /* linger active */\n"
8814 "    int l_linger;   /* how many seconds to linger for */\n"
8815 "};\n"
8816 msgstr ""
8817 "struct linger {\n"
8818 "    int l_onoff;    /* linger active */\n"
8819 "    int l_linger;   /* how many seconds to linger for */\n"
8820 "};\n"
8821
8822 #. type: Plain text
8823 #: build/C/man7/socket.7:405
8824 msgid ""
8825 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
8826 "queued messages for the socket have been successfully sent or the linger "
8827 "timeout has been reached.  Otherwise, the call returns immediately and the "
8828 "closing is done in the background.  When the socket is closed as part of "
8829 "B<exit>(2), it always lingers in the background."
8830 msgstr ""
8831 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
8832 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
8833 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
8834 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
8835 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
8836 "送られる。"
8837
8838 #. type: TP
8839 #: build/C/man7/socket.7:405
8840 #, fuzzy, no-wrap
8841 #| msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8842 msgid "B<SO_MARK> (since Linux 2.6.25)"
8843 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8844
8845 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
8846 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
8847 #. type: Plain text
8848 #: build/C/man7/socket.7:416
8849 msgid ""
8850 "Set the mark for each packet sent through this socket (similar to the "
8851 "netfilter MARK target but socket-based).  Changing the mark can be used for "
8852 "mark-based routing without netfilter or for packet filtering.  Setting this "
8853 "option requires the B<CAP_NET_ADMIN> capability."
8854 msgstr ""
8855
8856 #. type: TP
8857 #: build/C/man7/socket.7:416
8858 #, no-wrap
8859 msgid "B<SO_OOBINLINE>"
8860 msgstr "B<SO_OOBINLINE>"
8861
8862 #.  don't document it because it can do too much harm.
8863 #. .B SO_NO_CHECK
8864 #. type: Plain text
8865 #: build/C/man7/socket.7:425
8866 msgid ""
8867 "If this option is enabled, out-of-band data is directly placed into the "
8868 "receive data stream.  Otherwise out-of-band data is only passed when the "
8869 "B<MSG_OOB> flag is set during receiving."
8870 msgstr ""
8871 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
8872 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
8873 "ラグがセットされている場合に限って渡される。"
8874
8875 #. type: TP
8876 #: build/C/man7/socket.7:425
8877 #, no-wrap
8878 msgid "B<SO_PASSCRED>"
8879 msgstr "B<SO_PASSCRED>"
8880
8881 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8882 #.  in the 2.6.18 ChangeLog
8883 #. type: Plain text
8884 #: build/C/man7/socket.7:434
8885 msgid ""
8886 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
8887 "For more information see B<unix>(7)."
8888 msgstr ""
8889 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
8890 "を参照のこと。"
8891
8892 #. type: TP
8893 #: build/C/man7/socket.7:434
8894 #, no-wrap
8895 msgid "B<SO_PEERCRED>"
8896 msgstr "B<SO_PEERCRED>"
8897
8898 #. type: Plain text
8899 #: build/C/man7/socket.7:457
8900 #, fuzzy
8901 #| msgid ""
8902 #| "Return the credentials of the foreign process connected to this socket.  "
8903 #| "This is only possible for connected B<AF_UNIX> stream sockets and "
8904 #| "B<AF_UNIX> stream and datagram socket pairs created using B<socketpair>"
8905 #| "(2); see B<unix>(7).  The returned credentials are those that were in "
8906 #| "effect at the time of the call to B<connect>(2)  or B<socketpair>(2).  "
8907 #| "Argument is a I<ucred> structure.  This socket option is read-only."
8908 msgid ""
8909 "Return the credentials of the foreign process connected to this socket.  "
8910 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
8911 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
8912 "(7).  The returned credentials are those that were in effect at the time of "
8913 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
8914 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
8915 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
8916 "option is read-only."
8917 msgstr ""
8918 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。\n"
8919 "このソケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソ"
8920 "ケット間、\n"
8921 "および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケット"
8922 "と\n"
8923 "データグラムソケットのペアだけである。\n"
8924 "B<unix>(7)  を参照のこと。\n"
8925 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
8926 "る。\n"
8927 "引き数は I<ucred> 構造体である。\n"
8928 "このソケットオプションは読み込み専用である。"
8929
8930 #. type: TP
8931 #: build/C/man7/socket.7:457
8932 #, no-wrap
8933 msgid "B<SO_PRIORITY>"
8934 msgstr "B<SO_PRIORITY>"
8935
8936 #. type: Plain text
8937 #: build/C/man7/socket.7:470
8938 msgid ""
8939 "Set the protocol-defined priority for all packets to be sent on this "
8940 "socket.  Linux uses this value to order the networking queues: packets with "
8941 "a higher priority may be processed first depending on the selected device "
8942 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
8943 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
8944 "6 requires the B<CAP_NET_ADMIN> capability."
8945 msgstr ""
8946 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
8947 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
8948 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
8949 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
8950 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
8951 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
8952
8953 #. type: TP
8954 #: build/C/man7/socket.7:470
8955 #, no-wrap
8956 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
8957 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
8958
8959 #. type: Plain text
8960 #: build/C/man7/socket.7:478
8961 msgid ""
8962 "Retrieves the socket protocol as an integer, returning a value such as "
8963 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
8964 "only."
8965 msgstr ""
8966 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
8967 "る。\n"
8968 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8969
8970 #. type: TP
8971 #: build/C/man7/socket.7:478
8972 #, no-wrap
8973 msgid "B<SO_RCVBUF>"
8974 msgstr "B<SO_RCVBUF>"
8975
8976 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8977 #.  The following thread on LMKL is quite informative:
8978 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
8979 #.  17 July 2012
8980 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
8981 #. type: Plain text
8982 #: build/C/man7/socket.7:497
8983 msgid ""
8984 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
8985 "this value (to allow space for bookkeeping overhead)  when it is set using "
8986 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8987 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
8988 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
8989 "file.  The minimum (doubled) value for this option is 256."
8990 msgstr ""
8991 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
8992 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8993 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8994 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
8995 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
8996 "る。 このオプションの最小値は (2倍した値で) 256 である。"
8997
8998 #. type: TP
8999 #: build/C/man7/socket.7:497
9000 #, no-wrap
9001 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9002 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9003
9004 #. type: Plain text
9005 #: build/C/man7/socket.7:506
9006 msgid ""
9007 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9008 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9009 "overridden."
9010 msgstr ""
9011 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9012 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9013 "きすることができる。"
9014
9015 #. type: TP
9016 #: build/C/man7/socket.7:506
9017 #, no-wrap
9018 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9019 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9020
9021 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9022 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9023 #. type: Plain text
9024 #: build/C/man7/socket.7:535
9025 msgid ""
9026 "Specify the minimum number of bytes in the buffer until the socket layer "
9027 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9028 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9029 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9030 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9031 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9032 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9033 "single byte of data is available.  A subsequent read from the socket will "
9034 "block until B<SO_RCVLOWAT> bytes are available."
9035 msgstr ""
9036 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9037 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9038 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9039 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9040 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9041 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9042 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9043 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9044 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9045 "してしまう。"
9046
9047 #. type: TP
9048 #: build/C/man7/socket.7:535
9049 #, no-wrap
9050 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9051 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9052
9053 #.  Not implemented in 2.0.
9054 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9055 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9056 #.  in fact to EAGAIN
9057 #. type: Plain text
9058 #: build/C/man7/socket.7:570
9059 #, fuzzy
9060 #| msgid ""
9061 #| "Specify the receiving or sending timeouts until reporting an error.  The "
9062 #| "argument is a I<struct timeval>.  If an input or output function blocks "
9063 #| "for this period of time, and data has been sent or received, the return "
9064 #| "value of that function will be the amount of data transferred; if no data "
9065 #| "has been transferred and the timeout has been reached then -1 is returned "
9066 #| "with I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket "
9067 #| "was specified to be nonblocking.  If the timeout is set to zero (the "
9068 #| "default)  then the operation will never timeout.  Timeouts only have "
9069 #| "effect for system calls that perform socket I/O (e.g., B<read>(2), "
9070 #| "B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have no effect for "
9071 #| "B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9072 msgid ""
9073 "Specify the receiving or sending timeouts until reporting an error.  The "
9074 "argument is a I<struct timeval>.  If an input or output function blocks for "
9075 "this period of time, and data has been sent or received, the return value of "
9076 "that function will be the amount of data transferred; if no data has been "
9077 "transferred and the timeout has been reached then -1 is returned with "
9078 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9079 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9080 "the timeout is set to zero (the default)  then the operation will never "
9081 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9082 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9083 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9084 msgstr ""
9085 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9086 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9087 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9088 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9089 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> を設定され、 あたかもソケットに"
9090 "非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値であ"
9091 "る) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響"
9092 "を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), "
9093 "B<recvmsg>(2), B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>"
9094 "(2), B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
9095
9096 #. type: TP
9097 #: build/C/man7/socket.7:570
9098 #, no-wrap
9099 msgid "B<SO_REUSEADDR>"
9100 msgstr "B<SO_REUSEADDR>"
9101
9102 #. type: Plain text
9103 #: build/C/man7/socket.7:585
9104 msgid ""
9105 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9106 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9107 "this means that a socket may bind, except when there is an active listening "
9108 "socket bound to the address.  When the listening socket is bound to "
9109 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9110 "port for any local address.  Argument is an integer boolean flag."
9111 msgstr ""
9112 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9113 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9114 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9115 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9116 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9117 "ドできない。 引き数はブール整数のフラグである。"
9118
9119 #. type: TP
9120 #: build/C/man7/socket.7:585
9121 #, no-wrap
9122 msgid "B<SO_SNDBUF>"
9123 msgstr "B<SO_SNDBUF>"
9124
9125 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9126 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9127 #. type: Plain text
9128 #: build/C/man7/socket.7:601
9129 msgid ""
9130 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9131 "this value (to allow space for bookkeeping overhead)  when it is set using "
9132 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9133 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9134 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9135 "file.  The minimum (doubled) value for this option is 2048."
9136 msgstr ""
9137 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9138 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9139 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9140 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9141 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9142 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9143
9144 #. type: TP
9145 #: build/C/man7/socket.7:601
9146 #, no-wrap
9147 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9148 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9149
9150 #. type: Plain text
9151 #: build/C/man7/socket.7:610
9152 msgid ""
9153 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9154 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9155 "overridden."
9156 msgstr ""
9157 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9158 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9159 "きすることができる。"
9160
9161 #. type: TP
9162 #: build/C/man7/socket.7:610
9163 #, no-wrap
9164 msgid "B<SO_TIMESTAMP>"
9165 msgstr "B<SO_TIMESTAMP>"
9166
9167 #. type: Plain text
9168 #: build/C/man7/socket.7:626
9169 msgid ""
9170 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9171 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9172 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9173 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9174 "details on control messages."
9175 msgstr ""
9176 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9177 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9178 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9179 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9180
9181 #. type: TP
9182 #: build/C/man7/socket.7:626
9183 #, no-wrap
9184 msgid "B<SO_TYPE>"
9185 msgstr "B<SO_TYPE>"
9186
9187 #. type: Plain text
9188 #: build/C/man7/socket.7:631
9189 msgid ""
9190 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9191 "option is read-only."
9192 msgstr ""
9193 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9194 "このソケットオプションは読み出し専用である。"
9195
9196 #. type: SS
9197 #: build/C/man7/socket.7:631
9198 #, no-wrap
9199 msgid "Signals"
9200 msgstr "シグナル"
9201
9202 #. type: Plain text
9203 #: build/C/man7/socket.7:642
9204 msgid ""
9205 "When writing onto a connection-oriented socket that has been shut down (by "
9206 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9207 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9208 "the B<MSG_NOSIGNAL> flag."
9209 msgstr ""
9210 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9211 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9212 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9213 "していた場合はシグナルは送られない。"
9214
9215 #. type: Plain text
9216 #: build/C/man7/socket.7:667
9217 msgid ""
9218 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9219 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9220 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9221 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9222 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9223 "signal will be called with the file descriptor in the I<si_fd> field of its "
9224 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9225 msgstr ""
9226 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9227 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9228 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9229 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9230 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9231 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9232 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9233 "を参照のこと。"
9234
9235 #.  .SS Ancillary messages
9236 #. type: Plain text
9237 #: build/C/man7/socket.7:675
9238 msgid ""
9239 "Under some circumstances (e.g., multiple processes accessing a single "
9240 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9241 "when the process reacts to the signal.  If this happens, the process should "
9242 "wait again because Linux will resend the signal later."
9243 msgstr ""
9244 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9245 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9246 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9247 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9248
9249 #. type: SS
9250 #: build/C/man7/socket.7:675
9251 #, no-wrap
9252 msgid "/proc interfaces"
9253 msgstr "/proc インタフェース"
9254
9255 #. type: Plain text
9256 #: build/C/man7/socket.7:679
9257 msgid ""
9258 "The core socket networking parameters can be accessed via files in the "
9259 "directory I</proc/sys/net/core/>."
9260 msgstr ""
9261 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9262 "レクトリ内のファイルを通してアクセスできる。"
9263
9264 #. type: TP
9265 #: build/C/man7/socket.7:679
9266 #, no-wrap
9267 msgid "I<rmem_default>"
9268 msgstr "I<rmem_default>"
9269
9270 #. type: Plain text
9271 #: build/C/man7/socket.7:682
9272 msgid "contains the default setting in bytes of the socket receive buffer."
9273 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9274
9275 #. type: TP
9276 #: build/C/man7/socket.7:682
9277 #, no-wrap
9278 msgid "I<rmem_max>"
9279 msgstr "I<rmem_max>"
9280
9281 #. type: Plain text
9282 #: build/C/man7/socket.7:688
9283 msgid ""
9284 "contains the maximum socket receive buffer size in bytes which a user may "
9285 "set by using the B<SO_RCVBUF> socket option."
9286 msgstr ""
9287 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9288 "ファサイズの最大値 (バイト単位)。"
9289
9290 #. type: TP
9291 #: build/C/man7/socket.7:688
9292 #, no-wrap
9293 msgid "I<wmem_default>"
9294 msgstr "I<wmem_default>"
9295
9296 #. type: Plain text
9297 #: build/C/man7/socket.7:691
9298 msgid "contains the default setting in bytes of the socket send buffer."
9299 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9300
9301 #. type: TP
9302 #: build/C/man7/socket.7:691
9303 #, no-wrap
9304 msgid "I<wmem_max>"
9305 msgstr "I<wmem_max>"
9306
9307 #. type: Plain text
9308 #: build/C/man7/socket.7:697
9309 msgid ""
9310 "contains the maximum socket send buffer size in bytes which a user may set "
9311 "by using the B<SO_SNDBUF> socket option."
9312 msgstr ""
9313 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9314 "ファサイズの最大値 (バイト単位)。"
9315
9316 #. type: TP
9317 #: build/C/man7/socket.7:697
9318 #, no-wrap
9319 msgid "I<message_cost> and I<message_burst>"
9320 msgstr "I<message_cost> と I<message_burst>"
9321
9322 #. type: Plain text
9323 #: build/C/man7/socket.7:701
9324 msgid ""
9325 "configure the token bucket filter used to load limit warning messages caused "
9326 "by external network events."
9327 msgstr ""
9328 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9329 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9330
9331 #. type: TP
9332 #: build/C/man7/socket.7:701
9333 #, no-wrap
9334 msgid "I<netdev_max_backlog>"
9335 msgstr "I<netdev_max_backlog>"
9336
9337 #. type: Plain text
9338 #: build/C/man7/socket.7:704
9339 msgid "Maximum number of packets in the global input queue."
9340 msgstr "グローバルな入力キューにおける最大のパケット数。"
9341
9342 #. type: TP
9343 #: build/C/man7/socket.7:704
9344 #, no-wrap
9345 msgid "I<optmem_max>"
9346 msgstr "I<optmem_max>"
9347
9348 #.  netdev_fastroute is not documented because it is experimental
9349 #. type: Plain text
9350 #: build/C/man7/socket.7:709
9351 msgid ""
9352 "Maximum length of ancillary data and user control data like the iovecs per "
9353 "socket."
9354 msgstr ""
9355 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9356 "うなもの) との和の最大長。"
9357
9358 #. type: SS
9359 #: build/C/man7/socket.7:709
9360 #, no-wrap
9361 msgid "Ioctls"
9362 msgstr "ioctl"
9363
9364 #. type: Plain text
9365 #: build/C/man7/socket.7:712
9366 msgid "These operations can be accessed using B<ioctl>(2):"
9367 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9368
9369 #. type: Plain text
9370 #: build/C/man7/socket.7:716
9371 #, no-wrap
9372 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9373 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9374
9375 #. type: TP
9376 #: build/C/man7/socket.7:718
9377 #, no-wrap
9378 msgid "B<SIOCGSTAMP>"
9379 msgstr "B<SIOCGSTAMP>"
9380
9381 #. type: Plain text
9382 #: build/C/man7/socket.7:742
9383 msgid ""
9384 "Return a I<struct timeval> with the receive timestamp of the last packet "
9385 "passed to the user.  This is useful for accurate round trip time "
9386 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9387 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
9388 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9389 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9390 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9391 "to B<ENOENT>)."
9392 msgstr ""
9393 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9394 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9395 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9396 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9397 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9398 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9399 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9400 "セットする)。"
9401
9402 #. type: TP
9403 #: build/C/man7/socket.7:742
9404 #, no-wrap
9405 msgid "B<SIOCSPGRP>"
9406 msgstr "B<SIOCSPGRP>"
9407
9408 #. type: Plain text
9409 #: build/C/man7/socket.7:761
9410 msgid ""
9411 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9412 "when an asynchronous I/O operation has finished or urgent data is "
9413 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9414 "positive, send the signals to that process.  If the argument is negative, "
9415 "send the signals to the process group with the ID of the absolute value of "
9416 "the argument.  The process may only choose itself or its own process group "
9417 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9418 "UID of 0."
9419 msgstr ""
9420 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9421 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9422 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9423 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9424 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9425 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9426 "の場合は この限りではない。"
9427
9428 #. type: TP
9429 #: build/C/man7/socket.7:761
9430 #, no-wrap
9431 msgid "B<FIOASYNC>"
9432 msgstr "B<FIOASYNC>"
9433
9434 #. type: Plain text
9435 #: build/C/man7/socket.7:771
9436 msgid ""
9437 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9438 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9439 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9440 msgstr ""
9441 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9442 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9443 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9444
9445 #. type: Plain text
9446 #: build/C/man7/socket.7:779
9447 msgid ""
9448 "Argument is an integer boolean flag.  (This operation is synonymous with the "
9449 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
9450 msgstr ""
9451 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
9452 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9453
9454 #. type: TP
9455 #: build/C/man7/socket.7:779
9456 #, no-wrap
9457 msgid "B<SIOCGPGRP>"
9458 msgstr "B<SIOCGPGRP>"
9459
9460 #. type: Plain text
9461 #: build/C/man7/socket.7:788
9462 msgid ""
9463 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9464 "signals, or 0 when none is set."
9465 msgstr ""
9466 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9467 "る。 ない場合は 0 が返る。"
9468
9469 #. type: Plain text
9470 #: build/C/man7/socket.7:792
9471 msgid "Valid B<fcntl>(2)  operations:"
9472 msgstr "有効な B<fcntl>(2)  操作:"
9473
9474 #. type: TP
9475 #: build/C/man7/socket.7:792
9476 #, no-wrap
9477 msgid "B<FIOGETOWN>"
9478 msgstr "B<FIOGETOWN>"
9479
9480 #. type: Plain text
9481 #: build/C/man7/socket.7:797
9482 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9483 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
9484
9485 #. type: TP
9486 #: build/C/man7/socket.7:797
9487 #, no-wrap
9488 msgid "B<FIOSETOWN>"
9489 msgstr "B<FIOSETOWN>"
9490
9491 #. type: Plain text
9492 #: build/C/man7/socket.7:802
9493 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9494 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
9495
9496 #. type: Plain text
9497 #: build/C/man7/socket.7:816
9498 msgid ""
9499 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
9500 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
9501 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
9502 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9503 "be read or written."
9504 msgstr ""
9505 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9506 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9507 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9508 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9509 "はできなかった。"
9510
9511 #. type: Plain text
9512 #: build/C/man7/socket.7:821
9513 msgid ""
9514 "Linux assumes that half of the send/receive buffer is used for internal "
9515 "kernel structures; thus the values in the corresponding I</proc> files are "
9516 "twice what can be observed on the wire."
9517 msgstr ""
9518 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
9519 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
9520 "なる。"
9521
9522 #. type: Plain text
9523 #: build/C/man7/socket.7:834
9524 msgid ""
9525 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
9526 "option was set both in the previous program that performed a B<bind>(2)  to "
9527 "the port and in the program that wants to reuse the port.  This differs from "
9528 "some implementations (e.g., FreeBSD)  where only the later program needs to "
9529 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
9530 "since, for example, a server program is designed to always set this option."
9531 msgstr ""
9532 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
9533 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
9534 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
9535 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
9536 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
9537 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
9538 "このオプションをセットするように設計されるからである。"
9539
9540 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
9541 #.  .SH AUTHORS
9542 #.  This man page was written by Andi Kleen.
9543 #. type: Plain text
9544 #: build/C/man7/socket.7:847
9545 msgid ""
9546 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
9547 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
9548 "is via the libpcap library."
9549 msgstr ""
9550 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
9551 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
9552 "して 用いる方が良い。"
9553
9554 #. type: Plain text
9555 #: build/C/man7/socket.7:859
9556 #, fuzzy
9557 #| msgid ""
9558 #| "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), "
9559 #| "B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
9560 msgid ""
9561 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9562 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9563 "B<unix>(7)"
9564 msgstr ""
9565 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
9566 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
9567
9568 #. type: TH
9569 #: build/C/man2/socketcall.2:25
9570 #, no-wrap
9571 msgid "SOCKETCALL"
9572 msgstr "SOCKETCALL"
9573
9574 #. type: TH
9575 #: build/C/man2/socketcall.2:25
9576 #, fuzzy, no-wrap
9577 #| msgid "2010-10-06"
9578 msgid "2012-10-16"
9579 msgstr "2010-10-06"
9580
9581 #. type: Plain text
9582 #: build/C/man2/socketcall.2:28
9583 msgid "socketcall - socket system calls"
9584 msgstr "socketcall - ソケット・システムコール"
9585
9586 #. type: Plain text
9587 #: build/C/man2/socketcall.2:30
9588 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9589 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9590
9591 #. type: Plain text
9592 #: build/C/man2/socketcall.2:38
9593 msgid ""
9594 "B<socketcall>()  is a common kernel entry point for the socket system "
9595 "calls.  I<call> determines which socket function to invoke.  I<args> points "
9596 "to a block containing the actual arguments, which are passed through to the "
9597 "appropriate call."
9598 msgstr ""
9599 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
9600 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
9601 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
9602 "ロックを指す。"
9603
9604 #. type: Plain text
9605 #: build/C/man2/socketcall.2:42
9606 msgid ""
9607 "User programs should call the appropriate functions by their usual names.  "
9608 "Only standard library implementors and kernel hackers need to know about "
9609 "B<socketcall>()."
9610 msgstr ""
9611 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
9612 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
9613 "必要がある。"
9614
9615 #. type: Plain text
9616 #: build/C/man2/socketcall.2:45
9617 msgid ""
9618 "This call is specific to Linux, and should not be used in programs intended "
9619 "to be portable."
9620 msgstr ""
9621 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
9622 "い。"
9623
9624 #. type: Plain text
9625 #: build/C/man2/socketcall.2:53
9626 #, fuzzy
9627 #| msgid ""
9628 #| "On a few architectures, for example ia64, there is no B<socketcall>()  "
9629 #| "system call; instead B<socket>(2), B<accept>(2), B<bind>(2), and so on "
9630 #| "really are implemented as separate system calls."
9631 msgid ""
9632 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
9633 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
9634 "(2), and so on really are implemented as separate system calls."
9635 msgstr ""
9636 "ia64 などのいくつかのアーキテクチャでは、システムコール B<socketcall>()  が存"
9637 "在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2)  など"
9638 "が独立したシステムコールとして実装されている。"
9639
9640 #. type: Plain text
9641 #: build/C/man2/socketcall.2:71
9642 msgid ""
9643 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9644 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9645 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9646 "(2), B<socket>(2), B<socketpair>(2)"
9647 msgstr ""
9648 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9649 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9650 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9651 "(2), B<socket>(2), B<socketpair>(2)"
9652
9653 #. type: TH
9654 #: build/C/man2/socketpair.2:42
9655 #, no-wrap
9656 msgid "SOCKETPAIR"
9657 msgstr "SOCKETPAIR"
9658
9659 #. type: TH
9660 #: build/C/man2/socketpair.2:42
9661 #, no-wrap
9662 msgid "2008-10-11"
9663 msgstr "2008-10-11"
9664
9665 #. type: Plain text
9666 #: build/C/man2/socketpair.2:45
9667 msgid "socketpair - create a pair of connected sockets"
9668 msgstr "socketpair - 接続されたソケットのペアを作成する"
9669
9670 #. type: Plain text
9671 #: build/C/man2/socketpair.2:52
9672 msgid ""
9673 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9674 ">I<sv>B<[2]);>"
9675 msgstr ""
9676 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9677 ">I<sv>B<[2]);>"
9678
9679 #. type: Plain text
9680 #: build/C/man2/socketpair.2:63
9681 msgid ""
9682 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
9683 "the specified I<domain>, of the specified I<type>, and using the optionally "
9684 "specified I<protocol>.  For further details of these arguments, see B<socket>"
9685 "(2)."
9686 msgstr ""
9687 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
9688 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
9689 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
9690
9691 #. type: Plain text
9692 #: build/C/man2/socketpair.2:69
9693 msgid ""
9694 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
9695 "and I<sv>[1].  The two sockets are indistinguishable."
9696 msgstr ""
9697 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
9698 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
9699
9700 #. type: Plain text
9701 #: build/C/man2/socketpair.2:78
9702 msgid "The specified address family is not supported on this machine."
9703 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
9704
9705 #. type: Plain text
9706 #: build/C/man2/socketpair.2:83
9707 msgid ""
9708 "The address I<sv> does not specify a valid part of the process address space."
9709 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
9710
9711 #. type: Plain text
9712 #: build/C/man2/socketpair.2:86
9713 msgid "Too many descriptors are in use by this process."
9714 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
9715
9716 #. type: Plain text
9717 #: build/C/man2/socketpair.2:92
9718 msgid "The specified protocol does not support creation of socket pairs."
9719 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
9720
9721 #. type: Plain text
9722 #: build/C/man2/socketpair.2:95
9723 msgid "The specified protocol is not supported on this machine."
9724 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
9725
9726 #. type: Plain text
9727 #: build/C/man2/socketpair.2:103
9728 msgid ""
9729 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
9730 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
9731 "of the BSD socket layer (including System V variants)."
9732 msgstr ""
9733 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
9734 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
9735 "BSD 以外のシステムと、 互いに移植性がある。"
9736
9737 #. type: Plain text
9738 #: build/C/man2/socketpair.2:109
9739 msgid ""
9740 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
9741 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
9742 "restriction.)"
9743 msgstr ""
9744 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
9745 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
9746
9747 #. type: Plain text
9748 #: build/C/man2/socketpair.2:118
9749 msgid ""
9750 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
9751 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
9752 msgstr ""
9753 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
9754 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
9755
9756 #. type: Plain text
9757 #: build/C/man2/socketpair.2:131
9758 msgid ""
9759 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9760 msgstr ""
9761 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9762
9763 #~ msgid "2011-09-16"
9764 #~ msgstr "2011-09-16"
9765
9766 #~ msgid "B<MSG_WAITFORONE>"
9767 #~ msgstr "B<MSG_WAITFORONE>"
9768
9769 #~ msgid "2010-06-10"
9770 #~ msgstr "2010-06-10"
9771
9772 #~ msgid ""
9773 #~ "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
9774 #~ "Programmer's Supplementary Documents Volume 1.>"
9775 #~ msgstr ""
9776 #~ "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
9777 #~ "Supplementary Documents Volume 1> として再版された。"
9778
9779 #~ msgid "2007-06-28"
9780 #~ msgstr "2007-06-28"
9781
9782 #~ msgid "2011-10-04"
9783 #~ msgstr "2011-10-04"
9784
9785 #~ msgid "2010-08-31"
9786 #~ msgstr "2010-08-31"
9787
9788 #~ msgid "2010-06-13"
9789 #~ msgstr "2010-06-13"
9790
9791 #~ msgid "RETURN VALUES"
9792 #~ msgstr "RETURN VALUES"