diff options
| author | Ben Kimock <kimockb@gmail.com> | 2023-08-25 17:54:50 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2023-08-25 21:26:06 -0400 |
| commit | 1abaf40ec818dfc0a0ad50e6e772cce60acc8477 (patch) | |
| tree | 2eaff06fd68fa083f10f102cfcec5278e130506b /library/std/src/sys/unix | |
| parent | 18be2728bd0d59c8fc74311de365a52a2d5e3eee (diff) | |
Add a new helper to avoid calling io::Error::kind
Diffstat (limited to 'library/std/src/sys/unix')
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 77ef086f29b..6d743903314 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -240,6 +240,11 @@ pub use crate::sys::android::signal; #[cfg(not(target_os = "android"))] pub use libc::signal; +#[inline] +pub(crate) fn is_interrupted(errno: i32) -> bool { + errno == libc::EINTR +} + pub fn decode_error_kind(errno: i32) -> ErrorKind { use ErrorKind::*; match errno as libc::c_int { |
