Skip to content

Add errors used in binder. #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions rust/kernel/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ impl Error {
/// Try again.
pub const EAGAIN: Self = Error(-(bindings::EAGAIN as i32));

/// Device or resource busy.
pub const EBUSY: Self = Error(-(bindings::EBUSY as i32));

/// Restart the system call.
pub const ERESTARTSYS: Self = Error(-(bindings::ERESTARTSYS as i32));

/// Operation not permitted.
pub const EPERM: Self = Error(-(bindings::EPERM as i32));

/// No such process.
pub const ESRCH: Self = Error(-(bindings::ESRCH as i32));

/// No such file or directory.
pub const ENOENT: Self = Error(-(bindings::ENOENT as i32));

/// Creates an [`Error`] from a kernel error code.
pub fn from_kernel_errno(errno: c_types::c_int) -> Error {
Error(errno)
Expand Down