write_all assumes that a write returning 0 is a kind of EOF
Open
Nobody has claimed this yet.
A-docs
A-io
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
The code is quite self-explaining:
However, reading the write() docs, I see no justification for this. As far as I can tell, write is allowed to spuriously return 0 as a form of "short write". This random website also says so.
Cc @the8472
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with library/std/src/io/mod.rs at lines 1835-1847, then read the write() and write_all() documentation to compare their stated handling of zero-length writes. Check the existing standard-library I/O tests for coverage of this case; done means the behavior matches the documented contract and has a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100