Skip to content

Commit 26944af

Browse files
committed
rust: add remaining errors to error.rs
Add the remaining errors of include/uapi/asm-generic/errno-base.h to rust/kernel/error.rs. Signed-off-by: Viktor Garske <[email protected]>
1 parent 6c201fd commit 26944af

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

rust/kernel/error.rs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,96 @@ impl Error {
3636
/// Interrupted system call.
3737
pub const EINTR: Self = Error(-(bindings::EINTR as i32));
3838

39+
/// I/O error.
40+
pub const EIO: Self = Error(-(bindings::EIO as i32));
41+
42+
/// No such device or address.
43+
pub const ENXIO: Self = Error(-(bindings::ENXIO as i32));
44+
45+
/// Argument list too long.
46+
pub const E2BIG: Self = Error(-(bindings::E2BIG as i32));
47+
48+
/// Exec format error.
49+
pub const ENOEXEC: Self = Error(-(bindings::ENOEXEC as i32));
50+
3951
/// Bad file number.
4052
pub const EBADF: Self = Error(-(bindings::EBADF as i32));
4153

54+
/// No child processes.
55+
pub const ECHILD: Self = Error(-(bindings::ECHILD as i32));
56+
4257
/// Try again.
4358
pub const EAGAIN: Self = Error(-(bindings::EAGAIN as i32));
4459

4560
/// Out of memory.
4661
pub const ENOMEM: Self = Error(-(bindings::ENOMEM as i32));
4762

63+
/// Permission denied.
64+
pub const EACCES: Self = Error(-(bindings::EACCES as i32));
65+
4866
/// Bad address.
4967
pub const EFAULT: Self = Error(-(bindings::EFAULT as i32));
5068

69+
/// Block device required.
70+
pub const ENOTBLK: Self = Error(-(bindings::ENOTBLK as i32));
71+
5172
/// Device or resource busy.
5273
pub const EBUSY: Self = Error(-(bindings::EBUSY as i32));
5374

75+
/// File exists.
76+
pub const EEXIST: Self = Error(-(bindings::EEXIST as i32));
77+
78+
/// Cross-device link.
79+
pub const EXDEV: Self = Error(-(bindings::EXDEV as i32));
80+
81+
/// No such device.
82+
pub const ENODEV: Self = Error(-(bindings::ENODEV as i32));
83+
84+
/// Not a directory.
85+
pub const ENOTDIR: Self = Error(-(bindings::ENOTDIR as i32));
86+
87+
/// Is a directory.
88+
pub const EISDIR: Self = Error(-(bindings::EISDIR as i32));
89+
5490
/// Invalid argument.
5591
pub const EINVAL: Self = Error(-(bindings::EINVAL as i32));
5692

93+
/// File table overflow.
94+
pub const ENFILE: Self = Error(-(bindings::ENFILE as i32));
95+
96+
/// Too many open files.
97+
pub const EMFILE: Self = Error(-(bindings::EMFILE as i32));
98+
99+
/// Not a typewriter.
100+
pub const ENOTTY: Self = Error(-(bindings::ENOTTY as i32));
101+
102+
/// Text file busy.
103+
pub const ETXTBSY: Self = Error(-(bindings::ETXTBSY as i32));
104+
105+
/// File too large.
106+
pub const EFBIG: Self = Error(-(bindings::EFBIG as i32));
107+
108+
/// No space left on device.
109+
pub const ENOSPC: Self = Error(-(bindings::ENOSPC as i32));
110+
57111
/// Illegal seek.
58112
pub const ESPIPE: Self = Error(-(bindings::ESPIPE as i32));
59113

114+
/// Read-only file system.
115+
pub const EROFS: Self = Error(-(bindings::EROFS as i32));
116+
117+
/// Too many links.
118+
pub const EMLINK: Self = Error(-(bindings::EMLINK as i32));
119+
120+
/// Broken pipe.
121+
pub const EPIPE: Self = Error(-(bindings::EPIPE as i32));
122+
123+
/// Math argument out of domain of func.
124+
pub const EDOM: Self = Error(-(bindings::EDOM as i32));
125+
126+
/// Math result not representable.
127+
pub const ERANGE: Self = Error(-(bindings::ERANGE as i32));
128+
60129
/// Restart the system call.
61130
pub const ERESTARTSYS: Self = Error(-(bindings::ERESTARTSYS as i32));
62131

0 commit comments

Comments
 (0)