bakkot opened PR #8000 from bakkot:patch-1
to bytecodealliance:main
:
If I am reading the docs correctly - and I am not at all sure that I am - the return value of
fd_write
is anerrno
, not the number of bytes written. That seems to match up with what I observe in an actual module compiled with wasi-sdk and run via Node's wasi module.This is important because it has exactly the opposite interpretation:
0
indicates a successful write, not failure.Possibly
nwritten
should be*nwritten
also, since it's a pointer. (Specifically it's an out-parameter which is where the number of bytes written actually goes.)
bakkot requested wasmtime-default-reviewers for a review on PR #8000.
bakkot requested pchickey for a review on PR #8000.
pchickey commented on PR #8000:
Thanks for catching this, your understanding and fix is correct. Want to change it to
*nwritten
as well? Unfortunately those docs have not gotten a lot of love since they were written a long time ago.
bakkot updated PR #8000.
Want to change it to
*nwritten
as well?Done.
Unfortunately those docs have not gotten a lot of love since they were written a long time ago.
Yeah, I figured everyone's been (understandably!) putting energy into preview2. Fortunately they haven't really gotten stale - presumably they'll need a new version for preview2 someday, but for now this is still all accurate and useful, from what I can tell.
pchickey submitted PR review.
pchickey merged PR #8000.
Last updated: Nov 22 2024 at 16:03 UTC