OSDN Git Service

69bf08626ba48d75865976e8ebf3f28f9e7866b8
[linuxjm/LDP_man-pages.git] / draft / man3 / errno.3
1 .\" Copyright (c) 1996 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" 5 Oct 2002, Modified by Michael Kerrisk <mtk.manpages@gmail.com>
24 .\"     Updated for POSIX.1 2001
25 .\" 2004-12-17 Martin Schulze <joey@infodrom.org>, mtk
26 .\"     Removed errno declaration prototype, added notes
27 .\" 2006-02-09 Kurt Wall, mtk
28 .\"     Added non-POSIX errors
29 .\"
30 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
31 .\"     all rights reserved.
32 .\" Translated 1997-12-24, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
33 .\" Updated 1999-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
34 .\" Updated 1999-08-21, NAKANO Takeo <nakano@apm.seikei.ac.jp>
35 .\" Updated 2003-07-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" Updated 2005-03-15, Akihiro MOTOKI
37 .\" Updated 2006-02-15, Akihiro MOTOKI, Catch up to LDP v2.23
38 .\" Updated 2006-07-14, Akihiro MOTOKI, Catch up to LDP v2.34
39 .\" Updated 2008-08-07, Akihiro MOTOKI, Catch up to LDP v3.05
40 .\"
41 .TH ERRNO 3 2008-07-09 "" "Linux Programmer's Manual"
42 .\"O .SH NAME
43 .SH 名前
44 .\"O errno \- number of last error
45 errno \- 直近に発生したエラーの番号
46 .\"O .SH SYNOPSIS
47 .SH 書式
48 .B #include <errno.h>
49 .\".sp
50 .\".BI "extern int " errno ;
51 .\"O .SH DESCRIPTION
52 .SH 説明
53 .\"O The
54 .\"O .I <errno.h>
55 .\"O header file defines the integer variable
56 .\"O .IR errno ,
57 .\"O which is set by system calls and some library functions in the event
58 .\"O of an error to indicate what went wrong.
59 .\"O Its value is significant only when the return value of
60 .\"O the call indicated an error
61 .\"O (i.e., \-1 from most system calls;
62 .\"O \-1 or NULL from most library functions);
63 .\"O a function that succeeds
64 .\"O .I is
65 .\"O allowed to change
66 .\"O .IR errno .
67 ヘッダファイル
68 .I <errno.h>
69 で整数型の変数
70 .I errno
71 が定義されており、
72 システムコールやいくつかのライブラリ関数は、エラーが発生した際に
73 この変数にその原因を示す値を設定する。
74 この値は呼び出しの返り値がエラー (ほとんどのシステムコールでは
75 \-1 で、ほとんどのライブラリ関数では \-1 か NULL) を示したときに
76 のみ意味を持つが、ライブラリ関数は成功した場合も
77 .I errno
78 を変更することが許されている。
79
80 .\"O Valid error numbers are all nonzero; \fIerrno\fP is never set to zero
81 .\"O by any system call or library function.
82 有効なエラー番号はいずれも 0 以外の値を持つ。
83 どのシステムコールもライブラリ関数も
84 \fIerrno\fP を 0 に設定することはない。
85
86 .\"O For some system calls and library functions (e.g.,
87 .\"O .BR getpriority (2)),
88 .\"O \-1 is a valid return on success.
89 .\"O In such cases, a successful return can be distinguished from an error
90 .\"O return by setting
91 .\"O .I errno
92 .\"O to zero before the call, and then,
93 .\"O if the call returns a status that indicates that an error
94 .\"O may have occurred, checking to see if
95 .\"O .I errno
96 .\"O has a nonzero value.
97 いくつかのシステムコールやライブラリ関数 (例えば
98 .BR getpriority (2))
99 では、成功した場合の有効な返り値として \-1 が返されることがある。
100 このような場合、成功なのかエラーなのかを区別するためには、
101 呼び出しの前に
102 .I errno
103 を 0 に設定しておけばよい。呼び出しの返り値がエラー発生の可能性を
104 示すものだった場合には、
105 .I errno
106 が 0 以外の値かを見て確認すればよい。
107
108 .\"O \fIerrno\fP is defined by the ISO C standard to be a modifiable lvalue
109 .\"O of type \fIint\fP, and must not be explicitly declared; \fIerrno\fP
110 .\"O may be a macro.
111 .\"O \fIerrno\fP is thread-local; setting it in one thread
112 .\"O does not affect its value in any other thread.
113 \fIerrno\fP は、ISO C standard で \fIint\fP 型の変更可能な左辺値
114 として定義されており、明示的に宣言を行ってはならない;
115 \fIerrno\fP はマクロの場合もありえる。
116 \fIerrno\fP はスレッド毎に値を持つ。
117 つまりあるスレッドで \fIerrno\fP が設定されても、
118 他のスレッドの \fIerrno\fP には影響しない。
119
120 .\"O All the error names specified by POSIX.1
121 .\"O must have distinct values, with the exception of
122 .\"O .B EAGAIN
123 .\"O and
124 .\"O .BR EWOULDBLOCK ,
125 .\"O which may be the same.
126 POSIX.1 で定義されているすべてのエラー名には、
127 それぞれ異なる値が対応していなければならない。
128 但し、
129 .B EAGAIN
130
131 .B EWOULDBLOCK
132 は例外で、これらは同じ値を持ってもよい。
133
134 .\" The following is now
135 .\"O .\" POSIX.1 (2001 edition) lists the following symbolic error names.  Of
136 .\"O .\" these, \fBEDOM\fP and \fBERANGE\fP are in the ISO C standard.  ISO C
137 .\"O .\" Amendment 1 defines the additional error number \fBEILSEQ\fP for
138 .\"O .\" coding errors in multibyte or wide characters.
139 .\" POSIX.1 (2001 年版) でのエラー名シンボルのリストを以下に示す。
140 .\" これらのうち、 \fBEDOM\fP と \fBERANGE\fP は ISO C standard にある。
141 .\" さらに、ISO C Amendment 1 では、エラー番号 \fBEILSEQ\fP が
142 .\" マルチバイト文字やワイド文字での符号化エラーを表すために
143 .\" 定義されている。
144 .\"
145 .\"O Below is a list of the symbolic error names that are defined on Linux.
146 .\"O Some of these are marked
147 .\"O .IR POSIX.1 ,
148 .\"O indicating that the name is defined by POSIX.1-2001, or
149 .\"O .IR C99 ,
150 .\"O indicating that the name is defined by C99.
151 .TP 16
152 .B E2BIG
153 .\"O Argument list too long (POSIX.1)
154 引き数リストが長過ぎる (POSIX.1)
155 .TP
156 .B EACCES
157 .\"O Permission denied (POSIX.1)
158 許可がない (POSIX.1)
159 .TP
160 .B EADDRINUSE
161 .\"O Address already in use (POSIX.1)
162 アドレスがすでに使用されている (POSIX.1)
163 .TP
164 .B EADDRNOTAVAIL
165 .\"O Address not available (POSIX.1)
166 アドレスが使用できない (POSIX.1)
167 .\"O .\" EADV is only an error on HURD(?)
168 .\" EADV は HURD においてだけのエラー(?)
169 .TP
170 .B EAFNOSUPPORT
171 .\"O Address family not supported (POSIX.1)
172 アドレス・ファミリーがサポートされていない (POSIX.1)
173 .TP
174 .B EAGAIN
175 .\"O Resource temporarily unavailable (may be the same value as
176 .\"O .BR EWOULDBLOCK )
177 .\"O (POSIX.1)
178 リソースが一時的に利用不可
179 .RB ( EWOULDBLOCK
180 と同じ値でもよい) (POSIX.1)
181 .TP
182 .B EALREADY
183 .\"O Connection already in progress (POSIX.1)
184 接続が既に処理中である (POSIX.1)
185 .TP
186 .B EBADE
187 .\"O Invalid exchange
188 不正なやり取り (exchange) である
189 .TP
190 .B EBADF
191 .\"O Bad file descriptor (POSIX.1)
192 ファイルディスクリプタが不正である (POSIX.1)
193 .TP
194 .B EBADFD
195 .\"O File descriptor in bad state
196 ファイルディスクリプタが不正な状態である
197 .TP
198 .B EBADMSG
199 .\"O Bad message (POSIX.1)
200 メッセージが不正である (POSIX.1)
201 .TP
202 .B EBADR
203 .\"O Invalid request descriptor
204 不正なリクエストディスクリプタ
205 .TP
206 .B EBADRQC
207 .\"O Invalid request code
208 不正なリクエストコード
209 .TP
210 .B EBADSLT
211 .\"O Invalid slot
212 不正なスロット
213 .\" EBFONT is defined but appears not to be used by kernel or glibc.
214 .TP
215 .B EBUSY
216 .\"O Device or resource busy (POSIX.1)
217 リソースが使用中である (POSIX.1)
218 .TP
219 .B ECANCELED
220 .\"O Operation canceled (POSIX.1)
221 操作がキャンセルされた (POSIX.1)
222 .TP
223 .B ECHILD
224 .\"O No child processes (POSIX.1)
225 子プロセスが無い (POSIX.1)
226 .TP
227 .B ECHRNG
228 .\"O Channel number out of range
229 チャンネル番号が範囲外である
230 .TP
231 .B ECOMM
232 .\"O Communication error on send
233 送信時に通信エラーが発生した
234 .TP
235 .B ECONNABORTED
236 .\"O Connection aborted (POSIX.1)
237 接続が中止された (POSIX.1)
238 .TP
239 .B ECONNREFUSED
240 .\"O Connection refused (POSIX.1)
241 接続が拒否された (POSIX.1)
242 .TP
243 .B ECONNRESET
244 .\"O Connection reset (POSIX.1)
245 接続がリセットされた (POSIX.1)
246 .TP
247 .B EDEADLK
248 .\"O Resource deadlock avoided (POSIX.1)
249 リソースのデッドロックを回避した (POSIX.1)
250 .TP
251 .B EDEADLOCK
252 .\"O Synonym for
253 .\"O .B EDEADLK
254 .B EDEADLK
255 の同義語
256 .TP
257 .B EDESTADDRREQ
258 .\"O Destination address required (POSIX.1)
259 宛先アドレスが必要である (POSIX.1)
260 .TP
261 .B EDOM
262 .\"O Mathematics argument out of domain of function (POSIX.1, C99)
263 数学関数で引き数が領域外である (out of domain)
264 .\" EDOTDOT is defined but appears to be unused
265 .TP
266 .B EDQUOT
267 .\" POSIX just says "Reserved"
268 .\"O Disk quota exceeded (POSIX.1)
269 ディスク・クォータ (quota) を超過した (POSIX.1)
270 .TP
271 .B EEXIST
272 .\"O File exists (POSIX.1)
273 ファイルが存在する (POSIX.1)
274 .TP
275 .B EFAULT
276 .\"O Bad address (POSIX.1)
277 アドレスが不正である (POSIX.1)
278 .TP
279 .B EFBIG
280 .\"O File too large (POSIX.1)
281 ファイルが大き過ぎる (POSIX.1)
282 .TP
283 .B EHOSTDOWN
284 .\"O Host is down
285 ホストがダウンしている
286 .TP
287 .B EHOSTUNREACH
288 .\"O Host is unreachable (POSIX.1)
289 ホストに到達不能である (POSIX.1)
290 .TP
291 .B EIDRM
292 .\"O Identifier removed (POSIX.1)
293 識別子が削除された (POSIX.1)
294 .TP
295 .B EILSEQ
296 .\"O Illegal byte sequence (POSIX.1, C99)
297 不正なバイト列 (POSIX.1, C99)
298 .TP
299 .B EINPROGRESS
300 .\"O Operation in progress (POSIX.1)
301 操作が実行中である (POSIX.1)
302 .TP
303 .B EINTR
304 .\"O Interrupted function call (POSIX.1); see
305 .\"O .BR signal (7).
306 関数呼び出しが割り込まれた (POSIX.1);
307 .BR signal (7)
308 参照。
309 .TP
310 .B EINVAL
311 .\"O Invalid argument (POSIX.1)
312 引数が無効である (POSIX.1)
313 .TP
314 .B EIO
315 .\"O Input/output error (POSIX.1)
316 入出力エラー (POSIX.1)
317 .TP
318 .B EISCONN
319 .\"O Socket is connected (POSIX.1)
320 ソケットが接続されている (POSIX.1)
321 .TP
322 .B EISDIR
323 .\"O Is a directory (POSIX.1)
324 ディレクトリである (POSIX.1)
325 .TP
326 .B EISNAM
327 .\"O Is a named type file
328 名前付きのファイルである
329 .TP
330 .B EKEYEXPIRED
331 .\"O Key has expired
332 鍵が期限切れとなった
333 .TP
334 .B EKEYREJECTED
335 .\"O Key was rejected by service
336 鍵がサーバにより拒否された
337 .TP
338 .B EKEYREVOKED
339 .\"O Key has been revoked
340 鍵が無効となった
341 .TP
342 .B EL2HLT
343 .\"O Level 2 halted
344 停止 (レベル 2)
345 .TP
346 .B EL2NSYNC
347 .\"O Level 2 not synchronized
348 同期できていない (レベル 2)
349 .TP
350 .B EL3HLT
351 .\"O Level 3 halted
352 停止 (レベル 3)
353 .TP
354 .B EL3RST
355 .\"O Level 3 halted
356 リセット (レベル 3)
357 .TP
358 .B ELIBACC
359 .\"O Cannot access a needed shared library
360 必要な共有ライブラリにアクセスできなかった
361 .TP
362 .B ELIBBAD
363 .\"O Accessing a corrupted shared library
364 壊れた共有ライブラリにアクセスしようとした
365 .TP
366 .B ELIBMAX
367 .\"O Attempting to link in too many shared libraries
368 リンクしようとした共有ライブラリが多過ぎる
369 .TP
370 .B ELIBSCN
371 .\"O lib section in a.out corrupted
372 a.out のライブラリセクションが壊れている (corrupted)
373 .TP
374 .B ELIBEXEC
375 .\"O Cannot exec a shared library directly
376 共有ライブラリを直接実行できなかった
377 .TP
378 .B ELOOP
379 .\"O Too many levels of symbolic links (POSIX.1)
380 シンボリック・リンクの回数が多過ぎる (POSIX.1)
381 .\" ELNRNG is defined but appears to be unused
382 .TP
383 .B EMEDIUMTYPE
384 .\"O Wrong medium type
385 間違ったメディア種別である
386 .TP
387 .B EMFILE
388 .\"O Too many open files (POSIX.1)
389 オープンされているファイルが多過ぎる (POSIX.1)
390 .TP
391 .B EMLINK
392 .\"O Too many links (POSIX.1)
393 リンクが多過ぎる (POSIX.1)
394 .TP
395 .B EMSGSIZE
396 .\"O Message too long (POSIX.1)
397 メッセージが長過ぎる (POSIX.1)
398 .TP
399 .B EMULTIHOP
400 .\" POSIX says "Reserved"
401 .\"O Multihop attempted (POSIX.1)
402 マルチホップ (multihop) を試みた (POSIX.1)
403 .TP
404 .B ENAMETOOLONG
405 .\"O Filename too long (POSIX.1)
406 ファイル名が長過ぎる (POSIX.1)
407 .\" ENAVAIL is defined, but appears not to be used
408 .TP
409 .B ENETDOWN
410 .\"O Network is down (POSIX.1)
411 ネットワークが不通である (POSIX.1)
412 .TP
413 .B ENETRESET
414 .\"O Connection aborted by network (POSIX.1)
415 接続がネットワーク側から中止された (POSIX.1)
416 .TP
417 .B ENETUNREACH
418 .\"O Network unreachable (POSIX.1)
419 ネットワークが到達不能である (POSIX.1)
420 .TP
421 .B ENFILE
422 .\"O Too many open files in system (POSIX.1)
423 システム全体でオープンされているファイルが多過ぎる (POSIX.1)
424 .\" ENOANO is defined but appears to be unused.
425 .TP
426 .B ENOBUFS
427 .\"O No buffer space available (POSIX.1 (XSI STREAMS option))
428 使用可能なバッファ空間がない (POSIX.1 (XSI STREAMS option))
429 .\" ENOCSI is defined but appears to be unused.
430 .TP
431 .B ENODATA
432 .\"O No message is available on the STREAM head read queue (POSIX.1)
433 ストリームの読み出しキューの先頭に読み出し可能なメッセージがない
434 (POSIX.1)
435 .TP
436 .B ENODEV
437 .\"O No such device (POSIX.1)
438 そのようなデバイスは無い (POSIX.1)
439 .TP
440 .B ENOENT
441 .\"O No such file or directory (POSIX.1)
442 そのようなファイルやディレクトリは無い (POSIX.1)
443 .TP
444 .B ENOEXEC
445 .\"O Exec format error (POSIX.1)
446 実行ファイル形式のエラー (POSIX.1)
447 .TP
448 .B ENOKEY
449 .\"O Required key not available
450 要求された鍵が利用できない
451 .TP
452 .B ENOLCK
453 .\"O No locks available (POSIX.1)
454 利用できるロックが無い (POSIX.1)
455 .TP
456 .B ENOLINK
457 .\" POSIX says "Reserved"
458 .\"O Link has been severed (POSIX.1)
459 リンクが切れている (POSIX.1)
460 .TP
461 .B ENOMEDIUM
462 .\"O No medium found
463 メディアが見つからない
464 .TP
465 .B ENOMEM
466 .\"O Not enough space (POSIX.1)
467 十分な空きメモリ領域が無い (POSIX.1)
468 .TP
469 .B ENOMSG
470 .\"O No message of the desired type (POSIX.1)
471 要求された型のメッセージが存在しない (POSIX.1)
472 .TP
473 .B ENONET
474 .\"O Machine is not on the network
475 マシンがネットワーク上にない
476 .TP
477 .B ENOPKG
478 .\"O Package not installed
479 パッケージがインストールされていない
480 .TP
481 .B ENOPROTOOPT
482 .\"O Protocol not available (POSIX.1)
483 指定されたプロトコルが利用できない (POSIX.1)
484 .TP
485 .B ENOSPC
486 .\"O No space left on device (POSIX.1)
487 デバイスに空き領域が無い (POSIX.1)
488 .TP
489 .B ENOSR
490 .\"O No STREAM resources (POSIX.1 (XSI STREAMS option))
491 指定されたストリーム・リソースが存在しない (POSIX.1 (XSI STREAMS option))
492 .TP
493 .B ENOSTR
494 .\"O Not a STREAM (POSIX.1 (XSI STREAMS option))
495 ストリームではない (POSIX.1 (XSI STREAMS option))
496 .TP
497 .B ENOSYS
498 .\"O Function not implemented (POSIX.1)
499 関数が実装されていない (POSIX.1)
500 .TP
501 .B ENOTBLK
502 .\"O Block device required
503 ブロックデバイスが必要である
504 .TP
505 .B ENOTCONN
506 .\"O The socket is not connected (POSIX.1)
507 ソケットが接続されていない (POSIX.1)
508 .TP
509 .B ENOTDIR
510 .\"O Not a directory (POSIX.1)
511 ディレクトリではない (POSIX.1)
512 .TP
513 .B ENOTEMPTY
514 .\"O Directory not empty (POSIX.1)
515 ディレクトリが空ではない (POSIX.1)
516 .\" ENOTNAM is defined but appears to be unused.
517 .TP
518 .B ENOTSOCK
519 .\"O Not a socket (POSIX.1)
520 ソケットではない (POSIX.1)
521 .TP
522 .B ENOTSUP
523 .\"O Operation not supported (POSIX.1)
524 操作がサポートされていない (POSIX.1)
525 .TP
526 .B ENOTTY
527 .\"O Inappropriate I/O control operation (POSIX.1)
528 I/O 制御操作が適切でない (POSIX.1)
529 .TP
530 .B ENOTUNIQ
531 .\"O Name not unique on network
532 名前がネットワークで一意ではない
533 .TP
534 .B ENXIO
535 .\"O No such device or address (POSIX.1)
536 そのようなデバイスやアドレスはない (POSIX.1)
537 .TP
538 .B EOPNOTSUPP
539 .\"O Operation not supported on socket (POSIX.1)
540 ソケットでサポートしていない操作である (POSIX.1)
541 .sp
542 .\"O .RB ( ENOTSUP
543 .\"O and
544 .\"O .B EOPNOTSUPP
545 .\"O have the same value on Linux, but
546 .\"O according to POSIX.1 these error values should be distinct.)
547 (Linux では
548 .B ENOTSUP
549
550 .B EOPNOTSUPP
551 は同じ値を持つが、
552 POSIX.1 に従えば両者のエラー値は区別されるべきである。)
553 .TP
554 .B EOVERFLOW
555 .\"O Value too large to be stored in data type (POSIX.1)
556 指定されたデータ型に格納するには値が大き過ぎる (POSIX.1)
557 .TP
558 .B EPERM
559 .\"O Operation not permitted (POSIX.1)
560 操作が許可されていない (POSIX.1)
561 .TP
562 .B EPFNOSUPPORT
563 .\"O Protocol family not supported
564 サポートされていないプロトコルファミリーである
565 .TP
566 .B EPIPE
567 .\"O Broken pipe (POSIX.1)
568 パイプが壊れている (POSIX.1)
569 .TP
570 .B EPROTO
571 .\"O Protocol error (POSIX.1)
572 プロトコル・エラー (POSIX.1)
573 .TP
574 .B EPROTONOSUPPORT
575 .\"O Protocol not supported (POSIX.1)
576 プロトコルがサポートされていない (POSIX.1)
577 .TP
578 .B EPROTOTYPE
579 .\"O Protocol wrong type for socket (POSIX.1)
580 ソケットに指定できないプロトコル・タイプである (POSIX.1)
581 .TP
582 .B ERANGE
583 .\"O Result too large (POSIX.1, C99)
584 結果が大き過ぎる (POSIX.1, C99)
585 .TP
586 .B EREMCHG
587 .\"O Remote address changed
588 リモートアドレスが変わった
589 .TP
590 .B EREMOTE
591 .\"O Object is remote
592 オブジェクトがリモートにある
593 .TP
594 .B EREMOTEIO
595 .\"O Remote I/O error
596 リモート I/O エラー
597 .TP
598 .B ERESTART
599 .\"O Interrupted system call should be restarted
600 システムコールが中断され再スタートが必要である
601 .TP
602 .B EROFS
603 .\"O Read-only file system (POSIX.1)
604 読み出し専用のファイルシステムである (POSIX.1)
605 .TP
606 .B ESHUTDOWN
607 .\"O Cannot send after transport endpoint shutdown
608 通信相手がシャットダウンされて送信できない
609 .TP
610 .B ESPIPE
611 .\"O Invalid seek (POSIX.1)
612 無効なシーク (POSIX.1)
613 .TP
614 .B ESOCKTNOSUPPORT
615 .\"O Socket type not supported
616 サポートされていないソケット種別である
617 .TP
618 .B ESRCH
619 .\"O No such process (POSIX.1)
620 そのようなプロセスは無い (POSIX.1)
621 .\" ESRMNT is defined but appears not to be used
622 .TP
623 .B ESTALE
624 .\"O Stale file handle (POSIX.1)
625 ファイルハンドルが古い状態になっている (POSIX.1)
626 .sp
627 .\"O This error can occur for NFS and for other file systems
628 NFS や他のファイルシステムで起こりうる。
629 .TP
630 .B ESTRPIPE
631 .\"O Streams pipe error
632 ストリーム・パイプ・エラー
633 .TP
634 .B ETIME
635 .\"O Timer expired
636 .\"O (POSIX.1 (XSI STREAMS option))
637 時間が経過した
638 (POSIX.1 (XSI STREAMS option))
639 .sp
640 .\"O (POSIX.1 says "STREAM
641 .\"O .BR ioctl (2)
642 .\"O timeout")
643 (POSIX.1 では "STREAM
644 .BR ioctl (2)
645 timeout" と書かれている)
646 .TP
647 .B ETIMEDOUT
648 .\"O Connection timed out (POSIX.1)
649 操作がタイムアウトした (POSIX.1)
650 .\" ETOOMANYREFS is defined, but appears not to be used.
651 .TP
652 .B ETXTBSY
653 .\"O Text file busy (POSIX.1)
654 テキストファイルが使用中である (POSIX.1)
655 .TP
656 .B EUCLEAN
657 .\"Omotoki: 意味が分からないので、そのまま原文を残してある。
658 .\"O Structure needs cleaning
659 Structure needs cleaning
660 .TP
661 .B EUNATCH
662 .\"O Protocol driver not attached
663 プロトコルのドライバが付与 (attach) されていない
664 .TP
665 .B EUSERS
666 .\"O Too many users
667 ユーザ数が多過ぎる
668 .TP
669 .B EWOULDBLOCK
670 .\"O Operation would block (may be same value as
671 .\"O .BR EAGAIN )
672 .\"O (POSIX.1)
673 操作がブロックされる見込みである
674 .RB ( EAGAIN
675 と同じ値でもよい) (POSIX.1)
676 .TP
677 .B EXDEV
678 .\"O Improper link (POSIX.1)
679 不適切なリンク (POSIX.1)
680 .TP
681 .B EXFULL
682 .\"O Exchange full
683 変換テーブルが一杯である
684 .\"O .SH NOTES
685 .SH 注意
686 .\"O A common mistake is to do
687 以下はよくやる間違いである。
688 .in +4n
689 .nf
690
691 if (somecall() == \-1) {
692     printf("somecall() failed\en");
693     if (errno == ...) { ... }
694 }
695
696 .fi
697 .in
698 .\"O where
699 .\"O .I errno
700 .\"O no longer needs to have the value it had upon return from
701 .\"O .IR somecall ()
702 .\"O (i.e., it may have been changed by the
703 .\"O .BR printf (3)).
704 このようにすると、参照している時点では
705 .I errno
706 はもはや
707 .IR somecall ()
708 から返された値を保持しているとは限らない
709 .RB ( printf (3)
710 により変更されているかもしれない)。
711 .\"O If the value of
712 .\"O .I errno
713 .\"O should be preserved across a library call, it must be saved:
714 ライブラリコールをまたいで
715 .I errno
716 の値を保存したい場合は、以下のように保存しなければならない:
717 .in +4n
718 .nf
719
720 if (somecall() == \-1) {
721     int errsv = errno;
722     printf("somecall() failed\en");
723     if (errsv == ...) { ... }
724 }
725 .fi
726 .in
727 .PP
728 .\"O It was common in traditional C to declare
729 .\"O .I errno
730 .\"O manually
731 .\"O (i.e.,
732 .\"O .IR "extern int errno" )
733 .\"O instead of including
734 .\"O .IR <errno.h> .
735 .\"O .BR "Do not do this" .
736 .\"O It will not work with modern versions of the C library.
737 .\"O However, on (very) old UNIX systems, there may be no
738 .\"O .I <errno.h>
739 .\"O and the declaration is needed.
740 昔の C では、
741 .I <errno.h>
742 をインクルードするのではなく
743 .I errno
744 を手動で
745 .RI ( "extern int errno"
746 のように) 定義するのが一般的であった。
747 .BR "このようなことはしないこと" "。"
748 こうすると、最近のバージョンの C ライブラリでは正しく動作しないだろう。
749 しかし、(非常に) 古い UNIX システムでは、
750 .I <errno.h>
751 がなく、宣言が必要なことがあるかもしれない。
752 .\"O .SH "SEE ALSO"
753 .BR err (3),
754 .BR error (3),
755 .BR perror (3),
756 .BR strerror (3)