2003-06-09 09:59:11 +00:00
|
|
|
.\" Author: Juli Mallett <jmallett@FreeBSD.org>
|
|
|
|
.\" Date: June 04, 2003
|
|
|
|
.\" Description:
|
|
|
|
.\" Manual page for libufs functions:
|
|
|
|
.\" cgread(3)
|
|
|
|
.\" cgread1(3)
|
2006-10-31 21:21:48 +00:00
|
|
|
.\" cgwrite1(3)
|
2003-06-09 09:59:11 +00:00
|
|
|
.\"
|
2003-06-10 18:24:40 +00:00
|
|
|
.\" This file is in the public domain.
|
|
|
|
.\"
|
2003-06-09 09:59:11 +00:00
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2004-07-02 18:00:03 +00:00
|
|
|
.Dd June 4, 2003
|
2003-06-09 09:59:11 +00:00
|
|
|
.Dt CGREAD 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
2006-10-31 21:21:48 +00:00
|
|
|
.Nm cgread , cgread1, cgwrite1
|
|
|
|
.Nd read/write cylinder groups of UFS disks
|
2003-06-09 09:59:11 +00:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libufs
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/param.h
|
|
|
|
.In sys/mount.h
|
|
|
|
.In ufs/ufs/ufsmount.h
|
|
|
|
.In ufs/ufs/dinode.h
|
|
|
|
.In ufs/ffs/fs.h
|
|
|
|
.In libufs.h
|
|
|
|
.Ft int
|
|
|
|
.Fn cgread "struct uufsd *disk"
|
|
|
|
.Ft int
|
|
|
|
.Fn cgread1 "struct uufsd *disk" "int c"
|
2006-10-31 21:21:48 +00:00
|
|
|
.Ft int
|
|
|
|
.Fn cgwrite1 "struct uufsd *disk" "int c"
|
2003-06-09 09:59:11 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn cgread
|
|
|
|
and
|
|
|
|
.Fn cgread1
|
|
|
|
functions provide cylinder group reads for
|
|
|
|
.Xr libufs 3
|
|
|
|
consumers.
|
|
|
|
The
|
|
|
|
.Fn cgread1
|
|
|
|
function reads from one cylinder group, specified by
|
|
|
|
.Fa c
|
|
|
|
into the
|
2004-07-05 06:53:34 +00:00
|
|
|
.Va d_cg
|
2003-06-09 09:59:11 +00:00
|
|
|
field of a userland UFS disk structure.
|
|
|
|
It sets the
|
2004-07-05 06:53:34 +00:00
|
|
|
.Va d_lcg
|
2003-06-10 18:36:16 +00:00
|
|
|
field to the cylinder group number
|
2003-06-09 09:59:11 +00:00
|
|
|
.Fa c .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn cgread
|
|
|
|
function operates on sequential cylinder groups.
|
|
|
|
Calling the
|
|
|
|
.Fn cgread
|
|
|
|
function is equivalent to calling
|
2004-07-05 06:53:34 +00:00
|
|
|
.Fn cgread1
|
2003-06-09 09:59:11 +00:00
|
|
|
with a cylinder group specifier equivalent to the value of the current
|
2004-07-05 06:53:34 +00:00
|
|
|
.Va d_ccg
|
2003-06-09 09:59:11 +00:00
|
|
|
field, and then incrementing the
|
2004-07-05 06:53:34 +00:00
|
|
|
.Va d_ccg
|
2003-06-09 09:59:11 +00:00
|
|
|
field.
|
2006-10-31 21:21:48 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fn cgwrite1
|
|
|
|
function stores cylinder group specified by
|
|
|
|
.Fa c
|
|
|
|
from
|
|
|
|
.Va d_cg
|
|
|
|
field of a userland UFS disk structure on disk.
|
2004-07-05 06:53:34 +00:00
|
|
|
.Sh RETURN VALUES
|
2003-06-09 09:59:11 +00:00
|
|
|
Both functions return 0 if there are no more cylinder groups to read,
|
2004-07-05 06:53:34 +00:00
|
|
|
1 if there are more cylinder groups, and \-1 on error.
|
2003-06-09 09:59:11 +00:00
|
|
|
.Sh ERRORS
|
|
|
|
The function
|
|
|
|
.Fn cgread
|
|
|
|
may fail and set
|
|
|
|
.Va errno
|
|
|
|
for any of the errors specified for the library function
|
|
|
|
.Xr bread 3 .
|
|
|
|
.Pp
|
|
|
|
The function
|
|
|
|
.Fn cgread1
|
|
|
|
has semantically identical failure conditions to those of
|
|
|
|
.Fn cgread .
|
2006-10-31 21:21:48 +00:00
|
|
|
.Pp
|
|
|
|
The function
|
|
|
|
.Fn cgwrite1
|
|
|
|
may fail and set
|
|
|
|
.Va errno
|
|
|
|
for any of the errors specified for the library function
|
|
|
|
.Xr bwrite 3 .
|
2003-06-09 09:59:11 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr bread 3 ,
|
2006-10-31 21:21:48 +00:00
|
|
|
.Xr bwrite 3 ,
|
2003-06-09 09:59:11 +00:00
|
|
|
.Xr libufs 3
|
|
|
|
.Sh HISTORY
|
|
|
|
These functions first appeared as part of
|
|
|
|
.Xr libufs 3
|
|
|
|
in
|
|
|
|
.Fx 5.1 .
|
|
|
|
.Sh AUTHORS
|
|
|
|
.An Juli Mallett Aq jmallett@FreeBSD.org
|