| Modifier and Type | Field and Description
|
|---|
| public static final int | MAP_32BITEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_ANONEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_ANONYMOUSEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_DENYWRITEEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_EXECUTABLEEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final long |
|
| public static final int | MAP_FILEEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_FIXEDEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_FIXED_NOREPLACEEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_GROWSDOWNEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_HUGE_1GBEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_HUGE_2MBEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int |
|
| public static final int |
|
| public static final int | MAP_HUGETLBEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_LOCKEDEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_NONBLOCKEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_NORESERVEEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_POPULATEEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_PRIVATEThe flags argument determines whether updates to the mapping are visible to other processes mapping the same region, and whether updates are carried
through to the underlying file.
|
| public static final int | MAP_SHAREDThe flags argument determines whether updates to the mapping are visible to other processes mapping the same region, and whether updates are carried
through to the underlying file.
|
| public static final int | MAP_SHARED_VALIDATEThe flags argument determines whether updates to the mapping are visible to other processes mapping the same region, and whether updates are carried
through to the underlying file.
|
| public static final int | MAP_STACKEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_SYNCEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | MAP_UNINITIALIZEDEnum values:
MAP_32BIT -
Put the mapping into the first 2 Gigabytes of the process address space.
This flag is supported only on x86-64, for 64-bit programs. It was added to allow thread stacks to be allocated somewhere in the first 2 GB of
memory, so as to improve context-switch performance on some early 64-bit processors. Modern x86-64 processors no longer have this performance
problem, so use of this flag is not required on those systems. The MAP_32BIT flag is ignored when MAP_FIXED is set.
MAP_ANONYMOUS -
The mapping is not backed by any file; its contents are initialized to zero.
The fd argument is ignored; however, some implementations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is specified,
and portable applications should ensure this. The offset argument should be zero. The use of MAP_ANONYMOUS in conjunction with
MAP_SHARED is supported on Linux only since kernel 2.4.
MAP_ANON - Synonym for MAP_ANONYMOUS; provided for compatibility with other implementations.
MAP_DENYWRITE -
This flag is ignored.
(Long ago —Linux 2.0 and earlier— it signaled that attempts to write to the underlying file should fail with ETXTBSY. But this was a source
of denial-of-service attacks.)
MAP_EXECUTABLE - This flag is ignored.
MAP_FILE - Compatibility flag. Ignored.
MAP_FIXED -
Don't interpret addr as a hint: place the mapping at exactly that address.
addr must be suitably aligned: for most architectures a multiple of the page size is sufficient; however, some architectures may impose
additional restrictions. If the memory region specified by addr and length 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, mmap will fail.
Software that aspires to be portable should use the MAP_FIXED flag with care, keeping in mind that the exact layout of a process's memory
mappings is allowed to change significantly between kernel versions, C library versions, and operating system releases. Carefully read the
discussion of this flag in NOTES!
MAP_FIXED_NOREPLACE -
This flag provides behavior that is similar to MAP_FIXED with respect to the addr enforcement, but differs in that
MAP_FIXED_NOREPLACE never clobbers a preexisting mapped range.
If the requested range would collide with an existing mapping, then this call fails with the error EEXIST. This flag can therefore be used
as a way to atomically (with respect to other threads) attempt to map an address range: one thread will succeed; all others will report failure.
Note that older kernels which do not recognize the MAP_FIXED_NOREPLACE flag will typically (upon detecting a collision with a preexisting
mapping) fall back to a "non-MAP_FIXED" type of behavior: they will return an address that is different from the requested address.
Therefore, backward-compatible software should check the returned address against the requested address.
(since Linux 4.17)
MAP_GROWSDOWN -
This flag is used for stacks. It indicates to the kernel virtual memory system that the mapping should extend downward in memory.
The return address is one page lower than the memory area that is actually created in the process's virtual address space. Touching an address in
the "guard" page below the mapping will cause the mapping to grow by a page. This growth can be repeated until the mapping grows to within a page
of the high end of the next lower mapping, at which point touching the "guard" page will result in a SIGSEGV signal.
MAP_HUGETLB -
Allocate the mapping using "huge" pages.
See the Linux kernel source file Documentation/admin-guide/mm/hugetlbpage.rst for further information, as well as NOTES, below.
(since Linux 2.6.32)
MAP_HUGE_2MB -
Used in conjunction with MAP_HUGETLB to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) on systems that support
multiple hugetlb page sizes.
More generally, the desired huge page size can be configured by encoding the base-2 logarithm of the desired page size in the six bits at the
offset MAP_HUGE_SHIFT. (A value of zero in this bit field provides the default huge page size; the default huge page size can be discovered via
the Hugepagesize field exposed by /proc/meminfo.) Thus, the above two constants are defined as:
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
|
| public static final int | PROT_EXECThe prot argument describes the desired memory protection of the mapping (and must not conflict with the open mode of the file).
|
| public static final int | PROT_GROWSDOWNThe prot argument describes the desired memory protection of the mapping (and must not conflict with the open mode of the file).
|
| public static final int | PROT_GROWSUPThe prot argument describes the desired memory protection of the mapping (and must not conflict with the open mode of the file).
|
| public static final int | PROT_NONEThe prot argument describes the desired memory protection of the mapping (and must not conflict with the open mode of the file).
|
| public static final int | PROT_READThe prot argument describes the desired memory protection of the mapping (and must not conflict with the open mode of the file).
|
| public static final int | PROT_WRITEThe prot argument describes the desired memory protection of the mapping (and must not conflict with the open mode of the file).
|