[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    read_vtoc(3X) manual page Table of Contents

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:
  1. 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.


Table of Contents