bsd_errnos/
openbsd.rs

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