diff --git a/Cargo.toml b/Cargo.toml index 37f97ce5da..af41ed109d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "redox_syscall" -version = "0.8.0" +version = "0.8.1" description = "A Rust library to access raw Redox system calls" license = "MIT" authors = ["Jeremy Soller "] diff --git a/src/flag.rs b/src/flag.rs index 458ef23d74..80d849180a 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -258,6 +258,23 @@ impl ProcSchemeVerb { } } +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum FileTableVerb { + Close = 1, + Dup2 = 2, + CloseCloExec = 3, +} +impl FileTableVerb { + pub fn try_from_raw(value: u8) -> Option { + Some(match value { + 1 => Self::Close, + 2 => Self::Dup2, + 3 => Self::CloseCloExec, + _ => return None, + }) + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(usize)] pub enum SchemeSocketCall {