2009年4月27日月曜日

Unix errno一覧

他サイトで見つけたのですが,現在とちょっと違っているようなので自分で調べてまとめてみました.
とりあえずmanページと,返ってきたエラーコードのみの少ない情報ですが(^^;)
(Fedora9 Kernel:2.6.25)

1 EPERM Operation not permitted (POSIX.1)
2 ENOENT No such file or directory (POSIX.1)
3 ESRCH No such process (POSIX.1)
4 EINTR Interrupted function call (POSIX.1)
5 EIO Input/output error (POSIX.1)
6 ENXIO No such device or address (POSIX.1)
7 E2BIG Argument list too long (POSIX.1)
8 ENOEXEC Exec format error (POSIX.1)
9 EBADF Bad file descriptor (POSIX.1)
10 ECHILD No child processes (POSIX.1)
11 EAGAIN Resource temporarily unavailable (may be the same value as EWOULDBLOCK)(POSIX.1)
11 EWOULDBLOCK Operation would block (may be same value as EAGAIN) (POSIX.1)
12 ENOMEM Not enough space (POSIX.1)
13 EACCES Permission denied (POSIX.1)
14 EFAULT Bad address (POSIX.1)
15 ENOTBLK Block device required
16 EBUSY Device or resource busy (POSIX.1)
17 EEXIST File exists (POSIX.1)
18 EXDEV Improper link (POSIX.1)
19 ENODEV No such device (POSIX.1)
20 ENOTDIR Not a directory (POSIX.1)
21 EISDIR Is a directory (POSIX.1)
22 EINVAL Invalid argument (POSIX.1)
23 ENFILE Too many open files in system (POSIX.1)
24 EMFILE Too many open files (POSIX.1)
25 ENOTTY Inappropriate I/O control operation (POSIX.1)
26 ETXTBSY Text file busy (POSIX.1)
27 EFBIG File too large (POSIX.1)
28 ENOSPC No space left on device (POSIX.1)
29 ESPIPE Invalid seek (POSIX.1)
30 EROFS Read-only file system (POSIX.1)
31 EMLINK Too many links (POSIX.1)
32 EPIPE Broken pipe (POSIX.1)
33 EDOM Mathematics argument out of domain of function (POSIX.1
34 ERANGE Result too large (POSIX.1
35 EDEADLK Resource deadlock avoided (POSIX.1)
35 EDEADLOCK Synonym for EDEADLK
36 ENAMETOOLONG Filename too long (POSIX.1)
37 ENOLCK No locks available (POSIX.1)
38 ENOSYS Function not implemented (POSIX.1)
39 ENOTEMPTY Directory not empty (POSIX.1)
40 ELOOP Too many levels of symbolic links (POSIX.1)
42 ENOMSG No message of the desired type (POSIX.1)
43 EIDRM Identifier removed (POSIX.1)
44 ECHRNG Channel number out of range
45 EL2NSYNC Level 2 not synchronized
46 EL3HLT Level 3 halted
47 EL3RST Level 3 halted
49 EUNATCH Protocol driver not attached
51 EL2HLT Level 2 halted
52 EBADE Invalid exchange
53 EBADR Invalid request descriptor
54 EXFULL Exchange full
56 EBADRQC Invalid request code
57 EBADSLT Invalid slot
60 ENOSTR Not a STREAM (POSIX.1 (XSI STREAMS option))
61 ENODATA No message is available on the STREAM head read queue (POSIX.1)
62 ETIME Timer expired (POSIX.1 (XSI STREAMS option))(POSIX.1 says STREAM ioctl(2) timeout)
63 ENOSR No STREAM resources (POSIX.1 (XSI STREAMS option))
64 ENONET Machine is not on the network
65 ENOPKG Package not installed
66 EREMOTE Object is remote
67 ENOLINK Link has been severed (POSIX.1)
70 ECOMM Communication error on send
71 EPROTO Protocol error (POSIX.1)
72 EMULTIHOP Multihop attempted (POSIX.1)
74 EBADMSG Bad message (POSIX.1)
75 EOVERFLOW Value too large to be stored in data type (POSIX.1)
76 ENOTUNIQ Name not unique on network
77 EBADFD File descriptor in bad state
78 EREMCHG Remote address changed
79 ELIBACC Cannot access a needed shared library
80 ELIBBAD Accessing a corrupted shared library
81 ELIBSCN lib section in a.out corrupted
82 ELIBMAX Attempting to link in too many shared libraries
83 ELIBEXEC Cannot exec a shared library directly
84 EILSEQ Illegal byte sequence (POSIX.1
85 ERESTART Interrupted system call should be restarted
86 ESTRPIPE Streams pipe error
87 EUSERS Too many users
88 ENOTSOCK Not a socket (POSIX.1)
89 EDESTADDRREQ Destination address required (POSIX.1)
90 EMSGSIZE Message too long (POSIX.1)
91 EPROTOTYPE Protocol wrong type for socket (POSIX.1)
92 ENOPROTOOPT Protocol not available (POSIX.1)
93 EPROTONOSUPPORT Protocol not supported (POSIX.1)
94 ESOCKTNOSUPPORT Socket type not supported
95 ENOTSUP Operation not supported (POSIX.1)
95 EOPNOTSUPP Operation not supported on socket (POSIX.1)(ENOTSUP and EOPNOTSUPP have the same value on Linux
96 EPFNOSUPPORT Protocol family not supported
97 EAFNOSUPPORT Address family not supported (POSIX.1)
98 EADDRINUSE Address already in use (POSIX.1)
99 EADDRNOTAVAIL Address not available (POSIX.1)
100 ENETDOWN Network is down (POSIX.1)
101 ENETUNREACH Network unreachable (POSIX.1)
102 ENETRESET Connection aborted by network (POSIX.1)
103 ECONNABORTED Connection aborted (POSIX.1)
104 ECONNRESET Connection reset (POSIX.1)
105 ENOBUFS No buffer space available (POSIX.1 (XSI STREAMS option))
106 EISCONN Socket is connected (POSIX.1)
107 ENOTCONN The socket is not connected (POSIX.1)
108 ESHUTDOWN Cannot send after transport endpoint shutdown
110 ETIMEDOUT Connection timed out (POSIX.1)
111 ECONNREFUSED Connection refused (POSIX.1)
112 EHOSTDOWN Host is down
113 EHOSTUNREACH Host is unreachable (POSIX.1)
114 EALREADY Connection already in progress (POSIX.1)
115 EINPROGRESS Operation in progress (POSIX.1)
116 ESTALE Stale file handle (POSIX.1)
117 EUCLEAN Structure needs cleaning
120 EISNAM Is a named type file
121 EREMOTEIO Remote I/O error
122 EDQUOT Disk quota exceeded (POSIX.1)
123 ENOMEDIUM No medium found
124 EMEDIUMTYPE Wrong medium type
125 ECANCELED Operation canceled (POSIX.1)
126 ENOKEY Required key not available
127 EKEYEXPIRED Key has expired
128 EKEYREVOKED Key has been revoked
129 EKEYREJECTED Key was rejected by service

エラーが起きたときにreturnされる値(-1など)と,errnoって違うんですね.
知らなかったです.

参考ページ:
PC覚え書き | Unix系errno一覧