Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Extended Library Functionsread_vtoc(3EXT)


NAME

 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);

DESCRIPTION

 

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.

RETURN VALUES

 

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.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelUnsafe

SEE ALSO

 

fmthard(1M), format(1M), prtvtoc(1M), ioctl(2), attributes(5), dkio(7I)

BUGS

 

The write_vtoc() function cannot write a VTOC on an unlabeled disk. Use format(1M) for this purpose.


SunOS 5.9Go To TopLast Changed 11 Feb 1999

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.