From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 12 21:27:58 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3253716A468 for ; Tue, 12 Jun 2007 21:27:58 +0000 (UTC) (envelope-from jimmy@mammothcheese.ca) Received: from smtp100.rog.mail.re2.yahoo.com (smtp100.rog.mail.re2.yahoo.com [206.190.36.78]) by mx1.freebsd.org (Postfix) with SMTP id C4FB813C48C for ; Tue, 12 Jun 2007 21:27:57 +0000 (UTC) (envelope-from jimmy@mammothcheese.ca) Received: (qmail 15431 invoked from network); 12 Jun 2007 21:01:17 -0000 Received: from unknown (HELO ?74.110.53.6?) (jazzturk@rogers.com@74.110.53.6 with plain) by smtp100.rog.mail.re2.yahoo.com with SMTP; 12 Jun 2007 21:01:17 -0000 X-YMail-OSG: rsgrI.kVM1mEkfJ32L_cVJldNxbxbRAg4rJJ1a4FWeCPgONZUdXKuheTo_mrLPtcrQ-- Message-ID: <466F099B.5070801@mammothcheese.ca> Date: Tue, 12 Jun 2007 17:01:15 -0400 From: James Bailie User-Agent: Thunderbird 2.0.0.0 (X11/20070609) MIME-Version: 1.0 To: cole@opteqint.net, freebsd-hackers@freebsd.org References: <20070612204525.9598C13C4AD@mx1.freebsd.org> In-Reply-To: <20070612204525.9598C13C4AD@mx1.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Kqueue queries X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2007 21:27:58 -0000 Cole wrote: > If I do the above, and just keep increasing number_events and > just mark the kevent as EV_DISABLED or EV_DELETE then all it > does is return that event as soon as I call kevent() with the > following values: ident : 7, filter : -1, flags : 16384 That flags value is EV_ERROR. It indicates your attempt to register an event on a closed descriptor. You do not need to disable or delete events manually if the descriptor is closed, if that was the intent. Closing a descriptor causes all events registered on it to be removed automatically. You need to get those events for closed descriptors out of your input queue. -- James Bailie http://www.mammothcheese.ca