madvise - Advise the system of the expected paging behavior of a process
int madvise (
int behav );
addr Specifies the address of the region to which the advice refers.
len Specifies the length in bytes of the region specified by the addr
behav Specifies the behavior of the region. The following values for
the behav parameter are defined in the sys/mman.h header file:
No further special treatment
Expect random page references
Expect sequential references
Will need these pages
Do not need these pages
The system will free any whole pages in the specified
region. All modifications will be lost and any swapped
out pages will be discarded. Subsequent access to the
region will result in a zero-fill-on-demand fault as
though it is being accessed for the first time.
Reserved swap space is not affected by this call.
Ensure that resources are reserved
The madvise() function permits a process to advise the system about its
expected future behavior in referencing a mapped file or shared memory
Only a few values of the behav parameter values are operational on Tru64
UNIX systems. Non-operational values cause the system to always return
Upon successful completion, the madvise() function returns zero. Other-
wise, -1 is returned and errno is set to indicate the error.
If the madvise() function fails, errno may be set to one of the following
[EINVAL] The behav parameter is invalid.
[ENOSPC] The behav parameter specifies MADV_SPACEAVAIL and resources can-
not be reserved.