Subject: Re: Importing kqueue's from FreeBSD...
To: Jason R Thorpe , Jonathan Lemon <>
From: Jonathan Lemon <>
List: tech-kern
Date: 03/15/2001 18:29:27
On Thu, Mar 15, 2001 at 04:25:43PM -0800, Jason R Thorpe wrote:
> On Thu, Mar 15, 2001 at 06:16:51PM -0600, Jonathan Lemon wrote:
>  > Each filter has a private flag word and a data word that they can
>  > define for their own use.  An EVFILT_DEVICE filter may define some of
>  > the bits in them to mean inserted/removed/suspended, "current status",
>  > or whatever the filter wants to return.
> Hm -- might be nice if there was a way to get a bigger blob of data
> than just a single word...

Hah.  I had that discussion in the early days of the design of kqueue
with matt dillon.  The problem is always, how many words is enough?
There is always an application that just wants one more word than
provided.  So I provided u_int flag, an intptr_t data, which should be
enough to either pass back data in-band or provide information where
to find things out-of band.  This doesn't count the void *udata field

The answer I came up with was to use a backchannel if you really want
to pass back a lot of data.  I have a filter that does this, for example,
by using copyout() to pass out multiple socket fd's, peer/local addresses,
and so forth.