Skip to main content

libcontainer/syscall/
mod.rs

1//! Contains a wrapper of syscalls for unit tests
2//! This provides a uniform interface for rest of Youki
3//! to call syscalls required for container management
4
5pub mod linux;
6#[allow(clippy::module_inception)]
7pub mod syscall;
8pub mod test;
9
10pub use syscall::Syscall;
11#[derive(Debug, thiserror::Error)]
12pub enum SyscallError {
13    #[error("unexpected mount attr option: {0}")]
14    UnexpectedMountRecursiveOption(String),
15    #[error(transparent)]
16    Nix(#[from] nix::Error),
17    #[error(transparent)]
18    IO(#[from] std::io::Error),
19    #[error("failed to set capabilities: {0}")]
20    SetCaps(#[from] caps::errors::CapsError),
21    #[error(transparent)]
22    Pathrs(#[from] pathrs::error::Error),
23}
24
25type Result<T> = std::result::Result<T, SyscallError>;