From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 13 09:38:10 2003 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4BC216A4BF; Mon, 13 Oct 2003 09:38:10 -0700 (PDT) Received: from blake.polstra.com (dsl081-189-066.sea1.dsl.speakeasy.net [64.81.189.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F01043F93; Mon, 13 Oct 2003 09:38:07 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (dsl081-189-067.sea1.dsl.speakeasy.net [64.81.189.67]) by blake.polstra.com (8.12.9p2/8.12.9) with ESMTP id h9DGbxOH028760; Mon, 13 Oct 2003 09:37:59 -0700 (PDT) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200310130749.h9D7nWF9038579@freefall.freebsd.org> Date: Mon, 13 Oct 2003 09:37:59 -0700 (PDT) From: John Polstra To: John-Mark Gurney X-Bogosity: No, tests=bogofilter, spamicity=0.476372, version=0.14.5 cc: boris@cs.tu-berlin.de cc: freebsd-bugs@freebsd.org Subject: Re: kern/45291: kevent(2) ignores timeout if nevents == 0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2003 16:38:10 -0000 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