OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.65
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2014-04-24 00:51+0900\n"
10 "PO-Revision-Date: 2014-04-19 21:14+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7:56 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:56
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:57
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
77
78 #. type: SH
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:59
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
89 #, no-wrap
90 msgid "SYNOPSIS"
91 msgstr "書式"
92
93 #. type: Plain text
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
95 #, no-wrap
96 msgid ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
102
103 #. type: Plain text
104 #: build/C/man2/accept.2:50
105 #, no-wrap
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
108
109 #. type: Plain text
110 #: build/C/man2/accept.2:53
111 #, no-wrap
112 msgid ""
113 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115 msgstr ""
116 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
118
119 #. type: Plain text
120 #: build/C/man2/accept.2:56
121 #, no-wrap
122 msgid ""
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
125 msgstr ""
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
128
129 #. type: SH
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:63
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "説明"
143
144 #. type: Plain text
145 #: build/C/man2/accept.2:72
146 msgid ""
147 "The B<accept>()  system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket.  The newly created socket is not in the listening "
152 "state.  The original socket I<sockfd> is unaffected by this call."
153 msgstr ""
154 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
158 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
159 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
160
161 #. type: Plain text
162 #: build/C/man2/accept.2:81
163 msgid ""
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
167 msgstr ""
168 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
170 "である。"
171
172 #. type: Plain text
173 #: build/C/man2/accept.2:99
174 msgid ""
175 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer.  The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2)  and the "
179 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
181 msgstr ""
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
183 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
184 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
185 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
186 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
187 "おくべきである。"
188
189 #. type: Plain text
190 #: build/C/man2/accept.2:107
191 msgid ""
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
195 msgstr ""
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
199
200 #. type: Plain text
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
202 msgid ""
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
205 "call."
206 msgstr ""
207 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
208 "る。\n"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
210 "される。"
211
212 #. type: Plain text
213 #: build/C/man2/accept.2:125
214 msgid ""
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
217 "present.  If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
219 "B<EWOULDBLOCK>."
220 msgstr ""
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
225
226 #. type: Plain text
227 #: build/C/man2/accept.2:139
228 msgid ""
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>()  to get a socket "
232 "for that connection.  Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
234 msgstr ""
235 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
240
241 #. type: Plain text
242 #: build/C/man2/accept.2:152
243 msgid ""
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation.  Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket.  Currently only DECNet has these "
249 "semantics on Linux."
250 msgstr ""
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
257
258 #. type: Plain text
259 #: build/C/man2/accept.2:162
260 msgid ""
261 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
263 "behavior:"
264 msgstr ""
265 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
267 "できる。"
268
269 #. type: TP
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2:160
271 #, no-wrap
272 msgid "B<SOCK_NONBLOCK>"
273 msgstr "B<SOCK_NONBLOCK>"
274
275 #. type: Plain text
276 #: build/C/man2/accept.2:170 build/C/man2/socket.2:168
277 msgid ""
278 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
279 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
280 msgstr ""
281 "新しく生成されるオープンファイル記述 (open file description) の "
282 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
283 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
284 "なる。"
285
286 #. type: TP
287 #: build/C/man2/accept.2:170 build/C/man2/socket.2:168
288 #, no-wrap
289 msgid "B<SOCK_CLOEXEC>"
290 msgstr "B<SOCK_CLOEXEC>"
291
292 #. type: Plain text
293 #: build/C/man2/accept.2:180 build/C/man2/socket.2:178
294 msgid ""
295 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
296 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
297 "may be useful."
298 msgstr ""
299 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
300 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
301 "B<O_CLOEXEC> フラグの説明を参照のこと。"
302
303 #. type: SH
304 #: build/C/man2/accept.2:180 build/C/man2/bind.2:152
305 #: build/C/man3/bindresvport.3:67 build/C/man2/connect.2:127
306 #: build/C/man3/getifaddrs.3:142 build/C/man2/getsockname.2:67
307 #: build/C/man2/getsockopt.2:131 build/C/man3/if_nameindex.3:71
308 #: build/C/man3/if_nametoindex.3:54 build/C/man2/listen.2:82
309 #: build/C/man2/recv.2:400 build/C/man2/recvmmsg.2:147
310 #: build/C/man2/select.2:299 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:275 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:310
313 #: build/C/man2/socketpair.2:69
314 #, no-wrap
315 msgid "RETURN VALUE"
316 msgstr "返り値"
317
318 #. type: Plain text
319 #: build/C/man2/accept.2:187
320 msgid ""
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
323 "is set appropriately."
324 msgstr ""
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
326 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
327 "定する。"
328
329 #. type: SS
330 #: build/C/man2/accept.2:187
331 #, no-wrap
332 msgid "Error handling"
333 msgstr "エラー処理"
334
335 #. type: Plain text
336 #: build/C/man2/accept.2:214
337 msgid ""
338 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
339 "on the new socket as an error code from B<accept>().  This behavior differs "
340 "from other BSD socket implementations.  For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
345 msgstr ""
346 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
353 "B<ENETUNREACH>"
354
355 #. type: SH
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:416 build/C/man2/recvmmsg.2:155
362 #: build/C/man2/select.2:317 build/C/man2/send.2:280
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:315 build/C/man2/socketpair.2:74
365 #, no-wrap
366 msgid "ERRORS"
367 msgstr "エラー"
368
369 #. type: TP
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:421 build/C/man2/send.2:296
371 #, no-wrap
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
374
375 #.  Actually EAGAIN on Linux
376 #. type: Plain text
377 #: build/C/man2/accept.2:223
378 msgid ""
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
383 msgstr ""
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
388
389 #. type: TP
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:165
391 #: build/C/man2/connect.2:169 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:91
393 #: build/C/man2/recv.2:430 build/C/man2/select.2:318 build/C/man2/send.2:304
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプタが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:191
417 #: build/C/man2/connect.2:175 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:439
419 #: build/C/man2/send.2:313 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:203
432 #: build/C/man2/recv.2:443 build/C/man2/select.2:323 build/C/man2/send.2:316
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:169
448 #: build/C/man2/bind.2:195 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:448
450 #: build/C/man2/recvmmsg.2:159 build/C/man2/select.2:327
451 #: build/C/man2/send.2:320 build/C/man3/sockatmark.3:63
452 #: build/C/man2/socket.2:323 build/C/man2/socket.2:326
453 #, no-wrap
454 msgid "B<EINVAL>"
455 msgstr "B<EINVAL>"
456
457 #. type: Plain text
458 #: build/C/man2/accept.2:244
459 msgid ""
460 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
461 "negative)."
462 msgstr ""
463 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
464 "負の場合など)。"
465
466 #. type: Plain text
467 #: build/C/man2/accept.2:249
468 msgid "(B<accept4>())  invalid value in I<flags>."
469 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
470
471 #. type: TP
472 #: build/C/man2/accept.2:249 build/C/man2/socket.2:331
473 #: build/C/man2/socketpair.2:83
474 #, no-wrap
475 msgid "B<EMFILE>"
476 msgstr "B<EMFILE>"
477
478 #. type: Plain text
479 #: build/C/man2/accept.2:252
480 msgid "The per-process limit of open file descriptors has been reached."
481 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
482
483 #. type: TP
484 #: build/C/man2/accept.2:252 build/C/man2/socket.2:334
485 #: build/C/man2/socketpair.2:86
486 #, no-wrap
487 msgid "B<ENFILE>"
488 msgstr "B<ENFILE>"
489
490 #. type: Plain text
491 #: build/C/man2/accept.2:255 build/C/man2/socket.2:337
492 #: build/C/man2/socketpair.2:89
493 msgid "The system limit on the total number of open files has been reached."
494 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
495
496 #. type: TP
497 #: build/C/man2/accept.2:255
498 #, no-wrap
499 msgid "B<ENOBUFS>, B<ENOMEM>"
500 msgstr "B<ENOBUFS>, B<ENOMEM>"
501
502 #. type: Plain text
503 #: build/C/man2/accept.2:260
504 msgid ""
505 "Not enough free memory.  This often means that the memory allocation is "
506 "limited by the socket buffer limits, not by the system memory."
507 msgstr ""
508 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
509 "ケットバッファの大きさによるメモリ割り当ての制限である。"
510
511 #. type: TP
512 #: build/C/man2/accept.2:260 build/C/man2/bind.2:174
513 #: build/C/man2/connect.2:215 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:96
515 #: build/C/man2/recv.2:463 build/C/man2/send.2:349
516 #, no-wrap
517 msgid "B<ENOTSOCK>"
518 msgstr "B<ENOTSOCK>"
519
520 #. type: Plain text
521 #: build/C/man2/accept.2:263
522 msgid "The descriptor references a file, not a socket."
523 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
524
525 #. type: TP
526 #: build/C/man2/accept.2:263 build/C/man2/listen.2:101 build/C/man2/send.2:354
527 #: build/C/man2/socketpair.2:89
528 #, no-wrap
529 msgid "B<EOPNOTSUPP>"
530 msgstr "B<EOPNOTSUPP>"
531
532 #. type: Plain text
533 #: build/C/man2/accept.2:267
534 msgid "The referenced socket is not of type B<SOCK_STREAM>."
535 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
536
537 #. type: TP
538 #: build/C/man2/accept.2:267
539 #, no-wrap
540 msgid "B<EPROTO>"
541 msgstr "B<EPROTO>"
542
543 #. type: Plain text
544 #: build/C/man2/accept.2:270
545 msgid "Protocol error."
546 msgstr "プロトコル・エラー。"
547
548 #. type: Plain text
549 #: build/C/man2/accept.2:274
550 msgid "In addition, Linux B<accept>()  may fail if:"
551 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
552
553 #. type: TP
554 #: build/C/man2/accept.2:274
555 #, no-wrap
556 msgid "B<EPERM>"
557 msgstr "B<EPERM>"
558
559 #. type: Plain text
560 #: build/C/man2/accept.2:277
561 msgid "Firewall rules forbid connection."
562 msgstr "ファイアウォールのルールにより接続が禁止された。"
563
564 #. type: Plain text
565 #: build/C/man2/accept.2:289
566 msgid ""
567 "In addition, network errors for the new socket and as defined for the "
568 "protocol may be returned.  Various Linux kernels can return other errors "
569 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
570 "value B<ERESTARTSYS> may be seen during a trace."
571 msgstr ""
572 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
573 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
574 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
575 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
576 "ともある。"
577
578 #. type: SH
579 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
580 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:163
581 #: build/C/man2/select.2:336 build/C/man2/sendmmsg.2:145
582 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:913
583 #, no-wrap
584 msgid "VERSIONS"
585 msgstr "バージョン"
586
587 #. type: Plain text
588 #: build/C/man2/accept.2:294
589 msgid ""
590 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
591 "support in glibc is available starting with version 2.10."
592 msgstr ""
593 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
594 "サポートはバージョン 2.10 以降で利用可能である。"
595
596 #. type: SH
597 #: build/C/man2/accept.2:294 build/C/man2/bind.2:222
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:225
599 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
600 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
601 #: build/C/man3/if_nametoindex.3:92 build/C/man2/listen.2:106
602 #: build/C/man2/recv.2:468 build/C/man2/recvmmsg.2:168
603 #: build/C/man2/select.2:342 build/C/man2/send.2:368
604 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
605 #: build/C/man2/socket.2:348 build/C/man2/socketcall.2:42
606 #: build/C/man2/socketpair.2:95
607 #, no-wrap
608 msgid "CONFORMING TO"
609 msgstr "準拠"
610
611 #.  The BSD man page documents five possible error returns
612 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
613 #.  POSIX.1-2001 documents errors
614 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
615 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
616 #.  In addition, SUSv2 documents EFAULT and ENOSR.
617 #. type: Plain text
618 #: build/C/man2/accept.2:306
619 msgid ""
620 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
621 "4.2BSD)."
622 msgstr ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
624 "された)."
625
626 #. type: Plain text
627 #: build/C/man2/accept.2:309
628 msgid "B<accept4>()  is a nonstandard Linux extension."
629 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
630
631 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
632 #.  do not inherit file status flags -- MTK Jun 05
633 #. type: Plain text
634 #: build/C/man2/accept.2:324
635 msgid ""
636 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
637 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
638 "socket.  This behavior differs from the canonical BSD sockets "
639 "implementation.  Portable programs should not rely on inheritance or "
640 "noninheritance of file status flags and always explicitly set all required "
641 "flags on the socket returned from B<accept>()."
642 msgstr ""
643 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
644 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
645 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
646 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
647 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
648 "である。"
649
650 #. type: SH
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:234
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:241
653 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
654 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:111
655 #: build/C/man2/recv.2:478 build/C/man2/select.2:357
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:382
657 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
658 #: build/C/man2/socket.2:362 build/C/man7/socket.7:927
659 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
660 #, no-wrap
661 msgid "NOTES"
662 msgstr "注意"
663
664 #. type: Plain text
665 #: build/C/man2/accept.2:330 build/C/man2/bind.2:240
666 #: build/C/man2/connect.2:247 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:137 build/C/man2/socket.2:368
668 #: build/C/man2/socketpair.2:124
669 msgid ""
670 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
671 "this header file is not required on Linux.  However, some historical (BSD) "
672 "implementations required this header file, and portable applications are "
673 "probably wise to include it."
674 msgstr ""
675 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
676 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
677 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
678 "ションではこのファイルを インクルードするのが賢明であろう。"
679
680 #. type: Plain text
681 #: build/C/man2/accept.2:351
682 msgid ""
683 "There may not always be a connection waiting after a B<SIGIO> is delivered "
684 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
685 "connection might have been removed by an asynchronous network error or "
686 "another thread before B<accept>()  is called.  If this happens, then the "
687 "call will block waiting for the next connection to arrive.  To ensure that "
688 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
689 "B<O_NONBLOCK> flag set (see B<socket>(7))."
690 msgstr ""
691 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
692 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
693 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
694 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
695 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
696 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
697 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
698 "見よ)。"
699
700 #. type: SS
701 #: build/C/man2/accept.2:351
702 #, no-wrap
703 msgid "The socklen_t type"
704 msgstr "socklen_t 型"
705
706 #. type: Plain text
707 #: build/C/man2/accept.2:361
708 msgid ""
709 "The third argument of B<accept>()  was originally declared as an I<int *> "
710 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
711 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
712 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
713 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
714 "Torvalds:"
715 msgstr ""
716 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
717 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
718 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
719 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
720 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
721 "た。 Linus Torvald の発言を引用する:"
722
723 #.  .I fails: only italicizes a single line
724 #. type: Plain text
725 #: build/C/man2/accept.2:378
726 msgid ""
727 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
728 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
729 "make it a size_t, and I (and hopefully others, but obviously not too many) "
730 "complained to them very loudly indeed.  Making it a size_t is completely "
731 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
732 "bit architectures, for example.  And it I<has> to be the same size as \"int"
733 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
734 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
735 "have touched it in the first place, but once they did they felt it had to "
736 "have a named type for some unfathomable reason (probably somebody didn't "
737 "like losing face over having done the original stupid thing, so they "
738 "silently just renamed their blunder).\""
739 msgstr ""
740 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
741 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
742 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
743 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
744 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
745 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
746 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
747 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
748 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
749 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
750 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
751 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
752 "う)。」"
753
754 #. type: SH
755 #: build/C/man2/accept.2:378 build/C/man2/bind.2:254
756 #: build/C/man2/connect.2:258 build/C/man3/getifaddrs.3:207
757 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:166
758 #: build/C/man2/recv.2:513 build/C/man2/recvmmsg.2:171
759 #: build/C/man2/select.2:548 build/C/man2/select_tut.2:529
760 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
761 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:381
762 #, no-wrap
763 msgid "EXAMPLE"
764 msgstr "例"
765
766 #. type: Plain text
767 #: build/C/man2/accept.2:381 build/C/man2/listen.2:169
768 msgid "See B<bind>(2)."
769 msgstr "B<bind>(2)  参照。"
770
771 #. type: SH
772 #: build/C/man2/accept.2:381 build/C/man2/bind.2:319
773 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:263
774 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
775 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
776 #: build/C/man3/if_nametoindex.3:96 build/C/man2/listen.2:169
777 #: build/C/man2/recv.2:518 build/C/man2/recvmmsg.2:266
778 #: build/C/man2/select.2:585 build/C/man2/select_tut.2:821
779 #: build/C/man2/send.2:424 build/C/man2/sendmmsg.2:236
780 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:386
781 #: build/C/man7/socket.7:958 build/C/man2/socketcall.2:53
782 #: build/C/man2/socketpair.2:124
783 #, no-wrap
784 msgid "SEE ALSO"
785 msgstr "関連項目"
786
787 #. type: Plain text
788 #: build/C/man2/accept.2:388
789 msgid ""
790 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
791 "B<socket>(7)"
792 msgstr ""
793 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
794 "B<socket>(7)"
795
796 #. type: SH
797 #: build/C/man2/accept.2:388 build/C/man2/bind.2:332
798 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:270
799 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
800 #: build/C/man2/getsockopt.2:212 build/C/man3/if_nameindex.3:154
801 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:175
802 #: build/C/man2/recv.2:529 build/C/man2/recvmmsg.2:273
803 #: build/C/man2/select.2:599 build/C/man2/select_tut.2:840
804 #: build/C/man2/send.2:439 build/C/man2/sendmmsg.2:241
805 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:415
806 #: build/C/man7/socket.7:970 build/C/man2/socketcall.2:71
807 #: build/C/man2/socketpair.2:131
808 #, no-wrap
809 msgid "COLOPHON"
810 msgstr "この文書について"
811
812 #. type: Plain text
813 #: build/C/man2/accept.2:395 build/C/man2/bind.2:339
814 #: build/C/man3/bindresvport.3:123 build/C/man2/connect.2:277
815 #: build/C/man3/getifaddrs.3:322 build/C/man2/getsockname.2:128
816 #: build/C/man2/getsockopt.2:219 build/C/man3/if_nameindex.3:161
817 #: build/C/man3/if_nametoindex.3:107 build/C/man2/listen.2:182
818 #: build/C/man2/recv.2:536 build/C/man2/recvmmsg.2:280
819 #: build/C/man2/select.2:606 build/C/man2/select_tut.2:847
820 #: build/C/man2/send.2:446 build/C/man2/sendmmsg.2:248
821 #: build/C/man3/sockatmark.3:151 build/C/man2/socket.2:422
822 #: build/C/man7/socket.7:977 build/C/man2/socketcall.2:78
823 #: build/C/man2/socketpair.2:138
824 #, fuzzy
825 #| msgid ""
826 #| "This page is part of release 3.64 of the Linux I<man-pages> project.  A "
827 #| "description of the project, and information about reporting bugs, can be "
828 #| "found at \\%http://www.kernel.org/doc/man-pages/."
829 msgid ""
830 "This page is part of release 3.65 of the Linux I<man-pages> project.  A "
831 "description of the project, and information about reporting bugs, can be "
832 "found at \\%http://www.kernel.org/doc/man-pages/."
833 msgstr ""
834 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.64 の一部\n"
835 "である。プロジェクトの説明とバグ報告に関する情報は\n"
836 "http://www.kernel.org/doc/man-pages/ に書かれている。"
837
838 #. type: TH
839 #: build/C/man2/bind.2:68
840 #, no-wrap
841 msgid "BIND"
842 msgstr "BIND"
843
844 #. type: TH
845 #: build/C/man2/bind.2:68
846 #, no-wrap
847 msgid "2007-12-28"
848 msgstr "2007-12-28"
849
850 #. type: Plain text
851 #: build/C/man2/bind.2:71
852 msgid "bind - bind a name to a socket"
853 msgstr "bind - ソケットに名前をつける"
854
855 #. type: Plain text
856 #: build/C/man2/bind.2:78
857 #, no-wrap
858 msgid ""
859 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
860 "B<         socklen_t >I<addrlen>B<);>\n"
861 msgstr ""
862 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
863 "B<         socklen_t >I<addrlen>B<);>\n"
864
865 #. type: Plain text
866 #: build/C/man2/bind.2:92
867 msgid ""
868 "When a socket is created with B<socket>(2), it exists in a name space "
869 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
870 "address specified by I<addr> to the socket referred to by the file "
871 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
872 "address structure pointed to by I<addr>.  Traditionally, this operation is "
873 "called \\(lqassigning a name to a socket\\(rq."
874 msgstr ""
875 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
876 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
877 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
878 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
879 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
880 "る。"
881
882 #. type: Plain text
883 #: build/C/man2/bind.2:99
884 msgid ""
885 "It is normally necessary to assign a local address using B<bind>()  before a "
886 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
887 msgstr ""
888 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
889 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
890 "る。"
891
892 #. type: Plain text
893 #: build/C/man2/bind.2:130
894 msgid ""
895 "The rules used in name binding vary between address families.  Consult the "
896 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
897 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
898 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
899 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
900 msgstr ""
901 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
902 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
903 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
904 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
905 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
906
907 #. type: Plain text
908 #: build/C/man2/bind.2:137
909 msgid ""
910 "The actual structure passed for the I<addr> argument will depend on the "
911 "address family.  The I<sockaddr> structure is defined as something like:"
912 msgstr ""
913 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
914 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
915
916 #. type: Plain text
917 #: build/C/man2/bind.2:144
918 #, no-wrap
919 msgid ""
920 "struct sockaddr {\n"
921 "    sa_family_t sa_family;\n"
922 "    char        sa_data[14];\n"
923 "}\n"
924 msgstr ""
925 "struct sockaddr {\n"
926 "    sa_family_t sa_family;\n"
927 "    char        sa_data[14];\n"
928 "}\n"
929
930 #. type: Plain text
931 #: build/C/man2/bind.2:152
932 msgid ""
933 "The only purpose of this structure is to cast the structure pointer passed "
934 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
935 msgstr ""
936 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
937 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
938
939 #. type: Plain text
940 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
941 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
942 #: build/C/man2/socketpair.2:74
943 msgid ""
944 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
945 "appropriately."
946 msgstr ""
947 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
948 "設定される。"
949
950 #. type: TP
951 #: build/C/man2/bind.2:158 build/C/man2/bind.2:182
952 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
953 #: build/C/man2/send.2:285 build/C/man2/socket.2:316
954 #, no-wrap
955 msgid "B<EACCES>"
956 msgstr "B<EACCES>"
957
958 #.  e.g., privileged port in AF_INET domain
959 #. type: Plain text
960 #: build/C/man2/bind.2:162
961 msgid "The address is protected, and the user is not the superuser."
962 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
963
964 #. type: TP
965 #: build/C/man2/bind.2:162 build/C/man3/bindresvport.3:82
966 #: build/C/man2/connect.2:148 build/C/man2/listen.2:88
967 #, no-wrap
968 msgid "B<EADDRINUSE>"
969 msgstr "B<EADDRINUSE>"
970
971 #. type: Plain text
972 #: build/C/man2/bind.2:165
973 msgid "The given address is already in use."
974 msgstr "指定されたアドレスが既に使用中である。"
975
976 #. type: Plain text
977 #: build/C/man2/bind.2:169
978 msgid "I<sockfd> is not a valid descriptor."
979 msgstr "I<sockfd> が不正なディスクリプタである。"
980
981 #.  This may change in the future: see
982 #.  .I linux/unix/sock.c for details.
983 #. type: Plain text
984 #: build/C/man2/bind.2:174
985 msgid "The socket is already bound to an address."
986 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
987
988 #. type: Plain text
989 #: build/C/man2/bind.2:178
990 msgid "I<sockfd> is a descriptor for a file, not a socket."
991 msgstr ""
992 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
993
994 #. type: Plain text
995 #: build/C/man2/bind.2:182
996 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
997 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
998
999 #. type: Plain text
1000 #: build/C/man2/bind.2:187
1001 msgid ""
1002 "Search permission is denied on a component of the path prefix.  (See also "
1003 "B<path_resolution>(7).)"
1004 msgstr ""
1005 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
1006 "(7)  も参照すること)。"
1007
1008 #. type: TP
1009 #: build/C/man2/bind.2:187
1010 #, no-wrap
1011 msgid "B<EADDRNOTAVAIL>"
1012 msgstr "B<EADDRNOTAVAIL>"
1013
1014 #. type: Plain text
1015 #: build/C/man2/bind.2:191
1016 msgid ""
1017 "A nonexistent interface was requested or the requested address was not local."
1018 msgstr ""
1019 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1020 "かった。"
1021
1022 #. type: Plain text
1023 #: build/C/man2/bind.2:195
1024 msgid "I<addr> points outside the user's accessible address space."
1025 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1026
1027 #. type: Plain text
1028 #: build/C/man2/bind.2:202
1029 msgid ""
1030 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1031 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1032
1033 #. type: TP
1034 #: build/C/man2/bind.2:202
1035 #, no-wrap
1036 msgid "B<ELOOP>"
1037 msgstr "B<ELOOP>"
1038
1039 #. type: Plain text
1040 #: build/C/man2/bind.2:206
1041 msgid "Too many symbolic links were encountered in resolving I<addr>."
1042 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1043
1044 #. type: TP
1045 #: build/C/man2/bind.2:206
1046 #, no-wrap
1047 msgid "B<ENAMETOOLONG>"
1048 msgstr "B<ENAMETOOLONG>"
1049
1050 #. type: Plain text
1051 #: build/C/man2/bind.2:210
1052 msgid "I<addr> is too long."
1053 msgstr "I<addr> が長過ぎる。"
1054
1055 #. type: TP
1056 #: build/C/man2/bind.2:210
1057 #, no-wrap
1058 msgid "B<ENOENT>"
1059 msgstr "B<ENOENT>"
1060
1061 #. type: Plain text
1062 #: build/C/man2/bind.2:213
1063 msgid "The file does not exist."
1064 msgstr "ファイルが存在しない。"
1065
1066 #. type: TP
1067 #: build/C/man2/bind.2:213 build/C/man2/recv.2:452 build/C/man2/select.2:333
1068 #: build/C/man2/send.2:343
1069 #, no-wrap
1070 msgid "B<ENOMEM>"
1071 msgstr "B<ENOMEM>"
1072
1073 #. type: Plain text
1074 #: build/C/man2/bind.2:216
1075 msgid "Insufficient kernel memory was available."
1076 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1077
1078 #. type: TP
1079 #: build/C/man2/bind.2:216
1080 #, no-wrap
1081 msgid "B<ENOTDIR>"
1082 msgstr "B<ENOTDIR>"
1083
1084 #. type: Plain text
1085 #: build/C/man2/bind.2:219
1086 msgid "A component of the path prefix is not a directory."
1087 msgstr "パス名の構成要素がディレクトリではない。"
1088
1089 #. type: TP
1090 #: build/C/man2/bind.2:219
1091 #, no-wrap
1092 msgid "B<EROFS>"
1093 msgstr "B<EROFS>"
1094
1095 #. type: Plain text
1096 #: build/C/man2/bind.2:222
1097 msgid "The socket inode would reside on a read-only filesystem."
1098 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1099
1100 #.  SVr4 documents an additional
1101 #.  .B ENOSR
1102 #.  general error condition, and
1103 #.  additional
1104 #.  .B EIO
1105 #.  and
1106 #.  .B EISDIR
1107 #.  UNIX-domain error conditions.
1108 #. type: Plain text
1109 #: build/C/man2/bind.2:234
1110 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1111 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1112
1113 #. type: Plain text
1114 #: build/C/man2/bind.2:251
1115 msgid ""
1116 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1117 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1118 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1119 msgstr ""
1120 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1121 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1122 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1123
1124 #. type: SH
1125 #: build/C/man2/bind.2:251 build/C/man2/getsockopt.2:199
1126 #: build/C/man2/select.2:485 build/C/man2/send.2:414
1127 #: build/C/man3/sockatmark.3:100 build/C/man7/socket.7:945
1128 #, no-wrap
1129 msgid "BUGS"
1130 msgstr "バグ"
1131
1132 #.  FIXME What *are* transparent proxy options?
1133 #. type: Plain text
1134 #: build/C/man2/bind.2:254
1135 msgid "The transparent proxy options are not described."
1136 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1137
1138 #. type: Plain text
1139 #: build/C/man2/bind.2:259
1140 msgid ""
1141 "An example of the use of B<bind>()  with Internet domain sockets can be "
1142 "found in B<getaddrinfo>(3)."
1143 msgstr ""
1144 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1145 "(3)  に記載されている。"
1146
1147 #.  listen.7 refers to this example.
1148 #.  accept.7 refers to this example.
1149 #.  unix.7 refers to this example.
1150 #. type: Plain text
1151 #: build/C/man2/bind.2:266
1152 msgid ""
1153 "The following example shows how to bind a stream socket in the UNIX "
1154 "(B<AF_UNIX>)  domain, and accept connections:"
1155 msgstr ""
1156 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1157 "を示したものである。"
1158
1159 #. type: Plain text
1160 #: build/C/man2/bind.2:273
1161 #, no-wrap
1162 msgid ""
1163 "#include E<lt>sys/socket.hE<gt>\n"
1164 "#include E<lt>sys/un.hE<gt>\n"
1165 "#include E<lt>stdlib.hE<gt>\n"
1166 "#include E<lt>stdio.hE<gt>\n"
1167 "#include E<lt>string.hE<gt>\n"
1168 msgstr ""
1169 "#include E<lt>sys/socket.hE<gt>\n"
1170 "#include E<lt>sys/un.hE<gt>\n"
1171 "#include E<lt>stdlib.hE<gt>\n"
1172 "#include E<lt>stdio.hE<gt>\n"
1173 "#include E<lt>string.hE<gt>\n"
1174
1175 #. type: Plain text
1176 #: build/C/man2/bind.2:276
1177 #, no-wrap
1178 msgid ""
1179 "#define MY_SOCK_PATH \"/somepath\"\n"
1180 "#define LISTEN_BACKLOG 50\n"
1181 msgstr ""
1182 "#define MY_SOCK_PATH \"/somepath\"\n"
1183 "#define LISTEN_BACKLOG 50\n"
1184
1185 #. type: Plain text
1186 #: build/C/man2/bind.2:279
1187 #, no-wrap
1188 msgid ""
1189 "#define handle_error(msg) \\e\n"
1190 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1191 msgstr ""
1192 "#define handle_error(msg) \\e\n"
1193 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1194
1195 #. type: Plain text
1196 #: build/C/man2/bind.2:286
1197 #, no-wrap
1198 msgid ""
1199 "int\n"
1200 "main(int argc, char *argv[])\n"
1201 "{\n"
1202 "    int sfd, cfd;\n"
1203 "    struct sockaddr_un my_addr, peer_addr;\n"
1204 "    socklen_t peer_addr_size;\n"
1205 msgstr ""
1206 "int\n"
1207 "main(int argc, char *argv[])\n"
1208 "{\n"
1209 "    int sfd, cfd;\n"
1210 "    struct sockaddr_un my_addr, peer_addr;\n"
1211 "    socklen_t peer_addr_size;\n"
1212
1213 #. type: Plain text
1214 #: build/C/man2/bind.2:290
1215 #, no-wrap
1216 msgid ""
1217 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1218 "    if (sfd == -1)\n"
1219 "        handle_error(\"socket\");\n"
1220 msgstr ""
1221 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1222 "    if (sfd == -1)\n"
1223 "        handle_error(\"socket\");\n"
1224
1225 #. type: Plain text
1226 #: build/C/man2/bind.2:296
1227 #, no-wrap
1228 msgid ""
1229 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1230 "                        /* Clear structure */\n"
1231 "    my_addr.sun_family = AF_UNIX;\n"
1232 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1233 "            sizeof(my_addr.sun_path) - 1);\n"
1234 msgstr ""
1235 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1236 "                        /* Clear structure */\n"
1237 "    my_addr.sun_family = AF_UNIX;\n"
1238 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1239 "            sizeof(my_addr.sun_path) - 1);\n"
1240
1241 #. type: Plain text
1242 #: build/C/man2/bind.2:300
1243 #, no-wrap
1244 msgid ""
1245 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1246 "            sizeof(struct sockaddr_un)) == -1)\n"
1247 "        handle_error(\"bind\");\n"
1248 msgstr ""
1249 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1250 "            sizeof(struct sockaddr_un)) == -1)\n"
1251 "        handle_error(\"bind\");\n"
1252
1253 #. type: Plain text
1254 #: build/C/man2/bind.2:303
1255 #, no-wrap
1256 msgid ""
1257 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1258 "        handle_error(\"listen\");\n"
1259 msgstr ""
1260 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1261 "        handle_error(\"listen\");\n"
1262
1263 #. type: Plain text
1264 #: build/C/man2/bind.2:306
1265 #, no-wrap
1266 msgid ""
1267 "    /* Now we can accept incoming connections one\n"
1268 "       at a time using accept(2) */\n"
1269 msgstr ""
1270 "    /* Now we can accept incoming connections one\n"
1271 "       at a time using accept(2) */\n"
1272
1273 #. type: Plain text
1274 #: build/C/man2/bind.2:312
1275 #, no-wrap
1276 msgid ""
1277 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1278 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1279 "                 &peer_addr_size);\n"
1280 "    if (cfd == -1)\n"
1281 "        handle_error(\"accept\");\n"
1282 msgstr ""
1283 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1284 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1285 "                 &peer_addr_size)\n"
1286 "    if (cfd == -1)\n"
1287 "        handle_error(\"accept\");\n"
1288
1289 #. type: Plain text
1290 #: build/C/man2/bind.2:314
1291 #, no-wrap
1292 msgid "    /* Code to deal with incoming connection(s)... */\n"
1293 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1294
1295 #. type: Plain text
1296 #: build/C/man2/bind.2:318
1297 #, no-wrap
1298 msgid ""
1299 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1300 "       should be deleted using unlink(2) or remove(3) */\n"
1301 "}\n"
1302 msgstr ""
1303 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1304 "       should be deleted using unlink(2) or remove(3) */\n"
1305 "}\n"
1306
1307 #. type: Plain text
1308 #: build/C/man2/bind.2:332
1309 msgid ""
1310 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1311 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1312 "(7), B<socket>(7), B<unix>(7)"
1313 msgstr ""
1314 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1315 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1316 "(7), B<socket>(7), B<unix>(7)"
1317
1318 #. type: TH
1319 #: build/C/man3/bindresvport.3:30
1320 #, no-wrap
1321 msgid "BINDRESVPORT"
1322 msgstr "BINDRESVPORT"
1323
1324 #. type: TH
1325 #: build/C/man3/bindresvport.3:30
1326 #, no-wrap
1327 msgid "2013-06-21"
1328 msgstr "2013-06-21"
1329
1330 #. type: Plain text
1331 #: build/C/man3/bindresvport.3:33
1332 msgid "bindresvport - bind a socket to a privileged IP port"
1333 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1334
1335 #. type: Plain text
1336 #: build/C/man3/bindresvport.3:37
1337 #, no-wrap
1338 msgid ""
1339 "B<#include E<lt>sys/types.hE<gt>>\n"
1340 "B<#include E<lt>netinet/in.hE<gt>>\n"
1341 msgstr ""
1342 "B<#include E<lt>sys/types.hE<gt>>\n"
1343 "B<#include E<lt>netinet/in.hE<gt>>\n"
1344
1345 #. type: Plain text
1346 #: build/C/man3/bindresvport.3:39
1347 #, no-wrap
1348 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1349 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1350
1351 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1352 #. type: Plain text
1353 #: build/C/man3/bindresvport.3:46
1354 msgid ""
1355 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1356 "anonymous IP port, that is, a port number arbitrarily selected from the "
1357 "range 512 to 1023."
1358 msgstr ""
1359 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1360 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1361 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1362
1363 #. type: Plain text
1364 #: build/C/man3/bindresvport.3:56
1365 msgid ""
1366 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1367 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1368 "allocated."
1369 msgstr ""
1370 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1371 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1372 "される。"
1373
1374 #. type: Plain text
1375 #: build/C/man3/bindresvport.3:67
1376 msgid ""
1377 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1378 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1379 "return the port number actually allocated.  (This information can later be "
1380 "obtained using B<getsockname>(2).)"
1381 msgstr ""
1382 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1383 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1384 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1385 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1386
1387 #. type: Plain text
1388 #: build/C/man3/bindresvport.3:72
1389 msgid ""
1390 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1391 "I<errno> set to indicate the cause of the error."
1392 msgstr ""
1393 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1394 "I<errno> にエラーの原因を示す値を設定する。"
1395
1396 #. type: Plain text
1397 #: build/C/man3/bindresvport.3:77
1398 msgid ""
1399 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1400 "addition, the following errors may occur:"
1401 msgstr ""
1402 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1403 "以下のエラーが発生することがある:"
1404
1405 #. type: Plain text
1406 #: build/C/man3/bindresvport.3:82
1407 msgid ""
1408 "The caller did not have superuser privilege (to be precise: the "
1409 "B<CAP_NET_BIND_SERVICE> capability is required)."
1410 msgstr ""
1411 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1412 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1413
1414 #. type: Plain text
1415 #: build/C/man3/bindresvport.3:85
1416 msgid "All privileged ports are in use."
1417 msgstr "全ての特権ポートが使用中である。"
1418
1419 #. type: TP
1420 #: build/C/man3/bindresvport.3:85
1421 #, no-wrap
1422 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1423 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1424
1425 #. type: Plain text
1426 #: build/C/man3/bindresvport.3:92
1427 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1428 msgstr ""
1429 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1430
1431 #. type: SH
1432 #: build/C/man3/bindresvport.3:92 build/C/man3/if_nametoindex.3:85
1433 #: build/C/man3/sockatmark.3:73
1434 #, no-wrap
1435 msgid "ATTRIBUTES"
1436 msgstr "属性"
1437
1438 #. type: SS
1439 #: build/C/man3/bindresvport.3:93 build/C/man3/if_nametoindex.3:86
1440 #: build/C/man3/sockatmark.3:74
1441 #, no-wrap
1442 msgid "Multithreading (see pthreads(7))"
1443 msgstr "マルチスレッディング (pthreads(7) 参照)"
1444
1445 #. type: Plain text
1446 #: build/C/man3/bindresvport.3:98
1447 msgid ""
1448 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1449 "that is not protected, so it is not thread-safe."
1450 msgstr ""
1451 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1452 "静的変数を使用しているため、スレッドセーフではない。"
1453
1454 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1455 #. type: Plain text
1456 #: build/C/man3/bindresvport.3:104
1457 msgid ""
1458 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1459 "static variable, so it is thread-safe."
1460 msgstr ""
1461 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1462 "ており、スレッドセーフである。"
1463
1464 #. type: Plain text
1465 #: build/C/man3/bindresvport.3:107
1466 msgid ""
1467 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1468 msgstr ""
1469 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1470
1471 #. type: Plain text
1472 #: build/C/man3/bindresvport.3:113
1473 msgid ""
1474 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1475 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1476 msgstr ""
1477 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1478 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1479
1480 #. type: Plain text
1481 #: build/C/man3/bindresvport.3:116
1482 msgid "B<bind>(2), B<getsockname>(2)"
1483 msgstr "B<bind>(2), B<getsockname>(2)"
1484
1485 #. type: TH
1486 #: build/C/man2/connect.2:67
1487 #, no-wrap
1488 msgid "CONNECT"
1489 msgstr "CONNECT"
1490
1491 #. type: TH
1492 #: build/C/man2/connect.2:67 build/C/man2/getsockname.2:40
1493 #, no-wrap
1494 msgid "2008-12-03"
1495 msgstr "2008-12-03"
1496
1497 #. type: Plain text
1498 #: build/C/man2/connect.2:70
1499 msgid "connect - initiate a connection on a socket"
1500 msgstr "connect - ソケットの接続を行う"
1501
1502 #. type: Plain text
1503 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1504 #: build/C/man2/listen.2:51
1505 #, no-wrap
1506 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1507 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1508
1509 #. type: Plain text
1510 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1511 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1512 #: build/C/man2/recv.2:51
1513 #, no-wrap
1514 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1515 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1516
1517 #. type: Plain text
1518 #: build/C/man2/connect.2:78
1519 #, no-wrap
1520 msgid ""
1521 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1522 "B<            socklen_t >I<addrlen>B<);>\n"
1523 msgstr ""
1524 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1525 "B<            socklen_t >I<addrlen>B<);>\n"
1526
1527 #. type: Plain text
1528 #: build/C/man2/connect.2:97
1529 msgid ""
1530 "The B<connect>()  system call connects the socket referred to by the file "
1531 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1532 "argument specifies the size of I<addr>.  The format of the address in "
1533 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1534 "B<socket>(2)  for further details."
1535 msgstr ""
1536 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1537 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1538 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1539 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1540 "こと。"
1541
1542 #. type: Plain text
1543 #: build/C/man2/connect.2:113
1544 msgid ""
1545 "If the socket I<sockfd> is of type B<SOCK_DGRAM>, then I<addr> is the "
1546 "address to which datagrams are sent by default, and the only address from "
1547 "which datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1548 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1549 "that is bound to the address specified by I<addr>."
1550 msgstr ""
1551 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1552 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1553 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1554 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1555 "に対する接続の 作成を試みる。"
1556
1557 #. type: Plain text
1558 #: build/C/man2/connect.2:127
1559 msgid ""
1560 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1561 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1562 "times to change their association.  Connectionless sockets may dissolve the "
1563 "association by connecting to an address with the I<sa_family> member of "
1564 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1565 msgstr ""
1566 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1567 "()  が成功する。 コネクションレス (connectionless) プロトコルでは対応を変更す"
1568 "るために何度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1569 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1570 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1571
1572 #. type: Plain text
1573 #: build/C/man2/connect.2:132
1574 msgid ""
1575 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1576 "returned, and I<errno> is set appropriately."
1577 msgstr ""
1578 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1579 "適切な値を設定する。"
1580
1581 #. type: Plain text
1582 #: build/C/man2/connect.2:135
1583 msgid ""
1584 "The following are general socket errors only.  There may be other domain-"
1585 "specific error codes."
1586 msgstr ""
1587 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1588 "する可能性がある。"
1589
1590 #. type: Plain text
1591 #: build/C/man2/connect.2:143
1592 msgid ""
1593 "For UNIX domain sockets, which are identified by pathname: Write permission "
1594 "is denied on the socket file, or search permission is denied for one of the "
1595 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1596 msgstr ""
1597 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1598 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1599 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1600
1601 #. type: TP
1602 #: build/C/man2/connect.2:143
1603 #, no-wrap
1604 msgid "B<EACCES>, B<EPERM>"
1605 msgstr "B<EACCES>, B<EPERM>"
1606
1607 #. type: Plain text
1608 #: build/C/man2/connect.2:148
1609 msgid ""
1610 "The user tried to connect to a broadcast address without having the socket "
1611 "broadcast flag enabled or the connection request failed because of a local "
1612 "firewall rule."
1613 msgstr ""
1614 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1615 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1616 "要求が失敗した。"
1617
1618 #. type: Plain text
1619 #: build/C/man2/connect.2:151
1620 msgid "Local address is already in use."
1621 msgstr "ローカルアドレスが既に使用されている。"
1622
1623 #. type: TP
1624 #: build/C/man2/connect.2:151 build/C/man2/socket.2:320
1625 #: build/C/man2/socketpair.2:75
1626 #, no-wrap
1627 msgid "B<EAFNOSUPPORT>"
1628 msgstr "B<EAFNOSUPPORT>"
1629
1630 #. type: Plain text
1631 #: build/C/man2/connect.2:156
1632 msgid ""
1633 "The passed address didn't have the correct address family in its "
1634 "I<sa_family> field."
1635 msgstr ""
1636 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1637 "い。"
1638
1639 #. type: TP
1640 #: build/C/man2/connect.2:156
1641 #, no-wrap
1642 msgid "B<EAGAIN>"
1643 msgstr "B<EAGAIN>"
1644
1645 #. type: Plain text
1646 #: build/C/man2/connect.2:165
1647 msgid ""
1648 "No more free local ports or insufficient entries in the routing cache.  For "
1649 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1650 "B<ip>(7)  for information on how to increase the number of local ports."
1651 msgstr ""
1652 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1653 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1654 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1655
1656 #. type: TP
1657 #: build/C/man2/connect.2:165
1658 #, no-wrap
1659 msgid "B<EALREADY>"
1660 msgstr "B<EALREADY>"
1661
1662 #. type: Plain text
1663 #: build/C/man2/connect.2:169
1664 msgid ""
1665 "The socket is nonblocking and a previous connection attempt has not yet been "
1666 "completed."
1667 msgstr ""
1668 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1669
1670 #. type: Plain text
1671 #: build/C/man2/connect.2:172
1672 msgid "The file descriptor is not a valid index in the descriptor table."
1673 msgstr ""
1674 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1675 "い。"
1676
1677 #. type: TP
1678 #: build/C/man2/connect.2:172 build/C/man2/recv.2:435
1679 #, no-wrap
1680 msgid "B<ECONNREFUSED>"
1681 msgstr "B<ECONNREFUSED>"
1682
1683 #. type: Plain text
1684 #: build/C/man2/connect.2:175
1685 msgid "No-one listening on the remote address."
1686 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1687
1688 #. type: Plain text
1689 #: build/C/man2/connect.2:178
1690 msgid "The socket structure address is outside the user's address space."
1691 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1692
1693 #. type: TP
1694 #: build/C/man2/connect.2:178
1695 #, no-wrap
1696 msgid "B<EINPROGRESS>"
1697 msgstr "B<EINPROGRESS>"
1698
1699 #. type: Plain text
1700 #: build/C/man2/connect.2:203
1701 msgid ""
1702 "The socket is nonblocking and the connection cannot be completed "
1703 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1704 "by selecting the socket for writing.  After B<select>(2)  indicates "
1705 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1706 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1707 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1708 "error codes listed here, explaining the reason for the failure)."
1709 msgstr ""
1710 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1711 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1712 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1713 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1714 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1715 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1716 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1717 "の原因が分かる。"
1718
1719 #.  For TCP, the connection will complete asynchronously.
1720 #.  See http://lkml.org/lkml/2005/7/12/254
1721 #. type: Plain text
1722 #: build/C/man2/connect.2:209
1723 msgid ""
1724 "The system call was interrupted by a signal that was caught; see B<signal>"
1725 "(7)."
1726 msgstr ""
1727 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1728
1729 #. type: TP
1730 #: build/C/man2/connect.2:209 build/C/man2/send.2:323
1731 #, no-wrap
1732 msgid "B<EISCONN>"
1733 msgstr "B<EISCONN>"
1734
1735 #. type: Plain text
1736 #: build/C/man2/connect.2:212
1737 msgid "The socket is already connected."
1738 msgstr "ソケットは既に接続 (connect) されている。"
1739
1740 #. type: TP
1741 #: build/C/man2/connect.2:212
1742 #, no-wrap
1743 msgid "B<ENETUNREACH>"
1744 msgstr "B<ENETUNREACH>"
1745
1746 #. type: Plain text
1747 #: build/C/man2/connect.2:215
1748 msgid "Network is unreachable."
1749 msgstr "到達できないネットワークである。"
1750
1751 #. type: Plain text
1752 #: build/C/man2/connect.2:218
1753 msgid "The file descriptor is not associated with a socket."
1754 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1755
1756 #. type: TP
1757 #: build/C/man2/connect.2:218
1758 #, no-wrap
1759 msgid "B<ETIMEDOUT>"
1760 msgstr "B<ETIMEDOUT>"
1761
1762 #. type: Plain text
1763 #: build/C/man2/connect.2:225
1764 msgid ""
1765 "Timeout while attempting connection.  The server may be too busy to accept "
1766 "new connections.  Note that for IP sockets the timeout may be very long when "
1767 "syncookies are enabled on the server."
1768 msgstr ""
1769 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1770 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1771 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1772 "ること。"
1773
1774 #.  SVr4 documents the additional
1775 #.  general error codes
1776 #.  .BR EADDRNOTAVAIL ,
1777 #.  .BR EINVAL ,
1778 #.  .BR EAFNOSUPPORT ,
1779 #.  .BR EALREADY ,
1780 #.  .BR EINTR ,
1781 #.  .BR EPROTOTYPE ,
1782 #.  and
1783 #.  .BR ENOSR .
1784 #.  It also
1785 #.  documents many additional error conditions not described here.
1786 #. type: Plain text
1787 #: build/C/man2/connect.2:241
1788 msgid ""
1789 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1790 "POSIX.1-2001."
1791 msgstr ""
1792 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1793
1794 #. type: Plain text
1795 #: build/C/man2/connect.2:258
1796 msgid ""
1797 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1798 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1799 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1800 msgstr ""
1801 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1802 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1803 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1804
1805 #. type: Plain text
1806 #: build/C/man2/connect.2:263
1807 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1808 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1809
1810 #. type: Plain text
1811 #: build/C/man2/connect.2:270
1812 msgid ""
1813 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1814 "B<path_resolution>(7)"
1815 msgstr ""
1816 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1817 "B<path_resolution>(7)"
1818
1819 #. type: TH
1820 #: build/C/man3/getifaddrs.3:36
1821 #, no-wrap
1822 msgid "GETIFADDRS"
1823 msgstr "GETIFADDRS"
1824
1825 #. type: TH
1826 #: build/C/man3/getifaddrs.3:36
1827 #, no-wrap
1828 msgid "2014-02-26"
1829 msgstr "2014-02-26"
1830
1831 #. type: TH
1832 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1833 #: build/C/man3/if_nametoindex.3:25
1834 #, no-wrap
1835 msgid "GNU"
1836 msgstr "GNU"
1837
1838 #. type: Plain text
1839 #: build/C/man3/getifaddrs.3:39
1840 msgid "getifaddrs, freeifaddrs - get interface addresses"
1841 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1842
1843 #. type: Plain text
1844 #: build/C/man3/getifaddrs.3:43
1845 #, no-wrap
1846 msgid ""
1847 "B<#include E<lt>sys/types.hE<gt>>\n"
1848 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1849 msgstr ""
1850 "B<#include E<lt>sys/types.hE<gt>>\n"
1851 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1852
1853 #. type: Plain text
1854 #: build/C/man3/getifaddrs.3:45
1855 #, no-wrap
1856 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1857 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1858
1859 #. type: Plain text
1860 #: build/C/man3/getifaddrs.3:47
1861 #, no-wrap
1862 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1863 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1864
1865 #. type: Plain text
1866 #: build/C/man3/getifaddrs.3:58
1867 msgid ""
1868 "The B<getifaddrs>()  function creates a linked list of structures describing "
1869 "the network interfaces of the local system, and stores the address of the "
1870 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1871 "structures, defined as follows:"
1872 msgstr ""
1873 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1874 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1875 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1876 "うに定義されている。"
1877
1878 #. type: Plain text
1879 #: build/C/man3/getifaddrs.3:77
1880 #, no-wrap
1881 msgid ""
1882 "struct ifaddrs {\n"
1883 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1884 "    char            *ifa_name;    /* Name of interface */\n"
1885 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1886 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1887 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1888 "    union {\n"
1889 "        struct sockaddr *ifu_broadaddr;\n"
1890 "                         /* Broadcast address of interface */\n"
1891 "        struct sockaddr *ifu_dstaddr;\n"
1892 "                         /* Point-to-point destination address */\n"
1893 "    } ifa_ifu;\n"
1894 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1895 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1896 "    void            *ifa_data;    /* Address-specific data */\n"
1897 "};\n"
1898 msgstr ""
1899 "struct ifaddrs {\n"
1900 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1901 "    char            *ifa_name;    /* Name of interface */\n"
1902 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1903 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1904 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1905 "    union {\n"
1906 "        struct sockaddr *ifu_broadaddr;\n"
1907 "                         /* Broadcast address of interface */\n"
1908 "        struct sockaddr *ifu_dstaddr;\n"
1909 "                         /* Point-to-point destination address */\n"
1910 "    } ifa_ifu;\n"
1911 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1912 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1913 "    void            *ifa_data;    /* Address-specific data */\n"
1914 "};\n"
1915
1916 #. type: Plain text
1917 #: build/C/man3/getifaddrs.3:84
1918 msgid ""
1919 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1920 "or NULL if this is the last item of the list."
1921 msgstr ""
1922 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1923 "素がリストの最後の場合には NULL が入る。"
1924
1925 #.  The constant
1926 #.  .B IF NAMESIZE
1927 #.  indicates the maximum length of this field.
1928 #. type: Plain text
1929 #: build/C/man3/getifaddrs.3:91
1930 msgid "The I<ifa_name> points to the null-terminated interface name."
1931 msgstr "I<ifa_name> は NULL 終端されたインターフェース名を指す。"
1932
1933 #. type: Plain text
1934 #: build/C/man3/getifaddrs.3:100
1935 msgid ""
1936 "The I<ifa_flags> field contains the interface flags, as returned by the "
1937 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1938 "these flags)."
1939 msgstr ""
1940 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1941 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1942 "B<netdevice>(7) を参照)。"
1943
1944 #. type: Plain text
1945 #: build/C/man3/getifaddrs.3:109
1946 msgid ""
1947 "The I<ifa_addr> field points to a structure containing the interface "
1948 "address.  (The I<sa_family> subfield should be consulted to determine the "
1949 "format of the address structure.)  This field may contain a null pointer."
1950 msgstr ""
1951 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
1952 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
1953 "すべきである)。 このフィールドは NULL ポインタとなる場合がある。"
1954
1955 #. type: Plain text
1956 #: build/C/man3/getifaddrs.3:116
1957 msgid ""
1958 "The I<ifa_netmask> field points to a structure containing the netmask "
1959 "associated with I<ifa_addr>, if applicable for the address family.  This "
1960 "field may contain a null pointer."
1961 msgstr ""
1962 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
1963 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
1964 "る。 このフィールドは NULL ポインタとなる場合がある。"
1965
1966 #. type: Plain text
1967 #: build/C/man3/getifaddrs.3:131
1968 msgid ""
1969 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1970 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1971 "will contain the broadcast address associated with I<ifa_addr> (if "
1972 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1973 "destination address of the point-to-point interface."
1974 msgstr ""
1975 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
1976 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
1977 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
1978 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
1979 "point インターフェースの宛先アドレスが入るかが決まる。"
1980
1981 #. type: Plain text
1982 #: build/C/man3/getifaddrs.3:136
1983 msgid ""
1984 "The I<ifa_data> field points to a buffer containing address-family-specific "
1985 "data; this field may be NULL if there is no such data for this interface."
1986 msgstr ""
1987 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
1988 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
1989 "フィールドは NULL となる。"
1990
1991 #. type: Plain text
1992 #: build/C/man3/getifaddrs.3:142
1993 msgid ""
1994 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1995 "freed using B<freeifaddrs>()  when no longer needed."
1996 msgstr ""
1997 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
1998 "B<freeifaddrs>() を使って解放すべきである。"
1999
2000 #. type: Plain text
2001 #: build/C/man3/getifaddrs.3:149
2002 msgid ""
2003 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2004 "I<errno> is set appropriately."
2005 msgstr ""
2006 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2007 "が適切に設定される。"
2008
2009 #. type: Plain text
2010 #: build/C/man3/getifaddrs.3:162
2011 msgid ""
2012 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2013 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
2014 "(2), B<malloc>(3), or B<realloc>(3)."
2015 msgstr ""
2016 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には B<socket>"
2017 "(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>"
2018 "(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定される。"
2019
2020 #. type: Plain text
2021 #: build/C/man3/getifaddrs.3:170
2022 msgid ""
2023 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2024 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2025 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2026 "available only on kernels that support netlink."
2027 msgstr ""
2028 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2029 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2030 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2031 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2032
2033 #.  , but the BSD-derived documentation generally
2034 #.  appears to be confused and obsolete on this point.
2035 #.  i.e., commonly it still says one of them will be NULL, even if
2036 #.  the ifa_ifu union is already present
2037 #. type: Plain text
2038 #: build/C/man3/getifaddrs.3:190
2039 msgid ""
2040 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2041 "the BSD systems, but with slightly different semantics documented"
2042 "\\(emreturning one entry per interface, not per address.  This means "
2043 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2044 "address, and no link-level address is returned if the interface has an IP "
2045 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2046 "I<ifa_dstaddr> differs on various systems."
2047 msgstr ""
2048 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2049 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2050 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2051 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2052 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2053 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2054 "どちらを選択するかを決める方法は、 システムにより異なる。"
2055
2056 #. type: Plain text
2057 #: build/C/man3/getifaddrs.3:207
2058 msgid ""
2059 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2060 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2061 "containing lower-level details about the interface and its physical layer.  "
2062 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2063 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2064 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2065 "hE<gt>>), which contains various interface attributes and statistics."
2066 msgstr ""
2067 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2068 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2069 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2070 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2071 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2072 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2073 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2074 "インターフェースの様々な属性や統計情報が入る。"
2075
2076 #. type: Plain text
2077 #: build/C/man3/getifaddrs.3:214
2078 msgid ""
2079 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2080 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2081 "system:"
2082 msgstr ""
2083 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2084 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2085
2086 #. type: Plain text
2087 #: build/C/man3/getifaddrs.3:235
2088 #, no-wrap
2089 msgid ""
2090 "$ B<./a.out>\n"
2091 "lo       AF_PACKET (17)\n"
2092 "                tx_packets =        524; rx_packets =        524\n"
2093 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2094 "wlp3s0   AF_PACKET (17)\n"
2095 "                tx_packets =     108391; rx_packets =     130245\n"
2096 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2097 "em1      AF_PACKET (17)\n"
2098 "                tx_packets =          0; rx_packets =          0\n"
2099 "                tx_bytes   =          0; rx_bytes   =          0\n"
2100 "lo       AF_INET (2)\n"
2101 "                address: E<lt>127.0.0.1E<gt>\n"
2102 "wlp3s0   AF_INET (2)\n"
2103 "                address: E<lt>192.168.235.137E<gt>\n"
2104 "lo       AF_INET6 (10)\n"
2105 "                address: E<lt>::1E<gt>\n"
2106 "wlp3s0   AF_INET6 (10)\n"
2107 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2108 msgstr ""
2109 "$ B<./a.out>\n"
2110 "lo       AF_PACKET (17)\n"
2111 "                tx_packets =        524; rx_packets =        524\n"
2112 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2113 "wlp3s0   AF_PACKET (17)\n"
2114 "                tx_packets =     108391; rx_packets =     130245\n"
2115 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2116 "em1      AF_PACKET (17)\n"
2117 "                tx_packets =          0; rx_packets =          0\n"
2118 "                tx_bytes   =          0; rx_bytes   =          0\n"
2119 "lo       AF_INET (2)\n"
2120 "                address: E<lt>127.0.0.1E<gt>\n"
2121 "wlp3s0   AF_INET (2)\n"
2122 "                address: E<lt>192.168.235.137E<gt>\n"
2123 "lo       AF_INET6 (10)\n"
2124 "                address: E<lt>::1E<gt>\n"
2125 "wlp3s0   AF_INET6 (10)\n"
2126 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2127
2128 #. type: SS
2129 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2130 #: build/C/man2/recvmmsg.2:204
2131 #, no-wrap
2132 msgid "Program source"
2133 msgstr "プログラムのソース"
2134
2135 #. type: Plain text
2136 #: build/C/man3/getifaddrs.3:249
2137 #, no-wrap
2138 msgid ""
2139 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2140 "#include E<lt>arpa/inet.hE<gt>\n"
2141 "#include E<lt>sys/socket.hE<gt>\n"
2142 "#include E<lt>netdb.hE<gt>\n"
2143 "#include E<lt>ifaddrs.hE<gt>\n"
2144 "#include E<lt>stdio.hE<gt>\n"
2145 "#include E<lt>stdlib.hE<gt>\n"
2146 "#include E<lt>unistd.hE<gt>\n"
2147 "#include E<lt>linux/if_link.hE<gt>\n"
2148 msgstr ""
2149 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2150 "#include E<lt>arpa/inet.hE<gt>\n"
2151 "#include E<lt>sys/socket.hE<gt>\n"
2152 "#include E<lt>netdb.hE<gt>\n"
2153 "#include E<lt>ifaddrs.hE<gt>\n"
2154 "#include E<lt>stdio.hE<gt>\n"
2155 "#include E<lt>stdlib.hE<gt>\n"
2156 "#include E<lt>unistd.hE<gt>\n"
2157 "#include E<lt>linux/if_link.hE<gt>\n"
2158
2159 #. type: Plain text
2160 #: build/C/man3/getifaddrs.3:255
2161 #, no-wrap
2162 msgid ""
2163 "int main(int argc, char *argv[])\n"
2164 "{\n"
2165 "    struct ifaddrs *ifaddr, *ifa;\n"
2166 "    int family, s, n;\n"
2167 "    char host[NI_MAXHOST];\n"
2168 msgstr ""
2169 "int main(int argc, char *argv[])\n"
2170 "{\n"
2171 "    struct ifaddrs *ifaddr, *ifa;\n"
2172 "    int family, s, n;\n"
2173 "    char host[NI_MAXHOST];\n"
2174
2175 #. type: Plain text
2176 #: build/C/man3/getifaddrs.3:260
2177 #, no-wrap
2178 msgid ""
2179 "    if (getifaddrs(&ifaddr) == -1) {\n"
2180 "        perror(\"getifaddrs\");\n"
2181 "        exit(EXIT_FAILURE);\n"
2182 "    }\n"
2183 msgstr ""
2184 "    if (getifaddrs(&ifaddr) == -1) {\n"
2185 "        perror(\"getifaddrs\");\n"
2186 "        exit(EXIT_FAILURE);\n"
2187 "    }\n"
2188
2189 #. type: Plain text
2190 #: build/C/man3/getifaddrs.3:263
2191 #, no-wrap
2192 msgid ""
2193 "    /* Walk through linked list, maintaining head pointer so we\n"
2194 "       can free list later */\n"
2195 msgstr ""
2196 "    /* Walk through linked list, maintaining head pointer so we\n"
2197 "       can free list later */\n"
2198
2199 #. type: Plain text
2200 #: build/C/man3/getifaddrs.3:267
2201 #, no-wrap
2202 msgid ""
2203 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2204 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2205 "            continue;\n"
2206 msgstr ""
2207 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2208 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2209 "            continue;\n"
2210
2211 #. type: Plain text
2212 #: build/C/man3/getifaddrs.3:269
2213 #, no-wrap
2214 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2215 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2216
2217 #. type: Plain text
2218 #: build/C/man3/getifaddrs.3:272
2219 #, no-wrap
2220 msgid ""
2221 "        /* Display interface name and family (including symbolic\n"
2222 "           form of the latter for the common families) */\n"
2223 msgstr ""
2224 "        /* Display interface name and family (including symbolic\n"
2225 "           form of the latter for the common families) */\n"
2226
2227 #. type: Plain text
2228 #: build/C/man3/getifaddrs.3:279
2229 #, no-wrap
2230 msgid ""
2231 "        printf(\"%-8s %s (%d)\\en\",\n"
2232 "               ifa-E<gt>ifa_name,\n"
2233 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2234 "               (family == AF_INET) ? \"AF_INET\" :\n"
2235 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2236 "               family);\n"
2237 msgstr ""
2238 "        printf(\"%-8s %s (%d)\\en\",\n"
2239 "               ifa-E<gt>ifa_name,\n"
2240 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2241 "               (family == AF_INET) ? \"AF_INET\" :\n"
2242 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2243 "               family);\n"
2244
2245 #. type: Plain text
2246 #: build/C/man3/getifaddrs.3:281
2247 #, no-wrap
2248 msgid "        /* For an AF_INET* interface address, display the address */\n"
2249 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2250
2251 #. type: Plain text
2252 #: build/C/man3/getifaddrs.3:292
2253 #, no-wrap
2254 msgid ""
2255 "        if (family == AF_INET || family == AF_INET6) {\n"
2256 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2257 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2258 "                                          sizeof(struct sockaddr_in6),\n"
2259 "                    host, NI_MAXHOST,\n"
2260 "                    NULL, 0, NI_NUMERICHOST);\n"
2261 "            if (s != 0) {\n"
2262 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2263 "                exit(EXIT_FAILURE);\n"
2264 "            }\n"
2265 msgstr ""
2266 "        if (family == AF_INET || family == AF_INET6) {\n"
2267 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2268 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2269 "                                          sizeof(struct sockaddr_in6),\n"
2270 "                    host, NI_MAXHOST,\n"
2271 "                    NULL, 0, NI_NUMERICHOST);\n"
2272 "            if (s != 0) {\n"
2273 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2274 "                exit(EXIT_FAILURE);\n"
2275 "            }\n"
2276
2277 #. type: Plain text
2278 #: build/C/man3/getifaddrs.3:294
2279 #, no-wrap
2280 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2281 msgstr "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2282
2283 #. type: Plain text
2284 #: build/C/man3/getifaddrs.3:297
2285 #, no-wrap
2286 msgid ""
2287 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2288 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2289 msgstr ""
2290 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2291 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2292
2293 #. type: Plain text
2294 #: build/C/man3/getifaddrs.3:304
2295 #, no-wrap
2296 msgid ""
2297 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2298 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2299 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2300 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2301 "        }\n"
2302 "    }\n"
2303 msgstr ""
2304 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2305 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2306 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2307 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2308 "        }\n"
2309 "    }\n"
2310
2311 #. type: Plain text
2312 #: build/C/man3/getifaddrs.3:308
2313 #, no-wrap
2314 msgid ""
2315 "    freeifaddrs(ifaddr);\n"
2316 "    exit(EXIT_SUCCESS);\n"
2317 "}\n"
2318 msgstr ""
2319 "    freeifaddrs(ifaddr);\n"
2320 "    exit(EXIT_SUCCESS);\n"
2321 "}\n"
2322
2323 #. type: Plain text
2324 #: build/C/man3/getifaddrs.3:315
2325 msgid ""
2326 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2327 msgstr ""
2328 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2329
2330 #. type: TH
2331 #: build/C/man2/getsockname.2:40
2332 #, no-wrap
2333 msgid "GETSOCKNAME"
2334 msgstr "GETSOCKNAME"
2335
2336 #. type: Plain text
2337 #: build/C/man2/getsockname.2:43
2338 msgid "getsockname - get socket name"
2339 msgstr "getsockname - ソケットの名前を取得する"
2340
2341 #. type: Plain text
2342 #: build/C/man2/getsockname.2:49
2343 #, no-wrap
2344 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2345 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2346
2347 #. type: Plain text
2348 #: build/C/man2/getsockname.2:62
2349 msgid ""
2350 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2351 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2352 "should be initialized to indicate the amount of space (in bytes) pointed to "
2353 "by I<addr>.  On return it contains the actual size of the socket address."
2354 msgstr ""
2355 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2356 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2357 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2358 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2359 "納される。"
2360
2361 #. type: Plain text
2362 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2363 #: build/C/man2/listen.2:96
2364 msgid "The argument I<sockfd> is not a valid descriptor."
2365 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2366
2367 #. type: Plain text
2368 #: build/C/man2/getsockname.2:84
2369 msgid ""
2370 "The I<addr> argument points to memory not in a valid part of the process "
2371 "address space."
2372 msgstr ""
2373 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2374 "い。"
2375
2376 #. type: Plain text
2377 #: build/C/man2/getsockname.2:88
2378 msgid "I<addrlen> is invalid (e.g., is negative)."
2379 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2380
2381 #. type: TP
2382 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2383 #: build/C/man2/send.2:335
2384 #, no-wrap
2385 msgid "B<ENOBUFS>"
2386 msgstr "B<ENOBUFS>"
2387
2388 #. type: Plain text
2389 #: build/C/man2/getsockname.2:92
2390 msgid ""
2391 "Insufficient resources were available in the system to perform the operation."
2392 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2393
2394 #. type: Plain text
2395 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2396 msgid "The argument I<sockfd> is a file, not a socket."
2397 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2398
2399 #.  SVr4 documents additional ENOMEM
2400 #.  and ENOSR error codes.
2401 #. type: Plain text
2402 #: build/C/man2/getsockname.2:103
2403 msgid ""
2404 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2405 "POSIX.1-2001."
2406 msgstr ""
2407 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2408
2409 #. type: Plain text
2410 #: build/C/man2/getsockname.2:114
2411 msgid ""
2412 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2413 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2414 "resulted in the present I<socklen_t>, also used by glibc.  See also B<accept>"
2415 "(2)."
2416 msgstr ""
2417 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2418 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2419 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2420
2421 #. type: Plain text
2422 #: build/C/man2/getsockname.2:121
2423 msgid ""
2424 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2425 "(7)"
2426 msgstr ""
2427 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2428 "(7)"
2429
2430 #. type: TH
2431 #: build/C/man2/getsockopt.2:44
2432 #, no-wrap
2433 msgid "GETSOCKOPT"
2434 msgstr "GETSOCKOPT"
2435
2436 #. type: TH
2437 #: build/C/man2/getsockopt.2:44
2438 #, no-wrap
2439 msgid "2014-01-24"
2440 msgstr "2014-01-24"
2441
2442 #. type: Plain text
2443 #: build/C/man2/getsockopt.2:47
2444 msgid "getsockopt, setsockopt - get and set options on sockets"
2445 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2446
2447 #. type: Plain text
2448 #: build/C/man2/getsockopt.2:57
2449 #, no-wrap
2450 msgid ""
2451 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2452 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2453 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2454 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2455 msgstr ""
2456 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2457 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2458 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2459 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2460
2461 #. type: Plain text
2462 #: build/C/man2/getsockopt.2:67
2463 msgid ""
2464 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2465 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2466 "protocol levels; they are always present at the uppermost socket level."
2467 msgstr ""
2468 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2469 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2470 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2471 "定される。"
2472
2473 #. type: Plain text
2474 #: build/C/man2/getsockopt.2:86
2475 msgid ""
2476 "When manipulating socket options, the level at which the option resides and "
2477 "the name of the option must be specified.  To manipulate options at the "
2478 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2479 "options at any other level the protocol number of the appropriate protocol "
2480 "controlling the option is supplied.  For example, to indicate that an option "
2481 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2482 "protocol number of B<TCP>; see B<getprotoent>(3)."
2483 msgstr ""
2484 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2485 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2486 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2487 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2488 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2489 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2490 "B<getprotoent>(3)  を参照すること。"
2491
2492 #. type: Plain text
2493 #: build/C/man2/getsockopt.2:108
2494 msgid ""
2495 "The arguments I<optval> and I<optlen> are used to access option values for "
2496 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2497 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2498 "I<optlen> is a value-result argument, initially containing the size of the "
2499 "buffer pointed to by I<optval>, and modified on return to indicate the "
2500 "actual size of the value returned.  If no option value is to be supplied or "
2501 "returned, I<optval> may be NULL."
2502 msgstr ""
2503 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2504 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2505 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2506 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2507 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2508 "I<optval> は NULL でも良い。"
2509
2510 #. type: Plain text
2511 #: build/C/man2/getsockopt.2:118
2512 msgid ""
2513 "I<Optname> and any specified options are passed uninterpreted to the "
2514 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2515 "socket.hE<gt>> contains definitions for socket level options, described "
2516 "below.  Options at other protocol levels vary in format and name; consult "
2517 "the appropriate entries in section 4 of the manual."
2518 msgstr ""
2519 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2520 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2521 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2522 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2523 "ること。"
2524
2525 #. type: Plain text
2526 #: build/C/man2/getsockopt.2:127
2527 msgid ""
2528 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2529 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2530 "or zero if the option is to be disabled."
2531 msgstr ""
2532 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2533 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2534 "を指定し、 無効(disable)にするにはゼロを指定する。"
2535
2536 #. type: Plain text
2537 #: build/C/man2/getsockopt.2:131
2538 msgid ""
2539 "For a description of the available socket options see B<socket>(7)  and the "
2540 "appropriate protocol man pages."
2541 msgstr ""
2542 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2543 "ルの man ページを参照のこと。"
2544
2545 #. type: Plain text
2546 #: build/C/man2/getsockopt.2:152
2547 msgid ""
2548 "The address pointed to by I<optval> is not in a valid part of the process "
2549 "address space.  For B<getsockopt>(), this error may also be returned if "
2550 "I<optlen> is not in a valid part of the process address space."
2551 msgstr ""
2552 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2553 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2554 "い場合にもこのエラーが返される。"
2555
2556 #. type: Plain text
2557 #: build/C/man2/getsockopt.2:163
2558 msgid ""
2559 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2560 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2561 "option described in B<ip>(7))."
2562 msgstr ""
2563 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2564 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2565 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2566
2567 #. type: TP
2568 #: build/C/man2/getsockopt.2:163
2569 #, no-wrap
2570 msgid "B<ENOPROTOOPT>"
2571 msgstr "B<ENOPROTOOPT>"
2572
2573 #. type: Plain text
2574 #: build/C/man2/getsockopt.2:166
2575 msgid "The option is unknown at the level indicated."
2576 msgstr "指定された層(level)にはこのオプションは存在しない。"
2577
2578 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2579 #.  not document the
2580 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2581 #.  options
2582 #. type: Plain text
2583 #: build/C/man2/getsockopt.2:178
2584 msgid ""
2585 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2586 msgstr ""
2587 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2588 "POSIX.1-2001."
2589
2590 #. type: Plain text
2591 #: build/C/man2/getsockopt.2:199
2592 msgid ""
2593 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2594 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2595 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2596 "glibc.  See also B<accept>(2)."
2597 msgstr ""
2598 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2599 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2600 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2601 "る。 B<accept>(2)  も参照のこと。"
2602
2603 #. type: Plain text
2604 #: build/C/man2/getsockopt.2:202
2605 msgid ""
2606 "Several of the socket options should be handled at lower levels of the "
2607 "system."
2608 msgstr ""
2609 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2610
2611 #. type: Plain text
2612 #: build/C/man2/getsockopt.2:212
2613 msgid ""
2614 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2615 "B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2616 msgstr ""
2617 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2618 "B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2619
2620 #. type: TH
2621 #: build/C/man3/if_nameindex.3:26
2622 #, no-wrap
2623 msgid "IF_NAMEINDEX"
2624 msgstr "IF_NAMEINDEX"
2625
2626 #. type: TH
2627 #: build/C/man3/if_nameindex.3:26
2628 #, no-wrap
2629 msgid "2012-11-21"
2630 msgstr "2012-11-21"
2631
2632 #. type: Plain text
2633 #: build/C/man3/if_nameindex.3:29
2634 msgid ""
2635 "if_nameindex, if_freenameindex - get network interface names and indexes"
2636 msgstr ""
2637 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2638 "クスを取得する"
2639
2640 #. type: Plain text
2641 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2642 #, no-wrap
2643 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2644 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2645
2646 #. type: Plain text
2647 #: build/C/man3/if_nameindex.3:35
2648 #, no-wrap
2649 msgid ""
2650 "B<struct if_nameindex *if_nameindex(void);>\n"
2651 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2652 msgstr ""
2653 "B<struct if_nameindex *if_nameindex(void);>\n"
2654 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2655
2656 #. type: Plain text
2657 #: build/C/man3/if_nameindex.3:46
2658 msgid ""
2659 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2660 "structures, each containing information about one of the network interfaces "
2661 "on the local system.  The I<if_nameindex> structure contains at least the "
2662 "following entries:"
2663 msgstr ""
2664 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2665 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2666 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2667
2668 #. type: Plain text
2669 #: build/C/man3/if_nameindex.3:51
2670 #, no-wrap
2671 msgid ""
2672 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2673 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2674 msgstr ""
2675 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2676 "    char        *if_name;  /* NULL 終端された名前 (\"eth0\" など) */\n"
2677
2678 #. type: Plain text
2679 #: build/C/man3/if_nameindex.3:65
2680 msgid ""
2681 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2682 "points to the null-terminated interface name.  The end of the array is "
2683 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2684 msgstr ""
2685 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2686 "フィールドは NULL 終端されたインターフェース名を指す。 配列の最後は、 "
2687 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2688
2689 #. type: Plain text
2690 #: build/C/man3/if_nameindex.3:71
2691 msgid ""
2692 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2693 "and should be freed using B<if_freenameindex>()  when no longer needed."
2694 msgstr ""
2695 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2696 "は B<if_freenameindex>() で解放すべきである。"
2697
2698 #. type: Plain text
2699 #: build/C/man3/if_nameindex.3:78
2700 msgid ""
2701 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2702 "is returned, and I<errno> is set appropriately."
2703 msgstr ""
2704 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2705 "NULL が返され、 I<errno> が適切に設定される。"
2706
2707 #. type: Plain text
2708 #: build/C/man3/if_nameindex.3:83
2709 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2710 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2711
2712 #. type: Plain text
2713 #: build/C/man3/if_nameindex.3:86
2714 msgid "Insufficient resources available."
2715 msgstr "利用可能なリソースが十分にない。"
2716
2717 #. type: Plain text
2718 #: build/C/man3/if_nameindex.3:97
2719 msgid ""
2720 "B<if_nameindex>()  may also fail for any of the errors specified for "
2721 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2722 "B<sendto>(2), or B<malloc>(3)."
2723 msgstr ""
2724 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>"
2725 "(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定されているエラーの"
2726 "いずれかで失敗する場合がある。"
2727
2728 #. type: Plain text
2729 #: build/C/man3/if_nameindex.3:104
2730 msgid ""
2731 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2732 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2733 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2734 "available only on kernels that support netlink."
2735 msgstr ""
2736 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2737 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2738 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2739 "netlink をサポートするカーネルにおいてのみである。"
2740
2741 #. type: Plain text
2742 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:94
2743 msgid "RFC\\ 3493, POSIX.1-2001."
2744 msgstr "RFC\\ 3493, POSIX.1-2001."
2745
2746 #. type: Plain text
2747 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:96
2748 msgid "This function first appeared in BSDi."
2749 msgstr "この関数は BSDi 初めて登場した。"
2750
2751 #. type: Plain text
2752 #: build/C/man3/if_nameindex.3:112
2753 msgid ""
2754 "The program below demonstrates the use of the functions described on this "
2755 "page.  An example of the output this program might produce is the following:"
2756 msgstr ""
2757 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2758 "ムが生成する出力は以下のようになる。"
2759
2760 #. type: Plain text
2761 #: build/C/man3/if_nameindex.3:119
2762 #, no-wrap
2763 msgid ""
2764 "$ B<./a.out>I<\n"
2765 "1: lo\n"
2766 "2: wlan0\n"
2767 "3: em1>\n"
2768 msgstr ""
2769 "$ B<./a.out>I<\n"
2770 "1: lo\n"
2771 "2: wlan0\n"
2772 "3: em1>\n"
2773
2774 #. type: Plain text
2775 #: build/C/man3/if_nameindex.3:127
2776 #, no-wrap
2777 msgid ""
2778 "#include E<lt>net/if.hE<gt>\n"
2779 "#include E<lt>stdio.hE<gt>\n"
2780 "#include E<lt>stdlib.hE<gt>\n"
2781 "#include E<lt>unistd.hE<gt>\n"
2782 msgstr ""
2783 "#include E<lt>net/if.hE<gt>\n"
2784 "#include E<lt>stdio.hE<gt>\n"
2785 "#include E<lt>stdlib.hE<gt>\n"
2786 "#include E<lt>unistd.hE<gt>\n"
2787
2788 #. type: Plain text
2789 #: build/C/man3/if_nameindex.3:132
2790 #, no-wrap
2791 msgid ""
2792 "int\n"
2793 "main(int argc, char *argv[])\n"
2794 "{\n"
2795 "    struct if_nameindex *if_ni, *i;\n"
2796 msgstr ""
2797 "int\n"
2798 "main(int argc, char *argv[])\n"
2799 "{\n"
2800 "    struct if_nameindex *if_ni, *i;\n"
2801
2802 #. type: Plain text
2803 #: build/C/man3/if_nameindex.3:138
2804 #, no-wrap
2805 msgid ""
2806 "    if_ni = if_nameindex();\n"
2807 "    if (if_ni == NULL) {\n"
2808 "        perror(\"if_nameindex\");\n"
2809 "        exit(EXIT_FAILURE);\n"
2810 "    }\n"
2811 msgstr ""
2812 "    if_ni = if_nameindex();\n"
2813 "    if (if_ni == NULL) {\n"
2814 "        perror(\"if_nameindex\");\n"
2815 "        exit(EXIT_FAILURE);\n"
2816 "    }\n"
2817
2818 #. type: Plain text
2819 #: build/C/man3/if_nameindex.3:141
2820 #, no-wrap
2821 msgid ""
2822 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2823 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2824 msgstr ""
2825 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2826 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2827
2828 #. type: Plain text
2829 #: build/C/man3/if_nameindex.3:143
2830 #, no-wrap
2831 msgid "    if_freenameindex(if_ni);\n"
2832 msgstr "    if_freenameindex(if_ni);\n"
2833
2834 #. type: Plain text
2835 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:584
2836 #, no-wrap
2837 msgid ""
2838 "    exit(EXIT_SUCCESS);\n"
2839 "}\n"
2840 msgstr ""
2841 "    exit(EXIT_SUCCESS);\n"
2842 "}\n"
2843
2844 #. type: Plain text
2845 #: build/C/man3/if_nameindex.3:154
2846 msgid ""
2847 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2848 "B<if_nametoindex>(3), B<ifconfig>(8)"
2849 msgstr ""
2850 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2851 "B<if_nametoindex>(3), B<ifconfig>(8)"
2852
2853 #. type: TH
2854 #: build/C/man3/if_nametoindex.3:25
2855 #, no-wrap
2856 msgid "IF_NAMETOINDEX"
2857 msgstr "IF_NAMETOINDEX"
2858
2859 #. type: TH
2860 #: build/C/man3/if_nametoindex.3:25
2861 #, no-wrap
2862 msgid "2014-04-01"
2863 msgstr "2014-04-01"
2864
2865 #. type: Plain text
2866 #: build/C/man3/if_nametoindex.3:29
2867 msgid ""
2868 "if_nametoindex, if_indextoname - mappings between network interface names "
2869 "and indexes"
2870 msgstr ""
2871 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2872 "クスのマッピングを行う"
2873
2874 #. type: Plain text
2875 #: build/C/man3/if_nametoindex.3:34
2876 #, no-wrap
2877 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2878 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2879
2880 #. type: Plain text
2881 #: build/C/man3/if_nametoindex.3:36
2882 #, no-wrap
2883 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2884 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2885
2886 #. type: Plain text
2887 #: build/C/man3/if_nametoindex.3:43
2888 msgid ""
2889 "The B<if_nametoindex>()  function returns the index of the network interface "
2890 "corresponding to the name I<ifname>."
2891 msgstr ""
2892 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2893 "のインデックスを返す。"
2894
2895 #. type: Plain text
2896 #: build/C/man3/if_nametoindex.3:54
2897 msgid ""
2898 "The B<if_indextoname>()  function returns the name of the network interface "
2899 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2900 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2901 "least B<IF_NAMESIZE> bytes."
2902 msgstr ""
2903 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2904 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2905 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2906 "る。"
2907
2908 #. type: Plain text
2909 #: build/C/man3/if_nametoindex.3:61
2910 msgid ""
2911 "On success, B<if_nametoindex>()  returns the index number of the network "
2912 "interface; on error, 0 is returned and I<errno> is set appropriately."
2913 msgstr ""
2914 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2915 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2916
2917 #. type: Plain text
2918 #: build/C/man3/if_nametoindex.3:69
2919 msgid ""
2920 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2921 "returned and I<errno> is set appropriately."
2922 msgstr ""
2923 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2924 "が返され、 I<errno> が適切に設定される。"
2925
2926 #. type: Plain text
2927 #: build/C/man3/if_nametoindex.3:74
2928 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2929 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2930
2931 #. type: TP
2932 #: build/C/man3/if_nametoindex.3:74
2933 #, no-wrap
2934 msgid "B<ENXIO>"
2935 msgstr "B<ENXIO>"
2936
2937 #. type: Plain text
2938 #: build/C/man3/if_nametoindex.3:77
2939 msgid "No interface found for the index."
2940 msgstr "インデックスに対応するインターフェースがない。"
2941
2942 #. type: Plain text
2943 #: build/C/man3/if_nametoindex.3:85
2944 msgid ""
2945 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2946 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2947 msgstr ""
2948 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2949 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2950
2951 #. type: Plain text
2952 #: build/C/man3/if_nametoindex.3:92
2953 msgid ""
2954 "The B<if_nametoindex>()  and B<if_indextoname>()  functions are thread-safe."
2955 msgstr ""
2956 "関数 B<if_nametoindex>() と B<if_indextoname>() はスレッドセーフである。"
2957
2958 #. type: Plain text
2959 #: build/C/man3/if_nametoindex.3:100
2960 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2961 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2962
2963 #. type: TH
2964 #: build/C/man2/listen.2:45
2965 #, no-wrap
2966 msgid "LISTEN"
2967 msgstr "LISTEN"
2968
2969 #. type: TH
2970 #: build/C/man2/listen.2:45
2971 #, no-wrap
2972 msgid "2008-11-20"
2973 msgstr "2008-11-20"
2974
2975 #. type: Plain text
2976 #: build/C/man2/listen.2:48
2977 msgid "listen - listen for connections on a socket"
2978 msgstr "listen - ソケット(socket)上の接続を待つ"
2979
2980 #. type: Plain text
2981 #: build/C/man2/listen.2:55
2982 #, no-wrap
2983 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2984 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2985
2986 #. type: Plain text
2987 #: build/C/man2/listen.2:63
2988 msgid ""
2989 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2990 "that is, as a socket that will be used to accept incoming connection "
2991 "requests using B<accept>(2)."
2992 msgstr ""
2993 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2994 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2995 "した接続要求を受け付けるのに使用されるソケットである。"
2996
2997 #. type: Plain text
2998 #: build/C/man2/listen.2:70
2999 msgid ""
3000 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3001 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3002 msgstr ""
3003 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3004 "するファイルディスクリプタである。"
3005
3006 #. type: Plain text
3007 #: build/C/man2/listen.2:82
3008 msgid ""
3009 "The I<backlog> argument defines the maximum length to which the queue of "
3010 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3011 "when the queue is full, the client may receive an error with an indication "
3012 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3013 "the request may be ignored so that a later reattempt at connection succeeds."
3014 msgstr ""
3015 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3016 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3017 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3018 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3019 "い。"
3020
3021 #. type: Plain text
3022 #: build/C/man2/listen.2:91
3023 msgid "Another socket is already listening on the same port."
3024 msgstr "別のソケットが既に同じポートを listen している。"
3025
3026 #. type: Plain text
3027 #: build/C/man2/listen.2:101 build/C/man2/send.2:354
3028 msgid "The argument I<sockfd> is not a socket."
3029 msgstr "引き数 I<sockfd> はソケットではない。"
3030
3031 #. type: Plain text
3032 #: build/C/man2/listen.2:106
3033 msgid "The socket is not of a type that supports the B<listen>()  operation."
3034 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3035
3036 #. type: Plain text
3037 #: build/C/man2/listen.2:111
3038 msgid ""
3039 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3040 "4.2BSD."
3041 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3042
3043 #. type: Plain text
3044 #: build/C/man2/listen.2:113
3045 msgid "To accept connections, the following steps are performed:"
3046 msgstr "接続を受け付けるには、以下の処理が実行される。"
3047
3048 #. type: TP
3049 #: build/C/man2/listen.2:114 build/C/man2/select_tut.2:347
3050 #, no-wrap
3051 msgid "1."
3052 msgstr "1."
3053
3054 #. type: Plain text
3055 #: build/C/man2/listen.2:117
3056 msgid "A socket is created with B<socket>(2)."
3057 msgstr "B<socket>(2)  でソケットを作成する。"
3058
3059 #. type: TP
3060 #: build/C/man2/listen.2:117 build/C/man2/select_tut.2:356
3061 #, no-wrap
3062 msgid "2."
3063 msgstr "2."
3064
3065 #. type: Plain text
3066 #: build/C/man2/listen.2:123
3067 msgid ""
3068 "The socket is bound to a local address using B<bind>(2), so that other "
3069 "sockets may be B<connect>(2)ed to it."
3070 msgstr ""
3071 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3072 "のソケットに B<connect>(2)  できるようにする。"
3073
3074 #. type: TP
3075 #: build/C/man2/listen.2:123 build/C/man2/select_tut.2:360
3076 #, no-wrap
3077 msgid "3."
3078 msgstr "3."
3079
3080 #. type: Plain text
3081 #: build/C/man2/listen.2:127
3082 msgid ""
3083 "A willingness to accept incoming connections and a queue limit for incoming "
3084 "connections are specified with B<listen>()."
3085 msgstr ""
3086 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3087 "定する。"
3088
3089 #. type: TP
3090 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:367
3091 #, no-wrap
3092 msgid "4."
3093 msgstr "4."
3094
3095 #. type: Plain text
3096 #: build/C/man2/listen.2:130
3097 msgid "Connections are accepted with B<accept>(2)."
3098 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3099
3100 #. type: Plain text
3101 #: build/C/man2/listen.2:153
3102 msgid ""
3103 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3104 "2.2.  Now it specifies the queue length for I<completely> established "
3105 "sockets waiting to be accepted, instead of the number of incomplete "
3106 "connection requests.  The maximum length of the queue for incomplete sockets "
3107 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3108 "are enabled there is no logical maximum length and this setting is ignored.  "
3109 "See B<tcp>(7)  for more information."
3110 msgstr ""
3111 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3112 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3113 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3114 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3115 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3116 "論理的な最大長は存在せず、この設定は無視される。"
3117
3118 #.  The following is now rather historic information (MTK, Jun 05)
3119 #.  Don't rely on this value in portable applications since BSD
3120 #.  (and some BSD-derived systems) limit the backlog to 5.
3121 #. type: Plain text
3122 #: build/C/man2/listen.2:166
3123 msgid ""
3124 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3125 "somaxconn>, then it is silently truncated to that value; the default value "
3126 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3127 "value, B<SOMAXCONN>, with the value 128."
3128 msgstr ""
3129 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3130 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3131 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3132 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3133
3134 #. type: Plain text
3135 #: build/C/man2/listen.2:175
3136 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3137 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3138
3139 #. type: TH
3140 #: build/C/man2/recv.2:41
3141 #, no-wrap
3142 msgid "RECV"
3143 msgstr "RECV"
3144
3145 #. type: TH
3146 #: build/C/man2/recv.2:41
3147 #, no-wrap
3148 msgid "2014-02-11"
3149 msgstr "2014-02-11"
3150
3151 #. type: Plain text
3152 #: build/C/man2/recv.2:44
3153 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3154 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3155
3156 #. type: Plain text
3157 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3158 #: build/C/man2/select_tut.2:47
3159 #, no-wrap
3160 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3161 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3162
3163 #. type: Plain text
3164 #: build/C/man2/recv.2:53
3165 #, no-wrap
3166 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3167 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3168
3169 #. type: Plain text
3170 #: build/C/man2/recv.2:56
3171 #, no-wrap
3172 msgid ""
3173 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3174 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3175 msgstr ""
3176 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3177 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3178
3179 #. type: Plain text
3180 #: build/C/man2/recv.2:58
3181 #, no-wrap
3182 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3183 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3184
3185 #. type: Plain text
3186 #: build/C/man2/recv.2:70
3187 msgid ""
3188 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3189 "messages from a socket.  They may be used to receive data on both "
3190 "connectionless and connection-oriented sockets.  This page first describes "
3191 "common features of all three system calls, and then describes the "
3192 "differences between the calls."
3193 msgstr ""
3194 "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受"
3195 "け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 "
3196 "(connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら "
3197 "3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違い"
3198 "について説明する。"
3199
3200 #. type: Plain text
3201 #: build/C/man2/recv.2:76
3202 msgid ""
3203 "All three calls return the length of the message on successful completion.  "
3204 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3205 "discarded depending on the type of socket the message is received from."
3206 msgstr ""
3207 "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返"
3208 "す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッ"
3209 "セージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれな"
3210 "い。"
3211
3212 #. type: Plain text
3213 #: build/C/man2/recv.2:86
3214 msgid ""
3215 "If no messages are available at the socket, the receive calls wait for a "
3216 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3217 "which case the value -1 is returned and the external variable I<errno> is "
3218 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3219 "data available, up to the requested amount, rather than waiting for receipt "
3220 "of the full amount requested."
3221 msgstr ""
3222 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3223 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3224 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3225 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3226 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3227 "る (受信されるデータの最大サイズは要求したサイズである)。"
3228
3229 #. type: Plain text
3230 #: build/C/man2/recv.2:93
3231 msgid ""
3232 "An application can used B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3233 "determine when more data arrives on a socket."
3234 msgstr ""
3235 "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットに"
3236 "さらにデータが到着しているかを判定することができる。"
3237
3238 #. type: SS
3239 #: build/C/man2/recv.2:93
3240 #, no-wrap
3241 msgid "The flags argument"
3242 msgstr "フラグ引き数"
3243
3244 #. type: Plain text
3245 #: build/C/man2/recv.2:97
3246 msgid ""
3247 "The I<flags> argument is formed by ORing one or more of the following values:"
3248 msgstr ""
3249 "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指"
3250 "定する:"
3251
3252 #. type: TP
3253 #: build/C/man2/recv.2:97
3254 #, no-wrap
3255 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3256 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3257
3258 #. type: Plain text
3259 #: build/C/man2/recv.2:108
3260 msgid ""
3261 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3262 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3263 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3264 "flag of B<open>(2)."
3265 msgstr ""
3266 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3267 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3268 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3269 "同じ理由で有用である。"
3270
3271 #. type: TP
3272 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3273 #, no-wrap
3274 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3275 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3276
3277 #. type: Plain text
3278 #: build/C/man2/recv.2:118
3279 msgid ""
3280 "Enables nonblocking operation; if the operation would block, the call fails "
3281 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3282 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3283 msgstr ""
3284 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3285 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3286 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3287
3288 #. type: TP
3289 #: build/C/man2/recv.2:118
3290 #, no-wrap
3291 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3292 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3293
3294 #. type: Plain text
3295 #: build/C/man2/recv.2:137
3296 msgid ""
3297 "This flag specifies that queued errors should be received from the socket "
3298 "error queue.  The error is passed in an ancillary message with a type "
3299 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3300 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3301 "information.  The payload of the original packet that caused the error is "
3302 "passed as normal data via I<msg_iovec>.  The original destination address of "
3303 "the datagram that caused the error is supplied via I<msg_name>."
3304 msgstr ""
3305 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3306 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3307 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3308 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3309 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3310 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3311 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3312 "I<msg_name> 経由で参照できる。"
3313
3314 #. type: Plain text
3315 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3316 msgid ""
3317 "For local errors, no address is passed (this can be checked with the "
3318 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3319 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3320 "the pending socket error is regenerated based on the next queued error and "
3321 "will be passed on the next socket operation."
3322 msgstr ""
3323 "ローカルなエラーの場合はアドレスは渡されない\n"
3324 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3325 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3326 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3327 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3328
3329 #. type: Plain text
3330 #: build/C/man2/recv.2:153
3331 msgid "The error is supplied in a I<sock_extended_err> structure:"
3332 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3333
3334 #. type: Plain text
3335 #: build/C/man2/recv.2:160
3336 #, no-wrap
3337 msgid ""
3338 "#define SO_EE_ORIGIN_NONE    0\n"
3339 "#define SO_EE_ORIGIN_LOCAL   1\n"
3340 "#define SO_EE_ORIGIN_ICMP    2\n"
3341 "#define SO_EE_ORIGIN_ICMP6   3\n"
3342 msgstr ""
3343 "#define SO_EE_ORIGIN_NONE    0\n"
3344 "#define SO_EE_ORIGIN_LOCAL   1\n"
3345 "#define SO_EE_ORIGIN_ICMP    2\n"
3346 "#define SO_EE_ORIGIN_ICMP6   3\n"
3347
3348 #. type: Plain text
3349 #: build/C/man2/recv.2:172
3350 #, no-wrap
3351 msgid ""
3352 "struct sock_extended_err\n"
3353 "{\n"
3354 "    uint32_t ee_errno;   /* error number */\n"
3355 "    uint8_t  ee_origin;  /* where the error originated */\n"
3356 "    uint8_t  ee_type;    /* type */\n"
3357 "    uint8_t  ee_code;    /* code */\n"
3358 "    uint8_t  ee_pad;     /* padding */\n"
3359 "    uint32_t ee_info;    /* additional information */\n"
3360 "    uint32_t ee_data;    /* other data */\n"
3361 "    /* More data may follow */\n"
3362 "};\n"
3363 msgstr ""
3364 "struct sock_extended_err\n"
3365 "{\n"
3366 "    uint32_t ee_errno;   /* error number */\n"
3367 "    uint8_t  ee_origin;  /* where the error originated */\n"
3368 "    uint8_t  ee_type;    /* type */\n"
3369 "    uint8_t  ee_code;    /* code */\n"
3370 "    uint8_t  ee_pad;     /* padding */\n"
3371 "    uint32_t ee_info;    /* additional information */\n"
3372 "    uint32_t ee_data;    /* other data */\n"
3373 "    /* More data may follow */\n"
3374 "};\n"
3375
3376 #. type: Plain text
3377 #: build/C/man2/recv.2:174
3378 #, no-wrap
3379 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3380 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3381
3382 #. type: Plain text
3383 #: build/C/man2/recv.2:198
3384 msgid ""
3385 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3386 "is the origin code of where the error originated.  The other fields are "
3387 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3388 "address of the network object where the error originated from given a "
3389 "pointer to the ancillary message.  If this address is not known, the "
3390 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3391 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3392 "caused the error is passed as normal data."
3393 msgstr ""
3394 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3395 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3396 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3397 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3398 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3399 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3400 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3401 "される。"
3402
3403 #. type: TP
3404 #: build/C/man2/recv.2:212 build/C/man2/recv.2:393 build/C/man2/send.2:230
3405 #, no-wrap
3406 msgid "B<MSG_OOB>"
3407 msgstr "B<MSG_OOB>"
3408
3409 #. type: Plain text
3410 #: build/C/man2/recv.2:219
3411 msgid ""
3412 "This flag requests receipt of out-of-band data that would not be received in "
3413 "the normal data stream.  Some protocols place expedited data at the head of "
3414 "the normal data queue, and thus this flag cannot be used with such protocols."
3415 msgstr ""
3416 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3417 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3418 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3419 "い。"
3420
3421 #. type: TP
3422 #: build/C/man2/recv.2:219
3423 #, no-wrap
3424 msgid "B<MSG_PEEK>"
3425 msgstr "B<MSG_PEEK>"
3426
3427 #. type: Plain text
3428 #: build/C/man2/recv.2:226
3429 msgid ""
3430 "This flag causes the receive operation to return data from the beginning of "
3431 "the receive queue without removing that data from the queue.  Thus, a "
3432 "subsequent receive call will return the same data."
3433 msgstr ""
3434 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3435 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3436 "が返ることになる。"
3437
3438 #. type: TP
3439 #: build/C/man2/recv.2:226
3440 #, no-wrap
3441 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3442 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3443
3444 #. type: Plain text
3445 #: build/C/man2/recv.2:234
3446 msgid ""
3447 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3448 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3449 "return the real length of the packet or datagram, even when it was longer "
3450 "than the passed buffer."
3451 msgstr ""
3452 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3453 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3454 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3455 "場合にも、 パケットやデータグラムの実際の長さを返す。"
3456
3457 #. type: Plain text
3458 #: build/C/man2/recv.2:237
3459 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3460 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3461
3462 #. type: TP
3463 #: build/C/man2/recv.2:237
3464 #, no-wrap
3465 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3466 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3467
3468 #. type: Plain text
3469 #: build/C/man2/recv.2:245
3470 msgid ""
3471 "This flag requests that the operation block until the full request is "
3472 "satisfied.  However, the call may still return less data than requested if a "
3473 "signal is caught, an error or disconnect occurs, or the next data to be "
3474 "received is of a different type than that returned."
3475 msgstr ""
3476 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3477 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3478 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3479 "りデータが少なくても返ることがある。"
3480
3481 #. type: SS
3482 #: build/C/man2/recv.2:245
3483 #, no-wrap
3484 msgid "recvfrom()"
3485 msgstr "recvfrom()"
3486
3487 #. type: Plain text
3488 #: build/C/man2/recv.2:251
3489 msgid ""
3490 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3491 "caller must specify the size of the buffer in I<len>."
3492 msgstr ""
3493 "B<recvfrom>() は受信したメッセージをバッファ I<buf> に格納する。 呼び出し元は"
3494 "バッファサイズを I<len> で指定しなければならない。"
3495
3496 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3497 #.  .I src_addr
3498 #.  is filled in.
3499 #.  .I src_addr
3500 #.  is also filled in for stream sockets in the UNIX domain, but is not
3501 #.  filled in for stream sockets in the Internet domain.)
3502 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3503 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3504 #. type: Plain text
3505 #: build/C/man2/recv.2:279
3506 msgid ""
3507 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3508 "address of the message, that source address is placed in the buffer pointed "
3509 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3510 "Before the call, it should be initialized to the size of the buffer "
3511 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3512 "the actual size of the source address.  The returned address is truncated if "
3513 "the buffer provided is too small; in this case, I<addrlen> will return a "
3514 "value greater than was supplied to the call."
3515 msgstr ""
3516 "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが"
3517 "分かる場合、 この送信元アドレスが I<src_addr> が指すバッファに格納される。 こ"
3518 "の場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元は "
3519 "I<src_addr> に割り当てたバッファの大きさで初期化しておくべきである。 返ってく"
3520 "る時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡された"
3521 "バッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められる。この場"
3522 "合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返される。"
3523
3524 #. type: Plain text
3525 #: build/C/man2/recv.2:286
3526 msgid ""
3527 "If the caller is not interested in the source address, I<src_addr> should be "
3528 "specified as NULL and I<addrlen> should be specified as 0."
3529 msgstr ""
3530 "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> には NULL を指定"
3531 "し、 I<addrlen> には 0 を指定すべきである。"
3532
3533 #. type: SS
3534 #: build/C/man2/recv.2:286
3535 #, no-wrap
3536 msgid "recv()"
3537 msgstr "recv()"
3538
3539 #. type: Plain text
3540 #: build/C/man2/recv.2:294
3541 msgid ""
3542 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3543 "B<connect>(2)).  It is equivalent to the call:"
3544 msgstr ""
3545 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用さ"
3546 "れる (B<connect>(2) 参照)。次の呼び出しと等価である。"
3547
3548 #. type: Plain text
3549 #: build/C/man2/recv.2:297
3550 #, no-wrap
3551 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3552 msgstr "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3553
3554 #. type: SS
3555 #: build/C/man2/recv.2:297
3556 #, no-wrap
3557 msgid "recvmsg()"
3558 msgstr "recvmsg()"
3559
3560 #. type: Plain text
3561 #: build/C/man2/recv.2:305
3562 msgid ""
3563 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3564 "directly supplied arguments.  This structure is defined as follows in "
3565 "I<E<lt>sys/socket.hE<gt>>:"
3566 msgstr ""
3567 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3568 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3569
3570 #. type: Plain text
3571 #: build/C/man2/recv.2:312
3572 #, no-wrap
3573 msgid ""
3574 "struct iovec {                    /* Scatter/gather array items */\n"
3575 "    void  *iov_base;              /* Starting address */\n"
3576 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3577 "};\n"
3578 msgstr ""
3579 "struct iovec {                    /* Scatter/gather array items */\n"
3580 "    void  *iov_base;              /* Starting address */\n"
3581 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3582 "};\n"
3583
3584 #. type: Plain text
3585 #: build/C/man2/recv.2:322 build/C/man2/send.2:258
3586 #, no-wrap
3587 msgid ""
3588 "struct msghdr {\n"
3589 "    void         *msg_name;       /* optional address */\n"
3590 "    socklen_t     msg_namelen;    /* size of address */\n"
3591 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3592 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3593 "    void         *msg_control;    /* ancillary data, see below */\n"
3594 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3595 "    int           msg_flags;      /* flags on received message */\n"
3596 "};\n"
3597 msgstr ""
3598 "struct msghdr {\n"
3599 "    void         *msg_name;       /* 追加のアドレス */\n"
3600 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3601 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3602 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3603 "    void         *msg_control;    /* 補助データ (後述) */\n"
3604 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3605 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3606 "};\n"
3607
3608 #. type: Plain text
3609 #: build/C/man2/recv.2:352
3610 msgid ""
3611 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3612 "is unconnected; I<msg_name> may be given as a null pointer if no names are "
3613 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3614 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3615 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3616 "other protocol control-related messages or miscellaneous ancillary data.  "
3617 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3618 "the available buffer in I<msg_control>; upon return from a successful call "
3619 "it will contain the length of the control message sequence."
3620 msgstr ""
3621 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3622 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3623 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3624 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3625 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3626 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3627 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3628 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3629 "さが入っている。"
3630
3631 #. type: Plain text
3632 #: build/C/man2/recv.2:354
3633 msgid "The messages are of the form:"
3634 msgstr "メッセージの形式は以下の通り:"
3635
3636 #. type: Plain text
3637 #: build/C/man2/recv.2:364
3638 #, no-wrap
3639 msgid ""
3640 "struct cmsghdr {\n"
3641 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3642 "    int           cmsg_level;   /* originating protocol */\n"
3643 "    int           cmsg_type;    /* protocol-specific type */\n"
3644 "/* followed by\n"
3645 "    unsigned char cmsg_data[]; */\n"
3646 "};\n"
3647 msgstr ""
3648 "struct cmsghdr {\n"
3649 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3650 "    int           cmsg_level;   /* originating protocol */\n"
3651 "    int           cmsg_type;    /* protocol-specific type */\n"
3652 "/* followed by\n"
3653 "    unsigned char cmsg_data[]; */\n"
3654 "};\n"
3655
3656 #. type: Plain text
3657 #: build/C/man2/recv.2:369
3658 msgid ""
3659 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3660 msgstr ""
3661 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3662
3663 #. type: Plain text
3664 #: build/C/man2/recv.2:372
3665 msgid ""
3666 "As an example, Linux uses this ancillary data mechanism to pass extended "
3667 "errors, IP options, or file descriptors over UNIX domain sockets."
3668 msgstr ""
3669 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3670 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3671 "いる。"
3672
3673 #. type: Plain text
3674 #: build/C/man2/recv.2:380
3675 msgid ""
3676 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3677 "It can contain several flags:"
3678 msgstr ""
3679 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3680 "れる。ここにはいくつかのフラグが入る。"
3681
3682 #. type: TP
3683 #: build/C/man2/recv.2:380
3684 #, no-wrap
3685 msgid "B<MSG_EOR>"
3686 msgstr "B<MSG_EOR>"
3687
3688 #. type: Plain text
3689 #: build/C/man2/recv.2:385
3690 msgid ""
3691 "indicates end-of-record; the data returned completed a record (generally "
3692 "used with sockets of type B<SOCK_SEQPACKET>)."
3693 msgstr ""
3694 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3695 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3696
3697 #. type: TP
3698 #: build/C/man2/recv.2:385
3699 #, no-wrap
3700 msgid "B<MSG_TRUNC>"
3701 msgstr "B<MSG_TRUNC>"
3702
3703 #. type: Plain text
3704 #: build/C/man2/recv.2:389
3705 msgid ""
3706 "indicates that the trailing portion of a datagram was discarded because the "
3707 "datagram was larger than the buffer supplied."
3708 msgstr ""
3709 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3710 "た部分が捨てられたことを示す。"
3711
3712 #. type: TP
3713 #: build/C/man2/recv.2:389
3714 #, no-wrap
3715 msgid "B<MSG_CTRUNC>"
3716 msgstr "B<MSG_CTRUNC>"
3717
3718 #. type: Plain text
3719 #: build/C/man2/recv.2:393
3720 msgid ""
3721 "indicates that some control data were discarded due to lack of space in the "
3722 "buffer for ancillary data."
3723 msgstr ""
3724 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3725 "を示す。"
3726
3727 #. type: Plain text
3728 #: build/C/man2/recv.2:396
3729 msgid ""
3730 "is returned to indicate that expedited or out-of-band data were received."
3731 msgstr "速達データや帯域外データを受信したことを示す。"
3732
3733 #. type: TP
3734 #: build/C/man2/recv.2:396
3735 #, no-wrap
3736 msgid "B<MSG_ERRQUEUE>"
3737 msgstr "B<MSG_ERRQUEUE>"
3738
3739 #. type: Plain text
3740 #: build/C/man2/recv.2:400
3741 msgid ""
3742 "indicates that no data was received but an extended error from the socket "
3743 "error queue."
3744 msgstr ""
3745 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3746 "を示す。"
3747
3748 #. type: Plain text
3749 #: build/C/man2/recv.2:406
3750 msgid ""
3751 "These calls return the number of bytes received, or -1 if an error "
3752 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3753 msgstr ""
3754 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3755 "にエラーを示す値を設定する。"
3756
3757 #. type: Plain text
3758 #: build/C/man2/recv.2:409
3759 msgid ""
3760 "When a stream socket peer has performed an orderly shutdown, the return "
3761 "value will be 0 (the traditional \"end-of-file\" return)."
3762 msgstr ""
3763 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3764 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3765
3766 #. type: Plain text
3767 #: build/C/man2/recv.2:413
3768 msgid ""
3769 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3770 "permit zero-length datagrams.  When such a datagram is received, the return "
3771 "value is 0."
3772 msgstr ""
3773 "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメイ"
3774 "ンなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受"
3775 "信した場合、 返り値は 0 となる。"
3776
3777 #. type: Plain text
3778 #: build/C/man2/recv.2:416
3779 msgid ""
3780 "The value 0 may also be returned if the requested number of bytes to receive "
3781 "from a stream socket was 0."
3782 msgstr ""
3783 "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返され"
3784 "る。"
3785
3786 #. type: Plain text
3787 #: build/C/man2/recv.2:421
3788 msgid ""
3789 "These are some standard errors generated by the socket layer.  Additional "
3790 "errors may be generated and returned from the underlying protocol modules; "
3791 "see their manual pages."
3792 msgstr ""
3793 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3794 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3795 "ること。"
3796
3797 #.  Actually EAGAIN on Linux
3798 #. type: Plain text
3799 #: build/C/man2/recv.2:430
3800 msgid ""
3801 "The socket is marked nonblocking and the receive operation would block, or a "
3802 "receive timeout had been set and the timeout expired before data was "
3803 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3804 "and does not require these constants to have the same value, so a portable "
3805 "application should check for both possibilities."
3806 msgstr ""
3807 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3808 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3809 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3810 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3811 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3812
3813 #. type: Plain text
3814 #: build/C/man2/recv.2:435
3815 msgid "The argument I<sockfd> is an invalid descriptor."
3816 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3817
3818 #. type: Plain text
3819 #: build/C/man2/recv.2:439
3820 msgid ""
3821 "A remote host refused to allow the network connection (typically because it "
3822 "is not running the requested service)."
3823 msgstr ""
3824 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3825 "たサービスが起動されていないなどがある)。"
3826
3827 #. type: Plain text
3828 #: build/C/man2/recv.2:443
3829 msgid ""
3830 "The receive buffer pointer(s) point outside the process's address space."
3831 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3832
3833 #. type: Plain text
3834 #: build/C/man2/recv.2:448
3835 msgid ""
3836 "The receive was interrupted by delivery of a signal before any data were "
3837 "available; see B<signal>(7)."
3838 msgstr ""
3839 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3840
3841 #. type: Plain text
3842 #: build/C/man2/recv.2:452 build/C/man2/send.2:323
3843 msgid "Invalid argument passed."
3844 msgstr "不正な引き数が渡された。"
3845
3846 #. type: Plain text
3847 #: build/C/man2/recv.2:456
3848 msgid "Could not allocate memory for B<recvmsg>()."
3849 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3850
3851 #. type: TP
3852 #: build/C/man2/recv.2:456 build/C/man2/send.2:346
3853 #, no-wrap
3854 msgid "B<ENOTCONN>"
3855 msgstr "B<ENOTCONN>"
3856
3857 #. type: Plain text
3858 #: build/C/man2/recv.2:463
3859 msgid ""
3860 "The socket is associated with a connection-oriented protocol and has not "
3861 "been connected (see B<connect>(2)  and B<accept>(2))."
3862 msgstr ""
3863 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3864 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3865
3866 #. type: Plain text
3867 #: build/C/man2/recv.2:468
3868 msgid "The argument I<sockfd> does not refer to a socket."
3869 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3870
3871 #. type: Plain text
3872 #: build/C/man2/recv.2:471
3873 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3874 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3875
3876 #. type: Plain text
3877 #: build/C/man2/recv.2:478
3878 msgid ""
3879 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3880 "flags."
3881 msgstr ""
3882 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3883 "されている。"
3884
3885 #. type: Plain text
3886 #: build/C/man2/recv.2:494
3887 msgid ""
3888 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3889 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3890 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3891 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3892 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3893 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3894 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3895 msgstr ""
3896 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3897 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3898 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3899 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3900 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3901 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3902 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3903
3904 #.  glibc bug raised 12 Mar 2006
3905 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3906 #.  The problem is an underlying kernel issue: the size of the
3907 #.  __kernel_size_t type used to type this field varies
3908 #.  across architectures, but socklen_t is always 32 bits.
3909 #. type: Plain text
3910 #: build/C/man2/recv.2:508 build/C/man2/send.2:409
3911 msgid ""
3912 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3913 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3914 "I<size_t>."
3915 msgstr ""
3916 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3917 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3918 "ある。"
3919
3920 #. type: Plain text
3921 #: build/C/man2/recv.2:513
3922 msgid ""
3923 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3924 "can be used to receive multiple datagrams in a single call."
3925 msgstr ""
3926 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3927 "固有の システムコールに関する情報が書かれている。"
3928
3929 #. type: Plain text
3930 #: build/C/man2/recv.2:518
3931 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3932 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3933
3934 #. type: Plain text
3935 #: build/C/man2/recv.2:529
3936 msgid ""
3937 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3938 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3939 msgstr ""
3940 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3941 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3942
3943 #. type: TH
3944 #: build/C/man2/recvmmsg.2:31
3945 #, no-wrap
3946 msgid "RECVMMSG"
3947 msgstr "RECVMMSG"
3948
3949 #. type: TH
3950 #: build/C/man2/recvmmsg.2:31
3951 #, no-wrap
3952 msgid "2012-12-24"
3953 msgstr "2012-12-24"
3954
3955 #. type: Plain text
3956 #: build/C/man2/recvmmsg.2:34
3957 msgid "recvmmsg - receive multiple messages on a socket"
3958 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
3959
3960 #. type: Plain text
3961 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3962 #, no-wrap
3963 msgid ""
3964 "B<#define _GNU_SOURCE>\n"
3965 "B<#include E<lt>sys/socket.hE<gt>>\n"
3966 msgstr ""
3967 "B<#define _GNU_SOURCE>\n"
3968 "B<#include E<lt>sys/socket.hE<gt>>\n"
3969
3970 #. type: Plain text
3971 #: build/C/man2/recvmmsg.2:41
3972 #, no-wrap
3973 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3974 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3975
3976 #. type: Plain text
3977 #: build/C/man2/recvmmsg.2:43
3978 #, no-wrap
3979 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3980 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3981
3982 #. type: Plain text
3983 #: build/C/man2/recvmmsg.2:55
3984 msgid ""
3985 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3986 "the caller to receive multiple messages from a socket using a single system "
3987 "call.  (This has performance benefits for some applications.)  A further "
3988 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3989 "operation."
3990 msgstr ""
3991 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
3992 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
3993 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
3994 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
3995
3996 #. type: Plain text
3997 #: build/C/man2/recvmmsg.2:59
3998 msgid ""
3999 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4000 "from."
4001 msgstr ""
4002 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
4003
4004 #. type: Plain text
4005 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4006 msgid ""
4007 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4008 "The size of this array is specified in I<vlen>."
4009 msgstr ""
4010 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4011 "I<vlen> で指定する。"
4012
4013 #. type: Plain text
4014 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4015 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4016 msgstr ""
4017 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4018
4019 #. type: Plain text
4020 #: build/C/man2/recvmmsg.2:80
4021 #, no-wrap
4022 msgid ""
4023 "struct mmsghdr {\n"
4024 "    struct msghdr msg_hdr;  /* Message header */\n"
4025 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4026 "};\n"
4027 msgstr ""
4028 "struct mmsghdr {\n"
4029 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
4030 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
4031 "};\n"
4032
4033 #. type: Plain text
4034 #: build/C/man2/recvmmsg.2:95
4035 msgid ""
4036 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
4037 "(2).  The I<msg_len> field is the number of bytes returned for the message "
4038 "in the entry.  This field has the same value as the return value of a single "
4039 "B<recvmsg>(2)  on the header."
4040 msgstr ""
4041 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4042 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4043 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4044 "る。"
4045
4046 #. type: Plain text
4047 #: build/C/man2/recvmmsg.2:102
4048 msgid ""
4049 "The I<flags> argument contains flags ORed together.  The flags are the same "
4050 "as documented for B<recvmsg>(2), with the following addition:"
4051 msgstr ""
4052 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4053 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4054
4055 #. type: TP
4056 #: build/C/man2/recvmmsg.2:102
4057 #, no-wrap
4058 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4059 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4060
4061 #. type: Plain text
4062 #: build/C/man2/recvmmsg.2:107
4063 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4064 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4065
4066 #. type: Plain text
4067 #: build/C/man2/recvmmsg.2:121
4068 msgid ""
4069 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
4070 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
4071 "operation.  (This interval will be rounded up to the system clock "
4072 "granularity, and kernel scheduling delays mean that the blocking interval "
4073 "may overrun by a small amount.)  If I<timeout> is NULL, then the operation "
4074 "blocks indefinitely."
4075 msgstr ""
4076 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4077 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (待ち時間は"
4078 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延により少"
4079 "しだけ長くなる可能性がある)。 I<timeout>が NULL の場合、 受信操作は無期限に停"
4080 "止 (block) する。"
4081
4082 #. type: Plain text
4083 #: build/C/man2/recvmmsg.2:132
4084 msgid ""
4085 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4086 "received or until the timeout expires.  A nonblocking call reads as many "
4087 "messages as are available (up to the limit specified by I<vlen>)  and "
4088 "returns immediately."
4089 msgstr ""
4090 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4091 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4092 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4093 "すぐに返る。"
4094
4095 #. type: Plain text
4096 #: build/C/man2/recvmmsg.2:147
4097 msgid ""
4098 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4099 "to contain information about each received message: I<msg_len> contains the "
4100 "size of the received message; the subfields of I<msg_hdr> are updated as "
4101 "described in B<recvmsg>(2).  The return value of the call indicates the "
4102 "number of elements of I<msgvec> that have been updated."
4103 msgstr ""
4104 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4105 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4106 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4107 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4108 "数である。"
4109
4110 #. type: Plain text
4111 #: build/C/man2/recvmmsg.2:155
4112 msgid ""
4113 "On success, B<recvmmsg>()  returns the number of messages received in "
4114 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4115 "error."
4116 msgstr ""
4117 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4118 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4119
4120 #. type: Plain text
4121 #: build/C/man2/recvmmsg.2:159
4122 msgid ""
4123 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4124 msgstr ""
4125 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4126 "がある。"
4127
4128 #. type: Plain text
4129 #: build/C/man2/recvmmsg.2:163
4130 msgid "I<timeout> is invalid."
4131 msgstr "I<timeout> が無効である。"
4132
4133 #. type: Plain text
4134 #: build/C/man2/recvmmsg.2:168
4135 msgid ""
4136 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4137 "was added in version 2.12."
4138 msgstr ""
4139 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4140 "はバージョン 2.12 以降で利用可能である。"
4141
4142 #. type: Plain text
4143 #: build/C/man2/recvmmsg.2:171
4144 msgid "B<recvmmsg>()  is Linux-specific."
4145 msgstr "B<recvmmsg>() は Linux 固有である。"
4146
4147 #. type: Plain text
4148 #: build/C/man2/recvmmsg.2:179
4149 msgid ""
4150 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4151 "socket and stores them in multiple buffers.  The call returns if all buffers "
4152 "are filled or if the timeout specified has expired."
4153 msgstr ""
4154 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4155 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4156 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4157
4158 #. type: Plain text
4159 #: build/C/man2/recvmmsg.2:182
4160 msgid ""
4161 "The following snippet periodically generates UDP datagrams containing a "
4162 "random number:"
4163 msgstr ""
4164 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4165 "る。"
4166
4167 #. type: Plain text
4168 #: build/C/man2/recvmmsg.2:187
4169 #, no-wrap
4170 msgid ""
4171 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4172 "B<sleep 0.25; done>\n"
4173 msgstr ""
4174 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4175 "B<sleep 0.25; done>\n"
4176
4177 #. type: Plain text
4178 #: build/C/man2/recvmmsg.2:192
4179 msgid ""
4180 "These datagrams are read by the example application, which can give the "
4181 "following output:"
4182 msgstr ""
4183 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4184 "が得られる。"
4185
4186 #. type: Plain text
4187 #: build/C/man2/recvmmsg.2:202
4188 #, no-wrap
4189 msgid ""
4190 "$B< ./a.out>\n"
4191 "5 messages received\n"
4192 "1 11782\n"
4193 "2 11345\n"
4194 "3 304\n"
4195 "4 13514\n"
4196 "5 28421\n"
4197 msgstr ""
4198 "$B< ./a.out>\n"
4199 "5 messages received\n"
4200 "1 11782\n"
4201 "2 11345\n"
4202 "3 304\n"
4203 "4 13514\n"
4204 "5 28421\n"
4205
4206 #. type: Plain text
4207 #: build/C/man2/recvmmsg.2:213
4208 #, no-wrap
4209 msgid ""
4210 "#define _GNU_SOURCE\n"
4211 "#include E<lt>netinet/ip.hE<gt>\n"
4212 "#include E<lt>stdio.hE<gt>\n"
4213 "#include E<lt>stdlib.hE<gt>\n"
4214 "#include E<lt>string.hE<gt>\n"
4215 "#include E<lt>sys/socket.hE<gt>\n"
4216 msgstr ""
4217 "#define _GNU_SOURCE\n"
4218 "#include E<lt>netinet/ip.hE<gt>\n"
4219 "#include E<lt>stdio.hE<gt>\n"
4220 "#include E<lt>stdlib.hE<gt>\n"
4221 "#include E<lt>string.hE<gt>\n"
4222 "#include E<lt>sys/socket.hE<gt>\n"
4223
4224 #. type: Plain text
4225 #: build/C/man2/recvmmsg.2:226
4226 #, no-wrap
4227 msgid ""
4228 "int\n"
4229 "main(void)\n"
4230 "{\n"
4231 "#define VLEN 10\n"
4232 "#define BUFSIZE 200\n"
4233 "#define TIMEOUT 1\n"
4234 "    int sockfd, retval, i;\n"
4235 "    struct sockaddr_in sa;\n"
4236 "    struct mmsghdr msgs[VLEN];\n"
4237 "    struct iovec iovecs[VLEN];\n"
4238 "    char bufs[VLEN][BUFSIZE+1];\n"
4239 "    struct timespec timeout;\n"
4240 msgstr ""
4241 "int\n"
4242 "main(void)\n"
4243 "{\n"
4244 "#define VLEN 10\n"
4245 "#define BUFSIZE 200\n"
4246 "#define TIMEOUT 1\n"
4247 "    int sockfd, retval, i;\n"
4248 "    struct sockaddr_in sa;\n"
4249 "    struct mmsghdr msgs[VLEN];\n"
4250 "    struct iovec iovecs[VLEN];\n"
4251 "    char bufs[VLEN][BUFSIZE+1];\n"
4252 "    struct timespec timeout;\n"
4253
4254 #. type: Plain text
4255 #: build/C/man2/recvmmsg.2:232 build/C/man2/sendmmsg.2:201
4256 #, no-wrap
4257 msgid ""
4258 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4259 "    if (sockfd == -1) {\n"
4260 "        perror(\"socket()\");\n"
4261 "        exit(EXIT_FAILURE);\n"
4262 "    }\n"
4263 msgstr ""
4264 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4265 "    if (sockfd == -1) {\n"
4266 "        perror(\"socket()\");\n"
4267 "        exit(EXIT_FAILURE);\n"
4268 "    }\n"
4269
4270 #. type: Plain text
4271 #: build/C/man2/recvmmsg.2:240
4272 #, no-wrap
4273 msgid ""
4274 "    sa.sin_family = AF_INET;\n"
4275 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4276 "    sa.sin_port = htons(1234);\n"
4277 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4278 "        perror(\"bind()\");\n"
4279 "        exit(EXIT_FAILURE);\n"
4280 "    }\n"
4281 msgstr ""
4282 "    sa.sin_family = AF_INET;\n"
4283 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4284 "    sa.sin_port = htons(1234);\n"
4285 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4286 "        perror(\"bind()\");\n"
4287 "        exit(EXIT_FAILURE);\n"
4288 "    }\n"
4289
4290 #. type: Plain text
4291 #: build/C/man2/recvmmsg.2:248
4292 #, no-wrap
4293 msgid ""
4294 "    memset(msgs, 0, sizeof(msgs));\n"
4295 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4296 "        iovecs[i].iov_base         = bufs[i];\n"
4297 "        iovecs[i].iov_len          = BUFSIZE;\n"
4298 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4299 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4300 "    }\n"
4301 msgstr ""
4302 "    memset(msgs, 0, sizeof(msgs));\n"
4303 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4304 "        iovecs[i].iov_base         = bufs[i];\n"
4305 "        iovecs[i].iov_len          = BUFSIZE;\n"
4306 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4307 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4308 "    }\n"
4309
4310 #. type: Plain text
4311 #: build/C/man2/recvmmsg.2:251
4312 #, no-wrap
4313 msgid ""
4314 "    timeout.tv_sec = TIMEOUT;\n"
4315 "    timeout.tv_nsec = 0;\n"
4316 msgstr ""
4317 "    timeout.tv_sec = TIMEOUT;\n"
4318 "    timeout.tv_nsec = 0;\n"
4319
4320 #. type: Plain text
4321 #: build/C/man2/recvmmsg.2:257
4322 #, no-wrap
4323 msgid ""
4324 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4325 "    if (retval == -1) {\n"
4326 "        perror(\"recvmmsg()\");\n"
4327 "        exit(EXIT_FAILURE);\n"
4328 "    }\n"
4329 msgstr ""
4330 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4331 "    if (retval == -1) {\n"
4332 "        perror(\"recvmmsg()\");\n"
4333 "        exit(EXIT_FAILURE);\n"
4334 "    }\n"
4335
4336 #. type: Plain text
4337 #: build/C/man2/recvmmsg.2:265
4338 #, no-wrap
4339 msgid ""
4340 "    printf(\"%d messages received\\en\", retval);\n"
4341 "    for (i = 0; i E<lt> retval; i++) {\n"
4342 "        bufs[i][msgs[i].msg_len] = 0;\n"
4343 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4344 "    }\n"
4345 "    exit(EXIT_SUCCESS);\n"
4346 "}\n"
4347 msgstr ""
4348 "    printf(\"%d messages received\\en\", retval);\n"
4349 "    for (i = 0; i E<lt> retval; i++) {\n"
4350 "        bufs[i][msgs[i].msg_len] = 0;\n"
4351 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4352 "    }\n"
4353 "    exit(EXIT_SUCCESS);\n"
4354 "}\n"
4355
4356 #. type: Plain text
4357 #: build/C/man2/recvmmsg.2:273
4358 msgid ""
4359 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4360 "(2), B<socket>(7)"
4361 msgstr ""
4362 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
4363 "(2), B<socket>(7)"
4364
4365 #. type: TH
4366 #: build/C/man2/select.2:38
4367 #, no-wrap
4368 msgid "SELECT"
4369 msgstr "SELECT"
4370
4371 #. type: TH
4372 #: build/C/man2/select.2:38
4373 #, no-wrap
4374 msgid "2014-01-31"
4375 msgstr "2014-01-31"
4376
4377 #. type: Plain text
4378 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4379 msgid ""
4380 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4381 "multiplexing"
4382 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4383
4384 #. type: Plain text
4385 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4386 #, no-wrap
4387 msgid "/* According to POSIX.1-2001 */\n"
4388 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4389
4390 #. type: Plain text
4391 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4392 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4393 #, no-wrap
4394 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4395 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4396
4397 #. type: Plain text
4398 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4399 #, no-wrap
4400 msgid "/* According to earlier standards */\n"
4401 msgstr "/* 以前の規格に従う場合 */\n"
4402
4403 #. type: Plain text
4404 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4405 #, no-wrap
4406 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4407 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4408
4409 #. type: Plain text
4410 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4411 #, no-wrap
4412 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4413 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4414
4415 #. type: Plain text
4416 #: build/C/man2/select.2:58
4417 #, no-wrap
4418 msgid ""
4419 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4420 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4421 msgstr ""
4422 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4423 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4424
4425 #. type: Plain text
4426 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4427 #, no-wrap
4428 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4429 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4430
4431 #. type: Plain text
4432 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4433 #, no-wrap
4434 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4435 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4436
4437 #. type: Plain text
4438 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4439 #, no-wrap
4440 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4441 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4442
4443 #. type: Plain text
4444 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4445 #, no-wrap
4446 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4447 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4448
4449 #. type: Plain text
4450 #: build/C/man2/select.2:72
4451 #, no-wrap
4452 msgid ""
4453 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4454 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4455 "B<            const sigset_t *>I<sigmask>B<);>\n"
4456 msgstr ""
4457 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4458 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4459 "B<            const sigset_t *>I<sigmask>B<);>\n"
4460
4461 #. type: Plain text
4462 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4463 #: build/C/man3/sockatmark.3:36
4464 msgid ""
4465 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4466 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4467
4468 #. type: Plain text
4469 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4470 msgid ""
4471 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4472 "600"
4473 msgstr ""
4474 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4475 "600"
4476
4477 #. type: Plain text
4478 #: build/C/man2/select.2:92
4479 msgid ""
4480 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4481 "descriptors, waiting until one or more of the file descriptors become \"ready"
4482 "\" for some class of I/O operation (e.g., input possible).  A file "
4483 "descriptor is considered ready if it is possible to perform the "
4484 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4485 msgstr ""
4486 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4487 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4488 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4489 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4490 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4491 "意味する。"
4492
4493 #. type: Plain text
4494 #: build/C/man2/select.2:98
4495 msgid ""
4496 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4497 "these three differences:"
4498 msgstr ""
4499 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4500
4501 #. type: TP
4502 #: build/C/man2/select.2:98
4503 #, no-wrap
4504 msgid "(i)"
4505 msgstr "(i)"
4506
4507 #. type: Plain text
4508 #: build/C/man2/select.2:108
4509 msgid ""
4510 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4511 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4512 "and nanoseconds)."
4513 msgstr ""
4514 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4515 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4516 "timespec> (秒・ナノ秒単位) を用いる。"
4517
4518 #. type: TP
4519 #: build/C/man2/select.2:108
4520 #, no-wrap
4521 msgid "(ii)"
4522 msgstr "(ii)"
4523
4524 #. type: Plain text
4525 #: build/C/man2/select.2:116
4526 msgid ""
4527 "B<select>()  may update the I<timeout> argument to indicate how much time "
4528 "was left.  B<pselect>()  does not change this argument."
4529 msgstr ""
4530 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4531 "B<pselect>()  はこの引き数を変更しない。"
4532
4533 #. type: TP
4534 #: build/C/man2/select.2:116
4535 #, no-wrap
4536 msgid "(iii)"
4537 msgstr "(iii)"
4538
4539 #. type: Plain text
4540 #: build/C/man2/select.2:125
4541 msgid ""
4542 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4543 "with NULL I<sigmask>."
4544 msgstr ""
4545 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4546 "指定した場合の B<pselect>()  と同じである。"
4547
4548 #. type: Plain text
4549 #: build/C/man2/select.2:143
4550 msgid ""
4551 "Three independent sets of file descriptors are watched.  Those listed in "
4552 "I<readfds> will be watched to see if characters become available for reading "
4553 "(more precisely, to see if a read will not block; in particular, a file "
4554 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4555 "watched to see if a write will not block, and those in I<exceptfds> will be "
4556 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4557 "which file descriptors actually changed status.  Each of the three file "
4558 "descriptor sets may be specified as NULL if no file descriptors are to be "
4559 "watched for the corresponding class of events."
4560 msgstr ""
4561 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4562 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4563 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4564 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4565 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4566 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4567 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4568 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4569 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4570 "指定することができる。"
4571
4572 #. type: Plain text
4573 #: build/C/man2/select.2:156
4574 msgid ""
4575 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4576 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4577 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4578 "part of the set; this is useful after B<select>()  returns."
4579 msgstr ""
4580 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4581 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4582 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4583 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4584 "る。"
4585
4586 #. type: Plain text
4587 #: build/C/man2/select.2:159
4588 msgid ""
4589 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4590 "plus 1."
4591 msgstr ""
4592 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4593 "のである。"
4594
4595 #. type: Plain text
4596 #: build/C/man2/select.2:166
4597 msgid ""
4598 "The I<timeout> argument specifies the interval that B<select>()  should "
4599 "block waiting for a file descriptor to become ready.  The call will block "
4600 "until either:"
4601 msgstr ""
4602 "I<timeout> 引き数は、 B<select>() がファイルディスクリプタが ready になるのを"
4603 "待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
4604
4605 #. type: IP
4606 #: build/C/man2/select.2:166 build/C/man2/select.2:168
4607 #: build/C/man2/select.2:170
4608 #, no-wrap
4609 msgid "*"
4610 msgstr "*"
4611
4612 #. type: Plain text
4613 #: build/C/man2/select.2:168
4614 msgid "a file descriptor becomes ready;"
4615 msgstr "ファイルディスクリプタが利用可能になる。"
4616
4617 #. type: Plain text
4618 #: build/C/man2/select.2:170
4619 msgid "the call is interrupted by a signal handler; or"
4620 msgstr "システムコールがシグナルハンドラにより割り込まれた。"
4621
4622 #. type: Plain text
4623 #: build/C/man2/select.2:172
4624 msgid "the timeout expires."
4625 msgstr "タイムアウト時間が満了した。"
4626
4627 #. type: Plain text
4628 #: build/C/man2/select.2:189
4629 msgid ""
4630 "Note that the I<timeout> interval will be rounded up to the system clock "
4631 "granularity, and kernel scheduling delays mean that the blocking interval "
4632 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4633 "are zero, then B<select>()  returns immediately.  (This is useful for "
4634 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4635 "indefinitely."
4636 msgstr ""
4637 "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケ"
4638 "ジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 "
4639 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰す"
4640 "る (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に "
4641 "NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) "
4642 "する。"
4643
4644 #. type: Plain text
4645 #: build/C/man2/select.2:199
4646 msgid ""
4647 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4648 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4649 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4650 "restores the original signal mask."
4651 msgstr ""
4652 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4653 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4654 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4655 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4656
4657 #. type: Plain text
4658 #: build/C/man2/select.2:205
4659 msgid ""
4660 "Other than the difference in the precision of the I<timeout> argument, the "
4661 "following B<pselect>()  call:"
4662 msgstr ""
4663 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4664
4665 #. type: Plain text
4666 #: build/C/man2/select.2:209
4667 #, no-wrap
4668 msgid ""
4669 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4670 "                    timeout, &sigmask);\n"
4671 msgstr ""
4672 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4673 "                    timeout, &sigmask);\n"
4674
4675 #. type: Plain text
4676 #: build/C/man2/select.2:214
4677 msgid "is equivalent to I<atomically> executing the following calls:"
4678 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4679
4680 #. type: Plain text
4681 #: build/C/man2/select.2:217
4682 #, no-wrap
4683 msgid "    sigset_t origmask;\n"
4684 msgstr "    sigset_t origmask;\n"
4685
4686 #. type: Plain text
4687 #: build/C/man2/select.2:221
4688 #, no-wrap
4689 msgid ""
4690 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4691 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4692 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4693 msgstr ""
4694 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4695 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4696 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4697
4698 #. type: Plain text
4699 #: build/C/man2/select.2:242
4700 msgid ""
4701 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4702 "either a signal or for a file descriptor to become ready, then an atomic "
4703 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4704 "a global flag and returns.  Then a test of this global flag followed by a "
4705 "call of B<select>()  could hang indefinitely if the signal arrived just "
4706 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4707 "one to first block signals, handle the signals that have come in, then call "
4708 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4709 msgstr ""
4710 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4711 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4712 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4713 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4714 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4715 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4716 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4717 "で、前記の競合を避けることができる。)"
4718
4719 #. type: SS
4720 #: build/C/man2/select.2:242
4721 #, no-wrap
4722 msgid "The timeout"
4723 msgstr "タイムアウト"
4724
4725 #. type: Plain text
4726 #: build/C/man2/select.2:246
4727 msgid ""
4728 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4729 "like"
4730 msgstr ""
4731 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4732
4733 #. type: Plain text
4734 #: build/C/man2/select.2:253
4735 #, no-wrap
4736 msgid ""
4737 "struct timeval {\n"
4738 "    long    tv_sec;         /* seconds */\n"
4739 "    long    tv_usec;        /* microseconds */\n"
4740 "};\n"
4741 msgstr ""
4742 "struct timeval {\n"
4743 "    long    tv_sec;         /* 秒 */\n"
4744 "    long    tv_usec;        /* マイクロ秒 */\n"
4745 "};\n"
4746
4747 #. type: Plain text
4748 #: build/C/man2/select.2:257
4749 msgid "and"
4750 msgstr "や"
4751
4752 #. type: Plain text
4753 #: build/C/man2/select.2:264
4754 #, no-wrap
4755 msgid ""
4756 "struct timespec {\n"
4757 "    long    tv_sec;         /* seconds */\n"
4758 "    long    tv_nsec;        /* nanoseconds */\n"
4759 "};\n"
4760 msgstr ""
4761 "struct timespec {\n"
4762 "    long    tv_sec;         /* 秒 */\n"
4763 "    long    tv_nsec;        /* ナノ秒 */\n"
4764 "};\n"
4765
4766 #. type: Plain text
4767 #: build/C/man2/select.2:268
4768 msgid "(However, see below on the POSIX.1-2001 versions.)"
4769 msgstr ""
4770 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4771 "照)"
4772
4773 #. type: Plain text
4774 #: build/C/man2/select.2:276
4775 msgid ""
4776 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4777 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4778 "precision."
4779 msgstr ""
4780 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4781 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4782 "呼び出すという方法を使っているコードもある。"
4783
4784 #.  .PP - it is rumored that:
4785 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4786 #.  - it is certainly true that:
4787 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4788 #. type: Plain text
4789 #: build/C/man2/select.2:299
4790 msgid ""
4791 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4792 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4793 "either behavior.)  This causes problems both when Linux code which reads "
4794 "I<timeout> is ported to other operating systems, and when code is ported to "
4795 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4796 "without reinitializing it.  Consider I<timeout> to be undefined after "
4797 "B<select>()  returns."
4798 msgstr ""
4799 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4800 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4801 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4802 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4803 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4804 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4805 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4806 "ある。"
4807
4808 #. type: Plain text
4809 #: build/C/man2/select.2:317
4810 msgid ""
4811 "On success, B<select>()  and B<pselect>()  return the number of file "
4812 "descriptors contained in the three returned descriptor sets (that is, the "
4813 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4814 "which may be zero if the timeout expires before anything interesting "
4815 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4816 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4817 "undefined."
4818 msgstr ""
4819 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4820 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4821 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4822 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4823 "ならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディスクリ"
4824 "プタ集合は変更されず、 I<timeout> は不定となる。"
4825
4826 #. type: Plain text
4827 #: build/C/man2/select.2:323
4828 msgid ""
4829 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4830 "descriptor that was already closed, or one on which an error has occurred.)"
4831 msgstr ""
4832 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4833 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4834 "タが指定された)。"
4835
4836 #. type: Plain text
4837 #: build/C/man2/select.2:327
4838 msgid "A signal was caught; see B<signal>(7)."
4839 msgstr "シグナルを受信した。"
4840
4841 #. type: Plain text
4842 #: build/C/man2/select.2:333
4843 msgid ""
4844 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4845 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4846
4847 #. type: Plain text
4848 #: build/C/man2/select.2:336
4849 msgid "unable to allocate memory for internal tables."
4850 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4851
4852 #. type: Plain text
4853 #: build/C/man2/select.2:342
4854 msgid ""
4855 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4856 "()  was emulated in glibc (but see BUGS)."
4857 msgstr ""
4858 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4859 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4860
4861 #. type: Plain text
4862 #: build/C/man2/select.2:353
4863 msgid ""
4864 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4865 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4866 "clones of the BSD socket layer (including System V variants).  However, note "
4867 "that the System V variant typically sets the timeout variable before exit, "
4868 "but the BSD variant does not."
4869 msgstr ""
4870 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4871 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4872 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4873 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4874 "ること。"
4875
4876 #. type: Plain text
4877 #: build/C/man2/select.2:357
4878 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4879 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4880
4881 #. type: Plain text
4882 #: build/C/man2/select.2:374
4883 msgid ""
4884 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4885 "with a value of I<fd> that is negative or is equal to or larger than "
4886 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4887 "I<fd> to be a valid file descriptor."
4888 msgstr ""
4889 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4890 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4891 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4892 "プタでなければならないと規定されている。"
4893
4894 #. type: Plain text
4895 #: build/C/man2/select.2:383
4896 msgid ""
4897 "Concerning the types involved, the classical situation is that the two "
4898 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4899 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4900 "situation is"
4901 msgstr ""
4902 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4903 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4904 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4905
4906 #. type: Plain text
4907 #: build/C/man2/select.2:390
4908 #, no-wrap
4909 msgid ""
4910 "struct timeval {\n"
4911 "    time_t         tv_sec;     /* seconds */\n"
4912 "    suseconds_t    tv_usec;    /* microseconds */\n"
4913 "};\n"
4914 msgstr ""
4915 "struct timeval {\n"
4916 "\t time_t         tv_sec;     /* 秒 */\n"
4917 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4918 "};\n"
4919
4920 #. type: Plain text
4921 #: build/C/man2/select.2:401
4922 msgid ""
4923 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4924 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4925 msgstr ""
4926 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4927 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4928
4929 #. type: Plain text
4930 #: build/C/man2/select.2:413
4931 msgid ""
4932 "Concerning prototypes, the classical situation is that one should include "
4933 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4934 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4935 msgstr ""
4936 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4937 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4938 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4939 "インクルードすればよい。"
4940
4941 #. type: Plain text
4942 #: build/C/man2/select.2:425
4943 msgid ""
4944 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4945 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4946 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4947 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4948 "requirements are as shown in the SYNOPSIS."
4949 msgstr ""
4950 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4951 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4952 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4953 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4954 "使用するには、「書式」に記載された要件を満たす必要がある。"
4955
4956 #. type: SS
4957 #: build/C/man2/select.2:425
4958 #, no-wrap
4959 msgid "Multithreaded applications"
4960 msgstr "マルチスレッド・アプリケーション"
4961
4962 #. type: Plain text
4963 #: build/C/man2/select.2:441
4964 msgid ""
4965 "If a file descriptor being monitored by B<select>()  is closed in another "
4966 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
4967 "unblocks and returns, with an indication that the file descriptor is ready "
4968 "(a subsequent I/O operation will likely fail with an error, unless another "
4969 "the file descriptor reopened between the time B<select>()  returned and the "
4970 "I/O operations was performed).  On Linux (and some other systems), closing "
4971 "the file descriptor in another thread has no effect on B<select>().  In "
4972 "summary, any application that relies on a particular behavior in this "
4973 "scenario must be considered buggy."
4974 msgstr ""
4975 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
4976 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
4977 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
4978 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
4979 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
4980 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
4981 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
4982 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
4983 "ている」と考えなければならない。"
4984
4985 #. type: SS
4986 #: build/C/man2/select.2:441
4987 #, no-wrap
4988 msgid "Linux notes"
4989 msgstr "Linux での注意"
4990
4991 #. type: Plain text
4992 #: build/C/man2/select.2:449
4993 msgid ""
4994 "The B<pselect>()  interface described in this page is implemented by glibc.  "
4995 "The underlying Linux system call is named B<pselect6>().  This system call "
4996 "has somewhat different behavior from the glibc wrapper function."
4997 msgstr ""
4998 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
4999 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5000 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5001 "関数とは少し違った動作をする。"
5002
5003 #. type: Plain text
5004 #: build/C/man2/select.2:464
5005 msgid ""
5006 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5007 "However, the glibc wrapper function hides this behavior by using a local "
5008 "variable for the timeout argument that is passed to the system call.  Thus, "
5009 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5010 "this is the behavior required by POSIX.1-2001."
5011 msgstr ""
5012 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5013 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5014 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5015 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5016 "これが POSIX.1-2001 が要求している動作である。"
5017
5018 #. type: Plain text
5019 #: build/C/man2/select.2:470
5020 msgid ""
5021 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5022 "*> pointer, but is instead a structure of the form:"
5023 msgstr ""
5024 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5025 "ポインタではなく、以下に示す構造体である。"
5026
5027 #. type: Plain text
5028 #: build/C/man2/select.2:478
5029 #, no-wrap
5030 msgid ""
5031 "struct {\n"
5032 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5033 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5034 "                               to by 'ss' */\n"
5035 "};\n"
5036 msgstr ""
5037 "struct {\n"
5038 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
5039 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5040 "                               (バイト数) */\n"
5041 "};\n"
5042
5043 #. type: Plain text
5044 #: build/C/man2/select.2:485
5045 msgid ""
5046 "This allows the system call to obtain both a pointer to the signal set and "
5047 "its size, while allowing for the fact that most architectures support a "
5048 "maximum of 6 arguments to a system call."
5049 msgstr ""
5050 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5051 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5052 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5053 "のサイズの両方を取得することができるのである。"
5054
5055 #. type: Plain text
5056 #: build/C/man2/select.2:491
5057 msgid ""
5058 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5059 "argument."
5060 msgstr ""
5061 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5062 "されていた。"
5063
5064 #. type: Plain text
5065 #: build/C/man2/select.2:504
5066 msgid ""
5067 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5068 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5069 "implementation remained vulnerable to the very race condition that B<pselect>"
5070 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
5071 "B<pselect>()  system call on kernels where it is provided."
5072 msgstr ""
5073 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5074 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5075 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5076 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5077 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5078 "が使用される。"
5079
5080 #. type: Plain text
5081 #: build/C/man2/select.2:517
5082 msgid ""
5083 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5084 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5085 "signal handler writes a byte to a pipe whose other end is monitored by "
5086 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5087 "to a pipe that may be full or reading from a pipe that may be empty, "
5088 "nonblocking I/O is used when reading from and writing to the pipe.)"
5089 msgstr ""
5090 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5091 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5092 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5093 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5094 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5095 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5096 "(nonblocking) I/O を使用するとよい)。"
5097
5098 #.  Stevens discusses a case where accept can block after select
5099 #.  returns successfully because of an intervening RST from the client.
5100 #.  Maybe the kernel should have returned EIO in such a situation?
5101 #. type: Plain text
5102 #: build/C/man2/select.2:533
5103 msgid ""
5104 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5105 "reading\", while nevertheless a subsequent read blocks.  This could for "
5106 "example happen when data has arrived but upon examination has wrong checksum "
5107 "and is discarded.  There may be other circumstances in which a file "
5108 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5109 "B<O_NONBLOCK> on sockets that should not block."
5110 msgstr ""
5111 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
5112 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5113 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5114 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5115 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5116 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5117
5118 #. type: Plain text
5119 #: build/C/man2/select.2:548
5120 msgid ""
5121 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5122 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5123 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5124 "behavior, but the glibc wrapper hides this behavior by internally copying "
5125 "the I<timeout> to a local variable and passing that variable to the system "
5126 "call."
5127 msgstr ""
5128 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
5129 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5130 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5131 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5132 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5133 "数をシステムコールに渡している。"
5134
5135 #. type: Plain text
5136 #: build/C/man2/select.2:555
5137 #, no-wrap
5138 msgid ""
5139 "#include E<lt>stdio.hE<gt>\n"
5140 "#include E<lt>stdlib.hE<gt>\n"
5141 "#include E<lt>sys/time.hE<gt>\n"
5142 "#include E<lt>sys/types.hE<gt>\n"
5143 "#include E<lt>unistd.hE<gt>\n"
5144 msgstr ""
5145 "#include E<lt>stdio.hE<gt>\n"
5146 "#include E<lt>stdlib.hE<gt>\n"
5147 "#include E<lt>sys/time.hE<gt>\n"
5148 "#include E<lt>sys/types.hE<gt>\n"
5149 "#include E<lt>unistd.hE<gt>\n"
5150
5151 #. type: Plain text
5152 #: build/C/man2/select.2:562
5153 #, no-wrap
5154 msgid ""
5155 "int\n"
5156 "main(void)\n"
5157 "{\n"
5158 "    fd_set rfds;\n"
5159 "    struct timeval tv;\n"
5160 "    int retval;\n"
5161 msgstr ""
5162 "int\n"
5163 "main(void)\n"
5164 "{\n"
5165 "    fd_set rfds;\n"
5166 "    struct timeval tv;\n"
5167 "    int retval;\n"
5168
5169 #. type: Plain text
5170 #: build/C/man2/select.2:566
5171 #, no-wrap
5172 msgid ""
5173 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5174 "    FD_ZERO(&rfds);\n"
5175 "    FD_SET(0, &rfds);\n"
5176 msgstr ""
5177 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5178 "    FD_ZERO(&rfds);\n"
5179 "    FD_SET(0, &rfds);\n"
5180
5181 #. type: Plain text
5182 #: build/C/man2/select.2:570
5183 #, no-wrap
5184 msgid ""
5185 "    /* Wait up to five seconds. */\n"
5186 "    tv.tv_sec = 5;\n"
5187 "    tv.tv_usec = 0;\n"
5188 msgstr ""
5189 "    /* 5 秒間監視する。*/\n"
5190 "    tv.tv_sec = 5;\n"
5191 "    tv.tv_usec = 0;\n"
5192
5193 #. type: Plain text
5194 #: build/C/man2/select.2:573
5195 #, no-wrap
5196 msgid ""
5197 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5198 "    /* Don't rely on the value of tv now! */\n"
5199 msgstr ""
5200 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5201 "    /* この時点での tv の値を信頼してはならない。*/\n"
5202
5203 #. type: Plain text
5204 #: build/C/man2/select.2:581
5205 #, no-wrap
5206 msgid ""
5207 "    if (retval == -1)\n"
5208 "        perror(\"select()\");\n"
5209 "    else if (retval)\n"
5210 "        printf(\"Data is available now.\\en\");\n"
5211 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5212 "    else\n"
5213 "        printf(\"No data within five seconds.\\en\");\n"
5214 msgstr ""
5215 "    if (retval == -1)\n"
5216 "\tperror(\"select()\");\n"
5217 "    else if (retval)\n"
5218 "        printf(\"今、データが取得できました。\\en\");\n"
5219 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5220 "    else\n"
5221 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5222
5223 #. type: Plain text
5224 #: build/C/man2/select.2:596
5225 msgid ""
5226 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5227 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5228 msgstr ""
5229 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5230 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5231
5232 #. type: Plain text
5233 #: build/C/man2/select.2:599
5234 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5235 msgstr ""
5236 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5237
5238 #. type: TH
5239 #: build/C/man2/select_tut.2:32
5240 #, no-wrap
5241 msgid "SELECT_TUT"
5242 msgstr "SELECT_TUT"
5243
5244 #. type: TH
5245 #: build/C/man2/select_tut.2:32
5246 #, no-wrap
5247 msgid "2013-12-30"
5248 msgstr "2013-12-30"
5249
5250 #. type: Plain text
5251 #: build/C/man2/select_tut.2:52
5252 #, no-wrap
5253 msgid ""
5254 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5255 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5256 msgstr ""
5257 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5258 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5259
5260 #. type: Plain text
5261 #: build/C/man2/select_tut.2:66
5262 #, no-wrap
5263 msgid ""
5264 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5265 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5266 "B<            const sigset_t *>I<sigmask>B<);>\n"
5267 msgstr ""
5268 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5269 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5270 "B<            const sigset_t *>I<sigmask>B<);>\n"
5271
5272 #. type: Plain text
5273 #: build/C/man2/select_tut.2:83
5274 msgid ""
5275 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5276 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5277 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5278 "occurred on any of the descriptors."
5279 msgstr ""
5280 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5281 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5282 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5283 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5284 "る。"
5285
5286 #. type: Plain text
5287 #: build/C/man2/select_tut.2:108
5288 msgid ""
5289 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5290 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5291 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5292 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5293 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5294 "according to the rules described below; after calling B<select>()  you can "
5295 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5296 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5297 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5298 "descriptor from a set."
5299 msgstr ""
5300 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5301 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5302 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5303 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5304 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5305 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5306 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5307 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5308 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5309 "のファイルディスクリプタの削除を行う。"
5310
5311 #. type: SS
5312 #: build/C/man2/select_tut.2:108
5313 #, no-wrap
5314 msgid "Arguments"
5315 msgstr "引き数"
5316
5317 #. type: TP
5318 #: build/C/man2/select_tut.2:109
5319 #, no-wrap
5320 msgid "I<readfds>"
5321 msgstr "I<readfds>"
5322
5323 #. type: Plain text
5324 #: build/C/man2/select_tut.2:118
5325 msgid ""
5326 "This set is watched to see if data is available for reading from any of its "
5327 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5328 "cleared of all file descriptors except for those that are immediately "
5329 "available for reading."
5330 msgstr ""
5331 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5332 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5333 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5334
5335 #. type: TP
5336 #: build/C/man2/select_tut.2:118
5337 #, no-wrap
5338 msgid "I<writefds>"
5339 msgstr "I<writefds>"
5340
5341 #. type: Plain text
5342 #: build/C/man2/select_tut.2:127
5343 msgid ""
5344 "This set is watched to see if there is space to write data to any of its "
5345 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5346 "cleared of all file descriptors except for those that are immediately "
5347 "available for writing."
5348 msgstr ""
5349 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5350 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5351 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5352
5353 #. type: TP
5354 #: build/C/man2/select_tut.2:127
5355 #, no-wrap
5356 msgid "I<exceptfds>"
5357 msgstr "I<exceptfds>"
5358
5359 #. type: Plain text
5360 #: build/C/man2/select_tut.2:149
5361 msgid ""
5362 "This set is watched for \"exceptional conditions\".  In practice, only one "
5363 "such exceptional condition is common: the availability of I<out-of-band> "
5364 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5365 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5366 "where B<select>(2)  indicates an exceptional condition occurs with "
5367 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5368 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5369 "for those for which an exceptional condition has occurred."
5370 msgstr ""
5371 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5372 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5373 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5374 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5375 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5376 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5377 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5378 "状態が発生したディスクリプタ以外は集合から削除される。"
5379
5380 #. type: TP
5381 #: build/C/man2/select_tut.2:149
5382 #, no-wrap
5383 msgid "I<nfds>"
5384 msgstr "I<nfds>"
5385
5386 #. type: Plain text
5387 #: build/C/man2/select_tut.2:156
5388 msgid ""
5389 "This is an integer one more than the maximum of any file descriptor in any "
5390 "of the sets.  In other words, while adding file descriptors to each of the "
5391 "sets, you must calculate the maximum integer value of all of them, then "
5392 "increment this value by one, and then pass this as I<nfds>."
5393 msgstr ""
5394 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5395 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5396 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5397 "I<nfds> として渡さないといけない、ということだ。"
5398
5399 #. type: TP
5400 #: build/C/man2/select_tut.2:156
5401 #, no-wrap
5402 msgid "I<utimeout>"
5403 msgstr "I<utimeout>"
5404
5405 #. type: Plain text
5406 #: build/C/man2/select_tut.2:169
5407 msgid ""
5408 "This is the longest time B<select>()  may wait before returning, even if "
5409 "nothing interesting happened.  If this value is passed as NULL, then "
5410 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5411 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5412 "return immediately, with information about the readiness of file descriptors "
5413 "at the time of the call.  The structure I<struct timeval> is defined as:"
5414 msgstr ""
5415 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5416 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5417 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5418 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5419 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5420 "ように定義されている:"
5421
5422 #. type: Plain text
5423 #: build/C/man2/select_tut.2:176
5424 #, no-wrap
5425 msgid ""
5426 "struct timeval {\n"
5427 "    time_t tv_sec;    /* seconds */\n"
5428 "    long tv_usec;     /* microseconds */\n"
5429 "};\n"
5430 msgstr ""
5431 "struct timeval {\n"
5432 "    time_t tv_sec;    /* seconds */\n"
5433 "    long tv_usec;     /* microseconds */\n"
5434 "};\n"
5435
5436 #. type: TP
5437 #: build/C/man2/select_tut.2:178
5438 #, no-wrap
5439 msgid "I<ntimeout>"
5440 msgstr "I<ntimeout>"
5441
5442 #. type: Plain text
5443 #: build/C/man2/select_tut.2:187
5444 msgid ""
5445 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5446 "I<struct timespec> has nanosecond precision as follows:"
5447 msgstr ""
5448 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5449 "timespec> は次に示すようにナノ秒の精度を持つ。"
5450
5451 #. type: Plain text
5452 #: build/C/man2/select_tut.2:194
5453 #, no-wrap
5454 msgid ""
5455 "struct timespec {\n"
5456 "    long tv_sec;    /* seconds */\n"
5457 "    long tv_nsec;   /* nanoseconds */\n"
5458 "};\n"
5459 msgstr ""
5460 "struct timespec {\n"
5461 "    long tv_sec;    /* seconds */\n"
5462 "    long tv_nsec;   /* nanoseconds */\n"
5463 "};\n"
5464
5465 #. type: TP
5466 #: build/C/man2/select_tut.2:196
5467 #, no-wrap
5468 msgid "I<sigmask>"
5469 msgstr "I<sigmask>"
5470
5471 #. type: Plain text
5472 #: build/C/man2/select_tut.2:213
5473 msgid ""
5474 "This argument holds a set of signals that the kernel should unblock (i.e., "
5475 "remove from the signal mask of the calling thread), while the caller is "
5476 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5477 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5478 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
5479 "()  will then behave just like B<select>()."
5480 msgstr ""
5481 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5482 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5483 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5484 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5485 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
5486 "()  と全く同じ動作となる。"
5487
5488 #. type: SS
5489 #: build/C/man2/select_tut.2:213
5490 #, no-wrap
5491 msgid "Combining signal and data events"
5492 msgstr "シグナルとデータイベントを組み合わせる"
5493
5494 #. type: Plain text
5495 #: build/C/man2/select_tut.2:257
5496 msgid ""
5497 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5498 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5499 "normally use the signal handler only to raise a global flag.  The global "
5500 "flag will indicate that the event must be processed in the main loop of the "
5501 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5502 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5503 "signals can be processed in the main loop of the program, otherwise B<select>"
5504 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
5505 "conditional to check the global flag.  So we must ask: what if a signal "
5506 "arrives after the conditional, but before the B<select>()  call? The answer "
5507 "is that B<select>()  would block indefinitely, even though an event is "
5508 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5509 "This call can be used to set the signal mask to a set of signals that are "
5510 "only to be received within the B<pselect>()  call.  For instance, let us say "
5511 "that the event in question was the exit of a child process.  Before the "
5512 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5513 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5514 "mask.  Our program would look like:"
5515 msgstr ""
5516 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5517 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5518 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5519 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5520 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5521 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5522 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5523 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5524 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5525 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5526 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5527 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5528 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5529 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5530 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5531 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5532 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5533 "る。"
5534
5535 #. type: Plain text
5536 #: build/C/man2/select_tut.2:260
5537 #, no-wrap
5538 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5539 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5540
5541 #. type: Plain text
5542 #: build/C/man2/select_tut.2:266
5543 #, no-wrap
5544 msgid ""
5545 "static void\n"
5546 "child_sig_handler(int sig)\n"
5547 "{\n"
5548 "    got_SIGCHLD = 1;\n"
5549 "}\n"
5550 msgstr ""
5551 "static void\n"
5552 "child_sig_handler(int sig)\n"
5553 "{\n"
5554 "    got_SIGCHLD = 1;\n"
5555 "}\n"
5556
5557 #. type: Plain text
5558 #: build/C/man2/select_tut.2:274
5559 #, no-wrap
5560 msgid ""
5561 "int\n"
5562 "main(int argc, char *argv[])\n"
5563 "{\n"
5564 "    sigset_t sigmask, empty_mask;\n"
5565 "    struct sigaction sa;\n"
5566 "    fd_set readfds, writefds, exceptfds;\n"
5567 "    int r;\n"
5568 msgstr ""
5569 "int\n"
5570 "main(int argc, char *argv[])\n"
5571 "{\n"
5572 "    sigset_t sigmask, empty_mask;\n"
5573 "    struct sigaction sa;\n"
5574 "    fd_set readfds, writefds, exceptfds;\n"
5575 "    int r;\n"
5576
5577 #. type: Plain text
5578 #: build/C/man2/select_tut.2:281
5579 #, no-wrap
5580 msgid ""
5581 "    sigemptyset(&sigmask);\n"
5582 "    sigaddset(&sigmask, SIGCHLD);\n"
5583 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5584 "        perror(\"sigprocmask\");\n"
5585 "        exit(EXIT_FAILURE);\n"
5586 "    }\n"
5587 msgstr ""
5588 "    sigemptyset(&sigmask);\n"
5589 "    sigaddset(&sigmask, SIGCHLD);\n"
5590 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5591 "        perror(\"sigprocmask\");\n"
5592 "        exit(EXIT_FAILURE);\n"
5593 "    }\n"
5594
5595 #. type: Plain text
5596 #: build/C/man2/select_tut.2:289
5597 #, no-wrap
5598 msgid ""
5599 "    sa.sa_flags = 0;\n"
5600 "    sa.sa_handler = child_sig_handler;\n"
5601 "    sigemptyset(&sa.sa_mask);\n"
5602 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5603 "        perror(\"sigaction\");\n"
5604 "        exit(EXIT_FAILURE);\n"
5605 "    }\n"
5606 msgstr ""
5607 "    sa.sa_flags = 0;\n"
5608 "    sa.sa_handler = child_sig_handler;\n"
5609 "    sigemptyset(&sa.sa_mask);\n"
5610 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5611 "        perror(\"sigaction\");\n"
5612 "        exit(EXIT_FAILURE);\n"
5613 "    }\n"
5614
5615 #. type: Plain text
5616 #: build/C/man2/select_tut.2:291
5617 #, no-wrap
5618 msgid "    sigemptyset(&empty_mask);\n"
5619 msgstr "    sigemptyset(&empty_mask);\n"
5620
5621 #. type: Plain text
5622 #: build/C/man2/select_tut.2:295
5623 #, no-wrap
5624 msgid ""
5625 "    for (;;) {          /* main loop */\n"
5626 "        /* Initialize readfds, writefds, and exceptfds\n"
5627 "           before the pselect() call. (Code omitted.) */\n"
5628 msgstr ""
5629 "    for (;;) {          /* main loop */\n"
5630 "        /* Initialize readfds, writefds, and exceptfds\n"
5631 "           before the pselect() call. (Code omitted.) */\n"
5632
5633 #. type: Plain text
5634 #: build/C/man2/select_tut.2:301
5635 #, no-wrap
5636 msgid ""
5637 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5638 "                    NULL, &empty_mask);\n"
5639 "        if (r == -1 && errno != EINTR) {\n"
5640 "            /* Handle error */\n"
5641 "        }\n"
5642 msgstr ""
5643 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5644 "                    NULL, &empty_mask);\n"
5645 "        if (r == -1 && errno != EINTR) {\n"
5646 "            /* Handle error */\n"
5647 "        }\n"
5648
5649 #. type: Plain text
5650 #: build/C/man2/select_tut.2:304
5651 #, no-wrap
5652 msgid ""
5653 "        if (got_SIGCHLD) {\n"
5654 "            got_SIGCHLD = 0;\n"
5655 msgstr ""
5656 "        if (got_SIGCHLD) {\n"
5657 "            got_SIGCHLD = 0;\n"
5658
5659 #. type: Plain text
5660 #: build/C/man2/select_tut.2:308
5661 #, no-wrap
5662 msgid ""
5663 "            /* Handle signalled event here; e.g., wait() for all\n"
5664 "               terminated children. (Code omitted.) */\n"
5665 "        }\n"
5666 msgstr ""
5667 "            /* Handle signalled event here; e.g., wait() for all\n"
5668 "               terminated children. (Code omitted.) */\n"
5669 "        }\n"
5670
5671 #. type: Plain text
5672 #: build/C/man2/select_tut.2:312
5673 #, no-wrap
5674 msgid ""
5675 "        /* main body of program */\n"
5676 "    }\n"
5677 "}\n"
5678 msgstr ""
5679 "        /* main body of program */\n"
5680 "    }\n"
5681 "}\n"
5682
5683 #. type: SS
5684 #: build/C/man2/select_tut.2:313
5685 #, no-wrap
5686 msgid "Practical"
5687 msgstr "実例"
5688
5689 #. type: Plain text
5690 #: build/C/man2/select_tut.2:334
5691 msgid ""
5692 "So what is the point of B<select>()? Can't I just read and write to my "
5693 "descriptors whenever I want? The point of B<select>()  is that it watches "
5694 "multiple descriptors at the same time and properly puts the process to sleep "
5695 "if there is no activity.  UNIX programmers often find themselves in a "
5696 "position where they have to handle I/O from more than one file descriptor "
5697 "where the data flow may be intermittent.  If you were to merely create a "
5698 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5699 "your calls may block waiting for data from/to a file descriptor, while "
5700 "another file descriptor is unused though ready for I/O.  B<select>()  "
5701 "efficiently copes with this situation."
5702 msgstr ""
5703 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5704 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5705 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5706 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5707 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5708 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5709 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5710 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5711 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5712
5713 #. type: SS
5714 #: build/C/man2/select_tut.2:334
5715 #, no-wrap
5716 msgid "Select law"
5717 msgstr "SELECT の掟"
5718
5719 #. type: Plain text
5720 #: build/C/man2/select_tut.2:347
5721 msgid ""
5722 "Many people who try to use B<select>()  come across behavior that is "
5723 "difficult to understand and produces nonportable or borderline results.  For "
5724 "instance, the above program is carefully written not to block at any point, "
5725 "even though it does not set its file descriptors to nonblocking mode.  It is "
5726 "easy to introduce subtle errors that will remove the advantage of using "
5727 "B<select>(), so here is a list of essentials to watch for when using "
5728 "B<select>()."
5729 msgstr ""
5730 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5731 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5732 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5733 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5734 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5735 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5736 "ことにする。"
5737
5738 #. type: Plain text
5739 #: build/C/man2/select_tut.2:356
5740 msgid ""
5741 "You should always try to use B<select>()  without a timeout.  Your program "
5742 "should have nothing to do if there is no data available.  Code that depends "
5743 "on timeouts is not usually portable and is difficult to debug."
5744 msgstr ""
5745 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5746 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5747 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5748
5749 #. type: Plain text
5750 #: build/C/man2/select_tut.2:360
5751 msgid ""
5752 "The value I<nfds> must be properly calculated for efficiency as explained "
5753 "above."
5754 msgstr ""
5755 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5756 "えなければならない。"
5757
5758 #. type: Plain text
5759 #: build/C/man2/select_tut.2:367
5760 msgid ""
5761 "No file descriptor must be added to any set if you do not intend to check "
5762 "its result after the B<select>()  call, and respond appropriately.  See next "
5763 "rule."
5764 msgstr ""
5765 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5766 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5767
5768 #. type: Plain text
5769 #: build/C/man2/select_tut.2:373
5770 msgid ""
5771 "After B<select>()  returns, all file descriptors in all sets should be "
5772 "checked to see if they are ready."
5773 msgstr ""
5774 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5775 "て 読み書き可能な状態になっているかをチェックすべきである。"
5776
5777 #. type: TP
5778 #: build/C/man2/select_tut.2:373
5779 #, no-wrap
5780 msgid "5."
5781 msgstr "5."
5782
5783 #. type: Plain text
5784 #: build/C/man2/select_tut.2:388
5785 msgid ""
5786 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5787 "necessarily read/write the full amount of data that you have requested.  If "
5788 "they do read/write the full amount, it's because you have a low traffic load "
5789 "and a fast stream.  This is not always going to be the case.  You should "
5790 "cope with the case of your functions managing to send or receive only a "
5791 "single byte."
5792 msgstr ""
5793 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5794 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5795 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5796 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5797 "うな場合も 考慮に入れてやらなければならない。"
5798
5799 #. type: TP
5800 #: build/C/man2/select_tut.2:388
5801 #, no-wrap
5802 msgid "6."
5803 msgstr "6."
5804
5805 #. type: Plain text
5806 #: build/C/man2/select_tut.2:396
5807 msgid ""
5808 "Never read/write only in single bytes at a time unless you are really sure "
5809 "that you have a small amount of data to process.  It is extremely "
5810 "inefficient not to read/write as much data as you can buffer each time.  The "
5811 "buffers in the example below are 1024 bytes although they could easily be "
5812 "made larger."
5813 msgstr ""
5814 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5815 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5816 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5817 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5818
5819 #. type: TP
5820 #: build/C/man2/select_tut.2:396
5821 #, no-wrap
5822 msgid "7."
5823 msgstr "7."
5824
5825 #.  Nonetheless, you should still cope with these errors for completeness.
5826 #. type: Plain text
5827 #: build/C/man2/select_tut.2:418
5828 msgid ""
5829 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5830 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5831 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5832 "properly managed (not done properly above).  If your program is not going to "
5833 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5834 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5835 msgstr ""
5836 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5837 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5838 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5839 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5840 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5841 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5842
5843 #. type: TP
5844 #: build/C/man2/select_tut.2:418
5845 #, no-wrap
5846 msgid "8."
5847 msgstr "8."
5848
5849 #. type: Plain text
5850 #: build/C/man2/select_tut.2:427
5851 msgid ""
5852 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5853 "length of zero."
5854 msgstr ""
5855 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5856 "(2), B<send>(2)  を呼び出してはならない。"
5857
5858 #. type: TP
5859 #: build/C/man2/select_tut.2:427
5860 #, no-wrap
5861 msgid "9."
5862 msgstr "9."
5863
5864 #. type: Plain text
5865 #: build/C/man2/select_tut.2:443
5866 msgid ""
5867 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5868 "with errors other than those listed in B<7.>, or one of the input functions "
5869 "returns 0, indicating end of file, then you should I<not> pass that "
5870 "descriptor to B<select>()  again.  In the example below, I close the "
5871 "descriptor immediately, and then set it to -1 to prevent it being included "
5872 "in a set."
5873 msgstr ""
5874 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5875 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5876 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5877 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5878 "が集合に含まれ続けるのを許さないようにしている。"
5879
5880 #. type: TP
5881 #: build/C/man2/select_tut.2:443
5882 #, no-wrap
5883 msgid "10."
5884 msgstr "10."
5885
5886 #. type: Plain text
5887 #: build/C/man2/select_tut.2:450
5888 msgid ""
5889 "The timeout value must be initialized with each new call to B<select>(), "
5890 "since some operating systems modify the structure.  B<pselect>()  however "
5891 "does not modify its timeout structure."
5892 msgstr ""
5893 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5894 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5895 "分の timeout 構造体を変更することはない。"
5896
5897 #. type: TP
5898 #: build/C/man2/select_tut.2:450
5899 #, no-wrap
5900 msgid "11."
5901 msgstr "11."
5902
5903 #.  "I have heard" does not fill me with confidence, and doesn't
5904 #.  belong in a man page, so I've commented this point out.
5905 #.  .TP
5906 #.  11.
5907 #.  I have heard that the Windows socket layer does not cope with OOB data
5908 #.  properly.
5909 #.  It also does not cope with
5910 #.  .BR select ()
5911 #.  calls when no file descriptors are set at all.
5912 #.  Having no file descriptors set is a useful
5913 #.  way to sleep the process with subsecond precision by using the timeout.
5914 #.  (See further on.)
5915 #. type: Plain text
5916 #: build/C/man2/select_tut.2:469
5917 msgid ""
5918 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5919 "used in a loop, then the sets must be reinitialized before each call."
5920 msgstr ""
5921 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5922 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5923 "期化し直さなければならない。"
5924
5925 #. type: SS
5926 #: build/C/man2/select_tut.2:469
5927 #, no-wrap
5928 msgid "Usleep emulation"
5929 msgstr "usleep エミュレーション"
5930
5931 #. type: Plain text
5932 #: build/C/man2/select_tut.2:476
5933 msgid ""
5934 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5935 "()  with a finite timeout and no file descriptors as follows:"
5936 msgstr ""
5937 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5938 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5939 "できる。 以下のようにする。"
5940
5941 #. type: Plain text
5942 #: build/C/man2/select_tut.2:482
5943 #, no-wrap
5944 msgid ""
5945 "    struct timeval tv;\n"
5946 "    tv.tv_sec = 0;\n"
5947 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5948 "    select(0, NULL, NULL, NULL, &tv);\n"
5949 msgstr ""
5950 "    struct timeval tv;\n"
5951 "    tv.tv_sec = 0;\n"
5952 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5953 "    select(0, NULL, NULL, NULL, &tv);\n"
5954
5955 #. type: Plain text
5956 #: build/C/man2/select_tut.2:485
5957 msgid "This is guaranteed to work only on UNIX systems, however."
5958 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5959
5960 #. type: Plain text
5961 #: build/C/man2/select_tut.2:490
5962 msgid ""
5963 "On success, B<select>()  returns the total number of file descriptors still "
5964 "present in the file descriptor sets."
5965 msgstr ""
5966 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5967 "ディスクリプタの総数を返す。"
5968
5969 #. type: Plain text
5970 #: build/C/man2/select_tut.2:496
5971 msgid ""
5972 "If B<select>()  timed out, then the return value will be zero.  The file "
5973 "descriptors set should be all empty (but may not be on some systems)."
5974 msgstr ""
5975 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5976 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5977
5978 #. type: Plain text
5979 #: build/C/man2/select_tut.2:503
5980 msgid ""
5981 "A return value of -1 indicates an error, with I<errno> being set "
5982 "appropriately.  In the case of an error, the contents of the returned sets "
5983 "and the I<struct timeout> contents are undefined and should not be used.  "
5984 "B<pselect>()  however never modifies I<ntimeout>."
5985 msgstr ""
5986 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5987 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5988 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5989 "変更しない。"
5990
5991 #. type: Plain text
5992 #: build/C/man2/select_tut.2:512
5993 msgid ""
5994 "Generally speaking, all operating systems that support sockets also support "
5995 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5996 "and efficient way that naive programmers try to solve in a more complicated "
5997 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5998 msgstr ""
5999 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6000 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6001 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6002 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6003
6004 #. type: Plain text
6005 #: build/C/man2/select_tut.2:521
6006 msgid ""
6007 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6008 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6009 "is nowadays widely available, but historically was less portable than "
6010 "B<select>()."
6011 msgstr ""
6012 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6013 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6014 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6015
6016 #. type: Plain text
6017 #: build/C/man2/select_tut.2:529
6018 msgid ""
6019 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6020 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6021 "of file descriptors."
6022 msgstr ""
6023 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
6024 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
6025
6026 #. type: Plain text
6027 #: build/C/man2/select_tut.2:534
6028 msgid ""
6029 "Here is an example that better demonstrates the true utility of B<select>"
6030 "().  The listing below is a TCP forwarding program that forwards from one "
6031 "TCP port to another."
6032 msgstr ""
6033 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6034 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6035
6036 #. type: Plain text
6037 #: build/C/man2/select_tut.2:547
6038 #, no-wrap
6039 msgid ""
6040 "#include E<lt>stdlib.hE<gt>\n"
6041 "#include E<lt>stdio.hE<gt>\n"
6042 "#include E<lt>unistd.hE<gt>\n"
6043 "#include E<lt>sys/time.hE<gt>\n"
6044 "#include E<lt>sys/types.hE<gt>\n"
6045 "#include E<lt>string.hE<gt>\n"
6046 "#include E<lt>signal.hE<gt>\n"
6047 "#include E<lt>sys/socket.hE<gt>\n"
6048 "#include E<lt>netinet/in.hE<gt>\n"
6049 "#include E<lt>arpa/inet.hE<gt>\n"
6050 "#include E<lt>errno.hE<gt>\n"
6051 msgstr ""
6052 "#include E<lt>stdlib.hE<gt>\n"
6053 "#include E<lt>stdio.hE<gt>\n"
6054 "#include E<lt>unistd.hE<gt>\n"
6055 "#include E<lt>sys/time.hE<gt>\n"
6056 "#include E<lt>sys/types.hE<gt>\n"
6057 "#include E<lt>string.hE<gt>\n"
6058 "#include E<lt>signal.hE<gt>\n"
6059 "#include E<lt>sys/socket.hE<gt>\n"
6060 "#include E<lt>netinet/in.hE<gt>\n"
6061 "#include E<lt>arpa/inet.hE<gt>\n"
6062 "#include E<lt>errno.hE<gt>\n"
6063
6064 #. type: Plain text
6065 #: build/C/man2/select_tut.2:549
6066 #, no-wrap
6067 msgid "static int forward_port;\n"
6068 msgstr "static int forward_port;\n"
6069
6070 #. type: Plain text
6071 #: build/C/man2/select_tut.2:552
6072 #, no-wrap
6073 msgid ""
6074 "#undef max\n"
6075 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6076 msgstr ""
6077 "#undef max\n"
6078 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6079
6080 #. type: Plain text
6081 #: build/C/man2/select_tut.2:559
6082 #, no-wrap
6083 msgid ""
6084 "static int\n"
6085 "listen_socket(int listen_port)\n"
6086 "{\n"
6087 "    struct sockaddr_in a;\n"
6088 "    int s;\n"
6089 "    int yes;\n"
6090 msgstr ""
6091 "static int\n"
6092 "listen_socket(int listen_port)\n"
6093 "{\n"
6094 "    struct sockaddr_in a;\n"
6095 "    int s;\n"
6096 "    int yes;\n"
6097
6098 #. type: Plain text
6099 #: build/C/man2/select_tut.2:584
6100 #, no-wrap
6101 msgid ""
6102 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6103 "    if (s == -1) {\n"
6104 "        perror(\"socket\");\n"
6105 "        return -1;\n"
6106 "    }\n"
6107 "    yes = 1;\n"
6108 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6109 "            &yes, sizeof(yes)) == -1) {\n"
6110 "        perror(\"setsockopt\");\n"
6111 "        close(s);\n"
6112 "        return -1;\n"
6113 "    }\n"
6114 "    memset(&a, 0, sizeof(a));\n"
6115 "    a.sin_port = htons(listen_port);\n"
6116 "    a.sin_family = AF_INET;\n"
6117 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6118 "        perror(\"bind\");\n"
6119 "        close(s);\n"
6120 "        return -1;\n"
6121 "    }\n"
6122 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6123 "    listen(s, 10);\n"
6124 "    return s;\n"
6125 "}\n"
6126 msgstr ""
6127 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6128 "        perror(\"socket\");\n"
6129 "        return -1;\n"
6130 "    }\n"
6131 "    yes = 1;\n"
6132 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6133 "            &yes, sizeof(yes)) == -1) {\n"
6134 "        perror(\"setsockopt\");\n"
6135 "        close(s);\n"
6136 "        return -1;\n"
6137 "    }\n"
6138 "    memset(&a, 0, sizeof(a));\n"
6139 "    a.sin_port = htons(listen_port);\n"
6140 "    a.sin_family = AF_INET;\n"
6141 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6142 "        perror(\"bind\");\n"
6143 "        close(s);\n"
6144 "        return -1;\n"
6145 "    }\n"
6146 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6147 "    listen(s, 10);\n"
6148 "    return s;\n"
6149 "}\n"
6150
6151 #. type: Plain text
6152 #: build/C/man2/select_tut.2:590
6153 #, no-wrap
6154 msgid ""
6155 "static int\n"
6156 "connect_socket(int connect_port, char *address)\n"
6157 "{\n"
6158 "    struct sockaddr_in a;\n"
6159 "    int s;\n"
6160 msgstr ""
6161 "static int\n"
6162 "connect_socket(int connect_port, char *address)\n"
6163 "{\n"
6164 "    struct sockaddr_in a;\n"
6165 "    int s;\n"
6166
6167 #. type: Plain text
6168 #: build/C/man2/select_tut.2:597
6169 #, no-wrap
6170 msgid ""
6171 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6172 "    if (s == -1) {\n"
6173 "        perror(\"socket\");\n"
6174 "        close(s);\n"
6175 "        return -1;\n"
6176 "    }\n"
6177 msgstr ""
6178 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6179 "    if (s == -1) {\n"
6180 "        perror(\"socket\");\n"
6181 "        close(s);\n"
6182 "        return -1;\n"
6183 "    }\n"
6184
6185 #. type: Plain text
6186 #: build/C/man2/select_tut.2:601
6187 #, no-wrap
6188 msgid ""
6189 "    memset(&a, 0, sizeof(a));\n"
6190 "    a.sin_port = htons(connect_port);\n"
6191 "    a.sin_family = AF_INET;\n"
6192 msgstr ""
6193 "    memset(&a, 0, sizeof(a));\n"
6194 "    a.sin_port = htons(connect_port);\n"
6195 "    a.sin_family = AF_INET;\n"
6196
6197 #. type: Plain text
6198 #: build/C/man2/select_tut.2:607
6199 #, no-wrap
6200 msgid ""
6201 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6202 "        perror(\"bad IP address format\");\n"
6203 "        close(s);\n"
6204 "        return -1;\n"
6205 "    }\n"
6206 msgstr ""
6207 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6208 "        perror(\"bad IP address format\");\n"
6209 "        close(s);\n"
6210 "        return -1;\n"
6211 "    }\n"
6212
6213 #. type: Plain text
6214 #: build/C/man2/select_tut.2:616
6215 #, no-wrap
6216 msgid ""
6217 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6218 "        perror(\"connect()\");\n"
6219 "        shutdown(s, SHUT_RDWR);\n"
6220 "        close(s);\n"
6221 "        return -1;\n"
6222 "    }\n"
6223 "    return s;\n"
6224 "}\n"
6225 msgstr ""
6226 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6227 "        perror(\"connect()\");\n"
6228 "        shutdown(s, SHUT_RDWR);\n"
6229 "        close(s);\n"
6230 "        return -1;\n"
6231 "    }\n"
6232 "    return s;\n"
6233 "}\n"
6234
6235 #. type: Plain text
6236 #: build/C/man2/select_tut.2:624
6237 #, no-wrap
6238 msgid ""
6239 "#define SHUT_FD1 do {                                \\e\n"
6240 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6241 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6242 "                         close(fd1);                 \\e\n"
6243 "                         fd1 = -1;                   \\e\n"
6244 "                     }                               \\e\n"
6245 "                 } while (0)\n"
6246 msgstr ""
6247 "#define SHUT_FD1 do {                                \\e\n"
6248 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6249 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6250 "                         close(fd1);                 \\e\n"
6251 "                         fd1 = -1;                   \\e\n"
6252 "                     }                               \\e\n"
6253 "                 } while (0)\n"
6254
6255 #. type: Plain text
6256 #: build/C/man2/select_tut.2:632
6257 #, no-wrap
6258 msgid ""
6259 "#define SHUT_FD2 do {                                \\e\n"
6260 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6261 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6262 "                         close(fd2);                 \\e\n"
6263 "                         fd2 = -1;                   \\e\n"
6264 "                     }                               \\e\n"
6265 "                 } while (0)\n"
6266 msgstr ""
6267 "#define SHUT_FD2 do {                                \\e\n"
6268 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6269 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6270 "                         close(fd2);                 \\e\n"
6271 "                         fd2 = -1;                   \\e\n"
6272 "                     }                               \\e\n"
6273 "                 } while (0)\n"
6274
6275 #. type: Plain text
6276 #: build/C/man2/select_tut.2:634
6277 #, no-wrap
6278 msgid "#define BUF_SIZE 1024\n"
6279 msgstr "#define BUF_SIZE 1024\n"
6280
6281 #. type: Plain text
6282 #: build/C/man2/select_tut.2:643
6283 #, no-wrap
6284 msgid ""
6285 "int\n"
6286 "main(int argc, char *argv[])\n"
6287 "{\n"
6288 "    int h;\n"
6289 "    int fd1 = -1, fd2 = -1;\n"
6290 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6291 "    int buf1_avail, buf1_written;\n"
6292 "    int buf2_avail, buf2_written;\n"
6293 msgstr ""
6294 "int\n"
6295 "main(int argc, char *argv[])\n"
6296 "{\n"
6297 "    int h;\n"
6298 "    int fd1 = -1, fd2 = -1;\n"
6299 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6300 "    int buf1_avail, buf1_written;\n"
6301 "    int buf2_avail, buf2_written;\n"
6302
6303 #. type: Plain text
6304 #: build/C/man2/select_tut.2:649
6305 #, no-wrap
6306 msgid ""
6307 "    if (argc != 4) {\n"
6308 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6309 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6310 "        exit(EXIT_FAILURE);\n"
6311 "    }\n"
6312 msgstr ""
6313 "    if (argc != 4) {\n"
6314 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6315 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6316 "        exit(EXIT_FAILURE);\n"
6317 "    }\n"
6318
6319 #. type: Plain text
6320 #: build/C/man2/select_tut.2:651
6321 #, no-wrap
6322 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6323 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6324
6325 #. type: Plain text
6326 #: build/C/man2/select_tut.2:653
6327 #, no-wrap
6328 msgid "    forward_port = atoi(argv[2]);\n"
6329 msgstr "    forward_port = atoi(argv[2]);\n"
6330
6331 #. type: Plain text
6332 #: build/C/man2/select_tut.2:657
6333 #, no-wrap
6334 msgid ""
6335 "    h = listen_socket(atoi(argv[1]));\n"
6336 "    if (h == -1)\n"
6337 "        exit(EXIT_FAILURE);\n"
6338 msgstr ""
6339 "    h = listen_socket(atoi(argv[1]));\n"
6340 "    if (h == -1)\n"
6341 "        exit(EXIT_FAILURE);\n"
6342
6343 #. type: Plain text
6344 #: build/C/man2/select_tut.2:661
6345 #, no-wrap
6346 msgid ""
6347 "    for (;;) {\n"
6348 "        int r, nfds = 0;\n"
6349 "        fd_set rd, wr, er;\n"
6350 msgstr ""
6351 "    for (;;) {\n"
6352 "        int r, nfds = 0;\n"
6353 "        fd_set rd, wr, er;\n"
6354
6355 #. type: Plain text
6356 #: build/C/man2/select_tut.2:691
6357 #, no-wrap
6358 msgid ""
6359 "        FD_ZERO(&rd);\n"
6360 "        FD_ZERO(&wr);\n"
6361 "        FD_ZERO(&er);\n"
6362 "        FD_SET(h, &rd);\n"
6363 "        nfds = max(nfds, h);\n"
6364 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6365 "            FD_SET(fd1, &rd);\n"
6366 "            nfds = max(nfds, fd1);\n"
6367 "        }\n"
6368 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6369 "            FD_SET(fd2, &rd);\n"
6370 "            nfds = max(nfds, fd2);\n"
6371 "        }\n"
6372 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6373 "            FD_SET(fd1, &wr);\n"
6374 "            nfds = max(nfds, fd1);\n"
6375 "        }\n"
6376 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6377 "            FD_SET(fd2, &wr);\n"
6378 "            nfds = max(nfds, fd2);\n"
6379 "        }\n"
6380 "        if (fd1 E<gt> 0) {\n"
6381 "            FD_SET(fd1, &er);\n"
6382 "            nfds = max(nfds, fd1);\n"
6383 "        }\n"
6384 "        if (fd2 E<gt> 0) {\n"
6385 "            FD_SET(fd2, &er);\n"
6386 "            nfds = max(nfds, fd2);\n"
6387 "        }\n"
6388 msgstr ""
6389 "        FD_ZERO(&rd);\n"
6390 "        FD_ZERO(&wr);\n"
6391 "        FD_ZERO(&er);\n"
6392 "        FD_SET(h, &rd);\n"
6393 "        nfds = max(nfds, h);\n"
6394 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6395 "            FD_SET(fd1, &rd);\n"
6396 "            nfds = max(nfds, fd1);\n"
6397 "        }\n"
6398 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6399 "            FD_SET(fd2, &rd);\n"
6400 "            nfds = max(nfds, fd2);\n"
6401 "        }\n"
6402 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6403 "            FD_SET(fd1, &wr);\n"
6404 "            nfds = max(nfds, fd1);\n"
6405 "        }\n"
6406 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6407 "            FD_SET(fd2, &wr);\n"
6408 "            nfds = max(nfds, fd2);\n"
6409 "        }\n"
6410 "        if (fd1 E<gt> 0) {\n"
6411 "            FD_SET(fd1, &er);\n"
6412 "            nfds = max(nfds, fd1);\n"
6413 "        }\n"
6414 "        if (fd2 E<gt> 0) {\n"
6415 "            FD_SET(fd2, &er);\n"
6416 "            nfds = max(nfds, fd2);\n"
6417 "        }\n"
6418
6419 #. type: Plain text
6420 #: build/C/man2/select_tut.2:693
6421 #, no-wrap
6422 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6423 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6424
6425 #. type: Plain text
6426 #: build/C/man2/select_tut.2:696
6427 #, no-wrap
6428 msgid ""
6429 "        if (r == -1 && errno == EINTR)\n"
6430 "            continue;\n"
6431 msgstr ""
6432 "        if (r == -1 && errno == EINTR)\n"
6433 "            continue;\n"
6434
6435 #. type: Plain text
6436 #: build/C/man2/select_tut.2:701
6437 #, no-wrap
6438 msgid ""
6439 "        if (r == -1) {\n"
6440 "            perror(\"select()\");\n"
6441 "            exit(EXIT_FAILURE);\n"
6442 "        }\n"
6443 msgstr ""
6444 "        if (r == -1) {\n"
6445 "            perror(\"select()\");\n"
6446 "            exit(EXIT_FAILURE);\n"
6447 "        }\n"
6448
6449 #. type: Plain text
6450 #: build/C/man2/select_tut.2:705
6451 #, no-wrap
6452 msgid ""
6453 "        if (FD_ISSET(h, &rd)) {\n"
6454 "            unsigned int l;\n"
6455 "            struct sockaddr_in client_address;\n"
6456 msgstr ""
6457 "        if (FD_ISSET(h, &rd)) {\n"
6458 "            unsigned int l;\n"
6459 "            struct sockaddr_in client_address;\n"
6460
6461 #. type: Plain text
6462 #: build/C/man2/select_tut.2:724
6463 #, no-wrap
6464 msgid ""
6465 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6466 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6467 "            if (r == -1) {\n"
6468 "                perror(\"accept()\");\n"
6469 "            } else {\n"
6470 "                SHUT_FD1;\n"
6471 "                SHUT_FD2;\n"
6472 "                buf1_avail = buf1_written = 0;\n"
6473 "                buf2_avail = buf2_written = 0;\n"
6474 "                fd1 = r;\n"
6475 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6476 "                if (fd2 == -1)\n"
6477 "                    SHUT_FD1;\n"
6478 "                else\n"
6479 "                    printf(\"connect from %s\\en\",\n"
6480 "                            inet_ntoa(client_address.sin_addr));\n"
6481 "            }\n"
6482 "        }\n"
6483 msgstr ""
6484 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6485 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6486 "            if (r == -1) {\n"
6487 "                perror(\"accept()\");\n"
6488 "            } else {\n"
6489 "                SHUT_FD1;\n"
6490 "                SHUT_FD2;\n"
6491 "                buf1_avail = buf1_written = 0;\n"
6492 "                buf2_avail = buf2_written = 0;\n"
6493 "                fd1 = r;\n"
6494 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6495 "                if (fd2 == -1)\n"
6496 "                    SHUT_FD1;\n"
6497 "                else\n"
6498 "                    printf(\"connect from %s\\en\",\n"
6499 "                            inet_ntoa(client_address.sin_addr));\n"
6500 "            }\n"
6501 "        }\n"
6502
6503 #. type: Plain text
6504 #: build/C/man2/select_tut.2:726
6505 #, no-wrap
6506 msgid "        /* NB: read oob data before normal reads */\n"
6507 msgstr "        /* NB: read oob data before normal reads */\n"
6508
6509 #. type: Plain text
6510 #: build/C/man2/select_tut.2:730
6511 #, no-wrap
6512 msgid ""
6513 "        if (fd1 E<gt> 0)\n"
6514 "            if (FD_ISSET(fd1, &er)) {\n"
6515 "                char c;\n"
6516 msgstr ""
6517 "        if (fd1 E<gt> 0)\n"
6518 "            if (FD_ISSET(fd1, &er)) {\n"
6519 "                char c;\n"
6520
6521 #. type: Plain text
6522 #: build/C/man2/select_tut.2:740
6523 #, no-wrap
6524 msgid ""
6525 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6526 "                if (r E<lt> 1)\n"
6527 "                    SHUT_FD1;\n"
6528 "                else\n"
6529 "                    send(fd2, &c, 1, MSG_OOB);\n"
6530 "            }\n"
6531 "        if (fd2 E<gt> 0)\n"
6532 "            if (FD_ISSET(fd2, &er)) {\n"
6533 "                char c;\n"
6534 msgstr ""
6535 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6536 "                if (r E<lt> 1)\n"
6537 "                    SHUT_FD1;\n"
6538 "                else\n"
6539 "                    send(fd2, &c, 1, MSG_OOB);\n"
6540 "            }\n"
6541 "        if (fd2 E<gt> 0)\n"
6542 "            if (FD_ISSET(fd2, &er)) {\n"
6543 "                char c;\n"
6544
6545 #. type: Plain text
6546 #: build/C/man2/select_tut.2:783
6547 #, no-wrap
6548 msgid ""
6549 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6550 "                if (r E<lt> 1)\n"
6551 "                    SHUT_FD2;\n"
6552 "                else\n"
6553 "                    send(fd1, &c, 1, MSG_OOB);\n"
6554 "            }\n"
6555 "        if (fd1 E<gt> 0)\n"
6556 "            if (FD_ISSET(fd1, &rd)) {\n"
6557 "                r = read(fd1, buf1 + buf1_avail,\n"
6558 "                          BUF_SIZE - buf1_avail);\n"
6559 "                if (r E<lt> 1)\n"
6560 "                    SHUT_FD1;\n"
6561 "                else\n"
6562 "                    buf1_avail += r;\n"
6563 "            }\n"
6564 "        if (fd2 E<gt> 0)\n"
6565 "            if (FD_ISSET(fd2, &rd)) {\n"
6566 "                r = read(fd2, buf2 + buf2_avail,\n"
6567 "                          BUF_SIZE - buf2_avail);\n"
6568 "                if (r E<lt> 1)\n"
6569 "                    SHUT_FD2;\n"
6570 "                else\n"
6571 "                    buf2_avail += r;\n"
6572 "            }\n"
6573 "        if (fd1 E<gt> 0)\n"
6574 "            if (FD_ISSET(fd1, &wr)) {\n"
6575 "                r = write(fd1, buf2 + buf2_written,\n"
6576 "                           buf2_avail - buf2_written);\n"
6577 "                if (r E<lt> 1)\n"
6578 "                    SHUT_FD1;\n"
6579 "                else\n"
6580 "                    buf2_written += r;\n"
6581 "            }\n"
6582 "        if (fd2 E<gt> 0)\n"
6583 "            if (FD_ISSET(fd2, &wr)) {\n"
6584 "                r = write(fd2, buf1 + buf1_written,\n"
6585 "                           buf1_avail - buf1_written);\n"
6586 "                if (r E<lt> 1)\n"
6587 "                    SHUT_FD2;\n"
6588 "                else\n"
6589 "                    buf1_written += r;\n"
6590 "            }\n"
6591 msgstr ""
6592 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6593 "                if (r E<lt> 1)\n"
6594 "                    SHUT_FD2;\n"
6595 "                else\n"
6596 "                    send(fd1, &c, 1, MSG_OOB);\n"
6597 "            }\n"
6598 "        if (fd1 E<gt> 0)\n"
6599 "            if (FD_ISSET(fd1, &rd)) {\n"
6600 "                r = read(fd1, buf1 + buf1_avail,\n"
6601 "                          BUF_SIZE - buf1_avail);\n"
6602 "                if (r E<lt> 1)\n"
6603 "                    SHUT_FD1;\n"
6604 "                else\n"
6605 "                    buf1_avail += r;\n"
6606 "            }\n"
6607 "        if (fd2 E<gt> 0)\n"
6608 "            if (FD_ISSET(fd2, &rd)) {\n"
6609 "                r = read(fd2, buf2 + buf2_avail,\n"
6610 "                          BUF_SIZE - buf2_avail);\n"
6611 "                if (r E<lt> 1)\n"
6612 "                    SHUT_FD2;\n"
6613 "                else\n"
6614 "                    buf2_avail += r;\n"
6615 "            }\n"
6616 "        if (fd1 E<gt> 0)\n"
6617 "            if (FD_ISSET(fd1, &wr)) {\n"
6618 "                r = write(fd1, buf2 + buf2_written,\n"
6619 "                           buf2_avail - buf2_written);\n"
6620 "                if (r E<lt> 1)\n"
6621 "                    SHUT_FD1;\n"
6622 "                else\n"
6623 "                    buf2_written += r;\n"
6624 "            }\n"
6625 "        if (fd2 E<gt> 0)\n"
6626 "            if (FD_ISSET(fd2, &wr)) {\n"
6627 "                r = write(fd2, buf1 + buf1_written,\n"
6628 "                           buf1_avail - buf1_written);\n"
6629 "                if (r E<lt> 1)\n"
6630 "                    SHUT_FD2;\n"
6631 "                else\n"
6632 "                    buf1_written += r;\n"
6633 "            }\n"
6634
6635 #. type: Plain text
6636 #: build/C/man2/select_tut.2:785
6637 #, no-wrap
6638 msgid "        /* check if write data has caught read data */\n"
6639 msgstr "        /* check if write data has caught read data */\n"
6640
6641 #. type: Plain text
6642 #: build/C/man2/select_tut.2:790
6643 #, no-wrap
6644 msgid ""
6645 "        if (buf1_written == buf1_avail)\n"
6646 "            buf1_written = buf1_avail = 0;\n"
6647 "        if (buf2_written == buf2_avail)\n"
6648 "            buf2_written = buf2_avail = 0;\n"
6649 msgstr ""
6650 "        if (buf1_written == buf1_avail)\n"
6651 "            buf1_written = buf1_avail = 0;\n"
6652 "        if (buf2_written == buf2_avail)\n"
6653 "            buf2_written = buf2_avail = 0;\n"
6654
6655 #. type: Plain text
6656 #: build/C/man2/select_tut.2:793
6657 #, no-wrap
6658 msgid ""
6659 "        /* one side has closed the connection, keep\n"
6660 "           writing to the other side until empty */\n"
6661 msgstr ""
6662 "        /* one side has closed the connection, keep\n"
6663 "           writing to the other side until empty */\n"
6664
6665 #. type: Plain text
6666 #: build/C/man2/select_tut.2:801
6667 #, no-wrap
6668 msgid ""
6669 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6670 "            SHUT_FD2;\n"
6671 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6672 "            SHUT_FD1;\n"
6673 "    }\n"
6674 "    exit(EXIT_SUCCESS);\n"
6675 "}\n"
6676 msgstr ""
6677 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6678 "            SHUT_FD2;\n"
6679 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6680 "            SHUT_FD1;\n"
6681 "    }\n"
6682 "    exit(EXIT_SUCCESS);\n"
6683 "}\n"
6684
6685 #. type: Plain text
6686 #: build/C/man2/select_tut.2:815
6687 msgid ""
6688 "The above program properly forwards most kinds of TCP connections including "
6689 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6690 "problem of having data flow in both directions simultaneously.  You might "
6691 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6692 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6693 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6694 "because you end up using inefficient timeouts."
6695 msgstr ""
6696 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6697 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6698 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
6699 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
6700 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
6701 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
6702 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
6703 "起こってしまう。"
6704
6705 #. type: Plain text
6706 #: build/C/man2/select_tut.2:821
6707 msgid ""
6708 "The program does not handle more than one simultaneous connection at a time, "
6709 "although it could easily be extended to do this with a linked list of buffers"
6710 "\\(emone for each connection.  At the moment, new connections cause the "
6711 "current connection to be dropped."
6712 msgstr ""
6713 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6714 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6715 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6716
6717 #.  .SH AUTHORS
6718 #.  This man page was written by Paul Sheer.
6719 #. type: Plain text
6720 #: build/C/man2/select_tut.2:840
6721 msgid ""
6722 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6723 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6724 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6725 "(3), B<epoll>(7)"
6726 msgstr ""
6727 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
6728 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
6729 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
6730 "(3), B<epoll>(7)"
6731
6732 #. type: TH
6733 #: build/C/man2/send.2:40
6734 #, no-wrap
6735 msgid "SEND"
6736 msgstr "SEND"
6737
6738 #. type: TH
6739 #: build/C/man2/send.2:40
6740 #, no-wrap
6741 msgid "2013-12-12"
6742 msgstr "2013-12-12"
6743
6744 #. type: Plain text
6745 #: build/C/man2/send.2:43
6746 msgid "send, sendto, sendmsg - send a message on a socket"
6747 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6748
6749 #. type: Plain text
6750 #: build/C/man2/send.2:47
6751 #, no-wrap
6752 msgid ""
6753 "B<#include E<lt>sys/types.hE<gt>>\n"
6754 "B<#include E<lt>sys/socket.hE<gt>>\n"
6755 msgstr ""
6756 "B<#include E<lt>sys/types.hE<gt>>\n"
6757 "B<#include E<lt>sys/socket.hE<gt>>\n"
6758
6759 #. type: Plain text
6760 #: build/C/man2/send.2:50
6761 #, no-wrap
6762 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6763 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6764
6765 #. type: Plain text
6766 #: build/C/man2/send.2:54
6767 #, no-wrap
6768 msgid ""
6769 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6770 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6771 msgstr ""
6772 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6773 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6774
6775 #. type: Plain text
6776 #: build/C/man2/send.2:57
6777 #, no-wrap
6778 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6779 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6780
6781 #. type: Plain text
6782 #: build/C/man2/send.2:65
6783 msgid ""
6784 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6785 "transmit a message to another socket."
6786 msgstr ""
6787 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6788 "メッセージを転送するのに使用される。"
6789
6790 #. type: Plain text
6791 #: build/C/man2/send.2:84
6792 msgid ""
6793 "The B<send>()  call may be used only when the socket is in a I<connected> "
6794 "state (so that the intended recipient is known).  The only difference "
6795 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6796 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6797 "following call"
6798 msgstr ""
6799 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6800 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
6801 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
6802 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
6803
6804 #. type: Plain text
6805 #: build/C/man2/send.2:86
6806 #, no-wrap
6807 msgid "    send(sockfd, buf, len, flags);\n"
6808 msgstr "    send(sockfd, buf, len, flags);\n"
6809
6810 #. type: Plain text
6811 #: build/C/man2/send.2:88
6812 msgid "is equivalent to"
6813 msgstr "は以下と等価である。"
6814
6815 #. type: Plain text
6816 #: build/C/man2/send.2:90
6817 #, no-wrap
6818 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6819 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6820
6821 #. type: Plain text
6822 #: build/C/man2/send.2:94
6823 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6824 msgstr ""
6825 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6826 "る。"
6827
6828 #. type: Plain text
6829 #: build/C/man2/send.2:122
6830 msgid ""
6831 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6832 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6833 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6834 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6835 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6836 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6837 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6838 "size."
6839 msgstr ""
6840 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6841 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6842 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6843 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6844 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6845 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
6846 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
6847 "msg_namelen> で指定される。"
6848
6849 #. type: Plain text
6850 #: build/C/man2/send.2:138
6851 msgid ""
6852 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6853 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6854 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6855 "ancillary data (also known as control information)."
6856 msgstr ""
6857 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6858 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6859 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6860 "(制御情報とも呼ばれる) を送信することもできる。"
6861
6862 #. type: Plain text
6863 #: build/C/man2/send.2:143
6864 msgid ""
6865 "If the message is too long to pass atomically through the underlying "
6866 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6867 "transmitted."
6868 msgstr ""
6869 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6870 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6871 "ラーが返され、そのメッセージは転送されない。"
6872
6873 #. type: Plain text
6874 #: build/C/man2/send.2:147
6875 msgid ""
6876 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6877 "detected errors are indicated by a return value of -1."
6878 msgstr ""
6879 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6880 "出された場合は、返り値 -1 として通知される。"
6881
6882 #. type: Plain text
6883 #: build/C/man2/send.2:160
6884 msgid ""
6885 "When the message does not fit into the send buffer of the socket, B<send>()  "
6886 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6887 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6888 "in this case.  The B<select>(2)  call may be used to determine when it is "
6889 "possible to send more data."
6890 msgstr ""
6891 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6892 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6893 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6894 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6895 "用することができる。"
6896
6897 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6898 #. type: Plain text
6899 #: build/C/man2/send.2:166
6900 msgid ""
6901 "The I<flags> argument is the bitwise OR of zero or more of the following "
6902 "flags."
6903 msgstr ""
6904 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6905 "のを指定する。"
6906
6907 #. type: TP
6908 #: build/C/man2/send.2:166
6909 #, no-wrap
6910 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
6911 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6912
6913 #. type: Plain text
6914 #: build/C/man2/send.2:180
6915 msgid ""
6916 "Tell the link layer that forward progress happened: you got a successful "
6917 "reply from the other side.  If the link layer doesn't get this it will "
6918 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6919 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
6920 "IPv4 and IPv6.  See B<arp>(7)  for details."
6921 msgstr ""
6922 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6923 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6924 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6925 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6926 "されている。 詳しくは B<arp>(7)  参照のこと。"
6927
6928 #. type: TP
6929 #: build/C/man2/send.2:180
6930 #, no-wrap
6931 msgid "B<MSG_DONTROUTE>"
6932 msgstr "B<MSG_DONTROUTE>"
6933
6934 #. type: Plain text
6935 #: build/C/man2/send.2:188
6936 msgid ""
6937 "Don't use a gateway to send out the packet, send to hosts only on directly "
6938 "connected networks.  This is usually used only by diagnostic or routing "
6939 "programs.  This is defined only for protocol families that route; packet "
6940 "sockets don't."
6941 msgstr ""
6942 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6943 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6944 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6945 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6946
6947 #. type: Plain text
6948 #: build/C/man2/send.2:199
6949 msgid ""
6950 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6951 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6952 "flag with the B<F_SETFL> B<fcntl>(2))."
6953 msgstr ""
6954 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6955 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6956 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6957
6958 #. type: TP
6959 #: build/C/man2/send.2:199
6960 #, no-wrap
6961 msgid "B<MSG_EOR> (since Linux 2.2)"
6962 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6963
6964 #. type: Plain text
6965 #: build/C/man2/send.2:203
6966 msgid ""
6967 "Terminates a record (when this notion is supported, as for sockets of type "
6968 "B<SOCK_SEQPACKET>)."
6969 msgstr ""
6970 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6971 "ケット種別のときに有効)。"
6972
6973 #. type: TP
6974 #: build/C/man2/send.2:203
6975 #, no-wrap
6976 msgid "B<MSG_MORE> (since Linux 2.4.4)"
6977 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6978
6979 #. type: Plain text
6980 #: build/C/man2/send.2:212
6981 msgid ""
6982 "The caller has more data to send.  This flag is used with TCP sockets to "
6983 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6984 "with the difference that this flag can be set on a per-call basis."
6985 msgstr ""
6986 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6987 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6988 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6989 "機能を有効にできる点である。"
6990
6991 #. type: Plain text
6992 #: build/C/man2/send.2:221
6993 msgid ""
6994 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6995 "the kernel to package all of the data sent in calls with this flag set into "
6996 "a single datagram which is transmitted only when a call is performed that "
6997 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6998 "described in B<udp>(7).)"
6999 msgstr ""
7000 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7001 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7002 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7003 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7004 "ソケットオプション B<UDP_CORK> も参照)。"
7005
7006 #. type: TP
7007 #: build/C/man2/send.2:221
7008 #, no-wrap
7009 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7010 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7011
7012 #. type: Plain text
7013 #: build/C/man2/send.2:230
7014 msgid ""
7015 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7016 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7017 msgstr ""
7018 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7019 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7020
7021 #. type: Plain text
7022 #: build/C/man2/send.2:239
7023 msgid ""
7024 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7025 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7026 "data."
7027 msgstr ""
7028 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7029 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7030 "をサポートしている必要がある。"
7031
7032 #. type: Plain text
7033 #: build/C/man2/send.2:246
7034 msgid ""
7035 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
7036 "below for an exact description of its fields."
7037 msgstr ""
7038 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
7039 "B<recv>(2)  と以下の説明を参照すること。"
7040
7041 #.  Still to be documented:
7042 #.   Send file descriptors and user credentials using the
7043 #.   msg_control* fields.
7044 #.   The flags returned in msg_flags.
7045 #. type: Plain text
7046 #: build/C/man2/send.2:275
7047 msgid ""
7048 "You may send control information using the I<msg_control> and "
7049 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7050 "process is limited per socket by the value in I</proc/sys/net/core/"
7051 "optmem_max>; see B<socket>(7)."
7052 msgstr ""
7053 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
7054 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7055 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
7056
7057 #. type: Plain text
7058 #: build/C/man2/send.2:280
7059 msgid ""
7060 "On success, these calls return the number of bytes sent.  On error, -1 is "
7061 "returned, and I<errno> is set appropriately."
7062 msgstr ""
7063 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7064 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7065
7066 #. type: Plain text
7067 #: build/C/man2/send.2:285
7068 msgid ""
7069 "These are some standard errors generated by the socket layer.  Additional "
7070 "errors may be generated and returned from the underlying protocol modules; "
7071 "see their respective manual pages."
7072 msgstr ""
7073 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7074 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7075 "れぞれのマニュアルを参照すること。"
7076
7077 #. type: Plain text
7078 #: build/C/man2/send.2:293
7079 msgid ""
7080 "(For UNIX domain sockets, which are identified by pathname)  Write "
7081 "permission is denied on the destination socket file, or search permission is "
7082 "denied for one of the directories the path prefix.  (See B<path_resolution>"
7083 "(7).)"
7084 msgstr ""
7085 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7086 "\n"
7087 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7088 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7089 "(B<path_resolution>(7) も参照のこと)"
7090
7091 #. type: Plain text
7092 #: build/C/man2/send.2:296
7093 msgid ""
7094 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7095 "as though it was a unicast address."
7096 msgstr ""
7097 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7098 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7099
7100 #.  Actually EAGAIN on Linux
7101 #. type: Plain text
7102 #: build/C/man2/send.2:304
7103 msgid ""
7104 "The socket is marked nonblocking and the requested operation would block.  "
7105 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7106 "require these constants to have the same value, so a portable application "
7107 "should check for both possibilities."
7108 msgstr ""
7109 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7110 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7111 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7112 "両方の可能性を 確認すべきである。"
7113
7114 #. type: Plain text
7115 #: build/C/man2/send.2:307
7116 msgid "An invalid descriptor was specified."
7117 msgstr "無効なディスクリプターが指定された。"
7118
7119 #. type: TP
7120 #: build/C/man2/send.2:307
7121 #, no-wrap
7122 msgid "B<ECONNRESET>"
7123 msgstr "B<ECONNRESET>"
7124
7125 #. type: Plain text
7126 #: build/C/man2/send.2:310
7127 msgid "Connection reset by peer."
7128 msgstr "接続が接続相手によりリセットされた。"
7129
7130 #. type: TP
7131 #: build/C/man2/send.2:310
7132 #, no-wrap
7133 msgid "B<EDESTADDRREQ>"
7134 msgstr "B<EDESTADDRREQ>"
7135
7136 #. type: Plain text
7137 #: build/C/man2/send.2:313
7138 msgid "The socket is not connection-mode, and no peer address is set."
7139 msgstr ""
7140 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7141 "ていない。"
7142
7143 #. type: Plain text
7144 #: build/C/man2/send.2:316
7145 msgid "An invalid user space address was specified for an argument."
7146 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7147
7148 #. type: Plain text
7149 #: build/C/man2/send.2:320
7150 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7151 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7152
7153 #. type: Plain text
7154 #: build/C/man2/send.2:329
7155 msgid ""
7156 "The connection-mode socket was connected already but a recipient was "
7157 "specified.  (Now either this error is returned, or the recipient "
7158 "specification is ignored.)"
7159 msgstr ""
7160 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7161 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7162 "いずれかとなる)"
7163
7164 #. type: TP
7165 #: build/C/man2/send.2:329
7166 #, no-wrap
7167 msgid "B<EMSGSIZE>"
7168 msgstr "B<EMSGSIZE>"
7169
7170 #.  (e.g., SOCK_DGRAM )
7171 #. type: Plain text
7172 #: build/C/man2/send.2:335
7173 msgid ""
7174 "The socket type requires that message be sent atomically, and the size of "
7175 "the message to be sent made this impossible."
7176 msgstr ""
7177 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7178 "るが、 メッセージが大き過ぎるため送信することができない。"
7179
7180 #. type: Plain text
7181 #: build/C/man2/send.2:343
7182 msgid ""
7183 "The output queue for a network interface was full.  This generally indicates "
7184 "that the interface has stopped sending, but may be caused by transient "
7185 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7186 "silently dropped when a device queue overflows.)"
7187 msgstr ""
7188 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7189 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7190 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7191 "フローした場合にはパケットは黙って捨てられる)"
7192
7193 #. type: Plain text
7194 #: build/C/man2/send.2:346
7195 msgid "No memory available."
7196 msgstr "メモリが足りない。"
7197
7198 #. type: Plain text
7199 #: build/C/man2/send.2:349
7200 msgid "The socket is not connected, and no target has been given."
7201 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7202
7203 #. type: Plain text
7204 #: build/C/man2/send.2:359
7205 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7206 msgstr ""
7207 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7208 "る。"
7209
7210 #. type: TP
7211 #: build/C/man2/send.2:359
7212 #, no-wrap
7213 msgid "B<EPIPE>"
7214 msgstr "B<EPIPE>"
7215
7216 #. type: Plain text
7217 #: build/C/man2/send.2:368
7218 msgid ""
7219 "The local end has been shut down on a connection oriented socket.  In this "
7220 "case, the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7221 "set."
7222 msgstr ""
7223 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7224 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7225
7226 #. type: Plain text
7227 #: build/C/man2/send.2:371
7228 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7229 msgstr ""
7230 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7231
7232 #. type: Plain text
7233 #: build/C/man2/send.2:382
7234 msgid ""
7235 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7236 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7237 "flag is a Linux extension."
7238 msgstr ""
7239 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7240 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7241 "ラグは Linux での拡張である。"
7242
7243 #. type: Plain text
7244 #: build/C/man2/send.2:395
7245 msgid ""
7246 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7247 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7248 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7249 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7250 "and libc5.  See also B<accept>(2)."
7251 msgstr ""
7252 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7253 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7254 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7255 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7256 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7257
7258 #. type: Plain text
7259 #: build/C/man2/send.2:414
7260 msgid ""
7261 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7262 "can be used to transmit multiple datagrams in a single call."
7263 msgstr ""
7264 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7265 "る\n"
7266 "Linux 固有の システムコールに関する情報が書かれている。"
7267
7268 #. type: Plain text
7269 #: build/C/man2/send.2:419
7270 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7271 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7272
7273 #. type: Plain text
7274 #: build/C/man2/send.2:424
7275 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7276 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7277
7278 #. type: Plain text
7279 #: build/C/man2/send.2:439
7280 msgid ""
7281 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7282 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7283 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7284 msgstr ""
7285 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7286 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
7287 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7288
7289 #. type: TH
7290 #: build/C/man2/sendmmsg.2:28
7291 #, no-wrap
7292 msgid "SENDMMSG"
7293 msgstr "SENDMMSG"
7294
7295 #. type: TH
7296 #: build/C/man2/sendmmsg.2:28
7297 #, no-wrap
7298 msgid "2012-12-16"
7299 msgstr "2012-12-16"
7300
7301 #. type: Plain text
7302 #: build/C/man2/sendmmsg.2:31
7303 msgid "sendmmsg - send multiple messages on a socket"
7304 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7305
7306 #. type: Plain text
7307 #: build/C/man2/sendmmsg.2:39
7308 #, no-wrap
7309 msgid ""
7310 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7311 "B<             unsigned int >I<flags>B<);>\n"
7312 msgstr ""
7313 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7314 "B<             unsigned int >I<flags>B<);>\n"
7315
7316 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7317 #. type: Plain text
7318 #: build/C/man2/sendmmsg.2:49
7319 msgid ""
7320 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7321 "the caller to transmit multiple messages on a socket using a single system "
7322 "call.  (This has performance benefits for some applications.)"
7323 msgstr ""
7324 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7325 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7326 "ンによっては性能上のメリットがある)。"
7327
7328 #. type: Plain text
7329 #: build/C/man2/sendmmsg.2:54
7330 msgid ""
7331 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7332 "to be transmitted."
7333 msgstr ""
7334 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7335
7336 #. type: Plain text
7337 #: build/C/man2/sendmmsg.2:75
7338 #, no-wrap
7339 msgid ""
7340 "struct mmsghdr {\n"
7341 "    struct msghdr msg_hdr;  /* Message header */\n"
7342 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7343 "};\n"
7344 msgstr ""
7345 "struct mmsghdr {\n"
7346 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7347 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7348 "};\n"
7349
7350 #. type: Plain text
7351 #: build/C/man2/sendmmsg.2:91
7352 msgid ""
7353 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
7354 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
7355 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
7356 "B<sendmsg>(2)  call)."
7357 msgstr ""
7358 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7359 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7360 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7361 "合の返り値と同じである。"
7362
7363 #. type: Plain text
7364 #: build/C/man2/sendmmsg.2:97
7365 msgid ""
7366 "The I<flags> argument contains flags ORed together.  The flags are the same "
7367 "as for B<sendmsg>(2)."
7368 msgstr ""
7369 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7370 "B<sendmsg>(2) と同じである。"
7371
7372 #. type: Plain text
7373 #: build/C/man2/sendmmsg.2:107
7374 msgid ""
7375 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7376 "sent.  A nonblocking call sends as many messages as possible (up to the "
7377 "limit specified by I<vlen>)  and returns immediately."
7378 msgstr ""
7379 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7380 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7381 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7382
7383 #. type: Plain text
7384 #: build/C/man2/sendmmsg.2:119
7385 msgid ""
7386 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7387 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7388 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7389 "of elements of I<msgvec> that have been updated."
7390 msgstr ""
7391 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7392 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7393 "しの返り値は、更新された I<msgvec> の要素数である。"
7394
7395 #. type: Plain text
7396 #: build/C/man2/sendmmsg.2:129
7397 msgid ""
7398 "On success, B<sendmmsg>()  returns the number of messages sent from "
7399 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7400 "B<sendmmsg>()  call to send the remaining messages."
7401 msgstr ""
7402 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7403 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7404 "て残りのメッセージを送信することができる。"
7405
7406 #. type: Plain text
7407 #: build/C/man2/sendmmsg.2:133
7408 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7409 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7410
7411 #
7412 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7413 #.      ... only return an error if no datagrams could be sent.
7414 #.      If less than the requested number of messages were sent, the application
7415 #.      must retry starting at the first failed one and if the problem is
7416 #.      persistent the error will be returned.
7417 #.      This matches the behaviour of other syscalls like read/write - it
7418 #.      is not an error if less than the requested number of elements are sent.
7419 #. type: Plain text
7420 #: build/C/man2/sendmmsg.2:145
7421 msgid ""
7422 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7423 "could be sent."
7424 msgstr ""
7425 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7426 "く送信できなかった場合のみである。"
7427
7428 #. type: Plain text
7429 #: build/C/man2/sendmmsg.2:150
7430 msgid ""
7431 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7432 "added in version 2.14."
7433 msgstr ""
7434 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7435 "バージョン 2.14 で追加された。"
7436
7437 #. type: Plain text
7438 #: build/C/man2/sendmmsg.2:153
7439 msgid "B<sendmmsg>()  is Linux-specific."
7440 msgstr "B<sendmmsg>() は Linux 固有である。"
7441
7442 #
7443 #
7444 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7445 #.      net: Cap number of elements for sendmmsg
7446 #.      To limit the amount of time we can spend in sendmmsg, cap the
7447 #.      number of elements to UIO_MAXIOV (currently 1024).
7448 #.      For error handling an application using sendmmsg needs to retry at
7449 #.      the first unsent message, so capping is simpler and requires less
7450 #.      application logic than returning EINVAL.
7451 #. type: Plain text
7452 #: build/C/man2/sendmmsg.2:168
7453 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7454 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7455
7456 #. type: Plain text
7457 #: build/C/man2/sendmmsg.2:177
7458 msgid ""
7459 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7460 "distinct UDP datagrams using one system call.  The contents of the first "
7461 "datagram originates from a pair of buffers."
7462 msgstr ""
7463 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7464 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7465 "の内容は、二つのバッファから取得される。"
7466
7467 #. type: Plain text
7468 #: build/C/man2/sendmmsg.2:186
7469 #, no-wrap
7470 msgid ""
7471 "#define _GNU_SOURCE\n"
7472 "#include E<lt>netinet/ip.hE<gt>\n"
7473 "#include E<lt>stdio.hE<gt>\n"
7474 "#include E<lt>stdlib.hE<gt>\n"
7475 "#include E<lt>string.hE<gt>\n"
7476 "#include E<lt>sys/types.hE<gt>\n"
7477 "#include E<lt>sys/socket.hE<gt>\n"
7478 msgstr ""
7479 "#define _GNU_SOURCE\n"
7480 "#include E<lt>netinet/ip.hE<gt>\n"
7481 "#include E<lt>stdio.hE<gt>\n"
7482 "#include E<lt>stdlib.hE<gt>\n"
7483 "#include E<lt>string.hE<gt>\n"
7484 "#include E<lt>sys/types.hE<gt>\n"
7485 "#include E<lt>sys/socket.hE<gt>\n"
7486
7487 #. type: Plain text
7488 #: build/C/man2/sendmmsg.2:195
7489 #, no-wrap
7490 msgid ""
7491 "int\n"
7492 "main(void)\n"
7493 "{\n"
7494 "    int sockfd;\n"
7495 "    struct sockaddr_in sa;\n"
7496 "    struct mmsghdr msg[2];\n"
7497 "    struct iovec msg1[2], msg2;\n"
7498 "    int retval;\n"
7499 msgstr ""
7500 "int\n"
7501 "main(void)\n"
7502 "{\n"
7503 "    int sockfd;\n"
7504 "    struct sockaddr_in sa;\n"
7505 "    struct mmsghdr msg[2];\n"
7506 "    struct iovec msg1[2], msg2;\n"
7507 "    int retval;\n"
7508
7509 #. type: Plain text
7510 #: build/C/man2/sendmmsg.2:209
7511 #, no-wrap
7512 msgid ""
7513 "    sa.sin_family = AF_INET;\n"
7514 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7515 "    sa.sin_port = htons(1234);\n"
7516 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7517 "        perror(\"connect()\");\n"
7518 "        exit(EXIT_FAILURE);\n"
7519 "    }\n"
7520 msgstr ""
7521 "    sa.sin_family = AF_INET;\n"
7522 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7523 "    sa.sin_port = htons(1234);\n"
7524 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7525 "        perror(\"connect()\");\n"
7526 "        exit(EXIT_FAILURE);\n"
7527 "    }\n"
7528
7529 #. type: Plain text
7530 #: build/C/man2/sendmmsg.2:215
7531 #, no-wrap
7532 msgid ""
7533 "    memset(msg1, 0, sizeof(msg1));\n"
7534 "    msg1[0].iov_base = \"one\";\n"
7535 "    msg1[0].iov_len = 3;\n"
7536 "    msg1[1].iov_base = \"two\";\n"
7537 "    msg1[1].iov_len = 3;\n"
7538 msgstr ""
7539 "    memset(msg1, 0, sizeof(msg1));\n"
7540 "    msg1[0].iov_base = \"one\";\n"
7541 "    msg1[0].iov_len = 3;\n"
7542 "    msg1[1].iov_base = \"two\";\n"
7543 "    msg1[1].iov_len = 3;\n"
7544
7545 #. type: Plain text
7546 #: build/C/man2/sendmmsg.2:219
7547 #, no-wrap
7548 msgid ""
7549 "    memset(&msg2, 0, sizeof(msg2));\n"
7550 "    msg2.iov_base = \"three\";\n"
7551 "    msg2.iov_len = 5;\n"
7552 msgstr ""
7553 "    memset(&msg2, 0, sizeof(msg2));\n"
7554 "    msg2.iov_base = \"three\";\n"
7555 "    msg2.iov_len = 5;\n"
7556
7557 #. type: Plain text
7558 #: build/C/man2/sendmmsg.2:223
7559 #, no-wrap
7560 msgid ""
7561 "    memset(msg, 0, sizeof(msg));\n"
7562 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7563 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7564 msgstr ""
7565 "    memset(msg, 0, sizeof(msg));\n"
7566 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7567 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7568
7569 #. type: Plain text
7570 #: build/C/man2/sendmmsg.2:226
7571 #, no-wrap
7572 msgid ""
7573 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7574 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7575 msgstr ""
7576 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7577 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7578
7579 #. type: Plain text
7580 #: build/C/man2/sendmmsg.2:232
7581 #, no-wrap
7582 msgid ""
7583 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7584 "    if (retval == -1)\n"
7585 "        perror(\"sendmmsg()\");\n"
7586 "    else\n"
7587 "        printf(\"%d messages sent\\en\", retval);\n"
7588 msgstr ""
7589 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7590 "    if (retval == -1)\n"
7591 "        perror(\"sendmmsg()\");\n"
7592 "    else\n"
7593 "        printf(\"%d messages sent\\en\", retval);\n"
7594
7595 #. type: Plain text
7596 #: build/C/man2/sendmmsg.2:235
7597 #, no-wrap
7598 msgid ""
7599 "    exit(0);\n"
7600 "}\n"
7601 msgstr ""
7602 "    exit(0);\n"
7603 "}\n"
7604
7605 #. type: Plain text
7606 #: build/C/man2/sendmmsg.2:241
7607 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7608 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7609
7610 #. type: TH
7611 #: build/C/man3/sockatmark.3:25
7612 #, no-wrap
7613 msgid "SOCKATMARK"
7614 msgstr "SOCKATMARK"
7615
7616 #. type: TH
7617 #: build/C/man3/sockatmark.3:25
7618 #, no-wrap
7619 msgid "2014-02-28"
7620 msgstr "2014-02-28"
7621
7622 #. type: Plain text
7623 #: build/C/man3/sockatmark.3:28
7624 msgid "sockatmark - determine whether socket is at out-of-band mark"
7625 msgstr ""
7626 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7627 "べる"
7628
7629 #. type: Plain text
7630 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7631 #: build/C/man7/socket.7:61 build/C/man2/socketpair.2:49
7632 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7633 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7634
7635 #. type: Plain text
7636 #: build/C/man3/sockatmark.3:32
7637 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7638 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7639
7640 #. type: Plain text
7641 #: build/C/man3/sockatmark.3:41
7642 msgid ""
7643 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7644 "\\ 600"
7645 msgstr ""
7646 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7647 "\\ 600"
7648
7649 #. type: Plain text
7650 #: build/C/man3/sockatmark.3:51
7651 msgid ""
7652 "B<sockatmark>()  returns a value indicating whether or not the socket "
7653 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7654 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7655 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7656 msgstr ""
7657 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7658 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7659 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7660 "この関数は帯域外マークを削除しない。"
7661
7662 #. type: Plain text
7663 #: build/C/man3/sockatmark.3:58
7664 msgid ""
7665 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7666 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7667 "set to indicate the error."
7668 msgstr ""
7669 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7670 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7671 "れ、エラーを表す I<errno> が設定される。"
7672
7673 #. type: Plain text
7674 #: build/C/man3/sockatmark.3:63
7675 msgid "I<sockfd> is not a valid file descriptor."
7676 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7677
7678 #.  POSIX.1 says ENOTTY for this case
7679 #. type: Plain text
7680 #: build/C/man3/sockatmark.3:70
7681 msgid ""
7682 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7683 msgstr ""
7684 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7685
7686 #. type: Plain text
7687 #: build/C/man3/sockatmark.3:73
7688 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7689 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7690
7691 #. type: Plain text
7692 #: build/C/man3/sockatmark.3:78
7693 msgid "The B<sockatmark>()  function is thread-safe."
7694 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7695
7696 #. type: Plain text
7697 #: build/C/man3/sockatmark.3:80
7698 msgid "POSIX.1-2001."
7699 msgstr "POSIX.1-2001."
7700
7701 #. type: Plain text
7702 #: build/C/man3/sockatmark.3:87
7703 msgid ""
7704 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7705 "the B<MSG_OOB> flag of B<recv>(2)."
7706 msgstr ""
7707 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7708 "B<recv>(2)  で読み込むことができる。"
7709
7710 #. type: Plain text
7711 #: build/C/man3/sockatmark.3:89
7712 msgid "Out-of-band data is supported only on some stream socket protocols."
7713 msgstr ""
7714 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7715 "ない。"
7716
7717 #. type: Plain text
7718 #: build/C/man3/sockatmark.3:94
7719 msgid ""
7720 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7721 "signal."
7722 msgstr ""
7723 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7724 "る。"
7725
7726 #. type: Plain text
7727 #: build/C/man3/sockatmark.3:100
7728 msgid ""
7729 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7730 "operation."
7731 msgstr ""
7732 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7733
7734 #. type: Plain text
7735 #: build/C/man3/sockatmark.3:104
7736 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7737 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7738
7739 #. type: Plain text
7740 #: build/C/man3/sockatmark.3:109
7741 msgid ""
7742 "The following code can be used after receipt of a B<SIGURG> signal to read "
7743 "(and discard) all data up to the mark, and then read the byte of data at the "
7744 "mark:"
7745 msgstr ""
7746 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7747 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7748
7749 #. type: Plain text
7750 #: build/C/man3/sockatmark.3:114
7751 #, no-wrap
7752 msgid ""
7753 "    char buf[BUF_LEN];\n"
7754 "    char oobdata;\n"
7755 "    int atmark, s;\n"
7756 msgstr ""
7757 "    char buf[BUF_LEN];\n"
7758 "    char oobdata;\n"
7759 "    int atmark, s;\n"
7760
7761 #. type: Plain text
7762 #: build/C/man3/sockatmark.3:121
7763 #, no-wrap
7764 msgid ""
7765 "    for (;;) {\n"
7766 "        atmark = sockatmark(sockfd);\n"
7767 "        if (atmark == -1) {\n"
7768 "            perror(\"sockatmark\");\n"
7769 "            break;\n"
7770 "        }\n"
7771 msgstr ""
7772 "    for (;;) {\n"
7773 "        atmark = sockatmark(sockfd);\n"
7774 "        if (atmark == -1) {\n"
7775 "            perror(\"sockatmark\");\n"
7776 "            break;\n"
7777 "        }\n"
7778
7779 #. type: Plain text
7780 #: build/C/man3/sockatmark.3:124
7781 #, no-wrap
7782 msgid ""
7783 "        if (atmark)\n"
7784 "            break;\n"
7785 msgstr ""
7786 "        if (atmark)\n"
7787 "            break;\n"
7788
7789 #. type: Plain text
7790 #: build/C/man3/sockatmark.3:131
7791 #, no-wrap
7792 msgid ""
7793 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7794 "        if (s == -1)\n"
7795 "            perror(\"read\");\n"
7796 "        if (s E<lt>= 0)\n"
7797 "            break;\n"
7798 "    }\n"
7799 msgstr ""
7800 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7801 "        if (s == -1)\n"
7802 "            perror(\"read\");\n"
7803 "        if (s E<lt>= 0)\n"
7804 "            break;\n"
7805 "    }\n"
7806
7807 #. type: Plain text
7808 #: build/C/man3/sockatmark.3:138
7809 #, no-wrap
7810 msgid ""
7811 "    if (atmark == 1) {\n"
7812 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7813 "            perror(\"recv\");\n"
7814 "            ...\n"
7815 "        }\n"
7816 "    }\n"
7817 msgstr ""
7818 "    if (atmark == 1) {\n"
7819 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7820 "            perror(\"recv\");\n"
7821 "            ...\n"
7822 "        }\n"
7823 "    }\n"
7824
7825 #. type: Plain text
7826 #: build/C/man3/sockatmark.3:144
7827 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7828 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7829
7830 #. type: TH
7831 #: build/C/man2/socket.2:43 build/C/man7/socket.7:56
7832 #, no-wrap
7833 msgid "SOCKET"
7834 msgstr "SOCKET"
7835
7836 #. type: TH
7837 #: build/C/man2/socket.2:43
7838 #, no-wrap
7839 msgid "2013-12-31"
7840 msgstr "2013-12-31"
7841
7842 #. type: Plain text
7843 #: build/C/man2/socket.2:46
7844 msgid "socket - create an endpoint for communication"
7845 msgstr "socket - 通信のための端点(endpoint)を作成する"
7846
7847 #. type: Plain text
7848 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7849 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7850 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7851
7852 #. type: Plain text
7853 #: build/C/man2/socket.2:52
7854 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7855 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7856
7857 #. type: Plain text
7858 #: build/C/man2/socket.2:55
7859 msgid ""
7860 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7861 msgstr ""
7862 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7863 "(descriptor)を返す。"
7864
7865 #. type: Plain text
7866 #: build/C/man2/socket.2:63
7867 msgid ""
7868 "The I<domain> argument specifies a communication domain; this selects the "
7869 "protocol family which will be used for communication.  These families are "
7870 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7871 "include:"
7872 msgstr ""
7873 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7874 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7875 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7876 "下の通り。"
7877
7878 #. type: tbl table
7879 #: build/C/man2/socket.2:66
7880 #, no-wrap
7881 msgid "Name:Purpose:Man page\n"
7882 msgstr "名前:目的:マニュアル\n"
7883
7884 #. type: tbl table
7885 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7886 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7887 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7888 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
7889 #, no-wrap
7890 msgid "T{\n"
7891 msgstr "T{\n"
7892
7893 #. type: tbl table
7894 #: build/C/man2/socket.2:68
7895 #, no-wrap
7896 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
7897 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
7898
7899 #. type: tbl table
7900 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
7901 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
7902 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
7903 #: build/C/man7/socket.7:192
7904 #, no-wrap
7905 msgid "T}:T{\n"
7906 msgstr "T}:T{\n"
7907
7908 #. type: tbl table
7909 #: build/C/man2/socket.2:70
7910 #, no-wrap
7911 msgid "Local communication\n"
7912 msgstr "ローカル通信\n"
7913
7914 #. type: tbl table
7915 #: build/C/man2/socket.2:72
7916 #, no-wrap
7917 msgid "B<unix>(7)\n"
7918 msgstr "B<unix>(7)\n"
7919
7920 #. type: tbl table
7921 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
7922 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
7923 #: build/C/man2/socket.2:118 build/C/man7/socket.7:171
7924 #: build/C/man7/socket.7:175 build/C/man7/socket.7:178
7925 #: build/C/man7/socket.7:184 build/C/man7/socket.7:187
7926 #: build/C/man7/socket.7:196 build/C/man7/socket.7:203
7927 #, no-wrap
7928 msgid "T}\n"
7929 msgstr "T}\n"
7930
7931 #. type: tbl table
7932 #: build/C/man2/socket.2:75
7933 #, no-wrap
7934 msgid "B<AF_INET>\n"
7935 msgstr "B<AF_INET>\n"
7936
7937 #. type: tbl table
7938 #: build/C/man2/socket.2:76
7939 #, no-wrap
7940 msgid "T}:IPv4 Internet protocols:T{\n"
7941 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
7942
7943 #. type: tbl table
7944 #: build/C/man2/socket.2:77
7945 #, no-wrap
7946 msgid "B<ip>(7)\n"
7947 msgstr "B<ip>(7)\n"
7948
7949 #. type: tbl table
7950 #: build/C/man2/socket.2:80
7951 #, no-wrap
7952 msgid "B<AF_INET6>\n"
7953 msgstr "B<AF_INET6>\n"
7954
7955 #. type: tbl table
7956 #: build/C/man2/socket.2:81
7957 #, no-wrap
7958 msgid "T}:IPv6 Internet protocols:T{\n"
7959 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7960
7961 #. type: tbl table
7962 #: build/C/man2/socket.2:82
7963 #, no-wrap
7964 msgid "B<ipv6>(7)\n"
7965 msgstr "B<ipv6>(7)\n"
7966
7967 #. type: tbl table
7968 #: build/C/man2/socket.2:85
7969 #, no-wrap
7970 msgid "B<AF_IPX>\n"
7971 msgstr "B<AF_IPX>\n"
7972
7973 #. type: tbl table
7974 #: build/C/man2/socket.2:86
7975 #, no-wrap
7976 msgid "T}:IPX - Novell protocols:\n"
7977 msgstr "T}:IPX - Novell プロトコル:\n"
7978
7979 #. type: tbl table
7980 #: build/C/man2/socket.2:88
7981 #, no-wrap
7982 msgid "B<AF_NETLINK>\n"
7983 msgstr "B<AF_NETLINK>\n"
7984
7985 #. type: tbl table
7986 #: build/C/man2/socket.2:90
7987 #, no-wrap
7988 msgid "Kernel user interface device\n"
7989 msgstr "カーネル・ユーザ・デバイス\n"
7990
7991 #. type: tbl table
7992 #: build/C/man2/socket.2:92
7993 #, no-wrap
7994 msgid "B<netlink>(7)\n"
7995 msgstr "B<netlink>(7)\n"
7996
7997 #. type: tbl table
7998 #: build/C/man2/socket.2:95
7999 #, no-wrap
8000 msgid "B<AF_X25>\n"
8001 msgstr "B<AF_X25>\n"
8002
8003 #. type: tbl table
8004 #: build/C/man2/socket.2:96
8005 #, no-wrap
8006 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8007 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8008
8009 #. type: tbl table
8010 #: build/C/man2/socket.2:97
8011 #, no-wrap
8012 msgid "B<x25>(7)\n"
8013 msgstr "B<x25>(7)\n"
8014
8015 #. type: tbl table
8016 #: build/C/man2/socket.2:100
8017 #, no-wrap
8018 msgid "B<AF_AX25>\n"
8019 msgstr "B<AF_AX25>\n"
8020
8021 #. type: tbl table
8022 #: build/C/man2/socket.2:102
8023 #, no-wrap
8024 msgid "Amateur radio AX.25 protocol\n"
8025 msgstr "アマチュア無線 AX.25 プロトコル\n"
8026
8027 #. type: tbl table
8028 #: build/C/man2/socket.2:103
8029 #, no-wrap
8030 msgid "T}:\n"
8031 msgstr "T}:\n"
8032
8033 #. type: tbl table
8034 #: build/C/man2/socket.2:105
8035 #, no-wrap
8036 msgid "B<AF_ATMPVC>\n"
8037 msgstr "B<AF_ATMPVC>\n"
8038
8039 #. type: tbl table
8040 #: build/C/man2/socket.2:106
8041 #, no-wrap
8042 msgid "T}:Access to raw ATM PVCs:\n"
8043 msgstr "T}:生の ATM PVC にアクセスする:\n"
8044
8045 #. type: tbl table
8046 #: build/C/man2/socket.2:108
8047 #, no-wrap
8048 msgid "B<AF_APPLETALK>\n"
8049 msgstr "B<AF_APPLETALK>\n"
8050
8051 #. type: tbl table
8052 #: build/C/man2/socket.2:109
8053 #, no-wrap
8054 msgid "T}:Appletalk:T{\n"
8055 msgstr "T}:アップルトーク:T{\n"
8056
8057 #. type: tbl table
8058 #: build/C/man2/socket.2:110
8059 #, no-wrap
8060 msgid "B<ddp>(7)\n"
8061 msgstr "B<ddp>(7)\n"
8062
8063 #. type: tbl table
8064 #: build/C/man2/socket.2:113
8065 #, no-wrap
8066 msgid "B<AF_PACKET>\n"
8067 msgstr "B<AF_PACKET>\n"
8068
8069 #. type: tbl table
8070 #: build/C/man2/socket.2:115
8071 #, no-wrap
8072 msgid "Low level packet interface\n"
8073 msgstr "低レベルのパケットインターフェース\n"
8074
8075 #. type: tbl table
8076 #: build/C/man2/socket.2:117
8077 #, no-wrap
8078 msgid "B<packet>(7)\n"
8079 msgstr "B<packet>(7)\n"
8080
8081 #. type: Plain text
8082 #: build/C/man2/socket.2:126
8083 msgid ""
8084 "The socket has the indicated I<type>, which specifies the communication "
8085 "semantics.  Currently defined types are:"
8086 msgstr ""
8087 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8088 "る。 定義されている型は現在以下の通り。"
8089
8090 #. type: TP
8091 #: build/C/man2/socket.2:126
8092 #, no-wrap
8093 msgid "B<SOCK_STREAM>"
8094 msgstr "B<SOCK_STREAM>"
8095
8096 #. type: Plain text
8097 #: build/C/man2/socket.2:130
8098 msgid ""
8099 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8100 "out-of-band data transmission mechanism may be supported."
8101 msgstr ""
8102 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8103 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8104
8105 #. type: TP
8106 #: build/C/man2/socket.2:130
8107 #, no-wrap
8108 msgid "B<SOCK_DGRAM>"
8109 msgstr "B<SOCK_DGRAM>"
8110
8111 #. type: Plain text
8112 #: build/C/man2/socket.2:134
8113 msgid ""
8114 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8115 "length)."
8116 msgstr ""
8117 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8118 "する。"
8119
8120 #. type: TP
8121 #: build/C/man2/socket.2:134
8122 #, no-wrap
8123 msgid "B<SOCK_SEQPACKET>"
8124 msgstr "B<SOCK_SEQPACKET>"
8125
8126 #. type: Plain text
8127 #: build/C/man2/socket.2:139
8128 msgid ""
8129 "Provides a sequenced, reliable, two-way connection-based data transmission "
8130 "path for datagrams of fixed maximum length; a consumer is required to read "
8131 "an entire packet with each input system call."
8132 msgstr ""
8133 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8134 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8135 "ト全体を読み取ることが要求される。"
8136
8137 #. type: TP
8138 #: build/C/man2/socket.2:139
8139 #, no-wrap
8140 msgid "B<SOCK_RAW>"
8141 msgstr "B<SOCK_RAW>"
8142
8143 #. type: Plain text
8144 #: build/C/man2/socket.2:142
8145 msgid "Provides raw network protocol access."
8146 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8147
8148 #. type: TP
8149 #: build/C/man2/socket.2:142
8150 #, no-wrap
8151 msgid "B<SOCK_RDM>"
8152 msgstr "B<SOCK_RDM>"
8153
8154 #. type: Plain text
8155 #: build/C/man2/socket.2:145
8156 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8157 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8158
8159 #. type: TP
8160 #: build/C/man2/socket.2:145
8161 #, no-wrap
8162 msgid "B<SOCK_PACKET>"
8163 msgstr "B<SOCK_PACKET>"
8164
8165 #. type: Plain text
8166 #: build/C/man2/socket.2:150
8167 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8168 msgstr ""
8169 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8170 "こと"
8171
8172 #. type: Plain text
8173 #: build/C/man2/socket.2:152
8174 msgid "Some socket types may not be implemented by all protocol families."
8175 msgstr ""
8176 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。"
8177
8178 #. type: Plain text
8179 #: build/C/man2/socket.2:160
8180 msgid ""
8181 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8182 "addition to specifying a socket type, it may include the bitwise OR of any "
8183 "of the following values, to modify the behavior of B<socket>():"
8184 msgstr ""
8185 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8186 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8187 "ることで、 B<socket>()  の振舞いを変更することができる。"
8188
8189 #. type: Plain text
8190 #: build/C/man2/socket.2:194
8191 msgid ""
8192 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8193 "Normally only a single protocol exists to support a particular socket type "
8194 "within a given protocol family, in which case I<protocol> can be specified "
8195 "as 0.  However, it is possible that many protocols may exist, in which case "
8196 "a particular protocol must be specified in this manner.  The protocol number "
8197 "to use is specific to the ``communication domain'' in which communication is "
8198 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8199 "protocol name strings to protocol numbers."
8200 msgstr ""
8201 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8202 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8203 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8204 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8205 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8206 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8207 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8208
8209 #. type: Plain text
8210 #: build/C/man2/socket.2:224
8211 msgid ""
8212 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8213 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
8214 "a I<connected> state before any data may be sent or received on it.  A "
8215 "connection to another socket is created with a B<connect>(2)  call.  Once "
8216 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
8217 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
8218 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
8219 "also be transmitted as described in B<send>(2)  and received as described in "
8220 "B<recv>(2)."
8221 msgstr ""
8222 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8223 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8224 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8225 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
8226 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
8227 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
8228 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
8229
8230 #. type: Plain text
8231 #: build/C/man2/socket.2:250
8232 msgid ""
8233 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8234 "data is not lost or duplicated.  If a piece of data for which the peer "
8235 "protocol has buffer space cannot be successfully transmitted within a "
8236 "reasonable length of time, then the connection is considered to be dead.  "
8237 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8238 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8239 "signal is raised if a process sends or receives on a broken stream; this "
8240 "causes naive processes, which do not handle the signal, to exit.  "
8241 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8242 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8243 "amount of data requested, and any data remaining in the arriving packet will "
8244 "be discarded.  Also all message boundaries in incoming datagrams are "
8245 "preserved."
8246 msgstr ""
8247 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8248 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8249 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8250 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8251 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8252 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8253 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8254 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8255 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8256 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8257
8258 #. type: Plain text
8259 #: build/C/man2/socket.2:260
8260 msgid ""
8261 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8262 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8263 "received with B<recvfrom>(2), which returns the next datagram along with the "
8264 "address of its sender."
8265 msgstr ""
8266 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8267 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
8268 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
8269 "す。"
8270
8271 #. type: Plain text
8272 #: build/C/man2/socket.2:267
8273 msgid ""
8274 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8275 "from the device driver.  Use B<packet>(7)  instead."
8276 msgstr ""
8277 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8278 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8279
8280 #. type: Plain text
8281 #: build/C/man2/socket.2:290
8282 msgid ""
8283 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8284 "process group to receive a B<SIGURG> signal when the out-of-band data "
8285 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8286 "unexpectedly.  This operation may also be used to set the process or process "
8287 "group that receives the I/O and asynchronous notification of I/O events via "
8288 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8289 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8290 msgstr ""
8291 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8292 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8293 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8294 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8295 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8296 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8297 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8298
8299 #. type: Plain text
8300 #: build/C/man2/socket.2:300
8301 msgid ""
8302 "When the network signals an error condition to the protocol module (e.g., "
8303 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8304 "The next operation on this socket will return the error code of the pending "
8305 "error.  For some protocols it is possible to enable a per-socket error queue "
8306 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
8307 "(7)."
8308 msgstr ""
8309 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8310 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8311 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8312 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8313 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8314 "B<IP_RECVERR> を参照すること。"
8315
8316 #. type: Plain text
8317 #: build/C/man2/socket.2:310
8318 msgid ""
8319 "The operation of sockets is controlled by socket level I<options>.  These "
8320 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8321 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8322 "respectively."
8323 msgstr ""
8324 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8325 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8326 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8327
8328 #. type: Plain text
8329 #: build/C/man2/socket.2:315
8330 msgid ""
8331 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8332 "is returned, and I<errno> is set appropriately."
8333 msgstr ""
8334 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8335 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8336
8337 #. type: Plain text
8338 #: build/C/man2/socket.2:320
8339 msgid ""
8340 "Permission to create a socket of the specified type and/or protocol is "
8341 "denied."
8342 msgstr ""
8343 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8344
8345 #. type: Plain text
8346 #: build/C/man2/socket.2:323
8347 msgid "The implementation does not support the specified address family."
8348 msgstr "指定されたアドレスファミリーがサポートされていない。"
8349
8350 #. type: Plain text
8351 #: build/C/man2/socket.2:326
8352 msgid "Unknown protocol, or protocol family not available."
8353 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8354
8355 #.  Since Linux 2.6.27
8356 #. type: Plain text
8357 #: build/C/man2/socket.2:331
8358 msgid "Invalid flags in I<type>."
8359 msgstr "I<type> に無効なフラグが指定されている。"
8360
8361 #. type: Plain text
8362 #: build/C/man2/socket.2:334
8363 msgid "Process file table overflow."
8364 msgstr "プロセスのファイルテーブルが溢れている。"
8365
8366 #. type: TP
8367 #: build/C/man2/socket.2:337
8368 #, no-wrap
8369 msgid "B<ENOBUFS> or B<ENOMEM>"
8370 msgstr "B<ENOBUFS> または B<ENOMEM>"
8371
8372 #. type: Plain text
8373 #: build/C/man2/socket.2:342
8374 msgid ""
8375 "Insufficient memory is available.  The socket cannot be created until "
8376 "sufficient resources are freed."
8377 msgstr ""
8378 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8379 "ない。"
8380
8381 #. type: TP
8382 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8383 #, no-wrap
8384 msgid "B<EPROTONOSUPPORT>"
8385 msgstr "B<EPROTONOSUPPORT>"
8386
8387 #. type: Plain text
8388 #: build/C/man2/socket.2:346
8389 msgid ""
8390 "The protocol type or the specified protocol is not supported within this "
8391 "domain."
8392 msgstr ""
8393 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8394 "いない。"
8395
8396 #. type: Plain text
8397 #: build/C/man2/socket.2:348
8398 msgid "Other errors may be generated by the underlying protocol modules."
8399 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8400
8401 #. type: Plain text
8402 #: build/C/man2/socket.2:350
8403 msgid "4.4BSD, POSIX.1-2001."
8404 msgstr "4.4BSD, POSIX.1-2001."
8405
8406 #. type: Plain text
8407 #: build/C/man2/socket.2:356
8408 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8409 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8410
8411 #. type: Plain text
8412 #: build/C/man2/socket.2:362
8413 msgid ""
8414 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8415 "systems supporting clones of the BSD socket layer (including System V "
8416 "variants)."
8417 msgstr ""
8418 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
8419 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
8420 "外のシステムからの移植ができる。"
8421
8422 #. type: Plain text
8423 #: build/C/man2/socket.2:381
8424 msgid ""
8425 "The manifest constants used under 4.x BSD for protocol families are "
8426 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8427 "are used for address families.  However, already the BSD man page promises: "
8428 "\"The protocol family generally is the same as the address family\", and "
8429 "subsequent standards use AF_* everywhere."
8430 msgstr ""
8431 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8432 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8433 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8434 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8435 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8436 "それ以外の規格では全ての場所で AF_* が使用されている。"
8437
8438 #. type: Plain text
8439 #: build/C/man2/socket.2:386
8440 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8441 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8442
8443 #. type: Plain text
8444 #: build/C/man2/socket.2:409
8445 msgid ""
8446 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8447 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8448 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8449 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8450 "(7), B<unix>(7)"
8451 msgstr ""
8452 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8453 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8454 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8455 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
8456 "(7), B<unix>(7)"
8457
8458 #. type: Plain text
8459 #: build/C/man2/socket.2:415
8460 msgid ""
8461 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8462 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8463 "Programmer's Supplementary Documents Volume 1.>"
8464 msgstr ""
8465 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8466 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8467 "Supplementary Documents Volume 1.> として再版された)"
8468
8469 #. type: TH
8470 #: build/C/man7/socket.7:56
8471 #, no-wrap
8472 msgid "2014-02-21"
8473 msgstr "2014-02-21"
8474
8475 #. type: Plain text
8476 #: build/C/man7/socket.7:59
8477 msgid "socket - Linux socket interface"
8478 msgstr "socket - Linux のソケットインターフェース"
8479
8480 #. type: Plain text
8481 #: build/C/man7/socket.7:63
8482 msgid ""
8483 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8484 ">I<protocol>B<);>"
8485 msgstr ""
8486 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8487 ">I<protocol>B<);>"
8488
8489 #. type: Plain text
8490 #: build/C/man7/socket.7:82
8491 msgid ""
8492 "This manual page describes the Linux networking socket layer user "
8493 "interface.  The BSD compatible sockets are the uniform interface between the "
8494 "user process and the network protocol stacks in the kernel.  The protocol "
8495 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8496 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8497 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8498 msgstr ""
8499 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8500 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8501 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8502 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8503 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8504 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8505 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8506
8507 #. type: SS
8508 #: build/C/man7/socket.7:82
8509 #, no-wrap
8510 msgid "Socket-layer functions"
8511 msgstr "ソケット層の関数群"
8512
8513 #. type: Plain text
8514 #: build/C/man7/socket.7:86
8515 msgid ""
8516 "These functions are used by the user process to send or receive packets and "
8517 "to do other socket operations.  For more information see their respective "
8518 "manual pages."
8519 msgstr ""
8520 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8521 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8522
8523 #. type: Plain text
8524 #: build/C/man7/socket.7:102
8525 msgid ""
8526 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8527 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8528 "address, B<listen>(2)  tells the socket that new connections shall be "
8529 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8530 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8531 "(implemented only for a few local families like B<AF_UNIX>)"
8532 msgstr ""
8533 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8534 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8535 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8536 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8537 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8538 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8539 "リーでしか実装されていない)。"
8540
8541 #. type: Plain text
8542 #: build/C/man7/socket.7:124
8543 msgid ""
8544 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8545 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8546 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8547 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
8548 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
8549 "write data."
8550 msgstr ""
8551 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8552 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8553 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8554 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8555 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8556 "ことができる。"
8557
8558 #. type: Plain text
8559 #: build/C/man7/socket.7:135
8560 msgid ""
8561 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8562 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8563 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8564 "be used to set or read some other options."
8565 msgstr ""
8566 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8567 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8568 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8569 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8570
8571 #. type: Plain text
8572 #: build/C/man7/socket.7:140
8573 msgid ""
8574 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8575 "full-duplex socket connection."
8576 msgstr ""
8577 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8578 "続を部分的にクローズする。"
8579
8580 #. type: Plain text
8581 #: build/C/man7/socket.7:146
8582 msgid ""
8583 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8584 "not supported on sockets."
8585 msgstr ""
8586 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8587 "ではサポートされていない。"
8588
8589 #. type: Plain text
8590 #: build/C/man7/socket.7:163
8591 msgid ""
8592 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8593 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8594 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8595 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8596 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8597 msgstr ""
8598 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8599 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8600 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8601 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8602 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8603 "B<select>(2)  を使って待つことができる。"
8604
8605 #. type: tbl table
8606 #: build/C/man7/socket.7:167
8607 #, no-wrap
8608 msgid "I/O events\n"
8609 msgstr "I/O イベント\n"
8610
8611 #. type: tbl table
8612 #: build/C/man7/socket.7:168
8613 #, no-wrap
8614 msgid "Event:Poll flag:Occurrence\n"
8615 msgstr "イベント:poll フラグ:内容\n"
8616
8617 #. type: tbl table
8618 #: build/C/man7/socket.7:169 build/C/man7/socket.7:172
8619 #, no-wrap
8620 msgid "Read:POLLIN:T{\n"
8621 msgstr "Read:POLLIN:T{\n"
8622
8623 #. type: tbl table
8624 #: build/C/man7/socket.7:170
8625 #, no-wrap
8626 msgid "New data arrived.\n"
8627 msgstr "新しいデータが到着した。\n"
8628
8629 #. type: tbl table
8630 #: build/C/man7/socket.7:173
8631 #, no-wrap
8632 msgid "A connection setup has been completed\n"
8633 msgstr "(接続志向のソケットで)\n"
8634
8635 #. type: tbl table
8636 #: build/C/man7/socket.7:174
8637 #, no-wrap
8638 msgid "(for connection-oriented sockets)\n"
8639 msgstr "接続の設定が終了した。\n"
8640
8641 #. type: tbl table
8642 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
8643 #, no-wrap
8644 msgid "Read:POLLHUP:T{\n"
8645 msgstr "Read:POLLHUP:T{\n"
8646
8647 #. type: tbl table
8648 #: build/C/man7/socket.7:177
8649 #, no-wrap
8650 msgid "A disconnection request has been initiated by the other end.\n"
8651 msgstr "接続先で切断要求が生成された。\n"
8652
8653 #. type: tbl table
8654 #: build/C/man7/socket.7:180
8655 #, no-wrap
8656 msgid "A connection is broken (only for connection-oriented protocols).\n"
8657 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8658
8659 #. type: tbl table
8660 #: build/C/man7/socket.7:181
8661 #, no-wrap
8662 msgid "When the socket is written\n"
8663 msgstr "この場合、ソケットに書き込みが行われると\n"
8664
8665 #. type: tbl table
8666 #: build/C/man7/socket.7:182
8667 #, no-wrap
8668 msgid "B<SIGPIPE>\n"
8669 msgstr "B<SIGPIPE>\n"
8670
8671 #. type: tbl table
8672 #: build/C/man7/socket.7:183
8673 #, no-wrap
8674 msgid "is also sent.\n"
8675 msgstr "も送信される。\n"
8676
8677 #. type: tbl table
8678 #: build/C/man7/socket.7:185
8679 #, no-wrap
8680 msgid "Write:POLLOUT:T{\n"
8681 msgstr "Write:POLLOUT:T{\n"
8682
8683 #. type: tbl table
8684 #: build/C/man7/socket.7:186
8685 #, no-wrap
8686 msgid "Socket has enough send buffer space for writing new data.\n"
8687 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8688
8689 #. type: tbl table
8690 #: build/C/man7/socket.7:188
8691 #, no-wrap
8692 msgid "Read/Write:T{\n"
8693 msgstr "Read/Write:T{\n"
8694
8695 #. type: tbl table
8696 #: build/C/man7/socket.7:189
8697 #, no-wrap
8698 msgid "POLLIN|\n"
8699 msgstr "POLLIN|\n"
8700
8701 #. type: tbl table
8702 #: build/C/man7/socket.7:190
8703 #, no-wrap
8704 msgid ".br\n"
8705 msgstr ".br\n"
8706
8707 #. type: tbl table
8708 #: build/C/man7/socket.7:191
8709 #, no-wrap
8710 msgid "POLLOUT\n"
8711 msgstr "POLLOUT\n"
8712
8713 #. type: tbl table
8714 #: build/C/man7/socket.7:193
8715 #, no-wrap
8716 msgid "An outgoing\n"
8717 msgstr "外部向けの\n"
8718
8719 #. type: tbl table
8720 #: build/C/man7/socket.7:194
8721 #, no-wrap
8722 msgid "B<connect>(2)\n"
8723 msgstr "B<connect>(2)\n"
8724
8725 #. type: tbl table
8726 #: build/C/man7/socket.7:195
8727 #, no-wrap
8728 msgid "finished.\n"
8729 msgstr "が終了した。\n"
8730
8731 #. type: tbl table
8732 #: build/C/man7/socket.7:197
8733 #, no-wrap
8734 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8735 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8736
8737 #. type: tbl table
8738 #: build/C/man7/socket.7:198
8739 #, no-wrap
8740 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8741 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8742
8743 #. type: tbl table
8744 #: build/C/man7/socket.7:199
8745 #, no-wrap
8746 msgid "Exception:POLLPRI:T{\n"
8747 msgstr "Exception:POLLPRI:T{\n"
8748
8749 #. type: tbl table
8750 #: build/C/man7/socket.7:200
8751 #, no-wrap
8752 msgid "Urgent data arrived.\n"
8753 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8754
8755 #. type: tbl table
8756 #: build/C/man7/socket.7:201
8757 #, no-wrap
8758 msgid "B<SIGURG>\n"
8759 msgstr "B<SIGURG>\n"
8760
8761 #. type: tbl table
8762 #: build/C/man7/socket.7:202
8763 #, no-wrap
8764 msgid "is sent then.\n"
8765 msgstr "が送信される。\n"
8766
8767 #. type: Plain text
8768 #: build/C/man7/socket.7:231
8769 msgid ""
8770 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8771 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8772 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8773 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8774 "I<Signals> discussion below."
8775 msgstr ""
8776 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8777 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8778 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8779 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8780 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8781 "と。"
8782
8783 #. type: SS
8784 #: build/C/man7/socket.7:231
8785 #, no-wrap
8786 msgid "Socket address structures"
8787 msgstr "ソケットアドレス構造体"
8788
8789 #. type: Plain text
8790 #: build/C/man7/socket.7:247
8791 msgid ""
8792 "Each socket domain has its own format for socket addresses, with a domain-"
8793 "specific address structure.  Each of these structures begins with an integer "
8794 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8795 "address structure.  This allows the various system calls (e.g., B<connect>"
8796 "(2), B<bind>(2), B<accept>(2), B<getsockname>(2), B<getpeername>(2)), which "
8797 "are generic to all socket domains, to determine the domain of a particular "
8798 "socket address."
8799 msgstr ""
8800 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8801 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8802 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8803 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8804 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8805 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8806 "できる。"
8807
8808 #. type: Plain text
8809 #: build/C/man7/socket.7:257
8810 msgid ""
8811 "To allow any type of socket address to be passed to interfaces in the "
8812 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8813 "type is purely to allow casting of domain-specific socket address types to a "
8814 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8815 "calls to the sockets API."
8816 msgstr ""
8817 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8818 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8819 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8820 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8821 "告を出すのを避けることができる。"
8822
8823 #. type: Plain text
8824 #: build/C/man7/socket.7:267
8825 msgid ""
8826 "In addition, the sockets API provides the data type I<struct "
8827 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8828 "domain-specific socket address structures; it is large enough and is aligned "
8829 "properly.  (In particular, it is large enough to hold IPv6 socket "
8830 "addresses.)  The structure includes the following field, which can be used "
8831 "to identify the type of socket address actually stored in the structure:"
8832 msgstr ""
8833 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8834 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8835 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8836 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8837 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8838 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8839 "できる。"
8840
8841 #. type: Plain text
8842 #: build/C/man7/socket.7:271
8843 #, no-wrap
8844 msgid "    sa_family_t ss_family;\n"
8845 msgstr "    sa_family_t ss_family;\n"
8846
8847 #. type: Plain text
8848 #: build/C/man7/socket.7:279
8849 msgid ""
8850 "The I<sockaddr_storage> structure is useful in programs that must handle "
8851 "socket addresses in a generic way (e.g., programs that must deal with both "
8852 "IPv4 and IPv6 socket addresses)."
8853 msgstr ""
8854 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8855 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8856 "ログラム) で有用である。"
8857
8858 #. type: SS
8859 #: build/C/man7/socket.7:279
8860 #, no-wrap
8861 msgid "Socket options"
8862 msgstr "ソケットオプション"
8863
8864 #.  FIXME
8865 #.  In the list below, the text used to describe argument types
8866 #.  for each socket option should be more consistent
8867 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8868 #.  W R Stevens, UNPv1
8869 #. type: Plain text
8870 #: build/C/man7/socket.7:297
8871 msgid ""
8872 "The socket options listed below can be set by using B<setsockopt>(2)  and "
8873 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
8874 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
8875 msgstr ""
8876 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
8877 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8878 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
8879 "I<int> へのポインタである。"
8880
8881 #. type: TP
8882 #: build/C/man7/socket.7:297
8883 #, no-wrap
8884 msgid "B<SO_ACCEPTCONN>"
8885 msgstr "B<SO_ACCEPTCONN>"
8886
8887 #. type: Plain text
8888 #: build/C/man7/socket.7:305
8889 msgid ""
8890 "Returns a value indicating whether or not this socket has been marked to "
8891 "accept connections with B<listen>(2).  The value 0 indicates that this is "
8892 "not a listening socket, the value 1 indicates that this is a listening "
8893 "socket.  This socket option is read-only."
8894 msgstr ""
8895 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
8896 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
8897 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
8898
8899 #. type: TP
8900 #: build/C/man7/socket.7:305
8901 #, no-wrap
8902 msgid "B<SO_BINDTODEVICE>"
8903 msgstr "B<SO_BINDTODEVICE>"
8904
8905 #. type: Plain text
8906 #: build/C/man7/socket.7:324
8907 msgid ""
8908 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
8909 "the passed interface name.  If the name is an empty string or the option "
8910 "length is zero, the socket device binding is removed.  The passed option is "
8911 "a variable-length null-terminated interface name string with the maximum "
8912 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
8913 "received from that particular interface are processed by the socket.  Note "
8914 "that this works only for some socket types, particularly B<AF_INET> "
8915 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
8916 "there)."
8917 msgstr ""
8918 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
8919 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
8920 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
8921 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
8922 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
8923 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
8924 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
8925 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
8926 "B<bind>(2) を使うこと)。"
8927
8928 #. type: Plain text
8929 #: build/C/man7/socket.7:338
8930 msgid ""
8931 "Before Linux 3.8, this socket option could be set, but could not retrieved "
8932 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
8933 "argument should contain the buffer size available to receive the device name "
8934 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
8935 "reported back in the I<optlen> argument."
8936 msgstr ""
8937 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
8938 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
8939 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
8940 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
8941 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
8942
8943 #. type: TP
8944 #: build/C/man7/socket.7:338
8945 #, no-wrap
8946 msgid "B<SO_BROADCAST>"
8947 msgstr "B<SO_BROADCAST>"
8948
8949 #. type: Plain text
8950 #: build/C/man7/socket.7:344
8951 msgid ""
8952 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
8953 "to send packets to a broadcast address.  This option has no effect on stream-"
8954 "oriented sockets."
8955 msgstr ""
8956 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
8957 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
8958 "ストリーム指向のソケットには何の効果もない。"
8959
8960 #. type: TP
8961 #: build/C/man7/socket.7:344
8962 #, no-wrap
8963 msgid "B<SO_BSDCOMPAT>"
8964 msgstr "B<SO_BSDCOMPAT>"
8965
8966 #. type: Plain text
8967 #: build/C/man7/socket.7:356
8968 msgid ""
8969 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
8970 "module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP "
8971 "socket will not be passed to the user program.  In later kernel versions, "
8972 "support for this option has been phased out: Linux 2.4 silently ignores it, "
8973 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
8974 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
8975 "header changing, skipping of the broadcast flag) for raw sockets with this "
8976 "option, but that was removed in Linux 2.2."
8977 msgstr ""
8978 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
8979 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
8980 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
8981 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
8982 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
8983 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
8984 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
8985 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
8986 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
8987
8988 #. type: TP
8989 #: build/C/man7/socket.7:356
8990 #, no-wrap
8991 msgid "B<SO_DEBUG>"
8992 msgstr "B<SO_DEBUG>"
8993
8994 #. type: Plain text
8995 #: build/C/man7/socket.7:362
8996 msgid ""
8997 "Enable socket debugging.  Only allowed for processes with the "
8998 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
8999 msgstr ""
9000 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9001 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9002
9003 #. type: TP
9004 #: build/C/man7/socket.7:362
9005 #, no-wrap
9006 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9007 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9008
9009 #. type: Plain text
9010 #: build/C/man7/socket.7:370
9011 msgid ""
9012 "Retrieves the socket domain as an integer, returning a value such as "
9013 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9014 "only."
9015 msgstr ""
9016 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9017 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9018
9019 #. type: TP
9020 #: build/C/man7/socket.7:370
9021 #, no-wrap
9022 msgid "B<SO_ERROR>"
9023 msgstr "B<SO_ERROR>"
9024
9025 #. type: Plain text
9026 #: build/C/man7/socket.7:375
9027 msgid ""
9028 "Get and clear the pending socket error.  This socket option is read-only.  "
9029 "Expects an integer."
9030 msgstr ""
9031 "保留になっていたソケットエラーを取得してクリアする。\n"
9032 "このソケットオプションは読み込み専用である。整数値をとる。"
9033
9034 #. type: TP
9035 #: build/C/man7/socket.7:375
9036 #, no-wrap
9037 msgid "B<SO_DONTROUTE>"
9038 msgstr "B<SO_DONTROUTE>"
9039
9040 #. type: Plain text
9041 #: build/C/man7/socket.7:384
9042 msgid ""
9043 "Don't send via a gateway, send only to directly connected hosts.  The same "
9044 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9045 "B<send>(2)  operation.  Expects an integer boolean flag."
9046 msgstr ""
9047 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9048 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9049 "数のフラグを取る。"
9050
9051 #. type: TP
9052 #: build/C/man7/socket.7:384
9053 #, no-wrap
9054 msgid "B<SO_KEEPALIVE>"
9055 msgstr "B<SO_KEEPALIVE>"
9056
9057 #. type: Plain text
9058 #: build/C/man7/socket.7:388
9059 msgid ""
9060 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9061 "Expects an integer boolean flag."
9062 msgstr ""
9063 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9064 "の整数フラグをとる。"
9065
9066 #. type: TP
9067 #: build/C/man7/socket.7:388
9068 #, no-wrap
9069 msgid "B<SO_LINGER>"
9070 msgstr "B<SO_LINGER>"
9071
9072 #. type: Plain text
9073 #: build/C/man7/socket.7:396
9074 msgid ""
9075 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9076 msgstr ""
9077 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9078
9079 #. type: Plain text
9080 #: build/C/man7/socket.7:403
9081 #, no-wrap
9082 msgid ""
9083 "struct linger {\n"
9084 "    int l_onoff;    /* linger active */\n"
9085 "    int l_linger;   /* how many seconds to linger for */\n"
9086 "};\n"
9087 msgstr ""
9088 "struct linger {\n"
9089 "    int l_onoff;    /* linger active */\n"
9090 "    int l_linger;   /* how many seconds to linger for */\n"
9091 "};\n"
9092
9093 #. type: Plain text
9094 #: build/C/man7/socket.7:417
9095 msgid ""
9096 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9097 "queued messages for the socket have been successfully sent or the linger "
9098 "timeout has been reached.  Otherwise, the call returns immediately and the "
9099 "closing is done in the background.  When the socket is closed as part of "
9100 "B<exit>(2), it always lingers in the background."
9101 msgstr ""
9102 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9103 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9104 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9105 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9106 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9107 "送られる。"
9108
9109 #. type: TP
9110 #: build/C/man7/socket.7:417
9111 #, no-wrap
9112 msgid "B<SO_MARK> (since Linux 2.6.25)"
9113 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9114
9115 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9116 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9117 #. type: Plain text
9118 #: build/C/man7/socket.7:428
9119 msgid ""
9120 "Set the mark for each packet sent through this socket (similar to the "
9121 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9122 "mark-based routing without netfilter or for packet filtering.  Setting this "
9123 "option requires the B<CAP_NET_ADMIN> capability."
9124 msgstr ""
9125 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9126 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9127 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9128 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9129 "ティが必要である。"
9130
9131 #. type: TP
9132 #: build/C/man7/socket.7:428
9133 #, no-wrap
9134 msgid "B<SO_OOBINLINE>"
9135 msgstr "B<SO_OOBINLINE>"
9136
9137 #.  don't document it because it can do too much harm.
9138 #. .B SO_NO_CHECK
9139 #. type: Plain text
9140 #: build/C/man7/socket.7:437
9141 msgid ""
9142 "If this option is enabled, out-of-band data is directly placed into the "
9143 "receive data stream.  Otherwise out-of-band data is passed only when the "
9144 "B<MSG_OOB> flag is set during receiving."
9145 msgstr ""
9146 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9147 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9148 "ラグがセットされている場合に限って渡される。"
9149
9150 #. type: TP
9151 #: build/C/man7/socket.7:437
9152 #, no-wrap
9153 msgid "B<SO_PASSCRED>"
9154 msgstr "B<SO_PASSCRED>"
9155
9156 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9157 #.  in the 2.6.18 ChangeLog
9158 #. type: Plain text
9159 #: build/C/man7/socket.7:446
9160 msgid ""
9161 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9162 "For more information see B<unix>(7)."
9163 msgstr ""
9164 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9165 "を参照のこと。"
9166
9167 #. type: TP
9168 #: build/C/man7/socket.7:446
9169 #, no-wrap
9170 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9171 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9172
9173 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9174 #. type: Plain text
9175 #: build/C/man7/socket.7:456
9176 msgid ""
9177 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9178 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9179 "with B<MSG_PEEK> flag."
9180 msgstr ""
9181 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9182 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9183 "B<unix>(7) ソケットでのみサポートされている。"
9184
9185 #. type: Plain text
9186 #: build/C/man7/socket.7:464
9187 msgid ""
9188 "When this option is set to a negative value (it is set to -1 for all new "
9189 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9190 "flag will peek data from the front of the queue."
9191 msgstr ""
9192 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9193 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9194 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9195 "のソケットではこのオプションの値は必ず -1 に設定される。"
9196
9197 #. type: Plain text
9198 #: build/C/man7/socket.7:471
9199 msgid ""
9200 "When the option is set to a value greater than or equal to zero, then the "
9201 "next peek at data queued in the socket will occur at the byte offset "
9202 "specified by the option value.  At the same time, the \"peek offset\" will "
9203 "be incremented by the number of bytes that were peeked from the queue, so "
9204 "that a subsequent peek will return the next data in the queue."
9205 msgstr ""
9206 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9207 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9208 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9209 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9210
9211 #. type: Plain text
9212 #: build/C/man7/socket.7:483
9213 msgid ""
9214 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9215 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9216 "by the number of bytes removed.  In other words, receiving data without the "
9217 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9218 "the correct relative position in the queued data, so that a subsequent peek "
9219 "will retrieve the data that would have been retrieved had the data not been "
9220 "removed."
9221 msgstr ""
9222 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9223 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9224 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9225 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9226 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9227 "いうことである。"
9228
9229 #. type: Plain text
9230 #: build/C/man7/socket.7:488
9231 msgid ""
9232 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9233 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9234 msgstr ""
9235 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9236 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9237
9238 #. type: Plain text
9239 #: build/C/man7/socket.7:492
9240 msgid ""
9241 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9242 "Suppose a stream socket has the following queued input data:"
9243 msgstr ""
9244 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9245 "以下の入力データが入っているものとする。"
9246
9247 #. type: Plain text
9248 #: build/C/man7/socket.7:494
9249 #, no-wrap
9250 msgid "    aabbccddeeff\n"
9251 msgstr "    aabbccddeeff\n"
9252
9253 #. type: Plain text
9254 #: build/C/man7/socket.7:499
9255 msgid ""
9256 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9257 "the comments:"
9258 msgstr ""
9259 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9260
9261 #. type: Plain text
9262 #: build/C/man7/socket.7:504
9263 #, no-wrap
9264 msgid ""
9265 "int ov = 4;                  // Set peek offset to 4\n"
9266 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9267 msgstr ""
9268 "int ov = 4;                  // Set peek offset to 4\n"
9269 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9270
9271 #. type: Plain text
9272 #: build/C/man7/socket.7:509
9273 #, no-wrap
9274 msgid ""
9275 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9276 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9277 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9278 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9279 msgstr ""
9280 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9281 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9282 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9283 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9284
9285 #. type: TP
9286 #: build/C/man7/socket.7:511
9287 #, no-wrap
9288 msgid "B<SO_PEERCRED>"
9289 msgstr "B<SO_PEERCRED>"
9290
9291 #. type: Plain text
9292 #: build/C/man7/socket.7:534
9293 msgid ""
9294 "Return the credentials of the foreign process connected to this socket.  "
9295 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9296 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
9297 "(7).  The returned credentials are those that were in effect at the time of "
9298 "the call to B<connect>(2)  or B<socketpair>(2).  The argument is a I<ucred> "
9299 "structure; define the B<_GNU_SOURCE> feature test macro to obtain the "
9300 "definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This socket "
9301 "option is read-only."
9302 msgstr ""
9303 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9304 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9305 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9306 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9307 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9308 "る。 引き数は I<ucred> 構造体である。この構造体の定義を I<E<lt>sys/socket."
9309 "hE<gt>> を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義すること。 このソ"
9310 "ケットオプションは読み込み専用である。"
9311
9312 #. type: TP
9313 #: build/C/man7/socket.7:534
9314 #, no-wrap
9315 msgid "B<SO_PRIORITY>"
9316 msgstr "B<SO_PRIORITY>"
9317
9318 #. type: Plain text
9319 #: build/C/man7/socket.7:547
9320 msgid ""
9321 "Set the protocol-defined priority for all packets to be sent on this "
9322 "socket.  Linux uses this value to order the networking queues: packets with "
9323 "a higher priority may be processed first depending on the selected device "
9324 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9325 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9326 "6 requires the B<CAP_NET_ADMIN> capability."
9327 msgstr ""
9328 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9329 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9330 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9331 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9332 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9333 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9334
9335 #. type: TP
9336 #: build/C/man7/socket.7:547
9337 #, no-wrap
9338 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9339 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9340
9341 #. type: Plain text
9342 #: build/C/man7/socket.7:555
9343 msgid ""
9344 "Retrieves the socket protocol as an integer, returning a value such as "
9345 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9346 "only."
9347 msgstr ""
9348 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9349 "る。\n"
9350 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9351
9352 #. type: TP
9353 #: build/C/man7/socket.7:555
9354 #, no-wrap
9355 msgid "B<SO_RCVBUF>"
9356 msgstr "B<SO_RCVBUF>"
9357
9358 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9359 #.  The following thread on LMKL is quite informative:
9360 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9361 #.  17 July 2012
9362 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9363 #. type: Plain text
9364 #: build/C/man7/socket.7:574
9365 msgid ""
9366 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9367 "this value (to allow space for bookkeeping overhead)  when it is set using "
9368 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9369 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9370 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9371 "file.  The minimum (doubled) value for this option is 256."
9372 msgstr ""
9373 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9374 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9375 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9376 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9377 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9378 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9379
9380 #. type: TP
9381 #: build/C/man7/socket.7:574
9382 #, no-wrap
9383 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9384 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9385
9386 #. type: Plain text
9387 #: build/C/man7/socket.7:583
9388 msgid ""
9389 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9390 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9391 "overridden."
9392 msgstr ""
9393 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9394 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9395 "きすることができる。"
9396
9397 #. type: TP
9398 #: build/C/man7/socket.7:583
9399 #, no-wrap
9400 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9401 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9402
9403 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9404 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9405 #. type: Plain text
9406 #: build/C/man7/socket.7:612
9407 msgid ""
9408 "Specify the minimum number of bytes in the buffer until the socket layer "
9409 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9410 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9411 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9412 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9413 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9414 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9415 "single byte of data is available.  A subsequent read from the socket will "
9416 "block until B<SO_RCVLOWAT> bytes are available."
9417 msgstr ""
9418 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9419 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9420 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9421 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9422 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9423 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9424 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9425 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9426 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9427 "してしまう。"
9428
9429 #. type: TP
9430 #: build/C/man7/socket.7:612
9431 #, no-wrap
9432 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9433 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9434
9435 #.  Not implemented in 2.0.
9436 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9437 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9438 #.  in fact to EAGAIN
9439 #. type: Plain text
9440 #: build/C/man7/socket.7:647
9441 msgid ""
9442 "Specify the receiving or sending timeouts until reporting an error.  The "
9443 "argument is a I<struct timeval>.  If an input or output function blocks for "
9444 "this period of time, and data has been sent or received, the return value of "
9445 "that function will be the amount of data transferred; if no data has been "
9446 "transferred and the timeout has been reached, then -1 is returned with "
9447 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9448 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9449 "the timeout is set to zero (the default), then the operation will never "
9450 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9451 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9452 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9453 msgstr ""
9454 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9455 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9456 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9457 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9458 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> (B<connect>"
9459 "(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定されたように見"
9460 "える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操作は決してタ"
9461 "イムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット I/O を実行す"
9462 "るシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), B<send>(2), "
9463 "B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), B<epoll_wait>(2)  などには"
9464 "タイムアウトは影響を及ぼさない。"
9465
9466 #. type: TP
9467 #: build/C/man7/socket.7:647
9468 #, no-wrap
9469 msgid "B<SO_REUSEADDR>"
9470 msgstr "B<SO_REUSEADDR>"
9471
9472 #. type: Plain text
9473 #: build/C/man7/socket.7:662
9474 msgid ""
9475 "Indicates that the rules used in validating addresses supplied in a B<bind>"
9476 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
9477 "this means that a socket may bind, except when there is an active listening "
9478 "socket bound to the address.  When the listening socket is bound to "
9479 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
9480 "port for any local address.  Argument is an integer boolean flag."
9481 msgstr ""
9482 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9483 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9484 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9485 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9486 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9487 "ドできない。 引き数はブール整数のフラグである。"
9488
9489 #. type: TP
9490 #: build/C/man7/socket.7:662
9491 #, no-wrap
9492 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9493 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9494
9495 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9496 #. type: Plain text
9497 #: build/C/man7/socket.7:669
9498 msgid ""
9499 "Indicates that an unsigned 32-bit value ancilliary msg (cmsg)  should be "
9500 "attached to received skbs indicating the number of packets dropped by the "
9501 "socket between the last received packet and this received packet"
9502 msgstr ""
9503
9504 #. type: TP
9505 #: build/C/man7/socket.7:669
9506 #, no-wrap
9507 msgid "B<SO_SNDBUF>"
9508 msgstr "B<SO_SNDBUF>"
9509
9510 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9511 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9512 #. type: Plain text
9513 #: build/C/man7/socket.7:685
9514 msgid ""
9515 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9516 "this value (to allow space for bookkeeping overhead)  when it is set using "
9517 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9518 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9519 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9520 "file.  The minimum (doubled) value for this option is 2048."
9521 msgstr ""
9522 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9523 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9524 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9525 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9526 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9527 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9528
9529 #. type: TP
9530 #: build/C/man7/socket.7:685
9531 #, no-wrap
9532 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9533 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9534
9535 #. type: Plain text
9536 #: build/C/man7/socket.7:694
9537 msgid ""
9538 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9539 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9540 "overridden."
9541 msgstr ""
9542 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9543 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9544 "きすることができる。"
9545
9546 #. type: TP
9547 #: build/C/man7/socket.7:694
9548 #, no-wrap
9549 msgid "B<SO_TIMESTAMP>"
9550 msgstr "B<SO_TIMESTAMP>"
9551
9552 #. type: Plain text
9553 #: build/C/man7/socket.7:710
9554 msgid ""
9555 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9556 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9557 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9558 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9559 "details on control messages."
9560 msgstr ""
9561 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9562 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9563 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9564 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9565
9566 #. type: TP
9567 #: build/C/man7/socket.7:710
9568 #, no-wrap
9569 msgid "B<SO_TYPE>"
9570 msgstr "B<SO_TYPE>"
9571
9572 #. type: Plain text
9573 #: build/C/man7/socket.7:715
9574 msgid ""
9575 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9576 "option is read-only."
9577 msgstr ""
9578 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9579 "このソケットオプションは読み出し専用である。"
9580
9581 #. type: TP
9582 #: build/C/man7/socket.7:715
9583 #, no-wrap
9584 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9585 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9586
9587 #. type: Plain text
9588 #: build/C/man7/socket.7:724
9589 msgid ""
9590 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9591 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9592 "The default for this option is controlled by the I</proc/sys/net/core/"
9593 "busy_read> file."
9594 msgstr ""
9595
9596 #. type: Plain text
9597 #: build/C/man7/socket.7:734
9598 msgid ""
9599 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9600 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9601 "with B<SO_BUSY_POLL> set and no events to report are found."
9602 msgstr ""
9603
9604 #. type: Plain text
9605 #: build/C/man7/socket.7:738
9606 msgid ""
9607 "In both cases, busy polling will only be done when the socket last received "
9608 "data from a network device that supports this option."
9609 msgstr ""
9610
9611 #. type: Plain text
9612 #: build/C/man7/socket.7:742
9613 msgid ""
9614 "While busy polling may improve latency of some applications, care must be "
9615 "taken when using it since this will increase both CPU utilization and power "
9616 "usage."
9617 msgstr ""
9618
9619 #. type: SS
9620 #: build/C/man7/socket.7:742
9621 #, no-wrap
9622 msgid "Signals"
9623 msgstr "シグナル"
9624
9625 #. type: Plain text
9626 #: build/C/man7/socket.7:753
9627 msgid ""
9628 "When writing onto a connection-oriented socket that has been shut down (by "
9629 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9630 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9631 "the B<MSG_NOSIGNAL> flag."
9632 msgstr ""
9633 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9634 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9635 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9636 "していた場合はシグナルは送られない。"
9637
9638 #. type: Plain text
9639 #: build/C/man7/socket.7:778
9640 msgid ""
9641 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
9642 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
9643 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
9644 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
9645 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
9646 "signal will be called with the file descriptor in the I<si_fd> field of its "
9647 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
9648 msgstr ""
9649 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9650 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9651 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9652 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9653 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9654 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9655 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9656 "を参照のこと。"
9657
9658 #.  .SS Ancillary messages
9659 #. type: Plain text
9660 #: build/C/man7/socket.7:786
9661 msgid ""
9662 "Under some circumstances (e.g., multiple processes accessing a single "
9663 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9664 "when the process reacts to the signal.  If this happens, the process should "
9665 "wait again because Linux will resend the signal later."
9666 msgstr ""
9667 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9668 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9669 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9670 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9671
9672 #. type: SS
9673 #: build/C/man7/socket.7:786
9674 #, no-wrap
9675 msgid "/proc interfaces"
9676 msgstr "/proc インタフェース"
9677
9678 #. type: Plain text
9679 #: build/C/man7/socket.7:790
9680 msgid ""
9681 "The core socket networking parameters can be accessed via files in the "
9682 "directory I</proc/sys/net/core/>."
9683 msgstr ""
9684 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9685 "レクトリ内のファイルを通してアクセスできる。"
9686
9687 #. type: TP
9688 #: build/C/man7/socket.7:790
9689 #, no-wrap
9690 msgid "I<rmem_default>"
9691 msgstr "I<rmem_default>"
9692
9693 #. type: Plain text
9694 #: build/C/man7/socket.7:793
9695 msgid "contains the default setting in bytes of the socket receive buffer."
9696 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9697
9698 #. type: TP
9699 #: build/C/man7/socket.7:793
9700 #, no-wrap
9701 msgid "I<rmem_max>"
9702 msgstr "I<rmem_max>"
9703
9704 #. type: Plain text
9705 #: build/C/man7/socket.7:799
9706 msgid ""
9707 "contains the maximum socket receive buffer size in bytes which a user may "
9708 "set by using the B<SO_RCVBUF> socket option."
9709 msgstr ""
9710 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9711 "ファサイズの最大値 (バイト単位)。"
9712
9713 #. type: TP
9714 #: build/C/man7/socket.7:799
9715 #, no-wrap
9716 msgid "I<wmem_default>"
9717 msgstr "I<wmem_default>"
9718
9719 #. type: Plain text
9720 #: build/C/man7/socket.7:802
9721 msgid "contains the default setting in bytes of the socket send buffer."
9722 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9723
9724 #. type: TP
9725 #: build/C/man7/socket.7:802
9726 #, no-wrap
9727 msgid "I<wmem_max>"
9728 msgstr "I<wmem_max>"
9729
9730 #. type: Plain text
9731 #: build/C/man7/socket.7:808
9732 msgid ""
9733 "contains the maximum socket send buffer size in bytes which a user may set "
9734 "by using the B<SO_SNDBUF> socket option."
9735 msgstr ""
9736 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9737 "ファサイズの最大値 (バイト単位)。"
9738
9739 #. type: TP
9740 #: build/C/man7/socket.7:808
9741 #, no-wrap
9742 msgid "I<message_cost> and I<message_burst>"
9743 msgstr "I<message_cost> と I<message_burst>"
9744
9745 #. type: Plain text
9746 #: build/C/man7/socket.7:812
9747 msgid ""
9748 "configure the token bucket filter used to load limit warning messages caused "
9749 "by external network events."
9750 msgstr ""
9751 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9752 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9753
9754 #. type: TP
9755 #: build/C/man7/socket.7:812
9756 #, no-wrap
9757 msgid "I<netdev_max_backlog>"
9758 msgstr "I<netdev_max_backlog>"
9759
9760 #. type: Plain text
9761 #: build/C/man7/socket.7:815
9762 msgid "Maximum number of packets in the global input queue."
9763 msgstr "グローバルな入力キューにおける最大のパケット数。"
9764
9765 #. type: TP
9766 #: build/C/man7/socket.7:815
9767 #, no-wrap
9768 msgid "I<optmem_max>"
9769 msgstr "I<optmem_max>"
9770
9771 #.  netdev_fastroute is not documented because it is experimental
9772 #. type: Plain text
9773 #: build/C/man7/socket.7:820
9774 msgid ""
9775 "Maximum length of ancillary data and user control data like the iovecs per "
9776 "socket."
9777 msgstr ""
9778 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9779 "うなもの) との和の最大長。"
9780
9781 #. type: SS
9782 #: build/C/man7/socket.7:820
9783 #, no-wrap
9784 msgid "Ioctls"
9785 msgstr "ioctl"
9786
9787 #. type: Plain text
9788 #: build/C/man7/socket.7:823
9789 msgid "These operations can be accessed using B<ioctl>(2):"
9790 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9791
9792 #. type: Plain text
9793 #: build/C/man7/socket.7:827
9794 #, no-wrap
9795 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9796 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9797
9798 #. type: TP
9799 #: build/C/man7/socket.7:829
9800 #, no-wrap
9801 msgid "B<SIOCGSTAMP>"
9802 msgstr "B<SIOCGSTAMP>"
9803
9804 #. type: Plain text
9805 #: build/C/man7/socket.7:853
9806 msgid ""
9807 "Return a I<struct timeval> with the receive timestamp of the last packet "
9808 "passed to the user.  This is useful for accurate round trip time "
9809 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9810 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9811 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9812 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9813 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9814 "to B<ENOENT>)."
9815 msgstr ""
9816 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9817 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9818 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9819 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9820 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9821 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9822 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9823 "セットする)。"
9824
9825 #. type: TP
9826 #: build/C/man7/socket.7:853
9827 #, no-wrap
9828 msgid "B<SIOCSPGRP>"
9829 msgstr "B<SIOCSPGRP>"
9830
9831 #. type: Plain text
9832 #: build/C/man7/socket.7:872
9833 msgid ""
9834 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9835 "when an asynchronous I/O operation has finished or urgent data is "
9836 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9837 "positive, send the signals to that process.  If the argument is negative, "
9838 "send the signals to the process group with the ID of the absolute value of "
9839 "the argument.  The process may only choose itself or its own process group "
9840 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9841 "UID of 0."
9842 msgstr ""
9843 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9844 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9845 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9846 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9847 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9848 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9849 "の場合は この限りではない。"
9850
9851 #. type: TP
9852 #: build/C/man7/socket.7:872
9853 #, no-wrap
9854 msgid "B<FIOASYNC>"
9855 msgstr "B<FIOASYNC>"
9856
9857 #. type: Plain text
9858 #: build/C/man7/socket.7:882
9859 msgid ""
9860 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9861 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9862 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9863 msgstr ""
9864 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9865 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9866 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9867
9868 #. type: Plain text
9869 #: build/C/man7/socket.7:890
9870 msgid ""
9871 "Argument is an integer boolean flag.  (This operation is synonymous with the "
9872 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
9873 msgstr ""
9874 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
9875 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
9876
9877 #. type: TP
9878 #: build/C/man7/socket.7:890
9879 #, no-wrap
9880 msgid "B<SIOCGPGRP>"
9881 msgstr "B<SIOCGPGRP>"
9882
9883 #. type: Plain text
9884 #: build/C/man7/socket.7:899
9885 msgid ""
9886 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
9887 "signals, or 0 when none is set."
9888 msgstr ""
9889 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
9890 "る。 ない場合は 0 が返る。"
9891
9892 #. type: Plain text
9893 #: build/C/man7/socket.7:903
9894 msgid "Valid B<fcntl>(2)  operations:"
9895 msgstr "有効な B<fcntl>(2)  操作:"
9896
9897 #. type: TP
9898 #: build/C/man7/socket.7:903
9899 #, no-wrap
9900 msgid "B<FIOGETOWN>"
9901 msgstr "B<FIOGETOWN>"
9902
9903 #. type: Plain text
9904 #: build/C/man7/socket.7:908
9905 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
9906 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
9907
9908 #. type: TP
9909 #: build/C/man7/socket.7:908
9910 #, no-wrap
9911 msgid "B<FIOSETOWN>"
9912 msgstr "B<FIOSETOWN>"
9913
9914 #. type: Plain text
9915 #: build/C/man7/socket.7:913
9916 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
9917 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
9918
9919 #. type: Plain text
9920 #: build/C/man7/socket.7:927
9921 msgid ""
9922 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
9923 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
9924 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
9925 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
9926 "be read or written."
9927 msgstr ""
9928 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
9929 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
9930 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
9931 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
9932 "はできなかった。"
9933
9934 #. type: Plain text
9935 #: build/C/man7/socket.7:932
9936 msgid ""
9937 "Linux assumes that half of the send/receive buffer is used for internal "
9938 "kernel structures; thus the values in the corresponding I</proc> files are "
9939 "twice what can be observed on the wire."
9940 msgstr ""
9941 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
9942 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
9943 "なる。"
9944
9945 #. type: Plain text
9946 #: build/C/man7/socket.7:945
9947 msgid ""
9948 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
9949 "option was set both in the previous program that performed a B<bind>(2)  to "
9950 "the port and in the program that wants to reuse the port.  This differs from "
9951 "some implementations (e.g., FreeBSD)  where only the later program needs to "
9952 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
9953 "since, for example, a server program is designed to always set this option."
9954 msgstr ""
9955 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
9956 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
9957 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
9958 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
9959 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
9960 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
9961 "このオプションをセットするように設計されるからである。"
9962
9963 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
9964 #.  .SH AUTHORS
9965 #.  This man page was written by Andi Kleen.
9966 #. type: Plain text
9967 #: build/C/man7/socket.7:958
9968 msgid ""
9969 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
9970 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
9971 "is via the libpcap library."
9972 msgstr ""
9973 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
9974 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
9975 "して 用いる方が良い。"
9976
9977 #. type: Plain text
9978 #: build/C/man7/socket.7:970
9979 msgid ""
9980 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
9981 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9982 "B<unix>(7)"
9983 msgstr ""
9984 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
9985 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
9986 "B<unix>(7)"
9987
9988 #. type: TH
9989 #: build/C/man2/socketcall.2:25
9990 #, no-wrap
9991 msgid "SOCKETCALL"
9992 msgstr "SOCKETCALL"
9993
9994 #. type: TH
9995 #: build/C/man2/socketcall.2:25
9996 #, no-wrap
9997 msgid "2012-10-16"
9998 msgstr "2012-10-16"
9999
10000 #. type: Plain text
10001 #: build/C/man2/socketcall.2:28
10002 msgid "socketcall - socket system calls"
10003 msgstr "socketcall - ソケット・システムコール"
10004
10005 #. type: Plain text
10006 #: build/C/man2/socketcall.2:30
10007 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10008 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10009
10010 #. type: Plain text
10011 #: build/C/man2/socketcall.2:38
10012 msgid ""
10013 "B<socketcall>()  is a common kernel entry point for the socket system "
10014 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10015 "to a block containing the actual arguments, which are passed through to the "
10016 "appropriate call."
10017 msgstr ""
10018 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
10019 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10020 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10021 "ロックを指す。"
10022
10023 #. type: Plain text
10024 #: build/C/man2/socketcall.2:42
10025 msgid ""
10026 "User programs should call the appropriate functions by their usual names.  "
10027 "Only standard library implementors and kernel hackers need to know about "
10028 "B<socketcall>()."
10029 msgstr ""
10030 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10031 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
10032 "必要がある。"
10033
10034 #. type: Plain text
10035 #: build/C/man2/socketcall.2:45
10036 msgid ""
10037 "This call is specific to Linux, and should not be used in programs intended "
10038 "to be portable."
10039 msgstr ""
10040 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10041 "い。"
10042
10043 #. type: Plain text
10044 #: build/C/man2/socketcall.2:53
10045 msgid ""
10046 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10047 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), B<bind>"
10048 "(2), and so on really are implemented as separate system calls."
10049 msgstr ""
10050 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10051 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10052 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10053
10054 #. type: Plain text
10055 #: build/C/man2/socketcall.2:71
10056 msgid ""
10057 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10058 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10059 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10060 "(2), B<socket>(2), B<socketpair>(2)"
10061 msgstr ""
10062 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
10063 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
10064 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
10065 "(2), B<socket>(2), B<socketpair>(2)"
10066
10067 #. type: TH
10068 #: build/C/man2/socketpair.2:42
10069 #, no-wrap
10070 msgid "SOCKETPAIR"
10071 msgstr "SOCKETPAIR"
10072
10073 #. type: TH
10074 #: build/C/man2/socketpair.2:42
10075 #, no-wrap
10076 msgid "2008-10-11"
10077 msgstr "2008-10-11"
10078
10079 #. type: Plain text
10080 #: build/C/man2/socketpair.2:45
10081 msgid "socketpair - create a pair of connected sockets"
10082 msgstr "socketpair - 接続されたソケットのペアを作成する"
10083
10084 #. type: Plain text
10085 #: build/C/man2/socketpair.2:52
10086 msgid ""
10087 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10088 ">I<sv>B<[2]);>"
10089 msgstr ""
10090 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10091 ">I<sv>B<[2]);>"
10092
10093 #. type: Plain text
10094 #: build/C/man2/socketpair.2:63
10095 msgid ""
10096 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10097 "the specified I<domain>, of the specified I<type>, and using the optionally "
10098 "specified I<protocol>.  For further details of these arguments, see B<socket>"
10099 "(2)."
10100 msgstr ""
10101 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10102 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10103 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10104
10105 #. type: Plain text
10106 #: build/C/man2/socketpair.2:69
10107 msgid ""
10108 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10109 "and I<sv>[1].  The two sockets are indistinguishable."
10110 msgstr ""
10111 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10112 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10113
10114 #. type: Plain text
10115 #: build/C/man2/socketpair.2:78
10116 msgid "The specified address family is not supported on this machine."
10117 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10118
10119 #. type: Plain text
10120 #: build/C/man2/socketpair.2:83
10121 msgid ""
10122 "The address I<sv> does not specify a valid part of the process address space."
10123 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10124
10125 #. type: Plain text
10126 #: build/C/man2/socketpair.2:86
10127 msgid "Too many descriptors are in use by this process."
10128 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10129
10130 #. type: Plain text
10131 #: build/C/man2/socketpair.2:92
10132 msgid "The specified protocol does not support creation of socket pairs."
10133 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10134
10135 #. type: Plain text
10136 #: build/C/man2/socketpair.2:95
10137 msgid "The specified protocol is not supported on this machine."
10138 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10139
10140 #. type: Plain text
10141 #: build/C/man2/socketpair.2:103
10142 msgid ""
10143 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10144 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10145 "of the BSD socket layer (including System V variants)."
10146 msgstr ""
10147 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10148 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
10149 "BSD 以外のシステムと、 互いに移植性がある。"
10150
10151 #. type: Plain text
10152 #: build/C/man2/socketpair.2:109
10153 msgid ""
10154 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10155 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10156 "restriction.)"
10157 msgstr ""
10158 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10159 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10160
10161 #. type: Plain text
10162 #: build/C/man2/socketpair.2:118
10163 msgid ""
10164 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10165 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10166 msgstr ""
10167 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10168 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10169
10170 #. type: Plain text
10171 #: build/C/man2/socketpair.2:131
10172 msgid ""
10173 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10174 msgstr ""
10175 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"