vm_writep Kernel Service

Purpose

Initiates page-out for a page range in a virtual memory object.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/vmuser.h>

int vm_writep ( vmid,  pfirst,  npages)
vmid_t  vmid;
int pfirst;
int npages;

Description

The vm_writep kernel service initiates page-out for the specified page range in the virtual memory object. I/O is initiated for modified pages only. Unchanged pages are left in memory, but their reference bits are set to 0.

The caller can wait for the completion of I/O initiated by this and prior calls by calling the vms_iowait kernel service.

Note: The vm_writep subroutine is not supported for use on large pages.

Parameters

Item Description
vmid Specifies the identifier for the virtual memory object.
pfirst Specifies the first page number at which page-out is to begin.
npages Specifies the number of pages for which the page-out operation is to be performed.

Execution Environment

The vm_writep kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates successful completion.
EINVAL Indicates any one of the following errors:
  • The virtual memory object ID is not valid.
  • The starting page is negative.
  • The number of pages is negative.
  • The page range exceeds the size of virtual memory object.
  • One or more large pages lie in the target page range.