1#[cfg(all(
2 not(mio_unsupported_force_poll_poll),
3 any(
4 target_os = "android",
5 target_os = "illumos",
6 target_os = "linux",
7 target_os = "redox",
8 )
9))]
10mod epoll;
11
12#[cfg(all(
13 not(mio_unsupported_force_poll_poll),
14 any(
15 target_os = "android",
16 target_os = "illumos",
17 target_os = "linux",
18 target_os = "redox",
19 )
20))]
21pub(crate) use self::epoll::{event, Event, Events, Selector};
22
23#[cfg(any(
24 mio_unsupported_force_poll_poll,
25 target_os = "solaris",
26 target_os = "vita"
27))]
28mod poll;
29
30#[cfg(any(
31 mio_unsupported_force_poll_poll,
32 target_os = "solaris",
33 target_os = "vita"
34))]
35pub(crate) use self::poll::{event, Event, Events, Selector};
36
37cfg_io_source! {
38 #[cfg(any(mio_unsupported_force_poll_poll, target_os = "solaris", target_os = "vita"))]
39 pub(crate) use self::poll::IoSourceState;
40}
41
42#[cfg(all(
43 not(mio_unsupported_force_poll_poll),
44 any(
45 target_os = "dragonfly",
46 target_os = "freebsd",
47 target_os = "ios",
48 target_os = "macos",
49 target_os = "netbsd",
50 target_os = "openbsd",
51 target_os = "tvos",
52 target_os = "watchos",
53 )
54))]
55mod kqueue;
56
57#[cfg(all(
58 not(mio_unsupported_force_poll_poll),
59 any(
60 target_os = "dragonfly",
61 target_os = "freebsd",
62 target_os = "ios",
63 target_os = "macos",
64 target_os = "netbsd",
65 target_os = "openbsd",
66 target_os = "tvos",
67 target_os = "watchos",
68 ),
69))]
70pub(crate) use self::kqueue::{event, Event, Events, Selector};
71
72/// Lowest file descriptor used in `Selector::try_clone`.
73///
74/// # Notes
75///
76/// Usually fds 0, 1 and 2 are standard in, out and error. Some application
77/// blindly assume this to be true, which means using any one of those a select
78/// could result in some interesting and unexpected errors. Avoid that by using
79/// an fd that doesn't have a pre-determined usage.
80const LOWEST_FD: libc::c_int = 3;
81