mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-05-24 08:55:20 -04:00
address review
This commit is contained in:
@@ -121,6 +121,10 @@ pub enum FsError {
|
||||
#[error("The directory is not empty.")]
|
||||
DirectoryNotEmpty,
|
||||
|
||||
/// The device or resource is busy.
|
||||
#[error("The device or resource is busy.")]
|
||||
Busy,
|
||||
|
||||
/// Invalid input parameters.
|
||||
#[error("Invalid input parameters.")]
|
||||
InvalidInput,
|
||||
|
||||
@@ -44,6 +44,7 @@ pub const ERANGE: isize = -34;
|
||||
pub const EWOULDBLOCK: isize = -EAGAIN;
|
||||
pub const ENAMETOOLONG: isize = -36;
|
||||
pub const ENOSYS: isize = -38;
|
||||
pub const ENOTEMPTY: isize = -39;
|
||||
pub const ELOOP: isize = -40;
|
||||
pub const EAFNOSUPPORT: isize = -97;
|
||||
pub const EOPNOTSUPP: isize = -95;
|
||||
@@ -63,7 +64,10 @@ pub fn kern_err_to_syscall(err: KernelError) -> isize {
|
||||
KernelError::Fs(FsError::IsADirectory) => EISDIR,
|
||||
KernelError::Fs(FsError::NotADirectory) => ENOTDIR,
|
||||
KernelError::Fs(FsError::AlreadyExists) => EEXIST,
|
||||
KernelError::Fs(FsError::DirectoryNotEmpty) => ENOTEMPTY,
|
||||
KernelError::Fs(FsError::Busy) => EBUSY,
|
||||
KernelError::Fs(FsError::InvalidInput) => EINVAL, // TODO: Is this right?
|
||||
KernelError::InUse => EBUSY,
|
||||
KernelError::Fs(FsError::PermissionDenied) => EACCES,
|
||||
KernelError::Fs(FsError::TooManyFiles) => EMFILE,
|
||||
KernelError::Fs(FsError::NoDevice) => ENODEV,
|
||||
|
||||
Reference in New Issue
Block a user