Subject: Re: wsevent cleanup
To: Julio M. Merino Vidal <jmmv84@gmail.com>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 02/06/2006 17:34:37
  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-373096685-1139247277=:1894
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Mon, 6 Feb 2006, Julio M. Merino Vidal wrote:

> El 06/02/2006, a las 16:25, Iain Hibbert escribi=F3:
>
> > On Mon, 6 Feb 2006, Julio M. Merino Vidal wrote:
> > > struct wscons_event evt[N];
> > > ... fill evt with up to N events ...  (see below)
> > > error =3D wsevent_inject(evar, evt, N);
> > > if (error !=3D 0)
> > > =09queue is full
> >
> > what will happen if there are X spaces but N > X ?
>
> Sorry, the N in the call to wsevent_inject should be the number of
> events generated, not the maximum size of the vector.

actually, I meant than N to be the number of events to be injected and X
is an unknown (to the caller) number that is the number of spaces
currently available in the queue (neither do we know the max queue length)

> > Which errors can occur with wsevent_inject(), would it be easier to ret=
urn
> > the number of items actually queued and leave the caller to supply an
> > errno? (or simply pass '&num' ?)
>
> The only error that can occur is when the queue does not have enough
> free space.

My point then is that if you can only inject one event, the error meant
'No Space' whereas if you can push several at a time, it will mean 'Not
Enough Space for N' which is slightly different and somewhat vague, and it
might be useful to be more specific with 'I injected Y', similar to how
write(2) works..

iain
--0-373096685-1139247277=:1894--