kern/45291: kevent(2) ignores timeout if nevents == 0

John Polstra jdp at polstra.com
Mon Oct 13 09:38:10 PDT 2003


On 13-Oct-2003 John-Mark Gurney wrote:
> Synopsis: kevent(2) ignores timeout if nevents == 0
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: jmg
> State-Changed-When: Mon Oct 13 00:46:53 PDT 2003
> State-Changed-Why: 
> to quote the man page: If timeout is a non-NULL pointer, it specifies
> a maximum interval to wait for an event,
> 
> The behavior is correct since you wanted to wait for 0 events, and since
> it has delivered all the events it can (none), it returns.  Unless provide
> with good reason (or maybe a patch to the manpage to document this feature?)
> I will close the PR in 5 days.

I disagree.  The current behavior is not correct.  It is inconsistent
with the longstanding behavior of both poll() and select().  Also,
from a practical standpoint, returning immediately instead of
waiting for the timeout to expire makes writing a typical event loop
more awkward.  It requires the addition of a special case in the
application code to deal with the situation where no events are being
awaited.  That's not necessary when using poll() or select().

John


More information about the freebsd-bugs mailing list