epoll: Error out if someone asks for one-shot
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 17:50:24 +0000 (12:50 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 2 Mar 2017 18:01:28 +0000 (13:01 -0500)
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/iplib/epoll.c

index 9414c71..85fa52f 100644 (file)
@@ -364,6 +364,11 @@ static int __epoll_ctl_add(struct epoll_ctlr *ep, int fd,
                werrstr("Epoll level-triggered not supported");
                return -1;
        }
+       if (event->events & EPOLLONESHOT) {
+               errno = EPERM;
+               werrstr("Epoll one-shot not supported");
+               return -1;
+       }
        /* The sockets-to-plan9 networking shims are a bit inconvenient.  The user
         * asked us to epoll on an FD, but that FD is actually a Qdata FD.  We might
         * need to actually epoll on the listen_fd.  Further, we don't know yet