xref: /freebsd/lib/libufs/libufs.3 (revision eb69d1f144a6fcc765d1b9d44a5ae8082353e70b)
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 January 19, 2018
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 bread 3 ,
57.Xr bwrite 3 ,
58.Xr cgget 3 ,
59.Xr cgput 3 ,
60.Xr cgread 3 ,
61.Xr cgread1 3 ,
62.Xr cgwrite 3 ,
63.Xr cgwrite1 3 ,
64.Xr sbread 3 ,
65.Xr sbwrite 3 ,
66.Xr ufs_disk_close 3 ,
67.Xr ufs_disk_fillout 3 ,
68.Xr ufs_disk_fillout_blank 3 ,
69.Xr ufs_disk_write 3 ,
70.Xr ffs 7
71.Sh HISTORY
72The
73.Xr libufs 3
74library first appeared in
75.Fx 5.0 .
76.Sh AUTHORS
77.An Juli Mallett Aq Mt jmallett@FreeBSD.org
78.Pp
79.An -nosplit
80Additional design, feedback, and ideas were provided by
81.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
82