Releases virtual memory resources for the specified address range.
#include <sys/types.h> #include <sys/errno.h> #include <sys/vmuser.h>
int vm_release (vaddr, nbytes) caddr_t vaddr; int nbytes;
vaddr | Specifies the address of the first byte in the address range to be released. |
nbytes | Specifies the number of bytes to be released. |
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.
The vm_release kernel service can be called from the process environment only.
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 vm_release kernel service is part of Base Operating System (BOS) Runtime.
The vm_releasep kernel service.
Memory Kernel Services and Understanding Virtual Memory Manager Interfaces in AIX Kernel Extensions and Device Support Programming Concepts.