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

Function wasi_fd_write

src/wrappers.rs:133–140  ·  view source on GitHub ↗
(ctx: &mut VmCtx, v_fd: u32, iovs: u32, iovcnt: u32)

Source from the content-addressed store, hash-verified

131#[ensures(ctx_safe(ctx))]
132#[ensures(trace_safe(trace, ctx))]
133pub fn wasi_fd_write(ctx: &mut VmCtx, v_fd: u32, iovs: u32, iovcnt: u32) -> RuntimeResult<u32> {
134 let fd = ctx.fdmap.fd_to_native(v_fd)?;
135 let wasm_iovs = parse_iovs(ctx, iovs, iovcnt);
136 unwrap_result!(wasm_iovs);
137
138 let result = trace_writev(ctx, fd, &wasm_iovs, iovcnt as usize)?;
139 Ok(result as u32)
140}
141
142// https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#fd_seek
143// modifies: none

Calls 3

parse_iovsFunction · 0.85
trace_writevFunction · 0.85
fd_to_nativeMethod · 0.80

Tested by

no test coverage detected