vdev_get_name()
Build a human-readable name for a vdev
Synopsis:
#include <qvm/vdev-core.h>int vdev_get_name(char* buf,
size_t count,
const vdev_t* vdp)Arguments:
- buf
- A pointer to a buffer for storing the name. This can be NULL if you want to learn the required buffer size.
- count
- The size of the buffer referenced by buf, in bytes. This can be zero if buf is NULL.
- vdp
- A pointer to the vdev for which a name must be obtained.
Description:
This function fills in the given buffer with a string that contains a human-readable name for the given vdev. The buf and count arguments are passed to snprintf().
Returns:
If buf was not NULL, the length of the name written into its space, in bytes. If buf was NULL, the buffer size required to store the name.
If an error occurred, a negative value is returned and errno is set.
Page updated:
