xref: /freebsd/lib/libufs/sbread.3 (revision 7660b554bc59a07be0431c17e0e33815818baa69)
1.\" Author:	Juli Mallett <jmallett@FreeBSD.org>
2.\" Date:	June 04, 2003
3.\" Description:
4.\" 	Manual page for libufs functions:
5.\"		sbread(3)
6.\"		sbwrite(3)
7.\"
8.\" This file is in the public domain.
9.\"
10.\" $FreeBSD$
11.\"
12.Dd June 04, 2003
13.Dt SBREAD 3
14.Os
15.Sh NAME
16.Nm sbread , sbwrite
17.Nd read and write superblocks of a UFS filesystem
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 sbread "struct uufsd *disk"
30.Ft int
31.Fn sbwrite "struct uufsd *disk" "int all"
32.Sh DESCRIPTION
33The
34.Fn sbread
35and
36.Fn sbwrite
37functions provide superblock reads and writes for
38.Xr libufs 3
39consumers.
40The
41.Fn sbread
42and
43.Fn sbwrite
44functions operate on the superblock field,
45.Fa d_sb ,
46associated with a given userland UFS disk structure.
47Additionally, the
48.Fn sbwrite
49function will write to all superblock locations if the
50.Fa all
51value is non-zero.
52.Pp
53The
54.Fn sbread
55and
56.Fn sbwrite
57functions return 0 on success or -1 on error.
58.Sh ERRORS
59The function
60.Fn sbread
61may fail and set
62.Va errno
63for any of the errors specified for the library function
64.Xr bread 3 .
65Additionally, it may follow the
66.Xr libufs 3
67error methodologies in situations where no usable superblock could be
68found.
69.Pp
70The function
71.Fn sbwrite
72may fail and set
73.Va errno
74for any of the errors specified for the library function
75.Xr bwrite 3 .
76.Sh SEE ALSO
77.Xr bread 3 ,
78.Xr bwrite 3 ,
79.Xr libufs 3
80.Sh HISTORY
81These functions first appeared as part of
82.Xr libufs 3
83in
84.Fx 5.0 .
85.Sh AUTHORS
86.An Juli Mallett Aq jmallett@FreeBSD.org
87