DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

aio_memlock(AIO)


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(AIO), aiocb(M), aio_read(AIO), aio_suspend(AIO), write(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005