xref: /freebsd/lib/libufs/cgread.3 (revision dce6e6518b85561495cff38a3074a69d29d58a55)
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 04, 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/types.h
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.Sh DESCRIPTION
33The
34.Fn cgread
35and
36.Fn cgread1
37functions provide cylinder group reads for
38.Xr libufs 3
39consumers.
40The
41.Fn cgread1
42function reads from one cylinder group, specified by
43.Fa c
44into the
45.Fa d_cg
46field of a userland UFS disk structure.
47It sets the
48.Fa d_lcg
49field to the cylinder group number
50.Fa c .
51.Pp
52The
53.Fn cgread
54function operates on sequential cylinder groups.
55Calling the
56.Fn cgread
57function is equivalent to calling
58.Nm cgread1
59with a cylinder group specifier equivalent to the value of the current
60.Fa d_ccg
61field, and then incrementing the
62.Fa d_ccg
63field.
64.Pp
65Both functions return 0 if there are no more cylinder groups to read,
661 if there are more cylinder groups, and -1 on error.
67.Sh ERRORS
68The function
69.Fn cgread
70may fail and set
71.Va errno
72for any of the errors specified for the library function
73.Xr bread 3 .
74.Pp
75The function
76.Fn cgread1
77has semantically identical failure conditions to those of
78.Fn cgread .
79.Sh SEE ALSO
80.Xr bread 3 ,
81.Xr libufs 3
82.Sh HISTORY
83These functions first appeared as part of
84.Xr libufs 3
85in
86.Fx 5.1 .
87.Sh AUTHORS
88.An Juli Mallett Aq jmallett@FreeBSD.org
89