OSDN Git Service

(split) git commit -m "LDP: Update the version to 3.63 in PO files"
[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: 2014-04-13 10:27+0900\n"
10 "PO-Revision-Date: 2014-04-13 10:39+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:56 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:56
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:57
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
77
78 #. type: SH
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:59
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
89 #, no-wrap
90 msgid "SYNOPSIS"
91 msgstr "書式"
92
93 #. type: Plain text
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
95 #, no-wrap
96 msgid ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
102
103 #. type: Plain text
104 #: build/C/man2/accept.2:50
105 #, no-wrap
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
108
109 #. type: Plain text
110 #: build/C/man2/accept.2:53
111 #, no-wrap
112 msgid ""
113 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115 msgstr ""
116 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
118
119 #. type: Plain text
120 #: build/C/man2/accept.2:56
121 #, no-wrap
122 msgid ""
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
125 msgstr ""
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
128
129 #. type: SH
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:63
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "説明"
143
144 #. type: Plain text
145 #: build/C/man2/accept.2:72
146 msgid ""
147 "The B<accept>()  system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket.  The newly created socket is not in the listening "
152 "state.  The original socket I<sockfd> is unaffected by this call."
153 msgstr ""
154 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
158 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
159 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
160
161 #. type: Plain text
162 #: build/C/man2/accept.2:81
163 msgid ""
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
167 msgstr ""
168 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
170 "である。"
171
172 #. type: Plain text
173 #: build/C/man2/accept.2:99
174 msgid ""
175 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer.  The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2)  and the "
179 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
181 msgstr ""
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
183 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
184 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
185 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
186 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
187 "おくべきである。"
188
189 #. type: Plain text
190 #: build/C/man2/accept.2:107
191 msgid ""
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
195 msgstr ""
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
199
200 #. type: Plain text
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
202 msgid ""
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
205 "call."
206 msgstr ""
207 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
208 "る。\n"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
210 "される。"
211
212 #. type: Plain text
213 #: build/C/man2/accept.2:125
214 msgid ""
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
217 "present.  If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
219 "B<EWOULDBLOCK>."
220 msgstr ""
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
225
226 #. type: Plain text
227 #: build/C/man2/accept.2:139
228 msgid ""
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>()  to get a socket "
232 "for that connection.  Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
234 msgstr ""
235 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
240
241 #. type: Plain text
242 #: build/C/man2/accept.2:152
243 msgid ""
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation.  Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket.  Currently only DECNet has these "
249 "semantics on Linux."
250 msgstr ""
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
257
258 #. type: Plain text
259 #: build/C/man2/accept.2:162
260 msgid ""
261 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
263 "behavior:"
264 msgstr ""
265 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
267 "できる。"
268
269 #. type: TP
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2:160
271 #, no-wrap
272 msgid "B<SOCK_NONBLOCK>"
273 msgstr "B<SOCK_NONBLOCK>"
274
275 #. type: Plain text
276 #: build/C/man2/accept.2:170 build/C/man2/socket.2:168
277 msgid ""
278 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
279 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
280 msgstr ""
281 "新しく生成されるオープンファイル記述 (open file description) の "
282 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
283 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
284 "なる。"
285
286 #. type: TP
287 #: build/C/man2/accept.2:170 build/C/man2/socket.2:168
288 #, no-wrap
289 msgid "B<SOCK_CLOEXEC>"
290 msgstr "B<SOCK_CLOEXEC>"
291
292 #. type: Plain text
293 #: build/C/man2/accept.2:180 build/C/man2/socket.2:178
294 msgid ""
295 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
296 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
297 "may be useful."
298 msgstr ""
299 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
300 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
301 "B<O_CLOEXEC> フラグの説明を参照のこと。"
302
303 #. type: SH
304 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
305 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
306 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
307 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
308 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
309 #: build/C/man2/recv.2:400 build/C/man2/recvmmsg.2:149
310 #: build/C/man2/select.2:299 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:310
313 #: build/C/man2/socketpair.2:69
314 #, no-wrap
315 msgid "RETURN VALUE"
316 msgstr "返り値"
317
318 #. type: Plain text
319 #: build/C/man2/accept.2:187
320 msgid ""
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
323 "is set appropriately."
324 msgstr ""
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
326 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
327 "定する。"
328
329 #. type: SS
330 #: build/C/man2/accept.2:187
331 #, no-wrap
332 msgid "Error handling"
333 msgstr "エラー処理"
334
335 #. type: Plain text
336 #: build/C/man2/accept.2:214
337 msgid ""
338 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
339 "on the new socket as an error code from B<accept>().  This behavior differs "
340 "from other BSD socket implementations.  For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
345 msgstr ""
346 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
353 "B<ENETUNREACH>"
354
355 #. type: SH
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:416 build/C/man2/recvmmsg.2:157
362 #: build/C/man2/select.2:317 build/C/man2/send.2:280
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:315 build/C/man2/socketpair.2:74
365 #, no-wrap
366 msgid "ERRORS"
367 msgstr "エラー"
368
369 #. type: TP
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:421 build/C/man2/send.2:296
371 #, no-wrap
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
374
375 #.  Actually EAGAIN on Linux
376 #. type: Plain text
377 #: build/C/man2/accept.2:223
378 msgid ""
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
383 msgstr ""
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
388
389 #. type: TP
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:165
391 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
393 #: build/C/man2/recv.2:430 build/C/man2/select.2:318 build/C/man2/send.2:304
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプタが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:191
417 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:439
419 #: build/C/man2/send.2:313 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:203
432 #: build/C/man2/recv.2:443 build/C/man2/select.2:323 build/C/man2/send.2:316
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:169
448 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:448
450 #: build/C/man2/recvmmsg.2:161 build/C/man2/select.2:327
451 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:63
452 #: build/C/man2/socket.2:323 build/C/man2/socket.2:326
453 #, no-wrap
454 msgid "B<EINVAL>"
455 msgstr "B<EINVAL>"
456
457 #. type: Plain text
458 #: build/C/man2/accept.2:244
459 msgid ""
460 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
461 "negative)."
462 msgstr ""
463 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
464 "負の場合など)。"
465
466 #. type: Plain text
467 #: build/C/man2/accept.2:249
468 msgid "(B<accept4>())  invalid value in I<flags>."
469 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
470
471 #. type: TP
472 #: build/C/man2/accept.2:249 build/C/man2/socket.2:331
473 #: build/C/man2/socketpair.2:83
474 #, no-wrap
475 msgid "B<EMFILE>"
476 msgstr "B<EMFILE>"
477
478 #. type: Plain text
479 #: build/C/man2/accept.2:252
480 msgid "The per-process limit of open file descriptors has been reached."
481 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
482
483 #. type: TP
484 #: build/C/man2/accept.2:252 build/C/man2/socket.2:334
485 #: build/C/man2/socketpair.2:86
486 #, no-wrap
487 msgid "B<ENFILE>"
488 msgstr "B<ENFILE>"
489
490 #. type: Plain text
491 #: build/C/man2/accept.2:255 build/C/man2/socket.2:337
492 #: build/C/man2/socketpair.2:89
493 msgid "The system limit on the total number of open files has been reached."
494 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
495
496 #. type: TP
497 #: build/C/man2/accept.2:255
498 #, no-wrap
499 msgid "B<ENOBUFS>, B<ENOMEM>"
500 msgstr "B<ENOBUFS>, B<ENOMEM>"
501
502 #. type: Plain text
503 #: build/C/man2/accept.2:260
504 msgid ""
505 "Not enough free memory.  This often means that the memory allocation is "
506 "limited by the socket buffer limits, not by the system memory."
507 msgstr ""
508 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
509 "ケットバッファの大きさによるメモリ割り当ての制限である。"
510
511 #. type: TP
512 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
513 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
515 #: build/C/man2/recv.2:463 build/C/man2/send.2:349
516 #, no-wrap
517 msgid "B<ENOTSOCK>"
518 msgstr "B<ENOTSOCK>"
519
520 #. type: Plain text
521 #: build/C/man2/accept.2:263
522 msgid "The descriptor references a file, not a socket."
523 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
524
525 #. type: TP
526 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
527 #: build/C/man2/socketpair.2:89
528 #, no-wrap
529 msgid "B<EOPNOTSUPP>"
530 msgstr "B<EOPNOTSUPP>"
531
532 #. type: Plain text
533 #: build/C/man2/accept.2:267
534 msgid "The referenced socket is not of type B<SOCK_STREAM>."
535 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
536
537 #. type: TP
538 #: build/C/man2/accept.2:267
539 #, no-wrap
540 msgid "B<EPROTO>"
541 msgstr "B<EPROTO>"
542
543 #. type: Plain text
544 #: build/C/man2/accept.2:270
545 msgid "Protocol error."
546 msgstr "プロトコル・エラー。"
547
548 #. type: Plain text
549 #: build/C/man2/accept.2:274
550 msgid "In addition, Linux B<accept>()  may fail if:"
551 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
552
553 #. type: TP
554 #: build/C/man2/accept.2:274
555 #, no-wrap
556 msgid "B<EPERM>"
557 msgstr "B<EPERM>"
558
559 #. type: Plain text
560 #: build/C/man2/accept.2:277
561 msgid "Firewall rules forbid connection."
562 msgstr "ファイアウォールのルールにより接続が禁止された。"
563
564 #. type: Plain text
565 #: build/C/man2/accept.2:289
566 msgid ""
567 "In addition, network errors for the new socket and as defined for the "
568 "protocol may be returned.  Various Linux kernels can return other errors "
569 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
570 "value B<ERESTARTSYS> may be seen during a trace."
571 msgstr ""
572 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
573 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
574 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
575 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
576 "ともある。"
577
578 #. type: SH
579 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
580 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:165
581 #: build/C/man2/select.2:336 build/C/man2/sendmmsg.2:145
582 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:913
583 #, no-wrap
584 msgid "VERSIONS"
585 msgstr "バージョン"
586
587 #. type: Plain text
588 #: build/C/man2/accept.2:294
589 msgid ""
590 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
591 "support in glibc is available starting with version 2.10."
592 msgstr ""
593 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
594 "サポートはバージョン 2.10 以降で利用可能である。"
595
596 #. type: SH
597 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:225
599 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
600 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
601 #: build/C/man3/if_nametoindex.3:85 build/C/man2/listen.2:106
602 #: build/C/man2/recv.2:468 build/C/man2/recvmmsg.2:170
603 #: build/C/man2/select.2:342 build/C/man2/send.2:368
604 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
605 #: build/C/man2/socket.2:348 build/C/man2/socketcall.2:42
606 #: build/C/man2/socketpair.2:95
607 #, no-wrap
608 msgid "CONFORMING TO"
609 msgstr "準拠"
610
611 #.  The BSD man page documents five possible error returns
612 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
613 #.  POSIX.1-2001 documents errors
614 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
615 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
616 #.  In addition, SUSv2 documents EFAULT and ENOSR.
617 #. type: Plain text
618 #: build/C/man2/accept.2:306
619 msgid ""
620 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
621 "4.2BSD)."
622 msgstr ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
624 "された)."
625
626 #. type: Plain text
627 #: build/C/man2/accept.2:309
628 msgid "B<accept4>()  is a nonstandard Linux extension."
629 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
630
631 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
632 #.  do not inherit file status flags -- MTK Jun 05
633 #. type: Plain text
634 #: build/C/man2/accept.2:324
635 msgid ""
636 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
637 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
638 "socket.  This behavior differs from the canonical BSD sockets "
639 "implementation.  Portable programs should not rely on inheritance or "
640 "noninheritance of file status flags and always explicitly set all required "
641 "flags on the socket returned from B<accept>()."
642 msgstr ""
643 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
644 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
645 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
646 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
647 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
648 "である。"
649
650 #. type: SH
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:241
653 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
654 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
655 #: build/C/man2/recv.2:478 build/C/man2/select.2:357
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
657 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
658 #: build/C/man2/socket.2:362 build/C/man7/socket.7:927
659 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
660 #, no-wrap
661 msgid "NOTES"
662 msgstr "注意"
663
664 #. type: Plain text
665 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
666 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:137 build/C/man2/socket.2:368
668 #: build/C/man2/socketpair.2:124
669 msgid ""
670 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
671 "this header file is not required on Linux.  However, some historical (BSD) "
672 "implementations required this header file, and portable applications are "
673 "probably wise to include it."
674 msgstr ""
675 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
676 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
677 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
678 "ションではこのファイルを インクルードするのが賢明であろう。"
679
680 #. type: Plain text
681 #: build/C/man2/accept.2:351
682 #, fuzzy
683 #| msgid ""
684 #| "There may not always be a connection waiting after a B<SIGIO> is "
685 #| "delivered or B<select>(2)  or B<poll>(2)  return a readability event "
686 #| "because the connection might have been removed by an asynchronous network "
687 #| "error or another thread before B<accept>()  is called.  If this happens "
688 #| "then the call will block waiting for the next connection to arrive.  To "
689 #| "ensure that B<accept>()  never blocks, the passed socket I<sockfd> needs "
690 #| "to have the B<O_NONBLOCK> flag set (see B<socket>(7))."
691 msgid ""
692 "There may not always be a connection waiting after a B<SIGIO> is delivered "
693 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
694 "connection might have been removed by an asynchronous network error or "
695 "another thread before B<accept>()  is called.  If this happens, then the "
696 "call will block waiting for the next connection to arrive.  To ensure that "
697 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
698 "B<O_NONBLOCK> flag set (see B<socket>(7))."
699 msgstr ""
700 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
701 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
702 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
703 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
704 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
705 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
706 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
707 "見よ)。"
708
709 #. type: SS
710 #: build/C/man2/accept.2:351
711 #, no-wrap
712 msgid "The socklen_t type"
713 msgstr "socklen_t 型"
714
715 #. type: Plain text
716 #: build/C/man2/accept.2:361
717 msgid ""
718 "The third argument of B<accept>()  was originally declared as an I<int *> "
719 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
720 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
721 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
722 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
723 "Torvalds:"
724 msgstr ""
725 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
726 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
727 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
728 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
729 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
730 "た。 Linus Torvald の発言を引用する:"
731
732 #.  .I fails: only italicizes a single line
733 #. type: Plain text
734 #: build/C/man2/accept.2:378
735 msgid ""
736 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
737 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
738 "make it a size_t, and I (and hopefully others, but obviously not too many) "
739 "complained to them very loudly indeed.  Making it a size_t is completely "
740 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
741 "bit architectures, for example.  And it I<has> to be the same size as \"int"
742 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
743 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
744 "have touched it in the first place, but once they did they felt it had to "
745 "have a named type for some unfathomable reason (probably somebody didn't "
746 "like losing face over having done the original stupid thing, so they "
747 "silently just renamed their blunder).\""
748 msgstr ""
749 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
750 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
751 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
752 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
753 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
754 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
755 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
756 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
757 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
758 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
759 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
760 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
761 "う)。」"
762
763 #. type: SH
764 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
765 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
766 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
767 #: build/C/man2/recv.2:513 build/C/man2/recvmmsg.2:173
768 #: build/C/man2/select.2:548 build/C/man2/select_tut.2:529
769 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
770 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:381
771 #, no-wrap
772 msgid "EXAMPLE"
773 msgstr "例"
774
775 #. type: Plain text
776 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
777 msgid "See B<bind>(2)."
778 msgstr "B<bind>(2)  参照。"
779
780 #. type: SH
781 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
782 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:263
783 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
784 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
785 #: build/C/man3/if_nametoindex.3:89 build/C/man2/listen.2:169
786 #: build/C/man2/recv.2:518 build/C/man2/recvmmsg.2:268
787 #: build/C/man2/select.2:585 build/C/man2/select_tut.2:821
788 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
789 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:386
790 #: build/C/man7/socket.7:958 build/C/man2/socketcall.2:53
791 #: build/C/man2/socketpair.2:124
792 #, no-wrap
793 msgid "SEE ALSO"
794 msgstr "関連項目"
795
796 #. type: Plain text
797 #: build/C/man2/accept.2:388
798 msgid ""
799 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
800 "B<socket>(7)"
801 msgstr ""
802 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
803 "B<socket>(7)"
804
805 #. type: SH
806 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
807 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:270
808 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
809 #: build/C/man2/getsockopt.2:212 build/C/man3/if_nameindex.3:154
810 #: build/C/man3/if_nametoindex.3:93 build/C/man2/listen.2:175
811 #: build/C/man2/recv.2:529 build/C/man2/recvmmsg.2:275
812 #: build/C/man2/select.2:599 build/C/man2/select_tut.2:840
813 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
814 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:415
815 #: build/C/man7/socket.7:970 build/C/man2/socketcall.2:71
816 #: build/C/man2/socketpair.2:131
817 #, no-wrap
818 msgid "COLOPHON"
819 msgstr "この文書について"
820
821 #. type: Plain text
822 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
823 #: build/C/man3/bindresvport.3:123 build/C/man2/connect.2:277
824 #: build/C/man3/getifaddrs.3:322 build/C/man2/getsockname.2:128
825 #: build/C/man2/getsockopt.2:219 build/C/man3/if_nameindex.3:161
826 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:182
827 #: build/C/man2/recv.2:536 build/C/man2/recvmmsg.2:282
828 #: build/C/man2/select.2:606 build/C/man2/select_tut.2:847
829 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
830 #: build/C/man3/sockatmark.3:151 build/C/man2/socket.2:422
831 #: build/C/man7/socket.7:977 build/C/man2/socketcall.2:78
832 #: build/C/man2/socketpair.2:138
833 msgid ""
834 "This page is part of release 3.63 of the Linux I<man-pages> project.  A "
835 "description of the project, and information about reporting bugs, can be "
836 "found at \\%http://www.kernel.org/doc/man-pages/."
837 msgstr ""
838 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.63 の一部\n"
839 "である。プロジェクトの説明とバグ報告に関する情報は\n"
840 "http://www.kernel.org/doc/man-pages/ に書かれている。"
841
842 #. type: TH
843 #: build/C/man2/bind.2:68
844 #, no-wrap
845 msgid "BIND"
846 msgstr "BIND"
847
848 #. type: TH
849 #: build/C/man2/bind.2:68
850 #, no-wrap
851 msgid "2007-12-28"
852 msgstr "2007-12-28"
853
854 #. type: Plain text
855 #: build/C/man2/bind.2:71
856 msgid "bind - bind a name to a socket"
857 msgstr "bind - ソケットに名前をつける"
858
859 #. type: Plain text
860 #: build/C/man2/bind.2:78
861 #, no-wrap
862 msgid ""
863 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
864 "B<         socklen_t >I<addrlen>B<);>\n"
865 msgstr ""
866 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
867 "B<         socklen_t >I<addrlen>B<);>\n"
868
869 #. type: Plain text
870 #: build/C/man2/bind.2:92
871 msgid ""
872 "When a socket is created with B<socket>(2), it exists in a name space "
873 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
874 "address specified by I<addr> to the socket referred to by the file "
875 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
876 "address structure pointed to by I<addr>.  Traditionally, this operation is "
877 "called \\(lqassigning a name to a socket\\(rq."
878 msgstr ""
879 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
880 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
881 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
882 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
883 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
884 "る。"
885
886 #. type: Plain text
887 #: build/C/man2/bind.2:99
888 msgid ""
889 "It is normally necessary to assign a local address using B<bind>()  before a "
890 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
891 msgstr ""
892 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
893 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
894 "る。"
895
896 #. type: Plain text
897 #: build/C/man2/bind.2:130
898 msgid ""
899 "The rules used in name binding vary between address families.  Consult the "
900 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
901 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
902 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
903 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
904 msgstr ""
905 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
906 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
907 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
908 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
909 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
910
911 #. type: Plain text
912 #: build/C/man2/bind.2:137
913 msgid ""
914 "The actual structure passed for the I<addr> argument will depend on the "
915 "address family.  The I<sockaddr> structure is defined as something like:"
916 msgstr ""
917 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
918 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
919
920 #. type: Plain text
921 #: build/C/man2/bind.2:144
922 #, no-wrap
923 msgid ""
924 "struct sockaddr {\n"
925 "    sa_family_t sa_family;\n"
926 "    char        sa_data[14];\n"
927 "}\n"
928 msgstr ""
929 "struct sockaddr {\n"
930 "    sa_family_t sa_family;\n"
931 "    char        sa_data[14];\n"
932 "}\n"
933
934 #. type: Plain text
935 #: build/C/man2/bind.2:152
936 msgid ""
937 "The only purpose of this structure is to cast the structure pointer passed "
938 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
939 msgstr ""
940 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
941 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
942
943 #. type: Plain text
944 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
945 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
946 #: build/C/man2/socketpair.2:74
947 msgid ""
948 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
949 "appropriately."
950 msgstr ""
951 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
952 "設定される。"
953
954 #. type: TP
955 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
956 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
957 #: build/C/man2/send.2:285 build/C/man2/socket.2:316
958 #, no-wrap
959 msgid "B<EACCES>"
960 msgstr "B<EACCES>"
961
962 #.  e.g., privileged port in AF_INET domain
963 #. type: Plain text
964 #: build/C/man2/bind.2:162
965 msgid "The address is protected, and the user is not the superuser."
966 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
967
968 #. type: TP
969 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
970 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
971 #, no-wrap
972 msgid "B<EADDRINUSE>"
973 msgstr "B<EADDRINUSE>"
974
975 #. type: Plain text
976 #: build/C/man2/bind.2:165
977 msgid "The given address is already in use."
978 msgstr "指定されたアドレスが既に使用中である。"
979
980 #. type: Plain text
981 #: build/C/man2/bind.2:169
982 msgid "I<sockfd> is not a valid descriptor."
983 msgstr "I<sockfd> が不正なディスクリプタである。"
984
985 #.  This may change in the future: see
986 #.  .I linux/unix/sock.c for details.
987 #. type: Plain text
988 #: build/C/man2/bind.2:174
989 msgid "The socket is already bound to an address."
990 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
991
992 #. type: Plain text
993 #: build/C/man2/bind.2:178
994 msgid "I<sockfd> is a descriptor for a file, not a socket."
995 msgstr ""
996 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
997
998 #. type: Plain text
999 #: build/C/man2/bind.2:182
1000 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1001 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1002
1003 #. type: Plain text
1004 #: build/C/man2/bind.2:187
1005 msgid ""
1006 "Search permission is denied on a component of the path prefix.  (See also "
1007 "B<path_resolution>(7).)"
1008 msgstr ""
1009 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1010 "(7)  も参照すること)。"
1011
1012 #. type: TP
1013 #: build/C/man2/bind.2:187
1014 #, no-wrap
1015 msgid "B<EADDRNOTAVAIL>"
1016 msgstr "B<EADDRNOTAVAIL>"
1017
1018 #. type: Plain text
1019 #: build/C/man2/bind.2:191
1020 msgid ""
1021 "A nonexistent interface was requested or the requested address was not local."
1022 msgstr ""
1023 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1024 "かった。"
1025
1026 #. type: Plain text
1027 #: build/C/man2/bind.2:195
1028 msgid "I<addr> points outside the user's accessible address space."
1029 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1030
1031 #. type: Plain text
1032 #: build/C/man2/bind.2:202
1033 msgid ""
1034 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1035 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1036
1037 #. type: TP
1038 #: build/C/man2/bind.2:202
1039 #, no-wrap
1040 msgid "B<ELOOP>"
1041 msgstr "B<ELOOP>"
1042
1043 #. type: Plain text
1044 #: build/C/man2/bind.2:206
1045 msgid "Too many symbolic links were encountered in resolving I<addr>."
1046 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1047
1048 #. type: TP
1049 #: build/C/man2/bind.2:206
1050 #, no-wrap
1051 msgid "B<ENAMETOOLONG>"
1052 msgstr "B<ENAMETOOLONG>"
1053
1054 #. type: Plain text
1055 #: build/C/man2/bind.2:210
1056 msgid "I<addr> is too long."
1057 msgstr "I<addr> が長過ぎる。"
1058
1059 #. type: TP
1060 #: build/C/man2/bind.2:210
1061 #, no-wrap
1062 msgid "B<ENOENT>"
1063 msgstr "B<ENOENT>"
1064
1065 #. type: Plain text
1066 #: build/C/man2/bind.2:213
1067 msgid "The file does not exist."
1068 msgstr "ファイルが存在しない。"
1069
1070 #. type: TP
1071 #: build/C/man2/bind.2:213 build/C/man2/recv.2:452 build/C/man2/select.2:333
1072 #: build/C/man2/send.2:343
1073 #, no-wrap
1074 msgid "B<ENOMEM>"
1075 msgstr "B<ENOMEM>"
1076
1077 #. type: Plain text
1078 #: build/C/man2/bind.2:216
1079 msgid "Insufficient kernel memory was available."
1080 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1081
1082 #. type: TP
1083 #: build/C/man2/bind.2:216
1084 #, no-wrap
1085 msgid "B<ENOTDIR>"
1086 msgstr "B<ENOTDIR>"
1087
1088 #. type: Plain text
1089 #: build/C/man2/bind.2:219
1090 msgid "A component of the path prefix is not a directory."
1091 msgstr "パス名の構成要素がディレクトリではない。"
1092
1093 #. type: TP
1094 #: build/C/man2/bind.2:219
1095 #, no-wrap
1096 msgid "B<EROFS>"
1097 msgstr "B<EROFS>"
1098
1099 #. type: Plain text
1100 #: build/C/man2/bind.2:222
1101 msgid "The socket inode would reside on a read-only filesystem."
1102 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1103
1104 #.  SVr4 documents an additional
1105 #.  .B ENOSR
1106 #.  general error condition, and
1107 #.  additional
1108 #.  .B EIO
1109 #.  and
1110 #.  .B EISDIR
1111 #.  UNIX-domain error conditions.
1112 #. type: Plain text
1113 #: build/C/man2/bind.2:234
1114 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1115 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1116
1117 #. type: Plain text
1118 #: build/C/man2/bind.2:251
1119 msgid ""
1120 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1121 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1122 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1123 msgstr ""
1124 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1125 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1126 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1127
1128 #. type: SH
1129 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1130 #: build/C/man2/select.2:485 build/C/man2/send.2:414
1131 #: build/C/man3/sockatmark.3:100 build/C/man7/socket.7:945
1132 #, no-wrap
1133 msgid "BUGS"
1134 msgstr "バグ"
1135
1136 #.  FIXME What *are* transparent proxy options?
1137 #. type: Plain text
1138 #: build/C/man2/bind.2:254
1139 msgid "The transparent proxy options are not described."
1140 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1141
1142 #. type: Plain text
1143 #: build/C/man2/bind.2:259
1144 msgid ""
1145 "An example of the use of B<bind>()  with Internet domain sockets can be "
1146 "found in B<getaddrinfo>(3)."
1147 msgstr ""
1148 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1149 "(3)  に記載されている。"
1150
1151 #.  listen.7 refers to this example.
1152 #.  accept.7 refers to this example.
1153 #.  unix.7 refers to this example.
1154 #. type: Plain text
1155 #: build/C/man2/bind.2:266
1156 msgid ""
1157 "The following example shows how to bind a stream socket in the UNIX "
1158 "(B<AF_UNIX>)  domain, and accept connections:"
1159 msgstr ""
1160 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1161 "を示したものである。"
1162
1163 #. type: Plain text
1164 #: build/C/man2/bind.2:273
1165 #, no-wrap
1166 msgid ""
1167 "#include E<lt>sys/socket.hE<gt>\n"
1168 "#include E<lt>sys/un.hE<gt>\n"
1169 "#include E<lt>stdlib.hE<gt>\n"
1170 "#include E<lt>stdio.hE<gt>\n"
1171 "#include E<lt>string.hE<gt>\n"
1172 msgstr ""
1173 "#include E<lt>sys/socket.hE<gt>\n"
1174 "#include E<lt>sys/un.hE<gt>\n"
1175 "#include E<lt>stdlib.hE<gt>\n"
1176 "#include E<lt>stdio.hE<gt>\n"
1177 "#include E<lt>string.hE<gt>\n"
1178
1179 #. type: Plain text
1180 #: build/C/man2/bind.2:276
1181 #, no-wrap
1182 msgid ""
1183 "#define MY_SOCK_PATH \"/somepath\"\n"
1184 "#define LISTEN_BACKLOG 50\n"
1185 msgstr ""
1186 "#define MY_SOCK_PATH \"/somepath\"\n"
1187 "#define LISTEN_BACKLOG 50\n"
1188
1189 #. type: Plain text
1190 #: build/C/man2/bind.2:279
1191 #, no-wrap
1192 msgid ""
1193 "#define handle_error(msg) \\e\n"
1194 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1195 msgstr ""
1196 "#define handle_error(msg) \\e\n"
1197 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1198
1199 #. type: Plain text
1200 #: build/C/man2/bind.2:286
1201 #, no-wrap
1202 msgid ""
1203 "int\n"
1204 "main(int argc, char *argv[])\n"
1205 "{\n"
1206 "    int sfd, cfd;\n"
1207 "    struct sockaddr_un my_addr, peer_addr;\n"
1208 "    socklen_t peer_addr_size;\n"
1209 msgstr ""
1210 "int\n"
1211 "main(int argc, char *argv[])\n"
1212 "{\n"
1213 "    int sfd, cfd;\n"
1214 "    struct sockaddr_un my_addr, peer_addr;\n"
1215 "    socklen_t peer_addr_size;\n"
1216
1217 #. type: Plain text
1218 #: build/C/man2/bind.2:290
1219 #, no-wrap
1220 msgid ""
1221 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1222 "    if (sfd == -1)\n"
1223 "        handle_error(\"socket\");\n"
1224 msgstr ""
1225 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1226 "    if (sfd == -1)\n"
1227 "        handle_error(\"socket\");\n"
1228
1229 #. type: Plain text
1230 #: build/C/man2/bind.2:296
1231 #, no-wrap
1232 msgid ""
1233 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1234 "                        /* Clear structure */\n"
1235 "    my_addr.sun_family = AF_UNIX;\n"
1236 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1237 "            sizeof(my_addr.sun_path) - 1);\n"
1238 msgstr ""
1239 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1240 "                        /* Clear structure */\n"
1241 "    my_addr.sun_family = AF_UNIX;\n"
1242 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1243 "            sizeof(my_addr.sun_path) - 1);\n"
1244
1245 #. type: Plain text
1246 #: build/C/man2/bind.2:300
1247 #, no-wrap
1248 msgid ""
1249 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1250 "            sizeof(struct sockaddr_un)) == -1)\n"
1251 "        handle_error(\"bind\");\n"
1252 msgstr ""
1253 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1254 "            sizeof(struct sockaddr_un)) == -1)\n"
1255 "        handle_error(\"bind\");\n"
1256
1257 #. type: Plain text
1258 #: build/C/man2/bind.2:303
1259 #, no-wrap
1260 msgid ""
1261 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1262 "        handle_error(\"listen\");\n"
1263 msgstr ""
1264 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1265 "        handle_error(\"listen\");\n"
1266
1267 #. type: Plain text
1268 #: build/C/man2/bind.2:306
1269 #, no-wrap
1270 msgid ""
1271 "    /* Now we can accept incoming connections one\n"
1272 "       at a time using accept(2) */\n"
1273 msgstr ""
1274 "    /* Now we can accept incoming connections one\n"
1275 "       at a time using accept(2) */\n"
1276
1277 #. type: Plain text
1278 #: build/C/man2/bind.2:312
1279 #, no-wrap
1280 msgid ""
1281 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1282 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1283 "                 &peer_addr_size);\n"
1284 "    if (cfd == -1)\n"
1285 "        handle_error(\"accept\");\n"
1286 msgstr ""
1287 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1288 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1289 "                 &peer_addr_size)\n"
1290 "    if (cfd == -1)\n"
1291 "        handle_error(\"accept\");\n"
1292
1293 #. type: Plain text
1294 #: build/C/man2/bind.2:314
1295 #, no-wrap
1296 msgid "    /* Code to deal with incoming connection(s)... */\n"
1297 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1298
1299 #. type: Plain text
1300 #: build/C/man2/bind.2:318
1301 #, no-wrap
1302 msgid ""
1303 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1304 "       should be deleted using unlink(2) or remove(3) */\n"
1305 "}\n"
1306 msgstr ""
1307 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1308 "       should be deleted using unlink(2) or remove(3) */\n"
1309 "}\n"
1310
1311 #. type: Plain text
1312 #: build/C/man2/bind.2:332
1313 msgid ""
1314 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1315 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1316 "(7), B<socket>(7), B<unix>(7)"
1317 msgstr ""
1318 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1319 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1320 "(7), B<socket>(7), B<unix>(7)"
1321
1322 #. type: TH
1323 #: build/C/man3/bindresvport.3:30
1324 #, no-wrap
1325 msgid "BINDRESVPORT"
1326 msgstr "BINDRESVPORT"
1327
1328 #. type: TH
1329 #: build/C/man3/bindresvport.3:30
1330 #, no-wrap
1331 msgid "2013-06-21"
1332 msgstr "2013-06-21"
1333
1334 #. type: Plain text
1335 #: build/C/man3/bindresvport.3:33
1336 msgid "bindresvport - bind a socket to a privileged IP port"
1337 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1338
1339 #. type: Plain text
1340 #: build/C/man3/bindresvport.3:37
1341 #, no-wrap
1342 msgid ""
1343 "B<#include E<lt>sys/types.hE<gt>>\n"
1344 "B<#include E<lt>netinet/in.hE<gt>>\n"
1345 msgstr ""
1346 "B<#include E<lt>sys/types.hE<gt>>\n"
1347 "B<#include E<lt>netinet/in.hE<gt>>\n"
1348
1349 #. type: Plain text
1350 #: build/C/man3/bindresvport.3:39
1351 #, no-wrap
1352 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1353 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1354
1355 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1356 #. type: Plain text
1357 #: build/C/man3/bindresvport.3:46
1358 msgid ""
1359 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1360 "anonymous IP port, that is, a port number arbitrarily selected from the "
1361 "range 512 to 1023."
1362 msgstr ""
1363 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1364 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1365 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1366
1367 #. type: Plain text
1368 #: build/C/man3/bindresvport.3:56
1369 msgid ""
1370 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1371 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1372 "allocated."
1373 msgstr ""
1374 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1375 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1376 "される。"
1377
1378 #. type: Plain text
1379 #: build/C/man3/bindresvport.3:67
1380 msgid ""
1381 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1382 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1383 "return the port number actually allocated.  (This information can later be "
1384 "obtained using B<getsockname>(2).)"
1385 msgstr ""
1386 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1387 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1388 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1389 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1390
1391 #. type: Plain text
1392 #: build/C/man3/bindresvport.3:72
1393 msgid ""
1394 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1395 "I<errno> set to indicate the cause of the error."
1396 msgstr ""
1397 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1398 "I<errno> にエラーの原因を示す値を設定する。"
1399
1400 #. type: Plain text
1401 #: build/C/man3/bindresvport.3:77
1402 msgid ""
1403 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1404 "addition, the following errors may occur:"
1405 msgstr ""
1406 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1407 "以下のエラーが発生することがある:"
1408
1409 #. type: Plain text
1410 #: build/C/man3/bindresvport.3:82
1411 msgid ""
1412 "The caller did not have superuser privilege (to be precise: the "
1413 "B<CAP_NET_BIND_SERVICE> capability is required)."
1414 msgstr ""
1415 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1416 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1417
1418 #. type: Plain text
1419 #: build/C/man3/bindresvport.3:85
1420 msgid "All privileged ports are in use."
1421 msgstr "全ての特権ポートが使用中である。"
1422
1423 #. type: TP
1424 #: build/C/man3/bindresvport.3:85
1425 #, no-wrap
1426 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1427 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1428
1429 #. type: Plain text
1430 #: build/C/man3/bindresvport.3:92
1431 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1432 msgstr ""
1433 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1434
1435 #. type: SH
1436 #: build/C/man3/bindresvport.3:92 build/C/man3/sockatmark.3:73
1437 #, no-wrap
1438 msgid "ATTRIBUTES"
1439 msgstr "属性"
1440
1441 #. type: SS
1442 #: build/C/man3/bindresvport.3:93 build/C/man3/sockatmark.3:74
1443 #, no-wrap
1444 msgid "Multithreading (see pthreads(7))"
1445 msgstr "マルチスレッディング (pthreads(7) 参照)"
1446
1447 #. type: Plain text
1448 #: build/C/man3/bindresvport.3:98
1449 msgid ""
1450 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1451 "that is not protected, so it is not thread-safe."
1452 msgstr ""
1453 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1454 "静的変数を使用しているため、スレッドセーフではない。"
1455
1456 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1457 #. type: Plain text
1458 #: build/C/man3/bindresvport.3:104
1459 msgid ""
1460 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1461 "static variable, so it is thread-safe."
1462 msgstr ""
1463 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1464 "ており、スレッドセーフである。"
1465
1466 #. type: Plain text
1467 #: build/C/man3/bindresvport.3:107
1468 msgid ""
1469 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1470 msgstr ""
1471 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1472
1473 #. type: Plain text
1474 #: build/C/man3/bindresvport.3:113
1475 msgid ""
1476 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1477 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1478 msgstr ""
1479 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1480 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1481
1482 #. type: Plain text
1483 #: build/C/man3/bindresvport.3:116
1484 msgid "B<bind>(2), B<getsockname>(2)"
1485 msgstr "B<bind>(2), B<getsockname>(2)"
1486
1487 #. type: TH
1488 #: build/C/man2/connect.2:67
1489 #, no-wrap
1490 msgid "CONNECT"
1491 msgstr "CONNECT"
1492
1493 #. type: TH
1494 #: build/C/man2/connect.2:67 build/C/man2/getsockname.2:40
1495 #, no-wrap
1496 msgid "2008-12-03"
1497 msgstr "2008-12-03"
1498
1499 #. type: Plain text
1500 #: build/C/man2/connect.2:70
1501 msgid "connect - initiate a connection on a socket"
1502 msgstr "connect - ソケットの接続を行う"
1503
1504 #. type: Plain text
1505 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1506 #: build/C/man2/listen.2:51
1507 #, no-wrap
1508 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1509 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1510
1511 #. type: Plain text
1512 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1513 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1514 #: build/C/man2/recv.2:51
1515 #, no-wrap
1516 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1517 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1518
1519 #. type: Plain text
1520 #: build/C/man2/connect.2:78
1521 #, no-wrap
1522 msgid ""
1523 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1524 "B<            socklen_t >I<addrlen>B<);>\n"
1525 msgstr ""
1526 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1527 "B<            socklen_t >I<addrlen>B<);>\n"
1528
1529 #. type: Plain text
1530 #: build/C/man2/connect.2:97
1531 msgid ""
1532 "The B<connect>()  system call connects the socket referred to by the file "
1533 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1534 "argument specifies the size of I<addr>.  The format of the address in "
1535 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1536 "B<socket>(2)  for further details."
1537 msgstr ""
1538 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1539 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1540 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1541 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1542 "こと。"
1543
1544 #. type: Plain text
1545 #: build/C/man2/connect.2:113
1546 msgid ""
1547 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1548 "to which datagrams are sent by default, and the only address from which "
1549 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1550 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1551 "that is bound to the address specified by I<addr>."
1552 msgstr ""
1553 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1554 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1555 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1556 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1557 "に対する接続の 作成を試みる。"
1558
1559 #. type: Plain text
1560 #: build/C/man2/connect.2:127
1561 msgid ""
1562 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1563 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1564 "times to change their association.  Connectionless sockets may dissolve the "
1565 "association by connecting to an address with the I<sa_family> member of "
1566 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1567 msgstr ""
1568 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1569 "()  が成功する。 コネクションレス (connectionless) プロトコルでは対応を変更す"
1570 "るために何度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1571 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1572 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1573
1574 #. type: Plain text
1575 #: build/C/man2/connect.2:132
1576 msgid ""
1577 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1578 "returned, and I<errno> is set appropriately."
1579 msgstr ""
1580 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1581 "適切な値を設定する。"
1582
1583 #. type: Plain text
1584 #: build/C/man2/connect.2:135
1585 msgid ""
1586 "The following are general socket errors only.  There may be other domain-"
1587 "specific error codes."
1588 msgstr ""
1589 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1590 "する可能性がある。"
1591
1592 #. type: Plain text
1593 #: build/C/man2/connect.2:143
1594 msgid ""
1595 "For UNIX domain sockets, which are identified by pathname: Write permission "
1596 "is denied on the socket file, or search permission is denied for one of the "
1597 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1598 msgstr ""
1599 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1600 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1601 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1602
1603 #. type: TP
1604 #: build/C/man2/connect.2:143
1605 #, no-wrap
1606 msgid "B<EACCES>, B<EPERM>"
1607 msgstr "B<EACCES>, B<EPERM>"
1608
1609 #. type: Plain text
1610 #: build/C/man2/connect.2:148
1611 msgid ""
1612 "The user tried to connect to a broadcast address without having the socket "
1613 "broadcast flag enabled or the connection request failed because of a local "
1614 "firewall rule."
1615 msgstr ""
1616 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1617 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1618 "要求が失敗した。"
1619
1620 #. type: Plain text
1621 #: build/C/man2/connect.2:151
1622 msgid "Local address is already in use."
1623 msgstr "ローカルアドレスが既に使用されている。"
1624
1625 #. type: TP
1626 #: build/C/man2/connect.2:151 build/C/man2/socket.2:320
1627 #: build/C/man2/socketpair.2:75
1628 #, no-wrap
1629 msgid "B<EAFNOSUPPORT>"
1630 msgstr "B<EAFNOSUPPORT>"
1631
1632 #. type: Plain text
1633 #: build/C/man2/connect.2:156
1634 msgid ""
1635 "The passed address didn't have the correct address family in its "
1636 "I<sa_family> field."
1637 msgstr ""
1638 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1639 "い。"
1640
1641 #. type: TP
1642 #: build/C/man2/connect.2:156
1643 #, no-wrap
1644 msgid "B<EAGAIN>"
1645 msgstr "B<EAGAIN>"
1646
1647 #. type: Plain text
1648 #: build/C/man2/connect.2:165
1649 msgid ""
1650 "No more free local ports or insufficient entries in the routing cache.  For "
1651 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1652 "B<ip>(7)  for information on how to increase the number of local ports."
1653 msgstr ""
1654 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1655 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1656 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1657
1658 #. type: TP
1659 #: build/C/man2/connect.2:165
1660 #, no-wrap
1661 msgid "B<EALREADY>"
1662 msgstr "B<EALREADY>"
1663
1664 #. type: Plain text
1665 #: build/C/man2/connect.2:169
1666 msgid ""
1667 "The socket is nonblocking and a previous connection attempt has not yet been "
1668 "completed."
1669 msgstr ""
1670 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1671
1672 #. type: Plain text
1673 #: build/C/man2/connect.2:172
1674 msgid "The file descriptor is not a valid index in the descriptor table."
1675 msgstr ""
1676 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1677 "い。"
1678
1679 #. type: TP
1680 #: build/C/man2/connect.2:172 build/C/man2/recv.2:435
1681 #, no-wrap
1682 msgid "B<ECONNREFUSED>"
1683 msgstr "B<ECONNREFUSED>"
1684
1685 #. type: Plain text
1686 #: build/C/man2/connect.2:175
1687 msgid "No-one listening on the remote address."
1688 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1689
1690 #. type: Plain text
1691 #: build/C/man2/connect.2:178
1692 msgid "The socket structure address is outside the user's address space."
1693 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1694
1695 #. type: TP
1696 #: build/C/man2/connect.2:178
1697 #, no-wrap
1698 msgid "B<EINPROGRESS>"
1699 msgstr "B<EINPROGRESS>"
1700
1701 #. type: Plain text
1702 #: build/C/man2/connect.2:203
1703 msgid ""
1704 "The socket is nonblocking and the connection cannot be completed "
1705 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1706 "by selecting the socket for writing.  After B<select>(2)  indicates "
1707 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1708 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1709 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1710 "error codes listed here, explaining the reason for the failure)."
1711 msgstr ""
1712 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1713 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1714 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1715 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1716 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1717 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1718 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1719 "の原因が分かる。"
1720
1721 #.  For TCP, the connection will complete asynchronously.
1722 #.  See http://lkml.org/lkml/2005/7/12/254
1723 #. type: Plain text
1724 #: build/C/man2/connect.2:209
1725 msgid ""
1726 "The system call was interrupted by a signal that was caught; see B<signal>"
1727 "(7)."
1728 msgstr ""
1729 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1730
1731 #. type: TP
1732 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1733 #, no-wrap
1734 msgid "B<EISCONN>"
1735 msgstr "B<EISCONN>"
1736
1737 #. type: Plain text
1738 #: build/C/man2/connect.2:212
1739 msgid "The socket is already connected."
1740 msgstr "ソケットは既に接続 (connect) されている。"
1741
1742 #. type: TP
1743 #: build/C/man2/connect.2:212
1744 #, no-wrap
1745 msgid "B<ENETUNREACH>"
1746 msgstr "B<ENETUNREACH>"
1747
1748 #. type: Plain text
1749 #: build/C/man2/connect.2:215
1750 msgid "Network is unreachable."
1751 msgstr "到達できないネットワークである。"
1752
1753 #. type: Plain text
1754 #: build/C/man2/connect.2:218
1755 msgid "The file descriptor is not associated with a socket."
1756 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1757
1758 #. type: TP
1759 #: build/C/man2/connect.2:218
1760 #, no-wrap
1761 msgid "B<ETIMEDOUT>"
1762 msgstr "B<ETIMEDOUT>"
1763
1764 #. type: Plain text
1765 #: build/C/man2/connect.2:225
1766 msgid ""
1767 "Timeout while attempting connection.  The server may be too busy to accept "
1768 "new connections.  Note that for IP sockets the timeout may be very long when "
1769 "syncookies are enabled on the server."
1770 msgstr ""
1771 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1772 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1773 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1774 "ること。"
1775
1776 #.  SVr4 documents the additional
1777 #.  general error codes
1778 #.  .BR EADDRNOTAVAIL ,
1779 #.  .BR EINVAL ,
1780 #.  .BR EAFNOSUPPORT ,
1781 #.  .BR EALREADY ,
1782 #.  .BR EINTR ,
1783 #.  .BR EPROTOTYPE ,
1784 #.  and
1785 #.  .BR ENOSR .
1786 #.  It also
1787 #.  documents many additional error conditions not described here.
1788 #. type: Plain text
1789 #: build/C/man2/connect.2:241
1790 msgid ""
1791 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1792 "POSIX.1-2001."
1793 msgstr ""
1794 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1795
1796 #. type: Plain text
1797 #: build/C/man2/connect.2:258
1798 msgid ""
1799 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1800 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1801 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1802 msgstr ""
1803 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1804 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1805 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1806
1807 #. type: Plain text
1808 #: build/C/man2/connect.2:263
1809 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1810 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1811
1812 #. type: Plain text
1813 #: build/C/man2/connect.2:270
1814 msgid ""
1815 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1816 "B<path_resolution>(7)"
1817 msgstr ""
1818 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1819 "B<path_resolution>(7)"
1820
1821 #. type: TH
1822 #: build/C/man3/getifaddrs.3:36
1823 #, no-wrap
1824 msgid "GETIFADDRS"
1825 msgstr "GETIFADDRS"
1826
1827 #. type: TH
1828 #: build/C/man3/getifaddrs.3:36
1829 #, no-wrap
1830 msgid "2014-02-26"
1831 msgstr ""
1832
1833 #. type: TH
1834 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1835 #: build/C/man3/if_nametoindex.3:25
1836 #, no-wrap
1837 msgid "GNU"
1838 msgstr "GNU"
1839
1840 #. type: Plain text
1841 #: build/C/man3/getifaddrs.3:39
1842 msgid "getifaddrs, freeifaddrs - get interface addresses"
1843 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1844
1845 #. type: Plain text
1846 #: build/C/man3/getifaddrs.3:43
1847 #, no-wrap
1848 msgid ""
1849 "B<#include E<lt>sys/types.hE<gt>>\n"
1850 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1851 msgstr ""
1852 "B<#include E<lt>sys/types.hE<gt>>\n"
1853 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1854
1855 #. type: Plain text
1856 #: build/C/man3/getifaddrs.3:45
1857 #, no-wrap
1858 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1859 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1860
1861 #. type: Plain text
1862 #: build/C/man3/getifaddrs.3:47
1863 #, no-wrap
1864 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1865 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1866
1867 #. type: Plain text
1868 #: build/C/man3/getifaddrs.3:58
1869 msgid ""
1870 "The B<getifaddrs>()  function creates a linked list of structures describing "
1871 "the network interfaces of the local system, and stores the address of the "
1872 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1873 "structures, defined as follows:"
1874 msgstr ""
1875 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1876 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1877 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1878 "うに定義されている。"
1879
1880 #. type: Plain text
1881 #: build/C/man3/getifaddrs.3:77
1882 #, no-wrap
1883 msgid ""
1884 "struct ifaddrs {\n"
1885 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1886 "    char            *ifa_name;    /* Name of interface */\n"
1887 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1888 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1889 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1890 "    union {\n"
1891 "        struct sockaddr *ifu_broadaddr;\n"
1892 "                         /* Broadcast address of interface */\n"
1893 "        struct sockaddr *ifu_dstaddr;\n"
1894 "                         /* Point-to-point destination address */\n"
1895 "    } ifa_ifu;\n"
1896 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1897 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1898 "    void            *ifa_data;    /* Address-specific data */\n"
1899 "};\n"
1900 msgstr ""
1901 "struct ifaddrs {\n"
1902 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1903 "    char            *ifa_name;    /* Name of interface */\n"
1904 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1905 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1906 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1907 "    union {\n"
1908 "        struct sockaddr *ifu_broadaddr;\n"
1909 "                         /* Broadcast address of interface */\n"
1910 "        struct sockaddr *ifu_dstaddr;\n"
1911 "                         /* Point-to-point destination address */\n"
1912 "    } ifa_ifu;\n"
1913 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1914 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1915 "    void            *ifa_data;    /* Address-specific data */\n"
1916 "};\n"
1917
1918 #. type: Plain text
1919 #: build/C/man3/getifaddrs.3:84
1920 msgid ""
1921 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1922 "or NULL if this is the last item of the list."
1923 msgstr ""
1924 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1925 "素がリストの最後の場合には NULL が入る。"
1926
1927 #.  The constant
1928 #.  .B IF NAMESIZE
1929 #.  indicates the maximum length of this field.
1930 #. type: Plain text
1931 #: build/C/man3/getifaddrs.3:91
1932 msgid "The I<ifa_name> points to the null-terminated interface name."
1933 msgstr "I<ifa_name> は NULL 終端されたインターフェース名を指す。"
1934
1935 #. type: Plain text
1936 #: build/C/man3/getifaddrs.3:100
1937 msgid ""
1938 "The I<ifa_flags> field contains the interface flags, as returned by the "
1939 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1940 "these flags)."
1941 msgstr ""
1942 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1943 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1944 "B<netdevice>(7) を参照)。"
1945
1946 #. type: Plain text
1947 #: build/C/man3/getifaddrs.3:109
1948 #, fuzzy
1949 #| msgid ""
1950 #| "The I<ifa_addr> field points to a structure containing the interface "
1951 #| "address.  (The I<sa_family> subfield should be consulted to determine the "
1952 #| "format of the address structure.)  This field may contain a NULL pointer."
1953 msgid ""
1954 "The I<ifa_addr> field points to a structure containing the interface "
1955 "address.  (The I<sa_family> subfield should be consulted to determine the "
1956 "format of the address structure.)  This field may contain a null pointer."
1957 msgstr ""
1958 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
1959 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
1960 "すべきである)。 このフィールドは NULL ポインタとなる場合がある。"
1961
1962 #. type: Plain text
1963 #: build/C/man3/getifaddrs.3:116
1964 #, fuzzy
1965 #| msgid ""
1966 #| "The I<ifa_netmask> field points to a structure containing the netmask "
1967 #| "associated with I<ifa_addr>, if applicable for the address family.  This "
1968 #| "field may contain a NULL pointer."
1969 msgid ""
1970 "The I<ifa_netmask> field points to a structure containing the netmask "
1971 "associated with I<ifa_addr>, if applicable for the address family.  This "
1972 "field may contain a null pointer."
1973 msgstr ""
1974 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
1975 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
1976 "る。 このフィールドは NULL ポインタとなる場合がある。"
1977
1978 #. type: Plain text
1979 #: build/C/man3/getifaddrs.3:131
1980 msgid ""
1981 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1982 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1983 "will contain the broadcast address associated with I<ifa_addr> (if "
1984 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1985 "destination address of the point-to-point interface."
1986 msgstr ""
1987 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
1988 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
1989 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
1990 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
1991 "point インターフェースの宛先アドレスが入るかが決まる。"
1992
1993 #. type: Plain text
1994 #: build/C/man3/getifaddrs.3:136
1995 msgid ""
1996 "The I<ifa_data> field points to a buffer containing address-family-specific "
1997 "data; this field may be NULL if there is no such data for this interface."
1998 msgstr ""
1999 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
2000 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
2001 "フィールドは NULL となる。"
2002
2003 #. type: Plain text
2004 #: build/C/man3/getifaddrs.3:142
2005 msgid ""
2006 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
2007 "freed using B<freeifaddrs>()  when no longer needed."
2008 msgstr ""
2009 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2010 "B<freeifaddrs>() を使って解放すべきである。"
2011
2012 #. type: Plain text
2013 #: build/C/man3/getifaddrs.3:149
2014 msgid ""
2015 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2016 "I<errno> is set appropriately."
2017 msgstr ""
2018 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2019 "が適切に設定される。"
2020
2021 #. type: Plain text
2022 #: build/C/man3/getifaddrs.3:162
2023 msgid ""
2024 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2025 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
2026 "(2), B<malloc>(3), or B<realloc>(3)."
2027 msgstr ""
2028 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には B<socket>"
2029 "(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>"
2030 "(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定される。"
2031
2032 #. type: Plain text
2033 #: build/C/man3/getifaddrs.3:170
2034 msgid ""
2035 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2036 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2037 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2038 "available only on kernels that support netlink."
2039 msgstr ""
2040 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2041 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2042 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2043 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2044
2045 #.  , but the BSD-derived documentation generally
2046 #.  appears to be confused and obsolete on this point.
2047 #.  i.e., commonly it still says one of them will be NULL, even if
2048 #.  the ifa_ifu union is already present
2049 #. type: Plain text
2050 #: build/C/man3/getifaddrs.3:190
2051 msgid ""
2052 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2053 "the BSD systems, but with slightly different semantics documented"
2054 "\\(emreturning one entry per interface, not per address.  This means "
2055 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2056 "address, and no link-level address is returned if the interface has an IP "
2057 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2058 "I<ifa_dstaddr> differs on various systems."
2059 msgstr ""
2060 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2061 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2062 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2063 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2064 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2065 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2066 "どちらを選択するかを決める方法は、 システムにより異なる。"
2067
2068 #. type: Plain text
2069 #: build/C/man3/getifaddrs.3:207
2070 msgid ""
2071 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2072 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2073 "containing lower-level details about the interface and its physical layer.  "
2074 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2075 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2076 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2077 "hE<gt>>), which contains various interface attributes and statistics."
2078 msgstr ""
2079 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2080 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2081 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2082 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2083 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2084 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2085 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2086 "インターフェースの様々な属性や統計情報が入る。"
2087
2088 #. type: Plain text
2089 #: build/C/man3/getifaddrs.3:214
2090 msgid ""
2091 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2092 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2093 "system:"
2094 msgstr ""
2095 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2096 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2097
2098 #. type: Plain text
2099 #: build/C/man3/getifaddrs.3:235
2100 #, no-wrap
2101 msgid ""
2102 "$ B<./a.out>\n"
2103 "lo       AF_PACKET (17)\n"
2104 "                tx_packets =        524; rx_packets =        524\n"
2105 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2106 "wlp3s0   AF_PACKET (17)\n"
2107 "                tx_packets =     108391; rx_packets =     130245\n"
2108 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2109 "em1      AF_PACKET (17)\n"
2110 "                tx_packets =          0; rx_packets =          0\n"
2111 "                tx_bytes   =          0; rx_bytes   =          0\n"
2112 "lo       AF_INET (2)\n"
2113 "                address: E<lt>127.0.0.1E<gt>\n"
2114 "wlp3s0   AF_INET (2)\n"
2115 "                address: E<lt>192.168.235.137E<gt>\n"
2116 "lo       AF_INET6 (10)\n"
2117 "                address: E<lt>::1E<gt>\n"
2118 "wlp3s0   AF_INET6 (10)\n"
2119 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2120 msgstr ""
2121
2122 #. type: SS
2123 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2124 #: build/C/man2/recvmmsg.2:206
2125 #, no-wrap
2126 msgid "Program source"
2127 msgstr "プログラムのソース"
2128
2129 #. type: Plain text
2130 #: build/C/man3/getifaddrs.3:249
2131 #, fuzzy, no-wrap
2132 #| msgid ""
2133 #| "#include E<lt>arpa/inet.hE<gt>\n"
2134 #| "#include E<lt>sys/socket.hE<gt>\n"
2135 #| "#include E<lt>netdb.hE<gt>\n"
2136 #| "#include E<lt>ifaddrs.hE<gt>\n"
2137 #| "#include E<lt>stdio.hE<gt>\n"
2138 #| "#include E<lt>stdlib.hE<gt>\n"
2139 #| "#include E<lt>unistd.hE<gt>\n"
2140 msgid ""
2141 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2142 "#include E<lt>arpa/inet.hE<gt>\n"
2143 "#include E<lt>sys/socket.hE<gt>\n"
2144 "#include E<lt>netdb.hE<gt>\n"
2145 "#include E<lt>ifaddrs.hE<gt>\n"
2146 "#include E<lt>stdio.hE<gt>\n"
2147 "#include E<lt>stdlib.hE<gt>\n"
2148 "#include E<lt>unistd.hE<gt>\n"
2149 "#include E<lt>linux/if_link.hE<gt>\n"
2150 msgstr ""
2151 "#include E<lt>arpa/inet.hE<gt>\n"
2152 "#include E<lt>sys/socket.hE<gt>\n"
2153 "#include E<lt>netdb.hE<gt>\n"
2154 "#include E<lt>ifaddrs.hE<gt>\n"
2155 "#include E<lt>stdio.hE<gt>\n"
2156 "#include E<lt>stdlib.hE<gt>\n"
2157 "#include E<lt>unistd.hE<gt>\n"
2158
2159 #. type: Plain text
2160 #: build/C/man3/getifaddrs.3:255
2161 #, fuzzy, no-wrap
2162 #| msgid ""
2163 #| "int\n"
2164 #| "main(int argc, char *argv[])\n"
2165 #| "{\n"
2166 #| "    struct ifaddrs *ifaddr, *ifa;\n"
2167 #| "    int family, s;\n"
2168 #| "    char host[NI_MAXHOST];\n"
2169 msgid ""
2170 "int main(int argc, char *argv[])\n"
2171 "{\n"
2172 "    struct ifaddrs *ifaddr, *ifa;\n"
2173 "    int family, s, n;\n"
2174 "    char host[NI_MAXHOST];\n"
2175 msgstr ""
2176 "int\n"
2177 "main(int argc, char *argv[])\n"
2178 "{\n"
2179 "    struct ifaddrs *ifaddr, *ifa;\n"
2180 "    int family, s;\n"
2181 "    char host[NI_MAXHOST];\n"
2182
2183 #. type: Plain text
2184 #: build/C/man3/getifaddrs.3:260
2185 #, no-wrap
2186 msgid ""
2187 "    if (getifaddrs(&ifaddr) == -1) {\n"
2188 "        perror(\"getifaddrs\");\n"
2189 "        exit(EXIT_FAILURE);\n"
2190 "    }\n"
2191 msgstr ""
2192 "    if (getifaddrs(&ifaddr) == -1) {\n"
2193 "        perror(\"getifaddrs\");\n"
2194 "        exit(EXIT_FAILURE);\n"
2195 "    }\n"
2196
2197 #. type: Plain text
2198 #: build/C/man3/getifaddrs.3:263
2199 #, no-wrap
2200 msgid ""
2201 "    /* Walk through linked list, maintaining head pointer so we\n"
2202 "       can free list later */\n"
2203 msgstr ""
2204 "    /* Walk through linked list, maintaining head pointer so we\n"
2205 "       can free list later */\n"
2206
2207 #. type: Plain text
2208 #: build/C/man3/getifaddrs.3:267
2209 #, fuzzy, no-wrap
2210 #| msgid ""
2211 #| "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2212 #| "        if (ifa-E<gt>ifa_addr == NULL)\n"
2213 #| "            continue;\n"
2214 msgid ""
2215 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2216 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2217 "            continue;\n"
2218 msgstr ""
2219 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2220 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2221 "            continue;\n"
2222
2223 #. type: Plain text
2224 #: build/C/man3/getifaddrs.3:269
2225 #, no-wrap
2226 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2227 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2228
2229 #. type: Plain text
2230 #: build/C/man3/getifaddrs.3:272
2231 #, no-wrap
2232 msgid ""
2233 "        /* Display interface name and family (including symbolic\n"
2234 "           form of the latter for the common families) */\n"
2235 msgstr ""
2236 "        /* Display interface name and family (including symbolic\n"
2237 "           form of the latter for the common families) */\n"
2238
2239 #. type: Plain text
2240 #: build/C/man3/getifaddrs.3:279
2241 #, fuzzy, no-wrap
2242 #| msgid ""
2243 #| "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2244 #| "                ifa-E<gt>ifa_name, family,\n"
2245 #| "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2246 #| "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2247 #| "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2248 msgid ""
2249 "        printf(\"%-8s %s (%d)\\en\",\n"
2250 "               ifa-E<gt>ifa_name,\n"
2251 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2252 "               (family == AF_INET) ? \"AF_INET\" :\n"
2253 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2254 "               family);\n"
2255 msgstr ""
2256 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2257 "                ifa-E<gt>ifa_name, family,\n"
2258 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2259 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2260 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2261
2262 #. type: Plain text
2263 #: build/C/man3/getifaddrs.3:281
2264 #, no-wrap
2265 msgid "        /* For an AF_INET* interface address, display the address */\n"
2266 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2267
2268 #. type: Plain text
2269 #: build/C/man3/getifaddrs.3:292
2270 #, fuzzy, no-wrap
2271 #| msgid ""
2272 #| "        if (family == AF_INET || family == AF_INET6) {\n"
2273 #| "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2274 #| "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2275 #| "                                          sizeof(struct sockaddr_in6),\n"
2276 #| "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2277 #| "            if (s != 0) {\n"
2278 #| "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2279 #| "                exit(EXIT_FAILURE);\n"
2280 #| "            }\n"
2281 #| "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2282 #| "        }\n"
2283 #| "    }\n"
2284 msgid ""
2285 "        if (family == AF_INET || family == AF_INET6) {\n"
2286 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2287 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2288 "                                          sizeof(struct sockaddr_in6),\n"
2289 "                    host, NI_MAXHOST,\n"
2290 "                    NULL, 0, NI_NUMERICHOST);\n"
2291 "            if (s != 0) {\n"
2292 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2293 "                exit(EXIT_FAILURE);\n"
2294 "            }\n"
2295 msgstr ""
2296 "        if (family == AF_INET || family == AF_INET6) {\n"
2297 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2298 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2299 "                                          sizeof(struct sockaddr_in6),\n"
2300 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2301 "            if (s != 0) {\n"
2302 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2303 "                exit(EXIT_FAILURE);\n"
2304 "            }\n"
2305 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2306 "        }\n"
2307 "    }\n"
2308
2309 #. type: Plain text
2310 #: build/C/man3/getifaddrs.3:294
2311 #, no-wrap
2312 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2313 msgstr ""
2314
2315 #. type: Plain text
2316 #: build/C/man3/getifaddrs.3:297
2317 #, no-wrap
2318 msgid ""
2319 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2320 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2321 msgstr ""
2322
2323 #. type: Plain text
2324 #: build/C/man3/getifaddrs.3:304
2325 #, no-wrap
2326 msgid ""
2327 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2328 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2329 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2330 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2331 "        }\n"
2332 "    }\n"
2333 msgstr ""
2334
2335 #. type: Plain text
2336 #: build/C/man3/getifaddrs.3:308
2337 #, no-wrap
2338 msgid ""
2339 "    freeifaddrs(ifaddr);\n"
2340 "    exit(EXIT_SUCCESS);\n"
2341 "}\n"
2342 msgstr ""
2343 "    freeifaddrs(ifaddr);\n"
2344 "    exit(EXIT_SUCCESS);\n"
2345 "}\n"
2346
2347 #. type: Plain text
2348 #: build/C/man3/getifaddrs.3:315
2349 msgid ""
2350 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2351 msgstr ""
2352 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2353
2354 #. type: TH
2355 #: build/C/man2/getsockname.2:40
2356 #, no-wrap
2357 msgid "GETSOCKNAME"
2358 msgstr "GETSOCKNAME"
2359
2360 #. type: Plain text
2361 #: build/C/man2/getsockname.2:43
2362 msgid "getsockname - get socket name"
2363 msgstr "getsockname - ソケットの名前を取得する"
2364
2365 #. type: Plain text
2366 #: build/C/man2/getsockname.2:49
2367 #, no-wrap
2368 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2369 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2370
2371 #. type: Plain text
2372 #: build/C/man2/getsockname.2:62
2373 msgid ""
2374 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2375 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2376 "should be initialized to indicate the amount of space (in bytes) pointed to "
2377 "by I<addr>.  On return it contains the actual size of the socket address."
2378 msgstr ""
2379 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2380 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2381 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2382 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2383 "納される。"
2384
2385 #. type: Plain text
2386 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2387 #: build/C/man2/listen.2:96
2388 msgid "The argument I<sockfd> is not a valid descriptor."
2389 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2390
2391 #. type: Plain text
2392 #: build/C/man2/getsockname.2:84
2393 msgid ""
2394 "The I<addr> argument points to memory not in a valid part of the process "
2395 "address space."
2396 msgstr ""
2397 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2398 "い。"
2399
2400 #. type: Plain text
2401 #: build/C/man2/getsockname.2:88
2402 msgid "I<addrlen> is invalid (e.g., is negative)."
2403 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2404
2405 #. type: TP
2406 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2407 #: build/C/man2/send.2:335
2408 #, no-wrap
2409 msgid "B<ENOBUFS>"
2410 msgstr "B<ENOBUFS>"
2411
2412 #. type: Plain text
2413 #: build/C/man2/getsockname.2:92
2414 msgid ""
2415 "Insufficient resources were available in the system to perform the operation."
2416 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2417
2418 #. type: Plain text
2419 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2420 msgid "The argument I<sockfd> is a file, not a socket."
2421 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2422
2423 #.  SVr4 documents additional ENOMEM
2424 #.  and ENOSR error codes.
2425 #. type: Plain text
2426 #: build/C/man2/getsockname.2:103
2427 msgid ""
2428 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2429 "POSIX.1-2001."
2430 msgstr ""
2431 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2432
2433 #. type: Plain text
2434 #: build/C/man2/getsockname.2:114
2435 msgid ""
2436 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2437 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2438 "resulted in the present I<socklen_t>, also used by glibc.  See also B<accept>"
2439 "(2)."
2440 msgstr ""
2441 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2442 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2443 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2444
2445 #. type: Plain text
2446 #: build/C/man2/getsockname.2:121
2447 msgid ""
2448 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2449 "(7)"
2450 msgstr ""
2451 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2452 "(7)"
2453
2454 #. type: TH
2455 #: build/C/man2/getsockopt.2:44
2456 #, no-wrap
2457 msgid "GETSOCKOPT"
2458 msgstr "GETSOCKOPT"
2459
2460 #. type: TH
2461 #: build/C/man2/getsockopt.2:44
2462 #, fuzzy, no-wrap
2463 #| msgid "2009-01-19"
2464 msgid "2014-01-24"
2465 msgstr "2009-01-19"
2466
2467 #. type: Plain text
2468 #: build/C/man2/getsockopt.2:47
2469 msgid "getsockopt, setsockopt - get and set options on sockets"
2470 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2471
2472 #. type: Plain text
2473 #: build/C/man2/getsockopt.2:57
2474 #, no-wrap
2475 msgid ""
2476 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2477 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2478 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2479 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2480 msgstr ""
2481 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2482 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2483 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2484 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2485
2486 #. type: Plain text
2487 #: build/C/man2/getsockopt.2:67
2488 msgid ""
2489 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2490 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2491 "protocol levels; they are always present at the uppermost socket level."
2492 msgstr ""
2493 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2494 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2495 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2496 "定される。"
2497
2498 #. type: Plain text
2499 #: build/C/man2/getsockopt.2:86
2500 msgid ""
2501 "When manipulating socket options, the level at which the option resides and "
2502 "the name of the option must be specified.  To manipulate options at the "
2503 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2504 "options at any other level the protocol number of the appropriate protocol "
2505 "controlling the option is supplied.  For example, to indicate that an option "
2506 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2507 "protocol number of B<TCP>; see B<getprotoent>(3)."
2508 msgstr ""
2509 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2510 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2511 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2512 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2513 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2514 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2515 "B<getprotoent>(3)  を参照すること。"
2516
2517 #. type: Plain text
2518 #: build/C/man2/getsockopt.2:108
2519 msgid ""
2520 "The arguments I<optval> and I<optlen> are used to access option values for "
2521 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2522 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2523 "I<optlen> is a value-result argument, initially containing the size of the "
2524 "buffer pointed to by I<optval>, and modified on return to indicate the "
2525 "actual size of the value returned.  If no option value is to be supplied or "
2526 "returned, I<optval> may be NULL."
2527 msgstr ""
2528 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2529 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2530 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2531 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2532 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2533 "I<optval> は NULL でも良い。"
2534
2535 #. type: Plain text
2536 #: build/C/man2/getsockopt.2:118
2537 msgid ""
2538 "I<Optname> and any specified options are passed uninterpreted to the "
2539 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2540 "socket.hE<gt>> contains definitions for socket level options, described "
2541 "below.  Options at other protocol levels vary in format and name; consult "
2542 "the appropriate entries in section 4 of the manual."
2543 msgstr ""
2544 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2545 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2546 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2547 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2548 "ること。"
2549
2550 #. type: Plain text
2551 #: build/C/man2/getsockopt.2:127
2552 msgid ""
2553 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2554 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2555 "or zero if the option is to be disabled."
2556 msgstr ""
2557 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2558 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2559 "を指定し、 無効(disable)にするにはゼロを指定する。"
2560
2561 #. type: Plain text
2562 #: build/C/man2/getsockopt.2:131
2563 msgid ""
2564 "For a description of the available socket options see B<socket>(7)  and the "
2565 "appropriate protocol man pages."
2566 msgstr ""
2567 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2568 "ルの man ページを参照のこと。"
2569
2570 #. type: Plain text
2571 #: build/C/man2/getsockopt.2:152
2572 msgid ""
2573 "The address pointed to by I<optval> is not in a valid part of the process "
2574 "address space.  For B<getsockopt>(), this error may also be returned if "
2575 "I<optlen> is not in a valid part of the process address space."
2576 msgstr ""
2577 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2578 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2579 "い場合にもこのエラーが返される。"
2580
2581 #. type: Plain text
2582 #: build/C/man2/getsockopt.2:163
2583 msgid ""
2584 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2585 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2586 "option described in B<ip>(7))."
2587 msgstr ""
2588 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2589 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2590 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2591
2592 #. type: TP
2593 #: build/C/man2/getsockopt.2:163
2594 #, no-wrap
2595 msgid "B<ENOPROTOOPT>"
2596 msgstr "B<ENOPROTOOPT>"
2597
2598 #. type: Plain text
2599 #: build/C/man2/getsockopt.2:166
2600 msgid "The option is unknown at the level indicated."
2601 msgstr "指定された層(level)にはこのオプションは存在しない。"
2602
2603 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2604 #.  not document the
2605 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2606 #.  options
2607 #. type: Plain text
2608 #: build/C/man2/getsockopt.2:178
2609 msgid ""
2610 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2611 msgstr ""
2612 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2613 "POSIX.1-2001."
2614
2615 #. type: Plain text
2616 #: build/C/man2/getsockopt.2:199
2617 msgid ""
2618 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2619 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2620 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2621 "glibc.  See also B<accept>(2)."
2622 msgstr ""
2623 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2624 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2625 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2626 "る。 B<accept>(2)  も参照のこと。"
2627
2628 #. type: Plain text
2629 #: build/C/man2/getsockopt.2:202
2630 msgid ""
2631 "Several of the socket options should be handled at lower levels of the "
2632 "system."
2633 msgstr ""
2634 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2635
2636 #. type: Plain text
2637 #: build/C/man2/getsockopt.2:212
2638 #, fuzzy
2639 #| msgid ""
2640 #| "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>"
2641 #| "(7), B<tcp>(7), B<unix>(7)"
2642 msgid ""
2643 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2644 "B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2645 msgstr ""
2646 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2647 "B<tcp>(7), B<unix>(7)"
2648
2649 #. type: TH
2650 #: build/C/man3/if_nameindex.3:26
2651 #, no-wrap
2652 msgid "IF_NAMEINDEX"
2653 msgstr "IF_NAMEINDEX"
2654
2655 #. type: TH
2656 #: build/C/man3/if_nameindex.3:26
2657 #, no-wrap
2658 msgid "2012-11-21"
2659 msgstr "2012-11-21"
2660
2661 #. type: Plain text
2662 #: build/C/man3/if_nameindex.3:29
2663 msgid ""
2664 "if_nameindex, if_freenameindex - get network interface names and indexes"
2665 msgstr ""
2666 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2667 "クスを取得する"
2668
2669 #. type: Plain text
2670 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2671 #, no-wrap
2672 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2673 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2674
2675 #. type: Plain text
2676 #: build/C/man3/if_nameindex.3:35
2677 #, no-wrap
2678 msgid ""
2679 "B<struct if_nameindex *if_nameindex(void);>\n"
2680 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2681 msgstr ""
2682 "B<struct if_nameindex *if_nameindex(void);>\n"
2683 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2684
2685 #. type: Plain text
2686 #: build/C/man3/if_nameindex.3:46
2687 msgid ""
2688 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2689 "structures, each containing information about one of the network interfaces "
2690 "on the local system.  The I<if_nameindex> structure contains at least the "
2691 "following entries:"
2692 msgstr ""
2693 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2694 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2695 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2696
2697 #. type: Plain text
2698 #: build/C/man3/if_nameindex.3:51
2699 #, no-wrap
2700 msgid ""
2701 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2702 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2703 msgstr ""
2704 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2705 "    char        *if_name;  /* NULL 終端された名前 (\"eth0\" など) */\n"
2706
2707 #. type: Plain text
2708 #: build/C/man3/if_nameindex.3:65
2709 msgid ""
2710 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2711 "points to the null-terminated interface name.  The end of the array is "
2712 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2713 msgstr ""
2714 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2715 "フィールドは NULL 終端されたインターフェース名を指す。 配列の最後は、 "
2716 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2717
2718 #. type: Plain text
2719 #: build/C/man3/if_nameindex.3:71
2720 msgid ""
2721 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2722 "and should be freed using B<if_freenameindex>()  when no longer needed."
2723 msgstr ""
2724 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2725 "は B<if_freenameindex>() で解放すべきである。"
2726
2727 #. type: Plain text
2728 #: build/C/man3/if_nameindex.3:78
2729 #, fuzzy
2730 #| msgid ""
2731 #| "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2732 #| "NULL pointer is returned, and I<errno> is set appropriately."
2733 msgid ""
2734 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2735 "is returned, and I<errno> is set appropriately."
2736 msgstr ""
2737 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2738 "NULL ポインタが返され、 I<errno> が適切に設定される。"
2739
2740 #. type: Plain text
2741 #: build/C/man3/if_nameindex.3:83
2742 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2743 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2744
2745 #. type: Plain text
2746 #: build/C/man3/if_nameindex.3:86
2747 msgid "Insufficient resources available."
2748 msgstr "利用可能なリソースが十分にない。"
2749
2750 #. type: Plain text
2751 #: build/C/man3/if_nameindex.3:97
2752 msgid ""
2753 "B<if_nameindex>()  may also fail for any of the errors specified for "
2754 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2755 "B<sendto>(2), or B<malloc>(3)."
2756 msgstr ""
2757 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>"
2758 "(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定されているエラーの"
2759 "いずれかで失敗する場合がある。"
2760
2761 #. type: Plain text
2762 #: build/C/man3/if_nameindex.3:104
2763 msgid ""
2764 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2765 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2766 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2767 "available only on kernels that support netlink."
2768 msgstr ""
2769 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2770 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2771 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2772 "netlink をサポートするカーネルにおいてのみである。"
2773
2774 #. type: Plain text
2775 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2776 msgid "RFC\\ 3493, POSIX.1-2001."
2777 msgstr "RFC\\ 3493, POSIX.1-2001."
2778
2779 #. type: Plain text
2780 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2781 msgid "This function first appeared in BSDi."
2782 msgstr "この関数は BSDi 初めて登場した。"
2783
2784 #. type: Plain text
2785 #: build/C/man3/if_nameindex.3:112
2786 msgid ""
2787 "The program below demonstrates the use of the functions described on this "
2788 "page.  An example of the output this program might produce is the following:"
2789 msgstr ""
2790 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2791 "ムが生成する出力は以下のようになる。"
2792
2793 #. type: Plain text
2794 #: build/C/man3/if_nameindex.3:119
2795 #, no-wrap
2796 msgid ""
2797 "$ B<./a.out>I<\n"
2798 "1: lo\n"
2799 "2: wlan0\n"
2800 "3: em1>\n"
2801 msgstr ""
2802 "$ B<./a.out>I<\n"
2803 "1: lo\n"
2804 "2: wlan0\n"
2805 "3: em1>\n"
2806
2807 #. type: Plain text
2808 #: build/C/man3/if_nameindex.3:127
2809 #, no-wrap
2810 msgid ""
2811 "#include E<lt>net/if.hE<gt>\n"
2812 "#include E<lt>stdio.hE<gt>\n"
2813 "#include E<lt>stdlib.hE<gt>\n"
2814 "#include E<lt>unistd.hE<gt>\n"
2815 msgstr ""
2816 "#include E<lt>net/if.hE<gt>\n"
2817 "#include E<lt>stdio.hE<gt>\n"
2818 "#include E<lt>stdlib.hE<gt>\n"
2819 "#include E<lt>unistd.hE<gt>\n"
2820
2821 #. type: Plain text
2822 #: build/C/man3/if_nameindex.3:132
2823 #, no-wrap
2824 msgid ""
2825 "int\n"
2826 "main(int argc, char *argv[])\n"
2827 "{\n"
2828 "    struct if_nameindex *if_ni, *i;\n"
2829 msgstr ""
2830 "int\n"
2831 "main(int argc, char *argv[])\n"
2832 "{\n"
2833 "    struct if_nameindex *if_ni, *i;\n"
2834
2835 #. type: Plain text
2836 #: build/C/man3/if_nameindex.3:138
2837 #, no-wrap
2838 msgid ""
2839 "    if_ni = if_nameindex();\n"
2840 "    if (if_ni == NULL) {\n"
2841 "        perror(\"if_nameindex\");\n"
2842 "        exit(EXIT_FAILURE);\n"
2843 "    }\n"
2844 msgstr ""
2845 "    if_ni = if_nameindex();\n"
2846 "    if (if_ni == NULL) {\n"
2847 "        perror(\"if_nameindex\");\n"
2848 "        exit(EXIT_FAILURE);\n"
2849 "    }\n"
2850
2851 #. type: Plain text
2852 #: build/C/man3/if_nameindex.3:141
2853 #, no-wrap
2854 msgid ""
2855 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2856 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2857 msgstr ""
2858 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2859 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2860
2861 #. type: Plain text
2862 #: build/C/man3/if_nameindex.3:143
2863 #, no-wrap
2864 msgid "    if_freenameindex(if_ni);\n"
2865 msgstr "    if_freenameindex(if_ni);\n"
2866
2867 #. type: Plain text
2868 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:584
2869 #, no-wrap
2870 msgid ""
2871 "    exit(EXIT_SUCCESS);\n"
2872 "}\n"
2873 msgstr ""
2874 "    exit(EXIT_SUCCESS);\n"
2875 "}\n"
2876
2877 #. type: Plain text
2878 #: build/C/man3/if_nameindex.3:154
2879 msgid ""
2880 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2881 "B<if_nametoindex>(3), B<ifconfig>(8)"
2882 msgstr ""
2883 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2884 "B<if_nametoindex>(3), B<ifconfig>(8)"
2885
2886 #. type: TH
2887 #: build/C/man3/if_nametoindex.3:25
2888 #, no-wrap
2889 msgid "IF_NAMETOINDEX"
2890 msgstr "IF_NAMETOINDEX"
2891
2892 #. type: TH
2893 #: build/C/man3/if_nametoindex.3:25
2894 #, no-wrap
2895 msgid "2012-12-14"
2896 msgstr "2012-12-14"
2897
2898 #. type: Plain text
2899 #: build/C/man3/if_nametoindex.3:29
2900 msgid ""
2901 "if_nametoindex, if_indextoname - mappings between network interface names "
2902 "and indexes"
2903 msgstr ""
2904 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2905 "クスのマッピングを行う"
2906
2907 #. type: Plain text
2908 #: build/C/man3/if_nametoindex.3:34
2909 #, no-wrap
2910 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2911 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2912
2913 #. type: Plain text
2914 #: build/C/man3/if_nametoindex.3:36
2915 #, no-wrap
2916 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2917 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2918
2919 #. type: Plain text
2920 #: build/C/man3/if_nametoindex.3:43
2921 msgid ""
2922 "The B<if_nametoindex>()  function returns the index of the network interface "
2923 "corresponding to the name I<ifname>."
2924 msgstr ""
2925 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2926 "のインデックスを返す。"
2927
2928 #. type: Plain text
2929 #: build/C/man3/if_nametoindex.3:54
2930 msgid ""
2931 "The B<if_indextoname>()  function returns the name of the network interface "
2932 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2933 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2934 "least B<IF_NAMESIZE> bytes."
2935 msgstr ""
2936 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2937 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2938 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2939 "る。"
2940
2941 #. type: Plain text
2942 #: build/C/man3/if_nametoindex.3:61
2943 msgid ""
2944 "On success, B<if_nametoindex>()  returns the index number of the network "
2945 "interface; on error, 0 is returned and I<errno> is set appropriately."
2946 msgstr ""
2947 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2948 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2949
2950 #. type: Plain text
2951 #: build/C/man3/if_nametoindex.3:69
2952 msgid ""
2953 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2954 "returned and I<errno> is set appropriately."
2955 msgstr ""
2956 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2957 "が返され、 I<errno> が適切に設定される。"
2958
2959 #. type: Plain text
2960 #: build/C/man3/if_nametoindex.3:74
2961 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2962 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2963
2964 #. type: TP
2965 #: build/C/man3/if_nametoindex.3:74
2966 #, no-wrap
2967 msgid "B<ENXIO>"
2968 msgstr "B<ENXIO>"
2969
2970 #. type: Plain text
2971 #: build/C/man3/if_nametoindex.3:77
2972 msgid "No interface found for the index."
2973 msgstr "インデックスに対応するインターフェースがない。"
2974
2975 #. type: Plain text
2976 #: build/C/man3/if_nametoindex.3:85
2977 msgid ""
2978 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2979 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2980 msgstr ""
2981 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2982 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2983
2984 #. type: Plain text
2985 #: build/C/man3/if_nametoindex.3:93
2986 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2987 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2988
2989 #. type: TH
2990 #: build/C/man2/listen.2:45
2991 #, no-wrap
2992 msgid "LISTEN"
2993 msgstr "LISTEN"
2994
2995 #. type: TH
2996 #: build/C/man2/listen.2:45
2997 #, no-wrap
2998 msgid "2008-11-20"
2999 msgstr "2008-11-20"
3000
3001 #. type: Plain text
3002 #: build/C/man2/listen.2:48
3003 msgid "listen - listen for connections on a socket"
3004 msgstr "listen - ソケット(socket)上の接続を待つ"
3005
3006 #. type: Plain text
3007 #: build/C/man2/listen.2:55
3008 #, no-wrap
3009 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3010 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3011
3012 #. type: Plain text
3013 #: build/C/man2/listen.2:63
3014 msgid ""
3015 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
3016 "that is, as a socket that will be used to accept incoming connection "
3017 "requests using B<accept>(2)."
3018 msgstr ""
3019 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3020 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
3021 "した接続要求を受け付けるのに使用されるソケットである。"
3022
3023 #. type: Plain text
3024 #: build/C/man2/listen.2:70
3025 msgid ""
3026 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3027 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3028 msgstr ""
3029 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3030 "するファイルディスクリプタである。"
3031
3032 #. type: Plain text
3033 #: build/C/man2/listen.2:82
3034 msgid ""
3035 "The I<backlog> argument defines the maximum length to which the queue of "
3036 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3037 "when the queue is full, the client may receive an error with an indication "
3038 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3039 "the request may be ignored so that a later reattempt at connection succeeds."
3040 msgstr ""
3041 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3042 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3043 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3044 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3045 "い。"
3046
3047 #. type: Plain text
3048 #: build/C/man2/listen.2:91
3049 msgid "Another socket is already listening on the same port."
3050 msgstr "別のソケットが既に同じポートを listen している。"
3051
3052 #. type: Plain text
3053 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
3054 msgid "The argument I<sockfd> is not a socket."
3055 msgstr "引き数 I<sockfd> はソケットではない。"
3056
3057 #. type: Plain text
3058 #: build/C/man2/listen.2:106
3059 msgid "The socket is not of a type that supports the B<listen>()  operation."
3060 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3061
3062 #. type: Plain text
3063 #: build/C/man2/listen.2:111
3064 msgid ""
3065 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3066 "4.2BSD."
3067 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3068
3069 #. type: Plain text
3070 #: build/C/man2/listen.2:113
3071 msgid "To accept connections, the following steps are performed:"
3072 msgstr "接続を受け付けるには、以下の処理が実行される。"
3073
3074 #. type: TP
3075 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
3076 #, no-wrap
3077 msgid "1."
3078 msgstr "1."
3079
3080 #. type: Plain text
3081 #: build/C/man2/listen.2:117
3082 msgid "A socket is created with B<socket>(2)."
3083 msgstr "B<socket>(2)  でソケットを作成する。"
3084
3085 #. type: TP
3086 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
3087 #, no-wrap
3088 msgid "2."
3089 msgstr "2."
3090
3091 #. type: Plain text
3092 #: build/C/man2/listen.2:123
3093 msgid ""
3094 "The socket is bound to a local address using B<bind>(2), so that other "
3095 "sockets may be B<connect>(2)ed to it."
3096 msgstr ""
3097 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3098 "のソケットに B<connect>(2)  できるようにする。"
3099
3100 #. type: TP
3101 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
3102 #, no-wrap
3103 msgid "3."
3104 msgstr "3."
3105
3106 #. type: Plain text
3107 #: build/C/man2/listen.2:127
3108 msgid ""
3109 "A willingness to accept incoming connections and a queue limit for incoming "
3110 "connections are specified with B<listen>()."
3111 msgstr ""
3112 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3113 "定する。"
3114
3115 #. type: TP
3116 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
3117 #, no-wrap
3118 msgid "4."
3119 msgstr "4."
3120
3121 #. type: Plain text
3122 #: build/C/man2/listen.2:130
3123 msgid "Connections are accepted with B<accept>(2)."
3124 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3125
3126 #. type: Plain text
3127 #: build/C/man2/listen.2:153
3128 msgid ""
3129 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3130 "2.2.  Now it specifies the queue length for I<completely> established "
3131 "sockets waiting to be accepted, instead of the number of incomplete "
3132 "connection requests.  The maximum length of the queue for incomplete sockets "
3133 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3134 "are enabled there is no logical maximum length and this setting is ignored.  "
3135 "See B<tcp>(7)  for more information."
3136 msgstr ""
3137 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3138 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3139 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3140 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3141 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3142 "論理的な最大長は存在せず、この設定は無視される。"
3143
3144 #.  The following is now rather historic information (MTK, Jun 05)
3145 #.  Don't rely on this value in portable applications since BSD
3146 #.  (and some BSD-derived systems) limit the backlog to 5.
3147 #. type: Plain text
3148 #: build/C/man2/listen.2:166
3149 msgid ""
3150 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3151 "somaxconn>, then it is silently truncated to that value; the default value "
3152 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3153 "value, B<SOMAXCONN>, with the value 128."
3154 msgstr ""
3155 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3156 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3157 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3158 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3159
3160 #. type: Plain text
3161 #: build/C/man2/listen.2:175
3162 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3163 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3164
3165 #. type: TH
3166 #: build/C/man2/recv.2:41
3167 #, no-wrap
3168 msgid "RECV"
3169 msgstr "RECV"
3170
3171 #. type: TH
3172 #: build/C/man2/recv.2:41
3173 #, fuzzy, no-wrap
3174 #| msgid "2012-11-11"
3175 msgid "2014-02-11"
3176 msgstr "2012-11-11"
3177
3178 #. type: Plain text
3179 #: build/C/man2/recv.2:44
3180 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3181 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3182
3183 #. type: Plain text
3184 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3185 #: build/C/man2/select_tut.2:47
3186 #, no-wrap
3187 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3188 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3189
3190 #. type: Plain text
3191 #: build/C/man2/recv.2:53
3192 #, no-wrap
3193 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3194 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3195
3196 #. type: Plain text
3197 #: build/C/man2/recv.2:56
3198 #, no-wrap
3199 msgid ""
3200 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3201 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3202 msgstr ""
3203 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3204 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3205
3206 #. type: Plain text
3207 #: build/C/man2/recv.2:58
3208 #, no-wrap
3209 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3210 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3211
3212 #. type: Plain text
3213 #: build/C/man2/recv.2:70
3214 #, fuzzy
3215 #| msgid ""
3216 #| "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages "
3217 #| "from a socket, and may be used to receive data on a socket whether or not "
3218 #| "it is connection-oriented."
3219 msgid ""
3220 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3221 "messages from a socket.  They may be used to receive data on both "
3222 "connectionless and connection-oriented sockets.  This page first describes "
3223 "common features of all three system calls, and then describes the "
3224 "differences between the calls."
3225 msgstr ""
3226 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3227 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3228 "接続指向 (connection-oriened) であってもなくてもよい。"
3229
3230 #. type: Plain text
3231 #: build/C/man2/recv.2:76
3232 #, fuzzy
3233 #| msgid ""
3234 #| "All three routines return the length of the message on successful "
3235 #| "completion.  If a message is too long to fit in the supplied buffer, "
3236 #| "excess bytes may be discarded depending on the type of socket the message "
3237 #| "is received from."
3238 msgid ""
3239 "All three calls return the length of the message on successful completion.  "
3240 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3241 "discarded depending on the type of socket the message is received from."
3242 msgstr ""
3243 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3244 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3245 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3246
3247 #. type: Plain text
3248 #: build/C/man2/recv.2:86
3249 msgid ""
3250 "If no messages are available at the socket, the receive calls wait for a "
3251 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3252 "which case the value -1 is returned and the external variable I<errno> is "
3253 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3254 "data available, up to the requested amount, rather than waiting for receipt "
3255 "of the full amount requested."
3256 msgstr ""
3257 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3258 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3259 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3260 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3261 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3262 "る (受信されるデータの最大サイズは要求したサイズである)。"
3263
3264 #. type: Plain text
3265 #: build/C/man2/recv.2:93
3266 #, fuzzy
3267 #| msgid ""
3268 #| "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3269 #| "data arrives."
3270 msgid ""
3271 "An application can used B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3272 "determine when more data arrives on a socket."
3273 msgstr ""
3274 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3275 "る。"
3276
3277 #. type: SS
3278 #: build/C/man2/recv.2:93
3279 #, no-wrap
3280 msgid "The flags argument"
3281 msgstr ""
3282
3283 #. type: Plain text
3284 #: build/C/man2/recv.2:97
3285 #, fuzzy
3286 #| msgid ""
3287 #| "The I<flags> argument to a B<recv>()  call is formed by ORing one or more "
3288 #| "of the following values:"
3289 msgid ""
3290 "The I<flags> argument is formed by ORing one or more of the following values:"
3291 msgstr ""
3292 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3293 "和 を取ったものを指定する:"
3294
3295 #. type: TP
3296 #: build/C/man2/recv.2:97
3297 #, no-wrap
3298 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3299 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3300
3301 #. type: Plain text
3302 #: build/C/man2/recv.2:108
3303 msgid ""
3304 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3305 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3306 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3307 "flag of B<open>(2)."
3308 msgstr ""
3309 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3310 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3311 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3312 "同じ理由で有用である。"
3313
3314 #. type: TP
3315 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3316 #, no-wrap
3317 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3318 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3319
3320 #. type: Plain text
3321 #: build/C/man2/recv.2:118
3322 msgid ""
3323 "Enables nonblocking operation; if the operation would block, the call fails "
3324 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3325 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3326 msgstr ""
3327 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3328 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3329 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3330
3331 #. type: TP
3332 #: build/C/man2/recv.2:118
3333 #, no-wrap
3334 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3335 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3336
3337 #. type: Plain text
3338 #: build/C/man2/recv.2:137
3339 msgid ""
3340 "This flag specifies that queued errors should be received from the socket "
3341 "error queue.  The error is passed in an ancillary message with a type "
3342 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3343 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3344 "information.  The payload of the original packet that caused the error is "
3345 "passed as normal data via I<msg_iovec>.  The original destination address of "
3346 "the datagram that caused the error is supplied via I<msg_name>."
3347 msgstr ""
3348 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3349 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3350 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3351 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3352 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3353 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3354 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3355 "I<msg_name> 経由で参照できる。"
3356
3357 #. type: Plain text
3358 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3359 msgid ""
3360 "For local errors, no address is passed (this can be checked with the "
3361 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3362 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3363 "the pending socket error is regenerated based on the next queued error and "
3364 "will be passed on the next socket operation."
3365 msgstr ""
3366 "ローカルなエラーの場合はアドレスは渡されない\n"
3367 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3368 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3369 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3370 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3371
3372 #. type: Plain text
3373 #: build/C/man2/recv.2:153
3374 msgid "The error is supplied in a I<sock_extended_err> structure:"
3375 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3376
3377 #. type: Plain text
3378 #: build/C/man2/recv.2:160
3379 #, no-wrap
3380 msgid ""
3381 "#define SO_EE_ORIGIN_NONE    0\n"
3382 "#define SO_EE_ORIGIN_LOCAL   1\n"
3383 "#define SO_EE_ORIGIN_ICMP    2\n"
3384 "#define SO_EE_ORIGIN_ICMP6   3\n"
3385 msgstr ""
3386 "#define SO_EE_ORIGIN_NONE    0\n"
3387 "#define SO_EE_ORIGIN_LOCAL   1\n"
3388 "#define SO_EE_ORIGIN_ICMP    2\n"
3389 "#define SO_EE_ORIGIN_ICMP6   3\n"
3390
3391 #. type: Plain text
3392 #: build/C/man2/recv.2:172
3393 #, no-wrap
3394 msgid ""
3395 "struct sock_extended_err\n"
3396 "{\n"
3397 "    uint32_t ee_errno;   /* error number */\n"
3398 "    uint8_t  ee_origin;  /* where the error originated */\n"
3399 "    uint8_t  ee_type;    /* type */\n"
3400 "    uint8_t  ee_code;    /* code */\n"
3401 "    uint8_t  ee_pad;     /* padding */\n"
3402 "    uint32_t ee_info;    /* additional information */\n"
3403 "    uint32_t ee_data;    /* other data */\n"
3404 "    /* More data may follow */\n"
3405 "};\n"
3406 msgstr ""
3407 "struct sock_extended_err\n"
3408 "{\n"
3409 "    uint32_t ee_errno;   /* error number */\n"
3410 "    uint8_t  ee_origin;  /* where the error originated */\n"
3411 "    uint8_t  ee_type;    /* type */\n"
3412 "    uint8_t  ee_code;    /* code */\n"
3413 "    uint8_t  ee_pad;     /* padding */\n"
3414 "    uint32_t ee_info;    /* additional information */\n"
3415 "    uint32_t ee_data;    /* other data */\n"
3416 "    /* More data may follow */\n"
3417 "};\n"
3418
3419 #. type: Plain text
3420 #: build/C/man2/recv.2:174
3421 #, no-wrap
3422 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3423 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3424
3425 #. type: Plain text
3426 #: build/C/man2/recv.2:198
3427 msgid ""
3428 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3429 "is the origin code of where the error originated.  The other fields are "
3430 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3431 "address of the network object where the error originated from given a "
3432 "pointer to the ancillary message.  If this address is not known, the "
3433 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3434 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3435 "caused the error is passed as normal data."
3436 msgstr ""
3437 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3438 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3439 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3440 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3441 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3442 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3443 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3444 "される。"
3445
3446 #. type: TP
3447 #: build/C/man2/recv.2:212 build/C/man2/recv.2:393 build/C/man2/send.2:230
3448 #, no-wrap
3449 msgid "B<MSG_OOB>"
3450 msgstr "B<MSG_OOB>"
3451
3452 #. type: Plain text
3453 #: build/C/man2/recv.2:219
3454 msgid ""
3455 "This flag requests receipt of out-of-band data that would not be received in "
3456 "the normal data stream.  Some protocols place expedited data at the head of "
3457 "the normal data queue, and thus this flag cannot be used with such protocols."
3458 msgstr ""
3459 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3460 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3461 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3462 "い。"
3463
3464 #. type: TP
3465 #: build/C/man2/recv.2:219
3466 #, no-wrap
3467 msgid "B<MSG_PEEK>"
3468 msgstr "B<MSG_PEEK>"
3469
3470 #. type: Plain text
3471 #: build/C/man2/recv.2:226
3472 msgid ""
3473 "This flag causes the receive operation to return data from the beginning of "
3474 "the receive queue without removing that data from the queue.  Thus, a "
3475 "subsequent receive call will return the same data."
3476 msgstr ""
3477 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3478 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3479 "が返ることになる。"
3480
3481 #. type: TP
3482 #: build/C/man2/recv.2:226
3483 #, no-wrap
3484 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3485 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3486
3487 #. type: Plain text
3488 #: build/C/man2/recv.2:234
3489 #, fuzzy
3490 #| msgid ""
3491 #| "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3492 #| "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3493 #| "return the real length of the packet or datagram, even when it was longer "
3494 #| "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3495 #| "sockets."
3496 msgid ""
3497 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3498 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3499 "return the real length of the packet or datagram, even when it was longer "
3500 "than the passed buffer."
3501 msgstr ""
3502 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3503 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3504 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3505 "場合にも、 パケットやデータグラムの実際の長さを返す。 UNIX ドメインソケット "
3506 "(B<unix>(7))  ソケットについては実装されていない。"
3507
3508 #. type: Plain text
3509 #: build/C/man2/recv.2:237
3510 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3511 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3512
3513 #. type: TP
3514 #: build/C/man2/recv.2:237
3515 #, no-wrap
3516 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3517 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3518
3519 #. type: Plain text
3520 #: build/C/man2/recv.2:245
3521 msgid ""
3522 "This flag requests that the operation block until the full request is "
3523 "satisfied.  However, the call may still return less data than requested if a "
3524 "signal is caught, an error or disconnect occurs, or the next data to be "
3525 "received is of a different type than that returned."
3526 msgstr ""
3527 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3528 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3529 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3530 "りデータが少なくても返ることがある。"
3531
3532 #. type: SS
3533 #: build/C/man2/recv.2:245
3534 #, no-wrap
3535 msgid "recvfrom()"
3536 msgstr ""
3537
3538 #. type: Plain text
3539 #: build/C/man2/recv.2:251
3540 msgid ""
3541 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3542 "caller must specify the size of the buffer in I<len>."
3543 msgstr ""
3544
3545 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3546 #.  .I src_addr
3547 #.  is filled in.
3548 #.  .I src_addr
3549 #.  is also filled in for stream sockets in the UNIX domain, but is not
3550 #.  filled in for stream sockets in the Internet domain.)
3551 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3552 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3553 #. type: Plain text
3554 #: build/C/man2/recv.2:279
3555 #, fuzzy
3556 #| msgid ""
3557 #| "If I<src_addr> is not NULL, and the underlying protocol provides the "
3558 #| "source address, this source address is filled in.  When I<src_addr> is "
3559 #| "NULL, nothing is filled in; in this case, I<addrlen> is not used, and "
3560 #| "should also be NULL.  The argument I<addrlen> is a value-result argument, "
3561 #| "which the caller should initialize before the call to the size of the "
3562 #| "buffer associated with I<src_addr>, and modified on return to indicate "
3563 #| "the actual size of the source address.  The returned address is truncated "
3564 #| "if the buffer provided is too small; in this case, I<addrlen> will return "
3565 #| "a value greater than was supplied to the call."
3566 msgid ""
3567 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3568 "address of the message, that source address is placed in the buffer pointed "
3569 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3570 "Before the call, it should be initialized to the size of the buffer "
3571 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3572 "the actual size of the source address.  The returned address is truncated if "
3573 "the buffer provided is too small; in this case, I<addrlen> will return a "
3574 "value greater than was supplied to the call."
3575 msgstr ""
3576 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3577 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3578 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3579 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3580 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3581 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3582 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3583 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3584 "な値が返される。"
3585
3586 #. type: Plain text
3587 #: build/C/man2/recv.2:286
3588 msgid ""
3589 "If the caller is not interested in the source address, I<src_addr> should be "
3590 "specified as NULL and I<addrlen> should be specified as 0."
3591 msgstr ""
3592
3593 #. type: SS
3594 #: build/C/man2/recv.2:286
3595 #, no-wrap
3596 msgid "recv()"
3597 msgstr ""
3598
3599 #. type: Plain text
3600 #: build/C/man2/recv.2:294
3601 #, fuzzy
3602 #| msgid ""
3603 #| "The B<recv>()  call is normally used only on a I<connected> socket (see "
3604 #| "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL "
3605 #| "I<src_addr> argument."
3606 msgid ""
3607 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3608 "B<connect>(2)).  It is equivalent to the call:"
3609 msgstr ""
3610 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3611 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3612 "()  と等価である。"
3613
3614 #. type: Plain text
3615 #: build/C/man2/recv.2:297
3616 #, fuzzy, no-wrap
3617 #| msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
3618 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3619 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
3620
3621 #. type: SS
3622 #: build/C/man2/recv.2:297
3623 #, no-wrap
3624 msgid "recvmsg()"
3625 msgstr ""
3626
3627 #. type: Plain text
3628 #: build/C/man2/recv.2:305
3629 msgid ""
3630 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3631 "directly supplied arguments.  This structure is defined as follows in "
3632 "I<E<lt>sys/socket.hE<gt>>:"
3633 msgstr ""
3634 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3635 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3636
3637 #. type: Plain text
3638 #: build/C/man2/recv.2:312
3639 #, no-wrap
3640 msgid ""
3641 "struct iovec {                    /* Scatter/gather array items */\n"
3642 "    void  *iov_base;              /* Starting address */\n"
3643 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3644 "};\n"
3645 msgstr ""
3646 "struct iovec {                    /* Scatter/gather array items */\n"
3647 "    void  *iov_base;              /* Starting address */\n"
3648 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3649 "};\n"
3650
3651 #. type: Plain text
3652 #: build/C/man2/recv.2:322 build/C/man2/send.2:258
3653 #, no-wrap
3654 msgid ""
3655 "struct msghdr {\n"
3656 "    void         *msg_name;       /* optional address */\n"
3657 "    socklen_t     msg_namelen;    /* size of address */\n"
3658 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3659 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3660 "    void         *msg_control;    /* ancillary data, see below */\n"
3661 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3662 "    int           msg_flags;      /* flags on received message */\n"
3663 "};\n"
3664 msgstr ""
3665 "struct msghdr {\n"
3666 "    void         *msg_name;       /* 追加のアドレス */\n"
3667 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3668 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3669 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3670 "    void         *msg_control;    /* 補助データ (後述) */\n"
3671 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3672 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3673 "};\n"
3674
3675 #. type: Plain text
3676 #: build/C/man2/recv.2:352
3677 #, fuzzy
3678 #| msgid ""
3679 #| "Here I<msg_name> and I<msg_namelen> specify the source address if the "
3680 #| "socket is unconnected; I<msg_name> may be given as a NULL pointer if no "
3681 #| "names are desired or required.  The fields I<msg_iov> and I<msg_iovlen> "
3682 #| "describe scatter-gather locations, as discussed in B<readv>(2).  The "
3683 #| "field I<msg_control>, which has length I<msg_controllen>, points to a "
3684 #| "buffer for other protocol control-related messages or miscellaneous "
3685 #| "ancillary data.  When B<recvmsg>()  is called, I<msg_controllen> should "
3686 #| "contain the length of the available buffer in I<msg_control>; upon return "
3687 #| "from a successful call it will contain the length of the control message "
3688 #| "sequence."
3689 msgid ""
3690 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3691 "is unconnected; I<msg_name> may be given as a null pointer if no names are "
3692 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3693 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3694 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3695 "other protocol control-related messages or miscellaneous ancillary data.  "
3696 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3697 "the available buffer in I<msg_control>; upon return from a successful call "
3698 "it will contain the length of the control message sequence."
3699 msgstr ""
3700 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3701 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3702 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3703 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3704 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3705 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3706 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3707 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3708 "さが入っている。"
3709
3710 #. type: Plain text
3711 #: build/C/man2/recv.2:354
3712 msgid "The messages are of the form:"
3713 msgstr "メッセージの形式は以下の通り:"
3714
3715 #. type: Plain text
3716 #: build/C/man2/recv.2:364
3717 #, no-wrap
3718 msgid ""
3719 "struct cmsghdr {\n"
3720 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3721 "    int           cmsg_level;   /* originating protocol */\n"
3722 "    int           cmsg_type;    /* protocol-specific type */\n"
3723 "/* followed by\n"
3724 "    unsigned char cmsg_data[]; */\n"
3725 "};\n"
3726 msgstr ""
3727 "struct cmsghdr {\n"
3728 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3729 "    int           cmsg_level;   /* originating protocol */\n"
3730 "    int           cmsg_type;    /* protocol-specific type */\n"
3731 "/* followed by\n"
3732 "    unsigned char cmsg_data[]; */\n"
3733 "};\n"
3734
3735 #. type: Plain text
3736 #: build/C/man2/recv.2:369
3737 msgid ""
3738 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3739 msgstr ""
3740 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3741
3742 #. type: Plain text
3743 #: build/C/man2/recv.2:372
3744 msgid ""
3745 "As an example, Linux uses this ancillary data mechanism to pass extended "
3746 "errors, IP options, or file descriptors over UNIX domain sockets."
3747 msgstr ""
3748 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3749 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3750 "いる。"
3751
3752 #. type: Plain text
3753 #: build/C/man2/recv.2:380
3754 msgid ""
3755 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3756 "It can contain several flags:"
3757 msgstr ""
3758 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3759 "れる。ここにはいくつかのフラグが入る。"
3760
3761 #. type: TP
3762 #: build/C/man2/recv.2:380
3763 #, no-wrap
3764 msgid "B<MSG_EOR>"
3765 msgstr "B<MSG_EOR>"
3766
3767 #. type: Plain text
3768 #: build/C/man2/recv.2:385
3769 msgid ""
3770 "indicates end-of-record; the data returned completed a record (generally "
3771 "used with sockets of type B<SOCK_SEQPACKET>)."
3772 msgstr ""
3773 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3774 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3775
3776 #. type: TP
3777 #: build/C/man2/recv.2:385
3778 #, no-wrap
3779 msgid "B<MSG_TRUNC>"
3780 msgstr "B<MSG_TRUNC>"
3781
3782 #. type: Plain text
3783 #: build/C/man2/recv.2:389
3784 msgid ""
3785 "indicates that the trailing portion of a datagram was discarded because the "
3786 "datagram was larger than the buffer supplied."
3787 msgstr ""
3788 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3789 "た部分が捨てられたことを示す。"
3790
3791 #. type: TP
3792 #: build/C/man2/recv.2:389
3793 #, no-wrap
3794 msgid "B<MSG_CTRUNC>"
3795 msgstr "B<MSG_CTRUNC>"
3796
3797 #. type: Plain text
3798 #: build/C/man2/recv.2:393
3799 msgid ""
3800 "indicates that some control data were discarded due to lack of space in the "
3801 "buffer for ancillary data."
3802 msgstr ""
3803 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3804 "を示す。"
3805
3806 #. type: Plain text
3807 #: build/C/man2/recv.2:396
3808 msgid ""
3809 "is returned to indicate that expedited or out-of-band data were received."
3810 msgstr "速達データや帯域外データを受信したことを示す。"
3811
3812 #. type: TP
3813 #: build/C/man2/recv.2:396
3814 #, no-wrap
3815 msgid "B<MSG_ERRQUEUE>"
3816 msgstr "B<MSG_ERRQUEUE>"
3817
3818 #. type: Plain text
3819 #: build/C/man2/recv.2:400
3820 msgid ""
3821 "indicates that no data was received but an extended error from the socket "
3822 "error queue."
3823 msgstr ""
3824 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3825 "を示す。"
3826
3827 #. type: Plain text
3828 #: build/C/man2/recv.2:406
3829 #, fuzzy
3830 #| msgid ""
3831 #| "These calls return the number of bytes received, or -1 if an error "
3832 #| "occurred.  In the event of an error, I<errno> is set to indicate the "
3833 #| "error.  The return value will be 0 when the peer has performed an orderly "
3834 #| "shutdown."
3835 msgid ""
3836 "These calls return the number of bytes received, or -1 if an error "
3837 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3838 msgstr ""
3839 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3840 "にエラーを示す値を設定する。  接続先が正しくシャットダウンを実行した場合は、"
3841 "返り値は 0 となる。"
3842
3843 #. type: Plain text
3844 #: build/C/man2/recv.2:409
3845 msgid ""
3846 "When a stream socket peer has performed an orderly shutdown, the return "
3847 "value will be 0 (the traditional \"end-of-file\" return)."
3848 msgstr ""
3849
3850 #. type: Plain text
3851 #: build/C/man2/recv.2:413
3852 msgid ""
3853 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3854 "permit zero-length datagrams.  When such a datagram is received, the return "
3855 "value is 0."
3856 msgstr ""
3857
3858 #. type: Plain text
3859 #: build/C/man2/recv.2:416
3860 msgid ""
3861 "The value 0 may also be returned if the requested number of bytes to receive "
3862 "from a stream socket was 0."
3863 msgstr ""
3864
3865 #. type: Plain text
3866 #: build/C/man2/recv.2:421
3867 msgid ""
3868 "These are some standard errors generated by the socket layer.  Additional "
3869 "errors may be generated and returned from the underlying protocol modules; "
3870 "see their manual pages."
3871 msgstr ""
3872 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3873 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3874 "ること。"
3875
3876 #.  Actually EAGAIN on Linux
3877 #. type: Plain text
3878 #: build/C/man2/recv.2:430
3879 msgid ""
3880 "The socket is marked nonblocking and the receive operation would block, or a "
3881 "receive timeout had been set and the timeout expired before data was "
3882 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3883 "and does not require these constants to have the same value, so a portable "
3884 "application should check for both possibilities."
3885 msgstr ""
3886 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3887 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3888 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3889 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3890 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3891
3892 #. type: Plain text
3893 #: build/C/man2/recv.2:435
3894 msgid "The argument I<sockfd> is an invalid descriptor."
3895 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3896
3897 #. type: Plain text
3898 #: build/C/man2/recv.2:439
3899 msgid ""
3900 "A remote host refused to allow the network connection (typically because it "
3901 "is not running the requested service)."
3902 msgstr ""
3903 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3904 "たサービスが起動されていないなどがある)。"
3905
3906 #. type: Plain text
3907 #: build/C/man2/recv.2:443
3908 msgid ""
3909 "The receive buffer pointer(s) point outside the process's address space."
3910 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3911
3912 #. type: Plain text
3913 #: build/C/man2/recv.2:448
3914 msgid ""
3915 "The receive was interrupted by delivery of a signal before any data were "
3916 "available; see B<signal>(7)."
3917 msgstr ""
3918 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3919
3920 #. type: Plain text
3921 #: build/C/man2/recv.2:452 build/C/man2/send.2:323
3922 msgid "Invalid argument passed."
3923 msgstr "不正な引き数が渡された。"
3924
3925 #. type: Plain text
3926 #: build/C/man2/recv.2:456
3927 msgid "Could not allocate memory for B<recvmsg>()."
3928 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3929
3930 #. type: TP
3931 #: build/C/man2/recv.2:456 build/C/man2/send.2:346
3932 #, no-wrap
3933 msgid "B<ENOTCONN>"
3934 msgstr "B<ENOTCONN>"
3935
3936 #. type: Plain text
3937 #: build/C/man2/recv.2:463
3938 msgid ""
3939 "The socket is associated with a connection-oriented protocol and has not "
3940 "been connected (see B<connect>(2)  and B<accept>(2))."
3941 msgstr ""
3942 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3943 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3944
3945 #. type: Plain text
3946 #: build/C/man2/recv.2:468
3947 msgid "The argument I<sockfd> does not refer to a socket."
3948 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3949
3950 #. type: Plain text
3951 #: build/C/man2/recv.2:471
3952 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3953 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3954
3955 #. type: Plain text
3956 #: build/C/man2/recv.2:478
3957 msgid ""
3958 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3959 "flags."
3960 msgstr ""
3961 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3962 "されている。"
3963
3964 #. type: Plain text
3965 #: build/C/man2/recv.2:494
3966 msgid ""
3967 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3968 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3969 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3970 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3971 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3972 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3973 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3974 msgstr ""
3975 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3976 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3977 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3978 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3979 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3980 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3981 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3982
3983 #.  glibc bug raised 12 Mar 2006
3984 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3985 #.  The problem is an underlying kernel issue: the size of the
3986 #.  __kernel_size_t type used to type this field varies
3987 #.  across architectures, but socklen_t is always 32 bits.
3988 #. type: Plain text
3989 #: build/C/man2/recv.2:508 build/C/man2/send.2:409
3990 msgid ""
3991 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3992 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3993 "I<size_t>."
3994 msgstr ""
3995 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3996 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3997 "ある。"
3998
3999 #. type: Plain text
4000 #: build/C/man2/recv.2:513
4001 msgid ""
4002 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
4003 "can be used to receive multiple datagrams in a single call."
4004 msgstr ""
4005 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
4006 "固有の システムコールに関する情報が書かれている。"
4007
4008 #. type: Plain text
4009 #: build/C/man2/recv.2:518
4010 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
4011 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
4012
4013 #. type: Plain text
4014 #: build/C/man2/recv.2:529
4015 msgid ""
4016 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4017 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4018 msgstr ""
4019 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4020 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4021
4022 #. type: TH
4023 #: build/C/man2/recvmmsg.2:31
4024 #, no-wrap
4025 msgid "RECVMMSG"
4026 msgstr "RECVMMSG"
4027
4028 #. type: TH
4029 #: build/C/man2/recvmmsg.2:31
4030 #, no-wrap
4031 msgid "2012-12-24"
4032 msgstr "2012-12-24"
4033
4034 #. type: Plain text
4035 #: build/C/man2/recvmmsg.2:34
4036 msgid "recvmmsg - receive multiple messages on a socket"
4037 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
4038
4039 #. type: Plain text
4040 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
4041 #, no-wrap
4042 msgid ""
4043 "B<#define _GNU_SOURCE>\n"
4044 "B<#include E<lt>sys/socket.hE<gt>>\n"
4045 msgstr ""
4046 "B<#define _GNU_SOURCE>\n"
4047 "B<#include E<lt>sys/socket.hE<gt>>\n"
4048
4049 #. type: Plain text
4050 #: build/C/man2/recvmmsg.2:41
4051 #, no-wrap
4052 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4053 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4054
4055 #. type: Plain text
4056 #: build/C/man2/recvmmsg.2:43
4057 #, no-wrap
4058 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4059 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4060
4061 #. type: Plain text
4062 #: build/C/man2/recvmmsg.2:55
4063 msgid ""
4064 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
4065 "the caller to receive multiple messages from a socket using a single system "
4066 "call.  (This has performance benefits for some applications.)  A further "
4067 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
4068 "operation."
4069 msgstr ""
4070 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4071 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4072 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4073 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4074
4075 #. type: Plain text
4076 #: build/C/man2/recvmmsg.2:59
4077 msgid ""
4078 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4079 "from."
4080 msgstr ""
4081 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
4082
4083 #. type: Plain text
4084 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4085 msgid ""
4086 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4087 "The size of this array is specified in I<vlen>."
4088 msgstr ""
4089 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4090 "I<vlen> で指定する。"
4091
4092 #. type: Plain text
4093 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4094 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4095 msgstr ""
4096 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4097
4098 #. type: Plain text
4099 #: build/C/man2/recvmmsg.2:80
4100 #, no-wrap
4101 msgid ""
4102 "struct mmsghdr {\n"
4103 "    struct msghdr msg_hdr;  /* Message header */\n"
4104 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4105 "};\n"
4106 msgstr ""
4107 "struct mmsghdr {\n"
4108 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
4109 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
4110 "};\n"
4111
4112 #. type: Plain text
4113 #: build/C/man2/recvmmsg.2:95
4114 msgid ""
4115 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
4116 "(2).  The I<msg_len> field is the number of bytes returned for the message "
4117 "in the entry.  This field has the same value as the return value of a single "
4118 "B<recvmsg>(2)  on the header."
4119 msgstr ""
4120 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4121 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4122 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4123 "る。"
4124
4125 #. type: Plain text
4126 #: build/C/man2/recvmmsg.2:102
4127 msgid ""
4128 "The I<flags> argument contains flags ORed together.  The flags are the same "
4129 "as documented for B<recvmsg>(2), with the following addition:"
4130 msgstr ""
4131 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4132 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4133
4134 #. type: TP
4135 #: build/C/man2/recvmmsg.2:102
4136 #, no-wrap
4137 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4138 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4139
4140 #. type: Plain text
4141 #: build/C/man2/recvmmsg.2:107
4142 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4143 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4144
4145 #. type: Plain text
4146 #: build/C/man2/recvmmsg.2:123
4147 msgid ""
4148 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
4149 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
4150 "operation.  (This interval will be rounded up to the system clock "
4151 "granularity, and kernel scheduling delays mean that the blocking interval "
4152 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
4153 "blocks indefinitely."
4154 msgstr ""
4155 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4156 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (待ち時間は"
4157 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延により少"
4158 "しだけ長くなる可能性がある)。 I<timeout>が I<NULL> の場合、 受信操作は無期限"
4159 "に停止 (block) する。"
4160
4161 #. type: Plain text
4162 #: build/C/man2/recvmmsg.2:134
4163 msgid ""
4164 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4165 "received or until the timeout expires.  A nonblocking call reads as many "
4166 "messages as are available (up to the limit specified by I<vlen>)  and "
4167 "returns immediately."
4168 msgstr ""
4169 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4170 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4171 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4172 "すぐに返る。"
4173
4174 #. type: Plain text
4175 #: build/C/man2/recvmmsg.2:149
4176 msgid ""
4177 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4178 "to contain information about each received message: I<msg_len> contains the "
4179 "size of the received message; the subfields of I<msg_hdr> are updated as "
4180 "described in B<recvmsg>(2).  The return value of the call indicates the "
4181 "number of elements of I<msgvec> that have been updated."
4182 msgstr ""
4183 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4184 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4185 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4186 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4187 "数である。"
4188
4189 #. type: Plain text
4190 #: build/C/man2/recvmmsg.2:157
4191 msgid ""
4192 "On success, B<recvmmsg>()  returns the number of messages received in "
4193 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4194 "error."
4195 msgstr ""
4196 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4197 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4198
4199 #. type: Plain text
4200 #: build/C/man2/recvmmsg.2:161
4201 msgid ""
4202 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4203 msgstr ""
4204 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4205 "がある。"
4206
4207 #. type: Plain text
4208 #: build/C/man2/recvmmsg.2:165
4209 msgid "I<timeout> is invalid."
4210 msgstr "I<timeout> が無効である。"
4211
4212 #. type: Plain text
4213 #: build/C/man2/recvmmsg.2:170
4214 msgid ""
4215 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4216 "was added in version 2.12."
4217 msgstr ""
4218 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4219 "はバージョン 2.12 以降で利用可能である。"
4220
4221 #. type: Plain text
4222 #: build/C/man2/recvmmsg.2:173
4223 msgid "B<recvmmsg>()  is Linux-specific."
4224 msgstr "B<recvmmsg>() は Linux 固有である。"
4225
4226 #. type: Plain text
4227 #: build/C/man2/recvmmsg.2:181
4228 msgid ""
4229 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4230 "socket and stores them in multiple buffers.  The call returns if all buffers "
4231 "are filled or if the timeout specified has expired."
4232 msgstr ""
4233 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4234 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4235 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4236
4237 #. type: Plain text
4238 #: build/C/man2/recvmmsg.2:184
4239 msgid ""
4240 "The following snippet periodically generates UDP datagrams containing a "
4241 "random number:"
4242 msgstr ""
4243 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4244 "る。"
4245
4246 #. type: Plain text
4247 #: build/C/man2/recvmmsg.2:189
4248 #, no-wrap
4249 msgid ""
4250 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4251 "B<sleep 0.25; done>\n"
4252 msgstr ""
4253 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4254 "B<sleep 0.25; done>\n"
4255
4256 #. type: Plain text
4257 #: build/C/man2/recvmmsg.2:194
4258 msgid ""
4259 "These datagrams are read by the example application, which can give the "
4260 "following output:"
4261 msgstr ""
4262 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4263 "が得られる。"
4264
4265 #. type: Plain text
4266 #: build/C/man2/recvmmsg.2:204
4267 #, no-wrap
4268 msgid ""
4269 "$B< ./a.out>\n"
4270 "5 messages received\n"
4271 "1 11782\n"
4272 "2 11345\n"
4273 "3 304\n"
4274 "4 13514\n"
4275 "5 28421\n"
4276 msgstr ""
4277 "$B< ./a.out>\n"
4278 "5 messages received\n"
4279 "1 11782\n"
4280 "2 11345\n"
4281 "3 304\n"
4282 "4 13514\n"
4283 "5 28421\n"
4284
4285 #. type: Plain text
4286 #: build/C/man2/recvmmsg.2:215
4287 #, no-wrap
4288 msgid ""
4289 "#define _GNU_SOURCE\n"
4290 "#include E<lt>netinet/ip.hE<gt>\n"
4291 "#include E<lt>stdio.hE<gt>\n"
4292 "#include E<lt>stdlib.hE<gt>\n"
4293 "#include E<lt>string.hE<gt>\n"
4294 "#include E<lt>sys/socket.hE<gt>\n"
4295 msgstr ""
4296 "#define _GNU_SOURCE\n"
4297 "#include E<lt>netinet/ip.hE<gt>\n"
4298 "#include E<lt>stdio.hE<gt>\n"
4299 "#include E<lt>stdlib.hE<gt>\n"
4300 "#include E<lt>string.hE<gt>\n"
4301 "#include E<lt>sys/socket.hE<gt>\n"
4302
4303 #. type: Plain text
4304 #: build/C/man2/recvmmsg.2:228
4305 #, no-wrap
4306 msgid ""
4307 "int\n"
4308 "main(void)\n"
4309 "{\n"
4310 "#define VLEN 10\n"
4311 "#define BUFSIZE 200\n"
4312 "#define TIMEOUT 1\n"
4313 "    int sockfd, retval, i;\n"
4314 "    struct sockaddr_in sa;\n"
4315 "    struct mmsghdr msgs[VLEN];\n"
4316 "    struct iovec iovecs[VLEN];\n"
4317 "    char bufs[VLEN][BUFSIZE+1];\n"
4318 "    struct timespec timeout;\n"
4319 msgstr ""
4320 "int\n"
4321 "main(void)\n"
4322 "{\n"
4323 "#define VLEN 10\n"
4324 "#define BUFSIZE 200\n"
4325 "#define TIMEOUT 1\n"
4326 "    int sockfd, retval, i;\n"
4327 "    struct sockaddr_in sa;\n"
4328 "    struct mmsghdr msgs[VLEN];\n"
4329 "    struct iovec iovecs[VLEN];\n"
4330 "    char bufs[VLEN][BUFSIZE+1];\n"
4331 "    struct timespec timeout;\n"
4332
4333 #. type: Plain text
4334 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4335 #, no-wrap
4336 msgid ""
4337 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4338 "    if (sockfd == -1) {\n"
4339 "        perror(\"socket()\");\n"
4340 "        exit(EXIT_FAILURE);\n"
4341 "    }\n"
4342 msgstr ""
4343 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4344 "    if (sockfd == -1) {\n"
4345 "        perror(\"socket()\");\n"
4346 "        exit(EXIT_FAILURE);\n"
4347 "    }\n"
4348
4349 #. type: Plain text
4350 #: build/C/man2/recvmmsg.2:242
4351 #, no-wrap
4352 msgid ""
4353 "    sa.sin_family = AF_INET;\n"
4354 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4355 "    sa.sin_port = htons(1234);\n"
4356 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4357 "        perror(\"bind()\");\n"
4358 "        exit(EXIT_FAILURE);\n"
4359 "    }\n"
4360 msgstr ""
4361 "    sa.sin_family = AF_INET;\n"
4362 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4363 "    sa.sin_port = htons(1234);\n"
4364 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4365 "        perror(\"bind()\");\n"
4366 "        exit(EXIT_FAILURE);\n"
4367 "    }\n"
4368
4369 #. type: Plain text
4370 #: build/C/man2/recvmmsg.2:250
4371 #, no-wrap
4372 msgid ""
4373 "    memset(msgs, 0, sizeof(msgs));\n"
4374 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4375 "        iovecs[i].iov_base         = bufs[i];\n"
4376 "        iovecs[i].iov_len          = BUFSIZE;\n"
4377 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4378 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4379 "    }\n"
4380 msgstr ""
4381 "    memset(msgs, 0, sizeof(msgs));\n"
4382 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4383 "        iovecs[i].iov_base         = bufs[i];\n"
4384 "        iovecs[i].iov_len          = BUFSIZE;\n"
4385 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4386 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4387 "    }\n"
4388
4389 #. type: Plain text
4390 #: build/C/man2/recvmmsg.2:253
4391 #, no-wrap
4392 msgid ""
4393 "    timeout.tv_sec = TIMEOUT;\n"
4394 "    timeout.tv_nsec = 0;\n"
4395 msgstr ""
4396 "    timeout.tv_sec = TIMEOUT;\n"
4397 "    timeout.tv_nsec = 0;\n"
4398
4399 #. type: Plain text
4400 #: build/C/man2/recvmmsg.2:259
4401 #, no-wrap
4402 msgid ""
4403 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4404 "    if (retval == -1) {\n"
4405 "        perror(\"recvmmsg()\");\n"
4406 "        exit(EXIT_FAILURE);\n"
4407 "    }\n"
4408 msgstr ""
4409 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4410 "    if (retval == -1) {\n"
4411 "        perror(\"recvmmsg()\");\n"
4412 "        exit(EXIT_FAILURE);\n"
4413 "    }\n"
4414
4415 #. type: Plain text
4416 #: build/C/man2/recvmmsg.2:267
4417 #, no-wrap
4418 msgid ""
4419 "    printf(\"%d messages received\\en\", retval);\n"
4420 "    for (i = 0; i E<lt> retval; i++) {\n"
4421 "        bufs[i][msgs[i].msg_len] = 0;\n"
4422 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4423 "    }\n"
4424 "    exit(EXIT_SUCCESS);\n"
4425 "}\n"
4426 msgstr ""
4427 "    printf(\"%d messages received\\en\", retval);\n"
4428 "    for (i = 0; i E<lt> retval; i++) {\n"
4429 "        bufs[i][msgs[i].msg_len] = 0;\n"
4430 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4431 "    }\n"
4432 "    exit(EXIT_SUCCESS);\n"
4433 "}\n"
4434
4435 #. type: Plain text
4436 #: build/C/man2/recvmmsg.2:275
4437 msgid ""
4438 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4439 "(2), B<socket>(7)"
4440 msgstr ""
4441 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4442 "(2), B<socket>(7)"
4443
4444 #. type: TH
4445 #: build/C/man2/select.2:38
4446 #, no-wrap
4447 msgid "SELECT"
4448 msgstr "SELECT"
4449
4450 #. type: TH
4451 #: build/C/man2/select.2:38
4452 #, fuzzy, no-wrap
4453 #| msgid "2009-01-19"
4454 msgid "2014-01-31"
4455 msgstr "2009-01-19"
4456
4457 #. type: Plain text
4458 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4459 msgid ""
4460 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4461 "multiplexing"
4462 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4463
4464 #. type: Plain text
4465 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4466 #, no-wrap
4467 msgid "/* According to POSIX.1-2001 */\n"
4468 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4469
4470 #. type: Plain text
4471 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4472 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4473 #, no-wrap
4474 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4475 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4476
4477 #. type: Plain text
4478 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4479 #, no-wrap
4480 msgid "/* According to earlier standards */\n"
4481 msgstr "/* 以前の規格に従う場合 */\n"
4482
4483 #. type: Plain text
4484 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4485 #, no-wrap
4486 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4487 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4488
4489 #. type: Plain text
4490 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4491 #, no-wrap
4492 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4493 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4494
4495 #. type: Plain text
4496 #: build/C/man2/select.2:58
4497 #, no-wrap
4498 msgid ""
4499 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4500 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4501 msgstr ""
4502 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4503 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4504
4505 #. type: Plain text
4506 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4507 #, no-wrap
4508 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4509 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4510
4511 #. type: Plain text
4512 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4513 #, no-wrap
4514 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4515 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4516
4517 #. type: Plain text
4518 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4519 #, no-wrap
4520 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4521 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4522
4523 #. type: Plain text
4524 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4525 #, no-wrap
4526 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4527 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4528
4529 #. type: Plain text
4530 #: build/C/man2/select.2:72
4531 #, no-wrap
4532 msgid ""
4533 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4534 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4535 "B<            const sigset_t *>I<sigmask>B<);>\n"
4536 msgstr ""
4537 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4538 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4539 "B<            const sigset_t *>I<sigmask>B<);>\n"
4540
4541 #. type: Plain text
4542 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4543 #: build/C/man3/sockatmark.3:36
4544 msgid ""
4545 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4546 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4547
4548 #. type: Plain text
4549 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4550 msgid ""
4551 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4552 "600"
4553 msgstr ""
4554 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4555 "600"
4556
4557 #. type: Plain text
4558 #: build/C/man2/select.2:92
4559 msgid ""
4560 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4561 "descriptors, waiting until one or more of the file descriptors become \"ready"
4562 "\" for some class of I/O operation (e.g., input possible).  A file "
4563 "descriptor is considered ready if it is possible to perform the "
4564 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4565 msgstr ""
4566 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4567 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4568 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4569 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4570 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4571 "意味する。"
4572
4573 #. type: Plain text
4574 #: build/C/man2/select.2:98
4575 msgid ""
4576 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4577 "these three differences:"
4578 msgstr ""
4579 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4580
4581 #. type: TP
4582 #: build/C/man2/select.2:98
4583 #, no-wrap
4584 msgid "(i)"
4585 msgstr "(i)"
4586
4587 #. type: Plain text
4588 #: build/C/man2/select.2:108
4589 msgid ""
4590 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4591 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4592 "and nanoseconds)."
4593 msgstr ""
4594 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4595 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4596 "timespec> (秒・ナノ秒単位) を用いる。"
4597
4598 #. type: TP
4599 #: build/C/man2/select.2:108
4600 #, no-wrap
4601 msgid "(ii)"
4602 msgstr "(ii)"
4603
4604 #. type: Plain text
4605 #: build/C/man2/select.2:116
4606 msgid ""
4607 "B<select>()  may update the I<timeout> argument to indicate how much time "
4608 "was left.  B<pselect>()  does not change this argument."
4609 msgstr ""
4610 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4611 "B<pselect>()  はこの引き数を変更しない。"
4612
4613 #. type: TP
4614 #: build/C/man2/select.2:116
4615 #, no-wrap
4616 msgid "(iii)"
4617 msgstr "(iii)"
4618
4619 #. type: Plain text
4620 #: build/C/man2/select.2:125
4621 msgid ""
4622 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4623 "with NULL I<sigmask>."
4624 msgstr ""
4625 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4626 "指定した場合の B<pselect>()  と同じである。"
4627
4628 #. type: Plain text
4629 #: build/C/man2/select.2:143
4630 msgid ""
4631 "Three independent sets of file descriptors are watched.  Those listed in "
4632 "I<readfds> will be watched to see if characters become available for reading "
4633 "(more precisely, to see if a read will not block; in particular, a file "
4634 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4635 "watched to see if a write will not block, and those in I<exceptfds> will be "
4636 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4637 "which file descriptors actually changed status.  Each of the three file "
4638 "descriptor sets may be specified as NULL if no file descriptors are to be "
4639 "watched for the corresponding class of events."
4640 msgstr ""
4641 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4642 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4643 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4644 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4645 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4646 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4647 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4648 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4649 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4650 "指定することができる。"
4651
4652 #. type: Plain text
4653 #: build/C/man2/select.2:156
4654 msgid ""
4655 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4656 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4657 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4658 "part of the set; this is useful after B<select>()  returns."
4659 msgstr ""
4660 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4661 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4662 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4663 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4664 "る。"
4665
4666 #. type: Plain text
4667 #: build/C/man2/select.2:159
4668 msgid ""
4669 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4670 "plus 1."
4671 msgstr ""
4672 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4673 "のである。"
4674
4675 #. type: Plain text
4676 #: build/C/man2/select.2:166
4677 msgid ""
4678 "The I<timeout> argument specifies the interval that B<select>()  should "
4679 "block waiting for a file descriptor to become ready.  The call will block "
4680 "until either:"
4681 msgstr ""
4682
4683 #. type: IP
4684 #: build/C/man2/select.2:166 build/C/man2/select.2:168
4685 #: build/C/man2/select.2:170
4686 #, no-wrap
4687 msgid "*"
4688 msgstr ""
4689
4690 #. type: Plain text
4691 #: build/C/man2/select.2:168
4692 msgid "a file descriptor becomes ready;"
4693 msgstr ""
4694
4695 #. type: Plain text
4696 #: build/C/man2/select.2:170
4697 #, fuzzy
4698 #| msgid ""
4699 #| "The system call was interrupted by a signal that was caught; see B<signal>"
4700 #| "(7)."
4701 msgid "the call is interrupted by a signal handler; or"
4702 msgstr ""
4703 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
4704
4705 #. type: Plain text
4706 #: build/C/man2/select.2:172
4707 #, fuzzy
4708 #| msgid "The timeout"
4709 msgid "the timeout expires."
4710 msgstr "タイムアウト"
4711
4712 #. type: Plain text
4713 #: build/C/man2/select.2:189
4714 #, fuzzy
4715 #| msgid ""
4716 #| "The I<timeout> argument specifies the interval that B<select>()  should "
4717 #| "block waiting for a file descriptor to become ready.  This interval will "
4718 #| "be rounded up to the system clock granularity, and kernel scheduling "
4719 #| "delays mean that the blocking interval may overrun by a small amount.  If "
4720 #| "both fields of the I<timeval> structure are zero, then B<select>()  "
4721 #| "returns immediately.  (This is useful for polling.)  If I<timeout> is "
4722 #| "NULL (no timeout), B<select>()  can block indefinitely."
4723 msgid ""
4724 "Note that the I<timeout> interval will be rounded up to the system clock "
4725 "granularity, and kernel scheduling delays mean that the blocking interval "
4726 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4727 "are zero, then B<select>()  returns immediately.  (This is useful for "
4728 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4729 "indefinitely."
4730 msgstr ""
4731 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4732 "B<select>() が停止する停止時間を指定する\n"
4733 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4734 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4735 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4736 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4737 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4738 "期限に停止 (block) する。"
4739
4740 #. type: Plain text
4741 #: build/C/man2/select.2:199
4742 msgid ""
4743 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4744 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4745 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4746 "restores the original signal mask."
4747 msgstr ""
4748 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4749 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4750 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4751 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4752
4753 #. type: Plain text
4754 #: build/C/man2/select.2:205
4755 msgid ""
4756 "Other than the difference in the precision of the I<timeout> argument, the "
4757 "following B<pselect>()  call:"
4758 msgstr ""
4759 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4760
4761 #. type: Plain text
4762 #: build/C/man2/select.2:209
4763 #, no-wrap
4764 msgid ""
4765 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4766 "                    timeout, &sigmask);\n"
4767 msgstr ""
4768 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4769 "                    timeout, &sigmask);\n"
4770
4771 #. type: Plain text
4772 #: build/C/man2/select.2:214
4773 msgid "is equivalent to I<atomically> executing the following calls:"
4774 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4775
4776 #. type: Plain text
4777 #: build/C/man2/select.2:217
4778 #, no-wrap
4779 msgid "    sigset_t origmask;\n"
4780 msgstr "    sigset_t origmask;\n"
4781
4782 #. type: Plain text
4783 #: build/C/man2/select.2:221
4784 #, no-wrap
4785 msgid ""
4786 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4787 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4788 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4789 msgstr ""
4790 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4791 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4792 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4793
4794 #. type: Plain text
4795 #: build/C/man2/select.2:242
4796 msgid ""
4797 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4798 "either a signal or for a file descriptor to become ready, then an atomic "
4799 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4800 "a global flag and returns.  Then a test of this global flag followed by a "
4801 "call of B<select>()  could hang indefinitely if the signal arrived just "
4802 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4803 "one to first block signals, handle the signals that have come in, then call "
4804 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4805 msgstr ""
4806 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4807 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4808 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4809 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4810 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4811 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4812 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4813 "で、前記の競合を避けることができる。)"
4814
4815 #. type: SS
4816 #: build/C/man2/select.2:242
4817 #, no-wrap
4818 msgid "The timeout"
4819 msgstr "タイムアウト"
4820
4821 #. type: Plain text
4822 #: build/C/man2/select.2:246
4823 msgid ""
4824 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4825 "like"
4826 msgstr ""
4827 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4828
4829 #. type: Plain text
4830 #: build/C/man2/select.2:253
4831 #, no-wrap
4832 msgid ""
4833 "struct timeval {\n"
4834 "    long    tv_sec;         /* seconds */\n"
4835 "    long    tv_usec;        /* microseconds */\n"
4836 "};\n"
4837 msgstr ""
4838 "struct timeval {\n"
4839 "    long    tv_sec;         /* 秒 */\n"
4840 "    long    tv_usec;        /* マイクロ秒 */\n"
4841 "};\n"
4842
4843 #. type: Plain text
4844 #: build/C/man2/select.2:257
4845 msgid "and"
4846 msgstr "や"
4847
4848 #. type: Plain text
4849 #: build/C/man2/select.2:264
4850 #, no-wrap
4851 msgid ""
4852 "struct timespec {\n"
4853 "    long    tv_sec;         /* seconds */\n"
4854 "    long    tv_nsec;        /* nanoseconds */\n"
4855 "};\n"
4856 msgstr ""
4857 "struct timespec {\n"
4858 "    long    tv_sec;         /* 秒 */\n"
4859 "    long    tv_nsec;        /* ナノ秒 */\n"
4860 "};\n"
4861
4862 #. type: Plain text
4863 #: build/C/man2/select.2:268
4864 msgid "(However, see below on the POSIX.1-2001 versions.)"
4865 msgstr ""
4866 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4867 "照)"
4868
4869 #. type: Plain text
4870 #: build/C/man2/select.2:276
4871 msgid ""
4872 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4873 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4874 "precision."
4875 msgstr ""
4876 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4877 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4878 "呼び出すという方法を使っているコードもある。"
4879
4880 #.  .PP - it is rumored that:
4881 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4882 #.  - it is certainly true that:
4883 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4884 #. type: Plain text
4885 #: build/C/man2/select.2:299
4886 msgid ""
4887 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4888 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4889 "either behavior.)  This causes problems both when Linux code which reads "
4890 "I<timeout> is ported to other operating systems, and when code is ported to "
4891 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4892 "without reinitializing it.  Consider I<timeout> to be undefined after "
4893 "B<select>()  returns."
4894 msgstr ""
4895 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4896 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4897 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4898 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4899 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4900 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4901 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4902 "ある。"
4903
4904 #. type: Plain text
4905 #: build/C/man2/select.2:317
4906 #, fuzzy
4907 #| msgid ""
4908 #| "On success, B<select>()  and B<pselect>()  return the number of file "
4909 #| "descriptors contained in the three returned descriptor sets (that is, the "
4910 #| "total number of bits that are set in I<readfds>, I<writefds>, "
4911 #| "I<exceptfds>)  which may be zero if the timeout expires before anything "
4912 #| "interesting happens.  On error, -1 is returned, and I<errno> is set "
4913 #| "appropriately; the sets and I<timeout> become undefined, so do not rely "
4914 #| "on their contents after an error."
4915 msgid ""
4916 "On success, B<select>()  and B<pselect>()  return the number of file "
4917 "descriptors contained in the three returned descriptor sets (that is, the "
4918 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4919 "which may be zero if the timeout expires before anything interesting "
4920 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4921 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4922 "undefined."
4923 msgstr ""
4924 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4925 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4926 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4927 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4928 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4929 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4930
4931 #. type: Plain text
4932 #: build/C/man2/select.2:323
4933 msgid ""
4934 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4935 "descriptor that was already closed, or one on which an error has occurred.)"
4936 msgstr ""
4937 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4938 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4939 "タが指定された)。"
4940
4941 #. type: Plain text
4942 #: build/C/man2/select.2:327
4943 msgid "A signal was caught; see B<signal>(7)."
4944 msgstr "シグナルを受信した。"
4945
4946 #. type: Plain text
4947 #: build/C/man2/select.2:333
4948 msgid ""
4949 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4950 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4951
4952 #. type: Plain text
4953 #: build/C/man2/select.2:336
4954 msgid "unable to allocate memory for internal tables."
4955 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4956
4957 #. type: Plain text
4958 #: build/C/man2/select.2:342
4959 msgid ""
4960 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4961 "()  was emulated in glibc (but see BUGS)."
4962 msgstr ""
4963 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4964 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4965
4966 #. type: Plain text
4967 #: build/C/man2/select.2:353
4968 msgid ""
4969 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4970 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4971 "clones of the BSD socket layer (including System V variants).  However, note "
4972 "that the System V variant typically sets the timeout variable before exit, "
4973 "but the BSD variant does not."
4974 msgstr ""
4975 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4976 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4977 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4978 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4979 "ること。"
4980
4981 #. type: Plain text
4982 #: build/C/man2/select.2:357
4983 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4984 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4985
4986 #. type: Plain text
4987 #: build/C/man2/select.2:374
4988 msgid ""
4989 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4990 "with a value of I<fd> that is negative or is equal to or larger than "
4991 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4992 "I<fd> to be a valid file descriptor."
4993 msgstr ""
4994 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4995 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4996 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4997 "プタでなければならないと規定されている。"
4998
4999 #. type: Plain text
5000 #: build/C/man2/select.2:383
5001 msgid ""
5002 "Concerning the types involved, the classical situation is that the two "
5003 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
5004 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
5005 "situation is"
5006 msgstr ""
5007 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
5008 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
5009 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
5010
5011 #. type: Plain text
5012 #: build/C/man2/select.2:390
5013 #, no-wrap
5014 msgid ""
5015 "struct timeval {\n"
5016 "    time_t         tv_sec;     /* seconds */\n"
5017 "    suseconds_t    tv_usec;    /* microseconds */\n"
5018 "};\n"
5019 msgstr ""
5020 "struct timeval {\n"
5021 "\t time_t         tv_sec;     /* 秒 */\n"
5022 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
5023 "};\n"
5024
5025 #. type: Plain text
5026 #: build/C/man2/select.2:401
5027 msgid ""
5028 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
5029 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
5030 msgstr ""
5031 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
5032 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
5033
5034 #. type: Plain text
5035 #: build/C/man2/select.2:413
5036 msgid ""
5037 "Concerning prototypes, the classical situation is that one should include "
5038 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
5039 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
5040 msgstr ""
5041 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
5042 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
5043 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
5044 "インクルードすればよい。"
5045
5046 #. type: Plain text
5047 #: build/C/man2/select.2:425
5048 msgid ""
5049 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
5050 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
5051 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
5052 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
5053 "requirements are as shown in the SYNOPSIS."
5054 msgstr ""
5055 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
5056 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
5057 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
5058 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
5059 "使用するには、「書式」に記載された要件を満たす必要がある。"
5060
5061 #. type: SS
5062 #: build/C/man2/select.2:425
5063 #, no-wrap
5064 msgid "Multithreaded applications"
5065 msgstr "マルチスレッド・アプリケーション"
5066
5067 #. type: Plain text
5068 #: build/C/man2/select.2:441
5069 msgid ""
5070 "If a file descriptor being monitored by B<select>()  is closed in another "
5071 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
5072 "unblocks and returns, with an indication that the file descriptor is ready "
5073 "(a subsequent I/O operation will likely fail with an error, unless another "
5074 "the file descriptor reopened between the time B<select>()  returned and the "
5075 "I/O operations was performed).  On Linux (and some other systems), closing "
5076 "the file descriptor in another thread has no effect on B<select>().  In "
5077 "summary, any application that relies on a particular behavior in this "
5078 "scenario must be considered buggy."
5079 msgstr ""
5080 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
5081 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
5082 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
5083 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
5084 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
5085 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
5086 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
5087 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
5088 "ている」と考えなければならない。"
5089
5090 #. type: SS
5091 #: build/C/man2/select.2:441
5092 #, no-wrap
5093 msgid "Linux notes"
5094 msgstr "Linux での注意"
5095
5096 #. type: Plain text
5097 #: build/C/man2/select.2:449
5098 msgid ""
5099 "The B<pselect>()  interface described in this page is implemented by glibc.  "
5100 "The underlying Linux system call is named B<pselect6>().  This system call "
5101 "has somewhat different behavior from the glibc wrapper function."
5102 msgstr ""
5103 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5104 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5105 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5106 "関数とは少し違った動作をする。"
5107
5108 #. type: Plain text
5109 #: build/C/man2/select.2:464
5110 msgid ""
5111 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5112 "However, the glibc wrapper function hides this behavior by using a local "
5113 "variable for the timeout argument that is passed to the system call.  Thus, "
5114 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5115 "this is the behavior required by POSIX.1-2001."
5116 msgstr ""
5117 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5118 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5119 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5120 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5121 "これが POSIX.1-2001 が要求している動作である。"
5122
5123 #. type: Plain text
5124 #: build/C/man2/select.2:470
5125 msgid ""
5126 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5127 "*> pointer, but is instead a structure of the form:"
5128 msgstr ""
5129 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5130 "ポインタではなく、以下に示す構造体である。"
5131
5132 #. type: Plain text
5133 #: build/C/man2/select.2:478
5134 #, no-wrap
5135 msgid ""
5136 "struct {\n"
5137 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5138 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5139 "                               to by 'ss' */\n"
5140 "};\n"
5141 msgstr ""
5142 "struct {\n"
5143 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
5144 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5145 "                               (バイト数) */\n"
5146 "};\n"
5147
5148 #. type: Plain text
5149 #: build/C/man2/select.2:485
5150 msgid ""
5151 "This allows the system call to obtain both a pointer to the signal set and "
5152 "its size, while allowing for the fact that most architectures support a "
5153 "maximum of 6 arguments to a system call."
5154 msgstr ""
5155 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5156 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5157 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5158 "のサイズの両方を取得することができるのである。"
5159
5160 #. type: Plain text
5161 #: build/C/man2/select.2:491
5162 msgid ""
5163 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5164 "argument."
5165 msgstr ""
5166 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5167 "されていた。"
5168
5169 #. type: Plain text
5170 #: build/C/man2/select.2:504
5171 msgid ""
5172 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5173 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5174 "implementation remained vulnerable to the very race condition that B<pselect>"
5175 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
5176 "B<pselect>()  system call on kernels where it is provided."
5177 msgstr ""
5178 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5179 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5180 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5181 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5182 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5183 "が使用される。"
5184
5185 #. type: Plain text
5186 #: build/C/man2/select.2:517
5187 msgid ""
5188 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5189 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5190 "signal handler writes a byte to a pipe whose other end is monitored by "
5191 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5192 "to a pipe that may be full or reading from a pipe that may be empty, "
5193 "nonblocking I/O is used when reading from and writing to the pipe.)"
5194 msgstr ""
5195 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5196 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5197 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5198 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5199 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5200 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5201 "(nonblocking) I/O を使用するとよい)。"
5202
5203 #.  Stevens discusses a case where accept can block after select
5204 #.  returns successfully because of an intervening RST from the client.
5205 #.  Maybe the kernel should have returned EIO in such a situation?
5206 #. type: Plain text
5207 #: build/C/man2/select.2:533
5208 msgid ""
5209 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5210 "reading\", while nevertheless a subsequent read blocks.  This could for "
5211 "example happen when data has arrived but upon examination has wrong checksum "
5212 "and is discarded.  There may be other circumstances in which a file "
5213 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5214 "B<O_NONBLOCK> on sockets that should not block."
5215 msgstr ""
5216 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
5217 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5218 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5219 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5220 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5221 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5222
5223 #. type: Plain text
5224 #: build/C/man2/select.2:548
5225 msgid ""
5226 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5227 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5228 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5229 "behavior, but the glibc wrapper hides this behavior by internally copying "
5230 "the I<timeout> to a local variable and passing that variable to the system "
5231 "call."
5232 msgstr ""
5233 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
5234 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5235 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5236 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5237 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5238 "数をシステムコールに渡している。"
5239
5240 #. type: Plain text
5241 #: build/C/man2/select.2:555
5242 #, no-wrap
5243 msgid ""
5244 "#include E<lt>stdio.hE<gt>\n"
5245 "#include E<lt>stdlib.hE<gt>\n"
5246 "#include E<lt>sys/time.hE<gt>\n"
5247 "#include E<lt>sys/types.hE<gt>\n"
5248 "#include E<lt>unistd.hE<gt>\n"
5249 msgstr ""
5250 "#include E<lt>stdio.hE<gt>\n"
5251 "#include E<lt>stdlib.hE<gt>\n"
5252 "#include E<lt>sys/time.hE<gt>\n"
5253 "#include E<lt>sys/types.hE<gt>\n"
5254 "#include E<lt>unistd.hE<gt>\n"
5255
5256 #. type: Plain text
5257 #: build/C/man2/select.2:562
5258 #, no-wrap
5259 msgid ""
5260 "int\n"
5261 "main(void)\n"
5262 "{\n"
5263 "    fd_set rfds;\n"
5264 "    struct timeval tv;\n"
5265 "    int retval;\n"
5266 msgstr ""
5267 "int\n"
5268 "main(void)\n"
5269 "{\n"
5270 "    fd_set rfds;\n"
5271 "    struct timeval tv;\n"
5272 "    int retval;\n"
5273
5274 #. type: Plain text
5275 #: build/C/man2/select.2:566
5276 #, no-wrap
5277 msgid ""
5278 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5279 "    FD_ZERO(&rfds);\n"
5280 "    FD_SET(0, &rfds);\n"
5281 msgstr ""
5282 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5283 "    FD_ZERO(&rfds);\n"
5284 "    FD_SET(0, &rfds);\n"
5285
5286 #. type: Plain text
5287 #: build/C/man2/select.2:570
5288 #, no-wrap
5289 msgid ""
5290 "    /* Wait up to five seconds. */\n"
5291 "    tv.tv_sec = 5;\n"
5292 "    tv.tv_usec = 0;\n"
5293 msgstr ""
5294 "    /* 5 秒間監視する。*/\n"
5295 "    tv.tv_sec = 5;\n"
5296 "    tv.tv_usec = 0;\n"
5297
5298 #. type: Plain text
5299 #: build/C/man2/select.2:573
5300 #, no-wrap
5301 msgid ""
5302 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5303 "    /* Don't rely on the value of tv now! */\n"
5304 msgstr ""
5305 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5306 "    /* この時点での tv の値を信頼してはならない。*/\n"
5307
5308 #. type: Plain text
5309 #: build/C/man2/select.2:581
5310 #, no-wrap
5311 msgid ""
5312 "    if (retval == -1)\n"
5313 "        perror(\"select()\");\n"
5314 "    else if (retval)\n"
5315 "        printf(\"Data is available now.\\en\");\n"
5316 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5317 "    else\n"
5318 "        printf(\"No data within five seconds.\\en\");\n"
5319 msgstr ""
5320 "    if (retval == -1)\n"
5321 "\tperror(\"select()\");\n"
5322 "    else if (retval)\n"
5323 "        printf(\"今、データが取得できました。\\en\");\n"
5324 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5325 "    else\n"
5326 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5327
5328 #. type: Plain text
5329 #: build/C/man2/select.2:596
5330 msgid ""
5331 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5332 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5333 msgstr ""
5334 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5335 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5336
5337 #. type: Plain text
5338 #: build/C/man2/select.2:599
5339 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5340 msgstr ""
5341 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5342
5343 #. type: TH
5344 #: build/C/man2/select_tut.2:32
5345 #, no-wrap
5346 msgid "SELECT_TUT"
5347 msgstr "SELECT_TUT"
5348
5349 #. type: TH
5350 #: build/C/man2/select_tut.2:32
5351 #, fuzzy, no-wrap
5352 #| msgid "2013-09-04"
5353 msgid "2013-12-30"
5354 msgstr "2013-09-04"
5355
5356 #. type: Plain text
5357 #: build/C/man2/select_tut.2:52
5358 #, no-wrap
5359 msgid ""
5360 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5361 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5362 msgstr ""
5363 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5364 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5365
5366 #. type: Plain text
5367 #: build/C/man2/select_tut.2:66
5368 #, no-wrap
5369 msgid ""
5370 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5371 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5372 "B<            const sigset_t *>I<sigmask>B<);>\n"
5373 msgstr ""
5374 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5375 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5376 "B<            const sigset_t *>I<sigmask>B<);>\n"
5377
5378 #. type: Plain text
5379 #: build/C/man2/select_tut.2:83
5380 msgid ""
5381 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5382 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5383 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5384 "occurred on any of the descriptors."
5385 msgstr ""
5386 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5387 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5388 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5389 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5390 "る。"
5391
5392 #. type: Plain text
5393 #: build/C/man2/select_tut.2:108
5394 msgid ""
5395 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5396 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5397 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5398 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5399 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5400 "according to the rules described below; after calling B<select>()  you can "
5401 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5402 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5403 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5404 "descriptor from a set."
5405 msgstr ""
5406 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5407 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5408 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5409 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5410 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5411 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5412 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5413 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5414 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5415 "のファイルディスクリプタの削除を行う。"
5416
5417 #. type: SS
5418 #: build/C/man2/select_tut.2:108
5419 #, no-wrap
5420 msgid "Arguments"
5421 msgstr "引き数"
5422
5423 #. type: TP
5424 #: build/C/man2/select_tut.2:109
5425 #, no-wrap
5426 msgid "I<readfds>"
5427 msgstr "I<readfds>"
5428
5429 #. type: Plain text
5430 #: build/C/man2/select_tut.2:118
5431 msgid ""
5432 "This set is watched to see if data is available for reading from any of its "
5433 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5434 "cleared of all file descriptors except for those that are immediately "
5435 "available for reading."
5436 msgstr ""
5437 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5438 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5439 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5440
5441 #. type: TP
5442 #: build/C/man2/select_tut.2:118
5443 #, no-wrap
5444 msgid "I<writefds>"
5445 msgstr "I<writefds>"
5446
5447 #. type: Plain text
5448 #: build/C/man2/select_tut.2:127
5449 msgid ""
5450 "This set is watched to see if there is space to write data to any of its "
5451 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5452 "cleared of all file descriptors except for those that are immediately "
5453 "available for writing."
5454 msgstr ""
5455 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5456 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5457 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5458
5459 #. type: TP
5460 #: build/C/man2/select_tut.2:127
5461 #, no-wrap
5462 msgid "I<exceptfds>"
5463 msgstr "I<exceptfds>"
5464
5465 #. type: Plain text
5466 #: build/C/man2/select_tut.2:149
5467 msgid ""
5468 "This set is watched for \"exceptional conditions\".  In practice, only one "
5469 "such exceptional condition is common: the availability of I<out-of-band> "
5470 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5471 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5472 "where B<select>(2)  indicates an exceptional condition occurs with "
5473 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5474 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5475 "for those for which an exceptional condition has occurred."
5476 msgstr ""
5477 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5478 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5479 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5480 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5481 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5482 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5483 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5484 "状態が発生したディスクリプタ以外は集合から削除される。"
5485
5486 #. type: TP
5487 #: build/C/man2/select_tut.2:149
5488 #, no-wrap
5489 msgid "I<nfds>"
5490 msgstr "I<nfds>"
5491
5492 #. type: Plain text
5493 #: build/C/man2/select_tut.2:156
5494 msgid ""
5495 "This is an integer one more than the maximum of any file descriptor in any "
5496 "of the sets.  In other words, while adding file descriptors to each of the "
5497 "sets, you must calculate the maximum integer value of all of them, then "
5498 "increment this value by one, and then pass this as I<nfds>."
5499 msgstr ""
5500 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5501 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5502 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5503 "I<nfds> として渡さないといけない、ということだ。"
5504
5505 #. type: TP
5506 #: build/C/man2/select_tut.2:156
5507 #, no-wrap
5508 msgid "I<utimeout>"
5509 msgstr "I<utimeout>"
5510
5511 #. type: Plain text
5512 #: build/C/man2/select_tut.2:169
5513 msgid ""
5514 "This is the longest time B<select>()  may wait before returning, even if "
5515 "nothing interesting happened.  If this value is passed as NULL, then "
5516 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5517 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5518 "return immediately, with information about the readiness of file descriptors "
5519 "at the time of the call.  The structure I<struct timeval> is defined as:"
5520 msgstr ""
5521 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5522 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5523 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5524 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5525 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5526 "ように定義されている:"
5527
5528 #. type: Plain text
5529 #: build/C/man2/select_tut.2:176
5530 #, no-wrap
5531 msgid ""
5532 "struct timeval {\n"
5533 "    time_t tv_sec;    /* seconds */\n"
5534 "    long tv_usec;     /* microseconds */\n"
5535 "};\n"
5536 msgstr ""
5537 "struct timeval {\n"
5538 "    time_t tv_sec;    /* seconds */\n"
5539 "    long tv_usec;     /* microseconds */\n"
5540 "};\n"
5541
5542 #. type: TP
5543 #: build/C/man2/select_tut.2:178
5544 #, no-wrap
5545 msgid "I<ntimeout>"
5546 msgstr "I<ntimeout>"
5547
5548 #. type: Plain text
5549 #: build/C/man2/select_tut.2:187
5550 msgid ""
5551 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5552 "I<struct timespec> has nanosecond precision as follows:"
5553 msgstr ""
5554 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5555 "timespec> は次に示すようにナノ秒の精度を持つ。"
5556
5557 #. type: Plain text
5558 #: build/C/man2/select_tut.2:194
5559 #, no-wrap
5560 msgid ""
5561 "struct timespec {\n"
5562 "    long tv_sec;    /* seconds */\n"
5563 "    long tv_nsec;   /* nanoseconds */\n"
5564 "};\n"
5565 msgstr ""
5566 "struct timespec {\n"
5567 "    long tv_sec;    /* seconds */\n"
5568 "    long tv_nsec;   /* nanoseconds */\n"
5569 "};\n"
5570
5571 #. type: TP
5572 #: build/C/man2/select_tut.2:196
5573 #, no-wrap
5574 msgid "I<sigmask>"
5575 msgstr "I<sigmask>"
5576
5577 #. type: Plain text
5578 #: build/C/man2/select_tut.2:213
5579 msgid ""
5580 "This argument holds a set of signals that the kernel should unblock (i.e., "
5581 "remove from the signal mask of the calling thread), while the caller is "
5582 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5583 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5584 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5585 "()  will then behave just like B<select>()."
5586 msgstr ""
5587 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5588 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5589 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5590 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5591 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5592 "()  と全く同じ動作となる。"
5593
5594 #. type: SS
5595 #: build/C/man2/select_tut.2:213
5596 #, no-wrap
5597 msgid "Combining signal and data events"
5598 msgstr "シグナルとデータイベントを組み合わせる"
5599
5600 #. type: Plain text
5601 #: build/C/man2/select_tut.2:257
5602 msgid ""
5603 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5604 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5605 "normally use the signal handler only to raise a global flag.  The global "
5606 "flag will indicate that the event must be processed in the main loop of the "
5607 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5608 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5609 "signals can be processed in the main loop of the program, otherwise B<select>"
5610 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5611 "conditional to check the global flag.  So we must ask: what if a signal "
5612 "arrives after the conditional, but before the B<select>()  call? The answer "
5613 "is that B<select>()  would block indefinitely, even though an event is "
5614 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5615 "This call can be used to set the signal mask to a set of signals that are "
5616 "only to be received within the B<pselect>()  call.  For instance, let us say "
5617 "that the event in question was the exit of a child process.  Before the "
5618 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5619 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5620 "mask.  Our program would look like:"
5621 msgstr ""
5622 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5623 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5624 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5625 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5626 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5627 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5628 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5629 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5630 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5631 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5632 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5633 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5634 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5635 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5636 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5637 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5638 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5639 "る。"
5640
5641 #. type: Plain text
5642 #: build/C/man2/select_tut.2:260
5643 #, no-wrap
5644 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5645 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5646
5647 #. type: Plain text
5648 #: build/C/man2/select_tut.2:266
5649 #, no-wrap
5650 msgid ""
5651 "static void\n"
5652 "child_sig_handler(int sig)\n"
5653 "{\n"
5654 "    got_SIGCHLD = 1;\n"
5655 "}\n"
5656 msgstr ""
5657 "static void\n"
5658 "child_sig_handler(int sig)\n"
5659 "{\n"
5660 "    got_SIGCHLD = 1;\n"
5661 "}\n"
5662
5663 #. type: Plain text
5664 #: build/C/man2/select_tut.2:274
5665 #, no-wrap
5666 msgid ""
5667 "int\n"
5668 "main(int argc, char *argv[])\n"
5669 "{\n"
5670 "    sigset_t sigmask, empty_mask;\n"
5671 "    struct sigaction sa;\n"
5672 "    fd_set readfds, writefds, exceptfds;\n"
5673 "    int r;\n"
5674 msgstr ""
5675 "int\n"
5676 "main(int argc, char *argv[])\n"
5677 "{\n"
5678 "    sigset_t sigmask, empty_mask;\n"
5679 "    struct sigaction sa;\n"
5680 "    fd_set readfds, writefds, exceptfds;\n"
5681 "    int r;\n"
5682
5683 #. type: Plain text
5684 #: build/C/man2/select_tut.2:281
5685 #, no-wrap
5686 msgid ""
5687 "    sigemptyset(&sigmask);\n"
5688 "    sigaddset(&sigmask, SIGCHLD);\n"
5689 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5690 "        perror(\"sigprocmask\");\n"
5691 "        exit(EXIT_FAILURE);\n"
5692 "    }\n"
5693 msgstr ""
5694 "    sigemptyset(&sigmask);\n"
5695 "    sigaddset(&sigmask, SIGCHLD);\n"
5696 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5697 "        perror(\"sigprocmask\");\n"
5698 "        exit(EXIT_FAILURE);\n"
5699 "    }\n"
5700
5701 #. type: Plain text
5702 #: build/C/man2/select_tut.2:289
5703 #, no-wrap
5704 msgid ""
5705 "    sa.sa_flags = 0;\n"
5706 "    sa.sa_handler = child_sig_handler;\n"
5707 "    sigemptyset(&sa.sa_mask);\n"
5708 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5709 "        perror(\"sigaction\");\n"
5710 "        exit(EXIT_FAILURE);\n"
5711 "    }\n"
5712 msgstr ""
5713 "    sa.sa_flags = 0;\n"
5714 "    sa.sa_handler = child_sig_handler;\n"
5715 "    sigemptyset(&sa.sa_mask);\n"
5716 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5717 "        perror(\"sigaction\");\n"
5718 "        exit(EXIT_FAILURE);\n"
5719 "    }\n"
5720
5721 #. type: Plain text
5722 #: build/C/man2/select_tut.2:291
5723 #, no-wrap
5724 msgid "    sigemptyset(&empty_mask);\n"
5725 msgstr "    sigemptyset(&empty_mask);\n"
5726
5727 #. type: Plain text
5728 #: build/C/man2/select_tut.2:295
5729 #, no-wrap
5730 msgid ""
5731 "    for (;;) {          /* main loop */\n"
5732 "        /* Initialize readfds, writefds, and exceptfds\n"
5733 "           before the pselect() call. (Code omitted.) */\n"
5734 msgstr ""
5735 "    for (;;) {          /* main loop */\n"
5736 "        /* Initialize readfds, writefds, and exceptfds\n"
5737 "           before the pselect() call. (Code omitted.) */\n"
5738
5739 #. type: Plain text
5740 #: build/C/man2/select_tut.2:301
5741 #, no-wrap
5742 msgid ""
5743 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5744 "                    NULL, &empty_mask);\n"
5745 "        if (r == -1 && errno != EINTR) {\n"
5746 "            /* Handle error */\n"
5747 "        }\n"
5748 msgstr ""
5749 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5750 "                    NULL, &empty_mask);\n"
5751 "        if (r == -1 && errno != EINTR) {\n"
5752 "            /* Handle error */\n"
5753 "        }\n"
5754
5755 #. type: Plain text
5756 #: build/C/man2/select_tut.2:304
5757 #, no-wrap
5758 msgid ""
5759 "        if (got_SIGCHLD) {\n"
5760 "            got_SIGCHLD = 0;\n"
5761 msgstr ""
5762 "        if (got_SIGCHLD) {\n"
5763 "            got_SIGCHLD = 0;\n"
5764
5765 #. type: Plain text
5766 #: build/C/man2/select_tut.2:308
5767 #, no-wrap
5768 msgid ""
5769 "            /* Handle signalled event here; e.g., wait() for all\n"
5770 "               terminated children. (Code omitted.) */\n"
5771 "        }\n"
5772 msgstr ""
5773 "            /* Handle signalled event here; e.g., wait() for all\n"
5774 "               terminated children. (Code omitted.) */\n"
5775 "        }\n"
5776
5777 #. type: Plain text
5778 #: build/C/man2/select_tut.2:312
5779 #, no-wrap
5780 msgid ""
5781 "        /* main body of program */\n"
5782 "    }\n"
5783 "}\n"
5784 msgstr ""
5785 "        /* main body of program */\n"
5786 "    }\n"
5787 "}\n"
5788
5789 #. type: SS
5790 #: build/C/man2/select_tut.2:313
5791 #, no-wrap
5792 msgid "Practical"
5793 msgstr "実例"
5794
5795 #. type: Plain text
5796 #: build/C/man2/select_tut.2:334
5797 msgid ""
5798 "So what is the point of B<select>()? Can't I just read and write to my "
5799 "descriptors whenever I want? The point of B<select>()  is that it watches "
5800 "multiple descriptors at the same time and properly puts the process to sleep "
5801 "if there is no activity.  UNIX programmers often find themselves in a "
5802 "position where they have to handle I/O from more than one file descriptor "
5803 "where the data flow may be intermittent.  If you were to merely create a "
5804 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5805 "your calls may block waiting for data from/to a file descriptor, while "
5806 "another file descriptor is unused though ready for I/O.  B<select>()  "
5807 "efficiently copes with this situation."
5808 msgstr ""
5809 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5810 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5811 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5812 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5813 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5814 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5815 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5816 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5817 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5818
5819 #. type: SS
5820 #: build/C/man2/select_tut.2:334
5821 #, no-wrap
5822 msgid "Select law"
5823 msgstr "SELECT の掟"
5824
5825 #. type: Plain text
5826 #: build/C/man2/select_tut.2:347
5827 msgid ""
5828 "Many people who try to use B<select>()  come across behavior that is "
5829 "difficult to understand and produces nonportable or borderline results.  For "
5830 "instance, the above program is carefully written not to block at any point, "
5831 "even though it does not set its file descriptors to nonblocking mode.  It is "
5832 "easy to introduce subtle errors that will remove the advantage of using "
5833 "B<select>(), so here is a list of essentials to watch for when using "
5834 "B<select>()."
5835 msgstr ""
5836 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5837 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5838 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5839 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5840 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5841 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5842 "ことにする。"
5843
5844 #. type: Plain text
5845 #: build/C/man2/select_tut.2:356
5846 msgid ""
5847 "You should always try to use B<select>()  without a timeout.  Your program "
5848 "should have nothing to do if there is no data available.  Code that depends "
5849 "on timeouts is not usually portable and is difficult to debug."
5850 msgstr ""
5851 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5852 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5853 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5854
5855 #. type: Plain text
5856 #: build/C/man2/select_tut.2:360
5857 msgid ""
5858 "The value I<nfds> must be properly calculated for efficiency as explained "
5859 "above."
5860 msgstr ""
5861 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5862 "えなければならない。"
5863
5864 #. type: Plain text
5865 #: build/C/man2/select_tut.2:367
5866 msgid ""
5867 "No file descriptor must be added to any set if you do not intend to check "
5868 "its result after the B<select>()  call, and respond appropriately.  See next "
5869 "rule."
5870 msgstr ""
5871 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5872 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5873
5874 #. type: Plain text
5875 #: build/C/man2/select_tut.2:373
5876 msgid ""
5877 "After B<select>()  returns, all file descriptors in all sets should be "
5878 "checked to see if they are ready."
5879 msgstr ""
5880 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5881 "て 読み書き可能な状態になっているかをチェックすべきである。"
5882
5883 #. type: TP
5884 #: build/C/man2/select_tut.2:373
5885 #, no-wrap
5886 msgid "5."
5887 msgstr "5."
5888
5889 #. type: Plain text
5890 #: build/C/man2/select_tut.2:388
5891 msgid ""
5892 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5893 "necessarily read/write the full amount of data that you have requested.  If "
5894 "they do read/write the full amount, it's because you have a low traffic load "
5895 "and a fast stream.  This is not always going to be the case.  You should "
5896 "cope with the case of your functions managing to send or receive only a "
5897 "single byte."
5898 msgstr ""
5899 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5900 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5901 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5902 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5903 "うな場合も 考慮に入れてやらなければならない。"
5904
5905 #. type: TP
5906 #: build/C/man2/select_tut.2:388
5907 #, no-wrap
5908 msgid "6."
5909 msgstr "6."
5910
5911 #. type: Plain text
5912 #: build/C/man2/select_tut.2:396
5913 msgid ""
5914 "Never read/write only in single bytes at a time unless you are really sure "
5915 "that you have a small amount of data to process.  It is extremely "
5916 "inefficient not to read/write as much data as you can buffer each time.  The "
5917 "buffers in the example below are 1024 bytes although they could easily be "
5918 "made larger."
5919 msgstr ""
5920 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5921 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5922 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5923 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5924
5925 #. type: TP
5926 #: build/C/man2/select_tut.2:396
5927 #, no-wrap
5928 msgid "7."
5929 msgstr "7."
5930
5931 #.  Nonetheless, you should still cope with these errors for completeness.
5932 #. type: Plain text
5933 #: build/C/man2/select_tut.2:418
5934 msgid ""
5935 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5936 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5937 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5938 "properly managed (not done properly above).  If your program is not going to "
5939 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5940 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5941 msgstr ""
5942 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5943 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5944 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5945 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5946 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5947 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5948
5949 #. type: TP
5950 #: build/C/man2/select_tut.2:418
5951 #, no-wrap
5952 msgid "8."
5953 msgstr "8."
5954
5955 #. type: Plain text
5956 #: build/C/man2/select_tut.2:427
5957 msgid ""
5958 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5959 "length of zero."
5960 msgstr ""
5961 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5962 "(2), B<send>(2)  を呼び出してはならない。"
5963
5964 #. type: TP
5965 #: build/C/man2/select_tut.2:427
5966 #, no-wrap
5967 msgid "9."
5968 msgstr "9."
5969
5970 #. type: Plain text
5971 #: build/C/man2/select_tut.2:443
5972 msgid ""
5973 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5974 "with errors other than those listed in B<7.>, or one of the input functions "
5975 "returns 0, indicating end of file, then you should I<not> pass that "
5976 "descriptor to B<select>()  again.  In the example below, I close the "
5977 "descriptor immediately, and then set it to -1 to prevent it being included "
5978 "in a set."
5979 msgstr ""
5980 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5981 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5982 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5983 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5984 "が集合に含まれ続けるのを許さないようにしている。"
5985
5986 #. type: TP
5987 #: build/C/man2/select_tut.2:443
5988 #, no-wrap
5989 msgid "10."
5990 msgstr "10."
5991
5992 #. type: Plain text
5993 #: build/C/man2/select_tut.2:450
5994 msgid ""
5995 "The timeout value must be initialized with each new call to B<select>(), "
5996 "since some operating systems modify the structure.  B<pselect>()  however "
5997 "does not modify its timeout structure."
5998 msgstr ""
5999 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
6000 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
6001 "分の timeout 構造体を変更することはない。"
6002
6003 #. type: TP
6004 #: build/C/man2/select_tut.2:450
6005 #, no-wrap
6006 msgid "11."
6007 msgstr "11."
6008
6009 #.  "I have heard" does not fill me with confidence, and doesn't
6010 #.  belong in a man page, so I've commented this point out.
6011 #.  .TP
6012 #.  11.
6013 #.  I have heard that the Windows socket layer does not cope with OOB data
6014 #.  properly.
6015 #.  It also does not cope with
6016 #.  .BR select ()
6017 #.  calls when no file descriptors are set at all.
6018 #.  Having no file descriptors set is a useful
6019 #.  way to sleep the process with subsecond precision by using the timeout.
6020 #.  (See further on.)
6021 #. type: Plain text
6022 #: build/C/man2/select_tut.2:469
6023 msgid ""
6024 "Since B<select>()  modifies its file descriptor sets, if the call is being "
6025 "used in a loop, then the sets must be reinitialized before each call."
6026 msgstr ""
6027 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
6028 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
6029 "期化し直さなければならない。"
6030
6031 #. type: SS
6032 #: build/C/man2/select_tut.2:469
6033 #, no-wrap
6034 msgid "Usleep emulation"
6035 msgstr "usleep エミュレーション"
6036
6037 #. type: Plain text
6038 #: build/C/man2/select_tut.2:476
6039 msgid ""
6040 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
6041 "()  with a finite timeout and no file descriptors as follows:"
6042 msgstr ""
6043 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
6044 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
6045 "できる。 以下のようにする。"
6046
6047 #. type: Plain text
6048 #: build/C/man2/select_tut.2:482
6049 #, no-wrap
6050 msgid ""
6051 "    struct timeval tv;\n"
6052 "    tv.tv_sec = 0;\n"
6053 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6054 "    select(0, NULL, NULL, NULL, &tv);\n"
6055 msgstr ""
6056 "    struct timeval tv;\n"
6057 "    tv.tv_sec = 0;\n"
6058 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6059 "    select(0, NULL, NULL, NULL, &tv);\n"
6060
6061 #. type: Plain text
6062 #: build/C/man2/select_tut.2:485
6063 msgid "This is guaranteed to work only on UNIX systems, however."
6064 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6065
6066 #. type: Plain text
6067 #: build/C/man2/select_tut.2:490
6068 msgid ""
6069 "On success, B<select>()  returns the total number of file descriptors still "
6070 "present in the file descriptor sets."
6071 msgstr ""
6072 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
6073 "ディスクリプタの総数を返す。"
6074
6075 #. type: Plain text
6076 #: build/C/man2/select_tut.2:496
6077 msgid ""
6078 "If B<select>()  timed out, then the return value will be zero.  The file "
6079 "descriptors set should be all empty (but may not be on some systems)."
6080 msgstr ""
6081 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6082 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
6083
6084 #. type: Plain text
6085 #: build/C/man2/select_tut.2:503
6086 msgid ""
6087 "A return value of -1 indicates an error, with I<errno> being set "
6088 "appropriately.  In the case of an error, the contents of the returned sets "
6089 "and the I<struct timeout> contents are undefined and should not be used.  "
6090 "B<pselect>()  however never modifies I<ntimeout>."
6091 msgstr ""
6092 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6093 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6094 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
6095 "変更しない。"
6096
6097 #. type: Plain text
6098 #: build/C/man2/select_tut.2:512
6099 msgid ""
6100 "Generally speaking, all operating systems that support sockets also support "
6101 "B<select>().  B<select>()  can be used to solve many problems in a portable "
6102 "and efficient way that naive programmers try to solve in a more complicated "
6103 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6104 msgstr ""
6105 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6106 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6107 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6108 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6109
6110 #. type: Plain text
6111 #: build/C/man2/select_tut.2:521
6112 msgid ""
6113 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6114 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6115 "is nowadays widely available, but historically was less portable than "
6116 "B<select>()."
6117 msgstr ""
6118 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6119 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6120 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6121
6122 #. type: Plain text
6123 #: build/C/man2/select_tut.2:529
6124 msgid ""
6125 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6126 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6127 "of file descriptors."
6128 msgstr ""
6129 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
6130 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
6131
6132 #. type: Plain text
6133 #: build/C/man2/select_tut.2:534
6134 msgid ""
6135 "Here is an example that better demonstrates the true utility of B<select>"
6136 "().  The listing below is a TCP forwarding program that forwards from one "
6137 "TCP port to another."
6138 msgstr ""
6139 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6140 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6141
6142 #. type: Plain text
6143 #: build/C/man2/select_tut.2:547
6144 #, no-wrap
6145 msgid ""
6146 "#include E<lt>stdlib.hE<gt>\n"
6147 "#include E<lt>stdio.hE<gt>\n"
6148 "#include E<lt>unistd.hE<gt>\n"
6149 "#include E<lt>sys/time.hE<gt>\n"
6150 "#include E<lt>sys/types.hE<gt>\n"
6151 "#include E<lt>string.hE<gt>\n"
6152 "#include E<lt>signal.hE<gt>\n"
6153 "#include E<lt>sys/socket.hE<gt>\n"
6154 "#include E<lt>netinet/in.hE<gt>\n"
6155 "#include E<lt>arpa/inet.hE<gt>\n"
6156 "#include E<lt>errno.hE<gt>\n"
6157 msgstr ""
6158 "#include E<lt>stdlib.hE<gt>\n"
6159 "#include E<lt>stdio.hE<gt>\n"
6160 "#include E<lt>unistd.hE<gt>\n"
6161 "#include E<lt>sys/time.hE<gt>\n"
6162 "#include E<lt>sys/types.hE<gt>\n"
6163 "#include E<lt>string.hE<gt>\n"
6164 "#include E<lt>signal.hE<gt>\n"
6165 "#include E<lt>sys/socket.hE<gt>\n"
6166 "#include E<lt>netinet/in.hE<gt>\n"
6167 "#include E<lt>arpa/inet.hE<gt>\n"
6168 "#include E<lt>errno.hE<gt>\n"
6169
6170 #. type: Plain text
6171 #: build/C/man2/select_tut.2:549
6172 #, no-wrap
6173 msgid "static int forward_port;\n"
6174 msgstr "static int forward_port;\n"
6175
6176 #. type: Plain text
6177 #: build/C/man2/select_tut.2:552
6178 #, no-wrap
6179 msgid ""
6180 "#undef max\n"
6181 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6182 msgstr ""
6183 "#undef max\n"
6184 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6185
6186 #. type: Plain text
6187 #: build/C/man2/select_tut.2:559
6188 #, no-wrap
6189 msgid ""
6190 "static int\n"
6191 "listen_socket(int listen_port)\n"
6192 "{\n"
6193 "    struct sockaddr_in a;\n"
6194 "    int s;\n"
6195 "    int yes;\n"
6196 msgstr ""
6197 "static int\n"
6198 "listen_socket(int listen_port)\n"
6199 "{\n"
6200 "    struct sockaddr_in a;\n"
6201 "    int s;\n"
6202 "    int yes;\n"
6203
6204 #. type: Plain text
6205 #: build/C/man2/select_tut.2:584
6206 #, fuzzy, no-wrap
6207 #| msgid ""
6208 #| "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6209 #| "        perror(\"socket\");\n"
6210 #| "        return -1;\n"
6211 #| "    }\n"
6212 #| "    yes = 1;\n"
6213 #| "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6214 #| "            &yes, sizeof(yes)) == -1) {\n"
6215 #| "        perror(\"setsockopt\");\n"
6216 #| "        close(s);\n"
6217 #| "        return -1;\n"
6218 #| "    }\n"
6219 #| "    memset(&a, 0, sizeof(a));\n"
6220 #| "    a.sin_port = htons(listen_port);\n"
6221 #| "    a.sin_family = AF_INET;\n"
6222 #| "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6223 #| "        perror(\"bind\");\n"
6224 #| "        close(s);\n"
6225 #| "        return -1;\n"
6226 #| "    }\n"
6227 #| "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6228 #| "    listen(s, 10);\n"
6229 #| "    return s;\n"
6230 #| "}\n"
6231 msgid ""
6232 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6233 "    if (s == -1) {\n"
6234 "        perror(\"socket\");\n"
6235 "        return -1;\n"
6236 "    }\n"
6237 "    yes = 1;\n"
6238 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6239 "            &yes, sizeof(yes)) == -1) {\n"
6240 "        perror(\"setsockopt\");\n"
6241 "        close(s);\n"
6242 "        return -1;\n"
6243 "    }\n"
6244 "    memset(&a, 0, sizeof(a));\n"
6245 "    a.sin_port = htons(listen_port);\n"
6246 "    a.sin_family = AF_INET;\n"
6247 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6248 "        perror(\"bind\");\n"
6249 "        close(s);\n"
6250 "        return -1;\n"
6251 "    }\n"
6252 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6253 "    listen(s, 10);\n"
6254 "    return s;\n"
6255 "}\n"
6256 msgstr ""
6257 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6258 "        perror(\"socket\");\n"
6259 "        return -1;\n"
6260 "    }\n"
6261 "    yes = 1;\n"
6262 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6263 "            &yes, sizeof(yes)) == -1) {\n"
6264 "        perror(\"setsockopt\");\n"
6265 "        close(s);\n"
6266 "        return -1;\n"
6267 "    }\n"
6268 "    memset(&a, 0, sizeof(a));\n"
6269 "    a.sin_port = htons(listen_port);\n"
6270 "    a.sin_family = AF_INET;\n"
6271 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6272 "        perror(\"bind\");\n"
6273 "        close(s);\n"
6274 "        return -1;\n"
6275 "    }\n"
6276 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6277 "    listen(s, 10);\n"
6278 "    return s;\n"
6279 "}\n"
6280
6281 #. type: Plain text
6282 #: build/C/man2/select_tut.2:590
6283 #, no-wrap
6284 msgid ""
6285 "static int\n"
6286 "connect_socket(int connect_port, char *address)\n"
6287 "{\n"
6288 "    struct sockaddr_in a;\n"
6289 "    int s;\n"
6290 msgstr ""
6291 "static int\n"
6292 "connect_socket(int connect_port, char *address)\n"
6293 "{\n"
6294 "    struct sockaddr_in a;\n"
6295 "    int s;\n"
6296
6297 #. type: Plain text
6298 #: build/C/man2/select_tut.2:597
6299 #, fuzzy, no-wrap
6300 #| msgid ""
6301 #| "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6302 #| "        perror(\"socket\");\n"
6303 #| "        close(s);\n"
6304 #| "        return -1;\n"
6305 #| "    }\n"
6306 msgid ""
6307 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6308 "    if (s == -1) {\n"
6309 "        perror(\"socket\");\n"
6310 "        close(s);\n"
6311 "        return -1;\n"
6312 "    }\n"
6313 msgstr ""
6314 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6315 "        perror(\"socket\");\n"
6316 "        close(s);\n"
6317 "        return -1;\n"
6318 "    }\n"
6319
6320 #. type: Plain text
6321 #: build/C/man2/select_tut.2:601
6322 #, no-wrap
6323 msgid ""
6324 "    memset(&a, 0, sizeof(a));\n"
6325 "    a.sin_port = htons(connect_port);\n"
6326 "    a.sin_family = AF_INET;\n"
6327 msgstr ""
6328 "    memset(&a, 0, sizeof(a));\n"
6329 "    a.sin_port = htons(connect_port);\n"
6330 "    a.sin_family = AF_INET;\n"
6331
6332 #. type: Plain text
6333 #: build/C/man2/select_tut.2:607
6334 #, no-wrap
6335 msgid ""
6336 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6337 "        perror(\"bad IP address format\");\n"
6338 "        close(s);\n"
6339 "        return -1;\n"
6340 "    }\n"
6341 msgstr ""
6342 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6343 "        perror(\"bad IP address format\");\n"
6344 "        close(s);\n"
6345 "        return -1;\n"
6346 "    }\n"
6347
6348 #. type: Plain text
6349 #: build/C/man2/select_tut.2:616
6350 #, no-wrap
6351 msgid ""
6352 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6353 "        perror(\"connect()\");\n"
6354 "        shutdown(s, SHUT_RDWR);\n"
6355 "        close(s);\n"
6356 "        return -1;\n"
6357 "    }\n"
6358 "    return s;\n"
6359 "}\n"
6360 msgstr ""
6361 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6362 "        perror(\"connect()\");\n"
6363 "        shutdown(s, SHUT_RDWR);\n"
6364 "        close(s);\n"
6365 "        return -1;\n"
6366 "    }\n"
6367 "    return s;\n"
6368 "}\n"
6369
6370 #. type: Plain text
6371 #: build/C/man2/select_tut.2:624
6372 #, no-wrap
6373 msgid ""
6374 "#define SHUT_FD1 do {                                \\e\n"
6375 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6376 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6377 "                         close(fd1);                 \\e\n"
6378 "                         fd1 = -1;                   \\e\n"
6379 "                     }                               \\e\n"
6380 "                 } while (0)\n"
6381 msgstr ""
6382 "#define SHUT_FD1 do {                                \\e\n"
6383 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6384 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6385 "                         close(fd1);                 \\e\n"
6386 "                         fd1 = -1;                   \\e\n"
6387 "                     }                               \\e\n"
6388 "                 } while (0)\n"
6389
6390 #. type: Plain text
6391 #: build/C/man2/select_tut.2:632
6392 #, no-wrap
6393 msgid ""
6394 "#define SHUT_FD2 do {                                \\e\n"
6395 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6396 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6397 "                         close(fd2);                 \\e\n"
6398 "                         fd2 = -1;                   \\e\n"
6399 "                     }                               \\e\n"
6400 "                 } while (0)\n"
6401 msgstr ""
6402 "#define SHUT_FD2 do {                                \\e\n"
6403 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6404 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6405 "                         close(fd2);                 \\e\n"
6406 "                         fd2 = -1;                   \\e\n"
6407 "                     }                               \\e\n"
6408 "                 } while (0)\n"
6409
6410 #. type: Plain text
6411 #: build/C/man2/select_tut.2:634
6412 #, no-wrap
6413 msgid "#define BUF_SIZE 1024\n"
6414 msgstr "#define BUF_SIZE 1024\n"
6415
6416 #. type: Plain text
6417 #: build/C/man2/select_tut.2:643
6418 #, no-wrap
6419 msgid ""
6420 "int\n"
6421 "main(int argc, char *argv[])\n"
6422 "{\n"
6423 "    int h;\n"
6424 "    int fd1 = -1, fd2 = -1;\n"
6425 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6426 "    int buf1_avail, buf1_written;\n"
6427 "    int buf2_avail, buf2_written;\n"
6428 msgstr ""
6429 "int\n"
6430 "main(int argc, char *argv[])\n"
6431 "{\n"
6432 "    int h;\n"
6433 "    int fd1 = -1, fd2 = -1;\n"
6434 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6435 "    int buf1_avail, buf1_written;\n"
6436 "    int buf2_avail, buf2_written;\n"
6437
6438 #. type: Plain text
6439 #: build/C/man2/select_tut.2:649
6440 #, no-wrap
6441 msgid ""
6442 "    if (argc != 4) {\n"
6443 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6444 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6445 "        exit(EXIT_FAILURE);\n"
6446 "    }\n"
6447 msgstr ""
6448 "    if (argc != 4) {\n"
6449 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6450 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6451 "        exit(EXIT_FAILURE);\n"
6452 "    }\n"
6453
6454 #. type: Plain text
6455 #: build/C/man2/select_tut.2:651
6456 #, no-wrap
6457 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6458 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6459
6460 #. type: Plain text
6461 #: build/C/man2/select_tut.2:653
6462 #, no-wrap
6463 msgid "    forward_port = atoi(argv[2]);\n"
6464 msgstr "    forward_port = atoi(argv[2]);\n"
6465
6466 #. type: Plain text
6467 #: build/C/man2/select_tut.2:657
6468 #, no-wrap
6469 msgid ""
6470 "    h = listen_socket(atoi(argv[1]));\n"
6471 "    if (h == -1)\n"
6472 "        exit(EXIT_FAILURE);\n"
6473 msgstr ""
6474 "    h = listen_socket(atoi(argv[1]));\n"
6475 "    if (h == -1)\n"
6476 "        exit(EXIT_FAILURE);\n"
6477
6478 #. type: Plain text
6479 #: build/C/man2/select_tut.2:661
6480 #, no-wrap
6481 msgid ""
6482 "    for (;;) {\n"
6483 "        int r, nfds = 0;\n"
6484 "        fd_set rd, wr, er;\n"
6485 msgstr ""
6486 "    for (;;) {\n"
6487 "        int r, nfds = 0;\n"
6488 "        fd_set rd, wr, er;\n"
6489
6490 #. type: Plain text
6491 #: build/C/man2/select_tut.2:691
6492 #, no-wrap
6493 msgid ""
6494 "        FD_ZERO(&rd);\n"
6495 "        FD_ZERO(&wr);\n"
6496 "        FD_ZERO(&er);\n"
6497 "        FD_SET(h, &rd);\n"
6498 "        nfds = max(nfds, h);\n"
6499 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6500 "            FD_SET(fd1, &rd);\n"
6501 "            nfds = max(nfds, fd1);\n"
6502 "        }\n"
6503 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6504 "            FD_SET(fd2, &rd);\n"
6505 "            nfds = max(nfds, fd2);\n"
6506 "        }\n"
6507 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6508 "            FD_SET(fd1, &wr);\n"
6509 "            nfds = max(nfds, fd1);\n"
6510 "        }\n"
6511 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6512 "            FD_SET(fd2, &wr);\n"
6513 "            nfds = max(nfds, fd2);\n"
6514 "        }\n"
6515 "        if (fd1 E<gt> 0) {\n"
6516 "            FD_SET(fd1, &er);\n"
6517 "            nfds = max(nfds, fd1);\n"
6518 "        }\n"
6519 "        if (fd2 E<gt> 0) {\n"
6520 "            FD_SET(fd2, &er);\n"
6521 "            nfds = max(nfds, fd2);\n"
6522 "        }\n"
6523 msgstr ""
6524 "        FD_ZERO(&rd);\n"
6525 "        FD_ZERO(&wr);\n"
6526 "        FD_ZERO(&er);\n"
6527 "        FD_SET(h, &rd);\n"
6528 "        nfds = max(nfds, h);\n"
6529 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6530 "            FD_SET(fd1, &rd);\n"
6531 "            nfds = max(nfds, fd1);\n"
6532 "        }\n"
6533 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6534 "            FD_SET(fd2, &rd);\n"
6535 "            nfds = max(nfds, fd2);\n"
6536 "        }\n"
6537 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6538 "            FD_SET(fd1, &wr);\n"
6539 "            nfds = max(nfds, fd1);\n"
6540 "        }\n"
6541 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6542 "            FD_SET(fd2, &wr);\n"
6543 "            nfds = max(nfds, fd2);\n"
6544 "        }\n"
6545 "        if (fd1 E<gt> 0) {\n"
6546 "            FD_SET(fd1, &er);\n"
6547 "            nfds = max(nfds, fd1);\n"
6548 "        }\n"
6549 "        if (fd2 E<gt> 0) {\n"
6550 "            FD_SET(fd2, &er);\n"
6551 "            nfds = max(nfds, fd2);\n"
6552 "        }\n"
6553
6554 #. type: Plain text
6555 #: build/C/man2/select_tut.2:693
6556 #, no-wrap
6557 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6558 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6559
6560 #. type: Plain text
6561 #: build/C/man2/select_tut.2:696
6562 #, no-wrap
6563 msgid ""
6564 "        if (r == -1 && errno == EINTR)\n"
6565 "            continue;\n"
6566 msgstr ""
6567 "        if (r == -1 && errno == EINTR)\n"
6568 "            continue;\n"
6569
6570 #. type: Plain text
6571 #: build/C/man2/select_tut.2:701
6572 #, no-wrap
6573 msgid ""
6574 "        if (r == -1) {\n"
6575 "            perror(\"select()\");\n"
6576 "            exit(EXIT_FAILURE);\n"
6577 "        }\n"
6578 msgstr ""
6579 "        if (r == -1) {\n"
6580 "            perror(\"select()\");\n"
6581 "            exit(EXIT_FAILURE);\n"
6582 "        }\n"
6583
6584 #. type: Plain text
6585 #: build/C/man2/select_tut.2:705
6586 #, no-wrap
6587 msgid ""
6588 "        if (FD_ISSET(h, &rd)) {\n"
6589 "            unsigned int l;\n"
6590 "            struct sockaddr_in client_address;\n"
6591 msgstr ""
6592 "        if (FD_ISSET(h, &rd)) {\n"
6593 "            unsigned int l;\n"
6594 "            struct sockaddr_in client_address;\n"
6595
6596 #. type: Plain text
6597 #: build/C/man2/select_tut.2:724
6598 #, no-wrap
6599 msgid ""
6600 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6601 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6602 "            if (r == -1) {\n"
6603 "                perror(\"accept()\");\n"
6604 "            } else {\n"
6605 "                SHUT_FD1;\n"
6606 "                SHUT_FD2;\n"
6607 "                buf1_avail = buf1_written = 0;\n"
6608 "                buf2_avail = buf2_written = 0;\n"
6609 "                fd1 = r;\n"
6610 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6611 "                if (fd2 == -1)\n"
6612 "                    SHUT_FD1;\n"
6613 "                else\n"
6614 "                    printf(\"connect from %s\\en\",\n"
6615 "                            inet_ntoa(client_address.sin_addr));\n"
6616 "            }\n"
6617 "        }\n"
6618 msgstr ""
6619 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6620 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6621 "            if (r == -1) {\n"
6622 "                perror(\"accept()\");\n"
6623 "            } else {\n"
6624 "                SHUT_FD1;\n"
6625 "                SHUT_FD2;\n"
6626 "                buf1_avail = buf1_written = 0;\n"
6627 "                buf2_avail = buf2_written = 0;\n"
6628 "                fd1 = r;\n"
6629 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6630 "                if (fd2 == -1)\n"
6631 "                    SHUT_FD1;\n"
6632 "                else\n"
6633 "                    printf(\"connect from %s\\en\",\n"
6634 "                            inet_ntoa(client_address.sin_addr));\n"
6635 "            }\n"
6636 "        }\n"
6637
6638 #. type: Plain text
6639 #: build/C/man2/select_tut.2:726
6640 #, no-wrap
6641 msgid "        /* NB: read oob data before normal reads */\n"
6642 msgstr "        /* NB: read oob data before normal reads */\n"
6643
6644 #. type: Plain text
6645 #: build/C/man2/select_tut.2:730
6646 #, no-wrap
6647 msgid ""
6648 "        if (fd1 E<gt> 0)\n"
6649 "            if (FD_ISSET(fd1, &er)) {\n"
6650 "                char c;\n"
6651 msgstr ""
6652 "        if (fd1 E<gt> 0)\n"
6653 "            if (FD_ISSET(fd1, &er)) {\n"
6654 "                char c;\n"
6655
6656 #. type: Plain text
6657 #: build/C/man2/select_tut.2:740
6658 #, no-wrap
6659 msgid ""
6660 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6661 "                if (r E<lt> 1)\n"
6662 "                    SHUT_FD1;\n"
6663 "                else\n"
6664 "                    send(fd2, &c, 1, MSG_OOB);\n"
6665 "            }\n"
6666 "        if (fd2 E<gt> 0)\n"
6667 "            if (FD_ISSET(fd2, &er)) {\n"
6668 "                char c;\n"
6669 msgstr ""
6670 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6671 "                if (r E<lt> 1)\n"
6672 "                    SHUT_FD1;\n"
6673 "                else\n"
6674 "                    send(fd2, &c, 1, MSG_OOB);\n"
6675 "            }\n"
6676 "        if (fd2 E<gt> 0)\n"
6677 "            if (FD_ISSET(fd2, &er)) {\n"
6678 "                char c;\n"
6679
6680 #. type: Plain text
6681 #: build/C/man2/select_tut.2:783
6682 #, no-wrap
6683 msgid ""
6684 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6685 "                if (r E<lt> 1)\n"
6686 "                    SHUT_FD2;\n"
6687 "                else\n"
6688 "                    send(fd1, &c, 1, MSG_OOB);\n"
6689 "            }\n"
6690 "        if (fd1 E<gt> 0)\n"
6691 "            if (FD_ISSET(fd1, &rd)) {\n"
6692 "                r = read(fd1, buf1 + buf1_avail,\n"
6693 "                          BUF_SIZE - buf1_avail);\n"
6694 "                if (r E<lt> 1)\n"
6695 "                    SHUT_FD1;\n"
6696 "                else\n"
6697 "                    buf1_avail += r;\n"
6698 "            }\n"
6699 "        if (fd2 E<gt> 0)\n"
6700 "            if (FD_ISSET(fd2, &rd)) {\n"
6701 "                r = read(fd2, buf2 + buf2_avail,\n"
6702 "                          BUF_SIZE - buf2_avail);\n"
6703 "                if (r E<lt> 1)\n"
6704 "                    SHUT_FD2;\n"
6705 "                else\n"
6706 "                    buf2_avail += r;\n"
6707 "            }\n"
6708 "        if (fd1 E<gt> 0)\n"
6709 "            if (FD_ISSET(fd1, &wr)) {\n"
6710 "                r = write(fd1, buf2 + buf2_written,\n"
6711 "                           buf2_avail - buf2_written);\n"
6712 "                if (r E<lt> 1)\n"
6713 "                    SHUT_FD1;\n"
6714 "                else\n"
6715 "                    buf2_written += r;\n"
6716 "            }\n"
6717 "        if (fd2 E<gt> 0)\n"
6718 "            if (FD_ISSET(fd2, &wr)) {\n"
6719 "                r = write(fd2, buf1 + buf1_written,\n"
6720 "                           buf1_avail - buf1_written);\n"
6721 "                if (r E<lt> 1)\n"
6722 "                    SHUT_FD2;\n"
6723 "                else\n"
6724 "                    buf1_written += r;\n"
6725 "            }\n"
6726 msgstr ""
6727 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6728 "                if (r E<lt> 1)\n"
6729 "                    SHUT_FD2;\n"
6730 "                else\n"
6731 "                    send(fd1, &c, 1, MSG_OOB);\n"
6732 "            }\n"
6733 "        if (fd1 E<gt> 0)\n"
6734 "            if (FD_ISSET(fd1, &rd)) {\n"
6735 "                r = read(fd1, buf1 + buf1_avail,\n"
6736 "                          BUF_SIZE - buf1_avail);\n"
6737 "                if (r E<lt> 1)\n"
6738 "                    SHUT_FD1;\n"
6739 "                else\n"
6740 "                    buf1_avail += r;\n"
6741 "            }\n"
6742 "        if (fd2 E<gt> 0)\n"
6743 "            if (FD_ISSET(fd2, &rd)) {\n"
6744 "                r = read(fd2, buf2 + buf2_avail,\n"
6745 "                          BUF_SIZE - buf2_avail);\n"
6746 "                if (r E<lt> 1)\n"
6747 "                    SHUT_FD2;\n"
6748 "                else\n"
6749 "                    buf2_avail += r;\n"
6750 "            }\n"
6751 "        if (fd1 E<gt> 0)\n"
6752 "            if (FD_ISSET(fd1, &wr)) {\n"
6753 "                r = write(fd1, buf2 + buf2_written,\n"
6754 "                           buf2_avail - buf2_written);\n"
6755 "                if (r E<lt> 1)\n"
6756 "                    SHUT_FD1;\n"
6757 "                else\n"
6758 "                    buf2_written += r;\n"
6759 "            }\n"
6760 "        if (fd2 E<gt> 0)\n"
6761 "            if (FD_ISSET(fd2, &wr)) {\n"
6762 "                r = write(fd2, buf1 + buf1_written,\n"
6763 "                           buf1_avail - buf1_written);\n"
6764 "                if (r E<lt> 1)\n"
6765 "                    SHUT_FD2;\n"
6766 "                else\n"
6767 "                    buf1_written += r;\n"
6768 "            }\n"
6769
6770 #. type: Plain text
6771 #: build/C/man2/select_tut.2:785
6772 #, no-wrap
6773 msgid "        /* check if write data has caught read data */\n"
6774 msgstr "        /* check if write data has caught read data */\n"
6775
6776 #. type: Plain text
6777 #: build/C/man2/select_tut.2:790
6778 #, no-wrap
6779 msgid ""
6780 "        if (buf1_written == buf1_avail)\n"
6781 "            buf1_written = buf1_avail = 0;\n"
6782 "        if (buf2_written == buf2_avail)\n"
6783 "            buf2_written = buf2_avail = 0;\n"
6784 msgstr ""
6785 "        if (buf1_written == buf1_avail)\n"
6786 "            buf1_written = buf1_avail = 0;\n"
6787 "        if (buf2_written == buf2_avail)\n"
6788 "            buf2_written = buf2_avail = 0;\n"
6789
6790 #. type: Plain text
6791 #: build/C/man2/select_tut.2:793
6792 #, no-wrap
6793 msgid ""
6794 "        /* one side has closed the connection, keep\n"
6795 "           writing to the other side until empty */\n"
6796 msgstr ""
6797 "        /* one side has closed the connection, keep\n"
6798 "           writing to the other side until empty */\n"
6799
6800 #. type: Plain text
6801 #: build/C/man2/select_tut.2:801
6802 #, no-wrap
6803 msgid ""
6804 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6805 "            SHUT_FD2;\n"
6806 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6807 "            SHUT_FD1;\n"
6808 "    }\n"
6809 "    exit(EXIT_SUCCESS);\n"
6810 "}\n"
6811 msgstr ""
6812 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6813 "            SHUT_FD2;\n"
6814 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6815 "            SHUT_FD1;\n"
6816 "    }\n"
6817 "    exit(EXIT_SUCCESS);\n"
6818 "}\n"
6819
6820 #. type: Plain text
6821 #: build/C/man2/select_tut.2:815
6822 msgid ""
6823 "The above program properly forwards most kinds of TCP connections including "
6824 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6825 "problem of having data flow in both directions simultaneously.  You might "
6826 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6827 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6828 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6829 "because you end up using inefficient timeouts."
6830 msgstr ""
6831 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6832 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6833 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6834 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6835 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6836 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6837 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6838 "起こってしまう。"
6839
6840 #. type: Plain text
6841 #: build/C/man2/select_tut.2:821
6842 msgid ""
6843 "The program does not handle more than one simultaneous connection at a time, "
6844 "although it could easily be extended to do this with a linked list of buffers"
6845 "\\(emone for each connection.  At the moment, new connections cause the "
6846 "current connection to be dropped."
6847 msgstr ""
6848 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6849 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6850 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6851
6852 #.  .SH AUTHORS
6853 #.  This man page was written by Paul Sheer.
6854 #. type: Plain text
6855 #: build/C/man2/select_tut.2:840
6856 msgid ""
6857 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6858 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6859 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6860 "(3), B<epoll>(7)"
6861 msgstr ""
6862 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6863 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6864 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6865 "(3), B<epoll>(7)"
6866
6867 #. type: TH
6868 #: build/C/man2/send.2:40
6869 #, no-wrap
6870 msgid "SEND"
6871 msgstr "SEND"
6872
6873 #. type: TH
6874 #: build/C/man2/send.2:40
6875 #, fuzzy, no-wrap
6876 #| msgid "2012-12-14"
6877 msgid "2013-12-12"
6878 msgstr "2012-12-14"
6879
6880 #. type: Plain text
6881 #: build/C/man2/send.2:43
6882 msgid "send, sendto, sendmsg - send a message on a socket"
6883 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6884
6885 #. type: Plain text
6886 #: build/C/man2/send.2:47
6887 #, no-wrap
6888 msgid ""
6889 "B<#include E<lt>sys/types.hE<gt>>\n"
6890 "B<#include E<lt>sys/socket.hE<gt>>\n"
6891 msgstr ""
6892 "B<#include E<lt>sys/types.hE<gt>>\n"
6893 "B<#include E<lt>sys/socket.hE<gt>>\n"
6894
6895 #. type: Plain text
6896 #: build/C/man2/send.2:50
6897 #, no-wrap
6898 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6899 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6900
6901 #. type: Plain text
6902 #: build/C/man2/send.2:54
6903 #, no-wrap
6904 msgid ""
6905 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6906 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6907 msgstr ""
6908 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6909 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6910
6911 #. type: Plain text
6912 #: build/C/man2/send.2:57
6913 #, no-wrap
6914 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6915 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6916
6917 #. type: Plain text
6918 #: build/C/man2/send.2:65
6919 msgid ""
6920 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6921 "transmit a message to another socket."
6922 msgstr ""
6923 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6924 "メッセージを転送するのに使用される。"
6925
6926 #. type: Plain text
6927 #: build/C/man2/send.2:84
6928 msgid ""
6929 "The B<send>()  call may be used only when the socket is in a I<connected> "
6930 "state (so that the intended recipient is known).  The only difference "
6931 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6932 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6933 "following call"
6934 msgstr ""
6935 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6936 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6937 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6938 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6939
6940 #. type: Plain text
6941 #: build/C/man2/send.2:86
6942 #, no-wrap
6943 msgid "    send(sockfd, buf, len, flags);\n"
6944 msgstr "    send(sockfd, buf, len, flags);\n"
6945
6946 #. type: Plain text
6947 #: build/C/man2/send.2:88
6948 msgid "is equivalent to"
6949 msgstr "は以下と等価である。"
6950
6951 #. type: Plain text
6952 #: build/C/man2/send.2:90
6953 #, no-wrap
6954 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6955 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6956
6957 #. type: Plain text
6958 #: build/C/man2/send.2:94
6959 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6960 msgstr ""
6961 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6962 "る。"
6963
6964 #. type: Plain text
6965 #: build/C/man2/send.2:122
6966 msgid ""
6967 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6968 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6969 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6970 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6971 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6972 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6973 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6974 "size."
6975 msgstr ""
6976 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6977 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6978 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6979 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6980 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6981 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6982 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6983 "msg_namelen> で指定される。"
6984
6985 #. type: Plain text
6986 #: build/C/man2/send.2:138
6987 msgid ""
6988 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6989 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6990 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6991 "ancillary data (also known as control information)."
6992 msgstr ""
6993 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6994 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6995 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6996 "(制御情報とも呼ばれる) を送信することもできる。"
6997
6998 #. type: Plain text
6999 #: build/C/man2/send.2:143
7000 msgid ""
7001 "If the message is too long to pass atomically through the underlying "
7002 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
7003 "transmitted."
7004 msgstr ""
7005 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
7006 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
7007 "ラーが返され、そのメッセージは転送されない。"
7008
7009 #. type: Plain text
7010 #: build/C/man2/send.2:147
7011 msgid ""
7012 "No indication of failure to deliver is implicit in a B<send>().  Locally "
7013 "detected errors are indicated by a return value of -1."
7014 msgstr ""
7015 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
7016 "出された場合は、返り値 -1 として通知される。"
7017
7018 #. type: Plain text
7019 #: build/C/man2/send.2:160
7020 msgid ""
7021 "When the message does not fit into the send buffer of the socket, B<send>()  "
7022 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
7023 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
7024 "in this case.  The B<select>(2)  call may be used to determine when it is "
7025 "possible to send more data."
7026 msgstr ""
7027 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
7028 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
7029 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
7030 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
7031 "用することができる。"
7032
7033 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
7034 #. type: Plain text
7035 #: build/C/man2/send.2:166
7036 msgid ""
7037 "The I<flags> argument is the bitwise OR of zero or more of the following "
7038 "flags."
7039 msgstr ""
7040 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
7041 "のを指定する。"
7042
7043 #. type: TP
7044 #: build/C/man2/send.2:166
7045 #, fuzzy, no-wrap
7046 #| msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
7047 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
7048 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
7049
7050 #. type: Plain text
7051 #: build/C/man2/send.2:180
7052 msgid ""
7053 "Tell the link layer that forward progress happened: you got a successful "
7054 "reply from the other side.  If the link layer doesn't get this it will "
7055 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
7056 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
7057 "IPv4 and IPv6.  See B<arp>(7)  for details."
7058 msgstr ""
7059 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
7060 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
7061 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
7062 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
7063 "されている。 詳しくは B<arp>(7)  参照のこと。"
7064
7065 #. type: TP
7066 #: build/C/man2/send.2:180
7067 #, no-wrap
7068 msgid "B<MSG_DONTROUTE>"
7069 msgstr "B<MSG_DONTROUTE>"
7070
7071 #. type: Plain text
7072 #: build/C/man2/send.2:188
7073 msgid ""
7074 "Don't use a gateway to send out the packet, send to hosts only on directly "
7075 "connected networks.  This is usually used only by diagnostic or routing "
7076 "programs.  This is defined only for protocol families that route; packet "
7077 "sockets don't."
7078 msgstr ""
7079 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
7080 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
7081 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
7082 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
7083
7084 #. type: Plain text
7085 #: build/C/man2/send.2:199
7086 msgid ""
7087 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
7088 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
7089 "flag with the B<F_SETFL> B<fcntl>(2))."
7090 msgstr ""
7091 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
7092 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
7093 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
7094
7095 #. type: TP
7096 #: build/C/man2/send.2:199
7097 #, no-wrap
7098 msgid "B<MSG_EOR> (since Linux 2.2)"
7099 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7100
7101 #. type: Plain text
7102 #: build/C/man2/send.2:203
7103 msgid ""
7104 "Terminates a record (when this notion is supported, as for sockets of type "
7105 "B<SOCK_SEQPACKET>)."
7106 msgstr ""
7107 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7108 "ケット種別のときに有効)。"
7109
7110 #. type: TP
7111 #: build/C/man2/send.2:203
7112 #, fuzzy, no-wrap
7113 #| msgid "B<MSG_MORE> (Since Linux 2.4.4)"
7114 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7115 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7116
7117 #. type: Plain text
7118 #: build/C/man2/send.2:212
7119 msgid ""
7120 "The caller has more data to send.  This flag is used with TCP sockets to "
7121 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7122 "with the difference that this flag can be set on a per-call basis."
7123 msgstr ""
7124 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7125 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
7126 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
7127 "機能を有効にできる点である。"
7128
7129 #. type: Plain text
7130 #: build/C/man2/send.2:221
7131 msgid ""
7132 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7133 "the kernel to package all of the data sent in calls with this flag set into "
7134 "a single datagram which is transmitted only when a call is performed that "
7135 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
7136 "described in B<udp>(7).)"
7137 msgstr ""
7138 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7139 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7140 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7141 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7142 "ソケットオプション B<UDP_CORK> も参照)。"
7143
7144 #. type: TP
7145 #: build/C/man2/send.2:221
7146 #, no-wrap
7147 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7148 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7149
7150 #. type: Plain text
7151 #: build/C/man2/send.2:230
7152 msgid ""
7153 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7154 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7155 msgstr ""
7156 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7157 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7158
7159 #. type: Plain text
7160 #: build/C/man2/send.2:239
7161 msgid ""
7162 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7163 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7164 "data."
7165 msgstr ""
7166 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7167 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7168 "をサポートしている必要がある。"
7169
7170 #. type: Plain text
7171 #: build/C/man2/send.2:246
7172 msgid ""
7173 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
7174 "below for an exact description of its fields."
7175 msgstr ""
7176 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
7177 "B<recv>(2)  と以下の説明を参照すること。"
7178
7179 #.  Still to be documented:
7180 #.   Send file descriptors and user credentials using the
7181 #.   msg_control* fields.
7182 #.   The flags returned in msg_flags.
7183 #. type: Plain text
7184 #: build/C/man2/send.2:275
7185 msgid ""
7186 "You may send control information using the I<msg_control> and "
7187 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7188 "process is limited per socket by the value in I</proc/sys/net/core/"
7189 "optmem_max>; see B<socket>(7)."
7190 msgstr ""
7191 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
7192 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7193 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
7194
7195 #. type: Plain text
7196 #: build/C/man2/send.2:280
7197 #, fuzzy
7198 #| msgid ""
7199 #| "On success, these calls return the number of characters sent.  On error, "
7200 #| "-1 is returned, and I<errno> is set appropriately."
7201 msgid ""
7202 "On success, these calls return the number of bytes sent.  On error, -1 is "
7203 "returned, and I<errno> is set appropriately."
7204 msgstr ""
7205 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7206 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7207
7208 #. type: Plain text
7209 #: build/C/man2/send.2:285
7210 msgid ""
7211 "These are some standard errors generated by the socket layer.  Additional "
7212 "errors may be generated and returned from the underlying protocol modules; "
7213 "see their respective manual pages."
7214 msgstr ""
7215 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7216 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7217 "れぞれのマニュアルを参照すること。"
7218
7219 #. type: Plain text
7220 #: build/C/man2/send.2:293
7221 msgid ""
7222 "(For UNIX domain sockets, which are identified by pathname)  Write "
7223 "permission is denied on the destination socket file, or search permission is "
7224 "denied for one of the directories the path prefix.  (See B<path_resolution>"
7225 "(7).)"
7226 msgstr ""
7227 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7228 "\n"
7229 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7230 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7231 "(B<path_resolution>(7) も参照のこと)"
7232
7233 #. type: Plain text
7234 #: build/C/man2/send.2:296
7235 msgid ""
7236 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7237 "as though it was a unicast address."
7238 msgstr ""
7239 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7240 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7241
7242 #.  Actually EAGAIN on Linux
7243 #. type: Plain text
7244 #: build/C/man2/send.2:304
7245 msgid ""
7246 "The socket is marked nonblocking and the requested operation would block.  "
7247 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7248 "require these constants to have the same value, so a portable application "
7249 "should check for both possibilities."
7250 msgstr ""
7251 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7252 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7253 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7254 "両方の可能性を 確認すべきである。"
7255
7256 #. type: Plain text
7257 #: build/C/man2/send.2:307
7258 msgid "An invalid descriptor was specified."
7259 msgstr "無効なディスクリプターが指定された。"
7260
7261 #. type: TP
7262 #: build/C/man2/send.2:307
7263 #, no-wrap
7264 msgid "B<ECONNRESET>"
7265 msgstr "B<ECONNRESET>"
7266
7267 #. type: Plain text
7268 #: build/C/man2/send.2:310
7269 msgid "Connection reset by peer."
7270 msgstr "接続が接続相手によりリセットされた。"
7271
7272 #. type: TP
7273 #: build/C/man2/send.2:310
7274 #, no-wrap
7275 msgid "B<EDESTADDRREQ>"
7276 msgstr "B<EDESTADDRREQ>"
7277
7278 #. type: Plain text
7279 #: build/C/man2/send.2:313
7280 msgid "The socket is not connection-mode, and no peer address is set."
7281 msgstr ""
7282 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7283 "ていない。"
7284
7285 #. type: Plain text
7286 #: build/C/man2/send.2:316
7287 msgid "An invalid user space address was specified for an argument."
7288 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7289
7290 #. type: Plain text
7291 #: build/C/man2/send.2:320
7292 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7293 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7294
7295 #. type: Plain text
7296 #: build/C/man2/send.2:329
7297 msgid ""
7298 "The connection-mode socket was connected already but a recipient was "
7299 "specified.  (Now either this error is returned, or the recipient "
7300 "specification is ignored.)"
7301 msgstr ""
7302 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7303 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7304 "いずれかとなる)"
7305
7306 #. type: TP
7307 #: build/C/man2/send.2:329
7308 #, no-wrap
7309 msgid "B<EMSGSIZE>"
7310 msgstr "B<EMSGSIZE>"
7311
7312 #.  (e.g., SOCK_DGRAM )
7313 #. type: Plain text
7314 #: build/C/man2/send.2:335
7315 msgid ""
7316 "The socket type requires that message be sent atomically, and the size of "
7317 "the message to be sent made this impossible."
7318 msgstr ""
7319 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7320 "るが、 メッセージが大き過ぎるため送信することができない。"
7321
7322 #. type: Plain text
7323 #: build/C/man2/send.2:343
7324 msgid ""
7325 "The output queue for a network interface was full.  This generally indicates "
7326 "that the interface has stopped sending, but may be caused by transient "
7327 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7328 "silently dropped when a device queue overflows.)"
7329 msgstr ""
7330 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7331 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7332 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7333 "フローした場合にはパケットは黙って捨てられる)"
7334
7335 #. type: Plain text
7336 #: build/C/man2/send.2:346
7337 msgid "No memory available."
7338 msgstr "メモリが足りない。"
7339
7340 #. type: Plain text
7341 #: build/C/man2/send.2:349
7342 msgid "The socket is not connected, and no target has been given."
7343 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7344
7345 #. type: Plain text
7346 #: build/C/man2/send.2:359
7347 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7348 msgstr ""
7349 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7350 "る。"
7351
7352 #. type: TP
7353 #: build/C/man2/send.2:359
7354 #, no-wrap
7355 msgid "B<EPIPE>"
7356 msgstr "B<EPIPE>"
7357
7358 #. type: Plain text
7359 #: build/C/man2/send.2:368
7360 msgid ""
7361 "The local end has been shut down on a connection oriented socket.  In this "
7362 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7363 "set."
7364 msgstr ""
7365 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7366 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7367
7368 #. type: Plain text
7369 #: build/C/man2/send.2:371
7370 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7371 msgstr ""
7372 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7373
7374 #. type: Plain text
7375 #: build/C/man2/send.2:382
7376 msgid ""
7377 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7378 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7379 "flag is a Linux extension."
7380 msgstr ""
7381 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7382 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7383 "ラグは Linux での拡張である。"
7384
7385 #. type: Plain text
7386 #: build/C/man2/send.2:395
7387 msgid ""
7388 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7389 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7390 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7391 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7392 "and libc5.  See also B<accept>(2)."
7393 msgstr ""
7394 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7395 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7396 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7397 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7398 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7399
7400 #. type: Plain text
7401 #: build/C/man2/send.2:414
7402 msgid ""
7403 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7404 "can be used to transmit multiple datagrams in a single call."
7405 msgstr ""
7406 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7407 "る\n"
7408 "Linux 固有の システムコールに関する情報が書かれている。"
7409
7410 #. type: Plain text
7411 #: build/C/man2/send.2:419
7412 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7413 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7414
7415 #. type: Plain text
7416 #: build/C/man2/send.2:424
7417 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7418 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7419
7420 #. type: Plain text
7421 #: build/C/man2/send.2:439
7422 msgid ""
7423 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7424 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7425 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7426 msgstr ""
7427 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7428 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7429 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7430
7431 #. type: TH
7432 #: build/C/man2/sendmmsg.2:28
7433 #, no-wrap
7434 msgid "SENDMMSG"
7435 msgstr "SENDMMSG"
7436
7437 #. type: TH
7438 #: build/C/man2/sendmmsg.2:28
7439 #, no-wrap
7440 msgid "2012-12-16"
7441 msgstr "2012-12-16"
7442
7443 #. type: Plain text
7444 #: build/C/man2/sendmmsg.2:31
7445 msgid "sendmmsg - send multiple messages on a socket"
7446 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7447
7448 #. type: Plain text
7449 #: build/C/man2/sendmmsg.2:39
7450 #, no-wrap
7451 msgid ""
7452 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7453 "B<             unsigned int >I<flags>B<);>\n"
7454 msgstr ""
7455 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7456 "B<             unsigned int >I<flags>B<);>\n"
7457
7458 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7459 #. type: Plain text
7460 #: build/C/man2/sendmmsg.2:49
7461 msgid ""
7462 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7463 "the caller to transmit multiple messages on a socket using a single system "
7464 "call.  (This has performance benefits for some applications.)"
7465 msgstr ""
7466 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7467 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7468 "ンによっては性能上のメリットがある)。"
7469
7470 #. type: Plain text
7471 #: build/C/man2/sendmmsg.2:54
7472 msgid ""
7473 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7474 "to be transmitted."
7475 msgstr ""
7476 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7477
7478 #. type: Plain text
7479 #: build/C/man2/sendmmsg.2:75
7480 #, no-wrap
7481 msgid ""
7482 "struct mmsghdr {\n"
7483 "    struct msghdr msg_hdr;  /* Message header */\n"
7484 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7485 "};\n"
7486 msgstr ""
7487 "struct mmsghdr {\n"
7488 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7489 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7490 "};\n"
7491
7492 #. type: Plain text
7493 #: build/C/man2/sendmmsg.2:91
7494 msgid ""
7495 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7496 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7497 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7498 "B<sendmsg>(2)  call)."
7499 msgstr ""
7500 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7501 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7502 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7503 "合の返り値と同じである。"
7504
7505 #. type: Plain text
7506 #: build/C/man2/sendmmsg.2:97
7507 msgid ""
7508 "The I<flags> argument contains flags ORed together.  The flags are the same "
7509 "as for B<sendmsg>(2)."
7510 msgstr ""
7511 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7512 "B<sendmsg>(2) と同じである。"
7513
7514 #. type: Plain text
7515 #: build/C/man2/sendmmsg.2:107
7516 msgid ""
7517 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7518 "sent.  A nonblocking call sends as many messages as possible (up to the "
7519 "limit specified by I<vlen>)  and returns immediately."
7520 msgstr ""
7521 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7522 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7523 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7524
7525 #. type: Plain text
7526 #: build/C/man2/sendmmsg.2:119
7527 msgid ""
7528 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7529 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7530 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7531 "of elements of I<msgvec> that have been updated."
7532 msgstr ""
7533 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7534 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7535 "しの返り値は、更新された I<msgvec> の要素数である。"
7536
7537 #. type: Plain text
7538 #: build/C/man2/sendmmsg.2:129
7539 msgid ""
7540 "On success, B<sendmmsg>()  returns the number of messages sent from "
7541 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7542 "B<sendmmsg>()  call to send the remaining messages."
7543 msgstr ""
7544 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7545 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7546 "て残りのメッセージを送信することができる。"
7547
7548 #. type: Plain text
7549 #: build/C/man2/sendmmsg.2:133
7550 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7551 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7552
7553 #
7554 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7555 #.      ... only return an error if no datagrams could be sent.
7556 #.      If less than the requested number of messages were sent, the application
7557 #.      must retry starting at the first failed one and if the problem is
7558 #.      persistent the error will be returned.
7559 #.      This matches the behaviour of other syscalls like read/write - it
7560 #.      is not an error if less than the requested number of elements are sent.
7561 #. type: Plain text
7562 #: build/C/man2/sendmmsg.2:145
7563 msgid ""
7564 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7565 "could be sent."
7566 msgstr ""
7567 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7568 "く送信できなかった場合のみである。"
7569
7570 #. type: Plain text
7571 #: build/C/man2/sendmmsg.2:150
7572 msgid ""
7573 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7574 "added in version 2.14."
7575 msgstr ""
7576 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7577 "バージョン 2.14 で追加された。"
7578
7579 #. type: Plain text
7580 #: build/C/man2/sendmmsg.2:153
7581 msgid "B<sendmmsg>()  is Linux-specific."
7582 msgstr "B<sendmmsg>() は Linux 固有である。"
7583
7584 #
7585 #
7586 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7587 #.      net: Cap number of elements for sendmmsg
7588 #.      To limit the amount of time we can spend in sendmmsg, cap the
7589 #.      number of elements to UIO_MAXIOV (currently 1024).
7590 #.      For error handling an application using sendmmsg needs to retry at
7591 #.      the first unsent message, so capping is simpler and requires less
7592 #.      application logic than returning EINVAL.
7593 #. type: Plain text
7594 #: build/C/man2/sendmmsg.2:168
7595 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7596 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7597
7598 #. type: Plain text
7599 #: build/C/man2/sendmmsg.2:177
7600 msgid ""
7601 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7602 "distinct UDP datagrams using one system call.  The contents of the first "
7603 "datagram originates from a pair of buffers."
7604 msgstr ""
7605 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7606 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7607 "の内容は、二つのバッファから取得される。"
7608
7609 #. type: Plain text
7610 #: build/C/man2/sendmmsg.2:186
7611 #, no-wrap
7612 msgid ""
7613 "#define _GNU_SOURCE\n"
7614 "#include E<lt>netinet/ip.hE<gt>\n"
7615 "#include E<lt>stdio.hE<gt>\n"
7616 "#include E<lt>stdlib.hE<gt>\n"
7617 "#include E<lt>string.hE<gt>\n"
7618 "#include E<lt>sys/types.hE<gt>\n"
7619 "#include E<lt>sys/socket.hE<gt>\n"
7620 msgstr ""
7621 "#define _GNU_SOURCE\n"
7622 "#include E<lt>netinet/ip.hE<gt>\n"
7623 "#include E<lt>stdio.hE<gt>\n"
7624 "#include E<lt>stdlib.hE<gt>\n"
7625 "#include E<lt>string.hE<gt>\n"
7626 "#include E<lt>sys/types.hE<gt>\n"
7627 "#include E<lt>sys/socket.hE<gt>\n"
7628
7629 #. type: Plain text
7630 #: build/C/man2/sendmmsg.2:195
7631 #, no-wrap
7632 msgid ""
7633 "int\n"
7634 "main(void)\n"
7635 "{\n"
7636 "    int sockfd;\n"
7637 "    struct sockaddr_in sa;\n"
7638 "    struct mmsghdr msg[2];\n"
7639 "    struct iovec msg1[2], msg2;\n"
7640 "    int retval;\n"
7641 msgstr ""
7642 "int\n"
7643 "main(void)\n"
7644 "{\n"
7645 "    int sockfd;\n"
7646 "    struct sockaddr_in sa;\n"
7647 "    struct mmsghdr msg[2];\n"
7648 "    struct iovec msg1[2], msg2;\n"
7649 "    int retval;\n"
7650
7651 #. type: Plain text
7652 #: build/C/man2/sendmmsg.2:209
7653 #, no-wrap
7654 msgid ""
7655 "    sa.sin_family = AF_INET;\n"
7656 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7657 "    sa.sin_port = htons(1234);\n"
7658 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7659 "        perror(\"connect()\");\n"
7660 "        exit(EXIT_FAILURE);\n"
7661 "    }\n"
7662 msgstr ""
7663 "    sa.sin_family = AF_INET;\n"
7664 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7665 "    sa.sin_port = htons(1234);\n"
7666 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7667 "        perror(\"connect()\");\n"
7668 "        exit(EXIT_FAILURE);\n"
7669 "    }\n"
7670
7671 #. type: Plain text
7672 #: build/C/man2/sendmmsg.2:215
7673 #, no-wrap
7674 msgid ""
7675 "    memset(msg1, 0, sizeof(msg1));\n"
7676 "    msg1[0].iov_base = \"one\";\n"
7677 "    msg1[0].iov_len = 3;\n"
7678 "    msg1[1].iov_base = \"two\";\n"
7679 "    msg1[1].iov_len = 3;\n"
7680 msgstr ""
7681 "    memset(msg1, 0, sizeof(msg1));\n"
7682 "    msg1[0].iov_base = \"one\";\n"
7683 "    msg1[0].iov_len = 3;\n"
7684 "    msg1[1].iov_base = \"two\";\n"
7685 "    msg1[1].iov_len = 3;\n"
7686
7687 #. type: Plain text
7688 #: build/C/man2/sendmmsg.2:219
7689 #, no-wrap
7690 msgid ""
7691 "    memset(&msg2, 0, sizeof(msg2));\n"
7692 "    msg2.iov_base = \"three\";\n"
7693 "    msg2.iov_len = 5;\n"
7694 msgstr ""
7695 "    memset(&msg2, 0, sizeof(msg2));\n"
7696 "    msg2.iov_base = \"three\";\n"
7697 "    msg2.iov_len = 5;\n"
7698
7699 #. type: Plain text
7700 #: build/C/man2/sendmmsg.2:223
7701 #, no-wrap
7702 msgid ""
7703 "    memset(msg, 0, sizeof(msg));\n"
7704 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7705 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7706 msgstr ""
7707 "    memset(msg, 0, sizeof(msg));\n"
7708 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7709 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7710
7711 #. type: Plain text
7712 #: build/C/man2/sendmmsg.2:226
7713 #, no-wrap
7714 msgid ""
7715 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7716 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7717 msgstr ""
7718 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7719 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7720
7721 #. type: Plain text
7722 #: build/C/man2/sendmmsg.2:232
7723 #, no-wrap
7724 msgid ""
7725 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7726 "    if (retval == -1)\n"
7727 "        perror(\"sendmmsg()\");\n"
7728 "    else\n"
7729 "        printf(\"%d messages sent\\en\", retval);\n"
7730 msgstr ""
7731 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7732 "    if (retval == -1)\n"
7733 "        perror(\"sendmmsg()\");\n"
7734 "    else\n"
7735 "        printf(\"%d messages sent\\en\", retval);\n"
7736
7737 #. type: Plain text
7738 #: build/C/man2/sendmmsg.2:235
7739 #, no-wrap
7740 msgid ""
7741 "    exit(0);\n"
7742 "}\n"
7743 msgstr ""
7744 "    exit(0);\n"
7745 "}\n"
7746
7747 #. type: Plain text
7748 #: build/C/man2/sendmmsg.2:241
7749 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7750 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7751
7752 #. type: TH
7753 #: build/C/man3/sockatmark.3:25
7754 #, no-wrap
7755 msgid "SOCKATMARK"
7756 msgstr "SOCKATMARK"
7757
7758 #. type: TH
7759 #: build/C/man3/sockatmark.3:25
7760 #, fuzzy, no-wrap
7761 #| msgid "2007-12-28"
7762 msgid "2014-02-28"
7763 msgstr "2007-12-28"
7764
7765 #. type: Plain text
7766 #: build/C/man3/sockatmark.3:28
7767 msgid "sockatmark - determine whether socket is at out-of-band mark"
7768 msgstr ""
7769 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7770 "べる"
7771
7772 #. type: Plain text
7773 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7774 #: build/C/man7/socket.7:61 build/C/man2/socketpair.2:49
7775 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7776 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7777
7778 #. type: Plain text
7779 #: build/C/man3/sockatmark.3:32
7780 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7781 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7782
7783 #. type: Plain text
7784 #: build/C/man3/sockatmark.3:41
7785 msgid ""
7786 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7787 "\\ 600"
7788 msgstr ""
7789 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7790 "\\ 600"
7791
7792 #. type: Plain text
7793 #: build/C/man3/sockatmark.3:51
7794 msgid ""
7795 "B<sockatmark>()  returns a value indicating whether or not the socket "
7796 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7797 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7798 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7799 msgstr ""
7800 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7801 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7802 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7803 "この関数は帯域外マークを削除しない。"
7804
7805 #. type: Plain text
7806 #: build/C/man3/sockatmark.3:58
7807 msgid ""
7808 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7809 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7810 "set to indicate the error."
7811 msgstr ""
7812 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7813 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7814 "れ、エラーを表す I<errno> が設定される。"
7815
7816 #. type: Plain text
7817 #: build/C/man3/sockatmark.3:63
7818 msgid "I<sockfd> is not a valid file descriptor."
7819 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7820
7821 #.  POSIX.1 says ENOTTY for this case
7822 #. type: Plain text
7823 #: build/C/man3/sockatmark.3:70
7824 msgid ""
7825 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7826 msgstr ""
7827 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7828
7829 #. type: Plain text
7830 #: build/C/man3/sockatmark.3:73
7831 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7832 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7833
7834 #. type: Plain text
7835 #: build/C/man3/sockatmark.3:78
7836 msgid "The B<sockatmark>()  function is thread-safe."
7837 msgstr ""
7838
7839 #. type: Plain text
7840 #: build/C/man3/sockatmark.3:80
7841 msgid "POSIX.1-2001."
7842 msgstr "POSIX.1-2001."
7843
7844 #. type: Plain text
7845 #: build/C/man3/sockatmark.3:87
7846 msgid ""
7847 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7848 "the B<MSG_OOB> flag of B<recv>(2)."
7849 msgstr ""
7850 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7851 "B<recv>(2)  で読み込むことができる。"
7852
7853 #. type: Plain text
7854 #: build/C/man3/sockatmark.3:89
7855 msgid "Out-of-band data is supported only on some stream socket protocols."
7856 msgstr ""
7857 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7858 "ない。"
7859
7860 #. type: Plain text
7861 #: build/C/man3/sockatmark.3:94
7862 msgid ""
7863 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7864 "signal."
7865 msgstr ""
7866 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7867 "る。"
7868
7869 #. type: Plain text
7870 #: build/C/man3/sockatmark.3:100
7871 msgid ""
7872 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7873 "operation."
7874 msgstr ""
7875 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7876
7877 #. type: Plain text
7878 #: build/C/man3/sockatmark.3:104
7879 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7880 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7881
7882 #. type: Plain text
7883 #: build/C/man3/sockatmark.3:109
7884 msgid ""
7885 "The following code can be used after receipt of a B<SIGURG> signal to read "
7886 "(and discard) all data up to the mark, and then read the byte of data at the "
7887 "mark:"
7888 msgstr ""
7889 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7890 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7891
7892 #. type: Plain text
7893 #: build/C/man3/sockatmark.3:114
7894 #, no-wrap
7895 msgid ""
7896 "    char buf[BUF_LEN];\n"
7897 "    char oobdata;\n"
7898 "    int atmark, s;\n"
7899 msgstr ""
7900 "    char buf[BUF_LEN];\n"
7901 "    char oobdata;\n"
7902 "    int atmark, s;\n"
7903
7904 #. type: Plain text
7905 #: build/C/man3/sockatmark.3:121
7906 #, no-wrap
7907 msgid ""
7908 "    for (;;) {\n"
7909 "        atmark = sockatmark(sockfd);\n"
7910 "        if (atmark == -1) {\n"
7911 "            perror(\"sockatmark\");\n"
7912 "            break;\n"
7913 "        }\n"
7914 msgstr ""
7915 "    for (;;) {\n"
7916 "        atmark = sockatmark(sockfd);\n"
7917 "        if (atmark == -1) {\n"
7918 "            perror(\"sockatmark\");\n"
7919 "            break;\n"
7920 "        }\n"
7921
7922 #. type: Plain text
7923 #: build/C/man3/sockatmark.3:124
7924 #, no-wrap
7925 msgid ""
7926 "        if (atmark)\n"
7927 "            break;\n"
7928 msgstr ""
7929 "        if (atmark)\n"
7930 "            break;\n"
7931
7932 #. type: Plain text
7933 #: build/C/man3/sockatmark.3:131
7934 #, no-wrap
7935 msgid ""
7936 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7937 "        if (s == -1)\n"
7938 "            perror(\"read\");\n"
7939 "        if (s E<lt>= 0)\n"
7940 "            break;\n"
7941 "    }\n"
7942 msgstr ""
7943 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7944 "        if (s == -1)\n"
7945 "            perror(\"read\");\n"
7946 "        if (s E<lt>= 0)\n"
7947 "            break;\n"
7948 "    }\n"
7949
7950 #. type: Plain text
7951 #: build/C/man3/sockatmark.3:138
7952 #, no-wrap
7953 msgid ""
7954 "    if (atmark == 1) {\n"
7955 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7956 "            perror(\"recv\");\n"
7957 "            ...\n"
7958 "        }\n"
7959 "    }\n"
7960 msgstr ""
7961 "    if (atmark == 1) {\n"
7962 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7963 "            perror(\"recv\");\n"
7964 "            ...\n"
7965 "        }\n"
7966 "    }\n"
7967
7968 #. type: Plain text
7969 #: build/C/man3/sockatmark.3:144
7970 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7971 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7972
7973 #. type: TH
7974 #: build/C/man2/socket.2:43 build/C/man7/socket.7:56
7975 #, no-wrap
7976 msgid "SOCKET"
7977 msgstr "SOCKET"
7978
7979 #. type: TH
7980 #: build/C/man2/socket.2:43
7981 #, fuzzy, no-wrap
7982 #| msgid "2012-12-14"
7983 msgid "2013-12-31"
7984 msgstr "2012-12-14"
7985
7986 #. type: Plain text
7987 #: build/C/man2/socket.2:46
7988 msgid "socket - create an endpoint for communication"
7989 msgstr "socket - 通信のための端点(endpoint)を作成する"
7990
7991 #. type: Plain text
7992 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7993 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7994 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7995
7996 #. type: Plain text
7997 #: build/C/man2/socket.2:52
7998 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7999 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8000
8001 #. type: Plain text
8002 #: build/C/man2/socket.2:55
8003 msgid ""
8004 "B<socket>()  creates an endpoint for communication and returns a descriptor."
8005 msgstr ""
8006 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
8007 "(descriptor)を返す。"
8008
8009 #. type: Plain text
8010 #: build/C/man2/socket.2:63
8011 msgid ""
8012 "The I<domain> argument specifies a communication domain; this selects the "
8013 "protocol family which will be used for communication.  These families are "
8014 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
8015 "include:"
8016 msgstr ""
8017 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
8018 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
8019 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
8020 "下の通り。"
8021
8022 #. type: tbl table
8023 #: build/C/man2/socket.2:66
8024 #, no-wrap
8025 msgid "Name:Purpose:Man page\n"
8026 msgstr "名前:目的:マニュアル\n"
8027
8028 #. type: tbl table
8029 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
8030 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
8031 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
8032 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8033 #, no-wrap
8034 msgid "T{\n"
8035 msgstr "T{\n"
8036
8037 #. type: tbl table
8038 #: build/C/man2/socket.2:68
8039 #, no-wrap
8040 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8041 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8042
8043 #. type: tbl table
8044 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8045 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8046 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8047 #: build/C/man7/socket.7:192
8048 #, no-wrap
8049 msgid "T}:T{\n"
8050 msgstr "T}:T{\n"
8051
8052 #. type: tbl table
8053 #: build/C/man2/socket.2:70
8054 #, no-wrap
8055 msgid "Local communication\n"
8056 msgstr "ローカル通信\n"
8057
8058 #. type: tbl table
8059 #: build/C/man2/socket.2:72
8060 #, no-wrap
8061 msgid "B<unix>(7)\n"
8062 msgstr "B<unix>(7)\n"
8063
8064 #. type: tbl table
8065 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8066 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8067 #: build/C/man2/socket.2:118 build/C/man7/socket.7:171
8068 #: build/C/man7/socket.7:175 build/C/man7/socket.7:178
8069 #: build/C/man7/socket.7:184 build/C/man7/socket.7:187
8070 #: build/C/man7/socket.7:196 build/C/man7/socket.7:203
8071 #, no-wrap
8072 msgid "T}\n"
8073 msgstr "T}\n"
8074
8075 #. type: tbl table
8076 #: build/C/man2/socket.2:75
8077 #, no-wrap
8078 msgid "B<AF_INET>\n"
8079 msgstr "B<AF_INET>\n"
8080
8081 #. type: tbl table
8082 #: build/C/man2/socket.2:76
8083 #, no-wrap
8084 msgid "T}:IPv4 Internet protocols:T{\n"
8085 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
8086
8087 #. type: tbl table
8088 #: build/C/man2/socket.2:77
8089 #, no-wrap
8090 msgid "B<ip>(7)\n"
8091 msgstr "B<ip>(7)\n"
8092
8093 #. type: tbl table
8094 #: build/C/man2/socket.2:80
8095 #, no-wrap
8096 msgid "B<AF_INET6>\n"
8097 msgstr "B<AF_INET6>\n"
8098
8099 #. type: tbl table
8100 #: build/C/man2/socket.2:81
8101 #, no-wrap
8102 msgid "T}:IPv6 Internet protocols:T{\n"
8103 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
8104
8105 #. type: tbl table
8106 #: build/C/man2/socket.2:82
8107 #, no-wrap
8108 msgid "B<ipv6>(7)\n"
8109 msgstr "B<ipv6>(7)\n"
8110
8111 #. type: tbl table
8112 #: build/C/man2/socket.2:85
8113 #, no-wrap
8114 msgid "B<AF_IPX>\n"
8115 msgstr "B<AF_IPX>\n"
8116
8117 #. type: tbl table
8118 #: build/C/man2/socket.2:86
8119 #, no-wrap
8120 msgid "T}:IPX - Novell protocols:\n"
8121 msgstr "T}:IPX - Novell プロトコル:\n"
8122
8123 #. type: tbl table
8124 #: build/C/man2/socket.2:88
8125 #, no-wrap
8126 msgid "B<AF_NETLINK>\n"
8127 msgstr "B<AF_NETLINK>\n"
8128
8129 #. type: tbl table
8130 #: build/C/man2/socket.2:90
8131 #, no-wrap
8132 msgid "Kernel user interface device\n"
8133 msgstr "カーネル・ユーザ・デバイス\n"
8134
8135 #. type: tbl table
8136 #: build/C/man2/socket.2:92
8137 #, no-wrap
8138 msgid "B<netlink>(7)\n"
8139 msgstr "B<netlink>(7)\n"
8140
8141 #. type: tbl table
8142 #: build/C/man2/socket.2:95
8143 #, no-wrap
8144 msgid "B<AF_X25>\n"
8145 msgstr "B<AF_X25>\n"
8146
8147 #. type: tbl table
8148 #: build/C/man2/socket.2:96
8149 #, no-wrap
8150 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8151 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8152
8153 #. type: tbl table
8154 #: build/C/man2/socket.2:97
8155 #, no-wrap
8156 msgid "B<x25>(7)\n"
8157 msgstr "B<x25>(7)\n"
8158
8159 #. type: tbl table
8160 #: build/C/man2/socket.2:100
8161 #, no-wrap
8162 msgid "B<AF_AX25>\n"
8163 msgstr "B<AF_AX25>\n"
8164
8165 #. type: tbl table
8166 #: build/C/man2/socket.2:102
8167 #, no-wrap
8168 msgid "Amateur radio AX.25 protocol\n"
8169 msgstr "アマチュア無線 AX.25 プロトコル\n"
8170
8171 #. type: tbl table
8172 #: build/C/man2/socket.2:103
8173 #, no-wrap
8174 msgid "T}:\n"
8175 msgstr "T}:\n"
8176
8177 #. type: tbl table
8178 #: build/C/man2/socket.2:105
8179 #, no-wrap
8180 msgid "B<AF_ATMPVC>\n"
8181 msgstr "B<AF_ATMPVC>\n"
8182
8183 #. type: tbl table
8184 #: build/C/man2/socket.2:106
8185 #, no-wrap
8186 msgid "T}:Access to raw ATM PVCs:\n"
8187 msgstr "T}:生の ATM PVC にアクセスする:\n"
8188
8189 #. type: tbl table
8190 #: build/C/man2/socket.2:108
8191 #, no-wrap
8192 msgid "B<AF_APPLETALK>\n"
8193 msgstr "B<AF_APPLETALK>\n"
8194
8195 #. type: tbl table
8196 #: build/C/man2/socket.2:109
8197 #, no-wrap
8198 msgid "T}:Appletalk:T{\n"
8199 msgstr "T}:アップルトーク:T{\n"
8200
8201 #. type: tbl table
8202 #: build/C/man2/socket.2:110
8203 #, no-wrap
8204 msgid "B<ddp>(7)\n"
8205 msgstr "B<ddp>(7)\n"
8206
8207 #. type: tbl table
8208 #: build/C/man2/socket.2:113
8209 #, no-wrap
8210 msgid "B<AF_PACKET>\n"
8211 msgstr "B<AF_PACKET>\n"
8212
8213 #. type: tbl table
8214 #: build/C/man2/socket.2:115
8215 #, no-wrap
8216 msgid "Low level packet interface\n"
8217 msgstr "低レベルのパケットインターフェース\n"
8218
8219 #. type: tbl table
8220 #: build/C/man2/socket.2:117
8221 #, no-wrap
8222 msgid "B<packet>(7)\n"
8223 msgstr "B<packet>(7)\n"
8224
8225 #. type: Plain text
8226 #: build/C/man2/socket.2:126
8227 msgid ""
8228 "The socket has the indicated I<type>, which specifies the communication "
8229 "semantics.  Currently defined types are:"
8230 msgstr ""
8231 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8232 "る。 定義されている型は現在以下の通り。"
8233
8234 #. type: TP
8235 #: build/C/man2/socket.2:126
8236 #, no-wrap
8237 msgid "B<SOCK_STREAM>"
8238 msgstr "B<SOCK_STREAM>"
8239
8240 #. type: Plain text
8241 #: build/C/man2/socket.2:130
8242 msgid ""
8243 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8244 "out-of-band data transmission mechanism may be supported."
8245 msgstr ""
8246 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8247 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8248
8249 #. type: TP
8250 #: build/C/man2/socket.2:130
8251 #, no-wrap
8252 msgid "B<SOCK_DGRAM>"
8253 msgstr "B<SOCK_DGRAM>"
8254
8255 #. type: Plain text
8256 #: build/C/man2/socket.2:134
8257 msgid ""
8258 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8259 "length)."
8260 msgstr ""
8261 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8262 "する。"
8263
8264 #. type: TP
8265 #: build/C/man2/socket.2:134
8266 #, no-wrap
8267 msgid "B<SOCK_SEQPACKET>"
8268 msgstr "B<SOCK_SEQPACKET>"
8269
8270 #. type: Plain text
8271 #: build/C/man2/socket.2:139
8272 msgid ""
8273 "Provides a sequenced, reliable, two-way connection-based data transmission "
8274 "path for datagrams of fixed maximum length; a consumer is required to read "
8275 "an entire packet with each input system call."
8276 msgstr ""
8277 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8278 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8279 "ト全体を読み取ることが要求される。"
8280
8281 #. type: TP
8282 #: build/C/man2/socket.2:139
8283 #, no-wrap
8284 msgid "B<SOCK_RAW>"
8285 msgstr "B<SOCK_RAW>"
8286
8287 #. type: Plain text
8288 #: build/C/man2/socket.2:142
8289 msgid "Provides raw network protocol access."
8290 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8291
8292 #. type: TP
8293 #: build/C/man2/socket.2:142
8294 #, no-wrap
8295 msgid "B<SOCK_RDM>"
8296 msgstr "B<SOCK_RDM>"
8297
8298 #. type: Plain text
8299 #: build/C/man2/socket.2:145
8300 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8301 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8302
8303 #. type: TP
8304 #: build/C/man2/socket.2:145
8305 #, no-wrap
8306 msgid "B<SOCK_PACKET>"
8307 msgstr "B<SOCK_PACKET>"
8308
8309 #. type: Plain text
8310 #: build/C/man2/socket.2:150
8311 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8312 msgstr ""
8313 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8314 "こと"
8315
8316 #. type: Plain text
8317 #: build/C/man2/socket.2:152
8318 #, fuzzy
8319 #| msgid ""
8320 #| "Some socket types may not be implemented by all protocol families; for "
8321 #| "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
8322 msgid "Some socket types may not be implemented by all protocol families."
8323 msgstr ""
8324 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
8325 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
8326
8327 #. type: Plain text
8328 #: build/C/man2/socket.2:160
8329 msgid ""
8330 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8331 "addition to specifying a socket type, it may include the bitwise OR of any "
8332 "of the following values, to modify the behavior of B<socket>():"
8333 msgstr ""
8334 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8335 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8336 "ることで、 B<socket>()  の振舞いを変更することができる。"
8337
8338 #. type: Plain text
8339 #: build/C/man2/socket.2:194
8340 msgid ""
8341 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8342 "Normally only a single protocol exists to support a particular socket type "
8343 "within a given protocol family, in which case I<protocol> can be specified "
8344 "as 0.  However, it is possible that many protocols may exist, in which case "
8345 "a particular protocol must be specified in this manner.  The protocol number "
8346 "to use is specific to the ``communication domain'' in which communication is "
8347 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8348 "protocol name strings to protocol numbers."
8349 msgstr ""
8350 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8351 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8352 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8353 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8354 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8355 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8356 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8357
8358 #. type: Plain text
8359 #: build/C/man2/socket.2:224
8360 msgid ""
8361 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8362 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
8363 "a I<connected> state before any data may be sent or received on it.  A "
8364 "connection to another socket is created with a B<connect>(2)  call.  Once "
8365 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
8366 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
8367 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
8368 "also be transmitted as described in B<send>(2)  and received as described in "
8369 "B<recv>(2)."
8370 msgstr ""
8371 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8372 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8373 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8374 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
8375 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
8376 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
8377 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
8378
8379 #. type: Plain text
8380 #: build/C/man2/socket.2:250
8381 msgid ""
8382 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8383 "data is not lost or duplicated.  If a piece of data for which the peer "
8384 "protocol has buffer space cannot be successfully transmitted within a "
8385 "reasonable length of time, then the connection is considered to be dead.  "
8386 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8387 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8388 "signal is raised if a process sends or receives on a broken stream; this "
8389 "causes naive processes, which do not handle the signal, to exit.  "
8390 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8391 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8392 "amount of data requested, and any data remaining in the arriving packet will "
8393 "be discarded.  Also all message boundaries in incoming datagrams are "
8394 "preserved."
8395 msgstr ""
8396 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8397 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8398 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8399 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8400 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8401 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8402 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8403 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8404 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8405 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8406
8407 #. type: Plain text
8408 #: build/C/man2/socket.2:260
8409 msgid ""
8410 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8411 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8412 "received with B<recvfrom>(2), which returns the next datagram along with the "
8413 "address of its sender."
8414 msgstr ""
8415 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8416 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8417 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8418 "す。"
8419
8420 #. type: Plain text
8421 #: build/C/man2/socket.2:267
8422 msgid ""
8423 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8424 "from the device driver.  Use B<packet>(7)  instead."
8425 msgstr ""
8426 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8427 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8428
8429 #. type: Plain text
8430 #: build/C/man2/socket.2:290
8431 msgid ""
8432 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8433 "process group to receive a B<SIGURG> signal when the out-of-band data "
8434 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8435 "unexpectedly.  This operation may also be used to set the process or process "
8436 "group that receives the I/O and asynchronous notification of I/O events via "
8437 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8438 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8439 msgstr ""
8440 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8441 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8442 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8443 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8444 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8445 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8446 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8447
8448 #. type: Plain text
8449 #: build/C/man2/socket.2:300
8450 msgid ""
8451 "When the network signals an error condition to the protocol module (e.g., "
8452 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8453 "The next operation on this socket will return the error code of the pending "
8454 "error.  For some protocols it is possible to enable a per-socket error queue "
8455 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8456 "(7)."
8457 msgstr ""
8458 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8459 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8460 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8461 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8462 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8463 "B<IP_RECVERR> を参照すること。"
8464
8465 #. type: Plain text
8466 #: build/C/man2/socket.2:310
8467 msgid ""
8468 "The operation of sockets is controlled by socket level I<options>.  These "
8469 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8470 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8471 "respectively."
8472 msgstr ""
8473 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8474 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8475 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8476
8477 #. type: Plain text
8478 #: build/C/man2/socket.2:315
8479 msgid ""
8480 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8481 "is returned, and I<errno> is set appropriately."
8482 msgstr ""
8483 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8484 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8485
8486 #. type: Plain text
8487 #: build/C/man2/socket.2:320
8488 msgid ""
8489 "Permission to create a socket of the specified type and/or protocol is "
8490 "denied."
8491 msgstr ""
8492 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8493
8494 #. type: Plain text
8495 #: build/C/man2/socket.2:323
8496 msgid "The implementation does not support the specified address family."
8497 msgstr "指定されたアドレスファミリーがサポートされていない。"
8498
8499 #. type: Plain text
8500 #: build/C/man2/socket.2:326
8501 msgid "Unknown protocol, or protocol family not available."
8502 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8503
8504 #.  Since Linux 2.6.27
8505 #. type: Plain text
8506 #: build/C/man2/socket.2:331
8507 msgid "Invalid flags in I<type>."
8508 msgstr "I<type> に無効なフラグが指定されている。"
8509
8510 #. type: Plain text
8511 #: build/C/man2/socket.2:334
8512 msgid "Process file table overflow."
8513 msgstr "プロセスのファイルテーブルが溢れている。"
8514
8515 #. type: TP
8516 #: build/C/man2/socket.2:337
8517 #, no-wrap
8518 msgid "B<ENOBUFS> or B<ENOMEM>"
8519 msgstr "B<ENOBUFS> または B<ENOMEM>"
8520
8521 #. type: Plain text
8522 #: build/C/man2/socket.2:342
8523 msgid ""
8524 "Insufficient memory is available.  The socket cannot be created until "
8525 "sufficient resources are freed."
8526 msgstr ""
8527 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8528 "ない。"
8529
8530 #. type: TP
8531 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8532 #, no-wrap
8533 msgid "B<EPROTONOSUPPORT>"
8534 msgstr "B<EPROTONOSUPPORT>"
8535
8536 #. type: Plain text
8537 #: build/C/man2/socket.2:346
8538 msgid ""
8539 "The protocol type or the specified protocol is not supported within this "
8540 "domain."
8541 msgstr ""
8542 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8543 "いない。"
8544
8545 #. type: Plain text
8546 #: build/C/man2/socket.2:348
8547 msgid "Other errors may be generated by the underlying protocol modules."
8548 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8549
8550 #. type: Plain text
8551 #: build/C/man2/socket.2:350
8552 msgid "4.4BSD, POSIX.1-2001."
8553 msgstr "4.4BSD, POSIX.1-2001."
8554
8555 #. type: Plain text
8556 #: build/C/man2/socket.2:356
8557 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8558 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8559
8560 #. type: Plain text
8561 #: build/C/man2/socket.2:362
8562 msgid ""
8563 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8564 "systems supporting clones of the BSD socket layer (including System V "
8565 "variants)."
8566 msgstr ""
8567 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8568 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8569 "外のシステムからの移植ができる。"
8570
8571 #. type: Plain text
8572 #: build/C/man2/socket.2:381
8573 msgid ""
8574 "The manifest constants used under 4.x BSD for protocol families are "
8575 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8576 "are used for address families.  However, already the BSD man page promises: "
8577 "\"The protocol family generally is the same as the address family\", and "
8578 "subsequent standards use AF_* everywhere."
8579 msgstr ""
8580 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8581 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8582 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8583 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8584 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8585 "それ以外の規格では全ての場所で AF_* が使用されている。"
8586
8587 #. type: Plain text
8588 #: build/C/man2/socket.2:386
8589 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8590 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8591
8592 #. type: Plain text
8593 #: build/C/man2/socket.2:409
8594 msgid ""
8595 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8596 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8597 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8598 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8599 "(7), B<unix>(7)"
8600 msgstr ""
8601 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8602 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8603 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8604 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8605 "(7), B<unix>(7)"
8606
8607 #. type: Plain text
8608 #: build/C/man2/socket.2:415
8609 msgid ""
8610 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8611 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8612 "Programmer's Supplementary Documents Volume 1.>"
8613 msgstr ""
8614 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8615 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8616 "Supplementary Documents Volume 1.> として再版された)"
8617
8618 #. type: TH
8619 #: build/C/man7/socket.7:56
8620 #, no-wrap
8621 msgid "2014-02-21"
8622 msgstr ""
8623
8624 #. type: Plain text
8625 #: build/C/man7/socket.7:59
8626 msgid "socket - Linux socket interface"
8627 msgstr "socket - Linux のソケットインターフェース"
8628
8629 #. type: Plain text
8630 #: build/C/man7/socket.7:63
8631 msgid ""
8632 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8633 ">I<protocol>B<);>"
8634 msgstr ""
8635 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8636 ">I<protocol>B<);>"
8637
8638 #. type: Plain text
8639 #: build/C/man7/socket.7:82
8640 #, fuzzy
8641 #| msgid ""
8642 #| "This manual page describes the Linux networking socket layer user "
8643 #| "interface.  The BSD compatible sockets are the uniform interface between "
8644 #| "the user process and the network protocol stacks in the kernel.  The "
8645 #| "protocol modules are grouped into I<protocol families> like B<AF_INET>, "
8646 #| "B<AF_IPX>, B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or "
8647 #| "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and "
8648 #| "types."
8649 msgid ""
8650 "This manual page describes the Linux networking socket layer user "
8651 "interface.  The BSD compatible sockets are the uniform interface between the "
8652 "user process and the network protocol stacks in the kernel.  The protocol "
8653 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8654 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8655 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8656 msgstr ""
8657 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8658 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8659 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8660 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8661 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8662 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8663 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8664
8665 #. type: SS
8666 #: build/C/man7/socket.7:82
8667 #, no-wrap
8668 msgid "Socket-layer functions"
8669 msgstr "ソケット層の関数群"
8670
8671 #. type: Plain text
8672 #: build/C/man7/socket.7:86
8673 msgid ""
8674 "These functions are used by the user process to send or receive packets and "
8675 "to do other socket operations.  For more information see their respective "
8676 "manual pages."
8677 msgstr ""
8678 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8679 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8680
8681 #. type: Plain text
8682 #: build/C/man7/socket.7:102
8683 msgid ""
8684 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8685 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8686 "address, B<listen>(2)  tells the socket that new connections shall be "
8687 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8688 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8689 "(implemented only for a few local families like B<AF_UNIX>)"
8690 msgstr ""
8691 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8692 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8693 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8694 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8695 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8696 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8697 "リーでしか実装されていない)。"
8698
8699 #. type: Plain text
8700 #: build/C/man7/socket.7:124
8701 msgid ""
8702 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8703 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8704 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8705 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8706 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8707 "write data."
8708 msgstr ""
8709 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8710 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8711 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8712 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8713 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8714 "ことができる。"
8715
8716 #. type: Plain text
8717 #: build/C/man7/socket.7:135
8718 msgid ""
8719 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8720 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8721 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8722 "be used to set or read some other options."
8723 msgstr ""
8724 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8725 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8726 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8727 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8728
8729 #. type: Plain text
8730 #: build/C/man7/socket.7:140
8731 msgid ""
8732 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8733 "full-duplex socket connection."
8734 msgstr ""
8735 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8736 "続を部分的にクローズする。"
8737
8738 #. type: Plain text
8739 #: build/C/man7/socket.7:146
8740 msgid ""
8741 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8742 "not supported on sockets."
8743 msgstr ""
8744 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8745 "ではサポートされていない。"
8746
8747 #. type: Plain text
8748 #: build/C/man7/socket.7:163
8749 msgid ""
8750 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8751 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8752 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8753 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8754 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8755 msgstr ""
8756 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8757 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8758 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8759 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8760 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8761 "B<select>(2)  を使って待つことができる。"
8762
8763 #. type: tbl table
8764 #: build/C/man7/socket.7:167
8765 #, no-wrap
8766 msgid "I/O events\n"
8767 msgstr "I/O イベント\n"
8768
8769 #. type: tbl table
8770 #: build/C/man7/socket.7:168
8771 #, no-wrap
8772 msgid "Event:Poll flag:Occurrence\n"
8773 msgstr "イベント:poll フラグ:内容\n"
8774
8775 #. type: tbl table
8776 #: build/C/man7/socket.7:169 build/C/man7/socket.7:172
8777 #, no-wrap
8778 msgid "Read:POLLIN:T{\n"
8779 msgstr "Read:POLLIN:T{\n"
8780
8781 #. type: tbl table
8782 #: build/C/man7/socket.7:170
8783 #, no-wrap
8784 msgid "New data arrived.\n"
8785 msgstr "新しいデータが到着した。\n"
8786
8787 #. type: tbl table
8788 #: build/C/man7/socket.7:173
8789 #, no-wrap
8790 msgid "A connection setup has been completed\n"
8791 msgstr "(接続志向のソケットで)\n"
8792
8793 #. type: tbl table
8794 #: build/C/man7/socket.7:174
8795 #, no-wrap
8796 msgid "(for connection-oriented sockets)\n"
8797 msgstr "接続の設定が終了した。\n"
8798
8799 #. type: tbl table
8800 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
8801 #, no-wrap
8802 msgid "Read:POLLHUP:T{\n"
8803 msgstr "Read:POLLHUP:T{\n"
8804
8805 #. type: tbl table
8806 #: build/C/man7/socket.7:177
8807 #, no-wrap
8808 msgid "A disconnection request has been initiated by the other end.\n"
8809 msgstr "接続先で切断要求が生成された。\n"
8810
8811 #. type: tbl table
8812 #: build/C/man7/socket.7:180
8813 #, no-wrap
8814 msgid "A connection is broken (only for connection-oriented protocols).\n"
8815 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8816
8817 #. type: tbl table
8818 #: build/C/man7/socket.7:181
8819 #, no-wrap
8820 msgid "When the socket is written\n"
8821 msgstr "この場合、ソケットに書き込みが行われると\n"
8822
8823 #. type: tbl table
8824 #: build/C/man7/socket.7:182
8825 #, no-wrap
8826 msgid "B<SIGPIPE>\n"
8827 msgstr "B<SIGPIPE>\n"
8828
8829 #. type: tbl table
8830 #: build/C/man7/socket.7:183
8831 #, no-wrap
8832 msgid "is also sent.\n"
8833 msgstr "も送信される。\n"
8834
8835 #. type: tbl table
8836 #: build/C/man7/socket.7:185
8837 #, no-wrap
8838 msgid "Write:POLLOUT:T{\n"
8839 msgstr "Write:POLLOUT:T{\n"
8840
8841 #. type: tbl table
8842 #: build/C/man7/socket.7:186
8843 #, no-wrap
8844 msgid "Socket has enough send buffer space for writing new data.\n"
8845 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8846
8847 #. type: tbl table
8848 #: build/C/man7/socket.7:188
8849 #, no-wrap
8850 msgid "Read/Write:T{\n"
8851 msgstr "Read/Write:T{\n"
8852
8853 #. type: tbl table
8854 #: build/C/man7/socket.7:189
8855 #, no-wrap
8856 msgid "POLLIN|\n"
8857 msgstr "POLLIN|\n"
8858
8859 #. type: tbl table
8860 #: build/C/man7/socket.7:190
8861 #, no-wrap
8862 msgid ".br\n"
8863 msgstr ".br\n"
8864
8865 #. type: tbl table
8866 #: build/C/man7/socket.7:191
8867 #, no-wrap
8868 msgid "POLLOUT\n"
8869 msgstr "POLLOUT\n"
8870
8871 #. type: tbl table
8872 #: build/C/man7/socket.7:193
8873 #, no-wrap
8874 msgid "An outgoing\n"
8875 msgstr "外部向けの\n"
8876
8877 #. type: tbl table
8878 #: build/C/man7/socket.7:194
8879 #, no-wrap
8880 msgid "B<connect>(2)\n"
8881 msgstr "B<connect>(2)\n"
8882
8883 #. type: tbl table
8884 #: build/C/man7/socket.7:195
8885 #, no-wrap
8886 msgid "finished.\n"
8887 msgstr "が終了した。\n"
8888
8889 #. type: tbl table
8890 #: build/C/man7/socket.7:197
8891 #, no-wrap
8892 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8893 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8894
8895 #. type: tbl table
8896 #: build/C/man7/socket.7:198
8897 #, no-wrap
8898 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8899 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8900
8901 #. type: tbl table
8902 #: build/C/man7/socket.7:199
8903 #, no-wrap
8904 msgid "Exception:POLLPRI:T{\n"
8905 msgstr "Exception:POLLPRI:T{\n"
8906
8907 #. type: tbl table
8908 #: build/C/man7/socket.7:200
8909 #, no-wrap
8910 msgid "Urgent data arrived.\n"
8911 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8912
8913 #. type: tbl table
8914 #: build/C/man7/socket.7:201
8915 #, no-wrap
8916 msgid "B<SIGURG>\n"
8917 msgstr "B<SIGURG>\n"
8918
8919 #. type: tbl table
8920 #: build/C/man7/socket.7:202
8921 #, no-wrap
8922 msgid "is sent then.\n"
8923 msgstr "が送信される。\n"
8924
8925 #. type: Plain text
8926 #: build/C/man7/socket.7:231
8927 msgid ""
8928 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8929 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8930 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8931 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8932 "I<Signals> discussion below."
8933 msgstr ""
8934 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8935 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8936 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8937 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8938 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8939 "と。"
8940
8941 #. type: SS
8942 #: build/C/man7/socket.7:231
8943 #, no-wrap
8944 msgid "Socket address structures"
8945 msgstr "ソケットアドレス構造体"
8946
8947 #. type: Plain text
8948 #: build/C/man7/socket.7:247
8949 msgid ""
8950 "Each socket domain has its own format for socket addresses, with a domain-"
8951 "specific address structure.  Each of these structures begins with an integer "
8952 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8953 "address structure.  This allows the various system calls (e.g., B<connect>"
8954 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8955 "are generic to all socket domains, to determine the domain of a particular "
8956 "socket address."
8957 msgstr ""
8958 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8959 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8960 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8961 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8962 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8963 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8964 "できる。"
8965
8966 #. type: Plain text
8967 #: build/C/man7/socket.7:257
8968 msgid ""
8969 "To allow any type of socket address to be passed to interfaces in the "
8970 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8971 "type is purely to allow casting of domain-specific socket address types to a "
8972 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8973 "calls to the sockets API."
8974 msgstr ""
8975 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8976 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8977 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8978 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8979 "告を出すのを避けることができる。"
8980
8981 #. type: Plain text
8982 #: build/C/man7/socket.7:267
8983 msgid ""
8984 "In addition, the sockets API provides the data type I<struct "
8985 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8986 "domain-specific socket address structures; it is large enough and is aligned "
8987 "properly.  (In particular, it is large enough to hold IPv6 socket "
8988 "addresses.)  The structure includes the following field, which can be used "
8989 "to identify the type of socket address actually stored in the structure:"
8990 msgstr ""
8991 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8992 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8993 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8994 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8995 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8996 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8997 "できる。"
8998
8999 #. type: Plain text
9000 #: build/C/man7/socket.7:271
9001 #, no-wrap
9002 msgid "    sa_family_t ss_family;\n"
9003 msgstr "    sa_family_t ss_family;\n"
9004
9005 #. type: Plain text
9006 #: build/C/man7/socket.7:279
9007 msgid ""
9008 "The I<sockaddr_storage> structure is useful in programs that must handle "
9009 "socket addresses in a generic way (e.g., programs that must deal with both "
9010 "IPv4 and IPv6 socket addresses)."
9011 msgstr ""
9012 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
9013 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
9014 "ログラム) で有用である。"
9015
9016 #. type: SS
9017 #: build/C/man7/socket.7:279
9018 #, no-wrap
9019 msgid "Socket options"
9020 msgstr "ソケットオプション"
9021
9022 #.  FIXME
9023 #.  In the list below, the text used to describe argument types
9024 #.  for each socket option should be more consistent
9025 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
9026 #.  W R Stevens, UNPv1
9027 #. type: Plain text
9028 #: build/C/man7/socket.7:297
9029 msgid ""
9030 "The socket options listed below can be set by using B<setsockopt>(2)  and "
9031 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
9032 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
9033 msgstr ""
9034 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
9035 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
9036 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
9037 "I<int> へのポインタである。"
9038
9039 #. type: TP
9040 #: build/C/man7/socket.7:297
9041 #, no-wrap
9042 msgid "B<SO_ACCEPTCONN>"
9043 msgstr "B<SO_ACCEPTCONN>"
9044
9045 #. type: Plain text
9046 #: build/C/man7/socket.7:305
9047 msgid ""
9048 "Returns a value indicating whether or not this socket has been marked to "
9049 "accept connections with B<listen>(2).  The value 0 indicates that this is "
9050 "not a listening socket, the value 1 indicates that this is a listening "
9051 "socket.  This socket option is read-only."
9052 msgstr ""
9053 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
9054 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9055 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9056
9057 #. type: TP
9058 #: build/C/man7/socket.7:305
9059 #, no-wrap
9060 msgid "B<SO_BINDTODEVICE>"
9061 msgstr "B<SO_BINDTODEVICE>"
9062
9063 #. type: Plain text
9064 #: build/C/man7/socket.7:324
9065 msgid ""
9066 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9067 "the passed interface name.  If the name is an empty string or the option "
9068 "length is zero, the socket device binding is removed.  The passed option is "
9069 "a variable-length null-terminated interface name string with the maximum "
9070 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
9071 "received from that particular interface are processed by the socket.  Note "
9072 "that this works only for some socket types, particularly B<AF_INET> "
9073 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
9074 "there)."
9075 msgstr ""
9076 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9077 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9078 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9079 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9080 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9081 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9082 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9083 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9084 "B<bind>(2) を使うこと)。"
9085
9086 #. type: Plain text
9087 #: build/C/man7/socket.7:338
9088 msgid ""
9089 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9090 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
9091 "argument should contain the buffer size available to receive the device name "
9092 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
9093 "reported back in the I<optlen> argument."
9094 msgstr ""
9095 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9096 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9097 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9098 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
9099 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9100
9101 #. type: TP
9102 #: build/C/man7/socket.7:338
9103 #, no-wrap
9104 msgid "B<SO_BROADCAST>"
9105 msgstr "B<SO_BROADCAST>"
9106
9107 #. type: Plain text
9108 #: build/C/man7/socket.7:344
9109 msgid ""
9110 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
9111 "to send packets to a broadcast address.  This option has no effect on stream-"
9112 "oriented sockets."
9113 msgstr ""
9114 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9115 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9116 "ストリーム指向のソケットには何の効果もない。"
9117
9118 #. type: TP
9119 #: build/C/man7/socket.7:344
9120 #, no-wrap
9121 msgid "B<SO_BSDCOMPAT>"
9122 msgstr "B<SO_BSDCOMPAT>"
9123
9124 #. type: Plain text
9125 #: build/C/man7/socket.7:356
9126 msgid ""
9127 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
9128 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
9129 "socket will not be passed to the user program.  In later kernel versions, "
9130 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9131 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9132 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9133 "header changing, skipping of the broadcast flag) for raw sockets with this "
9134 "option, but that was removed in Linux 2.2."
9135 msgstr ""
9136 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9137 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9138 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
9139 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
9140 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
9141 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
9142 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
9143 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
9144 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
9145
9146 #. type: TP
9147 #: build/C/man7/socket.7:356
9148 #, no-wrap
9149 msgid "B<SO_DEBUG>"
9150 msgstr "B<SO_DEBUG>"
9151
9152 #. type: Plain text
9153 #: build/C/man7/socket.7:362
9154 msgid ""
9155 "Enable socket debugging.  Only allowed for processes with the "
9156 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9157 msgstr ""
9158 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9159 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9160
9161 #. type: TP
9162 #: build/C/man7/socket.7:362
9163 #, no-wrap
9164 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9165 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9166
9167 #. type: Plain text
9168 #: build/C/man7/socket.7:370
9169 msgid ""
9170 "Retrieves the socket domain as an integer, returning a value such as "
9171 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9172 "only."
9173 msgstr ""
9174 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9175 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9176
9177 #. type: TP
9178 #: build/C/man7/socket.7:370
9179 #, no-wrap
9180 msgid "B<SO_ERROR>"
9181 msgstr "B<SO_ERROR>"
9182
9183 #. type: Plain text
9184 #: build/C/man7/socket.7:375
9185 msgid ""
9186 "Get and clear the pending socket error.  This socket option is read-only.  "
9187 "Expects an integer."
9188 msgstr ""
9189 "保留になっていたソケットエラーを取得してクリアする。\n"
9190 "このソケットオプションは読み込み専用である。整数値をとる。"
9191
9192 #. type: TP
9193 #: build/C/man7/socket.7:375
9194 #, no-wrap
9195 msgid "B<SO_DONTROUTE>"
9196 msgstr "B<SO_DONTROUTE>"
9197
9198 #. type: Plain text
9199 #: build/C/man7/socket.7:384
9200 msgid ""
9201 "Don't send via a gateway, send only to directly connected hosts.  The same "
9202 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9203 "B<send>(2)  operation.  Expects an integer boolean flag."
9204 msgstr ""
9205 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9206 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9207 "数のフラグを取る。"
9208
9209 #. type: TP
9210 #: build/C/man7/socket.7:384
9211 #, no-wrap
9212 msgid "B<SO_KEEPALIVE>"
9213 msgstr "B<SO_KEEPALIVE>"
9214
9215 #. type: Plain text
9216 #: build/C/man7/socket.7:388
9217 msgid ""
9218 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9219 "Expects an integer boolean flag."
9220 msgstr ""
9221 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9222 "の整数フラグをとる。"
9223
9224 #. type: TP
9225 #: build/C/man7/socket.7:388
9226 #, no-wrap
9227 msgid "B<SO_LINGER>"
9228 msgstr "B<SO_LINGER>"
9229
9230 #. type: Plain text
9231 #: build/C/man7/socket.7:396
9232 msgid ""
9233 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9234 msgstr ""
9235 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9236
9237 #. type: Plain text
9238 #: build/C/man7/socket.7:403
9239 #, no-wrap
9240 msgid ""
9241 "struct linger {\n"
9242 "    int l_onoff;    /* linger active */\n"
9243 "    int l_linger;   /* how many seconds to linger for */\n"
9244 "};\n"
9245 msgstr ""
9246 "struct linger {\n"
9247 "    int l_onoff;    /* linger active */\n"
9248 "    int l_linger;   /* how many seconds to linger for */\n"
9249 "};\n"
9250
9251 #. type: Plain text
9252 #: build/C/man7/socket.7:417
9253 msgid ""
9254 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9255 "queued messages for the socket have been successfully sent or the linger "
9256 "timeout has been reached.  Otherwise, the call returns immediately and the "
9257 "closing is done in the background.  When the socket is closed as part of "
9258 "B<exit>(2), it always lingers in the background."
9259 msgstr ""
9260 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9261 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9262 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9263 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9264 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9265 "送られる。"
9266
9267 #. type: TP
9268 #: build/C/man7/socket.7:417
9269 #, no-wrap
9270 msgid "B<SO_MARK> (since Linux 2.6.25)"
9271 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9272
9273 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9274 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9275 #. type: Plain text
9276 #: build/C/man7/socket.7:428
9277 msgid ""
9278 "Set the mark for each packet sent through this socket (similar to the "
9279 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9280 "mark-based routing without netfilter or for packet filtering.  Setting this "
9281 "option requires the B<CAP_NET_ADMIN> capability."
9282 msgstr ""
9283 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9284 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9285 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9286 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9287 "ティが必要である。"
9288
9289 #. type: TP
9290 #: build/C/man7/socket.7:428
9291 #, no-wrap
9292 msgid "B<SO_OOBINLINE>"
9293 msgstr "B<SO_OOBINLINE>"
9294
9295 #.  don't document it because it can do too much harm.
9296 #. .B SO_NO_CHECK
9297 #. type: Plain text
9298 #: build/C/man7/socket.7:437
9299 msgid ""
9300 "If this option is enabled, out-of-band data is directly placed into the "
9301 "receive data stream.  Otherwise out-of-band data is passed only when the "
9302 "B<MSG_OOB> flag is set during receiving."
9303 msgstr ""
9304 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9305 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9306 "ラグがセットされている場合に限って渡される。"
9307
9308 #. type: TP
9309 #: build/C/man7/socket.7:437
9310 #, no-wrap
9311 msgid "B<SO_PASSCRED>"
9312 msgstr "B<SO_PASSCRED>"
9313
9314 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9315 #.  in the 2.6.18 ChangeLog
9316 #. type: Plain text
9317 #: build/C/man7/socket.7:446
9318 msgid ""
9319 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9320 "For more information see B<unix>(7)."
9321 msgstr ""
9322 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9323 "を参照のこと。"
9324
9325 #. type: TP
9326 #: build/C/man7/socket.7:446
9327 #, no-wrap
9328 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9329 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9330
9331 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9332 #. type: Plain text
9333 #: build/C/man7/socket.7:456
9334 #, fuzzy
9335 #| msgid ""
9336 #| "This option, which is currently supported only for B<unix>(7)  sockets, "
9337 #| "sets the value of the \"peek offset\" for the B<recv(2)> system call when "
9338 #| "used with B<MSG_PEEK> flag."
9339 msgid ""
9340 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9341 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9342 "with B<MSG_PEEK> flag."
9343 msgstr ""
9344 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9345 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9346 "B<unix>(7) ソケットでのみサポートされている。"
9347
9348 #. type: Plain text
9349 #: build/C/man7/socket.7:464
9350 #, fuzzy
9351 #| msgid ""
9352 #| "When this option is set to a negative value (it is set to -1 for all new "
9353 #| "sockets), traditional behavior is provided: B<recv(2)> with the "
9354 #| "B<MSG_PEEK> flag will peek data from the front of the queue."
9355 msgid ""
9356 "When this option is set to a negative value (it is set to -1 for all new "
9357 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9358 "flag will peek data from the front of the queue."
9359 msgstr ""
9360 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9361 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9362 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9363 "のソケットではこのオプションの値は必ず -1 に設定される。"
9364
9365 #. type: Plain text
9366 #: build/C/man7/socket.7:471
9367 msgid ""
9368 "When the option is set to a value greater than or equal to zero, then the "
9369 "next peek at data queued in the socket will occur at the byte offset "
9370 "specified by the option value.  At the same time, the \"peek offset\" will "
9371 "be incremented by the number of bytes that were peeked from the queue, so "
9372 "that a subsequent peek will return the next data in the queue."
9373 msgstr ""
9374 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9375 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9376 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9377 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9378
9379 #. type: Plain text
9380 #: build/C/man7/socket.7:483
9381 msgid ""
9382 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9383 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9384 "by the number of bytes removed.  In other words, receiving data without the "
9385 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9386 "the correct relative position in the queued data, so that a subsequent peek "
9387 "will retrieve the data that would have been retrieved had the data not been "
9388 "removed."
9389 msgstr ""
9390 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9391 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9392 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9393 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9394 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9395 "いうことである。"
9396
9397 #. type: Plain text
9398 #: build/C/man7/socket.7:488
9399 msgid ""
9400 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9401 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9402 msgstr ""
9403 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9404 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9405
9406 #. type: Plain text
9407 #: build/C/man7/socket.7:492
9408 msgid ""
9409 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9410 "Suppose a stream socket has the following queued input data:"
9411 msgstr ""
9412 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9413 "以下の入力データが入っているものとする。"
9414
9415 #. type: Plain text
9416 #: build/C/man7/socket.7:494
9417 #, no-wrap
9418 msgid "    aabbccddeeff\n"
9419 msgstr "    aabbccddeeff\n"
9420
9421 #. type: Plain text
9422 #: build/C/man7/socket.7:499
9423 msgid ""
9424 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9425 "the comments:"
9426 msgstr ""
9427 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9428
9429 #. type: Plain text
9430 #: build/C/man7/socket.7:504
9431 #, no-wrap
9432 msgid ""
9433 "int ov = 4;                  // Set peek offset to 4\n"
9434 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9435 msgstr ""
9436 "int ov = 4;                  // Set peek offset to 4\n"
9437 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9438
9439 #. type: Plain text
9440 #: build/C/man7/socket.7:509
9441 #, no-wrap
9442 msgid ""
9443 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9444 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9445 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9446 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9447 msgstr ""
9448 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9449 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9450 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9451 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9452
9453 #. type: TP
9454 #: build/C/man7/socket.7:511
9455 #, no-wrap
9456 msgid "B<SO_PEERCRED>"
9457 msgstr "B<SO_PEERCRED>"
9458
9459 #. type: Plain text
9460 #: build/C/man7/socket.7:534
9461 msgid ""
9462 "Return the credentials of the foreign process connected to this socket.  "
9463 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9464 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
9465 "(7).  The returned credentials are those that were in effect at the time of "
9466 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
9467 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
9468 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
9469 "option is read-only."
9470 msgstr ""
9471 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9472 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9473 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9474 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9475 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9476 "る。引き数は I<ucred> 構造体である。このソケットオプションは読み込み専用であ"
9477 "る。"
9478
9479 #. type: TP
9480 #: build/C/man7/socket.7:534
9481 #, no-wrap
9482 msgid "B<SO_PRIORITY>"
9483 msgstr "B<SO_PRIORITY>"
9484
9485 #. type: Plain text
9486 #: build/C/man7/socket.7:547
9487 msgid ""
9488 "Set the protocol-defined priority for all packets to be sent on this "
9489 "socket.  Linux uses this value to order the networking queues: packets with "
9490 "a higher priority may be processed first depending on the selected device "
9491 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9492 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9493 "6 requires the B<CAP_NET_ADMIN> capability."
9494 msgstr ""
9495 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9496 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9497 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9498 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9499 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9500 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9501
9502 #. type: TP
9503 #: build/C/man7/socket.7:547
9504 #, no-wrap
9505 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9506 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9507
9508 #. type: Plain text
9509 #: build/C/man7/socket.7:555
9510 msgid ""
9511 "Retrieves the socket protocol as an integer, returning a value such as "
9512 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9513 "only."
9514 msgstr ""
9515 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9516 "る。\n"
9517 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9518
9519 #. type: TP
9520 #: build/C/man7/socket.7:555
9521 #, no-wrap
9522 msgid "B<SO_RCVBUF>"
9523 msgstr "B<SO_RCVBUF>"
9524
9525 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9526 #.  The following thread on LMKL is quite informative:
9527 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9528 #.  17 July 2012
9529 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9530 #. type: Plain text
9531 #: build/C/man7/socket.7:574
9532 msgid ""
9533 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9534 "this value (to allow space for bookkeeping overhead)  when it is set using "
9535 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9536 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9537 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9538 "file.  The minimum (doubled) value for this option is 256."
9539 msgstr ""
9540 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9541 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9542 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9543 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9544 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9545 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9546
9547 #. type: TP
9548 #: build/C/man7/socket.7:574
9549 #, no-wrap
9550 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9551 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9552
9553 #. type: Plain text
9554 #: build/C/man7/socket.7:583
9555 msgid ""
9556 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9557 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9558 "overridden."
9559 msgstr ""
9560 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9561 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9562 "きすることができる。"
9563
9564 #. type: TP
9565 #: build/C/man7/socket.7:583
9566 #, no-wrap
9567 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9568 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9569
9570 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9571 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9572 #. type: Plain text
9573 #: build/C/man7/socket.7:612
9574 msgid ""
9575 "Specify the minimum number of bytes in the buffer until the socket layer "
9576 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9577 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9578 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9579 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9580 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9581 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9582 "single byte of data is available.  A subsequent read from the socket will "
9583 "block until B<SO_RCVLOWAT> bytes are available."
9584 msgstr ""
9585 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9586 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9587 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9588 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9589 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9590 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9591 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9592 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9593 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9594 "してしまう。"
9595
9596 #. type: TP
9597 #: build/C/man7/socket.7:612
9598 #, no-wrap
9599 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9600 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9601
9602 #.  Not implemented in 2.0.
9603 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9604 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9605 #.  in fact to EAGAIN
9606 #. type: Plain text
9607 #: build/C/man7/socket.7:647
9608 msgid ""
9609 "Specify the receiving or sending timeouts until reporting an error.  The "
9610 "argument is a I<struct timeval>.  If an input or output function blocks for "
9611 "this period of time, and data has been sent or received, the return value of "
9612 "that function will be the amount of data transferred; if no data has been "
9613 "transferred and the timeout has been reached then -1 is returned with "
9614 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9615 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9616 "the timeout is set to zero (the default)  then the operation will never "
9617 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9618 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9619 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9620 msgstr ""
9621 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9622 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9623 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9624 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9625 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>"
9626 "(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見"
9627 "える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタ"
9628 "イムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行す"
9629 "るシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), "
9630 "B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), B<epoll_wait>(2)  などには"
9631 "タイムアウトは影響を及ぼさない。"
9632
9633 #. type: TP
9634 #: build/C/man7/socket.7:647
9635 #, no-wrap
9636 msgid "B<SO_REUSEADDR>"
9637 msgstr "B<SO_REUSEADDR>"
9638
9639 #. type: Plain text
9640 #: build/C/man7/socket.7:662
9641 msgid ""
9642 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9643 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9644 "this means that a socket may bind, except when there is an active listening "
9645 "socket bound to the address.  When the listening socket is bound to "
9646 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9647 "port for any local address.  Argument is an integer boolean flag."
9648 msgstr ""
9649 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9650 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9651 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9652 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9653 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9654 "ドできない。 引き数はブール整数のフラグである。"
9655
9656 #. type: TP
9657 #: build/C/man7/socket.7:662
9658 #, fuzzy, no-wrap
9659 #| msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9660 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9661 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9662
9663 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9664 #. type: Plain text
9665 #: build/C/man7/socket.7:669
9666 msgid ""
9667 "Indicates that an unsigned 32-bit value ancilliary msg (cmsg)  should be "
9668 "attached to received skbs indicating the number of packets dropped by the "
9669 "socket between the last received packet and this received packet"
9670 msgstr ""
9671
9672 #. type: TP
9673 #: build/C/man7/socket.7:669
9674 #, no-wrap
9675 msgid "B<SO_SNDBUF>"
9676 msgstr "B<SO_SNDBUF>"
9677
9678 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9679 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9680 #. type: Plain text
9681 #: build/C/man7/socket.7:685
9682 msgid ""
9683 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9684 "this value (to allow space for bookkeeping overhead)  when it is set using "
9685 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9686 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9687 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9688 "file.  The minimum (doubled) value for this option is 2048."
9689 msgstr ""
9690 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9691 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9692 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9693 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9694 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9695 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9696
9697 #. type: TP
9698 #: build/C/man7/socket.7:685
9699 #, no-wrap
9700 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9701 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9702
9703 #. type: Plain text
9704 #: build/C/man7/socket.7:694
9705 msgid ""
9706 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9707 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9708 "overridden."
9709 msgstr ""
9710 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9711 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9712 "きすることができる。"
9713
9714 #. type: TP
9715 #: build/C/man7/socket.7:694
9716 #, no-wrap
9717 msgid "B<SO_TIMESTAMP>"
9718 msgstr "B<SO_TIMESTAMP>"
9719
9720 #. type: Plain text
9721 #: build/C/man7/socket.7:710
9722 msgid ""
9723 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9724 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9725 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9726 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9727 "details on control messages."
9728 msgstr ""
9729 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9730 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9731 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9732 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9733
9734 #. type: TP
9735 #: build/C/man7/socket.7:710
9736 #, no-wrap
9737 msgid "B<SO_TYPE>"
9738 msgstr "B<SO_TYPE>"
9739
9740 #. type: Plain text
9741 #: build/C/man7/socket.7:715
9742 msgid ""
9743 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9744 "option is read-only."
9745 msgstr ""
9746 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9747 "このソケットオプションは読み出し専用である。"
9748
9749 #. type: TP
9750 #: build/C/man7/socket.7:715
9751 #, fuzzy, no-wrap
9752 #| msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9753 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9754 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9755
9756 #. type: Plain text
9757 #: build/C/man7/socket.7:724
9758 msgid ""
9759 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9760 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9761 "The default for this option is controlled by the I</proc/sys/net/core/"
9762 "busy_read> file."
9763 msgstr ""
9764
9765 #. type: Plain text
9766 #: build/C/man7/socket.7:734
9767 msgid ""
9768 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9769 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9770 "with B<SO_BUSY_POLL> set and no events to report are found."
9771 msgstr ""
9772
9773 #. type: Plain text
9774 #: build/C/man7/socket.7:738
9775 msgid ""
9776 "In both cases, busy polling will only be done when the socket last received "
9777 "data from a network device that supports this option."
9778 msgstr ""
9779
9780 #. type: Plain text
9781 #: build/C/man7/socket.7:742
9782 msgid ""
9783 "While busy polling may improve latency of some applications, care must be "
9784 "taken when using it since this will increase both CPU utilization and power "
9785 "usage."
9786 msgstr ""
9787
9788 #. type: SS
9789 #: build/C/man7/socket.7:742
9790 #, no-wrap
9791 msgid "Signals"
9792 msgstr "シグナル"
9793
9794 #. type: Plain text
9795 #: build/C/man7/socket.7:753
9796 msgid ""
9797 "When writing onto a connection-oriented socket that has been shut down (by "
9798 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9799 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9800 "the B<MSG_NOSIGNAL> flag."
9801 msgstr ""
9802 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9803 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9804 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9805 "していた場合はシグナルは送られない。"
9806
9807 #. type: Plain text
9808 #: build/C/man7/socket.7:778
9809 msgid ""
9810 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9811 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9812 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9813 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9814 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9815 "signal will be called with the file descriptor in the I<si_fd> field of its "
9816 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9817 msgstr ""
9818 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9819 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9820 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9821 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9822 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9823 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9824 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9825 "を参照のこと。"
9826
9827 #.  .SS Ancillary messages
9828 #. type: Plain text
9829 #: build/C/man7/socket.7:786
9830 msgid ""
9831 "Under some circumstances (e.g., multiple processes accessing a single "
9832 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9833 "when the process reacts to the signal.  If this happens, the process should "
9834 "wait again because Linux will resend the signal later."
9835 msgstr ""
9836 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9837 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9838 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9839 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9840
9841 #. type: SS
9842 #: build/C/man7/socket.7:786
9843 #, no-wrap
9844 msgid "/proc interfaces"
9845 msgstr "/proc インタフェース"
9846
9847 #. type: Plain text
9848 #: build/C/man7/socket.7:790
9849 msgid ""
9850 "The core socket networking parameters can be accessed via files in the "
9851 "directory I</proc/sys/net/core/>."
9852 msgstr ""
9853 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9854 "レクトリ内のファイルを通してアクセスできる。"
9855
9856 #. type: TP
9857 #: build/C/man7/socket.7:790
9858 #, no-wrap
9859 msgid "I<rmem_default>"
9860 msgstr "I<rmem_default>"
9861
9862 #. type: Plain text
9863 #: build/C/man7/socket.7:793
9864 msgid "contains the default setting in bytes of the socket receive buffer."
9865 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9866
9867 #. type: TP
9868 #: build/C/man7/socket.7:793
9869 #, no-wrap
9870 msgid "I<rmem_max>"
9871 msgstr "I<rmem_max>"
9872
9873 #. type: Plain text
9874 #: build/C/man7/socket.7:799
9875 msgid ""
9876 "contains the maximum socket receive buffer size in bytes which a user may "
9877 "set by using the B<SO_RCVBUF> socket option."
9878 msgstr ""
9879 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9880 "ファサイズの最大値 (バイト単位)。"
9881
9882 #. type: TP
9883 #: build/C/man7/socket.7:799
9884 #, no-wrap
9885 msgid "I<wmem_default>"
9886 msgstr "I<wmem_default>"
9887
9888 #. type: Plain text
9889 #: build/C/man7/socket.7:802
9890 msgid "contains the default setting in bytes of the socket send buffer."
9891 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9892
9893 #. type: TP
9894 #: build/C/man7/socket.7:802
9895 #, no-wrap
9896 msgid "I<wmem_max>"
9897 msgstr "I<wmem_max>"
9898
9899 #. type: Plain text
9900 #: build/C/man7/socket.7:808
9901 msgid ""
9902 "contains the maximum socket send buffer size in bytes which a user may set "
9903 "by using the B<SO_SNDBUF> socket option."
9904 msgstr ""
9905 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9906 "ファサイズの最大値 (バイト単位)。"
9907
9908 #. type: TP
9909 #: build/C/man7/socket.7:808
9910 #, no-wrap
9911 msgid "I<message_cost> and I<message_burst>"
9912 msgstr "I<message_cost> と I<message_burst>"
9913
9914 #. type: Plain text
9915 #: build/C/man7/socket.7:812
9916 msgid ""
9917 "configure the token bucket filter used to load limit warning messages caused "
9918 "by external network events."
9919 msgstr ""
9920 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9921 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9922
9923 #. type: TP
9924 #: build/C/man7/socket.7:812
9925 #, no-wrap
9926 msgid "I<netdev_max_backlog>"
9927 msgstr "I<netdev_max_backlog>"
9928
9929 #. type: Plain text
9930 #: build/C/man7/socket.7:815
9931 msgid "Maximum number of packets in the global input queue."
9932 msgstr "グローバルな入力キューにおける最大のパケット数。"
9933
9934 #. type: TP
9935 #: build/C/man7/socket.7:815
9936 #, no-wrap
9937 msgid "I<optmem_max>"
9938 msgstr "I<optmem_max>"
9939
9940 #.  netdev_fastroute is not documented because it is experimental
9941 #. type: Plain text
9942 #: build/C/man7/socket.7:820
9943 msgid ""
9944 "Maximum length of ancillary data and user control data like the iovecs per "
9945 "socket."
9946 msgstr ""
9947 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9948 "うなもの) との和の最大長。"
9949
9950 #. type: SS
9951 #: build/C/man7/socket.7:820
9952 #, no-wrap
9953 msgid "Ioctls"
9954 msgstr "ioctl"
9955
9956 #. type: Plain text
9957 #: build/C/man7/socket.7:823
9958 msgid "These operations can be accessed using B<ioctl>(2):"
9959 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9960
9961 #. type: Plain text
9962 #: build/C/man7/socket.7:827
9963 #, no-wrap
9964 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9965 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9966
9967 #. type: TP
9968 #: build/C/man7/socket.7:829
9969 #, no-wrap
9970 msgid "B<SIOCGSTAMP>"
9971 msgstr "B<SIOCGSTAMP>"
9972
9973 #. type: Plain text
9974 #: build/C/man7/socket.7:853
9975 msgid ""
9976 "Return a I<struct timeval> with the receive timestamp of the last packet "
9977 "passed to the user.  This is useful for accurate round trip time "
9978 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9979 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9980 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9981 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9982 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9983 "to B<ENOENT>)."
9984 msgstr ""
9985 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9986 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9987 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9988 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9989 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9990 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9991 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9992 "セットする)。"
9993
9994 #. type: TP
9995 #: build/C/man7/socket.7:853
9996 #, no-wrap
9997 msgid "B<SIOCSPGRP>"
9998 msgstr "B<SIOCSPGRP>"
9999
10000 #. type: Plain text
10001 #: build/C/man7/socket.7:872
10002 msgid ""
10003 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
10004 "when an asynchronous I/O operation has finished or urgent data is "
10005 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
10006 "positive, send the signals to that process.  If the argument is negative, "
10007 "send the signals to the process group with the ID of the absolute value of "
10008 "the argument.  The process may only choose itself or its own process group "
10009 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
10010 "UID of 0."
10011 msgstr ""
10012 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
10013 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
10014 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
10015 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
10016 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
10017 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
10018 "の場合は この限りではない。"
10019
10020 #. type: TP
10021 #: build/C/man7/socket.7:872
10022 #, no-wrap
10023 msgid "B<FIOASYNC>"
10024 msgstr "B<FIOASYNC>"
10025
10026 #. type: Plain text
10027 #: build/C/man7/socket.7:882
10028 msgid ""
10029 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
10030 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
10031 "set with B<F_SETSIG> is raised when a new I/O event occurs."
10032 msgstr ""
10033 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
10034 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
10035 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
10036
10037 #. type: Plain text
10038 #: build/C/man7/socket.7:890
10039 msgid ""
10040 "Argument is an integer boolean flag.  (This operation is synonymous with the "
10041 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
10042 msgstr ""
10043 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
10044 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10045
10046 #. type: TP
10047 #: build/C/man7/socket.7:890
10048 #, no-wrap
10049 msgid "B<SIOCGPGRP>"
10050 msgstr "B<SIOCGPGRP>"
10051
10052 #. type: Plain text
10053 #: build/C/man7/socket.7:899
10054 msgid ""
10055 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10056 "signals, or 0 when none is set."
10057 msgstr ""
10058 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
10059 "る。 ない場合は 0 が返る。"
10060
10061 #. type: Plain text
10062 #: build/C/man7/socket.7:903
10063 msgid "Valid B<fcntl>(2)  operations:"
10064 msgstr "有効な B<fcntl>(2)  操作:"
10065
10066 #. type: TP
10067 #: build/C/man7/socket.7:903
10068 #, no-wrap
10069 msgid "B<FIOGETOWN>"
10070 msgstr "B<FIOGETOWN>"
10071
10072 #. type: Plain text
10073 #: build/C/man7/socket.7:908
10074 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10075 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
10076
10077 #. type: TP
10078 #: build/C/man7/socket.7:908
10079 #, no-wrap
10080 msgid "B<FIOSETOWN>"
10081 msgstr "B<FIOSETOWN>"
10082
10083 #. type: Plain text
10084 #: build/C/man7/socket.7:913
10085 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10086 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
10087
10088 #. type: Plain text
10089 #: build/C/man7/socket.7:927
10090 msgid ""
10091 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
10092 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
10093 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
10094 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10095 "be read or written."
10096 msgstr ""
10097 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10098 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
10099 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10100 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10101 "はできなかった。"
10102
10103 #. type: Plain text
10104 #: build/C/man7/socket.7:932
10105 msgid ""
10106 "Linux assumes that half of the send/receive buffer is used for internal "
10107 "kernel structures; thus the values in the corresponding I</proc> files are "
10108 "twice what can be observed on the wire."
10109 msgstr ""
10110 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
10111 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
10112 "なる。"
10113
10114 #. type: Plain text
10115 #: build/C/man7/socket.7:945
10116 msgid ""
10117 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
10118 "option was set both in the previous program that performed a B<bind>(2)  to "
10119 "the port and in the program that wants to reuse the port.  This differs from "
10120 "some implementations (e.g., FreeBSD)  where only the later program needs to "
10121 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
10122 "since, for example, a server program is designed to always set this option."
10123 msgstr ""
10124 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10125 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
10126 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10127 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10128 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10129 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10130 "このオプションをセットするように設計されるからである。"
10131
10132 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10133 #.  .SH AUTHORS
10134 #.  This man page was written by Andi Kleen.
10135 #. type: Plain text
10136 #: build/C/man7/socket.7:958
10137 msgid ""
10138 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10139 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
10140 "is via the libpcap library."
10141 msgstr ""
10142 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10143 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10144 "して 用いる方が良い。"
10145
10146 #. type: Plain text
10147 #: build/C/man7/socket.7:970
10148 #, fuzzy
10149 #| msgid ""
10150 #| "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
10151 #| "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>"
10152 #| "(7), B<unix>(7)"
10153 msgid ""
10154 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10155 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10156 "B<unix>(7)"
10157 msgstr ""
10158 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
10159 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10160 "B<unix>(7)"
10161
10162 #. type: TH
10163 #: build/C/man2/socketcall.2:25
10164 #, no-wrap
10165 msgid "SOCKETCALL"
10166 msgstr "SOCKETCALL"
10167
10168 #. type: TH
10169 #: build/C/man2/socketcall.2:25
10170 #, no-wrap
10171 msgid "2012-10-16"
10172 msgstr "2012-10-16"
10173
10174 #. type: Plain text
10175 #: build/C/man2/socketcall.2:28
10176 msgid "socketcall - socket system calls"
10177 msgstr "socketcall - ソケット・システムコール"
10178
10179 #. type: Plain text
10180 #: build/C/man2/socketcall.2:30
10181 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10182 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10183
10184 #. type: Plain text
10185 #: build/C/man2/socketcall.2:38
10186 msgid ""
10187 "B<socketcall>()  is a common kernel entry point for the socket system "
10188 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10189 "to a block containing the actual arguments, which are passed through to the "
10190 "appropriate call."
10191 msgstr ""
10192 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
10193 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10194 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10195 "ロックを指す。"
10196
10197 #. type: Plain text
10198 #: build/C/man2/socketcall.2:42
10199 msgid ""
10200 "User programs should call the appropriate functions by their usual names.  "
10201 "Only standard library implementors and kernel hackers need to know about "
10202 "B<socketcall>()."
10203 msgstr ""
10204 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10205 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
10206 "必要がある。"
10207
10208 #. type: Plain text
10209 #: build/C/man2/socketcall.2:45
10210 msgid ""
10211 "This call is specific to Linux, and should not be used in programs intended "
10212 "to be portable."
10213 msgstr ""
10214 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10215 "い。"
10216
10217 #. type: Plain text
10218 #: build/C/man2/socketcall.2:53
10219 msgid ""
10220 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10221 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
10222 "(2), and so on really are implemented as separate system calls."
10223 msgstr ""
10224 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10225 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10226 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10227
10228 #. type: Plain text
10229 #: build/C/man2/socketcall.2:71
10230 msgid ""
10231 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10232 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10233 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10234 "(2), B<socket>(2), B<socketpair>(2)"
10235 msgstr ""
10236 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10237 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10238 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10239 "(2), B<socket>(2), B<socketpair>(2)"
10240
10241 #. type: TH
10242 #: build/C/man2/socketpair.2:42
10243 #, no-wrap
10244 msgid "SOCKETPAIR"
10245 msgstr "SOCKETPAIR"
10246
10247 #. type: TH
10248 #: build/C/man2/socketpair.2:42
10249 #, no-wrap
10250 msgid "2008-10-11"
10251 msgstr "2008-10-11"
10252
10253 #. type: Plain text
10254 #: build/C/man2/socketpair.2:45
10255 msgid "socketpair - create a pair of connected sockets"
10256 msgstr "socketpair - 接続されたソケットのペアを作成する"
10257
10258 #. type: Plain text
10259 #: build/C/man2/socketpair.2:52
10260 msgid ""
10261 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10262 ">I<sv>B<[2]);>"
10263 msgstr ""
10264 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10265 ">I<sv>B<[2]);>"
10266
10267 #. type: Plain text
10268 #: build/C/man2/socketpair.2:63
10269 msgid ""
10270 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10271 "the specified I<domain>, of the specified I<type>, and using the optionally "
10272 "specified I<protocol>.  For further details of these arguments, see B<socket>"
10273 "(2)."
10274 msgstr ""
10275 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10276 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10277 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10278
10279 #. type: Plain text
10280 #: build/C/man2/socketpair.2:69
10281 msgid ""
10282 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10283 "and I<sv>[1].  The two sockets are indistinguishable."
10284 msgstr ""
10285 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10286 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10287
10288 #. type: Plain text
10289 #: build/C/man2/socketpair.2:78
10290 msgid "The specified address family is not supported on this machine."
10291 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10292
10293 #. type: Plain text
10294 #: build/C/man2/socketpair.2:83
10295 msgid ""
10296 "The address I<sv> does not specify a valid part of the process address space."
10297 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10298
10299 #. type: Plain text
10300 #: build/C/man2/socketpair.2:86
10301 msgid "Too many descriptors are in use by this process."
10302 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10303
10304 #. type: Plain text
10305 #: build/C/man2/socketpair.2:92
10306 msgid "The specified protocol does not support creation of socket pairs."
10307 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10308
10309 #. type: Plain text
10310 #: build/C/man2/socketpair.2:95
10311 msgid "The specified protocol is not supported on this machine."
10312 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10313
10314 #. type: Plain text
10315 #: build/C/man2/socketpair.2:103
10316 msgid ""
10317 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10318 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10319 "of the BSD socket layer (including System V variants)."
10320 msgstr ""
10321 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10322 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
10323 "BSD 以外のシステムと、 互いに移植性がある。"
10324
10325 #. type: Plain text
10326 #: build/C/man2/socketpair.2:109
10327 msgid ""
10328 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10329 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10330 "restriction.)"
10331 msgstr ""
10332 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10333 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10334
10335 #. type: Plain text
10336 #: build/C/man2/socketpair.2:118
10337 msgid ""
10338 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10339 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10340 msgstr ""
10341 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10342 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10343
10344 #. type: Plain text
10345 #: build/C/man2/socketpair.2:131
10346 msgid ""
10347 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10348 msgstr ""
10349 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10350
10351 #~ msgid ""
10352 #~ "$ B<./a.out>\n"
10353 #~ "lo      address family: 17 (AF_PACKET)\n"
10354 #~ "eth0    address family: 17 (AF_PACKET)\n"
10355 #~ "lo      address family: 2 (AF_INET)\n"
10356 #~ "        address: E<lt>127.0.0.1E<gt>\n"
10357 #~ "eth0    address family: 2 (AF_INET)\n"
10358 #~ "        address: E<lt>10.1.1.4E<gt>\n"
10359 #~ "lo      address family: 10 (AF_INET6)\n"
10360 #~ "        address: E<lt>::1E<gt>\n"
10361 #~ "eth0    address family: 10 (AF_INET6)\n"
10362 #~ "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
10363 #~ msgstr ""
10364 #~ "$ B<./a.out>\n"
10365 #~ "lo      address family: 17 (AF_PACKET)\n"
10366 #~ "eth0    address family: 17 (AF_PACKET)\n"
10367 #~ "lo      address family: 2 (AF_INET)\n"
10368 #~ "        address: E<lt>127.0.0.1E<gt>\n"
10369 #~ "eth0    address family: 2 (AF_INET)\n"
10370 #~ "        address: E<lt>10.1.1.4E<gt>\n"
10371 #~ "lo      address family: 10 (AF_INET6)\n"
10372 #~ "        address: E<lt>::1E<gt>\n"
10373 #~ "eth0    address family: 10 (AF_INET6)\n"
10374 #~ "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
10375
10376 #~ msgid "2013-04-19"
10377 #~ msgstr "2013-04-19"
10378
10379 #~ msgid "2012-08-03"
10380 #~ msgstr "2012-08-03"
10381
10382 #~ msgid "2012-04-23"
10383 #~ msgstr "2012-04-23"
10384
10385 #~ msgid "2012-08-17"
10386 #~ msgstr "2012-08-17"