From fa7fb7d635ba295ba6368d8c6288cac1fdf95181 Mon Sep 17 00:00:00 2001 From: ivmarkov Date: Tue, 10 Sep 2024 13:36:51 +0000 Subject: [PATCH] Remove the ESP-IDF special case as the assessment was wrong and it is not necessary --- src/reactor.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/reactor.rs b/src/reactor.rs index 28ed113..aaaf0bd 100644 --- a/src/reactor.rs +++ b/src/reactor.rs @@ -14,17 +14,9 @@ use libc as sys; use crate::{syscall, syscall_los, syscall_los_eagain}; -// For ESP-IDF sys::FDSETSIZE is currently wrongly set to 1024 in the `libc` crate -// Therefore, use a custom value for now -#[cfg(target_os = "espidf")] -const MAX_FDS: usize = 64; - -#[cfg(not(target_os = "espidf"))] -const MAX_FDS: usize = sys::FD_SETSIZE; - // In future, we might want to use a smaller - and possibly - configurable - with cargo feature(s) // amount of registrations to save memory, but for now, let's use the maximum amount -const MAX_REGISTRATIONS: usize = MAX_FDS; +const MAX_REGISTRATIONS: usize = sys::FD_SETSIZE; #[derive(EnumSetType, Debug)] pub(crate) enum Event { @@ -114,7 +106,7 @@ impl Registrations { Err(ErrorKind::InvalidInput)?; } - if fd >= MAX_FDS as RawFd { + if fd >= sys::FD_SETSIZE as RawFd { Err(ErrorKind::InvalidInput)?; }