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

unpinu Kernel Service


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;


base Specifies the address of the first byte to unpin.
len Indicates the number of bytes to unpin.
segflg Specifies whether the data to unpin is in user space or system space. The values for this flag are defined in the /usr/include/sys/uio.h file. This value can be one of the following:
UIO_SYSSPACE The region is mapped into the kernel address space.
UIO_USERSPACE The region is mapped into the user address space.


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.

Execution Environment

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.

Return Values

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.

Implementation Specifics

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

Related Information

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.

[ Previous | Next | Contents | Home | Search ]