Place MAP_* flags list in alphabeitical order.

This commit is contained in:
Michael Kerrisk 2007-05-01 15:23:23 +00:00
parent ae0318dfac
commit 83314009c0
1 changed files with 67 additions and 66 deletions

View File

@ -134,65 +134,13 @@ Both of these flags are described in POSIX.1-2001.
In addition, zero or more of the following values can be ORed in
.IR flags :
.\" FIXME ? Place the following list in alphabetical order?
.TP
.B MAP_32BIT
Put the mapping into the first 2GB of the process address space.
Ignored when
.B MAP_FIXED
Don't interpret
.I start
as a hint: place the mapping at exactly that address.
.I start
must be a multiple of the page size.
If the memory region specified by
.I start
and
.I len
overlaps pages of any existing mapping(s), then the overlapped
part of the existing mapping(s) will be discarded.
If the specified address cannot be used,
.BR mmap ()
will fail.
Because requiring a fixed address for a mapping is less portable,
the use of this option is discouraged.
.TP
.B MAP_DENYWRITE
This flag is ignored.
.\" Introduced in 1.1.36, removed in 1.3.24.
(Long ago, it signalled that attempts to write to the underlying file
should fail with
.BR ETXTBUSY .
But this was a source of denial-of-service attacks.)
.TP
.B MAP_EXECUTABLE
This flag is ignored.
.\" Introduced in 1.1.38, removed in 1.3.24. Flag tested in proc_follow_link.
.\" (Long ago, it signalled that the underlying file is an executable.
.\" However, that information was not really used anywhere.)
.\" Linus talked about DOS related to MAP_EXECUTABLE, but he was thinking of
.\" MAP_DENYWRITE?
.TP
.B MAP_NORESERVE
Do not reserve swap space for this mapping.
When swap space is reserved, one has the guarantee
that it is possible to modify the mapping.
When swap space is not reserved one might get SIGSEGV upon a write
if no physical memory is available.
See also the discussion of the file
.I /proc/sys/vm/overcommit_memory
in
.BR proc (5).
In kernels before 2.6, this flag only had effect for
private writable mappings.
.TP
.BR MAP_LOCKED " (since Linux 2.5.37)"
Lock the pages of the mapped region into memory in the manner of
.BR mlock () .
This flag is ignored in older kernels.
.\" If set, the mapped pages will not be swapped out.
.TP
.B MAP_GROWSDOWN
Used for stacks.
Indicates to the kernel virtual memory system that the mapping
should extend downwards in memory.
is set.
This flag is currently only supported on x86-64 for 64bit programs.
.TP
.B MAP_ANON
Synonym for
@ -221,21 +169,56 @@ in conjunction with
.B MAP_SHARED
is only supported on Linux since kernel 2.4.
.TP
.B MAP_DENYWRITE
This flag is ignored.
.\" Introduced in 1.1.36, removed in 1.3.24.
(Long ago, it signalled that attempts to write to the underlying file
should fail with
.BR ETXTBUSY .
But this was a source of denial-of-service attacks.)
.TP
.B MAP_EXECUTABLE
This flag is ignored.
.\" Introduced in 1.1.38, removed in 1.3.24. Flag tested in proc_follow_link.
.\" (Long ago, it signalled that the underlying file is an executable.
.\" However, that information was not really used anywhere.)
.\" Linus talked about DOS related to MAP_EXECUTABLE, but he was thinking of
.\" MAP_DENYWRITE?
.TP
.B MAP_FILE
Compatibility flag.
Ignored.
.\" On some systems, this was required as the opposite of
.\" MAP_ANONYMOUS -- mtk, 1 May 2007
.TP
.B MAP_32BIT
Put the mapping into the first 2GB of the process address space.
Ignored when
.B MAP_FIXED
is set.
This flag is currently only supported on x86-64 for 64bit programs.
Don't interpret
.I start
as a hint: place the mapping at exactly that address.
.I start
must be a multiple of the page size.
If the memory region specified by
.I start
and
.I len
overlaps pages of any existing mapping(s), then the overlapped
part of the existing mapping(s) will be discarded.
If the specified address cannot be used,
.BR mmap ()
will fail.
Because requiring a fixed address for a mapping is less portable,
the use of this option is discouraged.
.TP
.BR MAP_POPULATE " (since Linux 2.5.46)"
Populate (prefault) page tables for a file mapping,
by performing read-ahead on the file.
Later accesses to the mapping will not be blocked by page faults.
.B MAP_GROWSDOWN
Used for stacks.
Indicates to the kernel virtual memory system that the mapping
should extend downwards in memory.
.TP
.BR MAP_LOCKED " (since Linux 2.5.37)"
Lock the pages of the mapped region into memory in the manner of
.BR mlock () .
This flag is ignored in older kernels.
.\" If set, the mapped pages will not be swapped out.
.TP
.BR MAP_NONBLOCK " (since Linux 2.5.46)"
Only meaningful in conjunction with
@ -243,6 +226,24 @@ Only meaningful in conjunction with
Don't perform read-ahead:
only create page tables entries for pages
that are already present in RAM.
.TP
.B MAP_NORESERVE
Do not reserve swap space for this mapping.
When swap space is reserved, one has the guarantee
that it is possible to modify the mapping.
When swap space is not reserved one might get SIGSEGV upon a write
if no physical memory is available.
See also the discussion of the file
.I /proc/sys/vm/overcommit_memory
in
.BR proc (5).
In kernels before 2.6, this flag only had effect for
private writable mappings.
.TP
.BR MAP_POPULATE " (since Linux 2.5.46)"
Populate (prefault) page tables for a file mapping,
by performing read-ahead on the file.
Later accesses to the mapping will not be blocked by page faults.
.LP
Of the above flags, only
.B MAP_FIXED