aio_memlock(3aio) aio_memlock(3aio)
NAME
aio_memlock - memory locking function
SYNOPSIS
cc [options] -D_REENTRANT file -lthread
#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.
Only one request to aio_memlock is permitted during a
process's lifetime. 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 has
been made to lock memory 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.
REFERENCES
aio_cancel(3aio), aiocb(5), aio_read(3aio), aio_suspend(3aio),
write(2)
Copyright 1994 Novell, Inc. Page 1