diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2011-07-09 15:24:12 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2011-07-09 15:24:12 +0000 |
commit | 6847f7cfb3f684c7585142f02f7a5e74a6b82e06 (patch) | |
tree | 4a56fad356340a4c5dcf477b8665ef824416d4af /share/man/man9/copy.9 | |
parent | 2801687d568a6efada994a5ed1f3f4824f48f6d3 (diff) |
Document copyin_nofault, copyout_nofault, uiomove_nofault.
Submitted by: alc
Notes
Notes:
svn path=/head/; revision=223890
Diffstat (limited to 'share/man/man9/copy.9')
-rw-r--r-- | share/man/man9/copy.9 | 56 |
1 files changed, 42 insertions, 14 deletions
diff --git a/share/man/man9/copy.9 b/share/man/man9/copy.9 index b6b975f82840..37c7a0c47d9a 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 , |