| 112 | } |
| 113 | |
| 114 | int |
| 115 | EventIO::refresh(int e) |
| 116 | { |
| 117 | if (!this->syscall) { |
| 118 | return 0; |
| 119 | } |
| 120 | |
| 121 | ink_assert(event_loop); |
| 122 | #if TS_USE_KQUEUE && defined(USE_EDGE_TRIGGER) |
| 123 | e = e & events; |
| 124 | struct kevent ev[2]; |
| 125 | int n = 0; |
| 126 | if (e & EVENTIO_READ) { |
| 127 | EV_SET(&ev[n++], fd, EVFILT_READ, EV_ADD | INK_EV_EDGE_TRIGGER, 0, 0, this); |
| 128 | } |
| 129 | if (e & EVENTIO_WRITE) { |
| 130 | EV_SET(&ev[n++], fd, EVFILT_WRITE, EV_ADD | INK_EV_EDGE_TRIGGER, 0, 0, this); |
| 131 | } |
| 132 | if (n) { |
| 133 | return kevent(event_loop->kqueue_fd, &ev[0], n, nullptr, 0, nullptr); |
| 134 | } else { |
| 135 | return 0; |
| 136 | } |
| 137 | #endif |
| 138 | (void)e; // ATS_UNUSED |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | int |
| 143 | EventIO::stop() |
no test coverage detected