Unpins the specified address range in user or system memory.
#include <sys/types.h> #include <sys/errno.h> #include <sys/uio.h>
int unpinu (base, len, segflg) caddr_t base; int len; short segflg;
The unpinu service unpins a region of memory previously pinned by the pinu kernel service. When the pin count is 0, the page is not pinned and can be paged out of real memory. Upon finding an unpinned page, the unpinu service returns the EINVAL error code and leaves any remaining pinned pages still pinned.
The unpinu service should be used where the address space might be in either user or kernel space.
If the caller has a valid cross-memory descriptor for the address range, the xmempin and xmemunpin kernel services can be used instead of pinu and unpinu, and result in less pathlength.
The unpinu service can be called in the process environment when unpinning data that is in either user space or system space. It can be called in the interrupt environment only when unpinning data that is in system space.
0 | Indicates successful completion. |
EFAULT | Indicates that the memory region as specified by the base and len parameters is not within the address specified by the segflg parameter. |
EINVAL | Indicates that the value of the length parameter is negative or 0. Otherwise, the area of memory beginning at the byte specified by the base parameter and extending for the number of bytes specified by the len parameter is not defined. If neither cause is responsible, an unpinned page was specified. |
The unpinu kernel service is part of Base Operating System (BOS) Runtime.
The pin kernel service, unpin kernel service, xmempin kernel service, xmemunpin kernel service.
Understanding Execution Environments and Memory Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.