cdev_read()

Transfer available data from the internal input buffer to a user-provided buffer

Synopsis:

#include <qvm/cdev.h>
int cdev_read(struct cdev_state *cds,
              uint8_t *data,
              unsigned len)

Arguments:

cds
A pointer to a structure with the state of the character device.
data
A pointer to your buffer, which will receive the data.
len
The number of bytes available in the buffer.

Library:

Provided by qvm; no external library is required.

Description:

Use this function to read data from an internal buffer and put it in your own buffer.

Returns:

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