Sets the page protection key for a page range.
#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;
|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.|
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.
The vm_protectp kernel service can be called from the process environment only.
|0||Indicates a successful operation.|
|EINVAL||Indicates one of the following errors:|
The vm_protectp kernel service is part of Base Operating System (BOS) Runtime.
Memory Kernel Services and Understanding Virtual Memory Manager Interfaces in AIX Kernel Extensions and Device Support Programming Concepts.