aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-15 21:44:38 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-15 21:44:38 +0000
commit10bb2df624d460989f1572c41b0ceaba6c6f9a9e (patch)
treed4331fc0ae40bfa56d8e3a9f2b73f914383f3447 /src/sys
parent3031e295e0b6be45fd423a0545b0b04baa4a500a (diff)
parentac26036f346cc3eab333781d76395933faf6daf6 (diff)
downloadmio-aml_tz3_314012010.tar.gz
Change-Id: Id12140245b499a756d79b101c580a1171d764a4e
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/unix/selector/epoll.rs2
-rw-r--r--src/sys/unix/selector/kqueue.rs2
-rw-r--r--src/sys/unix/selector/mod.rs10
3 files changed, 2 insertions, 12 deletions
diff --git a/src/sys/unix/selector/epoll.rs b/src/sys/unix/selector/epoll.rs
index 38667d6..76ee7f9 100644
--- a/src/sys/unix/selector/epoll.rs
+++ b/src/sys/unix/selector/epoll.rs
@@ -41,7 +41,7 @@ impl Selector {
}
pub fn try_clone(&self) -> io::Result<Selector> {
- syscall!(fcntl(self.ep, libc::F_DUPFD_CLOEXEC, super::LOWEST_FD)).map(|ep| Selector {
+ syscall!(dup(self.ep)).map(|ep| Selector {
// It's the same selector, so we use the same id.
#[cfg(debug_assertions)]
id: self.id,
diff --git a/src/sys/unix/selector/kqueue.rs b/src/sys/unix/selector/kqueue.rs
index b36a537..34f5340 100644
--- a/src/sys/unix/selector/kqueue.rs
+++ b/src/sys/unix/selector/kqueue.rs
@@ -87,7 +87,7 @@ impl Selector {
}
pub fn try_clone(&self) -> io::Result<Selector> {
- syscall!(fcntl(self.kq, libc::F_DUPFD_CLOEXEC, super::LOWEST_FD)).map(|kq| Selector {
+ syscall!(dup(self.kq)).map(|kq| Selector {
// It's the same selector, so we use the same id.
#[cfg(debug_assertions)]
id: self.id,
diff --git a/src/sys/unix/selector/mod.rs b/src/sys/unix/selector/mod.rs
index b73d645..7525898 100644
--- a/src/sys/unix/selector/mod.rs
+++ b/src/sys/unix/selector/mod.rs
@@ -33,13 +33,3 @@ 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;