From d89e998922724de80996802721e167d9ca24f4d7 Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Fri, 6 Feb 2026 07:08:04 -0700 Subject: [PATCH] net: fix GET_BUF_SIZE constant for `target_os = "android"` (#7889) We recently tried to upgrade Android to the newest tokio, but tests that use these constants fail, since Android is provided the non-Linux constants. --- tokio/tests/tcp_socket.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio/tests/tcp_socket.rs b/tokio/tests/tcp_socket.rs index 6c4dcbd94..1c64c70ac 100644 --- a/tokio/tests/tcp_socket.rs +++ b/tokio/tests/tcp_socket.rs @@ -123,10 +123,10 @@ const SET_BUF_SIZE: u32 = 4096; // Linux doubles the buffer size for kernel usage, and exposes that when // retrieving the buffer size. -#[cfg(not(target_os = "linux"))] +#[cfg(not(any(target_os = "android", target_os = "linux")))] const GET_BUF_SIZE: u32 = SET_BUF_SIZE; -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "android", target_os = "linux"))] const GET_BUF_SIZE: u32 = 2 * SET_BUF_SIZE; test!(keepalive, set_keepalive(true));