fn create_epollfd(timer_fd: libc::c_int) -> Result<libc::c_int> {
        // create a new epoll fd
        let epoll_fd = epoll_create1(0)?;

        // event to pull
        let mut event = libc::epoll_event {
            events: libc::EPOLLIN as u32,
            u64: 1,
        };

        let epoll_flags = libc::EPOLL_CTL_ADD;

        // add event to the epoll
        epoll_ctl(epoll_fd, epoll_flags, timer_fd, &mut event)?;

        // return epoll fd
        Ok(epoll_fd)
    }
/// Create a new epoll file descriptor and add the timer to its interests
Create a new epoll file descriptor and add the timer to its interests
Create a new epoll file descriptor and add the timer to its interests
fn create_epollfd(timer_fd: libc::c_int) -> Result<libc::c_int> {
        // create a new epoll fd
        let epoll_fd = epoll_create1(0)?;
        // event to pull
        let mut event = libc::epoll_event {
            events: libc::EPOLLIN as u32,
            u64: 1,
        };
        let epoll_flags = libc::EPOLL_CTL_ADD;
        // add event to the epoll
        epoll_ctl(epoll_fd, epoll_flags, timer_fd, &mut event)?;
        // return epoll fd
        Ok(epoll_fd)
    }
fn create_epollfd ( timer_fd : libc :: c_int ) -> Result < libc :: c_int > { // create a new epoll fd let epoll_fd = epoll_create1 ( 0 ) ? ; // event to pull let mut event = libc :: epoll_event { events : libc :: EPOLLIN as u32 , u64 : 1 , } ; let epoll_flags = libc :: EPOLL_CTL_ADD ; // add event to the epoll epoll_ctl ( epoll_fd , epoll_flags , timer_fd , & mut event ) ? ; // return epoll fd Ok ( epoll_fd ) }
Create a new epoll file descriptor and add the timer to its interests
Create a new epoll file descriptor and add the timer to its interests
timer_fd
libc::c_int
timer_fd
libc::c_int