Initiates page-out for a page range in the address space.
The vm_write kernel service initiates page-out for pages that intersect the address range (vaddr, vaddr + nbytes).
If the force parameter is nonzero, modified pages are written to disk regardless of how recently they have been written.
Page-out is initiated for each modified page. An unchanged page is left in memory with its reference bit set to 0. This makes the unchanged page a candidate for the page replacement algorithm.
The caller must have write access to the specified pages.
The initiated I/O is asynchronous. The vms_iowait kernel service can be called to wait for I/O completion.
Item | Description |
---|---|
vaddr | Specifies the address of the first byte of the page range for which a page-out is desired. |
nbytes | Specifies the number of bytes starting at the byte specified by the vaddr parameter. This parameter must be nonnegative. All of the bytes must be in the same virtual memory object. |
force | Specifies a flag indicating that a modified page is to be written regardless of when it was last written. |
The vm_write kernel service can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates a successful completion. |
EINVAL | Indicates one of these four errors:
|
EACCES | Indicates that access does not permit writing. |
EIO | Indicates a permanent I/O error. |