Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ madvise(2) — OSF/1 3.0 αXP

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mmap(2)

madvise(2)  —  System Calls

NAME

madvise − Advise the system of a process’ expected paging behavior

SYNOPSIS

#include <sys/types.h> #include <sys/mman.h> int madvise (
caddr_t addr,
size_t len,
int behav );

PARAMETERS

addrSpecifies the address of the region to which the advice refers. 

lenSpecifies the length in bytes of the region specified by the addr parameter. 

behavSpecifies the behavior of the region.  The following values for the behav parameter are defined in the sys/mman.h header file:

MADV_NORMAL
No further special treatment

MADV_RANDOM
Expect random page references

MADV_SEQUENTIAL
Expect sequential references

MADV_WILLNEED
Will need these pages

MADV_DONTNEED
Do not need these pages

MADV_SPACEAVAIL
Ensure that resources are reserved

DESCRIPTION

The madvise() function permits a process to advise the system about its expected future behavior in referencing a mapped file or shared memory region. 

NOTES

The madvise() function has no functionality in OSF/1.  It is supported for compatibility only. 

AES Support Level:
Trial use

RETURN VALUES

Upon successful completion, the madvise() function returns zero.  Otherwise, -1 is returned and errno is set to indicate the error. 

ERRORS

If the madvise() function fails, errno may be set to one of the following values:

[EINVAL]The behav parameter is invalid. 

[ENOSPC]The behav parameter specifies MADV_SPACEAVAIL and resources can not be reserved. 

RELATED INFORMATION

Functions: mmap(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026