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

std: User a smaller stdin buffer on windows #13377

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

Apparently windows doesn't like reading from stdin with a large buffer size, and
it also apparently is ok with a smaller buffer size. This changes the reader
returned by stdin() to return an 8k buffered reader for stdin rather than a 64k
buffered reader.

Apparently libuv has run into this before, taking a peek at their code, with a
specific comment in their console code saying that "ReadConsole can't handle big
buffers", which I presume is related to invoking ReadFile as if it were a file
descriptor.

Closes #13304

Apparently windows doesn't like reading from stdin with a large buffer size, and
it also apparently is ok with a smaller buffer size. This changes the reader
returned by stdin() to return an 8k buffered reader for stdin rather than a 64k
buffered reader.

Apparently libuv has run into this before, taking a peek at their code, with a
specific comment in their console code saying that "ReadConsole can't handle big
buffers", which I presume is related to invoking ReadFile as if it were a file
descriptor.

Closes rust-lang#13304
@alexcrichton
Copy link
Member Author

Note that the test added does not expose the bug on windows, I think it's only a bug when reading from a real console. I've verified that this does indeed fix the problem on windows, and I figured that more I/O test don't exactly hurt us.

@alexcrichton alexcrichton deleted the issue-13304 branch April 8, 2014 16:56
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2022
… r=Veykril

fix: Underline only the intra-doc link itself instead of the whole doc comment
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 24, 2024
fix: Fixed incorrect comment form suggestion for too_long_first_doc_paragraph lint

fixes rust-lang#13309
changelog: none

Comment form is now a variable and a new test for too_long_first_doc_paragraph was added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stdin().read_u8 results in unknown error (OS Error 8 (FormatMessageW() returned error 15105))
2 participants