OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.63
[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: 2013-10-02 00:21+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 #, fuzzy
834 #| msgid ""
835 #| "This page is part of release 3.54 of the Linux I<man-pages> project.  A "
836 #| "description of the project, and information about reporting bugs, can be "
837 #| "found at \\%http://www.kernel.org/doc/man-pages/."
838 msgid ""
839 "This page is part of release 3.63 of the Linux I<man-pages> project.  A "
840 "description of the project, and information about reporting bugs, can be "
841 "found at \\%http://www.kernel.org/doc/man-pages/."
842 msgstr ""
843 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.54 の一部\n"
844 "である。プロジェクトの説明とバグ報告に関する情報は\n"
845 "http://www.kernel.org/doc/man-pages/ に書かれている。"
846
847 #. type: TH
848 #: build/C/man2/bind.2:68
849 #, no-wrap
850 msgid "BIND"
851 msgstr "BIND"
852
853 #. type: TH
854 #: build/C/man2/bind.2:68
855 #, no-wrap
856 msgid "2007-12-28"
857 msgstr "2007-12-28"
858
859 #. type: Plain text
860 #: build/C/man2/bind.2:71
861 msgid "bind - bind a name to a socket"
862 msgstr "bind - ソケットに名前をつける"
863
864 #. type: Plain text
865 #: build/C/man2/bind.2:78
866 #, no-wrap
867 msgid ""
868 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
869 "B<         socklen_t >I<addrlen>B<);>\n"
870 msgstr ""
871 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
872 "B<         socklen_t >I<addrlen>B<);>\n"
873
874 #. type: Plain text
875 #: build/C/man2/bind.2:92
876 msgid ""
877 "When a socket is created with B<socket>(2), it exists in a name space "
878 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
879 "address specified by I<addr> to the socket referred to by the file "
880 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
881 "address structure pointed to by I<addr>.  Traditionally, this operation is "
882 "called \\(lqassigning a name to a socket\\(rq."
883 msgstr ""
884 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
885 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
886 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
887 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
888 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
889 "る。"
890
891 #. type: Plain text
892 #: build/C/man2/bind.2:99
893 msgid ""
894 "It is normally necessary to assign a local address using B<bind>()  before a "
895 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
896 msgstr ""
897 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
898 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
899 "る。"
900
901 #. type: Plain text
902 #: build/C/man2/bind.2:130
903 msgid ""
904 "The rules used in name binding vary between address families.  Consult the "
905 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
906 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
907 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
908 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
909 msgstr ""
910 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
911 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
912 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
913 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
914 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
915
916 #. type: Plain text
917 #: build/C/man2/bind.2:137
918 msgid ""
919 "The actual structure passed for the I<addr> argument will depend on the "
920 "address family.  The I<sockaddr> structure is defined as something like:"
921 msgstr ""
922 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
923 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
924
925 #. type: Plain text
926 #: build/C/man2/bind.2:144
927 #, no-wrap
928 msgid ""
929 "struct sockaddr {\n"
930 "    sa_family_t sa_family;\n"
931 "    char        sa_data[14];\n"
932 "}\n"
933 msgstr ""
934 "struct sockaddr {\n"
935 "    sa_family_t sa_family;\n"
936 "    char        sa_data[14];\n"
937 "}\n"
938
939 #. type: Plain text
940 #: build/C/man2/bind.2:152
941 msgid ""
942 "The only purpose of this structure is to cast the structure pointer passed "
943 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
944 msgstr ""
945 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
946 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
947
948 #. type: Plain text
949 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
950 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
951 #: build/C/man2/socketpair.2:74
952 msgid ""
953 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
954 "appropriately."
955 msgstr ""
956 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
957 "設定される。"
958
959 #. type: TP
960 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
961 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
962 #: build/C/man2/send.2:285 build/C/man2/socket.2:316
963 #, no-wrap
964 msgid "B<EACCES>"
965 msgstr "B<EACCES>"
966
967 #.  e.g., privileged port in AF_INET domain
968 #. type: Plain text
969 #: build/C/man2/bind.2:162
970 msgid "The address is protected, and the user is not the superuser."
971 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
972
973 #. type: TP
974 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
975 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
976 #, no-wrap
977 msgid "B<EADDRINUSE>"
978 msgstr "B<EADDRINUSE>"
979
980 #. type: Plain text
981 #: build/C/man2/bind.2:165
982 msgid "The given address is already in use."
983 msgstr "指定されたアドレスが既に使用中である。"
984
985 #. type: Plain text
986 #: build/C/man2/bind.2:169
987 msgid "I<sockfd> is not a valid descriptor."
988 msgstr "I<sockfd> が不正なディスクリプタである。"
989
990 #.  This may change in the future: see
991 #.  .I linux/unix/sock.c for details.
992 #. type: Plain text
993 #: build/C/man2/bind.2:174
994 msgid "The socket is already bound to an address."
995 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
996
997 #. type: Plain text
998 #: build/C/man2/bind.2:178
999 msgid "I<sockfd> is a descriptor for a file, not a socket."
1000 msgstr ""
1001 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
1002
1003 #. type: Plain text
1004 #: build/C/man2/bind.2:182
1005 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1006 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1007
1008 #. type: Plain text
1009 #: build/C/man2/bind.2:187
1010 msgid ""
1011 "Search permission is denied on a component of the path prefix.  (See also "
1012 "B<path_resolution>(7).)"
1013 msgstr ""
1014 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1015 "(7)  も参照すること)。"
1016
1017 #. type: TP
1018 #: build/C/man2/bind.2:187
1019 #, no-wrap
1020 msgid "B<EADDRNOTAVAIL>"
1021 msgstr "B<EADDRNOTAVAIL>"
1022
1023 #. type: Plain text
1024 #: build/C/man2/bind.2:191
1025 msgid ""
1026 "A nonexistent interface was requested or the requested address was not local."
1027 msgstr ""
1028 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1029 "かった。"
1030
1031 #. type: Plain text
1032 #: build/C/man2/bind.2:195
1033 msgid "I<addr> points outside the user's accessible address space."
1034 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1035
1036 #. type: Plain text
1037 #: build/C/man2/bind.2:202
1038 msgid ""
1039 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1040 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1041
1042 #. type: TP
1043 #: build/C/man2/bind.2:202
1044 #, no-wrap
1045 msgid "B<ELOOP>"
1046 msgstr "B<ELOOP>"
1047
1048 #. type: Plain text
1049 #: build/C/man2/bind.2:206
1050 msgid "Too many symbolic links were encountered in resolving I<addr>."
1051 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1052
1053 #. type: TP
1054 #: build/C/man2/bind.2:206
1055 #, no-wrap
1056 msgid "B<ENAMETOOLONG>"
1057 msgstr "B<ENAMETOOLONG>"
1058
1059 #. type: Plain text
1060 #: build/C/man2/bind.2:210
1061 msgid "I<addr> is too long."
1062 msgstr "I<addr> が長過ぎる。"
1063
1064 #. type: TP
1065 #: build/C/man2/bind.2:210
1066 #, no-wrap
1067 msgid "B<ENOENT>"
1068 msgstr "B<ENOENT>"
1069
1070 #. type: Plain text
1071 #: build/C/man2/bind.2:213
1072 msgid "The file does not exist."
1073 msgstr "ファイルが存在しない。"
1074
1075 #. type: TP
1076 #: build/C/man2/bind.2:213 build/C/man2/recv.2:452 build/C/man2/select.2:333
1077 #: build/C/man2/send.2:343
1078 #, no-wrap
1079 msgid "B<ENOMEM>"
1080 msgstr "B<ENOMEM>"
1081
1082 #. type: Plain text
1083 #: build/C/man2/bind.2:216
1084 msgid "Insufficient kernel memory was available."
1085 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1086
1087 #. type: TP
1088 #: build/C/man2/bind.2:216
1089 #, no-wrap
1090 msgid "B<ENOTDIR>"
1091 msgstr "B<ENOTDIR>"
1092
1093 #. type: Plain text
1094 #: build/C/man2/bind.2:219
1095 msgid "A component of the path prefix is not a directory."
1096 msgstr "パス名の構成要素がディレクトリではない。"
1097
1098 #. type: TP
1099 #: build/C/man2/bind.2:219
1100 #, no-wrap
1101 msgid "B<EROFS>"
1102 msgstr "B<EROFS>"
1103
1104 #. type: Plain text
1105 #: build/C/man2/bind.2:222
1106 msgid "The socket inode would reside on a read-only filesystem."
1107 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1108
1109 #.  SVr4 documents an additional
1110 #.  .B ENOSR
1111 #.  general error condition, and
1112 #.  additional
1113 #.  .B EIO
1114 #.  and
1115 #.  .B EISDIR
1116 #.  UNIX-domain error conditions.
1117 #. type: Plain text
1118 #: build/C/man2/bind.2:234
1119 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1120 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1121
1122 #. type: Plain text
1123 #: build/C/man2/bind.2:251
1124 msgid ""
1125 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1126 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1127 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1128 msgstr ""
1129 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1130 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1131 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1132
1133 #. type: SH
1134 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1135 #: build/C/man2/select.2:485 build/C/man2/send.2:414
1136 #: build/C/man3/sockatmark.3:100 build/C/man7/socket.7:945
1137 #, no-wrap
1138 msgid "BUGS"
1139 msgstr "バグ"
1140
1141 #.  FIXME What *are* transparent proxy options?
1142 #. type: Plain text
1143 #: build/C/man2/bind.2:254
1144 msgid "The transparent proxy options are not described."
1145 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1146
1147 #. type: Plain text
1148 #: build/C/man2/bind.2:259
1149 msgid ""
1150 "An example of the use of B<bind>()  with Internet domain sockets can be "
1151 "found in B<getaddrinfo>(3)."
1152 msgstr ""
1153 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1154 "(3)  に記載されている。"
1155
1156 #.  listen.7 refers to this example.
1157 #.  accept.7 refers to this example.
1158 #.  unix.7 refers to this example.
1159 #. type: Plain text
1160 #: build/C/man2/bind.2:266
1161 msgid ""
1162 "The following example shows how to bind a stream socket in the UNIX "
1163 "(B<AF_UNIX>)  domain, and accept connections:"
1164 msgstr ""
1165 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1166 "を示したものである。"
1167
1168 #. type: Plain text
1169 #: build/C/man2/bind.2:273
1170 #, no-wrap
1171 msgid ""
1172 "#include E<lt>sys/socket.hE<gt>\n"
1173 "#include E<lt>sys/un.hE<gt>\n"
1174 "#include E<lt>stdlib.hE<gt>\n"
1175 "#include E<lt>stdio.hE<gt>\n"
1176 "#include E<lt>string.hE<gt>\n"
1177 msgstr ""
1178 "#include E<lt>sys/socket.hE<gt>\n"
1179 "#include E<lt>sys/un.hE<gt>\n"
1180 "#include E<lt>stdlib.hE<gt>\n"
1181 "#include E<lt>stdio.hE<gt>\n"
1182 "#include E<lt>string.hE<gt>\n"
1183
1184 #. type: Plain text
1185 #: build/C/man2/bind.2:276
1186 #, no-wrap
1187 msgid ""
1188 "#define MY_SOCK_PATH \"/somepath\"\n"
1189 "#define LISTEN_BACKLOG 50\n"
1190 msgstr ""
1191 "#define MY_SOCK_PATH \"/somepath\"\n"
1192 "#define LISTEN_BACKLOG 50\n"
1193
1194 #. type: Plain text
1195 #: build/C/man2/bind.2:279
1196 #, no-wrap
1197 msgid ""
1198 "#define handle_error(msg) \\e\n"
1199 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1200 msgstr ""
1201 "#define handle_error(msg) \\e\n"
1202 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1203
1204 #. type: Plain text
1205 #: build/C/man2/bind.2:286
1206 #, no-wrap
1207 msgid ""
1208 "int\n"
1209 "main(int argc, char *argv[])\n"
1210 "{\n"
1211 "    int sfd, cfd;\n"
1212 "    struct sockaddr_un my_addr, peer_addr;\n"
1213 "    socklen_t peer_addr_size;\n"
1214 msgstr ""
1215 "int\n"
1216 "main(int argc, char *argv[])\n"
1217 "{\n"
1218 "    int sfd, cfd;\n"
1219 "    struct sockaddr_un my_addr, peer_addr;\n"
1220 "    socklen_t peer_addr_size;\n"
1221
1222 #. type: Plain text
1223 #: build/C/man2/bind.2:290
1224 #, no-wrap
1225 msgid ""
1226 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1227 "    if (sfd == -1)\n"
1228 "        handle_error(\"socket\");\n"
1229 msgstr ""
1230 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1231 "    if (sfd == -1)\n"
1232 "        handle_error(\"socket\");\n"
1233
1234 #. type: Plain text
1235 #: build/C/man2/bind.2:296
1236 #, no-wrap
1237 msgid ""
1238 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1239 "                        /* Clear structure */\n"
1240 "    my_addr.sun_family = AF_UNIX;\n"
1241 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1242 "            sizeof(my_addr.sun_path) - 1);\n"
1243 msgstr ""
1244 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1245 "                        /* Clear structure */\n"
1246 "    my_addr.sun_family = AF_UNIX;\n"
1247 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1248 "            sizeof(my_addr.sun_path) - 1);\n"
1249
1250 #. type: Plain text
1251 #: build/C/man2/bind.2:300
1252 #, no-wrap
1253 msgid ""
1254 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1255 "            sizeof(struct sockaddr_un)) == -1)\n"
1256 "        handle_error(\"bind\");\n"
1257 msgstr ""
1258 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1259 "            sizeof(struct sockaddr_un)) == -1)\n"
1260 "        handle_error(\"bind\");\n"
1261
1262 #. type: Plain text
1263 #: build/C/man2/bind.2:303
1264 #, no-wrap
1265 msgid ""
1266 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1267 "        handle_error(\"listen\");\n"
1268 msgstr ""
1269 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1270 "        handle_error(\"listen\");\n"
1271
1272 #. type: Plain text
1273 #: build/C/man2/bind.2:306
1274 #, no-wrap
1275 msgid ""
1276 "    /* Now we can accept incoming connections one\n"
1277 "       at a time using accept(2) */\n"
1278 msgstr ""
1279 "    /* Now we can accept incoming connections one\n"
1280 "       at a time using accept(2) */\n"
1281
1282 #. type: Plain text
1283 #: build/C/man2/bind.2:312
1284 #, no-wrap
1285 msgid ""
1286 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1287 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1288 "                 &peer_addr_size);\n"
1289 "    if (cfd == -1)\n"
1290 "        handle_error(\"accept\");\n"
1291 msgstr ""
1292 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1293 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1294 "                 &peer_addr_size)\n"
1295 "    if (cfd == -1)\n"
1296 "        handle_error(\"accept\");\n"
1297
1298 #. type: Plain text
1299 #: build/C/man2/bind.2:314
1300 #, no-wrap
1301 msgid "    /* Code to deal with incoming connection(s)... */\n"
1302 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1303
1304 #. type: Plain text
1305 #: build/C/man2/bind.2:318
1306 #, no-wrap
1307 msgid ""
1308 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1309 "       should be deleted using unlink(2) or remove(3) */\n"
1310 "}\n"
1311 msgstr ""
1312 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1313 "       should be deleted using unlink(2) or remove(3) */\n"
1314 "}\n"
1315
1316 #. type: Plain text
1317 #: build/C/man2/bind.2:332
1318 msgid ""
1319 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1320 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1321 "(7), B<socket>(7), B<unix>(7)"
1322 msgstr ""
1323 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1324 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1325 "(7), B<socket>(7), B<unix>(7)"
1326
1327 #. type: TH
1328 #: build/C/man3/bindresvport.3:30
1329 #, no-wrap
1330 msgid "BINDRESVPORT"
1331 msgstr "BINDRESVPORT"
1332
1333 #. type: TH
1334 #: build/C/man3/bindresvport.3:30
1335 #, no-wrap
1336 msgid "2013-06-21"
1337 msgstr "2013-06-21"
1338
1339 #. type: Plain text
1340 #: build/C/man3/bindresvport.3:33
1341 msgid "bindresvport - bind a socket to a privileged IP port"
1342 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1343
1344 #. type: Plain text
1345 #: build/C/man3/bindresvport.3:37
1346 #, no-wrap
1347 msgid ""
1348 "B<#include E<lt>sys/types.hE<gt>>\n"
1349 "B<#include E<lt>netinet/in.hE<gt>>\n"
1350 msgstr ""
1351 "B<#include E<lt>sys/types.hE<gt>>\n"
1352 "B<#include E<lt>netinet/in.hE<gt>>\n"
1353
1354 #. type: Plain text
1355 #: build/C/man3/bindresvport.3:39
1356 #, no-wrap
1357 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1358 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1359
1360 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1361 #. type: Plain text
1362 #: build/C/man3/bindresvport.3:46
1363 msgid ""
1364 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1365 "anonymous IP port, that is, a port number arbitrarily selected from the "
1366 "range 512 to 1023."
1367 msgstr ""
1368 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1369 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1370 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1371
1372 #. type: Plain text
1373 #: build/C/man3/bindresvport.3:56
1374 msgid ""
1375 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1376 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1377 "allocated."
1378 msgstr ""
1379 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1380 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1381 "される。"
1382
1383 #. type: Plain text
1384 #: build/C/man3/bindresvport.3:67
1385 msgid ""
1386 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1387 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1388 "return the port number actually allocated.  (This information can later be "
1389 "obtained using B<getsockname>(2).)"
1390 msgstr ""
1391 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1392 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1393 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1394 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1395
1396 #. type: Plain text
1397 #: build/C/man3/bindresvport.3:72
1398 msgid ""
1399 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1400 "I<errno> set to indicate the cause of the error."
1401 msgstr ""
1402 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1403 "I<errno> にエラーの原因を示す値を設定する。"
1404
1405 #. type: Plain text
1406 #: build/C/man3/bindresvport.3:77
1407 msgid ""
1408 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1409 "addition, the following errors may occur:"
1410 msgstr ""
1411 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1412 "以下のエラーが発生することがある:"
1413
1414 #. type: Plain text
1415 #: build/C/man3/bindresvport.3:82
1416 msgid ""
1417 "The caller did not have superuser privilege (to be precise: the "
1418 "B<CAP_NET_BIND_SERVICE> capability is required)."
1419 msgstr ""
1420 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1421 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1422
1423 #. type: Plain text
1424 #: build/C/man3/bindresvport.3:85
1425 msgid "All privileged ports are in use."
1426 msgstr "全ての特権ポートが使用中である。"
1427
1428 #. type: TP
1429 #: build/C/man3/bindresvport.3:85
1430 #, no-wrap
1431 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1432 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1433
1434 #. type: Plain text
1435 #: build/C/man3/bindresvport.3:92
1436 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1437 msgstr ""
1438 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1439
1440 #. type: SH
1441 #: build/C/man3/bindresvport.3:92 build/C/man3/sockatmark.3:73
1442 #, no-wrap
1443 msgid "ATTRIBUTES"
1444 msgstr "属性"
1445
1446 #. type: SS
1447 #: build/C/man3/bindresvport.3:93 build/C/man3/sockatmark.3:74
1448 #, no-wrap
1449 msgid "Multithreading (see pthreads(7))"
1450 msgstr "マルチスレッディング (pthreads(7) 参照)"
1451
1452 #. type: Plain text
1453 #: build/C/man3/bindresvport.3:98
1454 msgid ""
1455 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1456 "that is not protected, so it is not thread-safe."
1457 msgstr ""
1458 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1459 "静的変数を使用しているため、スレッドセーフではない。"
1460
1461 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1462 #. type: Plain text
1463 #: build/C/man3/bindresvport.3:104
1464 msgid ""
1465 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1466 "static variable, so it is thread-safe."
1467 msgstr ""
1468 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1469 "ており、スレッドセーフである。"
1470
1471 #. type: Plain text
1472 #: build/C/man3/bindresvport.3:107
1473 msgid ""
1474 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1475 msgstr ""
1476 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1477
1478 #. type: Plain text
1479 #: build/C/man3/bindresvport.3:113
1480 msgid ""
1481 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1482 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1483 msgstr ""
1484 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1485 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1486
1487 #. type: Plain text
1488 #: build/C/man3/bindresvport.3:116
1489 msgid "B<bind>(2), B<getsockname>(2)"
1490 msgstr "B<bind>(2), B<getsockname>(2)"
1491
1492 #. type: TH
1493 #: build/C/man2/connect.2:67
1494 #, no-wrap
1495 msgid "CONNECT"
1496 msgstr "CONNECT"
1497
1498 #. type: TH
1499 #: build/C/man2/connect.2:67 build/C/man2/getsockname.2:40
1500 #, no-wrap
1501 msgid "2008-12-03"
1502 msgstr "2008-12-03"
1503
1504 #. type: Plain text
1505 #: build/C/man2/connect.2:70
1506 msgid "connect - initiate a connection on a socket"
1507 msgstr "connect - ソケットの接続を行う"
1508
1509 #. type: Plain text
1510 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1511 #: build/C/man2/listen.2:51
1512 #, no-wrap
1513 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1514 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1515
1516 #. type: Plain text
1517 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1518 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1519 #: build/C/man2/recv.2:51
1520 #, no-wrap
1521 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1522 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1523
1524 #. type: Plain text
1525 #: build/C/man2/connect.2:78
1526 #, no-wrap
1527 msgid ""
1528 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1529 "B<            socklen_t >I<addrlen>B<);>\n"
1530 msgstr ""
1531 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1532 "B<            socklen_t >I<addrlen>B<);>\n"
1533
1534 #. type: Plain text
1535 #: build/C/man2/connect.2:97
1536 msgid ""
1537 "The B<connect>()  system call connects the socket referred to by the file "
1538 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1539 "argument specifies the size of I<addr>.  The format of the address in "
1540 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1541 "B<socket>(2)  for further details."
1542 msgstr ""
1543 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1544 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1545 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1546 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1547 "こと。"
1548
1549 #. type: Plain text
1550 #: build/C/man2/connect.2:113
1551 msgid ""
1552 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1553 "to which datagrams are sent by default, and the only address from which "
1554 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1555 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1556 "that is bound to the address specified by I<addr>."
1557 msgstr ""
1558 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1559 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1560 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1561 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1562 "に対する接続の 作成を試みる。"
1563
1564 #. type: Plain text
1565 #: build/C/man2/connect.2:127
1566 msgid ""
1567 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1568 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1569 "times to change their association.  Connectionless sockets may dissolve the "
1570 "association by connecting to an address with the I<sa_family> member of "
1571 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1572 msgstr ""
1573 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1574 "()  が成功する。 コネクションレス (connectionless) プロトコルでは対応を変更す"
1575 "るために何度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1576 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1577 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1578
1579 #. type: Plain text
1580 #: build/C/man2/connect.2:132
1581 msgid ""
1582 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1583 "returned, and I<errno> is set appropriately."
1584 msgstr ""
1585 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1586 "適切な値を設定する。"
1587
1588 #. type: Plain text
1589 #: build/C/man2/connect.2:135
1590 msgid ""
1591 "The following are general socket errors only.  There may be other domain-"
1592 "specific error codes."
1593 msgstr ""
1594 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1595 "する可能性がある。"
1596
1597 #. type: Plain text
1598 #: build/C/man2/connect.2:143
1599 msgid ""
1600 "For UNIX domain sockets, which are identified by pathname: Write permission "
1601 "is denied on the socket file, or search permission is denied for one of the "
1602 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1603 msgstr ""
1604 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1605 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1606 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1607
1608 #. type: TP
1609 #: build/C/man2/connect.2:143
1610 #, no-wrap
1611 msgid "B<EACCES>, B<EPERM>"
1612 msgstr "B<EACCES>, B<EPERM>"
1613
1614 #. type: Plain text
1615 #: build/C/man2/connect.2:148
1616 msgid ""
1617 "The user tried to connect to a broadcast address without having the socket "
1618 "broadcast flag enabled or the connection request failed because of a local "
1619 "firewall rule."
1620 msgstr ""
1621 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1622 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1623 "要求が失敗した。"
1624
1625 #. type: Plain text
1626 #: build/C/man2/connect.2:151
1627 msgid "Local address is already in use."
1628 msgstr "ローカルアドレスが既に使用されている。"
1629
1630 #. type: TP
1631 #: build/C/man2/connect.2:151 build/C/man2/socket.2:320
1632 #: build/C/man2/socketpair.2:75
1633 #, no-wrap
1634 msgid "B<EAFNOSUPPORT>"
1635 msgstr "B<EAFNOSUPPORT>"
1636
1637 #. type: Plain text
1638 #: build/C/man2/connect.2:156
1639 msgid ""
1640 "The passed address didn't have the correct address family in its "
1641 "I<sa_family> field."
1642 msgstr ""
1643 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1644 "い。"
1645
1646 #. type: TP
1647 #: build/C/man2/connect.2:156
1648 #, no-wrap
1649 msgid "B<EAGAIN>"
1650 msgstr "B<EAGAIN>"
1651
1652 #. type: Plain text
1653 #: build/C/man2/connect.2:165
1654 msgid ""
1655 "No more free local ports or insufficient entries in the routing cache.  For "
1656 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1657 "B<ip>(7)  for information on how to increase the number of local ports."
1658 msgstr ""
1659 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1660 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1661 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1662
1663 #. type: TP
1664 #: build/C/man2/connect.2:165
1665 #, no-wrap
1666 msgid "B<EALREADY>"
1667 msgstr "B<EALREADY>"
1668
1669 #. type: Plain text
1670 #: build/C/man2/connect.2:169
1671 msgid ""
1672 "The socket is nonblocking and a previous connection attempt has not yet been "
1673 "completed."
1674 msgstr ""
1675 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1676
1677 #. type: Plain text
1678 #: build/C/man2/connect.2:172
1679 msgid "The file descriptor is not a valid index in the descriptor table."
1680 msgstr ""
1681 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1682 "い。"
1683
1684 #. type: TP
1685 #: build/C/man2/connect.2:172 build/C/man2/recv.2:435
1686 #, no-wrap
1687 msgid "B<ECONNREFUSED>"
1688 msgstr "B<ECONNREFUSED>"
1689
1690 #. type: Plain text
1691 #: build/C/man2/connect.2:175
1692 msgid "No-one listening on the remote address."
1693 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1694
1695 #. type: Plain text
1696 #: build/C/man2/connect.2:178
1697 msgid "The socket structure address is outside the user's address space."
1698 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1699
1700 #. type: TP
1701 #: build/C/man2/connect.2:178
1702 #, no-wrap
1703 msgid "B<EINPROGRESS>"
1704 msgstr "B<EINPROGRESS>"
1705
1706 #. type: Plain text
1707 #: build/C/man2/connect.2:203
1708 msgid ""
1709 "The socket is nonblocking and the connection cannot be completed "
1710 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1711 "by selecting the socket for writing.  After B<select>(2)  indicates "
1712 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1713 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1714 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1715 "error codes listed here, explaining the reason for the failure)."
1716 msgstr ""
1717 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1718 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1719 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1720 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1721 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1722 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1723 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1724 "の原因が分かる。"
1725
1726 #.  For TCP, the connection will complete asynchronously.
1727 #.  See http://lkml.org/lkml/2005/7/12/254
1728 #. type: Plain text
1729 #: build/C/man2/connect.2:209
1730 msgid ""
1731 "The system call was interrupted by a signal that was caught; see B<signal>"
1732 "(7)."
1733 msgstr ""
1734 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1735
1736 #. type: TP
1737 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1738 #, no-wrap
1739 msgid "B<EISCONN>"
1740 msgstr "B<EISCONN>"
1741
1742 #. type: Plain text
1743 #: build/C/man2/connect.2:212
1744 msgid "The socket is already connected."
1745 msgstr "ソケットは既に接続 (connect) されている。"
1746
1747 #. type: TP
1748 #: build/C/man2/connect.2:212
1749 #, no-wrap
1750 msgid "B<ENETUNREACH>"
1751 msgstr "B<ENETUNREACH>"
1752
1753 #. type: Plain text
1754 #: build/C/man2/connect.2:215
1755 msgid "Network is unreachable."
1756 msgstr "到達できないネットワークである。"
1757
1758 #. type: Plain text
1759 #: build/C/man2/connect.2:218
1760 msgid "The file descriptor is not associated with a socket."
1761 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1762
1763 #. type: TP
1764 #: build/C/man2/connect.2:218
1765 #, no-wrap
1766 msgid "B<ETIMEDOUT>"
1767 msgstr "B<ETIMEDOUT>"
1768
1769 #. type: Plain text
1770 #: build/C/man2/connect.2:225
1771 msgid ""
1772 "Timeout while attempting connection.  The server may be too busy to accept "
1773 "new connections.  Note that for IP sockets the timeout may be very long when "
1774 "syncookies are enabled on the server."
1775 msgstr ""
1776 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1777 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1778 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1779 "ること。"
1780
1781 #.  SVr4 documents the additional
1782 #.  general error codes
1783 #.  .BR EADDRNOTAVAIL ,
1784 #.  .BR EINVAL ,
1785 #.  .BR EAFNOSUPPORT ,
1786 #.  .BR EALREADY ,
1787 #.  .BR EINTR ,
1788 #.  .BR EPROTOTYPE ,
1789 #.  and
1790 #.  .BR ENOSR .
1791 #.  It also
1792 #.  documents many additional error conditions not described here.
1793 #. type: Plain text
1794 #: build/C/man2/connect.2:241
1795 msgid ""
1796 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1797 "POSIX.1-2001."
1798 msgstr ""
1799 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1800
1801 #. type: Plain text
1802 #: build/C/man2/connect.2:258
1803 msgid ""
1804 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1805 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1806 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1807 msgstr ""
1808 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1809 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1810 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1811
1812 #. type: Plain text
1813 #: build/C/man2/connect.2:263
1814 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1815 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1816
1817 #. type: Plain text
1818 #: build/C/man2/connect.2:270
1819 msgid ""
1820 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1821 "B<path_resolution>(7)"
1822 msgstr ""
1823 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1824 "B<path_resolution>(7)"
1825
1826 #. type: TH
1827 #: build/C/man3/getifaddrs.3:36
1828 #, no-wrap
1829 msgid "GETIFADDRS"
1830 msgstr "GETIFADDRS"
1831
1832 #. type: TH
1833 #: build/C/man3/getifaddrs.3:36
1834 #, no-wrap
1835 msgid "2014-02-26"
1836 msgstr ""
1837
1838 #. type: TH
1839 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1840 #: build/C/man3/if_nametoindex.3:25
1841 #, no-wrap
1842 msgid "GNU"
1843 msgstr "GNU"
1844
1845 #. type: Plain text
1846 #: build/C/man3/getifaddrs.3:39
1847 msgid "getifaddrs, freeifaddrs - get interface addresses"
1848 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1849
1850 #. type: Plain text
1851 #: build/C/man3/getifaddrs.3:43
1852 #, no-wrap
1853 msgid ""
1854 "B<#include E<lt>sys/types.hE<gt>>\n"
1855 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1856 msgstr ""
1857 "B<#include E<lt>sys/types.hE<gt>>\n"
1858 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1859
1860 #. type: Plain text
1861 #: build/C/man3/getifaddrs.3:45
1862 #, no-wrap
1863 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1864 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1865
1866 #. type: Plain text
1867 #: build/C/man3/getifaddrs.3:47
1868 #, no-wrap
1869 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1870 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1871
1872 #. type: Plain text
1873 #: build/C/man3/getifaddrs.3:58
1874 msgid ""
1875 "The B<getifaddrs>()  function creates a linked list of structures describing "
1876 "the network interfaces of the local system, and stores the address of the "
1877 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1878 "structures, defined as follows:"
1879 msgstr ""
1880 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1881 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1882 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1883 "うに定義されている。"
1884
1885 #. type: Plain text
1886 #: build/C/man3/getifaddrs.3:77
1887 #, no-wrap
1888 msgid ""
1889 "struct ifaddrs {\n"
1890 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1891 "    char            *ifa_name;    /* Name of interface */\n"
1892 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1893 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1894 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1895 "    union {\n"
1896 "        struct sockaddr *ifu_broadaddr;\n"
1897 "                         /* Broadcast address of interface */\n"
1898 "        struct sockaddr *ifu_dstaddr;\n"
1899 "                         /* Point-to-point destination address */\n"
1900 "    } ifa_ifu;\n"
1901 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1902 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1903 "    void            *ifa_data;    /* Address-specific data */\n"
1904 "};\n"
1905 msgstr ""
1906 "struct ifaddrs {\n"
1907 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1908 "    char            *ifa_name;    /* Name of interface */\n"
1909 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1910 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1911 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1912 "    union {\n"
1913 "        struct sockaddr *ifu_broadaddr;\n"
1914 "                         /* Broadcast address of interface */\n"
1915 "        struct sockaddr *ifu_dstaddr;\n"
1916 "                         /* Point-to-point destination address */\n"
1917 "    } ifa_ifu;\n"
1918 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1919 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1920 "    void            *ifa_data;    /* Address-specific data */\n"
1921 "};\n"
1922
1923 #. type: Plain text
1924 #: build/C/man3/getifaddrs.3:84
1925 msgid ""
1926 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1927 "or NULL if this is the last item of the list."
1928 msgstr ""
1929 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1930 "素がリストの最後の場合には NULL が入る。"
1931
1932 #.  The constant
1933 #.  .B IF NAMESIZE
1934 #.  indicates the maximum length of this field.
1935 #. type: Plain text
1936 #: build/C/man3/getifaddrs.3:91
1937 msgid "The I<ifa_name> points to the null-terminated interface name."
1938 msgstr "I<ifa_name> は NULL 終端されたインターフェース名を指す。"
1939
1940 #. type: Plain text
1941 #: build/C/man3/getifaddrs.3:100
1942 msgid ""
1943 "The I<ifa_flags> field contains the interface flags, as returned by the "
1944 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1945 "these flags)."
1946 msgstr ""
1947 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1948 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1949 "B<netdevice>(7) を参照)。"
1950
1951 #. type: Plain text
1952 #: build/C/man3/getifaddrs.3:109
1953 #, fuzzy
1954 #| msgid ""
1955 #| "The I<ifa_addr> field points to a structure containing the interface "
1956 #| "address.  (The I<sa_family> subfield should be consulted to determine the "
1957 #| "format of the address structure.)  This field may contain a NULL pointer."
1958 msgid ""
1959 "The I<ifa_addr> field points to a structure containing the interface "
1960 "address.  (The I<sa_family> subfield should be consulted to determine the "
1961 "format of the address structure.)  This field may contain a null pointer."
1962 msgstr ""
1963 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
1964 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
1965 "すべきである)。 このフィールドは NULL ポインタとなる場合がある。"
1966
1967 #. type: Plain text
1968 #: build/C/man3/getifaddrs.3:116
1969 #, fuzzy
1970 #| msgid ""
1971 #| "The I<ifa_netmask> field points to a structure containing the netmask "
1972 #| "associated with I<ifa_addr>, if applicable for the address family.  This "
1973 #| "field may contain a NULL pointer."
1974 msgid ""
1975 "The I<ifa_netmask> field points to a structure containing the netmask "
1976 "associated with I<ifa_addr>, if applicable for the address family.  This "
1977 "field may contain a null pointer."
1978 msgstr ""
1979 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
1980 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
1981 "る。 このフィールドは NULL ポインタとなる場合がある。"
1982
1983 #. type: Plain text
1984 #: build/C/man3/getifaddrs.3:131
1985 msgid ""
1986 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1987 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1988 "will contain the broadcast address associated with I<ifa_addr> (if "
1989 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1990 "destination address of the point-to-point interface."
1991 msgstr ""
1992 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
1993 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
1994 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
1995 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
1996 "point インターフェースの宛先アドレスが入るかが決まる。"
1997
1998 #. type: Plain text
1999 #: build/C/man3/getifaddrs.3:136
2000 msgid ""
2001 "The I<ifa_data> field points to a buffer containing address-family-specific "
2002 "data; this field may be NULL if there is no such data for this interface."
2003 msgstr ""
2004 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
2005 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
2006 "フィールドは NULL となる。"
2007
2008 #. type: Plain text
2009 #: build/C/man3/getifaddrs.3:142
2010 msgid ""
2011 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
2012 "freed using B<freeifaddrs>()  when no longer needed."
2013 msgstr ""
2014 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2015 "B<freeifaddrs>() を使って解放すべきである。"
2016
2017 #. type: Plain text
2018 #: build/C/man3/getifaddrs.3:149
2019 msgid ""
2020 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2021 "I<errno> is set appropriately."
2022 msgstr ""
2023 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2024 "が適切に設定される。"
2025
2026 #. type: Plain text
2027 #: build/C/man3/getifaddrs.3:162
2028 msgid ""
2029 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2030 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
2031 "(2), B<malloc>(3), or B<realloc>(3)."
2032 msgstr ""
2033 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には B<socket>"
2034 "(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>"
2035 "(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定される。"
2036
2037 #. type: Plain text
2038 #: build/C/man3/getifaddrs.3:170
2039 msgid ""
2040 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2041 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2042 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2043 "available only on kernels that support netlink."
2044 msgstr ""
2045 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2046 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2047 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2048 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2049
2050 #.  , but the BSD-derived documentation generally
2051 #.  appears to be confused and obsolete on this point.
2052 #.  i.e., commonly it still says one of them will be NULL, even if
2053 #.  the ifa_ifu union is already present
2054 #. type: Plain text
2055 #: build/C/man3/getifaddrs.3:190
2056 msgid ""
2057 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2058 "the BSD systems, but with slightly different semantics documented"
2059 "\\(emreturning one entry per interface, not per address.  This means "
2060 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2061 "address, and no link-level address is returned if the interface has an IP "
2062 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2063 "I<ifa_dstaddr> differs on various systems."
2064 msgstr ""
2065 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2066 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2067 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2068 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2069 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2070 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2071 "どちらを選択するかを決める方法は、 システムにより異なる。"
2072
2073 #. type: Plain text
2074 #: build/C/man3/getifaddrs.3:207
2075 msgid ""
2076 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2077 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2078 "containing lower-level details about the interface and its physical layer.  "
2079 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2080 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2081 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2082 "hE<gt>>), which contains various interface attributes and statistics."
2083 msgstr ""
2084 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2085 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2086 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2087 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2088 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2089 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2090 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2091 "インターフェースの様々な属性や統計情報が入る。"
2092
2093 #. type: Plain text
2094 #: build/C/man3/getifaddrs.3:214
2095 msgid ""
2096 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2097 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2098 "system:"
2099 msgstr ""
2100 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2101 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2102
2103 #. type: Plain text
2104 #: build/C/man3/getifaddrs.3:235
2105 #, no-wrap
2106 msgid ""
2107 "$ B<./a.out>\n"
2108 "lo       AF_PACKET (17)\n"
2109 "                tx_packets =        524; rx_packets =        524\n"
2110 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2111 "wlp3s0   AF_PACKET (17)\n"
2112 "                tx_packets =     108391; rx_packets =     130245\n"
2113 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2114 "em1      AF_PACKET (17)\n"
2115 "                tx_packets =          0; rx_packets =          0\n"
2116 "                tx_bytes   =          0; rx_bytes   =          0\n"
2117 "lo       AF_INET (2)\n"
2118 "                address: E<lt>127.0.0.1E<gt>\n"
2119 "wlp3s0   AF_INET (2)\n"
2120 "                address: E<lt>192.168.235.137E<gt>\n"
2121 "lo       AF_INET6 (10)\n"
2122 "                address: E<lt>::1E<gt>\n"
2123 "wlp3s0   AF_INET6 (10)\n"
2124 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2125 msgstr ""
2126
2127 #. type: SS
2128 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2129 #: build/C/man2/recvmmsg.2:206
2130 #, no-wrap
2131 msgid "Program source"
2132 msgstr "プログラムのソース"
2133
2134 #. type: Plain text
2135 #: build/C/man3/getifaddrs.3:249
2136 #, fuzzy, no-wrap
2137 #| msgid ""
2138 #| "#include E<lt>arpa/inet.hE<gt>\n"
2139 #| "#include E<lt>sys/socket.hE<gt>\n"
2140 #| "#include E<lt>netdb.hE<gt>\n"
2141 #| "#include E<lt>ifaddrs.hE<gt>\n"
2142 #| "#include E<lt>stdio.hE<gt>\n"
2143 #| "#include E<lt>stdlib.hE<gt>\n"
2144 #| "#include E<lt>unistd.hE<gt>\n"
2145 msgid ""
2146 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2147 "#include E<lt>arpa/inet.hE<gt>\n"
2148 "#include E<lt>sys/socket.hE<gt>\n"
2149 "#include E<lt>netdb.hE<gt>\n"
2150 "#include E<lt>ifaddrs.hE<gt>\n"
2151 "#include E<lt>stdio.hE<gt>\n"
2152 "#include E<lt>stdlib.hE<gt>\n"
2153 "#include E<lt>unistd.hE<gt>\n"
2154 "#include E<lt>linux/if_link.hE<gt>\n"
2155 msgstr ""
2156 "#include E<lt>arpa/inet.hE<gt>\n"
2157 "#include E<lt>sys/socket.hE<gt>\n"
2158 "#include E<lt>netdb.hE<gt>\n"
2159 "#include E<lt>ifaddrs.hE<gt>\n"
2160 "#include E<lt>stdio.hE<gt>\n"
2161 "#include E<lt>stdlib.hE<gt>\n"
2162 "#include E<lt>unistd.hE<gt>\n"
2163
2164 #. type: Plain text
2165 #: build/C/man3/getifaddrs.3:255
2166 #, fuzzy, no-wrap
2167 #| msgid ""
2168 #| "int\n"
2169 #| "main(int argc, char *argv[])\n"
2170 #| "{\n"
2171 #| "    struct ifaddrs *ifaddr, *ifa;\n"
2172 #| "    int family, s;\n"
2173 #| "    char host[NI_MAXHOST];\n"
2174 msgid ""
2175 "int main(int argc, char *argv[])\n"
2176 "{\n"
2177 "    struct ifaddrs *ifaddr, *ifa;\n"
2178 "    int family, s, n;\n"
2179 "    char host[NI_MAXHOST];\n"
2180 msgstr ""
2181 "int\n"
2182 "main(int argc, char *argv[])\n"
2183 "{\n"
2184 "    struct ifaddrs *ifaddr, *ifa;\n"
2185 "    int family, s;\n"
2186 "    char host[NI_MAXHOST];\n"
2187
2188 #. type: Plain text
2189 #: build/C/man3/getifaddrs.3:260
2190 #, no-wrap
2191 msgid ""
2192 "    if (getifaddrs(&ifaddr) == -1) {\n"
2193 "        perror(\"getifaddrs\");\n"
2194 "        exit(EXIT_FAILURE);\n"
2195 "    }\n"
2196 msgstr ""
2197 "    if (getifaddrs(&ifaddr) == -1) {\n"
2198 "        perror(\"getifaddrs\");\n"
2199 "        exit(EXIT_FAILURE);\n"
2200 "    }\n"
2201
2202 #. type: Plain text
2203 #: build/C/man3/getifaddrs.3:263
2204 #, no-wrap
2205 msgid ""
2206 "    /* Walk through linked list, maintaining head pointer so we\n"
2207 "       can free list later */\n"
2208 msgstr ""
2209 "    /* Walk through linked list, maintaining head pointer so we\n"
2210 "       can free list later */\n"
2211
2212 #. type: Plain text
2213 #: build/C/man3/getifaddrs.3:267
2214 #, fuzzy, no-wrap
2215 #| msgid ""
2216 #| "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2217 #| "        if (ifa-E<gt>ifa_addr == NULL)\n"
2218 #| "            continue;\n"
2219 msgid ""
2220 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2221 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2222 "            continue;\n"
2223 msgstr ""
2224 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2225 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2226 "            continue;\n"
2227
2228 #. type: Plain text
2229 #: build/C/man3/getifaddrs.3:269
2230 #, no-wrap
2231 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2232 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2233
2234 #. type: Plain text
2235 #: build/C/man3/getifaddrs.3:272
2236 #, no-wrap
2237 msgid ""
2238 "        /* Display interface name and family (including symbolic\n"
2239 "           form of the latter for the common families) */\n"
2240 msgstr ""
2241 "        /* Display interface name and family (including symbolic\n"
2242 "           form of the latter for the common families) */\n"
2243
2244 #. type: Plain text
2245 #: build/C/man3/getifaddrs.3:279
2246 #, fuzzy, no-wrap
2247 #| msgid ""
2248 #| "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2249 #| "                ifa-E<gt>ifa_name, family,\n"
2250 #| "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2251 #| "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2252 #| "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2253 msgid ""
2254 "        printf(\"%-8s %s (%d)\\en\",\n"
2255 "               ifa-E<gt>ifa_name,\n"
2256 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2257 "               (family == AF_INET) ? \"AF_INET\" :\n"
2258 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2259 "               family);\n"
2260 msgstr ""
2261 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2262 "                ifa-E<gt>ifa_name, family,\n"
2263 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2264 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2265 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2266
2267 #. type: Plain text
2268 #: build/C/man3/getifaddrs.3:281
2269 #, no-wrap
2270 msgid "        /* For an AF_INET* interface address, display the address */\n"
2271 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2272
2273 #. type: Plain text
2274 #: build/C/man3/getifaddrs.3:292
2275 #, fuzzy, no-wrap
2276 #| msgid ""
2277 #| "        if (family == AF_INET || family == AF_INET6) {\n"
2278 #| "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2279 #| "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2280 #| "                                          sizeof(struct sockaddr_in6),\n"
2281 #| "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2282 #| "            if (s != 0) {\n"
2283 #| "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2284 #| "                exit(EXIT_FAILURE);\n"
2285 #| "            }\n"
2286 #| "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2287 #| "        }\n"
2288 #| "    }\n"
2289 msgid ""
2290 "        if (family == AF_INET || family == AF_INET6) {\n"
2291 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2292 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2293 "                                          sizeof(struct sockaddr_in6),\n"
2294 "                    host, NI_MAXHOST,\n"
2295 "                    NULL, 0, NI_NUMERICHOST);\n"
2296 "            if (s != 0) {\n"
2297 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2298 "                exit(EXIT_FAILURE);\n"
2299 "            }\n"
2300 msgstr ""
2301 "        if (family == AF_INET || family == AF_INET6) {\n"
2302 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2303 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2304 "                                          sizeof(struct sockaddr_in6),\n"
2305 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2306 "            if (s != 0) {\n"
2307 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2308 "                exit(EXIT_FAILURE);\n"
2309 "            }\n"
2310 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2311 "        }\n"
2312 "    }\n"
2313
2314 #. type: Plain text
2315 #: build/C/man3/getifaddrs.3:294
2316 #, no-wrap
2317 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2318 msgstr ""
2319
2320 #. type: Plain text
2321 #: build/C/man3/getifaddrs.3:297
2322 #, no-wrap
2323 msgid ""
2324 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2325 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2326 msgstr ""
2327
2328 #. type: Plain text
2329 #: build/C/man3/getifaddrs.3:304
2330 #, no-wrap
2331 msgid ""
2332 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2333 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2334 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2335 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2336 "        }\n"
2337 "    }\n"
2338 msgstr ""
2339
2340 #. type: Plain text
2341 #: build/C/man3/getifaddrs.3:308
2342 #, no-wrap
2343 msgid ""
2344 "    freeifaddrs(ifaddr);\n"
2345 "    exit(EXIT_SUCCESS);\n"
2346 "}\n"
2347 msgstr ""
2348 "    freeifaddrs(ifaddr);\n"
2349 "    exit(EXIT_SUCCESS);\n"
2350 "}\n"
2351
2352 #. type: Plain text
2353 #: build/C/man3/getifaddrs.3:315
2354 msgid ""
2355 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2356 msgstr ""
2357 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2358
2359 #. type: TH
2360 #: build/C/man2/getsockname.2:40
2361 #, no-wrap
2362 msgid "GETSOCKNAME"
2363 msgstr "GETSOCKNAME"
2364
2365 #. type: Plain text
2366 #: build/C/man2/getsockname.2:43
2367 msgid "getsockname - get socket name"
2368 msgstr "getsockname - ソケットの名前を取得する"
2369
2370 #. type: Plain text
2371 #: build/C/man2/getsockname.2:49
2372 #, no-wrap
2373 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2374 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2375
2376 #. type: Plain text
2377 #: build/C/man2/getsockname.2:62
2378 msgid ""
2379 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2380 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2381 "should be initialized to indicate the amount of space (in bytes) pointed to "
2382 "by I<addr>.  On return it contains the actual size of the socket address."
2383 msgstr ""
2384 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2385 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2386 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2387 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2388 "納される。"
2389
2390 #. type: Plain text
2391 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2392 #: build/C/man2/listen.2:96
2393 msgid "The argument I<sockfd> is not a valid descriptor."
2394 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2395
2396 #. type: Plain text
2397 #: build/C/man2/getsockname.2:84
2398 msgid ""
2399 "The I<addr> argument points to memory not in a valid part of the process "
2400 "address space."
2401 msgstr ""
2402 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2403 "い。"
2404
2405 #. type: Plain text
2406 #: build/C/man2/getsockname.2:88
2407 msgid "I<addrlen> is invalid (e.g., is negative)."
2408 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2409
2410 #. type: TP
2411 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2412 #: build/C/man2/send.2:335
2413 #, no-wrap
2414 msgid "B<ENOBUFS>"
2415 msgstr "B<ENOBUFS>"
2416
2417 #. type: Plain text
2418 #: build/C/man2/getsockname.2:92
2419 msgid ""
2420 "Insufficient resources were available in the system to perform the operation."
2421 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2422
2423 #. type: Plain text
2424 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2425 msgid "The argument I<sockfd> is a file, not a socket."
2426 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2427
2428 #.  SVr4 documents additional ENOMEM
2429 #.  and ENOSR error codes.
2430 #. type: Plain text
2431 #: build/C/man2/getsockname.2:103
2432 msgid ""
2433 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2434 "POSIX.1-2001."
2435 msgstr ""
2436 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2437
2438 #. type: Plain text
2439 #: build/C/man2/getsockname.2:114
2440 msgid ""
2441 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2442 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2443 "resulted in the present I<socklen_t>, also used by glibc.  See also B<accept>"
2444 "(2)."
2445 msgstr ""
2446 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2447 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2448 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2449
2450 #. type: Plain text
2451 #: build/C/man2/getsockname.2:121
2452 msgid ""
2453 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2454 "(7)"
2455 msgstr ""
2456 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2457 "(7)"
2458
2459 #. type: TH
2460 #: build/C/man2/getsockopt.2:44
2461 #, no-wrap
2462 msgid "GETSOCKOPT"
2463 msgstr "GETSOCKOPT"
2464
2465 #. type: TH
2466 #: build/C/man2/getsockopt.2:44
2467 #, fuzzy, no-wrap
2468 #| msgid "2009-01-19"
2469 msgid "2014-01-24"
2470 msgstr "2009-01-19"
2471
2472 #. type: Plain text
2473 #: build/C/man2/getsockopt.2:47
2474 msgid "getsockopt, setsockopt - get and set options on sockets"
2475 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2476
2477 #. type: Plain text
2478 #: build/C/man2/getsockopt.2:57
2479 #, no-wrap
2480 msgid ""
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 msgstr ""
2486 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2487 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2488 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2489 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2490
2491 #. type: Plain text
2492 #: build/C/man2/getsockopt.2:67
2493 msgid ""
2494 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2495 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2496 "protocol levels; they are always present at the uppermost socket level."
2497 msgstr ""
2498 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2499 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2500 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2501 "定される。"
2502
2503 #. type: Plain text
2504 #: build/C/man2/getsockopt.2:86
2505 msgid ""
2506 "When manipulating socket options, the level at which the option resides and "
2507 "the name of the option must be specified.  To manipulate options at the "
2508 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2509 "options at any other level the protocol number of the appropriate protocol "
2510 "controlling the option is supplied.  For example, to indicate that an option "
2511 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2512 "protocol number of B<TCP>; see B<getprotoent>(3)."
2513 msgstr ""
2514 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2515 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2516 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2517 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2518 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2519 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2520 "B<getprotoent>(3)  を参照すること。"
2521
2522 #. type: Plain text
2523 #: build/C/man2/getsockopt.2:108
2524 msgid ""
2525 "The arguments I<optval> and I<optlen> are used to access option values for "
2526 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2527 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2528 "I<optlen> is a value-result argument, initially containing the size of the "
2529 "buffer pointed to by I<optval>, and modified on return to indicate the "
2530 "actual size of the value returned.  If no option value is to be supplied or "
2531 "returned, I<optval> may be NULL."
2532 msgstr ""
2533 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2534 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2535 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2536 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2537 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2538 "I<optval> は NULL でも良い。"
2539
2540 #. type: Plain text
2541 #: build/C/man2/getsockopt.2:118
2542 msgid ""
2543 "I<Optname> and any specified options are passed uninterpreted to the "
2544 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2545 "socket.hE<gt>> contains definitions for socket level options, described "
2546 "below.  Options at other protocol levels vary in format and name; consult "
2547 "the appropriate entries in section 4 of the manual."
2548 msgstr ""
2549 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2550 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2551 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2552 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2553 "ること。"
2554
2555 #. type: Plain text
2556 #: build/C/man2/getsockopt.2:127
2557 msgid ""
2558 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2559 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2560 "or zero if the option is to be disabled."
2561 msgstr ""
2562 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2563 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2564 "を指定し、 無効(disable)にするにはゼロを指定する。"
2565
2566 #. type: Plain text
2567 #: build/C/man2/getsockopt.2:131
2568 msgid ""
2569 "For a description of the available socket options see B<socket>(7)  and the "
2570 "appropriate protocol man pages."
2571 msgstr ""
2572 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2573 "ルの man ページを参照のこと。"
2574
2575 #. type: Plain text
2576 #: build/C/man2/getsockopt.2:152
2577 msgid ""
2578 "The address pointed to by I<optval> is not in a valid part of the process "
2579 "address space.  For B<getsockopt>(), this error may also be returned if "
2580 "I<optlen> is not in a valid part of the process address space."
2581 msgstr ""
2582 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2583 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2584 "い場合にもこのエラーが返される。"
2585
2586 #. type: Plain text
2587 #: build/C/man2/getsockopt.2:163
2588 msgid ""
2589 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2590 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2591 "option described in B<ip>(7))."
2592 msgstr ""
2593 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2594 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2595 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2596
2597 #. type: TP
2598 #: build/C/man2/getsockopt.2:163
2599 #, no-wrap
2600 msgid "B<ENOPROTOOPT>"
2601 msgstr "B<ENOPROTOOPT>"
2602
2603 #. type: Plain text
2604 #: build/C/man2/getsockopt.2:166
2605 msgid "The option is unknown at the level indicated."
2606 msgstr "指定された層(level)にはこのオプションは存在しない。"
2607
2608 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2609 #.  not document the
2610 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2611 #.  options
2612 #. type: Plain text
2613 #: build/C/man2/getsockopt.2:178
2614 msgid ""
2615 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2616 msgstr ""
2617 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2618 "POSIX.1-2001."
2619
2620 #. type: Plain text
2621 #: build/C/man2/getsockopt.2:199
2622 msgid ""
2623 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2624 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2625 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2626 "glibc.  See also B<accept>(2)."
2627 msgstr ""
2628 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2629 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2630 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2631 "る。 B<accept>(2)  も参照のこと。"
2632
2633 #. type: Plain text
2634 #: build/C/man2/getsockopt.2:202
2635 msgid ""
2636 "Several of the socket options should be handled at lower levels of the "
2637 "system."
2638 msgstr ""
2639 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2640
2641 #. type: Plain text
2642 #: build/C/man2/getsockopt.2:212
2643 #, fuzzy
2644 #| msgid ""
2645 #| "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>"
2646 #| "(7), B<tcp>(7), B<unix>(7)"
2647 msgid ""
2648 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2649 "B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2650 msgstr ""
2651 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2652 "B<tcp>(7), B<unix>(7)"
2653
2654 #. type: TH
2655 #: build/C/man3/if_nameindex.3:26
2656 #, no-wrap
2657 msgid "IF_NAMEINDEX"
2658 msgstr "IF_NAMEINDEX"
2659
2660 #. type: TH
2661 #: build/C/man3/if_nameindex.3:26
2662 #, no-wrap
2663 msgid "2012-11-21"
2664 msgstr "2012-11-21"
2665
2666 #. type: Plain text
2667 #: build/C/man3/if_nameindex.3:29
2668 msgid ""
2669 "if_nameindex, if_freenameindex - get network interface names and indexes"
2670 msgstr ""
2671 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2672 "クスを取得する"
2673
2674 #. type: Plain text
2675 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2676 #, no-wrap
2677 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2678 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2679
2680 #. type: Plain text
2681 #: build/C/man3/if_nameindex.3:35
2682 #, no-wrap
2683 msgid ""
2684 "B<struct if_nameindex *if_nameindex(void);>\n"
2685 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2686 msgstr ""
2687 "B<struct if_nameindex *if_nameindex(void);>\n"
2688 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2689
2690 #. type: Plain text
2691 #: build/C/man3/if_nameindex.3:46
2692 msgid ""
2693 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2694 "structures, each containing information about one of the network interfaces "
2695 "on the local system.  The I<if_nameindex> structure contains at least the "
2696 "following entries:"
2697 msgstr ""
2698 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2699 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2700 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2701
2702 #. type: Plain text
2703 #: build/C/man3/if_nameindex.3:51
2704 #, no-wrap
2705 msgid ""
2706 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2707 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2708 msgstr ""
2709 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2710 "    char        *if_name;  /* NULL 終端された名前 (\"eth0\" など) */\n"
2711
2712 #. type: Plain text
2713 #: build/C/man3/if_nameindex.3:65
2714 msgid ""
2715 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2716 "points to the null-terminated interface name.  The end of the array is "
2717 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2718 msgstr ""
2719 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2720 "フィールドは NULL 終端されたインターフェース名を指す。 配列の最後は、 "
2721 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2722
2723 #. type: Plain text
2724 #: build/C/man3/if_nameindex.3:71
2725 msgid ""
2726 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2727 "and should be freed using B<if_freenameindex>()  when no longer needed."
2728 msgstr ""
2729 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2730 "は B<if_freenameindex>() で解放すべきである。"
2731
2732 #. type: Plain text
2733 #: build/C/man3/if_nameindex.3:78
2734 #, fuzzy
2735 #| msgid ""
2736 #| "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2737 #| "NULL pointer is returned, and I<errno> is set appropriately."
2738 msgid ""
2739 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2740 "is returned, and I<errno> is set appropriately."
2741 msgstr ""
2742 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2743 "NULL ポインタが返され、 I<errno> が適切に設定される。"
2744
2745 #. type: Plain text
2746 #: build/C/man3/if_nameindex.3:83
2747 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2748 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2749
2750 #. type: Plain text
2751 #: build/C/man3/if_nameindex.3:86
2752 msgid "Insufficient resources available."
2753 msgstr "利用可能なリソースが十分にない。"
2754
2755 #. type: Plain text
2756 #: build/C/man3/if_nameindex.3:97
2757 msgid ""
2758 "B<if_nameindex>()  may also fail for any of the errors specified for "
2759 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2760 "B<sendto>(2), or B<malloc>(3)."
2761 msgstr ""
2762 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>"
2763 "(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定されているエラーの"
2764 "いずれかで失敗する場合がある。"
2765
2766 #. type: Plain text
2767 #: build/C/man3/if_nameindex.3:104
2768 msgid ""
2769 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2770 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2771 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2772 "available only on kernels that support netlink."
2773 msgstr ""
2774 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2775 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2776 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2777 "netlink をサポートするカーネルにおいてのみである。"
2778
2779 #. type: Plain text
2780 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2781 msgid "RFC\\ 3493, POSIX.1-2001."
2782 msgstr "RFC\\ 3493, POSIX.1-2001."
2783
2784 #. type: Plain text
2785 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2786 msgid "This function first appeared in BSDi."
2787 msgstr "この関数は BSDi 初めて登場した。"
2788
2789 #. type: Plain text
2790 #: build/C/man3/if_nameindex.3:112
2791 msgid ""
2792 "The program below demonstrates the use of the functions described on this "
2793 "page.  An example of the output this program might produce is the following:"
2794 msgstr ""
2795 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2796 "ムが生成する出力は以下のようになる。"
2797
2798 #. type: Plain text
2799 #: build/C/man3/if_nameindex.3:119
2800 #, no-wrap
2801 msgid ""
2802 "$ B<./a.out>I<\n"
2803 "1: lo\n"
2804 "2: wlan0\n"
2805 "3: em1>\n"
2806 msgstr ""
2807 "$ B<./a.out>I<\n"
2808 "1: lo\n"
2809 "2: wlan0\n"
2810 "3: em1>\n"
2811
2812 #. type: Plain text
2813 #: build/C/man3/if_nameindex.3:127
2814 #, no-wrap
2815 msgid ""
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 msgstr ""
2821 "#include E<lt>net/if.hE<gt>\n"
2822 "#include E<lt>stdio.hE<gt>\n"
2823 "#include E<lt>stdlib.hE<gt>\n"
2824 "#include E<lt>unistd.hE<gt>\n"
2825
2826 #. type: Plain text
2827 #: build/C/man3/if_nameindex.3:132
2828 #, no-wrap
2829 msgid ""
2830 "int\n"
2831 "main(int argc, char *argv[])\n"
2832 "{\n"
2833 "    struct if_nameindex *if_ni, *i;\n"
2834 msgstr ""
2835 "int\n"
2836 "main(int argc, char *argv[])\n"
2837 "{\n"
2838 "    struct if_nameindex *if_ni, *i;\n"
2839
2840 #. type: Plain text
2841 #: build/C/man3/if_nameindex.3:138
2842 #, no-wrap
2843 msgid ""
2844 "    if_ni = if_nameindex();\n"
2845 "    if (if_ni == NULL) {\n"
2846 "        perror(\"if_nameindex\");\n"
2847 "        exit(EXIT_FAILURE);\n"
2848 "    }\n"
2849 msgstr ""
2850 "    if_ni = if_nameindex();\n"
2851 "    if (if_ni == NULL) {\n"
2852 "        perror(\"if_nameindex\");\n"
2853 "        exit(EXIT_FAILURE);\n"
2854 "    }\n"
2855
2856 #. type: Plain text
2857 #: build/C/man3/if_nameindex.3:141
2858 #, no-wrap
2859 msgid ""
2860 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2861 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2862 msgstr ""
2863 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2864 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2865
2866 #. type: Plain text
2867 #: build/C/man3/if_nameindex.3:143
2868 #, no-wrap
2869 msgid "    if_freenameindex(if_ni);\n"
2870 msgstr "    if_freenameindex(if_ni);\n"
2871
2872 #. type: Plain text
2873 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:584
2874 #, no-wrap
2875 msgid ""
2876 "    exit(EXIT_SUCCESS);\n"
2877 "}\n"
2878 msgstr ""
2879 "    exit(EXIT_SUCCESS);\n"
2880 "}\n"
2881
2882 #. type: Plain text
2883 #: build/C/man3/if_nameindex.3:154
2884 msgid ""
2885 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2886 "B<if_nametoindex>(3), B<ifconfig>(8)"
2887 msgstr ""
2888 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2889 "B<if_nametoindex>(3), B<ifconfig>(8)"
2890
2891 #. type: TH
2892 #: build/C/man3/if_nametoindex.3:25
2893 #, no-wrap
2894 msgid "IF_NAMETOINDEX"
2895 msgstr "IF_NAMETOINDEX"
2896
2897 #. type: TH
2898 #: build/C/man3/if_nametoindex.3:25
2899 #, no-wrap
2900 msgid "2012-12-14"
2901 msgstr "2012-12-14"
2902
2903 #. type: Plain text
2904 #: build/C/man3/if_nametoindex.3:29
2905 msgid ""
2906 "if_nametoindex, if_indextoname - mappings between network interface names "
2907 "and indexes"
2908 msgstr ""
2909 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2910 "クスのマッピングを行う"
2911
2912 #. type: Plain text
2913 #: build/C/man3/if_nametoindex.3:34
2914 #, no-wrap
2915 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2916 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2917
2918 #. type: Plain text
2919 #: build/C/man3/if_nametoindex.3:36
2920 #, no-wrap
2921 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2922 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2923
2924 #. type: Plain text
2925 #: build/C/man3/if_nametoindex.3:43
2926 msgid ""
2927 "The B<if_nametoindex>()  function returns the index of the network interface "
2928 "corresponding to the name I<ifname>."
2929 msgstr ""
2930 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2931 "のインデックスを返す。"
2932
2933 #. type: Plain text
2934 #: build/C/man3/if_nametoindex.3:54
2935 msgid ""
2936 "The B<if_indextoname>()  function returns the name of the network interface "
2937 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2938 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2939 "least B<IF_NAMESIZE> bytes."
2940 msgstr ""
2941 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2942 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2943 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2944 "る。"
2945
2946 #. type: Plain text
2947 #: build/C/man3/if_nametoindex.3:61
2948 msgid ""
2949 "On success, B<if_nametoindex>()  returns the index number of the network "
2950 "interface; on error, 0 is returned and I<errno> is set appropriately."
2951 msgstr ""
2952 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2953 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2954
2955 #. type: Plain text
2956 #: build/C/man3/if_nametoindex.3:69
2957 msgid ""
2958 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2959 "returned and I<errno> is set appropriately."
2960 msgstr ""
2961 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2962 "が返され、 I<errno> が適切に設定される。"
2963
2964 #. type: Plain text
2965 #: build/C/man3/if_nametoindex.3:74
2966 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2967 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2968
2969 #. type: TP
2970 #: build/C/man3/if_nametoindex.3:74
2971 #, no-wrap
2972 msgid "B<ENXIO>"
2973 msgstr "B<ENXIO>"
2974
2975 #. type: Plain text
2976 #: build/C/man3/if_nametoindex.3:77
2977 msgid "No interface found for the index."
2978 msgstr "インデックスに対応するインターフェースがない。"
2979
2980 #. type: Plain text
2981 #: build/C/man3/if_nametoindex.3:85
2982 msgid ""
2983 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2984 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2985 msgstr ""
2986 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2987 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2988
2989 #. type: Plain text
2990 #: build/C/man3/if_nametoindex.3:93
2991 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2992 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2993
2994 #. type: TH
2995 #: build/C/man2/listen.2:45
2996 #, no-wrap
2997 msgid "LISTEN"
2998 msgstr "LISTEN"
2999
3000 #. type: TH
3001 #: build/C/man2/listen.2:45
3002 #, no-wrap
3003 msgid "2008-11-20"
3004 msgstr "2008-11-20"
3005
3006 #. type: Plain text
3007 #: build/C/man2/listen.2:48
3008 msgid "listen - listen for connections on a socket"
3009 msgstr "listen - ソケット(socket)上の接続を待つ"
3010
3011 #. type: Plain text
3012 #: build/C/man2/listen.2:55
3013 #, no-wrap
3014 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3015 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3016
3017 #. type: Plain text
3018 #: build/C/man2/listen.2:63
3019 msgid ""
3020 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
3021 "that is, as a socket that will be used to accept incoming connection "
3022 "requests using B<accept>(2)."
3023 msgstr ""
3024 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3025 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
3026 "した接続要求を受け付けるのに使用されるソケットである。"
3027
3028 #. type: Plain text
3029 #: build/C/man2/listen.2:70
3030 msgid ""
3031 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3032 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3033 msgstr ""
3034 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3035 "するファイルディスクリプタである。"
3036
3037 #. type: Plain text
3038 #: build/C/man2/listen.2:82
3039 msgid ""
3040 "The I<backlog> argument defines the maximum length to which the queue of "
3041 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3042 "when the queue is full, the client may receive an error with an indication "
3043 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3044 "the request may be ignored so that a later reattempt at connection succeeds."
3045 msgstr ""
3046 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3047 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3048 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3049 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3050 "い。"
3051
3052 #. type: Plain text
3053 #: build/C/man2/listen.2:91
3054 msgid "Another socket is already listening on the same port."
3055 msgstr "別のソケットが既に同じポートを listen している。"
3056
3057 #. type: Plain text
3058 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
3059 msgid "The argument I<sockfd> is not a socket."
3060 msgstr "引き数 I<sockfd> はソケットではない。"
3061
3062 #. type: Plain text
3063 #: build/C/man2/listen.2:106
3064 msgid "The socket is not of a type that supports the B<listen>()  operation."
3065 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3066
3067 #. type: Plain text
3068 #: build/C/man2/listen.2:111
3069 msgid ""
3070 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3071 "4.2BSD."
3072 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3073
3074 #. type: Plain text
3075 #: build/C/man2/listen.2:113
3076 msgid "To accept connections, the following steps are performed:"
3077 msgstr "接続を受け付けるには、以下の処理が実行される。"
3078
3079 #. type: TP
3080 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
3081 #, no-wrap
3082 msgid "1."
3083 msgstr "1."
3084
3085 #. type: Plain text
3086 #: build/C/man2/listen.2:117
3087 msgid "A socket is created with B<socket>(2)."
3088 msgstr "B<socket>(2)  でソケットを作成する。"
3089
3090 #. type: TP
3091 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
3092 #, no-wrap
3093 msgid "2."
3094 msgstr "2."
3095
3096 #. type: Plain text
3097 #: build/C/man2/listen.2:123
3098 msgid ""
3099 "The socket is bound to a local address using B<bind>(2), so that other "
3100 "sockets may be B<connect>(2)ed to it."
3101 msgstr ""
3102 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3103 "のソケットに B<connect>(2)  できるようにする。"
3104
3105 #. type: TP
3106 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
3107 #, no-wrap
3108 msgid "3."
3109 msgstr "3."
3110
3111 #. type: Plain text
3112 #: build/C/man2/listen.2:127
3113 msgid ""
3114 "A willingness to accept incoming connections and a queue limit for incoming "
3115 "connections are specified with B<listen>()."
3116 msgstr ""
3117 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3118 "定する。"
3119
3120 #. type: TP
3121 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
3122 #, no-wrap
3123 msgid "4."
3124 msgstr "4."
3125
3126 #. type: Plain text
3127 #: build/C/man2/listen.2:130
3128 msgid "Connections are accepted with B<accept>(2)."
3129 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3130
3131 #. type: Plain text
3132 #: build/C/man2/listen.2:153
3133 msgid ""
3134 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3135 "2.2.  Now it specifies the queue length for I<completely> established "
3136 "sockets waiting to be accepted, instead of the number of incomplete "
3137 "connection requests.  The maximum length of the queue for incomplete sockets "
3138 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3139 "are enabled there is no logical maximum length and this setting is ignored.  "
3140 "See B<tcp>(7)  for more information."
3141 msgstr ""
3142 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3143 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3144 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3145 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3146 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3147 "論理的な最大長は存在せず、この設定は無視される。"
3148
3149 #.  The following is now rather historic information (MTK, Jun 05)
3150 #.  Don't rely on this value in portable applications since BSD
3151 #.  (and some BSD-derived systems) limit the backlog to 5.
3152 #. type: Plain text
3153 #: build/C/man2/listen.2:166
3154 msgid ""
3155 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3156 "somaxconn>, then it is silently truncated to that value; the default value "
3157 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3158 "value, B<SOMAXCONN>, with the value 128."
3159 msgstr ""
3160 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3161 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3162 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3163 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3164
3165 #. type: Plain text
3166 #: build/C/man2/listen.2:175
3167 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3168 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3169
3170 #. type: TH
3171 #: build/C/man2/recv.2:41
3172 #, no-wrap
3173 msgid "RECV"
3174 msgstr "RECV"
3175
3176 #. type: TH
3177 #: build/C/man2/recv.2:41
3178 #, fuzzy, no-wrap
3179 #| msgid "2012-11-11"
3180 msgid "2014-02-11"
3181 msgstr "2012-11-11"
3182
3183 #. type: Plain text
3184 #: build/C/man2/recv.2:44
3185 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3186 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3187
3188 #. type: Plain text
3189 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3190 #: build/C/man2/select_tut.2:47
3191 #, no-wrap
3192 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3193 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3194
3195 #. type: Plain text
3196 #: build/C/man2/recv.2:53
3197 #, no-wrap
3198 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3199 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3200
3201 #. type: Plain text
3202 #: build/C/man2/recv.2:56
3203 #, no-wrap
3204 msgid ""
3205 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3206 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3207 msgstr ""
3208 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3209 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3210
3211 #. type: Plain text
3212 #: build/C/man2/recv.2:58
3213 #, no-wrap
3214 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3215 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3216
3217 #. type: Plain text
3218 #: build/C/man2/recv.2:70
3219 #, fuzzy
3220 #| msgid ""
3221 #| "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages "
3222 #| "from a socket, and may be used to receive data on a socket whether or not "
3223 #| "it is connection-oriented."
3224 msgid ""
3225 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3226 "messages from a socket.  They may be used to receive data on both "
3227 "connectionless and connection-oriented sockets.  This page first describes "
3228 "common features of all three system calls, and then describes the "
3229 "differences between the calls."
3230 msgstr ""
3231 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3232 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3233 "接続指向 (connection-oriened) であってもなくてもよい。"
3234
3235 #. type: Plain text
3236 #: build/C/man2/recv.2:76
3237 #, fuzzy
3238 #| msgid ""
3239 #| "All three routines return the length of the message on successful "
3240 #| "completion.  If a message is too long to fit in the supplied buffer, "
3241 #| "excess bytes may be discarded depending on the type of socket the message "
3242 #| "is received from."
3243 msgid ""
3244 "All three calls return the length of the message on successful completion.  "
3245 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3246 "discarded depending on the type of socket the message is received from."
3247 msgstr ""
3248 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3249 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3250 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3251
3252 #. type: Plain text
3253 #: build/C/man2/recv.2:86
3254 msgid ""
3255 "If no messages are available at the socket, the receive calls wait for a "
3256 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3257 "which case the value -1 is returned and the external variable I<errno> is "
3258 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3259 "data available, up to the requested amount, rather than waiting for receipt "
3260 "of the full amount requested."
3261 msgstr ""
3262 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3263 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3264 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3265 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3266 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3267 "る (受信されるデータの最大サイズは要求したサイズである)。"
3268
3269 #. type: Plain text
3270 #: build/C/man2/recv.2:93
3271 #, fuzzy
3272 #| msgid ""
3273 #| "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3274 #| "data arrives."
3275 msgid ""
3276 "An application can used B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3277 "determine when more data arrives on a socket."
3278 msgstr ""
3279 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3280 "る。"
3281
3282 #. type: SS
3283 #: build/C/man2/recv.2:93
3284 #, no-wrap
3285 msgid "The flags argument"
3286 msgstr ""
3287
3288 #. type: Plain text
3289 #: build/C/man2/recv.2:97
3290 #, fuzzy
3291 #| msgid ""
3292 #| "The I<flags> argument to a B<recv>()  call is formed by ORing one or more "
3293 #| "of the following values:"
3294 msgid ""
3295 "The I<flags> argument is formed by ORing one or more of the following values:"
3296 msgstr ""
3297 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3298 "和 を取ったものを指定する:"
3299
3300 #. type: TP
3301 #: build/C/man2/recv.2:97
3302 #, no-wrap
3303 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3304 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3305
3306 #. type: Plain text
3307 #: build/C/man2/recv.2:108
3308 msgid ""
3309 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3310 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3311 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3312 "flag of B<open>(2)."
3313 msgstr ""
3314 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3315 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3316 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3317 "同じ理由で有用である。"
3318
3319 #. type: TP
3320 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3321 #, no-wrap
3322 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3323 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3324
3325 #. type: Plain text
3326 #: build/C/man2/recv.2:118
3327 msgid ""
3328 "Enables nonblocking operation; if the operation would block, the call fails "
3329 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3330 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3331 msgstr ""
3332 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3333 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3334 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3335
3336 #. type: TP
3337 #: build/C/man2/recv.2:118
3338 #, no-wrap
3339 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3340 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3341
3342 #. type: Plain text
3343 #: build/C/man2/recv.2:137
3344 msgid ""
3345 "This flag specifies that queued errors should be received from the socket "
3346 "error queue.  The error is passed in an ancillary message with a type "
3347 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3348 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3349 "information.  The payload of the original packet that caused the error is "
3350 "passed as normal data via I<msg_iovec>.  The original destination address of "
3351 "the datagram that caused the error is supplied via I<msg_name>."
3352 msgstr ""
3353 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3354 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3355 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3356 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3357 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3358 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3359 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3360 "I<msg_name> 経由で参照できる。"
3361
3362 #. type: Plain text
3363 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3364 msgid ""
3365 "For local errors, no address is passed (this can be checked with the "
3366 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3367 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3368 "the pending socket error is regenerated based on the next queued error and "
3369 "will be passed on the next socket operation."
3370 msgstr ""
3371 "ローカルなエラーの場合はアドレスは渡されない\n"
3372 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3373 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3374 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3375 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3376
3377 #. type: Plain text
3378 #: build/C/man2/recv.2:153
3379 msgid "The error is supplied in a I<sock_extended_err> structure:"
3380 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3381
3382 #. type: Plain text
3383 #: build/C/man2/recv.2:160
3384 #, no-wrap
3385 msgid ""
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 msgstr ""
3391 "#define SO_EE_ORIGIN_NONE    0\n"
3392 "#define SO_EE_ORIGIN_LOCAL   1\n"
3393 "#define SO_EE_ORIGIN_ICMP    2\n"
3394 "#define SO_EE_ORIGIN_ICMP6   3\n"
3395
3396 #. type: Plain text
3397 #: build/C/man2/recv.2:172
3398 #, no-wrap
3399 msgid ""
3400 "struct sock_extended_err\n"
3401 "{\n"
3402 "    uint32_t ee_errno;   /* error number */\n"
3403 "    uint8_t  ee_origin;  /* where the error originated */\n"
3404 "    uint8_t  ee_type;    /* type */\n"
3405 "    uint8_t  ee_code;    /* code */\n"
3406 "    uint8_t  ee_pad;     /* padding */\n"
3407 "    uint32_t ee_info;    /* additional information */\n"
3408 "    uint32_t ee_data;    /* other data */\n"
3409 "    /* More data may follow */\n"
3410 "};\n"
3411 msgstr ""
3412 "struct sock_extended_err\n"
3413 "{\n"
3414 "    uint32_t ee_errno;   /* error number */\n"
3415 "    uint8_t  ee_origin;  /* where the error originated */\n"
3416 "    uint8_t  ee_type;    /* type */\n"
3417 "    uint8_t  ee_code;    /* code */\n"
3418 "    uint8_t  ee_pad;     /* padding */\n"
3419 "    uint32_t ee_info;    /* additional information */\n"
3420 "    uint32_t ee_data;    /* other data */\n"
3421 "    /* More data may follow */\n"
3422 "};\n"
3423
3424 #. type: Plain text
3425 #: build/C/man2/recv.2:174
3426 #, no-wrap
3427 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3428 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3429
3430 #. type: Plain text
3431 #: build/C/man2/recv.2:198
3432 msgid ""
3433 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3434 "is the origin code of where the error originated.  The other fields are "
3435 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3436 "address of the network object where the error originated from given a "
3437 "pointer to the ancillary message.  If this address is not known, the "
3438 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3439 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3440 "caused the error is passed as normal data."
3441 msgstr ""
3442 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3443 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3444 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3445 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3446 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3447 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3448 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3449 "される。"
3450
3451 #. type: TP
3452 #: build/C/man2/recv.2:212 build/C/man2/recv.2:393 build/C/man2/send.2:230
3453 #, no-wrap
3454 msgid "B<MSG_OOB>"
3455 msgstr "B<MSG_OOB>"
3456
3457 #. type: Plain text
3458 #: build/C/man2/recv.2:219
3459 msgid ""
3460 "This flag requests receipt of out-of-band data that would not be received in "
3461 "the normal data stream.  Some protocols place expedited data at the head of "
3462 "the normal data queue, and thus this flag cannot be used with such protocols."
3463 msgstr ""
3464 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3465 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3466 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3467 "い。"
3468
3469 #. type: TP
3470 #: build/C/man2/recv.2:219
3471 #, no-wrap
3472 msgid "B<MSG_PEEK>"
3473 msgstr "B<MSG_PEEK>"
3474
3475 #. type: Plain text
3476 #: build/C/man2/recv.2:226
3477 msgid ""
3478 "This flag causes the receive operation to return data from the beginning of "
3479 "the receive queue without removing that data from the queue.  Thus, a "
3480 "subsequent receive call will return the same data."
3481 msgstr ""
3482 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3483 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3484 "が返ることになる。"
3485
3486 #. type: TP
3487 #: build/C/man2/recv.2:226
3488 #, no-wrap
3489 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3490 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3491
3492 #. type: Plain text
3493 #: build/C/man2/recv.2:234
3494 #, fuzzy
3495 #| msgid ""
3496 #| "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3497 #| "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3498 #| "return the real length of the packet or datagram, even when it was longer "
3499 #| "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3500 #| "sockets."
3501 msgid ""
3502 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3503 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3504 "return the real length of the packet or datagram, even when it was longer "
3505 "than the passed buffer."
3506 msgstr ""
3507 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3508 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3509 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3510 "場合にも、 パケットやデータグラムの実際の長さを返す。 UNIX ドメインソケット "
3511 "(B<unix>(7))  ソケットについては実装されていない。"
3512
3513 #. type: Plain text
3514 #: build/C/man2/recv.2:237
3515 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3516 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3517
3518 #. type: TP
3519 #: build/C/man2/recv.2:237
3520 #, no-wrap
3521 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3522 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3523
3524 #. type: Plain text
3525 #: build/C/man2/recv.2:245
3526 msgid ""
3527 "This flag requests that the operation block until the full request is "
3528 "satisfied.  However, the call may still return less data than requested if a "
3529 "signal is caught, an error or disconnect occurs, or the next data to be "
3530 "received is of a different type than that returned."
3531 msgstr ""
3532 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3533 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3534 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3535 "りデータが少なくても返ることがある。"
3536
3537 #. type: SS
3538 #: build/C/man2/recv.2:245
3539 #, no-wrap
3540 msgid "recvfrom()"
3541 msgstr ""
3542
3543 #. type: Plain text
3544 #: build/C/man2/recv.2:251
3545 msgid ""
3546 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3547 "caller must specify the size of the buffer in I<len>."
3548 msgstr ""
3549
3550 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3551 #.  .I src_addr
3552 #.  is filled in.
3553 #.  .I src_addr
3554 #.  is also filled in for stream sockets in the UNIX domain, but is not
3555 #.  filled in for stream sockets in the Internet domain.)
3556 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3557 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3558 #. type: Plain text
3559 #: build/C/man2/recv.2:279
3560 #, fuzzy
3561 #| msgid ""
3562 #| "If I<src_addr> is not NULL, and the underlying protocol provides the "
3563 #| "source address, this source address is filled in.  When I<src_addr> is "
3564 #| "NULL, nothing is filled in; in this case, I<addrlen> is not used, and "
3565 #| "should also be NULL.  The argument I<addrlen> is a value-result argument, "
3566 #| "which the caller should initialize before the call to the size of the "
3567 #| "buffer associated with I<src_addr>, and modified on return to indicate "
3568 #| "the actual size of the source address.  The returned address is truncated "
3569 #| "if the buffer provided is too small; in this case, I<addrlen> will return "
3570 #| "a value greater than was supplied to the call."
3571 msgid ""
3572 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3573 "address of the message, that source address is placed in the buffer pointed "
3574 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3575 "Before the call, it should be initialized to the size of the buffer "
3576 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3577 "the actual size of the source address.  The returned address is truncated if "
3578 "the buffer provided is too small; in this case, I<addrlen> will return a "
3579 "value greater than was supplied to the call."
3580 msgstr ""
3581 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3582 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3583 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3584 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3585 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3586 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3587 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3588 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3589 "な値が返される。"
3590
3591 #. type: Plain text
3592 #: build/C/man2/recv.2:286
3593 msgid ""
3594 "If the caller is not interested in the source address, I<src_addr> should be "
3595 "specified as NULL and I<addrlen> should be specified as 0."
3596 msgstr ""
3597
3598 #. type: SS
3599 #: build/C/man2/recv.2:286
3600 #, no-wrap
3601 msgid "recv()"
3602 msgstr ""
3603
3604 #. type: Plain text
3605 #: build/C/man2/recv.2:294
3606 #, fuzzy
3607 #| msgid ""
3608 #| "The B<recv>()  call is normally used only on a I<connected> socket (see "
3609 #| "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL "
3610 #| "I<src_addr> argument."
3611 msgid ""
3612 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3613 "B<connect>(2)).  It is equivalent to the call:"
3614 msgstr ""
3615 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3616 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3617 "()  と等価である。"
3618
3619 #. type: Plain text
3620 #: build/C/man2/recv.2:297
3621 #, fuzzy, no-wrap
3622 #| msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
3623 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3624 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
3625
3626 #. type: SS
3627 #: build/C/man2/recv.2:297
3628 #, no-wrap
3629 msgid "recvmsg()"
3630 msgstr ""
3631
3632 #. type: Plain text
3633 #: build/C/man2/recv.2:305
3634 msgid ""
3635 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3636 "directly supplied arguments.  This structure is defined as follows in "
3637 "I<E<lt>sys/socket.hE<gt>>:"
3638 msgstr ""
3639 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3640 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3641
3642 #. type: Plain text
3643 #: build/C/man2/recv.2:312
3644 #, no-wrap
3645 msgid ""
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 msgstr ""
3651 "struct iovec {                    /* Scatter/gather array items */\n"
3652 "    void  *iov_base;              /* Starting address */\n"
3653 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3654 "};\n"
3655
3656 #. type: Plain text
3657 #: build/C/man2/recv.2:322 build/C/man2/send.2:258
3658 #, no-wrap
3659 msgid ""
3660 "struct msghdr {\n"
3661 "    void         *msg_name;       /* optional address */\n"
3662 "    socklen_t     msg_namelen;    /* size of address */\n"
3663 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3664 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3665 "    void         *msg_control;    /* ancillary data, see below */\n"
3666 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3667 "    int           msg_flags;      /* flags on received message */\n"
3668 "};\n"
3669 msgstr ""
3670 "struct msghdr {\n"
3671 "    void         *msg_name;       /* 追加のアドレス */\n"
3672 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3673 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3674 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3675 "    void         *msg_control;    /* 補助データ (後述) */\n"
3676 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3677 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3678 "};\n"
3679
3680 #. type: Plain text
3681 #: build/C/man2/recv.2:352
3682 #, fuzzy
3683 #| msgid ""
3684 #| "Here I<msg_name> and I<msg_namelen> specify the source address if the "
3685 #| "socket is unconnected; I<msg_name> may be given as a NULL pointer if no "
3686 #| "names are desired or required.  The fields I<msg_iov> and I<msg_iovlen> "
3687 #| "describe scatter-gather locations, as discussed in B<readv>(2).  The "
3688 #| "field I<msg_control>, which has length I<msg_controllen>, points to a "
3689 #| "buffer for other protocol control-related messages or miscellaneous "
3690 #| "ancillary data.  When B<recvmsg>()  is called, I<msg_controllen> should "
3691 #| "contain the length of the available buffer in I<msg_control>; upon return "
3692 #| "from a successful call it will contain the length of the control message "
3693 #| "sequence."
3694 msgid ""
3695 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3696 "is unconnected; I<msg_name> may be given as a null pointer if no names are "
3697 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3698 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3699 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3700 "other protocol control-related messages or miscellaneous ancillary data.  "
3701 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3702 "the available buffer in I<msg_control>; upon return from a successful call "
3703 "it will contain the length of the control message sequence."
3704 msgstr ""
3705 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3706 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3707 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3708 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3709 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3710 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3711 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3712 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3713 "さが入っている。"
3714
3715 #. type: Plain text
3716 #: build/C/man2/recv.2:354
3717 msgid "The messages are of the form:"
3718 msgstr "メッセージの形式は以下の通り:"
3719
3720 #. type: Plain text
3721 #: build/C/man2/recv.2:364
3722 #, no-wrap
3723 msgid ""
3724 "struct cmsghdr {\n"
3725 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3726 "    int           cmsg_level;   /* originating protocol */\n"
3727 "    int           cmsg_type;    /* protocol-specific type */\n"
3728 "/* followed by\n"
3729 "    unsigned char cmsg_data[]; */\n"
3730 "};\n"
3731 msgstr ""
3732 "struct cmsghdr {\n"
3733 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3734 "    int           cmsg_level;   /* originating protocol */\n"
3735 "    int           cmsg_type;    /* protocol-specific type */\n"
3736 "/* followed by\n"
3737 "    unsigned char cmsg_data[]; */\n"
3738 "};\n"
3739
3740 #. type: Plain text
3741 #: build/C/man2/recv.2:369
3742 msgid ""
3743 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3744 msgstr ""
3745 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3746
3747 #. type: Plain text
3748 #: build/C/man2/recv.2:372
3749 msgid ""
3750 "As an example, Linux uses this ancillary data mechanism to pass extended "
3751 "errors, IP options, or file descriptors over UNIX domain sockets."
3752 msgstr ""
3753 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3754 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3755 "いる。"
3756
3757 #. type: Plain text
3758 #: build/C/man2/recv.2:380
3759 msgid ""
3760 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3761 "It can contain several flags:"
3762 msgstr ""
3763 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3764 "れる。ここにはいくつかのフラグが入る。"
3765
3766 #. type: TP
3767 #: build/C/man2/recv.2:380
3768 #, no-wrap
3769 msgid "B<MSG_EOR>"
3770 msgstr "B<MSG_EOR>"
3771
3772 #. type: Plain text
3773 #: build/C/man2/recv.2:385
3774 msgid ""
3775 "indicates end-of-record; the data returned completed a record (generally "
3776 "used with sockets of type B<SOCK_SEQPACKET>)."
3777 msgstr ""
3778 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3779 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3780
3781 #. type: TP
3782 #: build/C/man2/recv.2:385
3783 #, no-wrap
3784 msgid "B<MSG_TRUNC>"
3785 msgstr "B<MSG_TRUNC>"
3786
3787 #. type: Plain text
3788 #: build/C/man2/recv.2:389
3789 msgid ""
3790 "indicates that the trailing portion of a datagram was discarded because the "
3791 "datagram was larger than the buffer supplied."
3792 msgstr ""
3793 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3794 "た部分が捨てられたことを示す。"
3795
3796 #. type: TP
3797 #: build/C/man2/recv.2:389
3798 #, no-wrap
3799 msgid "B<MSG_CTRUNC>"
3800 msgstr "B<MSG_CTRUNC>"
3801
3802 #. type: Plain text
3803 #: build/C/man2/recv.2:393
3804 msgid ""
3805 "indicates that some control data were discarded due to lack of space in the "
3806 "buffer for ancillary data."
3807 msgstr ""
3808 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3809 "を示す。"
3810
3811 #. type: Plain text
3812 #: build/C/man2/recv.2:396
3813 msgid ""
3814 "is returned to indicate that expedited or out-of-band data were received."
3815 msgstr "速達データや帯域外データを受信したことを示す。"
3816
3817 #. type: TP
3818 #: build/C/man2/recv.2:396
3819 #, no-wrap
3820 msgid "B<MSG_ERRQUEUE>"
3821 msgstr "B<MSG_ERRQUEUE>"
3822
3823 #. type: Plain text
3824 #: build/C/man2/recv.2:400
3825 msgid ""
3826 "indicates that no data was received but an extended error from the socket "
3827 "error queue."
3828 msgstr ""
3829 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3830 "を示す。"
3831
3832 #. type: Plain text
3833 #: build/C/man2/recv.2:406
3834 #, fuzzy
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 "
3838 #| "error.  The return value will be 0 when the peer has performed an orderly "
3839 #| "shutdown."
3840 msgid ""
3841 "These calls return the number of bytes received, or -1 if an error "
3842 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3843 msgstr ""
3844 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3845 "にエラーを示す値を設定する。  接続先が正しくシャットダウンを実行した場合は、"
3846 "返り値は 0 となる。"
3847
3848 #. type: Plain text
3849 #: build/C/man2/recv.2:409
3850 msgid ""
3851 "When a stream socket peer has performed an orderly shutdown, the return "
3852 "value will be 0 (the traditional \"end-of-file\" return)."
3853 msgstr ""
3854
3855 #. type: Plain text
3856 #: build/C/man2/recv.2:413
3857 msgid ""
3858 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3859 "permit zero-length datagrams.  When such a datagram is received, the return "
3860 "value is 0."
3861 msgstr ""
3862
3863 #. type: Plain text
3864 #: build/C/man2/recv.2:416
3865 msgid ""
3866 "The value 0 may also be returned if the requested number of bytes to receive "
3867 "from a stream socket was 0."
3868 msgstr ""
3869
3870 #. type: Plain text
3871 #: build/C/man2/recv.2:421
3872 msgid ""
3873 "These are some standard errors generated by the socket layer.  Additional "
3874 "errors may be generated and returned from the underlying protocol modules; "
3875 "see their manual pages."
3876 msgstr ""
3877 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3878 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3879 "ること。"
3880
3881 #.  Actually EAGAIN on Linux
3882 #. type: Plain text
3883 #: build/C/man2/recv.2:430
3884 msgid ""
3885 "The socket is marked nonblocking and the receive operation would block, or a "
3886 "receive timeout had been set and the timeout expired before data was "
3887 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3888 "and does not require these constants to have the same value, so a portable "
3889 "application should check for both possibilities."
3890 msgstr ""
3891 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3892 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3893 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3894 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3895 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3896
3897 #. type: Plain text
3898 #: build/C/man2/recv.2:435
3899 msgid "The argument I<sockfd> is an invalid descriptor."
3900 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3901
3902 #. type: Plain text
3903 #: build/C/man2/recv.2:439
3904 msgid ""
3905 "A remote host refused to allow the network connection (typically because it "
3906 "is not running the requested service)."
3907 msgstr ""
3908 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3909 "たサービスが起動されていないなどがある)。"
3910
3911 #. type: Plain text
3912 #: build/C/man2/recv.2:443
3913 msgid ""
3914 "The receive buffer pointer(s) point outside the process's address space."
3915 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3916
3917 #. type: Plain text
3918 #: build/C/man2/recv.2:448
3919 msgid ""
3920 "The receive was interrupted by delivery of a signal before any data were "
3921 "available; see B<signal>(7)."
3922 msgstr ""
3923 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3924
3925 #. type: Plain text
3926 #: build/C/man2/recv.2:452 build/C/man2/send.2:323
3927 msgid "Invalid argument passed."
3928 msgstr "不正な引き数が渡された。"
3929
3930 #. type: Plain text
3931 #: build/C/man2/recv.2:456
3932 msgid "Could not allocate memory for B<recvmsg>()."
3933 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3934
3935 #. type: TP
3936 #: build/C/man2/recv.2:456 build/C/man2/send.2:346
3937 #, no-wrap
3938 msgid "B<ENOTCONN>"
3939 msgstr "B<ENOTCONN>"
3940
3941 #. type: Plain text
3942 #: build/C/man2/recv.2:463
3943 msgid ""
3944 "The socket is associated with a connection-oriented protocol and has not "
3945 "been connected (see B<connect>(2)  and B<accept>(2))."
3946 msgstr ""
3947 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3948 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3949
3950 #. type: Plain text
3951 #: build/C/man2/recv.2:468
3952 msgid "The argument I<sockfd> does not refer to a socket."
3953 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3954
3955 #. type: Plain text
3956 #: build/C/man2/recv.2:471
3957 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3958 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3959
3960 #. type: Plain text
3961 #: build/C/man2/recv.2:478
3962 msgid ""
3963 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3964 "flags."
3965 msgstr ""
3966 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3967 "されている。"
3968
3969 #. type: Plain text
3970 #: build/C/man2/recv.2:494
3971 msgid ""
3972 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3973 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3974 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3975 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3976 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3977 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3978 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3979 msgstr ""
3980 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3981 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3982 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3983 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3984 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3985 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3986 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3987
3988 #.  glibc bug raised 12 Mar 2006
3989 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3990 #.  The problem is an underlying kernel issue: the size of the
3991 #.  __kernel_size_t type used to type this field varies
3992 #.  across architectures, but socklen_t is always 32 bits.
3993 #. type: Plain text
3994 #: build/C/man2/recv.2:508 build/C/man2/send.2:409
3995 msgid ""
3996 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3997 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3998 "I<size_t>."
3999 msgstr ""
4000 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
4001 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
4002 "ある。"
4003
4004 #. type: Plain text
4005 #: build/C/man2/recv.2:513
4006 msgid ""
4007 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
4008 "can be used to receive multiple datagrams in a single call."
4009 msgstr ""
4010 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
4011 "固有の システムコールに関する情報が書かれている。"
4012
4013 #. type: Plain text
4014 #: build/C/man2/recv.2:518
4015 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
4016 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
4017
4018 #. type: Plain text
4019 #: build/C/man2/recv.2:529
4020 msgid ""
4021 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4022 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4023 msgstr ""
4024 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4025 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4026
4027 #. type: TH
4028 #: build/C/man2/recvmmsg.2:31
4029 #, no-wrap
4030 msgid "RECVMMSG"
4031 msgstr "RECVMMSG"
4032
4033 #. type: TH
4034 #: build/C/man2/recvmmsg.2:31
4035 #, no-wrap
4036 msgid "2012-12-24"
4037 msgstr "2012-12-24"
4038
4039 #. type: Plain text
4040 #: build/C/man2/recvmmsg.2:34
4041 msgid "recvmmsg - receive multiple messages on a socket"
4042 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
4043
4044 #. type: Plain text
4045 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
4046 #, no-wrap
4047 msgid ""
4048 "B<#define _GNU_SOURCE>\n"
4049 "B<#include E<lt>sys/socket.hE<gt>>\n"
4050 msgstr ""
4051 "B<#define _GNU_SOURCE>\n"
4052 "B<#include E<lt>sys/socket.hE<gt>>\n"
4053
4054 #. type: Plain text
4055 #: build/C/man2/recvmmsg.2:41
4056 #, no-wrap
4057 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4058 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4059
4060 #. type: Plain text
4061 #: build/C/man2/recvmmsg.2:43
4062 #, no-wrap
4063 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4064 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4065
4066 #. type: Plain text
4067 #: build/C/man2/recvmmsg.2:55
4068 msgid ""
4069 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
4070 "the caller to receive multiple messages from a socket using a single system "
4071 "call.  (This has performance benefits for some applications.)  A further "
4072 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
4073 "operation."
4074 msgstr ""
4075 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4076 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4077 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4078 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4079
4080 #. type: Plain text
4081 #: build/C/man2/recvmmsg.2:59
4082 msgid ""
4083 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4084 "from."
4085 msgstr ""
4086 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
4087
4088 #. type: Plain text
4089 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4090 msgid ""
4091 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4092 "The size of this array is specified in I<vlen>."
4093 msgstr ""
4094 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4095 "I<vlen> で指定する。"
4096
4097 #. type: Plain text
4098 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4099 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4100 msgstr ""
4101 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4102
4103 #. type: Plain text
4104 #: build/C/man2/recvmmsg.2:80
4105 #, no-wrap
4106 msgid ""
4107 "struct mmsghdr {\n"
4108 "    struct msghdr msg_hdr;  /* Message header */\n"
4109 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4110 "};\n"
4111 msgstr ""
4112 "struct mmsghdr {\n"
4113 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
4114 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
4115 "};\n"
4116
4117 #. type: Plain text
4118 #: build/C/man2/recvmmsg.2:95
4119 msgid ""
4120 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
4121 "(2).  The I<msg_len> field is the number of bytes returned for the message "
4122 "in the entry.  This field has the same value as the return value of a single "
4123 "B<recvmsg>(2)  on the header."
4124 msgstr ""
4125 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4126 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4127 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4128 "る。"
4129
4130 #. type: Plain text
4131 #: build/C/man2/recvmmsg.2:102
4132 msgid ""
4133 "The I<flags> argument contains flags ORed together.  The flags are the same "
4134 "as documented for B<recvmsg>(2), with the following addition:"
4135 msgstr ""
4136 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4137 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4138
4139 #. type: TP
4140 #: build/C/man2/recvmmsg.2:102
4141 #, no-wrap
4142 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4143 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4144
4145 #. type: Plain text
4146 #: build/C/man2/recvmmsg.2:107
4147 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4148 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4149
4150 #. type: Plain text
4151 #: build/C/man2/recvmmsg.2:123
4152 msgid ""
4153 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
4154 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
4155 "operation.  (This interval will be rounded up to the system clock "
4156 "granularity, and kernel scheduling delays mean that the blocking interval "
4157 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
4158 "blocks indefinitely."
4159 msgstr ""
4160 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4161 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (待ち時間は"
4162 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延により少"
4163 "しだけ長くなる可能性がある)。 I<timeout>が I<NULL> の場合、 受信操作は無期限"
4164 "に停止 (block) する。"
4165
4166 #. type: Plain text
4167 #: build/C/man2/recvmmsg.2:134
4168 msgid ""
4169 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4170 "received or until the timeout expires.  A nonblocking call reads as many "
4171 "messages as are available (up to the limit specified by I<vlen>)  and "
4172 "returns immediately."
4173 msgstr ""
4174 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4175 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4176 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4177 "すぐに返る。"
4178
4179 #. type: Plain text
4180 #: build/C/man2/recvmmsg.2:149
4181 msgid ""
4182 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4183 "to contain information about each received message: I<msg_len> contains the "
4184 "size of the received message; the subfields of I<msg_hdr> are updated as "
4185 "described in B<recvmsg>(2).  The return value of the call indicates the "
4186 "number of elements of I<msgvec> that have been updated."
4187 msgstr ""
4188 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4189 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4190 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4191 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4192 "数である。"
4193
4194 #. type: Plain text
4195 #: build/C/man2/recvmmsg.2:157
4196 msgid ""
4197 "On success, B<recvmmsg>()  returns the number of messages received in "
4198 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4199 "error."
4200 msgstr ""
4201 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4202 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4203
4204 #. type: Plain text
4205 #: build/C/man2/recvmmsg.2:161
4206 msgid ""
4207 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4208 msgstr ""
4209 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4210 "がある。"
4211
4212 #. type: Plain text
4213 #: build/C/man2/recvmmsg.2:165
4214 msgid "I<timeout> is invalid."
4215 msgstr "I<timeout> が無効である。"
4216
4217 #. type: Plain text
4218 #: build/C/man2/recvmmsg.2:170
4219 msgid ""
4220 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4221 "was added in version 2.12."
4222 msgstr ""
4223 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4224 "はバージョン 2.12 以降で利用可能である。"
4225
4226 #. type: Plain text
4227 #: build/C/man2/recvmmsg.2:173
4228 msgid "B<recvmmsg>()  is Linux-specific."
4229 msgstr "B<recvmmsg>() は Linux 固有である。"
4230
4231 #. type: Plain text
4232 #: build/C/man2/recvmmsg.2:181
4233 msgid ""
4234 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4235 "socket and stores them in multiple buffers.  The call returns if all buffers "
4236 "are filled or if the timeout specified has expired."
4237 msgstr ""
4238 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4239 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4240 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4241
4242 #. type: Plain text
4243 #: build/C/man2/recvmmsg.2:184
4244 msgid ""
4245 "The following snippet periodically generates UDP datagrams containing a "
4246 "random number:"
4247 msgstr ""
4248 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4249 "る。"
4250
4251 #. type: Plain text
4252 #: build/C/man2/recvmmsg.2:189
4253 #, no-wrap
4254 msgid ""
4255 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4256 "B<sleep 0.25; done>\n"
4257 msgstr ""
4258 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4259 "B<sleep 0.25; done>\n"
4260
4261 #. type: Plain text
4262 #: build/C/man2/recvmmsg.2:194
4263 msgid ""
4264 "These datagrams are read by the example application, which can give the "
4265 "following output:"
4266 msgstr ""
4267 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4268 "が得られる。"
4269
4270 #. type: Plain text
4271 #: build/C/man2/recvmmsg.2:204
4272 #, no-wrap
4273 msgid ""
4274 "$B< ./a.out>\n"
4275 "5 messages received\n"
4276 "1 11782\n"
4277 "2 11345\n"
4278 "3 304\n"
4279 "4 13514\n"
4280 "5 28421\n"
4281 msgstr ""
4282 "$B< ./a.out>\n"
4283 "5 messages received\n"
4284 "1 11782\n"
4285 "2 11345\n"
4286 "3 304\n"
4287 "4 13514\n"
4288 "5 28421\n"
4289
4290 #. type: Plain text
4291 #: build/C/man2/recvmmsg.2:215
4292 #, no-wrap
4293 msgid ""
4294 "#define _GNU_SOURCE\n"
4295 "#include E<lt>netinet/ip.hE<gt>\n"
4296 "#include E<lt>stdio.hE<gt>\n"
4297 "#include E<lt>stdlib.hE<gt>\n"
4298 "#include E<lt>string.hE<gt>\n"
4299 "#include E<lt>sys/socket.hE<gt>\n"
4300 msgstr ""
4301 "#define _GNU_SOURCE\n"
4302 "#include E<lt>netinet/ip.hE<gt>\n"
4303 "#include E<lt>stdio.hE<gt>\n"
4304 "#include E<lt>stdlib.hE<gt>\n"
4305 "#include E<lt>string.hE<gt>\n"
4306 "#include E<lt>sys/socket.hE<gt>\n"
4307
4308 #. type: Plain text
4309 #: build/C/man2/recvmmsg.2:228
4310 #, no-wrap
4311 msgid ""
4312 "int\n"
4313 "main(void)\n"
4314 "{\n"
4315 "#define VLEN 10\n"
4316 "#define BUFSIZE 200\n"
4317 "#define TIMEOUT 1\n"
4318 "    int sockfd, retval, i;\n"
4319 "    struct sockaddr_in sa;\n"
4320 "    struct mmsghdr msgs[VLEN];\n"
4321 "    struct iovec iovecs[VLEN];\n"
4322 "    char bufs[VLEN][BUFSIZE+1];\n"
4323 "    struct timespec timeout;\n"
4324 msgstr ""
4325 "int\n"
4326 "main(void)\n"
4327 "{\n"
4328 "#define VLEN 10\n"
4329 "#define BUFSIZE 200\n"
4330 "#define TIMEOUT 1\n"
4331 "    int sockfd, retval, i;\n"
4332 "    struct sockaddr_in sa;\n"
4333 "    struct mmsghdr msgs[VLEN];\n"
4334 "    struct iovec iovecs[VLEN];\n"
4335 "    char bufs[VLEN][BUFSIZE+1];\n"
4336 "    struct timespec timeout;\n"
4337
4338 #. type: Plain text
4339 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4340 #, no-wrap
4341 msgid ""
4342 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4343 "    if (sockfd == -1) {\n"
4344 "        perror(\"socket()\");\n"
4345 "        exit(EXIT_FAILURE);\n"
4346 "    }\n"
4347 msgstr ""
4348 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4349 "    if (sockfd == -1) {\n"
4350 "        perror(\"socket()\");\n"
4351 "        exit(EXIT_FAILURE);\n"
4352 "    }\n"
4353
4354 #. type: Plain text
4355 #: build/C/man2/recvmmsg.2:242
4356 #, no-wrap
4357 msgid ""
4358 "    sa.sin_family = AF_INET;\n"
4359 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4360 "    sa.sin_port = htons(1234);\n"
4361 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4362 "        perror(\"bind()\");\n"
4363 "        exit(EXIT_FAILURE);\n"
4364 "    }\n"
4365 msgstr ""
4366 "    sa.sin_family = AF_INET;\n"
4367 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4368 "    sa.sin_port = htons(1234);\n"
4369 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4370 "        perror(\"bind()\");\n"
4371 "        exit(EXIT_FAILURE);\n"
4372 "    }\n"
4373
4374 #. type: Plain text
4375 #: build/C/man2/recvmmsg.2:250
4376 #, no-wrap
4377 msgid ""
4378 "    memset(msgs, 0, sizeof(msgs));\n"
4379 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4380 "        iovecs[i].iov_base         = bufs[i];\n"
4381 "        iovecs[i].iov_len          = BUFSIZE;\n"
4382 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4383 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4384 "    }\n"
4385 msgstr ""
4386 "    memset(msgs, 0, sizeof(msgs));\n"
4387 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4388 "        iovecs[i].iov_base         = bufs[i];\n"
4389 "        iovecs[i].iov_len          = BUFSIZE;\n"
4390 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4391 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4392 "    }\n"
4393
4394 #. type: Plain text
4395 #: build/C/man2/recvmmsg.2:253
4396 #, no-wrap
4397 msgid ""
4398 "    timeout.tv_sec = TIMEOUT;\n"
4399 "    timeout.tv_nsec = 0;\n"
4400 msgstr ""
4401 "    timeout.tv_sec = TIMEOUT;\n"
4402 "    timeout.tv_nsec = 0;\n"
4403
4404 #. type: Plain text
4405 #: build/C/man2/recvmmsg.2:259
4406 #, no-wrap
4407 msgid ""
4408 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4409 "    if (retval == -1) {\n"
4410 "        perror(\"recvmmsg()\");\n"
4411 "        exit(EXIT_FAILURE);\n"
4412 "    }\n"
4413 msgstr ""
4414 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4415 "    if (retval == -1) {\n"
4416 "        perror(\"recvmmsg()\");\n"
4417 "        exit(EXIT_FAILURE);\n"
4418 "    }\n"
4419
4420 #. type: Plain text
4421 #: build/C/man2/recvmmsg.2:267
4422 #, no-wrap
4423 msgid ""
4424 "    printf(\"%d messages received\\en\", retval);\n"
4425 "    for (i = 0; i E<lt> retval; i++) {\n"
4426 "        bufs[i][msgs[i].msg_len] = 0;\n"
4427 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4428 "    }\n"
4429 "    exit(EXIT_SUCCESS);\n"
4430 "}\n"
4431 msgstr ""
4432 "    printf(\"%d messages received\\en\", retval);\n"
4433 "    for (i = 0; i E<lt> retval; i++) {\n"
4434 "        bufs[i][msgs[i].msg_len] = 0;\n"
4435 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4436 "    }\n"
4437 "    exit(EXIT_SUCCESS);\n"
4438 "}\n"
4439
4440 #. type: Plain text
4441 #: build/C/man2/recvmmsg.2:275
4442 msgid ""
4443 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4444 "(2), B<socket>(7)"
4445 msgstr ""
4446 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4447 "(2), B<socket>(7)"
4448
4449 #. type: TH
4450 #: build/C/man2/select.2:38
4451 #, no-wrap
4452 msgid "SELECT"
4453 msgstr "SELECT"
4454
4455 #. type: TH
4456 #: build/C/man2/select.2:38
4457 #, fuzzy, no-wrap
4458 #| msgid "2009-01-19"
4459 msgid "2014-01-31"
4460 msgstr "2009-01-19"
4461
4462 #. type: Plain text
4463 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4464 msgid ""
4465 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4466 "multiplexing"
4467 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4468
4469 #. type: Plain text
4470 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4471 #, no-wrap
4472 msgid "/* According to POSIX.1-2001 */\n"
4473 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4474
4475 #. type: Plain text
4476 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4477 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4478 #, no-wrap
4479 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4480 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4481
4482 #. type: Plain text
4483 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4484 #, no-wrap
4485 msgid "/* According to earlier standards */\n"
4486 msgstr "/* 以前の規格に従う場合 */\n"
4487
4488 #. type: Plain text
4489 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4490 #, no-wrap
4491 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4492 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4493
4494 #. type: Plain text
4495 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4496 #, no-wrap
4497 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4498 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4499
4500 #. type: Plain text
4501 #: build/C/man2/select.2:58
4502 #, no-wrap
4503 msgid ""
4504 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4505 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4506 msgstr ""
4507 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4508 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4509
4510 #. type: Plain text
4511 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4512 #, no-wrap
4513 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4514 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4515
4516 #. type: Plain text
4517 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4518 #, no-wrap
4519 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4520 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4521
4522 #. type: Plain text
4523 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4524 #, no-wrap
4525 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4526 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4527
4528 #. type: Plain text
4529 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4530 #, no-wrap
4531 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4532 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4533
4534 #. type: Plain text
4535 #: build/C/man2/select.2:72
4536 #, no-wrap
4537 msgid ""
4538 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4539 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4540 "B<            const sigset_t *>I<sigmask>B<);>\n"
4541 msgstr ""
4542 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4543 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4544 "B<            const sigset_t *>I<sigmask>B<);>\n"
4545
4546 #. type: Plain text
4547 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4548 #: build/C/man3/sockatmark.3:36
4549 msgid ""
4550 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4551 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4552
4553 #. type: Plain text
4554 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4555 msgid ""
4556 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4557 "600"
4558 msgstr ""
4559 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4560 "600"
4561
4562 #. type: Plain text
4563 #: build/C/man2/select.2:92
4564 msgid ""
4565 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4566 "descriptors, waiting until one or more of the file descriptors become \"ready"
4567 "\" for some class of I/O operation (e.g., input possible).  A file "
4568 "descriptor is considered ready if it is possible to perform the "
4569 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4570 msgstr ""
4571 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4572 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4573 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4574 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4575 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4576 "意味する。"
4577
4578 #. type: Plain text
4579 #: build/C/man2/select.2:98
4580 msgid ""
4581 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4582 "these three differences:"
4583 msgstr ""
4584 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4585
4586 #. type: TP
4587 #: build/C/man2/select.2:98
4588 #, no-wrap
4589 msgid "(i)"
4590 msgstr "(i)"
4591
4592 #. type: Plain text
4593 #: build/C/man2/select.2:108
4594 msgid ""
4595 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4596 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4597 "and nanoseconds)."
4598 msgstr ""
4599 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4600 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4601 "timespec> (秒・ナノ秒単位) を用いる。"
4602
4603 #. type: TP
4604 #: build/C/man2/select.2:108
4605 #, no-wrap
4606 msgid "(ii)"
4607 msgstr "(ii)"
4608
4609 #. type: Plain text
4610 #: build/C/man2/select.2:116
4611 msgid ""
4612 "B<select>()  may update the I<timeout> argument to indicate how much time "
4613 "was left.  B<pselect>()  does not change this argument."
4614 msgstr ""
4615 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4616 "B<pselect>()  はこの引き数を変更しない。"
4617
4618 #. type: TP
4619 #: build/C/man2/select.2:116
4620 #, no-wrap
4621 msgid "(iii)"
4622 msgstr "(iii)"
4623
4624 #. type: Plain text
4625 #: build/C/man2/select.2:125
4626 msgid ""
4627 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4628 "with NULL I<sigmask>."
4629 msgstr ""
4630 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4631 "指定した場合の B<pselect>()  と同じである。"
4632
4633 #. type: Plain text
4634 #: build/C/man2/select.2:143
4635 msgid ""
4636 "Three independent sets of file descriptors are watched.  Those listed in "
4637 "I<readfds> will be watched to see if characters become available for reading "
4638 "(more precisely, to see if a read will not block; in particular, a file "
4639 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4640 "watched to see if a write will not block, and those in I<exceptfds> will be "
4641 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4642 "which file descriptors actually changed status.  Each of the three file "
4643 "descriptor sets may be specified as NULL if no file descriptors are to be "
4644 "watched for the corresponding class of events."
4645 msgstr ""
4646 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4647 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4648 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4649 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4650 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4651 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4652 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4653 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4654 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4655 "指定することができる。"
4656
4657 #. type: Plain text
4658 #: build/C/man2/select.2:156
4659 msgid ""
4660 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4661 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4662 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4663 "part of the set; this is useful after B<select>()  returns."
4664 msgstr ""
4665 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4666 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4667 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4668 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4669 "る。"
4670
4671 #. type: Plain text
4672 #: build/C/man2/select.2:159
4673 msgid ""
4674 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4675 "plus 1."
4676 msgstr ""
4677 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4678 "のである。"
4679
4680 #. type: Plain text
4681 #: build/C/man2/select.2:166
4682 msgid ""
4683 "The I<timeout> argument specifies the interval that B<select>()  should "
4684 "block waiting for a file descriptor to become ready.  The call will block "
4685 "until either:"
4686 msgstr ""
4687
4688 #. type: IP
4689 #: build/C/man2/select.2:166 build/C/man2/select.2:168
4690 #: build/C/man2/select.2:170
4691 #, no-wrap
4692 msgid "*"
4693 msgstr ""
4694
4695 #. type: Plain text
4696 #: build/C/man2/select.2:168
4697 msgid "a file descriptor becomes ready;"
4698 msgstr ""
4699
4700 #. type: Plain text
4701 #: build/C/man2/select.2:170
4702 #, fuzzy
4703 #| msgid ""
4704 #| "The system call was interrupted by a signal that was caught; see B<signal>"
4705 #| "(7)."
4706 msgid "the call is interrupted by a signal handler; or"
4707 msgstr ""
4708 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
4709
4710 #. type: Plain text
4711 #: build/C/man2/select.2:172
4712 #, fuzzy
4713 #| msgid "The timeout"
4714 msgid "the timeout expires."
4715 msgstr "タイムアウト"
4716
4717 #. type: Plain text
4718 #: build/C/man2/select.2:189
4719 #, fuzzy
4720 #| msgid ""
4721 #| "The I<timeout> argument specifies the interval that B<select>()  should "
4722 #| "block waiting for a file descriptor to become ready.  This interval will "
4723 #| "be rounded up to the system clock granularity, and kernel scheduling "
4724 #| "delays mean that the blocking interval may overrun by a small amount.  If "
4725 #| "both fields of the I<timeval> structure are zero, then B<select>()  "
4726 #| "returns immediately.  (This is useful for polling.)  If I<timeout> is "
4727 #| "NULL (no timeout), B<select>()  can block indefinitely."
4728 msgid ""
4729 "Note that the I<timeout> interval will be rounded up to the system clock "
4730 "granularity, and kernel scheduling delays mean that the blocking interval "
4731 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4732 "are zero, then B<select>()  returns immediately.  (This is useful for "
4733 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4734 "indefinitely."
4735 msgstr ""
4736 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4737 "B<select>() が停止する停止時間を指定する\n"
4738 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4739 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4740 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4741 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4742 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4743 "期限に停止 (block) する。"
4744
4745 #. type: Plain text
4746 #: build/C/man2/select.2:199
4747 msgid ""
4748 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4749 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4750 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4751 "restores the original signal mask."
4752 msgstr ""
4753 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4754 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4755 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4756 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4757
4758 #. type: Plain text
4759 #: build/C/man2/select.2:205
4760 msgid ""
4761 "Other than the difference in the precision of the I<timeout> argument, the "
4762 "following B<pselect>()  call:"
4763 msgstr ""
4764 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4765
4766 #. type: Plain text
4767 #: build/C/man2/select.2:209
4768 #, no-wrap
4769 msgid ""
4770 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4771 "                    timeout, &sigmask);\n"
4772 msgstr ""
4773 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4774 "                    timeout, &sigmask);\n"
4775
4776 #. type: Plain text
4777 #: build/C/man2/select.2:214
4778 msgid "is equivalent to I<atomically> executing the following calls:"
4779 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4780
4781 #. type: Plain text
4782 #: build/C/man2/select.2:217
4783 #, no-wrap
4784 msgid "    sigset_t origmask;\n"
4785 msgstr "    sigset_t origmask;\n"
4786
4787 #. type: Plain text
4788 #: build/C/man2/select.2:221
4789 #, no-wrap
4790 msgid ""
4791 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4792 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4793 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4794 msgstr ""
4795 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4796 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4797 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4798
4799 #. type: Plain text
4800 #: build/C/man2/select.2:242
4801 msgid ""
4802 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4803 "either a signal or for a file descriptor to become ready, then an atomic "
4804 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4805 "a global flag and returns.  Then a test of this global flag followed by a "
4806 "call of B<select>()  could hang indefinitely if the signal arrived just "
4807 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4808 "one to first block signals, handle the signals that have come in, then call "
4809 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4810 msgstr ""
4811 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4812 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4813 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4814 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4815 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4816 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4817 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4818 "で、前記の競合を避けることができる。)"
4819
4820 #. type: SS
4821 #: build/C/man2/select.2:242
4822 #, no-wrap
4823 msgid "The timeout"
4824 msgstr "タイムアウト"
4825
4826 #. type: Plain text
4827 #: build/C/man2/select.2:246
4828 msgid ""
4829 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4830 "like"
4831 msgstr ""
4832 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4833
4834 #. type: Plain text
4835 #: build/C/man2/select.2:253
4836 #, no-wrap
4837 msgid ""
4838 "struct timeval {\n"
4839 "    long    tv_sec;         /* seconds */\n"
4840 "    long    tv_usec;        /* microseconds */\n"
4841 "};\n"
4842 msgstr ""
4843 "struct timeval {\n"
4844 "    long    tv_sec;         /* 秒 */\n"
4845 "    long    tv_usec;        /* マイクロ秒 */\n"
4846 "};\n"
4847
4848 #. type: Plain text
4849 #: build/C/man2/select.2:257
4850 msgid "and"
4851 msgstr "や"
4852
4853 #. type: Plain text
4854 #: build/C/man2/select.2:264
4855 #, no-wrap
4856 msgid ""
4857 "struct timespec {\n"
4858 "    long    tv_sec;         /* seconds */\n"
4859 "    long    tv_nsec;        /* nanoseconds */\n"
4860 "};\n"
4861 msgstr ""
4862 "struct timespec {\n"
4863 "    long    tv_sec;         /* 秒 */\n"
4864 "    long    tv_nsec;        /* ナノ秒 */\n"
4865 "};\n"
4866
4867 #. type: Plain text
4868 #: build/C/man2/select.2:268
4869 msgid "(However, see below on the POSIX.1-2001 versions.)"
4870 msgstr ""
4871 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4872 "照)"
4873
4874 #. type: Plain text
4875 #: build/C/man2/select.2:276
4876 msgid ""
4877 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4878 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4879 "precision."
4880 msgstr ""
4881 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4882 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4883 "呼び出すという方法を使っているコードもある。"
4884
4885 #.  .PP - it is rumored that:
4886 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4887 #.  - it is certainly true that:
4888 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4889 #. type: Plain text
4890 #: build/C/man2/select.2:299
4891 msgid ""
4892 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4893 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4894 "either behavior.)  This causes problems both when Linux code which reads "
4895 "I<timeout> is ported to other operating systems, and when code is ported to "
4896 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4897 "without reinitializing it.  Consider I<timeout> to be undefined after "
4898 "B<select>()  returns."
4899 msgstr ""
4900 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4901 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4902 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4903 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4904 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4905 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4906 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4907 "ある。"
4908
4909 #. type: Plain text
4910 #: build/C/man2/select.2:317
4911 #, fuzzy
4912 #| msgid ""
4913 #| "On success, B<select>()  and B<pselect>()  return the number of file "
4914 #| "descriptors contained in the three returned descriptor sets (that is, the "
4915 #| "total number of bits that are set in I<readfds>, I<writefds>, "
4916 #| "I<exceptfds>)  which may be zero if the timeout expires before anything "
4917 #| "interesting happens.  On error, -1 is returned, and I<errno> is set "
4918 #| "appropriately; the sets and I<timeout> become undefined, so do not rely "
4919 #| "on their contents after an error."
4920 msgid ""
4921 "On success, B<select>()  and B<pselect>()  return the number of file "
4922 "descriptors contained in the three returned descriptor sets (that is, the "
4923 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4924 "which may be zero if the timeout expires before anything interesting "
4925 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4926 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4927 "undefined."
4928 msgstr ""
4929 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4930 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4931 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4932 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4933 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4934 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4935
4936 #. type: Plain text
4937 #: build/C/man2/select.2:323
4938 msgid ""
4939 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4940 "descriptor that was already closed, or one on which an error has occurred.)"
4941 msgstr ""
4942 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4943 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4944 "タが指定された)。"
4945
4946 #. type: Plain text
4947 #: build/C/man2/select.2:327
4948 msgid "A signal was caught; see B<signal>(7)."
4949 msgstr "シグナルを受信した。"
4950
4951 #. type: Plain text
4952 #: build/C/man2/select.2:333
4953 msgid ""
4954 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4955 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4956
4957 #. type: Plain text
4958 #: build/C/man2/select.2:336
4959 msgid "unable to allocate memory for internal tables."
4960 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4961
4962 #. type: Plain text
4963 #: build/C/man2/select.2:342
4964 msgid ""
4965 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4966 "()  was emulated in glibc (but see BUGS)."
4967 msgstr ""
4968 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4969 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4970
4971 #. type: Plain text
4972 #: build/C/man2/select.2:353
4973 msgid ""
4974 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4975 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4976 "clones of the BSD socket layer (including System V variants).  However, note "
4977 "that the System V variant typically sets the timeout variable before exit, "
4978 "but the BSD variant does not."
4979 msgstr ""
4980 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4981 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4982 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4983 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4984 "ること。"
4985
4986 #. type: Plain text
4987 #: build/C/man2/select.2:357
4988 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4989 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4990
4991 #. type: Plain text
4992 #: build/C/man2/select.2:374
4993 msgid ""
4994 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4995 "with a value of I<fd> that is negative or is equal to or larger than "
4996 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4997 "I<fd> to be a valid file descriptor."
4998 msgstr ""
4999 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
5000 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
5001 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
5002 "プタでなければならないと規定されている。"
5003
5004 #. type: Plain text
5005 #: build/C/man2/select.2:383
5006 msgid ""
5007 "Concerning the types involved, the classical situation is that the two "
5008 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
5009 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
5010 "situation is"
5011 msgstr ""
5012 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
5013 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
5014 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
5015
5016 #. type: Plain text
5017 #: build/C/man2/select.2:390
5018 #, no-wrap
5019 msgid ""
5020 "struct timeval {\n"
5021 "    time_t         tv_sec;     /* seconds */\n"
5022 "    suseconds_t    tv_usec;    /* microseconds */\n"
5023 "};\n"
5024 msgstr ""
5025 "struct timeval {\n"
5026 "\t time_t         tv_sec;     /* 秒 */\n"
5027 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
5028 "};\n"
5029
5030 #. type: Plain text
5031 #: build/C/man2/select.2:401
5032 msgid ""
5033 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
5034 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
5035 msgstr ""
5036 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
5037 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
5038
5039 #. type: Plain text
5040 #: build/C/man2/select.2:413
5041 msgid ""
5042 "Concerning prototypes, the classical situation is that one should include "
5043 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
5044 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
5045 msgstr ""
5046 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
5047 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
5048 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
5049 "インクルードすればよい。"
5050
5051 #. type: Plain text
5052 #: build/C/man2/select.2:425
5053 msgid ""
5054 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
5055 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
5056 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
5057 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
5058 "requirements are as shown in the SYNOPSIS."
5059 msgstr ""
5060 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
5061 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
5062 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
5063 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
5064 "使用するには、「書式」に記載された要件を満たす必要がある。"
5065
5066 #. type: SS
5067 #: build/C/man2/select.2:425
5068 #, no-wrap
5069 msgid "Multithreaded applications"
5070 msgstr "マルチスレッド・アプリケーション"
5071
5072 #. type: Plain text
5073 #: build/C/man2/select.2:441
5074 msgid ""
5075 "If a file descriptor being monitored by B<select>()  is closed in another "
5076 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
5077 "unblocks and returns, with an indication that the file descriptor is ready "
5078 "(a subsequent I/O operation will likely fail with an error, unless another "
5079 "the file descriptor reopened between the time B<select>()  returned and the "
5080 "I/O operations was performed).  On Linux (and some other systems), closing "
5081 "the file descriptor in another thread has no effect on B<select>().  In "
5082 "summary, any application that relies on a particular behavior in this "
5083 "scenario must be considered buggy."
5084 msgstr ""
5085 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
5086 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
5087 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
5088 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
5089 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
5090 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
5091 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
5092 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
5093 "ている」と考えなければならない。"
5094
5095 #. type: SS
5096 #: build/C/man2/select.2:441
5097 #, no-wrap
5098 msgid "Linux notes"
5099 msgstr "Linux での注意"
5100
5101 #. type: Plain text
5102 #: build/C/man2/select.2:449
5103 msgid ""
5104 "The B<pselect>()  interface described in this page is implemented by glibc.  "
5105 "The underlying Linux system call is named B<pselect6>().  This system call "
5106 "has somewhat different behavior from the glibc wrapper function."
5107 msgstr ""
5108 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5109 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5110 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5111 "関数とは少し違った動作をする。"
5112
5113 #. type: Plain text
5114 #: build/C/man2/select.2:464
5115 msgid ""
5116 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5117 "However, the glibc wrapper function hides this behavior by using a local "
5118 "variable for the timeout argument that is passed to the system call.  Thus, "
5119 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5120 "this is the behavior required by POSIX.1-2001."
5121 msgstr ""
5122 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5123 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5124 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5125 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5126 "これが POSIX.1-2001 が要求している動作である。"
5127
5128 #. type: Plain text
5129 #: build/C/man2/select.2:470
5130 msgid ""
5131 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5132 "*> pointer, but is instead a structure of the form:"
5133 msgstr ""
5134 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5135 "ポインタではなく、以下に示す構造体である。"
5136
5137 #. type: Plain text
5138 #: build/C/man2/select.2:478
5139 #, no-wrap
5140 msgid ""
5141 "struct {\n"
5142 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5143 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5144 "                               to by 'ss' */\n"
5145 "};\n"
5146 msgstr ""
5147 "struct {\n"
5148 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
5149 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5150 "                               (バイト数) */\n"
5151 "};\n"
5152
5153 #. type: Plain text
5154 #: build/C/man2/select.2:485
5155 msgid ""
5156 "This allows the system call to obtain both a pointer to the signal set and "
5157 "its size, while allowing for the fact that most architectures support a "
5158 "maximum of 6 arguments to a system call."
5159 msgstr ""
5160 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5161 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5162 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5163 "のサイズの両方を取得することができるのである。"
5164
5165 #. type: Plain text
5166 #: build/C/man2/select.2:491
5167 msgid ""
5168 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5169 "argument."
5170 msgstr ""
5171 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5172 "されていた。"
5173
5174 #. type: Plain text
5175 #: build/C/man2/select.2:504
5176 msgid ""
5177 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5178 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5179 "implementation remained vulnerable to the very race condition that B<pselect>"
5180 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
5181 "B<pselect>()  system call on kernels where it is provided."
5182 msgstr ""
5183 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5184 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5185 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5186 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5187 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5188 "が使用される。"
5189
5190 #. type: Plain text
5191 #: build/C/man2/select.2:517
5192 msgid ""
5193 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5194 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5195 "signal handler writes a byte to a pipe whose other end is monitored by "
5196 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5197 "to a pipe that may be full or reading from a pipe that may be empty, "
5198 "nonblocking I/O is used when reading from and writing to the pipe.)"
5199 msgstr ""
5200 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5201 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5202 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5203 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5204 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5205 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5206 "(nonblocking) I/O を使用するとよい)。"
5207
5208 #.  Stevens discusses a case where accept can block after select
5209 #.  returns successfully because of an intervening RST from the client.
5210 #.  Maybe the kernel should have returned EIO in such a situation?
5211 #. type: Plain text
5212 #: build/C/man2/select.2:533
5213 msgid ""
5214 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5215 "reading\", while nevertheless a subsequent read blocks.  This could for "
5216 "example happen when data has arrived but upon examination has wrong checksum "
5217 "and is discarded.  There may be other circumstances in which a file "
5218 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5219 "B<O_NONBLOCK> on sockets that should not block."
5220 msgstr ""
5221 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
5222 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5223 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5224 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5225 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5226 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5227
5228 #. type: Plain text
5229 #: build/C/man2/select.2:548
5230 msgid ""
5231 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5232 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5233 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5234 "behavior, but the glibc wrapper hides this behavior by internally copying "
5235 "the I<timeout> to a local variable and passing that variable to the system "
5236 "call."
5237 msgstr ""
5238 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
5239 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5240 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5241 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5242 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5243 "数をシステムコールに渡している。"
5244
5245 #. type: Plain text
5246 #: build/C/man2/select.2:555
5247 #, no-wrap
5248 msgid ""
5249 "#include E<lt>stdio.hE<gt>\n"
5250 "#include E<lt>stdlib.hE<gt>\n"
5251 "#include E<lt>sys/time.hE<gt>\n"
5252 "#include E<lt>sys/types.hE<gt>\n"
5253 "#include E<lt>unistd.hE<gt>\n"
5254 msgstr ""
5255 "#include E<lt>stdio.hE<gt>\n"
5256 "#include E<lt>stdlib.hE<gt>\n"
5257 "#include E<lt>sys/time.hE<gt>\n"
5258 "#include E<lt>sys/types.hE<gt>\n"
5259 "#include E<lt>unistd.hE<gt>\n"
5260
5261 #. type: Plain text
5262 #: build/C/man2/select.2:562
5263 #, no-wrap
5264 msgid ""
5265 "int\n"
5266 "main(void)\n"
5267 "{\n"
5268 "    fd_set rfds;\n"
5269 "    struct timeval tv;\n"
5270 "    int retval;\n"
5271 msgstr ""
5272 "int\n"
5273 "main(void)\n"
5274 "{\n"
5275 "    fd_set rfds;\n"
5276 "    struct timeval tv;\n"
5277 "    int retval;\n"
5278
5279 #. type: Plain text
5280 #: build/C/man2/select.2:566
5281 #, no-wrap
5282 msgid ""
5283 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5284 "    FD_ZERO(&rfds);\n"
5285 "    FD_SET(0, &rfds);\n"
5286 msgstr ""
5287 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5288 "    FD_ZERO(&rfds);\n"
5289 "    FD_SET(0, &rfds);\n"
5290
5291 #. type: Plain text
5292 #: build/C/man2/select.2:570
5293 #, no-wrap
5294 msgid ""
5295 "    /* Wait up to five seconds. */\n"
5296 "    tv.tv_sec = 5;\n"
5297 "    tv.tv_usec = 0;\n"
5298 msgstr ""
5299 "    /* 5 秒間監視する。*/\n"
5300 "    tv.tv_sec = 5;\n"
5301 "    tv.tv_usec = 0;\n"
5302
5303 #. type: Plain text
5304 #: build/C/man2/select.2:573
5305 #, no-wrap
5306 msgid ""
5307 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5308 "    /* Don't rely on the value of tv now! */\n"
5309 msgstr ""
5310 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5311 "    /* この時点での tv の値を信頼してはならない。*/\n"
5312
5313 #. type: Plain text
5314 #: build/C/man2/select.2:581
5315 #, no-wrap
5316 msgid ""
5317 "    if (retval == -1)\n"
5318 "        perror(\"select()\");\n"
5319 "    else if (retval)\n"
5320 "        printf(\"Data is available now.\\en\");\n"
5321 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5322 "    else\n"
5323 "        printf(\"No data within five seconds.\\en\");\n"
5324 msgstr ""
5325 "    if (retval == -1)\n"
5326 "\tperror(\"select()\");\n"
5327 "    else if (retval)\n"
5328 "        printf(\"今、データが取得できました。\\en\");\n"
5329 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5330 "    else\n"
5331 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5332
5333 #. type: Plain text
5334 #: build/C/man2/select.2:596
5335 msgid ""
5336 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5337 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5338 msgstr ""
5339 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5340 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5341
5342 #. type: Plain text
5343 #: build/C/man2/select.2:599
5344 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5345 msgstr ""
5346 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5347
5348 #. type: TH
5349 #: build/C/man2/select_tut.2:32
5350 #, no-wrap
5351 msgid "SELECT_TUT"
5352 msgstr "SELECT_TUT"
5353
5354 #. type: TH
5355 #: build/C/man2/select_tut.2:32
5356 #, fuzzy, no-wrap
5357 #| msgid "2013-09-04"
5358 msgid "2013-12-30"
5359 msgstr "2013-09-04"
5360
5361 #. type: Plain text
5362 #: build/C/man2/select_tut.2:52
5363 #, no-wrap
5364 msgid ""
5365 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5366 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5367 msgstr ""
5368 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5369 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5370
5371 #. type: Plain text
5372 #: build/C/man2/select_tut.2:66
5373 #, no-wrap
5374 msgid ""
5375 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5376 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5377 "B<            const sigset_t *>I<sigmask>B<);>\n"
5378 msgstr ""
5379 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5380 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5381 "B<            const sigset_t *>I<sigmask>B<);>\n"
5382
5383 #. type: Plain text
5384 #: build/C/man2/select_tut.2:83
5385 msgid ""
5386 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5387 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5388 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5389 "occurred on any of the descriptors."
5390 msgstr ""
5391 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5392 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5393 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5394 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5395 "る。"
5396
5397 #. type: Plain text
5398 #: build/C/man2/select_tut.2:108
5399 msgid ""
5400 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5401 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5402 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5403 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5404 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5405 "according to the rules described below; after calling B<select>()  you can "
5406 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5407 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5408 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5409 "descriptor from a set."
5410 msgstr ""
5411 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5412 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5413 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5414 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5415 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5416 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5417 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5418 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5419 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5420 "のファイルディスクリプタの削除を行う。"
5421
5422 #. type: SS
5423 #: build/C/man2/select_tut.2:108
5424 #, no-wrap
5425 msgid "Arguments"
5426 msgstr "引き数"
5427
5428 #. type: TP
5429 #: build/C/man2/select_tut.2:109
5430 #, no-wrap
5431 msgid "I<readfds>"
5432 msgstr "I<readfds>"
5433
5434 #. type: Plain text
5435 #: build/C/man2/select_tut.2:118
5436 msgid ""
5437 "This set is watched to see if data is available for reading from any of its "
5438 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5439 "cleared of all file descriptors except for those that are immediately "
5440 "available for reading."
5441 msgstr ""
5442 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5443 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5444 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5445
5446 #. type: TP
5447 #: build/C/man2/select_tut.2:118
5448 #, no-wrap
5449 msgid "I<writefds>"
5450 msgstr "I<writefds>"
5451
5452 #. type: Plain text
5453 #: build/C/man2/select_tut.2:127
5454 msgid ""
5455 "This set is watched to see if there is space to write data to any of its "
5456 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5457 "cleared of all file descriptors except for those that are immediately "
5458 "available for writing."
5459 msgstr ""
5460 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5461 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5462 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5463
5464 #. type: TP
5465 #: build/C/man2/select_tut.2:127
5466 #, no-wrap
5467 msgid "I<exceptfds>"
5468 msgstr "I<exceptfds>"
5469
5470 #. type: Plain text
5471 #: build/C/man2/select_tut.2:149
5472 msgid ""
5473 "This set is watched for \"exceptional conditions\".  In practice, only one "
5474 "such exceptional condition is common: the availability of I<out-of-band> "
5475 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5476 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5477 "where B<select>(2)  indicates an exceptional condition occurs with "
5478 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5479 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5480 "for those for which an exceptional condition has occurred."
5481 msgstr ""
5482 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5483 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5484 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5485 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5486 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5487 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5488 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5489 "状態が発生したディスクリプタ以外は集合から削除される。"
5490
5491 #. type: TP
5492 #: build/C/man2/select_tut.2:149
5493 #, no-wrap
5494 msgid "I<nfds>"
5495 msgstr "I<nfds>"
5496
5497 #. type: Plain text
5498 #: build/C/man2/select_tut.2:156
5499 msgid ""
5500 "This is an integer one more than the maximum of any file descriptor in any "
5501 "of the sets.  In other words, while adding file descriptors to each of the "
5502 "sets, you must calculate the maximum integer value of all of them, then "
5503 "increment this value by one, and then pass this as I<nfds>."
5504 msgstr ""
5505 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5506 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5507 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5508 "I<nfds> として渡さないといけない、ということだ。"
5509
5510 #. type: TP
5511 #: build/C/man2/select_tut.2:156
5512 #, no-wrap
5513 msgid "I<utimeout>"
5514 msgstr "I<utimeout>"
5515
5516 #. type: Plain text
5517 #: build/C/man2/select_tut.2:169
5518 msgid ""
5519 "This is the longest time B<select>()  may wait before returning, even if "
5520 "nothing interesting happened.  If this value is passed as NULL, then "
5521 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5522 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5523 "return immediately, with information about the readiness of file descriptors "
5524 "at the time of the call.  The structure I<struct timeval> is defined as:"
5525 msgstr ""
5526 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5527 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5528 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5529 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5530 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5531 "ように定義されている:"
5532
5533 #. type: Plain text
5534 #: build/C/man2/select_tut.2:176
5535 #, no-wrap
5536 msgid ""
5537 "struct timeval {\n"
5538 "    time_t tv_sec;    /* seconds */\n"
5539 "    long tv_usec;     /* microseconds */\n"
5540 "};\n"
5541 msgstr ""
5542 "struct timeval {\n"
5543 "    time_t tv_sec;    /* seconds */\n"
5544 "    long tv_usec;     /* microseconds */\n"
5545 "};\n"
5546
5547 #. type: TP
5548 #: build/C/man2/select_tut.2:178
5549 #, no-wrap
5550 msgid "I<ntimeout>"
5551 msgstr "I<ntimeout>"
5552
5553 #. type: Plain text
5554 #: build/C/man2/select_tut.2:187
5555 msgid ""
5556 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5557 "I<struct timespec> has nanosecond precision as follows:"
5558 msgstr ""
5559 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5560 "timespec> は次に示すようにナノ秒の精度を持つ。"
5561
5562 #. type: Plain text
5563 #: build/C/man2/select_tut.2:194
5564 #, no-wrap
5565 msgid ""
5566 "struct timespec {\n"
5567 "    long tv_sec;    /* seconds */\n"
5568 "    long tv_nsec;   /* nanoseconds */\n"
5569 "};\n"
5570 msgstr ""
5571 "struct timespec {\n"
5572 "    long tv_sec;    /* seconds */\n"
5573 "    long tv_nsec;   /* nanoseconds */\n"
5574 "};\n"
5575
5576 #. type: TP
5577 #: build/C/man2/select_tut.2:196
5578 #, no-wrap
5579 msgid "I<sigmask>"
5580 msgstr "I<sigmask>"
5581
5582 #. type: Plain text
5583 #: build/C/man2/select_tut.2:213
5584 msgid ""
5585 "This argument holds a set of signals that the kernel should unblock (i.e., "
5586 "remove from the signal mask of the calling thread), while the caller is "
5587 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5588 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5589 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5590 "()  will then behave just like B<select>()."
5591 msgstr ""
5592 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5593 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5594 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5595 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5596 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5597 "()  と全く同じ動作となる。"
5598
5599 #. type: SS
5600 #: build/C/man2/select_tut.2:213
5601 #, no-wrap
5602 msgid "Combining signal and data events"
5603 msgstr "シグナルとデータイベントを組み合わせる"
5604
5605 #. type: Plain text
5606 #: build/C/man2/select_tut.2:257
5607 msgid ""
5608 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5609 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5610 "normally use the signal handler only to raise a global flag.  The global "
5611 "flag will indicate that the event must be processed in the main loop of the "
5612 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5613 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5614 "signals can be processed in the main loop of the program, otherwise B<select>"
5615 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5616 "conditional to check the global flag.  So we must ask: what if a signal "
5617 "arrives after the conditional, but before the B<select>()  call? The answer "
5618 "is that B<select>()  would block indefinitely, even though an event is "
5619 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5620 "This call can be used to set the signal mask to a set of signals that are "
5621 "only to be received within the B<pselect>()  call.  For instance, let us say "
5622 "that the event in question was the exit of a child process.  Before the "
5623 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5624 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5625 "mask.  Our program would look like:"
5626 msgstr ""
5627 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5628 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5629 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5630 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5631 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5632 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5633 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5634 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5635 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5636 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5637 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5638 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5639 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5640 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5641 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5642 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5643 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5644 "る。"
5645
5646 #. type: Plain text
5647 #: build/C/man2/select_tut.2:260
5648 #, no-wrap
5649 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5650 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5651
5652 #. type: Plain text
5653 #: build/C/man2/select_tut.2:266
5654 #, no-wrap
5655 msgid ""
5656 "static void\n"
5657 "child_sig_handler(int sig)\n"
5658 "{\n"
5659 "    got_SIGCHLD = 1;\n"
5660 "}\n"
5661 msgstr ""
5662 "static void\n"
5663 "child_sig_handler(int sig)\n"
5664 "{\n"
5665 "    got_SIGCHLD = 1;\n"
5666 "}\n"
5667
5668 #. type: Plain text
5669 #: build/C/man2/select_tut.2:274
5670 #, no-wrap
5671 msgid ""
5672 "int\n"
5673 "main(int argc, char *argv[])\n"
5674 "{\n"
5675 "    sigset_t sigmask, empty_mask;\n"
5676 "    struct sigaction sa;\n"
5677 "    fd_set readfds, writefds, exceptfds;\n"
5678 "    int r;\n"
5679 msgstr ""
5680 "int\n"
5681 "main(int argc, char *argv[])\n"
5682 "{\n"
5683 "    sigset_t sigmask, empty_mask;\n"
5684 "    struct sigaction sa;\n"
5685 "    fd_set readfds, writefds, exceptfds;\n"
5686 "    int r;\n"
5687
5688 #. type: Plain text
5689 #: build/C/man2/select_tut.2:281
5690 #, no-wrap
5691 msgid ""
5692 "    sigemptyset(&sigmask);\n"
5693 "    sigaddset(&sigmask, SIGCHLD);\n"
5694 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5695 "        perror(\"sigprocmask\");\n"
5696 "        exit(EXIT_FAILURE);\n"
5697 "    }\n"
5698 msgstr ""
5699 "    sigemptyset(&sigmask);\n"
5700 "    sigaddset(&sigmask, SIGCHLD);\n"
5701 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5702 "        perror(\"sigprocmask\");\n"
5703 "        exit(EXIT_FAILURE);\n"
5704 "    }\n"
5705
5706 #. type: Plain text
5707 #: build/C/man2/select_tut.2:289
5708 #, no-wrap
5709 msgid ""
5710 "    sa.sa_flags = 0;\n"
5711 "    sa.sa_handler = child_sig_handler;\n"
5712 "    sigemptyset(&sa.sa_mask);\n"
5713 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5714 "        perror(\"sigaction\");\n"
5715 "        exit(EXIT_FAILURE);\n"
5716 "    }\n"
5717 msgstr ""
5718 "    sa.sa_flags = 0;\n"
5719 "    sa.sa_handler = child_sig_handler;\n"
5720 "    sigemptyset(&sa.sa_mask);\n"
5721 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5722 "        perror(\"sigaction\");\n"
5723 "        exit(EXIT_FAILURE);\n"
5724 "    }\n"
5725
5726 #. type: Plain text
5727 #: build/C/man2/select_tut.2:291
5728 #, no-wrap
5729 msgid "    sigemptyset(&empty_mask);\n"
5730 msgstr "    sigemptyset(&empty_mask);\n"
5731
5732 #. type: Plain text
5733 #: build/C/man2/select_tut.2:295
5734 #, no-wrap
5735 msgid ""
5736 "    for (;;) {          /* main loop */\n"
5737 "        /* Initialize readfds, writefds, and exceptfds\n"
5738 "           before the pselect() call. (Code omitted.) */\n"
5739 msgstr ""
5740 "    for (;;) {          /* main loop */\n"
5741 "        /* Initialize readfds, writefds, and exceptfds\n"
5742 "           before the pselect() call. (Code omitted.) */\n"
5743
5744 #. type: Plain text
5745 #: build/C/man2/select_tut.2:301
5746 #, no-wrap
5747 msgid ""
5748 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5749 "                    NULL, &empty_mask);\n"
5750 "        if (r == -1 && errno != EINTR) {\n"
5751 "            /* Handle error */\n"
5752 "        }\n"
5753 msgstr ""
5754 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5755 "                    NULL, &empty_mask);\n"
5756 "        if (r == -1 && errno != EINTR) {\n"
5757 "            /* Handle error */\n"
5758 "        }\n"
5759
5760 #. type: Plain text
5761 #: build/C/man2/select_tut.2:304
5762 #, no-wrap
5763 msgid ""
5764 "        if (got_SIGCHLD) {\n"
5765 "            got_SIGCHLD = 0;\n"
5766 msgstr ""
5767 "        if (got_SIGCHLD) {\n"
5768 "            got_SIGCHLD = 0;\n"
5769
5770 #. type: Plain text
5771 #: build/C/man2/select_tut.2:308
5772 #, no-wrap
5773 msgid ""
5774 "            /* Handle signalled event here; e.g., wait() for all\n"
5775 "               terminated children. (Code omitted.) */\n"
5776 "        }\n"
5777 msgstr ""
5778 "            /* Handle signalled event here; e.g., wait() for all\n"
5779 "               terminated children. (Code omitted.) */\n"
5780 "        }\n"
5781
5782 #. type: Plain text
5783 #: build/C/man2/select_tut.2:312
5784 #, no-wrap
5785 msgid ""
5786 "        /* main body of program */\n"
5787 "    }\n"
5788 "}\n"
5789 msgstr ""
5790 "        /* main body of program */\n"
5791 "    }\n"
5792 "}\n"
5793
5794 #. type: SS
5795 #: build/C/man2/select_tut.2:313
5796 #, no-wrap
5797 msgid "Practical"
5798 msgstr "実例"
5799
5800 #. type: Plain text
5801 #: build/C/man2/select_tut.2:334
5802 msgid ""
5803 "So what is the point of B<select>()? Can't I just read and write to my "
5804 "descriptors whenever I want? The point of B<select>()  is that it watches "
5805 "multiple descriptors at the same time and properly puts the process to sleep "
5806 "if there is no activity.  UNIX programmers often find themselves in a "
5807 "position where they have to handle I/O from more than one file descriptor "
5808 "where the data flow may be intermittent.  If you were to merely create a "
5809 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5810 "your calls may block waiting for data from/to a file descriptor, while "
5811 "another file descriptor is unused though ready for I/O.  B<select>()  "
5812 "efficiently copes with this situation."
5813 msgstr ""
5814 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5815 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5816 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5817 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5818 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5819 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5820 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5821 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5822 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5823
5824 #. type: SS
5825 #: build/C/man2/select_tut.2:334
5826 #, no-wrap
5827 msgid "Select law"
5828 msgstr "SELECT の掟"
5829
5830 #. type: Plain text
5831 #: build/C/man2/select_tut.2:347
5832 msgid ""
5833 "Many people who try to use B<select>()  come across behavior that is "
5834 "difficult to understand and produces nonportable or borderline results.  For "
5835 "instance, the above program is carefully written not to block at any point, "
5836 "even though it does not set its file descriptors to nonblocking mode.  It is "
5837 "easy to introduce subtle errors that will remove the advantage of using "
5838 "B<select>(), so here is a list of essentials to watch for when using "
5839 "B<select>()."
5840 msgstr ""
5841 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5842 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5843 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5844 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5845 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5846 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5847 "ことにする。"
5848
5849 #. type: Plain text
5850 #: build/C/man2/select_tut.2:356
5851 msgid ""
5852 "You should always try to use B<select>()  without a timeout.  Your program "
5853 "should have nothing to do if there is no data available.  Code that depends "
5854 "on timeouts is not usually portable and is difficult to debug."
5855 msgstr ""
5856 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5857 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5858 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5859
5860 #. type: Plain text
5861 #: build/C/man2/select_tut.2:360
5862 msgid ""
5863 "The value I<nfds> must be properly calculated for efficiency as explained "
5864 "above."
5865 msgstr ""
5866 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5867 "えなければならない。"
5868
5869 #. type: Plain text
5870 #: build/C/man2/select_tut.2:367
5871 msgid ""
5872 "No file descriptor must be added to any set if you do not intend to check "
5873 "its result after the B<select>()  call, and respond appropriately.  See next "
5874 "rule."
5875 msgstr ""
5876 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5877 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5878
5879 #. type: Plain text
5880 #: build/C/man2/select_tut.2:373
5881 msgid ""
5882 "After B<select>()  returns, all file descriptors in all sets should be "
5883 "checked to see if they are ready."
5884 msgstr ""
5885 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5886 "て 読み書き可能な状態になっているかをチェックすべきである。"
5887
5888 #. type: TP
5889 #: build/C/man2/select_tut.2:373
5890 #, no-wrap
5891 msgid "5."
5892 msgstr "5."
5893
5894 #. type: Plain text
5895 #: build/C/man2/select_tut.2:388
5896 msgid ""
5897 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5898 "necessarily read/write the full amount of data that you have requested.  If "
5899 "they do read/write the full amount, it's because you have a low traffic load "
5900 "and a fast stream.  This is not always going to be the case.  You should "
5901 "cope with the case of your functions managing to send or receive only a "
5902 "single byte."
5903 msgstr ""
5904 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5905 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5906 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5907 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5908 "うな場合も 考慮に入れてやらなければならない。"
5909
5910 #. type: TP
5911 #: build/C/man2/select_tut.2:388
5912 #, no-wrap
5913 msgid "6."
5914 msgstr "6."
5915
5916 #. type: Plain text
5917 #: build/C/man2/select_tut.2:396
5918 msgid ""
5919 "Never read/write only in single bytes at a time unless you are really sure "
5920 "that you have a small amount of data to process.  It is extremely "
5921 "inefficient not to read/write as much data as you can buffer each time.  The "
5922 "buffers in the example below are 1024 bytes although they could easily be "
5923 "made larger."
5924 msgstr ""
5925 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5926 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5927 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5928 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5929
5930 #. type: TP
5931 #: build/C/man2/select_tut.2:396
5932 #, no-wrap
5933 msgid "7."
5934 msgstr "7."
5935
5936 #.  Nonetheless, you should still cope with these errors for completeness.
5937 #. type: Plain text
5938 #: build/C/man2/select_tut.2:418
5939 msgid ""
5940 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5941 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5942 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5943 "properly managed (not done properly above).  If your program is not going to "
5944 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5945 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5946 msgstr ""
5947 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5948 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5949 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5950 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5951 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5952 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5953
5954 #. type: TP
5955 #: build/C/man2/select_tut.2:418
5956 #, no-wrap
5957 msgid "8."
5958 msgstr "8."
5959
5960 #. type: Plain text
5961 #: build/C/man2/select_tut.2:427
5962 msgid ""
5963 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5964 "length of zero."
5965 msgstr ""
5966 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5967 "(2), B<send>(2)  を呼び出してはならない。"
5968
5969 #. type: TP
5970 #: build/C/man2/select_tut.2:427
5971 #, no-wrap
5972 msgid "9."
5973 msgstr "9."
5974
5975 #. type: Plain text
5976 #: build/C/man2/select_tut.2:443
5977 msgid ""
5978 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5979 "with errors other than those listed in B<7.>, or one of the input functions "
5980 "returns 0, indicating end of file, then you should I<not> pass that "
5981 "descriptor to B<select>()  again.  In the example below, I close the "
5982 "descriptor immediately, and then set it to -1 to prevent it being included "
5983 "in a set."
5984 msgstr ""
5985 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5986 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5987 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5988 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5989 "が集合に含まれ続けるのを許さないようにしている。"
5990
5991 #. type: TP
5992 #: build/C/man2/select_tut.2:443
5993 #, no-wrap
5994 msgid "10."
5995 msgstr "10."
5996
5997 #. type: Plain text
5998 #: build/C/man2/select_tut.2:450
5999 msgid ""
6000 "The timeout value must be initialized with each new call to B<select>(), "
6001 "since some operating systems modify the structure.  B<pselect>()  however "
6002 "does not modify its timeout structure."
6003 msgstr ""
6004 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
6005 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
6006 "分の timeout 構造体を変更することはない。"
6007
6008 #. type: TP
6009 #: build/C/man2/select_tut.2:450
6010 #, no-wrap
6011 msgid "11."
6012 msgstr "11."
6013
6014 #.  "I have heard" does not fill me with confidence, and doesn't
6015 #.  belong in a man page, so I've commented this point out.
6016 #.  .TP
6017 #.  11.
6018 #.  I have heard that the Windows socket layer does not cope with OOB data
6019 #.  properly.
6020 #.  It also does not cope with
6021 #.  .BR select ()
6022 #.  calls when no file descriptors are set at all.
6023 #.  Having no file descriptors set is a useful
6024 #.  way to sleep the process with subsecond precision by using the timeout.
6025 #.  (See further on.)
6026 #. type: Plain text
6027 #: build/C/man2/select_tut.2:469
6028 msgid ""
6029 "Since B<select>()  modifies its file descriptor sets, if the call is being "
6030 "used in a loop, then the sets must be reinitialized before each call."
6031 msgstr ""
6032 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
6033 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
6034 "期化し直さなければならない。"
6035
6036 #. type: SS
6037 #: build/C/man2/select_tut.2:469
6038 #, no-wrap
6039 msgid "Usleep emulation"
6040 msgstr "usleep エミュレーション"
6041
6042 #. type: Plain text
6043 #: build/C/man2/select_tut.2:476
6044 msgid ""
6045 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
6046 "()  with a finite timeout and no file descriptors as follows:"
6047 msgstr ""
6048 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
6049 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
6050 "できる。 以下のようにする。"
6051
6052 #. type: Plain text
6053 #: build/C/man2/select_tut.2:482
6054 #, no-wrap
6055 msgid ""
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 msgstr ""
6061 "    struct timeval tv;\n"
6062 "    tv.tv_sec = 0;\n"
6063 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6064 "    select(0, NULL, NULL, NULL, &tv);\n"
6065
6066 #. type: Plain text
6067 #: build/C/man2/select_tut.2:485
6068 msgid "This is guaranteed to work only on UNIX systems, however."
6069 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6070
6071 #. type: Plain text
6072 #: build/C/man2/select_tut.2:490
6073 msgid ""
6074 "On success, B<select>()  returns the total number of file descriptors still "
6075 "present in the file descriptor sets."
6076 msgstr ""
6077 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
6078 "ディスクリプタの総数を返す。"
6079
6080 #. type: Plain text
6081 #: build/C/man2/select_tut.2:496
6082 msgid ""
6083 "If B<select>()  timed out, then the return value will be zero.  The file "
6084 "descriptors set should be all empty (but may not be on some systems)."
6085 msgstr ""
6086 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6087 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
6088
6089 #. type: Plain text
6090 #: build/C/man2/select_tut.2:503
6091 msgid ""
6092 "A return value of -1 indicates an error, with I<errno> being set "
6093 "appropriately.  In the case of an error, the contents of the returned sets "
6094 "and the I<struct timeout> contents are undefined and should not be used.  "
6095 "B<pselect>()  however never modifies I<ntimeout>."
6096 msgstr ""
6097 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6098 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6099 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
6100 "変更しない。"
6101
6102 #. type: Plain text
6103 #: build/C/man2/select_tut.2:512
6104 msgid ""
6105 "Generally speaking, all operating systems that support sockets also support "
6106 "B<select>().  B<select>()  can be used to solve many problems in a portable "
6107 "and efficient way that naive programmers try to solve in a more complicated "
6108 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6109 msgstr ""
6110 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6111 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6112 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6113 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6114
6115 #. type: Plain text
6116 #: build/C/man2/select_tut.2:521
6117 msgid ""
6118 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6119 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6120 "is nowadays widely available, but historically was less portable than "
6121 "B<select>()."
6122 msgstr ""
6123 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6124 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6125 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6126
6127 #. type: Plain text
6128 #: build/C/man2/select_tut.2:529
6129 msgid ""
6130 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6131 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6132 "of file descriptors."
6133 msgstr ""
6134 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
6135 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
6136
6137 #. type: Plain text
6138 #: build/C/man2/select_tut.2:534
6139 msgid ""
6140 "Here is an example that better demonstrates the true utility of B<select>"
6141 "().  The listing below is a TCP forwarding program that forwards from one "
6142 "TCP port to another."
6143 msgstr ""
6144 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6145 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6146
6147 #. type: Plain text
6148 #: build/C/man2/select_tut.2:547
6149 #, no-wrap
6150 msgid ""
6151 "#include E<lt>stdlib.hE<gt>\n"
6152 "#include E<lt>stdio.hE<gt>\n"
6153 "#include E<lt>unistd.hE<gt>\n"
6154 "#include E<lt>sys/time.hE<gt>\n"
6155 "#include E<lt>sys/types.hE<gt>\n"
6156 "#include E<lt>string.hE<gt>\n"
6157 "#include E<lt>signal.hE<gt>\n"
6158 "#include E<lt>sys/socket.hE<gt>\n"
6159 "#include E<lt>netinet/in.hE<gt>\n"
6160 "#include E<lt>arpa/inet.hE<gt>\n"
6161 "#include E<lt>errno.hE<gt>\n"
6162 msgstr ""
6163 "#include E<lt>stdlib.hE<gt>\n"
6164 "#include E<lt>stdio.hE<gt>\n"
6165 "#include E<lt>unistd.hE<gt>\n"
6166 "#include E<lt>sys/time.hE<gt>\n"
6167 "#include E<lt>sys/types.hE<gt>\n"
6168 "#include E<lt>string.hE<gt>\n"
6169 "#include E<lt>signal.hE<gt>\n"
6170 "#include E<lt>sys/socket.hE<gt>\n"
6171 "#include E<lt>netinet/in.hE<gt>\n"
6172 "#include E<lt>arpa/inet.hE<gt>\n"
6173 "#include E<lt>errno.hE<gt>\n"
6174
6175 #. type: Plain text
6176 #: build/C/man2/select_tut.2:549
6177 #, no-wrap
6178 msgid "static int forward_port;\n"
6179 msgstr "static int forward_port;\n"
6180
6181 #. type: Plain text
6182 #: build/C/man2/select_tut.2:552
6183 #, no-wrap
6184 msgid ""
6185 "#undef max\n"
6186 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6187 msgstr ""
6188 "#undef max\n"
6189 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6190
6191 #. type: Plain text
6192 #: build/C/man2/select_tut.2:559
6193 #, no-wrap
6194 msgid ""
6195 "static int\n"
6196 "listen_socket(int listen_port)\n"
6197 "{\n"
6198 "    struct sockaddr_in a;\n"
6199 "    int s;\n"
6200 "    int yes;\n"
6201 msgstr ""
6202 "static int\n"
6203 "listen_socket(int listen_port)\n"
6204 "{\n"
6205 "    struct sockaddr_in a;\n"
6206 "    int s;\n"
6207 "    int yes;\n"
6208
6209 #. type: Plain text
6210 #: build/C/man2/select_tut.2:584
6211 #, fuzzy, no-wrap
6212 #| msgid ""
6213 #| "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6214 #| "        perror(\"socket\");\n"
6215 #| "        return -1;\n"
6216 #| "    }\n"
6217 #| "    yes = 1;\n"
6218 #| "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6219 #| "            &yes, sizeof(yes)) == -1) {\n"
6220 #| "        perror(\"setsockopt\");\n"
6221 #| "        close(s);\n"
6222 #| "        return -1;\n"
6223 #| "    }\n"
6224 #| "    memset(&a, 0, sizeof(a));\n"
6225 #| "    a.sin_port = htons(listen_port);\n"
6226 #| "    a.sin_family = AF_INET;\n"
6227 #| "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6228 #| "        perror(\"bind\");\n"
6229 #| "        close(s);\n"
6230 #| "        return -1;\n"
6231 #| "    }\n"
6232 #| "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6233 #| "    listen(s, 10);\n"
6234 #| "    return s;\n"
6235 #| "}\n"
6236 msgid ""
6237 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6238 "    if (s == -1) {\n"
6239 "        perror(\"socket\");\n"
6240 "        return -1;\n"
6241 "    }\n"
6242 "    yes = 1;\n"
6243 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6244 "            &yes, sizeof(yes)) == -1) {\n"
6245 "        perror(\"setsockopt\");\n"
6246 "        close(s);\n"
6247 "        return -1;\n"
6248 "    }\n"
6249 "    memset(&a, 0, sizeof(a));\n"
6250 "    a.sin_port = htons(listen_port);\n"
6251 "    a.sin_family = AF_INET;\n"
6252 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6253 "        perror(\"bind\");\n"
6254 "        close(s);\n"
6255 "        return -1;\n"
6256 "    }\n"
6257 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6258 "    listen(s, 10);\n"
6259 "    return s;\n"
6260 "}\n"
6261 msgstr ""
6262 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6263 "        perror(\"socket\");\n"
6264 "        return -1;\n"
6265 "    }\n"
6266 "    yes = 1;\n"
6267 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6268 "            &yes, sizeof(yes)) == -1) {\n"
6269 "        perror(\"setsockopt\");\n"
6270 "        close(s);\n"
6271 "        return -1;\n"
6272 "    }\n"
6273 "    memset(&a, 0, sizeof(a));\n"
6274 "    a.sin_port = htons(listen_port);\n"
6275 "    a.sin_family = AF_INET;\n"
6276 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6277 "        perror(\"bind\");\n"
6278 "        close(s);\n"
6279 "        return -1;\n"
6280 "    }\n"
6281 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6282 "    listen(s, 10);\n"
6283 "    return s;\n"
6284 "}\n"
6285
6286 #. type: Plain text
6287 #: build/C/man2/select_tut.2:590
6288 #, no-wrap
6289 msgid ""
6290 "static int\n"
6291 "connect_socket(int connect_port, char *address)\n"
6292 "{\n"
6293 "    struct sockaddr_in a;\n"
6294 "    int s;\n"
6295 msgstr ""
6296 "static int\n"
6297 "connect_socket(int connect_port, char *address)\n"
6298 "{\n"
6299 "    struct sockaddr_in a;\n"
6300 "    int s;\n"
6301
6302 #. type: Plain text
6303 #: build/C/man2/select_tut.2:597
6304 #, fuzzy, no-wrap
6305 #| msgid ""
6306 #| "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6307 #| "        perror(\"socket\");\n"
6308 #| "        close(s);\n"
6309 #| "        return -1;\n"
6310 #| "    }\n"
6311 msgid ""
6312 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6313 "    if (s == -1) {\n"
6314 "        perror(\"socket\");\n"
6315 "        close(s);\n"
6316 "        return -1;\n"
6317 "    }\n"
6318 msgstr ""
6319 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6320 "        perror(\"socket\");\n"
6321 "        close(s);\n"
6322 "        return -1;\n"
6323 "    }\n"
6324
6325 #. type: Plain text
6326 #: build/C/man2/select_tut.2:601
6327 #, no-wrap
6328 msgid ""
6329 "    memset(&a, 0, sizeof(a));\n"
6330 "    a.sin_port = htons(connect_port);\n"
6331 "    a.sin_family = AF_INET;\n"
6332 msgstr ""
6333 "    memset(&a, 0, sizeof(a));\n"
6334 "    a.sin_port = htons(connect_port);\n"
6335 "    a.sin_family = AF_INET;\n"
6336
6337 #. type: Plain text
6338 #: build/C/man2/select_tut.2:607
6339 #, no-wrap
6340 msgid ""
6341 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6342 "        perror(\"bad IP address format\");\n"
6343 "        close(s);\n"
6344 "        return -1;\n"
6345 "    }\n"
6346 msgstr ""
6347 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6348 "        perror(\"bad IP address format\");\n"
6349 "        close(s);\n"
6350 "        return -1;\n"
6351 "    }\n"
6352
6353 #. type: Plain text
6354 #: build/C/man2/select_tut.2:616
6355 #, no-wrap
6356 msgid ""
6357 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6358 "        perror(\"connect()\");\n"
6359 "        shutdown(s, SHUT_RDWR);\n"
6360 "        close(s);\n"
6361 "        return -1;\n"
6362 "    }\n"
6363 "    return s;\n"
6364 "}\n"
6365 msgstr ""
6366 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6367 "        perror(\"connect()\");\n"
6368 "        shutdown(s, SHUT_RDWR);\n"
6369 "        close(s);\n"
6370 "        return -1;\n"
6371 "    }\n"
6372 "    return s;\n"
6373 "}\n"
6374
6375 #. type: Plain text
6376 #: build/C/man2/select_tut.2:624
6377 #, no-wrap
6378 msgid ""
6379 "#define SHUT_FD1 do {                                \\e\n"
6380 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6381 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6382 "                         close(fd1);                 \\e\n"
6383 "                         fd1 = -1;                   \\e\n"
6384 "                     }                               \\e\n"
6385 "                 } while (0)\n"
6386 msgstr ""
6387 "#define SHUT_FD1 do {                                \\e\n"
6388 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6389 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6390 "                         close(fd1);                 \\e\n"
6391 "                         fd1 = -1;                   \\e\n"
6392 "                     }                               \\e\n"
6393 "                 } while (0)\n"
6394
6395 #. type: Plain text
6396 #: build/C/man2/select_tut.2:632
6397 #, no-wrap
6398 msgid ""
6399 "#define SHUT_FD2 do {                                \\e\n"
6400 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6401 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6402 "                         close(fd2);                 \\e\n"
6403 "                         fd2 = -1;                   \\e\n"
6404 "                     }                               \\e\n"
6405 "                 } while (0)\n"
6406 msgstr ""
6407 "#define SHUT_FD2 do {                                \\e\n"
6408 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6409 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6410 "                         close(fd2);                 \\e\n"
6411 "                         fd2 = -1;                   \\e\n"
6412 "                     }                               \\e\n"
6413 "                 } while (0)\n"
6414
6415 #. type: Plain text
6416 #: build/C/man2/select_tut.2:634
6417 #, no-wrap
6418 msgid "#define BUF_SIZE 1024\n"
6419 msgstr "#define BUF_SIZE 1024\n"
6420
6421 #. type: Plain text
6422 #: build/C/man2/select_tut.2:643
6423 #, no-wrap
6424 msgid ""
6425 "int\n"
6426 "main(int argc, char *argv[])\n"
6427 "{\n"
6428 "    int h;\n"
6429 "    int fd1 = -1, fd2 = -1;\n"
6430 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6431 "    int buf1_avail, buf1_written;\n"
6432 "    int buf2_avail, buf2_written;\n"
6433 msgstr ""
6434 "int\n"
6435 "main(int argc, char *argv[])\n"
6436 "{\n"
6437 "    int h;\n"
6438 "    int fd1 = -1, fd2 = -1;\n"
6439 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6440 "    int buf1_avail, buf1_written;\n"
6441 "    int buf2_avail, buf2_written;\n"
6442
6443 #. type: Plain text
6444 #: build/C/man2/select_tut.2:649
6445 #, no-wrap
6446 msgid ""
6447 "    if (argc != 4) {\n"
6448 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6449 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6450 "        exit(EXIT_FAILURE);\n"
6451 "    }\n"
6452 msgstr ""
6453 "    if (argc != 4) {\n"
6454 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6455 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6456 "        exit(EXIT_FAILURE);\n"
6457 "    }\n"
6458
6459 #. type: Plain text
6460 #: build/C/man2/select_tut.2:651
6461 #, no-wrap
6462 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6463 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6464
6465 #. type: Plain text
6466 #: build/C/man2/select_tut.2:653
6467 #, no-wrap
6468 msgid "    forward_port = atoi(argv[2]);\n"
6469 msgstr "    forward_port = atoi(argv[2]);\n"
6470
6471 #. type: Plain text
6472 #: build/C/man2/select_tut.2:657
6473 #, no-wrap
6474 msgid ""
6475 "    h = listen_socket(atoi(argv[1]));\n"
6476 "    if (h == -1)\n"
6477 "        exit(EXIT_FAILURE);\n"
6478 msgstr ""
6479 "    h = listen_socket(atoi(argv[1]));\n"
6480 "    if (h == -1)\n"
6481 "        exit(EXIT_FAILURE);\n"
6482
6483 #. type: Plain text
6484 #: build/C/man2/select_tut.2:661
6485 #, no-wrap
6486 msgid ""
6487 "    for (;;) {\n"
6488 "        int r, nfds = 0;\n"
6489 "        fd_set rd, wr, er;\n"
6490 msgstr ""
6491 "    for (;;) {\n"
6492 "        int r, nfds = 0;\n"
6493 "        fd_set rd, wr, er;\n"
6494
6495 #. type: Plain text
6496 #: build/C/man2/select_tut.2:691
6497 #, no-wrap
6498 msgid ""
6499 "        FD_ZERO(&rd);\n"
6500 "        FD_ZERO(&wr);\n"
6501 "        FD_ZERO(&er);\n"
6502 "        FD_SET(h, &rd);\n"
6503 "        nfds = max(nfds, h);\n"
6504 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6505 "            FD_SET(fd1, &rd);\n"
6506 "            nfds = max(nfds, fd1);\n"
6507 "        }\n"
6508 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6509 "            FD_SET(fd2, &rd);\n"
6510 "            nfds = max(nfds, fd2);\n"
6511 "        }\n"
6512 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6513 "            FD_SET(fd1, &wr);\n"
6514 "            nfds = max(nfds, fd1);\n"
6515 "        }\n"
6516 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6517 "            FD_SET(fd2, &wr);\n"
6518 "            nfds = max(nfds, fd2);\n"
6519 "        }\n"
6520 "        if (fd1 E<gt> 0) {\n"
6521 "            FD_SET(fd1, &er);\n"
6522 "            nfds = max(nfds, fd1);\n"
6523 "        }\n"
6524 "        if (fd2 E<gt> 0) {\n"
6525 "            FD_SET(fd2, &er);\n"
6526 "            nfds = max(nfds, fd2);\n"
6527 "        }\n"
6528 msgstr ""
6529 "        FD_ZERO(&rd);\n"
6530 "        FD_ZERO(&wr);\n"
6531 "        FD_ZERO(&er);\n"
6532 "        FD_SET(h, &rd);\n"
6533 "        nfds = max(nfds, h);\n"
6534 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6535 "            FD_SET(fd1, &rd);\n"
6536 "            nfds = max(nfds, fd1);\n"
6537 "        }\n"
6538 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6539 "            FD_SET(fd2, &rd);\n"
6540 "            nfds = max(nfds, fd2);\n"
6541 "        }\n"
6542 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6543 "            FD_SET(fd1, &wr);\n"
6544 "            nfds = max(nfds, fd1);\n"
6545 "        }\n"
6546 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6547 "            FD_SET(fd2, &wr);\n"
6548 "            nfds = max(nfds, fd2);\n"
6549 "        }\n"
6550 "        if (fd1 E<gt> 0) {\n"
6551 "            FD_SET(fd1, &er);\n"
6552 "            nfds = max(nfds, fd1);\n"
6553 "        }\n"
6554 "        if (fd2 E<gt> 0) {\n"
6555 "            FD_SET(fd2, &er);\n"
6556 "            nfds = max(nfds, fd2);\n"
6557 "        }\n"
6558
6559 #. type: Plain text
6560 #: build/C/man2/select_tut.2:693
6561 #, no-wrap
6562 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6563 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6564
6565 #. type: Plain text
6566 #: build/C/man2/select_tut.2:696
6567 #, no-wrap
6568 msgid ""
6569 "        if (r == -1 && errno == EINTR)\n"
6570 "            continue;\n"
6571 msgstr ""
6572 "        if (r == -1 && errno == EINTR)\n"
6573 "            continue;\n"
6574
6575 #. type: Plain text
6576 #: build/C/man2/select_tut.2:701
6577 #, no-wrap
6578 msgid ""
6579 "        if (r == -1) {\n"
6580 "            perror(\"select()\");\n"
6581 "            exit(EXIT_FAILURE);\n"
6582 "        }\n"
6583 msgstr ""
6584 "        if (r == -1) {\n"
6585 "            perror(\"select()\");\n"
6586 "            exit(EXIT_FAILURE);\n"
6587 "        }\n"
6588
6589 #. type: Plain text
6590 #: build/C/man2/select_tut.2:705
6591 #, no-wrap
6592 msgid ""
6593 "        if (FD_ISSET(h, &rd)) {\n"
6594 "            unsigned int l;\n"
6595 "            struct sockaddr_in client_address;\n"
6596 msgstr ""
6597 "        if (FD_ISSET(h, &rd)) {\n"
6598 "            unsigned int l;\n"
6599 "            struct sockaddr_in client_address;\n"
6600
6601 #. type: Plain text
6602 #: build/C/man2/select_tut.2:724
6603 #, no-wrap
6604 msgid ""
6605 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6606 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6607 "            if (r == -1) {\n"
6608 "                perror(\"accept()\");\n"
6609 "            } else {\n"
6610 "                SHUT_FD1;\n"
6611 "                SHUT_FD2;\n"
6612 "                buf1_avail = buf1_written = 0;\n"
6613 "                buf2_avail = buf2_written = 0;\n"
6614 "                fd1 = r;\n"
6615 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6616 "                if (fd2 == -1)\n"
6617 "                    SHUT_FD1;\n"
6618 "                else\n"
6619 "                    printf(\"connect from %s\\en\",\n"
6620 "                            inet_ntoa(client_address.sin_addr));\n"
6621 "            }\n"
6622 "        }\n"
6623 msgstr ""
6624 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6625 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6626 "            if (r == -1) {\n"
6627 "                perror(\"accept()\");\n"
6628 "            } else {\n"
6629 "                SHUT_FD1;\n"
6630 "                SHUT_FD2;\n"
6631 "                buf1_avail = buf1_written = 0;\n"
6632 "                buf2_avail = buf2_written = 0;\n"
6633 "                fd1 = r;\n"
6634 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6635 "                if (fd2 == -1)\n"
6636 "                    SHUT_FD1;\n"
6637 "                else\n"
6638 "                    printf(\"connect from %s\\en\",\n"
6639 "                            inet_ntoa(client_address.sin_addr));\n"
6640 "            }\n"
6641 "        }\n"
6642
6643 #. type: Plain text
6644 #: build/C/man2/select_tut.2:726
6645 #, no-wrap
6646 msgid "        /* NB: read oob data before normal reads */\n"
6647 msgstr "        /* NB: read oob data before normal reads */\n"
6648
6649 #. type: Plain text
6650 #: build/C/man2/select_tut.2:730
6651 #, no-wrap
6652 msgid ""
6653 "        if (fd1 E<gt> 0)\n"
6654 "            if (FD_ISSET(fd1, &er)) {\n"
6655 "                char c;\n"
6656 msgstr ""
6657 "        if (fd1 E<gt> 0)\n"
6658 "            if (FD_ISSET(fd1, &er)) {\n"
6659 "                char c;\n"
6660
6661 #. type: Plain text
6662 #: build/C/man2/select_tut.2:740
6663 #, no-wrap
6664 msgid ""
6665 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6666 "                if (r E<lt> 1)\n"
6667 "                    SHUT_FD1;\n"
6668 "                else\n"
6669 "                    send(fd2, &c, 1, MSG_OOB);\n"
6670 "            }\n"
6671 "        if (fd2 E<gt> 0)\n"
6672 "            if (FD_ISSET(fd2, &er)) {\n"
6673 "                char c;\n"
6674 msgstr ""
6675 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6676 "                if (r E<lt> 1)\n"
6677 "                    SHUT_FD1;\n"
6678 "                else\n"
6679 "                    send(fd2, &c, 1, MSG_OOB);\n"
6680 "            }\n"
6681 "        if (fd2 E<gt> 0)\n"
6682 "            if (FD_ISSET(fd2, &er)) {\n"
6683 "                char c;\n"
6684
6685 #. type: Plain text
6686 #: build/C/man2/select_tut.2:783
6687 #, no-wrap
6688 msgid ""
6689 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6690 "                if (r E<lt> 1)\n"
6691 "                    SHUT_FD2;\n"
6692 "                else\n"
6693 "                    send(fd1, &c, 1, MSG_OOB);\n"
6694 "            }\n"
6695 "        if (fd1 E<gt> 0)\n"
6696 "            if (FD_ISSET(fd1, &rd)) {\n"
6697 "                r = read(fd1, buf1 + buf1_avail,\n"
6698 "                          BUF_SIZE - buf1_avail);\n"
6699 "                if (r E<lt> 1)\n"
6700 "                    SHUT_FD1;\n"
6701 "                else\n"
6702 "                    buf1_avail += r;\n"
6703 "            }\n"
6704 "        if (fd2 E<gt> 0)\n"
6705 "            if (FD_ISSET(fd2, &rd)) {\n"
6706 "                r = read(fd2, buf2 + buf2_avail,\n"
6707 "                          BUF_SIZE - buf2_avail);\n"
6708 "                if (r E<lt> 1)\n"
6709 "                    SHUT_FD2;\n"
6710 "                else\n"
6711 "                    buf2_avail += r;\n"
6712 "            }\n"
6713 "        if (fd1 E<gt> 0)\n"
6714 "            if (FD_ISSET(fd1, &wr)) {\n"
6715 "                r = write(fd1, buf2 + buf2_written,\n"
6716 "                           buf2_avail - buf2_written);\n"
6717 "                if (r E<lt> 1)\n"
6718 "                    SHUT_FD1;\n"
6719 "                else\n"
6720 "                    buf2_written += r;\n"
6721 "            }\n"
6722 "        if (fd2 E<gt> 0)\n"
6723 "            if (FD_ISSET(fd2, &wr)) {\n"
6724 "                r = write(fd2, buf1 + buf1_written,\n"
6725 "                           buf1_avail - buf1_written);\n"
6726 "                if (r E<lt> 1)\n"
6727 "                    SHUT_FD2;\n"
6728 "                else\n"
6729 "                    buf1_written += r;\n"
6730 "            }\n"
6731 msgstr ""
6732 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6733 "                if (r E<lt> 1)\n"
6734 "                    SHUT_FD2;\n"
6735 "                else\n"
6736 "                    send(fd1, &c, 1, MSG_OOB);\n"
6737 "            }\n"
6738 "        if (fd1 E<gt> 0)\n"
6739 "            if (FD_ISSET(fd1, &rd)) {\n"
6740 "                r = read(fd1, buf1 + buf1_avail,\n"
6741 "                          BUF_SIZE - buf1_avail);\n"
6742 "                if (r E<lt> 1)\n"
6743 "                    SHUT_FD1;\n"
6744 "                else\n"
6745 "                    buf1_avail += r;\n"
6746 "            }\n"
6747 "        if (fd2 E<gt> 0)\n"
6748 "            if (FD_ISSET(fd2, &rd)) {\n"
6749 "                r = read(fd2, buf2 + buf2_avail,\n"
6750 "                          BUF_SIZE - buf2_avail);\n"
6751 "                if (r E<lt> 1)\n"
6752 "                    SHUT_FD2;\n"
6753 "                else\n"
6754 "                    buf2_avail += r;\n"
6755 "            }\n"
6756 "        if (fd1 E<gt> 0)\n"
6757 "            if (FD_ISSET(fd1, &wr)) {\n"
6758 "                r = write(fd1, buf2 + buf2_written,\n"
6759 "                           buf2_avail - buf2_written);\n"
6760 "                if (r E<lt> 1)\n"
6761 "                    SHUT_FD1;\n"
6762 "                else\n"
6763 "                    buf2_written += r;\n"
6764 "            }\n"
6765 "        if (fd2 E<gt> 0)\n"
6766 "            if (FD_ISSET(fd2, &wr)) {\n"
6767 "                r = write(fd2, buf1 + buf1_written,\n"
6768 "                           buf1_avail - buf1_written);\n"
6769 "                if (r E<lt> 1)\n"
6770 "                    SHUT_FD2;\n"
6771 "                else\n"
6772 "                    buf1_written += r;\n"
6773 "            }\n"
6774
6775 #. type: Plain text
6776 #: build/C/man2/select_tut.2:785
6777 #, no-wrap
6778 msgid "        /* check if write data has caught read data */\n"
6779 msgstr "        /* check if write data has caught read data */\n"
6780
6781 #. type: Plain text
6782 #: build/C/man2/select_tut.2:790
6783 #, no-wrap
6784 msgid ""
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 msgstr ""
6790 "        if (buf1_written == buf1_avail)\n"
6791 "            buf1_written = buf1_avail = 0;\n"
6792 "        if (buf2_written == buf2_avail)\n"
6793 "            buf2_written = buf2_avail = 0;\n"
6794
6795 #. type: Plain text
6796 #: build/C/man2/select_tut.2:793
6797 #, no-wrap
6798 msgid ""
6799 "        /* one side has closed the connection, keep\n"
6800 "           writing to the other side until empty */\n"
6801 msgstr ""
6802 "        /* one side has closed the connection, keep\n"
6803 "           writing to the other side until empty */\n"
6804
6805 #. type: Plain text
6806 #: build/C/man2/select_tut.2:801
6807 #, no-wrap
6808 msgid ""
6809 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6810 "            SHUT_FD2;\n"
6811 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6812 "            SHUT_FD1;\n"
6813 "    }\n"
6814 "    exit(EXIT_SUCCESS);\n"
6815 "}\n"
6816 msgstr ""
6817 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6818 "            SHUT_FD2;\n"
6819 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6820 "            SHUT_FD1;\n"
6821 "    }\n"
6822 "    exit(EXIT_SUCCESS);\n"
6823 "}\n"
6824
6825 #. type: Plain text
6826 #: build/C/man2/select_tut.2:815
6827 msgid ""
6828 "The above program properly forwards most kinds of TCP connections including "
6829 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6830 "problem of having data flow in both directions simultaneously.  You might "
6831 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6832 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6833 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6834 "because you end up using inefficient timeouts."
6835 msgstr ""
6836 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6837 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6838 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6839 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6840 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6841 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6842 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6843 "起こってしまう。"
6844
6845 #. type: Plain text
6846 #: build/C/man2/select_tut.2:821
6847 msgid ""
6848 "The program does not handle more than one simultaneous connection at a time, "
6849 "although it could easily be extended to do this with a linked list of buffers"
6850 "\\(emone for each connection.  At the moment, new connections cause the "
6851 "current connection to be dropped."
6852 msgstr ""
6853 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6854 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6855 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6856
6857 #.  .SH AUTHORS
6858 #.  This man page was written by Paul Sheer.
6859 #. type: Plain text
6860 #: build/C/man2/select_tut.2:840
6861 msgid ""
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 msgstr ""
6867 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6868 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6869 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6870 "(3), B<epoll>(7)"
6871
6872 #. type: TH
6873 #: build/C/man2/send.2:40
6874 #, no-wrap
6875 msgid "SEND"
6876 msgstr "SEND"
6877
6878 #. type: TH
6879 #: build/C/man2/send.2:40
6880 #, fuzzy, no-wrap
6881 #| msgid "2012-12-14"
6882 msgid "2013-12-12"
6883 msgstr "2012-12-14"
6884
6885 #. type: Plain text
6886 #: build/C/man2/send.2:43
6887 msgid "send, sendto, sendmsg - send a message on a socket"
6888 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6889
6890 #. type: Plain text
6891 #: build/C/man2/send.2:47
6892 #, no-wrap
6893 msgid ""
6894 "B<#include E<lt>sys/types.hE<gt>>\n"
6895 "B<#include E<lt>sys/socket.hE<gt>>\n"
6896 msgstr ""
6897 "B<#include E<lt>sys/types.hE<gt>>\n"
6898 "B<#include E<lt>sys/socket.hE<gt>>\n"
6899
6900 #. type: Plain text
6901 #: build/C/man2/send.2:50
6902 #, no-wrap
6903 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6904 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6905
6906 #. type: Plain text
6907 #: build/C/man2/send.2:54
6908 #, no-wrap
6909 msgid ""
6910 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6911 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6912 msgstr ""
6913 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6914 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6915
6916 #. type: Plain text
6917 #: build/C/man2/send.2:57
6918 #, no-wrap
6919 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6920 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6921
6922 #. type: Plain text
6923 #: build/C/man2/send.2:65
6924 msgid ""
6925 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6926 "transmit a message to another socket."
6927 msgstr ""
6928 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6929 "メッセージを転送するのに使用される。"
6930
6931 #. type: Plain text
6932 #: build/C/man2/send.2:84
6933 msgid ""
6934 "The B<send>()  call may be used only when the socket is in a I<connected> "
6935 "state (so that the intended recipient is known).  The only difference "
6936 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6937 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6938 "following call"
6939 msgstr ""
6940 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6941 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6942 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6943 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6944
6945 #. type: Plain text
6946 #: build/C/man2/send.2:86
6947 #, no-wrap
6948 msgid "    send(sockfd, buf, len, flags);\n"
6949 msgstr "    send(sockfd, buf, len, flags);\n"
6950
6951 #. type: Plain text
6952 #: build/C/man2/send.2:88
6953 msgid "is equivalent to"
6954 msgstr "は以下と等価である。"
6955
6956 #. type: Plain text
6957 #: build/C/man2/send.2:90
6958 #, no-wrap
6959 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6960 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6961
6962 #. type: Plain text
6963 #: build/C/man2/send.2:94
6964 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6965 msgstr ""
6966 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6967 "る。"
6968
6969 #. type: Plain text
6970 #: build/C/man2/send.2:122
6971 msgid ""
6972 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6973 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6974 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6975 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6976 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6977 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6978 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6979 "size."
6980 msgstr ""
6981 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6982 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6983 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6984 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6985 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6986 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6987 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6988 "msg_namelen> で指定される。"
6989
6990 #. type: Plain text
6991 #: build/C/man2/send.2:138
6992 msgid ""
6993 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6994 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6995 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6996 "ancillary data (also known as control information)."
6997 msgstr ""
6998 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6999 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
7000 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
7001 "(制御情報とも呼ばれる) を送信することもできる。"
7002
7003 #. type: Plain text
7004 #: build/C/man2/send.2:143
7005 msgid ""
7006 "If the message is too long to pass atomically through the underlying "
7007 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
7008 "transmitted."
7009 msgstr ""
7010 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
7011 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
7012 "ラーが返され、そのメッセージは転送されない。"
7013
7014 #. type: Plain text
7015 #: build/C/man2/send.2:147
7016 msgid ""
7017 "No indication of failure to deliver is implicit in a B<send>().  Locally "
7018 "detected errors are indicated by a return value of -1."
7019 msgstr ""
7020 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
7021 "出された場合は、返り値 -1 として通知される。"
7022
7023 #. type: Plain text
7024 #: build/C/man2/send.2:160
7025 msgid ""
7026 "When the message does not fit into the send buffer of the socket, B<send>()  "
7027 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
7028 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
7029 "in this case.  The B<select>(2)  call may be used to determine when it is "
7030 "possible to send more data."
7031 msgstr ""
7032 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
7033 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
7034 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
7035 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
7036 "用することができる。"
7037
7038 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
7039 #. type: Plain text
7040 #: build/C/man2/send.2:166
7041 msgid ""
7042 "The I<flags> argument is the bitwise OR of zero or more of the following "
7043 "flags."
7044 msgstr ""
7045 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
7046 "のを指定する。"
7047
7048 #. type: TP
7049 #: build/C/man2/send.2:166
7050 #, fuzzy, no-wrap
7051 #| msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
7052 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
7053 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
7054
7055 #. type: Plain text
7056 #: build/C/man2/send.2:180
7057 msgid ""
7058 "Tell the link layer that forward progress happened: you got a successful "
7059 "reply from the other side.  If the link layer doesn't get this it will "
7060 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
7061 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
7062 "IPv4 and IPv6.  See B<arp>(7)  for details."
7063 msgstr ""
7064 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
7065 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
7066 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
7067 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
7068 "されている。 詳しくは B<arp>(7)  参照のこと。"
7069
7070 #. type: TP
7071 #: build/C/man2/send.2:180
7072 #, no-wrap
7073 msgid "B<MSG_DONTROUTE>"
7074 msgstr "B<MSG_DONTROUTE>"
7075
7076 #. type: Plain text
7077 #: build/C/man2/send.2:188
7078 msgid ""
7079 "Don't use a gateway to send out the packet, send to hosts only on directly "
7080 "connected networks.  This is usually used only by diagnostic or routing "
7081 "programs.  This is defined only for protocol families that route; packet "
7082 "sockets don't."
7083 msgstr ""
7084 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
7085 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
7086 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
7087 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
7088
7089 #. type: Plain text
7090 #: build/C/man2/send.2:199
7091 msgid ""
7092 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
7093 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
7094 "flag with the B<F_SETFL> B<fcntl>(2))."
7095 msgstr ""
7096 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
7097 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
7098 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
7099
7100 #. type: TP
7101 #: build/C/man2/send.2:199
7102 #, no-wrap
7103 msgid "B<MSG_EOR> (since Linux 2.2)"
7104 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7105
7106 #. type: Plain text
7107 #: build/C/man2/send.2:203
7108 msgid ""
7109 "Terminates a record (when this notion is supported, as for sockets of type "
7110 "B<SOCK_SEQPACKET>)."
7111 msgstr ""
7112 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7113 "ケット種別のときに有効)。"
7114
7115 #. type: TP
7116 #: build/C/man2/send.2:203
7117 #, fuzzy, no-wrap
7118 #| msgid "B<MSG_MORE> (Since Linux 2.4.4)"
7119 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7120 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7121
7122 #. type: Plain text
7123 #: build/C/man2/send.2:212
7124 msgid ""
7125 "The caller has more data to send.  This flag is used with TCP sockets to "
7126 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7127 "with the difference that this flag can be set on a per-call basis."
7128 msgstr ""
7129 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7130 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
7131 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
7132 "機能を有効にできる点である。"
7133
7134 #. type: Plain text
7135 #: build/C/man2/send.2:221
7136 msgid ""
7137 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7138 "the kernel to package all of the data sent in calls with this flag set into "
7139 "a single datagram which is transmitted only when a call is performed that "
7140 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
7141 "described in B<udp>(7).)"
7142 msgstr ""
7143 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7144 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7145 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7146 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7147 "ソケットオプション B<UDP_CORK> も参照)。"
7148
7149 #. type: TP
7150 #: build/C/man2/send.2:221
7151 #, no-wrap
7152 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7153 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7154
7155 #. type: Plain text
7156 #: build/C/man2/send.2:230
7157 msgid ""
7158 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7159 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7160 msgstr ""
7161 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7162 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7163
7164 #. type: Plain text
7165 #: build/C/man2/send.2:239
7166 msgid ""
7167 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7168 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7169 "data."
7170 msgstr ""
7171 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7172 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7173 "をサポートしている必要がある。"
7174
7175 #. type: Plain text
7176 #: build/C/man2/send.2:246
7177 msgid ""
7178 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
7179 "below for an exact description of its fields."
7180 msgstr ""
7181 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
7182 "B<recv>(2)  と以下の説明を参照すること。"
7183
7184 #.  Still to be documented:
7185 #.   Send file descriptors and user credentials using the
7186 #.   msg_control* fields.
7187 #.   The flags returned in msg_flags.
7188 #. type: Plain text
7189 #: build/C/man2/send.2:275
7190 msgid ""
7191 "You may send control information using the I<msg_control> and "
7192 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7193 "process is limited per socket by the value in I</proc/sys/net/core/"
7194 "optmem_max>; see B<socket>(7)."
7195 msgstr ""
7196 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
7197 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7198 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
7199
7200 #. type: Plain text
7201 #: build/C/man2/send.2:280
7202 #, fuzzy
7203 #| msgid ""
7204 #| "On success, these calls return the number of characters sent.  On error, "
7205 #| "-1 is returned, and I<errno> is set appropriately."
7206 msgid ""
7207 "On success, these calls return the number of bytes sent.  On error, -1 is "
7208 "returned, and I<errno> is set appropriately."
7209 msgstr ""
7210 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7211 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7212
7213 #. type: Plain text
7214 #: build/C/man2/send.2:285
7215 msgid ""
7216 "These are some standard errors generated by the socket layer.  Additional "
7217 "errors may be generated and returned from the underlying protocol modules; "
7218 "see their respective manual pages."
7219 msgstr ""
7220 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7221 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7222 "れぞれのマニュアルを参照すること。"
7223
7224 #. type: Plain text
7225 #: build/C/man2/send.2:293
7226 msgid ""
7227 "(For UNIX domain sockets, which are identified by pathname)  Write "
7228 "permission is denied on the destination socket file, or search permission is "
7229 "denied for one of the directories the path prefix.  (See B<path_resolution>"
7230 "(7).)"
7231 msgstr ""
7232 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7233 "\n"
7234 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7235 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7236 "(B<path_resolution>(7) も参照のこと)"
7237
7238 #. type: Plain text
7239 #: build/C/man2/send.2:296
7240 msgid ""
7241 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7242 "as though it was a unicast address."
7243 msgstr ""
7244 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7245 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7246
7247 #.  Actually EAGAIN on Linux
7248 #. type: Plain text
7249 #: build/C/man2/send.2:304
7250 msgid ""
7251 "The socket is marked nonblocking and the requested operation would block.  "
7252 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7253 "require these constants to have the same value, so a portable application "
7254 "should check for both possibilities."
7255 msgstr ""
7256 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7257 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7258 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7259 "両方の可能性を 確認すべきである。"
7260
7261 #. type: Plain text
7262 #: build/C/man2/send.2:307
7263 msgid "An invalid descriptor was specified."
7264 msgstr "無効なディスクリプターが指定された。"
7265
7266 #. type: TP
7267 #: build/C/man2/send.2:307
7268 #, no-wrap
7269 msgid "B<ECONNRESET>"
7270 msgstr "B<ECONNRESET>"
7271
7272 #. type: Plain text
7273 #: build/C/man2/send.2:310
7274 msgid "Connection reset by peer."
7275 msgstr "接続が接続相手によりリセットされた。"
7276
7277 #. type: TP
7278 #: build/C/man2/send.2:310
7279 #, no-wrap
7280 msgid "B<EDESTADDRREQ>"
7281 msgstr "B<EDESTADDRREQ>"
7282
7283 #. type: Plain text
7284 #: build/C/man2/send.2:313
7285 msgid "The socket is not connection-mode, and no peer address is set."
7286 msgstr ""
7287 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7288 "ていない。"
7289
7290 #. type: Plain text
7291 #: build/C/man2/send.2:316
7292 msgid "An invalid user space address was specified for an argument."
7293 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7294
7295 #. type: Plain text
7296 #: build/C/man2/send.2:320
7297 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7298 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7299
7300 #. type: Plain text
7301 #: build/C/man2/send.2:329
7302 msgid ""
7303 "The connection-mode socket was connected already but a recipient was "
7304 "specified.  (Now either this error is returned, or the recipient "
7305 "specification is ignored.)"
7306 msgstr ""
7307 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7308 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7309 "いずれかとなる)"
7310
7311 #. type: TP
7312 #: build/C/man2/send.2:329
7313 #, no-wrap
7314 msgid "B<EMSGSIZE>"
7315 msgstr "B<EMSGSIZE>"
7316
7317 #.  (e.g., SOCK_DGRAM )
7318 #. type: Plain text
7319 #: build/C/man2/send.2:335
7320 msgid ""
7321 "The socket type requires that message be sent atomically, and the size of "
7322 "the message to be sent made this impossible."
7323 msgstr ""
7324 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7325 "るが、 メッセージが大き過ぎるため送信することができない。"
7326
7327 #. type: Plain text
7328 #: build/C/man2/send.2:343
7329 msgid ""
7330 "The output queue for a network interface was full.  This generally indicates "
7331 "that the interface has stopped sending, but may be caused by transient "
7332 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7333 "silently dropped when a device queue overflows.)"
7334 msgstr ""
7335 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7336 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7337 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7338 "フローした場合にはパケットは黙って捨てられる)"
7339
7340 #. type: Plain text
7341 #: build/C/man2/send.2:346
7342 msgid "No memory available."
7343 msgstr "メモリが足りない。"
7344
7345 #. type: Plain text
7346 #: build/C/man2/send.2:349
7347 msgid "The socket is not connected, and no target has been given."
7348 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7349
7350 #. type: Plain text
7351 #: build/C/man2/send.2:359
7352 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7353 msgstr ""
7354 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7355 "る。"
7356
7357 #. type: TP
7358 #: build/C/man2/send.2:359
7359 #, no-wrap
7360 msgid "B<EPIPE>"
7361 msgstr "B<EPIPE>"
7362
7363 #. type: Plain text
7364 #: build/C/man2/send.2:368
7365 msgid ""
7366 "The local end has been shut down on a connection oriented socket.  In this "
7367 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7368 "set."
7369 msgstr ""
7370 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7371 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7372
7373 #. type: Plain text
7374 #: build/C/man2/send.2:371
7375 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7376 msgstr ""
7377 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7378
7379 #. type: Plain text
7380 #: build/C/man2/send.2:382
7381 msgid ""
7382 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7383 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7384 "flag is a Linux extension."
7385 msgstr ""
7386 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7387 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7388 "ラグは Linux での拡張である。"
7389
7390 #. type: Plain text
7391 #: build/C/man2/send.2:395
7392 msgid ""
7393 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7394 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7395 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7396 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7397 "and libc5.  See also B<accept>(2)."
7398 msgstr ""
7399 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7400 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7401 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7402 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7403 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7404
7405 #. type: Plain text
7406 #: build/C/man2/send.2:414
7407 msgid ""
7408 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7409 "can be used to transmit multiple datagrams in a single call."
7410 msgstr ""
7411 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7412 "る\n"
7413 "Linux 固有の システムコールに関する情報が書かれている。"
7414
7415 #. type: Plain text
7416 #: build/C/man2/send.2:419
7417 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7418 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7419
7420 #. type: Plain text
7421 #: build/C/man2/send.2:424
7422 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7423 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7424
7425 #. type: Plain text
7426 #: build/C/man2/send.2:439
7427 msgid ""
7428 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7429 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7430 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7431 msgstr ""
7432 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7433 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7434 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7435
7436 #. type: TH
7437 #: build/C/man2/sendmmsg.2:28
7438 #, no-wrap
7439 msgid "SENDMMSG"
7440 msgstr "SENDMMSG"
7441
7442 #. type: TH
7443 #: build/C/man2/sendmmsg.2:28
7444 #, no-wrap
7445 msgid "2012-12-16"
7446 msgstr "2012-12-16"
7447
7448 #. type: Plain text
7449 #: build/C/man2/sendmmsg.2:31
7450 msgid "sendmmsg - send multiple messages on a socket"
7451 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7452
7453 #. type: Plain text
7454 #: build/C/man2/sendmmsg.2:39
7455 #, no-wrap
7456 msgid ""
7457 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7458 "B<             unsigned int >I<flags>B<);>\n"
7459 msgstr ""
7460 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7461 "B<             unsigned int >I<flags>B<);>\n"
7462
7463 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7464 #. type: Plain text
7465 #: build/C/man2/sendmmsg.2:49
7466 msgid ""
7467 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7468 "the caller to transmit multiple messages on a socket using a single system "
7469 "call.  (This has performance benefits for some applications.)"
7470 msgstr ""
7471 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7472 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7473 "ンによっては性能上のメリットがある)。"
7474
7475 #. type: Plain text
7476 #: build/C/man2/sendmmsg.2:54
7477 msgid ""
7478 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7479 "to be transmitted."
7480 msgstr ""
7481 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7482
7483 #. type: Plain text
7484 #: build/C/man2/sendmmsg.2:75
7485 #, no-wrap
7486 msgid ""
7487 "struct mmsghdr {\n"
7488 "    struct msghdr msg_hdr;  /* Message header */\n"
7489 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7490 "};\n"
7491 msgstr ""
7492 "struct mmsghdr {\n"
7493 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7494 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7495 "};\n"
7496
7497 #. type: Plain text
7498 #: build/C/man2/sendmmsg.2:91
7499 msgid ""
7500 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7501 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7502 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7503 "B<sendmsg>(2)  call)."
7504 msgstr ""
7505 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7506 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7507 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7508 "合の返り値と同じである。"
7509
7510 #. type: Plain text
7511 #: build/C/man2/sendmmsg.2:97
7512 msgid ""
7513 "The I<flags> argument contains flags ORed together.  The flags are the same "
7514 "as for B<sendmsg>(2)."
7515 msgstr ""
7516 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7517 "B<sendmsg>(2) と同じである。"
7518
7519 #. type: Plain text
7520 #: build/C/man2/sendmmsg.2:107
7521 msgid ""
7522 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7523 "sent.  A nonblocking call sends as many messages as possible (up to the "
7524 "limit specified by I<vlen>)  and returns immediately."
7525 msgstr ""
7526 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7527 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7528 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7529
7530 #. type: Plain text
7531 #: build/C/man2/sendmmsg.2:119
7532 msgid ""
7533 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7534 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7535 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7536 "of elements of I<msgvec> that have been updated."
7537 msgstr ""
7538 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7539 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7540 "しの返り値は、更新された I<msgvec> の要素数である。"
7541
7542 #. type: Plain text
7543 #: build/C/man2/sendmmsg.2:129
7544 msgid ""
7545 "On success, B<sendmmsg>()  returns the number of messages sent from "
7546 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7547 "B<sendmmsg>()  call to send the remaining messages."
7548 msgstr ""
7549 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7550 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7551 "て残りのメッセージを送信することができる。"
7552
7553 #. type: Plain text
7554 #: build/C/man2/sendmmsg.2:133
7555 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7556 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7557
7558 #
7559 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7560 #.      ... only return an error if no datagrams could be sent.
7561 #.      If less than the requested number of messages were sent, the application
7562 #.      must retry starting at the first failed one and if the problem is
7563 #.      persistent the error will be returned.
7564 #.      This matches the behaviour of other syscalls like read/write - it
7565 #.      is not an error if less than the requested number of elements are sent.
7566 #. type: Plain text
7567 #: build/C/man2/sendmmsg.2:145
7568 msgid ""
7569 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7570 "could be sent."
7571 msgstr ""
7572 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7573 "く送信できなかった場合のみである。"
7574
7575 #. type: Plain text
7576 #: build/C/man2/sendmmsg.2:150
7577 msgid ""
7578 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7579 "added in version 2.14."
7580 msgstr ""
7581 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7582 "バージョン 2.14 で追加された。"
7583
7584 #. type: Plain text
7585 #: build/C/man2/sendmmsg.2:153
7586 msgid "B<sendmmsg>()  is Linux-specific."
7587 msgstr "B<sendmmsg>() は Linux 固有である。"
7588
7589 #
7590 #
7591 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7592 #.      net: Cap number of elements for sendmmsg
7593 #.      To limit the amount of time we can spend in sendmmsg, cap the
7594 #.      number of elements to UIO_MAXIOV (currently 1024).
7595 #.      For error handling an application using sendmmsg needs to retry at
7596 #.      the first unsent message, so capping is simpler and requires less
7597 #.      application logic than returning EINVAL.
7598 #. type: Plain text
7599 #: build/C/man2/sendmmsg.2:168
7600 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7601 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7602
7603 #. type: Plain text
7604 #: build/C/man2/sendmmsg.2:177
7605 msgid ""
7606 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7607 "distinct UDP datagrams using one system call.  The contents of the first "
7608 "datagram originates from a pair of buffers."
7609 msgstr ""
7610 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7611 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7612 "の内容は、二つのバッファから取得される。"
7613
7614 #. type: Plain text
7615 #: build/C/man2/sendmmsg.2:186
7616 #, no-wrap
7617 msgid ""
7618 "#define _GNU_SOURCE\n"
7619 "#include E<lt>netinet/ip.hE<gt>\n"
7620 "#include E<lt>stdio.hE<gt>\n"
7621 "#include E<lt>stdlib.hE<gt>\n"
7622 "#include E<lt>string.hE<gt>\n"
7623 "#include E<lt>sys/types.hE<gt>\n"
7624 "#include E<lt>sys/socket.hE<gt>\n"
7625 msgstr ""
7626 "#define _GNU_SOURCE\n"
7627 "#include E<lt>netinet/ip.hE<gt>\n"
7628 "#include E<lt>stdio.hE<gt>\n"
7629 "#include E<lt>stdlib.hE<gt>\n"
7630 "#include E<lt>string.hE<gt>\n"
7631 "#include E<lt>sys/types.hE<gt>\n"
7632 "#include E<lt>sys/socket.hE<gt>\n"
7633
7634 #. type: Plain text
7635 #: build/C/man2/sendmmsg.2:195
7636 #, no-wrap
7637 msgid ""
7638 "int\n"
7639 "main(void)\n"
7640 "{\n"
7641 "    int sockfd;\n"
7642 "    struct sockaddr_in sa;\n"
7643 "    struct mmsghdr msg[2];\n"
7644 "    struct iovec msg1[2], msg2;\n"
7645 "    int retval;\n"
7646 msgstr ""
7647 "int\n"
7648 "main(void)\n"
7649 "{\n"
7650 "    int sockfd;\n"
7651 "    struct sockaddr_in sa;\n"
7652 "    struct mmsghdr msg[2];\n"
7653 "    struct iovec msg1[2], msg2;\n"
7654 "    int retval;\n"
7655
7656 #. type: Plain text
7657 #: build/C/man2/sendmmsg.2:209
7658 #, no-wrap
7659 msgid ""
7660 "    sa.sin_family = AF_INET;\n"
7661 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7662 "    sa.sin_port = htons(1234);\n"
7663 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7664 "        perror(\"connect()\");\n"
7665 "        exit(EXIT_FAILURE);\n"
7666 "    }\n"
7667 msgstr ""
7668 "    sa.sin_family = AF_INET;\n"
7669 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7670 "    sa.sin_port = htons(1234);\n"
7671 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7672 "        perror(\"connect()\");\n"
7673 "        exit(EXIT_FAILURE);\n"
7674 "    }\n"
7675
7676 #. type: Plain text
7677 #: build/C/man2/sendmmsg.2:215
7678 #, no-wrap
7679 msgid ""
7680 "    memset(msg1, 0, sizeof(msg1));\n"
7681 "    msg1[0].iov_base = \"one\";\n"
7682 "    msg1[0].iov_len = 3;\n"
7683 "    msg1[1].iov_base = \"two\";\n"
7684 "    msg1[1].iov_len = 3;\n"
7685 msgstr ""
7686 "    memset(msg1, 0, sizeof(msg1));\n"
7687 "    msg1[0].iov_base = \"one\";\n"
7688 "    msg1[0].iov_len = 3;\n"
7689 "    msg1[1].iov_base = \"two\";\n"
7690 "    msg1[1].iov_len = 3;\n"
7691
7692 #. type: Plain text
7693 #: build/C/man2/sendmmsg.2:219
7694 #, no-wrap
7695 msgid ""
7696 "    memset(&msg2, 0, sizeof(msg2));\n"
7697 "    msg2.iov_base = \"three\";\n"
7698 "    msg2.iov_len = 5;\n"
7699 msgstr ""
7700 "    memset(&msg2, 0, sizeof(msg2));\n"
7701 "    msg2.iov_base = \"three\";\n"
7702 "    msg2.iov_len = 5;\n"
7703
7704 #. type: Plain text
7705 #: build/C/man2/sendmmsg.2:223
7706 #, no-wrap
7707 msgid ""
7708 "    memset(msg, 0, sizeof(msg));\n"
7709 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7710 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7711 msgstr ""
7712 "    memset(msg, 0, sizeof(msg));\n"
7713 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7714 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7715
7716 #. type: Plain text
7717 #: build/C/man2/sendmmsg.2:226
7718 #, no-wrap
7719 msgid ""
7720 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7721 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7722 msgstr ""
7723 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7724 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7725
7726 #. type: Plain text
7727 #: build/C/man2/sendmmsg.2:232
7728 #, no-wrap
7729 msgid ""
7730 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7731 "    if (retval == -1)\n"
7732 "        perror(\"sendmmsg()\");\n"
7733 "    else\n"
7734 "        printf(\"%d messages sent\\en\", retval);\n"
7735 msgstr ""
7736 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7737 "    if (retval == -1)\n"
7738 "        perror(\"sendmmsg()\");\n"
7739 "    else\n"
7740 "        printf(\"%d messages sent\\en\", retval);\n"
7741
7742 #. type: Plain text
7743 #: build/C/man2/sendmmsg.2:235
7744 #, no-wrap
7745 msgid ""
7746 "    exit(0);\n"
7747 "}\n"
7748 msgstr ""
7749 "    exit(0);\n"
7750 "}\n"
7751
7752 #. type: Plain text
7753 #: build/C/man2/sendmmsg.2:241
7754 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7755 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7756
7757 #. type: TH
7758 #: build/C/man3/sockatmark.3:25
7759 #, no-wrap
7760 msgid "SOCKATMARK"
7761 msgstr "SOCKATMARK"
7762
7763 #. type: TH
7764 #: build/C/man3/sockatmark.3:25
7765 #, fuzzy, no-wrap
7766 #| msgid "2007-12-28"
7767 msgid "2014-02-28"
7768 msgstr "2007-12-28"
7769
7770 #. type: Plain text
7771 #: build/C/man3/sockatmark.3:28
7772 msgid "sockatmark - determine whether socket is at out-of-band mark"
7773 msgstr ""
7774 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7775 "べる"
7776
7777 #. type: Plain text
7778 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7779 #: build/C/man7/socket.7:61 build/C/man2/socketpair.2:49
7780 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7781 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7782
7783 #. type: Plain text
7784 #: build/C/man3/sockatmark.3:32
7785 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7786 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7787
7788 #. type: Plain text
7789 #: build/C/man3/sockatmark.3:41
7790 msgid ""
7791 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7792 "\\ 600"
7793 msgstr ""
7794 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7795 "\\ 600"
7796
7797 #. type: Plain text
7798 #: build/C/man3/sockatmark.3:51
7799 msgid ""
7800 "B<sockatmark>()  returns a value indicating whether or not the socket "
7801 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7802 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7803 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7804 msgstr ""
7805 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7806 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7807 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7808 "この関数は帯域外マークを削除しない。"
7809
7810 #. type: Plain text
7811 #: build/C/man3/sockatmark.3:58
7812 msgid ""
7813 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7814 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7815 "set to indicate the error."
7816 msgstr ""
7817 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7818 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7819 "れ、エラーを表す I<errno> が設定される。"
7820
7821 #. type: Plain text
7822 #: build/C/man3/sockatmark.3:63
7823 msgid "I<sockfd> is not a valid file descriptor."
7824 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7825
7826 #.  POSIX.1 says ENOTTY for this case
7827 #. type: Plain text
7828 #: build/C/man3/sockatmark.3:70
7829 msgid ""
7830 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7831 msgstr ""
7832 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7833
7834 #. type: Plain text
7835 #: build/C/man3/sockatmark.3:73
7836 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7837 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7838
7839 #. type: Plain text
7840 #: build/C/man3/sockatmark.3:78
7841 msgid "The B<sockatmark>()  function is thread-safe."
7842 msgstr ""
7843
7844 #. type: Plain text
7845 #: build/C/man3/sockatmark.3:80
7846 msgid "POSIX.1-2001."
7847 msgstr "POSIX.1-2001."
7848
7849 #. type: Plain text
7850 #: build/C/man3/sockatmark.3:87
7851 msgid ""
7852 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7853 "the B<MSG_OOB> flag of B<recv>(2)."
7854 msgstr ""
7855 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7856 "B<recv>(2)  で読み込むことができる。"
7857
7858 #. type: Plain text
7859 #: build/C/man3/sockatmark.3:89
7860 msgid "Out-of-band data is supported only on some stream socket protocols."
7861 msgstr ""
7862 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7863 "ない。"
7864
7865 #. type: Plain text
7866 #: build/C/man3/sockatmark.3:94
7867 msgid ""
7868 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7869 "signal."
7870 msgstr ""
7871 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7872 "る。"
7873
7874 #. type: Plain text
7875 #: build/C/man3/sockatmark.3:100
7876 msgid ""
7877 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7878 "operation."
7879 msgstr ""
7880 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7881
7882 #. type: Plain text
7883 #: build/C/man3/sockatmark.3:104
7884 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7885 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7886
7887 #. type: Plain text
7888 #: build/C/man3/sockatmark.3:109
7889 msgid ""
7890 "The following code can be used after receipt of a B<SIGURG> signal to read "
7891 "(and discard) all data up to the mark, and then read the byte of data at the "
7892 "mark:"
7893 msgstr ""
7894 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7895 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7896
7897 #. type: Plain text
7898 #: build/C/man3/sockatmark.3:114
7899 #, no-wrap
7900 msgid ""
7901 "    char buf[BUF_LEN];\n"
7902 "    char oobdata;\n"
7903 "    int atmark, s;\n"
7904 msgstr ""
7905 "    char buf[BUF_LEN];\n"
7906 "    char oobdata;\n"
7907 "    int atmark, s;\n"
7908
7909 #. type: Plain text
7910 #: build/C/man3/sockatmark.3:121
7911 #, no-wrap
7912 msgid ""
7913 "    for (;;) {\n"
7914 "        atmark = sockatmark(sockfd);\n"
7915 "        if (atmark == -1) {\n"
7916 "            perror(\"sockatmark\");\n"
7917 "            break;\n"
7918 "        }\n"
7919 msgstr ""
7920 "    for (;;) {\n"
7921 "        atmark = sockatmark(sockfd);\n"
7922 "        if (atmark == -1) {\n"
7923 "            perror(\"sockatmark\");\n"
7924 "            break;\n"
7925 "        }\n"
7926
7927 #. type: Plain text
7928 #: build/C/man3/sockatmark.3:124
7929 #, no-wrap
7930 msgid ""
7931 "        if (atmark)\n"
7932 "            break;\n"
7933 msgstr ""
7934 "        if (atmark)\n"
7935 "            break;\n"
7936
7937 #. type: Plain text
7938 #: build/C/man3/sockatmark.3:131
7939 #, no-wrap
7940 msgid ""
7941 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7942 "        if (s == -1)\n"
7943 "            perror(\"read\");\n"
7944 "        if (s E<lt>= 0)\n"
7945 "            break;\n"
7946 "    }\n"
7947 msgstr ""
7948 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7949 "        if (s == -1)\n"
7950 "            perror(\"read\");\n"
7951 "        if (s E<lt>= 0)\n"
7952 "            break;\n"
7953 "    }\n"
7954
7955 #. type: Plain text
7956 #: build/C/man3/sockatmark.3:138
7957 #, no-wrap
7958 msgid ""
7959 "    if (atmark == 1) {\n"
7960 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7961 "            perror(\"recv\");\n"
7962 "            ...\n"
7963 "        }\n"
7964 "    }\n"
7965 msgstr ""
7966 "    if (atmark == 1) {\n"
7967 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7968 "            perror(\"recv\");\n"
7969 "            ...\n"
7970 "        }\n"
7971 "    }\n"
7972
7973 #. type: Plain text
7974 #: build/C/man3/sockatmark.3:144
7975 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7976 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7977
7978 #. type: TH
7979 #: build/C/man2/socket.2:43 build/C/man7/socket.7:56
7980 #, no-wrap
7981 msgid "SOCKET"
7982 msgstr "SOCKET"
7983
7984 #. type: TH
7985 #: build/C/man2/socket.2:43
7986 #, fuzzy, no-wrap
7987 #| msgid "2012-12-14"
7988 msgid "2013-12-31"
7989 msgstr "2012-12-14"
7990
7991 #. type: Plain text
7992 #: build/C/man2/socket.2:46
7993 msgid "socket - create an endpoint for communication"
7994 msgstr "socket - 通信のための端点(endpoint)を作成する"
7995
7996 #. type: Plain text
7997 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7998 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7999 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
8000
8001 #. type: Plain text
8002 #: build/C/man2/socket.2:52
8003 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8004 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8005
8006 #. type: Plain text
8007 #: build/C/man2/socket.2:55
8008 msgid ""
8009 "B<socket>()  creates an endpoint for communication and returns a descriptor."
8010 msgstr ""
8011 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
8012 "(descriptor)を返す。"
8013
8014 #. type: Plain text
8015 #: build/C/man2/socket.2:63
8016 msgid ""
8017 "The I<domain> argument specifies a communication domain; this selects the "
8018 "protocol family which will be used for communication.  These families are "
8019 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
8020 "include:"
8021 msgstr ""
8022 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
8023 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
8024 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
8025 "下の通り。"
8026
8027 #. type: tbl table
8028 #: build/C/man2/socket.2:66
8029 #, no-wrap
8030 msgid "Name:Purpose:Man page\n"
8031 msgstr "名前:目的:マニュアル\n"
8032
8033 #. type: tbl table
8034 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
8035 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
8036 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
8037 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8038 #, no-wrap
8039 msgid "T{\n"
8040 msgstr "T{\n"
8041
8042 #. type: tbl table
8043 #: build/C/man2/socket.2:68
8044 #, no-wrap
8045 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8046 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8047
8048 #. type: tbl table
8049 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8050 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8051 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8052 #: build/C/man7/socket.7:192
8053 #, no-wrap
8054 msgid "T}:T{\n"
8055 msgstr "T}:T{\n"
8056
8057 #. type: tbl table
8058 #: build/C/man2/socket.2:70
8059 #, no-wrap
8060 msgid "Local communication\n"
8061 msgstr "ローカル通信\n"
8062
8063 #. type: tbl table
8064 #: build/C/man2/socket.2:72
8065 #, no-wrap
8066 msgid "B<unix>(7)\n"
8067 msgstr "B<unix>(7)\n"
8068
8069 #. type: tbl table
8070 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8071 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8072 #: build/C/man2/socket.2:118 build/C/man7/socket.7:171
8073 #: build/C/man7/socket.7:175 build/C/man7/socket.7:178
8074 #: build/C/man7/socket.7:184 build/C/man7/socket.7:187
8075 #: build/C/man7/socket.7:196 build/C/man7/socket.7:203
8076 #, no-wrap
8077 msgid "T}\n"
8078 msgstr "T}\n"
8079
8080 #. type: tbl table
8081 #: build/C/man2/socket.2:75
8082 #, no-wrap
8083 msgid "B<AF_INET>\n"
8084 msgstr "B<AF_INET>\n"
8085
8086 #. type: tbl table
8087 #: build/C/man2/socket.2:76
8088 #, no-wrap
8089 msgid "T}:IPv4 Internet protocols:T{\n"
8090 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
8091
8092 #. type: tbl table
8093 #: build/C/man2/socket.2:77
8094 #, no-wrap
8095 msgid "B<ip>(7)\n"
8096 msgstr "B<ip>(7)\n"
8097
8098 #. type: tbl table
8099 #: build/C/man2/socket.2:80
8100 #, no-wrap
8101 msgid "B<AF_INET6>\n"
8102 msgstr "B<AF_INET6>\n"
8103
8104 #. type: tbl table
8105 #: build/C/man2/socket.2:81
8106 #, no-wrap
8107 msgid "T}:IPv6 Internet protocols:T{\n"
8108 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
8109
8110 #. type: tbl table
8111 #: build/C/man2/socket.2:82
8112 #, no-wrap
8113 msgid "B<ipv6>(7)\n"
8114 msgstr "B<ipv6>(7)\n"
8115
8116 #. type: tbl table
8117 #: build/C/man2/socket.2:85
8118 #, no-wrap
8119 msgid "B<AF_IPX>\n"
8120 msgstr "B<AF_IPX>\n"
8121
8122 #. type: tbl table
8123 #: build/C/man2/socket.2:86
8124 #, no-wrap
8125 msgid "T}:IPX - Novell protocols:\n"
8126 msgstr "T}:IPX - Novell プロトコル:\n"
8127
8128 #. type: tbl table
8129 #: build/C/man2/socket.2:88
8130 #, no-wrap
8131 msgid "B<AF_NETLINK>\n"
8132 msgstr "B<AF_NETLINK>\n"
8133
8134 #. type: tbl table
8135 #: build/C/man2/socket.2:90
8136 #, no-wrap
8137 msgid "Kernel user interface device\n"
8138 msgstr "カーネル・ユーザ・デバイス\n"
8139
8140 #. type: tbl table
8141 #: build/C/man2/socket.2:92
8142 #, no-wrap
8143 msgid "B<netlink>(7)\n"
8144 msgstr "B<netlink>(7)\n"
8145
8146 #. type: tbl table
8147 #: build/C/man2/socket.2:95
8148 #, no-wrap
8149 msgid "B<AF_X25>\n"
8150 msgstr "B<AF_X25>\n"
8151
8152 #. type: tbl table
8153 #: build/C/man2/socket.2:96
8154 #, no-wrap
8155 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8156 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8157
8158 #. type: tbl table
8159 #: build/C/man2/socket.2:97
8160 #, no-wrap
8161 msgid "B<x25>(7)\n"
8162 msgstr "B<x25>(7)\n"
8163
8164 #. type: tbl table
8165 #: build/C/man2/socket.2:100
8166 #, no-wrap
8167 msgid "B<AF_AX25>\n"
8168 msgstr "B<AF_AX25>\n"
8169
8170 #. type: tbl table
8171 #: build/C/man2/socket.2:102
8172 #, no-wrap
8173 msgid "Amateur radio AX.25 protocol\n"
8174 msgstr "アマチュア無線 AX.25 プロトコル\n"
8175
8176 #. type: tbl table
8177 #: build/C/man2/socket.2:103
8178 #, no-wrap
8179 msgid "T}:\n"
8180 msgstr "T}:\n"
8181
8182 #. type: tbl table
8183 #: build/C/man2/socket.2:105
8184 #, no-wrap
8185 msgid "B<AF_ATMPVC>\n"
8186 msgstr "B<AF_ATMPVC>\n"
8187
8188 #. type: tbl table
8189 #: build/C/man2/socket.2:106
8190 #, no-wrap
8191 msgid "T}:Access to raw ATM PVCs:\n"
8192 msgstr "T}:生の ATM PVC にアクセスする:\n"
8193
8194 #. type: tbl table
8195 #: build/C/man2/socket.2:108
8196 #, no-wrap
8197 msgid "B<AF_APPLETALK>\n"
8198 msgstr "B<AF_APPLETALK>\n"
8199
8200 #. type: tbl table
8201 #: build/C/man2/socket.2:109
8202 #, no-wrap
8203 msgid "T}:Appletalk:T{\n"
8204 msgstr "T}:アップルトーク:T{\n"
8205
8206 #. type: tbl table
8207 #: build/C/man2/socket.2:110
8208 #, no-wrap
8209 msgid "B<ddp>(7)\n"
8210 msgstr "B<ddp>(7)\n"
8211
8212 #. type: tbl table
8213 #: build/C/man2/socket.2:113
8214 #, no-wrap
8215 msgid "B<AF_PACKET>\n"
8216 msgstr "B<AF_PACKET>\n"
8217
8218 #. type: tbl table
8219 #: build/C/man2/socket.2:115
8220 #, no-wrap
8221 msgid "Low level packet interface\n"
8222 msgstr "低レベルのパケットインターフェース\n"
8223
8224 #. type: tbl table
8225 #: build/C/man2/socket.2:117
8226 #, no-wrap
8227 msgid "B<packet>(7)\n"
8228 msgstr "B<packet>(7)\n"
8229
8230 #. type: Plain text
8231 #: build/C/man2/socket.2:126
8232 msgid ""
8233 "The socket has the indicated I<type>, which specifies the communication "
8234 "semantics.  Currently defined types are:"
8235 msgstr ""
8236 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8237 "る。 定義されている型は現在以下の通り。"
8238
8239 #. type: TP
8240 #: build/C/man2/socket.2:126
8241 #, no-wrap
8242 msgid "B<SOCK_STREAM>"
8243 msgstr "B<SOCK_STREAM>"
8244
8245 #. type: Plain text
8246 #: build/C/man2/socket.2:130
8247 msgid ""
8248 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8249 "out-of-band data transmission mechanism may be supported."
8250 msgstr ""
8251 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8252 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8253
8254 #. type: TP
8255 #: build/C/man2/socket.2:130
8256 #, no-wrap
8257 msgid "B<SOCK_DGRAM>"
8258 msgstr "B<SOCK_DGRAM>"
8259
8260 #. type: Plain text
8261 #: build/C/man2/socket.2:134
8262 msgid ""
8263 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8264 "length)."
8265 msgstr ""
8266 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8267 "する。"
8268
8269 #. type: TP
8270 #: build/C/man2/socket.2:134
8271 #, no-wrap
8272 msgid "B<SOCK_SEQPACKET>"
8273 msgstr "B<SOCK_SEQPACKET>"
8274
8275 #. type: Plain text
8276 #: build/C/man2/socket.2:139
8277 msgid ""
8278 "Provides a sequenced, reliable, two-way connection-based data transmission "
8279 "path for datagrams of fixed maximum length; a consumer is required to read "
8280 "an entire packet with each input system call."
8281 msgstr ""
8282 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8283 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8284 "ト全体を読み取ることが要求される。"
8285
8286 #. type: TP
8287 #: build/C/man2/socket.2:139
8288 #, no-wrap
8289 msgid "B<SOCK_RAW>"
8290 msgstr "B<SOCK_RAW>"
8291
8292 #. type: Plain text
8293 #: build/C/man2/socket.2:142
8294 msgid "Provides raw network protocol access."
8295 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8296
8297 #. type: TP
8298 #: build/C/man2/socket.2:142
8299 #, no-wrap
8300 msgid "B<SOCK_RDM>"
8301 msgstr "B<SOCK_RDM>"
8302
8303 #. type: Plain text
8304 #: build/C/man2/socket.2:145
8305 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8306 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8307
8308 #. type: TP
8309 #: build/C/man2/socket.2:145
8310 #, no-wrap
8311 msgid "B<SOCK_PACKET>"
8312 msgstr "B<SOCK_PACKET>"
8313
8314 #. type: Plain text
8315 #: build/C/man2/socket.2:150
8316 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8317 msgstr ""
8318 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8319 "こと"
8320
8321 #. type: Plain text
8322 #: build/C/man2/socket.2:152
8323 #, fuzzy
8324 #| msgid ""
8325 #| "Some socket types may not be implemented by all protocol families; for "
8326 #| "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
8327 msgid "Some socket types may not be implemented by all protocol families."
8328 msgstr ""
8329 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
8330 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
8331
8332 #. type: Plain text
8333 #: build/C/man2/socket.2:160
8334 msgid ""
8335 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8336 "addition to specifying a socket type, it may include the bitwise OR of any "
8337 "of the following values, to modify the behavior of B<socket>():"
8338 msgstr ""
8339 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8340 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8341 "ることで、 B<socket>()  の振舞いを変更することができる。"
8342
8343 #. type: Plain text
8344 #: build/C/man2/socket.2:194
8345 msgid ""
8346 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8347 "Normally only a single protocol exists to support a particular socket type "
8348 "within a given protocol family, in which case I<protocol> can be specified "
8349 "as 0.  However, it is possible that many protocols may exist, in which case "
8350 "a particular protocol must be specified in this manner.  The protocol number "
8351 "to use is specific to the ``communication domain'' in which communication is "
8352 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8353 "protocol name strings to protocol numbers."
8354 msgstr ""
8355 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8356 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8357 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8358 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8359 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8360 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8361 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8362
8363 #. type: Plain text
8364 #: build/C/man2/socket.2:224
8365 msgid ""
8366 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8367 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
8368 "a I<connected> state before any data may be sent or received on it.  A "
8369 "connection to another socket is created with a B<connect>(2)  call.  Once "
8370 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
8371 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
8372 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
8373 "also be transmitted as described in B<send>(2)  and received as described in "
8374 "B<recv>(2)."
8375 msgstr ""
8376 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8377 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8378 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8379 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
8380 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
8381 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
8382 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
8383
8384 #. type: Plain text
8385 #: build/C/man2/socket.2:250
8386 msgid ""
8387 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8388 "data is not lost or duplicated.  If a piece of data for which the peer "
8389 "protocol has buffer space cannot be successfully transmitted within a "
8390 "reasonable length of time, then the connection is considered to be dead.  "
8391 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8392 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8393 "signal is raised if a process sends or receives on a broken stream; this "
8394 "causes naive processes, which do not handle the signal, to exit.  "
8395 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8396 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8397 "amount of data requested, and any data remaining in the arriving packet will "
8398 "be discarded.  Also all message boundaries in incoming datagrams are "
8399 "preserved."
8400 msgstr ""
8401 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8402 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8403 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8404 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8405 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8406 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8407 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8408 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8409 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8410 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8411
8412 #. type: Plain text
8413 #: build/C/man2/socket.2:260
8414 msgid ""
8415 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8416 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8417 "received with B<recvfrom>(2), which returns the next datagram along with the "
8418 "address of its sender."
8419 msgstr ""
8420 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8421 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8422 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8423 "す。"
8424
8425 #. type: Plain text
8426 #: build/C/man2/socket.2:267
8427 msgid ""
8428 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8429 "from the device driver.  Use B<packet>(7)  instead."
8430 msgstr ""
8431 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8432 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8433
8434 #. type: Plain text
8435 #: build/C/man2/socket.2:290
8436 msgid ""
8437 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8438 "process group to receive a B<SIGURG> signal when the out-of-band data "
8439 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8440 "unexpectedly.  This operation may also be used to set the process or process "
8441 "group that receives the I/O and asynchronous notification of I/O events via "
8442 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8443 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8444 msgstr ""
8445 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8446 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8447 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8448 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8449 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8450 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8451 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8452
8453 #. type: Plain text
8454 #: build/C/man2/socket.2:300
8455 msgid ""
8456 "When the network signals an error condition to the protocol module (e.g., "
8457 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8458 "The next operation on this socket will return the error code of the pending "
8459 "error.  For some protocols it is possible to enable a per-socket error queue "
8460 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8461 "(7)."
8462 msgstr ""
8463 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8464 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8465 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8466 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8467 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8468 "B<IP_RECVERR> を参照すること。"
8469
8470 #. type: Plain text
8471 #: build/C/man2/socket.2:310
8472 msgid ""
8473 "The operation of sockets is controlled by socket level I<options>.  These "
8474 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8475 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8476 "respectively."
8477 msgstr ""
8478 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8479 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8480 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8481
8482 #. type: Plain text
8483 #: build/C/man2/socket.2:315
8484 msgid ""
8485 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8486 "is returned, and I<errno> is set appropriately."
8487 msgstr ""
8488 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8489 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8490
8491 #. type: Plain text
8492 #: build/C/man2/socket.2:320
8493 msgid ""
8494 "Permission to create a socket of the specified type and/or protocol is "
8495 "denied."
8496 msgstr ""
8497 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8498
8499 #. type: Plain text
8500 #: build/C/man2/socket.2:323
8501 msgid "The implementation does not support the specified address family."
8502 msgstr "指定されたアドレスファミリーがサポートされていない。"
8503
8504 #. type: Plain text
8505 #: build/C/man2/socket.2:326
8506 msgid "Unknown protocol, or protocol family not available."
8507 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8508
8509 #.  Since Linux 2.6.27
8510 #. type: Plain text
8511 #: build/C/man2/socket.2:331
8512 msgid "Invalid flags in I<type>."
8513 msgstr "I<type> に無効なフラグが指定されている。"
8514
8515 #. type: Plain text
8516 #: build/C/man2/socket.2:334
8517 msgid "Process file table overflow."
8518 msgstr "プロセスのファイルテーブルが溢れている。"
8519
8520 #. type: TP
8521 #: build/C/man2/socket.2:337
8522 #, no-wrap
8523 msgid "B<ENOBUFS> or B<ENOMEM>"
8524 msgstr "B<ENOBUFS> または B<ENOMEM>"
8525
8526 #. type: Plain text
8527 #: build/C/man2/socket.2:342
8528 msgid ""
8529 "Insufficient memory is available.  The socket cannot be created until "
8530 "sufficient resources are freed."
8531 msgstr ""
8532 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8533 "ない。"
8534
8535 #. type: TP
8536 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8537 #, no-wrap
8538 msgid "B<EPROTONOSUPPORT>"
8539 msgstr "B<EPROTONOSUPPORT>"
8540
8541 #. type: Plain text
8542 #: build/C/man2/socket.2:346
8543 msgid ""
8544 "The protocol type or the specified protocol is not supported within this "
8545 "domain."
8546 msgstr ""
8547 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8548 "いない。"
8549
8550 #. type: Plain text
8551 #: build/C/man2/socket.2:348
8552 msgid "Other errors may be generated by the underlying protocol modules."
8553 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8554
8555 #. type: Plain text
8556 #: build/C/man2/socket.2:350
8557 msgid "4.4BSD, POSIX.1-2001."
8558 msgstr "4.4BSD, POSIX.1-2001."
8559
8560 #. type: Plain text
8561 #: build/C/man2/socket.2:356
8562 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8563 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8564
8565 #. type: Plain text
8566 #: build/C/man2/socket.2:362
8567 msgid ""
8568 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8569 "systems supporting clones of the BSD socket layer (including System V "
8570 "variants)."
8571 msgstr ""
8572 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8573 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8574 "外のシステムからの移植ができる。"
8575
8576 #. type: Plain text
8577 #: build/C/man2/socket.2:381
8578 msgid ""
8579 "The manifest constants used under 4.x BSD for protocol families are "
8580 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8581 "are used for address families.  However, already the BSD man page promises: "
8582 "\"The protocol family generally is the same as the address family\", and "
8583 "subsequent standards use AF_* everywhere."
8584 msgstr ""
8585 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8586 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8587 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8588 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8589 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8590 "それ以外の規格では全ての場所で AF_* が使用されている。"
8591
8592 #. type: Plain text
8593 #: build/C/man2/socket.2:386
8594 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8595 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8596
8597 #. type: Plain text
8598 #: build/C/man2/socket.2:409
8599 msgid ""
8600 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8601 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8602 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8603 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8604 "(7), B<unix>(7)"
8605 msgstr ""
8606 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8607 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8608 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8609 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8610 "(7), B<unix>(7)"
8611
8612 #. type: Plain text
8613 #: build/C/man2/socket.2:415
8614 msgid ""
8615 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8616 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8617 "Programmer's Supplementary Documents Volume 1.>"
8618 msgstr ""
8619 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8620 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8621 "Supplementary Documents Volume 1.> として再版された)"
8622
8623 #. type: TH
8624 #: build/C/man7/socket.7:56
8625 #, no-wrap
8626 msgid "2014-02-21"
8627 msgstr ""
8628
8629 #. type: Plain text
8630 #: build/C/man7/socket.7:59
8631 msgid "socket - Linux socket interface"
8632 msgstr "socket - Linux のソケットインターフェース"
8633
8634 #. type: Plain text
8635 #: build/C/man7/socket.7:63
8636 msgid ""
8637 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8638 ">I<protocol>B<);>"
8639 msgstr ""
8640 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8641 ">I<protocol>B<);>"
8642
8643 #. type: Plain text
8644 #: build/C/man7/socket.7:82
8645 #, fuzzy
8646 #| msgid ""
8647 #| "This manual page describes the Linux networking socket layer user "
8648 #| "interface.  The BSD compatible sockets are the uniform interface between "
8649 #| "the user process and the network protocol stacks in the kernel.  The "
8650 #| "protocol modules are grouped into I<protocol families> like B<AF_INET>, "
8651 #| "B<AF_IPX>, B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or "
8652 #| "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and "
8653 #| "types."
8654 msgid ""
8655 "This manual page describes the Linux networking socket layer user "
8656 "interface.  The BSD compatible sockets are the uniform interface between the "
8657 "user process and the network protocol stacks in the kernel.  The protocol "
8658 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8659 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8660 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8661 msgstr ""
8662 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8663 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8664 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8665 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8666 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8667 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8668 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8669
8670 #. type: SS
8671 #: build/C/man7/socket.7:82
8672 #, no-wrap
8673 msgid "Socket-layer functions"
8674 msgstr "ソケット層の関数群"
8675
8676 #. type: Plain text
8677 #: build/C/man7/socket.7:86
8678 msgid ""
8679 "These functions are used by the user process to send or receive packets and "
8680 "to do other socket operations.  For more information see their respective "
8681 "manual pages."
8682 msgstr ""
8683 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8684 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8685
8686 #. type: Plain text
8687 #: build/C/man7/socket.7:102
8688 msgid ""
8689 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8690 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8691 "address, B<listen>(2)  tells the socket that new connections shall be "
8692 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8693 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8694 "(implemented only for a few local families like B<AF_UNIX>)"
8695 msgstr ""
8696 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8697 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8698 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8699 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8700 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8701 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8702 "リーでしか実装されていない)。"
8703
8704 #. type: Plain text
8705 #: build/C/man7/socket.7:124
8706 msgid ""
8707 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8708 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8709 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8710 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8711 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8712 "write data."
8713 msgstr ""
8714 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8715 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8716 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8717 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8718 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8719 "ことができる。"
8720
8721 #. type: Plain text
8722 #: build/C/man7/socket.7:135
8723 msgid ""
8724 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8725 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8726 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8727 "be used to set or read some other options."
8728 msgstr ""
8729 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8730 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8731 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8732 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8733
8734 #. type: Plain text
8735 #: build/C/man7/socket.7:140
8736 msgid ""
8737 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8738 "full-duplex socket connection."
8739 msgstr ""
8740 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8741 "続を部分的にクローズする。"
8742
8743 #. type: Plain text
8744 #: build/C/man7/socket.7:146
8745 msgid ""
8746 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8747 "not supported on sockets."
8748 msgstr ""
8749 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8750 "ではサポートされていない。"
8751
8752 #. type: Plain text
8753 #: build/C/man7/socket.7:163
8754 msgid ""
8755 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8756 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8757 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8758 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8759 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8760 msgstr ""
8761 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8762 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8763 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8764 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8765 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8766 "B<select>(2)  を使って待つことができる。"
8767
8768 #. type: tbl table
8769 #: build/C/man7/socket.7:167
8770 #, no-wrap
8771 msgid "I/O events\n"
8772 msgstr "I/O イベント\n"
8773
8774 #. type: tbl table
8775 #: build/C/man7/socket.7:168
8776 #, no-wrap
8777 msgid "Event:Poll flag:Occurrence\n"
8778 msgstr "イベント:poll フラグ:内容\n"
8779
8780 #. type: tbl table
8781 #: build/C/man7/socket.7:169 build/C/man7/socket.7:172
8782 #, no-wrap
8783 msgid "Read:POLLIN:T{\n"
8784 msgstr "Read:POLLIN:T{\n"
8785
8786 #. type: tbl table
8787 #: build/C/man7/socket.7:170
8788 #, no-wrap
8789 msgid "New data arrived.\n"
8790 msgstr "新しいデータが到着した。\n"
8791
8792 #. type: tbl table
8793 #: build/C/man7/socket.7:173
8794 #, no-wrap
8795 msgid "A connection setup has been completed\n"
8796 msgstr "(接続志向のソケットで)\n"
8797
8798 #. type: tbl table
8799 #: build/C/man7/socket.7:174
8800 #, no-wrap
8801 msgid "(for connection-oriented sockets)\n"
8802 msgstr "接続の設定が終了した。\n"
8803
8804 #. type: tbl table
8805 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
8806 #, no-wrap
8807 msgid "Read:POLLHUP:T{\n"
8808 msgstr "Read:POLLHUP:T{\n"
8809
8810 #. type: tbl table
8811 #: build/C/man7/socket.7:177
8812 #, no-wrap
8813 msgid "A disconnection request has been initiated by the other end.\n"
8814 msgstr "接続先で切断要求が生成された。\n"
8815
8816 #. type: tbl table
8817 #: build/C/man7/socket.7:180
8818 #, no-wrap
8819 msgid "A connection is broken (only for connection-oriented protocols).\n"
8820 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8821
8822 #. type: tbl table
8823 #: build/C/man7/socket.7:181
8824 #, no-wrap
8825 msgid "When the socket is written\n"
8826 msgstr "この場合、ソケットに書き込みが行われると\n"
8827
8828 #. type: tbl table
8829 #: build/C/man7/socket.7:182
8830 #, no-wrap
8831 msgid "B<SIGPIPE>\n"
8832 msgstr "B<SIGPIPE>\n"
8833
8834 #. type: tbl table
8835 #: build/C/man7/socket.7:183
8836 #, no-wrap
8837 msgid "is also sent.\n"
8838 msgstr "も送信される。\n"
8839
8840 #. type: tbl table
8841 #: build/C/man7/socket.7:185
8842 #, no-wrap
8843 msgid "Write:POLLOUT:T{\n"
8844 msgstr "Write:POLLOUT:T{\n"
8845
8846 #. type: tbl table
8847 #: build/C/man7/socket.7:186
8848 #, no-wrap
8849 msgid "Socket has enough send buffer space for writing new data.\n"
8850 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8851
8852 #. type: tbl table
8853 #: build/C/man7/socket.7:188
8854 #, no-wrap
8855 msgid "Read/Write:T{\n"
8856 msgstr "Read/Write:T{\n"
8857
8858 #. type: tbl table
8859 #: build/C/man7/socket.7:189
8860 #, no-wrap
8861 msgid "POLLIN|\n"
8862 msgstr "POLLIN|\n"
8863
8864 #. type: tbl table
8865 #: build/C/man7/socket.7:190
8866 #, no-wrap
8867 msgid ".br\n"
8868 msgstr ".br\n"
8869
8870 #. type: tbl table
8871 #: build/C/man7/socket.7:191
8872 #, no-wrap
8873 msgid "POLLOUT\n"
8874 msgstr "POLLOUT\n"
8875
8876 #. type: tbl table
8877 #: build/C/man7/socket.7:193
8878 #, no-wrap
8879 msgid "An outgoing\n"
8880 msgstr "外部向けの\n"
8881
8882 #. type: tbl table
8883 #: build/C/man7/socket.7:194
8884 #, no-wrap
8885 msgid "B<connect>(2)\n"
8886 msgstr "B<connect>(2)\n"
8887
8888 #. type: tbl table
8889 #: build/C/man7/socket.7:195
8890 #, no-wrap
8891 msgid "finished.\n"
8892 msgstr "が終了した。\n"
8893
8894 #. type: tbl table
8895 #: build/C/man7/socket.7:197
8896 #, no-wrap
8897 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8898 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8899
8900 #. type: tbl table
8901 #: build/C/man7/socket.7:198
8902 #, no-wrap
8903 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8904 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8905
8906 #. type: tbl table
8907 #: build/C/man7/socket.7:199
8908 #, no-wrap
8909 msgid "Exception:POLLPRI:T{\n"
8910 msgstr "Exception:POLLPRI:T{\n"
8911
8912 #. type: tbl table
8913 #: build/C/man7/socket.7:200
8914 #, no-wrap
8915 msgid "Urgent data arrived.\n"
8916 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8917
8918 #. type: tbl table
8919 #: build/C/man7/socket.7:201
8920 #, no-wrap
8921 msgid "B<SIGURG>\n"
8922 msgstr "B<SIGURG>\n"
8923
8924 #. type: tbl table
8925 #: build/C/man7/socket.7:202
8926 #, no-wrap
8927 msgid "is sent then.\n"
8928 msgstr "が送信される。\n"
8929
8930 #. type: Plain text
8931 #: build/C/man7/socket.7:231
8932 msgid ""
8933 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8934 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8935 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8936 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8937 "I<Signals> discussion below."
8938 msgstr ""
8939 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8940 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8941 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8942 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8943 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8944 "と。"
8945
8946 #. type: SS
8947 #: build/C/man7/socket.7:231
8948 #, no-wrap
8949 msgid "Socket address structures"
8950 msgstr "ソケットアドレス構造体"
8951
8952 #. type: Plain text
8953 #: build/C/man7/socket.7:247
8954 msgid ""
8955 "Each socket domain has its own format for socket addresses, with a domain-"
8956 "specific address structure.  Each of these structures begins with an integer "
8957 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8958 "address structure.  This allows the various system calls (e.g., B<connect>"
8959 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8960 "are generic to all socket domains, to determine the domain of a particular "
8961 "socket address."
8962 msgstr ""
8963 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8964 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8965 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8966 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8967 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8968 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8969 "できる。"
8970
8971 #. type: Plain text
8972 #: build/C/man7/socket.7:257
8973 msgid ""
8974 "To allow any type of socket address to be passed to interfaces in the "
8975 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8976 "type is purely to allow casting of domain-specific socket address types to a "
8977 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8978 "calls to the sockets API."
8979 msgstr ""
8980 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8981 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8982 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8983 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8984 "告を出すのを避けることができる。"
8985
8986 #. type: Plain text
8987 #: build/C/man7/socket.7:267
8988 msgid ""
8989 "In addition, the sockets API provides the data type I<struct "
8990 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8991 "domain-specific socket address structures; it is large enough and is aligned "
8992 "properly.  (In particular, it is large enough to hold IPv6 socket "
8993 "addresses.)  The structure includes the following field, which can be used "
8994 "to identify the type of socket address actually stored in the structure:"
8995 msgstr ""
8996 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8997 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8998 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8999 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
9000 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
9001 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
9002 "できる。"
9003
9004 #. type: Plain text
9005 #: build/C/man7/socket.7:271
9006 #, no-wrap
9007 msgid "    sa_family_t ss_family;\n"
9008 msgstr "    sa_family_t ss_family;\n"
9009
9010 #. type: Plain text
9011 #: build/C/man7/socket.7:279
9012 msgid ""
9013 "The I<sockaddr_storage> structure is useful in programs that must handle "
9014 "socket addresses in a generic way (e.g., programs that must deal with both "
9015 "IPv4 and IPv6 socket addresses)."
9016 msgstr ""
9017 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
9018 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
9019 "ログラム) で有用である。"
9020
9021 #. type: SS
9022 #: build/C/man7/socket.7:279
9023 #, no-wrap
9024 msgid "Socket options"
9025 msgstr "ソケットオプション"
9026
9027 #.  FIXME
9028 #.  In the list below, the text used to describe argument types
9029 #.  for each socket option should be more consistent
9030 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
9031 #.  W R Stevens, UNPv1
9032 #. type: Plain text
9033 #: build/C/man7/socket.7:297
9034 msgid ""
9035 "The socket options listed below can be set by using B<setsockopt>(2)  and "
9036 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
9037 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
9038 msgstr ""
9039 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
9040 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
9041 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
9042 "I<int> へのポインタである。"
9043
9044 #. type: TP
9045 #: build/C/man7/socket.7:297
9046 #, no-wrap
9047 msgid "B<SO_ACCEPTCONN>"
9048 msgstr "B<SO_ACCEPTCONN>"
9049
9050 #. type: Plain text
9051 #: build/C/man7/socket.7:305
9052 msgid ""
9053 "Returns a value indicating whether or not this socket has been marked to "
9054 "accept connections with B<listen>(2).  The value 0 indicates that this is "
9055 "not a listening socket, the value 1 indicates that this is a listening "
9056 "socket.  This socket option is read-only."
9057 msgstr ""
9058 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
9059 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9060 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9061
9062 #. type: TP
9063 #: build/C/man7/socket.7:305
9064 #, no-wrap
9065 msgid "B<SO_BINDTODEVICE>"
9066 msgstr "B<SO_BINDTODEVICE>"
9067
9068 #. type: Plain text
9069 #: build/C/man7/socket.7:324
9070 msgid ""
9071 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9072 "the passed interface name.  If the name is an empty string or the option "
9073 "length is zero, the socket device binding is removed.  The passed option is "
9074 "a variable-length null-terminated interface name string with the maximum "
9075 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
9076 "received from that particular interface are processed by the socket.  Note "
9077 "that this works only for some socket types, particularly B<AF_INET> "
9078 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
9079 "there)."
9080 msgstr ""
9081 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9082 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9083 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9084 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9085 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9086 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9087 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9088 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9089 "B<bind>(2) を使うこと)。"
9090
9091 #. type: Plain text
9092 #: build/C/man7/socket.7:338
9093 msgid ""
9094 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9095 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
9096 "argument should contain the buffer size available to receive the device name "
9097 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
9098 "reported back in the I<optlen> argument."
9099 msgstr ""
9100 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9101 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9102 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9103 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
9104 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9105
9106 #. type: TP
9107 #: build/C/man7/socket.7:338
9108 #, no-wrap
9109 msgid "B<SO_BROADCAST>"
9110 msgstr "B<SO_BROADCAST>"
9111
9112 #. type: Plain text
9113 #: build/C/man7/socket.7:344
9114 msgid ""
9115 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
9116 "to send packets to a broadcast address.  This option has no effect on stream-"
9117 "oriented sockets."
9118 msgstr ""
9119 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9120 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9121 "ストリーム指向のソケットには何の効果もない。"
9122
9123 #. type: TP
9124 #: build/C/man7/socket.7:344
9125 #, no-wrap
9126 msgid "B<SO_BSDCOMPAT>"
9127 msgstr "B<SO_BSDCOMPAT>"
9128
9129 #. type: Plain text
9130 #: build/C/man7/socket.7:356
9131 msgid ""
9132 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
9133 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
9134 "socket will not be passed to the user program.  In later kernel versions, "
9135 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9136 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9137 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9138 "header changing, skipping of the broadcast flag) for raw sockets with this "
9139 "option, but that was removed in Linux 2.2."
9140 msgstr ""
9141 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9142 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9143 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
9144 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
9145 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
9146 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
9147 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
9148 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
9149 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
9150
9151 #. type: TP
9152 #: build/C/man7/socket.7:356
9153 #, no-wrap
9154 msgid "B<SO_DEBUG>"
9155 msgstr "B<SO_DEBUG>"
9156
9157 #. type: Plain text
9158 #: build/C/man7/socket.7:362
9159 msgid ""
9160 "Enable socket debugging.  Only allowed for processes with the "
9161 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9162 msgstr ""
9163 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9164 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9165
9166 #. type: TP
9167 #: build/C/man7/socket.7:362
9168 #, no-wrap
9169 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9170 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9171
9172 #. type: Plain text
9173 #: build/C/man7/socket.7:370
9174 msgid ""
9175 "Retrieves the socket domain as an integer, returning a value such as "
9176 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9177 "only."
9178 msgstr ""
9179 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9180 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9181
9182 #. type: TP
9183 #: build/C/man7/socket.7:370
9184 #, no-wrap
9185 msgid "B<SO_ERROR>"
9186 msgstr "B<SO_ERROR>"
9187
9188 #. type: Plain text
9189 #: build/C/man7/socket.7:375
9190 msgid ""
9191 "Get and clear the pending socket error.  This socket option is read-only.  "
9192 "Expects an integer."
9193 msgstr ""
9194 "保留になっていたソケットエラーを取得してクリアする。\n"
9195 "このソケットオプションは読み込み専用である。整数値をとる。"
9196
9197 #. type: TP
9198 #: build/C/man7/socket.7:375
9199 #, no-wrap
9200 msgid "B<SO_DONTROUTE>"
9201 msgstr "B<SO_DONTROUTE>"
9202
9203 #. type: Plain text
9204 #: build/C/man7/socket.7:384
9205 msgid ""
9206 "Don't send via a gateway, send only to directly connected hosts.  The same "
9207 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9208 "B<send>(2)  operation.  Expects an integer boolean flag."
9209 msgstr ""
9210 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9211 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9212 "数のフラグを取る。"
9213
9214 #. type: TP
9215 #: build/C/man7/socket.7:384
9216 #, no-wrap
9217 msgid "B<SO_KEEPALIVE>"
9218 msgstr "B<SO_KEEPALIVE>"
9219
9220 #. type: Plain text
9221 #: build/C/man7/socket.7:388
9222 msgid ""
9223 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9224 "Expects an integer boolean flag."
9225 msgstr ""
9226 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9227 "の整数フラグをとる。"
9228
9229 #. type: TP
9230 #: build/C/man7/socket.7:388
9231 #, no-wrap
9232 msgid "B<SO_LINGER>"
9233 msgstr "B<SO_LINGER>"
9234
9235 #. type: Plain text
9236 #: build/C/man7/socket.7:396
9237 msgid ""
9238 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9239 msgstr ""
9240 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9241
9242 #. type: Plain text
9243 #: build/C/man7/socket.7:403
9244 #, no-wrap
9245 msgid ""
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 msgstr ""
9251 "struct linger {\n"
9252 "    int l_onoff;    /* linger active */\n"
9253 "    int l_linger;   /* how many seconds to linger for */\n"
9254 "};\n"
9255
9256 #. type: Plain text
9257 #: build/C/man7/socket.7:417
9258 msgid ""
9259 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9260 "queued messages for the socket have been successfully sent or the linger "
9261 "timeout has been reached.  Otherwise, the call returns immediately and the "
9262 "closing is done in the background.  When the socket is closed as part of "
9263 "B<exit>(2), it always lingers in the background."
9264 msgstr ""
9265 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9266 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9267 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9268 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9269 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9270 "送られる。"
9271
9272 #. type: TP
9273 #: build/C/man7/socket.7:417
9274 #, no-wrap
9275 msgid "B<SO_MARK> (since Linux 2.6.25)"
9276 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9277
9278 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9279 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9280 #. type: Plain text
9281 #: build/C/man7/socket.7:428
9282 msgid ""
9283 "Set the mark for each packet sent through this socket (similar to the "
9284 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9285 "mark-based routing without netfilter or for packet filtering.  Setting this "
9286 "option requires the B<CAP_NET_ADMIN> capability."
9287 msgstr ""
9288 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9289 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9290 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9291 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9292 "ティが必要である。"
9293
9294 #. type: TP
9295 #: build/C/man7/socket.7:428
9296 #, no-wrap
9297 msgid "B<SO_OOBINLINE>"
9298 msgstr "B<SO_OOBINLINE>"
9299
9300 #.  don't document it because it can do too much harm.
9301 #. .B SO_NO_CHECK
9302 #. type: Plain text
9303 #: build/C/man7/socket.7:437
9304 msgid ""
9305 "If this option is enabled, out-of-band data is directly placed into the "
9306 "receive data stream.  Otherwise out-of-band data is passed only when the "
9307 "B<MSG_OOB> flag is set during receiving."
9308 msgstr ""
9309 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9310 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9311 "ラグがセットされている場合に限って渡される。"
9312
9313 #. type: TP
9314 #: build/C/man7/socket.7:437
9315 #, no-wrap
9316 msgid "B<SO_PASSCRED>"
9317 msgstr "B<SO_PASSCRED>"
9318
9319 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9320 #.  in the 2.6.18 ChangeLog
9321 #. type: Plain text
9322 #: build/C/man7/socket.7:446
9323 msgid ""
9324 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9325 "For more information see B<unix>(7)."
9326 msgstr ""
9327 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9328 "を参照のこと。"
9329
9330 #. type: TP
9331 #: build/C/man7/socket.7:446
9332 #, no-wrap
9333 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9334 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9335
9336 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9337 #. type: Plain text
9338 #: build/C/man7/socket.7:456
9339 #, fuzzy
9340 #| msgid ""
9341 #| "This option, which is currently supported only for B<unix>(7)  sockets, "
9342 #| "sets the value of the \"peek offset\" for the B<recv(2)> system call when "
9343 #| "used with B<MSG_PEEK> flag."
9344 msgid ""
9345 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9346 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9347 "with B<MSG_PEEK> flag."
9348 msgstr ""
9349 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9350 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9351 "B<unix>(7) ソケットでのみサポートされている。"
9352
9353 #. type: Plain text
9354 #: build/C/man7/socket.7:464
9355 #, fuzzy
9356 #| msgid ""
9357 #| "When this option is set to a negative value (it is set to -1 for all new "
9358 #| "sockets), traditional behavior is provided: B<recv(2)> with the "
9359 #| "B<MSG_PEEK> flag will peek data from the front of the queue."
9360 msgid ""
9361 "When this option is set to a negative value (it is set to -1 for all new "
9362 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9363 "flag will peek data from the front of the queue."
9364 msgstr ""
9365 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9366 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9367 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9368 "のソケットではこのオプションの値は必ず -1 に設定される。"
9369
9370 #. type: Plain text
9371 #: build/C/man7/socket.7:471
9372 msgid ""
9373 "When the option is set to a value greater than or equal to zero, then the "
9374 "next peek at data queued in the socket will occur at the byte offset "
9375 "specified by the option value.  At the same time, the \"peek offset\" will "
9376 "be incremented by the number of bytes that were peeked from the queue, so "
9377 "that a subsequent peek will return the next data in the queue."
9378 msgstr ""
9379 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9380 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9381 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9382 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9383
9384 #. type: Plain text
9385 #: build/C/man7/socket.7:483
9386 msgid ""
9387 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9388 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9389 "by the number of bytes removed.  In other words, receiving data without the "
9390 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9391 "the correct relative position in the queued data, so that a subsequent peek "
9392 "will retrieve the data that would have been retrieved had the data not been "
9393 "removed."
9394 msgstr ""
9395 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9396 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9397 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9398 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9399 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9400 "いうことである。"
9401
9402 #. type: Plain text
9403 #: build/C/man7/socket.7:488
9404 msgid ""
9405 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9406 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9407 msgstr ""
9408 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9409 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9410
9411 #. type: Plain text
9412 #: build/C/man7/socket.7:492
9413 msgid ""
9414 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9415 "Suppose a stream socket has the following queued input data:"
9416 msgstr ""
9417 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9418 "以下の入力データが入っているものとする。"
9419
9420 #. type: Plain text
9421 #: build/C/man7/socket.7:494
9422 #, no-wrap
9423 msgid "    aabbccddeeff\n"
9424 msgstr "    aabbccddeeff\n"
9425
9426 #. type: Plain text
9427 #: build/C/man7/socket.7:499
9428 msgid ""
9429 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9430 "the comments:"
9431 msgstr ""
9432 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9433
9434 #. type: Plain text
9435 #: build/C/man7/socket.7:504
9436 #, no-wrap
9437 msgid ""
9438 "int ov = 4;                  // Set peek offset to 4\n"
9439 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9440 msgstr ""
9441 "int ov = 4;                  // Set peek offset to 4\n"
9442 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9443
9444 #. type: Plain text
9445 #: build/C/man7/socket.7:509
9446 #, no-wrap
9447 msgid ""
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 msgstr ""
9453 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9454 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9455 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9456 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9457
9458 #. type: TP
9459 #: build/C/man7/socket.7:511
9460 #, no-wrap
9461 msgid "B<SO_PEERCRED>"
9462 msgstr "B<SO_PEERCRED>"
9463
9464 #. type: Plain text
9465 #: build/C/man7/socket.7:534
9466 msgid ""
9467 "Return the credentials of the foreign process connected to this socket.  "
9468 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9469 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
9470 "(7).  The returned credentials are those that were in effect at the time of "
9471 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
9472 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
9473 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
9474 "option is read-only."
9475 msgstr ""
9476 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9477 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9478 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9479 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9480 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9481 "る。引き数は I<ucred> 構造体である。このソケットオプションは読み込み専用であ"
9482 "る。"
9483
9484 #. type: TP
9485 #: build/C/man7/socket.7:534
9486 #, no-wrap
9487 msgid "B<SO_PRIORITY>"
9488 msgstr "B<SO_PRIORITY>"
9489
9490 #. type: Plain text
9491 #: build/C/man7/socket.7:547
9492 msgid ""
9493 "Set the protocol-defined priority for all packets to be sent on this "
9494 "socket.  Linux uses this value to order the networking queues: packets with "
9495 "a higher priority may be processed first depending on the selected device "
9496 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9497 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9498 "6 requires the B<CAP_NET_ADMIN> capability."
9499 msgstr ""
9500 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9501 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9502 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9503 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9504 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9505 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9506
9507 #. type: TP
9508 #: build/C/man7/socket.7:547
9509 #, no-wrap
9510 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9511 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9512
9513 #. type: Plain text
9514 #: build/C/man7/socket.7:555
9515 msgid ""
9516 "Retrieves the socket protocol as an integer, returning a value such as "
9517 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9518 "only."
9519 msgstr ""
9520 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9521 "る。\n"
9522 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9523
9524 #. type: TP
9525 #: build/C/man7/socket.7:555
9526 #, no-wrap
9527 msgid "B<SO_RCVBUF>"
9528 msgstr "B<SO_RCVBUF>"
9529
9530 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9531 #.  The following thread on LMKL is quite informative:
9532 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9533 #.  17 July 2012
9534 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9535 #. type: Plain text
9536 #: build/C/man7/socket.7:574
9537 msgid ""
9538 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9539 "this value (to allow space for bookkeeping overhead)  when it is set using "
9540 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9541 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9542 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9543 "file.  The minimum (doubled) value for this option is 256."
9544 msgstr ""
9545 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9546 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9547 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9548 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9549 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9550 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9551
9552 #. type: TP
9553 #: build/C/man7/socket.7:574
9554 #, no-wrap
9555 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9556 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9557
9558 #. type: Plain text
9559 #: build/C/man7/socket.7:583
9560 msgid ""
9561 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9562 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9563 "overridden."
9564 msgstr ""
9565 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9566 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9567 "きすることができる。"
9568
9569 #. type: TP
9570 #: build/C/man7/socket.7:583
9571 #, no-wrap
9572 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9573 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9574
9575 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9576 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9577 #. type: Plain text
9578 #: build/C/man7/socket.7:612
9579 msgid ""
9580 "Specify the minimum number of bytes in the buffer until the socket layer "
9581 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9582 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9583 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9584 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9585 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9586 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9587 "single byte of data is available.  A subsequent read from the socket will "
9588 "block until B<SO_RCVLOWAT> bytes are available."
9589 msgstr ""
9590 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9591 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9592 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9593 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9594 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9595 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9596 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9597 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9598 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9599 "してしまう。"
9600
9601 #. type: TP
9602 #: build/C/man7/socket.7:612
9603 #, no-wrap
9604 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9605 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9606
9607 #.  Not implemented in 2.0.
9608 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9609 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9610 #.  in fact to EAGAIN
9611 #. type: Plain text
9612 #: build/C/man7/socket.7:647
9613 msgid ""
9614 "Specify the receiving or sending timeouts until reporting an error.  The "
9615 "argument is a I<struct timeval>.  If an input or output function blocks for "
9616 "this period of time, and data has been sent or received, the return value of "
9617 "that function will be the amount of data transferred; if no data has been "
9618 "transferred and the timeout has been reached then -1 is returned with "
9619 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9620 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9621 "the timeout is set to zero (the default)  then the operation will never "
9622 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9623 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9624 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9625 msgstr ""
9626 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9627 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9628 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9629 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9630 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>"
9631 "(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見"
9632 "える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタ"
9633 "イムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行す"
9634 "るシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), "
9635 "B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), B<epoll_wait>(2)  などには"
9636 "タイムアウトは影響を及ぼさない。"
9637
9638 #. type: TP
9639 #: build/C/man7/socket.7:647
9640 #, no-wrap
9641 msgid "B<SO_REUSEADDR>"
9642 msgstr "B<SO_REUSEADDR>"
9643
9644 #. type: Plain text
9645 #: build/C/man7/socket.7:662
9646 msgid ""
9647 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9648 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9649 "this means that a socket may bind, except when there is an active listening "
9650 "socket bound to the address.  When the listening socket is bound to "
9651 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9652 "port for any local address.  Argument is an integer boolean flag."
9653 msgstr ""
9654 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9655 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9656 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9657 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9658 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9659 "ドできない。 引き数はブール整数のフラグである。"
9660
9661 #. type: TP
9662 #: build/C/man7/socket.7:662
9663 #, fuzzy, no-wrap
9664 #| msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9665 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9666 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9667
9668 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9669 #. type: Plain text
9670 #: build/C/man7/socket.7:669
9671 msgid ""
9672 "Indicates that an unsigned 32-bit value ancilliary msg (cmsg)  should be "
9673 "attached to received skbs indicating the number of packets dropped by the "
9674 "socket between the last received packet and this received packet"
9675 msgstr ""
9676
9677 #. type: TP
9678 #: build/C/man7/socket.7:669
9679 #, no-wrap
9680 msgid "B<SO_SNDBUF>"
9681 msgstr "B<SO_SNDBUF>"
9682
9683 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9684 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9685 #. type: Plain text
9686 #: build/C/man7/socket.7:685
9687 msgid ""
9688 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9689 "this value (to allow space for bookkeeping overhead)  when it is set using "
9690 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9691 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9692 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9693 "file.  The minimum (doubled) value for this option is 2048."
9694 msgstr ""
9695 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9696 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9697 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9698 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9699 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9700 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9701
9702 #. type: TP
9703 #: build/C/man7/socket.7:685
9704 #, no-wrap
9705 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9706 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9707
9708 #. type: Plain text
9709 #: build/C/man7/socket.7:694
9710 msgid ""
9711 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9712 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9713 "overridden."
9714 msgstr ""
9715 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9716 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9717 "きすることができる。"
9718
9719 #. type: TP
9720 #: build/C/man7/socket.7:694
9721 #, no-wrap
9722 msgid "B<SO_TIMESTAMP>"
9723 msgstr "B<SO_TIMESTAMP>"
9724
9725 #. type: Plain text
9726 #: build/C/man7/socket.7:710
9727 msgid ""
9728 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9729 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9730 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9731 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9732 "details on control messages."
9733 msgstr ""
9734 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9735 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9736 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9737 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9738
9739 #. type: TP
9740 #: build/C/man7/socket.7:710
9741 #, no-wrap
9742 msgid "B<SO_TYPE>"
9743 msgstr "B<SO_TYPE>"
9744
9745 #. type: Plain text
9746 #: build/C/man7/socket.7:715
9747 msgid ""
9748 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9749 "option is read-only."
9750 msgstr ""
9751 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9752 "このソケットオプションは読み出し専用である。"
9753
9754 #. type: TP
9755 #: build/C/man7/socket.7:715
9756 #, fuzzy, no-wrap
9757 #| msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9758 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9759 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9760
9761 #. type: Plain text
9762 #: build/C/man7/socket.7:724
9763 msgid ""
9764 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9765 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9766 "The default for this option is controlled by the I</proc/sys/net/core/"
9767 "busy_read> file."
9768 msgstr ""
9769
9770 #. type: Plain text
9771 #: build/C/man7/socket.7:734
9772 msgid ""
9773 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9774 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9775 "with B<SO_BUSY_POLL> set and no events to report are found."
9776 msgstr ""
9777
9778 #. type: Plain text
9779 #: build/C/man7/socket.7:738
9780 msgid ""
9781 "In both cases, busy polling will only be done when the socket last received "
9782 "data from a network device that supports this option."
9783 msgstr ""
9784
9785 #. type: Plain text
9786 #: build/C/man7/socket.7:742
9787 msgid ""
9788 "While busy polling may improve latency of some applications, care must be "
9789 "taken when using it since this will increase both CPU utilization and power "
9790 "usage."
9791 msgstr ""
9792
9793 #. type: SS
9794 #: build/C/man7/socket.7:742
9795 #, no-wrap
9796 msgid "Signals"
9797 msgstr "シグナル"
9798
9799 #. type: Plain text
9800 #: build/C/man7/socket.7:753
9801 msgid ""
9802 "When writing onto a connection-oriented socket that has been shut down (by "
9803 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9804 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9805 "the B<MSG_NOSIGNAL> flag."
9806 msgstr ""
9807 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9808 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9809 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9810 "していた場合はシグナルは送られない。"
9811
9812 #. type: Plain text
9813 #: build/C/man7/socket.7:778
9814 msgid ""
9815 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9816 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9817 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9818 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9819 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9820 "signal will be called with the file descriptor in the I<si_fd> field of its "
9821 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9822 msgstr ""
9823 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9824 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9825 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9826 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9827 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9828 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9829 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9830 "を参照のこと。"
9831
9832 #.  .SS Ancillary messages
9833 #. type: Plain text
9834 #: build/C/man7/socket.7:786
9835 msgid ""
9836 "Under some circumstances (e.g., multiple processes accessing a single "
9837 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9838 "when the process reacts to the signal.  If this happens, the process should "
9839 "wait again because Linux will resend the signal later."
9840 msgstr ""
9841 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9842 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9843 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9844 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9845
9846 #. type: SS
9847 #: build/C/man7/socket.7:786
9848 #, no-wrap
9849 msgid "/proc interfaces"
9850 msgstr "/proc インタフェース"
9851
9852 #. type: Plain text
9853 #: build/C/man7/socket.7:790
9854 msgid ""
9855 "The core socket networking parameters can be accessed via files in the "
9856 "directory I</proc/sys/net/core/>."
9857 msgstr ""
9858 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9859 "レクトリ内のファイルを通してアクセスできる。"
9860
9861 #. type: TP
9862 #: build/C/man7/socket.7:790
9863 #, no-wrap
9864 msgid "I<rmem_default>"
9865 msgstr "I<rmem_default>"
9866
9867 #. type: Plain text
9868 #: build/C/man7/socket.7:793
9869 msgid "contains the default setting in bytes of the socket receive buffer."
9870 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9871
9872 #. type: TP
9873 #: build/C/man7/socket.7:793
9874 #, no-wrap
9875 msgid "I<rmem_max>"
9876 msgstr "I<rmem_max>"
9877
9878 #. type: Plain text
9879 #: build/C/man7/socket.7:799
9880 msgid ""
9881 "contains the maximum socket receive buffer size in bytes which a user may "
9882 "set by using the B<SO_RCVBUF> socket option."
9883 msgstr ""
9884 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9885 "ファサイズの最大値 (バイト単位)。"
9886
9887 #. type: TP
9888 #: build/C/man7/socket.7:799
9889 #, no-wrap
9890 msgid "I<wmem_default>"
9891 msgstr "I<wmem_default>"
9892
9893 #. type: Plain text
9894 #: build/C/man7/socket.7:802
9895 msgid "contains the default setting in bytes of the socket send buffer."
9896 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9897
9898 #. type: TP
9899 #: build/C/man7/socket.7:802
9900 #, no-wrap
9901 msgid "I<wmem_max>"
9902 msgstr "I<wmem_max>"
9903
9904 #. type: Plain text
9905 #: build/C/man7/socket.7:808
9906 msgid ""
9907 "contains the maximum socket send buffer size in bytes which a user may set "
9908 "by using the B<SO_SNDBUF> socket option."
9909 msgstr ""
9910 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9911 "ファサイズの最大値 (バイト単位)。"
9912
9913 #. type: TP
9914 #: build/C/man7/socket.7:808
9915 #, no-wrap
9916 msgid "I<message_cost> and I<message_burst>"
9917 msgstr "I<message_cost> と I<message_burst>"
9918
9919 #. type: Plain text
9920 #: build/C/man7/socket.7:812
9921 msgid ""
9922 "configure the token bucket filter used to load limit warning messages caused "
9923 "by external network events."
9924 msgstr ""
9925 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9926 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9927
9928 #. type: TP
9929 #: build/C/man7/socket.7:812
9930 #, no-wrap
9931 msgid "I<netdev_max_backlog>"
9932 msgstr "I<netdev_max_backlog>"
9933
9934 #. type: Plain text
9935 #: build/C/man7/socket.7:815
9936 msgid "Maximum number of packets in the global input queue."
9937 msgstr "グローバルな入力キューにおける最大のパケット数。"
9938
9939 #. type: TP
9940 #: build/C/man7/socket.7:815
9941 #, no-wrap
9942 msgid "I<optmem_max>"
9943 msgstr "I<optmem_max>"
9944
9945 #.  netdev_fastroute is not documented because it is experimental
9946 #. type: Plain text
9947 #: build/C/man7/socket.7:820
9948 msgid ""
9949 "Maximum length of ancillary data and user control data like the iovecs per "
9950 "socket."
9951 msgstr ""
9952 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9953 "うなもの) との和の最大長。"
9954
9955 #. type: SS
9956 #: build/C/man7/socket.7:820
9957 #, no-wrap
9958 msgid "Ioctls"
9959 msgstr "ioctl"
9960
9961 #. type: Plain text
9962 #: build/C/man7/socket.7:823
9963 msgid "These operations can be accessed using B<ioctl>(2):"
9964 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9965
9966 #. type: Plain text
9967 #: build/C/man7/socket.7:827
9968 #, no-wrap
9969 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9970 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9971
9972 #. type: TP
9973 #: build/C/man7/socket.7:829
9974 #, no-wrap
9975 msgid "B<SIOCGSTAMP>"
9976 msgstr "B<SIOCGSTAMP>"
9977
9978 #. type: Plain text
9979 #: build/C/man7/socket.7:853
9980 msgid ""
9981 "Return a I<struct timeval> with the receive timestamp of the last packet "
9982 "passed to the user.  This is useful for accurate round trip time "
9983 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9984 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9985 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9986 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9987 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9988 "to B<ENOENT>)."
9989 msgstr ""
9990 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9991 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9992 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9993 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9994 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9995 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9996 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9997 "セットする)。"
9998
9999 #. type: TP
10000 #: build/C/man7/socket.7:853
10001 #, no-wrap
10002 msgid "B<SIOCSPGRP>"
10003 msgstr "B<SIOCSPGRP>"
10004
10005 #. type: Plain text
10006 #: build/C/man7/socket.7:872
10007 msgid ""
10008 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
10009 "when an asynchronous I/O operation has finished or urgent data is "
10010 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
10011 "positive, send the signals to that process.  If the argument is negative, "
10012 "send the signals to the process group with the ID of the absolute value of "
10013 "the argument.  The process may only choose itself or its own process group "
10014 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
10015 "UID of 0."
10016 msgstr ""
10017 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
10018 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
10019 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
10020 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
10021 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
10022 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
10023 "の場合は この限りではない。"
10024
10025 #. type: TP
10026 #: build/C/man7/socket.7:872
10027 #, no-wrap
10028 msgid "B<FIOASYNC>"
10029 msgstr "B<FIOASYNC>"
10030
10031 #. type: Plain text
10032 #: build/C/man7/socket.7:882
10033 msgid ""
10034 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
10035 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
10036 "set with B<F_SETSIG> is raised when a new I/O event occurs."
10037 msgstr ""
10038 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
10039 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
10040 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
10041
10042 #. type: Plain text
10043 #: build/C/man7/socket.7:890
10044 msgid ""
10045 "Argument is an integer boolean flag.  (This operation is synonymous with the "
10046 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
10047 msgstr ""
10048 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
10049 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10050
10051 #. type: TP
10052 #: build/C/man7/socket.7:890
10053 #, no-wrap
10054 msgid "B<SIOCGPGRP>"
10055 msgstr "B<SIOCGPGRP>"
10056
10057 #. type: Plain text
10058 #: build/C/man7/socket.7:899
10059 msgid ""
10060 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10061 "signals, or 0 when none is set."
10062 msgstr ""
10063 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
10064 "る。 ない場合は 0 が返る。"
10065
10066 #. type: Plain text
10067 #: build/C/man7/socket.7:903
10068 msgid "Valid B<fcntl>(2)  operations:"
10069 msgstr "有効な B<fcntl>(2)  操作:"
10070
10071 #. type: TP
10072 #: build/C/man7/socket.7:903
10073 #, no-wrap
10074 msgid "B<FIOGETOWN>"
10075 msgstr "B<FIOGETOWN>"
10076
10077 #. type: Plain text
10078 #: build/C/man7/socket.7:908
10079 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10080 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
10081
10082 #. type: TP
10083 #: build/C/man7/socket.7:908
10084 #, no-wrap
10085 msgid "B<FIOSETOWN>"
10086 msgstr "B<FIOSETOWN>"
10087
10088 #. type: Plain text
10089 #: build/C/man7/socket.7:913
10090 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10091 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
10092
10093 #. type: Plain text
10094 #: build/C/man7/socket.7:927
10095 msgid ""
10096 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
10097 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
10098 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
10099 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10100 "be read or written."
10101 msgstr ""
10102 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10103 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
10104 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10105 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10106 "はできなかった。"
10107
10108 #. type: Plain text
10109 #: build/C/man7/socket.7:932
10110 msgid ""
10111 "Linux assumes that half of the send/receive buffer is used for internal "
10112 "kernel structures; thus the values in the corresponding I</proc> files are "
10113 "twice what can be observed on the wire."
10114 msgstr ""
10115 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
10116 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
10117 "なる。"
10118
10119 #. type: Plain text
10120 #: build/C/man7/socket.7:945
10121 msgid ""
10122 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
10123 "option was set both in the previous program that performed a B<bind>(2)  to "
10124 "the port and in the program that wants to reuse the port.  This differs from "
10125 "some implementations (e.g., FreeBSD)  where only the later program needs to "
10126 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
10127 "since, for example, a server program is designed to always set this option."
10128 msgstr ""
10129 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10130 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
10131 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10132 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10133 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10134 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10135 "このオプションをセットするように設計されるからである。"
10136
10137 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10138 #.  .SH AUTHORS
10139 #.  This man page was written by Andi Kleen.
10140 #. type: Plain text
10141 #: build/C/man7/socket.7:958
10142 msgid ""
10143 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10144 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
10145 "is via the libpcap library."
10146 msgstr ""
10147 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10148 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10149 "して 用いる方が良い。"
10150
10151 #. type: Plain text
10152 #: build/C/man7/socket.7:970
10153 #, fuzzy
10154 #| msgid ""
10155 #| "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
10156 #| "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>"
10157 #| "(7), B<unix>(7)"
10158 msgid ""
10159 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10160 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10161 "B<unix>(7)"
10162 msgstr ""
10163 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
10164 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10165 "B<unix>(7)"
10166
10167 #. type: TH
10168 #: build/C/man2/socketcall.2:25
10169 #, no-wrap
10170 msgid "SOCKETCALL"
10171 msgstr "SOCKETCALL"
10172
10173 #. type: TH
10174 #: build/C/man2/socketcall.2:25
10175 #, no-wrap
10176 msgid "2012-10-16"
10177 msgstr "2012-10-16"
10178
10179 #. type: Plain text
10180 #: build/C/man2/socketcall.2:28
10181 msgid "socketcall - socket system calls"
10182 msgstr "socketcall - ソケット・システムコール"
10183
10184 #. type: Plain text
10185 #: build/C/man2/socketcall.2:30
10186 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10187 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10188
10189 #. type: Plain text
10190 #: build/C/man2/socketcall.2:38
10191 msgid ""
10192 "B<socketcall>()  is a common kernel entry point for the socket system "
10193 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10194 "to a block containing the actual arguments, which are passed through to the "
10195 "appropriate call."
10196 msgstr ""
10197 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
10198 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10199 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10200 "ロックを指す。"
10201
10202 #. type: Plain text
10203 #: build/C/man2/socketcall.2:42
10204 msgid ""
10205 "User programs should call the appropriate functions by their usual names.  "
10206 "Only standard library implementors and kernel hackers need to know about "
10207 "B<socketcall>()."
10208 msgstr ""
10209 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10210 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
10211 "必要がある。"
10212
10213 #. type: Plain text
10214 #: build/C/man2/socketcall.2:45
10215 msgid ""
10216 "This call is specific to Linux, and should not be used in programs intended "
10217 "to be portable."
10218 msgstr ""
10219 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10220 "い。"
10221
10222 #. type: Plain text
10223 #: build/C/man2/socketcall.2:53
10224 msgid ""
10225 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10226 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
10227 "(2), and so on really are implemented as separate system calls."
10228 msgstr ""
10229 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10230 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10231 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10232
10233 #. type: Plain text
10234 #: build/C/man2/socketcall.2:71
10235 msgid ""
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 msgstr ""
10241 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10242 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10243 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10244 "(2), B<socket>(2), B<socketpair>(2)"
10245
10246 #. type: TH
10247 #: build/C/man2/socketpair.2:42
10248 #, no-wrap
10249 msgid "SOCKETPAIR"
10250 msgstr "SOCKETPAIR"
10251
10252 #. type: TH
10253 #: build/C/man2/socketpair.2:42
10254 #, no-wrap
10255 msgid "2008-10-11"
10256 msgstr "2008-10-11"
10257
10258 #. type: Plain text
10259 #: build/C/man2/socketpair.2:45
10260 msgid "socketpair - create a pair of connected sockets"
10261 msgstr "socketpair - 接続されたソケットのペアを作成する"
10262
10263 #. type: Plain text
10264 #: build/C/man2/socketpair.2:52
10265 msgid ""
10266 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10267 ">I<sv>B<[2]);>"
10268 msgstr ""
10269 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10270 ">I<sv>B<[2]);>"
10271
10272 #. type: Plain text
10273 #: build/C/man2/socketpair.2:63
10274 msgid ""
10275 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10276 "the specified I<domain>, of the specified I<type>, and using the optionally "
10277 "specified I<protocol>.  For further details of these arguments, see B<socket>"
10278 "(2)."
10279 msgstr ""
10280 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10281 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10282 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10283
10284 #. type: Plain text
10285 #: build/C/man2/socketpair.2:69
10286 msgid ""
10287 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10288 "and I<sv>[1].  The two sockets are indistinguishable."
10289 msgstr ""
10290 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10291 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10292
10293 #. type: Plain text
10294 #: build/C/man2/socketpair.2:78
10295 msgid "The specified address family is not supported on this machine."
10296 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10297
10298 #. type: Plain text
10299 #: build/C/man2/socketpair.2:83
10300 msgid ""
10301 "The address I<sv> does not specify a valid part of the process address space."
10302 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10303
10304 #. type: Plain text
10305 #: build/C/man2/socketpair.2:86
10306 msgid "Too many descriptors are in use by this process."
10307 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10308
10309 #. type: Plain text
10310 #: build/C/man2/socketpair.2:92
10311 msgid "The specified protocol does not support creation of socket pairs."
10312 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10313
10314 #. type: Plain text
10315 #: build/C/man2/socketpair.2:95
10316 msgid "The specified protocol is not supported on this machine."
10317 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10318
10319 #. type: Plain text
10320 #: build/C/man2/socketpair.2:103
10321 msgid ""
10322 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10323 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10324 "of the BSD socket layer (including System V variants)."
10325 msgstr ""
10326 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10327 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
10328 "BSD 以外のシステムと、 互いに移植性がある。"
10329
10330 #. type: Plain text
10331 #: build/C/man2/socketpair.2:109
10332 msgid ""
10333 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10334 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10335 "restriction.)"
10336 msgstr ""
10337 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10338 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10339
10340 #. type: Plain text
10341 #: build/C/man2/socketpair.2:118
10342 msgid ""
10343 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10344 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10345 msgstr ""
10346 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10347 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10348
10349 #. type: Plain text
10350 #: build/C/man2/socketpair.2:131
10351 msgid ""
10352 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10353 msgstr ""
10354 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10355
10356 #~ msgid ""
10357 #~ "$ B<./a.out>\n"
10358 #~ "lo      address family: 17 (AF_PACKET)\n"
10359 #~ "eth0    address family: 17 (AF_PACKET)\n"
10360 #~ "lo      address family: 2 (AF_INET)\n"
10361 #~ "        address: E<lt>127.0.0.1E<gt>\n"
10362 #~ "eth0    address family: 2 (AF_INET)\n"
10363 #~ "        address: E<lt>10.1.1.4E<gt>\n"
10364 #~ "lo      address family: 10 (AF_INET6)\n"
10365 #~ "        address: E<lt>::1E<gt>\n"
10366 #~ "eth0    address family: 10 (AF_INET6)\n"
10367 #~ "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
10368 #~ msgstr ""
10369 #~ "$ B<./a.out>\n"
10370 #~ "lo      address family: 17 (AF_PACKET)\n"
10371 #~ "eth0    address family: 17 (AF_PACKET)\n"
10372 #~ "lo      address family: 2 (AF_INET)\n"
10373 #~ "        address: E<lt>127.0.0.1E<gt>\n"
10374 #~ "eth0    address family: 2 (AF_INET)\n"
10375 #~ "        address: E<lt>10.1.1.4E<gt>\n"
10376 #~ "lo      address family: 10 (AF_INET6)\n"
10377 #~ "        address: E<lt>::1E<gt>\n"
10378 #~ "eth0    address family: 10 (AF_INET6)\n"
10379 #~ "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
10380
10381 #~ msgid "2013-04-19"
10382 #~ msgstr "2013-04-19"
10383
10384 #~ msgid "2012-08-03"
10385 #~ msgstr "2012-08-03"
10386
10387 #~ msgid "2012-04-23"
10388 #~ msgstr "2012-04-23"
10389
10390 #~ msgid "2012-08-17"
10391 #~ msgstr "2012-08-17"