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.
sunfishcode requested pchickey for a review on PR #2494.
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.
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.
pchickey submitted PR Review.
sunfishcode merged PR #2494.
Last updated: Dec 23 2024 at 12:05 UTC