Skip to content

Commit e545aa9

Browse files
committed
Un-hardcode MAX_REGISTRATIONS on regular OSes
1 parent 65c1e17 commit e545aa9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/reactor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ 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")]
1720
const MAX_REGISTRATIONS: usize = 20;
1821

19-
//const FD_SEGMENT: usize = sys::FD_SETSIZE / core::mem::size_of::<sys::fd_set>();
22+
#[cfg(not(target_os = "espidf"))]
23+
const MAX_REGISTRATIONS: usize = sys::FD_SETSIZE as usize;
2024

2125
#[derive(EnumSetType, Debug)]
2226
pub(crate) enum Event {

0 commit comments

Comments
 (0)