The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

NAME

sys/mman.h - memory management declarations

SYNOPSIS

#include <sys/mman.h>

DESCRIPTION

The following protection options are defined:

PROT_READ
Page can be read.

PROT_WRITE
Page can be written.

PROT_EXEC
Page can be executed.

PROT_NONE
Page can not be accessed.

The following flag options are defined:

MAP_SHARED
Share changes.

MAP_PRIVATE
Changes are private.

MAP_FIXED
Interpret addr exactly.

The following flags are defined for msync():

MS_ASYNC
Perform asynchronous writes.

MS_SYNC
Perform synchronous writes.

MS_INVALIDATE
Invalidate mappings.

The following symbolic constants are defined for the mlockall() function:

MCL_CURRENT
Lock currently mapped pages.

MCL_FUTURE
Lock pages that become mapped.

The symbolic constant MAP_FAILED is defined to indicate a failure from the mmap() function.

The size_t and off_t types are defined as described in <sys/types.h>.

The following are declared in <sys/mman.h> as functions and may also be defined as macros. Function prototypes must be provided for use with an ISO C compiler.

int    mlock(const void *, size_t);
int    mlockall(int);
void  *mmap(void *, size_t, int, int, int, off_t);
int    mprotect(void *, size_t, int);
int    msync(void *, size_t, int);
int    munlock(const void *, size_t);
int    munlockall(void);
int    munmap(void *, size_t);
int    shm_open(const char *, int, mode_t);
int    shm_unlink(const char *);

APPLICATION USAGE

None.

FUTURE DIRECTIONS

None.

SEE ALSO

mlock(), mlockall(), mmap(), mprotect(), msync(), munmap(), shm_open(), shm_unlink().

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]