version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ERRNO |
|
|
2 |
!!!ERRNO |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
SEE ALSO |
|
|
7 |
---- |
|
|
8 |
!!NAME |
|
|
9 |
|
|
|
10 |
|
|
|
11 |
errno - number of last error |
|
|
12 |
!!SYNOPSIS |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
#include |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
extern int errno; |
|
|
19 |
!!DESCRIPTION |
|
|
20 |
|
|
|
21 |
|
|
|
22 |
The integer __errno__ is set by system calls (and some |
|
|
23 |
library functions) to indicate what went wrong. Its value is |
|
|
24 |
significant only when the call returned an error (usually |
|
|
25 |
-1), and a library function that does succeed is allowed to |
|
|
26 |
change __errno__. |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
Sometimes, when -1 is also a legal return value one has to |
|
|
30 |
zero __errno__ before the call in order to detect |
|
|
31 |
possible errors. |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
__errno__ is defined by the ISO C standard to be a |
|
|
35 |
modifiable lvalue of type __int__, and must not be |
|
|
36 |
explicitly declared; __errno__ may be a macro. |
|
|
37 |
__errno__ is thread-local; setting it in one thread does |
|
|
38 |
not affect its value in any other thread. |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
Valid error numbers are all non-zero; __errno__ is never |
|
|
42 |
set to zero by any library function. All the error names |
|
|
43 |
specified by POSIX.1 must have distinct values. |
|
|
44 |
|
|
|
45 |
|
|
|
46 |
POSIX.1 (1996 edition) lists the following symbolic error |
|
|
47 |
names. Of these, __EDOM__ and __ERANGE__ are in the |
|
|
48 |
ISO C standard. ISO C Amendment 1 defines the additional |
|
|
49 |
error number __EILSEQ__ for coding errors in multibyte or |
|
|
50 |
wide characters. |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
__E2BIG__ |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
Arg list too long |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
__EACCES__ |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
Permission denied |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
__EAGAIN__ |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
Resource temporarily unavailable |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
__EBADF__ |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
Bad file descriptor |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
__EBADMSG__ |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
Bad message |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
__EBUSY__ |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
Resource busy |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
__ECANCELED__ |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
Operation canceled |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
__ECHILD__ |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
No child processes |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
__EDEADLK__ |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
Resource deadlock avoided |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
__EDOM__ |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
Domain error |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
__EEXIST__ |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
File exists |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
__EFAULT__ |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
Bad address |
|
|
123 |
|
|
|
124 |
|
|
|
125 |
__EFBIG__ |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
File too large |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
__EINPROGRESS__ |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
Operation in progress |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
__EINTR__ |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
Interrupted function call |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
__EINVAL__ |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
Invalid argument |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
__EIO__ |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
Input/output error |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
__EISDIR__ |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
Is a directory |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
__EMFILE__ |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
Too many open files |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
__EMLINK__ |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
Too many links |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__EMSGSIZE__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
Inappropriate message buffer length |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
__ENAMETOOLONG__ |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
Filename too long |
|
|
183 |
|
|
|
184 |
|
|
|
185 |
__ENFILE__ |
|
|
186 |
|
|
|
187 |
|
|
|
188 |
Too many open files in system |
|
|
189 |
|
|
|
190 |
|
|
|
191 |
__ENODEV__ |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
No such device |
|
|
195 |
|
|
|
196 |
|
|
|
197 |
__ENOENT__ |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
No such file or directory |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
__ENOEXEC__ |
|
|
204 |
|
|
|
205 |
|
|
|
206 |
Exec format error |
|
|
207 |
|
|
|
208 |
|
|
|
209 |
__ENOLCK__ |
|
|
210 |
|
|
|
211 |
|
|
|
212 |
No locks available |
|
|
213 |
|
|
|
214 |
|
|
|
215 |
__ENOMEM__ |
|
|
216 |
|
|
|
217 |
|
|
|
218 |
Not enough space |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
__ENOSPC__ |
|
|
222 |
|
|
|
223 |
|
|
|
224 |
No space left on device |
|
|
225 |
|
|
|
226 |
|
|
|
227 |
__ENOSYS__ |
|
|
228 |
|
|
|
229 |
|
|
|
230 |
Function not implemented |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
__ENOTDIR__ |
|
|
234 |
|
|
|
235 |
|
|
|
236 |
Not a directory |
|
|
237 |
|
|
|
238 |
|
|
|
239 |
__ENOTEMPTY__ |
|
|
240 |
|
|
|
241 |
|
|
|
242 |
Directory not empty |
|
|
243 |
|
|
|
244 |
|
|
|
245 |
__ENOTSUP__ |
|
|
246 |
|
|
|
247 |
|
|
|
248 |
Not supported |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
__ENOTTY__ |
|
|
252 |
|
|
|
253 |
|
|
|
254 |
Inappropriate I/O control operation |
|
|
255 |
|
|
|
256 |
|
|
|
257 |
__ENXIO__ |
|
|
258 |
|
|
|
259 |
|
|
|
260 |
No such device or address |
|
|
261 |
|
|
|
262 |
|
|
|
263 |
__EPERM__ |
|
|
264 |
|
|
|
265 |
|
|
|
266 |
Operation not permitted |
|
|
267 |
|
|
|
268 |
|
|
|
269 |
__EPIPE__ |
|
|
270 |
|
|
|
271 |
|
|
|
272 |
Broken pipe |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
__ERANGE__ |
|
|
276 |
|
|
|
277 |
|
|
|
278 |
Result too large |
|
|
279 |
|
|
|
280 |
|
|
|
281 |
__EROFS__ |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
Read-only file system |
|
|
285 |
|
|
|
286 |
|
|
|
287 |
__ESPIPE__ |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
Invalid seek |
|
|
291 |
|
|
|
292 |
|
|
|
293 |
__ESRCH__ |
|
|
294 |
|
|
|
295 |
|
|
|
296 |
No such process |
|
|
297 |
|
|
|
298 |
|
|
|
299 |
__ETIMEDOUT__ |
|
|
300 |
|
|
|
301 |
|
|
|
302 |
Operation timed out |
|
|
303 |
|
|
|
304 |
|
|
|
305 |
__EXDEV__ |
|
|
306 |
|
|
|
307 |
|
|
|
308 |
Improper link |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
Many other error numbers are returned by various Unix |
|
|
312 |
implementations. System V returns ETXTBSY (Text file busy) |
|
|
313 |
if one tries to exec() a file that is currently open for |
|
|
314 |
writing. Linux also returns this error if one tries to have |
|
|
315 |
a file both memory mapped with VM_DENYWRITE and open for |
|
|
316 |
writing. |
|
|
317 |
!!SEE ALSO |
|
|
318 |
|
|
|
319 |
|
|
|
320 |
perror(3), strerror(3) |
|
|
321 |
---- |