read_vtoc(3X)
NAME
read_vtoc, write_vtoc − read and write a disk’s VTOC
SYNOPSIS
#include <sys/vtoc.h>
cc [ flag ... ] file ... −ladm [ library ... ]
int read_vtoc(int fd, struct vtoc ∗vtoc);
int write_vtoc(int fd, struct vtoc ∗vtoc);
MT-LEVEL
Unsafe
DESCRIPTION
read_vtoc() returns the VTOC structure that is stored on the disk associated with the open file descriptor fd.
write_vtoc() stores the VTOC structure on at disk associated with the open file descriptor fd.
fd refers to any slice on a raw disk.
RETURN VALUES
read_vtoc returns:
positive number Success. The positive number is the slice index associated with the open file descriptor.
negative number There are two possible error returns. VT_EIO indicates an I/O error occurred and VT_ERROR indicates an unknown error.
write_vtoc returns:
0 Success
negative number 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 ALSO
format(1M), fmthard(1M), prtvtoc(1M), ioctl(2), dkio(7I)
BUGS
write_vtoc cannot write a VTOC on an unlabeled disk. Use format(1M) for this purpose.
SunOS 5.5.1 — Last change: 22 Jan 1993