From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 13 16:17:28 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 9A1A416A4B3 for ; Mon, 13 Oct 2003 16:17:28 -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 B291E43F85 for ; Mon, 13 Oct 2003 16:17:27 -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 h9DNHJOH030733; Mon, 13 Oct 2003 16:17:19 -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: <20031013194716.GP533@funkthat.com> Date: Mon, 13 Oct 2003 16:17:19 -0700 (PDT) From: John Polstra To: John-Mark Gurney X-Bogosity: No, tests=bogofilter, spamicity=0.499992, 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 23:17:28 -0000 On 13-Oct-2003 John-Mark Gurney wrote: > John Polstra wrote this message on Mon, Oct 13, 2003 at 09:37 -0700: >> >> 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(). > > Simple fix, you wait for a single event, adding a struct kevent such as: > struct kevent ke; > ret = kevent(qfd, NULL, 0, &ke, 1, &ts); > > makes it wait the full 10 seconds. so, are you suggesting that we change > the behavior to wait for the timeout to expire before we return ANY > events? (because that is what your suggesting). That's not what really what I was suggesting, but after thinking it over some more I think I agree that it's OK as it stands. Because you can use kevent() to register events, or wait for events, or both, I guess it makes sense to ignore the timeout entirely when no events could possibly be returned. Sorry for the noise. John