diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-10-04 15:13:22 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-10-04 15:13:22 +0300 |
commit | 653e9854637e129cd6a92adaff96784220165eea (patch) | |
tree | ac570922c641f1e0f1f9732f41d69e5cef3e77a6 | |
parent | 00ecf713e36de2a5efffe761458b7ac0328bce87 (diff) | |
download | unit-653e9854637e129cd6a92adaff96784220165eea.tar.gz unit-653e9854637e129cd6a92adaff96784220165eea.tar.bz2 |
Added Linux 4.5 EPOLLEXCLUSIVE support.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_epoll_engine.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nxt_epoll_engine.c b/src/nxt_epoll_engine.c index 7e9a0b1c..c3d629a6 100644 --- a/src/nxt_epoll_engine.c +++ b/src/nxt_epoll_engine.c @@ -27,7 +27,7 @@ * eventfd2() Linux 2.6.27, glibc 2.9. * accept4() Linux 2.6.28, glibc 2.10. * eventfd2(EFD_SEMAPHORE) Linux 2.6.30, glibc 2.10. - * EPOLLEXCLUSIVE Linux 4.5. + * EPOLLEXCLUSIVE Linux 4.5, glibc 2.24. */ @@ -570,9 +570,17 @@ nxt_epoll_oneshot_write(nxt_event_engine_t *engine, nxt_fd_event_t *ev) static void nxt_epoll_enable_accept(nxt_event_engine_t *engine, nxt_fd_event_t *ev) { + uint32_t events; + ev->read = NXT_EVENT_ACTIVE; - nxt_epoll_change(engine, ev, EPOLL_CTL_ADD, EPOLLIN); + events = EPOLLIN; + +#ifdef EPOLLEXCLUSIVE + events |= EPOLLEXCLUSIVE; +#endif + + nxt_epoll_change(engine, ev, EPOLL_CTL_ADD, events); } |