Merge pull request #81 from arihant2math/mutex-timeouts

This commit is contained in:
Matthew Leach
2025-12-24 08:08:20 +00:00
committed by GitHub
9 changed files with 74 additions and 7 deletions

View File

@@ -168,6 +168,9 @@ pub enum KernelError {
#[error("No such process")]
NoProcess,
#[error("Operation timed out")]
TimedOut,
#[error("{0}")]
Other(&'static str),
}

View File

@@ -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}"),
}
}