summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2016-01-24 01:19:38 +0000
committerRich Felker <dalias@aerifal.cx>2016-01-26 18:31:05 -0500
commit789ff6a9f8ec91729cde7fdcb0568d5d928eeba5 (patch)
tree2e7b75b6a7845486d033701140794536bd32e07e
parent51d5f139ca9e79d621a396542dde5b8cd76c5c3f (diff)
downloadmusl-789ff6a9f8ec91729cde7fdcb0568d5d928eeba5.tar.gz
add MCL_ONFAULT and MLOCK_ONFAULT mlockall and mlock2 flags
they lock faulted pages into memory (useful when a small part of a large mapped file needs efficient access), new in linux v4.4, commit b0f205c2a3082dd9081f9a94e50658c5fa906ff1 MLOCK_* is not in the POSIX reserved namespace for sys/mman.h
-rw-r--r--arch/aarch64/bits/mman.h1
-rw-r--r--arch/arm/bits/mman.h1
-rw-r--r--arch/i386/bits/mman.h1
-rw-r--r--arch/microblaze/bits/mman.h1
-rw-r--r--arch/mips/bits/mman.h1
-rw-r--r--arch/or1k/bits/mman.h1
-rw-r--r--arch/powerpc/bits/mman.h1
-rw-r--r--arch/sh/bits/mman.h1
-rw-r--r--arch/x32/bits/mman.h1
-rw-r--r--arch/x86_64/bits/mman.h1
-rw-r--r--include/sys/mman.h1
11 files changed, 11 insertions, 0 deletions
diff --git a/arch/aarch64/bits/mman.h b/arch/aarch64/bits/mman.h
index ce5519f2..31ece5bf 100644
--- a/arch/aarch64/bits/mman.h
+++ b/arch/aarch64/bits/mman.h
@@ -36,6 +36,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/arm/bits/mman.h b/arch/arm/bits/mman.h
index cc854aae..ea6f6a78 100644
--- a/arch/arm/bits/mman.h
+++ b/arch/arm/bits/mman.h
@@ -37,6 +37,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/i386/bits/mman.h b/arch/i386/bits/mman.h
index 0f53acb7..0c9022fd 100644
--- a/arch/i386/bits/mman.h
+++ b/arch/i386/bits/mman.h
@@ -38,6 +38,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/microblaze/bits/mman.h b/arch/microblaze/bits/mman.h
index cc854aae..ea6f6a78 100644
--- a/arch/microblaze/bits/mman.h
+++ b/arch/microblaze/bits/mman.h
@@ -37,6 +37,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/mips/bits/mman.h b/arch/mips/bits/mman.h
index 3125fc2b..cb9ac539 100644
--- a/arch/mips/bits/mman.h
+++ b/arch/mips/bits/mman.h
@@ -37,6 +37,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/or1k/bits/mman.h b/arch/or1k/bits/mman.h
index cc854aae..ea6f6a78 100644
--- a/arch/or1k/bits/mman.h
+++ b/arch/or1k/bits/mman.h
@@ -37,6 +37,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/powerpc/bits/mman.h b/arch/powerpc/bits/mman.h
index 779fddec..6581edc5 100644
--- a/arch/powerpc/bits/mman.h
+++ b/arch/powerpc/bits/mman.h
@@ -38,6 +38,7 @@
#define MCL_CURRENT 0x2000
#define MCL_FUTURE 0x4000
+#define MCL_ONFAULT 0x8000
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/sh/bits/mman.h b/arch/sh/bits/mman.h
index f6fc98f0..3a25df1e 100644
--- a/arch/sh/bits/mman.h
+++ b/arch/sh/bits/mman.h
@@ -38,6 +38,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/x32/bits/mman.h b/arch/x32/bits/mman.h
index 846b7eae..f3235f4e 100644
--- a/arch/x32/bits/mman.h
+++ b/arch/x32/bits/mman.h
@@ -38,6 +38,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/arch/x86_64/bits/mman.h b/arch/x86_64/bits/mman.h
index 846b7eae..f3235f4e 100644
--- a/arch/x86_64/bits/mman.h
+++ b/arch/x86_64/bits/mman.h
@@ -38,6 +38,7 @@
#define MCL_CURRENT 1
#define MCL_FUTURE 2
+#define MCL_ONFAULT 4
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define MADV_NORMAL 0
diff --git a/include/sys/mman.h b/include/sys/mman.h
index 9fc2db51..a1864ec8 100644
--- a/include/sys/mman.h
+++ b/include/sys/mman.h
@@ -39,6 +39,7 @@ int remap_file_pages (void *, size_t, int, size_t, int);
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+#define MLOCK_ONFAULT 0x01
int madvise (void *, size_t, int);
int mincore (void *, size_t, unsigned char *);
#endif