nodejs / uvwasi

WASI syscall API built atop libuv
MIT License
226 stars 51 forks source link

Behavior diverge from othe runtimes on empty `fd_read` #260

Closed yagehu closed 5 months ago

yagehu commented 5 months ago

fd_read or fd_write with a 0 length iovec succeeds on host Linux as well as other Wasm runtimes (Wasmer, Wasmtime, WasmEdge, WAMR). However, uvwasi returns inval. This is a result of libuv performing null checks at the start of uv_fs_{read,write}.

I want to raise this issue to see if maintainers wish to converge with other runtimes here. 0 length read or write should intuitively be a no-op, and we can address this edge case in uvwasi without changing libuv.

mhdawson commented 5 months ago

Seems reasonable to me, approved the PR but will give other maintainers a bit of time to review as well.