NAME
mmaaddvviissee, ppoossiixxmmaaddvviissee - give advice about use of memory
SYNOPSIS
##iinncclluuddee <
int mmaaddvviissee(void *addr, sizet len, int advice); int ppoossiixxmmaaddvviissee(void *addr, sizet len, int advice);> DESCRIPTION
The mmaaddvviissee() system call allows a process that has knowledge of its mem-
ory behavior to describe it to the system. The advice passed in may be used by the system to alter its virtual memory paging strategy. This advice may improve application and system performance. The behavior specified in advice can only be one of the following values: MADVNORMAL Indicates that the application has no advice to give on its behavior in the specified address range. This is the system default behavior. This is used with mmaaddvviissee() system call. POSIXMADVNORMAL Same as MADVNORMAL but used with ppoossiixxmmaaddvviissee() system call. MADVSEQUENTIAL Indicates that the application expects to access this address range in a sequential manner. This is used with mmaaddvviissee() system call. POSIXMADVSEQUENTIAL Same as MADVSEQUENTIAL but used with ppoossiixxmmaaddvviissee() system call. MADVRANDOM Indicates that the application expects to access this address range in a random manner. This is used with mmaaddvviissee() system call. POSIXMADVRANDOM Same as MADVRANDOM but used with ppoossiixxmmaaddvviissee() system call. MADVWILLNEED Indicates that the application expects to access this address range soon. This is used with mmaaddvviissee() system call. POSIXMADVWILLNEEDSame as MADVWILLNEED but used with ppoossiixxmmaaddvviissee() sys-
tem call. MADVDONTNEED Indicates that the application is not expecting to access this address range soon. This is used with mmaaddvviissee() system call. POSIXMADVDONTNEEDSame as MADVDONTNEED but used with ppoossiixxmmaaddvviissee() sys-
tem call.MADVFREE Indicates that the application will not need the infor-
mation contained in this address range, so the pages may be reused right away. The address range will remain valid. This is used with mmaaddvviissee() system call. The ppoossiixxmmaaddvviissee() behaves same as mmaaddvviissee() except that it uses values with POSIX prefix for the advice system call argument.RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a valueof -1 is returned and errno is set to indicate the error.
EERRRROORRSS mmaaddvviissee() fails if one or more of the following are true: [EINVAL] The value of advice is incorrect. [EINVAL] The address range includes unallocated regions. [ENOMEM] The virtual address range specified by the addr and len are outside the range allowed for the address space.LEGACY SYNOPSIS
##iinncclluuddee <
> ##iinncclluuddee <
int mmaaddvviissee(caddrt addr, sizet len, int advice); int ppoossiixxmmaaddvviissee(caddrt addr, sizet len, int advice); The include file> is necessary. The type of addr has changed. SEE ALSO
mincore(2), minherit(2), mprotect(2), msync(2), munmap(2), compat(5) HISTORYThe mmaaddvviissee function first appeared in 4.4BSD. The ppoossiixxmmaaddvviissee func-
tion is part of IEEE 1003.1-2001 and was first implemented in Mac OS X
10.2. BSD June 9, 1993 BSD