Skip to content

Commit b68ea41

Browse files
authored
io: hardcode platform list for poll_write (#7872)
1 parent 8f6d086 commit b68ea41

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

tokio/src/io/poll_evented.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ feature! {
188188
// Read more:
189189
// https://github.com/tokio-rs/tokio/issues/5866
190190
#[cfg(all(
191+
// keep in sync with poll_write
191192
not(mio_unsupported_force_poll_poll),
192193
any(
193194
// epoll
@@ -240,7 +241,28 @@ feature! {
240241
// that the socket buffer is full. Unfortunately this assumption
241242
// fails for level-triggered selectors (like on Windows or poll even for
242243
// UNIX): https://github.com/tokio-rs/tokio/issues/5866
243-
if n > 0 && (!cfg!(windows) && !cfg!(mio_unsupported_force_poll_poll) && n < buf.len()) {
244+
#[cfg(all(
245+
// keep in sync with poll_read
246+
not(mio_unsupported_force_poll_poll),
247+
any(
248+
// epoll
249+
target_os = "android",
250+
target_os = "illumos",
251+
target_os = "linux",
252+
target_os = "redox",
253+
// kqueue
254+
target_os = "dragonfly",
255+
target_os = "freebsd",
256+
target_os = "ios",
257+
target_os = "macos",
258+
target_os = "netbsd",
259+
target_os = "openbsd",
260+
target_os = "tvos",
261+
target_os = "visionos",
262+
target_os = "watchos",
263+
)
264+
))]
265+
if 0 < n && n < buf.len() {
244266
self.registration.clear_readiness(evt);
245267
}
246268

0 commit comments

Comments
 (0)