FreeBSD/Linux Kernel Cross Reference
sys/man/vm_copy.man
1 .\"
2 .\" Mach Operating System
3 .\" Copyright (c) 1991,1990 Carnegie Mellon University
4 .\" All Rights Reserved.
5 .\"
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
11 .\"
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 .\"
16 .\" Carnegie Mellon requests users of this software to return to
17 .\"
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
22 .\"
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"
26 .\"
27 .\" HISTORY
28 .\" $Log: vm_copy.man,v $
29 .\" Revision 2.6 93/03/18 15:16:37 mrt
30 .\" corrected types
31 .\" [93/03/12 16:55:12 lli]
32 .\"
33 .\" Revision 2.5 91/12/13 14:22:32 jsb
34 .\" Moved alignment restrictions to a BUGS section.
35 .\" Removed the non-overlapping restriction.
36 .\" [91/12/11 rpd]
37 .\"
38 .\" Revision 2.4 91/05/14 17:15:22 mrt
39 .\" Correcting copyright
40 .\"
41 .\" Revision 2.3 91/02/14 14:16:01 mrt
42 .\" Changed to new Mach copyright
43 .\" [91/02/12 18:16:59 mrt]
44 .\"
45 .\" Revision 2.2 90/08/07 18:47:15 rpd
46 .\" Created.
47 .\"
48 .TH vm_copy 2 9/19/86
49 .CM 4
50 .SH NAME
51 .nf
52 vm_copy \- copies memory to a destination address
53 .SH SYNOPSIS
54 .nf
55 .ft B
56 #include <mach.h>
57
58 .nf
59 .ft B
60 kern_return_t vm_copy (target_task, source_address, count, dest_address)
61 mach_port_t target_task;
62 vm_address_t source_address;
63 vm_size_t count;
64 vm_address_t dest_address;
65 .fi
66 .ft P
67 .SH ARGUMENTS
68 .TP 15
69 .B
70 target_task
71 Task whose virtual memory is to be affected.
72 .TP 15
73 .B
74 source_address
75 Address in \fBtarget_task\fR
76 of the start of the source range.
77 .TP 15
78 .B
79 count
80 Number of bytes to copy.
81 .TP 15
82 .B
83 dest_address
84 Address in \fBtarget_task\fR
85 of the start of the destination range.
86 .SH DESCRIPTION
87 \fBvm_copy\fR causes the source memory range to be copied to
88 the destination address. The source and destination memory ranges
89 may overlap. The destination address range must already be allocated and
90 writable; the source range must be readable.
91
92 \fBvm_copy\fR is equivalent to vm_read followed by vm_write.
93 .SH DIAGNOSTICS
94 .TP 25
95 KERN_SUCCESS
96 Memory copied.
97 .TP 25
98 KERN_PROTECTION_FAILURE
99 Either the destination region was not
100 not writable, or the source region was not readable.
101 .TP 25
102 KERN_INVALID_ADDRESS
103 Illegal or non-allocated address specified or
104 insufficient memory allocated at one of the addresses.
105 .SH BUGS
106 The current implementation requires that \fBsource_address\fR,
107 \fBcount\fR, and \fBdest_address\fR all be page-aligned.
108 Otherwise, KERN_INVALID_ARGUMENT is returned.
109 .SH SEE ALSO
110 vm_read(2),
111 vm_write(2),
112 vm_protect(2),
113 vm_statistics(2).
Cache object: f5a34f428c8b2648b8f6644cd727198e
|