Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discard 0-sized writes to files #7638

Merged
merged 2 commits into from
Feb 14, 2024

Commits on Feb 14, 2024

  1. Discard 0-sized writes to files

    This commit comes from bytecodealliance#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 bytecodealliance#7633
    alexcrichton committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    57fa569 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    302a0ed View commit details
    Browse the repository at this point in the history