diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-18 01:35:28 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-18 01:35:28 +0200 |
| commit | d62c625535494361b8ba0a004a1d24ce485f0b59 (patch) | |
| tree | a71299aa8fe70455663a9854ae26011691c0353b /include | |
| parent | c9c4f4cda362679567bc4bc04ffedc5d984e2329 (diff) | |
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 <rydberg@euromail.se>
Diffstat (limited to 'include')
| -rw-r--r-- | include/mtdev.h | 9 |
1 files changed, 5 insertions, 4 deletions
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); | |||
| 189 | * mtdev_pull - pull events from the kernel device | 189 | * mtdev_pull - pull events from the kernel device |
| 190 | * @dev: the mtdev in use | 190 | * @dev: the mtdev in use |
| 191 | * @fd: file descriptor of the kernel device | 191 | * @fd: file descriptor of the kernel device |
| 192 | * @max_events: max number of events to read | 192 | * @max_events: max number of events to read (zero for all) |
| 193 | * | 193 | * |
| 194 | * Read a maxmimum of max_events events from the device, and put them | 194 | * Read a maxmimum of max_events events from the device, and put them |
| 195 | * in the converter. The read operation behaves as dictated by the | 195 | * in the converter. If max_events is zero, all available events will |
| 196 | * file descriptior; if O_NONBLOCK is not set, the read will block | 196 | * be read. The read operation behaves as dictated by the file |
| 197 | * until max_events events are available or the buffer is full. | 197 | * descriptior; if O_NONBLOCK is not set, the read will block until |
| 198 | * max_events events are available or the buffer is full. | ||
| 198 | * | 199 | * |
| 199 | * On success, returns the number of events read. Otherwise, a standard | 200 | * On success, returns the number of events read. Otherwise, a standard |
| 200 | * negative error number is returned. | 201 | * negative error number is returned. |
