OSDN Git Service

(split) LDP: Translate snapshot
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2013-07-15 16:08+0900\n"
10 "PO-Revision-Date: 2013-07-24 03:05+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:45 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:45
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:46
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
77
78 #. type: SH
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:48
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
89 #, no-wrap
90 msgid "SYNOPSIS"
91 msgstr "書式"
92
93 #. type: Plain text
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
95 #, no-wrap
96 msgid ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
102
103 #. type: Plain text
104 #: build/C/man2/accept.2:50
105 #, no-wrap
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
108
109 #. type: Plain text
110 #: build/C/man2/accept.2:53
111 #, no-wrap
112 msgid ""
113 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115 msgstr ""
116 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
118
119 #. type: Plain text
120 #: build/C/man2/accept.2:56
121 #, no-wrap
122 msgid ""
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
125 msgstr ""
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
128
129 #. type: SH
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:52
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "説明"
143
144 #. type: Plain text
145 #: build/C/man2/accept.2:72
146 msgid ""
147 "The B<accept>()  system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket.  The newly created socket is not in the listening "
152 "state.  The original socket I<sockfd> is unaffected by this call."
153 msgstr ""
154 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
158 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
159 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
160
161 #. type: Plain text
162 #: build/C/man2/accept.2:81
163 msgid ""
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
167 msgstr ""
168 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
170 "である。"
171
172 #. type: Plain text
173 #: build/C/man2/accept.2:99
174 msgid ""
175 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer.  The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2)  and the "
179 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
181 msgstr ""
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
183 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
184 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
185 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
186 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
187 "おくべきである。"
188
189 #. type: Plain text
190 #: build/C/man2/accept.2:107
191 msgid ""
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
195 msgstr ""
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
199
200 #. type: Plain text
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
202 msgid ""
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
205 "call."
206 msgstr ""
207 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
208 "る。\n"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
210 "される。"
211
212 #. type: Plain text
213 #: build/C/man2/accept.2:125
214 msgid ""
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
217 "present.  If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
219 "B<EWOULDBLOCK>."
220 msgstr ""
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
225
226 #. type: Plain text
227 #: build/C/man2/accept.2:139
228 msgid ""
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>()  to get a socket "
232 "for that connection.  Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
234 msgstr ""
235 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
240
241 #. type: Plain text
242 #: build/C/man2/accept.2:152
243 msgid ""
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation.  Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket.  Currently only DECNet has these "
249 "semantics on Linux."
250 msgstr ""
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
257
258 #. type: Plain text
259 #: build/C/man2/accept.2:162
260 msgid ""
261 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
263 "behavior:"
264 msgstr ""
265 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
267 "できる。"
268
269 #. type: TP
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2:164
271 #, no-wrap
272 msgid "B<SOCK_NONBLOCK>"
273 msgstr "B<SOCK_NONBLOCK>"
274
275 #. type: Plain text
276 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
277 msgid ""
278 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
279 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
280 msgstr ""
281 "新しく生成されるオープンファイル記述 (open file description) の "
282 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
283 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
284 "なる。"
285
286 #. type: TP
287 #: build/C/man2/accept.2:170 build/C/man2/socket.2:172
288 #, no-wrap
289 msgid "B<SOCK_CLOEXEC>"
290 msgstr "B<SOCK_CLOEXEC>"
291
292 #. type: Plain text
293 #: build/C/man2/accept.2:180 build/C/man2/socket.2:182
294 msgid ""
295 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
296 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
297 "may be useful."
298 msgstr ""
299 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
300 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
301 "B<O_CLOEXEC> フラグの説明を参照のこと。"
302
303 #. type: SH
304 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
305 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
306 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
307 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
308 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
309 #: build/C/man2/recv.2:388 build/C/man2/recvmmsg.2:149
310 #: build/C/man2/select.2:289 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:314
313 #: build/C/man2/socketpair.2:69
314 #, no-wrap
315 msgid "RETURN VALUE"
316 msgstr "返り値"
317
318 #. type: Plain text
319 #: build/C/man2/accept.2:187
320 msgid ""
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
323 "is set appropriately."
324 msgstr ""
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
326 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
327 "定する。"
328
329 #. type: SS
330 #: build/C/man2/accept.2:187
331 #, no-wrap
332 msgid "Error handling"
333 msgstr "エラー処理"
334
335 #. type: Plain text
336 #: build/C/man2/accept.2:214
337 msgid ""
338 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
339 "on the new socket as an error code from B<accept>().  This behavior differs "
340 "from other BSD socket implementations.  For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
345 msgstr ""
346 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
353 "B<ENETUNREACH>"
354
355 #. type: SH
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:396 build/C/man2/recvmmsg.2:157
362 #: build/C/man2/select.2:306 build/C/man2/send.2:280
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:319 build/C/man2/socketpair.2:74
365 #, no-wrap
366 msgid "ERRORS"
367 msgstr "エラー"
368
369 #. type: TP
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:401 build/C/man2/send.2:296
371 #, no-wrap
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
374
375 #.  Actually EAGAIN on Linux
376 #. type: Plain text
377 #: build/C/man2/accept.2:223
378 msgid ""
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
383 msgstr ""
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
388
389 #. type: TP
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:165
391 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
393 #: build/C/man2/recv.2:410 build/C/man2/select.2:307 build/C/man2/send.2:304
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプタが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:191
417 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:419
419 #: build/C/man2/send.2:313 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:203
432 #: build/C/man2/recv.2:423 build/C/man2/select.2:312 build/C/man2/send.2:316
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:169
448 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:428
450 #: build/C/man2/recvmmsg.2:161 build/C/man2/select.2:316
451 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:63
452 #: build/C/man2/socket.2:327 build/C/man2/socket.2:330
453 #, no-wrap
454 msgid "B<EINVAL>"
455 msgstr "B<EINVAL>"
456
457 #. type: Plain text
458 #: build/C/man2/accept.2:244
459 msgid ""
460 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
461 "negative)."
462 msgstr ""
463 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
464 "負の場合など)。"
465
466 #. type: Plain text
467 #: build/C/man2/accept.2:249
468 msgid "(B<accept4>())  invalid value in I<flags>."
469 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
470
471 #. type: TP
472 #: build/C/man2/accept.2:249 build/C/man2/socket.2:335
473 #: build/C/man2/socketpair.2:83
474 #, no-wrap
475 msgid "B<EMFILE>"
476 msgstr "B<EMFILE>"
477
478 #. type: Plain text
479 #: build/C/man2/accept.2:252
480 msgid "The per-process limit of open file descriptors has been reached."
481 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
482
483 #. type: TP
484 #: build/C/man2/accept.2:252 build/C/man2/socket.2:338
485 #: build/C/man2/socketpair.2:86
486 #, no-wrap
487 msgid "B<ENFILE>"
488 msgstr "B<ENFILE>"
489
490 #. type: Plain text
491 #: build/C/man2/accept.2:255 build/C/man2/socket.2:341
492 #: build/C/man2/socketpair.2:89
493 msgid "The system limit on the total number of open files has been reached."
494 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
495
496 #. type: TP
497 #: build/C/man2/accept.2:255
498 #, no-wrap
499 msgid "B<ENOBUFS>, B<ENOMEM>"
500 msgstr "B<ENOBUFS>, B<ENOMEM>"
501
502 #. type: Plain text
503 #: build/C/man2/accept.2:260
504 msgid ""
505 "Not enough free memory.  This often means that the memory allocation is "
506 "limited by the socket buffer limits, not by the system memory."
507 msgstr ""
508 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
509 "ケットバッファの大きさによるメモリ割り当ての制限である。"
510
511 #. type: TP
512 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
513 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
515 #: build/C/man2/recv.2:443 build/C/man2/send.2:349
516 #, no-wrap
517 msgid "B<ENOTSOCK>"
518 msgstr "B<ENOTSOCK>"
519
520 #. type: Plain text
521 #: build/C/man2/accept.2:263
522 msgid "The descriptor references a file, not a socket."
523 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
524
525 #. type: TP
526 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
527 #: build/C/man2/socketpair.2:89
528 #, no-wrap
529 msgid "B<EOPNOTSUPP>"
530 msgstr "B<EOPNOTSUPP>"
531
532 #. type: Plain text
533 #: build/C/man2/accept.2:267
534 msgid "The referenced socket is not of type B<SOCK_STREAM>."
535 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
536
537 #. type: TP
538 #: build/C/man2/accept.2:267
539 #, no-wrap
540 msgid "B<EPROTO>"
541 msgstr "B<EPROTO>"
542
543 #. type: Plain text
544 #: build/C/man2/accept.2:270
545 msgid "Protocol error."
546 msgstr "プロトコル・エラー。"
547
548 #. type: Plain text
549 #: build/C/man2/accept.2:274
550 msgid "In addition, Linux B<accept>()  may fail if:"
551 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
552
553 #. type: TP
554 #: build/C/man2/accept.2:274
555 #, no-wrap
556 msgid "B<EPERM>"
557 msgstr "B<EPERM>"
558
559 #. type: Plain text
560 #: build/C/man2/accept.2:277
561 msgid "Firewall rules forbid connection."
562 msgstr "ファイアウォールのルールにより接続が禁止された。"
563
564 #. type: Plain text
565 #: build/C/man2/accept.2:289
566 msgid ""
567 "In addition, network errors for the new socket and as defined for the "
568 "protocol may be returned.  Various Linux kernels can return other errors "
569 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
570 "value B<ERESTARTSYS> may be seen during a trace."
571 msgstr ""
572 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
573 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
574 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
575 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
576 "ともある。"
577
578 #. type: SH
579 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
580 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:165
581 #: build/C/man2/select.2:325 build/C/man2/sendmmsg.2:145
582 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:868
583 #, no-wrap
584 msgid "VERSIONS"
585 msgstr "バージョン"
586
587 #. type: Plain text
588 #: build/C/man2/accept.2:294
589 msgid ""
590 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
591 "support in glibc is available starting with version 2.10."
592 msgstr ""
593 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
594 "サポートはバージョン 2.10 以降で利用可能である。"
595
596 #. type: SH
597 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:225
599 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
600 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
601 #: build/C/man3/if_nametoindex.3:85 build/C/man2/listen.2:106
602 #: build/C/man2/recv.2:448 build/C/man2/recvmmsg.2:170
603 #: build/C/man2/select.2:331 build/C/man2/send.2:368
604 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:73
605 #: build/C/man2/socket.2:352 build/C/man2/socketcall.2:42
606 #: build/C/man2/socketpair.2:95
607 #, no-wrap
608 msgid "CONFORMING TO"
609 msgstr "準拠"
610
611 #.  The BSD man page documents five possible error returns
612 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
613 #.  POSIX.1-2001 documents errors
614 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
615 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
616 #.  In addition, SUSv2 documents EFAULT and ENOSR.
617 #. type: Plain text
618 #: build/C/man2/accept.2:306
619 msgid ""
620 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
621 "4.2BSD)."
622 msgstr ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
624 "された)."
625
626 #. type: Plain text
627 #: build/C/man2/accept.2:309
628 msgid "B<accept4>()  is a nonstandard Linux extension."
629 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
630
631 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
632 #.  do not inherit file status flags -- MTK Jun 05
633 #. type: Plain text
634 #: build/C/man2/accept.2:324
635 msgid ""
636 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
637 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
638 "socket.  This behavior differs from the canonical BSD sockets "
639 "implementation.  Portable programs should not rely on inheritance or "
640 "noninheritance of file status flags and always explicitly set all required "
641 "flags on the socket returned from B<accept>()."
642 msgstr ""
643 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
644 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
645 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
646 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
647 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
648 "である。"
649
650 #. type: SH
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:241
653 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
654 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
655 #: build/C/man2/recv.2:458 build/C/man2/select.2:346
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
657 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:75
658 #: build/C/man2/socket.2:366 build/C/man7/socket.7:882
659 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
660 #, no-wrap
661 msgid "NOTES"
662 msgstr "注意"
663
664 #. type: Plain text
665 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
666 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:137 build/C/man2/socket.2:372
668 #: build/C/man2/socketpair.2:124
669 msgid ""
670 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
671 "this header file is not required on Linux.  However, some historical (BSD) "
672 "implementations required this header file, and portable applications are "
673 "probably wise to include it."
674 msgstr ""
675 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
676 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
677 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
678 "ションではこのファイルを インクルードするのが賢明であろう。"
679
680 #. type: Plain text
681 #: build/C/man2/accept.2:351
682 msgid ""
683 "There may not always be a connection waiting after a B<SIGIO> is delivered "
684 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
685 "connection might have been removed by an asynchronous network error or "
686 "another thread before B<accept>()  is called.  If this happens then the call "
687 "will block waiting for the next connection to arrive.  To ensure that "
688 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
689 "B<O_NONBLOCK> flag set (see B<socket>(7))."
690 msgstr ""
691 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
692 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
693 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
694 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
695 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
696 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
697 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
698 "見よ)。"
699
700 #. type: SS
701 #: build/C/man2/accept.2:351
702 #, no-wrap
703 msgid "The socklen_t type"
704 msgstr "socklen_t 型"
705
706 #. type: Plain text
707 #: build/C/man2/accept.2:361
708 msgid ""
709 "The third argument of B<accept>()  was originally declared as an I<int *> "
710 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
711 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
712 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
713 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
714 "Torvalds:"
715 msgstr ""
716 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
717 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
718 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
719 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
720 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
721 "た。 Linus Torvald の発言を引用する:"
722
723 #.  .I fails: only italicizes a single line
724 #. type: Plain text
725 #: build/C/man2/accept.2:378
726 msgid ""
727 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
728 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
729 "make it a size_t, and I (and hopefully others, but obviously not too many) "
730 "complained to them very loudly indeed.  Making it a size_t is completely "
731 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
732 "bit architectures, for example.  And it I<has> to be the same size as \"int"
733 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
734 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
735 "have touched it in the first place, but once they did they felt it had to "
736 "have a named type for some unfathomable reason (probably somebody didn't "
737 "like losing face over having done the original stupid thing, so they "
738 "silently just renamed their blunder).\""
739 msgstr ""
740 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
741 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
742 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
743 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
744 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
745 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
746 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
747 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
748 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
749 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
750 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
751 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
752 "う)。」"
753
754 #. type: SH
755 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
756 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
757 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
758 #: build/C/man2/recv.2:493 build/C/man2/recvmmsg.2:173
759 #: build/C/man2/select.2:537 build/C/man2/select_tut.2:529
760 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
761 #: build/C/man3/sockatmark.3:99 build/C/man2/socket.2:385
762 #, no-wrap
763 msgid "EXAMPLE"
764 msgstr "例"
765
766 #. type: Plain text
767 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
768 msgid "See B<bind>(2)."
769 msgstr "B<bind>(2)  参照。"
770
771 #. type: SH
772 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
773 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:263
774 #: build/C/man3/getifaddrs.3:290 build/C/man2/getsockname.2:114
775 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:146
776 #: build/C/man3/if_nametoindex.3:89 build/C/man2/listen.2:169
777 #: build/C/man2/recv.2:498 build/C/man2/recvmmsg.2:268
778 #: build/C/man2/select.2:574 build/C/man2/select_tut.2:819
779 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
780 #: build/C/man3/sockatmark.3:134 build/C/man2/socket.2:390
781 #: build/C/man7/socket.7:913 build/C/man2/socketcall.2:53
782 #: build/C/man2/socketpair.2:124
783 #, no-wrap
784 msgid "SEE ALSO"
785 msgstr "関連項目"
786
787 #. type: Plain text
788 #: build/C/man2/accept.2:388
789 msgid ""
790 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
791 "B<socket>(7)"
792 msgstr ""
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<socket>(7)"
795
796 #. type: SH
797 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
798 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:270
799 #: build/C/man3/getifaddrs.3:296 build/C/man2/getsockname.2:121
800 #: build/C/man2/getsockopt.2:210 build/C/man3/if_nameindex.3:153
801 #: build/C/man3/if_nametoindex.3:93 build/C/man2/listen.2:175
802 #: build/C/man2/recv.2:509 build/C/man2/recvmmsg.2:275
803 #: build/C/man2/select.2:588 build/C/man2/select_tut.2:838
804 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
805 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:419
806 #: build/C/man7/socket.7:925 build/C/man2/socketcall.2:71
807 #: build/C/man2/socketpair.2:131
808 #, no-wrap
809 msgid "COLOPHON"
810 msgstr "この文書について"
811
812 #. type: Plain text
813 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
814 #: build/C/man3/bindresvport.3:123 build/C/man2/connect.2:277
815 #: build/C/man3/getifaddrs.3:303 build/C/man2/getsockname.2:128
816 #: build/C/man2/getsockopt.2:217 build/C/man3/if_nameindex.3:160
817 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:182
818 #: build/C/man2/recv.2:516 build/C/man2/recvmmsg.2:282
819 #: build/C/man2/select.2:595 build/C/man2/select_tut.2:845
820 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
821 #: build/C/man3/sockatmark.3:146 build/C/man2/socket.2:426
822 #: build/C/man7/socket.7:932 build/C/man2/socketcall.2:78
823 #: build/C/man2/socketpair.2:138
824 msgid ""
825 "This page is part of release 3.52 of the Linux I<man-pages> project.  A "
826 "description of the project, and information about reporting bugs, can be "
827 "found at \\%http://www.kernel.org/doc/man-pages/."
828 msgstr ""
829 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.52 の一部\n"
830 "である。プロジェクトの説明とバグ報告に関する情報は\n"
831 "http://www.kernel.org/doc/man-pages/ に書かれている。"
832
833 #. type: TH
834 #: build/C/man2/bind.2:68
835 #, no-wrap
836 msgid "BIND"
837 msgstr "BIND"
838
839 #. type: TH
840 #: build/C/man2/bind.2:68
841 #, no-wrap
842 msgid "2007-12-28"
843 msgstr "2007-12-28"
844
845 #. type: Plain text
846 #: build/C/man2/bind.2:71
847 msgid "bind - bind a name to a socket"
848 msgstr "bind - ソケットに名前をつける"
849
850 #. type: Plain text
851 #: build/C/man2/bind.2:78
852 #, no-wrap
853 msgid ""
854 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
855 "B<         socklen_t >I<addrlen>B<);>\n"
856 msgstr ""
857 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
858 "B<         socklen_t >I<addrlen>B<);>\n"
859
860 #. type: Plain text
861 #: build/C/man2/bind.2:92
862 msgid ""
863 "When a socket is created with B<socket>(2), it exists in a name space "
864 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
865 "address specified by I<addr> to the socket referred to by the file "
866 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
867 "address structure pointed to by I<addr>.  Traditionally, this operation is "
868 "called \\(lqassigning a name to a socket\\(rq."
869 msgstr ""
870 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
871 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
872 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
873 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
874 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
875 "る。"
876
877 #. type: Plain text
878 #: build/C/man2/bind.2:99
879 msgid ""
880 "It is normally necessary to assign a local address using B<bind>()  before a "
881 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
882 msgstr ""
883 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
884 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
885 "る。"
886
887 #. type: Plain text
888 #: build/C/man2/bind.2:130
889 msgid ""
890 "The rules used in name binding vary between address families.  Consult the "
891 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
892 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
893 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
894 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
895 msgstr ""
896 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
897 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
898 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
899 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
900 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
901
902 #. type: Plain text
903 #: build/C/man2/bind.2:137
904 msgid ""
905 "The actual structure passed for the I<addr> argument will depend on the "
906 "address family.  The I<sockaddr> structure is defined as something like:"
907 msgstr ""
908 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
909 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
910
911 #. type: Plain text
912 #: build/C/man2/bind.2:144
913 #, no-wrap
914 msgid ""
915 "struct sockaddr {\n"
916 "    sa_family_t sa_family;\n"
917 "    char        sa_data[14];\n"
918 "}\n"
919 msgstr ""
920 "struct sockaddr {\n"
921 "    sa_family_t sa_family;\n"
922 "    char        sa_data[14];\n"
923 "}\n"
924
925 #. type: Plain text
926 #: build/C/man2/bind.2:152
927 msgid ""
928 "The only purpose of this structure is to cast the structure pointer passed "
929 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
930 msgstr ""
931 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
932 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
933
934 #. type: Plain text
935 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
936 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
937 #: build/C/man2/socketpair.2:74
938 msgid ""
939 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
940 "appropriately."
941 msgstr ""
942 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
943 "設定される。"
944
945 #. type: TP
946 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
947 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
948 #: build/C/man2/send.2:285 build/C/man2/socket.2:320
949 #, no-wrap
950 msgid "B<EACCES>"
951 msgstr "B<EACCES>"
952
953 #.  e.g., privileged port in AF_INET domain
954 #. type: Plain text
955 #: build/C/man2/bind.2:162
956 msgid "The address is protected, and the user is not the superuser."
957 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
958
959 #. type: TP
960 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
961 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
962 #, no-wrap
963 msgid "B<EADDRINUSE>"
964 msgstr "B<EADDRINUSE>"
965
966 #. type: Plain text
967 #: build/C/man2/bind.2:165
968 msgid "The given address is already in use."
969 msgstr "指定されたアドレスが既に使用中である。"
970
971 #. type: Plain text
972 #: build/C/man2/bind.2:169
973 msgid "I<sockfd> is not a valid descriptor."
974 msgstr "I<sockfd> が不正なディスクリプタである。"
975
976 #.  This may change in the future: see
977 #.  .I linux/unix/sock.c for details.
978 #. type: Plain text
979 #: build/C/man2/bind.2:174
980 msgid "The socket is already bound to an address."
981 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
982
983 #. type: Plain text
984 #: build/C/man2/bind.2:178
985 msgid "I<sockfd> is a descriptor for a file, not a socket."
986 msgstr ""
987 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
988
989 #. type: Plain text
990 #: build/C/man2/bind.2:182
991 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
992 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
993
994 #. type: Plain text
995 #: build/C/man2/bind.2:187
996 msgid ""
997 "Search permission is denied on a component of the path prefix.  (See also "
998 "B<path_resolution>(7).)"
999 msgstr ""
1000 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1001 "(7)  も参照すること)。"
1002
1003 #. type: TP
1004 #: build/C/man2/bind.2:187
1005 #, no-wrap
1006 msgid "B<EADDRNOTAVAIL>"
1007 msgstr "B<EADDRNOTAVAIL>"
1008
1009 #. type: Plain text
1010 #: build/C/man2/bind.2:191
1011 msgid ""
1012 "A nonexistent interface was requested or the requested address was not local."
1013 msgstr ""
1014 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1015 "かった。"
1016
1017 #. type: Plain text
1018 #: build/C/man2/bind.2:195
1019 msgid "I<addr> points outside the user's accessible address space."
1020 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1021
1022 #. type: Plain text
1023 #: build/C/man2/bind.2:202
1024 msgid ""
1025 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1026 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1027
1028 #. type: TP
1029 #: build/C/man2/bind.2:202
1030 #, no-wrap
1031 msgid "B<ELOOP>"
1032 msgstr "B<ELOOP>"
1033
1034 #. type: Plain text
1035 #: build/C/man2/bind.2:206
1036 msgid "Too many symbolic links were encountered in resolving I<addr>."
1037 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1038
1039 #. type: TP
1040 #: build/C/man2/bind.2:206
1041 #, no-wrap
1042 msgid "B<ENAMETOOLONG>"
1043 msgstr "B<ENAMETOOLONG>"
1044
1045 #. type: Plain text
1046 #: build/C/man2/bind.2:210
1047 msgid "I<addr> is too long."
1048 msgstr "I<addr> が長過ぎる。"
1049
1050 #. type: TP
1051 #: build/C/man2/bind.2:210
1052 #, no-wrap
1053 msgid "B<ENOENT>"
1054 msgstr "B<ENOENT>"
1055
1056 #. type: Plain text
1057 #: build/C/man2/bind.2:213
1058 msgid "The file does not exist."
1059 msgstr "ファイルが存在しない。"
1060
1061 #. type: TP
1062 #: build/C/man2/bind.2:213 build/C/man2/recv.2:432 build/C/man2/select.2:322
1063 #: build/C/man2/send.2:343
1064 #, no-wrap
1065 msgid "B<ENOMEM>"
1066 msgstr "B<ENOMEM>"
1067
1068 #. type: Plain text
1069 #: build/C/man2/bind.2:216
1070 msgid "Insufficient kernel memory was available."
1071 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1072
1073 #. type: TP
1074 #: build/C/man2/bind.2:216
1075 #, no-wrap
1076 msgid "B<ENOTDIR>"
1077 msgstr "B<ENOTDIR>"
1078
1079 #. type: Plain text
1080 #: build/C/man2/bind.2:219
1081 msgid "A component of the path prefix is not a directory."
1082 msgstr "パス名の構成要素がディレクトリではない。"
1083
1084 #. type: TP
1085 #: build/C/man2/bind.2:219
1086 #, no-wrap
1087 msgid "B<EROFS>"
1088 msgstr "B<EROFS>"
1089
1090 #. type: Plain text
1091 #: build/C/man2/bind.2:222
1092 msgid "The socket inode would reside on a read-only file system."
1093 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1094
1095 #.  SVr4 documents an additional
1096 #.  .B ENOSR
1097 #.  general error condition, and
1098 #.  additional
1099 #.  .B EIO
1100 #.  and
1101 #.  .B EISDIR
1102 #.  UNIX-domain error conditions.
1103 #. type: Plain text
1104 #: build/C/man2/bind.2:234
1105 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1106 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1107
1108 #. type: Plain text
1109 #: build/C/man2/bind.2:251
1110 msgid ""
1111 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1112 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1113 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1114 msgstr ""
1115 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1116 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1117 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1118
1119 #. type: SH
1120 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1121 #: build/C/man2/select.2:474 build/C/man2/send.2:414
1122 #: build/C/man3/sockatmark.3:95 build/C/man7/socket.7:900
1123 #, no-wrap
1124 msgid "BUGS"
1125 msgstr "バグ"
1126
1127 #.  FIXME What *are* transparent proxy options?
1128 #. type: Plain text
1129 #: build/C/man2/bind.2:254
1130 msgid "The transparent proxy options are not described."
1131 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1132
1133 #. type: Plain text
1134 #: build/C/man2/bind.2:259
1135 msgid ""
1136 "An example of the use of B<bind>()  with Internet domain sockets can be "
1137 "found in B<getaddrinfo>(3)."
1138 msgstr ""
1139 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1140 "(3)  に記載されている。"
1141
1142 #.  listen.7 refers to this example.
1143 #.  accept.7 refers to this example.
1144 #.  unix.7 refers to this example.
1145 #. type: Plain text
1146 #: build/C/man2/bind.2:266
1147 msgid ""
1148 "The following example shows how to bind a stream socket in the UNIX "
1149 "(B<AF_UNIX>)  domain, and accept connections:"
1150 msgstr ""
1151 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1152 "を示したものである。"
1153
1154 #. type: Plain text
1155 #: build/C/man2/bind.2:273
1156 #, no-wrap
1157 msgid ""
1158 "#include E<lt>sys/socket.hE<gt>\n"
1159 "#include E<lt>sys/un.hE<gt>\n"
1160 "#include E<lt>stdlib.hE<gt>\n"
1161 "#include E<lt>stdio.hE<gt>\n"
1162 "#include E<lt>string.hE<gt>\n"
1163 msgstr ""
1164 "#include E<lt>sys/socket.hE<gt>\n"
1165 "#include E<lt>sys/un.hE<gt>\n"
1166 "#include E<lt>stdlib.hE<gt>\n"
1167 "#include E<lt>stdio.hE<gt>\n"
1168 "#include E<lt>string.hE<gt>\n"
1169
1170 #. type: Plain text
1171 #: build/C/man2/bind.2:276
1172 #, no-wrap
1173 msgid ""
1174 "#define MY_SOCK_PATH \"/somepath\"\n"
1175 "#define LISTEN_BACKLOG 50\n"
1176 msgstr ""
1177 "#define MY_SOCK_PATH \"/somepath\"\n"
1178 "#define LISTEN_BACKLOG 50\n"
1179
1180 #. type: Plain text
1181 #: build/C/man2/bind.2:279
1182 #, no-wrap
1183 msgid ""
1184 "#define handle_error(msg) \\e\n"
1185 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1186 msgstr ""
1187 "#define handle_error(msg) \\e\n"
1188 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1189
1190 #. type: Plain text
1191 #: build/C/man2/bind.2:286
1192 #, no-wrap
1193 msgid ""
1194 "int\n"
1195 "main(int argc, char *argv[])\n"
1196 "{\n"
1197 "    int sfd, cfd;\n"
1198 "    struct sockaddr_un my_addr, peer_addr;\n"
1199 "    socklen_t peer_addr_size;\n"
1200 msgstr ""
1201 "int\n"
1202 "main(int argc, char *argv[])\n"
1203 "{\n"
1204 "    int sfd, cfd;\n"
1205 "    struct sockaddr_un my_addr, peer_addr;\n"
1206 "    socklen_t peer_addr_size;\n"
1207
1208 #. type: Plain text
1209 #: build/C/man2/bind.2:290
1210 #, no-wrap
1211 msgid ""
1212 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1213 "    if (sfd == -1)\n"
1214 "        handle_error(\"socket\");\n"
1215 msgstr ""
1216 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1217 "    if (sfd == -1)\n"
1218 "        handle_error(\"socket\");\n"
1219
1220 #. type: Plain text
1221 #: build/C/man2/bind.2:296
1222 #, no-wrap
1223 msgid ""
1224 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1225 "                        /* Clear structure */\n"
1226 "    my_addr.sun_family = AF_UNIX;\n"
1227 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1228 "            sizeof(my_addr.sun_path) - 1);\n"
1229 msgstr ""
1230 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1231 "                        /* Clear structure */\n"
1232 "    my_addr.sun_family = AF_UNIX;\n"
1233 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1234 "            sizeof(my_addr.sun_path) - 1);\n"
1235
1236 #. type: Plain text
1237 #: build/C/man2/bind.2:300
1238 #, no-wrap
1239 msgid ""
1240 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1241 "            sizeof(struct sockaddr_un)) == -1)\n"
1242 "        handle_error(\"bind\");\n"
1243 msgstr ""
1244 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1245 "            sizeof(struct sockaddr_un)) == -1)\n"
1246 "        handle_error(\"bind\");\n"
1247
1248 #. type: Plain text
1249 #: build/C/man2/bind.2:303
1250 #, no-wrap
1251 msgid ""
1252 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1253 "        handle_error(\"listen\");\n"
1254 msgstr ""
1255 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1256 "        handle_error(\"listen\");\n"
1257
1258 #. type: Plain text
1259 #: build/C/man2/bind.2:306
1260 #, no-wrap
1261 msgid ""
1262 "    /* Now we can accept incoming connections one\n"
1263 "       at a time using accept(2) */\n"
1264 msgstr ""
1265 "    /* Now we can accept incoming connections one\n"
1266 "       at a time using accept(2) */\n"
1267
1268 #. type: Plain text
1269 #: build/C/man2/bind.2:312
1270 #, no-wrap
1271 msgid ""
1272 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1273 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1274 "                 &peer_addr_size);\n"
1275 "    if (cfd == -1)\n"
1276 "        handle_error(\"accept\");\n"
1277 msgstr ""
1278 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1279 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1280 "                 &peer_addr_size)\n"
1281 "    if (cfd == -1)\n"
1282 "        handle_error(\"accept\");\n"
1283
1284 #. type: Plain text
1285 #: build/C/man2/bind.2:314
1286 #, no-wrap
1287 msgid "    /* Code to deal with incoming connection(s)... */\n"
1288 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1289
1290 #. type: Plain text
1291 #: build/C/man2/bind.2:318
1292 #, no-wrap
1293 msgid ""
1294 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1295 "       should be deleted using unlink(2) or remove(3) */\n"
1296 "}\n"
1297 msgstr ""
1298 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1299 "       should be deleted using unlink(2) or remove(3) */\n"
1300 "}\n"
1301
1302 #. type: Plain text
1303 #: build/C/man2/bind.2:332
1304 msgid ""
1305 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1306 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1307 "(7), B<socket>(7), B<unix>(7)"
1308 msgstr ""
1309 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1310 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1311 "(7), B<socket>(7), B<unix>(7)"
1312
1313 #. type: TH
1314 #: build/C/man3/bindresvport.3:30
1315 #, no-wrap
1316 msgid "BINDRESVPORT"
1317 msgstr "BINDRESVPORT"
1318
1319 #. type: TH
1320 #: build/C/man3/bindresvport.3:30 build/C/man7/socket.7:45
1321 #, no-wrap
1322 msgid "2013-06-21"
1323 msgstr "2013-06-21"
1324
1325 #. type: Plain text
1326 #: build/C/man3/bindresvport.3:33
1327 msgid "bindresvport - bind a socket to a privileged IP port"
1328 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1329
1330 #. type: Plain text
1331 #: build/C/man3/bindresvport.3:37
1332 #, no-wrap
1333 msgid ""
1334 "B<#include E<lt>sys/types.hE<gt>>\n"
1335 "B<#include E<lt>netinet/in.hE<gt>>\n"
1336 msgstr ""
1337 "B<#include E<lt>sys/types.hE<gt>>\n"
1338 "B<#include E<lt>netinet/in.hE<gt>>\n"
1339
1340 #. type: Plain text
1341 #: build/C/man3/bindresvport.3:39
1342 #, no-wrap
1343 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1344 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1345
1346 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1347 #. type: Plain text
1348 #: build/C/man3/bindresvport.3:46
1349 msgid ""
1350 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1351 "anonymous IP port, that is, a port number arbitrarily selected from the "
1352 "range 512 to 1023."
1353 msgstr ""
1354 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1355 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1356 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1357
1358 #. type: Plain text
1359 #: build/C/man3/bindresvport.3:56
1360 msgid ""
1361 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1362 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1363 "allocated."
1364 msgstr ""
1365 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1366 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1367 "される。"
1368
1369 #. type: Plain text
1370 #: build/C/man3/bindresvport.3:67
1371 msgid ""
1372 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1373 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1374 "return the port number actually allocated.  (This information can later be "
1375 "obtained using B<getsockname>(2).)"
1376 msgstr ""
1377 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1378 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1379 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1380 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1381
1382 #. type: Plain text
1383 #: build/C/man3/bindresvport.3:72
1384 msgid ""
1385 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1386 "I<errno> set to indicate the cause of the error."
1387 msgstr ""
1388 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1389 "I<errno> にエラーの原因を示す値を設定する。"
1390
1391 #. type: Plain text
1392 #: build/C/man3/bindresvport.3:77
1393 msgid ""
1394 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1395 "addition, the following errors may occur:"
1396 msgstr ""
1397 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1398 "以下のエラーが発生することがある:"
1399
1400 #. type: Plain text
1401 #: build/C/man3/bindresvport.3:82
1402 msgid ""
1403 "The caller did not have superuser privilege (to be precise: the "
1404 "B<CAP_NET_BIND_SERVICE> capability is required)."
1405 msgstr ""
1406 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1407 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1408
1409 #. type: Plain text
1410 #: build/C/man3/bindresvport.3:85
1411 msgid "All privileged ports are in use."
1412 msgstr "全ての特権ポートが使用中である。"
1413
1414 #. type: TP
1415 #: build/C/man3/bindresvport.3:85
1416 #, no-wrap
1417 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1418 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1419
1420 #. type: Plain text
1421 #: build/C/man3/bindresvport.3:92
1422 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1423 msgstr ""
1424 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1425
1426 #. type: SH
1427 #: build/C/man3/bindresvport.3:92
1428 #, no-wrap
1429 msgid "ATTRIBUTES"
1430 msgstr "属性"
1431
1432 #. type: SS
1433 #: build/C/man3/bindresvport.3:93
1434 #, no-wrap
1435 msgid "Multithreading (see pthreads(7))"
1436 msgstr "マルチスレッディング (pthreads(7) 参照)"
1437
1438 #. type: Plain text
1439 #: build/C/man3/bindresvport.3:98
1440 msgid ""
1441 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1442 "that is not protected, so it is not thread-safe."
1443 msgstr "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない静的変数を使用しているため、スレッドセーフではない。"
1444
1445 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1446 #. type: Plain text
1447 #: build/C/man3/bindresvport.3:104
1448 msgid ""
1449 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1450 "static variable, so it is thread-safe."
1451 msgstr "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っており、スレッドセーフである。"
1452
1453 #. type: Plain text
1454 #: build/C/man3/bindresvport.3:107
1455 msgid ""
1456 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1457 msgstr ""
1458 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1459
1460 #. type: Plain text
1461 #: build/C/man3/bindresvport.3:113
1462 msgid ""
1463 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1464 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1465 msgstr ""
1466 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1467 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1468
1469 #. type: Plain text
1470 #: build/C/man3/bindresvport.3:116
1471 msgid "B<bind>(2), B<getsockname>(2)"
1472 msgstr "B<bind>(2), B<getsockname>(2)"
1473
1474 #. type: TH
1475 #: build/C/man2/connect.2:67
1476 #, no-wrap
1477 msgid "CONNECT"
1478 msgstr "CONNECT"
1479
1480 #. type: TH
1481 #: build/C/man2/connect.2:67 build/C/man2/getsockname.2:40
1482 #: build/C/man2/getsockopt.2:44 build/C/man3/sockatmark.3:25
1483 #, no-wrap
1484 msgid "2008-12-03"
1485 msgstr "2008-12-03"
1486
1487 #. type: Plain text
1488 #: build/C/man2/connect.2:70
1489 msgid "connect - initiate a connection on a socket"
1490 msgstr "connect - ソケットの接続を行う"
1491
1492 #. type: Plain text
1493 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1494 #: build/C/man2/listen.2:51
1495 #, no-wrap
1496 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1497 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1498
1499 #. type: Plain text
1500 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1501 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1502 #: build/C/man2/recv.2:51
1503 #, no-wrap
1504 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1505 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1506
1507 #. type: Plain text
1508 #: build/C/man2/connect.2:78
1509 #, no-wrap
1510 msgid ""
1511 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1512 "B<            socklen_t >I<addrlen>B<);>\n"
1513 msgstr ""
1514 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1515 "B<            socklen_t >I<addrlen>B<);>\n"
1516
1517 #. type: Plain text
1518 #: build/C/man2/connect.2:97
1519 msgid ""
1520 "The B<connect>()  system call connects the socket referred to by the file "
1521 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1522 "argument specifies the size of I<addr>.  The format of the address in "
1523 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1524 "B<socket>(2)  for further details."
1525 msgstr ""
1526 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1527 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1528 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1529 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1530 "こと。"
1531
1532 #. type: Plain text
1533 #: build/C/man2/connect.2:113
1534 msgid ""
1535 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1536 "to which datagrams are sent by default, and the only address from which "
1537 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1538 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1539 "that is bound to the address specified by I<addr>."
1540 msgstr ""
1541 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1542 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1543 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1544 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1545 "に対する接続の 作成を試みる。"
1546
1547 #. type: Plain text
1548 #: build/C/man2/connect.2:127
1549 msgid ""
1550 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1551 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1552 "times to change their association.  Connectionless sockets may dissolve the "
1553 "association by connecting to an address with the I<sa_family> member of "
1554 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1555 msgstr ""
1556 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1557 "()  が成功する。 コネクションレス (connectionless) プロトコルでは対応を変更す"
1558 "るために何度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1559 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1560 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1561
1562 #. type: Plain text
1563 #: build/C/man2/connect.2:132
1564 msgid ""
1565 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1566 "returned, and I<errno> is set appropriately."
1567 msgstr ""
1568 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1569 "適切な値を設定する。"
1570
1571 #. type: Plain text
1572 #: build/C/man2/connect.2:135
1573 msgid ""
1574 "The following are general socket errors only.  There may be other domain-"
1575 "specific error codes."
1576 msgstr ""
1577 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1578 "する可能性がある。"
1579
1580 #. type: Plain text
1581 #: build/C/man2/connect.2:143
1582 msgid ""
1583 "For UNIX domain sockets, which are identified by pathname: Write permission "
1584 "is denied on the socket file, or search permission is denied for one of the "
1585 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1586 msgstr ""
1587 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1588 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1589 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1590
1591 #. type: TP
1592 #: build/C/man2/connect.2:143
1593 #, no-wrap
1594 msgid "B<EACCES>, B<EPERM>"
1595 msgstr "B<EACCES>, B<EPERM>"
1596
1597 #. type: Plain text
1598 #: build/C/man2/connect.2:148
1599 msgid ""
1600 "The user tried to connect to a broadcast address without having the socket "
1601 "broadcast flag enabled or the connection request failed because of a local "
1602 "firewall rule."
1603 msgstr ""
1604 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1605 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1606 "要求が失敗した。"
1607
1608 #. type: Plain text
1609 #: build/C/man2/connect.2:151
1610 msgid "Local address is already in use."
1611 msgstr "ローカルアドレスが既に使用されている。"
1612
1613 #. type: TP
1614 #: build/C/man2/connect.2:151 build/C/man2/socket.2:324
1615 #: build/C/man2/socketpair.2:75
1616 #, no-wrap
1617 msgid "B<EAFNOSUPPORT>"
1618 msgstr "B<EAFNOSUPPORT>"
1619
1620 #. type: Plain text
1621 #: build/C/man2/connect.2:156
1622 msgid ""
1623 "The passed address didn't have the correct address family in its "
1624 "I<sa_family> field."
1625 msgstr ""
1626 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1627 "い。"
1628
1629 #. type: TP
1630 #: build/C/man2/connect.2:156
1631 #, no-wrap
1632 msgid "B<EAGAIN>"
1633 msgstr "B<EAGAIN>"
1634
1635 #. type: Plain text
1636 #: build/C/man2/connect.2:165
1637 msgid ""
1638 "No more free local ports or insufficient entries in the routing cache.  For "
1639 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1640 "B<ip>(7)  for information on how to increase the number of local ports."
1641 msgstr ""
1642 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1643 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1644 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1645
1646 #. type: TP
1647 #: build/C/man2/connect.2:165
1648 #, no-wrap
1649 msgid "B<EALREADY>"
1650 msgstr "B<EALREADY>"
1651
1652 #. type: Plain text
1653 #: build/C/man2/connect.2:169
1654 msgid ""
1655 "The socket is nonblocking and a previous connection attempt has not yet been "
1656 "completed."
1657 msgstr ""
1658 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1659
1660 #. type: Plain text
1661 #: build/C/man2/connect.2:172
1662 msgid "The file descriptor is not a valid index in the descriptor table."
1663 msgstr ""
1664 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1665 "い。"
1666
1667 #. type: TP
1668 #: build/C/man2/connect.2:172 build/C/man2/recv.2:415
1669 #, no-wrap
1670 msgid "B<ECONNREFUSED>"
1671 msgstr "B<ECONNREFUSED>"
1672
1673 #. type: Plain text
1674 #: build/C/man2/connect.2:175
1675 msgid "No-one listening on the remote address."
1676 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1677
1678 #. type: Plain text
1679 #: build/C/man2/connect.2:178
1680 msgid "The socket structure address is outside the user's address space."
1681 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1682
1683 #. type: TP
1684 #: build/C/man2/connect.2:178
1685 #, no-wrap
1686 msgid "B<EINPROGRESS>"
1687 msgstr "B<EINPROGRESS>"
1688
1689 #. type: Plain text
1690 #: build/C/man2/connect.2:203
1691 msgid ""
1692 "The socket is nonblocking and the connection cannot be completed "
1693 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1694 "by selecting the socket for writing.  After B<select>(2)  indicates "
1695 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1696 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1697 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1698 "error codes listed here, explaining the reason for the failure)."
1699 msgstr ""
1700 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1701 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1702 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1703 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1704 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1705 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1706 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1707 "の原因が分かる。"
1708
1709 #.  For TCP, the connection will complete asynchronously.
1710 #.  See http://lkml.org/lkml/2005/7/12/254
1711 #. type: Plain text
1712 #: build/C/man2/connect.2:209
1713 msgid ""
1714 "The system call was interrupted by a signal that was caught; see B<signal>"
1715 "(7)."
1716 msgstr ""
1717 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1718
1719 #. type: TP
1720 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1721 #, no-wrap
1722 msgid "B<EISCONN>"
1723 msgstr "B<EISCONN>"
1724
1725 #. type: Plain text
1726 #: build/C/man2/connect.2:212
1727 msgid "The socket is already connected."
1728 msgstr "ソケットは既に接続 (connect) されている。"
1729
1730 #. type: TP
1731 #: build/C/man2/connect.2:212
1732 #, no-wrap
1733 msgid "B<ENETUNREACH>"
1734 msgstr "B<ENETUNREACH>"
1735
1736 #. type: Plain text
1737 #: build/C/man2/connect.2:215
1738 msgid "Network is unreachable."
1739 msgstr "到達できないネットワークである。"
1740
1741 #. type: Plain text
1742 #: build/C/man2/connect.2:218
1743 msgid "The file descriptor is not associated with a socket."
1744 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1745
1746 #. type: TP
1747 #: build/C/man2/connect.2:218
1748 #, no-wrap
1749 msgid "B<ETIMEDOUT>"
1750 msgstr "B<ETIMEDOUT>"
1751
1752 #. type: Plain text
1753 #: build/C/man2/connect.2:225
1754 msgid ""
1755 "Timeout while attempting connection.  The server may be too busy to accept "
1756 "new connections.  Note that for IP sockets the timeout may be very long when "
1757 "syncookies are enabled on the server."
1758 msgstr ""
1759 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1760 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1761 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1762 "ること。"
1763
1764 #.  SVr4 documents the additional
1765 #.  general error codes
1766 #.  .BR EADDRNOTAVAIL ,
1767 #.  .BR EINVAL ,
1768 #.  .BR EAFNOSUPPORT ,
1769 #.  .BR EALREADY ,
1770 #.  .BR EINTR ,
1771 #.  .BR EPROTOTYPE ,
1772 #.  and
1773 #.  .BR ENOSR .
1774 #.  It also
1775 #.  documents many additional error conditions not described here.
1776 #. type: Plain text
1777 #: build/C/man2/connect.2:241
1778 msgid ""
1779 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1780 "POSIX.1-2001."
1781 msgstr ""
1782 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1783
1784 #. type: Plain text
1785 #: build/C/man2/connect.2:258
1786 msgid ""
1787 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1788 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1789 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1790 msgstr ""
1791 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1792 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1793 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1794
1795 #. type: Plain text
1796 #: build/C/man2/connect.2:263
1797 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1798 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1799
1800 #. type: Plain text
1801 #: build/C/man2/connect.2:270
1802 msgid ""
1803 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1804 "B<path_resolution>(7)"
1805 msgstr ""
1806 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1807 "B<path_resolution>(7)"
1808
1809 #. type: TH
1810 #: build/C/man3/getifaddrs.3:36
1811 #, no-wrap
1812 msgid "GETIFADDRS"
1813 msgstr "GETIFADDRS"
1814
1815 #. type: TH
1816 #: build/C/man3/getifaddrs.3:36
1817 #, no-wrap
1818 msgid "2012-11-11"
1819 msgstr "2012-11-11"
1820
1821 #. type: TH
1822 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1823 #: build/C/man3/if_nametoindex.3:25
1824 #, no-wrap
1825 msgid "GNU"
1826 msgstr "GNU"
1827
1828 #. type: Plain text
1829 #: build/C/man3/getifaddrs.3:39
1830 msgid "getifaddrs, freeifaddrs - get interface addresses"
1831 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1832
1833 #. type: Plain text
1834 #: build/C/man3/getifaddrs.3:43
1835 #, no-wrap
1836 msgid ""
1837 "B<#include E<lt>sys/types.hE<gt>>\n"
1838 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1839 msgstr ""
1840 "B<#include E<lt>sys/types.hE<gt>>\n"
1841 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1842
1843 #. type: Plain text
1844 #: build/C/man3/getifaddrs.3:45
1845 #, no-wrap
1846 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1847 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1848
1849 #. type: Plain text
1850 #: build/C/man3/getifaddrs.3:47
1851 #, no-wrap
1852 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1853 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1854
1855 #. type: Plain text
1856 #: build/C/man3/getifaddrs.3:58
1857 msgid ""
1858 "The B<getifaddrs>()  function creates a linked list of structures describing "
1859 "the network interfaces of the local system, and stores the address of the "
1860 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1861 "structures, defined as follows:"
1862 msgstr ""
1863
1864 #. type: Plain text
1865 #: build/C/man3/getifaddrs.3:77
1866 #, no-wrap
1867 msgid ""
1868 "struct ifaddrs {\n"
1869 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1870 "    char            *ifa_name;    /* Name of interface */\n"
1871 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1872 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1873 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1874 "    union {\n"
1875 "        struct sockaddr *ifu_broadaddr;\n"
1876 "                         /* Broadcast address of interface */\n"
1877 "        struct sockaddr *ifu_dstaddr;\n"
1878 "                         /* Point-to-point destination address */\n"
1879 "    } ifa_ifu;\n"
1880 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1881 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1882 "    void            *ifa_data;    /* Address-specific data */\n"
1883 "};\n"
1884 msgstr ""
1885 "struct ifaddrs {\n"
1886 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1887 "    char            *ifa_name;    /* Name of interface */\n"
1888 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1889 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1890 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1891 "    union {\n"
1892 "        struct sockaddr *ifu_broadaddr;\n"
1893 "                         /* Broadcast address of interface */\n"
1894 "        struct sockaddr *ifu_dstaddr;\n"
1895 "                         /* Point-to-point destination address */\n"
1896 "    } ifa_ifu;\n"
1897 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1898 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1899 "    void            *ifa_data;    /* Address-specific data */\n"
1900 "};\n"
1901
1902 #. type: Plain text
1903 #: build/C/man3/getifaddrs.3:84
1904 msgid ""
1905 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1906 "or NULL if this is the last item of the list."
1907 msgstr ""
1908
1909 #.  The constant
1910 #.  .B IF NAMESIZE
1911 #.  indicates the maximum length of this field.
1912 #. type: Plain text
1913 #: build/C/man3/getifaddrs.3:91
1914 msgid "The I<ifa_name> points to the null-terminated interface name."
1915 msgstr ""
1916
1917 #. type: Plain text
1918 #: build/C/man3/getifaddrs.3:100
1919 msgid ""
1920 "The I<ifa_flags> field contains the interface flags, as returned by the "
1921 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1922 "these flags)."
1923 msgstr ""
1924
1925 #. type: Plain text
1926 #: build/C/man3/getifaddrs.3:109
1927 msgid ""
1928 "The I<ifa_addr> field points to a structure containing the interface "
1929 "address.  (The I<sa_family> subfield should be consulted to determine the "
1930 "format of the address structure.)  This field may contain a NULL pointer."
1931 msgstr ""
1932
1933 #. type: Plain text
1934 #: build/C/man3/getifaddrs.3:116
1935 msgid ""
1936 "The I<ifa_netmask> field points to a structure containing the netmask "
1937 "associated with I<ifa_addr>, if applicable for the address family.  This "
1938 "field may contain a NULL pointer."
1939 msgstr ""
1940
1941 #. type: Plain text
1942 #: build/C/man3/getifaddrs.3:131
1943 msgid ""
1944 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1945 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1946 "will contain the broadcast address associated with I<ifa_addr> (if "
1947 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1948 "destination address of the point-to-point interface."
1949 msgstr ""
1950
1951 #. type: Plain text
1952 #: build/C/man3/getifaddrs.3:136
1953 msgid ""
1954 "The I<ifa_data> field points to a buffer containing address-family-specific "
1955 "data; this field may be NULL if there is no such data for this interface."
1956 msgstr ""
1957
1958 #. type: Plain text
1959 #: build/C/man3/getifaddrs.3:142
1960 msgid ""
1961 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1962 "freed using B<freeifaddrs>()  when no longer needed."
1963 msgstr ""
1964
1965 #. type: Plain text
1966 #: build/C/man3/getifaddrs.3:149
1967 msgid ""
1968 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1969 "I<errno> is set appropriately."
1970 msgstr ""
1971
1972 #. type: Plain text
1973 #: build/C/man3/getifaddrs.3:162
1974 msgid ""
1975 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1976 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1977 "(2), B<malloc>(3), or B<realloc>(3)."
1978 msgstr ""
1979 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1980 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1981 "(2), B<malloc>(3), or B<realloc>(3)."
1982
1983 #. type: Plain text
1984 #: build/C/man3/getifaddrs.3:170
1985 msgid ""
1986 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1987 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
1988 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
1989 "available only on kernels that support netlink."
1990 msgstr ""
1991
1992 #.  , but the BSD-derived documentation generally
1993 #.  appears to be confused and obsolete on this point.
1994 #.  i.e., commonly it still says one of them will be NULL, even if
1995 #.  the ifa_ifu union is already present
1996 #. type: Plain text
1997 #: build/C/man3/getifaddrs.3:190
1998 msgid ""
1999 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2000 "the BSD systems, but with slightly different semantics documented"
2001 "\\(emreturning one entry per interface, not per address.  This means "
2002 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2003 "address, and no link-level address is returned if the interface has an IP "
2004 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2005 "I<ifa_dstaddr> differs on various systems."
2006 msgstr ""
2007
2008 #. type: Plain text
2009 #: build/C/man3/getifaddrs.3:207
2010 msgid ""
2011 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2012 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2013 "containing lower-level details about the interface and its physical layer.  "
2014 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2015 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2016 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2017 "hE<gt>>), which contains various interface attributes and statistics."
2018 msgstr ""
2019
2020 #. type: Plain text
2021 #: build/C/man3/getifaddrs.3:214
2022 msgid ""
2023 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2024 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2025 "system:"
2026 msgstr ""
2027
2028 #. type: Plain text
2029 #: build/C/man3/getifaddrs.3:228
2030 #, no-wrap
2031 msgid ""
2032 "$ B<./a.out>\n"
2033 "lo      address family: 17 (AF_PACKET)\n"
2034 "eth0    address family: 17 (AF_PACKET)\n"
2035 "lo      address family: 2 (AF_INET)\n"
2036 "        address: E<lt>127.0.0.1E<gt>\n"
2037 "eth0    address family: 2 (AF_INET)\n"
2038 "        address: E<lt>10.1.1.4E<gt>\n"
2039 "lo      address family: 10 (AF_INET6)\n"
2040 "        address: E<lt>::1E<gt>\n"
2041 "eth0    address family: 10 (AF_INET6)\n"
2042 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2043 msgstr ""
2044 "$ B<./a.out>\n"
2045 "lo      address family: 17 (AF_PACKET)\n"
2046 "eth0    address family: 17 (AF_PACKET)\n"
2047 "lo      address family: 2 (AF_INET)\n"
2048 "        address: E<lt>127.0.0.1E<gt>\n"
2049 "eth0    address family: 2 (AF_INET)\n"
2050 "        address: E<lt>10.1.1.4E<gt>\n"
2051 "lo      address family: 10 (AF_INET6)\n"
2052 "        address: E<lt>::1E<gt>\n"
2053 "eth0    address family: 10 (AF_INET6)\n"
2054 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2055
2056 #. type: SS
2057 #: build/C/man3/getifaddrs.3:230 build/C/man3/if_nameindex.3:120
2058 #: build/C/man2/recvmmsg.2:206
2059 #, no-wrap
2060 msgid "Program source"
2061 msgstr "プログラムのソース"
2062
2063 #. type: Plain text
2064 #: build/C/man3/getifaddrs.3:240
2065 #, no-wrap
2066 msgid ""
2067 "#include E<lt>arpa/inet.hE<gt>\n"
2068 "#include E<lt>sys/socket.hE<gt>\n"
2069 "#include E<lt>netdb.hE<gt>\n"
2070 "#include E<lt>ifaddrs.hE<gt>\n"
2071 "#include E<lt>stdio.hE<gt>\n"
2072 "#include E<lt>stdlib.hE<gt>\n"
2073 "#include E<lt>unistd.hE<gt>\n"
2074 msgstr ""
2075 "#include E<lt>arpa/inet.hE<gt>\n"
2076 "#include E<lt>sys/socket.hE<gt>\n"
2077 "#include E<lt>netdb.hE<gt>\n"
2078 "#include E<lt>ifaddrs.hE<gt>\n"
2079 "#include E<lt>stdio.hE<gt>\n"
2080 "#include E<lt>stdlib.hE<gt>\n"
2081 "#include E<lt>unistd.hE<gt>\n"
2082
2083 #. type: Plain text
2084 #: build/C/man3/getifaddrs.3:247
2085 #, no-wrap
2086 msgid ""
2087 "int\n"
2088 "main(int argc, char *argv[])\n"
2089 "{\n"
2090 "    struct ifaddrs *ifaddr, *ifa;\n"
2091 "    int family, s;\n"
2092 "    char host[NI_MAXHOST];\n"
2093 msgstr ""
2094 "int\n"
2095 "main(int argc, char *argv[])\n"
2096 "{\n"
2097 "    struct ifaddrs *ifaddr, *ifa;\n"
2098 "    int family, s;\n"
2099 "    char host[NI_MAXHOST];\n"
2100
2101 #. type: Plain text
2102 #: build/C/man3/getifaddrs.3:252
2103 #, no-wrap
2104 msgid ""
2105 "    if (getifaddrs(&ifaddr) == -1) {\n"
2106 "        perror(\"getifaddrs\");\n"
2107 "        exit(EXIT_FAILURE);\n"
2108 "    }\n"
2109 msgstr ""
2110 "    if (getifaddrs(&ifaddr) == -1) {\n"
2111 "        perror(\"getifaddrs\");\n"
2112 "        exit(EXIT_FAILURE);\n"
2113 "    }\n"
2114
2115 #. type: Plain text
2116 #: build/C/man3/getifaddrs.3:255
2117 #, no-wrap
2118 msgid ""
2119 "    /* Walk through linked list, maintaining head pointer so we\n"
2120 "       can free list later */\n"
2121 msgstr ""
2122 "    /* Walk through linked list, maintaining head pointer so we\n"
2123 "       can free list later */\n"
2124
2125 #. type: Plain text
2126 #: build/C/man3/getifaddrs.3:259
2127 #, no-wrap
2128 msgid ""
2129 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2130 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2131 "            continue;\n"
2132 msgstr ""
2133 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2134 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2135 "            continue;\n"
2136
2137 #. type: Plain text
2138 #: build/C/man3/getifaddrs.3:261
2139 #, no-wrap
2140 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2141 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2142
2143 #. type: Plain text
2144 #: build/C/man3/getifaddrs.3:264
2145 #, no-wrap
2146 msgid ""
2147 "        /* Display interface name and family (including symbolic\n"
2148 "           form of the latter for the common families) */\n"
2149 msgstr ""
2150 "        /* Display interface name and family (including symbolic\n"
2151 "           form of the latter for the common families) */\n"
2152
2153 #. type: Plain text
2154 #: build/C/man3/getifaddrs.3:270
2155 #, no-wrap
2156 msgid ""
2157 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2158 "                ifa-E<gt>ifa_name, family,\n"
2159 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2160 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2161 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2162 msgstr ""
2163 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2164 "                ifa-E<gt>ifa_name, family,\n"
2165 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2166 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2167 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2168
2169 #. type: Plain text
2170 #: build/C/man3/getifaddrs.3:272
2171 #, no-wrap
2172 msgid "        /* For an AF_INET* interface address, display the address */\n"
2173 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2174
2175 #. type: Plain text
2176 #: build/C/man3/getifaddrs.3:285
2177 #, no-wrap
2178 msgid ""
2179 "        if (family == AF_INET || family == AF_INET6) {\n"
2180 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2181 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2182 "                                          sizeof(struct sockaddr_in6),\n"
2183 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2184 "            if (s != 0) {\n"
2185 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2186 "                exit(EXIT_FAILURE);\n"
2187 "            }\n"
2188 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2189 "        }\n"
2190 "    }\n"
2191 msgstr ""
2192 "        if (family == AF_INET || family == AF_INET6) {\n"
2193 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2194 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2195 "                                          sizeof(struct sockaddr_in6),\n"
2196 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2197 "            if (s != 0) {\n"
2198 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2199 "                exit(EXIT_FAILURE);\n"
2200 "            }\n"
2201 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2202 "        }\n"
2203 "    }\n"
2204
2205 #. type: Plain text
2206 #: build/C/man3/getifaddrs.3:289
2207 #, no-wrap
2208 msgid ""
2209 "    freeifaddrs(ifaddr);\n"
2210 "    exit(EXIT_SUCCESS);\n"
2211 "}\n"
2212 msgstr ""
2213 "    freeifaddrs(ifaddr);\n"
2214 "    exit(EXIT_SUCCESS);\n"
2215 "}\n"
2216
2217 #. type: Plain text
2218 #: build/C/man3/getifaddrs.3:296
2219 msgid ""
2220 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2221 msgstr ""
2222 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2223
2224 #. type: TH
2225 #: build/C/man2/getsockname.2:40
2226 #, no-wrap
2227 msgid "GETSOCKNAME"
2228 msgstr "GETSOCKNAME"
2229
2230 #. type: Plain text
2231 #: build/C/man2/getsockname.2:43
2232 msgid "getsockname - get socket name"
2233 msgstr "getsockname - ソケットの名前を取得する"
2234
2235 #. type: Plain text
2236 #: build/C/man2/getsockname.2:49
2237 #, no-wrap
2238 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2239 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2240
2241 #. type: Plain text
2242 #: build/C/man2/getsockname.2:62
2243 msgid ""
2244 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2245 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2246 "should be initialized to indicate the amount of space (in bytes) pointed to "
2247 "by I<addr>.  On return it contains the actual size of the socket address."
2248 msgstr ""
2249 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2250 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2251 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2252 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2253 "納される。"
2254
2255 #. type: Plain text
2256 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2257 #: build/C/man2/listen.2:96
2258 msgid "The argument I<sockfd> is not a valid descriptor."
2259 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2260
2261 #. type: Plain text
2262 #: build/C/man2/getsockname.2:84
2263 msgid ""
2264 "The I<addr> argument points to memory not in a valid part of the process "
2265 "address space."
2266 msgstr ""
2267 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2268 "い。"
2269
2270 #. type: Plain text
2271 #: build/C/man2/getsockname.2:88
2272 msgid "I<addrlen> is invalid (e.g., is negative)."
2273 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2274
2275 #. type: TP
2276 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2277 #: build/C/man2/send.2:335
2278 #, no-wrap
2279 msgid "B<ENOBUFS>"
2280 msgstr "B<ENOBUFS>"
2281
2282 #. type: Plain text
2283 #: build/C/man2/getsockname.2:92
2284 msgid ""
2285 "Insufficient resources were available in the system to perform the operation."
2286 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2287
2288 #. type: Plain text
2289 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2290 msgid "The argument I<sockfd> is a file, not a socket."
2291 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2292
2293 #.  SVr4 documents additional ENOMEM
2294 #.  and ENOSR error codes.
2295 #. type: Plain text
2296 #: build/C/man2/getsockname.2:103
2297 msgid ""
2298 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2299 "POSIX.1-2001."
2300 msgstr ""
2301 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2302
2303 #. type: Plain text
2304 #: build/C/man2/getsockname.2:114
2305 msgid ""
2306 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2307 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2308 "resulted in the present I<socklen_t>, also used by glibc.  See also B<accept>"
2309 "(2)."
2310 msgstr "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関して、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2311
2312 #. type: Plain text
2313 #: build/C/man2/getsockname.2:121
2314 msgid ""
2315 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2316 "(7)"
2317 msgstr ""
2318 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2319 "(7)"
2320
2321 #. type: TH
2322 #: build/C/man2/getsockopt.2:44
2323 #, no-wrap
2324 msgid "GETSOCKOPT"
2325 msgstr "GETSOCKOPT"
2326
2327 #. type: Plain text
2328 #: build/C/man2/getsockopt.2:47
2329 msgid "getsockopt, setsockopt - get and set options on sockets"
2330 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2331
2332 #. type: Plain text
2333 #: build/C/man2/getsockopt.2:57
2334 #, no-wrap
2335 msgid ""
2336 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2337 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2338 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2339 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2340 msgstr ""
2341 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2342 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2343 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2344 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2345
2346 #. type: Plain text
2347 #: build/C/man2/getsockopt.2:67
2348 msgid ""
2349 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2350 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2351 "protocol levels; they are always present at the uppermost socket level."
2352 msgstr ""
2353 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2354 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2355 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2356 "定される。"
2357
2358 #. type: Plain text
2359 #: build/C/man2/getsockopt.2:86
2360 msgid ""
2361 "When manipulating socket options, the level at which the option resides and "
2362 "the name of the option must be specified.  To manipulate options at the "
2363 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2364 "options at any other level the protocol number of the appropriate protocol "
2365 "controlling the option is supplied.  For example, to indicate that an option "
2366 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2367 "protocol number of B<TCP>; see B<getprotoent>(3)."
2368 msgstr ""
2369 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2370 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2371 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2372 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2373 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2374 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2375 "B<getprotoent>(3)  を参照すること。"
2376
2377 #. type: Plain text
2378 #: build/C/man2/getsockopt.2:108
2379 msgid ""
2380 "The arguments I<optval> and I<optlen> are used to access option values for "
2381 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2382 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2383 "I<optlen> is a value-result argument, initially containing the size of the "
2384 "buffer pointed to by I<optval>, and modified on return to indicate the "
2385 "actual size of the value returned.  If no option value is to be supplied or "
2386 "returned, I<optval> may be NULL."
2387 msgstr ""
2388 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2389 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2390 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2391 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2392 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2393 "I<optval> は NULL でも良い。"
2394
2395 #. type: Plain text
2396 #: build/C/man2/getsockopt.2:118
2397 msgid ""
2398 "I<Optname> and any specified options are passed uninterpreted to the "
2399 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2400 "socket.hE<gt>> contains definitions for socket level options, described "
2401 "below.  Options at other protocol levels vary in format and name; consult "
2402 "the appropriate entries in section 4 of the manual."
2403 msgstr ""
2404 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2405 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2406 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2407 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2408 "ること。"
2409
2410 #. type: Plain text
2411 #: build/C/man2/getsockopt.2:127
2412 msgid ""
2413 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2414 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2415 "or zero if the option is to be disabled."
2416 msgstr ""
2417 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2418 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2419 "を指定し、 無効(disable)にするにはゼロを指定する。"
2420
2421 #. type: Plain text
2422 #: build/C/man2/getsockopt.2:131
2423 msgid ""
2424 "For a description of the available socket options see B<socket>(7)  and the "
2425 "appropriate protocol man pages."
2426 msgstr ""
2427 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2428 "ルの man ページを参照のこと。"
2429
2430 #. type: Plain text
2431 #: build/C/man2/getsockopt.2:152
2432 msgid ""
2433 "The address pointed to by I<optval> is not in a valid part of the process "
2434 "address space.  For B<getsockopt>(), this error may also be returned if "
2435 "I<optlen> is not in a valid part of the process address space."
2436 msgstr ""
2437 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2438 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2439 "い場合にもこのエラーが返される。"
2440
2441 #. type: Plain text
2442 #: build/C/man2/getsockopt.2:163
2443 msgid ""
2444 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2445 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2446 "option described in B<ip>(7))."
2447 msgstr ""
2448 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2449 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2450 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2451
2452 #. type: TP
2453 #: build/C/man2/getsockopt.2:163
2454 #, no-wrap
2455 msgid "B<ENOPROTOOPT>"
2456 msgstr "B<ENOPROTOOPT>"
2457
2458 #. type: Plain text
2459 #: build/C/man2/getsockopt.2:166
2460 msgid "The option is unknown at the level indicated."
2461 msgstr "指定された層(level)にはこのオプションは存在しない。"
2462
2463 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2464 #.  not document the
2465 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2466 #.  options
2467 #. type: Plain text
2468 #: build/C/man2/getsockopt.2:178
2469 msgid ""
2470 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2471 msgstr ""
2472 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2473 "POSIX.1-2001."
2474
2475 #. type: Plain text
2476 #: build/C/man2/getsockopt.2:199
2477 msgid ""
2478 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2479 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2480 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2481 "glibc.  See also B<accept>(2)."
2482 msgstr ""
2483 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2484 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2485 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2486 "る。 B<accept>(2)  も参照のこと。"
2487
2488 #. type: Plain text
2489 #: build/C/man2/getsockopt.2:202
2490 msgid ""
2491 "Several of the socket options should be handled at lower levels of the "
2492 "system."
2493 msgstr ""
2494 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2495
2496 #. type: Plain text
2497 #: build/C/man2/getsockopt.2:210
2498 msgid ""
2499 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2500 "B<tcp>(7), B<unix>(7)"
2501 msgstr ""
2502 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2503 "B<tcp>(7), B<unix>(7)"
2504
2505 #. type: TH
2506 #: build/C/man3/if_nameindex.3:26
2507 #, no-wrap
2508 msgid "IF_NAMEINDEX"
2509 msgstr "IF_NAMEINDEX"
2510
2511 #. type: TH
2512 #: build/C/man3/if_nameindex.3:26
2513 #, no-wrap
2514 msgid "2012-11-21"
2515 msgstr "2012-11-21"
2516
2517 #. type: Plain text
2518 #: build/C/man3/if_nameindex.3:29
2519 msgid ""
2520 "if_nameindex, if_freenameindex - get network interface names and indexes"
2521 msgstr ""
2522 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2523 "クスを取得する"
2524
2525 #. type: Plain text
2526 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2527 #, no-wrap
2528 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2529 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2530
2531 #. type: Plain text
2532 #: build/C/man3/if_nameindex.3:35
2533 #, no-wrap
2534 msgid ""
2535 "B<struct if_nameindex *if_nameindex(void);>\n"
2536 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2537 msgstr ""
2538 "B<struct if_nameindex *if_nameindex(void);>\n"
2539 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2540
2541 #. type: Plain text
2542 #: build/C/man3/if_nameindex.3:46
2543 msgid ""
2544 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2545 "structures, each containing information about one of the network interfaces "
2546 "on the local system.  The I<if_nameindex> structure contains at least the "
2547 "following entries:"
2548 msgstr ""
2549 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2550 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2551 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2552
2553 #. type: Plain text
2554 #: build/C/man3/if_nameindex.3:51
2555 #, no-wrap
2556 msgid ""
2557 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2558 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2559 msgstr ""
2560 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2561 "    char        *if_name;  /* NULL 終端された名前 (\"eth0\" など) */\n"
2562
2563 #. type: Plain text
2564 #: build/C/man3/if_nameindex.3:65
2565 msgid ""
2566 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2567 "points to the null-terminated interface name.  The end of the array is "
2568 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2569 msgstr ""
2570 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2571 "フィールドは NULL 終端されたインターフェース名を指す。 配列の最後は、 "
2572 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2573
2574 #. type: Plain text
2575 #: build/C/man3/if_nameindex.3:71
2576 msgid ""
2577 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2578 "and should be freed using B<if_freenameindex>()  when no longer needed."
2579 msgstr ""
2580 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2581 "は B<if_freenameindex>() で解放すべきである。"
2582
2583 #. type: Plain text
2584 #: build/C/man3/if_nameindex.3:78
2585 msgid ""
2586 "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2587 "NULL pointer is returned, and I<errno> is set appropriately."
2588 msgstr ""
2589 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2590 "NULL ポインタが返され、 I<errno> が適切に設定される。"
2591
2592 #. type: Plain text
2593 #: build/C/man3/if_nameindex.3:83
2594 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2595 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2596
2597 #. type: Plain text
2598 #: build/C/man3/if_nameindex.3:86
2599 msgid "Insufficient resources available."
2600 msgstr "利用可能なリソースが十分にない。"
2601
2602 #. type: Plain text
2603 #: build/C/man3/if_nameindex.3:97
2604 msgid ""
2605 "B<if_nameindex>()  may also fail for any of the errors specified for "
2606 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2607 "B<sendto>(2), or B<malloc>(3)."
2608 msgstr ""
2609 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>"
2610 "(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定されているエラーの"
2611 "いずれかで失敗する場合がある。"
2612
2613 #. type: Plain text
2614 #: build/C/man3/if_nameindex.3:104
2615 msgid ""
2616 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2617 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2618 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2619 "available only on kernels that support netlink."
2620 msgstr ""
2621 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2622 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2623 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2624 "netlink をサポートするカーネルにおいてのみである。"
2625
2626 #. type: Plain text
2627 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2628 msgid "RFC\\ 3493, POSIX.1-2001."
2629 msgstr "RFC\\ 3493, POSIX.1-2001."
2630
2631 #. type: Plain text
2632 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2633 msgid "This function first appeared in BSDi."
2634 msgstr "この関数は BSDi 初めて登場した。"
2635
2636 #. type: Plain text
2637 #: build/C/man3/if_nameindex.3:112
2638 msgid ""
2639 "The program below demonstrates the use of the functions described on this "
2640 "page.  An example of the output this program might produce is the following:"
2641 msgstr ""
2642 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2643 "ムが生成する出力は以下のようになる。"
2644
2645 #. type: Plain text
2646 #: build/C/man3/if_nameindex.3:118
2647 #, no-wrap
2648 msgid ""
2649 "$ B<./a.out>I<\n"
2650 "1: lo\n"
2651 "2: wlan0\n"
2652 "3: em1>\n"
2653 msgstr ""
2654 "$ B<./a.out>I<\n"
2655 "1: lo\n"
2656 "2: wlan0\n"
2657 "3: em1>\n"
2658
2659 #. type: Plain text
2660 #: build/C/man3/if_nameindex.3:126
2661 #, no-wrap
2662 msgid ""
2663 "#include E<lt>net/if.hE<gt>\n"
2664 "#include E<lt>stdio.hE<gt>\n"
2665 "#include E<lt>stdlib.hE<gt>\n"
2666 "#include E<lt>unistd.hE<gt>\n"
2667 msgstr ""
2668 "#include E<lt>net/if.hE<gt>\n"
2669 "#include E<lt>stdio.hE<gt>\n"
2670 "#include E<lt>stdlib.hE<gt>\n"
2671 "#include E<lt>unistd.hE<gt>\n"
2672
2673 #. type: Plain text
2674 #: build/C/man3/if_nameindex.3:131
2675 #, no-wrap
2676 msgid ""
2677 "int\n"
2678 "main(int argc, char *argv[])\n"
2679 "{\n"
2680 "    struct if_nameindex *if_ni, *i;\n"
2681 msgstr ""
2682 "int\n"
2683 "main(int argc, char *argv[])\n"
2684 "{\n"
2685 "    struct if_nameindex *if_ni, *i;\n"
2686
2687 #. type: Plain text
2688 #: build/C/man3/if_nameindex.3:137
2689 #, no-wrap
2690 msgid ""
2691 "    if_ni = if_nameindex();\n"
2692 "    if (if_ni == NULL) {\n"
2693 "        perror(\"if_nameindex\");\n"
2694 "        exit(EXIT_FAILURE);\n"
2695 "    }\n"
2696 msgstr ""
2697 "    if_ni = if_nameindex();\n"
2698 "    if (if_ni == NULL) {\n"
2699 "        perror(\"if_nameindex\");\n"
2700 "        exit(EXIT_FAILURE);\n"
2701 "    }\n"
2702
2703 #. type: Plain text
2704 #: build/C/man3/if_nameindex.3:140
2705 #, no-wrap
2706 msgid ""
2707 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2708 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2709 msgstr ""
2710 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2711 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2712
2713 #. type: Plain text
2714 #: build/C/man3/if_nameindex.3:142
2715 #, no-wrap
2716 msgid "    if_freenameindex(if_ni);\n"
2717 msgstr "    if_freenameindex(if_ni);\n"
2718
2719 #. type: Plain text
2720 #: build/C/man3/if_nameindex.3:145 build/C/man2/select.2:573
2721 #, no-wrap
2722 msgid ""
2723 "    exit(EXIT_SUCCESS);\n"
2724 "}\n"
2725 msgstr ""
2726 "    exit(EXIT_SUCCESS);\n"
2727 "}\n"
2728
2729 #. type: Plain text
2730 #: build/C/man3/if_nameindex.3:153
2731 msgid ""
2732 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2733 "B<if_nametoindex>(3), B<ifconfig>(8)"
2734 msgstr ""
2735 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2736 "B<if_nametoindex>(3), B<ifconfig>(8)"
2737
2738 #. type: TH
2739 #: build/C/man3/if_nametoindex.3:25
2740 #, no-wrap
2741 msgid "IF_NAMETOINDEX"
2742 msgstr "IF_NAMETOINDEX"
2743
2744 #. type: TH
2745 #: build/C/man3/if_nametoindex.3:25
2746 #, no-wrap
2747 msgid "2012-12-14"
2748 msgstr "2012-12-14"
2749
2750 #. type: Plain text
2751 #: build/C/man3/if_nametoindex.3:29
2752 msgid ""
2753 "if_nametoindex, if_indextoname - mappings between network interface names "
2754 "and indexes"
2755 msgstr ""
2756 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2757 "クスのマッピングを行う"
2758
2759 #. type: Plain text
2760 #: build/C/man3/if_nametoindex.3:34
2761 #, no-wrap
2762 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2763 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2764
2765 #. type: Plain text
2766 #: build/C/man3/if_nametoindex.3:36
2767 #, no-wrap
2768 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2769 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2770
2771 #. type: Plain text
2772 #: build/C/man3/if_nametoindex.3:43
2773 msgid ""
2774 "The B<if_nametoindex>()  function returns the index of the network interface "
2775 "corresponding to the name I<ifname>."
2776 msgstr ""
2777 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2778 "のインデックスを返す。"
2779
2780 #. type: Plain text
2781 #: build/C/man3/if_nametoindex.3:54
2782 msgid ""
2783 "The B<if_indextoname>()  function returns the name of the network interface "
2784 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2785 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2786 "least B<IF_NAMESIZE> bytes."
2787 msgstr ""
2788 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2789 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2790 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2791 "る。"
2792
2793 #. type: Plain text
2794 #: build/C/man3/if_nametoindex.3:61
2795 msgid ""
2796 "On success, B<if_nametoindex>()  returns the index number of the network "
2797 "interface; on error, 0 is returned and I<errno> is set appropriately."
2798 msgstr ""
2799 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2800 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2801
2802 #. type: Plain text
2803 #: build/C/man3/if_nametoindex.3:69
2804 msgid ""
2805 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2806 "returned and I<errno> is set appropriately."
2807 msgstr ""
2808 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2809 "が返され、 I<errno> が適切に設定される。"
2810
2811 #. type: Plain text
2812 #: build/C/man3/if_nametoindex.3:74
2813 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2814 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2815
2816 #. type: TP
2817 #: build/C/man3/if_nametoindex.3:74
2818 #, no-wrap
2819 msgid "B<ENXIO>"
2820 msgstr "B<ENXIO>"
2821
2822 #. type: Plain text
2823 #: build/C/man3/if_nametoindex.3:77
2824 msgid "No interface found for the index."
2825 msgstr "インデックスに対応するインターフェースがない。"
2826
2827 #. type: Plain text
2828 #: build/C/man3/if_nametoindex.3:85
2829 msgid ""
2830 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2831 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2832 msgstr ""
2833 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2834 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2835
2836 #. type: Plain text
2837 #: build/C/man3/if_nametoindex.3:93
2838 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2839 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2840
2841 #. type: TH
2842 #: build/C/man2/listen.2:45
2843 #, no-wrap
2844 msgid "LISTEN"
2845 msgstr "LISTEN"
2846
2847 #. type: TH
2848 #: build/C/man2/listen.2:45
2849 #, no-wrap
2850 msgid "2008-11-20"
2851 msgstr "2008-11-20"
2852
2853 #. type: Plain text
2854 #: build/C/man2/listen.2:48
2855 msgid "listen - listen for connections on a socket"
2856 msgstr "listen - ソケット(socket)上の接続を待つ"
2857
2858 #. type: Plain text
2859 #: build/C/man2/listen.2:55
2860 #, no-wrap
2861 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2862 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2863
2864 #. type: Plain text
2865 #: build/C/man2/listen.2:63
2866 msgid ""
2867 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2868 "that is, as a socket that will be used to accept incoming connection "
2869 "requests using B<accept>(2)."
2870 msgstr ""
2871 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2872 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2873 "した接続要求を受け付けるのに使用されるソケットである。"
2874
2875 #. type: Plain text
2876 #: build/C/man2/listen.2:70
2877 msgid ""
2878 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2879 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2880 msgstr ""
2881 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2882 "するファイルディスクリプタである。"
2883
2884 #. type: Plain text
2885 #: build/C/man2/listen.2:82
2886 msgid ""
2887 "The I<backlog> argument defines the maximum length to which the queue of "
2888 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2889 "when the queue is full, the client may receive an error with an indication "
2890 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2891 "the request may be ignored so that a later reattempt at connection succeeds."
2892 msgstr ""
2893 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2894 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2895 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2896 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2897 "い。"
2898
2899 #. type: Plain text
2900 #: build/C/man2/listen.2:91
2901 msgid "Another socket is already listening on the same port."
2902 msgstr "別のソケットが既に同じポートを listen している。"
2903
2904 #. type: Plain text
2905 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
2906 msgid "The argument I<sockfd> is not a socket."
2907 msgstr "引き数 I<sockfd> はソケットではない。"
2908
2909 #. type: Plain text
2910 #: build/C/man2/listen.2:106
2911 msgid "The socket is not of a type that supports the B<listen>()  operation."
2912 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2913
2914 #. type: Plain text
2915 #: build/C/man2/listen.2:111
2916 msgid ""
2917 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2918 "4.2BSD."
2919 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2920
2921 #. type: Plain text
2922 #: build/C/man2/listen.2:113
2923 msgid "To accept connections, the following steps are performed:"
2924 msgstr "接続を受け付けるには、以下の処理が実行される。"
2925
2926 #. type: TP
2927 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
2928 #, no-wrap
2929 msgid "1."
2930 msgstr "1."
2931
2932 #. type: Plain text
2933 #: build/C/man2/listen.2:117
2934 msgid "A socket is created with B<socket>(2)."
2935 msgstr "B<socket>(2)  でソケットを作成する。"
2936
2937 #. type: TP
2938 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
2939 #, no-wrap
2940 msgid "2."
2941 msgstr "2."
2942
2943 #. type: Plain text
2944 #: build/C/man2/listen.2:123
2945 msgid ""
2946 "The socket is bound to a local address using B<bind>(2), so that other "
2947 "sockets may be B<connect>(2)ed to it."
2948 msgstr ""
2949 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2950 "のソケットに B<connect>(2)  できるようにする。"
2951
2952 #. type: TP
2953 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
2954 #, no-wrap
2955 msgid "3."
2956 msgstr "3."
2957
2958 #. type: Plain text
2959 #: build/C/man2/listen.2:127
2960 msgid ""
2961 "A willingness to accept incoming connections and a queue limit for incoming "
2962 "connections are specified with B<listen>()."
2963 msgstr ""
2964 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2965 "定する。"
2966
2967 #. type: TP
2968 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
2969 #, no-wrap
2970 msgid "4."
2971 msgstr "4."
2972
2973 #. type: Plain text
2974 #: build/C/man2/listen.2:130
2975 msgid "Connections are accepted with B<accept>(2)."
2976 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2977
2978 #. type: Plain text
2979 #: build/C/man2/listen.2:153
2980 msgid ""
2981 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2982 "2.2.  Now it specifies the queue length for I<completely> established "
2983 "sockets waiting to be accepted, instead of the number of incomplete "
2984 "connection requests.  The maximum length of the queue for incomplete sockets "
2985 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2986 "are enabled there is no logical maximum length and this setting is ignored.  "
2987 "See B<tcp>(7)  for more information."
2988 msgstr ""
2989 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2990 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2991 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2992 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2993 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2994 "論理的な最大長は存在せず、この設定は無視される。"
2995
2996 #.  The following is now rather historic information (MTK, Jun 05)
2997 #.  Don't rely on this value in portable applications since BSD
2998 #.  (and some BSD-derived systems) limit the backlog to 5.
2999 #. type: Plain text
3000 #: build/C/man2/listen.2:166
3001 msgid ""
3002 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3003 "somaxconn>, then it is silently truncated to that value; the default value "
3004 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3005 "value, B<SOMAXCONN>, with the value 128."
3006 msgstr ""
3007 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3008 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3009 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3010 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3011
3012 #. type: Plain text
3013 #: build/C/man2/listen.2:175
3014 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3015 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3016
3017 #. type: TH
3018 #: build/C/man2/recv.2:41
3019 #, no-wrap
3020 msgid "RECV"
3021 msgstr "RECV"
3022
3023 #. type: TH
3024 #: build/C/man2/recv.2:41
3025 #, no-wrap
3026 msgid "2013-04-19"
3027 msgstr "2013-04-19"
3028
3029 #. type: Plain text
3030 #: build/C/man2/recv.2:44
3031 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3032 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3033
3034 #. type: Plain text
3035 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3036 #: build/C/man2/select_tut.2:47
3037 #, no-wrap
3038 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3039 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3040
3041 #. type: Plain text
3042 #: build/C/man2/recv.2:53
3043 #, no-wrap
3044 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3045 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3046
3047 #. type: Plain text
3048 #: build/C/man2/recv.2:56
3049 #, no-wrap
3050 msgid ""
3051 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3052 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3053 msgstr ""
3054 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3055 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3056
3057 #. type: Plain text
3058 #: build/C/man2/recv.2:58
3059 #, no-wrap
3060 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3061 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3062
3063 #. type: Plain text
3064 #: build/C/man2/recv.2:66
3065 msgid ""
3066 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
3067 "a socket, and may be used to receive data on a socket whether or not it is "
3068 "connection-oriented."
3069 msgstr ""
3070 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3071 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3072 "接続指向 (connection-oriened) であってもなくてもよい。"
3073
3074 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3075 #.  .I src_addr
3076 #.  is filled in.
3077 #.  .I src_addr
3078 #.  is also filled in for stream sockets in the UNIX domain, but is not
3079 #.  filled in for stream sockets in the Internet domain.)
3080 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3081 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3082 #. type: Plain text
3083 #: build/C/man2/recv.2:95
3084 msgid ""
3085 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3086 "address, this source address is filled in.  When I<src_addr> is NULL, "
3087 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
3088 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
3089 "caller should initialize before the call to the size of the buffer "
3090 "associated with I<src_addr>, and modified on return to indicate the actual "
3091 "size of the source address.  The returned address is truncated if the buffer "
3092 "provided is too small; in this case, I<addrlen> will return a value greater "
3093 "than was supplied to the call."
3094 msgstr ""
3095 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3096 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3097 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3098 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3099 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3100 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3101 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3102 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3103 "な値が返される。"
3104
3105 #. type: Plain text
3106 #: build/C/man2/recv.2:107
3107 msgid ""
3108 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3109 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
3110 "argument."
3111 msgstr ""
3112 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3113 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3114 "()  と等価である。"
3115
3116 #. type: Plain text
3117 #: build/C/man2/recv.2:113
3118 msgid ""
3119 "All three routines return the length of the message on successful "
3120 "completion.  If a message is too long to fit in the supplied buffer, excess "
3121 "bytes may be discarded depending on the type of socket the message is "
3122 "received from."
3123 msgstr ""
3124 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3125 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3126 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3127
3128 #. type: Plain text
3129 #: build/C/man2/recv.2:123
3130 msgid ""
3131 "If no messages are available at the socket, the receive calls wait for a "
3132 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3133 "which case the value -1 is returned and the external variable I<errno> is "
3134 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3135 "data available, up to the requested amount, rather than waiting for receipt "
3136 "of the full amount requested."
3137 msgstr ""
3138 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3139 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3140 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3141 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3142 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3143 "る (受信されるデータの最大サイズは要求したサイズである)。"
3144
3145 #. type: Plain text
3146 #: build/C/man2/recv.2:129
3147 msgid ""
3148 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3149 "data arrives."
3150 msgstr ""
3151 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3152 "る。"
3153
3154 #. type: Plain text
3155 #: build/C/man2/recv.2:135
3156 msgid ""
3157 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
3158 "the following values:"
3159 msgstr ""
3160 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3161 "和 を取ったものを指定する:"
3162
3163 #. type: TP
3164 #: build/C/man2/recv.2:135
3165 #, no-wrap
3166 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3167 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3168
3169 #. type: Plain text
3170 #: build/C/man2/recv.2:146
3171 msgid ""
3172 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3173 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3174 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3175 "flag of B<open>(2)."
3176 msgstr ""
3177 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3178 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3179 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3180 "同じ理由で有用である。"
3181
3182 #. type: TP
3183 #: build/C/man2/recv.2:146 build/C/man2/send.2:188
3184 #, no-wrap
3185 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3186 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3187
3188 #. type: Plain text
3189 #: build/C/man2/recv.2:156
3190 msgid ""
3191 "Enables nonblocking operation; if the operation would block, the call fails "
3192 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3193 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3194 msgstr ""
3195 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3196 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3197 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3198
3199 #. type: TP
3200 #: build/C/man2/recv.2:156
3201 #, no-wrap
3202 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3203 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3204
3205 #. type: Plain text
3206 #: build/C/man2/recv.2:175
3207 msgid ""
3208 "This flag specifies that queued errors should be received from the socket "
3209 "error queue.  The error is passed in an ancillary message with a type "
3210 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3211 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3212 "information.  The payload of the original packet that caused the error is "
3213 "passed as normal data via I<msg_iovec>.  The original destination address of "
3214 "the datagram that caused the error is supplied via I<msg_name>."
3215 msgstr ""
3216 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3217 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3218 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3219 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3220 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3221 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3222 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3223 "I<msg_name> 経由で参照できる。"
3224
3225 #. type: Plain text
3226 #: build/C/man2/recv.2:187 build/C/man2/recv.2:250
3227 msgid ""
3228 "For local errors, no address is passed (this can be checked with the "
3229 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3230 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3231 "the pending socket error is regenerated based on the next queued error and "
3232 "will be passed on the next socket operation."
3233 msgstr ""
3234 "ローカルなエラーの場合はアドレスは渡されない\n"
3235 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3236 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3237 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3238 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3239
3240 #. type: Plain text
3241 #: build/C/man2/recv.2:191
3242 msgid "The error is supplied in a I<sock_extended_err> structure:"
3243 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3244
3245 #. type: Plain text
3246 #: build/C/man2/recv.2:198
3247 #, no-wrap
3248 msgid ""
3249 "#define SO_EE_ORIGIN_NONE    0\n"
3250 "#define SO_EE_ORIGIN_LOCAL   1\n"
3251 "#define SO_EE_ORIGIN_ICMP    2\n"
3252 "#define SO_EE_ORIGIN_ICMP6   3\n"
3253 msgstr ""
3254 "#define SO_EE_ORIGIN_NONE    0\n"
3255 "#define SO_EE_ORIGIN_LOCAL   1\n"
3256 "#define SO_EE_ORIGIN_ICMP    2\n"
3257 "#define SO_EE_ORIGIN_ICMP6   3\n"
3258
3259 #. type: Plain text
3260 #: build/C/man2/recv.2:210
3261 #, no-wrap
3262 msgid ""
3263 "struct sock_extended_err\n"
3264 "{\n"
3265 "    uint32_t ee_errno;   /* error number */\n"
3266 "    uint8_t  ee_origin;  /* where the error originated */\n"
3267 "    uint8_t  ee_type;    /* type */\n"
3268 "    uint8_t  ee_code;    /* code */\n"
3269 "    uint8_t  ee_pad;     /* padding */\n"
3270 "    uint32_t ee_info;    /* additional information */\n"
3271 "    uint32_t ee_data;    /* other data */\n"
3272 "    /* More data may follow */\n"
3273 "};\n"
3274 msgstr ""
3275 "struct sock_extended_err\n"
3276 "{\n"
3277 "    uint32_t ee_errno;   /* error number */\n"
3278 "    uint8_t  ee_origin;  /* where the error originated */\n"
3279 "    uint8_t  ee_type;    /* type */\n"
3280 "    uint8_t  ee_code;    /* code */\n"
3281 "    uint8_t  ee_pad;     /* padding */\n"
3282 "    uint32_t ee_info;    /* additional information */\n"
3283 "    uint32_t ee_data;    /* other data */\n"
3284 "    /* More data may follow */\n"
3285 "};\n"
3286
3287 #. type: Plain text
3288 #: build/C/man2/recv.2:212
3289 #, no-wrap
3290 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3291 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3292
3293 #. type: Plain text
3294 #: build/C/man2/recv.2:236
3295 msgid ""
3296 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3297 "is the origin code of where the error originated.  The other fields are "
3298 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3299 "address of the network object where the error originated from given a "
3300 "pointer to the ancillary message.  If this address is not known, the "
3301 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3302 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3303 "caused the error is passed as normal data."
3304 msgstr ""
3305 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3306 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3307 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3308 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3309 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3310 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3311 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3312 "される。"
3313
3314 #. type: TP
3315 #: build/C/man2/recv.2:250 build/C/man2/recv.2:381 build/C/man2/send.2:230
3316 #, no-wrap
3317 msgid "B<MSG_OOB>"
3318 msgstr "B<MSG_OOB>"
3319
3320 #. type: Plain text
3321 #: build/C/man2/recv.2:257
3322 msgid ""
3323 "This flag requests receipt of out-of-band data that would not be received in "
3324 "the normal data stream.  Some protocols place expedited data at the head of "
3325 "the normal data queue, and thus this flag cannot be used with such protocols."
3326 msgstr ""
3327 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3328 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3329 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3330 "い。"
3331
3332 #. type: TP
3333 #: build/C/man2/recv.2:257
3334 #, no-wrap
3335 msgid "B<MSG_PEEK>"
3336 msgstr "B<MSG_PEEK>"
3337
3338 #. type: Plain text
3339 #: build/C/man2/recv.2:264
3340 msgid ""
3341 "This flag causes the receive operation to return data from the beginning of "
3342 "the receive queue without removing that data from the queue.  Thus, a "
3343 "subsequent receive call will return the same data."
3344 msgstr ""
3345 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3346 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3347 "が返ることになる。"
3348
3349 #. type: TP
3350 #: build/C/man2/recv.2:264
3351 #, no-wrap
3352 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3353 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3354
3355 #. type: Plain text
3356 #: build/C/man2/recv.2:275
3357 msgid ""
3358 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3359 "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3360 "return the real length of the packet or datagram, even when it was longer "
3361 "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3362 "sockets."
3363 msgstr ""
3364 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3365 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3366 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3367 "場合にも、 パケットやデータグラムの実際の長さを返す。 UNIX ドメインソケット "
3368 "(B<unix>(7))  ソケットについては実装されていない。"
3369
3370 #. type: Plain text
3371 #: build/C/man2/recv.2:278
3372 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3373 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3374
3375 #. type: TP
3376 #: build/C/man2/recv.2:278
3377 #, no-wrap
3378 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3379 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3380
3381 #. type: Plain text
3382 #: build/C/man2/recv.2:285
3383 msgid ""
3384 "This flag requests that the operation block until the full request is "
3385 "satisfied.  However, the call may still return less data than requested if a "
3386 "signal is caught, an error or disconnect occurs, or the next data to be "
3387 "received is of a different type than that returned."
3388 msgstr ""
3389 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3390 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3391 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3392 "りデータが少なくても返ることがある。"
3393
3394 #. type: Plain text
3395 #: build/C/man2/recv.2:293
3396 msgid ""
3397 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3398 "directly supplied arguments.  This structure is defined as follows in "
3399 "I<E<lt>sys/socket.hE<gt>>:"
3400 msgstr ""
3401 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3402 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3403
3404 #. type: Plain text
3405 #: build/C/man2/recv.2:300
3406 #, no-wrap
3407 msgid ""
3408 "struct iovec {                    /* Scatter/gather array items */\n"
3409 "    void  *iov_base;              /* Starting address */\n"
3410 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3411 "};\n"
3412 msgstr ""
3413 "struct iovec {                    /* Scatter/gather array items */\n"
3414 "    void  *iov_base;              /* Starting address */\n"
3415 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3416 "};\n"
3417
3418 #. type: Plain text
3419 #: build/C/man2/recv.2:310 build/C/man2/send.2:258
3420 #, no-wrap
3421 msgid ""
3422 "struct msghdr {\n"
3423 "    void         *msg_name;       /* optional address */\n"
3424 "    socklen_t     msg_namelen;    /* size of address */\n"
3425 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3426 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3427 "    void         *msg_control;    /* ancillary data, see below */\n"
3428 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3429 "    int           msg_flags;      /* flags on received message */\n"
3430 "};\n"
3431 msgstr ""
3432 "struct msghdr {\n"
3433 "    void         *msg_name;       /* 追加のアドレス */\n"
3434 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3435 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3436 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3437 "    void         *msg_control;    /* 補助データ (後述) */\n"
3438 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3439 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3440 "};\n"
3441
3442 #. type: Plain text
3443 #: build/C/man2/recv.2:340
3444 msgid ""
3445 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3446 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3447 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3448 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3449 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3450 "other protocol control-related messages or miscellaneous ancillary data.  "
3451 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3452 "the available buffer in I<msg_control>; upon return from a successful call "
3453 "it will contain the length of the control message sequence."
3454 msgstr ""
3455 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3456 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3457 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3458 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3459 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3460 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3461 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3462 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3463 "さが入っている。"
3464
3465 #. type: Plain text
3466 #: build/C/man2/recv.2:342
3467 msgid "The messages are of the form:"
3468 msgstr "メッセージの形式は以下の通り:"
3469
3470 #. type: Plain text
3471 #: build/C/man2/recv.2:352
3472 #, no-wrap
3473 msgid ""
3474 "struct cmsghdr {\n"
3475 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3476 "    int           cmsg_level;   /* originating protocol */\n"
3477 "    int           cmsg_type;    /* protocol-specific type */\n"
3478 "/* followed by\n"
3479 "    unsigned char cmsg_data[]; */\n"
3480 "};\n"
3481 msgstr ""
3482 "struct cmsghdr {\n"
3483 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3484 "    int           cmsg_level;   /* originating protocol */\n"
3485 "    int           cmsg_type;    /* protocol-specific type */\n"
3486 "/* followed by\n"
3487 "    unsigned char cmsg_data[]; */\n"
3488 "};\n"
3489
3490 #. type: Plain text
3491 #: build/C/man2/recv.2:357
3492 msgid ""
3493 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3494 msgstr ""
3495 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3496
3497 #. type: Plain text
3498 #: build/C/man2/recv.2:360
3499 msgid ""
3500 "As an example, Linux uses this ancillary data mechanism to pass extended "
3501 "errors, IP options, or file descriptors over UNIX domain sockets."
3502 msgstr ""
3503 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3504 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3505 "いる。"
3506
3507 #. type: Plain text
3508 #: build/C/man2/recv.2:368
3509 msgid ""
3510 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3511 "It can contain several flags:"
3512 msgstr ""
3513 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3514 "れる。ここにはいくつかのフラグが入る。"
3515
3516 #. type: TP
3517 #: build/C/man2/recv.2:368
3518 #, no-wrap
3519 msgid "B<MSG_EOR>"
3520 msgstr "B<MSG_EOR>"
3521
3522 #. type: Plain text
3523 #: build/C/man2/recv.2:373
3524 msgid ""
3525 "indicates end-of-record; the data returned completed a record (generally "
3526 "used with sockets of type B<SOCK_SEQPACKET>)."
3527 msgstr ""
3528 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3529 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3530
3531 #. type: TP
3532 #: build/C/man2/recv.2:373
3533 #, no-wrap
3534 msgid "B<MSG_TRUNC>"
3535 msgstr "B<MSG_TRUNC>"
3536
3537 #. type: Plain text
3538 #: build/C/man2/recv.2:377
3539 msgid ""
3540 "indicates that the trailing portion of a datagram was discarded because the "
3541 "datagram was larger than the buffer supplied."
3542 msgstr ""
3543 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3544 "た部分が捨てられたことを示す。"
3545
3546 #. type: TP
3547 #: build/C/man2/recv.2:377
3548 #, no-wrap
3549 msgid "B<MSG_CTRUNC>"
3550 msgstr "B<MSG_CTRUNC>"
3551
3552 #. type: Plain text
3553 #: build/C/man2/recv.2:381
3554 msgid ""
3555 "indicates that some control data were discarded due to lack of space in the "
3556 "buffer for ancillary data."
3557 msgstr ""
3558 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3559 "を示す。"
3560
3561 #. type: Plain text
3562 #: build/C/man2/recv.2:384
3563 msgid ""
3564 "is returned to indicate that expedited or out-of-band data were received."
3565 msgstr "速達データや帯域外データを受信したことを示す。"
3566
3567 #. type: TP
3568 #: build/C/man2/recv.2:384
3569 #, no-wrap
3570 msgid "B<MSG_ERRQUEUE>"
3571 msgstr "B<MSG_ERRQUEUE>"
3572
3573 #. type: Plain text
3574 #: build/C/man2/recv.2:388
3575 msgid ""
3576 "indicates that no data was received but an extended error from the socket "
3577 "error queue."
3578 msgstr ""
3579 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3580 "を示す。"
3581
3582 #. type: Plain text
3583 #: build/C/man2/recv.2:396
3584 msgid ""
3585 "These calls return the number of bytes received, or -1 if an error "
3586 "occurred.  In the event of an error, I<errno> is set to indicate the error.  "
3587 "The return value will be 0 when the peer has performed an orderly shutdown."
3588 msgstr "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> にエラーを示す値を設定する。  接続先が正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3589
3590 #. type: Plain text
3591 #: build/C/man2/recv.2:401
3592 msgid ""
3593 "These are some standard errors generated by the socket layer.  Additional "
3594 "errors may be generated and returned from the underlying protocol modules; "
3595 "see their manual pages."
3596 msgstr ""
3597 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3598 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3599 "ること。"
3600
3601 #.  Actually EAGAIN on Linux
3602 #. type: Plain text
3603 #: build/C/man2/recv.2:410
3604 msgid ""
3605 "The socket is marked nonblocking and the receive operation would block, or a "
3606 "receive timeout had been set and the timeout expired before data was "
3607 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3608 "and does not require these constants to have the same value, so a portable "
3609 "application should check for both possibilities."
3610 msgstr ""
3611 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3612 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3613 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3614 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3615 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3616
3617 #. type: Plain text
3618 #: build/C/man2/recv.2:415
3619 msgid "The argument I<sockfd> is an invalid descriptor."
3620 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3621
3622 #. type: Plain text
3623 #: build/C/man2/recv.2:419
3624 msgid ""
3625 "A remote host refused to allow the network connection (typically because it "
3626 "is not running the requested service)."
3627 msgstr ""
3628 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3629 "たサービスが起動されていないなどがある)。"
3630
3631 #. type: Plain text
3632 #: build/C/man2/recv.2:423
3633 msgid ""
3634 "The receive buffer pointer(s) point outside the process's address space."
3635 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3636
3637 #. type: Plain text
3638 #: build/C/man2/recv.2:428
3639 msgid ""
3640 "The receive was interrupted by delivery of a signal before any data were "
3641 "available; see B<signal>(7)."
3642 msgstr ""
3643 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3644
3645 #. type: Plain text
3646 #: build/C/man2/recv.2:432 build/C/man2/send.2:323
3647 msgid "Invalid argument passed."
3648 msgstr "不正な引き数が渡された。"
3649
3650 #. type: Plain text
3651 #: build/C/man2/recv.2:436
3652 msgid "Could not allocate memory for B<recvmsg>()."
3653 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3654
3655 #. type: TP
3656 #: build/C/man2/recv.2:436 build/C/man2/send.2:346
3657 #, no-wrap
3658 msgid "B<ENOTCONN>"
3659 msgstr "B<ENOTCONN>"
3660
3661 #. type: Plain text
3662 #: build/C/man2/recv.2:443
3663 msgid ""
3664 "The socket is associated with a connection-oriented protocol and has not "
3665 "been connected (see B<connect>(2)  and B<accept>(2))."
3666 msgstr ""
3667 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3668 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3669
3670 #. type: Plain text
3671 #: build/C/man2/recv.2:448
3672 msgid "The argument I<sockfd> does not refer to a socket."
3673 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3674
3675 #. type: Plain text
3676 #: build/C/man2/recv.2:451
3677 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3678 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3679
3680 #. type: Plain text
3681 #: build/C/man2/recv.2:458
3682 msgid ""
3683 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3684 "flags."
3685 msgstr ""
3686 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3687 "されている。"
3688
3689 #. type: Plain text
3690 #: build/C/man2/recv.2:474
3691 msgid ""
3692 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3693 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3694 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3695 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3696 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3697 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3698 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3699 msgstr ""
3700 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3701 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3702 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3703 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3704 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3705 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3706 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3707
3708 #.  glibc bug raised 12 Mar 2006
3709 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3710 #.  The problem is an underlying kernel issue: the size of the
3711 #.  __kernel_size_t type used to type this field varies
3712 #.  across architectures, but socklen_t is always 32 bits.
3713 #. type: Plain text
3714 #: build/C/man2/recv.2:488 build/C/man2/send.2:409
3715 msgid ""
3716 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3717 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3718 "I<size_t>."
3719 msgstr ""
3720 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3721 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3722 "ある。"
3723
3724 #. type: Plain text
3725 #: build/C/man2/recv.2:493
3726 msgid ""
3727 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3728 "can be used to receive multiple datagrams in a single call."
3729 msgstr ""
3730 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3731 "固有の システムコールに関する情報が書かれている。"
3732
3733 #. type: Plain text
3734 #: build/C/man2/recv.2:498
3735 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3736 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3737
3738 #. type: Plain text
3739 #: build/C/man2/recv.2:509
3740 msgid ""
3741 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3742 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3743 msgstr ""
3744 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3745 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3746
3747 #. type: TH
3748 #: build/C/man2/recvmmsg.2:31
3749 #, no-wrap
3750 msgid "RECVMMSG"
3751 msgstr "RECVMMSG"
3752
3753 #. type: TH
3754 #: build/C/man2/recvmmsg.2:31
3755 #, no-wrap
3756 msgid "2012-12-24"
3757 msgstr "2012-12-24"
3758
3759 #. type: Plain text
3760 #: build/C/man2/recvmmsg.2:34
3761 msgid "recvmmsg - receive multiple messages on a socket"
3762 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
3763
3764 #. type: Plain text
3765 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3766 #, no-wrap
3767 msgid ""
3768 "B<#define _GNU_SOURCE>\n"
3769 "B<#include E<lt>sys/socket.hE<gt>>\n"
3770 msgstr ""
3771 "B<#define _GNU_SOURCE>\n"
3772 "B<#include E<lt>sys/socket.hE<gt>>\n"
3773
3774 #. type: Plain text
3775 #: build/C/man2/recvmmsg.2:41
3776 #, no-wrap
3777 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3778 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3779
3780 #. type: Plain text
3781 #: build/C/man2/recvmmsg.2:43
3782 #, no-wrap
3783 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3784 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3785
3786 #. type: Plain text
3787 #: build/C/man2/recvmmsg.2:55
3788 msgid ""
3789 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3790 "the caller to receive multiple messages from a socket using a single system "
3791 "call.  (This has performance benefits for some applications.)  A further "
3792 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3793 "operation."
3794 msgstr ""
3795 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
3796 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
3797 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
3798 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
3799
3800 #. type: Plain text
3801 #: build/C/man2/recvmmsg.2:59
3802 msgid ""
3803 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3804 "from."
3805 msgstr ""
3806 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
3807
3808 #. type: Plain text
3809 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
3810 msgid ""
3811 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3812 "The size of this array is specified in I<vlen>."
3813 msgstr ""
3814 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
3815 "I<vlen> で指定する。"
3816
3817 #. type: Plain text
3818 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
3819 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3820 msgstr ""
3821 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
3822
3823 #. type: Plain text
3824 #: build/C/man2/recvmmsg.2:80
3825 #, no-wrap
3826 msgid ""
3827 "struct mmsghdr {\n"
3828 "    struct msghdr msg_hdr;  /* Message header */\n"
3829 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3830 "};\n"
3831 msgstr ""
3832 "struct mmsghdr {\n"
3833 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
3834 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
3835 "};\n"
3836
3837 #. type: Plain text
3838 #: build/C/man2/recvmmsg.2:95
3839 msgid ""
3840 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3841 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3842 "in the entry.  This field has the same value as the return value of a single "
3843 "B<recvmsg>(2)  on the header."
3844 msgstr ""
3845 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
3846 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
3847 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
3848 "る。"
3849
3850 #. type: Plain text
3851 #: build/C/man2/recvmmsg.2:102
3852 msgid ""
3853 "The I<flags> argument contains flags ORed together.  The flags are the same "
3854 "as documented for B<recvmsg>(2), with the following addition:"
3855 msgstr ""
3856 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
3857 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
3858
3859 #. type: TP
3860 #: build/C/man2/recvmmsg.2:102
3861 #, no-wrap
3862 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
3863 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
3864
3865 #. type: Plain text
3866 #: build/C/man2/recvmmsg.2:107
3867 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3868 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
3869
3870 #. type: Plain text
3871 #: build/C/man2/recvmmsg.2:123
3872 msgid ""
3873 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3874 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3875 "operation.  (This interval will be rounded up to the system clock "
3876 "granularity, and kernel scheduling delays mean that the blocking interval "
3877 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
3878 "blocks indefinitely."
3879 msgstr ""
3880 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
3881 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (待ち時間は"
3882 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延により少"
3883 "しだけ長くなる可能性がある)。 I<timeout>が I<NULL> の場合、 受信操作は無期限"
3884 "に停止 (block) する。"
3885
3886 #. type: Plain text
3887 #: build/C/man2/recvmmsg.2:134
3888 msgid ""
3889 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3890 "received or until the timeout expires.  A nonblocking call reads as many "
3891 "messages as are available (up to the limit specified by I<vlen>)  and "
3892 "returns immediately."
3893 msgstr ""
3894 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
3895 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
3896 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
3897 "すぐに返る。"
3898
3899 #. type: Plain text
3900 #: build/C/man2/recvmmsg.2:149
3901 msgid ""
3902 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3903 "to contain information about each received message: I<msg_len> contains the "
3904 "size of the received message; the subfields of I<msg_hdr> are updated as "
3905 "described in B<recvmsg>(2).  The return value of the call indicates the "
3906 "number of elements of I<msgvec> that have been updated."
3907 msgstr ""
3908 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
3909 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
3910 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
3911 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
3912 "数である。"
3913
3914 #. type: Plain text
3915 #: build/C/man2/recvmmsg.2:157
3916 msgid ""
3917 "On success, B<recvmmsg>()  returns the number of messages received in "
3918 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3919 "error."
3920 msgstr ""
3921 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
3922 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
3923
3924 #. type: Plain text
3925 #: build/C/man2/recvmmsg.2:161
3926 msgid ""
3927 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3928 msgstr ""
3929 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
3930 "がある。"
3931
3932 #. type: Plain text
3933 #: build/C/man2/recvmmsg.2:165
3934 msgid "I<timeout> is invalid."
3935 msgstr "I<timeout> が無効である。"
3936
3937 #. type: Plain text
3938 #: build/C/man2/recvmmsg.2:170
3939 msgid ""
3940 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
3941 "was added in version 2.12."
3942 msgstr ""
3943 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
3944 "はバージョン 2.12 以降で利用可能である。"
3945
3946 #. type: Plain text
3947 #: build/C/man2/recvmmsg.2:173
3948 msgid "B<recvmmsg>()  is Linux-specific."
3949 msgstr "B<recvmmsg>() は Linux 固有である。"
3950
3951 #. type: Plain text
3952 #: build/C/man2/recvmmsg.2:181
3953 msgid ""
3954 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
3955 "socket and stores them in multiple buffers.  The call returns if all buffers "
3956 "are filled or if the timeout specified has expired."
3957 msgstr ""
3958 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
3959 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
3960 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
3961
3962 #. type: Plain text
3963 #: build/C/man2/recvmmsg.2:184
3964 msgid ""
3965 "The following snippet periodically generates UDP datagrams containing a "
3966 "random number:"
3967 msgstr ""
3968 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
3969 "る。"
3970
3971 #. type: Plain text
3972 #: build/C/man2/recvmmsg.2:189
3973 #, no-wrap
3974 msgid ""
3975 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
3976 "B<sleep 0.25; done>\n"
3977 msgstr ""
3978 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
3979 "B<sleep 0.25; done>\n"
3980
3981 #. type: Plain text
3982 #: build/C/man2/recvmmsg.2:194
3983 msgid ""
3984 "These datagrams are read by the example application, which can give the "
3985 "following output:"
3986 msgstr ""
3987 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
3988 "が得られる。"
3989
3990 #. type: Plain text
3991 #: build/C/man2/recvmmsg.2:204
3992 #, no-wrap
3993 msgid ""
3994 "$B< ./a.out>\n"
3995 "5 messages received\n"
3996 "1 11782\n"
3997 "2 11345\n"
3998 "3 304\n"
3999 "4 13514\n"
4000 "5 28421\n"
4001 msgstr ""
4002 "$B< ./a.out>\n"
4003 "5 messages received\n"
4004 "1 11782\n"
4005 "2 11345\n"
4006 "3 304\n"
4007 "4 13514\n"
4008 "5 28421\n"
4009
4010 #. type: Plain text
4011 #: build/C/man2/recvmmsg.2:215
4012 #, no-wrap
4013 msgid ""
4014 "#define _GNU_SOURCE\n"
4015 "#include E<lt>netinet/ip.hE<gt>\n"
4016 "#include E<lt>stdio.hE<gt>\n"
4017 "#include E<lt>stdlib.hE<gt>\n"
4018 "#include E<lt>string.hE<gt>\n"
4019 "#include E<lt>sys/socket.hE<gt>\n"
4020 msgstr ""
4021 "#define _GNU_SOURCE\n"
4022 "#include E<lt>netinet/ip.hE<gt>\n"
4023 "#include E<lt>stdio.hE<gt>\n"
4024 "#include E<lt>stdlib.hE<gt>\n"
4025 "#include E<lt>string.hE<gt>\n"
4026 "#include E<lt>sys/socket.hE<gt>\n"
4027
4028 #. type: Plain text
4029 #: build/C/man2/recvmmsg.2:228
4030 #, no-wrap
4031 msgid ""
4032 "int\n"
4033 "main(void)\n"
4034 "{\n"
4035 "#define VLEN 10\n"
4036 "#define BUFSIZE 200\n"
4037 "#define TIMEOUT 1\n"
4038 "    int sockfd, retval, i;\n"
4039 "    struct sockaddr_in sa;\n"
4040 "    struct mmsghdr msgs[VLEN];\n"
4041 "    struct iovec iovecs[VLEN];\n"
4042 "    char bufs[VLEN][BUFSIZE+1];\n"
4043 "    struct timespec timeout;\n"
4044 msgstr ""
4045 "int\n"
4046 "main(void)\n"
4047 "{\n"
4048 "#define VLEN 10\n"
4049 "#define BUFSIZE 200\n"
4050 "#define TIMEOUT 1\n"
4051 "    int sockfd, retval, i;\n"
4052 "    struct sockaddr_in sa;\n"
4053 "    struct mmsghdr msgs[VLEN];\n"
4054 "    struct iovec iovecs[VLEN];\n"
4055 "    char bufs[VLEN][BUFSIZE+1];\n"
4056 "    struct timespec timeout;\n"
4057
4058 #. type: Plain text
4059 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
4060 #, no-wrap
4061 msgid ""
4062 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4063 "    if (sockfd == -1) {\n"
4064 "        perror(\"socket()\");\n"
4065 "        exit(EXIT_FAILURE);\n"
4066 "    }\n"
4067 msgstr ""
4068 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4069 "    if (sockfd == -1) {\n"
4070 "        perror(\"socket()\");\n"
4071 "        exit(EXIT_FAILURE);\n"
4072 "    }\n"
4073
4074 #. type: Plain text
4075 #: build/C/man2/recvmmsg.2:242
4076 #, no-wrap
4077 msgid ""
4078 "    sa.sin_family = AF_INET;\n"
4079 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4080 "    sa.sin_port = htons(1234);\n"
4081 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4082 "        perror(\"bind()\");\n"
4083 "        exit(EXIT_FAILURE);\n"
4084 "    }\n"
4085 msgstr ""
4086 "    sa.sin_family = AF_INET;\n"
4087 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4088 "    sa.sin_port = htons(1234);\n"
4089 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4090 "        perror(\"bind()\");\n"
4091 "        exit(EXIT_FAILURE);\n"
4092 "    }\n"
4093
4094 #. type: Plain text
4095 #: build/C/man2/recvmmsg.2:250
4096 #, no-wrap
4097 msgid ""
4098 "    memset(msgs, 0, sizeof(msgs));\n"
4099 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4100 "        iovecs[i].iov_base         = bufs[i];\n"
4101 "        iovecs[i].iov_len          = BUFSIZE;\n"
4102 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4103 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4104 "    }\n"
4105 msgstr ""
4106 "    memset(msgs, 0, sizeof(msgs));\n"
4107 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4108 "        iovecs[i].iov_base         = bufs[i];\n"
4109 "        iovecs[i].iov_len          = BUFSIZE;\n"
4110 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4111 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4112 "    }\n"
4113
4114 #. type: Plain text
4115 #: build/C/man2/recvmmsg.2:253
4116 #, no-wrap
4117 msgid ""
4118 "    timeout.tv_sec = TIMEOUT;\n"
4119 "    timeout.tv_nsec = 0;\n"
4120 msgstr ""
4121 "    timeout.tv_sec = TIMEOUT;\n"
4122 "    timeout.tv_nsec = 0;\n"
4123
4124 #. type: Plain text
4125 #: build/C/man2/recvmmsg.2:259
4126 #, no-wrap
4127 msgid ""
4128 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4129 "    if (retval == -1) {\n"
4130 "        perror(\"recvmmsg()\");\n"
4131 "        exit(EXIT_FAILURE);\n"
4132 "    }\n"
4133 msgstr ""
4134 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4135 "    if (retval == -1) {\n"
4136 "        perror(\"recvmmsg()\");\n"
4137 "        exit(EXIT_FAILURE);\n"
4138 "    }\n"
4139
4140 #. type: Plain text
4141 #: build/C/man2/recvmmsg.2:267
4142 #, no-wrap
4143 msgid ""
4144 "    printf(\"%d messages received\\en\", retval);\n"
4145 "    for (i = 0; i E<lt> retval; i++) {\n"
4146 "        bufs[i][msgs[i].msg_len] = 0;\n"
4147 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4148 "    }\n"
4149 "    exit(EXIT_SUCCESS);\n"
4150 "}\n"
4151 msgstr ""
4152 "    printf(\"%d messages received\\en\", retval);\n"
4153 "    for (i = 0; i E<lt> retval; i++) {\n"
4154 "        bufs[i][msgs[i].msg_len] = 0;\n"
4155 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4156 "    }\n"
4157 "    exit(EXIT_SUCCESS);\n"
4158 "}\n"
4159
4160 #. type: Plain text
4161 #: build/C/man2/recvmmsg.2:275
4162 msgid ""
4163 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4164 "(2), B<socket>(7)"
4165 msgstr ""
4166 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4167 "(2), B<socket>(7)"
4168
4169 #. type: TH
4170 #: build/C/man2/select.2:38
4171 #, no-wrap
4172 msgid "SELECT"
4173 msgstr "SELECT"
4174
4175 #. type: TH
4176 #: build/C/man2/select.2:38
4177 #, no-wrap
4178 msgid "2012-08-17"
4179 msgstr "2012-08-17"
4180
4181 #. type: Plain text
4182 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4183 msgid ""
4184 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4185 "multiplexing"
4186 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4187
4188 #. type: Plain text
4189 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4190 #, no-wrap
4191 msgid "/* According to POSIX.1-2001 */\n"
4192 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4193
4194 #. type: Plain text
4195 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4196 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4197 #, no-wrap
4198 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4199 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4200
4201 #. type: Plain text
4202 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4203 #, no-wrap
4204 msgid "/* According to earlier standards */\n"
4205 msgstr "/* 以前の規格に従う場合 */\n"
4206
4207 #. type: Plain text
4208 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4209 #, no-wrap
4210 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4211 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4212
4213 #. type: Plain text
4214 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4215 #, no-wrap
4216 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4217 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4218
4219 #. type: Plain text
4220 #: build/C/man2/select.2:58
4221 #, no-wrap
4222 msgid ""
4223 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4224 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4225 msgstr ""
4226 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4227 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4228
4229 #. type: Plain text
4230 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4231 #, no-wrap
4232 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4233 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4234
4235 #. type: Plain text
4236 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4237 #, no-wrap
4238 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4239 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4240
4241 #. type: Plain text
4242 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4243 #, no-wrap
4244 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4245 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4246
4247 #. type: Plain text
4248 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4249 #, no-wrap
4250 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4251 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4252
4253 #. type: Plain text
4254 #: build/C/man2/select.2:72
4255 #, no-wrap
4256 msgid ""
4257 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4258 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4259 "B<            const sigset_t *>I<sigmask>B<);>\n"
4260 msgstr ""
4261 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4262 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4263 "B<            const sigset_t *>I<sigmask>B<);>\n"
4264
4265 #. type: Plain text
4266 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4267 #: build/C/man3/sockatmark.3:36
4268 msgid ""
4269 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4270 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4271
4272 #. type: Plain text
4273 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4274 msgid ""
4275 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4276 "600"
4277 msgstr ""
4278 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4279 "600"
4280
4281 #. type: Plain text
4282 #: build/C/man2/select.2:92
4283 msgid ""
4284 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4285 "descriptors, waiting until one or more of the file descriptors become \"ready"
4286 "\" for some class of I/O operation (e.g., input possible).  A file "
4287 "descriptor is considered ready if it is possible to perform the "
4288 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4289 msgstr ""
4290 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4291 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4292 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4293 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4294 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4295 "意味する。"
4296
4297 #. type: Plain text
4298 #: build/C/man2/select.2:98
4299 msgid ""
4300 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4301 "these three differences:"
4302 msgstr ""
4303 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4304
4305 #. type: TP
4306 #: build/C/man2/select.2:98
4307 #, no-wrap
4308 msgid "(i)"
4309 msgstr "(i)"
4310
4311 #. type: Plain text
4312 #: build/C/man2/select.2:108
4313 msgid ""
4314 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4315 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4316 "and nanoseconds)."
4317 msgstr ""
4318 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4319 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4320 "timespec> (秒・ナノ秒単位) を用いる。"
4321
4322 #. type: TP
4323 #: build/C/man2/select.2:108
4324 #, no-wrap
4325 msgid "(ii)"
4326 msgstr "(ii)"
4327
4328 #. type: Plain text
4329 #: build/C/man2/select.2:116
4330 msgid ""
4331 "B<select>()  may update the I<timeout> argument to indicate how much time "
4332 "was left.  B<pselect>()  does not change this argument."
4333 msgstr ""
4334 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4335 "B<pselect>()  はこの引き数を変更しない。"
4336
4337 #. type: TP
4338 #: build/C/man2/select.2:116
4339 #, no-wrap
4340 msgid "(iii)"
4341 msgstr "(iii)"
4342
4343 #. type: Plain text
4344 #: build/C/man2/select.2:125
4345 msgid ""
4346 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4347 "with NULL I<sigmask>."
4348 msgstr ""
4349 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4350 "指定した場合の B<pselect>()  と同じである。"
4351
4352 #. type: Plain text
4353 #: build/C/man2/select.2:143
4354 msgid ""
4355 "Three independent sets of file descriptors are watched.  Those listed in "
4356 "I<readfds> will be watched to see if characters become available for reading "
4357 "(more precisely, to see if a read will not block; in particular, a file "
4358 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4359 "watched to see if a write will not block, and those in I<exceptfds> will be "
4360 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4361 "which file descriptors actually changed status.  Each of the three file "
4362 "descriptor sets may be specified as NULL if no file descriptors are to be "
4363 "watched for the corresponding class of events."
4364 msgstr ""
4365 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4366 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4367 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4368 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4369 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4370 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4371 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4372 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4373 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4374 "指定することができる。"
4375
4376 #. type: Plain text
4377 #: build/C/man2/select.2:156
4378 msgid ""
4379 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4380 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4381 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4382 "part of the set; this is useful after B<select>()  returns."
4383 msgstr ""
4384 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4385 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4386 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4387 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4388 "る。"
4389
4390 #. type: Plain text
4391 #: build/C/man2/select.2:159
4392 msgid ""
4393 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4394 "plus 1."
4395 msgstr ""
4396 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4397 "のである。"
4398
4399 #. type: Plain text
4400 #: build/C/man2/select.2:179
4401 msgid ""
4402 "The I<timeout> argument specifies the minimum interval that B<select>()  "
4403 "should block waiting for a file descriptor to become ready.  (This interval "
4404 "will be rounded up to the system clock granularity, and kernel scheduling "
4405 "delays mean that the blocking interval may overrun by a small amount.)  If "
4406 "both fields of the I<timeval> structure are zero, then B<select>()  returns "
4407 "immediately.  (This is useful for polling.)  If I<timeout> is NULL (no "
4408 "timeout), B<select>()  can block indefinitely."
4409 msgstr ""
4410 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4411 "B<select>() が停止する最小の停止時間を指定する\n"
4412 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4413 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4414 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4415 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4416 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4417 "期限に停止 (block) する。"
4418
4419 #. type: Plain text
4420 #: build/C/man2/select.2:189
4421 msgid ""
4422 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4423 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4424 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4425 "restores the original signal mask."
4426 msgstr ""
4427 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4428 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4429 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4430 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4431
4432 #. type: Plain text
4433 #: build/C/man2/select.2:195
4434 msgid ""
4435 "Other than the difference in the precision of the I<timeout> argument, the "
4436 "following B<pselect>()  call:"
4437 msgstr ""
4438 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4439
4440 #. type: Plain text
4441 #: build/C/man2/select.2:199
4442 #, no-wrap
4443 msgid ""
4444 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4445 "                    timeout, &sigmask);\n"
4446 msgstr ""
4447 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4448 "                    timeout, &sigmask);\n"
4449
4450 #. type: Plain text
4451 #: build/C/man2/select.2:204
4452 msgid "is equivalent to I<atomically> executing the following calls:"
4453 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4454
4455 #. type: Plain text
4456 #: build/C/man2/select.2:207
4457 #, no-wrap
4458 msgid "    sigset_t origmask;\n"
4459 msgstr "    sigset_t origmask;\n"
4460
4461 #. type: Plain text
4462 #: build/C/man2/select.2:211
4463 #, no-wrap
4464 msgid ""
4465 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4466 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4467 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4468 msgstr ""
4469 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4470 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4471 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4472
4473 #. type: Plain text
4474 #: build/C/man2/select.2:232
4475 msgid ""
4476 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4477 "either a signal or for a file descriptor to become ready, then an atomic "
4478 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4479 "a global flag and returns.  Then a test of this global flag followed by a "
4480 "call of B<select>()  could hang indefinitely if the signal arrived just "
4481 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4482 "one to first block signals, handle the signals that have come in, then call "
4483 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4484 msgstr ""
4485 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4486 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4487 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4488 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4489 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4490 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4491 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4492 "で、前記の競合を避けることができる。)"
4493
4494 #. type: SS
4495 #: build/C/man2/select.2:232
4496 #, no-wrap
4497 msgid "The timeout"
4498 msgstr "タイムアウト"
4499
4500 #. type: Plain text
4501 #: build/C/man2/select.2:236
4502 msgid ""
4503 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4504 "like"
4505 msgstr ""
4506 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4507
4508 #. type: Plain text
4509 #: build/C/man2/select.2:243
4510 #, no-wrap
4511 msgid ""
4512 "struct timeval {\n"
4513 "    long    tv_sec;         /* seconds */\n"
4514 "    long    tv_usec;        /* microseconds */\n"
4515 "};\n"
4516 msgstr ""
4517 "struct timeval {\n"
4518 "    long    tv_sec;         /* 秒 */\n"
4519 "    long    tv_usec;        /* マイクロ秒 */\n"
4520 "};\n"
4521
4522 #. type: Plain text
4523 #: build/C/man2/select.2:247
4524 msgid "and"
4525 msgstr "や"
4526
4527 #. type: Plain text
4528 #: build/C/man2/select.2:254
4529 #, no-wrap
4530 msgid ""
4531 "struct timespec {\n"
4532 "    long    tv_sec;         /* seconds */\n"
4533 "    long    tv_nsec;        /* nanoseconds */\n"
4534 "};\n"
4535 msgstr ""
4536 "struct timespec {\n"
4537 "    long    tv_sec;         /* 秒 */\n"
4538 "    long    tv_nsec;        /* ナノ秒 */\n"
4539 "};\n"
4540
4541 #. type: Plain text
4542 #: build/C/man2/select.2:258
4543 msgid "(However, see below on the POSIX.1-2001 versions.)"
4544 msgstr ""
4545 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4546 "照)"
4547
4548 #. type: Plain text
4549 #: build/C/man2/select.2:266
4550 msgid ""
4551 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4552 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4553 "precision."
4554 msgstr ""
4555 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4556 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4557 "呼び出すという方法を使っているコードもある。"
4558
4559 #.  .PP - it is rumored that:
4560 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4561 #.  - it is certainly true that:
4562 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4563 #. type: Plain text
4564 #: build/C/man2/select.2:289
4565 msgid ""
4566 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4567 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4568 "either behavior.)  This causes problems both when Linux code which reads "
4569 "I<timeout> is ported to other operating systems, and when code is ported to "
4570 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4571 "without reinitializing it.  Consider I<timeout> to be undefined after "
4572 "B<select>()  returns."
4573 msgstr ""
4574 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4575 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4576 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4577 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4578 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4579 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4580 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4581 "ある。"
4582
4583 #. type: Plain text
4584 #: build/C/man2/select.2:306
4585 msgid ""
4586 "On success, B<select>()  and B<pselect>()  return the number of file "
4587 "descriptors contained in the three returned descriptor sets (that is, the "
4588 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4589 "which may be zero if the timeout expires before anything interesting "
4590 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4591 "sets and I<timeout> become undefined, so do not rely on their contents after "
4592 "an error."
4593 msgstr ""
4594 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4595 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4596 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4597 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4598 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4599 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4600
4601 #. type: Plain text
4602 #: build/C/man2/select.2:312
4603 msgid ""
4604 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4605 "descriptor that was already closed, or one on which an error has occurred.)"
4606 msgstr ""
4607 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4608 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4609 "タが指定された)。"
4610
4611 #. type: Plain text
4612 #: build/C/man2/select.2:316
4613 msgid "A signal was caught; see B<signal>(7)."
4614 msgstr "シグナルを受信した。"
4615
4616 #. type: Plain text
4617 #: build/C/man2/select.2:322
4618 msgid ""
4619 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4620 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4621
4622 #. type: Plain text
4623 #: build/C/man2/select.2:325
4624 msgid "unable to allocate memory for internal tables."
4625 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4626
4627 #. type: Plain text
4628 #: build/C/man2/select.2:331
4629 msgid ""
4630 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4631 "()  was emulated in glibc (but see BUGS)."
4632 msgstr ""
4633 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4634 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4635
4636 #. type: Plain text
4637 #: build/C/man2/select.2:342
4638 msgid ""
4639 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4640 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4641 "clones of the BSD socket layer (including System V variants).  However, note "
4642 "that the System V variant typically sets the timeout variable before exit, "
4643 "but the BSD variant does not."
4644 msgstr ""
4645 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4646 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4647 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4648 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4649 "ること。"
4650
4651 #. type: Plain text
4652 #: build/C/man2/select.2:346
4653 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4654 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4655
4656 #. type: Plain text
4657 #: build/C/man2/select.2:363
4658 msgid ""
4659 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4660 "with a value of I<fd> that is negative or is equal to or larger than "
4661 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4662 "I<fd> to be a valid file descriptor."
4663 msgstr ""
4664 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4665 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4666 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4667 "プタでなければならないと規定されている。"
4668
4669 #. type: Plain text
4670 #: build/C/man2/select.2:372
4671 msgid ""
4672 "Concerning the types involved, the classical situation is that the two "
4673 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4674 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4675 "situation is"
4676 msgstr ""
4677 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4678 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4679 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4680
4681 #. type: Plain text
4682 #: build/C/man2/select.2:379
4683 #, no-wrap
4684 msgid ""
4685 "struct timeval {\n"
4686 "    time_t         tv_sec;     /* seconds */\n"
4687 "    suseconds_t    tv_usec;    /* microseconds */\n"
4688 "};\n"
4689 msgstr ""
4690 "struct timeval {\n"
4691 "\t time_t         tv_sec;     /* 秒 */\n"
4692 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4693 "};\n"
4694
4695 #. type: Plain text
4696 #: build/C/man2/select.2:390
4697 msgid ""
4698 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4699 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4700 msgstr ""
4701 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4702 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4703
4704 #. type: Plain text
4705 #: build/C/man2/select.2:402
4706 msgid ""
4707 "Concerning prototypes, the classical situation is that one should include "
4708 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4709 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4710 msgstr ""
4711 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4712 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4713 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4714 "インクルードすればよい。"
4715
4716 #. type: Plain text
4717 #: build/C/man2/select.2:414
4718 msgid ""
4719 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4720 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4721 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4722 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4723 "requirements are as shown in the SYNOPSIS."
4724 msgstr ""
4725 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4726 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4727 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4728 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4729 "使用するには、「書式」に記載された要件を満たす必要がある。"
4730
4731 #. type: SS
4732 #: build/C/man2/select.2:414
4733 #, no-wrap
4734 msgid "Multithreaded applications"
4735 msgstr "マルチスレッド・アプリケーション"
4736
4737 #. type: Plain text
4738 #: build/C/man2/select.2:430
4739 msgid ""
4740 "If a file descriptor being monitored by B<select>()  is closed in another "
4741 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
4742 "unblocks and returns, with an indication that the file descriptor is ready "
4743 "(a subsequent I/O operation will likely fail with an error, unless another "
4744 "the file descriptor reopened between the time B<select>()  returned and the "
4745 "I/O operations was performed).  On Linux (and some other systems), closing "
4746 "the file descriptor in another thread has no effect on B<select>().  In "
4747 "summary, any application that relies on a particular behavior in this "
4748 "scenario must be considered buggy."
4749 msgstr ""
4750 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
4751 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
4752 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
4753 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
4754 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
4755 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
4756 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
4757 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
4758 "ている」と考えなければならない。"
4759
4760 #. type: SS
4761 #: build/C/man2/select.2:430
4762 #, no-wrap
4763 msgid "Linux notes"
4764 msgstr "Linux での注意"
4765
4766 #. type: Plain text
4767 #: build/C/man2/select.2:438
4768 msgid ""
4769 "The B<pselect>()  interface described in this page is implemented by glibc.  "
4770 "The underlying Linux system call is named B<pselect6>().  This system call "
4771 "has somewhat different behavior from the glibc wrapper function."
4772 msgstr ""
4773 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4774 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
4775 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
4776 "関数とは少し違った動作をする。"
4777
4778 #. type: Plain text
4779 #: build/C/man2/select.2:453
4780 msgid ""
4781 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
4782 "However, the glibc wrapper function hides this behavior by using a local "
4783 "variable for the timeout argument that is passed to the system call.  Thus, "
4784 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
4785 "this is the behavior required by POSIX.1-2001."
4786 msgstr ""
4787 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
4788 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
4789 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
4790 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
4791 "これが POSIX.1-2001 が要求している動作である。"
4792
4793 #. type: Plain text
4794 #: build/C/man2/select.2:459
4795 msgid ""
4796 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
4797 "*> pointer, but is instead a structure of the form:"
4798 msgstr ""
4799 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
4800 "ポインタではなく、以下に示す構造体である。"
4801
4802 #. type: Plain text
4803 #: build/C/man2/select.2:467
4804 #, no-wrap
4805 msgid ""
4806 "struct {\n"
4807 "    const sigset_t *ss;     /* Pointer to signal set */\n"
4808 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
4809 "                               to by 'ss' */\n"
4810 "};\n"
4811 msgstr ""
4812 "struct {\n"
4813 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
4814 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
4815 "                               (バイト数) */\n"
4816 "};\n"
4817
4818 #. type: Plain text
4819 #: build/C/man2/select.2:474
4820 msgid ""
4821 "This allows the system call to obtain both a pointer to the signal set and "
4822 "its size, while allowing for the fact that most architectures support a "
4823 "maximum of 6 arguments to a system call."
4824 msgstr ""
4825 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
4826 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
4827 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
4828 "のサイズの両方を取得することができるのである。"
4829
4830 #. type: Plain text
4831 #: build/C/man2/select.2:480
4832 msgid ""
4833 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4834 "argument."
4835 msgstr ""
4836 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4837 "されていた。"
4838
4839 #. type: Plain text
4840 #: build/C/man2/select.2:493
4841 msgid ""
4842 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4843 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4844 "implementation remained vulnerable to the very race condition that B<pselect>"
4845 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4846 "B<pselect>()  system call on kernels where it is provided."
4847 msgstr ""
4848 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4849 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4850 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4851 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4852 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4853 "が使用される。"
4854
4855 #. type: Plain text
4856 #: build/C/man2/select.2:506
4857 msgid ""
4858 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4859 "trapping can be achieved using the self-pipe trick.  In this technique, a "
4860 "signal handler writes a byte to a pipe whose other end is monitored by "
4861 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
4862 "to a pipe that may be full or reading from a pipe that may be empty, "
4863 "nonblocking I/O is used when reading from and writing to the pipe.)"
4864 msgstr ""
4865 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
4866 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
4867 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
4868 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
4869 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
4870 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
4871 "(nonblocking) I/O を使用するとよい)。"
4872
4873 #.  Stevens discusses a case where accept can block after select
4874 #.  returns successfully because of an intervening RST from the client.
4875 #.  Maybe the kernel should have returned EIO in such a situation?
4876 #. type: Plain text
4877 #: build/C/man2/select.2:522
4878 msgid ""
4879 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4880 "reading\", while nevertheless a subsequent read blocks.  This could for "
4881 "example happen when data has arrived but upon examination has wrong checksum "
4882 "and is discarded.  There may be other circumstances in which a file "
4883 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4884 "B<O_NONBLOCK> on sockets that should not block."
4885 msgstr ""
4886 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4887 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4888 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4889 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4890 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4891 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4892
4893 #. type: Plain text
4894 #: build/C/man2/select.2:537
4895 msgid ""
4896 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4897 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4898 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4899 "behavior, but the glibc wrapper hides this behavior by internally copying "
4900 "the I<timeout> to a local variable and passing that variable to the system "
4901 "call."
4902 msgstr ""
4903 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4904 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4905 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4906 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4907 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4908 "数をシステムコールに渡している。"
4909
4910 #. type: Plain text
4911 #: build/C/man2/select.2:544
4912 #, no-wrap
4913 msgid ""
4914 "#include E<lt>stdio.hE<gt>\n"
4915 "#include E<lt>stdlib.hE<gt>\n"
4916 "#include E<lt>sys/time.hE<gt>\n"
4917 "#include E<lt>sys/types.hE<gt>\n"
4918 "#include E<lt>unistd.hE<gt>\n"
4919 msgstr ""
4920 "#include E<lt>stdio.hE<gt>\n"
4921 "#include E<lt>stdlib.hE<gt>\n"
4922 "#include E<lt>sys/time.hE<gt>\n"
4923 "#include E<lt>sys/types.hE<gt>\n"
4924 "#include E<lt>unistd.hE<gt>\n"
4925
4926 #. type: Plain text
4927 #: build/C/man2/select.2:551
4928 #, no-wrap
4929 msgid ""
4930 "int\n"
4931 "main(void)\n"
4932 "{\n"
4933 "    fd_set rfds;\n"
4934 "    struct timeval tv;\n"
4935 "    int retval;\n"
4936 msgstr ""
4937 "int\n"
4938 "main(void)\n"
4939 "{\n"
4940 "    fd_set rfds;\n"
4941 "    struct timeval tv;\n"
4942 "    int retval;\n"
4943
4944 #. type: Plain text
4945 #: build/C/man2/select.2:555
4946 #, no-wrap
4947 msgid ""
4948 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4949 "    FD_ZERO(&rfds);\n"
4950 "    FD_SET(0, &rfds);\n"
4951 msgstr ""
4952 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4953 "    FD_ZERO(&rfds);\n"
4954 "    FD_SET(0, &rfds);\n"
4955
4956 #. type: Plain text
4957 #: build/C/man2/select.2:559
4958 #, no-wrap
4959 msgid ""
4960 "    /* Wait up to five seconds. */\n"
4961 "    tv.tv_sec = 5;\n"
4962 "    tv.tv_usec = 0;\n"
4963 msgstr ""
4964 "    /* 5 秒間監視する。*/\n"
4965 "    tv.tv_sec = 5;\n"
4966 "    tv.tv_usec = 0;\n"
4967
4968 #. type: Plain text
4969 #: build/C/man2/select.2:562
4970 #, no-wrap
4971 msgid ""
4972 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4973 "    /* Don't rely on the value of tv now! */\n"
4974 msgstr ""
4975 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4976 "    /* この時点での tv の値を信頼してはならない。*/\n"
4977
4978 #. type: Plain text
4979 #: build/C/man2/select.2:570
4980 #, no-wrap
4981 msgid ""
4982 "    if (retval == -1)\n"
4983 "        perror(\"select()\");\n"
4984 "    else if (retval)\n"
4985 "        printf(\"Data is available now.\\en\");\n"
4986 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4987 "    else\n"
4988 "        printf(\"No data within five seconds.\\en\");\n"
4989 msgstr ""
4990 "    if (retval == -1)\n"
4991 "\tperror(\"select()\");\n"
4992 "    else if (retval)\n"
4993 "        printf(\"今、データが取得できました。\\en\");\n"
4994 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4995 "    else\n"
4996 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4997
4998 #. type: Plain text
4999 #: build/C/man2/select.2:585
5000 msgid ""
5001 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5002 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5003 msgstr ""
5004 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5005 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5006
5007 #. type: Plain text
5008 #: build/C/man2/select.2:588
5009 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5010 msgstr ""
5011 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5012
5013 #. type: TH
5014 #: build/C/man2/select_tut.2:32
5015 #, no-wrap
5016 msgid "SELECT_TUT"
5017 msgstr "SELECT_TUT"
5018
5019 #. type: TH
5020 #: build/C/man2/select_tut.2:32
5021 #, no-wrap
5022 msgid "2012-08-03"
5023 msgstr "2012-08-03"
5024
5025 #. type: Plain text
5026 #: build/C/man2/select_tut.2:52
5027 #, no-wrap
5028 msgid ""
5029 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5030 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5031 msgstr ""
5032 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5033 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5034
5035 #. type: Plain text
5036 #: build/C/man2/select_tut.2:66
5037 #, no-wrap
5038 msgid ""
5039 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5040 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5041 "B<            const sigset_t *>I<sigmask>B<);>\n"
5042 msgstr ""
5043 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5044 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5045 "B<            const sigset_t *>I<sigmask>B<);>\n"
5046
5047 #. type: Plain text
5048 #: build/C/man2/select_tut.2:83
5049 msgid ""
5050 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5051 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5052 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5053 "occurred on any of the descriptors."
5054 msgstr ""
5055 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5056 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5057 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5058 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5059 "る。"
5060
5061 #. type: Plain text
5062 #: build/C/man2/select_tut.2:108
5063 msgid ""
5064 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5065 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5066 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5067 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5068 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5069 "according to the rules described below; after calling B<select>()  you can "
5070 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5071 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5072 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5073 "descriptor from a set."
5074 msgstr ""
5075 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5076 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5077 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5078 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5079 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5080 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5081 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5082 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5083 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5084 "のファイルディスクリプタの削除を行う。"
5085
5086 #. type: SS
5087 #: build/C/man2/select_tut.2:108
5088 #, no-wrap
5089 msgid "Arguments"
5090 msgstr "引き数"
5091
5092 #. type: TP
5093 #: build/C/man2/select_tut.2:109
5094 #, no-wrap
5095 msgid "I<readfds>"
5096 msgstr "I<readfds>"
5097
5098 #. type: Plain text
5099 #: build/C/man2/select_tut.2:118
5100 msgid ""
5101 "This set is watched to see if data is available for reading from any of its "
5102 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5103 "cleared of all file descriptors except for those that are immediately "
5104 "available for reading."
5105 msgstr ""
5106 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5107 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5108 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5109
5110 #. type: TP
5111 #: build/C/man2/select_tut.2:118
5112 #, no-wrap
5113 msgid "I<writefds>"
5114 msgstr "I<writefds>"
5115
5116 #. type: Plain text
5117 #: build/C/man2/select_tut.2:127
5118 msgid ""
5119 "This set is watched to see if there is space to write data to any of its "
5120 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5121 "cleared of all file descriptors except for those that are immediately "
5122 "available for writing."
5123 msgstr ""
5124 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5125 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5126 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5127
5128 #. type: TP
5129 #: build/C/man2/select_tut.2:127
5130 #, no-wrap
5131 msgid "I<exceptfds>"
5132 msgstr "I<exceptfds>"
5133
5134 #. type: Plain text
5135 #: build/C/man2/select_tut.2:149
5136 msgid ""
5137 "This set is watched for \"exceptional conditions\".  In practice, only one "
5138 "such exceptional condition is common: the availability of I<out-of-band> "
5139 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5140 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5141 "where B<select>(2)  indicates an exceptional condition occurs with "
5142 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5143 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5144 "for those for which an exceptional condition has occurred."
5145 msgstr ""
5146 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5147 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5148 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5149 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5150 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5151 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5152 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5153 "状態が発生したディスクリプタ以外は集合から削除される。"
5154
5155 #. type: TP
5156 #: build/C/man2/select_tut.2:149
5157 #, no-wrap
5158 msgid "I<nfds>"
5159 msgstr "I<nfds>"
5160
5161 #. type: Plain text
5162 #: build/C/man2/select_tut.2:156
5163 msgid ""
5164 "This is an integer one more than the maximum of any file descriptor in any "
5165 "of the sets.  In other words, while adding file descriptors to each of the "
5166 "sets, you must calculate the maximum integer value of all of them, then "
5167 "increment this value by one, and then pass this as I<nfds>."
5168 msgstr ""
5169 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5170 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5171 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5172 "I<nfds> として渡さないといけない、ということだ。"
5173
5174 #. type: TP
5175 #: build/C/man2/select_tut.2:156
5176 #, no-wrap
5177 msgid "I<utimeout>"
5178 msgstr "I<utimeout>"
5179
5180 #. type: Plain text
5181 #: build/C/man2/select_tut.2:169
5182 msgid ""
5183 "This is the longest time B<select>()  may wait before returning, even if "
5184 "nothing interesting happened.  If this value is passed as NULL, then "
5185 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5186 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5187 "return immediately, with information about the readiness of file descriptors "
5188 "at the time of the call.  The structure I<struct timeval> is defined as:"
5189 msgstr ""
5190 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5191 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5192 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5193 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5194 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5195 "ように定義されている:"
5196
5197 #. type: Plain text
5198 #: build/C/man2/select_tut.2:176
5199 #, no-wrap
5200 msgid ""
5201 "struct timeval {\n"
5202 "    time_t tv_sec;    /* seconds */\n"
5203 "    long tv_usec;     /* microseconds */\n"
5204 "};\n"
5205 msgstr ""
5206 "struct timeval {\n"
5207 "    time_t tv_sec;    /* seconds */\n"
5208 "    long tv_usec;     /* microseconds */\n"
5209 "};\n"
5210
5211 #. type: TP
5212 #: build/C/man2/select_tut.2:178
5213 #, no-wrap
5214 msgid "I<ntimeout>"
5215 msgstr "I<ntimeout>"
5216
5217 #. type: Plain text
5218 #: build/C/man2/select_tut.2:187
5219 msgid ""
5220 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5221 "I<struct timespec> has nanosecond precision as follows:"
5222 msgstr ""
5223 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5224 "timespec> は次に示すようにナノ秒の精度を持つ。"
5225
5226 #. type: Plain text
5227 #: build/C/man2/select_tut.2:194
5228 #, no-wrap
5229 msgid ""
5230 "struct timespec {\n"
5231 "    long tv_sec;    /* seconds */\n"
5232 "    long tv_nsec;   /* nanoseconds */\n"
5233 "};\n"
5234 msgstr ""
5235 "struct timespec {\n"
5236 "    long tv_sec;    /* seconds */\n"
5237 "    long tv_nsec;   /* nanoseconds */\n"
5238 "};\n"
5239
5240 #. type: TP
5241 #: build/C/man2/select_tut.2:196
5242 #, no-wrap
5243 msgid "I<sigmask>"
5244 msgstr "I<sigmask>"
5245
5246 #. type: Plain text
5247 #: build/C/man2/select_tut.2:213
5248 msgid ""
5249 "This argument holds a set of signals that the kernel should unblock (i.e., "
5250 "remove from the signal mask of the calling thread), while the caller is "
5251 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5252 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5253 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5254 "()  will then behave just like B<select>()."
5255 msgstr ""
5256 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5257 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5258 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5259 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5260 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5261 "()  と全く同じ動作となる。"
5262
5263 #. type: SS
5264 #: build/C/man2/select_tut.2:213
5265 #, no-wrap
5266 msgid "Combining signal and data events"
5267 msgstr "シグナルとデータイベントを組み合わせる"
5268
5269 #. type: Plain text
5270 #: build/C/man2/select_tut.2:257
5271 msgid ""
5272 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5273 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5274 "normally use the signal handler only to raise a global flag.  The global "
5275 "flag will indicate that the event must be processed in the main loop of the "
5276 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5277 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5278 "signals can be processed in the main loop of the program, otherwise B<select>"
5279 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5280 "conditional to check the global flag.  So we must ask: what if a signal "
5281 "arrives after the conditional, but before the B<select>()  call? The answer "
5282 "is that B<select>()  would block indefinitely, even though an event is "
5283 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5284 "This call can be used to set the signal mask to a set of signals that are "
5285 "only to be received within the B<pselect>()  call.  For instance, let us say "
5286 "that the event in question was the exit of a child process.  Before the "
5287 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5288 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5289 "mask.  Our program would look like:"
5290 msgstr ""
5291 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5292 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5293 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5294 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5295 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5296 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5297 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5298 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5299 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5300 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5301 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5302 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5303 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5304 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5305 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5306 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5307 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5308 "る。"
5309
5310 #. type: Plain text
5311 #: build/C/man2/select_tut.2:260
5312 #, no-wrap
5313 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5314 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5315
5316 #. type: Plain text
5317 #: build/C/man2/select_tut.2:266
5318 #, no-wrap
5319 msgid ""
5320 "static void\n"
5321 "child_sig_handler(int sig)\n"
5322 "{\n"
5323 "    got_SIGCHLD = 1;\n"
5324 "}\n"
5325 msgstr ""
5326 "static void\n"
5327 "child_sig_handler(int sig)\n"
5328 "{\n"
5329 "    got_SIGCHLD = 1;\n"
5330 "}\n"
5331
5332 #. type: Plain text
5333 #: build/C/man2/select_tut.2:274
5334 #, no-wrap
5335 msgid ""
5336 "int\n"
5337 "main(int argc, char *argv[])\n"
5338 "{\n"
5339 "    sigset_t sigmask, empty_mask;\n"
5340 "    struct sigaction sa;\n"
5341 "    fd_set readfds, writefds, exceptfds;\n"
5342 "    int r;\n"
5343 msgstr ""
5344 "int\n"
5345 "main(int argc, char *argv[])\n"
5346 "{\n"
5347 "    sigset_t sigmask, empty_mask;\n"
5348 "    struct sigaction sa;\n"
5349 "    fd_set readfds, writefds, exceptfds;\n"
5350 "    int r;\n"
5351
5352 #. type: Plain text
5353 #: build/C/man2/select_tut.2:281
5354 #, no-wrap
5355 msgid ""
5356 "    sigemptyset(&sigmask);\n"
5357 "    sigaddset(&sigmask, SIGCHLD);\n"
5358 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5359 "        perror(\"sigprocmask\");\n"
5360 "        exit(EXIT_FAILURE);\n"
5361 "    }\n"
5362 msgstr ""
5363 "    sigemptyset(&sigmask);\n"
5364 "    sigaddset(&sigmask, SIGCHLD);\n"
5365 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5366 "        perror(\"sigprocmask\");\n"
5367 "        exit(EXIT_FAILURE);\n"
5368 "    }\n"
5369
5370 #. type: Plain text
5371 #: build/C/man2/select_tut.2:289
5372 #, no-wrap
5373 msgid ""
5374 "    sa.sa_flags = 0;\n"
5375 "    sa.sa_handler = child_sig_handler;\n"
5376 "    sigemptyset(&sa.sa_mask);\n"
5377 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5378 "        perror(\"sigaction\");\n"
5379 "        exit(EXIT_FAILURE);\n"
5380 "    }\n"
5381 msgstr ""
5382 "    sa.sa_flags = 0;\n"
5383 "    sa.sa_handler = child_sig_handler;\n"
5384 "    sigemptyset(&sa.sa_mask);\n"
5385 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5386 "        perror(\"sigaction\");\n"
5387 "        exit(EXIT_FAILURE);\n"
5388 "    }\n"
5389
5390 #. type: Plain text
5391 #: build/C/man2/select_tut.2:291
5392 #, no-wrap
5393 msgid "    sigemptyset(&empty_mask);\n"
5394 msgstr "    sigemptyset(&empty_mask);\n"
5395
5396 #. type: Plain text
5397 #: build/C/man2/select_tut.2:295
5398 #, no-wrap
5399 msgid ""
5400 "    for (;;) {          /* main loop */\n"
5401 "        /* Initialize readfds, writefds, and exceptfds\n"
5402 "           before the pselect() call. (Code omitted.) */\n"
5403 msgstr ""
5404 "    for (;;) {          /* main loop */\n"
5405 "        /* Initialize readfds, writefds, and exceptfds\n"
5406 "           before the pselect() call. (Code omitted.) */\n"
5407
5408 #. type: Plain text
5409 #: build/C/man2/select_tut.2:301
5410 #, no-wrap
5411 msgid ""
5412 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5413 "                    NULL, &empty_mask);\n"
5414 "        if (r == -1 && errno != EINTR) {\n"
5415 "            /* Handle error */\n"
5416 "        }\n"
5417 msgstr ""
5418 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5419 "                    NULL, &empty_mask);\n"
5420 "        if (r == -1 && errno != EINTR) {\n"
5421 "            /* Handle error */\n"
5422 "        }\n"
5423
5424 #. type: Plain text
5425 #: build/C/man2/select_tut.2:304
5426 #, no-wrap
5427 msgid ""
5428 "        if (got_SIGCHLD) {\n"
5429 "            got_SIGCHLD = 0;\n"
5430 msgstr ""
5431 "        if (got_SIGCHLD) {\n"
5432 "            got_SIGCHLD = 0;\n"
5433
5434 #. type: Plain text
5435 #: build/C/man2/select_tut.2:308
5436 #, no-wrap
5437 msgid ""
5438 "            /* Handle signalled event here; e.g., wait() for all\n"
5439 "               terminated children. (Code omitted.) */\n"
5440 "        }\n"
5441 msgstr ""
5442 "            /* Handle signalled event here; e.g., wait() for all\n"
5443 "               terminated children. (Code omitted.) */\n"
5444 "        }\n"
5445
5446 #. type: Plain text
5447 #: build/C/man2/select_tut.2:312
5448 #, no-wrap
5449 msgid ""
5450 "        /* main body of program */\n"
5451 "    }\n"
5452 "}\n"
5453 msgstr ""
5454 "        /* main body of program */\n"
5455 "    }\n"
5456 "}\n"
5457
5458 #. type: SS
5459 #: build/C/man2/select_tut.2:313
5460 #, no-wrap
5461 msgid "Practical"
5462 msgstr "実例"
5463
5464 #. type: Plain text
5465 #: build/C/man2/select_tut.2:334
5466 msgid ""
5467 "So what is the point of B<select>()? Can't I just read and write to my "
5468 "descriptors whenever I want? The point of B<select>()  is that it watches "
5469 "multiple descriptors at the same time and properly puts the process to sleep "
5470 "if there is no activity.  UNIX programmers often find themselves in a "
5471 "position where they have to handle I/O from more than one file descriptor "
5472 "where the data flow may be intermittent.  If you were to merely create a "
5473 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5474 "your calls may block waiting for data from/to a file descriptor, while "
5475 "another file descriptor is unused though ready for I/O.  B<select>()  "
5476 "efficiently copes with this situation."
5477 msgstr ""
5478 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5479 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5480 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5481 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5482 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5483 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5484 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5485 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5486 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5487
5488 #. type: SS
5489 #: build/C/man2/select_tut.2:334
5490 #, no-wrap
5491 msgid "Select law"
5492 msgstr "SELECT の掟"
5493
5494 #. type: Plain text
5495 #: build/C/man2/select_tut.2:347
5496 msgid ""
5497 "Many people who try to use B<select>()  come across behavior that is "
5498 "difficult to understand and produces nonportable or borderline results.  For "
5499 "instance, the above program is carefully written not to block at any point, "
5500 "even though it does not set its file descriptors to nonblocking mode.  It is "
5501 "easy to introduce subtle errors that will remove the advantage of using "
5502 "B<select>(), so here is a list of essentials to watch for when using "
5503 "B<select>()."
5504 msgstr ""
5505 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5506 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5507 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5508 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5509 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5510 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5511 "ことにする。"
5512
5513 #. type: Plain text
5514 #: build/C/man2/select_tut.2:356
5515 msgid ""
5516 "You should always try to use B<select>()  without a timeout.  Your program "
5517 "should have nothing to do if there is no data available.  Code that depends "
5518 "on timeouts is not usually portable and is difficult to debug."
5519 msgstr ""
5520 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5521 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5522 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5523
5524 #. type: Plain text
5525 #: build/C/man2/select_tut.2:360
5526 msgid ""
5527 "The value I<nfds> must be properly calculated for efficiency as explained "
5528 "above."
5529 msgstr ""
5530 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5531 "えなければならない。"
5532
5533 #. type: Plain text
5534 #: build/C/man2/select_tut.2:367
5535 msgid ""
5536 "No file descriptor must be added to any set if you do not intend to check "
5537 "its result after the B<select>()  call, and respond appropriately.  See next "
5538 "rule."
5539 msgstr ""
5540 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5541 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5542
5543 #. type: Plain text
5544 #: build/C/man2/select_tut.2:373
5545 msgid ""
5546 "After B<select>()  returns, all file descriptors in all sets should be "
5547 "checked to see if they are ready."
5548 msgstr ""
5549 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5550 "て 読み書き可能な状態になっているかをチェックすべきである。"
5551
5552 #. type: TP
5553 #: build/C/man2/select_tut.2:373
5554 #, no-wrap
5555 msgid "5."
5556 msgstr "5."
5557
5558 #. type: Plain text
5559 #: build/C/man2/select_tut.2:388
5560 msgid ""
5561 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5562 "necessarily read/write the full amount of data that you have requested.  If "
5563 "they do read/write the full amount, it's because you have a low traffic load "
5564 "and a fast stream.  This is not always going to be the case.  You should "
5565 "cope with the case of your functions managing to send or receive only a "
5566 "single byte."
5567 msgstr ""
5568 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5569 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5570 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5571 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5572 "うな場合も 考慮に入れてやらなければならない。"
5573
5574 #. type: TP
5575 #: build/C/man2/select_tut.2:388
5576 #, no-wrap
5577 msgid "6."
5578 msgstr "6."
5579
5580 #. type: Plain text
5581 #: build/C/man2/select_tut.2:396
5582 msgid ""
5583 "Never read/write only in single bytes at a time unless you are really sure "
5584 "that you have a small amount of data to process.  It is extremely "
5585 "inefficient not to read/write as much data as you can buffer each time.  The "
5586 "buffers in the example below are 1024 bytes although they could easily be "
5587 "made larger."
5588 msgstr ""
5589 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5590 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5591 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5592 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5593
5594 #. type: TP
5595 #: build/C/man2/select_tut.2:396
5596 #, no-wrap
5597 msgid "7."
5598 msgstr "7."
5599
5600 #.  Nonetheless, you should still cope with these errors for completeness.
5601 #. type: Plain text
5602 #: build/C/man2/select_tut.2:418
5603 msgid ""
5604 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5605 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5606 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5607 "properly managed (not done properly above).  If your program is not going to "
5608 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5609 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5610 msgstr ""
5611 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5612 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5613 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5614 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5615 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5616 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5617
5618 #. type: TP
5619 #: build/C/man2/select_tut.2:418
5620 #, no-wrap
5621 msgid "8."
5622 msgstr "8."
5623
5624 #. type: Plain text
5625 #: build/C/man2/select_tut.2:427
5626 msgid ""
5627 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5628 "length of zero."
5629 msgstr ""
5630 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5631 "(2), B<send>(2)  を呼び出してはならない。"
5632
5633 #. type: TP
5634 #: build/C/man2/select_tut.2:427
5635 #, no-wrap
5636 msgid "9."
5637 msgstr "9."
5638
5639 #. type: Plain text
5640 #: build/C/man2/select_tut.2:443
5641 msgid ""
5642 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5643 "with errors other than those listed in B<7.>, or one of the input functions "
5644 "returns 0, indicating end of file, then you should I<not> pass that "
5645 "descriptor to B<select>()  again.  In the example below, I close the "
5646 "descriptor immediately, and then set it to -1 to prevent it being included "
5647 "in a set."
5648 msgstr ""
5649 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5650 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5651 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5652 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5653 "が集合に含まれ続けるのを許さないようにしている。"
5654
5655 #. type: TP
5656 #: build/C/man2/select_tut.2:443
5657 #, no-wrap
5658 msgid "10."
5659 msgstr "10."
5660
5661 #. type: Plain text
5662 #: build/C/man2/select_tut.2:450
5663 msgid ""
5664 "The timeout value must be initialized with each new call to B<select>(), "
5665 "since some operating systems modify the structure.  B<pselect>()  however "
5666 "does not modify its timeout structure."
5667 msgstr ""
5668 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5669 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5670 "分の timeout 構造体を変更することはない。"
5671
5672 #. type: TP
5673 #: build/C/man2/select_tut.2:450
5674 #, no-wrap
5675 msgid "11."
5676 msgstr "11."
5677
5678 #.  "I have heard" does not fill me with confidence, and doesn't
5679 #.  belong in a man page, so I've commented this point out.
5680 #.  .TP
5681 #.  11.
5682 #.  I have heard that the Windows socket layer does not cope with OOB data
5683 #.  properly.
5684 #.  It also does not cope with
5685 #.  .BR select ()
5686 #.  calls when no file descriptors are set at all.
5687 #.  Having no file descriptors set is a useful
5688 #.  way to sleep the process with subsecond precision by using the timeout.
5689 #.  (See further on.)
5690 #. type: Plain text
5691 #: build/C/man2/select_tut.2:469
5692 msgid ""
5693 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5694 "used in a loop, then the sets must be reinitialized before each call."
5695 msgstr ""
5696 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5697 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5698 "期化し直さなければならない。"
5699
5700 #. type: SS
5701 #: build/C/man2/select_tut.2:469
5702 #, no-wrap
5703 msgid "Usleep emulation"
5704 msgstr "usleep エミュレーション"
5705
5706 #. type: Plain text
5707 #: build/C/man2/select_tut.2:476
5708 msgid ""
5709 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5710 "()  with a finite timeout and no file descriptors as follows:"
5711 msgstr ""
5712 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5713 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5714 "できる。 以下のようにする。"
5715
5716 #. type: Plain text
5717 #: build/C/man2/select_tut.2:482
5718 #, no-wrap
5719 msgid ""
5720 "    struct timeval tv;\n"
5721 "    tv.tv_sec = 0;\n"
5722 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5723 "    select(0, NULL, NULL, NULL, &tv);\n"
5724 msgstr ""
5725 "    struct timeval tv;\n"
5726 "    tv.tv_sec = 0;\n"
5727 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5728 "    select(0, NULL, NULL, NULL, &tv);\n"
5729
5730 #. type: Plain text
5731 #: build/C/man2/select_tut.2:485
5732 msgid "This is guaranteed to work only on UNIX systems, however."
5733 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5734
5735 #. type: Plain text
5736 #: build/C/man2/select_tut.2:490
5737 msgid ""
5738 "On success, B<select>()  returns the total number of file descriptors still "
5739 "present in the file descriptor sets."
5740 msgstr ""
5741 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5742 "ディスクリプタの総数を返す。"
5743
5744 #. type: Plain text
5745 #: build/C/man2/select_tut.2:496
5746 msgid ""
5747 "If B<select>()  timed out, then the return value will be zero.  The file "
5748 "descriptors set should be all empty (but may not be on some systems)."
5749 msgstr ""
5750 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5751 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5752
5753 #. type: Plain text
5754 #: build/C/man2/select_tut.2:503
5755 msgid ""
5756 "A return value of -1 indicates an error, with I<errno> being set "
5757 "appropriately.  In the case of an error, the contents of the returned sets "
5758 "and the I<struct timeout> contents are undefined and should not be used.  "
5759 "B<pselect>()  however never modifies I<ntimeout>."
5760 msgstr ""
5761 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5762 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5763 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5764 "変更しない。"
5765
5766 #. type: Plain text
5767 #: build/C/man2/select_tut.2:512
5768 msgid ""
5769 "Generally speaking, all operating systems that support sockets also support "
5770 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5771 "and efficient way that naive programmers try to solve in a more complicated "
5772 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5773 msgstr ""
5774 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5775 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5776 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5777 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5778
5779 #. type: Plain text
5780 #: build/C/man2/select_tut.2:521
5781 msgid ""
5782 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5783 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5784 "is nowadays widely available, but historically was less portable than "
5785 "B<select>()."
5786 msgstr ""
5787 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5788 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5789 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5790
5791 #. type: Plain text
5792 #: build/C/man2/select_tut.2:529
5793 msgid ""
5794 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5795 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5796 "of file descriptors."
5797 msgstr ""
5798 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5799 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5800
5801 #. type: Plain text
5802 #: build/C/man2/select_tut.2:534
5803 msgid ""
5804 "Here is an example that better demonstrates the true utility of B<select>"
5805 "().  The listing below is a TCP forwarding program that forwards from one "
5806 "TCP port to another."
5807 msgstr ""
5808 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5809 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5810
5811 #. type: Plain text
5812 #: build/C/man2/select_tut.2:547
5813 #, no-wrap
5814 msgid ""
5815 "#include E<lt>stdlib.hE<gt>\n"
5816 "#include E<lt>stdio.hE<gt>\n"
5817 "#include E<lt>unistd.hE<gt>\n"
5818 "#include E<lt>sys/time.hE<gt>\n"
5819 "#include E<lt>sys/types.hE<gt>\n"
5820 "#include E<lt>string.hE<gt>\n"
5821 "#include E<lt>signal.hE<gt>\n"
5822 "#include E<lt>sys/socket.hE<gt>\n"
5823 "#include E<lt>netinet/in.hE<gt>\n"
5824 "#include E<lt>arpa/inet.hE<gt>\n"
5825 "#include E<lt>errno.hE<gt>\n"
5826 msgstr ""
5827 "#include E<lt>stdlib.hE<gt>\n"
5828 "#include E<lt>stdio.hE<gt>\n"
5829 "#include E<lt>unistd.hE<gt>\n"
5830 "#include E<lt>sys/time.hE<gt>\n"
5831 "#include E<lt>sys/types.hE<gt>\n"
5832 "#include E<lt>string.hE<gt>\n"
5833 "#include E<lt>signal.hE<gt>\n"
5834 "#include E<lt>sys/socket.hE<gt>\n"
5835 "#include E<lt>netinet/in.hE<gt>\n"
5836 "#include E<lt>arpa/inet.hE<gt>\n"
5837 "#include E<lt>errno.hE<gt>\n"
5838
5839 #. type: Plain text
5840 #: build/C/man2/select_tut.2:549
5841 #, no-wrap
5842 msgid "static int forward_port;\n"
5843 msgstr "static int forward_port;\n"
5844
5845 #. type: Plain text
5846 #: build/C/man2/select_tut.2:552
5847 #, no-wrap
5848 msgid ""
5849 "#undef max\n"
5850 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5851 msgstr ""
5852 "#undef max\n"
5853 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5854
5855 #. type: Plain text
5856 #: build/C/man2/select_tut.2:559
5857 #, no-wrap
5858 msgid ""
5859 "static int\n"
5860 "listen_socket(int listen_port)\n"
5861 "{\n"
5862 "    struct sockaddr_in a;\n"
5863 "    int s;\n"
5864 "    int yes;\n"
5865 msgstr ""
5866 "static int\n"
5867 "listen_socket(int listen_port)\n"
5868 "{\n"
5869 "    struct sockaddr_in a;\n"
5870 "    int s;\n"
5871 "    int yes;\n"
5872
5873 #. type: Plain text
5874 #: build/C/man2/select_tut.2:583
5875 #, no-wrap
5876 msgid ""
5877 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5878 "        perror(\"socket\");\n"
5879 "        return -1;\n"
5880 "    }\n"
5881 "    yes = 1;\n"
5882 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5883 "            &yes, sizeof(yes)) == -1) {\n"
5884 "        perror(\"setsockopt\");\n"
5885 "        close(s);\n"
5886 "        return -1;\n"
5887 "    }\n"
5888 "    memset(&a, 0, sizeof(a));\n"
5889 "    a.sin_port = htons(listen_port);\n"
5890 "    a.sin_family = AF_INET;\n"
5891 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5892 "        perror(\"bind\");\n"
5893 "        close(s);\n"
5894 "        return -1;\n"
5895 "    }\n"
5896 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5897 "    listen(s, 10);\n"
5898 "    return s;\n"
5899 "}\n"
5900 msgstr ""
5901 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5902 "        perror(\"socket\");\n"
5903 "        return -1;\n"
5904 "    }\n"
5905 "    yes = 1;\n"
5906 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5907 "            &yes, sizeof(yes)) == -1) {\n"
5908 "        perror(\"setsockopt\");\n"
5909 "        close(s);\n"
5910 "        return -1;\n"
5911 "    }\n"
5912 "    memset(&a, 0, sizeof(a));\n"
5913 "    a.sin_port = htons(listen_port);\n"
5914 "    a.sin_family = AF_INET;\n"
5915 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5916 "        perror(\"bind\");\n"
5917 "        close(s);\n"
5918 "        return -1;\n"
5919 "    }\n"
5920 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5921 "    listen(s, 10);\n"
5922 "    return s;\n"
5923 "}\n"
5924
5925 #. type: Plain text
5926 #: build/C/man2/select_tut.2:589
5927 #, no-wrap
5928 msgid ""
5929 "static int\n"
5930 "connect_socket(int connect_port, char *address)\n"
5931 "{\n"
5932 "    struct sockaddr_in a;\n"
5933 "    int s;\n"
5934 msgstr ""
5935 "static int\n"
5936 "connect_socket(int connect_port, char *address)\n"
5937 "{\n"
5938 "    struct sockaddr_in a;\n"
5939 "    int s;\n"
5940
5941 #. type: Plain text
5942 #: build/C/man2/select_tut.2:595
5943 #, no-wrap
5944 msgid ""
5945 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5946 "        perror(\"socket\");\n"
5947 "        close(s);\n"
5948 "        return -1;\n"
5949 "    }\n"
5950 msgstr ""
5951 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5952 "        perror(\"socket\");\n"
5953 "        close(s);\n"
5954 "        return -1;\n"
5955 "    }\n"
5956
5957 #. type: Plain text
5958 #: build/C/man2/select_tut.2:599
5959 #, no-wrap
5960 msgid ""
5961 "    memset(&a, 0, sizeof(a));\n"
5962 "    a.sin_port = htons(connect_port);\n"
5963 "    a.sin_family = AF_INET;\n"
5964 msgstr ""
5965 "    memset(&a, 0, sizeof(a));\n"
5966 "    a.sin_port = htons(connect_port);\n"
5967 "    a.sin_family = AF_INET;\n"
5968
5969 #. type: Plain text
5970 #: build/C/man2/select_tut.2:605
5971 #, no-wrap
5972 msgid ""
5973 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5974 "        perror(\"bad IP address format\");\n"
5975 "        close(s);\n"
5976 "        return -1;\n"
5977 "    }\n"
5978 msgstr ""
5979 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5980 "        perror(\"bad IP address format\");\n"
5981 "        close(s);\n"
5982 "        return -1;\n"
5983 "    }\n"
5984
5985 #. type: Plain text
5986 #: build/C/man2/select_tut.2:614
5987 #, no-wrap
5988 msgid ""
5989 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5990 "        perror(\"connect()\");\n"
5991 "        shutdown(s, SHUT_RDWR);\n"
5992 "        close(s);\n"
5993 "        return -1;\n"
5994 "    }\n"
5995 "    return s;\n"
5996 "}\n"
5997 msgstr ""
5998 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5999 "        perror(\"connect()\");\n"
6000 "        shutdown(s, SHUT_RDWR);\n"
6001 "        close(s);\n"
6002 "        return -1;\n"
6003 "    }\n"
6004 "    return s;\n"
6005 "}\n"
6006
6007 #. type: Plain text
6008 #: build/C/man2/select_tut.2:622
6009 #, no-wrap
6010 msgid ""
6011 "#define SHUT_FD1 do {                                \\e\n"
6012 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6013 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6014 "                         close(fd1);                 \\e\n"
6015 "                         fd1 = -1;                   \\e\n"
6016 "                     }                               \\e\n"
6017 "                 } while (0)\n"
6018 msgstr ""
6019 "#define SHUT_FD1 do {                                \\e\n"
6020 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6021 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6022 "                         close(fd1);                 \\e\n"
6023 "                         fd1 = -1;                   \\e\n"
6024 "                     }                               \\e\n"
6025 "                 } while (0)\n"
6026
6027 #. type: Plain text
6028 #: build/C/man2/select_tut.2:630
6029 #, no-wrap
6030 msgid ""
6031 "#define SHUT_FD2 do {                                \\e\n"
6032 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6033 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6034 "                         close(fd2);                 \\e\n"
6035 "                         fd2 = -1;                   \\e\n"
6036 "                     }                               \\e\n"
6037 "                 } while (0)\n"
6038 msgstr ""
6039 "#define SHUT_FD2 do {                                \\e\n"
6040 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6041 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6042 "                         close(fd2);                 \\e\n"
6043 "                         fd2 = -1;                   \\e\n"
6044 "                     }                               \\e\n"
6045 "                 } while (0)\n"
6046
6047 #. type: Plain text
6048 #: build/C/man2/select_tut.2:632
6049 #, no-wrap
6050 msgid "#define BUF_SIZE 1024\n"
6051 msgstr "#define BUF_SIZE 1024\n"
6052
6053 #. type: Plain text
6054 #: build/C/man2/select_tut.2:641
6055 #, no-wrap
6056 msgid ""
6057 "int\n"
6058 "main(int argc, char *argv[])\n"
6059 "{\n"
6060 "    int h;\n"
6061 "    int fd1 = -1, fd2 = -1;\n"
6062 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6063 "    int buf1_avail, buf1_written;\n"
6064 "    int buf2_avail, buf2_written;\n"
6065 msgstr ""
6066 "int\n"
6067 "main(int argc, char *argv[])\n"
6068 "{\n"
6069 "    int h;\n"
6070 "    int fd1 = -1, fd2 = -1;\n"
6071 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6072 "    int buf1_avail, buf1_written;\n"
6073 "    int buf2_avail, buf2_written;\n"
6074
6075 #. type: Plain text
6076 #: build/C/man2/select_tut.2:647
6077 #, no-wrap
6078 msgid ""
6079 "    if (argc != 4) {\n"
6080 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6081 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6082 "        exit(EXIT_FAILURE);\n"
6083 "    }\n"
6084 msgstr ""
6085 "    if (argc != 4) {\n"
6086 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6087 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6088 "        exit(EXIT_FAILURE);\n"
6089 "    }\n"
6090
6091 #. type: Plain text
6092 #: build/C/man2/select_tut.2:649
6093 #, no-wrap
6094 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6095 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6096
6097 #. type: Plain text
6098 #: build/C/man2/select_tut.2:651
6099 #, no-wrap
6100 msgid "    forward_port = atoi(argv[2]);\n"
6101 msgstr "    forward_port = atoi(argv[2]);\n"
6102
6103 #. type: Plain text
6104 #: build/C/man2/select_tut.2:655
6105 #, no-wrap
6106 msgid ""
6107 "    h = listen_socket(atoi(argv[1]));\n"
6108 "    if (h == -1)\n"
6109 "        exit(EXIT_FAILURE);\n"
6110 msgstr ""
6111 "    h = listen_socket(atoi(argv[1]));\n"
6112 "    if (h == -1)\n"
6113 "        exit(EXIT_FAILURE);\n"
6114
6115 #. type: Plain text
6116 #: build/C/man2/select_tut.2:659
6117 #, no-wrap
6118 msgid ""
6119 "    for (;;) {\n"
6120 "        int r, nfds = 0;\n"
6121 "        fd_set rd, wr, er;\n"
6122 msgstr ""
6123 "    for (;;) {\n"
6124 "        int r, nfds = 0;\n"
6125 "        fd_set rd, wr, er;\n"
6126
6127 #. type: Plain text
6128 #: build/C/man2/select_tut.2:689
6129 #, no-wrap
6130 msgid ""
6131 "        FD_ZERO(&rd);\n"
6132 "        FD_ZERO(&wr);\n"
6133 "        FD_ZERO(&er);\n"
6134 "        FD_SET(h, &rd);\n"
6135 "        nfds = max(nfds, h);\n"
6136 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6137 "            FD_SET(fd1, &rd);\n"
6138 "            nfds = max(nfds, fd1);\n"
6139 "        }\n"
6140 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6141 "            FD_SET(fd2, &rd);\n"
6142 "            nfds = max(nfds, fd2);\n"
6143 "        }\n"
6144 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6145 "            FD_SET(fd1, &wr);\n"
6146 "            nfds = max(nfds, fd1);\n"
6147 "        }\n"
6148 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6149 "            FD_SET(fd2, &wr);\n"
6150 "            nfds = max(nfds, fd2);\n"
6151 "        }\n"
6152 "        if (fd1 E<gt> 0) {\n"
6153 "            FD_SET(fd1, &er);\n"
6154 "            nfds = max(nfds, fd1);\n"
6155 "        }\n"
6156 "        if (fd2 E<gt> 0) {\n"
6157 "            FD_SET(fd2, &er);\n"
6158 "            nfds = max(nfds, fd2);\n"
6159 "        }\n"
6160 msgstr ""
6161 "        FD_ZERO(&rd);\n"
6162 "        FD_ZERO(&wr);\n"
6163 "        FD_ZERO(&er);\n"
6164 "        FD_SET(h, &rd);\n"
6165 "        nfds = max(nfds, h);\n"
6166 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6167 "            FD_SET(fd1, &rd);\n"
6168 "            nfds = max(nfds, fd1);\n"
6169 "        }\n"
6170 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6171 "            FD_SET(fd2, &rd);\n"
6172 "            nfds = max(nfds, fd2);\n"
6173 "        }\n"
6174 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6175 "            FD_SET(fd1, &wr);\n"
6176 "            nfds = max(nfds, fd1);\n"
6177 "        }\n"
6178 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6179 "            FD_SET(fd2, &wr);\n"
6180 "            nfds = max(nfds, fd2);\n"
6181 "        }\n"
6182 "        if (fd1 E<gt> 0) {\n"
6183 "            FD_SET(fd1, &er);\n"
6184 "            nfds = max(nfds, fd1);\n"
6185 "        }\n"
6186 "        if (fd2 E<gt> 0) {\n"
6187 "            FD_SET(fd2, &er);\n"
6188 "            nfds = max(nfds, fd2);\n"
6189 "        }\n"
6190
6191 #. type: Plain text
6192 #: build/C/man2/select_tut.2:691
6193 #, no-wrap
6194 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6195 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6196
6197 #. type: Plain text
6198 #: build/C/man2/select_tut.2:694
6199 #, no-wrap
6200 msgid ""
6201 "        if (r == -1 && errno == EINTR)\n"
6202 "            continue;\n"
6203 msgstr ""
6204 "        if (r == -1 && errno == EINTR)\n"
6205 "            continue;\n"
6206
6207 #. type: Plain text
6208 #: build/C/man2/select_tut.2:699
6209 #, no-wrap
6210 msgid ""
6211 "        if (r == -1) {\n"
6212 "            perror(\"select()\");\n"
6213 "            exit(EXIT_FAILURE);\n"
6214 "        }\n"
6215 msgstr ""
6216 "        if (r == -1) {\n"
6217 "            perror(\"select()\");\n"
6218 "            exit(EXIT_FAILURE);\n"
6219 "        }\n"
6220
6221 #. type: Plain text
6222 #: build/C/man2/select_tut.2:703
6223 #, no-wrap
6224 msgid ""
6225 "        if (FD_ISSET(h, &rd)) {\n"
6226 "            unsigned int l;\n"
6227 "            struct sockaddr_in client_address;\n"
6228 msgstr ""
6229 "        if (FD_ISSET(h, &rd)) {\n"
6230 "            unsigned int l;\n"
6231 "            struct sockaddr_in client_address;\n"
6232
6233 #. type: Plain text
6234 #: build/C/man2/select_tut.2:722
6235 #, no-wrap
6236 msgid ""
6237 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6238 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6239 "            if (r == -1) {\n"
6240 "                perror(\"accept()\");\n"
6241 "            } else {\n"
6242 "                SHUT_FD1;\n"
6243 "                SHUT_FD2;\n"
6244 "                buf1_avail = buf1_written = 0;\n"
6245 "                buf2_avail = buf2_written = 0;\n"
6246 "                fd1 = r;\n"
6247 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6248 "                if (fd2 == -1)\n"
6249 "                    SHUT_FD1;\n"
6250 "                else\n"
6251 "                    printf(\"connect from %s\\en\",\n"
6252 "                            inet_ntoa(client_address.sin_addr));\n"
6253 "            }\n"
6254 "        }\n"
6255 msgstr ""
6256 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6257 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6258 "            if (r == -1) {\n"
6259 "                perror(\"accept()\");\n"
6260 "            } else {\n"
6261 "                SHUT_FD1;\n"
6262 "                SHUT_FD2;\n"
6263 "                buf1_avail = buf1_written = 0;\n"
6264 "                buf2_avail = buf2_written = 0;\n"
6265 "                fd1 = r;\n"
6266 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6267 "                if (fd2 == -1)\n"
6268 "                    SHUT_FD1;\n"
6269 "                else\n"
6270 "                    printf(\"connect from %s\\en\",\n"
6271 "                            inet_ntoa(client_address.sin_addr));\n"
6272 "            }\n"
6273 "        }\n"
6274
6275 #. type: Plain text
6276 #: build/C/man2/select_tut.2:724
6277 #, no-wrap
6278 msgid "        /* NB: read oob data before normal reads */\n"
6279 msgstr "        /* NB: read oob data before normal reads */\n"
6280
6281 #. type: Plain text
6282 #: build/C/man2/select_tut.2:728
6283 #, no-wrap
6284 msgid ""
6285 "        if (fd1 E<gt> 0)\n"
6286 "            if (FD_ISSET(fd1, &er)) {\n"
6287 "                char c;\n"
6288 msgstr ""
6289 "        if (fd1 E<gt> 0)\n"
6290 "            if (FD_ISSET(fd1, &er)) {\n"
6291 "                char c;\n"
6292
6293 #. type: Plain text
6294 #: build/C/man2/select_tut.2:738
6295 #, no-wrap
6296 msgid ""
6297 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6298 "                if (r E<lt> 1)\n"
6299 "                    SHUT_FD1;\n"
6300 "                else\n"
6301 "                    send(fd2, &c, 1, MSG_OOB);\n"
6302 "            }\n"
6303 "        if (fd2 E<gt> 0)\n"
6304 "            if (FD_ISSET(fd2, &er)) {\n"
6305 "                char c;\n"
6306 msgstr ""
6307 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6308 "                if (r E<lt> 1)\n"
6309 "                    SHUT_FD1;\n"
6310 "                else\n"
6311 "                    send(fd2, &c, 1, MSG_OOB);\n"
6312 "            }\n"
6313 "        if (fd2 E<gt> 0)\n"
6314 "            if (FD_ISSET(fd2, &er)) {\n"
6315 "                char c;\n"
6316
6317 #. type: Plain text
6318 #: build/C/man2/select_tut.2:781
6319 #, no-wrap
6320 msgid ""
6321 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6322 "                if (r E<lt> 1)\n"
6323 "                    SHUT_FD2;\n"
6324 "                else\n"
6325 "                    send(fd1, &c, 1, MSG_OOB);\n"
6326 "            }\n"
6327 "        if (fd1 E<gt> 0)\n"
6328 "            if (FD_ISSET(fd1, &rd)) {\n"
6329 "                r = read(fd1, buf1 + buf1_avail,\n"
6330 "                          BUF_SIZE - buf1_avail);\n"
6331 "                if (r E<lt> 1)\n"
6332 "                    SHUT_FD1;\n"
6333 "                else\n"
6334 "                    buf1_avail += r;\n"
6335 "            }\n"
6336 "        if (fd2 E<gt> 0)\n"
6337 "            if (FD_ISSET(fd2, &rd)) {\n"
6338 "                r = read(fd2, buf2 + buf2_avail,\n"
6339 "                          BUF_SIZE - buf2_avail);\n"
6340 "                if (r E<lt> 1)\n"
6341 "                    SHUT_FD2;\n"
6342 "                else\n"
6343 "                    buf2_avail += r;\n"
6344 "            }\n"
6345 "        if (fd1 E<gt> 0)\n"
6346 "            if (FD_ISSET(fd1, &wr)) {\n"
6347 "                r = write(fd1, buf2 + buf2_written,\n"
6348 "                           buf2_avail - buf2_written);\n"
6349 "                if (r E<lt> 1)\n"
6350 "                    SHUT_FD1;\n"
6351 "                else\n"
6352 "                    buf2_written += r;\n"
6353 "            }\n"
6354 "        if (fd2 E<gt> 0)\n"
6355 "            if (FD_ISSET(fd2, &wr)) {\n"
6356 "                r = write(fd2, buf1 + buf1_written,\n"
6357 "                           buf1_avail - buf1_written);\n"
6358 "                if (r E<lt> 1)\n"
6359 "                    SHUT_FD2;\n"
6360 "                else\n"
6361 "                    buf1_written += r;\n"
6362 "            }\n"
6363 msgstr ""
6364 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6365 "                if (r E<lt> 1)\n"
6366 "                    SHUT_FD2;\n"
6367 "                else\n"
6368 "                    send(fd1, &c, 1, MSG_OOB);\n"
6369 "            }\n"
6370 "        if (fd1 E<gt> 0)\n"
6371 "            if (FD_ISSET(fd1, &rd)) {\n"
6372 "                r = read(fd1, buf1 + buf1_avail,\n"
6373 "                          BUF_SIZE - buf1_avail);\n"
6374 "                if (r E<lt> 1)\n"
6375 "                    SHUT_FD1;\n"
6376 "                else\n"
6377 "                    buf1_avail += r;\n"
6378 "            }\n"
6379 "        if (fd2 E<gt> 0)\n"
6380 "            if (FD_ISSET(fd2, &rd)) {\n"
6381 "                r = read(fd2, buf2 + buf2_avail,\n"
6382 "                          BUF_SIZE - buf2_avail);\n"
6383 "                if (r E<lt> 1)\n"
6384 "                    SHUT_FD2;\n"
6385 "                else\n"
6386 "                    buf2_avail += r;\n"
6387 "            }\n"
6388 "        if (fd1 E<gt> 0)\n"
6389 "            if (FD_ISSET(fd1, &wr)) {\n"
6390 "                r = write(fd1, buf2 + buf2_written,\n"
6391 "                           buf2_avail - buf2_written);\n"
6392 "                if (r E<lt> 1)\n"
6393 "                    SHUT_FD1;\n"
6394 "                else\n"
6395 "                    buf2_written += r;\n"
6396 "            }\n"
6397 "        if (fd2 E<gt> 0)\n"
6398 "            if (FD_ISSET(fd2, &wr)) {\n"
6399 "                r = write(fd2, buf1 + buf1_written,\n"
6400 "                           buf1_avail - buf1_written);\n"
6401 "                if (r E<lt> 1)\n"
6402 "                    SHUT_FD2;\n"
6403 "                else\n"
6404 "                    buf1_written += r;\n"
6405 "            }\n"
6406
6407 #. type: Plain text
6408 #: build/C/man2/select_tut.2:783
6409 #, no-wrap
6410 msgid "        /* check if write data has caught read data */\n"
6411 msgstr "        /* check if write data has caught read data */\n"
6412
6413 #. type: Plain text
6414 #: build/C/man2/select_tut.2:788
6415 #, no-wrap
6416 msgid ""
6417 "        if (buf1_written == buf1_avail)\n"
6418 "            buf1_written = buf1_avail = 0;\n"
6419 "        if (buf2_written == buf2_avail)\n"
6420 "            buf2_written = buf2_avail = 0;\n"
6421 msgstr ""
6422 "        if (buf1_written == buf1_avail)\n"
6423 "            buf1_written = buf1_avail = 0;\n"
6424 "        if (buf2_written == buf2_avail)\n"
6425 "            buf2_written = buf2_avail = 0;\n"
6426
6427 #. type: Plain text
6428 #: build/C/man2/select_tut.2:791
6429 #, no-wrap
6430 msgid ""
6431 "        /* one side has closed the connection, keep\n"
6432 "           writing to the other side until empty */\n"
6433 msgstr ""
6434 "        /* one side has closed the connection, keep\n"
6435 "           writing to the other side until empty */\n"
6436
6437 #. type: Plain text
6438 #: build/C/man2/select_tut.2:799
6439 #, no-wrap
6440 msgid ""
6441 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6442 "            SHUT_FD2;\n"
6443 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6444 "            SHUT_FD1;\n"
6445 "    }\n"
6446 "    exit(EXIT_SUCCESS);\n"
6447 "}\n"
6448 msgstr ""
6449 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6450 "            SHUT_FD2;\n"
6451 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6452 "            SHUT_FD1;\n"
6453 "    }\n"
6454 "    exit(EXIT_SUCCESS);\n"
6455 "}\n"
6456
6457 #. type: Plain text
6458 #: build/C/man2/select_tut.2:813
6459 msgid ""
6460 "The above program properly forwards most kinds of TCP connections including "
6461 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6462 "problem of having data flow in both directions simultaneously.  You might "
6463 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6464 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6465 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6466 "because you end up using inefficient timeouts."
6467 msgstr ""
6468 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6469 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6470 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6471 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6472 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6473 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6474 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6475 "起こってしまう。"
6476
6477 #. type: Plain text
6478 #: build/C/man2/select_tut.2:819
6479 msgid ""
6480 "The program does not handle more than one simultaneous connection at a time, "
6481 "although it could easily be extended to do this with a linked list of buffers"
6482 "\\(emone for each connection.  At the moment, new connections cause the "
6483 "current connection to be dropped."
6484 msgstr ""
6485 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6486 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6487 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6488
6489 #.  .SH AUTHORS
6490 #.  This man page was written by Paul Sheer.
6491 #. type: Plain text
6492 #: build/C/man2/select_tut.2:838
6493 msgid ""
6494 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6495 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6496 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6497 "(3), B<epoll>(7)"
6498 msgstr ""
6499 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6500 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6501 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6502 "(3), B<epoll>(7)"
6503
6504 #. type: TH
6505 #: build/C/man2/send.2:40
6506 #, no-wrap
6507 msgid "SEND"
6508 msgstr "SEND"
6509
6510 #. type: TH
6511 #: build/C/man2/send.2:40
6512 #, no-wrap
6513 msgid "2012-04-23"
6514 msgstr "2012-04-23"
6515
6516 #. type: Plain text
6517 #: build/C/man2/send.2:43
6518 msgid "send, sendto, sendmsg - send a message on a socket"
6519 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6520
6521 #. type: Plain text
6522 #: build/C/man2/send.2:47
6523 #, no-wrap
6524 msgid ""
6525 "B<#include E<lt>sys/types.hE<gt>>\n"
6526 "B<#include E<lt>sys/socket.hE<gt>>\n"
6527 msgstr ""
6528 "B<#include E<lt>sys/types.hE<gt>>\n"
6529 "B<#include E<lt>sys/socket.hE<gt>>\n"
6530
6531 #. type: Plain text
6532 #: build/C/man2/send.2:50
6533 #, no-wrap
6534 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6535 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6536
6537 #. type: Plain text
6538 #: build/C/man2/send.2:54
6539 #, no-wrap
6540 msgid ""
6541 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6542 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6543 msgstr ""
6544 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6545 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6546
6547 #. type: Plain text
6548 #: build/C/man2/send.2:57
6549 #, no-wrap
6550 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6551 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6552
6553 #. type: Plain text
6554 #: build/C/man2/send.2:65
6555 msgid ""
6556 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6557 "transmit a message to another socket."
6558 msgstr ""
6559 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6560 "メッセージを転送するのに使用される。"
6561
6562 #. type: Plain text
6563 #: build/C/man2/send.2:84
6564 msgid ""
6565 "The B<send>()  call may be used only when the socket is in a I<connected> "
6566 "state (so that the intended recipient is known).  The only difference "
6567 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6568 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6569 "following call"
6570 msgstr ""
6571 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6572 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6573 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6574 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6575
6576 #. type: Plain text
6577 #: build/C/man2/send.2:86
6578 #, no-wrap
6579 msgid "    send(sockfd, buf, len, flags);\n"
6580 msgstr "    send(sockfd, buf, len, flags);\n"
6581
6582 #. type: Plain text
6583 #: build/C/man2/send.2:88
6584 msgid "is equivalent to"
6585 msgstr "は以下と等価である。"
6586
6587 #. type: Plain text
6588 #: build/C/man2/send.2:90
6589 #, no-wrap
6590 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6591 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6592
6593 #. type: Plain text
6594 #: build/C/man2/send.2:94
6595 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6596 msgstr ""
6597 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6598 "る。"
6599
6600 #. type: Plain text
6601 #: build/C/man2/send.2:122
6602 msgid ""
6603 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6604 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6605 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6606 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6607 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6608 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6609 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6610 "size."
6611 msgstr ""
6612 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6613 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6614 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6615 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6616 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6617 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6618 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6619 "msg_namelen> で指定される。"
6620
6621 #. type: Plain text
6622 #: build/C/man2/send.2:138
6623 msgid ""
6624 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6625 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6626 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6627 "ancillary data (also known as control information)."
6628 msgstr ""
6629 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6630 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6631 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6632 "(制御情報とも呼ばれる) を送信することもできる。"
6633
6634 #. type: Plain text
6635 #: build/C/man2/send.2:143
6636 msgid ""
6637 "If the message is too long to pass atomically through the underlying "
6638 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6639 "transmitted."
6640 msgstr ""
6641 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6642 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6643 "ラーが返され、そのメッセージは転送されない。"
6644
6645 #. type: Plain text
6646 #: build/C/man2/send.2:147
6647 msgid ""
6648 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6649 "detected errors are indicated by a return value of -1."
6650 msgstr ""
6651 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6652 "出された場合は、返り値 -1 として通知される。"
6653
6654 #. type: Plain text
6655 #: build/C/man2/send.2:160
6656 msgid ""
6657 "When the message does not fit into the send buffer of the socket, B<send>()  "
6658 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6659 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6660 "in this case.  The B<select>(2)  call may be used to determine when it is "
6661 "possible to send more data."
6662 msgstr ""
6663 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6664 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6665 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6666 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6667 "用することができる。"
6668
6669 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6670 #. type: Plain text
6671 #: build/C/man2/send.2:166
6672 msgid ""
6673 "The I<flags> argument is the bitwise OR of zero or more of the following "
6674 "flags."
6675 msgstr ""
6676 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6677 "のを指定する。"
6678
6679 #. type: TP
6680 #: build/C/man2/send.2:166
6681 #, no-wrap
6682 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6683 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6684
6685 #. type: Plain text
6686 #: build/C/man2/send.2:180
6687 msgid ""
6688 "Tell the link layer that forward progress happened: you got a successful "
6689 "reply from the other side.  If the link layer doesn't get this it will "
6690 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6691 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
6692 "IPv4 and IPv6.  See B<arp>(7)  for details."
6693 msgstr ""
6694 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6695 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6696 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6697 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6698 "されている。 詳しくは B<arp>(7)  参照のこと。"
6699
6700 #. type: TP
6701 #: build/C/man2/send.2:180
6702 #, no-wrap
6703 msgid "B<MSG_DONTROUTE>"
6704 msgstr "B<MSG_DONTROUTE>"
6705
6706 #. type: Plain text
6707 #: build/C/man2/send.2:188
6708 msgid ""
6709 "Don't use a gateway to send out the packet, send to hosts only on directly "
6710 "connected networks.  This is usually used only by diagnostic or routing "
6711 "programs.  This is defined only for protocol families that route; packet "
6712 "sockets don't."
6713 msgstr ""
6714 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6715 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6716 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6717 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6718
6719 #. type: Plain text
6720 #: build/C/man2/send.2:199
6721 msgid ""
6722 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6723 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6724 "flag with the B<F_SETFL> B<fcntl>(2))."
6725 msgstr ""
6726 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6727 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6728 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6729
6730 #. type: TP
6731 #: build/C/man2/send.2:199
6732 #, no-wrap
6733 msgid "B<MSG_EOR> (since Linux 2.2)"
6734 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6735
6736 #. type: Plain text
6737 #: build/C/man2/send.2:203
6738 msgid ""
6739 "Terminates a record (when this notion is supported, as for sockets of type "
6740 "B<SOCK_SEQPACKET>)."
6741 msgstr ""
6742 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6743 "ケット種別のときに有効)。"
6744
6745 #. type: TP
6746 #: build/C/man2/send.2:203
6747 #, no-wrap
6748 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6749 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6750
6751 #. type: Plain text
6752 #: build/C/man2/send.2:212
6753 msgid ""
6754 "The caller has more data to send.  This flag is used with TCP sockets to "
6755 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6756 "with the difference that this flag can be set on a per-call basis."
6757 msgstr ""
6758 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6759 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6760 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6761 "機能を有効にできる点である。"
6762
6763 #. type: Plain text
6764 #: build/C/man2/send.2:221
6765 msgid ""
6766 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6767 "the kernel to package all of the data sent in calls with this flag set into "
6768 "a single datagram which is transmitted only when a call is performed that "
6769 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6770 "described in B<udp>(7).)"
6771 msgstr ""
6772 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6773 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6774 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6775 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6776 "ソケットオプション B<UDP_CORK> も参照)。"
6777
6778 #. type: TP
6779 #: build/C/man2/send.2:221
6780 #, no-wrap
6781 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6782 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6783
6784 #. type: Plain text
6785 #: build/C/man2/send.2:230
6786 msgid ""
6787 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6788 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6789 msgstr ""
6790 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6791 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6792
6793 #. type: Plain text
6794 #: build/C/man2/send.2:239
6795 msgid ""
6796 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6797 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6798 "data."
6799 msgstr ""
6800 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6801 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6802 "をサポートしている必要がある。"
6803
6804 #. type: Plain text
6805 #: build/C/man2/send.2:246
6806 msgid ""
6807 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6808 "below for an exact description of its fields."
6809 msgstr ""
6810 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6811 "B<recv>(2)  と以下の説明を参照すること。"
6812
6813 #.  Still to be documented:
6814 #.   Send file descriptors and user credentials using the
6815 #.   msg_control* fields.
6816 #.   The flags returned in msg_flags.
6817 #. type: Plain text
6818 #: build/C/man2/send.2:275
6819 msgid ""
6820 "You may send control information using the I<msg_control> and "
6821 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6822 "process is limited per socket by the value in I</proc/sys/net/core/"
6823 "optmem_max>; see B<socket>(7)."
6824 msgstr ""
6825 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6826 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6827 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6828
6829 #. type: Plain text
6830 #: build/C/man2/send.2:280
6831 msgid ""
6832 "On success, these calls return the number of characters sent.  On error, -1 "
6833 "is returned, and I<errno> is set appropriately."
6834 msgstr ""
6835 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6836 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6837
6838 #. type: Plain text
6839 #: build/C/man2/send.2:285
6840 msgid ""
6841 "These are some standard errors generated by the socket layer.  Additional "
6842 "errors may be generated and returned from the underlying protocol modules; "
6843 "see their respective manual pages."
6844 msgstr ""
6845 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6846 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6847 "れぞれのマニュアルを参照すること。"
6848
6849 #. type: Plain text
6850 #: build/C/man2/send.2:293
6851 msgid ""
6852 "(For UNIX domain sockets, which are identified by pathname)  Write "
6853 "permission is denied on the destination socket file, or search permission is "
6854 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6855 "(7).)"
6856 msgstr ""
6857 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6858 "\n"
6859 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6860 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6861 "(B<path_resolution>(7) も参照のこと)"
6862
6863 #. type: Plain text
6864 #: build/C/man2/send.2:296
6865 msgid ""
6866 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6867 "as though it was a unicast address."
6868 msgstr ""
6869 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6870 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6871
6872 #.  Actually EAGAIN on Linux
6873 #. type: Plain text
6874 #: build/C/man2/send.2:304
6875 msgid ""
6876 "The socket is marked nonblocking and the requested operation would block.  "
6877 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6878 "require these constants to have the same value, so a portable application "
6879 "should check for both possibilities."
6880 msgstr ""
6881 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6882 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6883 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6884 "両方の可能性を 確認すべきである。"
6885
6886 #. type: Plain text
6887 #: build/C/man2/send.2:307
6888 msgid "An invalid descriptor was specified."
6889 msgstr "無効なディスクリプターが指定された。"
6890
6891 #. type: TP
6892 #: build/C/man2/send.2:307
6893 #, no-wrap
6894 msgid "B<ECONNRESET>"
6895 msgstr "B<ECONNRESET>"
6896
6897 #. type: Plain text
6898 #: build/C/man2/send.2:310
6899 msgid "Connection reset by peer."
6900 msgstr "接続が接続相手によりリセットされた。"
6901
6902 #. type: TP
6903 #: build/C/man2/send.2:310
6904 #, no-wrap
6905 msgid "B<EDESTADDRREQ>"
6906 msgstr "B<EDESTADDRREQ>"
6907
6908 #. type: Plain text
6909 #: build/C/man2/send.2:313
6910 msgid "The socket is not connection-mode, and no peer address is set."
6911 msgstr ""
6912 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6913 "ていない。"
6914
6915 #. type: Plain text
6916 #: build/C/man2/send.2:316
6917 msgid "An invalid user space address was specified for an argument."
6918 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6919
6920 #. type: Plain text
6921 #: build/C/man2/send.2:320
6922 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6923 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6924
6925 #. type: Plain text
6926 #: build/C/man2/send.2:329
6927 msgid ""
6928 "The connection-mode socket was connected already but a recipient was "
6929 "specified.  (Now either this error is returned, or the recipient "
6930 "specification is ignored.)"
6931 msgstr ""
6932 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6933 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6934 "いずれかとなる)"
6935
6936 #. type: TP
6937 #: build/C/man2/send.2:329
6938 #, no-wrap
6939 msgid "B<EMSGSIZE>"
6940 msgstr "B<EMSGSIZE>"
6941
6942 #.  (e.g., SOCK_DGRAM )
6943 #. type: Plain text
6944 #: build/C/man2/send.2:335
6945 msgid ""
6946 "The socket type requires that message be sent atomically, and the size of "
6947 "the message to be sent made this impossible."
6948 msgstr ""
6949 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6950 "るが、 メッセージが大き過ぎるため送信することができない。"
6951
6952 #. type: Plain text
6953 #: build/C/man2/send.2:343
6954 msgid ""
6955 "The output queue for a network interface was full.  This generally indicates "
6956 "that the interface has stopped sending, but may be caused by transient "
6957 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6958 "silently dropped when a device queue overflows.)"
6959 msgstr ""
6960 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6961 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6962 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6963 "フローした場合にはパケットは黙って捨てられる)"
6964
6965 #. type: Plain text
6966 #: build/C/man2/send.2:346
6967 msgid "No memory available."
6968 msgstr "メモリが足りない。"
6969
6970 #. type: Plain text
6971 #: build/C/man2/send.2:349
6972 msgid "The socket is not connected, and no target has been given."
6973 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6974
6975 #. type: Plain text
6976 #: build/C/man2/send.2:359
6977 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6978 msgstr ""
6979 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6980 "る。"
6981
6982 #. type: TP
6983 #: build/C/man2/send.2:359
6984 #, no-wrap
6985 msgid "B<EPIPE>"
6986 msgstr "B<EPIPE>"
6987
6988 #. type: Plain text
6989 #: build/C/man2/send.2:368
6990 msgid ""
6991 "The local end has been shut down on a connection oriented socket.  In this "
6992 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6993 "set."
6994 msgstr ""
6995 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6996 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6997
6998 #. type: Plain text
6999 #: build/C/man2/send.2:371
7000 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7001 msgstr ""
7002 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7003
7004 #. type: Plain text
7005 #: build/C/man2/send.2:382
7006 msgid ""
7007 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7008 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7009 "flag is a Linux extension."
7010 msgstr ""
7011 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7012 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7013 "ラグは Linux での拡張である。"
7014
7015 #. type: Plain text
7016 #: build/C/man2/send.2:395
7017 msgid ""
7018 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7019 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7020 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7021 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7022 "and libc5.  See also B<accept>(2)."
7023 msgstr ""
7024 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7025 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7026 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7027 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7028 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7029
7030 #. type: Plain text
7031 #: build/C/man2/send.2:414
7032 msgid ""
7033 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7034 "can be used to transmit multiple datagrams in a single call."
7035 msgstr ""
7036 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7037 "る\n"
7038 "Linux 固有の システムコールに関する情報が書かれている。"
7039
7040 #. type: Plain text
7041 #: build/C/man2/send.2:419
7042 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7043 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7044
7045 #. type: Plain text
7046 #: build/C/man2/send.2:424
7047 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7048 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7049
7050 #. type: Plain text
7051 #: build/C/man2/send.2:439
7052 msgid ""
7053 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7054 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7055 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7056 msgstr ""
7057 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7058 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7059 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7060
7061 #. type: TH
7062 #: build/C/man2/sendmmsg.2:28
7063 #, no-wrap
7064 msgid "SENDMMSG"
7065 msgstr "SENDMMSG"
7066
7067 #. type: TH
7068 #: build/C/man2/sendmmsg.2:28
7069 #, no-wrap
7070 msgid "2012-12-16"
7071 msgstr "2012-12-16"
7072
7073 #. type: Plain text
7074 #: build/C/man2/sendmmsg.2:31
7075 msgid "sendmmsg - send multiple messages on a socket"
7076 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7077
7078 #. type: Plain text
7079 #: build/C/man2/sendmmsg.2:39
7080 #, no-wrap
7081 msgid ""
7082 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7083 "B<             unsigned int >I<flags>B<);>\n"
7084 msgstr ""
7085 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7086 "B<             unsigned int >I<flags>B<);>\n"
7087
7088 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7089 #. type: Plain text
7090 #: build/C/man2/sendmmsg.2:49
7091 msgid ""
7092 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7093 "the caller to transmit multiple messages on a socket using a single system "
7094 "call.  (This has performance benefits for some applications.)"
7095 msgstr ""
7096 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7097 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7098 "ンによっては性能上のメリットがある)。"
7099
7100 #. type: Plain text
7101 #: build/C/man2/sendmmsg.2:54
7102 msgid ""
7103 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7104 "to be transmitted."
7105 msgstr ""
7106 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7107
7108 #. type: Plain text
7109 #: build/C/man2/sendmmsg.2:75
7110 #, no-wrap
7111 msgid ""
7112 "struct mmsghdr {\n"
7113 "    struct msghdr msg_hdr;  /* Message header */\n"
7114 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7115 "};\n"
7116 msgstr ""
7117 "struct mmsghdr {\n"
7118 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7119 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7120 "};\n"
7121
7122 #. type: Plain text
7123 #: build/C/man2/sendmmsg.2:91
7124 msgid ""
7125 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7126 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7127 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7128 "B<sendmsg>(2)  call)."
7129 msgstr ""
7130 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7131 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7132 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7133 "合の返り値と同じである。"
7134
7135 #. type: Plain text
7136 #: build/C/man2/sendmmsg.2:97
7137 msgid ""
7138 "The I<flags> argument contains flags ORed together.  The flags are the same "
7139 "as for B<sendmsg>(2)."
7140 msgstr ""
7141 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7142 "B<sendmsg>(2) と同じである。"
7143
7144 #. type: Plain text
7145 #: build/C/man2/sendmmsg.2:107
7146 msgid ""
7147 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7148 "sent.  A nonblocking call sends as many messages as possible (up to the "
7149 "limit specified by I<vlen>)  and returns immediately."
7150 msgstr ""
7151 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7152 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7153 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7154
7155 #. type: Plain text
7156 #: build/C/man2/sendmmsg.2:119
7157 msgid ""
7158 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7159 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7160 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7161 "of elements of I<msgvec> that have been updated."
7162 msgstr ""
7163 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7164 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7165 "しの返り値は、更新された I<msgvec> の要素数である。"
7166
7167 #. type: Plain text
7168 #: build/C/man2/sendmmsg.2:129
7169 msgid ""
7170 "On success, B<sendmmsg>()  returns the number of messages sent from "
7171 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7172 "B<sendmmsg>()  call to send the remaining messages."
7173 msgstr ""
7174 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7175 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7176 "て残りのメッセージを送信することができる。"
7177
7178 #. type: Plain text
7179 #: build/C/man2/sendmmsg.2:133
7180 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7181 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7182
7183 #
7184 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7185 #.      ... only return an error if no datagrams could be sent.
7186 #.      If less than the requested number of messages were sent, the application
7187 #.      must retry starting at the first failed one and if the problem is
7188 #.      persistent the error will be returned.
7189 #.      This matches the behaviour of other syscalls like read/write - it
7190 #.      is not an error if less than the requested number of elements are sent.
7191 #. type: Plain text
7192 #: build/C/man2/sendmmsg.2:145
7193 msgid ""
7194 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7195 "could be sent."
7196 msgstr ""
7197 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7198 "く送信できなかった場合のみである。"
7199
7200 #. type: Plain text
7201 #: build/C/man2/sendmmsg.2:150
7202 msgid ""
7203 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7204 "added in version 2.14."
7205 msgstr ""
7206 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7207 "バージョン 2.14 で追加された。"
7208
7209 #. type: Plain text
7210 #: build/C/man2/sendmmsg.2:153
7211 msgid "B<sendmmsg>()  is Linux-specific."
7212 msgstr "B<sendmmsg>() は Linux 固有である。"
7213
7214 #
7215 #
7216 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7217 #.      net: Cap number of elements for sendmmsg
7218 #.      To limit the amount of time we can spend in sendmmsg, cap the
7219 #.      number of elements to UIO_MAXIOV (currently 1024).
7220 #.      For error handling an application using sendmmsg needs to retry at
7221 #.      the first unsent message, so capping is simpler and requires less
7222 #.      application logic than returning EINVAL.
7223 #. type: Plain text
7224 #: build/C/man2/sendmmsg.2:168
7225 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7226 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7227
7228 #. type: Plain text
7229 #: build/C/man2/sendmmsg.2:177
7230 msgid ""
7231 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7232 "distinct UDP datagrams using one system call.  The contents of the first "
7233 "datagram originates from a pair of buffers."
7234 msgstr ""
7235 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7236 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7237 "の内容は、二つのバッファから取得される。"
7238
7239 #. type: Plain text
7240 #: build/C/man2/sendmmsg.2:186
7241 #, no-wrap
7242 msgid ""
7243 "#define _GNU_SOURCE\n"
7244 "#include E<lt>netinet/ip.hE<gt>\n"
7245 "#include E<lt>stdio.hE<gt>\n"
7246 "#include E<lt>stdlib.hE<gt>\n"
7247 "#include E<lt>string.hE<gt>\n"
7248 "#include E<lt>sys/types.hE<gt>\n"
7249 "#include E<lt>sys/socket.hE<gt>\n"
7250 msgstr ""
7251 "#define _GNU_SOURCE\n"
7252 "#include E<lt>netinet/ip.hE<gt>\n"
7253 "#include E<lt>stdio.hE<gt>\n"
7254 "#include E<lt>stdlib.hE<gt>\n"
7255 "#include E<lt>string.hE<gt>\n"
7256 "#include E<lt>sys/types.hE<gt>\n"
7257 "#include E<lt>sys/socket.hE<gt>\n"
7258
7259 #. type: Plain text
7260 #: build/C/man2/sendmmsg.2:195
7261 #, no-wrap
7262 msgid ""
7263 "int\n"
7264 "main(void)\n"
7265 "{\n"
7266 "    int sockfd;\n"
7267 "    struct sockaddr_in sa;\n"
7268 "    struct mmsghdr msg[2];\n"
7269 "    struct iovec msg1[2], msg2;\n"
7270 "    int retval;\n"
7271 msgstr ""
7272 "int\n"
7273 "main(void)\n"
7274 "{\n"
7275 "    int sockfd;\n"
7276 "    struct sockaddr_in sa;\n"
7277 "    struct mmsghdr msg[2];\n"
7278 "    struct iovec msg1[2], msg2;\n"
7279 "    int retval;\n"
7280
7281 #. type: Plain text
7282 #: build/C/man2/sendmmsg.2:209
7283 #, no-wrap
7284 msgid ""
7285 "    sa.sin_family = AF_INET;\n"
7286 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7287 "    sa.sin_port = htons(1234);\n"
7288 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7289 "        perror(\"connect()\");\n"
7290 "        exit(EXIT_FAILURE);\n"
7291 "    }\n"
7292 msgstr ""
7293 "    sa.sin_family = AF_INET;\n"
7294 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7295 "    sa.sin_port = htons(1234);\n"
7296 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7297 "        perror(\"connect()\");\n"
7298 "        exit(EXIT_FAILURE);\n"
7299 "    }\n"
7300
7301 #. type: Plain text
7302 #: build/C/man2/sendmmsg.2:215
7303 #, no-wrap
7304 msgid ""
7305 "    memset(msg1, 0, sizeof(msg1));\n"
7306 "    msg1[0].iov_base = \"one\";\n"
7307 "    msg1[0].iov_len = 3;\n"
7308 "    msg1[1].iov_base = \"two\";\n"
7309 "    msg1[1].iov_len = 3;\n"
7310 msgstr ""
7311 "    memset(msg1, 0, sizeof(msg1));\n"
7312 "    msg1[0].iov_base = \"one\";\n"
7313 "    msg1[0].iov_len = 3;\n"
7314 "    msg1[1].iov_base = \"two\";\n"
7315 "    msg1[1].iov_len = 3;\n"
7316
7317 #. type: Plain text
7318 #: build/C/man2/sendmmsg.2:219
7319 #, no-wrap
7320 msgid ""
7321 "    memset(&msg2, 0, sizeof(msg2));\n"
7322 "    msg2.iov_base = \"three\";\n"
7323 "    msg2.iov_len = 5;\n"
7324 msgstr ""
7325 "    memset(&msg2, 0, sizeof(msg2));\n"
7326 "    msg2.iov_base = \"three\";\n"
7327 "    msg2.iov_len = 5;\n"
7328
7329 #. type: Plain text
7330 #: build/C/man2/sendmmsg.2:223
7331 #, no-wrap
7332 msgid ""
7333 "    memset(msg, 0, sizeof(msg));\n"
7334 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7335 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7336 msgstr ""
7337 "    memset(msg, 0, sizeof(msg));\n"
7338 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7339 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7340
7341 #. type: Plain text
7342 #: build/C/man2/sendmmsg.2:226
7343 #, no-wrap
7344 msgid ""
7345 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7346 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7347 msgstr ""
7348 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7349 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7350
7351 #. type: Plain text
7352 #: build/C/man2/sendmmsg.2:232
7353 #, no-wrap
7354 msgid ""
7355 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7356 "    if (retval == -1)\n"
7357 "        perror(\"sendmmsg()\");\n"
7358 "    else\n"
7359 "        printf(\"%d messages sent\\en\", retval);\n"
7360 msgstr ""
7361 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7362 "    if (retval == -1)\n"
7363 "        perror(\"sendmmsg()\");\n"
7364 "    else\n"
7365 "        printf(\"%d messages sent\\en\", retval);\n"
7366
7367 #. type: Plain text
7368 #: build/C/man2/sendmmsg.2:235
7369 #, no-wrap
7370 msgid ""
7371 "    exit(0);\n"
7372 "}\n"
7373 msgstr ""
7374 "    exit(0);\n"
7375 "}\n"
7376
7377 #. type: Plain text
7378 #: build/C/man2/sendmmsg.2:241
7379 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7380 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7381
7382 #. type: TH
7383 #: build/C/man3/sockatmark.3:25
7384 #, no-wrap
7385 msgid "SOCKATMARK"
7386 msgstr "SOCKATMARK"
7387
7388 #. type: Plain text
7389 #: build/C/man3/sockatmark.3:28
7390 msgid "sockatmark - determine whether socket is at out-of-band mark"
7391 msgstr ""
7392 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7393 "べる"
7394
7395 #. type: Plain text
7396 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7397 #: build/C/man7/socket.7:50 build/C/man2/socketpair.2:49
7398 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7399 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7400
7401 #. type: Plain text
7402 #: build/C/man3/sockatmark.3:32
7403 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7404 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7405
7406 #. type: Plain text
7407 #: build/C/man3/sockatmark.3:41
7408 msgid ""
7409 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7410 "\\ 600"
7411 msgstr ""
7412 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7413 "\\ 600"
7414
7415 #. type: Plain text
7416 #: build/C/man3/sockatmark.3:51
7417 msgid ""
7418 "B<sockatmark>()  returns a value indicating whether or not the socket "
7419 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7420 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7421 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7422 msgstr ""
7423 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7424 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7425 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7426 "この関数は帯域外マークを削除しない。"
7427
7428 #. type: Plain text
7429 #: build/C/man3/sockatmark.3:58
7430 msgid ""
7431 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7432 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7433 "set to indicate the error."
7434 msgstr ""
7435 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7436 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7437 "れ、エラーを表す I<errno> が設定される。"
7438
7439 #. type: Plain text
7440 #: build/C/man3/sockatmark.3:63
7441 msgid "I<sockfd> is not a valid file descriptor."
7442 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7443
7444 #.  POSIX.1 says ENOTTY for this case
7445 #. type: Plain text
7446 #: build/C/man3/sockatmark.3:70
7447 msgid ""
7448 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7449 msgstr ""
7450 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7451
7452 #. type: Plain text
7453 #: build/C/man3/sockatmark.3:73
7454 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7455 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7456
7457 #. type: Plain text
7458 #: build/C/man3/sockatmark.3:75
7459 msgid "POSIX.1-2001."
7460 msgstr "POSIX.1-2001."
7461
7462 #. type: Plain text
7463 #: build/C/man3/sockatmark.3:82
7464 msgid ""
7465 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7466 "the B<MSG_OOB> flag of B<recv>(2)."
7467 msgstr ""
7468 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7469 "B<recv>(2)  で読み込むことができる。"
7470
7471 #. type: Plain text
7472 #: build/C/man3/sockatmark.3:84
7473 msgid "Out-of-band data is supported only on some stream socket protocols."
7474 msgstr ""
7475 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7476 "ない。"
7477
7478 #. type: Plain text
7479 #: build/C/man3/sockatmark.3:89
7480 msgid ""
7481 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7482 "signal."
7483 msgstr ""
7484 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7485 "る。"
7486
7487 #. type: Plain text
7488 #: build/C/man3/sockatmark.3:95
7489 msgid ""
7490 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7491 "operation."
7492 msgstr ""
7493 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7494
7495 #. type: Plain text
7496 #: build/C/man3/sockatmark.3:99
7497 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7498 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7499
7500 #. type: Plain text
7501 #: build/C/man3/sockatmark.3:104
7502 msgid ""
7503 "The following code can be used after receipt of a B<SIGURG> signal to read "
7504 "(and discard) all data up to the mark, and then read the byte of data at the "
7505 "mark:"
7506 msgstr ""
7507 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7508 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7509
7510 #. type: Plain text
7511 #: build/C/man3/sockatmark.3:109
7512 #, no-wrap
7513 msgid ""
7514 "    char buf[BUF_LEN];\n"
7515 "    char oobdata;\n"
7516 "    int atmark, s;\n"
7517 msgstr ""
7518 "    char buf[BUF_LEN];\n"
7519 "    char oobdata;\n"
7520 "    int atmark, s;\n"
7521
7522 #. type: Plain text
7523 #: build/C/man3/sockatmark.3:116
7524 #, no-wrap
7525 msgid ""
7526 "    for (;;) {\n"
7527 "        atmark = sockatmark(sockfd);\n"
7528 "        if (atmark == -1) {\n"
7529 "            perror(\"sockatmark\");\n"
7530 "            break;\n"
7531 "        }\n"
7532 msgstr ""
7533 "    for (;;) {\n"
7534 "        atmark = sockatmark(sockfd);\n"
7535 "        if (atmark == -1) {\n"
7536 "            perror(\"sockatmark\");\n"
7537 "            break;\n"
7538 "        }\n"
7539
7540 #. type: Plain text
7541 #: build/C/man3/sockatmark.3:119
7542 #, no-wrap
7543 msgid ""
7544 "        if (atmark)\n"
7545 "            break;\n"
7546 msgstr ""
7547 "        if (atmark)\n"
7548 "            break;\n"
7549
7550 #. type: Plain text
7551 #: build/C/man3/sockatmark.3:126
7552 #, no-wrap
7553 msgid ""
7554 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7555 "        if (s == -1)\n"
7556 "            perror(\"read\");\n"
7557 "        if (s E<lt>= 0)\n"
7558 "            break;\n"
7559 "    }\n"
7560 msgstr ""
7561 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7562 "        if (s == -1)\n"
7563 "            perror(\"read\");\n"
7564 "        if (s E<lt>= 0)\n"
7565 "            break;\n"
7566 "    }\n"
7567
7568 #. type: Plain text
7569 #: build/C/man3/sockatmark.3:133
7570 #, no-wrap
7571 msgid ""
7572 "    if (atmark == 1) {\n"
7573 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7574 "            perror(\"recv\");\n"
7575 "            ...\n"
7576 "        }\n"
7577 "    }\n"
7578 msgstr ""
7579 "    if (atmark == 1) {\n"
7580 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7581 "            perror(\"recv\");\n"
7582 "            ...\n"
7583 "        }\n"
7584 "    }\n"
7585
7586 #. type: Plain text
7587 #: build/C/man3/sockatmark.3:139
7588 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7589 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7590
7591 #. type: TH
7592 #: build/C/man2/socket.2:43 build/C/man7/socket.7:45
7593 #, no-wrap
7594 msgid "SOCKET"
7595 msgstr "SOCKET"
7596
7597 #. type: TH
7598 #: build/C/man2/socket.2:43
7599 #, no-wrap
7600 msgid "2009-01-19"
7601 msgstr "2009-01-19"
7602
7603 #. type: Plain text
7604 #: build/C/man2/socket.2:46
7605 msgid "socket - create an endpoint for communication"
7606 msgstr "socket - 通信のための端点(endpoint)を作成する"
7607
7608 #. type: Plain text
7609 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7610 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7611 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7612
7613 #. type: Plain text
7614 #: build/C/man2/socket.2:52
7615 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7616 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7617
7618 #. type: Plain text
7619 #: build/C/man2/socket.2:55
7620 msgid ""
7621 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7622 msgstr ""
7623 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7624 "(descriptor)を返す。"
7625
7626 #. type: Plain text
7627 #: build/C/man2/socket.2:63
7628 msgid ""
7629 "The I<domain> argument specifies a communication domain; this selects the "
7630 "protocol family which will be used for communication.  These families are "
7631 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7632 "include:"
7633 msgstr ""
7634 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7635 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7636 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7637 "下の通り。"
7638
7639 #. type: tbl table
7640 #: build/C/man2/socket.2:66
7641 #, no-wrap
7642 msgid "Name:Purpose:Man page\n"
7643 msgstr "名前:目的:マニュアル\n"
7644
7645 #. type: tbl table
7646 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7647 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7648 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7649 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7650 #, no-wrap
7651 msgid "T{\n"
7652 msgstr "T{\n"
7653
7654 #. type: tbl table
7655 #: build/C/man2/socket.2:68
7656 #, no-wrap
7657 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7658 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7659
7660 #. type: tbl table
7661 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7662 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7663 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7664 #: build/C/man7/socket.7:181
7665 #, no-wrap
7666 msgid "T}:T{\n"
7667 msgstr "T}:T{\n"
7668
7669 #. type: tbl table
7670 #: build/C/man2/socket.2:70
7671 #, no-wrap
7672 msgid "Local communication\n"
7673 msgstr "ローカル通信\n"
7674
7675 #. type: tbl table
7676 #: build/C/man2/socket.2:72
7677 #, no-wrap
7678 msgid "B<unix>(7)\n"
7679 msgstr "B<unix>(7)\n"
7680
7681 #. type: tbl table
7682 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7683 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7684 #: build/C/man2/socket.2:118 build/C/man7/socket.7:160
7685 #: build/C/man7/socket.7:164 build/C/man7/socket.7:167
7686 #: build/C/man7/socket.7:173 build/C/man7/socket.7:176
7687 #: build/C/man7/socket.7:185 build/C/man7/socket.7:192
7688 #, no-wrap
7689 msgid "T}\n"
7690 msgstr "T}\n"
7691
7692 #. type: tbl table
7693 #: build/C/man2/socket.2:75
7694 #, no-wrap
7695 msgid "B<AF_INET>\n"
7696 msgstr "B<AF_INET>\n"
7697
7698 #. type: tbl table
7699 #: build/C/man2/socket.2:76
7700 #, no-wrap
7701 msgid "T}:IPv4 Internet protocols:T{\n"
7702 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7703
7704 #. type: tbl table
7705 #: build/C/man2/socket.2:77
7706 #, no-wrap
7707 msgid "B<ip>(7)\n"
7708 msgstr "B<ip>(7)\n"
7709
7710 #. type: tbl table
7711 #: build/C/man2/socket.2:80
7712 #, no-wrap
7713 msgid "B<AF_INET6>\n"
7714 msgstr "B<AF_INET6>\n"
7715
7716 #. type: tbl table
7717 #: build/C/man2/socket.2:81
7718 #, no-wrap
7719 msgid "T}:IPv6 Internet protocols:T{\n"
7720 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7721
7722 #. type: tbl table
7723 #: build/C/man2/socket.2:82
7724 #, no-wrap
7725 msgid "B<ipv6>(7)\n"
7726 msgstr "B<ipv6>(7)\n"
7727
7728 #. type: tbl table
7729 #: build/C/man2/socket.2:85
7730 #, no-wrap
7731 msgid "B<AF_IPX>\n"
7732 msgstr "B<AF_IPX>\n"
7733
7734 #. type: tbl table
7735 #: build/C/man2/socket.2:86
7736 #, no-wrap
7737 msgid "T}:IPX - Novell protocols:\n"
7738 msgstr "T}:IPX - Novell プロトコル:\n"
7739
7740 #. type: tbl table
7741 #: build/C/man2/socket.2:88
7742 #, no-wrap
7743 msgid "B<AF_NETLINK>\n"
7744 msgstr "B<AF_NETLINK>\n"
7745
7746 #. type: tbl table
7747 #: build/C/man2/socket.2:90
7748 #, no-wrap
7749 msgid "Kernel user interface device\n"
7750 msgstr "カーネル・ユーザ・デバイス\n"
7751
7752 #. type: tbl table
7753 #: build/C/man2/socket.2:92
7754 #, no-wrap
7755 msgid "B<netlink>(7)\n"
7756 msgstr "B<netlink>(7)\n"
7757
7758 #. type: tbl table
7759 #: build/C/man2/socket.2:95
7760 #, no-wrap
7761 msgid "B<AF_X25>\n"
7762 msgstr "B<AF_X25>\n"
7763
7764 #. type: tbl table
7765 #: build/C/man2/socket.2:96
7766 #, no-wrap
7767 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
7768 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
7769
7770 #. type: tbl table
7771 #: build/C/man2/socket.2:97
7772 #, no-wrap
7773 msgid "B<x25>(7)\n"
7774 msgstr "B<x25>(7)\n"
7775
7776 #. type: tbl table
7777 #: build/C/man2/socket.2:100
7778 #, no-wrap
7779 msgid "B<AF_AX25>\n"
7780 msgstr "B<AF_AX25>\n"
7781
7782 #. type: tbl table
7783 #: build/C/man2/socket.2:102
7784 #, no-wrap
7785 msgid "Amateur radio AX.25 protocol\n"
7786 msgstr "アマチュア無線 AX.25 プロトコル\n"
7787
7788 #. type: tbl table
7789 #: build/C/man2/socket.2:103
7790 #, no-wrap
7791 msgid "T}:\n"
7792 msgstr "T}:\n"
7793
7794 #. type: tbl table
7795 #: build/C/man2/socket.2:105
7796 #, no-wrap
7797 msgid "B<AF_ATMPVC>\n"
7798 msgstr "B<AF_ATMPVC>\n"
7799
7800 #. type: tbl table
7801 #: build/C/man2/socket.2:106
7802 #, no-wrap
7803 msgid "T}:Access to raw ATM PVCs:\n"
7804 msgstr "T}:生の ATM PVC にアクセスする:\n"
7805
7806 #. type: tbl table
7807 #: build/C/man2/socket.2:108
7808 #, no-wrap
7809 msgid "B<AF_APPLETALK>\n"
7810 msgstr "B<AF_APPLETALK>\n"
7811
7812 #. type: tbl table
7813 #: build/C/man2/socket.2:109
7814 #, no-wrap
7815 msgid "T}:Appletalk:T{\n"
7816 msgstr "T}:アップルトーク:T{\n"
7817
7818 #. type: tbl table
7819 #: build/C/man2/socket.2:110
7820 #, no-wrap
7821 msgid "B<ddp>(7)\n"
7822 msgstr "B<ddp>(7)\n"
7823
7824 #. type: tbl table
7825 #: build/C/man2/socket.2:113
7826 #, no-wrap
7827 msgid "B<AF_PACKET>\n"
7828 msgstr "B<AF_PACKET>\n"
7829
7830 #. type: tbl table
7831 #: build/C/man2/socket.2:115
7832 #, no-wrap
7833 msgid "Low level packet interface\n"
7834 msgstr "低レベルのパケットインターフェース\n"
7835
7836 #. type: tbl table
7837 #: build/C/man2/socket.2:117
7838 #, no-wrap
7839 msgid "B<packet>(7)\n"
7840 msgstr "B<packet>(7)\n"
7841
7842 #. type: Plain text
7843 #: build/C/man2/socket.2:126
7844 msgid ""
7845 "The socket has the indicated I<type>, which specifies the communication "
7846 "semantics.  Currently defined types are:"
7847 msgstr ""
7848 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7849 "る。 定義されている型は現在以下の通り。"
7850
7851 #. type: TP
7852 #: build/C/man2/socket.2:126
7853 #, no-wrap
7854 msgid "B<SOCK_STREAM>"
7855 msgstr "B<SOCK_STREAM>"
7856
7857 #. type: Plain text
7858 #: build/C/man2/socket.2:130
7859 msgid ""
7860 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
7861 "out-of-band data transmission mechanism may be supported."
7862 msgstr ""
7863 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7864 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7865
7866 #. type: TP
7867 #: build/C/man2/socket.2:130
7868 #, no-wrap
7869 msgid "B<SOCK_DGRAM>"
7870 msgstr "B<SOCK_DGRAM>"
7871
7872 #. type: Plain text
7873 #: build/C/man2/socket.2:134
7874 msgid ""
7875 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7876 "length)."
7877 msgstr ""
7878 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
7879 "する。"
7880
7881 #. type: TP
7882 #: build/C/man2/socket.2:134
7883 #, no-wrap
7884 msgid "B<SOCK_SEQPACKET>"
7885 msgstr "B<SOCK_SEQPACKET>"
7886
7887 #. type: Plain text
7888 #: build/C/man2/socket.2:139
7889 msgid ""
7890 "Provides a sequenced, reliable, two-way connection-based data transmission "
7891 "path for datagrams of fixed maximum length; a consumer is required to read "
7892 "an entire packet with each input system call."
7893 msgstr ""
7894 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7895 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7896 "ト全体を読み取ることが要求される。"
7897
7898 #. type: TP
7899 #: build/C/man2/socket.2:139
7900 #, no-wrap
7901 msgid "B<SOCK_RAW>"
7902 msgstr "B<SOCK_RAW>"
7903
7904 #. type: Plain text
7905 #: build/C/man2/socket.2:142
7906 msgid "Provides raw network protocol access."
7907 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7908
7909 #. type: TP
7910 #: build/C/man2/socket.2:142
7911 #, no-wrap
7912 msgid "B<SOCK_RDM>"
7913 msgstr "B<SOCK_RDM>"
7914
7915 #. type: Plain text
7916 #: build/C/man2/socket.2:145
7917 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7918 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7919
7920 #. type: TP
7921 #: build/C/man2/socket.2:145
7922 #, no-wrap
7923 msgid "B<SOCK_PACKET>"
7924 msgstr "B<SOCK_PACKET>"
7925
7926 #. type: Plain text
7927 #: build/C/man2/socket.2:150
7928 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7929 msgstr ""
7930 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7931 "こと"
7932
7933 #. type: Plain text
7934 #: build/C/man2/socket.2:156
7935 msgid ""
7936 "Some socket types may not be implemented by all protocol families; for "
7937 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7938 msgstr ""
7939 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7940 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7941
7942 #. type: Plain text
7943 #: build/C/man2/socket.2:164
7944 msgid ""
7945 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7946 "addition to specifying a socket type, it may include the bitwise OR of any "
7947 "of the following values, to modify the behavior of B<socket>():"
7948 msgstr ""
7949 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7950 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7951 "ることで、 B<socket>()  の振舞いを変更することができる。"
7952
7953 #. type: Plain text
7954 #: build/C/man2/socket.2:198
7955 msgid ""
7956 "The I<protocol> specifies a particular protocol to be used with the socket.  "
7957 "Normally only a single protocol exists to support a particular socket type "
7958 "within a given protocol family, in which case I<protocol> can be specified "
7959 "as 0.  However, it is possible that many protocols may exist, in which case "
7960 "a particular protocol must be specified in this manner.  The protocol number "
7961 "to use is specific to the ``communication domain'' in which communication is "
7962 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
7963 "protocol name strings to protocol numbers."
7964 msgstr ""
7965 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7966 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7967 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7968 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7969 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7970 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
7971 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
7972
7973 #. type: Plain text
7974 #: build/C/man2/socket.2:228
7975 msgid ""
7976 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7977 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7978 "a I<connected> state before any data may be sent or received on it.  A "
7979 "connection to another socket is created with a B<connect>(2)  call.  Once "
7980 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7981 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7982 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7983 "also be transmitted as described in B<send>(2)  and received as described in "
7984 "B<recv>(2)."
7985 msgstr ""
7986 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7987 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7988 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7989 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7990 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7991 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7992 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7993
7994 #. type: Plain text
7995 #: build/C/man2/socket.2:254
7996 msgid ""
7997 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7998 "data is not lost or duplicated.  If a piece of data for which the peer "
7999 "protocol has buffer space cannot be successfully transmitted within a "
8000 "reasonable length of time, then the connection is considered to be dead.  "
8001 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8002 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8003 "signal is raised if a process sends or receives on a broken stream; this "
8004 "causes naive processes, which do not handle the signal, to exit.  "
8005 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8006 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8007 "amount of data requested, and any data remaining in the arriving packet will "
8008 "be discarded.  Also all message boundaries in incoming datagrams are "
8009 "preserved."
8010 msgstr ""
8011 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8012 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8013 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8014 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8015 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8016 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8017 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8018 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8019 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8020 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8021
8022 #. type: Plain text
8023 #: build/C/man2/socket.2:264
8024 msgid ""
8025 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8026 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8027 "received with B<recvfrom>(2), which returns the next datagram along with the "
8028 "address of its sender."
8029 msgstr ""
8030 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8031 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8032 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8033 "す。"
8034
8035 #. type: Plain text
8036 #: build/C/man2/socket.2:271
8037 msgid ""
8038 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8039 "from the device driver.  Use B<packet>(7)  instead."
8040 msgstr ""
8041 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8042 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8043
8044 #. type: Plain text
8045 #: build/C/man2/socket.2:294
8046 msgid ""
8047 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8048 "process group to receive a B<SIGURG> signal when the out-of-band data "
8049 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8050 "unexpectedly.  This operation may also be used to set the process or process "
8051 "group that receives the I/O and asynchronous notification of I/O events via "
8052 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8053 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8054 msgstr ""
8055 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8056 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8057 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8058 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8059 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8060 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8061 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8062
8063 #. type: Plain text
8064 #: build/C/man2/socket.2:304
8065 msgid ""
8066 "When the network signals an error condition to the protocol module (e.g., "
8067 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8068 "The next operation on this socket will return the error code of the pending "
8069 "error.  For some protocols it is possible to enable a per-socket error queue "
8070 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8071 "(7)."
8072 msgstr ""
8073 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8074 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8075 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8076 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8077 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8078 "B<IP_RECVERR> を参照すること。"
8079
8080 #. type: Plain text
8081 #: build/C/man2/socket.2:314
8082 msgid ""
8083 "The operation of sockets is controlled by socket level I<options>.  These "
8084 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8085 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8086 "respectively."
8087 msgstr ""
8088 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8089 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8090 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8091
8092 #. type: Plain text
8093 #: build/C/man2/socket.2:319
8094 msgid ""
8095 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8096 "is returned, and I<errno> is set appropriately."
8097 msgstr ""
8098 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8099 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8100
8101 #. type: Plain text
8102 #: build/C/man2/socket.2:324
8103 msgid ""
8104 "Permission to create a socket of the specified type and/or protocol is "
8105 "denied."
8106 msgstr ""
8107 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8108
8109 #. type: Plain text
8110 #: build/C/man2/socket.2:327
8111 msgid "The implementation does not support the specified address family."
8112 msgstr "指定されたアドレスファミリーがサポートされていない。"
8113
8114 #. type: Plain text
8115 #: build/C/man2/socket.2:330
8116 msgid "Unknown protocol, or protocol family not available."
8117 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8118
8119 #.  Since Linux 2.6.27
8120 #. type: Plain text
8121 #: build/C/man2/socket.2:335
8122 msgid "Invalid flags in I<type>."
8123 msgstr "I<type> に無効なフラグが指定されている。"
8124
8125 #. type: Plain text
8126 #: build/C/man2/socket.2:338
8127 msgid "Process file table overflow."
8128 msgstr "プロセスのファイルテーブルが溢れている。"
8129
8130 #. type: TP
8131 #: build/C/man2/socket.2:341
8132 #, no-wrap
8133 msgid "B<ENOBUFS> or B<ENOMEM>"
8134 msgstr "B<ENOBUFS> または B<ENOMEM>"
8135
8136 #. type: Plain text
8137 #: build/C/man2/socket.2:346
8138 msgid ""
8139 "Insufficient memory is available.  The socket cannot be created until "
8140 "sufficient resources are freed."
8141 msgstr ""
8142 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8143 "ない。"
8144
8145 #. type: TP
8146 #: build/C/man2/socket.2:346 build/C/man2/socketpair.2:92
8147 #, no-wrap
8148 msgid "B<EPROTONOSUPPORT>"
8149 msgstr "B<EPROTONOSUPPORT>"
8150
8151 #. type: Plain text
8152 #: build/C/man2/socket.2:350
8153 msgid ""
8154 "The protocol type or the specified protocol is not supported within this "
8155 "domain."
8156 msgstr ""
8157 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8158 "いない。"
8159
8160 #. type: Plain text
8161 #: build/C/man2/socket.2:352
8162 msgid "Other errors may be generated by the underlying protocol modules."
8163 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8164
8165 #. type: Plain text
8166 #: build/C/man2/socket.2:354
8167 msgid "4.4BSD, POSIX.1-2001."
8168 msgstr "4.4BSD, POSIX.1-2001."
8169
8170 #. type: Plain text
8171 #: build/C/man2/socket.2:360
8172 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8173 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8174
8175 #. type: Plain text
8176 #: build/C/man2/socket.2:366
8177 msgid ""
8178 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8179 "systems supporting clones of the BSD socket layer (including System V "
8180 "variants)."
8181 msgstr ""
8182 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8183 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8184 "外のシステムからの移植ができる。"
8185
8186 #. type: Plain text
8187 #: build/C/man2/socket.2:385
8188 msgid ""
8189 "The manifest constants used under 4.x BSD for protocol families are "
8190 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8191 "are used for address families.  However, already the BSD man page promises: "
8192 "\"The protocol family generally is the same as the address family\", and "
8193 "subsequent standards use AF_* everywhere."
8194 msgstr ""
8195 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8196 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8197 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8198 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8199 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8200 "それ以外の規格では全ての場所で AF_* が使用されている。"
8201
8202 #. type: Plain text
8203 #: build/C/man2/socket.2:390
8204 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8205 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8206
8207 #. type: Plain text
8208 #: build/C/man2/socket.2:413
8209 msgid ""
8210 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8211 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8212 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8213 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8214 "(7), B<unix>(7)"
8215 msgstr ""
8216 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8217 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8218 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8219 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8220 "(7), B<unix>(7)"
8221
8222 #. type: Plain text
8223 #: build/C/man2/socket.2:419
8224 msgid ""
8225 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8226 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8227 "Programmer's Supplementary Documents Volume 1.>"
8228 msgstr ""
8229 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8230 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8231 "Supplementary Documents Volume 1.> として再版された)"
8232
8233 #. type: Plain text
8234 #: build/C/man7/socket.7:48
8235 msgid "socket - Linux socket interface"
8236 msgstr "socket - Linux のソケットインターフェース"
8237
8238 #. type: Plain text
8239 #: build/C/man7/socket.7:52
8240 msgid ""
8241 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8242 ">I<protocol>B<);>"
8243 msgstr ""
8244 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8245 ">I<protocol>B<);>"
8246
8247 #. type: Plain text
8248 #: build/C/man7/socket.7:71
8249 msgid ""
8250 "This manual page describes the Linux networking socket layer user "
8251 "interface.  The BSD compatible sockets are the uniform interface between the "
8252 "user process and the network protocol stacks in the kernel.  The protocol "
8253 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
8254 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
8255 "B<socket>(2)  for more information on families and types."
8256 msgstr ""
8257 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8258 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8259 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8260 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8261 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8262 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8263 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8264
8265 #. type: SS
8266 #: build/C/man7/socket.7:71
8267 #, no-wrap
8268 msgid "Socket-layer functions"
8269 msgstr "ソケット層の関数群"
8270
8271 #. type: Plain text
8272 #: build/C/man7/socket.7:75
8273 msgid ""
8274 "These functions are used by the user process to send or receive packets and "
8275 "to do other socket operations.  For more information see their respective "
8276 "manual pages."
8277 msgstr ""
8278 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8279 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8280
8281 #. type: Plain text
8282 #: build/C/man7/socket.7:91
8283 msgid ""
8284 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8285 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8286 "address, B<listen>(2)  tells the socket that new connections shall be "
8287 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8288 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8289 "(implemented only for a few local families like B<AF_UNIX>)"
8290 msgstr ""
8291 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8292 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8293 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8294 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8295 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8296 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8297 "リーでしか実装されていない)。"
8298
8299 #. type: Plain text
8300 #: build/C/man7/socket.7:113
8301 msgid ""
8302 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8303 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8304 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8305 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8306 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8307 "write data."
8308 msgstr ""
8309 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8310 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8311 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8312 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8313 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8314 "ことができる。"
8315
8316 #. type: Plain text
8317 #: build/C/man7/socket.7:124
8318 msgid ""
8319 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8320 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8321 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8322 "be used to set or read some other options."
8323 msgstr ""
8324 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8325 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8326 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8327 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8328
8329 #. type: Plain text
8330 #: build/C/man7/socket.7:129
8331 msgid ""
8332 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8333 "full-duplex socket connection."
8334 msgstr ""
8335 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8336 "続を部分的にクローズする。"
8337
8338 #. type: Plain text
8339 #: build/C/man7/socket.7:135
8340 msgid ""
8341 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8342 "not supported on sockets."
8343 msgstr ""
8344 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8345 "ではサポートされていない。"
8346
8347 #. type: Plain text
8348 #: build/C/man7/socket.7:152
8349 msgid ""
8350 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8351 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8352 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8353 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8354 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8355 msgstr ""
8356 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8357 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8358 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8359 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8360 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8361 "B<select>(2)  を使って待つことができる。"
8362
8363 #. type: tbl table
8364 #: build/C/man7/socket.7:156
8365 #, no-wrap
8366 msgid "I/O events\n"
8367 msgstr "I/O イベント\n"
8368
8369 #. type: tbl table
8370 #: build/C/man7/socket.7:157
8371 #, no-wrap
8372 msgid "Event:Poll flag:Occurrence\n"
8373 msgstr "イベント:poll フラグ:内容\n"
8374
8375 #. type: tbl table
8376 #: build/C/man7/socket.7:158 build/C/man7/socket.7:161
8377 #, no-wrap
8378 msgid "Read:POLLIN:T{\n"
8379 msgstr "Read:POLLIN:T{\n"
8380
8381 #. type: tbl table
8382 #: build/C/man7/socket.7:159
8383 #, no-wrap
8384 msgid "New data arrived.\n"
8385 msgstr "新しいデータが到着した。\n"
8386
8387 #. type: tbl table
8388 #: build/C/man7/socket.7:162
8389 #, no-wrap
8390 msgid "A connection setup has been completed\n"
8391 msgstr "(接続志向のソケットで)\n"
8392
8393 #. type: tbl table
8394 #: build/C/man7/socket.7:163
8395 #, no-wrap
8396 msgid "(for connection-oriented sockets)\n"
8397 msgstr "接続の設定が終了した。\n"
8398
8399 #. type: tbl table
8400 #: build/C/man7/socket.7:165 build/C/man7/socket.7:168
8401 #, no-wrap
8402 msgid "Read:POLLHUP:T{\n"
8403 msgstr "Read:POLLHUP:T{\n"
8404
8405 #. type: tbl table
8406 #: build/C/man7/socket.7:166
8407 #, no-wrap
8408 msgid "A disconnection request has been initiated by the other end.\n"
8409 msgstr "接続先で切断要求が生成された。\n"
8410
8411 #. type: tbl table
8412 #: build/C/man7/socket.7:169
8413 #, no-wrap
8414 msgid "A connection is broken (only for connection-oriented protocols).\n"
8415 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8416
8417 #. type: tbl table
8418 #: build/C/man7/socket.7:170
8419 #, no-wrap
8420 msgid "When the socket is written\n"
8421 msgstr "この場合、ソケットに書き込みが行われると\n"
8422
8423 #. type: tbl table
8424 #: build/C/man7/socket.7:171
8425 #, no-wrap
8426 msgid "B<SIGPIPE>\n"
8427 msgstr "B<SIGPIPE>\n"
8428
8429 #. type: tbl table
8430 #: build/C/man7/socket.7:172
8431 #, no-wrap
8432 msgid "is also sent.\n"
8433 msgstr "も送信される。\n"
8434
8435 #. type: tbl table
8436 #: build/C/man7/socket.7:174
8437 #, no-wrap
8438 msgid "Write:POLLOUT:T{\n"
8439 msgstr "Write:POLLOUT:T{\n"
8440
8441 #. type: tbl table
8442 #: build/C/man7/socket.7:175
8443 #, no-wrap
8444 msgid "Socket has enough send buffer space for writing new data.\n"
8445 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8446
8447 #. type: tbl table
8448 #: build/C/man7/socket.7:177
8449 #, no-wrap
8450 msgid "Read/Write:T{\n"
8451 msgstr "Read/Write:T{\n"
8452
8453 #. type: tbl table
8454 #: build/C/man7/socket.7:178
8455 #, no-wrap
8456 msgid "POLLIN|\n"
8457 msgstr "POLLIN|\n"
8458
8459 #. type: tbl table
8460 #: build/C/man7/socket.7:179
8461 #, no-wrap
8462 msgid ".br\n"
8463 msgstr ".br\n"
8464
8465 #. type: tbl table
8466 #: build/C/man7/socket.7:180
8467 #, no-wrap
8468 msgid "POLLOUT\n"
8469 msgstr "POLLOUT\n"
8470
8471 #. type: tbl table
8472 #: build/C/man7/socket.7:182
8473 #, no-wrap
8474 msgid "An outgoing\n"
8475 msgstr "外部向けの\n"
8476
8477 #. type: tbl table
8478 #: build/C/man7/socket.7:183
8479 #, no-wrap
8480 msgid "B<connect>(2)\n"
8481 msgstr "B<connect>(2)\n"
8482
8483 #. type: tbl table
8484 #: build/C/man7/socket.7:184
8485 #, no-wrap
8486 msgid "finished.\n"
8487 msgstr "が終了した。\n"
8488
8489 #. type: tbl table
8490 #: build/C/man7/socket.7:186
8491 #, no-wrap
8492 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8493 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8494
8495 #. type: tbl table
8496 #: build/C/man7/socket.7:187
8497 #, no-wrap
8498 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8499 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8500
8501 #. type: tbl table
8502 #: build/C/man7/socket.7:188
8503 #, no-wrap
8504 msgid "Exception:POLLPRI:T{\n"
8505 msgstr "Exception:POLLPRI:T{\n"
8506
8507 #. type: tbl table
8508 #: build/C/man7/socket.7:189
8509 #, no-wrap
8510 msgid "Urgent data arrived.\n"
8511 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8512
8513 #. type: tbl table
8514 #: build/C/man7/socket.7:190
8515 #, no-wrap
8516 msgid "B<SIGURG>\n"
8517 msgstr "B<SIGURG>\n"
8518
8519 #. type: tbl table
8520 #: build/C/man7/socket.7:191
8521 #, no-wrap
8522 msgid "is sent then.\n"
8523 msgstr "が送信される。\n"
8524
8525 #. type: Plain text
8526 #: build/C/man7/socket.7:220
8527 msgid ""
8528 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8529 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8530 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8531 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8532 "I<Signals> discussion below."
8533 msgstr ""
8534 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8535 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8536 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8537 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8538 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8539 "と。"
8540
8541 #. type: SS
8542 #: build/C/man7/socket.7:220
8543 #, no-wrap
8544 msgid "Socket address structures"
8545 msgstr "ソケットアドレス構造体"
8546
8547 #. type: Plain text
8548 #: build/C/man7/socket.7:236
8549 msgid ""
8550 "Each socket domain has its own format for socket addresses, with a domain-"
8551 "specific address structure.  Each of these structures begins with an integer "
8552 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8553 "address structure.  This allows the various system calls (e.g., B<connect>"
8554 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8555 "are generic to all socket domains, to determine the domain of a particular "
8556 "socket address."
8557 msgstr ""
8558 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8559 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8560 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8561 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8562 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8563 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8564 "できる。"
8565
8566 #. type: Plain text
8567 #: build/C/man7/socket.7:246
8568 msgid ""
8569 "To allow any type of socket address to be passed to interfaces in the "
8570 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8571 "type is purely to allow casting of domain-specific socket address types to a "
8572 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8573 "calls to the sockets API."
8574 msgstr ""
8575 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8576 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8577 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8578 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8579 "告を出すのを避けることができる。"
8580
8581 #. type: Plain text
8582 #: build/C/man7/socket.7:256
8583 msgid ""
8584 "In addition, the sockets API provides the data type I<struct "
8585 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8586 "domain-specific socket address structures; it is large enough and is aligned "
8587 "properly.  (In particular, it is large enough to hold IPv6 socket "
8588 "addresses.)  The structure includes the following field, which can be used "
8589 "to identify the type of socket address actually stored in the structure:"
8590 msgstr ""
8591 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8592 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8593 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8594 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8595 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8596 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8597 "できる。"
8598
8599 #. type: Plain text
8600 #: build/C/man7/socket.7:260
8601 #, no-wrap
8602 msgid "    sa_family_t ss_family;\n"
8603 msgstr "    sa_family_t ss_family;\n"
8604
8605 #. type: Plain text
8606 #: build/C/man7/socket.7:268
8607 msgid ""
8608 "The I<sockaddr_storage> structure is useful in programs that must handle "
8609 "socket addresses in a generic way (e.g., programs that must deal with both "
8610 "IPv4 and IPv6 socket addresses)."
8611 msgstr ""
8612 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8613 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8614 "ログラム) で有用である。"
8615
8616 #. type: SS
8617 #: build/C/man7/socket.7:268
8618 #, no-wrap
8619 msgid "Socket options"
8620 msgstr "ソケットオプション"
8621
8622 #.  FIXME
8623 #.  In the list below, the text used to describe argument types
8624 #.  for each socket option should be more consistent
8625 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8626 #.  W R Stevens, UNPv1
8627 #. type: Plain text
8628 #: build/C/man7/socket.7:286
8629 msgid ""
8630 "The socket options listed below can be set by using B<setsockopt>(2)  and "
8631 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
8632 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
8633 msgstr "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケットレベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は I<int> へのポインタである。"
8634
8635 #. type: TP
8636 #: build/C/man7/socket.7:286
8637 #, no-wrap
8638 msgid "B<SO_ACCEPTCONN>"
8639 msgstr "B<SO_ACCEPTCONN>"
8640
8641 #. type: Plain text
8642 #: build/C/man7/socket.7:294
8643 msgid ""
8644 "Returns a value indicating whether or not this socket has been marked to "
8645 "accept connections with B<listen>(2).  The value 0 indicates that this is "
8646 "not a listening socket, the value 1 indicates that this is a listening "
8647 "socket.  This socket option is read-only."
8648 msgstr ""
8649 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
8650 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8651 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8652
8653 #. type: TP
8654 #: build/C/man7/socket.7:294
8655 #, no-wrap
8656 msgid "B<SO_BINDTODEVICE>"
8657 msgstr "B<SO_BINDTODEVICE>"
8658
8659 #. type: Plain text
8660 #: build/C/man7/socket.7:313
8661 msgid ""
8662 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8663 "the passed interface name.  If the name is an empty string or the option "
8664 "length is zero, the socket device binding is removed.  The passed option is "
8665 "a variable-length null-terminated interface name string with the maximum "
8666 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
8667 "received from that particular interface are processed by the socket.  Note "
8668 "that this works only for some socket types, particularly B<AF_INET> "
8669 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
8670 "there)."
8671 msgstr ""
8672 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
8673 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
8674 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
8675 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
8676 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
8677 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
8678 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
8679 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
8680 "B<bind>(2) を使うこと)。"
8681
8682 #. type: Plain text
8683 #: build/C/man7/socket.7:327
8684 msgid ""
8685 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8686 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
8687 "argument should contain the buffer size available to receive the device name "
8688 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
8689 "reported back in the I<optlen> argument."
8690 msgstr ""
8691 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
8692 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
8693 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
8694 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
8695 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
8696
8697 #. type: TP
8698 #: build/C/man7/socket.7:327
8699 #, no-wrap
8700 msgid "B<SO_BROADCAST>"
8701 msgstr "B<SO_BROADCAST>"
8702
8703 #. type: Plain text
8704 #: build/C/man7/socket.7:333
8705 msgid ""
8706 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
8707 "to send packets to a broadcast address.  This option has no effect on stream-"
8708 "oriented sockets."
8709 msgstr ""
8710 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
8711 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
8712 "ストリーム指向のソケットには何の効果もない。"
8713
8714 #. type: TP
8715 #: build/C/man7/socket.7:333
8716 #, no-wrap
8717 msgid "B<SO_BSDCOMPAT>"
8718 msgstr "B<SO_BSDCOMPAT>"
8719
8720 #. type: Plain text
8721 #: build/C/man7/socket.7:345
8722 msgid ""
8723 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
8724 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
8725 "socket will not be passed to the user program.  In later kernel versions, "
8726 "support for this option has been phased out: Linux 2.4 silently ignores it, "
8727 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
8728 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
8729 "header changing, skipping of the broadcast flag) for raw sockets with this "
8730 "option, but that was removed in Linux 2.2."
8731 msgstr ""
8732 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
8733 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
8734 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
8735 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
8736 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
8737 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
8738 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
8739 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
8740 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
8741
8742 #. type: TP
8743 #: build/C/man7/socket.7:345
8744 #, no-wrap
8745 msgid "B<SO_DEBUG>"
8746 msgstr "B<SO_DEBUG>"
8747
8748 #. type: Plain text
8749 #: build/C/man7/socket.7:351
8750 msgid ""
8751 "Enable socket debugging.  Only allowed for processes with the "
8752 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
8753 msgstr ""
8754 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
8755 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
8756
8757 #. type: TP
8758 #: build/C/man7/socket.7:351
8759 #, no-wrap
8760 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8761 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8762
8763 #. type: Plain text
8764 #: build/C/man7/socket.7:359
8765 msgid ""
8766 "Retrieves the socket domain as an integer, returning a value such as "
8767 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
8768 "only."
8769 msgstr ""
8770 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
8771 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8772
8773 #. type: TP
8774 #: build/C/man7/socket.7:359
8775 #, no-wrap
8776 msgid "B<SO_ERROR>"
8777 msgstr "B<SO_ERROR>"
8778
8779 #. type: Plain text
8780 #: build/C/man7/socket.7:364
8781 msgid ""
8782 "Get and clear the pending socket error.  This socket option is read-only.  "
8783 "Expects an integer."
8784 msgstr ""
8785 "保留になっていたソケットエラーを取得してクリアする。\n"
8786 "このソケットオプションは読み込み専用である。整数値をとる。"
8787
8788 #. type: TP
8789 #: build/C/man7/socket.7:364
8790 #, no-wrap
8791 msgid "B<SO_DONTROUTE>"
8792 msgstr "B<SO_DONTROUTE>"
8793
8794 #. type: Plain text
8795 #: build/C/man7/socket.7:373
8796 msgid ""
8797 "Don't send via a gateway, send only to directly connected hosts.  The same "
8798 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
8799 "B<send>(2)  operation.  Expects an integer boolean flag."
8800 msgstr ""
8801 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
8802 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
8803 "数のフラグを取る。"
8804
8805 #. type: TP
8806 #: build/C/man7/socket.7:373
8807 #, no-wrap
8808 msgid "B<SO_KEEPALIVE>"
8809 msgstr "B<SO_KEEPALIVE>"
8810
8811 #. type: Plain text
8812 #: build/C/man7/socket.7:377
8813 msgid ""
8814 "Enable sending of keep-alive messages on connection-oriented sockets.  "
8815 "Expects an integer boolean flag."
8816 msgstr ""
8817 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
8818 "の整数フラグをとる。"
8819
8820 #. type: TP
8821 #: build/C/man7/socket.7:377
8822 #, no-wrap
8823 msgid "B<SO_LINGER>"
8824 msgstr "B<SO_LINGER>"
8825
8826 #. type: Plain text
8827 #: build/C/man7/socket.7:385
8828 msgid ""
8829 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
8830 msgstr ""
8831 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
8832
8833 #. type: Plain text
8834 #: build/C/man7/socket.7:392
8835 #, no-wrap
8836 msgid ""
8837 "struct linger {\n"
8838 "    int l_onoff;    /* linger active */\n"
8839 "    int l_linger;   /* how many seconds to linger for */\n"
8840 "};\n"
8841 msgstr ""
8842 "struct linger {\n"
8843 "    int l_onoff;    /* linger active */\n"
8844 "    int l_linger;   /* how many seconds to linger for */\n"
8845 "};\n"
8846
8847 #. type: Plain text
8848 #: build/C/man7/socket.7:406
8849 msgid ""
8850 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
8851 "queued messages for the socket have been successfully sent or the linger "
8852 "timeout has been reached.  Otherwise, the call returns immediately and the "
8853 "closing is done in the background.  When the socket is closed as part of "
8854 "B<exit>(2), it always lingers in the background."
8855 msgstr ""
8856 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
8857 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
8858 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
8859 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
8860 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
8861 "送られる。"
8862
8863 #. type: TP
8864 #: build/C/man7/socket.7:406
8865 #, no-wrap
8866 msgid "B<SO_MARK> (since Linux 2.6.25)"
8867 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
8868
8869 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
8870 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
8871 #. type: Plain text
8872 #: build/C/man7/socket.7:417
8873 msgid ""
8874 "Set the mark for each packet sent through this socket (similar to the "
8875 "netfilter MARK target but socket-based).  Changing the mark can be used for "
8876 "mark-based routing without netfilter or for packet filtering.  Setting this "
8877 "option requires the B<CAP_NET_ADMIN> capability."
8878 msgstr ""
8879 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
8880 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
8881 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
8882 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
8883 "ティが必要である。"
8884
8885 #. type: TP
8886 #: build/C/man7/socket.7:417
8887 #, no-wrap
8888 msgid "B<SO_OOBINLINE>"
8889 msgstr "B<SO_OOBINLINE>"
8890
8891 #.  don't document it because it can do too much harm.
8892 #. .B SO_NO_CHECK
8893 #. type: Plain text
8894 #: build/C/man7/socket.7:426
8895 msgid ""
8896 "If this option is enabled, out-of-band data is directly placed into the "
8897 "receive data stream.  Otherwise out-of-band data is passed only when the "
8898 "B<MSG_OOB> flag is set during receiving."
8899 msgstr ""
8900 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
8901 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
8902 "ラグがセットされている場合に限って渡される。"
8903
8904 #. type: TP
8905 #: build/C/man7/socket.7:426
8906 #, no-wrap
8907 msgid "B<SO_PASSCRED>"
8908 msgstr "B<SO_PASSCRED>"
8909
8910 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8911 #.  in the 2.6.18 ChangeLog
8912 #. type: Plain text
8913 #: build/C/man7/socket.7:435
8914 msgid ""
8915 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
8916 "For more information see B<unix>(7)."
8917 msgstr ""
8918 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
8919 "を参照のこと。"
8920
8921 #. type: TP
8922 #: build/C/man7/socket.7:435
8923 #, no-wrap
8924 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
8925 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
8926
8927 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
8928 #. type: Plain text
8929 #: build/C/man7/socket.7:445
8930 msgid ""
8931 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
8932 "the value of the \"peek offset\" for the B<recv(2)> system call when used "
8933 "with B<MSG_PEEK> flag."
8934 msgstr "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek offset\" にこのオプションの値が設定される。現在のところ、このオプションは B<unix>(7) ソケットでのみサポートされている。"
8935
8936 #. type: Plain text
8937 #: build/C/man7/socket.7:453
8938 msgid ""
8939 "When this option is set to a negative value (it is set to -1 for all new "
8940 "sockets), traditional behavior is provided: B<recv(2)> with the B<MSG_PEEK> "
8941 "flag will peek data from the front of the queue."
8942 msgstr "このオプションが負の値に設定された場合、従来の動作となる。 つまり B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規のソケットではこのオプションの値は必ず -1 に設定される。"
8943
8944 #. type: Plain text
8945 #: build/C/man7/socket.7:460
8946 msgid ""
8947 "When the option is set to a value greater than or equal to zero, then the "
8948 "next peek at data queued in the socket will occur at the byte offset "
8949 "specified by the option value.  At the same time, the \"peek offset\" will "
8950 "be incremented by the number of bytes that were peeked from the queue, so "
8951 "that a subsequent peek will return the next data in the queue.i"
8952 msgstr "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプション値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。したがって、次の peek 処理ではキューのその次にあるデータが返される。"
8953
8954 #. type: Plain text
8955 #: build/C/man7/socket.7:472
8956 msgid ""
8957 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
8958 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
8959 "by the number of bytes removed.  In other words, receiving data without the "
8960 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
8961 "the correct relative position in the queued data, so that a subsequent peek "
8962 "will retrieve the data that would have been retrieved had the data not been "
8963 "removed."
8964 msgstr "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しでキューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だけ減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 \"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されるということである。"
8965
8966 #. type: Plain text
8967 #: build/C/man7/socket.7:477
8968 msgid ""
8969 "For datagram sockets, if the \"peek offset\" points to the middle of a "
8970 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
8971 msgstr "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合には、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
8972
8973 #. type: Plain text
8974 #: build/C/man7/socket.7:481
8975 msgid ""
8976 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
8977 "Suppose a stream socket has the following queued input data:"
8978 msgstr "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに以下の入力データが入っているものとする。"
8979
8980 #. type: Plain text
8981 #: build/C/man7/socket.7:483
8982 #, no-wrap
8983 msgid "    aabbccddeeff\n"
8984 msgstr "    aabbccddeeff\n"
8985
8986 #. type: Plain text
8987 #: build/C/man7/socket.7:488
8988 msgid ""
8989 "The following sequence of B<recv>(2)  calls would have the effect noted in "
8990 "the comments:"
8991 msgstr "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
8992
8993 #. type: Plain text
8994 #: build/C/man7/socket.7:493
8995 #, no-wrap
8996 msgid ""
8997 "int ov = 4;                  // Set peek offset to 4\n"
8998 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
8999 msgstr ""
9000 "int ov = 4;                  // Set peek offset to 4\n"
9001 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9002
9003 #. type: Plain text
9004 #: build/C/man7/socket.7:498
9005 #, no-wrap
9006 msgid ""
9007 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9008 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9009 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9010 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9011 msgstr ""
9012 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9013 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9014 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9015 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9016
9017 #. type: TP
9018 #: build/C/man7/socket.7:500
9019 #, no-wrap
9020 msgid "B<SO_PEERCRED>"
9021 msgstr "B<SO_PEERCRED>"
9022
9023 #. type: Plain text
9024 #: build/C/man7/socket.7:523
9025 msgid ""
9026 "Return the credentials of the foreign process connected to this socket.  "
9027 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9028 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
9029 "(7).  The returned credentials are those that were in effect at the time of "
9030 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
9031 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
9032 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
9033 "option is read-only."
9034 msgstr ""
9035 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9036 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9037 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9038 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9039 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9040 "る。引き数は I<ucred> 構造体である。このソケットオプションは読み込み専用であ"
9041 "る。"
9042
9043 #. type: TP
9044 #: build/C/man7/socket.7:523
9045 #, no-wrap
9046 msgid "B<SO_PRIORITY>"
9047 msgstr "B<SO_PRIORITY>"
9048
9049 #. type: Plain text
9050 #: build/C/man7/socket.7:536
9051 msgid ""
9052 "Set the protocol-defined priority for all packets to be sent on this "
9053 "socket.  Linux uses this value to order the networking queues: packets with "
9054 "a higher priority may be processed first depending on the selected device "
9055 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9056 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9057 "6 requires the B<CAP_NET_ADMIN> capability."
9058 msgstr ""
9059 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9060 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9061 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9062 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9063 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9064 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9065
9066 #. type: TP
9067 #: build/C/man7/socket.7:536
9068 #, no-wrap
9069 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9070 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9071
9072 #. type: Plain text
9073 #: build/C/man7/socket.7:544
9074 msgid ""
9075 "Retrieves the socket protocol as an integer, returning a value such as "
9076 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9077 "only."
9078 msgstr ""
9079 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9080 "る。\n"
9081 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9082
9083 #. type: TP
9084 #: build/C/man7/socket.7:544
9085 #, no-wrap
9086 msgid "B<SO_RCVBUF>"
9087 msgstr "B<SO_RCVBUF>"
9088
9089 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9090 #.  The following thread on LMKL is quite informative:
9091 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9092 #.  17 July 2012
9093 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9094 #. type: Plain text
9095 #: build/C/man7/socket.7:563
9096 msgid ""
9097 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9098 "this value (to allow space for bookkeeping overhead)  when it is set using "
9099 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9100 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9101 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9102 "file.  The minimum (doubled) value for this option is 256."
9103 msgstr ""
9104 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9105 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9106 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9107 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9108 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9109 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9110
9111 #. type: TP
9112 #: build/C/man7/socket.7:563
9113 #, no-wrap
9114 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9115 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9116
9117 #. type: Plain text
9118 #: build/C/man7/socket.7:572
9119 msgid ""
9120 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9121 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9122 "overridden."
9123 msgstr ""
9124 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9125 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9126 "きすることができる。"
9127
9128 #. type: TP
9129 #: build/C/man7/socket.7:572
9130 #, no-wrap
9131 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9132 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9133
9134 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9135 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9136 #. type: Plain text
9137 #: build/C/man7/socket.7:601
9138 msgid ""
9139 "Specify the minimum number of bytes in the buffer until the socket layer "
9140 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9141 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9142 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9143 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9144 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9145 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9146 "single byte of data is available.  A subsequent read from the socket will "
9147 "block until B<SO_RCVLOWAT> bytes are available."
9148 msgstr ""
9149 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9150 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9151 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9152 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9153 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9154 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9155 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9156 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9157 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9158 "してしまう。"
9159
9160 #. type: TP
9161 #: build/C/man7/socket.7:601
9162 #, no-wrap
9163 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9164 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9165
9166 #.  Not implemented in 2.0.
9167 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9168 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9169 #.  in fact to EAGAIN
9170 #. type: Plain text
9171 #: build/C/man7/socket.7:636
9172 msgid ""
9173 "Specify the receiving or sending timeouts until reporting an error.  The "
9174 "argument is a I<struct timeval>.  If an input or output function blocks for "
9175 "this period of time, and data has been sent or received, the return value of "
9176 "that function will be the amount of data transferred; if no data has been "
9177 "transferred and the timeout has been reached then -1 is returned with "
9178 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9179 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9180 "the timeout is set to zero (the default)  then the operation will never "
9181 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9182 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9183 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9184 msgstr ""
9185 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9186 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9187 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9188 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9189 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>"
9190 "(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見"
9191 "える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタ"
9192 "イムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行す"
9193 "るシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), "
9194 "B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), B<epoll_wait>(2)  などには"
9195 "タイムアウトは影響を及ぼさない。"
9196
9197 #. type: TP
9198 #: build/C/man7/socket.7:636
9199 #, no-wrap
9200 msgid "B<SO_REUSEADDR>"
9201 msgstr "B<SO_REUSEADDR>"
9202
9203 #. type: Plain text
9204 #: build/C/man7/socket.7:651
9205 msgid ""
9206 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9207 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9208 "this means that a socket may bind, except when there is an active listening "
9209 "socket bound to the address.  When the listening socket is bound to "
9210 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9211 "port for any local address.  Argument is an integer boolean flag."
9212 msgstr ""
9213 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9214 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9215 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9216 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9217 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9218 "ドできない。 引き数はブール整数のフラグである。"
9219
9220 #. type: TP
9221 #: build/C/man7/socket.7:651
9222 #, no-wrap
9223 msgid "B<SO_SNDBUF>"
9224 msgstr "B<SO_SNDBUF>"
9225
9226 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9227 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9228 #. type: Plain text
9229 #: build/C/man7/socket.7:667
9230 msgid ""
9231 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9232 "this value (to allow space for bookkeeping overhead)  when it is set using "
9233 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9234 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9235 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9236 "file.  The minimum (doubled) value for this option is 2048."
9237 msgstr ""
9238 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9239 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9240 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9241 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9242 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9243 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9244
9245 #. type: TP
9246 #: build/C/man7/socket.7:667
9247 #, no-wrap
9248 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9249 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9250
9251 #. type: Plain text
9252 #: build/C/man7/socket.7:676
9253 msgid ""
9254 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9255 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9256 "overridden."
9257 msgstr ""
9258 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9259 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9260 "きすることができる。"
9261
9262 #. type: TP
9263 #: build/C/man7/socket.7:676
9264 #, no-wrap
9265 msgid "B<SO_TIMESTAMP>"
9266 msgstr "B<SO_TIMESTAMP>"
9267
9268 #. type: Plain text
9269 #: build/C/man7/socket.7:692
9270 msgid ""
9271 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9272 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9273 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9274 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9275 "details on control messages."
9276 msgstr ""
9277 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9278 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9279 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9280 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9281
9282 #. type: TP
9283 #: build/C/man7/socket.7:692
9284 #, no-wrap
9285 msgid "B<SO_TYPE>"
9286 msgstr "B<SO_TYPE>"
9287
9288 #. type: Plain text
9289 #: build/C/man7/socket.7:697
9290 msgid ""
9291 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9292 "option is read-only."
9293 msgstr ""
9294 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9295 "このソケットオプションは読み出し専用である。"
9296
9297 #. type: SS
9298 #: build/C/man7/socket.7:697
9299 #, no-wrap
9300 msgid "Signals"
9301 msgstr "シグナル"
9302
9303 #. type: Plain text
9304 #: build/C/man7/socket.7:708
9305 msgid ""
9306 "When writing onto a connection-oriented socket that has been shut down (by "
9307 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9308 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9309 "the B<MSG_NOSIGNAL> flag."
9310 msgstr ""
9311 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9312 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9313 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9314 "していた場合はシグナルは送られない。"
9315
9316 #. type: Plain text
9317 #: build/C/man7/socket.7:733
9318 msgid ""
9319 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9320 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9321 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9322 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9323 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9324 "signal will be called with the file descriptor in the I<si_fd> field of its "
9325 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9326 msgstr ""
9327 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9328 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9329 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9330 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9331 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9332 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9333 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9334 "を参照のこと。"
9335
9336 #.  .SS Ancillary messages
9337 #. type: Plain text
9338 #: build/C/man7/socket.7:741
9339 msgid ""
9340 "Under some circumstances (e.g., multiple processes accessing a single "
9341 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9342 "when the process reacts to the signal.  If this happens, the process should "
9343 "wait again because Linux will resend the signal later."
9344 msgstr ""
9345 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9346 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9347 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9348 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9349
9350 #. type: SS
9351 #: build/C/man7/socket.7:741
9352 #, no-wrap
9353 msgid "/proc interfaces"
9354 msgstr "/proc インタフェース"
9355
9356 #. type: Plain text
9357 #: build/C/man7/socket.7:745
9358 msgid ""
9359 "The core socket networking parameters can be accessed via files in the "
9360 "directory I</proc/sys/net/core/>."
9361 msgstr ""
9362 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9363 "レクトリ内のファイルを通してアクセスできる。"
9364
9365 #. type: TP
9366 #: build/C/man7/socket.7:745
9367 #, no-wrap
9368 msgid "I<rmem_default>"
9369 msgstr "I<rmem_default>"
9370
9371 #. type: Plain text
9372 #: build/C/man7/socket.7:748
9373 msgid "contains the default setting in bytes of the socket receive buffer."
9374 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9375
9376 #. type: TP
9377 #: build/C/man7/socket.7:748
9378 #, no-wrap
9379 msgid "I<rmem_max>"
9380 msgstr "I<rmem_max>"
9381
9382 #. type: Plain text
9383 #: build/C/man7/socket.7:754
9384 msgid ""
9385 "contains the maximum socket receive buffer size in bytes which a user may "
9386 "set by using the B<SO_RCVBUF> socket option."
9387 msgstr ""
9388 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9389 "ファサイズの最大値 (バイト単位)。"
9390
9391 #. type: TP
9392 #: build/C/man7/socket.7:754
9393 #, no-wrap
9394 msgid "I<wmem_default>"
9395 msgstr "I<wmem_default>"
9396
9397 #. type: Plain text
9398 #: build/C/man7/socket.7:757
9399 msgid "contains the default setting in bytes of the socket send buffer."
9400 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9401
9402 #. type: TP
9403 #: build/C/man7/socket.7:757
9404 #, no-wrap
9405 msgid "I<wmem_max>"
9406 msgstr "I<wmem_max>"
9407
9408 #. type: Plain text
9409 #: build/C/man7/socket.7:763
9410 msgid ""
9411 "contains the maximum socket send buffer size in bytes which a user may set "
9412 "by using the B<SO_SNDBUF> socket option."
9413 msgstr ""
9414 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9415 "ファサイズの最大値 (バイト単位)。"
9416
9417 #. type: TP
9418 #: build/C/man7/socket.7:763
9419 #, no-wrap
9420 msgid "I<message_cost> and I<message_burst>"
9421 msgstr "I<message_cost> と I<message_burst>"
9422
9423 #. type: Plain text
9424 #: build/C/man7/socket.7:767
9425 msgid ""
9426 "configure the token bucket filter used to load limit warning messages caused "
9427 "by external network events."
9428 msgstr ""
9429 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9430 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9431
9432 #. type: TP
9433 #: build/C/man7/socket.7:767
9434 #, no-wrap
9435 msgid "I<netdev_max_backlog>"
9436 msgstr "I<netdev_max_backlog>"
9437
9438 #. type: Plain text
9439 #: build/C/man7/socket.7:770
9440 msgid "Maximum number of packets in the global input queue."
9441 msgstr "グローバルな入力キューにおける最大のパケット数。"
9442
9443 #. type: TP
9444 #: build/C/man7/socket.7:770
9445 #, no-wrap
9446 msgid "I<optmem_max>"
9447 msgstr "I<optmem_max>"
9448
9449 #.  netdev_fastroute is not documented because it is experimental
9450 #. type: Plain text
9451 #: build/C/man7/socket.7:775
9452 msgid ""
9453 "Maximum length of ancillary data and user control data like the iovecs per "
9454 "socket."
9455 msgstr ""
9456 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9457 "うなもの) との和の最大長。"
9458
9459 #. type: SS
9460 #: build/C/man7/socket.7:775
9461 #, no-wrap
9462 msgid "Ioctls"
9463 msgstr "ioctl"
9464
9465 #. type: Plain text
9466 #: build/C/man7/socket.7:778
9467 msgid "These operations can be accessed using B<ioctl>(2):"
9468 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9469
9470 #. type: Plain text
9471 #: build/C/man7/socket.7:782
9472 #, no-wrap
9473 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9474 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9475
9476 #. type: TP
9477 #: build/C/man7/socket.7:784
9478 #, no-wrap
9479 msgid "B<SIOCGSTAMP>"
9480 msgstr "B<SIOCGSTAMP>"
9481
9482 #. type: Plain text
9483 #: build/C/man7/socket.7:808
9484 msgid ""
9485 "Return a I<struct timeval> with the receive timestamp of the last packet "
9486 "passed to the user.  This is useful for accurate round trip time "
9487 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9488 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9489 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9490 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9491 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9492 "to B<ENOENT>)."
9493 msgstr ""
9494 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9495 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9496 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9497 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9498 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9499 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9500 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9501 "セットする)。"
9502
9503 #. type: TP
9504 #: build/C/man7/socket.7:808
9505 #, no-wrap
9506 msgid "B<SIOCSPGRP>"
9507 msgstr "B<SIOCSPGRP>"
9508
9509 #. type: Plain text
9510 #: build/C/man7/socket.7:827
9511 msgid ""
9512 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9513 "when an asynchronous I/O operation has finished or urgent data is "
9514 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9515 "positive, send the signals to that process.  If the argument is negative, "
9516 "send the signals to the process group with the ID of the absolute value of "
9517 "the argument.  The process may only choose itself or its own process group "
9518 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9519 "UID of 0."
9520 msgstr ""
9521 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9522 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9523 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9524 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9525 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9526 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9527 "の場合は この限りではない。"
9528
9529 #. type: TP
9530 #: build/C/man7/socket.7:827
9531 #, no-wrap
9532 msgid "B<FIOASYNC>"
9533 msgstr "B<FIOASYNC>"
9534
9535 #. type: Plain text
9536 #: build/C/man7/socket.7:837
9537 msgid ""
9538 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9539 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9540 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9541 msgstr ""
9542 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9543 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9544 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9545
9546 #. type: Plain text
9547 #: build/C/man7/socket.7:845
9548 msgid ""
9549 "Argument is an integer boolean flag.  (This operation is synonymous with the "
9550 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
9551 msgstr ""
9552 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
9553 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9554
9555 #. type: TP
9556 #: build/C/man7/socket.7:845
9557 #, no-wrap
9558 msgid "B<SIOCGPGRP>"
9559 msgstr "B<SIOCGPGRP>"
9560
9561 #. type: Plain text
9562 #: build/C/man7/socket.7:854
9563 msgid ""
9564 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9565 "signals, or 0 when none is set."
9566 msgstr ""
9567 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9568 "る。 ない場合は 0 が返る。"
9569
9570 #. type: Plain text
9571 #: build/C/man7/socket.7:858
9572 msgid "Valid B<fcntl>(2)  operations:"
9573 msgstr "有効な B<fcntl>(2)  操作:"
9574
9575 #. type: TP
9576 #: build/C/man7/socket.7:858
9577 #, no-wrap
9578 msgid "B<FIOGETOWN>"
9579 msgstr "B<FIOGETOWN>"
9580
9581 #. type: Plain text
9582 #: build/C/man7/socket.7:863
9583 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9584 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
9585
9586 #. type: TP
9587 #: build/C/man7/socket.7:863
9588 #, no-wrap
9589 msgid "B<FIOSETOWN>"
9590 msgstr "B<FIOSETOWN>"
9591
9592 #. type: Plain text
9593 #: build/C/man7/socket.7:868
9594 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9595 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
9596
9597 #. type: Plain text
9598 #: build/C/man7/socket.7:882
9599 msgid ""
9600 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
9601 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
9602 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
9603 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9604 "be read or written."
9605 msgstr ""
9606 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9607 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9608 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9609 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9610 "はできなかった。"
9611
9612 #. type: Plain text
9613 #: build/C/man7/socket.7:887
9614 msgid ""
9615 "Linux assumes that half of the send/receive buffer is used for internal "
9616 "kernel structures; thus the values in the corresponding I</proc> files are "
9617 "twice what can be observed on the wire."
9618 msgstr ""
9619 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
9620 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
9621 "なる。"
9622
9623 #. type: Plain text
9624 #: build/C/man7/socket.7:900
9625 msgid ""
9626 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
9627 "option was set both in the previous program that performed a B<bind>(2)  to "
9628 "the port and in the program that wants to reuse the port.  This differs from "
9629 "some implementations (e.g., FreeBSD)  where only the later program needs to "
9630 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
9631 "since, for example, a server program is designed to always set this option."
9632 msgstr ""
9633 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
9634 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
9635 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
9636 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
9637 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
9638 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
9639 "このオプションをセットするように設計されるからである。"
9640
9641 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
9642 #.  .SH AUTHORS
9643 #.  This man page was written by Andi Kleen.
9644 #. type: Plain text
9645 #: build/C/man7/socket.7:913
9646 msgid ""
9647 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
9648 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
9649 "is via the libpcap library."
9650 msgstr ""
9651 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
9652 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
9653 "して 用いる方が良い。"
9654
9655 #. type: Plain text
9656 #: build/C/man7/socket.7:925
9657 msgid ""
9658 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9659 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9660 "B<unix>(7)"
9661 msgstr ""
9662 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9663 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9664 "B<unix>(7)"
9665
9666 #. type: TH
9667 #: build/C/man2/socketcall.2:25
9668 #, no-wrap
9669 msgid "SOCKETCALL"
9670 msgstr "SOCKETCALL"
9671
9672 #. type: TH
9673 #: build/C/man2/socketcall.2:25
9674 #, no-wrap
9675 msgid "2012-10-16"
9676 msgstr "2012-10-16"
9677
9678 #. type: Plain text
9679 #: build/C/man2/socketcall.2:28
9680 msgid "socketcall - socket system calls"
9681 msgstr "socketcall - ソケット・システムコール"
9682
9683 #. type: Plain text
9684 #: build/C/man2/socketcall.2:30
9685 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9686 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9687
9688 #. type: Plain text
9689 #: build/C/man2/socketcall.2:38
9690 msgid ""
9691 "B<socketcall>()  is a common kernel entry point for the socket system "
9692 "calls.  I<call> determines which socket function to invoke.  I<args> points "
9693 "to a block containing the actual arguments, which are passed through to the "
9694 "appropriate call."
9695 msgstr ""
9696 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
9697 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
9698 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
9699 "ロックを指す。"
9700
9701 #. type: Plain text
9702 #: build/C/man2/socketcall.2:42
9703 msgid ""
9704 "User programs should call the appropriate functions by their usual names.  "
9705 "Only standard library implementors and kernel hackers need to know about "
9706 "B<socketcall>()."
9707 msgstr ""
9708 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
9709 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
9710 "必要がある。"
9711
9712 #. type: Plain text
9713 #: build/C/man2/socketcall.2:45
9714 msgid ""
9715 "This call is specific to Linux, and should not be used in programs intended "
9716 "to be portable."
9717 msgstr ""
9718 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
9719 "い。"
9720
9721 #. type: Plain text
9722 #: build/C/man2/socketcall.2:53
9723 msgid ""
9724 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
9725 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
9726 "(2), and so on really are implemented as separate system calls."
9727 msgstr ""
9728 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
9729 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
9730 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
9731
9732 #. type: Plain text
9733 #: build/C/man2/socketcall.2:71
9734 msgid ""
9735 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9736 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9737 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9738 "(2), B<socket>(2), B<socketpair>(2)"
9739 msgstr ""
9740 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9741 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9742 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9743 "(2), B<socket>(2), B<socketpair>(2)"
9744
9745 #. type: TH
9746 #: build/C/man2/socketpair.2:42
9747 #, no-wrap
9748 msgid "SOCKETPAIR"
9749 msgstr "SOCKETPAIR"
9750
9751 #. type: TH
9752 #: build/C/man2/socketpair.2:42
9753 #, no-wrap
9754 msgid "2008-10-11"
9755 msgstr "2008-10-11"
9756
9757 #. type: Plain text
9758 #: build/C/man2/socketpair.2:45
9759 msgid "socketpair - create a pair of connected sockets"
9760 msgstr "socketpair - 接続されたソケットのペアを作成する"
9761
9762 #. type: Plain text
9763 #: build/C/man2/socketpair.2:52
9764 msgid ""
9765 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9766 ">I<sv>B<[2]);>"
9767 msgstr ""
9768 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9769 ">I<sv>B<[2]);>"
9770
9771 #. type: Plain text
9772 #: build/C/man2/socketpair.2:63
9773 msgid ""
9774 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
9775 "the specified I<domain>, of the specified I<type>, and using the optionally "
9776 "specified I<protocol>.  For further details of these arguments, see B<socket>"
9777 "(2)."
9778 msgstr ""
9779 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
9780 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
9781 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
9782
9783 #. type: Plain text
9784 #: build/C/man2/socketpair.2:69
9785 msgid ""
9786 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
9787 "and I<sv>[1].  The two sockets are indistinguishable."
9788 msgstr ""
9789 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
9790 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
9791
9792 #. type: Plain text
9793 #: build/C/man2/socketpair.2:78
9794 msgid "The specified address family is not supported on this machine."
9795 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
9796
9797 #. type: Plain text
9798 #: build/C/man2/socketpair.2:83
9799 msgid ""
9800 "The address I<sv> does not specify a valid part of the process address space."
9801 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
9802
9803 #. type: Plain text
9804 #: build/C/man2/socketpair.2:86
9805 msgid "Too many descriptors are in use by this process."
9806 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
9807
9808 #. type: Plain text
9809 #: build/C/man2/socketpair.2:92
9810 msgid "The specified protocol does not support creation of socket pairs."
9811 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
9812
9813 #. type: Plain text
9814 #: build/C/man2/socketpair.2:95
9815 msgid "The specified protocol is not supported on this machine."
9816 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
9817
9818 #. type: Plain text
9819 #: build/C/man2/socketpair.2:103
9820 msgid ""
9821 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
9822 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
9823 "of the BSD socket layer (including System V variants)."
9824 msgstr ""
9825 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
9826 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
9827 "BSD 以外のシステムと、 互いに移植性がある。"
9828
9829 #. type: Plain text
9830 #: build/C/man2/socketpair.2:109
9831 msgid ""
9832 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
9833 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
9834 "restriction.)"
9835 msgstr ""
9836 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
9837 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
9838
9839 #. type: Plain text
9840 #: build/C/man2/socketpair.2:118
9841 msgid ""
9842 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
9843 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
9844 msgstr ""
9845 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
9846 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
9847
9848 #. type: Plain text
9849 #: build/C/man2/socketpair.2:131
9850 msgid ""
9851 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9852 msgstr ""
9853 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9854
9855 #~ msgid "2012-12-21"
9856 #~ msgstr "2012-12-21"