summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2017-09-10 20:13:20 +0000
committerian <ian@FreeBSD.org>2017-09-10 20:13:20 +0000
commitf88ee4b7126253730dd421d403ec3cbd99582544 (patch)
tree6b384ef98eeab88a3af12c80c1e798ed748e1f27 /share/man/man9
parente8793ba6396fed6605372cc86cc51be1fa885485 (diff)
downloadFreeBSD-src-f88ee4b7126253730dd421d403ec3cbd99582544.zip
FreeBSD-src-f88ee4b7126253730dd421d403ec3cbd99582544.tar.gz
MFC r315089: Document uiomove_frombuf(9).
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile1
-rw-r--r--share/man/man9/uio.928
2 files changed, 26 insertions, 3 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index b49d54e..1287bc4 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1791,6 +1791,7 @@ MLINKS+=uidinfo.9 uifind.9 \
uidinfo.9 uihashinit.9 \
uidinfo.9 uihold.9
MLINKS+=uio.9 uiomove.9 \
+ uio.9 uiomove_frombuf.9 \
uio.9 uiomove_nofault.9
.if ${MK_USB} != "no"
diff --git a/share/man/man9/uio.9 b/share/man/man9/uio.9
index fd66e3d..51cf8cf 100644
--- a/share/man/man9/uio.9
+++ b/share/man/man9/uio.9
@@ -25,12 +25,13 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 19, 2012
+.Dd March 11, 2017
.Dt UIO 9
.Os
.Sh NAME
.Nm uio ,
.Nm uiomove ,
+.Nm uiomove_frombuf ,
.Nm uiomove_nofault
.Nd device driver I/O routines
.Sh SYNOPSIS
@@ -50,10 +51,13 @@ struct uio {
.Ft int
.Fn uiomove "void *buf" "int howmuch" "struct uio *uiop"
.Ft int
+.Fn uiomove_frombuf "void *buf" "int howmuch" "struct uio *uiop"
+.Ft int
.Fn uiomove_nofault "void *buf" "int howmuch" "struct uio *uiop"
.Sh DESCRIPTION
The functions
-.Fn uiomove
+.Fn uiomove ,
+.Fn uiomove_frombuf ,
and
.Fn uiomove_nofault
are used to transfer data between buffers and I/O vectors that might
@@ -129,9 +133,27 @@ Thus, the function
.Fn uiomove_nofault
can be called from contexts where acquiring virtual memory system
locks or sleeping are prohibited.
+.Pp
+The
+.Fn uiomove_frombuf
+function is a convenience wrapper around
+.Fn uiomove
+for drivers that serve data which is wholly contained within an
+existing buffer in memory.
+It validates the
+.Va uio_offset
+and
+.Va uio_resid
+values against the size of the existing buffer, handling short
+transfers when the request partially overlaps the buffer.
+When
+.Va uio_offset
+is greater than or equal to the buffer size, the result is success
+with no bytes transfered, effectively signaling EOF.
.Sh RETURN VALUES
On success
-.Fn uiomove
+.Fn uiomove ,
+.Fn uiomove_frombuf ,
and
.Fn uiomove_nofault
will return 0; on error they will return an appropriate error code.
OpenPOWER on IntegriCloud