osfmk/man/memory_object_synchronize.html
Server Interface - Forward a client's request to synchronize data with its image in backing store.
**kern\_return\_t memory\_object\_synchronize**** (memory\_object\_t **memory\_object,** memory\_object\_control\_t **memory\_control,** vm\_offset\_t **offset,** vm\_offset\_t **length,** memory\_object **sync\_flags** ); ****kern\_return\_t seqnos\_memory\_object\_synchronize**** (memory\_object\_t **memory\_object,** mach\_port\_seqno\_t **seqno,** memory\_object\_control\_t **memory\_control,** vm\_offset\_t **offset,** vm\_offset\_t **length,** memory\_object **sync\_flags** );**
memory_object[in abstract-memory-object (receive) right] The abstract memory object port that represents the memory object data.
seqno[in scalar] The sequence number of this message relative to the abstract memory object port.
memory_control[in memory-cache-control send right] The memory cache control port to be used for a response by the memory manager. If the memory object has been supplied to more than one kernel, this parameter identifies the kernel that is making the call.
offset[in scalar] The offset within the memory object.
length[in scalar] The number of bytes cleaned or flushed, starting at offset. The number converts to an integral number of virtual pages.
sync_flags[in scalar] The bit-wise OR of flags affecting the synchronization.
VM_SYNC_INVALIDATE Flushes pages in the range. Only precious pages are returned to the memory manager.
VM_SYNC_SYNCHRONOUS Writes dirty and precious pages back to the memory manager, waits for pages to reach backing storage.
VM_SYNC_ASYNCHRONOUS Writes dirty and precious pages back to the memory manager, returns without waiting for pages to reach backing storage.
A memory_object_synchronize function is called as the result of a kernel message indicating that a client wishes to synchronize the contents of a range of a memory object with its backing storage image. This message would have been preceded by memory_object_data_return messages cleaning or flushing the specified range.
Depending on the client's supplied sync_flags, the manager waits for the pages to reach the desired state and then replies with memory_object_synchronize_completed at which time the client returns from its vm_msync call. Multiple synchronize requests may be outstanding at a time but they will not overlap.
Only generic errors apply.
Functions: vm_msync, memory_object_synchronize_completed, memory_object_data_return, memory_object_server, seqnos_memory_object_server.