Add memfd_create(2) and mlock2(2).
These are old enough now that the latest devices will have kernels that
support them.
Also add basic doc comments to <sys/mman.h>.
Test: treehugger
Change-Id: I1b5ff5db0b6270f5c374287cac1d6a751a0259f5
diff --git a/libc/SECCOMP_WHITELIST_COMMON.TXT b/libc/SECCOMP_WHITELIST_COMMON.TXT
index a2114dd..07f84a8 100644
--- a/libc/SECCOMP_WHITELIST_COMMON.TXT
+++ b/libc/SECCOMP_WHITELIST_COMMON.TXT
@@ -68,28 +68,24 @@
# Useful new syscalls which we don't yet use in bionic.
#
-# Since Linux 3.14, not in glibc.
-int sched_getattr(pid_t pid, struct sched_attr* attr, unsigned int flags) all
-int sched_setattr(pid_t pid, struct sched_attr* attr, unsigned int size, unsigned int flags) all
-# Since Linux 3.15, glibc 2.27.
-int memfd_create(const char* name, unsigned int flags) all
-# Since Linux 3.19, not in glibc.
-int execveat(int dirfd, const char* pathname, char* const* argv, char* const* envp, int flags) all
-# Since Linux 4.3, not in glibc. Probed for and conditionally used by ART.
-int membarrier(int cmd, int flags) all
-# Since Linux 4.5, glibc 2.27.
-ssize_t copy_file_range(int fd_in, loff_t* off_in, int fd_out, loff_t* off_out, size_t len, unsigned int flags) all
-# Since Linux 4.4, glibc 2.27.
-int mlock2(const void* addr, size_t len, int flags) all
-# Since Linux 4.6, glibc 2.26.
-ssize_t preadv2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags) all
-ssize_t pwritev2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags) all
# Since Linux 2.5, not in glibc.
int io_setup(unsigned nr, aio_context_t *ctxp) all
int io_destroy(aio_context_t ctx) all
int io_submit(aio_context_t ctx, long nr, struct iocb **iocbpp) all
int io_getevents(aio_context_t ctx, long min_nr, long max_nr, struct io_event *events, struct timespec *timeout) all
int io_cancel(aio_context_t ctx, struct iocb *, struct io_event *result) all
+# Since Linux 3.14, not in glibc.
+int sched_getattr(pid_t pid, struct sched_attr* attr, unsigned int flags) all
+int sched_setattr(pid_t pid, struct sched_attr* attr, unsigned int size, unsigned int flags) all
+# Since Linux 3.19, not in glibc (and not really needed to implement fexecve).
+int execveat(int dirfd, const char* pathname, char* const* argv, char* const* envp, int flags) all
+# Since Linux 4.3, not in glibc. Probed for and conditionally used by ART.
+int membarrier(int cmd, int flags) all
+# Since Linux 4.5, glibc 2.27.
+ssize_t copy_file_range(int fd_in, loff_t* off_in, int fd_out, loff_t* off_out, size_t len, unsigned int flags) all
+# Since Linux 4.6, glibc 2.26.
+ssize_t preadv2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags) all
+ssize_t pwritev2(int fd, const struct iovec* iov, int iovcnt, off_t offset, int flags) all
# Since Linux 4.11, glibc 2.30.
int statx(int, const char*, int, unsigned int, statx*) all
# Since Linux 5.1, not in glibc.