summaryrefslogtreecommitdiff
path: root/share/man/man9
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2012-06-21 18:01:41 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2012-06-21 18:01:41 +0000
commit902c81742cee2b2c6f0381ef992b3b99d5609b6a (patch)
tree18ad1504a548b39285d001c6914f7c70d3d0eb8b /share/man/man9
parent5d02d67713a48552eec285cd96b50ba303d7c5f2 (diff)
Document kcopy() and add a note that copystr() does not return EFAULT
when it encounters an illegal address. Discussed with deraadt, guenther, and kettenis.
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/copy.925
1 files changed, 23 insertions, 2 deletions
diff --git a/share/man/man9/copy.9 b/share/man/man9/copy.9
index f720443ff31..c62e675aa68 100644
--- a/share/man/man9/copy.9
+++ b/share/man/man9/copy.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: copy.9,v 1.14 2007/05/31 19:20:00 jmc Exp $
+.\" $OpenBSD: copy.9,v 1.15 2012/06/21 18:01:40 matthew Exp $
.\" $NetBSD: copy.9,v 1.2 1996/01/09 03:23:04 thorpej Exp $
.\"
.\" Copyright (c) 1996 Jason R. Thorpe.
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: June 21 2012 $
.Dt COPY 9
.Os
.Sh NAME
@@ -52,12 +52,16 @@
.Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done"
.Ft int
.Fn copyoutstr "const void *kaddr" "void *uaddr" "size_t len" "size_t *done"
+.Ft int
+.Fn kcopy "const void *kfaddr" "void *kdaddr" "size_t len"
.Sh DESCRIPTION
The
.Nm
functions are designed to copy contiguous data from one address to another.
All but
.Fn copystr
+and
+.Fn kcopy
copy data from user-space to kernel-space or vice-versa.
.Pp
The
@@ -92,6 +96,16 @@ if
.Fa done
is not
.Dv NULL .
+.Pp
+Unlike the other
+.Nm
+functions,
+.Fn copystr
+does
+.Em not
+support returning
+.Er EFAULT
+when a bad address is encountered.
.It Fn copyinstr
Copies a null-terminated string, at most
.Fa len
@@ -120,6 +134,13 @@ if
.Fa done
is not
.Dv NULL .
+.It Fn kcopy
+Copies
+.Fa len
+bytes of data from the kernel-space address
+.Fa kfaddr
+to the kernel-space address
+.Fa kdaddr .
.El
.Sh RETURN VALUES
The