Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2005 16:46:22 -0600 (CST)
From:      =?ISO-8859-1?Q?Se=E1n_C=2E_Farley?= <sean-freebsd@farley.org>
To:        =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= <V.Haisman@sh.cvut.cz>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Number of kevents registered in kqueue
Message-ID:  <20051216164406.G4815@thor.farley.org>
In-Reply-To: <43A3416A.2000407@sh.cvut.cz>
References:  <20051216155717.W4815@thor.farley.org> <43A3416A.2000407@sh.cvut.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-914946570-1134773182=:4815
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Fri, 16 Dec 2005, V=E1clav Haisman wrote:

> Se=E1n C. Farley wrote:
>> I may have missed it in the man page, but I am unable to find a way
>> to determine how many kevents are currently registered within a
>> kqueue.  If there is no method for a count, how about a way to find
>> if a kqueue is empty or not.  Besides tracking what events are still
>> within a kqueue, this would make for an easier way to write an event
>> loop.  Currently, calling kevent() on an empty kqueue will still
>> block.

<snip>

> I was working with it recently and my understanding is that if you
> want to retrieve any events and not block if there are none then you
> should give it zeroed struct timespec. Quote from the man page:
>
> "If timeout is a NULL pointer, kevent() waits indefinitely.  To effect
> a poll, the timeout argument should be non-NULL, pointing to a
> zero-valued timespec structure."

I understand about the timeout.  I am looking for different methods to
break out of a loop where I want to remain until all events are handled
and deleted from the kqueue.

Se=E1n
--=20
sean-freebsd@farley.org
--0-914946570-1134773182=:4815--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051216164406.G4815>