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