MCPcopy Create free account
hub / github.com/WasmVM/WasmVM / fs_close

Function fs_close

host/sysenv/sys_fs.cpp:103–110  ·  view source on GitHub ↗

close(fd:i32) -> i32

Source from the content-addressed store, hash-verified

101
102// close(fd:i32) -> i32
103static std::vector<Value> fs_close(Stack& stack) {
104 Frame& frame = stack.frames.top();
105 i32_t fd = std::get<i32_t>(frame.locals[0]);
106 FdEntry* e = fd_table.get(fd);
107 if(!e) return {Value(i32_t(-EBADF))};
108 fd_table.release(fd);
109 return {Value(i32_t(0))};
110}
111
112// read(fd:i32, buf_ptr, buf_len) -> i32
113static std::vector<Value> fs_read(Stack& stack) {

Callers

nothing calls this directly

Calls 3

ValueClass · 0.85
releaseMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected