You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently updated my local version of wasmtime and noticed that the behavior of fd_write seems to have changed. I am supplying two strings to print: a supplied string, and a newline character. This used to print the newline character, which is what I expect, but seems to no longer do so. I bisected the behavior change back to PR #2444, but I didn't see this behavior change explicitly called out.
Basically, I'm wondering:
Is this new behavior intended, or a bug?
If this new behavior is intended, what am I doing wrong in the example program?
fd_write returns the amount of bytes written. You have to call it in a loop until all bytes are written. This matches the posix write syscall. From the man page of the write syscall:
The number of bytes written may be less than count if, for example, there is insufficient space on the underlying physical medium, or the RLIMIT_FSIZE resource limit is encountered (see setrlimit(2)), or the call was interrupted by a signal handler after having written less than count bytes. (See also pipe(7).)
Higher level api's generally do this loop for you.
fd_write returns the amount of bytes written. You have to call it in a loop until all bytes are written. This matches the posix write syscall. From the man page of the write syscall:
The number of bytes written may be less than count if, for example, there is insufficient space on the underlying physical medium, or the RLIMIT_FSIZE resource limit is encountered (see setrlimit(2)), or the call was interrupted by a signal handler after having written less than count bytes. (See also pipe(7).)
Higher level api's generally do this loop for you.
Thank you, this makes a lot of sense! Sorry for the false report
I recently updated my local version of wasmtime and noticed that the behavior of
fd_write
seems to have changed. I am supplying two strings to print: a supplied string, and a newline character. This used to print the newline character, which is what I expect, but seems to no longer do so. I bisected the behavior change back to PR #2444, but I didn't see this behavior change explicitly called out.Basically, I'm wondering:
Thanks for reading!
Test Case
Steps to Reproduce
wasmtime repro.wast
(contents above)Expected Results
Actual Results
Versions and Environment
I first observed this behavior on wasmtime 0.29.0. I bisected the issue back to PR #2444, which seems to be where the behavior changed.
Operating system: Windows 10
Architecture: x86
The text was updated successfully, but these errors were encountered: