Skip to content

Commit fa7fb7d

Browse files
committed
Remove the ESP-IDF special case as the assessment was wrong and it is not necessary
1 parent 30d7fd7 commit fa7fb7d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/reactor.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@ use libc as sys;
1414

1515
use crate::{syscall, syscall_los, syscall_los_eagain};
1616

17-
// For ESP-IDF sys::FDSETSIZE is currently wrongly set to 1024 in the `libc` crate
18-
// Therefore, use a custom value for now
19-
#[cfg(target_os = "espidf")]
20-
const MAX_FDS: usize = 64;
21-
22-
#[cfg(not(target_os = "espidf"))]
23-
const MAX_FDS: usize = sys::FD_SETSIZE;
24-
2517
// In future, we might want to use a smaller - and possibly - configurable - with cargo feature(s)
2618
// amount of registrations to save memory, but for now, let's use the maximum amount
27-
const MAX_REGISTRATIONS: usize = MAX_FDS;
19+
const MAX_REGISTRATIONS: usize = sys::FD_SETSIZE;
2820

2921
#[derive(EnumSetType, Debug)]
3022
pub(crate) enum Event {
@@ -114,7 +106,7 @@ impl<const N: usize> Registrations<N> {
114106
Err(ErrorKind::InvalidInput)?;
115107
}
116108

117-
if fd >= MAX_FDS as RawFd {
109+
if fd >= sys::FD_SETSIZE as RawFd {
118110
Err(ErrorKind::InvalidInput)?;
119111
}
120112

0 commit comments

Comments
 (0)