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

Add WouldBlock error kind to IoError #16666

Closed
carllerche opened this issue Aug 22, 2014 · 6 comments · Fixed by #23430
Closed

Add WouldBlock error kind to IoError #16666

carllerche opened this issue Aug 22, 2014 · 6 comments · Fixed by #23430
Assignees
Labels
I-needs-decision Issue: In need of a decision.
Milestone

Comments

@carllerche
Copy link
Member

I'm working on a non-blocking IO lib for rust. It would be very helpful to have an error kind that clearly indicates the retry semantics of non-blocking IO.

I believe that currently EAGAIN and EWOULDBLOCK are mapped to ResourceUnavailable but that does not clearly indicate the would block / retry semantics.

@steveklabnik
Copy link
Member

Adding stuff to the standard lib requires an RFC these days, if you still care about this, you should make sure the IO RFC takes care of it.

@steveklabnik
Copy link
Member

/cc @aturon , i guess this is kinda a bug sorta

@steveklabnik
Copy link
Member

nominating for backcompat-libs like all the othe rones

@carllerche
Copy link
Member Author

/cc @alexcrichton

@aturon
Copy link
Member

aturon commented Feb 17, 2015

This currently maps to a ResourceUnavailable error (same as EINTR when it isn't retried internally).

@pnkfelix
Copy link
Member

P-backcompat-libs, 1.0 beta, I-needs-decision

@pnkfelix pnkfelix added I-needs-decision Issue: In need of a decision. and removed I-nominated labels Feb 19, 2015
@pnkfelix pnkfelix added this to the 1.0 beta milestone Feb 19, 2015
@alexcrichton alexcrichton self-assigned this Mar 17, 2015
bors added a commit that referenced this issue Mar 19, 2015
This commit stabilizes the `ErrorKind` enumeration which is consumed by and
generated by the `io::Error` type. The purpose of this type is to serve as a
cross-platform namespace to categorize errors into. Two specific issues are
addressed as part of this stablization:

* The naming of each variant was scrutinized and some were tweaked. An example
  is how `FileNotFound` was renamed to simply `NotFound`. These names should not
  show either a Unix or Windows bias and the set of names is intended to grow
  over time. For now the names will likely largely consist of those errors
  generated by the I/O APIs in the standard library.

* The mapping of OS error codes onto kinds has been altered. Coalescing no
  longer occurs (multiple error codes become one kind). It is intended that each
  OS error code, if bound, corresponds to only one `ErrorKind`. The current set
  of error kinds was expanded slightly to include some networking errors.

This commit also adds a `raw_os_error` function which returns an `Option<i32>`
to extract the underlying raw error code from the `Error`.

Closes #16666

[breaking-change]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-needs-decision Issue: In need of a decision.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants