]>
Commit | Line | Data |
---|---|---|
9bccf70c | 1 | <h2>vm_msync</h2>\r<hr>\r<p>\r<strong>Function</strong> - Synchronize the specified region of virtual memory.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t vm_msync</strong>\r <strong>(vm_task_t</strong> <var>target_task</var>,\r <strong>vm_address_t</strong> <var>address</var>,\r <strong>vm_size_t</strong> <var>size</var>,\r <strong>target_task</strong> <var>sync_flags</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>target_task</var> \r<dd>\r[in task send right]\rThe port for the task whose address space contains \rthe region.\r<p>\r<dt> <var>address</var> \r<dd>\r[in scalar]\rThe starting address for the region.\r<p>\r<dt> <var>size</var> \r<dd>\r[in scalar]\rThe number of bytes in the region.\r<p>\r<dt> <var>sync_flags</var> \r<dd>\r[in scalar]\rThe bit-wise <strong>OR</strong> of flags affecting the synchronization. \rSpecifying both <strong>VM_SYNC_SYNCHRONOUS</strong> and\r<strong>VM_SYNC_ASYNCHRONOUS</strong> is invalid.\r<dl>\r<p>\r<dt> <strong>VM_SYNC_INVALIDATE</strong>\r<dd>\rFlushes pages in the range. Only precious pages are returned to \rthe memory manager unless either <strong>VM_SYNC_SYNCHRONOUS</strong> or\r<strong>VM_SYNC_ASYNCHRONOUS</strong> is also set.\r<p>\r<dt> <strong>VM_SYNC_SYNCHRONOUS</strong>\r<dd>\rWrites dirty and precious pages back to the memory manager, \rwaits for pages to reach backing storage.\r<p>\r<dt> <strong>VM_SYNC_ASYNCHRONOUS</strong>\r<dd>\rWrites dirty and precious pages back to the memory manager, \rreturns without waiting for pages to reach backing storage.\r</dl>\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>vm_msync</strong> function synchronizes the contents of\ra memory range with its \rbacking store image by flushing or cleaning the contents of the\rspecified range \rto the range's memory manager, engaging in a synchronization protocol with \rthe manager (<strong>memory_object_synchronize</strong>). \rThe client does not return from \rthis call until the memory manager responds (to the kernel) with\r<strong>memory_object_synchronize_completed</strong>.\r<h3>NOTES</h3>\r<p>\rThis interface is machine word length specific because of the virtual address\rparameter.\r<h3>RETURN VALUES</h3>\r<dl>\r<p>\r<dt> <strong>KERN_INVALID_ADDRESS</strong>\r<dd>\rThe address is illegal or specifies a non-allocated region.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="memory_object_synchronize.html"><strong>memory_object_synchronize</strong></a>,\r<a href="MO_SY_completed.html"><strong>memory_object_synchronize_completed</strong></a>.\r |