OSDN Git Service

(split) LDP: Update POT and ja.po to LDP v3.37.
[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: 2012-03-22 04:26+0900\n"
10 "PO-Revision-Date: 2012-03-22 02:01+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:39
20 #, no-wrap
21 msgid "ACCEPT"
22 msgstr "ACCEPT"
23
24 #. type: TH
25 #: build/C/man2/accept.2:39
26 #, no-wrap
27 msgid "2010-09-10"
28 msgstr "2010-09-10"
29
30 #. type: TH
31 #: build/C/man2/accept.2:39 build/C/man2/bind.2:66 build/C/man2/connect.2:65
32 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
33 #: build/C/man2/listen.2:43 build/C/man2/recv.2:39 build/C/man2/recvmmsg.2:26
34 #: build/C/man2/select.2:38 build/C/man2/select_tut.2:30
35 #: build/C/man2/send.2:38 build/C/man2/sendmmsg.2:28
36 #: build/C/man3/sockatmark.3:23 build/C/man2/socket.2:41
37 #: build/C/man7/socket.7:26 build/C/man2/socketcall.2:26
38 #: build/C/man2/socketpair.2:40
39 #, no-wrap
40 msgid "Linux"
41 msgstr "Linux"
42
43 #. type: TH
44 #: build/C/man2/accept.2:39 build/C/man2/bind.2:66
45 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
46 #: build/C/man3/getifaddrs.3:33 build/C/man2/getsockname.2:38
47 #: build/C/man2/getsockopt.2:42 build/C/man2/listen.2:43
48 #: build/C/man2/recv.2:39 build/C/man2/recvmmsg.2:26 build/C/man2/select.2:38
49 #: build/C/man2/select_tut.2:30 build/C/man2/send.2:38
50 #: build/C/man2/sendmmsg.2:28 build/C/man3/sockatmark.3:23
51 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
52 #: build/C/man2/socketcall.2:26 build/C/man2/socketpair.2:40
53 #, no-wrap
54 msgid "Linux Programmer's Manual"
55 msgstr "Linux Programmer's Manual"
56
57 #. type: SH
58 #: build/C/man2/accept.2:40 build/C/man2/bind.2:67
59 #: build/C/man3/bindresvport.3:28 build/C/man2/connect.2:66
60 #: build/C/man3/getifaddrs.3:34 build/C/man2/getsockname.2:39
61 #: build/C/man2/getsockopt.2:43 build/C/man2/listen.2:44
62 #: build/C/man2/recv.2:40 build/C/man2/recvmmsg.2:27 build/C/man2/select.2:39
63 #: build/C/man2/select_tut.2:31 build/C/man2/send.2:39
64 #: build/C/man2/sendmmsg.2:29 build/C/man3/sockatmark.3:24
65 #: build/C/man2/socket.2:42 build/C/man7/socket.7:27
66 #: build/C/man2/socketcall.2:27 build/C/man2/socketpair.2:41
67 #, no-wrap
68 msgid "NAME"
69 msgstr "名前"
70
71 #. type: Plain text
72 #: build/C/man2/accept.2:42
73 msgid "accept - accept a connection on a socket"
74 msgstr "accept - ソケットへの接続を受ける"
75
76 #. type: SH
77 #: build/C/man2/accept.2:42 build/C/man2/bind.2:69
78 #: build/C/man3/bindresvport.3:30 build/C/man2/connect.2:68
79 #: build/C/man3/getifaddrs.3:36 build/C/man2/getsockname.2:41
80 #: build/C/man2/getsockopt.2:45 build/C/man2/listen.2:46
81 #: build/C/man2/recv.2:42 build/C/man2/recvmmsg.2:29 build/C/man2/select.2:42
82 #: build/C/man2/select_tut.2:34 build/C/man2/send.2:41
83 #: build/C/man2/sendmmsg.2:31 build/C/man3/sockatmark.3:26
84 #: build/C/man2/socket.2:44 build/C/man7/socket.7:29
85 #: build/C/man2/socketcall.2:29 build/C/man2/socketpair.2:43
86 #, no-wrap
87 msgid "SYNOPSIS"
88 msgstr "書式"
89
90 #. type: Plain text
91 #: build/C/man2/accept.2:46 build/C/man2/bind.2:73
92 #, no-wrap
93 msgid ""
94 "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
95 "B<#include E<lt>sys/socket.hE<gt>>\n"
96 msgstr ""
97 "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
98 "B<#include E<lt>sys/socket.hE<gt>>\n"
99
100 #. type: Plain text
101 #: build/C/man2/accept.2:48
102 #, no-wrap
103 msgid "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
104 msgstr "B<int accept(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
105
106 #. type: Plain text
107 #: build/C/man2/accept.2:51
108 #, no-wrap
109 msgid ""
110 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
111 "B<#include E<lt>sys/socket.hE<gt>>\n"
112 msgstr ""
113 "B<#define _GNU_SOURCE>             /* feature_test_macros(7) 参照 */\n"
114 "B<#include E<lt>sys/socket.hE<gt>>\n"
115
116 #. type: Plain text
117 #: build/C/man2/accept.2:54
118 #, no-wrap
119 msgid ""
120 "B<int accept4(int >I<sockfd>B<, struct sockaddr *>I<addr>B<,>\n"
121 "B<            socklen_t *>I<addrlen>B<, int >I<flags>B<);>\n"
122 msgstr ""
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
126 #. type: SH
127 #: build/C/man2/accept.2:55 build/C/man2/bind.2:77
128 #: build/C/man3/bindresvport.3:37 build/C/man2/connect.2:77
129 #: build/C/man3/getifaddrs.3:45 build/C/man2/getsockname.2:48
130 #: build/C/man2/getsockopt.2:56 build/C/man2/listen.2:54
131 #: build/C/man2/recv.2:57 build/C/man2/recvmmsg.2:39 build/C/man2/select.2:81
132 #: build/C/man2/select_tut.2:73 build/C/man2/send.2:56
133 #: build/C/man2/sendmmsg.2:40 build/C/man3/sockatmark.3:40
134 #: build/C/man2/socket.2:50 build/C/man7/socket.7:33
135 #: build/C/man2/socketcall.2:31 build/C/man2/socketpair.2:50
136 #, no-wrap
137 msgid "DESCRIPTION"
138 msgstr "説明"
139
140 #. type: Plain text
141 #: build/C/man2/accept.2:70
142 msgid ""
143 "The B<accept>()  system call is used with connection-based socket types "
144 "(B<SOCK_STREAM>, B<SOCK_SEQPACKET>).  It extracts the first connection "
145 "request on the queue of pending connections for the listening socket, "
146 "I<sockfd>, creates a new connected socket, and returns a new file descriptor "
147 "referring to that socket.  The newly created socket is not in the listening "
148 "state.  The original socket I<sockfd> is unaffected by this call."
149 msgstr ""
150 "B<accept>()  システムコールは、接続指向のソケット型 (B<SOCK_STREAM>, "
151 "B<SOCK_SEQPACKET>)  で用いられる。 この関数は、接続待ちソケット I<socket> 宛"
152 "ての保留状態の接続要求が入っているキューから 先頭の接続要求を取り出し、接続済"
153 "みソケットを新規に生成し、 そのソケットを参照する新しいファイル・ディスクリプ"
154 "タを返す。 新規に生成されたソケットは、接続待ち (listen) 状態ではない。 もと"
155 "もとのソケット I<sockfd> はこの呼び出しによって影響を受けない。"
156
157 #. type: Plain text
158 #: build/C/man2/accept.2:79
159 msgid ""
160 "The argument I<sockfd> is a socket that has been created with B<socket>(2), "
161 "bound to a local address with B<bind>(2), and is listening for connections "
162 "after a B<listen>(2)."
163 msgstr ""
164 "引き数 I<sockfd> は、 B<socket>(2)  によって生成され、 B<bind>(2)  によって"
165 "ローカルアドレスにバインドされ、 B<listen>(2)  を経て接続を待っているソケット"
166 "である。"
167
168 #. type: Plain text
169 #: build/C/man2/accept.2:97
170 msgid ""
171 "The argument I<addr> is a pointer to a I<sockaddr> structure.  This "
172 "structure is filled in with the address of the peer socket, as known to the "
173 "communications layer.  The exact format of the address returned I<addr> is "
174 "determined by the socket's address family (see B<socket>(2)  and the "
175 "respective protocol man pages).  When I<addr> is NULL, nothing is filled in; "
176 "in this case, I<addrlen> is not used, and should also be NULL."
177 msgstr ""
178 "I<addr> 引き数は I<sockaddr> 構造体へのポインタである。 この構造体には接続相"
179 "手のソケットのアドレスが入っている。 I<addr> 引き数で返されるアドレスの正確な"
180 "フォーマットは、 ソケットのアドレス種別によって変わる (B<socket>(2)  およびそ"
181 "れぞれのプロトコルの man ページを参照)。 I<addr> が NULL の場合、 I<addr> に"
182 "は何も入らない。この場合、 I<addrlen> は使用されず、この引き数は NULL にして"
183 "おくべきである。"
184
185 #. type: Plain text
186 #: build/C/man2/accept.2:105
187 msgid ""
188 "The I<addrlen> argument is a value-result argument: the caller must "
189 "initialize it to contain the size (in bytes) of the structure pointed to by "
190 "I<addr>; on return it will contain the actual size of the peer address."
191 msgstr ""
192 "I<addrlen> 引き数は入出力両用の引き数である。呼び出し時には、呼び出し元が "
193 "I<addr> が指す構造体のサイズ (バイト単位) で初期化しておかなければならない。 "
194 "返ってくる時には、接続相手のアドレスの実際の大きさが格納される。"
195
196 #. type: Plain text
197 #: build/C/man2/accept.2:110 build/C/man2/getsockname.2:65
198 msgid ""
199 "The returned address is truncated if the buffer provided is too small; in "
200 "this case, I<addrlen> will return a value greater than was supplied to the "
201 "call."
202 msgstr ""
203 "渡されたバッファが小さ過ぎた場合は、返されるアドレスの末尾が切り詰められ"
204 "る。\n"
205 "この場合には、 I<addrlen> には、呼び出し時に指定された値よりも大きな値が格納"
206 "される。"
207
208 #. type: Plain text
209 #: build/C/man2/accept.2:123
210 msgid ""
211 "If no pending connections are present on the queue, and the socket is not "
212 "marked as nonblocking, B<accept>()  blocks the caller until a connection is "
213 "present.  If the socket is marked nonblocking and no pending connections are "
214 "present on the queue, B<accept>()  fails with the error B<EAGAIN> or "
215 "B<EWOULDBLOCK>."
216 msgstr ""
217 "キューに保留となっている接続要求がなく、 かつソケットが非停止になっていないと"
218 "きは、 B<accept>()  は接続が発生するまで呼び出し元を停止 (block) する。 ソ"
219 "ケットが非停止になっていて、 待ち状態の接続要求がキューに無いときは、 "
220 "B<accept>()  はエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。"
221
222 #. type: Plain text
223 #: build/C/man2/accept.2:137
224 msgid ""
225 "In order to be notified of incoming connections on a socket, you can use "
226 "B<select>(2)  or B<poll>(2).  A readable event will be delivered when a new "
227 "connection is attempted and you may then call B<accept>()  to get a socket "
228 "for that connection.  Alternatively, you can set the socket to deliver "
229 "B<SIGIO> when activity occurs on a socket; see B<socket>(7)  for details."
230 msgstr ""
231 "ソケットへの接続到着を知るには、 B<select>(2)  または B<poll>(2)  を用いれば"
232 "よい。 新しい接続要求が来るとソケットは読み込み可能になるので、 そうしたら "
233 "B<accept>()  を呼んでその接続に対するソケットを取得すればよい。 あるいはソ"
234 "ケットに設定を行い、何らかのアクションがあったときに B<SIGIO> を配送 "
235 "(deliver) させるようにすることもできる。詳細は B<socket>(7)  を参照のこと。"
236
237 #. type: Plain text
238 #: build/C/man2/accept.2:150
239 msgid ""
240 "For certain protocols which require an explicit confirmation, such as "
241 "DECNet, B<accept>()  can be thought of as merely dequeuing the next "
242 "connection request and not implying confirmation.  Confirmation can be "
243 "implied by a normal read or write on the new file descriptor, and rejection "
244 "can be implied by closing the new socket.  Currently only DECNet has these "
245 "semantics on Linux."
246 msgstr ""
247 "明示的な接続確認 (confirmation) を必要とするようなプロトコル (DECNet など) で"
248 "は、 B<accept>()  は単に次の接続要求をキューから取り出すだけであり、 接続確認"
249 "は行わないことに注意せよ。接続確認は、 新しいファイル・ディスクリプタに対す"
250 "る 通常の読み取り/書き込みによってなされ、接続拒否 (rejection)  は新しいソ"
251 "ケットをクローズすることによってなされる。 現在のところ、 Linux 上でこれらの"
252 "セマンティクスを持つのは DECNet だけである。"
253
254 #. type: Plain text
255 #: build/C/man2/accept.2:160
256 msgid ""
257 "If I<flags> is 0, then B<accept4>()  is the same as B<accept>().  The "
258 "following values can be bitwise ORed in I<flags> to obtain different "
259 "behavior:"
260 msgstr ""
261 "I<flags> が 0 の場合、 B<accept4>()  は B<accept>()  と同じである。 I<flags> "
262 "に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることが"
263 "できる。"
264
265 #. type: TP
266 #: build/C/man2/accept.2:160 build/C/man2/socket.2:162
267 #, no-wrap
268 msgid "B<SOCK_NONBLOCK>"
269 msgstr "B<SOCK_NONBLOCK>"
270
271 #. type: Plain text
272 #: build/C/man2/accept.2:168 build/C/man2/socket.2:170
273 msgid ""
274 "Set the B<O_NONBLOCK> file status flag on the new open file description.  "
275 "Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
276 msgstr ""
277 "新しく生成されるオープンファイル記述 (open file description) の "
278 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
279 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなく"
280 "なる。"
281
282 #. type: TP
283 #: build/C/man2/accept.2:168 build/C/man2/socket.2:170
284 #, no-wrap
285 msgid "B<SOCK_CLOEXEC>"
286 msgstr "B<SOCK_CLOEXEC>"
287
288 #. type: Plain text
289 #: build/C/man2/accept.2:178 build/C/man2/socket.2:180
290 msgid ""
291 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See "
292 "the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this "
293 "may be useful."
294 msgstr ""
295 "新しいファイルディスクリプタに対して close-on-exec (B<FD_CLOEXEC>)  フラグを"
296 "セットする。 このフラグが役に立つ理由については、 B<open>(2)  の "
297 "B<O_CLOEXEC> フラグの説明を参照のこと。"
298
299 #. type: SH
300 #: build/C/man2/accept.2:178 build/C/man2/bind.2:150
301 #: build/C/man3/bindresvport.3:64 build/C/man2/connect.2:125
302 #: build/C/man2/getsockname.2:65 build/C/man2/getsockopt.2:129
303 #: build/C/man2/listen.2:80 build/C/man2/recv.2:386
304 #: build/C/man2/recvmmsg.2:141 build/C/man2/select.2:285
305 #: build/C/man2/select_tut.2:483 build/C/man2/send.2:273
306 #: build/C/man2/sendmmsg.2:119 build/C/man3/sockatmark.3:49
307 #: build/C/man2/socket.2:312 build/C/man2/socketpair.2:67
308 #, no-wrap
309 msgid "RETURN VALUE"
310 msgstr "返り値"
311
312 #. type: Plain text
313 #: build/C/man2/accept.2:185
314 msgid ""
315 "On success, these system calls return a nonnegative integer that is a "
316 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
317 "is set appropriately."
318 msgstr ""
319 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
320 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
321 "定する。"
322
323 #. type: SS
324 #: build/C/man2/accept.2:185
325 #, no-wrap
326 msgid "Error Handling"
327 msgstr "エラー処理"
328
329 #. type: Plain text
330 #: build/C/man2/accept.2:212
331 msgid ""
332 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
333 "on the new socket as an error code from B<accept>().  This behavior differs "
334 "from other BSD socket implementations.  For reliable operation the "
335 "application should detect the network errors defined for the protocol after "
336 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In case of TCP/IP "
337 "these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, "
338 "B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
339 msgstr ""
340 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
341 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
342 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
343 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
344 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
345 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
346 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
347 "B<ENETUNREACH>"
348
349 #. type: SH
350 #: build/C/man2/accept.2:212 build/C/man2/bind.2:155
351 #: build/C/man3/bindresvport.3:69 build/C/man2/connect.2:130
352 #: build/C/man3/getifaddrs.3:144 build/C/man2/getsockname.2:70
353 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
354 #: build/C/man2/recv.2:391 build/C/man2/recvmmsg.2:149
355 #: build/C/man2/select.2:302 build/C/man2/send.2:278
356 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:54
357 #: build/C/man2/socket.2:317 build/C/man2/socketpair.2:72
358 #, no-wrap
359 msgid "ERRORS"
360 msgstr "エラー"
361
362 #. type: TP
363 #: build/C/man2/accept.2:213 build/C/man2/recv.2:396 build/C/man2/send.2:291
364 #, no-wrap
365 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
366 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
367
368 #.  Actually EAGAIN on Linux
369 #. type: Plain text
370 #: build/C/man2/accept.2:221
371 msgid ""
372 "The socket is marked nonblocking and no connections are present to be "
373 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
374 "and does not require these constants to have the same value, so a portable "
375 "application should check for both possibilities."
376 msgstr ""
377 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
378 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
379 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
380 "ションでは、両方の可能性を 確認すべきである。"
381
382 #. type: TP
383 #: build/C/man2/accept.2:221 build/C/man2/bind.2:163
384 #: build/C/man2/connect.2:167 build/C/man2/getsockname.2:71
385 #: build/C/man2/getsockopt.2:135 build/C/man2/listen.2:89
386 #: build/C/man2/recv.2:405 build/C/man2/select.2:303 build/C/man2/send.2:299
387 #: build/C/man3/sockatmark.3:55
388 #, no-wrap
389 msgid "B<EBADF>"
390 msgstr "B<EBADF>"
391
392 #. type: Plain text
393 #: build/C/man2/accept.2:224
394 msgid "The descriptor is invalid."
395 msgstr "ディスクリプタが不正。"
396
397 #. type: TP
398 #: build/C/man2/accept.2:224
399 #, no-wrap
400 msgid "B<ECONNABORTED>"
401 msgstr "B<ECONNABORTED>"
402
403 #. type: Plain text
404 #: build/C/man2/accept.2:227
405 msgid "A connection has been aborted."
406 msgstr "接続が中止された。"
407
408 #. type: TP
409 #: build/C/man2/accept.2:227 build/C/man2/bind.2:189
410 #: build/C/man2/connect.2:173 build/C/man2/getsockname.2:76
411 #: build/C/man2/getsockopt.2:140 build/C/man2/recv.2:414
412 #: build/C/man2/send.2:308 build/C/man2/socketpair.2:76
413 #, no-wrap
414 msgid "B<EFAULT>"
415 msgstr "B<EFAULT>"
416
417 #. type: Plain text
418 #: build/C/man2/accept.2:232
419 msgid ""
420 "The I<addr> argument is not in a writable part of the user address space."
421 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
422
423 #. type: TP
424 #: build/C/man2/accept.2:232 build/C/man2/connect.2:201
425 #: build/C/man2/recv.2:418 build/C/man2/select.2:308 build/C/man2/send.2:311
426 #, no-wrap
427 msgid "B<EINTR>"
428 msgstr "B<EINTR>"
429
430 #. type: Plain text
431 #: build/C/man2/accept.2:237
432 msgid ""
433 "The system call was interrupted by a signal that was caught before a valid "
434 "connection arrived; see B<signal>(7)."
435 msgstr ""
436 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
437 "た。 B<signal>(7)  参照。"
438
439 #. type: TP
440 #: build/C/man2/accept.2:237 build/C/man2/accept.2:242 build/C/man2/bind.2:167
441 #: build/C/man2/bind.2:193 build/C/man2/getsockname.2:82
442 #: build/C/man2/getsockopt.2:150 build/C/man2/recv.2:423
443 #: build/C/man2/recvmmsg.2:153 build/C/man2/select.2:312
444 #: build/C/man2/send.2:315 build/C/man3/sockatmark.3:59
445 #: build/C/man2/socket.2:325 build/C/man2/socket.2:328
446 #, no-wrap
447 msgid "B<EINVAL>"
448 msgstr "B<EINVAL>"
449
450 #. type: Plain text
451 #: build/C/man2/accept.2:242
452 msgid ""
453 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
454 "negative)."
455 msgstr ""
456 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
457 "負の場合など)。"
458
459 #. type: Plain text
460 #: build/C/man2/accept.2:247
461 msgid "(B<accept4>())  invalid value in I<flags>."
462 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
463
464 #. type: TP
465 #: build/C/man2/accept.2:247 build/C/man2/socket.2:333
466 #: build/C/man2/socketpair.2:81
467 #, no-wrap
468 msgid "B<EMFILE>"
469 msgstr "B<EMFILE>"
470
471 #. type: Plain text
472 #: build/C/man2/accept.2:250
473 msgid "The per-process limit of open file descriptors has been reached."
474 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
475
476 #. type: TP
477 #: build/C/man2/accept.2:250 build/C/man2/socket.2:336
478 #: build/C/man2/socketpair.2:84
479 #, no-wrap
480 msgid "B<ENFILE>"
481 msgstr "B<ENFILE>"
482
483 #. type: Plain text
484 #: build/C/man2/accept.2:253 build/C/man2/socket.2:339
485 #: build/C/man2/socketpair.2:87
486 msgid "The system limit on the total number of open files has been reached."
487 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
488
489 #. type: TP
490 #: build/C/man2/accept.2:253
491 #, no-wrap
492 msgid "B<ENOBUFS>, B<ENOMEM>"
493 msgstr "B<ENOBUFS>, B<ENOMEM>"
494
495 #. type: Plain text
496 #: build/C/man2/accept.2:258
497 msgid ""
498 "Not enough free memory.  This often means that the memory allocation is "
499 "limited by the socket buffer limits, not by the system memory."
500 msgstr ""
501 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
502 "ケットバッファの大きさによるメモリ割り当ての制限である。"
503
504 #. type: TP
505 #: build/C/man2/accept.2:258 build/C/man2/bind.2:172
506 #: build/C/man2/connect.2:213 build/C/man2/getsockname.2:90
507 #: build/C/man2/getsockopt.2:164 build/C/man2/listen.2:94
508 #: build/C/man2/recv.2:438 build/C/man2/send.2:344
509 #, no-wrap
510 msgid "B<ENOTSOCK>"
511 msgstr "B<ENOTSOCK>"
512
513 #. type: Plain text
514 #: build/C/man2/accept.2:261
515 msgid "The descriptor references a file, not a socket."
516 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
517
518 #. type: TP
519 #: build/C/man2/accept.2:261 build/C/man2/listen.2:99 build/C/man2/send.2:349
520 #: build/C/man2/socketpair.2:87
521 #, no-wrap
522 msgid "B<EOPNOTSUPP>"
523 msgstr "B<EOPNOTSUPP>"
524
525 #. type: Plain text
526 #: build/C/man2/accept.2:265
527 msgid "The referenced socket is not of type B<SOCK_STREAM>."
528 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
529
530 #. type: TP
531 #: build/C/man2/accept.2:265
532 #, no-wrap
533 msgid "B<EPROTO>"
534 msgstr "B<EPROTO>"
535
536 #. type: Plain text
537 #: build/C/man2/accept.2:268
538 msgid "Protocol error."
539 msgstr "プロトコル・エラー。"
540
541 #. type: Plain text
542 #: build/C/man2/accept.2:272
543 msgid "In addition, Linux B<accept>()  may fail if:"
544 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
545
546 #. type: TP
547 #: build/C/man2/accept.2:272
548 #, no-wrap
549 msgid "B<EPERM>"
550 msgstr "B<EPERM>"
551
552 #. type: Plain text
553 #: build/C/man2/accept.2:275
554 msgid "Firewall rules forbid connection."
555 msgstr "ファイアウォールのルールにより接続が禁止された。"
556
557 #. type: Plain text
558 #: build/C/man2/accept.2:287
559 msgid ""
560 "In addition, network errors for the new socket and as defined for the "
561 "protocol may be returned.  Various Linux kernels can return other errors "
562 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
563 "value B<ERESTARTSYS> may be seen during a trace."
564 msgstr ""
565 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
566 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
567 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
568 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
569 "ともある。"
570
571 #. type: SH
572 #: build/C/man2/accept.2:287 build/C/man3/getifaddrs.3:157
573 #: build/C/man2/recvmmsg.2:157 build/C/man2/select.2:321
574 #: build/C/man2/sendmmsg.2:145 build/C/man3/sockatmark.3:66
575 #: build/C/man7/socket.7:697
576 #, no-wrap
577 msgid "VERSIONS"
578 msgstr "バージョン"
579
580 #. type: Plain text
581 #: build/C/man2/accept.2:292
582 msgid ""
583 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
584 "support in glibc is available starting with version 2.10."
585 msgstr ""
586 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
587 "サポートはバージョン 2.10 以降で利用可能である。"
588
589 #. type: SH
590 #: build/C/man2/accept.2:292 build/C/man2/bind.2:220
591 #: build/C/man3/bindresvport.3:89 build/C/man2/connect.2:223
592 #: build/C/man3/getifaddrs.3:165 build/C/man2/getsockname.2:95
593 #: build/C/man2/getsockopt.2:169 build/C/man2/listen.2:104
594 #: build/C/man2/recv.2:443 build/C/man2/recvmmsg.2:162
595 #: build/C/man2/select.2:327 build/C/man2/send.2:363
596 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:69
597 #: build/C/man2/socket.2:350 build/C/man2/socketcall.2:43
598 #: build/C/man2/socketpair.2:93
599 #, no-wrap
600 msgid "CONFORMING TO"
601 msgstr "準拠"
602
603 #.  The BSD man page documents five possible error returns
604 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
605 #.  POSIX.1-2001 documents errors
606 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
607 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
608 #.  In addition, SUSv2 documents EFAULT and ENOSR.
609 #. type: Plain text
610 #: build/C/man2/accept.2:304
611 msgid ""
612 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
613 "4.2BSD)."
614 msgstr ""
615 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
616 "された)."
617
618 #. type: Plain text
619 #: build/C/man2/accept.2:307
620 msgid "B<accept4>()  is a nonstandard Linux extension."
621 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
622
623 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
624 #.  do not inherit file status flags -- MTK Jun 05
625 #. type: Plain text
626 #: build/C/man2/accept.2:322
627 msgid ""
628 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
629 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
630 "socket.  This behavior differs from the canonical BSD sockets "
631 "implementation.  Portable programs should not rely on inheritance or "
632 "noninheritance of file status flags and always explicitly set all required "
633 "flags on the socket returned from B<accept>()."
634 msgstr ""
635 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
636 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
637 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
638 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
639 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
640 "である。"
641
642 #. type: SH
643 #: build/C/man2/accept.2:322 build/C/man2/bind.2:232
644 #: build/C/man3/bindresvport.3:92 build/C/man2/connect.2:239
645 #: build/C/man3/getifaddrs.3:185 build/C/man2/getsockname.2:101
646 #: build/C/man2/getsockopt.2:176 build/C/man2/listen.2:109
647 #: build/C/man2/recv.2:453 build/C/man2/select.2:342
648 #: build/C/man2/select_tut.2:501 build/C/man2/send.2:377
649 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:71
650 #: build/C/man2/socket.2:364 build/C/man7/socket.7:711
651 #: build/C/man2/socketcall.2:46 build/C/man2/socketpair.2:101
652 #, no-wrap
653 msgid "NOTES"
654 msgstr "注意"
655
656 #. type: Plain text
657 #: build/C/man2/accept.2:328 build/C/man2/bind.2:238
658 #: build/C/man2/connect.2:245 build/C/man2/getsockopt.2:182
659 #: build/C/man2/listen.2:135 build/C/man2/socket.2:370
660 #: build/C/man2/socketpair.2:122
661 msgid ""
662 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
663 "this header file is not required on Linux.  However, some historical (BSD) "
664 "implementations required this header file, and portable applications are "
665 "probably wise to include it."
666 msgstr ""
667 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
668 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
669 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
670 "ションではこのファイルを インクルードするのが賢明であろう。"
671
672 #. type: Plain text
673 #: build/C/man2/accept.2:349
674 msgid ""
675 "There may not always be a connection waiting after a B<SIGIO> is delivered "
676 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
677 "connection might have been removed by an asynchronous network error or "
678 "another thread before B<accept>()  is called.  If this happens then the call "
679 "will block waiting for the next connection to arrive.  To ensure that "
680 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
681 "B<O_NONBLOCK> flag set (see B<socket>(7))."
682 msgstr ""
683 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
684 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
685 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
686 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
687 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
688 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
689 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
690 "見よ)。"
691
692 #. type: SS
693 #: build/C/man2/accept.2:349
694 #, no-wrap
695 msgid "The socklen_t type"
696 msgstr "socklen_t 型"
697
698 #. type: Plain text
699 #: build/C/man2/accept.2:359
700 msgid ""
701 "The third argument of B<accept>()  was originally declared as an I<int *> "
702 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
703 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
704 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
705 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
706 "Torvalds:"
707 msgstr ""
708 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
709 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
710 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
711 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
712 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
713 "た。 Linus Torvald の発言を引用する:"
714
715 #.  .I fails: only italicizes a single line
716 #. type: Plain text
717 #: build/C/man2/accept.2:376
718 msgid ""
719 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
720 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
721 "make it a size_t, and I (and hopefully others, but obviously not too many) "
722 "complained to them very loudly indeed.  Making it a size_t is completely "
723 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
724 "bit architectures, for example.  And it I<has> to be the same size as \"int"
725 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
726 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
727 "have touched it in the first place, but once they did they felt it had to "
728 "have a named type for some unfathomable reason (probably somebody didn't "
729 "like losing face over having done the original stupid thing, so they "
730 "silently just renamed their blunder).\""
731 msgstr ""
732 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
733 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
734 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
735 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
736 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
737 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
738 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
739 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
740 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
741 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
742 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
743 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
744 "う)。」"
745
746 #. type: SH
747 #: build/C/man2/accept.2:376 build/C/man2/bind.2:252
748 #: build/C/man2/connect.2:256 build/C/man3/getifaddrs.3:198
749 #: build/C/man2/listen.2:164 build/C/man2/recv.2:488 build/C/man2/select.2:482
750 #: build/C/man2/select_tut.2:527 build/C/man2/send.2:414
751 #: build/C/man3/sockatmark.3:95 build/C/man2/socket.2:382
752 #, no-wrap
753 msgid "EXAMPLE"
754 msgstr "例"
755
756 #. type: Plain text
757 #: build/C/man2/accept.2:379 build/C/man2/listen.2:167
758 msgid "See B<bind>(2)."
759 msgstr "B<bind>(2)  参照。"
760
761 #. type: SH
762 #: build/C/man2/accept.2:379 build/C/man2/bind.2:317
763 #: build/C/man3/bindresvport.3:98 build/C/man2/connect.2:261
764 #: build/C/man3/getifaddrs.3:281 build/C/man2/getsockname.2:110
765 #: build/C/man2/getsockopt.2:200 build/C/man2/listen.2:167
766 #: build/C/man2/recv.2:493 build/C/man2/recvmmsg.2:165
767 #: build/C/man2/select.2:519 build/C/man2/select_tut.2:817
768 #: build/C/man2/send.2:419 build/C/man2/sendmmsg.2:168
769 #: build/C/man3/sockatmark.3:130 build/C/man2/socket.2:387
770 #: build/C/man7/socket.7:742 build/C/man2/socketcall.2:54
771 #: build/C/man2/socketpair.2:122
772 #, no-wrap
773 msgid "SEE ALSO"
774 msgstr "関連項目"
775
776 #. type: Plain text
777 #: build/C/man2/accept.2:386
778 msgid ""
779 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
780 "B<socket>(7)"
781 msgstr ""
782 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
783 "B<socket>(7)"
784
785 #. type: SH
786 #: build/C/man2/accept.2:386 build/C/man2/bind.2:330
787 #: build/C/man3/bindresvport.3:101 build/C/man2/connect.2:268
788 #: build/C/man3/getifaddrs.3:287 build/C/man2/getsockname.2:117
789 #: build/C/man2/getsockopt.2:208 build/C/man2/listen.2:173
790 #: build/C/man2/recv.2:504 build/C/man2/recvmmsg.2:172
791 #: build/C/man2/select.2:534 build/C/man2/select_tut.2:836
792 #: build/C/man2/send.2:434 build/C/man2/sendmmsg.2:173
793 #: build/C/man3/sockatmark.3:135 build/C/man2/socket.2:418
794 #: build/C/man7/socket.7:753 build/C/man2/socketcall.2:72
795 #: build/C/man2/socketpair.2:129
796 #, no-wrap
797 msgid "COLOPHON"
798 msgstr ""
799
800 #. type: Plain text
801 #: build/C/man2/accept.2:393 build/C/man2/bind.2:337
802 #: build/C/man3/bindresvport.3:108 build/C/man2/connect.2:275
803 #: build/C/man3/getifaddrs.3:294 build/C/man2/getsockname.2:124
804 #: build/C/man2/getsockopt.2:215 build/C/man2/listen.2:180
805 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:179
806 #: build/C/man2/select.2:541 build/C/man2/select_tut.2:843
807 #: build/C/man2/send.2:441 build/C/man2/sendmmsg.2:180
808 #: build/C/man3/sockatmark.3:142 build/C/man2/socket.2:425
809 #: build/C/man7/socket.7:760 build/C/man2/socketcall.2:79
810 #: build/C/man2/socketpair.2:136
811 msgid ""
812 "This page is part of release 3.37 of the Linux I<man-pages> project.  A "
813 "description of the project, and information about reporting bugs, can be "
814 "found at http://www.kernel.org/doc/man-pages/."
815 msgstr ""
816
817 #. type: TH
818 #: build/C/man2/bind.2:66
819 #, no-wrap
820 msgid "BIND"
821 msgstr "BIND"
822
823 #. type: TH
824 #: build/C/man2/bind.2:66
825 #, no-wrap
826 msgid "2007-12-28"
827 msgstr "2007-12-28"
828
829 #. type: Plain text
830 #: build/C/man2/bind.2:69
831 msgid "bind - bind a name to a socket"
832 msgstr "bind - ソケットに名前をつける"
833
834 #. type: Plain text
835 #: build/C/man2/bind.2:76
836 #, no-wrap
837 msgid ""
838 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
839 "B<         socklen_t >I<addrlen>B<);>\n"
840 msgstr ""
841 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
842 "B<         socklen_t >I<addrlen>B<);>\n"
843
844 #. type: Plain text
845 #: build/C/man2/bind.2:90
846 msgid ""
847 "When a socket is created with B<socket>(2), it exists in a name space "
848 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
849 "address specified to by I<addr> to the socket referred to by the file "
850 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
851 "address structure pointed to by I<addr>.  Traditionally, this operation is "
852 "called \\(lqassigning a name to a socket\\(rq."
853 msgstr ""
854 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
855 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
856 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
857 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
858 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
859 "る。"
860
861 #. type: Plain text
862 #: build/C/man2/bind.2:97
863 msgid ""
864 "It is normally necessary to assign a local address using B<bind>()  before a "
865 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
866 msgstr ""
867 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
868 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
869 "る。"
870
871 #. type: Plain text
872 #: build/C/man2/bind.2:128
873 msgid ""
874 "The rules used in name binding vary between address families.  Consult the "
875 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
876 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
877 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
878 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
879 msgstr ""
880 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
881 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
882 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
883 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
884 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
885
886 #. type: Plain text
887 #: build/C/man2/bind.2:135
888 msgid ""
889 "The actual structure passed for the I<addr> argument will depend on the "
890 "address family.  The I<sockaddr> structure is defined as something like:"
891 msgstr ""
892 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
893 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
894
895 #. type: Plain text
896 #: build/C/man2/bind.2:142
897 #, no-wrap
898 msgid ""
899 "struct sockaddr {\n"
900 "    sa_family_t sa_family;\n"
901 "    char        sa_data[14];\n"
902 "}\n"
903 msgstr ""
904 "struct sockaddr {\n"
905 "    sa_family_t sa_family;\n"
906 "    char        sa_data[14];\n"
907 "}\n"
908
909 #. type: Plain text
910 #: build/C/man2/bind.2:150
911 msgid ""
912 "The only purpose of this structure is to cast the structure pointer passed "
913 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
914 msgstr ""
915 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
916 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
917
918 #. type: Plain text
919 #: build/C/man2/bind.2:155 build/C/man2/getsockname.2:70
920 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
921 #: build/C/man2/socketpair.2:72
922 msgid ""
923 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
924 "appropriately."
925 msgstr ""
926 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
927 "設定される。"
928
929 #. type: TP
930 #: build/C/man2/bind.2:156 build/C/man2/bind.2:180
931 #: build/C/man3/bindresvport.3:74 build/C/man2/connect.2:133
932 #: build/C/man2/send.2:283 build/C/man2/socket.2:318
933 #, no-wrap
934 msgid "B<EACCES>"
935 msgstr "B<EACCES>"
936
937 #.  e.g., privileged port in AF_INET domain
938 #. type: Plain text
939 #: build/C/man2/bind.2:160
940 msgid "The address is protected, and the user is not the superuser."
941 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
942
943 #. type: TP
944 #: build/C/man2/bind.2:160 build/C/man3/bindresvport.3:79
945 #: build/C/man2/connect.2:146 build/C/man2/listen.2:86
946 #, no-wrap
947 msgid "B<EADDRINUSE>"
948 msgstr "B<EADDRINUSE>"
949
950 #. type: Plain text
951 #: build/C/man2/bind.2:163
952 msgid "The given address is already in use."
953 msgstr "指定されたアドレスが既に使用中である。"
954
955 #. type: Plain text
956 #: build/C/man2/bind.2:167
957 msgid "I<sockfd> is not a valid descriptor."
958 msgstr "I<sockfd> が不正なディスクリプタである。"
959
960 #.  This may change in the future: see
961 #.  .I linux/unix/sock.c for details.
962 #. type: Plain text
963 #: build/C/man2/bind.2:172
964 msgid "The socket is already bound to an address."
965 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
966
967 #. type: Plain text
968 #: build/C/man2/bind.2:176
969 msgid "I<sockfd> is a descriptor for a file, not a socket."
970 msgstr ""
971 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
972
973 #. type: Plain text
974 #: build/C/man2/bind.2:180
975 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
976 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
977
978 #. type: Plain text
979 #: build/C/man2/bind.2:185
980 msgid ""
981 "Search permission is denied on a component of the path prefix.  (See also "
982 "B<path_resolution>(7).)"
983 msgstr ""
984 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
985 "(7)  も参照すること)。"
986
987 #. type: TP
988 #: build/C/man2/bind.2:185
989 #, no-wrap
990 msgid "B<EADDRNOTAVAIL>"
991 msgstr "B<EADDRNOTAVAIL>"
992
993 #. type: Plain text
994 #: build/C/man2/bind.2:189
995 msgid ""
996 "A nonexistent interface was requested or the requested address was not local."
997 msgstr ""
998 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
999 "かった。"
1000
1001 #. type: Plain text
1002 #: build/C/man2/bind.2:193
1003 msgid "I<addr> points outside the user's accessible address space."
1004 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1005
1006 #. type: Plain text
1007 #: build/C/man2/bind.2:200
1008 msgid ""
1009 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1010 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1011
1012 #. type: TP
1013 #: build/C/man2/bind.2:200
1014 #, no-wrap
1015 msgid "B<ELOOP>"
1016 msgstr "B<ELOOP>"
1017
1018 #. type: Plain text
1019 #: build/C/man2/bind.2:204
1020 msgid "Too many symbolic links were encountered in resolving I<addr>."
1021 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1022
1023 #. type: TP
1024 #: build/C/man2/bind.2:204
1025 #, no-wrap
1026 msgid "B<ENAMETOOLONG>"
1027 msgstr "B<ENAMETOOLONG>"
1028
1029 #. type: Plain text
1030 #: build/C/man2/bind.2:208
1031 msgid "I<addr> is too long."
1032 msgstr "I<addr> が長過ぎる。"
1033
1034 #. type: TP
1035 #: build/C/man2/bind.2:208
1036 #, no-wrap
1037 msgid "B<ENOENT>"
1038 msgstr "B<ENOENT>"
1039
1040 #. type: Plain text
1041 #: build/C/man2/bind.2:211
1042 msgid "The file does not exist."
1043 msgstr "ファイルが存在しない。"
1044
1045 #. type: TP
1046 #: build/C/man2/bind.2:211 build/C/man2/recv.2:427 build/C/man2/select.2:318
1047 #: build/C/man2/send.2:338
1048 #, no-wrap
1049 msgid "B<ENOMEM>"
1050 msgstr "B<ENOMEM>"
1051
1052 #. type: Plain text
1053 #: build/C/man2/bind.2:214
1054 msgid "Insufficient kernel memory was available."
1055 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1056
1057 #. type: TP
1058 #: build/C/man2/bind.2:214
1059 #, no-wrap
1060 msgid "B<ENOTDIR>"
1061 msgstr "B<ENOTDIR>"
1062
1063 #. type: Plain text
1064 #: build/C/man2/bind.2:217
1065 msgid "A component of the path prefix is not a directory."
1066 msgstr "パス名の構成要素がディレクトリではない。"
1067
1068 #. type: TP
1069 #: build/C/man2/bind.2:217
1070 #, no-wrap
1071 msgid "B<EROFS>"
1072 msgstr "B<EROFS>"
1073
1074 #. type: Plain text
1075 #: build/C/man2/bind.2:220
1076 msgid "The socket inode would reside on a read-only file system."
1077 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1078
1079 #.  SVr4 documents an additional
1080 #.  .B ENOSR
1081 #.  general error condition, and
1082 #.  additional
1083 #.  .B EIO
1084 #.  and
1085 #.  .B EISDIR
1086 #.  UNIX-domain error conditions.
1087 #. type: Plain text
1088 #: build/C/man2/bind.2:232
1089 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1090 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1091
1092 #. type: Plain text
1093 #: build/C/man2/bind.2:249
1094 msgid ""
1095 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1096 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1097 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1098 msgstr ""
1099 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1100 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1101 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1102
1103 #. type: SH
1104 #: build/C/man2/bind.2:249 build/C/man2/getsockopt.2:197
1105 #: build/C/man2/select.2:423 build/C/man2/send.2:409
1106 #: build/C/man3/sockatmark.3:91 build/C/man7/socket.7:729
1107 #, no-wrap
1108 msgid "BUGS"
1109 msgstr "バグ"
1110
1111 #.  FIXME What *are* transparent proxy options?
1112 #. type: Plain text
1113 #: build/C/man2/bind.2:252
1114 msgid "The transparent proxy options are not described."
1115 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1116
1117 #. type: Plain text
1118 #: build/C/man2/bind.2:257
1119 msgid ""
1120 "An example of the use of B<bind>()  with Internet domain sockets can be "
1121 "found in B<getaddrinfo>(3)."
1122 msgstr ""
1123 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1124 "(3)  に記載されている。"
1125
1126 #.  listen.7 refers to this example.
1127 #.  accept.7 refers to this example.
1128 #.  unix.7 refers to this example.
1129 #. type: Plain text
1130 #: build/C/man2/bind.2:264
1131 msgid ""
1132 "The following example shows how to bind a stream socket in the UNIX "
1133 "(B<AF_UNIX>)  domain, and accept connections:"
1134 msgstr ""
1135 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1136 "を示したものである。"
1137
1138 #. type: Plain text
1139 #: build/C/man2/bind.2:271
1140 #, no-wrap
1141 msgid ""
1142 "#include E<lt>sys/socket.hE<gt>\n"
1143 "#include E<lt>sys/un.hE<gt>\n"
1144 "#include E<lt>stdlib.hE<gt>\n"
1145 "#include E<lt>stdio.hE<gt>\n"
1146 "#include E<lt>string.hE<gt>\n"
1147 msgstr ""
1148 "#include E<lt>sys/socket.hE<gt>\n"
1149 "#include E<lt>sys/un.hE<gt>\n"
1150 "#include E<lt>stdlib.hE<gt>\n"
1151 "#include E<lt>stdio.hE<gt>\n"
1152 "#include E<lt>string.hE<gt>\n"
1153
1154 #. type: Plain text
1155 #: build/C/man2/bind.2:274
1156 #, no-wrap
1157 msgid ""
1158 "#define MY_SOCK_PATH \"/somepath\"\n"
1159 "#define LISTEN_BACKLOG 50\n"
1160 msgstr ""
1161 "#define MY_SOCK_PATH \"/somepath\"\n"
1162 "#define LISTEN_BACKLOG 50\n"
1163
1164 #. type: Plain text
1165 #: build/C/man2/bind.2:277
1166 #, no-wrap
1167 msgid ""
1168 "#define handle_error(msg) \\e\n"
1169 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1170 msgstr ""
1171 "#define handle_error(msg) \\e\n"
1172 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1173
1174 #. type: Plain text
1175 #: build/C/man2/bind.2:284
1176 #, no-wrap
1177 msgid ""
1178 "int\n"
1179 "main(int argc, char *argv[])\n"
1180 "{\n"
1181 "    int sfd, cfd;\n"
1182 "    struct sockaddr_un my_addr, peer_addr;\n"
1183 "    socklen_t peer_addr_size;\n"
1184 msgstr ""
1185 "int\n"
1186 "main(int argc, char *argv[])\n"
1187 "{\n"
1188 "    int sfd, cfd;\n"
1189 "    struct sockaddr_un my_addr, peer_addr;\n"
1190 "    socklen_t peer_addr_size;\n"
1191
1192 #. type: Plain text
1193 #: build/C/man2/bind.2:288
1194 #, no-wrap
1195 msgid ""
1196 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1197 "    if (sfd == -1)\n"
1198 "        handle_error(\"socket\");\n"
1199 msgstr ""
1200 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1201 "    if (sfd == -1)\n"
1202 "        handle_error(\"socket\");\n"
1203
1204 #. type: Plain text
1205 #: build/C/man2/bind.2:294
1206 #, no-wrap
1207 msgid ""
1208 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1209 "                        /* Clear structure */\n"
1210 "    my_addr.sun_family = AF_UNIX;\n"
1211 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1212 "            sizeof(my_addr.sun_path) - 1);\n"
1213 msgstr ""
1214 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1215 "                        /* Clear structure */\n"
1216 "    my_addr.sun_family = AF_UNIX;\n"
1217 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1218 "            sizeof(my_addr.sun_path) - 1);\n"
1219
1220 #. type: Plain text
1221 #: build/C/man2/bind.2:298
1222 #, no-wrap
1223 msgid ""
1224 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1225 "            sizeof(struct sockaddr_un)) == -1)\n"
1226 "        handle_error(\"bind\");\n"
1227 msgstr ""
1228 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1229 "            sizeof(struct sockaddr_un)) == -1)\n"
1230 "        handle_error(\"bind\");\n"
1231
1232 #. type: Plain text
1233 #: build/C/man2/bind.2:301
1234 #, no-wrap
1235 msgid ""
1236 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1237 "        handle_error(\"listen\");\n"
1238 msgstr ""
1239 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1240 "        handle_error(\"listen\");\n"
1241
1242 #. type: Plain text
1243 #: build/C/man2/bind.2:304
1244 #, no-wrap
1245 msgid ""
1246 "    /* Now we can accept incoming connections one\n"
1247 "       at a time using accept(2) */\n"
1248 msgstr ""
1249 "    /* Now we can accept incoming connections one\n"
1250 "       at a time using accept(2) */\n"
1251
1252 #. type: Plain text
1253 #: build/C/man2/bind.2:310
1254 #, no-wrap
1255 msgid ""
1256 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1257 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1258 "                 &peer_addr_size);\n"
1259 "    if (cfd == -1)\n"
1260 "        handle_error(\"accept\");\n"
1261 msgstr ""
1262 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1263 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1264 "                 &peer_addr_size)\n"
1265 "    if (cfd == -1)\n"
1266 "        handle_error(\"accept\");\n"
1267
1268 #. type: Plain text
1269 #: build/C/man2/bind.2:312
1270 #, no-wrap
1271 msgid "    /* Code to deal with incoming connection(s)... */\n"
1272 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1273
1274 #. type: Plain text
1275 #: build/C/man2/bind.2:316
1276 #, no-wrap
1277 msgid ""
1278 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1279 "       should be deleted using unlink(2) or remove(3) */\n"
1280 "}\n"
1281 msgstr ""
1282 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1283 "       should be deleted using unlink(2) or remove(3) */\n"
1284 "}\n"
1285
1286 #. type: Plain text
1287 #: build/C/man2/bind.2:330
1288 msgid ""
1289 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1290 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1291 "(7), B<socket>(7), B<unix>(7)"
1292 msgstr ""
1293 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1294 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1295 "(7), B<socket>(7), B<unix>(7)"
1296
1297 #. type: TH
1298 #: build/C/man3/bindresvport.3:27
1299 #, no-wrap
1300 msgid "BINDRESVPORT"
1301 msgstr "BINDRESVPORT"
1302
1303 #. type: TH
1304 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
1305 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
1306 #: build/C/man3/sockatmark.3:23
1307 #, no-wrap
1308 msgid "2008-12-03"
1309 msgstr "2008-12-03"
1310
1311 #. type: Plain text
1312 #: build/C/man3/bindresvport.3:30
1313 msgid "bindresvport - bind a socket to a privileged IP port"
1314 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1315
1316 #. type: Plain text
1317 #: build/C/man3/bindresvport.3:34
1318 #, no-wrap
1319 msgid ""
1320 "B<#include E<lt>sys/types.hE<gt>>\n"
1321 "B<#include E<lt>netinet/in.hE<gt>>\n"
1322 msgstr ""
1323 "B<#include E<lt>sys/types.hE<gt>>\n"
1324 "B<#include E<lt>netinet/in.hE<gt>>\n"
1325
1326 #. type: Plain text
1327 #: build/C/man3/bindresvport.3:36
1328 #, no-wrap
1329 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1330 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1331
1332 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1333 #. type: Plain text
1334 #: build/C/man3/bindresvport.3:43
1335 msgid ""
1336 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1337 "anonymous IP port, that is, a port number arbitrarily selected from the "
1338 "range 512 to 1023."
1339 msgstr ""
1340 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1341 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1342 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1343
1344 #. type: Plain text
1345 #: build/C/man3/bindresvport.3:53
1346 msgid ""
1347 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1348 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1349 "allocated."
1350 msgstr ""
1351 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1352 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1353 "される。"
1354
1355 #. type: Plain text
1356 #: build/C/man3/bindresvport.3:64
1357 msgid ""
1358 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1359 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1360 "return the port number actually allocated.  (This information can later be "
1361 "obtained using B<getsockname>(2).)"
1362 msgstr ""
1363 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1364 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1365 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1366 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1367
1368 #. type: Plain text
1369 #: build/C/man3/bindresvport.3:69
1370 msgid ""
1371 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1372 "I<errno> set to indicate the cause of the error."
1373 msgstr ""
1374 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1375 "I<errno> にエラーの原因を示す値を設定する。"
1376
1377 #. type: Plain text
1378 #: build/C/man3/bindresvport.3:74
1379 msgid ""
1380 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1381 "addition, the following errors may occur:"
1382 msgstr ""
1383 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1384 "以下のエラーが発生することがある:"
1385
1386 #. type: Plain text
1387 #: build/C/man3/bindresvport.3:79
1388 msgid ""
1389 "The caller did not have superuser privilege (to be precise: the "
1390 "B<CAP_NET_BIND_SERVICE> capability is required)."
1391 msgstr ""
1392 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1393 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1394
1395 #. type: Plain text
1396 #: build/C/man3/bindresvport.3:82
1397 msgid "All privileged ports are in use."
1398 msgstr "全ての特権ポートが使用中である。"
1399
1400 #. type: TP
1401 #: build/C/man3/bindresvport.3:82
1402 #, no-wrap
1403 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1404 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1405
1406 #. type: Plain text
1407 #: build/C/man3/bindresvport.3:89
1408 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1409 msgstr ""
1410 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1411
1412 #. type: Plain text
1413 #: build/C/man3/bindresvport.3:92
1414 msgid ""
1415 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1416 msgstr ""
1417 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1418
1419 #. type: Plain text
1420 #: build/C/man3/bindresvport.3:98
1421 msgid ""
1422 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1423 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1424 msgstr ""
1425 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1426 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1427
1428 #. type: Plain text
1429 #: build/C/man3/bindresvport.3:101
1430 msgid "B<bind>(2), B<getsockname>(2)"
1431 msgstr "B<bind>(2), B<getsockname>(2)"
1432
1433 #. type: TH
1434 #: build/C/man2/connect.2:65
1435 #, no-wrap
1436 msgid "CONNECT"
1437 msgstr "CONNECT"
1438
1439 #. type: Plain text
1440 #: build/C/man2/connect.2:68
1441 msgid "connect - initiate a connection on a socket"
1442 msgstr "connect - ソケットの接続を行う"
1443
1444 #. type: Plain text
1445 #: build/C/man2/connect.2:71 build/C/man2/getsockopt.2:48
1446 #: build/C/man2/listen.2:49
1447 #, no-wrap
1448 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1449 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1450
1451 #. type: Plain text
1452 #: build/C/man2/connect.2:73 build/C/man2/getsockname.2:44
1453 #: build/C/man2/getsockopt.2:50 build/C/man2/listen.2:51
1454 #: build/C/man2/recv.2:49
1455 #, no-wrap
1456 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1457 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1458
1459 #. type: Plain text
1460 #: build/C/man2/connect.2:76
1461 #, no-wrap
1462 msgid ""
1463 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1464 "B<            socklen_t >I<addrlen>B<);>\n"
1465 msgstr ""
1466 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1467 "B<            socklen_t >I<addrlen>B<);>\n"
1468
1469 #. type: Plain text
1470 #: build/C/man2/connect.2:95
1471 msgid ""
1472 "The B<connect>()  system call connects the socket referred to by the file "
1473 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1474 "argument specifies the size of I<addr>.  The format of the address in "
1475 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1476 "B<socket>(2)  for further details."
1477 msgstr ""
1478 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1479 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1480 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1481 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1482 "こと。"
1483
1484 #. type: Plain text
1485 #: build/C/man2/connect.2:111
1486 msgid ""
1487 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1488 "to which datagrams are sent by default, and the only address from which "
1489 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1490 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1491 "that is bound to the address specified by I<addr>."
1492 msgstr ""
1493 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1494 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1495 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1496 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1497 "に対する接続の 作成を試みる。"
1498
1499 #. type: Plain text
1500 #: build/C/man2/connect.2:125
1501 msgid ""
1502 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1503 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1504 "times to change their association.  Connectionless sockets may dissolve the "
1505 "association by connecting to an address with the I<sa_family> member of "
1506 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1507 msgstr ""
1508 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1509 "()  が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1510 "度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1511 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1512 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1513
1514 #. type: Plain text
1515 #: build/C/man2/connect.2:130
1516 msgid ""
1517 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1518 "returned, and I<errno> is set appropriately."
1519 msgstr ""
1520 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1521 "適切な値を設定する。"
1522
1523 #. type: Plain text
1524 #: build/C/man2/connect.2:133
1525 msgid ""
1526 "The following are general socket errors only.  There may be other domain-"
1527 "specific error codes."
1528 msgstr ""
1529 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1530 "する可能性がある。"
1531
1532 #. type: Plain text
1533 #: build/C/man2/connect.2:141
1534 msgid ""
1535 "For UNIX domain sockets, which are identified by pathname: Write permission "
1536 "is denied on the socket file, or search permission is denied for one of the "
1537 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1538 msgstr ""
1539 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1540 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1541 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1542
1543 #. type: TP
1544 #: build/C/man2/connect.2:141
1545 #, no-wrap
1546 msgid "B<EACCES>, B<EPERM>"
1547 msgstr "B<EACCES>, B<EPERM>"
1548
1549 #. type: Plain text
1550 #: build/C/man2/connect.2:146
1551 msgid ""
1552 "The user tried to connect to a broadcast address without having the socket "
1553 "broadcast flag enabled or the connection request failed because of a local "
1554 "firewall rule."
1555 msgstr ""
1556 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1557 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1558 "要求が失敗した。"
1559
1560 #. type: Plain text
1561 #: build/C/man2/connect.2:149
1562 msgid "Local address is already in use."
1563 msgstr "ローカルアドレスが既に使用されている。"
1564
1565 #. type: TP
1566 #: build/C/man2/connect.2:149 build/C/man2/socket.2:322
1567 #: build/C/man2/socketpair.2:73
1568 #, no-wrap
1569 msgid "B<EAFNOSUPPORT>"
1570 msgstr "B<EAFNOSUPPORT>"
1571
1572 #. type: Plain text
1573 #: build/C/man2/connect.2:154
1574 msgid ""
1575 "The passed address didn't have the correct address family in its "
1576 "I<sa_family> field."
1577 msgstr ""
1578 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1579 "い。"
1580
1581 #. type: TP
1582 #: build/C/man2/connect.2:154
1583 #, no-wrap
1584 msgid "B<EAGAIN>"
1585 msgstr "B<EAGAIN>"
1586
1587 #. type: Plain text
1588 #: build/C/man2/connect.2:163
1589 msgid ""
1590 "No more free local ports or insufficient entries in the routing cache.  For "
1591 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1592 "B<ip>(7)  for information on how to increase the number of local ports."
1593 msgstr ""
1594 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1595 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1596 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1597
1598 #. type: TP
1599 #: build/C/man2/connect.2:163
1600 #, no-wrap
1601 msgid "B<EALREADY>"
1602 msgstr "B<EALREADY>"
1603
1604 #. type: Plain text
1605 #: build/C/man2/connect.2:167
1606 msgid ""
1607 "The socket is nonblocking and a previous connection attempt has not yet been "
1608 "completed."
1609 msgstr ""
1610 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1611
1612 #. type: Plain text
1613 #: build/C/man2/connect.2:170
1614 msgid "The file descriptor is not a valid index in the descriptor table."
1615 msgstr ""
1616 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1617 "い。"
1618
1619 #. type: TP
1620 #: build/C/man2/connect.2:170 build/C/man2/recv.2:410
1621 #, no-wrap
1622 msgid "B<ECONNREFUSED>"
1623 msgstr "B<ECONNREFUSED>"
1624
1625 #. type: Plain text
1626 #: build/C/man2/connect.2:173
1627 msgid "No-one listening on the remote address."
1628 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1629
1630 #. type: Plain text
1631 #: build/C/man2/connect.2:176
1632 msgid "The socket structure address is outside the user's address space."
1633 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1634
1635 #. type: TP
1636 #: build/C/man2/connect.2:176
1637 #, no-wrap
1638 msgid "B<EINPROGRESS>"
1639 msgstr "B<EINPROGRESS>"
1640
1641 #. type: Plain text
1642 #: build/C/man2/connect.2:201
1643 msgid ""
1644 "The socket is nonblocking and the connection cannot be completed "
1645 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1646 "by selecting the socket for writing.  After B<select>(2)  indicates "
1647 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1648 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1649 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1650 "error codes listed here, explaining the reason for the failure)."
1651 msgstr ""
1652 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1653 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1654 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1655 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1656 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1657 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1658 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1659 "の原因が分かる。"
1660
1661 #.  For TCP, the connection will complete asynchronously.
1662 #.  See http://lkml.org/lkml/2005/7/12/254
1663 #. type: Plain text
1664 #: build/C/man2/connect.2:207
1665 msgid ""
1666 "The system call was interrupted by a signal that was caught; see B<signal>"
1667 "(7)."
1668 msgstr ""
1669 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1670
1671 #. type: TP
1672 #: build/C/man2/connect.2:207 build/C/man2/send.2:318
1673 #, no-wrap
1674 msgid "B<EISCONN>"
1675 msgstr "B<EISCONN>"
1676
1677 #. type: Plain text
1678 #: build/C/man2/connect.2:210
1679 msgid "The socket is already connected."
1680 msgstr "ソケットは既に接続 (connect) されている。"
1681
1682 #. type: TP
1683 #: build/C/man2/connect.2:210
1684 #, no-wrap
1685 msgid "B<ENETUNREACH>"
1686 msgstr "B<ENETUNREACH>"
1687
1688 #. type: Plain text
1689 #: build/C/man2/connect.2:213
1690 msgid "Network is unreachable."
1691 msgstr "到達できないネットワークである。"
1692
1693 #. type: Plain text
1694 #: build/C/man2/connect.2:216
1695 msgid "The file descriptor is not associated with a socket."
1696 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1697
1698 #. type: TP
1699 #: build/C/man2/connect.2:216
1700 #, no-wrap
1701 msgid "B<ETIMEDOUT>"
1702 msgstr "B<ETIMEDOUT>"
1703
1704 #. type: Plain text
1705 #: build/C/man2/connect.2:223
1706 msgid ""
1707 "Timeout while attempting connection.  The server may be too busy to accept "
1708 "new connections.  Note that for IP sockets the timeout may be very long when "
1709 "syncookies are enabled on the server."
1710 msgstr ""
1711 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1712 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1713 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1714 "ること。"
1715
1716 #.  SVr4 documents the additional
1717 #.  general error codes
1718 #.  .BR EADDRNOTAVAIL ,
1719 #.  .BR EINVAL ,
1720 #.  .BR EAFNOSUPPORT ,
1721 #.  .BR EALREADY ,
1722 #.  .BR EINTR ,
1723 #.  .BR EPROTOTYPE ,
1724 #.  and
1725 #.  .BR ENOSR .
1726 #.  It also
1727 #.  documents many additional error conditions not described here.
1728 #. type: Plain text
1729 #: build/C/man2/connect.2:239
1730 msgid ""
1731 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1732 "POSIX.1-2001."
1733 msgstr ""
1734 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1735
1736 #. type: Plain text
1737 #: build/C/man2/connect.2:256
1738 msgid ""
1739 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1740 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1741 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1742 msgstr ""
1743 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1744 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1745 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1746
1747 #. type: Plain text
1748 #: build/C/man2/connect.2:261
1749 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1750 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1751
1752 #. type: Plain text
1753 #: build/C/man2/connect.2:268
1754 msgid ""
1755 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1756 "B<path_resolution>(7)"
1757 msgstr ""
1758 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1759 "B<path_resolution>(7)"
1760
1761 #. type: TH
1762 #: build/C/man3/getifaddrs.3:33
1763 #, no-wrap
1764 msgid "GETIFADDRS"
1765 msgstr "GETIFADDRS"
1766
1767 #. type: TH
1768 #: build/C/man3/getifaddrs.3:33
1769 #, no-wrap
1770 msgid "2010-10-06"
1771 msgstr "2010-10-06"
1772
1773 #. type: TH
1774 #: build/C/man3/getifaddrs.3:33
1775 #, no-wrap
1776 msgid "GNU"
1777 msgstr "GNU"
1778
1779 #. type: Plain text
1780 #: build/C/man3/getifaddrs.3:36
1781 msgid "getifaddrs, freeifaddrs - get interface addresses"
1782 msgstr "getifaddrs, freeifaddrs - get interface addresses"
1783
1784 #. type: Plain text
1785 #: build/C/man3/getifaddrs.3:40
1786 #, no-wrap
1787 msgid ""
1788 "B<#include E<lt>sys/types.hE<gt>>\n"
1789 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1790 msgstr ""
1791 "B<#include E<lt>sys/types.hE<gt>>\n"
1792 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1793
1794 #. type: Plain text
1795 #: build/C/man3/getifaddrs.3:42
1796 #, no-wrap
1797 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1798 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1799
1800 #. type: Plain text
1801 #: build/C/man3/getifaddrs.3:44
1802 #, no-wrap
1803 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1804 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1805
1806 #. type: Plain text
1807 #: build/C/man3/getifaddrs.3:55
1808 msgid ""
1809 "The B<getifaddrs>()  function creates a linked list of structures describing "
1810 "the network interfaces of the local system, and stores the address of the "
1811 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1812 "structures, defined as follows:"
1813 msgstr ""
1814 "The B<getifaddrs>()  function creates a linked list of structures describing "
1815 "the network interfaces of the local system, and stores the address of the "
1816 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1817 "structures, defined as follows:"
1818
1819 #. type: Plain text
1820 #: build/C/man3/getifaddrs.3:74
1821 #, no-wrap
1822 msgid ""
1823 "struct ifaddrs {\n"
1824 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1825 "    char            *ifa_name;    /* Name of interface */\n"
1826 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1827 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1828 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1829 "    union {\n"
1830 "        struct sockaddr *ifu_broadaddr;\n"
1831 "                         /* Broadcast address of interface */\n"
1832 "        struct sockaddr *ifu_dstaddr;\n"
1833 "                         /* Point-to-point destination address */\n"
1834 "    } ifa_ifu;\n"
1835 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1836 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1837 "    void            *ifa_data;    /* Address-specific data */\n"
1838 "};\n"
1839 msgstr ""
1840 "struct ifaddrs {\n"
1841 "    struct ifaddrs  *ifa_next;    /* Next item in list */\n"
1842 "    char            *ifa_name;    /* Name of interface */\n"
1843 "    unsigned int     ifa_flags;   /* Flags from SIOCGIFFLAGS */\n"
1844 "    struct sockaddr *ifa_addr;    /* Address of interface */\n"
1845 "    struct sockaddr *ifa_netmask; /* Netmask of interface */\n"
1846 "    union {\n"
1847 "        struct sockaddr *ifu_broadaddr;\n"
1848 "                         /* Broadcast address of interface */\n"
1849 "        struct sockaddr *ifu_dstaddr;\n"
1850 "                         /* Point-to-point destination address */\n"
1851 "    } ifa_ifu;\n"
1852 "#define              ifa_broadaddr ifa_ifu.ifu_broadaddr\n"
1853 "#define              ifa_dstaddr   ifa_ifu.ifu_dstaddr\n"
1854 "    void            *ifa_data;    /* Address-specific data */\n"
1855 "};\n"
1856
1857 #. type: Plain text
1858 #: build/C/man3/getifaddrs.3:81
1859 msgid ""
1860 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1861 "or NULL if this is the last item of the list."
1862 msgstr ""
1863 "The I<ifa_next> field contains a pointer to the next structure on the list, "
1864 "or NULL if this is the last item of the list."
1865
1866 #.  The constant
1867 #.  .B IF NAMESIZE
1868 #.  indicates the maximum length of this field.
1869 #. type: Plain text
1870 #: build/C/man3/getifaddrs.3:88
1871 msgid "The I<ifa_name> points to the null-terminated interface name."
1872 msgstr "The I<ifa_name> points to the null-terminated interface name."
1873
1874 #. type: Plain text
1875 #: build/C/man3/getifaddrs.3:97
1876 msgid ""
1877 "The I<ifa_flags> field contains the interface flags, as returned by the "
1878 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1879 "these flags)."
1880 msgstr ""
1881 "The I<ifa_flags> field contains the interface flags, as returned by the "
1882 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1883 "these flags)."
1884
1885 #. type: Plain text
1886 #: build/C/man3/getifaddrs.3:105
1887 msgid ""
1888 "The I<ifa_addr> field points to a structure containing the interface "
1889 "address.  (The I<sa_family> subfield should be consulted to determine the "
1890 "format of the address structure.)"
1891 msgstr ""
1892 "The I<ifa_addr> field points to a structure containing the interface "
1893 "address.  (The I<sa_family> subfield should be consulted to determine the "
1894 "format of the address structure.)"
1895
1896 #. type: Plain text
1897 #: build/C/man3/getifaddrs.3:111
1898 msgid ""
1899 "The I<ifa_netmask> field points to a structure containing the netmask "
1900 "associated with I<ifa_addr>, if applicable for the address family."
1901 msgstr ""
1902 "The I<ifa_netmask> field points to a structure containing the netmask "
1903 "associated with I<ifa_addr>, if applicable for the address family."
1904
1905 #. type: Plain text
1906 #: build/C/man3/getifaddrs.3:126
1907 msgid ""
1908 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1909 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1910 "will contain the broadcast address associated with I<ifa_addr> (if "
1911 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1912 "destination address of the point-to-point interface."
1913 msgstr ""
1914 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1915 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1916 "will contain the broadcast address associated with I<ifa_addr> (if "
1917 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1918 "destination address of the point-to-point interface."
1919
1920 #. type: Plain text
1921 #: build/C/man3/getifaddrs.3:131
1922 msgid ""
1923 "The I<ifa_data> field points to a buffer containing address-family-specific "
1924 "data; this field may be NULL if there is no such data for this interface."
1925 msgstr ""
1926 "The I<ifa_data> field points to a buffer containing address-family-specific "
1927 "data; this field may be NULL if there is no such data for this interface."
1928
1929 #. type: Plain text
1930 #: build/C/man3/getifaddrs.3:137
1931 msgid ""
1932 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1933 "freed using B<freeifaddrs>()  when no longer needed."
1934 msgstr ""
1935 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1936 "freed using B<freeifaddrs>()  when no longer needed."
1937
1938 #. type: SH
1939 #: build/C/man3/getifaddrs.3:137
1940 #, no-wrap
1941 msgid "RETURN VALUES"
1942 msgstr "RETURN VALUES"
1943
1944 #. type: Plain text
1945 #: build/C/man3/getifaddrs.3:144
1946 msgid ""
1947 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1948 "I<errno> is set appropriately."
1949 msgstr ""
1950 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1951 "I<errno> is set appropriately."
1952
1953 #. type: Plain text
1954 #: build/C/man3/getifaddrs.3:157
1955 msgid ""
1956 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1957 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1958 "(2), B<malloc>(3), or B<realloc>(3)."
1959 msgstr ""
1960 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1961 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1962 "(2), B<malloc>(3), or B<realloc>(3)."
1963
1964 #. type: Plain text
1965 #: build/C/man3/getifaddrs.3:165
1966 msgid ""
1967 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1968 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1969 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1970 "available on kernels that support netlink."
1971 msgstr ""
1972 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1973 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1974 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1975 "available on kernels that support netlink."
1976
1977 #.  , but the BSD-derived documentation generally
1978 #.  appears to be confused and obsolete on this point.
1979 #.  i.e., commonly it still says one of them will be NULL, even if
1980 #.  the ifa_ifu union is already present
1981 #. type: Plain text
1982 #: build/C/man3/getifaddrs.3:185
1983 msgid ""
1984 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1985 "the BSD systems, but with slightly different semantics documented"
1986 "\\(emreturning one entry per interface, not per address.  This means "
1987 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1988 "address, and no link-level address is returned if the interface has an IP "
1989 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1990 "I<ifa_dstaddr> differs on various systems."
1991 msgstr ""
1992 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1993 "the BSD systems, but with slightly different semantics documented"
1994 "\\(emreturning one entry per interface, not per address.  This means "
1995 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1996 "address, and no link-level address is returned if the interface has an IP "
1997 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1998 "I<ifa_dstaddr> differs on various systems."
1999
2000 #. type: Plain text
2001 #: build/C/man3/getifaddrs.3:198
2002 msgid ""
2003 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2004 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2005 "containing lower-level details about the interface and its physical layer.  "
2006 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2007 "net_device_stats>, defined in I<E<lt>linux/netdevice.hE<gt>>, which contains "
2008 "various interface attributes and statistics."
2009 msgstr ""
2010 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
2011 "assigned to the interface, but also one B<AF_PACKET> address per interface "
2012 "containing lower-level details about the interface and its physical layer.  "
2013 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
2014 "net_device_stats>, defined in I<E<lt>linux/netdevice.hE<gt>>, which contains "
2015 "various interface attributes and statistics."
2016
2017 #. type: Plain text
2018 #: build/C/man3/getifaddrs.3:205
2019 msgid ""
2020 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2021 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2022 "system:"
2023 msgstr ""
2024 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
2025 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
2026 "system:"
2027
2028 #. type: Plain text
2029 #: build/C/man3/getifaddrs.3:219
2030 #, no-wrap
2031 msgid ""
2032 "$ B<./a.out>\n"
2033 "lo      address family: 17 (AF_PACKET)\n"
2034 "eth0    address family: 17 (AF_PACKET)\n"
2035 "lo      address family: 2 (AF_INET)\n"
2036 "        address: E<lt>127.0.0.1E<gt>\n"
2037 "eth0    address family: 2 (AF_INET)\n"
2038 "        address: E<lt>10.1.1.4E<gt>\n"
2039 "lo      address family: 10 (AF_INET6)\n"
2040 "        address: E<lt>::1E<gt>\n"
2041 "eth0    address family: 10 (AF_INET6)\n"
2042 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2043 msgstr ""
2044 "$ B<./a.out>\n"
2045 "lo      address family: 17 (AF_PACKET)\n"
2046 "eth0    address family: 17 (AF_PACKET)\n"
2047 "lo      address family: 2 (AF_INET)\n"
2048 "        address: E<lt>127.0.0.1E<gt>\n"
2049 "eth0    address family: 2 (AF_INET)\n"
2050 "        address: E<lt>10.1.1.4E<gt>\n"
2051 "lo      address family: 10 (AF_INET6)\n"
2052 "        address: E<lt>::1E<gt>\n"
2053 "eth0    address family: 10 (AF_INET6)\n"
2054 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2055
2056 #. type: SS
2057 #: build/C/man3/getifaddrs.3:221
2058 #, no-wrap
2059 msgid "Program source"
2060 msgstr "Program source"
2061
2062 #. type: Plain text
2063 #: build/C/man3/getifaddrs.3:231
2064 #, no-wrap
2065 msgid ""
2066 "#include E<lt>arpa/inet.hE<gt>\n"
2067 "#include E<lt>sys/socket.hE<gt>\n"
2068 "#include E<lt>netdb.hE<gt>\n"
2069 "#include E<lt>ifaddrs.hE<gt>\n"
2070 "#include E<lt>stdio.hE<gt>\n"
2071 "#include E<lt>stdlib.hE<gt>\n"
2072 "#include E<lt>unistd.hE<gt>\n"
2073 msgstr ""
2074 "#include E<lt>arpa/inet.hE<gt>\n"
2075 "#include E<lt>sys/socket.hE<gt>\n"
2076 "#include E<lt>netdb.hE<gt>\n"
2077 "#include E<lt>ifaddrs.hE<gt>\n"
2078 "#include E<lt>stdio.hE<gt>\n"
2079 "#include E<lt>stdlib.hE<gt>\n"
2080 "#include E<lt>unistd.hE<gt>\n"
2081
2082 #. type: Plain text
2083 #: build/C/man3/getifaddrs.3:238
2084 #, no-wrap
2085 msgid ""
2086 "int\n"
2087 "main(int argc, char *argv[])\n"
2088 "{\n"
2089 "    struct ifaddrs *ifaddr, *ifa;\n"
2090 "    int family, s;\n"
2091 "    char host[NI_MAXHOST];\n"
2092 msgstr ""
2093 "int\n"
2094 "main(int argc, char *argv[])\n"
2095 "{\n"
2096 "    struct ifaddrs *ifaddr, *ifa;\n"
2097 "    int family, s;\n"
2098 "    char host[NI_MAXHOST];\n"
2099
2100 #. type: Plain text
2101 #: build/C/man3/getifaddrs.3:243
2102 #, no-wrap
2103 msgid ""
2104 "    if (getifaddrs(&ifaddr) == -1) {\n"
2105 "        perror(\"getifaddrs\");\n"
2106 "        exit(EXIT_FAILURE);\n"
2107 "    }\n"
2108 msgstr ""
2109 "    if (getifaddrs(&ifaddr) == -1) {\n"
2110 "        perror(\"getifaddrs\");\n"
2111 "        exit(EXIT_FAILURE);\n"
2112 "    }\n"
2113
2114 #. type: Plain text
2115 #: build/C/man3/getifaddrs.3:246
2116 #, no-wrap
2117 msgid ""
2118 "    /* Walk through linked list, maintaining head pointer so we\n"
2119 "       can free list later */\n"
2120 msgstr ""
2121 "    /* Walk through linked list, maintaining head pointer so we\n"
2122 "       can free list later */\n"
2123
2124 #. type: Plain text
2125 #: build/C/man3/getifaddrs.3:250
2126 #, no-wrap
2127 msgid ""
2128 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2129 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2130 "            continue;\n"
2131 msgstr ""
2132 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2133 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2134 "            continue;\n"
2135
2136 #. type: Plain text
2137 #: build/C/man3/getifaddrs.3:252
2138 #, no-wrap
2139 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2140 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2141
2142 #. type: Plain text
2143 #: build/C/man3/getifaddrs.3:255
2144 #, no-wrap
2145 msgid ""
2146 "        /* Display interface name and family (including symbolic\n"
2147 "           form of the latter for the common families) */\n"
2148 msgstr ""
2149 "        /* Display interface name and family (including symbolic\n"
2150 "           form of the latter for the common families) */\n"
2151
2152 #. type: Plain text
2153 #: build/C/man3/getifaddrs.3:261
2154 #, no-wrap
2155 msgid ""
2156 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2157 "                ifa-E<gt>ifa_name, family,\n"
2158 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2159 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2160 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2161 msgstr ""
2162 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2163 "                ifa-E<gt>ifa_name, family,\n"
2164 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2165 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2166 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2167
2168 #. type: Plain text
2169 #: build/C/man3/getifaddrs.3:263
2170 #, no-wrap
2171 msgid "        /* For an AF_INET* interface address, display the address */\n"
2172 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2173
2174 #. type: Plain text
2175 #: build/C/man3/getifaddrs.3:276
2176 #, no-wrap
2177 msgid ""
2178 "        if (family == AF_INET || family == AF_INET6) {\n"
2179 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2180 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2181 "                                          sizeof(struct sockaddr_in6),\n"
2182 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2183 "            if (s != 0) {\n"
2184 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2185 "                exit(EXIT_FAILURE);\n"
2186 "            }\n"
2187 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2188 "        }\n"
2189 "    }\n"
2190 msgstr ""
2191 "        if (family == AF_INET || family == AF_INET6) {\n"
2192 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2193 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2194 "                                          sizeof(struct sockaddr_in6),\n"
2195 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2196 "            if (s != 0) {\n"
2197 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2198 "                exit(EXIT_FAILURE);\n"
2199 "            }\n"
2200 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2201 "        }\n"
2202 "    }\n"
2203
2204 #. type: Plain text
2205 #: build/C/man3/getifaddrs.3:280
2206 #, no-wrap
2207 msgid ""
2208 "    freeifaddrs(ifaddr);\n"
2209 "    exit(EXIT_SUCCESS);\n"
2210 "}\n"
2211 msgstr ""
2212 "    freeifaddrs(ifaddr);\n"
2213 "    exit(EXIT_SUCCESS);\n"
2214 "}\n"
2215
2216 #. type: Plain text
2217 #: build/C/man3/getifaddrs.3:287
2218 msgid ""
2219 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2220 msgstr ""
2221 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2222
2223 #. type: TH
2224 #: build/C/man2/getsockname.2:38
2225 #, no-wrap
2226 msgid "GETSOCKNAME"
2227 msgstr "GETSOCKNAME"
2228
2229 #. type: Plain text
2230 #: build/C/man2/getsockname.2:41
2231 msgid "getsockname - get socket name"
2232 msgstr "getsockname - ソケットの名前を取得する"
2233
2234 #. type: Plain text
2235 #: build/C/man2/getsockname.2:47
2236 #, no-wrap
2237 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2238 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2239
2240 #. type: Plain text
2241 #: build/C/man2/getsockname.2:60
2242 msgid ""
2243 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2244 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2245 "should be initialized to indicate the amount of space (in bytes) pointed to "
2246 "by I<addr>.  On return it contains the actual size of the socket address."
2247 msgstr ""
2248 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2249 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2250 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2251 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2252 "納される。"
2253
2254 #. type: Plain text
2255 #: build/C/man2/getsockname.2:76 build/C/man2/getsockopt.2:140
2256 #: build/C/man2/listen.2:94
2257 msgid "The argument I<sockfd> is not a valid descriptor."
2258 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2259
2260 #. type: Plain text
2261 #: build/C/man2/getsockname.2:82
2262 msgid ""
2263 "The I<addr> argument points to memory not in a valid part of the process "
2264 "address space."
2265 msgstr ""
2266 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2267 "い。"
2268
2269 #. type: Plain text
2270 #: build/C/man2/getsockname.2:86
2271 msgid "I<addrlen> is invalid (e.g., is negative)."
2272 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2273
2274 #. type: TP
2275 #: build/C/man2/getsockname.2:86 build/C/man2/send.2:330
2276 #, no-wrap
2277 msgid "B<ENOBUFS>"
2278 msgstr "B<ENOBUFS>"
2279
2280 #. type: Plain text
2281 #: build/C/man2/getsockname.2:90
2282 msgid ""
2283 "Insufficient resources were available in the system to perform the operation."
2284 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2285
2286 #. type: Plain text
2287 #: build/C/man2/getsockname.2:95 build/C/man2/getsockopt.2:169
2288 msgid "The argument I<sockfd> is a file, not a socket."
2289 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2290
2291 #.  SVr4 documents additional ENOMEM
2292 #.  and ENOSR error codes.
2293 #. type: Plain text
2294 #: build/C/man2/getsockname.2:101
2295 msgid ""
2296 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2297 "POSIX.1-2001."
2298 msgstr ""
2299 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2300
2301 #. type: Plain text
2302 #: build/C/man2/getsockname.2:110
2303 msgid ""
2304 "The third argument of B<getsockname>()  is in reality an I<int *> (and this "
2305 "is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
2306 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
2307 msgstr ""
2308 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2309 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2310 "POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2311
2312 #. type: Plain text
2313 #: build/C/man2/getsockname.2:117
2314 msgid ""
2315 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2316 "(7)"
2317 msgstr ""
2318 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2319 "(7)"
2320
2321 #. type: TH
2322 #: build/C/man2/getsockopt.2:42
2323 #, no-wrap
2324 msgid "GETSOCKOPT"
2325 msgstr "GETSOCKOPT"
2326
2327 #. type: Plain text
2328 #: build/C/man2/getsockopt.2:45
2329 msgid "getsockopt, setsockopt - get and set options on sockets"
2330 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2331
2332 #. type: Plain text
2333 #: build/C/man2/getsockopt.2:55
2334 #, no-wrap
2335 msgid ""
2336 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2337 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2338 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2339 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2340 msgstr ""
2341 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2342 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2343 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2344 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2345
2346 #. type: Plain text
2347 #: build/C/man2/getsockopt.2:65
2348 msgid ""
2349 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2350 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2351 "protocol levels; they are always present at the uppermost socket level."
2352 msgstr ""
2353 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2354 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2355 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2356 "定される。"
2357
2358 #. type: Plain text
2359 #: build/C/man2/getsockopt.2:84
2360 msgid ""
2361 "When manipulating socket options, the level at which the option resides and "
2362 "the name of the option must be specified.  To manipulate options at the "
2363 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2364 "options at any other level the protocol number of the appropriate protocol "
2365 "controlling the option is supplied.  For example, to indicate that an option "
2366 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2367 "protocol number of B<TCP>; see B<getprotoent>(3)."
2368 msgstr ""
2369 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2370 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2371 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2372 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2373 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2374 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2375 "B<getprotoent>(3)  を参照すること。"
2376
2377 #. type: Plain text
2378 #: build/C/man2/getsockopt.2:106
2379 msgid ""
2380 "The arguments I<optval> and I<optlen> are used to access option values for "
2381 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2382 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2383 "I<optlen> is a value-result argument, initially containing the size of the "
2384 "buffer pointed to by I<optval>, and modified on return to indicate the "
2385 "actual size of the value returned.  If no option value is to be supplied or "
2386 "returned, I<optval> may be NULL."
2387 msgstr ""
2388 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2389 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2390 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2391 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2392 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2393 "I<optval> は NULL でも良い。"
2394
2395 #. type: Plain text
2396 #: build/C/man2/getsockopt.2:116
2397 msgid ""
2398 "I<Optname> and any specified options are passed uninterpreted to the "
2399 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2400 "socket.hE<gt>> contains definitions for socket level options, described "
2401 "below.  Options at other protocol levels vary in format and name; consult "
2402 "the appropriate entries in section 4 of the manual."
2403 msgstr ""
2404 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2405 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2406 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2407 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2408 "ること。"
2409
2410 #. type: Plain text
2411 #: build/C/man2/getsockopt.2:125
2412 msgid ""
2413 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2414 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2415 "or zero if the option is to be disabled."
2416 msgstr ""
2417 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2418 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2419 "を指定し、 無効(disable)にするにはゼロを指定する。"
2420
2421 #. type: Plain text
2422 #: build/C/man2/getsockopt.2:129
2423 msgid ""
2424 "For a description of the available socket options see B<socket>(7)  and the "
2425 "appropriate protocol man pages."
2426 msgstr ""
2427 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2428 "ルの man ページを参照のこと。"
2429
2430 #. type: Plain text
2431 #: build/C/man2/getsockopt.2:150
2432 msgid ""
2433 "The address pointed to by I<optval> is not in a valid part of the process "
2434 "address space.  For B<getsockopt>(), this error may also be returned if "
2435 "I<optlen> is not in a valid part of the process address space."
2436 msgstr ""
2437 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2438 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2439 "い場合にもこのエラーが返される。"
2440
2441 #. type: Plain text
2442 #: build/C/man2/getsockopt.2:161
2443 msgid ""
2444 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2445 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2446 "option described in B<ip>(7))."
2447 msgstr ""
2448 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2449 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2450 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2451
2452 #. type: TP
2453 #: build/C/man2/getsockopt.2:161
2454 #, no-wrap
2455 msgid "B<ENOPROTOOPT>"
2456 msgstr "B<ENOPROTOOPT>"
2457
2458 #. type: Plain text
2459 #: build/C/man2/getsockopt.2:164
2460 msgid "The option is unknown at the level indicated."
2461 msgstr "指定された層(level)にはこのオプションは存在しない。"
2462
2463 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2464 #.  not document the
2465 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2466 #.  options
2467 #. type: Plain text
2468 #: build/C/man2/getsockopt.2:176
2469 msgid ""
2470 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2471 msgstr ""
2472 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2473 "POSIX.1-2001."
2474
2475 #. type: Plain text
2476 #: build/C/man2/getsockopt.2:197
2477 msgid ""
2478 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2479 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2480 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2481 "glibc.  See also B<accept>(2)."
2482 msgstr ""
2483 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2484 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2485 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2486 "る。 B<accept>(2)  も参照のこと。"
2487
2488 #. type: Plain text
2489 #: build/C/man2/getsockopt.2:200
2490 msgid ""
2491 "Several of the socket options should be handled at lower levels of the "
2492 "system."
2493 msgstr ""
2494 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2495
2496 #. type: Plain text
2497 #: build/C/man2/getsockopt.2:208
2498 msgid ""
2499 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2500 "B<tcp>(7), B<unix>(7)"
2501 msgstr ""
2502 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2503 "B<tcp>(7), B<unix>(7)"
2504
2505 #. type: TH
2506 #: build/C/man2/listen.2:43
2507 #, no-wrap
2508 msgid "LISTEN"
2509 msgstr "LISTEN"
2510
2511 #. type: TH
2512 #: build/C/man2/listen.2:43
2513 #, no-wrap
2514 msgid "2008-11-20"
2515 msgstr "2008-11-20"
2516
2517 #. type: Plain text
2518 #: build/C/man2/listen.2:46
2519 msgid "listen - listen for connections on a socket"
2520 msgstr "listen - ソケット(socket)上の接続を待つ"
2521
2522 #. type: Plain text
2523 #: build/C/man2/listen.2:53
2524 #, no-wrap
2525 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2526 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2527
2528 #. type: Plain text
2529 #: build/C/man2/listen.2:61
2530 msgid ""
2531 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2532 "that is, as a socket that will be used to accept incoming connection "
2533 "requests using B<accept>(2)."
2534 msgstr ""
2535 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2536 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2537 "した接続要求を受け付けるのに使用されるソケットである。"
2538
2539 #. type: Plain text
2540 #: build/C/man2/listen.2:68
2541 msgid ""
2542 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2543 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2544 msgstr ""
2545 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2546 "するファイルディスクリプタである。"
2547
2548 #. type: Plain text
2549 #: build/C/man2/listen.2:80
2550 msgid ""
2551 "The I<backlog> argument defines the maximum length to which the queue of "
2552 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2553 "when the queue is full, the client may receive an error with an indication "
2554 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2555 "the request may be ignored so that a later reattempt at connection succeeds."
2556 msgstr ""
2557 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2558 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2559 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2560 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2561 "い。"
2562
2563 #. type: Plain text
2564 #: build/C/man2/listen.2:89
2565 msgid "Another socket is already listening on the same port."
2566 msgstr "別のソケットが既に同じポートを listen している。"
2567
2568 #. type: Plain text
2569 #: build/C/man2/listen.2:99 build/C/man2/send.2:349
2570 msgid "The argument I<sockfd> is not a socket."
2571 msgstr "引き数 I<sockfd> はソケットではない。"
2572
2573 #. type: Plain text
2574 #: build/C/man2/listen.2:104
2575 msgid "The socket is not of a type that supports the B<listen>()  operation."
2576 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2577
2578 #. type: Plain text
2579 #: build/C/man2/listen.2:109
2580 msgid ""
2581 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2582 "4.2BSD."
2583 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2584
2585 #. type: Plain text
2586 #: build/C/man2/listen.2:111
2587 msgid "To accept connections, the following steps are performed:"
2588 msgstr "接続を受け付けるには、以下の処理が実行される。"
2589
2590 #. type: TP
2591 #: build/C/man2/listen.2:112 build/C/man2/select_tut.2:345
2592 #, no-wrap
2593 msgid "1."
2594 msgstr "1."
2595
2596 #. type: Plain text
2597 #: build/C/man2/listen.2:115
2598 msgid "A socket is created with B<socket>(2)."
2599 msgstr "B<socket>(2)  でソケットを作成する。"
2600
2601 #. type: TP
2602 #: build/C/man2/listen.2:115 build/C/man2/select_tut.2:354
2603 #, no-wrap
2604 msgid "2."
2605 msgstr "2."
2606
2607 #. type: Plain text
2608 #: build/C/man2/listen.2:121
2609 msgid ""
2610 "The socket is bound to a local address using B<bind>(2), so that other "
2611 "sockets may be B<connect>(2)ed to it."
2612 msgstr ""
2613 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2614 "のソケットに B<connect>(2)  できるようにする。"
2615
2616 #. type: TP
2617 #: build/C/man2/listen.2:121 build/C/man2/select_tut.2:358
2618 #, no-wrap
2619 msgid "3."
2620 msgstr "3."
2621
2622 #. type: Plain text
2623 #: build/C/man2/listen.2:125
2624 msgid ""
2625 "A willingness to accept incoming connections and a queue limit for incoming "
2626 "connections are specified with B<listen>()."
2627 msgstr ""
2628 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2629 "定する。"
2630
2631 #. type: TP
2632 #: build/C/man2/listen.2:125 build/C/man2/select_tut.2:365
2633 #, no-wrap
2634 msgid "4."
2635 msgstr "4."
2636
2637 #. type: Plain text
2638 #: build/C/man2/listen.2:128
2639 msgid "Connections are accepted with B<accept>(2)."
2640 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2641
2642 #. type: Plain text
2643 #: build/C/man2/listen.2:151
2644 msgid ""
2645 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2646 "2.2.  Now it specifies the queue length for I<completely> established "
2647 "sockets waiting to be accepted, instead of the number of incomplete "
2648 "connection requests.  The maximum length of the queue for incomplete sockets "
2649 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2650 "are enabled there is no logical maximum length and this setting is ignored.  "
2651 "See B<tcp>(7)  for more information."
2652 msgstr ""
2653 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2654 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2655 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2656 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2657 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2658 "論理的な最大長は存在せず、この設定は無視される。"
2659
2660 #.  The following is now rather historic information (MTK, Jun 05)
2661 #.  Don't rely on this value in portable applications since BSD
2662 #.  (and some BSD-derived systems) limit the backlog to 5.
2663 #. type: Plain text
2664 #: build/C/man2/listen.2:164
2665 msgid ""
2666 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2667 "somaxconn>, then it is silently truncated to that value; the default value "
2668 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
2669 "value, B<SOMAXCONN>, with the value 128."
2670 msgstr ""
2671 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2672 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2673 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2674 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2675
2676 #. type: Plain text
2677 #: build/C/man2/listen.2:173
2678 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2679 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2680
2681 #. type: TH
2682 #: build/C/man2/recv.2:39
2683 #, no-wrap
2684 msgid "RECV"
2685 msgstr "RECV"
2686
2687 #. type: TH
2688 #: build/C/man2/recv.2:39
2689 #, no-wrap
2690 msgid "2011-09-16"
2691 msgstr "2011-09-16"
2692
2693 #. type: Plain text
2694 #: build/C/man2/recv.2:42
2695 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
2696 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
2697
2698 #. type: Plain text
2699 #: build/C/man2/recv.2:47 build/C/man2/select.2:53
2700 #: build/C/man2/select_tut.2:45
2701 #, no-wrap
2702 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
2703 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
2704
2705 #. type: Plain text
2706 #: build/C/man2/recv.2:51
2707 #, no-wrap
2708 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2709 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2710
2711 #. type: Plain text
2712 #: build/C/man2/recv.2:54
2713 #, no-wrap
2714 msgid ""
2715 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2716 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2717 msgstr ""
2718 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2719 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2720
2721 #. type: Plain text
2722 #: build/C/man2/recv.2:56
2723 #, no-wrap
2724 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2725 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2726
2727 #. type: Plain text
2728 #: build/C/man2/recv.2:64
2729 msgid ""
2730 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
2731 "a socket, and may be used to receive data on a socket whether or not it is "
2732 "connection-oriented."
2733 msgstr ""
2734 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
2735 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
2736 "接続指向 (connection-oriened) であってもなくてもよい。"
2737
2738 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
2739 #.  .I src_addr
2740 #.  is filled in.
2741 #.  .I src_addr
2742 #.  is also filled in for stream sockets in the UNIX domain, but is not
2743 #.  filled in for stream sockets in the Internet domain.)
2744 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
2745 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
2746 #. type: Plain text
2747 #: build/C/man2/recv.2:93
2748 msgid ""
2749 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
2750 "address, this source address is filled in.  When I<src_addr> is NULL, "
2751 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
2752 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
2753 "caller should initialize before the call to the size of the buffer "
2754 "associated with I<src_addr>, and modified on return to indicate the actual "
2755 "size of the source address.  The returned address is truncated if the buffer "
2756 "provided is too small; in this case, I<addrlen> will return a value greater "
2757 "than was supplied to the call."
2758 msgstr ""
2759 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
2760 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
2761 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
2762 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
2763 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
2764 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
2765 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
2766 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
2767 "な値が返される。"
2768
2769 #. type: Plain text
2770 #: build/C/man2/recv.2:105
2771 msgid ""
2772 "The B<recv>()  call is normally used only on a I<connected> socket (see "
2773 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
2774 "argument."
2775 msgstr ""
2776 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
2777 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
2778 "()  と等価である。"
2779
2780 #. type: Plain text
2781 #: build/C/man2/recv.2:111
2782 msgid ""
2783 "All three routines return the length of the message on successful "
2784 "completion.  If a message is too long to fit in the supplied buffer, excess "
2785 "bytes may be discarded depending on the type of socket the message is "
2786 "received from."
2787 msgstr ""
2788 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
2789 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
2790 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
2791
2792 #. type: Plain text
2793 #: build/C/man2/recv.2:121
2794 msgid ""
2795 "If no messages are available at the socket, the receive calls wait for a "
2796 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
2797 "which case the value -1 is returned and the external variable I<errno> is "
2798 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
2799 "data available, up to the requested amount, rather than waiting for receipt "
2800 "of the full amount requested."
2801 msgstr ""
2802 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
2803 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
2804 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
2805 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
2806 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
2807 "る (受信されるデータの最大サイズは要求したサイズである)。"
2808
2809 #. type: Plain text
2810 #: build/C/man2/recv.2:127
2811 msgid ""
2812 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
2813 "data arrives."
2814 msgstr ""
2815 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
2816 "る。"
2817
2818 #. type: Plain text
2819 #: build/C/man2/recv.2:133
2820 msgid ""
2821 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
2822 "the following values:"
2823 msgstr ""
2824 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
2825 "和 を取ったものを指定する:"
2826
2827 #. type: TP
2828 #: build/C/man2/recv.2:133
2829 #, no-wrap
2830 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
2831 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
2832
2833 #. type: Plain text
2834 #: build/C/man2/recv.2:144
2835 msgid ""
2836 "Set the close-on-exec flag for the file descriptor received via a UNIX "
2837 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
2838 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
2839 "flag of B<open>(2)."
2840 msgstr ""
2841 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
2842 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
2843 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
2844 "同じ理由で有用である。"
2845
2846 #. type: TP
2847 #: build/C/man2/recv.2:144 build/C/man2/send.2:186
2848 #, no-wrap
2849 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
2850 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
2851
2852 #. type: Plain text
2853 #: build/C/man2/recv.2:154
2854 msgid ""
2855 "Enables nonblocking operation; if the operation would block, the call fails "
2856 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
2857 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
2858 msgstr ""
2859 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
2860 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
2861 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
2862
2863 #. type: TP
2864 #: build/C/man2/recv.2:154
2865 #, no-wrap
2866 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
2867 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
2868
2869 #. type: Plain text
2870 #: build/C/man2/recv.2:173
2871 msgid ""
2872 "This flag specifies that queued errors should be received from the socket "
2873 "error queue.  The error is passed in an ancillary message with a type "
2874 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
2875 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
2876 "information.  The payload of the original packet that caused the error is "
2877 "passed as normal data via I<msg_iovec>.  The original destination address of "
2878 "the datagram that caused the error is supplied via I<msg_name>."
2879 msgstr ""
2880 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
2881 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
2882 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
2883 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
2884 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
2885 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
2886 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
2887 "I<msg_name> 経由で参照できる。"
2888
2889 #. type: Plain text
2890 #: build/C/man2/recv.2:185 build/C/man2/recv.2:248
2891 msgid ""
2892 "For local errors, no address is passed (this can be checked with the "
2893 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
2894 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
2895 "the pending socket error is regenerated based on the next queued error and "
2896 "will be passed on the next socket operation."
2897 msgstr ""
2898 "ローカルなエラーの場合はアドレスは渡されない\n"
2899 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
2900 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
2901 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
2902 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
2903
2904 #. type: Plain text
2905 #: build/C/man2/recv.2:189
2906 msgid "The error is supplied in a I<sock_extended_err> structure:"
2907 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
2908
2909 #. type: Plain text
2910 #: build/C/man2/recv.2:196
2911 #, no-wrap
2912 msgid ""
2913 "#define SO_EE_ORIGIN_NONE    0\n"
2914 "#define SO_EE_ORIGIN_LOCAL   1\n"
2915 "#define SO_EE_ORIGIN_ICMP    2\n"
2916 "#define SO_EE_ORIGIN_ICMP6   3\n"
2917 msgstr ""
2918 "#define SO_EE_ORIGIN_NONE    0\n"
2919 "#define SO_EE_ORIGIN_LOCAL   1\n"
2920 "#define SO_EE_ORIGIN_ICMP    2\n"
2921 "#define SO_EE_ORIGIN_ICMP6   3\n"
2922
2923 #. type: Plain text
2924 #: build/C/man2/recv.2:208
2925 #, no-wrap
2926 msgid ""
2927 "struct sock_extended_err\n"
2928 "{\n"
2929 "    uint32_t ee_errno;   /* error number */\n"
2930 "    uint8_t  ee_origin;  /* where the error originated */\n"
2931 "    uint8_t  ee_type;    /* type */\n"
2932 "    uint8_t  ee_code;    /* code */\n"
2933 "    uint8_t  ee_pad;     /* padding */\n"
2934 "    uint32_t ee_info;    /* additional information */\n"
2935 "    uint32_t ee_data;    /* other data */\n"
2936 "    /* More data may follow */\n"
2937 "};\n"
2938 msgstr ""
2939 "struct sock_extended_err\n"
2940 "{\n"
2941 "    uint32_t ee_errno;   /* error number */\n"
2942 "    uint8_t  ee_origin;  /* where the error originated */\n"
2943 "    uint8_t  ee_type;    /* type */\n"
2944 "    uint8_t  ee_code;    /* code */\n"
2945 "    uint8_t  ee_pad;     /* padding */\n"
2946 "    uint32_t ee_info;    /* additional information */\n"
2947 "    uint32_t ee_data;    /* other data */\n"
2948 "    /* More data may follow */\n"
2949 "};\n"
2950
2951 #. type: Plain text
2952 #: build/C/man2/recv.2:210
2953 #, no-wrap
2954 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2955 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2956
2957 #. type: Plain text
2958 #: build/C/man2/recv.2:234
2959 msgid ""
2960 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
2961 "is the origin code of where the error originated.  The other fields are "
2962 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
2963 "address of the network object where the error originated from given a "
2964 "pointer to the ancillary message.  If this address is not known, the "
2965 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
2966 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
2967 "caused the error is passed as normal data."
2968 msgstr ""
2969 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
2970 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
2971 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
2972 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
2973 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
2974 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
2975 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
2976 "される。"
2977
2978 #. type: TP
2979 #: build/C/man2/recv.2:248 build/C/man2/recv.2:379 build/C/man2/send.2:228
2980 #, no-wrap
2981 msgid "B<MSG_OOB>"
2982 msgstr "B<MSG_OOB>"
2983
2984 #. type: Plain text
2985 #: build/C/man2/recv.2:255
2986 msgid ""
2987 "This flag requests receipt of out-of-band data that would not be received in "
2988 "the normal data stream.  Some protocols place expedited data at the head of "
2989 "the normal data queue, and thus this flag cannot be used with such protocols."
2990 msgstr ""
2991 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
2992 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
2993 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
2994 "い。"
2995
2996 #. type: TP
2997 #: build/C/man2/recv.2:255
2998 #, no-wrap
2999 msgid "B<MSG_PEEK>"
3000 msgstr "B<MSG_PEEK>"
3001
3002 #. type: Plain text
3003 #: build/C/man2/recv.2:262
3004 msgid ""
3005 "This flag causes the receive operation to return data from the beginning of "
3006 "the receive queue without removing that data from the queue.  Thus, a "
3007 "subsequent receive call will return the same data."
3008 msgstr ""
3009 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
3010 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
3011 "が返ることになる。"
3012
3013 #. type: TP
3014 #: build/C/man2/recv.2:262
3015 #, no-wrap
3016 msgid "B<MSG_TRUNC> (since Linux 2.2)"
3017 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
3018
3019 #. type: Plain text
3020 #: build/C/man2/recv.2:273
3021 msgid ""
3022 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), and "
3023 "netlink (since Linux 2.6.22) sockets: return the real length of the packet "
3024 "or datagram, even when it was longer than the passed buffer.  Not "
3025 "implemented for UNIX domain (B<unix>(7))  sockets."
3026 msgstr ""
3027 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
3028 "以降)、 netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの"
3029 "長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長"
3030 "さを返す。 UNIX ドメインソケット (B<unix>(7))  ソケットについては実装されてい"
3031 "ない。"
3032
3033 #. type: Plain text
3034 #: build/C/man2/recv.2:276
3035 msgid "For use with Internet stream sockets, see B<tcp>(7)."
3036 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
3037
3038 #. type: TP
3039 #: build/C/man2/recv.2:276
3040 #, no-wrap
3041 msgid "B<MSG_WAITALL> (since Linux 2.2)"
3042 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
3043
3044 #. type: Plain text
3045 #: build/C/man2/recv.2:283
3046 msgid ""
3047 "This flag requests that the operation block until the full request is "
3048 "satisfied.  However, the call may still return less data than requested if a "
3049 "signal is caught, an error or disconnect occurs, or the next data to be "
3050 "received is of a different type than that returned."
3051 msgstr ""
3052 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3053 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3054 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3055 "りデータが少なくても返ることがある。"
3056
3057 #. type: Plain text
3058 #: build/C/man2/recv.2:291
3059 msgid ""
3060 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3061 "directly supplied arguments.  This structure is defined as follows in "
3062 "I<E<lt>sys/socket.hE<gt>>:"
3063 msgstr ""
3064 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3065 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3066
3067 #. type: Plain text
3068 #: build/C/man2/recv.2:298
3069 #, no-wrap
3070 msgid ""
3071 "struct iovec {                    /* Scatter/gather array items */\n"
3072 "    void  *iov_base;              /* Starting address */\n"
3073 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3074 "};\n"
3075 msgstr ""
3076 "struct iovec {                    /* Scatter/gather array items */\n"
3077 "    void  *iov_base;              /* Starting address */\n"
3078 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3079 "};\n"
3080
3081 #. type: Plain text
3082 #: build/C/man2/recv.2:308 build/C/man2/send.2:256
3083 #, no-wrap
3084 msgid ""
3085 "struct msghdr {\n"
3086 "    void         *msg_name;       /* optional address */\n"
3087 "    socklen_t     msg_namelen;    /* size of address */\n"
3088 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3089 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3090 "    void         *msg_control;    /* ancillary data, see below */\n"
3091 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3092 "    int           msg_flags;      /* flags on received message */\n"
3093 "};\n"
3094 msgstr ""
3095 "struct msghdr {\n"
3096 "    void         *msg_name;       /* 追加のアドレス */\n"
3097 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3098 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3099 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3100 "    void         *msg_control;    /* 補助データ (後述) */\n"
3101 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3102 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3103 "};\n"
3104
3105 #. type: Plain text
3106 #: build/C/man2/recv.2:338
3107 msgid ""
3108 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3109 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3110 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3111 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3112 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3113 "other protocol control-related messages or miscellaneous ancillary data.  "
3114 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3115 "the available buffer in I<msg_control>; upon return from a successful call "
3116 "it will contain the length of the control message sequence."
3117 msgstr ""
3118 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3119 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3120 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3121 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3122 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3123 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3124 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3125 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3126 "さが入っている。"
3127
3128 #. type: Plain text
3129 #: build/C/man2/recv.2:340
3130 msgid "The messages are of the form:"
3131 msgstr "メッセージの形式は以下の通り:"
3132
3133 #. type: Plain text
3134 #: build/C/man2/recv.2:350
3135 #, no-wrap
3136 msgid ""
3137 "struct cmsghdr {\n"
3138 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3139 "    int           cmsg_level;   /* originating protocol */\n"
3140 "    int           cmsg_type;    /* protocol-specific type */\n"
3141 "/* followed by\n"
3142 "    unsigned char cmsg_data[]; */\n"
3143 "};\n"
3144 msgstr ""
3145 "struct cmsghdr {\n"
3146 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3147 "    int           cmsg_level;   /* originating protocol */\n"
3148 "    int           cmsg_type;    /* protocol-specific type */\n"
3149 "/* followed by\n"
3150 "    unsigned char cmsg_data[]; */\n"
3151 "};\n"
3152
3153 #. type: Plain text
3154 #: build/C/man2/recv.2:355
3155 msgid ""
3156 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3157 msgstr ""
3158 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3159
3160 #. type: Plain text
3161 #: build/C/man2/recv.2:358
3162 msgid ""
3163 "As an example, Linux uses this ancillary data mechanism to pass extended "
3164 "errors, IP options, or file descriptors over UNIX domain sockets."
3165 msgstr ""
3166 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3167 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3168 "いる。"
3169
3170 #. type: Plain text
3171 #: build/C/man2/recv.2:366
3172 msgid ""
3173 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3174 "It can contain several flags:"
3175 msgstr ""
3176 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3177 "れる。ここにはいくつかのフラグが入る。"
3178
3179 #. type: TP
3180 #: build/C/man2/recv.2:366
3181 #, no-wrap
3182 msgid "B<MSG_EOR>"
3183 msgstr "B<MSG_EOR>"
3184
3185 #. type: Plain text
3186 #: build/C/man2/recv.2:371
3187 msgid ""
3188 "indicates end-of-record; the data returned completed a record (generally "
3189 "used with sockets of type B<SOCK_SEQPACKET>)."
3190 msgstr ""
3191 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3192 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3193
3194 #. type: TP
3195 #: build/C/man2/recv.2:371
3196 #, no-wrap
3197 msgid "B<MSG_TRUNC>"
3198 msgstr "B<MSG_TRUNC>"
3199
3200 #. type: Plain text
3201 #: build/C/man2/recv.2:375
3202 msgid ""
3203 "indicates that the trailing portion of a datagram was discarded because the "
3204 "datagram was larger than the buffer supplied."
3205 msgstr ""
3206 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3207 "た部分が捨てられたことを示す。"
3208
3209 #. type: TP
3210 #: build/C/man2/recv.2:375
3211 #, no-wrap
3212 msgid "B<MSG_CTRUNC>"
3213 msgstr "B<MSG_CTRUNC>"
3214
3215 #. type: Plain text
3216 #: build/C/man2/recv.2:379
3217 msgid ""
3218 "indicates that some control data were discarded due to lack of space in the "
3219 "buffer for ancillary data."
3220 msgstr ""
3221 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3222 "を示す。"
3223
3224 #. type: Plain text
3225 #: build/C/man2/recv.2:382
3226 msgid ""
3227 "is returned to indicate that expedited or out-of-band data were received."
3228 msgstr "速達データや帯域外データを受信したことを示す。"
3229
3230 #. type: TP
3231 #: build/C/man2/recv.2:382
3232 #, no-wrap
3233 msgid "B<MSG_ERRQUEUE>"
3234 msgstr "B<MSG_ERRQUEUE>"
3235
3236 #. type: Plain text
3237 #: build/C/man2/recv.2:386
3238 msgid ""
3239 "indicates that no data was received but an extended error from the socket "
3240 "error queue."
3241 msgstr ""
3242 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3243 "を示す。"
3244
3245 #. type: Plain text
3246 #: build/C/man2/recv.2:391
3247 msgid ""
3248 "These calls return the number of bytes received, or -1 if an error "
3249 "occurred.  The return value will be 0 when the peer has performed an orderly "
3250 "shutdown."
3251 msgstr ""
3252 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3253 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3254
3255 #. type: Plain text
3256 #: build/C/man2/recv.2:396
3257 msgid ""
3258 "These are some standard errors generated by the socket layer.  Additional "
3259 "errors may be generated and returned from the underlying protocol modules; "
3260 "see their manual pages."
3261 msgstr ""
3262 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3263 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3264 "ること。"
3265
3266 #.  Actually EAGAIN on Linux
3267 #. type: Plain text
3268 #: build/C/man2/recv.2:405
3269 msgid ""
3270 "The socket is marked nonblocking and the receive operation would block, or a "
3271 "receive timeout had been set and the timeout expired before data was "
3272 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3273 "and does not require these constants to have the same value, so a portable "
3274 "application should check for both possibilities."
3275 msgstr ""
3276 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3277 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3278 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3279 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3280 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3281
3282 #. type: Plain text
3283 #: build/C/man2/recv.2:410
3284 msgid "The argument I<sockfd> is an invalid descriptor."
3285 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3286
3287 #. type: Plain text
3288 #: build/C/man2/recv.2:414
3289 msgid ""
3290 "A remote host refused to allow the network connection (typically because it "
3291 "is not running the requested service)."
3292 msgstr ""
3293 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3294 "たサービスが起動されていないなどがある)。"
3295
3296 #. type: Plain text
3297 #: build/C/man2/recv.2:418
3298 msgid ""
3299 "The receive buffer pointer(s) point outside the process's address space."
3300 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3301
3302 #. type: Plain text
3303 #: build/C/man2/recv.2:423
3304 msgid ""
3305 "The receive was interrupted by delivery of a signal before any data were "
3306 "available; see B<signal>(7)."
3307 msgstr ""
3308 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3309
3310 #. type: Plain text
3311 #: build/C/man2/recv.2:427 build/C/man2/send.2:318
3312 msgid "Invalid argument passed."
3313 msgstr "不正な引き数が渡された。"
3314
3315 #. type: Plain text
3316 #: build/C/man2/recv.2:431
3317 msgid "Could not allocate memory for B<recvmsg>()."
3318 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3319
3320 #. type: TP
3321 #: build/C/man2/recv.2:431 build/C/man2/send.2:341
3322 #, no-wrap
3323 msgid "B<ENOTCONN>"
3324 msgstr "B<ENOTCONN>"
3325
3326 #. type: Plain text
3327 #: build/C/man2/recv.2:438
3328 msgid ""
3329 "The socket is associated with a connection-oriented protocol and has not "
3330 "been connected (see B<connect>(2)  and B<accept>(2))."
3331 msgstr ""
3332 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3333 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3334
3335 #. type: Plain text
3336 #: build/C/man2/recv.2:443
3337 msgid "The argument I<sockfd> does not refer to a socket."
3338 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3339
3340 #. type: Plain text
3341 #: build/C/man2/recv.2:446
3342 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3343 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3344
3345 #. type: Plain text
3346 #: build/C/man2/recv.2:453
3347 msgid ""
3348 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3349 "flags."
3350 msgstr ""
3351 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3352 "されている。"
3353
3354 #. type: Plain text
3355 #: build/C/man2/recv.2:469
3356 msgid ""
3357 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3358 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3359 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3360 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3361 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3362 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3363 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3364 msgstr ""
3365 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3366 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3367 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3368 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3369 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3370 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3371 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3372
3373 #.  glibc bug raised 12 Mar 2006
3374 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3375 #.  The problem is an underlying kernel issue: the size of the
3376 #.  __kernel_size_t type used to type this field varies
3377 #.  across architectures, but socklen_t is always 32 bits.
3378 #. type: Plain text
3379 #: build/C/man2/recv.2:483 build/C/man2/send.2:404
3380 msgid ""
3381 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3382 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3383 "I<size_t>."
3384 msgstr ""
3385 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3386 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3387 "ある。"
3388
3389 #. type: Plain text
3390 #: build/C/man2/recv.2:488
3391 msgid ""
3392 "See B<recvmmsg(2)> for information about a Linux-specific system call that "
3393 "can be used to receive multiple datagrams in a single call."
3394 msgstr ""
3395 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3396 "固有の システムコールに関する情報が書かれている。"
3397
3398 #. type: Plain text
3399 #: build/C/man2/recv.2:493
3400 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3401 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3402
3403 #. type: Plain text
3404 #: build/C/man2/recv.2:504
3405 msgid ""
3406 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3407 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3408 msgstr ""
3409 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3410 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3411
3412 #. type: TH
3413 #: build/C/man2/recvmmsg.2:26
3414 #, no-wrap
3415 msgid "RECVMMSG"
3416 msgstr "RECVMMSG"
3417
3418 #. type: TH
3419 #: build/C/man2/recvmmsg.2:26
3420 #, no-wrap
3421 msgid "2011-10-04"
3422 msgstr "2011-10-04"
3423
3424 #. type: Plain text
3425 #: build/C/man2/recvmmsg.2:29
3426 msgid "recvmmsg - receive multiple messages on a socket"
3427 msgstr "recvmmsg - receive multiple messages on a socket"
3428
3429 #. type: Plain text
3430 #: build/C/man2/recvmmsg.2:33 build/C/man2/sendmmsg.2:35
3431 #, no-wrap
3432 msgid ""
3433 "B<#define _GNU_SOURCE>\n"
3434 "B<#include E<lt>sys/socket.hE<gt>>\n"
3435 msgstr ""
3436 "B<#define _GNU_SOURCE>\n"
3437 "B<#include E<lt>sys/socket.hE<gt>>\n"
3438
3439 #. type: Plain text
3440 #: build/C/man2/recvmmsg.2:36
3441 #, no-wrap
3442 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3443 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3444
3445 #. type: Plain text
3446 #: build/C/man2/recvmmsg.2:38
3447 #, no-wrap
3448 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3449 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3450
3451 #. type: Plain text
3452 #: build/C/man2/recvmmsg.2:50
3453 msgid ""
3454 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3455 "the caller to receive multiple messages from a socket using a single system "
3456 "call.  (This has performance benefits for some applications.)  A further "
3457 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3458 "operation."
3459 msgstr ""
3460 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3461 "the caller to receive multiple messages from a socket using a single system "
3462 "call.  (This has performance benefits for some applications.)  A further "
3463 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3464 "operation."
3465
3466 #. type: Plain text
3467 #: build/C/man2/recvmmsg.2:54
3468 msgid ""
3469 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3470 "from."
3471 msgstr ""
3472 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3473 "from."
3474
3475 #. type: Plain text
3476 #: build/C/man2/recvmmsg.2:62 build/C/man2/sendmmsg.2:62
3477 msgid ""
3478 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3479 "The size of this array is specified in I<vlen>."
3480 msgstr ""
3481 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3482 "The size of this array is specified in I<vlen>."
3483
3484 #. type: Plain text
3485 #: build/C/man2/recvmmsg.2:68 build/C/man2/sendmmsg.2:68
3486 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3487 msgstr "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3488
3489 #. type: Plain text
3490 #: build/C/man2/recvmmsg.2:75
3491 #, no-wrap
3492 msgid ""
3493 "struct mmsghdr {\n"
3494 "    struct msghdr msg_hdr;  /* Message header */\n"
3495 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3496 "};\n"
3497 msgstr ""
3498 "struct mmsghdr {\n"
3499 "    struct msghdr msg_hdr;  /* Message header */\n"
3500 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3501 "};\n"
3502
3503 #. type: Plain text
3504 #: build/C/man2/recvmmsg.2:90
3505 msgid ""
3506 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3507 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3508 "in the entry.  This field has the same value as the return value of a single "
3509 "B<recvmsg>(2)  on the header."
3510 msgstr ""
3511 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3512 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3513 "in the entry.  This field has the same value as the return value of a single "
3514 "B<recvmsg>(2)  on the header."
3515
3516 #. type: Plain text
3517 #: build/C/man2/recvmmsg.2:97
3518 msgid ""
3519 "The I<flags> argument contains flags ORed together.  The flags are the same "
3520 "as documented for B<recvmsg>(2), with the following addition:"
3521 msgstr ""
3522 "The I<flags> argument contains flags ORed together.  The flags are the same "
3523 "as documented for B<recvmsg>(2), with the following addition:"
3524
3525 #. type: TP
3526 #: build/C/man2/recvmmsg.2:97
3527 #, no-wrap
3528 msgid "B<MSG_WAITFORONE>"
3529 msgstr "B<MSG_WAITFORONE>"
3530
3531 #. type: Plain text
3532 #: build/C/man2/recvmmsg.2:102
3533 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3534 msgstr "Turns on B<MSG_DONTWAIT> after the first message has been received."
3535
3536 #. type: Plain text
3537 #: build/C/man2/recvmmsg.2:115
3538 msgid ""
3539 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3540 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3541 "operation.  If I<timeout> is I<NULL> then the operation blocks indefinitely."
3542 msgstr ""
3543 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3544 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3545 "operation.  If I<timeout> is I<NULL> then the operation blocks indefinitely."
3546
3547 #. type: Plain text
3548 #: build/C/man2/recvmmsg.2:126
3549 msgid ""
3550 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3551 "received or until the timeout expires.  A nonblocking call reads as many "
3552 "messages as are available (up to the limit specified by I<vlen>)  and "
3553 "returns immediately."
3554 msgstr ""
3555 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3556 "received or until the timeout expires.  A nonblocking call reads as many "
3557 "messages as are available (up to the limit specified by I<vlen>)  and "
3558 "returns immediately."
3559
3560 #. type: Plain text
3561 #: build/C/man2/recvmmsg.2:141
3562 msgid ""
3563 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3564 "to contain information about each received message: I<msg_len> contains the "
3565 "size of the received message; the subfields of I<msg_hdr> are updated as "
3566 "described in B<recvmsg>(2).  The return value of the call indicates the "
3567 "number of elements of I<msgvec> that have been updated."
3568 msgstr ""
3569 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3570 "to contain information about each received message: I<msg_len> contains the "
3571 "size of the received message; the subfields of I<msg_hdr> are updated as "
3572 "described in B<recvmsg>(2).  The return value of the call indicates the "
3573 "number of elements of I<msgvec> that have been updated."
3574
3575 #. type: Plain text
3576 #: build/C/man2/recvmmsg.2:149
3577 msgid ""
3578 "On success, B<recvmmsg>()  returns the number of messages received in "
3579 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3580 "error."
3581 msgstr ""
3582 "On success, B<recvmmsg>()  returns the number of messages received in "
3583 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3584 "error."
3585
3586 #. type: Plain text
3587 #: build/C/man2/recvmmsg.2:153
3588 msgid ""
3589 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3590 msgstr ""
3591 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3592
3593 #. type: Plain text
3594 #: build/C/man2/recvmmsg.2:157
3595 msgid "I<timeout> is invalid."
3596 msgstr "I<timeout> is invalid."
3597
3598 #. type: Plain text
3599 #: build/C/man2/recvmmsg.2:162
3600 msgid ""
3601 "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in glibc "
3602 "was added in version 2.12."
3603 msgstr ""
3604 "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in glibc "
3605 "was added in version 2.12."
3606
3607 #. type: Plain text
3608 #: build/C/man2/recvmmsg.2:165
3609 msgid "B<recvmmsg>()  is Linux-specific."
3610 msgstr "B<recvmmsg>()  is Linux-specific."
3611
3612 #. type: Plain text
3613 #: build/C/man2/recvmmsg.2:172
3614 msgid ""
3615 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3616 "(2), B<socket>(7)"
3617 msgstr ""
3618 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3619 "(2), B<socket>(7)"
3620
3621 #. type: TH
3622 #: build/C/man2/select.2:38
3623 #, no-wrap
3624 msgid "SELECT"
3625 msgstr "SELECT"
3626
3627 #. type: TH
3628 #: build/C/man2/select.2:38
3629 #, no-wrap
3630 msgid "2010-08-31"
3631 msgstr "2010-08-31"
3632
3633 #. type: Plain text
3634 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:34
3635 msgid ""
3636 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
3637 "multiplexing"
3638 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
3639
3640 #. type: Plain text
3641 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:37
3642 #, no-wrap
3643 msgid "/* According to POSIX.1-2001 */\n"
3644 msgstr "/* POSIX.1-2001 に従う場合 */\n"
3645
3646 #. type: Plain text
3647 #: build/C/man2/select.2:47 build/C/man2/select.2:68
3648 #: build/C/man2/select_tut.2:39 build/C/man2/select_tut.2:60
3649 #, no-wrap
3650 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
3651 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
3652
3653 #. type: Plain text
3654 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:41
3655 #, no-wrap
3656 msgid "/* According to earlier standards */\n"
3657 msgstr "/* 以前の規格に従う場合 */\n"
3658
3659 #. type: Plain text
3660 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:43
3661 #, no-wrap
3662 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
3663 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
3664
3665 #. type: Plain text
3666 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:47
3667 #, no-wrap
3668 msgid "B<#include E<lt>unistd.hE<gt>>\n"
3669 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
3670
3671 #. type: Plain text
3672 #: build/C/man2/select.2:58
3673 #, no-wrap
3674 msgid ""
3675 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3676 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3677 msgstr ""
3678 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3679 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3680
3681 #. type: Plain text
3682 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:52
3683 #, no-wrap
3684 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3685 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3686
3687 #. type: Plain text
3688 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:54
3689 #, no-wrap
3690 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3691 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3692
3693 #. type: Plain text
3694 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:56
3695 #, no-wrap
3696 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3697 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3698
3699 #. type: Plain text
3700 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:58
3701 #, no-wrap
3702 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3703 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3704
3705 #. type: Plain text
3706 #: build/C/man2/select.2:72
3707 #, no-wrap
3708 msgid ""
3709 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3710 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3711 "B<            const sigset_t *>I<sigmask>B<);>\n"
3712 msgstr ""
3713 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3714 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3715 "B<            const sigset_t *>I<sigmask>B<);>\n"
3716
3717 #. type: Plain text
3718 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:69
3719 #: build/C/man3/sockatmark.3:34
3720 msgid ""
3721 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3722 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3723
3724 #. type: Plain text
3725 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:73
3726 msgid ""
3727 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3728 "600"
3729 msgstr ""
3730 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3731 "600"
3732
3733 #. type: Plain text
3734 #: build/C/man2/select.2:92
3735 msgid ""
3736 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
3737 "descriptors, waiting until one or more of the file descriptors become \"ready"
3738 "\" for some class of I/O operation (e.g., input possible).  A file "
3739 "descriptor is considered ready if it is possible to perform the "
3740 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
3741 msgstr ""
3742 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
3743 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
3744 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
3745 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
3746 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
3747 "意味する。"
3748
3749 #. type: Plain text
3750 #: build/C/man2/select.2:98
3751 msgid ""
3752 "The operation of B<select>()  and B<pselect>()  is identical, with three "
3753 "differences:"
3754 msgstr ""
3755 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
3756
3757 #. type: TP
3758 #: build/C/man2/select.2:98
3759 #, no-wrap
3760 msgid "(i)"
3761 msgstr "(i)"
3762
3763 #. type: Plain text
3764 #: build/C/man2/select.2:108
3765 msgid ""
3766 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
3767 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
3768 "and nanoseconds)."
3769 msgstr ""
3770 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
3771 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
3772 "timespec> (秒・ナノ秒単位) を用いる。"
3773
3774 #. type: TP
3775 #: build/C/man2/select.2:108
3776 #, no-wrap
3777 msgid "(ii)"
3778 msgstr "(ii)"
3779
3780 #. type: Plain text
3781 #: build/C/man2/select.2:116
3782 msgid ""
3783 "B<select>()  may update the I<timeout> argument to indicate how much time "
3784 "was left.  B<pselect>()  does not change this argument."
3785 msgstr ""
3786 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
3787 "B<pselect>()  はこの引き数を変更しない。"
3788
3789 #. type: TP
3790 #: build/C/man2/select.2:116
3791 #, no-wrap
3792 msgid "(iii)"
3793 msgstr "(iii)"
3794
3795 #. type: Plain text
3796 #: build/C/man2/select.2:125
3797 msgid ""
3798 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
3799 "with NULL I<sigmask>."
3800 msgstr ""
3801 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
3802 "指定した場合の B<pselect>()  と同じである。"
3803
3804 #. type: Plain text
3805 #: build/C/man2/select.2:143
3806 msgid ""
3807 "Three independent sets of file descriptors are watched.  Those listed in "
3808 "I<readfds> will be watched to see if characters become available for reading "
3809 "(more precisely, to see if a read will not block; in particular, a file "
3810 "descriptor is also ready on end-of-file), those in I<writefds> will be "
3811 "watched to see if a write will not block, and those in I<exceptfds> will be "
3812 "watched for exceptions.  On exit, the sets are modified in place to indicate "
3813 "which file descriptors actually changed status.  Each of the three file "
3814 "descriptor sets may be specified as NULL if no file descriptors are to be "
3815 "watched for the corresponding class of events."
3816 msgstr ""
3817 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
3818 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
3819 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
3820 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
3821 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
3822 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
3823 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
3824 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
3825 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
3826 "指定することができる。"
3827
3828 #. type: Plain text
3829 #: build/C/man2/select.2:156
3830 msgid ""
3831 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
3832 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
3833 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
3834 "part of the set; this is useful after B<select>()  returns."
3835 msgstr ""
3836 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
3837 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
3838 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
3839 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
3840 "る。"
3841
3842 #. type: Plain text
3843 #: build/C/man2/select.2:159
3844 msgid ""
3845 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
3846 "plus 1."
3847 msgstr ""
3848 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
3849 "のである。"
3850
3851 #. type: Plain text
3852 #: build/C/man2/select.2:175
3853 msgid ""
3854 "I<timeout> is an upper bound on the amount of time elapsed before B<select>"
3855 "()  returns.  If both fields of the I<timeval> structure are zero, then "
3856 "B<select>()  returns immediately.  (This is useful for polling.)  If "
3857 "I<timeout> is NULL (no timeout), B<select>()  can block indefinitely."
3858 msgstr ""
3859 "I<timeout> は B<select>()  が復帰するまでの経過時間の上限である。 I<timeval> "
3860 "構造体の両方のフィールドが 0 の場合、 B<select>()  はすぐに復帰する (この機能"
3861 "はポーリング (polling) を行うのに便利である)。 I<timeout> に NULL (タイムアウ"
3862 "トなし)  が指定されると、 B<select>()  は無期限に停止 (block) する。"
3863
3864 #. type: Plain text
3865 #: build/C/man2/select.2:185
3866 msgid ""
3867 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
3868 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
3869 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
3870 "restores the original signal mask."
3871 msgstr ""
3872 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
3873 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
3874 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
3875 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
3876
3877 #. type: Plain text
3878 #: build/C/man2/select.2:191
3879 msgid ""
3880 "Other than the difference in the precision of the I<timeout> argument, the "
3881 "following B<pselect>()  call:"
3882 msgstr ""
3883 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
3884
3885 #. type: Plain text
3886 #: build/C/man2/select.2:195
3887 #, no-wrap
3888 msgid ""
3889 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3890 "                    timeout, &sigmask);\n"
3891 msgstr ""
3892 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3893 "                    timeout, &sigmask);\n"
3894
3895 #. type: Plain text
3896 #: build/C/man2/select.2:200
3897 msgid "is equivalent to I<atomically> executing the following calls:"
3898 msgstr "次のコールを I<atomic> に実行するのと等価である。"
3899
3900 #. type: Plain text
3901 #: build/C/man2/select.2:203
3902 #, no-wrap
3903 msgid "    sigset_t origmask;\n"
3904 msgstr "    sigset_t origmask;\n"
3905
3906 #. type: Plain text
3907 #: build/C/man2/select.2:207
3908 #, no-wrap
3909 msgid ""
3910 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3911 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3912 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3913 msgstr ""
3914 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3915 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3916 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3917
3918 #. type: Plain text
3919 #: build/C/man2/select.2:228
3920 msgid ""
3921 "The reason that B<pselect>()  is needed is that if one wants to wait for "
3922 "either a signal or for a file descriptor to become ready, then an atomic "
3923 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
3924 "a global flag and returns.  Then a test of this global flag followed by a "
3925 "call of B<select>()  could hang indefinitely if the signal arrived just "
3926 "after the test but just before the call.  By contrast, B<pselect>()  allows "
3927 "one to first block signals, handle the signals that have come in, then call "
3928 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
3929 msgstr ""
3930 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
3931 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
3932 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
3933 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
3934 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
3935 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
3936 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
3937 "で、前記の競合を避けることができる。)"
3938
3939 #. type: SS
3940 #: build/C/man2/select.2:228
3941 #, no-wrap
3942 msgid "The timeout"
3943 msgstr "タイムアウト"
3944
3945 #. type: Plain text
3946 #: build/C/man2/select.2:232
3947 msgid ""
3948 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
3949 "like"
3950 msgstr ""
3951 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
3952
3953 #. type: Plain text
3954 #: build/C/man2/select.2:239
3955 #, no-wrap
3956 msgid ""
3957 "struct timeval {\n"
3958 "    long    tv_sec;         /* seconds */\n"
3959 "    long    tv_usec;        /* microseconds */\n"
3960 "};\n"
3961 msgstr ""
3962 "struct timeval {\n"
3963 "    long    tv_sec;         /* 秒 */\n"
3964 "    long    tv_usec;        /* マイクロ秒 */\n"
3965 "};\n"
3966
3967 #. type: Plain text
3968 #: build/C/man2/select.2:243
3969 msgid "and"
3970 msgstr "や"
3971
3972 #. type: Plain text
3973 #: build/C/man2/select.2:250
3974 #, no-wrap
3975 msgid ""
3976 "struct timespec {\n"
3977 "    long    tv_sec;         /* seconds */\n"
3978 "    long    tv_nsec;        /* nanoseconds */\n"
3979 "};\n"
3980 msgstr ""
3981 "struct timespec {\n"
3982 "    long    tv_sec;         /* 秒 */\n"
3983 "    long    tv_nsec;        /* ナノ秒 */\n"
3984 "};\n"
3985
3986 #. type: Plain text
3987 #: build/C/man2/select.2:254
3988 msgid "(However, see below on the POSIX.1-2001 versions.)"
3989 msgstr ""
3990 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
3991 "照)"
3992
3993 #. type: Plain text
3994 #: build/C/man2/select.2:262
3995 msgid ""
3996 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
3997 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
3998 "precision."
3999 msgstr ""
4000 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
4001 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
4002 "呼び出すという方法を使っているコードもある。"
4003
4004 #.  .PP - it is rumored that:
4005 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
4006 #.  - it is certainly true that:
4007 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
4008 #. type: Plain text
4009 #: build/C/man2/select.2:285
4010 msgid ""
4011 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
4012 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
4013 "either behavior.)  This causes problems both when Linux code which reads "
4014 "I<timeout> is ported to other operating systems, and when code is ported to "
4015 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
4016 "without reinitializing it.  Consider I<timeout> to be undefined after "
4017 "B<select>()  returns."
4018 msgstr ""
4019 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
4020 "うになっているが、 他のほとんどの実装ではこのようになっていない "
4021 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
4022 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
4023 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
4024 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
4025 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
4026 "ある。"
4027
4028 #. type: Plain text
4029 #: build/C/man2/select.2:302
4030 msgid ""
4031 "On success, B<select>()  and B<pselect>()  return the number of file "
4032 "descriptors contained in the three returned descriptor sets (that is, the "
4033 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
4034 "which may be zero if the timeout expires before anything interesting "
4035 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
4036 "sets and I<timeout> become undefined, so do not rely on their contents after "
4037 "an error."
4038 msgstr ""
4039 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
4040 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
4041 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
4042 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
4043 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
4044 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
4045
4046 #. type: Plain text
4047 #: build/C/man2/select.2:308
4048 msgid ""
4049 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
4050 "descriptor that was already closed, or one on which an error has occurred.)"
4051 msgstr ""
4052 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
4053 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
4054 "タが指定された)。"
4055
4056 #. type: Plain text
4057 #: build/C/man2/select.2:312
4058 msgid "A signal was caught; see B<signal>(7)."
4059 msgstr "シグナルを受信した。"
4060
4061 #. type: Plain text
4062 #: build/C/man2/select.2:318
4063 msgid ""
4064 "I<nfds> is negative or the value contained within I<timeout> is invalid."
4065 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
4066
4067 #. type: Plain text
4068 #: build/C/man2/select.2:321
4069 msgid "unable to allocate memory for internal tables."
4070 msgstr "内部テーブルにメモリを割り当てることができなかった。"
4071
4072 #. type: Plain text
4073 #: build/C/man2/select.2:327
4074 msgid ""
4075 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
4076 "()  was emulated in glibc (but see BUGS)."
4077 msgstr ""
4078 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
4079 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
4080
4081 #. type: Plain text
4082 #: build/C/man2/select.2:338
4083 msgid ""
4084 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4085 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4086 "clones of the BSD socket layer (including System V variants).  However, note "
4087 "that the System V variant typically sets the timeout variable before exit, "
4088 "but the BSD variant does not."
4089 msgstr ""
4090 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4091 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4092 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4093 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4094 "ること。"
4095
4096 #. type: Plain text
4097 #: build/C/man2/select.2:342
4098 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4099 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4100
4101 #. type: Plain text
4102 #: build/C/man2/select.2:359
4103 msgid ""
4104 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4105 "with a value of I<fd> that is negative or is equal to or larger than "
4106 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4107 "I<fd> to be a valid file descriptor."
4108 msgstr ""
4109 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4110 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4111 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4112 "プタでなければならないと規定されている。"
4113
4114 #. type: Plain text
4115 #: build/C/man2/select.2:368
4116 msgid ""
4117 "Concerning the types involved, the classical situation is that the two "
4118 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4119 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4120 "situation is"
4121 msgstr ""
4122 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4123 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4124 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4125
4126 #. type: Plain text
4127 #: build/C/man2/select.2:375
4128 #, no-wrap
4129 msgid ""
4130 "struct timeval {\n"
4131 "    time_t         tv_sec;     /* seconds */\n"
4132 "    suseconds_t    tv_usec;    /* microseconds */\n"
4133 "};\n"
4134 msgstr ""
4135 "struct timeval {\n"
4136 "\t time_t         tv_sec;     /* 秒 */\n"
4137 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4138 "};\n"
4139
4140 #. type: Plain text
4141 #: build/C/man2/select.2:386
4142 msgid ""
4143 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4144 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4145 msgstr ""
4146 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4147 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4148
4149 #. type: Plain text
4150 #: build/C/man2/select.2:398
4151 msgid ""
4152 "Concerning prototypes, the classical situation is that one should include "
4153 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4154 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4155 msgstr ""
4156 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4157 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4158 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4159 "インクルードすればよい。"
4160
4161 #. type: Plain text
4162 #: build/C/man2/select.2:410
4163 msgid ""
4164 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4165 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4166 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4167 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4168 "requirements are as shown in the SYNOPSIS."
4169 msgstr ""
4170 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4171 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4172 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4173 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4174 "使用するには、「書式」に記載された要件を満たす必要がある。"
4175
4176 #. type: SS
4177 #: build/C/man2/select.2:410
4178 #, no-wrap
4179 msgid "Linux Notes"
4180 msgstr "Linux での注意"
4181
4182 #. type: Plain text
4183 #: build/C/man2/select.2:423
4184 msgid ""
4185 "The Linux B<pselect>()  system call modifies its I<timeout> argument.  "
4186 "However, the glibc wrapper function hides this behavior by using a local "
4187 "variable for the timeout argument that is passed to the system call.  Thus, "
4188 "the glibc B<pselect>()  function does not modify its timeout argument; this "
4189 "is the behavior required by POSIX.1-2001."
4190 msgstr ""
4191 "Linux の B<pselect>()  システムコールは I<timeout> 引き数を変更する。 しか"
4192 "し、 glibc のラッパー関数は、システムコールに渡す timeout 引き数 としてローカ"
4193 "ル変数を使うことでこの動作を隠蔽している。 このため、glibc の B<pselect>()  "
4194 "関数は timeout 引き数を変更しない。 これが POSIX.1-2001 が要求している動作で"
4195 "ある。"
4196
4197 #. type: Plain text
4198 #: build/C/man2/select.2:429
4199 msgid ""
4200 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4201 "argument."
4202 msgstr ""
4203 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4204 "されていた。"
4205
4206 #. type: Plain text
4207 #: build/C/man2/select.2:442
4208 msgid ""
4209 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4210 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4211 "implementation remained vulnerable to the very race condition that B<pselect>"
4212 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4213 "B<pselect>()  system call on kernels where it is provided."
4214 msgstr ""
4215 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4216 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4217 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4218 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4219 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4220 "が使用される。"
4221
4222 #. type: Plain text
4223 #: build/C/man2/select.2:451
4224 msgid ""
4225 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4226 "trapping can be achieved using the self-pipe trick (where a signal handler "
4227 "writes a byte to a pipe whose other end is monitored by B<select>()  in the "
4228 "main program.)"
4229 msgstr ""
4230 "B<pselect>()  がないシステムにおいて、 シグナルの捕捉を信頼性があり (移植性も"
4231 "高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい (シグナル"
4232 "ハンドラはパイプへ 1 バイトのデータを書き込み、同じパイプのもう一端をメインプ"
4233 "ログラムの B<select>()  で監視するという方法である)。"
4234
4235 #.  Stevens discusses a case where accept can block after select
4236 #.  returns successfully because of an intervening RST from the client.
4237 #.  Maybe the kernel should have returned EIO in such a situation?
4238 #. type: Plain text
4239 #: build/C/man2/select.2:467
4240 msgid ""
4241 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4242 "reading\", while nevertheless a subsequent read blocks.  This could for "
4243 "example happen when data has arrived but upon examination has wrong checksum "
4244 "and is discarded.  There may be other circumstances in which a file "
4245 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4246 "B<O_NONBLOCK> on sockets that should not block."
4247 msgstr ""
4248 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4249 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4250 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4251 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4252 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4253 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4254
4255 #. type: Plain text
4256 #: build/C/man2/select.2:482
4257 msgid ""
4258 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4259 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4260 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4261 "behavior, but the glibc wrapper hides this behavior by internally copying "
4262 "the I<timeout> to a local variable and passing that variable to the system "
4263 "call."
4264 msgstr ""
4265 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4266 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4267 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4268 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4269 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4270 "数をシステムコールに渡している。"
4271
4272 #. type: Plain text
4273 #: build/C/man2/select.2:489
4274 #, no-wrap
4275 msgid ""
4276 "#include E<lt>stdio.hE<gt>\n"
4277 "#include E<lt>stdlib.hE<gt>\n"
4278 "#include E<lt>sys/time.hE<gt>\n"
4279 "#include E<lt>sys/types.hE<gt>\n"
4280 "#include E<lt>unistd.hE<gt>\n"
4281 msgstr ""
4282 "#include E<lt>stdio.hE<gt>\n"
4283 "#include E<lt>stdlib.hE<gt>\n"
4284 "#include E<lt>sys/time.hE<gt>\n"
4285 "#include E<lt>sys/types.hE<gt>\n"
4286 "#include E<lt>unistd.hE<gt>\n"
4287
4288 #. type: Plain text
4289 #: build/C/man2/select.2:496
4290 #, no-wrap
4291 msgid ""
4292 "int\n"
4293 "main(void)\n"
4294 "{\n"
4295 "    fd_set rfds;\n"
4296 "    struct timeval tv;\n"
4297 "    int retval;\n"
4298 msgstr ""
4299 "int\n"
4300 "main(void)\n"
4301 "{\n"
4302 "    fd_set rfds;\n"
4303 "    struct timeval tv;\n"
4304 "    int retval;\n"
4305
4306 #. type: Plain text
4307 #: build/C/man2/select.2:500
4308 #, no-wrap
4309 msgid ""
4310 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4311 "    FD_ZERO(&rfds);\n"
4312 "    FD_SET(0, &rfds);\n"
4313 msgstr ""
4314 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4315 "    FD_ZERO(&rfds);\n"
4316 "    FD_SET(0, &rfds);\n"
4317
4318 #. type: Plain text
4319 #: build/C/man2/select.2:504
4320 #, no-wrap
4321 msgid ""
4322 "    /* Wait up to five seconds. */\n"
4323 "    tv.tv_sec = 5;\n"
4324 "    tv.tv_usec = 0;\n"
4325 msgstr ""
4326 "    /* 5 秒間監視する。*/\n"
4327 "    tv.tv_sec = 5;\n"
4328 "    tv.tv_usec = 0;\n"
4329
4330 #. type: Plain text
4331 #: build/C/man2/select.2:507
4332 #, no-wrap
4333 msgid ""
4334 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4335 "    /* Don't rely on the value of tv now! */\n"
4336 msgstr ""
4337 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4338 "    /* この時点での tv の値を信頼してはならない。*/\n"
4339
4340 #. type: Plain text
4341 #: build/C/man2/select.2:515
4342 #, no-wrap
4343 msgid ""
4344 "    if (retval == -1)\n"
4345 "        perror(\"select()\");\n"
4346 "    else if (retval)\n"
4347 "        printf(\"Data is available now.\\en\");\n"
4348 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4349 "    else\n"
4350 "        printf(\"No data within five seconds.\\en\");\n"
4351 msgstr ""
4352 "    if (retval == -1)\n"
4353 "\tperror(\"select()\");\n"
4354 "    else if (retval)\n"
4355 "        printf(\"今、データが取得できました。\\en\");\n"
4356 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4357 "    else\n"
4358 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4359
4360 #. type: Plain text
4361 #: build/C/man2/select.2:518
4362 #, no-wrap
4363 msgid ""
4364 "    exit(EXIT_SUCCESS);\n"
4365 "}\n"
4366 msgstr ""
4367 "    exit(EXIT_SUCCESS);\n"
4368 "}\n"
4369
4370 #. type: Plain text
4371 #: build/C/man2/select.2:522
4372 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4373 msgstr ""
4374 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
4375
4376 #. type: Plain text
4377 #: build/C/man2/select.2:534
4378 msgid ""
4379 "For vaguely related stuff, see B<accept>(2), B<connect>(2), B<poll>(2), "
4380 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4381 "(7), B<time>(7)"
4382 msgstr ""
4383 "関係がありそうなものを挙げておく: B<accept>(2), B<connect>(2), B<poll>(2), "
4384 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4385 "(7), B<time>(7)"
4386
4387 #. type: TH
4388 #: build/C/man2/select_tut.2:30
4389 #, no-wrap
4390 msgid "SELECT_TUT"
4391 msgstr "SELECT_TUT"
4392
4393 #. type: TH
4394 #: build/C/man2/select_tut.2:30
4395 #, no-wrap
4396 msgid "2010-06-10"
4397 msgstr "2010-06-10"
4398
4399 #. type: Plain text
4400 #: build/C/man2/select_tut.2:50
4401 #, no-wrap
4402 msgid ""
4403 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4404 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4405 msgstr ""
4406 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4407 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4408
4409 #. type: Plain text
4410 #: build/C/man2/select_tut.2:64
4411 #, no-wrap
4412 msgid ""
4413 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4414 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4415 "B<            const sigset_t *>I<sigmask>B<);>\n"
4416 msgstr ""
4417 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4418 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4419 "B<            const sigset_t *>I<sigmask>B<);>\n"
4420
4421 #. type: Plain text
4422 #: build/C/man2/select_tut.2:81
4423 msgid ""
4424 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
4425 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
4426 "see whether I/O becomes possible, or an \"exceptional condition\" has "
4427 "occurred on any of the descriptors."
4428 msgstr ""
4429 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
4430 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
4431 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
4432 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
4433 "る。"
4434
4435 #. type: Plain text
4436 #: build/C/man2/select_tut.2:106
4437 msgid ""
4438 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
4439 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
4440 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
4441 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
4442 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
4443 "according to the rules described below; after calling B<select>()  you can "
4444 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
4445 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
4446 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
4447 "descriptor from a set."
4448 msgstr ""
4449 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
4450 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
4451 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
4452 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
4453 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
4454 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
4455 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
4456 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
4457 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
4458 "のファイルディスクリプタの削除を行う。"
4459
4460 #. type: SS
4461 #: build/C/man2/select_tut.2:106
4462 #, no-wrap
4463 msgid "Arguments"
4464 msgstr "引き数"
4465
4466 #. type: TP
4467 #: build/C/man2/select_tut.2:107
4468 #, no-wrap
4469 msgid "I<readfds>"
4470 msgstr "I<readfds>"
4471
4472 #. type: Plain text
4473 #: build/C/man2/select_tut.2:116
4474 msgid ""
4475 "This set is watched to see if data is available for reading from any of its "
4476 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
4477 "cleared of all file descriptors except for those that are immediately "
4478 "available for reading."
4479 msgstr ""
4480 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
4481 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
4482 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
4483
4484 #. type: TP
4485 #: build/C/man2/select_tut.2:116
4486 #, no-wrap
4487 msgid "I<writefds>"
4488 msgstr "I<writefds>"
4489
4490 #. type: Plain text
4491 #: build/C/man2/select_tut.2:125
4492 msgid ""
4493 "This set is watched to see if there is space to write data to any of its "
4494 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
4495 "cleared of all file descriptors except for those that are immediately "
4496 "available for writing."
4497 msgstr ""
4498 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
4499 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
4500 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
4501
4502 #. type: TP
4503 #: build/C/man2/select_tut.2:125
4504 #, no-wrap
4505 msgid "I<exceptfds>"
4506 msgstr "I<exceptfds>"
4507
4508 #. type: Plain text
4509 #: build/C/man2/select_tut.2:147
4510 msgid ""
4511 "This set is watched for \"exceptional conditions\".  In practice, only one "
4512 "such exceptional condition is common: the availability of I<out-of-band> "
4513 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
4514 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
4515 "where B<select>(2)  indicates an exceptional condition occurs with "
4516 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
4517 "has returned, I<exceptfds> will be cleared of all file descriptors except "
4518 "for those for which an exceptional condition has occurred."
4519 msgstr ""
4520 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
4521 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
4522 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
4523 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
4524 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
4525 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
4526 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
4527 "状態が発生したディスクリプタ以外は集合から削除される。"
4528
4529 #. type: TP
4530 #: build/C/man2/select_tut.2:147
4531 #, no-wrap
4532 msgid "I<nfds>"
4533 msgstr "I<nfds>"
4534
4535 #. type: Plain text
4536 #: build/C/man2/select_tut.2:154
4537 msgid ""
4538 "This is an integer one more than the maximum of any file descriptor in any "
4539 "of the sets.  In other words, while adding file descriptors to each of the "
4540 "sets, you must calculate the maximum integer value of all of them, then "
4541 "increment this value by one, and then pass this as I<nfds>."
4542 msgstr ""
4543 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
4544 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
4545 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
4546 "I<nfds> として渡さないといけない、ということだ。"
4547
4548 #. type: TP
4549 #: build/C/man2/select_tut.2:154
4550 #, no-wrap
4551 msgid "I<utimeout>"
4552 msgstr "I<utimeout>"
4553
4554 #. type: Plain text
4555 #: build/C/man2/select_tut.2:167
4556 msgid ""
4557 "This is the longest time B<select>()  may wait before returning, even if "
4558 "nothing interesting happened.  If this value is passed as NULL, then "
4559 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
4560 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
4561 "return immediately, with information about the readiness of file descriptors "
4562 "at the time of the call.  The structure I<struct timeval> is defined as:"
4563 msgstr ""
4564 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
4565 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
4566 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
4567 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
4568 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
4569 "ように定義されている:"
4570
4571 #. type: Plain text
4572 #: build/C/man2/select_tut.2:174
4573 #, no-wrap
4574 msgid ""
4575 "struct timeval {\n"
4576 "    time_t tv_sec;    /* seconds */\n"
4577 "    long tv_usec;     /* microseconds */\n"
4578 "};\n"
4579 msgstr ""
4580 "struct timeval {\n"
4581 "    time_t tv_sec;    /* seconds */\n"
4582 "    long tv_usec;     /* microseconds */\n"
4583 "};\n"
4584
4585 #. type: TP
4586 #: build/C/man2/select_tut.2:176
4587 #, no-wrap
4588 msgid "I<ntimeout>"
4589 msgstr "I<ntimeout>"
4590
4591 #. type: Plain text
4592 #: build/C/man2/select_tut.2:185
4593 msgid ""
4594 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
4595 "I<struct timespec> has nanosecond precision as follows:"
4596 msgstr ""
4597 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
4598 "timespec> は次に示すようにナノ秒の精度を持つ。"
4599
4600 #. type: Plain text
4601 #: build/C/man2/select_tut.2:192
4602 #, no-wrap
4603 msgid ""
4604 "struct timespec {\n"
4605 "    long tv_sec;    /* seconds */\n"
4606 "    long tv_nsec;   /* nanoseconds */\n"
4607 "};\n"
4608 msgstr ""
4609 "struct timespec {\n"
4610 "    long tv_sec;    /* seconds */\n"
4611 "    long tv_nsec;   /* nanoseconds */\n"
4612 "};\n"
4613
4614 #. type: TP
4615 #: build/C/man2/select_tut.2:194
4616 #, no-wrap
4617 msgid "I<sigmask>"
4618 msgstr "I<sigmask>"
4619
4620 #. type: Plain text
4621 #: build/C/man2/select_tut.2:211
4622 msgid ""
4623 "This argument holds a set of signals that the kernel should unblock (i.e., "
4624 "remove from the signal mask of the calling thread), while the caller is "
4625 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
4626 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
4627 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
4628 "()  will then behave just like B<select>()."
4629 msgstr ""
4630 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
4631 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
4632 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
4633 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
4634 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
4635 "()  と全く同じ動作となる。"
4636
4637 #. type: SS
4638 #: build/C/man2/select_tut.2:211
4639 #, no-wrap
4640 msgid "Combining Signal and Data Events"
4641 msgstr "シグナルとデータイベントを組み合わせる"
4642
4643 #. type: Plain text
4644 #: build/C/man2/select_tut.2:255
4645 msgid ""
4646 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
4647 "descriptor(s) to become ready for I/O.  Programs that receive signals "
4648 "normally use the signal handler only to raise a global flag.  The global "
4649 "flag will indicate that the event must be processed in the main loop of the "
4650 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
4651 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
4652 "signals can be processed in the main loop of the program, otherwise B<select>"
4653 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
4654 "conditional to check the global flag.  So we must ask: what if a signal "
4655 "arrives after the conditional, but before the B<select>()  call? The answer "
4656 "is that B<select>()  would block indefinitely, even though an event is "
4657 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
4658 "This call can be used to set the signal mask to a set of signals that are "
4659 "only to be received within the B<pselect>()  call.  For instance, let us say "
4660 "that the event in question was the exit of a child process.  Before the "
4661 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
4662 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
4663 "mask.  Our program would look like:"
4664 msgstr ""
4665 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
4666 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
4667 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
4668 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
4669 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
4670 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
4671 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
4672 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
4673 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
4674 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
4675 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
4676 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
4677 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
4678 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
4679 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
4680 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
4681 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
4682 "る。"
4683
4684 #. type: Plain text
4685 #: build/C/man2/select_tut.2:258
4686 #, no-wrap
4687 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4688 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4689
4690 #. type: Plain text
4691 #: build/C/man2/select_tut.2:264
4692 #, no-wrap
4693 msgid ""
4694 "static void\n"
4695 "child_sig_handler(int sig)\n"
4696 "{\n"
4697 "    got_SIGCHLD = 1;\n"
4698 "}\n"
4699 msgstr ""
4700 "static void\n"
4701 "child_sig_handler(int sig)\n"
4702 "{\n"
4703 "    got_SIGCHLD = 1;\n"
4704 "}\n"
4705
4706 #. type: Plain text
4707 #: build/C/man2/select_tut.2:272
4708 #, no-wrap
4709 msgid ""
4710 "int\n"
4711 "main(int argc, char *argv[])\n"
4712 "{\n"
4713 "    sigset_t sigmask, empty_mask;\n"
4714 "    struct sigaction sa;\n"
4715 "    fd_set readfds, writefds, exceptfds;\n"
4716 "    int r;\n"
4717 msgstr ""
4718 "int\n"
4719 "main(int argc, char *argv[])\n"
4720 "{\n"
4721 "    sigset_t sigmask, empty_mask;\n"
4722 "    struct sigaction sa;\n"
4723 "    fd_set readfds, writefds, exceptfds;\n"
4724 "    int r;\n"
4725
4726 #. type: Plain text
4727 #: build/C/man2/select_tut.2:279
4728 #, no-wrap
4729 msgid ""
4730 "    sigemptyset(&sigmask);\n"
4731 "    sigaddset(&sigmask, SIGCHLD);\n"
4732 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4733 "        perror(\"sigprocmask\");\n"
4734 "        exit(EXIT_FAILURE);\n"
4735 "    }\n"
4736 msgstr ""
4737 "    sigemptyset(&sigmask);\n"
4738 "    sigaddset(&sigmask, SIGCHLD);\n"
4739 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4740 "        perror(\"sigprocmask\");\n"
4741 "        exit(EXIT_FAILURE);\n"
4742 "    }\n"
4743
4744 #. type: Plain text
4745 #: build/C/man2/select_tut.2:287
4746 #, no-wrap
4747 msgid ""
4748 "    sa.sa_flags = 0;\n"
4749 "    sa.sa_handler = child_sig_handler;\n"
4750 "    sigemptyset(&sa.sa_mask);\n"
4751 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4752 "        perror(\"sigaction\");\n"
4753 "        exit(EXIT_FAILURE);\n"
4754 "    }\n"
4755 msgstr ""
4756 "    sa.sa_flags = 0;\n"
4757 "    sa.sa_handler = child_sig_handler;\n"
4758 "    sigemptyset(&sa.sa_mask);\n"
4759 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4760 "        perror(\"sigaction\");\n"
4761 "        exit(EXIT_FAILURE);\n"
4762 "    }\n"
4763
4764 #. type: Plain text
4765 #: build/C/man2/select_tut.2:289
4766 #, no-wrap
4767 msgid "    sigemptyset(&empty_mask);\n"
4768 msgstr "    sigemptyset(&empty_mask);\n"
4769
4770 #. type: Plain text
4771 #: build/C/man2/select_tut.2:293
4772 #, no-wrap
4773 msgid ""
4774 "    for (;;) {          /* main loop */\n"
4775 "        /* Initialize readfds, writefds, and exceptfds\n"
4776 "           before the pselect() call. (Code omitted.) */\n"
4777 msgstr ""
4778 "    for (;;) {          /* main loop */\n"
4779 "        /* Initialize readfds, writefds, and exceptfds\n"
4780 "           before the pselect() call. (Code omitted.) */\n"
4781
4782 #. type: Plain text
4783 #: build/C/man2/select_tut.2:299
4784 #, no-wrap
4785 msgid ""
4786 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4787 "                    NULL, &empty_mask);\n"
4788 "        if (r == -1 && errno != EINTR) {\n"
4789 "            /* Handle error */\n"
4790 "        }\n"
4791 msgstr ""
4792 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4793 "                    NULL, &empty_mask);\n"
4794 "        if (r == -1 && errno != EINTR) {\n"
4795 "            /* Handle error */\n"
4796 "        }\n"
4797
4798 #. type: Plain text
4799 #: build/C/man2/select_tut.2:302
4800 #, no-wrap
4801 msgid ""
4802 "        if (got_SIGCHLD) {\n"
4803 "            got_SIGCHLD = 0;\n"
4804 msgstr ""
4805 "        if (got_SIGCHLD) {\n"
4806 "            got_SIGCHLD = 0;\n"
4807
4808 #. type: Plain text
4809 #: build/C/man2/select_tut.2:306
4810 #, no-wrap
4811 msgid ""
4812 "            /* Handle signalled event here; e.g., wait() for all\n"
4813 "               terminated children. (Code omitted.) */\n"
4814 "        }\n"
4815 msgstr ""
4816 "            /* Handle signalled event here; e.g., wait() for all\n"
4817 "               terminated children. (Code omitted.) */\n"
4818 "        }\n"
4819
4820 #. type: Plain text
4821 #: build/C/man2/select_tut.2:310
4822 #, no-wrap
4823 msgid ""
4824 "        /* main body of program */\n"
4825 "    }\n"
4826 "}\n"
4827 msgstr ""
4828 "        /* main body of program */\n"
4829 "    }\n"
4830 "}\n"
4831
4832 #. type: SS
4833 #: build/C/man2/select_tut.2:311
4834 #, no-wrap
4835 msgid "Practical"
4836 msgstr "実例"
4837
4838 #. type: Plain text
4839 #: build/C/man2/select_tut.2:332
4840 msgid ""
4841 "So what is the point of B<select>()? Can't I just read and write to my "
4842 "descriptors whenever I want? The point of B<select>()  is that it watches "
4843 "multiple descriptors at the same time and properly puts the process to sleep "
4844 "if there is no activity.  UNIX programmers often find themselves in a "
4845 "position where they have to handle I/O from more than one file descriptor "
4846 "where the data flow may be intermittent.  If you were to merely create a "
4847 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
4848 "your calls may block waiting for data from/to a file descriptor, while "
4849 "another file descriptor is unused though ready for I/O.  B<select>()  "
4850 "efficiently copes with this situation."
4851 msgstr ""
4852 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
4853 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
4854 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
4855 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
4856 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
4857 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
4858 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
4859 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
4860 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
4861
4862 #. type: SS
4863 #: build/C/man2/select_tut.2:332
4864 #, no-wrap
4865 msgid "Select Law"
4866 msgstr "SELECT の掟"
4867
4868 #. type: Plain text
4869 #: build/C/man2/select_tut.2:345
4870 msgid ""
4871 "Many people who try to use B<select>()  come across behavior that is "
4872 "difficult to understand and produces nonportable or borderline results.  For "
4873 "instance, the above program is carefully written not to block at any point, "
4874 "even though it does not set its file descriptors to nonblocking mode.  It is "
4875 "easy to introduce subtle errors that will remove the advantage of using "
4876 "B<select>(), so here is a list of essentials to watch for when using "
4877 "B<select>()."
4878 msgstr ""
4879 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
4880 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
4881 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
4882 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
4883 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
4884 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
4885 "ことにする。"
4886
4887 #. type: Plain text
4888 #: build/C/man2/select_tut.2:354
4889 msgid ""
4890 "You should always try to use B<select>()  without a timeout.  Your program "
4891 "should have nothing to do if there is no data available.  Code that depends "
4892 "on timeouts is not usually portable and is difficult to debug."
4893 msgstr ""
4894 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
4895 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
4896 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
4897
4898 #. type: Plain text
4899 #: build/C/man2/select_tut.2:358
4900 msgid ""
4901 "The value I<nfds> must be properly calculated for efficiency as explained "
4902 "above."
4903 msgstr ""
4904 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
4905 "えなければならない。"
4906
4907 #. type: Plain text
4908 #: build/C/man2/select_tut.2:365
4909 msgid ""
4910 "No file descriptor must be added to any set if you do not intend to check "
4911 "its result after the B<select>()  call, and respond appropriately.  See next "
4912 "rule."
4913 msgstr ""
4914 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
4915 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
4916
4917 #. type: Plain text
4918 #: build/C/man2/select_tut.2:371
4919 msgid ""
4920 "After B<select>()  returns, all file descriptors in all sets should be "
4921 "checked to see if they are ready."
4922 msgstr ""
4923 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
4924 "て 読み書き可能な状態になっているかをチェックすべきである。"
4925
4926 #. type: TP
4927 #: build/C/man2/select_tut.2:371
4928 #, no-wrap
4929 msgid "5."
4930 msgstr "5."
4931
4932 #. type: Plain text
4933 #: build/C/man2/select_tut.2:386
4934 msgid ""
4935 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
4936 "necessarily read/write the full amount of data that you have requested.  If "
4937 "they do read/write the full amount, it's because you have a low traffic load "
4938 "and a fast stream.  This is not always going to be the case.  You should "
4939 "cope with the case of your functions only managing to send or receive a "
4940 "single byte."
4941 msgstr ""
4942 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
4943 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
4944 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
4945 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
4946 "うな場合も 考慮に入れてやらなければならない。"
4947
4948 #. type: TP
4949 #: build/C/man2/select_tut.2:386
4950 #, no-wrap
4951 msgid "6."
4952 msgstr "6."
4953
4954 #. type: Plain text
4955 #: build/C/man2/select_tut.2:394
4956 msgid ""
4957 "Never read/write only in single bytes at a time unless you are really sure "
4958 "that you have a small amount of data to process.  It is extremely "
4959 "inefficient not to read/write as much data as you can buffer each time.  The "
4960 "buffers in the example below are 1024 bytes although they could easily be "
4961 "made larger."
4962 msgstr ""
4963 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
4964 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
4965 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
4966 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
4967
4968 #. type: TP
4969 #: build/C/man2/select_tut.2:394
4970 #, no-wrap
4971 msgid "7."
4972 msgstr "7."
4973
4974 #.  Nonetheless, you should still cope with these errors for completeness.
4975 #. type: Plain text
4976 #: build/C/man2/select_tut.2:416
4977 msgid ""
4978 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
4979 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
4980 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
4981 "properly managed (not done properly above).  If your program is not going to "
4982 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
4983 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
4984 msgstr ""
4985 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
4986 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
4987 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
4988 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
4989 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
4990 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
4991
4992 #. type: TP
4993 #: build/C/man2/select_tut.2:416
4994 #, no-wrap
4995 msgid "8."
4996 msgstr "8."
4997
4998 #. type: Plain text
4999 #: build/C/man2/select_tut.2:425
5000 msgid ""
5001 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
5002 "length of zero."
5003 msgstr ""
5004 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
5005 "(2), B<send>(2)  を呼び出してはならない。"
5006
5007 #. type: TP
5008 #: build/C/man2/select_tut.2:425
5009 #, no-wrap
5010 msgid "9."
5011 msgstr "9."
5012
5013 #. type: Plain text
5014 #: build/C/man2/select_tut.2:441
5015 msgid ""
5016 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
5017 "with errors other than those listed in B<7.>, or one of the input functions "
5018 "returns 0, indicating end of file, then you should I<not> pass that "
5019 "descriptor to B<select>()  again.  In the example below, I close the "
5020 "descriptor immediately, and then set it to -1 to prevent it being included "
5021 "in a set."
5022 msgstr ""
5023 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
5024 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
5025 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
5026 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
5027 "が集合に含まれ続けるのを許さないようにしている。"
5028
5029 #. type: TP
5030 #: build/C/man2/select_tut.2:441
5031 #, no-wrap
5032 msgid "10."
5033 msgstr "10."
5034
5035 #. type: Plain text
5036 #: build/C/man2/select_tut.2:448
5037 msgid ""
5038 "The timeout value must be initialized with each new call to B<select>(), "
5039 "since some operating systems modify the structure.  B<pselect>()  however "
5040 "does not modify its timeout structure."
5041 msgstr ""
5042 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
5043 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
5044 "分の timeout 構造体を変更することはない。"
5045
5046 #. type: TP
5047 #: build/C/man2/select_tut.2:448
5048 #, no-wrap
5049 msgid "11."
5050 msgstr "11."
5051
5052 #.  "I have heard" does not fill me with confidence, and doesn't
5053 #.  belong in a man page, so I've commented this point out.
5054 #.  .TP
5055 #.  11.
5056 #.  I have heard that the Windows socket layer does not cope with OOB data
5057 #.  properly.
5058 #.  It also does not cope with
5059 #.  .BR select ()
5060 #.  calls when no file descriptors are set at all.
5061 #.  Having no file descriptors set is a useful
5062 #.  way to sleep the process with subsecond precision by using the timeout.
5063 #.  (See further on.)
5064 #. type: Plain text
5065 #: build/C/man2/select_tut.2:467
5066 msgid ""
5067 "Since B<select>()  modifies its file descriptor sets, if the call is being "
5068 "used in a loop, then the sets must be reinitialized before each call."
5069 msgstr ""
5070 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
5071 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
5072 "期化し直さなければならない。"
5073
5074 #. type: SS
5075 #: build/C/man2/select_tut.2:467
5076 #, no-wrap
5077 msgid "Usleep Emulation"
5078 msgstr "usleep エミュレーション"
5079
5080 #. type: Plain text
5081 #: build/C/man2/select_tut.2:474
5082 msgid ""
5083 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5084 "()  with a finite timeout and no file descriptors as follows:"
5085 msgstr ""
5086 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5087 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5088 "できる。 以下のようにする。"
5089
5090 #. type: Plain text
5091 #: build/C/man2/select_tut.2:480
5092 #, no-wrap
5093 msgid ""
5094 "    struct timeval tv;\n"
5095 "    tv.tv_sec = 0;\n"
5096 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5097 "    select(0, NULL, NULL, NULL, &tv);\n"
5098 msgstr ""
5099 "    struct timeval tv;\n"
5100 "    tv.tv_sec = 0;\n"
5101 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5102 "    select(0, NULL, NULL, NULL, &tv);\n"
5103
5104 #. type: Plain text
5105 #: build/C/man2/select_tut.2:483
5106 msgid "This is only guaranteed to work on UNIX systems, however."
5107 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5108
5109 #. type: Plain text
5110 #: build/C/man2/select_tut.2:488
5111 msgid ""
5112 "On success, B<select>()  returns the total number of file descriptors still "
5113 "present in the file descriptor sets."
5114 msgstr ""
5115 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5116 "ディスクリプタの総数を返す。"
5117
5118 #. type: Plain text
5119 #: build/C/man2/select_tut.2:494
5120 msgid ""
5121 "If B<select>()  timed out, then the return value will be zero.  The file "
5122 "descriptors set should be all empty (but may not be on some systems)."
5123 msgstr ""
5124 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5125 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5126
5127 #. type: Plain text
5128 #: build/C/man2/select_tut.2:501
5129 msgid ""
5130 "A return value of -1 indicates an error, with I<errno> being set "
5131 "appropriately.  In the case of an error, the contents of the returned sets "
5132 "and the I<struct timeout> contents are undefined and should not be used.  "
5133 "B<pselect>()  however never modifies I<ntimeout>."
5134 msgstr ""
5135 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5136 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5137 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5138 "変更しない。"
5139
5140 #. type: Plain text
5141 #: build/C/man2/select_tut.2:510
5142 msgid ""
5143 "Generally speaking, all operating systems that support sockets also support "
5144 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5145 "and efficient way that naive programmers try to solve in a more complicated "
5146 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5147 msgstr ""
5148 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5149 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5150 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5151 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5152
5153 #. type: Plain text
5154 #: build/C/man2/select_tut.2:519
5155 msgid ""
5156 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5157 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5158 "is nowadays widely available, but historically was less portable than "
5159 "B<select>()."
5160 msgstr ""
5161 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5162 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5163 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5164
5165 #. type: Plain text
5166 #: build/C/man2/select_tut.2:527
5167 msgid ""
5168 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5169 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5170 "of file descriptors."
5171 msgstr ""
5172 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5173 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5174
5175 #. type: Plain text
5176 #: build/C/man2/select_tut.2:532
5177 msgid ""
5178 "Here is an example that better demonstrates the true utility of B<select>"
5179 "().  The listing below is a TCP forwarding program that forwards from one "
5180 "TCP port to another."
5181 msgstr ""
5182 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5183 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5184
5185 #. type: Plain text
5186 #: build/C/man2/select_tut.2:545
5187 #, no-wrap
5188 msgid ""
5189 "#include E<lt>stdlib.hE<gt>\n"
5190 "#include E<lt>stdio.hE<gt>\n"
5191 "#include E<lt>unistd.hE<gt>\n"
5192 "#include E<lt>sys/time.hE<gt>\n"
5193 "#include E<lt>sys/types.hE<gt>\n"
5194 "#include E<lt>string.hE<gt>\n"
5195 "#include E<lt>signal.hE<gt>\n"
5196 "#include E<lt>sys/socket.hE<gt>\n"
5197 "#include E<lt>netinet/in.hE<gt>\n"
5198 "#include E<lt>arpa/inet.hE<gt>\n"
5199 "#include E<lt>errno.hE<gt>\n"
5200 msgstr ""
5201 "#include E<lt>stdlib.hE<gt>\n"
5202 "#include E<lt>stdio.hE<gt>\n"
5203 "#include E<lt>unistd.hE<gt>\n"
5204 "#include E<lt>sys/time.hE<gt>\n"
5205 "#include E<lt>sys/types.hE<gt>\n"
5206 "#include E<lt>string.hE<gt>\n"
5207 "#include E<lt>signal.hE<gt>\n"
5208 "#include E<lt>sys/socket.hE<gt>\n"
5209 "#include E<lt>netinet/in.hE<gt>\n"
5210 "#include E<lt>arpa/inet.hE<gt>\n"
5211 "#include E<lt>errno.hE<gt>\n"
5212
5213 #. type: Plain text
5214 #: build/C/man2/select_tut.2:547
5215 #, no-wrap
5216 msgid "static int forward_port;\n"
5217 msgstr "static int forward_port;\n"
5218
5219 #. type: Plain text
5220 #: build/C/man2/select_tut.2:550
5221 #, no-wrap
5222 msgid ""
5223 "#undef max\n"
5224 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5225 msgstr ""
5226 "#undef max\n"
5227 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5228
5229 #. type: Plain text
5230 #: build/C/man2/select_tut.2:557
5231 #, no-wrap
5232 msgid ""
5233 "static int\n"
5234 "listen_socket(int listen_port)\n"
5235 "{\n"
5236 "    struct sockaddr_in a;\n"
5237 "    int s;\n"
5238 "    int yes;\n"
5239 msgstr ""
5240 "static int\n"
5241 "listen_socket(int listen_port)\n"
5242 "{\n"
5243 "    struct sockaddr_in a;\n"
5244 "    int s;\n"
5245 "    int yes;\n"
5246
5247 #. type: Plain text
5248 #: build/C/man2/select_tut.2:581
5249 #, no-wrap
5250 msgid ""
5251 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5252 "        perror(\"socket\");\n"
5253 "        return -1;\n"
5254 "    }\n"
5255 "    yes = 1;\n"
5256 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5257 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5258 "        perror(\"setsockopt\");\n"
5259 "        close(s);\n"
5260 "        return -1;\n"
5261 "    }\n"
5262 "    memset(&a, 0, sizeof(a));\n"
5263 "    a.sin_port = htons(listen_port);\n"
5264 "    a.sin_family = AF_INET;\n"
5265 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5266 "        perror(\"bind\");\n"
5267 "        close(s);\n"
5268 "        return -1;\n"
5269 "    }\n"
5270 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5271 "    listen(s, 10);\n"
5272 "    return s;\n"
5273 "}\n"
5274 msgstr ""
5275 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5276 "        perror(\"socket\");\n"
5277 "        return -1;\n"
5278 "    }\n"
5279 "    yes = 1;\n"
5280 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5281 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5282 "        perror(\"setsockopt\");\n"
5283 "        close(s);\n"
5284 "        return -1;\n"
5285 "    }\n"
5286 "    memset(&a, 0, sizeof(a));\n"
5287 "    a.sin_port = htons(listen_port);\n"
5288 "    a.sin_family = AF_INET;\n"
5289 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5290 "        perror(\"bind\");\n"
5291 "        close(s);\n"
5292 "        return -1;\n"
5293 "    }\n"
5294 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5295 "    listen(s, 10);\n"
5296 "    return s;\n"
5297 "}\n"
5298
5299 #. type: Plain text
5300 #: build/C/man2/select_tut.2:587
5301 #, no-wrap
5302 msgid ""
5303 "static int\n"
5304 "connect_socket(int connect_port, char *address)\n"
5305 "{\n"
5306 "    struct sockaddr_in a;\n"
5307 "    int s;\n"
5308 msgstr ""
5309 "static int\n"
5310 "connect_socket(int connect_port, char *address)\n"
5311 "{\n"
5312 "    struct sockaddr_in a;\n"
5313 "    int s;\n"
5314
5315 #. type: Plain text
5316 #: build/C/man2/select_tut.2:593
5317 #, no-wrap
5318 msgid ""
5319 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5320 "        perror(\"socket\");\n"
5321 "        close(s);\n"
5322 "        return -1;\n"
5323 "    }\n"
5324 msgstr ""
5325 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5326 "        perror(\"socket\");\n"
5327 "        close(s);\n"
5328 "        return -1;\n"
5329 "    }\n"
5330
5331 #. type: Plain text
5332 #: build/C/man2/select_tut.2:597
5333 #, no-wrap
5334 msgid ""
5335 "    memset(&a, 0, sizeof(a));\n"
5336 "    a.sin_port = htons(connect_port);\n"
5337 "    a.sin_family = AF_INET;\n"
5338 msgstr ""
5339 "    memset(&a, 0, sizeof(a));\n"
5340 "    a.sin_port = htons(connect_port);\n"
5341 "    a.sin_family = AF_INET;\n"
5342
5343 #. type: Plain text
5344 #: build/C/man2/select_tut.2:603
5345 #, no-wrap
5346 msgid ""
5347 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5348 "        perror(\"bad IP address format\");\n"
5349 "        close(s);\n"
5350 "        return -1;\n"
5351 "    }\n"
5352 msgstr ""
5353 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5354 "        perror(\"bad IP address format\");\n"
5355 "        close(s);\n"
5356 "        return -1;\n"
5357 "    }\n"
5358
5359 #. type: Plain text
5360 #: build/C/man2/select_tut.2:612
5361 #, no-wrap
5362 msgid ""
5363 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5364 "        perror(\"connect()\");\n"
5365 "        shutdown(s, SHUT_RDWR);\n"
5366 "        close(s);\n"
5367 "        return -1;\n"
5368 "    }\n"
5369 "    return s;\n"
5370 "}\n"
5371 msgstr ""
5372 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5373 "        perror(\"connect()\");\n"
5374 "        shutdown(s, SHUT_RDWR);\n"
5375 "        close(s);\n"
5376 "        return -1;\n"
5377 "    }\n"
5378 "    return s;\n"
5379 "}\n"
5380
5381 #. type: Plain text
5382 #: build/C/man2/select_tut.2:620
5383 #, no-wrap
5384 msgid ""
5385 "#define SHUT_FD1 do {                                \\e\n"
5386 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5387 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5388 "                         close(fd1);                 \\e\n"
5389 "                         fd1 = -1;                   \\e\n"
5390 "                     }                               \\e\n"
5391 "                 } while (0)\n"
5392 msgstr ""
5393 "#define SHUT_FD1 do {                                \\e\n"
5394 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5395 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5396 "                         close(fd1);                 \\e\n"
5397 "                         fd1 = -1;                   \\e\n"
5398 "                     }                               \\e\n"
5399 "                 } while (0)\n"
5400
5401 #. type: Plain text
5402 #: build/C/man2/select_tut.2:628
5403 #, no-wrap
5404 msgid ""
5405 "#define SHUT_FD2 do {                                \\e\n"
5406 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5407 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5408 "                         close(fd2);                 \\e\n"
5409 "                         fd2 = -1;                   \\e\n"
5410 "                     }                               \\e\n"
5411 "                 } while (0)\n"
5412 msgstr ""
5413 "#define SHUT_FD2 do {                                \\e\n"
5414 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5415 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5416 "                         close(fd2);                 \\e\n"
5417 "                         fd2 = -1;                   \\e\n"
5418 "                     }                               \\e\n"
5419 "                 } while (0)\n"
5420
5421 #. type: Plain text
5422 #: build/C/man2/select_tut.2:630
5423 #, no-wrap
5424 msgid "#define BUF_SIZE 1024\n"
5425 msgstr "#define BUF_SIZE 1024\n"
5426
5427 #. type: Plain text
5428 #: build/C/man2/select_tut.2:639
5429 #, no-wrap
5430 msgid ""
5431 "int\n"
5432 "main(int argc, char *argv[])\n"
5433 "{\n"
5434 "    int h;\n"
5435 "    int fd1 = -1, fd2 = -1;\n"
5436 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5437 "    int buf1_avail, buf1_written;\n"
5438 "    int buf2_avail, buf2_written;\n"
5439 msgstr ""
5440 "int\n"
5441 "main(int argc, char *argv[])\n"
5442 "{\n"
5443 "    int h;\n"
5444 "    int fd1 = -1, fd2 = -1;\n"
5445 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5446 "    int buf1_avail, buf1_written;\n"
5447 "    int buf2_avail, buf2_written;\n"
5448
5449 #. type: Plain text
5450 #: build/C/man2/select_tut.2:645
5451 #, no-wrap
5452 msgid ""
5453 "    if (argc != 4) {\n"
5454 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5455 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5456 "        exit(EXIT_FAILURE);\n"
5457 "    }\n"
5458 msgstr ""
5459 "    if (argc != 4) {\n"
5460 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5461 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5462 "        exit(EXIT_FAILURE);\n"
5463 "    }\n"
5464
5465 #. type: Plain text
5466 #: build/C/man2/select_tut.2:647
5467 #, no-wrap
5468 msgid "    signal(SIGPIPE, SIG_IGN);\n"
5469 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
5470
5471 #. type: Plain text
5472 #: build/C/man2/select_tut.2:649
5473 #, no-wrap
5474 msgid "    forward_port = atoi(argv[2]);\n"
5475 msgstr "    forward_port = atoi(argv[2]);\n"
5476
5477 #. type: Plain text
5478 #: build/C/man2/select_tut.2:653
5479 #, no-wrap
5480 msgid ""
5481 "    h = listen_socket(atoi(argv[1]));\n"
5482 "    if (h == -1)\n"
5483 "        exit(EXIT_FAILURE);\n"
5484 msgstr ""
5485 "    h = listen_socket(atoi(argv[1]));\n"
5486 "    if (h == -1)\n"
5487 "        exit(EXIT_FAILURE);\n"
5488
5489 #. type: Plain text
5490 #: build/C/man2/select_tut.2:657
5491 #, no-wrap
5492 msgid ""
5493 "    for (;;) {\n"
5494 "        int r, nfds = 0;\n"
5495 "        fd_set rd, wr, er;\n"
5496 msgstr ""
5497 "    for (;;) {\n"
5498 "        int r, nfds = 0;\n"
5499 "        fd_set rd, wr, er;\n"
5500
5501 #. type: Plain text
5502 #: build/C/man2/select_tut.2:687
5503 #, no-wrap
5504 msgid ""
5505 "        FD_ZERO(&rd);\n"
5506 "        FD_ZERO(&wr);\n"
5507 "        FD_ZERO(&er);\n"
5508 "        FD_SET(h, &rd);\n"
5509 "        nfds = max(nfds, h);\n"
5510 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5511 "            FD_SET(fd1, &rd);\n"
5512 "            nfds = max(nfds, fd1);\n"
5513 "        }\n"
5514 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5515 "            FD_SET(fd2, &rd);\n"
5516 "            nfds = max(nfds, fd2);\n"
5517 "        }\n"
5518 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5519 "            FD_SET(fd1, &wr);\n"
5520 "            nfds = max(nfds, fd1);\n"
5521 "        }\n"
5522 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5523 "            FD_SET(fd2, &wr);\n"
5524 "            nfds = max(nfds, fd2);\n"
5525 "        }\n"
5526 "        if (fd1 E<gt> 0) {\n"
5527 "            FD_SET(fd1, &er);\n"
5528 "            nfds = max(nfds, fd1);\n"
5529 "        }\n"
5530 "        if (fd2 E<gt> 0) {\n"
5531 "            FD_SET(fd2, &er);\n"
5532 "            nfds = max(nfds, fd2);\n"
5533 "        }\n"
5534 msgstr ""
5535 "        FD_ZERO(&rd);\n"
5536 "        FD_ZERO(&wr);\n"
5537 "        FD_ZERO(&er);\n"
5538 "        FD_SET(h, &rd);\n"
5539 "        nfds = max(nfds, h);\n"
5540 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5541 "            FD_SET(fd1, &rd);\n"
5542 "            nfds = max(nfds, fd1);\n"
5543 "        }\n"
5544 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5545 "            FD_SET(fd2, &rd);\n"
5546 "            nfds = max(nfds, fd2);\n"
5547 "        }\n"
5548 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5549 "            FD_SET(fd1, &wr);\n"
5550 "            nfds = max(nfds, fd1);\n"
5551 "        }\n"
5552 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5553 "            FD_SET(fd2, &wr);\n"
5554 "            nfds = max(nfds, fd2);\n"
5555 "        }\n"
5556 "        if (fd1 E<gt> 0) {\n"
5557 "            FD_SET(fd1, &er);\n"
5558 "            nfds = max(nfds, fd1);\n"
5559 "        }\n"
5560 "        if (fd2 E<gt> 0) {\n"
5561 "            FD_SET(fd2, &er);\n"
5562 "            nfds = max(nfds, fd2);\n"
5563 "        }\n"
5564
5565 #. type: Plain text
5566 #: build/C/man2/select_tut.2:689
5567 #, no-wrap
5568 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5569 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5570
5571 #. type: Plain text
5572 #: build/C/man2/select_tut.2:692
5573 #, no-wrap
5574 msgid ""
5575 "        if (r == -1 && errno == EINTR)\n"
5576 "            continue;\n"
5577 msgstr ""
5578 "        if (r == -1 && errno == EINTR)\n"
5579 "            continue;\n"
5580
5581 #. type: Plain text
5582 #: build/C/man2/select_tut.2:697
5583 #, no-wrap
5584 msgid ""
5585 "        if (r == -1) {\n"
5586 "            perror(\"select()\");\n"
5587 "            exit(EXIT_FAILURE);\n"
5588 "        }\n"
5589 msgstr ""
5590 "        if (r == -1) {\n"
5591 "            perror(\"select()\");\n"
5592 "            exit(EXIT_FAILURE);\n"
5593 "        }\n"
5594
5595 #. type: Plain text
5596 #: build/C/man2/select_tut.2:701
5597 #, no-wrap
5598 msgid ""
5599 "        if (FD_ISSET(h, &rd)) {\n"
5600 "            unsigned int l;\n"
5601 "            struct sockaddr_in client_address;\n"
5602 msgstr ""
5603 "        if (FD_ISSET(h, &rd)) {\n"
5604 "            unsigned int l;\n"
5605 "            struct sockaddr_in client_address;\n"
5606
5607 #. type: Plain text
5608 #: build/C/man2/select_tut.2:720
5609 #, no-wrap
5610 msgid ""
5611 "            memset(&client_address, 0, l = sizeof(client_address));\n"
5612 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5613 "            if (r == -1) {\n"
5614 "                perror(\"accept()\");\n"
5615 "            } else {\n"
5616 "                SHUT_FD1;\n"
5617 "                SHUT_FD2;\n"
5618 "                buf1_avail = buf1_written = 0;\n"
5619 "                buf2_avail = buf2_written = 0;\n"
5620 "                fd1 = r;\n"
5621 "                fd2 = connect_socket(forward_port, argv[3]);\n"
5622 "                if (fd2 == -1)\n"
5623 "                    SHUT_FD1;\n"
5624 "                else\n"
5625 "                    printf(\"connect from %s\\en\",\n"
5626 "                            inet_ntoa(client_address.sin_addr));\n"
5627 "            }\n"
5628 "        }\n"
5629 msgstr ""
5630 "            memset(&client_address, 0, l = sizeof(client_address));\n"
5631 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5632 "            if (r == -1) {\n"
5633 "                perror(\"accept()\");\n"
5634 "            } else {\n"
5635 "                SHUT_FD1;\n"
5636 "                SHUT_FD2;\n"
5637 "                buf1_avail = buf1_written = 0;\n"
5638 "                buf2_avail = buf2_written = 0;\n"
5639 "                fd1 = r;\n"
5640 "                fd2 = connect_socket(forward_port, argv[3]);\n"
5641 "                if (fd2 == -1)\n"
5642 "                    SHUT_FD1;\n"
5643 "                else\n"
5644 "                    printf(\"connect from %s\\en\",\n"
5645 "                            inet_ntoa(client_address.sin_addr));\n"
5646 "            }\n"
5647 "        }\n"
5648
5649 #. type: Plain text
5650 #: build/C/man2/select_tut.2:722
5651 #, no-wrap
5652 msgid "        /* NB: read oob data before normal reads */\n"
5653 msgstr "        /* NB: read oob data before normal reads */\n"
5654
5655 #. type: Plain text
5656 #: build/C/man2/select_tut.2:726
5657 #, no-wrap
5658 msgid ""
5659 "        if (fd1 E<gt> 0)\n"
5660 "            if (FD_ISSET(fd1, &er)) {\n"
5661 "                char c;\n"
5662 msgstr ""
5663 "        if (fd1 E<gt> 0)\n"
5664 "            if (FD_ISSET(fd1, &er)) {\n"
5665 "                char c;\n"
5666
5667 #. type: Plain text
5668 #: build/C/man2/select_tut.2:736
5669 #, no-wrap
5670 msgid ""
5671 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
5672 "                if (r E<lt> 1)\n"
5673 "                    SHUT_FD1;\n"
5674 "                else\n"
5675 "                    send(fd2, &c, 1, MSG_OOB);\n"
5676 "            }\n"
5677 "        if (fd2 E<gt> 0)\n"
5678 "            if (FD_ISSET(fd2, &er)) {\n"
5679 "                char c;\n"
5680 msgstr ""
5681 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
5682 "                if (r E<lt> 1)\n"
5683 "                    SHUT_FD1;\n"
5684 "                else\n"
5685 "                    send(fd2, &c, 1, MSG_OOB);\n"
5686 "            }\n"
5687 "        if (fd2 E<gt> 0)\n"
5688 "            if (FD_ISSET(fd2, &er)) {\n"
5689 "                char c;\n"
5690
5691 #. type: Plain text
5692 #: build/C/man2/select_tut.2:779
5693 #, no-wrap
5694 msgid ""
5695 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
5696 "                if (r E<lt> 1)\n"
5697 "                    SHUT_FD2;\n"
5698 "                else\n"
5699 "                    send(fd1, &c, 1, MSG_OOB);\n"
5700 "            }\n"
5701 "        if (fd1 E<gt> 0)\n"
5702 "            if (FD_ISSET(fd1, &rd)) {\n"
5703 "                r = read(fd1, buf1 + buf1_avail,\n"
5704 "                          BUF_SIZE - buf1_avail);\n"
5705 "                if (r E<lt> 1)\n"
5706 "                    SHUT_FD1;\n"
5707 "                else\n"
5708 "                    buf1_avail += r;\n"
5709 "            }\n"
5710 "        if (fd2 E<gt> 0)\n"
5711 "            if (FD_ISSET(fd2, &rd)) {\n"
5712 "                r = read(fd2, buf2 + buf2_avail,\n"
5713 "                          BUF_SIZE - buf2_avail);\n"
5714 "                if (r E<lt> 1)\n"
5715 "                    SHUT_FD2;\n"
5716 "                else\n"
5717 "                    buf2_avail += r;\n"
5718 "            }\n"
5719 "        if (fd1 E<gt> 0)\n"
5720 "            if (FD_ISSET(fd1, &wr)) {\n"
5721 "                r = write(fd1, buf2 + buf2_written,\n"
5722 "                           buf2_avail - buf2_written);\n"
5723 "                if (r E<lt> 1)\n"
5724 "                    SHUT_FD1;\n"
5725 "                else\n"
5726 "                    buf2_written += r;\n"
5727 "            }\n"
5728 "        if (fd2 E<gt> 0)\n"
5729 "            if (FD_ISSET(fd2, &wr)) {\n"
5730 "                r = write(fd2, buf1 + buf1_written,\n"
5731 "                           buf1_avail - buf1_written);\n"
5732 "                if (r E<lt> 1)\n"
5733 "                    SHUT_FD2;\n"
5734 "                else\n"
5735 "                    buf1_written += r;\n"
5736 "            }\n"
5737 msgstr ""
5738 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
5739 "                if (r E<lt> 1)\n"
5740 "                    SHUT_FD2;\n"
5741 "                else\n"
5742 "                    send(fd1, &c, 1, MSG_OOB);\n"
5743 "            }\n"
5744 "        if (fd1 E<gt> 0)\n"
5745 "            if (FD_ISSET(fd1, &rd)) {\n"
5746 "                r = read(fd1, buf1 + buf1_avail,\n"
5747 "                          BUF_SIZE - buf1_avail);\n"
5748 "                if (r E<lt> 1)\n"
5749 "                    SHUT_FD1;\n"
5750 "                else\n"
5751 "                    buf1_avail += r;\n"
5752 "            }\n"
5753 "        if (fd2 E<gt> 0)\n"
5754 "            if (FD_ISSET(fd2, &rd)) {\n"
5755 "                r = read(fd2, buf2 + buf2_avail,\n"
5756 "                          BUF_SIZE - buf2_avail);\n"
5757 "                if (r E<lt> 1)\n"
5758 "                    SHUT_FD2;\n"
5759 "                else\n"
5760 "                    buf2_avail += r;\n"
5761 "            }\n"
5762 "        if (fd1 E<gt> 0)\n"
5763 "            if (FD_ISSET(fd1, &wr)) {\n"
5764 "                r = write(fd1, buf2 + buf2_written,\n"
5765 "                           buf2_avail - buf2_written);\n"
5766 "                if (r E<lt> 1)\n"
5767 "                    SHUT_FD1;\n"
5768 "                else\n"
5769 "                    buf2_written += r;\n"
5770 "            }\n"
5771 "        if (fd2 E<gt> 0)\n"
5772 "            if (FD_ISSET(fd2, &wr)) {\n"
5773 "                r = write(fd2, buf1 + buf1_written,\n"
5774 "                           buf1_avail - buf1_written);\n"
5775 "                if (r E<lt> 1)\n"
5776 "                    SHUT_FD2;\n"
5777 "                else\n"
5778 "                    buf1_written += r;\n"
5779 "            }\n"
5780
5781 #. type: Plain text
5782 #: build/C/man2/select_tut.2:781
5783 #, no-wrap
5784 msgid "        /* check if write data has caught read data */\n"
5785 msgstr "        /* check if write data has caught read data */\n"
5786
5787 #. type: Plain text
5788 #: build/C/man2/select_tut.2:786
5789 #, no-wrap
5790 msgid ""
5791 "        if (buf1_written == buf1_avail)\n"
5792 "            buf1_written = buf1_avail = 0;\n"
5793 "        if (buf2_written == buf2_avail)\n"
5794 "            buf2_written = buf2_avail = 0;\n"
5795 msgstr ""
5796 "        if (buf1_written == buf1_avail)\n"
5797 "            buf1_written = buf1_avail = 0;\n"
5798 "        if (buf2_written == buf2_avail)\n"
5799 "            buf2_written = buf2_avail = 0;\n"
5800
5801 #. type: Plain text
5802 #: build/C/man2/select_tut.2:789
5803 #, no-wrap
5804 msgid ""
5805 "        /* one side has closed the connection, keep\n"
5806 "           writing to the other side until empty */\n"
5807 msgstr ""
5808 "        /* one side has closed the connection, keep\n"
5809 "           writing to the other side until empty */\n"
5810
5811 #. type: Plain text
5812 #: build/C/man2/select_tut.2:797
5813 #, no-wrap
5814 msgid ""
5815 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5816 "            SHUT_FD2;\n"
5817 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5818 "            SHUT_FD1;\n"
5819 "    }\n"
5820 "    exit(EXIT_SUCCESS);\n"
5821 "}\n"
5822 msgstr ""
5823 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5824 "            SHUT_FD2;\n"
5825 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5826 "            SHUT_FD1;\n"
5827 "    }\n"
5828 "    exit(EXIT_SUCCESS);\n"
5829 "}\n"
5830
5831 #. type: Plain text
5832 #: build/C/man2/select_tut.2:811
5833 msgid ""
5834 "The above program properly forwards most kinds of TCP connections including "
5835 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
5836 "problem of having data flow in both directions simultaneously.  You might "
5837 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
5838 "each stream.  This becomes more tricky than you might suspect.  Another idea "
5839 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
5840 "because you end up using inefficient timeouts."
5841 msgstr ""
5842 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
5843 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
5844 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
5845 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
5846 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
5847 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
5848 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
5849 "起こってしまう。"
5850
5851 #. type: Plain text
5852 #: build/C/man2/select_tut.2:817
5853 msgid ""
5854 "The program does not handle more than one simultaneous connection at a time, "
5855 "although it could easily be extended to do this with a linked list of buffers"
5856 "\\(emone for each connection.  At the moment, new connections cause the "
5857 "current connection to be dropped."
5858 msgstr ""
5859 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
5860 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
5861 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
5862
5863 #.  .SH AUTHORS
5864 #.  This man page was written by Paul Sheer.
5865 #. type: Plain text
5866 #: build/C/man2/select_tut.2:836
5867 msgid ""
5868 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5869 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5870 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5871 "(3), B<epoll>(7)"
5872 msgstr ""
5873 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5874 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5875 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5876 "(3), B<epoll>(7)"
5877
5878 #. type: TH
5879 #: build/C/man2/send.2:38
5880 #, no-wrap
5881 msgid "SEND"
5882 msgstr "SEND"
5883
5884 #. type: TH
5885 #: build/C/man2/send.2:38 build/C/man2/sendmmsg.2:28
5886 #, fuzzy, no-wrap
5887 #| msgid "2008-12-03"
5888 msgid "2012-02-27"
5889 msgstr "2008-12-03"
5890
5891 #. type: Plain text
5892 #: build/C/man2/send.2:41
5893 msgid "send, sendto, sendmsg - send a message on a socket"
5894 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
5895
5896 #. type: Plain text
5897 #: build/C/man2/send.2:45
5898 #, no-wrap
5899 msgid ""
5900 "B<#include E<lt>sys/types.hE<gt>>\n"
5901 "B<#include E<lt>sys/socket.hE<gt>>\n"
5902 msgstr ""
5903 "B<#include E<lt>sys/types.hE<gt>>\n"
5904 "B<#include E<lt>sys/socket.hE<gt>>\n"
5905
5906 #. type: Plain text
5907 #: build/C/man2/send.2:48
5908 #, no-wrap
5909 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5910 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5911
5912 #. type: Plain text
5913 #: build/C/man2/send.2:52
5914 #, no-wrap
5915 msgid ""
5916 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5917 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5918 msgstr ""
5919 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5920 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5921
5922 #. type: Plain text
5923 #: build/C/man2/send.2:55
5924 #, no-wrap
5925 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5926 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5927
5928 #. type: Plain text
5929 #: build/C/man2/send.2:63
5930 msgid ""
5931 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
5932 "transmit a message to another socket."
5933 msgstr ""
5934 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
5935 "メッセージを転送するのに使用される。"
5936
5937 #. type: Plain text
5938 #: build/C/man2/send.2:82
5939 msgid ""
5940 "The B<send>()  call may be used only when the socket is in a I<connected> "
5941 "state (so that the intended recipient is known).  The only difference "
5942 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
5943 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
5944 "following call"
5945 msgstr ""
5946 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
5947 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
5948 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
5949 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
5950
5951 #. type: Plain text
5952 #: build/C/man2/send.2:84
5953 #, no-wrap
5954 msgid "    send(sockfd, buf, len, flags);\n"
5955 msgstr "    send(sockfd, buf, len, flags);\n"
5956
5957 #. type: Plain text
5958 #: build/C/man2/send.2:86
5959 msgid "is equivalent to"
5960 msgstr "は以下と等価である。"
5961
5962 #. type: Plain text
5963 #: build/C/man2/send.2:88
5964 #, no-wrap
5965 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
5966 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
5967
5968 #. type: Plain text
5969 #: build/C/man2/send.2:92
5970 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
5971 msgstr ""
5972 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
5973 "る。"
5974
5975 #. type: Plain text
5976 #: build/C/man2/send.2:120
5977 msgid ""
5978 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
5979 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
5980 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
5981 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
5982 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
5983 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
5984 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
5985 "size."
5986 msgstr ""
5987 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
5988 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
5989 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
5990 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
5991 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
5992 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
5993 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
5994 "msg_namelen> で指定される。"
5995
5996 #. type: Plain text
5997 #: build/C/man2/send.2:136
5998 msgid ""
5999 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
6000 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
6001 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
6002 "ancillary data (also known as control information)."
6003 msgstr ""
6004 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
6005 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
6006 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
6007 "(制御情報とも呼ばれる) を送信することもできる。"
6008
6009 #. type: Plain text
6010 #: build/C/man2/send.2:141
6011 msgid ""
6012 "If the message is too long to pass atomically through the underlying "
6013 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
6014 "transmitted."
6015 msgstr ""
6016 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
6017 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
6018 "ラーが返され、そのメッセージは転送されない。"
6019
6020 #. type: Plain text
6021 #: build/C/man2/send.2:145
6022 msgid ""
6023 "No indication of failure to deliver is implicit in a B<send>().  Locally "
6024 "detected errors are indicated by a return value of -1."
6025 msgstr ""
6026 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
6027 "出された場合は、返り値 -1 として通知される。"
6028
6029 #. type: Plain text
6030 #: build/C/man2/send.2:158
6031 msgid ""
6032 "When the message does not fit into the send buffer of the socket, B<send>()  "
6033 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
6034 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
6035 "in this case.  The B<select>(2)  call may be used to determine when it is "
6036 "possible to send more data."
6037 msgstr ""
6038 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
6039 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
6040 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
6041 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
6042 "用することができる。"
6043
6044 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
6045 #. type: Plain text
6046 #: build/C/man2/send.2:164
6047 msgid ""
6048 "The I<flags> argument is the bitwise OR of zero or more of the following "
6049 "flags."
6050 msgstr ""
6051 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
6052 "のを指定する。"
6053
6054 #. type: TP
6055 #: build/C/man2/send.2:164
6056 #, no-wrap
6057 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
6058 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
6059
6060 #. type: Plain text
6061 #: build/C/man2/send.2:178
6062 msgid ""
6063 "Tell the link layer that forward progress happened: you got a successful "
6064 "reply from the other side.  If the link layer doesn't get this it will "
6065 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
6066 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
6067 "IPv4 and IPv6.  See B<arp>(7)  for details."
6068 msgstr ""
6069 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
6070 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
6071 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
6072 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
6073 "されている。 詳しくは B<arp>(7)  参照のこと。"
6074
6075 #. type: TP
6076 #: build/C/man2/send.2:178
6077 #, no-wrap
6078 msgid "B<MSG_DONTROUTE>"
6079 msgstr "B<MSG_DONTROUTE>"
6080
6081 #. type: Plain text
6082 #: build/C/man2/send.2:186
6083 msgid ""
6084 "Don't use a gateway to send out the packet, only send to hosts on directly "
6085 "connected networks.  This is usually used only by diagnostic or routing "
6086 "programs.  This is only defined for protocol families that route; packet "
6087 "sockets don't."
6088 msgstr ""
6089 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6090 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6091 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6092 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6093
6094 #. type: Plain text
6095 #: build/C/man2/send.2:197
6096 msgid ""
6097 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6098 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6099 "flag with the B<F_SETFL> B<fcntl>(2))."
6100 msgstr ""
6101 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6102 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6103 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6104
6105 #. type: TP
6106 #: build/C/man2/send.2:197
6107 #, no-wrap
6108 msgid "B<MSG_EOR> (since Linux 2.2)"
6109 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6110
6111 #. type: Plain text
6112 #: build/C/man2/send.2:201
6113 msgid ""
6114 "Terminates a record (when this notion is supported, as for sockets of type "
6115 "B<SOCK_SEQPACKET>)."
6116 msgstr ""
6117 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6118 "ケット種別のときに有効)。"
6119
6120 #. type: TP
6121 #: build/C/man2/send.2:201
6122 #, no-wrap
6123 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6124 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6125
6126 #. type: Plain text
6127 #: build/C/man2/send.2:210
6128 msgid ""
6129 "The caller has more data to send.  This flag is used with TCP sockets to "
6130 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6131 "with the difference that this flag can be set on a per-call basis."
6132 msgstr ""
6133 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6134 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6135 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6136 "機能を有効にできる点である。"
6137
6138 #. type: Plain text
6139 #: build/C/man2/send.2:219
6140 msgid ""
6141 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6142 "the kernel to package all of the data sent in calls with this flag set into "
6143 "a single datagram which is only transmitted when a call is performed that "
6144 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6145 "described in B<udp>(7).)"
6146 msgstr ""
6147 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6148 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6149 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6150 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6151 "ソケットオプション B<UDP_CORK> も参照)。"
6152
6153 #. type: TP
6154 #: build/C/man2/send.2:219
6155 #, no-wrap
6156 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6157 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6158
6159 #. type: Plain text
6160 #: build/C/man2/send.2:228
6161 msgid ""
6162 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6163 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6164 msgstr ""
6165 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6166 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6167
6168 #. type: Plain text
6169 #: build/C/man2/send.2:237
6170 msgid ""
6171 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6172 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6173 "data."
6174 msgstr ""
6175 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6176 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6177 "をサポートしている必要がある。"
6178
6179 #. type: Plain text
6180 #: build/C/man2/send.2:244
6181 msgid ""
6182 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6183 "below for an exact description of its fields."
6184 msgstr ""
6185 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6186 "B<recv>(2)  と以下の説明を参照すること。"
6187
6188 #.  Still to be documented:
6189 #.   Send file descriptors and user credentials using the
6190 #.   msg_control* fields.
6191 #.   The flags returned in msg_flags.
6192 #. type: Plain text
6193 #: build/C/man2/send.2:273
6194 msgid ""
6195 "You may send control information using the I<msg_control> and "
6196 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6197 "process is limited per socket by the value in I</proc/sys/net/core/"
6198 "optmem_max>; see B<socket>(7)."
6199 msgstr ""
6200 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6201 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6202 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6203
6204 #. type: Plain text
6205 #: build/C/man2/send.2:278
6206 msgid ""
6207 "On success, these calls return the number of characters sent.  On error, -1 "
6208 "is returned, and I<errno> is set appropriately."
6209 msgstr ""
6210 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6211 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6212
6213 #. type: Plain text
6214 #: build/C/man2/send.2:283
6215 msgid ""
6216 "These are some standard errors generated by the socket layer.  Additional "
6217 "errors may be generated and returned from the underlying protocol modules; "
6218 "see their respective manual pages."
6219 msgstr ""
6220 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6221 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6222 "れぞれのマニュアルを参照すること。"
6223
6224 #. type: Plain text
6225 #: build/C/man2/send.2:291
6226 msgid ""
6227 "(For UNIX domain sockets, which are identified by pathname)  Write "
6228 "permission is denied on the destination socket file, or search permission is "
6229 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6230 "(7).)"
6231 msgstr ""
6232 "(UNIX ドメインソケットはパス名で識別される。)  ソケット・ファイルへの書き込み"
6233 "許可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許"
6234 "可がなかった。 (B<path_resolution>(7)  も参照のこと)"
6235
6236 #.  Actually EAGAIN on Linux
6237 #. type: Plain text
6238 #: build/C/man2/send.2:299
6239 msgid ""
6240 "The socket is marked nonblocking and the requested operation would block.  "
6241 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6242 "require these constants to have the same value, so a portable application "
6243 "should check for both possibilities."
6244 msgstr ""
6245 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6246 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6247 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6248 "両方の可能性を 確認すべきである。"
6249
6250 #. type: Plain text
6251 #: build/C/man2/send.2:302
6252 msgid "An invalid descriptor was specified."
6253 msgstr "無効なディスクリプターが指定された。"
6254
6255 #. type: TP
6256 #: build/C/man2/send.2:302
6257 #, no-wrap
6258 msgid "B<ECONNRESET>"
6259 msgstr "B<ECONNRESET>"
6260
6261 #. type: Plain text
6262 #: build/C/man2/send.2:305
6263 msgid "Connection reset by peer."
6264 msgstr "接続が接続相手によりリセットされた。"
6265
6266 #. type: TP
6267 #: build/C/man2/send.2:305
6268 #, no-wrap
6269 msgid "B<EDESTADDRREQ>"
6270 msgstr "B<EDESTADDRREQ>"
6271
6272 #. type: Plain text
6273 #: build/C/man2/send.2:308
6274 msgid "The socket is not connection-mode, and no peer address is set."
6275 msgstr ""
6276 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6277 "ていない。"
6278
6279 #. type: Plain text
6280 #: build/C/man2/send.2:311
6281 msgid "An invalid user space address was specified for an argument."
6282 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6283
6284 #. type: Plain text
6285 #: build/C/man2/send.2:315
6286 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6287 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6288
6289 #. type: Plain text
6290 #: build/C/man2/send.2:324
6291 msgid ""
6292 "The connection-mode socket was connected already but a recipient was "
6293 "specified.  (Now either this error is returned, or the recipient "
6294 "specification is ignored.)"
6295 msgstr ""
6296 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6297 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6298 "いずれかとなる)"
6299
6300 #. type: TP
6301 #: build/C/man2/send.2:324
6302 #, no-wrap
6303 msgid "B<EMSGSIZE>"
6304 msgstr "B<EMSGSIZE>"
6305
6306 #.  (e.g., SOCK_DGRAM )
6307 #. type: Plain text
6308 #: build/C/man2/send.2:330
6309 msgid ""
6310 "The socket type requires that message be sent atomically, and the size of "
6311 "the message to be sent made this impossible."
6312 msgstr ""
6313 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6314 "るが、 メッセージが大き過ぎるため送信することができない。"
6315
6316 #. type: Plain text
6317 #: build/C/man2/send.2:338
6318 msgid ""
6319 "The output queue for a network interface was full.  This generally indicates "
6320 "that the interface has stopped sending, but may be caused by transient "
6321 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6322 "silently dropped when a device queue overflows.)"
6323 msgstr ""
6324 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6325 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6326 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6327 "フローした場合にはパケットは黙って捨てられる)"
6328
6329 #. type: Plain text
6330 #: build/C/man2/send.2:341
6331 msgid "No memory available."
6332 msgstr "メモリが足りない。"
6333
6334 #. type: Plain text
6335 #: build/C/man2/send.2:344
6336 msgid "The socket is not connected, and no target has been given."
6337 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6338
6339 #. type: Plain text
6340 #: build/C/man2/send.2:354
6341 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6342 msgstr ""
6343 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6344 "る。"
6345
6346 #. type: TP
6347 #: build/C/man2/send.2:354
6348 #, no-wrap
6349 msgid "B<EPIPE>"
6350 msgstr "B<EPIPE>"
6351
6352 #. type: Plain text
6353 #: build/C/man2/send.2:363
6354 msgid ""
6355 "The local end has been shut down on a connection oriented socket.  In this "
6356 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6357 "set."
6358 msgstr ""
6359 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6360 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6361
6362 #. type: Plain text
6363 #: build/C/man2/send.2:366
6364 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
6365 msgstr ""
6366 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
6367
6368 #. type: Plain text
6369 #: build/C/man2/send.2:377
6370 msgid ""
6371 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags.  "
6372 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
6373 "flag is a Linux extension."
6374 msgstr ""
6375 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
6376 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
6377 "ラグは Linux での拡張である。"
6378
6379 #. type: Plain text
6380 #: build/C/man2/send.2:390
6381 msgid ""
6382 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
6383 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
6384 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
6385 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
6386 "and libc5.  See also B<accept>(2)."
6387 msgstr ""
6388 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
6389 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
6390 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
6391 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
6392 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
6393
6394 #. type: Plain text
6395 #: build/C/man2/send.2:409
6396 #, fuzzy
6397 #| msgid ""
6398 #| "See B<recvmmsg(2)> for information about a Linux-specific system call "
6399 #| "that can be used to receive multiple datagrams in a single call."
6400 msgid ""
6401 "See B<sendmmsg(2)> for information about a Linux-specific system call that "
6402 "can be used to transmit multiple datagrams in a single call."
6403 msgstr ""
6404 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
6405 "固有の システムコールに関する情報が書かれている。"
6406
6407 #. type: Plain text
6408 #: build/C/man2/send.2:414
6409 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
6410 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
6411
6412 #. type: Plain text
6413 #: build/C/man2/send.2:419
6414 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
6415 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
6416
6417 #. type: Plain text
6418 #: build/C/man2/send.2:434
6419 #, fuzzy
6420 #| msgid ""
6421 #| "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6422 #| "B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>(7), B<socket>"
6423 #| "(7), B<tcp>(7), B<udp>(7)"
6424 msgid ""
6425 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6426 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6427 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6428 msgstr ""
6429 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6430 "B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>(7), B<socket>"
6431 "(7), B<tcp>(7), B<udp>(7)"
6432
6433 #. type: TH
6434 #: build/C/man2/sendmmsg.2:28
6435 #, fuzzy, no-wrap
6436 #| msgid "SEND"
6437 msgid "SENDMMSG"
6438 msgstr "SEND"
6439
6440 #. type: Plain text
6441 #: build/C/man2/sendmmsg.2:31
6442 #, fuzzy
6443 #| msgid "recvmmsg - receive multiple messages on a socket"
6444 msgid "sendmmsg - send multiple messages on a socket"
6445 msgstr "recvmmsg - receive multiple messages on a socket"
6446
6447 #. type: Plain text
6448 #: build/C/man2/sendmmsg.2:39
6449 #, fuzzy, no-wrap
6450 #| msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6451 msgid ""
6452 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6453 "B<             unsigned int >I<flags>B<);>\n"
6454 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6455
6456 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
6457 #. type: Plain text
6458 #: build/C/man2/sendmmsg.2:49
6459 #, fuzzy
6460 #| msgid ""
6461 #| "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that "
6462 #| "allows the caller to receive multiple messages from a socket using a "
6463 #| "single system call.  (This has performance benefits for some "
6464 #| "applications.)  A further extension over B<recvmsg>(2)  is support for a "
6465 #| "timeout on the receive operation."
6466 msgid ""
6467 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
6468 "the caller to transmit multiple messages on a socket using a single system "
6469 "call.  (This has performance benefits for some applications.)"
6470 msgstr ""
6471 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
6472 "the caller to receive multiple messages from a socket using a single system "
6473 "call.  (This has performance benefits for some applications.)  A further "
6474 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
6475 "operation."
6476
6477 #. type: Plain text
6478 #: build/C/man2/sendmmsg.2:54
6479 #, fuzzy
6480 #| msgid ""
6481 #| "The I<sockfd> argument is the file descriptor of the socket to receive "
6482 #| "data from."
6483 msgid ""
6484 "The I<sockfd> argument is the file descriptor of the socket on which data is "
6485 "to be transmitted."
6486 msgstr ""
6487 "The I<sockfd> argument is the file descriptor of the socket to receive data "
6488 "from."
6489
6490 #. type: Plain text
6491 #: build/C/man2/sendmmsg.2:75
6492 #, fuzzy, no-wrap
6493 #| msgid ""
6494 #| "struct mmsghdr {\n"
6495 #| "    struct msghdr msg_hdr;  /* Message header */\n"
6496 #| "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
6497 #| "};\n"
6498 msgid ""
6499 "struct mmsghdr {\n"
6500 "    struct msghdr msg_hdr;  /* Message header */\n"
6501 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
6502 "};\n"
6503 msgstr ""
6504 "struct mmsghdr {\n"
6505 "    struct msghdr msg_hdr;  /* Message header */\n"
6506 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
6507 "};\n"
6508
6509 #. type: Plain text
6510 #: build/C/man2/sendmmsg.2:91
6511 #, fuzzy
6512 #| msgid ""
6513 #| "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
6514 #| "(2).  The I<msg_len> field is the number of bytes returned for the "
6515 #| "message in the entry.  This field has the same value as the return value "
6516 #| "of a single B<recvmsg>(2)  on the header."
6517 msgid ""
6518 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
6519 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
6520 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
6521 "B<sendmsg>(2)  call)."
6522 msgstr ""
6523 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
6524 "(2).  The I<msg_len> field is the number of bytes returned for the message "
6525 "in the entry.  This field has the same value as the return value of a single "
6526 "B<recvmsg>(2)  on the header."
6527
6528 #. type: Plain text
6529 #: build/C/man2/sendmmsg.2:97
6530 #, fuzzy
6531 #| msgid ""
6532 #| "The I<flags> argument contains flags ORed together.  The flags are the "
6533 #| "same as documented for B<recvmsg>(2), with the following addition:"
6534 msgid ""
6535 "The I<flags> argument contains flags ORed together.  The flags are the same "
6536 "as for B<sendmsg>(2)."
6537 msgstr ""
6538 "The I<flags> argument contains flags ORed together.  The flags are the same "
6539 "as documented for B<recvmsg>(2), with the following addition:"
6540
6541 #. type: Plain text
6542 #: build/C/man2/sendmmsg.2:107
6543 #, fuzzy
6544 #| msgid ""
6545 #| "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
6546 #| "received or until the timeout expires.  A nonblocking call reads as many "
6547 #| "messages as are available (up to the limit specified by I<vlen>)  and "
6548 #| "returns immediately."
6549 msgid ""
6550 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
6551 "sent.  A nonblocking call sends as many messages as possible (up to the "
6552 "limit specified by I<vlen>)  and returns immediately."
6553 msgstr ""
6554 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
6555 "received or until the timeout expires.  A nonblocking call reads as many "
6556 "messages as are available (up to the limit specified by I<vlen>)  and "
6557 "returns immediately."
6558
6559 #. type: Plain text
6560 #: build/C/man2/sendmmsg.2:119
6561 #, fuzzy
6562 #| msgid ""
6563 #| "On return from B<recvmmsg>(), successive elements of I<msgvec> are "
6564 #| "updated to contain information about each received message: I<msg_len> "
6565 #| "contains the size of the received message; the subfields of I<msg_hdr> "
6566 #| "are updated as described in B<recvmsg>(2).  The return value of the call "
6567 #| "indicates the number of elements of I<msgvec> that have been updated."
6568 msgid ""
6569 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
6570 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
6571 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
6572 "of elements of I<msgvec> that have been updated."
6573 msgstr ""
6574 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
6575 "to contain information about each received message: I<msg_len> contains the "
6576 "size of the received message; the subfields of I<msg_hdr> are updated as "
6577 "described in B<recvmsg>(2).  The return value of the call indicates the "
6578 "number of elements of I<msgvec> that have been updated."
6579
6580 #. type: Plain text
6581 #: build/C/man2/sendmmsg.2:129
6582 #, fuzzy
6583 #| msgid ""
6584 #| "On success, B<recvmmsg>()  returns the number of messages received in "
6585 #| "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
6586 #| "error."
6587 msgid ""
6588 "On success, B<sendmmsg>()  returns the number of messages sent from "
6589 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
6590 "B<sendmmsg>()  call to send the remaining messages."
6591 msgstr ""
6592 "On success, B<recvmmsg>()  returns the number of messages received in "
6593 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
6594 "error."
6595
6596 #. type: Plain text
6597 #: build/C/man2/sendmmsg.2:133
6598 #, fuzzy
6599 #| msgid ""
6600 #| "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
6601 #| "I<errno> set to indicate the cause of the error."
6602 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
6603 msgstr ""
6604 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
6605 "I<errno> にエラーの原因を示す値を設定する。"
6606
6607 #
6608 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
6609 #.      ... only return an error if no datagrams could be sent.
6610 #.      If less than the requested number of messages were sent, the application
6611 #.      must retry starting at the first failed one and if the problem is
6612 #.      persistent the error will be returned.
6613 #.      This matches the behaviour of other syscalls like read/write - it
6614 #.      is not an error if less than the requested number of elements are sent.
6615 #. type: Plain text
6616 #: build/C/man2/sendmmsg.2:145
6617 msgid ""
6618 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
6619 "could be sent."
6620 msgstr ""
6621
6622 #. type: Plain text
6623 #: build/C/man2/sendmmsg.2:150
6624 #, fuzzy
6625 #| msgid ""
6626 #| "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in "
6627 #| "glibc was added in version 2.12."
6628 msgid ""
6629 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
6630 "added in version 2.14."
6631 msgstr ""
6632 "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in glibc "
6633 "was added in version 2.12."
6634
6635 #. type: Plain text
6636 #: build/C/man2/sendmmsg.2:153
6637 #, fuzzy
6638 #| msgid "B<recvmmsg>()  is Linux-specific."
6639 msgid "B<sendmmsg>()  is Linux-specific."
6640 msgstr "B<recvmmsg>()  is Linux-specific."
6641
6642 #
6643 #
6644 #.  commit 98382f419f32d2c12d021943b87dea555677144b
6645 #.      net: Cap number of elements for sendmmsg
6646 #.      To limit the amount of time we can spend in sendmmsg, cap the
6647 #.      number of elements to UIO_MAXIOV (currently 1024).
6648 #.      For error handling an application using sendmmsg needs to retry at
6649 #.      the first unsent message, so capping is simpler and requires less
6650 #.      application logic than returning EINVAL.
6651 #. type: Plain text
6652 #: build/C/man2/sendmmsg.2:168
6653 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
6654 msgstr ""
6655
6656 #. type: Plain text
6657 #: build/C/man2/sendmmsg.2:173
6658 #, fuzzy
6659 #| msgid ""
6660 #| "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), "
6661 #| "B<socket>(2), B<socket>(7)"
6662 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
6663 msgstr ""
6664 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
6665 "(2), B<socket>(7)"
6666
6667 #. type: TH
6668 #: build/C/man3/sockatmark.3:23
6669 #, no-wrap
6670 msgid "SOCKATMARK"
6671 msgstr "SOCKATMARK"
6672
6673 #. type: Plain text
6674 #: build/C/man3/sockatmark.3:26
6675 msgid "sockatmark - determine whether socket is at out-of-band mark"
6676 msgstr ""
6677 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
6678 "べる"
6679
6680 #. type: Plain text
6681 #: build/C/man3/sockatmark.3:28 build/C/man2/socket.2:48
6682 #: build/C/man7/socket.7:31 build/C/man2/socketpair.2:47
6683 msgid "B<#include E<lt>sys/socket.hE<gt>>"
6684 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
6685
6686 #. type: Plain text
6687 #: build/C/man3/sockatmark.3:30
6688 msgid "B<int sockatmark(int >I<sockfd>B<);>"
6689 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
6690
6691 #. type: Plain text
6692 #: build/C/man3/sockatmark.3:39
6693 msgid ""
6694 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6695 "\\ 600"
6696 msgstr ""
6697 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6698 "\\ 600"
6699
6700 #. type: Plain text
6701 #: build/C/man3/sockatmark.3:49
6702 msgid ""
6703 "B<sockatmark>()  returns a value indicating whether or not the socket "
6704 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
6705 "the socket is at the mark, then 1 is returned; if the socket is not at the "
6706 "mark, 0 is returned.  This function does not remove the out-of-band mark."
6707 msgstr ""
6708 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
6709 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
6710 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
6711 "この関数は帯域外マークを削除しない。"
6712
6713 #. type: Plain text
6714 #: build/C/man3/sockatmark.3:54
6715 msgid ""
6716 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
6717 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
6718 "set to indicate the error."
6719 msgstr ""
6720 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
6721 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
6722 "れ、エラーを表す I<errno> が設定される。"
6723
6724 #. type: Plain text
6725 #: build/C/man3/sockatmark.3:59
6726 msgid "I<sockfd> is not a valid file descriptor."
6727 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
6728
6729 #.  POSIX.1 says ENOTTY for this case
6730 #. type: Plain text
6731 #: build/C/man3/sockatmark.3:66
6732 msgid ""
6733 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
6734 msgstr ""
6735 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
6736
6737 #. type: Plain text
6738 #: build/C/man3/sockatmark.3:69
6739 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
6740 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
6741
6742 #. type: Plain text
6743 #: build/C/man3/sockatmark.3:71
6744 msgid "POSIX.1-2001."
6745 msgstr "POSIX.1-2001."
6746
6747 #. type: Plain text
6748 #: build/C/man3/sockatmark.3:78
6749 msgid ""
6750 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
6751 "the B<MSG_OOB> flag of B<recv>(2)."
6752 msgstr ""
6753 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
6754 "B<recv>(2)  で読み込むことができる。"
6755
6756 #. type: Plain text
6757 #: build/C/man3/sockatmark.3:80
6758 msgid "Out-of-band data is only supported on some stream socket protocols."
6759 msgstr ""
6760 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
6761 "ない。"
6762
6763 #. type: Plain text
6764 #: build/C/man3/sockatmark.3:85
6765 msgid ""
6766 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
6767 "signal."
6768 msgstr ""
6769 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
6770 "る。"
6771
6772 #. type: Plain text
6773 #: build/C/man3/sockatmark.3:91
6774 msgid ""
6775 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
6776 "operation."
6777 msgstr ""
6778 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
6779
6780 #. type: Plain text
6781 #: build/C/man3/sockatmark.3:95
6782 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
6783 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
6784
6785 #. type: Plain text
6786 #: build/C/man3/sockatmark.3:100
6787 msgid ""
6788 "The following code can be used after receipt of a B<SIGURG> signal to read "
6789 "(and discard) all data up to the mark, and then read the byte of data at the "
6790 "mark:"
6791 msgstr ""
6792 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
6793 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
6794
6795 #. type: Plain text
6796 #: build/C/man3/sockatmark.3:105
6797 #, no-wrap
6798 msgid ""
6799 "    char buf[BUF_LEN];\n"
6800 "    char oobdata;\n"
6801 "    int atmark, s;\n"
6802 msgstr ""
6803 "    char buf[BUF_LEN];\n"
6804 "    char oobdata;\n"
6805 "    int atmark, s;\n"
6806
6807 #. type: Plain text
6808 #: build/C/man3/sockatmark.3:112
6809 #, no-wrap
6810 msgid ""
6811 "    for (;;) {\n"
6812 "        atmark = sockatmark(sockfd);\n"
6813 "        if (atmark == -1) {\n"
6814 "            perror(\"sockatmark\");\n"
6815 "            break;\n"
6816 "        }\n"
6817 msgstr ""
6818 "    for (;;) {\n"
6819 "        atmark = sockatmark(sockfd);\n"
6820 "        if (atmark == -1) {\n"
6821 "            perror(\"sockatmark\");\n"
6822 "            break;\n"
6823 "        }\n"
6824
6825 #. type: Plain text
6826 #: build/C/man3/sockatmark.3:115
6827 #, no-wrap
6828 msgid ""
6829 "        if (atmark)\n"
6830 "            break;\n"
6831 msgstr ""
6832 "        if (atmark)\n"
6833 "            break;\n"
6834
6835 #. type: Plain text
6836 #: build/C/man3/sockatmark.3:122
6837 #, no-wrap
6838 msgid ""
6839 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6840 "        if (s == -1)\n"
6841 "            perror(\"read\");\n"
6842 "        if (s E<lt>= 0)\n"
6843 "            break;\n"
6844 "    }\n"
6845 msgstr ""
6846 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6847 "        if (s == -1)\n"
6848 "            perror(\"read\");\n"
6849 "        if (s E<lt>= 0)\n"
6850 "            break;\n"
6851 "    }\n"
6852
6853 #. type: Plain text
6854 #: build/C/man3/sockatmark.3:129
6855 #, no-wrap
6856 msgid ""
6857 "    if (atmark == 1) {\n"
6858 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6859 "            perror(\"recv\");\n"
6860 "            ...\n"
6861 "        }\n"
6862 "    }\n"
6863 msgstr ""
6864 "    if (atmark == 1) {\n"
6865 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6866 "            perror(\"recv\");\n"
6867 "            ...\n"
6868 "        }\n"
6869 "    }\n"
6870
6871 #. type: Plain text
6872 #: build/C/man3/sockatmark.3:135
6873 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6874 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6875
6876 #. type: TH
6877 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
6878 #, no-wrap
6879 msgid "SOCKET"
6880 msgstr "SOCKET"
6881
6882 #. type: TH
6883 #: build/C/man2/socket.2:41
6884 #, no-wrap
6885 msgid "2009-01-19"
6886 msgstr "2009-01-19"
6887
6888 #. type: Plain text
6889 #: build/C/man2/socket.2:44
6890 msgid "socket - create an endpoint for communication"
6891 msgstr "socket - 通信のための端点(endpoint)を作成する"
6892
6893 #. type: Plain text
6894 #: build/C/man2/socket.2:46 build/C/man2/socketpair.2:45
6895 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
6896 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
6897
6898 #. type: Plain text
6899 #: build/C/man2/socket.2:50
6900 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6901 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6902
6903 #. type: Plain text
6904 #: build/C/man2/socket.2:53
6905 msgid ""
6906 "B<socket>()  creates an endpoint for communication and returns a descriptor."
6907 msgstr ""
6908 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
6909 "(descriptor)を返す。"
6910
6911 #. type: Plain text
6912 #: build/C/man2/socket.2:61
6913 msgid ""
6914 "The I<domain> argument specifies a communication domain; this selects the "
6915 "protocol family which will be used for communication.  These families are "
6916 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
6917 "include:"
6918 msgstr ""
6919 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
6920 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
6921 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
6922 "下の通り。"
6923
6924 #. type: tbl table
6925 #: build/C/man2/socket.2:64
6926 #, no-wrap
6927 msgid "Name:Purpose:Man page\n"
6928 msgstr "名前:目的:マニュアル\n"
6929
6930 #. type: tbl table
6931 #: build/C/man2/socket.2:65 build/C/man2/socket.2:72 build/C/man2/socket.2:77
6932 #: build/C/man2/socket.2:82 build/C/man2/socket.2:85 build/C/man2/socket.2:92
6933 #: build/C/man2/socket.2:97 build/C/man2/socket.2:102
6934 #: build/C/man2/socket.2:105 build/C/man2/socket.2:110
6935 #, no-wrap
6936 msgid "T{\n"
6937 msgstr "T{\n"
6938
6939 #. type: tbl table
6940 #: build/C/man2/socket.2:66
6941 #, no-wrap
6942 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
6943 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
6944
6945 #. type: tbl table
6946 #: build/C/man2/socket.2:67 build/C/man2/socket.2:69 build/C/man2/socket.2:87
6947 #: build/C/man2/socket.2:89 build/C/man2/socket.2:99 build/C/man2/socket.2:112
6948 #: build/C/man2/socket.2:114 build/C/man7/socket.7:162
6949 #, no-wrap
6950 msgid "T}:T{\n"
6951 msgstr "T}:T{\n"
6952
6953 #. type: tbl table
6954 #: build/C/man2/socket.2:68
6955 #, no-wrap
6956 msgid "Local communication\n"
6957 msgstr "ローカル通信\n"
6958
6959 #. type: tbl table
6960 #: build/C/man2/socket.2:70
6961 #, no-wrap
6962 msgid "B<unix>(7)\n"
6963 msgstr "B<unix>(7)\n"
6964
6965 #. type: tbl table
6966 #: build/C/man2/socket.2:71 build/C/man2/socket.2:76 build/C/man2/socket.2:81
6967 #: build/C/man2/socket.2:91 build/C/man2/socket.2:96 build/C/man2/socket.2:109
6968 #: build/C/man2/socket.2:116 build/C/man7/socket.7:141
6969 #: build/C/man7/socket.7:145 build/C/man7/socket.7:148
6970 #: build/C/man7/socket.7:154 build/C/man7/socket.7:157
6971 #: build/C/man7/socket.7:166 build/C/man7/socket.7:173
6972 #, no-wrap
6973 msgid "T}\n"
6974 msgstr "T}\n"
6975
6976 #. type: tbl table
6977 #: build/C/man2/socket.2:73
6978 #, no-wrap
6979 msgid "B<AF_INET>\n"
6980 msgstr "B<AF_INET>\n"
6981
6982 #. type: tbl table
6983 #: build/C/man2/socket.2:74
6984 #, no-wrap
6985 msgid "T}:IPv4 Internet protocols:T{\n"
6986 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
6987
6988 #. type: tbl table
6989 #: build/C/man2/socket.2:75
6990 #, no-wrap
6991 msgid "B<ip>(7)\n"
6992 msgstr "B<ip>(7)\n"
6993
6994 #. type: tbl table
6995 #: build/C/man2/socket.2:78
6996 #, no-wrap
6997 msgid "B<AF_INET6>\n"
6998 msgstr "B<AF_INET6>\n"
6999
7000 #. type: tbl table
7001 #: build/C/man2/socket.2:79
7002 #, no-wrap
7003 msgid "T}:IPv6 Internet protocols:T{\n"
7004 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
7005
7006 #. type: tbl table
7007 #: build/C/man2/socket.2:80
7008 #, no-wrap
7009 msgid "B<ipv6>(7)\n"
7010 msgstr "B<ipv6>(7)\n"
7011
7012 #. type: tbl table
7013 #: build/C/man2/socket.2:83
7014 #, no-wrap
7015 msgid "B<AF_IPX>\n"
7016 msgstr "B<AF_IPX>\n"
7017
7018 #. type: tbl table
7019 #: build/C/man2/socket.2:84
7020 #, no-wrap
7021 msgid "T}:IPX - Novell protocols:\n"
7022 msgstr "T}:IPX - Novell プロトコル:\n"
7023
7024 #. type: tbl table
7025 #: build/C/man2/socket.2:86
7026 #, no-wrap
7027 msgid "B<AF_NETLINK>\n"
7028 msgstr "B<AF_NETLINK>\n"
7029
7030 #. type: tbl table
7031 #: build/C/man2/socket.2:88
7032 #, no-wrap
7033 msgid "Kernel user interface device\n"
7034 msgstr "カーネル・ユーザ・デバイス\n"
7035
7036 #. type: tbl table
7037 #: build/C/man2/socket.2:90
7038 #, no-wrap
7039 msgid "B<netlink>(7)\n"
7040 msgstr "B<netlink>(7)\n"
7041
7042 #. type: tbl table
7043 #: build/C/man2/socket.2:93
7044 #, no-wrap
7045 msgid "B<AF_X25>\n"
7046 msgstr "B<AF_X25>\n"
7047
7048 #. type: tbl table
7049 #: build/C/man2/socket.2:94
7050 #, no-wrap
7051 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
7052 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
7053
7054 #. type: tbl table
7055 #: build/C/man2/socket.2:95
7056 #, no-wrap
7057 msgid "B<x25>(7)\n"
7058 msgstr "B<x25>(7)\n"
7059
7060 #. type: tbl table
7061 #: build/C/man2/socket.2:98
7062 #, no-wrap
7063 msgid "B<AF_AX25>\n"
7064 msgstr "B<AF_AX25>\n"
7065
7066 #. type: tbl table
7067 #: build/C/man2/socket.2:100
7068 #, no-wrap
7069 msgid "Amateur radio AX.25 protocol\n"
7070 msgstr "アマチュア無線 AX.25 プロトコル\n"
7071
7072 #. type: tbl table
7073 #: build/C/man2/socket.2:101
7074 #, no-wrap
7075 msgid "T}:\n"
7076 msgstr "T}:\n"
7077
7078 #. type: tbl table
7079 #: build/C/man2/socket.2:103
7080 #, no-wrap
7081 msgid "B<AF_ATMPVC>\n"
7082 msgstr "B<AF_ATMPVC>\n"
7083
7084 #. type: tbl table
7085 #: build/C/man2/socket.2:104
7086 #, no-wrap
7087 msgid "T}:Access to raw ATM PVCs:\n"
7088 msgstr "T}:生の ATM PVC にアクセスする:\n"
7089
7090 #. type: tbl table
7091 #: build/C/man2/socket.2:106
7092 #, no-wrap
7093 msgid "B<AF_APPLETALK>\n"
7094 msgstr "B<AF_APPLETALK>\n"
7095
7096 #. type: tbl table
7097 #: build/C/man2/socket.2:107
7098 #, no-wrap
7099 msgid "T}:Appletalk:T{\n"
7100 msgstr "T}:アップルトーク:T{\n"
7101
7102 #. type: tbl table
7103 #: build/C/man2/socket.2:108
7104 #, no-wrap
7105 msgid "B<ddp>(7)\n"
7106 msgstr "B<ddp>(7)\n"
7107
7108 #. type: tbl table
7109 #: build/C/man2/socket.2:111
7110 #, no-wrap
7111 msgid "B<AF_PACKET>\n"
7112 msgstr "B<AF_PACKET>\n"
7113
7114 #. type: tbl table
7115 #: build/C/man2/socket.2:113
7116 #, no-wrap
7117 msgid "Low level packet interface\n"
7118 msgstr "低レベルのパケットインターフェース\n"
7119
7120 #. type: tbl table
7121 #: build/C/man2/socket.2:115
7122 #, no-wrap
7123 msgid "B<packet>(7)\n"
7124 msgstr "B<packet>(7)\n"
7125
7126 #. type: Plain text
7127 #: build/C/man2/socket.2:124
7128 msgid ""
7129 "The socket has the indicated I<type>, which specifies the communication "
7130 "semantics.  Currently defined types are:"
7131 msgstr ""
7132 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
7133 "る。 定義されている型は現在以下の通り。"
7134
7135 #. type: TP
7136 #: build/C/man2/socket.2:124
7137 #, no-wrap
7138 msgid "B<SOCK_STREAM>"
7139 msgstr "B<SOCK_STREAM>"
7140
7141 #. type: Plain text
7142 #: build/C/man2/socket.2:128
7143 msgid ""
7144 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
7145 "out-of-band data transmission mechanism may be supported."
7146 msgstr ""
7147 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
7148 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
7149
7150 #. type: TP
7151 #: build/C/man2/socket.2:128
7152 #, no-wrap
7153 msgid "B<SOCK_DGRAM>"
7154 msgstr "B<SOCK_DGRAM>"
7155
7156 #. type: Plain text
7157 #: build/C/man2/socket.2:132
7158 msgid ""
7159 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
7160 "length)."
7161 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ)  をサポートする。"
7162
7163 #. type: TP
7164 #: build/C/man2/socket.2:132
7165 #, no-wrap
7166 msgid "B<SOCK_SEQPACKET>"
7167 msgstr "B<SOCK_SEQPACKET>"
7168
7169 #. type: Plain text
7170 #: build/C/man2/socket.2:137
7171 msgid ""
7172 "Provides a sequenced, reliable, two-way connection-based data transmission "
7173 "path for datagrams of fixed maximum length; a consumer is required to read "
7174 "an entire packet with each input system call."
7175 msgstr ""
7176 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7177 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7178 "ト全体を読み取ることが要求される。"
7179
7180 #. type: TP
7181 #: build/C/man2/socket.2:137
7182 #, no-wrap
7183 msgid "B<SOCK_RAW>"
7184 msgstr "B<SOCK_RAW>"
7185
7186 #. type: Plain text
7187 #: build/C/man2/socket.2:140
7188 msgid "Provides raw network protocol access."
7189 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7190
7191 #. type: TP
7192 #: build/C/man2/socket.2:140
7193 #, no-wrap
7194 msgid "B<SOCK_RDM>"
7195 msgstr "B<SOCK_RDM>"
7196
7197 #. type: Plain text
7198 #: build/C/man2/socket.2:143
7199 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7200 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7201
7202 #. type: TP
7203 #: build/C/man2/socket.2:143
7204 #, no-wrap
7205 msgid "B<SOCK_PACKET>"
7206 msgstr "B<SOCK_PACKET>"
7207
7208 #. type: Plain text
7209 #: build/C/man2/socket.2:148
7210 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7211 msgstr ""
7212 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7213 "こと"
7214
7215 #. type: Plain text
7216 #: build/C/man2/socket.2:154
7217 msgid ""
7218 "Some socket types may not be implemented by all protocol families; for "
7219 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7220 msgstr ""
7221 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7222 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7223
7224 #. type: Plain text
7225 #: build/C/man2/socket.2:162
7226 msgid ""
7227 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7228 "addition to specifying a socket type, it may include the bitwise OR of any "
7229 "of the following values, to modify the behavior of B<socket>():"
7230 msgstr ""
7231 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7232 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7233 "ることで、 B<socket>()  の振舞いを変更することができる。"
7234
7235 #. type: Plain text
7236 #: build/C/man2/socket.2:196
7237 msgid ""
7238 "The I<protocol> specifies a particular protocol to be used with the socket.  "
7239 "Normally only a single protocol exists to support a particular socket type "
7240 "within a given protocol family, in which case I<protocol> can be specified "
7241 "as 0.  However, it is possible that many protocols may exist, in which case "
7242 "a particular protocol must be specified in this manner.  The protocol number "
7243 "to use is specific to the ``communication domain'' in which communication is "
7244 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
7245 "protocol name strings to protocol numbers."
7246 msgstr ""
7247 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7248 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7249 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7250 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7251 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7252 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
7253 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
7254
7255 #. type: Plain text
7256 #: build/C/man2/socket.2:226
7257 msgid ""
7258 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7259 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7260 "a I<connected> state before any data may be sent or received on it.  A "
7261 "connection to another socket is created with a B<connect>(2)  call.  Once "
7262 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7263 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7264 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7265 "also be transmitted as described in B<send>(2)  and received as described in "
7266 "B<recv>(2)."
7267 msgstr ""
7268 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7269 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7270 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7271 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7272 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7273 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7274 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7275
7276 #. type: Plain text
7277 #: build/C/man2/socket.2:252
7278 msgid ""
7279 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7280 "data is not lost or duplicated.  If a piece of data for which the peer "
7281 "protocol has buffer space cannot be successfully transmitted within a "
7282 "reasonable length of time, then the connection is considered to be dead.  "
7283 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7284 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
7285 "signal is raised if a process sends or receives on a broken stream; this "
7286 "causes naive processes, which do not handle the signal, to exit.  "
7287 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7288 "sockets.  The only difference is that B<read>(2)  calls will return only the "
7289 "amount of data requested, and any data remaining in the arriving packet will "
7290 "be discarded.  Also all message boundaries in incoming datagrams are "
7291 "preserved."
7292 msgstr ""
7293 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7294 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7295 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7296 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7297 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7298 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7299 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7300 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
7301 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
7302 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
7303
7304 #. type: Plain text
7305 #: build/C/man2/socket.2:262
7306 msgid ""
7307 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
7308 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
7309 "received with B<recvfrom>(2), which returns the next datagram along with the "
7310 "address of its sender."
7311 msgstr ""
7312 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
7313 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
7314 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
7315 "す。"
7316
7317 #. type: Plain text
7318 #: build/C/man2/socket.2:269
7319 msgid ""
7320 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
7321 "from the device driver.  Use B<packet>(7)  instead."
7322 msgstr ""
7323 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
7324 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
7325
7326 #. type: Plain text
7327 #: build/C/man2/socket.2:292
7328 msgid ""
7329 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
7330 "process group to receive a B<SIGURG> signal when the out-of-band data "
7331 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
7332 "unexpectedly.  This operation may also be used to set the process or process "
7333 "group that receives the I/O and asynchronous notification of I/O events via "
7334 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
7335 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
7336 msgstr ""
7337 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
7338 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
7339 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
7340 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
7341 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
7342 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
7343 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
7344
7345 #. type: Plain text
7346 #: build/C/man2/socket.2:302
7347 msgid ""
7348 "When the network signals an error condition to the protocol module (e.g., "
7349 "using a ICMP message for IP) the pending error flag is set for the socket.  "
7350 "The next operation on this socket will return the error code of the pending "
7351 "error.  For some protocols it is possible to enable a per-socket error queue "
7352 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
7353 "(7)."
7354 msgstr ""
7355 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
7356 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
7357 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
7358 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
7359 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
7360 "B<IP_RECVERR> を参照すること。"
7361
7362 #. type: Plain text
7363 #: build/C/man2/socket.2:312
7364 msgid ""
7365 "The operation of sockets is controlled by socket level I<options>.  These "
7366 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
7367 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
7368 "respectively."
7369 msgstr ""
7370 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
7371 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
7372 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
7373
7374 #. type: Plain text
7375 #: build/C/man2/socket.2:317
7376 msgid ""
7377 "On success, a file descriptor for the new socket is returned.  On error, -1 "
7378 "is returned, and I<errno> is set appropriately."
7379 msgstr ""
7380 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
7381 "した場合は -1 を返し、 I<errno> を適切に設定する。"
7382
7383 #. type: Plain text
7384 #: build/C/man2/socket.2:322
7385 msgid ""
7386 "Permission to create a socket of the specified type and/or protocol is "
7387 "denied."
7388 msgstr ""
7389 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
7390
7391 #. type: Plain text
7392 #: build/C/man2/socket.2:325
7393 msgid "The implementation does not support the specified address family."
7394 msgstr "指定されたアドレスファミリーがサポートされていない。"
7395
7396 #. type: Plain text
7397 #: build/C/man2/socket.2:328
7398 msgid "Unknown protocol, or protocol family not available."
7399 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
7400
7401 #.  Since Linux 2.6.27
7402 #. type: Plain text
7403 #: build/C/man2/socket.2:333
7404 msgid "Invalid flags in I<type>."
7405 msgstr "I<type> に無効なフラグが指定されている。"
7406
7407 #. type: Plain text
7408 #: build/C/man2/socket.2:336
7409 msgid "Process file table overflow."
7410 msgstr "プロセスのファイルテーブルが溢れている。"
7411
7412 #. type: TP
7413 #: build/C/man2/socket.2:339
7414 #, no-wrap
7415 msgid "B<ENOBUFS> or B<ENOMEM>"
7416 msgstr "B<ENOBUFS> または B<ENOMEM>"
7417
7418 #. type: Plain text
7419 #: build/C/man2/socket.2:344
7420 msgid ""
7421 "Insufficient memory is available.  The socket cannot be created until "
7422 "sufficient resources are freed."
7423 msgstr ""
7424 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
7425 "ない。"
7426
7427 #. type: TP
7428 #: build/C/man2/socket.2:344 build/C/man2/socketpair.2:90
7429 #, no-wrap
7430 msgid "B<EPROTONOSUPPORT>"
7431 msgstr "B<EPROTONOSUPPORT>"
7432
7433 #. type: Plain text
7434 #: build/C/man2/socket.2:348
7435 msgid ""
7436 "The protocol type or the specified protocol is not supported within this "
7437 "domain."
7438 msgstr ""
7439 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
7440 "いない。"
7441
7442 #. type: Plain text
7443 #: build/C/man2/socket.2:350
7444 msgid "Other errors may be generated by the underlying protocol modules."
7445 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
7446
7447 #. type: Plain text
7448 #: build/C/man2/socket.2:352
7449 msgid "4.4BSD, POSIX.1-2001."
7450 msgstr "4.4BSD, POSIX.1-2001."
7451
7452 #. type: Plain text
7453 #: build/C/man2/socket.2:358
7454 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
7455 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
7456
7457 #. type: Plain text
7458 #: build/C/man2/socket.2:364
7459 msgid ""
7460 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
7461 "systems supporting clones of the BSD socket layer (including System V "
7462 "variants)."
7463 msgstr ""
7464 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
7465 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
7466 "外のシステムからの移植ができる。"
7467
7468 #. type: Plain text
7469 #: build/C/man2/socket.2:382
7470 msgid ""
7471 "The manifest constants used under 4.x BSD for protocol families are "
7472 "B<PF_UNIX>, B<PF_INET>, etc., while B<AF_UNIX> etc. are used for address "
7473 "families.  However, already the BSD man page promises: \"The protocol family "
7474 "generally is the same as the address family\", and subsequent standards use "
7475 "AF_* everywhere."
7476 msgstr ""
7477 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには B<PF_UNIX>, "
7478 "B<PF_INET> 等を使用している。一方でアドレス・ファミリーには B<AF_UNIX> 等が使"
7479 "用されている。しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミ"
7480 "リーはアドレス・ファミリーと同じものである。」 と保証している。それでそれ以外"
7481 "の規格では全ての場所で AF_* が使用されている。"
7482
7483 #. type: Plain text
7484 #: build/C/man2/socket.2:387
7485 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
7486 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7487
7488 #. type: Plain text
7489 #: build/C/man2/socket.2:410
7490 msgid ""
7491 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7492 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7493 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7494 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7495 "(7), B<unix>(7)"
7496 msgstr ""
7497 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7498 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7499 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7500 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7501 "(7), B<unix>(7)"
7502
7503 #. type: Plain text
7504 #: build/C/man2/socket.2:414
7505 msgid ""
7506 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq is "
7507 "reprinted in I<UNIX Programmer's Supplementary Documents Volume 1.>"
7508 msgstr ""
7509 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq は "
7510 "I<UNIX Programmer's Supplementary Documents Volume 1> として再版された。"
7511
7512 #. type: Plain text
7513 #: build/C/man2/socket.2:418
7514 msgid ""
7515 "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
7516 "Programmer's Supplementary Documents Volume 1.>"
7517 msgstr ""
7518 "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
7519 "Supplementary Documents Volume 1> として再版された。"
7520
7521 #. type: TH
7522 #: build/C/man7/socket.7:26
7523 #, fuzzy, no-wrap
7524 #| msgid "2010-06-10"
7525 msgid "2010-06-13"
7526 msgstr "2010-06-10"
7527
7528 #. type: Plain text
7529 #: build/C/man7/socket.7:29
7530 msgid "socket - Linux socket interface"
7531 msgstr "socket - Linux のソケットインターフェース"
7532
7533 #. type: Plain text
7534 #: build/C/man7/socket.7:33
7535 msgid ""
7536 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7537 ">I<protocol>B<);>"
7538 msgstr ""
7539 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7540 ">I<protocol>B<);>"
7541
7542 #. type: Plain text
7543 #: build/C/man7/socket.7:52
7544 msgid ""
7545 "This manual page describes the Linux networking socket layer user "
7546 "interface.  The BSD compatible sockets are the uniform interface between the "
7547 "user process and the network protocol stacks in the kernel.  The protocol "
7548 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
7549 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
7550 "B<socket>(2)  for more information on families and types."
7551 msgstr ""
7552 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
7553 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
7554 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
7555 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
7556 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
7557 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
7558 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
7559
7560 #. type: SS
7561 #: build/C/man7/socket.7:52
7562 #, no-wrap
7563 msgid "Socket Layer Functions"
7564 msgstr "ソケット層の関数群"
7565
7566 #. type: Plain text
7567 #: build/C/man7/socket.7:56
7568 msgid ""
7569 "These functions are used by the user process to send or receive packets and "
7570 "to do other socket operations.  For more information see their respective "
7571 "manual pages."
7572 msgstr ""
7573 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
7574 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
7575
7576 #. type: Plain text
7577 #: build/C/man7/socket.7:72
7578 msgid ""
7579 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
7580 "socket address, the B<bind>(2)  function binds a socket to a local socket "
7581 "address, B<listen>(2)  tells the socket that new connections shall be "
7582 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
7583 "connection.  B<socketpair>(2)  returns two connected anonymous sockets (only "
7584 "implemented for a few local families like B<AF_UNIX>)"
7585 msgstr ""
7586 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
7587 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
7588 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
7589 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
7590 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
7591 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
7592 "リーでしか実装されていない)。"
7593
7594 #. type: Plain text
7595 #: build/C/man7/socket.7:94
7596 msgid ""
7597 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
7598 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
7599 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
7600 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
7601 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
7602 "write data."
7603 msgstr ""
7604 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
7605 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
7606 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
7607 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
7608 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
7609 "ことができる。"
7610
7611 #. type: Plain text
7612 #: build/C/man7/socket.7:105
7613 msgid ""
7614 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
7615 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
7616 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
7617 "be used to set or read some other options."
7618 msgstr ""
7619 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
7620 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
7621 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
7622 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
7623
7624 #. type: Plain text
7625 #: build/C/man7/socket.7:110
7626 msgid ""
7627 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
7628 "full-duplex socket connection."
7629 msgstr ""
7630 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
7631 "続を部分的にクローズする。"
7632
7633 #. type: Plain text
7634 #: build/C/man7/socket.7:116
7635 msgid ""
7636 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
7637 "not supported on sockets."
7638 msgstr ""
7639 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
7640 "ではサポートされていない。"
7641
7642 #. type: Plain text
7643 #: build/C/man7/socket.7:133
7644 msgid ""
7645 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
7646 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
7647 "that would block will (usually)  return with B<EAGAIN> (operation should be "
7648 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
7649 "can then wait for various events via B<poll>(2)  or B<select>(2)."
7650 msgstr ""
7651 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
7652 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
7653 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
7654 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
7655 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
7656 "B<select>(2)  を使って待つことができる。"
7657
7658 #. type: tbl table
7659 #: build/C/man7/socket.7:137
7660 #, no-wrap
7661 msgid "I/O events\n"
7662 msgstr "I/O イベント\n"
7663
7664 #. type: tbl table
7665 #: build/C/man7/socket.7:138
7666 #, no-wrap
7667 msgid "Event:Poll flag:Occurrence\n"
7668 msgstr "イベント:poll フラグ:内容\n"
7669
7670 #. type: tbl table
7671 #: build/C/man7/socket.7:139 build/C/man7/socket.7:142
7672 #, no-wrap
7673 msgid "Read:POLLIN:T{\n"
7674 msgstr "Read:POLLIN:T{\n"
7675
7676 #. type: tbl table
7677 #: build/C/man7/socket.7:140
7678 #, no-wrap
7679 msgid "New data arrived.\n"
7680 msgstr "新しいデータが到着した。\n"
7681
7682 #. type: tbl table
7683 #: build/C/man7/socket.7:143
7684 #, no-wrap
7685 msgid "A connection setup has been completed\n"
7686 msgstr "(接続志向のソケットで)\n"
7687
7688 #. type: tbl table
7689 #: build/C/man7/socket.7:144
7690 #, no-wrap
7691 msgid "(for connection-oriented sockets)\n"
7692 msgstr "接続の設定が終了した。\n"
7693
7694 #. type: tbl table
7695 #: build/C/man7/socket.7:146 build/C/man7/socket.7:149
7696 #, no-wrap
7697 msgid "Read:POLLHUP:T{\n"
7698 msgstr "Read:POLLHUP:T{\n"
7699
7700 #. type: tbl table
7701 #: build/C/man7/socket.7:147
7702 #, no-wrap
7703 msgid "A disconnection request has been initiated by the other end.\n"
7704 msgstr "接続先で切断要求が生成された。\n"
7705
7706 #. type: tbl table
7707 #: build/C/man7/socket.7:150
7708 #, no-wrap
7709 msgid "A connection is broken (only for connection-oriented protocols).\n"
7710 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
7711
7712 #. type: tbl table
7713 #: build/C/man7/socket.7:151
7714 #, no-wrap
7715 msgid "When the socket is written\n"
7716 msgstr "この場合、ソケットに書き込みが行われると\n"
7717
7718 #. type: tbl table
7719 #: build/C/man7/socket.7:152
7720 #, no-wrap
7721 msgid "B<SIGPIPE>\n"
7722 msgstr "B<SIGPIPE>\n"
7723
7724 #. type: tbl table
7725 #: build/C/man7/socket.7:153
7726 #, no-wrap
7727 msgid "is also sent.\n"
7728 msgstr "も送信される。\n"
7729
7730 #. type: tbl table
7731 #: build/C/man7/socket.7:155
7732 #, no-wrap
7733 msgid "Write:POLLOUT:T{\n"
7734 msgstr "Write:POLLOUT:T{\n"
7735
7736 #. type: tbl table
7737 #: build/C/man7/socket.7:156
7738 #, no-wrap
7739 msgid "Socket has enough send buffer space for writing new data.\n"
7740 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
7741
7742 #. type: tbl table
7743 #: build/C/man7/socket.7:158
7744 #, no-wrap
7745 msgid "Read/Write:T{\n"
7746 msgstr "Read/Write:T{\n"
7747
7748 #. type: tbl table
7749 #: build/C/man7/socket.7:159
7750 #, no-wrap
7751 msgid "POLLIN|\n"
7752 msgstr "POLLIN|\n"
7753
7754 #. type: tbl table
7755 #: build/C/man7/socket.7:160
7756 #, no-wrap
7757 msgid ".br\n"
7758 msgstr ".br\n"
7759
7760 #. type: tbl table
7761 #: build/C/man7/socket.7:161
7762 #, no-wrap
7763 msgid "POLLOUT\n"
7764 msgstr "POLLOUT\n"
7765
7766 #. type: tbl table
7767 #: build/C/man7/socket.7:163
7768 #, no-wrap
7769 msgid "An outgoing\n"
7770 msgstr "外部向けの\n"
7771
7772 #. type: tbl table
7773 #: build/C/man7/socket.7:164
7774 #, no-wrap
7775 msgid "B<connect>(2)\n"
7776 msgstr "B<connect>(2)\n"
7777
7778 #. type: tbl table
7779 #: build/C/man7/socket.7:165
7780 #, no-wrap
7781 msgid "finished.\n"
7782 msgstr "が終了した。\n"
7783
7784 #. type: tbl table
7785 #: build/C/man7/socket.7:167
7786 #, no-wrap
7787 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
7788 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
7789
7790 #. type: tbl table
7791 #: build/C/man7/socket.7:168
7792 #, no-wrap
7793 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
7794 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
7795
7796 #. type: tbl table
7797 #: build/C/man7/socket.7:169
7798 #, no-wrap
7799 msgid "Exception:POLLPRI:T{\n"
7800 msgstr "Exception:POLLPRI:T{\n"
7801
7802 #. type: tbl table
7803 #: build/C/man7/socket.7:170
7804 #, no-wrap
7805 msgid "Urgent data arrived.\n"
7806 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
7807
7808 #. type: tbl table
7809 #: build/C/man7/socket.7:171
7810 #, no-wrap
7811 msgid "B<SIGURG>\n"
7812 msgstr "B<SIGURG>\n"
7813
7814 #. type: tbl table
7815 #: build/C/man7/socket.7:172
7816 #, no-wrap
7817 msgid "is sent then.\n"
7818 msgstr "が送信される。\n"
7819
7820 #. type: Plain text
7821 #: build/C/man7/socket.7:202
7822 msgid ""
7823 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
7824 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
7825 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
7826 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
7827 "I<Signals> discussion below."
7828 msgstr ""
7829 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
7830 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
7831 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
7832 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
7833 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
7834 "と。"
7835
7836 #. type: SS
7837 #: build/C/man7/socket.7:202
7838 #, no-wrap
7839 msgid "Socket Options"
7840 msgstr "ソケットオプション"
7841
7842 #.  FIXME
7843 #.  In the list below, the text used to describe argument types
7844 #.  for each socket option should be more consistent
7845 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
7846 #.  W R Stevens, UNPv1
7847 #. type: Plain text
7848 #: build/C/man7/socket.7:216
7849 msgid ""
7850 "These socket options can be set by using B<setsockopt>(2)  and read with "
7851 "B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for all sockets:"
7852 msgstr ""
7853 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
7854 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
7855 "レベルには B<SOL_SOCKET> を指定すること。"
7856
7857 #. type: TP
7858 #: build/C/man7/socket.7:216
7859 #, no-wrap
7860 msgid "B<SO_ACCEPTCONN>"
7861 msgstr "B<SO_ACCEPTCONN>"
7862
7863 #. type: Plain text
7864 #: build/C/man7/socket.7:224
7865 #, fuzzy
7866 #| msgid ""
7867 #| "Returns a value indicating whether or not this socket has been marked to "
7868 #| "accept connections with B<listen>(2).  The value 0 indicates that this is "
7869 #| "not a listening socket, the value 1 indicates that this is a listening "
7870 #| "socket.  Can only be read with B<getsockopt>(2)."
7871 msgid ""
7872 "Returns a value indicating whether or not this socket has been marked to "
7873 "accept connections with B<listen>(2).  The value 0 indicates that this is "
7874 "not a listening socket, the value 1 indicates that this is a listening "
7875 "socket.  This socket option is read-only."
7876 msgstr ""
7877 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
7878 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
7879 "状態のソケットであることを示す。 B<getsockopt>(2)  からのみ読み出し可能であ"
7880 "る。"
7881
7882 #. type: TP
7883 #: build/C/man7/socket.7:224
7884 #, no-wrap
7885 msgid "B<SO_BINDTODEVICE>"
7886 msgstr "B<SO_BINDTODEVICE>"
7887
7888 #. type: Plain text
7889 #: build/C/man7/socket.7:243
7890 #, fuzzy
7891 #| msgid ""
7892 #| "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified "
7893 #| "in the passed interface name.  If the name is an empty string or the "
7894 #| "option length is zero, the socket device binding is removed.  The passed "
7895 #| "option is a variable-length null-terminated interface name string with "
7896 #| "the maximum size of B<IFNAMSIZ>.  If a socket is bound to an interface, "
7897 #| "only packets received from that particular interface are processed by the "
7898 #| "socket.  Note that this only works for some socket types, particularly "
7899 #| "B<AF_INET> sockets.  It is not supported for packet sockets (use normal "
7900 #| "B<bind>(8)  there)."
7901 msgid ""
7902 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
7903 "the passed interface name.  If the name is an empty string or the option "
7904 "length is zero, the socket device binding is removed.  The passed option is "
7905 "a variable-length null-terminated interface name string with the maximum "
7906 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
7907 "received from that particular interface are processed by the socket.  Note "
7908 "that this only works for some socket types, particularly B<AF_INET> "
7909 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
7910 "there)."
7911 msgstr ""
7912 "このソケットを、引き数で渡したインターフェース名で指定される (\\(lqeth0\\(rq "
7913 "のような) 特定のデバイスにバインドする。 名前が空文字列だったり、オプションの"
7914 "長さ (optlen) が 0 の場合には、 ソケットのバインドが削除される。渡すオプショ"
7915 "ンは、インターフェース名が 入ったヌル文字で終端された可変長の文字列である。 "
7916 "文字列の最大のサイズは B<IFNAMSIX> である。 ソケットがインターフェースにバイ"
7917 "ンドされると、 その特定のインターフェースから受信されたパケットだけを処理す"
7918 "る。 このオプションはいくつかのソケットタイプ、特に B<AF_INET> に対してのみ動"
7919 "作する点に注意すること。 パケットソケットではサポートされていない (通常の "
7920 "B<bind>(8)  を使うこと)。"
7921
7922 #. type: TP
7923 #: build/C/man7/socket.7:243
7924 #, no-wrap
7925 msgid "B<SO_BROADCAST>"
7926 msgstr "B<SO_BROADCAST>"
7927
7928 #. type: Plain text
7929 #: build/C/man7/socket.7:250
7930 msgid ""
7931 "Set or get the broadcast flag.  When enabled, datagram sockets receive "
7932 "packets sent to a broadcast address and they are allowed to send packets to "
7933 "a broadcast address.  This option has no effect on stream-oriented sockets."
7934 msgstr ""
7935 "ブロードキャストフラグを設定・取得する。有効になっていると、 データグラムソ"
7936 "ケットはブロードキャストアドレスに送られたパケットを受信したり、 ブロードキャ"
7937 "ストアドレスにパケットを送信したりできるようになる。 ストリーム指向のソケット"
7938 "には何の効果もない。"
7939
7940 #. type: TP
7941 #: build/C/man7/socket.7:250
7942 #, no-wrap
7943 msgid "B<SO_BSDCOMPAT>"
7944 msgstr "B<SO_BSDCOMPAT>"
7945
7946 #. type: Plain text
7947 #: build/C/man7/socket.7:262
7948 msgid ""
7949 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
7950 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
7951 "socket will not be passed to the user program.  In later kernel versions, "
7952 "support for this option has been phased out: Linux 2.4 silently ignores it, "
7953 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
7954 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
7955 "header changing, skipping of the broadcast flag) for raw sockets with this "
7956 "option, but that was removed in Linux 2.2."
7957 msgstr ""
7958 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
7959 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
7960 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
7961 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
7962 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
7963 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
7964 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
7965 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
7966 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
7967
7968 #. type: TP
7969 #: build/C/man7/socket.7:262
7970 #, no-wrap
7971 msgid "B<SO_DEBUG>"
7972 msgstr "B<SO_DEBUG>"
7973
7974 #. type: Plain text
7975 #: build/C/man7/socket.7:268
7976 msgid ""
7977 "Enable socket debugging.  Only allowed for processes with the "
7978 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
7979 msgstr ""
7980 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
7981 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
7982
7983 #. type: TP
7984 #: build/C/man7/socket.7:268
7985 #, fuzzy, no-wrap
7986 #| msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
7987 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
7988 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
7989
7990 #. type: Plain text
7991 #: build/C/man7/socket.7:276
7992 msgid ""
7993 "Retrieves the socket domain as an integer, returning a value such as "
7994 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
7995 "only."
7996 msgstr ""
7997
7998 #. type: TP
7999 #: build/C/man7/socket.7:276
8000 #, no-wrap
8001 msgid "B<SO_ERROR>"
8002 msgstr "B<SO_ERROR>"
8003
8004 #. type: Plain text
8005 #: build/C/man7/socket.7:281
8006 #, fuzzy
8007 #| msgid ""
8008 #| "Get and clear the pending socket error.  Only valid as a B<getsockopt>"
8009 #| "(2).  Expects an integer."
8010 msgid ""
8011 "Get and clear the pending socket error.  This socket option is read-only.  "
8012 "Expects an integer."
8013 msgstr ""
8014 "保留になっていたソケットエラーを取得してクリアする。 B<getsockopt>(2)  でのみ"
8015 "用いることができる。 整数値をとる。"
8016
8017 #. type: TP
8018 #: build/C/man7/socket.7:281
8019 #, no-wrap
8020 msgid "B<SO_DONTROUTE>"
8021 msgstr "B<SO_DONTROUTE>"
8022
8023 #. type: Plain text
8024 #: build/C/man7/socket.7:290
8025 msgid ""
8026 "Don't send via a gateway, only send to directly connected hosts.  The same "
8027 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
8028 "B<send>(2)  operation.  Expects an integer boolean flag."
8029 msgstr ""
8030 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2)  操作"
8031 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
8032 "フラグを取る。"
8033
8034 #. type: TP
8035 #: build/C/man7/socket.7:290
8036 #, no-wrap
8037 msgid "B<SO_KEEPALIVE>"
8038 msgstr "B<SO_KEEPALIVE>"
8039
8040 #. type: Plain text
8041 #: build/C/man7/socket.7:294
8042 msgid ""
8043 "Enable sending of keep-alive messages on connection-oriented sockets.  "
8044 "Expects an integer boolean flag."
8045 msgstr ""
8046 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
8047 "の整数フラグをとる。"
8048
8049 #. type: TP
8050 #: build/C/man7/socket.7:294
8051 #, no-wrap
8052 msgid "B<SO_LINGER>"
8053 msgstr "B<SO_LINGER>"
8054
8055 #. type: Plain text
8056 #: build/C/man7/socket.7:302
8057 msgid ""
8058 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
8059 msgstr ""
8060 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
8061
8062 #. type: Plain text
8063 #: build/C/man7/socket.7:309
8064 #, no-wrap
8065 msgid ""
8066 "struct linger {\n"
8067 "    int l_onoff;    /* linger active */\n"
8068 "    int l_linger;   /* how many seconds to linger for */\n"
8069 "};\n"
8070 msgstr ""
8071 "struct linger {\n"
8072 "    int l_onoff;    /* linger active */\n"
8073 "    int l_linger;   /* how many seconds to linger for */\n"
8074 "};\n"
8075
8076 #. type: Plain text
8077 #: build/C/man7/socket.7:323
8078 msgid ""
8079 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
8080 "queued messages for the socket have been successfully sent or the linger "
8081 "timeout has been reached.  Otherwise, the call returns immediately and the "
8082 "closing is done in the background.  When the socket is closed as part of "
8083 "B<exit>(2), it always lingers in the background."
8084 msgstr ""
8085 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
8086 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
8087 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
8088 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
8089 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
8090 "送られる。"
8091
8092 #. type: TP
8093 #: build/C/man7/socket.7:323
8094 #, no-wrap
8095 msgid "B<SO_OOBINLINE>"
8096 msgstr "B<SO_OOBINLINE>"
8097
8098 #.  don't document it because it can do too much harm.
8099 #. .B SO_NO_CHECK
8100 #. type: Plain text
8101 #: build/C/man7/socket.7:332
8102 msgid ""
8103 "If this option is enabled, out-of-band data is directly placed into the "
8104 "receive data stream.  Otherwise out-of-band data is only passed when the "
8105 "B<MSG_OOB> flag is set during receiving."
8106 msgstr ""
8107 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
8108 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
8109 "ラグがセットされている場合に限って渡される。"
8110
8111 #. type: TP
8112 #: build/C/man7/socket.7:332
8113 #, no-wrap
8114 msgid "B<SO_PASSCRED>"
8115 msgstr "B<SO_PASSCRED>"
8116
8117 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
8118 #.  in the 2.6.18 ChangeLog
8119 #. type: Plain text
8120 #: build/C/man7/socket.7:341
8121 msgid ""
8122 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
8123 "For more information see B<unix>(7)."
8124 msgstr ""
8125 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
8126 "を参照のこと。"
8127
8128 #. type: TP
8129 #: build/C/man7/socket.7:341
8130 #, no-wrap
8131 msgid "B<SO_PEERCRED>"
8132 msgstr "B<SO_PEERCRED>"
8133
8134 #. type: Plain text
8135 #: build/C/man7/socket.7:361
8136 #, fuzzy
8137 #| msgid ""
8138 #| "Return the credentials of the foreign process connected to this socket.  "
8139 #| "This is only possible for connected B<AF_UNIX> stream sockets and "
8140 #| "B<AF_UNIX> stream and datagram socket pairs created using B<socketpair>"
8141 #| "(2); see B<unix>(7).  The returned credentials are those that were in "
8142 #| "effect at the time of the call to B<connect>(2)  or B<socketpair>(2).  "
8143 #| "Argument is a I<ucred> structure.  Only valid as a B<getsockopt>(2)."
8144 msgid ""
8145 "Return the credentials of the foreign process connected to this socket.  "
8146 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
8147 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
8148 "(7).  The returned credentials are those that were in effect at the time of "
8149 "the call to B<connect>(2)  or B<socketpair>(2).  Argument is a I<ucred> "
8150 "structure.  This socket option is read-only."
8151 msgstr ""
8152 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。 このソ"
8153 "ケットオプションが利用できるのは、 接続された B<AF_UNIX> ストリームソケット"
8154 "間、および B<socketpair>(2)  を使って作成された B<AF_UNIX> のストリームソケッ"
8155 "トとデータグラムソケットのペアだけである。 B<unix>(7)  を参照のこと。 "
8156 "B<connect>(2)  や B<socketpair>(2)  が呼ばれた時に有効であった信任状が返され"
8157 "る。 引き数は I<ucred> 構造体である。 B<getsockopt>(2)  でのみ用いることがで"
8158 "きる。"
8159
8160 #. type: TP
8161 #: build/C/man7/socket.7:361
8162 #, no-wrap
8163 msgid "B<SO_PRIORITY>"
8164 msgstr "B<SO_PRIORITY>"
8165
8166 #. type: Plain text
8167 #: build/C/man7/socket.7:374
8168 msgid ""
8169 "Set the protocol-defined priority for all packets to be sent on this "
8170 "socket.  Linux uses this value to order the networking queues: packets with "
8171 "a higher priority may be processed first depending on the selected device "
8172 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
8173 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
8174 "6 requires the B<CAP_NET_ADMIN> capability."
8175 msgstr ""
8176 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
8177 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
8178 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
8179 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
8180 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
8181 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
8182
8183 #. type: TP
8184 #: build/C/man7/socket.7:374
8185 #, fuzzy, no-wrap
8186 #| msgid "B<MSG_TRUNC> (since Linux 2.2)"
8187 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
8188 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
8189
8190 #. type: Plain text
8191 #: build/C/man7/socket.7:382
8192 msgid ""
8193 "Retrieves the socket protocol as an integer, returning a value such as "
8194 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
8195 "only."
8196 msgstr ""
8197
8198 #. type: TP
8199 #: build/C/man7/socket.7:382
8200 #, no-wrap
8201 msgid "B<SO_RCVBUF>"
8202 msgstr "B<SO_RCVBUF>"
8203
8204 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8205 #. type: Plain text
8206 #: build/C/man7/socket.7:397
8207 msgid ""
8208 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
8209 "this value (to allow space for bookkeeping overhead)  when it is set using "
8210 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8211 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
8212 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
8213 "file.  The minimum (doubled) value for this option is 256."
8214 msgstr ""
8215 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
8216 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8217 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8218 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
8219 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
8220 "る。 このオプションの最小値は (2倍した値で) 256 である。"
8221
8222 #. type: TP
8223 #: build/C/man7/socket.7:397
8224 #, no-wrap
8225 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
8226 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
8227
8228 #. type: Plain text
8229 #: build/C/man7/socket.7:406
8230 msgid ""
8231 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8232 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
8233 "overridden."
8234 msgstr ""
8235 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8236 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
8237 "きすることができる。"
8238
8239 #. type: TP
8240 #: build/C/man7/socket.7:406
8241 #, no-wrap
8242 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
8243 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
8244
8245 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
8246 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
8247 #. type: Plain text
8248 #: build/C/man7/socket.7:435
8249 msgid ""
8250 "Specify the minimum number of bytes in the buffer until the socket layer "
8251 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
8252 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
8253 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
8254 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
8255 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
8256 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
8257 "single byte of data is available.  A subsequent read from the socket will "
8258 "block until B<SO_RCVLOWAT> bytes are available."
8259 msgstr ""
8260 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
8261 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
8262 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
8263 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
8264 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
8265 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
8266 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
8267 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
8268 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
8269 "してしまう。"
8270
8271 #. type: TP
8272 #: build/C/man7/socket.7:435
8273 #, no-wrap
8274 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
8275 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
8276
8277 #.  Not implemented in 2.0.
8278 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
8279 #.  Implemented in 2.3.41 for setsockopt, and actually used.
8280 #.  in fact to EAGAIN
8281 #. type: Plain text
8282 #: build/C/man7/socket.7:466
8283 msgid ""
8284 "Specify the receiving or sending timeouts until reporting an error.  The "
8285 "argument is a I<struct timeval>.  If an input or output function blocks for "
8286 "this period of time, and data has been sent or received, the return value of "
8287 "that function will be the amount of data transferred; if no data has been "
8288 "transferred and the timeout has been reached then -1 is returned with "
8289 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket was "
8290 "specified to be nonblocking.  If the timeout is set to zero (the default)  "
8291 "then the operation will never timeout.  Timeouts only have effect for system "
8292 "calls that perform socket I/O (e.g., B<read>(2), B<recvmsg>(2), B<send>(2), "
8293 "B<sendmsg>(2)); timeouts have no effect for B<select>(2), B<poll>(2), "
8294 "B<epoll_wait>(2), etc."
8295 msgstr ""
8296 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
8297 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
8298 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
8299 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
8300 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> を設定され、 あたかもソケットに"
8301 "非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値であ"
8302 "る) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響"
8303 "を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), "
8304 "B<recvmsg>(2), B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>"
8305 "(2), B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
8306
8307 #. type: TP
8308 #: build/C/man7/socket.7:466
8309 #, no-wrap
8310 msgid "B<SO_REUSEADDR>"
8311 msgstr "B<SO_REUSEADDR>"
8312
8313 #. type: Plain text
8314 #: build/C/man7/socket.7:481
8315 msgid ""
8316 "Indicates that the rules used in validating addresses supplied in a B<bind>"
8317 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
8318 "this means that a socket may bind, except when there is an active listening "
8319 "socket bound to the address.  When the listening socket is bound to "
8320 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
8321 "port for any local address.  Argument is an integer boolean flag."
8322 msgstr ""
8323 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
8324 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
8325 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
8326 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
8327 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
8328 "ドできない。 引き数はブール整数のフラグである。"
8329
8330 #. type: TP
8331 #: build/C/man7/socket.7:481
8332 #, no-wrap
8333 msgid "B<SO_SNDBUF>"
8334 msgstr "B<SO_SNDBUF>"
8335
8336 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8337 #. type: Plain text
8338 #: build/C/man7/socket.7:496
8339 msgid ""
8340 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
8341 "this value (to allow space for bookkeeping overhead)  when it is set using "
8342 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8343 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
8344 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
8345 "file.  The minimum (doubled) value for this option is 2048."
8346 msgstr ""
8347 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
8348 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8349 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8350 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
8351 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
8352 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
8353
8354 #. type: TP
8355 #: build/C/man7/socket.7:496
8356 #, no-wrap
8357 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
8358 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
8359
8360 #. type: Plain text
8361 #: build/C/man7/socket.7:505
8362 msgid ""
8363 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8364 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
8365 "overridden."
8366 msgstr ""
8367 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8368 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
8369 "きすることができる。"
8370
8371 #. type: TP
8372 #: build/C/man7/socket.7:505
8373 #, no-wrap
8374 msgid "B<SO_TIMESTAMP>"
8375 msgstr "B<SO_TIMESTAMP>"
8376
8377 #. type: Plain text
8378 #: build/C/man7/socket.7:521
8379 msgid ""
8380 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
8381 "timestamp control message is sent with level B<SOL_SOCKET> and the "
8382 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
8383 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
8384 "details on control messages."
8385 msgstr ""
8386 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
8387 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
8388 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
8389 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
8390
8391 #. type: TP
8392 #: build/C/man7/socket.7:521
8393 #, no-wrap
8394 msgid "B<SO_TYPE>"
8395 msgstr "B<SO_TYPE>"
8396
8397 #. type: Plain text
8398 #: build/C/man7/socket.7:526
8399 #, fuzzy
8400 #| msgid ""
8401 #| "Gets the socket type as an integer (like B<SOCK_STREAM>).  Can only be "
8402 #| "read with B<getsockopt>(2)."
8403 msgid ""
8404 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
8405 "option is read-only."
8406 msgstr ""
8407 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。 B<getsockopt>(2)  か"
8408 "らのみ読み出し可能である。"
8409
8410 #. type: SS
8411 #: build/C/man7/socket.7:526
8412 #, no-wrap
8413 msgid "Signals"
8414 msgstr "シグナル"
8415
8416 #. type: Plain text
8417 #: build/C/man7/socket.7:537
8418 msgid ""
8419 "When writing onto a connection-oriented socket that has been shut down (by "
8420 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
8421 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
8422 "the B<MSG_NOSIGNAL> flag."
8423 msgstr ""
8424 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
8425 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
8426 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
8427 "していた場合はシグナルは送られない。"
8428
8429 #. type: Plain text
8430 #: build/C/man7/socket.7:562
8431 msgid ""
8432 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
8433 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
8434 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
8435 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
8436 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
8437 "signal will be called with the file descriptor in the I<si_fd> field of its "
8438 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
8439 msgstr ""
8440 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
8441 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
8442 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
8443 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
8444 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
8445 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
8446 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
8447 "を参照のこと。"
8448
8449 #.  .SS Ancillary Messages
8450 #. type: Plain text
8451 #: build/C/man7/socket.7:570
8452 msgid ""
8453 "Under some circumstances (e.g., multiple processes accessing a single "
8454 "socket), the condition that caused the B<SIGIO> may have already disappeared "
8455 "when the process reacts to the signal.  If this happens, the process should "
8456 "wait again because Linux will resend the signal later."
8457 msgstr ""
8458 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
8459 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
8460 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
8461 "すべきである。 Linux は同じシグナルを後で再送するからである。"
8462
8463 #. type: SS
8464 #: build/C/man7/socket.7:570
8465 #, no-wrap
8466 msgid "/proc interfaces"
8467 msgstr "/proc インタフェース"
8468
8469 #. type: Plain text
8470 #: build/C/man7/socket.7:574
8471 msgid ""
8472 "The core socket networking parameters can be accessed via files in the "
8473 "directory I</proc/sys/net/core/>."
8474 msgstr ""
8475 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
8476 "レクトリ内のファイルを通してアクセスできる。"
8477
8478 #. type: TP
8479 #: build/C/man7/socket.7:574
8480 #, no-wrap
8481 msgid "I<rmem_default>"
8482 msgstr "I<rmem_default>"
8483
8484 #. type: Plain text
8485 #: build/C/man7/socket.7:577
8486 msgid "contains the default setting in bytes of the socket receive buffer."
8487 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
8488
8489 #. type: TP
8490 #: build/C/man7/socket.7:577
8491 #, no-wrap
8492 msgid "I<rmem_max>"
8493 msgstr "I<rmem_max>"
8494
8495 #. type: Plain text
8496 #: build/C/man7/socket.7:583
8497 msgid ""
8498 "contains the maximum socket receive buffer size in bytes which a user may "
8499 "set by using the B<SO_RCVBUF> socket option."
8500 msgstr ""
8501 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
8502 "ファサイズの最大値 (バイト単位)。"
8503
8504 #. type: TP
8505 #: build/C/man7/socket.7:583
8506 #, no-wrap
8507 msgid "I<wmem_default>"
8508 msgstr "I<wmem_default>"
8509
8510 #. type: Plain text
8511 #: build/C/man7/socket.7:586
8512 msgid "contains the default setting in bytes of the socket send buffer."
8513 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
8514
8515 #. type: TP
8516 #: build/C/man7/socket.7:586
8517 #, no-wrap
8518 msgid "I<wmem_max>"
8519 msgstr "I<wmem_max>"
8520
8521 #. type: Plain text
8522 #: build/C/man7/socket.7:592
8523 msgid ""
8524 "contains the maximum socket send buffer size in bytes which a user may set "
8525 "by using the B<SO_SNDBUF> socket option."
8526 msgstr ""
8527 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
8528 "ファサイズの最大値 (バイト単位)。"
8529
8530 #. type: TP
8531 #: build/C/man7/socket.7:592
8532 #, no-wrap
8533 msgid "I<message_cost> and I<message_burst>"
8534 msgstr "I<message_cost> と I<message_burst>"
8535
8536 #. type: Plain text
8537 #: build/C/man7/socket.7:596
8538 msgid ""
8539 "configure the token bucket filter used to load limit warning messages caused "
8540 "by external network events."
8541 msgstr ""
8542 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
8543 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
8544
8545 #. type: TP
8546 #: build/C/man7/socket.7:596
8547 #, no-wrap
8548 msgid "I<netdev_max_backlog>"
8549 msgstr "I<netdev_max_backlog>"
8550
8551 #. type: Plain text
8552 #: build/C/man7/socket.7:599
8553 msgid "Maximum number of packets in the global input queue."
8554 msgstr "グローバルな入力キューにおける最大のパケット数。"
8555
8556 #. type: TP
8557 #: build/C/man7/socket.7:599
8558 #, no-wrap
8559 msgid "I<optmem_max>"
8560 msgstr "I<optmem_max>"
8561
8562 #.  netdev_fastroute is not documented because it is experimental
8563 #. type: Plain text
8564 #: build/C/man7/socket.7:604
8565 msgid ""
8566 "Maximum length of ancillary data and user control data like the iovecs per "
8567 "socket."
8568 msgstr ""
8569 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
8570 "うなもの) との和の最大長。"
8571
8572 #. type: SS
8573 #: build/C/man7/socket.7:604
8574 #, no-wrap
8575 msgid "Ioctls"
8576 msgstr "ioctl"
8577
8578 #. type: Plain text
8579 #: build/C/man7/socket.7:607
8580 msgid "These operations can be accessed using B<ioctl>(2):"
8581 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
8582
8583 #. type: Plain text
8584 #: build/C/man7/socket.7:611
8585 #, no-wrap
8586 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8587 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8588
8589 #. type: TP
8590 #: build/C/man7/socket.7:613
8591 #, no-wrap
8592 msgid "B<SIOCGSTAMP>"
8593 msgstr "B<SIOCGSTAMP>"
8594
8595 #. type: Plain text
8596 #: build/C/man7/socket.7:637
8597 msgid ""
8598 "Return a I<struct timeval> with the receive timestamp of the last packet "
8599 "passed to the user.  This is useful for accurate round trip time "
8600 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
8601 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
8602 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
8603 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
8604 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
8605 "to B<ENOENT>)."
8606 msgstr ""
8607 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
8608 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
8609 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
8610 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
8611 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
8612 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
8613 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
8614 "セットする)。"
8615
8616 #. type: TP
8617 #: build/C/man7/socket.7:637
8618 #, no-wrap
8619 msgid "B<SIOCSPGRP>"
8620 msgstr "B<SIOCSPGRP>"
8621
8622 #. type: Plain text
8623 #: build/C/man7/socket.7:656
8624 msgid ""
8625 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
8626 "when an asynchronous I/O operation has finished or urgent data is "
8627 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
8628 "positive, send the signals to that process.  If the argument is negative, "
8629 "send the signals to the process group with the ID of the absolute value of "
8630 "the argument.  The process may only choose itself or its own process group "
8631 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
8632 "UID of 0."
8633 msgstr ""
8634 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
8635 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
8636 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
8637 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
8638 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
8639 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
8640 "の場合は この限りではない。"
8641
8642 #. type: TP
8643 #: build/C/man7/socket.7:656
8644 #, no-wrap
8645 msgid "B<FIOASYNC>"
8646 msgstr "B<FIOASYNC>"
8647
8648 #. type: Plain text
8649 #: build/C/man7/socket.7:666
8650 msgid ""
8651 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
8652 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
8653 "set with B<F_SETSIG> is raised when a new I/O event occurs."
8654 msgstr ""
8655 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
8656 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
8657 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
8658
8659 #. type: Plain text
8660 #: build/C/man7/socket.7:674
8661 msgid ""
8662 "Argument is an integer boolean flag.  (This operation is synonymous with the "
8663 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
8664 msgstr ""
8665 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
8666 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
8667
8668 #. type: TP
8669 #: build/C/man7/socket.7:674
8670 #, no-wrap
8671 msgid "B<SIOCGPGRP>"
8672 msgstr "B<SIOCGPGRP>"
8673
8674 #. type: Plain text
8675 #: build/C/man7/socket.7:683
8676 msgid ""
8677 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
8678 "signals, or 0 when none is set."
8679 msgstr ""
8680 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
8681 "る。 ない場合は 0 が返る。"
8682
8683 #. type: Plain text
8684 #: build/C/man7/socket.7:687
8685 msgid "Valid B<fcntl>(2)  operations:"
8686 msgstr "有効な B<fcntl>(2)  操作:"
8687
8688 #. type: TP
8689 #: build/C/man7/socket.7:687
8690 #, no-wrap
8691 msgid "B<FIOGETOWN>"
8692 msgstr "B<FIOGETOWN>"
8693
8694 #. type: Plain text
8695 #: build/C/man7/socket.7:692
8696 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
8697 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
8698
8699 #. type: TP
8700 #: build/C/man7/socket.7:692
8701 #, no-wrap
8702 msgid "B<FIOSETOWN>"
8703 msgstr "B<FIOSETOWN>"
8704
8705 #. type: Plain text
8706 #: build/C/man7/socket.7:697
8707 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
8708 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
8709
8710 #. type: Plain text
8711 #: build/C/man7/socket.7:711
8712 msgid ""
8713 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
8714 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
8715 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
8716 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
8717 "be read or written."
8718 msgstr ""
8719 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
8720 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
8721 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
8722 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
8723 "はできなかった。"
8724
8725 #. type: Plain text
8726 #: build/C/man7/socket.7:716
8727 msgid ""
8728 "Linux assumes that half of the send/receive buffer is used for internal "
8729 "kernel structures; thus the values in the corresponding I</proc> files are "
8730 "twice what can be observed on the wire."
8731 msgstr ""
8732 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
8733 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
8734 "なる。"
8735
8736 #. type: Plain text
8737 #: build/C/man7/socket.7:729
8738 msgid ""
8739 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
8740 "option was set both in the previous program that performed a B<bind>(2)  to "
8741 "the port and in the program that wants to reuse the port.  This differs from "
8742 "some implementations (e.g., FreeBSD)  where only the later program needs to "
8743 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
8744 "since, for example, a server program is designed to always set this option."
8745 msgstr ""
8746 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
8747 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
8748 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
8749 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
8750 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
8751 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
8752 "このオプションをセットするように設計されるからである。"
8753
8754 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
8755 #.  .SH AUTHORS
8756 #.  This man page was written by Andi Kleen.
8757 #. type: Plain text
8758 #: build/C/man7/socket.7:742
8759 msgid ""
8760 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
8761 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
8762 "is via the libpcap library."
8763 msgstr ""
8764 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
8765 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
8766 "して 用いる方が良い。"
8767
8768 #. type: Plain text
8769 #: build/C/man7/socket.7:753
8770 msgid ""
8771 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8772 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8773 msgstr ""
8774 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8775 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8776
8777 #. type: TH
8778 #: build/C/man2/socketcall.2:26
8779 #, no-wrap
8780 msgid "SOCKETCALL"
8781 msgstr "SOCKETCALL"
8782
8783 #. type: TH
8784 #: build/C/man2/socketcall.2:26
8785 #, no-wrap
8786 msgid "2007-06-28"
8787 msgstr "2007-06-28"
8788
8789 #. type: Plain text
8790 #: build/C/man2/socketcall.2:29
8791 msgid "socketcall - socket system calls"
8792 msgstr "socketcall - ソケット・システムコール"
8793
8794 #. type: Plain text
8795 #: build/C/man2/socketcall.2:31
8796 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8797 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8798
8799 #. type: Plain text
8800 #: build/C/man2/socketcall.2:39
8801 msgid ""
8802 "B<socketcall>()  is a common kernel entry point for the socket system "
8803 "calls.  I<call> determines which socket function to invoke.  I<args> points "
8804 "to a block containing the actual arguments, which are passed through to the "
8805 "appropriate call."
8806 msgstr ""
8807 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
8808 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
8809 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
8810 "ロックを指す。"
8811
8812 #. type: Plain text
8813 #: build/C/man2/socketcall.2:43
8814 msgid ""
8815 "User programs should call the appropriate functions by their usual names.  "
8816 "Only standard library implementors and kernel hackers need to know about "
8817 "B<socketcall>()."
8818 msgstr ""
8819 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
8820 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
8821 "必要がある。"
8822
8823 #. type: Plain text
8824 #: build/C/man2/socketcall.2:46
8825 msgid ""
8826 "This call is specific to Linux, and should not be used in programs intended "
8827 "to be portable."
8828 msgstr ""
8829 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
8830 "い。"
8831
8832 #. type: Plain text
8833 #: build/C/man2/socketcall.2:54
8834 msgid ""
8835 "On a few architectures, for example ia64, there is no B<socketcall>()  "
8836 "system call; instead B<socket>(2), B<accept>(2), B<bind>(2), and so on "
8837 "really are implemented as separate system calls."
8838 msgstr ""
8839 "ia64 などのいくつかのアーキテクチャでは、システムコール B<socketcall>()  が存"
8840 "在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2)  など"
8841 "が独立したシステムコールとして実装されている。"
8842
8843 #. type: Plain text
8844 #: build/C/man2/socketcall.2:72
8845 msgid ""
8846 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8847 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8848 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8849 "(2), B<socket>(2), B<socketpair>(2)"
8850 msgstr ""
8851 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8852 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8853 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8854 "(2), B<socket>(2), B<socketpair>(2)"
8855
8856 #. type: TH
8857 #: build/C/man2/socketpair.2:40
8858 #, no-wrap
8859 msgid "SOCKETPAIR"
8860 msgstr "SOCKETPAIR"
8861
8862 #. type: TH
8863 #: build/C/man2/socketpair.2:40
8864 #, no-wrap
8865 msgid "2008-10-11"
8866 msgstr "2008-10-11"
8867
8868 #. type: Plain text
8869 #: build/C/man2/socketpair.2:43
8870 msgid "socketpair - create a pair of connected sockets"
8871 msgstr "socketpair - 接続されたソケットのペアを作成する"
8872
8873 #. type: Plain text
8874 #: build/C/man2/socketpair.2:50
8875 msgid ""
8876 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8877 ">I<sv>B<[2]);>"
8878 msgstr ""
8879 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8880 ">I<sv>B<[2]);>"
8881
8882 #. type: Plain text
8883 #: build/C/man2/socketpair.2:61
8884 msgid ""
8885 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
8886 "the specified I<domain>, of the specified I<type>, and using the optionally "
8887 "specified I<protocol>.  For further details of these arguments, see B<socket>"
8888 "(2)."
8889 msgstr ""
8890 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
8891 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
8892 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
8893
8894 #. type: Plain text
8895 #: build/C/man2/socketpair.2:67
8896 msgid ""
8897 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
8898 "and I<sv>[1].  The two sockets are indistinguishable."
8899 msgstr ""
8900 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
8901 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
8902
8903 #. type: Plain text
8904 #: build/C/man2/socketpair.2:76
8905 msgid "The specified address family is not supported on this machine."
8906 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
8907
8908 #. type: Plain text
8909 #: build/C/man2/socketpair.2:81
8910 msgid ""
8911 "The address I<sv> does not specify a valid part of the process address space."
8912 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
8913
8914 #. type: Plain text
8915 #: build/C/man2/socketpair.2:84
8916 msgid "Too many descriptors are in use by this process."
8917 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
8918
8919 #. type: Plain text
8920 #: build/C/man2/socketpair.2:90
8921 msgid "The specified protocol does not support creation of socket pairs."
8922 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
8923
8924 #. type: Plain text
8925 #: build/C/man2/socketpair.2:93
8926 msgid "The specified protocol is not supported on this machine."
8927 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
8928
8929 #. type: Plain text
8930 #: build/C/man2/socketpair.2:101
8931 msgid ""
8932 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
8933 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
8934 "of the BSD socket layer (including System V variants)."
8935 msgstr ""
8936 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
8937 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
8938 "BSD 以外のシステムと、 互いに移植性がある。"
8939
8940 #. type: Plain text
8941 #: build/C/man2/socketpair.2:107
8942 msgid ""
8943 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
8944 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
8945 "restriction.)"
8946 msgstr ""
8947 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
8948 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
8949
8950 #. type: Plain text
8951 #: build/C/man2/socketpair.2:116
8952 msgid ""
8953 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
8954 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
8955 msgstr ""
8956 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
8957 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
8958
8959 #. type: Plain text
8960 #: build/C/man2/socketpair.2:129
8961 msgid ""
8962 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8963 msgstr ""
8964 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8965
8966 #~ msgid "2011-10-01"
8967 #~ msgstr "2011-10-01"