as_lw_pool_init Kernel Service

Purpose

Initializes lightweight attach and detach subsystem for the current process with the given settings.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/vmuser.h>
#include <sys/adspace.h>

int as_lw_pool_init (pool_size, flags)
size_t pool_size;
uint flags;

Parameters

Item Description
pool_size Specifies the maximum number of bytes that can be attached by lightweight services at one time by each thread of this process.
flags Specifies flag options for this kernel service. Valid values are 0 and LW_DEBUG.

Description

Note: The as_lw_pool_init kernel service should be used with caution. Read the documentation for this and the other lightweight services (as_lw_att64 and as_lw_det64) carefully before doing so. There is a risk that illegal data accesses will be allowed if these services are not used correctly.

The as_lw_pool_init kernel service initializes the lightweight pool size and flag settings for the current process. Once it has been called, these settings are fixed and cannot be changed for the process.

If LW_DEBUG is set in the flags parameter, the risk of illegal data access will be removed from calls to the as_lw_att64 kernel service and the as_lw_det64 kernel service. This setting allows users to debug problems that are caused by incorrect use of these services.

Processes that have called the as_lw_pool_init kernel service can use the other lightweight kernel services (as_lw_att64 and as_lw_det64) to attach and detach virtual memory regions represented by a cross memory descriptor. These kernel services are used on a per-thread basis, that is if one thread uses the as_lw_att64 kernel service to attach virtual memory to a region of its address space, that region cannot be addressed by any other thread, and it must be detached by the same thread by using the as_lw_det64 kernel service.

This service will operate correctly only for 64-bit user address spaces. It will not work for kernel processes (kprocs).

Execution Environment

The as_lw_pool_init kernel service can be called from a 64-bit process environment only.

Return Values

On successful completion, this service returns 0.
Item Description
ENOSYS The service was called by a 32-bit process.
EEXIST The as_lw_pool_init kernel service has already been successfully completed for this process.
EINVAL Invalid flag settings or the pool_size parameter is 0.
EPERM Called by a user thread that is not 1:1 with a kernel thread.

Implementation Specifics

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