Add bionic headers for process_madvise
Test: atest bionic-unit-tests-static
Bug: 173258203
Change-Id: I396945b95de364055b87cc53321aed4fad4ebc70
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 7cf7a2d..33a8a61 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -113,6 +113,7 @@
int msync(const void*, size_t, int) all
int mprotect(const void*, size_t, int) all
int madvise(void*, size_t, int) all
+int process_madvise(int, const struct iovec*, size_t, int, unsigned int) all
int mlock(const void* addr, size_t len) all
int mlock2(const void* addr, size_t len, int flags) all
int munlock(const void* addr, size_t len) all
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index fe4ea7f..3b44dab 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <linux/memfd.h>
#include <linux/mman.h>
+#include <linux/uio.h>
__BEGIN_DECLS
@@ -161,6 +162,15 @@
*/
int madvise(void* __addr, size_t __size, int __advice);
+/**
+ * [process_madvise(2)](http://man7.org/linux/man-pages/man2/process_madvise.2.html)
+ * works just like madvise(2) but applies to the process specified by the given
+ * PID file descriptor.
+ *
+ * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ */
+int process_madvise(int __pid_fd, const struct iovec* __iov, size_t __count, int __advice, unsigned int __flags);
+
#if defined(__USE_GNU)
/**
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index a17a33f..f4f35ac 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -1552,12 +1552,13 @@
LIBC_S { # introduced=S
global:
- ffsl;
- ffsll;
__libc_get_static_tls_bounds;
__libc_register_thread_exit_callback;
__libc_iterate_dynamic_tls;
__libc_register_dynamic_tls_listeners;
+ ffsl;
+ ffsll;
+ process_madvise;
} LIBC_R;
LIBC_PRIVATE {