From 8ace7f00d941c4b4792e1486f4ce4acadb79d55e Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Tue, 5 Jan 2021 13:52:14 -0800 Subject: [PATCH] delete file::get/set_oflags --- crates/wasi-c2/src/file.rs | 8 -------- crates/wasi-c2/src/stdio.rs | 18 ------------------ crates/wasi-c2/src/virt/pipe.rs | 14 +------------- 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/crates/wasi-c2/src/file.rs b/crates/wasi-c2/src/file.rs index 847c6f87cb..ab0d04c093 100644 --- a/crates/wasi-c2/src/file.rs +++ b/crates/wasi-c2/src/file.rs @@ -9,8 +9,6 @@ pub trait WasiFile: FileIoExt + SetTimes { fn get_filetype(&self) -> Result; fn get_fdflags(&self) -> Result; fn set_fdflags(&self, _flags: FdFlags) -> Result<(), Error>; - fn get_oflags(&self) -> Result; - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error>; fn get_filestat(&self) -> Result; fn set_filestat_size(&self, _size: u64) -> Result<(), Error>; } @@ -246,12 +244,6 @@ impl WasiFile for cap_std::fs::File { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { todo!("set_fdflags is not implemented") } - fn get_oflags(&self) -> Result { - todo!("get_oflags is not implemented"); - } - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> { - todo!("set_oflags is not implemented"); - } fn get_filestat(&self) -> Result { let meta = self.metadata()?; use cap_fs_ext::MetadataExt; diff --git a/crates/wasi-c2/src/stdio.rs b/crates/wasi-c2/src/stdio.rs index 9e83217363..e2ad89be8d 100644 --- a/crates/wasi-c2/src/stdio.rs +++ b/crates/wasi-c2/src/stdio.rs @@ -32,12 +32,6 @@ impl WasiFile for Stdin { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { todo!() } - fn get_oflags(&self) -> Result { - todo!() - } - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> { - todo!() - } fn get_filestat(&self) -> Result { todo!() } @@ -75,12 +69,6 @@ impl WasiFile for Stdout { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { todo!() } - fn get_oflags(&self) -> Result { - todo!() - } - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> { - todo!() - } fn get_filestat(&self) -> Result { todo!() } @@ -118,12 +106,6 @@ impl WasiFile for Stderr { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { todo!() } - fn get_oflags(&self) -> Result { - todo!() - } - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> { - todo!() - } fn get_filestat(&self) -> Result { todo!() } diff --git a/crates/wasi-c2/src/virt/pipe.rs b/crates/wasi-c2/src/virt/pipe.rs index 8fe25d8c82..493cf986cd 100644 --- a/crates/wasi-c2/src/virt/pipe.rs +++ b/crates/wasi-c2/src/virt/pipe.rs @@ -9,7 +9,7 @@ //! Some convenience constructors are included for common backing types like `Vec` and `String`, //! but the virtual pipes can be instantiated with any `Read` or `Write` type. //! -use crate::file::{FdFlags, FileType, Filestat, OFlags, WasiFile}; +use crate::file::{FdFlags, FileType, Filestat, WasiFile}; use crate::Error; use std::io::{self, Read, Write}; use std::sync::{Arc, RwLock}; @@ -183,12 +183,6 @@ impl WasiFile for ReadPipe { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { Err(Error::Perm) } - fn get_oflags(&self) -> Result { - Ok(OFlags::empty()) - } - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> { - Err(Error::Perm) - } fn get_filestat(&self) -> Result { Ok(Filestat { device_id: 0, @@ -361,12 +355,6 @@ impl WasiFile for WritePipe { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { Err(Error::Perm) } - fn get_oflags(&self) -> Result { - Ok(OFlags::empty()) - } - fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> { - Err(Error::Perm) - } fn get_filestat(&self) -> Result { Ok(Filestat { device_id: 0,