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::io::Read.read's documentation should mention ErrorKind::Interrupted #34661

Closed
glandium opened this issue Jul 5, 2016 · 3 comments
Closed
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority

Comments

@glandium
Copy link
Contributor

glandium commented Jul 5, 2016

https://doc.rust-lang.org/std/io/trait.Read.html#tymethod.read currently says:

This function does not provide any guarantees about whether it blocks waiting for data, but if an object needs to block for a read but cannot it will typically signal this via an Err return value.

This could be taken as meaning EAGAIN/EWOULDBLOCK need to be handled (which, btw, is not in ErrorKind, but O_NONBLOCK is probably not in libstd anyways), but it looks like it means one needs to handle EINTR, which, if you're not familiar with the POSIX API, is very easy to skip.

BTW, this, unfortunately, makes read() cumbersome to use.

@sfackler
Copy link
Member

sfackler commented Jul 5, 2016

(which, btw, is not in ErrorKind

https://doc.rust-lang.org/std/io/enum.ErrorKind.html#variant.WouldBlock

@steveklabnik steveklabnik added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Mar 10, 2017
@steveklabnik
Copy link
Member

sub-bug of #40322

@steveklabnik steveklabnik added the P-medium Medium priority label Mar 22, 2017
@steveklabnik
Copy link
Member

(as such, closing it in favor of that one, even though this one is older, as that one is more general)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants