aboutsummaryrefslogtreecommitdiff
path: root/src/sys/unix/selector/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/unix/selector/mod.rs')
-rw-r--r--src/sys/unix/selector/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sys/unix/selector/mod.rs b/src/sys/unix/selector/mod.rs
index 7525898..b73d645 100644
--- a/src/sys/unix/selector/mod.rs
+++ b/src/sys/unix/selector/mod.rs
@@ -33,3 +33,13 @@ mod kqueue;
target_os = "openbsd"
))]
pub(crate) use self::kqueue::{event, Event, Events, Selector};
+
+/// Lowest file descriptor used in `Selector::try_clone`.
+///
+/// # Notes
+///
+/// Usually fds 0, 1 and 2 are standard in, out and error. Some application
+/// blindly assume this to be true, which means using any one of those a select
+/// could result in some interesting and unexpected errors. Avoid that by using
+/// an fd that doesn't have a pre-determined usage.
+const LOWEST_FD: libc::c_int = 3;