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

Method fd_to_native

src/fdmap.rs:68–74  ·  view source on GitHub ↗
(&self, v_fd: SboxFd)

Source from the content-addressed store, hash-verified

66 // #[pure]
67 #[ensures(result.is_ok() ==> old(v_fd) < MAX_SBOX_FDS)]
68 pub fn fd_to_native(&self, v_fd: SboxFd) -> RuntimeResult<HostFd> {
69 if v_fd >= MAX_SBOX_FDS {
70 return Err(Ebadf);
71 }
72 // self.m[idx as usize]
73 vec_checked_lookup(&self.m, v_fd)
74 }
75
76 #[pure]
77 #[requires(index < MAX_SBOX_FDS)]

Callers 15

poll_parse_fdsFunction · 0.80
wasi_fd_readFunction · 0.80
wasi_fd_writeFunction · 0.80
wasi_fd_seekFunction · 0.80
wasi_fd_adviseFunction · 0.80
wasi_fd_allocateFunction · 0.80
wasi_fd_syncFunction · 0.80
wasi_fd_datasyncFunction · 0.80
wasi_fd_fdstat_getFunction · 0.80
wasi_fd_fdstat_set_flagsFunction · 0.80
wasi_fd_filestat_getFunction · 0.80

Calls 1

vec_checked_lookupFunction · 0.85

Tested by

no test coverage detected