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

Function _wasmfs_pread

system/lib/wasmfs/js_api.cpp:216–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216int _wasmfs_pread(int fd, void* buf, size_t count, off_t offset) {
217 __wasi_iovec_t iovs[1];
218 iovs[0].buf = (uint8_t*)buf;
219 iovs[0].buf_len = count;
220
221 __wasi_size_t numBytes;
222 __wasi_errno_t err = __wasi_fd_pread(fd, iovs, 1, offset, &numBytes);
223 if (err) {
224 return -err;
225 }
226 return numBytes;
227}
228
229int _wasmfs_truncate(const char* path, off_t length) {
230 return __syscall_truncate64(path, length);

Callers

nothing calls this directly

Calls 1

__wasi_fd_preadFunction · 0.85

Tested by

no test coverage detected