Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion library/std/src/sys/io/error/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,15 @@ pub fn decode_error_kind(errno: i32) -> io::ErrorKind {
libc::EXDEV => CrossesDevices,
libc::EINPROGRESS => InProgress,
libc::EMFILE | libc::ENFILE => TooManyOpenFiles,
libc::EOPNOTSUPP => Unsupported,
libc::EIO => InputOutputError,

libc::EACCES | libc::EPERM => PermissionDenied,

// EOPNOTSUPP and ENOTSUP can have the same value on some systems,
// but different values on others (e.g. Apple), so we can't use a
// match clause
x if x == libc::EOPNOTSUPP || x == libc::ENOTSUP => Unsupported,

@RalfJung RalfJung Aug 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there is also ENOSYS mapping to the same thing. Seems better to group all 3 together.

View changes since the review


// These two constants can have the same value on some systems,
// but different values on others, so we can't use a match
// clause
Expand Down
Loading