1 | /* errno is not a global variable, because that would make using it |
---|
2 | non-reentrant. Instead, its address is returned by the function |
---|
3 | __errno. */ |
---|
4 | |
---|
5 | #ifndef _SYS_ERRNO_H_ |
---|
6 | #ifdef __cplusplus |
---|
7 | extern "C" { |
---|
8 | #endif |
---|
9 | #define _SYS_ERRNO_H_ |
---|
10 | |
---|
11 | #include <sys/reent.h> |
---|
12 | |
---|
13 | #ifndef _REENT_ONLY |
---|
14 | #define errno (*__errno()) |
---|
15 | extern int *__errno (void); |
---|
16 | #endif |
---|
17 | |
---|
18 | /* Please don't use these variables directly. |
---|
19 | Use strerror instead. */ |
---|
20 | extern __IMPORT const char * const _sys_errlist[]; |
---|
21 | extern __IMPORT int _sys_nerr; |
---|
22 | #ifdef __CYGWIN__ |
---|
23 | extern __IMPORT const char * const sys_errlist[]; |
---|
24 | extern __IMPORT int sys_nerr; |
---|
25 | extern __IMPORT char *program_invocation_name; |
---|
26 | extern __IMPORT char *program_invocation_short_name; |
---|
27 | #endif |
---|
28 | |
---|
29 | #define __errno_r(ptr) ((ptr)->_errno) |
---|
30 | |
---|
31 | #define EPERM 1 /* Not owner */ |
---|
32 | #define ENOENT 2 /* No such file or directory */ |
---|
33 | #define ESRCH 3 /* No such process */ |
---|
34 | #define EINTR 4 /* Interrupted system call */ |
---|
35 | #define EIO 5 /* I/O error */ |
---|
36 | #define ENXIO 6 /* No such device or address */ |
---|
37 | #define E2BIG 7 /* Arg list too long */ |
---|
38 | #define ENOEXEC 8 /* Exec format error */ |
---|
39 | #define EBADF 9 /* Bad file number */ |
---|
40 | #define ECHILD 10 /* No children */ |
---|
41 | #define EAGAIN 11 /* No more processes */ |
---|
42 | #define ENOMEM 12 /* Not enough space */ |
---|
43 | #define EACCES 13 /* Permission denied */ |
---|
44 | #define EFAULT 14 /* Bad address */ |
---|
45 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
46 | #define ENOTBLK 15 /* Block device required */ |
---|
47 | #endif |
---|
48 | #define EBUSY 16 /* Device or resource busy */ |
---|
49 | #define EEXIST 17 /* File exists */ |
---|
50 | #define EXDEV 18 /* Cross-device link */ |
---|
51 | #define ENODEV 19 /* No such device */ |
---|
52 | #define ENOTDIR 20 /* Not a directory */ |
---|
53 | #define EISDIR 21 /* Is a directory */ |
---|
54 | #define EINVAL 22 /* Invalid argument */ |
---|
55 | #define ENFILE 23 /* Too many open files in system */ |
---|
56 | #define EMFILE 24 /* File descriptor value too large */ |
---|
57 | #define ENOTTY 25 /* Not a character device */ |
---|
58 | #define ETXTBSY 26 /* Text file busy */ |
---|
59 | #define EFBIG 27 /* File too large */ |
---|
60 | #define ENOSPC 28 /* No space left on device */ |
---|
61 | #define ESPIPE 29 /* Illegal seek */ |
---|
62 | #define EROFS 30 /* Read-only file system */ |
---|
63 | #define EMLINK 31 /* Too many links */ |
---|
64 | #define EPIPE 32 /* Broken pipe */ |
---|
65 | #define EDOM 33 /* Mathematics argument out of domain of function */ |
---|
66 | #define ERANGE 34 /* Result too large */ |
---|
67 | #define ENOMSG 35 /* No message of desired type */ |
---|
68 | #define EIDRM 36 /* Identifier removed */ |
---|
69 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
70 | #define ECHRNG 37 /* Channel number out of range */ |
---|
71 | #define EL2NSYNC 38 /* Level 2 not synchronized */ |
---|
72 | #define EL3HLT 39 /* Level 3 halted */ |
---|
73 | #define EL3RST 40 /* Level 3 reset */ |
---|
74 | #define ELNRNG 41 /* Link number out of range */ |
---|
75 | #define EUNATCH 42 /* Protocol driver not attached */ |
---|
76 | #define ENOCSI 43 /* No CSI structure available */ |
---|
77 | #define EL2HLT 44 /* Level 2 halted */ |
---|
78 | #endif |
---|
79 | #define EDEADLK 45 /* Deadlock */ |
---|
80 | #define ENOLCK 46 /* No lock */ |
---|
81 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
82 | #define EBADE 50 /* Invalid exchange */ |
---|
83 | #define EBADR 51 /* Invalid request descriptor */ |
---|
84 | #define EXFULL 52 /* Exchange full */ |
---|
85 | #define ENOANO 53 /* No anode */ |
---|
86 | #define EBADRQC 54 /* Invalid request code */ |
---|
87 | #define EBADSLT 55 /* Invalid slot */ |
---|
88 | #define EDEADLOCK 56 /* File locking deadlock error */ |
---|
89 | #define EBFONT 57 /* Bad font file fmt */ |
---|
90 | #endif |
---|
91 | #define ENOSTR 60 /* Not a stream */ |
---|
92 | #define ENODATA 61 /* No data (for no delay io) */ |
---|
93 | #define ETIME 62 /* Stream ioctl timeout */ |
---|
94 | #define ENOSR 63 /* No stream resources */ |
---|
95 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
96 | #define ENONET 64 /* Machine is not on the network */ |
---|
97 | #define ENOPKG 65 /* Package not installed */ |
---|
98 | #define EREMOTE 66 /* The object is remote */ |
---|
99 | #endif |
---|
100 | #define ENOLINK 67 /* Virtual circuit is gone */ |
---|
101 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
102 | #define EADV 68 /* Advertise error */ |
---|
103 | #define ESRMNT 69 /* Srmount error */ |
---|
104 | #define ECOMM 70 /* Communication error on send */ |
---|
105 | #endif |
---|
106 | #define EPROTO 71 /* Protocol error */ |
---|
107 | #define EMULTIHOP 74 /* Multihop attempted */ |
---|
108 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
109 | #define ELBIN 75 /* Inode is remote (not really error) */ |
---|
110 | #define EDOTDOT 76 /* Cross mount point (not really error) */ |
---|
111 | #endif |
---|
112 | #define EBADMSG 77 /* Bad message */ |
---|
113 | #define EFTYPE 79 /* Inappropriate file type or format */ |
---|
114 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
115 | #define ENOTUNIQ 80 /* Given log. name not unique */ |
---|
116 | #define EBADFD 81 /* f.d. invalid for this operation */ |
---|
117 | #define EREMCHG 82 /* Remote address changed */ |
---|
118 | #define ELIBACC 83 /* Can't access a needed shared lib */ |
---|
119 | #define ELIBBAD 84 /* Accessing a corrupted shared lib */ |
---|
120 | #define ELIBSCN 85 /* .lib section in a.out corrupted */ |
---|
121 | #define ELIBMAX 86 /* Attempting to link in too many libs */ |
---|
122 | #define ELIBEXEC 87 /* Attempting to exec a shared library */ |
---|
123 | #endif |
---|
124 | #define ENOSYS 88 /* Function not implemented */ |
---|
125 | #ifdef __CYGWIN__ |
---|
126 | #define ENMFILE 89 /* No more files */ |
---|
127 | #endif |
---|
128 | #define ENOTEMPTY 90 /* Directory not empty */ |
---|
129 | #define ENAMETOOLONG 91 /* File or path name too long */ |
---|
130 | #define ELOOP 92 /* Too many symbolic links */ |
---|
131 | #define EOPNOTSUPP 95 /* Operation not supported on socket */ |
---|
132 | #define EPFNOSUPPORT 96 /* Protocol family not supported */ |
---|
133 | #define ECONNRESET 104 /* Connection reset by peer */ |
---|
134 | #define ENOBUFS 105 /* No buffer space available */ |
---|
135 | #define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ |
---|
136 | #define EPROTOTYPE 107 /* Protocol wrong type for socket */ |
---|
137 | #define ENOTSOCK 108 /* Socket operation on non-socket */ |
---|
138 | #define ENOPROTOOPT 109 /* Protocol not available */ |
---|
139 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
140 | #define ESHUTDOWN 110 /* Can't send after socket shutdown */ |
---|
141 | #endif |
---|
142 | #define ECONNREFUSED 111 /* Connection refused */ |
---|
143 | #define EADDRINUSE 112 /* Address already in use */ |
---|
144 | #define ECONNABORTED 113 /* Software caused connection abort */ |
---|
145 | #define ENETUNREACH 114 /* Network is unreachable */ |
---|
146 | #define ENETDOWN 115 /* Network interface is not configured */ |
---|
147 | #define ETIMEDOUT 116 /* Connection timed out */ |
---|
148 | #define EHOSTDOWN 117 /* Host is down */ |
---|
149 | #define EHOSTUNREACH 118 /* Host is unreachable */ |
---|
150 | #define EINPROGRESS 119 /* Connection already in progress */ |
---|
151 | #define EALREADY 120 /* Socket already connected */ |
---|
152 | #define EDESTADDRREQ 121 /* Destination address required */ |
---|
153 | #define EMSGSIZE 122 /* Message too long */ |
---|
154 | #define EPROTONOSUPPORT 123 /* Unknown protocol */ |
---|
155 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
156 | #define ESOCKTNOSUPPORT 124 /* Socket type not supported */ |
---|
157 | #endif |
---|
158 | #define EADDRNOTAVAIL 125 /* Address not available */ |
---|
159 | #define ENETRESET 126 /* Connection aborted by network */ |
---|
160 | #define EISCONN 127 /* Socket is already connected */ |
---|
161 | #define ENOTCONN 128 /* Socket is not connected */ |
---|
162 | #define ETOOMANYREFS 129 |
---|
163 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
164 | #define EPROCLIM 130 |
---|
165 | #define EUSERS 131 |
---|
166 | #endif |
---|
167 | #define EDQUOT 132 |
---|
168 | #define ESTALE 133 |
---|
169 | #define ENOTSUP 134 /* Not supported */ |
---|
170 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
171 | #define ENOMEDIUM 135 /* No medium (in tape drive) */ |
---|
172 | #endif |
---|
173 | #ifdef __CYGWIN__ |
---|
174 | #define ENOSHARE 136 /* No such host or network path */ |
---|
175 | #define ECASECLASH 137 /* Filename exists with different case */ |
---|
176 | #endif |
---|
177 | #define EILSEQ 138 /* Illegal byte sequence */ |
---|
178 | #define EOVERFLOW 139 /* Value too large for defined data type */ |
---|
179 | #define ECANCELED 140 /* Operation canceled */ |
---|
180 | #define ENOTRECOVERABLE 141 /* State not recoverable */ |
---|
181 | #define EOWNERDEAD 142 /* Previous owner died */ |
---|
182 | #ifdef __LINUX_ERRNO_EXTENSIONS__ |
---|
183 | #define ESTRPIPE 143 /* Streams pipe error */ |
---|
184 | #endif |
---|
185 | #define EWOULDBLOCK EAGAIN /* Operation would block */ |
---|
186 | |
---|
187 | #define __ELASTERROR 2000 /* Users can add values starting here */ |
---|
188 | |
---|
189 | #ifdef __cplusplus |
---|
190 | } |
---|
191 | #endif |
---|
192 | #endif /* _SYS_ERRNO_H */ |
---|