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