1 /*
2  * reimplementation of Daniel Bernsteins unix library.
3  * placed in the public domain by Uwe Ohse, uwe@ohse.de.
4  * This file is automatically generated.
5  */
6 /* @(#) $Id: s.error_str.c 1.7 03/03/03 07:14:44+00:00 uwe@ranan.ohse.de $ */
7 
8 #include "error.h"
error_str(int ec)9 const char *error_str(int ec) {
10 	if (ec==0) return "no error";
11 #ifdef EACCES
12 	if (ec==EACCES) return "access denied";
13 #endif
14 	if (ec==error_acces) return "access denied";
15 #ifdef EAGAIN
16 	if (ec==EAGAIN) return "temporary failure";
17 #endif
18 	if (ec==error_again) return "temporary failure";
19 #ifdef ECONNREFUSED
20 	if (ec==ECONNREFUSED) return "connection refused";
21 #endif
22 	if (ec==error_connrefused) return "connection refused";
23 #ifdef EEXIST
24 	if (ec==EEXIST) return "file already exists";
25 #endif
26 	if (ec==error_exist) return "file already exists";
27 #ifdef EINPROGRESS
28 	if (ec==EINPROGRESS) return "operation in progress";
29 #endif
30 	if (ec==error_inprogress) return "operation in progress";
31 #ifdef EINTR
32 	if (ec==EINTR) return "interrupted system call";
33 #endif
34 	if (ec==error_intr) return "interrupted system call";
35 #ifdef EIO
36 	if (ec==EIO) return "input/output error";
37 #endif
38 	if (ec==error_io) return "input/output error";
39 #ifdef EISDIR
40 	if (ec==EISDIR) return "is a directory";
41 #endif
42 	if (ec==error_isdir) return "is a directory";
43 #ifdef EMLINK
44 	if (ec==EMLINK) return "too many links";
45 #endif
46 	if (ec==error_mlink) return "too many links";
47 #ifdef ENXIO
48 	if (ec==ENXIO) return "device not configured";
49 #endif
50 	if (ec==error_nodevice) return "device not configured";
51 #ifdef ENOENT
52 	if (ec==ENOENT) return "file does not exist";
53 #endif
54 	if (ec==error_noent) return "file does not exist";
55 #ifdef ENOMEM
56 	if (ec==ENOMEM) return "out of memory";
57 #endif
58 	if (ec==error_nomem) return "out of memory";
59 #ifdef EPERM
60 	if (ec==EPERM) return "permission denied";
61 #endif
62 	if (ec==error_perm) return "permission denied";
63 #ifdef EPIPE
64 	if (ec==EPIPE) return "broken pipe";
65 #endif
66 	if (ec==error_pipe) return "broken pipe";
67 #ifdef EPROTO
68 	if (ec==EPROTO) return "protocol error";
69 #endif
70 	if (ec==error_proto) return "protocol error";
71 #ifdef ETIMEDOUT
72 	if (ec==ETIMEDOUT) return "timed out";
73 #endif
74 	if (ec==error_timeout) return "timed out";
75 #ifdef ETXTBSY
76 	if (ec==ETXTBSY) return "text busy";
77 #endif
78 	if (ec==error_txtbsy) return "text busy";
79 #ifdef EWOULDBLOCK
80 	if (ec==EWOULDBLOCK) return "input/output would block";
81 #endif
82 	if (ec==error_wouldblock) return "input/output would block";
83 #ifdef E2BIG
84 	if (ec==E2BIG) return "argument list too long";
85 #endif
86 #ifdef EADDRINUSE
87 	if (ec==EADDRINUSE) return "address already used";
88 #endif
89 #ifdef EADDRNOTAVAIL
90 	if (ec==EADDRNOTAVAIL) return "address not available";
91 #endif
92 #ifdef EADV
93 	if (ec==EADV) return "advertise error";
94 #endif
95 #ifdef EAFNOSUPPORT
96 	if (ec==EAFNOSUPPORT) return "address family not supported";
97 #endif
98 	if (ec==error_afnosupport) return "address family not supported";
99 #ifdef EALREADY
100 	if (ec==EALREADY) return "operation already in progress";
101 #endif
102 #ifdef EAUTH
103 	if (ec==EAUTH) return "authentication error";
104 #endif
105 #ifdef EBADF
106 	if (ec==EBADF) return "file descriptor not open";
107 #endif
108 #ifdef EBADMSG
109 	if (ec==EBADMSG) return "bad message type";
110 #endif
111 #ifdef EBADRPC
112 	if (ec==EBADRPC) return "RPC structure is bad";
113 #endif
114 #ifdef EBUSY
115 	if (ec==EBUSY) return "device busy";
116 #endif
117 #ifdef ECHILD
118 	if (ec==ECHILD) return "no child processes";
119 #endif
120 #ifdef ECOMM
121 	if (ec==ECOMM) return "communication error";
122 #endif
123 #ifdef ECONNABORTED
124 	if (ec==ECONNABORTED) return "connection aborted";
125 #endif
126 #ifdef ECONNRESET
127 	if (ec==ECONNRESET) return "connection reset";
128 #endif
129 	if (ec==error_connreset) return "connection reset";
130 #ifdef EDEADLK
131 	if (ec==EDEADLK) return "operation would cause deadlock";
132 #endif
133 #ifdef EDESTADDRREQ
134 	if (ec==EDESTADDRREQ) return "destination address required";
135 #endif
136 #ifdef EDOM
137 	if (ec==EDOM) return "input out of range";
138 #endif
139 #ifdef EDQUOT
140 	if (ec==EDQUOT) return "disk quota exceeded";
141 #endif
142 #ifdef EFAULT
143 	if (ec==EFAULT) return "bad address";
144 #endif
145 #ifdef EFBIG
146 	if (ec==EFBIG) return "file too big";
147 #endif
148 #ifdef EFTYPE
149 	if (ec==EFTYPE) return "bad file type";
150 #endif
151 #ifdef EHOSTDOWN
152 	if (ec==EHOSTDOWN) return "host down";
153 #endif
154 #ifdef EHOSTUNREACH
155 	if (ec==EHOSTUNREACH) return "host unreachable";
156 #endif
157 #ifdef EIDRM
158 	if (ec==EIDRM) return "identifier removed";
159 #endif
160 #ifdef EINVAL
161 	if (ec==EINVAL) return "invalid argument";
162 #endif
163 #ifdef EISCONN
164 	if (ec==EISCONN) return "already connected";
165 #endif
166 #ifdef ELOOP
167 	if (ec==ELOOP) return "symbolic link loop";
168 #endif
169 #ifdef EMFILE
170 	if (ec==EMFILE) return "process cannot open more files";
171 #endif
172 #ifdef EMSGSIZE
173 	if (ec==EMSGSIZE) return "message too long";
174 #endif
175 #ifdef EMULTIHOP
176 	if (ec==EMULTIHOP) return "multihop attempted";
177 #endif
178 #ifdef ENAMETOOLONG
179 	if (ec==ENAMETOOLONG) return "file name too long";
180 #endif
181 #ifdef ENEEDAUTH
182 	if (ec==ENEEDAUTH) return "not authenticated";
183 #endif
184 #ifdef ENETDOWN
185 	if (ec==ENETDOWN) return "network down";
186 #endif
187 #ifdef ENETRESET
188 	if (ec==ENETRESET) return "network reset";
189 #endif
190 #ifdef ENETUNREACH
191 	if (ec==ENETUNREACH) return "network unreachable";
192 #endif
193 #ifdef ENFILE
194 	if (ec==ENFILE) return "system cannot open more files";
195 #endif
196 #ifdef ENOBUFS
197 	if (ec==ENOBUFS) return "out of buffer space";
198 #endif
199 #ifdef ENODEV
200 	if (ec==ENODEV) return "device does not support operation";
201 #endif
202 #ifdef ENOEXEC
203 	if (ec==ENOEXEC) return "exec format error";
204 #endif
205 #ifdef ENOLCK
206 	if (ec==ENOLCK) return "no locks available";
207 #endif
208 #ifdef ENOLINK
209 	if (ec==ENOLINK) return "link severed";
210 #endif
211 #ifdef ENOMSG
212 	if (ec==ENOMSG) return "no message of desired type";
213 #endif
214 #ifdef ENONET
215 	if (ec==ENONET) return "machine not on network";
216 #endif
217 #ifdef ENOPROTOOPT
218 	if (ec==ENOPROTOOPT) return "protocol not available";
219 #endif
220 #ifdef ENOSPC
221 	if (ec==ENOSPC) return "out of disk space";
222 #endif
223 #ifdef ENOSR
224 	if (ec==ENOSR) return "out of stream resources";
225 #endif
226 #ifdef ENOSTR
227 	if (ec==ENOSTR) return "not a stream device";
228 #endif
229 #ifdef ENOSYS
230 	if (ec==ENOSYS) return "system call not available";
231 #endif
232 #ifdef ENOTBLK
233 	if (ec==ENOTBLK) return "not a block device";
234 #endif
235 #ifdef ENOTCONN
236 	if (ec==ENOTCONN) return "not connected";
237 #endif
238 #ifdef ENOTDIR
239 	if (ec==ENOTDIR) return "not a directory";
240 #endif
241 #ifdef ENOTEMPTY
242 	if (ec==ENOTEMPTY) return "directory not empty";
243 #endif
244 #ifdef ENOTSOCK
245 	if (ec==ENOTSOCK) return "not a socket";
246 #endif
247 #ifdef ENOTTY
248 	if (ec==ENOTTY) return "not a tty";
249 #endif
250 #ifdef EOPNOTSUPP
251 	if (ec==EOPNOTSUPP) return "operation not supported";
252 #endif
253 #ifdef EPFNOSUPPORT
254 	if (ec==EPFNOSUPPORT) return "protocol family not supported";
255 #endif
256 #ifdef EPROCLIM
257 	if (ec==EPROCLIM) return "too many processes";
258 #endif
259 #ifdef EPROCUNAVAIL
260 	if (ec==EPROCUNAVAIL) return "bad procedure for program";
261 #endif
262 #ifdef EPROGMISMATCH
263 	if (ec==EPROGMISMATCH) return "program version mismatch";
264 #endif
265 #ifdef EPROGUNAVAIL
266 	if (ec==EPROGUNAVAIL) return "RPC program unavailable";
267 #endif
268 #ifdef EPROTONOSUPPORT
269 	if (ec==EPROTONOSUPPORT) return "protocol not supported";
270 #endif
271 #ifdef EPROTOTYPE
272 	if (ec==EPROTOTYPE) return "incorrect protocol type";
273 #endif
274 #ifdef ERANGE
275 	if (ec==ERANGE) return "output out of range";
276 #endif
277 #ifdef EREMCHG
278 	if (ec==EREMCHG) return "remote address changed";
279 #endif
280 #ifdef EREMOTE
281 	if (ec==EREMOTE) return "too many levels of remote in path";
282 #endif
283 #ifdef EROFS
284 	if (ec==EROFS) return "read-only file system";
285 #endif
286 #ifdef ERPCMISMATCH
287 	if (ec==ERPCMISMATCH) return "RPC version mismatch";
288 #endif
289 #ifdef ERREMOTE
290 	if (ec==ERREMOTE) return "object not local";
291 #endif
292 #ifdef ESHUTDOWN
293 	if (ec==ESHUTDOWN) return "socket shut down";
294 #endif
295 #ifdef ESOCKTNOSUPPORT
296 	if (ec==ESOCKTNOSUPPORT) return "socket type not supported";
297 #endif
298 #ifdef ESPIPE
299 	if (ec==ESPIPE) return "unseekable descriptor";
300 #endif
301 #ifdef ESRCH
302 	if (ec==ESRCH) return "no such process";
303 #endif
304 #ifdef ESRMNT
305 	if (ec==ESRMNT) return "srmount error";
306 #endif
307 #ifdef ESTALE
308 	if (ec==ESTALE) return "stale NFS file handle";
309 #endif
310 #ifdef ETIME
311 	if (ec==ETIME) return "timer expired";
312 #endif
313 #ifdef ETOOMANYREFS
314 	if (ec==ETOOMANYREFS) return "too many references";
315 #endif
316 #ifdef EUSERS
317 	if (ec==EUSERS) return "too many users";
318 #endif
319 #ifdef EXDEV
320 	if (ec==EXDEV) return "cross-device link";
321 #endif
322 return "unknown error";
323 }
324