From 0d6baba6715e46b15233b13b6515284576aab9b4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 22 Apr 2024 23:59:43 +1000 Subject: [PATCH] Enable `preadv2` optimization on android Signed-off-by: Jiahao XU --- src/unix.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix.rs b/src/unix.rs index e1a45b7..88fb76b 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -290,7 +290,7 @@ impl Client { // // TODO: musl libc supports preadv2 since 1.2.5, but `libc` crate // hasn't yet added it. - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", target_os = "android"))] { let read = self.read().as_raw_fd(); loop { @@ -397,7 +397,7 @@ impl Client { // This should be available for all linux targets, // though only [`non_blocking_read`] currently uses it so adding gnu cfg. -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] mod linux { use super::*;