From d62c625535494361b8ba0a004a1d24ce485f0b59 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Fri, 18 Jun 2010 01:35:28 +0200 Subject: Allow max_events to be zero in mtdev_pull() When reading from non-blocking devices, it makes sense to read all events available. This patch lets a zero max_events achieve that. Signed-off-by: Henrik Rydberg --- include/mtdev.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/mtdev.h') diff --git a/include/mtdev.h b/include/mtdev.h index abb76da..7d442f1 100644 --- a/include/mtdev.h +++ b/include/mtdev.h @@ -189,12 +189,13 @@ void mtdev_put(struct mtdev *dev, const struct input_event *ev); * mtdev_pull - pull events from the kernel device * @dev: the mtdev in use * @fd: file descriptor of the kernel device - * @max_events: max number of events to read + * @max_events: max number of events to read (zero for all) * * Read a maxmimum of max_events events from the device, and put them - * in the converter. The read operation behaves as dictated by the - * file descriptior; if O_NONBLOCK is not set, the read will block - * until max_events events are available or the buffer is full. + * in the converter. If max_events is zero, all available events will + * be read. The read operation behaves as dictated by the file + * descriptior; if O_NONBLOCK is not set, the read will block until + * max_events events are available or the buffer is full. * * On success, returns the number of events read. Otherwise, a standard * negative error number is returned. -- cgit v1.2.3