OSDN Git Service

e12dbeee805241a8c6fcb7330eb3f2d85fb98a27
[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-05-01 04:22+0900\n"
10 "PO-Revision-Date: 2012-05-04 03:38+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/man3/getifaddrs.3:137 build/C/man2/getsockname.2:65
303 #: build/C/man2/getsockopt.2:129 build/C/man2/listen.2:80
304 #: build/C/man2/recv.2:386 build/C/man2/recvmmsg.2:141
305 #: build/C/man2/select.2:285 build/C/man2/select_tut.2:483
306 #: build/C/man2/send.2:273 build/C/man2/sendmmsg.2:119
307 #: build/C/man3/sockatmark.3:49 build/C/man2/socket.2:312
308 #: build/C/man2/socketpair.2:67
309 #, no-wrap
310 msgid "RETURN VALUE"
311 msgstr "返り値"
312
313 #. type: Plain text
314 #: build/C/man2/accept.2:185
315 msgid ""
316 "On success, these system calls return a nonnegative integer that is a "
317 "descriptor for the accepted socket.  On error, -1 is returned, and I<errno> "
318 "is set appropriately."
319 msgstr ""
320 "成功した場合、これらのシステムコールは 受け付けたソケットのディスクリプタであ"
321 "る非負の整数値を返す。 エラーが発生した場合は -1 を返し、 I<errno> を適切に設"
322 "定する。"
323
324 #. type: SS
325 #: build/C/man2/accept.2:185
326 #, no-wrap
327 msgid "Error Handling"
328 msgstr "エラー処理"
329
330 #. type: Plain text
331 #: build/C/man2/accept.2:212
332 msgid ""
333 "Linux B<accept>()  (and B<accept4>())  passes already-pending network errors "
334 "on the new socket as an error code from B<accept>().  This behavior differs "
335 "from other BSD socket implementations.  For reliable operation the "
336 "application should detect the network errors defined for the protocol after "
337 "B<accept>()  and treat them like B<EAGAIN> by retrying.  In case of TCP/IP "
338 "these are B<ENETDOWN>, B<EPROTO>, B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, "
339 "B<EHOSTUNREACH>, B<EOPNOTSUPP>, and B<ENETUNREACH>."
340 msgstr ""
341 "Linux の B<accept>()  (と B<accept4>())  は、新しいソケットにおける、発生済み"
342 "のネットワークエラーを B<accept>()  からのエラーコードとして渡す。 この振舞い"
343 "は BSD ソケットの実装とは異なる。 信頼性の高い動作を行うためには、 アプリケー"
344 "ションはプロトコルで定義されているネットワークエラーの検知を B<accept>()  の"
345 "あとに行い、それらのエラーを B<EAGAIN> と同じように扱い、再試行 (retry) を行"
346 "うべきである。 TCP/IP では、以下のエラーが該当する: B<ENETDOWN>, B<EPROTO>, "
347 "B<ENOPROTOOPT>, B<EHOSTDOWN>, B<ENONET>, B<EHOSTUNREACH>, B<EOPNOTSUPP>, "
348 "B<ENETUNREACH>"
349
350 #. type: SH
351 #: build/C/man2/accept.2:212 build/C/man2/bind.2:155
352 #: build/C/man3/bindresvport.3:69 build/C/man2/connect.2:130
353 #: build/C/man3/getifaddrs.3:144 build/C/man2/getsockname.2:70
354 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
355 #: build/C/man2/recv.2:391 build/C/man2/recvmmsg.2:149
356 #: build/C/man2/select.2:302 build/C/man2/send.2:278
357 #: build/C/man2/sendmmsg.2:133 build/C/man3/sockatmark.3:54
358 #: build/C/man2/socket.2:317 build/C/man2/socketpair.2:72
359 #, no-wrap
360 msgid "ERRORS"
361 msgstr "エラー"
362
363 #. type: TP
364 #: build/C/man2/accept.2:213 build/C/man2/recv.2:396 build/C/man2/send.2:294
365 #, no-wrap
366 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
367 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
368
369 #.  Actually EAGAIN on Linux
370 #. type: Plain text
371 #: build/C/man2/accept.2:221
372 msgid ""
373 "The socket is marked nonblocking and no connections are present to be "
374 "accepted.  POSIX.1-2001 allows either error to be returned for this case, "
375 "and does not require these constants to have the same value, so a portable "
376 "application should check for both possibilities."
377 msgstr ""
378 "ソケットが非停止になっていて、 かつ受付け対象の接続が存在しない。 "
379 "POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これら 2 つ"
380 "の定数が同じ値を持つことも求めていない。 したがって、移植性が必要なアプリケー"
381 "ションでは、両方の可能性を 確認すべきである。"
382
383 #. type: TP
384 #: build/C/man2/accept.2:221 build/C/man2/bind.2:163
385 #: build/C/man2/connect.2:167 build/C/man2/getsockname.2:71
386 #: build/C/man2/getsockopt.2:135 build/C/man2/listen.2:89
387 #: build/C/man2/recv.2:405 build/C/man2/select.2:303 build/C/man2/send.2:302
388 #: build/C/man3/sockatmark.3:55
389 #, no-wrap
390 msgid "B<EBADF>"
391 msgstr "B<EBADF>"
392
393 #. type: Plain text
394 #: build/C/man2/accept.2:224
395 msgid "The descriptor is invalid."
396 msgstr "ディスクリプタが不正。"
397
398 #. type: TP
399 #: build/C/man2/accept.2:224
400 #, no-wrap
401 msgid "B<ECONNABORTED>"
402 msgstr "B<ECONNABORTED>"
403
404 #. type: Plain text
405 #: build/C/man2/accept.2:227
406 msgid "A connection has been aborted."
407 msgstr "接続が中止された。"
408
409 #. type: TP
410 #: build/C/man2/accept.2:227 build/C/man2/bind.2:189
411 #: build/C/man2/connect.2:173 build/C/man2/getsockname.2:76
412 #: build/C/man2/getsockopt.2:140 build/C/man2/recv.2:414
413 #: build/C/man2/send.2:311 build/C/man2/socketpair.2:76
414 #, no-wrap
415 msgid "B<EFAULT>"
416 msgstr "B<EFAULT>"
417
418 #. type: Plain text
419 #: build/C/man2/accept.2:232
420 msgid ""
421 "The I<addr> argument is not in a writable part of the user address space."
422 msgstr "I<addr> 引き数がユーザアドレス空間の書き込み可能領域にない。"
423
424 #. type: TP
425 #: build/C/man2/accept.2:232 build/C/man2/connect.2:201
426 #: build/C/man2/recv.2:418 build/C/man2/select.2:308 build/C/man2/send.2:314
427 #, no-wrap
428 msgid "B<EINTR>"
429 msgstr "B<EINTR>"
430
431 #. type: Plain text
432 #: build/C/man2/accept.2:237
433 msgid ""
434 "The system call was interrupted by a signal that was caught before a valid "
435 "connection arrived; see B<signal>(7)."
436 msgstr ""
437 "有効な接続が到着する前に捕捉されたシグナルによって システムコールが中断され"
438 "た。 B<signal>(7)  参照。"
439
440 #. type: TP
441 #: build/C/man2/accept.2:237 build/C/man2/accept.2:242 build/C/man2/bind.2:167
442 #: build/C/man2/bind.2:193 build/C/man2/getsockname.2:82
443 #: build/C/man2/getsockopt.2:150 build/C/man2/recv.2:423
444 #: build/C/man2/recvmmsg.2:153 build/C/man2/select.2:312
445 #: build/C/man2/send.2:318 build/C/man3/sockatmark.3:59
446 #: build/C/man2/socket.2:325 build/C/man2/socket.2:328
447 #, no-wrap
448 msgid "B<EINVAL>"
449 msgstr "B<EINVAL>"
450
451 #. type: Plain text
452 #: build/C/man2/accept.2:242
453 msgid ""
454 "Socket is not listening for connections, or I<addrlen> is invalid (e.g., is "
455 "negative)."
456 msgstr ""
457 "ソケットが接続待ち状態ではない。もしくは、 I<addrlen> が不正である (例えば、"
458 "負の場合など)。"
459
460 #. type: Plain text
461 #: build/C/man2/accept.2:247
462 msgid "(B<accept4>())  invalid value in I<flags>."
463 msgstr "(B<accept4>())  I<flags> に不正な値が指定されている。"
464
465 #. type: TP
466 #: build/C/man2/accept.2:247 build/C/man2/socket.2:333
467 #: build/C/man2/socketpair.2:81
468 #, no-wrap
469 msgid "B<EMFILE>"
470 msgstr "B<EMFILE>"
471
472 #. type: Plain text
473 #: build/C/man2/accept.2:250
474 msgid "The per-process limit of open file descriptors has been reached."
475 msgstr "1プロセスがオープンできるファイル・ディスクリプタ数の上限に達した。"
476
477 #. type: TP
478 #: build/C/man2/accept.2:250 build/C/man2/socket.2:336
479 #: build/C/man2/socketpair.2:84
480 #, no-wrap
481 msgid "B<ENFILE>"
482 msgstr "B<ENFILE>"
483
484 #. type: Plain text
485 #: build/C/man2/accept.2:253 build/C/man2/socket.2:339
486 #: build/C/man2/socketpair.2:87
487 msgid "The system limit on the total number of open files has been reached."
488 msgstr "オープンされたファイルの総数がシステム全体の上限に達していた。"
489
490 #. type: TP
491 #: build/C/man2/accept.2:253
492 #, no-wrap
493 msgid "B<ENOBUFS>, B<ENOMEM>"
494 msgstr "B<ENOBUFS>, B<ENOMEM>"
495
496 #. type: Plain text
497 #: build/C/man2/accept.2:258
498 msgid ""
499 "Not enough free memory.  This often means that the memory allocation is "
500 "limited by the socket buffer limits, not by the system memory."
501 msgstr ""
502 "メモリが足りない。 多くの場合は、システムメモリが足りないわけではなく、 ソ"
503 "ケットバッファの大きさによるメモリ割り当ての制限である。"
504
505 #. type: TP
506 #: build/C/man2/accept.2:258 build/C/man2/bind.2:172
507 #: build/C/man2/connect.2:213 build/C/man2/getsockname.2:90
508 #: build/C/man2/getsockopt.2:164 build/C/man2/listen.2:94
509 #: build/C/man2/recv.2:438 build/C/man2/send.2:347
510 #, no-wrap
511 msgid "B<ENOTSOCK>"
512 msgstr "B<ENOTSOCK>"
513
514 #. type: Plain text
515 #: build/C/man2/accept.2:261
516 msgid "The descriptor references a file, not a socket."
517 msgstr "ディスクリプタはソケットではなくファイルを参照している。"
518
519 #. type: TP
520 #: build/C/man2/accept.2:261 build/C/man2/listen.2:99 build/C/man2/send.2:352
521 #: build/C/man2/socketpair.2:87
522 #, no-wrap
523 msgid "B<EOPNOTSUPP>"
524 msgstr "B<EOPNOTSUPP>"
525
526 #. type: Plain text
527 #: build/C/man2/accept.2:265
528 msgid "The referenced socket is not of type B<SOCK_STREAM>."
529 msgstr "参照しているソケットの型が B<SOCK_STREAM> でない。"
530
531 #. type: TP
532 #: build/C/man2/accept.2:265
533 #, no-wrap
534 msgid "B<EPROTO>"
535 msgstr "B<EPROTO>"
536
537 #. type: Plain text
538 #: build/C/man2/accept.2:268
539 msgid "Protocol error."
540 msgstr "プロトコル・エラー。"
541
542 #. type: Plain text
543 #: build/C/man2/accept.2:272
544 msgid "In addition, Linux B<accept>()  may fail if:"
545 msgstr "上記に加えて、Linux の B<accept>()  は以下のエラーで失敗する:"
546
547 #. type: TP
548 #: build/C/man2/accept.2:272
549 #, no-wrap
550 msgid "B<EPERM>"
551 msgstr "B<EPERM>"
552
553 #. type: Plain text
554 #: build/C/man2/accept.2:275
555 msgid "Firewall rules forbid connection."
556 msgstr "ファイアウォールのルールにより接続が禁止された。"
557
558 #. type: Plain text
559 #: build/C/man2/accept.2:287
560 msgid ""
561 "In addition, network errors for the new socket and as defined for the "
562 "protocol may be returned.  Various Linux kernels can return other errors "
563 "such as B<ENOSR>, B<ESOCKTNOSUPPORT>, B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  The "
564 "value B<ERESTARTSYS> may be seen during a trace."
565 msgstr ""
566 "この他に、新しいソケットに対するネットワークエラーが返されることもある。 これ"
567 "らはそれぞれのプロトコルで定義されている。 いろいろな Linux カーネルでは、 以"
568 "下に示すようなエラーを返すこともある。 B<ENOSR>, B<ESOCKTNOSUPPORT>, "
569 "B<EPROTONOSUPPORT>, B<ETIMEDOUT>.  B<ERESTARTSYS> がトレースの最中に現れるこ"
570 "ともある。"
571
572 #. type: SH
573 #: build/C/man2/accept.2:287 build/C/man3/getifaddrs.3:157
574 #: build/C/man2/recvmmsg.2:157 build/C/man2/select.2:321
575 #: build/C/man2/sendmmsg.2:145 build/C/man3/sockatmark.3:66
576 #: build/C/man7/socket.7:696
577 #, no-wrap
578 msgid "VERSIONS"
579 msgstr "バージョン"
580
581 #. type: Plain text
582 #: build/C/man2/accept.2:292
583 msgid ""
584 "The B<accept4>()  system call is available starting with Linux 2.6.28; "
585 "support in glibc is available starting with version 2.10."
586 msgstr ""
587 "B<accept4>()  システムコールは Linux 2.6.28 以降で利用可能である。 glibc での"
588 "サポートはバージョン 2.10 以降で利用可能である。"
589
590 #. type: SH
591 #: build/C/man2/accept.2:292 build/C/man2/bind.2:220
592 #: build/C/man3/bindresvport.3:89 build/C/man2/connect.2:223
593 #: build/C/man3/getifaddrs.3:165 build/C/man2/getsockname.2:95
594 #: build/C/man2/getsockopt.2:169 build/C/man2/listen.2:104
595 #: build/C/man2/recv.2:443 build/C/man2/recvmmsg.2:162
596 #: build/C/man2/select.2:327 build/C/man2/send.2:366
597 #: build/C/man2/sendmmsg.2:150 build/C/man3/sockatmark.3:69
598 #: build/C/man2/socket.2:350 build/C/man2/socketcall.2:43
599 #: build/C/man2/socketpair.2:93
600 #, no-wrap
601 msgid "CONFORMING TO"
602 msgstr "準拠"
603
604 #.  The BSD man page documents five possible error returns
605 #.  (EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EFAULT).
606 #.  POSIX.1-2001 documents errors
607 #.  EAGAIN, EBADF, ECONNABORTED, EINTR, EINVAL, EMFILE,
608 #.  ENFILE, ENOBUFS, ENOMEM, ENOTSOCK, EOPNOTSUPP, EPROTO, EWOULDBLOCK.
609 #.  In addition, SUSv2 documents EFAULT and ENOSR.
610 #. type: Plain text
611 #: build/C/man2/accept.2:304
612 msgid ""
613 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  first appeared in "
614 "4.2BSD)."
615 msgstr ""
616 "B<accept>(): POSIX.1-2001, SVr4, 4.4BSD, (B<accept>()  は 4.2BSD で初めて実装"
617 "された)."
618
619 #. type: Plain text
620 #: build/C/man2/accept.2:307
621 msgid "B<accept4>()  is a nonstandard Linux extension."
622 msgstr "B<accept4>()  は非標準の Linux による拡張である。"
623
624 #.  Some testing seems to show that Tru64 5.1 and HP-UX 11 also
625 #.  do not inherit file status flags -- MTK Jun 05
626 #. type: Plain text
627 #: build/C/man2/accept.2:322
628 msgid ""
629 "On Linux, the new socket returned by B<accept>()  does I<not> inherit file "
630 "status flags such as B<O_NONBLOCK> and B<O_ASYNC> from the listening "
631 "socket.  This behavior differs from the canonical BSD sockets "
632 "implementation.  Portable programs should not rely on inheritance or "
633 "noninheritance of file status flags and always explicitly set all required "
634 "flags on the socket returned from B<accept>()."
635 msgstr ""
636 "Linux では、 B<accept>()  が返す新しいソケットは listen を行っているソケット"
637 "の ファイル状態フラグ (B<O_NONBLOCK> や B<O_ASYNC> など) を継承「しない」。 "
638 "この動作は標準的な BSD ソケットの実装とは異なっている。 移植性を考慮したプロ"
639 "グラムではファイル状態フラグが継承されるかどうかは 前提にせず、常に B<accept>"
640 "()  が返したソケットに対して全ての必要なフラグを明示的に設定するように すべき"
641 "である。"
642
643 #. type: SH
644 #: build/C/man2/accept.2:322 build/C/man2/bind.2:232
645 #: build/C/man3/bindresvport.3:92 build/C/man2/connect.2:239
646 #: build/C/man3/getifaddrs.3:185 build/C/man2/getsockname.2:101
647 #: build/C/man2/getsockopt.2:176 build/C/man2/listen.2:109
648 #: build/C/man2/recv.2:453 build/C/man2/select.2:342
649 #: build/C/man2/select_tut.2:501 build/C/man2/send.2:380
650 #: build/C/man2/sendmmsg.2:153 build/C/man3/sockatmark.3:71
651 #: build/C/man2/socket.2:364 build/C/man7/socket.7:710
652 #: build/C/man2/socketcall.2:46 build/C/man2/socketpair.2:101
653 #, no-wrap
654 msgid "NOTES"
655 msgstr "注意"
656
657 #. type: Plain text
658 #: build/C/man2/accept.2:328 build/C/man2/bind.2:238
659 #: build/C/man2/connect.2:245 build/C/man2/getsockopt.2:182
660 #: build/C/man2/listen.2:135 build/C/man2/socket.2:370
661 #: build/C/man2/socketpair.2:122
662 msgid ""
663 "POSIX.1-2001 does not require the inclusion of I<E<lt>sys/types.hE<gt>>, and "
664 "this header file is not required on Linux.  However, some historical (BSD) "
665 "implementations required this header file, and portable applications are "
666 "probably wise to include it."
667 msgstr ""
668 "POSIX.1-2001 では I<E<lt>sys/types.hE<gt>> のインクルードは必須とされておら"
669 "ず、 Linux ではこのヘッダファイルは必要ではない。 しかし、歴史的には、いくつ"
670 "かの実装 (BSD 系) でこのヘッダファイルが 必要であり、移植性が必要なアプリケー"
671 "ションではこのファイルを インクルードするのが賢明であろう。"
672
673 #. type: Plain text
674 #: build/C/man2/accept.2:349
675 msgid ""
676 "There may not always be a connection waiting after a B<SIGIO> is delivered "
677 "or B<select>(2)  or B<poll>(2)  return a readability event because the "
678 "connection might have been removed by an asynchronous network error or "
679 "another thread before B<accept>()  is called.  If this happens then the call "
680 "will block waiting for the next connection to arrive.  To ensure that "
681 "B<accept>()  never blocks, the passed socket I<sockfd> needs to have the "
682 "B<O_NONBLOCK> flag set (see B<socket>(7))."
683 msgstr ""
684 "B<SIGIO> が届けられた後や、 B<select>(2)  または B<poll>(2)  が読み込み可能イ"
685 "ベントを返した後に、 必ずしも待機中の接続があるとは限らない。 なぜならその接"
686 "続は、 B<accept>()  が呼ばれる前に、非同期的なネットワークエラーや 他のスレッ"
687 "ドから呼ばれた (別の) accept によって 削除されているかもしれないからである。 "
688 "この場合、その B<accept>()  呼び出しは停止 (block) し、次の接続の到着を待ちつ"
689 "づける。 B<accept>()  に停止を行わせないようにするには、引き数に渡すソケット "
690 "I<sockfd> に B<O_NONBLOCK> フラグをセットしておく必要がある (B<socket>(7)  を"
691 "見よ)。"
692
693 #. type: SS
694 #: build/C/man2/accept.2:349
695 #, no-wrap
696 msgid "The socklen_t type"
697 msgstr "socklen_t 型"
698
699 #. type: Plain text
700 #: build/C/man2/accept.2:359
701 msgid ""
702 "The third argument of B<accept>()  was originally declared as an I<int *> "
703 "(and is that under libc4 and libc5 and on many other systems like 4.x BSD, "
704 "SunOS 4, SGI); a POSIX.1g draft standard wanted to change it into a I<size_t "
705 "*>, and that is what it is for SunOS 5.  Later POSIX drafts have I<socklen_t "
706 "*>, and so do the Single UNIX Specification and glibc2.  Quoting Linus "
707 "Torvalds:"
708 msgstr ""
709 "B<accept>()  の第 3 引き数は、もともと I<int *> と宣言されていた (libc4 や "
710 "libc5, 4.x BSD, SunOS 4, SGI など多くのシステムではそうなっている)。 "
711 "POSIX.1g draft 標準は、 これを I<size_t *> に変更しようとし、SunOS 5 ではそう"
712 "宣言されている。 後に POSIX drafts には I<socklen_t *> が含まれるようにな"
713 "り、 Single UNIX Specification や glibc2 ではこのように宣言されるようになっ"
714 "た。 Linus Torvald の発言を引用する:"
715
716 #.  .I fails: only italicizes a single line
717 #. type: Plain text
718 #: build/C/man2/accept.2:376
719 msgid ""
720 "\"_Any_ sane library _must_ have \"socklen_t\" be the same size as int.  "
721 "Anything else breaks any BSD socket layer stuff.  POSIX initially I<did> "
722 "make it a size_t, and I (and hopefully others, but obviously not too many) "
723 "complained to them very loudly indeed.  Making it a size_t is completely "
724 "broken, exactly because size_t very seldom is the same size as \"int\" on 64-"
725 "bit architectures, for example.  And it I<has> to be the same size as \"int"
726 "\" because that's what the BSD socket interface is.  Anyway, the POSIX "
727 "people eventually got a clue, and created \"socklen_t\".  They shouldn't "
728 "have touched it in the first place, but once they did they felt it had to "
729 "have a named type for some unfathomable reason (probably somebody didn't "
730 "like losing face over having done the original stupid thing, so they "
731 "silently just renamed their blunder).\""
732 msgstr ""
733 "「まともなライブラリを作りたければ、 \"socklen_t\" のサイズは int と同じにし"
734 "なきゃならない。 さもないと BSD ソケット層を破壊することになっちゃう。 POSIX "
735 "は最初こいつを size_t にしたんで、 ぼくは彼らに文句をがなりたてた (多分そうい"
736 "う人は他にもいたと思う。多くはなかったようだけど)。 こいつを size_t にするの"
737 "は完全にいかれてる。 例えば 64 ビットアーキテクチャでは、 size_t が \"int\" "
738 "と同じサイズだなんてことはほとんどないからね。 このサイズは \"int\" と 同じで"
739 "なきゃ『ダメ』なんだ。 BSD ソケットインターフェースっていうのはそういうものな"
740 "んだから。 まあともかく POSIX の人たちも、 \"socklen_t\" を作るという解決策を"
741 "なんとかひねり出した。 そもそも最初から放っておけば良かったんだが、 いじっ"
742 "ちゃった以上、 名前付きの型を持たせなきゃならない、と思ったみたいだね。 なん"
743 "でかはわかんないけど (きっと最初にやっちまった馬鹿な間違いで顔をつぶしたくな"
744 "かったから、 こっそり名前を付け替えて自分たちの大失敗をごまかそうとしたんだろ"
745 "う)。」"
746
747 #. type: SH
748 #: build/C/man2/accept.2:376 build/C/man2/bind.2:252
749 #: build/C/man2/connect.2:256 build/C/man3/getifaddrs.3:198
750 #: build/C/man2/listen.2:164 build/C/man2/recv.2:488 build/C/man2/select.2:484
751 #: build/C/man2/select_tut.2:527 build/C/man2/send.2:417
752 #: build/C/man3/sockatmark.3:95 build/C/man2/socket.2:382
753 #, no-wrap
754 msgid "EXAMPLE"
755 msgstr "例"
756
757 #. type: Plain text
758 #: build/C/man2/accept.2:379 build/C/man2/listen.2:167
759 msgid "See B<bind>(2)."
760 msgstr "B<bind>(2)  参照。"
761
762 #. type: SH
763 #: build/C/man2/accept.2:379 build/C/man2/bind.2:317
764 #: build/C/man3/bindresvport.3:98 build/C/man2/connect.2:261
765 #: build/C/man3/getifaddrs.3:281 build/C/man2/getsockname.2:110
766 #: build/C/man2/getsockopt.2:200 build/C/man2/listen.2:167
767 #: build/C/man2/recv.2:493 build/C/man2/recvmmsg.2:165
768 #: build/C/man2/select.2:521 build/C/man2/select_tut.2:817
769 #: build/C/man2/send.2:422 build/C/man2/sendmmsg.2:168
770 #: build/C/man3/sockatmark.3:130 build/C/man2/socket.2:387
771 #: build/C/man7/socket.7:741 build/C/man2/socketcall.2:54
772 #: build/C/man2/socketpair.2:122
773 #, no-wrap
774 msgid "SEE ALSO"
775 msgstr "関連項目"
776
777 #. type: Plain text
778 #: build/C/man2/accept.2:386
779 msgid ""
780 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
781 "B<socket>(7)"
782 msgstr ""
783 "B<bind>(2), B<connect>(2), B<listen>(2), B<select>(2), B<socket>(2), "
784 "B<socket>(7)"
785
786 #. type: SH
787 #: build/C/man2/accept.2:386 build/C/man2/bind.2:330
788 #: build/C/man3/bindresvport.3:101 build/C/man2/connect.2:268
789 #: build/C/man3/getifaddrs.3:287 build/C/man2/getsockname.2:117
790 #: build/C/man2/getsockopt.2:208 build/C/man2/listen.2:173
791 #: build/C/man2/recv.2:504 build/C/man2/recvmmsg.2:172
792 #: build/C/man2/select.2:536 build/C/man2/select_tut.2:836
793 #: build/C/man2/send.2:437 build/C/man2/sendmmsg.2:173
794 #: build/C/man3/sockatmark.3:135 build/C/man2/socket.2:418
795 #: build/C/man7/socket.7:752 build/C/man2/socketcall.2:72
796 #: build/C/man2/socketpair.2:129
797 #, no-wrap
798 msgid "COLOPHON"
799 msgstr "この文書について"
800
801 #. type: Plain text
802 #: build/C/man2/accept.2:393 build/C/man2/bind.2:337
803 #: build/C/man3/bindresvport.3:108 build/C/man2/connect.2:275
804 #: build/C/man3/getifaddrs.3:294 build/C/man2/getsockname.2:124
805 #: build/C/man2/getsockopt.2:215 build/C/man2/listen.2:180
806 #: build/C/man2/recv.2:511 build/C/man2/recvmmsg.2:179
807 #: build/C/man2/select.2:543 build/C/man2/select_tut.2:843
808 #: build/C/man2/send.2:444 build/C/man2/sendmmsg.2:180
809 #: build/C/man3/sockatmark.3:142 build/C/man2/socket.2:425
810 #: build/C/man7/socket.7:759 build/C/man2/socketcall.2:79
811 #: build/C/man2/socketpair.2:136
812 msgid ""
813 "This page is part of release 3.40 of the Linux I<man-pages> project.  A "
814 "description of the project, and information about reporting bugs, can be "
815 "found at http://www.kernel.org/doc/man-pages/."
816 msgstr ""
817 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.40 の一部\n"
818 "である。プロジェクトの説明とバグ報告に関する情報は\n"
819 "http://www.kernel.org/doc/man-pages/ に書かれている。"
820
821 #. type: TH
822 #: build/C/man2/bind.2:66
823 #, no-wrap
824 msgid "BIND"
825 msgstr "BIND"
826
827 #. type: TH
828 #: build/C/man2/bind.2:66
829 #, no-wrap
830 msgid "2007-12-28"
831 msgstr "2007-12-28"
832
833 #. type: Plain text
834 #: build/C/man2/bind.2:69
835 msgid "bind - bind a name to a socket"
836 msgstr "bind - ソケットに名前をつける"
837
838 #. type: Plain text
839 #: build/C/man2/bind.2:76
840 #, no-wrap
841 msgid ""
842 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
843 "B<         socklen_t >I<addrlen>B<);>\n"
844 msgstr ""
845 "B<int bind(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
846 "B<         socklen_t >I<addrlen>B<);>\n"
847
848 #. type: Plain text
849 #: build/C/man2/bind.2:90
850 msgid ""
851 "When a socket is created with B<socket>(2), it exists in a name space "
852 "(address family) but has no address assigned to it.  B<bind>()  assigns the "
853 "address specified by I<addr> to the socket referred to by the file "
854 "descriptor I<sockfd>.  I<addrlen> specifies the size, in bytes, of the "
855 "address structure pointed to by I<addr>.  Traditionally, this operation is "
856 "called \\(lqassigning a name to a socket\\(rq."
857 msgstr ""
858 "B<socket>(2)  でソケットが作成されたとき、そのソケットは名前空間 (アドレス・"
859 "ファミリー) に 存在するが、アドレスは割り当てられていない。 B<bind>()  は、"
860 "ファイルディスクリプタ I<sockfd> で参照されるソケットに I<addr> で指定された"
861 "アドレスを割り当てる。 I<addrlen> には I<addr> が指すアドレス構造体のサイズを"
862 "バイト単位で指定する。 伝統的にこの操作は 「ソケットに名前をつける」 と呼ばれ"
863 "る。"
864
865 #. type: Plain text
866 #: build/C/man2/bind.2:97
867 msgid ""
868 "It is normally necessary to assign a local address using B<bind>()  before a "
869 "B<SOCK_STREAM> socket may receive connections (see B<accept>(2))."
870 msgstr ""
871 "B<SOCK_STREAM> ソケットが接続を受け付けられるようにするには (B<accept>(2)  を"
872 "参照)、通常その前に B<bind>()  を使用してローカルアドレスを割り当てる必要があ"
873 "る。"
874
875 #. type: Plain text
876 #: build/C/man2/bind.2:128
877 msgid ""
878 "The rules used in name binding vary between address families.  Consult the "
879 "manual entries in Section 7 for detailed information.  For B<AF_INET> see "
880 "B<ip>(7), for B<AF_INET6> see B<ipv6>(7), for B<AF_UNIX> see B<unix>(7), for "
881 "B<AF_APPLETALK> see B<ddp>(7), for B<AF_PACKET> see B<packet>(7), for "
882 "B<AF_X25> see B<x25>(7)  and for B<AF_NETLINK> see B<netlink>(7)."
883 msgstr ""
884 "名前付けのルールはアドレス・ファミリーごとに異なっている。詳細な情報は 第 7 "
885 "章の各マニュアルを参照すること。 B<AF_INET> は B<ip>(7)  を、 B<AF_INET6> は "
886 "B<ipv6>(7)  を、 B<AF_UNIX> は B<unix>(7)  を、 B<AF_APPLETALK> は B<ddp>"
887 "(7)  を、 B<AF_PACKET> は B<packet>(7)  を、 B<AF_X25> は B<x25>(7)  を、 "
888 "B<AF_NETLINK> は B<netlink>(7)  を参照。"
889
890 #. type: Plain text
891 #: build/C/man2/bind.2:135
892 msgid ""
893 "The actual structure passed for the I<addr> argument will depend on the "
894 "address family.  The I<sockaddr> structure is defined as something like:"
895 msgstr ""
896 "I<addr> 引き数に実際にどのような構造体が渡されるかは、 アドレス・ファミリーに"
897 "依存する。 I<sockaddr> 構造体は以下のような感じで定義されている:"
898
899 #. type: Plain text
900 #: build/C/man2/bind.2:142
901 #, no-wrap
902 msgid ""
903 "struct sockaddr {\n"
904 "    sa_family_t sa_family;\n"
905 "    char        sa_data[14];\n"
906 "}\n"
907 msgstr ""
908 "struct sockaddr {\n"
909 "    sa_family_t sa_family;\n"
910 "    char        sa_data[14];\n"
911 "}\n"
912
913 #. type: Plain text
914 #: build/C/man2/bind.2:150
915 msgid ""
916 "The only purpose of this structure is to cast the structure pointer passed "
917 "in I<addr> in order to avoid compiler warnings.  See EXAMPLE below."
918 msgstr ""
919 "この構造体は、 I<addr> に渡される構造体へのポインタをキャストし、 コンパイラ"
920 "の警告メッセージを抑えるためだけに存在する。 下記の「例」を参照。"
921
922 #. type: Plain text
923 #: build/C/man2/bind.2:155 build/C/man2/getsockname.2:70
924 #: build/C/man2/getsockopt.2:134 build/C/man2/listen.2:85
925 #: build/C/man2/socketpair.2:72
926 msgid ""
927 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
928 "appropriately."
929 msgstr ""
930 "成功した場合にはゼロが返される。エラー時には -1 が返され、 I<errno> が適切に"
931 "設定される。"
932
933 #. type: TP
934 #: build/C/man2/bind.2:156 build/C/man2/bind.2:180
935 #: build/C/man3/bindresvport.3:74 build/C/man2/connect.2:133
936 #: build/C/man2/send.2:283 build/C/man2/socket.2:318
937 #, no-wrap
938 msgid "B<EACCES>"
939 msgstr "B<EACCES>"
940
941 #.  e.g., privileged port in AF_INET domain
942 #. type: Plain text
943 #: build/C/man2/bind.2:160
944 msgid "The address is protected, and the user is not the superuser."
945 msgstr "そのアドレスは保護されていて、かつユーザがスーパーユーザではない。"
946
947 #. type: TP
948 #: build/C/man2/bind.2:160 build/C/man3/bindresvport.3:79
949 #: build/C/man2/connect.2:146 build/C/man2/listen.2:86
950 #, no-wrap
951 msgid "B<EADDRINUSE>"
952 msgstr "B<EADDRINUSE>"
953
954 #. type: Plain text
955 #: build/C/man2/bind.2:163
956 msgid "The given address is already in use."
957 msgstr "指定されたアドレスが既に使用中である。"
958
959 #. type: Plain text
960 #: build/C/man2/bind.2:167
961 msgid "I<sockfd> is not a valid descriptor."
962 msgstr "I<sockfd> が不正なディスクリプタである。"
963
964 #.  This may change in the future: see
965 #.  .I linux/unix/sock.c for details.
966 #. type: Plain text
967 #: build/C/man2/bind.2:172
968 msgid "The socket is already bound to an address."
969 msgstr "ソケットがすでにアドレスに結びつけ (bind) られている。"
970
971 #. type: Plain text
972 #: build/C/man2/bind.2:176
973 msgid "I<sockfd> is a descriptor for a file, not a socket."
974 msgstr ""
975 "I<sockfd> がファイルに対するディスクリプタで、ソケットに対するものではない。"
976
977 #. type: Plain text
978 #: build/C/man2/bind.2:180
979 msgid "The following errors are specific to UNIX domain (B<AF_UNIX>)  sockets:"
980 msgstr "以下のエラーは UNIXドメイン (B<AF_UNIX>)  のソケット特有である:"
981
982 #. type: Plain text
983 #: build/C/man2/bind.2:185
984 msgid ""
985 "Search permission is denied on a component of the path prefix.  (See also "
986 "B<path_resolution>(7).)"
987 msgstr ""
988 "パス名の構成要素に検索許可 (search permission) がない (B<path_resolution>"
989 "(7)  も参照すること)。"
990
991 #. type: TP
992 #: build/C/man2/bind.2:185
993 #, no-wrap
994 msgid "B<EADDRNOTAVAIL>"
995 msgstr "B<EADDRNOTAVAIL>"
996
997 #. type: Plain text
998 #: build/C/man2/bind.2:189
999 msgid ""
1000 "A nonexistent interface was requested or the requested address was not local."
1001 msgstr ""
1002 "存在しないインタフェースが要求されたか、要求されたアドレスが ローカルではな"
1003 "かった。"
1004
1005 #. type: Plain text
1006 #: build/C/man2/bind.2:193
1007 msgid "I<addr> points outside the user's accessible address space."
1008 msgstr "I<addr> がユーザのアクセス可能なアドレス空間の外を指している。"
1009
1010 #. type: Plain text
1011 #: build/C/man2/bind.2:200
1012 msgid ""
1013 "The I<addrlen> is wrong, or the socket was not in the B<AF_UNIX> family."
1014 msgstr "I<addrlen> が不正であるか、ソケットが B<AF_UNIX> ファミリーではない。"
1015
1016 #. type: TP
1017 #: build/C/man2/bind.2:200
1018 #, no-wrap
1019 msgid "B<ELOOP>"
1020 msgstr "B<ELOOP>"
1021
1022 #. type: Plain text
1023 #: build/C/man2/bind.2:204
1024 msgid "Too many symbolic links were encountered in resolving I<addr>."
1025 msgstr "I<addr> を解決する際に遭遇したシンボリック・リンクが多過ぎる。"
1026
1027 #. type: TP
1028 #: build/C/man2/bind.2:204
1029 #, no-wrap
1030 msgid "B<ENAMETOOLONG>"
1031 msgstr "B<ENAMETOOLONG>"
1032
1033 #. type: Plain text
1034 #: build/C/man2/bind.2:208
1035 msgid "I<addr> is too long."
1036 msgstr "I<addr> が長過ぎる。"
1037
1038 #. type: TP
1039 #: build/C/man2/bind.2:208
1040 #, no-wrap
1041 msgid "B<ENOENT>"
1042 msgstr "B<ENOENT>"
1043
1044 #. type: Plain text
1045 #: build/C/man2/bind.2:211
1046 msgid "The file does not exist."
1047 msgstr "ファイルが存在しない。"
1048
1049 #. type: TP
1050 #: build/C/man2/bind.2:211 build/C/man2/recv.2:427 build/C/man2/select.2:318
1051 #: build/C/man2/send.2:341
1052 #, no-wrap
1053 msgid "B<ENOMEM>"
1054 msgstr "B<ENOMEM>"
1055
1056 #. type: Plain text
1057 #: build/C/man2/bind.2:214
1058 msgid "Insufficient kernel memory was available."
1059 msgstr "カーネルに、利用可能なメモリーが十分にない。"
1060
1061 #. type: TP
1062 #: build/C/man2/bind.2:214
1063 #, no-wrap
1064 msgid "B<ENOTDIR>"
1065 msgstr "B<ENOTDIR>"
1066
1067 #. type: Plain text
1068 #: build/C/man2/bind.2:217
1069 msgid "A component of the path prefix is not a directory."
1070 msgstr "パス名の構成要素がディレクトリではない。"
1071
1072 #. type: TP
1073 #: build/C/man2/bind.2:217
1074 #, no-wrap
1075 msgid "B<EROFS>"
1076 msgstr "B<EROFS>"
1077
1078 #. type: Plain text
1079 #: build/C/man2/bind.2:220
1080 msgid "The socket inode would reside on a read-only file system."
1081 msgstr "ソケット inode が読み込み専用のファイルシステム上にある。"
1082
1083 #.  SVr4 documents an additional
1084 #.  .B ENOSR
1085 #.  general error condition, and
1086 #.  additional
1087 #.  .B EIO
1088 #.  and
1089 #.  .B EISDIR
1090 #.  UNIX-domain error conditions.
1091 #. type: Plain text
1092 #: build/C/man2/bind.2:232
1093 msgid "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  first appeared in 4.2BSD)."
1094 msgstr "SVr4, 4.4BSD, POSIX.1-2001 (B<bind>()  は 4.2BSD で最初に現われた)。"
1095
1096 #. type: Plain text
1097 #: build/C/man2/bind.2:249
1098 msgid ""
1099 "The third argument of B<bind>()  is in reality an I<int> (and this is what 4."
1100 "x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in the "
1101 "present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1102 msgstr ""
1103 "B<bind>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際には "
1104 "I<int> である。glibc でも使われている現在の I<socklen_t> に関して、POSIX には"
1105 "少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
1106
1107 #. type: SH
1108 #: build/C/man2/bind.2:249 build/C/man2/getsockopt.2:197
1109 #: build/C/man2/select.2:425 build/C/man2/send.2:412
1110 #: build/C/man3/sockatmark.3:91 build/C/man7/socket.7:728
1111 #, no-wrap
1112 msgid "BUGS"
1113 msgstr "バグ"
1114
1115 #.  FIXME What *are* transparent proxy options?
1116 #. type: Plain text
1117 #: build/C/man2/bind.2:252
1118 msgid "The transparent proxy options are not described."
1119 msgstr "透過的プロキシ (transparent proxy) オプションについて記述していない。"
1120
1121 #. type: Plain text
1122 #: build/C/man2/bind.2:257
1123 msgid ""
1124 "An example of the use of B<bind>()  with Internet domain sockets can be "
1125 "found in B<getaddrinfo>(3)."
1126 msgstr ""
1127 "インターネット・ドメイン・ソケットでの B<bind>()  の利用例が B<getaddrinfo>"
1128 "(3)  に記載されている。"
1129
1130 #.  listen.7 refers to this example.
1131 #.  accept.7 refers to this example.
1132 #.  unix.7 refers to this example.
1133 #. type: Plain text
1134 #: build/C/man2/bind.2:264
1135 msgid ""
1136 "The following example shows how to bind a stream socket in the UNIX "
1137 "(B<AF_UNIX>)  domain, and accept connections:"
1138 msgstr ""
1139 "以下の例は、UNIX ドメイン (B<AF_UNIX>)  でストリームソケットを bind する方法"
1140 "を示したものである。"
1141
1142 #. type: Plain text
1143 #: build/C/man2/bind.2:271
1144 #, no-wrap
1145 msgid ""
1146 "#include E<lt>sys/socket.hE<gt>\n"
1147 "#include E<lt>sys/un.hE<gt>\n"
1148 "#include E<lt>stdlib.hE<gt>\n"
1149 "#include E<lt>stdio.hE<gt>\n"
1150 "#include E<lt>string.hE<gt>\n"
1151 msgstr ""
1152 "#include E<lt>sys/socket.hE<gt>\n"
1153 "#include E<lt>sys/un.hE<gt>\n"
1154 "#include E<lt>stdlib.hE<gt>\n"
1155 "#include E<lt>stdio.hE<gt>\n"
1156 "#include E<lt>string.hE<gt>\n"
1157
1158 #. type: Plain text
1159 #: build/C/man2/bind.2:274
1160 #, no-wrap
1161 msgid ""
1162 "#define MY_SOCK_PATH \"/somepath\"\n"
1163 "#define LISTEN_BACKLOG 50\n"
1164 msgstr ""
1165 "#define MY_SOCK_PATH \"/somepath\"\n"
1166 "#define LISTEN_BACKLOG 50\n"
1167
1168 #. type: Plain text
1169 #: build/C/man2/bind.2:277
1170 #, no-wrap
1171 msgid ""
1172 "#define handle_error(msg) \\e\n"
1173 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1174 msgstr ""
1175 "#define handle_error(msg) \\e\n"
1176 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1177
1178 #. type: Plain text
1179 #: build/C/man2/bind.2:284
1180 #, no-wrap
1181 msgid ""
1182 "int\n"
1183 "main(int argc, char *argv[])\n"
1184 "{\n"
1185 "    int sfd, cfd;\n"
1186 "    struct sockaddr_un my_addr, peer_addr;\n"
1187 "    socklen_t peer_addr_size;\n"
1188 msgstr ""
1189 "int\n"
1190 "main(int argc, char *argv[])\n"
1191 "{\n"
1192 "    int sfd, cfd;\n"
1193 "    struct sockaddr_un my_addr, peer_addr;\n"
1194 "    socklen_t peer_addr_size;\n"
1195
1196 #. type: Plain text
1197 #: build/C/man2/bind.2:288
1198 #, no-wrap
1199 msgid ""
1200 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1201 "    if (sfd == -1)\n"
1202 "        handle_error(\"socket\");\n"
1203 msgstr ""
1204 "    sfd = socket(AF_UNIX, SOCK_STREAM, 0);\n"
1205 "    if (sfd == -1)\n"
1206 "        handle_error(\"socket\");\n"
1207
1208 #. type: Plain text
1209 #: build/C/man2/bind.2:294
1210 #, no-wrap
1211 msgid ""
1212 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1213 "                        /* Clear structure */\n"
1214 "    my_addr.sun_family = AF_UNIX;\n"
1215 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1216 "            sizeof(my_addr.sun_path) - 1);\n"
1217 msgstr ""
1218 "    memset(&my_addr, 0, sizeof(struct sockaddr_un));\n"
1219 "                        /* Clear structure */\n"
1220 "    my_addr.sun_family = AF_UNIX;\n"
1221 "    strncpy(my_addr.sun_path, MY_SOCK_PATH,\n"
1222 "            sizeof(my_addr.sun_path) - 1);\n"
1223
1224 #. type: Plain text
1225 #: build/C/man2/bind.2:298
1226 #, no-wrap
1227 msgid ""
1228 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1229 "            sizeof(struct sockaddr_un)) == -1)\n"
1230 "        handle_error(\"bind\");\n"
1231 msgstr ""
1232 "    if (bind(sfd, (struct sockaddr *) &my_addr,\n"
1233 "            sizeof(struct sockaddr_un)) == -1)\n"
1234 "        handle_error(\"bind\");\n"
1235
1236 #. type: Plain text
1237 #: build/C/man2/bind.2:301
1238 #, no-wrap
1239 msgid ""
1240 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1241 "        handle_error(\"listen\");\n"
1242 msgstr ""
1243 "    if (listen(sfd, LISTEN_BACKLOG) == -1)\n"
1244 "        handle_error(\"listen\");\n"
1245
1246 #. type: Plain text
1247 #: build/C/man2/bind.2:304
1248 #, no-wrap
1249 msgid ""
1250 "    /* Now we can accept incoming connections one\n"
1251 "       at a time using accept(2) */\n"
1252 msgstr ""
1253 "    /* Now we can accept incoming connections one\n"
1254 "       at a time using accept(2) */\n"
1255
1256 #. type: Plain text
1257 #: build/C/man2/bind.2:310
1258 #, no-wrap
1259 msgid ""
1260 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1261 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1262 "                 &peer_addr_size);\n"
1263 "    if (cfd == -1)\n"
1264 "        handle_error(\"accept\");\n"
1265 msgstr ""
1266 "    peer_addr_size = sizeof(struct sockaddr_un);\n"
1267 "    cfd = accept(sfd, (struct sockaddr *) &peer_addr,\n"
1268 "                 &peer_addr_size)\n"
1269 "    if (cfd == -1)\n"
1270 "        handle_error(\"accept\");\n"
1271
1272 #. type: Plain text
1273 #: build/C/man2/bind.2:312
1274 #, no-wrap
1275 msgid "    /* Code to deal with incoming connection(s)... */\n"
1276 msgstr "    /* Code to deal with incoming connection(s)... */\n"
1277
1278 #. type: Plain text
1279 #: build/C/man2/bind.2:316
1280 #, no-wrap
1281 msgid ""
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 msgstr ""
1286 "    /* When no longer required, the socket pathname, MY_SOCK_PATH\n"
1287 "       should be deleted using unlink(2) or remove(3) */\n"
1288 "}\n"
1289
1290 #. type: Plain text
1291 #: build/C/man2/bind.2:330
1292 msgid ""
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 msgstr ""
1297 "B<accept>(2), B<connect>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1298 "B<getaddrinfo>(3), B<getifaddrs>(3), B<ip>(7), B<ipv6>(7), B<path_resolution>"
1299 "(7), B<socket>(7), B<unix>(7)"
1300
1301 #. type: TH
1302 #: build/C/man3/bindresvport.3:27
1303 #, no-wrap
1304 msgid "BINDRESVPORT"
1305 msgstr "BINDRESVPORT"
1306
1307 #. type: TH
1308 #: build/C/man3/bindresvport.3:27 build/C/man2/connect.2:65
1309 #: build/C/man2/getsockname.2:38 build/C/man2/getsockopt.2:42
1310 #: build/C/man3/sockatmark.3:23
1311 #, no-wrap
1312 msgid "2008-12-03"
1313 msgstr "2008-12-03"
1314
1315 #. type: Plain text
1316 #: build/C/man3/bindresvport.3:30
1317 msgid "bindresvport - bind a socket to a privileged IP port"
1318 msgstr "bindresvport - ソケットを特権 IP ポートにバインドする"
1319
1320 #. type: Plain text
1321 #: build/C/man3/bindresvport.3:34
1322 #, no-wrap
1323 msgid ""
1324 "B<#include E<lt>sys/types.hE<gt>>\n"
1325 "B<#include E<lt>netinet/in.hE<gt>>\n"
1326 msgstr ""
1327 "B<#include E<lt>sys/types.hE<gt>>\n"
1328 "B<#include E<lt>netinet/in.hE<gt>>\n"
1329
1330 #. type: Plain text
1331 #: build/C/man3/bindresvport.3:36
1332 #, no-wrap
1333 msgid "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1334 msgstr "B<int bindresvport(int >I<sockfd>B<, struct sockaddr_in *>I<sin>B<);>\n"
1335
1336 #.  Glibc actually starts searching with a port # in the range 600 to 1023
1337 #. type: Plain text
1338 #: build/C/man3/bindresvport.3:43
1339 msgid ""
1340 "B<bindresvport>()  is used to bind a socket descriptor to a privileged "
1341 "anonymous IP port, that is, a port number arbitrarily selected from the "
1342 "range 512 to 1023."
1343 msgstr ""
1344 "B<bindresvport>()  は、ソケット・ディスクリプタを特権無名 (privileged "
1345 "anonymous) IP ポートに バインドするのに使う。特権無名 IP ポートとは、 ポート"
1346 "番号が 512 から 1023 の範囲から任意に選択されるポートである。"
1347
1348 #. type: Plain text
1349 #: build/C/man3/bindresvport.3:53
1350 msgid ""
1351 "If the B<bind>(2)  performed by B<bindresvport>()  is successful, and I<sin> "
1352 "is not NULL, then I<sin-E<gt>sin_port> returns the port number actually "
1353 "allocated."
1354 msgstr ""
1355 "B<bindresvport>()  によって実行された B<bind>(2)  が成功し、 I<sin> が NULL "
1356 "以外の場合、実際に割り当てられたポート番号が I<sin-E<gt>sin_port> に入れて返"
1357 "される。"
1358
1359 #. type: Plain text
1360 #: build/C/man3/bindresvport.3:64
1361 msgid ""
1362 "I<sin> can be NULL, in which case I<sin-E<gt>sin_family> is implicitly taken "
1363 "to be B<AF_INET>.  However, in this case, B<bindresvport>()  has no way to "
1364 "return the port number actually allocated.  (This information can later be "
1365 "obtained using B<getsockname>(2).)"
1366 msgstr ""
1367 "I<sin> には NULL を指定することもでき、その場合には I<sin-E<gt>sin_family> は"
1368 "暗黙のうちに B<AF_INET> とみなされる。 しかし、この場合には、 B<bindresvport>"
1369 "()  は実際に割り当てられたポート番号を返す手段を持たない (割り当てられたポー"
1370 "ト番号は、後で B<getsockname>(2)  を使って取得できる)。"
1371
1372 #. type: Plain text
1373 #: build/C/man3/bindresvport.3:69
1374 msgid ""
1375 "B<bindresvport>()  returns 0 on success; otherwise -1 is returned and "
1376 "I<errno> set to indicate the cause of the error."
1377 msgstr ""
1378 "B<bindresvport>()  は成功すると 0 を返す。それ以外の場合、-1 を返し、 "
1379 "I<errno> にエラーの原因を示す値を設定する。"
1380
1381 #. type: Plain text
1382 #: build/C/man3/bindresvport.3:74
1383 msgid ""
1384 "B<bindresvport>()  can fail for any of the same reasons as B<bind>(2).  In "
1385 "addition, the following errors may occur:"
1386 msgstr ""
1387 "B<bindresvport>()  は B<bind>(2)  と同じ原因で失敗する可能性がある。 さらに、"
1388 "以下のエラーが発生することがある:"
1389
1390 #. type: Plain text
1391 #: build/C/man3/bindresvport.3:79
1392 msgid ""
1393 "The caller did not have superuser privilege (to be precise: the "
1394 "B<CAP_NET_BIND_SERVICE> capability is required)."
1395 msgstr ""
1396 "呼び出し元がスーパーユーザの特権を持っていなかった (より正確に言うと、 "
1397 "B<CAP_NET_BIND_SERVICE> ケーパビリティが必要である)。"
1398
1399 #. type: Plain text
1400 #: build/C/man3/bindresvport.3:82
1401 msgid "All privileged ports are in use."
1402 msgstr "全ての特権ポートが使用中である。"
1403
1404 #. type: TP
1405 #: build/C/man3/bindresvport.3:82
1406 #, no-wrap
1407 msgid "B<EAFNOSUPPORT> (B<EPFNOSUPPORT> in glibc 2.7 and earlier)"
1408 msgstr "B<EAFNOSUPPORT> (glibc 2.7 以前では B<EPFNOSUPPORT>)"
1409
1410 #. type: Plain text
1411 #: build/C/man3/bindresvport.3:89
1412 msgid "I<sin> is not NULL and I<sin-E<gt>sin_family> is not B<AF_INET>."
1413 msgstr ""
1414 "I<sin> が NULL 以外で、かつ I<sin-E<gt>sin_family> が B<AF_INET> でなかった。"
1415
1416 #. type: Plain text
1417 #: build/C/man3/bindresvport.3:92
1418 msgid ""
1419 "Not in POSIX.1-2001.  Present on the BSDs, Solaris, and many other systems."
1420 msgstr ""
1421 "POSIX.1-2001 にはない。 BSD, Solaris およびその他の多くのシステムに存在する。"
1422
1423 #. type: Plain text
1424 #: build/C/man3/bindresvport.3:98
1425 msgid ""
1426 "Unlike some B<bindresvport>()  implementations, the glibc implementation "
1427 "ignores any value that the caller supplies in I<sin-E<gt>sin_port>."
1428 msgstr ""
1429 "B<bindresvport>()  のいくつかの実装と異なり、glibc の実装では呼び出し元が "
1430 "I<sin-E<gt>sin_port> で渡した値はどんな値であっても無視される。"
1431
1432 #. type: Plain text
1433 #: build/C/man3/bindresvport.3:101
1434 msgid "B<bind>(2), B<getsockname>(2)"
1435 msgstr "B<bind>(2), B<getsockname>(2)"
1436
1437 #. type: TH
1438 #: build/C/man2/connect.2:65
1439 #, no-wrap
1440 msgid "CONNECT"
1441 msgstr "CONNECT"
1442
1443 #. type: Plain text
1444 #: build/C/man2/connect.2:68
1445 msgid "connect - initiate a connection on a socket"
1446 msgstr "connect - ソケットの接続を行う"
1447
1448 #. type: Plain text
1449 #: build/C/man2/connect.2:71 build/C/man2/getsockopt.2:48
1450 #: build/C/man2/listen.2:49
1451 #, no-wrap
1452 msgid "B<#include E<lt>sys/types.hE<gt>>          /* See NOTES */\n"
1453 msgstr "B<#include E<lt>sys/types.hE<gt>>          /* 「注意」参照 */\n"
1454
1455 #. type: Plain text
1456 #: build/C/man2/connect.2:73 build/C/man2/getsockname.2:44
1457 #: build/C/man2/getsockopt.2:50 build/C/man2/listen.2:51
1458 #: build/C/man2/recv.2:49
1459 #, no-wrap
1460 msgid "B<#include E<lt>sys/socket.hE<gt>>\n"
1461 msgstr "B<#include E<lt>sys/socket.hE<gt>>\n"
1462
1463 #. type: Plain text
1464 #: build/C/man2/connect.2:76
1465 #, no-wrap
1466 msgid ""
1467 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1468 "B<            socklen_t >I<addrlen>B<);>\n"
1469 msgstr ""
1470 "B<int connect(int >I<sockfd>B<, const struct sockaddr *>I<addr>B<,>\n"
1471 "B<            socklen_t >I<addrlen>B<);>\n"
1472
1473 #. type: Plain text
1474 #: build/C/man2/connect.2:95
1475 msgid ""
1476 "The B<connect>()  system call connects the socket referred to by the file "
1477 "descriptor I<sockfd> to the address specified by I<addr>.  The I<addrlen> "
1478 "argument specifies the size of I<addr>.  The format of the address in "
1479 "I<addr> is determined by the address space of the socket I<sockfd>; see "
1480 "B<socket>(2)  for further details."
1481 msgstr ""
1482 "B<connect>()  システムコールは、ファイルディスクリプタ I<sockfd> が参照してい"
1483 "るソケットを I<addr> で指定されたアドレスに接続する。 I<addrlen> 引き数は "
1484 "I<addr> の大きさを示す。 I<addr> のアドレスのフォーマットはソケット "
1485 "I<sockfd> のアドレス空間により異なる。 さらなる詳細は B<socket>(2)  を参照の"
1486 "こと。"
1487
1488 #. type: Plain text
1489 #: build/C/man2/connect.2:111
1490 msgid ""
1491 "If the socket I<sockfd> is of type B<SOCK_DGRAM> then I<addr> is the address "
1492 "to which datagrams are sent by default, and the only address from which "
1493 "datagrams are received.  If the socket is of type B<SOCK_STREAM> or "
1494 "B<SOCK_SEQPACKET>, this call attempts to make a connection to the socket "
1495 "that is bound to the address specified by I<addr>."
1496 msgstr ""
1497 "ソケット I<sockfd> が B<SOCK_DGRAM> 型であれば、 I<addr> は、デフォルトのデー"
1498 "タグラムの送信先のアドレスであり、 データグラムを受信する唯一のアドレスを示す"
1499 "に過ぎない。 ソケットが B<SOCK_STREAM> 型もしくは B<SOCK_SEQPACKET> 型であれ"
1500 "ば、このシステムコールは I<addr> で指定されたアドレスに結び付けられたソケット"
1501 "に対する接続の 作成を試みる。"
1502
1503 #. type: Plain text
1504 #: build/C/man2/connect.2:125
1505 msgid ""
1506 "Generally, connection-based protocol sockets may successfully B<connect>()  "
1507 "only once; connectionless protocol sockets may use B<connect>()  multiple "
1508 "times to change their association.  Connectionless sockets may dissolve the "
1509 "association by connecting to an address with the I<sa_family> member of "
1510 "I<sockaddr> set to B<AF_UNSPEC> (supported on Linux since kernel 2.2)."
1511 msgstr ""
1512 "一般的に、接続指向 (connection-oriented) プロトコルでは一度だけ B<connect>"
1513 "()  が成功する。 非接続 (connectionless) プロトコルでは対応を変更するために何"
1514 "度も B<connect>()  を使用できる。 非接続ソケットは I<sockaddr> の "
1515 "I<sa_family> メンバに B<AF_UNSPEC> を設定することで、接続アドレスの対応を解消"
1516 "することができる (B<AF_UNSPEC> はカーネル 2.2 以降の Linux でサポート)。"
1517
1518 #. type: Plain text
1519 #: build/C/man2/connect.2:130
1520 msgid ""
1521 "If the connection or binding succeeds, zero is returned.  On error, -1 is "
1522 "returned, and I<errno> is set appropriately."
1523 msgstr ""
1524 "接続または対応づけに成功するとゼロを返す。 失敗すると -1 を返し、 I<errno> に"
1525 "適切な値を設定する。"
1526
1527 #. type: Plain text
1528 #: build/C/man2/connect.2:133
1529 msgid ""
1530 "The following are general socket errors only.  There may be other domain-"
1531 "specific error codes."
1532 msgstr ""
1533 "以下は一般的なソケットについてのエラーである。他にドメイン特有のエラー が発生"
1534 "する可能性がある。"
1535
1536 #. type: Plain text
1537 #: build/C/man2/connect.2:141
1538 msgid ""
1539 "For UNIX domain sockets, which are identified by pathname: Write permission "
1540 "is denied on the socket file, or search permission is denied for one of the "
1541 "directories in the path prefix.  (See also B<path_resolution>(7).)"
1542 msgstr ""
1543 "UNIX ドメインソケットはパス名で識別される。 ソケット・ファイルへの書き込み許"
1544 "可がなかったか、パス名へ 到達するまでのディレクトリのいずれかに対する検索許可"
1545 "がなかった。 (B<path_resolution>(7)  も参照のこと)"
1546
1547 #. type: TP
1548 #: build/C/man2/connect.2:141
1549 #, no-wrap
1550 msgid "B<EACCES>, B<EPERM>"
1551 msgstr "B<EACCES>, B<EPERM>"
1552
1553 #. type: Plain text
1554 #: build/C/man2/connect.2:146
1555 msgid ""
1556 "The user tried to connect to a broadcast address without having the socket "
1557 "broadcast flag enabled or the connection request failed because of a local "
1558 "firewall rule."
1559 msgstr ""
1560 "ソケットのブロードキャスト・フラグが有効になっていないのに ユーザがブロード"
1561 "キャストへ接続を試みた。または、ローカルのファイアウォールの 規則により接続の"
1562 "要求が失敗した。"
1563
1564 #. type: Plain text
1565 #: build/C/man2/connect.2:149
1566 msgid "Local address is already in use."
1567 msgstr "ローカルアドレスが既に使用されている。"
1568
1569 #. type: TP
1570 #: build/C/man2/connect.2:149 build/C/man2/socket.2:322
1571 #: build/C/man2/socketpair.2:73
1572 #, no-wrap
1573 msgid "B<EAFNOSUPPORT>"
1574 msgstr "B<EAFNOSUPPORT>"
1575
1576 #. type: Plain text
1577 #: build/C/man2/connect.2:154
1578 msgid ""
1579 "The passed address didn't have the correct address family in its "
1580 "I<sa_family> field."
1581 msgstr ""
1582 "渡されたアドレスの I<sa_family> フィールドが正しいアドレス・ファミリーではな"
1583 "い。"
1584
1585 #. type: TP
1586 #: build/C/man2/connect.2:154
1587 #, no-wrap
1588 msgid "B<EAGAIN>"
1589 msgstr "B<EAGAIN>"
1590
1591 #. type: Plain text
1592 #: build/C/man2/connect.2:163
1593 msgid ""
1594 "No more free local ports or insufficient entries in the routing cache.  For "
1595 "B<AF_INET> see the description of I</proc/sys/net/ipv4/ip_local_port_range> "
1596 "B<ip>(7)  for information on how to increase the number of local ports."
1597 msgstr ""
1598 "使用可能なローカルのポートがないか、 ルーティングキャッシュに十分なエントリが"
1599 "ない。 B<AF_INET> の場合に、ローカルポートの数を増やす方法については、 B<ip>"
1600 "(7)  の I</proc/sys/net/ipv4/ip_local_port_range> の説明を参照のこと。"
1601
1602 #. type: TP
1603 #: build/C/man2/connect.2:163
1604 #, no-wrap
1605 msgid "B<EALREADY>"
1606 msgstr "B<EALREADY>"
1607
1608 #. type: Plain text
1609 #: build/C/man2/connect.2:167
1610 msgid ""
1611 "The socket is nonblocking and a previous connection attempt has not yet been "
1612 "completed."
1613 msgstr ""
1614 "ソケットが非停止 (nonblocking) に設定されており、 前の接続が完了していない。"
1615
1616 #. type: Plain text
1617 #: build/C/man2/connect.2:170
1618 msgid "The file descriptor is not a valid index in the descriptor table."
1619 msgstr ""
1620 "ファイルディスクリプターがディスクリプターテーブルの 有効なインデックスではな"
1621 "い。"
1622
1623 #. type: TP
1624 #: build/C/man2/connect.2:170 build/C/man2/recv.2:410
1625 #, no-wrap
1626 msgid "B<ECONNREFUSED>"
1627 msgstr "B<ECONNREFUSED>"
1628
1629 #. type: Plain text
1630 #: build/C/man2/connect.2:173
1631 msgid "No-one listening on the remote address."
1632 msgstr "リモートアドレスで接続を待っているプログラムがない。"
1633
1634 #. type: Plain text
1635 #: build/C/man2/connect.2:176
1636 msgid "The socket structure address is outside the user's address space."
1637 msgstr "ソケット構造体のアドレスがユーザーのアドレス空間外にある。"
1638
1639 #. type: TP
1640 #: build/C/man2/connect.2:176
1641 #, no-wrap
1642 msgid "B<EINPROGRESS>"
1643 msgstr "B<EINPROGRESS>"
1644
1645 #. type: Plain text
1646 #: build/C/man2/connect.2:201
1647 msgid ""
1648 "The socket is nonblocking and the connection cannot be completed "
1649 "immediately.  It is possible to B<select>(2)  or B<poll>(2)  for completion "
1650 "by selecting the socket for writing.  After B<select>(2)  indicates "
1651 "writability, use B<getsockopt>(2)  to read the B<SO_ERROR> option at level "
1652 "B<SOL_SOCKET> to determine whether B<connect>()  completed successfully "
1653 "(B<SO_ERROR> is zero) or unsuccessfully (B<SO_ERROR> is one of the usual "
1654 "error codes listed here, explaining the reason for the failure)."
1655 msgstr ""
1656 "ソケットが非停止 (nonblocking) に設定されていて、接続をすぐに 完了することが"
1657 "できない。その場合、 B<select>(2)  や B<poll>(2)  を使ってそのソケットが書き"
1658 "込み可能になるのを待つことで、 接続の完了を知ることができる。 B<select>(2)  "
1659 "で書き込み可能になった後に、 B<getsockopt>(2)  を使って B<SOL_SOCKET> レベル"
1660 "で B<SO_ERROR> オプションを読み出すこ とにより、 B<connect>()  が成功したか、"
1661 "失敗したかを判断できる。 成功の場合 B<SO_ERROR> が 0 であり、 失敗の場合 "
1662 "B<SO_ERROR> がここのリストにあるいずれかのエラーコードであり、 それにより失敗"
1663 "の原因が分かる。"
1664
1665 #.  For TCP, the connection will complete asynchronously.
1666 #.  See http://lkml.org/lkml/2005/7/12/254
1667 #. type: Plain text
1668 #: build/C/man2/connect.2:207
1669 msgid ""
1670 "The system call was interrupted by a signal that was caught; see B<signal>"
1671 "(7)."
1672 msgstr ""
1673 "捕捉されたシグナルによりシステムコールが中断された。 B<signal>(7)  参照。"
1674
1675 #. type: TP
1676 #: build/C/man2/connect.2:207 build/C/man2/send.2:321
1677 #, no-wrap
1678 msgid "B<EISCONN>"
1679 msgstr "B<EISCONN>"
1680
1681 #. type: Plain text
1682 #: build/C/man2/connect.2:210
1683 msgid "The socket is already connected."
1684 msgstr "ソケットは既に接続 (connect) されている。"
1685
1686 #. type: TP
1687 #: build/C/man2/connect.2:210
1688 #, no-wrap
1689 msgid "B<ENETUNREACH>"
1690 msgstr "B<ENETUNREACH>"
1691
1692 #. type: Plain text
1693 #: build/C/man2/connect.2:213
1694 msgid "Network is unreachable."
1695 msgstr "到達できないネットワークである。"
1696
1697 #. type: Plain text
1698 #: build/C/man2/connect.2:216
1699 msgid "The file descriptor is not associated with a socket."
1700 msgstr "ファイルディスクリプターがソケットと関連付けられていない。"
1701
1702 #. type: TP
1703 #: build/C/man2/connect.2:216
1704 #, no-wrap
1705 msgid "B<ETIMEDOUT>"
1706 msgstr "B<ETIMEDOUT>"
1707
1708 #. type: Plain text
1709 #: build/C/man2/connect.2:223
1710 msgid ""
1711 "Timeout while attempting connection.  The server may be too busy to accept "
1712 "new connections.  Note that for IP sockets the timeout may be very long when "
1713 "syncookies are enabled on the server."
1714 msgstr ""
1715 "接続を試みている途中で時間切れ (timeout) になった。サーバーが混雑していて 新"
1716 "たな接続を受け入れられないのかもしれない。 IP ソケットでは、 syncookie がサー"
1717 "バーで有効になっている場合、 タイムアウトが非常に長くなる場合があるので注意す"
1718 "ること。"
1719
1720 #.  SVr4 documents the additional
1721 #.  general error codes
1722 #.  .BR EADDRNOTAVAIL ,
1723 #.  .BR EINVAL ,
1724 #.  .BR EAFNOSUPPORT ,
1725 #.  .BR EALREADY ,
1726 #.  .BR EINTR ,
1727 #.  .BR EPROTOTYPE ,
1728 #.  and
1729 #.  .BR ENOSR .
1730 #.  It also
1731 #.  documents many additional error conditions not described here.
1732 #. type: Plain text
1733 #: build/C/man2/connect.2:239
1734 msgid ""
1735 "SVr4, 4.4BSD, (the B<connect>()  function first appeared in 4.2BSD), "
1736 "POSIX.1-2001."
1737 msgstr ""
1738 "SVr4, 4.4BSD, (B<connect>()  関数は 4.2BSD で最初に登場した), POSIX.1-2001."
1739
1740 #. type: Plain text
1741 #: build/C/man2/connect.2:256
1742 msgid ""
1743 "The third argument of B<connect>()  is in reality an I<int> (and this is "
1744 "what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
1745 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
1746 msgstr ""
1747 "B<connect>()  の三番目の引き数は 4.x BSD や libc4, libc5 と同様に実際には "
1748 "I<int> である。 POSIX では紆余曲折を経て現在の I<socklen_t> になっており、 "
1749 "glibc でも I<socklen_t> を使っている。 B<accept>(2)  も参照のこと。"
1750
1751 #. type: Plain text
1752 #: build/C/man2/connect.2:261
1753 msgid "An example of the use of B<connect>()  is shown in B<getaddrinfo>(3)."
1754 msgstr "B<connect>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
1755
1756 #. type: Plain text
1757 #: build/C/man2/connect.2:268
1758 msgid ""
1759 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1760 "B<path_resolution>(7)"
1761 msgstr ""
1762 "B<accept>(2), B<bind>(2), B<getsockname>(2), B<listen>(2), B<socket>(2), "
1763 "B<path_resolution>(7)"
1764
1765 #. type: TH
1766 #: build/C/man3/getifaddrs.3:33
1767 #, no-wrap
1768 msgid "GETIFADDRS"
1769 msgstr "GETIFADDRS"
1770
1771 #. type: TH
1772 #: build/C/man3/getifaddrs.3:33
1773 #, no-wrap
1774 msgid "2010-10-06"
1775 msgstr "2010-10-06"
1776
1777 #. type: TH
1778 #: build/C/man3/getifaddrs.3:33
1779 #, no-wrap
1780 msgid "GNU"
1781 msgstr "GNU"
1782
1783 #. type: Plain text
1784 #: build/C/man3/getifaddrs.3:36
1785 msgid "getifaddrs, freeifaddrs - get interface addresses"
1786 msgstr ""
1787
1788 #. type: Plain text
1789 #: build/C/man3/getifaddrs.3:40
1790 #, no-wrap
1791 msgid ""
1792 "B<#include E<lt>sys/types.hE<gt>>\n"
1793 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1794 msgstr ""
1795 "B<#include E<lt>sys/types.hE<gt>>\n"
1796 "B<#include E<lt>ifaddrs.hE<gt>>\n"
1797
1798 #. type: Plain text
1799 #: build/C/man3/getifaddrs.3:42
1800 #, no-wrap
1801 msgid "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1802 msgstr "B<int getifaddrs(struct ifaddrs **>I<ifap>B<);>\n"
1803
1804 #. type: Plain text
1805 #: build/C/man3/getifaddrs.3:44
1806 #, no-wrap
1807 msgid "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1808 msgstr "B<void freeifaddrs(struct ifaddrs *>I<ifa>B<);>\n"
1809
1810 #. type: Plain text
1811 #: build/C/man3/getifaddrs.3:55
1812 msgid ""
1813 "The B<getifaddrs>()  function creates a linked list of structures describing "
1814 "the network interfaces of the local system, and stores the address of the "
1815 "first item of the list in I<*ifap>.  The list consists of I<ifaddrs> "
1816 "structures, defined as follows:"
1817 msgstr ""
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
1864 #.  The constant
1865 #.  .B IF NAMESIZE
1866 #.  indicates the maximum length of this field.
1867 #. type: Plain text
1868 #: build/C/man3/getifaddrs.3:88
1869 msgid "The I<ifa_name> points to the null-terminated interface name."
1870 msgstr ""
1871
1872 #. type: Plain text
1873 #: build/C/man3/getifaddrs.3:97
1874 msgid ""
1875 "The I<ifa_flags> field contains the interface flags, as returned by the "
1876 "B<SIOCGIFFLAGS> B<ioctl>(2)  operation (see B<netdevice>(7)  for a list of "
1877 "these flags)."
1878 msgstr ""
1879
1880 #. type: Plain text
1881 #: build/C/man3/getifaddrs.3:105
1882 msgid ""
1883 "The I<ifa_addr> field points to a structure containing the interface "
1884 "address.  (The I<sa_family> subfield should be consulted to determine the "
1885 "format of the address structure.)"
1886 msgstr ""
1887
1888 #. type: Plain text
1889 #: build/C/man3/getifaddrs.3:111
1890 msgid ""
1891 "The I<ifa_netmask> field points to a structure containing the netmask "
1892 "associated with I<ifa_addr>, if applicable for the address family."
1893 msgstr ""
1894
1895 #. type: Plain text
1896 #: build/C/man3/getifaddrs.3:126
1897 msgid ""
1898 "Depending on whether the bit B<IFF_BROADCAST> or B<IFF_POINTOPOINT> is set "
1899 "in I<ifa_flags> (only one can be set at a time), either I<ifa_broadaddr> "
1900 "will contain the broadcast address associated with I<ifa_addr> (if "
1901 "applicable for the address family) or I<ifa_dstaddr> will contain the "
1902 "destination address of the point-to-point interface."
1903 msgstr ""
1904
1905 #. type: Plain text
1906 #: build/C/man3/getifaddrs.3:131
1907 msgid ""
1908 "The I<ifa_data> field points to a buffer containing address-family-specific "
1909 "data; this field may be NULL if there is no such data for this interface."
1910 msgstr ""
1911
1912 #. type: Plain text
1913 #: build/C/man3/getifaddrs.3:137
1914 msgid ""
1915 "The data returned by B<getifaddrs>()  is dynamically allocated and should be "
1916 "freed using B<freeifaddrs>()  when no longer needed."
1917 msgstr ""
1918
1919 #. type: Plain text
1920 #: build/C/man3/getifaddrs.3:144
1921 msgid ""
1922 "On success, B<getifaddrs>()  returns zero; on error, -1 is returned, and "
1923 "I<errno> is set appropriately."
1924 msgstr ""
1925
1926 #. type: Plain text
1927 #: build/C/man3/getifaddrs.3:157
1928 msgid ""
1929 "B<getifaddrs>()  may fail and set I<errno> for any of the errors specified "
1930 "for B<socket>(2), B<bind>(2), B<getsockname>(2), B<recvmsg>(2), B<sendto>"
1931 "(2), B<malloc>(3), or B<realloc>(3)."
1932 msgstr ""
1933
1934 #. type: Plain text
1935 #: build/C/man3/getifaddrs.3:165
1936 msgid ""
1937 "The B<getifaddrs>()  function first appeared in glibc 2.3, but before glibc "
1938 "2.3.3, the implementation only supported IPv4 addresses; IPv6 support was "
1939 "added in glibc 2.3.3.  Support of address families other than IPv4 is only "
1940 "available on kernels that support netlink."
1941 msgstr ""
1942
1943 #.  , but the BSD-derived documentation generally
1944 #.  appears to be confused and obsolete on this point.
1945 #.  i.e., commonly it still says one of them will be NULL, even if
1946 #.  the ifa_ifu union is already present
1947 #. type: Plain text
1948 #: build/C/man3/getifaddrs.3:185
1949 msgid ""
1950 "Not in POSIX.1-2001.  This function first appeared in BSDi and is present on "
1951 "the BSD systems, but with slightly different semantics documented"
1952 "\\(emreturning one entry per interface, not per address.  This means "
1953 "I<ifa_addr> and other fields can actually be NULL if the interface has no "
1954 "address, and no link-level address is returned if the interface has an IP "
1955 "address assigned.  Also, the way of choosing either I<ifa_broadaddr> or "
1956 "I<ifa_dstaddr> differs on various systems."
1957 msgstr ""
1958
1959 #. type: Plain text
1960 #: build/C/man3/getifaddrs.3:198
1961 msgid ""
1962 "The addresses returned on Linux will usually be the IPv4 and IPv6 addresses "
1963 "assigned to the interface, but also one B<AF_PACKET> address per interface "
1964 "containing lower-level details about the interface and its physical layer.  "
1965 "In this case, the I<ifa_data> field may contain a pointer to a I<struct "
1966 "net_device_stats>, defined in I<E<lt>linux/netdevice.hE<gt>>, which contains "
1967 "various interface attributes and statistics."
1968 msgstr ""
1969
1970 #. type: Plain text
1971 #: build/C/man3/getifaddrs.3:205
1972 msgid ""
1973 "The program below demonstrates the use of B<getifaddrs>(), B<freeifaddrs>(), "
1974 "and B<getnameinfo>(3).  Here is what we see when running this program on one "
1975 "system:"
1976 msgstr ""
1977
1978 #. type: Plain text
1979 #: build/C/man3/getifaddrs.3:219
1980 #, no-wrap
1981 msgid ""
1982 "$ B<./a.out>\n"
1983 "lo      address family: 17 (AF_PACKET)\n"
1984 "eth0    address family: 17 (AF_PACKET)\n"
1985 "lo      address family: 2 (AF_INET)\n"
1986 "        address: E<lt>127.0.0.1E<gt>\n"
1987 "eth0    address family: 2 (AF_INET)\n"
1988 "        address: E<lt>10.1.1.4E<gt>\n"
1989 "lo      address family: 10 (AF_INET6)\n"
1990 "        address: E<lt>::1E<gt>\n"
1991 "eth0    address family: 10 (AF_INET6)\n"
1992 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
1993 msgstr ""
1994 "$ B<./a.out>\n"
1995 "lo      address family: 17 (AF_PACKET)\n"
1996 "eth0    address family: 17 (AF_PACKET)\n"
1997 "lo      address family: 2 (AF_INET)\n"
1998 "        address: E<lt>127.0.0.1E<gt>\n"
1999 "eth0    address family: 2 (AF_INET)\n"
2000 "        address: E<lt>10.1.1.4E<gt>\n"
2001 "lo      address family: 10 (AF_INET6)\n"
2002 "        address: E<lt>::1E<gt>\n"
2003 "eth0    address family: 10 (AF_INET6)\n"
2004 "        address: E<lt>fe80::2d0:59ff:feda:eb51%eth0E<gt>\n"
2005
2006 #. type: SS
2007 #: build/C/man3/getifaddrs.3:221
2008 #, no-wrap
2009 msgid "Program source"
2010 msgstr ""
2011
2012 #. type: Plain text
2013 #: build/C/man3/getifaddrs.3:231
2014 #, no-wrap
2015 msgid ""
2016 "#include E<lt>arpa/inet.hE<gt>\n"
2017 "#include E<lt>sys/socket.hE<gt>\n"
2018 "#include E<lt>netdb.hE<gt>\n"
2019 "#include E<lt>ifaddrs.hE<gt>\n"
2020 "#include E<lt>stdio.hE<gt>\n"
2021 "#include E<lt>stdlib.hE<gt>\n"
2022 "#include E<lt>unistd.hE<gt>\n"
2023 msgstr ""
2024 "#include E<lt>arpa/inet.hE<gt>\n"
2025 "#include E<lt>sys/socket.hE<gt>\n"
2026 "#include E<lt>netdb.hE<gt>\n"
2027 "#include E<lt>ifaddrs.hE<gt>\n"
2028 "#include E<lt>stdio.hE<gt>\n"
2029 "#include E<lt>stdlib.hE<gt>\n"
2030 "#include E<lt>unistd.hE<gt>\n"
2031
2032 #. type: Plain text
2033 #: build/C/man3/getifaddrs.3:238
2034 #, no-wrap
2035 msgid ""
2036 "int\n"
2037 "main(int argc, char *argv[])\n"
2038 "{\n"
2039 "    struct ifaddrs *ifaddr, *ifa;\n"
2040 "    int family, s;\n"
2041 "    char host[NI_MAXHOST];\n"
2042 msgstr ""
2043 "int\n"
2044 "main(int argc, char *argv[])\n"
2045 "{\n"
2046 "    struct ifaddrs *ifaddr, *ifa;\n"
2047 "    int family, s;\n"
2048 "    char host[NI_MAXHOST];\n"
2049
2050 #. type: Plain text
2051 #: build/C/man3/getifaddrs.3:243
2052 #, no-wrap
2053 msgid ""
2054 "    if (getifaddrs(&ifaddr) == -1) {\n"
2055 "        perror(\"getifaddrs\");\n"
2056 "        exit(EXIT_FAILURE);\n"
2057 "    }\n"
2058 msgstr ""
2059 "    if (getifaddrs(&ifaddr) == -1) {\n"
2060 "        perror(\"getifaddrs\");\n"
2061 "        exit(EXIT_FAILURE);\n"
2062 "    }\n"
2063
2064 #. type: Plain text
2065 #: build/C/man3/getifaddrs.3:246
2066 #, no-wrap
2067 msgid ""
2068 "    /* Walk through linked list, maintaining head pointer so we\n"
2069 "       can free list later */\n"
2070 msgstr ""
2071 "    /* Walk through linked list, maintaining head pointer so we\n"
2072 "       can free list later */\n"
2073
2074 #. type: Plain text
2075 #: build/C/man3/getifaddrs.3:250
2076 #, no-wrap
2077 msgid ""
2078 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2079 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2080 "            continue;\n"
2081 msgstr ""
2082 "    for (ifa = ifaddr; ifa != NULL; ifa = ifa-E<gt>ifa_next) {\n"
2083 "        if (ifa-E<gt>ifa_addr == NULL)\n"
2084 "            continue;\n"
2085
2086 #. type: Plain text
2087 #: build/C/man3/getifaddrs.3:252
2088 #, no-wrap
2089 msgid "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2090 msgstr "        family = ifa-E<gt>ifa_addr-E<gt>sa_family;\n"
2091
2092 #. type: Plain text
2093 #: build/C/man3/getifaddrs.3:255
2094 #, no-wrap
2095 msgid ""
2096 "        /* Display interface name and family (including symbolic\n"
2097 "           form of the latter for the common families) */\n"
2098 msgstr ""
2099 "        /* Display interface name and family (including symbolic\n"
2100 "           form of the latter for the common families) */\n"
2101
2102 #. type: Plain text
2103 #: build/C/man3/getifaddrs.3:261
2104 #, no-wrap
2105 msgid ""
2106 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2107 "                ifa-E<gt>ifa_name, family,\n"
2108 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2109 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2110 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2111 msgstr ""
2112 "        printf(\"%s\\t  address family: %d%s\\en\",\n"
2113 "                ifa-E<gt>ifa_name, family,\n"
2114 "                (family == AF_PACKET) ? \" (AF_PACKET)\" :\n"
2115 "                (family == AF_INET) ?   \" (AF_INET)\" :\n"
2116 "                (family == AF_INET6) ?  \" (AF_INET6)\" : \"\");\n"
2117
2118 #. type: Plain text
2119 #: build/C/man3/getifaddrs.3:263
2120 #, no-wrap
2121 msgid "        /* For an AF_INET* interface address, display the address */\n"
2122 msgstr "        /* For an AF_INET* interface address, display the address */\n"
2123
2124 #. type: Plain text
2125 #: build/C/man3/getifaddrs.3:276
2126 #, no-wrap
2127 msgid ""
2128 "        if (family == AF_INET || family == AF_INET6) {\n"
2129 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2130 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2131 "                                          sizeof(struct sockaddr_in6),\n"
2132 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2133 "            if (s != 0) {\n"
2134 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2135 "                exit(EXIT_FAILURE);\n"
2136 "            }\n"
2137 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2138 "        }\n"
2139 "    }\n"
2140 msgstr ""
2141 "        if (family == AF_INET || family == AF_INET6) {\n"
2142 "            s = getnameinfo(ifa-E<gt>ifa_addr,\n"
2143 "                    (family == AF_INET) ? sizeof(struct sockaddr_in) :\n"
2144 "                                          sizeof(struct sockaddr_in6),\n"
2145 "                    host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);\n"
2146 "            if (s != 0) {\n"
2147 "                printf(\"getnameinfo() failed: %s\\en\", gai_strerror(s));\n"
2148 "                exit(EXIT_FAILURE);\n"
2149 "            }\n"
2150 "            printf(\"\\etaddress: E<lt>%sE<gt>\\en\", host);\n"
2151 "        }\n"
2152 "    }\n"
2153
2154 #. type: Plain text
2155 #: build/C/man3/getifaddrs.3:280
2156 #, no-wrap
2157 msgid ""
2158 "    freeifaddrs(ifaddr);\n"
2159 "    exit(EXIT_SUCCESS);\n"
2160 "}\n"
2161 msgstr ""
2162 "    freeifaddrs(ifaddr);\n"
2163 "    exit(EXIT_SUCCESS);\n"
2164 "}\n"
2165
2166 #. type: Plain text
2167 #: build/C/man3/getifaddrs.3:287
2168 msgid ""
2169 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2170 msgstr ""
2171 "B<bind>(2), B<getsockname>(2), B<socket>(2), B<packet>(7), B<ifconfig>(8)"
2172
2173 #. type: TH
2174 #: build/C/man2/getsockname.2:38
2175 #, no-wrap
2176 msgid "GETSOCKNAME"
2177 msgstr "GETSOCKNAME"
2178
2179 #. type: Plain text
2180 #: build/C/man2/getsockname.2:41
2181 msgid "getsockname - get socket name"
2182 msgstr "getsockname - ソケットの名前を取得する"
2183
2184 #. type: Plain text
2185 #: build/C/man2/getsockname.2:47
2186 #, no-wrap
2187 msgid "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2188 msgstr "B<int getsockname(int >I<sockfd>B<, struct sockaddr *>I<addr>B<, socklen_t *>I<addrlen>B<);>\n"
2189
2190 #. type: Plain text
2191 #: build/C/man2/getsockname.2:60
2192 msgid ""
2193 "B<getsockname>()  returns the current address to which the socket I<sockfd> "
2194 "is bound, in the buffer pointed to by I<addr>.  The I<addrlen> argument "
2195 "should be initialized to indicate the amount of space (in bytes) pointed to "
2196 "by I<addr>.  On return it contains the actual size of the socket address."
2197 msgstr ""
2198 "B<getsockname>()  は、ソケット I<sockfd> に結び付けられている現在のアドレス"
2199 "を、 I<addr> が指すバッファに格納して返す。 I<addrlen> 引き数は、 I<addr> が"
2200 "指している領域のサイズ (バイト単位) に初期化しておかなければならない。 関数が"
2201 "返る時には、 I<addrlen> にはソケットアドレスの実際のサイズ (バイト単位) が格"
2202 "納される。"
2203
2204 #. type: Plain text
2205 #: build/C/man2/getsockname.2:76 build/C/man2/getsockopt.2:140
2206 #: build/C/man2/listen.2:94
2207 msgid "The argument I<sockfd> is not a valid descriptor."
2208 msgstr "引き数 I<sockfd> は有効なディスクリプターでない。"
2209
2210 #. type: Plain text
2211 #: build/C/man2/getsockname.2:82
2212 msgid ""
2213 "The I<addr> argument points to memory not in a valid part of the process "
2214 "address space."
2215 msgstr ""
2216 "引き数 I<addr> の指しているメモリがプロセスのアドレス空間の有効な部分ではな"
2217 "い。"
2218
2219 #. type: Plain text
2220 #: build/C/man2/getsockname.2:86
2221 msgid "I<addrlen> is invalid (e.g., is negative)."
2222 msgstr "I<addrlen> が不正である (例えば、負で場合など)。"
2223
2224 #. type: TP
2225 #: build/C/man2/getsockname.2:86 build/C/man2/send.2:333
2226 #, no-wrap
2227 msgid "B<ENOBUFS>"
2228 msgstr "B<ENOBUFS>"
2229
2230 #. type: Plain text
2231 #: build/C/man2/getsockname.2:90
2232 msgid ""
2233 "Insufficient resources were available in the system to perform the operation."
2234 msgstr "処理をするだけの十分なリソースがシステムに無い。"
2235
2236 #. type: Plain text
2237 #: build/C/man2/getsockname.2:95 build/C/man2/getsockopt.2:169
2238 msgid "The argument I<sockfd> is a file, not a socket."
2239 msgstr "引き数 I<sockfd> がソケットではなくファイルである。"
2240
2241 #.  SVr4 documents additional ENOMEM
2242 #.  and ENOSR error codes.
2243 #. type: Plain text
2244 #: build/C/man2/getsockname.2:101
2245 msgid ""
2246 "SVr4, 4.4BSD (the B<getsockname>()  function call appeared in 4.2BSD), "
2247 "POSIX.1-2001."
2248 msgstr ""
2249 "SVr4, 4.4BSD (B<getsockname>()  関数は 4.2BSD で追加された), POSIX.1-2001."
2250
2251 #. type: Plain text
2252 #: build/C/man2/getsockname.2:110
2253 msgid ""
2254 "The third argument of B<getsockname>()  is in reality an I<int *> (and this "
2255 "is what 4.x BSD and libc4 and libc5 have).  Some POSIX confusion resulted in "
2256 "the present I<socklen_t>, also used by glibc.  See also B<accept>(2)."
2257 msgstr ""
2258 "B<getsockname>()  の三番目の引き数は (4.x BSD や libc4, libc5 と同様に) 実際"
2259 "には I<int *> である。 glibc でも使われている現在の I<socklen_t> に関して、 "
2260 "POSIX には少し混乱がある。 詳しくは B<accept>(2)  を参照のこと。"
2261
2262 #. type: Plain text
2263 #: build/C/man2/getsockname.2:117
2264 msgid ""
2265 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2266 "(7)"
2267 msgstr ""
2268 "B<bind>(2), B<socket>(2), B<getifaddrs>(3), B<ip>(7), B<socket>(7), B<unix>"
2269 "(7)"
2270
2271 #. type: TH
2272 #: build/C/man2/getsockopt.2:42
2273 #, no-wrap
2274 msgid "GETSOCKOPT"
2275 msgstr "GETSOCKOPT"
2276
2277 #. type: Plain text
2278 #: build/C/man2/getsockopt.2:45
2279 msgid "getsockopt, setsockopt - get and set options on sockets"
2280 msgstr "getsockopt, setsockopt - ソケットのオプションの設定と取得を行なう"
2281
2282 #. type: Plain text
2283 #: build/C/man2/getsockopt.2:55
2284 #, no-wrap
2285 msgid ""
2286 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2287 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2288 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2289 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2290 msgstr ""
2291 "B<int getsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2292 "B<               void *>I<optval>B<, socklen_t *>I<optlen>B<);>\n"
2293 "B<int setsockopt(int >I<sockfd>B<, int >I<level>B<, int >I<optname>B<,>\n"
2294 "B<               const void *>I<optval>B<, socklen_t >I<optlen>B<);>\n"
2295
2296 #. type: Plain text
2297 #: build/C/man2/getsockopt.2:65
2298 msgid ""
2299 "B<getsockopt>()  and B<setsockopt>()  manipulate options for the socket "
2300 "referred to by the file descriptor I<sockfd>.  Options may exist at multiple "
2301 "protocol levels; they are always present at the uppermost socket level."
2302 msgstr ""
2303 "B<getsockopt>()  と B<setsockopt>()  は、ファイルディスクリプタ I<socket> で"
2304 "参照されるソケットに関連するオプションの操作を行う。 オプションは複数のプロト"
2305 "コル層(level)に存在するかもしれないが、 これらは常に最上位のソケット層へと設"
2306 "定される。"
2307
2308 #. type: Plain text
2309 #: build/C/man2/getsockopt.2:84
2310 msgid ""
2311 "When manipulating socket options, the level at which the option resides and "
2312 "the name of the option must be specified.  To manipulate options at the "
2313 "sockets API level, I<level> is specified as B<SOL_SOCKET>.  To manipulate "
2314 "options at any other level the protocol number of the appropriate protocol "
2315 "controlling the option is supplied.  For example, to indicate that an option "
2316 "is to be interpreted by the B<TCP> protocol, I<level> should be set to the "
2317 "protocol number of B<TCP>; see B<getprotoent>(3)."
2318 msgstr ""
2319 "ソケット・オプションを操作する際には、オプションの層 (level) と オプションの"
2320 "名前を指定しなければならない。 ソケット API 層でオプションを操作する為には、 "
2321 "I<level> を B<SOL_SOCKET> に指定する。 他の全ての層でオプションを操作する為に"
2322 "は、与えられたオプションの 制御主体となるプロトコルのプロトコル番号を指定す"
2323 "る。例えば、 オプションが B<TCP> プロトコルで解釈されるべきことを指示するに"
2324 "は、 I<level> に B<TCP> のプロトコル番号を指定しなければならない。 "
2325 "B<getprotoent>(3)  を参照すること。"
2326
2327 #. type: Plain text
2328 #: build/C/man2/getsockopt.2:106
2329 msgid ""
2330 "The arguments I<optval> and I<optlen> are used to access option values for "
2331 "B<setsockopt>().  For B<getsockopt>()  they identify a buffer in which the "
2332 "value for the requested option(s) are to be returned.  For B<getsockopt>(), "
2333 "I<optlen> is a value-result argument, initially containing the size of the "
2334 "buffer pointed to by I<optval>, and modified on return to indicate the "
2335 "actual size of the value returned.  If no option value is to be supplied or "
2336 "returned, I<optval> may be NULL."
2337 msgstr ""
2338 "I<optval> と I<optlen> 引き数は B<setsockopt>()  のオプションの値にアクセスす"
2339 "るために用いられる。 B<getsockopt>()  では要求したオプションの値を返すための"
2340 "バッファーを指定する。 B<getsockopt>()  では I<optlen> は値と結果両用の引き数"
2341 "で、最初に I<optval> の指しているバッファーのサイズを与え、実際に返される値の"
2342 "サイズに 書き換えられる。もしオプション値を与えず、返されもしない場合には "
2343 "I<optval> は NULL でも良い。"
2344
2345 #. type: Plain text
2346 #: build/C/man2/getsockopt.2:116
2347 msgid ""
2348 "I<Optname> and any specified options are passed uninterpreted to the "
2349 "appropriate protocol module for interpretation.  The include file I<E<lt>sys/"
2350 "socket.hE<gt>> contains definitions for socket level options, described "
2351 "below.  Options at other protocol levels vary in format and name; consult "
2352 "the appropriate entries in section 4 of the manual."
2353 msgstr ""
2354 "I<optname> および指定されたオプションは解釈されずに、適切なプロトコル・モ"
2355 "ジュールに 渡されて解釈される。インクルード・ファイル I<E<lt>sys/socket."
2356 "hE<gt>> には後述のソケット層のオプションの定義が含まれている。 他のプロトコル"
2357 "層では名前や形式は異なる。 マニュアルのセクション 4 の適切なエントリを参照す"
2358 "ること。"
2359
2360 #. type: Plain text
2361 #: build/C/man2/getsockopt.2:125
2362 msgid ""
2363 "Most socket-level options utilize an I<int> argument for I<optval>.  For "
2364 "B<setsockopt>(), the argument should be nonzero to enable a boolean option, "
2365 "or zero if the option is to be disabled."
2366 msgstr ""
2367 "ほとんどのソケット層のオプションは I<optval> に I<int> 引き数を利用する。 "
2368 "B<setsockopt>()  で、二値(boolean)オプションを有効(enable)にするにはゼロ以外"
2369 "を指定し、 無効(disable)にするにはゼロを指定する。"
2370
2371 #. type: Plain text
2372 #: build/C/man2/getsockopt.2:129
2373 msgid ""
2374 "For a description of the available socket options see B<socket>(7)  and the "
2375 "appropriate protocol man pages."
2376 msgstr ""
2377 "利用可能なソケットオプションの説明に関しては、 B<socket>(7)  と適切なプロトコ"
2378 "ルの man ページを参照のこと。"
2379
2380 #. type: Plain text
2381 #: build/C/man2/getsockopt.2:150
2382 msgid ""
2383 "The address pointed to by I<optval> is not in a valid part of the process "
2384 "address space.  For B<getsockopt>(), this error may also be returned if "
2385 "I<optlen> is not in a valid part of the process address space."
2386 msgstr ""
2387 "I<optval> で指定されたアドレスがプロセスのアドレス空間の有効な部分ではない。 "
2388 "B<getsockopt>()  の場合、 I<optlen> がプロセスのアドレス空間の有効な部分でな"
2389 "い場合にもこのエラーが返される。"
2390
2391 #. type: Plain text
2392 #: build/C/man2/getsockopt.2:161
2393 msgid ""
2394 "I<optlen> invalid in B<setsockopt>().  In some cases this error can also "
2395 "occur for an invalid value in I<optval> (e.g., for the B<IP_ADD_MEMBERSHIP> "
2396 "option described in B<ip>(7))."
2397 msgstr ""
2398 "B<setsockopt>()  で I<option> が不正である。 I<optval> に無効な値が指定された"
2399 "場合にも、このエラーが発生する可能性がある (例えば、 B<ip>(7)  に説明がある "
2400 "B<IP_ADD_MEMBERSHIP> オプションなど)。"
2401
2402 #. type: TP
2403 #: build/C/man2/getsockopt.2:161
2404 #, no-wrap
2405 msgid "B<ENOPROTOOPT>"
2406 msgstr "B<ENOPROTOOPT>"
2407
2408 #. type: Plain text
2409 #: build/C/man2/getsockopt.2:164
2410 msgid "The option is unknown at the level indicated."
2411 msgstr "指定された層(level)にはこのオプションは存在しない。"
2412
2413 #.  SVr4 documents additional ENOMEM and ENOSR error codes, but does
2414 #.  not document the
2415 #.  .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
2416 #.  options
2417 #. type: Plain text
2418 #: build/C/man2/getsockopt.2:176
2419 msgid ""
2420 "SVr4, 4.4BSD (these system calls first appeared in 4.2BSD), POSIX.1-2001."
2421 msgstr ""
2422 "SVr4, 4.4BSD (これらのシステム・コールは 4.2BSD で最初に現れた), "
2423 "POSIX.1-2001."
2424
2425 #. type: Plain text
2426 #: build/C/man2/getsockopt.2:197
2427 msgid ""
2428 "The I<optlen> argument of B<getsockopt>()  and B<setsockopt>()  is in "
2429 "reality an I<int [*]> (and this is what 4.x BSD and libc4 and libc5 have).  "
2430 "Some POSIX confusion resulted in the present I<socklen_t>, also used by "
2431 "glibc.  See also B<accept>(2)."
2432 msgstr ""
2433 "B<getsockopt>()  と B<setsockopt>()  の I<optlen> 引き数は実際は I<int [*]> "
2434 "である (そして 4.x BSD と libc4 と libc5 はそうなっている)。 POSIX では紆余曲"
2435 "折を経て現在の I<socklen_t> になっており、 glibc でも I<socklen_t> を使ってい"
2436 "る。 B<accept>(2)  も参照のこと。"
2437
2438 #. type: Plain text
2439 #: build/C/man2/getsockopt.2:200
2440 msgid ""
2441 "Several of the socket options should be handled at lower levels of the "
2442 "system."
2443 msgstr ""
2444 "ソケットのオプションのいくつかはシステムのより低い層で 処理されるべきである。"
2445
2446 #. type: Plain text
2447 #: build/C/man2/getsockopt.2:208
2448 msgid ""
2449 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2450 "B<tcp>(7), B<unix>(7)"
2451 msgstr ""
2452 "B<ioctl>(2), B<socket>(2), B<getprotoent>(3), B<protocols>(5), B<socket>(7), "
2453 "B<tcp>(7), B<unix>(7)"
2454
2455 #. type: TH
2456 #: build/C/man2/listen.2:43
2457 #, no-wrap
2458 msgid "LISTEN"
2459 msgstr "LISTEN"
2460
2461 #. type: TH
2462 #: build/C/man2/listen.2:43
2463 #, no-wrap
2464 msgid "2008-11-20"
2465 msgstr "2008-11-20"
2466
2467 #. type: Plain text
2468 #: build/C/man2/listen.2:46
2469 msgid "listen - listen for connections on a socket"
2470 msgstr "listen - ソケット(socket)上の接続を待つ"
2471
2472 #. type: Plain text
2473 #: build/C/man2/listen.2:53
2474 #, no-wrap
2475 msgid "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2476 msgstr "B<int listen(int >I<sockfd>B<, int >I<backlog>B<);>\n"
2477
2478 #. type: Plain text
2479 #: build/C/man2/listen.2:61
2480 msgid ""
2481 "B<listen>()  marks the socket referred to by I<sockfd> as a passive socket, "
2482 "that is, as a socket that will be used to accept incoming connection "
2483 "requests using B<accept>(2)."
2484 msgstr ""
2485 "B<listen>()  は I<sockfd> が参照するソケットを接続待ちソケット (passive "
2486 "socket) として印をつける。 接続待ちソケットとは、 B<accept>(2)  を使って到着"
2487 "した接続要求を受け付けるのに使用されるソケットである。"
2488
2489 #. type: Plain text
2490 #: build/C/man2/listen.2:68
2491 msgid ""
2492 "The I<sockfd> argument is a file descriptor that refers to a socket of type "
2493 "B<SOCK_STREAM> or B<SOCK_SEQPACKET>."
2494 msgstr ""
2495 "I<sockfd> 引き数は、 B<SOCK_STREAM> 型か B<SOCK_SEQPACKET> 型のソケットを参照"
2496 "するファイルディスクリプタである。"
2497
2498 #. type: Plain text
2499 #: build/C/man2/listen.2:80
2500 msgid ""
2501 "The I<backlog> argument defines the maximum length to which the queue of "
2502 "pending connections for I<sockfd> may grow.  If a connection request arrives "
2503 "when the queue is full, the client may receive an error with an indication "
2504 "of B<ECONNREFUSED> or, if the underlying protocol supports retransmission, "
2505 "the request may be ignored so that a later reattempt at connection succeeds."
2506 msgstr ""
2507 "I<backlog> 引き数は、 I<sockfd> についての保留中の接続のキューの最大長を指定"
2508 "する。 キューがいっぱいの状態で接続要求が到着すると、クライアントは "
2509 "B<ECONNREFUSED> というエラーを受け取る。下位層のプロトコルが再送信をサポート "
2510 "していれば、要求は無視され、これ以降の接続要求の再送信が成功するかもしれな"
2511 "い。"
2512
2513 #. type: Plain text
2514 #: build/C/man2/listen.2:89
2515 msgid "Another socket is already listening on the same port."
2516 msgstr "別のソケットが既に同じポートを listen している。"
2517
2518 #. type: Plain text
2519 #: build/C/man2/listen.2:99 build/C/man2/send.2:352
2520 msgid "The argument I<sockfd> is not a socket."
2521 msgstr "引き数 I<sockfd> はソケットではない。"
2522
2523 #. type: Plain text
2524 #: build/C/man2/listen.2:104
2525 msgid "The socket is not of a type that supports the B<listen>()  operation."
2526 msgstr "ソケットは B<listen>()  がサポートしている型ではない。"
2527
2528 #. type: Plain text
2529 #: build/C/man2/listen.2:109
2530 msgid ""
2531 "4.4BSD, POSIX.1-2001.  The B<listen>()  function call first appeared in "
2532 "4.2BSD."
2533 msgstr "4.4BSD, POSIX.1-2001.  B<listen>()  関数は 4.2BSDで初めて実装された。"
2534
2535 #. type: Plain text
2536 #: build/C/man2/listen.2:111
2537 msgid "To accept connections, the following steps are performed:"
2538 msgstr "接続を受け付けるには、以下の処理が実行される。"
2539
2540 #. type: TP
2541 #: build/C/man2/listen.2:112 build/C/man2/select_tut.2:345
2542 #, no-wrap
2543 msgid "1."
2544 msgstr "1."
2545
2546 #. type: Plain text
2547 #: build/C/man2/listen.2:115
2548 msgid "A socket is created with B<socket>(2)."
2549 msgstr "B<socket>(2)  でソケットを作成する。"
2550
2551 #. type: TP
2552 #: build/C/man2/listen.2:115 build/C/man2/select_tut.2:354
2553 #, no-wrap
2554 msgid "2."
2555 msgstr "2."
2556
2557 #. type: Plain text
2558 #: build/C/man2/listen.2:121
2559 msgid ""
2560 "The socket is bound to a local address using B<bind>(2), so that other "
2561 "sockets may be B<connect>(2)ed to it."
2562 msgstr ""
2563 "B<bind>(2)  を使ってソケットにローカルアドレスを割り当てて、 他のソケットがこ"
2564 "のソケットに B<connect>(2)  できるようにする。"
2565
2566 #. type: TP
2567 #: build/C/man2/listen.2:121 build/C/man2/select_tut.2:358
2568 #, no-wrap
2569 msgid "3."
2570 msgstr "3."
2571
2572 #. type: Plain text
2573 #: build/C/man2/listen.2:125
2574 msgid ""
2575 "A willingness to accept incoming connections and a queue limit for incoming "
2576 "connections are specified with B<listen>()."
2577 msgstr ""
2578 "B<listen>()  を使って、接続要求を受け付ける意志と接続要求を入れるキュー長を指"
2579 "定する。"
2580
2581 #. type: TP
2582 #: build/C/man2/listen.2:125 build/C/man2/select_tut.2:365
2583 #, no-wrap
2584 msgid "4."
2585 msgstr "4."
2586
2587 #. type: Plain text
2588 #: build/C/man2/listen.2:128
2589 msgid "Connections are accepted with B<accept>(2)."
2590 msgstr "B<accept>(2)  を使って接続を受け付ける。"
2591
2592 #. type: Plain text
2593 #: build/C/man2/listen.2:151
2594 msgid ""
2595 "The behavior of the I<backlog> argument on TCP sockets changed with Linux "
2596 "2.2.  Now it specifies the queue length for I<completely> established "
2597 "sockets waiting to be accepted, instead of the number of incomplete "
2598 "connection requests.  The maximum length of the queue for incomplete sockets "
2599 "can be set using I</proc/sys/net/ipv4/tcp_max_syn_backlog>.  When syncookies "
2600 "are enabled there is no logical maximum length and this setting is ignored.  "
2601 "See B<tcp>(7)  for more information."
2602 msgstr ""
2603 "TCP ソケットでの I<backlog> 引き数の振る舞いは Linux 2.2 で変更された。 現在"
2604 "ではこの引き数は、 受け付けられるのを待っている、 I<完全に> 確立されたソケッ"
2605 "トのキューの長さを指定する。 以前は不完全な接続要求の数であったが、これを置き"
2606 "換えた。 不完全なソケットのキューの最大長は I</proc/sys/net/ipv4/"
2607 "tcp_max_syn_backlog> を用いて設定できる。 syncookie が有効になっている場合、 "
2608 "論理的な最大長は存在せず、この設定は無視される。"
2609
2610 #.  The following is now rather historic information (MTK, Jun 05)
2611 #.  Don't rely on this value in portable applications since BSD
2612 #.  (and some BSD-derived systems) limit the backlog to 5.
2613 #. type: Plain text
2614 #: build/C/man2/listen.2:164
2615 msgid ""
2616 "If the I<backlog> argument is greater than the value in I</proc/sys/net/core/"
2617 "somaxconn>, then it is silently truncated to that value; the default value "
2618 "in this file is 128.  In kernels before 2.4.25, this limit was a hard coded "
2619 "value, B<SOMAXCONN>, with the value 128."
2620 msgstr ""
2621 "I<backlog> 引き数が I</proc/sys/net/core/somaxconn> の値よりも大きければ、 "
2622 "I<backlog> の値は暗黙のうちにこの値に切り詰められる。 このファイルのデフォル"
2623 "ト値は 128 である。 バージョン 2.4.5 以前のカーネルでは、この上限値は コード"
2624 "埋め込みの固定値 B<SOMAXCONN> であり、その値は 128 であった。"
2625
2626 #. type: Plain text
2627 #: build/C/man2/listen.2:173
2628 msgid "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2629 msgstr "B<accept>(2), B<bind>(2), B<connect>(2), B<socket>(2), B<socket>(7)"
2630
2631 #. type: TH
2632 #: build/C/man2/recv.2:39
2633 #, no-wrap
2634 msgid "RECV"
2635 msgstr "RECV"
2636
2637 #. type: TH
2638 #: build/C/man2/recv.2:39
2639 #, no-wrap
2640 msgid "2011-09-16"
2641 msgstr "2011-09-16"
2642
2643 #. type: Plain text
2644 #: build/C/man2/recv.2:42
2645 msgid "recv, recvfrom, recvmsg - receive a message from a socket"
2646 msgstr "recv, recvfrom, recvmsg - ソケットからメッセージを受け取る"
2647
2648 #. type: Plain text
2649 #: build/C/man2/recv.2:47 build/C/man2/select.2:53
2650 #: build/C/man2/select_tut.2:45
2651 #, no-wrap
2652 msgid "B<#include E<lt>sys/types.hE<gt>>\n"
2653 msgstr "B<#include E<lt>sys/types.hE<gt>>\n"
2654
2655 #. type: Plain text
2656 #: build/C/man2/recv.2:51
2657 #, no-wrap
2658 msgid "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2659 msgstr "B<ssize_t recv(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
2660
2661 #. type: Plain text
2662 #: build/C/man2/recv.2:54
2663 #, no-wrap
2664 msgid ""
2665 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2666 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2667 msgstr ""
2668 "B<ssize_t recvfrom(int >I<sockfd>B<, void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
2669 "B<                 struct sockaddr *>I<src_addr>B<, socklen_t *>I<addrlen>B<);>\n"
2670
2671 #. type: Plain text
2672 #: build/C/man2/recv.2:56
2673 #, no-wrap
2674 msgid "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2675 msgstr "B<ssize_t recvmsg(int >I<sockfd>B<, struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
2676
2677 #. type: Plain text
2678 #: build/C/man2/recv.2:64
2679 msgid ""
2680 "The B<recvfrom>()  and B<recvmsg>()  calls are used to receive messages from "
2681 "a socket, and may be used to receive data on a socket whether or not it is "
2682 "connection-oriented."
2683 msgstr ""
2684 "B<recvfrom>()  と B<recvmsg>()  コールは、ソケットからメッセージを受け取るの"
2685 "に使用する。 またソケットのデータ受信にも使うことができ、 このときソケットは"
2686 "接続指向 (connection-oriened) であってもなくてもよい。"
2687
2688 #.  (Note: for datagram sockets in both the UNIX and Internet domains,
2689 #.  .I src_addr
2690 #.  is filled in.
2691 #.  .I src_addr
2692 #.  is also filled in for stream sockets in the UNIX domain, but is not
2693 #.  filled in for stream sockets in the Internet domain.)
2694 #.  [The above notes on AF_UNIX and AF_INET sockets apply as at
2695 #.  Kernel 2.4.18. (MTK, 22 Jul 02)]
2696 #. type: Plain text
2697 #: build/C/man2/recv.2:93
2698 msgid ""
2699 "If I<src_addr> is not NULL, and the underlying protocol provides the source "
2700 "address, this source address is filled in.  When I<src_addr> is NULL, "
2701 "nothing is filled in; in this case, I<addrlen> is not used, and should also "
2702 "be NULL.  The argument I<addrlen> is a value-result argument, which the "
2703 "caller should initialize before the call to the size of the buffer "
2704 "associated with I<src_addr>, and modified on return to indicate the actual "
2705 "size of the source address.  The returned address is truncated if the buffer "
2706 "provided is too small; in this case, I<addrlen> will return a value greater "
2707 "than was supplied to the call."
2708 msgstr ""
2709 "I<src_addr> が NULL 以外で、下層のプロトコルから送信元アドレスが分かる場合、 "
2710 "I<src_addr> にはこの送信元アドレスが入れられる。 I<src_addr> が NULL の場"
2711 "合、 I<src_addr> には何も入らない。この場合、 I<addrlen> は使用されず、この引"
2712 "き数は NULL にしておくべきである。 引き数 I<addrlen> は入出力両用の引き数であ"
2713 "る。呼び出し時には、呼び出し元が I<src_addr> に割り当てたバッファの大きさで初"
2714 "期化しておくべきである。 返ってくる時には、送信元アドレスの実際の大きさに変更"
2715 "される。 渡されたバッファが小さ過ぎる場合には、返されるアドレスの末尾は 切り"
2716 "詰められる。この場合には、 I<addrlen> では、呼び出し時に渡された値よりも大き"
2717 "な値が返される。"
2718
2719 #. type: Plain text
2720 #: build/C/man2/recv.2:105
2721 msgid ""
2722 "The B<recv>()  call is normally used only on a I<connected> socket (see "
2723 "B<connect>(2))  and is identical to B<recvfrom>()  with a NULL I<src_addr> "
2724 "argument."
2725 msgstr ""
2726 "B<recv>()  コールは通常 I<接続済みの (connected)> ソケット (B<connect>(2)  を"
2727 "参照) についてのみ使用され、 I<src_addr> 引き数に NULL を指定した B<recvfrom>"
2728 "()  と等価である。"
2729
2730 #. type: Plain text
2731 #: build/C/man2/recv.2:111
2732 msgid ""
2733 "All three routines return the length of the message on successful "
2734 "completion.  If a message is too long to fit in the supplied buffer, excess "
2735 "bytes may be discarded depending on the type of socket the message is "
2736 "received from."
2737 msgstr ""
2738 "これらの三つのルーチンはいずれも、成功した場合にはメッセージの長さを返す。 "
2739 "メッセージが長過ぎて指定されたバッファに入り切らなかった場合には、 メッセージ"
2740 "を受信したソケットの種類によっては余分のバイトが捨てられる かもしれない。"
2741
2742 #. type: Plain text
2743 #: build/C/man2/recv.2:121
2744 msgid ""
2745 "If no messages are available at the socket, the receive calls wait for a "
2746 "message to arrive, unless the socket is nonblocking (see B<fcntl>(2)), in "
2747 "which case the value -1 is returned and the external variable I<errno> is "
2748 "set to B<EAGAIN> or B<EWOULDBLOCK>.  The receive calls normally return any "
2749 "data available, up to the requested amount, rather than waiting for receipt "
2750 "of the full amount requested."
2751 msgstr ""
2752 "ソケットに受け取るメッセージが存在しなかった場合、 受信用のコールはメッセージ"
2753 "が到着するまで待つ。 ただし、ソケットが非停止 (nonblocking)  に設定されていた"
2754 "場合 (B<fcntl>(2)  を参照) は -1 を返し、外部変数 I<errno> に B<EAGAIN> か "
2755 "B<EWOULDBLOCK> を設定する。 これらの受信用のコールは、受信したデータのサイズ"
2756 "が要求したサイズに 達するまで待つのではなく、何らかのデータを受信すると復帰す"
2757 "る (受信されるデータの最大サイズは要求したサイズである)。"
2758
2759 #. type: Plain text
2760 #: build/C/man2/recv.2:127
2761 msgid ""
2762 "The B<select>(2)  or B<poll>(2)  call may be used to determine when more "
2763 "data arrives."
2764 msgstr ""
2765 "B<select>(2)  や B<poll>(2)  コールを使って、次のデータがいつ届くかを判断でき"
2766 "る。"
2767
2768 #. type: Plain text
2769 #: build/C/man2/recv.2:133
2770 msgid ""
2771 "The I<flags> argument to a B<recv>()  call is formed by ORing one or more of "
2772 "the following values:"
2773 msgstr ""
2774 "B<recv>()  コールの I<flags> 引き数には、以下の値を 1つ以上、ビット単位の論理"
2775 "和 を取ったものを指定する:"
2776
2777 #. type: TP
2778 #: build/C/man2/recv.2:133
2779 #, no-wrap
2780 msgid "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() only; since Linux 2.6.23)"
2781 msgstr "B<MSG_CMSG_CLOEXEC> (B<recvmsg>() のみ; Linux 2.6.23)"
2782
2783 #. type: Plain text
2784 #: build/C/man2/recv.2:144
2785 msgid ""
2786 "Set the close-on-exec flag for the file descriptor received via a UNIX "
2787 "domain file descriptor using the B<SCM_RIGHTS> operation (described in "
2788 "B<unix>(7)).  This flag is useful for the same reasons as the B<O_CLOEXEC> "
2789 "flag of B<open>(2)."
2790 msgstr ""
2791 "(B<unix>(7)  で説明されている)  B<SCM_RIGHTS> 操作を使って UNIX ドメインの"
2792 "ファイルディスクリプタ経由で受信した ファイルディスクリプタについて close-on-"
2793 "exec フラグをセットする。 このフラグは、 B<open>(2)  の B<O_CLOEXEC> フラグと"
2794 "同じ理由で有用である。"
2795
2796 #. type: TP
2797 #: build/C/man2/recv.2:144 build/C/man2/send.2:186
2798 #, no-wrap
2799 msgid "B<MSG_DONTWAIT> (since Linux 2.2)"
2800 msgstr "B<MSG_DONTWAIT> (Linux 2.2 以降)"
2801
2802 #. type: Plain text
2803 #: build/C/man2/recv.2:154
2804 msgid ""
2805 "Enables nonblocking operation; if the operation would block, the call fails "
2806 "with the error B<EAGAIN> or B<EWOULDBLOCK> (this can also be enabled using "
2807 "the B<O_NONBLOCK> flag with the B<F_SETFL> B<fcntl>(2))."
2808 msgstr ""
2809 "非停止 (nonblocking) 操作を有効にする。 操作が停止するような場合にエラー "
2810 "B<EAGAIN> か B<EWOULDBLOCK> で呼び出しが失敗する (B<fcntl>(2)  の B<F_SETFL> "
2811 "で B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
2812
2813 #. type: TP
2814 #: build/C/man2/recv.2:154
2815 #, no-wrap
2816 msgid "B<MSG_ERRQUEUE> (since Linux 2.2)"
2817 msgstr "B<MSG_ERRQUEUE> (Linux 2.2 以降)"
2818
2819 #. type: Plain text
2820 #: build/C/man2/recv.2:173
2821 msgid ""
2822 "This flag specifies that queued errors should be received from the socket "
2823 "error queue.  The error is passed in an ancillary message with a type "
2824 "dependent on the protocol (for IPv4 B<IP_RECVERR>).  The user should supply "
2825 "a buffer of sufficient size.  See B<cmsg>(3)  and B<ip>(7)  for more "
2826 "information.  The payload of the original packet that caused the error is "
2827 "passed as normal data via I<msg_iovec>.  The original destination address of "
2828 "the datagram that caused the error is supplied via I<msg_name>."
2829 msgstr ""
2830 "このフラグを指定すると、 キューに入れられたエラーをソケットのエラーキューから"
2831 "取りだせるようになる。 このエラーは補助メッセージに組み込まれて渡され、 この"
2832 "補助メッセージの種別はプロトコルに依存する (IPv4 の場合は B<IP_RECVERR>)。 "
2833 "ユーザは十分なサイズのバッファを用意しなければならない。 補助メッセージに関す"
2834 "るより詳細な情報は B<cmsg>(3)  および B<ip>(7)  を参照のこと。 エラーの原因と"
2835 "なったオリジナルパケットのペイロードは、 I<msg_iovec> 経由で通常のデータとし"
2836 "て渡される。 エラーを起こしたデータグラムのオリジナルの宛先アドレスは、 "
2837 "I<msg_name> 経由で参照できる。"
2838
2839 #. type: Plain text
2840 #: build/C/man2/recv.2:185 build/C/man2/recv.2:248
2841 msgid ""
2842 "For local errors, no address is passed (this can be checked with the "
2843 "I<cmsg_len> member of the I<cmsghdr>).  For error receives, the "
2844 "B<MSG_ERRQUEUE> is set in the I<msghdr>.  After an error has been passed, "
2845 "the pending socket error is regenerated based on the next queued error and "
2846 "will be passed on the next socket operation."
2847 msgstr ""
2848 "ローカルなエラーの場合はアドレスは渡されない\n"
2849 "(これは I<cmsghdr> の I<cmsg_len> メンバーでチェックできる)。\n"
2850 "受信エラーの場合は B<MSG_ERRQUIE> が I<msghdr> にセットされる。\n"
2851 "エラーが渡された後には、キューに入っている次のエラーに基いて、\n"
2852 "処理待ちのソケット・エラーが再生成され、次のソケット操作の際に渡される。"
2853
2854 #. type: Plain text
2855 #: build/C/man2/recv.2:189
2856 msgid "The error is supplied in a I<sock_extended_err> structure:"
2857 msgstr "このエラーは I<sock_extended_err> 構造体で提供される:"
2858
2859 #. type: Plain text
2860 #: build/C/man2/recv.2:196
2861 #, no-wrap
2862 msgid ""
2863 "#define SO_EE_ORIGIN_NONE    0\n"
2864 "#define SO_EE_ORIGIN_LOCAL   1\n"
2865 "#define SO_EE_ORIGIN_ICMP    2\n"
2866 "#define SO_EE_ORIGIN_ICMP6   3\n"
2867 msgstr ""
2868 "#define SO_EE_ORIGIN_NONE    0\n"
2869 "#define SO_EE_ORIGIN_LOCAL   1\n"
2870 "#define SO_EE_ORIGIN_ICMP    2\n"
2871 "#define SO_EE_ORIGIN_ICMP6   3\n"
2872
2873 #. type: Plain text
2874 #: build/C/man2/recv.2:208
2875 #, no-wrap
2876 msgid ""
2877 "struct sock_extended_err\n"
2878 "{\n"
2879 "    uint32_t ee_errno;   /* error number */\n"
2880 "    uint8_t  ee_origin;  /* where the error originated */\n"
2881 "    uint8_t  ee_type;    /* type */\n"
2882 "    uint8_t  ee_code;    /* code */\n"
2883 "    uint8_t  ee_pad;     /* padding */\n"
2884 "    uint32_t ee_info;    /* additional information */\n"
2885 "    uint32_t ee_data;    /* other data */\n"
2886 "    /* More data may follow */\n"
2887 "};\n"
2888 msgstr ""
2889 "struct sock_extended_err\n"
2890 "{\n"
2891 "    uint32_t ee_errno;   /* error number */\n"
2892 "    uint8_t  ee_origin;  /* where the error originated */\n"
2893 "    uint8_t  ee_type;    /* type */\n"
2894 "    uint8_t  ee_code;    /* code */\n"
2895 "    uint8_t  ee_pad;     /* padding */\n"
2896 "    uint32_t ee_info;    /* additional information */\n"
2897 "    uint32_t ee_data;    /* other data */\n"
2898 "    /* More data may follow */\n"
2899 "};\n"
2900
2901 #. type: Plain text
2902 #: build/C/man2/recv.2:210
2903 #, no-wrap
2904 msgid "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2905 msgstr "struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);\n"
2906
2907 #. type: Plain text
2908 #: build/C/man2/recv.2:234
2909 msgid ""
2910 "I<ee_errno> contains the I<errno> number of the queued error.  I<ee_origin> "
2911 "is the origin code of where the error originated.  The other fields are "
2912 "protocol-specific.  The macro B<SOCK_EE_OFFENDER> returns a pointer to the "
2913 "address of the network object where the error originated from given a "
2914 "pointer to the ancillary message.  If this address is not known, the "
2915 "I<sa_family> member of the I<sockaddr> contains B<AF_UNSPEC> and the other "
2916 "fields of the I<sockaddr> are undefined.  The payload of the packet that "
2917 "caused the error is passed as normal data."
2918 msgstr ""
2919 "I<ee_errno> にはキューに入れられたエラーの I<errno> が入っている。 "
2920 "I<ee_origin> にはエラーが発生した場所のオリジン・コード (origin code) が入っ"
2921 "ている。 他のフィールドはプロトコル依存である。 B<SO_EE_OFFENDER> マクロは、"
2922 "この補助的なメッセージを引き数に取って、 エラーの発生したネットワークオブジェ"
2923 "クトのアドレスへのポインタを返す。 アドレスが不明の場合には、 I<sockaddr> の "
2924 "I<sa_family> メンバーが B<AF_UNSPEC> になっている。 I<sockaddr> の他のフィー"
2925 "ルドは不定である。 エラーの発生したパケットのペイロードは通常のデータとして渡"
2926 "される。"
2927
2928 #. type: TP
2929 #: build/C/man2/recv.2:248 build/C/man2/recv.2:379 build/C/man2/send.2:228
2930 #, no-wrap
2931 msgid "B<MSG_OOB>"
2932 msgstr "B<MSG_OOB>"
2933
2934 #. type: Plain text
2935 #: build/C/man2/recv.2:255
2936 msgid ""
2937 "This flag requests receipt of out-of-band data that would not be received in "
2938 "the normal data stream.  Some protocols place expedited data at the head of "
2939 "the normal data queue, and thus this flag cannot be used with such protocols."
2940 msgstr ""
2941 "このフラグは、通常のデータ・ストリームでは受信できない 帯域外 (out-of-band) "
2942 "データの受信を要求する。 プロトコルによっては、 通常のデータ・キューの先頭に"
2943 "速達データを置くものがあるが、 そのようなプロトコルではこのフラグは使用できな"
2944 "い。"
2945
2946 #. type: TP
2947 #: build/C/man2/recv.2:255
2948 #, no-wrap
2949 msgid "B<MSG_PEEK>"
2950 msgstr "B<MSG_PEEK>"
2951
2952 #. type: Plain text
2953 #: build/C/man2/recv.2:262
2954 msgid ""
2955 "This flag causes the receive operation to return data from the beginning of "
2956 "the receive queue without removing that data from the queue.  Thus, a "
2957 "subsequent receive call will return the same data."
2958 msgstr ""
2959 "このフラグを指定すると、 受信キューの最初のデータを返すとき、キューからデータ"
2960 "を削除しない。 したがって、この後でもう一度受信コールを呼び出すと、同じデータ"
2961 "が返ることになる。"
2962
2963 #. type: TP
2964 #: build/C/man2/recv.2:262
2965 #, no-wrap
2966 msgid "B<MSG_TRUNC> (since Linux 2.2)"
2967 msgstr "B<MSG_TRUNC> (Linux 2.2 以降)"
2968
2969 #. type: Plain text
2970 #: build/C/man2/recv.2:273
2971 msgid ""
2972 "For raw (B<AF_PACKET>), Internet datagram (since Linux 2.4.27/2.6.8), and "
2973 "netlink (since Linux 2.6.22) sockets: return the real length of the packet "
2974 "or datagram, even when it was longer than the passed buffer.  Not "
2975 "implemented for UNIX domain (B<unix>(7))  sockets."
2976 msgstr ""
2977 "raw ソケット (B<AF_PACKET>)、 Internet datagram ソケット (Linux 2.4.27/2.6.8 "
2978 "以降)、 netlink (Linux 2.6.22 以降) ソケットの場合、 パケットやデータグラムの"
2979 "長さが渡したバッファよりも長かった場合にも、 パケットやデータグラムの実際の長"
2980 "さを返す。 UNIX ドメインソケット (B<unix>(7))  ソケットについては実装されてい"
2981 "ない。"
2982
2983 #. type: Plain text
2984 #: build/C/man2/recv.2:276
2985 msgid "For use with Internet stream sockets, see B<tcp>(7)."
2986 msgstr "Internet ストリームソケットでの利用については B<tcp>(7)  を参照。"
2987
2988 #. type: TP
2989 #: build/C/man2/recv.2:276
2990 #, no-wrap
2991 msgid "B<MSG_WAITALL> (since Linux 2.2)"
2992 msgstr "B<MSG_WAITALL> (Linux 2.2 以降)"
2993
2994 #. type: Plain text
2995 #: build/C/man2/recv.2:283
2996 msgid ""
2997 "This flag requests that the operation block until the full request is "
2998 "satisfied.  However, the call may still return less data than requested if a "
2999 "signal is caught, an error or disconnect occurs, or the next data to be "
3000 "received is of a different type than that returned."
3001 msgstr ""
3002 "このフラグは、要求した量いっぱいのデータが到着するまで、 操作を停止 (block) "
3003 "するよう要求する。 但し、シグナルを受信したり、エラーや切断 (disconnect) が発"
3004 "生したり、 次に受信されるデータが異なる型だったりした場合には、 要求した量よ"
3005 "りデータが少なくても返ることがある。"
3006
3007 #. type: Plain text
3008 #: build/C/man2/recv.2:291
3009 msgid ""
3010 "The B<recvmsg>()  call uses a I<msghdr> structure to minimize the number of "
3011 "directly supplied arguments.  This structure is defined as follows in "
3012 "I<E<lt>sys/socket.hE<gt>>:"
3013 msgstr ""
3014 "B<recvmsg>()  コールは、直接渡す引き数の数を減らすために I<msghdr> 構造体を使"
3015 "用する。この構造体は I<E<lt>sys/socket.hE<gt>> で以下のように定義されている:"
3016
3017 #. type: Plain text
3018 #: build/C/man2/recv.2:298
3019 #, no-wrap
3020 msgid ""
3021 "struct iovec {                    /* Scatter/gather array items */\n"
3022 "    void  *iov_base;              /* Starting address */\n"
3023 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3024 "};\n"
3025 msgstr ""
3026 "struct iovec {                    /* Scatter/gather array items */\n"
3027 "    void  *iov_base;              /* Starting address */\n"
3028 "    size_t iov_len;               /* Number of bytes to transfer */\n"
3029 "};\n"
3030
3031 #. type: Plain text
3032 #: build/C/man2/recv.2:308 build/C/man2/send.2:256
3033 #, no-wrap
3034 msgid ""
3035 "struct msghdr {\n"
3036 "    void         *msg_name;       /* optional address */\n"
3037 "    socklen_t     msg_namelen;    /* size of address */\n"
3038 "    struct iovec *msg_iov;        /* scatter/gather array */\n"
3039 "    size_t        msg_iovlen;     /* # elements in msg_iov */\n"
3040 "    void         *msg_control;    /* ancillary data, see below */\n"
3041 "    size_t        msg_controllen; /* ancillary data buffer len */\n"
3042 "    int           msg_flags;      /* flags on received message */\n"
3043 "};\n"
3044 msgstr ""
3045 "struct msghdr {\n"
3046 "    void         *msg_name;       /* 追加のアドレス */\n"
3047 "    socklen_t     msg_namelen;    /* アドレスのサイズ */\n"
3048 "    struct iovec *msg_iov;        /* scatter/gather 配列 */\n"
3049 "    size_t        msg_iovlen;     /* msg_iov の要素数 */\n"
3050 "    void         *msg_control;    /* 補助データ (後述) */\n"
3051 "    size_t        msg_controllen; /* 補助データバッファ長 */\n"
3052 "    int           msg_flags;      /* 受信メッセージのフラグ */\n"
3053 "};\n"
3054
3055 #. type: Plain text
3056 #: build/C/man2/recv.2:338
3057 msgid ""
3058 "Here I<msg_name> and I<msg_namelen> specify the source address if the socket "
3059 "is unconnected; I<msg_name> may be given as a NULL pointer if no names are "
3060 "desired or required.  The fields I<msg_iov> and I<msg_iovlen> describe "
3061 "scatter-gather locations, as discussed in B<readv>(2).  The field "
3062 "I<msg_control>, which has length I<msg_controllen>, points to a buffer for "
3063 "other protocol control-related messages or miscellaneous ancillary data.  "
3064 "When B<recvmsg>()  is called, I<msg_controllen> should contain the length of "
3065 "the available buffer in I<msg_control>; upon return from a successful call "
3066 "it will contain the length of the control message sequence."
3067 msgstr ""
3068 "I<msg_name> と I<msg_namelen> は、ソケットが接続されていない場合に送信元のア"
3069 "ドレスを指定する。 名前が必要ない場合には I<msg_name> に NULL ポインタを指定"
3070 "する。 I<msg_iov> と I<msg_iovlen> フィールドは B<readv>(2)  に記述されている"
3071 "ような分解/結合用のベクトル (scatter-gather locations)  を指定する。 "
3072 "I<msg_control> フィールドは I<msg_controllen> の長さを持ち、他のプロトコル制"
3073 "御メッセージや 種々の補助データのためのバッファへのポインタである。 "
3074 "B<recvmsg>()  を呼ぶ際には、 I<msg_controllen> に I<msg_control> のバッファの"
3075 "長さを入れておく必要がある。 コールが成功して返った場合、制御メッセージ列の長"
3076 "さが入っている。"
3077
3078 #. type: Plain text
3079 #: build/C/man2/recv.2:340
3080 msgid "The messages are of the form:"
3081 msgstr "メッセージの形式は以下の通り:"
3082
3083 #. type: Plain text
3084 #: build/C/man2/recv.2:350
3085 #, no-wrap
3086 msgid ""
3087 "struct cmsghdr {\n"
3088 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3089 "    int           cmsg_level;   /* originating protocol */\n"
3090 "    int           cmsg_type;    /* protocol-specific type */\n"
3091 "/* followed by\n"
3092 "    unsigned char cmsg_data[]; */\n"
3093 "};\n"
3094 msgstr ""
3095 "struct cmsghdr {\n"
3096 "    socklen_t     cmsg_len;     /* data byte count, including hdr */\n"
3097 "    int           cmsg_level;   /* originating protocol */\n"
3098 "    int           cmsg_type;    /* protocol-specific type */\n"
3099 "/* followed by\n"
3100 "    unsigned char cmsg_data[]; */\n"
3101 "};\n"
3102
3103 #. type: Plain text
3104 #: build/C/man2/recv.2:355
3105 msgid ""
3106 "Ancillary data should only be accessed by the macros defined in B<cmsg>(3)."
3107 msgstr ""
3108 "補助データは、 B<cmsg>(3)  に定義されたマクロ経由でのみアクセスすべきである。"
3109
3110 #. type: Plain text
3111 #: build/C/man2/recv.2:358
3112 msgid ""
3113 "As an example, Linux uses this ancillary data mechanism to pass extended "
3114 "errors, IP options, or file descriptors over UNIX domain sockets."
3115 msgstr ""
3116 "例をあげると、 Linux はこの補助データのメカニズムを、 UNIX ドメインソケット上"
3117 "での拡張エラーや IP オプション、 ファイル・ディスクリプタの受け渡しに利用して"
3118 "いる。"
3119
3120 #. type: Plain text
3121 #: build/C/man2/recv.2:366
3122 msgid ""
3123 "The I<msg_flags> field in the I<msghdr> is set on return of B<recvmsg>().  "
3124 "It can contain several flags:"
3125 msgstr ""
3126 "I<msghdr> の I<msg_flags> フィールドは B<recvmsg>()  からのリターン時に設定さ"
3127 "れる。ここにはいくつかのフラグが入る。"
3128
3129 #. type: TP
3130 #: build/C/man2/recv.2:366
3131 #, no-wrap
3132 msgid "B<MSG_EOR>"
3133 msgstr "B<MSG_EOR>"
3134
3135 #. type: Plain text
3136 #: build/C/man2/recv.2:371
3137 msgid ""
3138 "indicates end-of-record; the data returned completed a record (generally "
3139 "used with sockets of type B<SOCK_SEQPACKET>)."
3140 msgstr ""
3141 "これはレコードの終り (end-of-record) を示し、 返されたデータが完全なレコード"
3142 "であることを示す (一般的には B<SOCK_SEQPACKET> 型のソケットで使用される)。"
3143
3144 #. type: TP
3145 #: build/C/man2/recv.2:371
3146 #, no-wrap
3147 msgid "B<MSG_TRUNC>"
3148 msgstr "B<MSG_TRUNC>"
3149
3150 #. type: Plain text
3151 #: build/C/man2/recv.2:375
3152 msgid ""
3153 "indicates that the trailing portion of a datagram was discarded because the "
3154 "datagram was larger than the buffer supplied."
3155 msgstr ""
3156 "データグラムが与えられたバッファより大きかったために、 データグラムのはみ出し"
3157 "た部分が捨てられたことを示す。"
3158
3159 #. type: TP
3160 #: build/C/man2/recv.2:375
3161 #, no-wrap
3162 msgid "B<MSG_CTRUNC>"
3163 msgstr "B<MSG_CTRUNC>"
3164
3165 #. type: Plain text
3166 #: build/C/man2/recv.2:379
3167 msgid ""
3168 "indicates that some control data were discarded due to lack of space in the "
3169 "buffer for ancillary data."
3170 msgstr ""
3171 "補助データのためのバッファが不足したために、 制御データの一部が捨てられたこと"
3172 "を示す。"
3173
3174 #. type: Plain text
3175 #: build/C/man2/recv.2:382
3176 msgid ""
3177 "is returned to indicate that expedited or out-of-band data were received."
3178 msgstr "速達データや帯域外データを受信したことを示す。"
3179
3180 #. type: TP
3181 #: build/C/man2/recv.2:382
3182 #, no-wrap
3183 msgid "B<MSG_ERRQUEUE>"
3184 msgstr "B<MSG_ERRQUEUE>"
3185
3186 #. type: Plain text
3187 #: build/C/man2/recv.2:386
3188 msgid ""
3189 "indicates that no data was received but an extended error from the socket "
3190 "error queue."
3191 msgstr ""
3192 "データは受信しなかったが ソケットのエラー・キューから拡張エラーを受信したこと"
3193 "を示す。"
3194
3195 #. type: Plain text
3196 #: build/C/man2/recv.2:391
3197 msgid ""
3198 "These calls return the number of bytes received, or -1 if an error "
3199 "occurred.  The return value will be 0 when the peer has performed an orderly "
3200 "shutdown."
3201 msgstr ""
3202 "これらのコールは受信したバイト数を返す。 エラーの場合は -1 を返す。 接続先が"
3203 "正しくシャットダウンを実行した場合は、返り値は 0 となる。"
3204
3205 #. type: Plain text
3206 #: build/C/man2/recv.2:396
3207 msgid ""
3208 "These are some standard errors generated by the socket layer.  Additional "
3209 "errors may be generated and returned from the underlying protocol modules; "
3210 "see their manual pages."
3211 msgstr ""
3212 "これらはソケット層で発生する一般的なエラーである。 他のエラーが下層のプロトコ"
3213 "ル・モジュールで生成され、 返されるかもしれない。 それらのマニュアルを参照す"
3214 "ること。"
3215
3216 #.  Actually EAGAIN on Linux
3217 #. type: Plain text
3218 #: build/C/man2/recv.2:405
3219 msgid ""
3220 "The socket is marked nonblocking and the receive operation would block, or a "
3221 "receive timeout had been set and the timeout expired before data was "
3222 "received.  POSIX.1-2001 allows either error to be returned for this case, "
3223 "and does not require these constants to have the same value, so a portable "
3224 "application should check for both possibilities."
3225 msgstr ""
3226 "ソケットが非停止 (nonblocking) に設定されていて 受信操作が停止するような状況"
3227 "になったか、 受信に時間切れ (timeout) が設定されていて データを受信する前に時"
3228 "間切れになった。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めて"
3229 "おり、 これら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性"
3230 "が必要なアプリケーションでは、両方の可能性を 確認すべきである。"
3231
3232 #. type: Plain text
3233 #: build/C/man2/recv.2:410
3234 msgid "The argument I<sockfd> is an invalid descriptor."
3235 msgstr "引き数 I<sockfd> が不正なディスクリプタである。"
3236
3237 #. type: Plain text
3238 #: build/C/man2/recv.2:414
3239 msgid ""
3240 "A remote host refused to allow the network connection (typically because it "
3241 "is not running the requested service)."
3242 msgstr ""
3243 "リモートのホストでネットワーク接続が拒否された (よくある理由としては、要求し"
3244 "たサービスが起動されていないなどがある)。"
3245
3246 #. type: Plain text
3247 #: build/C/man2/recv.2:418
3248 msgid ""
3249 "The receive buffer pointer(s) point outside the process's address space."
3250 msgstr "受信バッファへのポインタがプロセスのアドレス空間外を指している。"
3251
3252 #. type: Plain text
3253 #: build/C/man2/recv.2:423
3254 msgid ""
3255 "The receive was interrupted by delivery of a signal before any data were "
3256 "available; see B<signal>(7)."
3257 msgstr ""
3258 "データを受信する前に、シグナルが配送されて割り込まれた。 B<signal>(7)  参照。"
3259
3260 #. type: Plain text
3261 #: build/C/man2/recv.2:427 build/C/man2/send.2:321
3262 msgid "Invalid argument passed."
3263 msgstr "不正な引き数が渡された。"
3264
3265 #. type: Plain text
3266 #: build/C/man2/recv.2:431
3267 msgid "Could not allocate memory for B<recvmsg>()."
3268 msgstr "B<recvmsg>()  のためのメモリが確保できなかった。"
3269
3270 #. type: TP
3271 #: build/C/man2/recv.2:431 build/C/man2/send.2:344
3272 #, no-wrap
3273 msgid "B<ENOTCONN>"
3274 msgstr "B<ENOTCONN>"
3275
3276 #. type: Plain text
3277 #: build/C/man2/recv.2:438
3278 msgid ""
3279 "The socket is associated with a connection-oriented protocol and has not "
3280 "been connected (see B<connect>(2)  and B<accept>(2))."
3281 msgstr ""
3282 "ソケットに接続指向プロトコルが割り当てられており、 まだ接続されていない "
3283 "(B<connect>(2)  と B<accept>(2)  を参照のこと)。"
3284
3285 #. type: Plain text
3286 #: build/C/man2/recv.2:443
3287 msgid "The argument I<sockfd> does not refer to a socket."
3288 msgstr "引き数 I<sockfd> がソケットを参照していない。"
3289
3290 #. type: Plain text
3291 #: build/C/man2/recv.2:446
3292 msgid "4.4BSD (these function calls first appeared in 4.2BSD), POSIX.1-2001."
3293 msgstr "4.4BSD (これらの関数は 4.2BSD で現われた), POSIX.1-2001。"
3294
3295 #. type: Plain text
3296 #: build/C/man2/recv.2:453
3297 msgid ""
3298 "POSIX.1-2001 only describes the B<MSG_OOB>, B<MSG_PEEK>, and B<MSG_WAITALL> "
3299 "flags."
3300 msgstr ""
3301 "POSIX.1-2001 では、 B<MSG_OOB>, B<MSG_PEEK>, B<MSG_WAITALL> フラグだけが記載"
3302 "されている。"
3303
3304 #. type: Plain text
3305 #: build/C/man2/recv.2:469
3306 msgid ""
3307 "The prototypes given above follow glibc2.  The Single UNIX Specification "
3308 "agrees, except that it has return values of type I<ssize_t> (while 4.x BSD "
3309 "and libc4 and libc5 all have I<int>).  The I<flags> argument is I<int> in 4."
3310 "x BSD, but I<unsigned int> in libc4 and libc5.  The I<len> argument is "
3311 "I<int> in 4.x BSD, but I<size_t> in libc4 and libc5.  The I<addrlen> "
3312 "argument is I<int\\ *> in 4.x BSD, libc4 and libc5.  The present I<socklen_t"
3313 "\\ *> was invented by POSIX.  See also B<accept>(2)."
3314 msgstr ""
3315 "上記のプロトタイプは glibc2 にしたがっている。 Single UNIX Specification でも"
3316 "同様だが、 返り値の型が I<ssize_t> となっている (一方で 4.x BSD や libc4 や "
3317 "libc5 は全て I<int> を使用している)。 I<flags> 引き数は 4.x BSD では I<int> "
3318 "だが、libc4 と libc5 では I<unsigned int> である。 I<len> 引き数は 4.x BSD で"
3319 "は I<int> だが、 libc4 と libc5 では I<size_t> である。 I<addrlen> 引き数は "
3320 "4.x BSD, libc4, libc5 では I<int\\ *> である。 現在の I<socklen_t\\ *> は "
3321 "POSIX で発案された。 B<accept>(2)  も参照すること。"
3322
3323 #.  glibc bug raised 12 Mar 2006
3324 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=2448
3325 #.  The problem is an underlying kernel issue: the size of the
3326 #.  __kernel_size_t type used to type this field varies
3327 #.  across architectures, but socklen_t is always 32 bits.
3328 #. type: Plain text
3329 #: build/C/man2/recv.2:483 build/C/man2/send.2:407
3330 msgid ""
3331 "According to POSIX.1-2001, the I<msg_controllen> field of the I<msghdr> "
3332 "structure should be typed as I<socklen_t>, but glibc currently types it as "
3333 "I<size_t>."
3334 msgstr ""
3335 "POSIX.1-2001 では、構造体 I<msghdr> のフィールド I<msg_controllen> は "
3336 "I<socklen_t> 型であるべきだとされているが、 現在の glibc では I<size_t> 型で"
3337 "ある。"
3338
3339 #. type: Plain text
3340 #: build/C/man2/recv.2:488
3341 msgid ""
3342 "See B<recvmmsg(2)> for information about a Linux-specific system call that "
3343 "can be used to receive multiple datagrams in a single call."
3344 msgstr ""
3345 "B<recvmmsg>(2)  には、一度の呼び出しでの複数のデータグラムに使用できる Linux "
3346 "固有の システムコールに関する情報が書かれている。"
3347
3348 #. type: Plain text
3349 #: build/C/man2/recv.2:493
3350 msgid "An example of the use of B<recvfrom>()  is shown in B<getaddrinfo>(3)."
3351 msgstr "B<recvfrom>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
3352
3353 #. type: Plain text
3354 #: build/C/man2/recv.2:504
3355 msgid ""
3356 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3357 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3358 msgstr ""
3359 "B<fcntl>(2), B<getsockopt>(2), B<read>(2), B<recvmmsg>(2), B<select>(2), "
3360 "B<shutdown>(2), B<socket>(2), B<cmsg>(3), B<sockatmark>(3), B<socket>(7)"
3361
3362 #. type: TH
3363 #: build/C/man2/recvmmsg.2:26
3364 #, no-wrap
3365 msgid "RECVMMSG"
3366 msgstr "RECVMMSG"
3367
3368 #. type: TH
3369 #: build/C/man2/recvmmsg.2:26
3370 #, no-wrap
3371 msgid "2011-10-04"
3372 msgstr "2011-10-04"
3373
3374 #. type: Plain text
3375 #: build/C/man2/recvmmsg.2:29
3376 msgid "recvmmsg - receive multiple messages on a socket"
3377 msgstr ""
3378
3379 #. type: Plain text
3380 #: build/C/man2/recvmmsg.2:33 build/C/man2/sendmmsg.2:35
3381 #, no-wrap
3382 msgid ""
3383 "B<#define _GNU_SOURCE>\n"
3384 "B<#include E<lt>sys/socket.hE<gt>>\n"
3385 msgstr ""
3386 "B<#define _GNU_SOURCE>\n"
3387 "B<#include E<lt>sys/socket.hE<gt>>\n"
3388
3389 #. type: Plain text
3390 #: build/C/man2/recvmmsg.2:36
3391 #, no-wrap
3392 msgid "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3393 msgstr "B<int recvmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
3394
3395 #. type: Plain text
3396 #: build/C/man2/recvmmsg.2:38
3397 #, no-wrap
3398 msgid "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3399 msgstr "B<             unsigned int >I<flags>B<, struct timespec *>I<timeout>B<);>\n"
3400
3401 #. type: Plain text
3402 #: build/C/man2/recvmmsg.2:50
3403 msgid ""
3404 "The B<recvmmsg>()  system call is an extension of B<recvmsg>(2)  that allows "
3405 "the caller to receive multiple messages from a socket using a single system "
3406 "call.  (This has performance benefits for some applications.)  A further "
3407 "extension over B<recvmsg>(2)  is support for a timeout on the receive "
3408 "operation."
3409 msgstr ""
3410
3411 #. type: Plain text
3412 #: build/C/man2/recvmmsg.2:54
3413 msgid ""
3414 "The I<sockfd> argument is the file descriptor of the socket to receive data "
3415 "from."
3416 msgstr ""
3417
3418 #. type: Plain text
3419 #: build/C/man2/recvmmsg.2:62 build/C/man2/sendmmsg.2:62
3420 msgid ""
3421 "The I<msgvec> argument is a pointer to an array of I<mmsghdr> structures.  "
3422 "The size of this array is specified in I<vlen>."
3423 msgstr ""
3424
3425 #. type: Plain text
3426 #: build/C/man2/recvmmsg.2:68 build/C/man2/sendmmsg.2:68
3427 msgid "The I<mmsghdr> structure is defined in I<E<lt>sys/socket.hE<gt>> as:"
3428 msgstr ""
3429
3430 #. type: Plain text
3431 #: build/C/man2/recvmmsg.2:75
3432 #, no-wrap
3433 msgid ""
3434 "struct mmsghdr {\n"
3435 "    struct msghdr msg_hdr;  /* Message header */\n"
3436 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3437 "};\n"
3438 msgstr ""
3439 "struct mmsghdr {\n"
3440 "    struct msghdr msg_hdr;  /* Message header */\n"
3441 "    unsigned int  msg_len;  /* Number of received bytes for header */\n"
3442 "};\n"
3443
3444 #. type: Plain text
3445 #: build/C/man2/recvmmsg.2:90
3446 msgid ""
3447 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<recvmsg>"
3448 "(2).  The I<msg_len> field is the number of bytes returned for the message "
3449 "in the entry.  This field has the same value as the return value of a single "
3450 "B<recvmsg>(2)  on the header."
3451 msgstr ""
3452
3453 #. type: Plain text
3454 #: build/C/man2/recvmmsg.2:97
3455 msgid ""
3456 "The I<flags> argument contains flags ORed together.  The flags are the same "
3457 "as documented for B<recvmsg>(2), with the following addition:"
3458 msgstr ""
3459
3460 #. type: TP
3461 #: build/C/man2/recvmmsg.2:97
3462 #, no-wrap
3463 msgid "B<MSG_WAITFORONE>"
3464 msgstr "B<MSG_WAITFORONE>"
3465
3466 #. type: Plain text
3467 #: build/C/man2/recvmmsg.2:102
3468 msgid "Turns on B<MSG_DONTWAIT> after the first message has been received."
3469 msgstr ""
3470
3471 #. type: Plain text
3472 #: build/C/man2/recvmmsg.2:115
3473 msgid ""
3474 "The I<timeout> argument points to a I<struct timespec> (see B<clock_gettime>"
3475 "(2))  defining a timeout (seconds plus nanoseconds) for the receive "
3476 "operation.  If I<timeout> is I<NULL> then the operation blocks indefinitely."
3477 msgstr ""
3478
3479 #. type: Plain text
3480 #: build/C/man2/recvmmsg.2:126
3481 msgid ""
3482 "A blocking B<recvmmsg>()  call blocks until I<vlen> messages have been "
3483 "received or until the timeout expires.  A nonblocking call reads as many "
3484 "messages as are available (up to the limit specified by I<vlen>)  and "
3485 "returns immediately."
3486 msgstr ""
3487
3488 #. type: Plain text
3489 #: build/C/man2/recvmmsg.2:141
3490 msgid ""
3491 "On return from B<recvmmsg>(), successive elements of I<msgvec> are updated "
3492 "to contain information about each received message: I<msg_len> contains the "
3493 "size of the received message; the subfields of I<msg_hdr> are updated as "
3494 "described in B<recvmsg>(2).  The return value of the call indicates the "
3495 "number of elements of I<msgvec> that have been updated."
3496 msgstr ""
3497
3498 #. type: Plain text
3499 #: build/C/man2/recvmmsg.2:149
3500 msgid ""
3501 "On success, B<recvmmsg>()  returns the number of messages received in "
3502 "I<msgvec>; on error, -1 is returned, and I<errno> is set to indicate the "
3503 "error."
3504 msgstr ""
3505
3506 #. type: Plain text
3507 #: build/C/man2/recvmmsg.2:153
3508 msgid ""
3509 "Errors are as for B<recvmsg>(2).  In addition, the following error can occur:"
3510 msgstr ""
3511
3512 #. type: Plain text
3513 #: build/C/man2/recvmmsg.2:157
3514 msgid "I<timeout> is invalid."
3515 msgstr ""
3516
3517 #. type: Plain text
3518 #: build/C/man2/recvmmsg.2:162
3519 msgid ""
3520 "The B<recvmmsg>()  system call was added in Linux 2.6.32.  Support in glibc "
3521 "was added in version 2.12."
3522 msgstr ""
3523
3524 #. type: Plain text
3525 #: build/C/man2/recvmmsg.2:165
3526 msgid "B<recvmmsg>()  is Linux-specific."
3527 msgstr ""
3528
3529 #. type: Plain text
3530 #: build/C/man2/recvmmsg.2:172
3531 msgid ""
3532 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3533 "(2), B<socket>(7)"
3534 msgstr ""
3535 "B<clock_gettime>(2), B<recvmsg>(2), B<sendmmsg>(2), B<sendmsg>(2), B<socket>"
3536 "(2), B<socket>(7)"
3537
3538 #. type: TH
3539 #: build/C/man2/select.2:38
3540 #, no-wrap
3541 msgid "SELECT"
3542 msgstr "SELECT"
3543
3544 #. type: TH
3545 #: build/C/man2/select.2:38
3546 #, no-wrap
3547 msgid "2010-08-31"
3548 msgstr "2010-08-31"
3549
3550 #. type: Plain text
3551 #: build/C/man2/select.2:42 build/C/man2/select_tut.2:34
3552 msgid ""
3553 "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - synchronous I/O "
3554 "multiplexing"
3555 msgstr "select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO - 同期 I/O の多重化"
3556
3557 #. type: Plain text
3558 #: build/C/man2/select.2:45 build/C/man2/select_tut.2:37
3559 #, no-wrap
3560 msgid "/* According to POSIX.1-2001 */\n"
3561 msgstr "/* POSIX.1-2001 に従う場合 */\n"
3562
3563 #. type: Plain text
3564 #: build/C/man2/select.2:47 build/C/man2/select.2:68
3565 #: build/C/man2/select_tut.2:39 build/C/man2/select_tut.2:60
3566 #, no-wrap
3567 msgid "B<#include E<lt>sys/select.hE<gt>>\n"
3568 msgstr "B<#include E<lt>sys/select.hE<gt>>\n"
3569
3570 #. type: Plain text
3571 #: build/C/man2/select.2:49 build/C/man2/select_tut.2:41
3572 #, no-wrap
3573 msgid "/* According to earlier standards */\n"
3574 msgstr "/* 以前の規格に従う場合 */\n"
3575
3576 #. type: Plain text
3577 #: build/C/man2/select.2:51 build/C/man2/select_tut.2:43
3578 #, no-wrap
3579 msgid "B<#include E<lt>sys/time.hE<gt>>\n"
3580 msgstr "B<#include E<lt>sys/time.hE<gt>>\n"
3581
3582 #. type: Plain text
3583 #: build/C/man2/select.2:55 build/C/man2/select_tut.2:47
3584 #, no-wrap
3585 msgid "B<#include E<lt>unistd.hE<gt>>\n"
3586 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
3587
3588 #. type: Plain text
3589 #: build/C/man2/select.2:58
3590 #, no-wrap
3591 msgid ""
3592 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3593 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3594 msgstr ""
3595 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3596 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<timeout>B<);>\n"
3597
3598 #. type: Plain text
3599 #: build/C/man2/select.2:60 build/C/man2/select_tut.2:52
3600 #, no-wrap
3601 msgid "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3602 msgstr "B<void FD_CLR(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3603
3604 #. type: Plain text
3605 #: build/C/man2/select.2:62 build/C/man2/select_tut.2:54
3606 #, no-wrap
3607 msgid "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3608 msgstr "B<int  FD_ISSET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3609
3610 #. type: Plain text
3611 #: build/C/man2/select.2:64 build/C/man2/select_tut.2:56
3612 #, no-wrap
3613 msgid "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3614 msgstr "B<void FD_SET(int >I<fd>B<, fd_set *>I<set>B<);>\n"
3615
3616 #. type: Plain text
3617 #: build/C/man2/select.2:66 build/C/man2/select_tut.2:58
3618 #, no-wrap
3619 msgid "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3620 msgstr "B<void FD_ZERO(fd_set *>I<set>B<);>\n"
3621
3622 #. type: Plain text
3623 #: build/C/man2/select.2:72
3624 #, no-wrap
3625 msgid ""
3626 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3627 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3628 "B<            const sigset_t *>I<sigmask>B<);>\n"
3629 msgstr ""
3630 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
3631 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<timeout>B<,>\n"
3632 "B<            const sigset_t *>I<sigmask>B<);>\n"
3633
3634 #. type: Plain text
3635 #: build/C/man2/select.2:77 build/C/man2/select_tut.2:69
3636 #: build/C/man3/sockatmark.3:34
3637 msgid ""
3638 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
3639 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
3640
3641 #. type: Plain text
3642 #: build/C/man2/select.2:81 build/C/man2/select_tut.2:73
3643 msgid ""
3644 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3645 "600"
3646 msgstr ""
3647 "B<pselect>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ "
3648 "600"
3649
3650 #. type: Plain text
3651 #: build/C/man2/select.2:92
3652 msgid ""
3653 "B<select>()  and B<pselect>()  allow a program to monitor multiple file "
3654 "descriptors, waiting until one or more of the file descriptors become \"ready"
3655 "\" for some class of I/O operation (e.g., input possible).  A file "
3656 "descriptor is considered ready if it is possible to perform the "
3657 "corresponding I/O operation (e.g., B<read>(2))  without blocking."
3658 msgstr ""
3659 "B<select>()  や B<pselect>()  を使うと、プログラムで複数のファイルディスクリ"
3660 "プタを監視し、 一つ以上のファイルディスクリプタがある種の I/O 操作の 「ready "
3661 "(準備ができた)」状態 (例えば、読み込み可能になった状態)  になるまで待つことが"
3662 "できる。 ファイルディスクリプタが ready (準備ができた) とは、 対応する I/O 操"
3663 "作 (例えば B<read>(2)  など) が停止 (block) なしに実行可能な状態にあることを"
3664 "意味する。"
3665
3666 #. type: Plain text
3667 #: build/C/man2/select.2:98
3668 msgid ""
3669 "The operation of B<select>()  and B<pselect>()  is identical, with three "
3670 "differences:"
3671 msgstr ""
3672 "B<select>()  と B<pselect>()  の動作は同じであるが、以下の 3 点が異なる:"
3673
3674 #. type: TP
3675 #: build/C/man2/select.2:98
3676 #, no-wrap
3677 msgid "(i)"
3678 msgstr "(i)"
3679
3680 #. type: Plain text
3681 #: build/C/man2/select.2:108
3682 msgid ""
3683 "B<select>()  uses a timeout that is a I<struct timeval> (with seconds and "
3684 "microseconds), while B<pselect>()  uses a I<struct timespec> (with seconds "
3685 "and nanoseconds)."
3686 msgstr ""
3687 "B<select>()  では、タイムアウト時間の指定に構造体 I<struct timeval> (秒・マイ"
3688 "クロ秒単位) を用いる。 一方、 B<pselect>()  関数では、構造体 I<struct "
3689 "timespec> (秒・ナノ秒単位) を用いる。"
3690
3691 #. type: TP
3692 #: build/C/man2/select.2:108
3693 #, no-wrap
3694 msgid "(ii)"
3695 msgstr "(ii)"
3696
3697 #. type: Plain text
3698 #: build/C/man2/select.2:116
3699 msgid ""
3700 "B<select>()  may update the I<timeout> argument to indicate how much time "
3701 "was left.  B<pselect>()  does not change this argument."
3702 msgstr ""
3703 "B<select>()  は残り時間を示す I<timeout> 引き数を更新することがある。 "
3704 "B<pselect>()  はこの引き数を変更しない。"
3705
3706 #. type: TP
3707 #: build/C/man2/select.2:116
3708 #, no-wrap
3709 msgid "(iii)"
3710 msgstr "(iii)"
3711
3712 #. type: Plain text
3713 #: build/C/man2/select.2:125
3714 msgid ""
3715 "B<select>()  has no I<sigmask> argument, and behaves as B<pselect>()  called "
3716 "with NULL I<sigmask>."
3717 msgstr ""
3718 "B<select>()  は I<sigmask> 引き数を持たない。その動作は I<sigmask> に NULL を"
3719 "指定した場合の B<pselect>()  と同じである。"
3720
3721 #. type: Plain text
3722 #: build/C/man2/select.2:143
3723 msgid ""
3724 "Three independent sets of file descriptors are watched.  Those listed in "
3725 "I<readfds> will be watched to see if characters become available for reading "
3726 "(more precisely, to see if a read will not block; in particular, a file "
3727 "descriptor is also ready on end-of-file), those in I<writefds> will be "
3728 "watched to see if a write will not block, and those in I<exceptfds> will be "
3729 "watched for exceptions.  On exit, the sets are modified in place to indicate "
3730 "which file descriptors actually changed status.  Each of the three file "
3731 "descriptor sets may be specified as NULL if no file descriptors are to be "
3732 "watched for the corresponding class of events."
3733 msgstr ""
3734 "3 つの独立したファイルディスクリプタ集合の監視を行う。 I<readfds> に入れられ"
3735 "たディスクリプタについては、読み込みが可能かどうかを 監視する (より正確にいう"
3736 "と、停止 (block) なしで読むことができるかを 調べる。ファイルの終端 (end-of-"
3737 "file) の場合も、 ファイルディスクリプタは読み込み可能として扱われる)。 "
3738 "I<writefds> に入れられたディスクリプタについては、停止せずに書き込みが 可能か"
3739 "どうかを監視する。 I<exceptfds> にあるものについては、例外の監視を行なう。シ"
3740 "ステムコール終了時に、 どのファイルディスクリプタの状態が実際に変化したか示す"
3741 "ために、 集合の内容が変更される。 ある種別のイベントを監視したいファイルディ"
3742 "スクリプタが一つもない場合には、 対応するファイルディスクリプタ集合に NULL を"
3743 "指定することができる。"
3744
3745 #. type: Plain text
3746 #: build/C/man2/select.2:156
3747 msgid ""
3748 "Four macros are provided to manipulate the sets.  B<FD_ZERO>()  clears a "
3749 "set.  B<FD_SET>()  and B<FD_CLR>()  respectively add and remove a given file "
3750 "descriptor from a set.  B<FD_ISSET>()  tests to see if a file descriptor is "
3751 "part of the set; this is useful after B<select>()  returns."
3752 msgstr ""
3753 "集合を操作するために 4 つのマクロが提供されている。 B<FD_ZERO>()  は集合を消"
3754 "去する。 B<FD_SET>()  と B<FD_CLR>()  はそれぞれ指定したファイルディスクリプ"
3755 "タの集合への追加、削除を行う。 B<FD_ISSET>()  は集合にファイルディスクリプタ"
3756 "があるかどうか調べる; このマクロは B<select>()  が終了した後に使うと便利であ"
3757 "る。"
3758
3759 #. type: Plain text
3760 #: build/C/man2/select.2:159
3761 msgid ""
3762 "I<nfds> is the highest-numbered file descriptor in any of the three sets, "
3763 "plus 1."
3764 msgstr ""
3765 "I<nfds> は 3 つの集合に含まれるファイルディスクリプタの最大値に 1 を足したも"
3766 "のである。"
3767
3768 #. type: Plain text
3769 #: build/C/man2/select.2:175
3770 msgid ""
3771 "I<timeout> is an upper bound on the amount of time elapsed before B<select>"
3772 "()  returns.  If both fields of the I<timeval> structure are zero, then "
3773 "B<select>()  returns immediately.  (This is useful for polling.)  If "
3774 "I<timeout> is NULL (no timeout), B<select>()  can block indefinitely."
3775 msgstr ""
3776 "I<timeout> は B<select>()  が復帰するまでの経過時間の上限である。 I<timeval> "
3777 "構造体の両方のフィールドが 0 の場合、 B<select>()  はすぐに復帰する (この機能"
3778 "はポーリング (polling) を行うのに便利である)。 I<timeout> に NULL (タイムアウ"
3779 "トなし)  が指定されると、 B<select>()  は無期限に停止 (block) する。"
3780
3781 #. type: Plain text
3782 #: build/C/man2/select.2:185
3783 msgid ""
3784 "I<sigmask> is a pointer to a signal mask (see B<sigprocmask>(2)); if it is "
3785 "not NULL, then B<pselect>()  first replaces the current signal mask by the "
3786 "one pointed to by I<sigmask>, then does the \"select\" function, and then "
3787 "restores the original signal mask."
3788 msgstr ""
3789 "I<sigmask> は、シグナルマスク (B<sigprocmask>(2)  を参照) へのポインタであ"
3790 "る。 I<sigmask> が NULL でない場合、 B<pselect>()  は I<sigmask> が指している"
3791 "シグナルマスクで現在のシグナルマスクを置き換えてから、 \"select\" 関数を実行"
3792 "し、 終了後にシグナルマスクを元のシグナルマスクに戻す。"
3793
3794 #. type: Plain text
3795 #: build/C/man2/select.2:191
3796 msgid ""
3797 "Other than the difference in the precision of the I<timeout> argument, the "
3798 "following B<pselect>()  call:"
3799 msgstr ""
3800 "I<timeout> 引き数の精度の違いを除くと、以下の B<pselect>()  の呼び出しは、"
3801
3802 #. type: Plain text
3803 #: build/C/man2/select.2:195
3804 #, no-wrap
3805 msgid ""
3806 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3807 "                    timeout, &sigmask);\n"
3808 msgstr ""
3809 "    ready = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
3810 "                    timeout, &sigmask);\n"
3811
3812 #. type: Plain text
3813 #: build/C/man2/select.2:200
3814 msgid "is equivalent to I<atomically> executing the following calls:"
3815 msgstr "次のコールを I<atomic> に実行するのと等価である。"
3816
3817 #. type: Plain text
3818 #: build/C/man2/select.2:203
3819 #, no-wrap
3820 msgid "    sigset_t origmask;\n"
3821 msgstr "    sigset_t origmask;\n"
3822
3823 #. type: Plain text
3824 #: build/C/man2/select.2:207
3825 #, no-wrap
3826 msgid ""
3827 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3828 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3829 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3830 msgstr ""
3831 "    sigprocmask(SIG_SETMASK, &sigmask, &origmask);\n"
3832 "    ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);\n"
3833 "    sigprocmask(SIG_SETMASK, &origmask, NULL);\n"
3834
3835 #. type: Plain text
3836 #: build/C/man2/select.2:228
3837 msgid ""
3838 "The reason that B<pselect>()  is needed is that if one wants to wait for "
3839 "either a signal or for a file descriptor to become ready, then an atomic "
3840 "test is needed to prevent race conditions.  (Suppose the signal handler sets "
3841 "a global flag and returns.  Then a test of this global flag followed by a "
3842 "call of B<select>()  could hang indefinitely if the signal arrived just "
3843 "after the test but just before the call.  By contrast, B<pselect>()  allows "
3844 "one to first block signals, handle the signals that have come in, then call "
3845 "B<pselect>()  with the desired I<sigmask>, avoiding the race.)"
3846 msgstr ""
3847 "B<pselect>()  が必要になる理由は、シグナルやファイルディスクリプタの状態変化"
3848 "を 待ちたいときには、競合状態を避けるために atomic なテストが必要になる から"
3849 "である。 (シグナルハンドラが大域フラグを設定して戻る場合を考えてみよう。 この"
3850 "大域フラグのテストに続けて B<select>()  を呼び出すと、 シグナルがテストの直後"
3851 "かつ呼び出しの直前に届いた時には B<select>()  は永久にハングしてしまうかもし"
3852 "れない。 一方、 B<pselect>()  を使うと、まずシグナルを禁止 (block) して、入っ"
3853 "てくるシグナルを操作し、 望みの I<sigmask> で B<pselect>()  を呼び出すこと"
3854 "で、前記の競合を避けることができる。)"
3855
3856 #. type: SS
3857 #: build/C/man2/select.2:228
3858 #, no-wrap
3859 msgid "The timeout"
3860 msgstr "タイムアウト"
3861
3862 #. type: Plain text
3863 #: build/C/man2/select.2:232
3864 msgid ""
3865 "The time structures involved are defined in I<E<lt>sys/time.hE<gt>> and look "
3866 "like"
3867 msgstr ""
3868 "これらの関数で使用される時間関連の構造体は、 I<E<lt>sys/time.hE<gt>> で"
3869
3870 #. type: Plain text
3871 #: build/C/man2/select.2:239
3872 #, no-wrap
3873 msgid ""
3874 "struct timeval {\n"
3875 "    long    tv_sec;         /* seconds */\n"
3876 "    long    tv_usec;        /* microseconds */\n"
3877 "};\n"
3878 msgstr ""
3879 "struct timeval {\n"
3880 "    long    tv_sec;         /* 秒 */\n"
3881 "    long    tv_usec;        /* マイクロ秒 */\n"
3882 "};\n"
3883
3884 #. type: Plain text
3885 #: build/C/man2/select.2:243
3886 msgid "and"
3887 msgstr "や"
3888
3889 #. type: Plain text
3890 #: build/C/man2/select.2:250
3891 #, no-wrap
3892 msgid ""
3893 "struct timespec {\n"
3894 "    long    tv_sec;         /* seconds */\n"
3895 "    long    tv_nsec;        /* nanoseconds */\n"
3896 "};\n"
3897 msgstr ""
3898 "struct timespec {\n"
3899 "    long    tv_sec;         /* 秒 */\n"
3900 "    long    tv_nsec;        /* ナノ秒 */\n"
3901 "};\n"
3902
3903 #. type: Plain text
3904 #: build/C/man2/select.2:254
3905 msgid "(However, see below on the POSIX.1-2001 versions.)"
3906 msgstr ""
3907 "のように定義されている。 (POSIX.1-2001 での定義については下記の「注意」を参"
3908 "照)"
3909
3910 #. type: Plain text
3911 #: build/C/man2/select.2:262
3912 msgid ""
3913 "Some code calls B<select>()  with all three sets empty, I<nfds> zero, and a "
3914 "non-NULL I<timeout> as a fairly portable way to sleep with subsecond "
3915 "precision."
3916 msgstr ""
3917 "秒単位以下の精度でスリープを実現する 移植性の高い方法として、 3 つの集合全て"
3918 "を空、 I<nfds> を 0 、 I<timeout> を NULL でない値に設定して B<select>()  を"
3919 "呼び出すという方法を使っているコードもある。"
3920
3921 #.  .PP - it is rumored that:
3922 #.  On BSD, when a timeout occurs, the file descriptor bits are not changed.
3923 #.  - it is certainly true that:
3924 #.  Linux follows SUSv2 and sets the bit masks to zero upon a timeout.
3925 #. type: Plain text
3926 #: build/C/man2/select.2:285
3927 msgid ""
3928 "On Linux, B<select>()  modifies I<timeout> to reflect the amount of time not "
3929 "slept; most other implementations do not do this.  (POSIX.1-2001 permits "
3930 "either behavior.)  This causes problems both when Linux code which reads "
3931 "I<timeout> is ported to other operating systems, and when code is ported to "
3932 "Linux that reuses a I<struct timeval> for multiple B<select>()s in a loop "
3933 "without reinitializing it.  Consider I<timeout> to be undefined after "
3934 "B<select>()  returns."
3935 msgstr ""
3936 "Linux では、 B<select>()  は I<timeout> を変更し、残りの停止時間を反映するよ"
3937 "うになっているが、 他のほとんどの実装ではこのようになっていない "
3938 "(POSIX.1-2001 はどちらの動作も認めている)。 このため、 I<timeout> を参照して"
3939 "いる Linux のコードを他のオペレーティング・システムへ 移植する場合、問題が起"
3940 "こる。 また、ループの中で I<timeval> 構造体を初期化せずにそのまま再利用して "
3941 "B<select>()  を複数回行なっているコードを Linux へ移植する場合にも、問題が起"
3942 "こる。 B<select>()  から復帰した後は I<timeout> は未定義であると考えるべきで"
3943 "ある。"
3944
3945 #. type: Plain text
3946 #: build/C/man2/select.2:302
3947 msgid ""
3948 "On success, B<select>()  and B<pselect>()  return the number of file "
3949 "descriptors contained in the three returned descriptor sets (that is, the "
3950 "total number of bits that are set in I<readfds>, I<writefds>, I<exceptfds>)  "
3951 "which may be zero if the timeout expires before anything interesting "
3952 "happens.  On error, -1 is returned, and I<errno> is set appropriately; the "
3953 "sets and I<timeout> become undefined, so do not rely on their contents after "
3954 "an error."
3955 msgstr ""
3956 "成功した場合、 B<select>()  と B<pselect>()  は更新された 3 つのディスクリプ"
3957 "タ集合に含まれている ファイルディスクリプタの数 (つまり、 I<readfds>, "
3958 "I<writefds>, I<exceptfds> 中の 1 になっているビットの総数) を返す。 何も起こ"
3959 "らずに時間切れになった場合、 ディスクリプタの数は 0 になることもある。 エラー"
3960 "ならば -1 を返し、 I<errno> に適切な値が設定される; 集合と I<timeout> は未定"
3961 "義となるので、エラーが起こった後はそれらの内容を信頼してはならない。"
3962
3963 #. type: Plain text
3964 #: build/C/man2/select.2:308
3965 msgid ""
3966 "An invalid file descriptor was given in one of the sets.  (Perhaps a file "
3967 "descriptor that was already closed, or one on which an error has occurred.)"
3968 msgstr ""
3969 "いずれかの集合に無効なファイルディスクリプタが指定された (おそらくは、すでに"
3970 "クローズされたファイルディスクリプタか、 エラーが発生したファイルディスクリプ"
3971 "タが指定された)。"
3972
3973 #. type: Plain text
3974 #: build/C/man2/select.2:312
3975 msgid "A signal was caught; see B<signal>(7)."
3976 msgstr "シグナルを受信した。"
3977
3978 #. type: Plain text
3979 #: build/C/man2/select.2:318
3980 msgid ""
3981 "I<nfds> is negative or the value contained within I<timeout> is invalid."
3982 msgstr "I<n> が負、または I<timeout> に入っている値が不正である。"
3983
3984 #. type: Plain text
3985 #: build/C/man2/select.2:321
3986 msgid "unable to allocate memory for internal tables."
3987 msgstr "内部テーブルにメモリを割り当てることができなかった。"
3988
3989 #. type: Plain text
3990 #: build/C/man2/select.2:327
3991 msgid ""
3992 "B<pselect>()  was added to Linux in kernel 2.6.16.  Prior to this, B<pselect>"
3993 "()  was emulated in glibc (but see BUGS)."
3994 msgstr ""
3995 "B<pselect>()  はカーネル 2.6.16 で Linux に追加された。 それ以前は、 "
3996 "B<pselect>()  は glibc でエミュレートされていた (「バグ」の章を参照)。"
3997
3998 #. type: Plain text
3999 #: build/C/man2/select.2:338
4000 msgid ""
4001 "B<select>()  conforms to POSIX.1-2001 and 4.4BSD (B<select>()  first "
4002 "appeared in 4.2BSD).  Generally portable to/from non-BSD systems supporting "
4003 "clones of the BSD socket layer (including System V variants).  However, note "
4004 "that the System V variant typically sets the timeout variable before exit, "
4005 "but the BSD variant does not."
4006 msgstr ""
4007 "B<select>()  は POSIX.1-2001 と 4.4BSD (B<select>()  は 4.2BSD で最初に登場し"
4008 "た) に準拠する。 BSD ソケット層のクローンをサポートしている非 BSD システム "
4009 "(System V 系も含む) との間でだいたい移植性がある。しかし System V 系では たい"
4010 "がい timeout 変数を exit の前にセットするが、 BSD 系ではそうでないので注意す"
4011 "ること。"
4012
4013 #. type: Plain text
4014 #: build/C/man2/select.2:342
4015 msgid "B<pselect>()  is defined in POSIX.1g, and in POSIX.1-2001."
4016 msgstr "B<pselect>()  は POSIX.1g と POSIX.1-2001 で定義されている。"
4017
4018 #. type: Plain text
4019 #: build/C/man2/select.2:359
4020 msgid ""
4021 "An I<fd_set> is a fixed size buffer.  Executing B<FD_CLR>()  or B<FD_SET>()  "
4022 "with a value of I<fd> that is negative or is equal to or larger than "
4023 "B<FD_SETSIZE> will result in undefined behavior.  Moreover, POSIX requires "
4024 "I<fd> to be a valid file descriptor."
4025 msgstr ""
4026 "I<fd_set> は固定サイズのバッファである。 負や B<FD_SETSIZE> 以上の値を持つ "
4027 "I<fd> に対して B<FD_CLR>()  や B<FD_SET>()  を実行した場合、 どのような動作を"
4028 "するかは定義されていない。 また、 POSIX では I<fd> は有効なファイルディスクリ"
4029 "プタでなければならないと規定されている。"
4030
4031 #. type: Plain text
4032 #: build/C/man2/select.2:368
4033 msgid ""
4034 "Concerning the types involved, the classical situation is that the two "
4035 "fields of a I<timeval> structure are typed as I<long> (as shown above), and "
4036 "the structure is defined in I<E<lt>sys/time.hE<gt>>.  The POSIX.1-2001 "
4037 "situation is"
4038 msgstr ""
4039 "型宣言に関しては、昔ながらの状況では I<timeval> 構造体の 2 つのフィールドは "
4040 "(上記のように) 両方とも I<long> 型であり、構造体は I<E<lt>sys/time.hE<gt>> で"
4041 "定義されている。 POSIX.1-2001 の下では、以下のようになっている。"
4042
4043 #. type: Plain text
4044 #: build/C/man2/select.2:375
4045 #, no-wrap
4046 msgid ""
4047 "struct timeval {\n"
4048 "    time_t         tv_sec;     /* seconds */\n"
4049 "    suseconds_t    tv_usec;    /* microseconds */\n"
4050 "};\n"
4051 msgstr ""
4052 "struct timeval {\n"
4053 "\t time_t         tv_sec;     /* 秒 */\n"
4054 "\t suseconds_t    tv_usec;    /* マイクロ秒 */\n"
4055 "};\n"
4056
4057 #. type: Plain text
4058 #: build/C/man2/select.2:386
4059 msgid ""
4060 "where the structure is defined in I<E<lt>sys/select.hE<gt>> and the data "
4061 "types I<time_t> and I<suseconds_t> are defined in I<E<lt>sys/types.hE<gt>>."
4062 msgstr ""
4063 "この構造体は I<E<lt>sys/select.hE<gt>> で定義されており、データ型 I<time_t> "
4064 "と I<suseconds_t> は I<E<lt>sys/types.hE<gt>> で定義されている。"
4065
4066 #. type: Plain text
4067 #: build/C/man2/select.2:398
4068 msgid ""
4069 "Concerning prototypes, the classical situation is that one should include "
4070 "I<E<lt>time.hE<gt>> for B<select>().  The POSIX.1-2001 situation is that one "
4071 "should include I<E<lt>sys/select.hE<gt>> for B<select>()  and B<pselect>()."
4072 msgstr ""
4073 "プロトタイプに関しては、昔ながらの状況で B<select>()  を使いたい場合は、 "
4074 "I<E<lt>time.hE<gt>> をインクルードすればよい。 POSIX.1-2001 の環境で "
4075 "B<select>()  と B<pselect>()  を使いたい場合は、 I<E<lt>sys/select.hE<gt>> を"
4076 "インクルードすればよい。"
4077
4078 #. type: Plain text
4079 #: build/C/man2/select.2:410
4080 msgid ""
4081 "Libc4 and libc5 do not have a I<E<lt>sys/select.hE<gt>> header; under glibc "
4082 "2.0 and later this header exists.  Under glibc 2.0 it unconditionally gives "
4083 "the wrong prototype for B<pselect>().  Under glibc 2.1 to 2.2.1 it gives "
4084 "B<pselect>()  when B<_GNU_SOURCE> is defined.  Since glibc 2.2.2 the "
4085 "requirements are as shown in the SYNOPSIS."
4086 msgstr ""
4087 "ヘッダファイル I<E<lt>sys/select.hE<gt>> は libc4 と libc5 にはなく、glibc "
4088 "2.0 以降に存在する。 悪いことに glibc 2.0 以前では B<pselect>()  のプロトタイ"
4089 "プが間違っている。 glibc 2.1 から 2.2.1 では B<_GNU_SOURCE> が定義されている"
4090 "場合に、 B<pselect>()  が提供される。 glibc 2.2.2 以降では、 B<pselect>()  を"
4091 "使用するには、「書式」に記載された要件を満たす必要がある。"
4092
4093 #. type: SS
4094 #: build/C/man2/select.2:410
4095 #, no-wrap
4096 msgid "Linux Notes"
4097 msgstr "Linux での注意"
4098
4099 #. type: Plain text
4100 #: build/C/man2/select.2:425
4101 msgid ""
4102 "The Linux B<pselect>()  system call modifies its I<timeout> argument.  "
4103 "However, the glibc wrapper function hides this behavior by using a local "
4104 "variable for the timeout argument that is passed to the system call.  Thus, "
4105 "the glibc B<pselect>()  function does not modify its I<timeout> argument; "
4106 "this is the behavior required by POSIX.1-2001."
4107 msgstr ""
4108 "Linux の B<pselect>() システムコールは I<timeout> 引き数を変更する。 しか"
4109 "し、\n"
4110 "glibc のラッパー関数は、システムコールに渡す timeout 引き数 としてローカル変"
4111 "数\n"
4112 "を使うことでこの動作を隠蔽している。 このため、glibc の B<pselect>() 関数は\n"
4113 "I<timeout> 引き数を変更しない。 これが POSIX.1-2001 が要求している動作であ"
4114 "る。"
4115
4116 #. type: Plain text
4117 #: build/C/man2/select.2:431
4118 msgid ""
4119 "Glibc 2.0 provided a version of B<pselect>()  that did not take a I<sigmask> "
4120 "argument."
4121 msgstr ""
4122 "glibc 2.0 では、 I<sigmask> 引き数を取らないバージョンの B<pselect>()  が提供"
4123 "されていた。"
4124
4125 #. type: Plain text
4126 #: build/C/man2/select.2:444
4127 msgid ""
4128 "Starting with version 2.1, glibc provided an emulation of B<pselect>()  that "
4129 "was implemented using B<sigprocmask>(2)  and B<select>().  This "
4130 "implementation remained vulnerable to the very race condition that B<pselect>"
4131 "()  was designed to prevent.  Modern versions of glibc use the (race-free)  "
4132 "B<pselect>()  system call on kernels where it is provided."
4133 msgstr ""
4134 "バージョン 2.1 以降の glibc では、 B<pselect>()  は B<sigprocmask>(2)  と "
4135 "B<select>()  を使ってエミュレートされていた。 この実装にはきわどい競合条件に"
4136 "おいて脆弱性が残っていた。 この競合条件における問題を防止するために "
4137 "B<pselect>()  は設計されたのである。 最近のバージョンの glibc では、カーネル"
4138 "がサポートしている場合には、 (競合が起こらない)  B<pselect>()  システムコール"
4139 "が使用される。"
4140
4141 #. type: Plain text
4142 #: build/C/man2/select.2:453
4143 msgid ""
4144 "On systems that lack B<pselect>(), reliable (and more portable) signal "
4145 "trapping can be achieved using the self-pipe trick (where a signal handler "
4146 "writes a byte to a pipe whose other end is monitored by B<select>()  in the "
4147 "main program.)"
4148 msgstr ""
4149 "B<pselect>()  がないシステムにおいて、 シグナルの捕捉を信頼性があり (移植性も"
4150 "高い) 方法で行うには、 自己パイプ (self-pipe) という技を使うとよい (シグナル"
4151 "ハンドラはパイプへ 1 バイトのデータを書き込み、同じパイプのもう一端をメインプ"
4152 "ログラムの B<select>()  で監視するという方法である)。"
4153
4154 #.  Stevens discusses a case where accept can block after select
4155 #.  returns successfully because of an intervening RST from the client.
4156 #.  Maybe the kernel should have returned EIO in such a situation?
4157 #. type: Plain text
4158 #: build/C/man2/select.2:469
4159 msgid ""
4160 "Under Linux, B<select>()  may report a socket file descriptor as \"ready for "
4161 "reading\", while nevertheless a subsequent read blocks.  This could for "
4162 "example happen when data has arrived but upon examination has wrong checksum "
4163 "and is discarded.  There may be other circumstances in which a file "
4164 "descriptor is spuriously reported as ready.  Thus it may be safer to use "
4165 "B<O_NONBLOCK> on sockets that should not block."
4166 msgstr ""
4167 "Linux では、 B<select>()  がソケットファイルディスクリプタで \"読み込みの準備"
4168 "ができた\" と報告した場合でも、 この後で read を行うと停止 (block) することが"
4169 "ある。このような状況は、 例えば、データが到着したが、検査でチェックサム異常が"
4170 "見つかり廃棄された時 などに起こりえる。他にもファイルディスクリプタが準備でき"
4171 "たと間違って 報告される状況が起こるかもしれない。 したがって、停止すべきでは"
4172 "ないソケットに対しては B<O_NONBLOCK> を使うとより安全であろう。"
4173
4174 #. type: Plain text
4175 #: build/C/man2/select.2:484
4176 msgid ""
4177 "On Linux, B<select>()  also modifies I<timeout> if the call is interrupted "
4178 "by a signal handler (i.e., the B<EINTR> error return).  This is not "
4179 "permitted by POSIX.1-2001.  The Linux B<pselect>()  system call has the same "
4180 "behavior, but the glibc wrapper hides this behavior by internally copying "
4181 "the I<timeout> to a local variable and passing that variable to the system "
4182 "call."
4183 msgstr ""
4184 "Linux では、 B<select>()  がシグナルハンドラにより割り込まれた場合 (つまり "
4185 "B<EINTR> エラーが返る場合)、 I<timeout> も変更する。 これは POSIX.1-2001 では"
4186 "認められていない挙動である。 Linux の B<pselect>()  システムコールも同じ挙動"
4187 "をするが、 glibc のラッパー関数がこの挙動を隠蔽している。 具体的には、glibc "
4188 "のラッパー関数の内部で、 I<timeout> をローカル変数にコピーし、 このローカル変"
4189 "数をシステムコールに渡している。"
4190
4191 #. type: Plain text
4192 #: build/C/man2/select.2:491
4193 #, no-wrap
4194 msgid ""
4195 "#include E<lt>stdio.hE<gt>\n"
4196 "#include E<lt>stdlib.hE<gt>\n"
4197 "#include E<lt>sys/time.hE<gt>\n"
4198 "#include E<lt>sys/types.hE<gt>\n"
4199 "#include E<lt>unistd.hE<gt>\n"
4200 msgstr ""
4201 "#include E<lt>stdio.hE<gt>\n"
4202 "#include E<lt>stdlib.hE<gt>\n"
4203 "#include E<lt>sys/time.hE<gt>\n"
4204 "#include E<lt>sys/types.hE<gt>\n"
4205 "#include E<lt>unistd.hE<gt>\n"
4206
4207 #. type: Plain text
4208 #: build/C/man2/select.2:498
4209 #, no-wrap
4210 msgid ""
4211 "int\n"
4212 "main(void)\n"
4213 "{\n"
4214 "    fd_set rfds;\n"
4215 "    struct timeval tv;\n"
4216 "    int retval;\n"
4217 msgstr ""
4218 "int\n"
4219 "main(void)\n"
4220 "{\n"
4221 "    fd_set rfds;\n"
4222 "    struct timeval tv;\n"
4223 "    int retval;\n"
4224
4225 #. type: Plain text
4226 #: build/C/man2/select.2:502
4227 #, no-wrap
4228 msgid ""
4229 "    /* Watch stdin (fd 0) to see when it has input. */\n"
4230 "    FD_ZERO(&rfds);\n"
4231 "    FD_SET(0, &rfds);\n"
4232 msgstr ""
4233 "    /* stdin (fd 0) を監視し、入力があった場合に表示する。*/\n"
4234 "    FD_ZERO(&rfds);\n"
4235 "    FD_SET(0, &rfds);\n"
4236
4237 #. type: Plain text
4238 #: build/C/man2/select.2:506
4239 #, no-wrap
4240 msgid ""
4241 "    /* Wait up to five seconds. */\n"
4242 "    tv.tv_sec = 5;\n"
4243 "    tv.tv_usec = 0;\n"
4244 msgstr ""
4245 "    /* 5 秒間監視する。*/\n"
4246 "    tv.tv_sec = 5;\n"
4247 "    tv.tv_usec = 0;\n"
4248
4249 #. type: Plain text
4250 #: build/C/man2/select.2:509
4251 #, no-wrap
4252 msgid ""
4253 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4254 "    /* Don't rely on the value of tv now! */\n"
4255 msgstr ""
4256 "    retval = select(1, &rfds, NULL, NULL, &tv);\n"
4257 "    /* この時点での tv の値を信頼してはならない。*/\n"
4258
4259 #. type: Plain text
4260 #: build/C/man2/select.2:517
4261 #, no-wrap
4262 msgid ""
4263 "    if (retval == -1)\n"
4264 "        perror(\"select()\");\n"
4265 "    else if (retval)\n"
4266 "        printf(\"Data is available now.\\en\");\n"
4267 "        /* FD_ISSET(0, &rfds) will be true. */\n"
4268 "    else\n"
4269 "        printf(\"No data within five seconds.\\en\");\n"
4270 msgstr ""
4271 "    if (retval == -1)\n"
4272 "\tperror(\"select()\");\n"
4273 "    else if (retval)\n"
4274 "        printf(\"今、データが取得できました。\\en\");\n"
4275 "        /* FD_ISSET(0, &rfds) が true になる。*/\n"
4276 "    else\n"
4277 "        printf(\"5 秒以内にデータが入力されませんでした。\\en\");\n"
4278
4279 #. type: Plain text
4280 #: build/C/man2/select.2:520
4281 #, no-wrap
4282 msgid ""
4283 "    exit(EXIT_SUCCESS);\n"
4284 "}\n"
4285 msgstr ""
4286 "    exit(EXIT_SUCCESS);\n"
4287 "}\n"
4288
4289 #. type: Plain text
4290 #: build/C/man2/select.2:524
4291 msgid "For a tutorial with discussion and examples, see B<select_tut>(2)."
4292 msgstr ""
4293 "考察と使用例の書かれたチュートリアルとして、 B<select_tut>(2)  がある。"
4294
4295 #. type: Plain text
4296 #: build/C/man2/select.2:536
4297 msgid ""
4298 "For vaguely related stuff, see B<accept>(2), B<connect>(2), B<poll>(2), "
4299 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4300 "(7), B<time>(7)"
4301 msgstr ""
4302 "関係がありそうなものを挙げておく: B<accept>(2), B<connect>(2), B<poll>(2), "
4303 "B<read>(2), B<recv>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<epoll>"
4304 "(7), B<time>(7)"
4305
4306 #. type: TH
4307 #: build/C/man2/select_tut.2:30
4308 #, no-wrap
4309 msgid "SELECT_TUT"
4310 msgstr "SELECT_TUT"
4311
4312 #. type: TH
4313 #: build/C/man2/select_tut.2:30
4314 #, no-wrap
4315 msgid "2010-06-10"
4316 msgstr "2010-06-10"
4317
4318 #. type: Plain text
4319 #: build/C/man2/select_tut.2:50
4320 #, no-wrap
4321 msgid ""
4322 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4323 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4324 msgstr ""
4325 "B<int select(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4326 "B<           fd_set *>I<exceptfds>B<, struct timeval *>I<utimeout>B<);>\n"
4327
4328 #. type: Plain text
4329 #: build/C/man2/select_tut.2:64
4330 #, no-wrap
4331 msgid ""
4332 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4333 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4334 "B<            const sigset_t *>I<sigmask>B<);>\n"
4335 msgstr ""
4336 "B<int pselect(int >I<nfds>B<, fd_set *>I<readfds>B<, fd_set *>I<writefds>B<,>\n"
4337 "B<            fd_set *>I<exceptfds>B<, const struct timespec *>I<ntimeout>B<,>\n"
4338 "B<            const sigset_t *>I<sigmask>B<);>\n"
4339
4340 #. type: Plain text
4341 #: build/C/man2/select_tut.2:81
4342 msgid ""
4343 "B<select>()  (or B<pselect>())  is used to efficiently monitor multiple file "
4344 "descriptors, to see if any of them is, or becomes, \"ready\"; that is, to "
4345 "see whether I/O becomes possible, or an \"exceptional condition\" has "
4346 "occurred on any of the descriptors."
4347 msgstr ""
4348 "B<select>()  (や B<pselect>())  を使うと、効率的に複数のファイルディスクリプ"
4349 "タを監視し、 そのファイルディスクリプタのいずれかが 「ready (準備ができた)」"
4350 "状態、つまり I/O (入出力) が可能になっているかや、 ファイルディスクリプタのい"
4351 "ずれかが 「例外状態 (exceptional condition)」が発生したか、を調べることができ"
4352 "る。"
4353
4354 #. type: Plain text
4355 #: build/C/man2/select_tut.2:106
4356 msgid ""
4357 "Its principal arguments are three \"sets\" of file descriptors: I<readfds>, "
4358 "I<writefds>, and I<exceptfds>.  Each set is declared as type I<fd_set>, and "
4359 "its contents can be manipulated with the macros B<FD_CLR>(), B<FD_ISSET>(), "
4360 "B<FD_SET>(), and B<FD_ZERO>().  A newly declared set should first be cleared "
4361 "using B<FD_ZERO>().  B<select>()  modifies the contents of the sets "
4362 "according to the rules described below; after calling B<select>()  you can "
4363 "test if a file descriptor is still present in a set with the B<FD_ISSET>()  "
4364 "macro.  B<FD_ISSET>()  returns nonzero if a specified file descriptor is "
4365 "present in a set and zero if it is not.  B<FD_CLR>()  removes a file "
4366 "descriptor from a set."
4367 msgstr ""
4368 "この関数の主要な引き数は、3種類のファイルディスクリプタの「集合」 "
4369 "I<readfds>, I<writefds>, I<exceptfds> である。 各々の集合は B<fd_set> として"
4370 "宣言され、その内容は B<FD_CLR>(), B<FD_ISSET>(), B<FD_SET>(), B<FD_ZERO>()  "
4371 "といったマクロによって操作できる。 新しく宣言された集合は、まず最初に "
4372 "B<FD_ZERO>()  を使ってクリアすべきである。 B<select>()  はこれらの集合の内容"
4373 "を、以降に述べる規則に従って修正する。 B<select>()  を呼んだ後、ファイルディ"
4374 "スクリプタがまだ集合に存在しているかどうかは、 B<FD_ISSET>()  マクロによって"
4375 "調べることができる。 B<FD_ISSET>()  は指定されたディスクリプタが集合に存在し"
4376 "ていれば 0 以外の値を返し、 存在しなければ 0 を返す。 B<FD_CLR>()  は集合から"
4377 "のファイルディスクリプタの削除を行う。"
4378
4379 #. type: SS
4380 #: build/C/man2/select_tut.2:106
4381 #, no-wrap
4382 msgid "Arguments"
4383 msgstr "引き数"
4384
4385 #. type: TP
4386 #: build/C/man2/select_tut.2:107
4387 #, no-wrap
4388 msgid "I<readfds>"
4389 msgstr "I<readfds>"
4390
4391 #. type: Plain text
4392 #: build/C/man2/select_tut.2:116
4393 msgid ""
4394 "This set is watched to see if data is available for reading from any of its "
4395 "file descriptors.  After B<select>()  has returned, I<readfds> will be "
4396 "cleared of all file descriptors except for those that are immediately "
4397 "available for reading."
4398 msgstr ""
4399 "この集合に含まれるいずれかのファイルディスクリプタで、 データの読み込みが可能"
4400 "になったかどうかを監視する。 B<select>()  から戻る時に、I<readfds> のうち、 "
4401 "直ちに読み込み可能なファイルディスクリプタ以外は 集合から削除される。"
4402
4403 #. type: TP
4404 #: build/C/man2/select_tut.2:116
4405 #, no-wrap
4406 msgid "I<writefds>"
4407 msgstr "I<writefds>"
4408
4409 #. type: Plain text
4410 #: build/C/man2/select_tut.2:125
4411 msgid ""
4412 "This set is watched to see if there is space to write data to any of its "
4413 "file descriptors.  After B<select>()  has returned, I<writefds> will be "
4414 "cleared of all file descriptors except for those that are immediately "
4415 "available for writing."
4416 msgstr ""
4417 "この集合に含まれるいずれかのファイルディスクリプタで、 データを書き込むスペー"
4418 "スがあるかどうかを監視する。 B<select>()  から戻る時に、I<writefds> のうち、 "
4419 "直ちに書き込み可能なファイルディスクリプタ以外は 集合から削除される。"
4420
4421 #. type: TP
4422 #: build/C/man2/select_tut.2:125
4423 #, no-wrap
4424 msgid "I<exceptfds>"
4425 msgstr "I<exceptfds>"
4426
4427 #. type: Plain text
4428 #: build/C/man2/select_tut.2:147
4429 msgid ""
4430 "This set is watched for \"exceptional conditions\".  In practice, only one "
4431 "such exceptional condition is common: the availability of I<out-of-band> "
4432 "(OOB) data for reading from a TCP socket.  See B<recv>(2), B<send>(2), and "
4433 "B<tcp>(7)  for more details about OOB data.  (One other less common case "
4434 "where B<select>(2)  indicates an exceptional condition occurs with "
4435 "pseudoterminals in packet mode; see B<tty_ioctl>(4).)  After B<select>()  "
4436 "has returned, I<exceptfds> will be cleared of all file descriptors except "
4437 "for those for which an exceptional condition has occurred."
4438 msgstr ""
4439 "この集合に含まれるいずれかのファイルディスクリプタで、 「例外状態 "
4440 "(exceptional condition)」が発生したかどうかを監視する。 実際の動作では、普通"
4441 "に起こり得る例外状態は一つだけであり、 それは TCP ソケットで I<帯域外 (out-"
4442 "of-band; OOB)> データが 読み込み可能な場合である。 OOB データの詳細について"
4443 "は、 B<recv>(2), B<send>(2), B<tcp>(7)  を参照のこと。 (これ以外では、まれな"
4444 "ことだが、 パケットモードの擬似端末 (pseudoterminals) で B<select>()  が例外"
4445 "状態を示すことがある。)  B<select>()  が返る時に、I<exceptfds> のうち、 例外"
4446 "状態が発生したディスクリプタ以外は集合から削除される。"
4447
4448 #. type: TP
4449 #: build/C/man2/select_tut.2:147
4450 #, no-wrap
4451 msgid "I<nfds>"
4452 msgstr "I<nfds>"
4453
4454 #. type: Plain text
4455 #: build/C/man2/select_tut.2:154
4456 msgid ""
4457 "This is an integer one more than the maximum of any file descriptor in any "
4458 "of the sets.  In other words, while adding file descriptors to each of the "
4459 "sets, you must calculate the maximum integer value of all of them, then "
4460 "increment this value by one, and then pass this as I<nfds>."
4461 msgstr ""
4462 "全ての集合に含まれるファイルディスクリプタのうち、 値が最大のものに 1 を足し"
4463 "た整数である。 すなわち、ファイルディスクリプタを各集合に加える作業の途中"
4464 "で、 全てのファイルディスクリプタを見て最大値を求め、 それに 1 を加えて "
4465 "I<nfds> として渡さないといけない、ということだ。"
4466
4467 #. type: TP
4468 #: build/C/man2/select_tut.2:154
4469 #, no-wrap
4470 msgid "I<utimeout>"
4471 msgstr "I<utimeout>"
4472
4473 #. type: Plain text
4474 #: build/C/man2/select_tut.2:167
4475 msgid ""
4476 "This is the longest time B<select>()  may wait before returning, even if "
4477 "nothing interesting happened.  If this value is passed as NULL, then "
4478 "B<select>()  blocks indefinitely waiting for a file descriptor to become "
4479 "ready.  I<utimeout> can be set to zero seconds, which causes B<select>()  to "
4480 "return immediately, with information about the readiness of file descriptors "
4481 "at the time of the call.  The structure I<struct timeval> is defined as:"
4482 msgstr ""
4483 "(何も起こらなかった場合に)  B<select>()  が戻る前に待つ最大時間である。 この"
4484 "値に NULL を渡すと、 B<select>()  はファイルディスクリプタのいずれかが ready "
4485 "(準備ができた) 状態に なるまで待ち続けてずっと停止する。 I<utimeout> は 0 秒"
4486 "にすることもでき、 この場合 B<select>()  は直ちに返り、呼び出し時点のファイル"
4487 "ディスクリプタの状態に 関する情報が返される。 構造体 I<struct timeval> は次の"
4488 "ように定義されている:"
4489
4490 #. type: Plain text
4491 #: build/C/man2/select_tut.2:174
4492 #, no-wrap
4493 msgid ""
4494 "struct timeval {\n"
4495 "    time_t tv_sec;    /* seconds */\n"
4496 "    long tv_usec;     /* microseconds */\n"
4497 "};\n"
4498 msgstr ""
4499 "struct timeval {\n"
4500 "    time_t tv_sec;    /* seconds */\n"
4501 "    long tv_usec;     /* microseconds */\n"
4502 "};\n"
4503
4504 #. type: TP
4505 #: build/C/man2/select_tut.2:176
4506 #, no-wrap
4507 msgid "I<ntimeout>"
4508 msgstr "I<ntimeout>"
4509
4510 #. type: Plain text
4511 #: build/C/man2/select_tut.2:185
4512 msgid ""
4513 "This argument for B<pselect>()  has the same meaning as I<utimeout>, but "
4514 "I<struct timespec> has nanosecond precision as follows:"
4515 msgstr ""
4516 "B<pselect>()  のこの引き数は I<utimeout> と同じ意味を持つが、 I<struct "
4517 "timespec> は次に示すようにナノ秒の精度を持つ。"
4518
4519 #. type: Plain text
4520 #: build/C/man2/select_tut.2:192
4521 #, no-wrap
4522 msgid ""
4523 "struct timespec {\n"
4524 "    long tv_sec;    /* seconds */\n"
4525 "    long tv_nsec;   /* nanoseconds */\n"
4526 "};\n"
4527 msgstr ""
4528 "struct timespec {\n"
4529 "    long tv_sec;    /* seconds */\n"
4530 "    long tv_nsec;   /* nanoseconds */\n"
4531 "};\n"
4532
4533 #. type: TP
4534 #: build/C/man2/select_tut.2:194
4535 #, no-wrap
4536 msgid "I<sigmask>"
4537 msgstr "I<sigmask>"
4538
4539 #. type: Plain text
4540 #: build/C/man2/select_tut.2:211
4541 msgid ""
4542 "This argument holds a set of signals that the kernel should unblock (i.e., "
4543 "remove from the signal mask of the calling thread), while the caller is "
4544 "blocked inside the B<pselect>()  call (see B<sigaddset>(3)  and "
4545 "B<sigprocmask>(2)).  It may be NULL, in which case the call does not modify "
4546 "the signal mask on entry and exit to the function.  In this case, B<pselect>"
4547 "()  will then behave just like B<select>()."
4548 msgstr ""
4549 "この引き数は、呼び出し側が B<pselect>()  内部で停止している間に、カーネルが通"
4550 "知を許可すべきシグナル集合 (すなわち、呼び出したスレッドのシグナルマスクから"
4551 "削除すべきシグナル集合)  を保持する (B<sigaddset>(3)  と B<sigprocmask>(2)  "
4552 "を参照)。 この引き数は NULL にすることもでき、その場合はこの関数へ 入るとき・"
4553 "出るときにシグナルマスクを変更しない。 この場合、 B<pselect>()  は B<select>"
4554 "()  と全く同じ動作となる。"
4555
4556 #. type: SS
4557 #: build/C/man2/select_tut.2:211
4558 #, no-wrap
4559 msgid "Combining Signal and Data Events"
4560 msgstr "シグナルとデータイベントを組み合わせる"
4561
4562 #. type: Plain text
4563 #: build/C/man2/select_tut.2:255
4564 msgid ""
4565 "B<pselect>()  is useful if you are waiting for a signal as well as for file "
4566 "descriptor(s) to become ready for I/O.  Programs that receive signals "
4567 "normally use the signal handler only to raise a global flag.  The global "
4568 "flag will indicate that the event must be processed in the main loop of the "
4569 "program.  A signal will cause the B<select>()  (or B<pselect>())  call to "
4570 "return with I<errno> set to B<EINTR>.  This behavior is essential so that "
4571 "signals can be processed in the main loop of the program, otherwise B<select>"
4572 "()  would block indefinitely.  Now, somewhere in the main loop will be a "
4573 "conditional to check the global flag.  So we must ask: what if a signal "
4574 "arrives after the conditional, but before the B<select>()  call? The answer "
4575 "is that B<select>()  would block indefinitely, even though an event is "
4576 "actually pending.  This race condition is solved by the B<pselect>()  call.  "
4577 "This call can be used to set the signal mask to a set of signals that are "
4578 "only to be received within the B<pselect>()  call.  For instance, let us say "
4579 "that the event in question was the exit of a child process.  Before the "
4580 "start of the main loop, we would block B<SIGCHLD> using B<sigprocmask>(2).  "
4581 "Our B<pselect>()  call would enable B<SIGCHLD> by using an empty signal "
4582 "mask.  Our program would look like:"
4583 msgstr ""
4584 "ファイルディスクリプタが I/O 可能な状態になるのと同時に シグナルも待ちたい場"
4585 "合には、 B<pselect>()  が便利である。 シグナルを受信するプログラムは、通常"
4586 "は、 シグナルハンドラをグローバルなフラグを立てるためだけに使う。 このグロー"
4587 "バルなフラグは、 そのイベントをプログラムのメインループで 処理しなければなら"
4588 "ないことを示す。 シグナルを受けると B<select>()  (や B<pselect>())  は "
4589 "I<errno> に B<EINTR> をセットして戻ることになる。 シグナルがプログラムのメイ"
4590 "ンループで処理されるためにはこの動作が不可欠で、 これがないと B<select>()  は"
4591 "永遠に停止し続けることになる。 さて、メインループのどこかにこのグローバルフラ"
4592 "グをチェックする 条件文があるとしよう。ここで少し考えてみないといけない。 "
4593 "「シグナルが条件文の後、しかし B<select>()  コールの前に到着したら どうなるの"
4594 "か?」 答えは「その B<select>()  は、たとえ解決待ちのイベントがあったとして"
4595 "も、 永遠に停止する」である。 この競合状態は B<pselect>()  コールによって解決"
4596 "できる。 このコールを使うと、 B<pselect>()  で受信したいシグナルの集合だけを"
4597 "シグナルマスクに設定することができる。 例えば、問題となっているイベントが子プ"
4598 "ロセスの終了の場合を考えよう。 メインループが始まる前に、 B<SIGCHLD> を "
4599 "B<sigprocmask>(2)  でブロックする。 B<pselect>()  コールでは B<SIGCHLD> を、"
4600 "もともとのシグナルマスクを使って有効にするのだ。 このプログラムは次のようにな"
4601 "る。"
4602
4603 #. type: Plain text
4604 #: build/C/man2/select_tut.2:258
4605 #, no-wrap
4606 msgid "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4607 msgstr "static volatile sig_atomic_t got_SIGCHLD = 0;\n"
4608
4609 #. type: Plain text
4610 #: build/C/man2/select_tut.2:264
4611 #, no-wrap
4612 msgid ""
4613 "static void\n"
4614 "child_sig_handler(int sig)\n"
4615 "{\n"
4616 "    got_SIGCHLD = 1;\n"
4617 "}\n"
4618 msgstr ""
4619 "static void\n"
4620 "child_sig_handler(int sig)\n"
4621 "{\n"
4622 "    got_SIGCHLD = 1;\n"
4623 "}\n"
4624
4625 #. type: Plain text
4626 #: build/C/man2/select_tut.2:272
4627 #, no-wrap
4628 msgid ""
4629 "int\n"
4630 "main(int argc, char *argv[])\n"
4631 "{\n"
4632 "    sigset_t sigmask, empty_mask;\n"
4633 "    struct sigaction sa;\n"
4634 "    fd_set readfds, writefds, exceptfds;\n"
4635 "    int r;\n"
4636 msgstr ""
4637 "int\n"
4638 "main(int argc, char *argv[])\n"
4639 "{\n"
4640 "    sigset_t sigmask, empty_mask;\n"
4641 "    struct sigaction sa;\n"
4642 "    fd_set readfds, writefds, exceptfds;\n"
4643 "    int r;\n"
4644
4645 #. type: Plain text
4646 #: build/C/man2/select_tut.2:279
4647 #, no-wrap
4648 msgid ""
4649 "    sigemptyset(&sigmask);\n"
4650 "    sigaddset(&sigmask, SIGCHLD);\n"
4651 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4652 "        perror(\"sigprocmask\");\n"
4653 "        exit(EXIT_FAILURE);\n"
4654 "    }\n"
4655 msgstr ""
4656 "    sigemptyset(&sigmask);\n"
4657 "    sigaddset(&sigmask, SIGCHLD);\n"
4658 "    if (sigprocmask(SIG_BLOCK, &sigmask, NULL) == -1) {\n"
4659 "        perror(\"sigprocmask\");\n"
4660 "        exit(EXIT_FAILURE);\n"
4661 "    }\n"
4662
4663 #. type: Plain text
4664 #: build/C/man2/select_tut.2:287
4665 #, no-wrap
4666 msgid ""
4667 "    sa.sa_flags = 0;\n"
4668 "    sa.sa_handler = child_sig_handler;\n"
4669 "    sigemptyset(&sa.sa_mask);\n"
4670 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4671 "        perror(\"sigaction\");\n"
4672 "        exit(EXIT_FAILURE);\n"
4673 "    }\n"
4674 msgstr ""
4675 "    sa.sa_flags = 0;\n"
4676 "    sa.sa_handler = child_sig_handler;\n"
4677 "    sigemptyset(&sa.sa_mask);\n"
4678 "    if (sigaction(SIGCHLD, &sa, NULL) == -1) {\n"
4679 "        perror(\"sigaction\");\n"
4680 "        exit(EXIT_FAILURE);\n"
4681 "    }\n"
4682
4683 #. type: Plain text
4684 #: build/C/man2/select_tut.2:289
4685 #, no-wrap
4686 msgid "    sigemptyset(&empty_mask);\n"
4687 msgstr "    sigemptyset(&empty_mask);\n"
4688
4689 #. type: Plain text
4690 #: build/C/man2/select_tut.2:293
4691 #, no-wrap
4692 msgid ""
4693 "    for (;;) {          /* main loop */\n"
4694 "        /* Initialize readfds, writefds, and exceptfds\n"
4695 "           before the pselect() call. (Code omitted.) */\n"
4696 msgstr ""
4697 "    for (;;) {          /* main loop */\n"
4698 "        /* Initialize readfds, writefds, and exceptfds\n"
4699 "           before the pselect() call. (Code omitted.) */\n"
4700
4701 #. type: Plain text
4702 #: build/C/man2/select_tut.2:299
4703 #, no-wrap
4704 msgid ""
4705 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4706 "                    NULL, &empty_mask);\n"
4707 "        if (r == -1 && errno != EINTR) {\n"
4708 "            /* Handle error */\n"
4709 "        }\n"
4710 msgstr ""
4711 "        r = pselect(nfds, &readfds, &writefds, &exceptfds,\n"
4712 "                    NULL, &empty_mask);\n"
4713 "        if (r == -1 && errno != EINTR) {\n"
4714 "            /* Handle error */\n"
4715 "        }\n"
4716
4717 #. type: Plain text
4718 #: build/C/man2/select_tut.2:302
4719 #, no-wrap
4720 msgid ""
4721 "        if (got_SIGCHLD) {\n"
4722 "            got_SIGCHLD = 0;\n"
4723 msgstr ""
4724 "        if (got_SIGCHLD) {\n"
4725 "            got_SIGCHLD = 0;\n"
4726
4727 #. type: Plain text
4728 #: build/C/man2/select_tut.2:306
4729 #, no-wrap
4730 msgid ""
4731 "            /* Handle signalled event here; e.g., wait() for all\n"
4732 "               terminated children. (Code omitted.) */\n"
4733 "        }\n"
4734 msgstr ""
4735 "            /* Handle signalled event here; e.g., wait() for all\n"
4736 "               terminated children. (Code omitted.) */\n"
4737 "        }\n"
4738
4739 #. type: Plain text
4740 #: build/C/man2/select_tut.2:310
4741 #, no-wrap
4742 msgid ""
4743 "        /* main body of program */\n"
4744 "    }\n"
4745 "}\n"
4746 msgstr ""
4747 "        /* main body of program */\n"
4748 "    }\n"
4749 "}\n"
4750
4751 #. type: SS
4752 #: build/C/man2/select_tut.2:311
4753 #, no-wrap
4754 msgid "Practical"
4755 msgstr "実例"
4756
4757 #. type: Plain text
4758 #: build/C/man2/select_tut.2:332
4759 msgid ""
4760 "So what is the point of B<select>()? Can't I just read and write to my "
4761 "descriptors whenever I want? The point of B<select>()  is that it watches "
4762 "multiple descriptors at the same time and properly puts the process to sleep "
4763 "if there is no activity.  UNIX programmers often find themselves in a "
4764 "position where they have to handle I/O from more than one file descriptor "
4765 "where the data flow may be intermittent.  If you were to merely create a "
4766 "sequence of B<read>(2)  and B<write>(2)  calls, you would find that one of "
4767 "your calls may block waiting for data from/to a file descriptor, while "
4768 "another file descriptor is unused though ready for I/O.  B<select>()  "
4769 "efficiently copes with this situation."
4770 msgstr ""
4771 "実際のところ B<select>()  の大事な点は何なのか? ディスクリプタは好きなときに"
4772 "読み書きできるんじゃないの? B<select>()  の重要なところは、複数のディスクリ"
4773 "プタを同時に監視でき、 なんの動きもなければプロセスを適切にスリープ状態に移行"
4774 "するところにあるのだ。 UNIX プログラマは、 複数のファイルディスクリプタの入出"
4775 "力を同時に扱わねばならず、 しかもデータの流れは間欠的である、という状況によく"
4776 "出会う。 単に B<read>(2)  や B<write>(2)  コールのシーケンスを作るだけでは、"
4777 "それらのコールのどれかが ファイルディスクリプタからのデータを待ってブロックし"
4778 "ており、 別のファイルディスクリプタには I/O が可能なのに使えない、 ということ"
4779 "になってしまうだろう。 B<select>()  を使うとこの状況に効果的に対処できる。"
4780
4781 #. type: SS
4782 #: build/C/man2/select_tut.2:332
4783 #, no-wrap
4784 msgid "Select Law"
4785 msgstr "SELECT の掟"
4786
4787 #. type: Plain text
4788 #: build/C/man2/select_tut.2:345
4789 msgid ""
4790 "Many people who try to use B<select>()  come across behavior that is "
4791 "difficult to understand and produces nonportable or borderline results.  For "
4792 "instance, the above program is carefully written not to block at any point, "
4793 "even though it does not set its file descriptors to nonblocking mode.  It is "
4794 "easy to introduce subtle errors that will remove the advantage of using "
4795 "B<select>(), so here is a list of essentials to watch for when using "
4796 "B<select>()."
4797 msgstr ""
4798 "B<select>()  を使おうとした多くの人は、理解しにくい挙動に出くわし、結果的に "
4799 "できたものは移植性がないか、よくてもギリギリのものになってしまう。 例えば、上"
4800 "記のプログラムは、 集合に含まれるファイルディスクリプタを非停止 "
4801 "(nonblocking) モード にしなくても、どこにもブロックが生じないよう注意して書か"
4802 "れている。 微妙な間違いによって、 B<select>()  を使う利点は簡単に失われてしま"
4803 "う。 そこで、 B<select>()  コールを使うときに注意すべき重要事項を列挙しておく"
4804 "ことにする。"
4805
4806 #. type: Plain text
4807 #: build/C/man2/select_tut.2:354
4808 msgid ""
4809 "You should always try to use B<select>()  without a timeout.  Your program "
4810 "should have nothing to do if there is no data available.  Code that depends "
4811 "on timeouts is not usually portable and is difficult to debug."
4812 msgstr ""
4813 "B<select>()  を使うときは、タイムアウトは設定すべきでない。 処理するデータが"
4814 "無いときには、 あなたのプログラムには何もすることは無いはずである。 タイムア"
4815 "ウトに依存したコードは通常移植性がなく、 デバッグも難しくなる。"
4816
4817 #. type: Plain text
4818 #: build/C/man2/select_tut.2:358
4819 msgid ""
4820 "The value I<nfds> must be properly calculated for efficiency as explained "
4821 "above."
4822 msgstr ""
4823 "上述したように、 効率的なプログラムを書くには I<nfds> の値を適切に計算して与"
4824 "えなければならない。"
4825
4826 #. type: Plain text
4827 #: build/C/man2/select_tut.2:365
4828 msgid ""
4829 "No file descriptor must be added to any set if you do not intend to check "
4830 "its result after the B<select>()  call, and respond appropriately.  See next "
4831 "rule."
4832 msgstr ""
4833 "B<select>()  コールの終了後に結果をチェックして、 適切に対応するつもりのない"
4834 "ファイルディスクリプタは、 どの集合にも加えてはならない。 次のルールも参照。"
4835
4836 #. type: Plain text
4837 #: build/C/man2/select_tut.2:371
4838 msgid ""
4839 "After B<select>()  returns, all file descriptors in all sets should be "
4840 "checked to see if they are ready."
4841 msgstr ""
4842 "B<select>()  から返った後には、全ての集合の全てのファイルディスクリプタについ"
4843 "て 読み書き可能な状態になっているかをチェックすべきである。"
4844
4845 #. type: TP
4846 #: build/C/man2/select_tut.2:371
4847 #, no-wrap
4848 msgid "5."
4849 msgstr "5."
4850
4851 #. type: Plain text
4852 #: build/C/man2/select_tut.2:386
4853 msgid ""
4854 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  do I<not> "
4855 "necessarily read/write the full amount of data that you have requested.  If "
4856 "they do read/write the full amount, it's because you have a low traffic load "
4857 "and a fast stream.  This is not always going to be the case.  You should "
4858 "cope with the case of your functions only managing to send or receive a "
4859 "single byte."
4860 msgstr ""
4861 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  といった関数は、こちらが要求"
4862 "した全データを読み書きする必要はI<ない>。 もし全データを読み書きするなら、そ"
4863 "れはトラフィックの負荷が小さく、 ストリームが速い場合だろう。この条件は常に満"
4864 "たされるとは限らない。 これらの関数が頑張っても 1 バイトしか送受信できないよ"
4865 "うな場合も 考慮に入れてやらなければならない。"
4866
4867 #. type: TP
4868 #: build/C/man2/select_tut.2:386
4869 #, no-wrap
4870 msgid "6."
4871 msgstr "6."
4872
4873 #. type: Plain text
4874 #: build/C/man2/select_tut.2:394
4875 msgid ""
4876 "Never read/write only in single bytes at a time unless you are really sure "
4877 "that you have a small amount of data to process.  It is extremely "
4878 "inefficient not to read/write as much data as you can buffer each time.  The "
4879 "buffers in the example below are 1024 bytes although they could easily be "
4880 "made larger."
4881 msgstr ""
4882 "処理するデータ量が小さいことがはっきりとわかっている場合を除いて、 一度に 1 "
4883 "バイトずつ読み書きするようなことはしてはならない。 バッファの許すかぎりのデー"
4884 "タをまとめて読み書きしないと、 非常に効率が悪い。下記の例ではバッファは 1024 "
4885 "バイトにしているが、 このサイズを大きくするのは簡単だろう。"
4886
4887 #. type: TP
4888 #: build/C/man2/select_tut.2:394
4889 #, no-wrap
4890 msgid "7."
4891 msgstr "7."
4892
4893 #.  Nonetheless, you should still cope with these errors for completeness.
4894 #. type: Plain text
4895 #: build/C/man2/select_tut.2:416
4896 msgid ""
4897 "The functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  as well "
4898 "as the B<select>()  call can return -1 with I<errno> set to B<EINTR>, or "
4899 "with I<errno> set to B<EAGAIN> (B<EWOULDBLOCK>).  These results must be "
4900 "properly managed (not done properly above).  If your program is not going to "
4901 "receive any signals, then it is unlikely you will get B<EINTR>.  If your "
4902 "program does not set nonblocking I/O, you will not get B<EAGAIN>."
4903 msgstr ""
4904 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  などの関数や B<select>()  "
4905 "コールは、 I<errno> を B<EINTR や EAGAIN> (B<EWOULDBLOCK>)  にして -1 を返す"
4906 "ことがある。 このような結果に対して適切に対応してやらなければならない (上記の"
4907 "例ではしていない)。 書いているプログラムがシグナルを受ける予定がなければ、 "
4908 "B<EINTR> が返されることはあまり考えられない。 書いているプログラムで非ブロッ"
4909 "ク I/O をセットしていない場合は、 B<EAGAIN> が返されることはないだろう。"
4910
4911 #. type: TP
4912 #: build/C/man2/select_tut.2:416
4913 #, no-wrap
4914 msgid "8."
4915 msgstr "8."
4916
4917 #. type: Plain text
4918 #: build/C/man2/select_tut.2:425
4919 msgid ""
4920 "Never call B<read>(2), B<recv>(2), B<write>(2), or B<send>(2)  with a buffer "
4921 "length of zero."
4922 msgstr ""
4923 "決して、引き数に長さ 0 のバッファを指定して B<read>(2), B<recv>(2), B<write>"
4924 "(2), B<send>(2)  を呼び出してはならない。"
4925
4926 #. type: TP
4927 #: build/C/man2/select_tut.2:425
4928 #, no-wrap
4929 msgid "9."
4930 msgstr "9."
4931
4932 #. type: Plain text
4933 #: build/C/man2/select_tut.2:441
4934 msgid ""
4935 "If the functions B<read>(2), B<recv>(2), B<write>(2), and B<send>(2)  fail "
4936 "with errors other than those listed in B<7.>, or one of the input functions "
4937 "returns 0, indicating end of file, then you should I<not> pass that "
4938 "descriptor to B<select>()  again.  In the example below, I close the "
4939 "descriptor immediately, and then set it to -1 to prevent it being included "
4940 "in a set."
4941 msgstr ""
4942 "B<read>(2), B<recv>(2), B<write>(2), B<send>(2)  が B<7.> に示した以外のエ"
4943 "ラーで失敗した場合や、 入力系の関数の一つがファイル末尾を表す 0 を返した場合"
4944 "は、 そのディスクリプタをもう一度 select に渡してはI<ならない>。 下記の例で"
4945 "は、そのディスクリプタをただちにクローズし、 そこには -1 をセットして、 それ"
4946 "が集合に含まれ続けるのを許さないようにしている。"
4947
4948 #. type: TP
4949 #: build/C/man2/select_tut.2:441
4950 #, no-wrap
4951 msgid "10."
4952 msgstr "10."
4953
4954 #. type: Plain text
4955 #: build/C/man2/select_tut.2:448
4956 msgid ""
4957 "The timeout value must be initialized with each new call to B<select>(), "
4958 "since some operating systems modify the structure.  B<pselect>()  however "
4959 "does not modify its timeout structure."
4960 msgstr ""
4961 "タイムアウトの値は B<select>()  を呼ぶたびに初期化すべきである。 OS によって"
4962 "は timeout 構造体が変更される場合があるからである。 但し、 B<pselect>()  は自"
4963 "分の timeout 構造体を変更することはない。"
4964
4965 #. type: TP
4966 #: build/C/man2/select_tut.2:448
4967 #, no-wrap
4968 msgid "11."
4969 msgstr "11."
4970
4971 #.  "I have heard" does not fill me with confidence, and doesn't
4972 #.  belong in a man page, so I've commented this point out.
4973 #.  .TP
4974 #.  11.
4975 #.  I have heard that the Windows socket layer does not cope with OOB data
4976 #.  properly.
4977 #.  It also does not cope with
4978 #.  .BR select ()
4979 #.  calls when no file descriptors are set at all.
4980 #.  Having no file descriptors set is a useful
4981 #.  way to sleep the process with subsecond precision by using the timeout.
4982 #.  (See further on.)
4983 #. type: Plain text
4984 #: build/C/man2/select_tut.2:467
4985 msgid ""
4986 "Since B<select>()  modifies its file descriptor sets, if the call is being "
4987 "used in a loop, then the sets must be reinitialized before each call."
4988 msgstr ""
4989 "B<select>()  はファイルディスクリプタ集合を変更するので、 B<select>()  がルー"
4990 "プの中で使用されている場合には、呼び出しを行う前に毎回 ディスクリプタ集合を初"
4991 "期化し直さなければならない。"
4992
4993 #. type: SS
4994 #: build/C/man2/select_tut.2:467
4995 #, no-wrap
4996 msgid "Usleep Emulation"
4997 msgstr "usleep エミュレーション"
4998
4999 #. type: Plain text
5000 #: build/C/man2/select_tut.2:474
5001 msgid ""
5002 "On systems that do not have a B<usleep>(3)  function, you can call B<select>"
5003 "()  with a finite timeout and no file descriptors as follows:"
5004 msgstr ""
5005 "B<usleep>(3)  関数を持たないシステムでは、 有限のタイムアウトを指定し、ファイ"
5006 "ルディスクリプタを全くセットせずに B<select>()  を呼び出すことで、これを代用"
5007 "できる。 以下のようにする。"
5008
5009 #. type: Plain text
5010 #: build/C/man2/select_tut.2:480
5011 #, no-wrap
5012 msgid ""
5013 "    struct timeval tv;\n"
5014 "    tv.tv_sec = 0;\n"
5015 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5016 "    select(0, NULL, NULL, NULL, &tv);\n"
5017 msgstr ""
5018 "    struct timeval tv;\n"
5019 "    tv.tv_sec = 0;\n"
5020 "    tv.tv_usec = 200000;  /* 0.2 seconds */\n"
5021 "    select(0, NULL, NULL, NULL, &tv);\n"
5022
5023 #. type: Plain text
5024 #: build/C/man2/select_tut.2:483
5025 msgid "This is only guaranteed to work on UNIX systems, however."
5026 msgstr "但し、これが動くと保証されているのは UNIX システムに限られる。"
5027
5028 #. type: Plain text
5029 #: build/C/man2/select_tut.2:488
5030 msgid ""
5031 "On success, B<select>()  returns the total number of file descriptors still "
5032 "present in the file descriptor sets."
5033 msgstr ""
5034 "成功すると、 B<select>()  はファイルディスクリプタ集合に残っている ファイル"
5035 "ディスクリプタの総数を返す。"
5036
5037 #. type: Plain text
5038 #: build/C/man2/select_tut.2:494
5039 msgid ""
5040 "If B<select>()  timed out, then the return value will be zero.  The file "
5041 "descriptors set should be all empty (but may not be on some systems)."
5042 msgstr ""
5043 "B<select>()  がタイムアウトすると、返り値は 0 になる。 その時、ファイルディス"
5044 "クリプタ集合はすべて空である (しかしそうならないシステムもある)。"
5045
5046 #. type: Plain text
5047 #: build/C/man2/select_tut.2:501
5048 msgid ""
5049 "A return value of -1 indicates an error, with I<errno> being set "
5050 "appropriately.  In the case of an error, the contents of the returned sets "
5051 "and the I<struct timeout> contents are undefined and should not be used.  "
5052 "B<pselect>()  however never modifies I<ntimeout>."
5053 msgstr ""
5054 "返り値が -1 の場合はエラーを意味し、 I<errno> が適切にセットされる。エラーが"
5055 "起こった場合、 返された集合の内容や構造体 I<struct timeout> の内容は 未定義と"
5056 "なっており、使用すべきではない。 しかし B<pselect>()  は決して I<ntimeout> を"
5057 "変更しない。"
5058
5059 #. type: Plain text
5060 #: build/C/man2/select_tut.2:510
5061 msgid ""
5062 "Generally speaking, all operating systems that support sockets also support "
5063 "B<select>().  B<select>()  can be used to solve many problems in a portable "
5064 "and efficient way that naive programmers try to solve in a more complicated "
5065 "manner using threads, forking, IPCs, signals, memory sharing, and so on."
5066 msgstr ""
5067 "一般的に言って、ソケットをサポートする全てのオペレーティングシステムは "
5068 "B<select>()  もサポートしている。 B<select>()  を使うと、プログラマがスレッ"
5069 "ド、フォーク、IPC、シグナル、メモリ共有、 等々を使ってもっと複雑な方法で解決"
5070 "しようとする多くの問題が、 移植性がありかつ効率的な方法で解決できる。"
5071
5072 #. type: Plain text
5073 #: build/C/man2/select_tut.2:519
5074 msgid ""
5075 "The B<poll>(2)  system call has the same functionality as B<select>(), and "
5076 "is somewhat more efficient when monitoring sparse file descriptor sets.  It "
5077 "is nowadays widely available, but historically was less portable than "
5078 "B<select>()."
5079 msgstr ""
5080 "B<poll>(2)  システムコールは B<select>()  と同じ機能を持っており、 まばらな"
5081 "ファイルディスクリプタ集合を監視する場合に いくらか効率がよい。 現在では広く"
5082 "利用可能であるが、以前は B<select>()  より移植性の面で劣っていた。"
5083
5084 #. type: Plain text
5085 #: build/C/man2/select_tut.2:527
5086 msgid ""
5087 "The Linux-specific B<epoll>(7)  API provides an interface that is more "
5088 "efficient than B<select>(2)  and B<poll>(2)  when monitoring large numbers "
5089 "of file descriptors."
5090 msgstr ""
5091 "Linux 独自の B<epoll>(7)  API は、多数のファイルディスクリプタを監視する場合"
5092 "に B<select>(2)  や B<poll>(2)  よりも効率的なインタフェースを提供している。"
5093
5094 #. type: Plain text
5095 #: build/C/man2/select_tut.2:532
5096 msgid ""
5097 "Here is an example that better demonstrates the true utility of B<select>"
5098 "().  The listing below is a TCP forwarding program that forwards from one "
5099 "TCP port to another."
5100 msgstr ""
5101 "B<select>()  の本当に便利な点を示す、よい例を紹介する。 以下のリストは、ある "
5102 "TCP ポートから別のポートへ転送を行う TCP フォワードプログラムである。"
5103
5104 #. type: Plain text
5105 #: build/C/man2/select_tut.2:545
5106 #, no-wrap
5107 msgid ""
5108 "#include E<lt>stdlib.hE<gt>\n"
5109 "#include E<lt>stdio.hE<gt>\n"
5110 "#include E<lt>unistd.hE<gt>\n"
5111 "#include E<lt>sys/time.hE<gt>\n"
5112 "#include E<lt>sys/types.hE<gt>\n"
5113 "#include E<lt>string.hE<gt>\n"
5114 "#include E<lt>signal.hE<gt>\n"
5115 "#include E<lt>sys/socket.hE<gt>\n"
5116 "#include E<lt>netinet/in.hE<gt>\n"
5117 "#include E<lt>arpa/inet.hE<gt>\n"
5118 "#include E<lt>errno.hE<gt>\n"
5119 msgstr ""
5120 "#include E<lt>stdlib.hE<gt>\n"
5121 "#include E<lt>stdio.hE<gt>\n"
5122 "#include E<lt>unistd.hE<gt>\n"
5123 "#include E<lt>sys/time.hE<gt>\n"
5124 "#include E<lt>sys/types.hE<gt>\n"
5125 "#include E<lt>string.hE<gt>\n"
5126 "#include E<lt>signal.hE<gt>\n"
5127 "#include E<lt>sys/socket.hE<gt>\n"
5128 "#include E<lt>netinet/in.hE<gt>\n"
5129 "#include E<lt>arpa/inet.hE<gt>\n"
5130 "#include E<lt>errno.hE<gt>\n"
5131
5132 #. type: Plain text
5133 #: build/C/man2/select_tut.2:547
5134 #, no-wrap
5135 msgid "static int forward_port;\n"
5136 msgstr "static int forward_port;\n"
5137
5138 #. type: Plain text
5139 #: build/C/man2/select_tut.2:550
5140 #, no-wrap
5141 msgid ""
5142 "#undef max\n"
5143 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5144 msgstr ""
5145 "#undef max\n"
5146 "#define max(x,y) ((x) E<gt> (y) ? (x) : (y))\n"
5147
5148 #. type: Plain text
5149 #: build/C/man2/select_tut.2:557
5150 #, no-wrap
5151 msgid ""
5152 "static int\n"
5153 "listen_socket(int listen_port)\n"
5154 "{\n"
5155 "    struct sockaddr_in a;\n"
5156 "    int s;\n"
5157 "    int yes;\n"
5158 msgstr ""
5159 "static int\n"
5160 "listen_socket(int listen_port)\n"
5161 "{\n"
5162 "    struct sockaddr_in a;\n"
5163 "    int s;\n"
5164 "    int yes;\n"
5165
5166 #. type: Plain text
5167 #: build/C/man2/select_tut.2:581
5168 #, no-wrap
5169 msgid ""
5170 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5171 "        perror(\"socket\");\n"
5172 "        return -1;\n"
5173 "    }\n"
5174 "    yes = 1;\n"
5175 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5176 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5177 "        perror(\"setsockopt\");\n"
5178 "        close(s);\n"
5179 "        return -1;\n"
5180 "    }\n"
5181 "    memset(&a, 0, sizeof(a));\n"
5182 "    a.sin_port = htons(listen_port);\n"
5183 "    a.sin_family = AF_INET;\n"
5184 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5185 "        perror(\"bind\");\n"
5186 "        close(s);\n"
5187 "        return -1;\n"
5188 "    }\n"
5189 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5190 "    listen(s, 10);\n"
5191 "    return s;\n"
5192 "}\n"
5193 msgstr ""
5194 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5195 "        perror(\"socket\");\n"
5196 "        return -1;\n"
5197 "    }\n"
5198 "    yes = 1;\n"
5199 "    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,\n"
5200 "            (char *) &yes, sizeof(yes)) == -1) {\n"
5201 "        perror(\"setsockopt\");\n"
5202 "        close(s);\n"
5203 "        return -1;\n"
5204 "    }\n"
5205 "    memset(&a, 0, sizeof(a));\n"
5206 "    a.sin_port = htons(listen_port);\n"
5207 "    a.sin_family = AF_INET;\n"
5208 "    if (bind(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5209 "        perror(\"bind\");\n"
5210 "        close(s);\n"
5211 "        return -1;\n"
5212 "    }\n"
5213 "    printf(\"accepting connections on port %d\\en\", listen_port);\n"
5214 "    listen(s, 10);\n"
5215 "    return s;\n"
5216 "}\n"
5217
5218 #. type: Plain text
5219 #: build/C/man2/select_tut.2:587
5220 #, no-wrap
5221 msgid ""
5222 "static int\n"
5223 "connect_socket(int connect_port, char *address)\n"
5224 "{\n"
5225 "    struct sockaddr_in a;\n"
5226 "    int s;\n"
5227 msgstr ""
5228 "static int\n"
5229 "connect_socket(int connect_port, char *address)\n"
5230 "{\n"
5231 "    struct sockaddr_in a;\n"
5232 "    int s;\n"
5233
5234 #. type: Plain text
5235 #: build/C/man2/select_tut.2:593
5236 #, no-wrap
5237 msgid ""
5238 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5239 "        perror(\"socket\");\n"
5240 "        close(s);\n"
5241 "        return -1;\n"
5242 "    }\n"
5243 msgstr ""
5244 "    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n"
5245 "        perror(\"socket\");\n"
5246 "        close(s);\n"
5247 "        return -1;\n"
5248 "    }\n"
5249
5250 #. type: Plain text
5251 #: build/C/man2/select_tut.2:597
5252 #, no-wrap
5253 msgid ""
5254 "    memset(&a, 0, sizeof(a));\n"
5255 "    a.sin_port = htons(connect_port);\n"
5256 "    a.sin_family = AF_INET;\n"
5257 msgstr ""
5258 "    memset(&a, 0, sizeof(a));\n"
5259 "    a.sin_port = htons(connect_port);\n"
5260 "    a.sin_family = AF_INET;\n"
5261
5262 #. type: Plain text
5263 #: build/C/man2/select_tut.2:603
5264 #, no-wrap
5265 msgid ""
5266 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5267 "        perror(\"bad IP address format\");\n"
5268 "        close(s);\n"
5269 "        return -1;\n"
5270 "    }\n"
5271 msgstr ""
5272 "    if (!inet_aton(address, (struct in_addr *) &a.sin_addr.s_addr)) {\n"
5273 "        perror(\"bad IP address format\");\n"
5274 "        close(s);\n"
5275 "        return -1;\n"
5276 "    }\n"
5277
5278 #. type: Plain text
5279 #: build/C/man2/select_tut.2:612
5280 #, no-wrap
5281 msgid ""
5282 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5283 "        perror(\"connect()\");\n"
5284 "        shutdown(s, SHUT_RDWR);\n"
5285 "        close(s);\n"
5286 "        return -1;\n"
5287 "    }\n"
5288 "    return s;\n"
5289 "}\n"
5290 msgstr ""
5291 "    if (connect(s, (struct sockaddr *) &a, sizeof(a)) == -1) {\n"
5292 "        perror(\"connect()\");\n"
5293 "        shutdown(s, SHUT_RDWR);\n"
5294 "        close(s);\n"
5295 "        return -1;\n"
5296 "    }\n"
5297 "    return s;\n"
5298 "}\n"
5299
5300 #. type: Plain text
5301 #: build/C/man2/select_tut.2:620
5302 #, no-wrap
5303 msgid ""
5304 "#define SHUT_FD1 do {                                \\e\n"
5305 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5306 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5307 "                         close(fd1);                 \\e\n"
5308 "                         fd1 = -1;                   \\e\n"
5309 "                     }                               \\e\n"
5310 "                 } while (0)\n"
5311 msgstr ""
5312 "#define SHUT_FD1 do {                                \\e\n"
5313 "                     if (fd1 E<gt>= 0) {                 \\e\n"
5314 "                         shutdown(fd1, SHUT_RDWR);   \\e\n"
5315 "                         close(fd1);                 \\e\n"
5316 "                         fd1 = -1;                   \\e\n"
5317 "                     }                               \\e\n"
5318 "                 } while (0)\n"
5319
5320 #. type: Plain text
5321 #: build/C/man2/select_tut.2:628
5322 #, no-wrap
5323 msgid ""
5324 "#define SHUT_FD2 do {                                \\e\n"
5325 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5326 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5327 "                         close(fd2);                 \\e\n"
5328 "                         fd2 = -1;                   \\e\n"
5329 "                     }                               \\e\n"
5330 "                 } while (0)\n"
5331 msgstr ""
5332 "#define SHUT_FD2 do {                                \\e\n"
5333 "                     if (fd2 E<gt>= 0) {                 \\e\n"
5334 "                         shutdown(fd2, SHUT_RDWR);   \\e\n"
5335 "                         close(fd2);                 \\e\n"
5336 "                         fd2 = -1;                   \\e\n"
5337 "                     }                               \\e\n"
5338 "                 } while (0)\n"
5339
5340 #. type: Plain text
5341 #: build/C/man2/select_tut.2:630
5342 #, no-wrap
5343 msgid "#define BUF_SIZE 1024\n"
5344 msgstr "#define BUF_SIZE 1024\n"
5345
5346 #. type: Plain text
5347 #: build/C/man2/select_tut.2:639
5348 #, no-wrap
5349 msgid ""
5350 "int\n"
5351 "main(int argc, char *argv[])\n"
5352 "{\n"
5353 "    int h;\n"
5354 "    int fd1 = -1, fd2 = -1;\n"
5355 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5356 "    int buf1_avail, buf1_written;\n"
5357 "    int buf2_avail, buf2_written;\n"
5358 msgstr ""
5359 "int\n"
5360 "main(int argc, char *argv[])\n"
5361 "{\n"
5362 "    int h;\n"
5363 "    int fd1 = -1, fd2 = -1;\n"
5364 "    char buf1[BUF_SIZE], buf2[BUF_SIZE];\n"
5365 "    int buf1_avail, buf1_written;\n"
5366 "    int buf2_avail, buf2_written;\n"
5367
5368 #. type: Plain text
5369 #: build/C/man2/select_tut.2:645
5370 #, no-wrap
5371 msgid ""
5372 "    if (argc != 4) {\n"
5373 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5374 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5375 "        exit(EXIT_FAILURE);\n"
5376 "    }\n"
5377 msgstr ""
5378 "    if (argc != 4) {\n"
5379 "        fprintf(stderr, \"Usage\\en\\etfwd E<lt>listen-portE<gt> \"\n"
5380 "                 \"E<lt>forward-to-portE<gt> E<lt>forward-to-ip-addressE<gt>\\en\");\n"
5381 "        exit(EXIT_FAILURE);\n"
5382 "    }\n"
5383
5384 #. type: Plain text
5385 #: build/C/man2/select_tut.2:647
5386 #, no-wrap
5387 msgid "    signal(SIGPIPE, SIG_IGN);\n"
5388 msgstr "    signal(SIGPIPE, SIG_IGN);\n"
5389
5390 #. type: Plain text
5391 #: build/C/man2/select_tut.2:649
5392 #, no-wrap
5393 msgid "    forward_port = atoi(argv[2]);\n"
5394 msgstr "    forward_port = atoi(argv[2]);\n"
5395
5396 #. type: Plain text
5397 #: build/C/man2/select_tut.2:653
5398 #, no-wrap
5399 msgid ""
5400 "    h = listen_socket(atoi(argv[1]));\n"
5401 "    if (h == -1)\n"
5402 "        exit(EXIT_FAILURE);\n"
5403 msgstr ""
5404 "    h = listen_socket(atoi(argv[1]));\n"
5405 "    if (h == -1)\n"
5406 "        exit(EXIT_FAILURE);\n"
5407
5408 #. type: Plain text
5409 #: build/C/man2/select_tut.2:657
5410 #, no-wrap
5411 msgid ""
5412 "    for (;;) {\n"
5413 "        int r, nfds = 0;\n"
5414 "        fd_set rd, wr, er;\n"
5415 msgstr ""
5416 "    for (;;) {\n"
5417 "        int r, nfds = 0;\n"
5418 "        fd_set rd, wr, er;\n"
5419
5420 #. type: Plain text
5421 #: build/C/man2/select_tut.2:687
5422 #, no-wrap
5423 msgid ""
5424 "        FD_ZERO(&rd);\n"
5425 "        FD_ZERO(&wr);\n"
5426 "        FD_ZERO(&er);\n"
5427 "        FD_SET(h, &rd);\n"
5428 "        nfds = max(nfds, h);\n"
5429 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5430 "            FD_SET(fd1, &rd);\n"
5431 "            nfds = max(nfds, fd1);\n"
5432 "        }\n"
5433 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5434 "            FD_SET(fd2, &rd);\n"
5435 "            nfds = max(nfds, fd2);\n"
5436 "        }\n"
5437 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5438 "            FD_SET(fd1, &wr);\n"
5439 "            nfds = max(nfds, fd1);\n"
5440 "        }\n"
5441 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5442 "            FD_SET(fd2, &wr);\n"
5443 "            nfds = max(nfds, fd2);\n"
5444 "        }\n"
5445 "        if (fd1 E<gt> 0) {\n"
5446 "            FD_SET(fd1, &er);\n"
5447 "            nfds = max(nfds, fd1);\n"
5448 "        }\n"
5449 "        if (fd2 E<gt> 0) {\n"
5450 "            FD_SET(fd2, &er);\n"
5451 "            nfds = max(nfds, fd2);\n"
5452 "        }\n"
5453 msgstr ""
5454 "        FD_ZERO(&rd);\n"
5455 "        FD_ZERO(&wr);\n"
5456 "        FD_ZERO(&er);\n"
5457 "        FD_SET(h, &rd);\n"
5458 "        nfds = max(nfds, h);\n"
5459 "        if (fd1 E<gt> 0 && buf1_avail E<lt> BUF_SIZE) {\n"
5460 "            FD_SET(fd1, &rd);\n"
5461 "            nfds = max(nfds, fd1);\n"
5462 "        }\n"
5463 "        if (fd2 E<gt> 0 && buf2_avail E<lt> BUF_SIZE) {\n"
5464 "            FD_SET(fd2, &rd);\n"
5465 "            nfds = max(nfds, fd2);\n"
5466 "        }\n"
5467 "        if (fd1 E<gt> 0 && buf2_avail - buf2_written E<gt> 0) {\n"
5468 "            FD_SET(fd1, &wr);\n"
5469 "            nfds = max(nfds, fd1);\n"
5470 "        }\n"
5471 "        if (fd2 E<gt> 0 && buf1_avail - buf1_written E<gt> 0) {\n"
5472 "            FD_SET(fd2, &wr);\n"
5473 "            nfds = max(nfds, fd2);\n"
5474 "        }\n"
5475 "        if (fd1 E<gt> 0) {\n"
5476 "            FD_SET(fd1, &er);\n"
5477 "            nfds = max(nfds, fd1);\n"
5478 "        }\n"
5479 "        if (fd2 E<gt> 0) {\n"
5480 "            FD_SET(fd2, &er);\n"
5481 "            nfds = max(nfds, fd2);\n"
5482 "        }\n"
5483
5484 #. type: Plain text
5485 #: build/C/man2/select_tut.2:689
5486 #, no-wrap
5487 msgid "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5488 msgstr "        r = select(nfds + 1, &rd, &wr, &er, NULL);\n"
5489
5490 #. type: Plain text
5491 #: build/C/man2/select_tut.2:692
5492 #, no-wrap
5493 msgid ""
5494 "        if (r == -1 && errno == EINTR)\n"
5495 "            continue;\n"
5496 msgstr ""
5497 "        if (r == -1 && errno == EINTR)\n"
5498 "            continue;\n"
5499
5500 #. type: Plain text
5501 #: build/C/man2/select_tut.2:697
5502 #, no-wrap
5503 msgid ""
5504 "        if (r == -1) {\n"
5505 "            perror(\"select()\");\n"
5506 "            exit(EXIT_FAILURE);\n"
5507 "        }\n"
5508 msgstr ""
5509 "        if (r == -1) {\n"
5510 "            perror(\"select()\");\n"
5511 "            exit(EXIT_FAILURE);\n"
5512 "        }\n"
5513
5514 #. type: Plain text
5515 #: build/C/man2/select_tut.2:701
5516 #, no-wrap
5517 msgid ""
5518 "        if (FD_ISSET(h, &rd)) {\n"
5519 "            unsigned int l;\n"
5520 "            struct sockaddr_in client_address;\n"
5521 msgstr ""
5522 "        if (FD_ISSET(h, &rd)) {\n"
5523 "            unsigned int l;\n"
5524 "            struct sockaddr_in client_address;\n"
5525
5526 #. type: Plain text
5527 #: build/C/man2/select_tut.2:720
5528 #, no-wrap
5529 msgid ""
5530 "            memset(&client_address, 0, l = sizeof(client_address));\n"
5531 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5532 "            if (r == -1) {\n"
5533 "                perror(\"accept()\");\n"
5534 "            } else {\n"
5535 "                SHUT_FD1;\n"
5536 "                SHUT_FD2;\n"
5537 "                buf1_avail = buf1_written = 0;\n"
5538 "                buf2_avail = buf2_written = 0;\n"
5539 "                fd1 = r;\n"
5540 "                fd2 = connect_socket(forward_port, argv[3]);\n"
5541 "                if (fd2 == -1)\n"
5542 "                    SHUT_FD1;\n"
5543 "                else\n"
5544 "                    printf(\"connect from %s\\en\",\n"
5545 "                            inet_ntoa(client_address.sin_addr));\n"
5546 "            }\n"
5547 "        }\n"
5548 msgstr ""
5549 "            memset(&client_address, 0, l = sizeof(client_address));\n"
5550 "            r = accept(h, (struct sockaddr *) &client_address, &l);\n"
5551 "            if (r == -1) {\n"
5552 "                perror(\"accept()\");\n"
5553 "            } else {\n"
5554 "                SHUT_FD1;\n"
5555 "                SHUT_FD2;\n"
5556 "                buf1_avail = buf1_written = 0;\n"
5557 "                buf2_avail = buf2_written = 0;\n"
5558 "                fd1 = r;\n"
5559 "                fd2 = connect_socket(forward_port, argv[3]);\n"
5560 "                if (fd2 == -1)\n"
5561 "                    SHUT_FD1;\n"
5562 "                else\n"
5563 "                    printf(\"connect from %s\\en\",\n"
5564 "                            inet_ntoa(client_address.sin_addr));\n"
5565 "            }\n"
5566 "        }\n"
5567
5568 #. type: Plain text
5569 #: build/C/man2/select_tut.2:722
5570 #, no-wrap
5571 msgid "        /* NB: read oob data before normal reads */\n"
5572 msgstr "        /* NB: read oob data before normal reads */\n"
5573
5574 #. type: Plain text
5575 #: build/C/man2/select_tut.2:726
5576 #, no-wrap
5577 msgid ""
5578 "        if (fd1 E<gt> 0)\n"
5579 "            if (FD_ISSET(fd1, &er)) {\n"
5580 "                char c;\n"
5581 msgstr ""
5582 "        if (fd1 E<gt> 0)\n"
5583 "            if (FD_ISSET(fd1, &er)) {\n"
5584 "                char c;\n"
5585
5586 #. type: Plain text
5587 #: build/C/man2/select_tut.2:736
5588 #, no-wrap
5589 msgid ""
5590 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
5591 "                if (r E<lt> 1)\n"
5592 "                    SHUT_FD1;\n"
5593 "                else\n"
5594 "                    send(fd2, &c, 1, MSG_OOB);\n"
5595 "            }\n"
5596 "        if (fd2 E<gt> 0)\n"
5597 "            if (FD_ISSET(fd2, &er)) {\n"
5598 "                char c;\n"
5599 msgstr ""
5600 "                r = recv(fd1, &c, 1, MSG_OOB);\n"
5601 "                if (r E<lt> 1)\n"
5602 "                    SHUT_FD1;\n"
5603 "                else\n"
5604 "                    send(fd2, &c, 1, MSG_OOB);\n"
5605 "            }\n"
5606 "        if (fd2 E<gt> 0)\n"
5607 "            if (FD_ISSET(fd2, &er)) {\n"
5608 "                char c;\n"
5609
5610 #. type: Plain text
5611 #: build/C/man2/select_tut.2:779
5612 #, no-wrap
5613 msgid ""
5614 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
5615 "                if (r E<lt> 1)\n"
5616 "                    SHUT_FD2;\n"
5617 "                else\n"
5618 "                    send(fd1, &c, 1, MSG_OOB);\n"
5619 "            }\n"
5620 "        if (fd1 E<gt> 0)\n"
5621 "            if (FD_ISSET(fd1, &rd)) {\n"
5622 "                r = read(fd1, buf1 + buf1_avail,\n"
5623 "                          BUF_SIZE - buf1_avail);\n"
5624 "                if (r E<lt> 1)\n"
5625 "                    SHUT_FD1;\n"
5626 "                else\n"
5627 "                    buf1_avail += r;\n"
5628 "            }\n"
5629 "        if (fd2 E<gt> 0)\n"
5630 "            if (FD_ISSET(fd2, &rd)) {\n"
5631 "                r = read(fd2, buf2 + buf2_avail,\n"
5632 "                          BUF_SIZE - buf2_avail);\n"
5633 "                if (r E<lt> 1)\n"
5634 "                    SHUT_FD2;\n"
5635 "                else\n"
5636 "                    buf2_avail += r;\n"
5637 "            }\n"
5638 "        if (fd1 E<gt> 0)\n"
5639 "            if (FD_ISSET(fd1, &wr)) {\n"
5640 "                r = write(fd1, buf2 + buf2_written,\n"
5641 "                           buf2_avail - buf2_written);\n"
5642 "                if (r E<lt> 1)\n"
5643 "                    SHUT_FD1;\n"
5644 "                else\n"
5645 "                    buf2_written += r;\n"
5646 "            }\n"
5647 "        if (fd2 E<gt> 0)\n"
5648 "            if (FD_ISSET(fd2, &wr)) {\n"
5649 "                r = write(fd2, buf1 + buf1_written,\n"
5650 "                           buf1_avail - buf1_written);\n"
5651 "                if (r E<lt> 1)\n"
5652 "                    SHUT_FD2;\n"
5653 "                else\n"
5654 "                    buf1_written += r;\n"
5655 "            }\n"
5656 msgstr ""
5657 "                r = recv(fd2, &c, 1, MSG_OOB);\n"
5658 "                if (r E<lt> 1)\n"
5659 "                    SHUT_FD2;\n"
5660 "                else\n"
5661 "                    send(fd1, &c, 1, MSG_OOB);\n"
5662 "            }\n"
5663 "        if (fd1 E<gt> 0)\n"
5664 "            if (FD_ISSET(fd1, &rd)) {\n"
5665 "                r = read(fd1, buf1 + buf1_avail,\n"
5666 "                          BUF_SIZE - buf1_avail);\n"
5667 "                if (r E<lt> 1)\n"
5668 "                    SHUT_FD1;\n"
5669 "                else\n"
5670 "                    buf1_avail += r;\n"
5671 "            }\n"
5672 "        if (fd2 E<gt> 0)\n"
5673 "            if (FD_ISSET(fd2, &rd)) {\n"
5674 "                r = read(fd2, buf2 + buf2_avail,\n"
5675 "                          BUF_SIZE - buf2_avail);\n"
5676 "                if (r E<lt> 1)\n"
5677 "                    SHUT_FD2;\n"
5678 "                else\n"
5679 "                    buf2_avail += r;\n"
5680 "            }\n"
5681 "        if (fd1 E<gt> 0)\n"
5682 "            if (FD_ISSET(fd1, &wr)) {\n"
5683 "                r = write(fd1, buf2 + buf2_written,\n"
5684 "                           buf2_avail - buf2_written);\n"
5685 "                if (r E<lt> 1)\n"
5686 "                    SHUT_FD1;\n"
5687 "                else\n"
5688 "                    buf2_written += r;\n"
5689 "            }\n"
5690 "        if (fd2 E<gt> 0)\n"
5691 "            if (FD_ISSET(fd2, &wr)) {\n"
5692 "                r = write(fd2, buf1 + buf1_written,\n"
5693 "                           buf1_avail - buf1_written);\n"
5694 "                if (r E<lt> 1)\n"
5695 "                    SHUT_FD2;\n"
5696 "                else\n"
5697 "                    buf1_written += r;\n"
5698 "            }\n"
5699
5700 #. type: Plain text
5701 #: build/C/man2/select_tut.2:781
5702 #, no-wrap
5703 msgid "        /* check if write data has caught read data */\n"
5704 msgstr "        /* check if write data has caught read data */\n"
5705
5706 #. type: Plain text
5707 #: build/C/man2/select_tut.2:786
5708 #, no-wrap
5709 msgid ""
5710 "        if (buf1_written == buf1_avail)\n"
5711 "            buf1_written = buf1_avail = 0;\n"
5712 "        if (buf2_written == buf2_avail)\n"
5713 "            buf2_written = buf2_avail = 0;\n"
5714 msgstr ""
5715 "        if (buf1_written == buf1_avail)\n"
5716 "            buf1_written = buf1_avail = 0;\n"
5717 "        if (buf2_written == buf2_avail)\n"
5718 "            buf2_written = buf2_avail = 0;\n"
5719
5720 #. type: Plain text
5721 #: build/C/man2/select_tut.2:789
5722 #, no-wrap
5723 msgid ""
5724 "        /* one side has closed the connection, keep\n"
5725 "           writing to the other side until empty */\n"
5726 msgstr ""
5727 "        /* one side has closed the connection, keep\n"
5728 "           writing to the other side until empty */\n"
5729
5730 #. type: Plain text
5731 #: build/C/man2/select_tut.2:797
5732 #, no-wrap
5733 msgid ""
5734 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5735 "            SHUT_FD2;\n"
5736 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5737 "            SHUT_FD1;\n"
5738 "    }\n"
5739 "    exit(EXIT_SUCCESS);\n"
5740 "}\n"
5741 msgstr ""
5742 "        if (fd1 E<lt> 0 && buf1_avail - buf1_written == 0)\n"
5743 "            SHUT_FD2;\n"
5744 "        if (fd2 E<lt> 0 && buf2_avail - buf2_written == 0)\n"
5745 "            SHUT_FD1;\n"
5746 "    }\n"
5747 "    exit(EXIT_SUCCESS);\n"
5748 "}\n"
5749
5750 #. type: Plain text
5751 #: build/C/man2/select_tut.2:811
5752 msgid ""
5753 "The above program properly forwards most kinds of TCP connections including "
5754 "OOB signal data transmitted by B<telnet> servers.  It handles the tricky "
5755 "problem of having data flow in both directions simultaneously.  You might "
5756 "think it more efficient to use a B<fork>(2)  call and devote a thread to "
5757 "each stream.  This becomes more tricky than you might suspect.  Another idea "
5758 "is to set nonblocking I/O using B<fcntl>(2).  This also has its problems "
5759 "because you end up using inefficient timeouts."
5760 msgstr ""
5761 "上記のプログラムは、ほとんどの種類の TCP 接続をフォワードする。 B<telnet> "
5762 "サーバによって中継される OOB シグナルデータも扱える。 このプログラムは、デー"
5763 "タフローを双方向に同時に送るという、 ややこしい問題も処理できる。 B<fork>"
5764 "(2)  コールを使って、各ストリームごとに専用のスレッドを用いるほうが効率的"
5765 "だ、 という人もいるかもしれない。しかし、これは考えているよりずっとややこし"
5766 "い。 あるいは、 B<fcntl>(2)  を使って非ブロック I/O をセットすれば良い、とい"
5767 "うアイデアもあるだろう。 これにも実際には問題があり、タイムアウトが非効率的に"
5768 "起こってしまう。"
5769
5770 #. type: Plain text
5771 #: build/C/man2/select_tut.2:817
5772 msgid ""
5773 "The program does not handle more than one simultaneous connection at a time, "
5774 "although it could easily be extended to do this with a linked list of buffers"
5775 "\\(emone for each connection.  At the moment, new connections cause the "
5776 "current connection to be dropped."
5777 msgstr ""
5778 "このプログラムは一度にひとつ以上の同時接続を扱うことはできないが、 その様に拡"
5779 "張するのは簡単で、バッファのリンクリストを (接続ごとにひとつずつ) 使えばよ"
5780 "い。 現時点のものでは、新しい接続がくると古い接続は落ちてしまう。"
5781
5782 #.  .SH AUTHORS
5783 #.  This man page was written by Paul Sheer.
5784 #. type: Plain text
5785 #: build/C/man2/select_tut.2:836
5786 msgid ""
5787 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5788 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5789 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5790 "(3), B<epoll>(7)"
5791 msgstr ""
5792 "B<accept>(2), B<connect>(2), B<ioctl>(2), B<poll>(2), B<read>(2), B<recv>"
5793 "(2), B<select>(2), B<send>(2), B<sigprocmask>(2), B<write>(2), B<sigaddset>"
5794 "(3), B<sigdelset>(3), B<sigemptyset>(3), B<sigfillset>(3), B<sigismember>"
5795 "(3), B<epoll>(7)"
5796
5797 #. type: TH
5798 #: build/C/man2/send.2:38
5799 #, no-wrap
5800 msgid "SEND"
5801 msgstr "SEND"
5802
5803 #. type: TH
5804 #: build/C/man2/send.2:38 build/C/man7/socket.7:26
5805 #, no-wrap
5806 msgid "2012-04-23"
5807 msgstr "2012-04-23"
5808
5809 #. type: Plain text
5810 #: build/C/man2/send.2:41
5811 msgid "send, sendto, sendmsg - send a message on a socket"
5812 msgstr "send, sendto, sendmsg - ソケットへメッセージを送る"
5813
5814 #. type: Plain text
5815 #: build/C/man2/send.2:45
5816 #, no-wrap
5817 msgid ""
5818 "B<#include E<lt>sys/types.hE<gt>>\n"
5819 "B<#include E<lt>sys/socket.hE<gt>>\n"
5820 msgstr ""
5821 "B<#include E<lt>sys/types.hE<gt>>\n"
5822 "B<#include E<lt>sys/socket.hE<gt>>\n"
5823
5824 #. type: Plain text
5825 #: build/C/man2/send.2:48
5826 #, no-wrap
5827 msgid "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5828 msgstr "B<ssize_t send(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
5829
5830 #. type: Plain text
5831 #: build/C/man2/send.2:52
5832 #, no-wrap
5833 msgid ""
5834 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5835 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5836 msgstr ""
5837 "B<ssize_t sendto(int >I<sockfd>B<, const void *>I<buf>B<, size_t >I<len>B<, int >I<flags>B<,>\n"
5838 "B<               const struct sockaddr *>I<dest_addr>B<, socklen_t >I<addrlen>B<);>\n"
5839
5840 #. type: Plain text
5841 #: build/C/man2/send.2:55
5842 #, no-wrap
5843 msgid "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5844 msgstr "B<ssize_t sendmsg(int >I<sockfd>B<, const struct msghdr *>I<msg>B<, int >I<flags>B<);>\n"
5845
5846 #. type: Plain text
5847 #: build/C/man2/send.2:63
5848 msgid ""
5849 "The system calls B<send>(), B<sendto>(), and B<sendmsg>()  are used to "
5850 "transmit a message to another socket."
5851 msgstr ""
5852 "システムコール B<send>(), B<sendto>(), B<sendmsg>()  は、もう一方のソケットへ"
5853 "メッセージを転送するのに使用される。"
5854
5855 #. type: Plain text
5856 #: build/C/man2/send.2:82
5857 msgid ""
5858 "The B<send>()  call may be used only when the socket is in a I<connected> "
5859 "state (so that the intended recipient is known).  The only difference "
5860 "between B<send>()  and B<write>(2)  is the presence of I<flags>.  With a "
5861 "zero I<flags> argument, B<send>()  is equivalent to B<write>(2).  Also, the "
5862 "following call"
5863 msgstr ""
5864 "B<send>()  は、ソケットが I<接続された (connected)> 状態にある場合にのみ使用"
5865 "できる (つまり、どの相手に送信するかは既知である)。 B<send>()  と B<write>"
5866 "(2)  の違いは、引き数に I<flags> があるかどうかだけである。 引き数 I<flags> "
5867 "にフラグが指定されない場合、 B<send>()  は B<write>(2)  と等価である。 また、"
5868
5869 #. type: Plain text
5870 #: build/C/man2/send.2:84
5871 #, no-wrap
5872 msgid "    send(sockfd, buf, len, flags);\n"
5873 msgstr "    send(sockfd, buf, len, flags);\n"
5874
5875 #. type: Plain text
5876 #: build/C/man2/send.2:86
5877 msgid "is equivalent to"
5878 msgstr "は以下と等価である。"
5879
5880 #. type: Plain text
5881 #: build/C/man2/send.2:88
5882 #, no-wrap
5883 msgid "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
5884 msgstr "    sendto(sockfd, buf, len, flags, NULL, 0);\n"
5885
5886 #. type: Plain text
5887 #: build/C/man2/send.2:92
5888 msgid "The argument I<sockfd> is the file descriptor of the sending socket."
5889 msgstr ""
5890 "引き数 I<sockfd> は、データを送信するパケットのファイル・ディスクリプタであ"
5891 "る。"
5892
5893 #. type: Plain text
5894 #: build/C/man2/send.2:120
5895 msgid ""
5896 "If B<sendto>()  is used on a connection-mode (B<SOCK_STREAM>, "
5897 "B<SOCK_SEQPACKET>)  socket, the arguments I<dest_addr> and I<addrlen> are "
5898 "ignored (and the error B<EISCONN> may be returned when they are not NULL and "
5899 "0), and the error B<ENOTCONN> is returned when the socket was not actually "
5900 "connected.  Otherwise, the address of the target is given by I<dest_addr> "
5901 "with I<addrlen> specifying its size.  For B<sendmsg>(), the address of the "
5902 "target is given by I<msg.msg_name>, with I<msg.msg_namelen> specifying its "
5903 "size."
5904 msgstr ""
5905 "B<sendto>()  は、接続型 (connection-mode) のソケット (B<SOCK_STREAM>, "
5906 "B<SOCK_SEQPACKET>)  で 使用された場合、引き数 I<dest_addr> と I<addrlen> は無"
5907 "視される (各々の引き数が NULL と 0 でない場合は B<EISCONN> エラーも返され"
5908 "る)。 また、ソケットが実際には接続されていなかった時には B<ENOTCONN> エラーが"
5909 "返される。 接続型のソケット以外で使用された場合は、接続先のアドレスは "
5910 "I<dest_addr> で与えられ、そのサイズは I<addrlen> で指定される。 B<sendmsg>"
5911 "()  では、接続先のアドレスは I<msg.msg_name> で与えられ、そのサイズは I<msg."
5912 "msg_namelen> で指定される。"
5913
5914 #. type: Plain text
5915 #: build/C/man2/send.2:136
5916 msgid ""
5917 "For B<send>()  and B<sendto>(), the message is found in I<buf> and has "
5918 "length I<len>.  For B<sendmsg>(), the message is pointed to by the elements "
5919 "of the array I<msg.msg_iov>.  The B<sendmsg>()  call also allows sending "
5920 "ancillary data (also known as control information)."
5921 msgstr ""
5922 "B<send>()  と B<sendto>()  では、メッセージは I<buf> に格納されており、その長"
5923 "さは I<len> であると解釈される。 B<sendmsg>()  では、メッセージは 配列 I<msg."
5924 "msg_iov> の各要素が指す位置に格納されている。 B<sendmsg>()  では、補助データ "
5925 "(制御情報とも呼ばれる) を送信することもできる。"
5926
5927 #. type: Plain text
5928 #: build/C/man2/send.2:141
5929 msgid ""
5930 "If the message is too long to pass atomically through the underlying "
5931 "protocol, the error B<EMSGSIZE> is returned, and the message is not "
5932 "transmitted."
5933 msgstr ""
5934 "メッセージ長が長過ぎるために、そのソケットが使用するプロトコルでは、 メッセー"
5935 "ジをソケットに渡されたままの形で送信することができない場合、 B<EMSGSIZE> エ"
5936 "ラーが返され、そのメッセージは転送されない。"
5937
5938 #. type: Plain text
5939 #: build/C/man2/send.2:145
5940 msgid ""
5941 "No indication of failure to deliver is implicit in a B<send>().  Locally "
5942 "detected errors are indicated by a return value of -1."
5943 msgstr ""
5944 "B<send>()  では、配送の失敗の通知は明示的に行われる。 ローカル側でエラーが検"
5945 "出された場合は、返り値 -1 として通知される。"
5946
5947 #. type: Plain text
5948 #: build/C/man2/send.2:158
5949 msgid ""
5950 "When the message does not fit into the send buffer of the socket, B<send>()  "
5951 "normally blocks, unless the socket has been placed in nonblocking I/O mode.  "
5952 "In nonblocking mode it would fail with the error B<EAGAIN> or B<EWOULDBLOCK> "
5953 "in this case.  The B<select>(2)  call may be used to determine when it is "
5954 "possible to send more data."
5955 msgstr ""
5956 "メッセージがソケットの送信バッファに入れることができない場合、 B<send>()  は"
5957 "通常は停止 (block) する (ソケットが非停止 (nonblocking) I/O モード でない場"
5958 "合)。非停止モードの場合にはエラー B<EAGAIN> か B<EWOULDBLOCK> で失敗する。 い"
5959 "つデータをさらに送信できるようになるかを知るために、 B<select>(2)  コールを使"
5960 "用することができる。"
5961
5962 #.  FIXME ? document MSG_PROXY (which went away in 2.3.15)
5963 #. type: Plain text
5964 #: build/C/man2/send.2:164
5965 msgid ""
5966 "The I<flags> argument is the bitwise OR of zero or more of the following "
5967 "flags."
5968 msgstr ""
5969 "I<flags> 引き数は、以下のフラグの (0 個以上の) ビット単位の論理和を とったも"
5970 "のを指定する。"
5971
5972 #. type: TP
5973 #: build/C/man2/send.2:164
5974 #, no-wrap
5975 msgid "B<MSG_CONFIRM> (Since Linux 2.3.15)"
5976 msgstr "B<MSG_CONFIRM> (Linux 2.3.15 以降)"
5977
5978 #. type: Plain text
5979 #: build/C/man2/send.2:178
5980 msgid ""
5981 "Tell the link layer that forward progress happened: you got a successful "
5982 "reply from the other side.  If the link layer doesn't get this it will "
5983 "regularly reprobe the neighbor (e.g., via a unicast ARP).  Only valid on "
5984 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets and currently only implemented for "
5985 "IPv4 and IPv6.  See B<arp>(7)  for details."
5986 msgstr ""
5987 "転送処理に進展があった、つまり相手側から成功の応答を受けたことをリンク層に 知"
5988 "らせる。リンク層がこの通知を受け取らなかった場合には、通常どおり (ユニキャス"
5989 "ト ARP を使うなどの方法で) 近傍 (neighbor) の再検索を行う。 B<SOCK_DGRAM> と "
5990 "B<SOCK_RAW> のソケットに対してのみ有効で、現在のところ IPv4 と IPv6 のみ実装"
5991 "されている。 詳しくは B<arp>(7)  参照のこと。"
5992
5993 #. type: TP
5994 #: build/C/man2/send.2:178
5995 #, no-wrap
5996 msgid "B<MSG_DONTROUTE>"
5997 msgstr "B<MSG_DONTROUTE>"
5998
5999 #. type: Plain text
6000 #: build/C/man2/send.2:186
6001 msgid ""
6002 "Don't use a gateway to send out the packet, only send to hosts on directly "
6003 "connected networks.  This is usually used only by diagnostic or routing "
6004 "programs.  This is only defined for protocol families that route; packet "
6005 "sockets don't."
6006 msgstr ""
6007 "パケットを送り出すのにゲートウェイを使用せず、 直接接続されているネットワーク"
6008 "上のホストだけに送る。 通常、このフラグは診断 (diagnostic) やルーティング・プ"
6009 "ログラムに よってのみ使用される。このフラグは、経路制御が行われるプロトコル"
6010 "ファミリー に対してのみ定義されている。パケットソケットには定義されていない。"
6011
6012 #. type: Plain text
6013 #: build/C/man2/send.2:197
6014 msgid ""
6015 "Enables nonblocking operation; if the operation would block, B<EAGAIN> or "
6016 "B<EWOULDBLOCK> is returned (this can also be enabled using the B<O_NONBLOCK> "
6017 "flag with the B<F_SETFL> B<fcntl>(2))."
6018 msgstr ""
6019 "非停止 (nonblocking) 操作を有効にする。操作が停止されるような場合には "
6020 "B<EAGAIN> か B<EWOULDBLOCK> を返すようにする (B<fcntl>(2)  の B<F_SETFL> で "
6021 "B<O_NONBLOCK> フラグを指定することによっても有効にできる)。"
6022
6023 #. type: TP
6024 #: build/C/man2/send.2:197
6025 #, no-wrap
6026 msgid "B<MSG_EOR> (since Linux 2.2)"
6027 msgstr "B<MSG_EOR> (Linux 2.2 以降)"
6028
6029 #. type: Plain text
6030 #: build/C/man2/send.2:201
6031 msgid ""
6032 "Terminates a record (when this notion is supported, as for sockets of type "
6033 "B<SOCK_SEQPACKET>)."
6034 msgstr ""
6035 "レコードの終了を指示する (B<SOCK_SEQPACKET> のようにこの概念に対応しているソ"
6036 "ケット種別のときに有効)。"
6037
6038 #. type: TP
6039 #: build/C/man2/send.2:201
6040 #, no-wrap
6041 msgid "B<MSG_MORE> (Since Linux 2.4.4)"
6042 msgstr "B<MSG_MORE> (Linux 2.4.4 以降)"
6043
6044 #. type: Plain text
6045 #: build/C/man2/send.2:210
6046 msgid ""
6047 "The caller has more data to send.  This flag is used with TCP sockets to "
6048 "obtain the same effect as the B<TCP_CORK> socket option (see B<tcp>(7)), "
6049 "with the difference that this flag can be set on a per-call basis."
6050 msgstr ""
6051 "呼び出し元にさらに送るデータがあることを示す。 このフラグは TCP ソケットとと"
6052 "もに使用され、 B<TCP_CORK> ソケットオプションと同じ効果が得られる (B<tcp>"
6053 "(7)  を参照)。 B<TCP_CORK> との違いは、このフラグを使うと呼び出し単位で この"
6054 "機能を有効にできる点である。"
6055
6056 #. type: Plain text
6057 #: build/C/man2/send.2:219
6058 msgid ""
6059 "Since Linux 2.6, this flag is also supported for UDP sockets, and informs "
6060 "the kernel to package all of the data sent in calls with this flag set into "
6061 "a single datagram which is only transmitted when a call is performed that "
6062 "does not specify this flag.  (See also the B<UDP_CORK> socket option "
6063 "described in B<udp>(7).)"
6064 msgstr ""
6065 "Linux 2.6 以降では、このフラグは UDP ソケットでもサポートされており、 このフ"
6066 "ラグ付きで送信された全てのデータを一つのデータグラムにまとめて 送信すること"
6067 "を、カーネルに知らせる。まとめられたデータグラムは、 このフラグを指定せずにこ"
6068 "のシステムコールが実行された際に初めて送信される (B<udp>(7)  に記載されている"
6069 "ソケットオプション B<UDP_CORK> も参照)。"
6070
6071 #. type: TP
6072 #: build/C/man2/send.2:219
6073 #, no-wrap
6074 msgid "B<MSG_NOSIGNAL> (since Linux 2.2)"
6075 msgstr "B<MSG_NOSIGNAL> (Linux 2.2 以降)"
6076
6077 #. type: Plain text
6078 #: build/C/man2/send.2:228
6079 msgid ""
6080 "Requests not to send B<SIGPIPE> on errors on stream oriented sockets when "
6081 "the other end breaks the connection.  The B<EPIPE> error is still returned."
6082 msgstr ""
6083 "ストリーム指向のソケットで相手側が接続を切断した時に、エラーとして "
6084 "B<SIGPIPE> を送信しないように要求する。この場合でも B<EPIPE> は返される。"
6085
6086 #. type: Plain text
6087 #: build/C/man2/send.2:237
6088 msgid ""
6089 "Sends I<out-of-band> data on sockets that support this notion (e.g., of type "
6090 "B<SOCK_STREAM>); the underlying protocol must also support I<out-of-band> "
6091 "data."
6092 msgstr ""
6093 "I<帯域外 (out-of-band)> データをサポートするソケット (例えば "
6094 "B<SOCK_STREAM>)  で I<帯域外> データを送る。下位プロトコルも I<帯域外> データ"
6095 "をサポートしている必要がある。"
6096
6097 #. type: Plain text
6098 #: build/C/man2/send.2:244
6099 msgid ""
6100 "The definition of the I<msghdr> structure follows.  See B<recv>(2)  and "
6101 "below for an exact description of its fields."
6102 msgstr ""
6103 "I<msghdr> 構造体の内容は以下の通り。 各フィールドの正確な記述については "
6104 "B<recv>(2)  と以下の説明を参照すること。"
6105
6106 #.  Still to be documented:
6107 #.   Send file descriptors and user credentials using the
6108 #.   msg_control* fields.
6109 #.   The flags returned in msg_flags.
6110 #. type: Plain text
6111 #: build/C/man2/send.2:273
6112 msgid ""
6113 "You may send control information using the I<msg_control> and "
6114 "I<msg_controllen> members.  The maximum control buffer length the kernel can "
6115 "process is limited per socket by the value in I</proc/sys/net/core/"
6116 "optmem_max>; see B<socket>(7)."
6117 msgstr ""
6118 "I<msg_control> と I<msg_controllen> メンバーを使用して制御情報を送信すること"
6119 "ができる。 カーネルが処理できる制御バッファのソケットあたりの最大長は、 I</"
6120 "proc/sys/net/core/optmem_max> の値に制限されている。 B<socket>(7)  を参照。"
6121
6122 #. type: Plain text
6123 #: build/C/man2/send.2:278
6124 msgid ""
6125 "On success, these calls return the number of characters sent.  On error, -1 "
6126 "is returned, and I<errno> is set appropriately."
6127 msgstr ""
6128 "成功した場合、これらのシステムコールは送信されたバイト数を返す。 エラーの場"
6129 "合、 -1 を返し、 I<errno> を適切に設定にする。"
6130
6131 #. type: Plain text
6132 #: build/C/man2/send.2:283
6133 msgid ""
6134 "These are some standard errors generated by the socket layer.  Additional "
6135 "errors may be generated and returned from the underlying protocol modules; "
6136 "see their respective manual pages."
6137 msgstr ""
6138 "これらはソケット層で発生する一般的なエラーである。これ以外に、下層の プロトコ"
6139 "ル・モジュールで生成されたエラーが返されるかもしれない。 これらについては、そ"
6140 "れぞれのマニュアルを参照すること。"
6141
6142 #. type: Plain text
6143 #: build/C/man2/send.2:291
6144 msgid ""
6145 "(For UNIX domain sockets, which are identified by pathname)  Write "
6146 "permission is denied on the destination socket file, or search permission is "
6147 "denied for one of the directories the path prefix.  (See B<path_resolution>"
6148 "(7).)"
6149 msgstr ""
6150 "(UNIX ドメインソケットの場合; パス名で識別される。)\n"
6151 "\n"
6152 "ソケット・ファイルへの書き込み許可がなかったか、パス名へ到達するまでの\n"
6153 "ディレクトリのいずれかに対する検索許可がなかった。\n"
6154 "(B<path_resolution>(7) も参照のこと)"
6155
6156 #. type: Plain text
6157 #: build/C/man2/send.2:294
6158 msgid ""
6159 "(For UDP sockets) An attempt was made to send to a network/broadcast address "
6160 "as though it was a unicast address."
6161 msgstr ""
6162 "(UDP ソケットの場合) ユニキャストアドレスであるかのように、\n"
6163 "ネットワークアドレスやブロードキャストアドレスへの送信が試みられた。"
6164
6165 #.  Actually EAGAIN on Linux
6166 #. type: Plain text
6167 #: build/C/man2/send.2:302
6168 msgid ""
6169 "The socket is marked nonblocking and the requested operation would block.  "
6170 "POSIX.1-2001 allows either error to be returned for this case, and does not "
6171 "require these constants to have the same value, so a portable application "
6172 "should check for both possibilities."
6173 msgstr ""
6174 "ソケットが非停止に設定されており、 要求された操作が停止した。 POSIX.1-2001 "
6175 "は、この場合にどちらのエラーを返すことも認めており、 これら 2 つの定数が同じ"
6176 "値を持つことも求めていない。 したがって、移植性が必要なアプリケーションでは、"
6177 "両方の可能性を 確認すべきである。"
6178
6179 #. type: Plain text
6180 #: build/C/man2/send.2:305
6181 msgid "An invalid descriptor was specified."
6182 msgstr "無効なディスクリプターが指定された。"
6183
6184 #. type: TP
6185 #: build/C/man2/send.2:305
6186 #, no-wrap
6187 msgid "B<ECONNRESET>"
6188 msgstr "B<ECONNRESET>"
6189
6190 #. type: Plain text
6191 #: build/C/man2/send.2:308
6192 msgid "Connection reset by peer."
6193 msgstr "接続が接続相手によりリセットされた。"
6194
6195 #. type: TP
6196 #: build/C/man2/send.2:308
6197 #, no-wrap
6198 msgid "B<EDESTADDRREQ>"
6199 msgstr "B<EDESTADDRREQ>"
6200
6201 #. type: Plain text
6202 #: build/C/man2/send.2:311
6203 msgid "The socket is not connection-mode, and no peer address is set."
6204 msgstr ""
6205 "ソケットが接続型 (connection-mode) ではなく、 かつ送信先のアドレスが設定され"
6206 "ていない。"
6207
6208 #. type: Plain text
6209 #: build/C/man2/send.2:314
6210 msgid "An invalid user space address was specified for an argument."
6211 msgstr "ユーザー空間として不正なアドレスがパラメーターとして指定された。"
6212
6213 #. type: Plain text
6214 #: build/C/man2/send.2:318
6215 msgid "A signal occurred before any data was transmitted; see B<signal>(7)."
6216 msgstr "データが送信される前に、シグナルが発生した。 B<signal>(7)  参照。"
6217
6218 #. type: Plain text
6219 #: build/C/man2/send.2:327
6220 msgid ""
6221 "The connection-mode socket was connected already but a recipient was "
6222 "specified.  (Now either this error is returned, or the recipient "
6223 "specification is ignored.)"
6224 msgstr ""
6225 "接続型ソケットの接続がすでに確立していたが、受信者が指定されていた。 (現在の"
6226 "ところ、この状況では、このエラーが返されるか、 受信者の指定が無視されるか、の"
6227 "いずれかとなる)"
6228
6229 #. type: TP
6230 #: build/C/man2/send.2:327
6231 #, no-wrap
6232 msgid "B<EMSGSIZE>"
6233 msgstr "B<EMSGSIZE>"
6234
6235 #.  (e.g., SOCK_DGRAM )
6236 #. type: Plain text
6237 #: build/C/man2/send.2:333
6238 msgid ""
6239 "The socket type requires that message be sent atomically, and the size of "
6240 "the message to be sent made this impossible."
6241 msgstr ""
6242 "そのソケット種別 ではソケットに渡されたままの形でメッセージを送信する必要があ"
6243 "るが、 メッセージが大き過ぎるため送信することができない。"
6244
6245 #. type: Plain text
6246 #: build/C/man2/send.2:341
6247 msgid ""
6248 "The output queue for a network interface was full.  This generally indicates "
6249 "that the interface has stopped sending, but may be caused by transient "
6250 "congestion.  (Normally, this does not occur in Linux.  Packets are just "
6251 "silently dropped when a device queue overflows.)"
6252 msgstr ""
6253 "ネットワーク・インターフェースの出力キューが一杯である。 一般的には、一時的な"
6254 "輻輳 (congestion) のためにインターフェースが 送信を止めていることを意味す"
6255 "る。 (通常、Linux ではこのようなことは起こらない。デバイスのキューが オーバー"
6256 "フローした場合にはパケットは黙って捨てられる)"
6257
6258 #. type: Plain text
6259 #: build/C/man2/send.2:344
6260 msgid "No memory available."
6261 msgstr "メモリが足りない。"
6262
6263 #. type: Plain text
6264 #: build/C/man2/send.2:347
6265 msgid "The socket is not connected, and no target has been given."
6266 msgstr "ソケットが接続されておらず、接続先も指定されていない。"
6267
6268 #. type: Plain text
6269 #: build/C/man2/send.2:357
6270 msgid "Some bit in the I<flags> argument is inappropriate for the socket type."
6271 msgstr ""
6272 "引き数 I<flags> のいくつかのビットが、そのソケット種別では不適切なものであ"
6273 "る。"
6274
6275 #. type: TP
6276 #: build/C/man2/send.2:357
6277 #, no-wrap
6278 msgid "B<EPIPE>"
6279 msgstr "B<EPIPE>"
6280
6281 #. type: Plain text
6282 #: build/C/man2/send.2:366
6283 msgid ""
6284 "The local end has been shut down on a connection oriented socket.  In this "
6285 "case the process will also receive a B<SIGPIPE> unless B<MSG_NOSIGNAL> is "
6286 "set."
6287 msgstr ""
6288 "接続指向のソケットでローカル側が閉じられている。 この場合、 B<MSG_NOSIGNAL> "
6289 "が設定されていなければ、プロセスには B<SIGPIPE> も同時に送られる。"
6290
6291 #. type: Plain text
6292 #: build/C/man2/send.2:369
6293 msgid "4.4BSD, SVr4, POSIX.1-2001.  These function calls appeared in 4.2BSD."
6294 msgstr ""
6295 "4.4BSD, SVr4, POSIX.1-2001.  (これらの関数コールは 4.2BSD で最初に登場した)。"
6296
6297 #. type: Plain text
6298 #: build/C/man2/send.2:380
6299 msgid ""
6300 "POSIX.1-2001 only describes the B<MSG_OOB> and B<MSG_EOR> flags.  "
6301 "POSIX.1-2008 adds a specification of B<MSG_NOSIGNAL>.  The B<MSG_CONFIRM> "
6302 "flag is a Linux extension."
6303 msgstr ""
6304 "POSIX.1-2001 には、 B<MSG_OOB> と B<MSG_EOR> フラグだけが記載されている。 "
6305 "POSIX.1-2008 では B<MSG_NOSIGNAL> が規格に追加されている。 B<MSG_CONFIRM> フ"
6306 "ラグは Linux での拡張である。"
6307
6308 #. type: Plain text
6309 #: build/C/man2/send.2:393
6310 msgid ""
6311 "The prototypes given above follow the Single UNIX Specification, as glibc2 "
6312 "also does; the I<flags> argument was I<int> in 4.x BSD, but I<unsigned int> "
6313 "in libc4 and libc5; the I<len> argument was I<int> in 4.x BSD and libc4, but "
6314 "I<size_t> in libc5; the I<addrlen> argument was I<int> in 4.x BSD and libc4 "
6315 "and libc5.  See also B<accept>(2)."
6316 msgstr ""
6317 "上記のプロトタイプは Single UNIX Specification に従っている。 glibc2 も同様で"
6318 "ある。 I<flags> 引き数は 4.x BSD では I<int> であり、 libc4 と libc5 では "
6319 "I<unsigned int> である。 I<len> 引き数は 4.x BSD と libc4 では I<int> であ"
6320 "り、 libc5 では I<size_t> である。 I<addrlen> 引き数は 4.x BSD と libc4 と "
6321 "libc5 では I<int> である。 B<accept>(2)  も参照すること。"
6322
6323 #. type: Plain text
6324 #: build/C/man2/send.2:412
6325 msgid ""
6326 "See B<sendmmsg(2)> for information about a Linux-specific system call that "
6327 "can be used to transmit multiple datagrams in a single call."
6328 msgstr ""
6329 "B<sendmmsg>(2)  には、一度の呼び出しでの複数のデータグラムの送信に使用でき"
6330 "る\n"
6331 "Linux 固有の システムコールに関する情報が書かれている。"
6332
6333 #. type: Plain text
6334 #: build/C/man2/send.2:417
6335 msgid "Linux may return B<EPIPE> instead of B<ENOTCONN>."
6336 msgstr "Linux は B<ENOTCONN> を返す状況で B<EPIPE> を返すことがある。"
6337
6338 #. type: Plain text
6339 #: build/C/man2/send.2:422
6340 msgid "An example of the use of B<sendto>()  is shown in B<getaddrinfo>(3)."
6341 msgstr "B<sendto>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
6342
6343 #. type: Plain text
6344 #: build/C/man2/send.2:437
6345 msgid ""
6346 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6347 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6348 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6349 msgstr ""
6350 "B<fcntl>(2), B<getsockopt>(2), B<recv>(2), B<select>(2), B<sendfile>(2), "
6351 "B<sendmmsg>(2), B<shutdown>(2), B<socket>(2), B<write>(2), B<cmsg>(3), B<ip>"
6352 "(7), B<socket>(7), B<tcp>(7), B<udp>(7)"
6353
6354 #. type: TH
6355 #: build/C/man2/sendmmsg.2:28
6356 #, no-wrap
6357 msgid "SENDMMSG"
6358 msgstr "SENDMMSG"
6359
6360 #. type: TH
6361 #: build/C/man2/sendmmsg.2:28
6362 #, no-wrap
6363 msgid "2012-02-27"
6364 msgstr "2012-02-27"
6365
6366 #. type: Plain text
6367 #: build/C/man2/sendmmsg.2:31
6368 msgid "sendmmsg - send multiple messages on a socket"
6369 msgstr ""
6370
6371 #. type: Plain text
6372 #: build/C/man2/sendmmsg.2:39
6373 #, no-wrap
6374 msgid ""
6375 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6376 "B<             unsigned int >I<flags>B<);>\n"
6377 msgstr ""
6378 "B<int sendmmsg(int >I<sockfd>B<, struct mmsghdr *>I<msgvec>B<, unsigned int >I<vlen>B<,>\n"
6379 "B<             unsigned int >I<flags>B<);>\n"
6380
6381 #.  See commit 228e548e602061b08ee8e8966f567c12aa079682
6382 #. type: Plain text
6383 #: build/C/man2/sendmmsg.2:49
6384 msgid ""
6385 "The B<sendmmsg>()  system call is an extension of B<sendmsg>(2)  that allows "
6386 "the caller to transmit multiple messages on a socket using a single system "
6387 "call.  (This has performance benefits for some applications.)"
6388 msgstr ""
6389
6390 #. type: Plain text
6391 #: build/C/man2/sendmmsg.2:54
6392 msgid ""
6393 "The I<sockfd> argument is the file descriptor of the socket on which data is "
6394 "to be transmitted."
6395 msgstr ""
6396
6397 #. type: Plain text
6398 #: build/C/man2/sendmmsg.2:75
6399 #, no-wrap
6400 msgid ""
6401 "struct mmsghdr {\n"
6402 "    struct msghdr msg_hdr;  /* Message header */\n"
6403 "    unsigned int  msg_len;  /* Number of bytes transmitted */\n"
6404 "};\n"
6405 msgstr ""
6406
6407 #. type: Plain text
6408 #: build/C/man2/sendmmsg.2:91
6409 msgid ""
6410 "The I<msg_hdr> field is a I<msghdr> structure, as described in B<sendmsg>"
6411 "(2).  The I<msg_len> field is used to return the number of bytes sent from "
6412 "the message in I<msg_hdr> (i.e., the same as the return value from a single "
6413 "B<sendmsg>(2)  call)."
6414 msgstr ""
6415
6416 #. type: Plain text
6417 #: build/C/man2/sendmmsg.2:97
6418 msgid ""
6419 "The I<flags> argument contains flags ORed together.  The flags are the same "
6420 "as for B<sendmsg>(2)."
6421 msgstr ""
6422
6423 #. type: Plain text
6424 #: build/C/man2/sendmmsg.2:107
6425 msgid ""
6426 "A blocking B<sendmmsg>()  call blocks until I<vlen> messages have been "
6427 "sent.  A nonblocking call sends as many messages as possible (up to the "
6428 "limit specified by I<vlen>)  and returns immediately."
6429 msgstr ""
6430
6431 #. type: Plain text
6432 #: build/C/man2/sendmmsg.2:119
6433 msgid ""
6434 "On return from B<sendmmsg>(), the I<msg_len> fields of successive elements "
6435 "of I<msgvec> are updated to contain the number of bytes transmitted from the "
6436 "corresponding I<msg_hdr>.  The return value of the call indicates the number "
6437 "of elements of I<msgvec> that have been updated."
6438 msgstr ""
6439
6440 #. type: Plain text
6441 #: build/C/man2/sendmmsg.2:129
6442 msgid ""
6443 "On success, B<sendmmsg>()  returns the number of messages sent from "
6444 "I<msgvec>; if this is less than I<vlen>, the caller can retry with a further "
6445 "B<sendmmsg>()  call to send the remaining messages."
6446 msgstr ""
6447
6448 #. type: Plain text
6449 #: build/C/man2/sendmmsg.2:133
6450 msgid "On error, -1 is returned, and I<errno> is set to indicate the error."
6451 msgstr ""
6452
6453 #
6454 #.  commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
6455 #.      ... only return an error if no datagrams could be sent.
6456 #.      If less than the requested number of messages were sent, the application
6457 #.      must retry starting at the first failed one and if the problem is
6458 #.      persistent the error will be returned.
6459 #.      This matches the behaviour of other syscalls like read/write - it
6460 #.      is not an error if less than the requested number of elements are sent.
6461 #. type: Plain text
6462 #: build/C/man2/sendmmsg.2:145
6463 msgid ""
6464 "Errors are as for B<sendmsg>(2).  An error is returned only if no datagrams "
6465 "could be sent."
6466 msgstr ""
6467
6468 #. type: Plain text
6469 #: build/C/man2/sendmmsg.2:150
6470 msgid ""
6471 "The B<sendmmsg>()  system call was added in Linux 3.0.  Support in glibc was "
6472 "added in version 2.14."
6473 msgstr ""
6474
6475 #. type: Plain text
6476 #: build/C/man2/sendmmsg.2:153
6477 msgid "B<sendmmsg>()  is Linux-specific."
6478 msgstr ""
6479
6480 #
6481 #
6482 #.  commit 98382f419f32d2c12d021943b87dea555677144b
6483 #.      net: Cap number of elements for sendmmsg
6484 #.      To limit the amount of time we can spend in sendmmsg, cap the
6485 #.      number of elements to UIO_MAXIOV (currently 1024).
6486 #.      For error handling an application using sendmmsg needs to retry at
6487 #.      the first unsent message, so capping is simpler and requires less
6488 #.      application logic than returning EINVAL.
6489 #. type: Plain text
6490 #: build/C/man2/sendmmsg.2:168
6491 msgid "The value specified in I<vlen> is capped to B<UIO_MAXIOV> (1024)."
6492 msgstr ""
6493
6494 #. type: Plain text
6495 #: build/C/man2/sendmmsg.2:173
6496 msgid "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
6497 msgstr "B<recvmmsg>(2), B<sendmsg>(2), B<socket>(2), B<socket>(7)"
6498
6499 #. type: TH
6500 #: build/C/man3/sockatmark.3:23
6501 #, no-wrap
6502 msgid "SOCKATMARK"
6503 msgstr "SOCKATMARK"
6504
6505 #. type: Plain text
6506 #: build/C/man3/sockatmark.3:26
6507 msgid "sockatmark - determine whether socket is at out-of-band mark"
6508 msgstr ""
6509 "sockatmark - どのソケットに帯域外 (out-of-band) マークが付けられているかを調"
6510 "べる"
6511
6512 #. type: Plain text
6513 #: build/C/man3/sockatmark.3:28 build/C/man2/socket.2:48
6514 #: build/C/man7/socket.7:31 build/C/man2/socketpair.2:47
6515 msgid "B<#include E<lt>sys/socket.hE<gt>>"
6516 msgstr "B<#include E<lt>sys/socket.hE<gt>>"
6517
6518 #. type: Plain text
6519 #: build/C/man3/sockatmark.3:30
6520 msgid "B<int sockatmark(int >I<sockfd>B<);>"
6521 msgstr "B<int sockatmark(int >I<sockfd>B<);>"
6522
6523 #. type: Plain text
6524 #: build/C/man3/sockatmark.3:39
6525 msgid ""
6526 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6527 "\\ 600"
6528 msgstr ""
6529 "B<sockatmark>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>="
6530 "\\ 600"
6531
6532 #. type: Plain text
6533 #: build/C/man3/sockatmark.3:49
6534 msgid ""
6535 "B<sockatmark>()  returns a value indicating whether or not the socket "
6536 "referred to by the file descriptor I<sockfd> is at the out-of-band mark.  If "
6537 "the socket is at the mark, then 1 is returned; if the socket is not at the "
6538 "mark, 0 is returned.  This function does not remove the out-of-band mark."
6539 msgstr ""
6540 "B<sockatmark>()  はファイルディスクリプタ I<sockfd> で参照されるソケットに帯"
6541 "域外マークが付けられているか否かを返す。 ソケットにマークが付けられている場合"
6542 "は、1 が返される。 ソケットにマークが付けられていない場合は、0 が返される。 "
6543 "この関数は帯域外マークを削除しない。"
6544
6545 #. type: Plain text
6546 #: build/C/man3/sockatmark.3:54
6547 msgid ""
6548 "A successful call to B<sockatmark>()  returns 1 if the socket is at the out-"
6549 "of-band mark, or 0 if it is not.  On error, -1 is returned and I<errno> is "
6550 "set to indicate the error."
6551 msgstr ""
6552 "B<sockatmark>()  の呼び出しが成功した場合、ソケットに帯域外マークが 付けられ"
6553 "ていれば 1 を返し、付けられていなければ 0 を返す。 エラーの場合は -1 が返さ"
6554 "れ、エラーを表す I<errno> が設定される。"
6555
6556 #. type: Plain text
6557 #: build/C/man3/sockatmark.3:59
6558 msgid "I<sockfd> is not a valid file descriptor."
6559 msgstr "I<sockfd> が有効なファイルディスクリプタでない。"
6560
6561 #.  POSIX.1 says ENOTTY for this case
6562 #. type: Plain text
6563 #: build/C/man3/sockatmark.3:66
6564 msgid ""
6565 "I<sockfd> is not a file descriptor to which B<sockatmark>()  can be applied."
6566 msgstr ""
6567 "I<sockfd> は B<sockatmark>()  が適用できないファイルディスクリプタである。"
6568
6569 #. type: Plain text
6570 #: build/C/man3/sockatmark.3:69
6571 msgid "B<sockatmark>()  was added to glibc in version 2.2.4."
6572 msgstr "B<sockatmark>()  は glibc バージョン 2.2.4 で追加された。"
6573
6574 #. type: Plain text
6575 #: build/C/man3/sockatmark.3:71
6576 msgid "POSIX.1-2001."
6577 msgstr "POSIX.1-2001."
6578
6579 #. type: Plain text
6580 #: build/C/man3/sockatmark.3:78
6581 msgid ""
6582 "If B<sockatmark>()  returns 1, then the out-of-band data can be read using "
6583 "the B<MSG_OOB> flag of B<recv>(2)."
6584 msgstr ""
6585 "B<sockatmark>()  が 1 を返す場合、帯域外データは B<MSG_OOB> を指定した "
6586 "B<recv>(2)  で読み込むことができる。"
6587
6588 #. type: Plain text
6589 #: build/C/man3/sockatmark.3:80
6590 msgid "Out-of-band data is only supported on some stream socket protocols."
6591 msgstr ""
6592 "帯域外データは、いくつかのストリームソケットプロトコルでしか サポートされてい"
6593 "ない。"
6594
6595 #. type: Plain text
6596 #: build/C/man3/sockatmark.3:85
6597 msgid ""
6598 "B<sockatmark>()  can safely be called from a handler for the B<SIGURG> "
6599 "signal."
6600 msgstr ""
6601 "B<sockatmark>()  は B<SIGURG> シグナルのハンドラから安全に呼び出すことができ"
6602 "る。"
6603
6604 #. type: Plain text
6605 #: build/C/man3/sockatmark.3:91
6606 msgid ""
6607 "B<sockatmark>()  is implemented using the B<SIOCATMARK> B<ioctl>(2)  "
6608 "operation."
6609 msgstr ""
6610 "B<sockatmark>()  は B<SIOCATMARK> B<ioctl>(2)  操作を使って実装されている。"
6611
6612 #. type: Plain text
6613 #: build/C/man3/sockatmark.3:95
6614 msgid "Prior to glibc 2.4, B<sockatmark>()  did not work."
6615 msgstr "glibc 2.4 より前のバージョンでは、 B<sockatmark>()  は動作しない。"
6616
6617 #. type: Plain text
6618 #: build/C/man3/sockatmark.3:100
6619 msgid ""
6620 "The following code can be used after receipt of a B<SIGURG> signal to read "
6621 "(and discard) all data up to the mark, and then read the byte of data at the "
6622 "mark:"
6623 msgstr ""
6624 "以下のコードは、 B<SIGURG> シグナルを受け取った後にマークまでの全てのデータを"
6625 "読み込んで (破棄し)、 マークされたデータのバイトを読み込むのに使用できる。"
6626
6627 #. type: Plain text
6628 #: build/C/man3/sockatmark.3:105
6629 #, no-wrap
6630 msgid ""
6631 "    char buf[BUF_LEN];\n"
6632 "    char oobdata;\n"
6633 "    int atmark, s;\n"
6634 msgstr ""
6635 "    char buf[BUF_LEN];\n"
6636 "    char oobdata;\n"
6637 "    int atmark, s;\n"
6638
6639 #. type: Plain text
6640 #: build/C/man3/sockatmark.3:112
6641 #, no-wrap
6642 msgid ""
6643 "    for (;;) {\n"
6644 "        atmark = sockatmark(sockfd);\n"
6645 "        if (atmark == -1) {\n"
6646 "            perror(\"sockatmark\");\n"
6647 "            break;\n"
6648 "        }\n"
6649 msgstr ""
6650 "    for (;;) {\n"
6651 "        atmark = sockatmark(sockfd);\n"
6652 "        if (atmark == -1) {\n"
6653 "            perror(\"sockatmark\");\n"
6654 "            break;\n"
6655 "        }\n"
6656
6657 #. type: Plain text
6658 #: build/C/man3/sockatmark.3:115
6659 #, no-wrap
6660 msgid ""
6661 "        if (atmark)\n"
6662 "            break;\n"
6663 msgstr ""
6664 "        if (atmark)\n"
6665 "            break;\n"
6666
6667 #. type: Plain text
6668 #: build/C/man3/sockatmark.3:122
6669 #, no-wrap
6670 msgid ""
6671 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6672 "        if (s == -1)\n"
6673 "            perror(\"read\");\n"
6674 "        if (s E<lt>= 0)\n"
6675 "            break;\n"
6676 "    }\n"
6677 msgstr ""
6678 "        s = read(sockfd, buf, BUF_LEN) E<lt>= 0);\n"
6679 "        if (s == -1)\n"
6680 "            perror(\"read\");\n"
6681 "        if (s E<lt>= 0)\n"
6682 "            break;\n"
6683 "    }\n"
6684
6685 #. type: Plain text
6686 #: build/C/man3/sockatmark.3:129
6687 #, no-wrap
6688 msgid ""
6689 "    if (atmark == 1) {\n"
6690 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6691 "            perror(\"recv\");\n"
6692 "            ...\n"
6693 "        }\n"
6694 "    }\n"
6695 msgstr ""
6696 "    if (atmark == 1) {\n"
6697 "        if (recv(sockfd, &oobdata, 1, MSG_OOB) == -1) {\n"
6698 "            perror(\"recv\");\n"
6699 "            ...\n"
6700 "        }\n"
6701 "    }\n"
6702
6703 #. type: Plain text
6704 #: build/C/man3/sockatmark.3:135
6705 msgid "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6706 msgstr "B<fcntl>(2), B<recv>(2), B<send>(2), B<tcp>(7)"
6707
6708 #. type: TH
6709 #: build/C/man2/socket.2:41 build/C/man7/socket.7:26
6710 #, no-wrap
6711 msgid "SOCKET"
6712 msgstr "SOCKET"
6713
6714 #. type: TH
6715 #: build/C/man2/socket.2:41
6716 #, no-wrap
6717 msgid "2009-01-19"
6718 msgstr "2009-01-19"
6719
6720 #. type: Plain text
6721 #: build/C/man2/socket.2:44
6722 msgid "socket - create an endpoint for communication"
6723 msgstr "socket - 通信のための端点(endpoint)を作成する"
6724
6725 #. type: Plain text
6726 #: build/C/man2/socket.2:46 build/C/man2/socketpair.2:45
6727 msgid "B<#include E<lt>sys/types.hE<gt>> /* See NOTES */"
6728 msgstr "B<#include E<lt>sys/types.hE<gt>> /* 「注意」参照 */"
6729
6730 #. type: Plain text
6731 #: build/C/man2/socket.2:50
6732 msgid "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6733 msgstr "B<int socket(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<);>"
6734
6735 #. type: Plain text
6736 #: build/C/man2/socket.2:53
6737 msgid ""
6738 "B<socket>()  creates an endpoint for communication and returns a descriptor."
6739 msgstr ""
6740 "B<socket>()  は通信のための端点(endpoint)を作成し、ディスクリプター"
6741 "(descriptor)を返す。"
6742
6743 #. type: Plain text
6744 #: build/C/man2/socket.2:61
6745 msgid ""
6746 "The I<domain> argument specifies a communication domain; this selects the "
6747 "protocol family which will be used for communication.  These families are "
6748 "defined in I<E<lt>sys/socket.hE<gt>>.  The currently understood formats "
6749 "include:"
6750 msgstr ""
6751 "I<domain> 引数は通信を行なうドメインを指定する; これはどの プロトコル・ファミ"
6752 "リ(protocol family)を通信に使用するかを指定する。 これらのファミリは "
6753 "I<E<lt>sys/socket.hE<gt>> に定義されている。 現在、理解できるフォーマットは以"
6754 "下の通り。"
6755
6756 #. type: tbl table
6757 #: build/C/man2/socket.2:64
6758 #, no-wrap
6759 msgid "Name:Purpose:Man page\n"
6760 msgstr "名前:目的:マニュアル\n"
6761
6762 #. type: tbl table
6763 #: build/C/man2/socket.2:65 build/C/man2/socket.2:72 build/C/man2/socket.2:77
6764 #: build/C/man2/socket.2:82 build/C/man2/socket.2:85 build/C/man2/socket.2:92
6765 #: build/C/man2/socket.2:97 build/C/man2/socket.2:102
6766 #: build/C/man2/socket.2:105 build/C/man2/socket.2:110
6767 #, no-wrap
6768 msgid "T{\n"
6769 msgstr "T{\n"
6770
6771 #. type: tbl table
6772 #: build/C/man2/socket.2:66
6773 #, no-wrap
6774 msgid "B<AF_UNIX>, B<AF_LOCAL>\n"
6775 msgstr "B<AF_UNIX>, B<AF_LOCAL>\n"
6776
6777 #. type: tbl table
6778 #: build/C/man2/socket.2:67 build/C/man2/socket.2:69 build/C/man2/socket.2:87
6779 #: build/C/man2/socket.2:89 build/C/man2/socket.2:99 build/C/man2/socket.2:112
6780 #: build/C/man2/socket.2:114 build/C/man7/socket.7:162
6781 #, no-wrap
6782 msgid "T}:T{\n"
6783 msgstr "T}:T{\n"
6784
6785 #. type: tbl table
6786 #: build/C/man2/socket.2:68
6787 #, no-wrap
6788 msgid "Local communication\n"
6789 msgstr "ローカル通信\n"
6790
6791 #. type: tbl table
6792 #: build/C/man2/socket.2:70
6793 #, no-wrap
6794 msgid "B<unix>(7)\n"
6795 msgstr "B<unix>(7)\n"
6796
6797 #. type: tbl table
6798 #: build/C/man2/socket.2:71 build/C/man2/socket.2:76 build/C/man2/socket.2:81
6799 #: build/C/man2/socket.2:91 build/C/man2/socket.2:96 build/C/man2/socket.2:109
6800 #: build/C/man2/socket.2:116 build/C/man7/socket.7:141
6801 #: build/C/man7/socket.7:145 build/C/man7/socket.7:148
6802 #: build/C/man7/socket.7:154 build/C/man7/socket.7:157
6803 #: build/C/man7/socket.7:166 build/C/man7/socket.7:173
6804 #, no-wrap
6805 msgid "T}\n"
6806 msgstr "T}\n"
6807
6808 #. type: tbl table
6809 #: build/C/man2/socket.2:73
6810 #, no-wrap
6811 msgid "B<AF_INET>\n"
6812 msgstr "B<AF_INET>\n"
6813
6814 #. type: tbl table
6815 #: build/C/man2/socket.2:74
6816 #, no-wrap
6817 msgid "T}:IPv4 Internet protocols:T{\n"
6818 msgstr "T}:IPv4 インターネット・プロトコル:T{\n"
6819
6820 #. type: tbl table
6821 #: build/C/man2/socket.2:75
6822 #, no-wrap
6823 msgid "B<ip>(7)\n"
6824 msgstr "B<ip>(7)\n"
6825
6826 #. type: tbl table
6827 #: build/C/man2/socket.2:78
6828 #, no-wrap
6829 msgid "B<AF_INET6>\n"
6830 msgstr "B<AF_INET6>\n"
6831
6832 #. type: tbl table
6833 #: build/C/man2/socket.2:79
6834 #, no-wrap
6835 msgid "T}:IPv6 Internet protocols:T{\n"
6836 msgstr "T}:IPv6 インターネット・プロトコル:T{\n"
6837
6838 #. type: tbl table
6839 #: build/C/man2/socket.2:80
6840 #, no-wrap
6841 msgid "B<ipv6>(7)\n"
6842 msgstr "B<ipv6>(7)\n"
6843
6844 #. type: tbl table
6845 #: build/C/man2/socket.2:83
6846 #, no-wrap
6847 msgid "B<AF_IPX>\n"
6848 msgstr "B<AF_IPX>\n"
6849
6850 #. type: tbl table
6851 #: build/C/man2/socket.2:84
6852 #, no-wrap
6853 msgid "T}:IPX - Novell protocols:\n"
6854 msgstr "T}:IPX - Novell プロトコル:\n"
6855
6856 #. type: tbl table
6857 #: build/C/man2/socket.2:86
6858 #, no-wrap
6859 msgid "B<AF_NETLINK>\n"
6860 msgstr "B<AF_NETLINK>\n"
6861
6862 #. type: tbl table
6863 #: build/C/man2/socket.2:88
6864 #, no-wrap
6865 msgid "Kernel user interface device\n"
6866 msgstr "カーネル・ユーザ・デバイス\n"
6867
6868 #. type: tbl table
6869 #: build/C/man2/socket.2:90
6870 #, no-wrap
6871 msgid "B<netlink>(7)\n"
6872 msgstr "B<netlink>(7)\n"
6873
6874 #. type: tbl table
6875 #: build/C/man2/socket.2:93
6876 #, no-wrap
6877 msgid "B<AF_X25>\n"
6878 msgstr "B<AF_X25>\n"
6879
6880 #. type: tbl table
6881 #: build/C/man2/socket.2:94
6882 #, no-wrap
6883 msgid "T}:ITU-T X.25 / ISO-8208 protocol:T{\n"
6884 msgstr "T}:ITU-T X.25 / ISO-8208 プロトコル:T{\n"
6885
6886 #. type: tbl table
6887 #: build/C/man2/socket.2:95
6888 #, no-wrap
6889 msgid "B<x25>(7)\n"
6890 msgstr "B<x25>(7)\n"
6891
6892 #. type: tbl table
6893 #: build/C/man2/socket.2:98
6894 #, no-wrap
6895 msgid "B<AF_AX25>\n"
6896 msgstr "B<AF_AX25>\n"
6897
6898 #. type: tbl table
6899 #: build/C/man2/socket.2:100
6900 #, no-wrap
6901 msgid "Amateur radio AX.25 protocol\n"
6902 msgstr "アマチュア無線 AX.25 プロトコル\n"
6903
6904 #. type: tbl table
6905 #: build/C/man2/socket.2:101
6906 #, no-wrap
6907 msgid "T}:\n"
6908 msgstr "T}:\n"
6909
6910 #. type: tbl table
6911 #: build/C/man2/socket.2:103
6912 #, no-wrap
6913 msgid "B<AF_ATMPVC>\n"
6914 msgstr "B<AF_ATMPVC>\n"
6915
6916 #. type: tbl table
6917 #: build/C/man2/socket.2:104
6918 #, no-wrap
6919 msgid "T}:Access to raw ATM PVCs:\n"
6920 msgstr "T}:生の ATM PVC にアクセスする:\n"
6921
6922 #. type: tbl table
6923 #: build/C/man2/socket.2:106
6924 #, no-wrap
6925 msgid "B<AF_APPLETALK>\n"
6926 msgstr "B<AF_APPLETALK>\n"
6927
6928 #. type: tbl table
6929 #: build/C/man2/socket.2:107
6930 #, no-wrap
6931 msgid "T}:Appletalk:T{\n"
6932 msgstr "T}:アップルトーク:T{\n"
6933
6934 #. type: tbl table
6935 #: build/C/man2/socket.2:108
6936 #, no-wrap
6937 msgid "B<ddp>(7)\n"
6938 msgstr "B<ddp>(7)\n"
6939
6940 #. type: tbl table
6941 #: build/C/man2/socket.2:111
6942 #, no-wrap
6943 msgid "B<AF_PACKET>\n"
6944 msgstr "B<AF_PACKET>\n"
6945
6946 #. type: tbl table
6947 #: build/C/man2/socket.2:113
6948 #, no-wrap
6949 msgid "Low level packet interface\n"
6950 msgstr "低レベルのパケットインターフェース\n"
6951
6952 #. type: tbl table
6953 #: build/C/man2/socket.2:115
6954 #, no-wrap
6955 msgid "B<packet>(7)\n"
6956 msgstr "B<packet>(7)\n"
6957
6958 #. type: Plain text
6959 #: build/C/man2/socket.2:124
6960 msgid ""
6961 "The socket has the indicated I<type>, which specifies the communication "
6962 "semantics.  Currently defined types are:"
6963 msgstr ""
6964 "ソケットは I<type> で指定される型を持ち、それは通信方式(semantics)を指定す"
6965 "る。 定義されている型は現在以下の通り。"
6966
6967 #. type: TP
6968 #: build/C/man2/socket.2:124
6969 #, no-wrap
6970 msgid "B<SOCK_STREAM>"
6971 msgstr "B<SOCK_STREAM>"
6972
6973 #. type: Plain text
6974 #: build/C/man2/socket.2:128
6975 msgid ""
6976 "Provides sequenced, reliable, two-way, connection-based byte streams.  An "
6977 "out-of-band data transmission mechanism may be supported."
6978 msgstr ""
6979 "順序性と信頼性があり、双方向の、接続された バイト・ストリーム(byte stream)を"
6980 "提供する。 帯域外(out-of-band)データ転送メカニズムもサポートされる。"
6981
6982 #. type: TP
6983 #: build/C/man2/socket.2:128
6984 #, no-wrap
6985 msgid "B<SOCK_DGRAM>"
6986 msgstr "B<SOCK_DGRAM>"
6987
6988 #. type: Plain text
6989 #: build/C/man2/socket.2:132
6990 msgid ""
6991 "Supports datagrams (connectionless, unreliable messages of a fixed maximum "
6992 "length)."
6993 msgstr "データグラム(接続、信頼性無し、固定最大長メッセージ)  をサポートする。"
6994
6995 #. type: TP
6996 #: build/C/man2/socket.2:132
6997 #, no-wrap
6998 msgid "B<SOCK_SEQPACKET>"
6999 msgstr "B<SOCK_SEQPACKET>"
7000
7001 #. type: Plain text
7002 #: build/C/man2/socket.2:137
7003 msgid ""
7004 "Provides a sequenced, reliable, two-way connection-based data transmission "
7005 "path for datagrams of fixed maximum length; a consumer is required to read "
7006 "an entire packet with each input system call."
7007 msgstr ""
7008 "固定最大長のデータグラム転送パスに基づいた順序性、信頼性のある 双方向の接続に"
7009 "基づいた通信を提供する。受け取り側ではそれぞれの入力 システム・コールでパケッ"
7010 "ト全体を読み取ることが要求される。"
7011
7012 #. type: TP
7013 #: build/C/man2/socket.2:137
7014 #, no-wrap
7015 msgid "B<SOCK_RAW>"
7016 msgstr "B<SOCK_RAW>"
7017
7018 #. type: Plain text
7019 #: build/C/man2/socket.2:140
7020 msgid "Provides raw network protocol access."
7021 msgstr "生のネットワーク・プロトコルへのアクセスを提供する。"
7022
7023 #. type: TP
7024 #: build/C/man2/socket.2:140
7025 #, no-wrap
7026 msgid "B<SOCK_RDM>"
7027 msgstr "B<SOCK_RDM>"
7028
7029 #. type: Plain text
7030 #: build/C/man2/socket.2:143
7031 msgid "Provides a reliable datagram layer that does not guarantee ordering."
7032 msgstr "信頼性はあるが、順序は保証しないデータグラム層を提供する。"
7033
7034 #. type: TP
7035 #: build/C/man2/socket.2:143
7036 #, no-wrap
7037 msgid "B<SOCK_PACKET>"
7038 msgstr "B<SOCK_PACKET>"
7039
7040 #. type: Plain text
7041 #: build/C/man2/socket.2:148
7042 msgid "Obsolete and should not be used in new programs; see B<packet>(7)."
7043 msgstr ""
7044 "廃止されており新しいプログラムで使用してはいけない。 B<packet>(7)  を参照する"
7045 "こと"
7046
7047 #. type: Plain text
7048 #: build/C/man2/socket.2:154
7049 msgid ""
7050 "Some socket types may not be implemented by all protocol families; for "
7051 "example, B<SOCK_SEQPACKET> is not implemented for B<AF_INET>."
7052 msgstr ""
7053 "ある種のソケット型が全てのプロトコル・ファミリで実装されているわけではない。 "
7054 "例えば B<SOCK_SEQPACKET> は B<AF_INET> には実装されていない。"
7055
7056 #. type: Plain text
7057 #: build/C/man2/socket.2:162
7058 msgid ""
7059 "Since Linux 2.6.27, the I<type> argument serves a second purpose: in "
7060 "addition to specifying a socket type, it may include the bitwise OR of any "
7061 "of the following values, to modify the behavior of B<socket>():"
7062 msgstr ""
7063 "Linux 2.6.27 以降では、 I<type> 引数は二つ目の目的にも使用される。 ソケットの"
7064 "型を指定するのに加えて、 以下の値のいくつかをビット単位の論理和 (OR) で指定す"
7065 "ることで、 B<socket>()  の振舞いを変更することができる。"
7066
7067 #. type: Plain text
7068 #: build/C/man2/socket.2:196
7069 msgid ""
7070 "The I<protocol> specifies a particular protocol to be used with the socket.  "
7071 "Normally only a single protocol exists to support a particular socket type "
7072 "within a given protocol family, in which case I<protocol> can be specified "
7073 "as 0.  However, it is possible that many protocols may exist, in which case "
7074 "a particular protocol must be specified in this manner.  The protocol number "
7075 "to use is specific to the ``communication domain'' in which communication is "
7076 "to take place; see B<protocols>(5).  See B<getprotoent>(3)  on how to map "
7077 "protocol name strings to protocol numbers."
7078 msgstr ""
7079 "I<protocol> はソケットによって使用される固有のプロトコルを指定する。通常それ"
7080 "ぞれの ソケットは、与えられたプロトコル・ファミリの種類ごとに一つのプロトコル"
7081 "のみを サポートする。 その場合は I<protocol> に 0 を指定できる。 しかし、多く"
7082 "のプロトコルが存在してもかまわない。 この場合にはこの方法により固有のプロトコ"
7083 "ルを指定する必要がある。 使用されるプロトコル番号は通信の行なわれる``通信ドメ"
7084 "イン''に 固有である; B<protocols>(5)  を参照すること。 プロトコル名をどうやっ"
7085 "てプロトコル番号に対応させるかについては B<getprotoent>(3)  を参照すること。"
7086
7087 #. type: Plain text
7088 #: build/C/man2/socket.2:226
7089 msgid ""
7090 "Sockets of type B<SOCK_STREAM> are full-duplex byte streams, similar to "
7091 "pipes.  They do not preserve record boundaries.  A stream socket must be in "
7092 "a I<connected> state before any data may be sent or received on it.  A "
7093 "connection to another socket is created with a B<connect>(2)  call.  Once "
7094 "connected, data may be transferred using B<read>(2)  and B<write>(2)  calls "
7095 "or some variant of the B<send>(2)  and B<recv>(2)  calls.  When a session "
7096 "has been completed a B<close>(2)  may be performed.  Out-of-band data may "
7097 "also be transmitted as described in B<send>(2)  and received as described in "
7098 "B<recv>(2)."
7099 msgstr ""
7100 "B<SOCK_STREAM> 型のソケットはパイプのような全二重バイト・ストリームである。 "
7101 "これらはレコード境界を保存しない。 ストリームは、ソケットがデータを送ったり受"
7102 "けたりする前に I<接続された> 状態になってなければならない。他のソケットへの接"
7103 "続は B<connect>(2)  コールによって行なわれる。一度接続したらデータは B<read>"
7104 "(2)  と B<write>(2)  コールや B<send>(2)  と B<recv>(2)  コールの変種を使用し"
7105 "て転送できる。 セッションが完了したら B<close>(2)  が行なわれる。帯域外データ"
7106 "の転送も B<send>(2)  に記述されており、 受信も B<recv>(2)  に記述されている。"
7107
7108 #. type: Plain text
7109 #: build/C/man2/socket.2:252
7110 msgid ""
7111 "The communications protocols which implement a B<SOCK_STREAM> ensure that "
7112 "data is not lost or duplicated.  If a piece of data for which the peer "
7113 "protocol has buffer space cannot be successfully transmitted within a "
7114 "reasonable length of time, then the connection is considered to be dead.  "
7115 "When B<SO_KEEPALIVE> is enabled on the socket the protocol checks in a "
7116 "protocol-specific manner if the other end is still alive.  A B<SIGPIPE> "
7117 "signal is raised if a process sends or receives on a broken stream; this "
7118 "causes naive processes, which do not handle the signal, to exit.  "
7119 "B<SOCK_SEQPACKET> sockets employ the same system calls as B<SOCK_STREAM> "
7120 "sockets.  The only difference is that B<read>(2)  calls will return only the "
7121 "amount of data requested, and any data remaining in the arriving packet will "
7122 "be discarded.  Also all message boundaries in incoming datagrams are "
7123 "preserved."
7124 msgstr ""
7125 "B<SOCK_STREAM> を実装した通信プロトコルはデータに損失や重複がないことを保証す"
7126 "る。 もし相手のプロトコルがバッファー空間を持つ データの断片を適当な時間のう"
7127 "ちに転送できなければ、 接続は断たれたとみなす。そのソケット B<SO_KEEPALIVE> "
7128 "が有効になっている場合、プロトコル独自の方法で接続の相手側がまだ 有効であるか"
7129 "をチェックする。 もしプロセスが、壊れたストリームでデータを送受信しようとした"
7130 "場合には B<SIGPIPE> シグナルが送られる; これは通常のそのシグナルを扱っていな"
7131 "いプロセスを 終了させる。 B<SOCK_SEQPACKET> ソケットは B<SOCK_STREAM> ソケッ"
7132 "トと同じシステム・コールを使用する。 唯一の違いは B<read>(2)  コールが要求さ"
7133 "れた量のデータのみを返し、到着したパケットの残りの部分を 捨ててしまうことであ"
7134 "る。同様に入ってくるデータグラムの全てのメッセージ境界は 保存される。"
7135
7136 #. type: Plain text
7137 #: build/C/man2/socket.2:262
7138 msgid ""
7139 "B<SOCK_DGRAM> and B<SOCK_RAW> sockets allow sending of datagrams to "
7140 "correspondents named in B<sendto>(2)  calls.  Datagrams are generally "
7141 "received with B<recvfrom>(2), which returns the next datagram along with the "
7142 "address of its sender."
7143 msgstr ""
7144 "B<SOCK_DGRAM> と B<SOCK_RAW> ソケットは B<sendto>(2)  コールで指定された相手"
7145 "へデータグラムを送ることが許されている。 データグラムは一般に B<recvfrom>"
7146 "(2)  で受けとり、 このコールは次のデータグラムを送信者のアドレスと一緒に返"
7147 "す。"
7148
7149 #. type: Plain text
7150 #: build/C/man2/socket.2:269
7151 msgid ""
7152 "B<SOCK_PACKET> is an obsolete socket type to receive raw packets directly "
7153 "from the device driver.  Use B<packet>(7)  instead."
7154 msgstr ""
7155 "B<SOCK_PACKET> は古いソケット型で、生(raw)のパケットをデバイスドライバから 直"
7156 "接受信するためのものである。 今は代わりに B<packet>(7)  を用いること。"
7157
7158 #. type: Plain text
7159 #: build/C/man2/socket.2:292
7160 msgid ""
7161 "An B<fcntl>(2)  B<F_SETOWN> operation can be used to specify a process or "
7162 "process group to receive a B<SIGURG> signal when the out-of-band data "
7163 "arrives or B<SIGPIPE> signal when a B<SOCK_STREAM> connection breaks "
7164 "unexpectedly.  This operation may also be used to set the process or process "
7165 "group that receives the I/O and asynchronous notification of I/O events via "
7166 "B<SIGIO>.  Using B<F_SETOWN> is equivalent to an B<ioctl>(2)  call with the "
7167 "B<FIOSETOWN> or B<SIOCSPGRP> argument."
7168 msgstr ""
7169 "B<fcntl>(2)  の B<F_SETOWN> 操作を使って、シグナル B<SIGURG> や B<SIGPIPE> を"
7170 "受けとるプロセス・グループを指定できる。 B<SIGURG> シグナルは帯域外データが到"
7171 "着した時に、 B<SIGPIPE> シグナルは B<SOCK_STREAM> 接続が予期せず切断された時"
7172 "に送られる。 また、 B<F_SETOWN> 操作は、I/O や I/O イベントの非同期 "
7173 "(asynchronous) 通知を B<SIGIO> を経由で受け取るプロセスやプロセス・グループを"
7174 "設定するのにも使用できる。 B<F_SETOWN> を使用することは B<FIOSETOWN> または "
7175 "B<SIOCSPGRP> の引数で B<ioctl>(2)  を使用することと等価である。"
7176
7177 #. type: Plain text
7178 #: build/C/man2/socket.2:302
7179 msgid ""
7180 "When the network signals an error condition to the protocol module (e.g., "
7181 "using a ICMP message for IP) the pending error flag is set for the socket.  "
7182 "The next operation on this socket will return the error code of the pending "
7183 "error.  For some protocols it is possible to enable a per-socket error queue "
7184 "to retrieve detailed information about the error; see B<IP_RECVERR> in B<ip>"
7185 "(7)."
7186 msgstr ""
7187 "ネットワークがプロトコル・モジュールにエラー状態を伝えた場合 (例えば、IP の "
7188 "ICMP メッセージを使用して)には、ソケットの ペンディング・エラー・フラグが設定"
7189 "される。次にこのソケットを操作した 時にペンディングされていたエラー・コードが"
7190 "返される。プロトコルによっては エラーについてのより詳しい情報を受け取るために"
7191 "ソケットごとのエラー・キューを 受け取ることが可能である。 B<ip>(7)  の "
7192 "B<IP_RECVERR> を参照すること。"
7193
7194 #. type: Plain text
7195 #: build/C/man2/socket.2:312
7196 msgid ""
7197 "The operation of sockets is controlled by socket level I<options>.  These "
7198 "options are defined in I<E<lt>sys/socket.hE<gt>>.  The functions "
7199 "B<setsockopt>(2)  and B<getsockopt>(2)  are used to set and get options, "
7200 "respectively."
7201 msgstr ""
7202 "ソケットの操作はソケット・レベル I<options> によって制御される。 これらのオプ"
7203 "ションは I<E<lt>sys/socket.hE<gt>> に定義されている。 B<setsockopt>(2)  と "
7204 "B<getsockopt>(2)  関数はそれぞれオプションの設定と取得を行なう。"
7205
7206 #. type: Plain text
7207 #: build/C/man2/socket.2:317
7208 msgid ""
7209 "On success, a file descriptor for the new socket is returned.  On error, -1 "
7210 "is returned, and I<errno> is set appropriately."
7211 msgstr ""
7212 "成功した場合、新しいソケットのファイル・ディスクリプターを返す。 エラーが発生"
7213 "した場合は -1 を返し、 I<errno> を適切に設定する。"
7214
7215 #. type: Plain text
7216 #: build/C/man2/socket.2:322
7217 msgid ""
7218 "Permission to create a socket of the specified type and/or protocol is "
7219 "denied."
7220 msgstr ""
7221 "指定されたタイプまたはプロトコルのソケットを作成する許可が与えられていない。"
7222
7223 #. type: Plain text
7224 #: build/C/man2/socket.2:325
7225 msgid "The implementation does not support the specified address family."
7226 msgstr "指定されたアドレスファミリーがサポートされていない。"
7227
7228 #. type: Plain text
7229 #: build/C/man2/socket.2:328
7230 msgid "Unknown protocol, or protocol family not available."
7231 msgstr "知らないプロトコル、または利用できないプロトコル・ファミリである。"
7232
7233 #.  Since Linux 2.6.27
7234 #. type: Plain text
7235 #: build/C/man2/socket.2:333
7236 msgid "Invalid flags in I<type>."
7237 msgstr "I<type> に無効なフラグが指定されている。"
7238
7239 #. type: Plain text
7240 #: build/C/man2/socket.2:336
7241 msgid "Process file table overflow."
7242 msgstr "プロセスのファイルテーブルが溢れている。"
7243
7244 #. type: TP
7245 #: build/C/man2/socket.2:339
7246 #, no-wrap
7247 msgid "B<ENOBUFS> or B<ENOMEM>"
7248 msgstr "B<ENOBUFS> または B<ENOMEM>"
7249
7250 #. type: Plain text
7251 #: build/C/man2/socket.2:344
7252 msgid ""
7253 "Insufficient memory is available.  The socket cannot be created until "
7254 "sufficient resources are freed."
7255 msgstr ""
7256 "十分なメモリがない。十分な資源が解放されるまではソケットを 作成することはでき"
7257 "ない。"
7258
7259 #. type: TP
7260 #: build/C/man2/socket.2:344 build/C/man2/socketpair.2:90
7261 #, no-wrap
7262 msgid "B<EPROTONOSUPPORT>"
7263 msgstr "B<EPROTONOSUPPORT>"
7264
7265 #. type: Plain text
7266 #: build/C/man2/socket.2:348
7267 msgid ""
7268 "The protocol type or the specified protocol is not supported within this "
7269 "domain."
7270 msgstr ""
7271 "このドメインでは指定されたプロトコルまたはプロトコル・タイプが サポートされて"
7272 "いない。"
7273
7274 #. type: Plain text
7275 #: build/C/man2/socket.2:350
7276 msgid "Other errors may be generated by the underlying protocol modules."
7277 msgstr "下位のプロトコル・モジュールから他のエラーが生成されるかもしれない。"
7278
7279 #. type: Plain text
7280 #: build/C/man2/socket.2:352
7281 msgid "4.4BSD, POSIX.1-2001."
7282 msgstr "4.4BSD, POSIX.1-2001."
7283
7284 #. type: Plain text
7285 #: build/C/man2/socket.2:358
7286 msgid "The B<SOCK_NONBLOCK> and B<SOCK_CLOEXEC> flags are Linux-specific."
7287 msgstr "フラグ B<SOCK_NONBLOCK>, B<SOCK_CLOEXEC> は Linux 固有である。"
7288
7289 #. type: Plain text
7290 #: build/C/man2/socket.2:364
7291 msgid ""
7292 "B<socket>()  appeared in 4.2BSD.  It is generally portable to/from non-BSD "
7293 "systems supporting clones of the BSD socket layer (including System V "
7294 "variants)."
7295 msgstr ""
7296 "B<socket>()  は 4.2BSD で登場した。一般に、(System V の変種を含めて)  BSD の"
7297 "ソケット層の互換性をサポートしている BSD 以外のシステムへの、 または、BSD 以"
7298 "外のシステムからの移植ができる。"
7299
7300 #. type: Plain text
7301 #: build/C/man2/socket.2:382
7302 msgid ""
7303 "The manifest constants used under 4.x BSD for protocol families are "
7304 "B<PF_UNIX>, B<PF_INET>, etc., while B<AF_UNIX> etc. are used for address "
7305 "families.  However, already the BSD man page promises: \"The protocol family "
7306 "generally is the same as the address family\", and subsequent standards use "
7307 "AF_* everywhere."
7308 msgstr ""
7309 "4.x BSD において定数を使用する場合、プロトコル・ファミリーには B<PF_UNIX>, "
7310 "B<PF_INET> 等を使用している。一方でアドレス・ファミリーには B<AF_UNIX> 等が使"
7311 "用されている。しかしながら BSD のマニュアルでは 「一般にプロトコル・ファミ"
7312 "リーはアドレス・ファミリーと同じものである。」 と保証している。それでそれ以外"
7313 "の規格では全ての場所で AF_* が使用されている。"
7314
7315 #. type: Plain text
7316 #: build/C/man2/socket.2:387
7317 msgid "An example of the use of B<socket>()  is shown in B<getaddrinfo>(3)."
7318 msgstr "B<socket>()  の利用例が B<getaddrinfo>(3)  に記載されている。"
7319
7320 #. type: Plain text
7321 #: build/C/man2/socket.2:410
7322 msgid ""
7323 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7324 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7325 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7326 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7327 "(7), B<unix>(7)"
7328 msgstr ""
7329 "B<accept>(2), B<bind>(2), B<connect>(2), B<fcntl>(2), B<getpeername>(2), "
7330 "B<getsockname>(2), B<getsockopt>(2), B<ioctl>(2), B<listen>(2), B<read>(2), "
7331 "B<recv>(2), B<select>(2), B<send>(2), B<shutdown>(2), B<socketpair>(2), "
7332 "B<write>(2), B<getprotoent>(3), B<ip>(7), B<socket>(7), B<tcp>(7), B<udp>"
7333 "(7), B<unix>(7)"
7334
7335 #. type: Plain text
7336 #: build/C/man2/socket.2:414
7337 msgid ""
7338 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq is "
7339 "reprinted in I<UNIX Programmer's Supplementary Documents Volume 1.>"
7340 msgstr ""
7341 "\\(lqAn Introductory 4.3BSD Interprocess Communication Tutorial\\(rq は "
7342 "I<UNIX Programmer's Supplementary Documents Volume 1> として再版された。"
7343
7344 #. type: Plain text
7345 #: build/C/man2/socket.2:418
7346 msgid ""
7347 "\\(lqBSD Interprocess Communication Tutorial\\(rq is reprinted in I<UNIX "
7348 "Programmer's Supplementary Documents Volume 1.>"
7349 msgstr ""
7350 "\\(lqBSD Interprocess Communication Tutorial\\(rq は I<UNIX Programmer's "
7351 "Supplementary Documents Volume 1> として再版された。"
7352
7353 #. type: Plain text
7354 #: build/C/man7/socket.7:29
7355 msgid "socket - Linux socket interface"
7356 msgstr "socket - Linux のソケットインターフェース"
7357
7358 #. type: Plain text
7359 #: build/C/man7/socket.7:33
7360 msgid ""
7361 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7362 ">I<protocol>B<);>"
7363 msgstr ""
7364 "I<sockfd>B< = socket(int >I<socket_family>B<, int >I<socket_type>B<, int "
7365 ">I<protocol>B<);>"
7366
7367 #. type: Plain text
7368 #: build/C/man7/socket.7:52
7369 msgid ""
7370 "This manual page describes the Linux networking socket layer user "
7371 "interface.  The BSD compatible sockets are the uniform interface between the "
7372 "user process and the network protocol stacks in the kernel.  The protocol "
7373 "modules are grouped into I<protocol families> like B<AF_INET>, B<AF_IPX>, "
7374 "B<AF_PACKET> and I<socket types> like B<SOCK_STREAM> or B<SOCK_DGRAM>.  See "
7375 "B<socket>(2)  for more information on families and types."
7376 msgstr ""
7377 "このマニュアルページは Linux ネットワークのソケット層に対する ユーザインター"
7378 "フェースを記述するものである。 BSD 互換ソケットは、ユーザプロセスとカーネル内"
7379 "部の ネットワークプロトコルスタック群との間に、 統一的なインターフェースを提"
7380 "供するものである。 プロトコルモジュールは I<プロトコルファミリー (protocol "
7381 "familiy)> (例: B<AF_INET>, B<AF_IPX>, B<AF_PACKET>)  と I<ソケットタイプ "
7382 "(socket types)> (例: B<SOCK_STREAM>, B<SOCK_DGRAM>)  に分類できる。 これらに"
7383 "関するより詳しい情報は B<socket>(2)  を参照のこと。"
7384
7385 #. type: SS
7386 #: build/C/man7/socket.7:52
7387 #, no-wrap
7388 msgid "Socket Layer Functions"
7389 msgstr "ソケット層の関数群"
7390
7391 #. type: Plain text
7392 #: build/C/man7/socket.7:56
7393 msgid ""
7394 "These functions are used by the user process to send or receive packets and "
7395 "to do other socket operations.  For more information see their respective "
7396 "manual pages."
7397 msgstr ""
7398 "これらの関数はユーザプロセスがパケットを送受信したり、その他のソケット操作を "
7399 "行ったりするために用いられる。詳細はそれぞれのマニュアルページを 見てほしい。"
7400
7401 #. type: Plain text
7402 #: build/C/man7/socket.7:72
7403 msgid ""
7404 "B<socket>(2)  creates a socket, B<connect>(2)  connects a socket to a remote "
7405 "socket address, the B<bind>(2)  function binds a socket to a local socket "
7406 "address, B<listen>(2)  tells the socket that new connections shall be "
7407 "accepted, and B<accept>(2)  is used to get a new socket with a new incoming "
7408 "connection.  B<socketpair>(2)  returns two connected anonymous sockets (only "
7409 "implemented for a few local families like B<AF_UNIX>)"
7410 msgstr ""
7411 "B<socket>(2)  はソケットを生成する。 B<connect>(2)  はソケットをリモートのソ"
7412 "ケットアドレスに接続する。 B<bind>(2)  はソケットをローカルのソケットアドレス"
7413 "にバインドする。 B<listen>(2)  はソケットに新しい接続が来たら受信するように伝"
7414 "え、 B<accept>(2)  は外部からやってきた接続に対して新しいソケットを得るために"
7415 "用いられる。 B<socketpair>(2)  は互いに接続された二つの名前無しソケット "
7416 "(anonymous socket) を返す (B<AF_UNIX> のような、いくつかのローカルなファミ"
7417 "リーでしか実装されていない)。"
7418
7419 #. type: Plain text
7420 #: build/C/man7/socket.7:94
7421 msgid ""
7422 "B<send>(2), B<sendto>(2), and B<sendmsg>(2)  send data over a socket, and "
7423 "B<recv>(2), B<recvfrom>(2), B<recvmsg>(2)  receive data from a socket.  "
7424 "B<poll>(2)  and B<select>(2)  wait for arriving data or a readiness to send "
7425 "data.  In addition, the standard I/O operations like B<write>(2), B<writev>"
7426 "(2), B<sendfile>(2), B<read>(2), and B<readv>(2)  can be used to read and "
7427 "write data."
7428 msgstr ""
7429 "B<send>(2), B<sendto>(2), B<sendmsg>(2)  はソケットを通してデータを送信し、 "
7430 "B<recv>(2)  B<recvfrom>(2), B<recvmsg>(2)  はソケットからデータを受信する。 "
7431 "B<poll>(2)  と B<select>(2)  はデータの到着を待ったり、データ送信の準備ができ"
7432 "るまで待ったりする。 さらに、 B<write>(2), B<writev>(2), B<sendfile>(2), "
7433 "B<read>(2), B<readv>(2)  のような標準的な I/O 操作もデータの読み書きに用いる"
7434 "ことができる。"
7435
7436 #. type: Plain text
7437 #: build/C/man7/socket.7:105
7438 msgid ""
7439 "B<getsockname>(2)  returns the local socket address and B<getpeername>(2)  "
7440 "returns the remote socket address.  B<getsockopt>(2)  and B<setsockopt>(2)  "
7441 "are used to set or get socket layer or protocol options.  B<ioctl>(2)  can "
7442 "be used to set or read some other options."
7443 msgstr ""
7444 "B<getsockbyname>(2)  はローカルのソケットアドレスを返し、 B<getpeername>(2)  "
7445 "はリモートのソケットアドレスを返す。 B<getsockopt>(2)  と B<setsockopt>(2)  "
7446 "はソケット層のオプションやプロトコルオプションの取得・設定に用いられる。 他の"
7447 "いくつかのオプションの取得・設定には B<ioctl>(2)  を使うことができる。"
7448
7449 #. type: Plain text
7450 #: build/C/man7/socket.7:110
7451 msgid ""
7452 "B<close>(2)  is used to close a socket.  B<shutdown>(2)  closes parts of a "
7453 "full-duplex socket connection."
7454 msgstr ""
7455 "B<close>(2)  はソケットをクローズする。 B<shutdown>(2)  は全二重なソケット接"
7456 "続を部分的にクローズする。"
7457
7458 #. type: Plain text
7459 #: build/C/man7/socket.7:116
7460 msgid ""
7461 "Seeking, or calling B<pread>(2)  or B<pwrite>(2)  with a nonzero position is "
7462 "not supported on sockets."
7463 msgstr ""
7464 "シーク動作や、 0 以外の位置に対する B<pread>(2)  や B<pwrite>(2)  はソケット"
7465 "ではサポートされていない。"
7466
7467 #. type: Plain text
7468 #: build/C/man7/socket.7:133
7469 msgid ""
7470 "It is possible to do nonblocking I/O on sockets by setting the B<O_NONBLOCK> "
7471 "flag on a socket file descriptor using B<fcntl>(2).  Then all operations "
7472 "that would block will (usually)  return with B<EAGAIN> (operation should be "
7473 "retried later); B<connect>(2)  will return B<EINPROGRESS> error.  The user "
7474 "can then wait for various events via B<poll>(2)  or B<select>(2)."
7475 msgstr ""
7476 "非ブロッキングな I/O をソケットで行うことは可能で、 B<fcntl>(2)  を使ってソ"
7477 "ケットのファイルディスクリプタに B<O_NONBLOCK> フラグをセットすれば良い。 こ"
7478 "うするとブロックされる操作は、 (通常)  B<EAGAIN> エラーで戻ることになる (後で"
7479 "処理が再試行されることが期待されている)。 B<connect>(2)  では B<EINPROGRESS> "
7480 "エラーが返される。 この場合、ユーザはさまざまなイベントを B<poll>(2)  や "
7481 "B<select>(2)  を使って待つことができる。"
7482
7483 #. type: tbl table
7484 #: build/C/man7/socket.7:137
7485 #, no-wrap
7486 msgid "I/O events\n"
7487 msgstr "I/O イベント\n"
7488
7489 #. type: tbl table
7490 #: build/C/man7/socket.7:138
7491 #, no-wrap
7492 msgid "Event:Poll flag:Occurrence\n"
7493 msgstr "イベント:poll フラグ:内容\n"
7494
7495 #. type: tbl table
7496 #: build/C/man7/socket.7:139 build/C/man7/socket.7:142
7497 #, no-wrap
7498 msgid "Read:POLLIN:T{\n"
7499 msgstr "Read:POLLIN:T{\n"
7500
7501 #. type: tbl table
7502 #: build/C/man7/socket.7:140
7503 #, no-wrap
7504 msgid "New data arrived.\n"
7505 msgstr "新しいデータが到着した。\n"
7506
7507 #. type: tbl table
7508 #: build/C/man7/socket.7:143
7509 #, no-wrap
7510 msgid "A connection setup has been completed\n"
7511 msgstr "(接続志向のソケットで)\n"
7512
7513 #. type: tbl table
7514 #: build/C/man7/socket.7:144
7515 #, no-wrap
7516 msgid "(for connection-oriented sockets)\n"
7517 msgstr "接続の設定が終了した。\n"
7518
7519 #. type: tbl table
7520 #: build/C/man7/socket.7:146 build/C/man7/socket.7:149
7521 #, no-wrap
7522 msgid "Read:POLLHUP:T{\n"
7523 msgstr "Read:POLLHUP:T{\n"
7524
7525 #. type: tbl table
7526 #: build/C/man7/socket.7:147
7527 #, no-wrap
7528 msgid "A disconnection request has been initiated by the other end.\n"
7529 msgstr "接続先で切断要求が生成された。\n"
7530
7531 #. type: tbl table
7532 #: build/C/man7/socket.7:150
7533 #, no-wrap
7534 msgid "A connection is broken (only for connection-oriented protocols).\n"
7535 msgstr "接続が壊れた (接続志向のプロトコルのみ)。\n"
7536
7537 #. type: tbl table
7538 #: build/C/man7/socket.7:151
7539 #, no-wrap
7540 msgid "When the socket is written\n"
7541 msgstr "この場合、ソケットに書き込みが行われると\n"
7542
7543 #. type: tbl table
7544 #: build/C/man7/socket.7:152
7545 #, no-wrap
7546 msgid "B<SIGPIPE>\n"
7547 msgstr "B<SIGPIPE>\n"
7548
7549 #. type: tbl table
7550 #: build/C/man7/socket.7:153
7551 #, no-wrap
7552 msgid "is also sent.\n"
7553 msgstr "も送信される。\n"
7554
7555 #. type: tbl table
7556 #: build/C/man7/socket.7:155
7557 #, no-wrap
7558 msgid "Write:POLLOUT:T{\n"
7559 msgstr "Write:POLLOUT:T{\n"
7560
7561 #. type: tbl table
7562 #: build/C/man7/socket.7:156
7563 #, no-wrap
7564 msgid "Socket has enough send buffer space for writing new data.\n"
7565 msgstr "ソケットには新しいデータを書き込むのに充分なバッファ領域がある。\n"
7566
7567 #. type: tbl table
7568 #: build/C/man7/socket.7:158
7569 #, no-wrap
7570 msgid "Read/Write:T{\n"
7571 msgstr "Read/Write:T{\n"
7572
7573 #. type: tbl table
7574 #: build/C/man7/socket.7:159
7575 #, no-wrap
7576 msgid "POLLIN|\n"
7577 msgstr "POLLIN|\n"
7578
7579 #. type: tbl table
7580 #: build/C/man7/socket.7:160
7581 #, no-wrap
7582 msgid ".br\n"
7583 msgstr ".br\n"
7584
7585 #. type: tbl table
7586 #: build/C/man7/socket.7:161
7587 #, no-wrap
7588 msgid "POLLOUT\n"
7589 msgstr "POLLOUT\n"
7590
7591 #. type: tbl table
7592 #: build/C/man7/socket.7:163
7593 #, no-wrap
7594 msgid "An outgoing\n"
7595 msgstr "外部向けの\n"
7596
7597 #. type: tbl table
7598 #: build/C/man7/socket.7:164
7599 #, no-wrap
7600 msgid "B<connect>(2)\n"
7601 msgstr "B<connect>(2)\n"
7602
7603 #. type: tbl table
7604 #: build/C/man7/socket.7:165
7605 #, no-wrap
7606 msgid "finished.\n"
7607 msgstr "が終了した。\n"
7608
7609 #. type: tbl table
7610 #: build/C/man7/socket.7:167
7611 #, no-wrap
7612 msgid "Read/Write:POLLERR:An asynchronous error occurred.\n"
7613 msgstr "Read/Write:POLLERR:非同期的 (asynchronous) なエラーが起こった。\n"
7614
7615 #. type: tbl table
7616 #: build/C/man7/socket.7:168
7617 #, no-wrap
7618 msgid "Read/Write:POLLHUP:The other end has shut down one direction.\n"
7619 msgstr "Read/Write:POLLHUP:接続先が片方向を切断した。\n"
7620
7621 #. type: tbl table
7622 #: build/C/man7/socket.7:169
7623 #, no-wrap
7624 msgid "Exception:POLLPRI:T{\n"
7625 msgstr "Exception:POLLPRI:T{\n"
7626
7627 #. type: tbl table
7628 #: build/C/man7/socket.7:170
7629 #, no-wrap
7630 msgid "Urgent data arrived.\n"
7631 msgstr "緊急データ (urgent data) が到着した。この場合は\n"
7632
7633 #. type: tbl table
7634 #: build/C/man7/socket.7:171
7635 #, no-wrap
7636 msgid "B<SIGURG>\n"
7637 msgstr "B<SIGURG>\n"
7638
7639 #. type: tbl table
7640 #: build/C/man7/socket.7:172
7641 #, no-wrap
7642 msgid "is sent then.\n"
7643 msgstr "が送信される。\n"
7644
7645 #. type: Plain text
7646 #: build/C/man7/socket.7:202
7647 msgid ""
7648 "An alternative to B<poll>(2)  and B<select>(2)  is to let the kernel inform "
7649 "the application about events via a B<SIGIO> signal.  For that the B<O_ASYNC> "
7650 "flag must be set on a socket file descriptor via B<fcntl>(2)  and a valid "
7651 "signal handler for B<SIGIO> must be installed via B<sigaction>(2).  See the "
7652 "I<Signals> discussion below."
7653 msgstr ""
7654 "B<poll>(2)  や B<select>(2)  を使う代わりに、カーネルからアプリケーションに "
7655 "イベントを通知させるのに B<SIGIO> シグナルを使う方法もある。 この方法を使うに"
7656 "は、 B<fcntl>(2)  を用いてソケットのファイルディスクリプタに B<O_ASYNC> フラ"
7657 "グをセットし、 B<SIGIO> に対する有効なシグナルハンドラを B<sigaction>(2)  に"
7658 "よって設定しておく必要がある。 後述の I<シグナル> に関する議論も参考にするこ"
7659 "と。"
7660
7661 #. type: SS
7662 #: build/C/man7/socket.7:202
7663 #, no-wrap
7664 msgid "Socket Options"
7665 msgstr "ソケットオプション"
7666
7667 #.  FIXME
7668 #.  In the list below, the text used to describe argument types
7669 #.  for each socket option should be more consistent
7670 #.  SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
7671 #.  W R Stevens, UNPv1
7672 #. type: Plain text
7673 #: build/C/man7/socket.7:216
7674 msgid ""
7675 "These socket options can be set by using B<setsockopt>(2)  and read with "
7676 "B<getsockopt>(2)  with the socket level set to B<SOL_SOCKET> for all sockets:"
7677 msgstr ""
7678 "これらのソケットオプションは、 B<setsockopt>(2)  を用いれば設定でき、 "
7679 "B<getsockopt>(2)  を用いれば取得できる。 但し、どのソケットの場合も ソケット"
7680 "レベルには B<SOL_SOCKET> を指定すること。"
7681
7682 #. type: TP
7683 #: build/C/man7/socket.7:216
7684 #, no-wrap
7685 msgid "B<SO_ACCEPTCONN>"
7686 msgstr "B<SO_ACCEPTCONN>"
7687
7688 #. type: Plain text
7689 #: build/C/man7/socket.7:224
7690 msgid ""
7691 "Returns a value indicating whether or not this socket has been marked to "
7692 "accept connections with B<listen>(2).  The value 0 indicates that this is "
7693 "not a listening socket, the value 1 indicates that this is a listening "
7694 "socket.  This socket option is read-only."
7695 msgstr ""
7696 "このソケットが B<listen>(2)  によって接続待ち受け状態に設定されているかどうか"
7697 "を示す値を返す。 値 0 は listen 状態のソケットでないことを、 値 1 は listen "
7698 "状態のソケットであることを示す。このソケットオプションは読み込み専用である。"
7699
7700 #. type: TP
7701 #: build/C/man7/socket.7:224
7702 #, no-wrap
7703 msgid "B<SO_BINDTODEVICE>"
7704 msgstr "B<SO_BINDTODEVICE>"
7705
7706 #. type: Plain text
7707 #: build/C/man7/socket.7:243
7708 msgid ""
7709 "Bind this socket to a particular device like \\(lqeth0\\(rq, as specified in "
7710 "the passed interface name.  If the name is an empty string or the option "
7711 "length is zero, the socket device binding is removed.  The passed option is "
7712 "a variable-length null-terminated interface name string with the maximum "
7713 "size of B<IFNAMSIZ>.  If a socket is bound to an interface, only packets "
7714 "received from that particular interface are processed by the socket.  Note "
7715 "that this only works for some socket types, particularly B<AF_INET> "
7716 "sockets.  It is not supported for packet sockets (use normal B<bind>(2)  "
7717 "there)."
7718 msgstr ""
7719 "このソケットを、引き数で渡したインターフェース名で指定される\n"
7720 "(\\(lqeth0\\(rq のような) 特定のデバイスにバインドする。\n"
7721 "名前が空文字列だったり、オプションの長さ (optlen) が 0 の場合には、\n"
7722 "ソケットのバインドが削除される。渡すオプションは、インターフェース名が\n"
7723 "入ったヌル文字で終端された可変長の文字列である。\n"
7724 "文字列の最大のサイズは B<IFNAMSIX> である。\n"
7725 "ソケットがインターフェースにバインドされると、その特定のインターフェース\n"
7726 "から受信されたパケットだけを処理する。\n"
7727 "このオプションはいくつかのソケットタイプ、\n"
7728 "特に B<AF_INET> に対してのみ動作する点に注意すること。\n"
7729 "パケットソケットではサポートされていない (通常の B<bind>(2) を使うこと)。"
7730
7731 #. type: TP
7732 #: build/C/man7/socket.7:243
7733 #, no-wrap
7734 msgid "B<SO_BROADCAST>"
7735 msgstr "B<SO_BROADCAST>"
7736
7737 #. type: Plain text
7738 #: build/C/man7/socket.7:249
7739 msgid ""
7740 "Set or get the broadcast flag.  When enabled, datagram sockets are allowed "
7741 "to send packets to a broadcast address.  This option has no effect on stream-"
7742 "oriented sockets."
7743 msgstr ""
7744 "ブロードキャストフラグを設定・取得する。有効になっていると、データグラ\n"
7745 "ムソケットはブロードキャストアドレスにパケットを送信できるようになる。\n"
7746 "ストリーム指向のソケットには何の効果もない。"
7747
7748 #. type: TP
7749 #: build/C/man7/socket.7:249
7750 #, no-wrap
7751 msgid "B<SO_BSDCOMPAT>"
7752 msgstr "B<SO_BSDCOMPAT>"
7753
7754 #. type: Plain text
7755 #: build/C/man7/socket.7:261
7756 msgid ""
7757 "Enable BSD bug-to-bug compatibility.  This is used by the UDP protocol "
7758 "module in Linux 2.0 and 2.2.  If enabled ICMP errors received for a UDP "
7759 "socket will not be passed to the user program.  In later kernel versions, "
7760 "support for this option has been phased out: Linux 2.4 silently ignores it, "
7761 "and Linux 2.6 generates a kernel warning (printk()) if a program uses this "
7762 "option.  Linux 2.0 also enabled BSD bug-to-bug compatibility options (random "
7763 "header changing, skipping of the broadcast flag) for raw sockets with this "
7764 "option, but that was removed in Linux 2.2."
7765 msgstr ""
7766 "BSD のバグに対して互換性を取るための機能を有効にする。 この機能は Linux 2.0 "
7767 "と 2.2 の UDP プロトコルモジュールで使用されている。 有効になっていると、 "
7768 "UDP ソケットで受信された ICMP エラーは ユーザプログラムに渡されない。 これ以"
7769 "降のバージョンのカーネルでは、このオプションのサポートは 段階的に廃止されてき"
7770 "た。 Linux 2.4 ではこのオプションは黙って無視され、 Linux 2.6 ではプログラム"
7771 "がこのオプションを使用すると (printk() を使って)  カーネルの警告メッセージが"
7772 "出力される。 Linux 2.0 では、このオプションを指定すると、 raw ソケットにおい"
7773 "ても BSD のバグ (ランダムヘッダ変更、 ブロードキャストフラグのスキップ)  に対"
7774 "する互換機能が有効になっていた。 しかし、こちらは Linux 2.2 で削除された。"
7775
7776 #. type: TP
7777 #: build/C/man7/socket.7:261
7778 #, no-wrap
7779 msgid "B<SO_DEBUG>"
7780 msgstr "B<SO_DEBUG>"
7781
7782 #. type: Plain text
7783 #: build/C/man7/socket.7:267
7784 msgid ""
7785 "Enable socket debugging.  Only allowed for processes with the "
7786 "B<CAP_NET_ADMIN> capability or an effective user ID of 0."
7787 msgstr ""
7788 "ソケットのデバッグ機能を有効にする。 B<CAP_NET_ADMIN> 権限を持つプロセスか、"
7789 "実効ユーザ ID が 0 のプロセスでしか 利用できない。"
7790
7791 #. type: TP
7792 #: build/C/man7/socket.7:267
7793 #, no-wrap
7794 msgid "B<SO_DOMAIN> (since Linux 2.6.32)"
7795 msgstr "B<SO_DOMAIN> (Linux 2.6.32 以降)"
7796
7797 #. type: Plain text
7798 #: build/C/man7/socket.7:275
7799 msgid ""
7800 "Retrieves the socket domain as an integer, returning a value such as "
7801 "B<AF_INET6>.  See B<socket>(2)  for details.  This socket option is read-"
7802 "only."
7803 msgstr ""
7804 "ソケットドメインを整数で取得する。 B<AF_INET6> のような値が返される。\n"
7805 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
7806
7807 #. type: TP
7808 #: build/C/man7/socket.7:275
7809 #, no-wrap
7810 msgid "B<SO_ERROR>"
7811 msgstr "B<SO_ERROR>"
7812
7813 #. type: Plain text
7814 #: build/C/man7/socket.7:280
7815 msgid ""
7816 "Get and clear the pending socket error.  This socket option is read-only.  "
7817 "Expects an integer."
7818 msgstr ""
7819 "保留になっていたソケットエラーを取得してクリアする。\n"
7820 "このソケットオプションは読み込み専用である。整数値をとる。"
7821
7822 #. type: TP
7823 #: build/C/man7/socket.7:280
7824 #, no-wrap
7825 msgid "B<SO_DONTROUTE>"
7826 msgstr "B<SO_DONTROUTE>"
7827
7828 #. type: Plain text
7829 #: build/C/man7/socket.7:289
7830 msgid ""
7831 "Don't send via a gateway, only send to directly connected hosts.  The same "
7832 "effect can be achieved by setting the B<MSG_DONTROUTE> flag on a socket "
7833 "B<send>(2)  operation.  Expects an integer boolean flag."
7834 msgstr ""
7835 "ゲートウェイを経由せず、直接接続されているホストに送信する。 B<send>(2)  操作"
7836 "で B<MSG_DONTROUTE> フラグをセットした場合も同じ効果が得られる。 ブール整数の"
7837 "フラグを取る。"
7838
7839 #. type: TP
7840 #: build/C/man7/socket.7:289
7841 #, no-wrap
7842 msgid "B<SO_KEEPALIVE>"
7843 msgstr "B<SO_KEEPALIVE>"
7844
7845 #. type: Plain text
7846 #: build/C/man7/socket.7:293
7847 msgid ""
7848 "Enable sending of keep-alive messages on connection-oriented sockets.  "
7849 "Expects an integer boolean flag."
7850 msgstr ""
7851 "接続志向のソケットに対する keep-alive メッセージの送信を有効にする。 ブール値"
7852 "の整数フラグをとる。"
7853
7854 #. type: TP
7855 #: build/C/man7/socket.7:293
7856 #, no-wrap
7857 msgid "B<SO_LINGER>"
7858 msgstr "B<SO_LINGER>"
7859
7860 #. type: Plain text
7861 #: build/C/man7/socket.7:301
7862 msgid ""
7863 "Sets or gets the B<SO_LINGER> option.  The argument is a I<linger> structure."
7864 msgstr ""
7865 "B<SO_LINGER> オプションを取得・設定する。引き数には I<linger> 構造体を取る。"
7866
7867 #. type: Plain text
7868 #: build/C/man7/socket.7:308
7869 #, no-wrap
7870 msgid ""
7871 "struct linger {\n"
7872 "    int l_onoff;    /* linger active */\n"
7873 "    int l_linger;   /* how many seconds to linger for */\n"
7874 "};\n"
7875 msgstr ""
7876 "struct linger {\n"
7877 "    int l_onoff;    /* linger active */\n"
7878 "    int l_linger;   /* how many seconds to linger for */\n"
7879 "};\n"
7880
7881 #. type: Plain text
7882 #: build/C/man7/socket.7:322
7883 msgid ""
7884 "When enabled, a B<close>(2)  or B<shutdown>(2)  will not return until all "
7885 "queued messages for the socket have been successfully sent or the linger "
7886 "timeout has been reached.  Otherwise, the call returns immediately and the "
7887 "closing is done in the background.  When the socket is closed as part of "
7888 "B<exit>(2), it always lingers in the background."
7889 msgstr ""
7890 "有効になっていると、 B<close>(2)  や B<shutdown>(2)  は、そのソケットにキュー"
7891 "イングされたメッセージがすべて送信完了するか、 linger (居残り) タイムアウトに"
7892 "なるまで返らない。無効になっていると、 これらのコールはただちに戻り、クローズ"
7893 "動作はバックグラウンドで行われる。 ソケットのクローズを B<exit>(2)  の一部と"
7894 "して行った場合には、残っているソケットの クローズ動作は必ずバックグラウンドに"
7895 "送られる。"
7896
7897 #. type: TP
7898 #: build/C/man7/socket.7:322
7899 #, no-wrap
7900 msgid "B<SO_OOBINLINE>"
7901 msgstr "B<SO_OOBINLINE>"
7902
7903 #.  don't document it because it can do too much harm.
7904 #. .B SO_NO_CHECK
7905 #. type: Plain text
7906 #: build/C/man7/socket.7:331
7907 msgid ""
7908 "If this option is enabled, out-of-band data is directly placed into the "
7909 "receive data stream.  Otherwise out-of-band data is only passed when the "
7910 "B<MSG_OOB> flag is set during receiving."
7911 msgstr ""
7912 "このオプションを有効にすると、帯域外データ (out-of-band data) は 受信データス"
7913 "トリーム中に置かれる。有効にしなければ、 帯域外データは受信時に B<MSG_OOB> フ"
7914 "ラグがセットされている場合に限って渡される。"
7915
7916 #. type: TP
7917 #: build/C/man7/socket.7:331
7918 #, no-wrap
7919 msgid "B<SO_PASSCRED>"
7920 msgstr "B<SO_PASSCRED>"
7921
7922 #.  FIXME Document SO_PASSSEC, added in 2.6.18; there is some info
7923 #.  in the 2.6.18 ChangeLog
7924 #. type: Plain text
7925 #: build/C/man7/socket.7:340
7926 msgid ""
7927 "Enable or disable the receiving of the B<SCM_CREDENTIALS> control message.  "
7928 "For more information see B<unix>(7)."
7929 msgstr ""
7930 "B<SCM_CREDENTIALS> 制御メッセージの受信を有効/無効にする。詳細は B<unix>(7)  "
7931 "を参照のこと。"
7932
7933 #. type: TP
7934 #: build/C/man7/socket.7:340
7935 #, no-wrap
7936 msgid "B<SO_PEERCRED>"
7937 msgstr "B<SO_PEERCRED>"
7938
7939 #. type: Plain text
7940 #: build/C/man7/socket.7:360
7941 msgid ""
7942 "Return the credentials of the foreign process connected to this socket.  "
7943 "This is only possible for connected B<AF_UNIX> stream sockets and B<AF_UNIX> "
7944 "stream and datagram socket pairs created using B<socketpair>(2); see B<unix>"
7945 "(7).  The returned credentials are those that were in effect at the time of "
7946 "the call to B<connect>(2)  or B<socketpair>(2).  Argument is a I<ucred> "
7947 "structure.  This socket option is read-only."
7948 msgstr ""
7949 "このソケットに接続してきた外部プロセスの信任状 (credential) を返す。\n"
7950 "このソケットオプションが利用できるのは、接続された B<AF_UNIX> ストリームソ"
7951 "ケット間、\n"
7952 "および B<socketpair>(2) を使って作成された B<AF_UNIX> のストリームソケット"
7953 "と\n"
7954 "データグラムソケットのペアだけである。\n"
7955 "B<unix>(7)  を参照のこと。\n"
7956 "B<connect>(2) や B<socketpair>(2) が呼ばれた時に有効であった信任状が返され"
7957 "る。\n"
7958 "引き数は I<ucred> 構造体である。\n"
7959 "このソケットオプションは読み込み専用である。"
7960
7961 #. type: TP
7962 #: build/C/man7/socket.7:360
7963 #, no-wrap
7964 msgid "B<SO_PRIORITY>"
7965 msgstr "B<SO_PRIORITY>"
7966
7967 #. type: Plain text
7968 #: build/C/man7/socket.7:373
7969 msgid ""
7970 "Set the protocol-defined priority for all packets to be sent on this "
7971 "socket.  Linux uses this value to order the networking queues: packets with "
7972 "a higher priority may be processed first depending on the selected device "
7973 "queueing discipline.  For B<ip>(7), this also sets the IP type-of-service "
7974 "(TOS) field for outgoing packets.  Setting a priority outside the range 0 to "
7975 "6 requires the B<CAP_NET_ADMIN> capability."
7976 msgstr ""
7977 "プロトコルで定義された優先度を、このソケットから 送信される全てのパケットに"
7978 "セットする。 Linux はネットワークキュー内部の 整列にこの値を用いる。高い優先"
7979 "度を持っているパケットは先に処理される。 ただしそのデバイスのキュー処理のやり"
7980 "方に依存する。 B<ip>(7)  では、外向けパケットの IP type-of-service (TOS) "
7981 "フィールドにもこの値が設定される。 0 から 6 以外の優先度をセットするには "
7982 "B<CAP_NET_ADMIN> ケーパビリティが必要である。"
7983
7984 #. type: TP
7985 #: build/C/man7/socket.7:373
7986 #, no-wrap
7987 msgid "B<SO_PROTOCOL> (since Linux 2.6.32)"
7988 msgstr "B<SO_PROTOCOL> (Linux 2.6.32 以降)"
7989
7990 #. type: Plain text
7991 #: build/C/man7/socket.7:381
7992 msgid ""
7993 "Retrieves the socket protocol as an integer, returning a value such as "
7994 "B<IPPROTO_SCTP>.  See B<socket>(2)  for details.  This socket option is read-"
7995 "only."
7996 msgstr ""
7997 "ソケットのプロトコルを整数で取得する。 B<IPPROTO_SCTP> のような値が返され"
7998 "る。\n"
7999 "詳細は B<socket>(2) を参照。このソケットオプションは読み込み専用である。"
8000
8001 #. type: TP
8002 #: build/C/man7/socket.7:381
8003 #, no-wrap
8004 msgid "B<SO_RCVBUF>"
8005 msgstr "B<SO_RCVBUF>"
8006
8007 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8008 #. type: Plain text
8009 #: build/C/man7/socket.7:396
8010 msgid ""
8011 "Sets or gets the maximum socket receive buffer in bytes.  The kernel doubles "
8012 "this value (to allow space for bookkeeping overhead)  when it is set using "
8013 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8014 "The default value is set by the I</proc/sys/net/core/rmem_default> file, and "
8015 "the maximum allowed value is set by the I</proc/sys/net/core/rmem_max> "
8016 "file.  The minimum (doubled) value for this option is 256."
8017 msgstr ""
8018 "ソケットの受信バッファの最大サイズを設定・取得する (バイト単位)。 "
8019 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8020 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8021 "値を返す。 デフォルトの値は I</proc/sys/net/core/rmem_default> ファイルで設定"
8022 "され、許容される最大の値は I</proc/sys/net/core/rmem_max> ファイルで設定され"
8023 "る。 このオプションの最小値は (2倍した値で) 256 である。"
8024
8025 #. type: TP
8026 #: build/C/man7/socket.7:396
8027 #, no-wrap
8028 msgid "B<SO_RCVBUFFORCE> (since Linux 2.6.14)"
8029 msgstr "B<SO_RCVBUFFORCE> (Linux 2.6.14 以降)"
8030
8031 #. type: Plain text
8032 #: build/C/man7/socket.7:405
8033 msgid ""
8034 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8035 "perform the same task as B<SO_RCVBUF>, but the I<rmem_max> limit can be "
8036 "overridden."
8037 msgstr ""
8038 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8039 "ス) は B<SO_RCVBUF> と同じことを実行できる。 ただし、上限 I<rmem_max> を上書"
8040 "きすることができる。"
8041
8042 #. type: TP
8043 #: build/C/man7/socket.7:405
8044 #, no-wrap
8045 msgid "B<SO_RCVLOWAT> and B<SO_SNDLOWAT>"
8046 msgstr "B<SO_RCVLOWAT> と B<SO_SNDLOWAT>"
8047
8048 #.  See http://marc.theaimsgroup.com/?l=linux-kernel&m=111049368106984&w=2
8049 #.  Tested on kernel 2.6.14 -- mtk, 30 Nov 05
8050 #. type: Plain text
8051 #: build/C/man7/socket.7:434
8052 msgid ""
8053 "Specify the minimum number of bytes in the buffer until the socket layer "
8054 "will pass the data to the protocol (B<SO_SNDLOWAT>)  or the user on "
8055 "receiving (B<SO_RCVLOWAT>).  These two values are initialized to 1.  "
8056 "B<SO_SNDLOWAT> is not changeable on Linux (B<setsockopt>(2)  fails with the "
8057 "error B<ENOPROTOOPT>).  B<SO_RCVLOWAT> is changeable only since Linux 2.4.  "
8058 "The B<select>(2)  and B<poll>(2)  system calls currently do not respect the "
8059 "B<SO_RCVLOWAT> setting on Linux, and mark a socket readable when even a "
8060 "single byte of data is available.  A subsequent read from the socket will "
8061 "block until B<SO_RCVLOWAT> bytes are available."
8062 msgstr ""
8063 "バッファ中に溜めることのできるデータの最小値を指定する。 このサイズを越える"
8064 "と、ソケット層はそのデータをプロトコルに渡し (B<SO_SNDLOWAT>)、 受信時には"
8065 "ユーザに渡す (B<SO_RCVLOWAT>)。 これら二つの値は 1 に初期化される。 "
8066 "B<SO_SNDLOWAT> は Linux では変更できない (B<setsockopt>(2)  は "
8067 "B<ENOPROTOOPT> エラーで失敗する)。 B<SO_RCVLOWAT> は Linux 2.4 以降でのみ変更"
8068 "可能である。 現状、Linux ではシステムコール B<select>(2)  と B<poll>(2)  は "
8069 "B<SO_RCVLOWAT> の設定を考慮に入れずに動作し、 データが1バイト利用可能になった"
8070 "だけでも、 ソケットは読み出し可能とのマークをつける。 一方、それに続けて行う"
8071 "ソケットからの read は B<SO_RCVLOWAT> バイトのデータが利用可能になるまで停止"
8072 "してしまう。"
8073
8074 #. type: TP
8075 #: build/C/man7/socket.7:434
8076 #, no-wrap
8077 msgid "B<SO_RCVTIMEO> and B<SO_SNDTIMEO>"
8078 msgstr "B<SO_RCVTIMEO> と B<SO_SNDTIMEO>"
8079
8080 #.  Not implemented in 2.0.
8081 #.  Implemented in 2.1.11 for getsockopt: always return a zero struct.
8082 #.  Implemented in 2.3.41 for setsockopt, and actually used.
8083 #.  in fact to EAGAIN
8084 #. type: Plain text
8085 #: build/C/man7/socket.7:465
8086 msgid ""
8087 "Specify the receiving or sending timeouts until reporting an error.  The "
8088 "argument is a I<struct timeval>.  If an input or output function blocks for "
8089 "this period of time, and data has been sent or received, the return value of "
8090 "that function will be the amount of data transferred; if no data has been "
8091 "transferred and the timeout has been reached then -1 is returned with "
8092 "I<errno> set to B<EAGAIN> or B<EWOULDBLOCK> just as if the socket was "
8093 "specified to be nonblocking.  If the timeout is set to zero (the default)  "
8094 "then the operation will never timeout.  Timeouts only have effect for system "
8095 "calls that perform socket I/O (e.g., B<read>(2), B<recvmsg>(2), B<send>(2), "
8096 "B<sendmsg>(2)); timeouts have no effect for B<select>(2), B<poll>(2), "
8097 "B<epoll_wait>(2), etc."
8098 msgstr ""
8099 "送信・受信のタイムアウトを指定する。これを越えるとエラーを報告する。 引き数"
8100 "は I<struct timeval> である。 入出力関数がタイムアウト時間の間ブロックされ、"
8101 "かつデータの送信または 受信が行われていた場合は、転送されたデータ量が関数の返"
8102 "り値となる。 何もデータが転送されずにタイムアウトに達した場合は、 -1 を返"
8103 "し、 I<errno> に B<EAGAIN> か B<EWOULDBLOCK> を設定され、 あたかもソケットに"
8104 "非ブロッキングが指定されたように見える。 タイムアウト値に (デフォルト値であ"
8105 "る) 0 に設定すると、 操作は決してタイムアウトしなくなる。 タイムアウトが影響"
8106 "を及ぼすのは、 ソケット I/O を実行するシステムコールだけ (例えば B<read>(2), "
8107 "B<recvmsg>(2), B<send>(2), B<sendmsg>(2))  である。 B<select>(2), B<poll>"
8108 "(2), B<epoll_wait>(2)  などにはタイムアウトは影響を及ぼさない。"
8109
8110 #. type: TP
8111 #: build/C/man7/socket.7:465
8112 #, no-wrap
8113 msgid "B<SO_REUSEADDR>"
8114 msgstr "B<SO_REUSEADDR>"
8115
8116 #. type: Plain text
8117 #: build/C/man7/socket.7:480
8118 msgid ""
8119 "Indicates that the rules used in validating addresses supplied in a B<bind>"
8120 "(2)  call should allow reuse of local addresses.  For B<AF_INET> sockets "
8121 "this means that a socket may bind, except when there is an active listening "
8122 "socket bound to the address.  When the listening socket is bound to "
8123 "B<INADDR_ANY> with a specific port then it is not possible to bind to this "
8124 "port for any local address.  Argument is an integer boolean flag."
8125 msgstr ""
8126 "B<bind>(2)  コールに与えられたアドレスが正しいかを判断するルールで、 ローカル"
8127 "アドレスの再利用を可能にする。 つまり B<AF_INET> ソケットなら、そのアドレスに"
8128 "バインドされたアクティブな listen 状態のソケットが存在しない限り、バインドが"
8129 "行える。 listen 状態のソケットがアドレス B<INADDR_ANY> で特定のポートにバイン"
8130 "ドされている場合には、 このポートに対しては、どんなローカルアドレスでもバイン"
8131 "ドできない。 引き数はブール整数のフラグである。"
8132
8133 #. type: TP
8134 #: build/C/man7/socket.7:480
8135 #, no-wrap
8136 msgid "B<SO_SNDBUF>"
8137 msgstr "B<SO_SNDBUF>"
8138
8139 #.  Most (all?) other implementations do not do this -- MTK, Dec 05
8140 #. type: Plain text
8141 #: build/C/man7/socket.7:495
8142 msgid ""
8143 "Sets or gets the maximum socket send buffer in bytes.  The kernel doubles "
8144 "this value (to allow space for bookkeeping overhead)  when it is set using "
8145 "B<setsockopt>(2), and this doubled value is returned by B<getsockopt>(2).  "
8146 "The default value is set by the I</proc/sys/net/core/wmem_default> file and "
8147 "the maximum allowed value is set by the I</proc/sys/net/core/wmem_max> "
8148 "file.  The minimum (doubled) value for this option is 2048."
8149 msgstr ""
8150 "ソケットの送信バッファの最大サイズを設定・取得する (バイト単位)。 "
8151 "B<setsockopt>(2)  を使って値が設定されたときに (管理オーバヘッド用の領域を確"
8152 "保するために)  カーネルはこの値を 2倍し、 B<getsockopt>(2)  はこの 2倍された"
8153 "値を返す。 デフォルトの値は I</proc/sys/net/core/wmem_default> ファイルで設定"
8154 "され、許容される最大の値は I</proc/sys/net/core/wmem_max> ファイルで設定され"
8155 "る。 このオプションの最小値は (2倍した値で) 2048 である。"
8156
8157 #. type: TP
8158 #: build/C/man7/socket.7:495
8159 #, no-wrap
8160 msgid "B<SO_SNDBUFFORCE> (since Linux 2.6.14)"
8161 msgstr "B<SO_SNDBUFFORCE> (Linux 2.6.14 以降)"
8162
8163 #. type: Plain text
8164 #: build/C/man7/socket.7:504
8165 msgid ""
8166 "Using this socket option, a privileged (B<CAP_NET_ADMIN>)  process can "
8167 "perform the same task as B<SO_SNDBUF>, but the I<wmem_max> limit can be "
8168 "overridden."
8169 msgstr ""
8170 "このソケットオプションを使うと、特権プロセス (B<CAP_NET_ADMIN> を持つプロセ"
8171 "ス) は B<SO_SNDBUF> と同じことを実行できる。 ただし、上限 I<wmem_max> を上書"
8172 "きすることができる。"
8173
8174 #. type: TP
8175 #: build/C/man7/socket.7:504
8176 #, no-wrap
8177 msgid "B<SO_TIMESTAMP>"
8178 msgstr "B<SO_TIMESTAMP>"
8179
8180 #. type: Plain text
8181 #: build/C/man7/socket.7:520
8182 msgid ""
8183 "Enable or disable the receiving of the B<SO_TIMESTAMP> control message.  The "
8184 "timestamp control message is sent with level B<SOL_SOCKET> and the "
8185 "I<cmsg_data> field is a I<struct timeval> indicating the reception time of "
8186 "the last packet passed to the user in this call.  See B<cmsg>(3)  for "
8187 "details on control messages."
8188 msgstr ""
8189 "B<SO_TIMESTAMP> 制御メッセージの受信を有効/無効にする。 タイムスタンプ制御"
8190 "メッセージはレベル B<SOL_SOCKET> で送信され、 I<cmsg_data> フィールドはこのシ"
8191 "ステムコールでユーザに渡した 最後のパケットの受信時刻を示す I<struct "
8192 "timeval> である。 制御メッセージの詳細については B<cmsg>(3)  を参照。"
8193
8194 #. type: TP
8195 #: build/C/man7/socket.7:520
8196 #, no-wrap
8197 msgid "B<SO_TYPE>"
8198 msgstr "B<SO_TYPE>"
8199
8200 #. type: Plain text
8201 #: build/C/man7/socket.7:525
8202 msgid ""
8203 "Gets the socket type as an integer (e.g., B<SOCK_STREAM>).  This socket "
8204 "option is read-only."
8205 msgstr ""
8206 "ソケットのタイプを整数で取得する (例: B<SOCK_STREAM>)。\n"
8207 "このソケットオプションは読み出し専用である。"
8208
8209 #. type: SS
8210 #: build/C/man7/socket.7:525
8211 #, no-wrap
8212 msgid "Signals"
8213 msgstr "シグナル"
8214
8215 #. type: Plain text
8216 #: build/C/man7/socket.7:536
8217 msgid ""
8218 "When writing onto a connection-oriented socket that has been shut down (by "
8219 "the local or the remote end)  B<SIGPIPE> is sent to the writing process and "
8220 "B<EPIPE> is returned.  The signal is not sent when the write call specified "
8221 "the B<MSG_NOSIGNAL> flag."
8222 msgstr ""
8223 "(ローカルもしくはリモート側で) 切断された 接続指向 (connection-oriented) のソ"
8224 "ケットに対して 書き込みを行うと、その書き込みを行ったプロセスに B<SIGPIPE> が"
8225 "送られ、 B<EPIPE> が返される。 write 呼び出しに B<MSG_NOSIGNAL> フラグを指定"
8226 "していた場合はシグナルは送られない。"
8227
8228 #. type: Plain text
8229 #: build/C/man7/socket.7:561
8230 msgid ""
8231 "When requested with the B<FIOSETOWN> B<fcntl>(2)  or B<SIOCSPGRP> B<ioctl>"
8232 "(2), B<SIGIO> is sent when an I/O event occurs.  It is possible to use "
8233 "B<poll>(2)  or B<select>(2)  in the signal handler to find out which socket "
8234 "the event occurred on.  An alternative (in Linux 2.2) is to set a real-time "
8235 "signal using the B<F_SETSIG> B<fcntl>(2); the handler of the real time "
8236 "signal will be called with the file descriptor in the I<si_fd> field of its "
8237 "I<siginfo_t>.  See B<fcntl>(2)  for more information."
8238 msgstr ""
8239 "B<FIOSETOWN> B<fcntl>(2)  や B<SIOCSPGRP> B<ioctl>(2)  をプロセスまたはプロセ"
8240 "スグループに指定しておくと、 I/O イベントが起きたときに B<SIGIO> が送られ"
8241 "る。 B<poll>(2)  や B<select>(2)  をシグナルハンドラ内で用いれば、どのソケッ"
8242 "トでイベントが起こったかを 知ることができる。 (Linux 2.2 における) 別の方法と"
8243 "しては、 B<F_SETSIG> B<fcntl>(2)  を用いてリアルタイムシグナルを設定するやり"
8244 "方もある。 リアルタイムシグナルのハンドラは、 I<siginfo_t> の I<si_fd> フィー"
8245 "ルドにファイルディスクリプタが入った状態で呼び出される。 詳細は B<fcntl>(2)  "
8246 "を参照のこと。"
8247
8248 #.  .SS Ancillary Messages
8249 #. type: Plain text
8250 #: build/C/man7/socket.7:569
8251 msgid ""
8252 "Under some circumstances (e.g., multiple processes accessing a single "
8253 "socket), the condition that caused the B<SIGIO> may have already disappeared "
8254 "when the process reacts to the signal.  If this happens, the process should "
8255 "wait again because Linux will resend the signal later."
8256 msgstr ""
8257 "状況によっては (例えば複数のプロセスが一つのソケットにアクセスしているな"
8258 "ど)、 B<SIGIO> の原因となった状態は、プロセスがそのシグナルへの対応を行ったと"
8259 "きには 消えてしまっているかもしれない。 この場合は、プロセスは再び待つように"
8260 "すべきである。 Linux は同じシグナルを後で再送するからである。"
8261
8262 #. type: SS
8263 #: build/C/man7/socket.7:569
8264 #, no-wrap
8265 msgid "/proc interfaces"
8266 msgstr "/proc インタフェース"
8267
8268 #. type: Plain text
8269 #: build/C/man7/socket.7:573
8270 msgid ""
8271 "The core socket networking parameters can be accessed via files in the "
8272 "directory I</proc/sys/net/core/>."
8273 msgstr ""
8274 "core のソケットのネットワーキングパラメータには、 I</proc/sys/net/core/> ディ"
8275 "レクトリ内のファイルを通してアクセスできる。"
8276
8277 #. type: TP
8278 #: build/C/man7/socket.7:573
8279 #, no-wrap
8280 msgid "I<rmem_default>"
8281 msgstr "I<rmem_default>"
8282
8283 #. type: Plain text
8284 #: build/C/man7/socket.7:576
8285 msgid "contains the default setting in bytes of the socket receive buffer."
8286 msgstr "ソケットの受信バッファサイズのデフォルト値 (バイト単位)。"
8287
8288 #. type: TP
8289 #: build/C/man7/socket.7:576
8290 #, no-wrap
8291 msgid "I<rmem_max>"
8292 msgstr "I<rmem_max>"
8293
8294 #. type: Plain text
8295 #: build/C/man7/socket.7:582
8296 msgid ""
8297 "contains the maximum socket receive buffer size in bytes which a user may "
8298 "set by using the B<SO_RCVBUF> socket option."
8299 msgstr ""
8300 "B<SO_RCVBUF> ソケットオプションを用いてユーザが設定できる ソケットの受信バッ"
8301 "ファサイズの最大値 (バイト単位)。"
8302
8303 #. type: TP
8304 #: build/C/man7/socket.7:582
8305 #, no-wrap
8306 msgid "I<wmem_default>"
8307 msgstr "I<wmem_default>"
8308
8309 #. type: Plain text
8310 #: build/C/man7/socket.7:585
8311 msgid "contains the default setting in bytes of the socket send buffer."
8312 msgstr "ソケットの送信バッファサイズのデフォルト値 (バイト単位)。"
8313
8314 #. type: TP
8315 #: build/C/man7/socket.7:585
8316 #, no-wrap
8317 msgid "I<wmem_max>"
8318 msgstr "I<wmem_max>"
8319
8320 #. type: Plain text
8321 #: build/C/man7/socket.7:591
8322 msgid ""
8323 "contains the maximum socket send buffer size in bytes which a user may set "
8324 "by using the B<SO_SNDBUF> socket option."
8325 msgstr ""
8326 "B<SO_SNDBUF> ソケットオプションを用いてユーザが設定できる ソケットの送信バッ"
8327 "ファサイズの最大値 (バイト単位)。"
8328
8329 #. type: TP
8330 #: build/C/man7/socket.7:591
8331 #, no-wrap
8332 msgid "I<message_cost> and I<message_burst>"
8333 msgstr "I<message_cost> と I<message_burst>"
8334
8335 #. type: Plain text
8336 #: build/C/man7/socket.7:595
8337 msgid ""
8338 "configure the token bucket filter used to load limit warning messages caused "
8339 "by external network events."
8340 msgstr ""
8341 "トークン・バケット・フィルターを設定する。 これは外部のネットワークイベントに"
8342 "よって引き起こされた 負荷限界の警告メッセージに用いられる。"
8343
8344 #. type: TP
8345 #: build/C/man7/socket.7:595
8346 #, no-wrap
8347 msgid "I<netdev_max_backlog>"
8348 msgstr "I<netdev_max_backlog>"
8349
8350 #. type: Plain text
8351 #: build/C/man7/socket.7:598
8352 msgid "Maximum number of packets in the global input queue."
8353 msgstr "グローバルな入力キューにおける最大のパケット数。"
8354
8355 #. type: TP
8356 #: build/C/man7/socket.7:598
8357 #, no-wrap
8358 msgid "I<optmem_max>"
8359 msgstr "I<optmem_max>"
8360
8361 #.  netdev_fastroute is not documented because it is experimental
8362 #. type: Plain text
8363 #: build/C/man7/socket.7:603
8364 msgid ""
8365 "Maximum length of ancillary data and user control data like the iovecs per "
8366 "socket."
8367 msgstr ""
8368 "ソケットあたりの、補助データ (ancillary data) とユーザ制御データ (iovecs のよ"
8369 "うなもの) との和の最大長。"
8370
8371 #. type: SS
8372 #: build/C/man7/socket.7:603
8373 #, no-wrap
8374 msgid "Ioctls"
8375 msgstr "ioctl"
8376
8377 #. type: Plain text
8378 #: build/C/man7/socket.7:606
8379 msgid "These operations can be accessed using B<ioctl>(2):"
8380 msgstr "以下に示す操作には B<ioctl>(2)  を用いてアクセスできる。"
8381
8382 #. type: Plain text
8383 #: build/C/man7/socket.7:610
8384 #, no-wrap
8385 msgid "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8386 msgstr "I<error>B< = ioctl(>I<ip_socket>B<, >I<ioctl_type>B<, >I<&value_result>B<);>\n"
8387
8388 #. type: TP
8389 #: build/C/man7/socket.7:612
8390 #, no-wrap
8391 msgid "B<SIOCGSTAMP>"
8392 msgstr "B<SIOCGSTAMP>"
8393
8394 #. type: Plain text
8395 #: build/C/man7/socket.7:636
8396 msgid ""
8397 "Return a I<struct timeval> with the receive timestamp of the last packet "
8398 "passed to the user.  This is useful for accurate round trip time "
8399 "measurements.  See B<setitimer>(2)  for a description of I<struct timeval>.  "
8400 "This ioctl should only be used if the socket option B<SO_TIMESTAMP> is not "
8401 "set on the socket.  Otherwise, it returns the timestamp of the last packet "
8402 "that was received while B<SO_TIMESTAMP> was not set, or it fails if no such "
8403 "packet has been received, (i.e., B<ioctl>(2)  returns -1 with I<errno> set "
8404 "to B<ENOENT>)."
8405 msgstr ""
8406 "最後にユーザに渡されたパケットの受信タイムスタンプを I<struct timeval> に入れ"
8407 "て返す。 これは round trip 時間を正確に測りたいときに便利である。 I<struct "
8408 "timeval> の説明は B<setitimer>(2)  を見てほしい。 この ioctl は、ソケットオプ"
8409 "ション B<SO_TIMESTAMP> がソケットにセットされていない場合にのみ使用すべきであ"
8410 "る。 さもなければ、この ioctl は B<SO_TIMESTAMP> がセットされていなかった間に"
8411 "受信した最後のパケットの時刻を返すか、 そのようなパケットを受信していない場合"
8412 "には失敗する (つまり、 B<ioctl>(2)  は -1 を返し、 I<errno> に B<ENOENT> を"
8413 "セットする)。"
8414
8415 #. type: TP
8416 #: build/C/man7/socket.7:636
8417 #, no-wrap
8418 msgid "B<SIOCSPGRP>"
8419 msgstr "B<SIOCSPGRP>"
8420
8421 #. type: Plain text
8422 #: build/C/man7/socket.7:655
8423 msgid ""
8424 "Set the process or process group to send B<SIGIO> or B<SIGURG> signals to "
8425 "when an asynchronous I/O operation has finished or urgent data is "
8426 "available.  The argument is a pointer to a I<pid_t>.  If the argument is "
8427 "positive, send the signals to that process.  If the argument is negative, "
8428 "send the signals to the process group with the ID of the absolute value of "
8429 "the argument.  The process may only choose itself or its own process group "
8430 "to receive signals unless it has the B<CAP_KILL> capability or an effective "
8431 "UID of 0."
8432 msgstr ""
8433 "非同期 I/O 操作の終了時や緊急データの受信時に B<SIGIO> や B<SIGURG> シグナル"
8434 "群を送るプロセスやプロセスグループを設定する。 引き数は I<pid_t> へのポインタ"
8435 "である。 引き数が正だと、そのプロセスにシグナルが送られる。負だと、 引き数の"
8436 "絶対値を ID に持つプロセスグループにシグナルが送られる。 シグナル受信先には、"
8437 "自分自身のプロセス / 自分の所属するプロセスグループ しか指定できない。但し、 "
8438 "B<CAP_KILL> ケーパビリティを持っている場合、及び実効ユーザ ID が 0 のプロセス"
8439 "の場合は この限りではない。"
8440
8441 #. type: TP
8442 #: build/C/man7/socket.7:655
8443 #, no-wrap
8444 msgid "B<FIOASYNC>"
8445 msgstr "B<FIOASYNC>"
8446
8447 #. type: Plain text
8448 #: build/C/man7/socket.7:665
8449 msgid ""
8450 "Change the B<O_ASYNC> flag to enable or disable asynchronous I/O mode of the "
8451 "socket.  Asynchronous I/O mode means that the B<SIGIO> signal or the signal "
8452 "set with B<F_SETSIG> is raised when a new I/O event occurs."
8453 msgstr ""
8454 "B<O_ASYNC> フラグを変更し、ソケットの非同期 (asynchronous) I/O モードを 有効/"
8455 "無効にする。非同期 I/O モードでは、 新しい I/O イベントが起きたときに、 "
8456 "B<SIGIO> シグナルや B<F_SETSIG> で設定されたシグナル・セットが発行される。"
8457
8458 #. type: Plain text
8459 #: build/C/man7/socket.7:673
8460 msgid ""
8461 "Argument is an integer boolean flag.  (This operation is synonymous with the "
8462 "use of B<fcntl>(2)  to set the B<O_ASYNC> flag.)"
8463 msgstr ""
8464 "引き数はブール整数のフラグである。 (この操作は B<fcntl>(2)  を使って "
8465 "B<O_ASYNC> フラグをセットするのと同じ意味である。)"
8466
8467 #. type: TP
8468 #: build/C/man7/socket.7:673
8469 #, no-wrap
8470 msgid "B<SIOCGPGRP>"
8471 msgstr "B<SIOCGPGRP>"
8472
8473 #. type: Plain text
8474 #: build/C/man7/socket.7:682
8475 msgid ""
8476 "Get the current process or process group that receives B<SIGIO> or B<SIGURG> "
8477 "signals, or 0 when none is set."
8478 msgstr ""
8479 "B<SIGIO> や B<SIGURG> を受信したカレントプロセス・プロセスグループを取得す"
8480 "る。 ない場合は 0 が返る。"
8481
8482 #. type: Plain text
8483 #: build/C/man7/socket.7:686
8484 msgid "Valid B<fcntl>(2)  operations:"
8485 msgstr "有効な B<fcntl>(2)  操作:"
8486
8487 #. type: TP
8488 #: build/C/man7/socket.7:686
8489 #, no-wrap
8490 msgid "B<FIOGETOWN>"
8491 msgstr "B<FIOGETOWN>"
8492
8493 #. type: Plain text
8494 #: build/C/man7/socket.7:691
8495 msgid "The same as the B<SIOCGPGRP> B<ioctl>(2)."
8496 msgstr "B<SIOCGPGRP> B<ioctl>(2)  と同じ。"
8497
8498 #. type: TP
8499 #: build/C/man7/socket.7:691
8500 #, no-wrap
8501 msgid "B<FIOSETOWN>"
8502 msgstr "B<FIOSETOWN>"
8503
8504 #. type: Plain text
8505 #: build/C/man7/socket.7:696
8506 msgid "The same as the B<SIOCSPGRP> B<ioctl>(2)."
8507 msgstr "B<SIOCSPGRP> B<ioctl>(2)  と同じ。"
8508
8509 #. type: Plain text
8510 #: build/C/man7/socket.7:710
8511 msgid ""
8512 "B<SO_BINDTODEVICE> was introduced in Linux 2.0.30.  B<SO_PASSCRED> is new in "
8513 "Linux 2.2.  The I</proc> interfaces was introduced in Linux 2.2.  "
8514 "B<SO_RCVTIMEO> and B<SO_SNDTIMEO> are supported since Linux 2.3.41.  "
8515 "Earlier, timeouts were fixed to a protocol-specific setting, and could not "
8516 "be read or written."
8517 msgstr ""
8518 "B<SO_BINDTODEVICE> は Linux 2.0.30 で導入された。 B<SO_PASSCRED> は Linux "
8519 "2.2 で登場した。 I</proc> インタフェースは Linux 2.2 で導入された。 "
8520 "B<SO_RCVTIMEO> と B<SO_SNDTIMEO> は Linux 2.3.41 以降でサポートされている。 "
8521 "それ以前は、タイムアウトはプロトコル固有の固定の設定値で、 読み書きをすること"
8522 "はできなかった。"
8523
8524 #. type: Plain text
8525 #: build/C/man7/socket.7:715
8526 msgid ""
8527 "Linux assumes that half of the send/receive buffer is used for internal "
8528 "kernel structures; thus the values in the corresponding I</proc> files are "
8529 "twice what can be observed on the wire."
8530 msgstr ""
8531 "Linux は、送受信バッファの半分を内部のカーネル構造体で用いると仮定している。 "
8532 "したがって、対応する I</proc> ファイルはネットワーク回線上での大きさの 2 倍に"
8533 "なる。"
8534
8535 #. type: Plain text
8536 #: build/C/man7/socket.7:728
8537 msgid ""
8538 "Linux will only allow port reuse with the B<SO_REUSEADDR> option when this "
8539 "option was set both in the previous program that performed a B<bind>(2)  to "
8540 "the port and in the program that wants to reuse the port.  This differs from "
8541 "some implementations (e.g., FreeBSD)  where only the later program needs to "
8542 "set the B<SO_REUSEADDR> option.  Typically this difference is invisible, "
8543 "since, for example, a server program is designed to always set this option."
8544 msgstr ""
8545 "Linux では、 B<SO_REUSEADDR> オプションでポートの再利用が許可されるのは、 そ"
8546 "のポートに対して B<bind>(2)  を前に実行したプログラムとそのポートを再利用 し"
8547 "ようとするプログラムの両方で B<SO_REUSEADDR> がセットされた場合のみである。 "
8548 "この動作は (FreeBSD などの) いくつかの実装とは異なる。これらでは、 後でポート"
8549 "を再利用しようとするプログラムで B<SO_REUSEADDR> オプションをセットするだけで"
8550 "よい。 たいていはこの違いは見えない。なぜなら、例えばサーバプログラムは 常に"
8551 "このオプションをセットするように設計されるからである。"
8552
8553 #.  FIXME Document SO_ATTACH_FILTER and SO_DETACH_FILTER
8554 #.  .SH AUTHORS
8555 #.  This man page was written by Andi Kleen.
8556 #. type: Plain text
8557 #: build/C/man7/socket.7:741
8558 msgid ""
8559 "The B<CONFIG_FILTER> socket options B<SO_ATTACH_FILTER> and "
8560 "B<SO_DETACH_FILTER> are not documented.  The suggested interface to use them "
8561 "is via the libpcap library."
8562 msgstr ""
8563 "B<CONFIG_FILTER> ソケットオプションである B<SO_ATTACH_FILTER> と "
8564 "B<SO_DETACH_FILTER> について記載されていない。これらは libpcap ライブラリを通"
8565 "して 用いる方が良い。"
8566
8567 #. type: Plain text
8568 #: build/C/man7/socket.7:752
8569 msgid ""
8570 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8571 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8572 msgstr ""
8573 "B<getsockopt>(2), B<setsockopt>(2), B<socket>(2), B<capabilities>(7), B<ddp>"
8574 "(7), B<ip>(7), B<packet>(7), B<tcp>(7), B<udp>(7), B<unix>(7)"
8575
8576 #. type: TH
8577 #: build/C/man2/socketcall.2:26
8578 #, no-wrap
8579 msgid "SOCKETCALL"
8580 msgstr "SOCKETCALL"
8581
8582 #. type: TH
8583 #: build/C/man2/socketcall.2:26
8584 #, no-wrap
8585 msgid "2007-06-28"
8586 msgstr "2007-06-28"
8587
8588 #. type: Plain text
8589 #: build/C/man2/socketcall.2:29
8590 msgid "socketcall - socket system calls"
8591 msgstr "socketcall - ソケット・システムコール"
8592
8593 #. type: Plain text
8594 #: build/C/man2/socketcall.2:31
8595 msgid "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8596 msgstr "B<int socketcall(int >I<call>B<, unsigned long *>I<args>B<);>"
8597
8598 #. type: Plain text
8599 #: build/C/man2/socketcall.2:39
8600 msgid ""
8601 "B<socketcall>()  is a common kernel entry point for the socket system "
8602 "calls.  I<call> determines which socket function to invoke.  I<args> points "
8603 "to a block containing the actual arguments, which are passed through to the "
8604 "appropriate call."
8605 msgstr ""
8606 "B<socketcall>()  はソケット・システムコールのための共通のカーネル・エント"
8607 "リ・ ポイント(kernel entry point)である。 I<call> はどのソケット関数を呼び出"
8608 "すかを指定する。 I<args> は適切なコールに渡すための実際の引き数を含んでいるブ"
8609 "ロックを指す。"
8610
8611 #. type: Plain text
8612 #: build/C/man2/socketcall.2:43
8613 msgid ""
8614 "User programs should call the appropriate functions by their usual names.  "
8615 "Only standard library implementors and kernel hackers need to know about "
8616 "B<socketcall>()."
8617 msgstr ""
8618 "ユーザー・プログラムは通常の名前を使用して適切な関数を呼び出すべきである。 標"
8619 "準ライブラリの実装者やカーネル・ハッカーのみが B<socketcall>()  について知る"
8620 "必要がある。"
8621
8622 #. type: Plain text
8623 #: build/C/man2/socketcall.2:46
8624 msgid ""
8625 "This call is specific to Linux, and should not be used in programs intended "
8626 "to be portable."
8627 msgstr ""
8628 "このコールは Linux 特有であり、移植を意図したプログラムで 使用してはいけな"
8629 "い。"
8630
8631 #. type: Plain text
8632 #: build/C/man2/socketcall.2:54
8633 msgid ""
8634 "On a few architectures, for example ia64, there is no B<socketcall>()  "
8635 "system call; instead B<socket>(2), B<accept>(2), B<bind>(2), and so on "
8636 "really are implemented as separate system calls."
8637 msgstr ""
8638 "ia64 などのいくつかのアーキテクチャでは、システムコール B<socketcall>()  が存"
8639 "在しない。実際には、その代わりに B<socket>(2), B<accept>(2), B<bind>(2)  など"
8640 "が独立したシステムコールとして実装されている。"
8641
8642 #. type: Plain text
8643 #: build/C/man2/socketcall.2:72
8644 msgid ""
8645 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8646 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8647 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8648 "(2), B<socket>(2), B<socketpair>(2)"
8649 msgstr ""
8650 "B<accept>(2), B<bind>(2), B<connect>(2), B<getpeername>(2), B<getsockname>"
8651 "(2), B<getsockopt>(2), B<listen>(2), B<recv>(2), B<recvfrom>(2), B<recvmsg>"
8652 "(2), B<send>(2), B<sendmsg>(2), B<sendto>(2), B<setsockopt>(2), B<shutdown>"
8653 "(2), B<socket>(2), B<socketpair>(2)"
8654
8655 #. type: TH
8656 #: build/C/man2/socketpair.2:40
8657 #, no-wrap
8658 msgid "SOCKETPAIR"
8659 msgstr "SOCKETPAIR"
8660
8661 #. type: TH
8662 #: build/C/man2/socketpair.2:40
8663 #, no-wrap
8664 msgid "2008-10-11"
8665 msgstr "2008-10-11"
8666
8667 #. type: Plain text
8668 #: build/C/man2/socketpair.2:43
8669 msgid "socketpair - create a pair of connected sockets"
8670 msgstr "socketpair - 接続されたソケットのペアを作成する"
8671
8672 #. type: Plain text
8673 #: build/C/man2/socketpair.2:50
8674 msgid ""
8675 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8676 ">I<sv>B<[2]);>"
8677 msgstr ""
8678 "B<int socketpair(int >I<domain>B<, int >I<type>B<, int >I<protocol>B<, int "
8679 ">I<sv>B<[2]);>"
8680
8681 #. type: Plain text
8682 #: build/C/man2/socketpair.2:61
8683 msgid ""
8684 "The B<socketpair>()  call creates an unnamed pair of connected sockets in "
8685 "the specified I<domain>, of the specified I<type>, and using the optionally "
8686 "specified I<protocol>.  For further details of these arguments, see B<socket>"
8687 "(2)."
8688 msgstr ""
8689 "B<socketpair>()  は、指定されたドメイン I<domain> に指定された種類 I<type> で"
8690 "名前のないソケットの接続されたペアを作成する。 I<protocol> が指定されると、こ"
8691 "のプロトコルを用いる。 これらの引き数の詳細は B<socket>(2)  を参照のこと。"
8692
8693 #. type: Plain text
8694 #: build/C/man2/socketpair.2:67
8695 msgid ""
8696 "The descriptors used in referencing the new sockets are returned in I<sv>[0] "
8697 "and I<sv>[1].  The two sockets are indistinguishable."
8698 msgstr ""
8699 "新しいソケットの参照に使用するディスクリプタ (descriptor) が I<sv>[0] と "
8700 "I<sv>[1] に返される。 二つのソケットは全く同じである。"
8701
8702 #. type: Plain text
8703 #: build/C/man2/socketpair.2:76
8704 msgid "The specified address family is not supported on this machine."
8705 msgstr "このマシンでは指定されたアドレス・ファミリがサポートされていない。"
8706
8707 #. type: Plain text
8708 #: build/C/man2/socketpair.2:81
8709 msgid ""
8710 "The address I<sv> does not specify a valid part of the process address space."
8711 msgstr "アドレス I<sv> がこのプロセスで使えるアドレス空間を指定していない。"
8712
8713 #. type: Plain text
8714 #: build/C/man2/socketpair.2:84
8715 msgid "Too many descriptors are in use by this process."
8716 msgstr "このプロセスが使用しているディスクリプタの数が多すぎる。"
8717
8718 #. type: Plain text
8719 #: build/C/man2/socketpair.2:90
8720 msgid "The specified protocol does not support creation of socket pairs."
8721 msgstr "指定されたプロトコルではソケットのペアの作成がサポートされていない。"
8722
8723 #. type: Plain text
8724 #: build/C/man2/socketpair.2:93
8725 msgid "The specified protocol is not supported on this machine."
8726 msgstr "このマシンでは指定されたプロトコルがサポートされていない。"
8727
8728 #. type: Plain text
8729 #: build/C/man2/socketpair.2:101
8730 msgid ""
8731 "4.4BSD, POSIX.1-2001.  The B<socketpair>()  function call appeared in "
8732 "4.2BSD.  It is generally portable to/from non-BSD systems supporting clones "
8733 "of the BSD socket layer (including System V variants)."
8734 msgstr ""
8735 "4.4BSD, POSIX.1-2001.  B<socketpair>()  関数コールは 4.2BSD で現われた。一般"
8736 "に (System V の変種を含めて)  BSD のソケット層のクローンをサポートしている、"
8737 "BSD 以外のシステムと、 互いに移植性がある。"
8738
8739 #. type: Plain text
8740 #: build/C/man2/socketpair.2:107
8741 msgid ""
8742 "On Linux, the only supported domain for this call is B<AF_UNIX> (or "
8743 "synonymously, B<AF_LOCAL>).  (Most implementations have the same "
8744 "restriction.)"
8745 msgstr ""
8746 "Linux では、この関数でサポートされているドメインは B<AF_UNIX> (または同義語で"
8747 "ある B<AF_LOCAL>)  だけである。 (ほとんどの実装で同じ制限がある)"
8748
8749 #. type: Plain text
8750 #: build/C/man2/socketpair.2:116
8751 msgid ""
8752 "Since Linux 2.6.27, B<socketpair>()  supports the B<SOCK_NONBLOCK> and "
8753 "B<SOCK_CLOEXEC> flags described in B<socket>(2)."
8754 msgstr ""
8755 "Linux 2.6.27 以降では、 B<socketpair>()  は、フラグ B<SOCK_NONBLOCK> と "
8756 "B<SOCK_CLOEXEC> に対応している。フラグの説明は B<socket>(2)  を参照のこと。"
8757
8758 #. type: Plain text
8759 #: build/C/man2/socketpair.2:129
8760 msgid ""
8761 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8762 msgstr ""
8763 "B<pipe>(2), B<read>(2), B<socket>(2), B<write>(2), B<socket>(7), B<unix>(7)"
8764
8765 #~ msgid "2010-06-13"
8766 #~ msgstr "2010-06-13"
8767
8768 #~ msgid "RETURN VALUES"
8769 #~ msgstr "RETURN VALUES"
8770
8771 #~ msgid "2011-10-01"
8772 #~ msgstr "2011-10-01"