vdev_get_path()
Fill in a buffer with a path identifying a vdev
Synopsis:
#include <qvm/vdev-core.h>int vdev_get_path(const vdev_t *vdp,
char *buf,
size_t size)Arguments:
- vdp
- A pointer to the vdev for which a path must be obtained.
- buf
- A pointer to an output buffer. This can be NULL if you want to learn the required buffer size.
- size
- The size of the buffer referenced by buf, in bytes. This can be zero if buf is NULL.
Description:
This function fills in the given buffer with a string of up to PATH_MAX bytes that contains a path that identifies the given vdev. The buf and size arguments are passed to snprintf().
Returns:
If buf was not NULL, the number of characters that would have been written into the array, not counting the NULL terminator, had size been large enough. If the return value is equal to or greater than size, the string has been truncated. If buf was NULL, the returned value is the buffer size required to store the vdev path.
If an error occurred, a negative value is returned and errno is set.
Page updated:
