alexcrichton opened PR #7638 from alexcrichton:fix-pwrite-behavior
to bytecodealliance:main
:
This commit comes from #7633 where Windows and Unix would behave differently when writing at a particular file offset. Notably Unix semantics [indicate]:
Before any action described below is taken, and if nbyte is zero
and the file is a regular file, the write() function may detect
and return errors as described below. In the absence of errors,
or if error detection is not performed, the write() function
shall return zero and have no other results. If nbyte is zero and
the file is not a regular file, the results are unspecified.These semantics are a bit easier to emulate on Windows so the host implementation now discards any attempt to perform I/O if a zero-sized write is detected.
[indicate]: https://man7.org/linux/man-pages/man3/write.3p.html
Closes #7633
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested pchickey for a review on PR #7638.
alexcrichton requested wasmtime-core-reviewers for a review on PR #7638.
pchickey submitted PR review:
Seems like a good fix to me. Thanks
alexcrichton updated PR #7638.
alexcrichton has enabled auto merge for PR #7638.
alexcrichton commented on PR #7638:
Took me quite some time to set aside time to debug this failure on Windows, and it turned up https://github.com/bytecodealliance/system-interface/pull/43
alexcrichton updated PR #7638.
alexcrichton has enabled auto merge for PR #7638.
alexcrichton merged PR #7638.
Last updated: Nov 22 2024 at 17:03 UTC