]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libufs/ufs_disk_close.3
unbound: Vendor import 1.18.0
[FreeBSD/FreeBSD.git] / lib / libufs / ufs_disk_close.3
1 .\" Author:     Juli Mallett <jmallett@FreeBSD.org>
2 .\" Date:       June 04, 2003
3 .\" Description:
4 .\"     Manual page for libufs functions:
5 .\"             ufs_disk_close(3)
6 .\"             ufs_disk_fillout(3)
7 .\"             ufs_disk_fillout_blank(3)
8 .\"             ufs_disk_write(3)
9 .\"
10 .\" This file is in the public domain.
11 .\"
12 .Dd June 4, 2003
13 .Dt UFS_DISK_CLOSE 3
14 .Os
15 .Sh NAME
16 .Nm ufs_disk_close ,
17 .Nm ufs_disk_fillout ,
18 .Nm ufs_disk_fillout_blank ,
19 .Nm ufs_disk_write
20 .Nd open and close userland UFS disks
21 .Sh LIBRARY
22 .Lb libufs
23 .Sh SYNOPSIS
24 .In sys/param.h
25 .In sys/mount.h
26 .In ufs/ufs/ufsmount.h
27 .In ufs/ufs/dinode.h
28 .In ufs/ffs/fs.h
29 .In libufs.h
30 .Ft int
31 .Fn ufs_disk_close "struct uufsd *disk"
32 .Ft int
33 .Fn ufs_disk_fillout "struct uufsd *disk" "const char *name"
34 .Ft int
35 .Fn ufs_disk_fillout_blank "struct uufsd *disk" "const char *name"
36 .Ft int
37 .Fn ufs_disk_write "struct uufsd *disk"
38 .Sh DESCRIPTION
39 The
40 .Fn ufs_disk_close
41 function closes a disk and frees internal memory related to it.
42 It does not free the
43 .Fa disk
44 structure.
45 .Pp
46 The
47 .Fn ufs_disk_fillout
48 and
49 .Fn ufs_disk_fillout_blank
50 functions open a disk specified by
51 .Fa name
52 and populate the structure pointed to by
53 .Fa disk .
54 The disk is opened read-only.
55 The specified
56 .Fa name
57 may be either a mountpoint, a device name or a filesystem image.
58 The
59 .Fn ufs_disk_fillout
60 function assumes there is a valid superblock and will fail if not,
61 whereas the
62 .Fn ufs_disk_fillout_blank
63 function makes no assumptions of that sort.
64 .Pp
65 The
66 .Fn ufs_disk_write
67 function attempts to re-open a disk as writable if it is not currently.
68 .Sh ERRORS
69 The function
70 .Fn ufs_disk_close
71 has no failure points.
72 .Pp
73 The function
74 .Fn ufs_disk_fillout
75 may fail for any of the reasons
76 .Fn ufs_disk_fillout_blank
77 might, as well as for any reason
78 .Xr sbread 3
79 might.
80 .Pp
81 The
82 .Fn ufs_disk_fillout_blank
83 may fail and set
84 .Va errno
85 for any of the errors specified for the library functions
86 .Xr open 2 ,
87 .Xr strdup 3 .
88 Additionally, it may follow the
89 .Xr libufs 3
90 error methodologies in situations where no device could be found to
91 open.
92 .Pp
93 The function
94 .Fn ufs_disk_write
95 may fail and set
96 .Va errno
97 for any of the errors specified for the library functions
98 .Xr open 2
99 and
100 .Xr stat 2 .
101 Namely, it will fail if the disk in question may not be written to.
102 .Sh SEE ALSO
103 .Xr open 2 ,
104 .Xr getfsfile 3 ,
105 .Xr libufs 3 ,
106 .Xr sbread 3
107 .Sh HISTORY
108 These functions first appeared as part of
109 .Xr libufs 3
110 in
111 .Fx 5.0 .
112 .Sh AUTHORS
113 .An Juli Mallett Aq Mt jmallett@FreeBSD.org