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>
*** 20,29 ****
--- 20,30 ----
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2017 Joyent, Inc.
*/
/*
* evtchn.c
*** 448,472 ****
struct evtsoftdata *ep;
minor_t minor = getminor(dev);
short mask = 0;
ep = EVTCHNDRV_INST2SOFTS(EVTCHNDRV_MINOR2INST(minor));
- *phpp = (struct pollhead *)NULL;
if (ev & POLLOUT)
mask |= POLLOUT;
if (ep->ring_overflow)
mask |= POLLERR;
if (ev & (POLLIN | POLLRDNORM)) {
mutex_enter(&ep->evtchn_lock);
! if (ep->ring_cons != ep->ring_prod)
mask |= (POLLIN | POLLRDNORM) & ev;
! else
! if (mask == 0 && !anyyet)
! *phpp = &ep->evtchn_pollhead;
mutex_exit(&ep->evtchn_lock);
}
*revp = mask;
return (0);
}
--- 449,473 ----
struct evtsoftdata *ep;
minor_t minor = getminor(dev);
short mask = 0;
ep = EVTCHNDRV_INST2SOFTS(EVTCHNDRV_MINOR2INST(minor));
if (ev & POLLOUT)
mask |= POLLOUT;
if (ep->ring_overflow)
mask |= POLLERR;
if (ev & (POLLIN | POLLRDNORM)) {
mutex_enter(&ep->evtchn_lock);
! if (ep->ring_cons != ep->ring_prod) {
mask |= (POLLIN | POLLRDNORM) & ev;
! }
mutex_exit(&ep->evtchn_lock);
}
+ if ((mask == 0 && !anyyet) || (ev & POLLET)) {
+ *phpp = &ep->evtchn_pollhead;
+ }
*revp = mask;
return (0);
}