1read_vtoc(3EXT) Extended Library Functions read_vtoc(3EXT)
2
3
4
6 read_vtoc, write_vtoc - read and write a disk's VTOC
7
9 cc [ flag ... ] file ... -ladm [ library ... ]
10 #include <sys/vtoc.h>
11
12 int read_vtoc(int fd, struct vtoc *vtoc);
13
14
15 int write_vtoc(int fd, struct vtoc *vtoc);
16
17
18 int read_extvtoc(int fd, struct extvtoc *extvtoc);
19
20
21 int write_extvtoc(int fd, struct extvtoc *extvtoc);
22
23
25 The read_vtoc() and read_extvtoc() functions return the VTOC (volume
26 table of contents) structure that is stored on the disk associated
27 with the open file descriptor fd. On disks larger than 1 TB read_extv‐
28 toc() must be used.
29
30
31 The write_vtoc() and write_extvtoc() function stores the VTOC structure
32 on the disk associated with the open file descriptor fd. On disks
33 larger then 1TB write_extvtoc() function must be used.
34
35
36 The fd argument refers to any slice on a raw disk.
37
39 Upon successful completion, read_vtoc() and read_extvtoc() return a
40 positive integer indicating the slice index associated with the open
41 file descriptor. Otherwise, they return a negative integer indicating
42 one of the following errors:
43
44 VT_EIO An I/O error occurred.
45
46
47 VT_ENOTSUP This operation is not supported on this disk.
48
49
50 VT_ERROR An unknown error occurred.
51
52
53 VT_OVERFLOW The caller attempted an operation that is illegal on the
54 disk and may overflow the fields in the data structure.
55
56
57
58 Upon successful completion, write_vtoc() and write_extvtoc() return 0.
59 Otherwise, they return a negative integer indicating one of the follow‐
60 ing errors:
61
62 VT_EINVAL The VTOC contains an incorrect field.
63
64
65 VT_EIO An I/O error occurred.
66
67
68 VT_ENOTSUP This operation is not supported on this disk.
69
70
71 VT_ERROR An unknown error occurred.
72
73
74 VT_OVERFLOW The caller attempted an operation that is illegal on the
75 disk and may overflow the fields in the data structure.
76
77
79 See attributes(5) for descriptions of the following attributes:
80
81
82
83
84 ┌─────────────────────────────┬─────────────────────────────┐
85 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
86 ├─────────────────────────────┼─────────────────────────────┤
87 │MT-Level │Unsafe │
88 └─────────────────────────────┴─────────────────────────────┘
89
91 fmthard(1M), format(1M), prtvtoc(1M), ioctl(2),
92 efi_alloc_and_init(3EXT), attributes(5), dkio(7I)
93
95 The write_vtoc() function cannot write a VTOC on an unlabeled disk.
96 Use format(1M) for this purpose.
97
98
99
100SunOS 5.11 7 Oct 2008 read_vtoc(3EXT)