devela/sys/os/linux/consts/errno.rs
1// devela::sys::os::linux::consts::errno
2//
3//! `errno.h` constants.
4//
5
6/// Linux `sys/errno.h` constants.
7#[allow(non_camel_case_types)]
8pub struct LINUX_ERRNO;
9
10#[allow(missing_docs)]
11impl LINUX_ERRNO {
12 /// “Operation not permitted.”
13 ///
14 /// Only the owner of the file (or other resource) or processes with special
15 /// privileges can perform the operation.
16 pub const EPERM: isize = 1;
17
18 /// “No such file or directory.”
19 ///
20 /// This is a “file doesn’t exist” error for ordinary files that are referenced
21 /// in contexts where they are expected to already exist.
22 pub const ENOENT: isize = 2;
23
24 /// “No such process.”
25 ///
26 /// No process matches the specified process ID.
27 pub const ESRCH: isize = 3;
28
29 /// “Interrupted system call.”
30 ///
31 /// An asynchronous signal occurred and prevented completion of the call. When
32 /// this happens, you should try the call again.
33 ///
34 /// You can choose to have functions resume after a signal that is handled,
35 /// rather than failing with `EINTR`.
36 pub const EINTR: isize = 4;
37
38 /// “Input/output error.”
39 ///
40 /// Usually used for physical read or write errors.
41 pub const EIO: isize = 5;
42
43 /// “No such device or address.”
44 ///
45 /// The system tried to use the device represented by a file you specified, and
46 /// it couldn’t find the device. This can mean that the device file was
47 /// installed incorrectly, or that the physical device is missing or not
48 /// correctly attached to the computer.
49 pub const ENXIO: isize = 6;
50
51 /// “Argument list too long.”
52 ///
53 /// Used when the arguments passed to a new program being executed with one of
54 /// the exec functions (see Executing a File) occupy too much memory space. This
55 /// condition never arises on GNU/Hurd systems.
56 pub const E2BIG: isize = 7;
57
58 /// “Exec format error.”
59 ///
60 /// Invalid executable file format. This condition is detected by the exec functions.
61 pub const ENOEXEC: isize = 8;
62
63 /// “Bad file descriptor.”
64 ///
65 /// For example, I/O on a descriptor that has been closed or reading from a
66 /// descriptor open only for writing (or vice versa).
67 pub const EBADF: isize = 9;
68
69 /// “No child processes.”
70 ///
71 /// This error happens on operations that are supposed to manipulate child
72 /// processes, when there aren’t any processes to manipulate.
73 pub const ECHILD: isize = 10;
74
75 /// “Resource temporarily unavailable.”
76 ///
77 /// The call might work if you try again later. The constant
78 /// [`EWOULDBLOCK`][Self::EWOULDBLOCK] is another name for `EAGAIN`.
79 pub const EAGAIN: isize = 11;
80
81 /// “Cannot allocate memory.”
82 ///
83 /// The system cannot allocate more virtual memory because its capacity is full.
84 pub const ENOMEM: isize = 12;
85
86 /// “Permission denied.”
87 ///
88 /// The file permissions do not allow the attempted operation.
89 pub const EACCES: isize = 13;
90
91 /// “Bad address.”
92 ///
93 /// An invalid pointer was detected. On GNU/Hurd systems, this error never
94 /// happens; you get a signal instead.
95 pub const EFAULT: isize = 14;
96
97 /// “Block device required.”
98 ///
99 /// A file that isn’t a block special file was given in a situation that
100 /// requires one. For example, trying to mount an ordinary file as a file system
101 /// in Unix gives this error.
102 pub const ENOTBLK: isize = 15;
103
104 /// “Device or resource busy.”
105 ///
106 /// A system resource that can’t be shared is already in use. For example, if
107 /// you try to delete a file that is the root of a currently mounted filesystem,
108 /// you get this error.
109 pub const EBUSY: isize = 16;
110
111 /// “File exists.”
112 ///
113 /// An existing file was specified in a context where it only makes sense to
114 /// specify a new file.
115 pub const EEXIST: isize = 17;
116
117 /// “Invalid cross-device link.”
118 ///
119 /// An attempt to make an improper link across file systems was detected. This
120 /// happens not only when you use link (see Hard Links) but also when you rename
121 /// a file with rename (see Renaming Files).
122 pub const EXDEV: isize = 18;
123
124 /// “No such device.”
125 ///
126 /// The wrong type of device was given to a function that expects a particular
127 /// sort of device.
128 pub const ENODEV: isize = 19;
129
130 /// “Not a directory.”
131 ///
132 /// A file that isn’t a directory was specified when a directory is required.
133 pub const ENOTDIR: isize = 20;
134
135 /// “Is a directory.”
136 ///
137 /// You cannot open a directory for writing, or create or remove hard links to it.
138 pub const EISDIR: isize = 21;
139
140 /// “Invalid argument.”
141 ///
142 /// This is used to indicate various kinds of problems with passing the wrong
143 /// argument to a library function.
144 pub const EINVAL: isize = 22;
145
146 /// “Too many open files in system.”
147 ///
148 /// There are too many distinct file openings in the entire system. Note that
149 /// any number of linked channels count as just one file opening; see Linked
150 /// Channels. This error never occurs on GNU/Hurd systems.
151 pub const ENFILE: isize = 23;
152
153 /// “Too many open files.”
154 ///
155 /// The current process has too many files open and can’t open any more.
156 /// Duplicate descriptors do count toward this limit.
157 pub const EMFILE: isize = 24;
158
159 /// “Inappropriate ioctl for device.”
160 ///
161 /// Inappropriate I/O control operation, such as trying to set terminal modes on
162 /// an ordinary file.
163 pub const ENOTTY: isize = 25;
164
165 /// “Text file busy.”
166 ///
167 /// An attempt to execute a file that is currently open for writing, or write to
168 /// a file that is currently being executed. Often using a debugger to run a
169 /// program is considered having it open for writing and will cause this error.
170 /// (The name stands for “text file busy”.) This is not an error on GNU/Hurd
171 /// systems; the text is copied as necessary.
172 pub const ETXTBSY: isize = 26;
173
174 /// “File too large.”
175 ///
176 /// The size of a file would be larger than allowed by the system.
177 pub const EFBIG: isize = 27;
178
179 /// “No space left on device.”
180 ///
181 /// Write operation on a file failed because the disk is full.
182 pub const ENOSPC: isize = 28;
183
184 /// “Illegal seek.”
185 ///
186 /// Invalid seek operation (such as on a pipe).
187 pub const ESPIPE: isize = 29;
188
189 /// “Read-only file system.”
190 ///
191 /// An attempt was made to modify something on a read-only file system.
192 pub const EROFS: isize = 30;
193
194 /// “Too many links.”
195 ///
196 /// The link count of a single file would become too large. rename can cause
197 /// this error if the file being renamed already has as many links as it can take.
198 pub const EMLINK: isize = 31;
199
200 /// “Broken pipe.”
201 ///
202 /// There is no process reading from the other end of a pipe. Every library
203 /// function that returns this error code also generates a `SIGPIPE` signal; this
204 /// signal terminates the program if not handled or blocked. Thus, your program
205 /// will never actually see `EPIPE` unless it has handled or blocked `SIGPIPE`.
206 pub const EPIPE: isize = 32;
207
208 /// “Numerical argument out of domain.”
209 ///
210 /// Used by mathematical functions when an argument value does not fall into the
211 /// domain over which the function is defined.
212 pub const EDOM: isize = 33;
213
214 /// “Numerical result out of range.”
215 ///
216 /// Used by mathematical functions when the result value is not representable
217 /// because of overflow or underflow.
218 pub const ERANGE: isize = 34;
219
220 /// “Operation would block.”
221 ///
222 /// In the GNU C Library, this is another name for [`EAGAIN`][Self::EAGAIN].
223 /// The values are always the same, on every operating system.
224 ///
225 /// C libraries in many older Unix systems have EWOULDBLOCK as a separate error code.
226 pub const EWOULDBLOCK: isize = Self::EAGAIN;
227
228 pub const EDEADLK: isize = 35;
229 pub const ENAMETOOLONG: isize = 36;
230 pub const ENOLCK: isize = 37;
231 pub const ENOSYS: isize = 38;
232 pub const ENOTEMPTY: isize = 39;
233 pub const ELOOP: isize = 40;
234 pub const ENOMSG: isize = 42;
235 pub const EIDRM: isize = 43;
236 pub const ECHRNG: isize = 44;
237 pub const EL2NSYNC: isize = 45;
238 pub const EL3HLT: isize = 46;
239 pub const EL3RST: isize = 47;
240 pub const ELNRNG: isize = 48;
241 pub const EUNATCH: isize = 49;
242 pub const ENOCSI: isize = 50;
243 pub const EL2HLT: isize = 51;
244 pub const EBADE: isize = 52;
245 pub const EBADR: isize = 53;
246 pub const EXFULL: isize = 54;
247 pub const ENOANO: isize = 55;
248 pub const EBADRQC: isize = 56;
249 pub const EBADSLT: isize = 57;
250 pub const EMULTIHOP: isize = 72;
251 pub const EOVERFLOW: isize = 75;
252 pub const ENOTUNIQ: isize = 76;
253 pub const EBADFD: isize = 77;
254 pub const EBADMSG: isize = 74;
255 pub const EREMCHG: isize = 78;
256 pub const ELIBACC: isize = 79;
257 pub const ELIBBAD: isize = 80;
258 pub const ELIBSCN: isize = 81;
259 pub const ELIBMAX: isize = 82;
260 pub const ELIBEXEC: isize = 83;
261 pub const EILSEQ: isize = 84;
262 pub const ERESTART: isize = 85;
263 pub const ESTRPIPE: isize = 86;
264 pub const EUSERS: isize = 87;
265 pub const ENOTSOCK: isize = 88;
266 pub const EDESTADDRREQ: isize = 89;
267 pub const EMSGSIZE: isize = 90;
268 pub const EPROTOTYPE: isize = 91;
269 pub const ENOPROTOOPT: isize = 92;
270 pub const EPROTONOSUPPORT: isize = 93;
271 pub const ESOCKTNOSUPPORT: isize = 94;
272 pub const EOPNOTSUPP: isize = 95;
273 pub const EPFNOSUPPORT: isize = 96;
274 pub const EAFNOSUPPORT: isize = 97;
275 pub const EADDRINUSE: isize = 98;
276 pub const EADDRNOTAVAIL: isize = 99;
277 pub const ENETDOWN: isize = 100;
278 pub const ENETUNREACH: isize = 101;
279 pub const ENETRESET: isize = 102;
280 pub const ECONNABORTED: isize = 103;
281 pub const ECONNRESET: isize = 104;
282 pub const ENOBUFS: isize = 105;
283 pub const EISCONN: isize = 106;
284 pub const ENOTCONN: isize = 107;
285 pub const ESHUTDOWN: isize = 108;
286 pub const ETOOMANYREFS: isize = 109;
287 pub const ETIMEDOUT: isize = 110;
288 pub const ECONNREFUSED: isize = 111;
289 pub const EHOSTDOWN: isize = 112;
290 pub const EHOSTUNREACH: isize = 113;
291 pub const EALREADY: isize = 114;
292 pub const EINPROGRESS: isize = 115;
293 pub const ESTALE: isize = 116;
294 pub const EDQUOT: isize = 122;
295 pub const ENOMEDIUM: isize = 123;
296 pub const EMEDIUMTYPE: isize = 124;
297 pub const ECANCELED: isize = 125;
298 pub const ENOKEY: isize = 126;
299 pub const EKEYEXPIRED: isize = 127;
300 pub const EKEYREVOKED: isize = 128;
301 pub const EKEYREJECTED: isize = 129;
302 pub const EOWNERDEAD: isize = 130;
303 pub const ENOTRECOVERABLE: isize = 131;
304 pub const EHWPOISON: isize = 133;
305 pub const ERFKILL: isize = 132;
306}