Print this page
8634 epoll fails to wake on certain edge-triggered conditions
8635 epoll should not emit POLLNVAL
8636 recursive epoll should emit EPOLLRDNORM
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>

@@ -8,11 +8,11 @@
  * source.  A copy of the CDDL is also available via the Internet at
  * http://www.illumos.org/license/CDDL.
  */
 
 /*
- * Copyright 2016 Joyent, Inc.
+ * Copyright 2017 Joyent, Inc.
  */
 
 /*
  * Support for the eventfd facility, a Linux-borne facility for user-generated
  * file descriptor-based events.

@@ -226,12 +226,14 @@
                 revents |= POLLRDNORM | POLLIN;
 
         if (state->efd_value < EVENTFD_VALMAX)
                 revents |= POLLWRNORM | POLLOUT;
 
-        if (!(*reventsp = revents & events) && !anyyet)
+        *reventsp = revents & events;
+        if ((*reventsp == 0 && !anyyet) || (events & POLLET)) {
                 *phpp = &state->efd_pollhd;
+        }
 
         mutex_exit(&state->efd_lock);
 
         return (0);
 }