1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
.\" Author: Juli Mallett <jmallett@FreeBSD.org>
.\" Date: June 04, 2003
.\" Description:
.\" Manual page for libufs.
.\"
.\" This file is in the public domain.
.\"
.\" $FreeBSD$
.\"
.Dd June 04, 2003
.Dt LIBUFS 3
.Os
.Sh NAME
.Nm libufs
.Nd operate on UFS filesystems from userland
.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
.Sh DESCRIPTION
The
.Nm
library and the functions it provides are used for implementing
utilities which need to access a UFS filesystem at a low level from
userland.
Facilities provided are used to implement utilities such as
.Xr newfs 8
and
.Xr dumpfs 8 .
The
.Nm
library is designed to be simple, and to provide functions that are
traditionally useful to have.
.Pp
A disk is represented as the type
.Dq struct uufsd
as defined in
.Pa libufs.h .
The structure is filled out, operations are performed, and the disk
is closed.
.Sh ERRORS
Functions provided by
.Nm
return -1 in every functional error situation.
They also set the
.Fa d_error
field of
.Dq struct uufsd
to a string describing the error.
.Sh SEE ALSO
.Xr bread 3 ,
.Xr bwrite 3 ,
.Xr cgread 3 ,
.Xr cgread1 3 ,
.Xr sbread 3 ,
.Xr sbwrite 3 ,
.Xr ufs_disk_close 3 ,
.Xr ufs_disk_fillout 3 ,
.Xr ufs_disk_fillout_blank 3 ,
.Xr ufs_disk_write 3 ,
.Xr ffs 7 .
.Sh HISTORY
The
.Xr libufs 3
library first appeared in
.Fx 5.0 .
.Sh AUTHORS
.An Juli Mallett Aq jmallett@FreeBSD.org
.Pp
Additional design, feedback, and ideas were provided by
.An Poul-Henning Kamp Aq phk@FreeBSD.org .
|