| df67fe84 | 14-Feb-2024 |
Alex Crichton <[email protected]> |
Discard 0-sized writes to files (#7638)
* Discard 0-sized writes to files
This commit comes from #7633 where Windows and Unix would behave differently when writing at a particular file offset. Nota
Discard 0-sized writes to files (#7638)
* Discard 0-sized writes to files
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
* Discard empty writes in wasi-common as well
show more ...
|