]> git.proxmox.com Git - pve-lxc-syscalld.git/commitdiff
edge triggering is vital for us
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 30 Oct 2019 11:35:33 +0000 (12:35 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 30 Oct 2019 11:35:33 +0000 (12:35 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/epoll.rs
src/reactor.rs

index d8ef6cfdcf2bb93278b376e169044c57671f589f..8750f10c3057b134085849f9985d2f6989be95bd 100644 (file)
@@ -1,15 +1,16 @@
 use std::convert::TryFrom;
 use std::io;
-use std::time::Duration;
 use std::os::raw::c_int;
 use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
+use std::time::Duration;
 
-use crate::tools::Fd;
 use crate::error::io_err_other;
+use crate::tools::Fd;
 
 pub type EpollEvent = libc::epoll_event;
 
 pub const EPOLLIN: u32 = libc::EPOLLIN as u32;
+pub const EPOLLET: u32 = libc::EPOLLET as u32;
 pub const EPOLLOUT: u32 = libc::EPOLLOUT as u32;
 pub const EPOLLERR: u32 = libc::EPOLLERR as u32;
 pub const EPOLLHUP: u32 = libc::EPOLLHUP as u32;
@@ -65,7 +66,11 @@ impl Epoll {
         Ok(())
     }
 
-    pub fn wait(&self, event_buf: &mut [EpollEvent], timeout: Option<Duration>) -> io::Result<usize> {
+    pub fn wait(
+        &self,
+        event_buf: &mut [EpollEvent],
+        timeout: Option<Duration>,
+    ) -> io::Result<usize> {
         let millis = timeout
             .map(|t| c_int::try_from(t.as_millis()))
             .transpose()
index c731178657ba9579a3720ddabc6747c599c5ff84..a20807f0e6c6b1b0ca9e6ed6f354dc7acbb0d98f 100644 (file)
@@ -5,7 +5,7 @@ use std::sync::{Arc, Mutex};
 use std::task::{Context, Poll, Waker};
 use std::thread::JoinHandle;
 
-use crate::epoll::{Epoll, EpollEvent, EPOLLERR, EPOLLHUP, EPOLLIN, EPOLLOUT};
+use crate::epoll::{Epoll, EpollEvent, EPOLLERR, EPOLLET, EPOLLHUP, EPOLLIN, EPOLLOUT};
 use crate::error::io_err_other;
 use crate::poll_fn::poll_fn;
 use crate::tools::Fd;
@@ -102,7 +102,8 @@ impl Reactor {
             inner_ptr as *mut RegistrationInner as usize as u64
         };
 
-        self.epoll.add_fd(fd, EPOLLIN | EPOLLOUT, inner_ptr)?;
+        self.epoll
+            .add_fd(fd, EPOLLIN | EPOLLOUT | EPOLLET, inner_ptr)?;
 
         Ok(Registration { inner: Some(inner) })
     }