MCPcopy Create free account
hub / github.com/F-Stack/f-stack / aeApiDelEvent

Function aeApiDelEvent

app/redis-6.2.6/src/ae_epoll.c:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static void aeApiDelEvent(aeEventLoop *eventLoop, int fd, int delmask) {
92 aeApiState *state = eventLoop->apidata;
93 struct epoll_event ee = {0}; /* avoid valgrind warning */
94 int mask = eventLoop->events[fd].mask & (~delmask);
95
96 ee.events = 0;
97 if (mask & AE_READABLE) ee.events |= EPOLLIN;
98 if (mask & AE_WRITABLE) ee.events |= EPOLLOUT;
99 ee.data.fd = fd;
100 if (mask != AE_NONE) {
101 epoll_ctl(state->epfd,EPOLL_CTL_MOD,fd,&ee);
102 } else {
103 /* Note, Kernel < 2.6.9 requires a non null event pointer even for
104 * EPOLL_CTL_DEL. */
105 epoll_ctl(state->epfd,EPOLL_CTL_DEL,fd,&ee);
106 }
107}
108
109static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
110 aeApiState *state = eventLoop->apidata;

Callers 1

aeDeleteFileEventFunction · 0.70

Calls 1

epoll_ctlFunction · 0.85

Tested by

no test coverage detected