MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / aeApiAddEvent

Function aeApiAddEvent

src/ae_kqueue.c:102–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102static int aeApiAddEvent(aeEventLoop *eventLoop, int fd, int mask) {
103 aeApiState *state = (aeApiState*)eventLoop->apidata;
104 struct kevent ke;
105
106 if (mask & AE_READABLE) {
107 EV_SET(&ke, fd, EVFILT_READ, EV_ADD, 0, 0, NULL);
108 if (kevent(state->kqfd, &ke, 1, NULL, 0, NULL) == -1) return -1;
109 }
110 if (mask & AE_WRITABLE) {
111 EV_SET(&ke, fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
112 if (kevent(state->kqfd, &ke, 1, NULL, 0, NULL) == -1) return -1;
113 }
114 return 0;
115}
116
117static void aeApiDelEvent(aeEventLoop *eventLoop, int fd, int mask) {
118 aeApiState *state = (aeApiState*)eventLoop->apidata;

Callers

nothing calls this directly

Calls 1

keventClass · 0.70

Tested by

no test coverage detected