summaryrefslogtreecommitdiffstats
path: root/lib/libufs/ufs_disk_close.3
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2003-06-09 09:59:11 +0000
committerjmallett <jmallett@FreeBSD.org>2003-06-09 09:59:11 +0000
commit6cf3ba132390f49a24daa302ebcecc3c1691f193 (patch)
treed7c238a4f5e53bb14563252800a4324fc9de5890 /lib/libufs/ufs_disk_close.3
parent088f7e9d08bf2f78cbd0cb856ac83430912505d0 (diff)
downloadFreeBSD-src-6cf3ba132390f49a24daa302ebcecc3c1691f193.zip
FreeBSD-src-6cf3ba132390f49a24daa302ebcecc3c1691f193.tar.gz
Commit rudimentary libufs manual pages, except for that for
getino(3)/putino(3), inode.c has been reworked in Perforce to the point where a manual page may not be accurate. Certainly putino(3) has not even been merged back yet. These will need a lot of improvement for most applications, but they document the API enough to get someone on their feet, most likely. The best documentation still exists in the form of libufs(3) consumers in the base system.
Diffstat (limited to 'lib/libufs/ufs_disk_close.3')
-rw-r--r--lib/libufs/ufs_disk_close.3111
1 files changed, 111 insertions, 0 deletions
diff --git a/lib/libufs/ufs_disk_close.3 b/lib/libufs/ufs_disk_close.3
new file mode 100644
index 0000000..bda8db5
--- /dev/null
+++ b/lib/libufs/ufs_disk_close.3
@@ -0,0 +1,111 @@
+.\" Author: Juli Mallett <jmallett@FreeBSD.org>
+.\" Date: June 04, 2003
+.\" Description:
+.\" Manual page for libufs functions:
+.\" ufs_disk_close(3)
+.\" ufs_disk_fillout(3)
+.\" ufs_disk_fillout_blank(3)
+.\" ufs_disk_write(3)
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 04, 2003
+.Dt UFS_DISK_CLOSE 3
+.Os
+.Sh NAME
+.Nm ufs_disk_close , ufs_disk_fillout , ufs_disk_fillout_blank, ufs_disk_write
+.Nd open and close userland UFS disks
+.Sh LIBRARY
+.Lb libufs
+.Sh SYNOPSIS
+.In sys/types.h
+.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
+.Ft int
+.Fn ufs_disk_close "struct uufsd *disk"
+.Ft int
+.Fn ufs_disk_fillout "struct uufsd *disk" "const char *name"
+.Ft int
+.Fn ufs_disk_fillout_blank "struct uufsd *disk" "const char *name"
+.Ft int
+.Fn ufs_disk_write "struct uufsd *disk"
+.Sh DESCRIPTION
+The
+.Fn ufs_disk_close
+function closes a disk and frees internal memory related to it.
+It does not free the
+.Fa disk
+structure.
+.Pp
+The
+.Fn ufs_disk_fillout
+and
+.Fn ufs_disk_fillout_blank
+functions open a disk specified by
+.Fa name
+and populate the structure pointed to by
+.Fa disk .
+The disk is opened read-only.
+The specified
+.Fa name
+may be either a mountpoint, or a device name.
+The
+.Fn ufs_disk_fillout
+function assumes there is a valid superblock and will fail if not,
+whereas the
+.Fn ufs_disk_fillout_blank
+function makes no assumptions of that sort.
+.Pp
+The
+.Fn ufs_disk_write
+function attempts to re-open a disk as writable if it is not currently.
+.Sh ERRORS
+The function
+.Fn ufs_disk_close
+has no failure points.
+.Pp
+The function
+.Fn ufs_disk_fillout
+may fail for any of the reasons
+.Fn ufs_disk_fillout_blank
+might, as well as for any reason
+.Xr sbread 3
+might.
+.Pp
+The
+.Fn ufs_disk_fillout_blank
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr open 2 ,
+.Xr strdup 3
+Additionally, it may follow the
+.Xr libufs 3
+error methodologies in situations where no device could be found to
+open.
+.Pp
+The function
+.Fn ufs_disk_write
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr open 3
+and
+.Xr stat 3 .
+Namely, it will fail if the disk in question may not be written to.
+.Sh SEE ALSO
+.Xr getfsfile 3 ,
+.Xr libufs 3 ,
+.Xr open 3 ,
+.Xr sbread 3
+.Sh HISTORY
+These functions first appeared as part of
+.Xr libufs 3
+in
+.Fx 5.0 .
+.Sh AUTHORS
+.An Juli Mallett Aq jmallett@FreeBSD.org
OpenPOWER on IntegriCloud