bsd_errnos/
netbsd.rs

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