Stream: git-wasmtime

Topic: wasmtime / PR #2494 Fix the return value from wasi-common...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2020 at 00:57):

sunfishcode opened PR #2494 from sunfishcode/readdir-bufused to main:

fd_readdir returns a "bufused" value, which indicates the number of
bytes read into the buffer. WASI libc expects this value to be equal
to the size of the buffer if the end of the directory has not yet
been scanned.

Previously, wasi-common's fd_readdir was writing as many complete
entries as it could fit and then stopping, but this meant it was
returning size less than the buffer size even when the directory had
more entries. This patch makes it continue writing up until the end
of the buffer, and return that number of bytes, to let WASI libc
know that there's more to be read.

Fixes #2493.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2020 at 00:57):

sunfishcode requested pchickey for a review on PR #2494.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2020 at 01:05):

sunfishcode updated PR #2494 from sunfishcode/readdir-bufused to main:

fd_readdir returns a "bufused" value, which indicates the number of
bytes read into the buffer. WASI libc expects this value to be equal
to the size of the buffer if the end of the directory has not yet
been scanned.

Previously, wasi-common's fd_readdir was writing as many complete
entries as it could fit and then stopping, but this meant it was
returning size less than the buffer size even when the directory had
more entries. This patch makes it continue writing up until the end
of the buffer, and return that number of bytes, to let WASI libc
know that there's more to be read.

Fixes #2493.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2020 at 05:46):

sunfishcode updated PR #2494 from sunfishcode/readdir-bufused to main:

fd_readdir returns a "bufused" value, which indicates the number of
bytes read into the buffer. WASI libc expects this value to be equal
to the size of the buffer if the end of the directory has not yet
been scanned.

Previously, wasi-common's fd_readdir was writing as many complete
entries as it could fit and then stopping, but this meant it was
returning size less than the buffer size even when the directory had
more entries. This patch makes it continue writing up until the end
of the buffer, and return that number of bytes, to let WASI libc
know that there's more to be read.

Fixes #2493.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 10 2020 at 17:09):

pchickey submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 11 2020 at 18:52):

sunfishcode merged PR #2494.


Last updated: Oct 23 2024 at 20:03 UTC