mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-01-30 09:01:44 -05:00
Merge pull request #81 from arihant2math/mutex-timeouts
This commit is contained in:
@@ -168,6 +168,9 @@ pub enum KernelError {
|
||||
#[error("No such process")]
|
||||
NoProcess,
|
||||
|
||||
#[error("Operation timed out")]
|
||||
TimedOut,
|
||||
|
||||
#[error("{0}")]
|
||||
Other(&'static str),
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ pub const EDOM: isize = -33;
|
||||
pub const ERANGE: isize = -34;
|
||||
pub const EWOULDBLOCK: isize = -EAGAIN;
|
||||
pub const ENOSYS: isize = -38;
|
||||
pub const ETIMEDOUT: isize = -110;
|
||||
|
||||
pub fn kern_err_to_syscall(err: KernelError) -> isize {
|
||||
match err {
|
||||
@@ -51,6 +52,7 @@ pub fn kern_err_to_syscall(err: KernelError) -> isize {
|
||||
KernelError::SeekPipe => ESPIPE,
|
||||
KernelError::NotSupported => ENOSYS,
|
||||
KernelError::NoMemory => ENOMEM,
|
||||
KernelError::TimedOut => ETIMEDOUT,
|
||||
e => todo!("{e}"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user