NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO | BUGS
#include <sys/vtoc.h> cc [ flag ... ] file ... -ladm [ library ... ]int read_vtoc(int fd, struct vtoc *vtoc);
read_vtoc() returns the VTOC (volume table of contents) structure that is stored on the disk associated with the open file descriptor fd.
write_vtoc() stores the VTOC structure on the disk associated with the open file descriptor fd.
fd refers to any slice on a raw disk.
read_vtoc returns:
Success. The positive number is the slice index associated with the open file descriptor.
There are two possible error returns. VT_EIO indicates an I/O error occurred and VT_ERROR indicates an unknown error.
write_vtoc returns:
Success
There are three possible error returns. VT_EIO indicates an I/O error occurred, VT_ERROR indicates an unknown error, and VT_EINVAL indicates an incorrect field within the VTOC.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
MT-Level | Unsafe |
write_vtoc cannot write a VTOC on an unlabeled disk. Use format(1M) for this purpose.
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO | BUGS