4 <strong>Function
</strong> - Synchronize the specified region of virtual memory.
7 <strong>kern_return_t vm_msync
</strong>
8 <strong>(vm_task_t
</strong> <var>target_task
</var>,
9 <strong>vm_address_t
</strong> <var>address
</var>,
10 <strong>vm_size_t
</strong> <var>size
</var>,
11 <strong>target_task
</strong> <var>sync_flags
</var><strong>);
</strong>
16 <dt> <var>target_task
</var>
19 The port for the task whose address space contains
22 <dt> <var>address
</var>
25 The starting address for the region.
30 The number of bytes in the region.
32 <dt> <var>sync_flags
</var>
35 The bit-wise
<strong>OR
</strong> of flags affecting the synchronization.
36 Specifying both
<strong>VM_SYNC_SYNCHRONOUS
</strong> and
37 <strong>VM_SYNC_ASYNCHRONOUS
</strong> is invalid.
40 <dt> <strong>VM_SYNC_INVALIDATE
</strong>
42 Flushes pages in the range. Only precious pages are returned to
43 the memory manager unless either
<strong>VM_SYNC_SYNCHRONOUS
</strong> or
44 <strong>VM_SYNC_ASYNCHRONOUS
</strong> is also set.
46 <dt> <strong>VM_SYNC_SYNCHRONOUS
</strong>
48 Writes dirty and precious pages back to the memory manager,
49 waits for pages to reach backing storage.
51 <dt> <strong>VM_SYNC_ASYNCHRONOUS
</strong>
53 Writes dirty and precious pages back to the memory manager,
54 returns without waiting for pages to reach backing storage.
59 The
<strong>vm_msync
</strong> function synchronizes the contents of
60 a memory range with its
61 backing store image by flushing or cleaning the contents of the
63 to the range's memory manager, engaging in a synchronization protocol with
64 the manager (
<strong>memory_object_synchronize
</strong>).
65 The client does not return from
66 this call until the memory manager responds (to the kernel) with
67 <strong>memory_object_synchronize_completed
</strong>.
70 This interface is machine word length specific because of the virtual address
72 <h3>RETURN VALUES
</h3>
75 <dt> <strong>KERN_INVALID_ADDRESS
</strong>
77 The address is illegal or specifies a non-allocated region.
79 <h3>RELATED INFORMATION
</h3>
82 <a href=
"memory_object_synchronize.html"><strong>memory_object_synchronize
</strong></a>,
83 <a href=
"MO_SY_completed.html"><strong>memory_object_synchronize_completed
</strong></a>.