summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-08-08 16:57:15 -0700
committerDmitriy Ivanov <dimitry@google.com>2014-08-13 18:15:29 -0700
commit4bea4c631f747cc6b570ecd42c744a9b1103bf28 (patch)
tree6c8bc565ee133602d54fedaa17a04c60aaa92c96 /libc
parent8a84d383fb74135e928d341baa180c55854f2f42 (diff)
downloadbionic-4bea4c631f747cc6b570ecd42c744a9b1103bf28.zip
bionic-4bea4c631f747cc6b570ecd42c744a9b1103bf28.tar.gz
bionic-4bea4c631f747cc6b570ecd42c744a9b1103bf28.tar.bz2
Label pages mapped by linker_allocator
(cherry picked from commit 51a22a12ab370933a35463f5c81223132ec64dcb) Bug: 17013324 Change-Id: I345c9d0fecc29d3626c5be01cc3c0ed1583ac361
Diffstat (limited to 'libc')
-rw-r--r--libc/bionic/dlmalloc.c6
-rw-r--r--libc/private/bionic_prctl.h26
2 files changed, 27 insertions, 5 deletions
diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c
index d582071..e89c5d1 100644
--- a/libc/bionic/dlmalloc.c
+++ b/libc/bionic/dlmalloc.c
@@ -16,6 +16,7 @@
#include "dlmalloc.h"
+#include "private/bionic_prctl.h"
#include "private/libc_logging.h"
// Send dlmalloc errors to the log.
@@ -30,11 +31,6 @@ static void* named_anonymous_mmap(size_t length);
#define MMAP(s) named_anonymous_mmap(s)
#define DIRECT_MMAP(s) named_anonymous_mmap(s)
-// Local definitions of custom prctl arguments to set a vma name in Android kernels.
-#include <sys/prctl.h>
-#define PR_SET_VMA 0x53564d41
-#define PR_SET_VMA_ANON_NAME 0
-
// Ugly inclusion of C file so that bionic specific #defines configure dlmalloc.
#include "../upstream-dlmalloc/malloc.c"
diff --git a/libc/private/bionic_prctl.h b/libc/private/bionic_prctl.h
new file mode 100644
index 0000000..103cccb
--- /dev/null
+++ b/libc/private/bionic_prctl.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef BIONIC_PRCTL_H
+#define BIONIC_PRCTL_H
+
+#include <sys/prctl.h>
+
+// This is only supported by Android kernels, so it's not in the uapi headers.
+#define PR_SET_VMA 0x53564d41
+#define PR_SET_VMA_ANON_NAME 0
+
+#endif // BIONIC_PRCTL_H