You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2022/01/26 22:53:33 UTC

svn commit: r1897521 - in /apr/apr/trunk: include/apr_poll.h poll/unix/epoll.c

Author: ylavic
Date: Wed Jan 26 22:53:33 2022
New Revision: 1897521

URL: http://svn.apache.org/viewvc?rev=1897521&view=rev
Log:
poll: Provide APR_POLLEXCL for exclusive wake up on systems that support it.

epoll has EPOLLEXCLUSIVE, start with that.


Modified:
    apr/apr/trunk/include/apr_poll.h
    apr/apr/trunk/poll/unix/epoll.c

Modified: apr/apr/trunk/include/apr_poll.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_poll.h?rev=1897521&r1=1897520&r2=1897521&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_poll.h (original)
+++ apr/apr/trunk/include/apr_poll.h Wed Jan 26 22:53:33 2022
@@ -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 */
 /** @} */
 
 /**

Modified: apr/apr/trunk/poll/unix/epoll.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/epoll.c?rev=1897521&r1=1897520&r2=1897521&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/epoll.c (original)
+++ apr/apr/trunk/poll/unix/epoll.c Wed Jan 26 22:53:33 2022
@@ -35,6 +35,10 @@ static apr_int16_t get_epoll_event(apr_i
         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;