about summary refs log tree commit diff
path: root/library/std/src/sys/unix
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-08-25 17:54:50 -0400
committerBen Kimock <kimockb@gmail.com>2023-08-25 21:26:06 -0400
commit1abaf40ec818dfc0a0ad50e6e772cce60acc8477 (patch)
tree2eaff06fd68fa083f10f102cfcec5278e130506b /library/std/src/sys/unix
parent18be2728bd0d59c8fc74311de365a52a2d5e3eee (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.rs5
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 {