Skip to main content

xwrust/
errno.rs

1//! XWOS RUST:错误码
2//! ========
3//!
4
5use crate::types::XwEr;
6
7////////////////////////////////////////////////////////////////
8// libc errno.h 中定义的错误码
9////////////////////////////////////////////////////////////////
10/// Operation not permitted
11pub const EPERM: XwEr = 1;
12/// No such file or directory
13pub const ENOENT: XwEr = 2;
14/// No such process
15pub const ESRCH: XwEr = 3;
16/// Interrupted system call
17pub const EINTR: XwEr = 4;
18/// I/O error
19pub const EIO: XwEr = 5;
20/// No such device or address
21pub const ENXIO: XwEr = 6;
22/// Arg list too long
23pub const E2BIG: XwEr = 7;
24/// Exec format error
25pub const ENOEXEC: XwEr = 8;
26/// Bad file number
27pub const EBADF: XwEr = 9;
28/// No children
29pub const ECHILD: XwEr = 10;
30/// No more processes
31pub const EAGAIN: XwEr = 11;
32/// Not enough space
33pub const ENOMEM: XwEr = 12;
34/// Permission denied
35pub const EACCES: XwEr = 13;
36/// Bad address
37pub const EFAULT: XwEr = 14;
38/// Block device required
39pub const ENOTBLK: XwEr = 15;
40/// Device or resource busy
41pub const EBUSY: XwEr = 16;
42/// File exists
43pub const EEXIST: XwEr = 17;
44/// Cross-device link
45pub const EXDEV: XwEr = 18;
46/// No such device
47pub const ENODEV: XwEr = 19;
48/// Not a directory
49pub const ENOTDIR: XwEr = 20;
50/// Is a directory
51pub const EISDIR: XwEr = 21;
52/// Invalid argument
53pub const EINVAL: XwEr = 22;
54/// Too many open files in system
55pub const ENFILE: XwEr = 23;
56/// File descriptor value too large
57pub const EMFILE: XwEr = 24;
58/// Not a character device
59pub const ENOTTY: XwEr = 25;
60/// Text file busy
61pub const ETXTBSY: XwEr = 26;
62/// File too large
63pub const EFBIG: XwEr = 27;
64/// No space left on device
65pub const ENOSPC: XwEr = 28;
66/// Illegal seek
67pub const ESPIPE: XwEr = 29;
68/// Read-only file system
69pub const EROFS: XwEr = 30;
70/// Too many links
71pub const EMLINK: XwEr = 31;
72/// Broken pipe
73pub const EPIPE: XwEr = 32;
74/// Mathematics argument out of domain of function
75pub const EDOM: XwEr = 33;
76/// Result too large
77pub const ERANGE: XwEr = 34;
78/// No message of desired type
79pub const ENOMSG: XwEr = 35;
80/// Identifier removed
81pub const EIDRM: XwEr = 36;
82/// Channel number out of range
83pub const ECHRNG: XwEr = 37;
84/// Level 2 not synchronized
85pub const EL2NSYNC: XwEr = 38;
86/// Level 3 halted
87pub const EL3HLT: XwEr = 39;
88/// Level 3 reset
89pub const EL3RST: XwEr = 40;
90/// Link number out of range
91pub const ELNRNG: XwEr = 41;
92/// Protocol driver not attached
93pub const EUNATCH: XwEr = 42;
94/// No CSI structure available
95pub const ENOCSI: XwEr = 43;
96/// Level 2 halted
97pub const EL2HLT: XwEr = 44;
98/// Deadlock
99pub const EDEADLK: XwEr = 45;
100/// No lock
101pub const ENOLCK: XwEr = 46;
102/// Invalid exchange
103pub const EBADE: XwEr = 50;
104/// Invalid request descriptor
105pub const EBADR: XwEr = 51;
106/// Exchange full
107pub const EXFULL: XwEr = 52;
108/// No anode
109pub const ENOANO: XwEr = 53;
110/// Invalid request code
111pub const EBADRQC: XwEr = 54;
112/// Invalid slot
113pub const EBADSLT: XwEr = 55;
114/// File locking deadlock error
115pub const EDEADLOCK: XwEr = 56;
116/// Bad font file fmt
117pub const EBFONT: XwEr = 57;
118/// Not a stream
119pub const ENOSTR: XwEr = 60;
120/// No data (for no delay io)
121pub const ENODATA: XwEr = 61;
122/// Stream ioctl timeout
123pub const ETIME: XwEr = 62;
124/// No stream resources
125pub const ENOSR: XwEr = 63;
126/// Machine is not on the network
127pub const ENONET: XwEr = 64;
128/// Package not installed
129pub const ENOPKG: XwEr = 65;
130/// The object is remote
131pub const EREMOTE: XwEr = 66;
132/// Virtual circuit is gone
133pub const ENOLINK: XwEr = 67;
134/// Advertise error
135pub const EADV: XwEr = 68;
136/// Srmount error
137pub const ESRMNT: XwEr = 69;
138/// Communication error on send
139pub const ECOMM: XwEr = 70;
140/// Protocol error
141pub const EPROTO: XwEr = 71;
142/// Multihop attempted
143pub const EMULTIHOP: XwEr = 74;
144/// Inode is remote (not really error)
145pub const ELBIN: XwEr = 75;
146/// Cross mount point (not really error)
147pub const EDOTDOT: XwEr = 76;
148/// Bad message
149pub const EBADMSG: XwEr = 77;
150/// Inappropriate file type or format
151pub const EFTYPE: XwEr = 79;
152/// Given log. name not unique
153pub const ENOTUNIQ: XwEr = 80;
154/// f.d. invalid for this operation
155pub const EBADFD: XwEr = 81;
156/// Remote address changed
157pub const EREMCHG: XwEr = 82;
158/// Can't access a needed shared lib
159pub const ELIBACC: XwEr = 83;
160/// Accessing a corrupted shared lib
161pub const ELIBBAD: XwEr = 84;
162/// .lib section in a.out corrupted
163pub const ELIBSCN: XwEr = 85;
164/// Attempting to link in too many libs
165pub const ELIBMAX: XwEr = 86;
166/// Attempting to exec a shared library
167pub const ELIBEXEC: XwEr = 87;
168/// Function not implemented
169pub const ENOSYS: XwEr = 88;
170/// No more files
171pub const ENMFILE: XwEr = 89;
172/// Directory not empty
173pub const ENOTEMPTY: XwEr = 90;
174/// File or path name too long
175pub const ENAMETOOLONG: XwEr = 91;
176/// Too many symbolic links
177pub const ELOOP: XwEr = 92;
178/// Operation not supported on socket
179pub const EOPNOTSUPP: XwEr = 95;
180/// Protocol family not supported
181pub const EPFNOSUPPORT: XwEr = 96;
182/// Connection reset by peer
183pub const ECONNRESET: XwEr = 104;
184/// No buffer space available
185pub const ENOBUFS: XwEr = 105;
186/// Address family not supported by protocol family
187pub const EAFNOSUPPORT: XwEr = 106;
188/// Protocol wrong type for socket
189pub const EPROTOTYPE: XwEr = 107;
190/// Socket operation on non-socket
191pub const ENOTSOCK: XwEr = 108;
192/// Protocol not available
193pub const ENOPROTOOPT: XwEr = 109;
194/// Can't send after socket shutdown
195pub const ESHUTDOWN: XwEr = 110;
196/// Connection refused
197pub const ECONNREFUSED: XwEr = 111;
198/// Address already in use
199pub const EADDRINUSE: XwEr = 112;
200/// Software caused connection abort
201pub const ECONNABORTED: XwEr = 113;
202/// Network is unreachable
203pub const ENETUNREACH: XwEr = 114;
204/// Network interface is not configured
205pub const ENETDOWN: XwEr = 115;
206/// Connection timed out
207pub const ETIMEDOUT: XwEr = 116;
208/// Host is down
209pub const EHOSTDOWN: XwEr = 117;
210/// Host is unreachable
211pub const EHOSTUNREACH: XwEr = 118;
212/// Connection already in progress
213pub const EINPROGRESS: XwEr = 119;
214/// Socket already connected
215pub const EALREADY: XwEr = 120;
216/// Destination address required
217pub const EDESTADDRREQ: XwEr = 121;
218/// Message too long
219pub const EMSGSIZE: XwEr = 122;
220/// Unknown protocol
221pub const EPROTONOSUPPORT: XwEr = 123;
222/// Socket type not supported
223pub const ESOCKTNOSUPPORT: XwEr = 124;
224/// Address not available
225pub const EADDRNOTAVAIL: XwEr = 125;
226/// Connection aborted by network
227pub const ENETRESET: XwEr = 126;
228/// Socket is already connected
229pub const EISCONN: XwEr = 127;
230/// Socket is not connected
231pub const ENOTCONN: XwEr = 128;
232/// Too many references: cannot splice
233pub const ETOOMANYREFS: XwEr = 129;
234pub const EPROCLIM: XwEr = 130;
235/// Too many users
236pub const EUSERS: XwEr = 131;
237/// Disk quota exceeded (POSIX.1-2001)
238pub const EDQUOT: XwEr = 132;
239/// Stale file handle (POSIX.1-2001).
240pub const ESTALE: XwEr = 133;
241/// Not supported
242pub const ENOTSUP: XwEr = 134;
243/// No medium (in tape drive)
244pub const ENOMEDIUM: XwEr = 135;
245/// No such host or network path
246pub const ENOSHARE: XwEr = 136;
247/// Filename exists with different case
248pub const ECASECLASH: XwEr = 137;
249/// Illegal byte sequence
250pub const EILSEQ: XwEr = 138;
251/// Value too large for defined data type
252pub const EOVERFLOW: XwEr = 139;
253/// Operation canceled
254pub const ECANCELED: XwEr = 140;
255/// State not recoverable
256pub const ENOTRECOVERABLE: XwEr = 141;
257/// Previous owner died
258pub const EOWNERDEAD: XwEr = 142;
259/// Streams pipe error
260pub const ESTRPIPE: XwEr = 143;
261/// Operation would block
262pub const EWOULDBLOCK: XwEr = EAGAIN;
263
264////////////////////////////////////////////////////////////////
265// Linux 扩展的错误码
266////////////////////////////////////////////////////////////////
267/// restart syscall..
268pub const ERESTARTSYS: XwEr = 512;
269pub const ERESTARTNOINTR: XwEr = 513;
270/// restart if no handler..
271pub const ERESTARTNOHAND: XwEr = 514;
272/// No ioctl command
273pub const ENOIOCTLCMD: XwEr = 515;
274/// restart by calling sys_restart_syscall
275pub const ERESTART_RESTARTBLOCK: XwEr = 516;
276/// Driver requests probe retry
277pub const EPROBE_DEFER: XwEr = 517;
278/// open found a stale dentry
279pub const EOPENSTALE: XwEr = 518;
280/// Parameter not supported
281pub const ENOPARAM: XwEr = 519;
282/// Illegal NFS file handle
283pub const EBADHANDLE: XwEr = 521;
284/// Update synchronization mismatch
285pub const ENOTSYNC: XwEr = 522;
286/// Cookie is stale
287pub const EBADCOOKIE: XwEr = 523;
288/// Operation is not supported
289pub const ENOTSUPP: XwEr = 524;
290/// Buffer or request is too small
291pub const ETOOSMALL: XwEr = 525;
292/// An untranslatable error occurred
293pub const ESERVERFAULT: XwEr = 526;
294/// Type not supported by server
295pub const EBADTYPE: XwEr = 527;
296/// Request initiated, but will not complete before timeout
297pub const EJUKEBOX: XwEr = 528;
298/// iocb queued, will get completion event
299pub const EIOCBQUEUED: XwEr = 529;
300/// conflict with recalled state
301pub const ERECALLCONFLICT: XwEr = 530;
302
303////////////////////////////////////////////////////////////////
304// XWOS 扩展的错误码
305////////////////////////////////////////////////////////////////
306/// No error
307pub const XWOK: XwEr = 0;
308
309/// Thread context
310pub const ETHDCTX: XwEr = 800;
311/// Not thread context
312pub const ENOTTHDCTX: XwEr = 801;
313/// Bottom half context
314pub const EBHCTX: XwEr = 802;
315/// Not bottom half context
316pub const ENOTBHCTX: XwEr = 803;
317/// ISR context
318pub const EISRCTX: XwEr = 804;
319/// Not ISR context
320pub const ENOTISRCTX: XwEr = 805;
321/// Cannot preemption
322pub const EDISPMPT: XwEr = 806;
323/// Cannot enter BH
324pub const EDISBH: XwEr = 807;
325/// Cannot enter BH
326pub const EDISIRQ: XwEr = 808;
327
328/// Need to exit
329pub const EEXIT: XwEr = 814;
330
331/// Type error
332pub const ETYPE: XwEr = 830;
333/// Empty error
334pub const EEMPTY: XwEr = 831;
335/// Negative state
336pub const ENEGATIVE: XwEr = 832;
337/// Size error
338pub const ESIZE: XwEr = 833;
339/// Too small
340pub const E2SMALL: XwEr = 835;
341/// Not aligned
342pub const EALIGN: XwEr = 836;
343/// Owner error
344pub const EOWNER: XwEr = 837;
345
346/// BUG
347pub const EBUG: XwEr = 860;
348
349/// Nil object descriptor
350pub const ENILOBJD: XwEr = 880;
351/// Object dead
352pub const EOBJDEAD: XwEr = 884;
353/// Object active
354pub const EOBJACTIVE: XwEr = 885;