1#![allow(dead_code)]
2
3use crate::Errno;
6impl Errno {
7 pub const EMOUNTEXIT: Self = Self(-4);
9 pub const ENOIOCTL: Self = Self(-3);
11 pub const EJUSTRETURN: Self = Self(-2);
13 pub const ERESTART: Self = Self(-1);
15 pub const EPERM: Self = Self(1);
17 pub const ENOENT: Self = Self(2);
19 pub const ESRCH: Self = Self(3);
21 pub const EINTR: Self = Self(4);
23 pub const EIO: Self = Self(5);
25 pub const ENXIO: Self = Self(6);
27 pub const E2BIG: Self = Self(7);
29 pub const ENOEXEC: Self = Self(8);
31 pub const EBADF: Self = Self(9);
33 pub const ECHILD: Self = Self(10);
35 pub const EDEADLK: Self = Self(11);
37 pub const ENOMEM: Self = Self(12);
39 pub const EACCES: Self = Self(13);
41 pub const EFAULT: Self = Self(14);
43 pub const ENOTBLK: Self = Self(15);
45 pub const EBUSY: Self = Self(16);
47 pub const EEXIST: Self = Self(17);
49 pub const EXDEV: Self = Self(18);
51 pub const ENODEV: Self = Self(19);
53 pub const ENOTDIR: Self = Self(20);
55 pub const EISDIR: Self = Self(21);
57 pub const EINVAL: Self = Self(22);
59 pub const ENFILE: Self = Self(23);
61 pub const EMFILE: Self = Self(24);
63 pub const ENOTTY: Self = Self(25);
65 pub const ETXTBSY: Self = Self(26);
67 pub const EFBIG: Self = Self(27);
69 pub const ENOSPC: Self = Self(28);
71 pub const ESPIPE: Self = Self(29);
73 pub const EROFS: Self = Self(30);
75 pub const EMLINK: Self = Self(31);
77 pub const EPIPE: Self = Self(32);
79 pub const EDOM: Self = Self(33);
81 pub const ERANGE: Self = Self(34);
83 pub const EAGAIN: Self = Self(35);
85 pub const EINPROGRESS: Self = Self(36);
87 pub const EALREADY: Self = Self(37);
89 pub const ENOTSOCK: Self = Self(38);
91 pub const EDESTADDRREQ: Self = Self(39);
93 pub const EMSGSIZE: Self = Self(40);
95 pub const EPROTOTYPE: Self = Self(41);
97 pub const ENOPROTOOPT: Self = Self(42);
99 pub const EPROTONOSUPPORT: Self = Self(43);
101 pub const ESOCKTNOSUPPORT: Self = Self(44);
103 pub const EOPNOTSUPP: Self = Self(45);
105 pub const EPFNOSUPPORT: Self = Self(46);
107 pub const EAFNOSUPPORT: Self = Self(47);
109 pub const EADDRINUSE: Self = Self(48);
111 pub const EADDRNOTAVAIL: Self = Self(49);
113 pub const ENETDOWN: Self = Self(50);
115 pub const ENETUNREACH: Self = Self(51);
117 pub const ENETRESET: Self = Self(52);
119 pub const ECONNABORTED: Self = Self(53);
121 pub const ECONNRESET: Self = Self(54);
123 pub const ENOBUFS: Self = Self(55);
125 pub const EISCONN: Self = Self(56);
127 pub const ENOTCONN: Self = Self(57);
129 pub const ESHUTDOWN: Self = Self(58);
131 pub const ETOOMANYREFS: Self = Self(59);
133 pub const ETIMEDOUT: Self = Self(60);
135 pub const ECONNREFUSED: Self = Self(61);
137 pub const ELOOP: Self = Self(62);
139 pub const ENAMETOOLONG: Self = Self(63);
141 pub const EHOSTDOWN: Self = Self(64);
143 pub const EHOSTUNREACH: Self = Self(65);
145 pub const ENOTEMPTY: Self = Self(66);
147 pub const EPROCLIM: Self = Self(67);
149 pub const EUSERS: Self = Self(68);
151 pub const EDQUOT: Self = Self(69);
153 pub const ESTALE: Self = Self(70);
155 pub const EREMOTE: Self = Self(71);
157 pub const EBADRPC: Self = Self(72);
159 pub const ERPCMISMATCH: Self = Self(73);
161 pub const EPROGUNAVAIL: Self = Self(74);
163 pub const EPROGMISMATCH: Self = Self(75);
165 pub const EPROCUNAVAIL: Self = Self(76);
167 pub const ENOLCK: Self = Self(77);
169 pub const ENOSYS: Self = Self(78);
171 pub const EFTYPE: Self = Self(79);
173 pub const EAUTH: Self = Self(80);
175 pub const ENEEDAUTH: Self = Self(81);
177 pub const EIDRM: Self = Self(82);
179 pub const ENOMSG: Self = Self(83);
181 pub const EOVERFLOW: Self = Self(84);
183 pub const ECANCELED: Self = Self(85);
185 pub const EILSEQ: Self = Self(86);
187 pub const ENOATTR: Self = Self(87);
189 pub const EDOOFUS: Self = Self(88);
191 pub const EBADMSG: Self = Self(89);
193 pub const EMULTIHOP: Self = Self(90);
195 pub const ENOLINK: Self = Self(91);
197 pub const EPROTO: Self = Self(92);
199 pub const ENOMEDIUM: Self = Self(93);
201 pub const ENOTRECOVERABLE: Self = Self(94);
203 pub const EOWNERDEAD: Self = Self(95);
205 pub const EASYNC: Self = Self(99);
207 pub const ENOTSUP: Self = Self::EOPNOTSUPP;
209 pub const EWOULDBLOCK: Self = Self::EAGAIN;
211
212 pub const MIN: i32 = -4;
213 pub const MAX: i32 = 99;
214
215 #[cfg(feature = "iter")]
216 pub(crate) const ALL: [i32; 100] = [
217 -4, -3, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
218 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
219 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
220 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
221 91, 92, 93, 94, 95, 99,
222 ];
223
224 pub(crate) fn name_and_description(&self) -> Option<(&'static str, &'static str)> {
225 match self.0 {
226 -4 => Some(("EMOUNTEXIT", "mfs: mountpoint released via vfs_start")),
227 -3 => Some(("ENOIOCTL", "ioctl not handled by this layer")),
228 -2 => Some(("EJUSTRETURN", "don't modify regs, just return")),
229 -1 => Some(("ERESTART", "restart syscall")),
230 1 => Some(("EPERM", "Operation not permitted")),
231 2 => Some(("ENOENT", "No such file or directory")),
232 3 => Some(("ESRCH", "No such process")),
233 4 => Some(("EINTR", "Interrupted system call")),
234 5 => Some(("EIO", "Input/output error")),
235 6 => Some(("ENXIO", "Device not configured")),
236 7 => Some(("E2BIG", "Argument list too long")),
237 8 => Some(("ENOEXEC", "Exec format error")),
238 9 => Some(("EBADF", "Bad file descriptor")),
239 10 => Some(("ECHILD", "No child processes")),
240 11 => Some(("EDEADLK", "Resource deadlock avoided")),
241 12 => Some(("ENOMEM", "Cannot allocate memory")),
242 13 => Some(("EACCES", "Permission denied")),
243 14 => Some(("EFAULT", "Bad address")),
244 15 => Some(("ENOTBLK", "Block device required")),
245 16 => Some(("EBUSY", "Device busy")),
246 17 => Some(("EEXIST", "File exists")),
247 18 => Some(("EXDEV", "Cross-device link")),
248 19 => Some(("ENODEV", "Operation not supported by device")),
249 20 => Some(("ENOTDIR", "Not a directory")),
250 21 => Some(("EISDIR", "Is a directory")),
251 22 => Some(("EINVAL", "Invalid argument")),
252 23 => Some(("ENFILE", "Too many open files in system")),
253 24 => Some(("EMFILE", "Too many open files")),
254 25 => Some(("ENOTTY", "Inappropriate ioctl for device")),
255 26 => Some(("ETXTBSY", "Text file busy")),
256 27 => Some(("EFBIG", "File too large")),
257 28 => Some(("ENOSPC", "No space left on device")),
258 29 => Some(("ESPIPE", "Illegal seek")),
259 30 => Some(("EROFS", "Read-only filesystem")),
260 31 => Some(("EMLINK", "Too many links")),
261 32 => Some(("EPIPE", "Broken pipe")),
262 33 => Some(("EDOM", "Numerical argument out of domain")),
263 34 => Some(("ERANGE", "Result too large")),
264 35 => Some(("EAGAIN", "Resource temporarily unavailable")),
265 36 => Some(("EINPROGRESS", "Operation now in progress")),
266 37 => Some(("EALREADY", "Operation already in progress")),
267 38 => Some(("ENOTSOCK", "Socket operation on non-socket")),
268 39 => Some(("EDESTADDRREQ", "Destination address required")),
269 40 => Some(("EMSGSIZE", "Message too long")),
270 41 => Some(("EPROTOTYPE", "Protocol wrong type for socket")),
271 42 => Some(("ENOPROTOOPT", "Protocol not available")),
272 43 => Some(("EPROTONOSUPPORT", "Protocol not supported")),
273 44 => Some(("ESOCKTNOSUPPORT", "Socket type not supported")),
274 45 => Some(("EOPNOTSUPP", "Operation not supported")),
275 46 => Some(("EPFNOSUPPORT", "Protocol family not supported")),
276 47 => Some((
277 "EAFNOSUPPORT",
278 "Address family not supported by protocol family",
279 )),
280 48 => Some(("EADDRINUSE", "Address already in use")),
281 49 => Some(("EADDRNOTAVAIL", "Can't assign requested address")),
282 50 => Some(("ENETDOWN", "Network is down")),
283 51 => Some(("ENETUNREACH", "Network is unreachable")),
284 52 => Some(("ENETRESET", "Network dropped connection on reset")),
285 53 => Some(("ECONNABORTED", "Software caused connection abort")),
286 54 => Some(("ECONNRESET", "Connection reset by peer")),
287 55 => Some(("ENOBUFS", "No buffer space available")),
288 56 => Some(("EISCONN", "Socket is already connected")),
289 57 => Some(("ENOTCONN", "Socket is not connected")),
290 58 => Some(("ESHUTDOWN", "Can't send after socket shutdown")),
291 59 => Some(("ETOOMANYREFS", "Too many references: can't splice")),
292 60 => Some(("ETIMEDOUT", "Operation timed out")),
293 61 => Some(("ECONNREFUSED", "Connection refused")),
294 62 => Some(("ELOOP", "Too many levels of symbolic links")),
295 63 => Some(("ENAMETOOLONG", "File name too long")),
296 64 => Some(("EHOSTDOWN", "Host is down")),
297 65 => Some(("EHOSTUNREACH", "No route to host")),
298 66 => Some(("ENOTEMPTY", "Directory not empty")),
299 67 => Some(("EPROCLIM", "Too many processes")),
300 68 => Some(("EUSERS", "Too many users")),
301 69 => Some(("EDQUOT", "Disc quota exceeded")),
302 70 => Some(("ESTALE", "Stale NFS file handle")),
303 71 => Some(("EREMOTE", "Too many levels of remote in path")),
304 72 => Some(("EBADRPC", "RPC struct is bad")),
305 73 => Some(("ERPCMISMATCH", "RPC version wrong")),
306 74 => Some(("EPROGUNAVAIL", "RPC prog. not avail")),
307 75 => Some(("EPROGMISMATCH", "Program version wrong")),
308 76 => Some(("EPROCUNAVAIL", "Bad procedure for program")),
309 77 => Some(("ENOLCK", "No locks available")),
310 78 => Some(("ENOSYS", "Function not implemented")),
311 79 => Some(("EFTYPE", "Inappropriate file type or format")),
312 80 => Some(("EAUTH", "Authentication error")),
313 81 => Some(("ENEEDAUTH", "Need authenticator")),
314 82 => Some(("EIDRM", "Identifier removed")),
315 83 => Some(("ENOMSG", "No message of desired type")),
316 84 => Some(("EOVERFLOW", "Value too large to be stored in data type")),
317 85 => Some(("ECANCELED", "Operation canceled")),
318 86 => Some(("EILSEQ", "Illegal byte sequence")),
319 87 => Some(("ENOATTR", "Attribute not found")),
320 88 => Some(("EDOOFUS", "Programming error")),
321 89 => Some(("EBADMSG", "Bad message")),
322 90 => Some(("EMULTIHOP", "Multihop attempted")),
323 91 => Some(("ENOLINK", "Link has been severed")),
324 92 => Some(("EPROTO", "Protocol error")),
325 93 => Some(("ENOMEDIUM", "linux")),
326 94 => Some(("ENOTRECOVERABLE", "State not recoverable")),
327 95 => Some(("EOWNERDEAD", "Previous owner died")),
328 99 => Some(("EASYNC", "XXX")),
329 _ => None,
330 }
331 }
332}