epoll_example.c
// add EPOLLIN event of fd to the epollfd
add EPOLLIN event of fd to the epollfd
add EPOLLIN event of fd to the epollfd
void addfd(int epollfd, int fd, int enable_et)
{
    struct epoll_event event;
    event.data.fd = fd;
    event.events = EPOLLIN;
    if(enable_et) event.events |= EPOLLET;
    epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &event);
    setnonblocking(fd);
}
void addfd ( int epollfd , int fd , int enable_et ) { struct epoll_event event ; event . data . fd = fd ; event . events = EPOLLIN ; if ( enable_et ) event . events |= EPOLLET ; epoll_ctl ( epollfd , EPOLL_CTL_ADD , fd , & event ) ; setnonblocking ( fd ) ; }
add EPOLLIN event of fd to the epollfd
add EPOLLIN event of fd to the epollfd