25 #ifndef CPP_NIX_EPOLL_H_
26 #define CPP_NIX_EPOLL_H_
28 #include <sys/epoll.h>
69 int Add(
int fd, epoll_event* event) {
70 return epoll_ctl(
m_epfd, EPOLL_CTL_ADD, fd, event);
73 int Modify(
int fd, epoll_event* event) {
74 return epoll_ctl(
m_epfd, EPOLL_CTL_ADD, fd, event);
78 return epoll_ctl(
m_epfd, EPOLL_CTL_DEL, fd, NULL);
81 int Wait(
struct epoll_event *events,
int maxevents,
int timeout) {
82 return epoll_wait(
m_epfd, events, maxevents, timeout);
85 int Pwait(epoll_event *events,
int maxevents,
int timeout,
86 const sigset_t *sigmask) {
87 return epoll_pwait(
m_epfd, events, maxevents, timeout, sigmask);
96 #endif // CPP_NIX_EPOLL_H_
Epoll(epoll::Flags flags)
int Modify(int fd, epoll_event *event)
int Add(int fd, epoll_event *event)
int Pwait(epoll_event *events, int maxevents, int timeout, const sigset_t *sigmask)
int Wait(struct epoll_event *events, int maxevents, int timeout)