Skip to content

Commit e9b9c0e

Browse files
authored
Merge pull request #130 from wedsonaf/errors
Add errors used in binder.
2 parents d58e9d3 + d9c2ac9 commit e9b9c0e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rust/kernel/error.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ impl Error {
3434
/// Try again.
3535
pub const EAGAIN: Self = Error(-(bindings::EAGAIN as i32));
3636

37+
/// Device or resource busy.
38+
pub const EBUSY: Self = Error(-(bindings::EBUSY as i32));
39+
40+
/// Restart the system call.
41+
pub const ERESTARTSYS: Self = Error(-(bindings::ERESTARTSYS as i32));
42+
43+
/// Operation not permitted.
44+
pub const EPERM: Self = Error(-(bindings::EPERM as i32));
45+
46+
/// No such process.
47+
pub const ESRCH: Self = Error(-(bindings::ESRCH as i32));
48+
49+
/// No such file or directory.
50+
pub const ENOENT: Self = Error(-(bindings::ENOENT as i32));
51+
3752
/// Creates an [`Error`] from a kernel error code.
3853
pub fn from_kernel_errno(errno: c_types::c_int) -> Error {
3954
Error(errno)

0 commit comments

Comments
 (0)