os/uapi/
errno.rs

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