1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

Expose all MAP_ constants in <sys/mman.h> unconditionally (bug 29375)

POSIX reserves the MAP_ prefix for <sys/mman.h>, so there is no need to
conditionalize their definitions on feature test macros.
This commit is contained in:
Andreas Schwab
2022-08-16 15:18:11 +02:00
parent 589eda82bb
commit 954b8f3895
10 changed files with 90 additions and 124 deletions

View File

@@ -41,26 +41,22 @@
/* Sharing types (must choose one and only one of these). */
#define MAP_SHARED 0x01 /* Share changes. */
#define MAP_PRIVATE 0x02 /* Changes are private. */
#ifdef __USE_MISC
# define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate
#define MAP_SHARED_VALIDATE 0x03 /* Share changes and validate
extension flags. */
# define MAP_TYPE 0x0f /* Mask for type of mapping. */
#endif
#define MAP_TYPE 0x0f /* Mask for type of mapping. */
/* Other flags. */
#define MAP_FIXED 0x10 /* Interpret addr exactly. */
#ifdef __USE_MISC
# define MAP_FILE 0
# ifdef __MAP_ANONYMOUS
# define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */
# else
# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
# endif
# define MAP_ANON MAP_ANONYMOUS
/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
# define MAP_HUGE_SHIFT 26
# define MAP_HUGE_MASK 0x3f
#define MAP_FILE 0
#ifdef __MAP_ANONYMOUS
# define MAP_ANONYMOUS __MAP_ANONYMOUS /* Don't use a file. */
#else
# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
#endif
#define MAP_ANON MAP_ANONYMOUS
/* When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size. */
#define MAP_HUGE_SHIFT 26
#define MAP_HUGE_MASK 0x3f
/* Flags to `msync'. */
#define MS_ASYNC 1 /* Sync memory asynchronously. */

View File

@@ -25,18 +25,16 @@
includes asm-generic/mman.h without any changes to the values of
the MAP_* flags defined in that header. */
#ifdef __USE_MISC
# define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
# define MAP_DENYWRITE 0x00800 /* ETXTBSY. */
# define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
# define MAP_LOCKED 0x02000 /* Lock the mapping. */
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
# define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
# define MAP_SYNC 0x80000 /* Perform synchronous page
#define MAP_GROWSDOWN 0x00100 /* Stack-like segment. */
#define MAP_DENYWRITE 0x00800 /* ETXTBSY. */
#define MAP_EXECUTABLE 0x01000 /* Mark it as an executable. */
#define MAP_LOCKED 0x02000 /* Lock the mapping. */
#define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
#define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
#define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
#define MAP_STACK 0x20000 /* Allocation is for a stack. */
#define MAP_HUGETLB 0x40000 /* Create huge page mapping. */
#define MAP_SYNC 0x80000 /* Perform synchronous page
faults for the mapping. */
# define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED but do not unmap
underlying mapping. */
#endif