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

Function wasi_fd_read

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

Source from the content-addressed store, hash-verified

116#[ensures(ctx_safe(ctx))]
117#[ensures(trace_safe(trace, ctx))]
118pub fn wasi_fd_read(ctx: &mut VmCtx, v_fd: u32, iovs: u32, iovcnt: u32) -> RuntimeResult<u32> {
119 let fd = ctx.fdmap.fd_to_native(v_fd)?;
120 let wasm_iovs = parse_iovs(ctx, iovs, iovcnt);
121 unwrap_result!(wasm_iovs);
122
123 let result = trace_readv(ctx, fd, &wasm_iovs, iovcnt as usize)?;
124 Ok(result as u32)
125}
126
127#[with_ghost_var(trace: &mut Trace)]
128#[external_methods(push)]

Calls 3

parse_iovsFunction · 0.85
trace_readvFunction · 0.85
fd_to_nativeMethod · 0.80

Tested by

no test coverage detected