bsd_errnos/
apple.rs

1#![allow(dead_code)]
2
3// This file automatically generate. Do not edit.
4
5use crate::Errno;
6impl Errno {
7    /// kernel internal error
8    pub const EDATALESS: Self = Self(-8);
9    /// kernel internal error
10    pub const EKEEPLOOKING: Self = Self(-7);
11    /// kernel internal error
12    pub const EREDRIVEOPEN: Self = Self(-6);
13    /// restart lookup under heavy vnode pressure/recycling
14    pub const ERECYCLE: Self = Self(-5);
15    /// don't modify regs, just return
16    pub const EJUSTRETURN: Self = Self(-2);
17    /// restart syscall
18    pub const ERESTART: Self = Self(-1);
19    /// Operation not permitted
20    pub const EPERM: Self = Self(1);
21    /// No such file or directory
22    pub const ENOENT: Self = Self(2);
23    /// No such process
24    pub const ESRCH: Self = Self(3);
25    /// Interrupted system call
26    pub const EINTR: Self = Self(4);
27    /// Input/output error
28    pub const EIO: Self = Self(5);
29    /// Device not configured
30    pub const ENXIO: Self = Self(6);
31    /// Argument list too long
32    pub const E2BIG: Self = Self(7);
33    /// Exec format error
34    pub const ENOEXEC: Self = Self(8);
35    /// Bad file descriptor
36    pub const EBADF: Self = Self(9);
37    /// No child processes
38    pub const ECHILD: Self = Self(10);
39    /// Resource deadlock avoided
40    pub const EDEADLK: Self = Self(11);
41    /// Cannot allocate memory
42    pub const ENOMEM: Self = Self(12);
43    /// Permission denied
44    pub const EACCES: Self = Self(13);
45    /// Bad address
46    pub const EFAULT: Self = Self(14);
47    /// Block device required
48    pub const ENOTBLK: Self = Self(15);
49    /// Device / Resource busy
50    pub const EBUSY: Self = Self(16);
51    /// File exists
52    pub const EEXIST: Self = Self(17);
53    /// Cross-device link
54    pub const EXDEV: Self = Self(18);
55    /// Operation not supported by device
56    pub const ENODEV: Self = Self(19);
57    /// Not a directory
58    pub const ENOTDIR: Self = Self(20);
59    /// Is a directory
60    pub const EISDIR: Self = Self(21);
61    /// Invalid argument
62    pub const EINVAL: Self = Self(22);
63    /// Too many open files in system
64    pub const ENFILE: Self = Self(23);
65    /// Too many open files
66    pub const EMFILE: Self = Self(24);
67    /// Inappropriate ioctl for device
68    pub const ENOTTY: Self = Self(25);
69    /// Text file busy
70    pub const ETXTBSY: Self = Self(26);
71    /// File too large
72    pub const EFBIG: Self = Self(27);
73    /// No space left on device
74    pub const ENOSPC: Self = Self(28);
75    /// Illegal seek
76    pub const ESPIPE: Self = Self(29);
77    /// Read-only file system
78    pub const EROFS: Self = Self(30);
79    /// Too many links
80    pub const EMLINK: Self = Self(31);
81    /// Broken pipe
82    pub const EPIPE: Self = Self(32);
83    /// Numerical argument out of domain
84    pub const EDOM: Self = Self(33);
85    /// Result too large
86    pub const ERANGE: Self = Self(34);
87    /// Resource temporarily unavailable
88    pub const EAGAIN: Self = Self(35);
89    /// Operation now in progress
90    pub const EINPROGRESS: Self = Self(36);
91    /// Operation already in progress
92    pub const EALREADY: Self = Self(37);
93    /// Socket operation on non-socket
94    pub const ENOTSOCK: Self = Self(38);
95    /// Destination address required
96    pub const EDESTADDRREQ: Self = Self(39);
97    /// Message too long
98    pub const EMSGSIZE: Self = Self(40);
99    /// Protocol wrong type for socket
100    pub const EPROTOTYPE: Self = Self(41);
101    /// Protocol not available
102    pub const ENOPROTOOPT: Self = Self(42);
103    /// Protocol not supported
104    pub const EPROTONOSUPPORT: Self = Self(43);
105    /// Socket type not supported
106    pub const ESOCKTNOSUPPORT: Self = Self(44);
107    /// Operation not supported
108    pub const ENOTSUP: Self = Self(45);
109    /// Protocol family not supported
110    pub const EPFNOSUPPORT: Self = Self(46);
111    /// Address family not supported by protocol family
112    pub const EAFNOSUPPORT: Self = Self(47);
113    /// Address already in use
114    pub const EADDRINUSE: Self = Self(48);
115    /// Can't assign requested address
116    pub const EADDRNOTAVAIL: Self = Self(49);
117    /// Network is down
118    pub const ENETDOWN: Self = Self(50);
119    /// Network is unreachable
120    pub const ENETUNREACH: Self = Self(51);
121    /// Network dropped connection on reset
122    pub const ENETRESET: Self = Self(52);
123    /// Software caused connection abort
124    pub const ECONNABORTED: Self = Self(53);
125    /// Connection reset by peer
126    pub const ECONNRESET: Self = Self(54);
127    /// No buffer space available
128    pub const ENOBUFS: Self = Self(55);
129    /// Socket is already connected
130    pub const EISCONN: Self = Self(56);
131    /// Socket is not connected
132    pub const ENOTCONN: Self = Self(57);
133    /// Can't send after socket shutdown
134    pub const ESHUTDOWN: Self = Self(58);
135    /// Too many references: can't splice
136    pub const ETOOMANYREFS: Self = Self(59);
137    /// Operation timed out
138    pub const ETIMEDOUT: Self = Self(60);
139    /// Connection refused
140    pub const ECONNREFUSED: Self = Self(61);
141    /// Too many levels of symbolic links
142    pub const ELOOP: Self = Self(62);
143    /// File name too long
144    pub const ENAMETOOLONG: Self = Self(63);
145    /// Host is down
146    pub const EHOSTDOWN: Self = Self(64);
147    /// No route to host
148    pub const EHOSTUNREACH: Self = Self(65);
149    /// Directory not empty
150    pub const ENOTEMPTY: Self = Self(66);
151    /// Too many processes
152    pub const EPROCLIM: Self = Self(67);
153    /// Too many users
154    pub const EUSERS: Self = Self(68);
155    /// Disc quota exceeded
156    pub const EDQUOT: Self = Self(69);
157    /// Stale NFS file handle
158    pub const ESTALE: Self = Self(70);
159    /// Too many levels of remote in path
160    pub const EREMOTE: Self = Self(71);
161    /// RPC struct is bad
162    pub const EBADRPC: Self = Self(72);
163    /// RPC version wrong
164    pub const ERPCMISMATCH: Self = Self(73);
165    /// RPC prog. not avail
166    pub const EPROGUNAVAIL: Self = Self(74);
167    /// Program version wrong
168    pub const EPROGMISMATCH: Self = Self(75);
169    /// Bad procedure for program
170    pub const EPROCUNAVAIL: Self = Self(76);
171    /// No locks available
172    pub const ENOLCK: Self = Self(77);
173    /// Function not implemented
174    pub const ENOSYS: Self = Self(78);
175    /// Inappropriate file type or format
176    pub const EFTYPE: Self = Self(79);
177    /// Authentication error
178    pub const EAUTH: Self = Self(80);
179    /// Need authenticator
180    pub const ENEEDAUTH: Self = Self(81);
181    /// Device power is off
182    pub const EPWROFF: Self = Self(82);
183    /// Device error, e.g. paper out
184    pub const EDEVERR: Self = Self(83);
185    /// Value too large to be stored in data type
186    pub const EOVERFLOW: Self = Self(84);
187    /// Bad executable
188    pub const EBADEXEC: Self = Self(85);
189    /// Bad CPU type in executable
190    pub const EBADARCH: Self = Self(86);
191    /// Shared library version mismatch
192    pub const ESHLIBVERS: Self = Self(87);
193    /// Malformed Macho file
194    pub const EBADMACHO: Self = Self(88);
195    /// Operation canceled
196    pub const ECANCELED: Self = Self(89);
197    /// Identifier removed
198    pub const EIDRM: Self = Self(90);
199    /// No message of desired type
200    pub const ENOMSG: Self = Self(91);
201    /// Illegal byte sequence
202    pub const EILSEQ: Self = Self(92);
203    /// Attribute not found
204    pub const ENOATTR: Self = Self(93);
205    /// Bad message
206    pub const EBADMSG: Self = Self(94);
207    /// Reserved
208    pub const EMULTIHOP: Self = Self(95);
209    /// No message available on STREAM
210    pub const ENODATA: Self = Self(96);
211    /// Reserved
212    pub const ENOLINK: Self = Self(97);
213    /// No STREAM resources
214    pub const ENOSR: Self = Self(98);
215    /// Not a STREAM
216    pub const ENOSTR: Self = Self(99);
217    /// Protocol error
218    pub const EPROTO: Self = Self(100);
219    /// STREAM ioctl timeout
220    pub const ETIME: Self = Self(101);
221    /// Operation not supported on socket
222    pub const EOPNOTSUPP: Self = Self(102);
223    /// No such policy registered
224    pub const ENOPOLICY: Self = Self(103);
225    /// State not recoverable
226    pub const ENOTRECOVERABLE: Self = Self(104);
227    /// Previous owner died
228    pub const EOWNERDEAD: Self = Self(105);
229    /// Interface output queue is full
230    pub const EQFULL: Self = Self(106);
231    /// kernel internal error
232    pub const ECVCERORR: Self = Self(256);
233    /// kernel internal error
234    pub const ECVPERORR: Self = Self(512);
235    /// Alias for [Self::EAGAIN]
236    pub const EWOULDBLOCK: Self = Self::EAGAIN;
237
238    pub const MIN: i32 = -8;
239    pub const MAX: i32 = 512;
240
241    #[cfg(feature = "iter")]
242    pub(crate) const ALL: [i32; 114] = [
243        -8, -7, -6, -5, -2, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
244        20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
245        43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
246        66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
247        89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 256, 512,
248    ];
249
250    pub(crate) fn name_and_description(&self) -> Option<(&'static str, &'static str)> {
251        match self.0 {
252            -8 => Some(("EDATALESS", "kernel internal error")),
253            -7 => Some(("EKEEPLOOKING", "kernel internal error")),
254            -6 => Some(("EREDRIVEOPEN", "kernel internal error")),
255            -5 => Some((
256                "ERECYCLE",
257                "restart lookup under heavy vnode pressure/recycling",
258            )),
259            -2 => Some(("EJUSTRETURN", "don't modify regs, just return")),
260            -1 => Some(("ERESTART", "restart syscall")),
261            1 => Some(("EPERM", "Operation not permitted")),
262            2 => Some(("ENOENT", "No such file or directory")),
263            3 => Some(("ESRCH", "No such process")),
264            4 => Some(("EINTR", "Interrupted system call")),
265            5 => Some(("EIO", "Input/output error")),
266            6 => Some(("ENXIO", "Device not configured")),
267            7 => Some(("E2BIG", "Argument list too long")),
268            8 => Some(("ENOEXEC", "Exec format error")),
269            9 => Some(("EBADF", "Bad file descriptor")),
270            10 => Some(("ECHILD", "No child processes")),
271            11 => Some(("EDEADLK", "Resource deadlock avoided")),
272            12 => Some(("ENOMEM", "Cannot allocate memory")),
273            13 => Some(("EACCES", "Permission denied")),
274            14 => Some(("EFAULT", "Bad address")),
275            15 => Some(("ENOTBLK", "Block device required")),
276            16 => Some(("EBUSY", "Device / Resource busy")),
277            17 => Some(("EEXIST", "File exists")),
278            18 => Some(("EXDEV", "Cross-device link")),
279            19 => Some(("ENODEV", "Operation not supported by device")),
280            20 => Some(("ENOTDIR", "Not a directory")),
281            21 => Some(("EISDIR", "Is a directory")),
282            22 => Some(("EINVAL", "Invalid argument")),
283            23 => Some(("ENFILE", "Too many open files in system")),
284            24 => Some(("EMFILE", "Too many open files")),
285            25 => Some(("ENOTTY", "Inappropriate ioctl for device")),
286            26 => Some(("ETXTBSY", "Text file busy")),
287            27 => Some(("EFBIG", "File too large")),
288            28 => Some(("ENOSPC", "No space left on device")),
289            29 => Some(("ESPIPE", "Illegal seek")),
290            30 => Some(("EROFS", "Read-only file system")),
291            31 => Some(("EMLINK", "Too many links")),
292            32 => Some(("EPIPE", "Broken pipe")),
293            33 => Some(("EDOM", "Numerical argument out of domain")),
294            34 => Some(("ERANGE", "Result too large")),
295            35 => Some(("EAGAIN", "Resource temporarily unavailable")),
296            36 => Some(("EINPROGRESS", "Operation now in progress")),
297            37 => Some(("EALREADY", "Operation already in progress")),
298            38 => Some(("ENOTSOCK", "Socket operation on non-socket")),
299            39 => Some(("EDESTADDRREQ", "Destination address required")),
300            40 => Some(("EMSGSIZE", "Message too long")),
301            41 => Some(("EPROTOTYPE", "Protocol wrong type for socket")),
302            42 => Some(("ENOPROTOOPT", "Protocol not available")),
303            43 => Some(("EPROTONOSUPPORT", "Protocol not supported")),
304            44 => Some(("ESOCKTNOSUPPORT", "Socket type not supported")),
305            45 => Some(("ENOTSUP", "Operation not supported")),
306            46 => Some(("EPFNOSUPPORT", "Protocol family not supported")),
307            47 => Some((
308                "EAFNOSUPPORT",
309                "Address family not supported by protocol family",
310            )),
311            48 => Some(("EADDRINUSE", "Address already in use")),
312            49 => Some(("EADDRNOTAVAIL", "Can't assign requested address")),
313            50 => Some(("ENETDOWN", "Network is down")),
314            51 => Some(("ENETUNREACH", "Network is unreachable")),
315            52 => Some(("ENETRESET", "Network dropped connection on reset")),
316            53 => Some(("ECONNABORTED", "Software caused connection abort")),
317            54 => Some(("ECONNRESET", "Connection reset by peer")),
318            55 => Some(("ENOBUFS", "No buffer space available")),
319            56 => Some(("EISCONN", "Socket is already connected")),
320            57 => Some(("ENOTCONN", "Socket is not connected")),
321            58 => Some(("ESHUTDOWN", "Can't send after socket shutdown")),
322            59 => Some(("ETOOMANYREFS", "Too many references: can't splice")),
323            60 => Some(("ETIMEDOUT", "Operation timed out")),
324            61 => Some(("ECONNREFUSED", "Connection refused")),
325            62 => Some(("ELOOP", "Too many levels of symbolic links")),
326            63 => Some(("ENAMETOOLONG", "File name too long")),
327            64 => Some(("EHOSTDOWN", "Host is down")),
328            65 => Some(("EHOSTUNREACH", "No route to host")),
329            66 => Some(("ENOTEMPTY", "Directory not empty")),
330            67 => Some(("EPROCLIM", "Too many processes")),
331            68 => Some(("EUSERS", "Too many users")),
332            69 => Some(("EDQUOT", "Disc quota exceeded")),
333            70 => Some(("ESTALE", "Stale NFS file handle")),
334            71 => Some(("EREMOTE", "Too many levels of remote in path")),
335            72 => Some(("EBADRPC", "RPC struct is bad")),
336            73 => Some(("ERPCMISMATCH", "RPC version wrong")),
337            74 => Some(("EPROGUNAVAIL", "RPC prog. not avail")),
338            75 => Some(("EPROGMISMATCH", "Program version wrong")),
339            76 => Some(("EPROCUNAVAIL", "Bad procedure for program")),
340            77 => Some(("ENOLCK", "No locks available")),
341            78 => Some(("ENOSYS", "Function not implemented")),
342            79 => Some(("EFTYPE", "Inappropriate file type or format")),
343            80 => Some(("EAUTH", "Authentication error")),
344            81 => Some(("ENEEDAUTH", "Need authenticator")),
345            82 => Some(("EPWROFF", "Device power is off")),
346            83 => Some(("EDEVERR", "Device error, e.g. paper out")),
347            84 => Some(("EOVERFLOW", "Value too large to be stored in data type")),
348            85 => Some(("EBADEXEC", "Bad executable")),
349            86 => Some(("EBADARCH", "Bad CPU type in executable")),
350            87 => Some(("ESHLIBVERS", "Shared library version mismatch")),
351            88 => Some(("EBADMACHO", "Malformed Macho file")),
352            89 => Some(("ECANCELED", "Operation canceled")),
353            90 => Some(("EIDRM", "Identifier removed")),
354            91 => Some(("ENOMSG", "No message of desired type")),
355            92 => Some(("EILSEQ", "Illegal byte sequence")),
356            93 => Some(("ENOATTR", "Attribute not found")),
357            94 => Some(("EBADMSG", "Bad message")),
358            95 => Some(("EMULTIHOP", "Reserved")),
359            96 => Some(("ENODATA", "No message available on STREAM")),
360            97 => Some(("ENOLINK", "Reserved")),
361            98 => Some(("ENOSR", "No STREAM resources")),
362            99 => Some(("ENOSTR", "Not a STREAM")),
363            100 => Some(("EPROTO", "Protocol error")),
364            101 => Some(("ETIME", "STREAM ioctl timeout")),
365            102 => Some(("EOPNOTSUPP", "Operation not supported on socket")),
366            103 => Some(("ENOPOLICY", "No such policy registered")),
367            104 => Some(("ENOTRECOVERABLE", "State not recoverable")),
368            105 => Some(("EOWNERDEAD", "Previous owner died")),
369            106 => Some(("EQFULL", "Interface output queue is full")),
370            256 => Some(("ECVCERORR", "kernel internal error")),
371            512 => Some(("ECVPERORR", "kernel internal error")),
372            _ => None,
373        }
374    }
375}