| 214 | } |
| 215 | |
| 216 | int _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 | |
| 229 | int _wasmfs_truncate(const char* path, off_t length) { |
| 230 | return __syscall_truncate64(path, length); |
nothing calls this directly
no test coverage detected