summaryrefslogtreecommitdiffstats
path: root/lib/libufs/bread.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/bread.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/bread.3')
-rw-r--r--lib/libufs/bread.382
1 files changed, 82 insertions, 0 deletions
diff --git a/lib/libufs/bread.3 b/lib/libufs/bread.3
new file mode 100644
index 0000000..7b0f5a1
--- /dev/null
+++ b/lib/libufs/bread.3
@@ -0,0 +1,82 @@
+.\" Author: Juli Mallett <jmallett@FreeBSD.org>
+.\" Date: June 04, 2003
+.\" Description:
+.\" Manual page for libufs functions:
+.\" bread(3)
+.\" bwrite(3)
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 04, 2003
+.Dt BREAD 3
+.Os
+.Sh NAME
+.Nm bread , bwrite
+.Nd read and write blocks of a UFS filesystem
+.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 ssize_t
+.Fn bread "struct uufsd *disk" "ufs2_daddr_t blockno" "void *data" "size_t size"
+.Ft ssize_t
+.Fn bwrite "struct uufsd *disk" "ufs2_daddr_t blockno" "const void *data" "size_t size"
+.Sh DESCRIPTION
+The
+.Fn bread
+and
+.Fn bwrite
+functions provide a block read and write api for
+.Xr libufs 3
+consumers.
+They operate on a userland UFS disk structure, and perform the read
+and write at a given block address, which uses the current
+.Fa d_bsize
+value of the structure.
+.Pp
+The
+.Fn bread
+and
+.Fn bwrite
+functions return the amount written, or -1 in case of any error,
+including short read.
+.Sh ERRORS
+The function
+.Fn bread
+may fail and set
+.Va errno
+for any of the errors specified for the library functions
+.Xr ufs_disk_write
+or
+.Xr pread 2 .
+Additionally, it may follow the
+.Xr libufs 3
+error methodologies in situations where the amount of data read
+is not equal to the amount requested, or in case of device error.
+.Pp
+The function
+.Fn bwrite
+may fail and set
+.Va errno
+for any of the errors specified for the library function
+.Xr pwrite 2 .
+Additionally, it may follow the
+.Xr libufs 3
+error methodologies in situations where the amount of data written
+is not equal to the amount requested, or in case of a device error.
+.Sh SEE ALSO
+.Xr libufs 3 ,
+.Xr ufs_disk_write 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