|
Extended Library Functions | read_vtoc(3EXT) |
| read_vtoc, write_vtoc - read and write a disk's VTOC |
SYNOPSIS
|
cc [ flag ... ] file ... -ladm [ library ... ]
#include <sys/vtoc.h> int read_vtoc(int fd, struct vtoc *vtoc); |
| int write_vtoc(int fd, struct vtoc *vtoc); |
|
The read_vtoc() function returns the VTOC (volume table of contents) structure that is stored on the disk associated with the open file descriptor fd.
The write_vtoc() function stores the VTOC structure on the disk associated with the open file descriptor fd.
The fd argument refers to any slice on a raw disk.
|
|
Upon successful completion, read_vtoc() returns a positive number indicating the slice index associated with the open file descriptor. Otherwise, it returns a negative number indicating
one of the following errors:
-
VT_EIO
- An I/O error occurred.
-
VT_ERROR
- An unknown error occurred.
Upon successful completion, write_vtoc() returns 0. Otherwise, it returns a negative number indicating one of the following errors:
-
VT_EIO
- An I/O error occurred.
-
VT_ERROR
- An unknown error occurred.
-
VT_EINVAL
- The VTOC contains an incorrect field.
|
|
See attributes(5) for descriptions of the following
attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
MT-Level | Unsafe |
|
|
The write_vtoc() function cannot write a VTOC on an unlabeled disk. Use format(1M) for this purpose.
|
| |