MCPcopy Create free account
hub / github.com/PLSysSec/wave / wasi_fd_fdstat_set_flags

Function wasi_fd_fdstat_set_flags

src/wrappers.rs:266–273  ·  view source on GitHub ↗

can only adjust Fdflags using set_flags, not O_flags or any other flags

(ctx: &mut VmCtx, v_fd: u32, v_flags: u32)

Source from the content-addressed store, hash-verified

264#[ensures(trace_safe(trace, ctx))]
265// can only adjust Fdflags using set_flags, not O_flags or any other flags
266pub fn wasi_fd_fdstat_set_flags(ctx: &mut VmCtx, v_fd: u32, v_flags: u32) -> RuntimeResult<()> {
267 let flags = FdFlags::from(v_flags as i32);
268 let fd = ctx.fdmap.fd_to_native(v_fd)?;
269
270 let posix_flags = flags.to_posix();
271 let ret = trace_fsetfl(ctx, fd, posix_flags)?;
272 Ok(())
273}
274
275// https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#fd_filestat_get
276// modifies: None

Calls 3

trace_fsetflFunction · 0.85
fd_to_nativeMethod · 0.80
to_posixMethod · 0.45

Tested by

no test coverage detected