linux_errno/linux-errno_sparc.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/sparc/include/uapi/asm/errno.h?h=v5.19
94
95 /// Operation now in progress
96 EINPROGRESS = 36,
97 /// Operation already in progress
98 EALREADY = 37,
99 /// Socket operation on non-socket
100 ENOTSOCK = 38,
101 /// Destination address required
102 EDESTADDRREQ = 39,
103
104 /// Message too long
105 EMSGSIZE = 40,
106 /// Protocol wrong type for socket
107 EPROTOTYPE = 41,
108 /// Protocol not available
109 ENOPROTOOPT = 42,
110 /// Protocol not supported
111 EPROTONOSUPPORT = 43,
112 /// Socket type not supported
113 ESOCKTNOSUPPORT = 44,
114 /// Op not supported on transport endpoint
115 EOPNOTSUPP = 45,
116 /// Protocol family not supported
117 EPFNOSUPPORT = 46,
118 /// Address family not supported by protocol
119 EAFNOSUPPORT = 47,
120 /// Address already in use
121 EADDRINUSE = 48,
122 /// Cannot assign requested address
123 EADDRNOTAVAIL = 49,
124
125 /// Network is down
126 ENETDOWN = 50,
127 /// Network is unreachable
128 ENETUNREACH = 51,
129 /// Net dropped connection because of reset
130 ENETRESET = 52,
131 /// Software caused connection abort
132 ECONNABORTED = 53,
133 /// Connection reset by peer
134 ECONNRESET = 54,
135 /// No buffer space available
136 ENOBUFS = 55,
137 /// Transport endpoint is already connected
138 EISCONN = 56,
139 /// Transport endpoint is not connected
140 ENOTCONN = 57,
141 /// No send after transport endpoint shutdown
142 ESHUTDOWN = 58,
143 /// Too many references: cannot splice
144 ETOOMANYREFS = 59,
145
146 /// Connection timed out
147 ETIMEDOUT = 60,
148 /// Connection refused
149 ECONNREFUSED = 61,
150 /// Too many symbolic links encountered
151 ELOOP = 62,
152 /// File name too long
153 ENAMETOOLONG = 63,
154 /// Host is down
155 EHOSTDOWN = 64,
156 /// No route to host
157 EHOSTUNREACH = 65,
158 /// Directory not empty
159 ENOTEMPTY = 66,
160 /// SUNOS: Too many processes
161 EPROCLIM = 67,
162 /// Too many users
163 EUSERS = 68,
164 /// Quota exceeded
165 EDQUOT = 69,
166
167 /// Stale file handle
168 ESTALE = 70,
169 /// Object is remote
170 EREMOTE = 71,
171 /// Device not a stream
172 ENOSTR = 72,
173 /// Timer expired
174 ETIME = 73,
175 /// Out of streams resources
176 ENOSR = 74,
177 /// No message of desired type
178 ENOMSG = 75,
179 /// Not a data message
180 EBADMSG = 76,
181 /// Identifier removed
182 EIDRM = 77,
183 /// Resource deadlock would occur
184 EDEADLK = 78,
185 /// No record locks available
186 ENOLCK = 79,
187
188 /// Machine is not on the network
189 ENONET = 80,
190 /// SunOS: Too many lvls of remote in path
191 ERREMOTE = 81,
192 /// Link has been severed
193 ENOLINK = 82,
194 /// Advertise error
195 EADV = 83,
196 /// Srmount error
197 ESRMNT = 84,
198 /// Communication error on send
199 ECOMM = 85,
200 /// Protocol error
201 EPROTO = 86,
202 /// Multihop attempted
203 EMULTIHOP = 87,
204 /// RFS specific error
205 EDOTDOT = 88,
206 /// Remote address changed
207 EREMCHG = 89,
208
209 /// Function not implemented
210 ENOSYS = 90,
211 /// Streams pipe error
212 ESTRPIPE = 91,
213 /// Value too large for defined data type
214 EOVERFLOW = 92,
215 /// File descriptor in bad state
216 EBADFD = 93,
217 /// Channel number out of range
218 ECHRNG = 94,
219 /// Level 2 not synchronized
220 EL2NSYNC = 95,
221 /// Level 3 halted
222 EL3HLT = 96,
223 /// Level 3 reset
224 EL3RST = 97,
225 /// Link number out of range
226 ELNRNG = 98,
227 /// Protocol driver not attached
228 EUNATCH = 99,
229
230 /// No CSI structure available
231 ENOCSI = 100,
232 /// Level 2 halted
233 EL2HLT = 101,
234 /// Invalid exchange
235 EBADE = 102,
236 /// Invalid request descriptor
237 EBADR = 103,
238 /// Exchange full
239 EXFULL = 104,
240 /// No anode
241 ENOANO = 105,
242 /// Invalid request code
243 EBADRQC = 106,
244 /// Invalid slot
245 EBADSLT = 107,
246 /// File locking deadlock error
247 EDEADLOCK = 108,
248 /// Bad font file format
249 EBFONT = 109,
250
251 /// Cannot exec a shared library directly
252 ELIBEXEC = 110,
253 /// No data available
254 ENODATA = 111,
255 /// Accessing a corrupted shared library
256 ELIBBAD = 112,
257 /// Package not installed
258 ENOPKG = 113,
259 /// Can not access a needed shared library
260 ELIBACC = 114,
261 /// Name not unique on network
262 ENOTUNIQ = 115,
263 /// Interrupted syscall should be restarted
264 ERESTART = 116,
265 /// Structure needs cleaning
266 EUCLEAN = 117,
267 /// Not a XENIX named type file
268 ENOTNAM = 118,
269 /// No XENIX semaphores available
270 ENAVAIL = 119,
271
272 /// Is a named type file
273 EISNAM = 120,
274 /// Remote I/O error
275 EREMOTEIO = 121,
276 /// Illegal byte sequence
277 EILSEQ = 122,
278 /// Attempt to link in too many shared libs
279 ELIBMAX = 123,
280 /// .lib section in a.out corrupted
281 ELIBSCN = 124,
282 /// No medium found
283 ENOMEDIUM = 125,
284 /// Wrong medium type
285 EMEDIUMTYPE = 126,
286 /// Operation Cancelled
287 ECANCELED = 127,
288 /// Required key not available
289 ENOKEY = 128,
290 /// Key has expired
291 EKEYEXPIRED = 129,
292
293 /// Key has been revoked
294 EKEYREVOKED = 130,
295 /// Key was rejected by service
296 EKEYREJECTED = 131,
297 /// Owner died
298 EOWNERDEAD = 132,
299 /// State not recoverable
300 ENOTRECOVERABLE = 133,
301 /// Operation not possible due to RF-kill
302 ERFKILL = 134,
303 /// Memory page has hardware error
304 EHWPOISON = 135,
305}
306
307/// Operation would block (alias for [EAGAIN])
308pub const EWOULDBLOCK: crate::Error = EAGAIN;