summaryrefslogtreecommitdiff
path: root/poll/unix/epoll.c
diff options
context:
space:
mode:
authorIvan Zhakov <ivan@apache.org>2022-02-09 10:39:35 +0000
committerIvan Zhakov <ivan@apache.org>2022-02-09 10:39:35 +0000
commit0ef545062eda29eb0db5f49e11ca4fec3e038529 (patch)
tree7e8a150c4e114f40c21af7dc5a9cb04a7033e9d4 /poll/unix/epoll.c
parent011f944967c77b5608eaebf4cdc1947b7340d804 (diff)
parent89682a8e2e5eb498b6c4e4ff162052c7e2406a0b (diff)
downloadapr-0ef545062eda29eb0db5f49e11ca4fec3e038529.tar.gz
On 'win32-pollset-wakeup-no-file-socket-emulation' branch: Merge changes fromwin32-pollset-wakeup-no-file-socket-emulation
trunk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/win32-pollset-wakeup-no-file-socket-emulation@1897894 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll/unix/epoll.c')
-rw-r--r--poll/unix/epoll.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/poll/unix/epoll.c b/poll/unix/epoll.c
index c00a1094d..7e811241d 100644
--- a/poll/unix/epoll.c
+++ b/poll/unix/epoll.c
@@ -25,9 +25,9 @@
#if defined(HAVE_EPOLL)
-static apr_int16_t get_epoll_event(apr_int16_t event)
+static unsigned get_epoll_event(apr_int16_t event)
{
- apr_int16_t rv = 0;
+ unsigned rv = 0;
if (event & APR_POLLIN)
rv |= EPOLLIN;
@@ -35,12 +35,16 @@ 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;
}
-static apr_int16_t get_epoll_revent(apr_int16_t event)
+static apr_int16_t get_epoll_revent(unsigned event)
{
apr_int16_t rv = 0;
@@ -123,7 +127,7 @@ static apr_status_t impl_pollset_create(apr_pollset_t *pollset,
}
#endif
- pollset->p = apr_palloc(p, sizeof(apr_pollset_private_t));
+ pollset->p = apr_pcalloc(p, sizeof(apr_pollset_private_t));
#if APR_HAS_THREADS
if ((flags & APR_POLLSET_THREADSAFE) &&
!(flags & APR_POLLSET_NOCOPY) &&