OSDN Git Service

Update the version to 3.68 in ja.po
[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-06-08 01:30+0900\n"
10 "PO-Revision-Date: 2014-06-08 01:37+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man2/accept.2:41
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:41
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68 build/C/man2/connect.2:67
32 #: build/C/man2/getsockname.2:40 build/C/man2/getsockopt.2:44
33 #: build/C/man2/listen.2:45 build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:32
35 #: build/C/man2/send.2:40 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:25 build/C/man2/socket.2:43
37 #: build/C/man7/socket.7: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:408 build/C/man2/recvmmsg.2:148
310 #: build/C/man2/select.2:299 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:294 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2:310
313 #: build/C/man2/socketpair.2:69
314 #, no-wrap
315 msgid "RETURN VALUE"
316 msgstr "返り値"
317
318 #. type: Plain text
319 #: build/C/man2/accept.2:187
320 msgid ""
321 "On success, these system calls return a nonnegative integer that is a "
322 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
323 "is set appropriately."
324 msgstr ""
325 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
326 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
327 "定する。"
328
329 #. type: SS
330 #: build/C/man2/accept.2:187
331 #, no-wrap
332 msgid "Error handling"
333 msgstr "エラー処理"
334
335 #. type: Plain text
336 #: build/C/man2/accept.2:214
337 msgid ""
338 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
339 "on the new socket as an error code from B<accept>().  This behavior differs "
340 "from other BSD socket implementations.  For reliable operation the "
341 "application should detect the network errors defined for the protocol after "
342 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In the case of TCP/"
343 "IP, these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, "
344 "B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
345 msgstr ""
346 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
347 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
348 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
349 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
350 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
351 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
352 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
353 "B<ENETUNREACH>"
354
355 #. type: SH
356 #: build/C/man2/accept.2:214 build/C/man2/bind.2:157
357 #: build/C/man3/bindresvport.3:72 build/C/man2/connect.2:132
358 #: build/C/man3/getifaddrs.3:149 build/C/man2/getsockname.2:72
359 #: build/C/man2/getsockopt.2:136 build/C/man3/if_nameindex.3:78
360 #: build/C/man3/if_nametoindex.3:69 build/C/man2/listen.2:87
361 #: build/C/man2/recv.2:424 build/C/man2/recvmmsg.2:156
362 #: build/C/man2/select.2:317 build/C/man2/send.2:299
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2:315 build/C/man2/socketpair.2:74
365 #, no-wrap
366 msgid "ERRORS"
367 msgstr "エラー"
368
369 #. type: TP
370 #: build/C/man2/accept.2:215 build/C/man2/recv.2:429 build/C/man2/send.2:315
371 #, no-wrap
372 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
373 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
374
375 #.  Actually EAGAIN on Linux
376 #. type: Plain text
377 #: build/C/man2/accept.2:223
378 msgid ""
379 "The socket is marked nonblocking and no connections are present to be "
380 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
381 "and does not require these constants to have the same value, so a portable "
382 "application should check for both possibilities."
383 msgstr ""
384 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
385 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
386 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
387 "ションでは、両方の可能性を 確認すべきである。"
388
389 #. type: TP
390 #: build/C/man2/accept.2:223 build/C/man2/bind.2:176
391 #: build/C/man2/connect.2:176 build/C/man2/getsockname.2:73
392 #: build/C/man2/getsockopt.2:137 build/C/man2/listen.2:104
393 #: build/C/man2/recv.2:438 build/C/man2/select.2:318 build/C/man2/send.2:336
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプタが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:202
417 #: build/C/man2/connect.2:182 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:447
419 #: build/C/man2/send.2:345 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:210
432 #: build/C/man2/recv.2:451 build/C/man2/select.2:323 build/C/man2/send.2:348
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:180
448 #: build/C/man2/bind.2:206 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:456
450 #: build/C/man2/recvmmsg.2:160 build/C/man2/select.2:327
451 #: build/C/man2/send.2:352 build/C/man3/sockatmark.3:63
452 #: build/C/man2/socket.2:323 build/C/man2/socket.2:326
453 #, no-wrap
454 msgid "B<EINVAL>"
455 msgstr "B<EINVAL>"
456
457 #. type: Plain text
458 #: build/C/man2/accept.2:244
459 msgid ""
460 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
461 "negative)."
462 msgstr ""
463 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
464 "負の場合など)。"
465
466 #. type: Plain text
467 #: build/C/man2/accept.2:249
468 msgid "(B<accept4>())  invalid value in I<flags>."
469 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
470
471 #. type: TP
472 #: build/C/man2/accept.2:249 build/C/man2/socket.2:331
473 #: build/C/man2/socketpair.2:83
474 #, no-wrap
475 msgid "B<EMFILE>"
476 msgstr "B<EMFILE>"
477
478 #. type: Plain text
479 #: build/C/man2/accept.2:252
480 msgid "The per-process limit of open file descriptors has been reached."
481 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
482
483 #. type: TP
484 #: build/C/man2/accept.2:252 build/C/man2/socket.2:334
485 #: build/C/man2/socketpair.2:86
486 #, no-wrap
487 msgid "B<ENFILE>"
488 msgstr "B<ENFILE>"
489
490 #. type: Plain text
491 #: build/C/man2/accept.2:255 build/C/man2/socket.2:337
492 #: build/C/man2/socketpair.2:89
493 msgid "The system limit on the total number of open files has been reached."
494 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
495
496 #. type: TP
497 #: build/C/man2/accept.2:255
498 #, no-wrap
499 msgid "B<ENOBUFS>, B<ENOMEM>"
500 msgstr "B<ENOBUFS>, B<ENOMEM>"
501
502 #. type: Plain text
503 #: build/C/man2/accept.2:260
504 msgid ""
505 "Not enough free memory.  This often means that the memory allocation is "
506 "limited by the socket buffer limits, not by the system memory."
507 msgstr ""
508 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
509 "ケットバッファの大きさによるメモリ割り当ての制限である。"
510
511 #. type: TP
512 #: build/C/man2/accept.2:260 build/C/man2/bind.2:185
513 #: build/C/man2/connect.2:222 build/C/man2/getsockname.2:92
514 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:109
515 #: build/C/man2/recv.2:471 build/C/man2/send.2:381
516 #, no-wrap
517 msgid "B<ENOTSOCK>"
518 msgstr "B<ENOTSOCK>"
519
520 #. type: Plain text
521 #: build/C/man2/accept.2:263
522 msgid "The descriptor references a file, not a socket."
523 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
524
525 #. type: TP
526 #: build/C/man2/accept.2:263 build/C/man2/listen.2:114 build/C/man2/send.2:386
527 #: build/C/man2/socketpair.2:89
528 #, no-wrap
529 msgid "B<EOPNOTSUPP>"
530 msgstr "B<EOPNOTSUPP>"
531
532 #. type: Plain text
533 #: build/C/man2/accept.2:267
534 msgid "The referenced socket is not of type B<SOCK_STREAM>."
535 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
536
537 #. type: TP
538 #: build/C/man2/accept.2:267
539 #, no-wrap
540 msgid "B<EPROTO>"
541 msgstr "B<EPROTO>"
542
543 #. type: Plain text
544 #: build/C/man2/accept.2:270
545 msgid "Protocol error."
546 msgstr "プロトコル・エラー。"
547
548 #. type: Plain text
549 #: build/C/man2/accept.2:274
550 msgid "In addition, Linux B<accept>()  may fail if:"
551 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
552
553 #. type: TP
554 #: build/C/man2/accept.2:274
555 #, no-wrap
556 msgid "B<EPERM>"
557 msgstr "B<EPERM>"
558
559 #. type: Plain text
560 #: build/C/man2/accept.2:277
561 msgid "Firewall rules forbid connection."
562 msgstr "ファイアウォールのルールにより接続が禁止された。"
563
564 #. type: Plain text
565 #: build/C/man2/accept.2:289
566 msgid ""
567 "In addition, network errors for the new socket and as defined for the "
568 "protocol may be returned.  Various Linux kernels can return other errors "
569 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
570 "value B<ERESTARTSYS> may be seen during a trace."
571 msgstr ""
572 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
573 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
574 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
575 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
576 "ともある。"
577
578 #. type: SH
579 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
580 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:164
581 #: build/C/man2/select.2: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:233
598 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:232
599 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
600 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
601 #: build/C/man3/if_nametoindex.3:92 build/C/man2/listen.2:119
602 #: build/C/man2/recv.2:476 build/C/man2/recvmmsg.2:169
603 #: build/C/man2/select.2:342 build/C/man2/send.2:400
604 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
605 #: build/C/man2/socket.2:348 build/C/man2/socketcall.2:42
606 #: build/C/man2/socketpair.2:95
607 #, no-wrap
608 msgid "CONFORMING TO"
609 msgstr "準拠"
610
611 #.  The BSD man page documents five possible error returns
612 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
613 #.  POSIX.1-2001 documents errors
614 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
615 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
616 #.  In addition, SUSv2 documents EFAULT and ENOSR.
617 #. type: Plain text
618 #: build/C/man2/accept.2:306
619 msgid ""
620 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
621 "4.2BSD)."
622 msgstr ""
623 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
624 "された)."
625
626 #. type: Plain text
627 #: build/C/man2/accept.2:309
628 msgid "B<accept4>()  is a nonstandard Linux extension."
629 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
630
631 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
632 #.  do not inherit file status flags -- MTK Jun 05
633 #. type: Plain text
634 #: build/C/man2/accept.2:324
635 msgid ""
636 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
637 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
638 "socket.  This behavior differs from the canonical BSD sockets "
639 "implementation.  Portable programs should not rely on inheritance or "
640 "noninheritance of file status flags and always explicitly set all required "
641 "flags on the socket returned from B<accept>()."
642 msgstr ""
643 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
644 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
645 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
646 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に "
647 "B<accept>()  が返したソケットに対して全ての必要なフラグを明示的に設定するよう"
648 "に すべきである。"
649
650 #. type: SH
651 #: build/C/man2/accept.2:324 build/C/man2/bind.2:245
652 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:248
653 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
654 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:124
655 #: build/C/man2/recv.2:486 build/C/man2/select.2:357
656 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:414
657 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
658 #: build/C/man2/socket.2:362 build/C/man7/socket.7: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:251
666 #: build/C/man2/connect.2:254 build/C/man2/getsockopt.2:184
667 #: build/C/man2/listen.2:150 build/C/man2/socket.2:368
668 #: build/C/man2/socketpair.2:124
669 msgid ""
670 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
671 "this header file is not required on Linux.  However, some historical (BSD) "
672 "implementations required this header file, and portable applications are "
673 "probably wise to include it."
674 msgstr ""
675 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
676 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
677 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
678 "ションではこのファイルを インクルードするのが賢明であろう。"
679
680 #. type: Plain text
681 #: build/C/man2/accept.2:351
682 msgid ""
683 "There may not always be a connection waiting after a B<SIGIO> is delivered "
684 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
685 "connection might have been removed by an asynchronous network error or "
686 "another thread before B<accept>()  is called.  If this happens, then the "
687 "call will block waiting for the next connection to arrive.  To ensure that "
688 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
689 "B<O_NONBLOCK> flag set (see B<socket>(7))."
690 msgstr ""
691 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
692 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
693 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
694 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
695 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
696 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
697 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
698 "見よ)。"
699
700 #. type: SS
701 #: build/C/man2/accept.2:351
702 #, no-wrap
703 msgid "The socklen_t type"
704 msgstr "socklen_t 型"
705
706 #. type: Plain text
707 #: build/C/man2/accept.2:361
708 msgid ""
709 "The third argument of B<accept>()  was originally declared as an I<int *> "
710 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
711 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
712 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
713 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
714 "Torvalds:"
715 msgstr ""
716 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
717 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
718 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
719 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
720 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
721 "た。 Linus Torvald の発言を引用する:"
722
723 #.  .I fails: only italicizes a single line
724 #. type: Plain text
725 #: build/C/man2/accept.2:378
726 msgid ""
727 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
728 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
729 "make it a size_t, and I (and hopefully others, but obviously not too many) "
730 "complained to them very loudly indeed.  Making it a size_t is completely "
731 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
732 "bit architectures, for example.  And it I<has> to be the same size as \"int"
733 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
734 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
735 "have touched it in the first place, but once they did they felt it had to "
736 "have a named type for some unfathomable reason (probably somebody didn't "
737 "like losing face over having done the original stupid thing, so they "
738 "silently just renamed their blunder).\""
739 msgstr ""
740 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
741 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
742 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
743 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
744 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
745 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
746 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
747 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
748 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
749 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
750 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
751 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
752 "う)。」"
753
754 #. type: SH
755 #: build/C/man2/accept.2:378 build/C/man2/bind.2:265
756 #: build/C/man2/connect.2:265 build/C/man3/getifaddrs.3:207
757 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:179
758 #: build/C/man2/recv.2:521 build/C/man2/recvmmsg.2:172
759 #: build/C/man2/select.2:548 build/C/man2/select_tut.2:529
760 #: build/C/man2/send.2:451 build/C/man2/sendmmsg.2:168
761 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:381
762 #, no-wrap
763 msgid "EXAMPLE"
764 msgstr "例"
765
766 #. type: Plain text
767 #: build/C/man2/accept.2:381 build/C/man2/listen.2:182
768 msgid "See B<bind>(2)."
769 msgstr "B<bind>(2)  参照。"
770
771 #. type: SH
772 #: build/C/man2/accept.2:381 build/C/man2/bind.2:330
773 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:270
774 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
775 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
776 #: build/C/man3/if_nametoindex.3:96 build/C/man2/listen.2:182
777 #: build/C/man2/recv.2:526 build/C/man2/recvmmsg.2:278
778 #: build/C/man2/select.2:585 build/C/man2/select_tut.2:821
779 #: build/C/man2/send.2:456 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:343
798 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:277
799 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
800 #: build/C/man2/getsockopt.2:213 build/C/man3/if_nameindex.3:154
801 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:188
802 #: build/C/man2/recv.2:537 build/C/man2/recvmmsg.2:285
803 #: build/C/man2/select.2:599 build/C/man2/select_tut.2:840
804 #: build/C/man2/send.2:471 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:396 build/C/man2/bind.2:351
814 #: build/C/man3/bindresvport.3:124 build/C/man2/connect.2:285
815 #: build/C/man3/getifaddrs.3:323 build/C/man2/getsockname.2:129
816 #: build/C/man2/getsockopt.2:221 build/C/man3/if_nameindex.3:162
817 #: build/C/man3/if_nametoindex.3:108 build/C/man2/listen.2:196
818 #: build/C/man2/recv.2:545 build/C/man2/recvmmsg.2:293
819 #: build/C/man2/select.2:607 build/C/man2/select_tut.2:848
820 #: build/C/man2/send.2:479 build/C/man2/sendmmsg.2:249
821 #: build/C/man3/sockatmark.3:152 build/C/man2/socket.2:423
822 #: build/C/man7/socket.7:978 build/C/man2/socketcall.2:79
823 #: build/C/man2/socketpair.2:139
824 msgid ""
825 "This page is part of release 3.68 of the Linux I<man-pages> project.  A "
826 "description of the project, information about reporting bugs, and the latest "
827 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
828 "pages/."
829 msgstr ""
830 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.68 の一部\n"
831 "である。プロジェクトの説明とバグ報告に関する情報は\n"
832 "http://www.kernel.org/doc/man-pages/ に書かれている。"
833
834 #. type: TH
835 #: build/C/man2/bind.2:68
836 #, no-wrap
837 msgid "BIND"
838 msgstr "BIND"
839
840 #. type: TH
841 #: build/C/man2/bind.2:68 build/C/man2/connect.2:67 build/C/man2/listen.2:45
842 #: build/C/man2/recv.2:41 build/C/man2/send.2:40
843 #, no-wrap
844 msgid "2014-05-10"
845 msgstr "2014-05-10"
846
847 #. type: Plain text
848 #: build/C/man2/bind.2:71
849 msgid "bind - bind a name to a socket"
850 msgstr "bind - ソケットに名前をつける"
851
852 #. type: Plain text
853 #: build/C/man2/bind.2:78
854 #, no-wrap
855 msgid ""
856 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
857 "B<         socklen_t >I<addrlen>B<);>\n"
858 msgstr ""
859 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
860 "B<         socklen_t >I<addrlen>B<);>\n"
861
862 #. type: Plain text
863 #: build/C/man2/bind.2:92
864 msgid ""
865 "When a socket is created with B<socket>(2), it exists in a name space "
866 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
867 "address specified by I<addr> to the socket referred to by the file "
868 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
869 "address structure pointed to by I<addr>.  Traditionally, this operation is "
870 "called \\(lqassigning a name to a socket\\(rq."
871 msgstr ""
872 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
873 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
874 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
875 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
876 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
877 "る。"
878
879 #. type: Plain text
880 #: build/C/man2/bind.2:99
881 msgid ""
882 "It is normally necessary to assign a local address using B<bind>()  before a "
883 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
884 msgstr ""
885 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
886 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
887 "る。"
888
889 #. type: Plain text
890 #: build/C/man2/bind.2:130
891 msgid ""
892 "The rules used in name binding vary between address families.  Consult the "
893 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
894 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
895 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
896 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
897 msgstr ""
898 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
899 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
900 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は "
901 "B<ddp>(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  "
902 "を、 B<AF_NETLINK> は B<netlink>(7)  を参照。"
903
904 #. type: Plain text
905 #: build/C/man2/bind.2:137
906 msgid ""
907 "The actual structure passed for the I<addr> argument will depend on the "
908 "address family.  The I<sockaddr> structure is defined as something like:"
909 msgstr ""
910 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
911 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
912
913 #. type: Plain text
914 #: build/C/man2/bind.2:144
915 #, no-wrap
916 msgid ""
917 "struct sockaddr {\n"
918 "    sa_family_t sa_family;\n"
919 "    char        sa_data[14];\n"
920 "}\n"
921 msgstr ""
922 "struct sockaddr {\n"
923 "    sa_family_t sa_family;\n"
924 "    char        sa_data[14];\n"
925 "}\n"
926
927 #. type: Plain text
928 #: build/C/man2/bind.2:152
929 msgid ""
930 "The only purpose of this structure is to cast the structure pointer passed "
931 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
932 msgstr ""
933 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
934 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
935
936 #. type: Plain text
937 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
938 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
939 #: build/C/man2/socketpair.2:74
940 msgid ""
941 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
942 "appropriately."
943 msgstr ""
944 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
945 "設定される。"
946
947 #. type: TP
948 #: build/C/man2/bind.2:158 build/C/man2/bind.2:193
949 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
950 #: build/C/man2/send.2:304 build/C/man2/socket.2:316
951 #, no-wrap
952 msgid "B<EACCES>"
953 msgstr "B<EACCES>"
954
955 #.  e.g., privileged port in AF_INET domain
956 #. type: Plain text
957 #: build/C/man2/bind.2:162
958 msgid "The address is protected, and the user is not the superuser."
959 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
960
961 #. type: TP
962 #: build/C/man2/bind.2:162 build/C/man2/bind.2:165
963 #: build/C/man3/bindresvport.3:82 build/C/man2/connect.2:148
964 #: build/C/man2/listen.2:88 build/C/man2/listen.2:91
965 #, no-wrap
966 msgid "B<EADDRINUSE>"
967 msgstr "B<EADDRINUSE>"
968
969 #. type: Plain text
970 #: build/C/man2/bind.2:165
971 msgid "The given address is already in use."
972 msgstr "指定されたアドレスが既に使用中である。"
973
974 #. type: Plain text
975 #: build/C/man2/bind.2:175
976 msgid ""
977 "(Internet domain sockets)  The port number was specified as zero in the "
978 "socket address structure, but, upon attempting to bind to an ephemeral port, "
979 "it was determined that all port numbers in the ephemeral port range are "
980 "currently in use.  See the discussion of I</proc/sys/net/ipv4/"
981 "ip_local_port_range> B<ip>(7)."
982 msgstr ""
983 "(インターネットドメインソケットの場合) ソケットアドレス構造体でポート番号に "
984 "0 が指定されたが、 一時ポート (ephemeral port) を割り当てようとした際に、 一"
985 "時ポートとして使用する範囲のすべてのポート番号が使用中であった。 B<ip>(7) の "
986 "I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照。"
987
988 #. type: Plain text
989 #: build/C/man2/bind.2:180
990 msgid "I<sockfd> is not a valid descriptor."
991 msgstr "I<sockfd> が不正なディスクリプタである。"
992
993 #.  This may change in the future: see
994 #.  .I linux/unix/sock.c for details.
995 #. type: Plain text
996 #: build/C/man2/bind.2:185
997 msgid "The socket is already bound to an address."
998 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
999
1000 #. type: Plain text
1001 #: build/C/man2/bind.2:189
1002 msgid "I<sockfd> is a descriptor for a file, not a socket."
1003 msgstr ""
1004 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
1005
1006 #. type: Plain text
1007 #: build/C/man2/bind.2:193
1008 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1009 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1010
1011 #. type: Plain text
1012 #: build/C/man2/bind.2:198
1013 msgid ""
1014 "Search permission is denied on a component of the path prefix.  (See also "
1015 "B<path_resolution>(7).)"
1016 msgstr ""
1017 "パス名の構成要素に検索許可 (search permission) がない "
1018 "(B<path_resolution>(7)  も参照すること)。"
1019
1020 #. type: TP
1021 #: build/C/man2/bind.2:198 build/C/man2/connect.2:151
1022 #, no-wrap
1023 msgid "B<EADDRNOTAVAIL>"
1024 msgstr "B<EADDRNOTAVAIL>"
1025
1026 #. type: Plain text
1027 #: build/C/man2/bind.2:202
1028 msgid ""
1029 "A nonexistent interface was requested or the requested address was not local."
1030 msgstr ""
1031 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1032 "かった。"
1033
1034 #. type: Plain text
1035 #: build/C/man2/bind.2:206
1036 msgid "I<addr> points outside the user's accessible address space."
1037 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1038
1039 #. type: Plain text
1040 #: build/C/man2/bind.2:213
1041 msgid ""
1042 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1043 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1044
1045 #. type: TP
1046 #: build/C/man2/bind.2:213
1047 #, no-wrap
1048 msgid "B<ELOOP>"
1049 msgstr "B<ELOOP>"
1050
1051 #. type: Plain text
1052 #: build/C/man2/bind.2:217
1053 msgid "Too many symbolic links were encountered in resolving I<addr>."
1054 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1055
1056 #. type: TP
1057 #: build/C/man2/bind.2:217
1058 #, no-wrap
1059 msgid "B<ENAMETOOLONG>"
1060 msgstr "B<ENAMETOOLONG>"
1061
1062 #. type: Plain text
1063 #: build/C/man2/bind.2:221
1064 msgid "I<addr> is too long."
1065 msgstr "I<addr> が長過ぎる。"
1066
1067 #. type: TP
1068 #: build/C/man2/bind.2:221
1069 #, no-wrap
1070 msgid "B<ENOENT>"
1071 msgstr "B<ENOENT>"
1072
1073 #. type: Plain text
1074 #: build/C/man2/bind.2:224
1075 msgid "The file does not exist."
1076 msgstr "ファイルが存在しない。"
1077
1078 #. type: TP
1079 #: build/C/man2/bind.2:224 build/C/man2/recv.2:460 build/C/man2/select.2:333
1080 #: build/C/man2/send.2:375
1081 #, no-wrap
1082 msgid "B<ENOMEM>"
1083 msgstr "B<ENOMEM>"
1084
1085 #. type: Plain text
1086 #: build/C/man2/bind.2:227
1087 msgid "Insufficient kernel memory was available."
1088 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1089
1090 #. type: TP
1091 #: build/C/man2/bind.2:227
1092 #, no-wrap
1093 msgid "B<ENOTDIR>"
1094 msgstr "B<ENOTDIR>"
1095
1096 #. type: Plain text
1097 #: build/C/man2/bind.2:230
1098 msgid "A component of the path prefix is not a directory."
1099 msgstr "パス名の構成要素がディレクトリではない。"
1100
1101 #. type: TP
1102 #: build/C/man2/bind.2:230
1103 #, no-wrap
1104 msgid "B<EROFS>"
1105 msgstr "B<EROFS>"
1106
1107 #. type: Plain text
1108 #: build/C/man2/bind.2:233
1109 msgid "The socket inode would reside on a read-only filesystem."
1110 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1111
1112 #.  SVr4 documents an additional
1113 #.  .B ENOSR
1114 #.  general error condition, and
1115 #.  additional
1116 #.  .B EIO
1117 #.  and
1118 #.  .B EISDIR
1119 #.  UNIX-domain error conditions.
1120 #. type: Plain text
1121 #: build/C/man2/bind.2:245
1122 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1123 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1124
1125 #. type: Plain text
1126 #: build/C/man2/bind.2:262
1127 msgid ""
1128 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1129 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1130 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1131 msgstr ""
1132 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1133 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1134 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1135
1136 #. type: SH
1137 #: build/C/man2/bind.2:262 build/C/man2/getsockopt.2:199
1138 #: build/C/man2/recvmmsg.2:267 build/C/man2/select.2:485
1139 #: build/C/man2/send.2:446 build/C/man3/sockatmark.3:100
1140 #: build/C/man7/socket.7:945
1141 #, no-wrap
1142 msgid "BUGS"
1143 msgstr "バグ"
1144
1145 #.  FIXME What *are* transparent proxy options?
1146 #. type: Plain text
1147 #: build/C/man2/bind.2:265
1148 msgid "The transparent proxy options are not described."
1149 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1150
1151 #. type: Plain text
1152 #: build/C/man2/bind.2:270
1153 msgid ""
1154 "An example of the use of B<bind>()  with Internet domain sockets can be "
1155 "found in B<getaddrinfo>(3)."
1156 msgstr ""
1157 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が "
1158 "B<getaddrinfo>(3)  に記載されている。"
1159
1160 #.  listen.7 refers to this example.
1161 #.  accept.7 refers to this example.
1162 #.  unix.7 refers to this example.
1163 #. type: Plain text
1164 #: build/C/man2/bind.2:277
1165 msgid ""
1166 "The following example shows how to bind a stream socket in the UNIX "
1167 "(B<AF_UNIX>)  domain, and accept connections:"
1168 msgstr ""
1169 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1170 "を示したものである。"
1171
1172 #. type: Plain text
1173 #: build/C/man2/bind.2:284
1174 #, no-wrap
1175 msgid ""
1176 "#include E<lt>sys/socket.hE<gt>\n"
1177 "#include E<lt>sys/un.hE<gt>\n"
1178 "#include E<lt>stdlib.hE<gt>\n"
1179 "#include E<lt>stdio.hE<gt>\n"
1180 "#include E<lt>string.hE<gt>\n"
1181 msgstr ""
1182 "#include E<lt>sys/socket.hE<gt>\n"
1183 "#include E<lt>sys/un.hE<gt>\n"
1184 "#include E<lt>stdlib.hE<gt>\n"
1185 "#include E<lt>stdio.hE<gt>\n"
1186 "#include E<lt>string.hE<gt>\n"
1187
1188 #. type: Plain text
1189 #: build/C/man2/bind.2:287
1190 #, no-wrap
1191 msgid ""
1192 "#define MY_SOCK_PATH \"/somepath\"\n"
1193 "#define LISTEN_BACKLOG 50\n"
1194 msgstr ""
1195 "#define MY_SOCK_PATH \"/somepath\"\n"
1196 "#define LISTEN_BACKLOG 50\n"
1197
1198 #. type: Plain text
1199 #: build/C/man2/bind.2:290
1200 #, no-wrap
1201 msgid ""
1202 "#define handle_error(msg) \\e\n"
1203 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1204 msgstr ""
1205 "#define handle_error(msg) \\e\n"
1206 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1207
1208 #. type: Plain text
1209 #: build/C/man2/bind.2:297
1210 #, no-wrap
1211 msgid ""
1212 "int\n"
1213 "main(int argc, char *argv[])\n"
1214 "{\n"
1215 "    int sfd, cfd;\n"
1216 "    struct sockaddr_un my_addr, peer_addr;\n"
1217 "    socklen_t peer_addr_size;\n"
1218 msgstr ""
1219 "int\n"
1220 "main(int argc, char *argv[])\n"
1221 "{\n"
1222 "    int sfd, cfd;\n"
1223 "    struct sockaddr_un my_addr, peer_addr;\n"
1224 "    socklen_t peer_addr_size;\n"
1225
1226 #. type: Plain text
1227 #: build/C/man2/bind.2:301
1228 #, no-wrap
1229 msgid ""
1230 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1231 "    if (sfd == -1)\n"
1232 "        handle_error(\"socket\");\n"
1233 msgstr ""
1234 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1235 "    if (sfd == -1)\n"
1236 "        handle_error(\"socket\");\n"
1237
1238 #. type: Plain text
1239 #: build/C/man2/bind.2:307
1240 #, no-wrap
1241 msgid ""
1242 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1243 "                        /* Clear structure */\n"
1244 "    my_addr.sun_family = AF_UNIX;\n"
1245 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1246 "            sizeof(my_addr.sun_path) - 1);\n"
1247 msgstr ""
1248 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1249 "                        /* Clear structure */\n"
1250 "    my_addr.sun_family = AF_UNIX;\n"
1251 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1252 "            sizeof(my_addr.sun_path) - 1);\n"
1253
1254 #. type: Plain text
1255 #: build/C/man2/bind.2:311
1256 #, no-wrap
1257 msgid ""
1258 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1259 "            sizeof(struct sockaddr_un)) == -1)\n"
1260 "        handle_error(\"bind\");\n"
1261 msgstr ""
1262 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1263 "            sizeof(struct sockaddr_un)) == -1)\n"
1264 "        handle_error(\"bind\");\n"
1265
1266 #. type: Plain text
1267 #: build/C/man2/bind.2:314
1268 #, no-wrap
1269 msgid ""
1270 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1271 "        handle_error(\"listen\");\n"
1272 msgstr ""
1273 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1274 "        handle_error(\"listen\");\n"
1275
1276 #. type: Plain text
1277 #: build/C/man2/bind.2:317
1278 #, no-wrap
1279 msgid ""
1280 "    /* Now we can accept incoming connections one\n"
1281 "       at a time using accept(2) */\n"
1282 msgstr ""
1283 "    /* Now we can accept incoming connections one\n"
1284 "       at a time using accept(2) */\n"
1285
1286 #. type: Plain text
1287 #: build/C/man2/bind.2:323
1288 #, no-wrap
1289 msgid ""
1290 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1291 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1292 "                 &peer_addr_size);\n"
1293 "    if (cfd == -1)\n"
1294 "        handle_error(\"accept\");\n"
1295 msgstr ""
1296 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1297 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1298 "                 &peer_addr_size)\n"
1299 "    if (cfd == -1)\n"
1300 "        handle_error(\"accept\");\n"
1301
1302 #. type: Plain text
1303 #: build/C/man2/bind.2:325
1304 #, no-wrap
1305 msgid "    /* Code to deal with incoming connection(s)... */\n"
1306 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1307
1308 #. type: Plain text
1309 #: build/C/man2/bind.2:329
1310 #, no-wrap
1311 msgid ""
1312 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1313 "       should be deleted using unlink(2) or remove(3) */\n"
1314 "}\n"
1315 msgstr ""
1316 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1317 "       should be deleted using unlink(2) or remove(3) */\n"
1318 "}\n"
1319
1320 #. type: Plain text
1321 #: build/C/man2/bind.2:343
1322 msgid ""
1323 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1324 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1325 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1326 msgstr ""
1327 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1328 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1329 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1330
1331 #. type: TH
1332 #: build/C/man3/bindresvport.3:30
1333 #, no-wrap
1334 msgid "BINDRESVPORT"
1335 msgstr "BINDRESVPORT"
1336
1337 #. type: TH
1338 #: build/C/man3/bindresvport.3:30
1339 #, no-wrap
1340 msgid "2013-06-21"
1341 msgstr "2013-06-21"
1342
1343 #. type: Plain text
1344 #: build/C/man3/bindresvport.3:33
1345 msgid "bindresvport - bind a socket to a privileged IP port"
1346 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1347
1348 #. type: Plain text
1349 #: build/C/man3/bindresvport.3:37
1350 #, no-wrap
1351 msgid ""
1352 "B<#include E<lt>sys/types.hE<gt>>\n"
1353 "B<#include E<lt>netinet/in.hE<gt>>\n"
1354 msgstr ""
1355 "B<#include E<lt>sys/types.hE<gt>>\n"
1356 "B<#include E<lt>netinet/in.hE<gt>>\n"
1357
1358 #. type: Plain text
1359 #: build/C/man3/bindresvport.3:39
1360 #, no-wrap
1361 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1362 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1363
1364 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1365 #. type: Plain text
1366 #: build/C/man3/bindresvport.3:46
1367 msgid ""
1368 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1369 "anonymous IP port, that is, a port number arbitrarily selected from the "
1370 "range 512 to 1023."
1371 msgstr ""
1372 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1373 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1374 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1375
1376 #. type: Plain text
1377 #: build/C/man3/bindresvport.3:56
1378 msgid ""
1379 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1380 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1381 "allocated."
1382 msgstr ""
1383 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1384 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1385 "される。"
1386
1387 #. type: Plain text
1388 #: build/C/man3/bindresvport.3:67
1389 msgid ""
1390 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1391 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1392 "return the port number actually allocated.  (This information can later be "
1393 "obtained using B<getsockname>(2).)"
1394 msgstr ""
1395 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1396 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 "
1397 "B<bindresvport>()  は実際に割り当てられたポート番号を返す手段を持たない (割り"
1398 "当てられたポート番号は、後で B<getsockname>(2)  を使って取得できる)。"
1399
1400 #. type: Plain text
1401 #: build/C/man3/bindresvport.3:72
1402 msgid ""
1403 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1404 "I<errno> set to indicate the cause of the error."
1405 msgstr ""
1406 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1407 "I<errno> にエラーの原因を示す値を設定する。"
1408
1409 #. type: Plain text
1410 #: build/C/man3/bindresvport.3:77
1411 msgid ""
1412 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1413 "addition, the following errors may occur:"
1414 msgstr ""
1415 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1416 "以下のエラーが発生することがある:"
1417
1418 #. type: Plain text
1419 #: build/C/man3/bindresvport.3:82
1420 msgid ""
1421 "The caller did not have superuser privilege (to be precise: the "
1422 "B<CAP_NET_BIND_SERVICE> capability is required)."
1423 msgstr ""
1424 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1425 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1426
1427 #. type: Plain text
1428 #: build/C/man3/bindresvport.3:85
1429 msgid "All privileged ports are in use."
1430 msgstr "全ての特権ポートが使用中である。"
1431
1432 #. type: TP
1433 #: build/C/man3/bindresvport.3:85
1434 #, no-wrap
1435 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1436 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1437
1438 #. type: Plain text
1439 #: build/C/man3/bindresvport.3:92
1440 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1441 msgstr ""
1442 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1443
1444 #. type: SH
1445 #: build/C/man3/bindresvport.3:92 build/C/man3/if_nametoindex.3:85
1446 #: build/C/man3/sockatmark.3:73
1447 #, no-wrap
1448 msgid "ATTRIBUTES"
1449 msgstr "属性"
1450
1451 #. type: SS
1452 #: build/C/man3/bindresvport.3:93 build/C/man3/if_nametoindex.3:86
1453 #: build/C/man3/sockatmark.3:74
1454 #, no-wrap
1455 msgid "Multithreading (see pthreads(7))"
1456 msgstr "マルチスレッディング (pthreads(7) 参照)"
1457
1458 #. type: Plain text
1459 #: build/C/man3/bindresvport.3:98
1460 msgid ""
1461 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1462 "that is not protected, so it is not thread-safe."
1463 msgstr ""
1464 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1465 "静的変数を使用しているため、スレッドセーフではない。"
1466
1467 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1468 #. type: Plain text
1469 #: build/C/man3/bindresvport.3:104
1470 msgid ""
1471 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect "
1472 "static variable, so it is thread-safe."
1473 msgstr ""
1474 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1475 "ており、スレッドセーフである。"
1476
1477 #. type: Plain text
1478 #: build/C/man3/bindresvport.3:107
1479 msgid ""
1480 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1481 msgstr ""
1482 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1483
1484 #. type: Plain text
1485 #: build/C/man3/bindresvport.3:113
1486 msgid ""
1487 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1488 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1489 msgstr ""
1490 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1491 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1492
1493 #. type: Plain text
1494 #: build/C/man3/bindresvport.3:116
1495 msgid "B<bind>(2), B<getsockname>(2)"
1496 msgstr "B<bind>(2), B<getsockname>(2)"
1497
1498 #. type: TH
1499 #: build/C/man2/connect.2:67
1500 #, no-wrap
1501 msgid "CONNECT"
1502 msgstr "CONNECT"
1503
1504 #. type: Plain text
1505 #: build/C/man2/connect.2:70
1506 msgid "connect - initiate a connection on a socket"
1507 msgstr "connect - ソケットの接続を行う"
1508
1509 #. type: Plain text
1510 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1511 #: build/C/man2/listen.2:51
1512 #, no-wrap
1513 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1514 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1515
1516 #. type: Plain text
1517 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1518 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1519 #: build/C/man2/recv.2:51
1520 #, no-wrap
1521 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1522 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1523
1524 #. type: Plain text
1525 #: build/C/man2/connect.2:78
1526 #, no-wrap
1527 msgid ""
1528 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1529 "B<            socklen_t >I<addrlen>B<);>\n"
1530 msgstr ""
1531 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1532 "B<            socklen_t >I<addrlen>B<);>\n"
1533
1534 #. type: Plain text
1535 #: build/C/man2/connect.2:97
1536 msgid ""
1537 "The B<connect>()  system call connects the socket referred to by the file "
1538 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1539 "argument specifies the size of I<addr>.  The format of the address in "
1540 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1541 "B<socket>(2)  for further details."
1542 msgstr ""
1543 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1544 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1545 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1546 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1547 "こと。"
1548
1549 #. type: Plain text
1550 #: build/C/man2/connect.2:113
1551 msgid ""
1552 "If the socket I<sockfd> is of type B<SOCK_DGRAM>, then I<addr> is the "
1553 "address to which datagrams are sent by default, and the only address from "
1554 "which datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1555 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1556 "that is bound to the address specified by I<addr>."
1557 msgstr ""
1558 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1559 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1560 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1561 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1562 "に対する接続の 作成を試みる。"
1563
1564 #. type: Plain text
1565 #: build/C/man2/connect.2:127
1566 msgid ""
1567 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1568 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1569 "times to change their association.  Connectionless sockets may dissolve the "
1570 "association by connecting to an address with the I<sa_family> member of "
1571 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1572 msgstr ""
1573 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ "
1574 "B<connect>()  が成功する。 コネクションレス (connectionless) プロトコルでは対"
1575 "応を変更するために何度も B<connect>()  を使用できる。 非接続ソケットは "
1576 "I<sockaddr> の I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アド"
1577 "レスの対応を解消することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux で"
1578 "サポート)。"
1579
1580 #. type: Plain text
1581 #: build/C/man2/connect.2:132
1582 msgid ""
1583 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1584 "returned, and I<errno> is set appropriately."
1585 msgstr ""
1586 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1587 "適切な値を設定する。"
1588
1589 #. type: Plain text
1590 #: build/C/man2/connect.2:135
1591 msgid ""
1592 "The following are general socket errors only.  There may be other domain-"
1593 "specific error codes."
1594 msgstr ""
1595 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1596 "する可能性がある。"
1597
1598 #. type: Plain text
1599 #: build/C/man2/connect.2:143
1600 msgid ""
1601 "For UNIX domain sockets, which are identified by pathname: Write permission "
1602 "is denied on the socket file, or search permission is denied for one of the "
1603 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1604 msgstr ""
1605 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1606 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1607 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1608
1609 #. type: TP
1610 #: build/C/man2/connect.2:143
1611 #, no-wrap
1612 msgid "B<EACCES>, B<EPERM>"
1613 msgstr "B<EACCES>, B<EPERM>"
1614
1615 #. type: Plain text
1616 #: build/C/man2/connect.2:148
1617 msgid ""
1618 "The user tried to connect to a broadcast address without having the socket "
1619 "broadcast flag enabled or the connection request failed because of a local "
1620 "firewall rule."
1621 msgstr ""
1622 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1623 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1624 "要求が失敗した。"
1625
1626 #. type: Plain text
1627 #: build/C/man2/connect.2:151
1628 msgid "Local address is already in use."
1629 msgstr "ローカルアドレスが既に使用されている。"
1630
1631 #. type: Plain text
1632 #: build/C/man2/connect.2:164 build/C/man2/listen.2:104
1633 msgid ""
1634 "(Internet domain sockets)  The socket referred to by I<sockfd> had not "
1635 "previously been bound to an address and, upon attempting to bind it to an "
1636 "ephemeral port, it was determined that all port numbers in the ephemeral "
1637 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
1638 "ip_local_port_range> in B<ip>(7)."
1639 msgstr ""
1640 "(インターネットドメインソケットの場合) I<sockfd> が参照するソケットがそれ以前"
1641 "にアドレスにバインドされておらず、 そのソケットに一時ポートをバインドしようと"
1642 "した際に、 一時ポートとして使用する範囲のポート番号がすべて使用中であった。 "
1643 "B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照のこと。"
1644
1645 #. type: TP
1646 #: build/C/man2/connect.2:164 build/C/man2/socket.2:320
1647 #: build/C/man2/socketpair.2:75
1648 #, no-wrap
1649 msgid "B<EAFNOSUPPORT>"
1650 msgstr "B<EAFNOSUPPORT>"
1651
1652 #. type: Plain text
1653 #: build/C/man2/connect.2:169
1654 msgid ""
1655 "The passed address didn't have the correct address family in its "
1656 "I<sa_family> field."
1657 msgstr ""
1658 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1659 "い。"
1660
1661 #. type: TP
1662 #: build/C/man2/connect.2:169 build/C/man2/send.2:323
1663 #, no-wrap
1664 msgid "B<EAGAIN>"
1665 msgstr "B<EAGAIN>"
1666
1667 #. type: Plain text
1668 #: build/C/man2/connect.2:172
1669 msgid "Insufficient entries in the routing cache."
1670 msgstr "ルーティングキャッシュにエントリーが十分にない。"
1671
1672 #. type: TP
1673 #: build/C/man2/connect.2:172
1674 #, no-wrap
1675 msgid "B<EALREADY>"
1676 msgstr "B<EALREADY>"
1677
1678 #. type: Plain text
1679 #: build/C/man2/connect.2:176
1680 msgid ""
1681 "The socket is nonblocking and a previous connection attempt has not yet been "
1682 "completed."
1683 msgstr ""
1684 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1685
1686 #. type: Plain text
1687 #: build/C/man2/connect.2:179
1688 msgid "The file descriptor is not a valid index in the descriptor table."
1689 msgstr ""
1690 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1691 "い。"
1692
1693 #. type: TP
1694 #: build/C/man2/connect.2:179 build/C/man2/recv.2:443
1695 #, no-wrap
1696 msgid "B<ECONNREFUSED>"
1697 msgstr "B<ECONNREFUSED>"
1698
1699 #. type: Plain text
1700 #: build/C/man2/connect.2:182
1701 msgid "No-one listening on the remote address."
1702 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1703
1704 #. type: Plain text
1705 #: build/C/man2/connect.2:185
1706 msgid "The socket structure address is outside the user's address space."
1707 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1708
1709 #. type: TP
1710 #: build/C/man2/connect.2:185
1711 #, no-wrap
1712 msgid "B<EINPROGRESS>"
1713 msgstr "B<EINPROGRESS>"
1714
1715 #. type: Plain text
1716 #: build/C/man2/connect.2:210
1717 msgid ""
1718 "The socket is nonblocking and the connection cannot be completed "
1719 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1720 "by selecting the socket for writing.  After B<select>(2)  indicates "
1721 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1722 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1723 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1724 "error codes listed here, explaining the reason for the failure)."
1725 msgstr ""
1726 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1727 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1728 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1729 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1730 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1731 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1732 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1733 "の原因が分かる。"
1734
1735 #.  For TCP, the connection will complete asynchronously.
1736 #.  See http://lkml.org/lkml/2005/7/12/254
1737 #. type: Plain text
1738 #: build/C/man2/connect.2:216
1739 msgid ""
1740 "The system call was interrupted by a signal that was caught; see "
1741 "B<signal>(7)."
1742 msgstr ""
1743 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1744
1745 #. type: TP
1746 #: build/C/man2/connect.2:216 build/C/man2/send.2:355
1747 #, no-wrap
1748 msgid "B<EISCONN>"
1749 msgstr "B<EISCONN>"
1750
1751 #. type: Plain text
1752 #: build/C/man2/connect.2:219
1753 msgid "The socket is already connected."
1754 msgstr "ソケットは既に接続 (connect) されている。"
1755
1756 #. type: TP
1757 #: build/C/man2/connect.2:219
1758 #, no-wrap
1759 msgid "B<ENETUNREACH>"
1760 msgstr "B<ENETUNREACH>"
1761
1762 #. type: Plain text
1763 #: build/C/man2/connect.2:222
1764 msgid "Network is unreachable."
1765 msgstr "到達できないネットワークである。"
1766
1767 #. type: Plain text
1768 #: build/C/man2/connect.2:225
1769 msgid "The file descriptor is not associated with a socket."
1770 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1771
1772 #. type: TP
1773 #: build/C/man2/connect.2:225
1774 #, no-wrap
1775 msgid "B<ETIMEDOUT>"
1776 msgstr "B<ETIMEDOUT>"
1777
1778 #. type: Plain text
1779 #: build/C/man2/connect.2:232
1780 msgid ""
1781 "Timeout while attempting connection.  The server may be too busy to accept "
1782 "new connections.  Note that for IP sockets the timeout may be very long when "
1783 "syncookies are enabled on the server."
1784 msgstr ""
1785 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1786 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1787 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1788 "ること。"
1789
1790 #.  SVr4 documents the additional
1791 #.  general error codes
1792 #.  .BR EADDRNOTAVAIL ,
1793 #.  .BR EINVAL ,
1794 #.  .BR EAFNOSUPPORT ,
1795 #.  .BR EALREADY ,
1796 #.  .BR EINTR ,
1797 #.  .BR EPROTOTYPE ,
1798 #.  and
1799 #.  .BR ENOSR .
1800 #.  It also
1801 #.  documents many additional error conditions not described here.
1802 #. type: Plain text
1803 #: build/C/man2/connect.2:248
1804 msgid ""
1805 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1806 "POSIX.1-2001."
1807 msgstr ""
1808 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1809
1810 #. type: Plain text
1811 #: build/C/man2/connect.2:265
1812 msgid ""
1813 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1814 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1815 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1816 msgstr ""
1817 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1818 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1819 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1820
1821 #. type: Plain text
1822 #: build/C/man2/connect.2:270
1823 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1824 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1825
1826 #. type: Plain text
1827 #: build/C/man2/connect.2:277
1828 msgid ""
1829 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1830 "B<path_resolution>(7)"
1831 msgstr ""
1832 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1833 "B<path_resolution>(7)"
1834
1835 #. type: TH
1836 #: build/C/man3/getifaddrs.3:36
1837 #, no-wrap
1838 msgid "GETIFADDRS"
1839 msgstr "GETIFADDRS"
1840
1841 #. type: TH
1842 #: build/C/man3/getifaddrs.3:36
1843 #, no-wrap
1844 msgid "2014-02-26"
1845 msgstr "2014-02-26"
1846
1847 #. type: TH
1848 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1849 #: build/C/man3/if_nametoindex.3:25
1850 #, no-wrap
1851 msgid "GNU"
1852 msgstr "GNU"
1853
1854 #. type: Plain text
1855 #: build/C/man3/getifaddrs.3:39
1856 msgid "getifaddrs, freeifaddrs - get interface addresses"
1857 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1858
1859 #. type: Plain text
1860 #: build/C/man3/getifaddrs.3:43
1861 #, no-wrap
1862 msgid ""
1863 "B<#include E<lt>sys/types.hE<gt>>\n"
1864 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1865 msgstr ""
1866 "B<#include E<lt>sys/types.hE<gt>>\n"
1867 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1868
1869 #. type: Plain text
1870 #: build/C/man3/getifaddrs.3:45
1871 #, no-wrap
1872 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1873 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1874
1875 #. type: Plain text
1876 #: build/C/man3/getifaddrs.3:47
1877 #, no-wrap
1878 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1879 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1880
1881 #. type: Plain text
1882 #: build/C/man3/getifaddrs.3:58
1883 msgid ""
1884 "The B<getifaddrs>()  function creates a linked list of structures describing "
1885 "the network interfaces of the local system, and stores the address of the "
1886 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1887 "structures, defined as follows:"
1888 msgstr ""
1889 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1890 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1891 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1892 "うに定義されている。"
1893
1894 #. type: Plain text
1895 #: build/C/man3/getifaddrs.3:77
1896 #, no-wrap
1897 msgid ""
1898 "struct ifaddrs {\n"
1899 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1900 "    char            *ifa_name;    /* Name of interface */\n"
1901 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1902 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1903 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1904 "    union {\n"
1905 "        struct sockaddr *ifu_broadaddr;\n"
1906 "                         /* Broadcast address of interface */\n"
1907 "        struct sockaddr *ifu_dstaddr;\n"
1908 "                         /* Point-to-point destination address */\n"
1909 "    } ifa_ifu;\n"
1910 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1911 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1912 "    void            *ifa_data;    /* Address-specific data */\n"
1913 "};\n"
1914 msgstr ""
1915 "struct ifaddrs {\n"
1916 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1917 "    char            *ifa_name;    /* Name of interface */\n"
1918 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1919 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1920 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1921 "    union {\n"
1922 "        struct sockaddr *ifu_broadaddr;\n"
1923 "                         /* Broadcast address of interface */\n"
1924 "        struct sockaddr *ifu_dstaddr;\n"
1925 "                         /* Point-to-point destination address */\n"
1926 "    } ifa_ifu;\n"
1927 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1928 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1929 "    void            *ifa_data;    /* Address-specific data */\n"
1930 "};\n"
1931
1932 #. type: Plain text
1933 #: build/C/man3/getifaddrs.3:84
1934 msgid ""
1935 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1936 "or NULL if this is the last item of the list."
1937 msgstr ""
1938 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1939 "素がリストの最後の場合には NULL が入る。"
1940
1941 #.  The constant
1942 #.  .B IF NAMESIZE
1943 #.  indicates the maximum length of this field.
1944 #. type: Plain text
1945 #: build/C/man3/getifaddrs.3:91
1946 msgid "The I<ifa_name> points to the null-terminated interface name."
1947 msgstr "I<ifa_name> はヌル終端されたインターフェース名を指す。"
1948
1949 #. type: Plain text
1950 #: build/C/man3/getifaddrs.3:100
1951 msgid ""
1952 "The I<ifa_flags> field contains the interface flags, as returned by the "
1953 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1954 "these flags)."
1955 msgstr ""
1956 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1957 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1958 "B<netdevice>(7) を参照)。"
1959
1960 #. type: Plain text
1961 #: build/C/man3/getifaddrs.3:109
1962 msgid ""
1963 "The I<ifa_addr> field points to a structure containing the interface "
1964 "address.  (The I<sa_family> subfield should be consulted to determine the "
1965 "format of the address structure.)  This field may contain a null pointer."
1966 msgstr ""
1967 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
1968 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
1969 "すべきである)。 このフィールドはヌルポインタとなる場合がある。"
1970
1971 #. type: Plain text
1972 #: build/C/man3/getifaddrs.3:116
1973 msgid ""
1974 "The I<ifa_netmask> field points to a structure containing the netmask "
1975 "associated with I<ifa_addr>, if applicable for the address family.  This "
1976 "field may contain a null pointer."
1977 msgstr ""
1978 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
1979 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
1980 "る。 このフィールドはヌルポインタとなる場合がある。"
1981
1982 #. type: Plain text
1983 #: build/C/man3/getifaddrs.3:131
1984 msgid ""
1985 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1986 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1987 "will contain the broadcast address associated with I<ifa_addr> (if "
1988 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1989 "destination address of the point-to-point interface."
1990 msgstr ""
1991 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
1992 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
1993 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
1994 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
1995 "point インターフェースの宛先アドレスが入るかが決まる。"
1996
1997 #. type: Plain text
1998 #: build/C/man3/getifaddrs.3:136
1999 msgid ""
2000 "The I<ifa_data> field points to a buffer containing address-family-specific "
2001 "data; this field may be NULL if there is no such data for this interface."
2002 msgstr ""
2003 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
2004 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
2005 "フィールドは NULL となる。"
2006
2007 #. type: Plain text
2008 #: build/C/man3/getifaddrs.3:142
2009 msgid ""
2010 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
2011 "freed using B<freeifaddrs>()  when no longer needed."
2012 msgstr ""
2013 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2014 "B<freeifaddrs>() を使って解放すべきである。"
2015
2016 #. type: Plain text
2017 #: build/C/man3/getifaddrs.3:149
2018 msgid ""
2019 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2020 "I<errno> is set appropriately."
2021 msgstr ""
2022 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2023 "が適切に設定される。"
2024
2025 #. type: Plain text
2026 #: build/C/man3/getifaddrs.3:162
2027 msgid ""
2028 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2029 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), "
2030 "B<sendto>(2), B<malloc>(3), or B<realloc>(3)."
2031 msgstr ""
2032 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には "
2033 "B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), "
2034 "B<malloc>(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定され"
2035 "る。"
2036
2037 #. type: Plain text
2038 #: build/C/man3/getifaddrs.3:170
2039 msgid ""
2040 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2041 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2042 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2043 "available only on kernels that support netlink."
2044 msgstr ""
2045 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2046 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2047 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2048 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2049
2050 #.  , but the BSD-derived documentation generally
2051 #.  appears to be confused and obsolete on this point.
2052 #.  i.e., commonly it still says one of them will be NULL, even if
2053 #.  the ifa_ifu union is already present
2054 #. type: Plain text
2055 #: build/C/man3/getifaddrs.3:190
2056 msgid ""
2057 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2058 "the BSD systems, but with slightly different semantics documented"
2059 "\\(emreturning one entry per interface, not per address.  This means "
2060 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2061 "address, and no link-level address is returned if the interface has an IP "
2062 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2063 "I<ifa_dstaddr> differs on various systems."
2064 msgstr ""
2065 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2066 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2067 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2068 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2069 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2070 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2071 "どちらを選択するかを決める方法は、 システムにより異なる。"
2072
2073 #. type: Plain text
2074 #: build/C/man3/getifaddrs.3:207
2075 msgid ""
2076 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2077 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2078 "containing lower-level details about the interface and its physical layer.  "
2079 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2080 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2081 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2082 "hE<gt>>), which contains various interface attributes and statistics."
2083 msgstr ""
2084 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2085 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2086 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2087 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2088 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2089 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2090 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2091 "インターフェースの様々な属性や統計情報が入る。"
2092
2093 #. type: Plain text
2094 #: build/C/man3/getifaddrs.3:214
2095 msgid ""
2096 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2097 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2098 "system:"
2099 msgstr ""
2100 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2101 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2102
2103 #. type: Plain text
2104 #: build/C/man3/getifaddrs.3:235
2105 #, no-wrap
2106 msgid ""
2107 "$ B<./a.out>\n"
2108 "lo       AF_PACKET (17)\n"
2109 "                tx_packets =        524; rx_packets =        524\n"
2110 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2111 "wlp3s0   AF_PACKET (17)\n"
2112 "                tx_packets =     108391; rx_packets =     130245\n"
2113 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2114 "em1      AF_PACKET (17)\n"
2115 "                tx_packets =          0; rx_packets =          0\n"
2116 "                tx_bytes   =          0; rx_bytes   =          0\n"
2117 "lo       AF_INET (2)\n"
2118 "                address: E<lt>127.0.0.1E<gt>\n"
2119 "wlp3s0   AF_INET (2)\n"
2120 "                address: E<lt>192.168.235.137E<gt>\n"
2121 "lo       AF_INET6 (10)\n"
2122 "                address: E<lt>::1E<gt>\n"
2123 "wlp3s0   AF_INET6 (10)\n"
2124 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2125 msgstr ""
2126 "$ B<./a.out>\n"
2127 "lo       AF_PACKET (17)\n"
2128 "                tx_packets =        524; rx_packets =        524\n"
2129 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2130 "wlp3s0   AF_PACKET (17)\n"
2131 "                tx_packets =     108391; rx_packets =     130245\n"
2132 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2133 "em1      AF_PACKET (17)\n"
2134 "                tx_packets =          0; rx_packets =          0\n"
2135 "                tx_bytes   =          0; rx_bytes   =          0\n"
2136 "lo       AF_INET (2)\n"
2137 "                address: E<lt>127.0.0.1E<gt>\n"
2138 "wlp3s0   AF_INET (2)\n"
2139 "                address: E<lt>192.168.235.137E<gt>\n"
2140 "lo       AF_INET6 (10)\n"
2141 "                address: E<lt>::1E<gt>\n"
2142 "wlp3s0   AF_INET6 (10)\n"
2143 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2144
2145 #. type: SS
2146 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2147 #: build/C/man2/recvmmsg.2:205
2148 #, no-wrap
2149 msgid "Program source"
2150 msgstr "プログラムのソース"
2151
2152 #. type: Plain text
2153 #: build/C/man3/getifaddrs.3:249
2154 #, no-wrap
2155 msgid ""
2156 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2157 "#include E<lt>arpa/inet.hE<gt>\n"
2158 "#include E<lt>sys/socket.hE<gt>\n"
2159 "#include E<lt>netdb.hE<gt>\n"
2160 "#include E<lt>ifaddrs.hE<gt>\n"
2161 "#include E<lt>stdio.hE<gt>\n"
2162 "#include E<lt>stdlib.hE<gt>\n"
2163 "#include E<lt>unistd.hE<gt>\n"
2164 "#include E<lt>linux/if_link.hE<gt>\n"
2165 msgstr ""
2166 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2167 "#include E<lt>arpa/inet.hE<gt>\n"
2168 "#include E<lt>sys/socket.hE<gt>\n"
2169 "#include E<lt>netdb.hE<gt>\n"
2170 "#include E<lt>ifaddrs.hE<gt>\n"
2171 "#include E<lt>stdio.hE<gt>\n"
2172 "#include E<lt>stdlib.hE<gt>\n"
2173 "#include E<lt>unistd.hE<gt>\n"
2174 "#include E<lt>linux/if_link.hE<gt>\n"
2175
2176 #. type: Plain text
2177 #: build/C/man3/getifaddrs.3:255
2178 #, no-wrap
2179 msgid ""
2180 "int main(int argc, char *argv[])\n"
2181 "{\n"
2182 "    struct ifaddrs *ifaddr, *ifa;\n"
2183 "    int family, s, n;\n"
2184 "    char host[NI_MAXHOST];\n"
2185 msgstr ""
2186 "int main(int argc, char *argv[])\n"
2187 "{\n"
2188 "    struct ifaddrs *ifaddr, *ifa;\n"
2189 "    int family, s, n;\n"
2190 "    char host[NI_MAXHOST];\n"
2191
2192 #. type: Plain text
2193 #: build/C/man3/getifaddrs.3:260
2194 #, no-wrap
2195 msgid ""
2196 "    if (getifaddrs(&ifaddr) == -1) {\n"
2197 "        perror(\"getifaddrs\");\n"
2198 "        exit(EXIT_FAILURE);\n"
2199 "    }\n"
2200 msgstr ""
2201 "    if (getifaddrs(&ifaddr) == -1) {\n"
2202 "        perror(\"getifaddrs\");\n"
2203 "        exit(EXIT_FAILURE);\n"
2204 "    }\n"
2205
2206 #. type: Plain text
2207 #: build/C/man3/getifaddrs.3:263
2208 #, no-wrap
2209 msgid ""
2210 "    /* Walk through linked list, maintaining head pointer so we\n"
2211 "       can free list later */\n"
2212 msgstr ""
2213 "    /* Walk through linked list, maintaining head pointer so we\n"
2214 "       can free list later */\n"
2215
2216 #. type: Plain text
2217 #: build/C/man3/getifaddrs.3:267
2218 #, no-wrap
2219 msgid ""
2220 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2221 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2222 "            continue;\n"
2223 msgstr ""
2224 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2225 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2226 "            continue;\n"
2227
2228 #. type: Plain text
2229 #: build/C/man3/getifaddrs.3:269
2230 #, no-wrap
2231 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2232 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2233
2234 #. type: Plain text
2235 #: build/C/man3/getifaddrs.3:272
2236 #, no-wrap
2237 msgid ""
2238 "        /* Display interface name and family (including symbolic\n"
2239 "           form of the latter for the common families) */\n"
2240 msgstr ""
2241 "        /* Display interface name and family (including symbolic\n"
2242 "           form of the latter for the common families) */\n"
2243
2244 #. type: Plain text
2245 #: build/C/man3/getifaddrs.3:279
2246 #, no-wrap
2247 msgid ""
2248 "        printf(\"%-8s %s (%d)\\en\",\n"
2249 "               ifa-E<gt>ifa_name,\n"
2250 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2251 "               (family == AF_INET) ? \"AF_INET\" :\n"
2252 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2253 "               family);\n"
2254 msgstr ""
2255 "        printf(\"%-8s %s (%d)\\en\",\n"
2256 "               ifa-E<gt>ifa_name,\n"
2257 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2258 "               (family == AF_INET) ? \"AF_INET\" :\n"
2259 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2260 "               family);\n"
2261
2262 #. type: Plain text
2263 #: build/C/man3/getifaddrs.3:281
2264 #, no-wrap
2265 msgid "        /* For an AF_INET* interface address, display the address */\n"
2266 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2267
2268 #. type: Plain text
2269 #: build/C/man3/getifaddrs.3:292
2270 #, no-wrap
2271 msgid ""
2272 "        if (family == AF_INET || family == AF_INET6) {\n"
2273 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2274 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2275 "                                          sizeof(struct sockaddr_in6),\n"
2276 "                    host, NI_MAXHOST,\n"
2277 "                    NULL, 0, NI_NUMERICHOST);\n"
2278 "            if (s != 0) {\n"
2279 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2280 "                exit(EXIT_FAILURE);\n"
2281 "            }\n"
2282 msgstr ""
2283 "        if (family == AF_INET || family == AF_INET6) {\n"
2284 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2285 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2286 "                                          sizeof(struct sockaddr_in6),\n"
2287 "                    host, NI_MAXHOST,\n"
2288 "                    NULL, 0, NI_NUMERICHOST);\n"
2289 "            if (s != 0) {\n"
2290 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2291 "                exit(EXIT_FAILURE);\n"
2292 "            }\n"
2293
2294 #. type: Plain text
2295 #: build/C/man3/getifaddrs.3:294
2296 #, no-wrap
2297 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2298 msgstr "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2299
2300 #. type: Plain text
2301 #: build/C/man3/getifaddrs.3:297
2302 #, no-wrap
2303 msgid ""
2304 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2305 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2306 msgstr ""
2307 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2308 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2309
2310 #. type: Plain text
2311 #: build/C/man3/getifaddrs.3:304
2312 #, no-wrap
2313 msgid ""
2314 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2315 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2316 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2317 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2318 "        }\n"
2319 "    }\n"
2320 msgstr ""
2321 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2322 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2323 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2324 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2325 "        }\n"
2326 "    }\n"
2327
2328 #. type: Plain text
2329 #: build/C/man3/getifaddrs.3:308
2330 #, no-wrap
2331 msgid ""
2332 "    freeifaddrs(ifaddr);\n"
2333 "    exit(EXIT_SUCCESS);\n"
2334 "}\n"
2335 msgstr ""
2336 "    freeifaddrs(ifaddr);\n"
2337 "    exit(EXIT_SUCCESS);\n"
2338 "}\n"
2339
2340 #. type: Plain text
2341 #: build/C/man3/getifaddrs.3:315
2342 msgid ""
2343 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2344 msgstr ""
2345 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2346
2347 #. type: TH
2348 #: build/C/man2/getsockname.2:40
2349 #, no-wrap
2350 msgid "GETSOCKNAME"
2351 msgstr "GETSOCKNAME"
2352
2353 #. type: TH
2354 #: build/C/man2/getsockname.2:40
2355 #, no-wrap
2356 msgid "2008-12-03"
2357 msgstr "2008-12-03"
2358
2359 #. type: Plain text
2360 #: build/C/man2/getsockname.2:43
2361 msgid "getsockname - get socket name"
2362 msgstr "getsockname - ソケットの名前を取得する"
2363
2364 #. type: Plain text
2365 #: build/C/man2/getsockname.2:49
2366 #, no-wrap
2367 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2368 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2369
2370 #. type: Plain text
2371 #: build/C/man2/getsockname.2:62
2372 msgid ""
2373 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2374 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2375 "should be initialized to indicate the amount of space (in bytes) pointed to "
2376 "by I<addr>.  On return it contains the actual size of the socket address."
2377 msgstr ""
2378 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2379 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2380 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2381 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2382 "納される。"
2383
2384 #. type: Plain text
2385 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2386 #: build/C/man2/listen.2:109
2387 msgid "The argument I<sockfd> is not a valid descriptor."
2388 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2389
2390 #. type: Plain text
2391 #: build/C/man2/getsockname.2:84
2392 msgid ""
2393 "The I<addr> argument points to memory not in a valid part of the process "
2394 "address space."
2395 msgstr ""
2396 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2397 "い。"
2398
2399 #. type: Plain text
2400 #: build/C/man2/getsockname.2:88
2401 msgid "I<addrlen> is invalid (e.g., is negative)."
2402 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2403
2404 #. type: TP
2405 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2406 #: build/C/man2/send.2:367
2407 #, no-wrap
2408 msgid "B<ENOBUFS>"
2409 msgstr "B<ENOBUFS>"
2410
2411 #. type: Plain text
2412 #: build/C/man2/getsockname.2:92
2413 msgid ""
2414 "Insufficient resources were available in the system to perform the operation."
2415 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2416
2417 #. type: Plain text
2418 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2419 msgid "The argument I<sockfd> is a file, not a socket."
2420 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2421
2422 #.  SVr4 documents additional ENOMEM
2423 #.  and ENOSR error codes.
2424 #. type: Plain text
2425 #: build/C/man2/getsockname.2:103
2426 msgid ""
2427 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2428 "POSIX.1-2001."
2429 msgstr ""
2430 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2431
2432 #. type: Plain text
2433 #: build/C/man2/getsockname.2:114
2434 msgid ""
2435 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2436 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2437 "resulted in the present I<socklen_t>, also used by glibc.  See also "
2438 "B<accept>(2)."
2439 msgstr ""
2440 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2441 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2442 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2443
2444 #. type: Plain text
2445 #: build/C/man2/getsockname.2:121
2446 msgid ""
2447 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2448 "B<unix>(7)"
2449 msgstr ""
2450 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2451 "B<unix>(7)"
2452
2453 #. type: TH
2454 #: build/C/man2/getsockopt.2:44
2455 #, no-wrap
2456 msgid "GETSOCKOPT"
2457 msgstr "GETSOCKOPT"
2458
2459 #. type: TH
2460 #: build/C/man2/getsockopt.2:44
2461 #, no-wrap
2462 msgid "2014-04-28"
2463 msgstr "2014-04-28"
2464
2465 #. type: Plain text
2466 #: build/C/man2/getsockopt.2:47
2467 msgid "getsockopt, setsockopt - get and set options on sockets"
2468 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2469
2470 #. type: Plain text
2471 #: build/C/man2/getsockopt.2:57
2472 #, no-wrap
2473 msgid ""
2474 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2475 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2476 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2477 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2478 msgstr ""
2479 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2480 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2481 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2482 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2483
2484 #. type: Plain text
2485 #: build/C/man2/getsockopt.2:67
2486 msgid ""
2487 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2488 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2489 "protocol levels; they are always present at the uppermost socket level."
2490 msgstr ""
2491 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2492 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2493 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2494 "定される。"
2495
2496 #. type: Plain text
2497 #: build/C/man2/getsockopt.2:86
2498 msgid ""
2499 "When manipulating socket options, the level at which the option resides and "
2500 "the name of the option must be specified.  To manipulate options at the "
2501 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2502 "options at any other level the protocol number of the appropriate protocol "
2503 "controlling the option is supplied.  For example, to indicate that an option "
2504 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2505 "protocol number of B<TCP>; see B<getprotoent>(3)."
2506 msgstr ""
2507 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2508 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2509 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2510 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2511 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2512 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2513 "B<getprotoent>(3)  を参照すること。"
2514
2515 #. type: Plain text
2516 #: build/C/man2/getsockopt.2:108
2517 msgid ""
2518 "The arguments I<optval> and I<optlen> are used to access option values for "
2519 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2520 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2521 "I<optlen> is a value-result argument, initially containing the size of the "
2522 "buffer pointed to by I<optval>, and modified on return to indicate the "
2523 "actual size of the value returned.  If no option value is to be supplied or "
2524 "returned, I<optval> may be NULL."
2525 msgstr ""
2526 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2527 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2528 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2529 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2530 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2531 "I<optval> は NULL でも良い。"
2532
2533 #. type: Plain text
2534 #: build/C/man2/getsockopt.2:118
2535 msgid ""
2536 "I<Optname> and any specified options are passed uninterpreted to the "
2537 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2538 "socket.hE<gt>> contains definitions for socket level options, described "
2539 "below.  Options at other protocol levels vary in format and name; consult "
2540 "the appropriate entries in section 4 of the manual."
2541 msgstr ""
2542 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2543 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2544 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2545 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2546 "ること。"
2547
2548 #. type: Plain text
2549 #: build/C/man2/getsockopt.2:127
2550 msgid ""
2551 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2552 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2553 "or zero if the option is to be disabled."
2554 msgstr ""
2555 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2556 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2557 "を指定し、 無効(disable)にするにはゼロを指定する。"
2558
2559 #. type: Plain text
2560 #: build/C/man2/getsockopt.2:131
2561 msgid ""
2562 "For a description of the available socket options see B<socket>(7)  and the "
2563 "appropriate protocol man pages."
2564 msgstr ""
2565 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2566 "ルの man ページを参照のこと。"
2567
2568 #. type: Plain text
2569 #: build/C/man2/getsockopt.2:152
2570 msgid ""
2571 "The address pointed to by I<optval> is not in a valid part of the process "
2572 "address space.  For B<getsockopt>(), this error may also be returned if "
2573 "I<optlen> is not in a valid part of the process address space."
2574 msgstr ""
2575 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2576 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2577 "い場合にもこのエラーが返される。"
2578
2579 #. type: Plain text
2580 #: build/C/man2/getsockopt.2:163
2581 msgid ""
2582 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2583 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2584 "option described in B<ip>(7))."
2585 msgstr ""
2586 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2587 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2588 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2589
2590 #. type: TP
2591 #: build/C/man2/getsockopt.2:163
2592 #, no-wrap
2593 msgid "B<ENOPROTOOPT>"
2594 msgstr "B<ENOPROTOOPT>"
2595
2596 #. type: Plain text
2597 #: build/C/man2/getsockopt.2:166
2598 msgid "The option is unknown at the level indicated."
2599 msgstr "指定された層(level)にはこのオプションは存在しない。"
2600
2601 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2602 #.  not document the
2603 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2604 #.  options
2605 #. type: Plain text
2606 #: build/C/man2/getsockopt.2:178
2607 msgid ""
2608 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2609 msgstr ""
2610 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2611 "POSIX.1-2001."
2612
2613 #. type: Plain text
2614 #: build/C/man2/getsockopt.2:199
2615 msgid ""
2616 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2617 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2618 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2619 "glibc.  See also B<accept>(2)."
2620 msgstr ""
2621 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2622 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2623 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2624 "る。 B<accept>(2)  も参照のこと。"
2625
2626 #. type: Plain text
2627 #: build/C/man2/getsockopt.2:202
2628 msgid ""
2629 "Several of the socket options should be handled at lower levels of the "
2630 "system."
2631 msgstr ""
2632 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2633
2634 #. type: Plain text
2635 #: build/C/man2/getsockopt.2:213
2636 msgid ""
2637 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2638 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2639 msgstr ""
2640 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2641 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2642
2643 #. type: TH
2644 #: build/C/man3/if_nameindex.3:26
2645 #, no-wrap
2646 msgid "IF_NAMEINDEX"
2647 msgstr "IF_NAMEINDEX"
2648
2649 #. type: TH
2650 #: build/C/man3/if_nameindex.3:26
2651 #, no-wrap
2652 msgid "2012-11-21"
2653 msgstr "2012-11-21"
2654
2655 #. type: Plain text
2656 #: build/C/man3/if_nameindex.3:29
2657 msgid ""
2658 "if_nameindex, if_freenameindex - get network interface names and indexes"
2659 msgstr ""
2660 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2661 "クスを取得する"
2662
2663 #. type: Plain text
2664 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2665 #, no-wrap
2666 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2667 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2668
2669 #. type: Plain text
2670 #: build/C/man3/if_nameindex.3:35
2671 #, no-wrap
2672 msgid ""
2673 "B<struct if_nameindex *if_nameindex(void);>\n"
2674 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2675 msgstr ""
2676 "B<struct if_nameindex *if_nameindex(void);>\n"
2677 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2678
2679 #. type: Plain text
2680 #: build/C/man3/if_nameindex.3:46
2681 msgid ""
2682 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2683 "structures, each containing information about one of the network interfaces "
2684 "on the local system.  The I<if_nameindex> structure contains at least the "
2685 "following entries:"
2686 msgstr ""
2687 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2688 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2689 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2690
2691 #. type: Plain text
2692 #: build/C/man3/if_nameindex.3:51
2693 #, no-wrap
2694 msgid ""
2695 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2696 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2697 msgstr ""
2698 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2699 "    char        *if_name;  /*ヌル終端された名前 (\"eth0\" など) */\n"
2700
2701 #. type: Plain text
2702 #: build/C/man3/if_nameindex.3:65
2703 msgid ""
2704 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2705 "points to the null-terminated interface name.  The end of the array is "
2706 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2707 msgstr ""
2708 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2709 "フィールドはヌル終端されたインターフェース名を指す。 配列の最後は、 "
2710 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2711
2712 #. type: Plain text
2713 #: build/C/man3/if_nameindex.3:71
2714 msgid ""
2715 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2716 "and should be freed using B<if_freenameindex>()  when no longer needed."
2717 msgstr ""
2718 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2719 "は B<if_freenameindex>() で解放すべきである。"
2720
2721 #. type: Plain text
2722 #: build/C/man3/if_nameindex.3:78
2723 msgid ""
2724 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2725 "is returned, and I<errno> is set appropriately."
2726 msgstr ""
2727 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2728 "NULL が返され、 I<errno> が適切に設定される。"
2729
2730 #. type: Plain text
2731 #: build/C/man3/if_nameindex.3:83
2732 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2733 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2734
2735 #. type: Plain text
2736 #: build/C/man3/if_nameindex.3:86
2737 msgid "Insufficient resources available."
2738 msgstr "利用可能なリソースが十分にない。"
2739
2740 #. type: Plain text
2741 #: build/C/man3/if_nameindex.3:97
2742 msgid ""
2743 "B<if_nameindex>()  may also fail for any of the errors specified for "
2744 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2745 "B<sendto>(2), or B<malloc>(3)."
2746 msgstr ""
2747 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), "
2748 "B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定され"
2749 "ているエラーのいずれかで失敗する場合がある。"
2750
2751 #. type: Plain text
2752 #: build/C/man3/if_nameindex.3:104
2753 msgid ""
2754 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2755 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2756 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2757 "available only on kernels that support netlink."
2758 msgstr ""
2759 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2760 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2761 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2762 "netlink をサポートするカーネルにおいてのみである。"
2763
2764 #. type: Plain text
2765 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:94
2766 msgid "RFC\\ 3493, POSIX.1-2001."
2767 msgstr "RFC\\ 3493, POSIX.1-2001."
2768
2769 #. type: Plain text
2770 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:96
2771 msgid "This function first appeared in BSDi."
2772 msgstr "この関数は BSDi 初めて登場した。"
2773
2774 #. type: Plain text
2775 #: build/C/man3/if_nameindex.3:112
2776 msgid ""
2777 "The program below demonstrates the use of the functions described on this "
2778 "page.  An example of the output this program might produce is the following:"
2779 msgstr ""
2780 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2781 "ムが生成する出力は以下のようになる。"
2782
2783 #. type: Plain text
2784 #: build/C/man3/if_nameindex.3:119
2785 #, no-wrap
2786 msgid ""
2787 "$ B<./a.out>I<\n"
2788 "1: lo\n"
2789 "2: wlan0\n"
2790 "3: em1>\n"
2791 msgstr ""
2792 "$ B<./a.out>I<\n"
2793 "1: lo\n"
2794 "2: wlan0\n"
2795 "3: em1>\n"
2796
2797 #. type: Plain text
2798 #: build/C/man3/if_nameindex.3:127
2799 #, no-wrap
2800 msgid ""
2801 "#include E<lt>net/if.hE<gt>\n"
2802 "#include E<lt>stdio.hE<gt>\n"
2803 "#include E<lt>stdlib.hE<gt>\n"
2804 "#include E<lt>unistd.hE<gt>\n"
2805 msgstr ""
2806 "#include E<lt>net/if.hE<gt>\n"
2807 "#include E<lt>stdio.hE<gt>\n"
2808 "#include E<lt>stdlib.hE<gt>\n"
2809 "#include E<lt>unistd.hE<gt>\n"
2810
2811 #. type: Plain text
2812 #: build/C/man3/if_nameindex.3:132
2813 #, no-wrap
2814 msgid ""
2815 "int\n"
2816 "main(int argc, char *argv[])\n"
2817 "{\n"
2818 "    struct if_nameindex *if_ni, *i;\n"
2819 msgstr ""
2820 "int\n"
2821 "main(int argc, char *argv[])\n"
2822 "{\n"
2823 "    struct if_nameindex *if_ni, *i;\n"
2824
2825 #. type: Plain text
2826 #: build/C/man3/if_nameindex.3:138
2827 #, no-wrap
2828 msgid ""
2829 "    if_ni = if_nameindex();\n"
2830 "    if (if_ni == NULL) {\n"
2831 "        perror(\"if_nameindex\");\n"
2832 "        exit(EXIT_FAILURE);\n"
2833 "    }\n"
2834 msgstr ""
2835 "    if_ni = if_nameindex();\n"
2836 "    if (if_ni == NULL) {\n"
2837 "        perror(\"if_nameindex\");\n"
2838 "        exit(EXIT_FAILURE);\n"
2839 "    }\n"
2840
2841 #. type: Plain text
2842 #: build/C/man3/if_nameindex.3:141
2843 #, no-wrap
2844 msgid ""
2845 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2846 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2847 msgstr ""
2848 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2849 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2850
2851 #. type: Plain text
2852 #: build/C/man3/if_nameindex.3:143
2853 #, no-wrap
2854 msgid "    if_freenameindex(if_ni);\n"
2855 msgstr "    if_freenameindex(if_ni);\n"
2856
2857 #. type: Plain text
2858 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:584
2859 #, no-wrap
2860 msgid ""
2861 "    exit(EXIT_SUCCESS);\n"
2862 "}\n"
2863 msgstr ""
2864 "    exit(EXIT_SUCCESS);\n"
2865 "}\n"
2866
2867 #. type: Plain text
2868 #: build/C/man3/if_nameindex.3:154
2869 msgid ""
2870 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2871 "B<if_nametoindex>(3), B<ifconfig>(8)"
2872 msgstr ""
2873 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2874 "B<if_nametoindex>(3), B<ifconfig>(8)"
2875
2876 #. type: TH
2877 #: build/C/man3/if_nametoindex.3:25
2878 #, no-wrap
2879 msgid "IF_NAMETOINDEX"
2880 msgstr "IF_NAMETOINDEX"
2881
2882 #. type: TH
2883 #: build/C/man3/if_nametoindex.3:25
2884 #, no-wrap
2885 msgid "2014-04-01"
2886 msgstr "2014-04-01"
2887
2888 #. type: Plain text
2889 #: build/C/man3/if_nametoindex.3:29
2890 msgid ""
2891 "if_nametoindex, if_indextoname - mappings between network interface names "
2892 "and indexes"
2893 msgstr ""
2894 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2895 "クスのマッピングを行う"
2896
2897 #. type: Plain text
2898 #: build/C/man3/if_nametoindex.3:34
2899 #, no-wrap
2900 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2901 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2902
2903 #. type: Plain text
2904 #: build/C/man3/if_nametoindex.3:36
2905 #, no-wrap
2906 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2907 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2908
2909 #. type: Plain text
2910 #: build/C/man3/if_nametoindex.3:43
2911 msgid ""
2912 "The B<if_nametoindex>()  function returns the index of the network interface "
2913 "corresponding to the name I<ifname>."
2914 msgstr ""
2915 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2916 "のインデックスを返す。"
2917
2918 #. type: Plain text
2919 #: build/C/man3/if_nametoindex.3:54
2920 msgid ""
2921 "The B<if_indextoname>()  function returns the name of the network interface "
2922 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2923 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2924 "least B<IF_NAMESIZE> bytes."
2925 msgstr ""
2926 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2927 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2928 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2929 "る。"
2930
2931 #. type: Plain text
2932 #: build/C/man3/if_nametoindex.3:61
2933 msgid ""
2934 "On success, B<if_nametoindex>()  returns the index number of the network "
2935 "interface; on error, 0 is returned and I<errno> is set appropriately."
2936 msgstr ""
2937 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2938 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2939
2940 #. type: Plain text
2941 #: build/C/man3/if_nametoindex.3:69
2942 msgid ""
2943 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2944 "returned and I<errno> is set appropriately."
2945 msgstr ""
2946 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2947 "が返され、 I<errno> が適切に設定される。"
2948
2949 #. type: Plain text
2950 #: build/C/man3/if_nametoindex.3:74
2951 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2952 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2953
2954 #. type: TP
2955 #: build/C/man3/if_nametoindex.3:74
2956 #, no-wrap
2957 msgid "B<ENXIO>"
2958 msgstr "B<ENXIO>"
2959
2960 #. type: Plain text
2961 #: build/C/man3/if_nametoindex.3:77
2962 msgid "No interface found for the index."
2963 msgstr "インデックスに対応するインターフェースがない。"
2964
2965 #. type: Plain text
2966 #: build/C/man3/if_nametoindex.3:85
2967 msgid ""
2968 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
2969 "errors specified for B<socket>(2)  or B<ioctl>(2)."
2970 msgstr ""
2971 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
2972 "に対して規定されているエラーのいずれかで失敗する場合がある。"
2973
2974 #. type: Plain text
2975 #: build/C/man3/if_nametoindex.3:92
2976 msgid ""
2977 "The B<if_nametoindex>()  and B<if_indextoname>()  functions are thread-safe."
2978 msgstr ""
2979 "関数 B<if_nametoindex>() と B<if_indextoname>() はスレッドセーフである。"
2980
2981 #. type: Plain text
2982 #: build/C/man3/if_nametoindex.3:100
2983 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2984 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
2985
2986 #. type: TH
2987 #: build/C/man2/listen.2:45
2988 #, no-wrap
2989 msgid "LISTEN"
2990 msgstr "LISTEN"
2991
2992 #. type: Plain text
2993 #: build/C/man2/listen.2:48
2994 msgid "listen - listen for connections on a socket"
2995 msgstr "listen - ソケット(socket)上の接続を待つ"
2996
2997 #. type: Plain text
2998 #: build/C/man2/listen.2:55
2999 #, no-wrap
3000 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3001 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3002
3003 #. type: Plain text
3004 #: build/C/man2/listen.2:63
3005 msgid ""
3006 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
3007 "that is, as a socket that will be used to accept incoming connection "
3008 "requests using B<accept>(2)."
3009 msgstr ""
3010 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3011 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
3012 "した接続要求を受け付けるのに使用されるソケットである。"
3013
3014 #. type: Plain text
3015 #: build/C/man2/listen.2:70
3016 msgid ""
3017 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3018 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3019 msgstr ""
3020 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3021 "するファイルディスクリプタである。"
3022
3023 #. type: Plain text
3024 #: build/C/man2/listen.2:82
3025 msgid ""
3026 "The I<backlog> argument defines the maximum length to which the queue of "
3027 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3028 "when the queue is full, the client may receive an error with an indication "
3029 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3030 "the request may be ignored so that a later reattempt at connection succeeds."
3031 msgstr ""
3032 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3033 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3034 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3035 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3036 "い。"
3037
3038 #. type: Plain text
3039 #: build/C/man2/listen.2:91
3040 msgid "Another socket is already listening on the same port."
3041 msgstr "別のソケットが既に同じポートを listen している。"
3042
3043 #. type: Plain text
3044 #: build/C/man2/listen.2:114 build/C/man2/send.2:386
3045 msgid "The argument I<sockfd> is not a socket."
3046 msgstr "引き数 I<sockfd> はソケットではない。"
3047
3048 #. type: Plain text
3049 #: build/C/man2/listen.2:119
3050 msgid "The socket is not of a type that supports the B<listen>()  operation."
3051 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3052
3053 #. type: Plain text
3054 #: build/C/man2/listen.2:124
3055 msgid ""
3056 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3057 "4.2BSD."
3058 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3059
3060 #. type: Plain text
3061 #: build/C/man2/listen.2:126
3062 msgid "To accept connections, the following steps are performed:"
3063 msgstr "接続を受け付けるには、以下の処理が実行される。"
3064
3065 #. type: TP
3066 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:347
3067 #, no-wrap
3068 msgid "1."
3069 msgstr "1."
3070
3071 #. type: Plain text
3072 #: build/C/man2/listen.2:130
3073 msgid "A socket is created with B<socket>(2)."
3074 msgstr "B<socket>(2)  でソケットを作成する。"
3075
3076 #. type: TP
3077 #: build/C/man2/listen.2:130 build/C/man2/select_tut.2:356
3078 #, no-wrap
3079 msgid "2."
3080 msgstr "2."
3081
3082 #. type: Plain text
3083 #: build/C/man2/listen.2:136
3084 msgid ""
3085 "The socket is bound to a local address using B<bind>(2), so that other "
3086 "sockets may be B<connect>(2)ed to it."
3087 msgstr ""
3088 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3089 "のソケットに B<connect>(2)  できるようにする。"
3090
3091 #. type: TP
3092 #: build/C/man2/listen.2:136 build/C/man2/select_tut.2:360
3093 #, no-wrap
3094 msgid "3."
3095 msgstr "3."
3096
3097 #. type: Plain text
3098 #: build/C/man2/listen.2:140
3099 msgid ""
3100 "A willingness to accept incoming connections and a queue limit for incoming "
3101 "connections are specified with B<listen>()."
3102 msgstr ""
3103 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3104 "定する。"
3105
3106 #. type: TP
3107 #: build/C/man2/listen.2:140 build/C/man2/select_tut.2:367
3108 #, no-wrap
3109 msgid "4."
3110 msgstr "4."
3111
3112 #. type: Plain text
3113 #: build/C/man2/listen.2:143
3114 msgid "Connections are accepted with B<accept>(2)."
3115 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3116
3117 #. type: Plain text
3118 #: build/C/man2/listen.2:166
3119 msgid ""
3120 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3121 "2.2.  Now it specifies the queue length for I<completely> established "
3122 "sockets waiting to be accepted, instead of the number of incomplete "
3123 "connection requests.  The maximum length of the queue for incomplete sockets "
3124 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3125 "are enabled there is no logical maximum length and this setting is ignored.  "
3126 "See B<tcp>(7)  for more information."
3127 msgstr ""
3128 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3129 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3130 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3131 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3132 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3133 "論理的な最大長は存在せず、この設定は無視される。"
3134
3135 #.  The following is now rather historic information (MTK, Jun 05)
3136 #.  Don't rely on this value in portable applications since BSD
3137 #.  (and some BSD-derived systems) limit the backlog to 5.
3138 #. type: Plain text
3139 #: build/C/man2/listen.2:179
3140 msgid ""
3141 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3142 "somaxconn>, then it is silently truncated to that value; the default value "
3143 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3144 "value, B<SOMAXCONN>, with the value 128."
3145 msgstr ""
3146 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3147 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3148 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3149 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3150
3151 #. type: Plain text
3152 #: build/C/man2/listen.2:188
3153 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3154 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3155
3156 #. type: TH
3157 #: build/C/man2/recv.2:41
3158 #, no-wrap
3159 msgid "RECV"
3160 msgstr "RECV"
3161
3162 #. type: Plain text
3163 #: build/C/man2/recv.2:44
3164 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3165 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3166
3167 #. type: Plain text
3168 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3169 #: build/C/man2/select_tut.2:47
3170 #, no-wrap
3171 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3172 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3173
3174 #. type: Plain text
3175 #: build/C/man2/recv.2:53
3176 #, no-wrap
3177 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3178 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3179
3180 #. type: Plain text
3181 #: build/C/man2/recv.2:56
3182 #, no-wrap
3183 msgid ""
3184 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3185 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3186 msgstr ""
3187 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3188 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3189
3190 #. type: Plain text
3191 #: build/C/man2/recv.2:58
3192 #, no-wrap
3193 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3194 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3195
3196 #. type: Plain text
3197 #: build/C/man2/recv.2:70
3198 msgid ""
3199 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3200 "messages from a socket.  They may be used to receive data on both "
3201 "connectionless and connection-oriented sockets.  This page first describes "
3202 "common features of all three system calls, and then describes the "
3203 "differences between the calls."
3204 msgstr ""
3205 "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受"
3206 "け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 "
3207 "(connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら "
3208 "3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違い"
3209 "について説明する。"
3210
3211 #. type: Plain text
3212 #: build/C/man2/recv.2:76
3213 msgid ""
3214 "All three calls return the length of the message on successful completion.  "
3215 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3216 "discarded depending on the type of socket the message is received from."
3217 msgstr ""
3218 "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返"
3219 "す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッ"
3220 "セージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれな"
3221 "い。"
3222
3223 #. type: Plain text
3224 #: build/C/man2/recv.2:86
3225 msgid ""
3226 "If no messages are available at the socket, the receive calls wait for a "
3227 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3228 "which case the value -1 is returned and the external variable I<errno> is "
3229 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3230 "data available, up to the requested amount, rather than waiting for receipt "
3231 "of the full amount requested."
3232 msgstr ""
3233 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3234 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3235 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3236 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3237 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3238 "る (受信されるデータの最大サイズは要求したサイズである)。"
3239
3240 #. type: Plain text
3241 #: build/C/man2/recv.2:93
3242 msgid ""
3243 "An application can use B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3244 "determine when more data arrives on a socket."
3245 msgstr ""
3246 "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットに"
3247 "さらにデータが到着しているかを判定することができる。"
3248
3249 #. type: SS
3250 #: build/C/man2/recv.2:93 build/C/man2/send.2:160
3251 #, no-wrap
3252 msgid "The flags argument"
3253 msgstr "フラグ引き数"
3254
3255 #. type: Plain text
3256 #: build/C/man2/recv.2:97
3257 msgid ""
3258 "The I<flags> argument is formed by ORing one or more of the following values:"
3259 msgstr ""
3260 "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指"
3261 "定する:"
3262
3263 #. type: TP
3264 #: build/C/man2/recv.2:97
3265 #, no-wrap
3266 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3267 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3268
3269 #. type: Plain text
3270 #: build/C/man2/recv.2:108
3271 msgid ""
3272 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3273 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3274 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3275 "flag of B<open>(2)."
3276 msgstr ""
3277 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3278 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3279 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3280 "同じ理由で有用である。"
3281
3282 #. type: TP
3283 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3284 #, no-wrap
3285 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3286 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3287
3288 #. type: Plain text
3289 #: build/C/man2/recv.2:118
3290 msgid ""
3291 "Enables nonblocking operation; if the operation would block, the call fails "
3292 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3293 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3294 msgstr ""
3295 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3296 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3297 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3298
3299 #. type: TP
3300 #: build/C/man2/recv.2:118
3301 #, no-wrap
3302 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3303 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3304
3305 #. type: Plain text
3306 #: build/C/man2/recv.2:137
3307 msgid ""
3308 "This flag specifies that queued errors should be received from the socket "
3309 "error queue.  The error is passed in an ancillary message with a type "
3310 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3311 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3312 "information.  The payload of the original packet that caused the error is "
3313 "passed as normal data via I<msg_iovec>.  The original destination address of "
3314 "the datagram that caused the error is supplied via I<msg_name>."
3315 msgstr ""
3316 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3317 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3318 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3319 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3320 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3321 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3322 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3323 "I<msg_name> 経由で参照できる。"
3324
3325 #. type: Plain text
3326 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3327 msgid ""
3328 "For local errors, no address is passed (this can be checked with the "
3329 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3330 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3331 "the pending socket error is regenerated based on the next queued error and "
3332 "will be passed on the next socket operation."
3333 msgstr ""
3334 "ローカルなエラーの場合はアドレスは渡されない\n"
3335 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3336 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3337 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3338 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3339
3340 #. type: Plain text
3341 #: build/C/man2/recv.2:153
3342 msgid "The error is supplied in a I<sock_extended_err> structure:"
3343 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3344
3345 #. type: Plain text
3346 #: build/C/man2/recv.2:160
3347 #, no-wrap
3348 msgid ""
3349 "#define SO_EE_ORIGIN_NONE    0\n"
3350 "#define SO_EE_ORIGIN_LOCAL   1\n"
3351 "#define SO_EE_ORIGIN_ICMP    2\n"
3352 "#define SO_EE_ORIGIN_ICMP6   3\n"
3353 msgstr ""
3354 "#define SO_EE_ORIGIN_NONE    0\n"
3355 "#define SO_EE_ORIGIN_LOCAL   1\n"
3356 "#define SO_EE_ORIGIN_ICMP    2\n"
3357 "#define SO_EE_ORIGIN_ICMP6   3\n"
3358
3359 #. type: Plain text
3360 #: build/C/man2/recv.2:172
3361 #, no-wrap
3362 msgid ""
3363 "struct sock_extended_err\n"
3364 "{\n"
3365 "    uint32_t ee_errno;   /* error number */\n"
3366 "    uint8_t  ee_origin;  /* where the error originated */\n"
3367 "    uint8_t  ee_type;    /* type */\n"
3368 "    uint8_t  ee_code;    /* code */\n"
3369 "    uint8_t  ee_pad;     /* padding */\n"
3370 "    uint32_t ee_info;    /* additional information */\n"
3371 "    uint32_t ee_data;    /* other data */\n"
3372 "    /* More data may follow */\n"
3373 "};\n"
3374 msgstr ""
3375 "struct sock_extended_err\n"
3376 "{\n"
3377 "    uint32_t ee_errno;   /* error number */\n"
3378 "    uint8_t  ee_origin;  /* where the error originated */\n"
3379 "    uint8_t  ee_type;    /* type */\n"
3380 "    uint8_t  ee_code;    /* code */\n"
3381 "    uint8_t  ee_pad;     /* padding */\n"
3382 "    uint32_t ee_info;    /* additional information */\n"
3383 "    uint32_t ee_data;    /* other data */\n"
3384 "    /* More data may follow */\n"
3385 "};\n"
3386
3387 #. type: Plain text
3388 #: build/C/man2/recv.2:174
3389 #, no-wrap
3390 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3391 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3392
3393 #. type: Plain text
3394 #: build/C/man2/recv.2:198
3395 msgid ""
3396 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3397 "is the origin code of where the error originated.  The other fields are "
3398 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3399 "address of the network object where the error originated from given a "
3400 "pointer to the ancillary message.  If this address is not known, the "
3401 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3402 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3403 "caused the error is passed as normal data."
3404 msgstr ""
3405 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3406 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3407 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3408 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3409 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3410 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3411 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3412 "される。"
3413
3414 #. type: TP
3415 #: build/C/man2/recv.2:212 build/C/man2/recv.2:401 build/C/man2/send.2:230
3416 #, no-wrap
3417 msgid "B<MSG_OOB>"
3418 msgstr "B<MSG_OOB>"
3419
3420 #. type: Plain text
3421 #: build/C/man2/recv.2:219
3422 msgid ""
3423 "This flag requests receipt of out-of-band data that would not be received in "
3424 "the normal data stream.  Some protocols place expedited data at the head of "
3425 "the normal data queue, and thus this flag cannot be used with such protocols."
3426 msgstr ""
3427 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3428 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3429 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3430 "い。"
3431
3432 #. type: TP
3433 #: build/C/man2/recv.2:219
3434 #, no-wrap
3435 msgid "B<MSG_PEEK>"
3436 msgstr "B<MSG_PEEK>"
3437
3438 #. type: Plain text
3439 #: build/C/man2/recv.2:226
3440 msgid ""
3441 "This flag causes the receive operation to return data from the beginning of "
3442 "the receive queue without removing that data from the queue.  Thus, a "
3443 "subsequent receive call will return the same data."
3444 msgstr ""
3445 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3446 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3447 "が返ることになる。"
3448
3449 #. type: TP
3450 #: build/C/man2/recv.2:226
3451 #, no-wrap
3452 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3453 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3454
3455 #. type: Plain text
3456 #: build/C/man2/recv.2:234
3457 msgid ""
3458 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3459 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3460 "return the real length of the packet or datagram, even when it was longer "
3461 "than the passed buffer."
3462 msgstr ""
3463 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3464 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3465 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3466 "場合にも、 パケットやデータグラムの実際の長さを返す。"
3467
3468 #. type: Plain text
3469 #: build/C/man2/recv.2:237
3470 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3471 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3472
3473 #. type: TP
3474 #: build/C/man2/recv.2:237
3475 #, no-wrap
3476 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3477 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3478
3479 #. type: Plain text
3480 #: build/C/man2/recv.2:245
3481 msgid ""
3482 "This flag requests that the operation block until the full request is "
3483 "satisfied.  However, the call may still return less data than requested if a "
3484 "signal is caught, an error or disconnect occurs, or the next data to be "
3485 "received is of a different type than that returned."
3486 msgstr ""
3487 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3488 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3489 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3490 "りデータが少なくても返ることがある。"
3491
3492 #. type: SS
3493 #: build/C/man2/recv.2:245
3494 #, no-wrap
3495 msgid "recvfrom()"
3496 msgstr "recvfrom()"
3497
3498 #. type: Plain text
3499 #: build/C/man2/recv.2:251
3500 msgid ""
3501 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3502 "caller must specify the size of the buffer in I<len>."
3503 msgstr ""
3504 "B<recvfrom>() は受信したメッセージをバッファ I<buf> に格納する。 呼び出し元は"
3505 "バッファサイズを I<len> で指定しなければならない。"
3506
3507 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3508 #.  .I src_addr
3509 #.  is filled in.
3510 #.  .I src_addr
3511 #.  is also filled in for stream sockets in the UNIX domain, but is not
3512 #.  filled in for stream sockets in the Internet domain.)
3513 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3514 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3515 #. type: Plain text
3516 #: build/C/man2/recv.2:279
3517 msgid ""
3518 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3519 "address of the message, that source address is placed in the buffer pointed "
3520 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3521 "Before the call, it should be initialized to the size of the buffer "
3522 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3523 "the actual size of the source address.  The returned address is truncated if "
3524 "the buffer provided is too small; in this case, I<addrlen> will return a "
3525 "value greater than was supplied to the call."
3526 msgstr ""
3527 "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが"
3528 "分かる場合、 この送信元アドレスが I<src_addr> が指すバッファに格納される。 こ"
3529 "の場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元は "
3530 "I<src_addr> に割り当てたバッファの大きさで初期化しておくべきである。 返ってく"
3531 "る時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡された"
3532 "バッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められる。この場"
3533 "合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返される。"
3534
3535 #. type: Plain text
3536 #: build/C/man2/recv.2:286
3537 msgid ""
3538 "If the caller is not interested in the source address, I<src_addr> should be "
3539 "specified as NULL and I<addrlen> should be specified as 0."
3540 msgstr ""
3541 "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> には NULL を指定"
3542 "し、 I<addrlen> には 0 を指定すべきである。"
3543
3544 #. type: SS
3545 #: build/C/man2/recv.2:286
3546 #, no-wrap
3547 msgid "recv()"
3548 msgstr "recv()"
3549
3550 #. type: Plain text
3551 #: build/C/man2/recv.2:294
3552 msgid ""
3553 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3554 "B<connect>(2)).  It is equivalent to the call:"
3555 msgstr ""
3556 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用さ"
3557 "れる (B<connect>(2) 参照)。次の呼び出しと等価である。"
3558
3559 #. type: Plain text
3560 #: build/C/man2/recv.2:297
3561 #, no-wrap
3562 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3563 msgstr "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3564
3565 #. type: SS
3566 #: build/C/man2/recv.2:297
3567 #, no-wrap
3568 msgid "recvmsg()"
3569 msgstr "recvmsg()"
3570
3571 #. type: Plain text
3572 #: build/C/man2/recv.2:305
3573 msgid ""
3574 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3575 "directly supplied arguments.  This structure is defined as follows in "
3576 "I<E<lt>sys/socket.hE<gt>>:"
3577 msgstr ""
3578 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3579 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3580
3581 #. type: Plain text
3582 #: build/C/man2/recv.2:312
3583 #, no-wrap
3584 msgid ""
3585 "struct iovec {                    /* Scatter/gather array items */\n"
3586 "    void  *iov_base;              /* Starting address */\n"
3587 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3588 "};\n"
3589 msgstr ""
3590 "struct iovec {                    /* Scatter/gather array items */\n"
3591 "    void  *iov_base;              /* Starting address */\n"
3592 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3593 "};\n"
3594
3595 #. type: Plain text
3596 #: build/C/man2/recv.2:322
3597 #, no-wrap
3598 msgid ""
3599 "struct msghdr {\n"
3600 "    void         *msg_name;       /* optional address */\n"
3601 "    socklen_t     msg_namelen;    /* size of address */\n"
3602 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3603 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3604 "    void         *msg_control;    /* ancillary data, see below */\n"
3605 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3606 "    int           msg_flags;      /* flags on received message */\n"
3607 "};\n"
3608 msgstr ""
3609 "struct msghdr {\n"
3610 "    void         *msg_name;       /* 追加のアドレス */\n"
3611 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3612 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3613 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3614 "    void         *msg_control;    /* 補助データ (後述) */\n"
3615 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3616 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3617 "};\n"
3618
3619 #. type: Plain text
3620 #: build/C/man2/recv.2:338
3621 msgid ""
3622 "The I<msg_name> field points to a caller-allocated buffer that is used to "
3623 "return the source address if the socket is unconnected.  The caller should "
3624 "set I<msg_namelen> to the size of this buffer before this call; upon return "
3625 "from a successful call, I<msg_namelen> will contain the length of the "
3626 "returned address.  If the application does not need to know the source "
3627 "address, I<msg_name> can be specified as NULL."
3628 msgstr ""
3629 "フィールド I<msg_name> は、 ソケットが接続されていない場合に送信元アドレスを"
3630 "返すのに使用されるバッファを指す。 このバッファは呼び出し元が確保する。 呼び"
3631 "出し元は呼び出し前に I<msg_namelen> にこのバッファの大きさを設定しなければな"
3632 "らない。 呼び出しが成功した場合、呼び出しから返って来た際には I<msg_namelen> "
3633 "には返されるアドレスの長さが入っている。 アプリケーションが送信元アドレスを知"
3634 "る必要がない場合には、 I<msg_name> に NULL を指定することができる。"
3635
3636 #. type: Plain text
3637 #: build/C/man2/recv.2:345
3638 msgid ""
3639 "The fields I<msg_iov> and I<msg_iovlen> describe scatter-gather locations, "
3640 "as discussed in B<readv>(2)."
3641 msgstr ""
3642 "I<msg_iov> と I<msg_iovlen> フィールドは scatter-gather 用の場所を指定する。 "
3643 "B<readv>(2) に説明がある。"
3644
3645 #. type: Plain text
3646 #: build/C/man2/recv.2:360
3647 msgid ""
3648 "The field I<msg_control>, which has length I<msg_controllen>, points to a "
3649 "buffer for other protocol control-related messages or miscellaneous "
3650 "ancillary data.  When B<recvmsg>()  is called, I<msg_controllen> should "
3651 "contain the length of the available buffer in I<msg_control>; upon return "
3652 "from a successful call it will contain the length of the control message "
3653 "sequence."
3654 msgstr ""
3655 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3656 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3657 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3658 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3659 "さが入っている。"
3660
3661 #. type: Plain text
3662 #: build/C/man2/recv.2:362
3663 msgid "The messages are of the form:"
3664 msgstr "メッセージの形式は以下の通り:"
3665
3666 #. type: Plain text
3667 #: build/C/man2/recv.2:372
3668 #, no-wrap
3669 msgid ""
3670 "struct cmsghdr {\n"
3671 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3672 "    int           cmsg_level;   /* originating protocol */\n"
3673 "    int           cmsg_type;    /* protocol-specific type */\n"
3674 "/* followed by\n"
3675 "    unsigned char cmsg_data[]; */\n"
3676 "};\n"
3677 msgstr ""
3678 "struct cmsghdr {\n"
3679 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3680 "    int           cmsg_level;   /* originating protocol */\n"
3681 "    int           cmsg_type;    /* protocol-specific type */\n"
3682 "/* followed by\n"
3683 "    unsigned char cmsg_data[]; */\n"
3684 "};\n"
3685
3686 #. type: Plain text
3687 #: build/C/man2/recv.2:377
3688 msgid ""
3689 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3690 msgstr ""
3691 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3692
3693 #. type: Plain text
3694 #: build/C/man2/recv.2:380
3695 msgid ""
3696 "As an example, Linux uses this ancillary data mechanism to pass extended "
3697 "errors, IP options, or file descriptors over UNIX domain sockets."
3698 msgstr ""
3699 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3700 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3701 "いる。"
3702
3703 #. type: Plain text
3704 #: build/C/man2/recv.2:388
3705 msgid ""
3706 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3707 "It can contain several flags:"
3708 msgstr ""
3709 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3710 "れる。ここにはいくつかのフラグが入る。"
3711
3712 #. type: TP
3713 #: build/C/man2/recv.2:388
3714 #, no-wrap
3715 msgid "B<MSG_EOR>"
3716 msgstr "B<MSG_EOR>"
3717
3718 #. type: Plain text
3719 #: build/C/man2/recv.2:393
3720 msgid ""
3721 "indicates end-of-record; the data returned completed a record (generally "
3722 "used with sockets of type B<SOCK_SEQPACKET>)."
3723 msgstr ""
3724 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3725 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3726
3727 #. type: TP
3728 #: build/C/man2/recv.2:393
3729 #, no-wrap
3730 msgid "B<MSG_TRUNC>"
3731 msgstr "B<MSG_TRUNC>"
3732
3733 #. type: Plain text
3734 #: build/C/man2/recv.2:397
3735 msgid ""
3736 "indicates that the trailing portion of a datagram was discarded because the "
3737 "datagram was larger than the buffer supplied."
3738 msgstr ""
3739 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3740 "た部分が捨てられたことを示す。"
3741
3742 #. type: TP
3743 #: build/C/man2/recv.2:397
3744 #, no-wrap
3745 msgid "B<MSG_CTRUNC>"
3746 msgstr "B<MSG_CTRUNC>"
3747
3748 #. type: Plain text
3749 #: build/C/man2/recv.2:401
3750 msgid ""
3751 "indicates that some control data were discarded due to lack of space in the "
3752 "buffer for ancillary data."
3753 msgstr ""
3754 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3755 "を示す。"
3756
3757 #. type: Plain text
3758 #: build/C/man2/recv.2:404
3759 msgid ""
3760 "is returned to indicate that expedited or out-of-band data were received."
3761 msgstr "速達データや帯域外データを受信したことを示す。"
3762
3763 #. type: TP
3764 #: build/C/man2/recv.2:404
3765 #, no-wrap
3766 msgid "B<MSG_ERRQUEUE>"
3767 msgstr "B<MSG_ERRQUEUE>"
3768
3769 #. type: Plain text
3770 #: build/C/man2/recv.2:408
3771 msgid ""
3772 "indicates that no data was received but an extended error from the socket "
3773 "error queue."
3774 msgstr ""
3775 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3776 "を示す。"
3777
3778 #. type: Plain text
3779 #: build/C/man2/recv.2:414
3780 msgid ""
3781 "These calls return the number of bytes received, or -1 if an error "
3782 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3783 msgstr ""
3784 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3785 "にエラーを示す値を設定する。"
3786
3787 #. type: Plain text
3788 #: build/C/man2/recv.2:417
3789 msgid ""
3790 "When a stream socket peer has performed an orderly shutdown, the return "
3791 "value will be 0 (the traditional \"end-of-file\" return)."
3792 msgstr ""
3793 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3794 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3795
3796 #. type: Plain text
3797 #: build/C/man2/recv.2:421
3798 msgid ""
3799 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3800 "permit zero-length datagrams.  When such a datagram is received, the return "
3801 "value is 0."
3802 msgstr ""
3803 "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメイ"
3804 "ンなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受"
3805 "信した場合、 返り値は 0 となる。"
3806
3807 #. type: Plain text
3808 #: build/C/man2/recv.2:424
3809 msgid ""
3810 "The value 0 may also be returned if the requested number of bytes to receive "
3811 "from a stream socket was 0."
3812 msgstr ""
3813 "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返され"
3814 "る。"
3815
3816 #. type: Plain text
3817 #: build/C/man2/recv.2:429
3818 msgid ""
3819 "These are some standard errors generated by the socket layer.  Additional "
3820 "errors may be generated and returned from the underlying protocol modules; "
3821 "see their manual pages."
3822 msgstr ""
3823 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3824 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3825 "ること。"
3826
3827 #.  Actually EAGAIN on Linux
3828 #. type: Plain text
3829 #: build/C/man2/recv.2:438
3830 msgid ""
3831 "The socket is marked nonblocking and the receive operation would block, or a "
3832 "receive timeout had been set and the timeout expired before data was "
3833 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3834 "and does not require these constants to have the same value, so a portable "
3835 "application should check for both possibilities."
3836 msgstr ""
3837 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3838 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3839 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3840 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3841 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3842
3843 #. type: Plain text
3844 #: build/C/man2/recv.2:443
3845 msgid "The argument I<sockfd> is an invalid descriptor."
3846 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3847
3848 #. type: Plain text
3849 #: build/C/man2/recv.2:447
3850 msgid ""
3851 "A remote host refused to allow the network connection (typically because it "
3852 "is not running the requested service)."
3853 msgstr ""
3854 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3855 "たサービスが起動されていないなどがある)。"
3856
3857 #. type: Plain text
3858 #: build/C/man2/recv.2:451
3859 msgid ""
3860 "The receive buffer pointer(s) point outside the process's address space."
3861 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3862
3863 #. type: Plain text
3864 #: build/C/man2/recv.2:456
3865 msgid ""
3866 "The receive was interrupted by delivery of a signal before any data were "
3867 "available; see B<signal>(7)."
3868 msgstr ""
3869 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3870
3871 #. type: Plain text
3872 #: build/C/man2/recv.2:460 build/C/man2/send.2:355
3873 msgid "Invalid argument passed."
3874 msgstr "不正な引き数が渡された。"
3875
3876 #. type: Plain text
3877 #: build/C/man2/recv.2:464
3878 msgid "Could not allocate memory for B<recvmsg>()."
3879 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3880
3881 #. type: TP
3882 #: build/C/man2/recv.2:464 build/C/man2/send.2:378
3883 #, no-wrap
3884 msgid "B<ENOTCONN>"
3885 msgstr "B<ENOTCONN>"
3886
3887 #. type: Plain text
3888 #: build/C/man2/recv.2:471
3889 msgid ""
3890 "The socket is associated with a connection-oriented protocol and has not "
3891 "been connected (see B<connect>(2)  and B<accept>(2))."
3892 msgstr ""
3893 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3894 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3895
3896 #. type: Plain text
3897 #: build/C/man2/recv.2:476
3898 msgid "The argument I<sockfd> does not refer to a socket."
3899 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3900
3901 #. type: Plain text
3902 #: build/C/man2/recv.2:479
3903 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3904 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3905
3906 #. type: Plain text
3907 #: build/C/man2/recv.2:486
3908 msgid ""
3909 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3910 "flags."
3911 msgstr ""
3912 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3913 "されている。"
3914
3915 #. type: Plain text
3916 #: build/C/man2/recv.2:502
3917 msgid ""
3918 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3919 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3920 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3921 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3922 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3923 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3924 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3925 msgstr ""
3926 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3927 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3928 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3929 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3930 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3931 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3932 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3933
3934 #.  glibc bug raised 12 Mar 2006
3935 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3936 #.  The problem is an underlying kernel issue: the size of the
3937 #.  __kernel_size_t type used to type this field varies
3938 #.  across architectures, but socklen_t is always 32 bits.
3939 #. type: Plain text
3940 #: build/C/man2/recv.2:516 build/C/man2/send.2:441
3941 msgid ""
3942 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3943 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3944 "I<size_t>."
3945 msgstr ""
3946 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3947 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3948 "ある。"
3949
3950 #. type: Plain text
3951 #: build/C/man2/recv.2:521
3952 msgid ""
3953 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3954 "can be used to receive multiple datagrams in a single call."
3955 msgstr ""
3956 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3957 "固有の システムコールに関する情報が書かれている。"
3958
3959 #. type: Plain text
3960 #: build/C/man2/recv.2:526
3961 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3962 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3963
3964 #. type: Plain text
3965 #: build/C/man2/recv.2:537
3966 msgid ""
3967 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3968 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3969 msgstr ""
3970 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3971 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3972
3973 #. type: TH
3974 #: build/C/man2/recvmmsg.2:31
3975 #, no-wrap
3976 msgid "RECVMMSG"
3977 msgstr "RECVMMSG"
3978
3979 #. type: TH
3980 #: build/C/man2/recvmmsg.2:31
3981 #, no-wrap
3982 msgid "2014-05-21"
3983 msgstr "2014-05-21"
3984
3985 #. type: Plain text
3986 #: build/C/man2/recvmmsg.2:34
3987 msgid "recvmmsg - receive multiple messages on a socket"
3988 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
3989
3990 #. type: Plain text
3991 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
3992 #, no-wrap
3993 msgid ""
3994 "B<#define _GNU_SOURCE>\n"
3995 "B<#include E<lt>sys/socket.hE<gt>>\n"
3996 msgstr ""
3997 "B<#define _GNU_SOURCE>\n"
3998 "B<#include E<lt>sys/socket.hE<gt>>\n"
3999
4000 #. type: Plain text
4001 #: build/C/man2/recvmmsg.2:41
4002 #, no-wrap
4003 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4004 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4005
4006 #. type: Plain text
4007 #: build/C/man2/recvmmsg.2:43
4008 #, no-wrap
4009 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4010 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4011
4012 #. type: Plain text
4013 #: build/C/man2/recvmmsg.2:55
4014 msgid ""
4015 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
4016 "the caller to receive multiple messages from a socket using a single system "
4017 "call.  (This has performance benefits for some applications.)  A further "
4018 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
4019 "operation."
4020 msgstr ""
4021 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4022 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4023 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4024 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4025
4026 #. type: Plain text
4027 #: build/C/man2/recvmmsg.2:59
4028 msgid ""
4029 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4030 "from."
4031 msgstr ""
4032 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
4033
4034 #. type: Plain text
4035 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4036 msgid ""
4037 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4038 "The size of this array is specified in I<vlen>."
4039 msgstr ""
4040 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4041 "I<vlen> で指定する。"
4042
4043 #. type: Plain text
4044 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4045 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4046 msgstr ""
4047 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4048
4049 #. type: Plain text
4050 #: build/C/man2/recvmmsg.2:80
4051 #, no-wrap
4052 msgid ""
4053 "struct mmsghdr {\n"
4054 "    struct msghdr msg_hdr;  /* Message header */\n"
4055 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4056 "};\n"
4057 msgstr ""
4058 "struct mmsghdr {\n"
4059 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
4060 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
4061 "};\n"
4062
4063 #. type: Plain text
4064 #: build/C/man2/recvmmsg.2:95
4065 msgid ""
4066 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
4067 "B<recvmsg>(2).  The I<msg_len> field is the number of bytes returned for the "
4068 "message in the entry.  This field has the same value as the return value of "
4069 "a single B<recvmsg>(2)  on the header."
4070 msgstr ""
4071 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4072 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4073 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4074 "る。"
4075
4076 #. type: Plain text
4077 #: build/C/man2/recvmmsg.2:102
4078 msgid ""
4079 "The I<flags> argument contains flags ORed together.  The flags are the same "
4080 "as documented for B<recvmsg>(2), with the following addition:"
4081 msgstr ""
4082 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4083 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4084
4085 #. type: TP
4086 #: build/C/man2/recvmmsg.2:102
4087 #, no-wrap
4088 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4089 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4090
4091 #. type: Plain text
4092 #: build/C/man2/recvmmsg.2:107
4093 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4094 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4095
4096 #. type: Plain text
4097 #: build/C/man2/recvmmsg.2:122
4098 msgid ""
4099 "The I<timeout> argument points to a I<struct timespec> (see "
4100 "B<clock_gettime>(2))  defining a timeout (seconds plus nanoseconds) for the "
4101 "receive operation (I<but see BUGS!>).  (This interval will be rounded up to "
4102 "the system clock granularity, and kernel scheduling delays mean that the "
4103 "blocking interval may overrun by a small amount.)  If I<timeout> is NULL, "
4104 "then the operation blocks indefinitely."
4105 msgstr ""
4106 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4107 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (I<ただし、"
4108 "バグを参照のこと>) (待ち時間はシステムクロックの粒度に切り上げられ、カーネル"
4109 "のスケジューリング遅延により少しだけ長くなる可能性がある)。 I<timeout>が "
4110 "NULL の場合、 受信操作は無期限に停止 (block) する。"
4111
4112 #. type: Plain text
4113 #: build/C/man2/recvmmsg.2:133
4114 msgid ""
4115 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4116 "received or until the timeout expires.  A nonblocking call reads as many "
4117 "messages as are available (up to the limit specified by I<vlen>)  and "
4118 "returns immediately."
4119 msgstr ""
4120 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4121 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4122 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4123 "すぐに返る。"
4124
4125 #. type: Plain text
4126 #: build/C/man2/recvmmsg.2:148
4127 msgid ""
4128 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4129 "to contain information about each received message: I<msg_len> contains the "
4130 "size of the received message; the subfields of I<msg_hdr> are updated as "
4131 "described in B<recvmsg>(2).  The return value of the call indicates the "
4132 "number of elements of I<msgvec> that have been updated."
4133 msgstr ""
4134 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4135 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4136 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4137 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4138 "数である。"
4139
4140 #. type: Plain text
4141 #: build/C/man2/recvmmsg.2:156
4142 msgid ""
4143 "On success, B<recvmmsg>()  returns the number of messages received in "
4144 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4145 "error."
4146 msgstr ""
4147 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4148 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4149
4150 #. type: Plain text
4151 #: build/C/man2/recvmmsg.2:160
4152 msgid ""
4153 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4154 msgstr ""
4155 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4156 "がある。"
4157
4158 #. type: Plain text
4159 #: build/C/man2/recvmmsg.2:164
4160 msgid "I<timeout> is invalid."
4161 msgstr "I<timeout> が無効である。"
4162
4163 #. type: Plain text
4164 #: build/C/man2/recvmmsg.2:169
4165 msgid ""
4166 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4167 "was added in version 2.12."
4168 msgstr ""
4169 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4170 "はバージョン 2.12 以降で利用可能である。"
4171
4172 #. type: Plain text
4173 #: build/C/man2/recvmmsg.2:172
4174 msgid "B<recvmmsg>()  is Linux-specific."
4175 msgstr "B<recvmmsg>() は Linux 固有である。"
4176
4177 #. type: Plain text
4178 #: build/C/man2/recvmmsg.2:180
4179 msgid ""
4180 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4181 "socket and stores them in multiple buffers.  The call returns if all buffers "
4182 "are filled or if the timeout specified has expired."
4183 msgstr ""
4184 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4185 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4186 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4187
4188 #. type: Plain text
4189 #: build/C/man2/recvmmsg.2:183
4190 msgid ""
4191 "The following snippet periodically generates UDP datagrams containing a "
4192 "random number:"
4193 msgstr ""
4194 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4195 "る。"
4196
4197 #. type: Plain text
4198 #: build/C/man2/recvmmsg.2:188
4199 #, no-wrap
4200 msgid ""
4201 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4202 "B<sleep 0.25; done>\n"
4203 msgstr ""
4204 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4205 "B<sleep 0.25; done>\n"
4206
4207 #. type: Plain text
4208 #: build/C/man2/recvmmsg.2:193
4209 msgid ""
4210 "These datagrams are read by the example application, which can give the "
4211 "following output:"
4212 msgstr ""
4213 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4214 "が得られる。"
4215
4216 #. type: Plain text
4217 #: build/C/man2/recvmmsg.2:203
4218 #, no-wrap
4219 msgid ""
4220 "$B< ./a.out>\n"
4221 "5 messages received\n"
4222 "1 11782\n"
4223 "2 11345\n"
4224 "3 304\n"
4225 "4 13514\n"
4226 "5 28421\n"
4227 msgstr ""
4228 "$B< ./a.out>\n"
4229 "5 messages received\n"
4230 "1 11782\n"
4231 "2 11345\n"
4232 "3 304\n"
4233 "4 13514\n"
4234 "5 28421\n"
4235
4236 #. type: Plain text
4237 #: build/C/man2/recvmmsg.2:214
4238 #, no-wrap
4239 msgid ""
4240 "#define _GNU_SOURCE\n"
4241 "#include E<lt>netinet/ip.hE<gt>\n"
4242 "#include E<lt>stdio.hE<gt>\n"
4243 "#include E<lt>stdlib.hE<gt>\n"
4244 "#include E<lt>string.hE<gt>\n"
4245 "#include E<lt>sys/socket.hE<gt>\n"
4246 msgstr ""
4247 "#define _GNU_SOURCE\n"
4248 "#include E<lt>netinet/ip.hE<gt>\n"
4249 "#include E<lt>stdio.hE<gt>\n"
4250 "#include E<lt>stdlib.hE<gt>\n"
4251 "#include E<lt>string.hE<gt>\n"
4252 "#include E<lt>sys/socket.hE<gt>\n"
4253
4254 #. type: Plain text
4255 #: build/C/man2/recvmmsg.2:227
4256 #, no-wrap
4257 msgid ""
4258 "int\n"
4259 "main(void)\n"
4260 "{\n"
4261 "#define VLEN 10\n"
4262 "#define BUFSIZE 200\n"
4263 "#define TIMEOUT 1\n"
4264 "    int sockfd, retval, i;\n"
4265 "    struct sockaddr_in sa;\n"
4266 "    struct mmsghdr msgs[VLEN];\n"
4267 "    struct iovec iovecs[VLEN];\n"
4268 "    char bufs[VLEN][BUFSIZE+1];\n"
4269 "    struct timespec timeout;\n"
4270 msgstr ""
4271 "int\n"
4272 "main(void)\n"
4273 "{\n"
4274 "#define VLEN 10\n"
4275 "#define BUFSIZE 200\n"
4276 "#define TIMEOUT 1\n"
4277 "    int sockfd, retval, i;\n"
4278 "    struct sockaddr_in sa;\n"
4279 "    struct mmsghdr msgs[VLEN];\n"
4280 "    struct iovec iovecs[VLEN];\n"
4281 "    char bufs[VLEN][BUFSIZE+1];\n"
4282 "    struct timespec timeout;\n"
4283
4284 #. type: Plain text
4285 #: build/C/man2/recvmmsg.2:233 build/C/man2/sendmmsg.2:201
4286 #, no-wrap
4287 msgid ""
4288 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4289 "    if (sockfd == -1) {\n"
4290 "        perror(\"socket()\");\n"
4291 "        exit(EXIT_FAILURE);\n"
4292 "    }\n"
4293 msgstr ""
4294 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4295 "    if (sockfd == -1) {\n"
4296 "        perror(\"socket()\");\n"
4297 "        exit(EXIT_FAILURE);\n"
4298 "    }\n"
4299
4300 #. type: Plain text
4301 #: build/C/man2/recvmmsg.2:241
4302 #, no-wrap
4303 msgid ""
4304 "    sa.sin_family = AF_INET;\n"
4305 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4306 "    sa.sin_port = htons(1234);\n"
4307 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4308 "        perror(\"bind()\");\n"
4309 "        exit(EXIT_FAILURE);\n"
4310 "    }\n"
4311 msgstr ""
4312 "    sa.sin_family = AF_INET;\n"
4313 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4314 "    sa.sin_port = htons(1234);\n"
4315 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4316 "        perror(\"bind()\");\n"
4317 "        exit(EXIT_FAILURE);\n"
4318 "    }\n"
4319
4320 #. type: Plain text
4321 #: build/C/man2/recvmmsg.2:249
4322 #, no-wrap
4323 msgid ""
4324 "    memset(msgs, 0, sizeof(msgs));\n"
4325 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4326 "        iovecs[i].iov_base         = bufs[i];\n"
4327 "        iovecs[i].iov_len          = BUFSIZE;\n"
4328 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4329 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4330 "    }\n"
4331 msgstr ""
4332 "    memset(msgs, 0, sizeof(msgs));\n"
4333 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4334 "        iovecs[i].iov_base         = bufs[i];\n"
4335 "        iovecs[i].iov_len          = BUFSIZE;\n"
4336 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4337 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4338 "    }\n"
4339
4340 #. type: Plain text
4341 #: build/C/man2/recvmmsg.2:252
4342 #, no-wrap
4343 msgid ""
4344 "    timeout.tv_sec = TIMEOUT;\n"
4345 "    timeout.tv_nsec = 0;\n"
4346 msgstr ""
4347 "    timeout.tv_sec = TIMEOUT;\n"
4348 "    timeout.tv_nsec = 0;\n"
4349
4350 #. type: Plain text
4351 #: build/C/man2/recvmmsg.2:258
4352 #, no-wrap
4353 msgid ""
4354 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4355 "    if (retval == -1) {\n"
4356 "        perror(\"recvmmsg()\");\n"
4357 "        exit(EXIT_FAILURE);\n"
4358 "    }\n"
4359 msgstr ""
4360 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4361 "    if (retval == -1) {\n"
4362 "        perror(\"recvmmsg()\");\n"
4363 "        exit(EXIT_FAILURE);\n"
4364 "    }\n"
4365
4366 #. type: Plain text
4367 #: build/C/man2/recvmmsg.2:266
4368 #, no-wrap
4369 msgid ""
4370 "    printf(\"%d messages received\\en\", retval);\n"
4371 "    for (i = 0; i E<lt> retval; i++) {\n"
4372 "        bufs[i][msgs[i].msg_len] = 0;\n"
4373 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4374 "    }\n"
4375 "    exit(EXIT_SUCCESS);\n"
4376 "}\n"
4377 msgstr ""
4378 "    printf(\"%d messages received\\en\", retval);\n"
4379 "    for (i = 0; i E<lt> retval; i++) {\n"
4380 "        bufs[i][msgs[i].msg_len] = 0;\n"
4381 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4382 "    }\n"
4383 "    exit(EXIT_SUCCESS);\n"
4384 "}\n"
4385
4386 #.  FIXME https://bugzilla.kernel.org/show_bug.cgi?id=75371
4387 #.  http://thread.gmane.org/gmane.linux.man/5677
4388 #. type: Plain text
4389 #: build/C/man2/recvmmsg.2:278
4390 msgid ""
4391 "The I<timeout> argument does not work as intended.  The timeout is checked "
4392 "only after the receipt of each datagram, so that if up to I<vlen-1> "
4393 "datagrams are received before the timeout expires, but then no further "
4394 "datagrams are received, the call will block forever."
4395 msgstr ""
4396 "I<timeout> 引き数は意図した通りには動作しない。 タイムアウトは各データグラム"
4397 "の受信後にのみチェックされる。 そのため、 タイムアウトが満了する前に "
4398 "I<vlen-1> 個のデータグラムを受信し、 その後全くデータグラムを受信しなかった場"
4399 "合、 呼び出しはずっと停止し続けてしまう。"
4400
4401 #. type: Plain text
4402 #: build/C/man2/recvmmsg.2:285
4403 msgid ""
4404 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4405 "B<socket>(2), B<socket>(7)"
4406 msgstr ""
4407 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4408 "B<socket>(2), B<socket>(7)"
4409
4410 #. type: TH
4411 #: build/C/man2/select.2:38
4412 #, no-wrap
4413 msgid "SELECT"
4414 msgstr "SELECT"
4415
4416 #. type: TH
4417 #: build/C/man2/select.2:38
4418 #, no-wrap
4419 msgid "2014-01-31"
4420 msgstr "2014-01-31"
4421
4422 #. type: Plain text
4423 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4424 msgid ""
4425 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4426 "multiplexing"
4427 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4428
4429 #. type: Plain text
4430 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4431 #, no-wrap
4432 msgid "/* According to POSIX.1-2001 */\n"
4433 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4434
4435 #. type: Plain text
4436 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4437 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4438 #, no-wrap
4439 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4440 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4441
4442 #. type: Plain text
4443 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4444 #, no-wrap
4445 msgid "/* According to earlier standards */\n"
4446 msgstr "/* 以前の規格に従う場合 */\n"
4447
4448 #. type: Plain text
4449 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4450 #, no-wrap
4451 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4452 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4453
4454 #. type: Plain text
4455 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4456 #, no-wrap
4457 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4458 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4459
4460 #. type: Plain text
4461 #: build/C/man2/select.2:58
4462 #, no-wrap
4463 msgid ""
4464 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4465 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4466 msgstr ""
4467 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4468 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4469
4470 #. type: Plain text
4471 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4472 #, no-wrap
4473 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4474 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4475
4476 #. type: Plain text
4477 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4478 #, no-wrap
4479 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4480 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4481
4482 #. type: Plain text
4483 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4484 #, no-wrap
4485 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4486 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4487
4488 #. type: Plain text
4489 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4490 #, no-wrap
4491 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4492 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4493
4494 #. type: Plain text
4495 #: build/C/man2/select.2:72
4496 #, no-wrap
4497 msgid ""
4498 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4499 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4500 "B<            const sigset_t *>I<sigmask>B<);>\n"
4501 msgstr ""
4502 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4503 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4504 "B<            const sigset_t *>I<sigmask>B<);>\n"
4505
4506 #. type: Plain text
4507 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4508 #: build/C/man3/sockatmark.3:36
4509 msgid ""
4510 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4511 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4512
4513 #. type: Plain text
4514 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4515 msgid ""
4516 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4517 "600"
4518 msgstr ""
4519 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4520 "600"
4521
4522 #. type: Plain text
4523 #: build/C/man2/select.2:92
4524 msgid ""
4525 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4526 "descriptors, waiting until one or more of the file descriptors become \"ready"
4527 "\" for some class of I/O operation (e.g., input possible).  A file "
4528 "descriptor is considered ready if it is possible to perform the "
4529 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
4530 msgstr ""
4531 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4532 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4533 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4534 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
4535 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
4536 "意味する。"
4537
4538 #. type: Plain text
4539 #: build/C/man2/select.2:98
4540 msgid ""
4541 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4542 "these three differences:"
4543 msgstr ""
4544 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4545
4546 #. type: TP
4547 #: build/C/man2/select.2:98
4548 #, no-wrap
4549 msgid "(i)"
4550 msgstr "(i)"
4551
4552 #. type: Plain text
4553 #: build/C/man2/select.2:108
4554 msgid ""
4555 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4556 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4557 "and nanoseconds)."
4558 msgstr ""
4559 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4560 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4561 "timespec> (秒・ナノ秒単位) を用いる。"
4562
4563 #. type: TP
4564 #: build/C/man2/select.2:108
4565 #, no-wrap
4566 msgid "(ii)"
4567 msgstr "(ii)"
4568
4569 #. type: Plain text
4570 #: build/C/man2/select.2:116
4571 msgid ""
4572 "B<select>()  may update the I<timeout> argument to indicate how much time "
4573 "was left.  B<pselect>()  does not change this argument."
4574 msgstr ""
4575 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4576 "B<pselect>()  はこの引き数を変更しない。"
4577
4578 #. type: TP
4579 #: build/C/man2/select.2:116
4580 #, no-wrap
4581 msgid "(iii)"
4582 msgstr "(iii)"
4583
4584 #. type: Plain text
4585 #: build/C/man2/select.2:125
4586 msgid ""
4587 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4588 "with NULL I<sigmask>."
4589 msgstr ""
4590 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4591 "指定した場合の B<pselect>()  と同じである。"
4592
4593 #. type: Plain text
4594 #: build/C/man2/select.2:143
4595 msgid ""
4596 "Three independent sets of file descriptors are watched.  Those listed in "
4597 "I<readfds> will be watched to see if characters become available for reading "
4598 "(more precisely, to see if a read will not block; in particular, a file "
4599 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4600 "watched to see if a write will not block, and those in I<exceptfds> will be "
4601 "watched for exceptions.  On exit, the sets are modified in place to indicate "
4602 "which file descriptors actually changed status.  Each of the three file "
4603 "descriptor sets may be specified as NULL if no file descriptors are to be "
4604 "watched for the corresponding class of events."
4605 msgstr ""
4606 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4607 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4608 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4609 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4610 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
4611 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
4612 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
4613 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
4614 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
4615 "指定することができる。"
4616
4617 #. type: Plain text
4618 #: build/C/man2/select.2:156
4619 msgid ""
4620 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4621 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4622 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4623 "part of the set; this is useful after B<select>()  returns."
4624 msgstr ""
4625 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4626 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4627 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4628 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4629 "る。"
4630
4631 #. type: Plain text
4632 #: build/C/man2/select.2:159
4633 msgid ""
4634 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4635 "plus 1."
4636 msgstr ""
4637 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4638 "のである。"
4639
4640 #. type: Plain text
4641 #: build/C/man2/select.2:166
4642 msgid ""
4643 "The I<timeout> argument specifies the interval that B<select>()  should "
4644 "block waiting for a file descriptor to become ready.  The call will block "
4645 "until either:"
4646 msgstr ""
4647 "I<timeout> 引き数は、 B<select>() がファイルディスクリプタが ready になるのを"
4648 "待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
4649
4650 #. type: IP
4651 #: build/C/man2/select.2:166 build/C/man2/select.2:168
4652 #: build/C/man2/select.2:170
4653 #, no-wrap
4654 msgid "*"
4655 msgstr "*"
4656
4657 #. type: Plain text
4658 #: build/C/man2/select.2:168
4659 msgid "a file descriptor becomes ready;"
4660 msgstr "ファイルディスクリプタが利用可能になる。"
4661
4662 #. type: Plain text
4663 #: build/C/man2/select.2:170
4664 msgid "the call is interrupted by a signal handler; or"
4665 msgstr "システムコールがシグナルハンドラにより割り込まれた。"
4666
4667 #. type: Plain text
4668 #: build/C/man2/select.2:172
4669 msgid "the timeout expires."
4670 msgstr "タイムアウト時間が満了した。"
4671
4672 #. type: Plain text
4673 #: build/C/man2/select.2:189
4674 msgid ""
4675 "Note that the I<timeout> interval will be rounded up to the system clock "
4676 "granularity, and kernel scheduling delays mean that the blocking interval "
4677 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4678 "are zero, then B<select>()  returns immediately.  (This is useful for "
4679 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4680 "indefinitely."
4681 msgstr ""
4682 "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケ"
4683 "ジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 "
4684 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰す"
4685 "る (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に "
4686 "NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) "
4687 "する。"
4688
4689 #. type: Plain text
4690 #: build/C/man2/select.2:199
4691 msgid ""
4692 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4693 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4694 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4695 "restores the original signal mask."
4696 msgstr ""
4697 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4698 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4699 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4700 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4701
4702 #. type: Plain text
4703 #: build/C/man2/select.2:205
4704 msgid ""
4705 "Other than the difference in the precision of the I<timeout> argument, the "
4706 "following B<pselect>()  call:"
4707 msgstr ""
4708 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4709
4710 #. type: Plain text
4711 #: build/C/man2/select.2:209
4712 #, no-wrap
4713 msgid ""
4714 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4715 "                    timeout, &sigmask);\n"
4716 msgstr ""
4717 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4718 "                    timeout, &sigmask);\n"
4719
4720 #. type: Plain text
4721 #: build/C/man2/select.2:214
4722 msgid "is equivalent to I<atomically> executing the following calls:"
4723 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4724
4725 #. type: Plain text
4726 #: build/C/man2/select.2:217
4727 #, no-wrap
4728 msgid "    sigset_t origmask;\n"
4729 msgstr "    sigset_t origmask;\n"
4730
4731 #. type: Plain text
4732 #: build/C/man2/select.2:221
4733 #, no-wrap
4734 msgid ""
4735 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4736 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4737 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4738 msgstr ""
4739 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4740 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4741 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4742
4743 #. type: Plain text
4744 #: build/C/man2/select.2:242
4745 msgid ""
4746 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4747 "either a signal or for a file descriptor to become ready, then an atomic "
4748 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4749 "a global flag and returns.  Then a test of this global flag followed by a "
4750 "call of B<select>()  could hang indefinitely if the signal arrived just "
4751 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4752 "one to first block signals, handle the signals that have come in, then call "
4753 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4754 msgstr ""
4755 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4756 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4757 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4758 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4759 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4760 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4761 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4762 "で、前記の競合を避けることができる。)"
4763
4764 #. type: SS
4765 #: build/C/man2/select.2:242
4766 #, no-wrap
4767 msgid "The timeout"
4768 msgstr "タイムアウト"
4769
4770 #. type: Plain text
4771 #: build/C/man2/select.2:246
4772 msgid ""
4773 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4774 "like"
4775 msgstr ""
4776 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4777
4778 #. type: Plain text
4779 #: build/C/man2/select.2:253
4780 #, no-wrap
4781 msgid ""
4782 "struct timeval {\n"
4783 "    long    tv_sec;         /* seconds */\n"
4784 "    long    tv_usec;        /* microseconds */\n"
4785 "};\n"
4786 msgstr ""
4787 "struct timeval {\n"
4788 "    long    tv_sec;         /* 秒 */\n"
4789 "    long    tv_usec;        /* マイクロ秒 */\n"
4790 "};\n"
4791
4792 #. type: Plain text
4793 #: build/C/man2/select.2:257
4794 msgid "and"
4795 msgstr "や"
4796
4797 #. type: Plain text
4798 #: build/C/man2/select.2:264
4799 #, no-wrap
4800 msgid ""
4801 "struct timespec {\n"
4802 "    long    tv_sec;         /* seconds */\n"
4803 "    long    tv_nsec;        /* nanoseconds */\n"
4804 "};\n"
4805 msgstr ""
4806 "struct timespec {\n"
4807 "    long    tv_sec;         /* 秒 */\n"
4808 "    long    tv_nsec;        /* ナノ秒 */\n"
4809 "};\n"
4810
4811 #. type: Plain text
4812 #: build/C/man2/select.2:268
4813 msgid "(However, see below on the POSIX.1-2001 versions.)"
4814 msgstr ""
4815 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4816 "照)"
4817
4818 #. type: Plain text
4819 #: build/C/man2/select.2:276
4820 msgid ""
4821 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4822 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4823 "precision."
4824 msgstr ""
4825 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4826 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4827 "呼び出すという方法を使っているコードもある。"
4828
4829 #.  .PP - it is rumored that:
4830 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4831 #.  - it is certainly true that:
4832 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4833 #. type: Plain text
4834 #: build/C/man2/select.2:299
4835 msgid ""
4836 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4837 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4838 "either behavior.)  This causes problems both when Linux code which reads "
4839 "I<timeout> is ported to other operating systems, and when code is ported to "
4840 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4841 "without reinitializing it.  Consider I<timeout> to be undefined after "
4842 "B<select>()  returns."
4843 msgstr ""
4844 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4845 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4846 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4847 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4848 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4849 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4850 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4851 "ある。"
4852
4853 #. type: Plain text
4854 #: build/C/man2/select.2:317
4855 msgid ""
4856 "On success, B<select>()  and B<pselect>()  return the number of file "
4857 "descriptors contained in the three returned descriptor sets (that is, the "
4858 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4859 "which may be zero if the timeout expires before anything interesting "
4860 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4861 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4862 "undefined."
4863 msgstr ""
4864 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4865 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4866 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4867 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4868 "ならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディスクリ"
4869 "プタ集合は変更されず、 I<timeout> は不定となる。"
4870
4871 #. type: Plain text
4872 #: build/C/man2/select.2:323
4873 msgid ""
4874 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4875 "descriptor that was already closed, or one on which an error has occurred.)"
4876 msgstr ""
4877 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4878 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4879 "タが指定された)。"
4880
4881 #. type: Plain text
4882 #: build/C/man2/select.2:327
4883 msgid "A signal was caught; see B<signal>(7)."
4884 msgstr "シグナルを受信した。"
4885
4886 #. type: Plain text
4887 #: build/C/man2/select.2:333
4888 msgid ""
4889 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4890 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4891
4892 #. type: Plain text
4893 #: build/C/man2/select.2:336
4894 msgid "unable to allocate memory for internal tables."
4895 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4896
4897 #. type: Plain text
4898 #: build/C/man2/select.2:342
4899 msgid ""
4900 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, "
4901 "B<pselect>()  was emulated in glibc (but see BUGS)."
4902 msgstr ""
4903 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4904 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4905
4906 #. type: Plain text
4907 #: build/C/man2/select.2:353
4908 msgid ""
4909 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4910 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4911 "clones of the BSD socket layer (including System\\ V variants).  However, "
4912 "note that the System\\ V variant typically sets the timeout variable before "
4913 "exit, but the BSD variant does not."
4914 msgstr ""
4915 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4916 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4917 "(System\\ V 系も含む) との間でだいたい移植性がある。しかし System\\ V 系では "
4918 "たいがい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注"
4919 "意すること。"
4920
4921 #. type: Plain text
4922 #: build/C/man2/select.2:357
4923 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4924 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4925
4926 #. type: Plain text
4927 #: build/C/man2/select.2:374
4928 msgid ""
4929 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4930 "with a value of I<fd> that is negative or is equal to or larger than "
4931 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4932 "I<fd> to be a valid file descriptor."
4933 msgstr ""
4934 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4935 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4936 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4937 "プタでなければならないと規定されている。"
4938
4939 #. type: Plain text
4940 #: build/C/man2/select.2:383
4941 msgid ""
4942 "Concerning the types involved, the classical situation is that the two "
4943 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4944 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4945 "situation is"
4946 msgstr ""
4947 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4948 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4949 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4950
4951 #. type: Plain text
4952 #: build/C/man2/select.2:390
4953 #, no-wrap
4954 msgid ""
4955 "struct timeval {\n"
4956 "    time_t         tv_sec;     /* seconds */\n"
4957 "    suseconds_t    tv_usec;    /* microseconds */\n"
4958 "};\n"
4959 msgstr ""
4960 "struct timeval {\n"
4961 "\t time_t         tv_sec;     /* 秒 */\n"
4962 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4963 "};\n"
4964
4965 #. type: Plain text
4966 #: build/C/man2/select.2:401
4967 msgid ""
4968 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4969 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4970 msgstr ""
4971 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4972 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4973
4974 #. type: Plain text
4975 #: build/C/man2/select.2:413
4976 msgid ""
4977 "Concerning prototypes, the classical situation is that one should include "
4978 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4979 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4980 msgstr ""
4981 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4982 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4983 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4984 "インクルードすればよい。"
4985
4986 #. type: Plain text
4987 #: build/C/man2/select.2:425
4988 msgid ""
4989 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4990 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4991 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4992 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4993 "requirements are as shown in the SYNOPSIS."
4994 msgstr ""
4995 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4996 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4997 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4998 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4999 "使用するには、「書式」に記載された要件を満たす必要がある。"
5000
5001 #. type: SS
5002 #: build/C/man2/select.2:425
5003 #, no-wrap
5004 msgid "Multithreaded applications"
5005 msgstr "マルチスレッド・アプリケーション"
5006
5007 #. type: Plain text
5008 #: build/C/man2/select.2:441
5009 msgid ""
5010 "If a file descriptor being monitored by B<select>()  is closed in another "
5011 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
5012 "unblocks and returns, with an indication that the file descriptor is ready "
5013 "(a subsequent I/O operation will likely fail with an error, unless another "
5014 "the file descriptor reopened between the time B<select>()  returned and the "
5015 "I/O operations was performed).  On Linux (and some other systems), closing "
5016 "the file descriptor in another thread has no effect on B<select>().  In "
5017 "summary, any application that relies on a particular behavior in this "
5018 "scenario must be considered buggy."
5019 msgstr ""
5020 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
5021 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
5022 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
5023 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
5024 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
5025 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
5026 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
5027 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
5028 "ている」と考えなければならない。"
5029
5030 #. type: SS
5031 #: build/C/man2/select.2:441
5032 #, no-wrap
5033 msgid "Linux notes"
5034 msgstr "Linux での注意"
5035
5036 #. type: Plain text
5037 #: build/C/man2/select.2:449
5038 msgid ""
5039 "The B<pselect>()  interface described in this page is implemented by glibc.  "
5040 "The underlying Linux system call is named B<pselect6>().  This system call "
5041 "has somewhat different behavior from the glibc wrapper function."
5042 msgstr ""
5043 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5044 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5045 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5046 "関数とは少し違った動作をする。"
5047
5048 #. type: Plain text
5049 #: build/C/man2/select.2:464
5050 msgid ""
5051 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5052 "However, the glibc wrapper function hides this behavior by using a local "
5053 "variable for the timeout argument that is passed to the system call.  Thus, "
5054 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5055 "this is the behavior required by POSIX.1-2001."
5056 msgstr ""
5057 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5058 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5059 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5060 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5061 "これが POSIX.1-2001 が要求している動作である。"
5062
5063 #. type: Plain text
5064 #: build/C/man2/select.2:470
5065 msgid ""
5066 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5067 "*> pointer, but is instead a structure of the form:"
5068 msgstr ""
5069 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5070 "ポインタではなく、以下に示す構造体である。"
5071
5072 #. type: Plain text
5073 #: build/C/man2/select.2:478
5074 #, no-wrap
5075 msgid ""
5076 "struct {\n"
5077 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5078 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5079 "                               to by 'ss' */\n"
5080 "};\n"
5081 msgstr ""
5082 "struct {\n"
5083 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
5084 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5085 "                               (バイト数) */\n"
5086 "};\n"
5087
5088 #. type: Plain text
5089 #: build/C/man2/select.2:485
5090 msgid ""
5091 "This allows the system call to obtain both a pointer to the signal set and "
5092 "its size, while allowing for the fact that most architectures support a "
5093 "maximum of 6 arguments to a system call."
5094 msgstr ""
5095 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5096 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5097 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5098 "のサイズの両方を取得することができるのである。"
5099
5100 #. type: Plain text
5101 #: build/C/man2/select.2:491
5102 msgid ""
5103 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5104 "argument."
5105 msgstr ""
5106 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5107 "されていた。"
5108
5109 #. type: Plain text
5110 #: build/C/man2/select.2:504
5111 msgid ""
5112 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5113 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5114 "implementation remained vulnerable to the very race condition that "
5115 "B<pselect>()  was designed to prevent.  Modern versions of glibc use the "
5116 "(race-free)  B<pselect>()  system call on kernels where it is provided."
5117 msgstr ""
5118 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5119 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5120 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5121 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5122 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5123 "が使用される。"
5124
5125 #. type: Plain text
5126 #: build/C/man2/select.2:517
5127 msgid ""
5128 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5129 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5130 "signal handler writes a byte to a pipe whose other end is monitored by "
5131 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5132 "to a pipe that may be full or reading from a pipe that may be empty, "
5133 "nonblocking I/O is used when reading from and writing to the pipe.)"
5134 msgstr ""
5135 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5136 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5137 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5138 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5139 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5140 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5141 "(nonblocking) I/O を使用するとよい)。"
5142
5143 #.  Stevens discusses a case where accept can block after select
5144 #.  returns successfully because of an intervening RST from the client.
5145 #.  Maybe the kernel should have returned EIO in such a situation?
5146 #. type: Plain text
5147 #: build/C/man2/select.2:533
5148 msgid ""
5149 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5150 "reading\", while nevertheless a subsequent read blocks.  This could for "
5151 "example happen when data has arrived but upon examination has wrong checksum "
5152 "and is discarded.  There may be other circumstances in which a file "
5153 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5154 "B<O_NONBLOCK> on sockets that should not block."
5155 msgstr ""
5156 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
5157 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5158 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5159 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5160 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5161 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5162
5163 #. type: Plain text
5164 #: build/C/man2/select.2:548
5165 msgid ""
5166 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5167 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5168 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5169 "behavior, but the glibc wrapper hides this behavior by internally copying "
5170 "the I<timeout> to a local variable and passing that variable to the system "
5171 "call."
5172 msgstr ""
5173 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
5174 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5175 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5176 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5177 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5178 "数をシステムコールに渡している。"
5179
5180 #. type: Plain text
5181 #: build/C/man2/select.2:555
5182 #, no-wrap
5183 msgid ""
5184 "#include E<lt>stdio.hE<gt>\n"
5185 "#include E<lt>stdlib.hE<gt>\n"
5186 "#include E<lt>sys/time.hE<gt>\n"
5187 "#include E<lt>sys/types.hE<gt>\n"
5188 "#include E<lt>unistd.hE<gt>\n"
5189 msgstr ""
5190 "#include E<lt>stdio.hE<gt>\n"
5191 "#include E<lt>stdlib.hE<gt>\n"
5192 "#include E<lt>sys/time.hE<gt>\n"
5193 "#include E<lt>sys/types.hE<gt>\n"
5194 "#include E<lt>unistd.hE<gt>\n"
5195
5196 #. type: Plain text
5197 #: build/C/man2/select.2:562
5198 #, no-wrap
5199 msgid ""
5200 "int\n"
5201 "main(void)\n"
5202 "{\n"
5203 "    fd_set rfds;\n"
5204 "    struct timeval tv;\n"
5205 "    int retval;\n"
5206 msgstr ""
5207 "int\n"
5208 "main(void)\n"
5209 "{\n"
5210 "    fd_set rfds;\n"
5211 "    struct timeval tv;\n"
5212 "    int retval;\n"
5213
5214 #. type: Plain text
5215 #: build/C/man2/select.2:566
5216 #, no-wrap
5217 msgid ""
5218 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5219 "    FD_ZERO(&rfds);\n"
5220 "    FD_SET(0, &rfds);\n"
5221 msgstr ""
5222 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5223 "    FD_ZERO(&rfds);\n"
5224 "    FD_SET(0, &rfds);\n"
5225
5226 #. type: Plain text
5227 #: build/C/man2/select.2:570
5228 #, no-wrap
5229 msgid ""
5230 "    /* Wait up to five seconds. */\n"
5231 "    tv.tv_sec = 5;\n"
5232 "    tv.tv_usec = 0;\n"
5233 msgstr ""
5234 "    /* 5 秒間監視する。*/\n"
5235 "    tv.tv_sec = 5;\n"
5236 "    tv.tv_usec = 0;\n"
5237
5238 #. type: Plain text
5239 #: build/C/man2/select.2:573
5240 #, no-wrap
5241 msgid ""
5242 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5243 "    /* Don't rely on the value of tv now! */\n"
5244 msgstr ""
5245 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5246 "    /* この時点での tv の値を信頼してはならない。*/\n"
5247
5248 #. type: Plain text
5249 #: build/C/man2/select.2:581
5250 #, no-wrap
5251 msgid ""
5252 "    if (retval == -1)\n"
5253 "        perror(\"select()\");\n"
5254 "    else if (retval)\n"
5255 "        printf(\"Data is available now.\\en\");\n"
5256 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5257 "    else\n"
5258 "        printf(\"No data within five seconds.\\en\");\n"
5259 msgstr ""
5260 "    if (retval == -1)\n"
5261 "\tperror(\"select()\");\n"
5262 "    else if (retval)\n"
5263 "        printf(\"今、データが取得できました。\\en\");\n"
5264 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5265 "    else\n"
5266 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5267
5268 #. type: Plain text
5269 #: build/C/man2/select.2:596
5270 msgid ""
5271 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5272 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5273 msgstr ""
5274 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), B<send>(2), "
5275 "B<sigprocmask>(2), B<write>(2), B<epoll>(7), B<time>(7)"
5276
5277 #. type: Plain text
5278 #: build/C/man2/select.2:599
5279 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5280 msgstr ""
5281 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5282
5283 #. type: TH
5284 #: build/C/man2/select_tut.2:32
5285 #, no-wrap
5286 msgid "SELECT_TUT"
5287 msgstr "SELECT_TUT"
5288
5289 #. type: TH
5290 #: build/C/man2/select_tut.2:32
5291 #, no-wrap
5292 msgid "2013-12-30"
5293 msgstr "2013-12-30"
5294
5295 #. type: Plain text
5296 #: build/C/man2/select_tut.2:52
5297 #, no-wrap
5298 msgid ""
5299 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5300 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5301 msgstr ""
5302 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5303 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5304
5305 #. type: Plain text
5306 #: build/C/man2/select_tut.2:66
5307 #, no-wrap
5308 msgid ""
5309 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5310 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5311 "B<            const sigset_t *>I<sigmask>B<);>\n"
5312 msgstr ""
5313 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5314 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5315 "B<            const sigset_t *>I<sigmask>B<);>\n"
5316
5317 #. type: Plain text
5318 #: build/C/man2/select_tut.2:83
5319 msgid ""
5320 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5321 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5322 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5323 "occurred on any of the descriptors."
5324 msgstr ""
5325 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5326 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5327 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5328 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5329 "る。"
5330
5331 #. type: Plain text
5332 #: build/C/man2/select_tut.2:108
5333 msgid ""
5334 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5335 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5336 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5337 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5338 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5339 "according to the rules described below; after calling B<select>()  you can "
5340 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5341 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5342 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5343 "descriptor from a set."
5344 msgstr ""
5345 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5346 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5347 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5348 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5349 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5350 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5351 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5352 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5353 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5354 "のファイルディスクリプタの削除を行う。"
5355
5356 #. type: SS
5357 #: build/C/man2/select_tut.2:108
5358 #, no-wrap
5359 msgid "Arguments"
5360 msgstr "引き数"
5361
5362 #. type: TP
5363 #: build/C/man2/select_tut.2:109
5364 #, no-wrap
5365 msgid "I<readfds>"
5366 msgstr "I<readfds>"
5367
5368 #. type: Plain text
5369 #: build/C/man2/select_tut.2:118
5370 msgid ""
5371 "This set is watched to see if data is available for reading from any of its "
5372 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5373 "cleared of all file descriptors except for those that are immediately "
5374 "available for reading."
5375 msgstr ""
5376 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5377 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5378 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5379
5380 #. type: TP
5381 #: build/C/man2/select_tut.2:118
5382 #, no-wrap
5383 msgid "I<writefds>"
5384 msgstr "I<writefds>"
5385
5386 #. type: Plain text
5387 #: build/C/man2/select_tut.2:127
5388 msgid ""
5389 "This set is watched to see if there is space to write data to any of its "
5390 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5391 "cleared of all file descriptors except for those that are immediately "
5392 "available for writing."
5393 msgstr ""
5394 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5395 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5396 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5397
5398 #. type: TP
5399 #: build/C/man2/select_tut.2:127
5400 #, no-wrap
5401 msgid "I<exceptfds>"
5402 msgstr "I<exceptfds>"
5403
5404 #. type: Plain text
5405 #: build/C/man2/select_tut.2:149
5406 msgid ""
5407 "This set is watched for \"exceptional conditions\".  In practice, only one "
5408 "such exceptional condition is common: the availability of I<out-of-band> "
5409 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5410 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5411 "where B<select>(2)  indicates an exceptional condition occurs with "
5412 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5413 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5414 "for those for which an exceptional condition has occurred."
5415 msgstr ""
5416 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5417 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5418 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5419 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5420 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5421 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5422 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5423 "状態が発生したディスクリプタ以外は集合から削除される。"
5424
5425 #. type: TP
5426 #: build/C/man2/select_tut.2:149
5427 #, no-wrap
5428 msgid "I<nfds>"
5429 msgstr "I<nfds>"
5430
5431 #. type: Plain text
5432 #: build/C/man2/select_tut.2:156
5433 msgid ""
5434 "This is an integer one more than the maximum of any file descriptor in any "
5435 "of the sets.  In other words, while adding file descriptors to each of the "
5436 "sets, you must calculate the maximum integer value of all of them, then "
5437 "increment this value by one, and then pass this as I<nfds>."
5438 msgstr ""
5439 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5440 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5441 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5442 "I<nfds> として渡さないといけない、ということだ。"
5443
5444 #. type: TP
5445 #: build/C/man2/select_tut.2:156
5446 #, no-wrap
5447 msgid "I<utimeout>"
5448 msgstr "I<utimeout>"
5449
5450 #. type: Plain text
5451 #: build/C/man2/select_tut.2:169
5452 msgid ""
5453 "This is the longest time B<select>()  may wait before returning, even if "
5454 "nothing interesting happened.  If this value is passed as NULL, then "
5455 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5456 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5457 "return immediately, with information about the readiness of file descriptors "
5458 "at the time of the call.  The structure I<struct timeval> is defined as:"
5459 msgstr ""
5460 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5461 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5462 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5463 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5464 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5465 "ように定義されている:"
5466
5467 #. type: Plain text
5468 #: build/C/man2/select_tut.2:176
5469 #, no-wrap
5470 msgid ""
5471 "struct timeval {\n"
5472 "    time_t tv_sec;    /* seconds */\n"
5473 "    long tv_usec;     /* microseconds */\n"
5474 "};\n"
5475 msgstr ""
5476 "struct timeval {\n"
5477 "    time_t tv_sec;    /* seconds */\n"
5478 "    long tv_usec;     /* microseconds */\n"
5479 "};\n"
5480
5481 #. type: TP
5482 #: build/C/man2/select_tut.2:178
5483 #, no-wrap
5484 msgid "I<ntimeout>"
5485 msgstr "I<ntimeout>"
5486
5487 #. type: Plain text
5488 #: build/C/man2/select_tut.2:187
5489 msgid ""
5490 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5491 "I<struct timespec> has nanosecond precision as follows:"
5492 msgstr ""
5493 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5494 "timespec> は次に示すようにナノ秒の精度を持つ。"
5495
5496 #. type: Plain text
5497 #: build/C/man2/select_tut.2:194
5498 #, no-wrap
5499 msgid ""
5500 "struct timespec {\n"
5501 "    long tv_sec;    /* seconds */\n"
5502 "    long tv_nsec;   /* nanoseconds */\n"
5503 "};\n"
5504 msgstr ""
5505 "struct timespec {\n"
5506 "    long tv_sec;    /* seconds */\n"
5507 "    long tv_nsec;   /* nanoseconds */\n"
5508 "};\n"
5509
5510 #. type: TP
5511 #: build/C/man2/select_tut.2:196
5512 #, no-wrap
5513 msgid "I<sigmask>"
5514 msgstr "I<sigmask>"
5515
5516 #. type: Plain text
5517 #: build/C/man2/select_tut.2:213
5518 msgid ""
5519 "This argument holds a set of signals that the kernel should unblock (i.e., "
5520 "remove from the signal mask of the calling thread), while the caller is "
5521 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5522 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5523 "the signal mask on entry and exit to the function.  In this case, "
5524 "B<pselect>()  will then behave just like B<select>()."
5525 msgstr ""
5526 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5527 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5528 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5529 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5530 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は "
5531 "B<select>()  と全く同じ動作となる。"
5532
5533 #. type: SS
5534 #: build/C/man2/select_tut.2:213
5535 #, no-wrap
5536 msgid "Combining signal and data events"
5537 msgstr "シグナルとデータイベントを組み合わせる"
5538
5539 #. type: Plain text
5540 #: build/C/man2/select_tut.2:257
5541 msgid ""
5542 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5543 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5544 "normally use the signal handler only to raise a global flag.  The global "
5545 "flag will indicate that the event must be processed in the main loop of the "
5546 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5547 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5548 "signals can be processed in the main loop of the program, otherwise "
5549 "B<select>()  would block indefinitely.  Now, somewhere in the main loop will "
5550 "be a conditional to check the global flag.  So we must ask: what if a signal "
5551 "arrives after the conditional, but before the B<select>()  call? The answer "
5552 "is that B<select>()  would block indefinitely, even though an event is "
5553 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5554 "This call can be used to set the signal mask to a set of signals that are "
5555 "only to be received within the B<pselect>()  call.  For instance, let us say "
5556 "that the event in question was the exit of a child process.  Before the "
5557 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5558 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5559 "mask.  Our program would look like:"
5560 msgstr ""
5561 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5562 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5563 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5564 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5565 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5566 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5567 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5568 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5569 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5570 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5571 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5572 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5573 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5574 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5575 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5576 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5577 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5578 "る。"
5579
5580 #. type: Plain text
5581 #: build/C/man2/select_tut.2:260
5582 #, no-wrap
5583 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5584 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5585
5586 #. type: Plain text
5587 #: build/C/man2/select_tut.2:266
5588 #, no-wrap
5589 msgid ""
5590 "static void\n"
5591 "child_sig_handler(int sig)\n"
5592 "{\n"
5593 "    got_SIGCHLD = 1;\n"
5594 "}\n"
5595 msgstr ""
5596 "static void\n"
5597 "child_sig_handler(int sig)\n"
5598 "{\n"
5599 "    got_SIGCHLD = 1;\n"
5600 "}\n"
5601
5602 #. type: Plain text
5603 #: build/C/man2/select_tut.2:274
5604 #, no-wrap
5605 msgid ""
5606 "int\n"
5607 "main(int argc, char *argv[])\n"
5608 "{\n"
5609 "    sigset_t sigmask, empty_mask;\n"
5610 "    struct sigaction sa;\n"
5611 "    fd_set readfds, writefds, exceptfds;\n"
5612 "    int r;\n"
5613 msgstr ""
5614 "int\n"
5615 "main(int argc, char *argv[])\n"
5616 "{\n"
5617 "    sigset_t sigmask, empty_mask;\n"
5618 "    struct sigaction sa;\n"
5619 "    fd_set readfds, writefds, exceptfds;\n"
5620 "    int r;\n"
5621
5622 #. type: Plain text
5623 #: build/C/man2/select_tut.2:281
5624 #, no-wrap
5625 msgid ""
5626 "    sigemptyset(&sigmask);\n"
5627 "    sigaddset(&sigmask, SIGCHLD);\n"
5628 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5629 "        perror(\"sigprocmask\");\n"
5630 "        exit(EXIT_FAILURE);\n"
5631 "    }\n"
5632 msgstr ""
5633 "    sigemptyset(&sigmask);\n"
5634 "    sigaddset(&sigmask, SIGCHLD);\n"
5635 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5636 "        perror(\"sigprocmask\");\n"
5637 "        exit(EXIT_FAILURE);\n"
5638 "    }\n"
5639
5640 #. type: Plain text
5641 #: build/C/man2/select_tut.2:289
5642 #, no-wrap
5643 msgid ""
5644 "    sa.sa_flags = 0;\n"
5645 "    sa.sa_handler = child_sig_handler;\n"
5646 "    sigemptyset(&sa.sa_mask);\n"
5647 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5648 "        perror(\"sigaction\");\n"
5649 "        exit(EXIT_FAILURE);\n"
5650 "    }\n"
5651 msgstr ""
5652 "    sa.sa_flags = 0;\n"
5653 "    sa.sa_handler = child_sig_handler;\n"
5654 "    sigemptyset(&sa.sa_mask);\n"
5655 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5656 "        perror(\"sigaction\");\n"
5657 "        exit(EXIT_FAILURE);\n"
5658 "    }\n"
5659
5660 #. type: Plain text
5661 #: build/C/man2/select_tut.2:291
5662 #, no-wrap
5663 msgid "    sigemptyset(&empty_mask);\n"
5664 msgstr "    sigemptyset(&empty_mask);\n"
5665
5666 #. type: Plain text
5667 #: build/C/man2/select_tut.2:295
5668 #, no-wrap
5669 msgid ""
5670 "    for (;;) {          /* main loop */\n"
5671 "        /* Initialize readfds, writefds, and exceptfds\n"
5672 "           before the pselect() call. (Code omitted.) */\n"
5673 msgstr ""
5674 "    for (;;) {          /* main loop */\n"
5675 "        /* Initialize readfds, writefds, and exceptfds\n"
5676 "           before the pselect() call. (Code omitted.) */\n"
5677
5678 #. type: Plain text
5679 #: build/C/man2/select_tut.2:301
5680 #, no-wrap
5681 msgid ""
5682 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5683 "                    NULL, &empty_mask);\n"
5684 "        if (r == -1 && errno != EINTR) {\n"
5685 "            /* Handle error */\n"
5686 "        }\n"
5687 msgstr ""
5688 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5689 "                    NULL, &empty_mask);\n"
5690 "        if (r == -1 && errno != EINTR) {\n"
5691 "            /* Handle error */\n"
5692 "        }\n"
5693
5694 #. type: Plain text
5695 #: build/C/man2/select_tut.2:304
5696 #, no-wrap
5697 msgid ""
5698 "        if (got_SIGCHLD) {\n"
5699 "            got_SIGCHLD = 0;\n"
5700 msgstr ""
5701 "        if (got_SIGCHLD) {\n"
5702 "            got_SIGCHLD = 0;\n"
5703
5704 #. type: Plain text
5705 #: build/C/man2/select_tut.2:308
5706 #, no-wrap
5707 msgid ""
5708 "            /* Handle signalled event here; e.g., wait() for all\n"
5709 "               terminated children. (Code omitted.) */\n"
5710 "        }\n"
5711 msgstr ""
5712 "            /* Handle signalled event here; e.g., wait() for all\n"
5713 "               terminated children. (Code omitted.) */\n"
5714 "        }\n"
5715
5716 #. type: Plain text
5717 #: build/C/man2/select_tut.2:312
5718 #, no-wrap
5719 msgid ""
5720 "        /* main body of program */\n"
5721 "    }\n"
5722 "}\n"
5723 msgstr ""
5724 "        /* main body of program */\n"
5725 "    }\n"
5726 "}\n"
5727
5728 #. type: SS
5729 #: build/C/man2/select_tut.2:313
5730 #, no-wrap
5731 msgid "Practical"
5732 msgstr "実例"
5733
5734 #. type: Plain text
5735 #: build/C/man2/select_tut.2:334
5736 msgid ""
5737 "So what is the point of B<select>()? Can't I just read and write to my "
5738 "descriptors whenever I want? The point of B<select>()  is that it watches "
5739 "multiple descriptors at the same time and properly puts the process to sleep "
5740 "if there is no activity.  UNIX programmers often find themselves in a "
5741 "position where they have to handle I/O from more than one file descriptor "
5742 "where the data flow may be intermittent.  If you were to merely create a "
5743 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5744 "your calls may block waiting for data from/to a file descriptor, while "
5745 "another file descriptor is unused though ready for I/O.  B<select>()  "
5746 "efficiently copes with this situation."
5747 msgstr ""
5748 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5749 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5750 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5751 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5752 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5753 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5754 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5755 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5756 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5757
5758 #. type: SS
5759 #: build/C/man2/select_tut.2:334
5760 #, no-wrap
5761 msgid "Select law"
5762 msgstr "SELECT の掟"
5763
5764 #. type: Plain text
5765 #: build/C/man2/select_tut.2:347
5766 msgid ""
5767 "Many people who try to use B<select>()  come across behavior that is "
5768 "difficult to understand and produces nonportable or borderline results.  For "
5769 "instance, the above program is carefully written not to block at any point, "
5770 "even though it does not set its file descriptors to nonblocking mode.  It is "
5771 "easy to introduce subtle errors that will remove the advantage of using "
5772 "B<select>(), so here is a list of essentials to watch for when using "
5773 "B<select>()."
5774 msgstr ""
5775 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5776 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5777 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5778 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5779 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5780 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5781 "ことにする。"
5782
5783 #. type: Plain text
5784 #: build/C/man2/select_tut.2:356
5785 msgid ""
5786 "You should always try to use B<select>()  without a timeout.  Your program "
5787 "should have nothing to do if there is no data available.  Code that depends "
5788 "on timeouts is not usually portable and is difficult to debug."
5789 msgstr ""
5790 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5791 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5792 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5793
5794 #. type: Plain text
5795 #: build/C/man2/select_tut.2:360
5796 msgid ""
5797 "The value I<nfds> must be properly calculated for efficiency as explained "
5798 "above."
5799 msgstr ""
5800 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5801 "えなければならない。"
5802
5803 #. type: Plain text
5804 #: build/C/man2/select_tut.2:367
5805 msgid ""
5806 "No file descriptor must be added to any set if you do not intend to check "
5807 "its result after the B<select>()  call, and respond appropriately.  See next "
5808 "rule."
5809 msgstr ""
5810 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5811 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5812
5813 #. type: Plain text
5814 #: build/C/man2/select_tut.2:373
5815 msgid ""
5816 "After B<select>()  returns, all file descriptors in all sets should be "
5817 "checked to see if they are ready."
5818 msgstr ""
5819 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5820 "て 読み書き可能な状態になっているかをチェックすべきである。"
5821
5822 #. type: TP
5823 #: build/C/man2/select_tut.2:373
5824 #, no-wrap
5825 msgid "5."
5826 msgstr "5."
5827
5828 #. type: Plain text
5829 #: build/C/man2/select_tut.2:388
5830 msgid ""
5831 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5832 "necessarily read/write the full amount of data that you have requested.  If "
5833 "they do read/write the full amount, it's because you have a low traffic load "
5834 "and a fast stream.  This is not always going to be the case.  You should "
5835 "cope with the case of your functions managing to send or receive only a "
5836 "single byte."
5837 msgstr ""
5838 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5839 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5840 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5841 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5842 "うな場合も 考慮に入れてやらなければならない。"
5843
5844 #. type: TP
5845 #: build/C/man2/select_tut.2:388
5846 #, no-wrap
5847 msgid "6."
5848 msgstr "6."
5849
5850 #. type: Plain text
5851 #: build/C/man2/select_tut.2:396
5852 msgid ""
5853 "Never read/write only in single bytes at a time unless you are really sure "
5854 "that you have a small amount of data to process.  It is extremely "
5855 "inefficient not to read/write as much data as you can buffer each time.  The "
5856 "buffers in the example below are 1024 bytes although they could easily be "
5857 "made larger."
5858 msgstr ""
5859 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5860 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5861 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5862 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5863
5864 #. type: TP
5865 #: build/C/man2/select_tut.2:396
5866 #, no-wrap
5867 msgid "7."
5868 msgstr "7."
5869
5870 #.  Nonetheless, you should still cope with these errors for completeness.
5871 #. type: Plain text
5872 #: build/C/man2/select_tut.2:418
5873 msgid ""
5874 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5875 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5876 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5877 "properly managed (not done properly above).  If your program is not going to "
5878 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5879 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5880 msgstr ""
5881 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5882 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5883 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5884 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5885 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5886 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5887
5888 #. type: TP
5889 #: build/C/man2/select_tut.2:418
5890 #, no-wrap
5891 msgid "8."
5892 msgstr "8."
5893
5894 #. type: Plain text
5895 #: build/C/man2/select_tut.2:427
5896 msgid ""
5897 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5898 "length of zero."
5899 msgstr ""
5900 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), "
5901 "B<write>(2), B<send>(2)  を呼び出してはならない。"
5902
5903 #. type: TP
5904 #: build/C/man2/select_tut.2:427
5905 #, no-wrap
5906 msgid "9."
5907 msgstr "9."
5908
5909 #. type: Plain text
5910 #: build/C/man2/select_tut.2:443
5911 msgid ""
5912 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5913 "with errors other than those listed in B<7.>, or one of the input functions "
5914 "returns 0, indicating end of file, then you should I<not> pass that "
5915 "descriptor to B<select>()  again.  In the example below, I close the "
5916 "descriptor immediately, and then set it to -1 to prevent it being included "
5917 "in a set."
5918 msgstr ""
5919 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5920 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5921 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5922 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5923 "が集合に含まれ続けるのを許さないようにしている。"
5924
5925 #. type: TP
5926 #: build/C/man2/select_tut.2:443
5927 #, no-wrap
5928 msgid "10."
5929 msgstr "10."
5930
5931 #. type: Plain text
5932 #: build/C/man2/select_tut.2:450
5933 msgid ""
5934 "The timeout value must be initialized with each new call to B<select>(), "
5935 "since some operating systems modify the structure.  B<pselect>()  however "
5936 "does not modify its timeout structure."
5937 msgstr ""
5938 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5939 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5940 "分の timeout 構造体を変更することはない。"
5941
5942 #. type: TP
5943 #: build/C/man2/select_tut.2:450
5944 #, no-wrap
5945 msgid "11."
5946 msgstr "11."
5947
5948 #.  "I have heard" does not fill me with confidence, and doesn't
5949 #.  belong in a man page, so I've commented this point out.
5950 #.  .TP
5951 #.  11.
5952 #.  I have heard that the Windows socket layer does not cope with OOB data
5953 #.  properly.
5954 #.  It also does not cope with
5955 #.  .BR select ()
5956 #.  calls when no file descriptors are set at all.
5957 #.  Having no file descriptors set is a useful
5958 #.  way to sleep the process with subsecond precision by using the timeout.
5959 #.  (See further on.)
5960 #. type: Plain text
5961 #: build/C/man2/select_tut.2:469
5962 msgid ""
5963 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5964 "used in a loop, then the sets must be reinitialized before each call."
5965 msgstr ""
5966 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5967 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5968 "期化し直さなければならない。"
5969
5970 #. type: SS
5971 #: build/C/man2/select_tut.2:469
5972 #, no-wrap
5973 msgid "Usleep emulation"
5974 msgstr "usleep エミュレーション"
5975
5976 #. type: Plain text
5977 #: build/C/man2/select_tut.2:476
5978 msgid ""
5979 "On systems that do not have a B<usleep>(3)  function, you can call "
5980 "B<select>()  with a finite timeout and no file descriptors as follows:"
5981 msgstr ""
5982 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5983 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5984 "できる。 以下のようにする。"
5985
5986 #. type: Plain text
5987 #: build/C/man2/select_tut.2:482
5988 #, no-wrap
5989 msgid ""
5990 "    struct timeval tv;\n"
5991 "    tv.tv_sec = 0;\n"
5992 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5993 "    select(0, NULL, NULL, NULL, &tv);\n"
5994 msgstr ""
5995 "    struct timeval tv;\n"
5996 "    tv.tv_sec = 0;\n"
5997 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5998 "    select(0, NULL, NULL, NULL, &tv);\n"
5999
6000 #. type: Plain text
6001 #: build/C/man2/select_tut.2:485
6002 msgid "This is guaranteed to work only on UNIX systems, however."
6003 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6004
6005 #. type: Plain text
6006 #: build/C/man2/select_tut.2:490
6007 msgid ""
6008 "On success, B<select>()  returns the total number of file descriptors still "
6009 "present in the file descriptor sets."
6010 msgstr ""
6011 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
6012 "ディスクリプタの総数を返す。"
6013
6014 #. type: Plain text
6015 #: build/C/man2/select_tut.2:496
6016 msgid ""
6017 "If B<select>()  timed out, then the return value will be zero.  The file "
6018 "descriptors set should be all empty (but may not be on some systems)."
6019 msgstr ""
6020 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6021 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
6022
6023 #. type: Plain text
6024 #: build/C/man2/select_tut.2:503
6025 msgid ""
6026 "A return value of -1 indicates an error, with I<errno> being set "
6027 "appropriately.  In the case of an error, the contents of the returned sets "
6028 "and the I<struct timeout> contents are undefined and should not be used.  "
6029 "B<pselect>()  however never modifies I<ntimeout>."
6030 msgstr ""
6031 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6032 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6033 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
6034 "変更しない。"
6035
6036 #. type: Plain text
6037 #: build/C/man2/select_tut.2:512
6038 msgid ""
6039 "Generally speaking, all operating systems that support sockets also support "
6040 "B<select>().  B<select>()  can be used to solve many problems in a portable "
6041 "and efficient way that naive programmers try to solve in a more complicated "
6042 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6043 msgstr ""
6044 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6045 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6046 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6047 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6048
6049 #. type: Plain text
6050 #: build/C/man2/select_tut.2:521
6051 msgid ""
6052 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6053 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6054 "is nowadays widely available, but historically was less portable than "
6055 "B<select>()."
6056 msgstr ""
6057 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6058 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6059 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6060
6061 #. type: Plain text
6062 #: build/C/man2/select_tut.2:529
6063 msgid ""
6064 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6065 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6066 "of file descriptors."
6067 msgstr ""
6068 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
6069 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
6070
6071 #. type: Plain text
6072 #: build/C/man2/select_tut.2:534
6073 msgid ""
6074 "Here is an example that better demonstrates the true utility of "
6075 "B<select>().  The listing below is a TCP forwarding program that forwards "
6076 "from one TCP port to another."
6077 msgstr ""
6078 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6079 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6080
6081 #. type: Plain text
6082 #: build/C/man2/select_tut.2:547
6083 #, no-wrap
6084 msgid ""
6085 "#include E<lt>stdlib.hE<gt>\n"
6086 "#include E<lt>stdio.hE<gt>\n"
6087 "#include E<lt>unistd.hE<gt>\n"
6088 "#include E<lt>sys/time.hE<gt>\n"
6089 "#include E<lt>sys/types.hE<gt>\n"
6090 "#include E<lt>string.hE<gt>\n"
6091 "#include E<lt>signal.hE<gt>\n"
6092 "#include E<lt>sys/socket.hE<gt>\n"
6093 "#include E<lt>netinet/in.hE<gt>\n"
6094 "#include E<lt>arpa/inet.hE<gt>\n"
6095 "#include E<lt>errno.hE<gt>\n"
6096 msgstr ""
6097 "#include E<lt>stdlib.hE<gt>\n"
6098 "#include E<lt>stdio.hE<gt>\n"
6099 "#include E<lt>unistd.hE<gt>\n"
6100 "#include E<lt>sys/time.hE<gt>\n"
6101 "#include E<lt>sys/types.hE<gt>\n"
6102 "#include E<lt>string.hE<gt>\n"
6103 "#include E<lt>signal.hE<gt>\n"
6104 "#include E<lt>sys/socket.hE<gt>\n"
6105 "#include E<lt>netinet/in.hE<gt>\n"
6106 "#include E<lt>arpa/inet.hE<gt>\n"
6107 "#include E<lt>errno.hE<gt>\n"
6108
6109 #. type: Plain text
6110 #: build/C/man2/select_tut.2:549
6111 #, no-wrap
6112 msgid "static int forward_port;\n"
6113 msgstr "static int forward_port;\n"
6114
6115 #. type: Plain text
6116 #: build/C/man2/select_tut.2:552
6117 #, no-wrap
6118 msgid ""
6119 "#undef max\n"
6120 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6121 msgstr ""
6122 "#undef max\n"
6123 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6124
6125 #. type: Plain text
6126 #: build/C/man2/select_tut.2:559
6127 #, no-wrap
6128 msgid ""
6129 "static int\n"
6130 "listen_socket(int listen_port)\n"
6131 "{\n"
6132 "    struct sockaddr_in a;\n"
6133 "    int s;\n"
6134 "    int yes;\n"
6135 msgstr ""
6136 "static int\n"
6137 "listen_socket(int listen_port)\n"
6138 "{\n"
6139 "    struct sockaddr_in a;\n"
6140 "    int s;\n"
6141 "    int yes;\n"
6142
6143 #. type: Plain text
6144 #: build/C/man2/select_tut.2:584
6145 #, no-wrap
6146 msgid ""
6147 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6148 "    if (s == -1) {\n"
6149 "        perror(\"socket\");\n"
6150 "        return -1;\n"
6151 "    }\n"
6152 "    yes = 1;\n"
6153 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6154 "            &yes, sizeof(yes)) == -1) {\n"
6155 "        perror(\"setsockopt\");\n"
6156 "        close(s);\n"
6157 "        return -1;\n"
6158 "    }\n"
6159 "    memset(&a, 0, sizeof(a));\n"
6160 "    a.sin_port = htons(listen_port);\n"
6161 "    a.sin_family = AF_INET;\n"
6162 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6163 "        perror(\"bind\");\n"
6164 "        close(s);\n"
6165 "        return -1;\n"
6166 "    }\n"
6167 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6168 "    listen(s, 10);\n"
6169 "    return s;\n"
6170 "}\n"
6171 msgstr ""
6172 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6173 "        perror(\"socket\");\n"
6174 "        return -1;\n"
6175 "    }\n"
6176 "    yes = 1;\n"
6177 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6178 "            &yes, sizeof(yes)) == -1) {\n"
6179 "        perror(\"setsockopt\");\n"
6180 "        close(s);\n"
6181 "        return -1;\n"
6182 "    }\n"
6183 "    memset(&a, 0, sizeof(a));\n"
6184 "    a.sin_port = htons(listen_port);\n"
6185 "    a.sin_family = AF_INET;\n"
6186 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6187 "        perror(\"bind\");\n"
6188 "        close(s);\n"
6189 "        return -1;\n"
6190 "    }\n"
6191 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6192 "    listen(s, 10);\n"
6193 "    return s;\n"
6194 "}\n"
6195
6196 #. type: Plain text
6197 #: build/C/man2/select_tut.2:590
6198 #, no-wrap
6199 msgid ""
6200 "static int\n"
6201 "connect_socket(int connect_port, char *address)\n"
6202 "{\n"
6203 "    struct sockaddr_in a;\n"
6204 "    int s;\n"
6205 msgstr ""
6206 "static int\n"
6207 "connect_socket(int connect_port, char *address)\n"
6208 "{\n"
6209 "    struct sockaddr_in a;\n"
6210 "    int s;\n"
6211
6212 #. type: Plain text
6213 #: build/C/man2/select_tut.2:597
6214 #, no-wrap
6215 msgid ""
6216 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6217 "    if (s == -1) {\n"
6218 "        perror(\"socket\");\n"
6219 "        close(s);\n"
6220 "        return -1;\n"
6221 "    }\n"
6222 msgstr ""
6223 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6224 "    if (s == -1) {\n"
6225 "        perror(\"socket\");\n"
6226 "        close(s);\n"
6227 "        return -1;\n"
6228 "    }\n"
6229
6230 #. type: Plain text
6231 #: build/C/man2/select_tut.2:601
6232 #, no-wrap
6233 msgid ""
6234 "    memset(&a, 0, sizeof(a));\n"
6235 "    a.sin_port = htons(connect_port);\n"
6236 "    a.sin_family = AF_INET;\n"
6237 msgstr ""
6238 "    memset(&a, 0, sizeof(a));\n"
6239 "    a.sin_port = htons(connect_port);\n"
6240 "    a.sin_family = AF_INET;\n"
6241
6242 #. type: Plain text
6243 #: build/C/man2/select_tut.2:607
6244 #, no-wrap
6245 msgid ""
6246 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6247 "        perror(\"bad IP address format\");\n"
6248 "        close(s);\n"
6249 "        return -1;\n"
6250 "    }\n"
6251 msgstr ""
6252 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6253 "        perror(\"bad IP address format\");\n"
6254 "        close(s);\n"
6255 "        return -1;\n"
6256 "    }\n"
6257
6258 #. type: Plain text
6259 #: build/C/man2/select_tut.2:616
6260 #, no-wrap
6261 msgid ""
6262 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6263 "        perror(\"connect()\");\n"
6264 "        shutdown(s, SHUT_RDWR);\n"
6265 "        close(s);\n"
6266 "        return -1;\n"
6267 "    }\n"
6268 "    return s;\n"
6269 "}\n"
6270 msgstr ""
6271 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6272 "        perror(\"connect()\");\n"
6273 "        shutdown(s, SHUT_RDWR);\n"
6274 "        close(s);\n"
6275 "        return -1;\n"
6276 "    }\n"
6277 "    return s;\n"
6278 "}\n"
6279
6280 #. type: Plain text
6281 #: build/C/man2/select_tut.2:624
6282 #, no-wrap
6283 msgid ""
6284 "#define SHUT_FD1 do {                                \\e\n"
6285 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6286 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6287 "                         close(fd1);                 \\e\n"
6288 "                         fd1 = -1;                   \\e\n"
6289 "                     }                               \\e\n"
6290 "                 } while (0)\n"
6291 msgstr ""
6292 "#define SHUT_FD1 do {                                \\e\n"
6293 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6294 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6295 "                         close(fd1);                 \\e\n"
6296 "                         fd1 = -1;                   \\e\n"
6297 "                     }                               \\e\n"
6298 "                 } while (0)\n"
6299
6300 #. type: Plain text
6301 #: build/C/man2/select_tut.2:632
6302 #, no-wrap
6303 msgid ""
6304 "#define SHUT_FD2 do {                                \\e\n"
6305 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6306 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6307 "                         close(fd2);                 \\e\n"
6308 "                         fd2 = -1;                   \\e\n"
6309 "                     }                               \\e\n"
6310 "                 } while (0)\n"
6311 msgstr ""
6312 "#define SHUT_FD2 do {                                \\e\n"
6313 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6314 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6315 "                         close(fd2);                 \\e\n"
6316 "                         fd2 = -1;                   \\e\n"
6317 "                     }                               \\e\n"
6318 "                 } while (0)\n"
6319
6320 #. type: Plain text
6321 #: build/C/man2/select_tut.2:634
6322 #, no-wrap
6323 msgid "#define BUF_SIZE 1024\n"
6324 msgstr "#define BUF_SIZE 1024\n"
6325
6326 #. type: Plain text
6327 #: build/C/man2/select_tut.2:643
6328 #, no-wrap
6329 msgid ""
6330 "int\n"
6331 "main(int argc, char *argv[])\n"
6332 "{\n"
6333 "    int h;\n"
6334 "    int fd1 = -1, fd2 = -1;\n"
6335 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6336 "    int buf1_avail, buf1_written;\n"
6337 "    int buf2_avail, buf2_written;\n"
6338 msgstr ""
6339 "int\n"
6340 "main(int argc, char *argv[])\n"
6341 "{\n"
6342 "    int h;\n"
6343 "    int fd1 = -1, fd2 = -1;\n"
6344 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6345 "    int buf1_avail, buf1_written;\n"
6346 "    int buf2_avail, buf2_written;\n"
6347
6348 #. type: Plain text
6349 #: build/C/man2/select_tut.2:649
6350 #, no-wrap
6351 msgid ""
6352 "    if (argc != 4) {\n"
6353 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6354 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6355 "        exit(EXIT_FAILURE);\n"
6356 "    }\n"
6357 msgstr ""
6358 "    if (argc != 4) {\n"
6359 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6360 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6361 "        exit(EXIT_FAILURE);\n"
6362 "    }\n"
6363
6364 #. type: Plain text
6365 #: build/C/man2/select_tut.2:651
6366 #, no-wrap
6367 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6368 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6369
6370 #. type: Plain text
6371 #: build/C/man2/select_tut.2:653
6372 #, no-wrap
6373 msgid "    forward_port = atoi(argv[2]);\n"
6374 msgstr "    forward_port = atoi(argv[2]);\n"
6375
6376 #. type: Plain text
6377 #: build/C/man2/select_tut.2:657
6378 #, no-wrap
6379 msgid ""
6380 "    h = listen_socket(atoi(argv[1]));\n"
6381 "    if (h == -1)\n"
6382 "        exit(EXIT_FAILURE);\n"
6383 msgstr ""
6384 "    h = listen_socket(atoi(argv[1]));\n"
6385 "    if (h == -1)\n"
6386 "        exit(EXIT_FAILURE);\n"
6387
6388 #. type: Plain text
6389 #: build/C/man2/select_tut.2:661
6390 #, no-wrap
6391 msgid ""
6392 "    for (;;) {\n"
6393 "        int r, nfds = 0;\n"
6394 "        fd_set rd, wr, er;\n"
6395 msgstr ""
6396 "    for (;;) {\n"
6397 "        int r, nfds = 0;\n"
6398 "        fd_set rd, wr, er;\n"
6399
6400 #. type: Plain text
6401 #: build/C/man2/select_tut.2:691
6402 #, no-wrap
6403 msgid ""
6404 "        FD_ZERO(&rd);\n"
6405 "        FD_ZERO(&wr);\n"
6406 "        FD_ZERO(&er);\n"
6407 "        FD_SET(h, &rd);\n"
6408 "        nfds = max(nfds, h);\n"
6409 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6410 "            FD_SET(fd1, &rd);\n"
6411 "            nfds = max(nfds, fd1);\n"
6412 "        }\n"
6413 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6414 "            FD_SET(fd2, &rd);\n"
6415 "            nfds = max(nfds, fd2);\n"
6416 "        }\n"
6417 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6418 "            FD_SET(fd1, &wr);\n"
6419 "            nfds = max(nfds, fd1);\n"
6420 "        }\n"
6421 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6422 "            FD_SET(fd2, &wr);\n"
6423 "            nfds = max(nfds, fd2);\n"
6424 "        }\n"
6425 "        if (fd1 E<gt> 0) {\n"
6426 "            FD_SET(fd1, &er);\n"
6427 "            nfds = max(nfds, fd1);\n"
6428 "        }\n"
6429 "        if (fd2 E<gt> 0) {\n"
6430 "            FD_SET(fd2, &er);\n"
6431 "            nfds = max(nfds, fd2);\n"
6432 "        }\n"
6433 msgstr ""
6434 "        FD_ZERO(&rd);\n"
6435 "        FD_ZERO(&wr);\n"
6436 "        FD_ZERO(&er);\n"
6437 "        FD_SET(h, &rd);\n"
6438 "        nfds = max(nfds, h);\n"
6439 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6440 "            FD_SET(fd1, &rd);\n"
6441 "            nfds = max(nfds, fd1);\n"
6442 "        }\n"
6443 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6444 "            FD_SET(fd2, &rd);\n"
6445 "            nfds = max(nfds, fd2);\n"
6446 "        }\n"
6447 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6448 "            FD_SET(fd1, &wr);\n"
6449 "            nfds = max(nfds, fd1);\n"
6450 "        }\n"
6451 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6452 "            FD_SET(fd2, &wr);\n"
6453 "            nfds = max(nfds, fd2);\n"
6454 "        }\n"
6455 "        if (fd1 E<gt> 0) {\n"
6456 "            FD_SET(fd1, &er);\n"
6457 "            nfds = max(nfds, fd1);\n"
6458 "        }\n"
6459 "        if (fd2 E<gt> 0) {\n"
6460 "            FD_SET(fd2, &er);\n"
6461 "            nfds = max(nfds, fd2);\n"
6462 "        }\n"
6463
6464 #. type: Plain text
6465 #: build/C/man2/select_tut.2:693
6466 #, no-wrap
6467 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6468 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6469
6470 #. type: Plain text
6471 #: build/C/man2/select_tut.2:696
6472 #, no-wrap
6473 msgid ""
6474 "        if (r == -1 && errno == EINTR)\n"
6475 "            continue;\n"
6476 msgstr ""
6477 "        if (r == -1 && errno == EINTR)\n"
6478 "            continue;\n"
6479
6480 #. type: Plain text
6481 #: build/C/man2/select_tut.2:701
6482 #, no-wrap
6483 msgid ""
6484 "        if (r == -1) {\n"
6485 "            perror(\"select()\");\n"
6486 "            exit(EXIT_FAILURE);\n"
6487 "        }\n"
6488 msgstr ""
6489 "        if (r == -1) {\n"
6490 "            perror(\"select()\");\n"
6491 "            exit(EXIT_FAILURE);\n"
6492 "        }\n"
6493
6494 #. type: Plain text
6495 #: build/C/man2/select_tut.2:705
6496 #, no-wrap
6497 msgid ""
6498 "        if (FD_ISSET(h, &rd)) {\n"
6499 "            unsigned int l;\n"
6500 "            struct sockaddr_in client_address;\n"
6501 msgstr ""
6502 "        if (FD_ISSET(h, &rd)) {\n"
6503 "            unsigned int l;\n"
6504 "            struct sockaddr_in client_address;\n"
6505
6506 #. type: Plain text
6507 #: build/C/man2/select_tut.2:724
6508 #, no-wrap
6509 msgid ""
6510 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6511 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6512 "            if (r == -1) {\n"
6513 "                perror(\"accept()\");\n"
6514 "            } else {\n"
6515 "                SHUT_FD1;\n"
6516 "                SHUT_FD2;\n"
6517 "                buf1_avail = buf1_written = 0;\n"
6518 "                buf2_avail = buf2_written = 0;\n"
6519 "                fd1 = r;\n"
6520 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6521 "                if (fd2 == -1)\n"
6522 "                    SHUT_FD1;\n"
6523 "                else\n"
6524 "                    printf(\"connect from %s\\en\",\n"
6525 "                            inet_ntoa(client_address.sin_addr));\n"
6526 "            }\n"
6527 "        }\n"
6528 msgstr ""
6529 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6530 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6531 "            if (r == -1) {\n"
6532 "                perror(\"accept()\");\n"
6533 "            } else {\n"
6534 "                SHUT_FD1;\n"
6535 "                SHUT_FD2;\n"
6536 "                buf1_avail = buf1_written = 0;\n"
6537 "                buf2_avail = buf2_written = 0;\n"
6538 "                fd1 = r;\n"
6539 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6540 "                if (fd2 == -1)\n"
6541 "                    SHUT_FD1;\n"
6542 "                else\n"
6543 "                    printf(\"connect from %s\\en\",\n"
6544 "                            inet_ntoa(client_address.sin_addr));\n"
6545 "            }\n"
6546 "        }\n"
6547
6548 #. type: Plain text
6549 #: build/C/man2/select_tut.2:726
6550 #, no-wrap
6551 msgid "        /* NB: read oob data before normal reads */\n"
6552 msgstr "        /* NB: read oob data before normal reads */\n"
6553
6554 #. type: Plain text
6555 #: build/C/man2/select_tut.2:730
6556 #, no-wrap
6557 msgid ""
6558 "        if (fd1 E<gt> 0)\n"
6559 "            if (FD_ISSET(fd1, &er)) {\n"
6560 "                char c;\n"
6561 msgstr ""
6562 "        if (fd1 E<gt> 0)\n"
6563 "            if (FD_ISSET(fd1, &er)) {\n"
6564 "                char c;\n"
6565
6566 #. type: Plain text
6567 #: build/C/man2/select_tut.2:740
6568 #, no-wrap
6569 msgid ""
6570 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6571 "                if (r E<lt> 1)\n"
6572 "                    SHUT_FD1;\n"
6573 "                else\n"
6574 "                    send(fd2, &c, 1, MSG_OOB);\n"
6575 "            }\n"
6576 "        if (fd2 E<gt> 0)\n"
6577 "            if (FD_ISSET(fd2, &er)) {\n"
6578 "                char c;\n"
6579 msgstr ""
6580 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6581 "                if (r E<lt> 1)\n"
6582 "                    SHUT_FD1;\n"
6583 "                else\n"
6584 "                    send(fd2, &c, 1, MSG_OOB);\n"
6585 "            }\n"
6586 "        if (fd2 E<gt> 0)\n"
6587 "            if (FD_ISSET(fd2, &er)) {\n"
6588 "                char c;\n"
6589
6590 #. type: Plain text
6591 #: build/C/man2/select_tut.2:783
6592 #, no-wrap
6593 msgid ""
6594 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6595 "                if (r E<lt> 1)\n"
6596 "                    SHUT_FD2;\n"
6597 "                else\n"
6598 "                    send(fd1, &c, 1, MSG_OOB);\n"
6599 "            }\n"
6600 "        if (fd1 E<gt> 0)\n"
6601 "            if (FD_ISSET(fd1, &rd)) {\n"
6602 "                r = read(fd1, buf1 + buf1_avail,\n"
6603 "                          BUF_SIZE - buf1_avail);\n"
6604 "                if (r E<lt> 1)\n"
6605 "                    SHUT_FD1;\n"
6606 "                else\n"
6607 "                    buf1_avail += r;\n"
6608 "            }\n"
6609 "        if (fd2 E<gt> 0)\n"
6610 "            if (FD_ISSET(fd2, &rd)) {\n"
6611 "                r = read(fd2, buf2 + buf2_avail,\n"
6612 "                          BUF_SIZE - buf2_avail);\n"
6613 "                if (r E<lt> 1)\n"
6614 "                    SHUT_FD2;\n"
6615 "                else\n"
6616 "                    buf2_avail += r;\n"
6617 "            }\n"
6618 "        if (fd1 E<gt> 0)\n"
6619 "            if (FD_ISSET(fd1, &wr)) {\n"
6620 "                r = write(fd1, buf2 + buf2_written,\n"
6621 "                           buf2_avail - buf2_written);\n"
6622 "                if (r E<lt> 1)\n"
6623 "                    SHUT_FD1;\n"
6624 "                else\n"
6625 "                    buf2_written += r;\n"
6626 "            }\n"
6627 "        if (fd2 E<gt> 0)\n"
6628 "            if (FD_ISSET(fd2, &wr)) {\n"
6629 "                r = write(fd2, buf1 + buf1_written,\n"
6630 "                           buf1_avail - buf1_written);\n"
6631 "                if (r E<lt> 1)\n"
6632 "                    SHUT_FD2;\n"
6633 "                else\n"
6634 "                    buf1_written += r;\n"
6635 "            }\n"
6636 msgstr ""
6637 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6638 "                if (r E<lt> 1)\n"
6639 "                    SHUT_FD2;\n"
6640 "                else\n"
6641 "                    send(fd1, &c, 1, MSG_OOB);\n"
6642 "            }\n"
6643 "        if (fd1 E<gt> 0)\n"
6644 "            if (FD_ISSET(fd1, &rd)) {\n"
6645 "                r = read(fd1, buf1 + buf1_avail,\n"
6646 "                          BUF_SIZE - buf1_avail);\n"
6647 "                if (r E<lt> 1)\n"
6648 "                    SHUT_FD1;\n"
6649 "                else\n"
6650 "                    buf1_avail += r;\n"
6651 "            }\n"
6652 "        if (fd2 E<gt> 0)\n"
6653 "            if (FD_ISSET(fd2, &rd)) {\n"
6654 "                r = read(fd2, buf2 + buf2_avail,\n"
6655 "                          BUF_SIZE - buf2_avail);\n"
6656 "                if (r E<lt> 1)\n"
6657 "                    SHUT_FD2;\n"
6658 "                else\n"
6659 "                    buf2_avail += r;\n"
6660 "            }\n"
6661 "        if (fd1 E<gt> 0)\n"
6662 "            if (FD_ISSET(fd1, &wr)) {\n"
6663 "                r = write(fd1, buf2 + buf2_written,\n"
6664 "                           buf2_avail - buf2_written);\n"
6665 "                if (r E<lt> 1)\n"
6666 "                    SHUT_FD1;\n"
6667 "                else\n"
6668 "                    buf2_written += r;\n"
6669 "            }\n"
6670 "        if (fd2 E<gt> 0)\n"
6671 "            if (FD_ISSET(fd2, &wr)) {\n"
6672 "                r = write(fd2, buf1 + buf1_written,\n"
6673 "                           buf1_avail - buf1_written);\n"
6674 "                if (r E<lt> 1)\n"
6675 "                    SHUT_FD2;\n"
6676 "                else\n"
6677 "                    buf1_written += r;\n"
6678 "            }\n"
6679
6680 #. type: Plain text
6681 #: build/C/man2/select_tut.2:785
6682 #, no-wrap
6683 msgid "        /* check if write data has caught read data */\n"
6684 msgstr "        /* check if write data has caught read data */\n"
6685
6686 #. type: Plain text
6687 #: build/C/man2/select_tut.2:790
6688 #, no-wrap
6689 msgid ""
6690 "        if (buf1_written == buf1_avail)\n"
6691 "            buf1_written = buf1_avail = 0;\n"
6692 "        if (buf2_written == buf2_avail)\n"
6693 "            buf2_written = buf2_avail = 0;\n"
6694 msgstr ""
6695 "        if (buf1_written == buf1_avail)\n"
6696 "            buf1_written = buf1_avail = 0;\n"
6697 "        if (buf2_written == buf2_avail)\n"
6698 "            buf2_written = buf2_avail = 0;\n"
6699
6700 #. type: Plain text
6701 #: build/C/man2/select_tut.2:793
6702 #, no-wrap
6703 msgid ""
6704 "        /* one side has closed the connection, keep\n"
6705 "           writing to the other side until empty */\n"
6706 msgstr ""
6707 "        /* one side has closed the connection, keep\n"
6708 "           writing to the other side until empty */\n"
6709
6710 #. type: Plain text
6711 #: build/C/man2/select_tut.2:801
6712 #, no-wrap
6713 msgid ""
6714 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6715 "            SHUT_FD2;\n"
6716 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6717 "            SHUT_FD1;\n"
6718 "    }\n"
6719 "    exit(EXIT_SUCCESS);\n"
6720 "}\n"
6721 msgstr ""
6722 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6723 "            SHUT_FD2;\n"
6724 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6725 "            SHUT_FD1;\n"
6726 "    }\n"
6727 "    exit(EXIT_SUCCESS);\n"
6728 "}\n"
6729
6730 #. type: Plain text
6731 #: build/C/man2/select_tut.2:815
6732 msgid ""
6733 "The above program properly forwards most kinds of TCP connections including "
6734 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6735 "problem of having data flow in both directions simultaneously.  You might "
6736 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6737 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6738 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6739 "because you end up using inefficient timeouts."
6740 msgstr ""
6741 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6742 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6743 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 "
6744 "B<fork>(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効"
6745 "率的だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこ"
6746 "しい。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、と"
6747 "いうアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的"
6748 "に起こってしまう。"
6749
6750 #. type: Plain text
6751 #: build/C/man2/select_tut.2:821
6752 msgid ""
6753 "The program does not handle more than one simultaneous connection at a time, "
6754 "although it could easily be extended to do this with a linked list of buffers"
6755 "\\(emone for each connection.  At the moment, new connections cause the "
6756 "current connection to be dropped."
6757 msgstr ""
6758 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6759 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6760 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6761
6762 #.  .SH AUTHORS
6763 #.  This man page was written by Paul Sheer.
6764 #. type: Plain text
6765 #: build/C/man2/select_tut.2:840
6766 msgid ""
6767 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6768 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6769 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6770 "B<sigismember>(3), B<epoll>(7)"
6771 msgstr ""
6772 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6773 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6774 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6775 "B<sigismember>(3), B<epoll>(7)"
6776
6777 #. type: TH
6778 #: build/C/man2/send.2:40
6779 #, no-wrap
6780 msgid "SEND"
6781 msgstr "SEND"
6782
6783 #. type: Plain text
6784 #: build/C/man2/send.2:43
6785 msgid "send, sendto, sendmsg - send a message on a socket"
6786 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6787
6788 #. type: Plain text
6789 #: build/C/man2/send.2:47
6790 #, no-wrap
6791 msgid ""
6792 "B<#include E<lt>sys/types.hE<gt>>\n"
6793 "B<#include E<lt>sys/socket.hE<gt>>\n"
6794 msgstr ""
6795 "B<#include E<lt>sys/types.hE<gt>>\n"
6796 "B<#include E<lt>sys/socket.hE<gt>>\n"
6797
6798 #. type: Plain text
6799 #: build/C/man2/send.2:50
6800 #, no-wrap
6801 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6802 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6803
6804 #. type: Plain text
6805 #: build/C/man2/send.2:54
6806 #, no-wrap
6807 msgid ""
6808 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6809 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6810 msgstr ""
6811 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6812 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6813
6814 #. type: Plain text
6815 #: build/C/man2/send.2:57
6816 #, no-wrap
6817 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6818 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6819
6820 #. type: Plain text
6821 #: build/C/man2/send.2:65
6822 msgid ""
6823 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6824 "transmit a message to another socket."
6825 msgstr ""
6826 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6827 "メッセージを転送するのに使用される。"
6828
6829 #. type: Plain text
6830 #: build/C/man2/send.2:84
6831 msgid ""
6832 "The B<send>()  call may be used only when the socket is in a I<connected> "
6833 "state (so that the intended recipient is known).  The only difference "
6834 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6835 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6836 "following call"
6837 msgstr ""
6838 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6839 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と "
6840 "B<write>(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 "
6841 "I<flags> にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価であ"
6842 "る。 また、"
6843
6844 #. type: Plain text
6845 #: build/C/man2/send.2:86
6846 #, no-wrap
6847 msgid "    send(sockfd, buf, len, flags);\n"
6848 msgstr "    send(sockfd, buf, len, flags);\n"
6849
6850 #. type: Plain text
6851 #: build/C/man2/send.2:88
6852 msgid "is equivalent to"
6853 msgstr "は以下と等価である。"
6854
6855 #. type: Plain text
6856 #: build/C/man2/send.2:90
6857 #, no-wrap
6858 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6859 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6860
6861 #. type: Plain text
6862 #: build/C/man2/send.2:94
6863 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6864 msgstr ""
6865 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6866 "る。"
6867
6868 #. type: Plain text
6869 #: build/C/man2/send.2:122
6870 msgid ""
6871 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6872 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6873 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6874 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6875 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6876 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6877 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6878 "size."
6879 msgstr ""
6880 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6881 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6882 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6883 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6884 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6885 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 "
6886 "B<sendmsg>()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズ"
6887 "は I<msg.msg_namelen> で指定される。"
6888
6889 #. type: Plain text
6890 #: build/C/man2/send.2:138
6891 msgid ""
6892 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6893 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6894 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6895 "ancillary data (also known as control information)."
6896 msgstr ""
6897 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6898 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6899 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6900 "(制御情報とも呼ばれる) を送信することもできる。"
6901
6902 #. type: Plain text
6903 #: build/C/man2/send.2:143
6904 msgid ""
6905 "If the message is too long to pass atomically through the underlying "
6906 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6907 "transmitted."
6908 msgstr ""
6909 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6910 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6911 "ラーが返され、そのメッセージは転送されない。"
6912
6913 #. type: Plain text
6914 #: build/C/man2/send.2:147
6915 msgid ""
6916 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6917 "detected errors are indicated by a return value of -1."
6918 msgstr ""
6919 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6920 "出された場合は、返り値 -1 として通知される。"
6921
6922 #. type: Plain text
6923 #: build/C/man2/send.2:160
6924 msgid ""
6925 "When the message does not fit into the send buffer of the socket, B<send>()  "
6926 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6927 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6928 "in this case.  The B<select>(2)  call may be used to determine when it is "
6929 "possible to send more data."
6930 msgstr ""
6931 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6932 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6933 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6934 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6935 "用することができる。"
6936
6937 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6938 #. type: Plain text
6939 #: build/C/man2/send.2:166
6940 msgid ""
6941 "The I<flags> argument is the bitwise OR of zero or more of the following "
6942 "flags."
6943 msgstr ""
6944 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6945 "のを指定する。"
6946
6947 #. type: TP
6948 #: build/C/man2/send.2:166
6949 #, no-wrap
6950 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
6951 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6952
6953 #. type: Plain text
6954 #: build/C/man2/send.2:180
6955 msgid ""
6956 "Tell the link layer that forward progress happened: you got a successful "
6957 "reply from the other side.  If the link layer doesn't get this it will "
6958 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6959 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
6960 "IPv4 and IPv6.  See B<arp>(7)  for details."
6961 msgstr ""
6962 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6963 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6964 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6965 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6966 "されている。 詳しくは B<arp>(7)  参照のこと。"
6967
6968 #. type: TP
6969 #: build/C/man2/send.2:180
6970 #, no-wrap
6971 msgid "B<MSG_DONTROUTE>"
6972 msgstr "B<MSG_DONTROUTE>"
6973
6974 #. type: Plain text
6975 #: build/C/man2/send.2:188
6976 msgid ""
6977 "Don't use a gateway to send out the packet, send to hosts only on directly "
6978 "connected networks.  This is usually used only by diagnostic or routing "
6979 "programs.  This is defined only for protocol families that route; packet "
6980 "sockets don't."
6981 msgstr ""
6982 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6983 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6984 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6985 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6986
6987 #. type: Plain text
6988 #: build/C/man2/send.2:199
6989 msgid ""
6990 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6991 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6992 "flag with the B<F_SETFL> B<fcntl>(2))."
6993 msgstr ""
6994 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6995 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6996 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6997
6998 #. type: TP
6999 #: build/C/man2/send.2:199
7000 #, no-wrap
7001 msgid "B<MSG_EOR> (since Linux 2.2)"
7002 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7003
7004 #. type: Plain text
7005 #: build/C/man2/send.2:203
7006 msgid ""
7007 "Terminates a record (when this notion is supported, as for sockets of type "
7008 "B<SOCK_SEQPACKET>)."
7009 msgstr ""
7010 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7011 "ケット種別のときに有効)。"
7012
7013 #. type: TP
7014 #: build/C/man2/send.2:203
7015 #, no-wrap
7016 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7017 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7018
7019 #. type: Plain text
7020 #: build/C/man2/send.2:212
7021 msgid ""
7022 "The caller has more data to send.  This flag is used with TCP sockets to "
7023 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7024 "with the difference that this flag can be set on a per-call basis."
7025 msgstr ""
7026 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7027 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる "
7028 "(B<tcp>(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位"
7029 "で この機能を有効にできる点である。"
7030
7031 #. type: Plain text
7032 #: build/C/man2/send.2:221
7033 msgid ""
7034 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7035 "the kernel to package all of the data sent in calls with this flag set into "
7036 "a single datagram which is transmitted only when a call is performed that "
7037 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
7038 "described in B<udp>(7).)"
7039 msgstr ""
7040 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7041 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7042 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7043 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7044 "ソケットオプション B<UDP_CORK> も参照)。"
7045
7046 #. type: TP
7047 #: build/C/man2/send.2:221
7048 #, no-wrap
7049 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7050 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7051
7052 #. type: Plain text
7053 #: build/C/man2/send.2:230
7054 msgid ""
7055 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7056 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7057 msgstr ""
7058 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7059 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7060
7061 #. type: Plain text
7062 #: build/C/man2/send.2:239
7063 msgid ""
7064 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7065 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7066 "data."
7067 msgstr ""
7068 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7069 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7070 "をサポートしている必要がある。"
7071
7072 #. type: SS
7073 #: build/C/man2/send.2:239
7074 #, no-wrap
7075 msgid "sendmsg()"
7076 msgstr "sendmsg()"
7077
7078 #. type: Plain text
7079 #: build/C/man2/send.2:245
7080 msgid ""
7081 "The definition of the I<msghdr> structure employed by B<sendmsg>()  is as "
7082 "follows:"
7083 msgstr "B<sendmsg>() で利用されている I<msghdr> 構造体は以下の通り。"
7084
7085 #. type: Plain text
7086 #: build/C/man2/send.2:257
7087 #, no-wrap
7088 msgid ""
7089 "struct msghdr {\n"
7090 "    void         *msg_name;       /* optional address */\n"
7091 "    socklen_t     msg_namelen;    /* size of address */\n"
7092 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
7093 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
7094 "    void         *msg_control;    /* ancillary data, see below */\n"
7095 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
7096 "    int           msg_flags;      /* flags (unused) */\n"
7097 "};\n"
7098 msgstr ""
7099 "struct msghdr {\n"
7100 "    void         *msg_name;       /* 追加のアドレス */\n"
7101 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
7102 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
7103 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
7104 "    void         *msg_control;    /* 補助データ (後述) */\n"
7105 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
7106 "    int           msg_flags;      /* フラグ (未使用) */\n"
7107 "};\n"
7108
7109 #. type: Plain text
7110 #: build/C/man2/send.2:269
7111 msgid ""
7112 "The I<msg_name> field is used on an unconnected socket to specify the target "
7113 "address for a datagram.  It points to a buffer containing the address; the "
7114 "I<msg_namelen> field should be set to the size of the address.  For a "
7115 "connected socket, these fields should be specified as NULL and 0, "
7116 "respectively."
7117 msgstr ""
7118 "フィールド I<msg_name> は、 未接続のソケットでデータグラムの宛先アドレスを指"
7119 "定するのに使用される。 このフィールドはアドレスを格納したバッファを指す。 "
7120 "フィールド I<msg_namelen> にはアドレスの大きさを設定しなければならない。 接続"
7121 "済のソケットについては、これらのフィールドにはそれぞれ NULL と 0 を指定しなけ"
7122 "ればならない。"
7123
7124 #. type: Plain text
7125 #: build/C/man2/send.2:276
7126 msgid ""
7127 "The I<msg_iov> and I<msg_iovlen> fields specify scatter-gather locations, as "
7128 "for B<writev>(2)."
7129 msgstr ""
7130 "フィールド B<msg_iov> と I<msg_iovlen> は scatter-gather 用の場所を指定す"
7131 "る。 B<writev>(2) と同じ。"
7132
7133 #. type: Plain text
7134 #: build/C/man2/send.2:287
7135 msgid ""
7136 "You may send control information using the I<msg_control> and "
7137 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7138 "process is limited per socket by the value in I</proc/sys/net/core/"
7139 "optmem_max>; see B<socket>(7)."
7140 msgstr ""
7141 "フィールド I<msg_control> と I<msg_controllen> を使用して制御情報を送信するこ"
7142 "とができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7143 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
7144
7145 #.  Still to be documented:
7146 #.   Send file descriptors and user credentials using the
7147 #.   msg_control* fields.
7148 #. type: Plain text
7149 #: build/C/man2/send.2:294
7150 msgid "The I<msg_flags> field is ignored."
7151 msgstr "フィールド I<msg_flags> は無視される。"
7152
7153 #. type: Plain text
7154 #: build/C/man2/send.2:299
7155 msgid ""
7156 "On success, these calls return the number of bytes sent.  On error, -1 is "
7157 "returned, and I<errno> is set appropriately."
7158 msgstr ""
7159 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7160 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7161
7162 #. type: Plain text
7163 #: build/C/man2/send.2:304
7164 msgid ""
7165 "These are some standard errors generated by the socket layer.  Additional "
7166 "errors may be generated and returned from the underlying protocol modules; "
7167 "see their respective manual pages."
7168 msgstr ""
7169 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7170 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7171 "れぞれのマニュアルを参照すること。"
7172
7173 #. type: Plain text
7174 #: build/C/man2/send.2:312
7175 msgid ""
7176 "(For UNIX domain sockets, which are identified by pathname)  Write "
7177 "permission is denied on the destination socket file, or search permission is "
7178 "denied for one of the directories the path prefix.  (See "
7179 "B<path_resolution>(7).)"
7180 msgstr ""
7181 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7182 "\n"
7183 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7184 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7185 "(B<path_resolution>(7) も参照のこと)"
7186
7187 #. type: Plain text
7188 #: build/C/man2/send.2:315
7189 msgid ""
7190 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7191 "as though it was a unicast address."
7192 msgstr ""
7193 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7194 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7195
7196 #.  Actually EAGAIN on Linux
7197 #. type: Plain text
7198 #: build/C/man2/send.2:323
7199 msgid ""
7200 "The socket is marked nonblocking and the requested operation would block.  "
7201 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7202 "require these constants to have the same value, so a portable application "
7203 "should check for both possibilities."
7204 msgstr ""
7205 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7206 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7207 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7208 "両方の可能性を 確認すべきである。"
7209
7210 #. type: Plain text
7211 #: build/C/man2/send.2:336
7212 msgid ""
7213 "(Internet domain datagram sockets)  The socket referred to by I<sockfd> had "
7214 "not previously been bound to an address and, upon attempting to bind it to "
7215 "an ephemeral port, it was determined that all port numbers in the ephemeral "
7216 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
7217 "ip_local_port_range> in B<ip>(7)."
7218 msgstr ""
7219 "(インターネットドメインデータグラムソケットの場合) I<sockfd> が参照するソケッ"
7220 "トがそれ以前にアドレスにバインドされておらず、 そのソケットに一時ポートをバイ"
7221 "ンドしようとした際に、 一時ポートとして使用する範囲のポート番号がすべて使用中"
7222 "であった。 B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照"
7223 "のこと。"
7224
7225 #. type: Plain text
7226 #: build/C/man2/send.2:339
7227 msgid "An invalid descriptor was specified."
7228 msgstr "無効なディスクリプターが指定された。"
7229
7230 #. type: TP
7231 #: build/C/man2/send.2:339
7232 #, no-wrap
7233 msgid "B<ECONNRESET>"
7234 msgstr "B<ECONNRESET>"
7235
7236 #. type: Plain text
7237 #: build/C/man2/send.2:342
7238 msgid "Connection reset by peer."
7239 msgstr "接続が接続相手によりリセットされた。"
7240
7241 #. type: TP
7242 #: build/C/man2/send.2:342
7243 #, no-wrap
7244 msgid "B<EDESTADDRREQ>"
7245 msgstr "B<EDESTADDRREQ>"
7246
7247 #. type: Plain text
7248 #: build/C/man2/send.2:345
7249 msgid "The socket is not connection-mode, and no peer address is set."
7250 msgstr ""
7251 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7252 "ていない。"
7253
7254 #. type: Plain text
7255 #: build/C/man2/send.2:348
7256 msgid "An invalid user space address was specified for an argument."
7257 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7258
7259 #. type: Plain text
7260 #: build/C/man2/send.2:352
7261 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7262 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7263
7264 #. type: Plain text
7265 #: build/C/man2/send.2:361
7266 msgid ""
7267 "The connection-mode socket was connected already but a recipient was "
7268 "specified.  (Now either this error is returned, or the recipient "
7269 "specification is ignored.)"
7270 msgstr ""
7271 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7272 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7273 "いずれかとなる)"
7274
7275 #. type: TP
7276 #: build/C/man2/send.2:361
7277 #, no-wrap
7278 msgid "B<EMSGSIZE>"
7279 msgstr "B<EMSGSIZE>"
7280
7281 #.  (e.g., SOCK_DGRAM )
7282 #. type: Plain text
7283 #: build/C/man2/send.2:367
7284 msgid ""
7285 "The socket type requires that message be sent atomically, and the size of "
7286 "the message to be sent made this impossible."
7287 msgstr ""
7288 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7289 "るが、 メッセージが大き過ぎるため送信することができない。"
7290
7291 #. type: Plain text
7292 #: build/C/man2/send.2:375
7293 msgid ""
7294 "The output queue for a network interface was full.  This generally indicates "
7295 "that the interface has stopped sending, but may be caused by transient "
7296 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7297 "silently dropped when a device queue overflows.)"
7298 msgstr ""
7299 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7300 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7301 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7302 "フローした場合にはパケットは黙って捨てられる)"
7303
7304 #. type: Plain text
7305 #: build/C/man2/send.2:378
7306 msgid "No memory available."
7307 msgstr "メモリが足りない。"
7308
7309 #. type: Plain text
7310 #: build/C/man2/send.2:381
7311 msgid "The socket is not connected, and no target has been given."
7312 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7313
7314 #. type: Plain text
7315 #: build/C/man2/send.2:391
7316 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7317 msgstr ""
7318 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7319 "る。"
7320
7321 #. type: TP
7322 #: build/C/man2/send.2:391
7323 #, no-wrap
7324 msgid "B<EPIPE>"
7325 msgstr "B<EPIPE>"
7326
7327 #. type: Plain text
7328 #: build/C/man2/send.2:400
7329 msgid ""
7330 "The local end has been shut down on a connection oriented socket.  In this "
7331 "case, the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7332 "set."
7333 msgstr ""
7334 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7335 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7336
7337 #. type: Plain text
7338 #: build/C/man2/send.2:403
7339 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7340 msgstr ""
7341 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7342
7343 #. type: Plain text
7344 #: build/C/man2/send.2:414
7345 msgid ""
7346 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7347 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7348 "flag is a Linux extension."
7349 msgstr ""
7350 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7351 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7352 "ラグは Linux での拡張である。"
7353
7354 #. type: Plain text
7355 #: build/C/man2/send.2:427
7356 msgid ""
7357 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
7358 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
7359 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
7360 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
7361 "and libc5.  See also B<accept>(2)."
7362 msgstr ""
7363 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
7364 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
7365 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
7366 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
7367 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
7368
7369 #. type: Plain text
7370 #: build/C/man2/send.2:446
7371 msgid ""
7372 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7373 "can be used to transmit multiple datagrams in a single call."
7374 msgstr ""
7375 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7376 "る\n"
7377 "Linux 固有の システムコールに関する情報が書かれている。"
7378
7379 #. type: Plain text
7380 #: build/C/man2/send.2:451
7381 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7382 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7383
7384 #. type: Plain text
7385 #: build/C/man2/send.2:456
7386 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7387 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7388
7389 #. type: Plain text
7390 #: build/C/man2/send.2:471
7391 msgid ""
7392 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7393 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7394 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7395 msgstr ""
7396 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7397 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7398 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7399
7400 #. type: TH
7401 #: build/C/man2/sendmmsg.2:28
7402 #, no-wrap
7403 msgid "SENDMMSG"
7404 msgstr "SENDMMSG"
7405
7406 #. type: TH
7407 #: build/C/man2/sendmmsg.2:28
7408 #, no-wrap
7409 msgid "2012-12-16"
7410 msgstr "2012-12-16"
7411
7412 #. type: Plain text
7413 #: build/C/man2/sendmmsg.2:31
7414 msgid "sendmmsg - send multiple messages on a socket"
7415 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7416
7417 #. type: Plain text
7418 #: build/C/man2/sendmmsg.2:39
7419 #, no-wrap
7420 msgid ""
7421 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7422 "B<             unsigned int >I<flags>B<);>\n"
7423 msgstr ""
7424 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7425 "B<             unsigned int >I<flags>B<);>\n"
7426
7427 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7428 #. type: Plain text
7429 #: build/C/man2/sendmmsg.2:49
7430 msgid ""
7431 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7432 "the caller to transmit multiple messages on a socket using a single system "
7433 "call.  (This has performance benefits for some applications.)"
7434 msgstr ""
7435 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7436 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7437 "ンによっては性能上のメリットがある)。"
7438
7439 #. type: Plain text
7440 #: build/C/man2/sendmmsg.2:54
7441 msgid ""
7442 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7443 "to be transmitted."
7444 msgstr ""
7445 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7446
7447 #. type: Plain text
7448 #: build/C/man2/sendmmsg.2:75
7449 #, no-wrap
7450 msgid ""
7451 "struct mmsghdr {\n"
7452 "    struct msghdr msg_hdr;  /* Message header */\n"
7453 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7454 "};\n"
7455 msgstr ""
7456 "struct mmsghdr {\n"
7457 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7458 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7459 "};\n"
7460
7461 #. type: Plain text
7462 #: build/C/man2/sendmmsg.2:91
7463 msgid ""
7464 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
7465 "B<sendmsg>(2).  The I<msg_len> field is used to return the number of bytes "
7466 "sent from the message in I<msg_hdr> (i.e., the same as the return value from "
7467 "a single B<sendmsg>(2)  call)."
7468 msgstr ""
7469 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7470 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7471 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7472 "合の返り値と同じである。"
7473
7474 #. type: Plain text
7475 #: build/C/man2/sendmmsg.2:97
7476 msgid ""
7477 "The I<flags> argument contains flags ORed together.  The flags are the same "
7478 "as for B<sendmsg>(2)."
7479 msgstr ""
7480 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7481 "B<sendmsg>(2) と同じである。"
7482
7483 #. type: Plain text
7484 #: build/C/man2/sendmmsg.2:107
7485 msgid ""
7486 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7487 "sent.  A nonblocking call sends as many messages as possible (up to the "
7488 "limit specified by I<vlen>)  and returns immediately."
7489 msgstr ""
7490 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7491 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7492 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7493
7494 #. type: Plain text
7495 #: build/C/man2/sendmmsg.2:119
7496 msgid ""
7497 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7498 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7499 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7500 "of elements of I<msgvec> that have been updated."
7501 msgstr ""
7502 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7503 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7504 "しの返り値は、更新された I<msgvec> の要素数である。"
7505
7506 #. type: Plain text
7507 #: build/C/man2/sendmmsg.2:129
7508 msgid ""
7509 "On success, B<sendmmsg>()  returns the number of messages sent from "
7510 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7511 "B<sendmmsg>()  call to send the remaining messages."
7512 msgstr ""
7513 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7514 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7515 "て残りのメッセージを送信することができる。"
7516
7517 #. type: Plain text
7518 #: build/C/man2/sendmmsg.2:133
7519 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7520 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7521
7522 #
7523 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7524 #.      ... only return an error if no datagrams could be sent.
7525 #.      If less than the requested number of messages were sent, the application
7526 #.      must retry starting at the first failed one and if the problem is
7527 #.      persistent the error will be returned.
7528 #.      This matches the behaviour of other syscalls like read/write - it
7529 #.      is not an error if less than the requested number of elements are sent.
7530 #. type: Plain text
7531 #: build/C/man2/sendmmsg.2:145
7532 msgid ""
7533 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7534 "could be sent."
7535 msgstr ""
7536 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7537 "く送信できなかった場合のみである。"
7538
7539 #. type: Plain text
7540 #: build/C/man2/sendmmsg.2:150
7541 msgid ""
7542 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7543 "added in version 2.14."
7544 msgstr ""
7545 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7546 "バージョン 2.14 で追加された。"
7547
7548 #. type: Plain text
7549 #: build/C/man2/sendmmsg.2:153
7550 msgid "B<sendmmsg>()  is Linux-specific."
7551 msgstr "B<sendmmsg>() は Linux 固有である。"
7552
7553 #
7554 #
7555 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7556 #.      net: Cap number of elements for sendmmsg
7557 #.      To limit the amount of time we can spend in sendmmsg, cap the
7558 #.      number of elements to UIO_MAXIOV (currently 1024).
7559 #.      For error handling an application using sendmmsg needs to retry at
7560 #.      the first unsent message, so capping is simpler and requires less
7561 #.      application logic than returning EINVAL.
7562 #. type: Plain text
7563 #: build/C/man2/sendmmsg.2:168
7564 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7565 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7566
7567 #. type: Plain text
7568 #: build/C/man2/sendmmsg.2:177
7569 msgid ""
7570 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7571 "distinct UDP datagrams using one system call.  The contents of the first "
7572 "datagram originates from a pair of buffers."
7573 msgstr ""
7574 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7575 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7576 "の内容は、二つのバッファから取得される。"
7577
7578 #. type: Plain text
7579 #: build/C/man2/sendmmsg.2:186
7580 #, no-wrap
7581 msgid ""
7582 "#define _GNU_SOURCE\n"
7583 "#include E<lt>netinet/ip.hE<gt>\n"
7584 "#include E<lt>stdio.hE<gt>\n"
7585 "#include E<lt>stdlib.hE<gt>\n"
7586 "#include E<lt>string.hE<gt>\n"
7587 "#include E<lt>sys/types.hE<gt>\n"
7588 "#include E<lt>sys/socket.hE<gt>\n"
7589 msgstr ""
7590 "#define _GNU_SOURCE\n"
7591 "#include E<lt>netinet/ip.hE<gt>\n"
7592 "#include E<lt>stdio.hE<gt>\n"
7593 "#include E<lt>stdlib.hE<gt>\n"
7594 "#include E<lt>string.hE<gt>\n"
7595 "#include E<lt>sys/types.hE<gt>\n"
7596 "#include E<lt>sys/socket.hE<gt>\n"
7597
7598 #. type: Plain text
7599 #: build/C/man2/sendmmsg.2:195
7600 #, no-wrap
7601 msgid ""
7602 "int\n"
7603 "main(void)\n"
7604 "{\n"
7605 "    int sockfd;\n"
7606 "    struct sockaddr_in sa;\n"
7607 "    struct mmsghdr msg[2];\n"
7608 "    struct iovec msg1[2], msg2;\n"
7609 "    int retval;\n"
7610 msgstr ""
7611 "int\n"
7612 "main(void)\n"
7613 "{\n"
7614 "    int sockfd;\n"
7615 "    struct sockaddr_in sa;\n"
7616 "    struct mmsghdr msg[2];\n"
7617 "    struct iovec msg1[2], msg2;\n"
7618 "    int retval;\n"
7619
7620 #. type: Plain text
7621 #: build/C/man2/sendmmsg.2:209
7622 #, no-wrap
7623 msgid ""
7624 "    sa.sin_family = AF_INET;\n"
7625 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7626 "    sa.sin_port = htons(1234);\n"
7627 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7628 "        perror(\"connect()\");\n"
7629 "        exit(EXIT_FAILURE);\n"
7630 "    }\n"
7631 msgstr ""
7632 "    sa.sin_family = AF_INET;\n"
7633 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7634 "    sa.sin_port = htons(1234);\n"
7635 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7636 "        perror(\"connect()\");\n"
7637 "        exit(EXIT_FAILURE);\n"
7638 "    }\n"
7639
7640 #. type: Plain text
7641 #: build/C/man2/sendmmsg.2:215
7642 #, no-wrap
7643 msgid ""
7644 "    memset(msg1, 0, sizeof(msg1));\n"
7645 "    msg1[0].iov_base = \"one\";\n"
7646 "    msg1[0].iov_len = 3;\n"
7647 "    msg1[1].iov_base = \"two\";\n"
7648 "    msg1[1].iov_len = 3;\n"
7649 msgstr ""
7650 "    memset(msg1, 0, sizeof(msg1));\n"
7651 "    msg1[0].iov_base = \"one\";\n"
7652 "    msg1[0].iov_len = 3;\n"
7653 "    msg1[1].iov_base = \"two\";\n"
7654 "    msg1[1].iov_len = 3;\n"
7655
7656 #. type: Plain text
7657 #: build/C/man2/sendmmsg.2:219
7658 #, no-wrap
7659 msgid ""
7660 "    memset(&msg2, 0, sizeof(msg2));\n"
7661 "    msg2.iov_base = \"three\";\n"
7662 "    msg2.iov_len = 5;\n"
7663 msgstr ""
7664 "    memset(&msg2, 0, sizeof(msg2));\n"
7665 "    msg2.iov_base = \"three\";\n"
7666 "    msg2.iov_len = 5;\n"
7667
7668 #. type: Plain text
7669 #: build/C/man2/sendmmsg.2:223
7670 #, no-wrap
7671 msgid ""
7672 "    memset(msg, 0, sizeof(msg));\n"
7673 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7674 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7675 msgstr ""
7676 "    memset(msg, 0, sizeof(msg));\n"
7677 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7678 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7679
7680 #. type: Plain text
7681 #: build/C/man2/sendmmsg.2:226
7682 #, no-wrap
7683 msgid ""
7684 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7685 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7686 msgstr ""
7687 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7688 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7689
7690 #. type: Plain text
7691 #: build/C/man2/sendmmsg.2:232
7692 #, no-wrap
7693 msgid ""
7694 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7695 "    if (retval == -1)\n"
7696 "        perror(\"sendmmsg()\");\n"
7697 "    else\n"
7698 "        printf(\"%d messages sent\\en\", retval);\n"
7699 msgstr ""
7700 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7701 "    if (retval == -1)\n"
7702 "        perror(\"sendmmsg()\");\n"
7703 "    else\n"
7704 "        printf(\"%d messages sent\\en\", retval);\n"
7705
7706 #. type: Plain text
7707 #: build/C/man2/sendmmsg.2:235
7708 #, no-wrap
7709 msgid ""
7710 "    exit(0);\n"
7711 "}\n"
7712 msgstr ""
7713 "    exit(0);\n"
7714 "}\n"
7715
7716 #. type: Plain text
7717 #: build/C/man2/sendmmsg.2:241
7718 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7719 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7720
7721 #. type: TH
7722 #: build/C/man3/sockatmark.3:25
7723 #, no-wrap
7724 msgid "SOCKATMARK"
7725 msgstr "SOCKATMARK"
7726
7727 #. type: TH
7728 #: build/C/man3/sockatmark.3:25
7729 #, no-wrap
7730 msgid "2014-02-28"
7731 msgstr "2014-02-28"
7732
7733 #. type: Plain text
7734 #: build/C/man3/sockatmark.3:28
7735 msgid "sockatmark - determine whether socket is at out-of-band mark"
7736 msgstr ""
7737 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7738 "べる"
7739
7740 #. type: Plain text
7741 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7742 #: build/C/man7/socket.7:61 build/C/man2/socketpair.2:49
7743 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7744 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7745
7746 #. type: Plain text
7747 #: build/C/man3/sockatmark.3:32
7748 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7749 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7750
7751 #. type: Plain text
7752 #: build/C/man3/sockatmark.3:41
7753 msgid ""
7754 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7755 "\\ 600"
7756 msgstr ""
7757 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7758 "\\ 600"
7759
7760 #. type: Plain text
7761 #: build/C/man3/sockatmark.3:51
7762 msgid ""
7763 "B<sockatmark>()  returns a value indicating whether or not the socket "
7764 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7765 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7766 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7767 msgstr ""
7768 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7769 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7770 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7771 "この関数は帯域外マークを削除しない。"
7772
7773 #. type: Plain text
7774 #: build/C/man3/sockatmark.3:58
7775 msgid ""
7776 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7777 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7778 "set to indicate the error."
7779 msgstr ""
7780 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7781 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7782 "れ、エラーを表す I<errno> が設定される。"
7783
7784 #. type: Plain text
7785 #: build/C/man3/sockatmark.3:63
7786 msgid "I<sockfd> is not a valid file descriptor."
7787 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7788
7789 #.  POSIX.1 says ENOTTY for this case
7790 #. type: Plain text
7791 #: build/C/man3/sockatmark.3:70
7792 msgid ""
7793 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7794 msgstr ""
7795 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7796
7797 #. type: Plain text
7798 #: build/C/man3/sockatmark.3:73
7799 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7800 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7801
7802 #. type: Plain text
7803 #: build/C/man3/sockatmark.3:78
7804 msgid "The B<sockatmark>()  function is thread-safe."
7805 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7806
7807 #. type: Plain text
7808 #: build/C/man3/sockatmark.3:80
7809 msgid "POSIX.1-2001."
7810 msgstr "POSIX.1-2001."
7811
7812 #. type: Plain text
7813 #: build/C/man3/sockatmark.3:87
7814 msgid ""
7815 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7816 "the B<MSG_OOB> flag of B<recv>(2)."
7817 msgstr ""
7818 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7819 "B<recv>(2)  で読み込むことができる。"
7820
7821 #. type: Plain text
7822 #: build/C/man3/sockatmark.3:89
7823 msgid "Out-of-band data is supported only on some stream socket protocols."
7824 msgstr ""
7825 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7826 "ない。"
7827
7828 #. type: Plain text
7829 #: build/C/man3/sockatmark.3:94
7830 msgid ""
7831 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7832 "signal."
7833 msgstr ""
7834 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7835 "る。"
7836
7837 #. type: Plain text
7838 #: build/C/man3/sockatmark.3:100
7839 msgid ""
7840 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7841 "operation."
7842 msgstr ""
7843 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7844
7845 #. type: Plain text
7846 #: build/C/man3/sockatmark.3:104
7847 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7848 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7849
7850 #. type: Plain text
7851 #: build/C/man3/sockatmark.3:109
7852 msgid ""
7853 "The following code can be used after receipt of a B<SIGURG> signal to read "
7854 "(and discard) all data up to the mark, and then read the byte of data at the "
7855 "mark:"
7856 msgstr ""
7857 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7858 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7859
7860 #. type: Plain text
7861 #: build/C/man3/sockatmark.3:114
7862 #, no-wrap
7863 msgid ""
7864 "    char buf[BUF_LEN];\n"
7865 "    char oobdata;\n"
7866 "    int atmark, s;\n"
7867 msgstr ""
7868 "    char buf[BUF_LEN];\n"
7869 "    char oobdata;\n"
7870 "    int atmark, s;\n"
7871
7872 #. type: Plain text
7873 #: build/C/man3/sockatmark.3:121
7874 #, no-wrap
7875 msgid ""
7876 "    for (;;) {\n"
7877 "        atmark = sockatmark(sockfd);\n"
7878 "        if (atmark == -1) {\n"
7879 "            perror(\"sockatmark\");\n"
7880 "            break;\n"
7881 "        }\n"
7882 msgstr ""
7883 "    for (;;) {\n"
7884 "        atmark = sockatmark(sockfd);\n"
7885 "        if (atmark == -1) {\n"
7886 "            perror(\"sockatmark\");\n"
7887 "            break;\n"
7888 "        }\n"
7889
7890 #. type: Plain text
7891 #: build/C/man3/sockatmark.3:124
7892 #, no-wrap
7893 msgid ""
7894 "        if (atmark)\n"
7895 "            break;\n"
7896 msgstr ""
7897 "        if (atmark)\n"
7898 "            break;\n"
7899
7900 #. type: Plain text
7901 #: build/C/man3/sockatmark.3:131
7902 #, no-wrap
7903 msgid ""
7904 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7905 "        if (s == -1)\n"
7906 "            perror(\"read\");\n"
7907 "        if (s E<lt>= 0)\n"
7908 "            break;\n"
7909 "    }\n"
7910 msgstr ""
7911 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7912 "        if (s == -1)\n"
7913 "            perror(\"read\");\n"
7914 "        if (s E<lt>= 0)\n"
7915 "            break;\n"
7916 "    }\n"
7917
7918 #. type: Plain text
7919 #: build/C/man3/sockatmark.3:138
7920 #, no-wrap
7921 msgid ""
7922 "    if (atmark == 1) {\n"
7923 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7924 "            perror(\"recv\");\n"
7925 "            ...\n"
7926 "        }\n"
7927 "    }\n"
7928 msgstr ""
7929 "    if (atmark == 1) {\n"
7930 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7931 "            perror(\"recv\");\n"
7932 "            ...\n"
7933 "        }\n"
7934 "    }\n"
7935
7936 #. type: Plain text
7937 #: build/C/man3/sockatmark.3:144
7938 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7939 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7940
7941 #. type: TH
7942 #: build/C/man2/socket.2:43 build/C/man7/socket.7:56
7943 #, no-wrap
7944 msgid "SOCKET"
7945 msgstr "SOCKET"
7946
7947 #. type: TH
7948 #: build/C/man2/socket.2:43
7949 #, no-wrap
7950 msgid "2013-12-31"
7951 msgstr "2013-12-31"
7952
7953 #. type: Plain text
7954 #: build/C/man2/socket.2:46
7955 msgid "socket - create an endpoint for communication"
7956 msgstr "socket - 通信のための端点(endpoint)を作成する"
7957
7958 #. type: Plain text
7959 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7960 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7961 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7962
7963 #. type: Plain text
7964 #: build/C/man2/socket.2:52
7965 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7966 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7967
7968 #. type: Plain text
7969 #: build/C/man2/socket.2:55
7970 msgid ""
7971 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7972 msgstr ""
7973 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7974 "(descriptor)を返す。"
7975
7976 #. type: Plain text
7977 #: build/C/man2/socket.2:63
7978 msgid ""
7979 "The I<domain> argument specifies a communication domain; this selects the "
7980 "protocol family which will be used for communication.  These families are "
7981 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
7982 "include:"
7983 msgstr ""
7984 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
7985 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
7986 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
7987 "下の通り。"
7988
7989 #. type: tbl table
7990 #: build/C/man2/socket.2:66
7991 #, no-wrap
7992 msgid "Name:Purpose:Man page\n"
7993 msgstr "名前:目的:マニュアル\n"
7994
7995 #. type: tbl table
7996 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
7997 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
7998 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
7999 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8000 #, no-wrap
8001 msgid "T{\n"
8002 msgstr "T{\n"
8003
8004 #. type: tbl table
8005 #: build/C/man2/socket.2:68
8006 #, no-wrap
8007 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8008 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8009
8010 #. type: tbl table
8011 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8012 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8013 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8014 #: build/C/man7/socket.7:192
8015 #, no-wrap
8016 msgid "T}:T{\n"
8017 msgstr "T}:T{\n"
8018
8019 #. type: tbl table
8020 #: build/C/man2/socket.2:70
8021 #, no-wrap
8022 msgid "Local communication\n"
8023 msgstr "ローカル通信\n"
8024
8025 #. type: tbl table
8026 #: build/C/man2/socket.2:72
8027 #, no-wrap
8028 msgid "B<unix>(7)\n"
8029 msgstr "B<unix>(7)\n"
8030
8031 #. type: tbl table
8032 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8033 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8034 #: build/C/man2/socket.2:118 build/C/man7/socket.7:171
8035 #: build/C/man7/socket.7:175 build/C/man7/socket.7:178
8036 #: build/C/man7/socket.7:184 build/C/man7/socket.7:187
8037 #: build/C/man7/socket.7:196 build/C/man7/socket.7:203
8038 #, no-wrap
8039 msgid "T}\n"
8040 msgstr "T}\n"
8041
8042 #. type: tbl table
8043 #: build/C/man2/socket.2:75
8044 #, no-wrap
8045 msgid "B<AF_INET>\n"
8046 msgstr "B<AF_INET>\n"
8047
8048 #. type: tbl table
8049 #: build/C/man2/socket.2:76
8050 #, no-wrap
8051 msgid "T}:IPv4 Internet protocols:T{\n"
8052 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
8053
8054 #. type: tbl table
8055 #: build/C/man2/socket.2:77
8056 #, no-wrap
8057 msgid "B<ip>(7)\n"
8058 msgstr "B<ip>(7)\n"
8059
8060 #. type: tbl table
8061 #: build/C/man2/socket.2:80
8062 #, no-wrap
8063 msgid "B<AF_INET6>\n"
8064 msgstr "B<AF_INET6>\n"
8065
8066 #. type: tbl table
8067 #: build/C/man2/socket.2:81
8068 #, no-wrap
8069 msgid "T}:IPv6 Internet protocols:T{\n"
8070 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
8071
8072 #. type: tbl table
8073 #: build/C/man2/socket.2:82
8074 #, no-wrap
8075 msgid "B<ipv6>(7)\n"
8076 msgstr "B<ipv6>(7)\n"
8077
8078 #. type: tbl table
8079 #: build/C/man2/socket.2:85
8080 #, no-wrap
8081 msgid "B<AF_IPX>\n"
8082 msgstr "B<AF_IPX>\n"
8083
8084 #. type: tbl table
8085 #: build/C/man2/socket.2:86
8086 #, no-wrap
8087 msgid "T}:IPX - Novell protocols:\n"
8088 msgstr "T}:IPX - Novell プロトコル:\n"
8089
8090 #. type: tbl table
8091 #: build/C/man2/socket.2:88
8092 #, no-wrap
8093 msgid "B<AF_NETLINK>\n"
8094 msgstr "B<AF_NETLINK>\n"
8095
8096 #. type: tbl table
8097 #: build/C/man2/socket.2:90
8098 #, no-wrap
8099 msgid "Kernel user interface device\n"
8100 msgstr "カーネル・ユーザ・デバイス\n"
8101
8102 #. type: tbl table
8103 #: build/C/man2/socket.2:92
8104 #, no-wrap
8105 msgid "B<netlink>(7)\n"
8106 msgstr "B<netlink>(7)\n"
8107
8108 #. type: tbl table
8109 #: build/C/man2/socket.2:95
8110 #, no-wrap
8111 msgid "B<AF_X25>\n"
8112 msgstr "B<AF_X25>\n"
8113
8114 #. type: tbl table
8115 #: build/C/man2/socket.2:96
8116 #, no-wrap
8117 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8118 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8119
8120 #. type: tbl table
8121 #: build/C/man2/socket.2:97
8122 #, no-wrap
8123 msgid "B<x25>(7)\n"
8124 msgstr "B<x25>(7)\n"
8125
8126 #. type: tbl table
8127 #: build/C/man2/socket.2:100
8128 #, no-wrap
8129 msgid "B<AF_AX25>\n"
8130 msgstr "B<AF_AX25>\n"
8131
8132 #. type: tbl table
8133 #: build/C/man2/socket.2:102
8134 #, no-wrap
8135 msgid "Amateur radio AX.25 protocol\n"
8136 msgstr "アマチュア無線 AX.25 プロトコル\n"
8137
8138 #. type: tbl table
8139 #: build/C/man2/socket.2:103
8140 #, no-wrap
8141 msgid "T}:\n"
8142 msgstr "T}:\n"
8143
8144 #. type: tbl table
8145 #: build/C/man2/socket.2:105
8146 #, no-wrap
8147 msgid "B<AF_ATMPVC>\n"
8148 msgstr "B<AF_ATMPVC>\n"
8149
8150 #. type: tbl table
8151 #: build/C/man2/socket.2:106
8152 #, no-wrap
8153 msgid "T}:Access to raw ATM PVCs:\n"
8154 msgstr "T}:生の ATM PVC にアクセスする:\n"
8155
8156 #. type: tbl table
8157 #: build/C/man2/socket.2:108
8158 #, no-wrap
8159 msgid "B<AF_APPLETALK>\n"
8160 msgstr "B<AF_APPLETALK>\n"
8161
8162 #. type: tbl table
8163 #: build/C/man2/socket.2:109
8164 #, no-wrap
8165 msgid "T}:AppleTalk:T{\n"
8166 msgstr "T}:AppleTalk:T{\n"
8167
8168 #. type: tbl table
8169 #: build/C/man2/socket.2:110
8170 #, no-wrap
8171 msgid "B<ddp>(7)\n"
8172 msgstr "B<ddp>(7)\n"
8173
8174 #. type: tbl table
8175 #: build/C/man2/socket.2:113
8176 #, no-wrap
8177 msgid "B<AF_PACKET>\n"
8178 msgstr "B<AF_PACKET>\n"
8179
8180 #. type: tbl table
8181 #: build/C/man2/socket.2:115
8182 #, no-wrap
8183 msgid "Low level packet interface\n"
8184 msgstr "低レベルのパケットインターフェース\n"
8185
8186 #. type: tbl table
8187 #: build/C/man2/socket.2:117
8188 #, no-wrap
8189 msgid "B<packet>(7)\n"
8190 msgstr "B<packet>(7)\n"
8191
8192 #. type: Plain text
8193 #: build/C/man2/socket.2:126
8194 msgid ""
8195 "The socket has the indicated I<type>, which specifies the communication "
8196 "semantics.  Currently defined types are:"
8197 msgstr ""
8198 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8199 "る。 定義されている型は現在以下の通り。"
8200
8201 #. type: TP
8202 #: build/C/man2/socket.2:126
8203 #, no-wrap
8204 msgid "B<SOCK_STREAM>"
8205 msgstr "B<SOCK_STREAM>"
8206
8207 #. type: Plain text
8208 #: build/C/man2/socket.2:130
8209 msgid ""
8210 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8211 "out-of-band data transmission mechanism may be supported."
8212 msgstr ""
8213 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8214 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8215
8216 #. type: TP
8217 #: build/C/man2/socket.2:130
8218 #, no-wrap
8219 msgid "B<SOCK_DGRAM>"
8220 msgstr "B<SOCK_DGRAM>"
8221
8222 #. type: Plain text
8223 #: build/C/man2/socket.2:134
8224 msgid ""
8225 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8226 "length)."
8227 msgstr ""
8228 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8229 "する。"
8230
8231 #. type: TP
8232 #: build/C/man2/socket.2:134
8233 #, no-wrap
8234 msgid "B<SOCK_SEQPACKET>"
8235 msgstr "B<SOCK_SEQPACKET>"
8236
8237 #. type: Plain text
8238 #: build/C/man2/socket.2:139
8239 msgid ""
8240 "Provides a sequenced, reliable, two-way connection-based data transmission "
8241 "path for datagrams of fixed maximum length; a consumer is required to read "
8242 "an entire packet with each input system call."
8243 msgstr ""
8244 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8245 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8246 "ト全体を読み取ることが要求される。"
8247
8248 #. type: TP
8249 #: build/C/man2/socket.2:139
8250 #, no-wrap
8251 msgid "B<SOCK_RAW>"
8252 msgstr "B<SOCK_RAW>"
8253
8254 #. type: Plain text
8255 #: build/C/man2/socket.2:142
8256 msgid "Provides raw network protocol access."
8257 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8258
8259 #. type: TP
8260 #: build/C/man2/socket.2:142
8261 #, no-wrap
8262 msgid "B<SOCK_RDM>"
8263 msgstr "B<SOCK_RDM>"
8264
8265 #. type: Plain text
8266 #: build/C/man2/socket.2:145
8267 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8268 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8269
8270 #. type: TP
8271 #: build/C/man2/socket.2:145
8272 #, no-wrap
8273 msgid "B<SOCK_PACKET>"
8274 msgstr "B<SOCK_PACKET>"
8275
8276 #. type: Plain text
8277 #: build/C/man2/socket.2:150
8278 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8279 msgstr ""
8280 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8281 "こと"
8282
8283 #. type: Plain text
8284 #: build/C/man2/socket.2:152
8285 msgid "Some socket types may not be implemented by all protocol families."
8286 msgstr ""
8287 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。"
8288
8289 #. type: Plain text
8290 #: build/C/man2/socket.2:160
8291 msgid ""
8292 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8293 "addition to specifying a socket type, it may include the bitwise OR of any "
8294 "of the following values, to modify the behavior of B<socket>():"
8295 msgstr ""
8296 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8297 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8298 "ることで、 B<socket>()  の振舞いを変更することができる。"
8299
8300 #. type: Plain text
8301 #: build/C/man2/socket.2:194
8302 msgid ""
8303 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8304 "Normally only a single protocol exists to support a particular socket type "
8305 "within a given protocol family, in which case I<protocol> can be specified "
8306 "as 0.  However, it is possible that many protocols may exist, in which case "
8307 "a particular protocol must be specified in this manner.  The protocol number "
8308 "to use is specific to the ``communication domain'' in which communication is "
8309 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8310 "protocol name strings to protocol numbers."
8311 msgstr ""
8312 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8313 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8314 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8315 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8316 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8317 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8318 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8319
8320 #. type: Plain text
8321 #: build/C/man2/socket.2:224
8322 msgid ""
8323 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
8324 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
8325 "a I<connected> state before any data may be sent or received on it.  A "
8326 "connection to another socket is created with a B<connect>(2)  call.  Once "
8327 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
8328 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
8329 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
8330 "also be transmitted as described in B<send>(2)  and received as described in "
8331 "B<recv>(2)."
8332 msgstr ""
8333 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
8334 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
8335 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
8336 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは "
8337 "B<read>(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種"
8338 "を使用して転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域"
8339 "外データの転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述され"
8340 "ている。"
8341
8342 #. type: Plain text
8343 #: build/C/man2/socket.2:250
8344 msgid ""
8345 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8346 "data is not lost or duplicated.  If a piece of data for which the peer "
8347 "protocol has buffer space cannot be successfully transmitted within a "
8348 "reasonable length of time, then the connection is considered to be dead.  "
8349 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8350 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8351 "signal is raised if a process sends or receives on a broken stream; this "
8352 "causes naive processes, which do not handle the signal, to exit.  "
8353 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8354 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8355 "amount of data requested, and any data remaining in the arriving packet will "
8356 "be discarded.  Also all message boundaries in incoming datagrams are "
8357 "preserved."
8358 msgstr ""
8359 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8360 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8361 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8362 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8363 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8364 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8365 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8366 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8367 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8368 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8369
8370 #. type: Plain text
8371 #: build/C/man2/socket.2:260
8372 msgid ""
8373 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8374 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8375 "received with B<recvfrom>(2), which returns the next datagram along with the "
8376 "address of its sender."
8377 msgstr ""
8378 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8379 "へデータグラムを送ることが許されている。 データグラムは一般に "
8380 "B<recvfrom>(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと"
8381 "一緒に返す。"
8382
8383 #. type: Plain text
8384 #: build/C/man2/socket.2:267
8385 msgid ""
8386 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8387 "from the device driver.  Use B<packet>(7)  instead."
8388 msgstr ""
8389 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8390 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8391
8392 #. type: Plain text
8393 #: build/C/man2/socket.2:290
8394 msgid ""
8395 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8396 "process group to receive a B<SIGURG> signal when the out-of-band data "
8397 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8398 "unexpectedly.  This operation may also be used to set the process or process "
8399 "group that receives the I/O and asynchronous notification of I/O events via "
8400 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8401 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8402 msgstr ""
8403 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8404 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8405 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8406 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8407 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8408 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8409 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8410
8411 #. type: Plain text
8412 #: build/C/man2/socket.2:300
8413 msgid ""
8414 "When the network signals an error condition to the protocol module (e.g., "
8415 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8416 "The next operation on this socket will return the error code of the pending "
8417 "error.  For some protocols it is possible to enable a per-socket error queue "
8418 "to retrieve detailed information about the error; see B<IP_RECVERR> in "
8419 "B<ip>(7)."
8420 msgstr ""
8421 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8422 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8423 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8424 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8425 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8426 "B<IP_RECVERR> を参照すること。"
8427
8428 #. type: Plain text
8429 #: build/C/man2/socket.2:310
8430 msgid ""
8431 "The operation of sockets is controlled by socket level I<options>.  These "
8432 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8433 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8434 "respectively."
8435 msgstr ""
8436 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8437 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8438 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8439
8440 #. type: Plain text
8441 #: build/C/man2/socket.2:315
8442 msgid ""
8443 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8444 "is returned, and I<errno> is set appropriately."
8445 msgstr ""
8446 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8447 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8448
8449 #. type: Plain text
8450 #: build/C/man2/socket.2:320
8451 msgid ""
8452 "Permission to create a socket of the specified type and/or protocol is "
8453 "denied."
8454 msgstr ""
8455 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8456
8457 #. type: Plain text
8458 #: build/C/man2/socket.2:323
8459 msgid "The implementation does not support the specified address family."
8460 msgstr "指定されたアドレスファミリーがサポートされていない。"
8461
8462 #. type: Plain text
8463 #: build/C/man2/socket.2:326
8464 msgid "Unknown protocol, or protocol family not available."
8465 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8466
8467 #.  Since Linux 2.6.27
8468 #. type: Plain text
8469 #: build/C/man2/socket.2:331
8470 msgid "Invalid flags in I<type>."
8471 msgstr "I<type> に無効なフラグが指定されている。"
8472
8473 #. type: Plain text
8474 #: build/C/man2/socket.2:334
8475 msgid "Process file table overflow."
8476 msgstr "プロセスのファイルテーブルが溢れている。"
8477
8478 #. type: TP
8479 #: build/C/man2/socket.2:337
8480 #, no-wrap
8481 msgid "B<ENOBUFS> or B<ENOMEM>"
8482 msgstr "B<ENOBUFS> または B<ENOMEM>"
8483
8484 #. type: Plain text
8485 #: build/C/man2/socket.2:342
8486 msgid ""
8487 "Insufficient memory is available.  The socket cannot be created until "
8488 "sufficient resources are freed."
8489 msgstr ""
8490 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8491 "ない。"
8492
8493 #. type: TP
8494 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8495 #, no-wrap
8496 msgid "B<EPROTONOSUPPORT>"
8497 msgstr "B<EPROTONOSUPPORT>"
8498
8499 #. type: Plain text
8500 #: build/C/man2/socket.2:346
8501 msgid ""
8502 "The protocol type or the specified protocol is not supported within this "
8503 "domain."
8504 msgstr ""
8505 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8506 "いない。"
8507
8508 #. type: Plain text
8509 #: build/C/man2/socket.2:348
8510 msgid "Other errors may be generated by the underlying protocol modules."
8511 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8512
8513 #. type: Plain text
8514 #: build/C/man2/socket.2:350
8515 msgid "4.4BSD, POSIX.1-2001."
8516 msgstr "4.4BSD, POSIX.1-2001."
8517
8518 #. type: Plain text
8519 #: build/C/man2/socket.2:356
8520 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8521 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8522
8523 #. type: Plain text
8524 #: build/C/man2/socket.2:362
8525 msgid ""
8526 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8527 "systems supporting clones of the BSD socket layer (including System\\ V "
8528 "variants)."
8529 msgstr ""
8530 "B<socket>()  は 4.2BSD で登場した。一般に、(System\\ V の変種を含めて)  BSD "
8531 "のソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD "
8532 "以外のシステムからの移植ができる。"
8533
8534 #. type: Plain text
8535 #: build/C/man2/socket.2:381
8536 msgid ""
8537 "The manifest constants used under 4.x BSD for protocol families are "
8538 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8539 "are used for address families.  However, already the BSD man page promises: "
8540 "\"The protocol family generally is the same as the address family\", and "
8541 "subsequent standards use AF_* everywhere."
8542 msgstr ""
8543 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8544 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8545 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8546 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8547 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8548 "それ以外の規格では全ての場所で AF_* が使用されている。"
8549
8550 #. type: Plain text
8551 #: build/C/man2/socket.2:386
8552 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8553 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8554
8555 #. type: Plain text
8556 #: build/C/man2/socket.2:409
8557 msgid ""
8558 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8559 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8560 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8561 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8562 "B<udp>(7), B<unix>(7)"
8563 msgstr ""
8564 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8565 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8566 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8567 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8568 "B<udp>(7), B<unix>(7)"
8569
8570 #. type: Plain text
8571 #: build/C/man2/socket.2:415
8572 msgid ""
8573 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8574 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8575 "Programmer's Supplementary Documents Volume 1.>"
8576 msgstr ""
8577 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8578 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8579 "Supplementary Documents Volume 1.> として再版された)"
8580
8581 #. type: TH
8582 #: build/C/man7/socket.7:56
8583 #, no-wrap
8584 msgid "2014-02-21"
8585 msgstr "2014-02-21"
8586
8587 #. type: Plain text
8588 #: build/C/man7/socket.7:59
8589 msgid "socket - Linux socket interface"
8590 msgstr "socket - Linux のソケットインターフェース"
8591
8592 #. type: Plain text
8593 #: build/C/man7/socket.7:63
8594 msgid ""
8595 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8596 ">I<protocol>B<);>"
8597 msgstr ""
8598 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8599 ">I<protocol>B<);>"
8600
8601 #. type: Plain text
8602 #: build/C/man7/socket.7:82
8603 msgid ""
8604 "This manual page describes the Linux networking socket layer user "
8605 "interface.  The BSD compatible sockets are the uniform interface between the "
8606 "user process and the network protocol stacks in the kernel.  The protocol "
8607 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8608 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8609 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8610 msgstr ""
8611 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8612 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8613 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8614 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8615 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8616 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8617 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8618
8619 #. type: SS
8620 #: build/C/man7/socket.7:82
8621 #, no-wrap
8622 msgid "Socket-layer functions"
8623 msgstr "ソケット層の関数群"
8624
8625 #. type: Plain text
8626 #: build/C/man7/socket.7:86
8627 msgid ""
8628 "These functions are used by the user process to send or receive packets and "
8629 "to do other socket operations.  For more information see their respective "
8630 "manual pages."
8631 msgstr ""
8632 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8633 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8634
8635 #. type: Plain text
8636 #: build/C/man7/socket.7:102
8637 msgid ""
8638 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8639 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8640 "address, B<listen>(2)  tells the socket that new connections shall be "
8641 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8642 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8643 "(implemented only for a few local families like B<AF_UNIX>)"
8644 msgstr ""
8645 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8646 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8647 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8648 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8649 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8650 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8651 "リーでしか実装されていない)。"
8652
8653 #. type: Plain text
8654 #: build/C/man7/socket.7:124
8655 msgid ""
8656 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8657 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8658 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8659 "data.  In addition, the standard I/O operations like B<write>(2), "
8660 "B<writev>(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to "
8661 "read and write data."
8662 msgstr ""
8663 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8664 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8665 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8666 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8667 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8668 "ことができる。"
8669
8670 #. type: Plain text
8671 #: build/C/man7/socket.7:135
8672 msgid ""
8673 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8674 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8675 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8676 "be used to set or read some other options."
8677 msgstr ""
8678 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8679 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8680 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8681 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8682
8683 #. type: Plain text
8684 #: build/C/man7/socket.7:140
8685 msgid ""
8686 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8687 "full-duplex socket connection."
8688 msgstr ""
8689 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8690 "続を部分的にクローズする。"
8691
8692 #. type: Plain text
8693 #: build/C/man7/socket.7:146
8694 msgid ""
8695 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8696 "not supported on sockets."
8697 msgstr ""
8698 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8699 "ではサポートされていない。"
8700
8701 #. type: Plain text
8702 #: build/C/man7/socket.7:163
8703 msgid ""
8704 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8705 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8706 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8707 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8708 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8709 msgstr ""
8710 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8711 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8712 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8713 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8714 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8715 "B<select>(2)  を使って待つことができる。"
8716
8717 #. type: tbl table
8718 #: build/C/man7/socket.7:167
8719 #, no-wrap
8720 msgid "I/O events\n"
8721 msgstr "I/O イベント\n"
8722
8723 #. type: tbl table
8724 #: build/C/man7/socket.7:168
8725 #, no-wrap
8726 msgid "Event:Poll flag:Occurrence\n"
8727 msgstr "イベント:poll フラグ:内容\n"
8728
8729 #. type: tbl table
8730 #: build/C/man7/socket.7:169 build/C/man7/socket.7:172
8731 #, no-wrap
8732 msgid "Read:POLLIN:T{\n"
8733 msgstr "Read:POLLIN:T{\n"
8734
8735 #. type: tbl table
8736 #: build/C/man7/socket.7:170
8737 #, no-wrap
8738 msgid "New data arrived.\n"
8739 msgstr "新しいデータが到着した。\n"
8740
8741 #. type: tbl table
8742 #: build/C/man7/socket.7:173
8743 #, no-wrap
8744 msgid "A connection setup has been completed\n"
8745 msgstr "(接続志向のソケットで)\n"
8746
8747 #. type: tbl table
8748 #: build/C/man7/socket.7:174
8749 #, no-wrap
8750 msgid "(for connection-oriented sockets)\n"
8751 msgstr "接続の設定が終了した。\n"
8752
8753 #. type: tbl table
8754 #: build/C/man7/socket.7:176 build/C/man7/socket.7:179
8755 #, no-wrap
8756 msgid "Read:POLLHUP:T{\n"
8757 msgstr "Read:POLLHUP:T{\n"
8758
8759 #. type: tbl table
8760 #: build/C/man7/socket.7:177
8761 #, no-wrap
8762 msgid "A disconnection request has been initiated by the other end.\n"
8763 msgstr "接続先で切断要求が生成された。\n"
8764
8765 #. type: tbl table
8766 #: build/C/man7/socket.7:180
8767 #, no-wrap
8768 msgid "A connection is broken (only for connection-oriented protocols).\n"
8769 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8770
8771 #. type: tbl table
8772 #: build/C/man7/socket.7:181
8773 #, no-wrap
8774 msgid "When the socket is written\n"
8775 msgstr "この場合、ソケットに書き込みが行われると\n"
8776
8777 #. type: tbl table
8778 #: build/C/man7/socket.7:182
8779 #, no-wrap
8780 msgid "B<SIGPIPE>\n"
8781 msgstr "B<SIGPIPE>\n"
8782
8783 #. type: tbl table
8784 #: build/C/man7/socket.7:183
8785 #, no-wrap
8786 msgid "is also sent.\n"
8787 msgstr "も送信される。\n"
8788
8789 #. type: tbl table
8790 #: build/C/man7/socket.7:185
8791 #, no-wrap
8792 msgid "Write:POLLOUT:T{\n"
8793 msgstr "Write:POLLOUT:T{\n"
8794
8795 #. type: tbl table
8796 #: build/C/man7/socket.7:186
8797 #, no-wrap
8798 msgid "Socket has enough send buffer space for writing new data.\n"
8799 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8800
8801 #. type: tbl table
8802 #: build/C/man7/socket.7:188
8803 #, no-wrap
8804 msgid "Read/Write:T{\n"
8805 msgstr "Read/Write:T{\n"
8806
8807 #. type: tbl table
8808 #: build/C/man7/socket.7:189
8809 #, no-wrap
8810 msgid "POLLIN|\n"
8811 msgstr "POLLIN|\n"
8812
8813 #. type: tbl table
8814 #: build/C/man7/socket.7:190
8815 #, no-wrap
8816 msgid ".br\n"
8817 msgstr ".br\n"
8818
8819 #. type: tbl table
8820 #: build/C/man7/socket.7:191
8821 #, no-wrap
8822 msgid "POLLOUT\n"
8823 msgstr "POLLOUT\n"
8824
8825 #. type: tbl table
8826 #: build/C/man7/socket.7:193
8827 #, no-wrap
8828 msgid "An outgoing\n"
8829 msgstr "外部向けの\n"
8830
8831 #. type: tbl table
8832 #: build/C/man7/socket.7:194
8833 #, no-wrap
8834 msgid "B<connect>(2)\n"
8835 msgstr "B<connect>(2)\n"
8836
8837 #. type: tbl table
8838 #: build/C/man7/socket.7:195
8839 #, no-wrap
8840 msgid "finished.\n"
8841 msgstr "が終了した。\n"
8842
8843 #. type: tbl table
8844 #: build/C/man7/socket.7:197
8845 #, no-wrap
8846 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8847 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8848
8849 #. type: tbl table
8850 #: build/C/man7/socket.7:198
8851 #, no-wrap
8852 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8853 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8854
8855 #. type: tbl table
8856 #: build/C/man7/socket.7:199
8857 #, no-wrap
8858 msgid "Exception:POLLPRI:T{\n"
8859 msgstr "Exception:POLLPRI:T{\n"
8860
8861 #. type: tbl table
8862 #: build/C/man7/socket.7:200
8863 #, no-wrap
8864 msgid "Urgent data arrived.\n"
8865 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8866
8867 #. type: tbl table
8868 #: build/C/man7/socket.7:201
8869 #, no-wrap
8870 msgid "B<SIGURG>\n"
8871 msgstr "B<SIGURG>\n"
8872
8873 #. type: tbl table
8874 #: build/C/man7/socket.7:202
8875 #, no-wrap
8876 msgid "is sent then.\n"
8877 msgstr "が送信される。\n"
8878
8879 #. type: Plain text
8880 #: build/C/man7/socket.7:231
8881 msgid ""
8882 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8883 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8884 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8885 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8886 "I<Signals> discussion below."
8887 msgstr ""
8888 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8889 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8890 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8891 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8892 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8893 "と。"
8894
8895 #. type: SS
8896 #: build/C/man7/socket.7:231
8897 #, no-wrap
8898 msgid "Socket address structures"
8899 msgstr "ソケットアドレス構造体"
8900
8901 #. type: Plain text
8902 #: build/C/man7/socket.7:247
8903 msgid ""
8904 "Each socket domain has its own format for socket addresses, with a domain-"
8905 "specific address structure.  Each of these structures begins with an integer "
8906 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8907 "address structure.  This allows the various system calls (e.g., "
8908 "B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8909 "B<getpeername>(2)), which are generic to all socket domains, to determine "
8910 "the domain of a particular socket address."
8911 msgstr ""
8912 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8913 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8914 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8915 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8916 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8917 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8918 "できる。"
8919
8920 #. type: Plain text
8921 #: build/C/man7/socket.7:257
8922 msgid ""
8923 "To allow any type of socket address to be passed to interfaces in the "
8924 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8925 "type is purely to allow casting of domain-specific socket address types to a "
8926 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8927 "calls to the sockets API."
8928 msgstr ""
8929 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8930 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8931 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8932 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8933 "告を出すのを避けることができる。"
8934
8935 #. type: Plain text
8936 #: build/C/man7/socket.7:267
8937 msgid ""
8938 "In addition, the sockets API provides the data type I<struct "
8939 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8940 "domain-specific socket address structures; it is large enough and is aligned "
8941 "properly.  (In particular, it is large enough to hold IPv6 socket "
8942 "addresses.)  The structure includes the following field, which can be used "
8943 "to identify the type of socket address actually stored in the structure:"
8944 msgstr ""
8945 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8946 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8947 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8948 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8949 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8950 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8951 "できる。"
8952
8953 #. type: Plain text
8954 #: build/C/man7/socket.7:271
8955 #, no-wrap
8956 msgid "    sa_family_t ss_family;\n"
8957 msgstr "    sa_family_t ss_family;\n"
8958
8959 #. type: Plain text
8960 #: build/C/man7/socket.7:279
8961 msgid ""
8962 "The I<sockaddr_storage> structure is useful in programs that must handle "
8963 "socket addresses in a generic way (e.g., programs that must deal with both "
8964 "IPv4 and IPv6 socket addresses)."
8965 msgstr ""
8966 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8967 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8968 "ログラム) で有用である。"
8969
8970 #. type: SS
8971 #: build/C/man7/socket.7:279
8972 #, no-wrap
8973 msgid "Socket options"
8974 msgstr "ソケットオプション"
8975
8976 #.  FIXME
8977 #.  In the list below, the text used to describe argument types
8978 #.  for each socket option should be more consistent
8979 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8980 #.  W R Stevens, UNPv1
8981 #. type: Plain text
8982 #: build/C/man7/socket.7:297
8983 msgid ""
8984 "The socket options listed below can be set by using B<setsockopt>(2)  and "
8985 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
8986 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
8987 msgstr ""
8988 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
8989 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
8990 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
8991 "I<int> へのポインタである。"
8992
8993 #. type: TP
8994 #: build/C/man7/socket.7:297
8995 #, no-wrap
8996 msgid "B<SO_ACCEPTCONN>"
8997 msgstr "B<SO_ACCEPTCONN>"
8998
8999 #. type: Plain text
9000 #: build/C/man7/socket.7:305
9001 msgid ""
9002 "Returns a value indicating whether or not this socket has been marked to "
9003 "accept connections with B<listen>(2).  The value 0 indicates that this is "
9004 "not a listening socket, the value 1 indicates that this is a listening "
9005 "socket.  This socket option is read-only."
9006 msgstr ""
9007 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
9008 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9009 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9010
9011 #. type: TP
9012 #: build/C/man7/socket.7:305
9013 #, no-wrap
9014 msgid "B<SO_BINDTODEVICE>"
9015 msgstr "B<SO_BINDTODEVICE>"
9016
9017 #. type: Plain text
9018 #: build/C/man7/socket.7:324
9019 msgid ""
9020 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9021 "the passed interface name.  If the name is an empty string or the option "
9022 "length is zero, the socket device binding is removed.  The passed option is "
9023 "a variable-length null-terminated interface name string with the maximum "
9024 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
9025 "received from that particular interface are processed by the socket.  Note "
9026 "that this works only for some socket types, particularly B<AF_INET> "
9027 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
9028 "there)."
9029 msgstr ""
9030 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9031 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9032 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9033 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9034 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9035 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9036 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9037 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9038 "B<bind>(2) を使うこと)。"
9039
9040 #. type: Plain text
9041 #: build/C/man7/socket.7:338
9042 msgid ""
9043 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9044 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
9045 "argument should contain the buffer size available to receive the device name "
9046 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
9047 "reported back in the I<optlen> argument."
9048 msgstr ""
9049 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9050 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9051 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9052 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
9053 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9054
9055 #. type: TP
9056 #: build/C/man7/socket.7:338
9057 #, no-wrap
9058 msgid "B<SO_BROADCAST>"
9059 msgstr "B<SO_BROADCAST>"
9060
9061 #. type: Plain text
9062 #: build/C/man7/socket.7:344
9063 msgid ""
9064 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
9065 "to send packets to a broadcast address.  This option has no effect on stream-"
9066 "oriented sockets."
9067 msgstr ""
9068 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9069 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9070 "ストリーム指向のソケットには何の効果もない。"
9071
9072 #. type: TP
9073 #: build/C/man7/socket.7:344
9074 #, no-wrap
9075 msgid "B<SO_BSDCOMPAT>"
9076 msgstr "B<SO_BSDCOMPAT>"
9077
9078 #. type: Plain text
9079 #: build/C/man7/socket.7:356
9080 msgid ""
9081 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
9082 "module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP "
9083 "socket will not be passed to the user program.  In later kernel versions, "
9084 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9085 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9086 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9087 "header changing, skipping of the broadcast flag) for raw sockets with this "
9088 "option, but that was removed in Linux 2.2."
9089 msgstr ""
9090 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9091 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9092 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
9093 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
9094 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
9095 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
9096 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
9097 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
9098 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
9099
9100 #. type: TP
9101 #: build/C/man7/socket.7:356
9102 #, no-wrap
9103 msgid "B<SO_DEBUG>"
9104 msgstr "B<SO_DEBUG>"
9105
9106 #. type: Plain text
9107 #: build/C/man7/socket.7:362
9108 msgid ""
9109 "Enable socket debugging.  Only allowed for processes with the "
9110 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9111 msgstr ""
9112 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9113 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9114
9115 #. type: TP
9116 #: build/C/man7/socket.7:362
9117 #, no-wrap
9118 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9119 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9120
9121 #. type: Plain text
9122 #: build/C/man7/socket.7:370
9123 msgid ""
9124 "Retrieves the socket domain as an integer, returning a value such as "
9125 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9126 "only."
9127 msgstr ""
9128 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9129 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9130
9131 #. type: TP
9132 #: build/C/man7/socket.7:370
9133 #, no-wrap
9134 msgid "B<SO_ERROR>"
9135 msgstr "B<SO_ERROR>"
9136
9137 #. type: Plain text
9138 #: build/C/man7/socket.7:375
9139 msgid ""
9140 "Get and clear the pending socket error.  This socket option is read-only.  "
9141 "Expects an integer."
9142 msgstr ""
9143 "保留になっていたソケットエラーを取得してクリアする。\n"
9144 "このソケットオプションは読み込み専用である。整数値をとる。"
9145
9146 #. type: TP
9147 #: build/C/man7/socket.7:375
9148 #, no-wrap
9149 msgid "B<SO_DONTROUTE>"
9150 msgstr "B<SO_DONTROUTE>"
9151
9152 #. type: Plain text
9153 #: build/C/man7/socket.7:384
9154 msgid ""
9155 "Don't send via a gateway, send only to directly connected hosts.  The same "
9156 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9157 "B<send>(2)  operation.  Expects an integer boolean flag."
9158 msgstr ""
9159 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9160 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9161 "数のフラグを取る。"
9162
9163 #. type: TP
9164 #: build/C/man7/socket.7:384
9165 #, no-wrap
9166 msgid "B<SO_KEEPALIVE>"
9167 msgstr "B<SO_KEEPALIVE>"
9168
9169 #. type: Plain text
9170 #: build/C/man7/socket.7:388
9171 msgid ""
9172 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9173 "Expects an integer boolean flag."
9174 msgstr ""
9175 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9176 "の整数フラグをとる。"
9177
9178 #. type: TP
9179 #: build/C/man7/socket.7:388
9180 #, no-wrap
9181 msgid "B<SO_LINGER>"
9182 msgstr "B<SO_LINGER>"
9183
9184 #. type: Plain text
9185 #: build/C/man7/socket.7:396
9186 msgid ""
9187 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9188 msgstr ""
9189 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9190
9191 #. type: Plain text
9192 #: build/C/man7/socket.7:403
9193 #, no-wrap
9194 msgid ""
9195 "struct linger {\n"
9196 "    int l_onoff;    /* linger active */\n"
9197 "    int l_linger;   /* how many seconds to linger for */\n"
9198 "};\n"
9199 msgstr ""
9200 "struct linger {\n"
9201 "    int l_onoff;    /* linger active */\n"
9202 "    int l_linger;   /* how many seconds to linger for */\n"
9203 "};\n"
9204
9205 #. type: Plain text
9206 #: build/C/man7/socket.7:417
9207 msgid ""
9208 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9209 "queued messages for the socket have been successfully sent or the linger "
9210 "timeout has been reached.  Otherwise, the call returns immediately and the "
9211 "closing is done in the background.  When the socket is closed as part of "
9212 "B<exit>(2), it always lingers in the background."
9213 msgstr ""
9214 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9215 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9216 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9217 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9218 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9219 "送られる。"
9220
9221 #. type: TP
9222 #: build/C/man7/socket.7:417
9223 #, no-wrap
9224 msgid "B<SO_MARK> (since Linux 2.6.25)"
9225 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9226
9227 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9228 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9229 #. type: Plain text
9230 #: build/C/man7/socket.7:428
9231 msgid ""
9232 "Set the mark for each packet sent through this socket (similar to the "
9233 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9234 "mark-based routing without netfilter or for packet filtering.  Setting this "
9235 "option requires the B<CAP_NET_ADMIN> capability."
9236 msgstr ""
9237 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9238 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9239 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9240 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9241 "ティが必要である。"
9242
9243 #. type: TP
9244 #: build/C/man7/socket.7:428
9245 #, no-wrap
9246 msgid "B<SO_OOBINLINE>"
9247 msgstr "B<SO_OOBINLINE>"
9248
9249 #.  don't document it because it can do too much harm.
9250 #. .B SO_NO_CHECK
9251 #. type: Plain text
9252 #: build/C/man7/socket.7:437
9253 msgid ""
9254 "If this option is enabled, out-of-band data is directly placed into the "
9255 "receive data stream.  Otherwise, out-of-band data is passed only when the "
9256 "B<MSG_OOB> flag is set during receiving."
9257 msgstr ""
9258 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9259 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9260 "ラグがセットされている場合に限って渡される。"
9261
9262 #. type: TP
9263 #: build/C/man7/socket.7:437
9264 #, no-wrap
9265 msgid "B<SO_PASSCRED>"
9266 msgstr "B<SO_PASSCRED>"
9267
9268 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9269 #.  in the 2.6.18 ChangeLog
9270 #. type: Plain text
9271 #: build/C/man7/socket.7:446
9272 msgid ""
9273 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9274 "For more information see B<unix>(7)."
9275 msgstr ""
9276 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9277 "を参照のこと。"
9278
9279 #. type: TP
9280 #: build/C/man7/socket.7:446
9281 #, no-wrap
9282 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9283 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9284
9285 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9286 #. type: Plain text
9287 #: build/C/man7/socket.7:456
9288 msgid ""
9289 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9290 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9291 "with B<MSG_PEEK> flag."
9292 msgstr ""
9293 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9294 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9295 "B<unix>(7) ソケットでのみサポートされている。"
9296
9297 #. type: Plain text
9298 #: build/C/man7/socket.7:464
9299 msgid ""
9300 "When this option is set to a negative value (it is set to -1 for all new "
9301 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9302 "flag will peek data from the front of the queue."
9303 msgstr ""
9304 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9305 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9306 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9307 "のソケットではこのオプションの値は必ず -1 に設定される。"
9308
9309 #. type: Plain text
9310 #: build/C/man7/socket.7:471
9311 msgid ""
9312 "When the option is set to a value greater than or equal to zero, then the "
9313 "next peek at data queued in the socket will occur at the byte offset "
9314 "specified by the option value.  At the same time, the \"peek offset\" will "
9315 "be incremented by the number of bytes that were peeked from the queue, so "
9316 "that a subsequent peek will return the next data in the queue."
9317 msgstr ""
9318 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9319 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9320 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9321 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9322
9323 #. type: Plain text
9324 #: build/C/man7/socket.7:483
9325 msgid ""
9326 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9327 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9328 "by the number of bytes removed.  In other words, receiving data without the "
9329 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9330 "the correct relative position in the queued data, so that a subsequent peek "
9331 "will retrieve the data that would have been retrieved had the data not been "
9332 "removed."
9333 msgstr ""
9334 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9335 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9336 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9337 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9338 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9339 "いうことである。"
9340
9341 #. type: Plain text
9342 #: build/C/man7/socket.7:488
9343 msgid ""
9344 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9345 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9346 msgstr ""
9347 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9348 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9349
9350 #. type: Plain text
9351 #: build/C/man7/socket.7:492
9352 msgid ""
9353 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9354 "Suppose a stream socket has the following queued input data:"
9355 msgstr ""
9356 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9357 "以下の入力データが入っているものとする。"
9358
9359 #. type: Plain text
9360 #: build/C/man7/socket.7:494
9361 #, no-wrap
9362 msgid "    aabbccddeeff\n"
9363 msgstr "    aabbccddeeff\n"
9364
9365 #. type: Plain text
9366 #: build/C/man7/socket.7:499
9367 msgid ""
9368 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9369 "the comments:"
9370 msgstr ""
9371 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9372
9373 #. type: Plain text
9374 #: build/C/man7/socket.7:504
9375 #, no-wrap
9376 msgid ""
9377 "int ov = 4;                  // Set peek offset to 4\n"
9378 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9379 msgstr ""
9380 "int ov = 4;                  // Set peek offset to 4\n"
9381 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9382
9383 #. type: Plain text
9384 #: build/C/man7/socket.7:509
9385 #, no-wrap
9386 msgid ""
9387 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9388 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9389 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9390 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9391 msgstr ""
9392 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9393 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9394 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9395 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9396
9397 #. type: TP
9398 #: build/C/man7/socket.7:511
9399 #, no-wrap
9400 msgid "B<SO_PEERCRED>"
9401 msgstr "B<SO_PEERCRED>"
9402
9403 #. type: Plain text
9404 #: build/C/man7/socket.7:534
9405 msgid ""
9406 "Return the credentials of the foreign process connected to this socket.  "
9407 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9408 "stream and datagram socket pairs created using B<socketpair>(2); see "
9409 "B<unix>(7).  The returned credentials are those that were in effect at the "
9410 "time of the call to B<connect>(2)  or B<socketpair>(2).  The argument is a "
9411 "I<ucred> structure; define the B<_GNU_SOURCE> feature test macro to obtain "
9412 "the definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This "
9413 "socket option is read-only."
9414 msgstr ""
9415 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9416 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9417 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9418 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9419 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9420 "る。 引き数は I<ucred> 構造体である。この構造体の定義を I<E<lt>sys/socket."
9421 "hE<gt>> を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義すること。 このソ"
9422 "ケットオプションは読み込み専用である。"
9423
9424 #. type: TP
9425 #: build/C/man7/socket.7:534
9426 #, no-wrap
9427 msgid "B<SO_PRIORITY>"
9428 msgstr "B<SO_PRIORITY>"
9429
9430 #. type: Plain text
9431 #: build/C/man7/socket.7:547
9432 msgid ""
9433 "Set the protocol-defined priority for all packets to be sent on this "
9434 "socket.  Linux uses this value to order the networking queues: packets with "
9435 "a higher priority may be processed first depending on the selected device "
9436 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9437 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9438 "6 requires the B<CAP_NET_ADMIN> capability."
9439 msgstr ""
9440 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9441 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9442 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9443 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9444 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9445 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9446
9447 #. type: TP
9448 #: build/C/man7/socket.7:547
9449 #, no-wrap
9450 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9451 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9452
9453 #. type: Plain text
9454 #: build/C/man7/socket.7:555
9455 msgid ""
9456 "Retrieves the socket protocol as an integer, returning a value such as "
9457 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9458 "only."
9459 msgstr ""
9460 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9461 "る。\n"
9462 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9463
9464 #. type: TP
9465 #: build/C/man7/socket.7:555
9466 #, no-wrap
9467 msgid "B<SO_RCVBUF>"
9468 msgstr "B<SO_RCVBUF>"
9469
9470 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9471 #.  The following thread on LMKL is quite informative:
9472 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behaviour
9473 #.  17 July 2012
9474 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9475 #. type: Plain text
9476 #: build/C/man7/socket.7:574
9477 msgid ""
9478 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9479 "this value (to allow space for bookkeeping overhead)  when it is set using "
9480 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9481 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9482 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9483 "file.  The minimum (doubled) value for this option is 256."
9484 msgstr ""
9485 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9486 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9487 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9488 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9489 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9490 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9491
9492 #. type: TP
9493 #: build/C/man7/socket.7:574
9494 #, no-wrap
9495 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9496 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9497
9498 #. type: Plain text
9499 #: build/C/man7/socket.7:583
9500 msgid ""
9501 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9502 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9503 "overridden."
9504 msgstr ""
9505 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9506 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9507 "きすることができる。"
9508
9509 #. type: TP
9510 #: build/C/man7/socket.7:583
9511 #, no-wrap
9512 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9513 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9514
9515 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9516 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9517 #. type: Plain text
9518 #: build/C/man7/socket.7:612
9519 msgid ""
9520 "Specify the minimum number of bytes in the buffer until the socket layer "
9521 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9522 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9523 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9524 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9525 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9526 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9527 "single byte of data is available.  A subsequent read from the socket will "
9528 "block until B<SO_RCVLOWAT> bytes are available."
9529 msgstr ""
9530 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9531 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9532 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9533 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9534 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9535 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9536 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9537 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9538 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9539 "してしまう。"
9540
9541 #. type: TP
9542 #: build/C/man7/socket.7:612
9543 #, no-wrap
9544 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9545 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9546
9547 #.  Not implemented in 2.0.
9548 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9549 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9550 #.  in fact to EAGAIN
9551 #. type: Plain text
9552 #: build/C/man7/socket.7:647
9553 msgid ""
9554 "Specify the receiving or sending timeouts until reporting an error.  The "
9555 "argument is a I<struct timeval>.  If an input or output function blocks for "
9556 "this period of time, and data has been sent or received, the return value of "
9557 "that function will be the amount of data transferred; if no data has been "
9558 "transferred and the timeout has been reached, then -1 is returned with "
9559 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9560 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9561 "the timeout is set to zero (the default), then the operation will never "
9562 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9563 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9564 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9565 msgstr ""
9566 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9567 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9568 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9569 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9570 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> "
9571 "(B<connect>(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定さ"
9572 "れたように見える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操"
9573 "作は決してタイムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット "
9574 "I/O を実行するシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), "
9575 "B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), "
9576 "B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
9577
9578 #. type: TP
9579 #: build/C/man7/socket.7:647
9580 #, no-wrap
9581 msgid "B<SO_REUSEADDR>"
9582 msgstr "B<SO_REUSEADDR>"
9583
9584 #. type: Plain text
9585 #: build/C/man7/socket.7:662
9586 msgid ""
9587 "Indicates that the rules used in validating addresses supplied in a "
9588 "B<bind>(2)  call should allow reuse of local addresses.  For B<AF_INET> "
9589 "sockets this means that a socket may bind, except when there is an active "
9590 "listening socket bound to the address.  When the listening socket is bound "
9591 "to B<INADDR_ANY> with a specific port then it is not possible to bind to "
9592 "this port for any local address.  Argument is an integer boolean flag."
9593 msgstr ""
9594 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9595 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9596 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9597 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9598 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9599 "ドできない。 引き数はブール整数のフラグである。"
9600
9601 #. type: TP
9602 #: build/C/man7/socket.7:662
9603 #, no-wrap
9604 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9605 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9606
9607 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9608 #. type: Plain text
9609 #: build/C/man7/socket.7:669
9610 msgid ""
9611 "Indicates that an unsigned 32-bit value ancillary message (cmsg)  should be "
9612 "attached to received skbs indicating the number of packets dropped by the "
9613 "socket between the last received packet and this received packet."
9614 msgstr ""
9615 "最後の受信パケットとこの受信パケットの間にそのソケットで捨てられた (ドロップ"
9616 "された) パケット数を示す、unsigned 32 ビット値の補助メッセージ (cmsg) を受信"
9617 "した skb に付与することを指示する。"
9618
9619 #. type: TP
9620 #: build/C/man7/socket.7:669
9621 #, no-wrap
9622 msgid "B<SO_SNDBUF>"
9623 msgstr "B<SO_SNDBUF>"
9624
9625 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9626 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9627 #. type: Plain text
9628 #: build/C/man7/socket.7:685
9629 msgid ""
9630 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9631 "this value (to allow space for bookkeeping overhead)  when it is set using "
9632 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9633 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9634 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9635 "file.  The minimum (doubled) value for this option is 2048."
9636 msgstr ""
9637 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9638 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9639 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9640 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9641 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9642 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9643
9644 #. type: TP
9645 #: build/C/man7/socket.7:685
9646 #, no-wrap
9647 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9648 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9649
9650 #. type: Plain text
9651 #: build/C/man7/socket.7:694
9652 msgid ""
9653 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9654 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9655 "overridden."
9656 msgstr ""
9657 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9658 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9659 "きすることができる。"
9660
9661 #. type: TP
9662 #: build/C/man7/socket.7:694
9663 #, no-wrap
9664 msgid "B<SO_TIMESTAMP>"
9665 msgstr "B<SO_TIMESTAMP>"
9666
9667 #. type: Plain text
9668 #: build/C/man7/socket.7:710
9669 msgid ""
9670 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9671 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9672 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9673 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9674 "details on control messages."
9675 msgstr ""
9676 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9677 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9678 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9679 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9680
9681 #. type: TP
9682 #: build/C/man7/socket.7:710
9683 #, no-wrap
9684 msgid "B<SO_TYPE>"
9685 msgstr "B<SO_TYPE>"
9686
9687 #. type: Plain text
9688 #: build/C/man7/socket.7:715
9689 msgid ""
9690 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9691 "option is read-only."
9692 msgstr ""
9693 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9694 "このソケットオプションは読み出し専用である。"
9695
9696 #. type: TP
9697 #: build/C/man7/socket.7:715
9698 #, no-wrap
9699 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9700 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9701
9702 #. type: Plain text
9703 #: build/C/man7/socket.7:724
9704 msgid ""
9705 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9706 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9707 "The default for this option is controlled by the I</proc/sys/net/core/"
9708 "busy_read> file."
9709 msgstr ""
9710 "データがなかった際にブロッキング受信での busy polling のおおよその時間をマイ"
9711 "クロ秒単位で設定する。 この値を増やすには B<CAP_NET_ADMIN> ケーパビリティが必"
9712 "要である。 このオプションのデフォルト値は I</proc/sys/net/core/busy_read> で"
9713 "制御できる。"
9714
9715 #. type: Plain text
9716 #: build/C/man7/socket.7:734
9717 msgid ""
9718 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9719 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9720 "with B<SO_BUSY_POLL> set and no events to report are found."
9721 msgstr ""
9722 "I</proc/sys/net/core/busy_poll> の値により、 B<SO_BUSY_POLL> がセットされたソ"
9723 "ケットに対して B<select>(2) や B<poll>(2) を行い、報告すべきイベントがない場"
9724 "合に、 B<select>(2) や B<poll>(2) が busy polling をどのくらいの時間行うかが"
9725 "決まる。"
9726
9727 #. type: Plain text
9728 #: build/C/man7/socket.7:738
9729 msgid ""
9730 "In both cases, busy polling will only be done when the socket last received "
9731 "data from a network device that supports this option."
9732 msgstr ""
9733 "どちらの場合も、busy polling は、そのソケットが最後にデータを受信したネット"
9734 "ワークデバイスがこのオプションに対応している場合のみ行われる。"
9735
9736 #. type: Plain text
9737 #: build/C/man7/socket.7:742
9738 msgid ""
9739 "While busy polling may improve latency of some applications, care must be "
9740 "taken when using it since this will increase both CPU utilization and power "
9741 "usage."
9742 msgstr ""
9743 "busy polling により遅延が改善されるはアプリケーションもあるが、 busy polling "
9744 "は CPU 使用率と電力使用量をともに増加させることになるので、使用する際は注意し"
9745 "て行うこと。"
9746
9747 #. type: SS
9748 #: build/C/man7/socket.7:742
9749 #, no-wrap
9750 msgid "Signals"
9751 msgstr "シグナル"
9752
9753 #. type: Plain text
9754 #: build/C/man7/socket.7:753
9755 msgid ""
9756 "When writing onto a connection-oriented socket that has been shut down (by "
9757 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9758 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9759 "the B<MSG_NOSIGNAL> flag."
9760 msgstr ""
9761 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9762 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9763 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9764 "していた場合はシグナルは送られない。"
9765
9766 #. type: Plain text
9767 #: build/C/man7/socket.7:778
9768 msgid ""
9769 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> "
9770 "B<ioctl>(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to "
9771 "use B<poll>(2)  or B<select>(2)  in the signal handler to find out which "
9772 "socket the event occurred on.  An alternative (in Linux 2.2) is to set a "
9773 "real-time signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real "
9774 "time signal will be called with the file descriptor in the I<si_fd> field of "
9775 "its I<siginfo_t>.  See B<fcntl>(2)  for more information."
9776 msgstr ""
9777 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9778 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9779 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9780 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9781 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9782 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9783 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9784 "を参照のこと。"
9785
9786 #.  .SS Ancillary messages
9787 #. type: Plain text
9788 #: build/C/man7/socket.7:786
9789 msgid ""
9790 "Under some circumstances (e.g., multiple processes accessing a single "
9791 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9792 "when the process reacts to the signal.  If this happens, the process should "
9793 "wait again because Linux will resend the signal later."
9794 msgstr ""
9795 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9796 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9797 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9798 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9799
9800 #. type: SS
9801 #: build/C/man7/socket.7:786
9802 #, no-wrap
9803 msgid "/proc interfaces"
9804 msgstr "/proc インタフェース"
9805
9806 #. type: Plain text
9807 #: build/C/man7/socket.7:790
9808 msgid ""
9809 "The core socket networking parameters can be accessed via files in the "
9810 "directory I</proc/sys/net/core/>."
9811 msgstr ""
9812 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9813 "レクトリ内のファイルを通してアクセスできる。"
9814
9815 #. type: TP
9816 #: build/C/man7/socket.7:790
9817 #, no-wrap
9818 msgid "I<rmem_default>"
9819 msgstr "I<rmem_default>"
9820
9821 #. type: Plain text
9822 #: build/C/man7/socket.7:793
9823 msgid "contains the default setting in bytes of the socket receive buffer."
9824 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9825
9826 #. type: TP
9827 #: build/C/man7/socket.7:793
9828 #, no-wrap
9829 msgid "I<rmem_max>"
9830 msgstr "I<rmem_max>"
9831
9832 #. type: Plain text
9833 #: build/C/man7/socket.7:799
9834 msgid ""
9835 "contains the maximum socket receive buffer size in bytes which a user may "
9836 "set by using the B<SO_RCVBUF> socket option."
9837 msgstr ""
9838 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9839 "ファサイズの最大値 (バイト単位)。"
9840
9841 #. type: TP
9842 #: build/C/man7/socket.7:799
9843 #, no-wrap
9844 msgid "I<wmem_default>"
9845 msgstr "I<wmem_default>"
9846
9847 #. type: Plain text
9848 #: build/C/man7/socket.7:802
9849 msgid "contains the default setting in bytes of the socket send buffer."
9850 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9851
9852 #. type: TP
9853 #: build/C/man7/socket.7:802
9854 #, no-wrap
9855 msgid "I<wmem_max>"
9856 msgstr "I<wmem_max>"
9857
9858 #. type: Plain text
9859 #: build/C/man7/socket.7:808
9860 msgid ""
9861 "contains the maximum socket send buffer size in bytes which a user may set "
9862 "by using the B<SO_SNDBUF> socket option."
9863 msgstr ""
9864 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9865 "ファサイズの最大値 (バイト単位)。"
9866
9867 #. type: TP
9868 #: build/C/man7/socket.7:808
9869 #, no-wrap
9870 msgid "I<message_cost> and I<message_burst>"
9871 msgstr "I<message_cost> と I<message_burst>"
9872
9873 #. type: Plain text
9874 #: build/C/man7/socket.7:812
9875 msgid ""
9876 "configure the token bucket filter used to load limit warning messages caused "
9877 "by external network events."
9878 msgstr ""
9879 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9880 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9881
9882 #. type: TP
9883 #: build/C/man7/socket.7:812
9884 #, no-wrap
9885 msgid "I<netdev_max_backlog>"
9886 msgstr "I<netdev_max_backlog>"
9887
9888 #. type: Plain text
9889 #: build/C/man7/socket.7:815
9890 msgid "Maximum number of packets in the global input queue."
9891 msgstr "グローバルな入力キューにおける最大のパケット数。"
9892
9893 #. type: TP
9894 #: build/C/man7/socket.7:815
9895 #, no-wrap
9896 msgid "I<optmem_max>"
9897 msgstr "I<optmem_max>"
9898
9899 #.  netdev_fastroute is not documented because it is experimental
9900 #. type: Plain text
9901 #: build/C/man7/socket.7:820
9902 msgid ""
9903 "Maximum length of ancillary data and user control data like the iovecs per "
9904 "socket."
9905 msgstr ""
9906 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9907 "うなもの) との和の最大長。"
9908
9909 #. type: SS
9910 #: build/C/man7/socket.7:820
9911 #, no-wrap
9912 msgid "Ioctls"
9913 msgstr "ioctl"
9914
9915 #. type: Plain text
9916 #: build/C/man7/socket.7:823
9917 msgid "These operations can be accessed using B<ioctl>(2):"
9918 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9919
9920 #. type: Plain text
9921 #: build/C/man7/socket.7:827
9922 #, no-wrap
9923 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9924 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9925
9926 #. type: TP
9927 #: build/C/man7/socket.7:829
9928 #, no-wrap
9929 msgid "B<SIOCGSTAMP>"
9930 msgstr "B<SIOCGSTAMP>"
9931
9932 #. type: Plain text
9933 #: build/C/man7/socket.7:853
9934 msgid ""
9935 "Return a I<struct timeval> with the receive timestamp of the last packet "
9936 "passed to the user.  This is useful for accurate round trip time "
9937 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9938 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9939 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9940 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9941 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9942 "to B<ENOENT>)."
9943 msgstr ""
9944 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9945 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9946 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9947 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9948 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9949 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9950 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9951 "セットする)。"
9952
9953 #. type: TP
9954 #: build/C/man7/socket.7:853
9955 #, no-wrap
9956 msgid "B<SIOCSPGRP>"
9957 msgstr "B<SIOCSPGRP>"
9958
9959 #. type: Plain text
9960 #: build/C/man7/socket.7:872
9961 msgid ""
9962 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9963 "when an asynchronous I/O operation has finished or urgent data is "
9964 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9965 "positive, send the signals to that process.  If the argument is negative, "
9966 "send the signals to the process group with the ID of the absolute value of "
9967 "the argument.  The process may only choose itself or its own process group "
9968 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9969 "UID of 0."
9970 msgstr ""
9971 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9972 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9973 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9974 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9975 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9976 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9977 "の場合は この限りではない。"
9978
9979 #. type: TP
9980 #: build/C/man7/socket.7:872
9981 #, no-wrap
9982 msgid "B<FIOASYNC>"
9983 msgstr "B<FIOASYNC>"
9984
9985 #. type: Plain text
9986 #: build/C/man7/socket.7:882
9987 msgid ""
9988 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
9989 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
9990 "set with B<F_SETSIG> is raised when a new I/O event occurs."
9991 msgstr ""
9992 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
9993 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
9994 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
9995
9996 #. type: Plain text
9997 #: build/C/man7/socket.7:890
9998 msgid ""
9999 "Argument is an integer boolean flag.  (This operation is synonymous with the "
10000 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
10001 msgstr ""
10002 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
10003 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10004
10005 #. type: TP
10006 #: build/C/man7/socket.7:890
10007 #, no-wrap
10008 msgid "B<SIOCGPGRP>"
10009 msgstr "B<SIOCGPGRP>"
10010
10011 #. type: Plain text
10012 #: build/C/man7/socket.7:899
10013 msgid ""
10014 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10015 "signals, or 0 when none is set."
10016 msgstr ""
10017 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
10018 "る。 ない場合は 0 が返る。"
10019
10020 #. type: Plain text
10021 #: build/C/man7/socket.7:903
10022 msgid "Valid B<fcntl>(2)  operations:"
10023 msgstr "有効な B<fcntl>(2)  操作:"
10024
10025 #. type: TP
10026 #: build/C/man7/socket.7:903
10027 #, no-wrap
10028 msgid "B<FIOGETOWN>"
10029 msgstr "B<FIOGETOWN>"
10030
10031 #. type: Plain text
10032 #: build/C/man7/socket.7:908
10033 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10034 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
10035
10036 #. type: TP
10037 #: build/C/man7/socket.7:908
10038 #, no-wrap
10039 msgid "B<FIOSETOWN>"
10040 msgstr "B<FIOSETOWN>"
10041
10042 #. type: Plain text
10043 #: build/C/man7/socket.7:913
10044 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10045 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
10046
10047 #. type: Plain text
10048 #: build/C/man7/socket.7:927
10049 msgid ""
10050 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
10051 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
10052 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
10053 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10054 "be read or written."
10055 msgstr ""
10056 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10057 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
10058 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10059 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10060 "はできなかった。"
10061
10062 #. type: Plain text
10063 #: build/C/man7/socket.7:932
10064 msgid ""
10065 "Linux assumes that half of the send/receive buffer is used for internal "
10066 "kernel structures; thus the values in the corresponding I</proc> files are "
10067 "twice what can be observed on the wire."
10068 msgstr ""
10069 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
10070 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
10071 "なる。"
10072
10073 #. type: Plain text
10074 #: build/C/man7/socket.7:945
10075 msgid ""
10076 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
10077 "option was set both in the previous program that performed a B<bind>(2)  to "
10078 "the port and in the program that wants to reuse the port.  This differs from "
10079 "some implementations (e.g., FreeBSD)  where only the later program needs to "
10080 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
10081 "since, for example, a server program is designed to always set this option."
10082 msgstr ""
10083 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10084 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
10085 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10086 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10087 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10088 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10089 "このオプションをセットするように設計されるからである。"
10090
10091 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10092 #.  .SH AUTHORS
10093 #.  This man page was written by Andi Kleen.
10094 #. type: Plain text
10095 #: build/C/man7/socket.7:958
10096 msgid ""
10097 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10098 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
10099 "is via the libpcap library."
10100 msgstr ""
10101 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10102 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10103 "して 用いる方が良い。"
10104
10105 #. type: Plain text
10106 #: build/C/man7/socket.7:970
10107 msgid ""
10108 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10109 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10110 "B<unix>(7)"
10111 msgstr ""
10112 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10113 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10114 "B<unix>(7)"
10115
10116 #. type: TH
10117 #: build/C/man2/socketcall.2:25
10118 #, no-wrap
10119 msgid "SOCKETCALL"
10120 msgstr "SOCKETCALL"
10121
10122 #. type: TH
10123 #: build/C/man2/socketcall.2:25
10124 #, no-wrap
10125 msgid "2012-10-16"
10126 msgstr "2012-10-16"
10127
10128 #. type: Plain text
10129 #: build/C/man2/socketcall.2:28
10130 msgid "socketcall - socket system calls"
10131 msgstr "socketcall - ソケット・システムコール"
10132
10133 #. type: Plain text
10134 #: build/C/man2/socketcall.2:30
10135 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10136 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10137
10138 #. type: Plain text
10139 #: build/C/man2/socketcall.2:38
10140 msgid ""
10141 "B<socketcall>()  is a common kernel entry point for the socket system "
10142 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10143 "to a block containing the actual arguments, which are passed through to the "
10144 "appropriate call."
10145 msgstr ""
10146 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
10147 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10148 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10149 "ロックを指す。"
10150
10151 #. type: Plain text
10152 #: build/C/man2/socketcall.2:42
10153 msgid ""
10154 "User programs should call the appropriate functions by their usual names.  "
10155 "Only standard library implementors and kernel hackers need to know about "
10156 "B<socketcall>()."
10157 msgstr ""
10158 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10159 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
10160 "必要がある。"
10161
10162 #. type: Plain text
10163 #: build/C/man2/socketcall.2:45
10164 msgid ""
10165 "This call is specific to Linux, and should not be used in programs intended "
10166 "to be portable."
10167 msgstr ""
10168 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10169 "い。"
10170
10171 #. type: Plain text
10172 #: build/C/man2/socketcall.2:53
10173 msgid ""
10174 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10175 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), "
10176 "B<bind>(2), and so on really are implemented as separate system calls."
10177 msgstr ""
10178 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10179 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10180 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10181
10182 #. type: Plain text
10183 #: build/C/man2/socketcall.2:71
10184 msgid ""
10185 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10186 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10187 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10188 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10189 msgstr ""
10190 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10191 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10192 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10193 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10194
10195 #. type: TH
10196 #: build/C/man2/socketpair.2:42
10197 #, no-wrap
10198 msgid "SOCKETPAIR"
10199 msgstr "SOCKETPAIR"
10200
10201 #. type: TH
10202 #: build/C/man2/socketpair.2:42
10203 #, no-wrap
10204 msgid "2008-10-11"
10205 msgstr "2008-10-11"
10206
10207 #. type: Plain text
10208 #: build/C/man2/socketpair.2:45
10209 msgid "socketpair - create a pair of connected sockets"
10210 msgstr "socketpair - 接続されたソケットのペアを作成する"
10211
10212 #. type: Plain text
10213 #: build/C/man2/socketpair.2:52
10214 msgid ""
10215 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10216 ">I<sv>B<[2]);>"
10217 msgstr ""
10218 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10219 ">I<sv>B<[2]);>"
10220
10221 #. type: Plain text
10222 #: build/C/man2/socketpair.2:63
10223 msgid ""
10224 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10225 "the specified I<domain>, of the specified I<type>, and using the optionally "
10226 "specified I<protocol>.  For further details of these arguments, see "
10227 "B<socket>(2)."
10228 msgstr ""
10229 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10230 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10231 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10232
10233 #. type: Plain text
10234 #: build/C/man2/socketpair.2:69
10235 msgid ""
10236 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10237 "and I<sv>[1].  The two sockets are indistinguishable."
10238 msgstr ""
10239 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10240 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10241
10242 #. type: Plain text
10243 #: build/C/man2/socketpair.2:78
10244 msgid "The specified address family is not supported on this machine."
10245 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10246
10247 #. type: Plain text
10248 #: build/C/man2/socketpair.2:83
10249 msgid ""
10250 "The address I<sv> does not specify a valid part of the process address space."
10251 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10252
10253 #. type: Plain text
10254 #: build/C/man2/socketpair.2:86
10255 msgid "Too many descriptors are in use by this process."
10256 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10257
10258 #. type: Plain text
10259 #: build/C/man2/socketpair.2:92
10260 msgid "The specified protocol does not support creation of socket pairs."
10261 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10262
10263 #. type: Plain text
10264 #: build/C/man2/socketpair.2:95
10265 msgid "The specified protocol is not supported on this machine."
10266 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10267
10268 #. type: Plain text
10269 #: build/C/man2/socketpair.2:103
10270 msgid ""
10271 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10272 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10273 "of the BSD socket layer (including System\\ V variants)."
10274 msgstr ""
10275 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10276 "に (System\\ V の変種を含めて)  BSD のソケット層のクローンをサポートしてい"
10277 "る、BSD 以外のシステムと、 互いに移植性がある。"
10278
10279 #. type: Plain text
10280 #: build/C/man2/socketpair.2:109
10281 msgid ""
10282 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10283 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10284 "restriction.)"
10285 msgstr ""
10286 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10287 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10288
10289 #. type: Plain text
10290 #: build/C/man2/socketpair.2:118
10291 msgid ""
10292 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10293 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10294 msgstr ""
10295 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10296 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10297
10298 #. type: Plain text
10299 #: build/C/man2/socketpair.2:131
10300 msgid ""
10301 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10302 msgstr ""
10303 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"