OSDN Git Service

(split) LDP: Update ja.po (editorical only)
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2013-03-22 01:06+0900\n"
10 "PO-Revision-Date: 2013-03-26 16:29+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:48 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:48
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:49
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 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:51
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:55
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:393 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:56
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:398 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:407 build/C/man2/select.2:307 build/C/man2/send.2:304
394 #: build/C/man3/sockatmark.3:57
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:416
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:420 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:425
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:61
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:440 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:68 build/C/man7/socket.7:802
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:92 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:445 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:71
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:95 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:455 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:73
658 #: build/C/man2/socket.2:366 build/C/man7/socket.7:816
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:490 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:97 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:101 build/C/man2/connect.2:263
774 #: build/C/man3/getifaddrs.3:290 build/C/man2/getsockname.2:112
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:495 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:132 build/C/man2/socket.2:390
781 #: build/C/man7/socket.7:847 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:104 build/C/man2/connect.2:270
799 #: build/C/man3/getifaddrs.3:296 build/C/man2/getsockname.2:119
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:506 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:137 build/C/man2/socket.2:419
806 #: build/C/man7/socket.7:859 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:111 build/C/man2/connect.2:277
815 #: build/C/man3/getifaddrs.3:303 build/C/man2/getsockname.2:126
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:513 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:144 build/C/man2/socket.2:426
822 #: build/C/man7/socket.7:866 build/C/man2/socketcall.2:78
823 #: build/C/man2/socketpair.2:138
824 msgid ""
825 "This page is part of release 3.50 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.50 の一部\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:429 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:93 build/C/man7/socket.7:834
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/man2/connect.2:67
1321 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
1322 #: build/C/man3/sockatmark.3:25
1323 #, no-wrap
1324 msgid "2008-12-03"
1325 msgstr "2008-12-03"
1326
1327 #. type: Plain text
1328 #: build/C/man3/bindresvport.3:33
1329 msgid "bindresvport - bind a socket to a privileged IP port"
1330 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1331
1332 #. type: Plain text
1333 #: build/C/man3/bindresvport.3:37
1334 #, no-wrap
1335 msgid ""
1336 "B<#include E<lt>sys/types.hE<gt>>\n"
1337 "B<#include E<lt>netinet/in.hE<gt>>\n"
1338 msgstr ""
1339 "B<#include E<lt>sys/types.hE<gt>>\n"
1340 "B<#include E<lt>netinet/in.hE<gt>>\n"
1341
1342 #. type: Plain text
1343 #: build/C/man3/bindresvport.3:39
1344 #, no-wrap
1345 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1346 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1347
1348 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1349 #. type: Plain text
1350 #: build/C/man3/bindresvport.3:46
1351 msgid ""
1352 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1353 "anonymous IP port, that is, a port number arbitrarily selected from the "
1354 "range 512 to 1023."
1355 msgstr ""
1356 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1357 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1358 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1359
1360 #. type: Plain text
1361 #: build/C/man3/bindresvport.3:56
1362 msgid ""
1363 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1364 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1365 "allocated."
1366 msgstr ""
1367 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1368 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1369 "される。"
1370
1371 #. type: Plain text
1372 #: build/C/man3/bindresvport.3:67
1373 msgid ""
1374 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1375 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1376 "return the port number actually allocated.  (This information can later be "
1377 "obtained using B<getsockname>(2).)"
1378 msgstr ""
1379 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1380 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1381 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1382 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1383
1384 #. type: Plain text
1385 #: build/C/man3/bindresvport.3:72
1386 msgid ""
1387 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1388 "I<errno> set to indicate the cause of the error."
1389 msgstr ""
1390 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1391 "I<errno> にエラーの原因を示す値を設定する。"
1392
1393 #. type: Plain text
1394 #: build/C/man3/bindresvport.3:77
1395 msgid ""
1396 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1397 "addition, the following errors may occur:"
1398 msgstr ""
1399 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1400 "以下のエラーが発生することがある:"
1401
1402 #. type: Plain text
1403 #: build/C/man3/bindresvport.3:82
1404 msgid ""
1405 "The caller did not have superuser privilege (to be precise: the "
1406 "B<CAP_NET_BIND_SERVICE> capability is required)."
1407 msgstr ""
1408 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1409 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1410
1411 #. type: Plain text
1412 #: build/C/man3/bindresvport.3:85
1413 msgid "All privileged ports are in use."
1414 msgstr "全ての特権ポートが使用中である。"
1415
1416 #. type: TP
1417 #: build/C/man3/bindresvport.3:85
1418 #, no-wrap
1419 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1420 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1421
1422 #. type: Plain text
1423 #: build/C/man3/bindresvport.3:92
1424 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1425 msgstr ""
1426 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1427
1428 #. type: Plain text
1429 #: build/C/man3/bindresvport.3:95
1430 msgid ""
1431 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1432 msgstr ""
1433 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1434
1435 #. type: Plain text
1436 #: build/C/man3/bindresvport.3:101
1437 msgid ""
1438 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1439 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1440 msgstr ""
1441 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1442 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1443
1444 #. type: Plain text
1445 #: build/C/man3/bindresvport.3:104
1446 msgid "B<bind>(2), B<getsockname>(2)"
1447 msgstr "B<bind>(2), B<getsockname>(2)"
1448
1449 #. type: TH
1450 #: build/C/man2/connect.2:67
1451 #, no-wrap
1452 msgid "CONNECT"
1453 msgstr "CONNECT"
1454
1455 #. type: Plain text
1456 #: build/C/man2/connect.2:70
1457 msgid "connect - initiate a connection on a socket"
1458 msgstr "connect - ソケットの接続を行う"
1459
1460 #. type: Plain text
1461 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1462 #: build/C/man2/listen.2:51
1463 #, no-wrap
1464 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1465 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1466
1467 #. type: Plain text
1468 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1469 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1470 #: build/C/man2/recv.2:51
1471 #, no-wrap
1472 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1473 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1474
1475 #. type: Plain text
1476 #: build/C/man2/connect.2:78
1477 #, no-wrap
1478 msgid ""
1479 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1480 "B<            socklen_t >I<addrlen>B<);>\n"
1481 msgstr ""
1482 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1483 "B<            socklen_t >I<addrlen>B<);>\n"
1484
1485 #. type: Plain text
1486 #: build/C/man2/connect.2:97
1487 msgid ""
1488 "The B<connect>()  system call connects the socket referred to by the file "
1489 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1490 "argument specifies the size of I<addr>.  The format of the address in "
1491 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1492 "B<socket>(2)  for further details."
1493 msgstr ""
1494 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1495 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1496 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1497 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1498 "こと。"
1499
1500 #. type: Plain text
1501 #: build/C/man2/connect.2:113
1502 msgid ""
1503 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1504 "to which datagrams are sent by default, and the only address from which "
1505 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1506 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1507 "that is bound to the address specified by I<addr>."
1508 msgstr ""
1509 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1510 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1511 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1512 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1513 "に対する接続の 作成を試みる。"
1514
1515 #. type: Plain text
1516 #: build/C/man2/connect.2:127
1517 msgid ""
1518 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1519 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1520 "times to change their association.  Connectionless sockets may dissolve the "
1521 "association by connecting to an address with the I<sa_family> member of "
1522 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1523 msgstr ""
1524 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1525 "()  が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1526 "度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1527 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1528 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1529
1530 #. type: Plain text
1531 #: build/C/man2/connect.2:132
1532 msgid ""
1533 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1534 "returned, and I<errno> is set appropriately."
1535 msgstr ""
1536 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1537 "適切な値を設定する。"
1538
1539 #. type: Plain text
1540 #: build/C/man2/connect.2:135
1541 msgid ""
1542 "The following are general socket errors only.  There may be other domain-"
1543 "specific error codes."
1544 msgstr ""
1545 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1546 "する可能性がある。"
1547
1548 #. type: Plain text
1549 #: build/C/man2/connect.2:143
1550 msgid ""
1551 "For UNIX domain sockets, which are identified by pathname: Write permission "
1552 "is denied on the socket file, or search permission is denied for one of the "
1553 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1554 msgstr ""
1555 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1556 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1557 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1558
1559 #. type: TP
1560 #: build/C/man2/connect.2:143
1561 #, no-wrap
1562 msgid "B<EACCES>, B<EPERM>"
1563 msgstr "B<EACCES>, B<EPERM>"
1564
1565 #. type: Plain text
1566 #: build/C/man2/connect.2:148
1567 msgid ""
1568 "The user tried to connect to a broadcast address without having the socket "
1569 "broadcast flag enabled or the connection request failed because of a local "
1570 "firewall rule."
1571 msgstr ""
1572 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1573 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1574 "要求が失敗した。"
1575
1576 #. type: Plain text
1577 #: build/C/man2/connect.2:151
1578 msgid "Local address is already in use."
1579 msgstr "ローカルアドレスが既に使用されている。"
1580
1581 #. type: TP
1582 #: build/C/man2/connect.2:151 build/C/man2/socket.2:324
1583 #: build/C/man2/socketpair.2:75
1584 #, no-wrap
1585 msgid "B<EAFNOSUPPORT>"
1586 msgstr "B<EAFNOSUPPORT>"
1587
1588 #. type: Plain text
1589 #: build/C/man2/connect.2:156
1590 msgid ""
1591 "The passed address didn't have the correct address family in its "
1592 "I<sa_family> field."
1593 msgstr ""
1594 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1595 "い。"
1596
1597 #. type: TP
1598 #: build/C/man2/connect.2:156
1599 #, no-wrap
1600 msgid "B<EAGAIN>"
1601 msgstr "B<EAGAIN>"
1602
1603 #. type: Plain text
1604 #: build/C/man2/connect.2:165
1605 msgid ""
1606 "No more free local ports or insufficient entries in the routing cache.  For "
1607 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1608 "B<ip>(7)  for information on how to increase the number of local ports."
1609 msgstr ""
1610 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1611 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1612 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1613
1614 #. type: TP
1615 #: build/C/man2/connect.2:165
1616 #, no-wrap
1617 msgid "B<EALREADY>"
1618 msgstr "B<EALREADY>"
1619
1620 #. type: Plain text
1621 #: build/C/man2/connect.2:169
1622 msgid ""
1623 "The socket is nonblocking and a previous connection attempt has not yet been "
1624 "completed."
1625 msgstr ""
1626 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1627
1628 #. type: Plain text
1629 #: build/C/man2/connect.2:172
1630 msgid "The file descriptor is not a valid index in the descriptor table."
1631 msgstr ""
1632 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1633 "い。"
1634
1635 #. type: TP
1636 #: build/C/man2/connect.2:172 build/C/man2/recv.2:412
1637 #, no-wrap
1638 msgid "B<ECONNREFUSED>"
1639 msgstr "B<ECONNREFUSED>"
1640
1641 #. type: Plain text
1642 #: build/C/man2/connect.2:175
1643 msgid "No-one listening on the remote address."
1644 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1645
1646 #. type: Plain text
1647 #: build/C/man2/connect.2:178
1648 msgid "The socket structure address is outside the user's address space."
1649 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1650
1651 #. type: TP
1652 #: build/C/man2/connect.2:178
1653 #, no-wrap
1654 msgid "B<EINPROGRESS>"
1655 msgstr "B<EINPROGRESS>"
1656
1657 #. type: Plain text
1658 #: build/C/man2/connect.2:203
1659 msgid ""
1660 "The socket is nonblocking and the connection cannot be completed "
1661 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1662 "by selecting the socket for writing.  After B<select>(2)  indicates "
1663 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1664 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1665 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1666 "error codes listed here, explaining the reason for the failure)."
1667 msgstr ""
1668 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1669 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1670 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1671 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1672 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1673 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1674 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1675 "の原因が分かる。"
1676
1677 #.  For TCP, the connection will complete asynchronously.
1678 #.  See http://lkml.org/lkml/2005/7/12/254
1679 #. type: Plain text
1680 #: build/C/man2/connect.2:209
1681 msgid ""
1682 "The system call was interrupted by a signal that was caught; see B<signal>"
1683 "(7)."
1684 msgstr ""
1685 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1686
1687 #. type: TP
1688 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1689 #, no-wrap
1690 msgid "B<EISCONN>"
1691 msgstr "B<EISCONN>"
1692
1693 #. type: Plain text
1694 #: build/C/man2/connect.2:212
1695 msgid "The socket is already connected."
1696 msgstr "ソケットは既に接続 (connect) されている。"
1697
1698 #. type: TP
1699 #: build/C/man2/connect.2:212
1700 #, no-wrap
1701 msgid "B<ENETUNREACH>"
1702 msgstr "B<ENETUNREACH>"
1703
1704 #. type: Plain text
1705 #: build/C/man2/connect.2:215
1706 msgid "Network is unreachable."
1707 msgstr "到達できないネットワークである。"
1708
1709 #. type: Plain text
1710 #: build/C/man2/connect.2:218
1711 msgid "The file descriptor is not associated with a socket."
1712 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1713
1714 #. type: TP
1715 #: build/C/man2/connect.2:218
1716 #, no-wrap
1717 msgid "B<ETIMEDOUT>"
1718 msgstr "B<ETIMEDOUT>"
1719
1720 #. type: Plain text
1721 #: build/C/man2/connect.2:225
1722 msgid ""
1723 "Timeout while attempting connection.  The server may be too busy to accept "
1724 "new connections.  Note that for IP sockets the timeout may be very long when "
1725 "syncookies are enabled on the server."
1726 msgstr ""
1727 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1728 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1729 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1730 "ること。"
1731
1732 #.  SVr4 documents the additional
1733 #.  general error codes
1734 #.  .BR EADDRNOTAVAIL ,
1735 #.  .BR EINVAL ,
1736 #.  .BR EAFNOSUPPORT ,
1737 #.  .BR EALREADY ,
1738 #.  .BR EINTR ,
1739 #.  .BR EPROTOTYPE ,
1740 #.  and
1741 #.  .BR ENOSR .
1742 #.  It also
1743 #.  documents many additional error conditions not described here.
1744 #. type: Plain text
1745 #: build/C/man2/connect.2:241
1746 msgid ""
1747 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1748 "POSIX.1-2001."
1749 msgstr ""
1750 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1751
1752 #. type: Plain text
1753 #: build/C/man2/connect.2:258
1754 msgid ""
1755 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1756 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1757 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1758 msgstr ""
1759 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1760 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1761 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1762
1763 #. type: Plain text
1764 #: build/C/man2/connect.2:263
1765 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1766 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1767
1768 #. type: Plain text
1769 #: build/C/man2/connect.2:270
1770 msgid ""
1771 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1772 "B<path_resolution>(7)"
1773 msgstr ""
1774 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1775 "B<path_resolution>(7)"
1776
1777 #. type: TH
1778 #: build/C/man3/getifaddrs.3:36
1779 #, no-wrap
1780 msgid "GETIFADDRS"
1781 msgstr "GETIFADDRS"
1782
1783 #. type: TH
1784 #: build/C/man3/getifaddrs.3:36
1785 #, no-wrap
1786 msgid "2012-11-11"
1787 msgstr "2012-11-11"
1788
1789 #. type: TH
1790 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1791 #: build/C/man3/if_nametoindex.3:25
1792 #, no-wrap
1793 msgid "GNU"
1794 msgstr "GNU"
1795
1796 #. type: Plain text
1797 #: build/C/man3/getifaddrs.3:39
1798 msgid "getifaddrs, freeifaddrs - get interface addresses"
1799 msgstr ""
1800
1801 #. type: Plain text
1802 #: build/C/man3/getifaddrs.3:43
1803 #, no-wrap
1804 msgid ""
1805 "B<#include E<lt>sys/types.hE<gt>>\n"
1806 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1807 msgstr ""
1808 "B<#include E<lt>sys/types.hE<gt>>\n"
1809 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1810
1811 #. type: Plain text
1812 #: build/C/man3/getifaddrs.3:45
1813 #, no-wrap
1814 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1815 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1816
1817 #. type: Plain text
1818 #: build/C/man3/getifaddrs.3:47
1819 #, no-wrap
1820 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1821 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1822
1823 #. type: Plain text
1824 #: build/C/man3/getifaddrs.3:58
1825 msgid ""
1826 "The B<getifaddrs>()  function creates a linked list of structures describing "
1827 "the network interfaces of the local system, and stores the address of the "
1828 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1829 "structures, defined as follows:"
1830 msgstr ""
1831
1832 #. type: Plain text
1833 #: build/C/man3/getifaddrs.3:77
1834 #, no-wrap
1835 msgid ""
1836 "struct ifaddrs {\n"
1837 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1838 "    char            *ifa_name;    /* Name of interface */\n"
1839 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1840 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1841 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1842 "    union {\n"
1843 "        struct sockaddr *ifu_broadaddr;\n"
1844 "                         /* Broadcast address of interface */\n"
1845 "        struct sockaddr *ifu_dstaddr;\n"
1846 "                         /* Point-to-point destination address */\n"
1847 "    } ifa_ifu;\n"
1848 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1849 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1850 "    void            *ifa_data;    /* Address-specific data */\n"
1851 "};\n"
1852 msgstr ""
1853 "struct ifaddrs {\n"
1854 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1855 "    char            *ifa_name;    /* Name of interface */\n"
1856 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1857 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1858 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1859 "    union {\n"
1860 "        struct sockaddr *ifu_broadaddr;\n"
1861 "                         /* Broadcast address of interface */\n"
1862 "        struct sockaddr *ifu_dstaddr;\n"
1863 "                         /* Point-to-point destination address */\n"
1864 "    } ifa_ifu;\n"
1865 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1866 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1867 "    void            *ifa_data;    /* Address-specific data */\n"
1868 "};\n"
1869
1870 #. type: Plain text
1871 #: build/C/man3/getifaddrs.3:84
1872 msgid ""
1873 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1874 "or NULL if this is the last item of the list."
1875 msgstr ""
1876
1877 #.  The constant
1878 #.  .B IF NAMESIZE
1879 #.  indicates the maximum length of this field.
1880 #. type: Plain text
1881 #: build/C/man3/getifaddrs.3:91
1882 msgid "The I<ifa_name> points to the null-terminated interface name."
1883 msgstr ""
1884
1885 #. type: Plain text
1886 #: build/C/man3/getifaddrs.3:100
1887 msgid ""
1888 "The I<ifa_flags> field contains the interface flags, as returned by the "
1889 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1890 "these flags)."
1891 msgstr ""
1892
1893 #. type: Plain text
1894 #: build/C/man3/getifaddrs.3:109
1895 msgid ""
1896 "The I<ifa_addr> field points to a structure containing the interface "
1897 "address.  (The I<sa_family> subfield should be consulted to determine the "
1898 "format of the address structure.)  This field may contain a NULL pointer."
1899 msgstr ""
1900
1901 #. type: Plain text
1902 #: build/C/man3/getifaddrs.3:116
1903 msgid ""
1904 "The I<ifa_netmask> field points to a structure containing the netmask "
1905 "associated with I<ifa_addr>, if applicable for the address family.  This "
1906 "field may contain a NULL pointer."
1907 msgstr ""
1908
1909 #. type: Plain text
1910 #: build/C/man3/getifaddrs.3:131
1911 msgid ""
1912 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1913 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1914 "will contain the broadcast address associated with I<ifa_addr> (if "
1915 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1916 "destination address of the point-to-point interface."
1917 msgstr ""
1918
1919 #. type: Plain text
1920 #: build/C/man3/getifaddrs.3:136
1921 msgid ""
1922 "The I<ifa_data> field points to a buffer containing address-family-specific "
1923 "data; this field may be NULL if there is no such data for this interface."
1924 msgstr ""
1925
1926 #. type: Plain text
1927 #: build/C/man3/getifaddrs.3:142
1928 msgid ""
1929 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1930 "freed using B<freeifaddrs>()  when no longer needed."
1931 msgstr ""
1932
1933 #. type: Plain text
1934 #: build/C/man3/getifaddrs.3:149
1935 msgid ""
1936 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1937 "I<errno> is set appropriately."
1938 msgstr ""
1939
1940 #. type: Plain text
1941 #: build/C/man3/getifaddrs.3:162
1942 msgid ""
1943 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1944 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1945 "(2), B<malloc>(3), or B<realloc>(3)."
1946 msgstr ""
1947
1948 #. type: Plain text
1949 #: build/C/man3/getifaddrs.3:170
1950 msgid ""
1951 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1952 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1953 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1954 "available on kernels that support netlink."
1955 msgstr ""
1956
1957 #.  , but the BSD-derived documentation generally
1958 #.  appears to be confused and obsolete on this point.
1959 #.  i.e., commonly it still says one of them will be NULL, even if
1960 #.  the ifa_ifu union is already present
1961 #. type: Plain text
1962 #: build/C/man3/getifaddrs.3:190
1963 msgid ""
1964 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1965 "the BSD systems, but with slightly different semantics documented"
1966 "\\(emreturning one entry per interface, not per address.  This means "
1967 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1968 "address, and no link-level address is returned if the interface has an IP "
1969 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1970 "I<ifa_dstaddr> differs on various systems."
1971 msgstr ""
1972
1973 #. type: Plain text
1974 #: build/C/man3/getifaddrs.3:207
1975 msgid ""
1976 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
1977 "assigned to the interface, but also one B<AF_PACKET> address per interface "
1978 "containing lower-level details about the interface and its physical layer.  "
1979 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
1980 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
1981 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
1982 "hE<gt>>), which contains various interface attributes and statistics."
1983 msgstr ""
1984
1985 #. type: Plain text
1986 #: build/C/man3/getifaddrs.3:214
1987 msgid ""
1988 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
1989 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
1990 "system:"
1991 msgstr ""
1992
1993 #. type: Plain text
1994 #: build/C/man3/getifaddrs.3:228
1995 #, no-wrap
1996 msgid ""
1997 "$ B<./a.out>\n"
1998 "lo      address family: 17 (AF_PACKET)\n"
1999 "eth0    address family: 17 (AF_PACKET)\n"
2000 "lo      address family: 2 (AF_INET)\n"
2001 "        address: E<lt>127.0.0.1E<gt>\n"
2002 "eth0    address family: 2 (AF_INET)\n"
2003 "        address: E<lt>10.1.1.4E<gt>\n"
2004 "lo      address family: 10 (AF_INET6)\n"
2005 "        address: E<lt>::1E<gt>\n"
2006 "eth0    address family: 10 (AF_INET6)\n"
2007 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2008 msgstr ""
2009 "$ B<./a.out>\n"
2010 "lo      address family: 17 (AF_PACKET)\n"
2011 "eth0    address family: 17 (AF_PACKET)\n"
2012 "lo      address family: 2 (AF_INET)\n"
2013 "        address: E<lt>127.0.0.1E<gt>\n"
2014 "eth0    address family: 2 (AF_INET)\n"
2015 "        address: E<lt>10.1.1.4E<gt>\n"
2016 "lo      address family: 10 (AF_INET6)\n"
2017 "        address: E<lt>::1E<gt>\n"
2018 "eth0    address family: 10 (AF_INET6)\n"
2019 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2020
2021 #. type: SS
2022 #: build/C/man3/getifaddrs.3:230 build/C/man3/if_nameindex.3:120
2023 #: build/C/man2/recvmmsg.2:206
2024 #, no-wrap
2025 msgid "Program source"
2026 msgstr ""
2027
2028 #. type: Plain text
2029 #: build/C/man3/getifaddrs.3:240
2030 #, no-wrap
2031 msgid ""
2032 "#include E<lt>arpa/inet.hE<gt>\n"
2033 "#include E<lt>sys/socket.hE<gt>\n"
2034 "#include E<lt>netdb.hE<gt>\n"
2035 "#include E<lt>ifaddrs.hE<gt>\n"
2036 "#include E<lt>stdio.hE<gt>\n"
2037 "#include E<lt>stdlib.hE<gt>\n"
2038 "#include E<lt>unistd.hE<gt>\n"
2039 msgstr ""
2040 "#include E<lt>arpa/inet.hE<gt>\n"
2041 "#include E<lt>sys/socket.hE<gt>\n"
2042 "#include E<lt>netdb.hE<gt>\n"
2043 "#include E<lt>ifaddrs.hE<gt>\n"
2044 "#include E<lt>stdio.hE<gt>\n"
2045 "#include E<lt>stdlib.hE<gt>\n"
2046 "#include E<lt>unistd.hE<gt>\n"
2047
2048 #. type: Plain text
2049 #: build/C/man3/getifaddrs.3:247
2050 #, no-wrap
2051 msgid ""
2052 "int\n"
2053 "main(int argc, char *argv[])\n"
2054 "{\n"
2055 "    struct ifaddrs *ifaddr, *ifa;\n"
2056 "    int family, s;\n"
2057 "    char host[NI_MAXHOST];\n"
2058 msgstr ""
2059 "int\n"
2060 "main(int argc, char *argv[])\n"
2061 "{\n"
2062 "    struct ifaddrs *ifaddr, *ifa;\n"
2063 "    int family, s;\n"
2064 "    char host[NI_MAXHOST];\n"
2065
2066 #. type: Plain text
2067 #: build/C/man3/getifaddrs.3:252
2068 #, no-wrap
2069 msgid ""
2070 "    if (getifaddrs(&ifaddr) == -1) {\n"
2071 "        perror(\"getifaddrs\");\n"
2072 "        exit(EXIT_FAILURE);\n"
2073 "    }\n"
2074 msgstr ""
2075 "    if (getifaddrs(&ifaddr) == -1) {\n"
2076 "        perror(\"getifaddrs\");\n"
2077 "        exit(EXIT_FAILURE);\n"
2078 "    }\n"
2079
2080 #. type: Plain text
2081 #: build/C/man3/getifaddrs.3:255
2082 #, no-wrap
2083 msgid ""
2084 "    /* Walk through linked list, maintaining head pointer so we\n"
2085 "       can free list later */\n"
2086 msgstr ""
2087 "    /* Walk through linked list, maintaining head pointer so we\n"
2088 "       can free list later */\n"
2089
2090 #. type: Plain text
2091 #: build/C/man3/getifaddrs.3:259
2092 #, no-wrap
2093 msgid ""
2094 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2095 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2096 "            continue;\n"
2097 msgstr ""
2098 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2099 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2100 "            continue;\n"
2101
2102 #. type: Plain text
2103 #: build/C/man3/getifaddrs.3:261
2104 #, no-wrap
2105 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2106 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2107
2108 #. type: Plain text
2109 #: build/C/man3/getifaddrs.3:264
2110 #, no-wrap
2111 msgid ""
2112 "        /* Display interface name and family (including symbolic\n"
2113 "           form of the latter for the common families) */\n"
2114 msgstr ""
2115 "        /* Display interface name and family (including symbolic\n"
2116 "           form of the latter for the common families) */\n"
2117
2118 #. type: Plain text
2119 #: build/C/man3/getifaddrs.3:270
2120 #, no-wrap
2121 msgid ""
2122 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2123 "                ifa-E<gt>ifa_name, family,\n"
2124 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2125 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2126 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2127 msgstr ""
2128 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2129 "                ifa-E<gt>ifa_name, family,\n"
2130 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2131 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2132 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2133
2134 #. type: Plain text
2135 #: build/C/man3/getifaddrs.3:272
2136 #, no-wrap
2137 msgid "        /* For an AF_INET* interface address, display the address */\n"
2138 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2139
2140 #. type: Plain text
2141 #: build/C/man3/getifaddrs.3:285
2142 #, no-wrap
2143 msgid ""
2144 "        if (family == AF_INET || family == AF_INET6) {\n"
2145 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2146 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2147 "                                          sizeof(struct sockaddr_in6),\n"
2148 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2149 "            if (s != 0) {\n"
2150 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2151 "                exit(EXIT_FAILURE);\n"
2152 "            }\n"
2153 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2154 "        }\n"
2155 "    }\n"
2156 msgstr ""
2157 "        if (family == AF_INET || family == AF_INET6) {\n"
2158 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2159 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2160 "                                          sizeof(struct sockaddr_in6),\n"
2161 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2162 "            if (s != 0) {\n"
2163 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2164 "                exit(EXIT_FAILURE);\n"
2165 "            }\n"
2166 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2167 "        }\n"
2168 "    }\n"
2169
2170 #. type: Plain text
2171 #: build/C/man3/getifaddrs.3:289
2172 #, no-wrap
2173 msgid ""
2174 "    freeifaddrs(ifaddr);\n"
2175 "    exit(EXIT_SUCCESS);\n"
2176 "}\n"
2177 msgstr ""
2178 "    freeifaddrs(ifaddr);\n"
2179 "    exit(EXIT_SUCCESS);\n"
2180 "}\n"
2181
2182 #. type: Plain text
2183 #: build/C/man3/getifaddrs.3:296
2184 msgid ""
2185 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2186 msgstr ""
2187 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2188
2189 #. type: TH
2190 #: build/C/man2/getsockname.2:40
2191 #, no-wrap
2192 msgid "GETSOCKNAME"
2193 msgstr "GETSOCKNAME"
2194
2195 #. type: Plain text
2196 #: build/C/man2/getsockname.2:43
2197 msgid "getsockname - get socket name"
2198 msgstr "getsockname - ソケットの名前を取得する"
2199
2200 #. type: Plain text
2201 #: build/C/man2/getsockname.2:49
2202 #, no-wrap
2203 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2204 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2205
2206 #. type: Plain text
2207 #: build/C/man2/getsockname.2:62
2208 msgid ""
2209 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2210 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2211 "should be initialized to indicate the amount of space (in bytes) pointed to "
2212 "by I<addr>.  On return it contains the actual size of the socket address."
2213 msgstr ""
2214 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2215 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2216 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2217 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2218 "納される。"
2219
2220 #. type: Plain text
2221 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2222 #: build/C/man2/listen.2:96
2223 msgid "The argument I<sockfd> is not a valid descriptor."
2224 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2225
2226 #. type: Plain text
2227 #: build/C/man2/getsockname.2:84
2228 msgid ""
2229 "The I<addr> argument points to memory not in a valid part of the process "
2230 "address space."
2231 msgstr ""
2232 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2233 "い。"
2234
2235 #. type: Plain text
2236 #: build/C/man2/getsockname.2:88
2237 msgid "I<addrlen> is invalid (e.g., is negative)."
2238 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2239
2240 #. type: TP
2241 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2242 #: build/C/man2/send.2:335
2243 #, no-wrap
2244 msgid "B<ENOBUFS>"
2245 msgstr "B<ENOBUFS>"
2246
2247 #. type: Plain text
2248 #: build/C/man2/getsockname.2:92
2249 msgid ""
2250 "Insufficient resources were available in the system to perform the operation."
2251 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2252
2253 #. type: Plain text
2254 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2255 msgid "The argument I<sockfd> is a file, not a socket."
2256 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2257
2258 #.  SVr4 documents additional ENOMEM
2259 #.  and ENOSR error codes.
2260 #. type: Plain text
2261 #: build/C/man2/getsockname.2:103
2262 msgid ""
2263 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2264 "POSIX.1-2001."
2265 msgstr ""
2266 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2267
2268 #. type: Plain text
2269 #: build/C/man2/getsockname.2:112
2270 msgid ""
2271 "The third argument of B<getsockname>()  is in reality an I<int *> (and this "
2272 "is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
2273 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
2274 msgstr ""
2275 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2276 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2277 "POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2278
2279 #. type: Plain text
2280 #: build/C/man2/getsockname.2:119
2281 msgid ""
2282 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2283 "(7)"
2284 msgstr ""
2285 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2286 "(7)"
2287
2288 #. type: TH
2289 #: build/C/man2/getsockopt.2:44
2290 #, no-wrap
2291 msgid "GETSOCKOPT"
2292 msgstr "GETSOCKOPT"
2293
2294 #. type: Plain text
2295 #: build/C/man2/getsockopt.2:47
2296 msgid "getsockopt, setsockopt - get and set options on sockets"
2297 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2298
2299 #. type: Plain text
2300 #: build/C/man2/getsockopt.2:57
2301 #, no-wrap
2302 msgid ""
2303 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2304 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2305 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2306 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2307 msgstr ""
2308 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2309 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2310 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2311 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2312
2313 #. type: Plain text
2314 #: build/C/man2/getsockopt.2:67
2315 msgid ""
2316 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2317 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2318 "protocol levels; they are always present at the uppermost socket level."
2319 msgstr ""
2320 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2321 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2322 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2323 "定される。"
2324
2325 #. type: Plain text
2326 #: build/C/man2/getsockopt.2:86
2327 msgid ""
2328 "When manipulating socket options, the level at which the option resides and "
2329 "the name of the option must be specified.  To manipulate options at the "
2330 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2331 "options at any other level the protocol number of the appropriate protocol "
2332 "controlling the option is supplied.  For example, to indicate that an option "
2333 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2334 "protocol number of B<TCP>; see B<getprotoent>(3)."
2335 msgstr ""
2336 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2337 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2338 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2339 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2340 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2341 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2342 "B<getprotoent>(3)  を参照すること。"
2343
2344 #. type: Plain text
2345 #: build/C/man2/getsockopt.2:108
2346 msgid ""
2347 "The arguments I<optval> and I<optlen> are used to access option values for "
2348 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2349 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2350 "I<optlen> is a value-result argument, initially containing the size of the "
2351 "buffer pointed to by I<optval>, and modified on return to indicate the "
2352 "actual size of the value returned.  If no option value is to be supplied or "
2353 "returned, I<optval> may be NULL."
2354 msgstr ""
2355 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2356 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2357 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2358 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2359 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2360 "I<optval> は NULL でも良い。"
2361
2362 #. type: Plain text
2363 #: build/C/man2/getsockopt.2:118
2364 msgid ""
2365 "I<Optname> and any specified options are passed uninterpreted to the "
2366 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2367 "socket.hE<gt>> contains definitions for socket level options, described "
2368 "below.  Options at other protocol levels vary in format and name; consult "
2369 "the appropriate entries in section 4 of the manual."
2370 msgstr ""
2371 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2372 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2373 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2374 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2375 "ること。"
2376
2377 #. type: Plain text
2378 #: build/C/man2/getsockopt.2:127
2379 msgid ""
2380 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2381 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2382 "or zero if the option is to be disabled."
2383 msgstr ""
2384 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2385 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2386 "を指定し、 無効(disable)にするにはゼロを指定する。"
2387
2388 #. type: Plain text
2389 #: build/C/man2/getsockopt.2:131
2390 msgid ""
2391 "For a description of the available socket options see B<socket>(7)  and the "
2392 "appropriate protocol man pages."
2393 msgstr ""
2394 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2395 "ルの man ページを参照のこと。"
2396
2397 #. type: Plain text
2398 #: build/C/man2/getsockopt.2:152
2399 msgid ""
2400 "The address pointed to by I<optval> is not in a valid part of the process "
2401 "address space.  For B<getsockopt>(), this error may also be returned if "
2402 "I<optlen> is not in a valid part of the process address space."
2403 msgstr ""
2404 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2405 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2406 "い場合にもこのエラーが返される。"
2407
2408 #. type: Plain text
2409 #: build/C/man2/getsockopt.2:163
2410 msgid ""
2411 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2412 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2413 "option described in B<ip>(7))."
2414 msgstr ""
2415 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2416 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2417 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2418
2419 #. type: TP
2420 #: build/C/man2/getsockopt.2:163
2421 #, no-wrap
2422 msgid "B<ENOPROTOOPT>"
2423 msgstr "B<ENOPROTOOPT>"
2424
2425 #. type: Plain text
2426 #: build/C/man2/getsockopt.2:166
2427 msgid "The option is unknown at the level indicated."
2428 msgstr "指定された層(level)にはこのオプションは存在しない。"
2429
2430 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2431 #.  not document the
2432 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2433 #.  options
2434 #. type: Plain text
2435 #: build/C/man2/getsockopt.2:178
2436 msgid ""
2437 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2438 msgstr ""
2439 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2440 "POSIX.1-2001."
2441
2442 #. type: Plain text
2443 #: build/C/man2/getsockopt.2:199
2444 msgid ""
2445 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2446 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2447 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2448 "glibc.  See also B<accept>(2)."
2449 msgstr ""
2450 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2451 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2452 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2453 "る。 B<accept>(2)  も参照のこと。"
2454
2455 #. type: Plain text
2456 #: build/C/man2/getsockopt.2:202
2457 msgid ""
2458 "Several of the socket options should be handled at lower levels of the "
2459 "system."
2460 msgstr ""
2461 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2462
2463 #. type: Plain text
2464 #: build/C/man2/getsockopt.2:210
2465 msgid ""
2466 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2467 "B<tcp>(7), B<unix>(7)"
2468 msgstr ""
2469 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2470 "B<tcp>(7), B<unix>(7)"
2471
2472 #. type: TH
2473 #: build/C/man3/if_nameindex.3:26
2474 #, no-wrap
2475 msgid "IF_NAMEINDEX"
2476 msgstr ""
2477
2478 #. type: TH
2479 #: build/C/man3/if_nameindex.3:26
2480 #, no-wrap
2481 msgid "2012-11-21"
2482 msgstr "2012-11-21"
2483
2484 #. type: Plain text
2485 #: build/C/man3/if_nameindex.3:29
2486 msgid ""
2487 "if_nameindex, if_freenameindex - get network interface names and indexes"
2488 msgstr ""
2489
2490 #. type: Plain text
2491 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2492 #, no-wrap
2493 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2494 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2495
2496 #. type: Plain text
2497 #: build/C/man3/if_nameindex.3:35
2498 #, no-wrap
2499 msgid ""
2500 "B<struct if_nameindex *if_nameindex(void);>\n"
2501 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2502 msgstr ""
2503
2504 #. type: Plain text
2505 #: build/C/man3/if_nameindex.3:46
2506 msgid ""
2507 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2508 "structures, each containing information about one of the network interfaces "
2509 "on the local system.  The I<if_nameindex> structure contains at least the "
2510 "following entries:"
2511 msgstr ""
2512
2513 #. type: Plain text
2514 #: build/C/man3/if_nameindex.3:51
2515 #, no-wrap
2516 msgid ""
2517 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2518 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2519 msgstr ""
2520
2521 #. type: Plain text
2522 #: build/C/man3/if_nameindex.3:65
2523 msgid ""
2524 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2525 "points to the null-terminated interface name.  The end of the array is "
2526 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2527 msgstr ""
2528
2529 #. type: Plain text
2530 #: build/C/man3/if_nameindex.3:71
2531 msgid ""
2532 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2533 "and should be freed using B<if_freenameindex>()  when no longer needed."
2534 msgstr ""
2535
2536 #. type: Plain text
2537 #: build/C/man3/if_nameindex.3:78
2538 #, fuzzy
2539 #| msgid ""
2540 #| "On success, zero is returned.  On error, -1 is returned, and I<errno> is "
2541 #| "set appropriately."
2542 msgid ""
2543 "On success, B<if_nameindex>()  returns pointer to the array; on error, a "
2544 "NULL pointer is returned, and I<errno> is set appropriately."
2545 msgstr ""
2546 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
2547 "設定される。"
2548
2549 #. type: Plain text
2550 #: build/C/man3/if_nameindex.3:83
2551 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2552 msgstr ""
2553
2554 #. type: Plain text
2555 #: build/C/man3/if_nameindex.3:86
2556 msgid "Insufficient resources available."
2557 msgstr "利用可能なリソースが十分にない。"
2558
2559 #. type: Plain text
2560 #: build/C/man3/if_nameindex.3:97
2561 msgid ""
2562 "B<if_nameindex>()  may also fail for any of the errors specified for "
2563 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2564 "B<sendto>(2), or B<malloc>(3)."
2565 msgstr ""
2566
2567 #. type: Plain text
2568 #: build/C/man3/if_nameindex.3:104
2569 msgid ""
2570 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2571 "glibc 2.3.4, the implementation only supported interfaces with IPv4 "
2572 "addresses.  Support of interfaces that don't have IPv4 addresses is only "
2573 "available on kernels that support netlink."
2574 msgstr ""
2575
2576 #. type: Plain text
2577 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:87
2578 msgid "RFC\\ 3493, POSIX.1-2001."
2579 msgstr "RFC\\ 3493, POSIX.1-2001."
2580
2581 #. type: Plain text
2582 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:89
2583 msgid "This function first appeared in BSDi."
2584 msgstr "この関数は BSDi 初めて登場した。"
2585
2586 #. type: Plain text
2587 #: build/C/man3/if_nameindex.3:112
2588 msgid ""
2589 "The program below demonstrates the use of the functions described on this "
2590 "page.  An example of the output this program might produce is the following:"
2591 msgstr ""
2592
2593 #. type: Plain text
2594 #: build/C/man3/if_nameindex.3:118
2595 #, no-wrap
2596 msgid ""
2597 "$ B<./a.out>I<\n"
2598 "1: lo\n"
2599 "2: wlan0\n"
2600 "3: em1>\n"
2601 msgstr ""
2602
2603 #. type: Plain text
2604 #: build/C/man3/if_nameindex.3:126
2605 #, no-wrap
2606 msgid ""
2607 "#include E<lt>net/if.hE<gt>\n"
2608 "#include E<lt>stdio.hE<gt>\n"
2609 "#include E<lt>stdlib.hE<gt>\n"
2610 "#include E<lt>unistd.hE<gt>\n"
2611 msgstr ""
2612 "#include E<lt>net/if.hE<gt>\n"
2613 "#include E<lt>stdio.hE<gt>\n"
2614 "#include E<lt>stdlib.hE<gt>\n"
2615 "#include E<lt>unistd.hE<gt>\n"
2616
2617 #. type: Plain text
2618 #: build/C/man3/if_nameindex.3:131
2619 #, no-wrap
2620 msgid ""
2621 "int\n"
2622 "main(int argc, char *argv[])\n"
2623 "{\n"
2624 "    struct if_nameindex *if_ni, *i;\n"
2625 msgstr ""
2626 "int\n"
2627 "main(int argc, char *argv[])\n"
2628 "{\n"
2629 "    struct if_nameindex *if_ni, *i;\n"
2630
2631 #. type: Plain text
2632 #: build/C/man3/if_nameindex.3:137
2633 #, no-wrap
2634 msgid ""
2635 "    if_ni = if_nameindex();\n"
2636 "    if (if_ni == NULL) {\n"
2637 "        perror(\"if_nameindex\");\n"
2638 "        exit(EXIT_FAILURE);\n"
2639 "    }\n"
2640 msgstr ""
2641 "    if_ni = if_nameindex();\n"
2642 "    if (if_ni == NULL) {\n"
2643 "        perror(\"if_nameindex\");\n"
2644 "        exit(EXIT_FAILURE);\n"
2645 "    }\n"
2646
2647 #. type: Plain text
2648 #: build/C/man3/if_nameindex.3:140
2649 #, no-wrap
2650 msgid ""
2651 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2652 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2653 msgstr ""
2654
2655 #. type: Plain text
2656 #: build/C/man3/if_nameindex.3:142
2657 #, no-wrap
2658 msgid "    if_freenameindex(if_ni);\n"
2659 msgstr ""
2660
2661 #. type: Plain text
2662 #: build/C/man3/if_nameindex.3:145 build/C/man2/select.2:573
2663 #, no-wrap
2664 msgid ""
2665 "    exit(EXIT_SUCCESS);\n"
2666 "}\n"
2667 msgstr ""
2668 "    exit(EXIT_SUCCESS);\n"
2669 "}\n"
2670
2671 #. type: Plain text
2672 #: build/C/man3/if_nameindex.3:153
2673 msgid ""
2674 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2675 "B<if_nametoindex>(3), B<ifconfig>(8)"
2676 msgstr "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), B<if_nametoindex>(3), B<ifconfig>(8)"
2677
2678 #. type: TH
2679 #: build/C/man3/if_nametoindex.3:25
2680 #, no-wrap
2681 msgid "IF_NAMETOINDEX"
2682 msgstr "IF_NAMETOINDEX"
2683
2684 #. type: TH
2685 #: build/C/man3/if_nametoindex.3:25
2686 #, no-wrap
2687 msgid "2012-12-14"
2688 msgstr "2012-12-14"
2689
2690 #. type: Plain text
2691 #: build/C/man3/if_nametoindex.3:29
2692 msgid ""
2693 "if_nametoindex, if_indextoname - mappings between network interface names "
2694 "and indexes"
2695 msgstr ""
2696
2697 #. type: Plain text
2698 #: build/C/man3/if_nametoindex.3:34
2699 #, no-wrap
2700 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2701 msgstr ""
2702
2703 #. type: Plain text
2704 #: build/C/man3/if_nametoindex.3:36
2705 #, no-wrap
2706 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2707 msgstr ""
2708
2709 #. type: Plain text
2710 #: build/C/man3/if_nametoindex.3:43
2711 msgid ""
2712 "The B<if_nametoindex>()  function returns the index of the network interface "
2713 "corresponding to the name I<ifname>."
2714 msgstr ""
2715
2716 #. type: Plain text
2717 #: build/C/man3/if_nametoindex.3:54
2718 msgid ""
2719 "The B<if_indextoname>()  function returns the name of the network interface "
2720 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2721 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2722 "least B<IF_NAMESIZE> bytes."
2723 msgstr ""
2724
2725 #. type: Plain text
2726 #: build/C/man3/if_nametoindex.3:61
2727 #, fuzzy
2728 msgid ""
2729 "On success, B<if_nametoindex>()  returns the index number of the network "
2730 "interface; on error, 0 is returned and I<errno> is set appropriately."
2731 msgstr "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場合、 -1 を返し、 I<errno> を適切に設定にする。"
2732
2733 #. type: Plain text
2734 #: build/C/man3/if_nametoindex.3:69
2735 #, fuzzy
2736 #| msgid ""
2737 #| "On success, zero is returned.  On error, -1 is returned, and I<errno> is "
2738 #| "set appropriately."
2739 msgid ""
2740 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2741 "returned and I<errno> is set appropriately."
2742 msgstr ""
2743 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
2744 "設定される。"
2745
2746 #. type: Plain text
2747 #: build/C/man3/if_nametoindex.3:74
2748 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2749 msgstr ""
2750
2751 #. type: TP
2752 #: build/C/man3/if_nametoindex.3:74
2753 #, fuzzy, no-wrap
2754 #| msgid "B<ENFILE>"
2755 msgid "B<ENXIO>"
2756 msgstr "B<ENFILE>"
2757
2758 #. type: Plain text
2759 #: build/C/man3/if_nametoindex.3:77
2760 msgid "No interface found for the index."
2761 msgstr ""
2762
2763 #. type: Plain text
2764 #: build/C/man3/if_nametoindex.3:85
2765 msgid ""
2766 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2767 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2768 msgstr ""
2769
2770 #. type: Plain text
2771 #: build/C/man3/if_nametoindex.3:93
2772 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2773 msgstr ""
2774
2775 #. type: TH
2776 #: build/C/man2/listen.2:45
2777 #, no-wrap
2778 msgid "LISTEN"
2779 msgstr "LISTEN"
2780
2781 #. type: TH
2782 #: build/C/man2/listen.2:45
2783 #, no-wrap
2784 msgid "2008-11-20"
2785 msgstr "2008-11-20"
2786
2787 #. type: Plain text
2788 #: build/C/man2/listen.2:48
2789 msgid "listen - listen for connections on a socket"
2790 msgstr "listen - ソケット(socket)上の接続を待つ"
2791
2792 #. type: Plain text
2793 #: build/C/man2/listen.2:55
2794 #, no-wrap
2795 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2796 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2797
2798 #. type: Plain text
2799 #: build/C/man2/listen.2:63
2800 msgid ""
2801 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2802 "that is, as a socket that will be used to accept incoming connection "
2803 "requests using B<accept>(2)."
2804 msgstr ""
2805 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2806 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2807 "した接続要求を受け付けるのに使用されるソケットである。"
2808
2809 #. type: Plain text
2810 #: build/C/man2/listen.2:70
2811 msgid ""
2812 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2813 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2814 msgstr ""
2815 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2816 "するファイルディスクリプタである。"
2817
2818 #. type: Plain text
2819 #: build/C/man2/listen.2:82
2820 msgid ""
2821 "The I<backlog> argument defines the maximum length to which the queue of "
2822 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2823 "when the queue is full, the client may receive an error with an indication "
2824 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2825 "the request may be ignored so that a later reattempt at connection succeeds."
2826 msgstr ""
2827 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2828 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2829 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2830 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2831 "い。"
2832
2833 #. type: Plain text
2834 #: build/C/man2/listen.2:91
2835 msgid "Another socket is already listening on the same port."
2836 msgstr "別のソケットが既に同じポートを listen している。"
2837
2838 #. type: Plain text
2839 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
2840 msgid "The argument I<sockfd> is not a socket."
2841 msgstr "引き数 I<sockfd> はソケットではない。"
2842
2843 #. type: Plain text
2844 #: build/C/man2/listen.2:106
2845 msgid "The socket is not of a type that supports the B<listen>()  operation."
2846 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2847
2848 #. type: Plain text
2849 #: build/C/man2/listen.2:111
2850 msgid ""
2851 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2852 "4.2BSD."
2853 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2854
2855 #. type: Plain text
2856 #: build/C/man2/listen.2:113
2857 msgid "To accept connections, the following steps are performed:"
2858 msgstr "接続を受け付けるには、以下の処理が実行される。"
2859
2860 #. type: TP
2861 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
2862 #, no-wrap
2863 msgid "1."
2864 msgstr "1."
2865
2866 #. type: Plain text
2867 #: build/C/man2/listen.2:117
2868 msgid "A socket is created with B<socket>(2)."
2869 msgstr "B<socket>(2)  でソケットを作成する。"
2870
2871 #. type: TP
2872 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
2873 #, no-wrap
2874 msgid "2."
2875 msgstr "2."
2876
2877 #. type: Plain text
2878 #: build/C/man2/listen.2:123
2879 msgid ""
2880 "The socket is bound to a local address using B<bind>(2), so that other "
2881 "sockets may be B<connect>(2)ed to it."
2882 msgstr ""
2883 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2884 "のソケットに B<connect>(2)  できるようにする。"
2885
2886 #. type: TP
2887 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
2888 #, no-wrap
2889 msgid "3."
2890 msgstr "3."
2891
2892 #. type: Plain text
2893 #: build/C/man2/listen.2:127
2894 msgid ""
2895 "A willingness to accept incoming connections and a queue limit for incoming "
2896 "connections are specified with B<listen>()."
2897 msgstr ""
2898 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2899 "定する。"
2900
2901 #. type: TP
2902 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
2903 #, no-wrap
2904 msgid "4."
2905 msgstr "4."
2906
2907 #. type: Plain text
2908 #: build/C/man2/listen.2:130
2909 msgid "Connections are accepted with B<accept>(2)."
2910 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2911
2912 #. type: Plain text
2913 #: build/C/man2/listen.2:153
2914 msgid ""
2915 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2916 "2.2.  Now it specifies the queue length for I<completely> established "
2917 "sockets waiting to be accepted, instead of the number of incomplete "
2918 "connection requests.  The maximum length of the queue for incomplete sockets "
2919 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2920 "are enabled there is no logical maximum length and this setting is ignored.  "
2921 "See B<tcp>(7)  for more information."
2922 msgstr ""
2923 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2924 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2925 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2926 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2927 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2928 "論理的な最大長は存在せず、この設定は無視される。"
2929
2930 #.  The following is now rather historic information (MTK, Jun 05)
2931 #.  Don't rely on this value in portable applications since BSD
2932 #.  (and some BSD-derived systems) limit the backlog to 5.
2933 #. type: Plain text
2934 #: build/C/man2/listen.2:166
2935 msgid ""
2936 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2937 "somaxconn>, then it is silently truncated to that value; the default value "
2938 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
2939 "value, B<SOMAXCONN>, with the value 128."
2940 msgstr ""
2941 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2942 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2943 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2944 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2945
2946 #. type: Plain text
2947 #: build/C/man2/listen.2:175
2948 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2949 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2950
2951 #. type: TH
2952 #: build/C/man2/recv.2:41
2953 #, no-wrap
2954 msgid "RECV"
2955 msgstr "RECV"
2956
2957 #. type: TH
2958 #: build/C/man2/recv.2:41
2959 #, no-wrap
2960 msgid "2012-12-21"
2961 msgstr "2012-12-21"
2962
2963 #. type: Plain text
2964 #: build/C/man2/recv.2:44
2965 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
2966 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
2967
2968 #. type: Plain text
2969 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
2970 #: build/C/man2/select_tut.2:47
2971 #, no-wrap
2972 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
2973 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
2974
2975 #. type: Plain text
2976 #: build/C/man2/recv.2:53
2977 #, no-wrap
2978 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2979 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2980
2981 #. type: Plain text
2982 #: build/C/man2/recv.2:56
2983 #, no-wrap
2984 msgid ""
2985 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2986 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2987 msgstr ""
2988 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2989 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2990
2991 #. type: Plain text
2992 #: build/C/man2/recv.2:58
2993 #, no-wrap
2994 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2995 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2996
2997 #. type: Plain text
2998 #: build/C/man2/recv.2:66
2999 msgid ""
3000 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
3001 "a socket, and may be used to receive data on a socket whether or not it is "
3002 "connection-oriented."
3003 msgstr ""
3004 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
3005 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
3006 "接続指向 (connection-oriened) であってもなくてもよい。"
3007
3008 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3009 #.  .I src_addr
3010 #.  is filled in.
3011 #.  .I src_addr
3012 #.  is also filled in for stream sockets in the UNIX domain, but is not
3013 #.  filled in for stream sockets in the Internet domain.)
3014 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3015 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3016 #. type: Plain text
3017 #: build/C/man2/recv.2:95
3018 msgid ""
3019 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3020 "address, this source address is filled in.  When I<src_addr> is NULL, "
3021 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
3022 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
3023 "caller should initialize before the call to the size of the buffer "
3024 "associated with I<src_addr>, and modified on return to indicate the actual "
3025 "size of the source address.  The returned address is truncated if the buffer "
3026 "provided is too small; in this case, I<addrlen> will return a value greater "
3027 "than was supplied to the call."
3028 msgstr ""
3029 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
3030 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
3031 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
3032 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
3033 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
3034 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
3035 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
3036 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
3037 "な値が返される。"
3038
3039 #. type: Plain text
3040 #: build/C/man2/recv.2:107
3041 msgid ""
3042 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3043 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
3044 "argument."
3045 msgstr ""
3046 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
3047 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
3048 "()  と等価である。"
3049
3050 #. type: Plain text
3051 #: build/C/man2/recv.2:113
3052 msgid ""
3053 "All three routines return the length of the message on successful "
3054 "completion.  If a message is too long to fit in the supplied buffer, excess "
3055 "bytes may be discarded depending on the type of socket the message is "
3056 "received from."
3057 msgstr ""
3058 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
3059 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
3060 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
3061
3062 #. type: Plain text
3063 #: build/C/man2/recv.2:123
3064 msgid ""
3065 "If no messages are available at the socket, the receive calls wait for a "
3066 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3067 "which case the value -1 is returned and the external variable I<errno> is "
3068 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3069 "data available, up to the requested amount, rather than waiting for receipt "
3070 "of the full amount requested."
3071 msgstr ""
3072 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3073 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3074 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3075 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3076 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3077 "る (受信されるデータの最大サイズは要求したサイズである)。"
3078
3079 #. type: Plain text
3080 #: build/C/man2/recv.2:129
3081 msgid ""
3082 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
3083 "data arrives."
3084 msgstr ""
3085 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
3086 "る。"
3087
3088 #. type: Plain text
3089 #: build/C/man2/recv.2:135
3090 msgid ""
3091 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
3092 "the following values:"
3093 msgstr ""
3094 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
3095 "和 を取ったものを指定する:"
3096
3097 #. type: TP
3098 #: build/C/man2/recv.2:135
3099 #, no-wrap
3100 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3101 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3102
3103 #. type: Plain text
3104 #: build/C/man2/recv.2:146
3105 msgid ""
3106 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3107 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3108 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3109 "flag of B<open>(2)."
3110 msgstr ""
3111 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3112 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3113 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3114 "同じ理由で有用である。"
3115
3116 #. type: TP
3117 #: build/C/man2/recv.2:146 build/C/man2/send.2:188
3118 #, no-wrap
3119 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3120 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3121
3122 #. type: Plain text
3123 #: build/C/man2/recv.2:156
3124 msgid ""
3125 "Enables nonblocking operation; if the operation would block, the call fails "
3126 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3127 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3128 msgstr ""
3129 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3130 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3131 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3132
3133 #. type: TP
3134 #: build/C/man2/recv.2:156
3135 #, no-wrap
3136 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3137 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3138
3139 #. type: Plain text
3140 #: build/C/man2/recv.2:175
3141 msgid ""
3142 "This flag specifies that queued errors should be received from the socket "
3143 "error queue.  The error is passed in an ancillary message with a type "
3144 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3145 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3146 "information.  The payload of the original packet that caused the error is "
3147 "passed as normal data via I<msg_iovec>.  The original destination address of "
3148 "the datagram that caused the error is supplied via I<msg_name>."
3149 msgstr ""
3150 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3151 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3152 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3153 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3154 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3155 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3156 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3157 "I<msg_name> 経由で参照できる。"
3158
3159 #. type: Plain text
3160 #: build/C/man2/recv.2:187 build/C/man2/recv.2:250
3161 msgid ""
3162 "For local errors, no address is passed (this can be checked with the "
3163 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3164 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3165 "the pending socket error is regenerated based on the next queued error and "
3166 "will be passed on the next socket operation."
3167 msgstr ""
3168 "ローカルなエラーの場合はアドレスは渡されない\n"
3169 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3170 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3171 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3172 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3173
3174 #. type: Plain text
3175 #: build/C/man2/recv.2:191
3176 msgid "The error is supplied in a I<sock_extended_err> structure:"
3177 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3178
3179 #. type: Plain text
3180 #: build/C/man2/recv.2:198
3181 #, no-wrap
3182 msgid ""
3183 "#define SO_EE_ORIGIN_NONE    0\n"
3184 "#define SO_EE_ORIGIN_LOCAL   1\n"
3185 "#define SO_EE_ORIGIN_ICMP    2\n"
3186 "#define SO_EE_ORIGIN_ICMP6   3\n"
3187 msgstr ""
3188 "#define SO_EE_ORIGIN_NONE    0\n"
3189 "#define SO_EE_ORIGIN_LOCAL   1\n"
3190 "#define SO_EE_ORIGIN_ICMP    2\n"
3191 "#define SO_EE_ORIGIN_ICMP6   3\n"
3192
3193 #. type: Plain text
3194 #: build/C/man2/recv.2:210
3195 #, no-wrap
3196 msgid ""
3197 "struct sock_extended_err\n"
3198 "{\n"
3199 "    uint32_t ee_errno;   /* error number */\n"
3200 "    uint8_t  ee_origin;  /* where the error originated */\n"
3201 "    uint8_t  ee_type;    /* type */\n"
3202 "    uint8_t  ee_code;    /* code */\n"
3203 "    uint8_t  ee_pad;     /* padding */\n"
3204 "    uint32_t ee_info;    /* additional information */\n"
3205 "    uint32_t ee_data;    /* other data */\n"
3206 "    /* More data may follow */\n"
3207 "};\n"
3208 msgstr ""
3209 "struct sock_extended_err\n"
3210 "{\n"
3211 "    uint32_t ee_errno;   /* error number */\n"
3212 "    uint8_t  ee_origin;  /* where the error originated */\n"
3213 "    uint8_t  ee_type;    /* type */\n"
3214 "    uint8_t  ee_code;    /* code */\n"
3215 "    uint8_t  ee_pad;     /* padding */\n"
3216 "    uint32_t ee_info;    /* additional information */\n"
3217 "    uint32_t ee_data;    /* other data */\n"
3218 "    /* More data may follow */\n"
3219 "};\n"
3220
3221 #. type: Plain text
3222 #: build/C/man2/recv.2:212
3223 #, no-wrap
3224 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3225 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3226
3227 #. type: Plain text
3228 #: build/C/man2/recv.2:236
3229 msgid ""
3230 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3231 "is the origin code of where the error originated.  The other fields are "
3232 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3233 "address of the network object where the error originated from given a "
3234 "pointer to the ancillary message.  If this address is not known, the "
3235 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3236 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3237 "caused the error is passed as normal data."
3238 msgstr ""
3239 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3240 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3241 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3242 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3243 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3244 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3245 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3246 "される。"
3247
3248 #. type: TP
3249 #: build/C/man2/recv.2:250 build/C/man2/recv.2:381 build/C/man2/send.2:230
3250 #, no-wrap
3251 msgid "B<MSG_OOB>"
3252 msgstr "B<MSG_OOB>"
3253
3254 #. type: Plain text
3255 #: build/C/man2/recv.2:257
3256 msgid ""
3257 "This flag requests receipt of out-of-band data that would not be received in "
3258 "the normal data stream.  Some protocols place expedited data at the head of "
3259 "the normal data queue, and thus this flag cannot be used with such protocols."
3260 msgstr ""
3261 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3262 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3263 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3264 "い。"
3265
3266 #. type: TP
3267 #: build/C/man2/recv.2:257
3268 #, no-wrap
3269 msgid "B<MSG_PEEK>"
3270 msgstr "B<MSG_PEEK>"
3271
3272 #. type: Plain text
3273 #: build/C/man2/recv.2:264
3274 msgid ""
3275 "This flag causes the receive operation to return data from the beginning of "
3276 "the receive queue without removing that data from the queue.  Thus, a "
3277 "subsequent receive call will return the same data."
3278 msgstr ""
3279 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3280 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3281 "が返ることになる。"
3282
3283 #. type: TP
3284 #: build/C/man2/recv.2:264
3285 #, no-wrap
3286 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3287 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3288
3289 #. type: Plain text
3290 #: build/C/man2/recv.2:275
3291 msgid ""
3292 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3293 "netlink (since Linux 2.6.22) and UNIX datagram (since Linux 3.4) sockets: "
3294 "return the real length of the packet or datagram, even when it was longer "
3295 "than the passed buffer.  Not implemented for UNIX domain (B<unix>(7))  "
3296 "sockets."
3297 msgstr "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux 3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長さを返す。 UNIX ドメインソケット (B<unix>(7))  ソケットについては実装されていない。"
3298
3299 #. type: Plain text
3300 #: build/C/man2/recv.2:278
3301 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3302 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3303
3304 #. type: TP
3305 #: build/C/man2/recv.2:278
3306 #, no-wrap
3307 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3308 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3309
3310 #. type: Plain text
3311 #: build/C/man2/recv.2:285
3312 msgid ""
3313 "This flag requests that the operation block until the full request is "
3314 "satisfied.  However, the call may still return less data than requested if a "
3315 "signal is caught, an error or disconnect occurs, or the next data to be "
3316 "received is of a different type than that returned."
3317 msgstr ""
3318 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3319 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3320 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3321 "りデータが少なくても返ることがある。"
3322
3323 #. type: Plain text
3324 #: build/C/man2/recv.2:293
3325 msgid ""
3326 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3327 "directly supplied arguments.  This structure is defined as follows in "
3328 "I<E<lt>sys/socket.hE<gt>>:"
3329 msgstr ""
3330 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3331 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3332
3333 #. type: Plain text
3334 #: build/C/man2/recv.2:300
3335 #, no-wrap
3336 msgid ""
3337 "struct iovec {                    /* Scatter/gather array items */\n"
3338 "    void  *iov_base;              /* Starting address */\n"
3339 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3340 "};\n"
3341 msgstr ""
3342 "struct iovec {                    /* Scatter/gather array items */\n"
3343 "    void  *iov_base;              /* Starting address */\n"
3344 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3345 "};\n"
3346
3347 #. type: Plain text
3348 #: build/C/man2/recv.2:310 build/C/man2/send.2:258
3349 #, no-wrap
3350 msgid ""
3351 "struct msghdr {\n"
3352 "    void         *msg_name;       /* optional address */\n"
3353 "    socklen_t     msg_namelen;    /* size of address */\n"
3354 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3355 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3356 "    void         *msg_control;    /* ancillary data, see below */\n"
3357 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3358 "    int           msg_flags;      /* flags on received message */\n"
3359 "};\n"
3360 msgstr ""
3361 "struct msghdr {\n"
3362 "    void         *msg_name;       /* 追加のアドレス */\n"
3363 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3364 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3365 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3366 "    void         *msg_control;    /* 補助データ (後述) */\n"
3367 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3368 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3369 "};\n"
3370
3371 #. type: Plain text
3372 #: build/C/man2/recv.2:340
3373 msgid ""
3374 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3375 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3376 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3377 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3378 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3379 "other protocol control-related messages or miscellaneous ancillary data.  "
3380 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3381 "the available buffer in I<msg_control>; upon return from a successful call "
3382 "it will contain the length of the control message sequence."
3383 msgstr ""
3384 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3385 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3386 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3387 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3388 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3389 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3390 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3391 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3392 "さが入っている。"
3393
3394 #. type: Plain text
3395 #: build/C/man2/recv.2:342
3396 msgid "The messages are of the form:"
3397 msgstr "メッセージの形式は以下の通り:"
3398
3399 #. type: Plain text
3400 #: build/C/man2/recv.2:352
3401 #, no-wrap
3402 msgid ""
3403 "struct cmsghdr {\n"
3404 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3405 "    int           cmsg_level;   /* originating protocol */\n"
3406 "    int           cmsg_type;    /* protocol-specific type */\n"
3407 "/* followed by\n"
3408 "    unsigned char cmsg_data[]; */\n"
3409 "};\n"
3410 msgstr ""
3411 "struct cmsghdr {\n"
3412 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3413 "    int           cmsg_level;   /* originating protocol */\n"
3414 "    int           cmsg_type;    /* protocol-specific type */\n"
3415 "/* followed by\n"
3416 "    unsigned char cmsg_data[]; */\n"
3417 "};\n"
3418
3419 #. type: Plain text
3420 #: build/C/man2/recv.2:357
3421 msgid ""
3422 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3423 msgstr ""
3424 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3425
3426 #. type: Plain text
3427 #: build/C/man2/recv.2:360
3428 msgid ""
3429 "As an example, Linux uses this ancillary data mechanism to pass extended "
3430 "errors, IP options, or file descriptors over UNIX domain sockets."
3431 msgstr ""
3432 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3433 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3434 "いる。"
3435
3436 #. type: Plain text
3437 #: build/C/man2/recv.2:368
3438 msgid ""
3439 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3440 "It can contain several flags:"
3441 msgstr ""
3442 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3443 "れる。ここにはいくつかのフラグが入る。"
3444
3445 #. type: TP
3446 #: build/C/man2/recv.2:368
3447 #, no-wrap
3448 msgid "B<MSG_EOR>"
3449 msgstr "B<MSG_EOR>"
3450
3451 #. type: Plain text
3452 #: build/C/man2/recv.2:373
3453 msgid ""
3454 "indicates end-of-record; the data returned completed a record (generally "
3455 "used with sockets of type B<SOCK_SEQPACKET>)."
3456 msgstr ""
3457 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3458 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3459
3460 #. type: TP
3461 #: build/C/man2/recv.2:373
3462 #, no-wrap
3463 msgid "B<MSG_TRUNC>"
3464 msgstr "B<MSG_TRUNC>"
3465
3466 #. type: Plain text
3467 #: build/C/man2/recv.2:377
3468 msgid ""
3469 "indicates that the trailing portion of a datagram was discarded because the "
3470 "datagram was larger than the buffer supplied."
3471 msgstr ""
3472 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3473 "た部分が捨てられたことを示す。"
3474
3475 #. type: TP
3476 #: build/C/man2/recv.2:377
3477 #, no-wrap
3478 msgid "B<MSG_CTRUNC>"
3479 msgstr "B<MSG_CTRUNC>"
3480
3481 #. type: Plain text
3482 #: build/C/man2/recv.2:381
3483 msgid ""
3484 "indicates that some control data were discarded due to lack of space in the "
3485 "buffer for ancillary data."
3486 msgstr ""
3487 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3488 "を示す。"
3489
3490 #. type: Plain text
3491 #: build/C/man2/recv.2:384
3492 msgid ""
3493 "is returned to indicate that expedited or out-of-band data were received."
3494 msgstr "速達データや帯域外データを受信したことを示す。"
3495
3496 #. type: TP
3497 #: build/C/man2/recv.2:384
3498 #, no-wrap
3499 msgid "B<MSG_ERRQUEUE>"
3500 msgstr "B<MSG_ERRQUEUE>"
3501
3502 #. type: Plain text
3503 #: build/C/man2/recv.2:388
3504 msgid ""
3505 "indicates that no data was received but an extended error from the socket "
3506 "error queue."
3507 msgstr ""
3508 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3509 "を示す。"
3510
3511 #. type: Plain text
3512 #: build/C/man2/recv.2:393
3513 msgid ""
3514 "These calls return the number of bytes received, or -1 if an error "
3515 "occurred.  The return value will be 0 when the peer has performed an orderly "
3516 "shutdown."
3517 msgstr ""
3518 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3519 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3520
3521 #. type: Plain text
3522 #: build/C/man2/recv.2:398
3523 msgid ""
3524 "These are some standard errors generated by the socket layer.  Additional "
3525 "errors may be generated and returned from the underlying protocol modules; "
3526 "see their manual pages."
3527 msgstr ""
3528 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3529 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3530 "ること。"
3531
3532 #.  Actually EAGAIN on Linux
3533 #. type: Plain text
3534 #: build/C/man2/recv.2:407
3535 msgid ""
3536 "The socket is marked nonblocking and the receive operation would block, or a "
3537 "receive timeout had been set and the timeout expired before data was "
3538 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3539 "and does not require these constants to have the same value, so a portable "
3540 "application should check for both possibilities."
3541 msgstr ""
3542 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3543 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3544 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3545 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3546 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3547
3548 #. type: Plain text
3549 #: build/C/man2/recv.2:412
3550 msgid "The argument I<sockfd> is an invalid descriptor."
3551 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3552
3553 #. type: Plain text
3554 #: build/C/man2/recv.2:416
3555 msgid ""
3556 "A remote host refused to allow the network connection (typically because it "
3557 "is not running the requested service)."
3558 msgstr ""
3559 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3560 "たサービスが起動されていないなどがある)。"
3561
3562 #. type: Plain text
3563 #: build/C/man2/recv.2:420
3564 msgid ""
3565 "The receive buffer pointer(s) point outside the process's address space."
3566 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3567
3568 #. type: Plain text
3569 #: build/C/man2/recv.2:425
3570 msgid ""
3571 "The receive was interrupted by delivery of a signal before any data were "
3572 "available; see B<signal>(7)."
3573 msgstr ""
3574 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3575
3576 #. type: Plain text
3577 #: build/C/man2/recv.2:429 build/C/man2/send.2:323
3578 msgid "Invalid argument passed."
3579 msgstr "不正な引き数が渡された。"
3580
3581 #. type: Plain text
3582 #: build/C/man2/recv.2:433
3583 msgid "Could not allocate memory for B<recvmsg>()."
3584 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3585
3586 #. type: TP
3587 #: build/C/man2/recv.2:433 build/C/man2/send.2:346
3588 #, no-wrap
3589 msgid "B<ENOTCONN>"
3590 msgstr "B<ENOTCONN>"
3591
3592 #. type: Plain text
3593 #: build/C/man2/recv.2:440
3594 msgid ""
3595 "The socket is associated with a connection-oriented protocol and has not "
3596 "been connected (see B<connect>(2)  and B<accept>(2))."
3597 msgstr ""
3598 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3599 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3600
3601 #. type: Plain text
3602 #: build/C/man2/recv.2:445
3603 msgid "The argument I<sockfd> does not refer to a socket."
3604 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3605
3606 #. type: Plain text
3607 #: build/C/man2/recv.2:448
3608 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3609 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3610
3611 #. type: Plain text
3612 #: build/C/man2/recv.2:455
3613 msgid ""
3614 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3615 "flags."
3616 msgstr ""
3617 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3618 "されている。"
3619
3620 #. type: Plain text
3621 #: build/C/man2/recv.2:471
3622 msgid ""
3623 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3624 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3625 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3626 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3627 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3628 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3629 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3630 msgstr ""
3631 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3632 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3633 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3634 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3635 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3636 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3637 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3638
3639 #.  glibc bug raised 12 Mar 2006
3640 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3641 #.  The problem is an underlying kernel issue: the size of the
3642 #.  __kernel_size_t type used to type this field varies
3643 #.  across architectures, but socklen_t is always 32 bits.
3644 #. type: Plain text
3645 #: build/C/man2/recv.2:485 build/C/man2/send.2:409
3646 msgid ""
3647 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3648 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3649 "I<size_t>."
3650 msgstr ""
3651 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3652 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3653 "ある。"
3654
3655 #. type: Plain text
3656 #: build/C/man2/recv.2:490
3657 msgid ""
3658 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3659 "can be used to receive multiple datagrams in a single call."
3660 msgstr ""
3661 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3662 "固有の システムコールに関する情報が書かれている。"
3663
3664 #. type: Plain text
3665 #: build/C/man2/recv.2:495
3666 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3667 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3668
3669 #. type: Plain text
3670 #: build/C/man2/recv.2:506
3671 msgid ""
3672 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3673 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3674 msgstr ""
3675 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3676 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3677
3678 #. type: TH
3679 #: build/C/man2/recvmmsg.2:31
3680 #, no-wrap
3681 msgid "RECVMMSG"
3682 msgstr "RECVMMSG"
3683
3684 #. type: TH
3685 #: build/C/man2/recvmmsg.2:31
3686 #, no-wrap
3687 msgid "2012-12-24"
3688 msgstr "2012-12-24"
3689
3690 #. type: Plain text
3691 #: build/C/man2/recvmmsg.2:34
3692 msgid "recvmmsg - receive multiple messages on a socket"
3693 msgstr ""
3694
3695 #. type: Plain text
3696 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3697 #, no-wrap
3698 msgid ""
3699 "B<#define _GNU_SOURCE>\n"
3700 "B<#include E<lt>sys/socket.hE<gt>>\n"
3701 msgstr ""
3702 "B<#define _GNU_SOURCE>\n"
3703 "B<#include E<lt>sys/socket.hE<gt>>\n"
3704
3705 #. type: Plain text
3706 #: build/C/man2/recvmmsg.2:41
3707 #, no-wrap
3708 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3709 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3710
3711 #. type: Plain text
3712 #: build/C/man2/recvmmsg.2:43
3713 #, no-wrap
3714 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3715 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3716
3717 #. type: Plain text
3718 #: build/C/man2/recvmmsg.2:55
3719 msgid ""
3720 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3721 "the caller to receive multiple messages from a socket using a single system "
3722 "call.  (This has performance benefits for some applications.)  A further "
3723 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3724 "operation."
3725 msgstr ""
3726
3727 #. type: Plain text
3728 #: build/C/man2/recvmmsg.2:59
3729 msgid ""
3730 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3731 "from."
3732 msgstr ""
3733
3734 #. type: Plain text
3735 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
3736 msgid ""
3737 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3738 "The size of this array is specified in I<vlen>."
3739 msgstr ""
3740
3741 #. type: Plain text
3742 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
3743 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3744 msgstr ""
3745
3746 #. type: Plain text
3747 #: build/C/man2/recvmmsg.2:80
3748 #, no-wrap
3749 msgid ""
3750 "struct mmsghdr {\n"
3751 "    struct msghdr msg_hdr;  /* Message header */\n"
3752 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3753 "};\n"
3754 msgstr ""
3755 "struct mmsghdr {\n"
3756 "    struct msghdr msg_hdr;  /* Message header */\n"
3757 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3758 "};\n"
3759
3760 #. type: Plain text
3761 #: build/C/man2/recvmmsg.2:95
3762 msgid ""
3763 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3764 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3765 "in the entry.  This field has the same value as the return value of a single "
3766 "B<recvmsg>(2)  on the header."
3767 msgstr ""
3768
3769 #. type: Plain text
3770 #: build/C/man2/recvmmsg.2:102
3771 msgid ""
3772 "The I<flags> argument contains flags ORed together.  The flags are the same "
3773 "as documented for B<recvmsg>(2), with the following addition:"
3774 msgstr ""
3775
3776 #. type: TP
3777 #: build/C/man2/recvmmsg.2:102
3778 #, no-wrap
3779 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
3780 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
3781
3782 #. type: Plain text
3783 #: build/C/man2/recvmmsg.2:107
3784 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3785 msgstr ""
3786
3787 #. type: Plain text
3788 #: build/C/man2/recvmmsg.2:123
3789 msgid ""
3790 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3791 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3792 "operation.  (This interval will be rounded up to the system clock "
3793 "granularity, and kernel scheduling delays mean that the blocking interval "
3794 "may overrun by a small amount.)  If I<timeout> is I<NULL> then the operation "
3795 "blocks indefinitely."
3796 msgstr ""
3797
3798 #. type: Plain text
3799 #: build/C/man2/recvmmsg.2:134
3800 msgid ""
3801 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3802 "received or until the timeout expires.  A nonblocking call reads as many "
3803 "messages as are available (up to the limit specified by I<vlen>)  and "
3804 "returns immediately."
3805 msgstr ""
3806
3807 #. type: Plain text
3808 #: build/C/man2/recvmmsg.2:149
3809 msgid ""
3810 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3811 "to contain information about each received message: I<msg_len> contains the "
3812 "size of the received message; the subfields of I<msg_hdr> are updated as "
3813 "described in B<recvmsg>(2).  The return value of the call indicates the "
3814 "number of elements of I<msgvec> that have been updated."
3815 msgstr ""
3816
3817 #. type: Plain text
3818 #: build/C/man2/recvmmsg.2:157
3819 msgid ""
3820 "On success, B<recvmmsg>()  returns the number of messages received in "
3821 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3822 "error."
3823 msgstr ""
3824
3825 #. type: Plain text
3826 #: build/C/man2/recvmmsg.2:161
3827 msgid ""
3828 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3829 msgstr ""
3830
3831 #. type: Plain text
3832 #: build/C/man2/recvmmsg.2:165
3833 msgid "I<timeout> is invalid."
3834 msgstr ""
3835
3836 #. type: Plain text
3837 #: build/C/man2/recvmmsg.2:170
3838 #, fuzzy
3839 #| msgid ""
3840 #| "The B<accept4>()  system call is available starting with Linux 2.6.28; "
3841 #| "support in glibc is available starting with version 2.10."
3842 msgid ""
3843 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
3844 "was added in version 2.12."
3845 msgstr ""
3846 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
3847 "サポートはバージョン 2.10 以降で利用可能である。"
3848
3849 #. type: Plain text
3850 #: build/C/man2/recvmmsg.2:173
3851 msgid "B<recvmmsg>()  is Linux-specific."
3852 msgstr ""
3853
3854 #. type: Plain text
3855 #: build/C/man2/recvmmsg.2:181
3856 msgid ""
3857 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
3858 "socket and stores them in multiple buffers.  The call returns if all buffers "
3859 "are filled or if the timeout specified has expired."
3860 msgstr ""
3861
3862 #. type: Plain text
3863 #: build/C/man2/recvmmsg.2:184
3864 msgid ""
3865 "The following snippet periodically generates UDP datagrams containing a "
3866 "random number:"
3867 msgstr ""
3868
3869 #. type: Plain text
3870 #: build/C/man2/recvmmsg.2:189
3871 #, no-wrap
3872 msgid ""
3873 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
3874 "B<sleep 0.25; done>\n"
3875 msgstr ""
3876
3877 #. type: Plain text
3878 #: build/C/man2/recvmmsg.2:194
3879 msgid ""
3880 "These datagrams are read by the example application, which can give the "
3881 "following output:"
3882 msgstr ""
3883
3884 #. type: Plain text
3885 #: build/C/man2/recvmmsg.2:204
3886 #, no-wrap
3887 msgid ""
3888 "$B< ./a.out>\n"
3889 "5 messages received\n"
3890 "1 11782\n"
3891 "2 11345\n"
3892 "3 304\n"
3893 "4 13514\n"
3894 "5 28421\n"
3895 msgstr ""
3896
3897 #. type: Plain text
3898 #: build/C/man2/recvmmsg.2:215
3899 #, no-wrap
3900 msgid ""
3901 "#define _GNU_SOURCE\n"
3902 "#include E<lt>netinet/ip.hE<gt>\n"
3903 "#include E<lt>stdio.hE<gt>\n"
3904 "#include E<lt>stdlib.hE<gt>\n"
3905 "#include E<lt>string.hE<gt>\n"
3906 "#include E<lt>sys/socket.hE<gt>\n"
3907 msgstr ""
3908 "#define _GNU_SOURCE\n"
3909 "#include E<lt>netinet/ip.hE<gt>\n"
3910 "#include E<lt>stdio.hE<gt>\n"
3911 "#include E<lt>stdlib.hE<gt>\n"
3912 "#include E<lt>string.hE<gt>\n"
3913 "#include E<lt>sys/socket.hE<gt>\n"
3914
3915 #. type: Plain text
3916 #: build/C/man2/recvmmsg.2:228
3917 #, no-wrap
3918 msgid ""
3919 "int\n"
3920 "main(void)\n"
3921 "{\n"
3922 "#define VLEN 10\n"
3923 "#define BUFSIZE 200\n"
3924 "#define TIMEOUT 1\n"
3925 "    int sockfd, retval, i;\n"
3926 "    struct sockaddr_in sa;\n"
3927 "    struct mmsghdr msgs[VLEN];\n"
3928 "    struct iovec iovecs[VLEN];\n"
3929 "    char bufs[VLEN][BUFSIZE+1];\n"
3930 "    struct timespec timeout;\n"
3931 msgstr ""
3932
3933 #. type: Plain text
3934 #: build/C/man2/recvmmsg.2:234 build/C/man2/sendmmsg.2:201
3935 #, no-wrap
3936 msgid ""
3937 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
3938 "    if (sockfd == -1) {\n"
3939 "        perror(\"socket()\");\n"
3940 "        exit(EXIT_FAILURE);\n"
3941 "    }\n"
3942 msgstr ""
3943 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
3944 "    if (sockfd == -1) {\n"
3945 "        perror(\"socket()\");\n"
3946 "        exit(EXIT_FAILURE);\n"
3947 "    }\n"
3948
3949 #. type: Plain text
3950 #: build/C/man2/recvmmsg.2:242
3951 #, no-wrap
3952 msgid ""
3953 "    sa.sin_family = AF_INET;\n"
3954 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
3955 "    sa.sin_port = htons(1234);\n"
3956 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
3957 "        perror(\"bind()\");\n"
3958 "        exit(EXIT_FAILURE);\n"
3959 "    }\n"
3960 msgstr ""
3961 "    sa.sin_family = AF_INET;\n"
3962 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
3963 "    sa.sin_port = htons(1234);\n"
3964 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
3965 "        perror(\"bind()\");\n"
3966 "        exit(EXIT_FAILURE);\n"
3967 "    }\n"
3968
3969 #. type: Plain text
3970 #: build/C/man2/recvmmsg.2:250
3971 #, no-wrap
3972 msgid ""
3973 "    memset(msgs, 0, sizeof(msgs));\n"
3974 "    for (i = 0; i E<lt> VLEN; i++) {\n"
3975 "        iovecs[i].iov_base         = bufs[i];\n"
3976 "        iovecs[i].iov_len          = BUFSIZE;\n"
3977 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
3978 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
3979 "    }\n"
3980 msgstr ""
3981
3982 #. type: Plain text
3983 #: build/C/man2/recvmmsg.2:253
3984 #, no-wrap
3985 msgid ""
3986 "    timeout.tv_sec = TIMEOUT;\n"
3987 "    timeout.tv_nsec = 0;\n"
3988 msgstr ""
3989 "    timeout.tv_sec = TIMEOUT;\n"
3990 "    timeout.tv_nsec = 0;\n"
3991
3992 #. type: Plain text
3993 #: build/C/man2/recvmmsg.2:259
3994 #, no-wrap
3995 msgid ""
3996 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
3997 "    if (retval == -1) {\n"
3998 "        perror(\"recvmmsg()\");\n"
3999 "        exit(EXIT_FAILURE);\n"
4000 "    }\n"
4001 msgstr ""
4002 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4003 "    if (retval == -1) {\n"
4004 "        perror(\"recvmmsg()\");\n"
4005 "        exit(EXIT_FAILURE);\n"
4006 "    }\n"
4007
4008 #. type: Plain text
4009 #: build/C/man2/recvmmsg.2:267
4010 #, no-wrap
4011 msgid ""
4012 "    printf(\"%d messages received\\en\", retval);\n"
4013 "    for (i = 0; i E<lt> retval; i++) {\n"
4014 "        bufs[i][msgs[i].msg_len] = 0;\n"
4015 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4016 "    }\n"
4017 "    exit(EXIT_SUCCESS);\n"
4018 "}\n"
4019 msgstr ""
4020
4021 #. type: Plain text
4022 #: build/C/man2/recvmmsg.2:275
4023 msgid ""
4024 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4025 "(2), B<socket>(7)"
4026 msgstr ""
4027 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4028 "(2), B<socket>(7)"
4029
4030 #. type: TH
4031 #: build/C/man2/select.2:38
4032 #, no-wrap
4033 msgid "SELECT"
4034 msgstr "SELECT"
4035
4036 #. type: TH
4037 #: build/C/man2/select.2:38
4038 #, no-wrap
4039 msgid "2012-08-17"
4040 msgstr "2012-08-17"
4041
4042 #. type: Plain text
4043 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4044 msgid ""
4045 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4046 "multiplexing"
4047 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4048
4049 #. type: Plain text
4050 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4051 #, no-wrap
4052 msgid "/* According to POSIX.1-2001 */\n"
4053 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4054
4055 #. type: Plain text
4056 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4057 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4058 #, no-wrap
4059 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4060 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4061
4062 #. type: Plain text
4063 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4064 #, no-wrap
4065 msgid "/* According to earlier standards */\n"
4066 msgstr "/* 以前の規格に従う場合 */\n"
4067
4068 #. type: Plain text
4069 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4070 #, no-wrap
4071 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4072 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4073
4074 #. type: Plain text
4075 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4076 #, no-wrap
4077 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4078 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4079
4080 #. type: Plain text
4081 #: build/C/man2/select.2:58
4082 #, no-wrap
4083 msgid ""
4084 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4085 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4086 msgstr ""
4087 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4088 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4089
4090 #. type: Plain text
4091 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4092 #, no-wrap
4093 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4094 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4095
4096 #. type: Plain text
4097 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4098 #, no-wrap
4099 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4100 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4101
4102 #. type: Plain text
4103 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4104 #, no-wrap
4105 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4106 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4107
4108 #. type: Plain text
4109 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4110 #, no-wrap
4111 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4112 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4113
4114 #. type: Plain text
4115 #: build/C/man2/select.2:72
4116 #, no-wrap
4117 msgid ""
4118 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4119 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4120 "B<            const sigset_t *>I<sigmask>B<);>\n"
4121 msgstr ""
4122 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4123 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4124 "B<            const sigset_t *>I<sigmask>B<);>\n"
4125
4126 #. type: Plain text
4127 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4128 #: build/C/man3/sockatmark.3:36
4129 msgid ""
4130 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4131 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4132
4133 #. type: Plain text
4134 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4135 msgid ""
4136 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4137 "600"
4138 msgstr ""
4139 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4140 "600"
4141
4142 #. type: Plain text
4143 #: build/C/man2/select.2:92
4144 msgid ""
4145 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4146 "descriptors, waiting until one or more of the file descriptors become \"ready"
4147 "\" for some class of I/O operation (e.g., input possible).  A file "
4148 "descriptor is considered ready if it is possible to perform the "
4149 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4150 msgstr ""
4151 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4152 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4153 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4154 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4155 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4156 "意味する。"
4157
4158 #. type: Plain text
4159 #: build/C/man2/select.2:98
4160 msgid ""
4161 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4162 "these three differences:"
4163 msgstr ""
4164 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4165
4166 #. type: TP
4167 #: build/C/man2/select.2:98
4168 #, no-wrap
4169 msgid "(i)"
4170 msgstr "(i)"
4171
4172 #. type: Plain text
4173 #: build/C/man2/select.2:108
4174 msgid ""
4175 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4176 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4177 "and nanoseconds)."
4178 msgstr ""
4179 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4180 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4181 "timespec> (秒・ナノ秒単位) を用いる。"
4182
4183 #. type: TP
4184 #: build/C/man2/select.2:108
4185 #, no-wrap
4186 msgid "(ii)"
4187 msgstr "(ii)"
4188
4189 #. type: Plain text
4190 #: build/C/man2/select.2:116
4191 msgid ""
4192 "B<select>()  may update the I<timeout> argument to indicate how much time "
4193 "was left.  B<pselect>()  does not change this argument."
4194 msgstr ""
4195 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4196 "B<pselect>()  はこの引き数を変更しない。"
4197
4198 #. type: TP
4199 #: build/C/man2/select.2:116
4200 #, no-wrap
4201 msgid "(iii)"
4202 msgstr "(iii)"
4203
4204 #. type: Plain text
4205 #: build/C/man2/select.2:125
4206 msgid ""
4207 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4208 "with NULL I<sigmask>."
4209 msgstr ""
4210 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4211 "指定した場合の B<pselect>()  と同じである。"
4212
4213 #. type: Plain text
4214 #: build/C/man2/select.2:143
4215 msgid ""
4216 "Three independent sets of file descriptors are watched.  Those listed in "
4217 "I<readfds> will be watched to see if characters become available for reading "
4218 "(more precisely, to see if a read will not block; in particular, a file "
4219 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4220 "watched to see if a write will not block, and those in I<exceptfds> will be "
4221 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4222 "which file descriptors actually changed status.  Each of the three file "
4223 "descriptor sets may be specified as NULL if no file descriptors are to be "
4224 "watched for the corresponding class of events."
4225 msgstr ""
4226 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4227 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4228 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4229 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4230 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4231 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4232 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4233 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4234 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4235 "指定することができる。"
4236
4237 #. type: Plain text
4238 #: build/C/man2/select.2:156
4239 msgid ""
4240 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4241 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4242 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4243 "part of the set; this is useful after B<select>()  returns."
4244 msgstr ""
4245 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4246 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4247 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4248 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4249 "る。"
4250
4251 #. type: Plain text
4252 #: build/C/man2/select.2:159
4253 msgid ""
4254 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4255 "plus 1."
4256 msgstr ""
4257 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4258 "のである。"
4259
4260 #. type: Plain text
4261 #: build/C/man2/select.2:179
4262 msgid ""
4263 "The I<timeout> argument specifies the minimum interval that B<select>()  "
4264 "should block waiting for a file descriptor to become ready.  (This interval "
4265 "will be rounded up to the system clock granularity, and kernel scheduling "
4266 "delays mean that the blocking interval may overrun by a small amount.)  If "
4267 "both fields of the I<timeval> structure are zero, then B<select>()  returns "
4268 "immediately.  (This is useful for polling.)  If I<timeout> is NULL (no "
4269 "timeout), B<select>()  can block indefinitely."
4270 msgstr ""
4271 "I<timeout> 引き数で、ファイルディスクリプタが ready になるのを待って\n"
4272 "B<select>() が停止する最小の停止時間を指定する\n"
4273 "(この停止時間はシステムクロックの粒度に切り上げられ、\n"
4274 "カーネルのスケジューリング遅延により少しだけ長くなる可能性がある)。\n"
4275 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復\n"
4276 "帰する (この機能はポーリング (polling) を行うのに便利である)。\n"
4277 "I<timeout> に NULL (タイムアウトなし) が指定されると、 B<select>() は無\n"
4278 "期限に停止 (block) する。"
4279
4280 #. type: Plain text
4281 #: build/C/man2/select.2:189
4282 msgid ""
4283 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4284 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4285 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4286 "restores the original signal mask."
4287 msgstr ""
4288 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4289 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4290 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4291 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4292
4293 #. type: Plain text
4294 #: build/C/man2/select.2:195
4295 msgid ""
4296 "Other than the difference in the precision of the I<timeout> argument, the "
4297 "following B<pselect>()  call:"
4298 msgstr ""
4299 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4300
4301 #. type: Plain text
4302 #: build/C/man2/select.2:199
4303 #, no-wrap
4304 msgid ""
4305 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4306 "                    timeout, &sigmask);\n"
4307 msgstr ""
4308 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4309 "                    timeout, &sigmask);\n"
4310
4311 #. type: Plain text
4312 #: build/C/man2/select.2:204
4313 msgid "is equivalent to I<atomically> executing the following calls:"
4314 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4315
4316 #. type: Plain text
4317 #: build/C/man2/select.2:207
4318 #, no-wrap
4319 msgid "    sigset_t origmask;\n"
4320 msgstr "    sigset_t origmask;\n"
4321
4322 #. type: Plain text
4323 #: build/C/man2/select.2:211
4324 #, no-wrap
4325 msgid ""
4326 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4327 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4328 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4329 msgstr ""
4330 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4331 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4332 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4333
4334 #. type: Plain text
4335 #: build/C/man2/select.2:232
4336 msgid ""
4337 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4338 "either a signal or for a file descriptor to become ready, then an atomic "
4339 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4340 "a global flag and returns.  Then a test of this global flag followed by a "
4341 "call of B<select>()  could hang indefinitely if the signal arrived just "
4342 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4343 "one to first block signals, handle the signals that have come in, then call "
4344 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4345 msgstr ""
4346 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4347 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4348 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4349 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4350 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4351 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4352 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4353 "で、前記の競合を避けることができる。)"
4354
4355 #. type: SS
4356 #: build/C/man2/select.2:232
4357 #, no-wrap
4358 msgid "The timeout"
4359 msgstr "タイムアウト"
4360
4361 #. type: Plain text
4362 #: build/C/man2/select.2:236
4363 msgid ""
4364 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4365 "like"
4366 msgstr ""
4367 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4368
4369 #. type: Plain text
4370 #: build/C/man2/select.2:243
4371 #, no-wrap
4372 msgid ""
4373 "struct timeval {\n"
4374 "    long    tv_sec;         /* seconds */\n"
4375 "    long    tv_usec;        /* microseconds */\n"
4376 "};\n"
4377 msgstr ""
4378 "struct timeval {\n"
4379 "    long    tv_sec;         /* 秒 */\n"
4380 "    long    tv_usec;        /* マイクロ秒 */\n"
4381 "};\n"
4382
4383 #. type: Plain text
4384 #: build/C/man2/select.2:247
4385 msgid "and"
4386 msgstr "や"
4387
4388 #. type: Plain text
4389 #: build/C/man2/select.2:254
4390 #, no-wrap
4391 msgid ""
4392 "struct timespec {\n"
4393 "    long    tv_sec;         /* seconds */\n"
4394 "    long    tv_nsec;        /* nanoseconds */\n"
4395 "};\n"
4396 msgstr ""
4397 "struct timespec {\n"
4398 "    long    tv_sec;         /* 秒 */\n"
4399 "    long    tv_nsec;        /* ナノ秒 */\n"
4400 "};\n"
4401
4402 #. type: Plain text
4403 #: build/C/man2/select.2:258
4404 msgid "(However, see below on the POSIX.1-2001 versions.)"
4405 msgstr ""
4406 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4407 "照)"
4408
4409 #. type: Plain text
4410 #: build/C/man2/select.2:266
4411 msgid ""
4412 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4413 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4414 "precision."
4415 msgstr ""
4416 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4417 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4418 "呼び出すという方法を使っているコードもある。"
4419
4420 #.  .PP - it is rumored that:
4421 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4422 #.  - it is certainly true that:
4423 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4424 #. type: Plain text
4425 #: build/C/man2/select.2:289
4426 msgid ""
4427 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4428 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4429 "either behavior.)  This causes problems both when Linux code which reads "
4430 "I<timeout> is ported to other operating systems, and when code is ported to "
4431 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4432 "without reinitializing it.  Consider I<timeout> to be undefined after "
4433 "B<select>()  returns."
4434 msgstr ""
4435 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4436 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4437 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4438 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4439 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4440 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4441 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4442 "ある。"
4443
4444 #. type: Plain text
4445 #: build/C/man2/select.2:306
4446 msgid ""
4447 "On success, B<select>()  and B<pselect>()  return the number of file "
4448 "descriptors contained in the three returned descriptor sets (that is, the "
4449 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4450 "which may be zero if the timeout expires before anything interesting "
4451 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4452 "sets and I<timeout> become undefined, so do not rely on their contents after "
4453 "an error."
4454 msgstr ""
4455 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4456 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4457 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4458 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4459 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4460 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4461
4462 #. type: Plain text
4463 #: build/C/man2/select.2:312
4464 msgid ""
4465 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4466 "descriptor that was already closed, or one on which an error has occurred.)"
4467 msgstr ""
4468 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4469 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4470 "タが指定された)。"
4471
4472 #. type: Plain text
4473 #: build/C/man2/select.2:316
4474 msgid "A signal was caught; see B<signal>(7)."
4475 msgstr "シグナルを受信した。"
4476
4477 #. type: Plain text
4478 #: build/C/man2/select.2:322
4479 msgid ""
4480 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4481 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4482
4483 #. type: Plain text
4484 #: build/C/man2/select.2:325
4485 msgid "unable to allocate memory for internal tables."
4486 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4487
4488 #. type: Plain text
4489 #: build/C/man2/select.2:331
4490 msgid ""
4491 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4492 "()  was emulated in glibc (but see BUGS)."
4493 msgstr ""
4494 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4495 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4496
4497 #. type: Plain text
4498 #: build/C/man2/select.2:342
4499 msgid ""
4500 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4501 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4502 "clones of the BSD socket layer (including System V variants).  However, note "
4503 "that the System V variant typically sets the timeout variable before exit, "
4504 "but the BSD variant does not."
4505 msgstr ""
4506 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4507 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4508 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4509 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4510 "ること。"
4511
4512 #. type: Plain text
4513 #: build/C/man2/select.2:346
4514 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4515 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4516
4517 #. type: Plain text
4518 #: build/C/man2/select.2:363
4519 msgid ""
4520 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4521 "with a value of I<fd> that is negative or is equal to or larger than "
4522 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4523 "I<fd> to be a valid file descriptor."
4524 msgstr ""
4525 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4526 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4527 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4528 "プタでなければならないと規定されている。"
4529
4530 #. type: Plain text
4531 #: build/C/man2/select.2:372
4532 msgid ""
4533 "Concerning the types involved, the classical situation is that the two "
4534 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4535 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4536 "situation is"
4537 msgstr ""
4538 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4539 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4540 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4541
4542 #. type: Plain text
4543 #: build/C/man2/select.2:379
4544 #, no-wrap
4545 msgid ""
4546 "struct timeval {\n"
4547 "    time_t         tv_sec;     /* seconds */\n"
4548 "    suseconds_t    tv_usec;    /* microseconds */\n"
4549 "};\n"
4550 msgstr ""
4551 "struct timeval {\n"
4552 "\t time_t         tv_sec;     /* 秒 */\n"
4553 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4554 "};\n"
4555
4556 #. type: Plain text
4557 #: build/C/man2/select.2:390
4558 msgid ""
4559 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4560 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4561 msgstr ""
4562 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4563 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4564
4565 #. type: Plain text
4566 #: build/C/man2/select.2:402
4567 msgid ""
4568 "Concerning prototypes, the classical situation is that one should include "
4569 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4570 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4571 msgstr ""
4572 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4573 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4574 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4575 "インクルードすればよい。"
4576
4577 #. type: Plain text
4578 #: build/C/man2/select.2:414
4579 msgid ""
4580 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4581 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4582 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4583 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4584 "requirements are as shown in the SYNOPSIS."
4585 msgstr ""
4586 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4587 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4588 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4589 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4590 "使用するには、「書式」に記載された要件を満たす必要がある。"
4591
4592 #. type: SS
4593 #: build/C/man2/select.2:414
4594 #, no-wrap
4595 msgid "Multithreaded applications"
4596 msgstr ""
4597
4598 #. type: Plain text
4599 #: build/C/man2/select.2:430
4600 msgid ""
4601 "If a file descriptor being monitored by B<select>()  is closed in another "
4602 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
4603 "unblocks and returns, with an indication that the file descriptor is ready "
4604 "(a subsequent I/O operation will likely fail with an error, unless another "
4605 "the file descriptor reopened between the time B<select>()  returned and the "
4606 "I/O operations was performed).  On Linux (and some other systems), closing "
4607 "the file descriptor in another thread has no effect on B<select>().  In "
4608 "summary, any application that relies on a particular behavior in this "
4609 "scenario must be considered buggy."
4610 msgstr ""
4611
4612 #. type: SS
4613 #: build/C/man2/select.2:430
4614 #, no-wrap
4615 msgid "Linux notes"
4616 msgstr "Linux での注意"
4617
4618 #. type: Plain text
4619 #: build/C/man2/select.2:438
4620 msgid ""
4621 "The B<pselect>()  interface described in this page is implemented by glibc.  "
4622 "The underlying Linux system call is named B<pselect6>().  This system call "
4623 "has somewhat different behavior from the glibc wrapper function."
4624 msgstr ""
4625 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4626 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
4627 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
4628 "関数とは少し違った動作をする。"
4629
4630 #. type: Plain text
4631 #: build/C/man2/select.2:453
4632 msgid ""
4633 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
4634 "However, the glibc wrapper function hides this behavior by using a local "
4635 "variable for the timeout argument that is passed to the system call.  Thus, "
4636 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
4637 "this is the behavior required by POSIX.1-2001."
4638 msgstr ""
4639 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
4640 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
4641 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
4642 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
4643 "これが POSIX.1-2001 が要求している動作である。"
4644
4645 #. type: Plain text
4646 #: build/C/man2/select.2:459
4647 msgid ""
4648 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
4649 "*> pointer, but is instead a structure of the form:"
4650 msgstr ""
4651 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
4652 "ポインタではなく、以下に示す構造体である。"
4653
4654 #. type: Plain text
4655 #: build/C/man2/select.2:467
4656 #, no-wrap
4657 msgid ""
4658 "struct {\n"
4659 "    const sigset_t *ss;     /* Pointer to signal set */\n"
4660 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
4661 "                               to by 'ss' */\n"
4662 "};\n"
4663 msgstr ""
4664 "struct {\n"
4665 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
4666 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
4667 "                               (バイト数) */\n"
4668 "};\n"
4669
4670 #. type: Plain text
4671 #: build/C/man2/select.2:474
4672 msgid ""
4673 "This allows the system call to obtain both a pointer to the signal set and "
4674 "its size, while allowing for the fact that most architectures support a "
4675 "maximum of 6 arguments to a system call."
4676 msgstr ""
4677 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
4678 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
4679 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
4680 "のサイズの両方を取得することができるのである。"
4681
4682 #. type: Plain text
4683 #: build/C/man2/select.2:480
4684 msgid ""
4685 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4686 "argument."
4687 msgstr ""
4688 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4689 "されていた。"
4690
4691 #. type: Plain text
4692 #: build/C/man2/select.2:493
4693 msgid ""
4694 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4695 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4696 "implementation remained vulnerable to the very race condition that B<pselect>"
4697 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4698 "B<pselect>()  system call on kernels where it is provided."
4699 msgstr ""
4700 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4701 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4702 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4703 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4704 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4705 "が使用される。"
4706
4707 #. type: Plain text
4708 #: build/C/man2/select.2:506
4709 msgid ""
4710 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4711 "trapping can be achieved using the self-pipe trick.  In this technique, a "
4712 "signal handler writes a byte to a pipe whose other end is monitored by "
4713 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
4714 "to a pipe that may be full or reading from a pipe that may be empty, "
4715 "nonblocking I/O is used when reading from and writing to the pipe.)"
4716 msgstr ""
4717 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
4718 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
4719 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
4720 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
4721 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
4722 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
4723 "(nonblocking) I/O を使用するとよい)。"
4724
4725 #.  Stevens discusses a case where accept can block after select
4726 #.  returns successfully because of an intervening RST from the client.
4727 #.  Maybe the kernel should have returned EIO in such a situation?
4728 #. type: Plain text
4729 #: build/C/man2/select.2:522
4730 msgid ""
4731 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4732 "reading\", while nevertheless a subsequent read blocks.  This could for "
4733 "example happen when data has arrived but upon examination has wrong checksum "
4734 "and is discarded.  There may be other circumstances in which a file "
4735 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4736 "B<O_NONBLOCK> on sockets that should not block."
4737 msgstr ""
4738 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4739 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4740 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4741 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4742 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4743 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4744
4745 #. type: Plain text
4746 #: build/C/man2/select.2:537
4747 msgid ""
4748 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4749 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4750 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4751 "behavior, but the glibc wrapper hides this behavior by internally copying "
4752 "the I<timeout> to a local variable and passing that variable to the system "
4753 "call."
4754 msgstr ""
4755 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4756 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4757 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4758 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4759 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4760 "数をシステムコールに渡している。"
4761
4762 #. type: Plain text
4763 #: build/C/man2/select.2:544
4764 #, no-wrap
4765 msgid ""
4766 "#include E<lt>stdio.hE<gt>\n"
4767 "#include E<lt>stdlib.hE<gt>\n"
4768 "#include E<lt>sys/time.hE<gt>\n"
4769 "#include E<lt>sys/types.hE<gt>\n"
4770 "#include E<lt>unistd.hE<gt>\n"
4771 msgstr ""
4772 "#include E<lt>stdio.hE<gt>\n"
4773 "#include E<lt>stdlib.hE<gt>\n"
4774 "#include E<lt>sys/time.hE<gt>\n"
4775 "#include E<lt>sys/types.hE<gt>\n"
4776 "#include E<lt>unistd.hE<gt>\n"
4777
4778 #. type: Plain text
4779 #: build/C/man2/select.2:551
4780 #, no-wrap
4781 msgid ""
4782 "int\n"
4783 "main(void)\n"
4784 "{\n"
4785 "    fd_set rfds;\n"
4786 "    struct timeval tv;\n"
4787 "    int retval;\n"
4788 msgstr ""
4789 "int\n"
4790 "main(void)\n"
4791 "{\n"
4792 "    fd_set rfds;\n"
4793 "    struct timeval tv;\n"
4794 "    int retval;\n"
4795
4796 #. type: Plain text
4797 #: build/C/man2/select.2:555
4798 #, no-wrap
4799 msgid ""
4800 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4801 "    FD_ZERO(&rfds);\n"
4802 "    FD_SET(0, &rfds);\n"
4803 msgstr ""
4804 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4805 "    FD_ZERO(&rfds);\n"
4806 "    FD_SET(0, &rfds);\n"
4807
4808 #. type: Plain text
4809 #: build/C/man2/select.2:559
4810 #, no-wrap
4811 msgid ""
4812 "    /* Wait up to five seconds. */\n"
4813 "    tv.tv_sec = 5;\n"
4814 "    tv.tv_usec = 0;\n"
4815 msgstr ""
4816 "    /* 5 秒間監視する。*/\n"
4817 "    tv.tv_sec = 5;\n"
4818 "    tv.tv_usec = 0;\n"
4819
4820 #. type: Plain text
4821 #: build/C/man2/select.2:562
4822 #, no-wrap
4823 msgid ""
4824 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4825 "    /* Don't rely on the value of tv now! */\n"
4826 msgstr ""
4827 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4828 "    /* この時点での tv の値を信頼してはならない。*/\n"
4829
4830 #. type: Plain text
4831 #: build/C/man2/select.2:570
4832 #, no-wrap
4833 msgid ""
4834 "    if (retval == -1)\n"
4835 "        perror(\"select()\");\n"
4836 "    else if (retval)\n"
4837 "        printf(\"Data is available now.\\en\");\n"
4838 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4839 "    else\n"
4840 "        printf(\"No data within five seconds.\\en\");\n"
4841 msgstr ""
4842 "    if (retval == -1)\n"
4843 "\tperror(\"select()\");\n"
4844 "    else if (retval)\n"
4845 "        printf(\"今、データが取得できました。\\en\");\n"
4846 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4847 "    else\n"
4848 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4849
4850 #. type: Plain text
4851 #: build/C/man2/select.2:585
4852 msgid ""
4853 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
4854 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
4855 msgstr "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
4856
4857 #. type: Plain text
4858 #: build/C/man2/select.2:588
4859 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4860 msgstr ""
4861 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
4862
4863 #. type: TH
4864 #: build/C/man2/select_tut.2:32
4865 #, no-wrap
4866 msgid "SELECT_TUT"
4867 msgstr "SELECT_TUT"
4868
4869 #. type: TH
4870 #: build/C/man2/select_tut.2:32
4871 #, no-wrap
4872 msgid "2012-08-03"
4873 msgstr "2012-08-03"
4874
4875 #. type: Plain text
4876 #: build/C/man2/select_tut.2:52
4877 #, no-wrap
4878 msgid ""
4879 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4880 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4881 msgstr ""
4882 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4883 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4884
4885 #. type: Plain text
4886 #: build/C/man2/select_tut.2:66
4887 #, no-wrap
4888 msgid ""
4889 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4890 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4891 "B<            const sigset_t *>I<sigmask>B<);>\n"
4892 msgstr ""
4893 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4894 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4895 "B<            const sigset_t *>I<sigmask>B<);>\n"
4896
4897 #. type: Plain text
4898 #: build/C/man2/select_tut.2:83
4899 msgid ""
4900 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
4901 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
4902 "see whether I/O becomes possible, or an \"exceptional condition\" has "
4903 "occurred on any of the descriptors."
4904 msgstr ""
4905 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
4906 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
4907 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
4908 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
4909 "る。"
4910
4911 #. type: Plain text
4912 #: build/C/man2/select_tut.2:108
4913 msgid ""
4914 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
4915 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
4916 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
4917 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
4918 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
4919 "according to the rules described below; after calling B<select>()  you can "
4920 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
4921 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
4922 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
4923 "descriptor from a set."
4924 msgstr ""
4925 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
4926 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
4927 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
4928 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
4929 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
4930 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
4931 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
4932 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
4933 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
4934 "のファイルディスクリプタの削除を行う。"
4935
4936 #. type: SS
4937 #: build/C/man2/select_tut.2:108
4938 #, no-wrap
4939 msgid "Arguments"
4940 msgstr "引き数"
4941
4942 #. type: TP
4943 #: build/C/man2/select_tut.2:109
4944 #, no-wrap
4945 msgid "I<readfds>"
4946 msgstr "I<readfds>"
4947
4948 #. type: Plain text
4949 #: build/C/man2/select_tut.2:118
4950 msgid ""
4951 "This set is watched to see if data is available for reading from any of its "
4952 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
4953 "cleared of all file descriptors except for those that are immediately "
4954 "available for reading."
4955 msgstr ""
4956 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
4957 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
4958 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
4959
4960 #. type: TP
4961 #: build/C/man2/select_tut.2:118
4962 #, no-wrap
4963 msgid "I<writefds>"
4964 msgstr "I<writefds>"
4965
4966 #. type: Plain text
4967 #: build/C/man2/select_tut.2:127
4968 msgid ""
4969 "This set is watched to see if there is space to write data to any of its "
4970 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
4971 "cleared of all file descriptors except for those that are immediately "
4972 "available for writing."
4973 msgstr ""
4974 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
4975 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
4976 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
4977
4978 #. type: TP
4979 #: build/C/man2/select_tut.2:127
4980 #, no-wrap
4981 msgid "I<exceptfds>"
4982 msgstr "I<exceptfds>"
4983
4984 #. type: Plain text
4985 #: build/C/man2/select_tut.2:149
4986 msgid ""
4987 "This set is watched for \"exceptional conditions\".  In practice, only one "
4988 "such exceptional condition is common: the availability of I<out-of-band> "
4989 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
4990 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
4991 "where B<select>(2)  indicates an exceptional condition occurs with "
4992 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
4993 "has returned, I<exceptfds> will be cleared of all file descriptors except "
4994 "for those for which an exceptional condition has occurred."
4995 msgstr ""
4996 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
4997 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
4998 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
4999 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5000 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5001 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5002 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5003 "状態が発生したディスクリプタ以外は集合から削除される。"
5004
5005 #. type: TP
5006 #: build/C/man2/select_tut.2:149
5007 #, no-wrap
5008 msgid "I<nfds>"
5009 msgstr "I<nfds>"
5010
5011 #. type: Plain text
5012 #: build/C/man2/select_tut.2:156
5013 msgid ""
5014 "This is an integer one more than the maximum of any file descriptor in any "
5015 "of the sets.  In other words, while adding file descriptors to each of the "
5016 "sets, you must calculate the maximum integer value of all of them, then "
5017 "increment this value by one, and then pass this as I<nfds>."
5018 msgstr ""
5019 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5020 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5021 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5022 "I<nfds> として渡さないといけない、ということだ。"
5023
5024 #. type: TP
5025 #: build/C/man2/select_tut.2:156
5026 #, no-wrap
5027 msgid "I<utimeout>"
5028 msgstr "I<utimeout>"
5029
5030 #. type: Plain text
5031 #: build/C/man2/select_tut.2:169
5032 msgid ""
5033 "This is the longest time B<select>()  may wait before returning, even if "
5034 "nothing interesting happened.  If this value is passed as NULL, then "
5035 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5036 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5037 "return immediately, with information about the readiness of file descriptors "
5038 "at the time of the call.  The structure I<struct timeval> is defined as:"
5039 msgstr ""
5040 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5041 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5042 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5043 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5044 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5045 "ように定義されている:"
5046
5047 #. type: Plain text
5048 #: build/C/man2/select_tut.2:176
5049 #, no-wrap
5050 msgid ""
5051 "struct timeval {\n"
5052 "    time_t tv_sec;    /* seconds */\n"
5053 "    long tv_usec;     /* microseconds */\n"
5054 "};\n"
5055 msgstr ""
5056 "struct timeval {\n"
5057 "    time_t tv_sec;    /* seconds */\n"
5058 "    long tv_usec;     /* microseconds */\n"
5059 "};\n"
5060
5061 #. type: TP
5062 #: build/C/man2/select_tut.2:178
5063 #, no-wrap
5064 msgid "I<ntimeout>"
5065 msgstr "I<ntimeout>"
5066
5067 #. type: Plain text
5068 #: build/C/man2/select_tut.2:187
5069 msgid ""
5070 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5071 "I<struct timespec> has nanosecond precision as follows:"
5072 msgstr ""
5073 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5074 "timespec> は次に示すようにナノ秒の精度を持つ。"
5075
5076 #. type: Plain text
5077 #: build/C/man2/select_tut.2:194
5078 #, no-wrap
5079 msgid ""
5080 "struct timespec {\n"
5081 "    long tv_sec;    /* seconds */\n"
5082 "    long tv_nsec;   /* nanoseconds */\n"
5083 "};\n"
5084 msgstr ""
5085 "struct timespec {\n"
5086 "    long tv_sec;    /* seconds */\n"
5087 "    long tv_nsec;   /* nanoseconds */\n"
5088 "};\n"
5089
5090 #. type: TP
5091 #: build/C/man2/select_tut.2:196
5092 #, no-wrap
5093 msgid "I<sigmask>"
5094 msgstr "I<sigmask>"
5095
5096 #. type: Plain text
5097 #: build/C/man2/select_tut.2:213
5098 msgid ""
5099 "This argument holds a set of signals that the kernel should unblock (i.e., "
5100 "remove from the signal mask of the calling thread), while the caller is "
5101 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5102 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5103 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5104 "()  will then behave just like B<select>()."
5105 msgstr ""
5106 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5107 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5108 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5109 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5110 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5111 "()  と全く同じ動作となる。"
5112
5113 #. type: SS
5114 #: build/C/man2/select_tut.2:213
5115 #, no-wrap
5116 msgid "Combining signal and data events"
5117 msgstr "シグナルとデータイベントを組み合わせる"
5118
5119 #. type: Plain text
5120 #: build/C/man2/select_tut.2:257
5121 msgid ""
5122 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5123 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5124 "normally use the signal handler only to raise a global flag.  The global "
5125 "flag will indicate that the event must be processed in the main loop of the "
5126 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5127 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5128 "signals can be processed in the main loop of the program, otherwise B<select>"
5129 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5130 "conditional to check the global flag.  So we must ask: what if a signal "
5131 "arrives after the conditional, but before the B<select>()  call? The answer "
5132 "is that B<select>()  would block indefinitely, even though an event is "
5133 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5134 "This call can be used to set the signal mask to a set of signals that are "
5135 "only to be received within the B<pselect>()  call.  For instance, let us say "
5136 "that the event in question was the exit of a child process.  Before the "
5137 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5138 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5139 "mask.  Our program would look like:"
5140 msgstr ""
5141 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5142 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5143 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5144 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5145 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5146 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5147 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5148 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5149 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5150 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5151 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5152 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5153 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5154 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5155 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5156 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5157 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5158 "る。"
5159
5160 #. type: Plain text
5161 #: build/C/man2/select_tut.2:260
5162 #, no-wrap
5163 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5164 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5165
5166 #. type: Plain text
5167 #: build/C/man2/select_tut.2:266
5168 #, no-wrap
5169 msgid ""
5170 "static void\n"
5171 "child_sig_handler(int sig)\n"
5172 "{\n"
5173 "    got_SIGCHLD = 1;\n"
5174 "}\n"
5175 msgstr ""
5176 "static void\n"
5177 "child_sig_handler(int sig)\n"
5178 "{\n"
5179 "    got_SIGCHLD = 1;\n"
5180 "}\n"
5181
5182 #. type: Plain text
5183 #: build/C/man2/select_tut.2:274
5184 #, no-wrap
5185 msgid ""
5186 "int\n"
5187 "main(int argc, char *argv[])\n"
5188 "{\n"
5189 "    sigset_t sigmask, empty_mask;\n"
5190 "    struct sigaction sa;\n"
5191 "    fd_set readfds, writefds, exceptfds;\n"
5192 "    int r;\n"
5193 msgstr ""
5194 "int\n"
5195 "main(int argc, char *argv[])\n"
5196 "{\n"
5197 "    sigset_t sigmask, empty_mask;\n"
5198 "    struct sigaction sa;\n"
5199 "    fd_set readfds, writefds, exceptfds;\n"
5200 "    int r;\n"
5201
5202 #. type: Plain text
5203 #: build/C/man2/select_tut.2:281
5204 #, no-wrap
5205 msgid ""
5206 "    sigemptyset(&sigmask);\n"
5207 "    sigaddset(&sigmask, SIGCHLD);\n"
5208 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5209 "        perror(\"sigprocmask\");\n"
5210 "        exit(EXIT_FAILURE);\n"
5211 "    }\n"
5212 msgstr ""
5213 "    sigemptyset(&sigmask);\n"
5214 "    sigaddset(&sigmask, SIGCHLD);\n"
5215 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5216 "        perror(\"sigprocmask\");\n"
5217 "        exit(EXIT_FAILURE);\n"
5218 "    }\n"
5219
5220 #. type: Plain text
5221 #: build/C/man2/select_tut.2:289
5222 #, no-wrap
5223 msgid ""
5224 "    sa.sa_flags = 0;\n"
5225 "    sa.sa_handler = child_sig_handler;\n"
5226 "    sigemptyset(&sa.sa_mask);\n"
5227 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5228 "        perror(\"sigaction\");\n"
5229 "        exit(EXIT_FAILURE);\n"
5230 "    }\n"
5231 msgstr ""
5232 "    sa.sa_flags = 0;\n"
5233 "    sa.sa_handler = child_sig_handler;\n"
5234 "    sigemptyset(&sa.sa_mask);\n"
5235 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5236 "        perror(\"sigaction\");\n"
5237 "        exit(EXIT_FAILURE);\n"
5238 "    }\n"
5239
5240 #. type: Plain text
5241 #: build/C/man2/select_tut.2:291
5242 #, no-wrap
5243 msgid "    sigemptyset(&empty_mask);\n"
5244 msgstr "    sigemptyset(&empty_mask);\n"
5245
5246 #. type: Plain text
5247 #: build/C/man2/select_tut.2:295
5248 #, no-wrap
5249 msgid ""
5250 "    for (;;) {          /* main loop */\n"
5251 "        /* Initialize readfds, writefds, and exceptfds\n"
5252 "           before the pselect() call. (Code omitted.) */\n"
5253 msgstr ""
5254 "    for (;;) {          /* main loop */\n"
5255 "        /* Initialize readfds, writefds, and exceptfds\n"
5256 "           before the pselect() call. (Code omitted.) */\n"
5257
5258 #. type: Plain text
5259 #: build/C/man2/select_tut.2:301
5260 #, no-wrap
5261 msgid ""
5262 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5263 "                    NULL, &empty_mask);\n"
5264 "        if (r == -1 && errno != EINTR) {\n"
5265 "            /* Handle error */\n"
5266 "        }\n"
5267 msgstr ""
5268 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5269 "                    NULL, &empty_mask);\n"
5270 "        if (r == -1 && errno != EINTR) {\n"
5271 "            /* Handle error */\n"
5272 "        }\n"
5273
5274 #. type: Plain text
5275 #: build/C/man2/select_tut.2:304
5276 #, no-wrap
5277 msgid ""
5278 "        if (got_SIGCHLD) {\n"
5279 "            got_SIGCHLD = 0;\n"
5280 msgstr ""
5281 "        if (got_SIGCHLD) {\n"
5282 "            got_SIGCHLD = 0;\n"
5283
5284 #. type: Plain text
5285 #: build/C/man2/select_tut.2:308
5286 #, no-wrap
5287 msgid ""
5288 "            /* Handle signalled event here; e.g., wait() for all\n"
5289 "               terminated children. (Code omitted.) */\n"
5290 "        }\n"
5291 msgstr ""
5292 "            /* Handle signalled event here; e.g., wait() for all\n"
5293 "               terminated children. (Code omitted.) */\n"
5294 "        }\n"
5295
5296 #. type: Plain text
5297 #: build/C/man2/select_tut.2:312
5298 #, no-wrap
5299 msgid ""
5300 "        /* main body of program */\n"
5301 "    }\n"
5302 "}\n"
5303 msgstr ""
5304 "        /* main body of program */\n"
5305 "    }\n"
5306 "}\n"
5307
5308 #. type: SS
5309 #: build/C/man2/select_tut.2:313
5310 #, no-wrap
5311 msgid "Practical"
5312 msgstr "実例"
5313
5314 #. type: Plain text
5315 #: build/C/man2/select_tut.2:334
5316 msgid ""
5317 "So what is the point of B<select>()? Can't I just read and write to my "
5318 "descriptors whenever I want? The point of B<select>()  is that it watches "
5319 "multiple descriptors at the same time and properly puts the process to sleep "
5320 "if there is no activity.  UNIX programmers often find themselves in a "
5321 "position where they have to handle I/O from more than one file descriptor "
5322 "where the data flow may be intermittent.  If you were to merely create a "
5323 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5324 "your calls may block waiting for data from/to a file descriptor, while "
5325 "another file descriptor is unused though ready for I/O.  B<select>()  "
5326 "efficiently copes with this situation."
5327 msgstr ""
5328 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5329 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5330 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5331 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5332 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5333 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5334 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5335 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5336 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5337
5338 #. type: SS
5339 #: build/C/man2/select_tut.2:334
5340 #, no-wrap
5341 msgid "Select law"
5342 msgstr "SELECT の掟"
5343
5344 #. type: Plain text
5345 #: build/C/man2/select_tut.2:347
5346 msgid ""
5347 "Many people who try to use B<select>()  come across behavior that is "
5348 "difficult to understand and produces nonportable or borderline results.  For "
5349 "instance, the above program is carefully written not to block at any point, "
5350 "even though it does not set its file descriptors to nonblocking mode.  It is "
5351 "easy to introduce subtle errors that will remove the advantage of using "
5352 "B<select>(), so here is a list of essentials to watch for when using "
5353 "B<select>()."
5354 msgstr ""
5355 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5356 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5357 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5358 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5359 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5360 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5361 "ことにする。"
5362
5363 #. type: Plain text
5364 #: build/C/man2/select_tut.2:356
5365 msgid ""
5366 "You should always try to use B<select>()  without a timeout.  Your program "
5367 "should have nothing to do if there is no data available.  Code that depends "
5368 "on timeouts is not usually portable and is difficult to debug."
5369 msgstr ""
5370 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5371 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5372 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5373
5374 #. type: Plain text
5375 #: build/C/man2/select_tut.2:360
5376 msgid ""
5377 "The value I<nfds> must be properly calculated for efficiency as explained "
5378 "above."
5379 msgstr ""
5380 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5381 "えなければならない。"
5382
5383 #. type: Plain text
5384 #: build/C/man2/select_tut.2:367
5385 msgid ""
5386 "No file descriptor must be added to any set if you do not intend to check "
5387 "its result after the B<select>()  call, and respond appropriately.  See next "
5388 "rule."
5389 msgstr ""
5390 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5391 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5392
5393 #. type: Plain text
5394 #: build/C/man2/select_tut.2:373
5395 msgid ""
5396 "After B<select>()  returns, all file descriptors in all sets should be "
5397 "checked to see if they are ready."
5398 msgstr ""
5399 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5400 "て 読み書き可能な状態になっているかをチェックすべきである。"
5401
5402 #. type: TP
5403 #: build/C/man2/select_tut.2:373
5404 #, no-wrap
5405 msgid "5."
5406 msgstr "5."
5407
5408 #. type: Plain text
5409 #: build/C/man2/select_tut.2:388
5410 msgid ""
5411 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5412 "necessarily read/write the full amount of data that you have requested.  If "
5413 "they do read/write the full amount, it's because you have a low traffic load "
5414 "and a fast stream.  This is not always going to be the case.  You should "
5415 "cope with the case of your functions only managing to send or receive a "
5416 "single byte."
5417 msgstr ""
5418 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5419 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5420 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5421 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5422 "うな場合も 考慮に入れてやらなければならない。"
5423
5424 #. type: TP
5425 #: build/C/man2/select_tut.2:388
5426 #, no-wrap
5427 msgid "6."
5428 msgstr "6."
5429
5430 #. type: Plain text
5431 #: build/C/man2/select_tut.2:396
5432 msgid ""
5433 "Never read/write only in single bytes at a time unless you are really sure "
5434 "that you have a small amount of data to process.  It is extremely "
5435 "inefficient not to read/write as much data as you can buffer each time.  The "
5436 "buffers in the example below are 1024 bytes although they could easily be "
5437 "made larger."
5438 msgstr ""
5439 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5440 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5441 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5442 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5443
5444 #. type: TP
5445 #: build/C/man2/select_tut.2:396
5446 #, no-wrap
5447 msgid "7."
5448 msgstr "7."
5449
5450 #.  Nonetheless, you should still cope with these errors for completeness.
5451 #. type: Plain text
5452 #: build/C/man2/select_tut.2:418
5453 msgid ""
5454 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5455 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5456 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5457 "properly managed (not done properly above).  If your program is not going to "
5458 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5459 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5460 msgstr ""
5461 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5462 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5463 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5464 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5465 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5466 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5467
5468 #. type: TP
5469 #: build/C/man2/select_tut.2:418
5470 #, no-wrap
5471 msgid "8."
5472 msgstr "8."
5473
5474 #. type: Plain text
5475 #: build/C/man2/select_tut.2:427
5476 msgid ""
5477 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5478 "length of zero."
5479 msgstr ""
5480 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5481 "(2), B<send>(2)  を呼び出してはならない。"
5482
5483 #. type: TP
5484 #: build/C/man2/select_tut.2:427
5485 #, no-wrap
5486 msgid "9."
5487 msgstr "9."
5488
5489 #. type: Plain text
5490 #: build/C/man2/select_tut.2:443
5491 msgid ""
5492 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5493 "with errors other than those listed in B<7.>, or one of the input functions "
5494 "returns 0, indicating end of file, then you should I<not> pass that "
5495 "descriptor to B<select>()  again.  In the example below, I close the "
5496 "descriptor immediately, and then set it to -1 to prevent it being included "
5497 "in a set."
5498 msgstr ""
5499 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5500 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5501 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5502 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5503 "が集合に含まれ続けるのを許さないようにしている。"
5504
5505 #. type: TP
5506 #: build/C/man2/select_tut.2:443
5507 #, no-wrap
5508 msgid "10."
5509 msgstr "10."
5510
5511 #. type: Plain text
5512 #: build/C/man2/select_tut.2:450
5513 msgid ""
5514 "The timeout value must be initialized with each new call to B<select>(), "
5515 "since some operating systems modify the structure.  B<pselect>()  however "
5516 "does not modify its timeout structure."
5517 msgstr ""
5518 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5519 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5520 "分の timeout 構造体を変更することはない。"
5521
5522 #. type: TP
5523 #: build/C/man2/select_tut.2:450
5524 #, no-wrap
5525 msgid "11."
5526 msgstr "11."
5527
5528 #.  "I have heard" does not fill me with confidence, and doesn't
5529 #.  belong in a man page, so I've commented this point out.
5530 #.  .TP
5531 #.  11.
5532 #.  I have heard that the Windows socket layer does not cope with OOB data
5533 #.  properly.
5534 #.  It also does not cope with
5535 #.  .BR select ()
5536 #.  calls when no file descriptors are set at all.
5537 #.  Having no file descriptors set is a useful
5538 #.  way to sleep the process with subsecond precision by using the timeout.
5539 #.  (See further on.)
5540 #. type: Plain text
5541 #: build/C/man2/select_tut.2:469
5542 msgid ""
5543 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5544 "used in a loop, then the sets must be reinitialized before each call."
5545 msgstr ""
5546 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5547 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5548 "期化し直さなければならない。"
5549
5550 #. type: SS
5551 #: build/C/man2/select_tut.2:469
5552 #, no-wrap
5553 msgid "Usleep emulation"
5554 msgstr "usleep エミュレーション"
5555
5556 #. type: Plain text
5557 #: build/C/man2/select_tut.2:476
5558 msgid ""
5559 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5560 "()  with a finite timeout and no file descriptors as follows:"
5561 msgstr ""
5562 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5563 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5564 "できる。 以下のようにする。"
5565
5566 #. type: Plain text
5567 #: build/C/man2/select_tut.2:482
5568 #, no-wrap
5569 msgid ""
5570 "    struct timeval tv;\n"
5571 "    tv.tv_sec = 0;\n"
5572 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5573 "    select(0, NULL, NULL, NULL, &tv);\n"
5574 msgstr ""
5575 "    struct timeval tv;\n"
5576 "    tv.tv_sec = 0;\n"
5577 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5578 "    select(0, NULL, NULL, NULL, &tv);\n"
5579
5580 #. type: Plain text
5581 #: build/C/man2/select_tut.2:485
5582 msgid "This is only guaranteed to work on UNIX systems, however."
5583 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5584
5585 #. type: Plain text
5586 #: build/C/man2/select_tut.2:490
5587 msgid ""
5588 "On success, B<select>()  returns the total number of file descriptors still "
5589 "present in the file descriptor sets."
5590 msgstr ""
5591 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5592 "ディスクリプタの総数を返す。"
5593
5594 #. type: Plain text
5595 #: build/C/man2/select_tut.2:496
5596 msgid ""
5597 "If B<select>()  timed out, then the return value will be zero.  The file "
5598 "descriptors set should be all empty (but may not be on some systems)."
5599 msgstr ""
5600 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5601 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5602
5603 #. type: Plain text
5604 #: build/C/man2/select_tut.2:503
5605 msgid ""
5606 "A return value of -1 indicates an error, with I<errno> being set "
5607 "appropriately.  In the case of an error, the contents of the returned sets "
5608 "and the I<struct timeout> contents are undefined and should not be used.  "
5609 "B<pselect>()  however never modifies I<ntimeout>."
5610 msgstr ""
5611 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5612 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5613 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5614 "変更しない。"
5615
5616 #. type: Plain text
5617 #: build/C/man2/select_tut.2:512
5618 msgid ""
5619 "Generally speaking, all operating systems that support sockets also support "
5620 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5621 "and efficient way that naive programmers try to solve in a more complicated "
5622 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5623 msgstr ""
5624 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5625 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5626 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5627 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5628
5629 #. type: Plain text
5630 #: build/C/man2/select_tut.2:521
5631 msgid ""
5632 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5633 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5634 "is nowadays widely available, but historically was less portable than "
5635 "B<select>()."
5636 msgstr ""
5637 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5638 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5639 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5640
5641 #. type: Plain text
5642 #: build/C/man2/select_tut.2:529
5643 msgid ""
5644 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5645 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5646 "of file descriptors."
5647 msgstr ""
5648 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5649 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5650
5651 #. type: Plain text
5652 #: build/C/man2/select_tut.2:534
5653 msgid ""
5654 "Here is an example that better demonstrates the true utility of B<select>"
5655 "().  The listing below is a TCP forwarding program that forwards from one "
5656 "TCP port to another."
5657 msgstr ""
5658 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5659 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5660
5661 #. type: Plain text
5662 #: build/C/man2/select_tut.2:547
5663 #, no-wrap
5664 msgid ""
5665 "#include E<lt>stdlib.hE<gt>\n"
5666 "#include E<lt>stdio.hE<gt>\n"
5667 "#include E<lt>unistd.hE<gt>\n"
5668 "#include E<lt>sys/time.hE<gt>\n"
5669 "#include E<lt>sys/types.hE<gt>\n"
5670 "#include E<lt>string.hE<gt>\n"
5671 "#include E<lt>signal.hE<gt>\n"
5672 "#include E<lt>sys/socket.hE<gt>\n"
5673 "#include E<lt>netinet/in.hE<gt>\n"
5674 "#include E<lt>arpa/inet.hE<gt>\n"
5675 "#include E<lt>errno.hE<gt>\n"
5676 msgstr ""
5677 "#include E<lt>stdlib.hE<gt>\n"
5678 "#include E<lt>stdio.hE<gt>\n"
5679 "#include E<lt>unistd.hE<gt>\n"
5680 "#include E<lt>sys/time.hE<gt>\n"
5681 "#include E<lt>sys/types.hE<gt>\n"
5682 "#include E<lt>string.hE<gt>\n"
5683 "#include E<lt>signal.hE<gt>\n"
5684 "#include E<lt>sys/socket.hE<gt>\n"
5685 "#include E<lt>netinet/in.hE<gt>\n"
5686 "#include E<lt>arpa/inet.hE<gt>\n"
5687 "#include E<lt>errno.hE<gt>\n"
5688
5689 #. type: Plain text
5690 #: build/C/man2/select_tut.2:549
5691 #, no-wrap
5692 msgid "static int forward_port;\n"
5693 msgstr "static int forward_port;\n"
5694
5695 #. type: Plain text
5696 #: build/C/man2/select_tut.2:552
5697 #, no-wrap
5698 msgid ""
5699 "#undef max\n"
5700 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5701 msgstr ""
5702 "#undef max\n"
5703 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5704
5705 #. type: Plain text
5706 #: build/C/man2/select_tut.2:559
5707 #, no-wrap
5708 msgid ""
5709 "static int\n"
5710 "listen_socket(int listen_port)\n"
5711 "{\n"
5712 "    struct sockaddr_in a;\n"
5713 "    int s;\n"
5714 "    int yes;\n"
5715 msgstr ""
5716 "static int\n"
5717 "listen_socket(int listen_port)\n"
5718 "{\n"
5719 "    struct sockaddr_in a;\n"
5720 "    int s;\n"
5721 "    int yes;\n"
5722
5723 #. type: Plain text
5724 #: build/C/man2/select_tut.2:583
5725 #, no-wrap
5726 msgid ""
5727 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5728 "        perror(\"socket\");\n"
5729 "        return -1;\n"
5730 "    }\n"
5731 "    yes = 1;\n"
5732 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5733 "            &yes, sizeof(yes)) == -1) {\n"
5734 "        perror(\"setsockopt\");\n"
5735 "        close(s);\n"
5736 "        return -1;\n"
5737 "    }\n"
5738 "    memset(&a, 0, sizeof(a));\n"
5739 "    a.sin_port = htons(listen_port);\n"
5740 "    a.sin_family = AF_INET;\n"
5741 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5742 "        perror(\"bind\");\n"
5743 "        close(s);\n"
5744 "        return -1;\n"
5745 "    }\n"
5746 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5747 "    listen(s, 10);\n"
5748 "    return s;\n"
5749 "}\n"
5750 msgstr ""
5751 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5752 "        perror(\"socket\");\n"
5753 "        return -1;\n"
5754 "    }\n"
5755 "    yes = 1;\n"
5756 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5757 "            &yes, sizeof(yes)) == -1) {\n"
5758 "        perror(\"setsockopt\");\n"
5759 "        close(s);\n"
5760 "        return -1;\n"
5761 "    }\n"
5762 "    memset(&a, 0, sizeof(a));\n"
5763 "    a.sin_port = htons(listen_port);\n"
5764 "    a.sin_family = AF_INET;\n"
5765 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5766 "        perror(\"bind\");\n"
5767 "        close(s);\n"
5768 "        return -1;\n"
5769 "    }\n"
5770 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5771 "    listen(s, 10);\n"
5772 "    return s;\n"
5773 "}\n"
5774
5775 #. type: Plain text
5776 #: build/C/man2/select_tut.2:589
5777 #, no-wrap
5778 msgid ""
5779 "static int\n"
5780 "connect_socket(int connect_port, char *address)\n"
5781 "{\n"
5782 "    struct sockaddr_in a;\n"
5783 "    int s;\n"
5784 msgstr ""
5785 "static int\n"
5786 "connect_socket(int connect_port, char *address)\n"
5787 "{\n"
5788 "    struct sockaddr_in a;\n"
5789 "    int s;\n"
5790
5791 #. type: Plain text
5792 #: build/C/man2/select_tut.2:595
5793 #, no-wrap
5794 msgid ""
5795 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5796 "        perror(\"socket\");\n"
5797 "        close(s);\n"
5798 "        return -1;\n"
5799 "    }\n"
5800 msgstr ""
5801 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5802 "        perror(\"socket\");\n"
5803 "        close(s);\n"
5804 "        return -1;\n"
5805 "    }\n"
5806
5807 #. type: Plain text
5808 #: build/C/man2/select_tut.2:599
5809 #, no-wrap
5810 msgid ""
5811 "    memset(&a, 0, sizeof(a));\n"
5812 "    a.sin_port = htons(connect_port);\n"
5813 "    a.sin_family = AF_INET;\n"
5814 msgstr ""
5815 "    memset(&a, 0, sizeof(a));\n"
5816 "    a.sin_port = htons(connect_port);\n"
5817 "    a.sin_family = AF_INET;\n"
5818
5819 #. type: Plain text
5820 #: build/C/man2/select_tut.2:605
5821 #, no-wrap
5822 msgid ""
5823 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5824 "        perror(\"bad IP address format\");\n"
5825 "        close(s);\n"
5826 "        return -1;\n"
5827 "    }\n"
5828 msgstr ""
5829 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5830 "        perror(\"bad IP address format\");\n"
5831 "        close(s);\n"
5832 "        return -1;\n"
5833 "    }\n"
5834
5835 #. type: Plain text
5836 #: build/C/man2/select_tut.2:614
5837 #, no-wrap
5838 msgid ""
5839 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5840 "        perror(\"connect()\");\n"
5841 "        shutdown(s, SHUT_RDWR);\n"
5842 "        close(s);\n"
5843 "        return -1;\n"
5844 "    }\n"
5845 "    return s;\n"
5846 "}\n"
5847 msgstr ""
5848 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5849 "        perror(\"connect()\");\n"
5850 "        shutdown(s, SHUT_RDWR);\n"
5851 "        close(s);\n"
5852 "        return -1;\n"
5853 "    }\n"
5854 "    return s;\n"
5855 "}\n"
5856
5857 #. type: Plain text
5858 #: build/C/man2/select_tut.2:622
5859 #, no-wrap
5860 msgid ""
5861 "#define SHUT_FD1 do {                                \\e\n"
5862 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5863 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5864 "                         close(fd1);                 \\e\n"
5865 "                         fd1 = -1;                   \\e\n"
5866 "                     }                               \\e\n"
5867 "                 } while (0)\n"
5868 msgstr ""
5869 "#define SHUT_FD1 do {                                \\e\n"
5870 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5871 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5872 "                         close(fd1);                 \\e\n"
5873 "                         fd1 = -1;                   \\e\n"
5874 "                     }                               \\e\n"
5875 "                 } while (0)\n"
5876
5877 #. type: Plain text
5878 #: build/C/man2/select_tut.2:630
5879 #, no-wrap
5880 msgid ""
5881 "#define SHUT_FD2 do {                                \\e\n"
5882 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5883 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5884 "                         close(fd2);                 \\e\n"
5885 "                         fd2 = -1;                   \\e\n"
5886 "                     }                               \\e\n"
5887 "                 } while (0)\n"
5888 msgstr ""
5889 "#define SHUT_FD2 do {                                \\e\n"
5890 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5891 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5892 "                         close(fd2);                 \\e\n"
5893 "                         fd2 = -1;                   \\e\n"
5894 "                     }                               \\e\n"
5895 "                 } while (0)\n"
5896
5897 #. type: Plain text
5898 #: build/C/man2/select_tut.2:632
5899 #, no-wrap
5900 msgid "#define BUF_SIZE 1024\n"
5901 msgstr "#define BUF_SIZE 1024\n"
5902
5903 #. type: Plain text
5904 #: build/C/man2/select_tut.2:641
5905 #, no-wrap
5906 msgid ""
5907 "int\n"
5908 "main(int argc, char *argv[])\n"
5909 "{\n"
5910 "    int h;\n"
5911 "    int fd1 = -1, fd2 = -1;\n"
5912 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5913 "    int buf1_avail, buf1_written;\n"
5914 "    int buf2_avail, buf2_written;\n"
5915 msgstr ""
5916 "int\n"
5917 "main(int argc, char *argv[])\n"
5918 "{\n"
5919 "    int h;\n"
5920 "    int fd1 = -1, fd2 = -1;\n"
5921 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5922 "    int buf1_avail, buf1_written;\n"
5923 "    int buf2_avail, buf2_written;\n"
5924
5925 #. type: Plain text
5926 #: build/C/man2/select_tut.2:647
5927 #, no-wrap
5928 msgid ""
5929 "    if (argc != 4) {\n"
5930 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5931 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5932 "        exit(EXIT_FAILURE);\n"
5933 "    }\n"
5934 msgstr ""
5935 "    if (argc != 4) {\n"
5936 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5937 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5938 "        exit(EXIT_FAILURE);\n"
5939 "    }\n"
5940
5941 #. type: Plain text
5942 #: build/C/man2/select_tut.2:649
5943 #, no-wrap
5944 msgid "    signal(SIGPIPE, SIG_IGN);\n"
5945 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
5946
5947 #. type: Plain text
5948 #: build/C/man2/select_tut.2:651
5949 #, no-wrap
5950 msgid "    forward_port = atoi(argv[2]);\n"
5951 msgstr "    forward_port = atoi(argv[2]);\n"
5952
5953 #. type: Plain text
5954 #: build/C/man2/select_tut.2:655
5955 #, no-wrap
5956 msgid ""
5957 "    h = listen_socket(atoi(argv[1]));\n"
5958 "    if (h == -1)\n"
5959 "        exit(EXIT_FAILURE);\n"
5960 msgstr ""
5961 "    h = listen_socket(atoi(argv[1]));\n"
5962 "    if (h == -1)\n"
5963 "        exit(EXIT_FAILURE);\n"
5964
5965 #. type: Plain text
5966 #: build/C/man2/select_tut.2:659
5967 #, no-wrap
5968 msgid ""
5969 "    for (;;) {\n"
5970 "        int r, nfds = 0;\n"
5971 "        fd_set rd, wr, er;\n"
5972 msgstr ""
5973 "    for (;;) {\n"
5974 "        int r, nfds = 0;\n"
5975 "        fd_set rd, wr, er;\n"
5976
5977 #. type: Plain text
5978 #: build/C/man2/select_tut.2:689
5979 #, no-wrap
5980 msgid ""
5981 "        FD_ZERO(&rd);\n"
5982 "        FD_ZERO(&wr);\n"
5983 "        FD_ZERO(&er);\n"
5984 "        FD_SET(h, &rd);\n"
5985 "        nfds = max(nfds, h);\n"
5986 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5987 "            FD_SET(fd1, &rd);\n"
5988 "            nfds = max(nfds, fd1);\n"
5989 "        }\n"
5990 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5991 "            FD_SET(fd2, &rd);\n"
5992 "            nfds = max(nfds, fd2);\n"
5993 "        }\n"
5994 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5995 "            FD_SET(fd1, &wr);\n"
5996 "            nfds = max(nfds, fd1);\n"
5997 "        }\n"
5998 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5999 "            FD_SET(fd2, &wr);\n"
6000 "            nfds = max(nfds, fd2);\n"
6001 "        }\n"
6002 "        if (fd1 E<gt> 0) {\n"
6003 "            FD_SET(fd1, &er);\n"
6004 "            nfds = max(nfds, fd1);\n"
6005 "        }\n"
6006 "        if (fd2 E<gt> 0) {\n"
6007 "            FD_SET(fd2, &er);\n"
6008 "            nfds = max(nfds, fd2);\n"
6009 "        }\n"
6010 msgstr ""
6011 "        FD_ZERO(&rd);\n"
6012 "        FD_ZERO(&wr);\n"
6013 "        FD_ZERO(&er);\n"
6014 "        FD_SET(h, &rd);\n"
6015 "        nfds = max(nfds, h);\n"
6016 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6017 "            FD_SET(fd1, &rd);\n"
6018 "            nfds = max(nfds, fd1);\n"
6019 "        }\n"
6020 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6021 "            FD_SET(fd2, &rd);\n"
6022 "            nfds = max(nfds, fd2);\n"
6023 "        }\n"
6024 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6025 "            FD_SET(fd1, &wr);\n"
6026 "            nfds = max(nfds, fd1);\n"
6027 "        }\n"
6028 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6029 "            FD_SET(fd2, &wr);\n"
6030 "            nfds = max(nfds, fd2);\n"
6031 "        }\n"
6032 "        if (fd1 E<gt> 0) {\n"
6033 "            FD_SET(fd1, &er);\n"
6034 "            nfds = max(nfds, fd1);\n"
6035 "        }\n"
6036 "        if (fd2 E<gt> 0) {\n"
6037 "            FD_SET(fd2, &er);\n"
6038 "            nfds = max(nfds, fd2);\n"
6039 "        }\n"
6040
6041 #. type: Plain text
6042 #: build/C/man2/select_tut.2:691
6043 #, no-wrap
6044 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6045 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6046
6047 #. type: Plain text
6048 #: build/C/man2/select_tut.2:694
6049 #, no-wrap
6050 msgid ""
6051 "        if (r == -1 && errno == EINTR)\n"
6052 "            continue;\n"
6053 msgstr ""
6054 "        if (r == -1 && errno == EINTR)\n"
6055 "            continue;\n"
6056
6057 #. type: Plain text
6058 #: build/C/man2/select_tut.2:699
6059 #, no-wrap
6060 msgid ""
6061 "        if (r == -1) {\n"
6062 "            perror(\"select()\");\n"
6063 "            exit(EXIT_FAILURE);\n"
6064 "        }\n"
6065 msgstr ""
6066 "        if (r == -1) {\n"
6067 "            perror(\"select()\");\n"
6068 "            exit(EXIT_FAILURE);\n"
6069 "        }\n"
6070
6071 #. type: Plain text
6072 #: build/C/man2/select_tut.2:703
6073 #, no-wrap
6074 msgid ""
6075 "        if (FD_ISSET(h, &rd)) {\n"
6076 "            unsigned int l;\n"
6077 "            struct sockaddr_in client_address;\n"
6078 msgstr ""
6079 "        if (FD_ISSET(h, &rd)) {\n"
6080 "            unsigned int l;\n"
6081 "            struct sockaddr_in client_address;\n"
6082
6083 #. type: Plain text
6084 #: build/C/man2/select_tut.2:722
6085 #, no-wrap
6086 msgid ""
6087 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6088 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6089 "            if (r == -1) {\n"
6090 "                perror(\"accept()\");\n"
6091 "            } else {\n"
6092 "                SHUT_FD1;\n"
6093 "                SHUT_FD2;\n"
6094 "                buf1_avail = buf1_written = 0;\n"
6095 "                buf2_avail = buf2_written = 0;\n"
6096 "                fd1 = r;\n"
6097 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6098 "                if (fd2 == -1)\n"
6099 "                    SHUT_FD1;\n"
6100 "                else\n"
6101 "                    printf(\"connect from %s\\en\",\n"
6102 "                            inet_ntoa(client_address.sin_addr));\n"
6103 "            }\n"
6104 "        }\n"
6105 msgstr ""
6106 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6107 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6108 "            if (r == -1) {\n"
6109 "                perror(\"accept()\");\n"
6110 "            } else {\n"
6111 "                SHUT_FD1;\n"
6112 "                SHUT_FD2;\n"
6113 "                buf1_avail = buf1_written = 0;\n"
6114 "                buf2_avail = buf2_written = 0;\n"
6115 "                fd1 = r;\n"
6116 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6117 "                if (fd2 == -1)\n"
6118 "                    SHUT_FD1;\n"
6119 "                else\n"
6120 "                    printf(\"connect from %s\\en\",\n"
6121 "                            inet_ntoa(client_address.sin_addr));\n"
6122 "            }\n"
6123 "        }\n"
6124
6125 #. type: Plain text
6126 #: build/C/man2/select_tut.2:724
6127 #, no-wrap
6128 msgid "        /* NB: read oob data before normal reads */\n"
6129 msgstr "        /* NB: read oob data before normal reads */\n"
6130
6131 #. type: Plain text
6132 #: build/C/man2/select_tut.2:728
6133 #, no-wrap
6134 msgid ""
6135 "        if (fd1 E<gt> 0)\n"
6136 "            if (FD_ISSET(fd1, &er)) {\n"
6137 "                char c;\n"
6138 msgstr ""
6139 "        if (fd1 E<gt> 0)\n"
6140 "            if (FD_ISSET(fd1, &er)) {\n"
6141 "                char c;\n"
6142
6143 #. type: Plain text
6144 #: build/C/man2/select_tut.2:738
6145 #, no-wrap
6146 msgid ""
6147 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6148 "                if (r E<lt> 1)\n"
6149 "                    SHUT_FD1;\n"
6150 "                else\n"
6151 "                    send(fd2, &c, 1, MSG_OOB);\n"
6152 "            }\n"
6153 "        if (fd2 E<gt> 0)\n"
6154 "            if (FD_ISSET(fd2, &er)) {\n"
6155 "                char c;\n"
6156 msgstr ""
6157 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6158 "                if (r E<lt> 1)\n"
6159 "                    SHUT_FD1;\n"
6160 "                else\n"
6161 "                    send(fd2, &c, 1, MSG_OOB);\n"
6162 "            }\n"
6163 "        if (fd2 E<gt> 0)\n"
6164 "            if (FD_ISSET(fd2, &er)) {\n"
6165 "                char c;\n"
6166
6167 #. type: Plain text
6168 #: build/C/man2/select_tut.2:781
6169 #, no-wrap
6170 msgid ""
6171 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6172 "                if (r E<lt> 1)\n"
6173 "                    SHUT_FD2;\n"
6174 "                else\n"
6175 "                    send(fd1, &c, 1, MSG_OOB);\n"
6176 "            }\n"
6177 "        if (fd1 E<gt> 0)\n"
6178 "            if (FD_ISSET(fd1, &rd)) {\n"
6179 "                r = read(fd1, buf1 + buf1_avail,\n"
6180 "                          BUF_SIZE - buf1_avail);\n"
6181 "                if (r E<lt> 1)\n"
6182 "                    SHUT_FD1;\n"
6183 "                else\n"
6184 "                    buf1_avail += r;\n"
6185 "            }\n"
6186 "        if (fd2 E<gt> 0)\n"
6187 "            if (FD_ISSET(fd2, &rd)) {\n"
6188 "                r = read(fd2, buf2 + buf2_avail,\n"
6189 "                          BUF_SIZE - buf2_avail);\n"
6190 "                if (r E<lt> 1)\n"
6191 "                    SHUT_FD2;\n"
6192 "                else\n"
6193 "                    buf2_avail += r;\n"
6194 "            }\n"
6195 "        if (fd1 E<gt> 0)\n"
6196 "            if (FD_ISSET(fd1, &wr)) {\n"
6197 "                r = write(fd1, buf2 + buf2_written,\n"
6198 "                           buf2_avail - buf2_written);\n"
6199 "                if (r E<lt> 1)\n"
6200 "                    SHUT_FD1;\n"
6201 "                else\n"
6202 "                    buf2_written += r;\n"
6203 "            }\n"
6204 "        if (fd2 E<gt> 0)\n"
6205 "            if (FD_ISSET(fd2, &wr)) {\n"
6206 "                r = write(fd2, buf1 + buf1_written,\n"
6207 "                           buf1_avail - buf1_written);\n"
6208 "                if (r E<lt> 1)\n"
6209 "                    SHUT_FD2;\n"
6210 "                else\n"
6211 "                    buf1_written += r;\n"
6212 "            }\n"
6213 msgstr ""
6214 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6215 "                if (r E<lt> 1)\n"
6216 "                    SHUT_FD2;\n"
6217 "                else\n"
6218 "                    send(fd1, &c, 1, MSG_OOB);\n"
6219 "            }\n"
6220 "        if (fd1 E<gt> 0)\n"
6221 "            if (FD_ISSET(fd1, &rd)) {\n"
6222 "                r = read(fd1, buf1 + buf1_avail,\n"
6223 "                          BUF_SIZE - buf1_avail);\n"
6224 "                if (r E<lt> 1)\n"
6225 "                    SHUT_FD1;\n"
6226 "                else\n"
6227 "                    buf1_avail += r;\n"
6228 "            }\n"
6229 "        if (fd2 E<gt> 0)\n"
6230 "            if (FD_ISSET(fd2, &rd)) {\n"
6231 "                r = read(fd2, buf2 + buf2_avail,\n"
6232 "                          BUF_SIZE - buf2_avail);\n"
6233 "                if (r E<lt> 1)\n"
6234 "                    SHUT_FD2;\n"
6235 "                else\n"
6236 "                    buf2_avail += r;\n"
6237 "            }\n"
6238 "        if (fd1 E<gt> 0)\n"
6239 "            if (FD_ISSET(fd1, &wr)) {\n"
6240 "                r = write(fd1, buf2 + buf2_written,\n"
6241 "                           buf2_avail - buf2_written);\n"
6242 "                if (r E<lt> 1)\n"
6243 "                    SHUT_FD1;\n"
6244 "                else\n"
6245 "                    buf2_written += r;\n"
6246 "            }\n"
6247 "        if (fd2 E<gt> 0)\n"
6248 "            if (FD_ISSET(fd2, &wr)) {\n"
6249 "                r = write(fd2, buf1 + buf1_written,\n"
6250 "                           buf1_avail - buf1_written);\n"
6251 "                if (r E<lt> 1)\n"
6252 "                    SHUT_FD2;\n"
6253 "                else\n"
6254 "                    buf1_written += r;\n"
6255 "            }\n"
6256
6257 #. type: Plain text
6258 #: build/C/man2/select_tut.2:783
6259 #, no-wrap
6260 msgid "        /* check if write data has caught read data */\n"
6261 msgstr "        /* check if write data has caught read data */\n"
6262
6263 #. type: Plain text
6264 #: build/C/man2/select_tut.2:788
6265 #, no-wrap
6266 msgid ""
6267 "        if (buf1_written == buf1_avail)\n"
6268 "            buf1_written = buf1_avail = 0;\n"
6269 "        if (buf2_written == buf2_avail)\n"
6270 "            buf2_written = buf2_avail = 0;\n"
6271 msgstr ""
6272 "        if (buf1_written == buf1_avail)\n"
6273 "            buf1_written = buf1_avail = 0;\n"
6274 "        if (buf2_written == buf2_avail)\n"
6275 "            buf2_written = buf2_avail = 0;\n"
6276
6277 #. type: Plain text
6278 #: build/C/man2/select_tut.2:791
6279 #, no-wrap
6280 msgid ""
6281 "        /* one side has closed the connection, keep\n"
6282 "           writing to the other side until empty */\n"
6283 msgstr ""
6284 "        /* one side has closed the connection, keep\n"
6285 "           writing to the other side until empty */\n"
6286
6287 #. type: Plain text
6288 #: build/C/man2/select_tut.2:799
6289 #, no-wrap
6290 msgid ""
6291 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6292 "            SHUT_FD2;\n"
6293 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6294 "            SHUT_FD1;\n"
6295 "    }\n"
6296 "    exit(EXIT_SUCCESS);\n"
6297 "}\n"
6298 msgstr ""
6299 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6300 "            SHUT_FD2;\n"
6301 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6302 "            SHUT_FD1;\n"
6303 "    }\n"
6304 "    exit(EXIT_SUCCESS);\n"
6305 "}\n"
6306
6307 #. type: Plain text
6308 #: build/C/man2/select_tut.2:813
6309 msgid ""
6310 "The above program properly forwards most kinds of TCP connections including "
6311 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6312 "problem of having data flow in both directions simultaneously.  You might "
6313 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6314 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6315 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6316 "because you end up using inefficient timeouts."
6317 msgstr ""
6318 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6319 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6320 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6321 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6322 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6323 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6324 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6325 "起こってしまう。"
6326
6327 #. type: Plain text
6328 #: build/C/man2/select_tut.2:819
6329 msgid ""
6330 "The program does not handle more than one simultaneous connection at a time, "
6331 "although it could easily be extended to do this with a linked list of buffers"
6332 "\\(emone for each connection.  At the moment, new connections cause the "
6333 "current connection to be dropped."
6334 msgstr ""
6335 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6336 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6337 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6338
6339 #.  .SH AUTHORS
6340 #.  This man page was written by Paul Sheer.
6341 #. type: Plain text
6342 #: build/C/man2/select_tut.2:838
6343 msgid ""
6344 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6345 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6346 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6347 "(3), B<epoll>(7)"
6348 msgstr ""
6349 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6350 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6351 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6352 "(3), B<epoll>(7)"
6353
6354 #. type: TH
6355 #: build/C/man2/send.2:40
6356 #, no-wrap
6357 msgid "SEND"
6358 msgstr "SEND"
6359
6360 #. type: TH
6361 #: build/C/man2/send.2:40
6362 #, no-wrap
6363 msgid "2012-04-23"
6364 msgstr "2012-04-23"
6365
6366 #. type: Plain text
6367 #: build/C/man2/send.2:43
6368 msgid "send, sendto, sendmsg - send a message on a socket"
6369 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6370
6371 #. type: Plain text
6372 #: build/C/man2/send.2:47
6373 #, no-wrap
6374 msgid ""
6375 "B<#include E<lt>sys/types.hE<gt>>\n"
6376 "B<#include E<lt>sys/socket.hE<gt>>\n"
6377 msgstr ""
6378 "B<#include E<lt>sys/types.hE<gt>>\n"
6379 "B<#include E<lt>sys/socket.hE<gt>>\n"
6380
6381 #. type: Plain text
6382 #: build/C/man2/send.2:50
6383 #, no-wrap
6384 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6385 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6386
6387 #. type: Plain text
6388 #: build/C/man2/send.2:54
6389 #, no-wrap
6390 msgid ""
6391 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6392 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6393 msgstr ""
6394 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6395 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6396
6397 #. type: Plain text
6398 #: build/C/man2/send.2:57
6399 #, no-wrap
6400 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6401 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6402
6403 #. type: Plain text
6404 #: build/C/man2/send.2:65
6405 msgid ""
6406 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6407 "transmit a message to another socket."
6408 msgstr ""
6409 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6410 "メッセージを転送するのに使用される。"
6411
6412 #. type: Plain text
6413 #: build/C/man2/send.2:84
6414 msgid ""
6415 "The B<send>()  call may be used only when the socket is in a I<connected> "
6416 "state (so that the intended recipient is known).  The only difference "
6417 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6418 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6419 "following call"
6420 msgstr ""
6421 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6422 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6423 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6424 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6425
6426 #. type: Plain text
6427 #: build/C/man2/send.2:86
6428 #, no-wrap
6429 msgid "    send(sockfd, buf, len, flags);\n"
6430 msgstr "    send(sockfd, buf, len, flags);\n"
6431
6432 #. type: Plain text
6433 #: build/C/man2/send.2:88
6434 msgid "is equivalent to"
6435 msgstr "は以下と等価である。"
6436
6437 #. type: Plain text
6438 #: build/C/man2/send.2:90
6439 #, no-wrap
6440 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6441 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6442
6443 #. type: Plain text
6444 #: build/C/man2/send.2:94
6445 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6446 msgstr ""
6447 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6448 "る。"
6449
6450 #. type: Plain text
6451 #: build/C/man2/send.2:122
6452 msgid ""
6453 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6454 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6455 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6456 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6457 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6458 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6459 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6460 "size."
6461 msgstr ""
6462 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6463 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6464 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6465 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6466 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6467 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6468 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6469 "msg_namelen> で指定される。"
6470
6471 #. type: Plain text
6472 #: build/C/man2/send.2:138
6473 msgid ""
6474 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6475 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6476 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6477 "ancillary data (also known as control information)."
6478 msgstr ""
6479 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6480 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6481 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6482 "(制御情報とも呼ばれる) を送信することもできる。"
6483
6484 #. type: Plain text
6485 #: build/C/man2/send.2:143
6486 msgid ""
6487 "If the message is too long to pass atomically through the underlying "
6488 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6489 "transmitted."
6490 msgstr ""
6491 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6492 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6493 "ラーが返され、そのメッセージは転送されない。"
6494
6495 #. type: Plain text
6496 #: build/C/man2/send.2:147
6497 msgid ""
6498 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6499 "detected errors are indicated by a return value of -1."
6500 msgstr ""
6501 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6502 "出された場合は、返り値 -1 として通知される。"
6503
6504 #. type: Plain text
6505 #: build/C/man2/send.2:160
6506 msgid ""
6507 "When the message does not fit into the send buffer of the socket, B<send>()  "
6508 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6509 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6510 "in this case.  The B<select>(2)  call may be used to determine when it is "
6511 "possible to send more data."
6512 msgstr ""
6513 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6514 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6515 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6516 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6517 "用することができる。"
6518
6519 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6520 #. type: Plain text
6521 #: build/C/man2/send.2:166
6522 msgid ""
6523 "The I<flags> argument is the bitwise OR of zero or more of the following "
6524 "flags."
6525 msgstr ""
6526 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6527 "のを指定する。"
6528
6529 #. type: TP
6530 #: build/C/man2/send.2:166
6531 #, no-wrap
6532 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6533 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6534
6535 #. type: Plain text
6536 #: build/C/man2/send.2:180
6537 msgid ""
6538 "Tell the link layer that forward progress happened: you got a successful "
6539 "reply from the other side.  If the link layer doesn't get this it will "
6540 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6541 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
6542 "IPv4 and IPv6.  See B<arp>(7)  for details."
6543 msgstr ""
6544 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6545 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6546 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6547 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6548 "されている。 詳しくは B<arp>(7)  参照のこと。"
6549
6550 #. type: TP
6551 #: build/C/man2/send.2:180
6552 #, no-wrap
6553 msgid "B<MSG_DONTROUTE>"
6554 msgstr "B<MSG_DONTROUTE>"
6555
6556 #. type: Plain text
6557 #: build/C/man2/send.2:188
6558 msgid ""
6559 "Don't use a gateway to send out the packet, only send to hosts on directly "
6560 "connected networks.  This is usually used only by diagnostic or routing "
6561 "programs.  This is only defined for protocol families that route; packet "
6562 "sockets don't."
6563 msgstr ""
6564 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6565 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6566 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6567 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6568
6569 #. type: Plain text
6570 #: build/C/man2/send.2:199
6571 msgid ""
6572 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6573 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6574 "flag with the B<F_SETFL> B<fcntl>(2))."
6575 msgstr ""
6576 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6577 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6578 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6579
6580 #. type: TP
6581 #: build/C/man2/send.2:199
6582 #, no-wrap
6583 msgid "B<MSG_EOR> (since Linux 2.2)"
6584 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6585
6586 #. type: Plain text
6587 #: build/C/man2/send.2:203
6588 msgid ""
6589 "Terminates a record (when this notion is supported, as for sockets of type "
6590 "B<SOCK_SEQPACKET>)."
6591 msgstr ""
6592 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6593 "ケット種別のときに有効)。"
6594
6595 #. type: TP
6596 #: build/C/man2/send.2:203
6597 #, no-wrap
6598 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6599 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6600
6601 #. type: Plain text
6602 #: build/C/man2/send.2:212
6603 msgid ""
6604 "The caller has more data to send.  This flag is used with TCP sockets to "
6605 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6606 "with the difference that this flag can be set on a per-call basis."
6607 msgstr ""
6608 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6609 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6610 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6611 "機能を有効にできる点である。"
6612
6613 #. type: Plain text
6614 #: build/C/man2/send.2:221
6615 msgid ""
6616 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6617 "the kernel to package all of the data sent in calls with this flag set into "
6618 "a single datagram which is only transmitted when a call is performed that "
6619 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6620 "described in B<udp>(7).)"
6621 msgstr ""
6622 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6623 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6624 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6625 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6626 "ソケットオプション B<UDP_CORK> も参照)。"
6627
6628 #. type: TP
6629 #: build/C/man2/send.2:221
6630 #, no-wrap
6631 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6632 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6633
6634 #. type: Plain text
6635 #: build/C/man2/send.2:230
6636 msgid ""
6637 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6638 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6639 msgstr ""
6640 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6641 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6642
6643 #. type: Plain text
6644 #: build/C/man2/send.2:239
6645 msgid ""
6646 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6647 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6648 "data."
6649 msgstr ""
6650 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6651 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6652 "をサポートしている必要がある。"
6653
6654 #. type: Plain text
6655 #: build/C/man2/send.2:246
6656 msgid ""
6657 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6658 "below for an exact description of its fields."
6659 msgstr ""
6660 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6661 "B<recv>(2)  と以下の説明を参照すること。"
6662
6663 #.  Still to be documented:
6664 #.   Send file descriptors and user credentials using the
6665 #.   msg_control* fields.
6666 #.   The flags returned in msg_flags.
6667 #. type: Plain text
6668 #: build/C/man2/send.2:275
6669 msgid ""
6670 "You may send control information using the I<msg_control> and "
6671 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6672 "process is limited per socket by the value in I</proc/sys/net/core/"
6673 "optmem_max>; see B<socket>(7)."
6674 msgstr ""
6675 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6676 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6677 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6678
6679 #. type: Plain text
6680 #: build/C/man2/send.2:280
6681 msgid ""
6682 "On success, these calls return the number of characters sent.  On error, -1 "
6683 "is returned, and I<errno> is set appropriately."
6684 msgstr ""
6685 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6686 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6687
6688 #. type: Plain text
6689 #: build/C/man2/send.2:285
6690 msgid ""
6691 "These are some standard errors generated by the socket layer.  Additional "
6692 "errors may be generated and returned from the underlying protocol modules; "
6693 "see their respective manual pages."
6694 msgstr ""
6695 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6696 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6697 "れぞれのマニュアルを参照すること。"
6698
6699 #. type: Plain text
6700 #: build/C/man2/send.2:293
6701 msgid ""
6702 "(For UNIX domain sockets, which are identified by pathname)  Write "
6703 "permission is denied on the destination socket file, or search permission is "
6704 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6705 "(7).)"
6706 msgstr ""
6707 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6708 "\n"
6709 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6710 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6711 "(B<path_resolution>(7) も参照のこと)"
6712
6713 #. type: Plain text
6714 #: build/C/man2/send.2:296
6715 msgid ""
6716 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6717 "as though it was a unicast address."
6718 msgstr ""
6719 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6720 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6721
6722 #.  Actually EAGAIN on Linux
6723 #. type: Plain text
6724 #: build/C/man2/send.2:304
6725 msgid ""
6726 "The socket is marked nonblocking and the requested operation would block.  "
6727 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6728 "require these constants to have the same value, so a portable application "
6729 "should check for both possibilities."
6730 msgstr ""
6731 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6732 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6733 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6734 "両方の可能性を 確認すべきである。"
6735
6736 #. type: Plain text
6737 #: build/C/man2/send.2:307
6738 msgid "An invalid descriptor was specified."
6739 msgstr "無効なディスクリプターが指定された。"
6740
6741 #. type: TP
6742 #: build/C/man2/send.2:307
6743 #, no-wrap
6744 msgid "B<ECONNRESET>"
6745 msgstr "B<ECONNRESET>"
6746
6747 #. type: Plain text
6748 #: build/C/man2/send.2:310
6749 msgid "Connection reset by peer."
6750 msgstr "接続が接続相手によりリセットされた。"
6751
6752 #. type: TP
6753 #: build/C/man2/send.2:310
6754 #, no-wrap
6755 msgid "B<EDESTADDRREQ>"
6756 msgstr "B<EDESTADDRREQ>"
6757
6758 #. type: Plain text
6759 #: build/C/man2/send.2:313
6760 msgid "The socket is not connection-mode, and no peer address is set."
6761 msgstr ""
6762 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6763 "ていない。"
6764
6765 #. type: Plain text
6766 #: build/C/man2/send.2:316
6767 msgid "An invalid user space address was specified for an argument."
6768 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6769
6770 #. type: Plain text
6771 #: build/C/man2/send.2:320
6772 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6773 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6774
6775 #. type: Plain text
6776 #: build/C/man2/send.2:329
6777 msgid ""
6778 "The connection-mode socket was connected already but a recipient was "
6779 "specified.  (Now either this error is returned, or the recipient "
6780 "specification is ignored.)"
6781 msgstr ""
6782 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6783 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6784 "いずれかとなる)"
6785
6786 #. type: TP
6787 #: build/C/man2/send.2:329
6788 #, no-wrap
6789 msgid "B<EMSGSIZE>"
6790 msgstr "B<EMSGSIZE>"
6791
6792 #.  (e.g., SOCK_DGRAM )
6793 #. type: Plain text
6794 #: build/C/man2/send.2:335
6795 msgid ""
6796 "The socket type requires that message be sent atomically, and the size of "
6797 "the message to be sent made this impossible."
6798 msgstr ""
6799 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6800 "るが、 メッセージが大き過ぎるため送信することができない。"
6801
6802 #. type: Plain text
6803 #: build/C/man2/send.2:343
6804 msgid ""
6805 "The output queue for a network interface was full.  This generally indicates "
6806 "that the interface has stopped sending, but may be caused by transient "
6807 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6808 "silently dropped when a device queue overflows.)"
6809 msgstr ""
6810 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6811 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6812 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6813 "フローした場合にはパケットは黙って捨てられる)"
6814
6815 #. type: Plain text
6816 #: build/C/man2/send.2:346
6817 msgid "No memory available."
6818 msgstr "メモリが足りない。"
6819
6820 #. type: Plain text
6821 #: build/C/man2/send.2:349
6822 msgid "The socket is not connected, and no target has been given."
6823 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6824
6825 #. type: Plain text
6826 #: build/C/man2/send.2:359
6827 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6828 msgstr ""
6829 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6830 "る。"
6831
6832 #. type: TP
6833 #: build/C/man2/send.2:359
6834 #, no-wrap
6835 msgid "B<EPIPE>"
6836 msgstr "B<EPIPE>"
6837
6838 #. type: Plain text
6839 #: build/C/man2/send.2:368
6840 msgid ""
6841 "The local end has been shut down on a connection oriented socket.  In this "
6842 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6843 "set."
6844 msgstr ""
6845 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6846 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6847
6848 #. type: Plain text
6849 #: build/C/man2/send.2:371
6850 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
6851 msgstr ""
6852 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
6853
6854 #. type: Plain text
6855 #: build/C/man2/send.2:382
6856 msgid ""
6857 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags.  "
6858 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
6859 "flag is a Linux extension."
6860 msgstr ""
6861 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
6862 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
6863 "ラグは Linux での拡張である。"
6864
6865 #. type: Plain text
6866 #: build/C/man2/send.2:395
6867 msgid ""
6868 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
6869 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
6870 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
6871 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
6872 "and libc5.  See also B<accept>(2)."
6873 msgstr ""
6874 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
6875 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
6876 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
6877 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
6878 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
6879
6880 #. type: Plain text
6881 #: build/C/man2/send.2:414
6882 msgid ""
6883 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
6884 "can be used to transmit multiple datagrams in a single call."
6885 msgstr ""
6886 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
6887 "る\n"
6888 "Linux 固有の システムコールに関する情報が書かれている。"
6889
6890 #. type: Plain text
6891 #: build/C/man2/send.2:419
6892 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
6893 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
6894
6895 #. type: Plain text
6896 #: build/C/man2/send.2:424
6897 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
6898 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
6899
6900 #. type: Plain text
6901 #: build/C/man2/send.2:439
6902 msgid ""
6903 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6904 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6905 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6906 msgstr ""
6907 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6908 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6909 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6910
6911 #. type: TH
6912 #: build/C/man2/sendmmsg.2:28
6913 #, no-wrap
6914 msgid "SENDMMSG"
6915 msgstr "SENDMMSG"
6916
6917 #. type: TH
6918 #: build/C/man2/sendmmsg.2:28
6919 #, no-wrap
6920 msgid "2012-12-16"
6921 msgstr "2012-12-16"
6922
6923 #. type: Plain text
6924 #: build/C/man2/sendmmsg.2:31
6925 msgid "sendmmsg - send multiple messages on a socket"
6926 msgstr ""
6927
6928 #. type: Plain text
6929 #: build/C/man2/sendmmsg.2:39
6930 #, no-wrap
6931 msgid ""
6932 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6933 "B<             unsigned int >I<flags>B<);>\n"
6934 msgstr ""
6935 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6936 "B<             unsigned int >I<flags>B<);>\n"
6937
6938 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
6939 #. type: Plain text
6940 #: build/C/man2/sendmmsg.2:49
6941 msgid ""
6942 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
6943 "the caller to transmit multiple messages on a socket using a single system "
6944 "call.  (This has performance benefits for some applications.)"
6945 msgstr ""
6946
6947 #. type: Plain text
6948 #: build/C/man2/sendmmsg.2:54
6949 msgid ""
6950 "The I<sockfd> argument is the file descriptor of the socket on which data is "
6951 "to be transmitted."
6952 msgstr ""
6953
6954 #. type: Plain text
6955 #: build/C/man2/sendmmsg.2:75
6956 #, no-wrap
6957 msgid ""
6958 "struct mmsghdr {\n"
6959 "    struct msghdr msg_hdr;  /* Message header */\n"
6960 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
6961 "};\n"
6962 msgstr ""
6963
6964 #. type: Plain text
6965 #: build/C/man2/sendmmsg.2:91
6966 msgid ""
6967 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
6968 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
6969 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
6970 "B<sendmsg>(2)  call)."
6971 msgstr ""
6972
6973 #. type: Plain text
6974 #: build/C/man2/sendmmsg.2:97
6975 msgid ""
6976 "The I<flags> argument contains flags ORed together.  The flags are the same "
6977 "as for B<sendmsg>(2)."
6978 msgstr ""
6979
6980 #. type: Plain text
6981 #: build/C/man2/sendmmsg.2:107
6982 msgid ""
6983 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
6984 "sent.  A nonblocking call sends as many messages as possible (up to the "
6985 "limit specified by I<vlen>)  and returns immediately."
6986 msgstr ""
6987
6988 #. type: Plain text
6989 #: build/C/man2/sendmmsg.2:119
6990 msgid ""
6991 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
6992 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
6993 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
6994 "of elements of I<msgvec> that have been updated."
6995 msgstr ""
6996
6997 #. type: Plain text
6998 #: build/C/man2/sendmmsg.2:129
6999 msgid ""
7000 "On success, B<sendmmsg>()  returns the number of messages sent from "
7001 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7002 "B<sendmmsg>()  call to send the remaining messages."
7003 msgstr ""
7004
7005 #. type: Plain text
7006 #: build/C/man2/sendmmsg.2:133
7007 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7008 msgstr ""
7009
7010 #
7011 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7012 #.      ... only return an error if no datagrams could be sent.
7013 #.      If less than the requested number of messages were sent, the application
7014 #.      must retry starting at the first failed one and if the problem is
7015 #.      persistent the error will be returned.
7016 #.      This matches the behaviour of other syscalls like read/write - it
7017 #.      is not an error if less than the requested number of elements are sent.
7018 #. type: Plain text
7019 #: build/C/man2/sendmmsg.2:145
7020 msgid ""
7021 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7022 "could be sent."
7023 msgstr ""
7024
7025 #. type: Plain text
7026 #: build/C/man2/sendmmsg.2:150
7027 msgid ""
7028 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7029 "added in version 2.14."
7030 msgstr ""
7031
7032 #. type: Plain text
7033 #: build/C/man2/sendmmsg.2:153
7034 msgid "B<sendmmsg>()  is Linux-specific."
7035 msgstr ""
7036
7037 #
7038 #
7039 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7040 #.      net: Cap number of elements for sendmmsg
7041 #.      To limit the amount of time we can spend in sendmmsg, cap the
7042 #.      number of elements to UIO_MAXIOV (currently 1024).
7043 #.      For error handling an application using sendmmsg needs to retry at
7044 #.      the first unsent message, so capping is simpler and requires less
7045 #.      application logic than returning EINVAL.
7046 #. type: Plain text
7047 #: build/C/man2/sendmmsg.2:168
7048 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7049 msgstr ""
7050
7051 #. type: Plain text
7052 #: build/C/man2/sendmmsg.2:177
7053 msgid ""
7054 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7055 "distinct UDP datagrams using one system call.  The contents of the first "
7056 "datagram originates from a pair of buffers."
7057 msgstr ""
7058
7059 #. type: Plain text
7060 #: build/C/man2/sendmmsg.2:186
7061 #, no-wrap
7062 msgid ""
7063 "#define _GNU_SOURCE\n"
7064 "#include E<lt>netinet/ip.hE<gt>\n"
7065 "#include E<lt>stdio.hE<gt>\n"
7066 "#include E<lt>stdlib.hE<gt>\n"
7067 "#include E<lt>string.hE<gt>\n"
7068 "#include E<lt>sys/types.hE<gt>\n"
7069 "#include E<lt>sys/socket.hE<gt>\n"
7070 msgstr ""
7071 "#define _GNU_SOURCE\n"
7072 "#include E<lt>netinet/ip.hE<gt>\n"
7073 "#include E<lt>stdio.hE<gt>\n"
7074 "#include E<lt>stdlib.hE<gt>\n"
7075 "#include E<lt>string.hE<gt>\n"
7076 "#include E<lt>sys/types.hE<gt>\n"
7077 "#include E<lt>sys/socket.hE<gt>\n"
7078
7079 #. type: Plain text
7080 #: build/C/man2/sendmmsg.2:195
7081 #, no-wrap
7082 msgid ""
7083 "int\n"
7084 "main(void)\n"
7085 "{\n"
7086 "    int sockfd;\n"
7087 "    struct sockaddr_in sa;\n"
7088 "    struct mmsghdr msg[2];\n"
7089 "    struct iovec msg1[2], msg2;\n"
7090 "    int retval;\n"
7091 msgstr ""
7092 "int\n"
7093 "main(void)\n"
7094 "{\n"
7095 "    int sockfd;\n"
7096 "    struct sockaddr_in sa;\n"
7097 "    struct mmsghdr msg[2];\n"
7098 "    struct iovec msg1[2], msg2;\n"
7099 "    int retval;\n"
7100
7101 #. type: Plain text
7102 #: build/C/man2/sendmmsg.2:209
7103 #, no-wrap
7104 msgid ""
7105 "    sa.sin_family = AF_INET;\n"
7106 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7107 "    sa.sin_port = htons(1234);\n"
7108 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7109 "        perror(\"connect()\");\n"
7110 "        exit(EXIT_FAILURE);\n"
7111 "    }\n"
7112 msgstr ""
7113 "    sa.sin_family = AF_INET;\n"
7114 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7115 "    sa.sin_port = htons(1234);\n"
7116 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7117 "        perror(\"connect()\");\n"
7118 "        exit(EXIT_FAILURE);\n"
7119 "    }\n"
7120
7121 #. type: Plain text
7122 #: build/C/man2/sendmmsg.2:215
7123 #, no-wrap
7124 msgid ""
7125 "    memset(msg1, 0, sizeof(msg1));\n"
7126 "    msg1[0].iov_base = \"one\";\n"
7127 "    msg1[0].iov_len = 3;\n"
7128 "    msg1[1].iov_base = \"two\";\n"
7129 "    msg1[1].iov_len = 3;\n"
7130 msgstr ""
7131 "    memset(msg1, 0, sizeof(msg1));\n"
7132 "    msg1[0].iov_base = \"one\";\n"
7133 "    msg1[0].iov_len = 3;\n"
7134 "    msg1[1].iov_base = \"two\";\n"
7135 "    msg1[1].iov_len = 3;\n"
7136
7137 #. type: Plain text
7138 #: build/C/man2/sendmmsg.2:219
7139 #, no-wrap
7140 msgid ""
7141 "    memset(&msg2, 0, sizeof(msg2));\n"
7142 "    msg2.iov_base = \"three\";\n"
7143 "    msg2.iov_len = 5;\n"
7144 msgstr ""
7145 "    memset(&msg2, 0, sizeof(msg2));\n"
7146 "    msg2.iov_base = \"three\";\n"
7147 "    msg2.iov_len = 5;\n"
7148
7149 #. type: Plain text
7150 #: build/C/man2/sendmmsg.2:223
7151 #, no-wrap
7152 msgid ""
7153 "    memset(msg, 0, sizeof(msg));\n"
7154 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7155 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7156 msgstr ""
7157 "    memset(msg, 0, sizeof(msg));\n"
7158 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7159 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7160
7161 #. type: Plain text
7162 #: build/C/man2/sendmmsg.2:226
7163 #, no-wrap
7164 msgid ""
7165 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7166 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7167 msgstr ""
7168 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7169 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7170
7171 #. type: Plain text
7172 #: build/C/man2/sendmmsg.2:232
7173 #, no-wrap
7174 msgid ""
7175 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7176 "    if (retval == -1)\n"
7177 "        perror(\"sendmmsg()\");\n"
7178 "    else\n"
7179 "        printf(\"%d messages sent\\en\", retval);\n"
7180 msgstr ""
7181 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7182 "    if (retval == -1)\n"
7183 "        perror(\"sendmmsg()\");\n"
7184 "    else\n"
7185 "        printf(\"%d messages sent\\en\", retval);\n"
7186
7187 #. type: Plain text
7188 #: build/C/man2/sendmmsg.2:235
7189 #, no-wrap
7190 msgid ""
7191 "    exit(0);\n"
7192 "}\n"
7193 msgstr ""
7194 "    exit(0);\n"
7195 "}\n"
7196
7197 #. type: Plain text
7198 #: build/C/man2/sendmmsg.2:241
7199 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7200 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7201
7202 #. type: TH
7203 #: build/C/man3/sockatmark.3:25
7204 #, no-wrap
7205 msgid "SOCKATMARK"
7206 msgstr "SOCKATMARK"
7207
7208 #. type: Plain text
7209 #: build/C/man3/sockatmark.3:28
7210 msgid "sockatmark - determine whether socket is at out-of-band mark"
7211 msgstr ""
7212 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7213 "べる"
7214
7215 #. type: Plain text
7216 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7217 #: build/C/man7/socket.7:53 build/C/man2/socketpair.2:49
7218 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7219 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7220
7221 #. type: Plain text
7222 #: build/C/man3/sockatmark.3:32
7223 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7224 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7225
7226 #. type: Plain text
7227 #: build/C/man3/sockatmark.3:41
7228 msgid ""
7229 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7230 "\\ 600"
7231 msgstr ""
7232 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7233 "\\ 600"
7234
7235 #. type: Plain text
7236 #: build/C/man3/sockatmark.3:51
7237 msgid ""
7238 "B<sockatmark>()  returns a value indicating whether or not the socket "
7239 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7240 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7241 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7242 msgstr ""
7243 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7244 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7245 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7246 "この関数は帯域外マークを削除しない。"
7247
7248 #. type: Plain text
7249 #: build/C/man3/sockatmark.3:56
7250 msgid ""
7251 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7252 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7253 "set to indicate the error."
7254 msgstr ""
7255 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7256 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7257 "れ、エラーを表す I<errno> が設定される。"
7258
7259 #. type: Plain text
7260 #: build/C/man3/sockatmark.3:61
7261 msgid "I<sockfd> is not a valid file descriptor."
7262 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7263
7264 #.  POSIX.1 says ENOTTY for this case
7265 #. type: Plain text
7266 #: build/C/man3/sockatmark.3:68
7267 msgid ""
7268 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7269 msgstr ""
7270 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7271
7272 #. type: Plain text
7273 #: build/C/man3/sockatmark.3:71
7274 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7275 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7276
7277 #. type: Plain text
7278 #: build/C/man3/sockatmark.3:73
7279 msgid "POSIX.1-2001."
7280 msgstr "POSIX.1-2001."
7281
7282 #. type: Plain text
7283 #: build/C/man3/sockatmark.3:80
7284 msgid ""
7285 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7286 "the B<MSG_OOB> flag of B<recv>(2)."
7287 msgstr ""
7288 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7289 "B<recv>(2)  で読み込むことができる。"
7290
7291 #. type: Plain text
7292 #: build/C/man3/sockatmark.3:82
7293 msgid "Out-of-band data is only supported on some stream socket protocols."
7294 msgstr ""
7295 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7296 "ない。"
7297
7298 #. type: Plain text
7299 #: build/C/man3/sockatmark.3:87
7300 msgid ""
7301 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7302 "signal."
7303 msgstr ""
7304 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7305 "る。"
7306
7307 #. type: Plain text
7308 #: build/C/man3/sockatmark.3:93
7309 msgid ""
7310 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7311 "operation."
7312 msgstr ""
7313 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7314
7315 #. type: Plain text
7316 #: build/C/man3/sockatmark.3:97
7317 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7318 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7319
7320 #. type: Plain text
7321 #: build/C/man3/sockatmark.3:102
7322 msgid ""
7323 "The following code can be used after receipt of a B<SIGURG> signal to read "
7324 "(and discard) all data up to the mark, and then read the byte of data at the "
7325 "mark:"
7326 msgstr ""
7327 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7328 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7329
7330 #. type: Plain text
7331 #: build/C/man3/sockatmark.3:107
7332 #, no-wrap
7333 msgid ""
7334 "    char buf[BUF_LEN];\n"
7335 "    char oobdata;\n"
7336 "    int atmark, s;\n"
7337 msgstr ""
7338 "    char buf[BUF_LEN];\n"
7339 "    char oobdata;\n"
7340 "    int atmark, s;\n"
7341
7342 #. type: Plain text
7343 #: build/C/man3/sockatmark.3:114
7344 #, no-wrap
7345 msgid ""
7346 "    for (;;) {\n"
7347 "        atmark = sockatmark(sockfd);\n"
7348 "        if (atmark == -1) {\n"
7349 "            perror(\"sockatmark\");\n"
7350 "            break;\n"
7351 "        }\n"
7352 msgstr ""
7353 "    for (;;) {\n"
7354 "        atmark = sockatmark(sockfd);\n"
7355 "        if (atmark == -1) {\n"
7356 "            perror(\"sockatmark\");\n"
7357 "            break;\n"
7358 "        }\n"
7359
7360 #. type: Plain text
7361 #: build/C/man3/sockatmark.3:117
7362 #, no-wrap
7363 msgid ""
7364 "        if (atmark)\n"
7365 "            break;\n"
7366 msgstr ""
7367 "        if (atmark)\n"
7368 "            break;\n"
7369
7370 #. type: Plain text
7371 #: build/C/man3/sockatmark.3:124
7372 #, no-wrap
7373 msgid ""
7374 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7375 "        if (s == -1)\n"
7376 "            perror(\"read\");\n"
7377 "        if (s E<lt>= 0)\n"
7378 "            break;\n"
7379 "    }\n"
7380 msgstr ""
7381 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7382 "        if (s == -1)\n"
7383 "            perror(\"read\");\n"
7384 "        if (s E<lt>= 0)\n"
7385 "            break;\n"
7386 "    }\n"
7387
7388 #. type: Plain text
7389 #: build/C/man3/sockatmark.3:131
7390 #, no-wrap
7391 msgid ""
7392 "    if (atmark == 1) {\n"
7393 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7394 "            perror(\"recv\");\n"
7395 "            ...\n"
7396 "        }\n"
7397 "    }\n"
7398 msgstr ""
7399 "    if (atmark == 1) {\n"
7400 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7401 "            perror(\"recv\");\n"
7402 "            ...\n"
7403 "        }\n"
7404 "    }\n"
7405
7406 #. type: Plain text
7407 #: build/C/man3/sockatmark.3:137
7408 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7409 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7410
7411 #. type: TH
7412 #: build/C/man2/socket.2:43 build/C/man7/socket.7:48
7413 #, no-wrap
7414 msgid "SOCKET"
7415 msgstr "SOCKET"
7416
7417 #. type: TH
7418 #: build/C/man2/socket.2:43
7419 #, no-wrap
7420 msgid "2009-01-19"
7421 msgstr "2009-01-19"
7422
7423 #. type: Plain text
7424 #: build/C/man2/socket.2:46
7425 msgid "socket - create an endpoint for communication"
7426 msgstr "socket - 通信のための端点(endpoint)を作成する"
7427
7428 #. type: Plain text
7429 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7430 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7431 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7432
7433 #. type: Plain text
7434 #: build/C/man2/socket.2:52
7435 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7436 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7437
7438 #. type: Plain text
7439 #: build/C/man2/socket.2:55
7440 msgid ""
7441 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7442 msgstr ""
7443 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7444 "(descriptor)を返す。"
7445
7446 #. type: Plain text
7447 #: build/C/man2/socket.2:63
7448 msgid ""
7449 "The I<domain> argument specifies a communication domain; this selects the "
7450 "protocol family which will be used for communication.  These families are "
7451 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7452 "include:"
7453 msgstr ""
7454 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7455 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7456 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7457 "下の通り。"
7458
7459 #. type: tbl table
7460 #: build/C/man2/socket.2:66
7461 #, no-wrap
7462 msgid "Name:Purpose:Man page\n"
7463 msgstr "名前:目的:マニュアル\n"
7464
7465 #. type: tbl table
7466 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7467 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7468 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7469 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7470 #, no-wrap
7471 msgid "T{\n"
7472 msgstr "T{\n"
7473
7474 #. type: tbl table
7475 #: build/C/man2/socket.2:68
7476 #, no-wrap
7477 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7478 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7479
7480 #. type: tbl table
7481 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7482 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7483 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7484 #: build/C/man7/socket.7:184
7485 #, no-wrap
7486 msgid "T}:T{\n"
7487 msgstr "T}:T{\n"
7488
7489 #. type: tbl table
7490 #: build/C/man2/socket.2:70
7491 #, no-wrap
7492 msgid "Local communication\n"
7493 msgstr "ローカル通信\n"
7494
7495 #. type: tbl table
7496 #: build/C/man2/socket.2:72
7497 #, no-wrap
7498 msgid "B<unix>(7)\n"
7499 msgstr "B<unix>(7)\n"
7500
7501 #. type: tbl table
7502 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7503 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7504 #: build/C/man2/socket.2:118 build/C/man7/socket.7:163
7505 #: build/C/man7/socket.7:167 build/C/man7/socket.7:170
7506 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
7507 #: build/C/man7/socket.7:188 build/C/man7/socket.7:195
7508 #, no-wrap
7509 msgid "T}\n"
7510 msgstr "T}\n"
7511
7512 #. type: tbl table
7513 #: build/C/man2/socket.2:75
7514 #, no-wrap
7515 msgid "B<AF_INET>\n"
7516 msgstr "B<AF_INET>\n"
7517
7518 #. type: tbl table
7519 #: build/C/man2/socket.2:76
7520 #, no-wrap
7521 msgid "T}:IPv4 Internet protocols:T{\n"
7522 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7523
7524 #. type: tbl table
7525 #: build/C/man2/socket.2:77
7526 #, no-wrap
7527 msgid "B<ip>(7)\n"
7528 msgstr "B<ip>(7)\n"
7529
7530 #. type: tbl table
7531 #: build/C/man2/socket.2:80
7532 #, no-wrap
7533 msgid "B<AF_INET6>\n"
7534 msgstr "B<AF_INET6>\n"
7535
7536 #. type: tbl table
7537 #: build/C/man2/socket.2:81
7538 #, no-wrap
7539 msgid "T}:IPv6 Internet protocols:T{\n"
7540 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7541
7542 #. type: tbl table
7543 #: build/C/man2/socket.2:82
7544 #, no-wrap
7545 msgid "B<ipv6>(7)\n"
7546 msgstr "B<ipv6>(7)\n"
7547
7548 #. type: tbl table
7549 #: build/C/man2/socket.2:85
7550 #, no-wrap
7551 msgid "B<AF_IPX>\n"
7552 msgstr "B<AF_IPX>\n"
7553
7554 #. type: tbl table
7555 #: build/C/man2/socket.2:86
7556 #, no-wrap
7557 msgid "T}:IPX - Novell protocols:\n"
7558 msgstr "T}:IPX - Novell プロトコル:\n"
7559
7560 #. type: tbl table
7561 #: build/C/man2/socket.2:88
7562 #, no-wrap
7563 msgid "B<AF_NETLINK>\n"
7564 msgstr "B<AF_NETLINK>\n"
7565
7566 #. type: tbl table
7567 #: build/C/man2/socket.2:90
7568 #, no-wrap
7569 msgid "Kernel user interface device\n"
7570 msgstr "カーネル・ユーザ・デバイス\n"
7571
7572 #. type: tbl table
7573 #: build/C/man2/socket.2:92
7574 #, no-wrap
7575 msgid "B<netlink>(7)\n"
7576 msgstr "B<netlink>(7)\n"
7577
7578 #. type: tbl table
7579 #: build/C/man2/socket.2:95
7580 #, no-wrap
7581 msgid "B<AF_X25>\n"
7582 msgstr "B<AF_X25>\n"
7583
7584 #. type: tbl table
7585 #: build/C/man2/socket.2:96
7586 #, no-wrap
7587 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
7588 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
7589
7590 #. type: tbl table
7591 #: build/C/man2/socket.2:97
7592 #, no-wrap
7593 msgid "B<x25>(7)\n"
7594 msgstr "B<x25>(7)\n"
7595
7596 #. type: tbl table
7597 #: build/C/man2/socket.2:100
7598 #, no-wrap
7599 msgid "B<AF_AX25>\n"
7600 msgstr "B<AF_AX25>\n"
7601
7602 #. type: tbl table
7603 #: build/C/man2/socket.2:102
7604 #, no-wrap
7605 msgid "Amateur radio AX.25 protocol\n"
7606 msgstr "アマチュア無線 AX.25 プロトコル\n"
7607
7608 #. type: tbl table
7609 #: build/C/man2/socket.2:103
7610 #, no-wrap
7611 msgid "T}:\n"
7612 msgstr "T}:\n"
7613
7614 #. type: tbl table
7615 #: build/C/man2/socket.2:105
7616 #, no-wrap
7617 msgid "B<AF_ATMPVC>\n"
7618 msgstr "B<AF_ATMPVC>\n"
7619
7620 #. type: tbl table
7621 #: build/C/man2/socket.2:106
7622 #, no-wrap
7623 msgid "T}:Access to raw ATM PVCs:\n"
7624 msgstr "T}:生の ATM PVC にアクセスする:\n"
7625
7626 #. type: tbl table
7627 #: build/C/man2/socket.2:108
7628 #, no-wrap
7629 msgid "B<AF_APPLETALK>\n"
7630 msgstr "B<AF_APPLETALK>\n"
7631
7632 #. type: tbl table
7633 #: build/C/man2/socket.2:109
7634 #, no-wrap
7635 msgid "T}:Appletalk:T{\n"
7636 msgstr "T}:アップルトーク:T{\n"
7637
7638 #. type: tbl table
7639 #: build/C/man2/socket.2:110
7640 #, no-wrap
7641 msgid "B<ddp>(7)\n"
7642 msgstr "B<ddp>(7)\n"
7643
7644 #. type: tbl table
7645 #: build/C/man2/socket.2:113
7646 #, no-wrap
7647 msgid "B<AF_PACKET>\n"
7648 msgstr "B<AF_PACKET>\n"
7649
7650 #. type: tbl table
7651 #: build/C/man2/socket.2:115
7652 #, no-wrap
7653 msgid "Low level packet interface\n"
7654 msgstr "低レベルのパケットインターフェース\n"
7655
7656 #. type: tbl table
7657 #: build/C/man2/socket.2:117
7658 #, no-wrap
7659 msgid "B<packet>(7)\n"
7660 msgstr "B<packet>(7)\n"
7661
7662 #. type: Plain text
7663 #: build/C/man2/socket.2:126
7664 msgid ""
7665 "The socket has the indicated I<type>, which specifies the communication "
7666 "semantics.  Currently defined types are:"
7667 msgstr ""
7668 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7669 "る。 定義されている型は現在以下の通り。"
7670
7671 #. type: TP
7672 #: build/C/man2/socket.2:126
7673 #, no-wrap
7674 msgid "B<SOCK_STREAM>"
7675 msgstr "B<SOCK_STREAM>"
7676
7677 #. type: Plain text
7678 #: build/C/man2/socket.2:130
7679 msgid ""
7680 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
7681 "out-of-band data transmission mechanism may be supported."
7682 msgstr ""
7683 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7684 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7685
7686 #. type: TP
7687 #: build/C/man2/socket.2:130
7688 #, no-wrap
7689 msgid "B<SOCK_DGRAM>"
7690 msgstr "B<SOCK_DGRAM>"
7691
7692 #. type: Plain text
7693 #: build/C/man2/socket.2:134
7694 msgid ""
7695 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7696 "length)."
7697 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ)  をサポートする。"
7698
7699 #. type: TP
7700 #: build/C/man2/socket.2:134
7701 #, no-wrap
7702 msgid "B<SOCK_SEQPACKET>"
7703 msgstr "B<SOCK_SEQPACKET>"
7704
7705 #. type: Plain text
7706 #: build/C/man2/socket.2:139
7707 msgid ""
7708 "Provides a sequenced, reliable, two-way connection-based data transmission "
7709 "path for datagrams of fixed maximum length; a consumer is required to read "
7710 "an entire packet with each input system call."
7711 msgstr ""
7712 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7713 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7714 "ト全体を読み取ることが要求される。"
7715
7716 #. type: TP
7717 #: build/C/man2/socket.2:139
7718 #, no-wrap
7719 msgid "B<SOCK_RAW>"
7720 msgstr "B<SOCK_RAW>"
7721
7722 #. type: Plain text
7723 #: build/C/man2/socket.2:142
7724 msgid "Provides raw network protocol access."
7725 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7726
7727 #. type: TP
7728 #: build/C/man2/socket.2:142
7729 #, no-wrap
7730 msgid "B<SOCK_RDM>"
7731 msgstr "B<SOCK_RDM>"
7732
7733 #. type: Plain text
7734 #: build/C/man2/socket.2:145
7735 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7736 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7737
7738 #. type: TP
7739 #: build/C/man2/socket.2:145
7740 #, no-wrap
7741 msgid "B<SOCK_PACKET>"
7742 msgstr "B<SOCK_PACKET>"
7743
7744 #. type: Plain text
7745 #: build/C/man2/socket.2:150
7746 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7747 msgstr ""
7748 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7749 "こと"
7750
7751 #. type: Plain text
7752 #: build/C/man2/socket.2:156
7753 msgid ""
7754 "Some socket types may not be implemented by all protocol families; for "
7755 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7756 msgstr ""
7757 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7758 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7759
7760 #. type: Plain text
7761 #: build/C/man2/socket.2:164
7762 msgid ""
7763 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7764 "addition to specifying a socket type, it may include the bitwise OR of any "
7765 "of the following values, to modify the behavior of B<socket>():"
7766 msgstr ""
7767 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7768 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7769 "ることで、 B<socket>()  の振舞いを変更することができる。"
7770
7771 #. type: Plain text
7772 #: build/C/man2/socket.2:198
7773 msgid ""
7774 "The I<protocol> specifies a particular protocol to be used with the socket.  "
7775 "Normally only a single protocol exists to support a particular socket type "
7776 "within a given protocol family, in which case I<protocol> can be specified "
7777 "as 0.  However, it is possible that many protocols may exist, in which case "
7778 "a particular protocol must be specified in this manner.  The protocol number "
7779 "to use is specific to the ``communication domain'' in which communication is "
7780 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
7781 "protocol name strings to protocol numbers."
7782 msgstr ""
7783 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7784 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7785 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7786 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7787 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7788 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
7789 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
7790
7791 #. type: Plain text
7792 #: build/C/man2/socket.2:228
7793 msgid ""
7794 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7795 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7796 "a I<connected> state before any data may be sent or received on it.  A "
7797 "connection to another socket is created with a B<connect>(2)  call.  Once "
7798 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7799 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7800 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7801 "also be transmitted as described in B<send>(2)  and received as described in "
7802 "B<recv>(2)."
7803 msgstr ""
7804 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7805 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7806 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7807 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7808 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7809 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7810 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7811
7812 #. type: Plain text
7813 #: build/C/man2/socket.2:254
7814 msgid ""
7815 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7816 "data is not lost or duplicated.  If a piece of data for which the peer "
7817 "protocol has buffer space cannot be successfully transmitted within a "
7818 "reasonable length of time, then the connection is considered to be dead.  "
7819 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7820 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
7821 "signal is raised if a process sends or receives on a broken stream; this "
7822 "causes naive processes, which do not handle the signal, to exit.  "
7823 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7824 "sockets.  The only difference is that B<read>(2)  calls will return only the "
7825 "amount of data requested, and any data remaining in the arriving packet will "
7826 "be discarded.  Also all message boundaries in incoming datagrams are "
7827 "preserved."
7828 msgstr ""
7829 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7830 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7831 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7832 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7833 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7834 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7835 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7836 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
7837 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
7838 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
7839
7840 #. type: Plain text
7841 #: build/C/man2/socket.2:264
7842 msgid ""
7843 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
7844 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
7845 "received with B<recvfrom>(2), which returns the next datagram along with the "
7846 "address of its sender."
7847 msgstr ""
7848 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
7849 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
7850 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
7851 "す。"
7852
7853 #. type: Plain text
7854 #: build/C/man2/socket.2:271
7855 msgid ""
7856 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
7857 "from the device driver.  Use B<packet>(7)  instead."
7858 msgstr ""
7859 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
7860 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
7861
7862 #. type: Plain text
7863 #: build/C/man2/socket.2:294
7864 msgid ""
7865 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
7866 "process group to receive a B<SIGURG> signal when the out-of-band data "
7867 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
7868 "unexpectedly.  This operation may also be used to set the process or process "
7869 "group that receives the I/O and asynchronous notification of I/O events via "
7870 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
7871 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
7872 msgstr ""
7873 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
7874 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
7875 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
7876 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
7877 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
7878 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
7879 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
7880
7881 #. type: Plain text
7882 #: build/C/man2/socket.2:304
7883 msgid ""
7884 "When the network signals an error condition to the protocol module (e.g., "
7885 "using a ICMP message for IP) the pending error flag is set for the socket.  "
7886 "The next operation on this socket will return the error code of the pending "
7887 "error.  For some protocols it is possible to enable a per-socket error queue "
7888 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
7889 "(7)."
7890 msgstr ""
7891 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
7892 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
7893 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
7894 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
7895 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
7896 "B<IP_RECVERR> を参照すること。"
7897
7898 #. type: Plain text
7899 #: build/C/man2/socket.2:314
7900 msgid ""
7901 "The operation of sockets is controlled by socket level I<options>.  These "
7902 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
7903 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
7904 "respectively."
7905 msgstr ""
7906 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
7907 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
7908 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
7909
7910 #. type: Plain text
7911 #: build/C/man2/socket.2:319
7912 msgid ""
7913 "On success, a file descriptor for the new socket is returned.  On error, -1 "
7914 "is returned, and I<errno> is set appropriately."
7915 msgstr ""
7916 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
7917 "した場合は -1 を返し、 I<errno> を適切に設定する。"
7918
7919 #. type: Plain text
7920 #: build/C/man2/socket.2:324
7921 msgid ""
7922 "Permission to create a socket of the specified type and/or protocol is "
7923 "denied."
7924 msgstr ""
7925 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
7926
7927 #. type: Plain text
7928 #: build/C/man2/socket.2:327
7929 msgid "The implementation does not support the specified address family."
7930 msgstr "指定されたアドレスファミリーがサポートされていない。"
7931
7932 #. type: Plain text
7933 #: build/C/man2/socket.2:330
7934 msgid "Unknown protocol, or protocol family not available."
7935 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
7936
7937 #.  Since Linux 2.6.27
7938 #. type: Plain text
7939 #: build/C/man2/socket.2:335
7940 msgid "Invalid flags in I<type>."
7941 msgstr "I<type> に無効なフラグが指定されている。"
7942
7943 #. type: Plain text
7944 #: build/C/man2/socket.2:338
7945 msgid "Process file table overflow."
7946 msgstr "プロセスのファイルテーブルが溢れている。"
7947
7948 #. type: TP
7949 #: build/C/man2/socket.2:341
7950 #, no-wrap
7951 msgid "B<ENOBUFS> or B<ENOMEM>"
7952 msgstr "B<ENOBUFS> または B<ENOMEM>"
7953
7954 #. type: Plain text
7955 #: build/C/man2/socket.2:346
7956 msgid ""
7957 "Insufficient memory is available.  The socket cannot be created until "
7958 "sufficient resources are freed."
7959 msgstr ""
7960 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
7961 "ない。"
7962
7963 #. type: TP
7964 #: build/C/man2/socket.2:346 build/C/man2/socketpair.2:92
7965 #, no-wrap
7966 msgid "B<EPROTONOSUPPORT>"
7967 msgstr "B<EPROTONOSUPPORT>"
7968
7969 #. type: Plain text
7970 #: build/C/man2/socket.2:350
7971 msgid ""
7972 "The protocol type or the specified protocol is not supported within this "
7973 "domain."
7974 msgstr ""
7975 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
7976 "いない。"
7977
7978 #. type: Plain text
7979 #: build/C/man2/socket.2:352
7980 msgid "Other errors may be generated by the underlying protocol modules."
7981 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
7982
7983 #. type: Plain text
7984 #: build/C/man2/socket.2:354
7985 msgid "4.4BSD, POSIX.1-2001."
7986 msgstr "4.4BSD, POSIX.1-2001."
7987
7988 #. type: Plain text
7989 #: build/C/man2/socket.2:360
7990 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
7991 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
7992
7993 #. type: Plain text
7994 #: build/C/man2/socket.2:366
7995 msgid ""
7996 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
7997 "systems supporting clones of the BSD socket layer (including System V "
7998 "variants)."
7999 msgstr ""
8000 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8001 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8002 "外のシステムからの移植ができる。"
8003
8004 #. type: Plain text
8005 #: build/C/man2/socket.2:385
8006 msgid ""
8007 "The manifest constants used under 4.x BSD for protocol families are "
8008 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8009 "are used for address families.  However, already the BSD man page promises: "
8010 "\"The protocol family generally is the same as the address family\", and "
8011 "subsequent standards use AF_* everywhere."
8012 msgstr ""
8013 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8014 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8015 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8016 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8017 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8018 "それ以外の規格では全ての場所で AF_* が使用されている。"
8019
8020 #. type: Plain text
8021 #: build/C/man2/socket.2:390
8022 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8023 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8024
8025 #. type: Plain text
8026 #: build/C/man2/socket.2:413
8027 msgid ""
8028 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8029 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8030 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8031 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8032 "(7), B<unix>(7)"
8033 msgstr ""
8034 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8035 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8036 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8037 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8038 "(7), B<unix>(7)"
8039
8040 #. type: Plain text
8041 #: build/C/man2/socket.2:419
8042 msgid ""
8043 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8044 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8045 "Programmer's Supplementary Documents Volume 1.>"
8046 msgstr "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and \\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's Supplementary Documents Volume 1.> として再版された)"
8047
8048 #. type: TH
8049 #: build/C/man7/socket.7:48
8050 #, no-wrap
8051 msgid "2013-03-15"
8052 msgstr "2013-03-15"
8053
8054 #. type: Plain text
8055 #: build/C/man7/socket.7:51
8056 msgid "socket - Linux socket interface"
8057 msgstr "socket - Linux のソケットインターフェース"
8058
8059 #. type: Plain text
8060 #: build/C/man7/socket.7:55
8061 msgid ""
8062 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8063 ">I<protocol>B<);>"
8064 msgstr ""
8065 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8066 ">I<protocol>B<);>"
8067
8068 #. type: Plain text
8069 #: build/C/man7/socket.7:74
8070 msgid ""
8071 "This manual page describes the Linux networking socket layer user "
8072 "interface.  The BSD compatible sockets are the uniform interface between the "
8073 "user process and the network protocol stacks in the kernel.  The protocol "
8074 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
8075 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
8076 "B<socket>(2)  for more information on families and types."
8077 msgstr ""
8078 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8079 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8080 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8081 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8082 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8083 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8084 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8085
8086 #. type: SS
8087 #: build/C/man7/socket.7:74
8088 #, no-wrap
8089 msgid "Socket-layer functions"
8090 msgstr "ソケット層の関数群"
8091
8092 #. type: Plain text
8093 #: build/C/man7/socket.7:78
8094 msgid ""
8095 "These functions are used by the user process to send or receive packets and "
8096 "to do other socket operations.  For more information see their respective "
8097 "manual pages."
8098 msgstr ""
8099 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8100 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8101
8102 #. type: Plain text
8103 #: build/C/man7/socket.7:94
8104 msgid ""
8105 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8106 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8107 "address, B<listen>(2)  tells the socket that new connections shall be "
8108 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8109 "connection.  B<socketpair>(2)  returns two connected anonymous sockets (only "
8110 "implemented for a few local families like B<AF_UNIX>)"
8111 msgstr ""
8112 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8113 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8114 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8115 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8116 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8117 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8118 "リーでしか実装されていない)。"
8119
8120 #. type: Plain text
8121 #: build/C/man7/socket.7:116
8122 msgid ""
8123 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8124 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8125 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8126 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8127 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8128 "write data."
8129 msgstr ""
8130 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8131 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8132 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8133 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8134 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8135 "ことができる。"
8136
8137 #. type: Plain text
8138 #: build/C/man7/socket.7:127
8139 msgid ""
8140 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8141 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8142 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8143 "be used to set or read some other options."
8144 msgstr ""
8145 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8146 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8147 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8148 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8149
8150 #. type: Plain text
8151 #: build/C/man7/socket.7:132
8152 msgid ""
8153 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8154 "full-duplex socket connection."
8155 msgstr ""
8156 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8157 "続を部分的にクローズする。"
8158
8159 #. type: Plain text
8160 #: build/C/man7/socket.7:138
8161 msgid ""
8162 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8163 "not supported on sockets."
8164 msgstr ""
8165 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8166 "ではサポートされていない。"
8167
8168 #. type: Plain text
8169 #: build/C/man7/socket.7:155
8170 msgid ""
8171 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8172 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8173 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8174 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8175 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8176 msgstr ""
8177 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8178 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8179 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8180 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8181 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8182 "B<select>(2)  を使って待つことができる。"
8183
8184 #. type: tbl table
8185 #: build/C/man7/socket.7:159
8186 #, no-wrap
8187 msgid "I/O events\n"
8188 msgstr "I/O イベント\n"
8189
8190 #. type: tbl table
8191 #: build/C/man7/socket.7:160
8192 #, no-wrap
8193 msgid "Event:Poll flag:Occurrence\n"
8194 msgstr "イベント:poll フラグ:内容\n"
8195
8196 #. type: tbl table
8197 #: build/C/man7/socket.7:161 build/C/man7/socket.7:164
8198 #, no-wrap
8199 msgid "Read:POLLIN:T{\n"
8200 msgstr "Read:POLLIN:T{\n"
8201
8202 #. type: tbl table
8203 #: build/C/man7/socket.7:162
8204 #, no-wrap
8205 msgid "New data arrived.\n"
8206 msgstr "新しいデータが到着した。\n"
8207
8208 #. type: tbl table
8209 #: build/C/man7/socket.7:165
8210 #, no-wrap
8211 msgid "A connection setup has been completed\n"
8212 msgstr "(接続志向のソケットで)\n"
8213
8214 #. type: tbl table
8215 #: build/C/man7/socket.7:166
8216 #, no-wrap
8217 msgid "(for connection-oriented sockets)\n"
8218 msgstr "接続の設定が終了した。\n"
8219
8220 #. type: tbl table
8221 #: build/C/man7/socket.7:168 build/C/man7/socket.7:171
8222 #, no-wrap
8223 msgid "Read:POLLHUP:T{\n"
8224 msgstr "Read:POLLHUP:T{\n"
8225
8226 #. type: tbl table
8227 #: build/C/man7/socket.7:169
8228 #, no-wrap
8229 msgid "A disconnection request has been initiated by the other end.\n"
8230 msgstr "接続先で切断要求が生成された。\n"
8231
8232 #. type: tbl table
8233 #: build/C/man7/socket.7:172
8234 #, no-wrap
8235 msgid "A connection is broken (only for connection-oriented protocols).\n"
8236 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8237
8238 #. type: tbl table
8239 #: build/C/man7/socket.7:173
8240 #, no-wrap
8241 msgid "When the socket is written\n"
8242 msgstr "この場合、ソケットに書き込みが行われると\n"
8243
8244 #. type: tbl table
8245 #: build/C/man7/socket.7:174
8246 #, no-wrap
8247 msgid "B<SIGPIPE>\n"
8248 msgstr "B<SIGPIPE>\n"
8249
8250 #. type: tbl table
8251 #: build/C/man7/socket.7:175
8252 #, no-wrap
8253 msgid "is also sent.\n"
8254 msgstr "も送信される。\n"
8255
8256 #. type: tbl table
8257 #: build/C/man7/socket.7:177
8258 #, no-wrap
8259 msgid "Write:POLLOUT:T{\n"
8260 msgstr "Write:POLLOUT:T{\n"
8261
8262 #. type: tbl table
8263 #: build/C/man7/socket.7:178
8264 #, no-wrap
8265 msgid "Socket has enough send buffer space for writing new data.\n"
8266 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
8267
8268 #. type: tbl table
8269 #: build/C/man7/socket.7:180
8270 #, no-wrap
8271 msgid "Read/Write:T{\n"
8272 msgstr "Read/Write:T{\n"
8273
8274 #. type: tbl table
8275 #: build/C/man7/socket.7:181
8276 #, no-wrap
8277 msgid "POLLIN|\n"
8278 msgstr "POLLIN|\n"
8279
8280 #. type: tbl table
8281 #: build/C/man7/socket.7:182
8282 #, no-wrap
8283 msgid ".br\n"
8284 msgstr ".br\n"
8285
8286 #. type: tbl table
8287 #: build/C/man7/socket.7:183
8288 #, no-wrap
8289 msgid "POLLOUT\n"
8290 msgstr "POLLOUT\n"
8291
8292 #. type: tbl table
8293 #: build/C/man7/socket.7:185
8294 #, no-wrap
8295 msgid "An outgoing\n"
8296 msgstr "外部向けの\n"
8297
8298 #. type: tbl table
8299 #: build/C/man7/socket.7:186
8300 #, no-wrap
8301 msgid "B<connect>(2)\n"
8302 msgstr "B<connect>(2)\n"
8303
8304 #. type: tbl table
8305 #: build/C/man7/socket.7:187
8306 #, no-wrap
8307 msgid "finished.\n"
8308 msgstr "が終了した。\n"
8309
8310 #. type: tbl table
8311 #: build/C/man7/socket.7:189
8312 #, no-wrap
8313 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8314 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8315
8316 #. type: tbl table
8317 #: build/C/man7/socket.7:190
8318 #, no-wrap
8319 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8320 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8321
8322 #. type: tbl table
8323 #: build/C/man7/socket.7:191
8324 #, no-wrap
8325 msgid "Exception:POLLPRI:T{\n"
8326 msgstr "Exception:POLLPRI:T{\n"
8327
8328 #. type: tbl table
8329 #: build/C/man7/socket.7:192
8330 #, no-wrap
8331 msgid "Urgent data arrived.\n"
8332 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8333
8334 #. type: tbl table
8335 #: build/C/man7/socket.7:193
8336 #, no-wrap
8337 msgid "B<SIGURG>\n"
8338 msgstr "B<SIGURG>\n"
8339
8340 #. type: tbl table
8341 #: build/C/man7/socket.7:194
8342 #, no-wrap
8343 msgid "is sent then.\n"
8344 msgstr "が送信される。\n"
8345
8346 #. type: Plain text
8347 #: build/C/man7/socket.7:223
8348 msgid ""
8349 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8350 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8351 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8352 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8353 "I<Signals> discussion below."
8354 msgstr ""
8355 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8356 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8357 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8358 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8359 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8360 "と。"
8361
8362 #. type: SS
8363 #: build/C/man7/socket.7:223
8364 #, no-wrap
8365 msgid "Socket address structures"
8366 msgstr ""
8367
8368 #. type: Plain text
8369 #: build/C/man7/socket.7:239
8370 msgid ""
8371 "Each socket domain has its own format for socket addresses, with a domain-"
8372 "specific address structure.  Each of these structures begins with an integer "
8373 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8374 "address structure.  This allows the various system calls (e.g., B<connect>"
8375 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8376 "are generic to all socket domains, to determine the domain of a particular "
8377 "socket address."
8378 msgstr ""
8379
8380 #. type: Plain text
8381 #: build/C/man7/socket.7:249
8382 msgid ""
8383 "To allow any type of socket address to be passed to interfaces in the "
8384 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8385 "type is purely to allow casting of domain-specific socket address types to a "
8386 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8387 "calls to the sockets API."
8388 msgstr ""
8389
8390 #. type: Plain text
8391 #: build/C/man7/socket.7:259
8392 msgid ""
8393 "In addition, the sockets API provides the data type I<struct "
8394 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8395 "domain-specific socket address structures; it is large enough and is aligned "
8396 "properly.  (In particular, it is large enough to hold IPv6 socket "
8397 "addresses.)  The structure includes the following field, which can be used "
8398 "to identify the type of socket address actually stored in the structure:"
8399 msgstr ""
8400
8401 #. type: Plain text
8402 #: build/C/man7/socket.7:263
8403 #, no-wrap
8404 msgid "    sa_family_t ss_family;\n"
8405 msgstr ""
8406
8407 #. type: Plain text
8408 #: build/C/man7/socket.7:271
8409 msgid ""
8410 "The I<sockaddr_storage> structure is useful in programs that must handle "
8411 "socket addresses in a generic way (e.g., programs that must deal with both "
8412 "IPv4 and IPv6 socket addresses)."
8413 msgstr ""
8414
8415 #. type: SS
8416 #: build/C/man7/socket.7:271
8417 #, no-wrap
8418 msgid "Socket options"
8419 msgstr "ソケットオプション"
8420
8421 #.  FIXME
8422 #.  In the list below, the text used to describe argument types
8423 #.  for each socket option should be more consistent
8424 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8425 #.  W R Stevens, UNPv1
8426 #. type: Plain text
8427 #: build/C/man7/socket.7:285
8428 msgid ""
8429 "These socket options can be set by using B<setsockopt>(2)  and read with "
8430 "B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for all sockets:"
8431 msgstr ""
8432 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
8433 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8434 "レベルには B<SOL_SOCKET> を指定すること。"
8435
8436 #. type: TP
8437 #: build/C/man7/socket.7:285
8438 #, no-wrap
8439 msgid "B<SO_ACCEPTCONN>"
8440 msgstr "B<SO_ACCEPTCONN>"
8441
8442 #. type: Plain text
8443 #: build/C/man7/socket.7:293
8444 msgid ""
8445 "Returns a value indicating whether or not this socket has been marked to "
8446 "accept connections with B<listen>(2).  The value 0 indicates that this is "
8447 "not a listening socket, the value 1 indicates that this is a listening "
8448 "socket.  This socket option is read-only."
8449 msgstr ""
8450 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
8451 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8452 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8453
8454 #. type: TP
8455 #: build/C/man7/socket.7:293
8456 #, no-wrap
8457 msgid "B<SO_BINDTODEVICE>"
8458 msgstr "B<SO_BINDTODEVICE>"
8459
8460 #. type: Plain text
8461 #: build/C/man7/socket.7:312
8462 msgid ""
8463 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8464 "the passed interface name.  If the name is an empty string or the option "
8465 "length is zero, the socket device binding is removed.  The passed option is "
8466 "a variable-length null-terminated interface name string with the maximum "
8467 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
8468 "received from that particular interface are processed by the socket.  Note "
8469 "that this only works for some socket types, particularly B<AF_INET> "
8470 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
8471 "there)."
8472 msgstr ""
8473 "このソケットを、引き数で渡したインターフェース名で指定される\n"
8474 "(\\(lqeth0\\(rq のような) 特定のデバイスにバインドする。\n"
8475 "名前が空文字列だったり、オプションの長さ (optlen) が 0 の場合には、\n"
8476 "ソケットのバインドが削除される。渡すオプションは、インターフェース名が\n"
8477 "入ったヌル文字で終端された可変長の文字列である。\n"
8478 "文字列の最大のサイズは B<IFNAMSIX> である。\n"
8479 "ソケットがインターフェースにバインドされると、その特定のインターフェース\n"
8480 "から受信されたパケットだけを処理する。\n"
8481 "このオプションはいくつかのソケットタイプ、\n"
8482 "特に B<AF_INET> に対してのみ動作する点に注意すること。\n"
8483 "パケットソケットではサポートされていない (通常の B<bind>(2) を使うこと)。"
8484
8485 #. type: Plain text
8486 #: build/C/man7/socket.7:326
8487 msgid ""
8488 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8489 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
8490 "argument should contain the buffer size available to receive the device name "
8491 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
8492 "reported back in the I<optlen> argument."
8493 msgstr ""
8494
8495 #. type: TP
8496 #: build/C/man7/socket.7:326
8497 #, no-wrap
8498 msgid "B<SO_BROADCAST>"
8499 msgstr "B<SO_BROADCAST>"
8500
8501 #. type: Plain text
8502 #: build/C/man7/socket.7:332
8503 msgid ""
8504 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
8505 "to send packets to a broadcast address.  This option has no effect on stream-"
8506 "oriented sockets."
8507 msgstr ""
8508 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
8509 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
8510 "ストリーム指向のソケットには何の効果もない。"
8511
8512 #. type: TP
8513 #: build/C/man7/socket.7:332
8514 #, no-wrap
8515 msgid "B<SO_BSDCOMPAT>"
8516 msgstr "B<SO_BSDCOMPAT>"
8517
8518 #. type: Plain text
8519 #: build/C/man7/socket.7:344
8520 msgid ""
8521 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
8522 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
8523 "socket will not be passed to the user program.  In later kernel versions, "
8524 "support for this option has been phased out: Linux 2.4 silently ignores it, "
8525 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
8526 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
8527 "header changing, skipping of the broadcast flag) for raw sockets with this "
8528 "option, but that was removed in Linux 2.2."
8529 msgstr ""
8530 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
8531 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
8532 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
8533 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
8534 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
8535 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
8536 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
8537 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
8538 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
8539
8540 #. type: TP
8541 #: build/C/man7/socket.7:344
8542 #, no-wrap
8543 msgid "B<SO_DEBUG>"
8544 msgstr "B<SO_DEBUG>"
8545
8546 #. type: Plain text
8547 #: build/C/man7/socket.7:350
8548 msgid ""
8549 "Enable socket debugging.  Only allowed for processes with the "
8550 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
8551 msgstr ""
8552 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
8553 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
8554
8555 #. type: TP
8556 #: build/C/man7/socket.7:350
8557 #, no-wrap
8558 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
8559 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
8560
8561 #. type: Plain text
8562 #: build/C/man7/socket.7:358
8563 msgid ""
8564 "Retrieves the socket domain as an integer, returning a value such as "
8565 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
8566 "only."
8567 msgstr ""
8568 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
8569 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8570
8571 #. type: TP
8572 #: build/C/man7/socket.7:358
8573 #, no-wrap
8574 msgid "B<SO_ERROR>"
8575 msgstr "B<SO_ERROR>"
8576
8577 #. type: Plain text
8578 #: build/C/man7/socket.7:363
8579 msgid ""
8580 "Get and clear the pending socket error.  This socket option is read-only.  "
8581 "Expects an integer."
8582 msgstr ""
8583 "保留になっていたソケットエラーを取得してクリアする。\n"
8584 "このソケットオプションは読み込み専用である。整数値をとる。"
8585
8586 #. type: TP
8587 #: build/C/man7/socket.7:363
8588 #, no-wrap
8589 msgid "B<SO_DONTROUTE>"
8590 msgstr "B<SO_DONTROUTE>"
8591
8592 #. type: Plain text
8593 #: build/C/man7/socket.7:372
8594 msgid ""
8595 "Don't send via a gateway, only send to directly connected hosts.  The same "
8596 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
8597 "B<send>(2)  operation.  Expects an integer boolean flag."
8598 msgstr ""
8599 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2)  操作"
8600 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
8601 "フラグを取る。"
8602
8603 #. type: TP
8604 #: build/C/man7/socket.7:372
8605 #, no-wrap
8606 msgid "B<SO_KEEPALIVE>"
8607 msgstr "B<SO_KEEPALIVE>"
8608
8609 #. type: Plain text
8610 #: build/C/man7/socket.7:376
8611 msgid ""
8612 "Enable sending of keep-alive messages on connection-oriented sockets.  "
8613 "Expects an integer boolean flag."
8614 msgstr ""
8615 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
8616 "の整数フラグをとる。"
8617
8618 #. type: TP
8619 #: build/C/man7/socket.7:376
8620 #, no-wrap
8621 msgid "B<SO_LINGER>"
8622 msgstr "B<SO_LINGER>"
8623
8624 #. type: Plain text
8625 #: build/C/man7/socket.7:384
8626 msgid ""
8627 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
8628 msgstr ""
8629 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
8630
8631 #. type: Plain text
8632 #: build/C/man7/socket.7:391
8633 #, no-wrap
8634 msgid ""
8635 "struct linger {\n"
8636 "    int l_onoff;    /* linger active */\n"
8637 "    int l_linger;   /* how many seconds to linger for */\n"
8638 "};\n"
8639 msgstr ""
8640 "struct linger {\n"
8641 "    int l_onoff;    /* linger active */\n"
8642 "    int l_linger;   /* how many seconds to linger for */\n"
8643 "};\n"
8644
8645 #. type: Plain text
8646 #: build/C/man7/socket.7:405
8647 msgid ""
8648 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
8649 "queued messages for the socket have been successfully sent or the linger "
8650 "timeout has been reached.  Otherwise, the call returns immediately and the "
8651 "closing is done in the background.  When the socket is closed as part of "
8652 "B<exit>(2), it always lingers in the background."
8653 msgstr ""
8654 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
8655 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
8656 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
8657 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
8658 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
8659 "送られる。"
8660
8661 #. type: TP
8662 #: build/C/man7/socket.7:405
8663 #, no-wrap
8664 msgid "B<SO_MARK> (since Linux 2.6.25)"
8665 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
8666
8667 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
8668 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
8669 #. type: Plain text
8670 #: build/C/man7/socket.7:416
8671 msgid ""
8672 "Set the mark for each packet sent through this socket (similar to the "
8673 "netfilter MARK target but socket-based).  Changing the mark can be used for "
8674 "mark-based routing without netfilter or for packet filtering.  Setting this "
8675 "option requires the B<CAP_NET_ADMIN> capability."
8676 msgstr ""
8677
8678 #. type: TP
8679 #: build/C/man7/socket.7:416
8680 #, no-wrap
8681 msgid "B<SO_OOBINLINE>"
8682 msgstr "B<SO_OOBINLINE>"
8683
8684 #.  don't document it because it can do too much harm.
8685 #. .B SO_NO_CHECK
8686 #. type: Plain text
8687 #: build/C/man7/socket.7:425
8688 msgid ""
8689 "If this option is enabled, out-of-band data is directly placed into the "
8690 "receive data stream.  Otherwise out-of-band data is only passed when the "
8691 "B<MSG_OOB> flag is set during receiving."
8692 msgstr ""
8693 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
8694 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
8695 "ラグがセットされている場合に限って渡される。"
8696
8697 #. type: TP
8698 #: build/C/man7/socket.7:425
8699 #, no-wrap
8700 msgid "B<SO_PASSCRED>"
8701 msgstr "B<SO_PASSCRED>"
8702
8703 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8704 #.  in the 2.6.18 ChangeLog
8705 #. type: Plain text
8706 #: build/C/man7/socket.7:434
8707 msgid ""
8708 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
8709 "For more information see B<unix>(7)."
8710 msgstr ""
8711 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
8712 "を参照のこと。"
8713
8714 #. type: TP
8715 #: build/C/man7/socket.7:434
8716 #, no-wrap
8717 msgid "B<SO_PEERCRED>"
8718 msgstr "B<SO_PEERCRED>"
8719
8720 #. type: Plain text
8721 #: build/C/man7/socket.7:457
8722 #, fuzzy
8723 #| msgid ""
8724 #| "Return the credentials of the foreign process connected to this socket.  "
8725 #| "This is only possible for connected B<AF_UNIX> stream sockets and "
8726 #| "B<AF_UNIX> stream and datagram socket pairs created using B<socketpair>"
8727 #| "(2); see B<unix>(7).  The returned credentials are those that were in "
8728 #| "effect at the time of the call to B<connect>(2)  or B<socketpair>(2).  "
8729 #| "Argument is a I<ucred> structure.  This socket option is read-only."
8730 msgid ""
8731 "Return the credentials of the foreign process connected to this socket.  "
8732 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
8733 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
8734 "(7).  The returned credentials are those that were in effect at the time of "
8735 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
8736 "structure; define the B<GNU_SOURCE> feature test macro to obtain the "
8737 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
8738 "option is read-only."
8739 msgstr ""
8740 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。\n"
8741 "このソケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソ"
8742 "ケット間、\n"
8743 "および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケット"
8744 "と\n"
8745 "データグラムソケットのペアだけである。\n"
8746 "B<unix>(7)  を参照のこと。\n"
8747 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
8748 "る。\n"
8749 "引き数は I<ucred> 構造体である。\n"
8750 "このソケットオプションは読み込み専用である。"
8751
8752 #. type: TP
8753 #: build/C/man7/socket.7:457
8754 #, no-wrap
8755 msgid "B<SO_PRIORITY>"
8756 msgstr "B<SO_PRIORITY>"
8757
8758 #. type: Plain text
8759 #: build/C/man7/socket.7:470
8760 msgid ""
8761 "Set the protocol-defined priority for all packets to be sent on this "
8762 "socket.  Linux uses this value to order the networking queues: packets with "
8763 "a higher priority may be processed first depending on the selected device "
8764 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
8765 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
8766 "6 requires the B<CAP_NET_ADMIN> capability."
8767 msgstr ""
8768 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
8769 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
8770 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
8771 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
8772 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
8773 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
8774
8775 #. type: TP
8776 #: build/C/man7/socket.7:470
8777 #, no-wrap
8778 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
8779 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
8780
8781 #. type: Plain text
8782 #: build/C/man7/socket.7:478
8783 msgid ""
8784 "Retrieves the socket protocol as an integer, returning a value such as "
8785 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
8786 "only."
8787 msgstr ""
8788 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
8789 "る。\n"
8790 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8791
8792 #. type: TP
8793 #: build/C/man7/socket.7:478
8794 #, no-wrap
8795 msgid "B<SO_RCVBUF>"
8796 msgstr "B<SO_RCVBUF>"
8797
8798 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8799 #.  The following thread on LMKL is quite informative:
8800 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
8801 #.  17 July 2012
8802 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
8803 #. type: Plain text
8804 #: build/C/man7/socket.7:497
8805 msgid ""
8806 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
8807 "this value (to allow space for bookkeeping overhead)  when it is set using "
8808 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8809 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
8810 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
8811 "file.  The minimum (doubled) value for this option is 256."
8812 msgstr ""
8813 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
8814 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8815 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8816 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
8817 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
8818 "る。 このオプションの最小値は (2倍した値で) 256 である。"
8819
8820 #. type: TP
8821 #: build/C/man7/socket.7:497
8822 #, no-wrap
8823 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
8824 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
8825
8826 #. type: Plain text
8827 #: build/C/man7/socket.7:506
8828 msgid ""
8829 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8830 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
8831 "overridden."
8832 msgstr ""
8833 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8834 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
8835 "きすることができる。"
8836
8837 #. type: TP
8838 #: build/C/man7/socket.7:506
8839 #, no-wrap
8840 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
8841 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
8842
8843 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
8844 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
8845 #. type: Plain text
8846 #: build/C/man7/socket.7:535
8847 msgid ""
8848 "Specify the minimum number of bytes in the buffer until the socket layer "
8849 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
8850 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
8851 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
8852 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
8853 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
8854 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
8855 "single byte of data is available.  A subsequent read from the socket will "
8856 "block until B<SO_RCVLOWAT> bytes are available."
8857 msgstr ""
8858 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
8859 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
8860 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
8861 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
8862 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
8863 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
8864 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
8865 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
8866 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
8867 "してしまう。"
8868
8869 #. type: TP
8870 #: build/C/man7/socket.7:535
8871 #, no-wrap
8872 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
8873 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
8874
8875 #.  Not implemented in 2.0.
8876 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
8877 #.  Implemented in 2.3.41 for setsockopt, and actually used.
8878 #.  in fact to EAGAIN
8879 #. type: Plain text
8880 #: build/C/man7/socket.7:570
8881 msgid ""
8882 "Specify the receiving or sending timeouts until reporting an error.  The "
8883 "argument is a I<struct timeval>.  If an input or output function blocks for "
8884 "this period of time, and data has been sent or received, the return value of "
8885 "that function will be the amount of data transferred; if no data has been "
8886 "transferred and the timeout has been reached then -1 is returned with "
8887 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
8888 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
8889 "the timeout is set to zero (the default)  then the operation will never "
8890 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
8891 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
8892 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
8893 msgstr "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
8894
8895 #. type: TP
8896 #: build/C/man7/socket.7:570
8897 #, no-wrap
8898 msgid "B<SO_REUSEADDR>"
8899 msgstr "B<SO_REUSEADDR>"
8900
8901 #. type: Plain text
8902 #: build/C/man7/socket.7:585
8903 msgid ""
8904 "Indicates that the rules used in validating addresses supplied in a B<bind>"
8905 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
8906 "this means that a socket may bind, except when there is an active listening "
8907 "socket bound to the address.  When the listening socket is bound to "
8908 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
8909 "port for any local address.  Argument is an integer boolean flag."
8910 msgstr ""
8911 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
8912 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
8913 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
8914 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
8915 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
8916 "ドできない。 引き数はブール整数のフラグである。"
8917
8918 #. type: TP
8919 #: build/C/man7/socket.7:585
8920 #, no-wrap
8921 msgid "B<SO_SNDBUF>"
8922 msgstr "B<SO_SNDBUF>"
8923
8924 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8925 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
8926 #. type: Plain text
8927 #: build/C/man7/socket.7:601
8928 msgid ""
8929 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
8930 "this value (to allow space for bookkeeping overhead)  when it is set using "
8931 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8932 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
8933 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
8934 "file.  The minimum (doubled) value for this option is 2048."
8935 msgstr ""
8936 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
8937 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8938 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8939 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
8940 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
8941 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
8942
8943 #. type: TP
8944 #: build/C/man7/socket.7:601
8945 #, no-wrap
8946 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
8947 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
8948
8949 #. type: Plain text
8950 #: build/C/man7/socket.7:610
8951 msgid ""
8952 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8953 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
8954 "overridden."
8955 msgstr ""
8956 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8957 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
8958 "きすることができる。"
8959
8960 #. type: TP
8961 #: build/C/man7/socket.7:610
8962 #, no-wrap
8963 msgid "B<SO_TIMESTAMP>"
8964 msgstr "B<SO_TIMESTAMP>"
8965
8966 #. type: Plain text
8967 #: build/C/man7/socket.7:626
8968 msgid ""
8969 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
8970 "timestamp control message is sent with level B<SOL_SOCKET> and the "
8971 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
8972 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
8973 "details on control messages."
8974 msgstr ""
8975 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
8976 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
8977 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
8978 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
8979
8980 #. type: TP
8981 #: build/C/man7/socket.7:626
8982 #, no-wrap
8983 msgid "B<SO_TYPE>"
8984 msgstr "B<SO_TYPE>"
8985
8986 #. type: Plain text
8987 #: build/C/man7/socket.7:631
8988 msgid ""
8989 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
8990 "option is read-only."
8991 msgstr ""
8992 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
8993 "このソケットオプションは読み出し専用である。"
8994
8995 #. type: SS
8996 #: build/C/man7/socket.7:631
8997 #, no-wrap
8998 msgid "Signals"
8999 msgstr "シグナル"
9000
9001 #. type: Plain text
9002 #: build/C/man7/socket.7:642
9003 msgid ""
9004 "When writing onto a connection-oriented socket that has been shut down (by "
9005 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9006 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9007 "the B<MSG_NOSIGNAL> flag."
9008 msgstr ""
9009 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9010 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9011 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9012 "していた場合はシグナルは送られない。"
9013
9014 #. type: Plain text
9015 #: build/C/man7/socket.7:667
9016 msgid ""
9017 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9018 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9019 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9020 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9021 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9022 "signal will be called with the file descriptor in the I<si_fd> field of its "
9023 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9024 msgstr ""
9025 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9026 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9027 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9028 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9029 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9030 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9031 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9032 "を参照のこと。"
9033
9034 #.  .SS Ancillary messages
9035 #. type: Plain text
9036 #: build/C/man7/socket.7:675
9037 msgid ""
9038 "Under some circumstances (e.g., multiple processes accessing a single "
9039 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9040 "when the process reacts to the signal.  If this happens, the process should "
9041 "wait again because Linux will resend the signal later."
9042 msgstr ""
9043 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9044 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9045 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9046 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9047
9048 #. type: SS
9049 #: build/C/man7/socket.7:675
9050 #, no-wrap
9051 msgid "/proc interfaces"
9052 msgstr "/proc インタフェース"
9053
9054 #. type: Plain text
9055 #: build/C/man7/socket.7:679
9056 msgid ""
9057 "The core socket networking parameters can be accessed via files in the "
9058 "directory I</proc/sys/net/core/>."
9059 msgstr ""
9060 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9061 "レクトリ内のファイルを通してアクセスできる。"
9062
9063 #. type: TP
9064 #: build/C/man7/socket.7:679
9065 #, no-wrap
9066 msgid "I<rmem_default>"
9067 msgstr "I<rmem_default>"
9068
9069 #. type: Plain text
9070 #: build/C/man7/socket.7:682
9071 msgid "contains the default setting in bytes of the socket receive buffer."
9072 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9073
9074 #. type: TP
9075 #: build/C/man7/socket.7:682
9076 #, no-wrap
9077 msgid "I<rmem_max>"
9078 msgstr "I<rmem_max>"
9079
9080 #. type: Plain text
9081 #: build/C/man7/socket.7:688
9082 msgid ""
9083 "contains the maximum socket receive buffer size in bytes which a user may "
9084 "set by using the B<SO_RCVBUF> socket option."
9085 msgstr ""
9086 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9087 "ファサイズの最大値 (バイト単位)。"
9088
9089 #. type: TP
9090 #: build/C/man7/socket.7:688
9091 #, no-wrap
9092 msgid "I<wmem_default>"
9093 msgstr "I<wmem_default>"
9094
9095 #. type: Plain text
9096 #: build/C/man7/socket.7:691
9097 msgid "contains the default setting in bytes of the socket send buffer."
9098 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9099
9100 #. type: TP
9101 #: build/C/man7/socket.7:691
9102 #, no-wrap
9103 msgid "I<wmem_max>"
9104 msgstr "I<wmem_max>"
9105
9106 #. type: Plain text
9107 #: build/C/man7/socket.7:697
9108 msgid ""
9109 "contains the maximum socket send buffer size in bytes which a user may set "
9110 "by using the B<SO_SNDBUF> socket option."
9111 msgstr ""
9112 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9113 "ファサイズの最大値 (バイト単位)。"
9114
9115 #. type: TP
9116 #: build/C/man7/socket.7:697
9117 #, no-wrap
9118 msgid "I<message_cost> and I<message_burst>"
9119 msgstr "I<message_cost> と I<message_burst>"
9120
9121 #. type: Plain text
9122 #: build/C/man7/socket.7:701
9123 msgid ""
9124 "configure the token bucket filter used to load limit warning messages caused "
9125 "by external network events."
9126 msgstr ""
9127 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9128 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9129
9130 #. type: TP
9131 #: build/C/man7/socket.7:701
9132 #, no-wrap
9133 msgid "I<netdev_max_backlog>"
9134 msgstr "I<netdev_max_backlog>"
9135
9136 #. type: Plain text
9137 #: build/C/man7/socket.7:704
9138 msgid "Maximum number of packets in the global input queue."
9139 msgstr "グローバルな入力キューにおける最大のパケット数。"
9140
9141 #. type: TP
9142 #: build/C/man7/socket.7:704
9143 #, no-wrap
9144 msgid "I<optmem_max>"
9145 msgstr "I<optmem_max>"
9146
9147 #.  netdev_fastroute is not documented because it is experimental
9148 #. type: Plain text
9149 #: build/C/man7/socket.7:709
9150 msgid ""
9151 "Maximum length of ancillary data and user control data like the iovecs per "
9152 "socket."
9153 msgstr ""
9154 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9155 "うなもの) との和の最大長。"
9156
9157 #. type: SS
9158 #: build/C/man7/socket.7:709
9159 #, no-wrap
9160 msgid "Ioctls"
9161 msgstr "ioctl"
9162
9163 #. type: Plain text
9164 #: build/C/man7/socket.7:712
9165 msgid "These operations can be accessed using B<ioctl>(2):"
9166 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9167
9168 #. type: Plain text
9169 #: build/C/man7/socket.7:716
9170 #, no-wrap
9171 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9172 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9173
9174 #. type: TP
9175 #: build/C/man7/socket.7:718
9176 #, no-wrap
9177 msgid "B<SIOCGSTAMP>"
9178 msgstr "B<SIOCGSTAMP>"
9179
9180 #. type: Plain text
9181 #: build/C/man7/socket.7:742
9182 msgid ""
9183 "Return a I<struct timeval> with the receive timestamp of the last packet "
9184 "passed to the user.  This is useful for accurate round trip time "
9185 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9186 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
9187 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9188 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9189 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9190 "to B<ENOENT>)."
9191 msgstr ""
9192 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9193 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9194 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9195 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9196 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9197 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9198 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9199 "セットする)。"
9200
9201 #. type: TP
9202 #: build/C/man7/socket.7:742
9203 #, no-wrap
9204 msgid "B<SIOCSPGRP>"
9205 msgstr "B<SIOCSPGRP>"
9206
9207 #. type: Plain text
9208 #: build/C/man7/socket.7:761
9209 msgid ""
9210 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9211 "when an asynchronous I/O operation has finished or urgent data is "
9212 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9213 "positive, send the signals to that process.  If the argument is negative, "
9214 "send the signals to the process group with the ID of the absolute value of "
9215 "the argument.  The process may only choose itself or its own process group "
9216 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9217 "UID of 0."
9218 msgstr ""
9219 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9220 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9221 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9222 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9223 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9224 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9225 "の場合は この限りではない。"
9226
9227 #. type: TP
9228 #: build/C/man7/socket.7:761
9229 #, no-wrap
9230 msgid "B<FIOASYNC>"
9231 msgstr "B<FIOASYNC>"
9232
9233 #. type: Plain text
9234 #: build/C/man7/socket.7:771
9235 msgid ""
9236 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9237 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9238 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9239 msgstr ""
9240 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9241 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9242 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9243
9244 #. type: Plain text
9245 #: build/C/man7/socket.7:779
9246 msgid ""
9247 "Argument is an integer boolean flag.  (This operation is synonymous with the "
9248 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
9249 msgstr ""
9250 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
9251 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9252
9253 #. type: TP
9254 #: build/C/man7/socket.7:779
9255 #, no-wrap
9256 msgid "B<SIOCGPGRP>"
9257 msgstr "B<SIOCGPGRP>"
9258
9259 #. type: Plain text
9260 #: build/C/man7/socket.7:788
9261 msgid ""
9262 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9263 "signals, or 0 when none is set."
9264 msgstr ""
9265 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9266 "る。 ない場合は 0 が返る。"
9267
9268 #. type: Plain text
9269 #: build/C/man7/socket.7:792
9270 msgid "Valid B<fcntl>(2)  operations:"
9271 msgstr "有効な B<fcntl>(2)  操作:"
9272
9273 #. type: TP
9274 #: build/C/man7/socket.7:792
9275 #, no-wrap
9276 msgid "B<FIOGETOWN>"
9277 msgstr "B<FIOGETOWN>"
9278
9279 #. type: Plain text
9280 #: build/C/man7/socket.7:797
9281 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9282 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
9283
9284 #. type: TP
9285 #: build/C/man7/socket.7:797
9286 #, no-wrap
9287 msgid "B<FIOSETOWN>"
9288 msgstr "B<FIOSETOWN>"
9289
9290 #. type: Plain text
9291 #: build/C/man7/socket.7:802
9292 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9293 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
9294
9295 #. type: Plain text
9296 #: build/C/man7/socket.7:816
9297 msgid ""
9298 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
9299 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
9300 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
9301 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9302 "be read or written."
9303 msgstr ""
9304 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9305 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9306 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9307 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9308 "はできなかった。"
9309
9310 #. type: Plain text
9311 #: build/C/man7/socket.7:821
9312 msgid ""
9313 "Linux assumes that half of the send/receive buffer is used for internal "
9314 "kernel structures; thus the values in the corresponding I</proc> files are "
9315 "twice what can be observed on the wire."
9316 msgstr ""
9317 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
9318 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
9319 "なる。"
9320
9321 #. type: Plain text
9322 #: build/C/man7/socket.7:834
9323 msgid ""
9324 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
9325 "option was set both in the previous program that performed a B<bind>(2)  to "
9326 "the port and in the program that wants to reuse the port.  This differs from "
9327 "some implementations (e.g., FreeBSD)  where only the later program needs to "
9328 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
9329 "since, for example, a server program is designed to always set this option."
9330 msgstr ""
9331 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
9332 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
9333 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
9334 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
9335 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
9336 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
9337 "このオプションをセットするように設計されるからである。"
9338
9339 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
9340 #.  .SH AUTHORS
9341 #.  This man page was written by Andi Kleen.
9342 #. type: Plain text
9343 #: build/C/man7/socket.7:847
9344 msgid ""
9345 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
9346 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
9347 "is via the libpcap library."
9348 msgstr ""
9349 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
9350 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
9351 "して 用いる方が良い。"
9352
9353 #. type: Plain text
9354 #: build/C/man7/socket.7:859
9355 msgid ""
9356 "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), "
9357 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9358 "B<unix>(7)"
9359 msgstr "B<getsockopt>(2), B<connect>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
9360
9361 #. type: TH
9362 #: build/C/man2/socketcall.2:25
9363 #, no-wrap
9364 msgid "SOCKETCALL"
9365 msgstr "SOCKETCALL"
9366
9367 #. type: TH
9368 #: build/C/man2/socketcall.2:25
9369 #, no-wrap
9370 msgid "2012-10-16"
9371 msgstr "2012-10-16"
9372
9373 #. type: Plain text
9374 #: build/C/man2/socketcall.2:28
9375 msgid "socketcall - socket system calls"
9376 msgstr "socketcall - ソケット・システムコール"
9377
9378 #. type: Plain text
9379 #: build/C/man2/socketcall.2:30
9380 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9381 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
9382
9383 #. type: Plain text
9384 #: build/C/man2/socketcall.2:38
9385 msgid ""
9386 "B<socketcall>()  is a common kernel entry point for the socket system "
9387 "calls.  I<call> determines which socket function to invoke.  I<args> points "
9388 "to a block containing the actual arguments, which are passed through to the "
9389 "appropriate call."
9390 msgstr ""
9391 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
9392 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
9393 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
9394 "ロックを指す。"
9395
9396 #. type: Plain text
9397 #: build/C/man2/socketcall.2:42
9398 msgid ""
9399 "User programs should call the appropriate functions by their usual names.  "
9400 "Only standard library implementors and kernel hackers need to know about "
9401 "B<socketcall>()."
9402 msgstr ""
9403 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
9404 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
9405 "必要がある。"
9406
9407 #. type: Plain text
9408 #: build/C/man2/socketcall.2:45
9409 msgid ""
9410 "This call is specific to Linux, and should not be used in programs intended "
9411 "to be portable."
9412 msgstr ""
9413 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
9414 "い。"
9415
9416 #. type: Plain text
9417 #: build/C/man2/socketcall.2:53
9418 msgid ""
9419 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
9420 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
9421 "(2), and so on really are implemented as separate system calls."
9422 msgstr "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システムコール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
9423
9424 #. type: Plain text
9425 #: build/C/man2/socketcall.2:71
9426 msgid ""
9427 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9428 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9429 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9430 "(2), B<socket>(2), B<socketpair>(2)"
9431 msgstr ""
9432 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
9433 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
9434 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
9435 "(2), B<socket>(2), B<socketpair>(2)"
9436
9437 #. type: TH
9438 #: build/C/man2/socketpair.2:42
9439 #, no-wrap
9440 msgid "SOCKETPAIR"
9441 msgstr "SOCKETPAIR"
9442
9443 #. type: TH
9444 #: build/C/man2/socketpair.2:42
9445 #, no-wrap
9446 msgid "2008-10-11"
9447 msgstr "2008-10-11"
9448
9449 #. type: Plain text
9450 #: build/C/man2/socketpair.2:45
9451 msgid "socketpair - create a pair of connected sockets"
9452 msgstr "socketpair - 接続されたソケットのペアを作成する"
9453
9454 #. type: Plain text
9455 #: build/C/man2/socketpair.2:52
9456 msgid ""
9457 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9458 ">I<sv>B<[2]);>"
9459 msgstr ""
9460 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
9461 ">I<sv>B<[2]);>"
9462
9463 #. type: Plain text
9464 #: build/C/man2/socketpair.2:63
9465 msgid ""
9466 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
9467 "the specified I<domain>, of the specified I<type>, and using the optionally "
9468 "specified I<protocol>.  For further details of these arguments, see B<socket>"
9469 "(2)."
9470 msgstr ""
9471 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
9472 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
9473 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
9474
9475 #. type: Plain text
9476 #: build/C/man2/socketpair.2:69
9477 msgid ""
9478 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
9479 "and I<sv>[1].  The two sockets are indistinguishable."
9480 msgstr ""
9481 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
9482 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
9483
9484 #. type: Plain text
9485 #: build/C/man2/socketpair.2:78
9486 msgid "The specified address family is not supported on this machine."
9487 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
9488
9489 #. type: Plain text
9490 #: build/C/man2/socketpair.2:83
9491 msgid ""
9492 "The address I<sv> does not specify a valid part of the process address space."
9493 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
9494
9495 #. type: Plain text
9496 #: build/C/man2/socketpair.2:86
9497 msgid "Too many descriptors are in use by this process."
9498 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
9499
9500 #. type: Plain text
9501 #: build/C/man2/socketpair.2:92
9502 msgid "The specified protocol does not support creation of socket pairs."
9503 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
9504
9505 #. type: Plain text
9506 #: build/C/man2/socketpair.2:95
9507 msgid "The specified protocol is not supported on this machine."
9508 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
9509
9510 #. type: Plain text
9511 #: build/C/man2/socketpair.2:103
9512 msgid ""
9513 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
9514 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
9515 "of the BSD socket layer (including System V variants)."
9516 msgstr ""
9517 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
9518 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
9519 "BSD 以外のシステムと、 互いに移植性がある。"
9520
9521 #. type: Plain text
9522 #: build/C/man2/socketpair.2:109
9523 msgid ""
9524 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
9525 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
9526 "restriction.)"
9527 msgstr ""
9528 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
9529 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
9530
9531 #. type: Plain text
9532 #: build/C/man2/socketpair.2:118
9533 msgid ""
9534 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
9535 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
9536 msgstr ""
9537 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
9538 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
9539
9540 #. type: Plain text
9541 #: build/C/man2/socketpair.2:131
9542 msgid ""
9543 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9544 msgstr ""
9545 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
9546
9547 #~ msgid "2011-09-16"
9548 #~ msgstr "2011-09-16"
9549
9550 #~ msgid "B<MSG_WAITFORONE>"
9551 #~ msgstr "B<MSG_WAITFORONE>"
9552
9553 #~ msgid "2010-06-10"
9554 #~ msgstr "2010-06-10"
9555
9556 #~ msgid ""
9557 #~ "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
9558 #~ "Programmer's Supplementary Documents Volume 1.>"
9559 #~ msgstr ""
9560 #~ "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
9561 #~ "Supplementary Documents Volume 1> として再版された。"
9562
9563 #~ msgid "2007-06-28"
9564 #~ msgstr "2007-06-28"
9565
9566 #~ msgid "2011-10-04"
9567 #~ msgstr "2011-10-04"
9568
9569 #~ msgid "2010-08-31"
9570 #~ msgstr "2010-08-31"
9571
9572 #~ msgid "2010-06-13"
9573 #~ msgstr "2010-06-13"
9574
9575 #~ msgid "RETURN VALUES"
9576 #~ msgstr "RETURN VALUES"