From d9c2ac9d5e90d95957a6378974fa07bf8818bf30 Mon Sep 17 00:00:00 2001 From: Wedson Almeida Filho Date: Sat, 20 Mar 2021 21:56:17 +0000 Subject: [PATCH] Add errors used in binder. --- rust/kernel/error.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index a30786ec55d7da..68117e557e863d 100644 --- a/rust/kernel/error.rs +++ b/rust/kernel/error.rs @@ -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)