fn epoll_wait(timer_fd: libc::c_int, epoll_fd: libc::c_int) -> Result<()> {
        // vector to store events
        let mut events = Vec::with_capacity(1);

        // wait for the timer to fire an event. This is function will block.
        unsafe {
            epoll_wait(epoll_fd, events.as_mut_ptr(), 1, -1)?;
        }

        // read the value from the timerfd. This is required to re-arm the timer.
        let mut buffer: u64 = 0;
        let bufptr: *mut _ = &mut buffer;
        unsafe {
            read(timer_fd, bufptr as *mut libc::c_void, 8)?;
        }

        Ok(())
    }
/// Wait for an event on the epoll file descriptor
Wait for an event on the epoll file descriptor
Wait for an event on the epoll file descriptor
fn epoll_wait(timer_fd: libc::c_int, epoll_fd: libc::c_int) -> Result<()> {
        // vector to store events
        let mut events = Vec::with_capacity(1);
        // wait for the timer to fire an event. This is function will block.
        unsafe {
            epoll_wait(epoll_fd, events.as_mut_ptr(), 1, -1)?;
        }
        // read the value from the timerfd. This is required to re-arm the timer.
        let mut buffer: u64 = 0;
        let bufptr: *mut _ = &mut buffer;
        unsafe {
            read(timer_fd, bufptr as *mut libc::c_void, 8)?;
        }
        Ok(())
    }
fn epoll_wait ( timer_fd : libc :: c_int , epoll_fd : libc :: c_int ) -> Result < ( ) > { // vector to store events let mut events = Vec :: with_capacity ( 1 ) ; // wait for the timer to fire an event. This is function will block. unsafe { epoll_wait ( epoll_fd , events . as_mut_ptr ( ) , 1 , - 1 ) ? ; } // read the value from the timerfd. This is required to re-arm the timer. let mut buffer : u64 = 0 ; let bufptr : * mut _ = & mut buffer ; unsafe { read ( timer_fd , bufptr as * mut libc :: c_void , 8 ) ? ; } Ok ( ( ) ) }
Wait for an event on the epoll file descriptor
Wait for an event on the epoll file descriptor
timer_fd
libc::c_int
epoll_fd
libc::c_int
timer_fd
libc::c_int
epoll_fd
libc::c_int