aio_memlock(3aio)


aio_memlock -- memory locking function

Synopsis

   

cc [options] -Kthread file

#include <aio.h>

int aio_memlock(void *avaddr, size_t asize);

Description

aio_memlock provides a mechanism for locking the area of memory to be used for asynchronous I/O operations.

An application must lock down the entire area of memory which will be accessed to transfer the data for each request. avaddr specifies the starting address of memory to lock. asize specifies the size of the area in bytes.

Multiple requests to aio_memlock are permitted during a process's lifetime; each call must specify a different address range. This allows processes to do asynchronous I/O over multiple regions of the address space.

Once the memory is locked, it cannot be unlocked or changed. No special privilege is needed for this operation.

Errors


EINVAL
avaddr and/or avsize are not valid or an attempt was made to lock the same address range more than once.

Usage

You should only use aio_memlock with SVR4.2 or when the AIO_RAW aio_flag is set.

The amount of locked memory must be sized carefully. If it is too large, it may adversely effect the overall system performance. If it is too small, it will limit the number of asynchronous I/O requests that can be outstanding at any given point in time.

In addition, the application should make sure that any calls to functions that resize memory, such as brk and sbrk do not involve addresses within the locked area.

Compatibility

Earlier releases of UnixWare permitted only one call to aio_memlock during a process's lifetime.

References

aio_cancel(3aio), aiocb(5), aio_read(3aio), aio_suspend(3aio), write(2)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004