The trivial poll_no_poll() returned POLLNVAL if it got a bit it doesn't
recognize. This is wrong: poll() should ignore bits it doesn't recognize
and poll(1) states that POLLNVAL is only to be returned if the file
descriptor isn't open. This patch just drops the wrong test.

Before this patch, adding an extra bit not listed, like EPOLLRDHUP,
caused POLLNVAL to be returned. Worse, when using epoll, it did not
expect to ever get back POLLNVAL from poll(), and caused an assertion

Refs #971.

Signed-off-by: Nadav Har'El <>
 core/ | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/core/ b/core/
index a036bac9..cd968e4f 100644
--- a/core/
+++ b/core/
@@ -67,16 +67,7 @@ using namespace std;
 int poll_no_poll(int events)
-    /*
-     * Return true for read/write.  If the user asked for something
-     * special, return POLLNVAL, so that clients have a way of
-     * determining reliably whether or not the extended
-     * functionality is present without hard-coding knowledge
-     * of specific filesystem implementations.
-     */
-    if (events & ~POLLSTANDARD)
-        return (POLLNVAL);
+     // Return ready for read/write.
     return (events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));

You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to