posix_madvise()

Provide advisory information about the expected use of memory

Synopsis:

#include <sys/mman.h>

int posix_madvise( void *addr,
                   size_t len,
                   int advice );

Arguments:

addr
The address of the data the application is providing advice about.
len
The length of the data, in bytes.
advice
The advice to be applied to the memory range; one of the following:

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The posix_madvise() function advises the memory manager how the application expects to use the data in the memory starting at address addr, and continuing for len bytes. The memory manager may use this information to optimize handling of the data.

Returns:

EOK
Success.
EINVAL
The value of advice is invalid.
ENOMEM
Addresses in the specified range are partly or completely outside the range allowed for the address space of the calling process.

Classification:

POSIX 1003.1 ADV

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

posix_fadvise()