delete file::get/set_oflags

This commit is contained in:
Pat Hickey
2021-01-05 13:52:14 -08:00
parent fb32f65118
commit 8ace7f00d9
3 changed files with 1 additions and 39 deletions

View File

@@ -9,8 +9,6 @@ pub trait WasiFile: FileIoExt + SetTimes {
fn get_filetype(&self) -> Result<FileType, Error>; fn get_filetype(&self) -> Result<FileType, Error>;
fn get_fdflags(&self) -> Result<FdFlags, Error>; fn get_fdflags(&self) -> Result<FdFlags, Error>;
fn set_fdflags(&self, _flags: FdFlags) -> Result<(), Error>; fn set_fdflags(&self, _flags: FdFlags) -> Result<(), Error>;
fn get_oflags(&self) -> Result<OFlags, Error>;
fn set_oflags(&self, _flags: OFlags) -> Result<(), Error>;
fn get_filestat(&self) -> Result<Filestat, Error>; fn get_filestat(&self) -> Result<Filestat, Error>;
fn set_filestat_size(&self, _size: u64) -> Result<(), Error>; 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> { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
todo!("set_fdflags is not implemented") todo!("set_fdflags is not implemented")
} }
fn get_oflags(&self) -> Result<OFlags, Error> {
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<Filestat, Error> { fn get_filestat(&self) -> Result<Filestat, Error> {
let meta = self.metadata()?; let meta = self.metadata()?;
use cap_fs_ext::MetadataExt; use cap_fs_ext::MetadataExt;

View File

@@ -32,12 +32,6 @@ impl WasiFile for Stdin {
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
todo!() todo!()
} }
fn get_oflags(&self) -> Result<OFlags, Error> {
todo!()
}
fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> {
todo!()
}
fn get_filestat(&self) -> Result<Filestat, Error> { fn get_filestat(&self) -> Result<Filestat, Error> {
todo!() todo!()
} }
@@ -75,12 +69,6 @@ impl WasiFile for Stdout {
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
todo!() todo!()
} }
fn get_oflags(&self) -> Result<OFlags, Error> {
todo!()
}
fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> {
todo!()
}
fn get_filestat(&self) -> Result<Filestat, Error> { fn get_filestat(&self) -> Result<Filestat, Error> {
todo!() todo!()
} }
@@ -118,12 +106,6 @@ impl WasiFile for Stderr {
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
todo!() todo!()
} }
fn get_oflags(&self) -> Result<OFlags, Error> {
todo!()
}
fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> {
todo!()
}
fn get_filestat(&self) -> Result<Filestat, Error> { fn get_filestat(&self) -> Result<Filestat, Error> {
todo!() todo!()
} }

View File

@@ -9,7 +9,7 @@
//! Some convenience constructors are included for common backing types like `Vec<u8>` and `String`, //! Some convenience constructors are included for common backing types like `Vec<u8>` and `String`,
//! but the virtual pipes can be instantiated with any `Read` or `Write` type. //! 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 crate::Error;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
@@ -183,12 +183,6 @@ impl<R: Read> WasiFile for ReadPipe<R> {
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
Err(Error::Perm) Err(Error::Perm)
} }
fn get_oflags(&self) -> Result<OFlags, Error> {
Ok(OFlags::empty())
}
fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> {
Err(Error::Perm)
}
fn get_filestat(&self) -> Result<Filestat, Error> { fn get_filestat(&self) -> Result<Filestat, Error> {
Ok(Filestat { Ok(Filestat {
device_id: 0, device_id: 0,
@@ -361,12 +355,6 @@ impl<W: Write> WasiFile for WritePipe<W> {
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> { fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
Err(Error::Perm) Err(Error::Perm)
} }
fn get_oflags(&self) -> Result<OFlags, Error> {
Ok(OFlags::empty())
}
fn set_oflags(&self, _flags: OFlags) -> Result<(), Error> {
Err(Error::Perm)
}
fn get_filestat(&self) -> Result<Filestat, Error> { fn get_filestat(&self) -> Result<Filestat, Error> {
Ok(Filestat { Ok(Filestat {
device_id: 0, device_id: 0,