Skip to content

Commit 9f589b0

Browse files
committed
Update decode_error_kind to decode os errors to NotSupported
1 parent 4a15bd8 commit 9f589b0

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

library/std/src/sys/unix/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
148148
libc::EINVAL => ErrorKind::InvalidInput,
149149
libc::ETIMEDOUT => ErrorKind::TimedOut,
150150
libc::EEXIST => ErrorKind::AlreadyExists,
151+
libc::ENOSYS => ErrorKind::NotSupported,
151152

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

library/std/src/sys/vxworks/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
8383
libc::EINVAL => ErrorKind::InvalidInput,
8484
libc::ETIMEDOUT => ErrorKind::TimedOut,
8585
libc::EEXIST => ErrorKind::AlreadyExists,
86+
libc::ENOSYS => ErrorKind::NotSupported,
8687

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

library/std/src/sys/wasi/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub fn decode_error_kind(errno: i32) -> std_io::ErrorKind {
7878
wasi::ERRNO_TIMEDOUT => TimedOut,
7979
wasi::ERRNO_EXIST => AlreadyExists,
8080
wasi::ERRNO_AGAIN => WouldBlock,
81+
wasi::ERRNO_NOSYS => NotSupported,
8182
_ => Other,
8283
}
8384
}

library/std/src/sys/windows/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
7878
| c::ERROR_IPSEC_IKE_TIMED_OUT
7979
| c::ERROR_RUNLEVEL_SWITCH_TIMEOUT
8080
| c::ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT => return ErrorKind::TimedOut,
81+
c::ERROR_CALL_NOT_IMPLEMENTED => return ErrorKind::NotSupported,
8182
_ => {}
8283
}
8384

0 commit comments

Comments
 (0)