OSDN Git Service

Update editorical changes
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2015-02-04 23:31+0900\n"
10 "PO-Revision-Date: 2015-02-05 00:10+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:58 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:59
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
77
78 #. type: SH
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:61
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
89 #, no-wrap
90 msgid "SYNOPSIS"
91 msgstr "書式"
92
93 #. type: Plain text
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
95 #, no-wrap
96 msgid ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
102
103 #. type: Plain text
104 #: build/C/man2/accept.2:50
105 #, no-wrap
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
108
109 #. type: Plain text
110 #: build/C/man2/accept.2:53
111 #, no-wrap
112 msgid ""
113 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115 msgstr ""
116 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
118
119 #. type: Plain text
120 #: build/C/man2/accept.2:56
121 #, no-wrap
122 msgid ""
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
125 msgstr ""
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
128
129 #. type: SH
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:65
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "説明"
143
144 #. type: Plain text
145 #: build/C/man2/accept.2:72
146 msgid ""
147 "The B<accept>()  system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket.  The newly created socket is not in the listening "
152 "state.  The original socket I<sockfd> is unaffected by this call."
153 msgstr ""
154 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイルディスクリプ"
158 "ターを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 も"
159 "ともとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
160
161 #. type: Plain text
162 #: build/C/man2/accept.2:81
163 msgid ""
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
167 msgstr ""
168 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
170 "である。"
171
172 #. type: Plain text
173 #: build/C/man2/accept.2:99
174 msgid ""
175 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer.  The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2)  and the "
179 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
181 msgstr ""
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインターである。 この構造体には接続"
183 "相手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確"
184 "なフォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  および"
185 "それぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> "
186 "には何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にし"
187 "ておくべきである。"
188
189 #. type: Plain text
190 #: build/C/man2/accept.2:107
191 msgid ""
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
195 msgstr ""
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
199
200 #. type: Plain text
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
202 msgid ""
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
205 "call."
206 msgstr ""
207 "渡されたバッファーが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
208 "る。\n"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
210 "される。"
211
212 #. type: Plain text
213 #: build/C/man2/accept.2:125
214 msgid ""
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
217 "present.  If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
219 "B<EWOULDBLOCK>."
220 msgstr ""
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
225
226 #. type: Plain text
227 #: build/C/man2/accept.2:139
228 msgid ""
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>()  to get a socket "
232 "for that connection.  Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
234 msgstr ""
235 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
240
241 #. type: Plain text
242 #: build/C/man2/accept.2:152
243 msgid ""
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation.  Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket.  Currently only DECNet has these "
249 "semantics on Linux."
250 msgstr ""
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイルディスクリプターに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
257
258 #. type: Plain text
259 #: build/C/man2/accept.2:162
260 msgid ""
261 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
263 "behavior:"
264 msgstr ""
265 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
267 "できる。"
268
269 #. type: TP
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2:165
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:173
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:173
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:183
294 msgid ""
295 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
296 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
297 "may be useful."
298 msgstr ""
299 "新しいファイルディスクリプターに対して close-on-exec (B<FD_CLOEXEC>)  フラグ"
300 "をセットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
301 "B<O_CLOEXEC> フラグの説明を参照のこと。"
302
303 #. type: SH
304 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
305 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
306 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
307 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
308 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
309 #: build/C/man2/recv.2:408 build/C/man2/recvmmsg.2:148
310 #: build/C/man2/select.2:300 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:294 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:315
313 #: build/C/man2/socketpair.2:69
314 #, no-wrap
315 msgid "RETURN VALUE"
316 msgstr "返り値"
317
318 #. type: Plain text
319 #: build/C/man2/accept.2:187
320 msgid ""
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
323 "is set appropriately."
324 msgstr ""
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプターで"
326 "ある非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に"
327 "設定する。"
328
329 #. type: SS
330 #: build/C/man2/accept.2:187
331 #, no-wrap
332 msgid "Error handling"
333 msgstr "エラー処理"
334
335 #. type: Plain text
336 #: build/C/man2/accept.2:214
337 msgid ""
338 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
339 "on the new socket as an error code from B<accept>().  This behavior differs "
340 "from other BSD socket implementations.  For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
345 msgstr ""
346 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
353 "B<ENETUNREACH>"
354
355 #. type: SH
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:424 build/C/man2/recvmmsg.2:156
362 #: build/C/man2/select.2:318 build/C/man2/send.2:299
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:320 build/C/man2/socketpair.2:74
365 #, no-wrap
366 msgid "ERRORS"
367 msgstr "エラー"
368
369 #. type: TP
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:429 build/C/man2/send.2:315
371 #, no-wrap
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
374
375 #.  Actually EAGAIN on Linux
376 #. type: Plain text
377 #: build/C/man2/accept.2:223
378 msgid ""
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
383 msgstr ""
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
388
389 #. type: TP
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:176
391 #: build/C/man2/connect.2:176 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:104
393 #: build/C/man2/recv.2:438 build/C/man2/select.2:319 build/C/man2/send.2:336
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプターが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:208
417 #: build/C/man2/connect.2:182 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:447
419 #: build/C/man2/send.2:345 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザーアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:210
432 #: build/C/man2/recv.2:451 build/C/man2/select.2:324 build/C/man2/send.2:348
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:180
448 #: build/C/man2/bind.2:185 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:456
450 #: build/C/man2/recvmmsg.2:160 build/C/man2/select.2:328
451 #: build/C/man2/select.2:335 build/C/man2/send.2:352
452 #: build/C/man3/sockatmark.3:63 build/C/man2/socket.2:328
453 #: build/C/man2/socket.2:331
454 #, no-wrap
455 msgid "B<EINVAL>"
456 msgstr "B<EINVAL>"
457
458 #. type: Plain text
459 #: build/C/man2/accept.2:244
460 msgid ""
461 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
462 "negative)."
463 msgstr ""
464 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
465 "負の場合など)。"
466
467 #. type: Plain text
468 #: build/C/man2/accept.2:249
469 msgid "(B<accept4>())  invalid value in I<flags>."
470 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
471
472 #. type: TP
473 #: build/C/man2/accept.2:249 build/C/man2/socket.2:336
474 #: build/C/man2/socketpair.2:83
475 #, no-wrap
476 msgid "B<EMFILE>"
477 msgstr "B<EMFILE>"
478
479 #. type: Plain text
480 #: build/C/man2/accept.2:252
481 msgid "The per-process limit of open file descriptors has been reached."
482 msgstr "1プロセスがオープンできるファイルディスクリプター数の上限に達した。"
483
484 #. type: TP
485 #: build/C/man2/accept.2:252 build/C/man2/socket.2:339
486 #: build/C/man2/socketpair.2:86
487 #, no-wrap
488 msgid "B<ENFILE>"
489 msgstr "B<ENFILE>"
490
491 #. type: Plain text
492 #: build/C/man2/accept.2:255 build/C/man2/socket.2:342
493 #: build/C/man2/socketpair.2:89
494 msgid "The system limit on the total number of open files has been reached."
495 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
496
497 #. type: TP
498 #: build/C/man2/accept.2:255
499 #, no-wrap
500 msgid "B<ENOBUFS>, B<ENOMEM>"
501 msgstr "B<ENOBUFS>, B<ENOMEM>"
502
503 #. type: Plain text
504 #: build/C/man2/accept.2:260
505 msgid ""
506 "Not enough free memory.  This often means that the memory allocation is "
507 "limited by the socket buffer limits, not by the system memory."
508 msgstr ""
509 "メモリーが足りない。 多くの場合は、システムメモリーが足りないわけではなく、 "
510 "ソケットバッファーの大きさによるメモリー割り当ての制限である。"
511
512 #. type: TP
513 #: build/C/man2/accept.2:260 build/C/man2/bind.2:191
514 #: build/C/man2/connect.2:222 build/C/man2/getsockname.2:92
515 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:109
516 #: build/C/man2/recv.2:471 build/C/man2/send.2:381
517 #, no-wrap
518 msgid "B<ENOTSOCK>"
519 msgstr "B<ENOTSOCK>"
520
521 #. type: Plain text
522 #: build/C/man2/accept.2:263
523 msgid "The descriptor references a file, not a socket."
524 msgstr "ディスクリプターはソケットではなくファイルを参照している。"
525
526 #. type: TP
527 #: build/C/man2/accept.2:263 build/C/man2/listen.2:114 build/C/man2/send.2:386
528 #: build/C/man2/socketpair.2:89
529 #, no-wrap
530 msgid "B<EOPNOTSUPP>"
531 msgstr "B<EOPNOTSUPP>"
532
533 #. type: Plain text
534 #: build/C/man2/accept.2:267
535 msgid "The referenced socket is not of type B<SOCK_STREAM>."
536 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
537
538 #. type: TP
539 #: build/C/man2/accept.2:267
540 #, no-wrap
541 msgid "B<EPROTO>"
542 msgstr "B<EPROTO>"
543
544 #. type: Plain text
545 #: build/C/man2/accept.2:270
546 msgid "Protocol error."
547 msgstr "プロトコルエラー。"
548
549 #. type: Plain text
550 #: build/C/man2/accept.2:274
551 msgid "In addition, Linux B<accept>()  may fail if:"
552 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
553
554 #. type: TP
555 #: build/C/man2/accept.2:274
556 #, no-wrap
557 msgid "B<EPERM>"
558 msgstr "B<EPERM>"
559
560 #. type: Plain text
561 #: build/C/man2/accept.2:277
562 msgid "Firewall rules forbid connection."
563 msgstr "ファイアウォールのルールにより接続が禁止された。"
564
565 #. type: Plain text
566 #: build/C/man2/accept.2:289
567 msgid ""
568 "In addition, network errors for the new socket and as defined for the "
569 "protocol may be returned.  Various Linux kernels can return other errors "
570 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
571 "value B<ERESTARTSYS> may be seen during a trace."
572 msgstr ""
573 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
574 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
575 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
576 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
577 "ともある。"
578
579 #. type: SH
580 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
581 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:164
582 #: build/C/man2/select.2:343 build/C/man2/sendmmsg.2:145
583 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:915
584 #, no-wrap
585 msgid "VERSIONS"
586 msgstr "バージョン"
587
588 #. type: Plain text
589 #: build/C/man2/accept.2:294
590 msgid ""
591 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
592 "support in glibc is available starting with version 2.10."
593 msgstr ""
594 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
595 "サポートはバージョン 2.10 以降で利用可能である。"
596
597 #. type: SH
598 #: build/C/man2/accept.2:294 build/C/man2/bind.2:232
599 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:237
600 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
601 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
602 #: build/C/man3/if_nametoindex.3:92 build/C/man2/listen.2:119
603 #: build/C/man2/recv.2:476 build/C/man2/recvmmsg.2:169
604 #: build/C/man2/select.2:349 build/C/man2/send.2:400
605 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
606 #: build/C/man2/socket.2:353 build/C/man2/socketcall.2:42
607 #: build/C/man2/socketpair.2:95
608 #, no-wrap
609 msgid "CONFORMING TO"
610 msgstr "準拠"
611
612 #.  The BSD man page documents five possible error returns
613 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
614 #.  POSIX.1-2001 documents errors
615 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
616 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
617 #.  In addition, SUSv2 documents EFAULT and ENOSR.
618 #. type: Plain text
619 #: build/C/man2/accept.2:306
620 msgid ""
621 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
622 "4.2BSD)."
623 msgstr ""
624 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
625 "された)."
626
627 #. type: Plain text
628 #: build/C/man2/accept.2:309
629 msgid "B<accept4>()  is a nonstandard Linux extension."
630 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
631
632 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
633 #.  do not inherit file status flags -- MTK Jun 05
634 #. type: Plain text
635 #: build/C/man2/accept.2:324
636 msgid ""
637 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
638 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
639 "socket.  This behavior differs from the canonical BSD sockets "
640 "implementation.  Portable programs should not rely on inheritance or "
641 "noninheritance of file status flags and always explicitly set all required "
642 "flags on the socket returned from B<accept>()."
643 msgstr ""
644 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
645 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
646 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
647 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に "
648 "B<accept>()  が返したソケットに対して全ての必要なフラグを明示的に設定するよう"
649 "に すべきである。"
650
651 #. type: SH
652 #: build/C/man2/accept.2:324 build/C/man2/bind.2:244
653 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:253
654 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
655 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:124
656 #: build/C/man2/recv.2:486 build/C/man2/select.2:364
657 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:414
658 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
659 #: build/C/man2/socket.2:367 build/C/man7/socket.7:929
660 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
661 #, no-wrap
662 msgid "NOTES"
663 msgstr "注意"
664
665 #. type: Plain text
666 #: build/C/man2/accept.2:330 build/C/man2/bind.2:250
667 #: build/C/man2/connect.2:259 build/C/man2/getsockopt.2:184
668 #: build/C/man2/listen.2:150 build/C/man2/socket.2:373
669 #: build/C/man2/socketpair.2:124
670 msgid ""
671 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
672 "this header file is not required on Linux.  However, some historical (BSD) "
673 "implementations required this header file, and portable applications are "
674 "probably wise to include it."
675 msgstr ""
676 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
677 "ず、 Linux ではこのヘッダーファイルは必要ではない。 しかし、歴史的には、いく"
678 "つかの実装 (BSD 系) でこのヘッダーファイルが 必要であり、移植性が必要なアプリ"
679 "ケーションではこのファイルを インクルードするのが賢明であろう。"
680
681 #. type: Plain text
682 #: build/C/man2/accept.2:351
683 msgid ""
684 "There may not always be a connection waiting after a B<SIGIO> is delivered "
685 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
686 "connection might have been removed by an asynchronous network error or "
687 "another thread before B<accept>()  is called.  If this happens, then the "
688 "call will block waiting for the next connection to arrive.  To ensure that "
689 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
690 "B<O_NONBLOCK> flag set (see B<socket>(7))."
691 msgstr ""
692 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
693 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
694 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
695 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
696 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
697 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
698 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
699 "見よ)。"
700
701 #. type: SS
702 #: build/C/man2/accept.2:351
703 #, no-wrap
704 msgid "The socklen_t type"
705 msgstr "socklen_t 型"
706
707 #. type: Plain text
708 #: build/C/man2/accept.2:361
709 msgid ""
710 "The third argument of B<accept>()  was originally declared as an I<int *> "
711 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
712 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
713 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
714 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
715 "Torvalds:"
716 msgstr ""
717 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
718 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
719 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
720 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
721 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
722 "た。 Linus Torvald の発言を引用する:"
723
724 #.  .I fails: only italicizes a single line
725 #. type: Plain text
726 #: build/C/man2/accept.2:378
727 msgid ""
728 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
729 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
730 "make it a size_t, and I (and hopefully others, but obviously not too many) "
731 "complained to them very loudly indeed.  Making it a size_t is completely "
732 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
733 "bit architectures, for example.  And it I<has> to be the same size as \"int"
734 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
735 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
736 "have touched it in the first place, but once they did they felt it had to "
737 "have a named type for some unfathomable reason (probably somebody didn't "
738 "like losing face over having done the original stupid thing, so they "
739 "silently just renamed their blunder).\""
740 msgstr ""
741 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
742 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
743 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
744 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
745 "は完全にいかれてる。 例えば 64 ビットアーキテクチャーでは、 size_t が \"int"
746 "\" と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同"
747 "じでなきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうも"
748 "のなんだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決"
749 "策をなんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 い"
750 "じっちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 "
751 "なんでかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶした"
752 "くなかったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたん"
753 "だろう)。」"
754
755 #. type: SH
756 #: build/C/man2/accept.2:378 build/C/man2/bind.2:264
757 #: build/C/man2/connect.2:276 build/C/man3/getifaddrs.3:207
758 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:179
759 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:172
760 #: build/C/man2/select.2:555 build/C/man2/select_tut.2:529
761 #: build/C/man2/send.2:438 build/C/man2/sendmmsg.2:168
762 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:392
763 #, no-wrap
764 msgid "EXAMPLE"
765 msgstr "例"
766
767 #. type: Plain text
768 #: build/C/man2/accept.2:381 build/C/man2/listen.2:182
769 msgid "See B<bind>(2)."
770 msgstr "B<bind>(2)  参照。"
771
772 #. type: SH
773 #: build/C/man2/accept.2:381 build/C/man2/bind.2:329
774 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:281
775 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
776 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
777 #: build/C/man3/if_nametoindex.3:96 build/C/man2/listen.2:182
778 #: build/C/man2/recv.2:516 build/C/man2/recvmmsg.2:278
779 #: build/C/man2/select.2:592 build/C/man2/select_tut.2:821
780 #: build/C/man2/send.2:443 build/C/man2/sendmmsg.2:236
781 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:397
782 #: build/C/man7/socket.7:960 build/C/man2/socketcall.2:53
783 #: build/C/man2/socketpair.2:124
784 #, no-wrap
785 msgid "SEE ALSO"
786 msgstr "関連項目"
787
788 #. type: Plain text
789 #: build/C/man2/accept.2:388
790 msgid ""
791 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
792 "B<socket>(7)"
793 msgstr ""
794 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
795 "B<socket>(7)"
796
797 #. type: SH
798 #: build/C/man2/accept.2:388 build/C/man2/bind.2:342
799 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:288
800 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
801 #: build/C/man2/getsockopt.2:213 build/C/man3/if_nameindex.3:154
802 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:188
803 #: build/C/man2/recv.2:527 build/C/man2/recvmmsg.2:285
804 #: build/C/man2/select.2:607 build/C/man2/select_tut.2:840
805 #: build/C/man2/send.2:458 build/C/man2/sendmmsg.2:241
806 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:426
807 #: build/C/man7/socket.7:972 build/C/man2/socketcall.2:71
808 #: build/C/man2/socketpair.2:131
809 #, no-wrap
810 msgid "COLOPHON"
811 msgstr "この文書について"
812
813 #. type: Plain text
814 #: build/C/man2/accept.2:396 build/C/man2/bind.2:350
815 #: build/C/man3/bindresvport.3:124 build/C/man2/connect.2:296
816 #: build/C/man3/getifaddrs.3:323 build/C/man2/getsockname.2:129
817 #: build/C/man2/getsockopt.2:221 build/C/man3/if_nameindex.3:162
818 #: build/C/man3/if_nametoindex.3:108 build/C/man2/listen.2:196
819 #: build/C/man2/recv.2:535 build/C/man2/recvmmsg.2:293
820 #: build/C/man2/select.2:615 build/C/man2/select_tut.2:848
821 #: build/C/man2/send.2:466 build/C/man2/sendmmsg.2:249
822 #: build/C/man3/sockatmark.3:152 build/C/man2/socket.2:434
823 #: build/C/man7/socket.7:980 build/C/man2/socketcall.2:79
824 #: build/C/man2/socketpair.2:139
825 msgid ""
826 "This page is part of release 3.79 of the Linux I<man-pages> project.  A "
827 "description of the project, information about reporting bugs, and the latest "
828 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
829 "pages/."
830 msgstr ""
831 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.79 の一部\n"
832 "である。プロジェクトの説明とバグ報告に関する情報は\n"
833 "http://www.kernel.org/doc/man-pages/ に書かれている。"
834
835 #. type: TH
836 #: build/C/man2/bind.2:68
837 #, no-wrap
838 msgid "BIND"
839 msgstr "BIND"
840
841 #. type: TH
842 #: build/C/man2/bind.2:68 build/C/man2/recv.2:41 build/C/man2/send.2:40
843 #, no-wrap
844 msgid "2014-08-19"
845 msgstr "2014-08-19"
846
847 #. type: Plain text
848 #: build/C/man2/bind.2:71
849 msgid "bind - bind a name to a socket"
850 msgstr "bind - ソケットに名前をつける"
851
852 #. type: Plain text
853 #: build/C/man2/bind.2:78
854 #, no-wrap
855 msgid ""
856 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
857 "B<         socklen_t >I<addrlen>B<);>\n"
858 msgstr ""
859 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
860 "B<         socklen_t >I<addrlen>B<);>\n"
861
862 #. type: Plain text
863 #: build/C/man2/bind.2:92
864 msgid ""
865 "When a socket is created with B<socket>(2), it exists in a name space "
866 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
867 "address specified by I<addr> to the socket referred to by the file "
868 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
869 "address structure pointed to by I<addr>.  Traditionally, this operation is "
870 "called \\(lqassigning a name to a socket\\(rq."
871 msgstr ""
872 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス"
873 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
874 "ファイルディスクリプター I<sockfd> で参照されるソケットに I<addr> で指定され"
875 "たアドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズ"
876 "をバイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ば"
877 "れる。"
878
879 #. type: Plain text
880 #: build/C/man2/bind.2:99
881 msgid ""
882 "It is normally necessary to assign a local address using B<bind>()  before a "
883 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
884 msgstr ""
885 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
886 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
887 "る。"
888
889 #. type: Plain text
890 #: build/C/man2/bind.2:130
891 msgid ""
892 "The rules used in name binding vary between address families.  Consult the "
893 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
894 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
895 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
896 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
897 msgstr ""
898 "名前付けのルールはアドレスファミリーごとに異なっている。詳細な情報は 第 7 章"
899 "の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
900 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は "
901 "B<ddp>(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  "
902 "を、 B<AF_NETLINK> は B<netlink>(7)  を参照。"
903
904 #. type: Plain text
905 #: build/C/man2/bind.2:137
906 msgid ""
907 "The actual structure passed for the I<addr> argument will depend on the "
908 "address family.  The I<sockaddr> structure is defined as something like:"
909 msgstr ""
910 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレスファミリーに依"
911 "存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
912
913 #. type: Plain text
914 #: build/C/man2/bind.2:144
915 #, no-wrap
916 msgid ""
917 "struct sockaddr {\n"
918 "    sa_family_t sa_family;\n"
919 "    char        sa_data[14];\n"
920 "}\n"
921 msgstr ""
922 "struct sockaddr {\n"
923 "    sa_family_t sa_family;\n"
924 "    char        sa_data[14];\n"
925 "}\n"
926
927 #. type: Plain text
928 #: build/C/man2/bind.2:152
929 msgid ""
930 "The only purpose of this structure is to cast the structure pointer passed "
931 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
932 msgstr ""
933 "この構造体は、 I<addr> に渡される構造体へのポインターをキャストし、 コンパイ"
934 "ラの警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
935
936 #. type: Plain text
937 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
938 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
939 #: build/C/man2/socketpair.2:74
940 msgid ""
941 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
942 "appropriately."
943 msgstr ""
944 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
945 "設定される。"
946
947 #. type: TP
948 #: build/C/man2/bind.2:158 build/C/man2/bind.2:199
949 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
950 #: build/C/man2/send.2:304 build/C/man2/socket.2:321
951 #, no-wrap
952 msgid "B<EACCES>"
953 msgstr "B<EACCES>"
954
955 #.  e.g., privileged port in AF_INET domain
956 #. type: Plain text
957 #: build/C/man2/bind.2:162
958 msgid "The address is protected, and the user is not the superuser."
959 msgstr "そのアドレスは保護されていて、かつユーザーがスーパーユーザーではない。"
960
961 #. type: TP
962 #: build/C/man2/bind.2:162 build/C/man2/bind.2:165
963 #: build/C/man3/bindresvport.3:82 build/C/man2/connect.2:148
964 #: build/C/man2/listen.2:88 build/C/man2/listen.2:91
965 #, no-wrap
966 msgid "B<EADDRINUSE>"
967 msgstr "B<EADDRINUSE>"
968
969 #. type: Plain text
970 #: build/C/man2/bind.2:165
971 msgid "The given address is already in use."
972 msgstr "指定されたアドレスが既に使用中である。"
973
974 #. type: Plain text
975 #: build/C/man2/bind.2:175
976 msgid ""
977 "(Internet domain sockets)  The port number was specified as zero in the "
978 "socket address structure, but, upon attempting to bind to an ephemeral port, "
979 "it was determined that all port numbers in the ephemeral port range are "
980 "currently in use.  See the discussion of I</proc/sys/net/ipv4/"
981 "ip_local_port_range> B<ip>(7)."
982 msgstr ""
983 "(インターネットドメインソケットの場合) ソケットアドレス構造体でポート番号に "
984 "0 が指定されたが、 一時ポート (ephemeral port) を割り当てようとした際に、 一"
985 "時ポートとして使用する範囲のすべてのポート番号が使用中であった。 B<ip>(7) の "
986 "I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照。"
987
988 #. type: Plain text
989 #: build/C/man2/bind.2:180
990 msgid "I<sockfd> is not a valid descriptor."
991 msgstr "I<sockfd> が不正なディスクリプターである。"
992
993 #.  This may change in the future: see
994 #.  .I linux/unix/sock.c for details.
995 #. type: Plain text
996 #: build/C/man2/bind.2:185
997 msgid "The socket is already bound to an address."
998 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
999
1000 #. type: Plain text
1001 #: build/C/man2/bind.2:191
1002 msgid ""
1003 "I<addrlen> is wrong, or I<addr> is not a valid address for this socket's "
1004 "domain."
1005 msgstr ""
1006 "I<addrlen> が間違っているか、 I<addr> がこのソケットのドメインで有効なアドレ"
1007 "スではない。"
1008
1009 #. type: Plain text
1010 #: build/C/man2/bind.2:195
1011 msgid "I<sockfd> is a descriptor for a file, not a socket."
1012 msgstr ""
1013 "I<sockfd> がファイルに対するディスクリプターで、ソケットに対するものではな"
1014 "い。"
1015
1016 #. type: Plain text
1017 #: build/C/man2/bind.2:199
1018 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1019 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1020
1021 #. type: Plain text
1022 #: build/C/man2/bind.2:204
1023 msgid ""
1024 "Search permission is denied on a component of the path prefix.  (See also "
1025 "B<path_resolution>(7).)"
1026 msgstr ""
1027 "パス名の構成要素に検索許可 (search permission) がない "
1028 "(B<path_resolution>(7)  も参照すること)。"
1029
1030 #. type: TP
1031 #: build/C/man2/bind.2:204 build/C/man2/connect.2:151
1032 #, no-wrap
1033 msgid "B<EADDRNOTAVAIL>"
1034 msgstr "B<EADDRNOTAVAIL>"
1035
1036 #. type: Plain text
1037 #: build/C/man2/bind.2:208
1038 msgid ""
1039 "A nonexistent interface was requested or the requested address was not local."
1040 msgstr ""
1041 "存在しないインターフェースが要求されたか、要求されたアドレスが ローカルではな"
1042 "かった。"
1043
1044 #. type: Plain text
1045 #: build/C/man2/bind.2:212
1046 msgid "I<addr> points outside the user's accessible address space."
1047 msgstr "I<addr> がユーザーのアクセス可能なアドレス空間の外を指している。"
1048
1049 #. type: TP
1050 #: build/C/man2/bind.2:212
1051 #, no-wrap
1052 msgid "B<ELOOP>"
1053 msgstr "B<ELOOP>"
1054
1055 #. type: Plain text
1056 #: build/C/man2/bind.2:216
1057 msgid "Too many symbolic links were encountered in resolving I<addr>."
1058 msgstr "I<addr> を解決する際に遭遇したシンボリックリンクが多過ぎる。"
1059
1060 #. type: TP
1061 #: build/C/man2/bind.2:216
1062 #, no-wrap
1063 msgid "B<ENAMETOOLONG>"
1064 msgstr "B<ENAMETOOLONG>"
1065
1066 #. type: Plain text
1067 #: build/C/man2/bind.2:220
1068 msgid "I<addr> is too long."
1069 msgstr "I<addr> が長過ぎる。"
1070
1071 #. type: TP
1072 #: build/C/man2/bind.2:220
1073 #, no-wrap
1074 msgid "B<ENOENT>"
1075 msgstr "B<ENOENT>"
1076
1077 #. type: Plain text
1078 #: build/C/man2/bind.2:223
1079 msgid "The file does not exist."
1080 msgstr "ファイルが存在しない。"
1081
1082 #. type: TP
1083 #: build/C/man2/bind.2:223 build/C/man2/recv.2:460 build/C/man2/select.2:340
1084 #: build/C/man2/send.2:375
1085 #, no-wrap
1086 msgid "B<ENOMEM>"
1087 msgstr "B<ENOMEM>"
1088
1089 #. type: Plain text
1090 #: build/C/man2/bind.2:226
1091 msgid "Insufficient kernel memory was available."
1092 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1093
1094 #. type: TP
1095 #: build/C/man2/bind.2:226
1096 #, no-wrap
1097 msgid "B<ENOTDIR>"
1098 msgstr "B<ENOTDIR>"
1099
1100 #. type: Plain text
1101 #: build/C/man2/bind.2:229
1102 msgid "A component of the path prefix is not a directory."
1103 msgstr "パス名の構成要素がディレクトリではない。"
1104
1105 #. type: TP
1106 #: build/C/man2/bind.2:229
1107 #, no-wrap
1108 msgid "B<EROFS>"
1109 msgstr "B<EROFS>"
1110
1111 #. type: Plain text
1112 #: build/C/man2/bind.2:232
1113 msgid "The socket inode would reside on a read-only filesystem."
1114 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1115
1116 #.  SVr4 documents an additional
1117 #.  .B ENOSR
1118 #.  general error condition, and
1119 #.  additional
1120 #.  .B EIO
1121 #.  and
1122 #.  .B EISDIR
1123 #.  UNIX-domain error conditions.
1124 #. type: Plain text
1125 #: build/C/man2/bind.2:244
1126 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1127 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1128
1129 #. type: Plain text
1130 #: build/C/man2/bind.2:261
1131 msgid ""
1132 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1133 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1134 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1135 msgstr ""
1136 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1137 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1138 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1139
1140 #. type: SH
1141 #: build/C/man2/bind.2:261 build/C/man2/getsockopt.2:199
1142 #: build/C/man2/recvmmsg.2:267 build/C/man2/select.2:492
1143 #: build/C/man2/send.2:433 build/C/man3/sockatmark.3:100
1144 #: build/C/man7/socket.7:947
1145 #, no-wrap
1146 msgid "BUGS"
1147 msgstr "バグ"
1148
1149 #.  FIXME Document transparent proxy options
1150 #. type: Plain text
1151 #: build/C/man2/bind.2:264
1152 msgid "The transparent proxy options are not described."
1153 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1154
1155 #. type: Plain text
1156 #: build/C/man2/bind.2:269
1157 msgid ""
1158 "An example of the use of B<bind>()  with Internet domain sockets can be "
1159 "found in B<getaddrinfo>(3)."
1160 msgstr ""
1161 "インターネットドメインソケットでの B<bind>()  の利用例が B<getaddrinfo>(3)  "
1162 "に記載されている。"
1163
1164 #.  listen.7 refers to this example.
1165 #.  accept.7 refers to this example.
1166 #.  unix.7 refers to this example.
1167 #. type: Plain text
1168 #: build/C/man2/bind.2:276
1169 msgid ""
1170 "The following example shows how to bind a stream socket in the UNIX "
1171 "(B<AF_UNIX>)  domain, and accept connections:"
1172 msgstr ""
1173 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1174 "を示したものである。"
1175
1176 #. type: Plain text
1177 #: build/C/man2/bind.2:283
1178 #, no-wrap
1179 msgid ""
1180 "#include E<lt>sys/socket.hE<gt>\n"
1181 "#include E<lt>sys/un.hE<gt>\n"
1182 "#include E<lt>stdlib.hE<gt>\n"
1183 "#include E<lt>stdio.hE<gt>\n"
1184 "#include E<lt>string.hE<gt>\n"
1185 msgstr ""
1186 "#include E<lt>sys/socket.hE<gt>\n"
1187 "#include E<lt>sys/un.hE<gt>\n"
1188 "#include E<lt>stdlib.hE<gt>\n"
1189 "#include E<lt>stdio.hE<gt>\n"
1190 "#include E<lt>string.hE<gt>\n"
1191
1192 #. type: Plain text
1193 #: build/C/man2/bind.2:286
1194 #, no-wrap
1195 msgid ""
1196 "#define MY_SOCK_PATH \"/somepath\"\n"
1197 "#define LISTEN_BACKLOG 50\n"
1198 msgstr ""
1199 "#define MY_SOCK_PATH \"/somepath\"\n"
1200 "#define LISTEN_BACKLOG 50\n"
1201
1202 #. type: Plain text
1203 #: build/C/man2/bind.2:289
1204 #, no-wrap
1205 msgid ""
1206 "#define handle_error(msg) \\e\n"
1207 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1208 msgstr ""
1209 "#define handle_error(msg) \\e\n"
1210 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1211
1212 #. type: Plain text
1213 #: build/C/man2/bind.2:296
1214 #, no-wrap
1215 msgid ""
1216 "int\n"
1217 "main(int argc, char *argv[])\n"
1218 "{\n"
1219 "    int sfd, cfd;\n"
1220 "    struct sockaddr_un my_addr, peer_addr;\n"
1221 "    socklen_t peer_addr_size;\n"
1222 msgstr ""
1223 "int\n"
1224 "main(int argc, char *argv[])\n"
1225 "{\n"
1226 "    int sfd, cfd;\n"
1227 "    struct sockaddr_un my_addr, peer_addr;\n"
1228 "    socklen_t peer_addr_size;\n"
1229
1230 #. type: Plain text
1231 #: build/C/man2/bind.2:300
1232 #, no-wrap
1233 msgid ""
1234 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1235 "    if (sfd == -1)\n"
1236 "        handle_error(\"socket\");\n"
1237 msgstr ""
1238 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1239 "    if (sfd == -1)\n"
1240 "        handle_error(\"socket\");\n"
1241
1242 #. type: Plain text
1243 #: build/C/man2/bind.2:306
1244 #, no-wrap
1245 msgid ""
1246 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1247 "                        /* Clear structure */\n"
1248 "    my_addr.sun_family = AF_UNIX;\n"
1249 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1250 "            sizeof(my_addr.sun_path) - 1);\n"
1251 msgstr ""
1252 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1253 "                        /* Clear structure */\n"
1254 "    my_addr.sun_family = AF_UNIX;\n"
1255 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1256 "            sizeof(my_addr.sun_path) - 1);\n"
1257
1258 #. type: Plain text
1259 #: build/C/man2/bind.2:310
1260 #, no-wrap
1261 msgid ""
1262 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1263 "            sizeof(struct sockaddr_un)) == -1)\n"
1264 "        handle_error(\"bind\");\n"
1265 msgstr ""
1266 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1267 "            sizeof(struct sockaddr_un)) == -1)\n"
1268 "        handle_error(\"bind\");\n"
1269
1270 #. type: Plain text
1271 #: build/C/man2/bind.2:313
1272 #, no-wrap
1273 msgid ""
1274 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1275 "        handle_error(\"listen\");\n"
1276 msgstr ""
1277 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1278 "        handle_error(\"listen\");\n"
1279
1280 #. type: Plain text
1281 #: build/C/man2/bind.2:316
1282 #, no-wrap
1283 msgid ""
1284 "    /* Now we can accept incoming connections one\n"
1285 "       at a time using accept(2) */\n"
1286 msgstr ""
1287 "    /* Now we can accept incoming connections one\n"
1288 "       at a time using accept(2) */\n"
1289
1290 #. type: Plain text
1291 #: build/C/man2/bind.2:322
1292 #, no-wrap
1293 msgid ""
1294 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1295 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1296 "                 &peer_addr_size);\n"
1297 "    if (cfd == -1)\n"
1298 "        handle_error(\"accept\");\n"
1299 msgstr ""
1300 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1301 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1302 "                 &peer_addr_size)\n"
1303 "    if (cfd == -1)\n"
1304 "        handle_error(\"accept\");\n"
1305
1306 #. type: Plain text
1307 #: build/C/man2/bind.2:324
1308 #, no-wrap
1309 msgid "    /* Code to deal with incoming connection(s)... */\n"
1310 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1311
1312 #. type: Plain text
1313 #: build/C/man2/bind.2:328
1314 #, no-wrap
1315 msgid ""
1316 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1317 "       should be deleted using unlink(2) or remove(3) */\n"
1318 "}\n"
1319 msgstr ""
1320 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1321 "       should be deleted using unlink(2) or remove(3) */\n"
1322 "}\n"
1323
1324 #. type: Plain text
1325 #: build/C/man2/bind.2:342
1326 msgid ""
1327 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1328 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1329 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1330 msgstr ""
1331 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1332 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1333 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1334
1335 #. type: TH
1336 #: build/C/man3/bindresvport.3:30
1337 #, no-wrap
1338 msgid "BINDRESVPORT"
1339 msgstr "BINDRESVPORT"
1340
1341 #. type: TH
1342 #: build/C/man3/bindresvport.3:30
1343 #, no-wrap
1344 msgid "2013-06-21"
1345 msgstr "2013-06-21"
1346
1347 #. type: Plain text
1348 #: build/C/man3/bindresvport.3:33
1349 msgid "bindresvport - bind a socket to a privileged IP port"
1350 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1351
1352 #. type: Plain text
1353 #: build/C/man3/bindresvport.3:37
1354 #, no-wrap
1355 msgid ""
1356 "B<#include E<lt>sys/types.hE<gt>>\n"
1357 "B<#include E<lt>netinet/in.hE<gt>>\n"
1358 msgstr ""
1359 "B<#include E<lt>sys/types.hE<gt>>\n"
1360 "B<#include E<lt>netinet/in.hE<gt>>\n"
1361
1362 #. type: Plain text
1363 #: build/C/man3/bindresvport.3:39
1364 #, no-wrap
1365 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1366 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1367
1368 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1369 #. type: Plain text
1370 #: build/C/man3/bindresvport.3:46
1371 msgid ""
1372 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1373 "anonymous IP port, that is, a port number arbitrarily selected from the "
1374 "range 512 to 1023."
1375 msgstr ""
1376 "B<bindresvport>()  は、ソケットディスクリプターを特権無名 (privileged "
1377 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1378 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1379
1380 #. type: Plain text
1381 #: build/C/man3/bindresvport.3:56
1382 msgid ""
1383 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1384 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1385 "allocated."
1386 msgstr ""
1387 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1388 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1389 "される。"
1390
1391 #. type: Plain text
1392 #: build/C/man3/bindresvport.3:67
1393 msgid ""
1394 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1395 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1396 "return the port number actually allocated.  (This information can later be "
1397 "obtained using B<getsockname>(2).)"
1398 msgstr ""
1399 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1400 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 "
1401 "B<bindresvport>()  は実際に割り当てられたポート番号を返す手段を持たない (割り"
1402 "当てられたポート番号は、後で B<getsockname>(2)  を使って取得できる)。"
1403
1404 #. type: Plain text
1405 #: build/C/man3/bindresvport.3:72
1406 msgid ""
1407 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1408 "I<errno> set to indicate the cause of the error."
1409 msgstr ""
1410 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1411 "I<errno> にエラーの原因を示す値を設定する。"
1412
1413 #. type: Plain text
1414 #: build/C/man3/bindresvport.3:77
1415 msgid ""
1416 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1417 "addition, the following errors may occur:"
1418 msgstr ""
1419 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1420 "以下のエラーが発生することがある:"
1421
1422 #. type: Plain text
1423 #: build/C/man3/bindresvport.3:82
1424 msgid ""
1425 "The caller did not have superuser privilege (to be precise: the "
1426 "B<CAP_NET_BIND_SERVICE> capability is required)."
1427 msgstr ""
1428 "呼び出し元がスーパーユーザーの特権を持っていなかった (より正確に言うと、 "
1429 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1430
1431 #. type: Plain text
1432 #: build/C/man3/bindresvport.3:85
1433 msgid "All privileged ports are in use."
1434 msgstr "全ての特権ポートが使用中である。"
1435
1436 #. type: TP
1437 #: build/C/man3/bindresvport.3:85
1438 #, no-wrap
1439 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1440 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1441
1442 #. type: Plain text
1443 #: build/C/man3/bindresvport.3:92
1444 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1445 msgstr ""
1446 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1447
1448 #. type: SH
1449 #: build/C/man3/bindresvport.3:92 build/C/man3/if_nametoindex.3:85
1450 #: build/C/man3/sockatmark.3:73
1451 #, no-wrap
1452 msgid "ATTRIBUTES"
1453 msgstr "属性"
1454
1455 #. type: SS
1456 #: build/C/man3/bindresvport.3:93 build/C/man3/if_nametoindex.3:86
1457 #: build/C/man3/sockatmark.3:74
1458 #, no-wrap
1459 msgid "Multithreading (see pthreads(7))"
1460 msgstr "マルチスレッディング (pthreads(7) 参照)"
1461
1462 #. type: Plain text
1463 #: build/C/man3/bindresvport.3:98
1464 msgid ""
1465 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1466 "that is not protected, so it is not thread-safe."
1467 msgstr ""
1468 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1469 "静的変数を使用しているため、スレッドセーフではない。"
1470
1471 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1472 #. type: Plain text
1473 #: build/C/man3/bindresvport.3:104
1474 msgid ""
1475 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect the "
1476 "static variable, so it is thread-safe."
1477 msgstr ""
1478 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1479 "ており、スレッドセーフである。"
1480
1481 #. type: Plain text
1482 #: build/C/man3/bindresvport.3:107
1483 msgid ""
1484 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1485 msgstr ""
1486 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1487
1488 #. type: Plain text
1489 #: build/C/man3/bindresvport.3:113
1490 msgid ""
1491 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1492 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1493 msgstr ""
1494 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1495 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1496
1497 #. type: Plain text
1498 #: build/C/man3/bindresvport.3:116
1499 msgid "B<bind>(2), B<getsockname>(2)"
1500 msgstr "B<bind>(2), B<getsockname>(2)"
1501
1502 #. type: TH
1503 #: build/C/man2/connect.2:67
1504 #, no-wrap
1505 msgid "CONNECT"
1506 msgstr "CONNECT"
1507
1508 #. type: TH
1509 #: build/C/man2/connect.2:67
1510 #, no-wrap
1511 msgid "2014-09-06"
1512 msgstr "2014-09-06"
1513
1514 #. type: Plain text
1515 #: build/C/man2/connect.2:70
1516 msgid "connect - initiate a connection on a socket"
1517 msgstr "connect - ソケットの接続を行う"
1518
1519 #. type: Plain text
1520 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1521 #: build/C/man2/listen.2:51
1522 #, no-wrap
1523 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1524 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1525
1526 #. type: Plain text
1527 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1528 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1529 #: build/C/man2/recv.2:51
1530 #, no-wrap
1531 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1532 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1533
1534 #. type: Plain text
1535 #: build/C/man2/connect.2:78
1536 #, no-wrap
1537 msgid ""
1538 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1539 "B<            socklen_t >I<addrlen>B<);>\n"
1540 msgstr ""
1541 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1542 "B<            socklen_t >I<addrlen>B<);>\n"
1543
1544 #. type: Plain text
1545 #: build/C/man2/connect.2:97
1546 msgid ""
1547 "The B<connect>()  system call connects the socket referred to by the file "
1548 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1549 "argument specifies the size of I<addr>.  The format of the address in "
1550 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1551 "B<socket>(2)  for further details."
1552 msgstr ""
1553 "B<connect>()  システムコールは、ファイルディスクリプター I<sockfd> が参照して"
1554 "いるソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1555 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1556 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1557 "こと。"
1558
1559 #. type: Plain text
1560 #: build/C/man2/connect.2:113
1561 msgid ""
1562 "If the socket I<sockfd> is of type B<SOCK_DGRAM>, then I<addr> is the "
1563 "address to which datagrams are sent by default, and the only address from "
1564 "which datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1565 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1566 "that is bound to the address specified by I<addr>."
1567 msgstr ""
1568 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1569 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1570 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1571 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1572 "に対する接続の 作成を試みる。"
1573
1574 #. type: Plain text
1575 #: build/C/man2/connect.2:127
1576 msgid ""
1577 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1578 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1579 "times to change their association.  Connectionless sockets may dissolve the "
1580 "association by connecting to an address with the I<sa_family> member of "
1581 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1582 msgstr ""
1583 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ "
1584 "B<connect>()  が成功する。 コネクションレス (connectionless) プロトコルでは対"
1585 "応を変更するために何度も B<connect>()  を使用できる。 非接続ソケットは "
1586 "I<sockaddr> の I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アド"
1587 "レスの対応を解消することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux で"
1588 "サポート)。"
1589
1590 #. type: Plain text
1591 #: build/C/man2/connect.2:132
1592 msgid ""
1593 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1594 "returned, and I<errno> is set appropriately."
1595 msgstr ""
1596 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1597 "適切な値を設定する。"
1598
1599 #. type: Plain text
1600 #: build/C/man2/connect.2:135
1601 msgid ""
1602 "The following are general socket errors only.  There may be other domain-"
1603 "specific error codes."
1604 msgstr ""
1605 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1606 "する可能性がある。"
1607
1608 #. type: Plain text
1609 #: build/C/man2/connect.2:143
1610 msgid ""
1611 "For UNIX domain sockets, which are identified by pathname: Write permission "
1612 "is denied on the socket file, or search permission is denied for one of the "
1613 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1614 msgstr ""
1615 "UNIX ドメインソケットはパス名で識別される。 ソケットファイルへの書き込み許可"
1616 "がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可が"
1617 "なかった。 (B<path_resolution>(7)  も参照のこと)"
1618
1619 #. type: TP
1620 #: build/C/man2/connect.2:143
1621 #, no-wrap
1622 msgid "B<EACCES>, B<EPERM>"
1623 msgstr "B<EACCES>, B<EPERM>"
1624
1625 #. type: Plain text
1626 #: build/C/man2/connect.2:148
1627 msgid ""
1628 "The user tried to connect to a broadcast address without having the socket "
1629 "broadcast flag enabled or the connection request failed because of a local "
1630 "firewall rule."
1631 msgstr ""
1632 "ソケットのブロードキャストフラグが有効になっていないのに ユーザーがブロード"
1633 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1634 "要求が失敗した。"
1635
1636 #. type: Plain text
1637 #: build/C/man2/connect.2:151
1638 msgid "Local address is already in use."
1639 msgstr "ローカルアドレスが既に使用されている。"
1640
1641 #. type: Plain text
1642 #: build/C/man2/connect.2:164 build/C/man2/listen.2:104
1643 msgid ""
1644 "(Internet domain sockets)  The socket referred to by I<sockfd> had not "
1645 "previously been bound to an address and, upon attempting to bind it to an "
1646 "ephemeral port, it was determined that all port numbers in the ephemeral "
1647 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
1648 "ip_local_port_range> in B<ip>(7)."
1649 msgstr ""
1650 "(インターネットドメインソケットの場合) I<sockfd> が参照するソケットがそれ以前"
1651 "にアドレスにバインドされておらず、 そのソケットに一時ポートをバインドしようと"
1652 "した際に、 一時ポートとして使用する範囲のポート番号がすべて使用中であった。 "
1653 "B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照のこと。"
1654
1655 #. type: TP
1656 #: build/C/man2/connect.2:164 build/C/man2/socket.2:325
1657 #: build/C/man2/socketpair.2:75
1658 #, no-wrap
1659 msgid "B<EAFNOSUPPORT>"
1660 msgstr "B<EAFNOSUPPORT>"
1661
1662 #. type: Plain text
1663 #: build/C/man2/connect.2:169
1664 msgid ""
1665 "The passed address didn't have the correct address family in its "
1666 "I<sa_family> field."
1667 msgstr ""
1668 "渡されたアドレスの I<sa_family> フィールドが正しいアドレスファミリーではな"
1669 "い。"
1670
1671 #. type: TP
1672 #: build/C/man2/connect.2:169 build/C/man2/send.2:323
1673 #, no-wrap
1674 msgid "B<EAGAIN>"
1675 msgstr "B<EAGAIN>"
1676
1677 #. type: Plain text
1678 #: build/C/man2/connect.2:172
1679 msgid "Insufficient entries in the routing cache."
1680 msgstr "ルーティングキャッシュにエントリーが十分にない。"
1681
1682 #. type: TP
1683 #: build/C/man2/connect.2:172
1684 #, no-wrap
1685 msgid "B<EALREADY>"
1686 msgstr "B<EALREADY>"
1687
1688 #. type: Plain text
1689 #: build/C/man2/connect.2:176
1690 msgid ""
1691 "The socket is nonblocking and a previous connection attempt has not yet been "
1692 "completed."
1693 msgstr ""
1694 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1695
1696 #. type: Plain text
1697 #: build/C/man2/connect.2:179
1698 msgid "The file descriptor is not a valid index in the descriptor table."
1699 msgstr ""
1700 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1701 "い。"
1702
1703 #. type: TP
1704 #: build/C/man2/connect.2:179 build/C/man2/recv.2:443
1705 #, no-wrap
1706 msgid "B<ECONNREFUSED>"
1707 msgstr "B<ECONNREFUSED>"
1708
1709 #. type: Plain text
1710 #: build/C/man2/connect.2:182
1711 msgid "No-one listening on the remote address."
1712 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1713
1714 #. type: Plain text
1715 #: build/C/man2/connect.2:185
1716 msgid "The socket structure address is outside the user's address space."
1717 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1718
1719 #. type: TP
1720 #: build/C/man2/connect.2:185
1721 #, no-wrap
1722 msgid "B<EINPROGRESS>"
1723 msgstr "B<EINPROGRESS>"
1724
1725 #. type: Plain text
1726 #: build/C/man2/connect.2:210
1727 msgid ""
1728 "The socket is nonblocking and the connection cannot be completed "
1729 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1730 "by selecting the socket for writing.  After B<select>(2)  indicates "
1731 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1732 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1733 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1734 "error codes listed here, explaining the reason for the failure)."
1735 msgstr ""
1736 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1737 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1738 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1739 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1740 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1741 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1742 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1743 "の原因が分かる。"
1744
1745 #.  For TCP, the connection will complete asynchronously.
1746 #.  See http://lkml.org/lkml/2005/7/12/254
1747 #. type: Plain text
1748 #: build/C/man2/connect.2:216
1749 msgid ""
1750 "The system call was interrupted by a signal that was caught; see "
1751 "B<signal>(7)."
1752 msgstr ""
1753 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1754
1755 #. type: TP
1756 #: build/C/man2/connect.2:216 build/C/man2/send.2:355
1757 #, no-wrap
1758 msgid "B<EISCONN>"
1759 msgstr "B<EISCONN>"
1760
1761 #. type: Plain text
1762 #: build/C/man2/connect.2:219
1763 msgid "The socket is already connected."
1764 msgstr "ソケットは既に接続 (connect) されている。"
1765
1766 #. type: TP
1767 #: build/C/man2/connect.2:219
1768 #, no-wrap
1769 msgid "B<ENETUNREACH>"
1770 msgstr "B<ENETUNREACH>"
1771
1772 #. type: Plain text
1773 #: build/C/man2/connect.2:222
1774 msgid "Network is unreachable."
1775 msgstr "到達できないネットワークである。"
1776
1777 #. type: Plain text
1778 #: build/C/man2/connect.2:225
1779 msgid "The file descriptor is not associated with a socket."
1780 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1781
1782 #. type: TP
1783 #: build/C/man2/connect.2:225
1784 #, no-wrap
1785 msgid "B<EPROTOTYPE>"
1786 msgstr "B<EPROTOTYPE>"
1787
1788 #. type: Plain text
1789 #: build/C/man2/connect.2:230
1790 msgid ""
1791 "The socket type does not support the requested communications protocol.  "
1792 "This error can occur, for example, on an attempt to connect a UNIX domain "
1793 "datagram socket to a stream socket."
1794 msgstr ""
1795 "ソケットタイプが要求された通信プロトコルではサポートされていない。 このエラー"
1796 "は、 例えば UNIX ドメインデータグラムソケットをストリームソケットに接続しよう"
1797 "とした場合などに起こり得る。"
1798
1799 #. type: TP
1800 #: build/C/man2/connect.2:230
1801 #, no-wrap
1802 msgid "B<ETIMEDOUT>"
1803 msgstr "B<ETIMEDOUT>"
1804
1805 #. type: Plain text
1806 #: build/C/man2/connect.2:237
1807 msgid ""
1808 "Timeout while attempting connection.  The server may be too busy to accept "
1809 "new connections.  Note that for IP sockets the timeout may be very long when "
1810 "syncookies are enabled on the server."
1811 msgstr ""
1812 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1813 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1814 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1815 "ること。"
1816
1817 #.  SVr4 documents the additional
1818 #.  general error codes
1819 #.  .BR EADDRNOTAVAIL ,
1820 #.  .BR EINVAL ,
1821 #.  .BR EAFNOSUPPORT ,
1822 #.  .BR EALREADY ,
1823 #.  .BR EINTR ,
1824 #.  .BR EPROTOTYPE ,
1825 #.  and
1826 #.  .BR ENOSR .
1827 #.  It also
1828 #.  documents many additional error conditions not described here.
1829 #. type: Plain text
1830 #: build/C/man2/connect.2:253
1831 msgid ""
1832 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1833 "POSIX.1-2001."
1834 msgstr ""
1835 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1836
1837 #. type: Plain text
1838 #: build/C/man2/connect.2:270
1839 msgid ""
1840 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1841 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1842 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1843 msgstr ""
1844 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1845 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1846 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1847
1848 #. type: Plain text
1849 #: build/C/man2/connect.2:276
1850 msgid ""
1851 "If B<connect>()  fails, consider the state of the socket as unspecified.  "
1852 "Portable applications should close the socket and create a new one for "
1853 "reconnecting."
1854 msgstr ""
1855 "B<connect>() が失敗した場合、そのソケットの状態は不定だと考えること。 移植性"
1856 "を考慮したアプリケーションでは、そのソケットをクローズし、再接続用に新しいソ"
1857 "ケットを作成すべきである。"
1858
1859 #. type: Plain text
1860 #: build/C/man2/connect.2:281
1861 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1862 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1863
1864 #. type: Plain text
1865 #: build/C/man2/connect.2:288
1866 msgid ""
1867 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1868 "B<path_resolution>(7)"
1869 msgstr ""
1870 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1871 "B<path_resolution>(7)"
1872
1873 #. type: TH
1874 #: build/C/man3/getifaddrs.3:36
1875 #, no-wrap
1876 msgid "GETIFADDRS"
1877 msgstr "GETIFADDRS"
1878
1879 #. type: TH
1880 #: build/C/man3/getifaddrs.3:36
1881 #, no-wrap
1882 msgid "2014-02-26"
1883 msgstr "2014-02-26"
1884
1885 #. type: TH
1886 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1887 #: build/C/man3/if_nametoindex.3:25
1888 #, no-wrap
1889 msgid "GNU"
1890 msgstr "GNU"
1891
1892 #. type: Plain text
1893 #: build/C/man3/getifaddrs.3:39
1894 msgid "getifaddrs, freeifaddrs - get interface addresses"
1895 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1896
1897 #. type: Plain text
1898 #: build/C/man3/getifaddrs.3:43
1899 #, no-wrap
1900 msgid ""
1901 "B<#include E<lt>sys/types.hE<gt>>\n"
1902 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1903 msgstr ""
1904 "B<#include E<lt>sys/types.hE<gt>>\n"
1905 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1906
1907 #. type: Plain text
1908 #: build/C/man3/getifaddrs.3:45
1909 #, no-wrap
1910 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1911 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1912
1913 #. type: Plain text
1914 #: build/C/man3/getifaddrs.3:47
1915 #, no-wrap
1916 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1917 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1918
1919 #. type: Plain text
1920 #: build/C/man3/getifaddrs.3:58
1921 msgid ""
1922 "The B<getifaddrs>()  function creates a linked list of structures describing "
1923 "the network interfaces of the local system, and stores the address of the "
1924 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1925 "structures, defined as follows:"
1926 msgstr ""
1927 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1928 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1929 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1930 "うに定義されている。"
1931
1932 #. type: Plain text
1933 #: build/C/man3/getifaddrs.3:77
1934 #, no-wrap
1935 msgid ""
1936 "struct ifaddrs {\n"
1937 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1938 "    char            *ifa_name;    /* Name of interface */\n"
1939 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1940 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1941 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1942 "    union {\n"
1943 "        struct sockaddr *ifu_broadaddr;\n"
1944 "                         /* Broadcast address of interface */\n"
1945 "        struct sockaddr *ifu_dstaddr;\n"
1946 "                         /* Point-to-point destination address */\n"
1947 "    } ifa_ifu;\n"
1948 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1949 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1950 "    void            *ifa_data;    /* Address-specific data */\n"
1951 "};\n"
1952 msgstr ""
1953 "struct ifaddrs {\n"
1954 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1955 "    char            *ifa_name;    /* Name of interface */\n"
1956 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1957 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1958 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1959 "    union {\n"
1960 "        struct sockaddr *ifu_broadaddr;\n"
1961 "                         /* Broadcast address of interface */\n"
1962 "        struct sockaddr *ifu_dstaddr;\n"
1963 "                         /* Point-to-point destination address */\n"
1964 "    } ifa_ifu;\n"
1965 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1966 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1967 "    void            *ifa_data;    /* Address-specific data */\n"
1968 "};\n"
1969
1970 #. type: Plain text
1971 #: build/C/man3/getifaddrs.3:84
1972 msgid ""
1973 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1974 "or NULL if this is the last item of the list."
1975 msgstr ""
1976 "I<ifa_next> フィールドにはリストの次の構造体へのポインターが格納される。 この"
1977 "要素がリストの最後の場合には NULL が入る。"
1978
1979 #.  The constant
1980 #.  .B IF NAMESIZE
1981 #.  indicates the maximum length of this field.
1982 #. type: Plain text
1983 #: build/C/man3/getifaddrs.3:91
1984 msgid "The I<ifa_name> points to the null-terminated interface name."
1985 msgstr "I<ifa_name> はヌル終端されたインターフェース名を指す。"
1986
1987 #. type: Plain text
1988 #: build/C/man3/getifaddrs.3:100
1989 msgid ""
1990 "The I<ifa_flags> field contains the interface flags, as returned by the "
1991 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1992 "these flags)."
1993 msgstr ""
1994 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1995 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1996 "B<netdevice>(7) を参照)。"
1997
1998 #. type: Plain text
1999 #: build/C/man3/getifaddrs.3:109
2000 msgid ""
2001 "The I<ifa_addr> field points to a structure containing the interface "
2002 "address.  (The I<sa_family> subfield should be consulted to determine the "
2003 "format of the address structure.)  This field may contain a null pointer."
2004 msgstr ""
2005 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
2006 "ンターである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判"
2007 "別すべきである)。 このフィールドはヌルポインターとなる場合がある。"
2008
2009 #. type: Plain text
2010 #: build/C/man3/getifaddrs.3:116
2011 msgid ""
2012 "The I<ifa_netmask> field points to a structure containing the netmask "
2013 "associated with I<ifa_addr>, if applicable for the address family.  This "
2014 "field may contain a null pointer."
2015 msgstr ""
2016 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
2017 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインターが"
2018 "入る。 このフィールドはヌルポインターとなる場合がある。"
2019
2020 #. type: Plain text
2021 #: build/C/man3/getifaddrs.3:131
2022 msgid ""
2023 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
2024 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
2025 "will contain the broadcast address associated with I<ifa_addr> (if "
2026 "applicable for the address family) or I<ifa_dstaddr> will contain the "
2027 "destination address of the point-to-point interface."
2028 msgstr ""
2029 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
2030 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
2031 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
2032 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
2033 "point インターフェースの宛先アドレスが入るかが決まる。"
2034
2035 #. type: Plain text
2036 #: build/C/man3/getifaddrs.3:136
2037 msgid ""
2038 "The I<ifa_data> field points to a buffer containing address-family-specific "
2039 "data; this field may be NULL if there is no such data for this interface."
2040 msgstr ""
2041 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファーへ"
2042 "のポインターである。 そのインターフェースでこのようなデータがない場合には、 "
2043 "このフィールドは NULL となる。"
2044
2045 #. type: Plain text
2046 #: build/C/man3/getifaddrs.3:142
2047 msgid ""
2048 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
2049 "freed using B<freeifaddrs>()  when no longer needed."
2050 msgstr ""
2051 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2052 "B<freeifaddrs>() を使って解放すべきである。"
2053
2054 #. type: Plain text
2055 #: build/C/man3/getifaddrs.3:149
2056 msgid ""
2057 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2058 "I<errno> is set appropriately."
2059 msgstr ""
2060 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2061 "が適切に設定される。"
2062
2063 #. type: Plain text
2064 #: build/C/man3/getifaddrs.3:162
2065 msgid ""
2066 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2067 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), "
2068 "B<sendto>(2), B<malloc>(3), or B<realloc>(3)."
2069 msgstr ""
2070 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には "
2071 "B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), "
2072 "B<malloc>(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定され"
2073 "る。"
2074
2075 #. type: Plain text
2076 #: build/C/man3/getifaddrs.3:170
2077 msgid ""
2078 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2079 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2080 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2081 "available only on kernels that support netlink."
2082 msgstr ""
2083 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2084 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2085 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2086 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2087
2088 #.  , but the BSD-derived documentation generally
2089 #.  appears to be confused and obsolete on this point.
2090 #.  i.e., commonly it still says one of them will be NULL, even if
2091 #.  the ifa_ifu union is already present
2092 #. type: Plain text
2093 #: build/C/man3/getifaddrs.3:190
2094 msgid ""
2095 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2096 "the BSD systems, but with slightly different semantics documented"
2097 "\\(emreturning one entry per interface, not per address.  This means "
2098 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2099 "address, and no link-level address is returned if the interface has an IP "
2100 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2101 "I<ifa_dstaddr> differs on various systems."
2102 msgstr ""
2103 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2104 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2105 "フェース毎に 1 エントリーを返す。 このことは、 インターフェースがアドレスを持"
2106 "たない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2107 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2108 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2109 "どちらを選択するかを決める方法は、 システムにより異なる。"
2110
2111 #. type: Plain text
2112 #: build/C/man3/getifaddrs.3:207
2113 msgid ""
2114 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2115 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2116 "containing lower-level details about the interface and its physical layer.  "
2117 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2118 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2119 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2120 "hE<gt>>), which contains various interface attributes and statistics."
2121 msgstr ""
2122 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2123 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2124 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2125 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2126 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2127 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2128 "れる I<struct net_device_stats>) へのポインターが格納される。 この構造体に"
2129 "は、インターフェースの様々な属性や統計情報が入る。"
2130
2131 #. type: Plain text
2132 #: build/C/man3/getifaddrs.3:214
2133 msgid ""
2134 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2135 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2136 "system:"
2137 msgstr ""
2138 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2139 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2140
2141 #. type: Plain text
2142 #: build/C/man3/getifaddrs.3:235
2143 #, no-wrap
2144 msgid ""
2145 "$ B<./a.out>\n"
2146 "lo       AF_PACKET (17)\n"
2147 "                tx_packets =        524; rx_packets =        524\n"
2148 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2149 "wlp3s0   AF_PACKET (17)\n"
2150 "                tx_packets =     108391; rx_packets =     130245\n"
2151 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2152 "em1      AF_PACKET (17)\n"
2153 "                tx_packets =          0; rx_packets =          0\n"
2154 "                tx_bytes   =          0; rx_bytes   =          0\n"
2155 "lo       AF_INET (2)\n"
2156 "                address: E<lt>127.0.0.1E<gt>\n"
2157 "wlp3s0   AF_INET (2)\n"
2158 "                address: E<lt>192.168.235.137E<gt>\n"
2159 "lo       AF_INET6 (10)\n"
2160 "                address: E<lt>::1E<gt>\n"
2161 "wlp3s0   AF_INET6 (10)\n"
2162 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2163 msgstr ""
2164 "$ B<./a.out>\n"
2165 "lo       AF_PACKET (17)\n"
2166 "                tx_packets =        524; rx_packets =        524\n"
2167 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2168 "wlp3s0   AF_PACKET (17)\n"
2169 "                tx_packets =     108391; rx_packets =     130245\n"
2170 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2171 "em1      AF_PACKET (17)\n"
2172 "                tx_packets =          0; rx_packets =          0\n"
2173 "                tx_bytes   =          0; rx_bytes   =          0\n"
2174 "lo       AF_INET (2)\n"
2175 "                address: E<lt>127.0.0.1E<gt>\n"
2176 "wlp3s0   AF_INET (2)\n"
2177 "                address: E<lt>192.168.235.137E<gt>\n"
2178 "lo       AF_INET6 (10)\n"
2179 "                address: E<lt>::1E<gt>\n"
2180 "wlp3s0   AF_INET6 (10)\n"
2181 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2182
2183 #. type: SS
2184 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2185 #: build/C/man2/recvmmsg.2:205
2186 #, no-wrap
2187 msgid "Program source"
2188 msgstr "プログラムのソース"
2189
2190 #. type: Plain text
2191 #: build/C/man3/getifaddrs.3:249
2192 #, no-wrap
2193 msgid ""
2194 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2195 "#include E<lt>arpa/inet.hE<gt>\n"
2196 "#include E<lt>sys/socket.hE<gt>\n"
2197 "#include E<lt>netdb.hE<gt>\n"
2198 "#include E<lt>ifaddrs.hE<gt>\n"
2199 "#include E<lt>stdio.hE<gt>\n"
2200 "#include E<lt>stdlib.hE<gt>\n"
2201 "#include E<lt>unistd.hE<gt>\n"
2202 "#include E<lt>linux/if_link.hE<gt>\n"
2203 msgstr ""
2204 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2205 "#include E<lt>arpa/inet.hE<gt>\n"
2206 "#include E<lt>sys/socket.hE<gt>\n"
2207 "#include E<lt>netdb.hE<gt>\n"
2208 "#include E<lt>ifaddrs.hE<gt>\n"
2209 "#include E<lt>stdio.hE<gt>\n"
2210 "#include E<lt>stdlib.hE<gt>\n"
2211 "#include E<lt>unistd.hE<gt>\n"
2212 "#include E<lt>linux/if_link.hE<gt>\n"
2213
2214 #. type: Plain text
2215 #: build/C/man3/getifaddrs.3:255
2216 #, no-wrap
2217 msgid ""
2218 "int main(int argc, char *argv[])\n"
2219 "{\n"
2220 "    struct ifaddrs *ifaddr, *ifa;\n"
2221 "    int family, s, n;\n"
2222 "    char host[NI_MAXHOST];\n"
2223 msgstr ""
2224 "int main(int argc, char *argv[])\n"
2225 "{\n"
2226 "    struct ifaddrs *ifaddr, *ifa;\n"
2227 "    int family, s, n;\n"
2228 "    char host[NI_MAXHOST];\n"
2229
2230 #. type: Plain text
2231 #: build/C/man3/getifaddrs.3:260
2232 #, no-wrap
2233 msgid ""
2234 "    if (getifaddrs(&ifaddr) == -1) {\n"
2235 "        perror(\"getifaddrs\");\n"
2236 "        exit(EXIT_FAILURE);\n"
2237 "    }\n"
2238 msgstr ""
2239 "    if (getifaddrs(&ifaddr) == -1) {\n"
2240 "        perror(\"getifaddrs\");\n"
2241 "        exit(EXIT_FAILURE);\n"
2242 "    }\n"
2243
2244 #. type: Plain text
2245 #: build/C/man3/getifaddrs.3:263
2246 #, no-wrap
2247 msgid ""
2248 "    /* Walk through linked list, maintaining head pointer so we\n"
2249 "       can free list later */\n"
2250 msgstr ""
2251 "    /* Walk through linked list, maintaining head pointer so we\n"
2252 "       can free list later */\n"
2253
2254 #. type: Plain text
2255 #: build/C/man3/getifaddrs.3:267
2256 #, no-wrap
2257 msgid ""
2258 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2259 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2260 "            continue;\n"
2261 msgstr ""
2262 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2263 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2264 "            continue;\n"
2265
2266 #. type: Plain text
2267 #: build/C/man3/getifaddrs.3:269
2268 #, no-wrap
2269 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2270 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2271
2272 #. type: Plain text
2273 #: build/C/man3/getifaddrs.3:272
2274 #, no-wrap
2275 msgid ""
2276 "        /* Display interface name and family (including symbolic\n"
2277 "           form of the latter for the common families) */\n"
2278 msgstr ""
2279 "        /* Display interface name and family (including symbolic\n"
2280 "           form of the latter for the common families) */\n"
2281
2282 #. type: Plain text
2283 #: build/C/man3/getifaddrs.3:279
2284 #, no-wrap
2285 msgid ""
2286 "        printf(\"%-8s %s (%d)\\en\",\n"
2287 "               ifa-E<gt>ifa_name,\n"
2288 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2289 "               (family == AF_INET) ? \"AF_INET\" :\n"
2290 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2291 "               family);\n"
2292 msgstr ""
2293 "        printf(\"%-8s %s (%d)\\en\",\n"
2294 "               ifa-E<gt>ifa_name,\n"
2295 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2296 "               (family == AF_INET) ? \"AF_INET\" :\n"
2297 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2298 "               family);\n"
2299
2300 #. type: Plain text
2301 #: build/C/man3/getifaddrs.3:281
2302 #, no-wrap
2303 msgid "        /* For an AF_INET* interface address, display the address */\n"
2304 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2305
2306 #. type: Plain text
2307 #: build/C/man3/getifaddrs.3:292
2308 #, no-wrap
2309 msgid ""
2310 "        if (family == AF_INET || family == AF_INET6) {\n"
2311 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2312 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2313 "                                          sizeof(struct sockaddr_in6),\n"
2314 "                    host, NI_MAXHOST,\n"
2315 "                    NULL, 0, NI_NUMERICHOST);\n"
2316 "            if (s != 0) {\n"
2317 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2318 "                exit(EXIT_FAILURE);\n"
2319 "            }\n"
2320 msgstr ""
2321 "        if (family == AF_INET || family == AF_INET6) {\n"
2322 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2323 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2324 "                                          sizeof(struct sockaddr_in6),\n"
2325 "                    host, NI_MAXHOST,\n"
2326 "                    NULL, 0, NI_NUMERICHOST);\n"
2327 "            if (s != 0) {\n"
2328 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2329 "                exit(EXIT_FAILURE);\n"
2330 "            }\n"
2331
2332 #. type: Plain text
2333 #: build/C/man3/getifaddrs.3:294
2334 #, no-wrap
2335 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2336 msgstr "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2337
2338 #. type: Plain text
2339 #: build/C/man3/getifaddrs.3:297
2340 #, no-wrap
2341 msgid ""
2342 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2343 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2344 msgstr ""
2345 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2346 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2347
2348 #. type: Plain text
2349 #: build/C/man3/getifaddrs.3:304
2350 #, no-wrap
2351 msgid ""
2352 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2353 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2354 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2355 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2356 "        }\n"
2357 "    }\n"
2358 msgstr ""
2359 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2360 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2361 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2362 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2363 "        }\n"
2364 "    }\n"
2365
2366 #. type: Plain text
2367 #: build/C/man3/getifaddrs.3:308
2368 #, no-wrap
2369 msgid ""
2370 "    freeifaddrs(ifaddr);\n"
2371 "    exit(EXIT_SUCCESS);\n"
2372 "}\n"
2373 msgstr ""
2374 "    freeifaddrs(ifaddr);\n"
2375 "    exit(EXIT_SUCCESS);\n"
2376 "}\n"
2377
2378 #. type: Plain text
2379 #: build/C/man3/getifaddrs.3:315
2380 msgid ""
2381 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2382 msgstr ""
2383 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2384
2385 #. type: TH
2386 #: build/C/man2/getsockname.2:40
2387 #, no-wrap
2388 msgid "GETSOCKNAME"
2389 msgstr "GETSOCKNAME"
2390
2391 #. type: TH
2392 #: build/C/man2/getsockname.2:40
2393 #, no-wrap
2394 msgid "2008-12-03"
2395 msgstr "2008-12-03"
2396
2397 #. type: Plain text
2398 #: build/C/man2/getsockname.2:43
2399 msgid "getsockname - get socket name"
2400 msgstr "getsockname - ソケットの名前を取得する"
2401
2402 #. type: Plain text
2403 #: build/C/man2/getsockname.2:49
2404 #, no-wrap
2405 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2406 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2407
2408 #. type: Plain text
2409 #: build/C/man2/getsockname.2:62
2410 msgid ""
2411 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2412 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2413 "should be initialized to indicate the amount of space (in bytes) pointed to "
2414 "by I<addr>.  On return it contains the actual size of the socket address."
2415 msgstr ""
2416 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2417 "を、 I<addr> が指すバッファーに格納して返す。 I<addrlen> 引き数は、 I<addr> "
2418 "が指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数"
2419 "が返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が"
2420 "格納される。"
2421
2422 #. type: Plain text
2423 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2424 #: build/C/man2/listen.2:109
2425 msgid "The argument I<sockfd> is not a valid descriptor."
2426 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2427
2428 #. type: Plain text
2429 #: build/C/man2/getsockname.2:84
2430 msgid ""
2431 "The I<addr> argument points to memory not in a valid part of the process "
2432 "address space."
2433 msgstr ""
2434 "引き数 I<addr> の指しているメモリーがプロセスのアドレス空間の有効な部分ではな"
2435 "い。"
2436
2437 #. type: Plain text
2438 #: build/C/man2/getsockname.2:88
2439 msgid "I<addrlen> is invalid (e.g., is negative)."
2440 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2441
2442 #. type: TP
2443 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2444 #: build/C/man2/send.2:367
2445 #, no-wrap
2446 msgid "B<ENOBUFS>"
2447 msgstr "B<ENOBUFS>"
2448
2449 #. type: Plain text
2450 #: build/C/man2/getsockname.2:92
2451 msgid ""
2452 "Insufficient resources were available in the system to perform the operation."
2453 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2454
2455 #. type: Plain text
2456 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2457 msgid "The argument I<sockfd> is a file, not a socket."
2458 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2459
2460 #.  SVr4 documents additional ENOMEM
2461 #.  and ENOSR error codes.
2462 #. type: Plain text
2463 #: build/C/man2/getsockname.2:103
2464 msgid ""
2465 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2466 "POSIX.1-2001."
2467 msgstr ""
2468 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2469
2470 #. type: Plain text
2471 #: build/C/man2/getsockname.2:114
2472 msgid ""
2473 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2474 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2475 "resulted in the present I<socklen_t>, also used by glibc.  See also "
2476 "B<accept>(2)."
2477 msgstr ""
2478 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2479 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2480 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2481
2482 #. type: Plain text
2483 #: build/C/man2/getsockname.2:121
2484 msgid ""
2485 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2486 "B<unix>(7)"
2487 msgstr ""
2488 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2489 "B<unix>(7)"
2490
2491 #. type: TH
2492 #: build/C/man2/getsockopt.2:44
2493 #, no-wrap
2494 msgid "GETSOCKOPT"
2495 msgstr "GETSOCKOPT"
2496
2497 #. type: TH
2498 #: build/C/man2/getsockopt.2:44
2499 #, no-wrap
2500 msgid "2014-04-28"
2501 msgstr "2014-04-28"
2502
2503 #. type: Plain text
2504 #: build/C/man2/getsockopt.2:47
2505 msgid "getsockopt, setsockopt - get and set options on sockets"
2506 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2507
2508 #. type: Plain text
2509 #: build/C/man2/getsockopt.2:57
2510 #, no-wrap
2511 msgid ""
2512 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2513 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2514 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2515 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2516 msgstr ""
2517 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2518 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2519 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2520 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2521
2522 #. type: Plain text
2523 #: build/C/man2/getsockopt.2:67
2524 msgid ""
2525 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2526 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2527 "protocol levels; they are always present at the uppermost socket level."
2528 msgstr ""
2529 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプター I<socket> "
2530 "で参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロ"
2531 "トコル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと"
2532 "設定される。"
2533
2534 #. type: Plain text
2535 #: build/C/man2/getsockopt.2:86
2536 msgid ""
2537 "When manipulating socket options, the level at which the option resides and "
2538 "the name of the option must be specified.  To manipulate options at the "
2539 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2540 "options at any other level the protocol number of the appropriate protocol "
2541 "controlling the option is supplied.  For example, to indicate that an option "
2542 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2543 "protocol number of B<TCP>; see B<getprotoent>(3)."
2544 msgstr ""
2545 "ソケットオプションを操作する際には、オプションの層 (level) と オプションの名"
2546 "前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2547 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2548 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2549 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2550 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2551 "B<getprotoent>(3)  を参照すること。"
2552
2553 #. type: Plain text
2554 #: build/C/man2/getsockopt.2:108
2555 msgid ""
2556 "The arguments I<optval> and I<optlen> are used to access option values for "
2557 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2558 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2559 "I<optlen> is a value-result argument, initially containing the size of the "
2560 "buffer pointed to by I<optval>, and modified on return to indicate the "
2561 "actual size of the value returned.  If no option value is to be supplied or "
2562 "returned, I<optval> may be NULL."
2563 msgstr ""
2564 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2565 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2566 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2567 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2568 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2569 "I<optval> は NULL でも良い。"
2570
2571 #. type: Plain text
2572 #: build/C/man2/getsockopt.2:118
2573 msgid ""
2574 "I<Optname> and any specified options are passed uninterpreted to the "
2575 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2576 "socket.hE<gt>> contains definitions for socket level options, described "
2577 "below.  Options at other protocol levels vary in format and name; consult "
2578 "the appropriate entries in section 4 of the manual."
2579 msgstr ""
2580 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコルモジュー"
2581 "ルに 渡されて解釈される。インクルードファイル I<E<lt>sys/socket.hE<gt>> には"
2582 "後述のソケット層のオプションの定義が含まれている。 他のプロトコル層では名前や"
2583 "形式は異なる。 マニュアルのセクション 4 の適切なエントリーを参照すること。"
2584
2585 #. type: Plain text
2586 #: build/C/man2/getsockopt.2:127
2587 msgid ""
2588 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2589 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2590 "or zero if the option is to be disabled."
2591 msgstr ""
2592 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2593 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2594 "を指定し、 無効(disable)にするにはゼロを指定する。"
2595
2596 #. type: Plain text
2597 #: build/C/man2/getsockopt.2:131
2598 msgid ""
2599 "For a description of the available socket options see B<socket>(7)  and the "
2600 "appropriate protocol man pages."
2601 msgstr ""
2602 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2603 "ルの man ページを参照のこと。"
2604
2605 #. type: Plain text
2606 #: build/C/man2/getsockopt.2:152
2607 msgid ""
2608 "The address pointed to by I<optval> is not in a valid part of the process "
2609 "address space.  For B<getsockopt>(), this error may also be returned if "
2610 "I<optlen> is not in a valid part of the process address space."
2611 msgstr ""
2612 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2613 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2614 "い場合にもこのエラーが返される。"
2615
2616 #. type: Plain text
2617 #: build/C/man2/getsockopt.2:163
2618 msgid ""
2619 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2620 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2621 "option described in B<ip>(7))."
2622 msgstr ""
2623 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2624 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2625 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2626
2627 #. type: TP
2628 #: build/C/man2/getsockopt.2:163
2629 #, no-wrap
2630 msgid "B<ENOPROTOOPT>"
2631 msgstr "B<ENOPROTOOPT>"
2632
2633 #. type: Plain text
2634 #: build/C/man2/getsockopt.2:166
2635 msgid "The option is unknown at the level indicated."
2636 msgstr "指定された層(level)にはこのオプションは存在しない。"
2637
2638 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2639 #.  not document the
2640 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2641 #.  options
2642 #. type: Plain text
2643 #: build/C/man2/getsockopt.2:178
2644 msgid ""
2645 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2646 msgstr ""
2647 "SVr4, 4.4BSD (これらのシステムコールは 4.2BSD で最初に現れた), POSIX.1-2001."
2648
2649 #. type: Plain text
2650 #: build/C/man2/getsockopt.2:199
2651 msgid ""
2652 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2653 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2654 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2655 "glibc.  See also B<accept>(2)."
2656 msgstr ""
2657 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2658 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2659 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2660 "る。 B<accept>(2)  も参照のこと。"
2661
2662 #. type: Plain text
2663 #: build/C/man2/getsockopt.2:202
2664 msgid ""
2665 "Several of the socket options should be handled at lower levels of the "
2666 "system."
2667 msgstr ""
2668 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2669
2670 #. type: Plain text
2671 #: build/C/man2/getsockopt.2:213
2672 msgid ""
2673 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2674 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2675 msgstr ""
2676 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2677 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2678
2679 #. type: TH
2680 #: build/C/man3/if_nameindex.3:26
2681 #, no-wrap
2682 msgid "IF_NAMEINDEX"
2683 msgstr "IF_NAMEINDEX"
2684
2685 #. type: TH
2686 #: build/C/man3/if_nameindex.3:26
2687 #, no-wrap
2688 msgid "2012-11-21"
2689 msgstr "2012-11-21"
2690
2691 #. type: Plain text
2692 #: build/C/man3/if_nameindex.3:29
2693 msgid ""
2694 "if_nameindex, if_freenameindex - get network interface names and indexes"
2695 msgstr ""
2696 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2697 "クスを取得する"
2698
2699 #. type: Plain text
2700 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2701 #, no-wrap
2702 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2703 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2704
2705 #. type: Plain text
2706 #: build/C/man3/if_nameindex.3:35
2707 #, no-wrap
2708 msgid ""
2709 "B<struct if_nameindex *if_nameindex(void);>\n"
2710 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2711 msgstr ""
2712 "B<struct if_nameindex *if_nameindex(void);>\n"
2713 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2714
2715 #. type: Plain text
2716 #: build/C/man3/if_nameindex.3:46
2717 msgid ""
2718 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2719 "structures, each containing information about one of the network interfaces "
2720 "on the local system.  The I<if_nameindex> structure contains at least the "
2721 "following entries:"
2722 msgstr ""
2723 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2724 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2725 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2726
2727 #. type: Plain text
2728 #: build/C/man3/if_nameindex.3:51
2729 #, no-wrap
2730 msgid ""
2731 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2732 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2733 msgstr ""
2734 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2735 "    char        *if_name;  /*ヌル終端された名前 (\"eth0\" など) */\n"
2736
2737 #. type: Plain text
2738 #: build/C/man3/if_nameindex.3:65
2739 msgid ""
2740 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2741 "points to the null-terminated interface name.  The end of the array is "
2742 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2743 msgstr ""
2744 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2745 "フィールドはヌル終端されたインターフェース名を指す。 配列の最後は、 "
2746 "I<if_index> が 0 で I<ifa_name> が NULL のエントリーで示される。"
2747
2748 #. type: Plain text
2749 #: build/C/man3/if_nameindex.3:71
2750 msgid ""
2751 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2752 "and should be freed using B<if_freenameindex>()  when no longer needed."
2753 msgstr ""
2754 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2755 "は B<if_freenameindex>() で解放すべきである。"
2756
2757 #. type: Plain text
2758 #: build/C/man3/if_nameindex.3:78
2759 msgid ""
2760 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2761 "is returned, and I<errno> is set appropriately."
2762 msgstr ""
2763 "成功した場合には B<if_nameindex>() は配列へのポインターを返す。エラー時には "
2764 "NULL が返され、 I<errno> が適切に設定される。"
2765
2766 #. type: Plain text
2767 #: build/C/man3/if_nameindex.3:83
2768 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2769 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2770
2771 #. type: Plain text
2772 #: build/C/man3/if_nameindex.3:86
2773 msgid "Insufficient resources available."
2774 msgstr "利用可能なリソースが十分にない。"
2775
2776 #. type: Plain text
2777 #: build/C/man3/if_nameindex.3:97
2778 msgid ""
2779 "B<if_nameindex>()  may also fail for any of the errors specified for "
2780 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2781 "B<sendto>(2), or B<malloc>(3)."
2782 msgstr ""
2783 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), "
2784 "B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定され"
2785 "ているエラーのいずれかで失敗する場合がある。"
2786
2787 #. type: Plain text
2788 #: build/C/man3/if_nameindex.3:104
2789 msgid ""
2790 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2791 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2792 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2793 "available only on kernels that support netlink."
2794 msgstr ""
2795 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2796 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2797 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2798 "netlink をサポートするカーネルにおいてのみである。"
2799
2800 #. type: Plain text
2801 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:94
2802 msgid "RFC\\ 3493, POSIX.1-2001."
2803 msgstr "RFC\\ 3493, POSIX.1-2001."
2804
2805 #. type: Plain text
2806 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:96
2807 msgid "This function first appeared in BSDi."
2808 msgstr "この関数は BSDi 初めて登場した。"
2809
2810 #. type: Plain text
2811 #: build/C/man3/if_nameindex.3:112
2812 msgid ""
2813 "The program below demonstrates the use of the functions described on this "
2814 "page.  An example of the output this program might produce is the following:"
2815 msgstr ""
2816 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2817 "ムが生成する出力は以下のようになる。"
2818
2819 #. type: Plain text
2820 #: build/C/man3/if_nameindex.3:119
2821 #, no-wrap
2822 msgid ""
2823 "$ B<./a.out>I<\n"
2824 "1: lo\n"
2825 "2: wlan0\n"
2826 "3: em1>\n"
2827 msgstr ""
2828 "$ B<./a.out>I<\n"
2829 "1: lo\n"
2830 "2: wlan0\n"
2831 "3: em1>\n"
2832
2833 #. type: Plain text
2834 #: build/C/man3/if_nameindex.3:127
2835 #, no-wrap
2836 msgid ""
2837 "#include E<lt>net/if.hE<gt>\n"
2838 "#include E<lt>stdio.hE<gt>\n"
2839 "#include E<lt>stdlib.hE<gt>\n"
2840 "#include E<lt>unistd.hE<gt>\n"
2841 msgstr ""
2842 "#include E<lt>net/if.hE<gt>\n"
2843 "#include E<lt>stdio.hE<gt>\n"
2844 "#include E<lt>stdlib.hE<gt>\n"
2845 "#include E<lt>unistd.hE<gt>\n"
2846
2847 #. type: Plain text
2848 #: build/C/man3/if_nameindex.3:132
2849 #, no-wrap
2850 msgid ""
2851 "int\n"
2852 "main(int argc, char *argv[])\n"
2853 "{\n"
2854 "    struct if_nameindex *if_ni, *i;\n"
2855 msgstr ""
2856 "int\n"
2857 "main(int argc, char *argv[])\n"
2858 "{\n"
2859 "    struct if_nameindex *if_ni, *i;\n"
2860
2861 #. type: Plain text
2862 #: build/C/man3/if_nameindex.3:138
2863 #, no-wrap
2864 msgid ""
2865 "    if_ni = if_nameindex();\n"
2866 "    if (if_ni == NULL) {\n"
2867 "        perror(\"if_nameindex\");\n"
2868 "        exit(EXIT_FAILURE);\n"
2869 "    }\n"
2870 msgstr ""
2871 "    if_ni = if_nameindex();\n"
2872 "    if (if_ni == NULL) {\n"
2873 "        perror(\"if_nameindex\");\n"
2874 "        exit(EXIT_FAILURE);\n"
2875 "    }\n"
2876
2877 #. type: Plain text
2878 #: build/C/man3/if_nameindex.3:141
2879 #, no-wrap
2880 msgid ""
2881 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2882 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2883 msgstr ""
2884 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2885 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2886
2887 #. type: Plain text
2888 #: build/C/man3/if_nameindex.3:143
2889 #, no-wrap
2890 msgid "    if_freenameindex(if_ni);\n"
2891 msgstr "    if_freenameindex(if_ni);\n"
2892
2893 #. type: Plain text
2894 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:591
2895 #, no-wrap
2896 msgid ""
2897 "    exit(EXIT_SUCCESS);\n"
2898 "}\n"
2899 msgstr ""
2900 "    exit(EXIT_SUCCESS);\n"
2901 "}\n"
2902
2903 #. type: Plain text
2904 #: build/C/man3/if_nameindex.3:154
2905 msgid ""
2906 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2907 "B<if_nametoindex>(3), B<ifconfig>(8)"
2908 msgstr ""
2909 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2910 "B<if_nametoindex>(3), B<ifconfig>(8)"
2911
2912 #. type: TH
2913 #: build/C/man3/if_nametoindex.3:25
2914 #, no-wrap
2915 msgid "IF_NAMETOINDEX"
2916 msgstr "IF_NAMETOINDEX"
2917
2918 #. type: TH
2919 #: build/C/man3/if_nametoindex.3:25
2920 #, no-wrap
2921 msgid "2014-04-01"
2922 msgstr "2014-04-01"
2923
2924 #. type: Plain text
2925 #: build/C/man3/if_nametoindex.3:29
2926 msgid ""
2927 "if_nametoindex, if_indextoname - mappings between network interface names "
2928 "and indexes"
2929 msgstr ""
2930 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2931 "クスのマッピングを行う"
2932
2933 #. type: Plain text
2934 #: build/C/man3/if_nametoindex.3:34
2935 #, no-wrap
2936 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2937 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2938
2939 #. type: Plain text
2940 #: build/C/man3/if_nametoindex.3:36
2941 #, no-wrap
2942 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2943 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2944
2945 #. type: Plain text
2946 #: build/C/man3/if_nametoindex.3:43
2947 msgid ""
2948 "The B<if_nametoindex>()  function returns the index of the network interface "
2949 "corresponding to the name I<ifname>."
2950 msgstr ""
2951 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2952 "のインデックスを返す。"
2953
2954 #. type: Plain text
2955 #: build/C/man3/if_nametoindex.3:54
2956 msgid ""
2957 "The B<if_indextoname>()  function returns the name of the network interface "
2958 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2959 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2960 "least B<IF_NAMESIZE> bytes."
2961 msgstr ""
2962 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2963 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2964 "ファーに格納される。 バッファーは少なくとも B<IF_NAMESIZE> バイトの領域が必要"
2965 "である。"
2966
2967 #. type: Plain text
2968 #: build/C/man3/if_nametoindex.3:61
2969 msgid ""
2970 "On success, B<if_nametoindex>()  returns the index number of the network "
2971 "interface; on error, 0 is returned and I<errno> is set appropriately."
2972 msgstr ""
2973 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2974 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2975
2976 #. type: Plain text
2977 #: build/C/man3/if_nametoindex.3:69
2978 msgid ""
2979 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2980 "returned and I<errno> is set appropriately."
2981 msgstr ""
2982 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2983 "が返され、 I<errno> が適切に設定される。"
2984
2985 #. type: Plain text
2986 #: build/C/man3/if_nametoindex.3:74
2987 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2988 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2989
2990 #. type: TP
2991 #: build/C/man3/if_nametoindex.3:74
2992 #, no-wrap
2993 msgid "B<ENXIO>"
2994 msgstr "B<ENXIO>"
2995
2996 #. type: Plain text
2997 #: build/C/man3/if_nametoindex.3:77
2998 msgid "No interface found for the index."
2999 msgstr "インデックスに対応するインターフェースがない。"
3000
3001 #. type: Plain text
3002 #: build/C/man3/if_nametoindex.3:85
3003 msgid ""
3004 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
3005 "errors specified for B<socket>(2)  or B<ioctl>(2)."
3006 msgstr ""
3007 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
3008 "に対して規定されているエラーのいずれかで失敗する場合がある。"
3009
3010 #. type: Plain text
3011 #: build/C/man3/if_nametoindex.3:92
3012 msgid ""
3013 "The B<if_nametoindex>()  and B<if_indextoname>()  functions are thread-safe."
3014 msgstr ""
3015 "関数 B<if_nametoindex>() と B<if_indextoname>() はスレッドセーフである。"
3016
3017 #. type: Plain text
3018 #: build/C/man3/if_nametoindex.3:100
3019 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3020 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3021
3022 #. type: TH
3023 #: build/C/man2/listen.2:45
3024 #, no-wrap
3025 msgid "LISTEN"
3026 msgstr "LISTEN"
3027
3028 #. type: TH
3029 #: build/C/man2/listen.2:45
3030 #, no-wrap
3031 msgid "2014-05-10"
3032 msgstr "2014-05-10"
3033
3034 #. type: Plain text
3035 #: build/C/man2/listen.2:48
3036 msgid "listen - listen for connections on a socket"
3037 msgstr "listen - ソケット(socket)上の接続を待つ"
3038
3039 #. type: Plain text
3040 #: build/C/man2/listen.2:55
3041 #, no-wrap
3042 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3043 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3044
3045 #. type: Plain text
3046 #: build/C/man2/listen.2:63
3047 msgid ""
3048 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
3049 "that is, as a socket that will be used to accept incoming connection "
3050 "requests using B<accept>(2)."
3051 msgstr ""
3052 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3053 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
3054 "した接続要求を受け付けるのに使用されるソケットである。"
3055
3056 #. type: Plain text
3057 #: build/C/man2/listen.2:70
3058 msgid ""
3059 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3060 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3061 msgstr ""
3062 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3063 "するファイルディスクリプターである。"
3064
3065 #. type: Plain text
3066 #: build/C/man2/listen.2:82
3067 msgid ""
3068 "The I<backlog> argument defines the maximum length to which the queue of "
3069 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3070 "when the queue is full, the client may receive an error with an indication "
3071 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3072 "the request may be ignored so that a later reattempt at connection succeeds."
3073 msgstr ""
3074 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3075 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3076 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3077 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3078 "い。"
3079
3080 #. type: Plain text
3081 #: build/C/man2/listen.2:91
3082 msgid "Another socket is already listening on the same port."
3083 msgstr "別のソケットが既に同じポートを listen している。"
3084
3085 #. type: Plain text
3086 #: build/C/man2/listen.2:114 build/C/man2/send.2:386
3087 msgid "The argument I<sockfd> is not a socket."
3088 msgstr "引き数 I<sockfd> はソケットではない。"
3089
3090 #. type: Plain text
3091 #: build/C/man2/listen.2:119
3092 msgid "The socket is not of a type that supports the B<listen>()  operation."
3093 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3094
3095 #. type: Plain text
3096 #: build/C/man2/listen.2:124
3097 msgid ""
3098 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3099 "4.2BSD."
3100 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3101
3102 #. type: Plain text
3103 #: build/C/man2/listen.2:126
3104 msgid "To accept connections, the following steps are performed:"
3105 msgstr "接続を受け付けるには、以下の処理が実行される。"
3106
3107 #. type: TP
3108 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:347
3109 #, no-wrap
3110 msgid "1."
3111 msgstr "1."
3112
3113 #. type: Plain text
3114 #: build/C/man2/listen.2:130
3115 msgid "A socket is created with B<socket>(2)."
3116 msgstr "B<socket>(2)  でソケットを作成する。"
3117
3118 #. type: TP
3119 #: build/C/man2/listen.2:130 build/C/man2/select_tut.2:356
3120 #, no-wrap
3121 msgid "2."
3122 msgstr "2."
3123
3124 #. type: Plain text
3125 #: build/C/man2/listen.2:136
3126 msgid ""
3127 "The socket is bound to a local address using B<bind>(2), so that other "
3128 "sockets may be B<connect>(2)ed to it."
3129 msgstr ""
3130 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3131 "のソケットに B<connect>(2)  できるようにする。"
3132
3133 #. type: TP
3134 #: build/C/man2/listen.2:136 build/C/man2/select_tut.2:360
3135 #, no-wrap
3136 msgid "3."
3137 msgstr "3."
3138
3139 #. type: Plain text
3140 #: build/C/man2/listen.2:140
3141 msgid ""
3142 "A willingness to accept incoming connections and a queue limit for incoming "
3143 "connections are specified with B<listen>()."
3144 msgstr ""
3145 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3146 "定する。"
3147
3148 #. type: TP
3149 #: build/C/man2/listen.2:140 build/C/man2/select_tut.2:367
3150 #, no-wrap
3151 msgid "4."
3152 msgstr "4."
3153
3154 #. type: Plain text
3155 #: build/C/man2/listen.2:143
3156 msgid "Connections are accepted with B<accept>(2)."
3157 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3158
3159 #. type: Plain text
3160 #: build/C/man2/listen.2:166
3161 msgid ""
3162 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3163 "2.2.  Now it specifies the queue length for I<completely> established "
3164 "sockets waiting to be accepted, instead of the number of incomplete "
3165 "connection requests.  The maximum length of the queue for incomplete sockets "
3166 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3167 "are enabled there is no logical maximum length and this setting is ignored.  "
3168 "See B<tcp>(7)  for more information."
3169 msgstr ""
3170 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3171 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3172 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3173 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3174 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3175 "論理的な最大長は存在せず、この設定は無視される。"
3176
3177 #.  The following is now rather historic information (MTK, Jun 05)
3178 #.  Don't rely on this value in portable applications since BSD
3179 #.  (and some BSD-derived systems) limit the backlog to 5.
3180 #. type: Plain text
3181 #: build/C/man2/listen.2:179
3182 msgid ""
3183 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3184 "somaxconn>, then it is silently truncated to that value; the default value "
3185 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3186 "value, B<SOMAXCONN>, with the value 128."
3187 msgstr ""
3188 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3189 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3190 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3191 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3192
3193 #. type: Plain text
3194 #: build/C/man2/listen.2:188
3195 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3196 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3197
3198 #. type: TH
3199 #: build/C/man2/recv.2:41
3200 #, no-wrap
3201 msgid "RECV"
3202 msgstr "RECV"
3203
3204 #. type: Plain text
3205 #: build/C/man2/recv.2:44
3206 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3207 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3208
3209 #. type: Plain text
3210 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3211 #: build/C/man2/select_tut.2:47
3212 #, no-wrap
3213 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3214 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3215
3216 #. type: Plain text
3217 #: build/C/man2/recv.2:53
3218 #, no-wrap
3219 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3220 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3221
3222 #. type: Plain text
3223 #: build/C/man2/recv.2:56
3224 #, no-wrap
3225 msgid ""
3226 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3227 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3228 msgstr ""
3229 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3230 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3231
3232 #. type: Plain text
3233 #: build/C/man2/recv.2:58
3234 #, no-wrap
3235 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3236 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3237
3238 #. type: Plain text
3239 #: build/C/man2/recv.2:70
3240 msgid ""
3241 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3242 "messages from a socket.  They may be used to receive data on both "
3243 "connectionless and connection-oriented sockets.  This page first describes "
3244 "common features of all three system calls, and then describes the "
3245 "differences between the calls."
3246 msgstr ""
3247 "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受"
3248 "け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 "
3249 "(connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら "
3250 "3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違い"
3251 "について説明する。"
3252
3253 #. type: Plain text
3254 #: build/C/man2/recv.2:76
3255 msgid ""
3256 "All three calls return the length of the message on successful completion.  "
3257 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3258 "discarded depending on the type of socket the message is received from."
3259 msgstr ""
3260 "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返"
3261 "す。 メッセージが長過ぎて指定されたバッファーに入り切らなかった場合には、 "
3262 "メッセージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれ"
3263 "ない。"
3264
3265 #. type: Plain text
3266 #: build/C/man2/recv.2:86
3267 msgid ""
3268 "If no messages are available at the socket, the receive calls wait for a "
3269 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3270 "which case the value -1 is returned and the external variable I<errno> is "
3271 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3272 "data available, up to the requested amount, rather than waiting for receipt "
3273 "of the full amount requested."
3274 msgstr ""
3275 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3276 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3277 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3278 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3279 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3280 "る (受信されるデータの最大サイズは要求したサイズである)。"
3281
3282 #. type: Plain text
3283 #: build/C/man2/recv.2:93
3284 msgid ""
3285 "An application can use B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3286 "determine when more data arrives on a socket."
3287 msgstr ""
3288 "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットに"
3289 "さらにデータが到着しているかを判定することができる。"
3290
3291 #. type: SS
3292 #: build/C/man2/recv.2:93 build/C/man2/send.2:160
3293 #, no-wrap
3294 msgid "The flags argument"
3295 msgstr "フラグ引き数"
3296
3297 #. type: Plain text
3298 #: build/C/man2/recv.2:97
3299 msgid ""
3300 "The I<flags> argument is formed by ORing one or more of the following values:"
3301 msgstr ""
3302 "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指"
3303 "定する:"
3304
3305 #. type: TP
3306 #: build/C/man2/recv.2:97
3307 #, no-wrap
3308 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3309 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3310
3311 #. type: Plain text
3312 #: build/C/man2/recv.2:108
3313 msgid ""
3314 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3315 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3316 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3317 "flag of B<open>(2)."
3318 msgstr ""
3319 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3320 "ファイルディスクリプター経由で受信した ファイルディスクリプターについて "
3321 "close-on-exec フラグをセットする。 このフラグは、 B<open>(2)  の "
3322 "B<O_CLOEXEC> フラグと同じ理由で有用である。"
3323
3324 #. type: TP
3325 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3326 #, no-wrap
3327 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3328 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3329
3330 #. type: Plain text
3331 #: build/C/man2/recv.2:118
3332 msgid ""
3333 "Enables nonblocking operation; if the operation would block, the call fails "
3334 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3335 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3336 msgstr ""
3337 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3338 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3339 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3340
3341 #. type: TP
3342 #: build/C/man2/recv.2:118
3343 #, no-wrap
3344 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3345 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3346
3347 #. type: Plain text
3348 #: build/C/man2/recv.2:137
3349 msgid ""
3350 "This flag specifies that queued errors should be received from the socket "
3351 "error queue.  The error is passed in an ancillary message with a type "
3352 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3353 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3354 "information.  The payload of the original packet that caused the error is "
3355 "passed as normal data via I<msg_iovec>.  The original destination address of "
3356 "the datagram that caused the error is supplied via I<msg_name>."
3357 msgstr ""
3358 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3359 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3360 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3361 "ユーザーは十分なサイズのバッファーを用意しなければならない。 補助メッセージに"
3362 "関するより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原"
3363 "因となったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータ"
3364 "として渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3365 "I<msg_name> 経由で参照できる。"
3366
3367 #. type: Plain text
3368 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3369 msgid ""
3370 "For local errors, no address is passed (this can be checked with the "
3371 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3372 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3373 "the pending socket error is regenerated based on the next queued error and "
3374 "will be passed on the next socket operation."
3375 msgstr ""
3376 "ローカルなエラーの場合はアドレスは渡されない\n"
3377 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3378 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3379 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3380 "処理待ちのソケットエラーが再生成され、次のソケット操作の際に渡される。"
3381
3382 #. type: Plain text
3383 #: build/C/man2/recv.2:153
3384 msgid "The error is supplied in a I<sock_extended_err> structure:"
3385 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3386
3387 #. type: Plain text
3388 #: build/C/man2/recv.2:160
3389 #, no-wrap
3390 msgid ""
3391 "#define SO_EE_ORIGIN_NONE    0\n"
3392 "#define SO_EE_ORIGIN_LOCAL   1\n"
3393 "#define SO_EE_ORIGIN_ICMP    2\n"
3394 "#define SO_EE_ORIGIN_ICMP6   3\n"
3395 msgstr ""
3396 "#define SO_EE_ORIGIN_NONE    0\n"
3397 "#define SO_EE_ORIGIN_LOCAL   1\n"
3398 "#define SO_EE_ORIGIN_ICMP    2\n"
3399 "#define SO_EE_ORIGIN_ICMP6   3\n"
3400
3401 #. type: Plain text
3402 #: build/C/man2/recv.2:172
3403 #, no-wrap
3404 msgid ""
3405 "struct sock_extended_err\n"
3406 "{\n"
3407 "    uint32_t ee_errno;   /* error number */\n"
3408 "    uint8_t  ee_origin;  /* where the error originated */\n"
3409 "    uint8_t  ee_type;    /* type */\n"
3410 "    uint8_t  ee_code;    /* code */\n"
3411 "    uint8_t  ee_pad;     /* padding */\n"
3412 "    uint32_t ee_info;    /* additional information */\n"
3413 "    uint32_t ee_data;    /* other data */\n"
3414 "    /* More data may follow */\n"
3415 "};\n"
3416 msgstr ""
3417 "struct sock_extended_err\n"
3418 "{\n"
3419 "    uint32_t ee_errno;   /* error number */\n"
3420 "    uint8_t  ee_origin;  /* where the error originated */\n"
3421 "    uint8_t  ee_type;    /* type */\n"
3422 "    uint8_t  ee_code;    /* code */\n"
3423 "    uint8_t  ee_pad;     /* padding */\n"
3424 "    uint32_t ee_info;    /* additional information */\n"
3425 "    uint32_t ee_data;    /* other data */\n"
3426 "    /* More data may follow */\n"
3427 "};\n"
3428
3429 #. type: Plain text
3430 #: build/C/man2/recv.2:174
3431 #, no-wrap
3432 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3433 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3434
3435 #. type: Plain text
3436 #: build/C/man2/recv.2:198
3437 msgid ""
3438 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3439 "is the origin code of where the error originated.  The other fields are "
3440 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3441 "address of the network object where the error originated from given a "
3442 "pointer to the ancillary message.  If this address is not known, the "
3443 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3444 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3445 "caused the error is passed as normal data."
3446 msgstr ""
3447 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3448 "I<ee_origin> にはエラーが発生した場所のオリジンコード (origin code) が入って"
3449 "いる。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、こ"
3450 "の補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェク"
3451 "トのアドレスへのポインターを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3452 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3453 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3454 "される。"
3455
3456 #. type: TP
3457 #: build/C/man2/recv.2:212 build/C/man2/recv.2:401 build/C/man2/send.2:230
3458 #, no-wrap
3459 msgid "B<MSG_OOB>"
3460 msgstr "B<MSG_OOB>"
3461
3462 #. type: Plain text
3463 #: build/C/man2/recv.2:219
3464 msgid ""
3465 "This flag requests receipt of out-of-band data that would not be received in "
3466 "the normal data stream.  Some protocols place expedited data at the head of "
3467 "the normal data queue, and thus this flag cannot be used with such protocols."
3468 msgstr ""
3469 "このフラグは、通常のデータストリームでは受信できない 帯域外 (out-of-band) "
3470 "データの受信を要求する。 プロトコルによっては、 通常のデータキューの先頭に速"
3471 "達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3472 "い。"
3473
3474 #. type: TP
3475 #: build/C/man2/recv.2:219
3476 #, no-wrap
3477 msgid "B<MSG_PEEK>"
3478 msgstr "B<MSG_PEEK>"
3479
3480 #. type: Plain text
3481 #: build/C/man2/recv.2:226
3482 msgid ""
3483 "This flag causes the receive operation to return data from the beginning of "
3484 "the receive queue without removing that data from the queue.  Thus, a "
3485 "subsequent receive call will return the same data."
3486 msgstr ""
3487 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3488 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3489 "が返ることになる。"
3490
3491 #. type: TP
3492 #: build/C/man2/recv.2:226
3493 #, no-wrap
3494 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3495 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3496
3497 #. type: Plain text
3498 #: build/C/man2/recv.2:234
3499 msgid ""
3500 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3501 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3502 "return the real length of the packet or datagram, even when it was longer "
3503 "than the passed buffer."
3504 msgstr ""
3505 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3506 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3507 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファーよりも長かっ"
3508 "た場合にも、 パケットやデータグラムの実際の長さを返す。"
3509
3510 #. type: Plain text
3511 #: build/C/man2/recv.2:237
3512 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3513 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3514
3515 #. type: TP
3516 #: build/C/man2/recv.2:237
3517 #, no-wrap
3518 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3519 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3520
3521 #. type: Plain text
3522 #: build/C/man2/recv.2:245
3523 msgid ""
3524 "This flag requests that the operation block until the full request is "
3525 "satisfied.  However, the call may still return less data than requested if a "
3526 "signal is caught, an error or disconnect occurs, or the next data to be "
3527 "received is of a different type than that returned."
3528 msgstr ""
3529 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3530 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3531 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3532 "りデータが少なくても返ることがある。"
3533
3534 #. type: SS
3535 #: build/C/man2/recv.2:245
3536 #, no-wrap
3537 msgid "recvfrom()"
3538 msgstr "recvfrom()"
3539
3540 #. type: Plain text
3541 #: build/C/man2/recv.2:251
3542 msgid ""
3543 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3544 "caller must specify the size of the buffer in I<len>."
3545 msgstr ""
3546 "B<recvfrom>() は受信したメッセージをバッファー I<buf> に格納する。 呼び出し元"
3547 "はバッファーサイズを I<len> で指定しなければならない。"
3548
3549 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3550 #.  .I src_addr
3551 #.  is filled in.
3552 #.  .I src_addr
3553 #.  is also filled in for stream sockets in the UNIX domain, but is not
3554 #.  filled in for stream sockets in the Internet domain.)
3555 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3556 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3557 #. type: Plain text
3558 #: build/C/man2/recv.2:279
3559 msgid ""
3560 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3561 "address of the message, that source address is placed in the buffer pointed "
3562 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3563 "Before the call, it should be initialized to the size of the buffer "
3564 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3565 "the actual size of the source address.  The returned address is truncated if "
3566 "the buffer provided is too small; in this case, I<addrlen> will return a "
3567 "value greater than was supplied to the call."
3568 msgstr ""
3569 "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが"
3570 "分かる場合、 この送信元アドレスが I<src_addr> が指すバッファーに格納される。 "
3571 "この場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元"
3572 "は I<src_addr> に割り当てたバッファーの大きさで初期化しておくべきである。 "
3573 "返ってくる時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡"
3574 "されたバッファーが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められ"
3575 "る。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返"
3576 "される。"
3577
3578 #. type: Plain text
3579 #: build/C/man2/recv.2:286
3580 msgid ""
3581 "If the caller is not interested in the source address, I<src_addr> and "
3582 "I<addrlen> should be specified as NULL."
3583 msgstr ""
3584 "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> と I<addrlen> に"
3585 "は NULL を指定すべきである。"
3586
3587 #. type: SS
3588 #: build/C/man2/recv.2:286
3589 #, no-wrap
3590 msgid "recv()"
3591 msgstr "recv()"
3592
3593 #. type: Plain text
3594 #: build/C/man2/recv.2:294
3595 msgid ""
3596 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3597 "B<connect>(2)).  It is equivalent to the call:"
3598 msgstr ""
3599 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用さ"
3600 "れる (B<connect>(2) 参照)。次の呼び出しと等価である。"
3601
3602 #. type: Plain text
3603 #: build/C/man2/recv.2:297
3604 #, no-wrap
3605 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3606 msgstr "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3607
3608 #. type: SS
3609 #: build/C/man2/recv.2:297
3610 #, no-wrap
3611 msgid "recvmsg()"
3612 msgstr "recvmsg()"
3613
3614 #. type: Plain text
3615 #: build/C/man2/recv.2:305
3616 msgid ""
3617 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3618 "directly supplied arguments.  This structure is defined as follows in "
3619 "I<E<lt>sys/socket.hE<gt>>:"
3620 msgstr ""
3621 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3622 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3623
3624 #. type: Plain text
3625 #: build/C/man2/recv.2:312
3626 #, no-wrap
3627 msgid ""
3628 "struct iovec {                    /* Scatter/gather array items */\n"
3629 "    void  *iov_base;              /* Starting address */\n"
3630 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3631 "};\n"
3632 msgstr ""
3633 "struct iovec {                    /* Scatter/gather array items */\n"
3634 "    void  *iov_base;              /* Starting address */\n"
3635 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3636 "};\n"
3637
3638 #. type: Plain text
3639 #: build/C/man2/recv.2:322
3640 #, no-wrap
3641 msgid ""
3642 "struct msghdr {\n"
3643 "    void         *msg_name;       /* optional address */\n"
3644 "    socklen_t     msg_namelen;    /* size of address */\n"
3645 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3646 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3647 "    void         *msg_control;    /* ancillary data, see below */\n"
3648 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3649 "    int           msg_flags;      /* flags on received message */\n"
3650 "};\n"
3651 msgstr ""
3652 "struct msghdr {\n"
3653 "    void         *msg_name;       /* 追加のアドレス */\n"
3654 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3655 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3656 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3657 "    void         *msg_control;    /* 補助データ (後述) */\n"
3658 "    size_t        msg_controllen; /* 補助データバッファー長 */\n"
3659 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3660 "};\n"
3661
3662 #. type: Plain text
3663 #: build/C/man2/recv.2:338
3664 msgid ""
3665 "The I<msg_name> field points to a caller-allocated buffer that is used to "
3666 "return the source address if the socket is unconnected.  The caller should "
3667 "set I<msg_namelen> to the size of this buffer before this call; upon return "
3668 "from a successful call, I<msg_namelen> will contain the length of the "
3669 "returned address.  If the application does not need to know the source "
3670 "address, I<msg_name> can be specified as NULL."
3671 msgstr ""
3672 "フィールド I<msg_name> は、 ソケットが接続されていない場合に送信元アドレスを"
3673 "返すのに使用されるバッファーを指す。 このバッファーは呼び出し元が確保する。 "
3674 "呼び出し元は呼び出し前に I<msg_namelen> にこのバッファーの大きさを設定しなけ"
3675 "ればならない。 呼び出しが成功した場合、呼び出しから返って来た際には "
3676 "I<msg_namelen> には返されるアドレスの長さが入っている。 アプリケーションが送"
3677 "信元アドレスを知る必要がない場合には、 I<msg_name> に NULL を指定することがで"
3678 "きる。"
3679
3680 #. type: Plain text
3681 #: build/C/man2/recv.2:345
3682 msgid ""
3683 "The fields I<msg_iov> and I<msg_iovlen> describe scatter-gather locations, "
3684 "as discussed in B<readv>(2)."
3685 msgstr ""
3686 "I<msg_iov> と I<msg_iovlen> フィールドは scatter-gather 用の場所を指定する。 "
3687 "B<readv>(2) に説明がある。"
3688
3689 #. type: Plain text
3690 #: build/C/man2/recv.2:360
3691 msgid ""
3692 "The field I<msg_control>, which has length I<msg_controllen>, points to a "
3693 "buffer for other protocol control-related messages or miscellaneous "
3694 "ancillary data.  When B<recvmsg>()  is called, I<msg_controllen> should "
3695 "contain the length of the available buffer in I<msg_control>; upon return "
3696 "from a successful call it will contain the length of the control message "
3697 "sequence."
3698 msgstr ""
3699 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3700 "御メッセージや 種々の補助データのためのバッファーへのポインターである。 "
3701 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファー"
3702 "の長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の"
3703 "長さが入っている。"
3704
3705 #. type: Plain text
3706 #: build/C/man2/recv.2:362
3707 msgid "The messages are of the form:"
3708 msgstr "メッセージの形式は以下の通り:"
3709
3710 #. type: Plain text
3711 #: build/C/man2/recv.2:372
3712 #, no-wrap
3713 msgid ""
3714 "struct cmsghdr {\n"
3715 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3716 "    int           cmsg_level;   /* originating protocol */\n"
3717 "    int           cmsg_type;    /* protocol-specific type */\n"
3718 "/* followed by\n"
3719 "    unsigned char cmsg_data[]; */\n"
3720 "};\n"
3721 msgstr ""
3722 "struct cmsghdr {\n"
3723 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3724 "    int           cmsg_level;   /* originating protocol */\n"
3725 "    int           cmsg_type;    /* protocol-specific type */\n"
3726 "/* followed by\n"
3727 "    unsigned char cmsg_data[]; */\n"
3728 "};\n"
3729
3730 #. type: Plain text
3731 #: build/C/man2/recv.2:377
3732 msgid ""
3733 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3734 msgstr ""
3735 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3736
3737 #. type: Plain text
3738 #: build/C/man2/recv.2:380
3739 msgid ""
3740 "As an example, Linux uses this ancillary data mechanism to pass extended "
3741 "errors, IP options, or file descriptors over UNIX domain sockets."
3742 msgstr ""
3743 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3744 "での拡張エラーや IP オプション、 ファイルディスクリプターの受け渡しに利用して"
3745 "いる。"
3746
3747 #. type: Plain text
3748 #: build/C/man2/recv.2:388
3749 msgid ""
3750 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3751 "It can contain several flags:"
3752 msgstr ""
3753 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3754 "れる。ここにはいくつかのフラグが入る。"
3755
3756 #. type: TP
3757 #: build/C/man2/recv.2:388
3758 #, no-wrap
3759 msgid "B<MSG_EOR>"
3760 msgstr "B<MSG_EOR>"
3761
3762 #. type: Plain text
3763 #: build/C/man2/recv.2:393
3764 msgid ""
3765 "indicates end-of-record; the data returned completed a record (generally "
3766 "used with sockets of type B<SOCK_SEQPACKET>)."
3767 msgstr ""
3768 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3769 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3770
3771 #. type: TP
3772 #: build/C/man2/recv.2:393
3773 #, no-wrap
3774 msgid "B<MSG_TRUNC>"
3775 msgstr "B<MSG_TRUNC>"
3776
3777 #. type: Plain text
3778 #: build/C/man2/recv.2:397
3779 msgid ""
3780 "indicates that the trailing portion of a datagram was discarded because the "
3781 "datagram was larger than the buffer supplied."
3782 msgstr ""
3783 "データグラムが与えられたバッファーより大きかったために、 データグラムのはみ出"
3784 "した部分が捨てられたことを示す。"
3785
3786 #. type: TP
3787 #: build/C/man2/recv.2:397
3788 #, no-wrap
3789 msgid "B<MSG_CTRUNC>"
3790 msgstr "B<MSG_CTRUNC>"
3791
3792 #. type: Plain text
3793 #: build/C/man2/recv.2:401
3794 msgid ""
3795 "indicates that some control data were discarded due to lack of space in the "
3796 "buffer for ancillary data."
3797 msgstr ""
3798 "補助データのためのバッファーが不足したために、 制御データの一部が捨てられたこ"
3799 "とを示す。"
3800
3801 #. type: Plain text
3802 #: build/C/man2/recv.2:404
3803 msgid ""
3804 "is returned to indicate that expedited or out-of-band data were received."
3805 msgstr "速達データや帯域外データを受信したことを示す。"
3806
3807 #. type: TP
3808 #: build/C/man2/recv.2:404
3809 #, no-wrap
3810 msgid "B<MSG_ERRQUEUE>"
3811 msgstr "B<MSG_ERRQUEUE>"
3812
3813 #. type: Plain text
3814 #: build/C/man2/recv.2:408
3815 msgid ""
3816 "indicates that no data was received but an extended error from the socket "
3817 "error queue."
3818 msgstr ""
3819 "データは受信しなかったが ソケットのエラーキューから拡張エラーを受信したことを"
3820 "示す。"
3821
3822 #. type: Plain text
3823 #: build/C/man2/recv.2:414
3824 msgid ""
3825 "These calls return the number of bytes received, or -1 if an error "
3826 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3827 msgstr ""
3828 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3829 "にエラーを示す値を設定する。"
3830
3831 #. type: Plain text
3832 #: build/C/man2/recv.2:417
3833 msgid ""
3834 "When a stream socket peer has performed an orderly shutdown, the return "
3835 "value will be 0 (the traditional \"end-of-file\" return)."
3836 msgstr ""
3837 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3838 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3839
3840 #. type: Plain text
3841 #: build/C/man2/recv.2:421
3842 msgid ""
3843 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3844 "permit zero-length datagrams.  When such a datagram is received, the return "
3845 "value is 0."
3846 msgstr ""
3847 "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメイ"
3848 "ンなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受"
3849 "信した場合、 返り値は 0 となる。"
3850
3851 #. type: Plain text
3852 #: build/C/man2/recv.2:424
3853 msgid ""
3854 "The value 0 may also be returned if the requested number of bytes to receive "
3855 "from a stream socket was 0."
3856 msgstr ""
3857 "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返され"
3858 "る。"
3859
3860 #. type: Plain text
3861 #: build/C/man2/recv.2:429
3862 msgid ""
3863 "These are some standard errors generated by the socket layer.  Additional "
3864 "errors may be generated and returned from the underlying protocol modules; "
3865 "see their manual pages."
3866 msgstr ""
3867 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3868 "ルモジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照する"
3869 "こと。"
3870
3871 #.  Actually EAGAIN on Linux
3872 #. type: Plain text
3873 #: build/C/man2/recv.2:438
3874 msgid ""
3875 "The socket is marked nonblocking and the receive operation would block, or a "
3876 "receive timeout had been set and the timeout expired before data was "
3877 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3878 "and does not require these constants to have the same value, so a portable "
3879 "application should check for both possibilities."
3880 msgstr ""
3881 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3882 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3883 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3884 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3885 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3886
3887 #. type: Plain text
3888 #: build/C/man2/recv.2:443
3889 msgid "The argument I<sockfd> is an invalid descriptor."
3890 msgstr "引き数 I<sockfd> が不正なディスクリプターである。"
3891
3892 #. type: Plain text
3893 #: build/C/man2/recv.2:447
3894 msgid ""
3895 "A remote host refused to allow the network connection (typically because it "
3896 "is not running the requested service)."
3897 msgstr ""
3898 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3899 "たサービスが起動されていないなどがある)。"
3900
3901 #. type: Plain text
3902 #: build/C/man2/recv.2:451
3903 msgid ""
3904 "The receive buffer pointer(s) point outside the process's address space."
3905 msgstr "受信バッファーへのポインターがプロセスのアドレス空間外を指している。"
3906
3907 #. type: Plain text
3908 #: build/C/man2/recv.2:456
3909 msgid ""
3910 "The receive was interrupted by delivery of a signal before any data were "
3911 "available; see B<signal>(7)."
3912 msgstr ""
3913 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3914
3915 #. type: Plain text
3916 #: build/C/man2/recv.2:460 build/C/man2/send.2:355
3917 msgid "Invalid argument passed."
3918 msgstr "不正な引き数が渡された。"
3919
3920 #. type: Plain text
3921 #: build/C/man2/recv.2:464
3922 msgid "Could not allocate memory for B<recvmsg>()."
3923 msgstr "B<recvmsg>()  のためのメモリーが確保できなかった。"
3924
3925 #. type: TP
3926 #: build/C/man2/recv.2:464 build/C/man2/send.2:378
3927 #, no-wrap
3928 msgid "B<ENOTCONN>"
3929 msgstr "B<ENOTCONN>"
3930
3931 #. type: Plain text
3932 #: build/C/man2/recv.2:471
3933 msgid ""
3934 "The socket is associated with a connection-oriented protocol and has not "
3935 "been connected (see B<connect>(2)  and B<accept>(2))."
3936 msgstr ""
3937 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3938 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3939
3940 #. type: Plain text
3941 #: build/C/man2/recv.2:476
3942 msgid "The argument I<sockfd> does not refer to a socket."
3943 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3944
3945 #. type: Plain text
3946 #: build/C/man2/recv.2:479
3947 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3948 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3949
3950 #. type: Plain text
3951 #: build/C/man2/recv.2:486
3952 msgid ""
3953 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3954 "flags."
3955 msgstr ""
3956 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3957 "されている。"
3958
3959 #. type: Plain text
3960 #: build/C/man2/recv.2:492
3961 msgid "The I<socklen_t> type was invented by POSIX.  See also B<accept>(2)."
3962 msgstr "I<socklen_t> 型は POSIX で発案された。 B<accept>(2) も参照。"
3963
3964 #.  glibc bug raised 12 Mar 2006
3965 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3966 #.  The problem is an underlying kernel issue: the size of the
3967 #.  __kernel_size_t type used to type this field varies
3968 #.  across architectures, but socklen_t is always 32 bits.
3969 #. type: Plain text
3970 #: build/C/man2/recv.2:506 build/C/man2/send.2:428
3971 msgid ""
3972 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3973 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3974 "I<size_t>."
3975 msgstr ""
3976 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3977 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3978 "ある。"
3979
3980 #. type: Plain text
3981 #: build/C/man2/recv.2:511
3982 msgid ""
3983 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3984 "can be used to receive multiple datagrams in a single call."
3985 msgstr ""
3986 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3987 "固有の システムコールに関する情報が書かれている。"
3988
3989 #. type: Plain text
3990 #: build/C/man2/recv.2:516
3991 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3992 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3993
3994 #. type: Plain text
3995 #: build/C/man2/recv.2:527
3996 msgid ""
3997 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3998 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3999 msgstr ""
4000 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4001 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4002
4003 #. type: TH
4004 #: build/C/man2/recvmmsg.2:31
4005 #, no-wrap
4006 msgid "RECVMMSG"
4007 msgstr "RECVMMSG"
4008
4009 #. type: TH
4010 #: build/C/man2/recvmmsg.2:31
4011 #, no-wrap
4012 msgid "2014-06-13"
4013 msgstr "2014-06-13"
4014
4015 #. type: Plain text
4016 #: build/C/man2/recvmmsg.2:34
4017 msgid "recvmmsg - receive multiple messages on a socket"
4018 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
4019
4020 #. type: Plain text
4021 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
4022 #, no-wrap
4023 msgid ""
4024 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
4025 "B<#include E<lt>sys/socket.hE<gt>>\n"
4026 msgstr ""
4027 "B<#define _GNU_SOURCE>         /* feature_test_macros(7) 参照 */\n"
4028 "B<#include E<lt>sys/socket.hE<gt>>\n"
4029
4030 #. type: Plain text
4031 #: build/C/man2/recvmmsg.2:41
4032 #, no-wrap
4033 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4034 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4035
4036 #. type: Plain text
4037 #: build/C/man2/recvmmsg.2:43
4038 #, no-wrap
4039 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4040 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4041
4042 #. type: Plain text
4043 #: build/C/man2/recvmmsg.2:55
4044 msgid ""
4045 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
4046 "the caller to receive multiple messages from a socket using a single system "
4047 "call.  (This has performance benefits for some applications.)  A further "
4048 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
4049 "operation."
4050 msgstr ""
4051 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4052 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4053 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4054 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4055
4056 #. type: Plain text
4057 #: build/C/man2/recvmmsg.2:59
4058 msgid ""
4059 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4060 "from."
4061 msgstr ""
4062 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプターであ"
4063 "る。"
4064
4065 #. type: Plain text
4066 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4067 msgid ""
4068 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4069 "The size of this array is specified in I<vlen>."
4070 msgstr ""
4071 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4072 "I<vlen> で指定する。"
4073
4074 #. type: Plain text
4075 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4076 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4077 msgstr ""
4078 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4079
4080 #. type: Plain text
4081 #: build/C/man2/recvmmsg.2:80
4082 #, no-wrap
4083 msgid ""
4084 "struct mmsghdr {\n"
4085 "    struct msghdr msg_hdr;  /* Message header */\n"
4086 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4087 "};\n"
4088 msgstr ""
4089 "struct mmsghdr {\n"
4090 "    struct msghdr msg_hdr;  /* メッセージヘッダー */\n"
4091 "    unsigned int  msg_len;  /* このヘッダーで受信されたバイト数 */\n"
4092 "};\n"
4093
4094 #. type: Plain text
4095 #: build/C/man2/recvmmsg.2:95
4096 msgid ""
4097 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
4098 "B<recvmsg>(2).  The I<msg_len> field is the number of bytes returned for the "
4099 "message in the entry.  This field has the same value as the return value of "
4100 "a single B<recvmsg>(2)  on the header."
4101 msgstr ""
4102 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4103 "る。 I<msg_len> フィールドは、 このエントリーで返されるメッセージのバイト数"
4104 "で、 このヘッダーに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4105 "る。"
4106
4107 #. type: Plain text
4108 #: build/C/man2/recvmmsg.2:102
4109 msgid ""
4110 "The I<flags> argument contains flags ORed together.  The flags are the same "
4111 "as documented for B<recvmsg>(2), with the following addition:"
4112 msgstr ""
4113 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4114 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4115
4116 #. type: TP
4117 #: build/C/man2/recvmmsg.2:102
4118 #, no-wrap
4119 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4120 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4121
4122 #. type: Plain text
4123 #: build/C/man2/recvmmsg.2:107
4124 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4125 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4126
4127 #. type: Plain text
4128 #: build/C/man2/recvmmsg.2:122
4129 msgid ""
4130 "The I<timeout> argument points to a I<struct timespec> (see "
4131 "B<clock_gettime>(2))  defining a timeout (seconds plus nanoseconds) for the "
4132 "receive operation (I<but see BUGS!>).  (This interval will be rounded up to "
4133 "the system clock granularity, and kernel scheduling delays mean that the "
4134 "blocking interval may overrun by a small amount.)  If I<timeout> is NULL, "
4135 "then the operation blocks indefinitely."
4136 msgstr ""
4137 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4138 "ターで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (I<ただ"
4139 "し、バグを参照のこと>) (待ち時間はシステムクロックの粒度に切り上げられ、カー"
4140 "ネルのスケジューリング遅延により少しだけ長くなる可能性がある)。 I<timeout>が "
4141 "NULL の場合、 受信操作は無期限に停止 (block) する。"
4142
4143 #. type: Plain text
4144 #: build/C/man2/recvmmsg.2:133
4145 msgid ""
4146 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4147 "received or until the timeout expires.  A nonblocking call reads as many "
4148 "messages as are available (up to the limit specified by I<vlen>)  and "
4149 "returns immediately."
4150 msgstr ""
4151 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4152 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4153 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4154 "すぐに返る。"
4155
4156 #. type: Plain text
4157 #: build/C/man2/recvmmsg.2:148
4158 msgid ""
4159 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4160 "to contain information about each received message: I<msg_len> contains the "
4161 "size of the received message; the subfields of I<msg_hdr> are updated as "
4162 "described in B<recvmsg>(2).  The return value of the call indicates the "
4163 "number of elements of I<msgvec> that have been updated."
4164 msgstr ""
4165 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4166 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4167 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4168 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4169 "数である。"
4170
4171 #. type: Plain text
4172 #: build/C/man2/recvmmsg.2:156
4173 msgid ""
4174 "On success, B<recvmmsg>()  returns the number of messages received in "
4175 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4176 "error."
4177 msgstr ""
4178 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4179 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4180
4181 #. type: Plain text
4182 #: build/C/man2/recvmmsg.2:160
4183 msgid ""
4184 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4185 msgstr ""
4186 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4187 "がある。"
4188
4189 #. type: Plain text
4190 #: build/C/man2/recvmmsg.2:164
4191 msgid "I<timeout> is invalid."
4192 msgstr "I<timeout> が無効である。"
4193
4194 #. type: Plain text
4195 #: build/C/man2/recvmmsg.2:169
4196 msgid ""
4197 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4198 "was added in version 2.12."
4199 msgstr ""
4200 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4201 "はバージョン 2.12 以降で利用可能である。"
4202
4203 #. type: Plain text
4204 #: build/C/man2/recvmmsg.2:172
4205 msgid "B<recvmmsg>()  is Linux-specific."
4206 msgstr "B<recvmmsg>() は Linux 固有である。"
4207
4208 #. type: Plain text
4209 #: build/C/man2/recvmmsg.2:180
4210 msgid ""
4211 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4212 "socket and stores them in multiple buffers.  The call returns if all buffers "
4213 "are filled or if the timeout specified has expired."
4214 msgstr ""
4215 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4216 "し、それらを複数のバッファーに格納する。 呼び出しは、すべてのバッファーにメッ"
4217 "セージが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4218
4219 #. type: Plain text
4220 #: build/C/man2/recvmmsg.2:183
4221 msgid ""
4222 "The following snippet periodically generates UDP datagrams containing a "
4223 "random number:"
4224 msgstr ""
4225 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4226 "る。"
4227
4228 #. type: Plain text
4229 #: build/C/man2/recvmmsg.2:188
4230 #, no-wrap
4231 msgid ""
4232 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4233 "B<sleep 0.25; done>\n"
4234 msgstr ""
4235 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4236 "B<sleep 0.25; done>\n"
4237
4238 #. type: Plain text
4239 #: build/C/man2/recvmmsg.2:193
4240 msgid ""
4241 "These datagrams are read by the example application, which can give the "
4242 "following output:"
4243 msgstr ""
4244 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4245 "が得られる。"
4246
4247 #. type: Plain text
4248 #: build/C/man2/recvmmsg.2:203
4249 #, no-wrap
4250 msgid ""
4251 "$B< ./a.out>\n"
4252 "5 messages received\n"
4253 "1 11782\n"
4254 "2 11345\n"
4255 "3 304\n"
4256 "4 13514\n"
4257 "5 28421\n"
4258 msgstr ""
4259 "$B< ./a.out>\n"
4260 "5 messages received\n"
4261 "1 11782\n"
4262 "2 11345\n"
4263 "3 304\n"
4264 "4 13514\n"
4265 "5 28421\n"
4266
4267 #. type: Plain text
4268 #: build/C/man2/recvmmsg.2:214
4269 #, no-wrap
4270 msgid ""
4271 "#define _GNU_SOURCE\n"
4272 "#include E<lt>netinet/ip.hE<gt>\n"
4273 "#include E<lt>stdio.hE<gt>\n"
4274 "#include E<lt>stdlib.hE<gt>\n"
4275 "#include E<lt>string.hE<gt>\n"
4276 "#include E<lt>sys/socket.hE<gt>\n"
4277 msgstr ""
4278 "#define _GNU_SOURCE\n"
4279 "#include E<lt>netinet/ip.hE<gt>\n"
4280 "#include E<lt>stdio.hE<gt>\n"
4281 "#include E<lt>stdlib.hE<gt>\n"
4282 "#include E<lt>string.hE<gt>\n"
4283 "#include E<lt>sys/socket.hE<gt>\n"
4284
4285 #. type: Plain text
4286 #: build/C/man2/recvmmsg.2:227
4287 #, no-wrap
4288 msgid ""
4289 "int\n"
4290 "main(void)\n"
4291 "{\n"
4292 "#define VLEN 10\n"
4293 "#define BUFSIZE 200\n"
4294 "#define TIMEOUT 1\n"
4295 "    int sockfd, retval, i;\n"
4296 "    struct sockaddr_in sa;\n"
4297 "    struct mmsghdr msgs[VLEN];\n"
4298 "    struct iovec iovecs[VLEN];\n"
4299 "    char bufs[VLEN][BUFSIZE+1];\n"
4300 "    struct timespec timeout;\n"
4301 msgstr ""
4302 "int\n"
4303 "main(void)\n"
4304 "{\n"
4305 "#define VLEN 10\n"
4306 "#define BUFSIZE 200\n"
4307 "#define TIMEOUT 1\n"
4308 "    int sockfd, retval, i;\n"
4309 "    struct sockaddr_in sa;\n"
4310 "    struct mmsghdr msgs[VLEN];\n"
4311 "    struct iovec iovecs[VLEN];\n"
4312 "    char bufs[VLEN][BUFSIZE+1];\n"
4313 "    struct timespec timeout;\n"
4314
4315 #. type: Plain text
4316 #: build/C/man2/recvmmsg.2:233 build/C/man2/sendmmsg.2:201
4317 #, no-wrap
4318 msgid ""
4319 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4320 "    if (sockfd == -1) {\n"
4321 "        perror(\"socket()\");\n"
4322 "        exit(EXIT_FAILURE);\n"
4323 "    }\n"
4324 msgstr ""
4325 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4326 "    if (sockfd == -1) {\n"
4327 "        perror(\"socket()\");\n"
4328 "        exit(EXIT_FAILURE);\n"
4329 "    }\n"
4330
4331 #. type: Plain text
4332 #: build/C/man2/recvmmsg.2:241
4333 #, no-wrap
4334 msgid ""
4335 "    sa.sin_family = AF_INET;\n"
4336 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4337 "    sa.sin_port = htons(1234);\n"
4338 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4339 "        perror(\"bind()\");\n"
4340 "        exit(EXIT_FAILURE);\n"
4341 "    }\n"
4342 msgstr ""
4343 "    sa.sin_family = AF_INET;\n"
4344 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4345 "    sa.sin_port = htons(1234);\n"
4346 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4347 "        perror(\"bind()\");\n"
4348 "        exit(EXIT_FAILURE);\n"
4349 "    }\n"
4350
4351 #. type: Plain text
4352 #: build/C/man2/recvmmsg.2:249
4353 #, no-wrap
4354 msgid ""
4355 "    memset(msgs, 0, sizeof(msgs));\n"
4356 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4357 "        iovecs[i].iov_base         = bufs[i];\n"
4358 "        iovecs[i].iov_len          = BUFSIZE;\n"
4359 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4360 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4361 "    }\n"
4362 msgstr ""
4363 "    memset(msgs, 0, sizeof(msgs));\n"
4364 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4365 "        iovecs[i].iov_base         = bufs[i];\n"
4366 "        iovecs[i].iov_len          = BUFSIZE;\n"
4367 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4368 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4369 "    }\n"
4370
4371 #. type: Plain text
4372 #: build/C/man2/recvmmsg.2:252
4373 #, no-wrap
4374 msgid ""
4375 "    timeout.tv_sec = TIMEOUT;\n"
4376 "    timeout.tv_nsec = 0;\n"
4377 msgstr ""
4378 "    timeout.tv_sec = TIMEOUT;\n"
4379 "    timeout.tv_nsec = 0;\n"
4380
4381 #. type: Plain text
4382 #: build/C/man2/recvmmsg.2:258
4383 #, no-wrap
4384 msgid ""
4385 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4386 "    if (retval == -1) {\n"
4387 "        perror(\"recvmmsg()\");\n"
4388 "        exit(EXIT_FAILURE);\n"
4389 "    }\n"
4390 msgstr ""
4391 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4392 "    if (retval == -1) {\n"
4393 "        perror(\"recvmmsg()\");\n"
4394 "        exit(EXIT_FAILURE);\n"
4395 "    }\n"
4396
4397 #. type: Plain text
4398 #: build/C/man2/recvmmsg.2:266
4399 #, no-wrap
4400 msgid ""
4401 "    printf(\"%d messages received\\en\", retval);\n"
4402 "    for (i = 0; i E<lt> retval; i++) {\n"
4403 "        bufs[i][msgs[i].msg_len] = 0;\n"
4404 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4405 "    }\n"
4406 "    exit(EXIT_SUCCESS);\n"
4407 "}\n"
4408 msgstr ""
4409 "    printf(\"%d messages received\\en\", retval);\n"
4410 "    for (i = 0; i E<lt> retval; i++) {\n"
4411 "        bufs[i][msgs[i].msg_len] = 0;\n"
4412 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4413 "    }\n"
4414 "    exit(EXIT_SUCCESS);\n"
4415 "}\n"
4416
4417 #.  FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=75371
4418 #.  http://thread.gmane.org/gmane.linux.man/5677
4419 #. type: Plain text
4420 #: build/C/man2/recvmmsg.2:278
4421 msgid ""
4422 "The I<timeout> argument does not work as intended.  The timeout is checked "
4423 "only after the receipt of each datagram, so that if up to I<vlen-1> "
4424 "datagrams are received before the timeout expires, but then no further "
4425 "datagrams are received, the call will block forever."
4426 msgstr ""
4427 "I<timeout> 引き数は意図した通りには動作しない。 タイムアウトは各データグラム"
4428 "の受信後にのみチェックされる。 そのため、 タイムアウトが満了する前に "
4429 "I<vlen-1> 個のデータグラムを受信し、 その後全くデータグラムを受信しなかった場"
4430 "合、 呼び出しはずっと停止し続けてしまう。"
4431
4432 #. type: Plain text
4433 #: build/C/man2/recvmmsg.2:285
4434 msgid ""
4435 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4436 "B<socket>(2), B<socket>(7)"
4437 msgstr ""
4438 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4439 "B<socket>(2), B<socket>(7)"
4440
4441 #. type: TH
4442 #: build/C/man2/select.2:38
4443 #, no-wrap
4444 msgid "SELECT"
4445 msgstr "SELECT"
4446
4447 #. type: TH
4448 #: build/C/man2/select.2:38
4449 #, no-wrap
4450 msgid "2015-01-22"
4451 msgstr "2015-01-22"
4452
4453 #. type: Plain text
4454 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4455 msgid ""
4456 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4457 "multiplexing"
4458 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4459
4460 #. type: Plain text
4461 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4462 #, no-wrap
4463 msgid "/* According to POSIX.1-2001 */\n"
4464 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4465
4466 #. type: Plain text
4467 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4468 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4469 #, no-wrap
4470 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4471 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4472
4473 #. type: Plain text
4474 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4475 #, no-wrap
4476 msgid "/* According to earlier standards */\n"
4477 msgstr "/* 以前の規格に従う場合 */\n"
4478
4479 #. type: Plain text
4480 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4481 #, no-wrap
4482 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4483 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4484
4485 #. type: Plain text
4486 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4487 #, no-wrap
4488 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4489 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4490
4491 #. type: Plain text
4492 #: build/C/man2/select.2:58
4493 #, no-wrap
4494 msgid ""
4495 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4496 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4497 msgstr ""
4498 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4499 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4500
4501 #. type: Plain text
4502 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4503 #, no-wrap
4504 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4505 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4506
4507 #. type: Plain text
4508 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4509 #, no-wrap
4510 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4511 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4512
4513 #. type: Plain text
4514 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4515 #, no-wrap
4516 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4517 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4518
4519 #. type: Plain text
4520 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4521 #, no-wrap
4522 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4523 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4524
4525 #. type: Plain text
4526 #: build/C/man2/select.2:72
4527 #, no-wrap
4528 msgid ""
4529 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4530 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4531 "B<            const sigset_t *>I<sigmask>B<);>\n"
4532 msgstr ""
4533 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4534 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4535 "B<            const sigset_t *>I<sigmask>B<);>\n"
4536
4537 #. type: Plain text
4538 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4539 #: build/C/man3/sockatmark.3:36
4540 msgid ""
4541 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4542 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4543
4544 #. type: Plain text
4545 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4546 msgid ""
4547 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4548 "600"
4549 msgstr ""
4550 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4551 "600"
4552
4553 #. type: Plain text
4554 #: build/C/man2/select.2:93
4555 msgid ""
4556 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4557 "descriptors, waiting until one or more of the file descriptors become \"ready"
4558 "\" for some class of I/O operation (e.g., input possible).  A file "
4559 "descriptor is considered ready if it is possible to perform a corresponding "
4560 "I/O operation (e.g., B<read>(2)  without blocking, or a sufficiently small "
4561 "B<write>(2))."
4562 msgstr ""
4563 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4564 "プターを監視し、 一つ以上のファイルディスクリプターがある種の I/O 操作の "
4565 "「ready (準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待"
4566 "つことができる。 ファイルディスクリプターが ready (準備ができた) とは、 "
4567 "(B<read>(2)  などの) 対応する I/O 操作が停止 (block) なしに実行したり、 十分"
4568 "小さな B<write>(2) を実行したりできる状態にあることを意味する。"
4569
4570 #. type: Plain text
4571 #: build/C/man2/select.2:99
4572 msgid ""
4573 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4574 "these three differences:"
4575 msgstr ""
4576 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4577
4578 #. type: TP
4579 #: build/C/man2/select.2:99
4580 #, no-wrap
4581 msgid "(i)"
4582 msgstr "(i)"
4583
4584 #. type: Plain text
4585 #: build/C/man2/select.2:109
4586 msgid ""
4587 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4588 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4589 "and nanoseconds)."
4590 msgstr ""
4591 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4592 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4593 "timespec> (秒・ナノ秒単位) を用いる。"
4594
4595 #. type: TP
4596 #: build/C/man2/select.2:109
4597 #, no-wrap
4598 msgid "(ii)"
4599 msgstr "(ii)"
4600
4601 #. type: Plain text
4602 #: build/C/man2/select.2:117
4603 msgid ""
4604 "B<select>()  may update the I<timeout> argument to indicate how much time "
4605 "was left.  B<pselect>()  does not change this argument."
4606 msgstr ""
4607 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4608 "B<pselect>()  はこの引き数を変更しない。"
4609
4610 #. type: TP
4611 #: build/C/man2/select.2:117
4612 #, no-wrap
4613 msgid "(iii)"
4614 msgstr "(iii)"
4615
4616 #. type: Plain text
4617 #: build/C/man2/select.2:126
4618 msgid ""
4619 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4620 "with NULL I<sigmask>."
4621 msgstr ""
4622 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4623 "指定した場合の B<pselect>()  と同じである。"
4624
4625 #. type: Plain text
4626 #: build/C/man2/select.2:144
4627 msgid ""
4628 "Three independent sets of file descriptors are watched.  Those listed in "
4629 "I<readfds> will be watched to see if characters become available for reading "
4630 "(more precisely, to see if a read will not block; in particular, a file "
4631 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4632 "watched to see if space is available for write (though a large write may "
4633 "still block), and those in I<exceptfds> will be watched for exceptions.  On "
4634 "exit, the sets are modified in place to indicate which file descriptors "
4635 "actually changed status.  Each of the three file descriptor sets may be "
4636 "specified as NULL if no file descriptors are to be watched for the "
4637 "corresponding class of events."
4638 msgstr ""
4639 "3 つの独立したファイルディスクリプター集合の監視を行う。 I<readfds> に入れら"
4640 "れたディスクリプターについては、読み込みが可能かどうかを 監視する (より正確に"
4641 "いうと、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-"
4642 "of-file) の場合も、 ファイルディスクリプターは読み込み可能として扱われる)。 "
4643 "I<writefds> に入れられたディスクリプターについては、書き込み用に利用可能な領"
4644 "域があるかを監視する (ただし、大きな書き込みの場合には停止する可能性はあ"
4645 "る)。 I<exceptfds> にあるものについては、例外の監視を行なう。システムコール終"
4646 "了時に、 どのファイルディスクリプターの状態が実際に変化したか示すために、 集"
4647 "合の内容が変更される。 ある種別のイベントを監視したいファイルディスクリプター"
4648 "が一つもない場合には、 対応するファイルディスクリプター集合に NULL を指定する"
4649 "ことができる。"
4650
4651 #. type: Plain text
4652 #: build/C/man2/select.2:157
4653 msgid ""
4654 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4655 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4656 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4657 "part of the set; this is useful after B<select>()  returns."
4658 msgstr ""
4659 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4660 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4661 "ターの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプ"
4662 "ターがあるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利"
4663 "である。"
4664
4665 #. type: Plain text
4666 #: build/C/man2/select.2:160
4667 msgid ""
4668 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4669 "plus 1."
4670 msgstr ""
4671 "I<nfds> は 3 つの集合に含まれるファイルディスクリプターの最大値に 1 を足した"
4672 "ものである。"
4673
4674 #. type: Plain text
4675 #: build/C/man2/select.2:167
4676 msgid ""
4677 "The I<timeout> argument specifies the interval that B<select>()  should "
4678 "block waiting for a file descriptor to become ready.  The call will block "
4679 "until either:"
4680 msgstr ""
4681 "I<timeout> 引き数は、 B<select>() がファイルディスクリプターが ready になるの"
4682 "を待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
4683
4684 #. type: IP
4685 #: build/C/man2/select.2:167 build/C/man2/select.2:169
4686 #: build/C/man2/select.2:171
4687 #, no-wrap
4688 msgid "*"
4689 msgstr "*"
4690
4691 #. type: Plain text
4692 #: build/C/man2/select.2:169
4693 msgid "a file descriptor becomes ready;"
4694 msgstr "ファイルディスクリプターが利用可能になる。"
4695
4696 #. type: Plain text
4697 #: build/C/man2/select.2:171
4698 msgid "the call is interrupted by a signal handler; or"
4699 msgstr "システムコールがシグナルハンドラーにより割り込まれた。"
4700
4701 #. type: Plain text
4702 #: build/C/man2/select.2:173
4703 msgid "the timeout expires."
4704 msgstr "タイムアウト時間が満了した。"
4705
4706 #. type: Plain text
4707 #: build/C/man2/select.2:190
4708 msgid ""
4709 "Note that the I<timeout> interval will be rounded up to the system clock "
4710 "granularity, and kernel scheduling delays mean that the blocking interval "
4711 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4712 "are zero, then B<select>()  returns immediately.  (This is useful for "
4713 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4714 "indefinitely."
4715 msgstr ""
4716 "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケ"
4717 "ジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 "
4718 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰す"
4719 "る (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に "
4720 "NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) "
4721 "する。"
4722
4723 #. type: Plain text
4724 #: build/C/man2/select.2:200
4725 msgid ""
4726 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4727 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4728 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4729 "restores the original signal mask."
4730 msgstr ""
4731 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインターであ"
4732 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4733 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4734 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4735
4736 #. type: Plain text
4737 #: build/C/man2/select.2:206
4738 msgid ""
4739 "Other than the difference in the precision of the I<timeout> argument, the "
4740 "following B<pselect>()  call:"
4741 msgstr ""
4742 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4743
4744 #. type: Plain text
4745 #: build/C/man2/select.2:210
4746 #, no-wrap
4747 msgid ""
4748 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4749 "                    timeout, &sigmask);\n"
4750 msgstr ""
4751 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4752 "                    timeout, &sigmask);\n"
4753
4754 #. type: Plain text
4755 #: build/C/man2/select.2:215
4756 msgid "is equivalent to I<atomically> executing the following calls:"
4757 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4758
4759 #. type: Plain text
4760 #: build/C/man2/select.2:218
4761 #, no-wrap
4762 msgid "    sigset_t origmask;\n"
4763 msgstr "    sigset_t origmask;\n"
4764
4765 #. type: Plain text
4766 #: build/C/man2/select.2:222
4767 #, no-wrap
4768 msgid ""
4769 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4770 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4771 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4772 msgstr ""
4773 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4774 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4775 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4776
4777 #. type: Plain text
4778 #: build/C/man2/select.2:243
4779 msgid ""
4780 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4781 "either a signal or for a file descriptor to become ready, then an atomic "
4782 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4783 "a global flag and returns.  Then a test of this global flag followed by a "
4784 "call of B<select>()  could hang indefinitely if the signal arrived just "
4785 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4786 "one to first block signals, handle the signals that have come in, then call "
4787 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4788 msgstr ""
4789 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプターの状態変"
4790 "化を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる か"
4791 "らである。 (シグナルハンドラーが大域フラグを設定して戻る場合を考えてみよう。 "
4792 "この大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの"
4793 "直後かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうか"
4794 "もしれない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、"
4795 "入ってくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこ"
4796 "とで、前記の競合を避けることができる。)"
4797
4798 #. type: SS
4799 #: build/C/man2/select.2:243
4800 #, no-wrap
4801 msgid "The timeout"
4802 msgstr "タイムアウト"
4803
4804 #. type: Plain text
4805 #: build/C/man2/select.2:247
4806 msgid ""
4807 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4808 "like"
4809 msgstr ""
4810 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4811
4812 #. type: Plain text
4813 #: build/C/man2/select.2:254
4814 #, no-wrap
4815 msgid ""
4816 "struct timeval {\n"
4817 "    long    tv_sec;         /* seconds */\n"
4818 "    long    tv_usec;        /* microseconds */\n"
4819 "};\n"
4820 msgstr ""
4821 "struct timeval {\n"
4822 "    long    tv_sec;         /* 秒 */\n"
4823 "    long    tv_usec;        /* マイクロ秒 */\n"
4824 "};\n"
4825
4826 #. type: Plain text
4827 #: build/C/man2/select.2:258
4828 msgid "and"
4829 msgstr "や"
4830
4831 #. type: Plain text
4832 #: build/C/man2/select.2:265
4833 #, no-wrap
4834 msgid ""
4835 "struct timespec {\n"
4836 "    long    tv_sec;         /* seconds */\n"
4837 "    long    tv_nsec;        /* nanoseconds */\n"
4838 "};\n"
4839 msgstr ""
4840 "struct timespec {\n"
4841 "    long    tv_sec;         /* 秒 */\n"
4842 "    long    tv_nsec;        /* ナノ秒 */\n"
4843 "};\n"
4844
4845 #. type: Plain text
4846 #: build/C/man2/select.2:269
4847 msgid "(However, see below on the POSIX.1-2001 versions.)"
4848 msgstr ""
4849 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4850 "照)"
4851
4852 #. type: Plain text
4853 #: build/C/man2/select.2:277
4854 msgid ""
4855 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4856 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4857 "precision."
4858 msgstr ""
4859 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4860 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4861 "呼び出すという方法を使っているコードもある。"
4862
4863 #.  .PP - it is rumored that:
4864 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4865 #.  - it is certainly true that:
4866 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4867 #. type: Plain text
4868 #: build/C/man2/select.2:300
4869 msgid ""
4870 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4871 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4872 "either behavior.)  This causes problems both when Linux code which reads "
4873 "I<timeout> is ported to other operating systems, and when code is ported to "
4874 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4875 "without reinitializing it.  Consider I<timeout> to be undefined after "
4876 "B<select>()  returns."
4877 msgstr ""
4878 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4879 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4880 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4881 "いる Linux のコードを他のオペレーティングシステムへ 移植する場合、問題が起こ"
4882 "る。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4883 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4884 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4885 "ある。"
4886
4887 #. type: Plain text
4888 #: build/C/man2/select.2:318
4889 msgid ""
4890 "On success, B<select>()  and B<pselect>()  return the number of file "
4891 "descriptors contained in the three returned descriptor sets (that is, the "
4892 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4893 "which may be zero if the timeout expires before anything interesting "
4894 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4895 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4896 "undefined."
4897 msgstr ""
4898 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4899 "ター集合に含まれている ファイルディスクリプターの数 (つまり、 I<readfds>, "
4900 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4901 "らずに時間切れになった場合、 ディスクリプターの数は 0 になることもある。 エ"
4902 "ラーならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディス"
4903 "クリプター集合は変更されず、 I<timeout> は不定となる。"
4904
4905 #. type: Plain text
4906 #: build/C/man2/select.2:324
4907 msgid ""
4908 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4909 "descriptor that was already closed, or one on which an error has occurred.)"
4910 msgstr ""
4911 "いずれかの集合に無効なファイルディスクリプターが指定された (おそらくは、すで"
4912 "にクローズされたファイルディスクリプターか、 エラーが発生したファイルディスク"
4913 "リプターが指定された)。"
4914
4915 #. type: Plain text
4916 #: build/C/man2/select.2:328
4917 msgid "A signal was caught; see B<signal>(7)."
4918 msgstr "シグナルを受信した。"
4919
4920 #. type: Plain text
4921 #: build/C/man2/select.2:335
4922 msgid ""
4923 "I<nfds> is negative or exceeds the B<RLIMIT_NOFILE> resource limit (see "
4924 "B<getrlimit>(2))."
4925 msgstr ""
4926 "I<nfds> が負、 またはリソース上限 B<RLIMIT_NOFILE> (B<getrlimit>(2) 参照) よ"
4927 "り大きい。"
4928
4929 #. type: Plain text
4930 #: build/C/man2/select.2:340
4931 msgid "the value contained within I<timeout> is invalid."
4932 msgstr "I<timeout> に入っている値が不正である。"
4933
4934 #. type: Plain text
4935 #: build/C/man2/select.2:343
4936 msgid "unable to allocate memory for internal tables."
4937 msgstr "内部テーブルにメモリーを割り当てることができなかった。"
4938
4939 #. type: Plain text
4940 #: build/C/man2/select.2:349
4941 msgid ""
4942 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, "
4943 "B<pselect>()  was emulated in glibc (but see BUGS)."
4944 msgstr ""
4945 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4946 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4947
4948 #. type: Plain text
4949 #: build/C/man2/select.2:360
4950 msgid ""
4951 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4952 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4953 "clones of the BSD socket layer (including System\\ V variants).  However, "
4954 "note that the System\\ V variant typically sets the timeout variable before "
4955 "exit, but the BSD variant does not."
4956 msgstr ""
4957 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4958 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4959 "(System\\ V 系も含む) との間でだいたい移植性がある。しかし System\\ V 系では "
4960 "たいがい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注"
4961 "意すること。"
4962
4963 #. type: Plain text
4964 #: build/C/man2/select.2:364
4965 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4966 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4967
4968 #. type: Plain text
4969 #: build/C/man2/select.2:381
4970 msgid ""
4971 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4972 "with a value of I<fd> that is negative or is equal to or larger than "
4973 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4974 "I<fd> to be a valid file descriptor."
4975 msgstr ""
4976 "I<fd_set> は固定サイズのバッファーである。 負や B<FD_SETSIZE> 以上の値を持つ "
4977 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4978 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4979 "プターでなければならないと規定されている。"
4980
4981 #. type: Plain text
4982 #: build/C/man2/select.2:390
4983 msgid ""
4984 "Concerning the types involved, the classical situation is that the two "
4985 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4986 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4987 "situation is"
4988 msgstr ""
4989 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4990 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4991 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4992
4993 #. type: Plain text
4994 #: build/C/man2/select.2:397
4995 #, no-wrap
4996 msgid ""
4997 "struct timeval {\n"
4998 "    time_t         tv_sec;     /* seconds */\n"
4999 "    suseconds_t    tv_usec;    /* microseconds */\n"
5000 "};\n"
5001 msgstr ""
5002 "struct timeval {\n"
5003 "\t time_t         tv_sec;     /* 秒 */\n"
5004 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
5005 "};\n"
5006
5007 #. type: Plain text
5008 #: build/C/man2/select.2:408
5009 msgid ""
5010 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
5011 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
5012 msgstr ""
5013 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
5014 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
5015
5016 #. type: Plain text
5017 #: build/C/man2/select.2:420
5018 msgid ""
5019 "Concerning prototypes, the classical situation is that one should include "
5020 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
5021 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
5022 msgstr ""
5023 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
5024 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
5025 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
5026 "インクルードすればよい。"
5027
5028 #. type: Plain text
5029 #: build/C/man2/select.2:431
5030 msgid ""
5031 "Under glibc 2.0, I<E<lt>sys/select.hE<gt>> gives the wrong prototype for "
5032 "B<pselect>().  Under glibc 2.1 to 2.2.1, it gives B<pselect>()  when "
5033 "B<_GNU_SOURCE> is defined.  Since glibc 2.2.2, the requirements are as shown "
5034 "in the SYNOPSIS."
5035 msgstr ""
5036 "glibc 2.0 では I<E<lt>sys/select.hE<gt>> が提供する B<pselect>()  のプロトタ"
5037 "イプが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されてい"
5038 "る場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  "
5039 "を使用するには、「書式」に記載された要件を満たす必要がある。"
5040
5041 #. type: SS
5042 #: build/C/man2/select.2:431
5043 #, no-wrap
5044 msgid "Multithreaded applications"
5045 msgstr "マルチスレッドアプリケーション"
5046
5047 #. type: Plain text
5048 #: build/C/man2/select.2:448
5049 msgid ""
5050 "If a file descriptor being monitored by B<select>()  is closed in another "
5051 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
5052 "unblocks and returns, with an indication that the file descriptor is ready "
5053 "(a subsequent I/O operation will likely fail with an error, unless another "
5054 "the file descriptor reopened between the time B<select>()  returned and the "
5055 "I/O operations was performed).  On Linux (and some other systems), closing "
5056 "the file descriptor in another thread has no effect on B<select>().  In "
5057 "summary, any application that relies on a particular behavior in this "
5058 "scenario must be considered buggy."
5059 msgstr ""
5060 "B<select>() で監視中のファイルディスクリプターが別のスレッドでクローズされた"
5061 "場合、どのような結果になるかは規定されていない。いくつかの UNIX システムで"
5062 "は、 B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプターが "
5063 "ready だと報告される (B<select>() が返ってから I/O 操作が実行されるまでの間"
5064 "に、 別のファイルディスクリプターが再度オープンされない限り、 それ以降の I/O "
5065 "操作はおそらく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別の"
5066 "スレッドでファイルディスクリプターがクローズされても B<select>() には影響を与"
5067 "えない。 まとめると、このような場合に特定の動作に依存しているアプリケーション"
5068 "は「バグっている」と考えなければならない。"
5069
5070 #. type: SS
5071 #: build/C/man2/select.2:448
5072 #, no-wrap
5073 msgid "C library/kernel ABI differences"
5074 msgstr "C ライブラリとカーネル ABI の違い"
5075
5076 #. type: Plain text
5077 #: build/C/man2/select.2:456
5078 msgid ""
5079 "The B<pselect>()  interface described in this page is implemented by glibc.  "
5080 "The underlying Linux system call is named B<pselect6>().  This system call "
5081 "has somewhat different behavior from the glibc wrapper function."
5082 msgstr ""
5083 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5084 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5085 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5086 "関数とは少し違った動作をする。"
5087
5088 #. type: Plain text
5089 #: build/C/man2/select.2:471
5090 msgid ""
5091 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5092 "However, the glibc wrapper function hides this behavior by using a local "
5093 "variable for the timeout argument that is passed to the system call.  Thus, "
5094 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5095 "this is the behavior required by POSIX.1-2001."
5096 msgstr ""
5097 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5098 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5099 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5100 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5101 "これが POSIX.1-2001 が要求している動作である。"
5102
5103 #. type: Plain text
5104 #: build/C/man2/select.2:477
5105 msgid ""
5106 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5107 "*> pointer, but is instead a structure of the form:"
5108 msgstr ""
5109 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5110 "ポインターではなく、以下に示す構造体である。"
5111
5112 #. type: Plain text
5113 #: build/C/man2/select.2:485
5114 #, no-wrap
5115 msgid ""
5116 "struct {\n"
5117 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5118 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5119 "                               to by 'ss' */\n"
5120 "};\n"
5121 msgstr ""
5122 "struct {\n"
5123 "    const sigset_t *ss;     /* シグナル集合へのポインター */\n"
5124 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5125 "                               (バイト数) */\n"
5126 "};\n"
5127
5128 #. type: Plain text
5129 #: build/C/man2/select.2:492
5130 msgid ""
5131 "This allows the system call to obtain both a pointer to the signal set and "
5132 "its size, while allowing for the fact that most architectures support a "
5133 "maximum of 6 arguments to a system call."
5134 msgstr ""
5135 "このようにすることで、ほとんどのアーキテクチャーがサポートしている\n"
5136 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5137 "B<pselect6>() システムコールがシグナル集合へのポインターとシグナル集合\n"
5138 "のサイズの両方を取得することができるのである。"
5139
5140 #. type: Plain text
5141 #: build/C/man2/select.2:498
5142 msgid ""
5143 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5144 "argument."
5145 msgstr ""
5146 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5147 "されていた。"
5148
5149 #. type: Plain text
5150 #: build/C/man2/select.2:511
5151 msgid ""
5152 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5153 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5154 "implementation remained vulnerable to the very race condition that "
5155 "B<pselect>()  was designed to prevent.  Modern versions of glibc use the "
5156 "(race-free)  B<pselect>()  system call on kernels where it is provided."
5157 msgstr ""
5158 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5159 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5160 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5161 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5162 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5163 "が使用される。"
5164
5165 #. type: Plain text
5166 #: build/C/man2/select.2:524
5167 msgid ""
5168 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5169 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5170 "signal handler writes a byte to a pipe whose other end is monitored by "
5171 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5172 "to a pipe that may be full or reading from a pipe that may be empty, "
5173 "nonblocking I/O is used when reading from and writing to the pipe.)"
5174 msgstr ""
5175 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5176 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5177 "この方法では、シグナルハンドラーはパイプへ 1 バイトのデータを書き込み、\n"
5178 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5179 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5180 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5181 "(nonblocking) I/O を使用するとよい)。"
5182
5183 #.  Stevens discusses a case where accept can block after select
5184 #.  returns successfully because of an intervening RST from the client.
5185 #.  Maybe the kernel should have returned EIO in such a situation?
5186 #. type: Plain text
5187 #: build/C/man2/select.2:540
5188 msgid ""
5189 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5190 "reading\", while nevertheless a subsequent read blocks.  This could for "
5191 "example happen when data has arrived but upon examination has wrong checksum "
5192 "and is discarded.  There may be other circumstances in which a file "
5193 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5194 "B<O_NONBLOCK> on sockets that should not block."
5195 msgstr ""
5196 "Linux では、 B<select>()  がソケットファイルディスクリプターで \"読み込みの準"
5197 "備ができた\" と報告した場合でも、 この後で read を行うと停止 (block) すること"
5198 "がある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常"
5199 "が見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプターが準備"
5200 "できたと間違って 報告される状況が起こるかもしれない。 したがって、停止すべき"
5201 "ではないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5202
5203 #. type: Plain text
5204 #: build/C/man2/select.2:555
5205 msgid ""
5206 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5207 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5208 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5209 "behavior, but the glibc wrapper hides this behavior by internally copying "
5210 "the I<timeout> to a local variable and passing that variable to the system "
5211 "call."
5212 msgstr ""
5213 "Linux では、 B<select>()  がシグナルハンドラーにより割り込まれた場合 (つまり "
5214 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5215 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5216 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5217 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5218 "数をシステムコールに渡している。"
5219
5220 #. type: Plain text
5221 #: build/C/man2/select.2:562
5222 #, no-wrap
5223 msgid ""
5224 "#include E<lt>stdio.hE<gt>\n"
5225 "#include E<lt>stdlib.hE<gt>\n"
5226 "#include E<lt>sys/time.hE<gt>\n"
5227 "#include E<lt>sys/types.hE<gt>\n"
5228 "#include E<lt>unistd.hE<gt>\n"
5229 msgstr ""
5230 "#include E<lt>stdio.hE<gt>\n"
5231 "#include E<lt>stdlib.hE<gt>\n"
5232 "#include E<lt>sys/time.hE<gt>\n"
5233 "#include E<lt>sys/types.hE<gt>\n"
5234 "#include E<lt>unistd.hE<gt>\n"
5235
5236 #. type: Plain text
5237 #: build/C/man2/select.2:569
5238 #, no-wrap
5239 msgid ""
5240 "int\n"
5241 "main(void)\n"
5242 "{\n"
5243 "    fd_set rfds;\n"
5244 "    struct timeval tv;\n"
5245 "    int retval;\n"
5246 msgstr ""
5247 "int\n"
5248 "main(void)\n"
5249 "{\n"
5250 "    fd_set rfds;\n"
5251 "    struct timeval tv;\n"
5252 "    int retval;\n"
5253
5254 #. type: Plain text
5255 #: build/C/man2/select.2:573
5256 #, no-wrap
5257 msgid ""
5258 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5259 "    FD_ZERO(&rfds);\n"
5260 "    FD_SET(0, &rfds);\n"
5261 msgstr ""
5262 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5263 "    FD_ZERO(&rfds);\n"
5264 "    FD_SET(0, &rfds);\n"
5265
5266 #. type: Plain text
5267 #: build/C/man2/select.2:577
5268 #, no-wrap
5269 msgid ""
5270 "    /* Wait up to five seconds. */\n"
5271 "    tv.tv_sec = 5;\n"
5272 "    tv.tv_usec = 0;\n"
5273 msgstr ""
5274 "    /* 5 秒間監視する。*/\n"
5275 "    tv.tv_sec = 5;\n"
5276 "    tv.tv_usec = 0;\n"
5277
5278 #. type: Plain text
5279 #: build/C/man2/select.2:580
5280 #, no-wrap
5281 msgid ""
5282 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5283 "    /* Don't rely on the value of tv now! */\n"
5284 msgstr ""
5285 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5286 "    /* この時点での tv の値を信頼してはならない。*/\n"
5287
5288 #. type: Plain text
5289 #: build/C/man2/select.2:588
5290 #, no-wrap
5291 msgid ""
5292 "    if (retval == -1)\n"
5293 "        perror(\"select()\");\n"
5294 "    else if (retval)\n"
5295 "        printf(\"Data is available now.\\en\");\n"
5296 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5297 "    else\n"
5298 "        printf(\"No data within five seconds.\\en\");\n"
5299 msgstr ""
5300 "    if (retval == -1)\n"
5301 "\tperror(\"select()\");\n"
5302 "    else if (retval)\n"
5303 "        printf(\"今、データが取得できました。\\en\");\n"
5304 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5305 "    else\n"
5306 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5307
5308 #. type: Plain text
5309 #: build/C/man2/select.2:604
5310 msgid ""
5311 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
5312 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
5313 "B<epoll>(7), B<time>(7)"
5314 msgstr ""
5315 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
5316 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
5317 "B<epoll>(7), B<time>(7)"
5318
5319 #. type: Plain text
5320 #: build/C/man2/select.2:607
5321 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5322 msgstr ""
5323 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5324
5325 #. type: TH
5326 #: build/C/man2/select_tut.2:32
5327 #, no-wrap
5328 msgid "SELECT_TUT"
5329 msgstr "SELECT_TUT"
5330
5331 #. type: TH
5332 #: build/C/man2/select_tut.2:32
5333 #, no-wrap
5334 msgid "2013-12-30"
5335 msgstr "2013-12-30"
5336
5337 #. type: Plain text
5338 #: build/C/man2/select_tut.2:52
5339 #, no-wrap
5340 msgid ""
5341 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5342 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5343 msgstr ""
5344 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5345 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5346
5347 #. type: Plain text
5348 #: build/C/man2/select_tut.2:66
5349 #, no-wrap
5350 msgid ""
5351 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5352 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5353 "B<            const sigset_t *>I<sigmask>B<);>\n"
5354 msgstr ""
5355 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5356 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5357 "B<            const sigset_t *>I<sigmask>B<);>\n"
5358
5359 #. type: Plain text
5360 #: build/C/man2/select_tut.2:83
5361 msgid ""
5362 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5363 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5364 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5365 "occurred on any of the descriptors."
5366 msgstr ""
5367 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5368 "ターを監視し、 そのファイルディスクリプターのいずれかが 「ready (準備ができ"
5369 "た)」状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプ"
5370 "ターのいずれかが 「例外状態 (exceptional condition)」が発生したか、を調べるこ"
5371 "とができる。"
5372
5373 #. type: Plain text
5374 #: build/C/man2/select_tut.2:108
5375 msgid ""
5376 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5377 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5378 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5379 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5380 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5381 "according to the rules described below; after calling B<select>()  you can "
5382 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5383 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5384 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5385 "descriptor from a set."
5386 msgstr ""
5387 "この関数の主要な引き数は、3種類のファイルディスクリプターの「集合」 "
5388 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5389 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5390 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5391 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5392 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5393 "スクリプターがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによっ"
5394 "て調べることができる。 B<FD_ISSET>()  は指定されたディスクリプターが集合に存"
5395 "在していれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合"
5396 "からのファイルディスクリプターの削除を行う。"
5397
5398 #. type: SS
5399 #: build/C/man2/select_tut.2:108
5400 #, no-wrap
5401 msgid "Arguments"
5402 msgstr "引き数"
5403
5404 #. type: TP
5405 #: build/C/man2/select_tut.2:109
5406 #, no-wrap
5407 msgid "I<readfds>"
5408 msgstr "I<readfds>"
5409
5410 #. type: Plain text
5411 #: build/C/man2/select_tut.2:118
5412 msgid ""
5413 "This set is watched to see if data is available for reading from any of its "
5414 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5415 "cleared of all file descriptors except for those that are immediately "
5416 "available for reading."
5417 msgstr ""
5418 "この集合に含まれるいずれかのファイルディスクリプターで、 データの読み込みが可"
5419 "能になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のう"
5420 "ち、 直ちに読み込み可能なファイルディスクリプター以外は 集合から削除される。"
5421
5422 #. type: TP
5423 #: build/C/man2/select_tut.2:118
5424 #, no-wrap
5425 msgid "I<writefds>"
5426 msgstr "I<writefds>"
5427
5428 #. type: Plain text
5429 #: build/C/man2/select_tut.2:127
5430 msgid ""
5431 "This set is watched to see if there is space to write data to any of its "
5432 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5433 "cleared of all file descriptors except for those that are immediately "
5434 "available for writing."
5435 msgstr ""
5436 "この集合に含まれるいずれかのファイルディスクリプターで、 データを書き込むス"
5437 "ペースがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のう"
5438 "ち、 直ちに書き込み可能なファイルディスクリプター以外は 集合から削除される。"
5439
5440 #. type: TP
5441 #: build/C/man2/select_tut.2:127
5442 #, no-wrap
5443 msgid "I<exceptfds>"
5444 msgstr "I<exceptfds>"
5445
5446 #. type: Plain text
5447 #: build/C/man2/select_tut.2:149
5448 msgid ""
5449 "This set is watched for \"exceptional conditions\".  In practice, only one "
5450 "such exceptional condition is common: the availability of I<out-of-band> "
5451 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5452 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5453 "where B<select>(2)  indicates an exceptional condition occurs with "
5454 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5455 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5456 "for those for which an exceptional condition has occurred."
5457 msgstr ""
5458 "この集合に含まれるいずれかのファイルディスクリプターで、 「例外状態 "
5459 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5460 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5461 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5462 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5463 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5464 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5465 "状態が発生したディスクリプター以外は集合から削除される。"
5466
5467 #. type: TP
5468 #: build/C/man2/select_tut.2:149
5469 #, no-wrap
5470 msgid "I<nfds>"
5471 msgstr "I<nfds>"
5472
5473 #. type: Plain text
5474 #: build/C/man2/select_tut.2:156
5475 msgid ""
5476 "This is an integer one more than the maximum of any file descriptor in any "
5477 "of the sets.  In other words, while adding file descriptors to each of the "
5478 "sets, you must calculate the maximum integer value of all of them, then "
5479 "increment this value by one, and then pass this as I<nfds>."
5480 msgstr ""
5481 "全ての集合に含まれるファイルディスクリプターのうち、 値が最大のものに 1 を足"
5482 "した整数である。 すなわち、ファイルディスクリプターを各集合に加える作業の途中"
5483 "で、 全てのファイルディスクリプターを見て最大値を求め、 それに 1 を加えて "
5484 "I<nfds> として渡さないといけない、ということだ。"
5485
5486 #. type: TP
5487 #: build/C/man2/select_tut.2:156
5488 #, no-wrap
5489 msgid "I<utimeout>"
5490 msgstr "I<utimeout>"
5491
5492 #. type: Plain text
5493 #: build/C/man2/select_tut.2:169
5494 msgid ""
5495 "This is the longest time B<select>()  may wait before returning, even if "
5496 "nothing interesting happened.  If this value is passed as NULL, then "
5497 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5498 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5499 "return immediately, with information about the readiness of file descriptors "
5500 "at the time of the call.  The structure I<struct timeval> is defined as:"
5501 msgstr ""
5502 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5503 "値に NULL を渡すと、 B<select>()  はファイルディスクリプターのいずれかが "
5504 "ready (準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> "
5505 "は 0 秒にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点の"
5506 "ファイルディスクリプターの状態に 関する情報が返される。 構造体 I<struct "
5507 "timeval> は次のように定義されている:"
5508
5509 #. type: Plain text
5510 #: build/C/man2/select_tut.2:176
5511 #, no-wrap
5512 msgid ""
5513 "struct timeval {\n"
5514 "    time_t tv_sec;    /* seconds */\n"
5515 "    long tv_usec;     /* microseconds */\n"
5516 "};\n"
5517 msgstr ""
5518 "struct timeval {\n"
5519 "    time_t tv_sec;    /* seconds */\n"
5520 "    long tv_usec;     /* microseconds */\n"
5521 "};\n"
5522
5523 #. type: TP
5524 #: build/C/man2/select_tut.2:178
5525 #, no-wrap
5526 msgid "I<ntimeout>"
5527 msgstr "I<ntimeout>"
5528
5529 #. type: Plain text
5530 #: build/C/man2/select_tut.2:187
5531 msgid ""
5532 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5533 "I<struct timespec> has nanosecond precision as follows:"
5534 msgstr ""
5535 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5536 "timespec> は次に示すようにナノ秒の精度を持つ。"
5537
5538 #. type: Plain text
5539 #: build/C/man2/select_tut.2:194
5540 #, no-wrap
5541 msgid ""
5542 "struct timespec {\n"
5543 "    long tv_sec;    /* seconds */\n"
5544 "    long tv_nsec;   /* nanoseconds */\n"
5545 "};\n"
5546 msgstr ""
5547 "struct timespec {\n"
5548 "    long tv_sec;    /* seconds */\n"
5549 "    long tv_nsec;   /* nanoseconds */\n"
5550 "};\n"
5551
5552 #. type: TP
5553 #: build/C/man2/select_tut.2:196
5554 #, no-wrap
5555 msgid "I<sigmask>"
5556 msgstr "I<sigmask>"
5557
5558 #. type: Plain text
5559 #: build/C/man2/select_tut.2:213
5560 msgid ""
5561 "This argument holds a set of signals that the kernel should unblock (i.e., "
5562 "remove from the signal mask of the calling thread), while the caller is "
5563 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5564 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5565 "the signal mask on entry and exit to the function.  In this case, "
5566 "B<pselect>()  will then behave just like B<select>()."
5567 msgstr ""
5568 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5569 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5570 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5571 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5572 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は "
5573 "B<select>()  と全く同じ動作となる。"
5574
5575 #. type: SS
5576 #: build/C/man2/select_tut.2:213
5577 #, no-wrap
5578 msgid "Combining signal and data events"
5579 msgstr "シグナルとデータイベントを組み合わせる"
5580
5581 #. type: Plain text
5582 #: build/C/man2/select_tut.2:257
5583 msgid ""
5584 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5585 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5586 "normally use the signal handler only to raise a global flag.  The global "
5587 "flag will indicate that the event must be processed in the main loop of the "
5588 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5589 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5590 "signals can be processed in the main loop of the program, otherwise "
5591 "B<select>()  would block indefinitely.  Now, somewhere in the main loop will "
5592 "be a conditional to check the global flag.  So we must ask: what if a signal "
5593 "arrives after the conditional, but before the B<select>()  call? The answer "
5594 "is that B<select>()  would block indefinitely, even though an event is "
5595 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5596 "This call can be used to set the signal mask to a set of signals that are to "
5597 "be received only within the B<pselect>()  call.  For instance, let us say "
5598 "that the event in question was the exit of a child process.  Before the "
5599 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5600 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5601 "mask.  Our program would look like:"
5602 msgstr "ファイルディスクリプターが I/O 可能な状態になるのと同時に シグナルも待ちたい場合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常は、 シグナルハンドラーをグローバルなフラグを立てるためだけに使う。 このグローバルなフラグは、 そのイベントをプログラムのメインループで 処理しなければならないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメインループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラグをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるのか?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとしても、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決できる。 このコールを使うと、 B<pselect>() でのみ受信したいシグナルの集合をシグナルマスクに設定することができる。 例えば、問題となっているイベントが子プロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようになる。"
5603
5604 #. type: Plain text
5605 #: build/C/man2/select_tut.2:260
5606 #, no-wrap
5607 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5608 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5609
5610 #. type: Plain text
5611 #: build/C/man2/select_tut.2:266
5612 #, no-wrap
5613 msgid ""
5614 "static void\n"
5615 "child_sig_handler(int sig)\n"
5616 "{\n"
5617 "    got_SIGCHLD = 1;\n"
5618 "}\n"
5619 msgstr ""
5620 "static void\n"
5621 "child_sig_handler(int sig)\n"
5622 "{\n"
5623 "    got_SIGCHLD = 1;\n"
5624 "}\n"
5625
5626 #. type: Plain text
5627 #: build/C/man2/select_tut.2:274
5628 #, no-wrap
5629 msgid ""
5630 "int\n"
5631 "main(int argc, char *argv[])\n"
5632 "{\n"
5633 "    sigset_t sigmask, empty_mask;\n"
5634 "    struct sigaction sa;\n"
5635 "    fd_set readfds, writefds, exceptfds;\n"
5636 "    int r;\n"
5637 msgstr ""
5638 "int\n"
5639 "main(int argc, char *argv[])\n"
5640 "{\n"
5641 "    sigset_t sigmask, empty_mask;\n"
5642 "    struct sigaction sa;\n"
5643 "    fd_set readfds, writefds, exceptfds;\n"
5644 "    int r;\n"
5645
5646 #. type: Plain text
5647 #: build/C/man2/select_tut.2:281
5648 #, no-wrap
5649 msgid ""
5650 "    sigemptyset(&sigmask);\n"
5651 "    sigaddset(&sigmask, SIGCHLD);\n"
5652 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5653 "        perror(\"sigprocmask\");\n"
5654 "        exit(EXIT_FAILURE);\n"
5655 "    }\n"
5656 msgstr ""
5657 "    sigemptyset(&sigmask);\n"
5658 "    sigaddset(&sigmask, SIGCHLD);\n"
5659 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5660 "        perror(\"sigprocmask\");\n"
5661 "        exit(EXIT_FAILURE);\n"
5662 "    }\n"
5663
5664 #. type: Plain text
5665 #: build/C/man2/select_tut.2:289
5666 #, no-wrap
5667 msgid ""
5668 "    sa.sa_flags = 0;\n"
5669 "    sa.sa_handler = child_sig_handler;\n"
5670 "    sigemptyset(&sa.sa_mask);\n"
5671 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5672 "        perror(\"sigaction\");\n"
5673 "        exit(EXIT_FAILURE);\n"
5674 "    }\n"
5675 msgstr ""
5676 "    sa.sa_flags = 0;\n"
5677 "    sa.sa_handler = child_sig_handler;\n"
5678 "    sigemptyset(&sa.sa_mask);\n"
5679 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5680 "        perror(\"sigaction\");\n"
5681 "        exit(EXIT_FAILURE);\n"
5682 "    }\n"
5683
5684 #. type: Plain text
5685 #: build/C/man2/select_tut.2:291
5686 #, no-wrap
5687 msgid "    sigemptyset(&empty_mask);\n"
5688 msgstr "    sigemptyset(&empty_mask);\n"
5689
5690 #. type: Plain text
5691 #: build/C/man2/select_tut.2:295
5692 #, no-wrap
5693 msgid ""
5694 "    for (;;) {          /* main loop */\n"
5695 "        /* Initialize readfds, writefds, and exceptfds\n"
5696 "           before the pselect() call. (Code omitted.) */\n"
5697 msgstr ""
5698 "    for (;;) {          /* main loop */\n"
5699 "        /* Initialize readfds, writefds, and exceptfds\n"
5700 "           before the pselect() call. (Code omitted.) */\n"
5701
5702 #. type: Plain text
5703 #: build/C/man2/select_tut.2:301
5704 #, no-wrap
5705 msgid ""
5706 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5707 "                    NULL, &empty_mask);\n"
5708 "        if (r == -1 && errno != EINTR) {\n"
5709 "            /* Handle error */\n"
5710 "        }\n"
5711 msgstr ""
5712 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5713 "                    NULL, &empty_mask);\n"
5714 "        if (r == -1 && errno != EINTR) {\n"
5715 "            /* Handle error */\n"
5716 "        }\n"
5717
5718 #. type: Plain text
5719 #: build/C/man2/select_tut.2:304
5720 #, no-wrap
5721 msgid ""
5722 "        if (got_SIGCHLD) {\n"
5723 "            got_SIGCHLD = 0;\n"
5724 msgstr ""
5725 "        if (got_SIGCHLD) {\n"
5726 "            got_SIGCHLD = 0;\n"
5727
5728 #. type: Plain text
5729 #: build/C/man2/select_tut.2:308
5730 #, no-wrap
5731 msgid ""
5732 "            /* Handle signalled event here; e.g., wait() for all\n"
5733 "               terminated children. (Code omitted.) */\n"
5734 "        }\n"
5735 msgstr ""
5736 "            /* Handle signalled event here; e.g., wait() for all\n"
5737 "               terminated children. (Code omitted.) */\n"
5738 "        }\n"
5739
5740 #. type: Plain text
5741 #: build/C/man2/select_tut.2:312
5742 #, no-wrap
5743 msgid ""
5744 "        /* main body of program */\n"
5745 "    }\n"
5746 "}\n"
5747 msgstr ""
5748 "        /* main body of program */\n"
5749 "    }\n"
5750 "}\n"
5751
5752 #. type: SS
5753 #: build/C/man2/select_tut.2:313
5754 #, no-wrap
5755 msgid "Practical"
5756 msgstr "実例"
5757
5758 #. type: Plain text
5759 #: build/C/man2/select_tut.2:334
5760 msgid ""
5761 "So what is the point of B<select>()? Can't I just read and write to my "
5762 "descriptors whenever I want? The point of B<select>()  is that it watches "
5763 "multiple descriptors at the same time and properly puts the process to sleep "
5764 "if there is no activity.  UNIX programmers often find themselves in a "
5765 "position where they have to handle I/O from more than one file descriptor "
5766 "where the data flow may be intermittent.  If you were to merely create a "
5767 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5768 "your calls may block waiting for data from/to a file descriptor, while "
5769 "another file descriptor is unused though ready for I/O.  B<select>()  "
5770 "efficiently copes with this situation."
5771 msgstr ""
5772 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプターは好きなとき"
5773 "に読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスク"
5774 "リプターを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に"
5775 "移行するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプター"
5776 "の入出力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況"
5777 "によく出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけ"
5778 "では、それらのコールのどれかが ファイルディスクリプターからのデータを待ってブ"
5779 "ロックしており、 別のファイルディスクリプターには I/O が可能なのに使えない、 "
5780 "ということになってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処"
5781 "できる。"
5782
5783 #. type: SS
5784 #: build/C/man2/select_tut.2:334
5785 #, no-wrap
5786 msgid "Select law"
5787 msgstr "SELECT の掟"
5788
5789 #. type: Plain text
5790 #: build/C/man2/select_tut.2:347
5791 msgid ""
5792 "Many people who try to use B<select>()  come across behavior that is "
5793 "difficult to understand and produces nonportable or borderline results.  For "
5794 "instance, the above program is carefully written not to block at any point, "
5795 "even though it does not set its file descriptors to nonblocking mode.  It is "
5796 "easy to introduce subtle errors that will remove the advantage of using "
5797 "B<select>(), so here is a list of essentials to watch for when using "
5798 "B<select>()."
5799 msgstr ""
5800 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5801 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5802 "記のプログラムは、 集合に含まれるファイルディスクリプターを非停止 "
5803 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5804 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5805 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5806 "ことにする。"
5807
5808 #. type: Plain text
5809 #: build/C/man2/select_tut.2:356
5810 msgid ""
5811 "You should always try to use B<select>()  without a timeout.  Your program "
5812 "should have nothing to do if there is no data available.  Code that depends "
5813 "on timeouts is not usually portable and is difficult to debug."
5814 msgstr ""
5815 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5816 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5817 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5818
5819 #. type: Plain text
5820 #: build/C/man2/select_tut.2:360
5821 msgid ""
5822 "The value I<nfds> must be properly calculated for efficiency as explained "
5823 "above."
5824 msgstr ""
5825 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5826 "えなければならない。"
5827
5828 #. type: Plain text
5829 #: build/C/man2/select_tut.2:367
5830 msgid ""
5831 "No file descriptor must be added to any set if you do not intend to check "
5832 "its result after the B<select>()  call, and respond appropriately.  See next "
5833 "rule."
5834 msgstr ""
5835 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5836 "ファイルディスクリプターは、 どの集合にも加えてはならない。 次のルールも参"
5837 "照。"
5838
5839 #. type: Plain text
5840 #: build/C/man2/select_tut.2:373
5841 msgid ""
5842 "After B<select>()  returns, all file descriptors in all sets should be "
5843 "checked to see if they are ready."
5844 msgstr ""
5845 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプターにつ"
5846 "いて 読み書き可能な状態になっているかをチェックすべきである。"
5847
5848 #. type: TP
5849 #: build/C/man2/select_tut.2:373
5850 #, no-wrap
5851 msgid "5."
5852 msgstr "5."
5853
5854 #. type: Plain text
5855 #: build/C/man2/select_tut.2:388
5856 msgid ""
5857 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5858 "necessarily read/write the full amount of data that you have requested.  If "
5859 "they do read/write the full amount, it's because you have a low traffic load "
5860 "and a fast stream.  This is not always going to be the case.  You should "
5861 "cope with the case of your functions managing to send or receive only a "
5862 "single byte."
5863 msgstr ""
5864 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5865 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5866 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5867 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5868 "うな場合も 考慮に入れてやらなければならない。"
5869
5870 #. type: TP
5871 #: build/C/man2/select_tut.2:388
5872 #, no-wrap
5873 msgid "6."
5874 msgstr "6."
5875
5876 #. type: Plain text
5877 #: build/C/man2/select_tut.2:396
5878 msgid ""
5879 "Never read/write only in single bytes at a time unless you are really sure "
5880 "that you have a small amount of data to process.  It is extremely "
5881 "inefficient not to read/write as much data as you can buffer each time.  The "
5882 "buffers in the example below are 1024 bytes although they could easily be "
5883 "made larger."
5884 msgstr ""
5885 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5886 "バイトずつ読み書きするようなことはしてはならない。 バッファーの許すかぎりの"
5887 "データをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファー"
5888 "は 1024 バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5889
5890 #. type: TP
5891 #: build/C/man2/select_tut.2:396
5892 #, no-wrap
5893 msgid "7."
5894 msgstr "7."
5895
5896 #.  Nonetheless, you should still cope with these errors for completeness.
5897 #. type: Plain text
5898 #: build/C/man2/select_tut.2:418
5899 msgid ""
5900 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5901 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5902 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5903 "properly managed (not done properly above).  If your program is not going to "
5904 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5905 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5906 msgstr ""
5907 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5908 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5909 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5910 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5911 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5912 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5913
5914 #. type: TP
5915 #: build/C/man2/select_tut.2:418
5916 #, no-wrap
5917 msgid "8."
5918 msgstr "8."
5919
5920 #. type: Plain text
5921 #: build/C/man2/select_tut.2:427
5922 msgid ""
5923 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5924 "length of zero."
5925 msgstr ""
5926 "決して、引き数に長さ 0 のバッファーを指定して B<read>(2), B<recv>(2), "
5927 "B<write>(2), B<send>(2)  を呼び出してはならない。"
5928
5929 #. type: TP
5930 #: build/C/man2/select_tut.2:427
5931 #, no-wrap
5932 msgid "9."
5933 msgstr "9."
5934
5935 #. type: Plain text
5936 #: build/C/man2/select_tut.2:443
5937 msgid ""
5938 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5939 "with errors other than those listed in B<7.>, or one of the input functions "
5940 "returns 0, indicating end of file, then you should I<not> pass that "
5941 "descriptor to B<select>()  again.  In the example below, I close the "
5942 "descriptor immediately, and then set it to -1 to prevent it being included "
5943 "in a set."
5944 msgstr ""
5945 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5946 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5947 "は、 そのディスクリプターをもう一度 select に渡してはI<ならない>。 下記の例で"
5948 "は、そのディスクリプターをただちにクローズし、 そこには -1 をセットして、 そ"
5949 "れが集合に含まれ続けるのを許さないようにしている。"
5950
5951 #. type: TP
5952 #: build/C/man2/select_tut.2:443
5953 #, no-wrap
5954 msgid "10."
5955 msgstr "10."
5956
5957 #. type: Plain text
5958 #: build/C/man2/select_tut.2:450
5959 msgid ""
5960 "The timeout value must be initialized with each new call to B<select>(), "
5961 "since some operating systems modify the structure.  B<pselect>()  however "
5962 "does not modify its timeout structure."
5963 msgstr ""
5964 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5965 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5966 "分の timeout 構造体を変更することはない。"
5967
5968 #. type: TP
5969 #: build/C/man2/select_tut.2:450
5970 #, no-wrap
5971 msgid "11."
5972 msgstr "11."
5973
5974 #.  "I have heard" does not fill me with confidence, and doesn't
5975 #.  belong in a man page, so I've commented this point out.
5976 #.  .TP
5977 #.  11.
5978 #.  I have heard that the Windows socket layer does not cope with OOB data
5979 #.  properly.
5980 #.  It also does not cope with
5981 #.  .BR select ()
5982 #.  calls when no file descriptors are set at all.
5983 #.  Having no file descriptors set is a useful
5984 #.  way to sleep the process with subsecond precision by using the timeout.
5985 #.  (See further on.)
5986 #. type: Plain text
5987 #: build/C/man2/select_tut.2:469
5988 msgid ""
5989 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5990 "used in a loop, then the sets must be reinitialized before each call."
5991 msgstr ""
5992 "B<select>()  はファイルディスクリプター集合を変更するので、 B<select>()  が"
5993 "ループの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプター集"
5994 "合を初期化し直さなければならない。"
5995
5996 #. type: SS
5997 #: build/C/man2/select_tut.2:469
5998 #, no-wrap
5999 msgid "Usleep emulation"
6000 msgstr "usleep エミュレーション"
6001
6002 #. type: Plain text
6003 #: build/C/man2/select_tut.2:476
6004 msgid ""
6005 "On systems that do not have a B<usleep>(3)  function, you can call "
6006 "B<select>()  with a finite timeout and no file descriptors as follows:"
6007 msgstr ""
6008 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
6009 "ルディスクリプターを全くセットせずに B<select>()  を呼び出すことで、これを代"
6010 "用できる。 以下のようにする。"
6011
6012 #. type: Plain text
6013 #: build/C/man2/select_tut.2:482
6014 #, no-wrap
6015 msgid ""
6016 "    struct timeval tv;\n"
6017 "    tv.tv_sec = 0;\n"
6018 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6019 "    select(0, NULL, NULL, NULL, &tv);\n"
6020 msgstr ""
6021 "    struct timeval tv;\n"
6022 "    tv.tv_sec = 0;\n"
6023 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6024 "    select(0, NULL, NULL, NULL, &tv);\n"
6025
6026 #. type: Plain text
6027 #: build/C/man2/select_tut.2:485
6028 msgid "This is guaranteed to work only on UNIX systems, however."
6029 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6030
6031 #. type: Plain text
6032 #: build/C/man2/select_tut.2:490
6033 msgid ""
6034 "On success, B<select>()  returns the total number of file descriptors still "
6035 "present in the file descriptor sets."
6036 msgstr ""
6037 "成功すると、 B<select>()  はファイルディスクリプター集合に残っている ファイル"
6038 "ディスクリプターの総数を返す。"
6039
6040 #. type: Plain text
6041 #: build/C/man2/select_tut.2:496
6042 msgid ""
6043 "If B<select>()  timed out, then the return value will be zero.  The file "
6044 "descriptors set should be all empty (but may not be on some systems)."
6045 msgstr ""
6046 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6047 "クリプター集合はすべて空である (しかしそうならないシステムもある)。"
6048
6049 #. type: Plain text
6050 #: build/C/man2/select_tut.2:503
6051 msgid ""
6052 "A return value of -1 indicates an error, with I<errno> being set "
6053 "appropriately.  In the case of an error, the contents of the returned sets "
6054 "and the I<struct timeout> contents are undefined and should not be used.  "
6055 "B<pselect>()  however never modifies I<ntimeout>."
6056 msgstr ""
6057 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6058 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6059 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
6060 "変更しない。"
6061
6062 #. type: Plain text
6063 #: build/C/man2/select_tut.2:512
6064 msgid ""
6065 "Generally speaking, all operating systems that support sockets also support "
6066 "B<select>().  B<select>()  can be used to solve many problems in a portable "
6067 "and efficient way that naive programmers try to solve in a more complicated "
6068 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6069 msgstr ""
6070 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6071 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6072 "ド、フォーク、IPC、シグナル、メモリー共有、 等々を使ってもっと複雑な方法で解"
6073 "決しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6074
6075 #. type: Plain text
6076 #: build/C/man2/select_tut.2:521
6077 msgid ""
6078 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6079 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6080 "is nowadays widely available, but historically was less portable than "
6081 "B<select>()."
6082 msgstr ""
6083 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6084 "ファイルディスクリプター集合を監視する場合に いくらか効率がよい。 現在では広"
6085 "く利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6086
6087 #. type: Plain text
6088 #: build/C/man2/select_tut.2:529
6089 msgid ""
6090 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6091 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6092 "of file descriptors."
6093 msgstr ""
6094 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプターを監視する場"
6095 "合に B<select>(2)  や B<poll>(2)  よりも効率的なインターフェースを提供してい"
6096 "る。"
6097
6098 #. type: Plain text
6099 #: build/C/man2/select_tut.2:534
6100 msgid ""
6101 "Here is an example that better demonstrates the true utility of "
6102 "B<select>().  The listing below is a TCP forwarding program that forwards "
6103 "from one TCP port to another."
6104 msgstr ""
6105 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6106 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6107
6108 #. type: Plain text
6109 #: build/C/man2/select_tut.2:547
6110 #, no-wrap
6111 msgid ""
6112 "#include E<lt>stdlib.hE<gt>\n"
6113 "#include E<lt>stdio.hE<gt>\n"
6114 "#include E<lt>unistd.hE<gt>\n"
6115 "#include E<lt>sys/time.hE<gt>\n"
6116 "#include E<lt>sys/types.hE<gt>\n"
6117 "#include E<lt>string.hE<gt>\n"
6118 "#include E<lt>signal.hE<gt>\n"
6119 "#include E<lt>sys/socket.hE<gt>\n"
6120 "#include E<lt>netinet/in.hE<gt>\n"
6121 "#include E<lt>arpa/inet.hE<gt>\n"
6122 "#include E<lt>errno.hE<gt>\n"
6123 msgstr ""
6124 "#include E<lt>stdlib.hE<gt>\n"
6125 "#include E<lt>stdio.hE<gt>\n"
6126 "#include E<lt>unistd.hE<gt>\n"
6127 "#include E<lt>sys/time.hE<gt>\n"
6128 "#include E<lt>sys/types.hE<gt>\n"
6129 "#include E<lt>string.hE<gt>\n"
6130 "#include E<lt>signal.hE<gt>\n"
6131 "#include E<lt>sys/socket.hE<gt>\n"
6132 "#include E<lt>netinet/in.hE<gt>\n"
6133 "#include E<lt>arpa/inet.hE<gt>\n"
6134 "#include E<lt>errno.hE<gt>\n"
6135
6136 #. type: Plain text
6137 #: build/C/man2/select_tut.2:549
6138 #, no-wrap
6139 msgid "static int forward_port;\n"
6140 msgstr "static int forward_port;\n"
6141
6142 #. type: Plain text
6143 #: build/C/man2/select_tut.2:552
6144 #, no-wrap
6145 msgid ""
6146 "#undef max\n"
6147 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6148 msgstr ""
6149 "#undef max\n"
6150 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6151
6152 #. type: Plain text
6153 #: build/C/man2/select_tut.2:559
6154 #, no-wrap
6155 msgid ""
6156 "static int\n"
6157 "listen_socket(int listen_port)\n"
6158 "{\n"
6159 "    struct sockaddr_in a;\n"
6160 "    int s;\n"
6161 "    int yes;\n"
6162 msgstr ""
6163 "static int\n"
6164 "listen_socket(int listen_port)\n"
6165 "{\n"
6166 "    struct sockaddr_in a;\n"
6167 "    int s;\n"
6168 "    int yes;\n"
6169
6170 #. type: Plain text
6171 #: build/C/man2/select_tut.2:584
6172 #, no-wrap
6173 msgid ""
6174 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6175 "    if (s == -1) {\n"
6176 "        perror(\"socket\");\n"
6177 "        return -1;\n"
6178 "    }\n"
6179 "    yes = 1;\n"
6180 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6181 "            &yes, sizeof(yes)) == -1) {\n"
6182 "        perror(\"setsockopt\");\n"
6183 "        close(s);\n"
6184 "        return -1;\n"
6185 "    }\n"
6186 "    memset(&a, 0, sizeof(a));\n"
6187 "    a.sin_port = htons(listen_port);\n"
6188 "    a.sin_family = AF_INET;\n"
6189 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6190 "        perror(\"bind\");\n"
6191 "        close(s);\n"
6192 "        return -1;\n"
6193 "    }\n"
6194 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6195 "    listen(s, 10);\n"
6196 "    return s;\n"
6197 "}\n"
6198 msgstr ""
6199 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6200 "        perror(\"socket\");\n"
6201 "        return -1;\n"
6202 "    }\n"
6203 "    yes = 1;\n"
6204 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6205 "            &yes, sizeof(yes)) == -1) {\n"
6206 "        perror(\"setsockopt\");\n"
6207 "        close(s);\n"
6208 "        return -1;\n"
6209 "    }\n"
6210 "    memset(&a, 0, sizeof(a));\n"
6211 "    a.sin_port = htons(listen_port);\n"
6212 "    a.sin_family = AF_INET;\n"
6213 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6214 "        perror(\"bind\");\n"
6215 "        close(s);\n"
6216 "        return -1;\n"
6217 "    }\n"
6218 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6219 "    listen(s, 10);\n"
6220 "    return s;\n"
6221 "}\n"
6222
6223 #. type: Plain text
6224 #: build/C/man2/select_tut.2:590
6225 #, no-wrap
6226 msgid ""
6227 "static int\n"
6228 "connect_socket(int connect_port, char *address)\n"
6229 "{\n"
6230 "    struct sockaddr_in a;\n"
6231 "    int s;\n"
6232 msgstr ""
6233 "static int\n"
6234 "connect_socket(int connect_port, char *address)\n"
6235 "{\n"
6236 "    struct sockaddr_in a;\n"
6237 "    int s;\n"
6238
6239 #. type: Plain text
6240 #: build/C/man2/select_tut.2:597
6241 #, no-wrap
6242 msgid ""
6243 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6244 "    if (s == -1) {\n"
6245 "        perror(\"socket\");\n"
6246 "        close(s);\n"
6247 "        return -1;\n"
6248 "    }\n"
6249 msgstr ""
6250 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6251 "    if (s == -1) {\n"
6252 "        perror(\"socket\");\n"
6253 "        close(s);\n"
6254 "        return -1;\n"
6255 "    }\n"
6256
6257 #. type: Plain text
6258 #: build/C/man2/select_tut.2:601
6259 #, no-wrap
6260 msgid ""
6261 "    memset(&a, 0, sizeof(a));\n"
6262 "    a.sin_port = htons(connect_port);\n"
6263 "    a.sin_family = AF_INET;\n"
6264 msgstr ""
6265 "    memset(&a, 0, sizeof(a));\n"
6266 "    a.sin_port = htons(connect_port);\n"
6267 "    a.sin_family = AF_INET;\n"
6268
6269 #. type: Plain text
6270 #: build/C/man2/select_tut.2:607
6271 #, no-wrap
6272 msgid ""
6273 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6274 "        perror(\"bad IP address format\");\n"
6275 "        close(s);\n"
6276 "        return -1;\n"
6277 "    }\n"
6278 msgstr ""
6279 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6280 "        perror(\"bad IP address format\");\n"
6281 "        close(s);\n"
6282 "        return -1;\n"
6283 "    }\n"
6284
6285 #. type: Plain text
6286 #: build/C/man2/select_tut.2:616
6287 #, no-wrap
6288 msgid ""
6289 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6290 "        perror(\"connect()\");\n"
6291 "        shutdown(s, SHUT_RDWR);\n"
6292 "        close(s);\n"
6293 "        return -1;\n"
6294 "    }\n"
6295 "    return s;\n"
6296 "}\n"
6297 msgstr ""
6298 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6299 "        perror(\"connect()\");\n"
6300 "        shutdown(s, SHUT_RDWR);\n"
6301 "        close(s);\n"
6302 "        return -1;\n"
6303 "    }\n"
6304 "    return s;\n"
6305 "}\n"
6306
6307 #. type: Plain text
6308 #: build/C/man2/select_tut.2:624
6309 #, no-wrap
6310 msgid ""
6311 "#define SHUT_FD1 do {                                \\e\n"
6312 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6313 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6314 "                         close(fd1);                 \\e\n"
6315 "                         fd1 = -1;                   \\e\n"
6316 "                     }                               \\e\n"
6317 "                 } while (0)\n"
6318 msgstr ""
6319 "#define SHUT_FD1 do {                                \\e\n"
6320 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6321 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6322 "                         close(fd1);                 \\e\n"
6323 "                         fd1 = -1;                   \\e\n"
6324 "                     }                               \\e\n"
6325 "                 } while (0)\n"
6326
6327 #. type: Plain text
6328 #: build/C/man2/select_tut.2:632
6329 #, no-wrap
6330 msgid ""
6331 "#define SHUT_FD2 do {                                \\e\n"
6332 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6333 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6334 "                         close(fd2);                 \\e\n"
6335 "                         fd2 = -1;                   \\e\n"
6336 "                     }                               \\e\n"
6337 "                 } while (0)\n"
6338 msgstr ""
6339 "#define SHUT_FD2 do {                                \\e\n"
6340 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6341 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6342 "                         close(fd2);                 \\e\n"
6343 "                         fd2 = -1;                   \\e\n"
6344 "                     }                               \\e\n"
6345 "                 } while (0)\n"
6346
6347 #. type: Plain text
6348 #: build/C/man2/select_tut.2:634
6349 #, no-wrap
6350 msgid "#define BUF_SIZE 1024\n"
6351 msgstr "#define BUF_SIZE 1024\n"
6352
6353 #. type: Plain text
6354 #: build/C/man2/select_tut.2:643
6355 #, no-wrap
6356 msgid ""
6357 "int\n"
6358 "main(int argc, char *argv[])\n"
6359 "{\n"
6360 "    int h;\n"
6361 "    int fd1 = -1, fd2 = -1;\n"
6362 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6363 "    int buf1_avail, buf1_written;\n"
6364 "    int buf2_avail, buf2_written;\n"
6365 msgstr ""
6366 "int\n"
6367 "main(int argc, char *argv[])\n"
6368 "{\n"
6369 "    int h;\n"
6370 "    int fd1 = -1, fd2 = -1;\n"
6371 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6372 "    int buf1_avail, buf1_written;\n"
6373 "    int buf2_avail, buf2_written;\n"
6374
6375 #. type: Plain text
6376 #: build/C/man2/select_tut.2:649
6377 #, no-wrap
6378 msgid ""
6379 "    if (argc != 4) {\n"
6380 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6381 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6382 "        exit(EXIT_FAILURE);\n"
6383 "    }\n"
6384 msgstr ""
6385 "    if (argc != 4) {\n"
6386 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6387 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6388 "        exit(EXIT_FAILURE);\n"
6389 "    }\n"
6390
6391 #. type: Plain text
6392 #: build/C/man2/select_tut.2:651
6393 #, no-wrap
6394 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6395 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6396
6397 #. type: Plain text
6398 #: build/C/man2/select_tut.2:653
6399 #, no-wrap
6400 msgid "    forward_port = atoi(argv[2]);\n"
6401 msgstr "    forward_port = atoi(argv[2]);\n"
6402
6403 #. type: Plain text
6404 #: build/C/man2/select_tut.2:657
6405 #, no-wrap
6406 msgid ""
6407 "    h = listen_socket(atoi(argv[1]));\n"
6408 "    if (h == -1)\n"
6409 "        exit(EXIT_FAILURE);\n"
6410 msgstr ""
6411 "    h = listen_socket(atoi(argv[1]));\n"
6412 "    if (h == -1)\n"
6413 "        exit(EXIT_FAILURE);\n"
6414
6415 #. type: Plain text
6416 #: build/C/man2/select_tut.2:661
6417 #, no-wrap
6418 msgid ""
6419 "    for (;;) {\n"
6420 "        int r, nfds = 0;\n"
6421 "        fd_set rd, wr, er;\n"
6422 msgstr ""
6423 "    for (;;) {\n"
6424 "        int r, nfds = 0;\n"
6425 "        fd_set rd, wr, er;\n"
6426
6427 #. type: Plain text
6428 #: build/C/man2/select_tut.2:691
6429 #, no-wrap
6430 msgid ""
6431 "        FD_ZERO(&rd);\n"
6432 "        FD_ZERO(&wr);\n"
6433 "        FD_ZERO(&er);\n"
6434 "        FD_SET(h, &rd);\n"
6435 "        nfds = max(nfds, h);\n"
6436 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6437 "            FD_SET(fd1, &rd);\n"
6438 "            nfds = max(nfds, fd1);\n"
6439 "        }\n"
6440 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6441 "            FD_SET(fd2, &rd);\n"
6442 "            nfds = max(nfds, fd2);\n"
6443 "        }\n"
6444 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6445 "            FD_SET(fd1, &wr);\n"
6446 "            nfds = max(nfds, fd1);\n"
6447 "        }\n"
6448 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6449 "            FD_SET(fd2, &wr);\n"
6450 "            nfds = max(nfds, fd2);\n"
6451 "        }\n"
6452 "        if (fd1 E<gt> 0) {\n"
6453 "            FD_SET(fd1, &er);\n"
6454 "            nfds = max(nfds, fd1);\n"
6455 "        }\n"
6456 "        if (fd2 E<gt> 0) {\n"
6457 "            FD_SET(fd2, &er);\n"
6458 "            nfds = max(nfds, fd2);\n"
6459 "        }\n"
6460 msgstr ""
6461 "        FD_ZERO(&rd);\n"
6462 "        FD_ZERO(&wr);\n"
6463 "        FD_ZERO(&er);\n"
6464 "        FD_SET(h, &rd);\n"
6465 "        nfds = max(nfds, h);\n"
6466 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6467 "            FD_SET(fd1, &rd);\n"
6468 "            nfds = max(nfds, fd1);\n"
6469 "        }\n"
6470 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6471 "            FD_SET(fd2, &rd);\n"
6472 "            nfds = max(nfds, fd2);\n"
6473 "        }\n"
6474 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6475 "            FD_SET(fd1, &wr);\n"
6476 "            nfds = max(nfds, fd1);\n"
6477 "        }\n"
6478 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6479 "            FD_SET(fd2, &wr);\n"
6480 "            nfds = max(nfds, fd2);\n"
6481 "        }\n"
6482 "        if (fd1 E<gt> 0) {\n"
6483 "            FD_SET(fd1, &er);\n"
6484 "            nfds = max(nfds, fd1);\n"
6485 "        }\n"
6486 "        if (fd2 E<gt> 0) {\n"
6487 "            FD_SET(fd2, &er);\n"
6488 "            nfds = max(nfds, fd2);\n"
6489 "        }\n"
6490
6491 #. type: Plain text
6492 #: build/C/man2/select_tut.2:693
6493 #, no-wrap
6494 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6495 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6496
6497 #. type: Plain text
6498 #: build/C/man2/select_tut.2:696
6499 #, no-wrap
6500 msgid ""
6501 "        if (r == -1 && errno == EINTR)\n"
6502 "            continue;\n"
6503 msgstr ""
6504 "        if (r == -1 && errno == EINTR)\n"
6505 "            continue;\n"
6506
6507 #. type: Plain text
6508 #: build/C/man2/select_tut.2:701
6509 #, no-wrap
6510 msgid ""
6511 "        if (r == -1) {\n"
6512 "            perror(\"select()\");\n"
6513 "            exit(EXIT_FAILURE);\n"
6514 "        }\n"
6515 msgstr ""
6516 "        if (r == -1) {\n"
6517 "            perror(\"select()\");\n"
6518 "            exit(EXIT_FAILURE);\n"
6519 "        }\n"
6520
6521 #. type: Plain text
6522 #: build/C/man2/select_tut.2:705
6523 #, no-wrap
6524 msgid ""
6525 "        if (FD_ISSET(h, &rd)) {\n"
6526 "            unsigned int l;\n"
6527 "            struct sockaddr_in client_address;\n"
6528 msgstr ""
6529 "        if (FD_ISSET(h, &rd)) {\n"
6530 "            unsigned int l;\n"
6531 "            struct sockaddr_in client_address;\n"
6532
6533 #. type: Plain text
6534 #: build/C/man2/select_tut.2:724
6535 #, no-wrap
6536 msgid ""
6537 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6538 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6539 "            if (r == -1) {\n"
6540 "                perror(\"accept()\");\n"
6541 "            } else {\n"
6542 "                SHUT_FD1;\n"
6543 "                SHUT_FD2;\n"
6544 "                buf1_avail = buf1_written = 0;\n"
6545 "                buf2_avail = buf2_written = 0;\n"
6546 "                fd1 = r;\n"
6547 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6548 "                if (fd2 == -1)\n"
6549 "                    SHUT_FD1;\n"
6550 "                else\n"
6551 "                    printf(\"connect from %s\\en\",\n"
6552 "                            inet_ntoa(client_address.sin_addr));\n"
6553 "            }\n"
6554 "        }\n"
6555 msgstr ""
6556 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6557 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6558 "            if (r == -1) {\n"
6559 "                perror(\"accept()\");\n"
6560 "            } else {\n"
6561 "                SHUT_FD1;\n"
6562 "                SHUT_FD2;\n"
6563 "                buf1_avail = buf1_written = 0;\n"
6564 "                buf2_avail = buf2_written = 0;\n"
6565 "                fd1 = r;\n"
6566 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6567 "                if (fd2 == -1)\n"
6568 "                    SHUT_FD1;\n"
6569 "                else\n"
6570 "                    printf(\"connect from %s\\en\",\n"
6571 "                            inet_ntoa(client_address.sin_addr));\n"
6572 "            }\n"
6573 "        }\n"
6574
6575 #. type: Plain text
6576 #: build/C/man2/select_tut.2:726
6577 #, no-wrap
6578 msgid "        /* NB: read oob data before normal reads */\n"
6579 msgstr "        /* NB: read oob data before normal reads */\n"
6580
6581 #. type: Plain text
6582 #: build/C/man2/select_tut.2:730
6583 #, no-wrap
6584 msgid ""
6585 "        if (fd1 E<gt> 0)\n"
6586 "            if (FD_ISSET(fd1, &er)) {\n"
6587 "                char c;\n"
6588 msgstr ""
6589 "        if (fd1 E<gt> 0)\n"
6590 "            if (FD_ISSET(fd1, &er)) {\n"
6591 "                char c;\n"
6592
6593 #. type: Plain text
6594 #: build/C/man2/select_tut.2:740
6595 #, no-wrap
6596 msgid ""
6597 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6598 "                if (r E<lt> 1)\n"
6599 "                    SHUT_FD1;\n"
6600 "                else\n"
6601 "                    send(fd2, &c, 1, MSG_OOB);\n"
6602 "            }\n"
6603 "        if (fd2 E<gt> 0)\n"
6604 "            if (FD_ISSET(fd2, &er)) {\n"
6605 "                char c;\n"
6606 msgstr ""
6607 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6608 "                if (r E<lt> 1)\n"
6609 "                    SHUT_FD1;\n"
6610 "                else\n"
6611 "                    send(fd2, &c, 1, MSG_OOB);\n"
6612 "            }\n"
6613 "        if (fd2 E<gt> 0)\n"
6614 "            if (FD_ISSET(fd2, &er)) {\n"
6615 "                char c;\n"
6616
6617 #. type: Plain text
6618 #: build/C/man2/select_tut.2:783
6619 #, no-wrap
6620 msgid ""
6621 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6622 "                if (r E<lt> 1)\n"
6623 "                    SHUT_FD2;\n"
6624 "                else\n"
6625 "                    send(fd1, &c, 1, MSG_OOB);\n"
6626 "            }\n"
6627 "        if (fd1 E<gt> 0)\n"
6628 "            if (FD_ISSET(fd1, &rd)) {\n"
6629 "                r = read(fd1, buf1 + buf1_avail,\n"
6630 "                          BUF_SIZE - buf1_avail);\n"
6631 "                if (r E<lt> 1)\n"
6632 "                    SHUT_FD1;\n"
6633 "                else\n"
6634 "                    buf1_avail += r;\n"
6635 "            }\n"
6636 "        if (fd2 E<gt> 0)\n"
6637 "            if (FD_ISSET(fd2, &rd)) {\n"
6638 "                r = read(fd2, buf2 + buf2_avail,\n"
6639 "                          BUF_SIZE - buf2_avail);\n"
6640 "                if (r E<lt> 1)\n"
6641 "                    SHUT_FD2;\n"
6642 "                else\n"
6643 "                    buf2_avail += r;\n"
6644 "            }\n"
6645 "        if (fd1 E<gt> 0)\n"
6646 "            if (FD_ISSET(fd1, &wr)) {\n"
6647 "                r = write(fd1, buf2 + buf2_written,\n"
6648 "                           buf2_avail - buf2_written);\n"
6649 "                if (r E<lt> 1)\n"
6650 "                    SHUT_FD1;\n"
6651 "                else\n"
6652 "                    buf2_written += r;\n"
6653 "            }\n"
6654 "        if (fd2 E<gt> 0)\n"
6655 "            if (FD_ISSET(fd2, &wr)) {\n"
6656 "                r = write(fd2, buf1 + buf1_written,\n"
6657 "                           buf1_avail - buf1_written);\n"
6658 "                if (r E<lt> 1)\n"
6659 "                    SHUT_FD2;\n"
6660 "                else\n"
6661 "                    buf1_written += r;\n"
6662 "            }\n"
6663 msgstr ""
6664 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6665 "                if (r E<lt> 1)\n"
6666 "                    SHUT_FD2;\n"
6667 "                else\n"
6668 "                    send(fd1, &c, 1, MSG_OOB);\n"
6669 "            }\n"
6670 "        if (fd1 E<gt> 0)\n"
6671 "            if (FD_ISSET(fd1, &rd)) {\n"
6672 "                r = read(fd1, buf1 + buf1_avail,\n"
6673 "                          BUF_SIZE - buf1_avail);\n"
6674 "                if (r E<lt> 1)\n"
6675 "                    SHUT_FD1;\n"
6676 "                else\n"
6677 "                    buf1_avail += r;\n"
6678 "            }\n"
6679 "        if (fd2 E<gt> 0)\n"
6680 "            if (FD_ISSET(fd2, &rd)) {\n"
6681 "                r = read(fd2, buf2 + buf2_avail,\n"
6682 "                          BUF_SIZE - buf2_avail);\n"
6683 "                if (r E<lt> 1)\n"
6684 "                    SHUT_FD2;\n"
6685 "                else\n"
6686 "                    buf2_avail += r;\n"
6687 "            }\n"
6688 "        if (fd1 E<gt> 0)\n"
6689 "            if (FD_ISSET(fd1, &wr)) {\n"
6690 "                r = write(fd1, buf2 + buf2_written,\n"
6691 "                           buf2_avail - buf2_written);\n"
6692 "                if (r E<lt> 1)\n"
6693 "                    SHUT_FD1;\n"
6694 "                else\n"
6695 "                    buf2_written += r;\n"
6696 "            }\n"
6697 "        if (fd2 E<gt> 0)\n"
6698 "            if (FD_ISSET(fd2, &wr)) {\n"
6699 "                r = write(fd2, buf1 + buf1_written,\n"
6700 "                           buf1_avail - buf1_written);\n"
6701 "                if (r E<lt> 1)\n"
6702 "                    SHUT_FD2;\n"
6703 "                else\n"
6704 "                    buf1_written += r;\n"
6705 "            }\n"
6706
6707 #. type: Plain text
6708 #: build/C/man2/select_tut.2:785
6709 #, no-wrap
6710 msgid "        /* check if write data has caught read data */\n"
6711 msgstr "        /* check if write data has caught read data */\n"
6712
6713 #. type: Plain text
6714 #: build/C/man2/select_tut.2:790
6715 #, no-wrap
6716 msgid ""
6717 "        if (buf1_written == buf1_avail)\n"
6718 "            buf1_written = buf1_avail = 0;\n"
6719 "        if (buf2_written == buf2_avail)\n"
6720 "            buf2_written = buf2_avail = 0;\n"
6721 msgstr ""
6722 "        if (buf1_written == buf1_avail)\n"
6723 "            buf1_written = buf1_avail = 0;\n"
6724 "        if (buf2_written == buf2_avail)\n"
6725 "            buf2_written = buf2_avail = 0;\n"
6726
6727 #. type: Plain text
6728 #: build/C/man2/select_tut.2:793
6729 #, no-wrap
6730 msgid ""
6731 "        /* one side has closed the connection, keep\n"
6732 "           writing to the other side until empty */\n"
6733 msgstr ""
6734 "        /* one side has closed the connection, keep\n"
6735 "           writing to the other side until empty */\n"
6736
6737 #. type: Plain text
6738 #: build/C/man2/select_tut.2:801
6739 #, no-wrap
6740 msgid ""
6741 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6742 "            SHUT_FD2;\n"
6743 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6744 "            SHUT_FD1;\n"
6745 "    }\n"
6746 "    exit(EXIT_SUCCESS);\n"
6747 "}\n"
6748 msgstr ""
6749 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6750 "            SHUT_FD2;\n"
6751 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6752 "            SHUT_FD1;\n"
6753 "    }\n"
6754 "    exit(EXIT_SUCCESS);\n"
6755 "}\n"
6756
6757 #. type: Plain text
6758 #: build/C/man2/select_tut.2:815
6759 msgid ""
6760 "The above program properly forwards most kinds of TCP connections including "
6761 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6762 "problem of having data flow in both directions simultaneously.  You might "
6763 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6764 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6765 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6766 "because you end up using inefficient timeouts."
6767 msgstr ""
6768 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6769 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6770 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 "
6771 "B<fork>(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効"
6772 "率的だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこ"
6773 "しい。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、と"
6774 "いうアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的"
6775 "に起こってしまう。"
6776
6777 #. type: Plain text
6778 #: build/C/man2/select_tut.2:821
6779 msgid ""
6780 "The program does not handle more than one simultaneous connection at a time, "
6781 "although it could easily be extended to do this with a linked list of buffers"
6782 "\\(emone for each connection.  At the moment, new connections cause the "
6783 "current connection to be dropped."
6784 msgstr ""
6785 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6786 "張するのは簡単で、バッファーのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6787 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6788
6789 #.  .SH AUTHORS
6790 #.  This man page was written by Paul Sheer.
6791 #. type: Plain text
6792 #: build/C/man2/select_tut.2:840
6793 msgid ""
6794 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6795 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6796 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6797 "B<sigismember>(3), B<epoll>(7)"
6798 msgstr ""
6799 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6800 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6801 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6802 "B<sigismember>(3), B<epoll>(7)"
6803
6804 #. type: TH
6805 #: build/C/man2/send.2:40
6806 #, no-wrap
6807 msgid "SEND"
6808 msgstr "SEND"
6809
6810 #. type: Plain text
6811 #: build/C/man2/send.2:43
6812 msgid "send, sendto, sendmsg - send a message on a socket"
6813 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6814
6815 #. type: Plain text
6816 #: build/C/man2/send.2:47
6817 #, no-wrap
6818 msgid ""
6819 "B<#include E<lt>sys/types.hE<gt>>\n"
6820 "B<#include E<lt>sys/socket.hE<gt>>\n"
6821 msgstr ""
6822 "B<#include E<lt>sys/types.hE<gt>>\n"
6823 "B<#include E<lt>sys/socket.hE<gt>>\n"
6824
6825 #. type: Plain text
6826 #: build/C/man2/send.2:50
6827 #, no-wrap
6828 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6829 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6830
6831 #. type: Plain text
6832 #: build/C/man2/send.2:54
6833 #, no-wrap
6834 msgid ""
6835 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6836 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6837 msgstr ""
6838 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6839 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6840
6841 #. type: Plain text
6842 #: build/C/man2/send.2:57
6843 #, no-wrap
6844 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6845 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6846
6847 #. type: Plain text
6848 #: build/C/man2/send.2:65
6849 msgid ""
6850 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6851 "transmit a message to another socket."
6852 msgstr ""
6853 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6854 "メッセージを転送するのに使用される。"
6855
6856 #. type: Plain text
6857 #: build/C/man2/send.2:84
6858 msgid ""
6859 "The B<send>()  call may be used only when the socket is in a I<connected> "
6860 "state (so that the intended recipient is known).  The only difference "
6861 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6862 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6863 "following call"
6864 msgstr ""
6865 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6866 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と "
6867 "B<write>(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 "
6868 "I<flags> にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価であ"
6869 "る。 また、"
6870
6871 #. type: Plain text
6872 #: build/C/man2/send.2:86
6873 #, no-wrap
6874 msgid "    send(sockfd, buf, len, flags);\n"
6875 msgstr "    send(sockfd, buf, len, flags);\n"
6876
6877 #. type: Plain text
6878 #: build/C/man2/send.2:88
6879 msgid "is equivalent to"
6880 msgstr "は以下と等価である。"
6881
6882 #. type: Plain text
6883 #: build/C/man2/send.2:90
6884 #, no-wrap
6885 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6886 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6887
6888 #. type: Plain text
6889 #: build/C/man2/send.2:94
6890 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6891 msgstr ""
6892 "引き数 I<sockfd> は、データを送信するパケットのファイルディスクリプターであ"
6893 "る。"
6894
6895 #. type: Plain text
6896 #: build/C/man2/send.2:122
6897 msgid ""
6898 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6899 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6900 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6901 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6902 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6903 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6904 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6905 "size."
6906 msgstr ""
6907 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6908 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6909 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6910 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6911 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6912 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 "
6913 "B<sendmsg>()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズ"
6914 "は I<msg.msg_namelen> で指定される。"
6915
6916 #. type: Plain text
6917 #: build/C/man2/send.2:138
6918 msgid ""
6919 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6920 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6921 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6922 "ancillary data (also known as control information)."
6923 msgstr ""
6924 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6925 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6926 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6927 "(制御情報とも呼ばれる) を送信することもできる。"
6928
6929 #. type: Plain text
6930 #: build/C/man2/send.2:143
6931 msgid ""
6932 "If the message is too long to pass atomically through the underlying "
6933 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6934 "transmitted."
6935 msgstr ""
6936 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6937 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6938 "ラーが返され、そのメッセージは転送されない。"
6939
6940 #. type: Plain text
6941 #: build/C/man2/send.2:147
6942 msgid ""
6943 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6944 "detected errors are indicated by a return value of -1."
6945 msgstr ""
6946 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6947 "出された場合は、返り値 -1 として通知される。"
6948
6949 #. type: Plain text
6950 #: build/C/man2/send.2:160
6951 msgid ""
6952 "When the message does not fit into the send buffer of the socket, B<send>()  "
6953 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6954 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6955 "in this case.  The B<select>(2)  call may be used to determine when it is "
6956 "possible to send more data."
6957 msgstr ""
6958 "メッセージがソケットの送信バッファーに入れることができない場合、 B<send>()  "
6959 "は通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6960 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6961 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6962 "用することができる。"
6963
6964 #.  FIXME . ? document MSG_PROXY (which went away in 2.3.15)
6965 #. type: Plain text
6966 #: build/C/man2/send.2:166
6967 msgid ""
6968 "The I<flags> argument is the bitwise OR of zero or more of the following "
6969 "flags."
6970 msgstr ""
6971 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6972 "のを指定する。"
6973
6974 #. type: TP
6975 #: build/C/man2/send.2:166
6976 #, no-wrap
6977 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
6978 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6979
6980 #. type: Plain text
6981 #: build/C/man2/send.2:180
6982 msgid ""
6983 "Tell the link layer that forward progress happened: you got a successful "
6984 "reply from the other side.  If the link layer doesn't get this it will "
6985 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6986 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
6987 "IPv4 and IPv6.  See B<arp>(7)  for details."
6988 msgstr ""
6989 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6990 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6991 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6992 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6993 "されている。 詳しくは B<arp>(7)  参照のこと。"
6994
6995 #. type: TP
6996 #: build/C/man2/send.2:180
6997 #, no-wrap
6998 msgid "B<MSG_DONTROUTE>"
6999 msgstr "B<MSG_DONTROUTE>"
7000
7001 #. type: Plain text
7002 #: build/C/man2/send.2:188
7003 msgid ""
7004 "Don't use a gateway to send out the packet, send to hosts only on directly "
7005 "connected networks.  This is usually used only by diagnostic or routing "
7006 "programs.  This is defined only for protocol families that route; packet "
7007 "sockets don't."
7008 msgstr ""
7009 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
7010 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティングプロ"
7011 "グラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコルファ"
7012 "ミリー に対してのみ定義されている。パケットソケットには定義されていない。"
7013
7014 #. type: Plain text
7015 #: build/C/man2/send.2:199
7016 msgid ""
7017 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
7018 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
7019 "flag with the B<F_SETFL> B<fcntl>(2))."
7020 msgstr ""
7021 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
7022 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
7023 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
7024
7025 #. type: TP
7026 #: build/C/man2/send.2:199
7027 #, no-wrap
7028 msgid "B<MSG_EOR> (since Linux 2.2)"
7029 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7030
7031 #. type: Plain text
7032 #: build/C/man2/send.2:203
7033 msgid ""
7034 "Terminates a record (when this notion is supported, as for sockets of type "
7035 "B<SOCK_SEQPACKET>)."
7036 msgstr ""
7037 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7038 "ケット種別のときに有効)。"
7039
7040 #. type: TP
7041 #: build/C/man2/send.2:203
7042 #, no-wrap
7043 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7044 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7045
7046 #. type: Plain text
7047 #: build/C/man2/send.2:212
7048 msgid ""
7049 "The caller has more data to send.  This flag is used with TCP sockets to "
7050 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7051 "with the difference that this flag can be set on a per-call basis."
7052 msgstr ""
7053 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7054 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる "
7055 "(B<tcp>(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位"
7056 "で この機能を有効にできる点である。"
7057
7058 #. type: Plain text
7059 #: build/C/man2/send.2:221
7060 msgid ""
7061 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7062 "the kernel to package all of the data sent in calls with this flag set into "
7063 "a single datagram which is transmitted only when a call is performed that "
7064 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
7065 "described in B<udp>(7).)"
7066 msgstr ""
7067 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7068 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7069 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7070 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7071 "ソケットオプション B<UDP_CORK> も参照)。"
7072
7073 #. type: TP
7074 #: build/C/man2/send.2:221
7075 #, no-wrap
7076 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7077 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7078
7079 #. type: Plain text
7080 #: build/C/man2/send.2:230
7081 msgid ""
7082 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7083 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7084 msgstr ""
7085 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7086 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7087
7088 #. type: Plain text
7089 #: build/C/man2/send.2:239
7090 msgid ""
7091 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7092 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7093 "data."
7094 msgstr ""
7095 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7096 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7097 "をサポートしている必要がある。"
7098
7099 #. type: SS
7100 #: build/C/man2/send.2:239
7101 #, no-wrap
7102 msgid "sendmsg()"
7103 msgstr "sendmsg()"
7104
7105 #. type: Plain text
7106 #: build/C/man2/send.2:245
7107 msgid ""
7108 "The definition of the I<msghdr> structure employed by B<sendmsg>()  is as "
7109 "follows:"
7110 msgstr "B<sendmsg>() で利用されている I<msghdr> 構造体は以下の通り。"
7111
7112 #. type: Plain text
7113 #: build/C/man2/send.2:257
7114 #, no-wrap
7115 msgid ""
7116 "struct msghdr {\n"
7117 "    void         *msg_name;       /* optional address */\n"
7118 "    socklen_t     msg_namelen;    /* size of address */\n"
7119 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
7120 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
7121 "    void         *msg_control;    /* ancillary data, see below */\n"
7122 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
7123 "    int           msg_flags;      /* flags (unused) */\n"
7124 "};\n"
7125 msgstr ""
7126 "struct msghdr {\n"
7127 "    void         *msg_name;       /* 追加のアドレス */\n"
7128 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
7129 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
7130 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
7131 "    void         *msg_control;    /* 補助データ (後述) */\n"
7132 "    size_t        msg_controllen; /* 補助データバッファー長 */\n"
7133 "    int           msg_flags;      /* フラグ (未使用) */\n"
7134 "};\n"
7135
7136 #. type: Plain text
7137 #: build/C/man2/send.2:269
7138 msgid ""
7139 "The I<msg_name> field is used on an unconnected socket to specify the target "
7140 "address for a datagram.  It points to a buffer containing the address; the "
7141 "I<msg_namelen> field should be set to the size of the address.  For a "
7142 "connected socket, these fields should be specified as NULL and 0, "
7143 "respectively."
7144 msgstr ""
7145 "フィールド I<msg_name> は、 未接続のソケットでデータグラムの宛先アドレスを指"
7146 "定するのに使用される。 このフィールドはアドレスを格納したバッファーを指す。 "
7147 "フィールド I<msg_namelen> にはアドレスの大きさを設定しなければならない。 接続"
7148 "済のソケットについては、これらのフィールドにはそれぞれ NULL と 0 を指定しなけ"
7149 "ればならない。"
7150
7151 #. type: Plain text
7152 #: build/C/man2/send.2:276
7153 msgid ""
7154 "The I<msg_iov> and I<msg_iovlen> fields specify scatter-gather locations, as "
7155 "for B<writev>(2)."
7156 msgstr ""
7157 "フィールド B<msg_iov> と I<msg_iovlen> は scatter-gather 用の場所を指定す"
7158 "る。 B<writev>(2) と同じ。"
7159
7160 #. type: Plain text
7161 #: build/C/man2/send.2:287
7162 msgid ""
7163 "You may send control information using the I<msg_control> and "
7164 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7165 "process is limited per socket by the value in I</proc/sys/net/core/"
7166 "optmem_max>; see B<socket>(7)."
7167 msgstr ""
7168 "フィールド I<msg_control> と I<msg_controllen> を使用して制御情報を送信するこ"
7169 "とができる。 カーネルが処理できる制御バッファーのソケットあたりの最大長は、 "
7170 "I</proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参"
7171 "照。"
7172
7173 #.  Still to be documented:
7174 #.   Send file descriptors and user credentials using the
7175 #.   msg_control* fields.
7176 #. type: Plain text
7177 #: build/C/man2/send.2:294
7178 msgid "The I<msg_flags> field is ignored."
7179 msgstr "フィールド I<msg_flags> は無視される。"
7180
7181 #. type: Plain text
7182 #: build/C/man2/send.2:299
7183 msgid ""
7184 "On success, these calls return the number of bytes sent.  On error, -1 is "
7185 "returned, and I<errno> is set appropriately."
7186 msgstr ""
7187 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7188 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7189
7190 #. type: Plain text
7191 #: build/C/man2/send.2:304
7192 msgid ""
7193 "These are some standard errors generated by the socket layer.  Additional "
7194 "errors may be generated and returned from the underlying protocol modules; "
7195 "see their respective manual pages."
7196 msgstr ""
7197 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7198 "ルモジュールで生成されたエラーが返されるかもしれない。 これらについては、それ"
7199 "ぞれのマニュアルを参照すること。"
7200
7201 #. type: Plain text
7202 #: build/C/man2/send.2:312
7203 msgid ""
7204 "(For UNIX domain sockets, which are identified by pathname)  Write "
7205 "permission is denied on the destination socket file, or search permission is "
7206 "denied for one of the directories the path prefix.  (See "
7207 "B<path_resolution>(7).)"
7208 msgstr ""
7209 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7210 "\n"
7211 "ソケットファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7212 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7213 "(B<path_resolution>(7) も参照のこと)"
7214
7215 #. type: Plain text
7216 #: build/C/man2/send.2:315
7217 msgid ""
7218 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7219 "as though it was a unicast address."
7220 msgstr ""
7221 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7222 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7223
7224 #.  Actually EAGAIN on Linux
7225 #. type: Plain text
7226 #: build/C/man2/send.2:323
7227 msgid ""
7228 "The socket is marked nonblocking and the requested operation would block.  "
7229 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7230 "require these constants to have the same value, so a portable application "
7231 "should check for both possibilities."
7232 msgstr ""
7233 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7234 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7235 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7236 "両方の可能性を 確認すべきである。"
7237
7238 #. type: Plain text
7239 #: build/C/man2/send.2:336
7240 msgid ""
7241 "(Internet domain datagram sockets)  The socket referred to by I<sockfd> had "
7242 "not previously been bound to an address and, upon attempting to bind it to "
7243 "an ephemeral port, it was determined that all port numbers in the ephemeral "
7244 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
7245 "ip_local_port_range> in B<ip>(7)."
7246 msgstr ""
7247 "(インターネットドメインデータグラムソケットの場合) I<sockfd> が参照するソケッ"
7248 "トがそれ以前にアドレスにバインドされておらず、 そのソケットに一時ポートをバイ"
7249 "ンドしようとした際に、 一時ポートとして使用する範囲のポート番号がすべて使用中"
7250 "であった。 B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照"
7251 "のこと。"
7252
7253 #. type: Plain text
7254 #: build/C/man2/send.2:339
7255 msgid "An invalid descriptor was specified."
7256 msgstr "無効なディスクリプターが指定された。"
7257
7258 #. type: TP
7259 #: build/C/man2/send.2:339
7260 #, no-wrap
7261 msgid "B<ECONNRESET>"
7262 msgstr "B<ECONNRESET>"
7263
7264 #. type: Plain text
7265 #: build/C/man2/send.2:342
7266 msgid "Connection reset by peer."
7267 msgstr "接続が接続相手によりリセットされた。"
7268
7269 #. type: TP
7270 #: build/C/man2/send.2:342
7271 #, no-wrap
7272 msgid "B<EDESTADDRREQ>"
7273 msgstr "B<EDESTADDRREQ>"
7274
7275 #. type: Plain text
7276 #: build/C/man2/send.2:345
7277 msgid "The socket is not connection-mode, and no peer address is set."
7278 msgstr ""
7279 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7280 "ていない。"
7281
7282 #. type: Plain text
7283 #: build/C/man2/send.2:348
7284 msgid "An invalid user space address was specified for an argument."
7285 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7286
7287 #. type: Plain text
7288 #: build/C/man2/send.2:352
7289 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7290 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7291
7292 #. type: Plain text
7293 #: build/C/man2/send.2:361
7294 msgid ""
7295 "The connection-mode socket was connected already but a recipient was "
7296 "specified.  (Now either this error is returned, or the recipient "
7297 "specification is ignored.)"
7298 msgstr ""
7299 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7300 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7301 "いずれかとなる)"
7302
7303 #. type: TP
7304 #: build/C/man2/send.2:361
7305 #, no-wrap
7306 msgid "B<EMSGSIZE>"
7307 msgstr "B<EMSGSIZE>"
7308
7309 #.  (e.g., SOCK_DGRAM )
7310 #. type: Plain text
7311 #: build/C/man2/send.2:367
7312 msgid ""
7313 "The socket type requires that message be sent atomically, and the size of "
7314 "the message to be sent made this impossible."
7315 msgstr ""
7316 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7317 "るが、 メッセージが大き過ぎるため送信することができない。"
7318
7319 #. type: Plain text
7320 #: build/C/man2/send.2:375
7321 msgid ""
7322 "The output queue for a network interface was full.  This generally indicates "
7323 "that the interface has stopped sending, but may be caused by transient "
7324 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7325 "silently dropped when a device queue overflows.)"
7326 msgstr ""
7327 "ネットワークインターフェースの出力キューが一杯である。 一般的には、一時的な輻"
7328 "輳 (congestion) のためにインターフェースが 送信を止めていることを意味する。 "
7329 "(通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバーフ"
7330 "ローした場合にはパケットは黙って捨てられる)"
7331
7332 #. type: Plain text
7333 #: build/C/man2/send.2:378
7334 msgid "No memory available."
7335 msgstr "メモリーが足りない。"
7336
7337 #. type: Plain text
7338 #: build/C/man2/send.2:381
7339 msgid "The socket is not connected, and no target has been given."
7340 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7341
7342 #. type: Plain text
7343 #: build/C/man2/send.2:391
7344 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7345 msgstr ""
7346 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7347 "る。"
7348
7349 #. type: TP
7350 #: build/C/man2/send.2:391
7351 #, no-wrap
7352 msgid "B<EPIPE>"
7353 msgstr "B<EPIPE>"
7354
7355 #. type: Plain text
7356 #: build/C/man2/send.2:400
7357 msgid ""
7358 "The local end has been shut down on a connection oriented socket.  In this "
7359 "case, the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7360 "set."
7361 msgstr ""
7362 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7363 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7364
7365 #. type: Plain text
7366 #: build/C/man2/send.2:403
7367 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7368 msgstr ""
7369 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7370
7371 #. type: Plain text
7372 #: build/C/man2/send.2:414
7373 msgid ""
7374 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7375 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7376 "flag is a Linux extension."
7377 msgstr ""
7378 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7379 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7380 "ラグは Linux での拡張である。"
7381
7382 #. type: Plain text
7383 #: build/C/man2/send.2:433
7384 msgid ""
7385 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7386 "can be used to transmit multiple datagrams in a single call."
7387 msgstr ""
7388 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7389 "る\n"
7390 "Linux 固有の システムコールに関する情報が書かれている。"
7391
7392 #. type: Plain text
7393 #: build/C/man2/send.2:438
7394 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7395 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7396
7397 #. type: Plain text
7398 #: build/C/man2/send.2:443
7399 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7400 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7401
7402 #. type: Plain text
7403 #: build/C/man2/send.2:458
7404 msgid ""
7405 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7406 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7407 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7408 msgstr ""
7409 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7410 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7411 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7412
7413 #. type: TH
7414 #: build/C/man2/sendmmsg.2:28
7415 #, no-wrap
7416 msgid "SENDMMSG"
7417 msgstr "SENDMMSG"
7418
7419 #. type: TH
7420 #: build/C/man2/sendmmsg.2:28 build/C/man7/socket.7:58
7421 #, no-wrap
7422 msgid "2014-07-08"
7423 msgstr "2014-07-08"
7424
7425 #. type: Plain text
7426 #: build/C/man2/sendmmsg.2:31
7427 msgid "sendmmsg - send multiple messages on a socket"
7428 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7429
7430 #. type: Plain text
7431 #: build/C/man2/sendmmsg.2:39
7432 #, no-wrap
7433 msgid ""
7434 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7435 "B<             unsigned int >I<flags>B<);>\n"
7436 msgstr ""
7437 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7438 "B<             unsigned int >I<flags>B<);>\n"
7439
7440 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7441 #. type: Plain text
7442 #: build/C/man2/sendmmsg.2:49
7443 msgid ""
7444 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7445 "the caller to transmit multiple messages on a socket using a single system "
7446 "call.  (This has performance benefits for some applications.)"
7447 msgstr ""
7448 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7449 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7450 "ンによっては性能上のメリットがある)。"
7451
7452 #. type: Plain text
7453 #: build/C/man2/sendmmsg.2:54
7454 msgid ""
7455 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7456 "to be transmitted."
7457 msgstr ""
7458 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプターであ"
7459 "る。"
7460
7461 #. type: Plain text
7462 #: build/C/man2/sendmmsg.2:75
7463 #, no-wrap
7464 msgid ""
7465 "struct mmsghdr {\n"
7466 "    struct msghdr msg_hdr;  /* Message header */\n"
7467 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7468 "};\n"
7469 msgstr ""
7470 "struct mmsghdr {\n"
7471 "    struct msghdr msg_hdr;  /* メッセージヘッダー */\n"
7472 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7473 "};\n"
7474
7475 #. type: Plain text
7476 #: build/C/man2/sendmmsg.2:91
7477 msgid ""
7478 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
7479 "B<sendmsg>(2).  The I<msg_len> field is used to return the number of bytes "
7480 "sent from the message in I<msg_hdr> (i.e., the same as the return value from "
7481 "a single B<sendmsg>(2)  call)."
7482 msgstr ""
7483 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7484 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7485 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダーに対して呼び出した"
7486 "場合の返り値と同じである。"
7487
7488 #. type: Plain text
7489 #: build/C/man2/sendmmsg.2:97
7490 msgid ""
7491 "The I<flags> argument contains flags ORed together.  The flags are the same "
7492 "as for B<sendmsg>(2)."
7493 msgstr ""
7494 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7495 "B<sendmsg>(2) と同じである。"
7496
7497 #. type: Plain text
7498 #: build/C/man2/sendmmsg.2:107
7499 msgid ""
7500 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7501 "sent.  A nonblocking call sends as many messages as possible (up to the "
7502 "limit specified by I<vlen>)  and returns immediately."
7503 msgstr ""
7504 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7505 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7506 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7507
7508 #. type: Plain text
7509 #: build/C/man2/sendmmsg.2:119
7510 msgid ""
7511 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7512 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7513 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7514 "of elements of I<msgvec> that have been updated."
7515 msgstr ""
7516 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7517 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7518 "しの返り値は、更新された I<msgvec> の要素数である。"
7519
7520 #. type: Plain text
7521 #: build/C/man2/sendmmsg.2:129
7522 msgid ""
7523 "On success, B<sendmmsg>()  returns the number of messages sent from "
7524 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7525 "B<sendmmsg>()  call to send the remaining messages."
7526 msgstr ""
7527 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7528 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7529 "て残りのメッセージを送信することができる。"
7530
7531 #. type: Plain text
7532 #: build/C/man2/sendmmsg.2:133
7533 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7534 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7535
7536 #
7537 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7538 #.      ... only return an error if no datagrams could be sent.
7539 #.      If less than the requested number of messages were sent, the application
7540 #.      must retry starting at the first failed one and if the problem is
7541 #.      persistent the error will be returned.
7542 #.      This matches the behavior of other syscalls like read/write - it
7543 #.      is not an error if less than the requested number of elements are sent.
7544 #. type: Plain text
7545 #: build/C/man2/sendmmsg.2:145
7546 msgid ""
7547 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7548 "could be sent."
7549 msgstr ""
7550 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7551 "く送信できなかった場合のみである。"
7552
7553 #. type: Plain text
7554 #: build/C/man2/sendmmsg.2:150
7555 msgid ""
7556 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7557 "added in version 2.14."
7558 msgstr ""
7559 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7560 "バージョン 2.14 で追加された。"
7561
7562 #. type: Plain text
7563 #: build/C/man2/sendmmsg.2:153
7564 msgid "B<sendmmsg>()  is Linux-specific."
7565 msgstr "B<sendmmsg>() は Linux 固有である。"
7566
7567 #
7568 #
7569 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7570 #.      net: Cap number of elements for sendmmsg
7571 #.      To limit the amount of time we can spend in sendmmsg, cap the
7572 #.      number of elements to UIO_MAXIOV (currently 1024).
7573 #.      For error handling an application using sendmmsg needs to retry at
7574 #.      the first unsent message, so capping is simpler and requires less
7575 #.      application logic than returning EINVAL.
7576 #. type: Plain text
7577 #: build/C/man2/sendmmsg.2:168
7578 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7579 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7580
7581 #. type: Plain text
7582 #: build/C/man2/sendmmsg.2:177
7583 msgid ""
7584 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7585 "distinct UDP datagrams using one system call.  The contents of the first "
7586 "datagram originates from a pair of buffers."
7587 msgstr ""
7588 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7589 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7590 "の内容は、二つのバッファーから取得される。"
7591
7592 #. type: Plain text
7593 #: build/C/man2/sendmmsg.2:186
7594 #, no-wrap
7595 msgid ""
7596 "#define _GNU_SOURCE\n"
7597 "#include E<lt>netinet/ip.hE<gt>\n"
7598 "#include E<lt>stdio.hE<gt>\n"
7599 "#include E<lt>stdlib.hE<gt>\n"
7600 "#include E<lt>string.hE<gt>\n"
7601 "#include E<lt>sys/types.hE<gt>\n"
7602 "#include E<lt>sys/socket.hE<gt>\n"
7603 msgstr ""
7604 "#define _GNU_SOURCE\n"
7605 "#include E<lt>netinet/ip.hE<gt>\n"
7606 "#include E<lt>stdio.hE<gt>\n"
7607 "#include E<lt>stdlib.hE<gt>\n"
7608 "#include E<lt>string.hE<gt>\n"
7609 "#include E<lt>sys/types.hE<gt>\n"
7610 "#include E<lt>sys/socket.hE<gt>\n"
7611
7612 #. type: Plain text
7613 #: build/C/man2/sendmmsg.2:195
7614 #, no-wrap
7615 msgid ""
7616 "int\n"
7617 "main(void)\n"
7618 "{\n"
7619 "    int sockfd;\n"
7620 "    struct sockaddr_in sa;\n"
7621 "    struct mmsghdr msg[2];\n"
7622 "    struct iovec msg1[2], msg2;\n"
7623 "    int retval;\n"
7624 msgstr ""
7625 "int\n"
7626 "main(void)\n"
7627 "{\n"
7628 "    int sockfd;\n"
7629 "    struct sockaddr_in sa;\n"
7630 "    struct mmsghdr msg[2];\n"
7631 "    struct iovec msg1[2], msg2;\n"
7632 "    int retval;\n"
7633
7634 #. type: Plain text
7635 #: build/C/man2/sendmmsg.2:209
7636 #, no-wrap
7637 msgid ""
7638 "    sa.sin_family = AF_INET;\n"
7639 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7640 "    sa.sin_port = htons(1234);\n"
7641 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7642 "        perror(\"connect()\");\n"
7643 "        exit(EXIT_FAILURE);\n"
7644 "    }\n"
7645 msgstr ""
7646 "    sa.sin_family = AF_INET;\n"
7647 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7648 "    sa.sin_port = htons(1234);\n"
7649 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7650 "        perror(\"connect()\");\n"
7651 "        exit(EXIT_FAILURE);\n"
7652 "    }\n"
7653
7654 #. type: Plain text
7655 #: build/C/man2/sendmmsg.2:215
7656 #, no-wrap
7657 msgid ""
7658 "    memset(msg1, 0, sizeof(msg1));\n"
7659 "    msg1[0].iov_base = \"one\";\n"
7660 "    msg1[0].iov_len = 3;\n"
7661 "    msg1[1].iov_base = \"two\";\n"
7662 "    msg1[1].iov_len = 3;\n"
7663 msgstr ""
7664 "    memset(msg1, 0, sizeof(msg1));\n"
7665 "    msg1[0].iov_base = \"one\";\n"
7666 "    msg1[0].iov_len = 3;\n"
7667 "    msg1[1].iov_base = \"two\";\n"
7668 "    msg1[1].iov_len = 3;\n"
7669
7670 #. type: Plain text
7671 #: build/C/man2/sendmmsg.2:219
7672 #, no-wrap
7673 msgid ""
7674 "    memset(&msg2, 0, sizeof(msg2));\n"
7675 "    msg2.iov_base = \"three\";\n"
7676 "    msg2.iov_len = 5;\n"
7677 msgstr ""
7678 "    memset(&msg2, 0, sizeof(msg2));\n"
7679 "    msg2.iov_base = \"three\";\n"
7680 "    msg2.iov_len = 5;\n"
7681
7682 #. type: Plain text
7683 #: build/C/man2/sendmmsg.2:223
7684 #, no-wrap
7685 msgid ""
7686 "    memset(msg, 0, sizeof(msg));\n"
7687 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7688 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7689 msgstr ""
7690 "    memset(msg, 0, sizeof(msg));\n"
7691 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7692 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7693
7694 #. type: Plain text
7695 #: build/C/man2/sendmmsg.2:226
7696 #, no-wrap
7697 msgid ""
7698 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7699 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7700 msgstr ""
7701 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7702 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7703
7704 #. type: Plain text
7705 #: build/C/man2/sendmmsg.2:232
7706 #, no-wrap
7707 msgid ""
7708 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7709 "    if (retval == -1)\n"
7710 "        perror(\"sendmmsg()\");\n"
7711 "    else\n"
7712 "        printf(\"%d messages sent\\en\", retval);\n"
7713 msgstr ""
7714 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7715 "    if (retval == -1)\n"
7716 "        perror(\"sendmmsg()\");\n"
7717 "    else\n"
7718 "        printf(\"%d messages sent\\en\", retval);\n"
7719
7720 #. type: Plain text
7721 #: build/C/man2/sendmmsg.2:235
7722 #, no-wrap
7723 msgid ""
7724 "    exit(0);\n"
7725 "}\n"
7726 msgstr ""
7727 "    exit(0);\n"
7728 "}\n"
7729
7730 #. type: Plain text
7731 #: build/C/man2/sendmmsg.2:241
7732 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7733 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7734
7735 #. type: TH
7736 #: build/C/man3/sockatmark.3:25
7737 #, no-wrap
7738 msgid "SOCKATMARK"
7739 msgstr "SOCKATMARK"
7740
7741 #. type: TH
7742 #: build/C/man3/sockatmark.3:25
7743 #, no-wrap
7744 msgid "2014-02-28"
7745 msgstr "2014-02-28"
7746
7747 #. type: Plain text
7748 #: build/C/man3/sockatmark.3:28
7749 msgid "sockatmark - determine whether socket is at out-of-band mark"
7750 msgstr ""
7751 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7752 "べる"
7753
7754 #. type: Plain text
7755 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7756 #: build/C/man7/socket.7:63 build/C/man2/socketpair.2:49
7757 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7758 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7759
7760 #. type: Plain text
7761 #: build/C/man3/sockatmark.3:32
7762 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7763 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7764
7765 #. type: Plain text
7766 #: build/C/man3/sockatmark.3:41
7767 msgid ""
7768 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7769 "\\ 600"
7770 msgstr ""
7771 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7772 "\\ 600"
7773
7774 #. type: Plain text
7775 #: build/C/man3/sockatmark.3:51
7776 msgid ""
7777 "B<sockatmark>()  returns a value indicating whether or not the socket "
7778 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7779 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7780 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7781 msgstr ""
7782 "B<sockatmark>()  はファイルディスクリプター I<sockfd> で参照されるソケットに"
7783 "帯域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場"
7784 "合は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返され"
7785 "る。 この関数は帯域外マークを削除しない。"
7786
7787 #. type: Plain text
7788 #: build/C/man3/sockatmark.3:58
7789 msgid ""
7790 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7791 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7792 "set to indicate the error."
7793 msgstr ""
7794 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7795 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7796 "れ、エラーを表す I<errno> が設定される。"
7797
7798 #. type: Plain text
7799 #: build/C/man3/sockatmark.3:63
7800 msgid "I<sockfd> is not a valid file descriptor."
7801 msgstr "I<sockfd> が有効なファイルディスクリプターでない。"
7802
7803 #.  POSIX.1 says ENOTTY for this case
7804 #. type: Plain text
7805 #: build/C/man3/sockatmark.3:70
7806 msgid ""
7807 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7808 msgstr ""
7809 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプターである。"
7810
7811 #. type: Plain text
7812 #: build/C/man3/sockatmark.3:73
7813 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7814 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7815
7816 #. type: Plain text
7817 #: build/C/man3/sockatmark.3:78
7818 msgid "The B<sockatmark>()  function is thread-safe."
7819 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7820
7821 #. type: Plain text
7822 #: build/C/man3/sockatmark.3:80
7823 msgid "POSIX.1-2001."
7824 msgstr "POSIX.1-2001."
7825
7826 #. type: Plain text
7827 #: build/C/man3/sockatmark.3:87
7828 msgid ""
7829 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7830 "the B<MSG_OOB> flag of B<recv>(2)."
7831 msgstr ""
7832 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7833 "B<recv>(2)  で読み込むことができる。"
7834
7835 #. type: Plain text
7836 #: build/C/man3/sockatmark.3:89
7837 msgid "Out-of-band data is supported only on some stream socket protocols."
7838 msgstr ""
7839 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7840 "ない。"
7841
7842 #. type: Plain text
7843 #: build/C/man3/sockatmark.3:94
7844 msgid ""
7845 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7846 "signal."
7847 msgstr ""
7848 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラーから安全に呼び出すことがで"
7849 "きる。"
7850
7851 #. type: Plain text
7852 #: build/C/man3/sockatmark.3:100
7853 msgid ""
7854 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7855 "operation."
7856 msgstr ""
7857 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7858
7859 #. type: Plain text
7860 #: build/C/man3/sockatmark.3:104
7861 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7862 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7863
7864 #. type: Plain text
7865 #: build/C/man3/sockatmark.3:109
7866 msgid ""
7867 "The following code can be used after receipt of a B<SIGURG> signal to read "
7868 "(and discard) all data up to the mark, and then read the byte of data at the "
7869 "mark:"
7870 msgstr ""
7871 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7872 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7873
7874 #. type: Plain text
7875 #: build/C/man3/sockatmark.3:114
7876 #, no-wrap
7877 msgid ""
7878 "    char buf[BUF_LEN];\n"
7879 "    char oobdata;\n"
7880 "    int atmark, s;\n"
7881 msgstr ""
7882 "    char buf[BUF_LEN];\n"
7883 "    char oobdata;\n"
7884 "    int atmark, s;\n"
7885
7886 #. type: Plain text
7887 #: build/C/man3/sockatmark.3:121
7888 #, no-wrap
7889 msgid ""
7890 "    for (;;) {\n"
7891 "        atmark = sockatmark(sockfd);\n"
7892 "        if (atmark == -1) {\n"
7893 "            perror(\"sockatmark\");\n"
7894 "            break;\n"
7895 "        }\n"
7896 msgstr ""
7897 "    for (;;) {\n"
7898 "        atmark = sockatmark(sockfd);\n"
7899 "        if (atmark == -1) {\n"
7900 "            perror(\"sockatmark\");\n"
7901 "            break;\n"
7902 "        }\n"
7903
7904 #. type: Plain text
7905 #: build/C/man3/sockatmark.3:124
7906 #, no-wrap
7907 msgid ""
7908 "        if (atmark)\n"
7909 "            break;\n"
7910 msgstr ""
7911 "        if (atmark)\n"
7912 "            break;\n"
7913
7914 #. type: Plain text
7915 #: build/C/man3/sockatmark.3:131
7916 #, no-wrap
7917 msgid ""
7918 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7919 "        if (s == -1)\n"
7920 "            perror(\"read\");\n"
7921 "        if (s E<lt>= 0)\n"
7922 "            break;\n"
7923 "    }\n"
7924 msgstr ""
7925 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7926 "        if (s == -1)\n"
7927 "            perror(\"read\");\n"
7928 "        if (s E<lt>= 0)\n"
7929 "            break;\n"
7930 "    }\n"
7931
7932 #. type: Plain text
7933 #: build/C/man3/sockatmark.3:138
7934 #, no-wrap
7935 msgid ""
7936 "    if (atmark == 1) {\n"
7937 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7938 "            perror(\"recv\");\n"
7939 "            ...\n"
7940 "        }\n"
7941 "    }\n"
7942 msgstr ""
7943 "    if (atmark == 1) {\n"
7944 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7945 "            perror(\"recv\");\n"
7946 "            ...\n"
7947 "        }\n"
7948 "    }\n"
7949
7950 #. type: Plain text
7951 #: build/C/man3/sockatmark.3:144
7952 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7953 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7954
7955 #. type: TH
7956 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
7957 #, no-wrap
7958 msgid "SOCKET"
7959 msgstr "SOCKET"
7960
7961 #. type: TH
7962 #: build/C/man2/socket.2:43
7963 #, no-wrap
7964 msgid "2015-02-01"
7965 msgstr "2015-02-01"
7966
7967 #. type: Plain text
7968 #: build/C/man2/socket.2:46
7969 msgid "socket - create an endpoint for communication"
7970 msgstr "socket - 通信のための端点(endpoint)を作成する"
7971
7972 #. type: Plain text
7973 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7974 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7975 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7976
7977 #. type: Plain text
7978 #: build/C/man2/socket.2:52
7979 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7980 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7981
7982 #. type: Plain text
7983 #: build/C/man2/socket.2:55
7984 msgid ""
7985 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7986 msgstr ""
7987 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7988 "(descriptor)を返す。"
7989
7990 #. type: Plain text
7991 #: build/C/man2/socket.2:63
7992 msgid ""
7993 "The I<domain> argument specifies a communication domain; this selects the "
7994 "protocol family which will be used for communication.  These families are "
7995 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7996 "include:"
7997 msgstr ""
7998 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコルファミ"
7999 "リー(protocol family)を通信に使用するかを指定する。 これらのファミリーは "
8000 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
8001 "下の通り。"
8002
8003 #. type: tbl table
8004 #: build/C/man2/socket.2:66
8005 #, no-wrap
8006 msgid "Name:Purpose:Man page\n"
8007 msgstr "名前:目的:マニュアル\n"
8008
8009 #. type: tbl table
8010 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
8011 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
8012 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
8013 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8014 #: build/C/man2/socket.2:119
8015 #, no-wrap
8016 msgid "T{\n"
8017 msgstr "T{\n"
8018
8019 #. type: tbl table
8020 #: build/C/man2/socket.2:68
8021 #, no-wrap
8022 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8023 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8024
8025 #. type: tbl table
8026 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8027 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8028 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8029 #: build/C/man2/socket.2:121 build/C/man7/socket.7:194
8030 #, no-wrap
8031 msgid "T}:T{\n"
8032 msgstr "T}:T{\n"
8033
8034 #. type: tbl table
8035 #: build/C/man2/socket.2:70
8036 #, no-wrap
8037 msgid "Local communication\n"
8038 msgstr "ローカル通信\n"
8039
8040 #. type: tbl table
8041 #: build/C/man2/socket.2:72
8042 #, no-wrap
8043 msgid "B<unix>(7)\n"
8044 msgstr "B<unix>(7)\n"
8045
8046 #. type: tbl table
8047 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8048 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8049 #: build/C/man2/socket.2:118 build/C/man2/socket.2:123
8050 #: build/C/man7/socket.7:173 build/C/man7/socket.7:177
8051 #: build/C/man7/socket.7:180 build/C/man7/socket.7:186
8052 #: build/C/man7/socket.7:189 build/C/man7/socket.7:198
8053 #: build/C/man7/socket.7:205
8054 #, no-wrap
8055 msgid "T}\n"
8056 msgstr "T}\n"
8057
8058 #. type: tbl table
8059 #: build/C/man2/socket.2:75
8060 #, no-wrap
8061 msgid "B<AF_INET>\n"
8062 msgstr "B<AF_INET>\n"
8063
8064 #. type: tbl table
8065 #: build/C/man2/socket.2:76
8066 #, no-wrap
8067 msgid "T}:IPv4 Internet protocols:T{\n"
8068 msgstr "T}:IPv4 インターネットプロトコル:T{\n"
8069
8070 #. type: tbl table
8071 #: build/C/man2/socket.2:77
8072 #, no-wrap
8073 msgid "B<ip>(7)\n"
8074 msgstr "B<ip>(7)\n"
8075
8076 #. type: tbl table
8077 #: build/C/man2/socket.2:80
8078 #, no-wrap
8079 msgid "B<AF_INET6>\n"
8080 msgstr "B<AF_INET6>\n"
8081
8082 #. type: tbl table
8083 #: build/C/man2/socket.2:81
8084 #, no-wrap
8085 msgid "T}:IPv6 Internet protocols:T{\n"
8086 msgstr "T}:IPv6 インターネットプロトコル:T{\n"
8087
8088 #. type: tbl table
8089 #: build/C/man2/socket.2:82
8090 #, no-wrap
8091 msgid "B<ipv6>(7)\n"
8092 msgstr "B<ipv6>(7)\n"
8093
8094 #. type: tbl table
8095 #: build/C/man2/socket.2:85
8096 #, no-wrap
8097 msgid "B<AF_IPX>\n"
8098 msgstr "B<AF_IPX>\n"
8099
8100 #. type: tbl table
8101 #: build/C/man2/socket.2:86
8102 #, no-wrap
8103 msgid "T}:IPX - Novell protocols:\n"
8104 msgstr "T}:IPX - Novell プロトコル:\n"
8105
8106 #. type: tbl table
8107 #: build/C/man2/socket.2:88
8108 #, no-wrap
8109 msgid "B<AF_NETLINK>\n"
8110 msgstr "B<AF_NETLINK>\n"
8111
8112 #. type: tbl table
8113 #: build/C/man2/socket.2:90
8114 #, no-wrap
8115 msgid "Kernel user interface device\n"
8116 msgstr "カーネルユーザーインターフェースデバイス\n"
8117
8118 #. type: tbl table
8119 #: build/C/man2/socket.2:92
8120 #, no-wrap
8121 msgid "B<netlink>(7)\n"
8122 msgstr "B<netlink>(7)\n"
8123
8124 #. type: tbl table
8125 #: build/C/man2/socket.2:95
8126 #, no-wrap
8127 msgid "B<AF_X25>\n"
8128 msgstr "B<AF_X25>\n"
8129
8130 #. type: tbl table
8131 #: build/C/man2/socket.2:96
8132 #, no-wrap
8133 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8134 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8135
8136 #. type: tbl table
8137 #: build/C/man2/socket.2:97
8138 #, no-wrap
8139 msgid "B<x25>(7)\n"
8140 msgstr "B<x25>(7)\n"
8141
8142 #. type: tbl table
8143 #: build/C/man2/socket.2:100
8144 #, no-wrap
8145 msgid "B<AF_AX25>\n"
8146 msgstr "B<AF_AX25>\n"
8147
8148 #. type: tbl table
8149 #: build/C/man2/socket.2:102
8150 #, no-wrap
8151 msgid "Amateur radio AX.25 protocol\n"
8152 msgstr "アマチュア無線 AX.25 プロトコル\n"
8153
8154 #. type: tbl table
8155 #: build/C/man2/socket.2:103
8156 #, no-wrap
8157 msgid "T}:\n"
8158 msgstr "T}:\n"
8159
8160 #. type: tbl table
8161 #: build/C/man2/socket.2:105
8162 #, no-wrap
8163 msgid "B<AF_ATMPVC>\n"
8164 msgstr "B<AF_ATMPVC>\n"
8165
8166 #. type: tbl table
8167 #: build/C/man2/socket.2:106
8168 #, no-wrap
8169 msgid "T}:Access to raw ATM PVCs:\n"
8170 msgstr "T}:生の ATM PVC にアクセスする:\n"
8171
8172 #. type: tbl table
8173 #: build/C/man2/socket.2:108
8174 #, no-wrap
8175 msgid "B<AF_APPLETALK>\n"
8176 msgstr "B<AF_APPLETALK>\n"
8177
8178 #. type: tbl table
8179 #: build/C/man2/socket.2:109
8180 #, no-wrap
8181 msgid "T}:AppleTalk:T{\n"
8182 msgstr "T}:AppleTalk:T{\n"
8183
8184 #. type: tbl table
8185 #: build/C/man2/socket.2:110
8186 #, no-wrap
8187 msgid "B<ddp>(7)\n"
8188 msgstr "B<ddp>(7)\n"
8189
8190 #. type: tbl table
8191 #: build/C/man2/socket.2:113
8192 #, no-wrap
8193 msgid "B<AF_PACKET>\n"
8194 msgstr "B<AF_PACKET>\n"
8195
8196 #. type: tbl table
8197 #: build/C/man2/socket.2:115
8198 #, no-wrap
8199 msgid "Low level packet interface\n"
8200 msgstr "低レベルのパケットインターフェース\n"
8201
8202 #. type: tbl table
8203 #: build/C/man2/socket.2:117
8204 #, no-wrap
8205 msgid "B<packet>(7)\n"
8206 msgstr "B<packet>(7)\n"
8207
8208 #. type: tbl table
8209 #: build/C/man2/socket.2:120
8210 #, no-wrap
8211 msgid "B<AF_ALG>\n"
8212 msgstr "B<AF_ALG>\n"
8213
8214 #. type: tbl table
8215 #: build/C/man2/socket.2:122
8216 #, no-wrap
8217 msgid "Interface to kernel crypto API\n"
8218 msgstr ""
8219
8220 #. type: Plain text
8221 #: build/C/man2/socket.2:131
8222 msgid ""
8223 "The socket has the indicated I<type>, which specifies the communication "
8224 "semantics.  Currently defined types are:"
8225 msgstr ""
8226 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8227 "る。 定義されている型は現在以下の通り。"
8228
8229 #. type: TP
8230 #: build/C/man2/socket.2:131
8231 #, no-wrap
8232 msgid "B<SOCK_STREAM>"
8233 msgstr "B<SOCK_STREAM>"
8234
8235 #. type: Plain text
8236 #: build/C/man2/socket.2:135
8237 msgid ""
8238 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8239 "out-of-band data transmission mechanism may be supported."
8240 msgstr ""
8241 "順序性と信頼性があり、双方向の、接続された バイトストリーム(byte stream)を提"
8242 "供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8243
8244 #. type: TP
8245 #: build/C/man2/socket.2:135
8246 #, no-wrap
8247 msgid "B<SOCK_DGRAM>"
8248 msgstr "B<SOCK_DGRAM>"
8249
8250 #. type: Plain text
8251 #: build/C/man2/socket.2:139
8252 msgid ""
8253 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8254 "length)."
8255 msgstr ""
8256 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8257 "する。"
8258
8259 #. type: TP
8260 #: build/C/man2/socket.2:139
8261 #, no-wrap
8262 msgid "B<SOCK_SEQPACKET>"
8263 msgstr "B<SOCK_SEQPACKET>"
8264
8265 #. type: Plain text
8266 #: build/C/man2/socket.2:144
8267 msgid ""
8268 "Provides a sequenced, reliable, two-way connection-based data transmission "
8269 "path for datagrams of fixed maximum length; a consumer is required to read "
8270 "an entire packet with each input system call."
8271 msgstr ""
8272 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8273 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システムコールでパケット"
8274 "全体を読み取ることが要求される。"
8275
8276 #. type: TP
8277 #: build/C/man2/socket.2:144
8278 #, no-wrap
8279 msgid "B<SOCK_RAW>"
8280 msgstr "B<SOCK_RAW>"
8281
8282 #. type: Plain text
8283 #: build/C/man2/socket.2:147
8284 msgid "Provides raw network protocol access."
8285 msgstr "生のネットワークプロトコルへのアクセスを提供する。"
8286
8287 #. type: TP
8288 #: build/C/man2/socket.2:147
8289 #, no-wrap
8290 msgid "B<SOCK_RDM>"
8291 msgstr "B<SOCK_RDM>"
8292
8293 #. type: Plain text
8294 #: build/C/man2/socket.2:150
8295 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8296 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8297
8298 #. type: TP
8299 #: build/C/man2/socket.2:150
8300 #, no-wrap
8301 msgid "B<SOCK_PACKET>"
8302 msgstr "B<SOCK_PACKET>"
8303
8304 #. type: Plain text
8305 #: build/C/man2/socket.2:155
8306 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8307 msgstr ""
8308 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8309 "こと"
8310
8311 #. type: Plain text
8312 #: build/C/man2/socket.2:157
8313 msgid "Some socket types may not be implemented by all protocol families."
8314 msgstr ""
8315 "ある種のソケット型が全てのプロトコルファミリーで実装されているわけではない。"
8316
8317 #. type: Plain text
8318 #: build/C/man2/socket.2:165
8319 msgid ""
8320 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8321 "addition to specifying a socket type, it may include the bitwise OR of any "
8322 "of the following values, to modify the behavior of B<socket>():"
8323 msgstr ""
8324 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8325 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8326 "ることで、 B<socket>()  の振舞いを変更することができる。"
8327
8328 #. type: Plain text
8329 #: build/C/man2/socket.2:199
8330 msgid ""
8331 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8332 "Normally only a single protocol exists to support a particular socket type "
8333 "within a given protocol family, in which case I<protocol> can be specified "
8334 "as 0.  However, it is possible that many protocols may exist, in which case "
8335 "a particular protocol must be specified in this manner.  The protocol number "
8336 "to use is specific to the ``communication domain'' in which communication is "
8337 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8338 "protocol name strings to protocol numbers."
8339 msgstr ""
8340 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8341 "ぞれの ソケットは、与えられたプロトコルファミリーの種類ごとに一つのプロトコル"
8342 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8343 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8344 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8345 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8346 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8347
8348 #. type: Plain text
8349 #: build/C/man2/socket.2:229
8350 msgid ""
8351 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams.  They do not "
8352 "preserve record boundaries.  A stream socket must be in a I<connected> state "
8353 "before any data may be sent or received on it.  A connection to another "
8354 "socket is created with a B<connect>(2)  call.  Once connected, data may be "
8355 "transferred using B<read>(2)  and B<write>(2)  calls or some variant of the "
8356 "B<send>(2)  and B<recv>(2)  calls.  When a session has been completed a "
8357 "B<close>(2)  may be performed.  Out-of-band data may also be transmitted as "
8358 "described in B<send>(2)  and received as described in B<recv>(2)."
8359 msgstr ""
8360 "B<SOCK_STREAM> 型のソケットは全二重バイトストリームである。 これらはレコード"
8361 "境界を保存しない。 ストリームは、ソケットがデータを送ったり受けたりする前に "
8362 "I<接続された> 状態になってなければならない。他のソケットへの接続は "
8363 "B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>(2)  "
8364 "と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用して転"
8365 "送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データの転"
8366 "送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
8367
8368 #. type: Plain text
8369 #: build/C/man2/socket.2:255
8370 msgid ""
8371 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8372 "data is not lost or duplicated.  If a piece of data for which the peer "
8373 "protocol has buffer space cannot be successfully transmitted within a "
8374 "reasonable length of time, then the connection is considered to be dead.  "
8375 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8376 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8377 "signal is raised if a process sends or receives on a broken stream; this "
8378 "causes naive processes, which do not handle the signal, to exit.  "
8379 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8380 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8381 "amount of data requested, and any data remaining in the arriving packet will "
8382 "be discarded.  Also all message boundaries in incoming datagrams are "
8383 "preserved."
8384 msgstr ""
8385 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8386 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8387 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8388 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8389 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8390 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8391 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8392 "トと同じシステムコールを使用する。 唯一の違いは B<read>(2)  コールが要求され"
8393 "た量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8394 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8395
8396 #. type: Plain text
8397 #: build/C/man2/socket.2:265
8398 msgid ""
8399 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8400 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8401 "received with B<recvfrom>(2), which returns the next datagram along with the "
8402 "address of its sender."
8403 msgstr ""
8404 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8405 "へデータグラムを送ることが許されている。 データグラムは一般に "
8406 "B<recvfrom>(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと"
8407 "一緒に返す。"
8408
8409 #. type: Plain text
8410 #: build/C/man2/socket.2:272
8411 msgid ""
8412 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8413 "from the device driver.  Use B<packet>(7)  instead."
8414 msgstr ""
8415 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8416 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8417
8418 #. type: Plain text
8419 #: build/C/man2/socket.2:295
8420 msgid ""
8421 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8422 "process group to receive a B<SIGURG> signal when the out-of-band data "
8423 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8424 "unexpectedly.  This operation may also be used to set the process or process "
8425 "group that receives the I/O and asynchronous notification of I/O events via "
8426 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8427 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8428 msgstr ""
8429 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8430 "受けとるプロセスグループを指定できる。 B<SIGURG> シグナルは帯域外データが到着"
8431 "した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時に"
8432 "送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8433 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセスグループを設"
8434 "定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8435 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8436
8437 #. type: Plain text
8438 #: build/C/man2/socket.2:305
8439 msgid ""
8440 "When the network signals an error condition to the protocol module (e.g., "
8441 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8442 "The next operation on this socket will return the error code of the pending "
8443 "error.  For some protocols it is possible to enable a per-socket error queue "
8444 "to retrieve detailed information about the error; see B<IP_RECVERR> in "
8445 "B<ip>(7)."
8446 msgstr ""
8447 "ネットワークがプロトコルモジュールにエラー状態を伝えた場合 (例えば、IP の "
8448 "ICMP メッセージを使用して)には、ソケットの ペンディングエラーフラグが設定され"
8449 "る。次にこのソケットを操作した 時にペンディングされていたエラーコードが返され"
8450 "る。プロトコルによっては エラーについてのより詳しい情報を受け取るためにソケッ"
8451 "トごとのエラーキューを 受け取ることが可能である。 B<ip>(7)  の B<IP_RECVERR> "
8452 "を参照すること。"
8453
8454 #. type: Plain text
8455 #: build/C/man2/socket.2:315
8456 msgid ""
8457 "The operation of sockets is controlled by socket level I<options>.  These "
8458 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8459 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8460 "respectively."
8461 msgstr ""
8462 "ソケットの操作はソケットレベル I<options> によって制御される。 これらのオプ"
8463 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8464 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8465
8466 #. type: Plain text
8467 #: build/C/man2/socket.2:320
8468 msgid ""
8469 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8470 "is returned, and I<errno> is set appropriately."
8471 msgstr ""
8472 "成功した場合、新しいソケットのファイルディスクリプターを返す。 エラーが発生し"
8473 "た場合は -1 を返し、 I<errno> を適切に設定する。"
8474
8475 #. type: Plain text
8476 #: build/C/man2/socket.2:325
8477 msgid ""
8478 "Permission to create a socket of the specified type and/or protocol is "
8479 "denied."
8480 msgstr ""
8481 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8482
8483 #. type: Plain text
8484 #: build/C/man2/socket.2:328
8485 msgid "The implementation does not support the specified address family."
8486 msgstr "指定されたアドレスファミリーがサポートされていない。"
8487
8488 #. type: Plain text
8489 #: build/C/man2/socket.2:331
8490 msgid "Unknown protocol, or protocol family not available."
8491 msgstr "知らないプロトコル、または利用できないプロトコルファミリーである。"
8492
8493 #.  Since Linux 2.6.27
8494 #. type: Plain text
8495 #: build/C/man2/socket.2:336
8496 msgid "Invalid flags in I<type>."
8497 msgstr "I<type> に無効なフラグが指定されている。"
8498
8499 #. type: Plain text
8500 #: build/C/man2/socket.2:339
8501 msgid "Process file table overflow."
8502 msgstr "プロセスのファイルテーブルが溢れている。"
8503
8504 #. type: TP
8505 #: build/C/man2/socket.2:342
8506 #, no-wrap
8507 msgid "B<ENOBUFS> or B<ENOMEM>"
8508 msgstr "B<ENOBUFS> または B<ENOMEM>"
8509
8510 #. type: Plain text
8511 #: build/C/man2/socket.2:347
8512 msgid ""
8513 "Insufficient memory is available.  The socket cannot be created until "
8514 "sufficient resources are freed."
8515 msgstr ""
8516 "十分なメモリーがない。十分な資源が解放されるまではソケットを 作成することはで"
8517 "きない。"
8518
8519 #. type: TP
8520 #: build/C/man2/socket.2:347 build/C/man2/socketpair.2:92
8521 #, no-wrap
8522 msgid "B<EPROTONOSUPPORT>"
8523 msgstr "B<EPROTONOSUPPORT>"
8524
8525 #. type: Plain text
8526 #: build/C/man2/socket.2:351
8527 msgid ""
8528 "The protocol type or the specified protocol is not supported within this "
8529 "domain."
8530 msgstr ""
8531 "このドメインでは指定されたプロトコルまたはプロトコルタイプが サポートされてい"
8532 "ない。"
8533
8534 #. type: Plain text
8535 #: build/C/man2/socket.2:353
8536 msgid "Other errors may be generated by the underlying protocol modules."
8537 msgstr "下位のプロトコルモジュールから他のエラーが生成されるかもしれない。"
8538
8539 #. type: Plain text
8540 #: build/C/man2/socket.2:355
8541 msgid "4.4BSD, POSIX.1-2001."
8542 msgstr "4.4BSD, POSIX.1-2001."
8543
8544 #. type: Plain text
8545 #: build/C/man2/socket.2:361
8546 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8547 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8548
8549 #. type: Plain text
8550 #: build/C/man2/socket.2:367
8551 msgid ""
8552 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8553 "systems supporting clones of the BSD socket layer (including System\\ V "
8554 "variants)."
8555 msgstr ""
8556 "B<socket>()  は 4.2BSD で登場した。一般に、(System\\ V の変種を含めて)  BSD "
8557 "のソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD "
8558 "以外のシステムからの移植ができる。"
8559
8560 #. type: Plain text
8561 #: build/C/man2/socket.2:386
8562 msgid ""
8563 "The manifest constants used under 4.x BSD for protocol families are "
8564 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8565 "are used for address families.  However, already the BSD man page promises: "
8566 "\"The protocol family generally is the same as the address family\", and "
8567 "subsequent standards use AF_* everywhere."
8568 msgstr ""
8569 "4.x BSD において定数を使用する場合、プロトコルファミリーには\n"
8570 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレスファミリーには\n"
8571 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8572 "しかしながら BSD のマニュアルでは 「一般にプロトコルファミリーは\n"
8573 "アドレスファミリーと同じものである。」 と保証している。\n"
8574 "それ以外の規格では全ての場所で AF_* が使用されている。"
8575
8576 #. type: Plain text
8577 #: build/C/man2/socket.2:392
8578 msgid ""
8579 "The B<AF_ALG> protocol type was added in Linux 2.6.38.  More information on "
8580 "this interface is provided in the kernel source file, I<Documentation/crypto/"
8581 "crypto-API-userspace.txt>."
8582 msgstr ""
8583
8584 #. type: Plain text
8585 #: build/C/man2/socket.2:397
8586 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8587 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8588
8589 #. type: Plain text
8590 #: build/C/man2/socket.2:420
8591 msgid ""
8592 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8593 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8594 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8595 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8596 "B<udp>(7), B<unix>(7)"
8597 msgstr ""
8598 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8599 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8600 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8601 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8602 "B<udp>(7), B<unix>(7)"
8603
8604 #. type: Plain text
8605 #: build/C/man2/socket.2:426
8606 msgid ""
8607 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8608 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8609 "Programmer's Supplementary Documents Volume 1.>"
8610 msgstr ""
8611 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8612 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8613 "Supplementary Documents Volume 1.> として再版された)"
8614
8615 #. type: Plain text
8616 #: build/C/man7/socket.7:61
8617 msgid "socket - Linux socket interface"
8618 msgstr "socket - Linux のソケットインターフェース"
8619
8620 #. type: Plain text
8621 #: build/C/man7/socket.7:65
8622 msgid ""
8623 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8624 ">I<protocol>B<);>"
8625 msgstr ""
8626 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8627 ">I<protocol>B<);>"
8628
8629 #. type: Plain text
8630 #: build/C/man7/socket.7:84
8631 msgid ""
8632 "This manual page describes the Linux networking socket layer user "
8633 "interface.  The BSD compatible sockets are the uniform interface between the "
8634 "user process and the network protocol stacks in the kernel.  The protocol "
8635 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8636 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8637 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8638 msgstr ""
8639 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザーイン"
8640 "ターフェースを記述するものである。 BSD 互換ソケットは、ユーザープロセスとカー"
8641 "ネル内部の ネットワークプロトコルスタック群との間に、 統一的なインターフェー"
8642 "スを提供するものである。 プロトコルモジュールは I<プロトコルファミリー "
8643 "(protocol familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケット"
8644 "タイプ (socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 "
8645 "これらに関するより詳しい情報は B<socket>(2)  を参照のこと。"
8646
8647 #. type: SS
8648 #: build/C/man7/socket.7:84
8649 #, no-wrap
8650 msgid "Socket-layer functions"
8651 msgstr "ソケット層の関数群"
8652
8653 #. type: Plain text
8654 #: build/C/man7/socket.7:88
8655 msgid ""
8656 "These functions are used by the user process to send or receive packets and "
8657 "to do other socket operations.  For more information see their respective "
8658 "manual pages."
8659 msgstr ""
8660 "これらの関数はユーザープロセスがパケットを送受信したり、その他のソケット操作"
8661 "を 行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほし"
8662 "い。"
8663
8664 #. type: Plain text
8665 #: build/C/man7/socket.7:104
8666 msgid ""
8667 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8668 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8669 "address, B<listen>(2)  tells the socket that new connections shall be "
8670 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8671 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8672 "(implemented only for a few local families like B<AF_UNIX>)"
8673 msgstr ""
8674 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8675 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8676 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8677 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8678 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8679 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8680 "リーでしか実装されていない)。"
8681
8682 #. type: Plain text
8683 #: build/C/man7/socket.7:126
8684 msgid ""
8685 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8686 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8687 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8688 "data.  In addition, the standard I/O operations like B<write>(2), "
8689 "B<writev>(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to "
8690 "read and write data."
8691 msgstr ""
8692 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8693 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8694 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8695 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8696 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8697 "ことができる。"
8698
8699 #. type: Plain text
8700 #: build/C/man7/socket.7:137
8701 msgid ""
8702 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8703 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8704 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8705 "be used to set or read some other options."
8706 msgstr ""
8707 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8708 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8709 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8710 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8711
8712 #. type: Plain text
8713 #: build/C/man7/socket.7:142
8714 msgid ""
8715 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8716 "full-duplex socket connection."
8717 msgstr ""
8718 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8719 "続を部分的にクローズする。"
8720
8721 #. type: Plain text
8722 #: build/C/man7/socket.7:148
8723 msgid ""
8724 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8725 "not supported on sockets."
8726 msgstr ""
8727 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8728 "ではサポートされていない。"
8729
8730 #. type: Plain text
8731 #: build/C/man7/socket.7:165
8732 msgid ""
8733 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8734 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8735 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8736 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8737 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8738 msgstr ""
8739 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8740 "ケットのファイルディスクリプターに B<O_NONBLOCK> フラグをセットすれば良い。 "
8741 "こうするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後"
8742 "で処理が再試行されることが期待されている)。 B<connect>(2)  では "
8743 "B<EINPROGRESS> エラーが返される。 この場合、ユーザーはさまざまなイベントを "
8744 "B<poll>(2)  や B<select>(2)  を使って待つことができる。"
8745
8746 #. type: tbl table
8747 #: build/C/man7/socket.7:169
8748 #, no-wrap
8749 msgid "I/O events\n"
8750 msgstr "I/O イベント\n"
8751
8752 #. type: tbl table
8753 #: build/C/man7/socket.7:170
8754 #, no-wrap
8755 msgid "Event:Poll flag:Occurrence\n"
8756 msgstr "イベント:poll フラグ:内容\n"
8757
8758 #. type: tbl table
8759 #: build/C/man7/socket.7:171 build/C/man7/socket.7:174
8760 #, no-wrap
8761 msgid "Read:POLLIN:T{\n"
8762 msgstr "Read:POLLIN:T{\n"
8763
8764 #. type: tbl table
8765 #: build/C/man7/socket.7:172
8766 #, no-wrap
8767 msgid "New data arrived.\n"
8768 msgstr "新しいデータが到着した。\n"
8769
8770 #. type: tbl table
8771 #: build/C/man7/socket.7:175
8772 #, no-wrap
8773 msgid "A connection setup has been completed\n"
8774 msgstr "(接続志向のソケットで)\n"
8775
8776 #. type: tbl table
8777 #: build/C/man7/socket.7:176
8778 #, no-wrap
8779 msgid "(for connection-oriented sockets)\n"
8780 msgstr "接続の設定が終了した。\n"
8781
8782 #. type: tbl table
8783 #: build/C/man7/socket.7:178 build/C/man7/socket.7:181
8784 #, no-wrap
8785 msgid "Read:POLLHUP:T{\n"
8786 msgstr "Read:POLLHUP:T{\n"
8787
8788 #. type: tbl table
8789 #: build/C/man7/socket.7:179
8790 #, no-wrap
8791 msgid "A disconnection request has been initiated by the other end.\n"
8792 msgstr "接続先で切断要求が生成された。\n"
8793
8794 #. type: tbl table
8795 #: build/C/man7/socket.7:182
8796 #, no-wrap
8797 msgid "A connection is broken (only for connection-oriented protocols).\n"
8798 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8799
8800 #. type: tbl table
8801 #: build/C/man7/socket.7:183
8802 #, no-wrap
8803 msgid "When the socket is written\n"
8804 msgstr "この場合、ソケットに書き込みが行われると\n"
8805
8806 #. type: tbl table
8807 #: build/C/man7/socket.7:184
8808 #, no-wrap
8809 msgid "B<SIGPIPE>\n"
8810 msgstr "B<SIGPIPE>\n"
8811
8812 #. type: tbl table
8813 #: build/C/man7/socket.7:185
8814 #, no-wrap
8815 msgid "is also sent.\n"
8816 msgstr "も送信される。\n"
8817
8818 #. type: tbl table
8819 #: build/C/man7/socket.7:187
8820 #, no-wrap
8821 msgid "Write:POLLOUT:T{\n"
8822 msgstr "Write:POLLOUT:T{\n"
8823
8824 #. type: tbl table
8825 #: build/C/man7/socket.7:188
8826 #, no-wrap
8827 msgid "Socket has enough send buffer space for writing new data.\n"
8828 msgstr "ソケットには新しいデータを書き込むのに十分なバッファーがある。\n"
8829
8830 #. type: tbl table
8831 #: build/C/man7/socket.7:190
8832 #, no-wrap
8833 msgid "Read/Write:T{\n"
8834 msgstr "Read/Write:T{\n"
8835
8836 #. type: tbl table
8837 #: build/C/man7/socket.7:191
8838 #, no-wrap
8839 msgid "POLLIN|\n"
8840 msgstr "POLLIN|\n"
8841
8842 #. type: tbl table
8843 #: build/C/man7/socket.7:192
8844 #, no-wrap
8845 msgid ".br\n"
8846 msgstr ".br\n"
8847
8848 #. type: tbl table
8849 #: build/C/man7/socket.7:193
8850 #, no-wrap
8851 msgid "POLLOUT\n"
8852 msgstr "POLLOUT\n"
8853
8854 #. type: tbl table
8855 #: build/C/man7/socket.7:195
8856 #, no-wrap
8857 msgid "An outgoing\n"
8858 msgstr "外部向けの\n"
8859
8860 #. type: tbl table
8861 #: build/C/man7/socket.7:196
8862 #, no-wrap
8863 msgid "B<connect>(2)\n"
8864 msgstr "B<connect>(2)\n"
8865
8866 #. type: tbl table
8867 #: build/C/man7/socket.7:197
8868 #, no-wrap
8869 msgid "finished.\n"
8870 msgstr "が終了した。\n"
8871
8872 #. type: tbl table
8873 #: build/C/man7/socket.7:199
8874 #, no-wrap
8875 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8876 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8877
8878 #. type: tbl table
8879 #: build/C/man7/socket.7:200
8880 #, no-wrap
8881 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8882 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8883
8884 #. type: tbl table
8885 #: build/C/man7/socket.7:201
8886 #, no-wrap
8887 msgid "Exception:POLLPRI:T{\n"
8888 msgstr "Exception:POLLPRI:T{\n"
8889
8890 #. type: tbl table
8891 #: build/C/man7/socket.7:202
8892 #, no-wrap
8893 msgid "Urgent data arrived.\n"
8894 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8895
8896 #. type: tbl table
8897 #: build/C/man7/socket.7:203
8898 #, no-wrap
8899 msgid "B<SIGURG>\n"
8900 msgstr "B<SIGURG>\n"
8901
8902 #. type: tbl table
8903 #: build/C/man7/socket.7:204
8904 #, no-wrap
8905 msgid "is sent then.\n"
8906 msgstr "が送信される。\n"
8907
8908 #. type: Plain text
8909 #: build/C/man7/socket.7:233
8910 msgid ""
8911 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8912 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8913 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8914 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8915 "I<Signals> discussion below."
8916 msgstr ""
8917 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8918 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8919 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプターに B<O_ASYNC> フ"
8920 "ラグをセットし、 B<SIGIO> に対する有効なシグナルハンドラーを "
8921 "B<sigaction>(2)  によって設定しておく必要がある。 後述の I<シグナル> に関する"
8922 "議論も参考にすること。"
8923
8924 #. type: SS
8925 #: build/C/man7/socket.7:233
8926 #, no-wrap
8927 msgid "Socket address structures"
8928 msgstr "ソケットアドレス構造体"
8929
8930 #. type: Plain text
8931 #: build/C/man7/socket.7:249
8932 msgid ""
8933 "Each socket domain has its own format for socket addresses, with a domain-"
8934 "specific address structure.  Each of these structures begins with an integer "
8935 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8936 "address structure.  This allows the various system calls (e.g., "
8937 "B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8938 "B<getpeername>(2)), which are generic to all socket domains, to determine "
8939 "the domain of a particular socket address."
8940 msgstr ""
8941 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8942 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8943 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8944 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8945 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8946 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8947 "できる。"
8948
8949 #. type: Plain text
8950 #: build/C/man7/socket.7:259
8951 msgid ""
8952 "To allow any type of socket address to be passed to interfaces in the "
8953 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8954 "type is purely to allow casting of domain-specific socket address types to a "
8955 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8956 "calls to the sockets API."
8957 msgstr ""
8958 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8959 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8960 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8961 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8962 "告を出すのを避けることができる。"
8963
8964 #. type: Plain text
8965 #: build/C/man7/socket.7:269
8966 msgid ""
8967 "In addition, the sockets API provides the data type I<struct "
8968 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8969 "domain-specific socket address structures; it is large enough and is aligned "
8970 "properly.  (In particular, it is large enough to hold IPv6 socket "
8971 "addresses.)  The structure includes the following field, which can be used "
8972 "to identify the type of socket address actually stored in the structure:"
8973 msgstr ""
8974 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8975 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8976 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリー境界"
8977 "への) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するの"
8978 "にも十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールド"
8979 "を使って、 この構造体に実際に格納されているソケットアドレスの型を特定すること"
8980 "ができる。"
8981
8982 #. type: Plain text
8983 #: build/C/man7/socket.7:273
8984 #, no-wrap
8985 msgid "    sa_family_t ss_family;\n"
8986 msgstr "    sa_family_t ss_family;\n"
8987
8988 #. type: Plain text
8989 #: build/C/man7/socket.7:281
8990 msgid ""
8991 "The I<sockaddr_storage> structure is useful in programs that must handle "
8992 "socket addresses in a generic way (e.g., programs that must deal with both "
8993 "IPv4 and IPv6 socket addresses)."
8994 msgstr ""
8995 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8996 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8997 "ログラム) で有用である。"
8998
8999 #. type: SS
9000 #: build/C/man7/socket.7:281
9001 #, no-wrap
9002 msgid "Socket options"
9003 msgstr "ソケットオプション"
9004
9005 #.  FIXME .
9006 #.  In the list below, the text used to describe argument types
9007 #.  for each socket option should be more consistent
9008 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
9009 #.  W R Stevens, UNPv1
9010 #. type: Plain text
9011 #: build/C/man7/socket.7:299
9012 msgid ""
9013 "The socket options listed below can be set by using B<setsockopt>(2)  and "
9014 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
9015 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
9016 msgstr ""
9017 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
9018 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
9019 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
9020 "I<int> へのポインターである。"
9021
9022 #. type: TP
9023 #: build/C/man7/socket.7:299
9024 #, no-wrap
9025 msgid "B<SO_ACCEPTCONN>"
9026 msgstr "B<SO_ACCEPTCONN>"
9027
9028 #. type: Plain text
9029 #: build/C/man7/socket.7:307
9030 msgid ""
9031 "Returns a value indicating whether or not this socket has been marked to "
9032 "accept connections with B<listen>(2).  The value 0 indicates that this is "
9033 "not a listening socket, the value 1 indicates that this is a listening "
9034 "socket.  This socket option is read-only."
9035 msgstr ""
9036 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
9037 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9038 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9039
9040 #. type: TP
9041 #: build/C/man7/socket.7:307
9042 #, no-wrap
9043 msgid "B<SO_BINDTODEVICE>"
9044 msgstr "B<SO_BINDTODEVICE>"
9045
9046 #. type: Plain text
9047 #: build/C/man7/socket.7:326
9048 msgid ""
9049 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9050 "the passed interface name.  If the name is an empty string or the option "
9051 "length is zero, the socket device binding is removed.  The passed option is "
9052 "a variable-length null-terminated interface name string with the maximum "
9053 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
9054 "received from that particular interface are processed by the socket.  Note "
9055 "that this works only for some socket types, particularly B<AF_INET> "
9056 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
9057 "there)."
9058 msgstr ""
9059 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9060 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9061 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9062 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9063 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9064 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9065 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9066 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9067 "B<bind>(2) を使うこと)。"
9068
9069 #. type: Plain text
9070 #: build/C/man7/socket.7:340
9071 msgid ""
9072 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9073 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
9074 "argument should contain the buffer size available to receive the device name "
9075 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
9076 "reported back in the I<optlen> argument."
9077 msgstr ""
9078 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9079 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9080 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9081 "バッファーサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 "
9082 "実際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9083
9084 #. type: TP
9085 #: build/C/man7/socket.7:340
9086 #, no-wrap
9087 msgid "B<SO_BROADCAST>"
9088 msgstr "B<SO_BROADCAST>"
9089
9090 #. type: Plain text
9091 #: build/C/man7/socket.7:346
9092 msgid ""
9093 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
9094 "to send packets to a broadcast address.  This option has no effect on stream-"
9095 "oriented sockets."
9096 msgstr ""
9097 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9098 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9099 "ストリーム指向のソケットには何の効果もない。"
9100
9101 #. type: TP
9102 #: build/C/man7/socket.7:346
9103 #, no-wrap
9104 msgid "B<SO_BSDCOMPAT>"
9105 msgstr "B<SO_BSDCOMPAT>"
9106
9107 #. type: Plain text
9108 #: build/C/man7/socket.7:358
9109 msgid ""
9110 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
9111 "module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP "
9112 "socket will not be passed to the user program.  In later kernel versions, "
9113 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9114 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9115 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9116 "header changing, skipping of the broadcast flag) for raw sockets with this "
9117 "option, but that was removed in Linux 2.2."
9118 msgstr ""
9119 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9120 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9121 "UDP ソケットで受信された ICMP エラーは ユーザープログラムに渡されない。 これ"
9122 "以降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されて"
9123 "きた。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラ"
9124 "ムがこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージ"
9125 "が出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにお"
9126 "いても BSD のバグ (ランダムヘッダー変更、 ブロードキャストフラグのスキップ)  "
9127 "に対する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除され"
9128 "た。"
9129
9130 #. type: TP
9131 #: build/C/man7/socket.7:358
9132 #, no-wrap
9133 msgid "B<SO_DEBUG>"
9134 msgstr "B<SO_DEBUG>"
9135
9136 #. type: Plain text
9137 #: build/C/man7/socket.7:364
9138 msgid ""
9139 "Enable socket debugging.  Only allowed for processes with the "
9140 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9141 msgstr ""
9142 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9143 "実効ユーザー ID が 0 のプロセスでしか 利用できない。"
9144
9145 #. type: TP
9146 #: build/C/man7/socket.7:364
9147 #, no-wrap
9148 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9149 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9150
9151 #. type: Plain text
9152 #: build/C/man7/socket.7:372
9153 msgid ""
9154 "Retrieves the socket domain as an integer, returning a value such as "
9155 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9156 "only."
9157 msgstr ""
9158 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9159 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9160
9161 #. type: TP
9162 #: build/C/man7/socket.7:372
9163 #, no-wrap
9164 msgid "B<SO_ERROR>"
9165 msgstr "B<SO_ERROR>"
9166
9167 #. type: Plain text
9168 #: build/C/man7/socket.7:377
9169 msgid ""
9170 "Get and clear the pending socket error.  This socket option is read-only.  "
9171 "Expects an integer."
9172 msgstr ""
9173 "保留になっていたソケットエラーを取得してクリアする。\n"
9174 "このソケットオプションは読み込み専用である。整数値をとる。"
9175
9176 #. type: TP
9177 #: build/C/man7/socket.7:377
9178 #, no-wrap
9179 msgid "B<SO_DONTROUTE>"
9180 msgstr "B<SO_DONTROUTE>"
9181
9182 #. type: Plain text
9183 #: build/C/man7/socket.7:386
9184 msgid ""
9185 "Don't send via a gateway, send only to directly connected hosts.  The same "
9186 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9187 "B<send>(2)  operation.  Expects an integer boolean flag."
9188 msgstr ""
9189 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9190 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9191 "数のフラグを取る。"
9192
9193 #. type: TP
9194 #: build/C/man7/socket.7:386
9195 #, no-wrap
9196 msgid "B<SO_KEEPALIVE>"
9197 msgstr "B<SO_KEEPALIVE>"
9198
9199 #. type: Plain text
9200 #: build/C/man7/socket.7:390
9201 msgid ""
9202 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9203 "Expects an integer boolean flag."
9204 msgstr ""
9205 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9206 "の整数フラグをとる。"
9207
9208 #. type: TP
9209 #: build/C/man7/socket.7:390
9210 #, no-wrap
9211 msgid "B<SO_LINGER>"
9212 msgstr "B<SO_LINGER>"
9213
9214 #. type: Plain text
9215 #: build/C/man7/socket.7:398
9216 msgid ""
9217 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9218 msgstr ""
9219 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9220
9221 #. type: Plain text
9222 #: build/C/man7/socket.7:405
9223 #, no-wrap
9224 msgid ""
9225 "struct linger {\n"
9226 "    int l_onoff;    /* linger active */\n"
9227 "    int l_linger;   /* how many seconds to linger for */\n"
9228 "};\n"
9229 msgstr ""
9230 "struct linger {\n"
9231 "    int l_onoff;    /* linger active */\n"
9232 "    int l_linger;   /* how many seconds to linger for */\n"
9233 "};\n"
9234
9235 #. type: Plain text
9236 #: build/C/man7/socket.7:419
9237 msgid ""
9238 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9239 "queued messages for the socket have been successfully sent or the linger "
9240 "timeout has been reached.  Otherwise, the call returns immediately and the "
9241 "closing is done in the background.  When the socket is closed as part of "
9242 "B<exit>(2), it always lingers in the background."
9243 msgstr ""
9244 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9245 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9246 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9247 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9248 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9249 "送られる。"
9250
9251 #. type: TP
9252 #: build/C/man7/socket.7:419
9253 #, no-wrap
9254 msgid "B<SO_MARK> (since Linux 2.6.25)"
9255 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9256
9257 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9258 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9259 #. type: Plain text
9260 #: build/C/man7/socket.7:430
9261 msgid ""
9262 "Set the mark for each packet sent through this socket (similar to the "
9263 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9264 "mark-based routing without netfilter or for packet filtering.  Setting this "
9265 "option requires the B<CAP_NET_ADMIN> capability."
9266 msgstr ""
9267 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9268 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9269 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9270 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9271 "ティが必要である。"
9272
9273 #. type: TP
9274 #: build/C/man7/socket.7:430
9275 #, no-wrap
9276 msgid "B<SO_OOBINLINE>"
9277 msgstr "B<SO_OOBINLINE>"
9278
9279 #.  don't document it because it can do too much harm.
9280 #. .B SO_NO_CHECK
9281 #. type: Plain text
9282 #: build/C/man7/socket.7:439
9283 msgid ""
9284 "If this option is enabled, out-of-band data is directly placed into the "
9285 "receive data stream.  Otherwise, out-of-band data is passed only when the "
9286 "B<MSG_OOB> flag is set during receiving."
9287 msgstr ""
9288 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9289 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9290 "ラグがセットされている場合に限って渡される。"
9291
9292 #. type: TP
9293 #: build/C/man7/socket.7:439
9294 #, no-wrap
9295 msgid "B<SO_PASSCRED>"
9296 msgstr "B<SO_PASSCRED>"
9297
9298 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9299 #.  in the 2.6.18 ChangeLog
9300 #. type: Plain text
9301 #: build/C/man7/socket.7:448
9302 msgid ""
9303 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9304 "For more information see B<unix>(7)."
9305 msgstr ""
9306 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9307 "を参照のこと。"
9308
9309 #. type: TP
9310 #: build/C/man7/socket.7:448
9311 #, no-wrap
9312 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9313 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9314
9315 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9316 #. type: Plain text
9317 #: build/C/man7/socket.7:458
9318 msgid ""
9319 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9320 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9321 "with B<MSG_PEEK> flag."
9322 msgstr ""
9323 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9324 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9325 "B<unix>(7) ソケットでのみサポートされている。"
9326
9327 #. type: Plain text
9328 #: build/C/man7/socket.7:466
9329 msgid ""
9330 "When this option is set to a negative value (it is set to -1 for all new "
9331 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9332 "flag will peek data from the front of the queue."
9333 msgstr ""
9334 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9335 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9336 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9337 "のソケットではこのオプションの値は必ず -1 に設定される。"
9338
9339 #. type: Plain text
9340 #: build/C/man7/socket.7:473
9341 msgid ""
9342 "When the option is set to a value greater than or equal to zero, then the "
9343 "next peek at data queued in the socket will occur at the byte offset "
9344 "specified by the option value.  At the same time, the \"peek offset\" will "
9345 "be incremented by the number of bytes that were peeked from the queue, so "
9346 "that a subsequent peek will return the next data in the queue."
9347 msgstr ""
9348 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9349 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9350 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9351 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9352
9353 #. type: Plain text
9354 #: build/C/man7/socket.7:485
9355 msgid ""
9356 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9357 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9358 "by the number of bytes removed.  In other words, receiving data without the "
9359 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9360 "the correct relative position in the queued data, so that a subsequent peek "
9361 "will retrieve the data that would have been retrieved had the data not been "
9362 "removed."
9363 msgstr ""
9364 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9365 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9366 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9367 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9368 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9369 "いうことである。"
9370
9371 #. type: Plain text
9372 #: build/C/man7/socket.7:490
9373 msgid ""
9374 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9375 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9376 msgstr ""
9377 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9378 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9379
9380 #. type: Plain text
9381 #: build/C/man7/socket.7:494
9382 msgid ""
9383 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9384 "Suppose a stream socket has the following queued input data:"
9385 msgstr ""
9386 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9387 "以下の入力データが入っているものとする。"
9388
9389 #. type: Plain text
9390 #: build/C/man7/socket.7:496
9391 #, no-wrap
9392 msgid "    aabbccddeeff\n"
9393 msgstr "    aabbccddeeff\n"
9394
9395 #. type: Plain text
9396 #: build/C/man7/socket.7:501
9397 msgid ""
9398 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9399 "the comments:"
9400 msgstr ""
9401 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9402
9403 #. type: Plain text
9404 #: build/C/man7/socket.7:506
9405 #, no-wrap
9406 msgid ""
9407 "int ov = 4;                  // Set peek offset to 4\n"
9408 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9409 msgstr ""
9410 "int ov = 4;                  // Set peek offset to 4\n"
9411 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9412
9413 #. type: Plain text
9414 #: build/C/man7/socket.7:511
9415 #, no-wrap
9416 msgid ""
9417 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9418 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9419 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9420 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9421 msgstr ""
9422 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9423 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9424 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9425 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9426
9427 #. type: TP
9428 #: build/C/man7/socket.7:513
9429 #, no-wrap
9430 msgid "B<SO_PEERCRED>"
9431 msgstr "B<SO_PEERCRED>"
9432
9433 #. type: Plain text
9434 #: build/C/man7/socket.7:536
9435 msgid ""
9436 "Return the credentials of the foreign process connected to this socket.  "
9437 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9438 "stream and datagram socket pairs created using B<socketpair>(2); see "
9439 "B<unix>(7).  The returned credentials are those that were in effect at the "
9440 "time of the call to B<connect>(2)  or B<socketpair>(2).  The argument is a "
9441 "I<ucred> structure; define the B<_GNU_SOURCE> feature test macro to obtain "
9442 "the definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This "
9443 "socket option is read-only."
9444 msgstr ""
9445 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9446 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9447 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9448 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9449 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9450 "る。 引き数は I<ucred> 構造体である。この構造体の定義を I<E<lt>sys/socket."
9451 "hE<gt>> を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義すること。 このソ"
9452 "ケットオプションは読み込み専用である。"
9453
9454 #. type: TP
9455 #: build/C/man7/socket.7:536
9456 #, no-wrap
9457 msgid "B<SO_PRIORITY>"
9458 msgstr "B<SO_PRIORITY>"
9459
9460 #. type: Plain text
9461 #: build/C/man7/socket.7:549
9462 msgid ""
9463 "Set the protocol-defined priority for all packets to be sent on this "
9464 "socket.  Linux uses this value to order the networking queues: packets with "
9465 "a higher priority may be processed first depending on the selected device "
9466 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9467 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9468 "6 requires the B<CAP_NET_ADMIN> capability."
9469 msgstr ""
9470 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9471 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9472 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9473 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9474 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9475 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9476
9477 #. type: TP
9478 #: build/C/man7/socket.7:549
9479 #, no-wrap
9480 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9481 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9482
9483 #. type: Plain text
9484 #: build/C/man7/socket.7:557
9485 msgid ""
9486 "Retrieves the socket protocol as an integer, returning a value such as "
9487 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9488 "only."
9489 msgstr ""
9490 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9491 "る。\n"
9492 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9493
9494 #. type: TP
9495 #: build/C/man7/socket.7:557
9496 #, no-wrap
9497 msgid "B<SO_RCVBUF>"
9498 msgstr "B<SO_RCVBUF>"
9499
9500 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9501 #.  The following thread on LMKL is quite informative:
9502 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behavior
9503 #.  17 July 2012
9504 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9505 #. type: Plain text
9506 #: build/C/man7/socket.7:576
9507 msgid ""
9508 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9509 "this value (to allow space for bookkeeping overhead)  when it is set using "
9510 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9511 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9512 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9513 "file.  The minimum (doubled) value for this option is 256."
9514 msgstr ""
9515 "ソケットの受信バッファーの最大サイズを設定・取得する (バイト単位)。 "
9516 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9517 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9518 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9519 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9520 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9521
9522 #. type: TP
9523 #: build/C/man7/socket.7:576
9524 #, no-wrap
9525 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9526 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9527
9528 #. type: Plain text
9529 #: build/C/man7/socket.7:585
9530 msgid ""
9531 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9532 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9533 "overridden."
9534 msgstr ""
9535 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9536 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9537 "きすることができる。"
9538
9539 #. type: TP
9540 #: build/C/man7/socket.7:585
9541 #, no-wrap
9542 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9543 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9544
9545 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9546 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9547 #. type: Plain text
9548 #: build/C/man7/socket.7:614
9549 msgid ""
9550 "Specify the minimum number of bytes in the buffer until the socket layer "
9551 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9552 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9553 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9554 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9555 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9556 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9557 "single byte of data is available.  A subsequent read from the socket will "
9558 "block until B<SO_RCVLOWAT> bytes are available."
9559 msgstr ""
9560 "バッファー中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9561 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9562 "ユーザーに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9563 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9564 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9565 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9566 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9567 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9568 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9569 "してしまう。"
9570
9571 #. type: TP
9572 #: build/C/man7/socket.7:614
9573 #, no-wrap
9574 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9575 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9576
9577 #.  Not implemented in 2.0.
9578 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9579 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9580 #.  in fact to EAGAIN
9581 #. type: Plain text
9582 #: build/C/man7/socket.7:649
9583 msgid ""
9584 "Specify the receiving or sending timeouts until reporting an error.  The "
9585 "argument is a I<struct timeval>.  If an input or output function blocks for "
9586 "this period of time, and data has been sent or received, the return value of "
9587 "that function will be the amount of data transferred; if no data has been "
9588 "transferred and the timeout has been reached, then -1 is returned with "
9589 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9590 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9591 "the timeout is set to zero (the default), then the operation will never "
9592 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9593 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9594 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9595 msgstr ""
9596 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9597 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9598 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9599 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9600 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> "
9601 "(B<connect>(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定さ"
9602 "れたように見える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操"
9603 "作は決してタイムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット "
9604 "I/O を実行するシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), "
9605 "B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), "
9606 "B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
9607
9608 #. type: TP
9609 #: build/C/man7/socket.7:649
9610 #, no-wrap
9611 msgid "B<SO_REUSEADDR>"
9612 msgstr "B<SO_REUSEADDR>"
9613
9614 #. type: Plain text
9615 #: build/C/man7/socket.7:664
9616 msgid ""
9617 "Indicates that the rules used in validating addresses supplied in a "
9618 "B<bind>(2)  call should allow reuse of local addresses.  For B<AF_INET> "
9619 "sockets this means that a socket may bind, except when there is an active "
9620 "listening socket bound to the address.  When the listening socket is bound "
9621 "to B<INADDR_ANY> with a specific port then it is not possible to bind to "
9622 "this port for any local address.  Argument is an integer boolean flag."
9623 msgstr ""
9624 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9625 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9626 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9627 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9628 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9629 "ドできない。 引き数はブール整数のフラグである。"
9630
9631 #. type: TP
9632 #: build/C/man7/socket.7:664
9633 #, no-wrap
9634 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9635 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9636
9637 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9638 #. type: Plain text
9639 #: build/C/man7/socket.7:671
9640 msgid ""
9641 "Indicates that an unsigned 32-bit value ancillary message (cmsg)  should be "
9642 "attached to received skbs indicating the number of packets dropped by the "
9643 "socket between the last received packet and this received packet."
9644 msgstr ""
9645 "最後の受信パケットとこの受信パケットの間にそのソケットで捨てられた (ドロップ"
9646 "された) パケット数を示す、unsigned 32 ビット値の補助メッセージ (cmsg) を受信"
9647 "した skb に付与することを指示する。"
9648
9649 #. type: TP
9650 #: build/C/man7/socket.7:671
9651 #, no-wrap
9652 msgid "B<SO_SNDBUF>"
9653 msgstr "B<SO_SNDBUF>"
9654
9655 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9656 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9657 #. type: Plain text
9658 #: build/C/man7/socket.7:687
9659 msgid ""
9660 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9661 "this value (to allow space for bookkeeping overhead)  when it is set using "
9662 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9663 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9664 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9665 "file.  The minimum (doubled) value for this option is 2048."
9666 msgstr ""
9667 "ソケットの送信バッファーの最大サイズを設定・取得する (バイト単位)。 "
9668 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9669 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9670 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9671 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9672 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9673
9674 #. type: TP
9675 #: build/C/man7/socket.7:687
9676 #, no-wrap
9677 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9678 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9679
9680 #. type: Plain text
9681 #: build/C/man7/socket.7:696
9682 msgid ""
9683 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9684 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9685 "overridden."
9686 msgstr ""
9687 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9688 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9689 "きすることができる。"
9690
9691 #. type: TP
9692 #: build/C/man7/socket.7:696
9693 #, no-wrap
9694 msgid "B<SO_TIMESTAMP>"
9695 msgstr "B<SO_TIMESTAMP>"
9696
9697 #. type: Plain text
9698 #: build/C/man7/socket.7:712
9699 msgid ""
9700 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9701 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9702 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9703 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9704 "details on control messages."
9705 msgstr ""
9706 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9707 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9708 "ステムコールでユーザーに渡した 最後のパケットの受信時刻を示す I<struct "
9709 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9710
9711 #. type: TP
9712 #: build/C/man7/socket.7:712
9713 #, no-wrap
9714 msgid "B<SO_TYPE>"
9715 msgstr "B<SO_TYPE>"
9716
9717 #. type: Plain text
9718 #: build/C/man7/socket.7:717
9719 msgid ""
9720 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9721 "option is read-only."
9722 msgstr ""
9723 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9724 "このソケットオプションは読み出し専用である。"
9725
9726 #. type: TP
9727 #: build/C/man7/socket.7:717
9728 #, no-wrap
9729 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9730 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9731
9732 #. type: Plain text
9733 #: build/C/man7/socket.7:726
9734 msgid ""
9735 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9736 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9737 "The default for this option is controlled by the I</proc/sys/net/core/"
9738 "busy_read> file."
9739 msgstr ""
9740 "データがなかった際にブロッキング受信での busy polling のおおよその時間をマイ"
9741 "クロ秒単位で設定する。 この値を増やすには B<CAP_NET_ADMIN> ケーパビリティが必"
9742 "要である。 このオプションのデフォルト値は I</proc/sys/net/core/busy_read> で"
9743 "制御できる。"
9744
9745 #. type: Plain text
9746 #: build/C/man7/socket.7:736
9747 msgid ""
9748 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9749 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9750 "with B<SO_BUSY_POLL> set and no events to report are found."
9751 msgstr ""
9752 "I</proc/sys/net/core/busy_poll> の値により、 B<SO_BUSY_POLL> がセットされたソ"
9753 "ケットに対して B<select>(2) や B<poll>(2) を行い、報告すべきイベントがない場"
9754 "合に、 B<select>(2) や B<poll>(2) が busy polling をどのくらいの時間行うかが"
9755 "決まる。"
9756
9757 #. type: Plain text
9758 #: build/C/man7/socket.7:740
9759 msgid ""
9760 "In both cases, busy polling will only be done when the socket last received "
9761 "data from a network device that supports this option."
9762 msgstr ""
9763 "どちらの場合も、busy polling は、そのソケットが最後にデータを受信したネット"
9764 "ワークデバイスがこのオプションに対応している場合のみ行われる。"
9765
9766 #. type: Plain text
9767 #: build/C/man7/socket.7:744
9768 msgid ""
9769 "While busy polling may improve latency of some applications, care must be "
9770 "taken when using it since this will increase both CPU utilization and power "
9771 "usage."
9772 msgstr ""
9773 "busy polling により遅延が改善されるはアプリケーションもあるが、 busy polling "
9774 "は CPU 使用率と電力使用量をともに増加させることになるので、使用する際は注意し"
9775 "て行うこと。"
9776
9777 #. type: SS
9778 #: build/C/man7/socket.7:744
9779 #, no-wrap
9780 msgid "Signals"
9781 msgstr "シグナル"
9782
9783 #. type: Plain text
9784 #: build/C/man7/socket.7:755
9785 msgid ""
9786 "When writing onto a connection-oriented socket that has been shut down (by "
9787 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9788 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9789 "the B<MSG_NOSIGNAL> flag."
9790 msgstr ""
9791 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9792 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9793 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9794 "していた場合はシグナルは送られない。"
9795
9796 #. type: Plain text
9797 #: build/C/man7/socket.7:780
9798 msgid ""
9799 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> "
9800 "B<ioctl>(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to "
9801 "use B<poll>(2)  or B<select>(2)  in the signal handler to find out which "
9802 "socket the event occurred on.  An alternative (in Linux 2.2) is to set a "
9803 "real-time signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real "
9804 "time signal will be called with the file descriptor in the I<si_fd> field of "
9805 "its I<siginfo_t>.  See B<fcntl>(2)  for more information."
9806 msgstr ""
9807 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9808 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9809 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラー内で用いれば、どのソ"
9810 "ケットでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方"
9811 "法としては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定する"
9812 "やり方もある。 リアルタイムシグナルのハンドラーは、 I<siginfo_t> の I<si_fd> "
9813 "フィールドにファイルディスクリプターが入った状態で呼び出される。 詳細は "
9814 "B<fcntl>(2)  を参照のこと。"
9815
9816 #.  .SS Ancillary messages
9817 #. type: Plain text
9818 #: build/C/man7/socket.7:788
9819 msgid ""
9820 "Under some circumstances (e.g., multiple processes accessing a single "
9821 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9822 "when the process reacts to the signal.  If this happens, the process should "
9823 "wait again because Linux will resend the signal later."
9824 msgstr ""
9825 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9826 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9827 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9828 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9829
9830 #. type: SS
9831 #: build/C/man7/socket.7:788
9832 #, no-wrap
9833 msgid "/proc interfaces"
9834 msgstr "/proc インターフェース"
9835
9836 #. type: Plain text
9837 #: build/C/man7/socket.7:792
9838 msgid ""
9839 "The core socket networking parameters can be accessed via files in the "
9840 "directory I</proc/sys/net/core/>."
9841 msgstr ""
9842 "core のソケットのネットワーキングパラメーターには、 I</proc/sys/net/core/> "
9843 "ディレクトリ内のファイルを通してアクセスできる。"
9844
9845 #. type: TP
9846 #: build/C/man7/socket.7:792
9847 #, no-wrap
9848 msgid "I<rmem_default>"
9849 msgstr "I<rmem_default>"
9850
9851 #. type: Plain text
9852 #: build/C/man7/socket.7:795
9853 msgid "contains the default setting in bytes of the socket receive buffer."
9854 msgstr "ソケットの受信バッファーサイズのデフォルト値 (バイト単位)。"
9855
9856 #. type: TP
9857 #: build/C/man7/socket.7:795
9858 #, no-wrap
9859 msgid "I<rmem_max>"
9860 msgstr "I<rmem_max>"
9861
9862 #. type: Plain text
9863 #: build/C/man7/socket.7:801
9864 msgid ""
9865 "contains the maximum socket receive buffer size in bytes which a user may "
9866 "set by using the B<SO_RCVBUF> socket option."
9867 msgstr ""
9868 "B<SO_RCVBUF> ソケットオプションを用いてユーザーが設定できる ソケットの受信"
9869 "バッファーサイズの最大値 (バイト単位)。"
9870
9871 #. type: TP
9872 #: build/C/man7/socket.7:801
9873 #, no-wrap
9874 msgid "I<wmem_default>"
9875 msgstr "I<wmem_default>"
9876
9877 #. type: Plain text
9878 #: build/C/man7/socket.7:804
9879 msgid "contains the default setting in bytes of the socket send buffer."
9880 msgstr "ソケットの送信バッファーサイズのデフォルト値 (バイト単位)。"
9881
9882 #. type: TP
9883 #: build/C/man7/socket.7:804
9884 #, no-wrap
9885 msgid "I<wmem_max>"
9886 msgstr "I<wmem_max>"
9887
9888 #. type: Plain text
9889 #: build/C/man7/socket.7:810
9890 msgid ""
9891 "contains the maximum socket send buffer size in bytes which a user may set "
9892 "by using the B<SO_SNDBUF> socket option."
9893 msgstr ""
9894 "B<SO_SNDBUF> ソケットオプションを用いてユーザーが設定できる ソケットの送信"
9895 "バッファーサイズの最大値 (バイト単位)。"
9896
9897 #. type: TP
9898 #: build/C/man7/socket.7:810
9899 #, no-wrap
9900 msgid "I<message_cost> and I<message_burst>"
9901 msgstr "I<message_cost> と I<message_burst>"
9902
9903 #. type: Plain text
9904 #: build/C/man7/socket.7:814
9905 msgid ""
9906 "configure the token bucket filter used to load limit warning messages caused "
9907 "by external network events."
9908 msgstr ""
9909 "トークンバケットフィルターを設定する。 これは外部のネットワークイベントによっ"
9910 "て引き起こされた 負荷限界の警告メッセージに用いられる。"
9911
9912 #. type: TP
9913 #: build/C/man7/socket.7:814
9914 #, no-wrap
9915 msgid "I<netdev_max_backlog>"
9916 msgstr "I<netdev_max_backlog>"
9917
9918 #. type: Plain text
9919 #: build/C/man7/socket.7:817
9920 msgid "Maximum number of packets in the global input queue."
9921 msgstr "グローバルな入力キューにおける最大のパケット数。"
9922
9923 #. type: TP
9924 #: build/C/man7/socket.7:817
9925 #, no-wrap
9926 msgid "I<optmem_max>"
9927 msgstr "I<optmem_max>"
9928
9929 #.  netdev_fastroute is not documented because it is experimental
9930 #. type: Plain text
9931 #: build/C/man7/socket.7:822
9932 msgid ""
9933 "Maximum length of ancillary data and user control data like the iovecs per "
9934 "socket."
9935 msgstr ""
9936 "ソケットあたりの、補助データ (ancillary data) とユーザー制御データ (iovecs の"
9937 "ようなもの) との和の最大長。"
9938
9939 #. type: SS
9940 #: build/C/man7/socket.7:822
9941 #, no-wrap
9942 msgid "Ioctls"
9943 msgstr "ioctl"
9944
9945 #. type: Plain text
9946 #: build/C/man7/socket.7:825
9947 msgid "These operations can be accessed using B<ioctl>(2):"
9948 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9949
9950 #. type: Plain text
9951 #: build/C/man7/socket.7:829
9952 #, no-wrap
9953 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9954 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9955
9956 #. type: TP
9957 #: build/C/man7/socket.7:831
9958 #, no-wrap
9959 msgid "B<SIOCGSTAMP>"
9960 msgstr "B<SIOCGSTAMP>"
9961
9962 #. type: Plain text
9963 #: build/C/man7/socket.7:855
9964 msgid ""
9965 "Return a I<struct timeval> with the receive timestamp of the last packet "
9966 "passed to the user.  This is useful for accurate round trip time "
9967 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9968 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9969 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9970 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9971 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9972 "to B<ENOENT>)."
9973 msgstr ""
9974 "最後にユーザーに渡されたパケットの受信タイムスタンプを I<struct timeval> に入"
9975 "れて返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9976 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9977 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9978 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9979 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9980 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9981 "セットする)。"
9982
9983 #. type: TP
9984 #: build/C/man7/socket.7:855
9985 #, no-wrap
9986 msgid "B<SIOCSPGRP>"
9987 msgstr "B<SIOCSPGRP>"
9988
9989 #. type: Plain text
9990 #: build/C/man7/socket.7:874
9991 msgid ""
9992 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9993 "when an asynchronous I/O operation has finished or urgent data is "
9994 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9995 "positive, send the signals to that process.  If the argument is negative, "
9996 "send the signals to the process group with the ID of the absolute value of "
9997 "the argument.  The process may only choose itself or its own process group "
9998 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9999 "UID of 0."
10000 msgstr ""
10001 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
10002 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポイン"
10003 "ターである。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き"
10004 "数の絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先に"
10005 "は、自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但"
10006 "し、 B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザー ID が 0 の"
10007 "プロセスの場合は この限りではない。"
10008
10009 #. type: TP
10010 #: build/C/man7/socket.7:874
10011 #, no-wrap
10012 msgid "B<FIOASYNC>"
10013 msgstr "B<FIOASYNC>"
10014
10015 #. type: Plain text
10016 #: build/C/man7/socket.7:884
10017 msgid ""
10018 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
10019 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
10020 "set with B<F_SETSIG> is raised when a new I/O event occurs."
10021 msgstr ""
10022 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
10023 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
10024 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナルセットが発行される。"
10025
10026 #. type: Plain text
10027 #: build/C/man7/socket.7:892
10028 msgid ""
10029 "Argument is an integer boolean flag.  (This operation is synonymous with the "
10030 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
10031 msgstr ""
10032 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
10033 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10034
10035 #. type: TP
10036 #: build/C/man7/socket.7:892
10037 #, no-wrap
10038 msgid "B<SIOCGPGRP>"
10039 msgstr "B<SIOCGPGRP>"
10040
10041 #. type: Plain text
10042 #: build/C/man7/socket.7:901
10043 msgid ""
10044 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10045 "signals, or 0 when none is set."
10046 msgstr ""
10047 "B<SIGIO> や B<SIGURG> を受信したカレントプロセスかプロセスグループを取得す"
10048 "る。 ない場合は 0 が返る。"
10049
10050 #. type: Plain text
10051 #: build/C/man7/socket.7:905
10052 msgid "Valid B<fcntl>(2)  operations:"
10053 msgstr "有効な B<fcntl>(2)  操作:"
10054
10055 #. type: TP
10056 #: build/C/man7/socket.7:905
10057 #, no-wrap
10058 msgid "B<FIOGETOWN>"
10059 msgstr "B<FIOGETOWN>"
10060
10061 #. type: Plain text
10062 #: build/C/man7/socket.7:910
10063 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10064 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
10065
10066 #. type: TP
10067 #: build/C/man7/socket.7:910
10068 #, no-wrap
10069 msgid "B<FIOSETOWN>"
10070 msgstr "B<FIOSETOWN>"
10071
10072 #. type: Plain text
10073 #: build/C/man7/socket.7:915
10074 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10075 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
10076
10077 #. type: Plain text
10078 #: build/C/man7/socket.7:929
10079 msgid ""
10080 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
10081 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
10082 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
10083 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10084 "be read or written."
10085 msgstr ""
10086 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10087 "2.2 で登場した。 I</proc> インターフェースは Linux 2.2 で導入された。 "
10088 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10089 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10090 "はできなかった。"
10091
10092 #. type: Plain text
10093 #: build/C/man7/socket.7:934
10094 msgid ""
10095 "Linux assumes that half of the send/receive buffer is used for internal "
10096 "kernel structures; thus the values in the corresponding I</proc> files are "
10097 "twice what can be observed on the wire."
10098 msgstr ""
10099 "Linux は、送受信バッファーの半分を内部のカーネル構造体で用いると仮定してい"
10100 "る。 したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの "
10101 "2 倍になる。"
10102
10103 #. type: Plain text
10104 #: build/C/man7/socket.7:947
10105 msgid ""
10106 "Linux will allow port reuse only with the B<SO_REUSEADDR> option when this "
10107 "option was set both in the previous program that performed a B<bind>(2)  to "
10108 "the port and in the program that wants to reuse the port.  This differs from "
10109 "some implementations (e.g., FreeBSD)  where only the later program needs to "
10110 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
10111 "since, for example, a server program is designed to always set this option."
10112 msgstr ""
10113 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10114 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
10115 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10116 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10117 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10118 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10119 "このオプションをセットするように設計されるからである。"
10120
10121 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10122 #.  .SH AUTHORS
10123 #.  This man page was written by Andi Kleen.
10124 #. type: Plain text
10125 #: build/C/man7/socket.7:960
10126 msgid ""
10127 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10128 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
10129 "is via the libpcap library."
10130 msgstr ""
10131 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10132 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10133 "して 用いる方が良い。"
10134
10135 #. type: Plain text
10136 #: build/C/man7/socket.7:972
10137 msgid ""
10138 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10139 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10140 "B<unix>(7)"
10141 msgstr ""
10142 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10143 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10144 "B<unix>(7)"
10145
10146 #. type: TH
10147 #: build/C/man2/socketcall.2:25
10148 #, no-wrap
10149 msgid "SOCKETCALL"
10150 msgstr "SOCKETCALL"
10151
10152 #. type: TH
10153 #: build/C/man2/socketcall.2:25
10154 #, no-wrap
10155 msgid "2012-10-16"
10156 msgstr "2012-10-16"
10157
10158 #. type: Plain text
10159 #: build/C/man2/socketcall.2:28
10160 msgid "socketcall - socket system calls"
10161 msgstr "socketcall - ソケットシステムコール"
10162
10163 #. type: Plain text
10164 #: build/C/man2/socketcall.2:30
10165 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10166 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10167
10168 #. type: Plain text
10169 #: build/C/man2/socketcall.2:38
10170 msgid ""
10171 "B<socketcall>()  is a common kernel entry point for the socket system "
10172 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10173 "to a block containing the actual arguments, which are passed through to the "
10174 "appropriate call."
10175 msgstr ""
10176 "B<socketcall>()  はソケットシステムコールのための共通のカーネルエントリー ポ"
10177 "イント(kernel entry point)である。 I<call> はどのソケット関数を呼び出すかを指"
10178 "定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブロックを"
10179 "指す。"
10180
10181 #. type: Plain text
10182 #: build/C/man2/socketcall.2:42
10183 msgid ""
10184 "User programs should call the appropriate functions by their usual names.  "
10185 "Only standard library implementors and kernel hackers need to know about "
10186 "B<socketcall>()."
10187 msgstr ""
10188 "ユーザープログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標準"
10189 "ライブラリの実装者やカーネルハッカーのみが B<socketcall>()  について知る必要"
10190 "がある。"
10191
10192 #. type: Plain text
10193 #: build/C/man2/socketcall.2:45
10194 msgid ""
10195 "This call is specific to Linux, and should not be used in programs intended "
10196 "to be portable."
10197 msgstr ""
10198 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10199 "い。"
10200
10201 #. type: Plain text
10202 #: build/C/man2/socketcall.2:53
10203 msgid ""
10204 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10205 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), "
10206 "B<bind>(2), and so on really are implemented as separate system calls."
10207 msgstr ""
10208 "いくつかのアーキテクチャー\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システ"
10209 "ムコール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10210 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10211
10212 #. type: Plain text
10213 #: build/C/man2/socketcall.2:71
10214 msgid ""
10215 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10216 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10217 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10218 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10219 msgstr ""
10220 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10221 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10222 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10223 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10224
10225 #. type: TH
10226 #: build/C/man2/socketpair.2:42
10227 #, no-wrap
10228 msgid "SOCKETPAIR"
10229 msgstr "SOCKETPAIR"
10230
10231 #. type: TH
10232 #: build/C/man2/socketpair.2:42
10233 #, no-wrap
10234 msgid "2008-10-11"
10235 msgstr "2008-10-11"
10236
10237 #. type: Plain text
10238 #: build/C/man2/socketpair.2:45
10239 msgid "socketpair - create a pair of connected sockets"
10240 msgstr "socketpair - 接続されたソケットのペアを作成する"
10241
10242 #. type: Plain text
10243 #: build/C/man2/socketpair.2:52
10244 msgid ""
10245 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10246 ">I<sv>B<[2]);>"
10247 msgstr ""
10248 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10249 ">I<sv>B<[2]);>"
10250
10251 #. type: Plain text
10252 #: build/C/man2/socketpair.2:63
10253 msgid ""
10254 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10255 "the specified I<domain>, of the specified I<type>, and using the optionally "
10256 "specified I<protocol>.  For further details of these arguments, see "
10257 "B<socket>(2)."
10258 msgstr ""
10259 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10260 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10261 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10262
10263 #. type: Plain text
10264 #: build/C/man2/socketpair.2:69
10265 msgid ""
10266 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10267 "and I<sv>[1].  The two sockets are indistinguishable."
10268 msgstr ""
10269 "新しいソケットの参照に使用するディスクリプター (descriptor) が I<sv>[0] と "
10270 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10271
10272 #. type: Plain text
10273 #: build/C/man2/socketpair.2:78
10274 msgid "The specified address family is not supported on this machine."
10275 msgstr "このマシンでは指定されたアドレスファミリーがサポートされていない。"
10276
10277 #. type: Plain text
10278 #: build/C/man2/socketpair.2:83
10279 msgid ""
10280 "The address I<sv> does not specify a valid part of the process address space."
10281 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10282
10283 #. type: Plain text
10284 #: build/C/man2/socketpair.2:86
10285 msgid "Too many descriptors are in use by this process."
10286 msgstr "このプロセスが使用しているディスクリプターの数が多すぎる。"
10287
10288 #. type: Plain text
10289 #: build/C/man2/socketpair.2:92
10290 msgid "The specified protocol does not support creation of socket pairs."
10291 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10292
10293 #. type: Plain text
10294 #: build/C/man2/socketpair.2:95
10295 msgid "The specified protocol is not supported on this machine."
10296 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10297
10298 #. type: Plain text
10299 #: build/C/man2/socketpair.2:103
10300 msgid ""
10301 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10302 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10303 "of the BSD socket layer (including System\\ V variants)."
10304 msgstr ""
10305 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10306 "に (System\\ V の変種を含めて)  BSD のソケット層のクローンをサポートしてい"
10307 "る、BSD 以外のシステムと、 互いに移植性がある。"
10308
10309 #. type: Plain text
10310 #: build/C/man2/socketpair.2:109
10311 msgid ""
10312 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10313 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10314 "restriction.)"
10315 msgstr ""
10316 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10317 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10318
10319 #. type: Plain text
10320 #: build/C/man2/socketpair.2:118
10321 msgid ""
10322 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10323 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10324 msgstr ""
10325 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10326 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10327
10328 #. type: Plain text
10329 #: build/C/man2/socketpair.2:131
10330 msgid ""
10331 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10332 msgstr ""
10333 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"