use unsafe to mark reopen_with_fdflags as having special safety features
This commit is contained in:
@@ -38,7 +38,7 @@ impl WasiFile for File {
|
||||
// XXX get_fdflags is not implemented but lets lie rather than panic:
|
||||
Ok(FdFlags::empty())
|
||||
}
|
||||
fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
|
||||
unsafe 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> {
|
||||
|
||||
@@ -39,7 +39,7 @@ impl WasiFile for Stdin {
|
||||
// XXX get_fdflags is not implemented but lets lie rather than panic:
|
||||
Ok(FdFlags::empty())
|
||||
}
|
||||
fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
|
||||
unsafe fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
|
||||
Err(Error::Badf)
|
||||
}
|
||||
fn get_filestat(&self) -> Result<Filestat, Error> {
|
||||
@@ -128,7 +128,10 @@ macro_rules! wasi_file_write_impl {
|
||||
// XXX get_fdflags is not implemented but lets lie rather than panic:
|
||||
Ok(FdFlags::empty())
|
||||
}
|
||||
fn reopen_with_fdflags(&self, _fdflags: FdFlags) -> Result<Box<dyn WasiFile>, Error> {
|
||||
unsafe fn reopen_with_fdflags(
|
||||
&self,
|
||||
_fdflags: FdFlags,
|
||||
) -> Result<Box<dyn WasiFile>, Error> {
|
||||
Err(Error::Badf)
|
||||
}
|
||||
fn get_filestat(&self) -> Result<Filestat, Error> {
|
||||
|
||||
Reference in New Issue
Block a user