summaryrefslogtreecommitdiffstats
path: root/share/man/man9/copy.9
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-07-09 15:24:12 +0000
committerkib <kib@FreeBSD.org>2011-07-09 15:24:12 +0000
commit350f61d08c3e36bdfd80a728db93fc050e1b3100 (patch)
tree4a56fad356340a4c5dcf477b8665ef824416d4af /share/man/man9/copy.9
parent61e3fec296fa6c27ba164bba06c2773c8f52d5ae (diff)
downloadFreeBSD-src-350f61d08c3e36bdfd80a728db93fc050e1b3100.zip
FreeBSD-src-350f61d08c3e36bdfd80a728db93fc050e1b3100.tar.gz
Document copyin_nofault, copyout_nofault, uiomove_nofault.
Submitted by: alc
Diffstat (limited to 'share/man/man9/copy.9')
-rw-r--r--share/man/man9/copy.956
1 files changed, 42 insertions, 14 deletions
diff --git a/share/man/man9/copy.9 b/share/man/man9/copy.9
index b6b975f..37c7a0c 100644
--- a/share/man/man9/copy.9
+++ b/share/man/man9/copy.9
@@ -34,13 +34,15 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 7, 1996
+.Dd July 9, 2011
.Dt COPY 9
.Os
.Sh NAME
.Nm copy ,
.Nm copyin ,
+.Nm copyin_nofault ,
.Nm copyout ,
+.Nm copyout_nofault ,
.Nm copystr ,
.Nm copyinstr
.Nd kernel copy functions
@@ -50,8 +52,12 @@
.Ft int
.Fn copyin "const void *uaddr" "void *kaddr" "size_t len"
.Ft int
+.Fn copyin_nofault "const void *uaddr" "void *kaddr" "size_t len"
+.Ft int
.Fn copyout "const void *kaddr" "void *uaddr" "size_t len"
.Ft int
+.Fn copyout_nofault "const void *kaddr" "void *uaddr" "size_t len"
+.Ft int
.Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done"
.Ft int
.Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done"
@@ -67,25 +73,40 @@ All but
copy data from user-space to kernel-space or vice-versa.
.Pp
The
-.Nm
-routines provide the following functionality:
-.Bl -tag -width "copyoutstr()"
-.It Fn copyin
-Copies
+.Fn copyin
+and
+.Fn copyin_nofault
+functions copy
.Fa len
bytes of data from the user-space address
.Fa uaddr
to the kernel-space address
.Fa kaddr .
-.It Fn copyout
-Copies
+.Pp
+The
+.Fn copyout
+and
+.Fn copyout_nofault
+functions copy
.Fa len
bytes of data from the kernel-space address
.Fa kaddr
to the user-space address
.Fa uaddr .
-.It Fn copystr
-Copies a NUL-terminated string, at most
+.Pp
+The
+.Fn copyin_nofault
+and
+.Fn copyout_nofault
+functions require that the kernel-space and user-space data be
+accessible without incurring a page fault.
+The source and destination addresses must be physically mapped for
+read and write access, respectively, and neither the source nor
+destination addresses may be pageable.
+.Pp
+The
+.Fn copystr
+function copies a NUL-terminated string, at most
.Fa len
bytes long, from kernel-space address
.Fa kfaddr
@@ -98,8 +119,10 @@ NUL, is returned in
.Fa done
is
.No non- Ns Dv NULL ) .
-.It Fn copyinstr
-Copies a NUL-terminated string, at most
+.Pp
+The
+.Fn copyinstr
+function copies a NUL-terminated string, at most
.Fa len
bytes long, from user-space address
.Fa uaddr
@@ -121,7 +144,6 @@ is
.\" The number of bytes actually copied, including the terminating
.\" NUL, is returned in
.\" .Fa *done .
-.El
.Sh RETURN VALUES
The
.Nm
@@ -129,7 +151,13 @@ functions return 0 on success or
.Er EFAULT
if a bad address is encountered.
In addition, the
-.Fn copystr ,
+.Fn copyin_nofault
+and
+.Fn copyout_nofault
+functions return
+.Er EFAULT
+if a page fault occurs, and the
+.Fn copystr
and
.Fn copyinstr
.\" .Fn copyinstr ,
OpenPOWER on IntegriCloud