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 15:25:54
On Mon, 6 Feb 2006, Julio M. Merino Vidal wrote:

> This is a good idea too, and it may be better for what I have in mind
> because I'd locally construct all the events and then simply call
> the function to add them at once.  Something like:
>
> struct wscons_event evt[N];
> ... fill evt with up to N events ...  (see below)
> error = wsevent_inject(evar, evt, N);
> if (error != 0)
> 	queue is full

what will happen if there are X spaces but N > X ?

Which errors can occur with wsevent_inject(), would it be easier to return
the number of items actually queued and leave the caller to supply an
errno? (or simply pass '&num' ?)

Incidentally, will ioctl(WSMUXIO_INJECTEVENT) be affected by this?  I ask
because Bluetooth HID devices are on my list (should be getting some
hardware soon) and was intending to use this method to inject events from
a userland daemon - combining events could be a big win in such a case.

iain