summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-26 22:53:33 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-26 22:53:33 +0000
commitdf4d82325af245e6d56cfd82b6b3587dd9ca8ae9 (patch)
treeb40e12b8f3dfb158061d72e5fbc937e2a6eaaed8
parent9155323a563d055a226a4e6cfc1f2fb9f8d2abf0 (diff)
downloadapr-df4d82325af245e6d56cfd82b6b3587dd9ca8ae9.tar.gz
poll: Provide APR_POLLEXCL for exclusive wake up on systems that support it.
epoll has EPOLLEXCLUSIVE, start with that. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897521 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_poll.h1
-rw-r--r--poll/unix/epoll.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/apr_poll.h b/include/apr_poll.h
index 482d6ee1d..a79a6046d 100644
--- a/include/apr_poll.h
+++ b/include/apr_poll.h
@@ -52,6 +52,7 @@ extern "C" {
#define APR_POLLERR 0x010 /**< Pending error */
#define APR_POLLHUP 0x020 /**< Hangup occurred */
#define APR_POLLNVAL 0x040 /**< Descriptor invalid */
+#define APR_POLLEXCL 0x080 /**< Exclusive */
/** @} */
/**
diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c
index 89c41a404..340f43db8 100644
--- a/poll/unix/epoll.c
+++ b/poll/unix/epoll.c
@@ -35,6 +35,10 @@ static apr_int16_t get_epoll_event(apr_int16_t event)
rv |= EPOLLPRI;
if (event & APR_POLLOUT)
rv |= EPOLLOUT;
+#ifdef EPOLLEXCLUSIVE
+ if (event & APR_POLLEXCL)
+ rv |= EPOLLEXCLUSIVE;
+#endif
/* APR_POLLNVAL is not handled by epoll. EPOLLERR and EPOLLHUP are return-only */
return rv;