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

vm_protectp Kernel Service

Purpose

Sets the page protection key for a page range.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include  <sys/vmuser.h>
int vm_protectp (vmid, pfirst, npages, key)
vmid_t  vmid;
int pfirst;
int npages;
int key;

Parameters

vmid Specifies the identifier for the virtual memory object for which the page protection key is to be set.
pfirst Specifies the first page number in the designated page range.
npages Specifies the number of pages in the designated page range.
key Specifies the value to be used in setting the page protection key for the designated page range.

Description

The vm_protectp kernel service is called to set the storage protect key for a given page range. The key parameter specifies the value to which the page protection key is set. The protection key is set for all pages touched by the specified page range that are resident in memory. The vm_protectp kernel service applies only to client storage.

If a page is not in memory, no state information is saved from a particular call to the vm_protectp service. If the page is later paged-in, it receives the default page protection key.

Execution Environment

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

Return Values

0 Indicates a successful operation.
EINVAL Indicates one of the following errors:
  • Invalid virtual memory object ID.
  • The starting page in the designated page range is negative.
  • The number of pages in the page range is negative.
  • The designated page range exceeds the size of virtual memory object.
  • The target page range does not exist.

Implementation Specifics

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

Related Information

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


[ Previous | Next | Contents | Home | Search ]