From a990de90fe41456a23e58bd087d2f107d321f3a1 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 19 Jul 2024 16:37:58 +0400 Subject: Deleted vendor folder --- vendor/redox_syscall/src/scheme/mod.rs | 68 ---------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 vendor/redox_syscall/src/scheme/mod.rs (limited to 'vendor/redox_syscall/src/scheme/mod.rs') diff --git a/vendor/redox_syscall/src/scheme/mod.rs b/vendor/redox_syscall/src/scheme/mod.rs deleted file mode 100644 index 61655da..0000000 --- a/vendor/redox_syscall/src/scheme/mod.rs +++ /dev/null @@ -1,68 +0,0 @@ -use core::{slice, str}; - -use crate::{Error, Result, EOPNOTSUPP, ESKMSG, Packet, SKMSG_FRETURNFD}; - -pub use self::scheme::Scheme; -pub use self::scheme_mut::SchemeMut; -pub use self::scheme_block::SchemeBlock; -pub use self::scheme_block_mut::SchemeBlockMut; -pub use self::seek::*; - -unsafe fn str_from_raw_parts(ptr: *const u8, len: usize) -> Option<&'static str> { - let slice = slice::from_raw_parts(ptr, len); - str::from_utf8(slice).ok() -} - -mod scheme; -mod scheme_mut; -mod scheme_block; -mod scheme_block_mut; -mod seek; - -pub struct CallerCtx { - pub pid: usize, - pub uid: u32, - pub gid: u32, -} - -pub enum OpenResult { - ThisScheme { number: usize }, - OtherScheme { fd: usize }, -} - -// TODO: Find a better solution than generate.sh -pub(crate) fn convert_to_this_scheme(r: Result) -> Result { - r.map(|number| OpenResult::ThisScheme { number }) -} -pub(crate) fn convert_to_this_scheme_block(r: Result>) -> Result> { - r.map(|o| o.map(|number| OpenResult::ThisScheme { number })) -} -pub(crate) fn convert_in_scheme_handle_block(_: &Packet, result: Result>) -> Result> { - match result { - Ok(Some(OpenResult::ThisScheme { number })) => Ok(Some(number)), - Ok(Some(OpenResult::OtherScheme { .. })) => Err(Error::new(EOPNOTSUPP)), - Ok(None) => Ok(None), - Err(err) => Err(err), - } -} -pub(crate) fn convert_in_scheme_handle(packet: &mut Packet, result: Result) -> Result { - match result { - Ok(OpenResult::ThisScheme { number }) => Ok(number), - Ok(OpenResult::OtherScheme { fd }) => { - packet.b = SKMSG_FRETURNFD; - packet.c = fd; - Err(Error::new(ESKMSG)) - } - Err(err) => Err(err), - } -} - -impl CallerCtx { - pub fn from_packet(packet: &Packet) -> Self { - Self { - pid: packet.pid, - uid: packet.uid, - gid: packet.gid, - } - } -} -- cgit v1.2.3