Stream: git-wasmtime

Topic: wasmtime / PR #8000 Fix description of fd_write in WASI-t...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 16:51):

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 an errno, 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.)

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 16:51):

bakkot requested wasmtime-default-reviewers for a review on PR #8000.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 16:51):

bakkot requested pchickey for a review on PR #8000.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 18:16):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 18:28):

bakkot updated PR #8000.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 18:32):

bakkot commented on 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.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 19:10):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 27 2024 at 19:35):

pchickey merged PR #8000.


Last updated: Nov 22 2024 at 16:03 UTC