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

Function aeApiAddEvent

app/redis-6.2.6/src/ae_ff_kqueue.c:105–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

ff_keventFunction · 0.85

Tested by

no test coverage detected