OSDN Git Service

Update version in ja.po to 3.78
[linuxjm/LDP_man-pages.git] / po4a / socket / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2015-01-23 22:22+0900\n"
10 "PO-Revision-Date: 2015-01-23 22: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:58 build/C/man2/socketcall.2:25
38 #: build/C/man2/socketpair.2:42
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:41 build/C/man2/bind.2:68
45 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:67
46 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:40
47 #: build/C/man2/getsockopt.2:44 build/C/man3/if_nameindex.3:26
48 #: build/C/man3/if_nametoindex.3:25 build/C/man2/listen.2:45
49 #: build/C/man2/recv.2:41 build/C/man2/recvmmsg.2:31 build/C/man2/select.2:38
50 #: build/C/man2/select_tut.2:32 build/C/man2/send.2:40
51 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:25
52 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
53 #: build/C/man2/socketcall.2:25 build/C/man2/socketpair.2:42
54 #, no-wrap
55 msgid "Linux Programmer's Manual"
56 msgstr "Linux Programmer's Manual"
57
58 #. type: SH
59 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
60 #: build/C/man3/bindresvport.3:31 build/C/man2/connect.2:68
61 #: build/C/man3/getifaddrs.3:37 build/C/man2/getsockname.2:41
62 #: build/C/man2/getsockopt.2:45 build/C/man3/if_nameindex.3:27
63 #: build/C/man3/if_nametoindex.3:26 build/C/man2/listen.2:46
64 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:32 build/C/man2/select.2:39
65 #: build/C/man2/select_tut.2:33 build/C/man2/send.2:41
66 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:26
67 #: build/C/man2/socket.2:44 build/C/man7/socket.7:59
68 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:43
69 #, no-wrap
70 msgid "NAME"
71 msgstr "名前"
72
73 #. type: Plain text
74 #: build/C/man2/accept.2:44
75 msgid "accept, accept4 - accept a connection on a socket"
76 msgstr "accept, accept4 - ソケットへの接続を受ける"
77
78 #. type: SH
79 #: build/C/man2/accept.2:44 build/C/man2/bind.2:71
80 #: build/C/man3/bindresvport.3:33 build/C/man2/connect.2:70
81 #: build/C/man3/getifaddrs.3:39 build/C/man2/getsockname.2:43
82 #: build/C/man2/getsockopt.2:47 build/C/man3/if_nameindex.3:29
83 #: build/C/man3/if_nametoindex.3:29 build/C/man2/listen.2:48
84 #: build/C/man2/recv.2:44 build/C/man2/recvmmsg.2:34 build/C/man2/select.2:42
85 #: build/C/man2/select_tut.2:36 build/C/man2/send.2:43
86 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:28
87 #: build/C/man2/socket.2:46 build/C/man7/socket.7:61
88 #: build/C/man2/socketcall.2:28 build/C/man2/socketpair.2:45
89 #, no-wrap
90 msgid "SYNOPSIS"
91 msgstr "書式"
92
93 #. type: Plain text
94 #: build/C/man2/accept.2:48 build/C/man2/bind.2:75
95 #, no-wrap
96 msgid ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99 msgstr ""
100 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
101 "B<#include E<lt>sys/socket.hE<gt>>\n"
102
103 #. type: Plain text
104 #: build/C/man2/accept.2:50
105 #, no-wrap
106 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
107 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
108
109 #. type: Plain text
110 #: build/C/man2/accept.2:53
111 #, no-wrap
112 msgid ""
113 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115 msgstr ""
116 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
117 "B<#include E<lt>sys/socket.hE<gt>>\n"
118
119 #. type: Plain text
120 #: build/C/man2/accept.2:56
121 #, no-wrap
122 msgid ""
123 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
124 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
125 msgstr ""
126 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
127 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
128
129 #. type: SH
130 #: build/C/man2/accept.2:57 build/C/man2/bind.2:79
131 #: build/C/man3/bindresvport.3:40 build/C/man2/connect.2:79
132 #: build/C/man3/getifaddrs.3:48 build/C/man2/getsockname.2:50
133 #: build/C/man2/getsockopt.2:58 build/C/man3/if_nameindex.3:36
134 #: build/C/man3/if_nametoindex.3:37 build/C/man2/listen.2:56
135 #: build/C/man2/recv.2:59 build/C/man2/recvmmsg.2:44 build/C/man2/select.2:81
136 #: build/C/man2/select_tut.2:75 build/C/man2/send.2:58
137 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:42
138 #: build/C/man2/socket.2:52 build/C/man7/socket.7:65
139 #: build/C/man2/socketcall.2:30 build/C/man2/socketpair.2:52
140 #, no-wrap
141 msgid "DESCRIPTION"
142 msgstr "説明"
143
144 #. type: Plain text
145 #: build/C/man2/accept.2:72
146 msgid ""
147 "The B<accept>()  system call is used with connection-based socket types "
148 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
149 "request on the queue of pending connections for the listening socket, "
150 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
151 "referring to that socket.  The newly created socket is not in the listening "
152 "state.  The original socket I<sockfd> is unaffected by this call."
153 msgstr ""
154 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
155 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
156 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
157 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
158 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
159 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
160
161 #. type: Plain text
162 #: build/C/man2/accept.2:81
163 msgid ""
164 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
165 "bound to a local address with B<bind>(2), and is listening for connections "
166 "after a B<listen>(2)."
167 msgstr ""
168 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
169 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
170 "である。"
171
172 #. type: Plain text
173 #: build/C/man2/accept.2:99
174 msgid ""
175 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
176 "structure is filled in with the address of the peer socket, as known to the "
177 "communications layer.  The exact format of the address returned I<addr> is "
178 "determined by the socket's address family (see B<socket>(2)  and the "
179 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
180 "in this case, I<addrlen> is not used, and should also be NULL."
181 msgstr ""
182 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
183 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
184 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
185 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
186 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
187 "おくべきである。"
188
189 #. type: Plain text
190 #: build/C/man2/accept.2:107
191 msgid ""
192 "The I<addrlen> argument is a value-result argument: the caller must "
193 "initialize it to contain the size (in bytes) of the structure pointed to by "
194 "I<addr>; on return it will contain the actual size of the peer address."
195 msgstr ""
196 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
197 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
198 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
199
200 #. type: Plain text
201 #: build/C/man2/accept.2:112 build/C/man2/getsockname.2:67
202 msgid ""
203 "The returned address is truncated if the buffer provided is too small; in "
204 "this case, I<addrlen> will return a value greater than was supplied to the "
205 "call."
206 msgstr ""
207 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
208 "る。\n"
209 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
210 "される。"
211
212 #. type: Plain text
213 #: build/C/man2/accept.2:125
214 msgid ""
215 "If no pending connections are present on the queue, and the socket is not "
216 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
217 "present.  If the socket is marked nonblocking and no pending connections are "
218 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
219 "B<EWOULDBLOCK>."
220 msgstr ""
221 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
222 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
223 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
224 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
225
226 #. type: Plain text
227 #: build/C/man2/accept.2:139
228 msgid ""
229 "In order to be notified of incoming connections on a socket, you can use "
230 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
231 "connection is attempted and you may then call B<accept>()  to get a socket "
232 "for that connection.  Alternatively, you can set the socket to deliver "
233 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
234 msgstr ""
235 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
236 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
237 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
238 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
239 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
240
241 #. type: Plain text
242 #: build/C/man2/accept.2:152
243 msgid ""
244 "For certain protocols which require an explicit confirmation, such as "
245 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
246 "connection request and not implying confirmation.  Confirmation can be "
247 "implied by a normal read or write on the new file descriptor, and rejection "
248 "can be implied by closing the new socket.  Currently only DECNet has these "
249 "semantics on Linux."
250 msgstr ""
251 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
252 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
253 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
254 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
255 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
256 "セマンティクスを持つのは DECNet だけである。"
257
258 #. type: Plain text
259 #: build/C/man2/accept.2:162
260 msgid ""
261 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
262 "following values can be bitwise ORed in I<flags> to obtain different "
263 "behavior:"
264 msgstr ""
265 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
266 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
267 "できる。"
268
269 #. type: TP
270 #: build/C/man2/accept.2:162 build/C/man2/socket.2: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:300 build/C/man2/select_tut.2:485
311 #: build/C/man2/send.2:294 build/C/man2/sendmmsg.2:119
312 #: build/C/man3/sockatmark.3:51 build/C/man2/socket.2: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:318 build/C/man2/send.2:299
363 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:58
364 #: build/C/man2/socket.2: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:319 build/C/man2/send.2:336
394 #: build/C/man3/sockatmark.3:59
395 #, no-wrap
396 msgid "B<EBADF>"
397 msgstr "B<EBADF>"
398
399 #. type: Plain text
400 #: build/C/man2/accept.2:226
401 msgid "The descriptor is invalid."
402 msgstr "ディスクリプタが不正。"
403
404 #. type: TP
405 #: build/C/man2/accept.2:226
406 #, no-wrap
407 msgid "B<ECONNABORTED>"
408 msgstr "B<ECONNABORTED>"
409
410 #. type: Plain text
411 #: build/C/man2/accept.2:229
412 msgid "A connection has been aborted."
413 msgstr "接続が中止された。"
414
415 #. type: TP
416 #: build/C/man2/accept.2:229 build/C/man2/bind.2:208
417 #: build/C/man2/connect.2:182 build/C/man2/getsockname.2:78
418 #: build/C/man2/getsockopt.2:142 build/C/man2/recv.2:447
419 #: build/C/man2/send.2:345 build/C/man2/socketpair.2:78
420 #, no-wrap
421 msgid "B<EFAULT>"
422 msgstr "B<EFAULT>"
423
424 #. type: Plain text
425 #: build/C/man2/accept.2:234
426 msgid ""
427 "The I<addr> argument is not in a writable part of the user address space."
428 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
429
430 #. type: TP
431 #: build/C/man2/accept.2:234 build/C/man2/connect.2:210
432 #: build/C/man2/recv.2:451 build/C/man2/select.2:324 build/C/man2/send.2:348
433 #, no-wrap
434 msgid "B<EINTR>"
435 msgstr "B<EINTR>"
436
437 #. type: Plain text
438 #: build/C/man2/accept.2:239
439 msgid ""
440 "The system call was interrupted by a signal that was caught before a valid "
441 "connection arrived; see B<signal>(7)."
442 msgstr ""
443 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
444 "た。 B<signal>(7)  参照。"
445
446 #. type: TP
447 #: build/C/man2/accept.2:239 build/C/man2/accept.2:244 build/C/man2/bind.2:180
448 #: build/C/man2/bind.2:185 build/C/man2/getsockname.2:84
449 #: build/C/man2/getsockopt.2:152 build/C/man2/recv.2:456
450 #: build/C/man2/recvmmsg.2:160 build/C/man2/select.2:328
451 #: build/C/man2/select.2:335 build/C/man2/send.2:352
452 #: build/C/man3/sockatmark.3:63 build/C/man2/socket.2:323
453 #: build/C/man2/socket.2:326
454 #, no-wrap
455 msgid "B<EINVAL>"
456 msgstr "B<EINVAL>"
457
458 #. type: Plain text
459 #: build/C/man2/accept.2:244
460 msgid ""
461 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
462 "negative)."
463 msgstr ""
464 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
465 "負の場合など)。"
466
467 #. type: Plain text
468 #: build/C/man2/accept.2:249
469 msgid "(B<accept4>())  invalid value in I<flags>."
470 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
471
472 #. type: TP
473 #: build/C/man2/accept.2:249 build/C/man2/socket.2:331
474 #: build/C/man2/socketpair.2:83
475 #, no-wrap
476 msgid "B<EMFILE>"
477 msgstr "B<EMFILE>"
478
479 #. type: Plain text
480 #: build/C/man2/accept.2:252
481 msgid "The per-process limit of open file descriptors has been reached."
482 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
483
484 #. type: TP
485 #: build/C/man2/accept.2:252 build/C/man2/socket.2:334
486 #: build/C/man2/socketpair.2:86
487 #, no-wrap
488 msgid "B<ENFILE>"
489 msgstr "B<ENFILE>"
490
491 #. type: Plain text
492 #: build/C/man2/accept.2:255 build/C/man2/socket.2:337
493 #: build/C/man2/socketpair.2:89
494 msgid "The system limit on the total number of open files has been reached."
495 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
496
497 #. type: TP
498 #: build/C/man2/accept.2:255
499 #, no-wrap
500 msgid "B<ENOBUFS>, B<ENOMEM>"
501 msgstr "B<ENOBUFS>, B<ENOMEM>"
502
503 #. type: Plain text
504 #: build/C/man2/accept.2:260
505 msgid ""
506 "Not enough free memory.  This often means that the memory allocation is "
507 "limited by the socket buffer limits, not by the system memory."
508 msgstr ""
509 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
510 "ケットバッファの大きさによるメモリ割り当ての制限である。"
511
512 #. type: TP
513 #: build/C/man2/accept.2:260 build/C/man2/bind.2:191
514 #: build/C/man2/connect.2:222 build/C/man2/getsockname.2:92
515 #: build/C/man2/getsockopt.2:166 build/C/man2/listen.2:109
516 #: build/C/man2/recv.2:471 build/C/man2/send.2:381
517 #, no-wrap
518 msgid "B<ENOTSOCK>"
519 msgstr "B<ENOTSOCK>"
520
521 #. type: Plain text
522 #: build/C/man2/accept.2:263
523 msgid "The descriptor references a file, not a socket."
524 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
525
526 #. type: TP
527 #: build/C/man2/accept.2:263 build/C/man2/listen.2:114 build/C/man2/send.2:386
528 #: build/C/man2/socketpair.2:89
529 #, no-wrap
530 msgid "B<EOPNOTSUPP>"
531 msgstr "B<EOPNOTSUPP>"
532
533 #. type: Plain text
534 #: build/C/man2/accept.2:267
535 msgid "The referenced socket is not of type B<SOCK_STREAM>."
536 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
537
538 #. type: TP
539 #: build/C/man2/accept.2:267
540 #, no-wrap
541 msgid "B<EPROTO>"
542 msgstr "B<EPROTO>"
543
544 #. type: Plain text
545 #: build/C/man2/accept.2:270
546 msgid "Protocol error."
547 msgstr "プロトコル・エラー。"
548
549 #. type: Plain text
550 #: build/C/man2/accept.2:274
551 msgid "In addition, Linux B<accept>()  may fail if:"
552 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
553
554 #. type: TP
555 #: build/C/man2/accept.2:274
556 #, no-wrap
557 msgid "B<EPERM>"
558 msgstr "B<EPERM>"
559
560 #. type: Plain text
561 #: build/C/man2/accept.2:277
562 msgid "Firewall rules forbid connection."
563 msgstr "ファイアウォールのルールにより接続が禁止された。"
564
565 #. type: Plain text
566 #: build/C/man2/accept.2:289
567 msgid ""
568 "In addition, network errors for the new socket and as defined for the "
569 "protocol may be returned.  Various Linux kernels can return other errors "
570 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
571 "value B<ERESTARTSYS> may be seen during a trace."
572 msgstr ""
573 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
574 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
575 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
576 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
577 "ともある。"
578
579 #. type: SH
580 #: build/C/man2/accept.2:289 build/C/man3/getifaddrs.3:162
581 #: build/C/man3/if_nameindex.3:97 build/C/man2/recvmmsg.2:164
582 #: build/C/man2/select.2:343 build/C/man2/sendmmsg.2:145
583 #: build/C/man3/sockatmark.3:70 build/C/man7/socket.7:915
584 #, no-wrap
585 msgid "VERSIONS"
586 msgstr "バージョン"
587
588 #. type: Plain text
589 #: build/C/man2/accept.2:294
590 msgid ""
591 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
592 "support in glibc is available starting with version 2.10."
593 msgstr ""
594 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
595 "サポートはバージョン 2.10 以降で利用可能である。"
596
597 #. type: SH
598 #: build/C/man2/accept.2:294 build/C/man2/bind.2:232
599 #: build/C/man3/bindresvport.3:104 build/C/man2/connect.2:237
600 #: build/C/man3/getifaddrs.3:170 build/C/man2/getsockname.2:97
601 #: build/C/man2/getsockopt.2:171 build/C/man3/if_nameindex.3:104
602 #: build/C/man3/if_nametoindex.3:92 build/C/man2/listen.2:119
603 #: build/C/man2/recv.2:476 build/C/man2/recvmmsg.2:169
604 #: build/C/man2/select.2:349 build/C/man2/send.2:400
605 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:78
606 #: build/C/man2/socket.2:348 build/C/man2/socketcall.2:42
607 #: build/C/man2/socketpair.2:95
608 #, no-wrap
609 msgid "CONFORMING TO"
610 msgstr "準拠"
611
612 #.  The BSD man page documents five possible error returns
613 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
614 #.  POSIX.1-2001 documents errors
615 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
616 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
617 #.  In addition, SUSv2 documents EFAULT and ENOSR.
618 #. type: Plain text
619 #: build/C/man2/accept.2:306
620 msgid ""
621 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
622 "4.2BSD)."
623 msgstr ""
624 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
625 "された)."
626
627 #. type: Plain text
628 #: build/C/man2/accept.2:309
629 msgid "B<accept4>()  is a nonstandard Linux extension."
630 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
631
632 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
633 #.  do not inherit file status flags -- MTK Jun 05
634 #. type: Plain text
635 #: build/C/man2/accept.2:324
636 msgid ""
637 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
638 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
639 "socket.  This behavior differs from the canonical BSD sockets "
640 "implementation.  Portable programs should not rely on inheritance or "
641 "noninheritance of file status flags and always explicitly set all required "
642 "flags on the socket returned from B<accept>()."
643 msgstr ""
644 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
645 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
646 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
647 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に "
648 "B<accept>()  が返したソケットに対して全ての必要なフラグを明示的に設定するよう"
649 "に すべきである。"
650
651 #. type: SH
652 #: build/C/man2/accept.2:324 build/C/man2/bind.2:244
653 #: build/C/man3/bindresvport.3:107 build/C/man2/connect.2:253
654 #: build/C/man3/getifaddrs.3:190 build/C/man2/getsockname.2:103
655 #: build/C/man2/getsockopt.2:178 build/C/man2/listen.2:124
656 #: build/C/man2/recv.2:486 build/C/man2/select.2:364
657 #: build/C/man2/select_tut.2:503 build/C/man2/send.2:414
658 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:80
659 #: build/C/man2/socket.2:362 build/C/man7/socket.7:929
660 #: build/C/man2/socketcall.2:45 build/C/man2/socketpair.2:103
661 #, no-wrap
662 msgid "NOTES"
663 msgstr "注意"
664
665 #. type: Plain text
666 #: build/C/man2/accept.2:330 build/C/man2/bind.2:250
667 #: build/C/man2/connect.2:259 build/C/man2/getsockopt.2:184
668 #: build/C/man2/listen.2:150 build/C/man2/socket.2:368
669 #: build/C/man2/socketpair.2:124
670 msgid ""
671 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
672 "this header file is not required on Linux.  However, some historical (BSD) "
673 "implementations required this header file, and portable applications are "
674 "probably wise to include it."
675 msgstr ""
676 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
677 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
678 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
679 "ションではこのファイルを インクルードするのが賢明であろう。"
680
681 #. type: Plain text
682 #: build/C/man2/accept.2:351
683 msgid ""
684 "There may not always be a connection waiting after a B<SIGIO> is delivered "
685 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
686 "connection might have been removed by an asynchronous network error or "
687 "another thread before B<accept>()  is called.  If this happens, then the "
688 "call will block waiting for the next connection to arrive.  To ensure that "
689 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
690 "B<O_NONBLOCK> flag set (see B<socket>(7))."
691 msgstr ""
692 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
693 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
694 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
695 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
696 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
697 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
698 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
699 "見よ)。"
700
701 #. type: SS
702 #: build/C/man2/accept.2:351
703 #, no-wrap
704 msgid "The socklen_t type"
705 msgstr "socklen_t 型"
706
707 #. type: Plain text
708 #: build/C/man2/accept.2:361
709 msgid ""
710 "The third argument of B<accept>()  was originally declared as an I<int *> "
711 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
712 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
713 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
714 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
715 "Torvalds:"
716 msgstr ""
717 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
718 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
719 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
720 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
721 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
722 "た。 Linus Torvald の発言を引用する:"
723
724 #.  .I fails: only italicizes a single line
725 #. type: Plain text
726 #: build/C/man2/accept.2:378
727 msgid ""
728 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
729 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
730 "make it a size_t, and I (and hopefully others, but obviously not too many) "
731 "complained to them very loudly indeed.  Making it a size_t is completely "
732 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
733 "bit architectures, for example.  And it I<has> to be the same size as \"int"
734 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
735 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
736 "have touched it in the first place, but once they did they felt it had to "
737 "have a named type for some unfathomable reason (probably somebody didn't "
738 "like losing face over having done the original stupid thing, so they "
739 "silently just renamed their blunder).\""
740 msgstr ""
741 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
742 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
743 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
744 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
745 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
746 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
747 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
748 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
749 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
750 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
751 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
752 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
753 "う)。」"
754
755 #. type: SH
756 #: build/C/man2/accept.2:378 build/C/man2/bind.2:264
757 #: build/C/man2/connect.2:276 build/C/man3/getifaddrs.3:207
758 #: build/C/man3/if_nameindex.3:108 build/C/man2/listen.2:179
759 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:172
760 #: build/C/man2/select.2:555 build/C/man2/select_tut.2:529
761 #: build/C/man2/send.2:438 build/C/man2/sendmmsg.2:168
762 #: build/C/man3/sockatmark.3:104 build/C/man2/socket.2:381
763 #, no-wrap
764 msgid "EXAMPLE"
765 msgstr "例"
766
767 #. type: Plain text
768 #: build/C/man2/accept.2:381 build/C/man2/listen.2:182
769 msgid "See B<bind>(2)."
770 msgstr "B<bind>(2)  参照。"
771
772 #. type: SH
773 #: build/C/man2/accept.2:381 build/C/man2/bind.2:329
774 #: build/C/man3/bindresvport.3:113 build/C/man2/connect.2:281
775 #: build/C/man3/getifaddrs.3:309 build/C/man2/getsockname.2:114
776 #: build/C/man2/getsockopt.2:202 build/C/man3/if_nameindex.3:147
777 #: build/C/man3/if_nametoindex.3:96 build/C/man2/listen.2:182
778 #: build/C/man2/recv.2:516 build/C/man2/recvmmsg.2:278
779 #: build/C/man2/select.2:592 build/C/man2/select_tut.2:821
780 #: build/C/man2/send.2:443 build/C/man2/sendmmsg.2:236
781 #: build/C/man3/sockatmark.3:139 build/C/man2/socket.2:386
782 #: build/C/man7/socket.7:960 build/C/man2/socketcall.2:53
783 #: build/C/man2/socketpair.2:124
784 #, no-wrap
785 msgid "SEE ALSO"
786 msgstr "関連項目"
787
788 #. type: Plain text
789 #: build/C/man2/accept.2:388
790 msgid ""
791 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
792 "B<socket>(7)"
793 msgstr ""
794 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
795 "B<socket>(7)"
796
797 #. type: SH
798 #: build/C/man2/accept.2:388 build/C/man2/bind.2:342
799 #: build/C/man3/bindresvport.3:116 build/C/man2/connect.2:288
800 #: build/C/man3/getifaddrs.3:315 build/C/man2/getsockname.2:121
801 #: build/C/man2/getsockopt.2:213 build/C/man3/if_nameindex.3:154
802 #: build/C/man3/if_nametoindex.3:100 build/C/man2/listen.2:188
803 #: build/C/man2/recv.2:527 build/C/man2/recvmmsg.2:285
804 #: build/C/man2/select.2:607 build/C/man2/select_tut.2:840
805 #: build/C/man2/send.2:458 build/C/man2/sendmmsg.2:241
806 #: build/C/man3/sockatmark.3:144 build/C/man2/socket.2:415
807 #: build/C/man7/socket.7:972 build/C/man2/socketcall.2:71
808 #: build/C/man2/socketpair.2:131
809 #, no-wrap
810 msgid "COLOPHON"
811 msgstr "この文書について"
812
813 #. type: Plain text
814 #: build/C/man2/accept.2:396 build/C/man2/bind.2:350
815 #: build/C/man3/bindresvport.3:124 build/C/man2/connect.2:296
816 #: build/C/man3/getifaddrs.3:323 build/C/man2/getsockname.2:129
817 #: build/C/man2/getsockopt.2:221 build/C/man3/if_nameindex.3:162
818 #: build/C/man3/if_nametoindex.3:108 build/C/man2/listen.2:196
819 #: build/C/man2/recv.2:535 build/C/man2/recvmmsg.2:293
820 #: build/C/man2/select.2:615 build/C/man2/select_tut.2:848
821 #: build/C/man2/send.2:466 build/C/man2/sendmmsg.2:249
822 #: build/C/man3/sockatmark.3:152 build/C/man2/socket.2:423
823 #: build/C/man7/socket.7:980 build/C/man2/socketcall.2:79
824 #: build/C/man2/socketpair.2:139
825 msgid ""
826 "This page is part of release 3.78 of the Linux I<man-pages> project.  A "
827 "description of the project, information about reporting bugs, and the latest "
828 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
829 "pages/."
830 msgstr ""
831 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
832 "である。プロジェクトの説明とバグ報告に関する情報は\n"
833 "http://www.kernel.org/doc/man-pages/ に書かれている。"
834
835 #. type: TH
836 #: build/C/man2/bind.2:68
837 #, no-wrap
838 msgid "BIND"
839 msgstr "BIND"
840
841 #. type: TH
842 #: build/C/man2/bind.2:68 build/C/man2/recv.2:41 build/C/man2/send.2:40
843 #, no-wrap
844 msgid "2014-08-19"
845 msgstr "2014-08-19"
846
847 #. type: Plain text
848 #: build/C/man2/bind.2:71
849 msgid "bind - bind a name to a socket"
850 msgstr "bind - ソケットに名前をつける"
851
852 #. type: Plain text
853 #: build/C/man2/bind.2:78
854 #, no-wrap
855 msgid ""
856 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
857 "B<         socklen_t >I<addrlen>B<);>\n"
858 msgstr ""
859 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
860 "B<         socklen_t >I<addrlen>B<);>\n"
861
862 #. type: Plain text
863 #: build/C/man2/bind.2:92
864 msgid ""
865 "When a socket is created with B<socket>(2), it exists in a name space "
866 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
867 "address specified by I<addr> to the socket referred to by the file "
868 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
869 "address structure pointed to by I<addr>.  Traditionally, this operation is "
870 "called \\(lqassigning a name to a socket\\(rq."
871 msgstr ""
872 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
873 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
874 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
875 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
876 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
877 "る。"
878
879 #. type: Plain text
880 #: build/C/man2/bind.2:99
881 msgid ""
882 "It is normally necessary to assign a local address using B<bind>()  before a "
883 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
884 msgstr ""
885 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
886 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
887 "る。"
888
889 #. type: Plain text
890 #: build/C/man2/bind.2:130
891 msgid ""
892 "The rules used in name binding vary between address families.  Consult the "
893 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
894 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
895 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
896 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
897 msgstr ""
898 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
899 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
900 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は "
901 "B<ddp>(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  "
902 "を、 B<AF_NETLINK> は B<netlink>(7)  を参照。"
903
904 #. type: Plain text
905 #: build/C/man2/bind.2:137
906 msgid ""
907 "The actual structure passed for the I<addr> argument will depend on the "
908 "address family.  The I<sockaddr> structure is defined as something like:"
909 msgstr ""
910 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
911 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
912
913 #. type: Plain text
914 #: build/C/man2/bind.2:144
915 #, no-wrap
916 msgid ""
917 "struct sockaddr {\n"
918 "    sa_family_t sa_family;\n"
919 "    char        sa_data[14];\n"
920 "}\n"
921 msgstr ""
922 "struct sockaddr {\n"
923 "    sa_family_t sa_family;\n"
924 "    char        sa_data[14];\n"
925 "}\n"
926
927 #. type: Plain text
928 #: build/C/man2/bind.2:152
929 msgid ""
930 "The only purpose of this structure is to cast the structure pointer passed "
931 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
932 msgstr ""
933 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
934 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
935
936 #. type: Plain text
937 #: build/C/man2/bind.2:157 build/C/man2/getsockname.2:72
938 #: build/C/man2/getsockopt.2:136 build/C/man2/listen.2:87
939 #: build/C/man2/socketpair.2:74
940 msgid ""
941 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
942 "appropriately."
943 msgstr ""
944 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
945 "設定される。"
946
947 #. type: TP
948 #: build/C/man2/bind.2:158 build/C/man2/bind.2:199
949 #: build/C/man3/bindresvport.3:77 build/C/man2/connect.2:135
950 #: build/C/man2/send.2:304 build/C/man2/socket.2: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:191
1002 msgid ""
1003 "I<addrlen> is wrong, or I<addr> is not a valid address for this socket's "
1004 "domain."
1005 msgstr ""
1006 "I<addrlen> が間違っているか、 I<addr> がこのソケットのドメインで有効なアドレ"
1007 "スではない。"
1008
1009 #. type: Plain text
1010 #: build/C/man2/bind.2:195
1011 msgid "I<sockfd> is a descriptor for a file, not a socket."
1012 msgstr ""
1013 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
1014
1015 #. type: Plain text
1016 #: build/C/man2/bind.2:199
1017 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
1018 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
1019
1020 #. type: Plain text
1021 #: build/C/man2/bind.2:204
1022 msgid ""
1023 "Search permission is denied on a component of the path prefix.  (See also "
1024 "B<path_resolution>(7).)"
1025 msgstr ""
1026 "パス名の構成要素に検索許可 (search permission) がない "
1027 "(B<path_resolution>(7)  も参照すること)。"
1028
1029 #. type: TP
1030 #: build/C/man2/bind.2:204 build/C/man2/connect.2:151
1031 #, no-wrap
1032 msgid "B<EADDRNOTAVAIL>"
1033 msgstr "B<EADDRNOTAVAIL>"
1034
1035 #. type: Plain text
1036 #: build/C/man2/bind.2:208
1037 msgid ""
1038 "A nonexistent interface was requested or the requested address was not local."
1039 msgstr ""
1040 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1041 "かった。"
1042
1043 #. type: Plain text
1044 #: build/C/man2/bind.2:212
1045 msgid "I<addr> points outside the user's accessible address space."
1046 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1047
1048 #. type: TP
1049 #: build/C/man2/bind.2:212
1050 #, no-wrap
1051 msgid "B<ELOOP>"
1052 msgstr "B<ELOOP>"
1053
1054 #. type: Plain text
1055 #: build/C/man2/bind.2:216
1056 msgid "Too many symbolic links were encountered in resolving I<addr>."
1057 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1058
1059 #. type: TP
1060 #: build/C/man2/bind.2:216
1061 #, no-wrap
1062 msgid "B<ENAMETOOLONG>"
1063 msgstr "B<ENAMETOOLONG>"
1064
1065 #. type: Plain text
1066 #: build/C/man2/bind.2:220
1067 msgid "I<addr> is too long."
1068 msgstr "I<addr> が長過ぎる。"
1069
1070 #. type: TP
1071 #: build/C/man2/bind.2:220
1072 #, no-wrap
1073 msgid "B<ENOENT>"
1074 msgstr "B<ENOENT>"
1075
1076 #. type: Plain text
1077 #: build/C/man2/bind.2:223
1078 msgid "The file does not exist."
1079 msgstr "ファイルが存在しない。"
1080
1081 #. type: TP
1082 #: build/C/man2/bind.2:223 build/C/man2/recv.2:460 build/C/man2/select.2:340
1083 #: build/C/man2/send.2:375
1084 #, no-wrap
1085 msgid "B<ENOMEM>"
1086 msgstr "B<ENOMEM>"
1087
1088 #. type: Plain text
1089 #: build/C/man2/bind.2:226
1090 msgid "Insufficient kernel memory was available."
1091 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1092
1093 #. type: TP
1094 #: build/C/man2/bind.2:226
1095 #, no-wrap
1096 msgid "B<ENOTDIR>"
1097 msgstr "B<ENOTDIR>"
1098
1099 #. type: Plain text
1100 #: build/C/man2/bind.2:229
1101 msgid "A component of the path prefix is not a directory."
1102 msgstr "パス名の構成要素がディレクトリではない。"
1103
1104 #. type: TP
1105 #: build/C/man2/bind.2:229
1106 #, no-wrap
1107 msgid "B<EROFS>"
1108 msgstr "B<EROFS>"
1109
1110 #. type: Plain text
1111 #: build/C/man2/bind.2:232
1112 msgid "The socket inode would reside on a read-only filesystem."
1113 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1114
1115 #.  SVr4 documents an additional
1116 #.  .B ENOSR
1117 #.  general error condition, and
1118 #.  additional
1119 #.  .B EIO
1120 #.  and
1121 #.  .B EISDIR
1122 #.  UNIX-domain error conditions.
1123 #. type: Plain text
1124 #: build/C/man2/bind.2:244
1125 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1126 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1127
1128 #. type: Plain text
1129 #: build/C/man2/bind.2:261
1130 msgid ""
1131 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1132 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1133 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1134 msgstr ""
1135 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1136 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1137 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1138
1139 #. type: SH
1140 #: build/C/man2/bind.2:261 build/C/man2/getsockopt.2:199
1141 #: build/C/man2/recvmmsg.2:267 build/C/man2/select.2:492
1142 #: build/C/man2/send.2:433 build/C/man3/sockatmark.3:100
1143 #: build/C/man7/socket.7:947
1144 #, no-wrap
1145 msgid "BUGS"
1146 msgstr "バグ"
1147
1148 #.  FIXME Document transparent proxy options
1149 #. type: Plain text
1150 #: build/C/man2/bind.2:264
1151 msgid "The transparent proxy options are not described."
1152 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1153
1154 #. type: Plain text
1155 #: build/C/man2/bind.2:269
1156 msgid ""
1157 "An example of the use of B<bind>()  with Internet domain sockets can be "
1158 "found in B<getaddrinfo>(3)."
1159 msgstr ""
1160 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が "
1161 "B<getaddrinfo>(3)  に記載されている。"
1162
1163 #.  listen.7 refers to this example.
1164 #.  accept.7 refers to this example.
1165 #.  unix.7 refers to this example.
1166 #. type: Plain text
1167 #: build/C/man2/bind.2:276
1168 msgid ""
1169 "The following example shows how to bind a stream socket in the UNIX "
1170 "(B<AF_UNIX>)  domain, and accept connections:"
1171 msgstr ""
1172 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1173 "を示したものである。"
1174
1175 #. type: Plain text
1176 #: build/C/man2/bind.2:283
1177 #, no-wrap
1178 msgid ""
1179 "#include E<lt>sys/socket.hE<gt>\n"
1180 "#include E<lt>sys/un.hE<gt>\n"
1181 "#include E<lt>stdlib.hE<gt>\n"
1182 "#include E<lt>stdio.hE<gt>\n"
1183 "#include E<lt>string.hE<gt>\n"
1184 msgstr ""
1185 "#include E<lt>sys/socket.hE<gt>\n"
1186 "#include E<lt>sys/un.hE<gt>\n"
1187 "#include E<lt>stdlib.hE<gt>\n"
1188 "#include E<lt>stdio.hE<gt>\n"
1189 "#include E<lt>string.hE<gt>\n"
1190
1191 #. type: Plain text
1192 #: build/C/man2/bind.2:286
1193 #, no-wrap
1194 msgid ""
1195 "#define MY_SOCK_PATH \"/somepath\"\n"
1196 "#define LISTEN_BACKLOG 50\n"
1197 msgstr ""
1198 "#define MY_SOCK_PATH \"/somepath\"\n"
1199 "#define LISTEN_BACKLOG 50\n"
1200
1201 #. type: Plain text
1202 #: build/C/man2/bind.2:289
1203 #, no-wrap
1204 msgid ""
1205 "#define handle_error(msg) \\e\n"
1206 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1207 msgstr ""
1208 "#define handle_error(msg) \\e\n"
1209 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1210
1211 #. type: Plain text
1212 #: build/C/man2/bind.2:296
1213 #, no-wrap
1214 msgid ""
1215 "int\n"
1216 "main(int argc, char *argv[])\n"
1217 "{\n"
1218 "    int sfd, cfd;\n"
1219 "    struct sockaddr_un my_addr, peer_addr;\n"
1220 "    socklen_t peer_addr_size;\n"
1221 msgstr ""
1222 "int\n"
1223 "main(int argc, char *argv[])\n"
1224 "{\n"
1225 "    int sfd, cfd;\n"
1226 "    struct sockaddr_un my_addr, peer_addr;\n"
1227 "    socklen_t peer_addr_size;\n"
1228
1229 #. type: Plain text
1230 #: build/C/man2/bind.2:300
1231 #, no-wrap
1232 msgid ""
1233 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1234 "    if (sfd == -1)\n"
1235 "        handle_error(\"socket\");\n"
1236 msgstr ""
1237 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1238 "    if (sfd == -1)\n"
1239 "        handle_error(\"socket\");\n"
1240
1241 #. type: Plain text
1242 #: build/C/man2/bind.2:306
1243 #, no-wrap
1244 msgid ""
1245 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1246 "                        /* Clear structure */\n"
1247 "    my_addr.sun_family = AF_UNIX;\n"
1248 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1249 "            sizeof(my_addr.sun_path) - 1);\n"
1250 msgstr ""
1251 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1252 "                        /* Clear structure */\n"
1253 "    my_addr.sun_family = AF_UNIX;\n"
1254 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1255 "            sizeof(my_addr.sun_path) - 1);\n"
1256
1257 #. type: Plain text
1258 #: build/C/man2/bind.2:310
1259 #, no-wrap
1260 msgid ""
1261 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1262 "            sizeof(struct sockaddr_un)) == -1)\n"
1263 "        handle_error(\"bind\");\n"
1264 msgstr ""
1265 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1266 "            sizeof(struct sockaddr_un)) == -1)\n"
1267 "        handle_error(\"bind\");\n"
1268
1269 #. type: Plain text
1270 #: build/C/man2/bind.2:313
1271 #, no-wrap
1272 msgid ""
1273 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1274 "        handle_error(\"listen\");\n"
1275 msgstr ""
1276 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1277 "        handle_error(\"listen\");\n"
1278
1279 #. type: Plain text
1280 #: build/C/man2/bind.2:316
1281 #, no-wrap
1282 msgid ""
1283 "    /* Now we can accept incoming connections one\n"
1284 "       at a time using accept(2) */\n"
1285 msgstr ""
1286 "    /* Now we can accept incoming connections one\n"
1287 "       at a time using accept(2) */\n"
1288
1289 #. type: Plain text
1290 #: build/C/man2/bind.2:322
1291 #, no-wrap
1292 msgid ""
1293 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1294 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1295 "                 &peer_addr_size);\n"
1296 "    if (cfd == -1)\n"
1297 "        handle_error(\"accept\");\n"
1298 msgstr ""
1299 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1300 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1301 "                 &peer_addr_size)\n"
1302 "    if (cfd == -1)\n"
1303 "        handle_error(\"accept\");\n"
1304
1305 #. type: Plain text
1306 #: build/C/man2/bind.2:324
1307 #, no-wrap
1308 msgid "    /* Code to deal with incoming connection(s)... */\n"
1309 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1310
1311 #. type: Plain text
1312 #: build/C/man2/bind.2:328
1313 #, no-wrap
1314 msgid ""
1315 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1316 "       should be deleted using unlink(2) or remove(3) */\n"
1317 "}\n"
1318 msgstr ""
1319 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1320 "       should be deleted using unlink(2) or remove(3) */\n"
1321 "}\n"
1322
1323 #. type: Plain text
1324 #: build/C/man2/bind.2:342
1325 msgid ""
1326 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1327 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1328 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1329 msgstr ""
1330 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1331 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), "
1332 "B<path_resolution>(7), B<socket>(7), B<unix>(7)"
1333
1334 #. type: TH
1335 #: build/C/man3/bindresvport.3:30
1336 #, no-wrap
1337 msgid "BINDRESVPORT"
1338 msgstr "BINDRESVPORT"
1339
1340 #. type: TH
1341 #: build/C/man3/bindresvport.3:30
1342 #, no-wrap
1343 msgid "2013-06-21"
1344 msgstr "2013-06-21"
1345
1346 #. type: Plain text
1347 #: build/C/man3/bindresvport.3:33
1348 msgid "bindresvport - bind a socket to a privileged IP port"
1349 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1350
1351 #. type: Plain text
1352 #: build/C/man3/bindresvport.3:37
1353 #, no-wrap
1354 msgid ""
1355 "B<#include E<lt>sys/types.hE<gt>>\n"
1356 "B<#include E<lt>netinet/in.hE<gt>>\n"
1357 msgstr ""
1358 "B<#include E<lt>sys/types.hE<gt>>\n"
1359 "B<#include E<lt>netinet/in.hE<gt>>\n"
1360
1361 #. type: Plain text
1362 #: build/C/man3/bindresvport.3:39
1363 #, no-wrap
1364 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1365 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1366
1367 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1368 #. type: Plain text
1369 #: build/C/man3/bindresvport.3:46
1370 msgid ""
1371 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1372 "anonymous IP port, that is, a port number arbitrarily selected from the "
1373 "range 512 to 1023."
1374 msgstr ""
1375 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1376 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1377 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1378
1379 #. type: Plain text
1380 #: build/C/man3/bindresvport.3:56
1381 msgid ""
1382 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1383 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1384 "allocated."
1385 msgstr ""
1386 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1387 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1388 "される。"
1389
1390 #. type: Plain text
1391 #: build/C/man3/bindresvport.3:67
1392 msgid ""
1393 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1394 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1395 "return the port number actually allocated.  (This information can later be "
1396 "obtained using B<getsockname>(2).)"
1397 msgstr ""
1398 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1399 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 "
1400 "B<bindresvport>()  は実際に割り当てられたポート番号を返す手段を持たない (割り"
1401 "当てられたポート番号は、後で B<getsockname>(2)  を使って取得できる)。"
1402
1403 #. type: Plain text
1404 #: build/C/man3/bindresvport.3:72
1405 msgid ""
1406 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1407 "I<errno> set to indicate the cause of the error."
1408 msgstr ""
1409 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1410 "I<errno> にエラーの原因を示す値を設定する。"
1411
1412 #. type: Plain text
1413 #: build/C/man3/bindresvport.3:77
1414 msgid ""
1415 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1416 "addition, the following errors may occur:"
1417 msgstr ""
1418 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1419 "以下のエラーが発生することがある:"
1420
1421 #. type: Plain text
1422 #: build/C/man3/bindresvport.3:82
1423 msgid ""
1424 "The caller did not have superuser privilege (to be precise: the "
1425 "B<CAP_NET_BIND_SERVICE> capability is required)."
1426 msgstr ""
1427 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1428 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1429
1430 #. type: Plain text
1431 #: build/C/man3/bindresvport.3:85
1432 msgid "All privileged ports are in use."
1433 msgstr "全ての特権ポートが使用中である。"
1434
1435 #. type: TP
1436 #: build/C/man3/bindresvport.3:85
1437 #, no-wrap
1438 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1439 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1440
1441 #. type: Plain text
1442 #: build/C/man3/bindresvport.3:92
1443 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1444 msgstr ""
1445 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1446
1447 #. type: SH
1448 #: build/C/man3/bindresvport.3:92 build/C/man3/if_nametoindex.3:85
1449 #: build/C/man3/sockatmark.3:73
1450 #, no-wrap
1451 msgid "ATTRIBUTES"
1452 msgstr "属性"
1453
1454 #. type: SS
1455 #: build/C/man3/bindresvport.3:93 build/C/man3/if_nametoindex.3:86
1456 #: build/C/man3/sockatmark.3:74
1457 #, no-wrap
1458 msgid "Multithreading (see pthreads(7))"
1459 msgstr "マルチスレッディング (pthreads(7) 参照)"
1460
1461 #. type: Plain text
1462 #: build/C/man3/bindresvport.3:98
1463 msgid ""
1464 "Before glibc 2.17, the B<bindresvport>()  function uses a static variable "
1465 "that is not protected, so it is not thread-safe."
1466 msgstr ""
1467 "glibc 2.17 より前のバージョンでは、 B<bindresvport>() 関数は保護されていない"
1468 "静的変数を使用しているため、スレッドセーフではない。"
1469
1470 #.  commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
1471 #. type: Plain text
1472 #: build/C/man3/bindresvport.3:104
1473 msgid ""
1474 "Since glibc 2.17, the B<bindresvport>()  function uses a lock to protect the "
1475 "static variable, so it is thread-safe."
1476 msgstr ""
1477 "glibc 2.17 以降では、 B<bindresvport>() 関数は静的変数を保護するロックを使っ"
1478 "ており、スレッドセーフである。"
1479
1480 #. type: Plain text
1481 #: build/C/man3/bindresvport.3:107
1482 msgid ""
1483 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1484 msgstr ""
1485 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1486
1487 #. type: Plain text
1488 #: build/C/man3/bindresvport.3:113
1489 msgid ""
1490 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1491 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1492 msgstr ""
1493 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1494 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1495
1496 #. type: Plain text
1497 #: build/C/man3/bindresvport.3:116
1498 msgid "B<bind>(2), B<getsockname>(2)"
1499 msgstr "B<bind>(2), B<getsockname>(2)"
1500
1501 #. type: TH
1502 #: build/C/man2/connect.2:67
1503 #, no-wrap
1504 msgid "CONNECT"
1505 msgstr "CONNECT"
1506
1507 #. type: TH
1508 #: build/C/man2/connect.2:67
1509 #, no-wrap
1510 msgid "2014-09-06"
1511 msgstr "2014-09-06"
1512
1513 #. type: Plain text
1514 #: build/C/man2/connect.2:70
1515 msgid "connect - initiate a connection on a socket"
1516 msgstr "connect - ソケットの接続を行う"
1517
1518 #. type: Plain text
1519 #: build/C/man2/connect.2:73 build/C/man2/getsockopt.2:50
1520 #: build/C/man2/listen.2:51
1521 #, no-wrap
1522 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1523 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1524
1525 #. type: Plain text
1526 #: build/C/man2/connect.2:75 build/C/man2/getsockname.2:46
1527 #: build/C/man2/getsockopt.2:52 build/C/man2/listen.2:53
1528 #: build/C/man2/recv.2:51
1529 #, no-wrap
1530 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1531 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1532
1533 #. type: Plain text
1534 #: build/C/man2/connect.2:78
1535 #, no-wrap
1536 msgid ""
1537 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1538 "B<            socklen_t >I<addrlen>B<);>\n"
1539 msgstr ""
1540 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1541 "B<            socklen_t >I<addrlen>B<);>\n"
1542
1543 #. type: Plain text
1544 #: build/C/man2/connect.2:97
1545 msgid ""
1546 "The B<connect>()  system call connects the socket referred to by the file "
1547 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1548 "argument specifies the size of I<addr>.  The format of the address in "
1549 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1550 "B<socket>(2)  for further details."
1551 msgstr ""
1552 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1553 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1554 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1555 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1556 "こと。"
1557
1558 #. type: Plain text
1559 #: build/C/man2/connect.2:113
1560 msgid ""
1561 "If the socket I<sockfd> is of type B<SOCK_DGRAM>, then I<addr> is the "
1562 "address to which datagrams are sent by default, and the only address from "
1563 "which datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1564 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1565 "that is bound to the address specified by I<addr>."
1566 msgstr ""
1567 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1568 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1569 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1570 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1571 "に対する接続の 作成を試みる。"
1572
1573 #. type: Plain text
1574 #: build/C/man2/connect.2:127
1575 msgid ""
1576 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1577 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1578 "times to change their association.  Connectionless sockets may dissolve the "
1579 "association by connecting to an address with the I<sa_family> member of "
1580 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1581 msgstr ""
1582 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ "
1583 "B<connect>()  が成功する。 コネクションレス (connectionless) プロトコルでは対"
1584 "応を変更するために何度も B<connect>()  を使用できる。 非接続ソケットは "
1585 "I<sockaddr> の I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アド"
1586 "レスの対応を解消することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux で"
1587 "サポート)。"
1588
1589 #. type: Plain text
1590 #: build/C/man2/connect.2:132
1591 msgid ""
1592 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1593 "returned, and I<errno> is set appropriately."
1594 msgstr ""
1595 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1596 "適切な値を設定する。"
1597
1598 #. type: Plain text
1599 #: build/C/man2/connect.2:135
1600 msgid ""
1601 "The following are general socket errors only.  There may be other domain-"
1602 "specific error codes."
1603 msgstr ""
1604 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1605 "する可能性がある。"
1606
1607 #. type: Plain text
1608 #: build/C/man2/connect.2:143
1609 msgid ""
1610 "For UNIX domain sockets, which are identified by pathname: Write permission "
1611 "is denied on the socket file, or search permission is denied for one of the "
1612 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1613 msgstr ""
1614 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1615 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1616 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1617
1618 #. type: TP
1619 #: build/C/man2/connect.2:143
1620 #, no-wrap
1621 msgid "B<EACCES>, B<EPERM>"
1622 msgstr "B<EACCES>, B<EPERM>"
1623
1624 #. type: Plain text
1625 #: build/C/man2/connect.2:148
1626 msgid ""
1627 "The user tried to connect to a broadcast address without having the socket "
1628 "broadcast flag enabled or the connection request failed because of a local "
1629 "firewall rule."
1630 msgstr ""
1631 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1632 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1633 "要求が失敗した。"
1634
1635 #. type: Plain text
1636 #: build/C/man2/connect.2:151
1637 msgid "Local address is already in use."
1638 msgstr "ローカルアドレスが既に使用されている。"
1639
1640 #. type: Plain text
1641 #: build/C/man2/connect.2:164 build/C/man2/listen.2:104
1642 msgid ""
1643 "(Internet domain sockets)  The socket referred to by I<sockfd> had not "
1644 "previously been bound to an address and, upon attempting to bind it to an "
1645 "ephemeral port, it was determined that all port numbers in the ephemeral "
1646 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
1647 "ip_local_port_range> in B<ip>(7)."
1648 msgstr ""
1649 "(インターネットドメインソケットの場合) I<sockfd> が参照するソケットがそれ以前"
1650 "にアドレスにバインドされておらず、 そのソケットに一時ポートをバインドしようと"
1651 "した際に、 一時ポートとして使用する範囲のポート番号がすべて使用中であった。 "
1652 "B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照のこと。"
1653
1654 #. type: TP
1655 #: build/C/man2/connect.2:164 build/C/man2/socket.2:320
1656 #: build/C/man2/socketpair.2:75
1657 #, no-wrap
1658 msgid "B<EAFNOSUPPORT>"
1659 msgstr "B<EAFNOSUPPORT>"
1660
1661 #. type: Plain text
1662 #: build/C/man2/connect.2:169
1663 msgid ""
1664 "The passed address didn't have the correct address family in its "
1665 "I<sa_family> field."
1666 msgstr ""
1667 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1668 "い。"
1669
1670 #. type: TP
1671 #: build/C/man2/connect.2:169 build/C/man2/send.2:323
1672 #, no-wrap
1673 msgid "B<EAGAIN>"
1674 msgstr "B<EAGAIN>"
1675
1676 #. type: Plain text
1677 #: build/C/man2/connect.2:172
1678 msgid "Insufficient entries in the routing cache."
1679 msgstr "ルーティングキャッシュにエントリーが十分にない。"
1680
1681 #. type: TP
1682 #: build/C/man2/connect.2:172
1683 #, no-wrap
1684 msgid "B<EALREADY>"
1685 msgstr "B<EALREADY>"
1686
1687 #. type: Plain text
1688 #: build/C/man2/connect.2:176
1689 msgid ""
1690 "The socket is nonblocking and a previous connection attempt has not yet been "
1691 "completed."
1692 msgstr ""
1693 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1694
1695 #. type: Plain text
1696 #: build/C/man2/connect.2:179
1697 msgid "The file descriptor is not a valid index in the descriptor table."
1698 msgstr ""
1699 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1700 "い。"
1701
1702 #. type: TP
1703 #: build/C/man2/connect.2:179 build/C/man2/recv.2:443
1704 #, no-wrap
1705 msgid "B<ECONNREFUSED>"
1706 msgstr "B<ECONNREFUSED>"
1707
1708 #. type: Plain text
1709 #: build/C/man2/connect.2:182
1710 msgid "No-one listening on the remote address."
1711 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1712
1713 #. type: Plain text
1714 #: build/C/man2/connect.2:185
1715 msgid "The socket structure address is outside the user's address space."
1716 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1717
1718 #. type: TP
1719 #: build/C/man2/connect.2:185
1720 #, no-wrap
1721 msgid "B<EINPROGRESS>"
1722 msgstr "B<EINPROGRESS>"
1723
1724 #. type: Plain text
1725 #: build/C/man2/connect.2:210
1726 msgid ""
1727 "The socket is nonblocking and the connection cannot be completed "
1728 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1729 "by selecting the socket for writing.  After B<select>(2)  indicates "
1730 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1731 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1732 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1733 "error codes listed here, explaining the reason for the failure)."
1734 msgstr ""
1735 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1736 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1737 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1738 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1739 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1740 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1741 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1742 "の原因が分かる。"
1743
1744 #.  For TCP, the connection will complete asynchronously.
1745 #.  See http://lkml.org/lkml/2005/7/12/254
1746 #. type: Plain text
1747 #: build/C/man2/connect.2:216
1748 msgid ""
1749 "The system call was interrupted by a signal that was caught; see "
1750 "B<signal>(7)."
1751 msgstr ""
1752 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1753
1754 #. type: TP
1755 #: build/C/man2/connect.2:216 build/C/man2/send.2:355
1756 #, no-wrap
1757 msgid "B<EISCONN>"
1758 msgstr "B<EISCONN>"
1759
1760 #. type: Plain text
1761 #: build/C/man2/connect.2:219
1762 msgid "The socket is already connected."
1763 msgstr "ソケットは既に接続 (connect) されている。"
1764
1765 #. type: TP
1766 #: build/C/man2/connect.2:219
1767 #, no-wrap
1768 msgid "B<ENETUNREACH>"
1769 msgstr "B<ENETUNREACH>"
1770
1771 #. type: Plain text
1772 #: build/C/man2/connect.2:222
1773 msgid "Network is unreachable."
1774 msgstr "到達できないネットワークである。"
1775
1776 #. type: Plain text
1777 #: build/C/man2/connect.2:225
1778 msgid "The file descriptor is not associated with a socket."
1779 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1780
1781 #. type: TP
1782 #: build/C/man2/connect.2:225
1783 #, no-wrap
1784 msgid "B<EPROTOTYPE>"
1785 msgstr "B<EPROTOTYPE>"
1786
1787 #. type: Plain text
1788 #: build/C/man2/connect.2:230
1789 msgid ""
1790 "The socket type does not support the requested communications protocol.  "
1791 "This error can occur, for example, on an attempt to connect a UNIX domain "
1792 "datagram socket to a stream socket."
1793 msgstr ""
1794 "ソケットタイプが要求された通信プロトコルではサポートされていない。 このエラー"
1795 "は、 例えば UNIX ドメインデータグラムソケットをストリームソケットに接続しよう"
1796 "とした場合などに起こり得る。"
1797
1798 #. type: TP
1799 #: build/C/man2/connect.2:230
1800 #, no-wrap
1801 msgid "B<ETIMEDOUT>"
1802 msgstr "B<ETIMEDOUT>"
1803
1804 #. type: Plain text
1805 #: build/C/man2/connect.2:237
1806 msgid ""
1807 "Timeout while attempting connection.  The server may be too busy to accept "
1808 "new connections.  Note that for IP sockets the timeout may be very long when "
1809 "syncookies are enabled on the server."
1810 msgstr ""
1811 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1812 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1813 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1814 "ること。"
1815
1816 #.  SVr4 documents the additional
1817 #.  general error codes
1818 #.  .BR EADDRNOTAVAIL ,
1819 #.  .BR EINVAL ,
1820 #.  .BR EAFNOSUPPORT ,
1821 #.  .BR EALREADY ,
1822 #.  .BR EINTR ,
1823 #.  .BR EPROTOTYPE ,
1824 #.  and
1825 #.  .BR ENOSR .
1826 #.  It also
1827 #.  documents many additional error conditions not described here.
1828 #. type: Plain text
1829 #: build/C/man2/connect.2:253
1830 msgid ""
1831 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1832 "POSIX.1-2001."
1833 msgstr ""
1834 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1835
1836 #. type: Plain text
1837 #: build/C/man2/connect.2:270
1838 msgid ""
1839 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1840 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1841 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1842 msgstr ""
1843 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1844 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1845 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1846
1847 #. type: Plain text
1848 #: build/C/man2/connect.2:276
1849 msgid ""
1850 "If B<connect>()  fails, consider the state of the socket as unspecified.  "
1851 "Portable applications should close the socket and create a new one for "
1852 "reconnecting."
1853 msgstr ""
1854 "B<connect>() が失敗した場合、そのソケットの状態は不定だと考えること。 移植性"
1855 "を考慮したアプリケーションでは、そのソケットをクローズし、再接続用に新しいソ"
1856 "ケットを作成すべきである。"
1857
1858 #. type: Plain text
1859 #: build/C/man2/connect.2:281
1860 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1861 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1862
1863 #. type: Plain text
1864 #: build/C/man2/connect.2:288
1865 msgid ""
1866 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1867 "B<path_resolution>(7)"
1868 msgstr ""
1869 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1870 "B<path_resolution>(7)"
1871
1872 #. type: TH
1873 #: build/C/man3/getifaddrs.3:36
1874 #, no-wrap
1875 msgid "GETIFADDRS"
1876 msgstr "GETIFADDRS"
1877
1878 #. type: TH
1879 #: build/C/man3/getifaddrs.3:36
1880 #, no-wrap
1881 msgid "2014-02-26"
1882 msgstr "2014-02-26"
1883
1884 #. type: TH
1885 #: build/C/man3/getifaddrs.3:36 build/C/man3/if_nameindex.3:26
1886 #: build/C/man3/if_nametoindex.3:25
1887 #, no-wrap
1888 msgid "GNU"
1889 msgstr "GNU"
1890
1891 #. type: Plain text
1892 #: build/C/man3/getifaddrs.3:39
1893 msgid "getifaddrs, freeifaddrs - get interface addresses"
1894 msgstr "getifaddrs, freeifaddrs - インターフェースのアドレスを取得する"
1895
1896 #. type: Plain text
1897 #: build/C/man3/getifaddrs.3:43
1898 #, no-wrap
1899 msgid ""
1900 "B<#include E<lt>sys/types.hE<gt>>\n"
1901 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1902 msgstr ""
1903 "B<#include E<lt>sys/types.hE<gt>>\n"
1904 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1905
1906 #. type: Plain text
1907 #: build/C/man3/getifaddrs.3:45
1908 #, no-wrap
1909 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1910 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1911
1912 #. type: Plain text
1913 #: build/C/man3/getifaddrs.3:47
1914 #, no-wrap
1915 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1916 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1917
1918 #. type: Plain text
1919 #: build/C/man3/getifaddrs.3:58
1920 msgid ""
1921 "The B<getifaddrs>()  function creates a linked list of structures describing "
1922 "the network interfaces of the local system, and stores the address of the "
1923 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1924 "structures, defined as follows:"
1925 msgstr ""
1926 "B<getifaddrs>() 関数は、ローカルシステムのネットワークインターフェース情報を"
1927 "表す構造体の連結リストを作成し、 リストの先頭の要素のアドレスを I<*ifap> に格"
1928 "納する。 リストは I<ifaddrs> 構造体で構成される。 I<ifaddrs> 構造体は以下のよ"
1929 "うに定義されている。"
1930
1931 #. type: Plain text
1932 #: build/C/man3/getifaddrs.3:77
1933 #, no-wrap
1934 msgid ""
1935 "struct ifaddrs {\n"
1936 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1937 "    char            *ifa_name;    /* Name of interface */\n"
1938 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1939 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1940 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1941 "    union {\n"
1942 "        struct sockaddr *ifu_broadaddr;\n"
1943 "                         /* Broadcast address of interface */\n"
1944 "        struct sockaddr *ifu_dstaddr;\n"
1945 "                         /* Point-to-point destination address */\n"
1946 "    } ifa_ifu;\n"
1947 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1948 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1949 "    void            *ifa_data;    /* Address-specific data */\n"
1950 "};\n"
1951 msgstr ""
1952 "struct ifaddrs {\n"
1953 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1954 "    char            *ifa_name;    /* Name of interface */\n"
1955 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1956 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1957 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1958 "    union {\n"
1959 "        struct sockaddr *ifu_broadaddr;\n"
1960 "                         /* Broadcast address of interface */\n"
1961 "        struct sockaddr *ifu_dstaddr;\n"
1962 "                         /* Point-to-point destination address */\n"
1963 "    } ifa_ifu;\n"
1964 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1965 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1966 "    void            *ifa_data;    /* Address-specific data */\n"
1967 "};\n"
1968
1969 #. type: Plain text
1970 #: build/C/man3/getifaddrs.3:84
1971 msgid ""
1972 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1973 "or NULL if this is the last item of the list."
1974 msgstr ""
1975 "I<ifa_next> フィールドにはリストの次の構造体へのポインタが格納される。 この要"
1976 "素がリストの最後の場合には NULL が入る。"
1977
1978 #.  The constant
1979 #.  .B IF NAMESIZE
1980 #.  indicates the maximum length of this field.
1981 #. type: Plain text
1982 #: build/C/man3/getifaddrs.3:91
1983 msgid "The I<ifa_name> points to the null-terminated interface name."
1984 msgstr "I<ifa_name> はヌル終端されたインターフェース名を指す。"
1985
1986 #. type: Plain text
1987 #: build/C/man3/getifaddrs.3:100
1988 msgid ""
1989 "The I<ifa_flags> field contains the interface flags, as returned by the "
1990 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1991 "these flags)."
1992 msgstr ""
1993 "I<ifa_flags> フィールドには、 B<SIOCGIFFLAGS> B<ioctl>(2) 操作で返されるイン"
1994 "ターフェースのフラグが格納される (これらのフラグのリストについては "
1995 "B<netdevice>(7) を参照)。"
1996
1997 #. type: Plain text
1998 #: build/C/man3/getifaddrs.3:109
1999 msgid ""
2000 "The I<ifa_addr> field points to a structure containing the interface "
2001 "address.  (The I<sa_family> subfield should be consulted to determine the "
2002 "format of the address structure.)  This field may contain a null pointer."
2003 msgstr ""
2004 "I<ifa_addr> フィールドは、インターフェースのアドレスを格納した構造体へのポイ"
2005 "ンタである (I<sa_family> サブフィールドを参照して、アドレス構造体の形式を判別"
2006 "すべきである)。 このフィールドはヌルポインタとなる場合がある。"
2007
2008 #. type: Plain text
2009 #: build/C/man3/getifaddrs.3:116
2010 msgid ""
2011 "The I<ifa_netmask> field points to a structure containing the netmask "
2012 "associated with I<ifa_addr>, if applicable for the address family.  This "
2013 "field may contain a null pointer."
2014 msgstr ""
2015 "I<ifa_netmask> フィールドには、 ネットマスクがあるアドレスファミリーであれ"
2016 "ば、 I<ifa_addr> に関連付けられたネットマスクを格納した構造体へのポインタが入"
2017 "る。 このフィールドはヌルポインタとなる場合がある。"
2018
2019 #. type: Plain text
2020 #: build/C/man3/getifaddrs.3:131
2021 msgid ""
2022 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
2023 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
2024 "will contain the broadcast address associated with I<ifa_addr> (if "
2025 "applicable for the address family) or I<ifa_dstaddr> will contain the "
2026 "destination address of the point-to-point interface."
2027 msgstr ""
2028 "I<ifa_flags> にビット B<IFF_BROADCAST> か B<IFF_POINTOPOINT> のどちらが設定さ"
2029 "れているかにより (同時にはこれらのどちらか一方だけが設定される)、 "
2030 "I<ifa_broadaddr> に I<ifa_addr> に対応するブロードキャストが入るか (そのアド"
2031 "レスファミリーでブロードキャストがある場合)、 I<ifa_dstaddr> に point-to-"
2032 "point インターフェースの宛先アドレスが入るかが決まる。"
2033
2034 #. type: Plain text
2035 #: build/C/man3/getifaddrs.3:136
2036 msgid ""
2037 "The I<ifa_data> field points to a buffer containing address-family-specific "
2038 "data; this field may be NULL if there is no such data for this interface."
2039 msgstr ""
2040 "I<ifa_data> フィールドは、 アドレスファミリー固有のデータが入ったバッファへの"
2041 "ポインタである。 そのインターフェースでこのようなデータがない場合には、 この"
2042 "フィールドは NULL となる。"
2043
2044 #. type: Plain text
2045 #: build/C/man3/getifaddrs.3:142
2046 msgid ""
2047 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
2048 "freed using B<freeifaddrs>()  when no longer needed."
2049 msgstr ""
2050 "B<getifaddrs>() が返すデータは動的に確保される。 必要なくなった際には "
2051 "B<freeifaddrs>() を使って解放すべきである。"
2052
2053 #. type: Plain text
2054 #: build/C/man3/getifaddrs.3:149
2055 msgid ""
2056 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
2057 "I<errno> is set appropriately."
2058 msgstr ""
2059 "成功すると、 B<getifaddrs> は 0 を返す。 エラーの場合、 -1 が返り、 I<errno> "
2060 "が適切に設定される。"
2061
2062 #. type: Plain text
2063 #: build/C/man3/getifaddrs.3:162
2064 msgid ""
2065 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
2066 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), "
2067 "B<sendto>(2), B<malloc>(3), or B<realloc>(3)."
2068 msgstr ""
2069 "B<getifaddrs>() は失敗する場合があり、その場合には I<errno> には "
2070 "B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), "
2071 "B<malloc>(3), B<realloc>(3) に対して規定されているエラーのいずれかが設定され"
2072 "る。"
2073
2074 #. type: Plain text
2075 #: build/C/man3/getifaddrs.3:170
2076 msgid ""
2077 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
2078 "2.3.3, the implementation supported only IPv4 addresses; IPv6 support was "
2079 "added in glibc 2.3.3.  Support of address families other than IPv4 is "
2080 "available only on kernels that support netlink."
2081 msgstr ""
2082 "B<getifaddrs>() 関数は glibc 2.3 で初めて登場したが、 glibc 2.3.3 より前の"
2083 "バージョンの実装では IPv4 アドレスだけがサポートされていた。 IPv6 のサポート"
2084 "は glibc 2.3.3 で追加された。 IPv4 以外のアドレスファミリーが B<getifaddrs> "
2085 "で利用できるのは、 netlink をサポートするカーネルの場合だけである。"
2086
2087 #.  , but the BSD-derived documentation generally
2088 #.  appears to be confused and obsolete on this point.
2089 #.  i.e., commonly it still says one of them will be NULL, even if
2090 #.  the ifa_ifu union is already present
2091 #. type: Plain text
2092 #: build/C/man3/getifaddrs.3:190
2093 msgid ""
2094 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
2095 "the BSD systems, but with slightly different semantics documented"
2096 "\\(emreturning one entry per interface, not per address.  This means "
2097 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
2098 "address, and no link-level address is returned if the interface has an IP "
2099 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
2100 "I<ifa_dstaddr> differs on various systems."
2101 msgstr ""
2102 "POSIX.1-2001 にはない。 この関数は BSDi で初めて登場し、 BSD 系のシステムに存"
2103 "在するが、 ドキュメント上はかなり動作が異なり、アドレス毎ではなくインター"
2104 "フェース毎に 1 エントリを返す。 このことは、 インターフェースがアドレスを持た"
2105 "ない場合には I<ifa_addr> や他のフィールドは実際に NULL になり、 インター"
2106 "フェースに IP アドレスが割り当てられている場合には リンクレベルのアドレスは返"
2107 "されない、ということを意味する。 また、 I<ifa_broadaddr> と I<ifa_dstaddr> の"
2108 "どちらを選択するかを決める方法は、 システムにより異なる。"
2109
2110 #. type: Plain text
2111 #: build/C/man3/getifaddrs.3:207
2112 msgid ""
2113 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2114 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2115 "containing lower-level details about the interface and its physical layer.  "
2116 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2117 "rtnl_link_stats>, defined in I<E<lt>linux/if_link.hE<gt>> (in Linux 2.4 and "
2118 "earlier, I<struct net_device_stats>, defined in I<E<lt>linux/netdevice."
2119 "hE<gt>>), which contains various interface attributes and statistics."
2120 msgstr ""
2121 "Linux では、 返されるアドレスは通常インターフェースに割り当てられた IPv4 アド"
2122 "レスと IPv6 アドレスになるが、 これ以外にインターフェース毎に一つ "
2123 "B<AF_PACKET> アドレスも返される。 B<AF_PACKET> アドレスには、 インターフェー"
2124 "スとその物理層に関する低レベルの詳細が格納される。 この場合、 I<ifa_data> "
2125 "フィールドには、 I<E<lt>linux/if_link.hE<gt>> で定義される I<struct "
2126 "rtnl_link_stats> (Linux 2.4 以前では I<E<lt>linux/netdevice.hE<gt>> で定義さ"
2127 "れる I<struct net_device_stats>) へのポインタが格納される。 この構造体には、"
2128 "インターフェースの様々な属性や統計情報が入る。"
2129
2130 #. type: Plain text
2131 #: build/C/man3/getifaddrs.3:214
2132 msgid ""
2133 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2134 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2135 "system:"
2136 msgstr ""
2137 "以下のプログラムは B<getifaddrs>(), B<freeifaddrs>(), B<getnameinfo>(3) の使"
2138 "用例である。 以下はこのプログラムをあるシステムで実行した際の出力である。"
2139
2140 #. type: Plain text
2141 #: build/C/man3/getifaddrs.3:235
2142 #, no-wrap
2143 msgid ""
2144 "$ B<./a.out>\n"
2145 "lo       AF_PACKET (17)\n"
2146 "                tx_packets =        524; rx_packets =        524\n"
2147 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2148 "wlp3s0   AF_PACKET (17)\n"
2149 "                tx_packets =     108391; rx_packets =     130245\n"
2150 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2151 "em1      AF_PACKET (17)\n"
2152 "                tx_packets =          0; rx_packets =          0\n"
2153 "                tx_bytes   =          0; rx_bytes   =          0\n"
2154 "lo       AF_INET (2)\n"
2155 "                address: E<lt>127.0.0.1E<gt>\n"
2156 "wlp3s0   AF_INET (2)\n"
2157 "                address: E<lt>192.168.235.137E<gt>\n"
2158 "lo       AF_INET6 (10)\n"
2159 "                address: E<lt>::1E<gt>\n"
2160 "wlp3s0   AF_INET6 (10)\n"
2161 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2162 msgstr ""
2163 "$ B<./a.out>\n"
2164 "lo       AF_PACKET (17)\n"
2165 "                tx_packets =        524; rx_packets =        524\n"
2166 "                tx_bytes   =      38788; rx_bytes   =      38788\n"
2167 "wlp3s0   AF_PACKET (17)\n"
2168 "                tx_packets =     108391; rx_packets =     130245\n"
2169 "                tx_bytes   =   30420659; rx_bytes   =   94230014\n"
2170 "em1      AF_PACKET (17)\n"
2171 "                tx_packets =          0; rx_packets =          0\n"
2172 "                tx_bytes   =          0; rx_bytes   =          0\n"
2173 "lo       AF_INET (2)\n"
2174 "                address: E<lt>127.0.0.1E<gt>\n"
2175 "wlp3s0   AF_INET (2)\n"
2176 "                address: E<lt>192.168.235.137E<gt>\n"
2177 "lo       AF_INET6 (10)\n"
2178 "                address: E<lt>::1E<gt>\n"
2179 "wlp3s0   AF_INET6 (10)\n"
2180 "                address: E<lt>fe80::7ee9:d3ff:fef5:1a91%wlp3s0E<gt>\n"
2181
2182 #. type: SS
2183 #: build/C/man3/getifaddrs.3:237 build/C/man3/if_nameindex.3:121
2184 #: build/C/man2/recvmmsg.2:205
2185 #, no-wrap
2186 msgid "Program source"
2187 msgstr "プログラムのソース"
2188
2189 #. type: Plain text
2190 #: build/C/man3/getifaddrs.3:249
2191 #, no-wrap
2192 msgid ""
2193 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2194 "#include E<lt>arpa/inet.hE<gt>\n"
2195 "#include E<lt>sys/socket.hE<gt>\n"
2196 "#include E<lt>netdb.hE<gt>\n"
2197 "#include E<lt>ifaddrs.hE<gt>\n"
2198 "#include E<lt>stdio.hE<gt>\n"
2199 "#include E<lt>stdlib.hE<gt>\n"
2200 "#include E<lt>unistd.hE<gt>\n"
2201 "#include E<lt>linux/if_link.hE<gt>\n"
2202 msgstr ""
2203 "#define _GNU_SOURCE     /* To get defns of NI_MAXSERV and NI_MAXHOST */\n"
2204 "#include E<lt>arpa/inet.hE<gt>\n"
2205 "#include E<lt>sys/socket.hE<gt>\n"
2206 "#include E<lt>netdb.hE<gt>\n"
2207 "#include E<lt>ifaddrs.hE<gt>\n"
2208 "#include E<lt>stdio.hE<gt>\n"
2209 "#include E<lt>stdlib.hE<gt>\n"
2210 "#include E<lt>unistd.hE<gt>\n"
2211 "#include E<lt>linux/if_link.hE<gt>\n"
2212
2213 #. type: Plain text
2214 #: build/C/man3/getifaddrs.3:255
2215 #, no-wrap
2216 msgid ""
2217 "int main(int argc, char *argv[])\n"
2218 "{\n"
2219 "    struct ifaddrs *ifaddr, *ifa;\n"
2220 "    int family, s, n;\n"
2221 "    char host[NI_MAXHOST];\n"
2222 msgstr ""
2223 "int main(int argc, char *argv[])\n"
2224 "{\n"
2225 "    struct ifaddrs *ifaddr, *ifa;\n"
2226 "    int family, s, n;\n"
2227 "    char host[NI_MAXHOST];\n"
2228
2229 #. type: Plain text
2230 #: build/C/man3/getifaddrs.3:260
2231 #, no-wrap
2232 msgid ""
2233 "    if (getifaddrs(&ifaddr) == -1) {\n"
2234 "        perror(\"getifaddrs\");\n"
2235 "        exit(EXIT_FAILURE);\n"
2236 "    }\n"
2237 msgstr ""
2238 "    if (getifaddrs(&ifaddr) == -1) {\n"
2239 "        perror(\"getifaddrs\");\n"
2240 "        exit(EXIT_FAILURE);\n"
2241 "    }\n"
2242
2243 #. type: Plain text
2244 #: build/C/man3/getifaddrs.3:263
2245 #, no-wrap
2246 msgid ""
2247 "    /* Walk through linked list, maintaining head pointer so we\n"
2248 "       can free list later */\n"
2249 msgstr ""
2250 "    /* Walk through linked list, maintaining head pointer so we\n"
2251 "       can free list later */\n"
2252
2253 #. type: Plain text
2254 #: build/C/man3/getifaddrs.3:267
2255 #, no-wrap
2256 msgid ""
2257 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2258 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2259 "            continue;\n"
2260 msgstr ""
2261 "    for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa-E<gt>ifa_next, n++) {\n"
2262 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2263 "            continue;\n"
2264
2265 #. type: Plain text
2266 #: build/C/man3/getifaddrs.3:269
2267 #, no-wrap
2268 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2269 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2270
2271 #. type: Plain text
2272 #: build/C/man3/getifaddrs.3:272
2273 #, no-wrap
2274 msgid ""
2275 "        /* Display interface name and family (including symbolic\n"
2276 "           form of the latter for the common families) */\n"
2277 msgstr ""
2278 "        /* Display interface name and family (including symbolic\n"
2279 "           form of the latter for the common families) */\n"
2280
2281 #. type: Plain text
2282 #: build/C/man3/getifaddrs.3:279
2283 #, no-wrap
2284 msgid ""
2285 "        printf(\"%-8s %s (%d)\\en\",\n"
2286 "               ifa-E<gt>ifa_name,\n"
2287 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2288 "               (family == AF_INET) ? \"AF_INET\" :\n"
2289 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2290 "               family);\n"
2291 msgstr ""
2292 "        printf(\"%-8s %s (%d)\\en\",\n"
2293 "               ifa-E<gt>ifa_name,\n"
2294 "               (family == AF_PACKET) ? \"AF_PACKET\" :\n"
2295 "               (family == AF_INET) ? \"AF_INET\" :\n"
2296 "               (family == AF_INET6) ? \"AF_INET6\" : \"???\",\n"
2297 "               family);\n"
2298
2299 #. type: Plain text
2300 #: build/C/man3/getifaddrs.3:281
2301 #, no-wrap
2302 msgid "        /* For an AF_INET* interface address, display the address */\n"
2303 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2304
2305 #. type: Plain text
2306 #: build/C/man3/getifaddrs.3:292
2307 #, no-wrap
2308 msgid ""
2309 "        if (family == AF_INET || family == AF_INET6) {\n"
2310 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2311 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2312 "                                          sizeof(struct sockaddr_in6),\n"
2313 "                    host, NI_MAXHOST,\n"
2314 "                    NULL, 0, NI_NUMERICHOST);\n"
2315 "            if (s != 0) {\n"
2316 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2317 "                exit(EXIT_FAILURE);\n"
2318 "            }\n"
2319 msgstr ""
2320 "        if (family == AF_INET || family == AF_INET6) {\n"
2321 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2322 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2323 "                                          sizeof(struct sockaddr_in6),\n"
2324 "                    host, NI_MAXHOST,\n"
2325 "                    NULL, 0, NI_NUMERICHOST);\n"
2326 "            if (s != 0) {\n"
2327 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2328 "                exit(EXIT_FAILURE);\n"
2329 "            }\n"
2330
2331 #. type: Plain text
2332 #: build/C/man3/getifaddrs.3:294
2333 #, no-wrap
2334 msgid "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2335 msgstr "            printf(\"\\et\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2336
2337 #. type: Plain text
2338 #: build/C/man3/getifaddrs.3:297
2339 #, no-wrap
2340 msgid ""
2341 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2342 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2343 msgstr ""
2344 "        } else if (family == AF_PACKET && ifa-E<gt>ifa_data != NULL) {\n"
2345 "            struct rtnl_link_stats *stats = ifa-E<gt>ifa_data;\n"
2346
2347 #. type: Plain text
2348 #: build/C/man3/getifaddrs.3:304
2349 #, no-wrap
2350 msgid ""
2351 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2352 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2353 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2354 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2355 "        }\n"
2356 "    }\n"
2357 msgstr ""
2358 "            printf(\"\\et\\ettx_packets = %10u; rx_packets = %10u\\en\"\n"
2359 "                   \"\\et\\ettx_bytes   = %10u; rx_bytes   = %10u\\en\",\n"
2360 "                   stats-E<gt>tx_packets, stats-E<gt>rx_packets,\n"
2361 "                   stats-E<gt>tx_bytes, stats-E<gt>rx_bytes);\n"
2362 "        }\n"
2363 "    }\n"
2364
2365 #. type: Plain text
2366 #: build/C/man3/getifaddrs.3:308
2367 #, no-wrap
2368 msgid ""
2369 "    freeifaddrs(ifaddr);\n"
2370 "    exit(EXIT_SUCCESS);\n"
2371 "}\n"
2372 msgstr ""
2373 "    freeifaddrs(ifaddr);\n"
2374 "    exit(EXIT_SUCCESS);\n"
2375 "}\n"
2376
2377 #. type: Plain text
2378 #: build/C/man3/getifaddrs.3:315
2379 msgid ""
2380 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2381 msgstr ""
2382 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2383
2384 #. type: TH
2385 #: build/C/man2/getsockname.2:40
2386 #, no-wrap
2387 msgid "GETSOCKNAME"
2388 msgstr "GETSOCKNAME"
2389
2390 #. type: TH
2391 #: build/C/man2/getsockname.2:40
2392 #, no-wrap
2393 msgid "2008-12-03"
2394 msgstr "2008-12-03"
2395
2396 #. type: Plain text
2397 #: build/C/man2/getsockname.2:43
2398 msgid "getsockname - get socket name"
2399 msgstr "getsockname - ソケットの名前を取得する"
2400
2401 #. type: Plain text
2402 #: build/C/man2/getsockname.2:49
2403 #, no-wrap
2404 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2405 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2406
2407 #. type: Plain text
2408 #: build/C/man2/getsockname.2:62
2409 msgid ""
2410 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2411 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2412 "should be initialized to indicate the amount of space (in bytes) pointed to "
2413 "by I<addr>.  On return it contains the actual size of the socket address."
2414 msgstr ""
2415 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2416 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2417 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2418 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2419 "納される。"
2420
2421 #. type: Plain text
2422 #: build/C/man2/getsockname.2:78 build/C/man2/getsockopt.2:142
2423 #: build/C/man2/listen.2:109
2424 msgid "The argument I<sockfd> is not a valid descriptor."
2425 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2426
2427 #. type: Plain text
2428 #: build/C/man2/getsockname.2:84
2429 msgid ""
2430 "The I<addr> argument points to memory not in a valid part of the process "
2431 "address space."
2432 msgstr ""
2433 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2434 "い。"
2435
2436 #. type: Plain text
2437 #: build/C/man2/getsockname.2:88
2438 msgid "I<addrlen> is invalid (e.g., is negative)."
2439 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2440
2441 #. type: TP
2442 #: build/C/man2/getsockname.2:88 build/C/man3/if_nameindex.3:83
2443 #: build/C/man2/send.2:367
2444 #, no-wrap
2445 msgid "B<ENOBUFS>"
2446 msgstr "B<ENOBUFS>"
2447
2448 #. type: Plain text
2449 #: build/C/man2/getsockname.2:92
2450 msgid ""
2451 "Insufficient resources were available in the system to perform the operation."
2452 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2453
2454 #. type: Plain text
2455 #: build/C/man2/getsockname.2:97 build/C/man2/getsockopt.2:171
2456 msgid "The argument I<sockfd> is a file, not a socket."
2457 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2458
2459 #.  SVr4 documents additional ENOMEM
2460 #.  and ENOSR error codes.
2461 #. type: Plain text
2462 #: build/C/man2/getsockname.2:103
2463 msgid ""
2464 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2465 "POSIX.1-2001."
2466 msgstr ""
2467 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2468
2469 #. type: Plain text
2470 #: build/C/man2/getsockname.2:114
2471 msgid ""
2472 "The third argument of B<getsockname>()  is in reality an I<int\\ *> (and "
2473 "this is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion "
2474 "resulted in the present I<socklen_t>, also used by glibc.  See also "
2475 "B<accept>(2)."
2476 msgstr ""
2477 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2478 "には I<int\\ *> である。 glibc でも使われている現在の I<socklen_t> に関し"
2479 "て、 POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2480
2481 #. type: Plain text
2482 #: build/C/man2/getsockname.2:121
2483 msgid ""
2484 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2485 "B<unix>(7)"
2486 msgstr ""
2487 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), "
2488 "B<unix>(7)"
2489
2490 #. type: TH
2491 #: build/C/man2/getsockopt.2:44
2492 #, no-wrap
2493 msgid "GETSOCKOPT"
2494 msgstr "GETSOCKOPT"
2495
2496 #. type: TH
2497 #: build/C/man2/getsockopt.2:44
2498 #, no-wrap
2499 msgid "2014-04-28"
2500 msgstr "2014-04-28"
2501
2502 #. type: Plain text
2503 #: build/C/man2/getsockopt.2:47
2504 msgid "getsockopt, setsockopt - get and set options on sockets"
2505 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2506
2507 #. type: Plain text
2508 #: build/C/man2/getsockopt.2:57
2509 #, no-wrap
2510 msgid ""
2511 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2512 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2513 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2514 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2515 msgstr ""
2516 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2517 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2518 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2519 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2520
2521 #. type: Plain text
2522 #: build/C/man2/getsockopt.2:67
2523 msgid ""
2524 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2525 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2526 "protocol levels; they are always present at the uppermost socket level."
2527 msgstr ""
2528 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2529 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2530 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2531 "定される。"
2532
2533 #. type: Plain text
2534 #: build/C/man2/getsockopt.2:86
2535 msgid ""
2536 "When manipulating socket options, the level at which the option resides and "
2537 "the name of the option must be specified.  To manipulate options at the "
2538 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2539 "options at any other level the protocol number of the appropriate protocol "
2540 "controlling the option is supplied.  For example, to indicate that an option "
2541 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2542 "protocol number of B<TCP>; see B<getprotoent>(3)."
2543 msgstr ""
2544 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2545 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2546 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2547 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2548 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2549 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2550 "B<getprotoent>(3)  を参照すること。"
2551
2552 #. type: Plain text
2553 #: build/C/man2/getsockopt.2:108
2554 msgid ""
2555 "The arguments I<optval> and I<optlen> are used to access option values for "
2556 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2557 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2558 "I<optlen> is a value-result argument, initially containing the size of the "
2559 "buffer pointed to by I<optval>, and modified on return to indicate the "
2560 "actual size of the value returned.  If no option value is to be supplied or "
2561 "returned, I<optval> may be NULL."
2562 msgstr ""
2563 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2564 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2565 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2566 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2567 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2568 "I<optval> は NULL でも良い。"
2569
2570 #. type: Plain text
2571 #: build/C/man2/getsockopt.2:118
2572 msgid ""
2573 "I<Optname> and any specified options are passed uninterpreted to the "
2574 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2575 "socket.hE<gt>> contains definitions for socket level options, described "
2576 "below.  Options at other protocol levels vary in format and name; consult "
2577 "the appropriate entries in section 4 of the manual."
2578 msgstr ""
2579 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2580 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2581 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2582 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2583 "ること。"
2584
2585 #. type: Plain text
2586 #: build/C/man2/getsockopt.2:127
2587 msgid ""
2588 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2589 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2590 "or zero if the option is to be disabled."
2591 msgstr ""
2592 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2593 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2594 "を指定し、 無効(disable)にするにはゼロを指定する。"
2595
2596 #. type: Plain text
2597 #: build/C/man2/getsockopt.2:131
2598 msgid ""
2599 "For a description of the available socket options see B<socket>(7)  and the "
2600 "appropriate protocol man pages."
2601 msgstr ""
2602 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2603 "ルの man ページを参照のこと。"
2604
2605 #. type: Plain text
2606 #: build/C/man2/getsockopt.2:152
2607 msgid ""
2608 "The address pointed to by I<optval> is not in a valid part of the process "
2609 "address space.  For B<getsockopt>(), this error may also be returned if "
2610 "I<optlen> is not in a valid part of the process address space."
2611 msgstr ""
2612 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2613 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2614 "い場合にもこのエラーが返される。"
2615
2616 #. type: Plain text
2617 #: build/C/man2/getsockopt.2:163
2618 msgid ""
2619 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2620 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2621 "option described in B<ip>(7))."
2622 msgstr ""
2623 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2624 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2625 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2626
2627 #. type: TP
2628 #: build/C/man2/getsockopt.2:163
2629 #, no-wrap
2630 msgid "B<ENOPROTOOPT>"
2631 msgstr "B<ENOPROTOOPT>"
2632
2633 #. type: Plain text
2634 #: build/C/man2/getsockopt.2:166
2635 msgid "The option is unknown at the level indicated."
2636 msgstr "指定された層(level)にはこのオプションは存在しない。"
2637
2638 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2639 #.  not document the
2640 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2641 #.  options
2642 #. type: Plain text
2643 #: build/C/man2/getsockopt.2:178
2644 msgid ""
2645 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2646 msgstr ""
2647 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2648 "POSIX.1-2001."
2649
2650 #. type: Plain text
2651 #: build/C/man2/getsockopt.2:199
2652 msgid ""
2653 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2654 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2655 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2656 "glibc.  See also B<accept>(2)."
2657 msgstr ""
2658 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2659 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2660 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2661 "る。 B<accept>(2)  も参照のこと。"
2662
2663 #. type: Plain text
2664 #: build/C/man2/getsockopt.2:202
2665 msgid ""
2666 "Several of the socket options should be handled at lower levels of the "
2667 "system."
2668 msgstr ""
2669 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2670
2671 #. type: Plain text
2672 #: build/C/man2/getsockopt.2:213
2673 msgid ""
2674 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2675 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2676 msgstr ""
2677 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<ip>(7), "
2678 "B<packet>(7), B<socket>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
2679
2680 #. type: TH
2681 #: build/C/man3/if_nameindex.3:26
2682 #, no-wrap
2683 msgid "IF_NAMEINDEX"
2684 msgstr "IF_NAMEINDEX"
2685
2686 #. type: TH
2687 #: build/C/man3/if_nameindex.3:26
2688 #, no-wrap
2689 msgid "2012-11-21"
2690 msgstr "2012-11-21"
2691
2692 #. type: Plain text
2693 #: build/C/man3/if_nameindex.3:29
2694 msgid ""
2695 "if_nameindex, if_freenameindex - get network interface names and indexes"
2696 msgstr ""
2697 "if_nameindex, if_freenameindex - ネットワークインターフェースの名前とインデッ"
2698 "クスを取得する"
2699
2700 #. type: Plain text
2701 #: build/C/man3/if_nameindex.3:32 build/C/man3/if_nametoindex.3:32
2702 #, no-wrap
2703 msgid "B<#include E<lt>net/if.hE<gt>>\n"
2704 msgstr "B<#include E<lt>net/if.hE<gt>>\n"
2705
2706 #. type: Plain text
2707 #: build/C/man3/if_nameindex.3:35
2708 #, no-wrap
2709 msgid ""
2710 "B<struct if_nameindex *if_nameindex(void);>\n"
2711 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2712 msgstr ""
2713 "B<struct if_nameindex *if_nameindex(void);>\n"
2714 "B<void if_freenameindex(struct if_nameindex *>I<ptr>B<);>\n"
2715
2716 #. type: Plain text
2717 #: build/C/man3/if_nameindex.3:46
2718 msgid ""
2719 "The B<if_nameindex>()  function returns an array of I<if_nameindex> "
2720 "structures, each containing information about one of the network interfaces "
2721 "on the local system.  The I<if_nameindex> structure contains at least the "
2722 "following entries:"
2723 msgstr ""
2724 "B<if_nameindex>() 関数は I<if_nameindex> 構造体の配列を返す。 各構造体には"
2725 "ローカルシステムのネットワークインターフェースのいずれかの情報が入る。 "
2726 "I<if_nameindex> 構造体には少なくとも以下のフィールドがある。"
2727
2728 #. type: Plain text
2729 #: build/C/man3/if_nameindex.3:51
2730 #, no-wrap
2731 msgid ""
2732 "    unsigned int if_index; /* Index of interface (1, 2, ...) */\n"
2733 "    char        *if_name;  /* Null-terminated name (\"eth0\", etc.) */\n"
2734 msgstr ""
2735 "    unsigned int if_index; /* インターフェースのインデックス (1, 2, ...) */\n"
2736 "    char        *if_name;  /*ヌル終端された名前 (\"eth0\" など) */\n"
2737
2738 #. type: Plain text
2739 #: build/C/man3/if_nameindex.3:65
2740 msgid ""
2741 "The I<if_index> field contains the interface index.  The I<ifa_name> field "
2742 "points to the null-terminated interface name.  The end of the array is "
2743 "indicated by entry with I<if_index> set to zero and I<ifa_name> set to NULL."
2744 msgstr ""
2745 "I<if_index> フィールドにはインターフェースのインデックスが入る。 I<ifa_name> "
2746 "フィールドはヌル終端されたインターフェース名を指す。 配列の最後は、 "
2747 "I<if_index> が 0 で I<ifa_name> が NULL のエントリで示される。"
2748
2749 #. type: Plain text
2750 #: build/C/man3/if_nameindex.3:71
2751 msgid ""
2752 "The data structure returned by B<if_nameindex>()  is dynamically allocated "
2753 "and should be freed using B<if_freenameindex>()  when no longer needed."
2754 msgstr ""
2755 "B<if_nameindex>() が返すデータ構造体は動的に確保される。 必要なくなった際に"
2756 "は B<if_freenameindex>() で解放すべきである。"
2757
2758 #. type: Plain text
2759 #: build/C/man3/if_nameindex.3:78
2760 msgid ""
2761 "On success, B<if_nameindex>()  returns pointer to the array; on error, NULL "
2762 "is returned, and I<errno> is set appropriately."
2763 msgstr ""
2764 "成功した場合には B<if_nameindex>() は配列へのポインタを返す。エラー時には "
2765 "NULL が返され、 I<errno> が適切に設定される。"
2766
2767 #. type: Plain text
2768 #: build/C/man3/if_nameindex.3:83
2769 msgid "B<if_nameindex>()  may fail and set I<errno> if:"
2770 msgstr "B<if_nameindex>() が失敗した場合には以下の I<errno> が設定される。"
2771
2772 #. type: Plain text
2773 #: build/C/man3/if_nameindex.3:86
2774 msgid "Insufficient resources available."
2775 msgstr "利用可能なリソースが十分にない。"
2776
2777 #. type: Plain text
2778 #: build/C/man3/if_nameindex.3:97
2779 msgid ""
2780 "B<if_nameindex>()  may also fail for any of the errors specified for "
2781 "B<socket>(2), B<bind>(2), B<ioctl>(2), B<getsockname>(2), B<recvmsg>(2), "
2782 "B<sendto>(2), or B<malloc>(3)."
2783 msgstr ""
2784 "B<if_nameindex>() は、 B<socket>(2), B<bind>(2), B<ioctl>(2), "
2785 "B<getsockname>(2), B<recvmsg>(2), B<sendto>(2), B<malloc>(3) に対して規定され"
2786 "ているエラーのいずれかで失敗する場合がある。"
2787
2788 #. type: Plain text
2789 #: build/C/man3/if_nameindex.3:104
2790 msgid ""
2791 "The B<if_nameindex>()  function first appeared in glibc 2.1, but before "
2792 "glibc 2.3.4, the implementation supported only interfaces with IPv4 "
2793 "addresses.  Support of interfaces that don't have IPv4 addresses is "
2794 "available only on kernels that support netlink."
2795 msgstr ""
2796 "B<if_nameindex>() 関数は glibc 2.1 で初めて登場したが、 glibc 2.3.4 より前の"
2797 "バージョンの実装では IPv4 アドレスを持つインターフェースのみをサポートしてい"
2798 "た。 IPv4 アドレスを持たないインターフェースがサポートされているのは、 "
2799 "netlink をサポートするカーネルにおいてのみである。"
2800
2801 #. type: Plain text
2802 #: build/C/man3/if_nameindex.3:106 build/C/man3/if_nametoindex.3:94
2803 msgid "RFC\\ 3493, POSIX.1-2001."
2804 msgstr "RFC\\ 3493, POSIX.1-2001."
2805
2806 #. type: Plain text
2807 #: build/C/man3/if_nameindex.3:108 build/C/man3/if_nametoindex.3:96
2808 msgid "This function first appeared in BSDi."
2809 msgstr "この関数は BSDi 初めて登場した。"
2810
2811 #. type: Plain text
2812 #: build/C/man3/if_nameindex.3:112
2813 msgid ""
2814 "The program below demonstrates the use of the functions described on this "
2815 "page.  An example of the output this program might produce is the following:"
2816 msgstr ""
2817 "以下のプログラムはこのページで説明した関数の使い方を示している。このプログラ"
2818 "ムが生成する出力は以下のようになる。"
2819
2820 #. type: Plain text
2821 #: build/C/man3/if_nameindex.3:119
2822 #, no-wrap
2823 msgid ""
2824 "$ B<./a.out>I<\n"
2825 "1: lo\n"
2826 "2: wlan0\n"
2827 "3: em1>\n"
2828 msgstr ""
2829 "$ B<./a.out>I<\n"
2830 "1: lo\n"
2831 "2: wlan0\n"
2832 "3: em1>\n"
2833
2834 #. type: Plain text
2835 #: build/C/man3/if_nameindex.3:127
2836 #, no-wrap
2837 msgid ""
2838 "#include E<lt>net/if.hE<gt>\n"
2839 "#include E<lt>stdio.hE<gt>\n"
2840 "#include E<lt>stdlib.hE<gt>\n"
2841 "#include E<lt>unistd.hE<gt>\n"
2842 msgstr ""
2843 "#include E<lt>net/if.hE<gt>\n"
2844 "#include E<lt>stdio.hE<gt>\n"
2845 "#include E<lt>stdlib.hE<gt>\n"
2846 "#include E<lt>unistd.hE<gt>\n"
2847
2848 #. type: Plain text
2849 #: build/C/man3/if_nameindex.3:132
2850 #, no-wrap
2851 msgid ""
2852 "int\n"
2853 "main(int argc, char *argv[])\n"
2854 "{\n"
2855 "    struct if_nameindex *if_ni, *i;\n"
2856 msgstr ""
2857 "int\n"
2858 "main(int argc, char *argv[])\n"
2859 "{\n"
2860 "    struct if_nameindex *if_ni, *i;\n"
2861
2862 #. type: Plain text
2863 #: build/C/man3/if_nameindex.3:138
2864 #, no-wrap
2865 msgid ""
2866 "    if_ni = if_nameindex();\n"
2867 "    if (if_ni == NULL) {\n"
2868 "        perror(\"if_nameindex\");\n"
2869 "        exit(EXIT_FAILURE);\n"
2870 "    }\n"
2871 msgstr ""
2872 "    if_ni = if_nameindex();\n"
2873 "    if (if_ni == NULL) {\n"
2874 "        perror(\"if_nameindex\");\n"
2875 "        exit(EXIT_FAILURE);\n"
2876 "    }\n"
2877
2878 #. type: Plain text
2879 #: build/C/man3/if_nameindex.3:141
2880 #, no-wrap
2881 msgid ""
2882 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2883 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2884 msgstr ""
2885 "    for (i = if_ni; ! (i-E<gt>if_index == 0 && i-E<gt>if_name == NULL); i++)\n"
2886 "        printf(\"%u: %s\\en\", i-E<gt>if_index, i-E<gt>if_name);\n"
2887
2888 #. type: Plain text
2889 #: build/C/man3/if_nameindex.3:143
2890 #, no-wrap
2891 msgid "    if_freenameindex(if_ni);\n"
2892 msgstr "    if_freenameindex(if_ni);\n"
2893
2894 #. type: Plain text
2895 #: build/C/man3/if_nameindex.3:146 build/C/man2/select.2:591
2896 #, no-wrap
2897 msgid ""
2898 "    exit(EXIT_SUCCESS);\n"
2899 "}\n"
2900 msgstr ""
2901 "    exit(EXIT_SUCCESS);\n"
2902 "}\n"
2903
2904 #. type: Plain text
2905 #: build/C/man3/if_nameindex.3:154
2906 msgid ""
2907 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2908 "B<if_nametoindex>(3), B<ifconfig>(8)"
2909 msgstr ""
2910 "B<getsockopt>(2), B<setsockopt>(2), B<getifaddrs>(3), B<if_indextoname>(3), "
2911 "B<if_nametoindex>(3), B<ifconfig>(8)"
2912
2913 #. type: TH
2914 #: build/C/man3/if_nametoindex.3:25
2915 #, no-wrap
2916 msgid "IF_NAMETOINDEX"
2917 msgstr "IF_NAMETOINDEX"
2918
2919 #. type: TH
2920 #: build/C/man3/if_nametoindex.3:25
2921 #, no-wrap
2922 msgid "2014-04-01"
2923 msgstr "2014-04-01"
2924
2925 #. type: Plain text
2926 #: build/C/man3/if_nametoindex.3:29
2927 msgid ""
2928 "if_nametoindex, if_indextoname - mappings between network interface names "
2929 "and indexes"
2930 msgstr ""
2931 "if_nametoindex, if_indextoname - ネットワークインターフェースの名前とインデッ"
2932 "クスのマッピングを行う"
2933
2934 #. type: Plain text
2935 #: build/C/man3/if_nametoindex.3:34
2936 #, no-wrap
2937 msgid "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2938 msgstr "B<unsigned int if_nametoindex(const char *>I<ifname>B<);>\n"
2939
2940 #. type: Plain text
2941 #: build/C/man3/if_nametoindex.3:36
2942 #, no-wrap
2943 msgid "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2944 msgstr "B<char *if_indextoname(unsigned int ifindex, char *>I<ifname>B<);>\n"
2945
2946 #. type: Plain text
2947 #: build/C/man3/if_nametoindex.3:43
2948 msgid ""
2949 "The B<if_nametoindex>()  function returns the index of the network interface "
2950 "corresponding to the name I<ifname>."
2951 msgstr ""
2952 "B<if_nametoindex>() 関数は、 名前が I<ifname> のネットワークインターフェース"
2953 "のインデックスを返す。"
2954
2955 #. type: Plain text
2956 #: build/C/man3/if_nametoindex.3:54
2957 msgid ""
2958 "The B<if_indextoname>()  function returns the name of the network interface "
2959 "corresponding to the interface index I<ifindex>.  The name is placed in the "
2960 "buffer pointed to by I<ifname>.  The buffer must allow for the storage of at "
2961 "least B<IF_NAMESIZE> bytes."
2962 msgstr ""
2963 "B<if_indextoname>() 関数は、 インターフェースのインデックスが I<ifindex> に対"
2964 "応するネットワークインターフェースの名前を返す。 名前は I<ifname> が指すバッ"
2965 "ファに格納される。 バッファは少なくとも B<IF_NAMESIZE> バイトの領域が必要であ"
2966 "る。"
2967
2968 #. type: Plain text
2969 #: build/C/man3/if_nametoindex.3:61
2970 msgid ""
2971 "On success, B<if_nametoindex>()  returns the index number of the network "
2972 "interface; on error, 0 is returned and I<errno> is set appropriately."
2973 msgstr ""
2974 "成功した場合、 B<if_nametoindex>() はネットワークインターフェースのインデック"
2975 "ス番号を返す。エラーの場合、 0 を返し、 I<errno> を適切に設定にする。"
2976
2977 #. type: Plain text
2978 #: build/C/man3/if_nametoindex.3:69
2979 msgid ""
2980 "On success, B<if_indextoname>()  returns I<ifname>; on error, NULL is "
2981 "returned and I<errno> is set appropriately."
2982 msgstr ""
2983 "成功した場合には B<if_indextoname>() は I<ifname> を返す。エラー時には NULL "
2984 "が返され、 I<errno> が適切に設定される。"
2985
2986 #. type: Plain text
2987 #: build/C/man3/if_nametoindex.3:74
2988 msgid "B<if_indextoname>()  may fail and set I<errno> if:"
2989 msgstr "B<if_indextoname>() は以下の I<errno> で失敗する場合がある。"
2990
2991 #. type: TP
2992 #: build/C/man3/if_nametoindex.3:74
2993 #, no-wrap
2994 msgid "B<ENXIO>"
2995 msgstr "B<ENXIO>"
2996
2997 #. type: Plain text
2998 #: build/C/man3/if_nametoindex.3:77
2999 msgid "No interface found for the index."
3000 msgstr "インデックスに対応するインターフェースがない。"
3001
3002 #. type: Plain text
3003 #: build/C/man3/if_nametoindex.3:85
3004 msgid ""
3005 "B<if_nametoindex>()  and B<if_indextoname>()  may also fail for any of the "
3006 "errors specified for B<socket>(2)  or B<ioctl>(2)."
3007 msgstr ""
3008 "B<if_nametoindex>() と B<if_indextoname>() は、 B<socket>(2) と B<ioctl>(2) "
3009 "に対して規定されているエラーのいずれかで失敗する場合がある。"
3010
3011 #. type: Plain text
3012 #: build/C/man3/if_nametoindex.3:92
3013 msgid ""
3014 "The B<if_nametoindex>()  and B<if_indextoname>()  functions are thread-safe."
3015 msgstr ""
3016 "関数 B<if_nametoindex>() と B<if_indextoname>() はスレッドセーフである。"
3017
3018 #. type: Plain text
3019 #: build/C/man3/if_nametoindex.3:100
3020 msgid "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3021 msgstr "B<getifaddrs>(3), B<if_nameindex>(3), B<ifconfig>(8)"
3022
3023 #. type: TH
3024 #: build/C/man2/listen.2:45
3025 #, no-wrap
3026 msgid "LISTEN"
3027 msgstr "LISTEN"
3028
3029 #. type: TH
3030 #: build/C/man2/listen.2:45
3031 #, no-wrap
3032 msgid "2014-05-10"
3033 msgstr "2014-05-10"
3034
3035 #. type: Plain text
3036 #: build/C/man2/listen.2:48
3037 msgid "listen - listen for connections on a socket"
3038 msgstr "listen - ソケット(socket)上の接続を待つ"
3039
3040 #. type: Plain text
3041 #: build/C/man2/listen.2:55
3042 #, no-wrap
3043 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3044 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
3045
3046 #. type: Plain text
3047 #: build/C/man2/listen.2:63
3048 msgid ""
3049 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
3050 "that is, as a socket that will be used to accept incoming connection "
3051 "requests using B<accept>(2)."
3052 msgstr ""
3053 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
3054 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
3055 "した接続要求を受け付けるのに使用されるソケットである。"
3056
3057 #. type: Plain text
3058 #: build/C/man2/listen.2:70
3059 msgid ""
3060 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
3061 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
3062 msgstr ""
3063 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
3064 "するファイルディスクリプタである。"
3065
3066 #. type: Plain text
3067 #: build/C/man2/listen.2:82
3068 msgid ""
3069 "The I<backlog> argument defines the maximum length to which the queue of "
3070 "pending connections for I<sockfd> may grow.  If a connection request arrives "
3071 "when the queue is full, the client may receive an error with an indication "
3072 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
3073 "the request may be ignored so that a later reattempt at connection succeeds."
3074 msgstr ""
3075 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
3076 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
3077 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
3078 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
3079 "い。"
3080
3081 #. type: Plain text
3082 #: build/C/man2/listen.2:91
3083 msgid "Another socket is already listening on the same port."
3084 msgstr "別のソケットが既に同じポートを listen している。"
3085
3086 #. type: Plain text
3087 #: build/C/man2/listen.2:114 build/C/man2/send.2:386
3088 msgid "The argument I<sockfd> is not a socket."
3089 msgstr "引き数 I<sockfd> はソケットではない。"
3090
3091 #. type: Plain text
3092 #: build/C/man2/listen.2:119
3093 msgid "The socket is not of a type that supports the B<listen>()  operation."
3094 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
3095
3096 #. type: Plain text
3097 #: build/C/man2/listen.2:124
3098 msgid ""
3099 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
3100 "4.2BSD."
3101 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
3102
3103 #. type: Plain text
3104 #: build/C/man2/listen.2:126
3105 msgid "To accept connections, the following steps are performed:"
3106 msgstr "接続を受け付けるには、以下の処理が実行される。"
3107
3108 #. type: TP
3109 #: build/C/man2/listen.2:127 build/C/man2/select_tut.2:347
3110 #, no-wrap
3111 msgid "1."
3112 msgstr "1."
3113
3114 #. type: Plain text
3115 #: build/C/man2/listen.2:130
3116 msgid "A socket is created with B<socket>(2)."
3117 msgstr "B<socket>(2)  でソケットを作成する。"
3118
3119 #. type: TP
3120 #: build/C/man2/listen.2:130 build/C/man2/select_tut.2:356
3121 #, no-wrap
3122 msgid "2."
3123 msgstr "2."
3124
3125 #. type: Plain text
3126 #: build/C/man2/listen.2:136
3127 msgid ""
3128 "The socket is bound to a local address using B<bind>(2), so that other "
3129 "sockets may be B<connect>(2)ed to it."
3130 msgstr ""
3131 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
3132 "のソケットに B<connect>(2)  できるようにする。"
3133
3134 #. type: TP
3135 #: build/C/man2/listen.2:136 build/C/man2/select_tut.2:360
3136 #, no-wrap
3137 msgid "3."
3138 msgstr "3."
3139
3140 #. type: Plain text
3141 #: build/C/man2/listen.2:140
3142 msgid ""
3143 "A willingness to accept incoming connections and a queue limit for incoming "
3144 "connections are specified with B<listen>()."
3145 msgstr ""
3146 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
3147 "定する。"
3148
3149 #. type: TP
3150 #: build/C/man2/listen.2:140 build/C/man2/select_tut.2:367
3151 #, no-wrap
3152 msgid "4."
3153 msgstr "4."
3154
3155 #. type: Plain text
3156 #: build/C/man2/listen.2:143
3157 msgid "Connections are accepted with B<accept>(2)."
3158 msgstr "B<accept>(2)  を使って接続を受け付ける。"
3159
3160 #. type: Plain text
3161 #: build/C/man2/listen.2:166
3162 msgid ""
3163 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
3164 "2.2.  Now it specifies the queue length for I<completely> established "
3165 "sockets waiting to be accepted, instead of the number of incomplete "
3166 "connection requests.  The maximum length of the queue for incomplete sockets "
3167 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
3168 "are enabled there is no logical maximum length and this setting is ignored.  "
3169 "See B<tcp>(7)  for more information."
3170 msgstr ""
3171 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
3172 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
3173 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
3174 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
3175 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
3176 "論理的な最大長は存在せず、この設定は無視される。"
3177
3178 #.  The following is now rather historic information (MTK, Jun 05)
3179 #.  Don't rely on this value in portable applications since BSD
3180 #.  (and some BSD-derived systems) limit the backlog to 5.
3181 #. type: Plain text
3182 #: build/C/man2/listen.2:179
3183 msgid ""
3184 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
3185 "somaxconn>, then it is silently truncated to that value; the default value "
3186 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
3187 "value, B<SOMAXCONN>, with the value 128."
3188 msgstr ""
3189 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
3190 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
3191 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
3192 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
3193
3194 #. type: Plain text
3195 #: build/C/man2/listen.2:188
3196 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3197 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
3198
3199 #. type: TH
3200 #: build/C/man2/recv.2:41
3201 #, no-wrap
3202 msgid "RECV"
3203 msgstr "RECV"
3204
3205 #. type: Plain text
3206 #: build/C/man2/recv.2:44
3207 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
3208 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
3209
3210 #. type: Plain text
3211 #: build/C/man2/recv.2:49 build/C/man2/select.2:53
3212 #: build/C/man2/select_tut.2:47
3213 #, no-wrap
3214 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
3215 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
3216
3217 #. type: Plain text
3218 #: build/C/man2/recv.2:53
3219 #, no-wrap
3220 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3221 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
3222
3223 #. type: Plain text
3224 #: build/C/man2/recv.2:56
3225 #, no-wrap
3226 msgid ""
3227 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3228 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3229 msgstr ""
3230 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
3231 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
3232
3233 #. type: Plain text
3234 #: build/C/man2/recv.2:58
3235 #, no-wrap
3236 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3237 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
3238
3239 #. type: Plain text
3240 #: build/C/man2/recv.2:70
3241 msgid ""
3242 "The B<recv>(), B<recvfrom>(), and B<recvmsg>()  calls are used to receive "
3243 "messages from a socket.  They may be used to receive data on both "
3244 "connectionless and connection-oriented sockets.  This page first describes "
3245 "common features of all three system calls, and then describes the "
3246 "differences between the calls."
3247 msgstr ""
3248 "B<recv>(), B<recvfrom>(), B<recvmsg>() コールは、 ソケットからメッセージを受"
3249 "け取るのに使用される。 これらはコネクションレス型のソケットにも接続指向 "
3250 "(connection-oriened) 型のソケットにも使用できる。 このページでは、まずこれら "
3251 "3 つのシステムコールすべてに共通の機能について説明し、 システムコール間の違い"
3252 "について説明する。"
3253
3254 #. type: Plain text
3255 #: build/C/man2/recv.2:76
3256 msgid ""
3257 "All three calls return the length of the message on successful completion.  "
3258 "If a message is too long to fit in the supplied buffer, excess bytes may be "
3259 "discarded depending on the type of socket the message is received from."
3260 msgstr ""
3261 "これらの三つのシステムコールはいずれも、成功した場合にはメッセージの長さを返"
3262 "す。 メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッ"
3263 "セージを受信したソケットの種類によっては余分のバイトが捨てられる かもしれな"
3264 "い。"
3265
3266 #. type: Plain text
3267 #: build/C/man2/recv.2:86
3268 msgid ""
3269 "If no messages are available at the socket, the receive calls wait for a "
3270 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
3271 "which case the value -1 is returned and the external variable I<errno> is "
3272 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
3273 "data available, up to the requested amount, rather than waiting for receipt "
3274 "of the full amount requested."
3275 msgstr ""
3276 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
3277 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
3278 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
3279 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
3280 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
3281 "る (受信されるデータの最大サイズは要求したサイズである)。"
3282
3283 #. type: Plain text
3284 #: build/C/man2/recv.2:93
3285 msgid ""
3286 "An application can use B<select>(2), B<poll>(2), or B<epoll>(7)  to "
3287 "determine when more data arrives on a socket."
3288 msgstr ""
3289 "アプリケーションは B<select>(2), B<poll>(2), B<epoll>(7) を使って、ソケットに"
3290 "さらにデータが到着しているかを判定することができる。"
3291
3292 #. type: SS
3293 #: build/C/man2/recv.2:93 build/C/man2/send.2:160
3294 #, no-wrap
3295 msgid "The flags argument"
3296 msgstr "フラグ引き数"
3297
3298 #. type: Plain text
3299 #: build/C/man2/recv.2:97
3300 msgid ""
3301 "The I<flags> argument is formed by ORing one or more of the following values:"
3302 msgstr ""
3303 "I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理和 を取ったものを指"
3304 "定する:"
3305
3306 #. type: TP
3307 #: build/C/man2/recv.2:97
3308 #, no-wrap
3309 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
3310 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
3311
3312 #. type: Plain text
3313 #: build/C/man2/recv.2:108
3314 msgid ""
3315 "Set the close-on-exec flag for the file descriptor received via a UNIX "
3316 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
3317 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
3318 "flag of B<open>(2)."
3319 msgstr ""
3320 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
3321 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
3322 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
3323 "同じ理由で有用である。"
3324
3325 #. type: TP
3326 #: build/C/man2/recv.2:108 build/C/man2/send.2:188
3327 #, no-wrap
3328 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
3329 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
3330
3331 #. type: Plain text
3332 #: build/C/man2/recv.2:118
3333 msgid ""
3334 "Enables nonblocking operation; if the operation would block, the call fails "
3335 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
3336 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
3337 msgstr ""
3338 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
3339 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
3340 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
3341
3342 #. type: TP
3343 #: build/C/man2/recv.2:118
3344 #, no-wrap
3345 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
3346 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
3347
3348 #. type: Plain text
3349 #: build/C/man2/recv.2:137
3350 msgid ""
3351 "This flag specifies that queued errors should be received from the socket "
3352 "error queue.  The error is passed in an ancillary message with a type "
3353 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
3354 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
3355 "information.  The payload of the original packet that caused the error is "
3356 "passed as normal data via I<msg_iovec>.  The original destination address of "
3357 "the datagram that caused the error is supplied via I<msg_name>."
3358 msgstr ""
3359 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
3360 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
3361 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
3362 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
3363 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
3364 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
3365 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
3366 "I<msg_name> 経由で参照できる。"
3367
3368 #. type: Plain text
3369 #: build/C/man2/recv.2:149 build/C/man2/recv.2:212
3370 msgid ""
3371 "For local errors, no address is passed (this can be checked with the "
3372 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
3373 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
3374 "the pending socket error is regenerated based on the next queued error and "
3375 "will be passed on the next socket operation."
3376 msgstr ""
3377 "ローカルなエラーの場合はアドレスは渡されない\n"
3378 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
3379 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
3380 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
3381 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
3382
3383 #. type: Plain text
3384 #: build/C/man2/recv.2:153
3385 msgid "The error is supplied in a I<sock_extended_err> structure:"
3386 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
3387
3388 #. type: Plain text
3389 #: build/C/man2/recv.2:160
3390 #, no-wrap
3391 msgid ""
3392 "#define SO_EE_ORIGIN_NONE    0\n"
3393 "#define SO_EE_ORIGIN_LOCAL   1\n"
3394 "#define SO_EE_ORIGIN_ICMP    2\n"
3395 "#define SO_EE_ORIGIN_ICMP6   3\n"
3396 msgstr ""
3397 "#define SO_EE_ORIGIN_NONE    0\n"
3398 "#define SO_EE_ORIGIN_LOCAL   1\n"
3399 "#define SO_EE_ORIGIN_ICMP    2\n"
3400 "#define SO_EE_ORIGIN_ICMP6   3\n"
3401
3402 #. type: Plain text
3403 #: build/C/man2/recv.2:172
3404 #, no-wrap
3405 msgid ""
3406 "struct sock_extended_err\n"
3407 "{\n"
3408 "    uint32_t ee_errno;   /* error number */\n"
3409 "    uint8_t  ee_origin;  /* where the error originated */\n"
3410 "    uint8_t  ee_type;    /* type */\n"
3411 "    uint8_t  ee_code;    /* code */\n"
3412 "    uint8_t  ee_pad;     /* padding */\n"
3413 "    uint32_t ee_info;    /* additional information */\n"
3414 "    uint32_t ee_data;    /* other data */\n"
3415 "    /* More data may follow */\n"
3416 "};\n"
3417 msgstr ""
3418 "struct sock_extended_err\n"
3419 "{\n"
3420 "    uint32_t ee_errno;   /* error number */\n"
3421 "    uint8_t  ee_origin;  /* where the error originated */\n"
3422 "    uint8_t  ee_type;    /* type */\n"
3423 "    uint8_t  ee_code;    /* code */\n"
3424 "    uint8_t  ee_pad;     /* padding */\n"
3425 "    uint32_t ee_info;    /* additional information */\n"
3426 "    uint32_t ee_data;    /* other data */\n"
3427 "    /* More data may follow */\n"
3428 "};\n"
3429
3430 #. type: Plain text
3431 #: build/C/man2/recv.2:174
3432 #, no-wrap
3433 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3434 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
3435
3436 #. type: Plain text
3437 #: build/C/man2/recv.2:198
3438 msgid ""
3439 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
3440 "is the origin code of where the error originated.  The other fields are "
3441 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
3442 "address of the network object where the error originated from given a "
3443 "pointer to the ancillary message.  If this address is not known, the "
3444 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
3445 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
3446 "caused the error is passed as normal data."
3447 msgstr ""
3448 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
3449 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
3450 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
3451 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
3452 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
3453 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
3454 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
3455 "される。"
3456
3457 #. type: TP
3458 #: build/C/man2/recv.2:212 build/C/man2/recv.2:401 build/C/man2/send.2:230
3459 #, no-wrap
3460 msgid "B<MSG_OOB>"
3461 msgstr "B<MSG_OOB>"
3462
3463 #. type: Plain text
3464 #: build/C/man2/recv.2:219
3465 msgid ""
3466 "This flag requests receipt of out-of-band data that would not be received in "
3467 "the normal data stream.  Some protocols place expedited data at the head of "
3468 "the normal data queue, and thus this flag cannot be used with such protocols."
3469 msgstr ""
3470 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
3471 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
3472 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
3473 "い。"
3474
3475 #. type: TP
3476 #: build/C/man2/recv.2:219
3477 #, no-wrap
3478 msgid "B<MSG_PEEK>"
3479 msgstr "B<MSG_PEEK>"
3480
3481 #. type: Plain text
3482 #: build/C/man2/recv.2:226
3483 msgid ""
3484 "This flag causes the receive operation to return data from the beginning of "
3485 "the receive queue without removing that data from the queue.  Thus, a "
3486 "subsequent receive call will return the same data."
3487 msgstr ""
3488 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3489 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3490 "が返ることになる。"
3491
3492 #. type: TP
3493 #: build/C/man2/recv.2:226
3494 #, no-wrap
3495 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3496 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3497
3498 #. type: Plain text
3499 #: build/C/man2/recv.2:234
3500 msgid ""
3501 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), "
3502 "netlink (since Linux 2.6.22), and UNIX datagram (since Linux 3.4) sockets: "
3503 "return the real length of the packet or datagram, even when it was longer "
3504 "than the passed buffer."
3505 msgstr ""
3506 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3507 "以降)、 netlink (Linux 2.6.22 以降) ソケット、 UNIX datagram ソケット (Linux "
3508 "3.4 以降) の場合、パケットやデータグラムの長さが渡したバッファよりも長かった"
3509 "場合にも、 パケットやデータグラムの実際の長さを返す。"
3510
3511 #. type: Plain text
3512 #: build/C/man2/recv.2:237
3513 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3514 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3515
3516 #. type: TP
3517 #: build/C/man2/recv.2:237
3518 #, no-wrap
3519 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3520 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3521
3522 #. type: Plain text
3523 #: build/C/man2/recv.2:245
3524 msgid ""
3525 "This flag requests that the operation block until the full request is "
3526 "satisfied.  However, the call may still return less data than requested if a "
3527 "signal is caught, an error or disconnect occurs, or the next data to be "
3528 "received is of a different type than that returned."
3529 msgstr ""
3530 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3531 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3532 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3533 "りデータが少なくても返ることがある。"
3534
3535 #. type: SS
3536 #: build/C/man2/recv.2:245
3537 #, no-wrap
3538 msgid "recvfrom()"
3539 msgstr "recvfrom()"
3540
3541 #. type: Plain text
3542 #: build/C/man2/recv.2:251
3543 msgid ""
3544 "B<recvfrom>()  places the received message into the buffer I<buf>.  The "
3545 "caller must specify the size of the buffer in I<len>."
3546 msgstr ""
3547 "B<recvfrom>() は受信したメッセージをバッファ I<buf> に格納する。 呼び出し元は"
3548 "バッファサイズを I<len> で指定しなければならない。"
3549
3550 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
3551 #.  .I src_addr
3552 #.  is filled in.
3553 #.  .I src_addr
3554 #.  is also filled in for stream sockets in the UNIX domain, but is not
3555 #.  filled in for stream sockets in the Internet domain.)
3556 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
3557 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
3558 #. type: Plain text
3559 #: build/C/man2/recv.2:279
3560 msgid ""
3561 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
3562 "address of the message, that source address is placed in the buffer pointed "
3563 "to by I<src_addr>.  In this case, I<addrlen> is a value-result argument.  "
3564 "Before the call, it should be initialized to the size of the buffer "
3565 "associated with I<src_addr>.  Upon return, I<addrlen> is updated to contain "
3566 "the actual size of the source address.  The returned address is truncated if "
3567 "the buffer provided is too small; in this case, I<addrlen> will return a "
3568 "value greater than was supplied to the call."
3569 msgstr ""
3570 "I<src_addr> が NULL 以外で、下層のプロトコルからメッセージの送信元アドレスが"
3571 "分かる場合、 この送信元アドレスが I<src_addr> が指すバッファに格納される。 こ"
3572 "の場合、 I<addrlen> は入出力両用の引き数となる。 呼び出し前に、呼び出し元は "
3573 "I<src_addr> に割り当てたバッファの大きさで初期化しておくべきである。 返ってく"
3574 "る時には、 I<addrlen> は送信元アドレスの実際の大きさに変更される。渡された"
3575 "バッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り詰められる。この場"
3576 "合には、 I<addrlen> では、呼び出し時に渡された値よりも大きな値が返される。"
3577
3578 #. type: Plain text
3579 #: build/C/man2/recv.2:286
3580 msgid ""
3581 "If the caller is not interested in the source address, I<src_addr> and "
3582 "I<addrlen> should be specified as NULL."
3583 msgstr ""
3584 "呼び出し元が送信元アドレスを必要としない場合は、 I<src_addr> と I<addrlen> に"
3585 "は NULL を指定すべきである。"
3586
3587 #. type: SS
3588 #: build/C/man2/recv.2:286
3589 #, no-wrap
3590 msgid "recv()"
3591 msgstr "recv()"
3592
3593 #. type: Plain text
3594 #: build/C/man2/recv.2:294
3595 msgid ""
3596 "The B<recv>()  call is normally used only on a I<connected> socket (see "
3597 "B<connect>(2)).  It is equivalent to the call:"
3598 msgstr ""
3599 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケットに対してのみ使用さ"
3600 "れる (B<connect>(2) 参照)。次の呼び出しと等価である。"
3601
3602 #. type: Plain text
3603 #: build/C/man2/recv.2:297
3604 #, no-wrap
3605 msgid "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3606 msgstr "    recvfrom(fd, buf, len, flags, NULL, 0));\n"
3607
3608 #. type: SS
3609 #: build/C/man2/recv.2:297
3610 #, no-wrap
3611 msgid "recvmsg()"
3612 msgstr "recvmsg()"
3613
3614 #. type: Plain text
3615 #: build/C/man2/recv.2:305
3616 msgid ""
3617 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3618 "directly supplied arguments.  This structure is defined as follows in "
3619 "I<E<lt>sys/socket.hE<gt>>:"
3620 msgstr ""
3621 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3622 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3623
3624 #. type: Plain text
3625 #: build/C/man2/recv.2:312
3626 #, no-wrap
3627 msgid ""
3628 "struct iovec {                    /* Scatter/gather array items */\n"
3629 "    void  *iov_base;              /* Starting address */\n"
3630 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3631 "};\n"
3632 msgstr ""
3633 "struct iovec {                    /* Scatter/gather array items */\n"
3634 "    void  *iov_base;              /* Starting address */\n"
3635 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3636 "};\n"
3637
3638 #. type: Plain text
3639 #: build/C/man2/recv.2:322
3640 #, no-wrap
3641 msgid ""
3642 "struct msghdr {\n"
3643 "    void         *msg_name;       /* optional address */\n"
3644 "    socklen_t     msg_namelen;    /* size of address */\n"
3645 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3646 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3647 "    void         *msg_control;    /* ancillary data, see below */\n"
3648 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3649 "    int           msg_flags;      /* flags on received message */\n"
3650 "};\n"
3651 msgstr ""
3652 "struct msghdr {\n"
3653 "    void         *msg_name;       /* 追加のアドレス */\n"
3654 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3655 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3656 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3657 "    void         *msg_control;    /* 補助データ (後述) */\n"
3658 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3659 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3660 "};\n"
3661
3662 #. type: Plain text
3663 #: build/C/man2/recv.2:338
3664 msgid ""
3665 "The I<msg_name> field points to a caller-allocated buffer that is used to "
3666 "return the source address if the socket is unconnected.  The caller should "
3667 "set I<msg_namelen> to the size of this buffer before this call; upon return "
3668 "from a successful call, I<msg_namelen> will contain the length of the "
3669 "returned address.  If the application does not need to know the source "
3670 "address, I<msg_name> can be specified as NULL."
3671 msgstr ""
3672 "フィールド I<msg_name> は、 ソケットが接続されていない場合に送信元アドレスを"
3673 "返すのに使用されるバッファを指す。 このバッファは呼び出し元が確保する。 呼び"
3674 "出し元は呼び出し前に I<msg_namelen> にこのバッファの大きさを設定しなければな"
3675 "らない。 呼び出しが成功した場合、呼び出しから返って来た際には I<msg_namelen> "
3676 "には返されるアドレスの長さが入っている。 アプリケーションが送信元アドレスを知"
3677 "る必要がない場合には、 I<msg_name> に NULL を指定することができる。"
3678
3679 #. type: Plain text
3680 #: build/C/man2/recv.2:345
3681 msgid ""
3682 "The fields I<msg_iov> and I<msg_iovlen> describe scatter-gather locations, "
3683 "as discussed in B<readv>(2)."
3684 msgstr ""
3685 "I<msg_iov> と I<msg_iovlen> フィールドは scatter-gather 用の場所を指定する。 "
3686 "B<readv>(2) に説明がある。"
3687
3688 #. type: Plain text
3689 #: build/C/man2/recv.2:360
3690 msgid ""
3691 "The field I<msg_control>, which has length I<msg_controllen>, points to a "
3692 "buffer for other protocol control-related messages or miscellaneous "
3693 "ancillary data.  When B<recvmsg>()  is called, I<msg_controllen> should "
3694 "contain the length of the available buffer in I<msg_control>; upon return "
3695 "from a successful call it will contain the length of the control message "
3696 "sequence."
3697 msgstr ""
3698 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3699 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3700 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3701 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3702 "さが入っている。"
3703
3704 #. type: Plain text
3705 #: build/C/man2/recv.2:362
3706 msgid "The messages are of the form:"
3707 msgstr "メッセージの形式は以下の通り:"
3708
3709 #. type: Plain text
3710 #: build/C/man2/recv.2:372
3711 #, no-wrap
3712 msgid ""
3713 "struct cmsghdr {\n"
3714 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3715 "    int           cmsg_level;   /* originating protocol */\n"
3716 "    int           cmsg_type;    /* protocol-specific type */\n"
3717 "/* followed by\n"
3718 "    unsigned char cmsg_data[]; */\n"
3719 "};\n"
3720 msgstr ""
3721 "struct cmsghdr {\n"
3722 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3723 "    int           cmsg_level;   /* originating protocol */\n"
3724 "    int           cmsg_type;    /* protocol-specific type */\n"
3725 "/* followed by\n"
3726 "    unsigned char cmsg_data[]; */\n"
3727 "};\n"
3728
3729 #. type: Plain text
3730 #: build/C/man2/recv.2:377
3731 msgid ""
3732 "Ancillary data should be accessed only by the macros defined in B<cmsg>(3)."
3733 msgstr ""
3734 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3735
3736 #. type: Plain text
3737 #: build/C/man2/recv.2:380
3738 msgid ""
3739 "As an example, Linux uses this ancillary data mechanism to pass extended "
3740 "errors, IP options, or file descriptors over UNIX domain sockets."
3741 msgstr ""
3742 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3743 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3744 "いる。"
3745
3746 #. type: Plain text
3747 #: build/C/man2/recv.2:388
3748 msgid ""
3749 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3750 "It can contain several flags:"
3751 msgstr ""
3752 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3753 "れる。ここにはいくつかのフラグが入る。"
3754
3755 #. type: TP
3756 #: build/C/man2/recv.2:388
3757 #, no-wrap
3758 msgid "B<MSG_EOR>"
3759 msgstr "B<MSG_EOR>"
3760
3761 #. type: Plain text
3762 #: build/C/man2/recv.2:393
3763 msgid ""
3764 "indicates end-of-record; the data returned completed a record (generally "
3765 "used with sockets of type B<SOCK_SEQPACKET>)."
3766 msgstr ""
3767 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3768 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3769
3770 #. type: TP
3771 #: build/C/man2/recv.2:393
3772 #, no-wrap
3773 msgid "B<MSG_TRUNC>"
3774 msgstr "B<MSG_TRUNC>"
3775
3776 #. type: Plain text
3777 #: build/C/man2/recv.2:397
3778 msgid ""
3779 "indicates that the trailing portion of a datagram was discarded because the "
3780 "datagram was larger than the buffer supplied."
3781 msgstr ""
3782 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3783 "た部分が捨てられたことを示す。"
3784
3785 #. type: TP
3786 #: build/C/man2/recv.2:397
3787 #, no-wrap
3788 msgid "B<MSG_CTRUNC>"
3789 msgstr "B<MSG_CTRUNC>"
3790
3791 #. type: Plain text
3792 #: build/C/man2/recv.2:401
3793 msgid ""
3794 "indicates that some control data were discarded due to lack of space in the "
3795 "buffer for ancillary data."
3796 msgstr ""
3797 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3798 "を示す。"
3799
3800 #. type: Plain text
3801 #: build/C/man2/recv.2:404
3802 msgid ""
3803 "is returned to indicate that expedited or out-of-band data were received."
3804 msgstr "速達データや帯域外データを受信したことを示す。"
3805
3806 #. type: TP
3807 #: build/C/man2/recv.2:404
3808 #, no-wrap
3809 msgid "B<MSG_ERRQUEUE>"
3810 msgstr "B<MSG_ERRQUEUE>"
3811
3812 #. type: Plain text
3813 #: build/C/man2/recv.2:408
3814 msgid ""
3815 "indicates that no data was received but an extended error from the socket "
3816 "error queue."
3817 msgstr ""
3818 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3819 "を示す。"
3820
3821 #. type: Plain text
3822 #: build/C/man2/recv.2:414
3823 msgid ""
3824 "These calls return the number of bytes received, or -1 if an error "
3825 "occurred.  In the event of an error, I<errno> is set to indicate the error."
3826 msgstr ""
3827 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返し、 I<errno> "
3828 "にエラーを示す値を設定する。"
3829
3830 #. type: Plain text
3831 #: build/C/man2/recv.2:417
3832 msgid ""
3833 "When a stream socket peer has performed an orderly shutdown, the return "
3834 "value will be 0 (the traditional \"end-of-file\" return)."
3835 msgstr ""
3836 "ストリームソケットの接続相手が正しくシャットダウンを実行した場合は、\n"
3837 "返り値は 0 (昔ながらの \"end-of-file\" の戻り値) となる。"
3838
3839 #. type: Plain text
3840 #: build/C/man2/recv.2:421
3841 msgid ""
3842 "Datagram sockets in various domains (e.g., the UNIX and Internet domains)  "
3843 "permit zero-length datagrams.  When such a datagram is received, the return "
3844 "value is 0."
3845 msgstr ""
3846 "いくつかのドメインのデータグラムソケット (UNIX ドメインやインターネットドメイ"
3847 "ンなど) では、長さ 0 のデータグラムが送信できる。 このようなデータグラムを受"
3848 "信した場合、 返り値は 0 となる。"
3849
3850 #. type: Plain text
3851 #: build/C/man2/recv.2:424
3852 msgid ""
3853 "The value 0 may also be returned if the requested number of bytes to receive "
3854 "from a stream socket was 0."
3855 msgstr ""
3856 "ストリームソケットに対する受信要求バイト数が 0 だった場合も、 値 0 が返され"
3857 "る。"
3858
3859 #. type: Plain text
3860 #: build/C/man2/recv.2:429
3861 msgid ""
3862 "These are some standard errors generated by the socket layer.  Additional "
3863 "errors may be generated and returned from the underlying protocol modules; "
3864 "see their manual pages."
3865 msgstr ""
3866 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3867 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3868 "ること。"
3869
3870 #.  Actually EAGAIN on Linux
3871 #. type: Plain text
3872 #: build/C/man2/recv.2:438
3873 msgid ""
3874 "The socket is marked nonblocking and the receive operation would block, or a "
3875 "receive timeout had been set and the timeout expired before data was "
3876 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3877 "and does not require these constants to have the same value, so a portable "
3878 "application should check for both possibilities."
3879 msgstr ""
3880 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3881 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3882 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3883 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3884 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3885
3886 #. type: Plain text
3887 #: build/C/man2/recv.2:443
3888 msgid "The argument I<sockfd> is an invalid descriptor."
3889 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3890
3891 #. type: Plain text
3892 #: build/C/man2/recv.2:447
3893 msgid ""
3894 "A remote host refused to allow the network connection (typically because it "
3895 "is not running the requested service)."
3896 msgstr ""
3897 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3898 "たサービスが起動されていないなどがある)。"
3899
3900 #. type: Plain text
3901 #: build/C/man2/recv.2:451
3902 msgid ""
3903 "The receive buffer pointer(s) point outside the process's address space."
3904 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3905
3906 #. type: Plain text
3907 #: build/C/man2/recv.2:456
3908 msgid ""
3909 "The receive was interrupted by delivery of a signal before any data were "
3910 "available; see B<signal>(7)."
3911 msgstr ""
3912 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3913
3914 #. type: Plain text
3915 #: build/C/man2/recv.2:460 build/C/man2/send.2:355
3916 msgid "Invalid argument passed."
3917 msgstr "不正な引き数が渡された。"
3918
3919 #. type: Plain text
3920 #: build/C/man2/recv.2:464
3921 msgid "Could not allocate memory for B<recvmsg>()."
3922 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3923
3924 #. type: TP
3925 #: build/C/man2/recv.2:464 build/C/man2/send.2:378
3926 #, no-wrap
3927 msgid "B<ENOTCONN>"
3928 msgstr "B<ENOTCONN>"
3929
3930 #. type: Plain text
3931 #: build/C/man2/recv.2:471
3932 msgid ""
3933 "The socket is associated with a connection-oriented protocol and has not "
3934 "been connected (see B<connect>(2)  and B<accept>(2))."
3935 msgstr ""
3936 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3937 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3938
3939 #. type: Plain text
3940 #: build/C/man2/recv.2:476
3941 msgid "The argument I<sockfd> does not refer to a socket."
3942 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3943
3944 #. type: Plain text
3945 #: build/C/man2/recv.2:479
3946 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3947 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3948
3949 #. type: Plain text
3950 #: build/C/man2/recv.2:486
3951 msgid ""
3952 "POSIX.1-2001 describes only the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3953 "flags."
3954 msgstr ""
3955 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3956 "されている。"
3957
3958 #. type: Plain text
3959 #: build/C/man2/recv.2:492
3960 msgid "The I<socklen_t> type was invented by POSIX.  See also B<accept>(2)."
3961 msgstr "I<socklen_t> 型は POSIX で発案された。 B<accept>(2) も参照。"
3962
3963 #.  glibc bug raised 12 Mar 2006
3964 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3965 #.  The problem is an underlying kernel issue: the size of the
3966 #.  __kernel_size_t type used to type this field varies
3967 #.  across architectures, but socklen_t is always 32 bits.
3968 #. type: Plain text
3969 #: build/C/man2/recv.2:506 build/C/man2/send.2:428
3970 msgid ""
3971 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3972 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3973 "I<size_t>."
3974 msgstr ""
3975 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3976 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3977 "ある。"
3978
3979 #. type: Plain text
3980 #: build/C/man2/recv.2:511
3981 msgid ""
3982 "See B<recvmmsg>(2)  for information about a Linux-specific system call that "
3983 "can be used to receive multiple datagrams in a single call."
3984 msgstr ""
3985 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3986 "固有の システムコールに関する情報が書かれている。"
3987
3988 #. type: Plain text
3989 #: build/C/man2/recv.2:516
3990 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3991 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3992
3993 #. type: Plain text
3994 #: build/C/man2/recv.2:527
3995 msgid ""
3996 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3997 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3998 msgstr ""
3999 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
4000 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
4001
4002 #. type: TH
4003 #: build/C/man2/recvmmsg.2:31
4004 #, no-wrap
4005 msgid "RECVMMSG"
4006 msgstr "RECVMMSG"
4007
4008 #. type: TH
4009 #: build/C/man2/recvmmsg.2:31
4010 #, no-wrap
4011 msgid "2014-06-13"
4012 msgstr "2014-06-13"
4013
4014 #. type: Plain text
4015 #: build/C/man2/recvmmsg.2:34
4016 msgid "recvmmsg - receive multiple messages on a socket"
4017 msgstr "recvmmsg - 複数のメッセージをソケットから受信する"
4018
4019 #. type: Plain text
4020 #: build/C/man2/recvmmsg.2:38 build/C/man2/sendmmsg.2:35
4021 #, no-wrap
4022 msgid ""
4023 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
4024 "B<#include E<lt>sys/socket.hE<gt>>\n"
4025 msgstr ""
4026 "B<#define _GNU_SOURCE>         /* feature_test_macros(7) 参照 */\n"
4027 "B<#include E<lt>sys/socket.hE<gt>>\n"
4028
4029 #. type: Plain text
4030 #: build/C/man2/recvmmsg.2:41
4031 #, no-wrap
4032 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4033 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
4034
4035 #. type: Plain text
4036 #: build/C/man2/recvmmsg.2:43
4037 #, no-wrap
4038 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4039 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
4040
4041 #. type: Plain text
4042 #: build/C/man2/recvmmsg.2:55
4043 msgid ""
4044 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
4045 "the caller to receive multiple messages from a socket using a single system "
4046 "call.  (This has performance benefits for some applications.)  A further "
4047 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
4048 "operation."
4049 msgstr ""
4050 "B<recvmmsg>() システムコールは B<recvmsg>(2) の拡張で、 このシステムコールを"
4051 "使うと一度の呼び出しでソケットから複数のメッセージを受信することができる (ア"
4052 "プリケーションによっては性能上のメリットがある)。 他に B<recvmsg>(2) から拡張"
4053 "されている点としては、受信操作におけるタイムアウトのサポートがある。"
4054
4055 #. type: Plain text
4056 #: build/C/man2/recvmmsg.2:59
4057 msgid ""
4058 "The I<sockfd> argument is the file descriptor of the socket to receive data "
4059 "from."
4060 msgstr ""
4061 "I<sockfd> 引き数は、データを受信するソケットのファイルディスクリプタである。"
4062
4063 #. type: Plain text
4064 #: build/C/man2/recvmmsg.2:67 build/C/man2/sendmmsg.2:62
4065 msgid ""
4066 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
4067 "The size of this array is specified in I<vlen>."
4068 msgstr ""
4069 "I<msgvec> 引き数は I<mmsghdr> 構造体の配列である。 この配列の大きさは "
4070 "I<vlen> で指定する。"
4071
4072 #. type: Plain text
4073 #: build/C/man2/recvmmsg.2:73 build/C/man2/sendmmsg.2:68
4074 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
4075 msgstr ""
4076 "I<mmsghdr> 構造体は I<E<lt>sys/socket.hE<gt>> で次のように定義されている。"
4077
4078 #. type: Plain text
4079 #: build/C/man2/recvmmsg.2:80
4080 #, no-wrap
4081 msgid ""
4082 "struct mmsghdr {\n"
4083 "    struct msghdr msg_hdr;  /* Message header */\n"
4084 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
4085 "};\n"
4086 msgstr ""
4087 "struct mmsghdr {\n"
4088 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
4089 "    unsigned int  msg_len;  /* このヘッダで受信されたバイト数 */\n"
4090 "};\n"
4091
4092 #. type: Plain text
4093 #: build/C/man2/recvmmsg.2:95
4094 msgid ""
4095 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
4096 "B<recvmsg>(2).  The I<msg_len> field is the number of bytes returned for the "
4097 "message in the entry.  This field has the same value as the return value of "
4098 "a single B<recvmsg>(2)  on the header."
4099 msgstr ""
4100 "I<msg_hdr> フィールドは、 B<recvmsg>(2) で説明されている I<msghdr> 構造体であ"
4101 "る。 I<msg_len> フィールドは、 このエントリで返されるメッセージのバイト数"
4102 "で、 このヘッダに対して B<recvmsg>(2) を呼び出した場合の返り値と同じ値が入"
4103 "る。"
4104
4105 #. type: Plain text
4106 #: build/C/man2/recvmmsg.2:102
4107 msgid ""
4108 "The I<flags> argument contains flags ORed together.  The flags are the same "
4109 "as documented for B<recvmsg>(2), with the following addition:"
4110 msgstr ""
4111 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。 フラグは、 "
4112 "B<recvmsg>(2) で説明されているものに加えて、以下が使用できる。"
4113
4114 #. type: TP
4115 #: build/C/man2/recvmmsg.2:102
4116 #, no-wrap
4117 msgid "B<MSG_WAITFORONE> (since Linux 2.6.34)"
4118 msgstr "B<MSG_WAITFORONE> (Linux 2.6.34 以降)"
4119
4120 #. type: Plain text
4121 #: build/C/man2/recvmmsg.2:107
4122 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
4123 msgstr "最初のメッセージを受信後に B<MSG_DONTWAIT> を有効にする。"
4124
4125 #. type: Plain text
4126 #: build/C/man2/recvmmsg.2:122
4127 msgid ""
4128 "The I<timeout> argument points to a I<struct timespec> (see "
4129 "B<clock_gettime>(2))  defining a timeout (seconds plus nanoseconds) for the "
4130 "receive operation (I<but see BUGS!>).  (This interval will be rounded up to "
4131 "the system clock granularity, and kernel scheduling delays mean that the "
4132 "blocking interval may overrun by a small amount.)  If I<timeout> is NULL, "
4133 "then the operation blocks indefinitely."
4134 msgstr ""
4135 "I<timeout> 引き数は I<struct timespec> (B<clock_gettime>(2) 参照) へのポイン"
4136 "タで、 この構造体で受信操作のタイムアウト (秒とナノ秒) を指定する (I<ただし、"
4137 "バグを参照のこと>) (待ち時間はシステムクロックの粒度に切り上げられ、カーネル"
4138 "のスケジューリング遅延により少しだけ長くなる可能性がある)。 I<timeout>が "
4139 "NULL の場合、 受信操作は無期限に停止 (block) する。"
4140
4141 #. type: Plain text
4142 #: build/C/man2/recvmmsg.2:133
4143 msgid ""
4144 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
4145 "received or until the timeout expires.  A nonblocking call reads as many "
4146 "messages as are available (up to the limit specified by I<vlen>)  and "
4147 "returns immediately."
4148 msgstr ""
4149 "停止 (blocking) モードの B<recvmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
4150 "を受信するか、タイムアウトが満了するまで停止する。 非停止 (nonblocking) モー"
4151 "ドの呼び出しでは、 読み出し可能なメッセージ (最大で I<vlen> 個) を読み出し、 "
4152 "すぐに返る。"
4153
4154 #. type: Plain text
4155 #: build/C/man2/recvmmsg.2:148
4156 msgid ""
4157 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
4158 "to contain information about each received message: I<msg_len> contains the "
4159 "size of the received message; the subfields of I<msg_hdr> are updated as "
4160 "described in B<recvmsg>(2).  The return value of the call indicates the "
4161 "number of elements of I<msgvec> that have been updated."
4162 msgstr ""
4163 "B<recvmmsg>() が返った際には、 I<msgvec> のうちデータが受信された要素には、受"
4164 "信したそれぞれのメッセージの情報が格納されている。 また、 I<msg_len> には受信"
4165 "したメッセージの大きさが入り、 I<msg_hdr> の各フィールドは B<recvmsg>(2) に書"
4166 "かれている通りに更新される。 呼び出しの返り値は、更新された I<msgvec> の要素"
4167 "数である。"
4168
4169 #. type: Plain text
4170 #: build/C/man2/recvmmsg.2:156
4171 msgid ""
4172 "On success, B<recvmmsg>()  returns the number of messages received in "
4173 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
4174 "error."
4175 msgstr ""
4176 "成功すると、 B<recvmmsg>() は I<msgvec> に受信されたメッセージ数を返す。 エ"
4177 "ラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
4178
4179 #. type: Plain text
4180 #: build/C/man2/recvmmsg.2:160
4181 msgid ""
4182 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
4183 msgstr ""
4184 "エラーは B<recvmsg>(2) と同じである。 これに加えて、以下のエラーが起こる場合"
4185 "がある。"
4186
4187 #. type: Plain text
4188 #: build/C/man2/recvmmsg.2:164
4189 msgid "I<timeout> is invalid."
4190 msgstr "I<timeout> が無効である。"
4191
4192 #. type: Plain text
4193 #: build/C/man2/recvmmsg.2:169
4194 msgid ""
4195 "The B<recvmmsg>()  system call was added in Linux 2.6.33.  Support in glibc "
4196 "was added in version 2.12."
4197 msgstr ""
4198 "B<recvmmsg>() システムコールは Linux 2.6.33 で追加された。 glibc でのサポート"
4199 "はバージョン 2.12 以降で利用可能である。"
4200
4201 #. type: Plain text
4202 #: build/C/man2/recvmmsg.2:172
4203 msgid "B<recvmmsg>()  is Linux-specific."
4204 msgstr "B<recvmmsg>() は Linux 固有である。"
4205
4206 #. type: Plain text
4207 #: build/C/man2/recvmmsg.2:180
4208 msgid ""
4209 "The following program uses B<recvmmsg>()  to receive multiple messages on a "
4210 "socket and stores them in multiple buffers.  The call returns if all buffers "
4211 "are filled or if the timeout specified has expired."
4212 msgstr ""
4213 "以下のプログラムは、 B<recvmmsg>() を使って複数のメッセージをソケットから受信"
4214 "し、それらを複数のバッファに格納する。 呼び出しは、すべてのバッファにメッセー"
4215 "ジが格納されるか、 指定したタイムアウト時間が経過すると返る。"
4216
4217 #. type: Plain text
4218 #: build/C/man2/recvmmsg.2:183
4219 msgid ""
4220 "The following snippet periodically generates UDP datagrams containing a "
4221 "random number:"
4222 msgstr ""
4223 "以下のコマンドは、 ランダムな数字が入った UDP データグラムを定期的に生成す"
4224 "る。"
4225
4226 #. type: Plain text
4227 #: build/C/man2/recvmmsg.2:188
4228 #, no-wrap
4229 msgid ""
4230 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4231 "B<sleep 0.25; done>\n"
4232 msgstr ""
4233 "$B< while true; do echo $RANDOM E<gt> /dev/udp/127.0.0.1/1234; >\n"
4234 "B<sleep 0.25; done>\n"
4235
4236 #. type: Plain text
4237 #: build/C/man2/recvmmsg.2:193
4238 msgid ""
4239 "These datagrams are read by the example application, which can give the "
4240 "following output:"
4241 msgstr ""
4242 "生成されたデータグラムをサンプルアプリケーションが読み出し、以下のような出力"
4243 "が得られる。"
4244
4245 #. type: Plain text
4246 #: build/C/man2/recvmmsg.2:203
4247 #, no-wrap
4248 msgid ""
4249 "$B< ./a.out>\n"
4250 "5 messages received\n"
4251 "1 11782\n"
4252 "2 11345\n"
4253 "3 304\n"
4254 "4 13514\n"
4255 "5 28421\n"
4256 msgstr ""
4257 "$B< ./a.out>\n"
4258 "5 messages received\n"
4259 "1 11782\n"
4260 "2 11345\n"
4261 "3 304\n"
4262 "4 13514\n"
4263 "5 28421\n"
4264
4265 #. type: Plain text
4266 #: build/C/man2/recvmmsg.2:214
4267 #, no-wrap
4268 msgid ""
4269 "#define _GNU_SOURCE\n"
4270 "#include E<lt>netinet/ip.hE<gt>\n"
4271 "#include E<lt>stdio.hE<gt>\n"
4272 "#include E<lt>stdlib.hE<gt>\n"
4273 "#include E<lt>string.hE<gt>\n"
4274 "#include E<lt>sys/socket.hE<gt>\n"
4275 msgstr ""
4276 "#define _GNU_SOURCE\n"
4277 "#include E<lt>netinet/ip.hE<gt>\n"
4278 "#include E<lt>stdio.hE<gt>\n"
4279 "#include E<lt>stdlib.hE<gt>\n"
4280 "#include E<lt>string.hE<gt>\n"
4281 "#include E<lt>sys/socket.hE<gt>\n"
4282
4283 #. type: Plain text
4284 #: build/C/man2/recvmmsg.2:227
4285 #, no-wrap
4286 msgid ""
4287 "int\n"
4288 "main(void)\n"
4289 "{\n"
4290 "#define VLEN 10\n"
4291 "#define BUFSIZE 200\n"
4292 "#define TIMEOUT 1\n"
4293 "    int sockfd, retval, i;\n"
4294 "    struct sockaddr_in sa;\n"
4295 "    struct mmsghdr msgs[VLEN];\n"
4296 "    struct iovec iovecs[VLEN];\n"
4297 "    char bufs[VLEN][BUFSIZE+1];\n"
4298 "    struct timespec timeout;\n"
4299 msgstr ""
4300 "int\n"
4301 "main(void)\n"
4302 "{\n"
4303 "#define VLEN 10\n"
4304 "#define BUFSIZE 200\n"
4305 "#define TIMEOUT 1\n"
4306 "    int sockfd, retval, i;\n"
4307 "    struct sockaddr_in sa;\n"
4308 "    struct mmsghdr msgs[VLEN];\n"
4309 "    struct iovec iovecs[VLEN];\n"
4310 "    char bufs[VLEN][BUFSIZE+1];\n"
4311 "    struct timespec timeout;\n"
4312
4313 #. type: Plain text
4314 #: build/C/man2/recvmmsg.2:233 build/C/man2/sendmmsg.2:201
4315 #, no-wrap
4316 msgid ""
4317 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4318 "    if (sockfd == -1) {\n"
4319 "        perror(\"socket()\");\n"
4320 "        exit(EXIT_FAILURE);\n"
4321 "    }\n"
4322 msgstr ""
4323 "    sockfd = socket(AF_INET, SOCK_DGRAM, 0);\n"
4324 "    if (sockfd == -1) {\n"
4325 "        perror(\"socket()\");\n"
4326 "        exit(EXIT_FAILURE);\n"
4327 "    }\n"
4328
4329 #. type: Plain text
4330 #: build/C/man2/recvmmsg.2:241
4331 #, no-wrap
4332 msgid ""
4333 "    sa.sin_family = AF_INET;\n"
4334 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4335 "    sa.sin_port = htons(1234);\n"
4336 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4337 "        perror(\"bind()\");\n"
4338 "        exit(EXIT_FAILURE);\n"
4339 "    }\n"
4340 msgstr ""
4341 "    sa.sin_family = AF_INET;\n"
4342 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
4343 "    sa.sin_port = htons(1234);\n"
4344 "    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
4345 "        perror(\"bind()\");\n"
4346 "        exit(EXIT_FAILURE);\n"
4347 "    }\n"
4348
4349 #. type: Plain text
4350 #: build/C/man2/recvmmsg.2:249
4351 #, no-wrap
4352 msgid ""
4353 "    memset(msgs, 0, sizeof(msgs));\n"
4354 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4355 "        iovecs[i].iov_base         = bufs[i];\n"
4356 "        iovecs[i].iov_len          = BUFSIZE;\n"
4357 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4358 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4359 "    }\n"
4360 msgstr ""
4361 "    memset(msgs, 0, sizeof(msgs));\n"
4362 "    for (i = 0; i E<lt> VLEN; i++) {\n"
4363 "        iovecs[i].iov_base         = bufs[i];\n"
4364 "        iovecs[i].iov_len          = BUFSIZE;\n"
4365 "        msgs[i].msg_hdr.msg_iov    = &iovecs[i];\n"
4366 "        msgs[i].msg_hdr.msg_iovlen = 1;\n"
4367 "    }\n"
4368
4369 #. type: Plain text
4370 #: build/C/man2/recvmmsg.2:252
4371 #, no-wrap
4372 msgid ""
4373 "    timeout.tv_sec = TIMEOUT;\n"
4374 "    timeout.tv_nsec = 0;\n"
4375 msgstr ""
4376 "    timeout.tv_sec = TIMEOUT;\n"
4377 "    timeout.tv_nsec = 0;\n"
4378
4379 #. type: Plain text
4380 #: build/C/man2/recvmmsg.2:258
4381 #, no-wrap
4382 msgid ""
4383 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4384 "    if (retval == -1) {\n"
4385 "        perror(\"recvmmsg()\");\n"
4386 "        exit(EXIT_FAILURE);\n"
4387 "    }\n"
4388 msgstr ""
4389 "    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);\n"
4390 "    if (retval == -1) {\n"
4391 "        perror(\"recvmmsg()\");\n"
4392 "        exit(EXIT_FAILURE);\n"
4393 "    }\n"
4394
4395 #. type: Plain text
4396 #: build/C/man2/recvmmsg.2:266
4397 #, no-wrap
4398 msgid ""
4399 "    printf(\"%d messages received\\en\", retval);\n"
4400 "    for (i = 0; i E<lt> retval; i++) {\n"
4401 "        bufs[i][msgs[i].msg_len] = 0;\n"
4402 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4403 "    }\n"
4404 "    exit(EXIT_SUCCESS);\n"
4405 "}\n"
4406 msgstr ""
4407 "    printf(\"%d messages received\\en\", retval);\n"
4408 "    for (i = 0; i E<lt> retval; i++) {\n"
4409 "        bufs[i][msgs[i].msg_len] = 0;\n"
4410 "        printf(\"%d %s\", i+1, bufs[i]);\n"
4411 "    }\n"
4412 "    exit(EXIT_SUCCESS);\n"
4413 "}\n"
4414
4415 #.  FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=75371
4416 #.  http://thread.gmane.org/gmane.linux.man/5677
4417 #. type: Plain text
4418 #: build/C/man2/recvmmsg.2:278
4419 msgid ""
4420 "The I<timeout> argument does not work as intended.  The timeout is checked "
4421 "only after the receipt of each datagram, so that if up to I<vlen-1> "
4422 "datagrams are received before the timeout expires, but then no further "
4423 "datagrams are received, the call will block forever."
4424 msgstr ""
4425 "I<timeout> 引き数は意図した通りには動作しない。 タイムアウトは各データグラム"
4426 "の受信後にのみチェックされる。 そのため、 タイムアウトが満了する前に "
4427 "I<vlen-1> 個のデータグラムを受信し、 その後全くデータグラムを受信しなかった場"
4428 "合、 呼び出しはずっと停止し続けてしまう。"
4429
4430 #. type: Plain text
4431 #: build/C/man2/recvmmsg.2:285
4432 msgid ""
4433 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4434 "B<socket>(2), B<socket>(7)"
4435 msgstr ""
4436 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
4437 "B<socket>(2), B<socket>(7)"
4438
4439 #. type: TH
4440 #: build/C/man2/select.2:38
4441 #, no-wrap
4442 msgid "SELECT"
4443 msgstr "SELECT"
4444
4445 #. type: TH
4446 #: build/C/man2/select.2:38
4447 #, no-wrap
4448 msgid "2015-01-22"
4449 msgstr ""
4450
4451 #. type: Plain text
4452 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:36
4453 msgid ""
4454 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
4455 "multiplexing"
4456 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
4457
4458 #. type: Plain text
4459 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:39
4460 #, no-wrap
4461 msgid "/* According to POSIX.1-2001 */\n"
4462 msgstr "/* POSIX.1-2001 に従う場合 */\n"
4463
4464 #. type: Plain text
4465 #: build/C/man2/select.2:47 build/C/man2/select.2:68
4466 #: build/C/man2/select_tut.2:41 build/C/man2/select_tut.2:62
4467 #, no-wrap
4468 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
4469 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
4470
4471 #. type: Plain text
4472 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:43
4473 #, no-wrap
4474 msgid "/* According to earlier standards */\n"
4475 msgstr "/* 以前の規格に従う場合 */\n"
4476
4477 #. type: Plain text
4478 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:45
4479 #, no-wrap
4480 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
4481 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
4482
4483 #. type: Plain text
4484 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:49
4485 #, no-wrap
4486 msgid "B<#include E<lt>unistd.hE<gt>>\n"
4487 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
4488
4489 #. type: Plain text
4490 #: build/C/man2/select.2:58
4491 #, no-wrap
4492 msgid ""
4493 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4494 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4495 msgstr ""
4496 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4497 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
4498
4499 #. type: Plain text
4500 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:54
4501 #, no-wrap
4502 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4503 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4504
4505 #. type: Plain text
4506 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:56
4507 #, no-wrap
4508 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4509 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4510
4511 #. type: Plain text
4512 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:58
4513 #, no-wrap
4514 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4515 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
4516
4517 #. type: Plain text
4518 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:60
4519 #, no-wrap
4520 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4521 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
4522
4523 #. type: Plain text
4524 #: build/C/man2/select.2:72
4525 #, no-wrap
4526 msgid ""
4527 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4528 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4529 "B<            const sigset_t *>I<sigmask>B<);>\n"
4530 msgstr ""
4531 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4532 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
4533 "B<            const sigset_t *>I<sigmask>B<);>\n"
4534
4535 #. type: Plain text
4536 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:71
4537 #: build/C/man3/sockatmark.3:36
4538 msgid ""
4539 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
4540 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
4541
4542 #. type: Plain text
4543 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:75
4544 msgid ""
4545 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4546 "600"
4547 msgstr ""
4548 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
4549 "600"
4550
4551 #. type: Plain text
4552 #: build/C/man2/select.2:93
4553 msgid ""
4554 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
4555 "descriptors, waiting until one or more of the file descriptors become \"ready"
4556 "\" for some class of I/O operation (e.g., input possible).  A file "
4557 "descriptor is considered ready if it is possible to perform a corresponding "
4558 "I/O operation (e.g., B<read>(2)  without blocking, or a sufficiently small "
4559 "B<write>(2))."
4560 msgstr ""
4561 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
4562 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
4563 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
4564 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 (B<read>(2)  な"
4565 "どの) 対応する I/O 操作が停止 (block) なしに実行したり、 十分小さな "
4566 "B<write>(2) を実行したりできる状態にあることを意味する。"
4567
4568 #. type: Plain text
4569 #: build/C/man2/select.2:99
4570 msgid ""
4571 "The operation of B<select>()  and B<pselect>()  is identical, other than "
4572 "these three differences:"
4573 msgstr ""
4574 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
4575
4576 #. type: TP
4577 #: build/C/man2/select.2:99
4578 #, no-wrap
4579 msgid "(i)"
4580 msgstr "(i)"
4581
4582 #. type: Plain text
4583 #: build/C/man2/select.2:109
4584 msgid ""
4585 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
4586 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
4587 "and nanoseconds)."
4588 msgstr ""
4589 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
4590 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
4591 "timespec> (秒・ナノ秒単位) を用いる。"
4592
4593 #. type: TP
4594 #: build/C/man2/select.2:109
4595 #, no-wrap
4596 msgid "(ii)"
4597 msgstr "(ii)"
4598
4599 #. type: Plain text
4600 #: build/C/man2/select.2:117
4601 msgid ""
4602 "B<select>()  may update the I<timeout> argument to indicate how much time "
4603 "was left.  B<pselect>()  does not change this argument."
4604 msgstr ""
4605 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
4606 "B<pselect>()  はこの引き数を変更しない。"
4607
4608 #. type: TP
4609 #: build/C/man2/select.2:117
4610 #, no-wrap
4611 msgid "(iii)"
4612 msgstr "(iii)"
4613
4614 #. type: Plain text
4615 #: build/C/man2/select.2:126
4616 msgid ""
4617 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
4618 "with NULL I<sigmask>."
4619 msgstr ""
4620 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
4621 "指定した場合の B<pselect>()  と同じである。"
4622
4623 #. type: Plain text
4624 #: build/C/man2/select.2:144
4625 msgid ""
4626 "Three independent sets of file descriptors are watched.  Those listed in "
4627 "I<readfds> will be watched to see if characters become available for reading "
4628 "(more precisely, to see if a read will not block; in particular, a file "
4629 "descriptor is also ready on end-of-file), those in I<writefds> will be "
4630 "watched to see if space is available for write (though a large write may "
4631 "still block), and those in I<exceptfds> will be watched for exceptions.  On "
4632 "exit, the sets are modified in place to indicate which file descriptors "
4633 "actually changed status.  Each of the three file descriptor sets may be "
4634 "specified as NULL if no file descriptors are to be watched for the "
4635 "corresponding class of events."
4636 msgstr ""
4637 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
4638 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
4639 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
4640 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
4641 "I<writefds> に入れられたディスクリプタについては、書き込み用に利用可能な領域"
4642 "があるかを監視する (ただし、大きな書き込みの場合には停止する可能性はある)。 "
4643 "I<exceptfds> にあるものについては、例外の監視を行なう。システムコール終了時"
4644 "に、 どのファイルディスクリプタの状態が実際に変化したか示すために、 集合の内"
4645 "容が変更される。 ある種別のイベントを監視したいファイルディスクリプタが一つも"
4646 "ない場合には、 対応するファイルディスクリプタ集合に NULL を指定することができ"
4647 "る。"
4648
4649 #. type: Plain text
4650 #: build/C/man2/select.2:157
4651 msgid ""
4652 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
4653 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
4654 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
4655 "part of the set; this is useful after B<select>()  returns."
4656 msgstr ""
4657 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
4658 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
4659 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
4660 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
4661 "る。"
4662
4663 #. type: Plain text
4664 #: build/C/man2/select.2:160
4665 msgid ""
4666 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
4667 "plus 1."
4668 msgstr ""
4669 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
4670 "のである。"
4671
4672 #. type: Plain text
4673 #: build/C/man2/select.2:167
4674 msgid ""
4675 "The I<timeout> argument specifies the interval that B<select>()  should "
4676 "block waiting for a file descriptor to become ready.  The call will block "
4677 "until either:"
4678 msgstr ""
4679 "I<timeout> 引き数は、 B<select>() がファイルディスクリプタが ready になるのを"
4680 "待って停止する時間を指定する。 呼び出しは以下のいずれかになるまで停止する。"
4681
4682 #. type: IP
4683 #: build/C/man2/select.2:167 build/C/man2/select.2:169
4684 #: build/C/man2/select.2:171
4685 #, no-wrap
4686 msgid "*"
4687 msgstr "*"
4688
4689 #. type: Plain text
4690 #: build/C/man2/select.2:169
4691 msgid "a file descriptor becomes ready;"
4692 msgstr "ファイルディスクリプタが利用可能になる。"
4693
4694 #. type: Plain text
4695 #: build/C/man2/select.2:171
4696 msgid "the call is interrupted by a signal handler; or"
4697 msgstr "システムコールがシグナルハンドラにより割り込まれた。"
4698
4699 #. type: Plain text
4700 #: build/C/man2/select.2:173
4701 msgid "the timeout expires."
4702 msgstr "タイムアウト時間が満了した。"
4703
4704 #. type: Plain text
4705 #: build/C/man2/select.2:190
4706 msgid ""
4707 "Note that the I<timeout> interval will be rounded up to the system clock "
4708 "granularity, and kernel scheduling delays mean that the blocking interval "
4709 "may overrun by a small amount.  If both fields of the I<timeval> structure "
4710 "are zero, then B<select>()  returns immediately.  (This is useful for "
4711 "polling.)  If I<timeout> is NULL (no timeout), B<select>()  can block "
4712 "indefinitely."
4713 msgstr ""
4714 "この I<timeout> 時間はシステムクロックの粒度に切り上げられ、 カーネルのスケ"
4715 "ジューリング遅延により少しだけ長くなる可能性がある点に注意すること。 "
4716 "I<timeval> 構造体の両方のフィールドが 0 の場合、 B<select>() はすぐに復帰す"
4717 "る (この機能はポーリング (polling) を行うのに便利である)。 I<timeout> に "
4718 "NULL (タイムアウトなし) が指定されると、 B<select>() は無期限に停止 (block) "
4719 "する。"
4720
4721 #. type: Plain text
4722 #: build/C/man2/select.2:200
4723 msgid ""
4724 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
4725 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
4726 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
4727 "restores the original signal mask."
4728 msgstr ""
4729 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
4730 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
4731 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
4732 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
4733
4734 #. type: Plain text
4735 #: build/C/man2/select.2:206
4736 msgid ""
4737 "Other than the difference in the precision of the I<timeout> argument, the "
4738 "following B<pselect>()  call:"
4739 msgstr ""
4740 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
4741
4742 #. type: Plain text
4743 #: build/C/man2/select.2:210
4744 #, no-wrap
4745 msgid ""
4746 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4747 "                    timeout, &sigmask);\n"
4748 msgstr ""
4749 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4750 "                    timeout, &sigmask);\n"
4751
4752 #. type: Plain text
4753 #: build/C/man2/select.2:215
4754 msgid "is equivalent to I<atomically> executing the following calls:"
4755 msgstr "次のコールを I<atomic> に実行するのと等価である。"
4756
4757 #. type: Plain text
4758 #: build/C/man2/select.2:218
4759 #, no-wrap
4760 msgid "    sigset_t origmask;\n"
4761 msgstr "    sigset_t origmask;\n"
4762
4763 #. type: Plain text
4764 #: build/C/man2/select.2:222
4765 #, no-wrap
4766 msgid ""
4767 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4768 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4769 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4770 msgstr ""
4771 "    pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);\n"
4772 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
4773 "    pthread_sigmask(SIG_SETMASK, &origmask, NULL);\n"
4774
4775 #. type: Plain text
4776 #: build/C/man2/select.2:243
4777 msgid ""
4778 "The reason that B<pselect>()  is needed is that if one wants to wait for "
4779 "either a signal or for a file descriptor to become ready, then an atomic "
4780 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
4781 "a global flag and returns.  Then a test of this global flag followed by a "
4782 "call of B<select>()  could hang indefinitely if the signal arrived just "
4783 "after the test but just before the call.  By contrast, B<pselect>()  allows "
4784 "one to first block signals, handle the signals that have come in, then call "
4785 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
4786 msgstr ""
4787 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
4788 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
4789 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
4790 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
4791 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
4792 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
4793 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
4794 "で、前記の競合を避けることができる。)"
4795
4796 #. type: SS
4797 #: build/C/man2/select.2:243
4798 #, no-wrap
4799 msgid "The timeout"
4800 msgstr "タイムアウト"
4801
4802 #. type: Plain text
4803 #: build/C/man2/select.2:247
4804 msgid ""
4805 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
4806 "like"
4807 msgstr ""
4808 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
4809
4810 #. type: Plain text
4811 #: build/C/man2/select.2:254
4812 #, no-wrap
4813 msgid ""
4814 "struct timeval {\n"
4815 "    long    tv_sec;         /* seconds */\n"
4816 "    long    tv_usec;        /* microseconds */\n"
4817 "};\n"
4818 msgstr ""
4819 "struct timeval {\n"
4820 "    long    tv_sec;         /* 秒 */\n"
4821 "    long    tv_usec;        /* マイクロ秒 */\n"
4822 "};\n"
4823
4824 #. type: Plain text
4825 #: build/C/man2/select.2:258
4826 msgid "and"
4827 msgstr "や"
4828
4829 #. type: Plain text
4830 #: build/C/man2/select.2:265
4831 #, no-wrap
4832 msgid ""
4833 "struct timespec {\n"
4834 "    long    tv_sec;         /* seconds */\n"
4835 "    long    tv_nsec;        /* nanoseconds */\n"
4836 "};\n"
4837 msgstr ""
4838 "struct timespec {\n"
4839 "    long    tv_sec;         /* 秒 */\n"
4840 "    long    tv_nsec;        /* ナノ秒 */\n"
4841 "};\n"
4842
4843 #. type: Plain text
4844 #: build/C/man2/select.2:269
4845 msgid "(However, see below on the POSIX.1-2001 versions.)"
4846 msgstr ""
4847 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
4848 "照)"
4849
4850 #. type: Plain text
4851 #: build/C/man2/select.2:277
4852 msgid ""
4853 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
4854 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
4855 "precision."
4856 msgstr ""
4857 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4858 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4859 "呼び出すという方法を使っているコードもある。"
4860
4861 #.  .PP - it is rumored that:
4862 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4863 #.  - it is certainly true that:
4864 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4865 #. type: Plain text
4866 #: build/C/man2/select.2:300
4867 msgid ""
4868 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4869 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4870 "either behavior.)  This causes problems both when Linux code which reads "
4871 "I<timeout> is ported to other operating systems, and when code is ported to "
4872 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4873 "without reinitializing it.  Consider I<timeout> to be undefined after "
4874 "B<select>()  returns."
4875 msgstr ""
4876 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4877 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4878 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4879 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4880 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4881 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4882 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4883 "ある。"
4884
4885 #. type: Plain text
4886 #: build/C/man2/select.2:318
4887 msgid ""
4888 "On success, B<select>()  and B<pselect>()  return the number of file "
4889 "descriptors contained in the three returned descriptor sets (that is, the "
4890 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4891 "which may be zero if the timeout expires before anything interesting "
4892 "happens.  On error, -1 is returned, and I<errno> is set to indicate the "
4893 "error; the file descriptor sets are unmodified, and I<timeout> becomes "
4894 "undefined."
4895 msgstr ""
4896 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4897 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4898 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4899 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4900 "ならば -1 を返し、 I<errno> にエラーを示す値が設定される; ファイルディスクリ"
4901 "プタ集合は変更されず、 I<timeout> は不定となる。"
4902
4903 #. type: Plain text
4904 #: build/C/man2/select.2:324
4905 msgid ""
4906 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4907 "descriptor that was already closed, or one on which an error has occurred.)"
4908 msgstr ""
4909 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4910 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4911 "タが指定された)。"
4912
4913 #. type: Plain text
4914 #: build/C/man2/select.2:328
4915 msgid "A signal was caught; see B<signal>(7)."
4916 msgstr "シグナルを受信した。"
4917
4918 #. type: Plain text
4919 #: build/C/man2/select.2:335
4920 msgid ""
4921 "I<nfds> is negative or exceeds the B<RLIMIT_NOFILE> resource limit (see "
4922 "B<getrlimit>(2))."
4923 msgstr ""
4924 "I<nfds> が負、 またはリソース上限 B<RLIMIT_NOFILE> (B<getrlimit>(2) 参照) よ"
4925 "り大きい。"
4926
4927 #. type: Plain text
4928 #: build/C/man2/select.2:340
4929 msgid "the value contained within I<timeout> is invalid."
4930 msgstr "I<timeout> に入っている値が不正である。"
4931
4932 #. type: Plain text
4933 #: build/C/man2/select.2:343
4934 msgid "unable to allocate memory for internal tables."
4935 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4936
4937 #. type: Plain text
4938 #: build/C/man2/select.2:349
4939 msgid ""
4940 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, "
4941 "B<pselect>()  was emulated in glibc (but see BUGS)."
4942 msgstr ""
4943 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4944 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4945
4946 #. type: Plain text
4947 #: build/C/man2/select.2:360
4948 msgid ""
4949 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4950 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4951 "clones of the BSD socket layer (including System\\ V variants).  However, "
4952 "note that the System\\ V variant typically sets the timeout variable before "
4953 "exit, but the BSD variant does not."
4954 msgstr ""
4955 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4956 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4957 "(System\\ V 系も含む) との間でだいたい移植性がある。しかし System\\ V 系では "
4958 "たいがい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注"
4959 "意すること。"
4960
4961 #. type: Plain text
4962 #: build/C/man2/select.2:364
4963 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4964 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4965
4966 #. type: Plain text
4967 #: build/C/man2/select.2:381
4968 msgid ""
4969 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4970 "with a value of I<fd> that is negative or is equal to or larger than "
4971 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4972 "I<fd> to be a valid file descriptor."
4973 msgstr ""
4974 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4975 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4976 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4977 "プタでなければならないと規定されている。"
4978
4979 #. type: Plain text
4980 #: build/C/man2/select.2:390
4981 msgid ""
4982 "Concerning the types involved, the classical situation is that the two "
4983 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4984 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4985 "situation is"
4986 msgstr ""
4987 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4988 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4989 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4990
4991 #. type: Plain text
4992 #: build/C/man2/select.2:397
4993 #, no-wrap
4994 msgid ""
4995 "struct timeval {\n"
4996 "    time_t         tv_sec;     /* seconds */\n"
4997 "    suseconds_t    tv_usec;    /* microseconds */\n"
4998 "};\n"
4999 msgstr ""
5000 "struct timeval {\n"
5001 "\t time_t         tv_sec;     /* 秒 */\n"
5002 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
5003 "};\n"
5004
5005 #. type: Plain text
5006 #: build/C/man2/select.2:408
5007 msgid ""
5008 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
5009 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
5010 msgstr ""
5011 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
5012 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
5013
5014 #. type: Plain text
5015 #: build/C/man2/select.2:420
5016 msgid ""
5017 "Concerning prototypes, the classical situation is that one should include "
5018 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
5019 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
5020 msgstr ""
5021 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
5022 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
5023 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
5024 "インクルードすればよい。"
5025
5026 #. type: Plain text
5027 #: build/C/man2/select.2:431
5028 msgid ""
5029 "Under glibc 2.0, I<E<lt>sys/select.hE<gt>> gives the wrong prototype for "
5030 "B<pselect>().  Under glibc 2.1 to 2.2.1, it gives B<pselect>()  when "
5031 "B<_GNU_SOURCE> is defined.  Since glibc 2.2.2, the requirements are as shown "
5032 "in the SYNOPSIS."
5033 msgstr ""
5034 "glibc 2.0 では I<E<lt>sys/select.hE<gt>> が提供する B<pselect>()  のプロトタ"
5035 "イプが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されてい"
5036 "る場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  "
5037 "を使用するには、「書式」に記載された要件を満たす必要がある。"
5038
5039 #. type: SS
5040 #: build/C/man2/select.2:431
5041 #, no-wrap
5042 msgid "Multithreaded applications"
5043 msgstr "マルチスレッド・アプリケーション"
5044
5045 #. type: Plain text
5046 #: build/C/man2/select.2:448
5047 msgid ""
5048 "If a file descriptor being monitored by B<select>()  is closed in another "
5049 "thread, the result is unspecified.  On some UNIX systems, B<select>()  "
5050 "unblocks and returns, with an indication that the file descriptor is ready "
5051 "(a subsequent I/O operation will likely fail with an error, unless another "
5052 "the file descriptor reopened between the time B<select>()  returned and the "
5053 "I/O operations was performed).  On Linux (and some other systems), closing "
5054 "the file descriptor in another thread has no effect on B<select>().  In "
5055 "summary, any application that relies on a particular behavior in this "
5056 "scenario must be considered buggy."
5057 msgstr ""
5058 "B<select>() で監視中のファイルディスクリプタが別のスレッドでクローズされた場"
5059 "合、どのような結果になるかは規定されていない。いくつかの UNIX システムでは、 "
5060 "B<select>() は停止 (block) せず、すぐ返り、ファイルディスクリプタが ready だ"
5061 "と報告される (B<select>() が返ってから I/O 操作が実行されるまでの間に、 別の"
5062 "ファイルディスクリプタが再度オープンされない限り、 それ以降の I/O 操作はおそ"
5063 "らく失敗するだろう)。 Linux (や他のいくつかのシステム) では、 別のスレッドで"
5064 "ファイルディスクリプタがクローズされても B<select>() には影響を与えない。 ま"
5065 "とめると、このような場合に特定の動作に依存しているアプリケーションは「バグっ"
5066 "ている」と考えなければならない。"
5067
5068 #. type: SS
5069 #: build/C/man2/select.2:448
5070 #, no-wrap
5071 msgid "C library/kernel ABI differences"
5072 msgstr "C ライブラリとカーネル ABI の違い"
5073
5074 #. type: Plain text
5075 #: build/C/man2/select.2:456
5076 msgid ""
5077 "The B<pselect>()  interface described in this page is implemented by glibc.  "
5078 "The underlying Linux system call is named B<pselect6>().  This system call "
5079 "has somewhat different behavior from the glibc wrapper function."
5080 msgstr ""
5081 "このページで説明している B<pselect>() のインターフェースは、glibc に\n"
5082 "実装されているものである。内部で呼び出される Linux のシステムコールは\n"
5083 "B<pselect6>() という名前である。このシステムコールは glibc のラッパー\n"
5084 "関数とは少し違った動作をする。"
5085
5086 #. type: Plain text
5087 #: build/C/man2/select.2:471
5088 msgid ""
5089 "The Linux B<pselect6>()  system call modifies its I<timeout> argument.  "
5090 "However, the glibc wrapper function hides this behavior by using a local "
5091 "variable for the timeout argument that is passed to the system call.  Thus, "
5092 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
5093 "this is the behavior required by POSIX.1-2001."
5094 msgstr ""
5095 "Linux の B<pselect6>() システムコールは I<timeout> 引き数を変更する。\n"
5096 "しかし、glibc のラッパー関数は、システムコールに渡す timeout 引き数と\n"
5097 "してローカル変数を使うことでこの動作を隠蔽している。このため、glibc の\n"
5098 "B<pselect>() 関数は I<timeout> 引き数を変更しない。\n"
5099 "これが POSIX.1-2001 が要求している動作である。"
5100
5101 #. type: Plain text
5102 #: build/C/man2/select.2:477
5103 msgid ""
5104 "The final argument of the B<pselect6>()  system call is not a I<sigset_t\\ "
5105 "*> pointer, but is instead a structure of the form:"
5106 msgstr ""
5107 "B<pselect6>() システムコールの最後の引き数は I<sigset_t\\ *> 型の\n"
5108 "ポインタではなく、以下に示す構造体である。"
5109
5110 #. type: Plain text
5111 #: build/C/man2/select.2:485
5112 #, no-wrap
5113 msgid ""
5114 "struct {\n"
5115 "    const sigset_t *ss;     /* Pointer to signal set */\n"
5116 "    size_t          ss_len; /* Size (in bytes) of object pointed\n"
5117 "                               to by 'ss' */\n"
5118 "};\n"
5119 msgstr ""
5120 "struct {\n"
5121 "    const sigset_t *ss;     /* シグナル集合へのポインタ */\n"
5122 "    size_t          ss_len; /* 'ss' が指すオブジェクトのサイズ\n"
5123 "                               (バイト数) */\n"
5124 "};\n"
5125
5126 #. type: Plain text
5127 #: build/C/man2/select.2:492
5128 msgid ""
5129 "This allows the system call to obtain both a pointer to the signal set and "
5130 "its size, while allowing for the fact that most architectures support a "
5131 "maximum of 6 arguments to a system call."
5132 msgstr ""
5133 "このようにすることで、ほとんどのアーキテクチャがサポートしている\n"
5134 "システムコールの引き数が最大で 6 個という事実を満たしつつ、\n"
5135 "B<pselect6>() システムコールがシグナル集合へのポインタとシグナル集合\n"
5136 "のサイズの両方を取得することができるのである。"
5137
5138 #. type: Plain text
5139 #: build/C/man2/select.2:498
5140 msgid ""
5141 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
5142 "argument."
5143 msgstr ""
5144 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
5145 "されていた。"
5146
5147 #. type: Plain text
5148 #: build/C/man2/select.2:511
5149 msgid ""
5150 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
5151 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
5152 "implementation remained vulnerable to the very race condition that "
5153 "B<pselect>()  was designed to prevent.  Modern versions of glibc use the "
5154 "(race-free)  B<pselect>()  system call on kernels where it is provided."
5155 msgstr ""
5156 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
5157 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
5158 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
5159 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
5160 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
5161 "が使用される。"
5162
5163 #. type: Plain text
5164 #: build/C/man2/select.2:524
5165 msgid ""
5166 "On systems that lack B<pselect>(), reliable (and more portable) signal "
5167 "trapping can be achieved using the self-pipe trick.  In this technique, a "
5168 "signal handler writes a byte to a pipe whose other end is monitored by "
5169 "B<select>()  in the main program.  (To avoid possibly blocking when writing "
5170 "to a pipe that may be full or reading from a pipe that may be empty, "
5171 "nonblocking I/O is used when reading from and writing to the pipe.)"
5172 msgstr ""
5173 "B<pselect>() がないシステムにおいて、シグナルの捕捉を信頼性があり (移植\n"
5174 "性も高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい。\n"
5175 "この方法では、シグナルハンドラはパイプへ 1 バイトのデータを書き込み、\n"
5176 "同じパイプのもう一端をメインプログラムの B<select>() で監視する (一杯に\n"
5177 "なったパイプへの書き込みや空のパイプから読み出しを行った際に起こるであ\n"
5178 "ろう停止 (blocking) を避けるためには、パイプへの読み書きの際には 非停止\n"
5179 "(nonblocking) I/O を使用するとよい)。"
5180
5181 #.  Stevens discusses a case where accept can block after select
5182 #.  returns successfully because of an intervening RST from the client.
5183 #.  Maybe the kernel should have returned EIO in such a situation?
5184 #. type: Plain text
5185 #: build/C/man2/select.2:540
5186 msgid ""
5187 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
5188 "reading\", while nevertheless a subsequent read blocks.  This could for "
5189 "example happen when data has arrived but upon examination has wrong checksum "
5190 "and is discarded.  There may be other circumstances in which a file "
5191 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
5192 "B<O_NONBLOCK> on sockets that should not block."
5193 msgstr ""
5194 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
5195 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
5196 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
5197 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
5198 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
5199 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
5200
5201 #. type: Plain text
5202 #: build/C/man2/select.2:555
5203 msgid ""
5204 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
5205 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
5206 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
5207 "behavior, but the glibc wrapper hides this behavior by internally copying "
5208 "the I<timeout> to a local variable and passing that variable to the system "
5209 "call."
5210 msgstr ""
5211 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
5212 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
5213 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
5214 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
5215 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
5216 "数をシステムコールに渡している。"
5217
5218 #. type: Plain text
5219 #: build/C/man2/select.2:562
5220 #, no-wrap
5221 msgid ""
5222 "#include E<lt>stdio.hE<gt>\n"
5223 "#include E<lt>stdlib.hE<gt>\n"
5224 "#include E<lt>sys/time.hE<gt>\n"
5225 "#include E<lt>sys/types.hE<gt>\n"
5226 "#include E<lt>unistd.hE<gt>\n"
5227 msgstr ""
5228 "#include E<lt>stdio.hE<gt>\n"
5229 "#include E<lt>stdlib.hE<gt>\n"
5230 "#include E<lt>sys/time.hE<gt>\n"
5231 "#include E<lt>sys/types.hE<gt>\n"
5232 "#include E<lt>unistd.hE<gt>\n"
5233
5234 #. type: Plain text
5235 #: build/C/man2/select.2:569
5236 #, no-wrap
5237 msgid ""
5238 "int\n"
5239 "main(void)\n"
5240 "{\n"
5241 "    fd_set rfds;\n"
5242 "    struct timeval tv;\n"
5243 "    int retval;\n"
5244 msgstr ""
5245 "int\n"
5246 "main(void)\n"
5247 "{\n"
5248 "    fd_set rfds;\n"
5249 "    struct timeval tv;\n"
5250 "    int retval;\n"
5251
5252 #. type: Plain text
5253 #: build/C/man2/select.2:573
5254 #, no-wrap
5255 msgid ""
5256 "    /* Watch stdin (fd 0) to see when it has input. */\n"
5257 "    FD_ZERO(&rfds);\n"
5258 "    FD_SET(0, &rfds);\n"
5259 msgstr ""
5260 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
5261 "    FD_ZERO(&rfds);\n"
5262 "    FD_SET(0, &rfds);\n"
5263
5264 #. type: Plain text
5265 #: build/C/man2/select.2:577
5266 #, no-wrap
5267 msgid ""
5268 "    /* Wait up to five seconds. */\n"
5269 "    tv.tv_sec = 5;\n"
5270 "    tv.tv_usec = 0;\n"
5271 msgstr ""
5272 "    /* 5 秒間監視する。*/\n"
5273 "    tv.tv_sec = 5;\n"
5274 "    tv.tv_usec = 0;\n"
5275
5276 #. type: Plain text
5277 #: build/C/man2/select.2:580
5278 #, no-wrap
5279 msgid ""
5280 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5281 "    /* Don't rely on the value of tv now! */\n"
5282 msgstr ""
5283 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
5284 "    /* この時点での tv の値を信頼してはならない。*/\n"
5285
5286 #. type: Plain text
5287 #: build/C/man2/select.2:588
5288 #, no-wrap
5289 msgid ""
5290 "    if (retval == -1)\n"
5291 "        perror(\"select()\");\n"
5292 "    else if (retval)\n"
5293 "        printf(\"Data is available now.\\en\");\n"
5294 "        /* FD_ISSET(0, &rfds) will be true. */\n"
5295 "    else\n"
5296 "        printf(\"No data within five seconds.\\en\");\n"
5297 msgstr ""
5298 "    if (retval == -1)\n"
5299 "\tperror(\"select()\");\n"
5300 "    else if (retval)\n"
5301 "        printf(\"今、データが取得できました。\\en\");\n"
5302 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
5303 "    else\n"
5304 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
5305
5306 #. type: Plain text
5307 #: build/C/man2/select.2:604
5308 msgid ""
5309 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
5310 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
5311 "B<epoll>(7), B<time>(7)"
5312 msgstr ""
5313 "B<accept>(2), B<connect>(2), B<poll>(2), B<read>(2), B<recv>(2), "
5314 "B<restart_syscall>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
5315 "B<epoll>(7), B<time>(7)"
5316
5317 #. type: Plain text
5318 #: build/C/man2/select.2:607
5319 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
5320 msgstr ""
5321 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
5322
5323 #. type: TH
5324 #: build/C/man2/select_tut.2:32
5325 #, no-wrap
5326 msgid "SELECT_TUT"
5327 msgstr "SELECT_TUT"
5328
5329 #. type: TH
5330 #: build/C/man2/select_tut.2:32
5331 #, no-wrap
5332 msgid "2013-12-30"
5333 msgstr "2013-12-30"
5334
5335 #. type: Plain text
5336 #: build/C/man2/select_tut.2:52
5337 #, no-wrap
5338 msgid ""
5339 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5340 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5341 msgstr ""
5342 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5343 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
5344
5345 #. type: Plain text
5346 #: build/C/man2/select_tut.2:66
5347 #, no-wrap
5348 msgid ""
5349 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5350 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5351 "B<            const sigset_t *>I<sigmask>B<);>\n"
5352 msgstr ""
5353 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
5354 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
5355 "B<            const sigset_t *>I<sigmask>B<);>\n"
5356
5357 #. type: Plain text
5358 #: build/C/man2/select_tut.2:83
5359 msgid ""
5360 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
5361 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
5362 "see whether I/O becomes possible, or an \"exceptional condition\" has "
5363 "occurred on any of the descriptors."
5364 msgstr ""
5365 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
5366 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
5367 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
5368 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
5369 "る。"
5370
5371 #. type: Plain text
5372 #: build/C/man2/select_tut.2:108
5373 msgid ""
5374 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
5375 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
5376 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
5377 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
5378 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
5379 "according to the rules described below; after calling B<select>()  you can "
5380 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
5381 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
5382 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
5383 "descriptor from a set."
5384 msgstr ""
5385 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
5386 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
5387 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
5388 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
5389 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
5390 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
5391 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
5392 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
5393 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
5394 "のファイルディスクリプタの削除を行う。"
5395
5396 #. type: SS
5397 #: build/C/man2/select_tut.2:108
5398 #, no-wrap
5399 msgid "Arguments"
5400 msgstr "引き数"
5401
5402 #. type: TP
5403 #: build/C/man2/select_tut.2:109
5404 #, no-wrap
5405 msgid "I<readfds>"
5406 msgstr "I<readfds>"
5407
5408 #. type: Plain text
5409 #: build/C/man2/select_tut.2:118
5410 msgid ""
5411 "This set is watched to see if data is available for reading from any of its "
5412 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
5413 "cleared of all file descriptors except for those that are immediately "
5414 "available for reading."
5415 msgstr ""
5416 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
5417 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
5418 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
5419
5420 #. type: TP
5421 #: build/C/man2/select_tut.2:118
5422 #, no-wrap
5423 msgid "I<writefds>"
5424 msgstr "I<writefds>"
5425
5426 #. type: Plain text
5427 #: build/C/man2/select_tut.2:127
5428 msgid ""
5429 "This set is watched to see if there is space to write data to any of its "
5430 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
5431 "cleared of all file descriptors except for those that are immediately "
5432 "available for writing."
5433 msgstr ""
5434 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
5435 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
5436 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
5437
5438 #. type: TP
5439 #: build/C/man2/select_tut.2:127
5440 #, no-wrap
5441 msgid "I<exceptfds>"
5442 msgstr "I<exceptfds>"
5443
5444 #. type: Plain text
5445 #: build/C/man2/select_tut.2:149
5446 msgid ""
5447 "This set is watched for \"exceptional conditions\".  In practice, only one "
5448 "such exceptional condition is common: the availability of I<out-of-band> "
5449 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
5450 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
5451 "where B<select>(2)  indicates an exceptional condition occurs with "
5452 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
5453 "has returned, I<exceptfds> will be cleared of all file descriptors except "
5454 "for those for which an exceptional condition has occurred."
5455 msgstr ""
5456 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
5457 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
5458 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
5459 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
5460 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
5461 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
5462 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
5463 "状態が発生したディスクリプタ以外は集合から削除される。"
5464
5465 #. type: TP
5466 #: build/C/man2/select_tut.2:149
5467 #, no-wrap
5468 msgid "I<nfds>"
5469 msgstr "I<nfds>"
5470
5471 #. type: Plain text
5472 #: build/C/man2/select_tut.2:156
5473 msgid ""
5474 "This is an integer one more than the maximum of any file descriptor in any "
5475 "of the sets.  In other words, while adding file descriptors to each of the "
5476 "sets, you must calculate the maximum integer value of all of them, then "
5477 "increment this value by one, and then pass this as I<nfds>."
5478 msgstr ""
5479 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
5480 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
5481 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
5482 "I<nfds> として渡さないといけない、ということだ。"
5483
5484 #. type: TP
5485 #: build/C/man2/select_tut.2:156
5486 #, no-wrap
5487 msgid "I<utimeout>"
5488 msgstr "I<utimeout>"
5489
5490 #. type: Plain text
5491 #: build/C/man2/select_tut.2:169
5492 msgid ""
5493 "This is the longest time B<select>()  may wait before returning, even if "
5494 "nothing interesting happened.  If this value is passed as NULL, then "
5495 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
5496 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
5497 "return immediately, with information about the readiness of file descriptors "
5498 "at the time of the call.  The structure I<struct timeval> is defined as:"
5499 msgstr ""
5500 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
5501 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
5502 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
5503 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
5504 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
5505 "ように定義されている:"
5506
5507 #. type: Plain text
5508 #: build/C/man2/select_tut.2:176
5509 #, no-wrap
5510 msgid ""
5511 "struct timeval {\n"
5512 "    time_t tv_sec;    /* seconds */\n"
5513 "    long tv_usec;     /* microseconds */\n"
5514 "};\n"
5515 msgstr ""
5516 "struct timeval {\n"
5517 "    time_t tv_sec;    /* seconds */\n"
5518 "    long tv_usec;     /* microseconds */\n"
5519 "};\n"
5520
5521 #. type: TP
5522 #: build/C/man2/select_tut.2:178
5523 #, no-wrap
5524 msgid "I<ntimeout>"
5525 msgstr "I<ntimeout>"
5526
5527 #. type: Plain text
5528 #: build/C/man2/select_tut.2:187
5529 msgid ""
5530 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
5531 "I<struct timespec> has nanosecond precision as follows:"
5532 msgstr ""
5533 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
5534 "timespec> は次に示すようにナノ秒の精度を持つ。"
5535
5536 #. type: Plain text
5537 #: build/C/man2/select_tut.2:194
5538 #, no-wrap
5539 msgid ""
5540 "struct timespec {\n"
5541 "    long tv_sec;    /* seconds */\n"
5542 "    long tv_nsec;   /* nanoseconds */\n"
5543 "};\n"
5544 msgstr ""
5545 "struct timespec {\n"
5546 "    long tv_sec;    /* seconds */\n"
5547 "    long tv_nsec;   /* nanoseconds */\n"
5548 "};\n"
5549
5550 #. type: TP
5551 #: build/C/man2/select_tut.2:196
5552 #, no-wrap
5553 msgid "I<sigmask>"
5554 msgstr "I<sigmask>"
5555
5556 #. type: Plain text
5557 #: build/C/man2/select_tut.2:213
5558 msgid ""
5559 "This argument holds a set of signals that the kernel should unblock (i.e., "
5560 "remove from the signal mask of the calling thread), while the caller is "
5561 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
5562 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
5563 "the signal mask on entry and exit to the function.  In this case, "
5564 "B<pselect>()  will then behave just like B<select>()."
5565 msgstr ""
5566 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
5567 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
5568 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
5569 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
5570 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は "
5571 "B<select>()  と全く同じ動作となる。"
5572
5573 #. type: SS
5574 #: build/C/man2/select_tut.2:213
5575 #, no-wrap
5576 msgid "Combining signal and data events"
5577 msgstr "シグナルとデータイベントを組み合わせる"
5578
5579 #. type: Plain text
5580 #: build/C/man2/select_tut.2:257
5581 msgid ""
5582 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
5583 "descriptor(s) to become ready for I/O.  Programs that receive signals "
5584 "normally use the signal handler only to raise a global flag.  The global "
5585 "flag will indicate that the event must be processed in the main loop of the "
5586 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
5587 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
5588 "signals can be processed in the main loop of the program, otherwise "
5589 "B<select>()  would block indefinitely.  Now, somewhere in the main loop will "
5590 "be a conditional to check the global flag.  So we must ask: what if a signal "
5591 "arrives after the conditional, but before the B<select>()  call? The answer "
5592 "is that B<select>()  would block indefinitely, even though an event is "
5593 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
5594 "This call can be used to set the signal mask to a set of signals that are "
5595 "only to be received within the B<pselect>()  call.  For instance, let us say "
5596 "that the event in question was the exit of a child process.  Before the "
5597 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
5598 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
5599 "mask.  Our program would look like:"
5600 msgstr ""
5601 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
5602 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
5603 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
5604 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
5605 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
5606 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
5607 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
5608 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
5609 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
5610 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
5611 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
5612 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
5613 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
5614 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
5615 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
5616 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
5617 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
5618 "る。"
5619
5620 #. type: Plain text
5621 #: build/C/man2/select_tut.2:260
5622 #, no-wrap
5623 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5624 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
5625
5626 #. type: Plain text
5627 #: build/C/man2/select_tut.2:266
5628 #, no-wrap
5629 msgid ""
5630 "static void\n"
5631 "child_sig_handler(int sig)\n"
5632 "{\n"
5633 "    got_SIGCHLD = 1;\n"
5634 "}\n"
5635 msgstr ""
5636 "static void\n"
5637 "child_sig_handler(int sig)\n"
5638 "{\n"
5639 "    got_SIGCHLD = 1;\n"
5640 "}\n"
5641
5642 #. type: Plain text
5643 #: build/C/man2/select_tut.2:274
5644 #, no-wrap
5645 msgid ""
5646 "int\n"
5647 "main(int argc, char *argv[])\n"
5648 "{\n"
5649 "    sigset_t sigmask, empty_mask;\n"
5650 "    struct sigaction sa;\n"
5651 "    fd_set readfds, writefds, exceptfds;\n"
5652 "    int r;\n"
5653 msgstr ""
5654 "int\n"
5655 "main(int argc, char *argv[])\n"
5656 "{\n"
5657 "    sigset_t sigmask, empty_mask;\n"
5658 "    struct sigaction sa;\n"
5659 "    fd_set readfds, writefds, exceptfds;\n"
5660 "    int r;\n"
5661
5662 #. type: Plain text
5663 #: build/C/man2/select_tut.2:281
5664 #, no-wrap
5665 msgid ""
5666 "    sigemptyset(&sigmask);\n"
5667 "    sigaddset(&sigmask, SIGCHLD);\n"
5668 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5669 "        perror(\"sigprocmask\");\n"
5670 "        exit(EXIT_FAILURE);\n"
5671 "    }\n"
5672 msgstr ""
5673 "    sigemptyset(&sigmask);\n"
5674 "    sigaddset(&sigmask, SIGCHLD);\n"
5675 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
5676 "        perror(\"sigprocmask\");\n"
5677 "        exit(EXIT_FAILURE);\n"
5678 "    }\n"
5679
5680 #. type: Plain text
5681 #: build/C/man2/select_tut.2:289
5682 #, no-wrap
5683 msgid ""
5684 "    sa.sa_flags = 0;\n"
5685 "    sa.sa_handler = child_sig_handler;\n"
5686 "    sigemptyset(&sa.sa_mask);\n"
5687 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5688 "        perror(\"sigaction\");\n"
5689 "        exit(EXIT_FAILURE);\n"
5690 "    }\n"
5691 msgstr ""
5692 "    sa.sa_flags = 0;\n"
5693 "    sa.sa_handler = child_sig_handler;\n"
5694 "    sigemptyset(&sa.sa_mask);\n"
5695 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
5696 "        perror(\"sigaction\");\n"
5697 "        exit(EXIT_FAILURE);\n"
5698 "    }\n"
5699
5700 #. type: Plain text
5701 #: build/C/man2/select_tut.2:291
5702 #, no-wrap
5703 msgid "    sigemptyset(&empty_mask);\n"
5704 msgstr "    sigemptyset(&empty_mask);\n"
5705
5706 #. type: Plain text
5707 #: build/C/man2/select_tut.2:295
5708 #, no-wrap
5709 msgid ""
5710 "    for (;;) {          /* main loop */\n"
5711 "        /* Initialize readfds, writefds, and exceptfds\n"
5712 "           before the pselect() call. (Code omitted.) */\n"
5713 msgstr ""
5714 "    for (;;) {          /* main loop */\n"
5715 "        /* Initialize readfds, writefds, and exceptfds\n"
5716 "           before the pselect() call. (Code omitted.) */\n"
5717
5718 #. type: Plain text
5719 #: build/C/man2/select_tut.2:301
5720 #, no-wrap
5721 msgid ""
5722 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5723 "                    NULL, &empty_mask);\n"
5724 "        if (r == -1 && errno != EINTR) {\n"
5725 "            /* Handle error */\n"
5726 "        }\n"
5727 msgstr ""
5728 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
5729 "                    NULL, &empty_mask);\n"
5730 "        if (r == -1 && errno != EINTR) {\n"
5731 "            /* Handle error */\n"
5732 "        }\n"
5733
5734 #. type: Plain text
5735 #: build/C/man2/select_tut.2:304
5736 #, no-wrap
5737 msgid ""
5738 "        if (got_SIGCHLD) {\n"
5739 "            got_SIGCHLD = 0;\n"
5740 msgstr ""
5741 "        if (got_SIGCHLD) {\n"
5742 "            got_SIGCHLD = 0;\n"
5743
5744 #. type: Plain text
5745 #: build/C/man2/select_tut.2:308
5746 #, no-wrap
5747 msgid ""
5748 "            /* Handle signalled event here; e.g., wait() for all\n"
5749 "               terminated children. (Code omitted.) */\n"
5750 "        }\n"
5751 msgstr ""
5752 "            /* Handle signalled event here; e.g., wait() for all\n"
5753 "               terminated children. (Code omitted.) */\n"
5754 "        }\n"
5755
5756 #. type: Plain text
5757 #: build/C/man2/select_tut.2:312
5758 #, no-wrap
5759 msgid ""
5760 "        /* main body of program */\n"
5761 "    }\n"
5762 "}\n"
5763 msgstr ""
5764 "        /* main body of program */\n"
5765 "    }\n"
5766 "}\n"
5767
5768 #. type: SS
5769 #: build/C/man2/select_tut.2:313
5770 #, no-wrap
5771 msgid "Practical"
5772 msgstr "実例"
5773
5774 #. type: Plain text
5775 #: build/C/man2/select_tut.2:334
5776 msgid ""
5777 "So what is the point of B<select>()? Can't I just read and write to my "
5778 "descriptors whenever I want? The point of B<select>()  is that it watches "
5779 "multiple descriptors at the same time and properly puts the process to sleep "
5780 "if there is no activity.  UNIX programmers often find themselves in a "
5781 "position where they have to handle I/O from more than one file descriptor "
5782 "where the data flow may be intermittent.  If you were to merely create a "
5783 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
5784 "your calls may block waiting for data from/to a file descriptor, while "
5785 "another file descriptor is unused though ready for I/O.  B<select>()  "
5786 "efficiently copes with this situation."
5787 msgstr ""
5788 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
5789 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
5790 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
5791 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
5792 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
5793 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
5794 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
5795 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
5796 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
5797
5798 #. type: SS
5799 #: build/C/man2/select_tut.2:334
5800 #, no-wrap
5801 msgid "Select law"
5802 msgstr "SELECT の掟"
5803
5804 #. type: Plain text
5805 #: build/C/man2/select_tut.2:347
5806 msgid ""
5807 "Many people who try to use B<select>()  come across behavior that is "
5808 "difficult to understand and produces nonportable or borderline results.  For "
5809 "instance, the above program is carefully written not to block at any point, "
5810 "even though it does not set its file descriptors to nonblocking mode.  It is "
5811 "easy to introduce subtle errors that will remove the advantage of using "
5812 "B<select>(), so here is a list of essentials to watch for when using "
5813 "B<select>()."
5814 msgstr ""
5815 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
5816 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
5817 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
5818 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
5819 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
5820 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
5821 "ことにする。"
5822
5823 #. type: Plain text
5824 #: build/C/man2/select_tut.2:356
5825 msgid ""
5826 "You should always try to use B<select>()  without a timeout.  Your program "
5827 "should have nothing to do if there is no data available.  Code that depends "
5828 "on timeouts is not usually portable and is difficult to debug."
5829 msgstr ""
5830 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
5831 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
5832 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
5833
5834 #. type: Plain text
5835 #: build/C/man2/select_tut.2:360
5836 msgid ""
5837 "The value I<nfds> must be properly calculated for efficiency as explained "
5838 "above."
5839 msgstr ""
5840 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
5841 "えなければならない。"
5842
5843 #. type: Plain text
5844 #: build/C/man2/select_tut.2:367
5845 msgid ""
5846 "No file descriptor must be added to any set if you do not intend to check "
5847 "its result after the B<select>()  call, and respond appropriately.  See next "
5848 "rule."
5849 msgstr ""
5850 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
5851 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
5852
5853 #. type: Plain text
5854 #: build/C/man2/select_tut.2:373
5855 msgid ""
5856 "After B<select>()  returns, all file descriptors in all sets should be "
5857 "checked to see if they are ready."
5858 msgstr ""
5859 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
5860 "て 読み書き可能な状態になっているかをチェックすべきである。"
5861
5862 #. type: TP
5863 #: build/C/man2/select_tut.2:373
5864 #, no-wrap
5865 msgid "5."
5866 msgstr "5."
5867
5868 #. type: Plain text
5869 #: build/C/man2/select_tut.2:388
5870 msgid ""
5871 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
5872 "necessarily read/write the full amount of data that you have requested.  If "
5873 "they do read/write the full amount, it's because you have a low traffic load "
5874 "and a fast stream.  This is not always going to be the case.  You should "
5875 "cope with the case of your functions managing to send or receive only a "
5876 "single byte."
5877 msgstr ""
5878 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
5879 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
5880 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
5881 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
5882 "うな場合も 考慮に入れてやらなければならない。"
5883
5884 #. type: TP
5885 #: build/C/man2/select_tut.2:388
5886 #, no-wrap
5887 msgid "6."
5888 msgstr "6."
5889
5890 #. type: Plain text
5891 #: build/C/man2/select_tut.2:396
5892 msgid ""
5893 "Never read/write only in single bytes at a time unless you are really sure "
5894 "that you have a small amount of data to process.  It is extremely "
5895 "inefficient not to read/write as much data as you can buffer each time.  The "
5896 "buffers in the example below are 1024 bytes although they could easily be "
5897 "made larger."
5898 msgstr ""
5899 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
5900 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
5901 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
5902 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
5903
5904 #. type: TP
5905 #: build/C/man2/select_tut.2:396
5906 #, no-wrap
5907 msgid "7."
5908 msgstr "7."
5909
5910 #.  Nonetheless, you should still cope with these errors for completeness.
5911 #. type: Plain text
5912 #: build/C/man2/select_tut.2:418
5913 msgid ""
5914 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
5915 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
5916 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
5917 "properly managed (not done properly above).  If your program is not going to "
5918 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
5919 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
5920 msgstr ""
5921 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
5922 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
5923 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
5924 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
5925 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
5926 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
5927
5928 #. type: TP
5929 #: build/C/man2/select_tut.2:418
5930 #, no-wrap
5931 msgid "8."
5932 msgstr "8."
5933
5934 #. type: Plain text
5935 #: build/C/man2/select_tut.2:427
5936 msgid ""
5937 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5938 "length of zero."
5939 msgstr ""
5940 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), "
5941 "B<write>(2), B<send>(2)  を呼び出してはならない。"
5942
5943 #. type: TP
5944 #: build/C/man2/select_tut.2:427
5945 #, no-wrap
5946 msgid "9."
5947 msgstr "9."
5948
5949 #. type: Plain text
5950 #: build/C/man2/select_tut.2:443
5951 msgid ""
5952 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5953 "with errors other than those listed in B<7.>, or one of the input functions "
5954 "returns 0, indicating end of file, then you should I<not> pass that "
5955 "descriptor to B<select>()  again.  In the example below, I close the "
5956 "descriptor immediately, and then set it to -1 to prevent it being included "
5957 "in a set."
5958 msgstr ""
5959 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5960 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5961 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5962 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5963 "が集合に含まれ続けるのを許さないようにしている。"
5964
5965 #. type: TP
5966 #: build/C/man2/select_tut.2:443
5967 #, no-wrap
5968 msgid "10."
5969 msgstr "10."
5970
5971 #. type: Plain text
5972 #: build/C/man2/select_tut.2:450
5973 msgid ""
5974 "The timeout value must be initialized with each new call to B<select>(), "
5975 "since some operating systems modify the structure.  B<pselect>()  however "
5976 "does not modify its timeout structure."
5977 msgstr ""
5978 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5979 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5980 "分の timeout 構造体を変更することはない。"
5981
5982 #. type: TP
5983 #: build/C/man2/select_tut.2:450
5984 #, no-wrap
5985 msgid "11."
5986 msgstr "11."
5987
5988 #.  "I have heard" does not fill me with confidence, and doesn't
5989 #.  belong in a man page, so I've commented this point out.
5990 #.  .TP
5991 #.  11.
5992 #.  I have heard that the Windows socket layer does not cope with OOB data
5993 #.  properly.
5994 #.  It also does not cope with
5995 #.  .BR select ()
5996 #.  calls when no file descriptors are set at all.
5997 #.  Having no file descriptors set is a useful
5998 #.  way to sleep the process with subsecond precision by using the timeout.
5999 #.  (See further on.)
6000 #. type: Plain text
6001 #: build/C/man2/select_tut.2:469
6002 msgid ""
6003 "Since B<select>()  modifies its file descriptor sets, if the call is being "
6004 "used in a loop, then the sets must be reinitialized before each call."
6005 msgstr ""
6006 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
6007 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
6008 "期化し直さなければならない。"
6009
6010 #. type: SS
6011 #: build/C/man2/select_tut.2:469
6012 #, no-wrap
6013 msgid "Usleep emulation"
6014 msgstr "usleep エミュレーション"
6015
6016 #. type: Plain text
6017 #: build/C/man2/select_tut.2:476
6018 msgid ""
6019 "On systems that do not have a B<usleep>(3)  function, you can call "
6020 "B<select>()  with a finite timeout and no file descriptors as follows:"
6021 msgstr ""
6022 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
6023 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
6024 "できる。 以下のようにする。"
6025
6026 #. type: Plain text
6027 #: build/C/man2/select_tut.2:482
6028 #, no-wrap
6029 msgid ""
6030 "    struct timeval tv;\n"
6031 "    tv.tv_sec = 0;\n"
6032 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6033 "    select(0, NULL, NULL, NULL, &tv);\n"
6034 msgstr ""
6035 "    struct timeval tv;\n"
6036 "    tv.tv_sec = 0;\n"
6037 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
6038 "    select(0, NULL, NULL, NULL, &tv);\n"
6039
6040 #. type: Plain text
6041 #: build/C/man2/select_tut.2:485
6042 msgid "This is guaranteed to work only on UNIX systems, however."
6043 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
6044
6045 #. type: Plain text
6046 #: build/C/man2/select_tut.2:490
6047 msgid ""
6048 "On success, B<select>()  returns the total number of file descriptors still "
6049 "present in the file descriptor sets."
6050 msgstr ""
6051 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
6052 "ディスクリプタの総数を返す。"
6053
6054 #. type: Plain text
6055 #: build/C/man2/select_tut.2:496
6056 msgid ""
6057 "If B<select>()  timed out, then the return value will be zero.  The file "
6058 "descriptors set should be all empty (but may not be on some systems)."
6059 msgstr ""
6060 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
6061 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
6062
6063 #. type: Plain text
6064 #: build/C/man2/select_tut.2:503
6065 msgid ""
6066 "A return value of -1 indicates an error, with I<errno> being set "
6067 "appropriately.  In the case of an error, the contents of the returned sets "
6068 "and the I<struct timeout> contents are undefined and should not be used.  "
6069 "B<pselect>()  however never modifies I<ntimeout>."
6070 msgstr ""
6071 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
6072 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
6073 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
6074 "変更しない。"
6075
6076 #. type: Plain text
6077 #: build/C/man2/select_tut.2:512
6078 msgid ""
6079 "Generally speaking, all operating systems that support sockets also support "
6080 "B<select>().  B<select>()  can be used to solve many problems in a portable "
6081 "and efficient way that naive programmers try to solve in a more complicated "
6082 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
6083 msgstr ""
6084 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
6085 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
6086 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
6087 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
6088
6089 #. type: Plain text
6090 #: build/C/man2/select_tut.2:521
6091 msgid ""
6092 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
6093 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
6094 "is nowadays widely available, but historically was less portable than "
6095 "B<select>()."
6096 msgstr ""
6097 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
6098 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
6099 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
6100
6101 #. type: Plain text
6102 #: build/C/man2/select_tut.2:529
6103 msgid ""
6104 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
6105 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
6106 "of file descriptors."
6107 msgstr ""
6108 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
6109 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
6110
6111 #. type: Plain text
6112 #: build/C/man2/select_tut.2:534
6113 msgid ""
6114 "Here is an example that better demonstrates the true utility of "
6115 "B<select>().  The listing below is a TCP forwarding program that forwards "
6116 "from one TCP port to another."
6117 msgstr ""
6118 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
6119 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
6120
6121 #. type: Plain text
6122 #: build/C/man2/select_tut.2:547
6123 #, no-wrap
6124 msgid ""
6125 "#include E<lt>stdlib.hE<gt>\n"
6126 "#include E<lt>stdio.hE<gt>\n"
6127 "#include E<lt>unistd.hE<gt>\n"
6128 "#include E<lt>sys/time.hE<gt>\n"
6129 "#include E<lt>sys/types.hE<gt>\n"
6130 "#include E<lt>string.hE<gt>\n"
6131 "#include E<lt>signal.hE<gt>\n"
6132 "#include E<lt>sys/socket.hE<gt>\n"
6133 "#include E<lt>netinet/in.hE<gt>\n"
6134 "#include E<lt>arpa/inet.hE<gt>\n"
6135 "#include E<lt>errno.hE<gt>\n"
6136 msgstr ""
6137 "#include E<lt>stdlib.hE<gt>\n"
6138 "#include E<lt>stdio.hE<gt>\n"
6139 "#include E<lt>unistd.hE<gt>\n"
6140 "#include E<lt>sys/time.hE<gt>\n"
6141 "#include E<lt>sys/types.hE<gt>\n"
6142 "#include E<lt>string.hE<gt>\n"
6143 "#include E<lt>signal.hE<gt>\n"
6144 "#include E<lt>sys/socket.hE<gt>\n"
6145 "#include E<lt>netinet/in.hE<gt>\n"
6146 "#include E<lt>arpa/inet.hE<gt>\n"
6147 "#include E<lt>errno.hE<gt>\n"
6148
6149 #. type: Plain text
6150 #: build/C/man2/select_tut.2:549
6151 #, no-wrap
6152 msgid "static int forward_port;\n"
6153 msgstr "static int forward_port;\n"
6154
6155 #. type: Plain text
6156 #: build/C/man2/select_tut.2:552
6157 #, no-wrap
6158 msgid ""
6159 "#undef max\n"
6160 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6161 msgstr ""
6162 "#undef max\n"
6163 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
6164
6165 #. type: Plain text
6166 #: build/C/man2/select_tut.2:559
6167 #, no-wrap
6168 msgid ""
6169 "static int\n"
6170 "listen_socket(int listen_port)\n"
6171 "{\n"
6172 "    struct sockaddr_in a;\n"
6173 "    int s;\n"
6174 "    int yes;\n"
6175 msgstr ""
6176 "static int\n"
6177 "listen_socket(int listen_port)\n"
6178 "{\n"
6179 "    struct sockaddr_in a;\n"
6180 "    int s;\n"
6181 "    int yes;\n"
6182
6183 #. type: Plain text
6184 #: build/C/man2/select_tut.2:584
6185 #, no-wrap
6186 msgid ""
6187 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6188 "    if (s == -1) {\n"
6189 "        perror(\"socket\");\n"
6190 "        return -1;\n"
6191 "    }\n"
6192 "    yes = 1;\n"
6193 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6194 "            &yes, sizeof(yes)) == -1) {\n"
6195 "        perror(\"setsockopt\");\n"
6196 "        close(s);\n"
6197 "        return -1;\n"
6198 "    }\n"
6199 "    memset(&a, 0, sizeof(a));\n"
6200 "    a.sin_port = htons(listen_port);\n"
6201 "    a.sin_family = AF_INET;\n"
6202 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6203 "        perror(\"bind\");\n"
6204 "        close(s);\n"
6205 "        return -1;\n"
6206 "    }\n"
6207 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6208 "    listen(s, 10);\n"
6209 "    return s;\n"
6210 "}\n"
6211 msgstr ""
6212 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
6213 "        perror(\"socket\");\n"
6214 "        return -1;\n"
6215 "    }\n"
6216 "    yes = 1;\n"
6217 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
6218 "            &yes, sizeof(yes)) == -1) {\n"
6219 "        perror(\"setsockopt\");\n"
6220 "        close(s);\n"
6221 "        return -1;\n"
6222 "    }\n"
6223 "    memset(&a, 0, sizeof(a));\n"
6224 "    a.sin_port = htons(listen_port);\n"
6225 "    a.sin_family = AF_INET;\n"
6226 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6227 "        perror(\"bind\");\n"
6228 "        close(s);\n"
6229 "        return -1;\n"
6230 "    }\n"
6231 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
6232 "    listen(s, 10);\n"
6233 "    return s;\n"
6234 "}\n"
6235
6236 #. type: Plain text
6237 #: build/C/man2/select_tut.2:590
6238 #, no-wrap
6239 msgid ""
6240 "static int\n"
6241 "connect_socket(int connect_port, char *address)\n"
6242 "{\n"
6243 "    struct sockaddr_in a;\n"
6244 "    int s;\n"
6245 msgstr ""
6246 "static int\n"
6247 "connect_socket(int connect_port, char *address)\n"
6248 "{\n"
6249 "    struct sockaddr_in a;\n"
6250 "    int s;\n"
6251
6252 #. type: Plain text
6253 #: build/C/man2/select_tut.2:597
6254 #, no-wrap
6255 msgid ""
6256 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6257 "    if (s == -1) {\n"
6258 "        perror(\"socket\");\n"
6259 "        close(s);\n"
6260 "        return -1;\n"
6261 "    }\n"
6262 msgstr ""
6263 "    s = socket(AF_INET, SOCK_STREAM, 0);\n"
6264 "    if (s == -1) {\n"
6265 "        perror(\"socket\");\n"
6266 "        close(s);\n"
6267 "        return -1;\n"
6268 "    }\n"
6269
6270 #. type: Plain text
6271 #: build/C/man2/select_tut.2:601
6272 #, no-wrap
6273 msgid ""
6274 "    memset(&a, 0, sizeof(a));\n"
6275 "    a.sin_port = htons(connect_port);\n"
6276 "    a.sin_family = AF_INET;\n"
6277 msgstr ""
6278 "    memset(&a, 0, sizeof(a));\n"
6279 "    a.sin_port = htons(connect_port);\n"
6280 "    a.sin_family = AF_INET;\n"
6281
6282 #. type: Plain text
6283 #: build/C/man2/select_tut.2:607
6284 #, no-wrap
6285 msgid ""
6286 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6287 "        perror(\"bad IP address format\");\n"
6288 "        close(s);\n"
6289 "        return -1;\n"
6290 "    }\n"
6291 msgstr ""
6292 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
6293 "        perror(\"bad IP address format\");\n"
6294 "        close(s);\n"
6295 "        return -1;\n"
6296 "    }\n"
6297
6298 #. type: Plain text
6299 #: build/C/man2/select_tut.2:616
6300 #, no-wrap
6301 msgid ""
6302 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6303 "        perror(\"connect()\");\n"
6304 "        shutdown(s, SHUT_RDWR);\n"
6305 "        close(s);\n"
6306 "        return -1;\n"
6307 "    }\n"
6308 "    return s;\n"
6309 "}\n"
6310 msgstr ""
6311 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
6312 "        perror(\"connect()\");\n"
6313 "        shutdown(s, SHUT_RDWR);\n"
6314 "        close(s);\n"
6315 "        return -1;\n"
6316 "    }\n"
6317 "    return s;\n"
6318 "}\n"
6319
6320 #. type: Plain text
6321 #: build/C/man2/select_tut.2:624
6322 #, no-wrap
6323 msgid ""
6324 "#define SHUT_FD1 do {                                \\e\n"
6325 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6326 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6327 "                         close(fd1);                 \\e\n"
6328 "                         fd1 = -1;                   \\e\n"
6329 "                     }                               \\e\n"
6330 "                 } while (0)\n"
6331 msgstr ""
6332 "#define SHUT_FD1 do {                                \\e\n"
6333 "                     if (fd1 E<gt>= 0) {                 \\e\n"
6334 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
6335 "                         close(fd1);                 \\e\n"
6336 "                         fd1 = -1;                   \\e\n"
6337 "                     }                               \\e\n"
6338 "                 } while (0)\n"
6339
6340 #. type: Plain text
6341 #: build/C/man2/select_tut.2:632
6342 #, no-wrap
6343 msgid ""
6344 "#define SHUT_FD2 do {                                \\e\n"
6345 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6346 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6347 "                         close(fd2);                 \\e\n"
6348 "                         fd2 = -1;                   \\e\n"
6349 "                     }                               \\e\n"
6350 "                 } while (0)\n"
6351 msgstr ""
6352 "#define SHUT_FD2 do {                                \\e\n"
6353 "                     if (fd2 E<gt>= 0) {                 \\e\n"
6354 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
6355 "                         close(fd2);                 \\e\n"
6356 "                         fd2 = -1;                   \\e\n"
6357 "                     }                               \\e\n"
6358 "                 } while (0)\n"
6359
6360 #. type: Plain text
6361 #: build/C/man2/select_tut.2:634
6362 #, no-wrap
6363 msgid "#define BUF_SIZE 1024\n"
6364 msgstr "#define BUF_SIZE 1024\n"
6365
6366 #. type: Plain text
6367 #: build/C/man2/select_tut.2:643
6368 #, no-wrap
6369 msgid ""
6370 "int\n"
6371 "main(int argc, char *argv[])\n"
6372 "{\n"
6373 "    int h;\n"
6374 "    int fd1 = -1, fd2 = -1;\n"
6375 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6376 "    int buf1_avail, buf1_written;\n"
6377 "    int buf2_avail, buf2_written;\n"
6378 msgstr ""
6379 "int\n"
6380 "main(int argc, char *argv[])\n"
6381 "{\n"
6382 "    int h;\n"
6383 "    int fd1 = -1, fd2 = -1;\n"
6384 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
6385 "    int buf1_avail, buf1_written;\n"
6386 "    int buf2_avail, buf2_written;\n"
6387
6388 #. type: Plain text
6389 #: build/C/man2/select_tut.2:649
6390 #, no-wrap
6391 msgid ""
6392 "    if (argc != 4) {\n"
6393 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6394 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6395 "        exit(EXIT_FAILURE);\n"
6396 "    }\n"
6397 msgstr ""
6398 "    if (argc != 4) {\n"
6399 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
6400 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
6401 "        exit(EXIT_FAILURE);\n"
6402 "    }\n"
6403
6404 #. type: Plain text
6405 #: build/C/man2/select_tut.2:651
6406 #, no-wrap
6407 msgid "    signal(SIGPIPE, SIG_IGN);\n"
6408 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
6409
6410 #. type: Plain text
6411 #: build/C/man2/select_tut.2:653
6412 #, no-wrap
6413 msgid "    forward_port = atoi(argv[2]);\n"
6414 msgstr "    forward_port = atoi(argv[2]);\n"
6415
6416 #. type: Plain text
6417 #: build/C/man2/select_tut.2:657
6418 #, no-wrap
6419 msgid ""
6420 "    h = listen_socket(atoi(argv[1]));\n"
6421 "    if (h == -1)\n"
6422 "        exit(EXIT_FAILURE);\n"
6423 msgstr ""
6424 "    h = listen_socket(atoi(argv[1]));\n"
6425 "    if (h == -1)\n"
6426 "        exit(EXIT_FAILURE);\n"
6427
6428 #. type: Plain text
6429 #: build/C/man2/select_tut.2:661
6430 #, no-wrap
6431 msgid ""
6432 "    for (;;) {\n"
6433 "        int r, nfds = 0;\n"
6434 "        fd_set rd, wr, er;\n"
6435 msgstr ""
6436 "    for (;;) {\n"
6437 "        int r, nfds = 0;\n"
6438 "        fd_set rd, wr, er;\n"
6439
6440 #. type: Plain text
6441 #: build/C/man2/select_tut.2:691
6442 #, no-wrap
6443 msgid ""
6444 "        FD_ZERO(&rd);\n"
6445 "        FD_ZERO(&wr);\n"
6446 "        FD_ZERO(&er);\n"
6447 "        FD_SET(h, &rd);\n"
6448 "        nfds = max(nfds, h);\n"
6449 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6450 "            FD_SET(fd1, &rd);\n"
6451 "            nfds = max(nfds, fd1);\n"
6452 "        }\n"
6453 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6454 "            FD_SET(fd2, &rd);\n"
6455 "            nfds = max(nfds, fd2);\n"
6456 "        }\n"
6457 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6458 "            FD_SET(fd1, &wr);\n"
6459 "            nfds = max(nfds, fd1);\n"
6460 "        }\n"
6461 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6462 "            FD_SET(fd2, &wr);\n"
6463 "            nfds = max(nfds, fd2);\n"
6464 "        }\n"
6465 "        if (fd1 E<gt> 0) {\n"
6466 "            FD_SET(fd1, &er);\n"
6467 "            nfds = max(nfds, fd1);\n"
6468 "        }\n"
6469 "        if (fd2 E<gt> 0) {\n"
6470 "            FD_SET(fd2, &er);\n"
6471 "            nfds = max(nfds, fd2);\n"
6472 "        }\n"
6473 msgstr ""
6474 "        FD_ZERO(&rd);\n"
6475 "        FD_ZERO(&wr);\n"
6476 "        FD_ZERO(&er);\n"
6477 "        FD_SET(h, &rd);\n"
6478 "        nfds = max(nfds, h);\n"
6479 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
6480 "            FD_SET(fd1, &rd);\n"
6481 "            nfds = max(nfds, fd1);\n"
6482 "        }\n"
6483 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
6484 "            FD_SET(fd2, &rd);\n"
6485 "            nfds = max(nfds, fd2);\n"
6486 "        }\n"
6487 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
6488 "            FD_SET(fd1, &wr);\n"
6489 "            nfds = max(nfds, fd1);\n"
6490 "        }\n"
6491 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
6492 "            FD_SET(fd2, &wr);\n"
6493 "            nfds = max(nfds, fd2);\n"
6494 "        }\n"
6495 "        if (fd1 E<gt> 0) {\n"
6496 "            FD_SET(fd1, &er);\n"
6497 "            nfds = max(nfds, fd1);\n"
6498 "        }\n"
6499 "        if (fd2 E<gt> 0) {\n"
6500 "            FD_SET(fd2, &er);\n"
6501 "            nfds = max(nfds, fd2);\n"
6502 "        }\n"
6503
6504 #. type: Plain text
6505 #: build/C/man2/select_tut.2:693
6506 #, no-wrap
6507 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6508 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
6509
6510 #. type: Plain text
6511 #: build/C/man2/select_tut.2:696
6512 #, no-wrap
6513 msgid ""
6514 "        if (r == -1 && errno == EINTR)\n"
6515 "            continue;\n"
6516 msgstr ""
6517 "        if (r == -1 && errno == EINTR)\n"
6518 "            continue;\n"
6519
6520 #. type: Plain text
6521 #: build/C/man2/select_tut.2:701
6522 #, no-wrap
6523 msgid ""
6524 "        if (r == -1) {\n"
6525 "            perror(\"select()\");\n"
6526 "            exit(EXIT_FAILURE);\n"
6527 "        }\n"
6528 msgstr ""
6529 "        if (r == -1) {\n"
6530 "            perror(\"select()\");\n"
6531 "            exit(EXIT_FAILURE);\n"
6532 "        }\n"
6533
6534 #. type: Plain text
6535 #: build/C/man2/select_tut.2:705
6536 #, no-wrap
6537 msgid ""
6538 "        if (FD_ISSET(h, &rd)) {\n"
6539 "            unsigned int l;\n"
6540 "            struct sockaddr_in client_address;\n"
6541 msgstr ""
6542 "        if (FD_ISSET(h, &rd)) {\n"
6543 "            unsigned int l;\n"
6544 "            struct sockaddr_in client_address;\n"
6545
6546 #. type: Plain text
6547 #: build/C/man2/select_tut.2:724
6548 #, no-wrap
6549 msgid ""
6550 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6551 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6552 "            if (r == -1) {\n"
6553 "                perror(\"accept()\");\n"
6554 "            } else {\n"
6555 "                SHUT_FD1;\n"
6556 "                SHUT_FD2;\n"
6557 "                buf1_avail = buf1_written = 0;\n"
6558 "                buf2_avail = buf2_written = 0;\n"
6559 "                fd1 = r;\n"
6560 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6561 "                if (fd2 == -1)\n"
6562 "                    SHUT_FD1;\n"
6563 "                else\n"
6564 "                    printf(\"connect from %s\\en\",\n"
6565 "                            inet_ntoa(client_address.sin_addr));\n"
6566 "            }\n"
6567 "        }\n"
6568 msgstr ""
6569 "            memset(&client_address, 0, l = sizeof(client_address));\n"
6570 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
6571 "            if (r == -1) {\n"
6572 "                perror(\"accept()\");\n"
6573 "            } else {\n"
6574 "                SHUT_FD1;\n"
6575 "                SHUT_FD2;\n"
6576 "                buf1_avail = buf1_written = 0;\n"
6577 "                buf2_avail = buf2_written = 0;\n"
6578 "                fd1 = r;\n"
6579 "                fd2 = connect_socket(forward_port, argv[3]);\n"
6580 "                if (fd2 == -1)\n"
6581 "                    SHUT_FD1;\n"
6582 "                else\n"
6583 "                    printf(\"connect from %s\\en\",\n"
6584 "                            inet_ntoa(client_address.sin_addr));\n"
6585 "            }\n"
6586 "        }\n"
6587
6588 #. type: Plain text
6589 #: build/C/man2/select_tut.2:726
6590 #, no-wrap
6591 msgid "        /* NB: read oob data before normal reads */\n"
6592 msgstr "        /* NB: read oob data before normal reads */\n"
6593
6594 #. type: Plain text
6595 #: build/C/man2/select_tut.2:730
6596 #, no-wrap
6597 msgid ""
6598 "        if (fd1 E<gt> 0)\n"
6599 "            if (FD_ISSET(fd1, &er)) {\n"
6600 "                char c;\n"
6601 msgstr ""
6602 "        if (fd1 E<gt> 0)\n"
6603 "            if (FD_ISSET(fd1, &er)) {\n"
6604 "                char c;\n"
6605
6606 #. type: Plain text
6607 #: build/C/man2/select_tut.2:740
6608 #, no-wrap
6609 msgid ""
6610 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6611 "                if (r E<lt> 1)\n"
6612 "                    SHUT_FD1;\n"
6613 "                else\n"
6614 "                    send(fd2, &c, 1, MSG_OOB);\n"
6615 "            }\n"
6616 "        if (fd2 E<gt> 0)\n"
6617 "            if (FD_ISSET(fd2, &er)) {\n"
6618 "                char c;\n"
6619 msgstr ""
6620 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
6621 "                if (r E<lt> 1)\n"
6622 "                    SHUT_FD1;\n"
6623 "                else\n"
6624 "                    send(fd2, &c, 1, MSG_OOB);\n"
6625 "            }\n"
6626 "        if (fd2 E<gt> 0)\n"
6627 "            if (FD_ISSET(fd2, &er)) {\n"
6628 "                char c;\n"
6629
6630 #. type: Plain text
6631 #: build/C/man2/select_tut.2:783
6632 #, no-wrap
6633 msgid ""
6634 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6635 "                if (r E<lt> 1)\n"
6636 "                    SHUT_FD2;\n"
6637 "                else\n"
6638 "                    send(fd1, &c, 1, MSG_OOB);\n"
6639 "            }\n"
6640 "        if (fd1 E<gt> 0)\n"
6641 "            if (FD_ISSET(fd1, &rd)) {\n"
6642 "                r = read(fd1, buf1 + buf1_avail,\n"
6643 "                          BUF_SIZE - buf1_avail);\n"
6644 "                if (r E<lt> 1)\n"
6645 "                    SHUT_FD1;\n"
6646 "                else\n"
6647 "                    buf1_avail += r;\n"
6648 "            }\n"
6649 "        if (fd2 E<gt> 0)\n"
6650 "            if (FD_ISSET(fd2, &rd)) {\n"
6651 "                r = read(fd2, buf2 + buf2_avail,\n"
6652 "                          BUF_SIZE - buf2_avail);\n"
6653 "                if (r E<lt> 1)\n"
6654 "                    SHUT_FD2;\n"
6655 "                else\n"
6656 "                    buf2_avail += r;\n"
6657 "            }\n"
6658 "        if (fd1 E<gt> 0)\n"
6659 "            if (FD_ISSET(fd1, &wr)) {\n"
6660 "                r = write(fd1, buf2 + buf2_written,\n"
6661 "                           buf2_avail - buf2_written);\n"
6662 "                if (r E<lt> 1)\n"
6663 "                    SHUT_FD1;\n"
6664 "                else\n"
6665 "                    buf2_written += r;\n"
6666 "            }\n"
6667 "        if (fd2 E<gt> 0)\n"
6668 "            if (FD_ISSET(fd2, &wr)) {\n"
6669 "                r = write(fd2, buf1 + buf1_written,\n"
6670 "                           buf1_avail - buf1_written);\n"
6671 "                if (r E<lt> 1)\n"
6672 "                    SHUT_FD2;\n"
6673 "                else\n"
6674 "                    buf1_written += r;\n"
6675 "            }\n"
6676 msgstr ""
6677 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
6678 "                if (r E<lt> 1)\n"
6679 "                    SHUT_FD2;\n"
6680 "                else\n"
6681 "                    send(fd1, &c, 1, MSG_OOB);\n"
6682 "            }\n"
6683 "        if (fd1 E<gt> 0)\n"
6684 "            if (FD_ISSET(fd1, &rd)) {\n"
6685 "                r = read(fd1, buf1 + buf1_avail,\n"
6686 "                          BUF_SIZE - buf1_avail);\n"
6687 "                if (r E<lt> 1)\n"
6688 "                    SHUT_FD1;\n"
6689 "                else\n"
6690 "                    buf1_avail += r;\n"
6691 "            }\n"
6692 "        if (fd2 E<gt> 0)\n"
6693 "            if (FD_ISSET(fd2, &rd)) {\n"
6694 "                r = read(fd2, buf2 + buf2_avail,\n"
6695 "                          BUF_SIZE - buf2_avail);\n"
6696 "                if (r E<lt> 1)\n"
6697 "                    SHUT_FD2;\n"
6698 "                else\n"
6699 "                    buf2_avail += r;\n"
6700 "            }\n"
6701 "        if (fd1 E<gt> 0)\n"
6702 "            if (FD_ISSET(fd1, &wr)) {\n"
6703 "                r = write(fd1, buf2 + buf2_written,\n"
6704 "                           buf2_avail - buf2_written);\n"
6705 "                if (r E<lt> 1)\n"
6706 "                    SHUT_FD1;\n"
6707 "                else\n"
6708 "                    buf2_written += r;\n"
6709 "            }\n"
6710 "        if (fd2 E<gt> 0)\n"
6711 "            if (FD_ISSET(fd2, &wr)) {\n"
6712 "                r = write(fd2, buf1 + buf1_written,\n"
6713 "                           buf1_avail - buf1_written);\n"
6714 "                if (r E<lt> 1)\n"
6715 "                    SHUT_FD2;\n"
6716 "                else\n"
6717 "                    buf1_written += r;\n"
6718 "            }\n"
6719
6720 #. type: Plain text
6721 #: build/C/man2/select_tut.2:785
6722 #, no-wrap
6723 msgid "        /* check if write data has caught read data */\n"
6724 msgstr "        /* check if write data has caught read data */\n"
6725
6726 #. type: Plain text
6727 #: build/C/man2/select_tut.2:790
6728 #, no-wrap
6729 msgid ""
6730 "        if (buf1_written == buf1_avail)\n"
6731 "            buf1_written = buf1_avail = 0;\n"
6732 "        if (buf2_written == buf2_avail)\n"
6733 "            buf2_written = buf2_avail = 0;\n"
6734 msgstr ""
6735 "        if (buf1_written == buf1_avail)\n"
6736 "            buf1_written = buf1_avail = 0;\n"
6737 "        if (buf2_written == buf2_avail)\n"
6738 "            buf2_written = buf2_avail = 0;\n"
6739
6740 #. type: Plain text
6741 #: build/C/man2/select_tut.2:793
6742 #, no-wrap
6743 msgid ""
6744 "        /* one side has closed the connection, keep\n"
6745 "           writing to the other side until empty */\n"
6746 msgstr ""
6747 "        /* one side has closed the connection, keep\n"
6748 "           writing to the other side until empty */\n"
6749
6750 #. type: Plain text
6751 #: build/C/man2/select_tut.2:801
6752 #, no-wrap
6753 msgid ""
6754 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6755 "            SHUT_FD2;\n"
6756 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6757 "            SHUT_FD1;\n"
6758 "    }\n"
6759 "    exit(EXIT_SUCCESS);\n"
6760 "}\n"
6761 msgstr ""
6762 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
6763 "            SHUT_FD2;\n"
6764 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
6765 "            SHUT_FD1;\n"
6766 "    }\n"
6767 "    exit(EXIT_SUCCESS);\n"
6768 "}\n"
6769
6770 #. type: Plain text
6771 #: build/C/man2/select_tut.2:815
6772 msgid ""
6773 "The above program properly forwards most kinds of TCP connections including "
6774 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
6775 "problem of having data flow in both directions simultaneously.  You might "
6776 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
6777 "each stream.  This becomes more tricky than you might suspect.  Another idea "
6778 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
6779 "because you end up using inefficient timeouts."
6780 msgstr ""
6781 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
6782 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
6783 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 "
6784 "B<fork>(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効"
6785 "率的だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこ"
6786 "しい。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、と"
6787 "いうアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的"
6788 "に起こってしまう。"
6789
6790 #. type: Plain text
6791 #: build/C/man2/select_tut.2:821
6792 msgid ""
6793 "The program does not handle more than one simultaneous connection at a time, "
6794 "although it could easily be extended to do this with a linked list of buffers"
6795 "\\(emone for each connection.  At the moment, new connections cause the "
6796 "current connection to be dropped."
6797 msgstr ""
6798 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
6799 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
6800 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
6801
6802 #.  .SH AUTHORS
6803 #.  This man page was written by Paul Sheer.
6804 #. type: Plain text
6805 #: build/C/man2/select_tut.2:840
6806 msgid ""
6807 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6808 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6809 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6810 "B<sigismember>(3), B<epoll>(7)"
6811 msgstr ""
6812 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), "
6813 "B<recv>(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), "
6814 "B<sigaddset>(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), "
6815 "B<sigismember>(3), B<epoll>(7)"
6816
6817 #. type: TH
6818 #: build/C/man2/send.2:40
6819 #, no-wrap
6820 msgid "SEND"
6821 msgstr "SEND"
6822
6823 #. type: Plain text
6824 #: build/C/man2/send.2:43
6825 msgid "send, sendto, sendmsg - send a message on a socket"
6826 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
6827
6828 #. type: Plain text
6829 #: build/C/man2/send.2:47
6830 #, no-wrap
6831 msgid ""
6832 "B<#include E<lt>sys/types.hE<gt>>\n"
6833 "B<#include E<lt>sys/socket.hE<gt>>\n"
6834 msgstr ""
6835 "B<#include E<lt>sys/types.hE<gt>>\n"
6836 "B<#include E<lt>sys/socket.hE<gt>>\n"
6837
6838 #. type: Plain text
6839 #: build/C/man2/send.2:50
6840 #, no-wrap
6841 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6842 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6843
6844 #. type: Plain text
6845 #: build/C/man2/send.2:54
6846 #, no-wrap
6847 msgid ""
6848 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6849 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6850 msgstr ""
6851 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
6852 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
6853
6854 #. type: Plain text
6855 #: build/C/man2/send.2:57
6856 #, no-wrap
6857 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6858 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
6859
6860 #. type: Plain text
6861 #: build/C/man2/send.2:65
6862 msgid ""
6863 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
6864 "transmit a message to another socket."
6865 msgstr ""
6866 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
6867 "メッセージを転送するのに使用される。"
6868
6869 #. type: Plain text
6870 #: build/C/man2/send.2:84
6871 msgid ""
6872 "The B<send>()  call may be used only when the socket is in a I<connected> "
6873 "state (so that the intended recipient is known).  The only difference "
6874 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
6875 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
6876 "following call"
6877 msgstr ""
6878 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
6879 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と "
6880 "B<write>(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 "
6881 "I<flags> にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価であ"
6882 "る。 また、"
6883
6884 #. type: Plain text
6885 #: build/C/man2/send.2:86
6886 #, no-wrap
6887 msgid "    send(sockfd, buf, len, flags);\n"
6888 msgstr "    send(sockfd, buf, len, flags);\n"
6889
6890 #. type: Plain text
6891 #: build/C/man2/send.2:88
6892 msgid "is equivalent to"
6893 msgstr "は以下と等価である。"
6894
6895 #. type: Plain text
6896 #: build/C/man2/send.2:90
6897 #, no-wrap
6898 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6899 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
6900
6901 #. type: Plain text
6902 #: build/C/man2/send.2:94
6903 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
6904 msgstr ""
6905 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
6906 "る。"
6907
6908 #. type: Plain text
6909 #: build/C/man2/send.2:122
6910 msgid ""
6911 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
6912 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
6913 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
6914 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
6915 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
6916 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
6917 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
6918 "size."
6919 msgstr ""
6920 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
6921 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
6922 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
6923 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
6924 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
6925 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 "
6926 "B<sendmsg>()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズ"
6927 "は I<msg.msg_namelen> で指定される。"
6928
6929 #. type: Plain text
6930 #: build/C/man2/send.2:138
6931 msgid ""
6932 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6933 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6934 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6935 "ancillary data (also known as control information)."
6936 msgstr ""
6937 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6938 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6939 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6940 "(制御情報とも呼ばれる) を送信することもできる。"
6941
6942 #. type: Plain text
6943 #: build/C/man2/send.2:143
6944 msgid ""
6945 "If the message is too long to pass atomically through the underlying "
6946 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6947 "transmitted."
6948 msgstr ""
6949 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6950 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6951 "ラーが返され、そのメッセージは転送されない。"
6952
6953 #. type: Plain text
6954 #: build/C/man2/send.2:147
6955 msgid ""
6956 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6957 "detected errors are indicated by a return value of -1."
6958 msgstr ""
6959 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6960 "出された場合は、返り値 -1 として通知される。"
6961
6962 #. type: Plain text
6963 #: build/C/man2/send.2:160
6964 msgid ""
6965 "When the message does not fit into the send buffer of the socket, B<send>()  "
6966 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6967 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6968 "in this case.  The B<select>(2)  call may be used to determine when it is "
6969 "possible to send more data."
6970 msgstr ""
6971 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6972 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6973 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6974 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6975 "用することができる。"
6976
6977 #.  FIXME . ? document MSG_PROXY (which went away in 2.3.15)
6978 #. type: Plain text
6979 #: build/C/man2/send.2:166
6980 msgid ""
6981 "The I<flags> argument is the bitwise OR of zero or more of the following "
6982 "flags."
6983 msgstr ""
6984 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6985 "のを指定する。"
6986
6987 #. type: TP
6988 #: build/C/man2/send.2:166
6989 #, no-wrap
6990 msgid "B<MSG_CONFIRM> (since Linux 2.3.15)"
6991 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6992
6993 #. type: Plain text
6994 #: build/C/man2/send.2:180
6995 msgid ""
6996 "Tell the link layer that forward progress happened: you got a successful "
6997 "reply from the other side.  If the link layer doesn't get this it will "
6998 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6999 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently implemented only for "
7000 "IPv4 and IPv6.  See B<arp>(7)  for details."
7001 msgstr ""
7002 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
7003 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
7004 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
7005 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
7006 "されている。 詳しくは B<arp>(7)  参照のこと。"
7007
7008 #. type: TP
7009 #: build/C/man2/send.2:180
7010 #, no-wrap
7011 msgid "B<MSG_DONTROUTE>"
7012 msgstr "B<MSG_DONTROUTE>"
7013
7014 #. type: Plain text
7015 #: build/C/man2/send.2:188
7016 msgid ""
7017 "Don't use a gateway to send out the packet, send to hosts only on directly "
7018 "connected networks.  This is usually used only by diagnostic or routing "
7019 "programs.  This is defined only for protocol families that route; packet "
7020 "sockets don't."
7021 msgstr ""
7022 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
7023 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
7024 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
7025 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
7026
7027 #. type: Plain text
7028 #: build/C/man2/send.2:199
7029 msgid ""
7030 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
7031 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
7032 "flag with the B<F_SETFL> B<fcntl>(2))."
7033 msgstr ""
7034 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
7035 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
7036 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
7037
7038 #. type: TP
7039 #: build/C/man2/send.2:199
7040 #, no-wrap
7041 msgid "B<MSG_EOR> (since Linux 2.2)"
7042 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
7043
7044 #. type: Plain text
7045 #: build/C/man2/send.2:203
7046 msgid ""
7047 "Terminates a record (when this notion is supported, as for sockets of type "
7048 "B<SOCK_SEQPACKET>)."
7049 msgstr ""
7050 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
7051 "ケット種別のときに有効)。"
7052
7053 #. type: TP
7054 #: build/C/man2/send.2:203
7055 #, no-wrap
7056 msgid "B<MSG_MORE> (since Linux 2.4.4)"
7057 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
7058
7059 #. type: Plain text
7060 #: build/C/man2/send.2:212
7061 msgid ""
7062 "The caller has more data to send.  This flag is used with TCP sockets to "
7063 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
7064 "with the difference that this flag can be set on a per-call basis."
7065 msgstr ""
7066 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
7067 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる "
7068 "(B<tcp>(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位"
7069 "で この機能を有効にできる点である。"
7070
7071 #. type: Plain text
7072 #: build/C/man2/send.2:221
7073 msgid ""
7074 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
7075 "the kernel to package all of the data sent in calls with this flag set into "
7076 "a single datagram which is transmitted only when a call is performed that "
7077 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
7078 "described in B<udp>(7).)"
7079 msgstr ""
7080 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
7081 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
7082 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
7083 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
7084 "ソケットオプション B<UDP_CORK> も参照)。"
7085
7086 #. type: TP
7087 #: build/C/man2/send.2:221
7088 #, no-wrap
7089 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
7090 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
7091
7092 #. type: Plain text
7093 #: build/C/man2/send.2:230
7094 msgid ""
7095 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
7096 "the other end breaks the connection.  The B<EPIPE> error is still returned."
7097 msgstr ""
7098 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
7099 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
7100
7101 #. type: Plain text
7102 #: build/C/man2/send.2:239
7103 msgid ""
7104 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
7105 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
7106 "data."
7107 msgstr ""
7108 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
7109 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
7110 "をサポートしている必要がある。"
7111
7112 #. type: SS
7113 #: build/C/man2/send.2:239
7114 #, no-wrap
7115 msgid "sendmsg()"
7116 msgstr "sendmsg()"
7117
7118 #. type: Plain text
7119 #: build/C/man2/send.2:245
7120 msgid ""
7121 "The definition of the I<msghdr> structure employed by B<sendmsg>()  is as "
7122 "follows:"
7123 msgstr "B<sendmsg>() で利用されている I<msghdr> 構造体は以下の通り。"
7124
7125 #. type: Plain text
7126 #: build/C/man2/send.2:257
7127 #, no-wrap
7128 msgid ""
7129 "struct msghdr {\n"
7130 "    void         *msg_name;       /* optional address */\n"
7131 "    socklen_t     msg_namelen;    /* size of address */\n"
7132 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
7133 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
7134 "    void         *msg_control;    /* ancillary data, see below */\n"
7135 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
7136 "    int           msg_flags;      /* flags (unused) */\n"
7137 "};\n"
7138 msgstr ""
7139 "struct msghdr {\n"
7140 "    void         *msg_name;       /* 追加のアドレス */\n"
7141 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
7142 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
7143 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
7144 "    void         *msg_control;    /* 補助データ (後述) */\n"
7145 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
7146 "    int           msg_flags;      /* フラグ (未使用) */\n"
7147 "};\n"
7148
7149 #. type: Plain text
7150 #: build/C/man2/send.2:269
7151 msgid ""
7152 "The I<msg_name> field is used on an unconnected socket to specify the target "
7153 "address for a datagram.  It points to a buffer containing the address; the "
7154 "I<msg_namelen> field should be set to the size of the address.  For a "
7155 "connected socket, these fields should be specified as NULL and 0, "
7156 "respectively."
7157 msgstr ""
7158 "フィールド I<msg_name> は、 未接続のソケットでデータグラムの宛先アドレスを指"
7159 "定するのに使用される。 このフィールドはアドレスを格納したバッファを指す。 "
7160 "フィールド I<msg_namelen> にはアドレスの大きさを設定しなければならない。 接続"
7161 "済のソケットについては、これらのフィールドにはそれぞれ NULL と 0 を指定しなけ"
7162 "ればならない。"
7163
7164 #. type: Plain text
7165 #: build/C/man2/send.2:276
7166 msgid ""
7167 "The I<msg_iov> and I<msg_iovlen> fields specify scatter-gather locations, as "
7168 "for B<writev>(2)."
7169 msgstr ""
7170 "フィールド B<msg_iov> と I<msg_iovlen> は scatter-gather 用の場所を指定す"
7171 "る。 B<writev>(2) と同じ。"
7172
7173 #. type: Plain text
7174 #: build/C/man2/send.2:287
7175 msgid ""
7176 "You may send control information using the I<msg_control> and "
7177 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
7178 "process is limited per socket by the value in I</proc/sys/net/core/"
7179 "optmem_max>; see B<socket>(7)."
7180 msgstr ""
7181 "フィールド I<msg_control> と I<msg_controllen> を使用して制御情報を送信するこ"
7182 "とができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
7183 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
7184
7185 #.  Still to be documented:
7186 #.   Send file descriptors and user credentials using the
7187 #.   msg_control* fields.
7188 #. type: Plain text
7189 #: build/C/man2/send.2:294
7190 msgid "The I<msg_flags> field is ignored."
7191 msgstr "フィールド I<msg_flags> は無視される。"
7192
7193 #. type: Plain text
7194 #: build/C/man2/send.2:299
7195 msgid ""
7196 "On success, these calls return the number of bytes sent.  On error, -1 is "
7197 "returned, and I<errno> is set appropriately."
7198 msgstr ""
7199 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
7200 "合、 -1 を返し、 I<errno> を適切に設定にする。"
7201
7202 #. type: Plain text
7203 #: build/C/man2/send.2:304
7204 msgid ""
7205 "These are some standard errors generated by the socket layer.  Additional "
7206 "errors may be generated and returned from the underlying protocol modules; "
7207 "see their respective manual pages."
7208 msgstr ""
7209 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
7210 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
7211 "れぞれのマニュアルを参照すること。"
7212
7213 #. type: Plain text
7214 #: build/C/man2/send.2:312
7215 msgid ""
7216 "(For UNIX domain sockets, which are identified by pathname)  Write "
7217 "permission is denied on the destination socket file, or search permission is "
7218 "denied for one of the directories the path prefix.  (See "
7219 "B<path_resolution>(7).)"
7220 msgstr ""
7221 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
7222 "\n"
7223 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
7224 "ディレクトリのいずれかに対する検索許可がなかった。\n"
7225 "(B<path_resolution>(7) も参照のこと)"
7226
7227 #. type: Plain text
7228 #: build/C/man2/send.2:315
7229 msgid ""
7230 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
7231 "as though it was a unicast address."
7232 msgstr ""
7233 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
7234 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
7235
7236 #.  Actually EAGAIN on Linux
7237 #. type: Plain text
7238 #: build/C/man2/send.2:323
7239 msgid ""
7240 "The socket is marked nonblocking and the requested operation would block.  "
7241 "POSIX.1-2001 allows either error to be returned for this case, and does not "
7242 "require these constants to have the same value, so a portable application "
7243 "should check for both possibilities."
7244 msgstr ""
7245 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
7246 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
7247 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
7248 "両方の可能性を 確認すべきである。"
7249
7250 #. type: Plain text
7251 #: build/C/man2/send.2:336
7252 msgid ""
7253 "(Internet domain datagram sockets)  The socket referred to by I<sockfd> had "
7254 "not previously been bound to an address and, upon attempting to bind it to "
7255 "an ephemeral port, it was determined that all port numbers in the ephemeral "
7256 "port range are currently in use.  See the discussion of I</proc/sys/net/ipv4/"
7257 "ip_local_port_range> in B<ip>(7)."
7258 msgstr ""
7259 "(インターネットドメインデータグラムソケットの場合) I<sockfd> が参照するソケッ"
7260 "トがそれ以前にアドレスにバインドされておらず、 そのソケットに一時ポートをバイ"
7261 "ンドしようとした際に、 一時ポートとして使用する範囲のポート番号がすべて使用中"
7262 "であった。 B<ip>(7) の I</proc/sys/net/ipv4/ip_local_port_range> の議論を参照"
7263 "のこと。"
7264
7265 #. type: Plain text
7266 #: build/C/man2/send.2:339
7267 msgid "An invalid descriptor was specified."
7268 msgstr "無効なディスクリプターが指定された。"
7269
7270 #. type: TP
7271 #: build/C/man2/send.2:339
7272 #, no-wrap
7273 msgid "B<ECONNRESET>"
7274 msgstr "B<ECONNRESET>"
7275
7276 #. type: Plain text
7277 #: build/C/man2/send.2:342
7278 msgid "Connection reset by peer."
7279 msgstr "接続が接続相手によりリセットされた。"
7280
7281 #. type: TP
7282 #: build/C/man2/send.2:342
7283 #, no-wrap
7284 msgid "B<EDESTADDRREQ>"
7285 msgstr "B<EDESTADDRREQ>"
7286
7287 #. type: Plain text
7288 #: build/C/man2/send.2:345
7289 msgid "The socket is not connection-mode, and no peer address is set."
7290 msgstr ""
7291 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
7292 "ていない。"
7293
7294 #. type: Plain text
7295 #: build/C/man2/send.2:348
7296 msgid "An invalid user space address was specified for an argument."
7297 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
7298
7299 #. type: Plain text
7300 #: build/C/man2/send.2:352
7301 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
7302 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
7303
7304 #. type: Plain text
7305 #: build/C/man2/send.2:361
7306 msgid ""
7307 "The connection-mode socket was connected already but a recipient was "
7308 "specified.  (Now either this error is returned, or the recipient "
7309 "specification is ignored.)"
7310 msgstr ""
7311 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
7312 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
7313 "いずれかとなる)"
7314
7315 #. type: TP
7316 #: build/C/man2/send.2:361
7317 #, no-wrap
7318 msgid "B<EMSGSIZE>"
7319 msgstr "B<EMSGSIZE>"
7320
7321 #.  (e.g., SOCK_DGRAM )
7322 #. type: Plain text
7323 #: build/C/man2/send.2:367
7324 msgid ""
7325 "The socket type requires that message be sent atomically, and the size of "
7326 "the message to be sent made this impossible."
7327 msgstr ""
7328 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
7329 "るが、 メッセージが大き過ぎるため送信することができない。"
7330
7331 #. type: Plain text
7332 #: build/C/man2/send.2:375
7333 msgid ""
7334 "The output queue for a network interface was full.  This generally indicates "
7335 "that the interface has stopped sending, but may be caused by transient "
7336 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
7337 "silently dropped when a device queue overflows.)"
7338 msgstr ""
7339 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
7340 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
7341 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
7342 "フローした場合にはパケットは黙って捨てられる)"
7343
7344 #. type: Plain text
7345 #: build/C/man2/send.2:378
7346 msgid "No memory available."
7347 msgstr "メモリが足りない。"
7348
7349 #. type: Plain text
7350 #: build/C/man2/send.2:381
7351 msgid "The socket is not connected, and no target has been given."
7352 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
7353
7354 #. type: Plain text
7355 #: build/C/man2/send.2:391
7356 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
7357 msgstr ""
7358 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
7359 "る。"
7360
7361 #. type: TP
7362 #: build/C/man2/send.2:391
7363 #, no-wrap
7364 msgid "B<EPIPE>"
7365 msgstr "B<EPIPE>"
7366
7367 #. type: Plain text
7368 #: build/C/man2/send.2:400
7369 msgid ""
7370 "The local end has been shut down on a connection oriented socket.  In this "
7371 "case, the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
7372 "set."
7373 msgstr ""
7374 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
7375 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
7376
7377 #. type: Plain text
7378 #: build/C/man2/send.2:403
7379 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
7380 msgstr ""
7381 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
7382
7383 #. type: Plain text
7384 #: build/C/man2/send.2:414
7385 msgid ""
7386 "POSIX.1-2001 describes only the B<MSG_OOB> and B<MSG_EOR> flags.  "
7387 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
7388 "flag is a Linux extension."
7389 msgstr ""
7390 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
7391 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
7392 "ラグは Linux での拡張である。"
7393
7394 #. type: Plain text
7395 #: build/C/man2/send.2:433
7396 msgid ""
7397 "See B<sendmmsg>(2)  for information about a Linux-specific system call that "
7398 "can be used to transmit multiple datagrams in a single call."
7399 msgstr ""
7400 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
7401 "る\n"
7402 "Linux 固有の システムコールに関する情報が書かれている。"
7403
7404 #. type: Plain text
7405 #: build/C/man2/send.2:438
7406 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
7407 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
7408
7409 #. type: Plain text
7410 #: build/C/man2/send.2:443
7411 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
7412 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7413
7414 #. type: Plain text
7415 #: build/C/man2/send.2:458
7416 msgid ""
7417 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7418 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7419 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7420 msgstr ""
7421 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
7422 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), "
7423 "B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
7424
7425 #. type: TH
7426 #: build/C/man2/sendmmsg.2:28
7427 #, no-wrap
7428 msgid "SENDMMSG"
7429 msgstr "SENDMMSG"
7430
7431 #. type: TH
7432 #: build/C/man2/sendmmsg.2:28 build/C/man7/socket.7:58
7433 #, no-wrap
7434 msgid "2014-07-08"
7435 msgstr "2014-07-08"
7436
7437 #. type: Plain text
7438 #: build/C/man2/sendmmsg.2:31
7439 msgid "sendmmsg - send multiple messages on a socket"
7440 msgstr "sendmmsg - 複数のメッセージをソケットへ送信する"
7441
7442 #. type: Plain text
7443 #: build/C/man2/sendmmsg.2:39
7444 #, no-wrap
7445 msgid ""
7446 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7447 "B<             unsigned int >I<flags>B<);>\n"
7448 msgstr ""
7449 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
7450 "B<             unsigned int >I<flags>B<);>\n"
7451
7452 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
7453 #. type: Plain text
7454 #: build/C/man2/sendmmsg.2:49
7455 msgid ""
7456 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
7457 "the caller to transmit multiple messages on a socket using a single system "
7458 "call.  (This has performance benefits for some applications.)"
7459 msgstr ""
7460 "B<sendmmsg>() システムコールは B<sendmsg>(2) の拡張で、 このシステムコールを"
7461 "使うと一度の呼び出しでソケットに複数のメッセージを送信できる (アプリケーショ"
7462 "ンによっては性能上のメリットがある)。"
7463
7464 #. type: Plain text
7465 #: build/C/man2/sendmmsg.2:54
7466 msgid ""
7467 "The I<sockfd> argument is the file descriptor of the socket on which data is "
7468 "to be transmitted."
7469 msgstr ""
7470 "I<sockfd> 引き数は、 データを送信するソケットのファイルディスクリプタである。"
7471
7472 #. type: Plain text
7473 #: build/C/man2/sendmmsg.2:75
7474 #, no-wrap
7475 msgid ""
7476 "struct mmsghdr {\n"
7477 "    struct msghdr msg_hdr;  /* Message header */\n"
7478 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
7479 "};\n"
7480 msgstr ""
7481 "struct mmsghdr {\n"
7482 "    struct msghdr msg_hdr;  /* メッセージヘッダ */\n"
7483 "    unsigned int  msg_len;  /* 送信されたバイト数 */\n"
7484 "};\n"
7485
7486 #. type: Plain text
7487 #: build/C/man2/sendmmsg.2:91
7488 msgid ""
7489 "The I<msg_hdr> field is a I<msghdr> structure, as described in "
7490 "B<sendmsg>(2).  The I<msg_len> field is used to return the number of bytes "
7491 "sent from the message in I<msg_hdr> (i.e., the same as the return value from "
7492 "a single B<sendmsg>(2)  call)."
7493 msgstr ""
7494 "I<msg_hdr> フィールドは、 B<sendmsg>(2) で説明されている I<msghdr> 構造体であ"
7495 "る。 I<msg_len> フィールドは I<msg_hdr> から送信されたメッセージのバイト数を"
7496 "返すのに使用される。 この値は B<sendmsg>(2) をこのヘッダに対して呼び出した場"
7497 "合の返り値と同じである。"
7498
7499 #. type: Plain text
7500 #: build/C/man2/sendmmsg.2:97
7501 msgid ""
7502 "The I<flags> argument contains flags ORed together.  The flags are the same "
7503 "as for B<sendmsg>(2)."
7504 msgstr ""
7505 "I<flags> 引き数には複数のフラグを論理和 (OR) で指定できる。フラグは "
7506 "B<sendmsg>(2) と同じである。"
7507
7508 #. type: Plain text
7509 #: build/C/man2/sendmmsg.2:107
7510 msgid ""
7511 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
7512 "sent.  A nonblocking call sends as many messages as possible (up to the "
7513 "limit specified by I<vlen>)  and returns immediately."
7514 msgstr ""
7515 "停止 (blocking) モードの B<sendmmsg>() の呼び出しは、 I<vlen> 個のメッセージ"
7516 "が送信されるまで停止する。 非停止 (nonblocking) モードの呼び出しでは、 送信で"
7517 "きるだけのメッセージ (最大で I<vlen> 個) を送信し、 すぐに返る。"
7518
7519 #. type: Plain text
7520 #: build/C/man2/sendmmsg.2:119
7521 msgid ""
7522 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
7523 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
7524 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
7525 "of elements of I<msgvec> that have been updated."
7526 msgstr ""
7527 "B<sendmmsg>() が返った際には、 I<msgvec> の送信が行われた要素の I<msg_len> "
7528 "フィールドは、対応する I<msg_hdr> から送信されたバイト数が入っている。 呼び出"
7529 "しの返り値は、更新された I<msgvec> の要素数である。"
7530
7531 #. type: Plain text
7532 #: build/C/man2/sendmmsg.2:129
7533 msgid ""
7534 "On success, B<sendmmsg>()  returns the number of messages sent from "
7535 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
7536 "B<sendmmsg>()  call to send the remaining messages."
7537 msgstr ""
7538 "成功すると、 B<sendmmsg>() は I<msgvec> から送信されたメッセージ数を返す。 返"
7539 "り値が I<vlen> よりも小さい場合、 呼び出した側では再度 B<sendmmsg> を呼び出し"
7540 "て残りのメッセージを送信することができる。"
7541
7542 #. type: Plain text
7543 #: build/C/man2/sendmmsg.2:133
7544 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
7545 msgstr "エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
7546
7547 #
7548 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7549 #.      ... only return an error if no datagrams could be sent.
7550 #.      If less than the requested number of messages were sent, the application
7551 #.      must retry starting at the first failed one and if the problem is
7552 #.      persistent the error will be returned.
7553 #.      This matches the behavior of other syscalls like read/write - it
7554 #.      is not an error if less than the requested number of elements are sent.
7555 #. type: Plain text
7556 #: build/C/man2/sendmmsg.2:145
7557 msgid ""
7558 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
7559 "could be sent."
7560 msgstr ""
7561 "エラーは B<sendmsg>(2) と同じである。 エラーが返されるのは、 データグラムが全"
7562 "く送信できなかった場合のみである。"
7563
7564 #. type: Plain text
7565 #: build/C/man2/sendmmsg.2:150
7566 msgid ""
7567 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
7568 "added in version 2.14."
7569 msgstr ""
7570 "B<sendmmsg>() システムコールは Linux 3.0 で追加された。 glibc でのサポートは"
7571 "バージョン 2.14 で追加された。"
7572
7573 #. type: Plain text
7574 #: build/C/man2/sendmmsg.2:153
7575 msgid "B<sendmmsg>()  is Linux-specific."
7576 msgstr "B<sendmmsg>() は Linux 固有である。"
7577
7578 #
7579 #
7580 #.  commit 98382f419f32d2c12d021943b87dea555677144b
7581 #.      net: Cap number of elements for sendmmsg
7582 #.      To limit the amount of time we can spend in sendmmsg, cap the
7583 #.      number of elements to UIO_MAXIOV (currently 1024).
7584 #.      For error handling an application using sendmmsg needs to retry at
7585 #.      the first unsent message, so capping is simpler and requires less
7586 #.      application logic than returning EINVAL.
7587 #. type: Plain text
7588 #: build/C/man2/sendmmsg.2:168
7589 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
7590 msgstr "I<vlen> に指定できる値の最大値は B<UIO_MAXIOV> (1024) である。"
7591
7592 #. type: Plain text
7593 #: build/C/man2/sendmmsg.2:177
7594 msgid ""
7595 "The example below uses B<sendmmsg>()  to send I<onetwo> and I<three> in two "
7596 "distinct UDP datagrams using one system call.  The contents of the first "
7597 "datagram originates from a pair of buffers."
7598 msgstr ""
7599 "以下の例では、 B<sendmmsg>() を使って、 一度のシステムコールで、 I<onetwo> "
7600 "と I<three> を二つの別々の UDP データグラムで送信する。 一つ目のデータグラム"
7601 "の内容は、二つのバッファから取得される。"
7602
7603 #. type: Plain text
7604 #: build/C/man2/sendmmsg.2:186
7605 #, no-wrap
7606 msgid ""
7607 "#define _GNU_SOURCE\n"
7608 "#include E<lt>netinet/ip.hE<gt>\n"
7609 "#include E<lt>stdio.hE<gt>\n"
7610 "#include E<lt>stdlib.hE<gt>\n"
7611 "#include E<lt>string.hE<gt>\n"
7612 "#include E<lt>sys/types.hE<gt>\n"
7613 "#include E<lt>sys/socket.hE<gt>\n"
7614 msgstr ""
7615 "#define _GNU_SOURCE\n"
7616 "#include E<lt>netinet/ip.hE<gt>\n"
7617 "#include E<lt>stdio.hE<gt>\n"
7618 "#include E<lt>stdlib.hE<gt>\n"
7619 "#include E<lt>string.hE<gt>\n"
7620 "#include E<lt>sys/types.hE<gt>\n"
7621 "#include E<lt>sys/socket.hE<gt>\n"
7622
7623 #. type: Plain text
7624 #: build/C/man2/sendmmsg.2:195
7625 #, no-wrap
7626 msgid ""
7627 "int\n"
7628 "main(void)\n"
7629 "{\n"
7630 "    int sockfd;\n"
7631 "    struct sockaddr_in sa;\n"
7632 "    struct mmsghdr msg[2];\n"
7633 "    struct iovec msg1[2], msg2;\n"
7634 "    int retval;\n"
7635 msgstr ""
7636 "int\n"
7637 "main(void)\n"
7638 "{\n"
7639 "    int sockfd;\n"
7640 "    struct sockaddr_in sa;\n"
7641 "    struct mmsghdr msg[2];\n"
7642 "    struct iovec msg1[2], msg2;\n"
7643 "    int retval;\n"
7644
7645 #. type: Plain text
7646 #: build/C/man2/sendmmsg.2:209
7647 #, no-wrap
7648 msgid ""
7649 "    sa.sin_family = AF_INET;\n"
7650 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7651 "    sa.sin_port = htons(1234);\n"
7652 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7653 "        perror(\"connect()\");\n"
7654 "        exit(EXIT_FAILURE);\n"
7655 "    }\n"
7656 msgstr ""
7657 "    sa.sin_family = AF_INET;\n"
7658 "    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);\n"
7659 "    sa.sin_port = htons(1234);\n"
7660 "    if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {\n"
7661 "        perror(\"connect()\");\n"
7662 "        exit(EXIT_FAILURE);\n"
7663 "    }\n"
7664
7665 #. type: Plain text
7666 #: build/C/man2/sendmmsg.2:215
7667 #, no-wrap
7668 msgid ""
7669 "    memset(msg1, 0, sizeof(msg1));\n"
7670 "    msg1[0].iov_base = \"one\";\n"
7671 "    msg1[0].iov_len = 3;\n"
7672 "    msg1[1].iov_base = \"two\";\n"
7673 "    msg1[1].iov_len = 3;\n"
7674 msgstr ""
7675 "    memset(msg1, 0, sizeof(msg1));\n"
7676 "    msg1[0].iov_base = \"one\";\n"
7677 "    msg1[0].iov_len = 3;\n"
7678 "    msg1[1].iov_base = \"two\";\n"
7679 "    msg1[1].iov_len = 3;\n"
7680
7681 #. type: Plain text
7682 #: build/C/man2/sendmmsg.2:219
7683 #, no-wrap
7684 msgid ""
7685 "    memset(&msg2, 0, sizeof(msg2));\n"
7686 "    msg2.iov_base = \"three\";\n"
7687 "    msg2.iov_len = 5;\n"
7688 msgstr ""
7689 "    memset(&msg2, 0, sizeof(msg2));\n"
7690 "    msg2.iov_base = \"three\";\n"
7691 "    msg2.iov_len = 5;\n"
7692
7693 #. type: Plain text
7694 #: build/C/man2/sendmmsg.2:223
7695 #, no-wrap
7696 msgid ""
7697 "    memset(msg, 0, sizeof(msg));\n"
7698 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7699 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7700 msgstr ""
7701 "    memset(msg, 0, sizeof(msg));\n"
7702 "    msg[0].msg_hdr.msg_iov = msg1;\n"
7703 "    msg[0].msg_hdr.msg_iovlen = 2;\n"
7704
7705 #. type: Plain text
7706 #: build/C/man2/sendmmsg.2:226
7707 #, no-wrap
7708 msgid ""
7709 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7710 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7711 msgstr ""
7712 "    msg[1].msg_hdr.msg_iov = &msg2;\n"
7713 "    msg[1].msg_hdr.msg_iovlen = 1;\n"
7714
7715 #. type: Plain text
7716 #: build/C/man2/sendmmsg.2:232
7717 #, no-wrap
7718 msgid ""
7719 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7720 "    if (retval == -1)\n"
7721 "        perror(\"sendmmsg()\");\n"
7722 "    else\n"
7723 "        printf(\"%d messages sent\\en\", retval);\n"
7724 msgstr ""
7725 "    retval = sendmmsg(sockfd, msg, 2, 0);\n"
7726 "    if (retval == -1)\n"
7727 "        perror(\"sendmmsg()\");\n"
7728 "    else\n"
7729 "        printf(\"%d messages sent\\en\", retval);\n"
7730
7731 #. type: Plain text
7732 #: build/C/man2/sendmmsg.2:235
7733 #, no-wrap
7734 msgid ""
7735 "    exit(0);\n"
7736 "}\n"
7737 msgstr ""
7738 "    exit(0);\n"
7739 "}\n"
7740
7741 #. type: Plain text
7742 #: build/C/man2/sendmmsg.2:241
7743 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7744 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
7745
7746 #. type: TH
7747 #: build/C/man3/sockatmark.3:25
7748 #, no-wrap
7749 msgid "SOCKATMARK"
7750 msgstr "SOCKATMARK"
7751
7752 #. type: TH
7753 #: build/C/man3/sockatmark.3:25
7754 #, no-wrap
7755 msgid "2014-02-28"
7756 msgstr "2014-02-28"
7757
7758 #. type: Plain text
7759 #: build/C/man3/sockatmark.3:28
7760 msgid "sockatmark - determine whether socket is at out-of-band mark"
7761 msgstr ""
7762 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
7763 "べる"
7764
7765 #. type: Plain text
7766 #: build/C/man3/sockatmark.3:30 build/C/man2/socket.2:50
7767 #: build/C/man7/socket.7:63 build/C/man2/socketpair.2:49
7768 msgid "B<#include E<lt>sys/socket.hE<gt>>"
7769 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
7770
7771 #. type: Plain text
7772 #: build/C/man3/sockatmark.3:32
7773 msgid "B<int sockatmark(int >I<sockfd>B<);>"
7774 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
7775
7776 #. type: Plain text
7777 #: build/C/man3/sockatmark.3:41
7778 msgid ""
7779 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7780 "\\ 600"
7781 msgstr ""
7782 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
7783 "\\ 600"
7784
7785 #. type: Plain text
7786 #: build/C/man3/sockatmark.3:51
7787 msgid ""
7788 "B<sockatmark>()  returns a value indicating whether or not the socket "
7789 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
7790 "the socket is at the mark, then 1 is returned; if the socket is not at the "
7791 "mark, 0 is returned.  This function does not remove the out-of-band mark."
7792 msgstr ""
7793 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
7794 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
7795 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
7796 "この関数は帯域外マークを削除しない。"
7797
7798 #. type: Plain text
7799 #: build/C/man3/sockatmark.3:58
7800 msgid ""
7801 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
7802 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
7803 "set to indicate the error."
7804 msgstr ""
7805 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
7806 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
7807 "れ、エラーを表す I<errno> が設定される。"
7808
7809 #. type: Plain text
7810 #: build/C/man3/sockatmark.3:63
7811 msgid "I<sockfd> is not a valid file descriptor."
7812 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
7813
7814 #.  POSIX.1 says ENOTTY for this case
7815 #. type: Plain text
7816 #: build/C/man3/sockatmark.3:70
7817 msgid ""
7818 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
7819 msgstr ""
7820 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
7821
7822 #. type: Plain text
7823 #: build/C/man3/sockatmark.3:73
7824 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
7825 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
7826
7827 #. type: Plain text
7828 #: build/C/man3/sockatmark.3:78
7829 msgid "The B<sockatmark>()  function is thread-safe."
7830 msgstr "B<sockatmark>() 関数はスレッドセーフである。"
7831
7832 #. type: Plain text
7833 #: build/C/man3/sockatmark.3:80
7834 msgid "POSIX.1-2001."
7835 msgstr "POSIX.1-2001."
7836
7837 #. type: Plain text
7838 #: build/C/man3/sockatmark.3:87
7839 msgid ""
7840 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
7841 "the B<MSG_OOB> flag of B<recv>(2)."
7842 msgstr ""
7843 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
7844 "B<recv>(2)  で読み込むことができる。"
7845
7846 #. type: Plain text
7847 #: build/C/man3/sockatmark.3:89
7848 msgid "Out-of-band data is supported only on some stream socket protocols."
7849 msgstr ""
7850 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
7851 "ない。"
7852
7853 #. type: Plain text
7854 #: build/C/man3/sockatmark.3:94
7855 msgid ""
7856 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
7857 "signal."
7858 msgstr ""
7859 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
7860 "る。"
7861
7862 #. type: Plain text
7863 #: build/C/man3/sockatmark.3:100
7864 msgid ""
7865 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
7866 "operation."
7867 msgstr ""
7868 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
7869
7870 #. type: Plain text
7871 #: build/C/man3/sockatmark.3:104
7872 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
7873 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
7874
7875 #. type: Plain text
7876 #: build/C/man3/sockatmark.3:109
7877 msgid ""
7878 "The following code can be used after receipt of a B<SIGURG> signal to read "
7879 "(and discard) all data up to the mark, and then read the byte of data at the "
7880 "mark:"
7881 msgstr ""
7882 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
7883 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
7884
7885 #. type: Plain text
7886 #: build/C/man3/sockatmark.3:114
7887 #, no-wrap
7888 msgid ""
7889 "    char buf[BUF_LEN];\n"
7890 "    char oobdata;\n"
7891 "    int atmark, s;\n"
7892 msgstr ""
7893 "    char buf[BUF_LEN];\n"
7894 "    char oobdata;\n"
7895 "    int atmark, s;\n"
7896
7897 #. type: Plain text
7898 #: build/C/man3/sockatmark.3:121
7899 #, no-wrap
7900 msgid ""
7901 "    for (;;) {\n"
7902 "        atmark = sockatmark(sockfd);\n"
7903 "        if (atmark == -1) {\n"
7904 "            perror(\"sockatmark\");\n"
7905 "            break;\n"
7906 "        }\n"
7907 msgstr ""
7908 "    for (;;) {\n"
7909 "        atmark = sockatmark(sockfd);\n"
7910 "        if (atmark == -1) {\n"
7911 "            perror(\"sockatmark\");\n"
7912 "            break;\n"
7913 "        }\n"
7914
7915 #. type: Plain text
7916 #: build/C/man3/sockatmark.3:124
7917 #, no-wrap
7918 msgid ""
7919 "        if (atmark)\n"
7920 "            break;\n"
7921 msgstr ""
7922 "        if (atmark)\n"
7923 "            break;\n"
7924
7925 #. type: Plain text
7926 #: build/C/man3/sockatmark.3:131
7927 #, no-wrap
7928 msgid ""
7929 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7930 "        if (s == -1)\n"
7931 "            perror(\"read\");\n"
7932 "        if (s E<lt>= 0)\n"
7933 "            break;\n"
7934 "    }\n"
7935 msgstr ""
7936 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
7937 "        if (s == -1)\n"
7938 "            perror(\"read\");\n"
7939 "        if (s E<lt>= 0)\n"
7940 "            break;\n"
7941 "    }\n"
7942
7943 #. type: Plain text
7944 #: build/C/man3/sockatmark.3:138
7945 #, no-wrap
7946 msgid ""
7947 "    if (atmark == 1) {\n"
7948 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7949 "            perror(\"recv\");\n"
7950 "            ...\n"
7951 "        }\n"
7952 "    }\n"
7953 msgstr ""
7954 "    if (atmark == 1) {\n"
7955 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
7956 "            perror(\"recv\");\n"
7957 "            ...\n"
7958 "        }\n"
7959 "    }\n"
7960
7961 #. type: Plain text
7962 #: build/C/man3/sockatmark.3:144
7963 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7964 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
7965
7966 #. type: TH
7967 #: build/C/man2/socket.2:43 build/C/man7/socket.7:58
7968 #, no-wrap
7969 msgid "SOCKET"
7970 msgstr "SOCKET"
7971
7972 #. type: TH
7973 #: build/C/man2/socket.2:43
7974 #, no-wrap
7975 msgid "2013-12-31"
7976 msgstr "2013-12-31"
7977
7978 #. type: Plain text
7979 #: build/C/man2/socket.2:46
7980 msgid "socket - create an endpoint for communication"
7981 msgstr "socket - 通信のための端点(endpoint)を作成する"
7982
7983 #. type: Plain text
7984 #: build/C/man2/socket.2:48 build/C/man2/socketpair.2:47
7985 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
7986 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
7987
7988 #. type: Plain text
7989 #: build/C/man2/socket.2:52
7990 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7991 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
7992
7993 #. type: Plain text
7994 #: build/C/man2/socket.2:55
7995 msgid ""
7996 "B<socket>()  creates an endpoint for communication and returns a descriptor."
7997 msgstr ""
7998 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
7999 "(descriptor)を返す。"
8000
8001 #. type: Plain text
8002 #: build/C/man2/socket.2:63
8003 msgid ""
8004 "The I<domain> argument specifies a communication domain; this selects the "
8005 "protocol family which will be used for communication.  These families are "
8006 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
8007 "include:"
8008 msgstr ""
8009 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
8010 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
8011 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
8012 "下の通り。"
8013
8014 #. type: tbl table
8015 #: build/C/man2/socket.2:66
8016 #, no-wrap
8017 msgid "Name:Purpose:Man page\n"
8018 msgstr "名前:目的:マニュアル\n"
8019
8020 #. type: tbl table
8021 #: build/C/man2/socket.2:67 build/C/man2/socket.2:74 build/C/man2/socket.2:79
8022 #: build/C/man2/socket.2:84 build/C/man2/socket.2:87 build/C/man2/socket.2:94
8023 #: build/C/man2/socket.2:99 build/C/man2/socket.2:104
8024 #: build/C/man2/socket.2:107 build/C/man2/socket.2:112
8025 #, no-wrap
8026 msgid "T{\n"
8027 msgstr "T{\n"
8028
8029 #. type: tbl table
8030 #: build/C/man2/socket.2:68
8031 #, no-wrap
8032 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
8033 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
8034
8035 #. type: tbl table
8036 #: build/C/man2/socket.2:69 build/C/man2/socket.2:71 build/C/man2/socket.2:89
8037 #: build/C/man2/socket.2:91 build/C/man2/socket.2:101
8038 #: build/C/man2/socket.2:114 build/C/man2/socket.2:116
8039 #: build/C/man7/socket.7:194
8040 #, no-wrap
8041 msgid "T}:T{\n"
8042 msgstr "T}:T{\n"
8043
8044 #. type: tbl table
8045 #: build/C/man2/socket.2:70
8046 #, no-wrap
8047 msgid "Local communication\n"
8048 msgstr "ローカル通信\n"
8049
8050 #. type: tbl table
8051 #: build/C/man2/socket.2:72
8052 #, no-wrap
8053 msgid "B<unix>(7)\n"
8054 msgstr "B<unix>(7)\n"
8055
8056 #. type: tbl table
8057 #: build/C/man2/socket.2:73 build/C/man2/socket.2:78 build/C/man2/socket.2:83
8058 #: build/C/man2/socket.2:93 build/C/man2/socket.2:98 build/C/man2/socket.2:111
8059 #: build/C/man2/socket.2:118 build/C/man7/socket.7:173
8060 #: build/C/man7/socket.7:177 build/C/man7/socket.7:180
8061 #: build/C/man7/socket.7:186 build/C/man7/socket.7:189
8062 #: build/C/man7/socket.7:198 build/C/man7/socket.7:205
8063 #, no-wrap
8064 msgid "T}\n"
8065 msgstr "T}\n"
8066
8067 #. type: tbl table
8068 #: build/C/man2/socket.2:75
8069 #, no-wrap
8070 msgid "B<AF_INET>\n"
8071 msgstr "B<AF_INET>\n"
8072
8073 #. type: tbl table
8074 #: build/C/man2/socket.2:76
8075 #, no-wrap
8076 msgid "T}:IPv4 Internet protocols:T{\n"
8077 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
8078
8079 #. type: tbl table
8080 #: build/C/man2/socket.2:77
8081 #, no-wrap
8082 msgid "B<ip>(7)\n"
8083 msgstr "B<ip>(7)\n"
8084
8085 #. type: tbl table
8086 #: build/C/man2/socket.2:80
8087 #, no-wrap
8088 msgid "B<AF_INET6>\n"
8089 msgstr "B<AF_INET6>\n"
8090
8091 #. type: tbl table
8092 #: build/C/man2/socket.2:81
8093 #, no-wrap
8094 msgid "T}:IPv6 Internet protocols:T{\n"
8095 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
8096
8097 #. type: tbl table
8098 #: build/C/man2/socket.2:82
8099 #, no-wrap
8100 msgid "B<ipv6>(7)\n"
8101 msgstr "B<ipv6>(7)\n"
8102
8103 #. type: tbl table
8104 #: build/C/man2/socket.2:85
8105 #, no-wrap
8106 msgid "B<AF_IPX>\n"
8107 msgstr "B<AF_IPX>\n"
8108
8109 #. type: tbl table
8110 #: build/C/man2/socket.2:86
8111 #, no-wrap
8112 msgid "T}:IPX - Novell protocols:\n"
8113 msgstr "T}:IPX - Novell プロトコル:\n"
8114
8115 #. type: tbl table
8116 #: build/C/man2/socket.2:88
8117 #, no-wrap
8118 msgid "B<AF_NETLINK>\n"
8119 msgstr "B<AF_NETLINK>\n"
8120
8121 #. type: tbl table
8122 #: build/C/man2/socket.2:90
8123 #, no-wrap
8124 msgid "Kernel user interface device\n"
8125 msgstr "カーネル・ユーザ・デバイス\n"
8126
8127 #. type: tbl table
8128 #: build/C/man2/socket.2:92
8129 #, no-wrap
8130 msgid "B<netlink>(7)\n"
8131 msgstr "B<netlink>(7)\n"
8132
8133 #. type: tbl table
8134 #: build/C/man2/socket.2:95
8135 #, no-wrap
8136 msgid "B<AF_X25>\n"
8137 msgstr "B<AF_X25>\n"
8138
8139 #. type: tbl table
8140 #: build/C/man2/socket.2:96
8141 #, no-wrap
8142 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
8143 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
8144
8145 #. type: tbl table
8146 #: build/C/man2/socket.2:97
8147 #, no-wrap
8148 msgid "B<x25>(7)\n"
8149 msgstr "B<x25>(7)\n"
8150
8151 #. type: tbl table
8152 #: build/C/man2/socket.2:100
8153 #, no-wrap
8154 msgid "B<AF_AX25>\n"
8155 msgstr "B<AF_AX25>\n"
8156
8157 #. type: tbl table
8158 #: build/C/man2/socket.2:102
8159 #, no-wrap
8160 msgid "Amateur radio AX.25 protocol\n"
8161 msgstr "アマチュア無線 AX.25 プロトコル\n"
8162
8163 #. type: tbl table
8164 #: build/C/man2/socket.2:103
8165 #, no-wrap
8166 msgid "T}:\n"
8167 msgstr "T}:\n"
8168
8169 #. type: tbl table
8170 #: build/C/man2/socket.2:105
8171 #, no-wrap
8172 msgid "B<AF_ATMPVC>\n"
8173 msgstr "B<AF_ATMPVC>\n"
8174
8175 #. type: tbl table
8176 #: build/C/man2/socket.2:106
8177 #, no-wrap
8178 msgid "T}:Access to raw ATM PVCs:\n"
8179 msgstr "T}:生の ATM PVC にアクセスする:\n"
8180
8181 #. type: tbl table
8182 #: build/C/man2/socket.2:108
8183 #, no-wrap
8184 msgid "B<AF_APPLETALK>\n"
8185 msgstr "B<AF_APPLETALK>\n"
8186
8187 #. type: tbl table
8188 #: build/C/man2/socket.2:109
8189 #, no-wrap
8190 msgid "T}:AppleTalk:T{\n"
8191 msgstr "T}:AppleTalk:T{\n"
8192
8193 #. type: tbl table
8194 #: build/C/man2/socket.2:110
8195 #, no-wrap
8196 msgid "B<ddp>(7)\n"
8197 msgstr "B<ddp>(7)\n"
8198
8199 #. type: tbl table
8200 #: build/C/man2/socket.2:113
8201 #, no-wrap
8202 msgid "B<AF_PACKET>\n"
8203 msgstr "B<AF_PACKET>\n"
8204
8205 #. type: tbl table
8206 #: build/C/man2/socket.2:115
8207 #, no-wrap
8208 msgid "Low level packet interface\n"
8209 msgstr "低レベルのパケットインターフェース\n"
8210
8211 #. type: tbl table
8212 #: build/C/man2/socket.2:117
8213 #, no-wrap
8214 msgid "B<packet>(7)\n"
8215 msgstr "B<packet>(7)\n"
8216
8217 #. type: Plain text
8218 #: build/C/man2/socket.2:126
8219 msgid ""
8220 "The socket has the indicated I<type>, which specifies the communication "
8221 "semantics.  Currently defined types are:"
8222 msgstr ""
8223 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
8224 "る。 定義されている型は現在以下の通り。"
8225
8226 #. type: TP
8227 #: build/C/man2/socket.2:126
8228 #, no-wrap
8229 msgid "B<SOCK_STREAM>"
8230 msgstr "B<SOCK_STREAM>"
8231
8232 #. type: Plain text
8233 #: build/C/man2/socket.2:130
8234 msgid ""
8235 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
8236 "out-of-band data transmission mechanism may be supported."
8237 msgstr ""
8238 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
8239 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
8240
8241 #. type: TP
8242 #: build/C/man2/socket.2:130
8243 #, no-wrap
8244 msgid "B<SOCK_DGRAM>"
8245 msgstr "B<SOCK_DGRAM>"
8246
8247 #. type: Plain text
8248 #: build/C/man2/socket.2:134
8249 msgid ""
8250 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
8251 "length)."
8252 msgstr ""
8253 "データグラム (コネクションレス、信頼性無し、固定最大長メッセージ) をサポート"
8254 "する。"
8255
8256 #. type: TP
8257 #: build/C/man2/socket.2:134
8258 #, no-wrap
8259 msgid "B<SOCK_SEQPACKET>"
8260 msgstr "B<SOCK_SEQPACKET>"
8261
8262 #. type: Plain text
8263 #: build/C/man2/socket.2:139
8264 msgid ""
8265 "Provides a sequenced, reliable, two-way connection-based data transmission "
8266 "path for datagrams of fixed maximum length; a consumer is required to read "
8267 "an entire packet with each input system call."
8268 msgstr ""
8269 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
8270 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
8271 "ト全体を読み取ることが要求される。"
8272
8273 #. type: TP
8274 #: build/C/man2/socket.2:139
8275 #, no-wrap
8276 msgid "B<SOCK_RAW>"
8277 msgstr "B<SOCK_RAW>"
8278
8279 #. type: Plain text
8280 #: build/C/man2/socket.2:142
8281 msgid "Provides raw network protocol access."
8282 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
8283
8284 #. type: TP
8285 #: build/C/man2/socket.2:142
8286 #, no-wrap
8287 msgid "B<SOCK_RDM>"
8288 msgstr "B<SOCK_RDM>"
8289
8290 #. type: Plain text
8291 #: build/C/man2/socket.2:145
8292 msgid "Provides a reliable datagram layer that does not guarantee ordering."
8293 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
8294
8295 #. type: TP
8296 #: build/C/man2/socket.2:145
8297 #, no-wrap
8298 msgid "B<SOCK_PACKET>"
8299 msgstr "B<SOCK_PACKET>"
8300
8301 #. type: Plain text
8302 #: build/C/man2/socket.2:150
8303 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
8304 msgstr ""
8305 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
8306 "こと"
8307
8308 #. type: Plain text
8309 #: build/C/man2/socket.2:152
8310 msgid "Some socket types may not be implemented by all protocol families."
8311 msgstr ""
8312 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。"
8313
8314 #. type: Plain text
8315 #: build/C/man2/socket.2:160
8316 msgid ""
8317 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
8318 "addition to specifying a socket type, it may include the bitwise OR of any "
8319 "of the following values, to modify the behavior of B<socket>():"
8320 msgstr ""
8321 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
8322 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
8323 "ることで、 B<socket>()  の振舞いを変更することができる。"
8324
8325 #. type: Plain text
8326 #: build/C/man2/socket.2:194
8327 msgid ""
8328 "The I<protocol> specifies a particular protocol to be used with the socket.  "
8329 "Normally only a single protocol exists to support a particular socket type "
8330 "within a given protocol family, in which case I<protocol> can be specified "
8331 "as 0.  However, it is possible that many protocols may exist, in which case "
8332 "a particular protocol must be specified in this manner.  The protocol number "
8333 "to use is specific to the ``communication domain'' in which communication is "
8334 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
8335 "protocol name strings to protocol numbers."
8336 msgstr ""
8337 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
8338 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
8339 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
8340 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
8341 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
8342 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
8343 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
8344
8345 #. type: Plain text
8346 #: build/C/man2/socket.2:224
8347 msgid ""
8348 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams.  They do not "
8349 "preserve record boundaries.  A stream socket must be in a I<connected> state "
8350 "before any data may be sent or received on it.  A connection to another "
8351 "socket is created with a B<connect>(2)  call.  Once connected, data may be "
8352 "transferred using B<read>(2)  and B<write>(2)  calls or some variant of the "
8353 "B<send>(2)  and B<recv>(2)  calls.  When a session has been completed a "
8354 "B<close>(2)  may be performed.  Out-of-band data may also be transmitted as "
8355 "described in B<send>(2)  and received as described in B<recv>(2)."
8356 msgstr ""
8357 "B<SOCK_STREAM> 型のソケットは全二重バイト・ストリームである。 これらはレコー"
8358 "ド境界を保存しない。 ストリームは、ソケットがデータを送ったり受けたりする前"
8359 "に I<接続された> 状態になってなければならない。他のソケットへの接続は "
8360 "B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>(2)  "
8361 "と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用して転"
8362 "送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データの転"
8363 "送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
8364
8365 #. type: Plain text
8366 #: build/C/man2/socket.2:250
8367 msgid ""
8368 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
8369 "data is not lost or duplicated.  If a piece of data for which the peer "
8370 "protocol has buffer space cannot be successfully transmitted within a "
8371 "reasonable length of time, then the connection is considered to be dead.  "
8372 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
8373 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
8374 "signal is raised if a process sends or receives on a broken stream; this "
8375 "causes naive processes, which do not handle the signal, to exit.  "
8376 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
8377 "sockets.  The only difference is that B<read>(2)  calls will return only the "
8378 "amount of data requested, and any data remaining in the arriving packet will "
8379 "be discarded.  Also all message boundaries in incoming datagrams are "
8380 "preserved."
8381 msgstr ""
8382 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
8383 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
8384 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
8385 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
8386 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
8387 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
8388 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
8389 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
8390 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
8391 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
8392
8393 #. type: Plain text
8394 #: build/C/man2/socket.2:260
8395 msgid ""
8396 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
8397 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
8398 "received with B<recvfrom>(2), which returns the next datagram along with the "
8399 "address of its sender."
8400 msgstr ""
8401 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
8402 "へデータグラムを送ることが許されている。 データグラムは一般に "
8403 "B<recvfrom>(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと"
8404 "一緒に返す。"
8405
8406 #. type: Plain text
8407 #: build/C/man2/socket.2:267
8408 msgid ""
8409 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
8410 "from the device driver.  Use B<packet>(7)  instead."
8411 msgstr ""
8412 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
8413 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
8414
8415 #. type: Plain text
8416 #: build/C/man2/socket.2:290
8417 msgid ""
8418 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
8419 "process group to receive a B<SIGURG> signal when the out-of-band data "
8420 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
8421 "unexpectedly.  This operation may also be used to set the process or process "
8422 "group that receives the I/O and asynchronous notification of I/O events via "
8423 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
8424 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
8425 msgstr ""
8426 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
8427 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
8428 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
8429 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
8430 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
8431 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
8432 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
8433
8434 #. type: Plain text
8435 #: build/C/man2/socket.2:300
8436 msgid ""
8437 "When the network signals an error condition to the protocol module (e.g., "
8438 "using a ICMP message for IP) the pending error flag is set for the socket.  "
8439 "The next operation on this socket will return the error code of the pending "
8440 "error.  For some protocols it is possible to enable a per-socket error queue "
8441 "to retrieve detailed information about the error; see B<IP_RECVERR> in "
8442 "B<ip>(7)."
8443 msgstr ""
8444 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
8445 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
8446 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
8447 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
8448 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
8449 "B<IP_RECVERR> を参照すること。"
8450
8451 #. type: Plain text
8452 #: build/C/man2/socket.2:310
8453 msgid ""
8454 "The operation of sockets is controlled by socket level I<options>.  These "
8455 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
8456 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
8457 "respectively."
8458 msgstr ""
8459 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
8460 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
8461 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
8462
8463 #. type: Plain text
8464 #: build/C/man2/socket.2:315
8465 msgid ""
8466 "On success, a file descriptor for the new socket is returned.  On error, -1 "
8467 "is returned, and I<errno> is set appropriately."
8468 msgstr ""
8469 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
8470 "した場合は -1 を返し、 I<errno> を適切に設定する。"
8471
8472 #. type: Plain text
8473 #: build/C/man2/socket.2:320
8474 msgid ""
8475 "Permission to create a socket of the specified type and/or protocol is "
8476 "denied."
8477 msgstr ""
8478 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
8479
8480 #. type: Plain text
8481 #: build/C/man2/socket.2:323
8482 msgid "The implementation does not support the specified address family."
8483 msgstr "指定されたアドレスファミリーがサポートされていない。"
8484
8485 #. type: Plain text
8486 #: build/C/man2/socket.2:326
8487 msgid "Unknown protocol, or protocol family not available."
8488 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
8489
8490 #.  Since Linux 2.6.27
8491 #. type: Plain text
8492 #: build/C/man2/socket.2:331
8493 msgid "Invalid flags in I<type>."
8494 msgstr "I<type> に無効なフラグが指定されている。"
8495
8496 #. type: Plain text
8497 #: build/C/man2/socket.2:334
8498 msgid "Process file table overflow."
8499 msgstr "プロセスのファイルテーブルが溢れている。"
8500
8501 #. type: TP
8502 #: build/C/man2/socket.2:337
8503 #, no-wrap
8504 msgid "B<ENOBUFS> or B<ENOMEM>"
8505 msgstr "B<ENOBUFS> または B<ENOMEM>"
8506
8507 #. type: Plain text
8508 #: build/C/man2/socket.2:342
8509 msgid ""
8510 "Insufficient memory is available.  The socket cannot be created until "
8511 "sufficient resources are freed."
8512 msgstr ""
8513 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
8514 "ない。"
8515
8516 #. type: TP
8517 #: build/C/man2/socket.2:342 build/C/man2/socketpair.2:92
8518 #, no-wrap
8519 msgid "B<EPROTONOSUPPORT>"
8520 msgstr "B<EPROTONOSUPPORT>"
8521
8522 #. type: Plain text
8523 #: build/C/man2/socket.2:346
8524 msgid ""
8525 "The protocol type or the specified protocol is not supported within this "
8526 "domain."
8527 msgstr ""
8528 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
8529 "いない。"
8530
8531 #. type: Plain text
8532 #: build/C/man2/socket.2:348
8533 msgid "Other errors may be generated by the underlying protocol modules."
8534 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
8535
8536 #. type: Plain text
8537 #: build/C/man2/socket.2:350
8538 msgid "4.4BSD, POSIX.1-2001."
8539 msgstr "4.4BSD, POSIX.1-2001."
8540
8541 #. type: Plain text
8542 #: build/C/man2/socket.2:356
8543 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
8544 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
8545
8546 #. type: Plain text
8547 #: build/C/man2/socket.2:362
8548 msgid ""
8549 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
8550 "systems supporting clones of the BSD socket layer (including System\\ V "
8551 "variants)."
8552 msgstr ""
8553 "B<socket>()  は 4.2BSD で登場した。一般に、(System\\ V の変種を含めて)  BSD "
8554 "のソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD "
8555 "以外のシステムからの移植ができる。"
8556
8557 #. type: Plain text
8558 #: build/C/man2/socket.2:381
8559 msgid ""
8560 "The manifest constants used under 4.x BSD for protocol families are "
8561 "B<PF_UNIX>, B<PF_INET>, and so on, while B<AF_UNIX>, B<AF_INET>, and so on "
8562 "are used for address families.  However, already the BSD man page promises: "
8563 "\"The protocol family generally is the same as the address family\", and "
8564 "subsequent standards use AF_* everywhere."
8565 msgstr ""
8566 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには\n"
8567 "B<PF_UNIX>, B<PF_INET> 等を使用している。一方でアドレス・ファミリーには\n"
8568 "B<AF_UNIX>, B<AF_INET> 等が使用されている。\n"
8569 "しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミリーは\n"
8570 "アドレス・ファミリーと同じものである。」 と保証している。\n"
8571 "それ以外の規格では全ての場所で AF_* が使用されている。"
8572
8573 #. type: Plain text
8574 #: build/C/man2/socket.2:386
8575 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
8576 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
8577
8578 #. type: Plain text
8579 #: build/C/man2/socket.2:409
8580 msgid ""
8581 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8582 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8583 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8584 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8585 "B<udp>(7), B<unix>(7)"
8586 msgstr ""
8587 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
8588 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
8589 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
8590 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), "
8591 "B<udp>(7), B<unix>(7)"
8592
8593 #. type: Plain text
8594 #: build/C/man2/socket.2:415
8595 msgid ""
8596 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8597 "\\(lqBSD Interprocess Communication Tutorial\\(rq, reprinted in I<UNIX "
8598 "Programmer's Supplementary Documents Volume 1.>"
8599 msgstr ""
8600 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq and "
8601 "\\(lqBSD Interprocess Communication Tutorial\\(rq, (I<UNIX Programmer's "
8602 "Supplementary Documents Volume 1.> として再版された)"
8603
8604 #. type: Plain text
8605 #: build/C/man7/socket.7:61
8606 msgid "socket - Linux socket interface"
8607 msgstr "socket - Linux のソケットインターフェース"
8608
8609 #. type: Plain text
8610 #: build/C/man7/socket.7:65
8611 msgid ""
8612 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8613 ">I<protocol>B<);>"
8614 msgstr ""
8615 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
8616 ">I<protocol>B<);>"
8617
8618 #. type: Plain text
8619 #: build/C/man7/socket.7:84
8620 msgid ""
8621 "This manual page describes the Linux networking socket layer user "
8622 "interface.  The BSD compatible sockets are the uniform interface between the "
8623 "user process and the network protocol stacks in the kernel.  The protocol "
8624 "modules are grouped into I<protocol families> such as B<AF_INET>, B<AF_IPX>, "
8625 "and B<AF_PACKET>, and I<socket types> such as B<SOCK_STREAM> or "
8626 "B<SOCK_DGRAM>.  See B<socket>(2)  for more information on families and types."
8627 msgstr ""
8628 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
8629 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
8630 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
8631 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
8632 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
8633 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
8634 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
8635
8636 #. type: SS
8637 #: build/C/man7/socket.7:84
8638 #, no-wrap
8639 msgid "Socket-layer functions"
8640 msgstr "ソケット層の関数群"
8641
8642 #. type: Plain text
8643 #: build/C/man7/socket.7:88
8644 msgid ""
8645 "These functions are used by the user process to send or receive packets and "
8646 "to do other socket operations.  For more information see their respective "
8647 "manual pages."
8648 msgstr ""
8649 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
8650 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
8651
8652 #. type: Plain text
8653 #: build/C/man7/socket.7:104
8654 msgid ""
8655 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
8656 "socket address, the B<bind>(2)  function binds a socket to a local socket "
8657 "address, B<listen>(2)  tells the socket that new connections shall be "
8658 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
8659 "connection.  B<socketpair>(2)  returns two connected anonymous sockets "
8660 "(implemented only for a few local families like B<AF_UNIX>)"
8661 msgstr ""
8662 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
8663 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
8664 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
8665 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
8666 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
8667 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
8668 "リーでしか実装されていない)。"
8669
8670 #. type: Plain text
8671 #: build/C/man7/socket.7:126
8672 msgid ""
8673 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
8674 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
8675 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
8676 "data.  In addition, the standard I/O operations like B<write>(2), "
8677 "B<writev>(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to "
8678 "read and write data."
8679 msgstr ""
8680 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
8681 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
8682 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
8683 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
8684 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
8685 "ことができる。"
8686
8687 #. type: Plain text
8688 #: build/C/man7/socket.7:137
8689 msgid ""
8690 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
8691 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
8692 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
8693 "be used to set or read some other options."
8694 msgstr ""
8695 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
8696 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
8697 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
8698 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
8699
8700 #. type: Plain text
8701 #: build/C/man7/socket.7:142
8702 msgid ""
8703 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
8704 "full-duplex socket connection."
8705 msgstr ""
8706 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
8707 "続を部分的にクローズする。"
8708
8709 #. type: Plain text
8710 #: build/C/man7/socket.7:148
8711 msgid ""
8712 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
8713 "not supported on sockets."
8714 msgstr ""
8715 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
8716 "ではサポートされていない。"
8717
8718 #. type: Plain text
8719 #: build/C/man7/socket.7:165
8720 msgid ""
8721 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
8722 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
8723 "that would block will (usually)  return with B<EAGAIN> (operation should be "
8724 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
8725 "can then wait for various events via B<poll>(2)  or B<select>(2)."
8726 msgstr ""
8727 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
8728 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
8729 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
8730 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
8731 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
8732 "B<select>(2)  を使って待つことができる。"
8733
8734 #. type: tbl table
8735 #: build/C/man7/socket.7:169
8736 #, no-wrap
8737 msgid "I/O events\n"
8738 msgstr "I/O イベント\n"
8739
8740 #. type: tbl table
8741 #: build/C/man7/socket.7:170
8742 #, no-wrap
8743 msgid "Event:Poll flag:Occurrence\n"
8744 msgstr "イベント:poll フラグ:内容\n"
8745
8746 #. type: tbl table
8747 #: build/C/man7/socket.7:171 build/C/man7/socket.7:174
8748 #, no-wrap
8749 msgid "Read:POLLIN:T{\n"
8750 msgstr "Read:POLLIN:T{\n"
8751
8752 #. type: tbl table
8753 #: build/C/man7/socket.7:172
8754 #, no-wrap
8755 msgid "New data arrived.\n"
8756 msgstr "新しいデータが到着した。\n"
8757
8758 #. type: tbl table
8759 #: build/C/man7/socket.7:175
8760 #, no-wrap
8761 msgid "A connection setup has been completed\n"
8762 msgstr "(接続志向のソケットで)\n"
8763
8764 #. type: tbl table
8765 #: build/C/man7/socket.7:176
8766 #, no-wrap
8767 msgid "(for connection-oriented sockets)\n"
8768 msgstr "接続の設定が終了した。\n"
8769
8770 #. type: tbl table
8771 #: build/C/man7/socket.7:178 build/C/man7/socket.7:181
8772 #, no-wrap
8773 msgid "Read:POLLHUP:T{\n"
8774 msgstr "Read:POLLHUP:T{\n"
8775
8776 #. type: tbl table
8777 #: build/C/man7/socket.7:179
8778 #, no-wrap
8779 msgid "A disconnection request has been initiated by the other end.\n"
8780 msgstr "接続先で切断要求が生成された。\n"
8781
8782 #. type: tbl table
8783 #: build/C/man7/socket.7:182
8784 #, no-wrap
8785 msgid "A connection is broken (only for connection-oriented protocols).\n"
8786 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
8787
8788 #. type: tbl table
8789 #: build/C/man7/socket.7:183
8790 #, no-wrap
8791 msgid "When the socket is written\n"
8792 msgstr "この場合、ソケットに書き込みが行われると\n"
8793
8794 #. type: tbl table
8795 #: build/C/man7/socket.7:184
8796 #, no-wrap
8797 msgid "B<SIGPIPE>\n"
8798 msgstr "B<SIGPIPE>\n"
8799
8800 #. type: tbl table
8801 #: build/C/man7/socket.7:185
8802 #, no-wrap
8803 msgid "is also sent.\n"
8804 msgstr "も送信される。\n"
8805
8806 #. type: tbl table
8807 #: build/C/man7/socket.7:187
8808 #, no-wrap
8809 msgid "Write:POLLOUT:T{\n"
8810 msgstr "Write:POLLOUT:T{\n"
8811
8812 #. type: tbl table
8813 #: build/C/man7/socket.7:188
8814 #, no-wrap
8815 msgid "Socket has enough send buffer space for writing new data.\n"
8816 msgstr "ソケットには新しいデータを書き込むのに十分なバッファがある。\n"
8817
8818 #. type: tbl table
8819 #: build/C/man7/socket.7:190
8820 #, no-wrap
8821 msgid "Read/Write:T{\n"
8822 msgstr "Read/Write:T{\n"
8823
8824 #. type: tbl table
8825 #: build/C/man7/socket.7:191
8826 #, no-wrap
8827 msgid "POLLIN|\n"
8828 msgstr "POLLIN|\n"
8829
8830 #. type: tbl table
8831 #: build/C/man7/socket.7:192
8832 #, no-wrap
8833 msgid ".br\n"
8834 msgstr ".br\n"
8835
8836 #. type: tbl table
8837 #: build/C/man7/socket.7:193
8838 #, no-wrap
8839 msgid "POLLOUT\n"
8840 msgstr "POLLOUT\n"
8841
8842 #. type: tbl table
8843 #: build/C/man7/socket.7:195
8844 #, no-wrap
8845 msgid "An outgoing\n"
8846 msgstr "外部向けの\n"
8847
8848 #. type: tbl table
8849 #: build/C/man7/socket.7:196
8850 #, no-wrap
8851 msgid "B<connect>(2)\n"
8852 msgstr "B<connect>(2)\n"
8853
8854 #. type: tbl table
8855 #: build/C/man7/socket.7:197
8856 #, no-wrap
8857 msgid "finished.\n"
8858 msgstr "が終了した。\n"
8859
8860 #. type: tbl table
8861 #: build/C/man7/socket.7:199
8862 #, no-wrap
8863 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
8864 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
8865
8866 #. type: tbl table
8867 #: build/C/man7/socket.7:200
8868 #, no-wrap
8869 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
8870 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
8871
8872 #. type: tbl table
8873 #: build/C/man7/socket.7:201
8874 #, no-wrap
8875 msgid "Exception:POLLPRI:T{\n"
8876 msgstr "Exception:POLLPRI:T{\n"
8877
8878 #. type: tbl table
8879 #: build/C/man7/socket.7:202
8880 #, no-wrap
8881 msgid "Urgent data arrived.\n"
8882 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
8883
8884 #. type: tbl table
8885 #: build/C/man7/socket.7:203
8886 #, no-wrap
8887 msgid "B<SIGURG>\n"
8888 msgstr "B<SIGURG>\n"
8889
8890 #. type: tbl table
8891 #: build/C/man7/socket.7:204
8892 #, no-wrap
8893 msgid "is sent then.\n"
8894 msgstr "が送信される。\n"
8895
8896 #. type: Plain text
8897 #: build/C/man7/socket.7:233
8898 msgid ""
8899 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
8900 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
8901 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
8902 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
8903 "I<Signals> discussion below."
8904 msgstr ""
8905 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
8906 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
8907 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
8908 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
8909 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
8910 "と。"
8911
8912 #. type: SS
8913 #: build/C/man7/socket.7:233
8914 #, no-wrap
8915 msgid "Socket address structures"
8916 msgstr "ソケットアドレス構造体"
8917
8918 #. type: Plain text
8919 #: build/C/man7/socket.7:249
8920 msgid ""
8921 "Each socket domain has its own format for socket addresses, with a domain-"
8922 "specific address structure.  Each of these structures begins with an integer "
8923 "\"family\" field (typed as I<sa_family_t>)  that indicates the type of the "
8924 "address structure.  This allows the various system calls (e.g., "
8925 "B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8926 "B<getpeername>(2)), which are generic to all socket domains, to determine "
8927 "the domain of a particular socket address."
8928 msgstr ""
8929 "各ソケットドメインにはそれぞれ独自のソケットアドレス形式があり、ドメイン固有"
8930 "のアドレス構造体を持っている。 これらの構造体の先頭には、アドレス構造体の種類"
8931 "を示す整数の \"family\" フィールド (型は I<sa_family_t>) がある。 このフィー"
8932 "ルドにより、 すべてのソケットドメインで汎用的に使用されるシステムコール (例え"
8933 "ば、 B<connect>(2), B<bind>(2), B<accept>(2), B<getsockname>(2), "
8934 "B<getpeername>(2) など) が、特定のソケットアドレスのドメインを判定することが"
8935 "できる。"
8936
8937 #. type: Plain text
8938 #: build/C/man7/socket.7:259
8939 msgid ""
8940 "To allow any type of socket address to be passed to interfaces in the "
8941 "sockets API, the type I<struct sockaddr> is defined.  The purpose of this "
8942 "type is purely to allow casting of domain-specific socket address types to a "
8943 "\"generic\" type, so as to avoid compiler warnings about type mismatches in "
8944 "calls to the sockets API."
8945 msgstr ""
8946 "任意の種類のソケットアドレスをソケット API のインターフェースに渡せるよう"
8947 "に、 I<struct sockaddr> 型が定義されている。 この型の目的は、 純粋に、 ドメイ"
8948 "ン固有のソケットアドレスを 「汎用的な」型にキャストできるようにする点にあ"
8949 "る。 これにより、 ソケット API 呼び出しにおいて、 コンパイラが型の不一致の警"
8950 "告を出すのを避けることができる。"
8951
8952 #. type: Plain text
8953 #: build/C/man7/socket.7:269
8954 msgid ""
8955 "In addition, the sockets API provides the data type I<struct "
8956 "sockaddr_storage>.  This type is suitable to accommodate all supported "
8957 "domain-specific socket address structures; it is large enough and is aligned "
8958 "properly.  (In particular, it is large enough to hold IPv6 socket "
8959 "addresses.)  The structure includes the following field, which can be used "
8960 "to identify the type of socket address actually stored in the structure:"
8961 msgstr ""
8962 "これに加えて、ソケット API ではデータ型 I<struct sockaddr_storage> が提供され"
8963 "ている。 サポートしているすべてのドメイン固有のソケットアドレス構造体を収容す"
8964 "るのに、この型を使うことができる。 この型は十分な大きさがあり、(メモリ境界へ"
8965 "の) アラインも適切に行われている (特に、 IPv6 ソケットアドレスを収容するのに"
8966 "も十分な大きさである)。 この構造体には次のフィールドがあり、 このフィールドを"
8967 "使って、 この構造体に実際に格納されているソケットアドレスの型を特定することが"
8968 "できる。"
8969
8970 #. type: Plain text
8971 #: build/C/man7/socket.7:273
8972 #, no-wrap
8973 msgid "    sa_family_t ss_family;\n"
8974 msgstr "    sa_family_t ss_family;\n"
8975
8976 #. type: Plain text
8977 #: build/C/man7/socket.7:281
8978 msgid ""
8979 "The I<sockaddr_storage> structure is useful in programs that must handle "
8980 "socket addresses in a generic way (e.g., programs that must deal with both "
8981 "IPv4 and IPv6 socket addresses)."
8982 msgstr ""
8983 "I<sockaddr_storage> 構造体は、 ソケットアドレスを汎用的な方法で扱う必要がある"
8984 "プログラム (例えば、 IPv4 と IPv6 の両方のソケットアドレスを扱う必要があるプ"
8985 "ログラム) で有用である。"
8986
8987 #. type: SS
8988 #: build/C/man7/socket.7:281
8989 #, no-wrap
8990 msgid "Socket options"
8991 msgstr "ソケットオプション"
8992
8993 #.  FIXME .
8994 #.  In the list below, the text used to describe argument types
8995 #.  for each socket option should be more consistent
8996 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
8997 #.  W R Stevens, UNPv1
8998 #. type: Plain text
8999 #: build/C/man7/socket.7:299
9000 msgid ""
9001 "The socket options listed below can be set by using B<setsockopt>(2)  and "
9002 "read with B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for "
9003 "all sockets.  Unless otherwise noted, I<optval> is a pointer to an I<int>."
9004 msgstr ""
9005 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
9006 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
9007 "レベルには B<SOL_SOCKET> を指定すること。 注釈がない限り、 I<optval> は "
9008 "I<int> へのポインタである。"
9009
9010 #. type: TP
9011 #: build/C/man7/socket.7:299
9012 #, no-wrap
9013 msgid "B<SO_ACCEPTCONN>"
9014 msgstr "B<SO_ACCEPTCONN>"
9015
9016 #. type: Plain text
9017 #: build/C/man7/socket.7:307
9018 msgid ""
9019 "Returns a value indicating whether or not this socket has been marked to "
9020 "accept connections with B<listen>(2).  The value 0 indicates that this is "
9021 "not a listening socket, the value 1 indicates that this is a listening "
9022 "socket.  This socket option is read-only."
9023 msgstr ""
9024 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
9025 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
9026 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
9027
9028 #. type: TP
9029 #: build/C/man7/socket.7:307
9030 #, no-wrap
9031 msgid "B<SO_BINDTODEVICE>"
9032 msgstr "B<SO_BINDTODEVICE>"
9033
9034 #. type: Plain text
9035 #: build/C/man7/socket.7:326
9036 msgid ""
9037 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
9038 "the passed interface name.  If the name is an empty string or the option "
9039 "length is zero, the socket device binding is removed.  The passed option is "
9040 "a variable-length null-terminated interface name string with the maximum "
9041 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
9042 "received from that particular interface are processed by the socket.  Note "
9043 "that this works only for some socket types, particularly B<AF_INET> "
9044 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
9045 "there)."
9046 msgstr ""
9047 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
9048 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
9049 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。 渡すオプショ"
9050 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
9051 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
9052 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
9053 "る。 このオプションはいくつかのソケットタイプ、 特に B<AF_INET> に対してのみ"
9054 "動作する点に注意すること。 パケットソケットではサポートされていない (通常の "
9055 "B<bind>(2) を使うこと)。"
9056
9057 #. type: Plain text
9058 #: build/C/man7/socket.7:340
9059 msgid ""
9060 "Before Linux 3.8, this socket option could be set, but could not retrieved "
9061 "with B<getsockopt>(2).  Since Linux 3.8, it is readable.  The I<optlen> "
9062 "argument should contain the buffer size available to receive the device name "
9063 "and is recommended to be B<IFNAMSZ> bytes.  The real device name length is "
9064 "reported back in the I<optlen> argument."
9065 msgstr ""
9066 "Linux 3.8 より前のバージョンでは、このソケットオプションは B<getsockname>(2) "
9067 "で設定することはできたが、取得することができなかった。 Linux 3.8 以降では、読"
9068 "み出すことができる。 I<optlen> 引き数には、 デバイス名を格納するのに十分な"
9069 "バッファサイズを渡すべきであり、 B<IFNAMSIZ> バイトにすることを推奨する。 実"
9070 "際のデバイス名の長さは I<optlen> 引き数に格納されて返される。"
9071
9072 #. type: TP
9073 #: build/C/man7/socket.7:340
9074 #, no-wrap
9075 msgid "B<SO_BROADCAST>"
9076 msgstr "B<SO_BROADCAST>"
9077
9078 #. type: Plain text
9079 #: build/C/man7/socket.7:346
9080 msgid ""
9081 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
9082 "to send packets to a broadcast address.  This option has no effect on stream-"
9083 "oriented sockets."
9084 msgstr ""
9085 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
9086 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
9087 "ストリーム指向のソケットには何の効果もない。"
9088
9089 #. type: TP
9090 #: build/C/man7/socket.7:346
9091 #, no-wrap
9092 msgid "B<SO_BSDCOMPAT>"
9093 msgstr "B<SO_BSDCOMPAT>"
9094
9095 #. type: Plain text
9096 #: build/C/man7/socket.7:358
9097 msgid ""
9098 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
9099 "module in Linux 2.0 and 2.2.  If enabled, ICMP errors received for a UDP "
9100 "socket will not be passed to the user program.  In later kernel versions, "
9101 "support for this option has been phased out: Linux 2.4 silently ignores it, "
9102 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
9103 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
9104 "header changing, skipping of the broadcast flag) for raw sockets with this "
9105 "option, but that was removed in Linux 2.2."
9106 msgstr ""
9107 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
9108 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
9109 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
9110 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
9111 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
9112 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
9113 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
9114 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
9115 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
9116
9117 #. type: TP
9118 #: build/C/man7/socket.7:358
9119 #, no-wrap
9120 msgid "B<SO_DEBUG>"
9121 msgstr "B<SO_DEBUG>"
9122
9123 #. type: Plain text
9124 #: build/C/man7/socket.7:364
9125 msgid ""
9126 "Enable socket debugging.  Only allowed for processes with the "
9127 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
9128 msgstr ""
9129 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
9130 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
9131
9132 #. type: TP
9133 #: build/C/man7/socket.7:364
9134 #, no-wrap
9135 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
9136 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
9137
9138 #. type: Plain text
9139 #: build/C/man7/socket.7:372
9140 msgid ""
9141 "Retrieves the socket domain as an integer, returning a value such as "
9142 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
9143 "only."
9144 msgstr ""
9145 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
9146 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9147
9148 #. type: TP
9149 #: build/C/man7/socket.7:372
9150 #, no-wrap
9151 msgid "B<SO_ERROR>"
9152 msgstr "B<SO_ERROR>"
9153
9154 #. type: Plain text
9155 #: build/C/man7/socket.7:377
9156 msgid ""
9157 "Get and clear the pending socket error.  This socket option is read-only.  "
9158 "Expects an integer."
9159 msgstr ""
9160 "保留になっていたソケットエラーを取得してクリアする。\n"
9161 "このソケットオプションは読み込み専用である。整数値をとる。"
9162
9163 #. type: TP
9164 #: build/C/man7/socket.7:377
9165 #, no-wrap
9166 msgid "B<SO_DONTROUTE>"
9167 msgstr "B<SO_DONTROUTE>"
9168
9169 #. type: Plain text
9170 #: build/C/man7/socket.7:386
9171 msgid ""
9172 "Don't send via a gateway, send only to directly connected hosts.  The same "
9173 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
9174 "B<send>(2)  operation.  Expects an integer boolean flag."
9175 msgstr ""
9176 "ゲートウェイを経由せず、直接接続されているホストにのみ送信する。 B<send>(2)  "
9177 "操作で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整"
9178 "数のフラグを取る。"
9179
9180 #. type: TP
9181 #: build/C/man7/socket.7:386
9182 #, no-wrap
9183 msgid "B<SO_KEEPALIVE>"
9184 msgstr "B<SO_KEEPALIVE>"
9185
9186 #. type: Plain text
9187 #: build/C/man7/socket.7:390
9188 msgid ""
9189 "Enable sending of keep-alive messages on connection-oriented sockets.  "
9190 "Expects an integer boolean flag."
9191 msgstr ""
9192 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
9193 "の整数フラグをとる。"
9194
9195 #. type: TP
9196 #: build/C/man7/socket.7:390
9197 #, no-wrap
9198 msgid "B<SO_LINGER>"
9199 msgstr "B<SO_LINGER>"
9200
9201 #. type: Plain text
9202 #: build/C/man7/socket.7:398
9203 msgid ""
9204 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
9205 msgstr ""
9206 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
9207
9208 #. type: Plain text
9209 #: build/C/man7/socket.7:405
9210 #, no-wrap
9211 msgid ""
9212 "struct linger {\n"
9213 "    int l_onoff;    /* linger active */\n"
9214 "    int l_linger;   /* how many seconds to linger for */\n"
9215 "};\n"
9216 msgstr ""
9217 "struct linger {\n"
9218 "    int l_onoff;    /* linger active */\n"
9219 "    int l_linger;   /* how many seconds to linger for */\n"
9220 "};\n"
9221
9222 #. type: Plain text
9223 #: build/C/man7/socket.7:419
9224 msgid ""
9225 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
9226 "queued messages for the socket have been successfully sent or the linger "
9227 "timeout has been reached.  Otherwise, the call returns immediately and the "
9228 "closing is done in the background.  When the socket is closed as part of "
9229 "B<exit>(2), it always lingers in the background."
9230 msgstr ""
9231 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
9232 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
9233 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
9234 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
9235 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
9236 "送られる。"
9237
9238 #. type: TP
9239 #: build/C/man7/socket.7:419
9240 #, no-wrap
9241 msgid "B<SO_MARK> (since Linux 2.6.25)"
9242 msgstr "B<SO_MARK> (Linux 2.6.25 以降)"
9243
9244 #.  commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
9245 #.  and    914a9ab386a288d0f22252fc268ecbc048cdcbd5
9246 #. type: Plain text
9247 #: build/C/man7/socket.7:430
9248 msgid ""
9249 "Set the mark for each packet sent through this socket (similar to the "
9250 "netfilter MARK target but socket-based).  Changing the mark can be used for "
9251 "mark-based routing without netfilter or for packet filtering.  Setting this "
9252 "option requires the B<CAP_NET_ADMIN> capability."
9253 msgstr ""
9254 "このソケットから送信される各パケットにマークをセットする (netfilter の MARK "
9255 "ターゲットと似ているが、ソケット単位である点が異なる)。 マークの変更は、 "
9256 "netfilter なしでのマークに基づいてのルーティングや、 パケットフィルタリングに"
9257 "使うことができる。 このオプションを変更するには B<CAP_NET_ADMIN> ケーパビリ"
9258 "ティが必要である。"
9259
9260 #. type: TP
9261 #: build/C/man7/socket.7:430
9262 #, no-wrap
9263 msgid "B<SO_OOBINLINE>"
9264 msgstr "B<SO_OOBINLINE>"
9265
9266 #.  don't document it because it can do too much harm.
9267 #. .B SO_NO_CHECK
9268 #. type: Plain text
9269 #: build/C/man7/socket.7:439
9270 msgid ""
9271 "If this option is enabled, out-of-band data is directly placed into the "
9272 "receive data stream.  Otherwise, out-of-band data is passed only when the "
9273 "B<MSG_OOB> flag is set during receiving."
9274 msgstr ""
9275 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
9276 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
9277 "ラグがセットされている場合に限って渡される。"
9278
9279 #. type: TP
9280 #: build/C/man7/socket.7:439
9281 #, no-wrap
9282 msgid "B<SO_PASSCRED>"
9283 msgstr "B<SO_PASSCRED>"
9284
9285 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
9286 #.  in the 2.6.18 ChangeLog
9287 #. type: Plain text
9288 #: build/C/man7/socket.7:448
9289 msgid ""
9290 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
9291 "For more information see B<unix>(7)."
9292 msgstr ""
9293 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
9294 "を参照のこと。"
9295
9296 #. type: TP
9297 #: build/C/man7/socket.7:448
9298 #, no-wrap
9299 msgid "B<SO_PEEK_OFF> (since Linux 3.4)"
9300 msgstr "B<SO_PEEK_OFF> (Linux 3.4 以降)"
9301
9302 #.  commit ef64a54f6e558155b4f149bb10666b9e914b6c54
9303 #. type: Plain text
9304 #: build/C/man7/socket.7:458
9305 msgid ""
9306 "This option, which is currently supported only for B<unix>(7)  sockets, sets "
9307 "the value of the \"peek offset\" for the B<recv>(2)  system call when used "
9308 "with B<MSG_PEEK> flag."
9309 msgstr ""
9310 "B<MSG_PEEK> フラグと一緒に使用された場合 B<recv>(2) システムコールの \"peek "
9311 "offset\" にこのオプションの値が設定される。現在のところ、このオプションは "
9312 "B<unix>(7) ソケットでのみサポートされている。"
9313
9314 #. type: Plain text
9315 #: build/C/man7/socket.7:466
9316 msgid ""
9317 "When this option is set to a negative value (it is set to -1 for all new "
9318 "sockets), traditional behavior is provided: B<recv>(2)  with the B<MSG_PEEK> "
9319 "flag will peek data from the front of the queue."
9320 msgstr ""
9321 "このオプションが負の値に設定された場合、従来の動作となる。 つまり "
9322 "B<MSG_PEEK> フラグが指定された B<recv>(2) は、キューの先頭のデータに対して "
9323 "peek 処理を行う (データを読み出すが、キューからデータの削除を行わない)。 新規"
9324 "のソケットではこのオプションの値は必ず -1 に設定される。"
9325
9326 #. type: Plain text
9327 #: build/C/man7/socket.7:473
9328 msgid ""
9329 "When the option is set to a value greater than or equal to zero, then the "
9330 "next peek at data queued in the socket will occur at the byte offset "
9331 "specified by the option value.  At the same time, the \"peek offset\" will "
9332 "be incremented by the number of bytes that were peeked from the queue, so "
9333 "that a subsequent peek will return the next data in the queue."
9334 msgstr ""
9335 "このオプションに 0 以上の値が設定されると、 そのソケットのキュー上のオプショ"
9336 "ン値で指定されたバイトオフセットにあるデータが次の peek 処理で返される。 同時"
9337 "に、 \"peek offset\" がキューから peek 処理されたバイト数だけ加算される。した"
9338 "がって、次の peek 処理ではキューのその次にあるデータが返される。"
9339
9340 #. type: Plain text
9341 #: build/C/man7/socket.7:485
9342 msgid ""
9343 "If data is removed from the front of the queue via a call to B<recv>(2)  (or "
9344 "similar) without the B<MSG_PEEK> flag, the \"peek offset\" will be decreased "
9345 "by the number of bytes removed.  In other words, receiving data without the "
9346 "B<MSG_PEEK> flag will cause the \"peek offset\" to be adjusted to maintain "
9347 "the correct relative position in the queued data, so that a subsequent peek "
9348 "will retrieve the data that would have been retrieved had the data not been "
9349 "removed."
9350 msgstr ""
9351 "B<recv>(2) (や同様のシステムコール) の B<MSG_PEEK> フラグなしの呼び出しで"
9352 "キューの先頭のデータが削除された場合、 \"peek offset\" は削除されたバイト数だ"
9353 "け減算される。 言い換えると、 B<MSG_PEEK> フラグなしでデータを受信すると、 "
9354 "\"peek offset\" が指すキュー内の相対的な位置が狂わないように調整され、この後"
9355 "の peek では、 データ削除が行われなかった場合に返されたのと同じ値が返されると"
9356 "いうことである。"
9357
9358 #. type: Plain text
9359 #: build/C/man7/socket.7:490
9360 msgid ""
9361 "For datagram sockets, if the \"peek offset\" points to the middle of a "
9362 "packet, the data returned will be marked with the B<MSG_TRUNC> flag."
9363 msgstr ""
9364 "データグラムソケットでは、 \"peek offset\" がパケットの途中を指している場合に"
9365 "は、 返されるデータには B<MSG_TRUNC> フラグが付与される。"
9366
9367 #. type: Plain text
9368 #: build/C/man7/socket.7:494
9369 msgid ""
9370 "The following example serves to illustrate the use of B<SO_PEEK_OFF>.  "
9371 "Suppose a stream socket has the following queued input data:"
9372 msgstr ""
9373 "以下の例は B<SO_PEEK_OFF> の利用例を示している。ストリームソケットのキューに"
9374 "以下の入力データが入っているものとする。"
9375
9376 #. type: Plain text
9377 #: build/C/man7/socket.7:496
9378 #, no-wrap
9379 msgid "    aabbccddeeff\n"
9380 msgstr "    aabbccddeeff\n"
9381
9382 #. type: Plain text
9383 #: build/C/man7/socket.7:501
9384 msgid ""
9385 "The following sequence of B<recv>(2)  calls would have the effect noted in "
9386 "the comments:"
9387 msgstr ""
9388 "以下の順序で B<recv>(2) の呼び出しを行うと、コメントに書かれた結果となる。"
9389
9390 #. type: Plain text
9391 #: build/C/man7/socket.7:506
9392 #, no-wrap
9393 msgid ""
9394 "int ov = 4;                  // Set peek offset to 4\n"
9395 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9396 msgstr ""
9397 "int ov = 4;                  // Set peek offset to 4\n"
9398 "setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));\n"
9399
9400 #. type: Plain text
9401 #: build/C/man7/socket.7:511
9402 #, no-wrap
9403 msgid ""
9404 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9405 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9406 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9407 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9408 msgstr ""
9409 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"cc\"; offset set to 6\n"
9410 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"dd\"; offset set to 8\n"
9411 "recv(fd, buf, 2, 0);         // Reads \"aa\"; offset set to 6\n"
9412 "recv(fd, buf, 2, MSG_PEEK);  // Peeks \"ee\"; offset set to 8\n"
9413
9414 #. type: TP
9415 #: build/C/man7/socket.7:513
9416 #, no-wrap
9417 msgid "B<SO_PEERCRED>"
9418 msgstr "B<SO_PEERCRED>"
9419
9420 #. type: Plain text
9421 #: build/C/man7/socket.7:536
9422 msgid ""
9423 "Return the credentials of the foreign process connected to this socket.  "
9424 "This is possible only for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
9425 "stream and datagram socket pairs created using B<socketpair>(2); see "
9426 "B<unix>(7).  The returned credentials are those that were in effect at the "
9427 "time of the call to B<connect>(2)  or B<socketpair>(2).  The argument is a "
9428 "I<ucred> structure; define the B<_GNU_SOURCE> feature test macro to obtain "
9429 "the definition of that structure from I<E<lt>sys/socket.hE<gt>>.  This "
9430 "socket option is read-only."
9431 msgstr ""
9432 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。このソ"
9433 "ケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソケット"
9434 "間、および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケッ"
9435 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
9436 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
9437 "る。 引き数は I<ucred> 構造体である。この構造体の定義を I<E<lt>sys/socket."
9438 "hE<gt>> を得るには、 機能検査マクロ B<_GNU_SOURCE> を定義すること。 このソ"
9439 "ケットオプションは読み込み専用である。"
9440
9441 #. type: TP
9442 #: build/C/man7/socket.7:536
9443 #, no-wrap
9444 msgid "B<SO_PRIORITY>"
9445 msgstr "B<SO_PRIORITY>"
9446
9447 #. type: Plain text
9448 #: build/C/man7/socket.7:549
9449 msgid ""
9450 "Set the protocol-defined priority for all packets to be sent on this "
9451 "socket.  Linux uses this value to order the networking queues: packets with "
9452 "a higher priority may be processed first depending on the selected device "
9453 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
9454 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
9455 "6 requires the B<CAP_NET_ADMIN> capability."
9456 msgstr ""
9457 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
9458 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
9459 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
9460 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
9461 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
9462 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
9463
9464 #. type: TP
9465 #: build/C/man7/socket.7:549
9466 #, no-wrap
9467 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
9468 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
9469
9470 #. type: Plain text
9471 #: build/C/man7/socket.7:557
9472 msgid ""
9473 "Retrieves the socket protocol as an integer, returning a value such as "
9474 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
9475 "only."
9476 msgstr ""
9477 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
9478 "る。\n"
9479 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
9480
9481 #. type: TP
9482 #: build/C/man7/socket.7:557
9483 #, no-wrap
9484 msgid "B<SO_RCVBUF>"
9485 msgstr "B<SO_RCVBUF>"
9486
9487 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9488 #.  The following thread on LMKL is quite informative:
9489 #.  getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behavior
9490 #.  17 July 2012
9491 #.  http://thread.gmane.org/gmane.linux.kernel/1328935
9492 #. type: Plain text
9493 #: build/C/man7/socket.7:576
9494 msgid ""
9495 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
9496 "this value (to allow space for bookkeeping overhead)  when it is set using "
9497 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9498 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
9499 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
9500 "file.  The minimum (doubled) value for this option is 256."
9501 msgstr ""
9502 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
9503 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9504 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9505 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
9506 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
9507 "る。 このオプションの最小値は (2倍した値で) 256 である。"
9508
9509 #. type: TP
9510 #: build/C/man7/socket.7:576
9511 #, no-wrap
9512 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
9513 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
9514
9515 #. type: Plain text
9516 #: build/C/man7/socket.7:585
9517 msgid ""
9518 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9519 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
9520 "overridden."
9521 msgstr ""
9522 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9523 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
9524 "きすることができる。"
9525
9526 #. type: TP
9527 #: build/C/man7/socket.7:585
9528 #, no-wrap
9529 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
9530 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
9531
9532 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
9533 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
9534 #. type: Plain text
9535 #: build/C/man7/socket.7:614
9536 msgid ""
9537 "Specify the minimum number of bytes in the buffer until the socket layer "
9538 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
9539 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
9540 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
9541 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
9542 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
9543 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
9544 "single byte of data is available.  A subsequent read from the socket will "
9545 "block until B<SO_RCVLOWAT> bytes are available."
9546 msgstr ""
9547 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
9548 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
9549 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
9550 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
9551 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
9552 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
9553 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
9554 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
9555 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
9556 "してしまう。"
9557
9558 #. type: TP
9559 #: build/C/man7/socket.7:614
9560 #, no-wrap
9561 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
9562 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
9563
9564 #.  Not implemented in 2.0.
9565 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
9566 #.  Implemented in 2.3.41 for setsockopt, and actually used.
9567 #.  in fact to EAGAIN
9568 #. type: Plain text
9569 #: build/C/man7/socket.7:649
9570 msgid ""
9571 "Specify the receiving or sending timeouts until reporting an error.  The "
9572 "argument is a I<struct timeval>.  If an input or output function blocks for "
9573 "this period of time, and data has been sent or received, the return value of "
9574 "that function will be the amount of data transferred; if no data has been "
9575 "transferred and the timeout has been reached, then -1 is returned with "
9576 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK>, or B<EINPROGRESS> (for "
9577 "B<connect>(2))  just as if the socket was specified to be nonblocking.  If "
9578 "the timeout is set to zero (the default), then the operation will never "
9579 "timeout.  Timeouts only have effect for system calls that perform socket I/O "
9580 "(e.g., B<read>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2)); timeouts have "
9581 "no effect for B<select>(2), B<poll>(2), B<epoll_wait>(2), and so on."
9582 msgstr ""
9583 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
9584 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
9585 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
9586 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
9587 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> か B<EINPROGRESS> "
9588 "(B<connect>(2) の場合) が設定され、 あたかもソケットに非ブロッキングが指定さ"
9589 "れたように見える。 タイムアウト値に (デフォルト値である) 0 に設定すると、 操"
9590 "作は決してタイムアウトしなくなる。 タイムアウトが影響を及ぼすのは、 ソケット "
9591 "I/O を実行するシステムコールだけ (例えば B<read>(2), B<recvmsg>(2), "
9592 "B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>(2), "
9593 "B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
9594
9595 #. type: TP
9596 #: build/C/man7/socket.7:649
9597 #, no-wrap
9598 msgid "B<SO_REUSEADDR>"
9599 msgstr "B<SO_REUSEADDR>"
9600
9601 #. type: Plain text
9602 #: build/C/man7/socket.7:664
9603 msgid ""
9604 "Indicates that the rules used in validating addresses supplied in a "
9605 "B<bind>(2)  call should allow reuse of local addresses.  For B<AF_INET> "
9606 "sockets this means that a socket may bind, except when there is an active "
9607 "listening socket bound to the address.  When the listening socket is bound "
9608 "to B<INADDR_ANY> with a specific port then it is not possible to bind to "
9609 "this port for any local address.  Argument is an integer boolean flag."
9610 msgstr ""
9611 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
9612 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
9613 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
9614 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
9615 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
9616 "ドできない。 引き数はブール整数のフラグである。"
9617
9618 #. type: TP
9619 #: build/C/man7/socket.7:664
9620 #, no-wrap
9621 msgid "B<SO_RXQ_OVFL> (since Linux 2.6.33)"
9622 msgstr "B<SO_RXQ_OVFL> (Linux 2.6.33 以降)"
9623
9624 #.  commit 3b885787ea4112eaa80945999ea0901bf742707f
9625 #. type: Plain text
9626 #: build/C/man7/socket.7:671
9627 msgid ""
9628 "Indicates that an unsigned 32-bit value ancillary message (cmsg)  should be "
9629 "attached to received skbs indicating the number of packets dropped by the "
9630 "socket between the last received packet and this received packet."
9631 msgstr ""
9632 "最後の受信パケットとこの受信パケットの間にそのソケットで捨てられた (ドロップ"
9633 "された) パケット数を示す、unsigned 32 ビット値の補助メッセージ (cmsg) を受信"
9634 "した skb に付与することを指示する。"
9635
9636 #. type: TP
9637 #: build/C/man7/socket.7:671
9638 #, no-wrap
9639 msgid "B<SO_SNDBUF>"
9640 msgstr "B<SO_SNDBUF>"
9641
9642 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
9643 #.  See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
9644 #. type: Plain text
9645 #: build/C/man7/socket.7:687
9646 msgid ""
9647 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
9648 "this value (to allow space for bookkeeping overhead)  when it is set using "
9649 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
9650 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
9651 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
9652 "file.  The minimum (doubled) value for this option is 2048."
9653 msgstr ""
9654 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
9655 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
9656 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
9657 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
9658 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
9659 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
9660
9661 #. type: TP
9662 #: build/C/man7/socket.7:687
9663 #, no-wrap
9664 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
9665 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
9666
9667 #. type: Plain text
9668 #: build/C/man7/socket.7:696
9669 msgid ""
9670 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
9671 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
9672 "overridden."
9673 msgstr ""
9674 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
9675 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
9676 "きすることができる。"
9677
9678 #. type: TP
9679 #: build/C/man7/socket.7:696
9680 #, no-wrap
9681 msgid "B<SO_TIMESTAMP>"
9682 msgstr "B<SO_TIMESTAMP>"
9683
9684 #. type: Plain text
9685 #: build/C/man7/socket.7:712
9686 msgid ""
9687 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
9688 "timestamp control message is sent with level B<SOL_SOCKET> and the "
9689 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
9690 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
9691 "details on control messages."
9692 msgstr ""
9693 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
9694 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
9695 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
9696 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
9697
9698 #. type: TP
9699 #: build/C/man7/socket.7:712
9700 #, no-wrap
9701 msgid "B<SO_TYPE>"
9702 msgstr "B<SO_TYPE>"
9703
9704 #. type: Plain text
9705 #: build/C/man7/socket.7:717
9706 msgid ""
9707 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
9708 "option is read-only."
9709 msgstr ""
9710 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
9711 "このソケットオプションは読み出し専用である。"
9712
9713 #. type: TP
9714 #: build/C/man7/socket.7:717
9715 #, no-wrap
9716 msgid "B<SO_BUSY_POLL> (since Linux 3.11)"
9717 msgstr "B<SO_BUSY_POLL> (Linux 3.11 以降)"
9718
9719 #. type: Plain text
9720 #: build/C/man7/socket.7:726
9721 msgid ""
9722 "Sets the approximate time in microseconds to busy poll on a blocking receive "
9723 "when there is no data.  Increasing this value requires B<CAP_NET_ADMIN>.  "
9724 "The default for this option is controlled by the I</proc/sys/net/core/"
9725 "busy_read> file."
9726 msgstr ""
9727 "データがなかった際にブロッキング受信での busy polling のおおよその時間をマイ"
9728 "クロ秒単位で設定する。 この値を増やすには B<CAP_NET_ADMIN> ケーパビリティが必"
9729 "要である。 このオプションのデフォルト値は I</proc/sys/net/core/busy_read> で"
9730 "制御できる。"
9731
9732 #. type: Plain text
9733 #: build/C/man7/socket.7:736
9734 msgid ""
9735 "The value in the I</proc/sys/net/core/busy_poll> file determines how long "
9736 "B<select>(2)  and B<poll>(2)  will busy poll when they operate on sockets "
9737 "with B<SO_BUSY_POLL> set and no events to report are found."
9738 msgstr ""
9739 "I</proc/sys/net/core/busy_poll> の値により、 B<SO_BUSY_POLL> がセットされたソ"
9740 "ケットに対して B<select>(2) や B<poll>(2) を行い、報告すべきイベントがない場"
9741 "合に、 B<select>(2) や B<poll>(2) が busy polling をどのくらいの時間行うかが"
9742 "決まる。"
9743
9744 #. type: Plain text
9745 #: build/C/man7/socket.7:740
9746 msgid ""
9747 "In both cases, busy polling will only be done when the socket last received "
9748 "data from a network device that supports this option."
9749 msgstr ""
9750 "どちらの場合も、busy polling は、そのソケットが最後にデータを受信したネット"
9751 "ワークデバイスがこのオプションに対応している場合のみ行われる。"
9752
9753 #. type: Plain text
9754 #: build/C/man7/socket.7:744
9755 msgid ""
9756 "While busy polling may improve latency of some applications, care must be "
9757 "taken when using it since this will increase both CPU utilization and power "
9758 "usage."
9759 msgstr ""
9760 "busy polling により遅延が改善されるはアプリケーションもあるが、 busy polling "
9761 "は CPU 使用率と電力使用量をともに増加させることになるので、使用する際は注意し"
9762 "て行うこと。"
9763
9764 #. type: SS
9765 #: build/C/man7/socket.7:744
9766 #, no-wrap
9767 msgid "Signals"
9768 msgstr "シグナル"
9769
9770 #. type: Plain text
9771 #: build/C/man7/socket.7:755
9772 msgid ""
9773 "When writing onto a connection-oriented socket that has been shut down (by "
9774 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
9775 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
9776 "the B<MSG_NOSIGNAL> flag."
9777 msgstr ""
9778 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
9779 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
9780 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
9781 "していた場合はシグナルは送られない。"
9782
9783 #. type: Plain text
9784 #: build/C/man7/socket.7:780
9785 msgid ""
9786 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> "
9787 "B<ioctl>(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to "
9788 "use B<poll>(2)  or B<select>(2)  in the signal handler to find out which "
9789 "socket the event occurred on.  An alternative (in Linux 2.2) is to set a "
9790 "real-time signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real "
9791 "time signal will be called with the file descriptor in the I<si_fd> field of "
9792 "its I<siginfo_t>.  See B<fcntl>(2)  for more information."
9793 msgstr ""
9794 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
9795 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
9796 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
9797 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
9798 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
9799 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
9800 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
9801 "を参照のこと。"
9802
9803 #.  .SS Ancillary messages
9804 #. type: Plain text
9805 #: build/C/man7/socket.7:788
9806 msgid ""
9807 "Under some circumstances (e.g., multiple processes accessing a single "
9808 "socket), the condition that caused the B<SIGIO> may have already disappeared "
9809 "when the process reacts to the signal.  If this happens, the process should "
9810 "wait again because Linux will resend the signal later."
9811 msgstr ""
9812 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
9813 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
9814 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
9815 "すべきである。 Linux は同じシグナルを後で再送するからである。"
9816
9817 #. type: SS
9818 #: build/C/man7/socket.7:788
9819 #, no-wrap
9820 msgid "/proc interfaces"
9821 msgstr "/proc インタフェース"
9822
9823 #. type: Plain text
9824 #: build/C/man7/socket.7:792
9825 msgid ""
9826 "The core socket networking parameters can be accessed via files in the "
9827 "directory I</proc/sys/net/core/>."
9828 msgstr ""
9829 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
9830 "レクトリ内のファイルを通してアクセスできる。"
9831
9832 #. type: TP
9833 #: build/C/man7/socket.7:792
9834 #, no-wrap
9835 msgid "I<rmem_default>"
9836 msgstr "I<rmem_default>"
9837
9838 #. type: Plain text
9839 #: build/C/man7/socket.7:795
9840 msgid "contains the default setting in bytes of the socket receive buffer."
9841 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
9842
9843 #. type: TP
9844 #: build/C/man7/socket.7:795
9845 #, no-wrap
9846 msgid "I<rmem_max>"
9847 msgstr "I<rmem_max>"
9848
9849 #. type: Plain text
9850 #: build/C/man7/socket.7:801
9851 msgid ""
9852 "contains the maximum socket receive buffer size in bytes which a user may "
9853 "set by using the B<SO_RCVBUF> socket option."
9854 msgstr ""
9855 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
9856 "ファサイズの最大値 (バイト単位)。"
9857
9858 #. type: TP
9859 #: build/C/man7/socket.7:801
9860 #, no-wrap
9861 msgid "I<wmem_default>"
9862 msgstr "I<wmem_default>"
9863
9864 #. type: Plain text
9865 #: build/C/man7/socket.7:804
9866 msgid "contains the default setting in bytes of the socket send buffer."
9867 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
9868
9869 #. type: TP
9870 #: build/C/man7/socket.7:804
9871 #, no-wrap
9872 msgid "I<wmem_max>"
9873 msgstr "I<wmem_max>"
9874
9875 #. type: Plain text
9876 #: build/C/man7/socket.7:810
9877 msgid ""
9878 "contains the maximum socket send buffer size in bytes which a user may set "
9879 "by using the B<SO_SNDBUF> socket option."
9880 msgstr ""
9881 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
9882 "ファサイズの最大値 (バイト単位)。"
9883
9884 #. type: TP
9885 #: build/C/man7/socket.7:810
9886 #, no-wrap
9887 msgid "I<message_cost> and I<message_burst>"
9888 msgstr "I<message_cost> と I<message_burst>"
9889
9890 #. type: Plain text
9891 #: build/C/man7/socket.7:814
9892 msgid ""
9893 "configure the token bucket filter used to load limit warning messages caused "
9894 "by external network events."
9895 msgstr ""
9896 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
9897 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
9898
9899 #. type: TP
9900 #: build/C/man7/socket.7:814
9901 #, no-wrap
9902 msgid "I<netdev_max_backlog>"
9903 msgstr "I<netdev_max_backlog>"
9904
9905 #. type: Plain text
9906 #: build/C/man7/socket.7:817
9907 msgid "Maximum number of packets in the global input queue."
9908 msgstr "グローバルな入力キューにおける最大のパケット数。"
9909
9910 #. type: TP
9911 #: build/C/man7/socket.7:817
9912 #, no-wrap
9913 msgid "I<optmem_max>"
9914 msgstr "I<optmem_max>"
9915
9916 #.  netdev_fastroute is not documented because it is experimental
9917 #. type: Plain text
9918 #: build/C/man7/socket.7:822
9919 msgid ""
9920 "Maximum length of ancillary data and user control data like the iovecs per "
9921 "socket."
9922 msgstr ""
9923 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
9924 "うなもの) との和の最大長。"
9925
9926 #. type: SS
9927 #: build/C/man7/socket.7:822
9928 #, no-wrap
9929 msgid "Ioctls"
9930 msgstr "ioctl"
9931
9932 #. type: Plain text
9933 #: build/C/man7/socket.7:825
9934 msgid "These operations can be accessed using B<ioctl>(2):"
9935 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
9936
9937 #. type: Plain text
9938 #: build/C/man7/socket.7:829
9939 #, no-wrap
9940 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9941 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
9942
9943 #. type: TP
9944 #: build/C/man7/socket.7:831
9945 #, no-wrap
9946 msgid "B<SIOCGSTAMP>"
9947 msgstr "B<SIOCGSTAMP>"
9948
9949 #. type: Plain text
9950 #: build/C/man7/socket.7:855
9951 msgid ""
9952 "Return a I<struct timeval> with the receive timestamp of the last packet "
9953 "passed to the user.  This is useful for accurate round trip time "
9954 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
9955 "This ioctl should be used only if the socket option B<SO_TIMESTAMP> is not "
9956 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
9957 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
9958 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
9959 "to B<ENOENT>)."
9960 msgstr ""
9961 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
9962 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
9963 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
9964 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
9965 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
9966 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
9967 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
9968 "セットする)。"
9969
9970 #. type: TP
9971 #: build/C/man7/socket.7:855
9972 #, no-wrap
9973 msgid "B<SIOCSPGRP>"
9974 msgstr "B<SIOCSPGRP>"
9975
9976 #. type: Plain text
9977 #: build/C/man7/socket.7:874
9978 msgid ""
9979 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
9980 "when an asynchronous I/O operation has finished or urgent data is "
9981 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
9982 "positive, send the signals to that process.  If the argument is negative, "
9983 "send the signals to the process group with the ID of the absolute value of "
9984 "the argument.  The process may only choose itself or its own process group "
9985 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
9986 "UID of 0."
9987 msgstr ""
9988 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
9989 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
9990 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
9991 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
9992 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
9993 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
9994 "の場合は この限りではない。"
9995
9996 #. type: TP
9997 #: build/C/man7/socket.7:874
9998 #, no-wrap
9999 msgid "B<FIOASYNC>"
10000 msgstr "B<FIOASYNC>"
10001
10002 #. type: Plain text
10003 #: build/C/man7/socket.7:884
10004 msgid ""
10005 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
10006 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
10007 "set with B<F_SETSIG> is raised when a new I/O event occurs."
10008 msgstr ""
10009 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
10010 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
10011 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
10012
10013 #. type: Plain text
10014 #: build/C/man7/socket.7:892
10015 msgid ""
10016 "Argument is an integer boolean flag.  (This operation is synonymous with the "
10017 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
10018 msgstr ""
10019 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
10020 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
10021
10022 #. type: TP
10023 #: build/C/man7/socket.7:892
10024 #, no-wrap
10025 msgid "B<SIOCGPGRP>"
10026 msgstr "B<SIOCGPGRP>"
10027
10028 #. type: Plain text
10029 #: build/C/man7/socket.7:901
10030 msgid ""
10031 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
10032 "signals, or 0 when none is set."
10033 msgstr ""
10034 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
10035 "る。 ない場合は 0 が返る。"
10036
10037 #. type: Plain text
10038 #: build/C/man7/socket.7:905
10039 msgid "Valid B<fcntl>(2)  operations:"
10040 msgstr "有効な B<fcntl>(2)  操作:"
10041
10042 #. type: TP
10043 #: build/C/man7/socket.7:905
10044 #, no-wrap
10045 msgid "B<FIOGETOWN>"
10046 msgstr "B<FIOGETOWN>"
10047
10048 #. type: Plain text
10049 #: build/C/man7/socket.7:910
10050 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
10051 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
10052
10053 #. type: TP
10054 #: build/C/man7/socket.7:910
10055 #, no-wrap
10056 msgid "B<FIOSETOWN>"
10057 msgstr "B<FIOSETOWN>"
10058
10059 #. type: Plain text
10060 #: build/C/man7/socket.7:915
10061 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
10062 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
10063
10064 #. type: Plain text
10065 #: build/C/man7/socket.7:929
10066 msgid ""
10067 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
10068 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
10069 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
10070 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
10071 "be read or written."
10072 msgstr ""
10073 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
10074 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
10075 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
10076 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
10077 "はできなかった。"
10078
10079 #. type: Plain text
10080 #: build/C/man7/socket.7:934
10081 msgid ""
10082 "Linux assumes that half of the send/receive buffer is used for internal "
10083 "kernel structures; thus the values in the corresponding I</proc> files are "
10084 "twice what can be observed on the wire."
10085 msgstr ""
10086 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
10087 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
10088 "なる。"
10089
10090 #. type: Plain text
10091 #: build/C/man7/socket.7:947
10092 msgid ""
10093 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
10094 "option was set both in the previous program that performed a B<bind>(2)  to "
10095 "the port and in the program that wants to reuse the port.  This differs from "
10096 "some implementations (e.g., FreeBSD)  where only the later program needs to "
10097 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
10098 "since, for example, a server program is designed to always set this option."
10099 msgstr ""
10100 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
10101 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
10102 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
10103 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
10104 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
10105 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
10106 "このオプションをセットするように設計されるからである。"
10107
10108 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
10109 #.  .SH AUTHORS
10110 #.  This man page was written by Andi Kleen.
10111 #. type: Plain text
10112 #: build/C/man7/socket.7:960
10113 msgid ""
10114 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
10115 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
10116 "is via the libpcap library."
10117 msgstr ""
10118 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
10119 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
10120 "して 用いる方が良い。"
10121
10122 #. type: Plain text
10123 #: build/C/man7/socket.7:972
10124 msgid ""
10125 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10126 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10127 "B<unix>(7)"
10128 msgstr ""
10129 "B<connect>(2), B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), "
10130 "B<capabilities>(7), B<ddp>(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), "
10131 "B<unix>(7)"
10132
10133 #. type: TH
10134 #: build/C/man2/socketcall.2:25
10135 #, no-wrap
10136 msgid "SOCKETCALL"
10137 msgstr "SOCKETCALL"
10138
10139 #. type: TH
10140 #: build/C/man2/socketcall.2:25
10141 #, no-wrap
10142 msgid "2012-10-16"
10143 msgstr "2012-10-16"
10144
10145 #. type: Plain text
10146 #: build/C/man2/socketcall.2:28
10147 msgid "socketcall - socket system calls"
10148 msgstr "socketcall - ソケット・システムコール"
10149
10150 #. type: Plain text
10151 #: build/C/man2/socketcall.2:30
10152 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10153 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
10154
10155 #. type: Plain text
10156 #: build/C/man2/socketcall.2:38
10157 msgid ""
10158 "B<socketcall>()  is a common kernel entry point for the socket system "
10159 "calls.  I<call> determines which socket function to invoke.  I<args> points "
10160 "to a block containing the actual arguments, which are passed through to the "
10161 "appropriate call."
10162 msgstr ""
10163 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
10164 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
10165 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
10166 "ロックを指す。"
10167
10168 #. type: Plain text
10169 #: build/C/man2/socketcall.2:42
10170 msgid ""
10171 "User programs should call the appropriate functions by their usual names.  "
10172 "Only standard library implementors and kernel hackers need to know about "
10173 "B<socketcall>()."
10174 msgstr ""
10175 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
10176 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
10177 "必要がある。"
10178
10179 #. type: Plain text
10180 #: build/C/man2/socketcall.2:45
10181 msgid ""
10182 "This call is specific to Linux, and should not be used in programs intended "
10183 "to be portable."
10184 msgstr ""
10185 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
10186 "い。"
10187
10188 #. type: Plain text
10189 #: build/C/man2/socketcall.2:53
10190 msgid ""
10191 "On a some architectures\\(emfor example, x86-64 and ARM\\(emthere is no "
10192 "B<socketcall>()  system call; instead B<socket>(2), B<accept>(2), "
10193 "B<bind>(2), and so on really are implemented as separate system calls."
10194 msgstr ""
10195 "いくつかのアーキテクチャ\\\\(emfor 例えば x86-64 や ARM\\\\(emでは、システム"
10196 "コール B<socketcall>()  が存在しない。実際には、その代わりに B<socket>(2), "
10197 "B<accept>(2), B<bind>(2)  などが独立したシステムコールとして実装されている。"
10198
10199 #. type: Plain text
10200 #: build/C/man2/socketcall.2:71
10201 msgid ""
10202 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10203 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10204 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10205 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10206 msgstr ""
10207 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), "
10208 "B<getsockname>(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), "
10209 "B<recvfrom>(2), B<recvmsg>(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), "
10210 "B<setsockopt>(2), B<shutdown>(2), B<socket>(2), B<socketpair>(2)"
10211
10212 #. type: TH
10213 #: build/C/man2/socketpair.2:42
10214 #, no-wrap
10215 msgid "SOCKETPAIR"
10216 msgstr "SOCKETPAIR"
10217
10218 #. type: TH
10219 #: build/C/man2/socketpair.2:42
10220 #, no-wrap
10221 msgid "2008-10-11"
10222 msgstr "2008-10-11"
10223
10224 #. type: Plain text
10225 #: build/C/man2/socketpair.2:45
10226 msgid "socketpair - create a pair of connected sockets"
10227 msgstr "socketpair - 接続されたソケットのペアを作成する"
10228
10229 #. type: Plain text
10230 #: build/C/man2/socketpair.2:52
10231 msgid ""
10232 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10233 ">I<sv>B<[2]);>"
10234 msgstr ""
10235 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
10236 ">I<sv>B<[2]);>"
10237
10238 #. type: Plain text
10239 #: build/C/man2/socketpair.2:63
10240 msgid ""
10241 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
10242 "the specified I<domain>, of the specified I<type>, and using the optionally "
10243 "specified I<protocol>.  For further details of these arguments, see "
10244 "B<socket>(2)."
10245 msgstr ""
10246 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
10247 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
10248 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
10249
10250 #. type: Plain text
10251 #: build/C/man2/socketpair.2:69
10252 msgid ""
10253 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
10254 "and I<sv>[1].  The two sockets are indistinguishable."
10255 msgstr ""
10256 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
10257 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
10258
10259 #. type: Plain text
10260 #: build/C/man2/socketpair.2:78
10261 msgid "The specified address family is not supported on this machine."
10262 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
10263
10264 #. type: Plain text
10265 #: build/C/man2/socketpair.2:83
10266 msgid ""
10267 "The address I<sv> does not specify a valid part of the process address space."
10268 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
10269
10270 #. type: Plain text
10271 #: build/C/man2/socketpair.2:86
10272 msgid "Too many descriptors are in use by this process."
10273 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
10274
10275 #. type: Plain text
10276 #: build/C/man2/socketpair.2:92
10277 msgid "The specified protocol does not support creation of socket pairs."
10278 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
10279
10280 #. type: Plain text
10281 #: build/C/man2/socketpair.2:95
10282 msgid "The specified protocol is not supported on this machine."
10283 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
10284
10285 #. type: Plain text
10286 #: build/C/man2/socketpair.2:103
10287 msgid ""
10288 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
10289 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
10290 "of the BSD socket layer (including System\\ V variants)."
10291 msgstr ""
10292 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
10293 "に (System\\ V の変種を含めて)  BSD のソケット層のクローンをサポートしてい"
10294 "る、BSD 以外のシステムと、 互いに移植性がある。"
10295
10296 #. type: Plain text
10297 #: build/C/man2/socketpair.2:109
10298 msgid ""
10299 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
10300 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
10301 "restriction.)"
10302 msgstr ""
10303 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
10304 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
10305
10306 #. type: Plain text
10307 #: build/C/man2/socketpair.2:118
10308 msgid ""
10309 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
10310 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
10311 msgstr ""
10312 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
10313 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
10314
10315 #. type: Plain text
10316 #: build/C/man2/socketpair.2:131
10317 msgid ""
10318 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10319 msgstr ""
10320 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
10321
10322 #~ msgid "2014-12-31"
10323 #~ msgstr "2014-12-31"
10324
10325 #~ msgid ""
10326 #~ "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
10327 #~ msgstr ""
10328 #~ "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
10329
10330 #~ msgid ""
10331 #~ "The prototypes given above follow glibc2.  The Single UNIX Specification "
10332 #~ "agrees, except that it has return values of type I<ssize_t> (while 4.x "
10333 #~ "BSD and libc4 and libc5 all have I<int>).  The I<flags> argument is "
10334 #~ "I<int> in 4.x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> "
10335 #~ "argument is I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The "
10336 #~ "I<addrlen> argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The "
10337 #~ "present I<socklen_t\\ *> was invented by POSIX.  See also B<accept>(2)."
10338 #~ msgstr ""
10339 #~ "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification "
10340 #~ "でも同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や "
10341 #~ "libc4 や libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD "
10342 #~ "では I<int> だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き"
10343 #~ "数は 4.x BSD では I<int> だが、 libc4 と libc5 では I<size_t> である。 "
10344 #~ "I<addrlen> 引き数は 4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の "
10345 #~ "I<socklen_t\\ *> は POSIX で発案された。 B<accept>(2)  も参照すること。"
10346
10347 #~ msgid "Linux notes"
10348 #~ msgstr "Linux での注意"
10349
10350 #~ msgid ""
10351 #~ "The prototypes given above follow the Single UNIX Specification, as "
10352 #~ "glibc2 also does; the I<flags> argument was I<int> in 4.x BSD, but "
10353 #~ "I<unsigned int> in libc4 and libc5; the I<len> argument was I<int> in 4.x "
10354 #~ "BSD and libc4, but I<size_t> in libc5; the I<addrlen> argument was I<int> "
10355 #~ "in 4.x BSD and libc4 and libc5.  See also B<accept>(2)."
10356 #~ msgstr ""
10357 #~ "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同"
10358 #~ "様である。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 "
10359 #~ "では I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では "
10360 #~ "I<int> であり、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD "
10361 #~ "と libc4 と libc5 では I<int> である。 B<accept>(2)  も参照すること。"