cdev_input_receive()

Read available data from host device into a user-provided buffer

Synopsis:

#include <qvm/cdev.h>
int cdev_input_receive(struct cdev_state *cds,
                       void *dst,
                       unsigned len)

Arguments:

cds
A pointer to a structure with the state of the character device.
dst
A pointer to the user-provided destination buffer.
len
The length of the buffer, in bytes.

Library:

Provided by qvm; no external library is required.

Description:

Use this function if you are managing your own input and output buffers (see cdev_setup()). Calling this static inline function makes sense only if you are using the internal buffers (non-zero buffer size when calling cdev_setup()).

Returns:

If successful, the number of characters read; otherwise, a negative errno value.