linux_errno/linux-errno_mips.rs
1// Copyright (c) 2022 John Millikin <john@john-millikin.com>
2//
3// Permission to use, copy, modify, and/or distribute this software for any
4// purpose with or without fee is hereby granted.
5//
6// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
7// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
9// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
10// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
11// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
12// PERFORMANCE OF THIS SOFTWARE.
13//
14// SPDX-License-Identifier: 0BSD
15
16#![allow(unused)]
17
18errno_constants! {
19 // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/errno-base.h?h=v5.19
20
21 /// Operation not permitted
22 EPERM = 1,
23 /// No such file or directory
24 ENOENT = 2,
25 /// No such process
26 ESRCH = 3,
27 /// Interrupted system call
28 EINTR = 4,
29 /// I/O error
30 EIO = 5,
31 /// No such device or address
32 ENXIO = 6,
33 /// Argument list too long
34 E2BIG = 7,
35 /// Exec format error
36 ENOEXEC = 8,
37 /// Bad file number
38 EBADF = 9,
39
40 /// No child processes
41 ECHILD = 10,
42 /// Try again
43 EAGAIN = 11,
44 /// Out of memory
45 ENOMEM = 12,
46 /// Permission denied
47 EACCES = 13,
48 /// Bad address
49 EFAULT = 14,
50 /// Block device required
51 ENOTBLK = 15,
52 /// Device or resource busy
53 EBUSY = 16,
54 /// File exists
55 EEXIST = 17,
56 /// Cross-device link
57 EXDEV = 18,
58 /// No such device
59 ENODEV = 19,
60
61 /// Not a directory
62 ENOTDIR = 20,
63 /// Is a directory
64 EISDIR = 21,
65 /// Invalid argument
66 EINVAL = 22,
67 /// File table overflow
68 ENFILE = 23,
69 /// Too many open files
70 EMFILE = 24,
71 /// Not a typewriter
72 ENOTTY = 25,
73 /// Text file busy
74 ETXTBSY = 26,
75 /// File too large
76 EFBIG = 27,
77 /// No space left on device
78 ENOSPC = 28,
79 /// Illegal seek
80 ESPIPE = 29,
81
82 /// Read-only file system
83 EROFS = 30,
84 /// Too many links
85 EMLINK = 31,
86 /// Broken pipe
87 EPIPE = 32,
88 /// Math argument out of domain of func
89 EDOM = 33,
90 /// Math result not representable
91 ERANGE = 34,
92
93 // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/errno.h?h=v5.19
94
95 /// No message of desired type
96 ENOMSG = 35,
97 /// Identifier removed
98 EIDRM = 36,
99 /// Channel number out of range
100 ECHRNG = 37,
101 /// Level 2 not synchronized
102 EL2NSYNC = 38,
103 /// Level 3 halted
104 EL3HLT = 39,
105 /// Level 3 reset
106 EL3RST = 40,
107 /// Link number out of range
108 ELNRNG = 41,
109 /// Protocol driver not attached
110 EUNATCH = 42,
111 /// No CSI structure available
112 ENOCSI = 43,
113 /// Level 2 halted
114 EL2HLT = 44,
115 /// Resource deadlock would occur
116 EDEADLK = 45,
117 /// No record locks available
118 ENOLCK = 46,
119 /// Invalid exchange
120 EBADE = 50,
121 /// Invalid request descriptor
122 EBADR = 51,
123 /// Exchange full
124 EXFULL = 52,
125 /// No anode
126 ENOANO = 53,
127 /// Invalid request code
128 EBADRQC = 54,
129 /// Invalid slot
130 EBADSLT = 55,
131 /// File locking deadlock error
132 EDEADLOCK = 56,
133 /// Bad font file format
134 EBFONT = 59,
135 /// Device not a stream
136 ENOSTR = 60,
137 /// No data available
138 ENODATA = 61,
139 /// Timer expired
140 ETIME = 62,
141 /// Out of streams resources
142 ENOSR = 63,
143 /// Machine is not on the network
144 ENONET = 64,
145 /// Package not installed
146 ENOPKG = 65,
147 /// Object is remote
148 EREMOTE = 66,
149 /// Link has been severed
150 ENOLINK = 67,
151 /// Advertise error
152 EADV = 68,
153 /// Srmount error
154 ESRMNT = 69,
155 /// Communication error on send
156 ECOMM = 70,
157 /// Protocol error
158 EPROTO = 71,
159 /// RFS specific error
160 EDOTDOT = 73,
161 /// Multihop attempted
162 EMULTIHOP = 74,
163 /// Not a data message
164 EBADMSG = 77,
165 /// File name too long
166 ENAMETOOLONG = 78,
167 /// Value too large for defined data type
168 EOVERFLOW = 79,
169 /// Name not unique on network
170 ENOTUNIQ = 80,
171 /// File descriptor in bad state
172 EBADFD = 81,
173 /// Remote address changed
174 EREMCHG = 82,
175 /// Can not access a needed shared library
176 ELIBACC = 83,
177 /// Accessing a corrupted shared library
178 ELIBBAD = 84,
179 /// .lib section in a.out corrupted
180 ELIBSCN = 85,
181 /// Attempting to link in too many shared libraries
182 ELIBMAX = 86,
183 /// Cannot exec a shared library directly
184 ELIBEXEC = 87,
185 /// Illegal byte sequence
186 EILSEQ = 88,
187 /// Function not implemented
188 ENOSYS = 89,
189 /// Too many symbolic links encountered
190 ELOOP = 90,
191 /// Interrupted system call should be restarted
192 ERESTART = 91,
193 /// Streams pipe error
194 ESTRPIPE = 92,
195 /// Directory not empty
196 ENOTEMPTY = 93,
197 /// Too many users
198 EUSERS = 94,
199 /// Socket operation on non-socket
200 ENOTSOCK = 95,
201 /// Destination address required
202 EDESTADDRREQ = 96,
203 /// Message too long
204 EMSGSIZE = 97,
205 /// Protocol wrong type for socket
206 EPROTOTYPE = 98,
207 /// Protocol not available
208 ENOPROTOOPT = 99,
209 /// Protocol not supported
210 EPROTONOSUPPORT = 120,
211 /// Socket type not supported
212 ESOCKTNOSUPPORT = 121,
213 /// Operation not supported on transport endpoint
214 EOPNOTSUPP = 122,
215 /// Protocol family not supported
216 EPFNOSUPPORT = 123,
217 /// Address family not supported by protocol
218 EAFNOSUPPORT = 124,
219 /// Address already in use
220 EADDRINUSE = 125,
221 /// Cannot assign requested address
222 EADDRNOTAVAIL = 126,
223 /// Network is down
224 ENETDOWN = 127,
225 /// Network is unreachable
226 ENETUNREACH = 128,
227 /// Network dropped connection because of reset
228 ENETRESET = 129,
229 /// Software caused connection abort
230 ECONNABORTED = 130,
231 /// Connection reset by peer
232 ECONNRESET = 131,
233 /// No buffer space available
234 ENOBUFS = 132,
235 /// Transport endpoint is already connected
236 EISCONN = 133,
237 /// Transport endpoint is not connected
238 ENOTCONN = 134,
239 /// Structure needs cleaning
240 EUCLEAN = 135,
241 /// Not a XENIX named type file
242 ENOTNAM = 137,
243 /// No XENIX semaphores available
244 ENAVAIL = 138,
245 /// Is a named type file
246 EISNAM = 139,
247 /// Remote I/O error
248 EREMOTEIO = 140,
249 /// Reserved
250 EINIT = 141,
251 /// Error 142
252 EREMDEV = 142,
253 /// Cannot send after transport endpoint shutdown
254 ESHUTDOWN = 143,
255 /// Too many references: cannot splice
256 ETOOMANYREFS = 144,
257 /// Connection timed out
258 ETIMEDOUT = 145,
259 /// Connection refused
260 ECONNREFUSED = 146,
261 /// Host is down
262 EHOSTDOWN = 147,
263 /// No route to host
264 EHOSTUNREACH = 148,
265 /// Operation already in progress
266 EALREADY = 149,
267 /// Operation now in progress
268 EINPROGRESS = 150,
269 /// Stale file handle
270 ESTALE = 151,
271 /// AIO operation canceled
272 ECANCELED = 158,
273 /// No medium found
274 ENOMEDIUM = 159,
275 /// Wrong medium type
276 EMEDIUMTYPE = 160,
277 /// Required key not available
278 ENOKEY = 161,
279 /// Key has expired
280 EKEYEXPIRED = 162,
281 /// Key has been revoked
282 EKEYREVOKED = 163,
283 /// Key was rejected by service
284 EKEYREJECTED = 164,
285 /// Owner died
286 EOWNERDEAD = 165,
287 /// State not recoverable
288 ENOTRECOVERABLE = 166,
289 /// Operation not possible due to RF-kill
290 ERFKILL = 167,
291 /// Memory page has hardware error
292 EHWPOISON = 168,
293 /// Quota exceeded
294 EDQUOT = 1133,
295}
296
297/// Operation would block (alias for [EAGAIN])
298pub const EWOULDBLOCK: crate::Error = EAGAIN;