]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/libufs/cgread.3
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / lib / libufs / cgread.3
1 .\" Author:     Juli Mallett <jmallett@FreeBSD.org>
2 .\" Date:       June 04, 2003
3 .\" Description:
4 .\"     Manual page for libufs functions:
5 .\"             cgread(3)
6 .\"             cgread1(3)
7 .\"             cgwrite1(3)
8 .\"
9 .\" This file is in the public domain.
10 .\"
11 .\" $FreeBSD$
12 .\"
13 .Dd June 4, 2003
14 .Dt CGREAD 3
15 .Os
16 .Sh NAME
17 .Nm cgread , cgread1, cgwrite1
18 .Nd read/write cylinder groups of UFS disks
19 .Sh LIBRARY
20 .Lb libufs
21 .Sh SYNOPSIS
22 .In sys/param.h
23 .In sys/mount.h
24 .In ufs/ufs/ufsmount.h
25 .In ufs/ufs/dinode.h
26 .In ufs/ffs/fs.h
27 .In libufs.h
28 .Ft int
29 .Fn cgread "struct uufsd *disk"
30 .Ft int
31 .Fn cgread1 "struct uufsd *disk" "int c"
32 .Ft int
33 .Fn cgwrite1 "struct uufsd *disk" "int c"
34 .Sh DESCRIPTION
35 The
36 .Fn cgread
37 and
38 .Fn cgread1
39 functions provide cylinder group reads for
40 .Xr libufs 3
41 consumers.
42 The
43 .Fn cgread1
44 function reads from one cylinder group, specified by
45 .Fa c
46 into the
47 .Va d_cg
48 field of a userland UFS disk structure.
49 It sets the
50 .Va d_lcg
51 field to the cylinder group number
52 .Fa c .
53 .Pp
54 The
55 .Fn cgread
56 function operates on sequential cylinder groups.
57 Calling the
58 .Fn cgread
59 function is equivalent to calling
60 .Fn cgread1
61 with a cylinder group specifier equivalent to the value of the current
62 .Va d_ccg
63 field, and then incrementing the
64 .Va d_ccg
65 field.
66 .Pp
67 The
68 .Fn cgwrite1
69 function stores cylinder group specified by
70 .Fa c
71 from
72 .Va d_cg
73 field of a userland UFS disk structure on disk.
74 .Sh RETURN VALUES
75 Both functions return 0 if there are no more cylinder groups to read,
76 1 if there are more cylinder groups, and \-1 on error.
77 .Sh ERRORS
78 The function
79 .Fn cgread
80 may fail and set
81 .Va errno
82 for any of the errors specified for the library function
83 .Xr bread 3 .
84 .Pp
85 The function
86 .Fn cgread1
87 has semantically identical failure conditions to those of
88 .Fn cgread .
89 .Pp
90 The function
91 .Fn cgwrite1
92 may fail and set
93 .Va errno
94 for any of the errors specified for the library function
95 .Xr bwrite 3 .
96 .Sh SEE ALSO
97 .Xr bread 3 ,
98 .Xr bwrite 3 ,
99 .Xr libufs 3
100 .Sh HISTORY
101 These functions first appeared as part of
102 .Xr libufs 3
103 in
104 .Fx 5.1 .
105 .Sh AUTHORS
106 .An Juli Mallett Aq jmallett@FreeBSD.org