MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / _wasmfs_read

Function _wasmfs_read

system/lib/wasmfs/js_api.cpp:203–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203int _wasmfs_read(int fd, void* buf, size_t count) {
204 __wasi_iovec_t iovs[1];
205 iovs[0].buf = (uint8_t*)buf;
206 iovs[0].buf_len = count;
207
208 __wasi_size_t numBytes;
209 __wasi_errno_t err = __wasi_fd_read(fd, iovs, 1, &numBytes);
210 if (err) {
211 return -err;
212 }
213 return numBytes;
214}
215
216int _wasmfs_pread(int fd, void* buf, size_t count, off_t offset) {
217 __wasi_iovec_t iovs[1];

Callers

nothing calls this directly

Calls 1

__wasi_fd_readFunction · 0.85

Tested by

no test coverage detected