OSDN Git Service

LDP: Update POT and ja.po to LDP v3.75
[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: 2015-01-01 22:50+0900\n"
10 "PO-Revision-Date: 2014-06-08 01:37+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:58 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:58
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:59
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:61
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:65
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:408 build/C/man2/recvmmsg.2:148
310 #: build/C/man2/select.2:300 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:294 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:424 build/C/man2/recvmmsg.2:156
362 #: build/C/man2/select.2:318 build/C/man2/send.2:299
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:429 build/C/man2/send.2:315
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:176
391 #: build/C/man2/connect.2:176 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:104
393 #: build/C/man2/recv.2:438 build/C/man2/select.2:319 build/C/man2/send.2:336
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:208
417 #: build/C/man2/connect.2:182 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:447
419 #: build/C/man2/send.2:345 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:210
432 #: build/C/man2/recv.2:451 build/C/man2/select.2:324 build/C/man2/send.2:348
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:180
448 #: build/C/man2/bind.2:185 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:456
450 #: build/C/man2/recvmmsg.2:160 build/C/man2/select.2:328
451 #: build/C/man2/send.2:352 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:191
513 #: build/C/man2/connect.2:222 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:109
515 #: build/C/man2/recv.2:471 build/C/man2/send.2:381
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:114 build/C/man2/send.2:386
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:164
581 #: build/C/man2/select.2:337 build/C/man2/sendmmsg.2:145
582 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:915
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:232
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:237
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:92 build/C/man2/listen.2:119
602 #: build/C/man2/recv.2:476 build/C/man2/recvmmsg.2:169
603 #: build/C/man2/select.2:343 build/C/man2/send.2:400
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 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に "
647 "B<accept>()  が返したソケットに対して全ての必要なフラグを明示的に設定するよう"
648 "に すべきである。"
649
650 #. type: SH
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:244
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:253
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:124
655 #: build/C/man2/recv.2:486 build/C/man2/select.2:358
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:414
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:929
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:250
666 #: build/C/man2/connect.2:259 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:150 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 msgid ""
683 "There may not always be a connection waiting after a B<SIGIO> is delivered "
684 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
685 "connection might have been removed by an asynchronous network error or "
686 "another thread before B<accept>()  is called.  If this happens, then the "
687 "call will block waiting for the next connection to arrive.  To ensure that "
688 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
689 "B<O_NONBLOCK> flag set (see B<socket>(7))."
690 msgstr ""
691 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
692 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
693 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
694 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
695 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
696 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
697 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
698 "見よ)。"
699
700 #. type: SS
701 #: build/C/man2/accept.2:351
702 #, no-wrap
703 msgid "The socklen_t type"
704 msgstr "socklen_t 型"
705
706 #. type: Plain text
707 #: build/C/man2/accept.2:361
708 msgid ""
709 "The third argument of B<accept>()  was originally declared as an I<int *> "
710 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
711 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
712 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
713 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
714 "Torvalds:"
715 msgstr ""
716 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
717 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
718 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
719 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
720 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
721 "た。 Linus Torvald の発言を引用する:"
722
723 #.  .I fails: only italicizes a single line
724 #. type: Plain text
725 #: build/C/man2/accept.2:378
726 msgid ""
727 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
728 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
729 "make it a size_t, and I (and hopefully others, but obviously not too many) "
730 "complained to them very loudly indeed.  Making it a size_t is completely "
731 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
732 "bit architectures, for example.  And it I<has> to be the same size as \"int"
733 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
734 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
735 "have touched it in the first place, but once they did they felt it had to "
736 "have a named type for some unfathomable reason (probably somebody didn't "
737 "like losing face over having done the original stupid thing, so they "
738 "silently just renamed their blunder).\""
739 msgstr ""
740 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
741 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
742 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
743 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
744 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
745 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
746 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
747 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
748 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
749 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
750 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
751 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
752 "う)。」"
753
754 #. type: SH
755 #: build/C/man2/accept.2:378 build/C/man2/bind.2:264
756 #: build/C/man2/connect.2:276 build/C/man3/getifaddrs.3:207
757 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:179
758 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:172
759 #: build/C/man2/select.2:549 build/C/man2/select_tut.2:529
760 #: build/C/man2/send.2:438 build/C/man2/sendmmsg.2:168
761 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:381
762 #, no-wrap
763 msgid "EXAMPLE"
764 msgstr "例"
765
766 #. type: Plain text
767 #: build/C/man2/accept.2:381 build/C/man2/listen.2:182
768 msgid "See B<bind>(2)."
769 msgstr "B<bind>(2)  参照。"
770
771 #. type: SH
772 #: build/C/man2/accept.2:381 build/C/man2/bind.2:329
773 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:281
774 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
775 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
776 #: build/C/man3/if_nametoindex.3:96 build/C/man2/listen.2:182
777 #: build/C/man2/recv.2:516 build/C/man2/recvmmsg.2:278
778 #: build/C/man2/select.2:586 build/C/man2/select_tut.2:821
779 #: build/C/man2/send.2:443 build/C/man2/sendmmsg.2:236
780 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:386
781 #: build/C/man7/socket.7:960 build/C/man2/socketcall.2:53
782 #: build/C/man2/socketpair.2:124
783 #, no-wrap
784 msgid "SEE ALSO"
785 msgstr "関連項目"
786
787 #. type: Plain text
788 #: build/C/man2/accept.2:388
789 msgid ""
790 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
791 "B<socket>(7)"
792 msgstr ""
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<socket>(7)"
795
796 #. type: SH
797 #: build/C/man2/accept.2:388 build/C/man2/bind.2:342
798 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:288
799 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
800 #: build/C/man2/getsockopt.2:213 build/C/man3/if_nameindex.3:154
801 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:188
802 #: build/C/man2/recv.2:527 build/C/man2/recvmmsg.2:285
803 #: build/C/man2/select.2:600 build/C/man2/select_tut.2:840
804 #: build/C/man2/send.2:458 build/C/man2/sendmmsg.2:241
805 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:415
806 #: build/C/man7/socket.7:972 build/C/man2/socketcall.2:71
807 #: build/C/man2/socketpair.2:131
808 #, no-wrap
809 msgid "COLOPHON"
810 msgstr "この文書について"
811
812 #. type: Plain text
813 #: build/C/man2/accept.2:396 build/C/man2/bind.2:350
814 #: build/C/man3/bindresvport.3:124 build/C/man2/connect.2:296
815 #: build/C/man3/getifaddrs.3:323 build/C/man2/getsockname.2:129
816 #: build/C/man2/getsockopt.2:221 build/C/man3/if_nameindex.3:162
817 #: build/C/man3/if_nametoindex.3:108 build/C/man2/listen.2:196
818 #: build/C/man2/recv.2:535 build/C/man2/recvmmsg.2:293
819 #: build/C/man2/select.2:608 build/C/man2/select_tut.2:848
820 #: build/C/man2/send.2:466 build/C/man2/sendmmsg.2:249
821 #: build/C/man3/sockatmark.3:152 build/C/man2/socket.2:423
822 #: build/C/man7/socket.7:980 build/C/man2/socketcall.2:79
823 #: build/C/man2/socketpair.2:139
824 #, fuzzy
825 #| msgid ""
826 #| "This page is part of release 3.68 of the Linux I<man-pages> project.  A "
827 #| "description of the project, information about reporting bugs, and the "
828 #| "latest version of this page, can be found at \\%http://www.kernel.org/doc/"
829 #| "man-pages/."
830 msgid ""
831 "This page is part of release 3.75 of the Linux I<man-pages> project.  A "
832 "description of the project, information about reporting bugs, and the latest "
833 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
834 "pages/."
835 msgstr ""
836 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.68 の一部\n"
837 "である。プロジェクトの説明とバグ報告に関する情報は\n"
838 "http://www.kernel.org/doc/man-pages/ に書かれている。"
839
840 #. type: TH
841 #: build/C/man2/bind.2:68
842 #, no-wrap
843 msgid "BIND"
844 msgstr "BIND"
845
846 #. type: TH
847 #: build/C/man2/bind.2:68 build/C/man2/recv.2:41 build/C/man2/select.2:38
848 #: build/C/man2/send.2:40
849 #, fuzzy, no-wrap
850 #| msgid "2014-05-10"
851 msgid "2014-08-19"
852 msgstr "2014-05-10"
853
854 #. type: Plain text
855 #: build/C/man2/bind.2:71
856 msgid "bind - bind a name to a socket"
857 msgstr "bind - ソケットに名前をつける"
858
859 #. type: Plain text
860 #: build/C/man2/bind.2:78
861 #, no-wrap
862 msgid ""
863 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
864 "B<         socklen_t >I<addrlen>B<);>\n"
865 msgstr ""
866 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
867 "B<         socklen_t >I<addrlen>B<);>\n"
868
869 #. type: Plain text
870 #: build/C/man2/bind.2:92
871 msgid ""
872 "When a socket is created with B<socket>(2), it exists in a name space "
873 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
874 "address specified by I<addr> to the socket referred to by the file "
875 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
876 "address structure pointed to by I<addr>.  Traditionally, this operation is "
877 "called \\(lqassigning a name to a socket\\(rq."
878 msgstr ""
879 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
880 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
881 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
882 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
883 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
884 "る。"
885
886 #. type: Plain text
887 #: build/C/man2/bind.2:99
888 msgid ""
889 "It is normally necessary to assign a local address using B<bind>()  before a "
890 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
891 msgstr ""
892 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
893 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
894 "る。"
895
896 #. type: Plain text
897 #: build/C/man2/bind.2:130
898 msgid ""
899 "The rules used in name binding vary between address families.  Consult the "
900 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
901 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
902 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
903 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
904 msgstr ""
905 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
906 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
907 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は "
908 "B<ddp>(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  "
909 "を、 B<AF_NETLINK> は B<netlink>(7)  を参照。"
910
911 #. type: Plain text
912 #: build/C/man2/bind.2:137
913 msgid ""
914 "The actual structure passed for the I<addr> argument will depend on the "
915 "address family.  The I<sockaddr> structure is defined as something like:"
916 msgstr ""
917 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
918 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
919
920 #. type: Plain text
921 #: build/C/man2/bind.2:144
922 #, no-wrap
923 msgid ""
924 "struct sockaddr {\n"
925 "    sa_family_t sa_family;\n"
926 "    char        sa_data[14];\n"
927 "}\n"
928 msgstr ""
929 "struct sockaddr {\n"
930 "    sa_family_t sa_family;\n"
931 "    char        sa_data[14];\n"
932 "}\n"
933
934 #. type: Plain text
935 #: build/C/man2/bind.2:152
936 msgid ""
937 "The only purpose of this structure is to cast the structure pointer passed "
938 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
939 msgstr ""
940 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
941 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
942
943 #. type: Plain text
944 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
945 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
946 #: build/C/man2/socketpair.2:74
947 msgid ""
948 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
949 "appropriately."
950 msgstr ""
951 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
952 "設定される。"
953
954 #. type: TP
955 #: build/C/man2/bind.2:158 build/C/man2/bind.2:199
956 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
957 #: build/C/man2/send.2:304 build/C/man2/socket.2:316
958 #, no-wrap
959 msgid "B<EACCES>"
960 msgstr "B<EACCES>"
961
962 #.  e.g., privileged port in AF_INET domain
963 #. type: Plain text
964 #: build/C/man2/bind.2:162
965 msgid "The address is protected, and the user is not the superuser."
966 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
967
968 #. type: TP
969 #: build/C/man2/bind.2:162 build/C/man2/bind.2:165
970 #: build/C/man3/bindresvport.3:82 build/C/man2/connect.2:148
971 #: build/C/man2/listen.2:88 build/C/man2/listen.2:91
972 #, no-wrap
973 msgid "B<EADDRINUSE>"
974 msgstr "B<EADDRINUSE>"
975
976 #. type: Plain text
977 #: build/C/man2/bind.2:165
978 msgid "The given address is already in use."
979 msgstr "指定されたアドレスが既に使用中である。"
980
981 #. type: Plain text
982 #: build/C/man2/bind.2:175
983 msgid ""
984 "(Internet domain sockets)  The port number was specified as zero in the "
985 "socket address structure, but, upon attempting to bind to an ephemeral port, "
986 "it was determined that all port numbers in the ephemeral port range are "
987 "currently in use.  See the discussion of I</proc/sys/net/ipv4/"
988 "ip_local_port_range> B<ip>(7)."
989 msgstr ""
990 "(インターネットドメインソケットの場合) ソケットアドレス構造体でポート番号に "
991 "0 が指定されたが、 一時ポート (ephemeral port) を割り当てようとした際に、 一"
992 "時ポートとして使用する範囲のすべてのポート番号が使用中であった。 B<ip>(7) の "
993 "I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照。"
994
995 #. type: Plain text
996 #: build/C/man2/bind.2:180
997 msgid "I<sockfd> is not a valid descriptor."
998 msgstr "I<sockfd> が不正なディスクリプタである。"
999
1000 #.  This may change in the future: see
1001 #.  .I linux/unix/sock.c for details.
1002 #. type: Plain text
1003 #: build/C/man2/bind.2:185
1004 msgid "The socket is already bound to an address."
1005 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
1006
1007 #. type: Plain text
1008 #: build/C/man2/bind.2:191
1009 msgid ""
1010 "I<addrlen> is wrong, or I<addr> is not a valid address for this socket's "
1011 "domain."
1012 msgstr ""
1013
1014 #. type: Plain text
1015 #: build/C/man2/bind.2:195
1016 msgid "I<sockfd> is a descriptor for a file, not a socket."
1017 msgstr ""
1018 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
1019
1020 #. type: Plain text
1021 #: build/C/man2/bind.2:199
1022 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1023 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1024
1025 #. type: Plain text
1026 #: build/C/man2/bind.2:204
1027 msgid ""
1028 "Search permission is denied on a component of the path prefix.  (See also "
1029 "B<path_resolution>(7).)"
1030 msgstr ""
1031 "パス名の構成要素に検索許可 (search permission) がない "
1032 "(B<path_resolution>(7)  も参照すること)。"
1033
1034 #. type: TP
1035 #: build/C/man2/bind.2:204 build/C/man2/connect.2:151
1036 #, no-wrap
1037 msgid "B<EADDRNOTAVAIL>"
1038 msgstr "B<EADDRNOTAVAIL>"
1039
1040 #. type: Plain text
1041 #: build/C/man2/bind.2:208
1042 msgid ""
1043 "A nonexistent interface was requested or the requested address was not local."
1044 msgstr ""
1045 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1046 "かった。"
1047
1048 #. type: Plain text
1049 #: build/C/man2/bind.2:212
1050 msgid "I<addr> points outside the user's accessible address space."
1051 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1052
1053 #. type: TP
1054 #: build/C/man2/bind.2:212
1055 #, no-wrap
1056 msgid "B<ELOOP>"
1057 msgstr "B<ELOOP>"
1058
1059 #. type: Plain text
1060 #: build/C/man2/bind.2:216
1061 msgid "Too many symbolic links were encountered in resolving I<addr>."
1062 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1063
1064 #. type: TP
1065 #: build/C/man2/bind.2:216
1066 #, no-wrap
1067 msgid "B<ENAMETOOLONG>"
1068 msgstr "B<ENAMETOOLONG>"
1069
1070 #. type: Plain text
1071 #: build/C/man2/bind.2:220
1072 msgid "I<addr> is too long."
1073 msgstr "I<addr> が長過ぎる。"
1074
1075 #. type: TP
1076 #: build/C/man2/bind.2:220
1077 #, no-wrap
1078 msgid "B<ENOENT>"
1079 msgstr "B<ENOENT>"
1080
1081 #. type: Plain text
1082 #: build/C/man2/bind.2:223
1083 msgid "The file does not exist."
1084 msgstr "ファイルが存在しない。"
1085
1086 #. type: TP
1087 #: build/C/man2/bind.2:223 build/C/man2/recv.2:460 build/C/man2/select.2:334
1088 #: build/C/man2/send.2:375
1089 #, no-wrap
1090 msgid "B<ENOMEM>"
1091 msgstr "B<ENOMEM>"
1092
1093 #. type: Plain text
1094 #: build/C/man2/bind.2:226
1095 msgid "Insufficient kernel memory was available."
1096 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1097
1098 #. type: TP
1099 #: build/C/man2/bind.2:226
1100 #, no-wrap
1101 msgid "B<ENOTDIR>"
1102 msgstr "B<ENOTDIR>"
1103
1104 #. type: Plain text
1105 #: build/C/man2/bind.2:229
1106 msgid "A component of the path prefix is not a directory."
1107 msgstr "パス名の構成要素がディレクトリではない。"
1108
1109 #. type: TP
1110 #: build/C/man2/bind.2:229
1111 #, no-wrap
1112 msgid "B<EROFS>"
1113 msgstr "B<EROFS>"
1114
1115 #. type: Plain text
1116 #: build/C/man2/bind.2:232
1117 msgid "The socket inode would reside on a read-only filesystem."
1118 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1119
1120 #.  SVr4 documents an additional
1121 #.  .B ENOSR
1122 #.  general error condition, and
1123 #.  additional
1124 #.  .B EIO
1125 #.  and
1126 #.  .B EISDIR
1127 #.  UNIX-domain error conditions.
1128 #. type: Plain text
1129 #: build/C/man2/bind.2:244
1130 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1131 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1132
1133 #. type: Plain text
1134 #: build/C/man2/bind.2:261
1135 msgid ""
1136 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1137 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1138 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1139 msgstr ""
1140 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1141 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1142 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1143
1144 #. type: SH
1145 #: build/C/man2/bind.2:261 build/C/man2/getsockopt.2:199
1146 #: build/C/man2/recvmmsg.2:267 build/C/man2/select.2:486
1147 #: build/C/man2/send.2:433 build/C/man3/sockatmark.3:100
1148 #: build/C/man7/socket.7:947
1149 #, no-wrap
1150 msgid "BUGS"
1151 msgstr "バグ"
1152
1153 #.  FIXME Document transparent proxy options
1154 #. type: Plain text
1155 #: build/C/man2/bind.2:264
1156 msgid "The transparent proxy options are not described."
1157 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1158
1159 #. type: Plain text
1160 #: build/C/man2/bind.2:269
1161 msgid ""
1162 "An example of the use of B<bind>()  with Internet domain sockets can be "
1163 "found in B<getaddrinfo>(3)."
1164 msgstr ""
1165 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が "
1166 "B<getaddrinfo>(3)  に記載されている。"
1167
1168 #.  listen.7 refers to this example.
1169 #.  accept.7 refers to this example.
1170 #.  unix.7 refers to this example.
1171 #. type: Plain text
1172 #: build/C/man2/bind.2:276
1173 msgid ""
1174 "The following example shows how to bind a stream socket in the UNIX "
1175 "(B<AF_UNIX>)  domain, and accept connections:"
1176 msgstr ""
1177 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1178 "を示したものである。"
1179
1180 #. type: Plain text
1181 #: build/C/man2/bind.2:283
1182 #, no-wrap
1183 msgid ""
1184 "#include E<lt>sys/socket.hE<gt>\n"
1185 "#include E<lt>sys/un.hE<gt>\n"
1186 "#include E<lt>stdlib.hE<gt>\n"
1187 "#include E<lt>stdio.hE<gt>\n"
1188 "#include E<lt>string.hE<gt>\n"
1189 msgstr ""
1190 "#include E<lt>sys/socket.hE<gt>\n"
1191 "#include E<lt>sys/un.hE<gt>\n"
1192 "#include E<lt>stdlib.hE<gt>\n"
1193 "#include E<lt>stdio.hE<gt>\n"
1194 "#include E<lt>string.hE<gt>\n"
1195
1196 #. type: Plain text
1197 #: build/C/man2/bind.2:286
1198 #, no-wrap
1199 msgid ""
1200 "#define MY_SOCK_PATH \"/somepath\"\n"
1201 "#define LISTEN_BACKLOG 50\n"
1202 msgstr ""
1203 "#define MY_SOCK_PATH \"/somepath\"\n"
1204 "#define LISTEN_BACKLOG 50\n"
1205
1206 #. type: Plain text
1207 #: build/C/man2/bind.2:289
1208 #, no-wrap
1209 msgid ""
1210 "#define handle_error(msg) \\e\n"
1211 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1212 msgstr ""
1213 "#define handle_error(msg) \\e\n"
1214 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1215
1216 #. type: Plain text
1217 #: build/C/man2/bind.2:296
1218 #, no-wrap
1219 msgid ""
1220 "int\n"
1221 "main(int argc, char *argv[])\n"
1222 "{\n"
1223 "    int sfd, cfd;\n"
1224 "    struct sockaddr_un my_addr, peer_addr;\n"
1225 "    socklen_t peer_addr_size;\n"
1226 msgstr ""
1227 "int\n"
1228 "main(int argc, char *argv[])\n"
1229 "{\n"
1230 "    int sfd, cfd;\n"
1231 "    struct sockaddr_un my_addr, peer_addr;\n"
1232 "    socklen_t peer_addr_size;\n"
1233
1234 #. type: Plain text
1235 #: build/C/man2/bind.2:300
1236 #, no-wrap
1237 msgid ""
1238 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1239 "    if (sfd == -1)\n"
1240 "        handle_error(\"socket\");\n"
1241 msgstr ""
1242 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1243 "    if (sfd == -1)\n"
1244 "        handle_error(\"socket\");\n"
1245
1246 #. type: Plain text
1247 #: build/C/man2/bind.2:306
1248 #, no-wrap
1249 msgid ""
1250 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1251 "                        /* Clear structure */\n"
1252 "    my_addr.sun_family = AF_UNIX;\n"
1253 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1254 "            sizeof(my_addr.sun_path) - 1);\n"
1255 msgstr ""
1256 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1257 "                        /* Clear structure */\n"
1258 "    my_addr.sun_family = AF_UNIX;\n"
1259 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1260 "            sizeof(my_addr.sun_path) - 1);\n"
1261
1262 #. type: Plain text
1263 #: build/C/man2/bind.2:310
1264 #, no-wrap
1265 msgid ""
1266 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1267 "            sizeof(struct sockaddr_un)) == -1)\n"
1268 "        handle_error(\"bind\");\n"
1269 msgstr ""
1270 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1271 "            sizeof(struct sockaddr_un)) == -1)\n"
1272 "        handle_error(\"bind\");\n"
1273
1274 #. type: Plain text
1275 #: build/C/man2/bind.2:313
1276 #, no-wrap
1277 msgid ""
1278 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1279 "        handle_error(\"listen\");\n"
1280 msgstr ""
1281 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1282 "        handle_error(\"listen\");\n"
1283
1284 #. type: Plain text
1285 #: build/C/man2/bind.2:316
1286 #, no-wrap
1287 msgid ""
1288 "    /* Now we can accept incoming connections one\n"
1289 "       at a time using accept(2) */\n"
1290 msgstr ""
1291 "    /* Now we can accept incoming connections one\n"
1292 "       at a time using accept(2) */\n"
1293
1294 #. type: Plain text
1295 #: build/C/man2/bind.2:322
1296 #, no-wrap
1297 msgid ""
1298 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1299 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1300 "                 &peer_addr_size);\n"
1301 "    if (cfd == -1)\n"
1302 "        handle_error(\"accept\");\n"
1303 msgstr ""
1304 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1305 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1306 "                 &peer_addr_size)\n"
1307 "    if (cfd == -1)\n"
1308 "        handle_error(\"accept\");\n"
1309
1310 #. type: Plain text
1311 #: build/C/man2/bind.2:324
1312 #, no-wrap
1313 msgid "    /* Code to deal with incoming connection(s)... */\n"
1314 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1315
1316 #. type: Plain text
1317 #: build/C/man2/bind.2:328
1318 #, no-wrap
1319 msgid ""
1320 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1321 "       should be deleted using unlink(2) or remove(3) */\n"
1322 "}\n"
1323 msgstr ""
1324 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1325 "       should be deleted using unlink(2) or remove(3) */\n"
1326 "}\n"
1327
1328 #. type: Plain text
1329 #: build/C/man2/bind.2:342
1330 msgid ""
1331 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1332 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1333 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1334 msgstr ""
1335 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1336 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1337 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1338
1339 #. type: TH
1340 #: build/C/man3/bindresvport.3:30
1341 #, no-wrap
1342 msgid "BINDRESVPORT"
1343 msgstr "BINDRESVPORT"
1344
1345 #. type: TH
1346 #: build/C/man3/bindresvport.3:30
1347 #, no-wrap
1348 msgid "2013-06-21"
1349 msgstr "2013-06-21"
1350
1351 #. type: Plain text
1352 #: build/C/man3/bindresvport.3:33
1353 msgid "bindresvport - bind a socket to a privileged IP port"
1354 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1355
1356 #. type: Plain text
1357 #: build/C/man3/bindresvport.3:37
1358 #, no-wrap
1359 msgid ""
1360 "B<#include E<lt>sys/types.hE<gt>>\n"
1361 "B<#include E<lt>netinet/in.hE<gt>>\n"
1362 msgstr ""
1363 "B<#include E<lt>sys/types.hE<gt>>\n"
1364 "B<#include E<lt>netinet/in.hE<gt>>\n"
1365
1366 #. type: Plain text
1367 #: build/C/man3/bindresvport.3:39
1368 #, no-wrap
1369 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1370 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1371
1372 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1373 #. type: Plain text
1374 #: build/C/man3/bindresvport.3:46
1375 msgid ""
1376 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1377 "anonymous IP port, that is, a port number arbitrarily selected from the "
1378 "range 512 to 1023."
1379 msgstr ""
1380 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1381 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1382 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1383
1384 #. type: Plain text
1385 #: build/C/man3/bindresvport.3:56
1386 msgid ""
1387 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1388 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1389 "allocated."
1390 msgstr ""
1391 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1392 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1393 "される。"
1394
1395 #. type: Plain text
1396 #: build/C/man3/bindresvport.3:67
1397 msgid ""
1398 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1399 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1400 "return the port number actually allocated.  (This information can later be "
1401 "obtained using B<getsockname>(2).)"
1402 msgstr ""
1403 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1404 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 "
1405 "B<bindresvport>()  は実際に割り当てられたポート番号を返す手段を持たない (割り"
1406 "当てられたポート番号は、後で B<getsockname>(2)  を使って取得できる)。"
1407
1408 #. type: Plain text
1409 #: build/C/man3/bindresvport.3:72
1410 msgid ""
1411 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1412 "I<errno> set to indicate the cause of the error."
1413 msgstr ""
1414 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1415 "I<errno> にエラーの原因を示す値を設定する。"
1416
1417 #. type: Plain text
1418 #: build/C/man3/bindresvport.3:77
1419 msgid ""
1420 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1421 "addition, the following errors may occur:"
1422 msgstr ""
1423 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1424 "以下のエラーが発生することがある:"
1425
1426 #. type: Plain text
1427 #: build/C/man3/bindresvport.3:82
1428 msgid ""
1429 "The caller did not have superuser privilege (to be precise: the "
1430 "B<CAP_NET_BIND_SERVICE> capability is required)."
1431 msgstr ""
1432 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1433 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1434
1435 #. type: Plain text
1436 #: build/C/man3/bindresvport.3:85
1437 msgid "All privileged ports are in use."
1438 msgstr "全ての特権ポートが使用中である。"
1439
1440 #. type: TP
1441 #: build/C/man3/bindresvport.3:85
1442 #, no-wrap
1443 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1444 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1445
1446 #. type: Plain text
1447 #: build/C/man3/bindresvport.3:92
1448 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1449 msgstr ""
1450 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1451
1452 #. type: SH
1453 #: build/C/man3/bindresvport.3:92 build/C/man3/if_nametoindex.3:85
1454 #: build/C/man3/sockatmark.3:73
1455 #, no-wrap
1456 msgid "ATTRIBUTES"
1457 msgstr "属性"
1458
1459 #. type: SS
1460 #: build/C/man3/bindresvport.3:93 build/C/man3/if_nametoindex.3:86
1461 #: build/C/man3/sockatmark.3:74
1462 #, no-wrap
1463 msgid "Multithreading (see pthreads(7))"
1464 msgstr "マルチスレッディング (pthreads(7) 参照)"
1465
1466 #. type: Plain text
1467 #: build/C/man3/bindresvport.3:98
1468 msgid ""
1469 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1470 "that is not protected, so it is not thread-safe."
1471 msgstr ""
1472 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1473 "静的変数を使用しているため、スレッドセーフではない。"
1474
1475 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1476 #. type: Plain text
1477 #: build/C/man3/bindresvport.3:104
1478 #, fuzzy
1479 #| msgid ""
1480 #| "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1481 #| "static variable, so it is thread-safe."
1482 msgid ""
1483 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect the "
1484 "static variable, so it is thread-safe."
1485 msgstr ""
1486 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1487 "ており、スレッドセーフである。"
1488
1489 #. type: Plain text
1490 #: build/C/man3/bindresvport.3:107
1491 msgid ""
1492 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1493 msgstr ""
1494 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1495
1496 #. type: Plain text
1497 #: build/C/man3/bindresvport.3:113
1498 msgid ""
1499 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1500 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1501 msgstr ""
1502 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1503 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1504
1505 #. type: Plain text
1506 #: build/C/man3/bindresvport.3:116
1507 msgid "B<bind>(2), B<getsockname>(2)"
1508 msgstr "B<bind>(2), B<getsockname>(2)"
1509
1510 #. type: TH
1511 #: build/C/man2/connect.2:67
1512 #, no-wrap
1513 msgid "CONNECT"
1514 msgstr "CONNECT"
1515
1516 #. type: TH
1517 #: build/C/man2/connect.2:67
1518 #, fuzzy, no-wrap
1519 #| msgid "2014-05-10"
1520 msgid "2014-09-06"
1521 msgstr "2014-05-10"
1522
1523 #. type: Plain text
1524 #: build/C/man2/connect.2:70
1525 msgid "connect - initiate a connection on a socket"
1526 msgstr "connect - ソケットの接続を行う"
1527
1528 #. type: Plain text
1529 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1530 #: build/C/man2/listen.2:51
1531 #, no-wrap
1532 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1533 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1534
1535 #. type: Plain text
1536 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1537 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1538 #: build/C/man2/recv.2:51
1539 #, no-wrap
1540 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1541 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1542
1543 #. type: Plain text
1544 #: build/C/man2/connect.2:78
1545 #, no-wrap
1546 msgid ""
1547 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1548 "B<            socklen_t >I<addrlen>B<);>\n"
1549 msgstr ""
1550 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1551 "B<            socklen_t >I<addrlen>B<);>\n"
1552
1553 #. type: Plain text
1554 #: build/C/man2/connect.2:97
1555 msgid ""
1556 "The B<connect>()  system call connects the socket referred to by the file "
1557 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1558 "argument specifies the size of I<addr>.  The format of the address in "
1559 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1560 "B<socket>(2)  for further details."
1561 msgstr ""
1562 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1563 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1564 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1565 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1566 "こと。"
1567
1568 #. type: Plain text
1569 #: build/C/man2/connect.2:113
1570 msgid ""
1571 "If the socket I<sockfd> is of type B<SOCK_DGRAM>, then I<addr> is the "
1572 "address to which datagrams are sent by default, and the only address from "
1573 "which datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1574 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1575 "that is bound to the address specified by I<addr>."
1576 msgstr ""
1577 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1578 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1579 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1580 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1581 "に対する接続の 作成を試みる。"
1582
1583 #. type: Plain text
1584 #: build/C/man2/connect.2:127
1585 msgid ""
1586 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1587 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1588 "times to change their association.  Connectionless sockets may dissolve the "
1589 "association by connecting to an address with the I<sa_family> member of "
1590 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1591 msgstr ""
1592 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ "
1593 "B<connect>()  が成功する。 コネクションレス (connectionless) プロトコルでは対"
1594 "応を変更するために何度も B<connect>()  を使用できる。 非接続ソケットは "
1595 "I<sockaddr> の I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アド"
1596 "レスの対応を解消することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux で"
1597 "サポート)。"
1598
1599 #. type: Plain text
1600 #: build/C/man2/connect.2:132
1601 msgid ""
1602 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1603 "returned, and I<errno> is set appropriately."
1604 msgstr ""
1605 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1606 "適切な値を設定する。"
1607
1608 #. type: Plain text
1609 #: build/C/man2/connect.2:135
1610 msgid ""
1611 "The following are general socket errors only.  There may be other domain-"
1612 "specific error codes."
1613 msgstr ""
1614 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1615 "する可能性がある。"
1616
1617 #. type: Plain text
1618 #: build/C/man2/connect.2:143
1619 msgid ""
1620 "For UNIX domain sockets, which are identified by pathname: Write permission "
1621 "is denied on the socket file, or search permission is denied for one of the "
1622 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1623 msgstr ""
1624 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1625 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1626 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1627
1628 #. type: TP
1629 #: build/C/man2/connect.2:143
1630 #, no-wrap
1631 msgid "B<EACCES>, B<EPERM>"
1632 msgstr "B<EACCES>, B<EPERM>"
1633
1634 #. type: Plain text
1635 #: build/C/man2/connect.2:148
1636 msgid ""
1637 "The user tried to connect to a broadcast address without having the socket "
1638 "broadcast flag enabled or the connection request failed because of a local "
1639 "firewall rule."
1640 msgstr ""
1641 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1642 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1643 "要求が失敗した。"
1644
1645 #. type: Plain text
1646 #: build/C/man2/connect.2:151
1647 msgid "Local address is already in use."
1648 msgstr "ローカルアドレスが既に使用されている。"
1649
1650 #. type: Plain text
1651 #: build/C/man2/connect.2:164 build/C/man2/listen.2:104
1652 msgid ""
1653 "(Internet domain sockets)  The socket referred to by I<sockfd> had not "
1654 "previously been bound to an address and, upon attempting to bind it to an "
1655 "ephemeral port, it was determined that all port numbers in the ephemeral "
1656 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
1657 "ip_local_port_range> in B<ip>(7)."
1658 msgstr ""
1659 "(インターネットドメインソケットの場合) I<sockfd> が参照するソケットがそれ以前"
1660 "にアドレスにバインドされておらず、 そのソケットに一時ポートをバインドしようと"
1661 "した際に、 一時ポートとして使用する範囲のポート番号がすべて使用中であった。 "
1662 "B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照のこと。"
1663
1664 #. type: TP
1665 #: build/C/man2/connect.2:164 build/C/man2/socket.2:320
1666 #: build/C/man2/socketpair.2:75
1667 #, no-wrap
1668 msgid "B<EAFNOSUPPORT>"
1669 msgstr "B<EAFNOSUPPORT>"
1670
1671 #. type: Plain text
1672 #: build/C/man2/connect.2:169
1673 msgid ""
1674 "The passed address didn't have the correct address family in its "
1675 "I<sa_family> field."
1676 msgstr ""
1677 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1678 "い。"
1679
1680 #. type: TP
1681 #: build/C/man2/connect.2:169 build/C/man2/send.2:323
1682 #, no-wrap
1683 msgid "B<EAGAIN>"
1684 msgstr "B<EAGAIN>"
1685
1686 #. type: Plain text
1687 #: build/C/man2/connect.2:172
1688 msgid "Insufficient entries in the routing cache."
1689 msgstr "ルーティングキャッシュにエントリーが十分にない。"
1690
1691 #. type: TP
1692 #: build/C/man2/connect.2:172
1693 #, no-wrap
1694 msgid "B<EALREADY>"
1695 msgstr "B<EALREADY>"
1696
1697 #. type: Plain text
1698 #: build/C/man2/connect.2:176
1699 msgid ""
1700 "The socket is nonblocking and a previous connection attempt has not yet been "
1701 "completed."
1702 msgstr ""
1703 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1704
1705 #. type: Plain text
1706 #: build/C/man2/connect.2:179
1707 msgid "The file descriptor is not a valid index in the descriptor table."
1708 msgstr ""
1709 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1710 "い。"
1711
1712 #. type: TP
1713 #: build/C/man2/connect.2:179 build/C/man2/recv.2:443
1714 #, no-wrap
1715 msgid "B<ECONNREFUSED>"
1716 msgstr "B<ECONNREFUSED>"
1717
1718 #. type: Plain text
1719 #: build/C/man2/connect.2:182
1720 msgid "No-one listening on the remote address."
1721 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1722
1723 #. type: Plain text
1724 #: build/C/man2/connect.2:185
1725 msgid "The socket structure address is outside the user's address space."
1726 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1727
1728 #. type: TP
1729 #: build/C/man2/connect.2:185
1730 #, no-wrap
1731 msgid "B<EINPROGRESS>"
1732 msgstr "B<EINPROGRESS>"
1733
1734 #. type: Plain text
1735 #: build/C/man2/connect.2:210
1736 msgid ""
1737 "The socket is nonblocking and the connection cannot be completed "
1738 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1739 "by selecting the socket for writing.  After B<select>(2)  indicates "
1740 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1741 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1742 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1743 "error codes listed here, explaining the reason for the failure)."
1744 msgstr ""
1745 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1746 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1747 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1748 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1749 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1750 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1751 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1752 "の原因が分かる。"
1753
1754 #.  For TCP, the connection will complete asynchronously.
1755 #.  See http://lkml.org/lkml/2005/7/12/254
1756 #. type: Plain text
1757 #: build/C/man2/connect.2:216
1758 msgid ""
1759 "The system call was interrupted by a signal that was caught; see "
1760 "B<signal>(7)."
1761 msgstr ""
1762 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1763
1764 #. type: TP
1765 #: build/C/man2/connect.2:216 build/C/man2/send.2:355
1766 #, no-wrap
1767 msgid "B<EISCONN>"
1768 msgstr "B<EISCONN>"
1769
1770 #. type: Plain text
1771 #: build/C/man2/connect.2:219
1772 msgid "The socket is already connected."
1773 msgstr "ソケットは既に接続 (connect) されている。"
1774
1775 #. type: TP
1776 #: build/C/man2/connect.2:219
1777 #, no-wrap
1778 msgid "B<ENETUNREACH>"
1779 msgstr "B<ENETUNREACH>"
1780
1781 #. type: Plain text
1782 #: build/C/man2/connect.2:222
1783 msgid "Network is unreachable."
1784 msgstr "到達できないネットワークである。"
1785
1786 #. type: Plain text
1787 #: build/C/man2/connect.2:225
1788 msgid "The file descriptor is not associated with a socket."
1789 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1790
1791 #. type: TP
1792 #: build/C/man2/connect.2:225
1793 #, fuzzy, no-wrap
1794 #| msgid "B<EPROTO>"
1795 msgid "B<EPROTOTYPE>"
1796 msgstr "B<EPROTO>"
1797
1798 #. type: Plain text
1799 #: build/C/man2/connect.2:230
1800 msgid ""
1801 "The socket type does not support the requested communications protocol.  "
1802 "This error can occur, for example, on an attempt to connect a UNIX domain "
1803 "datagram socket to a stream socket."
1804 msgstr ""
1805
1806 #. type: TP
1807 #: build/C/man2/connect.2:230
1808 #, no-wrap
1809 msgid "B<ETIMEDOUT>"
1810 msgstr "B<ETIMEDOUT>"
1811
1812 #. type: Plain text
1813 #: build/C/man2/connect.2:237
1814 msgid ""
1815 "Timeout while attempting connection.  The server may be too busy to accept "
1816 "new connections.  Note that for IP sockets the timeout may be very long when "
1817 "syncookies are enabled on the server."
1818 msgstr ""
1819 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1820 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1821 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1822 "ること。"
1823
1824 #.  SVr4 documents the additional
1825 #.  general error codes
1826 #.  .BR EADDRNOTAVAIL ,
1827 #.  .BR EINVAL ,
1828 #.  .BR EAFNOSUPPORT ,
1829 #.  .BR EALREADY ,
1830 #.  .BR EINTR ,
1831 #.  .BR EPROTOTYPE ,
1832 #.  and
1833 #.  .BR ENOSR .
1834 #.  It also
1835 #.  documents many additional error conditions not described here.
1836 #. type: Plain text
1837 #: build/C/man2/connect.2:253
1838 msgid ""
1839 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1840 "POSIX.1-2001."
1841 msgstr ""
1842 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1843
1844 #. type: Plain text
1845 #: build/C/man2/connect.2:270
1846 msgid ""
1847 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1848 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1849 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1850 msgstr ""
1851 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1852 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1853 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1854
1855 #. type: Plain text
1856 #: build/C/man2/connect.2:276
1857 msgid ""
1858 "If B<connect()> fails, consider the state of the socket as unspecified.  "
1859 "Portable applications should close the socket and create a new one for "
1860 "reconnecting."
1861 msgstr ""
1862
1863 #. type: Plain text
1864 #: build/C/man2/connect.2:281
1865 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1866 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1867
1868 #. type: Plain text
1869 #: build/C/man2/connect.2:288
1870 msgid ""
1871 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1872 "B<path_resolution>(7)"
1873 msgstr ""
1874 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1875 "B<path_resolution>(7)"
1876
1877 #. type: TH
1878 #: build/C/man3/getifaddrs.3:36
1879 #, no-wrap
1880 msgid "GETIFADDRS"
1881 msgstr "GETIFADDRS"
1882
1883 #. type: TH
1884 #: build/C/man3/getifaddrs.3:36
1885 #, no-wrap
1886 msgid "2014-02-26"
1887 msgstr "2014-02-26"
1888
1889 #. type: TH
1890 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1891 #: build/C/man3/if_nametoindex.3:25
1892 #, no-wrap
1893 msgid "GNU"
1894 msgstr "GNU"
1895
1896 #. type: Plain text
1897 #: build/C/man3/getifaddrs.3:39
1898 msgid "getifaddrs, freeifaddrs - get interface addresses"
1899 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1900
1901 #. type: Plain text
1902 #: build/C/man3/getifaddrs.3:43
1903 #, no-wrap
1904 msgid ""
1905 "B<#include E<lt>sys/types.hE<gt>>\n"
1906 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1907 msgstr ""
1908 "B<#include E<lt>sys/types.hE<gt>>\n"
1909 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1910
1911 #. type: Plain text
1912 #: build/C/man3/getifaddrs.3:45
1913 #, no-wrap
1914 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1915 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1916
1917 #. type: Plain text
1918 #: build/C/man3/getifaddrs.3:47
1919 #, no-wrap
1920 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1921 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1922
1923 #. type: Plain text
1924 #: build/C/man3/getifaddrs.3:58
1925 msgid ""
1926 "The B<getifaddrs>()  function creates a linked list of structures describing "
1927 "the network interfaces of the local system, and stores the address of the "
1928 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1929 "structures, defined as follows:"
1930 msgstr ""
1931 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1932 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1933 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1934 "うに定義されている。"
1935
1936 #. type: Plain text
1937 #: build/C/man3/getifaddrs.3:77
1938 #, no-wrap
1939 msgid ""
1940 "struct ifaddrs {\n"
1941 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1942 "    char            *ifa_name;    /* Name of interface */\n"
1943 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1944 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1945 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1946 "    union {\n"
1947 "        struct sockaddr *ifu_broadaddr;\n"
1948 "                         /* Broadcast address of interface */\n"
1949 "        struct sockaddr *ifu_dstaddr;\n"
1950 "                         /* Point-to-point destination address */\n"
1951 "    } ifa_ifu;\n"
1952 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1953 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1954 "    void            *ifa_data;    /* Address-specific data */\n"
1955 "};\n"
1956 msgstr ""
1957 "struct ifaddrs {\n"
1958 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1959 "    char            *ifa_name;    /* Name of interface */\n"
1960 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1961 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1962 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1963 "    union {\n"
1964 "        struct sockaddr *ifu_broadaddr;\n"
1965 "                         /* Broadcast address of interface */\n"
1966 "        struct sockaddr *ifu_dstaddr;\n"
1967 "                         /* Point-to-point destination address */\n"
1968 "    } ifa_ifu;\n"
1969 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1970 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1971 "    void            *ifa_data;    /* Address-specific data */\n"
1972 "};\n"
1973
1974 #. type: Plain text
1975 #: build/C/man3/getifaddrs.3:84
1976 msgid ""
1977 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1978 "or NULL if this is the last item of the list."
1979 msgstr ""
1980 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1981 "素がリストの最後の場合には NULL が入る。"
1982
1983 #.  The constant
1984 #.  .B IF NAMESIZE
1985 #.  indicates the maximum length of this field.
1986 #. type: Plain text
1987 #: build/C/man3/getifaddrs.3:91
1988 msgid "The I<ifa_name> points to the null-terminated interface name."
1989 msgstr "I<ifa_name> はヌル終端されたインターフェース名を指す。"
1990
1991 #. type: Plain text
1992 #: build/C/man3/getifaddrs.3:100
1993 msgid ""
1994 "The I<ifa_flags> field contains the interface flags, as returned by the "
1995 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1996 "these flags)."
1997 msgstr ""
1998 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1999 "ターフェースのフラグが格納される (これらのフラグのリストについては "
2000 "B<netdevice>(7) を参照)。"
2001
2002 #. type: Plain text
2003 #: build/C/man3/getifaddrs.3:109
2004 msgid ""
2005 "The I<ifa_addr> field points to a structure containing the interface "
2006 "address.  (The I<sa_family> subfield should be consulted to determine the "
2007 "format of the address structure.)  This field may contain a null pointer."
2008 msgstr ""
2009 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
2010 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
2011 "すべきである)。 このフィールドはヌルポインタとなる場合がある。"
2012
2013 #. type: Plain text
2014 #: build/C/man3/getifaddrs.3:116
2015 msgid ""
2016 "The I<ifa_netmask> field points to a structure containing the netmask "
2017 "associated with I<ifa_addr>, if applicable for the address family.  This "
2018 "field may contain a null pointer."
2019 msgstr ""
2020 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
2021 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
2022 "る。 このフィールドはヌルポインタとなる場合がある。"
2023
2024 #. type: Plain text
2025 #: build/C/man3/getifaddrs.3:131
2026 msgid ""
2027 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
2028 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
2029 "will contain the broadcast address associated with I<ifa_addr> (if "
2030 "applicable for the address family) or I<ifa_dstaddr> will contain the "
2031 "destination address of the point-to-point interface."
2032 msgstr ""
2033 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
2034 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
2035 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
2036 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
2037 "point インターフェースの宛先アドレスが入るかが決まる。"
2038
2039 #. type: Plain text
2040 #: build/C/man3/getifaddrs.3:136
2041 msgid ""
2042 "The I<ifa_data> field points to a buffer containing address-family-specific "
2043 "data; this field may be NULL if there is no such data for this interface."
2044 msgstr ""
2045 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
2046 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
2047 "フィールドは NULL となる。"
2048
2049 #. type: Plain text
2050 #: build/C/man3/getifaddrs.3:142
2051 msgid ""
2052 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
2053 "freed using B<freeifaddrs>()  when no longer needed."
2054 msgstr ""
2055 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2056 "B<freeifaddrs>() を使って解放すべきである。"
2057
2058 #. type: Plain text
2059 #: build/C/man3/getifaddrs.3:149
2060 msgid ""
2061 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2062 "I<errno> is set appropriately."
2063 msgstr ""
2064 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2065 "が適切に設定される。"
2066
2067 #. type: Plain text
2068 #: build/C/man3/getifaddrs.3:162
2069 msgid ""
2070 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2071 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), "
2072 "B<sendto>(2), B<malloc>(3), or B<realloc>(3)."
2073 msgstr ""
2074 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には "
2075 "B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), "
2076 "B<malloc>(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定され"
2077 "る。"
2078
2079 #. type: Plain text
2080 #: build/C/man3/getifaddrs.3:170
2081 msgid ""
2082 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2083 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2084 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2085 "available only on kernels that support netlink."
2086 msgstr ""
2087 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2088 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2089 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2090 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2091
2092 #.  , but the BSD-derived documentation generally
2093 #.  appears to be confused and obsolete on this point.
2094 #.  i.e., commonly it still says one of them will be NULL, even if
2095 #.  the ifa_ifu union is already present
2096 #. type: Plain text
2097 #: build/C/man3/getifaddrs.3:190
2098 msgid ""
2099 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2100 "the BSD systems, but with slightly different semantics documented"
2101 "\\(emreturning one entry per interface, not per address.  This means "
2102 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2103 "address, and no link-level address is returned if the interface has an IP "
2104 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2105 "I<ifa_dstaddr> differs on various systems."
2106 msgstr ""
2107 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2108 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2109 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2110 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2111 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2112 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2113 "どちらを選択するかを決める方法は、 システムにより異なる。"
2114
2115 #. type: Plain text
2116 #: build/C/man3/getifaddrs.3:207
2117 msgid ""
2118 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2119 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2120 "containing lower-level details about the interface and its physical layer.  "
2121 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2122 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2123 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2124 "hE<gt>>), which contains various interface attributes and statistics."
2125 msgstr ""
2126 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2127 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2128 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2129 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2130 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2131 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2132 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2133 "インターフェースの様々な属性や統計情報が入る。"
2134
2135 #. type: Plain text
2136 #: build/C/man3/getifaddrs.3:214
2137 msgid ""
2138 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2139 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2140 "system:"
2141 msgstr ""
2142 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2143 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2144
2145 #. type: Plain text
2146 #: build/C/man3/getifaddrs.3:235
2147 #, no-wrap
2148 msgid ""
2149 "$ B<./a.out>\n"
2150 "lo       AF_PACKET (17)\n"
2151 "                tx_packets =        524; rx_packets =        524\n"
2152 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2153 "wlp3s0   AF_PACKET (17)\n"
2154 "                tx_packets =     108391; rx_packets =     130245\n"
2155 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2156 "em1      AF_PACKET (17)\n"
2157 "                tx_packets =          0; rx_packets =          0\n"
2158 "                tx_bytes   =          0; rx_bytes   =          0\n"
2159 "lo       AF_INET (2)\n"
2160 "                address: E<lt>127.0.0.1E<gt>\n"
2161 "wlp3s0   AF_INET (2)\n"
2162 "                address: E<lt>192.168.235.137E<gt>\n"
2163 "lo       AF_INET6 (10)\n"
2164 "                address: E<lt>::1E<gt>\n"
2165 "wlp3s0   AF_INET6 (10)\n"
2166 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2167 msgstr ""
2168 "$ B<./a.out>\n"
2169 "lo       AF_PACKET (17)\n"
2170 "                tx_packets =        524; rx_packets =        524\n"
2171 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2172 "wlp3s0   AF_PACKET (17)\n"
2173 "                tx_packets =     108391; rx_packets =     130245\n"
2174 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2175 "em1      AF_PACKET (17)\n"
2176 "                tx_packets =          0; rx_packets =          0\n"
2177 "                tx_bytes   =          0; rx_bytes   =          0\n"
2178 "lo       AF_INET (2)\n"
2179 "                address: E<lt>127.0.0.1E<gt>\n"
2180 "wlp3s0   AF_INET (2)\n"
2181 "                address: E<lt>192.168.235.137E<gt>\n"
2182 "lo       AF_INET6 (10)\n"
2183 "                address: E<lt>::1E<gt>\n"
2184 "wlp3s0   AF_INET6 (10)\n"
2185 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2186
2187 #. type: SS
2188 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2189 #: build/C/man2/recvmmsg.2:205
2190 #, no-wrap
2191 msgid "Program source"
2192 msgstr "プログラムのソース"
2193
2194 #. type: Plain text
2195 #: build/C/man3/getifaddrs.3:249
2196 #, no-wrap
2197 msgid ""
2198 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2199 "#include E<lt>arpa/inet.hE<gt>\n"
2200 "#include E<lt>sys/socket.hE<gt>\n"
2201 "#include E<lt>netdb.hE<gt>\n"
2202 "#include E<lt>ifaddrs.hE<gt>\n"
2203 "#include E<lt>stdio.hE<gt>\n"
2204 "#include E<lt>stdlib.hE<gt>\n"
2205 "#include E<lt>unistd.hE<gt>\n"
2206 "#include E<lt>linux/if_link.hE<gt>\n"
2207 msgstr ""
2208 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2209 "#include E<lt>arpa/inet.hE<gt>\n"
2210 "#include E<lt>sys/socket.hE<gt>\n"
2211 "#include E<lt>netdb.hE<gt>\n"
2212 "#include E<lt>ifaddrs.hE<gt>\n"
2213 "#include E<lt>stdio.hE<gt>\n"
2214 "#include E<lt>stdlib.hE<gt>\n"
2215 "#include E<lt>unistd.hE<gt>\n"
2216 "#include E<lt>linux/if_link.hE<gt>\n"
2217
2218 #. type: Plain text
2219 #: build/C/man3/getifaddrs.3:255
2220 #, no-wrap
2221 msgid ""
2222 "int main(int argc, char *argv[])\n"
2223 "{\n"
2224 "    struct ifaddrs *ifaddr, *ifa;\n"
2225 "    int family, s, n;\n"
2226 "    char host[NI_MAXHOST];\n"
2227 msgstr ""
2228 "int main(int argc, char *argv[])\n"
2229 "{\n"
2230 "    struct ifaddrs *ifaddr, *ifa;\n"
2231 "    int family, s, n;\n"
2232 "    char host[NI_MAXHOST];\n"
2233
2234 #. type: Plain text
2235 #: build/C/man3/getifaddrs.3:260
2236 #, no-wrap
2237 msgid ""
2238 "    if (getifaddrs(&ifaddr) == -1) {\n"
2239 "        perror(\"getifaddrs\");\n"
2240 "        exit(EXIT_FAILURE);\n"
2241 "    }\n"
2242 msgstr ""
2243 "    if (getifaddrs(&ifaddr) == -1) {\n"
2244 "        perror(\"getifaddrs\");\n"
2245 "        exit(EXIT_FAILURE);\n"
2246 "    }\n"
2247
2248 #. type: Plain text
2249 #: build/C/man3/getifaddrs.3:263
2250 #, no-wrap
2251 msgid ""
2252 "    /* Walk through linked list, maintaining head pointer so we\n"
2253 "       can free list later */\n"
2254 msgstr ""
2255 "    /* Walk through linked list, maintaining head pointer so we\n"
2256 "       can free list later */\n"
2257
2258 #. type: Plain text
2259 #: build/C/man3/getifaddrs.3:267
2260 #, no-wrap
2261 msgid ""
2262 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2263 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2264 "            continue;\n"
2265 msgstr ""
2266 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2267 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2268 "            continue;\n"
2269
2270 #. type: Plain text
2271 #: build/C/man3/getifaddrs.3:269
2272 #, no-wrap
2273 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2274 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2275
2276 #. type: Plain text
2277 #: build/C/man3/getifaddrs.3:272
2278 #, no-wrap
2279 msgid ""
2280 "        /* Display interface name and family (including symbolic\n"
2281 "           form of the latter for the common families) */\n"
2282 msgstr ""
2283 "        /* Display interface name and family (including symbolic\n"
2284 "           form of the latter for the common families) */\n"
2285
2286 #. type: Plain text
2287 #: build/C/man3/getifaddrs.3:279
2288 #, no-wrap
2289 msgid ""
2290 "        printf(\"%-8s %s (%d)\\en\",\n"
2291 "               ifa-E<gt>ifa_name,\n"
2292 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2293 "               (family == AF_INET) ? \"AF_INET\" :\n"
2294 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2295 "               family);\n"
2296 msgstr ""
2297 "        printf(\"%-8s %s (%d)\\en\",\n"
2298 "               ifa-E<gt>ifa_name,\n"
2299 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2300 "               (family == AF_INET) ? \"AF_INET\" :\n"
2301 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2302 "               family);\n"
2303
2304 #. type: Plain text
2305 #: build/C/man3/getifaddrs.3:281
2306 #, no-wrap
2307 msgid "        /* For an AF_INET* interface address, display the address */\n"
2308 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2309
2310 #. type: Plain text
2311 #: build/C/man3/getifaddrs.3:292
2312 #, no-wrap
2313 msgid ""
2314 "        if (family == AF_INET || family == AF_INET6) {\n"
2315 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2316 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2317 "                                          sizeof(struct sockaddr_in6),\n"
2318 "                    host, NI_MAXHOST,\n"
2319 "                    NULL, 0, NI_NUMERICHOST);\n"
2320 "            if (s != 0) {\n"
2321 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2322 "                exit(EXIT_FAILURE);\n"
2323 "            }\n"
2324 msgstr ""
2325 "        if (family == AF_INET || family == AF_INET6) {\n"
2326 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2327 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2328 "                                          sizeof(struct sockaddr_in6),\n"
2329 "                    host, NI_MAXHOST,\n"
2330 "                    NULL, 0, NI_NUMERICHOST);\n"
2331 "            if (s != 0) {\n"
2332 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2333 "                exit(EXIT_FAILURE);\n"
2334 "            }\n"
2335
2336 #. type: Plain text
2337 #: build/C/man3/getifaddrs.3:294
2338 #, no-wrap
2339 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2340 msgstr "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2341
2342 #. type: Plain text
2343 #: build/C/man3/getifaddrs.3:297
2344 #, no-wrap
2345 msgid ""
2346 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2347 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2348 msgstr ""
2349 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2350 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2351
2352 #. type: Plain text
2353 #: build/C/man3/getifaddrs.3:304
2354 #, no-wrap
2355 msgid ""
2356 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2357 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2358 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2359 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2360 "        }\n"
2361 "    }\n"
2362 msgstr ""
2363 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2364 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2365 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2366 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2367 "        }\n"
2368 "    }\n"
2369
2370 #. type: Plain text
2371 #: build/C/man3/getifaddrs.3:308
2372 #, no-wrap
2373 msgid ""
2374 "    freeifaddrs(ifaddr);\n"
2375 "    exit(EXIT_SUCCESS);\n"
2376 "}\n"
2377 msgstr ""
2378 "    freeifaddrs(ifaddr);\n"
2379 "    exit(EXIT_SUCCESS);\n"
2380 "}\n"
2381
2382 #. type: Plain text
2383 #: build/C/man3/getifaddrs.3:315
2384 msgid ""
2385 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2386 msgstr ""
2387 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2388
2389 #. type: TH
2390 #: build/C/man2/getsockname.2:40
2391 #, no-wrap
2392 msgid "GETSOCKNAME"
2393 msgstr "GETSOCKNAME"
2394
2395 #. type: TH
2396 #: build/C/man2/getsockname.2:40
2397 #, no-wrap
2398 msgid "2008-12-03"
2399 msgstr "2008-12-03"
2400
2401 #. type: Plain text
2402 #: build/C/man2/getsockname.2:43
2403 msgid "getsockname - get socket name"
2404 msgstr "getsockname - ソケットの名前を取得する"
2405
2406 #. type: Plain text
2407 #: build/C/man2/getsockname.2:49
2408 #, no-wrap
2409 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2410 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2411
2412 #. type: Plain text
2413 #: build/C/man2/getsockname.2:62
2414 msgid ""
2415 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2416 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2417 "should be initialized to indicate the amount of space (in bytes) pointed to "
2418 "by I<addr>.  On return it contains the actual size of the socket address."
2419 msgstr ""
2420 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2421 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2422 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2423 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2424 "納される。"
2425
2426 #. type: Plain text
2427 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2428 #: build/C/man2/listen.2:109
2429 msgid "The argument I<sockfd> is not a valid descriptor."
2430 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2431
2432 #. type: Plain text
2433 #: build/C/man2/getsockname.2:84
2434 msgid ""
2435 "The I<addr> argument points to memory not in a valid part of the process "
2436 "address space."
2437 msgstr ""
2438 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2439 "い。"
2440
2441 #. type: Plain text
2442 #: build/C/man2/getsockname.2:88
2443 msgid "I<addrlen> is invalid (e.g., is negative)."
2444 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2445
2446 #. type: TP
2447 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2448 #: build/C/man2/send.2:367
2449 #, no-wrap
2450 msgid "B<ENOBUFS>"
2451 msgstr "B<ENOBUFS>"
2452
2453 #. type: Plain text
2454 #: build/C/man2/getsockname.2:92
2455 msgid ""
2456 "Insufficient resources were available in the system to perform the operation."
2457 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2458
2459 #. type: Plain text
2460 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2461 msgid "The argument I<sockfd> is a file, not a socket."
2462 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2463
2464 #.  SVr4 documents additional ENOMEM
2465 #.  and ENOSR error codes.
2466 #. type: Plain text
2467 #: build/C/man2/getsockname.2:103
2468 msgid ""
2469 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2470 "POSIX.1-2001."
2471 msgstr ""
2472 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2473
2474 #. type: Plain text
2475 #: build/C/man2/getsockname.2:114
2476 msgid ""
2477 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2478 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2479 "resulted in the present I<socklen_t>, also used by glibc.  See also "
2480 "B<accept>(2)."
2481 msgstr ""
2482 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2483 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2484 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2485
2486 #. type: Plain text
2487 #: build/C/man2/getsockname.2:121
2488 msgid ""
2489 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2490 "B<unix>(7)"
2491 msgstr ""
2492 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2493 "B<unix>(7)"
2494
2495 #. type: TH
2496 #: build/C/man2/getsockopt.2:44
2497 #, no-wrap
2498 msgid "GETSOCKOPT"
2499 msgstr "GETSOCKOPT"
2500
2501 #. type: TH
2502 #: build/C/man2/getsockopt.2:44
2503 #, no-wrap
2504 msgid "2014-04-28"
2505 msgstr "2014-04-28"
2506
2507 #. type: Plain text
2508 #: build/C/man2/getsockopt.2:47
2509 msgid "getsockopt, setsockopt - get and set options on sockets"
2510 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2511
2512 #. type: Plain text
2513 #: build/C/man2/getsockopt.2:57
2514 #, no-wrap
2515 msgid ""
2516 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2517 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2518 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2519 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2520 msgstr ""
2521 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2522 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2523 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2524 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2525
2526 #. type: Plain text
2527 #: build/C/man2/getsockopt.2:67
2528 msgid ""
2529 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2530 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2531 "protocol levels; they are always present at the uppermost socket level."
2532 msgstr ""
2533 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2534 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2535 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2536 "定される。"
2537
2538 #. type: Plain text
2539 #: build/C/man2/getsockopt.2:86
2540 msgid ""
2541 "When manipulating socket options, the level at which the option resides and "
2542 "the name of the option must be specified.  To manipulate options at the "
2543 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2544 "options at any other level the protocol number of the appropriate protocol "
2545 "controlling the option is supplied.  For example, to indicate that an option "
2546 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2547 "protocol number of B<TCP>; see B<getprotoent>(3)."
2548 msgstr ""
2549 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2550 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2551 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2552 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2553 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2554 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2555 "B<getprotoent>(3)  を参照すること。"
2556
2557 #. type: Plain text
2558 #: build/C/man2/getsockopt.2:108
2559 msgid ""
2560 "The arguments I<optval> and I<optlen> are used to access option values for "
2561 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2562 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2563 "I<optlen> is a value-result argument, initially containing the size of the "
2564 "buffer pointed to by I<optval>, and modified on return to indicate the "
2565 "actual size of the value returned.  If no option value is to be supplied or "
2566 "returned, I<optval> may be NULL."
2567 msgstr ""
2568 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2569 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2570 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2571 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2572 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2573 "I<optval> は NULL でも良い。"
2574
2575 #. type: Plain text
2576 #: build/C/man2/getsockopt.2:118
2577 msgid ""
2578 "I<Optname> and any specified options are passed uninterpreted to the "
2579 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2580 "socket.hE<gt>> contains definitions for socket level options, described "
2581 "below.  Options at other protocol levels vary in format and name; consult "
2582 "the appropriate entries in section 4 of the manual."
2583 msgstr ""
2584 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2585 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2586 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2587 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2588 "ること。"
2589
2590 #. type: Plain text
2591 #: build/C/man2/getsockopt.2:127
2592 msgid ""
2593 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2594 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2595 "or zero if the option is to be disabled."
2596 msgstr ""
2597 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2598 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2599 "を指定し、 無効(disable)にするにはゼロを指定する。"
2600
2601 #. type: Plain text
2602 #: build/C/man2/getsockopt.2:131
2603 msgid ""
2604 "For a description of the available socket options see B<socket>(7)  and the "
2605 "appropriate protocol man pages."
2606 msgstr ""
2607 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2608 "ルの man ページを参照のこと。"
2609
2610 #. type: Plain text
2611 #: build/C/man2/getsockopt.2:152
2612 msgid ""
2613 "The address pointed to by I<optval> is not in a valid part of the process "
2614 "address space.  For B<getsockopt>(), this error may also be returned if "
2615 "I<optlen> is not in a valid part of the process address space."
2616 msgstr ""
2617 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2618 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2619 "い場合にもこのエラーが返される。"
2620
2621 #. type: Plain text
2622 #: build/C/man2/getsockopt.2:163
2623 msgid ""
2624 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2625 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2626 "option described in B<ip>(7))."
2627 msgstr ""
2628 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2629 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2630 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2631
2632 #. type: TP
2633 #: build/C/man2/getsockopt.2:163
2634 #, no-wrap
2635 msgid "B<ENOPROTOOPT>"
2636 msgstr "B<ENOPROTOOPT>"
2637
2638 #. type: Plain text
2639 #: build/C/man2/getsockopt.2:166
2640 msgid "The option is unknown at the level indicated."
2641 msgstr "指定された層(level)にはこのオプションは存在しない。"
2642
2643 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2644 #.  not document the
2645 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2646 #.  options
2647 #. type: Plain text
2648 #: build/C/man2/getsockopt.2:178
2649 msgid ""
2650 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2651 msgstr ""
2652 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2653 "POSIX.1-2001."
2654
2655 #. type: Plain text
2656 #: build/C/man2/getsockopt.2:199
2657 msgid ""
2658 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2659 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2660 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2661 "glibc.  See also B<accept>(2)."
2662 msgstr ""
2663 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2664 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2665 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2666 "る。 B<accept>(2)  も参照のこと。"
2667
2668 #. type: Plain text
2669 #: build/C/man2/getsockopt.2:202
2670 msgid ""
2671 "Several of the socket options should be handled at lower levels of the "
2672 "system."
2673 msgstr ""
2674 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2675
2676 #. type: Plain text
2677 #: build/C/man2/getsockopt.2:213
2678 msgid ""
2679 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2680 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2681 msgstr ""
2682 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2683 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2684
2685 #. type: TH
2686 #: build/C/man3/if_nameindex.3:26
2687 #, no-wrap
2688 msgid "IF_NAMEINDEX"
2689 msgstr "IF_NAMEINDEX"
2690
2691 #. type: TH
2692 #: build/C/man3/if_nameindex.3:26
2693 #, no-wrap
2694 msgid "2012-11-21"
2695 msgstr "2012-11-21"
2696
2697 #. type: Plain text
2698 #: build/C/man3/if_nameindex.3:29
2699 msgid ""
2700 "if_nameindex, if_freenameindex - get network interface names and indexes"
2701 msgstr ""
2702 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2703 "クスを取得する"
2704
2705 #. type: Plain text
2706 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2707 #, no-wrap
2708 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2709 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2710
2711 #. type: Plain text
2712 #: build/C/man3/if_nameindex.3:35
2713 #, no-wrap
2714 msgid ""
2715 "B<struct if_nameindex *if_nameindex(void);>\n"
2716 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2717 msgstr ""
2718 "B<struct if_nameindex *if_nameindex(void);>\n"
2719 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2720
2721 #. type: Plain text
2722 #: build/C/man3/if_nameindex.3:46
2723 msgid ""
2724 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2725 "structures, each containing information about one of the network interfaces "
2726 "on the local system.  The I<if_nameindex> structure contains at least the "
2727 "following entries:"
2728 msgstr ""
2729 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2730 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2731 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2732
2733 #. type: Plain text
2734 #: build/C/man3/if_nameindex.3:51
2735 #, no-wrap
2736 msgid ""
2737 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2738 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2739 msgstr ""
2740 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2741 "    char        *if_name;  /*ヌル終端された名前 (\"eth0\" など) */\n"
2742
2743 #. type: Plain text
2744 #: build/C/man3/if_nameindex.3:65
2745 msgid ""
2746 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2747 "points to the null-terminated interface name.  The end of the array is "
2748 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2749 msgstr ""
2750 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2751 "フィールドはヌル終端されたインターフェース名を指す。 配列の最後は、 "
2752 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2753
2754 #. type: Plain text
2755 #: build/C/man3/if_nameindex.3:71
2756 msgid ""
2757 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2758 "and should be freed using B<if_freenameindex>()  when no longer needed."
2759 msgstr ""
2760 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2761 "は B<if_freenameindex>() で解放すべきである。"
2762
2763 #. type: Plain text
2764 #: build/C/man3/if_nameindex.3:78
2765 msgid ""
2766 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2767 "is returned, and I<errno> is set appropriately."
2768 msgstr ""
2769 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2770 "NULL が返され、 I<errno> が適切に設定される。"
2771
2772 #. type: Plain text
2773 #: build/C/man3/if_nameindex.3:83
2774 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2775 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2776
2777 #. type: Plain text
2778 #: build/C/man3/if_nameindex.3:86
2779 msgid "Insufficient resources available."
2780 msgstr "利用可能なリソースが十分にない。"
2781
2782 #. type: Plain text
2783 #: build/C/man3/if_nameindex.3:97
2784 msgid ""
2785 "B<if_nameindex>()  may also fail for any of the errors specified for "
2786 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2787 "B<sendto>(2), or B<malloc>(3)."
2788 msgstr ""
2789 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), "
2790 "B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定され"
2791 "ているエラーのいずれかで失敗する場合がある。"
2792
2793 #. type: Plain text
2794 #: build/C/man3/if_nameindex.3:104
2795 msgid ""
2796 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2797 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2798 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2799 "available only on kernels that support netlink."
2800 msgstr ""
2801 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2802 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2803 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2804 "netlink をサポートするカーネルにおいてのみである。"
2805
2806 #. type: Plain text
2807 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:94
2808 msgid "RFC\\ 3493, POSIX.1-2001."
2809 msgstr "RFC\\ 3493, POSIX.1-2001."
2810
2811 #. type: Plain text
2812 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:96
2813 msgid "This function first appeared in BSDi."
2814 msgstr "この関数は BSDi 初めて登場した。"
2815
2816 #. type: Plain text
2817 #: build/C/man3/if_nameindex.3:112
2818 msgid ""
2819 "The program below demonstrates the use of the functions described on this "
2820 "page.  An example of the output this program might produce is the following:"
2821 msgstr ""
2822 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2823 "ムが生成する出力は以下のようになる。"
2824
2825 #. type: Plain text
2826 #: build/C/man3/if_nameindex.3:119
2827 #, no-wrap
2828 msgid ""
2829 "$ B<./a.out>I<\n"
2830 "1: lo\n"
2831 "2: wlan0\n"
2832 "3: em1>\n"
2833 msgstr ""
2834 "$ B<./a.out>I<\n"
2835 "1: lo\n"
2836 "2: wlan0\n"
2837 "3: em1>\n"
2838
2839 #. type: Plain text
2840 #: build/C/man3/if_nameindex.3:127
2841 #, no-wrap
2842 msgid ""
2843 "#include E<lt>net/if.hE<gt>\n"
2844 "#include E<lt>stdio.hE<gt>\n"
2845 "#include E<lt>stdlib.hE<gt>\n"
2846 "#include E<lt>unistd.hE<gt>\n"
2847 msgstr ""
2848 "#include E<lt>net/if.hE<gt>\n"
2849 "#include E<lt>stdio.hE<gt>\n"
2850 "#include E<lt>stdlib.hE<gt>\n"
2851 "#include E<lt>unistd.hE<gt>\n"
2852
2853 #. type: Plain text
2854 #: build/C/man3/if_nameindex.3:132
2855 #, no-wrap
2856 msgid ""
2857 "int\n"
2858 "main(int argc, char *argv[])\n"
2859 "{\n"
2860 "    struct if_nameindex *if_ni, *i;\n"
2861 msgstr ""
2862 "int\n"
2863 "main(int argc, char *argv[])\n"
2864 "{\n"
2865 "    struct if_nameindex *if_ni, *i;\n"
2866
2867 #. type: Plain text
2868 #: build/C/man3/if_nameindex.3:138
2869 #, no-wrap
2870 msgid ""
2871 "    if_ni = if_nameindex();\n"
2872 "    if (if_ni == NULL) {\n"
2873 "        perror(\"if_nameindex\");\n"
2874 "        exit(EXIT_FAILURE);\n"
2875 "    }\n"
2876 msgstr ""
2877 "    if_ni = if_nameindex();\n"
2878 "    if (if_ni == NULL) {\n"
2879 "        perror(\"if_nameindex\");\n"
2880 "        exit(EXIT_FAILURE);\n"
2881 "    }\n"
2882
2883 #. type: Plain text
2884 #: build/C/man3/if_nameindex.3:141
2885 #, no-wrap
2886 msgid ""
2887 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2888 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2889 msgstr ""
2890 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2891 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2892
2893 #. type: Plain text
2894 #: build/C/man3/if_nameindex.3:143
2895 #, no-wrap
2896 msgid "    if_freenameindex(if_ni);\n"
2897 msgstr "    if_freenameindex(if_ni);\n"
2898
2899 #. type: Plain text
2900 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:585
2901 #, no-wrap
2902 msgid ""
2903 "    exit(EXIT_SUCCESS);\n"
2904 "}\n"
2905 msgstr ""
2906 "    exit(EXIT_SUCCESS);\n"
2907 "}\n"
2908
2909 #. type: Plain text
2910 #: build/C/man3/if_nameindex.3:154
2911 msgid ""
2912 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2913 "B<if_nametoindex>(3), B<ifconfig>(8)"
2914 msgstr ""
2915 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2916 "B<if_nametoindex>(3), B<ifconfig>(8)"
2917
2918 #. type: TH
2919 #: build/C/man3/if_nametoindex.3:25
2920 #, no-wrap
2921 msgid "IF_NAMETOINDEX"
2922 msgstr "IF_NAMETOINDEX"
2923
2924 #. type: TH
2925 #: build/C/man3/if_nametoindex.3:25
2926 #, no-wrap
2927 msgid "2014-04-01"
2928 msgstr "2014-04-01"
2929
2930 #. type: Plain text
2931 #: build/C/man3/if_nametoindex.3:29
2932 msgid ""
2933 "if_nametoindex, if_indextoname - mappings between network interface names "
2934 "and indexes"
2935 msgstr ""
2936 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2937 "クスのマッピングを行う"
2938
2939 #. type: Plain text
2940 #: build/C/man3/if_nametoindex.3:34
2941 #, no-wrap
2942 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2943 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2944
2945 #. type: Plain text
2946 #: build/C/man3/if_nametoindex.3:36
2947 #, no-wrap
2948 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2949 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2950
2951 #. type: Plain text
2952 #: build/C/man3/if_nametoindex.3:43
2953 msgid ""
2954 "The B<if_nametoindex>()  function returns the index of the network interface "
2955 "corresponding to the name I<ifname>."
2956 msgstr ""
2957 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2958 "のインデックスを返す。"
2959
2960 #. type: Plain text
2961 #: build/C/man3/if_nametoindex.3:54
2962 msgid ""
2963 "The B<if_indextoname>()  function returns the name of the network interface "
2964 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2965 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2966 "least B<IF_NAMESIZE> bytes."
2967 msgstr ""
2968 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2969 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2970 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2971 "る。"
2972
2973 #. type: Plain text
2974 #: build/C/man3/if_nametoindex.3:61
2975 msgid ""
2976 "On success, B<if_nametoindex>()  returns the index number of the network "
2977 "interface; on error, 0 is returned and I<errno> is set appropriately."
2978 msgstr ""
2979 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2980 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2981
2982 #. type: Plain text
2983 #: build/C/man3/if_nametoindex.3:69
2984 msgid ""
2985 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2986 "returned and I<errno> is set appropriately."
2987 msgstr ""
2988 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2989 "が返され、 I<errno> が適切に設定される。"
2990
2991 #. type: Plain text
2992 #: build/C/man3/if_nametoindex.3:74
2993 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2994 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2995
2996 #. type: TP
2997 #: build/C/man3/if_nametoindex.3:74
2998 #, no-wrap
2999 msgid "B<ENXIO>"
3000 msgstr "B<ENXIO>"
3001
3002 #. type: Plain text
3003 #: build/C/man3/if_nametoindex.3:77
3004 msgid "No interface found for the index."
3005 msgstr "インデックスに対応するインターフェースがない。"
3006
3007 #. type: Plain text
3008 #: build/C/man3/if_nametoindex.3:85
3009 msgid ""
3010 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
3011 "errors specified for B<socket>(2)  or B<ioctl>(2)."
3012 msgstr ""
3013 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
3014 "に対して規定されているエラーのいずれかで失敗する場合がある。"
3015
3016 #. type: Plain text
3017 #: build/C/man3/if_nametoindex.3:92
3018 msgid ""
3019 "The B<if_nametoindex>()  and B<if_indextoname>()  functions are thread-safe."
3020 msgstr ""
3021 "関数 B<if_nametoindex>() と B<if_indextoname>() はスレッドセーフである。"
3022
3023 #. type: Plain text
3024 #: build/C/man3/if_nametoindex.3:100
3025 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3026 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3027
3028 #. type: TH
3029 #: build/C/man2/listen.2:45
3030 #, no-wrap
3031 msgid "LISTEN"
3032 msgstr "LISTEN"
3033
3034 #. type: TH
3035 #: build/C/man2/listen.2:45
3036 #, no-wrap
3037 msgid "2014-05-10"
3038 msgstr "2014-05-10"
3039
3040 #. type: Plain text
3041 #: build/C/man2/listen.2:48
3042 msgid "listen - listen for connections on a socket"
3043 msgstr "listen - ソケット(socket)上の接続を待つ"
3044
3045 #. type: Plain text
3046 #: build/C/man2/listen.2:55
3047 #, no-wrap
3048 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3049 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3050
3051 #. type: Plain text
3052 #: build/C/man2/listen.2:63
3053 msgid ""
3054 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
3055 "that is, as a socket that will be used to accept incoming connection "
3056 "requests using B<accept>(2)."
3057 msgstr ""
3058 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3059 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
3060 "した接続要求を受け付けるのに使用されるソケットである。"
3061
3062 #. type: Plain text
3063 #: build/C/man2/listen.2:70
3064 msgid ""
3065 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3066 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3067 msgstr ""
3068 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3069 "するファイルディスクリプタである。"
3070
3071 #. type: Plain text
3072 #: build/C/man2/listen.2:82
3073 msgid ""
3074 "The I<backlog> argument defines the maximum length to which the queue of "
3075 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3076 "when the queue is full, the client may receive an error with an indication "
3077 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3078 "the request may be ignored so that a later reattempt at connection succeeds."
3079 msgstr ""
3080 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3081 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3082 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3083 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3084 "い。"
3085
3086 #. type: Plain text
3087 #: build/C/man2/listen.2:91
3088 msgid "Another socket is already listening on the same port."
3089 msgstr "別のソケットが既に同じポートを listen している。"
3090
3091 #. type: Plain text
3092 #: build/C/man2/listen.2:114 build/C/man2/send.2:386
3093 msgid "The argument I<sockfd> is not a socket."
3094 msgstr "引き数 I<sockfd> はソケットではない。"
3095
3096 #. type: Plain text
3097 #: build/C/man2/listen.2:119
3098 msgid "The socket is not of a type that supports the B<listen>()  operation."
3099 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3100
3101 #. type: Plain text
3102 #: build/C/man2/listen.2:124
3103 msgid ""
3104 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3105 "4.2BSD."
3106 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3107
3108 #. type: Plain text
3109 #: build/C/man2/listen.2:126
3110 msgid "To accept connections, the following steps are performed:"
3111 msgstr "接続を受け付けるには、以下の処理が実行される。"
3112
3113 #. type: TP
3114 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:347
3115 #, no-wrap
3116 msgid "1."
3117 msgstr "1."
3118
3119 #. type: Plain text
3120 #: build/C/man2/listen.2:130
3121 msgid "A socket is created with B<socket>(2)."
3122 msgstr "B<socket>(2)  でソケットを作成する。"
3123
3124 #. type: TP
3125 #: build/C/man2/listen.2:130 build/C/man2/select_tut.2:356
3126 #, no-wrap
3127 msgid "2."
3128 msgstr "2."
3129
3130 #. type: Plain text
3131 #: build/C/man2/listen.2:136
3132 msgid ""
3133 "The socket is bound to a local address using B<bind>(2), so that other "
3134 "sockets may be B<connect>(2)ed to it."
3135 msgstr ""
3136 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3137 "のソケットに B<connect>(2)  できるようにする。"
3138
3139 #. type: TP
3140 #: build/C/man2/listen.2:136 build/C/man2/select_tut.2:360
3141 #, no-wrap
3142 msgid "3."
3143 msgstr "3."
3144
3145 #. type: Plain text
3146 #: build/C/man2/listen.2:140
3147 msgid ""
3148 "A willingness to accept incoming connections and a queue limit for incoming "
3149 "connections are specified with B<listen>()."
3150 msgstr ""
3151 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3152 "定する。"
3153
3154 #. type: TP
3155 #: build/C/man2/listen.2:140 build/C/man2/select_tut.2:367
3156 #, no-wrap
3157 msgid "4."
3158 msgstr "4."
3159
3160 #. type: Plain text
3161 #: build/C/man2/listen.2:143
3162 msgid "Connections are accepted with B<accept>(2)."
3163 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3164
3165 #. type: Plain text
3166 #: build/C/man2/listen.2:166
3167 msgid ""
3168 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3169 "2.2.  Now it specifies the queue length for I<completely> established "
3170 "sockets waiting to be accepted, instead of the number of incomplete "
3171 "connection requests.  The maximum length of the queue for incomplete sockets "
3172 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3173 "are enabled there is no logical maximum length and this setting is ignored.  "
3174 "See B<tcp>(7)  for more information."
3175 msgstr ""
3176 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3177 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3178 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3179 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3180 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3181 "論理的な最大長は存在せず、この設定は無視される。"
3182
3183 #.  The following is now rather historic information (MTK, Jun 05)
3184 #.  Don't rely on this value in portable applications since BSD
3185 #.  (and some BSD-derived systems) limit the backlog to 5.
3186 #. type: Plain text
3187 #: build/C/man2/listen.2:179
3188 msgid ""
3189 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3190 "somaxconn>, then it is silently truncated to that value; the default value "
3191 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3192 "value, B<SOMAXCONN>, with the value 128."
3193 msgstr ""
3194 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3195 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3196 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3197 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3198
3199 #. type: Plain text
3200 #: build/C/man2/listen.2:188
3201 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3202 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3203
3204 #. type: TH
3205 #: build/C/man2/recv.2:41
3206 #, no-wrap
3207 msgid "RECV"
3208 msgstr "RECV"
3209
3210 #. type: Plain text
3211 #: build/C/man2/recv.2:44
3212 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3213 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3214
3215 #. type: Plain text
3216 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3217 #: build/C/man2/select_tut.2:47
3218 #, no-wrap
3219 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3220 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3221
3222 #. type: Plain text
3223 #: build/C/man2/recv.2:53
3224 #, no-wrap
3225 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3226 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3227
3228 #. type: Plain text
3229 #: build/C/man2/recv.2:56
3230 #, no-wrap
3231 msgid ""
3232 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3233 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3234 msgstr ""
3235 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3236 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3237
3238 #. type: Plain text
3239 #: build/C/man2/recv.2:58
3240 #, no-wrap
3241 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3242 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3243
3244 #. type: Plain text
3245 #: build/C/man2/recv.2:70
3246 msgid ""
3247 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3248 "messages from a socket.  They may be used to receive data on both "
3249 "connectionless and connection-oriented sockets.  This page first describes "
3250 "common features of all three system calls, and then describes the "
3251 "differences between the calls."
3252 msgstr ""
3253 "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受"
3254 "け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 "
3255 "(connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら "
3256 "3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違い"
3257 "について説明する。"
3258
3259 #. type: Plain text
3260 #: build/C/man2/recv.2:76
3261 msgid ""
3262 "All three calls return the length of the message on successful completion.  "
3263 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3264 "discarded depending on the type of socket the message is received from."
3265 msgstr ""
3266 "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返"
3267 "す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッ"
3268 "セージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれな"
3269 "い。"
3270
3271 #. type: Plain text
3272 #: build/C/man2/recv.2:86
3273 msgid ""
3274 "If no messages are available at the socket, the receive calls wait for a "
3275 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3276 "which case the value -1 is returned and the external variable I<errno> is "
3277 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3278 "data available, up to the requested amount, rather than waiting for receipt "
3279 "of the full amount requested."
3280 msgstr ""
3281 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3282 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3283 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3284 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3285 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3286 "る (受信されるデータの最大サイズは要求したサイズである)。"
3287
3288 #. type: Plain text
3289 #: build/C/man2/recv.2:93
3290 msgid ""
3291 "An application can use B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3292 "determine when more data arrives on a socket."
3293 msgstr ""
3294 "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットに"
3295 "さらにデータが到着しているかを判定することができる。"
3296
3297 #. type: SS
3298 #: build/C/man2/recv.2:93 build/C/man2/send.2:160
3299 #, no-wrap
3300 msgid "The flags argument"
3301 msgstr "フラグ引き数"
3302
3303 #. type: Plain text
3304 #: build/C/man2/recv.2:97
3305 msgid ""
3306 "The I<flags> argument is formed by ORing one or more of the following values:"
3307 msgstr ""
3308 "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指"
3309 "定する:"
3310
3311 #. type: TP
3312 #: build/C/man2/recv.2:97
3313 #, no-wrap
3314 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3315 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3316
3317 #. type: Plain text
3318 #: build/C/man2/recv.2:108
3319 msgid ""
3320 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3321 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3322 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3323 "flag of B<open>(2)."
3324 msgstr ""
3325 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3326 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3327 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3328 "同じ理由で有用である。"
3329
3330 #. type: TP
3331 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3332 #, no-wrap
3333 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3334 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3335
3336 #. type: Plain text
3337 #: build/C/man2/recv.2:118
3338 msgid ""
3339 "Enables nonblocking operation; if the operation would block, the call fails "
3340 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3341 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3342 msgstr ""
3343 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3344 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3345 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3346
3347 #. type: TP
3348 #: build/C/man2/recv.2:118
3349 #, no-wrap
3350 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3351 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3352
3353 #. type: Plain text
3354 #: build/C/man2/recv.2:137
3355 msgid ""
3356 "This flag specifies that queued errors should be received from the socket "
3357 "error queue.  The error is passed in an ancillary message with a type "
3358 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3359 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3360 "information.  The payload of the original packet that caused the error is "
3361 "passed as normal data via I<msg_iovec>.  The original destination address of "
3362 "the datagram that caused the error is supplied via I<msg_name>."
3363 msgstr ""
3364 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3365 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3366 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3367 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3368 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3369 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3370 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3371 "I<msg_name> 経由で参照できる。"
3372
3373 #. type: Plain text
3374 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3375 msgid ""
3376 "For local errors, no address is passed (this can be checked with the "
3377 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3378 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3379 "the pending socket error is regenerated based on the next queued error and "
3380 "will be passed on the next socket operation."
3381 msgstr ""
3382 "ローカルなエラーの場合はアドレスは渡されない\n"
3383 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3384 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3385 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3386 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3387
3388 #. type: Plain text
3389 #: build/C/man2/recv.2:153
3390 msgid "The error is supplied in a I<sock_extended_err> structure:"
3391 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3392
3393 #. type: Plain text
3394 #: build/C/man2/recv.2:160
3395 #, no-wrap
3396 msgid ""
3397 "#define SO_EE_ORIGIN_NONE    0\n"
3398 "#define SO_EE_ORIGIN_LOCAL   1\n"
3399 "#define SO_EE_ORIGIN_ICMP    2\n"
3400 "#define SO_EE_ORIGIN_ICMP6   3\n"
3401 msgstr ""
3402 "#define SO_EE_ORIGIN_NONE    0\n"
3403 "#define SO_EE_ORIGIN_LOCAL   1\n"
3404 "#define SO_EE_ORIGIN_ICMP    2\n"
3405 "#define SO_EE_ORIGIN_ICMP6   3\n"
3406
3407 #. type: Plain text
3408 #: build/C/man2/recv.2:172
3409 #, no-wrap
3410 msgid ""
3411 "struct sock_extended_err\n"
3412 "{\n"
3413 "    uint32_t ee_errno;   /* error number */\n"
3414 "    uint8_t  ee_origin;  /* where the error originated */\n"
3415 "    uint8_t  ee_type;    /* type */\n"
3416 "    uint8_t  ee_code;    /* code */\n"
3417 "    uint8_t  ee_pad;     /* padding */\n"
3418 "    uint32_t ee_info;    /* additional information */\n"
3419 "    uint32_t ee_data;    /* other data */\n"
3420 "    /* More data may follow */\n"
3421 "};\n"
3422 msgstr ""
3423 "struct sock_extended_err\n"
3424 "{\n"
3425 "    uint32_t ee_errno;   /* error number */\n"
3426 "    uint8_t  ee_origin;  /* where the error originated */\n"
3427 "    uint8_t  ee_type;    /* type */\n"
3428 "    uint8_t  ee_code;    /* code */\n"
3429 "    uint8_t  ee_pad;     /* padding */\n"
3430 "    uint32_t ee_info;    /* additional information */\n"
3431 "    uint32_t ee_data;    /* other data */\n"
3432 "    /* More data may follow */\n"
3433 "};\n"
3434
3435 #. type: Plain text
3436 #: build/C/man2/recv.2:174
3437 #, no-wrap
3438 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3439 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3440
3441 #. type: Plain text
3442 #: build/C/man2/recv.2:198
3443 msgid ""
3444 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3445 "is the origin code of where the error originated.  The other fields are "
3446 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3447 "address of the network object where the error originated from given a "
3448 "pointer to the ancillary message.  If this address is not known, the "
3449 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3450 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3451 "caused the error is passed as normal data."
3452 msgstr ""
3453 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3454 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3455 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3456 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3457 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3458 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3459 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3460 "される。"
3461
3462 #. type: TP
3463 #: build/C/man2/recv.2:212 build/C/man2/recv.2:401 build/C/man2/send.2:230
3464 #, no-wrap
3465 msgid "B<MSG_OOB>"
3466 msgstr "B<MSG_OOB>"
3467
3468 #. type: Plain text
3469 #: build/C/man2/recv.2:219
3470 msgid ""
3471 "This flag requests receipt of out-of-band data that would not be received in "
3472 "the normal data stream.  Some protocols place expedited data at the head of "
3473 "the normal data queue, and thus this flag cannot be used with such protocols."
3474 msgstr ""
3475 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3476 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3477 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3478 "い。"
3479
3480 #. type: TP
3481 #: build/C/man2/recv.2:219
3482 #, no-wrap
3483 msgid "B<MSG_PEEK>"
3484 msgstr "B<MSG_PEEK>"
3485
3486 #. type: Plain text
3487 #: build/C/man2/recv.2:226
3488 msgid ""
3489 "This flag causes the receive operation to return data from the beginning of "
3490 "the receive queue without removing that data from the queue.  Thus, a "
3491 "subsequent receive call will return the same data."
3492 msgstr ""
3493 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3494 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3495 "が返ることになる。"
3496
3497 #. type: TP
3498 #: build/C/man2/recv.2:226
3499 #, no-wrap
3500 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3501 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3502
3503 #. type: Plain text
3504 #: build/C/man2/recv.2:234
3505 msgid ""
3506 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3507 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3508 "return the real length of the packet or datagram, even when it was longer "
3509 "than the passed buffer."
3510 msgstr ""
3511 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3512 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3513 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3514 "場合にも、 パケットやデータグラムの実際の長さを返す。"
3515
3516 #. type: Plain text
3517 #: build/C/man2/recv.2:237
3518 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3519 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3520
3521 #. type: TP
3522 #: build/C/man2/recv.2:237
3523 #, no-wrap
3524 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3525 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3526
3527 #. type: Plain text
3528 #: build/C/man2/recv.2:245
3529 msgid ""
3530 "This flag requests that the operation block until the full request is "
3531 "satisfied.  However, the call may still return less data than requested if a "
3532 "signal is caught, an error or disconnect occurs, or the next data to be "
3533 "received is of a different type than that returned."
3534 msgstr ""
3535 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3536 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3537 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3538 "りデータが少なくても返ることがある。"
3539
3540 #. type: SS
3541 #: build/C/man2/recv.2:245
3542 #, no-wrap
3543 msgid "recvfrom()"
3544 msgstr "recvfrom()"
3545
3546 #. type: Plain text
3547 #: build/C/man2/recv.2:251
3548 msgid ""
3549 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3550 "caller must specify the size of the buffer in I<len>."
3551 msgstr ""
3552 "B<recvfrom>() は受信したメッセージをバッファ I<buf> に格納する。 呼び出し元は"
3553 "バッファサイズを I<len> で指定しなければならない。"
3554
3555 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3556 #.  .I src_addr
3557 #.  is filled in.
3558 #.  .I src_addr
3559 #.  is also filled in for stream sockets in the UNIX domain, but is not
3560 #.  filled in for stream sockets in the Internet domain.)
3561 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3562 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3563 #. type: Plain text
3564 #: build/C/man2/recv.2:279
3565 msgid ""
3566 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3567 "address of the message, that source address is placed in the buffer pointed "
3568 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3569 "Before the call, it should be initialized to the size of the buffer "
3570 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3571 "the actual size of the source address.  The returned address is truncated if "
3572 "the buffer provided is too small; in this case, I<addrlen> will return a "
3573 "value greater than was supplied to the call."
3574 msgstr ""
3575 "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが"
3576 "分かる場合、 この送信元アドレスが I<src_addr> が指すバッファに格納される。 こ"
3577 "の場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元は "
3578 "I<src_addr> に割り当てたバッファの大きさで初期化しておくべきである。 返ってく"
3579 "る時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡された"
3580 "バッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められる。この場"
3581 "合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返される。"
3582
3583 #. type: Plain text
3584 #: build/C/man2/recv.2:286
3585 #, fuzzy
3586 #| msgid ""
3587 #| "If the caller is not interested in the source address, I<src_addr> should "
3588 #| "be specified as NULL and I<addrlen> should be specified as 0."
3589 msgid ""
3590 "If the caller is not interested in the source address, I<src_addr> and "
3591 "I<addrlen> should be specified as NULL."
3592 msgstr ""
3593 "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> には NULL を指定"
3594 "し、 I<addrlen> には 0 を指定すべきである。"
3595
3596 #. type: SS
3597 #: build/C/man2/recv.2:286
3598 #, no-wrap
3599 msgid "recv()"
3600 msgstr "recv()"
3601
3602 #. type: Plain text
3603 #: build/C/man2/recv.2:294
3604 msgid ""
3605 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3606 "B<connect>(2)).  It is equivalent to the call:"
3607 msgstr ""
3608 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用さ"
3609 "れる (B<connect>(2) 参照)。次の呼び出しと等価である。"
3610
3611 #. type: Plain text
3612 #: build/C/man2/recv.2:297
3613 #, no-wrap
3614 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3615 msgstr "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3616
3617 #. type: SS
3618 #: build/C/man2/recv.2:297
3619 #, no-wrap
3620 msgid "recvmsg()"
3621 msgstr "recvmsg()"
3622
3623 #. type: Plain text
3624 #: build/C/man2/recv.2:305
3625 msgid ""
3626 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3627 "directly supplied arguments.  This structure is defined as follows in "
3628 "I<E<lt>sys/socket.hE<gt>>:"
3629 msgstr ""
3630 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3631 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3632
3633 #. type: Plain text
3634 #: build/C/man2/recv.2:312
3635 #, no-wrap
3636 msgid ""
3637 "struct iovec {                    /* Scatter/gather array items */\n"
3638 "    void  *iov_base;              /* Starting address */\n"
3639 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3640 "};\n"
3641 msgstr ""
3642 "struct iovec {                    /* Scatter/gather array items */\n"
3643 "    void  *iov_base;              /* Starting address */\n"
3644 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3645 "};\n"
3646
3647 #. type: Plain text
3648 #: build/C/man2/recv.2:322
3649 #, no-wrap
3650 msgid ""
3651 "struct msghdr {\n"
3652 "    void         *msg_name;       /* optional address */\n"
3653 "    socklen_t     msg_namelen;    /* size of address */\n"
3654 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3655 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3656 "    void         *msg_control;    /* ancillary data, see below */\n"
3657 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3658 "    int           msg_flags;      /* flags on received message */\n"
3659 "};\n"
3660 msgstr ""
3661 "struct msghdr {\n"
3662 "    void         *msg_name;       /* 追加のアドレス */\n"
3663 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3664 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3665 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3666 "    void         *msg_control;    /* 補助データ (後述) */\n"
3667 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3668 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3669 "};\n"
3670
3671 #. type: Plain text
3672 #: build/C/man2/recv.2:338
3673 msgid ""
3674 "The I<msg_name> field points to a caller-allocated buffer that is used to "
3675 "return the source address if the socket is unconnected.  The caller should "
3676 "set I<msg_namelen> to the size of this buffer before this call; upon return "
3677 "from a successful call, I<msg_namelen> will contain the length of the "
3678 "returned address.  If the application does not need to know the source "
3679 "address, I<msg_name> can be specified as NULL."
3680 msgstr ""
3681 "フィールド I<msg_name> は、 ソケットが接続されていない場合に送信元アドレスを"
3682 "返すのに使用されるバッファを指す。 このバッファは呼び出し元が確保する。 呼び"
3683 "出し元は呼び出し前に I<msg_namelen> にこのバッファの大きさを設定しなければな"
3684 "らない。 呼び出しが成功した場合、呼び出しから返って来た際には I<msg_namelen> "
3685 "には返されるアドレスの長さが入っている。 アプリケーションが送信元アドレスを知"
3686 "る必要がない場合には、 I<msg_name> に NULL を指定することができる。"
3687
3688 #. type: Plain text
3689 #: build/C/man2/recv.2:345
3690 msgid ""
3691 "The fields I<msg_iov> and I<msg_iovlen> describe scatter-gather locations, "
3692 "as discussed in B<readv>(2)."
3693 msgstr ""
3694 "I<msg_iov> と I<msg_iovlen> フィールドは scatter-gather 用の場所を指定する。 "
3695 "B<readv>(2) に説明がある。"
3696
3697 #. type: Plain text
3698 #: build/C/man2/recv.2:360
3699 msgid ""
3700 "The field I<msg_control>, which has length I<msg_controllen>, points to a "
3701 "buffer for other protocol control-related messages or miscellaneous "
3702 "ancillary data.  When B<recvmsg>()  is called, I<msg_controllen> should "
3703 "contain the length of the available buffer in I<msg_control>; upon return "
3704 "from a successful call it will contain the length of the control message "
3705 "sequence."
3706 msgstr ""
3707 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3708 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3709 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3710 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3711 "さが入っている。"
3712
3713 #. type: Plain text
3714 #: build/C/man2/recv.2:362
3715 msgid "The messages are of the form:"
3716 msgstr "メッセージの形式は以下の通り:"
3717
3718 #. type: Plain text
3719 #: build/C/man2/recv.2:372
3720 #, no-wrap
3721 msgid ""
3722 "struct cmsghdr {\n"
3723 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3724 "    int           cmsg_level;   /* originating protocol */\n"
3725 "    int           cmsg_type;    /* protocol-specific type */\n"
3726 "/* followed by\n"
3727 "    unsigned char cmsg_data[]; */\n"
3728 "};\n"
3729 msgstr ""
3730 "struct cmsghdr {\n"
3731 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3732 "    int           cmsg_level;   /* originating protocol */\n"
3733 "    int           cmsg_type;    /* protocol-specific type */\n"
3734 "/* followed by\n"
3735 "    unsigned char cmsg_data[]; */\n"
3736 "};\n"
3737
3738 #. type: Plain text
3739 #: build/C/man2/recv.2:377
3740 msgid ""
3741 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3742 msgstr ""
3743 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3744
3745 #. type: Plain text
3746 #: build/C/man2/recv.2:380
3747 msgid ""
3748 "As an example, Linux uses this ancillary data mechanism to pass extended "
3749 "errors, IP options, or file descriptors over UNIX domain sockets."
3750 msgstr ""
3751 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3752 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3753 "いる。"
3754
3755 #. type: Plain text
3756 #: build/C/man2/recv.2:388
3757 msgid ""
3758 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3759 "It can contain several flags:"
3760 msgstr ""
3761 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3762 "れる。ここにはいくつかのフラグが入る。"
3763
3764 #. type: TP
3765 #: build/C/man2/recv.2:388
3766 #, no-wrap
3767 msgid "B<MSG_EOR>"
3768 msgstr "B<MSG_EOR>"
3769
3770 #. type: Plain text
3771 #: build/C/man2/recv.2:393
3772 msgid ""
3773 "indicates end-of-record; the data returned completed a record (generally "
3774 "used with sockets of type B<SOCK_SEQPACKET>)."
3775 msgstr ""
3776 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3777 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3778
3779 #. type: TP
3780 #: build/C/man2/recv.2:393
3781 #, no-wrap
3782 msgid "B<MSG_TRUNC>"
3783 msgstr "B<MSG_TRUNC>"
3784
3785 #. type: Plain text
3786 #: build/C/man2/recv.2:397
3787 msgid ""
3788 "indicates that the trailing portion of a datagram was discarded because the "
3789 "datagram was larger than the buffer supplied."
3790 msgstr ""
3791 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3792 "た部分が捨てられたことを示す。"
3793
3794 #. type: TP
3795 #: build/C/man2/recv.2:397
3796 #, no-wrap
3797 msgid "B<MSG_CTRUNC>"
3798 msgstr "B<MSG_CTRUNC>"
3799
3800 #. type: Plain text
3801 #: build/C/man2/recv.2:401
3802 msgid ""
3803 "indicates that some control data were discarded due to lack of space in the "
3804 "buffer for ancillary data."
3805 msgstr ""
3806 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3807 "を示す。"
3808
3809 #. type: Plain text
3810 #: build/C/man2/recv.2:404
3811 msgid ""
3812 "is returned to indicate that expedited or out-of-band data were received."
3813 msgstr "速達データや帯域外データを受信したことを示す。"
3814
3815 #. type: TP
3816 #: build/C/man2/recv.2:404
3817 #, no-wrap
3818 msgid "B<MSG_ERRQUEUE>"
3819 msgstr "B<MSG_ERRQUEUE>"
3820
3821 #. type: Plain text
3822 #: build/C/man2/recv.2:408
3823 msgid ""
3824 "indicates that no data was received but an extended error from the socket "
3825 "error queue."
3826 msgstr ""
3827 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3828 "を示す。"
3829
3830 #. type: Plain text
3831 #: build/C/man2/recv.2:414
3832 msgid ""
3833 "These calls return the number of bytes received, or -1 if an error "
3834 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3835 msgstr ""
3836 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3837 "にエラーを示す値を設定する。"
3838
3839 #. type: Plain text
3840 #: build/C/man2/recv.2:417
3841 msgid ""
3842 "When a stream socket peer has performed an orderly shutdown, the return "
3843 "value will be 0 (the traditional \"end-of-file\" return)."
3844 msgstr ""
3845 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3846 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3847
3848 #. type: Plain text
3849 #: build/C/man2/recv.2:421
3850 msgid ""
3851 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3852 "permit zero-length datagrams.  When such a datagram is received, the return "
3853 "value is 0."
3854 msgstr ""
3855 "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメイ"
3856 "ンなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受"
3857 "信した場合、 返り値は 0 となる。"
3858
3859 #. type: Plain text
3860 #: build/C/man2/recv.2:424
3861 msgid ""
3862 "The value 0 may also be returned if the requested number of bytes to receive "
3863 "from a stream socket was 0."
3864 msgstr ""
3865 "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返され"
3866 "る。"
3867
3868 #. type: Plain text
3869 #: build/C/man2/recv.2:429
3870 msgid ""
3871 "These are some standard errors generated by the socket layer.  Additional "
3872 "errors may be generated and returned from the underlying protocol modules; "
3873 "see their manual pages."
3874 msgstr ""
3875 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3876 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3877 "ること。"
3878
3879 #.  Actually EAGAIN on Linux
3880 #. type: Plain text
3881 #: build/C/man2/recv.2:438
3882 msgid ""
3883 "The socket is marked nonblocking and the receive operation would block, or a "
3884 "receive timeout had been set and the timeout expired before data was "
3885 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3886 "and does not require these constants to have the same value, so a portable "
3887 "application should check for both possibilities."
3888 msgstr ""
3889 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3890 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3891 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3892 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3893 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3894
3895 #. type: Plain text
3896 #: build/C/man2/recv.2:443
3897 msgid "The argument I<sockfd> is an invalid descriptor."
3898 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3899
3900 #. type: Plain text
3901 #: build/C/man2/recv.2:447
3902 msgid ""
3903 "A remote host refused to allow the network connection (typically because it "
3904 "is not running the requested service)."
3905 msgstr ""
3906 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3907 "たサービスが起動されていないなどがある)。"
3908
3909 #. type: Plain text
3910 #: build/C/man2/recv.2:451
3911 msgid ""
3912 "The receive buffer pointer(s) point outside the process's address space."
3913 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3914
3915 #. type: Plain text
3916 #: build/C/man2/recv.2:456
3917 msgid ""
3918 "The receive was interrupted by delivery of a signal before any data were "
3919 "available; see B<signal>(7)."
3920 msgstr ""
3921 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3922
3923 #. type: Plain text
3924 #: build/C/man2/recv.2:460 build/C/man2/send.2:355
3925 msgid "Invalid argument passed."
3926 msgstr "不正な引き数が渡された。"
3927
3928 #. type: Plain text
3929 #: build/C/man2/recv.2:464
3930 msgid "Could not allocate memory for B<recvmsg>()."
3931 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3932
3933 #. type: TP
3934 #: build/C/man2/recv.2:464 build/C/man2/send.2:378
3935 #, no-wrap
3936 msgid "B<ENOTCONN>"
3937 msgstr "B<ENOTCONN>"
3938
3939 #. type: Plain text
3940 #: build/C/man2/recv.2:471
3941 msgid ""
3942 "The socket is associated with a connection-oriented protocol and has not "
3943 "been connected (see B<connect>(2)  and B<accept>(2))."
3944 msgstr ""
3945 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3946 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3947
3948 #. type: Plain text
3949 #: build/C/man2/recv.2:476
3950 msgid "The argument I<sockfd> does not refer to a socket."
3951 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3952
3953 #. type: Plain text
3954 #: build/C/man2/recv.2:479
3955 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3956 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3957
3958 #. type: Plain text
3959 #: build/C/man2/recv.2:486
3960 msgid ""
3961 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3962 "flags."
3963 msgstr ""
3964 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3965 "されている。"
3966
3967 #. type: Plain text
3968 #: build/C/man2/recv.2:492
3969 msgid "The I<socklen_t> type was invented by POSIX.  See also B<accept>(2)."
3970 msgstr ""
3971
3972 #.  glibc bug raised 12 Mar 2006
3973 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3974 #.  The problem is an underlying kernel issue: the size of the
3975 #.  __kernel_size_t type used to type this field varies
3976 #.  across architectures, but socklen_t is always 32 bits.
3977 #. type: Plain text
3978 #: build/C/man2/recv.2:506 build/C/man2/send.2:428
3979 msgid ""
3980 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3981 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3982 "I<size_t>."
3983 msgstr ""
3984 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3985 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3986 "ある。"
3987
3988 #. type: Plain text
3989 #: build/C/man2/recv.2:511
3990 msgid ""
3991 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3992 "can be used to receive multiple datagrams in a single call."
3993 msgstr ""
3994 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3995 "固有の システムコールに関する情報が書かれている。"
3996
3997 #. type: Plain text
3998 #: build/C/man2/recv.2:516
3999 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
4000 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
4001
4002 #. type: Plain text
4003 #: build/C/man2/recv.2:527
4004 msgid ""
4005 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4006 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4007 msgstr ""
4008 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4009 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4010
4011 #. type: TH
4012 #: build/C/man2/recvmmsg.2:31
4013 #, no-wrap
4014 msgid "RECVMMSG"
4015 msgstr "RECVMMSG"
4016
4017 #. type: TH
4018 #: build/C/man2/recvmmsg.2:31
4019 #, fuzzy, no-wrap
4020 #| msgid "2014-05-10"
4021 msgid "2014-06-13"
4022 msgstr "2014-05-10"
4023
4024 #. type: Plain text
4025 #: build/C/man2/recvmmsg.2:34
4026 msgid "recvmmsg - receive multiple messages on a socket"
4027 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
4028
4029 #. type: Plain text
4030 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
4031 #, fuzzy, no-wrap
4032 #| msgid ""
4033 #| "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
4034 #| "B<#include E<lt>sys/socket.hE<gt>>\n"
4035 msgid ""
4036 "B<#define _GNU_SOURCE          /* See feature_test_macros(7) */>\n"
4037 "B<#include E<lt>sys/socket.hE<gt>>\n"
4038 msgstr ""
4039 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
4040 "B<#include E<lt>sys/socket.hE<gt>>\n"
4041
4042 #. type: Plain text
4043 #: build/C/man2/recvmmsg.2:41
4044 #, no-wrap
4045 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4046 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4047
4048 #. type: Plain text
4049 #: build/C/man2/recvmmsg.2:43
4050 #, no-wrap
4051 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4052 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4053
4054 #. type: Plain text
4055 #: build/C/man2/recvmmsg.2:55
4056 msgid ""
4057 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
4058 "the caller to receive multiple messages from a socket using a single system "
4059 "call.  (This has performance benefits for some applications.)  A further "
4060 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
4061 "operation."
4062 msgstr ""
4063 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4064 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4065 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4066 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4067
4068 #. type: Plain text
4069 #: build/C/man2/recvmmsg.2:59
4070 msgid ""
4071 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4072 "from."
4073 msgstr ""
4074 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
4075
4076 #. type: Plain text
4077 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4078 msgid ""
4079 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4080 "The size of this array is specified in I<vlen>."
4081 msgstr ""
4082 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4083 "I<vlen> で指定する。"
4084
4085 #. type: Plain text
4086 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4087 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4088 msgstr ""
4089 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4090
4091 #. type: Plain text
4092 #: build/C/man2/recvmmsg.2:80
4093 #, no-wrap
4094 msgid ""
4095 "struct mmsghdr {\n"
4096 "    struct msghdr msg_hdr;  /* Message header */\n"
4097 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4098 "};\n"
4099 msgstr ""
4100 "struct mmsghdr {\n"
4101 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
4102 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
4103 "};\n"
4104
4105 #. type: Plain text
4106 #: build/C/man2/recvmmsg.2:95
4107 msgid ""
4108 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
4109 "B<recvmsg>(2).  The I<msg_len> field is the number of bytes returned for the "
4110 "message in the entry.  This field has the same value as the return value of "
4111 "a single B<recvmsg>(2)  on the header."
4112 msgstr ""
4113 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4114 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4115 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4116 "る。"
4117
4118 #. type: Plain text
4119 #: build/C/man2/recvmmsg.2:102
4120 msgid ""
4121 "The I<flags> argument contains flags ORed together.  The flags are the same "
4122 "as documented for B<recvmsg>(2), with the following addition:"
4123 msgstr ""
4124 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4125 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4126
4127 #. type: TP
4128 #: build/C/man2/recvmmsg.2:102
4129 #, no-wrap
4130 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4131 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4132
4133 #. type: Plain text
4134 #: build/C/man2/recvmmsg.2:107
4135 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4136 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4137
4138 #. type: Plain text
4139 #: build/C/man2/recvmmsg.2:122
4140 msgid ""
4141 "The I<timeout> argument points to a I<struct timespec> (see "
4142 "B<clock_gettime>(2))  defining a timeout (seconds plus nanoseconds) for the "
4143 "receive operation (I<but see BUGS!>).  (This interval will be rounded up to "
4144 "the system clock granularity, and kernel scheduling delays mean that the "
4145 "blocking interval may overrun by a small amount.)  If I<timeout> is NULL, "
4146 "then the operation blocks indefinitely."
4147 msgstr ""
4148 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4149 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (I<ただし、"
4150 "バグを参照のこと>) (待ち時間はシステムクロックの粒度に切り上げられ、カーネル"
4151 "のスケジューリング遅延により少しだけ長くなる可能性がある)。 I<timeout>が "
4152 "NULL の場合、 受信操作は無期限に停止 (block) する。"
4153
4154 #. type: Plain text
4155 #: build/C/man2/recvmmsg.2:133
4156 msgid ""
4157 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4158 "received or until the timeout expires.  A nonblocking call reads as many "
4159 "messages as are available (up to the limit specified by I<vlen>)  and "
4160 "returns immediately."
4161 msgstr ""
4162 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4163 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4164 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4165 "すぐに返る。"
4166
4167 #. type: Plain text
4168 #: build/C/man2/recvmmsg.2:148
4169 msgid ""
4170 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4171 "to contain information about each received message: I<msg_len> contains the "
4172 "size of the received message; the subfields of I<msg_hdr> are updated as "
4173 "described in B<recvmsg>(2).  The return value of the call indicates the "
4174 "number of elements of I<msgvec> that have been updated."
4175 msgstr ""
4176 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4177 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4178 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4179 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4180 "数である。"
4181
4182 #. type: Plain text
4183 #: build/C/man2/recvmmsg.2:156
4184 msgid ""
4185 "On success, B<recvmmsg>()  returns the number of messages received in "
4186 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4187 "error."
4188 msgstr ""
4189 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4190 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4191
4192 #. type: Plain text
4193 #: build/C/man2/recvmmsg.2:160
4194 msgid ""
4195 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4196 msgstr ""
4197 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4198 "がある。"
4199
4200 #. type: Plain text
4201 #: build/C/man2/recvmmsg.2:164
4202 msgid "I<timeout> is invalid."
4203 msgstr "I<timeout> が無効である。"
4204
4205 #. type: Plain text
4206 #: build/C/man2/recvmmsg.2:169
4207 msgid ""
4208 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4209 "was added in version 2.12."
4210 msgstr ""
4211 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4212 "はバージョン 2.12 以降で利用可能である。"
4213
4214 #. type: Plain text
4215 #: build/C/man2/recvmmsg.2:172
4216 msgid "B<recvmmsg>()  is Linux-specific."
4217 msgstr "B<recvmmsg>() は Linux 固有である。"
4218
4219 #. type: Plain text
4220 #: build/C/man2/recvmmsg.2:180
4221 msgid ""
4222 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4223 "socket and stores them in multiple buffers.  The call returns if all buffers "
4224 "are filled or if the timeout specified has expired."
4225 msgstr ""
4226 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4227 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4228 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4229
4230 #. type: Plain text
4231 #: build/C/man2/recvmmsg.2:183
4232 msgid ""
4233 "The following snippet periodically generates UDP datagrams containing a "
4234 "random number:"
4235 msgstr ""
4236 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4237 "る。"
4238
4239 #. type: Plain text
4240 #: build/C/man2/recvmmsg.2:188
4241 #, no-wrap
4242 msgid ""
4243 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4244 "B<sleep 0.25; done>\n"
4245 msgstr ""
4246 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4247 "B<sleep 0.25; done>\n"
4248
4249 #. type: Plain text
4250 #: build/C/man2/recvmmsg.2:193
4251 msgid ""
4252 "These datagrams are read by the example application, which can give the "
4253 "following output:"
4254 msgstr ""
4255 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4256 "が得られる。"
4257
4258 #. type: Plain text
4259 #: build/C/man2/recvmmsg.2:203
4260 #, no-wrap
4261 msgid ""
4262 "$B< ./a.out>\n"
4263 "5 messages received\n"
4264 "1 11782\n"
4265 "2 11345\n"
4266 "3 304\n"
4267 "4 13514\n"
4268 "5 28421\n"
4269 msgstr ""
4270 "$B< ./a.out>\n"
4271 "5 messages received\n"
4272 "1 11782\n"
4273 "2 11345\n"
4274 "3 304\n"
4275 "4 13514\n"
4276 "5 28421\n"
4277
4278 #. type: Plain text
4279 #: build/C/man2/recvmmsg.2:214
4280 #, no-wrap
4281 msgid ""
4282 "#define _GNU_SOURCE\n"
4283 "#include E<lt>netinet/ip.hE<gt>\n"
4284 "#include E<lt>stdio.hE<gt>\n"
4285 "#include E<lt>stdlib.hE<gt>\n"
4286 "#include E<lt>string.hE<gt>\n"
4287 "#include E<lt>sys/socket.hE<gt>\n"
4288 msgstr ""
4289 "#define _GNU_SOURCE\n"
4290 "#include E<lt>netinet/ip.hE<gt>\n"
4291 "#include E<lt>stdio.hE<gt>\n"
4292 "#include E<lt>stdlib.hE<gt>\n"
4293 "#include E<lt>string.hE<gt>\n"
4294 "#include E<lt>sys/socket.hE<gt>\n"
4295
4296 #. type: Plain text
4297 #: build/C/man2/recvmmsg.2:227
4298 #, no-wrap
4299 msgid ""
4300 "int\n"
4301 "main(void)\n"
4302 "{\n"
4303 "#define VLEN 10\n"
4304 "#define BUFSIZE 200\n"
4305 "#define TIMEOUT 1\n"
4306 "    int sockfd, retval, i;\n"
4307 "    struct sockaddr_in sa;\n"
4308 "    struct mmsghdr msgs[VLEN];\n"
4309 "    struct iovec iovecs[VLEN];\n"
4310 "    char bufs[VLEN][BUFSIZE+1];\n"
4311 "    struct timespec timeout;\n"
4312 msgstr ""
4313 "int\n"
4314 "main(void)\n"
4315 "{\n"
4316 "#define VLEN 10\n"
4317 "#define BUFSIZE 200\n"
4318 "#define TIMEOUT 1\n"
4319 "    int sockfd, retval, i;\n"
4320 "    struct sockaddr_in sa;\n"
4321 "    struct mmsghdr msgs[VLEN];\n"
4322 "    struct iovec iovecs[VLEN];\n"
4323 "    char bufs[VLEN][BUFSIZE+1];\n"
4324 "    struct timespec timeout;\n"
4325
4326 #. type: Plain text
4327 #: build/C/man2/recvmmsg.2:233 build/C/man2/sendmmsg.2:201
4328 #, no-wrap
4329 msgid ""
4330 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4331 "    if (sockfd == -1) {\n"
4332 "        perror(\"socket()\");\n"
4333 "        exit(EXIT_FAILURE);\n"
4334 "    }\n"
4335 msgstr ""
4336 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4337 "    if (sockfd == -1) {\n"
4338 "        perror(\"socket()\");\n"
4339 "        exit(EXIT_FAILURE);\n"
4340 "    }\n"
4341
4342 #. type: Plain text
4343 #: build/C/man2/recvmmsg.2:241
4344 #, no-wrap
4345 msgid ""
4346 "    sa.sin_family = AF_INET;\n"
4347 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4348 "    sa.sin_port = htons(1234);\n"
4349 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4350 "        perror(\"bind()\");\n"
4351 "        exit(EXIT_FAILURE);\n"
4352 "    }\n"
4353 msgstr ""
4354 "    sa.sin_family = AF_INET;\n"
4355 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4356 "    sa.sin_port = htons(1234);\n"
4357 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4358 "        perror(\"bind()\");\n"
4359 "        exit(EXIT_FAILURE);\n"
4360 "    }\n"
4361
4362 #. type: Plain text
4363 #: build/C/man2/recvmmsg.2:249
4364 #, no-wrap
4365 msgid ""
4366 "    memset(msgs, 0, sizeof(msgs));\n"
4367 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4368 "        iovecs[i].iov_base         = bufs[i];\n"
4369 "        iovecs[i].iov_len          = BUFSIZE;\n"
4370 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4371 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4372 "    }\n"
4373 msgstr ""
4374 "    memset(msgs, 0, sizeof(msgs));\n"
4375 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4376 "        iovecs[i].iov_base         = bufs[i];\n"
4377 "        iovecs[i].iov_len          = BUFSIZE;\n"
4378 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4379 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4380 "    }\n"
4381
4382 #. type: Plain text
4383 #: build/C/man2/recvmmsg.2:252
4384 #, no-wrap
4385 msgid ""
4386 "    timeout.tv_sec = TIMEOUT;\n"
4387 "    timeout.tv_nsec = 0;\n"
4388 msgstr ""
4389 "    timeout.tv_sec = TIMEOUT;\n"
4390 "    timeout.tv_nsec = 0;\n"
4391
4392 #. type: Plain text
4393 #: build/C/man2/recvmmsg.2:258
4394 #, no-wrap
4395 msgid ""
4396 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4397 "    if (retval == -1) {\n"
4398 "        perror(\"recvmmsg()\");\n"
4399 "        exit(EXIT_FAILURE);\n"
4400 "    }\n"
4401 msgstr ""
4402 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4403 "    if (retval == -1) {\n"
4404 "        perror(\"recvmmsg()\");\n"
4405 "        exit(EXIT_FAILURE);\n"
4406 "    }\n"
4407
4408 #. type: Plain text
4409 #: build/C/man2/recvmmsg.2:266
4410 #, no-wrap
4411 msgid ""
4412 "    printf(\"%d messages received\\en\", retval);\n"
4413 "    for (i = 0; i E<lt> retval; i++) {\n"
4414 "        bufs[i][msgs[i].msg_len] = 0;\n"
4415 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4416 "    }\n"
4417 "    exit(EXIT_SUCCESS);\n"
4418 "}\n"
4419 msgstr ""
4420 "    printf(\"%d messages received\\en\", retval);\n"
4421 "    for (i = 0; i E<lt> retval; i++) {\n"
4422 "        bufs[i][msgs[i].msg_len] = 0;\n"
4423 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4424 "    }\n"
4425 "    exit(EXIT_SUCCESS);\n"
4426 "}\n"
4427
4428 #.  FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=75371
4429 #.  http://thread.gmane.org/gmane.linux.man/5677
4430 #. type: Plain text
4431 #: build/C/man2/recvmmsg.2:278
4432 msgid ""
4433 "The I<timeout> argument does not work as intended.  The timeout is checked "
4434 "only after the receipt of each datagram, so that if up to I<vlen-1> "
4435 "datagrams are received before the timeout expires, but then no further "
4436 "datagrams are received, the call will block forever."
4437 msgstr ""
4438 "I<timeout> 引き数は意図した通りには動作しない。 タイムアウトは各データグラム"
4439 "の受信後にのみチェックされる。 そのため、 タイムアウトが満了する前に "
4440 "I<vlen-1> 個のデータグラムを受信し、 その後全くデータグラムを受信しなかった場"
4441 "合、 呼び出しはずっと停止し続けてしまう。"
4442
4443 #. type: Plain text
4444 #: build/C/man2/recvmmsg.2:285
4445 msgid ""
4446 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4447 "B<socket>(2), B<socket>(7)"
4448 msgstr ""
4449 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4450 "B<socket>(2), B<socket>(7)"
4451
4452 #. type: TH
4453 #: build/C/man2/select.2:38
4454 #, no-wrap
4455 msgid "SELECT"
4456 msgstr "SELECT"
4457
4458 #. type: Plain text
4459 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4460 msgid ""
4461 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4462 "multiplexing"
4463 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4464
4465 #. type: Plain text
4466 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4467 #, no-wrap
4468 msgid "/* According to POSIX.1-2001 */\n"
4469 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4470
4471 #. type: Plain text
4472 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4473 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4474 #, no-wrap
4475 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4476 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4477
4478 #. type: Plain text
4479 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4480 #, no-wrap
4481 msgid "/* According to earlier standards */\n"
4482 msgstr "/* 以前の規格に従う場合 */\n"
4483
4484 #. type: Plain text
4485 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4486 #, no-wrap
4487 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4488 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4489
4490 #. type: Plain text
4491 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4492 #, no-wrap
4493 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4494 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4495
4496 #. type: Plain text
4497 #: build/C/man2/select.2:58
4498 #, no-wrap
4499 msgid ""
4500 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4501 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4502 msgstr ""
4503 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4504 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4505
4506 #. type: Plain text
4507 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4508 #, no-wrap
4509 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4510 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4511
4512 #. type: Plain text
4513 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4514 #, no-wrap
4515 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4516 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4517
4518 #. type: Plain text
4519 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4520 #, no-wrap
4521 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4522 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4523
4524 #. type: Plain text
4525 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4526 #, no-wrap
4527 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4528 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4529
4530 #. type: Plain text
4531 #: build/C/man2/select.2:72
4532 #, no-wrap
4533 msgid ""
4534 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4535 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4536 "B<            const sigset_t *>I<sigmask>B<);>\n"
4537 msgstr ""
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
4542 #. type: Plain text
4543 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4544 #: build/C/man3/sockatmark.3:36
4545 msgid ""
4546 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4547 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4548
4549 #. type: Plain text
4550 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4551 msgid ""
4552 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4553 "600"
4554 msgstr ""
4555 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4556 "600"
4557
4558 #. type: Plain text
4559 #: build/C/man2/select.2:93
4560 #, fuzzy
4561 #| msgid ""
4562 #| "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4563 #| "descriptors, waiting until one or more of the file descriptors become "
4564 #| "\"ready\" for some class of I/O operation (e.g., input possible).  A file "
4565 #| "descriptor is considered ready if it is possible to perform the "
4566 #| "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4567 msgid ""
4568 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4569 "descriptors, waiting until one or more of the file descriptors become \"ready"
4570 "\" for some class of I/O operation (e.g., input possible).  A file "
4571 "descriptor is considered ready if it is possible to perform a corresponding "
4572 "I/O operation (e.g., B<read>(2)  without blocking, or a sufficiently small "
4573 "B<write>(2))."
4574 msgstr ""
4575 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4576 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4577 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4578 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4579 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4580 "意味する。"
4581
4582 #. type: Plain text
4583 #: build/C/man2/select.2:99
4584 msgid ""
4585 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4586 "these three differences:"
4587 msgstr ""
4588 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4589
4590 #. type: TP
4591 #: build/C/man2/select.2:99
4592 #, no-wrap
4593 msgid "(i)"
4594 msgstr "(i)"
4595
4596 #. type: Plain text
4597 #: build/C/man2/select.2:109
4598 msgid ""
4599 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4600 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4601 "and nanoseconds)."
4602 msgstr ""
4603 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4604 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4605 "timespec> (秒・ナノ秒単位) を用いる。"
4606
4607 #. type: TP
4608 #: build/C/man2/select.2:109
4609 #, no-wrap
4610 msgid "(ii)"
4611 msgstr "(ii)"
4612
4613 #. type: Plain text
4614 #: build/C/man2/select.2:117
4615 msgid ""
4616 "B<select>()  may update the I<timeout> argument to indicate how much time "
4617 "was left.  B<pselect>()  does not change this argument."
4618 msgstr ""
4619 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4620 "B<pselect>()  はこの引き数を変更しない。"
4621
4622 #. type: TP
4623 #: build/C/man2/select.2:117
4624 #, no-wrap
4625 msgid "(iii)"
4626 msgstr "(iii)"
4627
4628 #. type: Plain text
4629 #: build/C/man2/select.2:126
4630 msgid ""
4631 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4632 "with NULL I<sigmask>."
4633 msgstr ""
4634 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4635 "指定した場合の B<pselect>()  と同じである。"
4636
4637 #. type: Plain text
4638 #: build/C/man2/select.2:144
4639 #, fuzzy
4640 #| msgid ""
4641 #| "Three independent sets of file descriptors are watched.  Those listed in "
4642 #| "I<readfds> will be watched to see if characters become available for "
4643 #| "reading (more precisely, to see if a read will not block; in particular, "
4644 #| "a file descriptor is also ready on end-of-file), those in I<writefds> "
4645 #| "will be watched to see if a write will not block, and those in "
4646 #| "I<exceptfds> will be watched for exceptions.  On exit, the sets are "
4647 #| "modified in place to indicate which file descriptors actually changed "
4648 #| "status.  Each of the three file descriptor sets may be specified as NULL "
4649 #| "if no file descriptors are to be watched for the corresponding class of "
4650 #| "events."
4651 msgid ""
4652 "Three independent sets of file descriptors are watched.  Those listed in "
4653 "I<readfds> will be watched to see if characters become available for reading "
4654 "(more precisely, to see if a read will not block; in particular, a file "
4655 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4656 "watched to see if space is available for write (though a large write may "
4657 "still block), and those in I<exceptfds> will be watched for exceptions.  On "
4658 "exit, the sets are modified in place to indicate which file descriptors "
4659 "actually changed status.  Each of the three file descriptor sets may be "
4660 "specified as NULL if no file descriptors are to be watched for the "
4661 "corresponding class of events."
4662 msgstr ""
4663 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4664 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4665 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4666 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4667 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4668 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4669 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4670 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4671 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4672 "指定することができる。"
4673
4674 #. type: Plain text
4675 #: build/C/man2/select.2:157
4676 msgid ""
4677 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4678 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4679 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4680 "part of the set; this is useful after B<select>()  returns."
4681 msgstr ""
4682 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4683 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4684 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4685 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4686 "る。"
4687
4688 #. type: Plain text
4689 #: build/C/man2/select.2:160
4690 msgid ""
4691 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4692 "plus 1."
4693 msgstr ""
4694 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4695 "のである。"
4696
4697 #. type: Plain text
4698 #: build/C/man2/select.2:167
4699 msgid ""
4700 "The I<timeout> argument specifies the interval that B<select>()  should "
4701 "block waiting for a file descriptor to become ready.  The call will block "
4702 "until either:"
4703 msgstr ""
4704 "I<timeout> 引き数は、 B<select>() がファイルディスクリプタが ready になるのを"
4705 "待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
4706
4707 #. type: IP
4708 #: build/C/man2/select.2:167 build/C/man2/select.2:169
4709 #: build/C/man2/select.2:171
4710 #, no-wrap
4711 msgid "*"
4712 msgstr "*"
4713
4714 #. type: Plain text
4715 #: build/C/man2/select.2:169
4716 msgid "a file descriptor becomes ready;"
4717 msgstr "ファイルディスクリプタが利用可能になる。"
4718
4719 #. type: Plain text
4720 #: build/C/man2/select.2:171
4721 msgid "the call is interrupted by a signal handler; or"
4722 msgstr "システムコールがシグナルハンドラにより割り込まれた。"
4723
4724 #. type: Plain text
4725 #: build/C/man2/select.2:173
4726 msgid "the timeout expires."
4727 msgstr "タイムアウト時間が満了した。"
4728
4729 #. type: Plain text
4730 #: build/C/man2/select.2:190
4731 msgid ""
4732 "Note that the I<timeout> interval will be rounded up to the system clock "
4733 "granularity, and kernel scheduling delays mean that the blocking interval "
4734 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4735 "are zero, then B<select>()  returns immediately.  (This is useful for "
4736 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4737 "indefinitely."
4738 msgstr ""
4739 "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケ"
4740 "ジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 "
4741 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰す"
4742 "る (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に "
4743 "NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) "
4744 "する。"
4745
4746 #. type: Plain text
4747 #: build/C/man2/select.2:200
4748 msgid ""
4749 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4750 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4751 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4752 "restores the original signal mask."
4753 msgstr ""
4754 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4755 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4756 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4757 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4758
4759 #. type: Plain text
4760 #: build/C/man2/select.2:206
4761 msgid ""
4762 "Other than the difference in the precision of the I<timeout> argument, the "
4763 "following B<pselect>()  call:"
4764 msgstr ""
4765 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4766
4767 #. type: Plain text
4768 #: build/C/man2/select.2:210
4769 #, no-wrap
4770 msgid ""
4771 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4772 "                    timeout, &sigmask);\n"
4773 msgstr ""
4774 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4775 "                    timeout, &sigmask);\n"
4776
4777 #. type: Plain text
4778 #: build/C/man2/select.2:215
4779 msgid "is equivalent to I<atomically> executing the following calls:"
4780 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4781
4782 #. type: Plain text
4783 #: build/C/man2/select.2:218
4784 #, no-wrap
4785 msgid "    sigset_t origmask;\n"
4786 msgstr "    sigset_t origmask;\n"
4787
4788 #. type: Plain text
4789 #: build/C/man2/select.2:222
4790 #, no-wrap
4791 msgid ""
4792 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4793 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4794 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4795 msgstr ""
4796 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4797 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4798 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4799
4800 #. type: Plain text
4801 #: build/C/man2/select.2:243
4802 msgid ""
4803 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4804 "either a signal or for a file descriptor to become ready, then an atomic "
4805 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4806 "a global flag and returns.  Then a test of this global flag followed by a "
4807 "call of B<select>()  could hang indefinitely if the signal arrived just "
4808 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4809 "one to first block signals, handle the signals that have come in, then call "
4810 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4811 msgstr ""
4812 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4813 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4814 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4815 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4816 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4817 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4818 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4819 "で、前記の競合を避けることができる。)"
4820
4821 #. type: SS
4822 #: build/C/man2/select.2:243
4823 #, no-wrap
4824 msgid "The timeout"
4825 msgstr "タイムアウト"
4826
4827 #. type: Plain text
4828 #: build/C/man2/select.2:247
4829 msgid ""
4830 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4831 "like"
4832 msgstr ""
4833 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4834
4835 #. type: Plain text
4836 #: build/C/man2/select.2:254
4837 #, no-wrap
4838 msgid ""
4839 "struct timeval {\n"
4840 "    long    tv_sec;         /* seconds */\n"
4841 "    long    tv_usec;        /* microseconds */\n"
4842 "};\n"
4843 msgstr ""
4844 "struct timeval {\n"
4845 "    long    tv_sec;         /* 秒 */\n"
4846 "    long    tv_usec;        /* マイクロ秒 */\n"
4847 "};\n"
4848
4849 #. type: Plain text
4850 #: build/C/man2/select.2:258
4851 msgid "and"
4852 msgstr "や"
4853
4854 #. type: Plain text
4855 #: build/C/man2/select.2:265
4856 #, no-wrap
4857 msgid ""
4858 "struct timespec {\n"
4859 "    long    tv_sec;         /* seconds */\n"
4860 "    long    tv_nsec;        /* nanoseconds */\n"
4861 "};\n"
4862 msgstr ""
4863 "struct timespec {\n"
4864 "    long    tv_sec;         /* 秒 */\n"
4865 "    long    tv_nsec;        /* ナノ秒 */\n"
4866 "};\n"
4867
4868 #. type: Plain text
4869 #: build/C/man2/select.2:269
4870 msgid "(However, see below on the POSIX.1-2001 versions.)"
4871 msgstr ""
4872 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4873 "照)"
4874
4875 #. type: Plain text
4876 #: build/C/man2/select.2:277
4877 msgid ""
4878 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4879 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4880 "precision."
4881 msgstr ""
4882 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4883 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4884 "呼び出すという方法を使っているコードもある。"
4885
4886 #.  .PP - it is rumored that:
4887 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4888 #.  - it is certainly true that:
4889 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4890 #. type: Plain text
4891 #: build/C/man2/select.2:300
4892 msgid ""
4893 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4894 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4895 "either behavior.)  This causes problems both when Linux code which reads "
4896 "I<timeout> is ported to other operating systems, and when code is ported to "
4897 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4898 "without reinitializing it.  Consider I<timeout> to be undefined after "
4899 "B<select>()  returns."
4900 msgstr ""
4901 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4902 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4903 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4904 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4905 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4906 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4907 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4908 "ある。"
4909
4910 #. type: Plain text
4911 #: build/C/man2/select.2:318
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>, I<exceptfds>)  "
4916 "which may be zero if the timeout expires before anything interesting "
4917 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4918 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4919 "undefined."
4920 msgstr ""
4921 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4922 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4923 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4924 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4925 "ならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディスクリ"
4926 "プタ集合は変更されず、 I<timeout> は不定となる。"
4927
4928 #. type: Plain text
4929 #: build/C/man2/select.2:324
4930 msgid ""
4931 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4932 "descriptor that was already closed, or one on which an error has occurred.)"
4933 msgstr ""
4934 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4935 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4936 "タが指定された)。"
4937
4938 #. type: Plain text
4939 #: build/C/man2/select.2:328
4940 msgid "A signal was caught; see B<signal>(7)."
4941 msgstr "シグナルを受信した。"
4942
4943 #. type: Plain text
4944 #: build/C/man2/select.2:334
4945 msgid ""
4946 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4947 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4948
4949 #. type: Plain text
4950 #: build/C/man2/select.2:337
4951 msgid "unable to allocate memory for internal tables."
4952 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4953
4954 #. type: Plain text
4955 #: build/C/man2/select.2:343
4956 msgid ""
4957 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, "
4958 "B<pselect>()  was emulated in glibc (but see BUGS)."
4959 msgstr ""
4960 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4961 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4962
4963 #. type: Plain text
4964 #: build/C/man2/select.2:354
4965 msgid ""
4966 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4967 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4968 "clones of the BSD socket layer (including System\\ V variants).  However, "
4969 "note that the System\\ V variant typically sets the timeout variable before "
4970 "exit, but the BSD variant does not."
4971 msgstr ""
4972 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4973 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4974 "(System\\ V 系も含む) との間でだいたい移植性がある。しかし System\\ V 系では "
4975 "たいがい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注"
4976 "意すること。"
4977
4978 #. type: Plain text
4979 #: build/C/man2/select.2:358
4980 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4981 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4982
4983 #. type: Plain text
4984 #: build/C/man2/select.2:375
4985 msgid ""
4986 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4987 "with a value of I<fd> that is negative or is equal to or larger than "
4988 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4989 "I<fd> to be a valid file descriptor."
4990 msgstr ""
4991 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4992 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4993 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4994 "プタでなければならないと規定されている。"
4995
4996 #. type: Plain text
4997 #: build/C/man2/select.2:384
4998 msgid ""
4999 "Concerning the types involved, the classical situation is that the two "
5000 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
5001 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
5002 "situation is"
5003 msgstr ""
5004 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
5005 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
5006 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
5007
5008 #. type: Plain text
5009 #: build/C/man2/select.2:391
5010 #, no-wrap
5011 msgid ""
5012 "struct timeval {\n"
5013 "    time_t         tv_sec;     /* seconds */\n"
5014 "    suseconds_t    tv_usec;    /* microseconds */\n"
5015 "};\n"
5016 msgstr ""
5017 "struct timeval {\n"
5018 "\t time_t         tv_sec;     /* 秒 */\n"
5019 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
5020 "};\n"
5021
5022 #. type: Plain text
5023 #: build/C/man2/select.2:402
5024 msgid ""
5025 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
5026 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
5027 msgstr ""
5028 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
5029 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
5030
5031 #. type: Plain text
5032 #: build/C/man2/select.2:414
5033 msgid ""
5034 "Concerning prototypes, the classical situation is that one should include "
5035 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
5036 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
5037 msgstr ""
5038 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
5039 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
5040 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
5041 "インクルードすればよい。"
5042
5043 #. type: Plain text
5044 #: build/C/man2/select.2:425
5045 #, fuzzy
5046 #| msgid ""
5047 #| "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under "
5048 #| "glibc 2.0 and later this header exists.  Under glibc 2.0 it "
5049 #| "unconditionally gives the wrong prototype for B<pselect>().  Under glibc "
5050 #| "2.1 to 2.2.1 it gives B<pselect>()  when B<_GNU_SOURCE> is defined.  "
5051 #| "Since glibc 2.2.2 the requirements are as shown in the SYNOPSIS."
5052 msgid ""
5053 "Under glibc 2.0, I<E<lt>sys/select.hE<gt>> gives the wrong prototype for "
5054 "B<pselect>().  Under glibc 2.1 to 2.2.1, it gives B<pselect>()  when "
5055 "B<_GNU_SOURCE> is defined.  Since glibc 2.2.2, the requirements are as shown "
5056 "in the SYNOPSIS."
5057 msgstr ""
5058 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
5059 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
5060 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
5061 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
5062 "使用するには、「書式」に記載された要件を満たす必要がある。"
5063
5064 #. type: SS
5065 #: build/C/man2/select.2:425
5066 #, no-wrap
5067 msgid "Multithreaded applications"
5068 msgstr "マルチスレッド・アプリケーション"
5069
5070 #. type: Plain text
5071 #: build/C/man2/select.2:442
5072 msgid ""
5073 "If a file descriptor being monitored by B<select>()  is closed in another "
5074 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
5075 "unblocks and returns, with an indication that the file descriptor is ready "
5076 "(a subsequent I/O operation will likely fail with an error, unless another "
5077 "the file descriptor reopened between the time B<select>()  returned and the "
5078 "I/O operations was performed).  On Linux (and some other systems), closing "
5079 "the file descriptor in another thread has no effect on B<select>().  In "
5080 "summary, any application that relies on a particular behavior in this "
5081 "scenario must be considered buggy."
5082 msgstr ""
5083 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
5084 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
5085 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
5086 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
5087 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
5088 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
5089 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
5090 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
5091 "ている」と考えなければならない。"
5092
5093 #. type: SS
5094 #: build/C/man2/select.2:442
5095 #, no-wrap
5096 msgid "C library/kernel ABI differences"
5097 msgstr ""
5098
5099 #. type: Plain text
5100 #: build/C/man2/select.2:450
5101 msgid ""
5102 "The B<pselect>()  interface described in this page is implemented by glibc.  "
5103 "The underlying Linux system call is named B<pselect6>().  This system call "
5104 "has somewhat different behavior from the glibc wrapper function."
5105 msgstr ""
5106 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5107 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5108 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5109 "関数とは少し違った動作をする。"
5110
5111 #. type: Plain text
5112 #: build/C/man2/select.2:465
5113 msgid ""
5114 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5115 "However, the glibc wrapper function hides this behavior by using a local "
5116 "variable for the timeout argument that is passed to the system call.  Thus, "
5117 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5118 "this is the behavior required by POSIX.1-2001."
5119 msgstr ""
5120 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5121 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5122 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5123 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5124 "これが POSIX.1-2001 が要求している動作である。"
5125
5126 #. type: Plain text
5127 #: build/C/man2/select.2:471
5128 msgid ""
5129 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5130 "*> pointer, but is instead a structure of the form:"
5131 msgstr ""
5132 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5133 "ポインタではなく、以下に示す構造体である。"
5134
5135 #. type: Plain text
5136 #: build/C/man2/select.2:479
5137 #, no-wrap
5138 msgid ""
5139 "struct {\n"
5140 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5141 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5142 "                               to by 'ss' */\n"
5143 "};\n"
5144 msgstr ""
5145 "struct {\n"
5146 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
5147 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5148 "                               (バイト数) */\n"
5149 "};\n"
5150
5151 #. type: Plain text
5152 #: build/C/man2/select.2:486
5153 msgid ""
5154 "This allows the system call to obtain both a pointer to the signal set and "
5155 "its size, while allowing for the fact that most architectures support a "
5156 "maximum of 6 arguments to a system call."
5157 msgstr ""
5158 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5159 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5160 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5161 "のサイズの両方を取得することができるのである。"
5162
5163 #. type: Plain text
5164 #: build/C/man2/select.2:492
5165 msgid ""
5166 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5167 "argument."
5168 msgstr ""
5169 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5170 "されていた。"
5171
5172 #. type: Plain text
5173 #: build/C/man2/select.2:505
5174 msgid ""
5175 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5176 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5177 "implementation remained vulnerable to the very race condition that "
5178 "B<pselect>()  was designed to prevent.  Modern versions of glibc use the "
5179 "(race-free)  B<pselect>()  system call on kernels where it is provided."
5180 msgstr ""
5181 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5182 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5183 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5184 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5185 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5186 "が使用される。"
5187
5188 #. type: Plain text
5189 #: build/C/man2/select.2:518
5190 msgid ""
5191 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5192 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5193 "signal handler writes a byte to a pipe whose other end is monitored by "
5194 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5195 "to a pipe that may be full or reading from a pipe that may be empty, "
5196 "nonblocking I/O is used when reading from and writing to the pipe.)"
5197 msgstr ""
5198 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5199 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5200 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5201 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5202 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5203 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5204 "(nonblocking) I/O を使用するとよい)。"
5205
5206 #.  Stevens discusses a case where accept can block after select
5207 #.  returns successfully because of an intervening RST from the client.
5208 #.  Maybe the kernel should have returned EIO in such a situation?
5209 #. type: Plain text
5210 #: build/C/man2/select.2:534
5211 msgid ""
5212 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5213 "reading\", while nevertheless a subsequent read blocks.  This could for "
5214 "example happen when data has arrived but upon examination has wrong checksum "
5215 "and is discarded.  There may be other circumstances in which a file "
5216 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5217 "B<O_NONBLOCK> on sockets that should not block."
5218 msgstr ""
5219 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
5220 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5221 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5222 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5223 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5224 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5225
5226 #. type: Plain text
5227 #: build/C/man2/select.2:549
5228 msgid ""
5229 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5230 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5231 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5232 "behavior, but the glibc wrapper hides this behavior by internally copying "
5233 "the I<timeout> to a local variable and passing that variable to the system "
5234 "call."
5235 msgstr ""
5236 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
5237 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5238 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5239 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5240 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5241 "数をシステムコールに渡している。"
5242
5243 #. type: Plain text
5244 #: build/C/man2/select.2:556
5245 #, no-wrap
5246 msgid ""
5247 "#include E<lt>stdio.hE<gt>\n"
5248 "#include E<lt>stdlib.hE<gt>\n"
5249 "#include E<lt>sys/time.hE<gt>\n"
5250 "#include E<lt>sys/types.hE<gt>\n"
5251 "#include E<lt>unistd.hE<gt>\n"
5252 msgstr ""
5253 "#include E<lt>stdio.hE<gt>\n"
5254 "#include E<lt>stdlib.hE<gt>\n"
5255 "#include E<lt>sys/time.hE<gt>\n"
5256 "#include E<lt>sys/types.hE<gt>\n"
5257 "#include E<lt>unistd.hE<gt>\n"
5258
5259 #. type: Plain text
5260 #: build/C/man2/select.2:563
5261 #, no-wrap
5262 msgid ""
5263 "int\n"
5264 "main(void)\n"
5265 "{\n"
5266 "    fd_set rfds;\n"
5267 "    struct timeval tv;\n"
5268 "    int retval;\n"
5269 msgstr ""
5270 "int\n"
5271 "main(void)\n"
5272 "{\n"
5273 "    fd_set rfds;\n"
5274 "    struct timeval tv;\n"
5275 "    int retval;\n"
5276
5277 #. type: Plain text
5278 #: build/C/man2/select.2:567
5279 #, no-wrap
5280 msgid ""
5281 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5282 "    FD_ZERO(&rfds);\n"
5283 "    FD_SET(0, &rfds);\n"
5284 msgstr ""
5285 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5286 "    FD_ZERO(&rfds);\n"
5287 "    FD_SET(0, &rfds);\n"
5288
5289 #. type: Plain text
5290 #: build/C/man2/select.2:571
5291 #, no-wrap
5292 msgid ""
5293 "    /* Wait up to five seconds. */\n"
5294 "    tv.tv_sec = 5;\n"
5295 "    tv.tv_usec = 0;\n"
5296 msgstr ""
5297 "    /* 5 秒間監視する。*/\n"
5298 "    tv.tv_sec = 5;\n"
5299 "    tv.tv_usec = 0;\n"
5300
5301 #. type: Plain text
5302 #: build/C/man2/select.2:574
5303 #, no-wrap
5304 msgid ""
5305 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5306 "    /* Don't rely on the value of tv now! */\n"
5307 msgstr ""
5308 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5309 "    /* この時点での tv の値を信頼してはならない。*/\n"
5310
5311 #. type: Plain text
5312 #: build/C/man2/select.2:582
5313 #, no-wrap
5314 msgid ""
5315 "    if (retval == -1)\n"
5316 "        perror(\"select()\");\n"
5317 "    else if (retval)\n"
5318 "        printf(\"Data is available now.\\en\");\n"
5319 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5320 "    else\n"
5321 "        printf(\"No data within five seconds.\\en\");\n"
5322 msgstr ""
5323 "    if (retval == -1)\n"
5324 "\tperror(\"select()\");\n"
5325 "    else if (retval)\n"
5326 "        printf(\"今、データが取得できました。\\en\");\n"
5327 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5328 "    else\n"
5329 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5330
5331 #. type: Plain text
5332 #: build/C/man2/select.2:597
5333 msgid ""
5334 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5335 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5336 msgstr ""
5337 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5338 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5339
5340 #. type: Plain text
5341 #: build/C/man2/select.2:600
5342 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5343 msgstr ""
5344 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5345
5346 #. type: TH
5347 #: build/C/man2/select_tut.2:32
5348 #, no-wrap
5349 msgid "SELECT_TUT"
5350 msgstr "SELECT_TUT"
5351
5352 #. type: TH
5353 #: build/C/man2/select_tut.2:32
5354 #, no-wrap
5355 msgid "2013-12-30"
5356 msgstr "2013-12-30"
5357
5358 #. type: Plain text
5359 #: build/C/man2/select_tut.2:52
5360 #, no-wrap
5361 msgid ""
5362 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5363 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5364 msgstr ""
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
5368 #. type: Plain text
5369 #: build/C/man2/select_tut.2:66
5370 #, no-wrap
5371 msgid ""
5372 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5373 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5374 "B<            const sigset_t *>I<sigmask>B<);>\n"
5375 msgstr ""
5376 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5377 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5378 "B<            const sigset_t *>I<sigmask>B<);>\n"
5379
5380 #. type: Plain text
5381 #: build/C/man2/select_tut.2:83
5382 msgid ""
5383 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5384 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5385 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5386 "occurred on any of the descriptors."
5387 msgstr ""
5388 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5389 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5390 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5391 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5392 "る。"
5393
5394 #. type: Plain text
5395 #: build/C/man2/select_tut.2:108
5396 msgid ""
5397 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5398 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5399 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5400 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5401 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5402 "according to the rules described below; after calling B<select>()  you can "
5403 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5404 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5405 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5406 "descriptor from a set."
5407 msgstr ""
5408 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5409 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5410 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5411 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5412 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5413 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5414 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5415 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5416 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5417 "のファイルディスクリプタの削除を行う。"
5418
5419 #. type: SS
5420 #: build/C/man2/select_tut.2:108
5421 #, no-wrap
5422 msgid "Arguments"
5423 msgstr "引き数"
5424
5425 #. type: TP
5426 #: build/C/man2/select_tut.2:109
5427 #, no-wrap
5428 msgid "I<readfds>"
5429 msgstr "I<readfds>"
5430
5431 #. type: Plain text
5432 #: build/C/man2/select_tut.2:118
5433 msgid ""
5434 "This set is watched to see if data is available for reading from any of its "
5435 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5436 "cleared of all file descriptors except for those that are immediately "
5437 "available for reading."
5438 msgstr ""
5439 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5440 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5441 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5442
5443 #. type: TP
5444 #: build/C/man2/select_tut.2:118
5445 #, no-wrap
5446 msgid "I<writefds>"
5447 msgstr "I<writefds>"
5448
5449 #. type: Plain text
5450 #: build/C/man2/select_tut.2:127
5451 msgid ""
5452 "This set is watched to see if there is space to write data to any of its "
5453 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5454 "cleared of all file descriptors except for those that are immediately "
5455 "available for writing."
5456 msgstr ""
5457 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5458 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5459 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5460
5461 #. type: TP
5462 #: build/C/man2/select_tut.2:127
5463 #, no-wrap
5464 msgid "I<exceptfds>"
5465 msgstr "I<exceptfds>"
5466
5467 #. type: Plain text
5468 #: build/C/man2/select_tut.2:149
5469 msgid ""
5470 "This set is watched for \"exceptional conditions\".  In practice, only one "
5471 "such exceptional condition is common: the availability of I<out-of-band> "
5472 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5473 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5474 "where B<select>(2)  indicates an exceptional condition occurs with "
5475 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5476 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5477 "for those for which an exceptional condition has occurred."
5478 msgstr ""
5479 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5480 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5481 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5482 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5483 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5484 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5485 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5486 "状態が発生したディスクリプタ以外は集合から削除される。"
5487
5488 #. type: TP
5489 #: build/C/man2/select_tut.2:149
5490 #, no-wrap
5491 msgid "I<nfds>"
5492 msgstr "I<nfds>"
5493
5494 #. type: Plain text
5495 #: build/C/man2/select_tut.2:156
5496 msgid ""
5497 "This is an integer one more than the maximum of any file descriptor in any "
5498 "of the sets.  In other words, while adding file descriptors to each of the "
5499 "sets, you must calculate the maximum integer value of all of them, then "
5500 "increment this value by one, and then pass this as I<nfds>."
5501 msgstr ""
5502 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5503 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5504 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5505 "I<nfds> として渡さないといけない、ということだ。"
5506
5507 #. type: TP
5508 #: build/C/man2/select_tut.2:156
5509 #, no-wrap
5510 msgid "I<utimeout>"
5511 msgstr "I<utimeout>"
5512
5513 #. type: Plain text
5514 #: build/C/man2/select_tut.2:169
5515 msgid ""
5516 "This is the longest time B<select>()  may wait before returning, even if "
5517 "nothing interesting happened.  If this value is passed as NULL, then "
5518 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5519 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5520 "return immediately, with information about the readiness of file descriptors "
5521 "at the time of the call.  The structure I<struct timeval> is defined as:"
5522 msgstr ""
5523 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5524 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5525 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5526 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5527 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5528 "ように定義されている:"
5529
5530 #. type: Plain text
5531 #: build/C/man2/select_tut.2:176
5532 #, no-wrap
5533 msgid ""
5534 "struct timeval {\n"
5535 "    time_t tv_sec;    /* seconds */\n"
5536 "    long tv_usec;     /* microseconds */\n"
5537 "};\n"
5538 msgstr ""
5539 "struct timeval {\n"
5540 "    time_t tv_sec;    /* seconds */\n"
5541 "    long tv_usec;     /* microseconds */\n"
5542 "};\n"
5543
5544 #. type: TP
5545 #: build/C/man2/select_tut.2:178
5546 #, no-wrap
5547 msgid "I<ntimeout>"
5548 msgstr "I<ntimeout>"
5549
5550 #. type: Plain text
5551 #: build/C/man2/select_tut.2:187
5552 msgid ""
5553 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5554 "I<struct timespec> has nanosecond precision as follows:"
5555 msgstr ""
5556 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5557 "timespec> は次に示すようにナノ秒の精度を持つ。"
5558
5559 #. type: Plain text
5560 #: build/C/man2/select_tut.2:194
5561 #, no-wrap
5562 msgid ""
5563 "struct timespec {\n"
5564 "    long tv_sec;    /* seconds */\n"
5565 "    long tv_nsec;   /* nanoseconds */\n"
5566 "};\n"
5567 msgstr ""
5568 "struct timespec {\n"
5569 "    long tv_sec;    /* seconds */\n"
5570 "    long tv_nsec;   /* nanoseconds */\n"
5571 "};\n"
5572
5573 #. type: TP
5574 #: build/C/man2/select_tut.2:196
5575 #, no-wrap
5576 msgid "I<sigmask>"
5577 msgstr "I<sigmask>"
5578
5579 #. type: Plain text
5580 #: build/C/man2/select_tut.2:213
5581 msgid ""
5582 "This argument holds a set of signals that the kernel should unblock (i.e., "
5583 "remove from the signal mask of the calling thread), while the caller is "
5584 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5585 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5586 "the signal mask on entry and exit to the function.  In this case, "
5587 "B<pselect>()  will then behave just like B<select>()."
5588 msgstr ""
5589 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5590 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5591 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5592 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5593 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は "
5594 "B<select>()  と全く同じ動作となる。"
5595
5596 #. type: SS
5597 #: build/C/man2/select_tut.2:213
5598 #, no-wrap
5599 msgid "Combining signal and data events"
5600 msgstr "シグナルとデータイベントを組み合わせる"
5601
5602 #. type: Plain text
5603 #: build/C/man2/select_tut.2:257
5604 msgid ""
5605 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5606 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5607 "normally use the signal handler only to raise a global flag.  The global "
5608 "flag will indicate that the event must be processed in the main loop of the "
5609 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5610 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5611 "signals can be processed in the main loop of the program, otherwise "
5612 "B<select>()  would block indefinitely.  Now, somewhere in the main loop will "
5613 "be a conditional to check the global flag.  So we must ask: what if a signal "
5614 "arrives after the conditional, but before the B<select>()  call? The answer "
5615 "is that B<select>()  would block indefinitely, even though an event is "
5616 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5617 "This call can be used to set the signal mask to a set of signals that are "
5618 "only to be received within the B<pselect>()  call.  For instance, let us say "
5619 "that the event in question was the exit of a child process.  Before the "
5620 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5621 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5622 "mask.  Our program would look like:"
5623 msgstr ""
5624 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5625 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5626 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5627 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5628 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5629 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5630 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5631 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5632 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5633 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5634 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5635 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5636 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5637 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5638 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5639 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5640 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5641 "る。"
5642
5643 #. type: Plain text
5644 #: build/C/man2/select_tut.2:260
5645 #, no-wrap
5646 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5647 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5648
5649 #. type: Plain text
5650 #: build/C/man2/select_tut.2:266
5651 #, no-wrap
5652 msgid ""
5653 "static void\n"
5654 "child_sig_handler(int sig)\n"
5655 "{\n"
5656 "    got_SIGCHLD = 1;\n"
5657 "}\n"
5658 msgstr ""
5659 "static void\n"
5660 "child_sig_handler(int sig)\n"
5661 "{\n"
5662 "    got_SIGCHLD = 1;\n"
5663 "}\n"
5664
5665 #. type: Plain text
5666 #: build/C/man2/select_tut.2:274
5667 #, no-wrap
5668 msgid ""
5669 "int\n"
5670 "main(int argc, char *argv[])\n"
5671 "{\n"
5672 "    sigset_t sigmask, empty_mask;\n"
5673 "    struct sigaction sa;\n"
5674 "    fd_set readfds, writefds, exceptfds;\n"
5675 "    int r;\n"
5676 msgstr ""
5677 "int\n"
5678 "main(int argc, char *argv[])\n"
5679 "{\n"
5680 "    sigset_t sigmask, empty_mask;\n"
5681 "    struct sigaction sa;\n"
5682 "    fd_set readfds, writefds, exceptfds;\n"
5683 "    int r;\n"
5684
5685 #. type: Plain text
5686 #: build/C/man2/select_tut.2:281
5687 #, no-wrap
5688 msgid ""
5689 "    sigemptyset(&sigmask);\n"
5690 "    sigaddset(&sigmask, SIGCHLD);\n"
5691 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5692 "        perror(\"sigprocmask\");\n"
5693 "        exit(EXIT_FAILURE);\n"
5694 "    }\n"
5695 msgstr ""
5696 "    sigemptyset(&sigmask);\n"
5697 "    sigaddset(&sigmask, SIGCHLD);\n"
5698 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5699 "        perror(\"sigprocmask\");\n"
5700 "        exit(EXIT_FAILURE);\n"
5701 "    }\n"
5702
5703 #. type: Plain text
5704 #: build/C/man2/select_tut.2:289
5705 #, no-wrap
5706 msgid ""
5707 "    sa.sa_flags = 0;\n"
5708 "    sa.sa_handler = child_sig_handler;\n"
5709 "    sigemptyset(&sa.sa_mask);\n"
5710 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5711 "        perror(\"sigaction\");\n"
5712 "        exit(EXIT_FAILURE);\n"
5713 "    }\n"
5714 msgstr ""
5715 "    sa.sa_flags = 0;\n"
5716 "    sa.sa_handler = child_sig_handler;\n"
5717 "    sigemptyset(&sa.sa_mask);\n"
5718 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5719 "        perror(\"sigaction\");\n"
5720 "        exit(EXIT_FAILURE);\n"
5721 "    }\n"
5722
5723 #. type: Plain text
5724 #: build/C/man2/select_tut.2:291
5725 #, no-wrap
5726 msgid "    sigemptyset(&empty_mask);\n"
5727 msgstr "    sigemptyset(&empty_mask);\n"
5728
5729 #. type: Plain text
5730 #: build/C/man2/select_tut.2:295
5731 #, no-wrap
5732 msgid ""
5733 "    for (;;) {          /* main loop */\n"
5734 "        /* Initialize readfds, writefds, and exceptfds\n"
5735 "           before the pselect() call. (Code omitted.) */\n"
5736 msgstr ""
5737 "    for (;;) {          /* main loop */\n"
5738 "        /* Initialize readfds, writefds, and exceptfds\n"
5739 "           before the pselect() call. (Code omitted.) */\n"
5740
5741 #. type: Plain text
5742 #: build/C/man2/select_tut.2:301
5743 #, no-wrap
5744 msgid ""
5745 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5746 "                    NULL, &empty_mask);\n"
5747 "        if (r == -1 && errno != EINTR) {\n"
5748 "            /* Handle error */\n"
5749 "        }\n"
5750 msgstr ""
5751 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5752 "                    NULL, &empty_mask);\n"
5753 "        if (r == -1 && errno != EINTR) {\n"
5754 "            /* Handle error */\n"
5755 "        }\n"
5756
5757 #. type: Plain text
5758 #: build/C/man2/select_tut.2:304
5759 #, no-wrap
5760 msgid ""
5761 "        if (got_SIGCHLD) {\n"
5762 "            got_SIGCHLD = 0;\n"
5763 msgstr ""
5764 "        if (got_SIGCHLD) {\n"
5765 "            got_SIGCHLD = 0;\n"
5766
5767 #. type: Plain text
5768 #: build/C/man2/select_tut.2:308
5769 #, no-wrap
5770 msgid ""
5771 "            /* Handle signalled event here; e.g., wait() for all\n"
5772 "               terminated children. (Code omitted.) */\n"
5773 "        }\n"
5774 msgstr ""
5775 "            /* Handle signalled event here; e.g., wait() for all\n"
5776 "               terminated children. (Code omitted.) */\n"
5777 "        }\n"
5778
5779 #. type: Plain text
5780 #: build/C/man2/select_tut.2:312
5781 #, no-wrap
5782 msgid ""
5783 "        /* main body of program */\n"
5784 "    }\n"
5785 "}\n"
5786 msgstr ""
5787 "        /* main body of program */\n"
5788 "    }\n"
5789 "}\n"
5790
5791 #. type: SS
5792 #: build/C/man2/select_tut.2:313
5793 #, no-wrap
5794 msgid "Practical"
5795 msgstr "実例"
5796
5797 #. type: Plain text
5798 #: build/C/man2/select_tut.2:334
5799 msgid ""
5800 "So what is the point of B<select>()? Can't I just read and write to my "
5801 "descriptors whenever I want? The point of B<select>()  is that it watches "
5802 "multiple descriptors at the same time and properly puts the process to sleep "
5803 "if there is no activity.  UNIX programmers often find themselves in a "
5804 "position where they have to handle I/O from more than one file descriptor "
5805 "where the data flow may be intermittent.  If you were to merely create a "
5806 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5807 "your calls may block waiting for data from/to a file descriptor, while "
5808 "another file descriptor is unused though ready for I/O.  B<select>()  "
5809 "efficiently copes with this situation."
5810 msgstr ""
5811 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5812 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5813 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5814 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5815 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5816 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5817 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5818 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5819 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5820
5821 #. type: SS
5822 #: build/C/man2/select_tut.2:334
5823 #, no-wrap
5824 msgid "Select law"
5825 msgstr "SELECT の掟"
5826
5827 #. type: Plain text
5828 #: build/C/man2/select_tut.2:347
5829 msgid ""
5830 "Many people who try to use B<select>()  come across behavior that is "
5831 "difficult to understand and produces nonportable or borderline results.  For "
5832 "instance, the above program is carefully written not to block at any point, "
5833 "even though it does not set its file descriptors to nonblocking mode.  It is "
5834 "easy to introduce subtle errors that will remove the advantage of using "
5835 "B<select>(), so here is a list of essentials to watch for when using "
5836 "B<select>()."
5837 msgstr ""
5838 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5839 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5840 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5841 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5842 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5843 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5844 "ことにする。"
5845
5846 #. type: Plain text
5847 #: build/C/man2/select_tut.2:356
5848 msgid ""
5849 "You should always try to use B<select>()  without a timeout.  Your program "
5850 "should have nothing to do if there is no data available.  Code that depends "
5851 "on timeouts is not usually portable and is difficult to debug."
5852 msgstr ""
5853 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5854 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5855 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5856
5857 #. type: Plain text
5858 #: build/C/man2/select_tut.2:360
5859 msgid ""
5860 "The value I<nfds> must be properly calculated for efficiency as explained "
5861 "above."
5862 msgstr ""
5863 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5864 "えなければならない。"
5865
5866 #. type: Plain text
5867 #: build/C/man2/select_tut.2:367
5868 msgid ""
5869 "No file descriptor must be added to any set if you do not intend to check "
5870 "its result after the B<select>()  call, and respond appropriately.  See next "
5871 "rule."
5872 msgstr ""
5873 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5874 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5875
5876 #. type: Plain text
5877 #: build/C/man2/select_tut.2:373
5878 msgid ""
5879 "After B<select>()  returns, all file descriptors in all sets should be "
5880 "checked to see if they are ready."
5881 msgstr ""
5882 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5883 "て 読み書き可能な状態になっているかをチェックすべきである。"
5884
5885 #. type: TP
5886 #: build/C/man2/select_tut.2:373
5887 #, no-wrap
5888 msgid "5."
5889 msgstr "5."
5890
5891 #. type: Plain text
5892 #: build/C/man2/select_tut.2:388
5893 msgid ""
5894 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5895 "necessarily read/write the full amount of data that you have requested.  If "
5896 "they do read/write the full amount, it's because you have a low traffic load "
5897 "and a fast stream.  This is not always going to be the case.  You should "
5898 "cope with the case of your functions managing to send or receive only a "
5899 "single byte."
5900 msgstr ""
5901 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5902 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5903 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5904 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5905 "うな場合も 考慮に入れてやらなければならない。"
5906
5907 #. type: TP
5908 #: build/C/man2/select_tut.2:388
5909 #, no-wrap
5910 msgid "6."
5911 msgstr "6."
5912
5913 #. type: Plain text
5914 #: build/C/man2/select_tut.2:396
5915 msgid ""
5916 "Never read/write only in single bytes at a time unless you are really sure "
5917 "that you have a small amount of data to process.  It is extremely "
5918 "inefficient not to read/write as much data as you can buffer each time.  The "
5919 "buffers in the example below are 1024 bytes although they could easily be "
5920 "made larger."
5921 msgstr ""
5922 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5923 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5924 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5925 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5926
5927 #. type: TP
5928 #: build/C/man2/select_tut.2:396
5929 #, no-wrap
5930 msgid "7."
5931 msgstr "7."
5932
5933 #.  Nonetheless, you should still cope with these errors for completeness.
5934 #. type: Plain text
5935 #: build/C/man2/select_tut.2:418
5936 msgid ""
5937 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5938 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5939 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5940 "properly managed (not done properly above).  If your program is not going to "
5941 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5942 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5943 msgstr ""
5944 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5945 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5946 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5947 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5948 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5949 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5950
5951 #. type: TP
5952 #: build/C/man2/select_tut.2:418
5953 #, no-wrap
5954 msgid "8."
5955 msgstr "8."
5956
5957 #. type: Plain text
5958 #: build/C/man2/select_tut.2:427
5959 msgid ""
5960 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5961 "length of zero."
5962 msgstr ""
5963 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), "
5964 "B<write>(2), B<send>(2)  を呼び出してはならない。"
5965
5966 #. type: TP
5967 #: build/C/man2/select_tut.2:427
5968 #, no-wrap
5969 msgid "9."
5970 msgstr "9."
5971
5972 #. type: Plain text
5973 #: build/C/man2/select_tut.2:443
5974 msgid ""
5975 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5976 "with errors other than those listed in B<7.>, or one of the input functions "
5977 "returns 0, indicating end of file, then you should I<not> pass that "
5978 "descriptor to B<select>()  again.  In the example below, I close the "
5979 "descriptor immediately, and then set it to -1 to prevent it being included "
5980 "in a set."
5981 msgstr ""
5982 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5983 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5984 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5985 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5986 "が集合に含まれ続けるのを許さないようにしている。"
5987
5988 #. type: TP
5989 #: build/C/man2/select_tut.2:443
5990 #, no-wrap
5991 msgid "10."
5992 msgstr "10."
5993
5994 #. type: Plain text
5995 #: build/C/man2/select_tut.2:450
5996 msgid ""
5997 "The timeout value must be initialized with each new call to B<select>(), "
5998 "since some operating systems modify the structure.  B<pselect>()  however "
5999 "does not modify its timeout structure."
6000 msgstr ""
6001 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
6002 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
6003 "分の timeout 構造体を変更することはない。"
6004
6005 #. type: TP
6006 #: build/C/man2/select_tut.2:450
6007 #, no-wrap
6008 msgid "11."
6009 msgstr "11."
6010
6011 #.  "I have heard" does not fill me with confidence, and doesn't
6012 #.  belong in a man page, so I've commented this point out.
6013 #.  .TP
6014 #.  11.
6015 #.  I have heard that the Windows socket layer does not cope with OOB data
6016 #.  properly.
6017 #.  It also does not cope with
6018 #.  .BR select ()
6019 #.  calls when no file descriptors are set at all.
6020 #.  Having no file descriptors set is a useful
6021 #.  way to sleep the process with subsecond precision by using the timeout.
6022 #.  (See further on.)
6023 #. type: Plain text
6024 #: build/C/man2/select_tut.2:469
6025 msgid ""
6026 "Since B<select>()  modifies its file descriptor sets, if the call is being "
6027 "used in a loop, then the sets must be reinitialized before each call."
6028 msgstr ""
6029 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
6030 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
6031 "期化し直さなければならない。"
6032
6033 #. type: SS
6034 #: build/C/man2/select_tut.2:469
6035 #, no-wrap
6036 msgid "Usleep emulation"
6037 msgstr "usleep エミュレーション"
6038
6039 #. type: Plain text
6040 #: build/C/man2/select_tut.2:476
6041 msgid ""
6042 "On systems that do not have a B<usleep>(3)  function, you can call "
6043 "B<select>()  with a finite timeout and no file descriptors as follows:"
6044 msgstr ""
6045 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
6046 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
6047 "できる。 以下のようにする。"
6048
6049 #. type: Plain text
6050 #: build/C/man2/select_tut.2:482
6051 #, no-wrap
6052 msgid ""
6053 "    struct timeval tv;\n"
6054 "    tv.tv_sec = 0;\n"
6055 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6056 "    select(0, NULL, NULL, NULL, &tv);\n"
6057 msgstr ""
6058 "    struct timeval tv;\n"
6059 "    tv.tv_sec = 0;\n"
6060 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6061 "    select(0, NULL, NULL, NULL, &tv);\n"
6062
6063 #. type: Plain text
6064 #: build/C/man2/select_tut.2:485
6065 msgid "This is guaranteed to work only on UNIX systems, however."
6066 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6067
6068 #. type: Plain text
6069 #: build/C/man2/select_tut.2:490
6070 msgid ""
6071 "On success, B<select>()  returns the total number of file descriptors still "
6072 "present in the file descriptor sets."
6073 msgstr ""
6074 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
6075 "ディスクリプタの総数を返す。"
6076
6077 #. type: Plain text
6078 #: build/C/man2/select_tut.2:496
6079 msgid ""
6080 "If B<select>()  timed out, then the return value will be zero.  The file "
6081 "descriptors set should be all empty (but may not be on some systems)."
6082 msgstr ""
6083 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6084 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
6085
6086 #. type: Plain text
6087 #: build/C/man2/select_tut.2:503
6088 msgid ""
6089 "A return value of -1 indicates an error, with I<errno> being set "
6090 "appropriately.  In the case of an error, the contents of the returned sets "
6091 "and the I<struct timeout> contents are undefined and should not be used.  "
6092 "B<pselect>()  however never modifies I<ntimeout>."
6093 msgstr ""
6094 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6095 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6096 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
6097 "変更しない。"
6098
6099 #. type: Plain text
6100 #: build/C/man2/select_tut.2:512
6101 msgid ""
6102 "Generally speaking, all operating systems that support sockets also support "
6103 "B<select>().  B<select>()  can be used to solve many problems in a portable "
6104 "and efficient way that naive programmers try to solve in a more complicated "
6105 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6106 msgstr ""
6107 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6108 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6109 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6110 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6111
6112 #. type: Plain text
6113 #: build/C/man2/select_tut.2:521
6114 msgid ""
6115 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6116 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6117 "is nowadays widely available, but historically was less portable than "
6118 "B<select>()."
6119 msgstr ""
6120 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6121 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6122 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6123
6124 #. type: Plain text
6125 #: build/C/man2/select_tut.2:529
6126 msgid ""
6127 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6128 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6129 "of file descriptors."
6130 msgstr ""
6131 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
6132 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
6133
6134 #. type: Plain text
6135 #: build/C/man2/select_tut.2:534
6136 msgid ""
6137 "Here is an example that better demonstrates the true utility of "
6138 "B<select>().  The listing below is a TCP forwarding program that forwards "
6139 "from one TCP port to another."
6140 msgstr ""
6141 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6142 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6143
6144 #. type: Plain text
6145 #: build/C/man2/select_tut.2:547
6146 #, no-wrap
6147 msgid ""
6148 "#include E<lt>stdlib.hE<gt>\n"
6149 "#include E<lt>stdio.hE<gt>\n"
6150 "#include E<lt>unistd.hE<gt>\n"
6151 "#include E<lt>sys/time.hE<gt>\n"
6152 "#include E<lt>sys/types.hE<gt>\n"
6153 "#include E<lt>string.hE<gt>\n"
6154 "#include E<lt>signal.hE<gt>\n"
6155 "#include E<lt>sys/socket.hE<gt>\n"
6156 "#include E<lt>netinet/in.hE<gt>\n"
6157 "#include E<lt>arpa/inet.hE<gt>\n"
6158 "#include E<lt>errno.hE<gt>\n"
6159 msgstr ""
6160 "#include E<lt>stdlib.hE<gt>\n"
6161 "#include E<lt>stdio.hE<gt>\n"
6162 "#include E<lt>unistd.hE<gt>\n"
6163 "#include E<lt>sys/time.hE<gt>\n"
6164 "#include E<lt>sys/types.hE<gt>\n"
6165 "#include E<lt>string.hE<gt>\n"
6166 "#include E<lt>signal.hE<gt>\n"
6167 "#include E<lt>sys/socket.hE<gt>\n"
6168 "#include E<lt>netinet/in.hE<gt>\n"
6169 "#include E<lt>arpa/inet.hE<gt>\n"
6170 "#include E<lt>errno.hE<gt>\n"
6171
6172 #. type: Plain text
6173 #: build/C/man2/select_tut.2:549
6174 #, no-wrap
6175 msgid "static int forward_port;\n"
6176 msgstr "static int forward_port;\n"
6177
6178 #. type: Plain text
6179 #: build/C/man2/select_tut.2:552
6180 #, no-wrap
6181 msgid ""
6182 "#undef max\n"
6183 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6184 msgstr ""
6185 "#undef max\n"
6186 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6187
6188 #. type: Plain text
6189 #: build/C/man2/select_tut.2:559
6190 #, no-wrap
6191 msgid ""
6192 "static int\n"
6193 "listen_socket(int listen_port)\n"
6194 "{\n"
6195 "    struct sockaddr_in a;\n"
6196 "    int s;\n"
6197 "    int yes;\n"
6198 msgstr ""
6199 "static int\n"
6200 "listen_socket(int listen_port)\n"
6201 "{\n"
6202 "    struct sockaddr_in a;\n"
6203 "    int s;\n"
6204 "    int yes;\n"
6205
6206 #. type: Plain text
6207 #: build/C/man2/select_tut.2:584
6208 #, no-wrap
6209 msgid ""
6210 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6211 "    if (s == -1) {\n"
6212 "        perror(\"socket\");\n"
6213 "        return -1;\n"
6214 "    }\n"
6215 "    yes = 1;\n"
6216 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6217 "            &yes, sizeof(yes)) == -1) {\n"
6218 "        perror(\"setsockopt\");\n"
6219 "        close(s);\n"
6220 "        return -1;\n"
6221 "    }\n"
6222 "    memset(&a, 0, sizeof(a));\n"
6223 "    a.sin_port = htons(listen_port);\n"
6224 "    a.sin_family = AF_INET;\n"
6225 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6226 "        perror(\"bind\");\n"
6227 "        close(s);\n"
6228 "        return -1;\n"
6229 "    }\n"
6230 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6231 "    listen(s, 10);\n"
6232 "    return s;\n"
6233 "}\n"
6234 msgstr ""
6235 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6236 "        perror(\"socket\");\n"
6237 "        return -1;\n"
6238 "    }\n"
6239 "    yes = 1;\n"
6240 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6241 "            &yes, sizeof(yes)) == -1) {\n"
6242 "        perror(\"setsockopt\");\n"
6243 "        close(s);\n"
6244 "        return -1;\n"
6245 "    }\n"
6246 "    memset(&a, 0, sizeof(a));\n"
6247 "    a.sin_port = htons(listen_port);\n"
6248 "    a.sin_family = AF_INET;\n"
6249 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6250 "        perror(\"bind\");\n"
6251 "        close(s);\n"
6252 "        return -1;\n"
6253 "    }\n"
6254 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6255 "    listen(s, 10);\n"
6256 "    return s;\n"
6257 "}\n"
6258
6259 #. type: Plain text
6260 #: build/C/man2/select_tut.2:590
6261 #, no-wrap
6262 msgid ""
6263 "static int\n"
6264 "connect_socket(int connect_port, char *address)\n"
6265 "{\n"
6266 "    struct sockaddr_in a;\n"
6267 "    int s;\n"
6268 msgstr ""
6269 "static int\n"
6270 "connect_socket(int connect_port, char *address)\n"
6271 "{\n"
6272 "    struct sockaddr_in a;\n"
6273 "    int s;\n"
6274
6275 #. type: Plain text
6276 #: build/C/man2/select_tut.2:597
6277 #, no-wrap
6278 msgid ""
6279 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6280 "    if (s == -1) {\n"
6281 "        perror(\"socket\");\n"
6282 "        close(s);\n"
6283 "        return -1;\n"
6284 "    }\n"
6285 msgstr ""
6286 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6287 "    if (s == -1) {\n"
6288 "        perror(\"socket\");\n"
6289 "        close(s);\n"
6290 "        return -1;\n"
6291 "    }\n"
6292
6293 #. type: Plain text
6294 #: build/C/man2/select_tut.2:601
6295 #, no-wrap
6296 msgid ""
6297 "    memset(&a, 0, sizeof(a));\n"
6298 "    a.sin_port = htons(connect_port);\n"
6299 "    a.sin_family = AF_INET;\n"
6300 msgstr ""
6301 "    memset(&a, 0, sizeof(a));\n"
6302 "    a.sin_port = htons(connect_port);\n"
6303 "    a.sin_family = AF_INET;\n"
6304
6305 #. type: Plain text
6306 #: build/C/man2/select_tut.2:607
6307 #, no-wrap
6308 msgid ""
6309 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6310 "        perror(\"bad IP address format\");\n"
6311 "        close(s);\n"
6312 "        return -1;\n"
6313 "    }\n"
6314 msgstr ""
6315 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6316 "        perror(\"bad IP address format\");\n"
6317 "        close(s);\n"
6318 "        return -1;\n"
6319 "    }\n"
6320
6321 #. type: Plain text
6322 #: build/C/man2/select_tut.2:616
6323 #, no-wrap
6324 msgid ""
6325 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6326 "        perror(\"connect()\");\n"
6327 "        shutdown(s, SHUT_RDWR);\n"
6328 "        close(s);\n"
6329 "        return -1;\n"
6330 "    }\n"
6331 "    return s;\n"
6332 "}\n"
6333 msgstr ""
6334 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6335 "        perror(\"connect()\");\n"
6336 "        shutdown(s, SHUT_RDWR);\n"
6337 "        close(s);\n"
6338 "        return -1;\n"
6339 "    }\n"
6340 "    return s;\n"
6341 "}\n"
6342
6343 #. type: Plain text
6344 #: build/C/man2/select_tut.2:624
6345 #, no-wrap
6346 msgid ""
6347 "#define SHUT_FD1 do {                                \\e\n"
6348 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6349 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6350 "                         close(fd1);                 \\e\n"
6351 "                         fd1 = -1;                   \\e\n"
6352 "                     }                               \\e\n"
6353 "                 } while (0)\n"
6354 msgstr ""
6355 "#define SHUT_FD1 do {                                \\e\n"
6356 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6357 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6358 "                         close(fd1);                 \\e\n"
6359 "                         fd1 = -1;                   \\e\n"
6360 "                     }                               \\e\n"
6361 "                 } while (0)\n"
6362
6363 #. type: Plain text
6364 #: build/C/man2/select_tut.2:632
6365 #, no-wrap
6366 msgid ""
6367 "#define SHUT_FD2 do {                                \\e\n"
6368 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6369 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6370 "                         close(fd2);                 \\e\n"
6371 "                         fd2 = -1;                   \\e\n"
6372 "                     }                               \\e\n"
6373 "                 } while (0)\n"
6374 msgstr ""
6375 "#define SHUT_FD2 do {                                \\e\n"
6376 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6377 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6378 "                         close(fd2);                 \\e\n"
6379 "                         fd2 = -1;                   \\e\n"
6380 "                     }                               \\e\n"
6381 "                 } while (0)\n"
6382
6383 #. type: Plain text
6384 #: build/C/man2/select_tut.2:634
6385 #, no-wrap
6386 msgid "#define BUF_SIZE 1024\n"
6387 msgstr "#define BUF_SIZE 1024\n"
6388
6389 #. type: Plain text
6390 #: build/C/man2/select_tut.2:643
6391 #, no-wrap
6392 msgid ""
6393 "int\n"
6394 "main(int argc, char *argv[])\n"
6395 "{\n"
6396 "    int h;\n"
6397 "    int fd1 = -1, fd2 = -1;\n"
6398 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6399 "    int buf1_avail, buf1_written;\n"
6400 "    int buf2_avail, buf2_written;\n"
6401 msgstr ""
6402 "int\n"
6403 "main(int argc, char *argv[])\n"
6404 "{\n"
6405 "    int h;\n"
6406 "    int fd1 = -1, fd2 = -1;\n"
6407 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6408 "    int buf1_avail, buf1_written;\n"
6409 "    int buf2_avail, buf2_written;\n"
6410
6411 #. type: Plain text
6412 #: build/C/man2/select_tut.2:649
6413 #, no-wrap
6414 msgid ""
6415 "    if (argc != 4) {\n"
6416 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6417 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6418 "        exit(EXIT_FAILURE);\n"
6419 "    }\n"
6420 msgstr ""
6421 "    if (argc != 4) {\n"
6422 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6423 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6424 "        exit(EXIT_FAILURE);\n"
6425 "    }\n"
6426
6427 #. type: Plain text
6428 #: build/C/man2/select_tut.2:651
6429 #, no-wrap
6430 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6431 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6432
6433 #. type: Plain text
6434 #: build/C/man2/select_tut.2:653
6435 #, no-wrap
6436 msgid "    forward_port = atoi(argv[2]);\n"
6437 msgstr "    forward_port = atoi(argv[2]);\n"
6438
6439 #. type: Plain text
6440 #: build/C/man2/select_tut.2:657
6441 #, no-wrap
6442 msgid ""
6443 "    h = listen_socket(atoi(argv[1]));\n"
6444 "    if (h == -1)\n"
6445 "        exit(EXIT_FAILURE);\n"
6446 msgstr ""
6447 "    h = listen_socket(atoi(argv[1]));\n"
6448 "    if (h == -1)\n"
6449 "        exit(EXIT_FAILURE);\n"
6450
6451 #. type: Plain text
6452 #: build/C/man2/select_tut.2:661
6453 #, no-wrap
6454 msgid ""
6455 "    for (;;) {\n"
6456 "        int r, nfds = 0;\n"
6457 "        fd_set rd, wr, er;\n"
6458 msgstr ""
6459 "    for (;;) {\n"
6460 "        int r, nfds = 0;\n"
6461 "        fd_set rd, wr, er;\n"
6462
6463 #. type: Plain text
6464 #: build/C/man2/select_tut.2:691
6465 #, no-wrap
6466 msgid ""
6467 "        FD_ZERO(&rd);\n"
6468 "        FD_ZERO(&wr);\n"
6469 "        FD_ZERO(&er);\n"
6470 "        FD_SET(h, &rd);\n"
6471 "        nfds = max(nfds, h);\n"
6472 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6473 "            FD_SET(fd1, &rd);\n"
6474 "            nfds = max(nfds, fd1);\n"
6475 "        }\n"
6476 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6477 "            FD_SET(fd2, &rd);\n"
6478 "            nfds = max(nfds, fd2);\n"
6479 "        }\n"
6480 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6481 "            FD_SET(fd1, &wr);\n"
6482 "            nfds = max(nfds, fd1);\n"
6483 "        }\n"
6484 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6485 "            FD_SET(fd2, &wr);\n"
6486 "            nfds = max(nfds, fd2);\n"
6487 "        }\n"
6488 "        if (fd1 E<gt> 0) {\n"
6489 "            FD_SET(fd1, &er);\n"
6490 "            nfds = max(nfds, fd1);\n"
6491 "        }\n"
6492 "        if (fd2 E<gt> 0) {\n"
6493 "            FD_SET(fd2, &er);\n"
6494 "            nfds = max(nfds, fd2);\n"
6495 "        }\n"
6496 msgstr ""
6497 "        FD_ZERO(&rd);\n"
6498 "        FD_ZERO(&wr);\n"
6499 "        FD_ZERO(&er);\n"
6500 "        FD_SET(h, &rd);\n"
6501 "        nfds = max(nfds, h);\n"
6502 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6503 "            FD_SET(fd1, &rd);\n"
6504 "            nfds = max(nfds, fd1);\n"
6505 "        }\n"
6506 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6507 "            FD_SET(fd2, &rd);\n"
6508 "            nfds = max(nfds, fd2);\n"
6509 "        }\n"
6510 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6511 "            FD_SET(fd1, &wr);\n"
6512 "            nfds = max(nfds, fd1);\n"
6513 "        }\n"
6514 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6515 "            FD_SET(fd2, &wr);\n"
6516 "            nfds = max(nfds, fd2);\n"
6517 "        }\n"
6518 "        if (fd1 E<gt> 0) {\n"
6519 "            FD_SET(fd1, &er);\n"
6520 "            nfds = max(nfds, fd1);\n"
6521 "        }\n"
6522 "        if (fd2 E<gt> 0) {\n"
6523 "            FD_SET(fd2, &er);\n"
6524 "            nfds = max(nfds, fd2);\n"
6525 "        }\n"
6526
6527 #. type: Plain text
6528 #: build/C/man2/select_tut.2:693
6529 #, no-wrap
6530 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6531 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6532
6533 #. type: Plain text
6534 #: build/C/man2/select_tut.2:696
6535 #, no-wrap
6536 msgid ""
6537 "        if (r == -1 && errno == EINTR)\n"
6538 "            continue;\n"
6539 msgstr ""
6540 "        if (r == -1 && errno == EINTR)\n"
6541 "            continue;\n"
6542
6543 #. type: Plain text
6544 #: build/C/man2/select_tut.2:701
6545 #, no-wrap
6546 msgid ""
6547 "        if (r == -1) {\n"
6548 "            perror(\"select()\");\n"
6549 "            exit(EXIT_FAILURE);\n"
6550 "        }\n"
6551 msgstr ""
6552 "        if (r == -1) {\n"
6553 "            perror(\"select()\");\n"
6554 "            exit(EXIT_FAILURE);\n"
6555 "        }\n"
6556
6557 #. type: Plain text
6558 #: build/C/man2/select_tut.2:705
6559 #, no-wrap
6560 msgid ""
6561 "        if (FD_ISSET(h, &rd)) {\n"
6562 "            unsigned int l;\n"
6563 "            struct sockaddr_in client_address;\n"
6564 msgstr ""
6565 "        if (FD_ISSET(h, &rd)) {\n"
6566 "            unsigned int l;\n"
6567 "            struct sockaddr_in client_address;\n"
6568
6569 #. type: Plain text
6570 #: build/C/man2/select_tut.2:724
6571 #, no-wrap
6572 msgid ""
6573 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6574 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6575 "            if (r == -1) {\n"
6576 "                perror(\"accept()\");\n"
6577 "            } else {\n"
6578 "                SHUT_FD1;\n"
6579 "                SHUT_FD2;\n"
6580 "                buf1_avail = buf1_written = 0;\n"
6581 "                buf2_avail = buf2_written = 0;\n"
6582 "                fd1 = r;\n"
6583 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6584 "                if (fd2 == -1)\n"
6585 "                    SHUT_FD1;\n"
6586 "                else\n"
6587 "                    printf(\"connect from %s\\en\",\n"
6588 "                            inet_ntoa(client_address.sin_addr));\n"
6589 "            }\n"
6590 "        }\n"
6591 msgstr ""
6592 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6593 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6594 "            if (r == -1) {\n"
6595 "                perror(\"accept()\");\n"
6596 "            } else {\n"
6597 "                SHUT_FD1;\n"
6598 "                SHUT_FD2;\n"
6599 "                buf1_avail = buf1_written = 0;\n"
6600 "                buf2_avail = buf2_written = 0;\n"
6601 "                fd1 = r;\n"
6602 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6603 "                if (fd2 == -1)\n"
6604 "                    SHUT_FD1;\n"
6605 "                else\n"
6606 "                    printf(\"connect from %s\\en\",\n"
6607 "                            inet_ntoa(client_address.sin_addr));\n"
6608 "            }\n"
6609 "        }\n"
6610
6611 #. type: Plain text
6612 #: build/C/man2/select_tut.2:726
6613 #, no-wrap
6614 msgid "        /* NB: read oob data before normal reads */\n"
6615 msgstr "        /* NB: read oob data before normal reads */\n"
6616
6617 #. type: Plain text
6618 #: build/C/man2/select_tut.2:730
6619 #, no-wrap
6620 msgid ""
6621 "        if (fd1 E<gt> 0)\n"
6622 "            if (FD_ISSET(fd1, &er)) {\n"
6623 "                char c;\n"
6624 msgstr ""
6625 "        if (fd1 E<gt> 0)\n"
6626 "            if (FD_ISSET(fd1, &er)) {\n"
6627 "                char c;\n"
6628
6629 #. type: Plain text
6630 #: build/C/man2/select_tut.2:740
6631 #, no-wrap
6632 msgid ""
6633 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6634 "                if (r E<lt> 1)\n"
6635 "                    SHUT_FD1;\n"
6636 "                else\n"
6637 "                    send(fd2, &c, 1, MSG_OOB);\n"
6638 "            }\n"
6639 "        if (fd2 E<gt> 0)\n"
6640 "            if (FD_ISSET(fd2, &er)) {\n"
6641 "                char c;\n"
6642 msgstr ""
6643 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6644 "                if (r E<lt> 1)\n"
6645 "                    SHUT_FD1;\n"
6646 "                else\n"
6647 "                    send(fd2, &c, 1, MSG_OOB);\n"
6648 "            }\n"
6649 "        if (fd2 E<gt> 0)\n"
6650 "            if (FD_ISSET(fd2, &er)) {\n"
6651 "                char c;\n"
6652
6653 #. type: Plain text
6654 #: build/C/man2/select_tut.2:783
6655 #, no-wrap
6656 msgid ""
6657 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6658 "                if (r E<lt> 1)\n"
6659 "                    SHUT_FD2;\n"
6660 "                else\n"
6661 "                    send(fd1, &c, 1, MSG_OOB);\n"
6662 "            }\n"
6663 "        if (fd1 E<gt> 0)\n"
6664 "            if (FD_ISSET(fd1, &rd)) {\n"
6665 "                r = read(fd1, buf1 + buf1_avail,\n"
6666 "                          BUF_SIZE - buf1_avail);\n"
6667 "                if (r E<lt> 1)\n"
6668 "                    SHUT_FD1;\n"
6669 "                else\n"
6670 "                    buf1_avail += r;\n"
6671 "            }\n"
6672 "        if (fd2 E<gt> 0)\n"
6673 "            if (FD_ISSET(fd2, &rd)) {\n"
6674 "                r = read(fd2, buf2 + buf2_avail,\n"
6675 "                          BUF_SIZE - buf2_avail);\n"
6676 "                if (r E<lt> 1)\n"
6677 "                    SHUT_FD2;\n"
6678 "                else\n"
6679 "                    buf2_avail += r;\n"
6680 "            }\n"
6681 "        if (fd1 E<gt> 0)\n"
6682 "            if (FD_ISSET(fd1, &wr)) {\n"
6683 "                r = write(fd1, buf2 + buf2_written,\n"
6684 "                           buf2_avail - buf2_written);\n"
6685 "                if (r E<lt> 1)\n"
6686 "                    SHUT_FD1;\n"
6687 "                else\n"
6688 "                    buf2_written += r;\n"
6689 "            }\n"
6690 "        if (fd2 E<gt> 0)\n"
6691 "            if (FD_ISSET(fd2, &wr)) {\n"
6692 "                r = write(fd2, buf1 + buf1_written,\n"
6693 "                           buf1_avail - buf1_written);\n"
6694 "                if (r E<lt> 1)\n"
6695 "                    SHUT_FD2;\n"
6696 "                else\n"
6697 "                    buf1_written += r;\n"
6698 "            }\n"
6699 msgstr ""
6700 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6701 "                if (r E<lt> 1)\n"
6702 "                    SHUT_FD2;\n"
6703 "                else\n"
6704 "                    send(fd1, &c, 1, MSG_OOB);\n"
6705 "            }\n"
6706 "        if (fd1 E<gt> 0)\n"
6707 "            if (FD_ISSET(fd1, &rd)) {\n"
6708 "                r = read(fd1, buf1 + buf1_avail,\n"
6709 "                          BUF_SIZE - buf1_avail);\n"
6710 "                if (r E<lt> 1)\n"
6711 "                    SHUT_FD1;\n"
6712 "                else\n"
6713 "                    buf1_avail += r;\n"
6714 "            }\n"
6715 "        if (fd2 E<gt> 0)\n"
6716 "            if (FD_ISSET(fd2, &rd)) {\n"
6717 "                r = read(fd2, buf2 + buf2_avail,\n"
6718 "                          BUF_SIZE - buf2_avail);\n"
6719 "                if (r E<lt> 1)\n"
6720 "                    SHUT_FD2;\n"
6721 "                else\n"
6722 "                    buf2_avail += r;\n"
6723 "            }\n"
6724 "        if (fd1 E<gt> 0)\n"
6725 "            if (FD_ISSET(fd1, &wr)) {\n"
6726 "                r = write(fd1, buf2 + buf2_written,\n"
6727 "                           buf2_avail - buf2_written);\n"
6728 "                if (r E<lt> 1)\n"
6729 "                    SHUT_FD1;\n"
6730 "                else\n"
6731 "                    buf2_written += r;\n"
6732 "            }\n"
6733 "        if (fd2 E<gt> 0)\n"
6734 "            if (FD_ISSET(fd2, &wr)) {\n"
6735 "                r = write(fd2, buf1 + buf1_written,\n"
6736 "                           buf1_avail - buf1_written);\n"
6737 "                if (r E<lt> 1)\n"
6738 "                    SHUT_FD2;\n"
6739 "                else\n"
6740 "                    buf1_written += r;\n"
6741 "            }\n"
6742
6743 #. type: Plain text
6744 #: build/C/man2/select_tut.2:785
6745 #, no-wrap
6746 msgid "        /* check if write data has caught read data */\n"
6747 msgstr "        /* check if write data has caught read data */\n"
6748
6749 #. type: Plain text
6750 #: build/C/man2/select_tut.2:790
6751 #, no-wrap
6752 msgid ""
6753 "        if (buf1_written == buf1_avail)\n"
6754 "            buf1_written = buf1_avail = 0;\n"
6755 "        if (buf2_written == buf2_avail)\n"
6756 "            buf2_written = buf2_avail = 0;\n"
6757 msgstr ""
6758 "        if (buf1_written == buf1_avail)\n"
6759 "            buf1_written = buf1_avail = 0;\n"
6760 "        if (buf2_written == buf2_avail)\n"
6761 "            buf2_written = buf2_avail = 0;\n"
6762
6763 #. type: Plain text
6764 #: build/C/man2/select_tut.2:793
6765 #, no-wrap
6766 msgid ""
6767 "        /* one side has closed the connection, keep\n"
6768 "           writing to the other side until empty */\n"
6769 msgstr ""
6770 "        /* one side has closed the connection, keep\n"
6771 "           writing to the other side until empty */\n"
6772
6773 #. type: Plain text
6774 #: build/C/man2/select_tut.2:801
6775 #, no-wrap
6776 msgid ""
6777 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6778 "            SHUT_FD2;\n"
6779 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6780 "            SHUT_FD1;\n"
6781 "    }\n"
6782 "    exit(EXIT_SUCCESS);\n"
6783 "}\n"
6784 msgstr ""
6785 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6786 "            SHUT_FD2;\n"
6787 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6788 "            SHUT_FD1;\n"
6789 "    }\n"
6790 "    exit(EXIT_SUCCESS);\n"
6791 "}\n"
6792
6793 #. type: Plain text
6794 #: build/C/man2/select_tut.2:815
6795 msgid ""
6796 "The above program properly forwards most kinds of TCP connections including "
6797 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6798 "problem of having data flow in both directions simultaneously.  You might "
6799 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6800 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6801 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6802 "because you end up using inefficient timeouts."
6803 msgstr ""
6804 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6805 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6806 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 "
6807 "B<fork>(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効"
6808 "率的だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこ"
6809 "しい。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、と"
6810 "いうアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的"
6811 "に起こってしまう。"
6812
6813 #. type: Plain text
6814 #: build/C/man2/select_tut.2:821
6815 msgid ""
6816 "The program does not handle more than one simultaneous connection at a time, "
6817 "although it could easily be extended to do this with a linked list of buffers"
6818 "\\(emone for each connection.  At the moment, new connections cause the "
6819 "current connection to be dropped."
6820 msgstr ""
6821 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6822 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6823 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6824
6825 #.  .SH AUTHORS
6826 #.  This man page was written by Paul Sheer.
6827 #. type: Plain text
6828 #: build/C/man2/select_tut.2:840
6829 msgid ""
6830 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6831 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6832 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6833 "B<sigismember>(3), B<epoll>(7)"
6834 msgstr ""
6835 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6836 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6837 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6838 "B<sigismember>(3), B<epoll>(7)"
6839
6840 #. type: TH
6841 #: build/C/man2/send.2:40
6842 #, no-wrap
6843 msgid "SEND"
6844 msgstr "SEND"
6845
6846 #. type: Plain text
6847 #: build/C/man2/send.2:43
6848 msgid "send, sendto, sendmsg - send a message on a socket"
6849 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6850
6851 #. type: Plain text
6852 #: build/C/man2/send.2:47
6853 #, no-wrap
6854 msgid ""
6855 "B<#include E<lt>sys/types.hE<gt>>\n"
6856 "B<#include E<lt>sys/socket.hE<gt>>\n"
6857 msgstr ""
6858 "B<#include E<lt>sys/types.hE<gt>>\n"
6859 "B<#include E<lt>sys/socket.hE<gt>>\n"
6860
6861 #. type: Plain text
6862 #: build/C/man2/send.2:50
6863 #, no-wrap
6864 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6865 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6866
6867 #. type: Plain text
6868 #: build/C/man2/send.2:54
6869 #, no-wrap
6870 msgid ""
6871 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6872 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6873 msgstr ""
6874 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6875 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6876
6877 #. type: Plain text
6878 #: build/C/man2/send.2:57
6879 #, no-wrap
6880 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6881 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6882
6883 #. type: Plain text
6884 #: build/C/man2/send.2:65
6885 msgid ""
6886 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6887 "transmit a message to another socket."
6888 msgstr ""
6889 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6890 "メッセージを転送するのに使用される。"
6891
6892 #. type: Plain text
6893 #: build/C/man2/send.2:84
6894 msgid ""
6895 "The B<send>()  call may be used only when the socket is in a I<connected> "
6896 "state (so that the intended recipient is known).  The only difference "
6897 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6898 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6899 "following call"
6900 msgstr ""
6901 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6902 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と "
6903 "B<write>(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 "
6904 "I<flags> にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価であ"
6905 "る。 また、"
6906
6907 #. type: Plain text
6908 #: build/C/man2/send.2:86
6909 #, no-wrap
6910 msgid "    send(sockfd, buf, len, flags);\n"
6911 msgstr "    send(sockfd, buf, len, flags);\n"
6912
6913 #. type: Plain text
6914 #: build/C/man2/send.2:88
6915 msgid "is equivalent to"
6916 msgstr "は以下と等価である。"
6917
6918 #. type: Plain text
6919 #: build/C/man2/send.2:90
6920 #, no-wrap
6921 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6922 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6923
6924 #. type: Plain text
6925 #: build/C/man2/send.2:94
6926 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6927 msgstr ""
6928 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6929 "る。"
6930
6931 #. type: Plain text
6932 #: build/C/man2/send.2:122
6933 msgid ""
6934 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6935 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6936 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6937 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6938 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6939 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6940 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6941 "size."
6942 msgstr ""
6943 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6944 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6945 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6946 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6947 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6948 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 "
6949 "B<sendmsg>()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズ"
6950 "は I<msg.msg_namelen> で指定される。"
6951
6952 #. type: Plain text
6953 #: build/C/man2/send.2:138
6954 msgid ""
6955 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6956 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6957 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6958 "ancillary data (also known as control information)."
6959 msgstr ""
6960 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6961 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6962 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6963 "(制御情報とも呼ばれる) を送信することもできる。"
6964
6965 #. type: Plain text
6966 #: build/C/man2/send.2:143
6967 msgid ""
6968 "If the message is too long to pass atomically through the underlying "
6969 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6970 "transmitted."
6971 msgstr ""
6972 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6973 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6974 "ラーが返され、そのメッセージは転送されない。"
6975
6976 #. type: Plain text
6977 #: build/C/man2/send.2:147
6978 msgid ""
6979 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6980 "detected errors are indicated by a return value of -1."
6981 msgstr ""
6982 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6983 "出された場合は、返り値 -1 として通知される。"
6984
6985 #. type: Plain text
6986 #: build/C/man2/send.2:160
6987 msgid ""
6988 "When the message does not fit into the send buffer of the socket, B<send>()  "
6989 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6990 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6991 "in this case.  The B<select>(2)  call may be used to determine when it is "
6992 "possible to send more data."
6993 msgstr ""
6994 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6995 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6996 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6997 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6998 "用することができる。"
6999
7000 #.  FIXME . ? document MSG_PROXY (which went away in 2.3.15)
7001 #. type: Plain text
7002 #: build/C/man2/send.2:166
7003 msgid ""
7004 "The I<flags> argument is the bitwise OR of zero or more of the following "
7005 "flags."
7006 msgstr ""
7007 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
7008 "のを指定する。"
7009
7010 #. type: TP
7011 #: build/C/man2/send.2:166
7012 #, no-wrap
7013 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
7014 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
7015
7016 #. type: Plain text
7017 #: build/C/man2/send.2:180
7018 msgid ""
7019 "Tell the link layer that forward progress happened: you got a successful "
7020 "reply from the other side.  If the link layer doesn't get this it will "
7021 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
7022 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
7023 "IPv4 and IPv6.  See B<arp>(7)  for details."
7024 msgstr ""
7025 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
7026 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
7027 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
7028 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
7029 "されている。 詳しくは B<arp>(7)  参照のこと。"
7030
7031 #. type: TP
7032 #: build/C/man2/send.2:180
7033 #, no-wrap
7034 msgid "B<MSG_DONTROUTE>"
7035 msgstr "B<MSG_DONTROUTE>"
7036
7037 #. type: Plain text
7038 #: build/C/man2/send.2:188
7039 msgid ""
7040 "Don't use a gateway to send out the packet, send to hosts only on directly "
7041 "connected networks.  This is usually used only by diagnostic or routing "
7042 "programs.  This is defined only for protocol families that route; packet "
7043 "sockets don't."
7044 msgstr ""
7045 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
7046 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
7047 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
7048 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
7049
7050 #. type: Plain text
7051 #: build/C/man2/send.2:199
7052 msgid ""
7053 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
7054 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
7055 "flag with the B<F_SETFL> B<fcntl>(2))."
7056 msgstr ""
7057 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
7058 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
7059 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
7060
7061 #. type: TP
7062 #: build/C/man2/send.2:199
7063 #, no-wrap
7064 msgid "B<MSG_EOR> (since Linux 2.2)"
7065 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7066
7067 #. type: Plain text
7068 #: build/C/man2/send.2:203
7069 msgid ""
7070 "Terminates a record (when this notion is supported, as for sockets of type "
7071 "B<SOCK_SEQPACKET>)."
7072 msgstr ""
7073 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7074 "ケット種別のときに有効)。"
7075
7076 #. type: TP
7077 #: build/C/man2/send.2:203
7078 #, no-wrap
7079 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7080 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7081
7082 #. type: Plain text
7083 #: build/C/man2/send.2:212
7084 msgid ""
7085 "The caller has more data to send.  This flag is used with TCP sockets to "
7086 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7087 "with the difference that this flag can be set on a per-call basis."
7088 msgstr ""
7089 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7090 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる "
7091 "(B<tcp>(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位"
7092 "で この機能を有効にできる点である。"
7093
7094 #. type: Plain text
7095 #: build/C/man2/send.2:221
7096 msgid ""
7097 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7098 "the kernel to package all of the data sent in calls with this flag set into "
7099 "a single datagram which is transmitted only when a call is performed that "
7100 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
7101 "described in B<udp>(7).)"
7102 msgstr ""
7103 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7104 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7105 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7106 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7107 "ソケットオプション B<UDP_CORK> も参照)。"
7108
7109 #. type: TP
7110 #: build/C/man2/send.2:221
7111 #, no-wrap
7112 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7113 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7114
7115 #. type: Plain text
7116 #: build/C/man2/send.2:230
7117 msgid ""
7118 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7119 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7120 msgstr ""
7121 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7122 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7123
7124 #. type: Plain text
7125 #: build/C/man2/send.2:239
7126 msgid ""
7127 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7128 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7129 "data."
7130 msgstr ""
7131 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7132 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7133 "をサポートしている必要がある。"
7134
7135 #. type: SS
7136 #: build/C/man2/send.2:239
7137 #, no-wrap
7138 msgid "sendmsg()"
7139 msgstr "sendmsg()"
7140
7141 #. type: Plain text
7142 #: build/C/man2/send.2:245
7143 msgid ""
7144 "The definition of the I<msghdr> structure employed by B<sendmsg>()  is as "
7145 "follows:"
7146 msgstr "B<sendmsg>() で利用されている I<msghdr> 構造体は以下の通り。"
7147
7148 #. type: Plain text
7149 #: build/C/man2/send.2:257
7150 #, no-wrap
7151 msgid ""
7152 "struct msghdr {\n"
7153 "    void         *msg_name;       /* optional address */\n"
7154 "    socklen_t     msg_namelen;    /* size of address */\n"
7155 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
7156 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
7157 "    void         *msg_control;    /* ancillary data, see below */\n"
7158 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
7159 "    int           msg_flags;      /* flags (unused) */\n"
7160 "};\n"
7161 msgstr ""
7162 "struct msghdr {\n"
7163 "    void         *msg_name;       /* 追加のアドレス */\n"
7164 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
7165 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
7166 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
7167 "    void         *msg_control;    /* 補助データ (後述) */\n"
7168 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
7169 "    int           msg_flags;      /* フラグ (未使用) */\n"
7170 "};\n"
7171
7172 #. type: Plain text
7173 #: build/C/man2/send.2:269
7174 msgid ""
7175 "The I<msg_name> field is used on an unconnected socket to specify the target "
7176 "address for a datagram.  It points to a buffer containing the address; the "
7177 "I<msg_namelen> field should be set to the size of the address.  For a "
7178 "connected socket, these fields should be specified as NULL and 0, "
7179 "respectively."
7180 msgstr ""
7181 "フィールド I<msg_name> は、 未接続のソケットでデータグラムの宛先アドレスを指"
7182 "定するのに使用される。 このフィールドはアドレスを格納したバッファを指す。 "
7183 "フィールド I<msg_namelen> にはアドレスの大きさを設定しなければならない。 接続"
7184 "済のソケットについては、これらのフィールドにはそれぞれ NULL と 0 を指定しなけ"
7185 "ればならない。"
7186
7187 #. type: Plain text
7188 #: build/C/man2/send.2:276
7189 msgid ""
7190 "The I<msg_iov> and I<msg_iovlen> fields specify scatter-gather locations, as "
7191 "for B<writev>(2)."
7192 msgstr ""
7193 "フィールド B<msg_iov> と I<msg_iovlen> は scatter-gather 用の場所を指定す"
7194 "る。 B<writev>(2) と同じ。"
7195
7196 #. type: Plain text
7197 #: build/C/man2/send.2:287
7198 msgid ""
7199 "You may send control information using the I<msg_control> and "
7200 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7201 "process is limited per socket by the value in I</proc/sys/net/core/"
7202 "optmem_max>; see B<socket>(7)."
7203 msgstr ""
7204 "フィールド I<msg_control> と I<msg_controllen> を使用して制御情報を送信するこ"
7205 "とができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7206 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
7207
7208 #.  Still to be documented:
7209 #.   Send file descriptors and user credentials using the
7210 #.   msg_control* fields.
7211 #. type: Plain text
7212 #: build/C/man2/send.2:294
7213 msgid "The I<msg_flags> field is ignored."
7214 msgstr "フィールド I<msg_flags> は無視される。"
7215
7216 #. type: Plain text
7217 #: build/C/man2/send.2:299
7218 msgid ""
7219 "On success, these calls return the number of bytes sent.  On error, -1 is "
7220 "returned, and I<errno> is set appropriately."
7221 msgstr ""
7222 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7223 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7224
7225 #. type: Plain text
7226 #: build/C/man2/send.2:304
7227 msgid ""
7228 "These are some standard errors generated by the socket layer.  Additional "
7229 "errors may be generated and returned from the underlying protocol modules; "
7230 "see their respective manual pages."
7231 msgstr ""
7232 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7233 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7234 "れぞれのマニュアルを参照すること。"
7235
7236 #. type: Plain text
7237 #: build/C/man2/send.2:312
7238 msgid ""
7239 "(For UNIX domain sockets, which are identified by pathname)  Write "
7240 "permission is denied on the destination socket file, or search permission is "
7241 "denied for one of the directories the path prefix.  (See "
7242 "B<path_resolution>(7).)"
7243 msgstr ""
7244 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7245 "\n"
7246 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7247 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7248 "(B<path_resolution>(7) も参照のこと)"
7249
7250 #. type: Plain text
7251 #: build/C/man2/send.2:315
7252 msgid ""
7253 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7254 "as though it was a unicast address."
7255 msgstr ""
7256 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7257 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7258
7259 #.  Actually EAGAIN on Linux
7260 #. type: Plain text
7261 #: build/C/man2/send.2:323
7262 msgid ""
7263 "The socket is marked nonblocking and the requested operation would block.  "
7264 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7265 "require these constants to have the same value, so a portable application "
7266 "should check for both possibilities."
7267 msgstr ""
7268 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7269 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7270 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7271 "両方の可能性を 確認すべきである。"
7272
7273 #. type: Plain text
7274 #: build/C/man2/send.2:336
7275 msgid ""
7276 "(Internet domain datagram sockets)  The socket referred to by I<sockfd> had "
7277 "not previously been bound to an address and, upon attempting to bind it to "
7278 "an ephemeral port, it was determined that all port numbers in the ephemeral "
7279 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
7280 "ip_local_port_range> in B<ip>(7)."
7281 msgstr ""
7282 "(インターネットドメインデータグラムソケットの場合) I<sockfd> が参照するソケッ"
7283 "トがそれ以前にアドレスにバインドされておらず、 そのソケットに一時ポートをバイ"
7284 "ンドしようとした際に、 一時ポートとして使用する範囲のポート番号がすべて使用中"
7285 "であった。 B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照"
7286 "のこと。"
7287
7288 #. type: Plain text
7289 #: build/C/man2/send.2:339
7290 msgid "An invalid descriptor was specified."
7291 msgstr "無効なディスクリプターが指定された。"
7292
7293 #. type: TP
7294 #: build/C/man2/send.2:339
7295 #, no-wrap
7296 msgid "B<ECONNRESET>"
7297 msgstr "B<ECONNRESET>"
7298
7299 #. type: Plain text
7300 #: build/C/man2/send.2:342
7301 msgid "Connection reset by peer."
7302 msgstr "接続が接続相手によりリセットされた。"
7303
7304 #. type: TP
7305 #: build/C/man2/send.2:342
7306 #, no-wrap
7307 msgid "B<EDESTADDRREQ>"
7308 msgstr "B<EDESTADDRREQ>"
7309
7310 #. type: Plain text
7311 #: build/C/man2/send.2:345
7312 msgid "The socket is not connection-mode, and no peer address is set."
7313 msgstr ""
7314 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7315 "ていない。"
7316
7317 #. type: Plain text
7318 #: build/C/man2/send.2:348
7319 msgid "An invalid user space address was specified for an argument."
7320 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7321
7322 #. type: Plain text
7323 #: build/C/man2/send.2:352
7324 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7325 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7326
7327 #. type: Plain text
7328 #: build/C/man2/send.2:361
7329 msgid ""
7330 "The connection-mode socket was connected already but a recipient was "
7331 "specified.  (Now either this error is returned, or the recipient "
7332 "specification is ignored.)"
7333 msgstr ""
7334 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7335 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7336 "いずれかとなる)"
7337
7338 #. type: TP
7339 #: build/C/man2/send.2:361
7340 #, no-wrap
7341 msgid "B<EMSGSIZE>"
7342 msgstr "B<EMSGSIZE>"
7343
7344 #.  (e.g., SOCK_DGRAM )
7345 #. type: Plain text
7346 #: build/C/man2/send.2:367
7347 msgid ""
7348 "The socket type requires that message be sent atomically, and the size of "
7349 "the message to be sent made this impossible."
7350 msgstr ""
7351 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7352 "るが、 メッセージが大き過ぎるため送信することができない。"
7353
7354 #. type: Plain text
7355 #: build/C/man2/send.2:375
7356 msgid ""
7357 "The output queue for a network interface was full.  This generally indicates "
7358 "that the interface has stopped sending, but may be caused by transient "
7359 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7360 "silently dropped when a device queue overflows.)"
7361 msgstr ""
7362 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7363 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7364 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7365 "フローした場合にはパケットは黙って捨てられる)"
7366
7367 #. type: Plain text
7368 #: build/C/man2/send.2:378
7369 msgid "No memory available."
7370 msgstr "メモリが足りない。"
7371
7372 #. type: Plain text
7373 #: build/C/man2/send.2:381
7374 msgid "The socket is not connected, and no target has been given."
7375 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7376
7377 #. type: Plain text
7378 #: build/C/man2/send.2:391
7379 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7380 msgstr ""
7381 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7382 "る。"
7383
7384 #. type: TP
7385 #: build/C/man2/send.2:391
7386 #, no-wrap
7387 msgid "B<EPIPE>"
7388 msgstr "B<EPIPE>"
7389
7390 #. type: Plain text
7391 #: build/C/man2/send.2:400
7392 msgid ""
7393 "The local end has been shut down on a connection oriented socket.  In this "
7394 "case, the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7395 "set."
7396 msgstr ""
7397 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7398 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7399
7400 #. type: Plain text
7401 #: build/C/man2/send.2:403
7402 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7403 msgstr ""
7404 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7405
7406 #. type: Plain text
7407 #: build/C/man2/send.2:414
7408 msgid ""
7409 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7410 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7411 "flag is a Linux extension."
7412 msgstr ""
7413 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7414 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7415 "ラグは Linux での拡張である。"
7416
7417 #. type: Plain text
7418 #: build/C/man2/send.2:433
7419 msgid ""
7420 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7421 "can be used to transmit multiple datagrams in a single call."
7422 msgstr ""
7423 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7424 "る\n"
7425 "Linux 固有の システムコールに関する情報が書かれている。"
7426
7427 #. type: Plain text
7428 #: build/C/man2/send.2:438
7429 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7430 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7431
7432 #. type: Plain text
7433 #: build/C/man2/send.2:443
7434 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7435 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7436
7437 #. type: Plain text
7438 #: build/C/man2/send.2:458
7439 msgid ""
7440 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7441 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7442 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7443 msgstr ""
7444 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7445 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7446 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7447
7448 #. type: TH
7449 #: build/C/man2/sendmmsg.2:28
7450 #, no-wrap
7451 msgid "SENDMMSG"
7452 msgstr "SENDMMSG"
7453
7454 #. type: TH
7455 #: build/C/man2/sendmmsg.2:28 build/C/man7/socket.7:58
7456 #, fuzzy, no-wrap
7457 #| msgid "2014-05-10"
7458 msgid "2014-07-08"
7459 msgstr "2014-05-10"
7460
7461 #. type: Plain text
7462 #: build/C/man2/sendmmsg.2:31
7463 msgid "sendmmsg - send multiple messages on a socket"
7464 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7465
7466 #. type: Plain text
7467 #: build/C/man2/sendmmsg.2:39
7468 #, no-wrap
7469 msgid ""
7470 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7471 "B<             unsigned int >I<flags>B<);>\n"
7472 msgstr ""
7473 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7474 "B<             unsigned int >I<flags>B<);>\n"
7475
7476 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7477 #. type: Plain text
7478 #: build/C/man2/sendmmsg.2:49
7479 msgid ""
7480 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7481 "the caller to transmit multiple messages on a socket using a single system "
7482 "call.  (This has performance benefits for some applications.)"
7483 msgstr ""
7484 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7485 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7486 "ンによっては性能上のメリットがある)。"
7487
7488 #. type: Plain text
7489 #: build/C/man2/sendmmsg.2:54
7490 msgid ""
7491 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7492 "to be transmitted."
7493 msgstr ""
7494 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7495
7496 #. type: Plain text
7497 #: build/C/man2/sendmmsg.2:75
7498 #, no-wrap
7499 msgid ""
7500 "struct mmsghdr {\n"
7501 "    struct msghdr msg_hdr;  /* Message header */\n"
7502 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7503 "};\n"
7504 msgstr ""
7505 "struct mmsghdr {\n"
7506 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7507 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7508 "};\n"
7509
7510 #. type: Plain text
7511 #: build/C/man2/sendmmsg.2:91
7512 msgid ""
7513 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
7514 "B<sendmsg>(2).  The I<msg_len> field is used to return the number of bytes "
7515 "sent from the message in I<msg_hdr> (i.e., the same as the return value from "
7516 "a single B<sendmsg>(2)  call)."
7517 msgstr ""
7518 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7519 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7520 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7521 "合の返り値と同じである。"
7522
7523 #. type: Plain text
7524 #: build/C/man2/sendmmsg.2:97
7525 msgid ""
7526 "The I<flags> argument contains flags ORed together.  The flags are the same "
7527 "as for B<sendmsg>(2)."
7528 msgstr ""
7529 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7530 "B<sendmsg>(2) と同じである。"
7531
7532 #. type: Plain text
7533 #: build/C/man2/sendmmsg.2:107
7534 msgid ""
7535 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7536 "sent.  A nonblocking call sends as many messages as possible (up to the "
7537 "limit specified by I<vlen>)  and returns immediately."
7538 msgstr ""
7539 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7540 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7541 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7542
7543 #. type: Plain text
7544 #: build/C/man2/sendmmsg.2:119
7545 msgid ""
7546 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7547 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7548 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7549 "of elements of I<msgvec> that have been updated."
7550 msgstr ""
7551 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7552 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7553 "しの返り値は、更新された I<msgvec> の要素数である。"
7554
7555 #. type: Plain text
7556 #: build/C/man2/sendmmsg.2:129
7557 msgid ""
7558 "On success, B<sendmmsg>()  returns the number of messages sent from "
7559 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7560 "B<sendmmsg>()  call to send the remaining messages."
7561 msgstr ""
7562 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7563 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7564 "て残りのメッセージを送信することができる。"
7565
7566 #. type: Plain text
7567 #: build/C/man2/sendmmsg.2:133
7568 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7569 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7570
7571 #
7572 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7573 #.      ... only return an error if no datagrams could be sent.
7574 #.      If less than the requested number of messages were sent, the application
7575 #.      must retry starting at the first failed one and if the problem is
7576 #.      persistent the error will be returned.
7577 #.      This matches the behavior of other syscalls like read/write - it
7578 #.      is not an error if less than the requested number of elements are sent.
7579 #. type: Plain text
7580 #: build/C/man2/sendmmsg.2:145
7581 msgid ""
7582 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7583 "could be sent."
7584 msgstr ""
7585 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7586 "く送信できなかった場合のみである。"
7587
7588 #. type: Plain text
7589 #: build/C/man2/sendmmsg.2:150
7590 msgid ""
7591 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7592 "added in version 2.14."
7593 msgstr ""
7594 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7595 "バージョン 2.14 で追加された。"
7596
7597 #. type: Plain text
7598 #: build/C/man2/sendmmsg.2:153
7599 msgid "B<sendmmsg>()  is Linux-specific."
7600 msgstr "B<sendmmsg>() は Linux 固有である。"
7601
7602 #
7603 #
7604 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7605 #.      net: Cap number of elements for sendmmsg
7606 #.      To limit the amount of time we can spend in sendmmsg, cap the
7607 #.      number of elements to UIO_MAXIOV (currently 1024).
7608 #.      For error handling an application using sendmmsg needs to retry at
7609 #.      the first unsent message, so capping is simpler and requires less
7610 #.      application logic than returning EINVAL.
7611 #. type: Plain text
7612 #: build/C/man2/sendmmsg.2:168
7613 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7614 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7615
7616 #. type: Plain text
7617 #: build/C/man2/sendmmsg.2:177
7618 msgid ""
7619 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7620 "distinct UDP datagrams using one system call.  The contents of the first "
7621 "datagram originates from a pair of buffers."
7622 msgstr ""
7623 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7624 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7625 "の内容は、二つのバッファから取得される。"
7626
7627 #. type: Plain text
7628 #: build/C/man2/sendmmsg.2:186
7629 #, no-wrap
7630 msgid ""
7631 "#define _GNU_SOURCE\n"
7632 "#include E<lt>netinet/ip.hE<gt>\n"
7633 "#include E<lt>stdio.hE<gt>\n"
7634 "#include E<lt>stdlib.hE<gt>\n"
7635 "#include E<lt>string.hE<gt>\n"
7636 "#include E<lt>sys/types.hE<gt>\n"
7637 "#include E<lt>sys/socket.hE<gt>\n"
7638 msgstr ""
7639 "#define _GNU_SOURCE\n"
7640 "#include E<lt>netinet/ip.hE<gt>\n"
7641 "#include E<lt>stdio.hE<gt>\n"
7642 "#include E<lt>stdlib.hE<gt>\n"
7643 "#include E<lt>string.hE<gt>\n"
7644 "#include E<lt>sys/types.hE<gt>\n"
7645 "#include E<lt>sys/socket.hE<gt>\n"
7646
7647 #. type: Plain text
7648 #: build/C/man2/sendmmsg.2:195
7649 #, no-wrap
7650 msgid ""
7651 "int\n"
7652 "main(void)\n"
7653 "{\n"
7654 "    int sockfd;\n"
7655 "    struct sockaddr_in sa;\n"
7656 "    struct mmsghdr msg[2];\n"
7657 "    struct iovec msg1[2], msg2;\n"
7658 "    int retval;\n"
7659 msgstr ""
7660 "int\n"
7661 "main(void)\n"
7662 "{\n"
7663 "    int sockfd;\n"
7664 "    struct sockaddr_in sa;\n"
7665 "    struct mmsghdr msg[2];\n"
7666 "    struct iovec msg1[2], msg2;\n"
7667 "    int retval;\n"
7668
7669 #. type: Plain text
7670 #: build/C/man2/sendmmsg.2:209
7671 #, no-wrap
7672 msgid ""
7673 "    sa.sin_family = AF_INET;\n"
7674 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7675 "    sa.sin_port = htons(1234);\n"
7676 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7677 "        perror(\"connect()\");\n"
7678 "        exit(EXIT_FAILURE);\n"
7679 "    }\n"
7680 msgstr ""
7681 "    sa.sin_family = AF_INET;\n"
7682 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7683 "    sa.sin_port = htons(1234);\n"
7684 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7685 "        perror(\"connect()\");\n"
7686 "        exit(EXIT_FAILURE);\n"
7687 "    }\n"
7688
7689 #. type: Plain text
7690 #: build/C/man2/sendmmsg.2:215
7691 #, no-wrap
7692 msgid ""
7693 "    memset(msg1, 0, sizeof(msg1));\n"
7694 "    msg1[0].iov_base = \"one\";\n"
7695 "    msg1[0].iov_len = 3;\n"
7696 "    msg1[1].iov_base = \"two\";\n"
7697 "    msg1[1].iov_len = 3;\n"
7698 msgstr ""
7699 "    memset(msg1, 0, sizeof(msg1));\n"
7700 "    msg1[0].iov_base = \"one\";\n"
7701 "    msg1[0].iov_len = 3;\n"
7702 "    msg1[1].iov_base = \"two\";\n"
7703 "    msg1[1].iov_len = 3;\n"
7704
7705 #. type: Plain text
7706 #: build/C/man2/sendmmsg.2:219
7707 #, no-wrap
7708 msgid ""
7709 "    memset(&msg2, 0, sizeof(msg2));\n"
7710 "    msg2.iov_base = \"three\";\n"
7711 "    msg2.iov_len = 5;\n"
7712 msgstr ""
7713 "    memset(&msg2, 0, sizeof(msg2));\n"
7714 "    msg2.iov_base = \"three\";\n"
7715 "    msg2.iov_len = 5;\n"
7716
7717 #. type: Plain text
7718 #: build/C/man2/sendmmsg.2:223
7719 #, no-wrap
7720 msgid ""
7721 "    memset(msg, 0, sizeof(msg));\n"
7722 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7723 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7724 msgstr ""
7725 "    memset(msg, 0, sizeof(msg));\n"
7726 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7727 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7728
7729 #. type: Plain text
7730 #: build/C/man2/sendmmsg.2:226
7731 #, no-wrap
7732 msgid ""
7733 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7734 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7735 msgstr ""
7736 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7737 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7738
7739 #. type: Plain text
7740 #: build/C/man2/sendmmsg.2:232
7741 #, no-wrap
7742 msgid ""
7743 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7744 "    if (retval == -1)\n"
7745 "        perror(\"sendmmsg()\");\n"
7746 "    else\n"
7747 "        printf(\"%d messages sent\\en\", retval);\n"
7748 msgstr ""
7749 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7750 "    if (retval == -1)\n"
7751 "        perror(\"sendmmsg()\");\n"
7752 "    else\n"
7753 "        printf(\"%d messages sent\\en\", retval);\n"
7754
7755 #. type: Plain text
7756 #: build/C/man2/sendmmsg.2:235
7757 #, no-wrap
7758 msgid ""
7759 "    exit(0);\n"
7760 "}\n"
7761 msgstr ""
7762 "    exit(0);\n"
7763 "}\n"
7764
7765 #. type: Plain text
7766 #: build/C/man2/sendmmsg.2:241
7767 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7768 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7769
7770 #. type: TH
7771 #: build/C/man3/sockatmark.3:25
7772 #, no-wrap
7773 msgid "SOCKATMARK"
7774 msgstr "SOCKATMARK"
7775
7776 #. type: TH
7777 #: build/C/man3/sockatmark.3:25
7778 #, no-wrap
7779 msgid "2014-02-28"
7780 msgstr "2014-02-28"
7781
7782 #. type: Plain text
7783 #: build/C/man3/sockatmark.3:28
7784 msgid "sockatmark - determine whether socket is at out-of-band mark"
7785 msgstr ""
7786 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7787 "べる"
7788
7789 #. type: Plain text
7790 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7791 #: build/C/man7/socket.7:63 build/C/man2/socketpair.2:49
7792 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7793 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7794
7795 #. type: Plain text
7796 #: build/C/man3/sockatmark.3:32
7797 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7798 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7799
7800 #. type: Plain text
7801 #: build/C/man3/sockatmark.3:41
7802 msgid ""
7803 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7804 "\\ 600"
7805 msgstr ""
7806 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7807 "\\ 600"
7808
7809 #. type: Plain text
7810 #: build/C/man3/sockatmark.3:51
7811 msgid ""
7812 "B<sockatmark>()  returns a value indicating whether or not the socket "
7813 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7814 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7815 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7816 msgstr ""
7817 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7818 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7819 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7820 "この関数は帯域外マークを削除しない。"
7821
7822 #. type: Plain text
7823 #: build/C/man3/sockatmark.3:58
7824 msgid ""
7825 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7826 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7827 "set to indicate the error."
7828 msgstr ""
7829 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7830 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7831 "れ、エラーを表す I<errno> が設定される。"
7832
7833 #. type: Plain text
7834 #: build/C/man3/sockatmark.3:63
7835 msgid "I<sockfd> is not a valid file descriptor."
7836 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7837
7838 #.  POSIX.1 says ENOTTY for this case
7839 #. type: Plain text
7840 #: build/C/man3/sockatmark.3:70
7841 msgid ""
7842 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7843 msgstr ""
7844 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7845
7846 #. type: Plain text
7847 #: build/C/man3/sockatmark.3:73
7848 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7849 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7850
7851 #. type: Plain text
7852 #: build/C/man3/sockatmark.3:78
7853 msgid "The B<sockatmark>()  function is thread-safe."
7854 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7855
7856 #. type: Plain text
7857 #: build/C/man3/sockatmark.3:80
7858 msgid "POSIX.1-2001."
7859 msgstr "POSIX.1-2001."
7860
7861 #. type: Plain text
7862 #: build/C/man3/sockatmark.3:87
7863 msgid ""
7864 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7865 "the B<MSG_OOB> flag of B<recv>(2)."
7866 msgstr ""
7867 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7868 "B<recv>(2)  で読み込むことができる。"
7869
7870 #. type: Plain text
7871 #: build/C/man3/sockatmark.3:89
7872 msgid "Out-of-band data is supported only on some stream socket protocols."
7873 msgstr ""
7874 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7875 "ない。"
7876
7877 #. type: Plain text
7878 #: build/C/man3/sockatmark.3:94
7879 msgid ""
7880 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7881 "signal."
7882 msgstr ""
7883 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7884 "る。"
7885
7886 #. type: Plain text
7887 #: build/C/man3/sockatmark.3:100
7888 msgid ""
7889 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7890 "operation."
7891 msgstr ""
7892 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7893
7894 #. type: Plain text
7895 #: build/C/man3/sockatmark.3:104
7896 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7897 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7898
7899 #. type: Plain text
7900 #: build/C/man3/sockatmark.3:109
7901 msgid ""
7902 "The following code can be used after receipt of a B<SIGURG> signal to read "
7903 "(and discard) all data up to the mark, and then read the byte of data at the "
7904 "mark:"
7905 msgstr ""
7906 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7907 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7908
7909 #. type: Plain text
7910 #: build/C/man3/sockatmark.3:114
7911 #, no-wrap
7912 msgid ""
7913 "    char buf[BUF_LEN];\n"
7914 "    char oobdata;\n"
7915 "    int atmark, s;\n"
7916 msgstr ""
7917 "    char buf[BUF_LEN];\n"
7918 "    char oobdata;\n"
7919 "    int atmark, s;\n"
7920
7921 #. type: Plain text
7922 #: build/C/man3/sockatmark.3:121
7923 #, no-wrap
7924 msgid ""
7925 "    for (;;) {\n"
7926 "        atmark = sockatmark(sockfd);\n"
7927 "        if (atmark == -1) {\n"
7928 "            perror(\"sockatmark\");\n"
7929 "            break;\n"
7930 "        }\n"
7931 msgstr ""
7932 "    for (;;) {\n"
7933 "        atmark = sockatmark(sockfd);\n"
7934 "        if (atmark == -1) {\n"
7935 "            perror(\"sockatmark\");\n"
7936 "            break;\n"
7937 "        }\n"
7938
7939 #. type: Plain text
7940 #: build/C/man3/sockatmark.3:124
7941 #, no-wrap
7942 msgid ""
7943 "        if (atmark)\n"
7944 "            break;\n"
7945 msgstr ""
7946 "        if (atmark)\n"
7947 "            break;\n"
7948
7949 #. type: Plain text
7950 #: build/C/man3/sockatmark.3:131
7951 #, no-wrap
7952 msgid ""
7953 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7954 "        if (s == -1)\n"
7955 "            perror(\"read\");\n"
7956 "        if (s E<lt>= 0)\n"
7957 "            break;\n"
7958 "    }\n"
7959 msgstr ""
7960 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7961 "        if (s == -1)\n"
7962 "            perror(\"read\");\n"
7963 "        if (s E<lt>= 0)\n"
7964 "            break;\n"
7965 "    }\n"
7966
7967 #. type: Plain text
7968 #: build/C/man3/sockatmark.3:138
7969 #, no-wrap
7970 msgid ""
7971 "    if (atmark == 1) {\n"
7972 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7973 "            perror(\"recv\");\n"
7974 "            ...\n"
7975 "        }\n"
7976 "    }\n"
7977 msgstr ""
7978 "    if (atmark == 1) {\n"
7979 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7980 "            perror(\"recv\");\n"
7981 "            ...\n"
7982 "        }\n"
7983 "    }\n"
7984
7985 #. type: Plain text
7986 #: build/C/man3/sockatmark.3:144
7987 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7988 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7989
7990 #. type: TH
7991 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
7992 #, no-wrap
7993 msgid "SOCKET"
7994 msgstr "SOCKET"
7995
7996 #. type: TH
7997 #: build/C/man2/socket.2:43
7998 #, no-wrap
7999 msgid "2013-12-31"
8000 msgstr "2013-12-31"
8001
8002 #. type: Plain text
8003 #: build/C/man2/socket.2:46
8004 msgid "socket - create an endpoint for communication"
8005 msgstr "socket - 通信のための端点(endpoint)を作成する"
8006
8007 #. type: Plain text
8008 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
8009 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
8010 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
8011
8012 #. type: Plain text
8013 #: build/C/man2/socket.2:52
8014 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8015 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
8016
8017 #. type: Plain text
8018 #: build/C/man2/socket.2:55
8019 msgid ""
8020 "B<socket>()  creates an endpoint for communication and returns a descriptor."
8021 msgstr ""
8022 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
8023 "(descriptor)を返す。"
8024
8025 #. type: Plain text
8026 #: build/C/man2/socket.2:63
8027 msgid ""
8028 "The I<domain> argument specifies a communication domain; this selects the "
8029 "protocol family which will be used for communication.  These families are "
8030 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
8031 "include:"
8032 msgstr ""
8033 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
8034 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
8035 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
8036 "下の通り。"
8037
8038 #. type: tbl table
8039 #: build/C/man2/socket.2:66
8040 #, no-wrap
8041 msgid "Name:Purpose:Man page\n"
8042 msgstr "名前:目的:マニュアル\n"
8043
8044 #. type: tbl table
8045 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
8046 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
8047 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
8048 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8049 #, no-wrap
8050 msgid "T{\n"
8051 msgstr "T{\n"
8052
8053 #. type: tbl table
8054 #: build/C/man2/socket.2:68
8055 #, no-wrap
8056 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8057 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8058
8059 #. type: tbl table
8060 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8061 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8062 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8063 #: build/C/man7/socket.7:194
8064 #, no-wrap
8065 msgid "T}:T{\n"
8066 msgstr "T}:T{\n"
8067
8068 #. type: tbl table
8069 #: build/C/man2/socket.2:70
8070 #, no-wrap
8071 msgid "Local communication\n"
8072 msgstr "ローカル通信\n"
8073
8074 #. type: tbl table
8075 #: build/C/man2/socket.2:72
8076 #, no-wrap
8077 msgid "B<unix>(7)\n"
8078 msgstr "B<unix>(7)\n"
8079
8080 #. type: tbl table
8081 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8082 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8083 #: build/C/man2/socket.2:118 build/C/man7/socket.7:173
8084 #: build/C/man7/socket.7:177 build/C/man7/socket.7:180
8085 #: build/C/man7/socket.7:186 build/C/man7/socket.7:189
8086 #: build/C/man7/socket.7:198 build/C/man7/socket.7:205
8087 #, no-wrap
8088 msgid "T}\n"
8089 msgstr "T}\n"
8090
8091 #. type: tbl table
8092 #: build/C/man2/socket.2:75
8093 #, no-wrap
8094 msgid "B<AF_INET>\n"
8095 msgstr "B<AF_INET>\n"
8096
8097 #. type: tbl table
8098 #: build/C/man2/socket.2:76
8099 #, no-wrap
8100 msgid "T}:IPv4 Internet protocols:T{\n"
8101 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
8102
8103 #. type: tbl table
8104 #: build/C/man2/socket.2:77
8105 #, no-wrap
8106 msgid "B<ip>(7)\n"
8107 msgstr "B<ip>(7)\n"
8108
8109 #. type: tbl table
8110 #: build/C/man2/socket.2:80
8111 #, no-wrap
8112 msgid "B<AF_INET6>\n"
8113 msgstr "B<AF_INET6>\n"
8114
8115 #. type: tbl table
8116 #: build/C/man2/socket.2:81
8117 #, no-wrap
8118 msgid "T}:IPv6 Internet protocols:T{\n"
8119 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
8120
8121 #. type: tbl table
8122 #: build/C/man2/socket.2:82
8123 #, no-wrap
8124 msgid "B<ipv6>(7)\n"
8125 msgstr "B<ipv6>(7)\n"
8126
8127 #. type: tbl table
8128 #: build/C/man2/socket.2:85
8129 #, no-wrap
8130 msgid "B<AF_IPX>\n"
8131 msgstr "B<AF_IPX>\n"
8132
8133 #. type: tbl table
8134 #: build/C/man2/socket.2:86
8135 #, no-wrap
8136 msgid "T}:IPX - Novell protocols:\n"
8137 msgstr "T}:IPX - Novell プロトコル:\n"
8138
8139 #. type: tbl table
8140 #: build/C/man2/socket.2:88
8141 #, no-wrap
8142 msgid "B<AF_NETLINK>\n"
8143 msgstr "B<AF_NETLINK>\n"
8144
8145 #. type: tbl table
8146 #: build/C/man2/socket.2:90
8147 #, no-wrap
8148 msgid "Kernel user interface device\n"
8149 msgstr "カーネル・ユーザ・デバイス\n"
8150
8151 #. type: tbl table
8152 #: build/C/man2/socket.2:92
8153 #, no-wrap
8154 msgid "B<netlink>(7)\n"
8155 msgstr "B<netlink>(7)\n"
8156
8157 #. type: tbl table
8158 #: build/C/man2/socket.2:95
8159 #, no-wrap
8160 msgid "B<AF_X25>\n"
8161 msgstr "B<AF_X25>\n"
8162
8163 #. type: tbl table
8164 #: build/C/man2/socket.2:96
8165 #, no-wrap
8166 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8167 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8168
8169 #. type: tbl table
8170 #: build/C/man2/socket.2:97
8171 #, no-wrap
8172 msgid "B<x25>(7)\n"
8173 msgstr "B<x25>(7)\n"
8174
8175 #. type: tbl table
8176 #: build/C/man2/socket.2:100
8177 #, no-wrap
8178 msgid "B<AF_AX25>\n"
8179 msgstr "B<AF_AX25>\n"
8180
8181 #. type: tbl table
8182 #: build/C/man2/socket.2:102
8183 #, no-wrap
8184 msgid "Amateur radio AX.25 protocol\n"
8185 msgstr "アマチュア無線 AX.25 プロトコル\n"
8186
8187 #. type: tbl table
8188 #: build/C/man2/socket.2:103
8189 #, no-wrap
8190 msgid "T}:\n"
8191 msgstr "T}:\n"
8192
8193 #. type: tbl table
8194 #: build/C/man2/socket.2:105
8195 #, no-wrap
8196 msgid "B<AF_ATMPVC>\n"
8197 msgstr "B<AF_ATMPVC>\n"
8198
8199 #. type: tbl table
8200 #: build/C/man2/socket.2:106
8201 #, no-wrap
8202 msgid "T}:Access to raw ATM PVCs:\n"
8203 msgstr "T}:生の ATM PVC にアクセスする:\n"
8204
8205 #. type: tbl table
8206 #: build/C/man2/socket.2:108
8207 #, no-wrap
8208 msgid "B<AF_APPLETALK>\n"
8209 msgstr "B<AF_APPLETALK>\n"
8210
8211 #. type: tbl table
8212 #: build/C/man2/socket.2:109
8213 #, no-wrap
8214 msgid "T}:AppleTalk:T{\n"
8215 msgstr "T}:AppleTalk:T{\n"
8216
8217 #. type: tbl table
8218 #: build/C/man2/socket.2:110
8219 #, no-wrap
8220 msgid "B<ddp>(7)\n"
8221 msgstr "B<ddp>(7)\n"
8222
8223 #. type: tbl table
8224 #: build/C/man2/socket.2:113
8225 #, no-wrap
8226 msgid "B<AF_PACKET>\n"
8227 msgstr "B<AF_PACKET>\n"
8228
8229 #. type: tbl table
8230 #: build/C/man2/socket.2:115
8231 #, no-wrap
8232 msgid "Low level packet interface\n"
8233 msgstr "低レベルのパケットインターフェース\n"
8234
8235 #. type: tbl table
8236 #: build/C/man2/socket.2:117
8237 #, no-wrap
8238 msgid "B<packet>(7)\n"
8239 msgstr "B<packet>(7)\n"
8240
8241 #. type: Plain text
8242 #: build/C/man2/socket.2:126
8243 msgid ""
8244 "The socket has the indicated I<type>, which specifies the communication "
8245 "semantics.  Currently defined types are:"
8246 msgstr ""
8247 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8248 "る。 定義されている型は現在以下の通り。"
8249
8250 #. type: TP
8251 #: build/C/man2/socket.2:126
8252 #, no-wrap
8253 msgid "B<SOCK_STREAM>"
8254 msgstr "B<SOCK_STREAM>"
8255
8256 #. type: Plain text
8257 #: build/C/man2/socket.2:130
8258 msgid ""
8259 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8260 "out-of-band data transmission mechanism may be supported."
8261 msgstr ""
8262 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8263 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8264
8265 #. type: TP
8266 #: build/C/man2/socket.2:130
8267 #, no-wrap
8268 msgid "B<SOCK_DGRAM>"
8269 msgstr "B<SOCK_DGRAM>"
8270
8271 #. type: Plain text
8272 #: build/C/man2/socket.2:134
8273 msgid ""
8274 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8275 "length)."
8276 msgstr ""
8277 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8278 "する。"
8279
8280 #. type: TP
8281 #: build/C/man2/socket.2:134
8282 #, no-wrap
8283 msgid "B<SOCK_SEQPACKET>"
8284 msgstr "B<SOCK_SEQPACKET>"
8285
8286 #. type: Plain text
8287 #: build/C/man2/socket.2:139
8288 msgid ""
8289 "Provides a sequenced, reliable, two-way connection-based data transmission "
8290 "path for datagrams of fixed maximum length; a consumer is required to read "
8291 "an entire packet with each input system call."
8292 msgstr ""
8293 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8294 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8295 "ト全体を読み取ることが要求される。"
8296
8297 #. type: TP
8298 #: build/C/man2/socket.2:139
8299 #, no-wrap
8300 msgid "B<SOCK_RAW>"
8301 msgstr "B<SOCK_RAW>"
8302
8303 #. type: Plain text
8304 #: build/C/man2/socket.2:142
8305 msgid "Provides raw network protocol access."
8306 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8307
8308 #. type: TP
8309 #: build/C/man2/socket.2:142
8310 #, no-wrap
8311 msgid "B<SOCK_RDM>"
8312 msgstr "B<SOCK_RDM>"
8313
8314 #. type: Plain text
8315 #: build/C/man2/socket.2:145
8316 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8317 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8318
8319 #. type: TP
8320 #: build/C/man2/socket.2:145
8321 #, no-wrap
8322 msgid "B<SOCK_PACKET>"
8323 msgstr "B<SOCK_PACKET>"
8324
8325 #. type: Plain text
8326 #: build/C/man2/socket.2:150
8327 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8328 msgstr ""
8329 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8330 "こと"
8331
8332 #. type: Plain text
8333 #: build/C/man2/socket.2:152
8334 msgid "Some socket types may not be implemented by all protocol families."
8335 msgstr ""
8336 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。"
8337
8338 #. type: Plain text
8339 #: build/C/man2/socket.2:160
8340 msgid ""
8341 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8342 "addition to specifying a socket type, it may include the bitwise OR of any "
8343 "of the following values, to modify the behavior of B<socket>():"
8344 msgstr ""
8345 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8346 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8347 "ることで、 B<socket>()  の振舞いを変更することができる。"
8348
8349 #. type: Plain text
8350 #: build/C/man2/socket.2:194
8351 msgid ""
8352 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8353 "Normally only a single protocol exists to support a particular socket type "
8354 "within a given protocol family, in which case I<protocol> can be specified "
8355 "as 0.  However, it is possible that many protocols may exist, in which case "
8356 "a particular protocol must be specified in this manner.  The protocol number "
8357 "to use is specific to the ``communication domain'' in which communication is "
8358 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8359 "protocol name strings to protocol numbers."
8360 msgstr ""
8361 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8362 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8363 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8364 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8365 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8366 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8367 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8368
8369 #. type: Plain text
8370 #: build/C/man2/socket.2:224
8371 msgid ""
8372 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8373 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
8374 "a I<connected> state before any data may be sent or received on it.  A "
8375 "connection to another socket is created with a B<connect>(2)  call.  Once "
8376 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
8377 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
8378 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
8379 "also be transmitted as described in B<send>(2)  and received as described in "
8380 "B<recv>(2)."
8381 msgstr ""
8382 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8383 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8384 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8385 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは "
8386 "B<read>(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種"
8387 "を使用して転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域"
8388 "外データの転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述され"
8389 "ている。"
8390
8391 #. type: Plain text
8392 #: build/C/man2/socket.2:250
8393 msgid ""
8394 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8395 "data is not lost or duplicated.  If a piece of data for which the peer "
8396 "protocol has buffer space cannot be successfully transmitted within a "
8397 "reasonable length of time, then the connection is considered to be dead.  "
8398 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8399 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8400 "signal is raised if a process sends or receives on a broken stream; this "
8401 "causes naive processes, which do not handle the signal, to exit.  "
8402 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8403 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8404 "amount of data requested, and any data remaining in the arriving packet will "
8405 "be discarded.  Also all message boundaries in incoming datagrams are "
8406 "preserved."
8407 msgstr ""
8408 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8409 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8410 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8411 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8412 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8413 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8414 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8415 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8416 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8417 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8418
8419 #. type: Plain text
8420 #: build/C/man2/socket.2:260
8421 msgid ""
8422 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8423 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8424 "received with B<recvfrom>(2), which returns the next datagram along with the "
8425 "address of its sender."
8426 msgstr ""
8427 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8428 "へデータグラムを送ることが許されている。 データグラムは一般に "
8429 "B<recvfrom>(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと"
8430 "一緒に返す。"
8431
8432 #. type: Plain text
8433 #: build/C/man2/socket.2:267
8434 msgid ""
8435 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8436 "from the device driver.  Use B<packet>(7)  instead."
8437 msgstr ""
8438 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8439 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8440
8441 #. type: Plain text
8442 #: build/C/man2/socket.2:290
8443 msgid ""
8444 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8445 "process group to receive a B<SIGURG> signal when the out-of-band data "
8446 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8447 "unexpectedly.  This operation may also be used to set the process or process "
8448 "group that receives the I/O and asynchronous notification of I/O events via "
8449 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8450 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8451 msgstr ""
8452 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8453 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8454 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8455 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8456 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8457 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8458 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8459
8460 #. type: Plain text
8461 #: build/C/man2/socket.2:300
8462 msgid ""
8463 "When the network signals an error condition to the protocol module (e.g., "
8464 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8465 "The next operation on this socket will return the error code of the pending "
8466 "error.  For some protocols it is possible to enable a per-socket error queue "
8467 "to retrieve detailed information about the error; see B<IP_RECVERR> in "
8468 "B<ip>(7)."
8469 msgstr ""
8470 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8471 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8472 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8473 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8474 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8475 "B<IP_RECVERR> を参照すること。"
8476
8477 #. type: Plain text
8478 #: build/C/man2/socket.2:310
8479 msgid ""
8480 "The operation of sockets is controlled by socket level I<options>.  These "
8481 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8482 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8483 "respectively."
8484 msgstr ""
8485 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8486 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8487 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8488
8489 #. type: Plain text
8490 #: build/C/man2/socket.2:315
8491 msgid ""
8492 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8493 "is returned, and I<errno> is set appropriately."
8494 msgstr ""
8495 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8496 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8497
8498 #. type: Plain text
8499 #: build/C/man2/socket.2:320
8500 msgid ""
8501 "Permission to create a socket of the specified type and/or protocol is "
8502 "denied."
8503 msgstr ""
8504 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8505
8506 #. type: Plain text
8507 #: build/C/man2/socket.2:323
8508 msgid "The implementation does not support the specified address family."
8509 msgstr "指定されたアドレスファミリーがサポートされていない。"
8510
8511 #. type: Plain text
8512 #: build/C/man2/socket.2:326
8513 msgid "Unknown protocol, or protocol family not available."
8514 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8515
8516 #.  Since Linux 2.6.27
8517 #. type: Plain text
8518 #: build/C/man2/socket.2:331
8519 msgid "Invalid flags in I<type>."
8520 msgstr "I<type> に無効なフラグが指定されている。"
8521
8522 #. type: Plain text
8523 #: build/C/man2/socket.2:334
8524 msgid "Process file table overflow."
8525 msgstr "プロセスのファイルテーブルが溢れている。"
8526
8527 #. type: TP
8528 #: build/C/man2/socket.2:337
8529 #, no-wrap
8530 msgid "B<ENOBUFS> or B<ENOMEM>"
8531 msgstr "B<ENOBUFS> または B<ENOMEM>"
8532
8533 #. type: Plain text
8534 #: build/C/man2/socket.2:342
8535 msgid ""
8536 "Insufficient memory is available.  The socket cannot be created until "
8537 "sufficient resources are freed."
8538 msgstr ""
8539 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8540 "ない。"
8541
8542 #. type: TP
8543 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8544 #, no-wrap
8545 msgid "B<EPROTONOSUPPORT>"
8546 msgstr "B<EPROTONOSUPPORT>"
8547
8548 #. type: Plain text
8549 #: build/C/man2/socket.2:346
8550 msgid ""
8551 "The protocol type or the specified protocol is not supported within this "
8552 "domain."
8553 msgstr ""
8554 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8555 "いない。"
8556
8557 #. type: Plain text
8558 #: build/C/man2/socket.2:348
8559 msgid "Other errors may be generated by the underlying protocol modules."
8560 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8561
8562 #. type: Plain text
8563 #: build/C/man2/socket.2:350
8564 msgid "4.4BSD, POSIX.1-2001."
8565 msgstr "4.4BSD, POSIX.1-2001."
8566
8567 #. type: Plain text
8568 #: build/C/man2/socket.2:356
8569 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8570 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8571
8572 #. type: Plain text
8573 #: build/C/man2/socket.2:362
8574 msgid ""
8575 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8576 "systems supporting clones of the BSD socket layer (including System\\ V "
8577 "variants)."
8578 msgstr ""
8579 "B<socket>()  は 4.2BSD で登場した。一般に、(System\\ V の変種を含めて)  BSD "
8580 "のソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD "
8581 "以外のシステムからの移植ができる。"
8582
8583 #. type: Plain text
8584 #: build/C/man2/socket.2:381
8585 msgid ""
8586 "The manifest constants used under 4.x BSD for protocol families are "
8587 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8588 "are used for address families.  However, already the BSD man page promises: "
8589 "\"The protocol family generally is the same as the address family\", and "
8590 "subsequent standards use AF_* everywhere."
8591 msgstr ""
8592 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8593 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8594 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8595 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8596 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8597 "それ以外の規格では全ての場所で AF_* が使用されている。"
8598
8599 #. type: Plain text
8600 #: build/C/man2/socket.2:386
8601 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8602 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8603
8604 #. type: Plain text
8605 #: build/C/man2/socket.2:409
8606 msgid ""
8607 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8608 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8609 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8610 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8611 "B<udp>(7), B<unix>(7)"
8612 msgstr ""
8613 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8614 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8615 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8616 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8617 "B<udp>(7), B<unix>(7)"
8618
8619 #. type: Plain text
8620 #: build/C/man2/socket.2:415
8621 msgid ""
8622 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8623 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8624 "Programmer's Supplementary Documents Volume 1.>"
8625 msgstr ""
8626 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8627 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8628 "Supplementary Documents Volume 1.> として再版された)"
8629
8630 #. type: Plain text
8631 #: build/C/man7/socket.7:61
8632 msgid "socket - Linux socket interface"
8633 msgstr "socket - Linux のソケットインターフェース"
8634
8635 #. type: Plain text
8636 #: build/C/man7/socket.7:65
8637 msgid ""
8638 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8639 ">I<protocol>B<);>"
8640 msgstr ""
8641 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8642 ">I<protocol>B<);>"
8643
8644 #. type: Plain text
8645 #: build/C/man7/socket.7:84
8646 msgid ""
8647 "This manual page describes the Linux networking socket layer user "
8648 "interface.  The BSD compatible sockets are the uniform interface between the "
8649 "user process and the network protocol stacks in the kernel.  The protocol "
8650 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8651 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8652 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8653 msgstr ""
8654 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8655 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8656 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8657 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8658 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8659 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8660 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8661
8662 #. type: SS
8663 #: build/C/man7/socket.7:84
8664 #, no-wrap
8665 msgid "Socket-layer functions"
8666 msgstr "ソケット層の関数群"
8667
8668 #. type: Plain text
8669 #: build/C/man7/socket.7:88
8670 msgid ""
8671 "These functions are used by the user process to send or receive packets and "
8672 "to do other socket operations.  For more information see their respective "
8673 "manual pages."
8674 msgstr ""
8675 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8676 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8677
8678 #. type: Plain text
8679 #: build/C/man7/socket.7:104
8680 msgid ""
8681 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8682 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8683 "address, B<listen>(2)  tells the socket that new connections shall be "
8684 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8685 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8686 "(implemented only for a few local families like B<AF_UNIX>)"
8687 msgstr ""
8688 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8689 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8690 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8691 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8692 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8693 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8694 "リーでしか実装されていない)。"
8695
8696 #. type: Plain text
8697 #: build/C/man7/socket.7:126
8698 msgid ""
8699 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8700 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8701 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8702 "data.  In addition, the standard I/O operations like B<write>(2), "
8703 "B<writev>(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to "
8704 "read and write data."
8705 msgstr ""
8706 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8707 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8708 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8709 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8710 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8711 "ことができる。"
8712
8713 #. type: Plain text
8714 #: build/C/man7/socket.7:137
8715 msgid ""
8716 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8717 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8718 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8719 "be used to set or read some other options."
8720 msgstr ""
8721 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8722 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8723 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8724 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8725
8726 #. type: Plain text
8727 #: build/C/man7/socket.7:142
8728 msgid ""
8729 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8730 "full-duplex socket connection."
8731 msgstr ""
8732 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8733 "続を部分的にクローズする。"
8734
8735 #. type: Plain text
8736 #: build/C/man7/socket.7:148
8737 msgid ""
8738 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8739 "not supported on sockets."
8740 msgstr ""
8741 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8742 "ではサポートされていない。"
8743
8744 #. type: Plain text
8745 #: build/C/man7/socket.7:165
8746 msgid ""
8747 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8748 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8749 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8750 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8751 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8752 msgstr ""
8753 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8754 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8755 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8756 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8757 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8758 "B<select>(2)  を使って待つことができる。"
8759
8760 #. type: tbl table
8761 #: build/C/man7/socket.7:169
8762 #, no-wrap
8763 msgid "I/O events\n"
8764 msgstr "I/O イベント\n"
8765
8766 #. type: tbl table
8767 #: build/C/man7/socket.7:170
8768 #, no-wrap
8769 msgid "Event:Poll flag:Occurrence\n"
8770 msgstr "イベント:poll フラグ:内容\n"
8771
8772 #. type: tbl table
8773 #: build/C/man7/socket.7:171 build/C/man7/socket.7:174
8774 #, no-wrap
8775 msgid "Read:POLLIN:T{\n"
8776 msgstr "Read:POLLIN:T{\n"
8777
8778 #. type: tbl table
8779 #: build/C/man7/socket.7:172
8780 #, no-wrap
8781 msgid "New data arrived.\n"
8782 msgstr "新しいデータが到着した。\n"
8783
8784 #. type: tbl table
8785 #: build/C/man7/socket.7:175
8786 #, no-wrap
8787 msgid "A connection setup has been completed\n"
8788 msgstr "(接続志向のソケットで)\n"
8789
8790 #. type: tbl table
8791 #: build/C/man7/socket.7:176
8792 #, no-wrap
8793 msgid "(for connection-oriented sockets)\n"
8794 msgstr "接続の設定が終了した。\n"
8795
8796 #. type: tbl table
8797 #: build/C/man7/socket.7:178 build/C/man7/socket.7:181
8798 #, no-wrap
8799 msgid "Read:POLLHUP:T{\n"
8800 msgstr "Read:POLLHUP:T{\n"
8801
8802 #. type: tbl table
8803 #: build/C/man7/socket.7:179
8804 #, no-wrap
8805 msgid "A disconnection request has been initiated by the other end.\n"
8806 msgstr "接続先で切断要求が生成された。\n"
8807
8808 #. type: tbl table
8809 #: build/C/man7/socket.7:182
8810 #, no-wrap
8811 msgid "A connection is broken (only for connection-oriented protocols).\n"
8812 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8813
8814 #. type: tbl table
8815 #: build/C/man7/socket.7:183
8816 #, no-wrap
8817 msgid "When the socket is written\n"
8818 msgstr "この場合、ソケットに書き込みが行われると\n"
8819
8820 #. type: tbl table
8821 #: build/C/man7/socket.7:184
8822 #, no-wrap
8823 msgid "B<SIGPIPE>\n"
8824 msgstr "B<SIGPIPE>\n"
8825
8826 #. type: tbl table
8827 #: build/C/man7/socket.7:185
8828 #, no-wrap
8829 msgid "is also sent.\n"
8830 msgstr "も送信される。\n"
8831
8832 #. type: tbl table
8833 #: build/C/man7/socket.7:187
8834 #, no-wrap
8835 msgid "Write:POLLOUT:T{\n"
8836 msgstr "Write:POLLOUT:T{\n"
8837
8838 #. type: tbl table
8839 #: build/C/man7/socket.7:188
8840 #, no-wrap
8841 msgid "Socket has enough send buffer space for writing new data.\n"
8842 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8843
8844 #. type: tbl table
8845 #: build/C/man7/socket.7:190
8846 #, no-wrap
8847 msgid "Read/Write:T{\n"
8848 msgstr "Read/Write:T{\n"
8849
8850 #. type: tbl table
8851 #: build/C/man7/socket.7:191
8852 #, no-wrap
8853 msgid "POLLIN|\n"
8854 msgstr "POLLIN|\n"
8855
8856 #. type: tbl table
8857 #: build/C/man7/socket.7:192
8858 #, no-wrap
8859 msgid ".br\n"
8860 msgstr ".br\n"
8861
8862 #. type: tbl table
8863 #: build/C/man7/socket.7:193
8864 #, no-wrap
8865 msgid "POLLOUT\n"
8866 msgstr "POLLOUT\n"
8867
8868 #. type: tbl table
8869 #: build/C/man7/socket.7:195
8870 #, no-wrap
8871 msgid "An outgoing\n"
8872 msgstr "外部向けの\n"
8873
8874 #. type: tbl table
8875 #: build/C/man7/socket.7:196
8876 #, no-wrap
8877 msgid "B<connect>(2)\n"
8878 msgstr "B<connect>(2)\n"
8879
8880 #. type: tbl table
8881 #: build/C/man7/socket.7:197
8882 #, no-wrap
8883 msgid "finished.\n"
8884 msgstr "が終了した。\n"
8885
8886 #. type: tbl table
8887 #: build/C/man7/socket.7:199
8888 #, no-wrap
8889 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8890 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8891
8892 #. type: tbl table
8893 #: build/C/man7/socket.7:200
8894 #, no-wrap
8895 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8896 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8897
8898 #. type: tbl table
8899 #: build/C/man7/socket.7:201
8900 #, no-wrap
8901 msgid "Exception:POLLPRI:T{\n"
8902 msgstr "Exception:POLLPRI:T{\n"
8903
8904 #. type: tbl table
8905 #: build/C/man7/socket.7:202
8906 #, no-wrap
8907 msgid "Urgent data arrived.\n"
8908 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8909
8910 #. type: tbl table
8911 #: build/C/man7/socket.7:203
8912 #, no-wrap
8913 msgid "B<SIGURG>\n"
8914 msgstr "B<SIGURG>\n"
8915
8916 #. type: tbl table
8917 #: build/C/man7/socket.7:204
8918 #, no-wrap
8919 msgid "is sent then.\n"
8920 msgstr "が送信される。\n"
8921
8922 #. type: Plain text
8923 #: build/C/man7/socket.7:233
8924 msgid ""
8925 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8926 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8927 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8928 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8929 "I<Signals> discussion below."
8930 msgstr ""
8931 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8932 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8933 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8934 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8935 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8936 "と。"
8937
8938 #. type: SS
8939 #: build/C/man7/socket.7:233
8940 #, no-wrap
8941 msgid "Socket address structures"
8942 msgstr "ソケットアドレス構造体"
8943
8944 #. type: Plain text
8945 #: build/C/man7/socket.7:249
8946 msgid ""
8947 "Each socket domain has its own format for socket addresses, with a domain-"
8948 "specific address structure.  Each of these structures begins with an integer "
8949 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8950 "address structure.  This allows the various system calls (e.g., "
8951 "B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8952 "B<getpeername>(2)), which are generic to all socket domains, to determine "
8953 "the domain of a particular socket address."
8954 msgstr ""
8955 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8956 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8957 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8958 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8959 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8960 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8961 "できる。"
8962
8963 #. type: Plain text
8964 #: build/C/man7/socket.7:259
8965 msgid ""
8966 "To allow any type of socket address to be passed to interfaces in the "
8967 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8968 "type is purely to allow casting of domain-specific socket address types to a "
8969 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8970 "calls to the sockets API."
8971 msgstr ""
8972 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8973 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8974 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8975 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8976 "告を出すのを避けることができる。"
8977
8978 #. type: Plain text
8979 #: build/C/man7/socket.7:269
8980 msgid ""
8981 "In addition, the sockets API provides the data type I<struct "
8982 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8983 "domain-specific socket address structures; it is large enough and is aligned "
8984 "properly.  (In particular, it is large enough to hold IPv6 socket "
8985 "addresses.)  The structure includes the following field, which can be used "
8986 "to identify the type of socket address actually stored in the structure:"
8987 msgstr ""
8988 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8989 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8990 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8991 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8992 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8993 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8994 "できる。"
8995
8996 #. type: Plain text
8997 #: build/C/man7/socket.7:273
8998 #, no-wrap
8999 msgid "    sa_family_t ss_family;\n"
9000 msgstr "    sa_family_t ss_family;\n"
9001
9002 #. type: Plain text
9003 #: build/C/man7/socket.7:281
9004 msgid ""
9005 "The I<sockaddr_storage> structure is useful in programs that must handle "
9006 "socket addresses in a generic way (e.g., programs that must deal with both "
9007 "IPv4 and IPv6 socket addresses)."
9008 msgstr ""
9009 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
9010 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
9011 "ログラム) で有用である。"
9012
9013 #. type: SS
9014 #: build/C/man7/socket.7:281
9015 #, no-wrap
9016 msgid "Socket options"
9017 msgstr "ソケットオプション"
9018
9019 #.  FIXME .
9020 #.  In the list below, the text used to describe argument types
9021 #.  for each socket option should be more consistent
9022 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
9023 #.  W R Stevens, UNPv1
9024 #. type: Plain text
9025 #: build/C/man7/socket.7:299
9026 msgid ""
9027 "The socket options listed below can be set by using B<setsockopt>(2)  and "
9028 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
9029 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
9030 msgstr ""
9031 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
9032 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
9033 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
9034 "I<int> へのポインタである。"
9035
9036 #. type: TP
9037 #: build/C/man7/socket.7:299
9038 #, no-wrap
9039 msgid "B<SO_ACCEPTCONN>"
9040 msgstr "B<SO_ACCEPTCONN>"
9041
9042 #. type: Plain text
9043 #: build/C/man7/socket.7:307
9044 msgid ""
9045 "Returns a value indicating whether or not this socket has been marked to "
9046 "accept connections with B<listen>(2).  The value 0 indicates that this is "
9047 "not a listening socket, the value 1 indicates that this is a listening "
9048 "socket.  This socket option is read-only."
9049 msgstr ""
9050 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
9051 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9052 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9053
9054 #. type: TP
9055 #: build/C/man7/socket.7:307
9056 #, no-wrap
9057 msgid "B<SO_BINDTODEVICE>"
9058 msgstr "B<SO_BINDTODEVICE>"
9059
9060 #. type: Plain text
9061 #: build/C/man7/socket.7:326
9062 msgid ""
9063 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9064 "the passed interface name.  If the name is an empty string or the option "
9065 "length is zero, the socket device binding is removed.  The passed option is "
9066 "a variable-length null-terminated interface name string with the maximum "
9067 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
9068 "received from that particular interface are processed by the socket.  Note "
9069 "that this works only for some socket types, particularly B<AF_INET> "
9070 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
9071 "there)."
9072 msgstr ""
9073 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9074 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9075 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9076 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9077 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9078 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9079 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9080 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9081 "B<bind>(2) を使うこと)。"
9082
9083 #. type: Plain text
9084 #: build/C/man7/socket.7:340
9085 msgid ""
9086 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9087 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
9088 "argument should contain the buffer size available to receive the device name "
9089 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
9090 "reported back in the I<optlen> argument."
9091 msgstr ""
9092 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9093 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9094 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9095 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
9096 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9097
9098 #. type: TP
9099 #: build/C/man7/socket.7:340
9100 #, no-wrap
9101 msgid "B<SO_BROADCAST>"
9102 msgstr "B<SO_BROADCAST>"
9103
9104 #. type: Plain text
9105 #: build/C/man7/socket.7:346
9106 msgid ""
9107 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
9108 "to send packets to a broadcast address.  This option has no effect on stream-"
9109 "oriented sockets."
9110 msgstr ""
9111 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9112 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9113 "ストリーム指向のソケットには何の効果もない。"
9114
9115 #. type: TP
9116 #: build/C/man7/socket.7:346
9117 #, no-wrap
9118 msgid "B<SO_BSDCOMPAT>"
9119 msgstr "B<SO_BSDCOMPAT>"
9120
9121 #. type: Plain text
9122 #: build/C/man7/socket.7:358
9123 msgid ""
9124 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
9125 "module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP "
9126 "socket will not be passed to the user program.  In later kernel versions, "
9127 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9128 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9129 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9130 "header changing, skipping of the broadcast flag) for raw sockets with this "
9131 "option, but that was removed in Linux 2.2."
9132 msgstr ""
9133 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9134 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9135 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
9136 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
9137 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
9138 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
9139 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
9140 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
9141 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
9142
9143 #. type: TP
9144 #: build/C/man7/socket.7:358
9145 #, no-wrap
9146 msgid "B<SO_DEBUG>"
9147 msgstr "B<SO_DEBUG>"
9148
9149 #. type: Plain text
9150 #: build/C/man7/socket.7:364
9151 msgid ""
9152 "Enable socket debugging.  Only allowed for processes with the "
9153 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9154 msgstr ""
9155 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9156 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9157
9158 #. type: TP
9159 #: build/C/man7/socket.7:364
9160 #, no-wrap
9161 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9162 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9163
9164 #. type: Plain text
9165 #: build/C/man7/socket.7:372
9166 msgid ""
9167 "Retrieves the socket domain as an integer, returning a value such as "
9168 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9169 "only."
9170 msgstr ""
9171 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9172 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9173
9174 #. type: TP
9175 #: build/C/man7/socket.7:372
9176 #, no-wrap
9177 msgid "B<SO_ERROR>"
9178 msgstr "B<SO_ERROR>"
9179
9180 #. type: Plain text
9181 #: build/C/man7/socket.7:377
9182 msgid ""
9183 "Get and clear the pending socket error.  This socket option is read-only.  "
9184 "Expects an integer."
9185 msgstr ""
9186 "保留になっていたソケットエラーを取得してクリアする。\n"
9187 "このソケットオプションは読み込み専用である。整数値をとる。"
9188
9189 #. type: TP
9190 #: build/C/man7/socket.7:377
9191 #, no-wrap
9192 msgid "B<SO_DONTROUTE>"
9193 msgstr "B<SO_DONTROUTE>"
9194
9195 #. type: Plain text
9196 #: build/C/man7/socket.7:386
9197 msgid ""
9198 "Don't send via a gateway, send only to directly connected hosts.  The same "
9199 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9200 "B<send>(2)  operation.  Expects an integer boolean flag."
9201 msgstr ""
9202 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9203 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9204 "数のフラグを取る。"
9205
9206 #. type: TP
9207 #: build/C/man7/socket.7:386
9208 #, no-wrap
9209 msgid "B<SO_KEEPALIVE>"
9210 msgstr "B<SO_KEEPALIVE>"
9211
9212 #. type: Plain text
9213 #: build/C/man7/socket.7:390
9214 msgid ""
9215 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9216 "Expects an integer boolean flag."
9217 msgstr ""
9218 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9219 "の整数フラグをとる。"
9220
9221 #. type: TP
9222 #: build/C/man7/socket.7:390
9223 #, no-wrap
9224 msgid "B<SO_LINGER>"
9225 msgstr "B<SO_LINGER>"
9226
9227 #. type: Plain text
9228 #: build/C/man7/socket.7:398
9229 msgid ""
9230 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9231 msgstr ""
9232 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9233
9234 #. type: Plain text
9235 #: build/C/man7/socket.7:405
9236 #, no-wrap
9237 msgid ""
9238 "struct linger {\n"
9239 "    int l_onoff;    /* linger active */\n"
9240 "    int l_linger;   /* how many seconds to linger for */\n"
9241 "};\n"
9242 msgstr ""
9243 "struct linger {\n"
9244 "    int l_onoff;    /* linger active */\n"
9245 "    int l_linger;   /* how many seconds to linger for */\n"
9246 "};\n"
9247
9248 #. type: Plain text
9249 #: build/C/man7/socket.7:419
9250 msgid ""
9251 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9252 "queued messages for the socket have been successfully sent or the linger "
9253 "timeout has been reached.  Otherwise, the call returns immediately and the "
9254 "closing is done in the background.  When the socket is closed as part of "
9255 "B<exit>(2), it always lingers in the background."
9256 msgstr ""
9257 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9258 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9259 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9260 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9261 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9262 "送られる。"
9263
9264 #. type: TP
9265 #: build/C/man7/socket.7:419
9266 #, no-wrap
9267 msgid "B<SO_MARK> (since Linux 2.6.25)"
9268 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9269
9270 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9271 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9272 #. type: Plain text
9273 #: build/C/man7/socket.7:430
9274 msgid ""
9275 "Set the mark for each packet sent through this socket (similar to the "
9276 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9277 "mark-based routing without netfilter or for packet filtering.  Setting this "
9278 "option requires the B<CAP_NET_ADMIN> capability."
9279 msgstr ""
9280 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9281 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9282 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9283 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9284 "ティが必要である。"
9285
9286 #. type: TP
9287 #: build/C/man7/socket.7:430
9288 #, no-wrap
9289 msgid "B<SO_OOBINLINE>"
9290 msgstr "B<SO_OOBINLINE>"
9291
9292 #.  don't document it because it can do too much harm.
9293 #. .B SO_NO_CHECK
9294 #. type: Plain text
9295 #: build/C/man7/socket.7:439
9296 msgid ""
9297 "If this option is enabled, out-of-band data is directly placed into the "
9298 "receive data stream.  Otherwise, out-of-band data is passed only when the "
9299 "B<MSG_OOB> flag is set during receiving."
9300 msgstr ""
9301 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9302 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9303 "ラグがセットされている場合に限って渡される。"
9304
9305 #. type: TP
9306 #: build/C/man7/socket.7:439
9307 #, no-wrap
9308 msgid "B<SO_PASSCRED>"
9309 msgstr "B<SO_PASSCRED>"
9310
9311 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9312 #.  in the 2.6.18 ChangeLog
9313 #. type: Plain text
9314 #: build/C/man7/socket.7:448
9315 msgid ""
9316 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9317 "For more information see B<unix>(7)."
9318 msgstr ""
9319 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9320 "を参照のこと。"
9321
9322 #. type: TP
9323 #: build/C/man7/socket.7:448
9324 #, no-wrap
9325 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9326 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9327
9328 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9329 #. type: Plain text
9330 #: build/C/man7/socket.7:458
9331 msgid ""
9332 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9333 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9334 "with B<MSG_PEEK> flag."
9335 msgstr ""
9336 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9337 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9338 "B<unix>(7) ソケットでのみサポートされている。"
9339
9340 #. type: Plain text
9341 #: build/C/man7/socket.7:466
9342 msgid ""
9343 "When this option is set to a negative value (it is set to -1 for all new "
9344 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9345 "flag will peek data from the front of the queue."
9346 msgstr ""
9347 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9348 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9349 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9350 "のソケットではこのオプションの値は必ず -1 に設定される。"
9351
9352 #. type: Plain text
9353 #: build/C/man7/socket.7:473
9354 msgid ""
9355 "When the option is set to a value greater than or equal to zero, then the "
9356 "next peek at data queued in the socket will occur at the byte offset "
9357 "specified by the option value.  At the same time, the \"peek offset\" will "
9358 "be incremented by the number of bytes that were peeked from the queue, so "
9359 "that a subsequent peek will return the next data in the queue."
9360 msgstr ""
9361 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9362 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9363 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9364 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9365
9366 #. type: Plain text
9367 #: build/C/man7/socket.7:485
9368 msgid ""
9369 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9370 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9371 "by the number of bytes removed.  In other words, receiving data without the "
9372 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9373 "the correct relative position in the queued data, so that a subsequent peek "
9374 "will retrieve the data that would have been retrieved had the data not been "
9375 "removed."
9376 msgstr ""
9377 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9378 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9379 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9380 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9381 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9382 "いうことである。"
9383
9384 #. type: Plain text
9385 #: build/C/man7/socket.7:490
9386 msgid ""
9387 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9388 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9389 msgstr ""
9390 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9391 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9392
9393 #. type: Plain text
9394 #: build/C/man7/socket.7:494
9395 msgid ""
9396 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9397 "Suppose a stream socket has the following queued input data:"
9398 msgstr ""
9399 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9400 "以下の入力データが入っているものとする。"
9401
9402 #. type: Plain text
9403 #: build/C/man7/socket.7:496
9404 #, no-wrap
9405 msgid "    aabbccddeeff\n"
9406 msgstr "    aabbccddeeff\n"
9407
9408 #. type: Plain text
9409 #: build/C/man7/socket.7:501
9410 msgid ""
9411 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9412 "the comments:"
9413 msgstr ""
9414 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9415
9416 #. type: Plain text
9417 #: build/C/man7/socket.7:506
9418 #, no-wrap
9419 msgid ""
9420 "int ov = 4;                  // Set peek offset to 4\n"
9421 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9422 msgstr ""
9423 "int ov = 4;                  // Set peek offset to 4\n"
9424 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9425
9426 #. type: Plain text
9427 #: build/C/man7/socket.7:511
9428 #, no-wrap
9429 msgid ""
9430 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9431 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9432 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9433 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9434 msgstr ""
9435 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9436 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9437 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9438 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9439
9440 #. type: TP
9441 #: build/C/man7/socket.7:513
9442 #, no-wrap
9443 msgid "B<SO_PEERCRED>"
9444 msgstr "B<SO_PEERCRED>"
9445
9446 #. type: Plain text
9447 #: build/C/man7/socket.7:536
9448 msgid ""
9449 "Return the credentials of the foreign process connected to this socket.  "
9450 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9451 "stream and datagram socket pairs created using B<socketpair>(2); see "
9452 "B<unix>(7).  The returned credentials are those that were in effect at the "
9453 "time of the call to B<connect>(2)  or B<socketpair>(2).  The argument is a "
9454 "I<ucred> structure; define the B<_GNU_SOURCE> feature test macro to obtain "
9455 "the definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This "
9456 "socket option is read-only."
9457 msgstr ""
9458 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9459 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9460 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9461 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9462 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9463 "る。 引き数は I<ucred> 構造体である。この構造体の定義を I<E<lt>sys/socket."
9464 "hE<gt>> を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義すること。 このソ"
9465 "ケットオプションは読み込み専用である。"
9466
9467 #. type: TP
9468 #: build/C/man7/socket.7:536
9469 #, no-wrap
9470 msgid "B<SO_PRIORITY>"
9471 msgstr "B<SO_PRIORITY>"
9472
9473 #. type: Plain text
9474 #: build/C/man7/socket.7:549
9475 msgid ""
9476 "Set the protocol-defined priority for all packets to be sent on this "
9477 "socket.  Linux uses this value to order the networking queues: packets with "
9478 "a higher priority may be processed first depending on the selected device "
9479 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9480 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9481 "6 requires the B<CAP_NET_ADMIN> capability."
9482 msgstr ""
9483 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9484 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9485 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9486 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9487 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9488 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9489
9490 #. type: TP
9491 #: build/C/man7/socket.7:549
9492 #, no-wrap
9493 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9494 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9495
9496 #. type: Plain text
9497 #: build/C/man7/socket.7:557
9498 msgid ""
9499 "Retrieves the socket protocol as an integer, returning a value such as "
9500 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9501 "only."
9502 msgstr ""
9503 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9504 "る。\n"
9505 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9506
9507 #. type: TP
9508 #: build/C/man7/socket.7:557
9509 #, no-wrap
9510 msgid "B<SO_RCVBUF>"
9511 msgstr "B<SO_RCVBUF>"
9512
9513 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9514 #.  The following thread on LMKL is quite informative:
9515 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behavior
9516 #.  17 July 2012
9517 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9518 #. type: Plain text
9519 #: build/C/man7/socket.7:576
9520 msgid ""
9521 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9522 "this value (to allow space for bookkeeping overhead)  when it is set using "
9523 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9524 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9525 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9526 "file.  The minimum (doubled) value for this option is 256."
9527 msgstr ""
9528 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9529 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9530 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9531 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9532 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9533 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9534
9535 #. type: TP
9536 #: build/C/man7/socket.7:576
9537 #, no-wrap
9538 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9539 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9540
9541 #. type: Plain text
9542 #: build/C/man7/socket.7:585
9543 msgid ""
9544 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9545 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9546 "overridden."
9547 msgstr ""
9548 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9549 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9550 "きすることができる。"
9551
9552 #. type: TP
9553 #: build/C/man7/socket.7:585
9554 #, no-wrap
9555 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9556 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9557
9558 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9559 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9560 #. type: Plain text
9561 #: build/C/man7/socket.7:614
9562 msgid ""
9563 "Specify the minimum number of bytes in the buffer until the socket layer "
9564 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9565 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9566 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9567 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9568 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9569 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9570 "single byte of data is available.  A subsequent read from the socket will "
9571 "block until B<SO_RCVLOWAT> bytes are available."
9572 msgstr ""
9573 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9574 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9575 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9576 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9577 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9578 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9579 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9580 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9581 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9582 "してしまう。"
9583
9584 #. type: TP
9585 #: build/C/man7/socket.7:614
9586 #, no-wrap
9587 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9588 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9589
9590 #.  Not implemented in 2.0.
9591 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9592 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9593 #.  in fact to EAGAIN
9594 #. type: Plain text
9595 #: build/C/man7/socket.7:649
9596 msgid ""
9597 "Specify the receiving or sending timeouts until reporting an error.  The "
9598 "argument is a I<struct timeval>.  If an input or output function blocks for "
9599 "this period of time, and data has been sent or received, the return value of "
9600 "that function will be the amount of data transferred; if no data has been "
9601 "transferred and the timeout has been reached, then -1 is returned with "
9602 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9603 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9604 "the timeout is set to zero (the default), then the operation will never "
9605 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9606 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9607 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9608 msgstr ""
9609 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9610 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9611 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9612 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9613 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> "
9614 "(B<connect>(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定さ"
9615 "れたように見える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操"
9616 "作は決してタイムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット "
9617 "I/O を実行するシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), "
9618 "B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), "
9619 "B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
9620
9621 #. type: TP
9622 #: build/C/man7/socket.7:649
9623 #, no-wrap
9624 msgid "B<SO_REUSEADDR>"
9625 msgstr "B<SO_REUSEADDR>"
9626
9627 #. type: Plain text
9628 #: build/C/man7/socket.7:664
9629 msgid ""
9630 "Indicates that the rules used in validating addresses supplied in a "
9631 "B<bind>(2)  call should allow reuse of local addresses.  For B<AF_INET> "
9632 "sockets this means that a socket may bind, except when there is an active "
9633 "listening socket bound to the address.  When the listening socket is bound "
9634 "to B<INADDR_ANY> with a specific port then it is not possible to bind to "
9635 "this port for any local address.  Argument is an integer boolean flag."
9636 msgstr ""
9637 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9638 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9639 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9640 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9641 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9642 "ドできない。 引き数はブール整数のフラグである。"
9643
9644 #. type: TP
9645 #: build/C/man7/socket.7:664
9646 #, no-wrap
9647 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9648 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9649
9650 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9651 #. type: Plain text
9652 #: build/C/man7/socket.7:671
9653 msgid ""
9654 "Indicates that an unsigned 32-bit value ancillary message (cmsg)  should be "
9655 "attached to received skbs indicating the number of packets dropped by the "
9656 "socket between the last received packet and this received packet."
9657 msgstr ""
9658 "最後の受信パケットとこの受信パケットの間にそのソケットで捨てられた (ドロップ"
9659 "された) パケット数を示す、unsigned 32 ビット値の補助メッセージ (cmsg) を受信"
9660 "した skb に付与することを指示する。"
9661
9662 #. type: TP
9663 #: build/C/man7/socket.7:671
9664 #, no-wrap
9665 msgid "B<SO_SNDBUF>"
9666 msgstr "B<SO_SNDBUF>"
9667
9668 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9669 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9670 #. type: Plain text
9671 #: build/C/man7/socket.7:687
9672 msgid ""
9673 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9674 "this value (to allow space for bookkeeping overhead)  when it is set using "
9675 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9676 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9677 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9678 "file.  The minimum (doubled) value for this option is 2048."
9679 msgstr ""
9680 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9681 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9682 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9683 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9684 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9685 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9686
9687 #. type: TP
9688 #: build/C/man7/socket.7:687
9689 #, no-wrap
9690 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9691 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9692
9693 #. type: Plain text
9694 #: build/C/man7/socket.7:696
9695 msgid ""
9696 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9697 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9698 "overridden."
9699 msgstr ""
9700 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9701 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9702 "きすることができる。"
9703
9704 #. type: TP
9705 #: build/C/man7/socket.7:696
9706 #, no-wrap
9707 msgid "B<SO_TIMESTAMP>"
9708 msgstr "B<SO_TIMESTAMP>"
9709
9710 #. type: Plain text
9711 #: build/C/man7/socket.7:712
9712 msgid ""
9713 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9714 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9715 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9716 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9717 "details on control messages."
9718 msgstr ""
9719 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9720 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9721 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9722 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9723
9724 #. type: TP
9725 #: build/C/man7/socket.7:712
9726 #, no-wrap
9727 msgid "B<SO_TYPE>"
9728 msgstr "B<SO_TYPE>"
9729
9730 #. type: Plain text
9731 #: build/C/man7/socket.7:717
9732 msgid ""
9733 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9734 "option is read-only."
9735 msgstr ""
9736 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9737 "このソケットオプションは読み出し専用である。"
9738
9739 #. type: TP
9740 #: build/C/man7/socket.7:717
9741 #, no-wrap
9742 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9743 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9744
9745 #. type: Plain text
9746 #: build/C/man7/socket.7:726
9747 msgid ""
9748 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9749 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9750 "The default for this option is controlled by the I</proc/sys/net/core/"
9751 "busy_read> file."
9752 msgstr ""
9753 "データがなかった際にブロッキング受信での busy polling のおおよその時間をマイ"
9754 "クロ秒単位で設定する。 この値を増やすには B<CAP_NET_ADMIN> ケーパビリティが必"
9755 "要である。 このオプションのデフォルト値は I</proc/sys/net/core/busy_read> で"
9756 "制御できる。"
9757
9758 #. type: Plain text
9759 #: build/C/man7/socket.7:736
9760 msgid ""
9761 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9762 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9763 "with B<SO_BUSY_POLL> set and no events to report are found."
9764 msgstr ""
9765 "I</proc/sys/net/core/busy_poll> の値により、 B<SO_BUSY_POLL> がセットされたソ"
9766 "ケットに対して B<select>(2) や B<poll>(2) を行い、報告すべきイベントがない場"
9767 "合に、 B<select>(2) や B<poll>(2) が busy polling をどのくらいの時間行うかが"
9768 "決まる。"
9769
9770 #. type: Plain text
9771 #: build/C/man7/socket.7:740
9772 msgid ""
9773 "In both cases, busy polling will only be done when the socket last received "
9774 "data from a network device that supports this option."
9775 msgstr ""
9776 "どちらの場合も、busy polling は、そのソケットが最後にデータを受信したネット"
9777 "ワークデバイスがこのオプションに対応している場合のみ行われる。"
9778
9779 #. type: Plain text
9780 #: build/C/man7/socket.7:744
9781 msgid ""
9782 "While busy polling may improve latency of some applications, care must be "
9783 "taken when using it since this will increase both CPU utilization and power "
9784 "usage."
9785 msgstr ""
9786 "busy polling により遅延が改善されるはアプリケーションもあるが、 busy polling "
9787 "は CPU 使用率と電力使用量をともに増加させることになるので、使用する際は注意し"
9788 "て行うこと。"
9789
9790 #. type: SS
9791 #: build/C/man7/socket.7:744
9792 #, no-wrap
9793 msgid "Signals"
9794 msgstr "シグナル"
9795
9796 #. type: Plain text
9797 #: build/C/man7/socket.7:755
9798 msgid ""
9799 "When writing onto a connection-oriented socket that has been shut down (by "
9800 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9801 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9802 "the B<MSG_NOSIGNAL> flag."
9803 msgstr ""
9804 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9805 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9806 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9807 "していた場合はシグナルは送られない。"
9808
9809 #. type: Plain text
9810 #: build/C/man7/socket.7:780
9811 msgid ""
9812 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> "
9813 "B<ioctl>(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to "
9814 "use B<poll>(2)  or B<select>(2)  in the signal handler to find out which "
9815 "socket the event occurred on.  An alternative (in Linux 2.2) is to set a "
9816 "real-time signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real "
9817 "time signal will be called with the file descriptor in the I<si_fd> field of "
9818 "its I<siginfo_t>.  See B<fcntl>(2)  for more information."
9819 msgstr ""
9820 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9821 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9822 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9823 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9824 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9825 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9826 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9827 "を参照のこと。"
9828
9829 #.  .SS Ancillary messages
9830 #. type: Plain text
9831 #: build/C/man7/socket.7:788
9832 msgid ""
9833 "Under some circumstances (e.g., multiple processes accessing a single "
9834 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9835 "when the process reacts to the signal.  If this happens, the process should "
9836 "wait again because Linux will resend the signal later."
9837 msgstr ""
9838 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9839 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9840 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9841 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9842
9843 #. type: SS
9844 #: build/C/man7/socket.7:788
9845 #, no-wrap
9846 msgid "/proc interfaces"
9847 msgstr "/proc インタフェース"
9848
9849 #. type: Plain text
9850 #: build/C/man7/socket.7:792
9851 msgid ""
9852 "The core socket networking parameters can be accessed via files in the "
9853 "directory I</proc/sys/net/core/>."
9854 msgstr ""
9855 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9856 "レクトリ内のファイルを通してアクセスできる。"
9857
9858 #. type: TP
9859 #: build/C/man7/socket.7:792
9860 #, no-wrap
9861 msgid "I<rmem_default>"
9862 msgstr "I<rmem_default>"
9863
9864 #. type: Plain text
9865 #: build/C/man7/socket.7:795
9866 msgid "contains the default setting in bytes of the socket receive buffer."
9867 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9868
9869 #. type: TP
9870 #: build/C/man7/socket.7:795
9871 #, no-wrap
9872 msgid "I<rmem_max>"
9873 msgstr "I<rmem_max>"
9874
9875 #. type: Plain text
9876 #: build/C/man7/socket.7:801
9877 msgid ""
9878 "contains the maximum socket receive buffer size in bytes which a user may "
9879 "set by using the B<SO_RCVBUF> socket option."
9880 msgstr ""
9881 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9882 "ファサイズの最大値 (バイト単位)。"
9883
9884 #. type: TP
9885 #: build/C/man7/socket.7:801
9886 #, no-wrap
9887 msgid "I<wmem_default>"
9888 msgstr "I<wmem_default>"
9889
9890 #. type: Plain text
9891 #: build/C/man7/socket.7:804
9892 msgid "contains the default setting in bytes of the socket send buffer."
9893 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9894
9895 #. type: TP
9896 #: build/C/man7/socket.7:804
9897 #, no-wrap
9898 msgid "I<wmem_max>"
9899 msgstr "I<wmem_max>"
9900
9901 #. type: Plain text
9902 #: build/C/man7/socket.7:810
9903 msgid ""
9904 "contains the maximum socket send buffer size in bytes which a user may set "
9905 "by using the B<SO_SNDBUF> socket option."
9906 msgstr ""
9907 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9908 "ファサイズの最大値 (バイト単位)。"
9909
9910 #. type: TP
9911 #: build/C/man7/socket.7:810
9912 #, no-wrap
9913 msgid "I<message_cost> and I<message_burst>"
9914 msgstr "I<message_cost> と I<message_burst>"
9915
9916 #. type: Plain text
9917 #: build/C/man7/socket.7:814
9918 msgid ""
9919 "configure the token bucket filter used to load limit warning messages caused "
9920 "by external network events."
9921 msgstr ""
9922 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9923 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9924
9925 #. type: TP
9926 #: build/C/man7/socket.7:814
9927 #, no-wrap
9928 msgid "I<netdev_max_backlog>"
9929 msgstr "I<netdev_max_backlog>"
9930
9931 #. type: Plain text
9932 #: build/C/man7/socket.7:817
9933 msgid "Maximum number of packets in the global input queue."
9934 msgstr "グローバルな入力キューにおける最大のパケット数。"
9935
9936 #. type: TP
9937 #: build/C/man7/socket.7:817
9938 #, no-wrap
9939 msgid "I<optmem_max>"
9940 msgstr "I<optmem_max>"
9941
9942 #.  netdev_fastroute is not documented because it is experimental
9943 #. type: Plain text
9944 #: build/C/man7/socket.7:822
9945 msgid ""
9946 "Maximum length of ancillary data and user control data like the iovecs per "
9947 "socket."
9948 msgstr ""
9949 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9950 "うなもの) との和の最大長。"
9951
9952 #. type: SS
9953 #: build/C/man7/socket.7:822
9954 #, no-wrap
9955 msgid "Ioctls"
9956 msgstr "ioctl"
9957
9958 #. type: Plain text
9959 #: build/C/man7/socket.7:825
9960 msgid "These operations can be accessed using B<ioctl>(2):"
9961 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9962
9963 #. type: Plain text
9964 #: build/C/man7/socket.7:829
9965 #, no-wrap
9966 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9967 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9968
9969 #. type: TP
9970 #: build/C/man7/socket.7:831
9971 #, no-wrap
9972 msgid "B<SIOCGSTAMP>"
9973 msgstr "B<SIOCGSTAMP>"
9974
9975 #. type: Plain text
9976 #: build/C/man7/socket.7:855
9977 msgid ""
9978 "Return a I<struct timeval> with the receive timestamp of the last packet "
9979 "passed to the user.  This is useful for accurate round trip time "
9980 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9981 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9982 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9983 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9984 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9985 "to B<ENOENT>)."
9986 msgstr ""
9987 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9988 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9989 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9990 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9991 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9992 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9993 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9994 "セットする)。"
9995
9996 #. type: TP
9997 #: build/C/man7/socket.7:855
9998 #, no-wrap
9999 msgid "B<SIOCSPGRP>"
10000 msgstr "B<SIOCSPGRP>"
10001
10002 #. type: Plain text
10003 #: build/C/man7/socket.7:874
10004 msgid ""
10005 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
10006 "when an asynchronous I/O operation has finished or urgent data is "
10007 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
10008 "positive, send the signals to that process.  If the argument is negative, "
10009 "send the signals to the process group with the ID of the absolute value of "
10010 "the argument.  The process may only choose itself or its own process group "
10011 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
10012 "UID of 0."
10013 msgstr ""
10014 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
10015 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
10016 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
10017 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
10018 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
10019 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
10020 "の場合は この限りではない。"
10021
10022 #. type: TP
10023 #: build/C/man7/socket.7:874
10024 #, no-wrap
10025 msgid "B<FIOASYNC>"
10026 msgstr "B<FIOASYNC>"
10027
10028 #. type: Plain text
10029 #: build/C/man7/socket.7:884
10030 msgid ""
10031 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
10032 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
10033 "set with B<F_SETSIG> is raised when a new I/O event occurs."
10034 msgstr ""
10035 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
10036 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
10037 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
10038
10039 #. type: Plain text
10040 #: build/C/man7/socket.7:892
10041 msgid ""
10042 "Argument is an integer boolean flag.  (This operation is synonymous with the "
10043 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
10044 msgstr ""
10045 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
10046 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10047
10048 #. type: TP
10049 #: build/C/man7/socket.7:892
10050 #, no-wrap
10051 msgid "B<SIOCGPGRP>"
10052 msgstr "B<SIOCGPGRP>"
10053
10054 #. type: Plain text
10055 #: build/C/man7/socket.7:901
10056 msgid ""
10057 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10058 "signals, or 0 when none is set."
10059 msgstr ""
10060 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
10061 "る。 ない場合は 0 が返る。"
10062
10063 #. type: Plain text
10064 #: build/C/man7/socket.7:905
10065 msgid "Valid B<fcntl>(2)  operations:"
10066 msgstr "有効な B<fcntl>(2)  操作:"
10067
10068 #. type: TP
10069 #: build/C/man7/socket.7:905
10070 #, no-wrap
10071 msgid "B<FIOGETOWN>"
10072 msgstr "B<FIOGETOWN>"
10073
10074 #. type: Plain text
10075 #: build/C/man7/socket.7:910
10076 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10077 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
10078
10079 #. type: TP
10080 #: build/C/man7/socket.7:910
10081 #, no-wrap
10082 msgid "B<FIOSETOWN>"
10083 msgstr "B<FIOSETOWN>"
10084
10085 #. type: Plain text
10086 #: build/C/man7/socket.7:915
10087 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10088 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
10089
10090 #. type: Plain text
10091 #: build/C/man7/socket.7:929
10092 msgid ""
10093 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
10094 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
10095 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
10096 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10097 "be read or written."
10098 msgstr ""
10099 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10100 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
10101 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10102 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10103 "はできなかった。"
10104
10105 #. type: Plain text
10106 #: build/C/man7/socket.7:934
10107 msgid ""
10108 "Linux assumes that half of the send/receive buffer is used for internal "
10109 "kernel structures; thus the values in the corresponding I</proc> files are "
10110 "twice what can be observed on the wire."
10111 msgstr ""
10112 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
10113 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
10114 "なる。"
10115
10116 #. type: Plain text
10117 #: build/C/man7/socket.7:947
10118 msgid ""
10119 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
10120 "option was set both in the previous program that performed a B<bind>(2)  to "
10121 "the port and in the program that wants to reuse the port.  This differs from "
10122 "some implementations (e.g., FreeBSD)  where only the later program needs to "
10123 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
10124 "since, for example, a server program is designed to always set this option."
10125 msgstr ""
10126 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10127 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
10128 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10129 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10130 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10131 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10132 "このオプションをセットするように設計されるからである。"
10133
10134 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10135 #.  .SH AUTHORS
10136 #.  This man page was written by Andi Kleen.
10137 #. type: Plain text
10138 #: build/C/man7/socket.7:960
10139 msgid ""
10140 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10141 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
10142 "is via the libpcap library."
10143 msgstr ""
10144 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10145 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10146 "して 用いる方が良い。"
10147
10148 #. type: Plain text
10149 #: build/C/man7/socket.7:972
10150 msgid ""
10151 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10152 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10153 "B<unix>(7)"
10154 msgstr ""
10155 "B<connect>(2), B<getsockopt>(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>(7), "
10157 "B<unix>(7)"
10158
10159 #. type: TH
10160 #: build/C/man2/socketcall.2:25
10161 #, no-wrap
10162 msgid "SOCKETCALL"
10163 msgstr "SOCKETCALL"
10164
10165 #. type: TH
10166 #: build/C/man2/socketcall.2:25
10167 #, no-wrap
10168 msgid "2012-10-16"
10169 msgstr "2012-10-16"
10170
10171 #. type: Plain text
10172 #: build/C/man2/socketcall.2:28
10173 msgid "socketcall - socket system calls"
10174 msgstr "socketcall - ソケット・システムコール"
10175
10176 #. type: Plain text
10177 #: build/C/man2/socketcall.2:30
10178 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10179 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10180
10181 #. type: Plain text
10182 #: build/C/man2/socketcall.2:38
10183 msgid ""
10184 "B<socketcall>()  is a common kernel entry point for the socket system "
10185 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10186 "to a block containing the actual arguments, which are passed through to the "
10187 "appropriate call."
10188 msgstr ""
10189 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
10190 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10191 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10192 "ロックを指す。"
10193
10194 #. type: Plain text
10195 #: build/C/man2/socketcall.2:42
10196 msgid ""
10197 "User programs should call the appropriate functions by their usual names.  "
10198 "Only standard library implementors and kernel hackers need to know about "
10199 "B<socketcall>()."
10200 msgstr ""
10201 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10202 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
10203 "必要がある。"
10204
10205 #. type: Plain text
10206 #: build/C/man2/socketcall.2:45
10207 msgid ""
10208 "This call is specific to Linux, and should not be used in programs intended "
10209 "to be portable."
10210 msgstr ""
10211 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10212 "い。"
10213
10214 #. type: Plain text
10215 #: build/C/man2/socketcall.2:53
10216 msgid ""
10217 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10218 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), "
10219 "B<bind>(2), and so on really are implemented as separate system calls."
10220 msgstr ""
10221 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10222 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10223 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10224
10225 #. type: Plain text
10226 #: build/C/man2/socketcall.2:71
10227 msgid ""
10228 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10229 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10230 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10231 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10232 msgstr ""
10233 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10234 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10235 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10236 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10237
10238 #. type: TH
10239 #: build/C/man2/socketpair.2:42
10240 #, no-wrap
10241 msgid "SOCKETPAIR"
10242 msgstr "SOCKETPAIR"
10243
10244 #. type: TH
10245 #: build/C/man2/socketpair.2:42
10246 #, no-wrap
10247 msgid "2008-10-11"
10248 msgstr "2008-10-11"
10249
10250 #. type: Plain text
10251 #: build/C/man2/socketpair.2:45
10252 msgid "socketpair - create a pair of connected sockets"
10253 msgstr "socketpair - 接続されたソケットのペアを作成する"
10254
10255 #. type: Plain text
10256 #: build/C/man2/socketpair.2:52
10257 msgid ""
10258 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10259 ">I<sv>B<[2]);>"
10260 msgstr ""
10261 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10262 ">I<sv>B<[2]);>"
10263
10264 #. type: Plain text
10265 #: build/C/man2/socketpair.2:63
10266 msgid ""
10267 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10268 "the specified I<domain>, of the specified I<type>, and using the optionally "
10269 "specified I<protocol>.  For further details of these arguments, see "
10270 "B<socket>(2)."
10271 msgstr ""
10272 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10273 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10274 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10275
10276 #. type: Plain text
10277 #: build/C/man2/socketpair.2:69
10278 msgid ""
10279 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10280 "and I<sv>[1].  The two sockets are indistinguishable."
10281 msgstr ""
10282 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10283 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10284
10285 #. type: Plain text
10286 #: build/C/man2/socketpair.2:78
10287 msgid "The specified address family is not supported on this machine."
10288 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10289
10290 #. type: Plain text
10291 #: build/C/man2/socketpair.2:83
10292 msgid ""
10293 "The address I<sv> does not specify a valid part of the process address space."
10294 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10295
10296 #. type: Plain text
10297 #: build/C/man2/socketpair.2:86
10298 msgid "Too many descriptors are in use by this process."
10299 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10300
10301 #. type: Plain text
10302 #: build/C/man2/socketpair.2:92
10303 msgid "The specified protocol does not support creation of socket pairs."
10304 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10305
10306 #. type: Plain text
10307 #: build/C/man2/socketpair.2:95
10308 msgid "The specified protocol is not supported on this machine."
10309 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10310
10311 #. type: Plain text
10312 #: build/C/man2/socketpair.2:103
10313 msgid ""
10314 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10315 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10316 "of the BSD socket layer (including System\\ V variants)."
10317 msgstr ""
10318 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10319 "に (System\\ V の変種を含めて)  BSD のソケット層のクローンをサポートしてい"
10320 "る、BSD 以外のシステムと、 互いに移植性がある。"
10321
10322 #. type: Plain text
10323 #: build/C/man2/socketpair.2:109
10324 msgid ""
10325 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10326 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10327 "restriction.)"
10328 msgstr ""
10329 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10330 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10331
10332 #. type: Plain text
10333 #: build/C/man2/socketpair.2:118
10334 msgid ""
10335 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10336 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10337 msgstr ""
10338 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10339 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10340
10341 #. type: Plain text
10342 #: build/C/man2/socketpair.2:131
10343 msgid ""
10344 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10345 msgstr ""
10346 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10347
10348 #~ msgid ""
10349 #~ "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
10350 #~ msgstr ""
10351 #~ "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
10352
10353 #~ msgid ""
10354 #~ "The prototypes given above follow glibc2.  The Single UNIX Specification "
10355 #~ "agrees, except that it has return values of type I<ssize_t> (while 4.x "
10356 #~ "BSD and libc4 and libc5 all have I<int>).  The I<flags> argument is "
10357 #~ "I<int> in 4.x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> "
10358 #~ "argument is I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The "
10359 #~ "I<addrlen> argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The "
10360 #~ "present I<socklen_t\\ *> was invented by POSIX.  See also B<accept>(2)."
10361 #~ msgstr ""
10362 #~ "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification "
10363 #~ "でも同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や "
10364 #~ "libc4 や libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD "
10365 #~ "では I<int> だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き"
10366 #~ "数は 4.x BSD では I<int> だが、 libc4 と libc5 では I<size_t> である。 "
10367 #~ "I<addrlen> 引き数は 4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の "
10368 #~ "I<socklen_t\\ *> は POSIX で発案された。 B<accept>(2)  も参照すること。"
10369
10370 #~ msgid "2014-05-21"
10371 #~ msgstr "2014-05-21"
10372
10373 #~ msgid ""
10374 #~ "B<#define _GNU_SOURCE>\n"
10375 #~ "B<#include E<lt>sys/socket.hE<gt>>\n"
10376 #~ msgstr ""
10377 #~ "B<#define _GNU_SOURCE>\n"
10378 #~ "B<#include E<lt>sys/socket.hE<gt>>\n"
10379
10380 #~ msgid "2014-01-31"
10381 #~ msgstr "2014-01-31"
10382
10383 #~ msgid "Linux notes"
10384 #~ msgstr "Linux での注意"
10385
10386 #~ msgid ""
10387 #~ "The prototypes given above follow the Single UNIX Specification, as "
10388 #~ "glibc2 also does; the I<flags> argument was I<int> in 4.x BSD, but "
10389 #~ "I<unsigned int> in libc4 and libc5; the I<len> argument was I<int> in 4.x "
10390 #~ "BSD and libc4, but I<size_t> in libc5; the I<addrlen> argument was I<int> "
10391 #~ "in 4.x BSD and libc4 and libc5.  See also B<accept>(2)."
10392 #~ msgstr ""
10393 #~ "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同"
10394 #~ "様である。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 "
10395 #~ "では I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では "
10396 #~ "I<int> であり、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD "
10397 #~ "と libc4 と libc5 では I<int> である。 B<accept>(2)  も参照すること。"
10398
10399 #~ msgid "2012-12-16"
10400 #~ msgstr "2012-12-16"
10401
10402 #~ msgid "2014-02-21"
10403 #~ msgstr "2014-02-21"