cdev_setup()

Complete the setup for a character device's state structure

Synopsis:

#include <qvm/cdev.h>
int cdev_setup(struct cdev_state *cds,
               struct vdev_s *vdev,
               unsigned size)

Arguments:

cds
A pointer to a structure with the state of the character device.
vdev
A pointer to the vdev using this state.
size
The size, in bytes, of the input and output buffers.

Library:

Provided by qvm; no external library is required.

Description:

This function allocates both the input and output buffers; and makes them both the size you specify in size. If you want to provide your own input and output buffers, set size to 0 (zero).

Returns:

EOK on success; otherwise an errno value.