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

vm_release Kernel Service

Purpose

Releases virtual memory resources for the specified address range.

Syntax

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

Parameters

vaddr Specifies the address of the first byte in the address range to be released.
nbytes Specifies the number of bytes to be released.

Description

The vm_release kernel service releases pages that intersect the specified address range from the vaddr parameter to the vaddr parameter plus the number of bytes specified by the nbytes parameter. The value in the nbytes parameter must be nonnegative and the caller must have write access to the pages specified by the address range.

Each page that intersects the byte range is logically reset to 0, and any page frame is discarded. A page frame in I/O state is marked for discard at I/O completion. That is, the page frame is placed on the free list when the I/O operation completes.

Note: All of the pages to be released must be in the same virtual memory object.

Execution Environment

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

Return Values

0 Indicates successful completion.
EACCES Indicates that the caller does not have write access to the specified pages.
EINVAL Indicates one of the following errors:
  • The specified region is not mapped.
  • The specified region is an I/O region.
  • The length specified in the nbytes parameter is negative.
  • The specified address range crosses a virtual memory object boundary.

Implementation Specifics

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

Related Information

The vm_releasep 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 ]