[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

vm_write Kernel Service

Purpose

Initiates page-out for a page range in the address space.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include  <sys/vmuser.h>
int vm_write (vaddr, nbytes, force)
int vaddr; 
int nbytes; 
int force; 

Parameters

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.

Description

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.

Execution Environment

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

Return Values

0 Indicates a successful completion.
EINVAL Indicates one of these four errors:
  • A region is not defined.
  • A region is an I/O region.
  • The length specified by the nbytes parameter is negative.
  • The address range crosses a virtual memory object boundary.
EACCES Indicates that access does not permit writing.
EIO Indicates a permanent I/O error.

Implementation Specifics

The vm_write kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The vm_writep kernel service, vms_iowait kernel service.

Memory Kernel Services and Understanding Virtual Memory Manager Interfaces in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]