change set_fdflags to reopen_with_fdflags

This commit is contained in:
Pat Hickey
2021-01-21 17:56:03 -08:00
parent a46c2ad0aa
commit f1a5dce716
6 changed files with 41 additions and 19 deletions

View File

@@ -38,8 +38,8 @@ impl WasiFile for File {
// XXX get_fdflags is not implemented but lets lie rather than panic:
Ok(FdFlags::empty())
}
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
todo!("set_fdflags is not implemented")
fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
todo!("reopen_with_fdflags is not implemented")
}
fn get_filestat(&self) -> Result<Filestat, Error> {
let meta = self.0.metadata()?;

View File

@@ -39,9 +39,8 @@ impl WasiFile for Stdin {
// XXX get_fdflags is not implemented but lets lie rather than panic:
Ok(FdFlags::empty())
}
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
// XXX
Err(Error::Perm)
fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
Err(Error::Badf)
}
fn get_filestat(&self) -> Result<Filestat, Error> {
let meta = self.0.as_file_view().metadata()?;
@@ -131,9 +130,8 @@ macro_rules! wasi_file_write_impl {
// XXX get_fdflags is not implemented but lets lie rather than panic:
Ok(FdFlags::empty())
}
fn set_fdflags(&self, _fdflags: FdFlags) -> Result<(), Error> {
// XXX
Err(Error::Perm)
fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
Err(Error::Badf)
}
fn get_filestat(&self) -> Result<Filestat, Error> {
// XXX can unsafe-io give a way to get metadata?