Skip to content

Commit acf03d7

Browse files
Merge pull request #285 from arihant2math/new-systemd3
systemd part 3: Cgroup2 partial stubbing
2 parents 3c0253e + 91117f8 commit acf03d7

8 files changed

Lines changed: 797 additions & 112 deletions

File tree

libkernel/src/error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ pub enum FsError {
121121
#[error("The directory is not empty.")]
122122
DirectoryNotEmpty,
123123

124+
/// The device or resource is busy.
125+
#[error("The device or resource is busy.")]
126+
Busy,
127+
124128
/// Invalid input parameters.
125129
#[error("Invalid input parameters.")]
126130
InvalidInput,

libkernel/src/error/syscall_error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub const ERANGE: isize = -34;
4444
pub const EWOULDBLOCK: isize = -EAGAIN;
4545
pub const ENAMETOOLONG: isize = -36;
4646
pub const ENOSYS: isize = -38;
47+
pub const ENOTEMPTY: isize = -39;
4748
pub const ELOOP: isize = -40;
4849
pub const EAFNOSUPPORT: isize = -97;
4950
pub const EOPNOTSUPP: isize = -95;
@@ -63,6 +64,8 @@ pub fn kern_err_to_syscall(err: KernelError) -> isize {
6364
KernelError::Fs(FsError::IsADirectory) => EISDIR,
6465
KernelError::Fs(FsError::NotADirectory) => ENOTDIR,
6566
KernelError::Fs(FsError::AlreadyExists) => EEXIST,
67+
KernelError::Fs(FsError::DirectoryNotEmpty) => ENOTEMPTY,
68+
KernelError::Fs(FsError::Busy) => EBUSY,
6669
KernelError::Fs(FsError::InvalidInput) => EINVAL, // TODO: Is this right?
6770
KernelError::Fs(FsError::PermissionDenied) => EACCES,
6871
KernelError::Fs(FsError::TooManyFiles) => EMFILE,

0 commit comments

Comments
 (0)