Add PR_SET_VMA and PR_SET_VMA_ANON_NAME to <sys/prctl.h>.
We've copied & pasted these to too many places. And if we're going to
have another go at upstreaming these, that's probably yet another reason
to have the *values* in just one place. (Even if upstream wants different
names, we'll likely keep the legacy names around for a while for source
compatibility.)
Bug: http://b/111903542
Test: ran tests
Change-Id: I8ccc557453d69530e5b74f865cbe0b458c84e3ba
diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp
index a37e910..de3309b 100644
--- a/linker/linker_allocator.cpp
+++ b/linker/linker_allocator.cpp
@@ -35,12 +35,11 @@
#include <stdlib.h>
#include <sys/mman.h>
+#include <sys/prctl.h>
#include <unistd.h>
#include <async_safe/log.h>
-#include "private/bionic_prctl.h"
-
//
// LinkerMemeoryAllocator is general purpose allocator
// designed to provide the same functionality as the malloc/free/realloc
diff --git a/linker/linker_allocator.h b/linker/linker_allocator.h
index 82e4ef4..8c4198b 100644
--- a/linker/linker_allocator.h
+++ b/linker/linker_allocator.h
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <sys/cdefs.h>
#include <sys/mman.h>
+#include <sys/prctl.h>
#include <stddef.h>
#include <unistd.h>
@@ -39,8 +40,6 @@
#include <async_safe/log.h>
-#include "private/bionic_prctl.h"
-
const uint32_t kSmallObjectMaxSizeLog2 = 10;
const uint32_t kSmallObjectMinSizeLog2 = 4;
const uint32_t kSmallObjectAllocatorsCount = kSmallObjectMaxSizeLog2 - kSmallObjectMinSizeLog2 + 1;
diff --git a/linker/linker_block_allocator.cpp b/linker/linker_block_allocator.cpp
index abb1ebd..dca944e 100644
--- a/linker/linker_block_allocator.cpp
+++ b/linker/linker_block_allocator.cpp
@@ -30,10 +30,9 @@
#include <inttypes.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/prctl.h>
#include <unistd.h>
-#include "private/bionic_prctl.h"
-
// the multiplier should be power of 2
static constexpr size_t round_up(size_t size, size_t multiplier) {
return (size + (multiplier - 1)) & ~(multiplier-1);
diff --git a/linker/linker_cfi.cpp b/linker/linker_cfi.cpp
index 8910c3f..782ebc6 100644
--- a/linker/linker_cfi.cpp
+++ b/linker/linker_cfi.cpp
@@ -31,9 +31,9 @@
#include "linker_debug.h"
#include "linker_globals.h"
#include "private/bionic_page.h"
-#include "private/bionic_prctl.h"
#include <sys/mman.h>
+#include <sys/prctl.h>
#include <sys/types.h>
#include <cstdint>
diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp
index 54354a8..0a7ccd8 100644
--- a/linker/linker_phdr.cpp
+++ b/linker/linker_phdr.cpp
@@ -31,6 +31,7 @@
#include <errno.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/prctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -41,7 +42,6 @@
#include "linker_debug.h"
#include "linker_utils.h"
-#include "private/bionic_prctl.h"
#include "private/CFIShadow.h" // For kLibraryAlignment
static int GetTargetElfMachine() {