xref: /freebsd/lib/libufs/libufs.3 (revision 4b9d605768acabc460aa6dcfe8a1f8db35b16794)
1.\" Author:	Juli Mallett <jmallett@FreeBSD.org>
2.\" Date:	June 04, 2003
3.\" Description:
4.\" 	Manual page for libufs.
5.\"
6.\" This file is in the public domain.
7.\"
8.Dd September 2, 2020
9.Dt LIBUFS 3
10.Os
11.Sh NAME
12.Nm libufs
13.Nd operate on UFS file systems from userland
14.Sh LIBRARY
15.Lb libufs
16.Sh SYNOPSIS
17.In sys/param.h
18.In sys/mount.h
19.In ufs/ufs/ufsmount.h
20.In ufs/ufs/dinode.h
21.In ufs/ffs/fs.h
22.In libufs.h
23.Sh DESCRIPTION
24The
25.Nm
26library and the functions it provides are used for implementing
27utilities which need to access a UFS file system at a low level from
28userland.
29Facilities provided are used to implement utilities such as
30.Xr newfs 8
31and
32.Xr dumpfs 8 .
33The
34.Nm
35library is designed to be simple, and to provide functions that are
36traditionally useful to have.
37.Pp
38A disk is represented as the type
39.Vt "struct uufsd"
40as defined in
41.In libufs.h .
42The structure is filled out, operations are performed, and the disk
43is closed.
44.Sh ERRORS
45Functions provided by
46.Nm
47return \-1 in every functional error situation.
48They also set the
49.Va d_error
50field of
51.Vt "struct uufsd"
52to a string describing the error.
53.Sh SEE ALSO
54.Xr berase 3 ,
55.Xr bread 3 ,
56.Xr bwrite 3 ,
57.Xr cgget 3 ,
58.Xr cgput 3 ,
59.Xr cgread 3 ,
60.Xr cgread1 3 ,
61.Xr cgwrite 3 ,
62.Xr cgwrite1 3 ,
63.Xr getinode 3 ,
64.Xr putinode 3 ,
65.Xr sbget 3 ,
66.Xr sbput 3 ,
67.Xr sbread 3 ,
68.Xr sbwrite 3 ,
69.Xr ufs_disk_close 3 ,
70.Xr ufs_disk_fillout 3 ,
71.Xr ufs_disk_fillout_blank 3 ,
72.Xr ufs_disk_write 3 ,
73.Xr ffs 7
74.Sh HISTORY
75The
76.Xr libufs 3
77library first appeared in
78.Fx 5.0 .
79.Sh AUTHORS
80.An Juli Mallett Aq Mt jmallett@FreeBSD.org
81.An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org
82.Pp
83.An -nosplit
84Additional design, feedback, and ideas were provided by
85.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
86