Merge "linker: add android_get_exported_namespace"
diff --git a/libc/Android.bp b/libc/Android.bp
index e8175f4..590fd28 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -2076,7 +2076,7 @@
 }
 
 ndk_headers {
-    name: "libc_android",
+    name: "libc_kernel_android_uapi_linux",
     from: "kernel/android/uapi/linux",
     to: "linux",
     srcs: ["kernel/android/uapi/linux/**/*.h"],
@@ -2084,6 +2084,14 @@
 }
 
 ndk_headers {
+    name: "libc_kernel_android_scsi",
+    from: "kernel/android/scsi",
+    to: "scsi",
+    srcs: ["kernel/android/scsi/**/*.h"],
+    license: "NOTICE",
+}
+
+ndk_headers {
     name: "libc_asm_arm",
     from: "kernel/uapi/asm-arm",
     to: "arm-linux-androideabi",
diff --git a/libc/SECCOMP_WHITELIST.TXT b/libc/SECCOMP_WHITELIST.TXT
index 7dadd39..a2a54c6 100644
--- a/libc/SECCOMP_WHITELIST.TXT
+++ b/libc/SECCOMP_WHITELIST.TXT
@@ -104,3 +104,14 @@
 
 # b/36726183. Note arm does not support mmap
 void*	mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)	x86,mips
+
+# Useful new syscalls which we don't yet use in bionic.
+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
+int memfd_create(const char* name, unsigned int flags) all
+int renameat2(int olddirfd, const char* oldpath, int newdirfd, const char* newpath, unsigned int flags)  all
+int execveat(int dirfd, const char* pathname, char* const* argv, char* const* envp, int flags)  all
+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
+int mlock2(const void* addr, size_t len, int flags) all
+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
diff --git a/libc/bionic/__libc_current_sigrtmax.cpp b/libc/bionic/__libc_current_sigrtmax.cpp
index 27fcb35..32179bb 100644
--- a/libc/bionic/__libc_current_sigrtmax.cpp
+++ b/libc/bionic/__libc_current_sigrtmax.cpp
@@ -29,5 +29,7 @@
 #include <signal.h>
 
 int __libc_current_sigrtmax(void) {
+  // If you change this, also change __ndk_legacy___libc_current_sigrtmax
+  // in <android/legacy_signal_inlines.h> to match.
   return __SIGRTMAX;
 }
diff --git a/libc/bionic/__libc_current_sigrtmin.cpp b/libc/bionic/__libc_current_sigrtmin.cpp
index 7c93267..f3b2bf6 100644
--- a/libc/bionic/__libc_current_sigrtmin.cpp
+++ b/libc/bionic/__libc_current_sigrtmin.cpp
@@ -34,5 +34,7 @@
 // __SIGRTMIN + 3 is reserved for triggering native stack dumps.
 
 int __libc_current_sigrtmin(void) {
+  // If you change this, also change __ndk_legacy___libc_current_sigrtmin
+  // in <android/legacy_signal_inlines.h> to match.
   return __SIGRTMIN + 4;
 }
diff --git a/libc/include/android/legacy_signal_inlines.h b/libc/include/android/legacy_signal_inlines.h
index afdaca8..a5d3a6f 100644
--- a/libc/include/android/legacy_signal_inlines.h
+++ b/libc/include/android/legacy_signal_inlines.h
@@ -41,6 +41,25 @@
 
 #if __ANDROID_API__ < __ANDROID_API_L__
 
+/* These weren't introduced until L. */
+int __libc_current_sigrtmax() __attribute__((__weak__)) __VERSIONER_NO_GUARD;
+int __libc_current_sigrtmin() __attribute__((__weak__)) __VERSIONER_NO_GUARD;
+
+static __inline int __ndk_legacy___libc_current_sigrtmax() {
+  if (__libc_current_sigrtmax) return __libc_current_sigrtmax();
+  return __SIGRTMAX; /* Should match __libc_current_sigrtmax. */
+}
+
+static __inline int __ndk_legacy___libc_current_sigrtmin() {
+  if (__libc_current_sigrtmin) return __libc_current_sigrtmin();
+  return __SIGRTMIN + 4; /* Should match __libc_current_sigrtmin. */
+}
+
+#undef SIGRTMAX
+#define SIGRTMAX __ndk_legacy___libc_current_sigrtmax()
+#undef SIGRTMIN
+#define SIGRTMIN __ndk_legacy___libc_current_sigrtmin()
+
 static __inline int sigismember(const sigset_t *set, int signum) {
   /* Signal numbers start at 1, but bit positions start at 0. */
   int bit = signum - 1;
diff --git a/libc/include/bits/wctype.h b/libc/include/bits/wctype.h
index c968d71..f21d46e 100644
--- a/libc/include/bits/wctype.h
+++ b/libc/include/bits/wctype.h
@@ -58,8 +58,8 @@
 int iswctype(wint_t, wctype_t);
 
 typedef const void* wctrans_t;
-wint_t towctrans(wint_t, wctrans_t) __INTRODUCED_IN_FUTURE __VERSIONER_NO_GUARD;
-wctrans_t wctrans(const char*) __INTRODUCED_IN_FUTURE __VERSIONER_NO_GUARD;
+wint_t towctrans(wint_t, wctrans_t) __INTRODUCED_IN(26) __VERSIONER_NO_GUARD;
+wctrans_t wctrans(const char*) __INTRODUCED_IN(26) __VERSIONER_NO_GUARD;
 
 __END_DECLS
 
diff --git a/libc/include/complex.h b/libc/include/complex.h
index f4dc124..c020e4f 100644
--- a/libc/include/complex.h
+++ b/libc/include/complex.h
@@ -61,63 +61,63 @@
 /* 7.3.5.1 The cacos functions */
 double complex cacos(double complex) __INTRODUCED_IN(23);
 float complex cacosf(float complex) __INTRODUCED_IN(23);
-long double complex cacosl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex cacosl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.5.2 The casin functions */
 double complex casin(double complex) __INTRODUCED_IN(23);
 float complex casinf(float complex) __INTRODUCED_IN(23);
-long double complex casinl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex casinl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.5.1 The catan functions */
 double complex catan(double complex) __INTRODUCED_IN(23);
 float complex catanf(float complex) __INTRODUCED_IN(23);
-long double complex catanl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex catanl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.5.1 The ccos functions */
 double complex ccos(double complex) __INTRODUCED_IN(23);
 float complex ccosf(float complex) __INTRODUCED_IN(23);
-long double complex ccosl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex ccosl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.5.1 The csin functions */
 double complex csin(double complex) __INTRODUCED_IN(23);
 float complex csinf(float complex) __INTRODUCED_IN(23);
-long double complex csinl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex csinl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.5.1 The ctan functions */
 double complex ctan(double complex) __INTRODUCED_IN(23);
 float complex ctanf(float complex) __INTRODUCED_IN(23);
-long double complex ctanl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex ctanl(long double complex) __INTRODUCED_IN(26);
 
 /* 7.3.6 Hyperbolic functions */
 /* 7.3.6.1 The cacosh functions */
 double complex cacosh(double complex) __INTRODUCED_IN(23);
 float complex cacoshf(float complex) __INTRODUCED_IN(23);
-long double complex cacoshl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex cacoshl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.6.2 The casinh functions */
 double complex casinh(double complex) __INTRODUCED_IN(23);
 float complex casinhf(float complex) __INTRODUCED_IN(23);
-long double complex casinhl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex casinhl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.6.3 The catanh functions */
 double complex catanh(double complex) __INTRODUCED_IN(23);
 float complex catanhf(float complex) __INTRODUCED_IN(23);
-long double complex catanhl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex catanhl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.6.4 The ccosh functions */
 double complex ccosh(double complex) __INTRODUCED_IN(23);
 float complex ccoshf(float complex) __INTRODUCED_IN(23);
-long double complex ccoshl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex ccoshl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.6.5 The csinh functions */
 double complex csinh(double complex) __INTRODUCED_IN(23);
 float complex csinhf(float complex) __INTRODUCED_IN(23);
-long double complex csinhl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex csinhl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.6.6 The ctanh functions */
 double complex ctanh(double complex) __INTRODUCED_IN(23);
 float complex ctanhf(float complex) __INTRODUCED_IN(23);
-long double complex ctanhl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex ctanhl(long double complex) __INTRODUCED_IN(26);
 
 /* 7.3.7 Exponential and logarithmic functions */
 /* 7.3.7.1 The cexp functions */
 double complex cexp(double complex) __INTRODUCED_IN(23);
 float complex cexpf(float complex) __INTRODUCED_IN(23);
-long double complex cexpl(long double complex) __INTRODUCED_IN_FUTURE;
+long double complex cexpl(long double complex) __INTRODUCED_IN(26);
 /* 7.3.7.2 The clog functions */
-double complex clog(double complex) __INTRODUCED_IN_FUTURE;
-float complex clogf(float complex) __INTRODUCED_IN_FUTURE;
-long double complex clogl(long double complex) __INTRODUCED_IN_FUTURE;
+double complex clog(double complex) __INTRODUCED_IN(26);
+float complex clogf(float complex) __INTRODUCED_IN(26);
+long double complex clogl(long double complex) __INTRODUCED_IN(26);
 
 /* 7.3.8 Power and absolute-value functions */
 /* 7.3.8.1 The cabs functions */
@@ -125,9 +125,9 @@
 float cabsf(float complex) __INTRODUCED_IN(23);
 long double cabsl(long double complex) __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(23);
 /* 7.3.8.2 The cpow functions */
-double complex cpow(double complex, double complex) __INTRODUCED_IN_FUTURE;
-float complex cpowf(float complex, float complex) __INTRODUCED_IN_FUTURE;
-long double complex cpowl(long double complex, long double complex) __INTRODUCED_IN_FUTURE;
+double complex cpow(double complex, double complex) __INTRODUCED_IN(26);
+float complex cpowf(float complex, float complex) __INTRODUCED_IN(26);
+long double complex cpowl(long double complex, long double complex) __INTRODUCED_IN(26);
 /* 7.3.8.3 The csqrt functions */
 double complex csqrt(double complex) __INTRODUCED_IN(23);
 float complex csqrtf(float complex) __INTRODUCED_IN(23);
diff --git a/libc/include/elf.h b/libc/include/elf.h
index c36bc8d..4181006 100644
--- a/libc/include/elf.h
+++ b/libc/include/elf.h
@@ -184,6 +184,12 @@
 
 #define PT_GNU_RELRO 0x6474e552
 
+#undef ELF_ST_TYPE
+#define ELF_ST_TYPE(x) ((x) & 0xf)
+#define ELF_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf))
+#define ELF32_ST_INFO(b,t) ELF_ST_INFO(b,t)
+#define ELF64_ST_INFO(b,t) ELF_ST_INFO(b,t)
+
 #define STB_LOOS      10
 #define STB_HIOS      12
 #define STB_LOPROC    13
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 2d01be7..652430c 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -91,7 +91,7 @@
 
 #if defined(__USE_GNU)
 ssize_t readahead(int, off64_t, size_t) __INTRODUCED_IN(16);
-int sync_file_range(int, off64_t, off64_t, unsigned int) __INTRODUCED_IN_FUTURE;
+int sync_file_range(int, off64_t, off64_t, unsigned int) __INTRODUCED_IN(26);
 #endif
 
 int __open_2(const char*, int) __INTRODUCED_IN(17);
diff --git a/libc/include/grp.h b/libc/include/grp.h
index 1d38265..b727562 100644
--- a/libc/include/grp.h
+++ b/libc/include/grp.h
@@ -51,10 +51,10 @@
 struct group* getgrnam(const char*);
 
 /* Note: Android has thousands and thousands of ids to iterate through. */
-struct group* getgrent(void) __INTRODUCED_IN_FUTURE;
+struct group* getgrent(void) __INTRODUCED_IN(26);
 
-void setgrent(void) __INTRODUCED_IN_FUTURE;
-void endgrent(void) __INTRODUCED_IN_FUTURE;
+void setgrent(void) __INTRODUCED_IN(26);
+void endgrent(void) __INTRODUCED_IN(26);
 int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**) __INTRODUCED_IN(24);
 int getgrnam_r(const char*, struct group*, char*, size_t, struct group**) __INTRODUCED_IN(24);
 int getgrouplist (const char*, gid_t, gid_t*, int*);
diff --git a/libc/include/langinfo.h b/libc/include/langinfo.h
index 5c884ac..c330117 100644
--- a/libc/include/langinfo.h
+++ b/libc/include/langinfo.h
@@ -92,8 +92,8 @@
 #define NOEXPR 54
 #define CRNCYSTR 55
 
-char* nl_langinfo(nl_item) __INTRODUCED_IN_FUTURE;
-char* nl_langinfo_l(nl_item, locale_t) __INTRODUCED_IN_FUTURE;
+char* nl_langinfo(nl_item) __INTRODUCED_IN(26);
+char* nl_langinfo_l(nl_item, locale_t) __INTRODUCED_IN(26);
 
 __END_DECLS
 
diff --git a/libc/include/link.h b/libc/include/link.h
index 0d07cb9..dd3b99f 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -28,6 +28,7 @@
 #ifndef _LINK_H_
 #define _LINK_H_
 
+#include <stdint.h>
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
@@ -55,7 +56,7 @@
 #endif
 
 #ifdef __arm__
-typedef long unsigned int* _Unwind_Ptr;
+typedef uintptr_t _Unwind_Ptr;
 _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr, int*);
 #endif
 
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index 752ee72..412e3f0 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -23,13 +23,9 @@
 
 __BEGIN_DECLS
 
-#if defined(__clang__)
-/* clang should support alloc_size in the nearish future. */
-#if __has_attribute(alloc_size)
-#error "We should enable alloc_size for clang."
-#else
+// Remove the workaround once b/37423073 is fixed.
+#if defined(__clang__) && !__has_attribute(alloc_size)
 #define __BIONIC_ALLOC_SIZE(...)
-#endif
 #else
 #define __BIONIC_ALLOC_SIZE(...) __attribute__((__alloc_size__(__VA_ARGS__)))
 #endif
diff --git a/libc/include/mntent.h b/libc/include/mntent.h
index ad9d72f..551a085 100644
--- a/libc/include/mntent.h
+++ b/libc/include/mntent.h
@@ -61,7 +61,7 @@
 struct mntent* getmntent(FILE*);
 struct mntent* getmntent_r(FILE*, struct mntent*, char*, int) __INTRODUCED_IN(21);
 FILE* setmntent(const char*, const char*) __INTRODUCED_IN(21);
-char* hasmntopt(const struct mntent*, const char*) __INTRODUCED_IN_FUTURE;
+char* hasmntopt(const struct mntent*, const char*) __INTRODUCED_IN(26);
 
 __END_DECLS
 
diff --git a/libc/include/nl_types.h b/libc/include/nl_types.h
index bcaab06..d478353 100644
--- a/libc/include/nl_types.h
+++ b/libc/include/nl_types.h
@@ -39,9 +39,9 @@
 typedef void* nl_catd;
 typedef int nl_item;
 
-nl_catd catopen(const char*, int) __INTRODUCED_IN_FUTURE;
-char* catgets(nl_catd, int, int, const char*) __INTRODUCED_IN_FUTURE;
-int catclose(nl_catd) __INTRODUCED_IN_FUTURE;
+nl_catd catopen(const char*, int) __INTRODUCED_IN(26);
+char* catgets(nl_catd, int, int, const char*) __INTRODUCED_IN(26);
+int catclose(nl_catd) __INTRODUCED_IN(26);
 
 __END_DECLS
 
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index ae4fdce..c34d1a3 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -207,7 +207,7 @@
 pthread_t pthread_self(void) __attribute_const__;
 
 #if defined(__USE_GNU)
-int pthread_getname_np(pthread_t, char* _Nonnull, size_t) __INTRODUCED_IN_FUTURE;
+int pthread_getname_np(pthread_t, char* _Nonnull, size_t) __INTRODUCED_IN(26);
 #endif
 /* TODO: this should be __USE_GNU too. */
 int pthread_setname_np(pthread_t, const char* _Nonnull);
diff --git a/libc/include/pwd.h b/libc/include/pwd.h
index 223fc5a..e37c637 100644
--- a/libc/include/pwd.h
+++ b/libc/include/pwd.h
@@ -84,10 +84,10 @@
 struct passwd* getpwuid(uid_t);
 
 /* Note: Android has thousands and thousands of ids to iterate through */
-struct passwd* getpwent(void) __INTRODUCED_IN_FUTURE;
+struct passwd* getpwent(void) __INTRODUCED_IN(26);
 
-void setpwent(void) __INTRODUCED_IN_FUTURE;
-void endpwent(void) __INTRODUCED_IN_FUTURE;
+void setpwent(void) __INTRODUCED_IN(26);
+void endpwent(void) __INTRODUCED_IN(26);
 
 int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**) __INTRODUCED_IN(12);
 int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**) __INTRODUCED_IN(12);
diff --git a/libc/include/signal.h b/libc/include/signal.h
index ffce1fa..1400328 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -136,16 +136,16 @@
 
 int sighold(int)
   __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
-  __INTRODUCED_IN_FUTURE;
+  __INTRODUCED_IN(26);
 int sigignore(int)
-  __attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN_FUTURE;
+  __attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN(26);
 int sigpause(int)
-  __attribute__((deprecated("use sigsuspend() instead"))) __INTRODUCED_IN_FUTURE;
+  __attribute__((deprecated("use sigsuspend() instead"))) __INTRODUCED_IN(26);
 int sigrelse(int)
   __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
-  __INTRODUCED_IN_FUTURE;
+  __INTRODUCED_IN(26);
 sighandler_t sigset(int, sighandler_t)
-  __attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN_FUTURE;
+  __attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN(26);
 
 int raise(int);
 int kill(pid_t, int);
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 8b0e9df..24916d6 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -227,7 +227,7 @@
 int vsscanf(const char* __restrict _Nonnull, const char* __restrict _Nonnull, __va_list) __scanflike(2, 0);
 
 #define L_ctermid 1024 /* size for ctermid() */
-char* ctermid(char*) __INTRODUCED_IN_FUTURE;
+char* ctermid(char*) __INTRODUCED_IN(26);
 
 FILE* fdopen(int, const char*);
 int fileno(FILE*);
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index bf25160..3cd8ad1 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -77,7 +77,7 @@
 double strtod(const char*, char**);
 long double strtold(const char*, char**) __INTRODUCED_IN(21);
 
-unsigned long strtoul_l(const char*, char**, int, locale_t) __INTRODUCED_IN_FUTURE;
+unsigned long strtoul_l(const char*, char**, int, locale_t) __INTRODUCED_IN(26);
 
 int atoi(const char*) __attribute_pure__;
 long atol(const char*) __attribute_pure__;
@@ -119,7 +119,7 @@
 int ptsname_r(int, char*, size_t);
 int unlockpt(int);
 
-int getsubopt(char**, char* const*, char**) __INTRODUCED_IN_FUTURE;
+int getsubopt(char**, char* const*, char**) __INTRODUCED_IN(26);
 
 typedef struct {
     int  quot;
@@ -146,7 +146,7 @@
 const char* getprogname(void) __INTRODUCED_IN(21);
 void setprogname(const char*) __INTRODUCED_IN(21);
 
-int mblen(const char*, size_t) __INTRODUCED_IN_FUTURE __VERSIONER_NO_GUARD;
+int mblen(const char*, size_t) __INTRODUCED_IN(26) __VERSIONER_NO_GUARD;
 size_t mbstowcs(wchar_t*, const char*, size_t);
 int mbtowc(wchar_t*, const char*, size_t) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD;
 int wctomb(char*, wchar_t) __INTRODUCED_IN(21) __VERSIONER_NO_GUARD;
@@ -226,9 +226,9 @@
 #endif
 
 #if __ANDROID_API__ >= __ANDROID_API_FUTURE__
-double strtod_l(const char*, char**, locale_t) __INTRODUCED_IN_FUTURE;
-float strtof_l(const char*, char**, locale_t) __INTRODUCED_IN_FUTURE;
-long strtol_l(const char*, char**, int, locale_t) __INTRODUCED_IN_FUTURE;
+double strtod_l(const char*, char**, locale_t) __INTRODUCED_IN(26);
+float strtof_l(const char*, char**, locale_t) __INTRODUCED_IN(26);
+long strtol_l(const char*, char**, int, locale_t) __INTRODUCED_IN(26);
 #else
 // Implemented as static inlines.
 #endif
diff --git a/libc/include/sys/msg.h b/libc/include/sys/msg.h
index f746bb5..ced5a3e 100644
--- a/libc/include/sys/msg.h
+++ b/libc/include/sys/msg.h
@@ -41,10 +41,10 @@
 typedef __kernel_ulong_t msgqnum_t;
 typedef __kernel_ulong_t msglen_t;
 
-int msgctl(int, int, struct msqid_ds*) __INTRODUCED_IN_FUTURE;
-int msgget(key_t, int) __INTRODUCED_IN_FUTURE;
-ssize_t msgrcv(int, void*, size_t, long, int) __INTRODUCED_IN_FUTURE;
-int msgsnd(int, const void*, size_t, int) __INTRODUCED_IN_FUTURE;
+int msgctl(int, int, struct msqid_ds*) __INTRODUCED_IN(26);
+int msgget(key_t, int) __INTRODUCED_IN(26);
+ssize_t msgrcv(int, void*, size_t, long, int) __INTRODUCED_IN(26);
+int msgsnd(int, const void*, size_t, int) __INTRODUCED_IN(26);
 
 __END_DECLS
 
diff --git a/libc/include/sys/quota.h b/libc/include/sys/quota.h
index 08ca982..51f7675 100644
--- a/libc/include/sys/quota.h
+++ b/libc/include/sys/quota.h
@@ -40,7 +40,7 @@
 
 __BEGIN_DECLS
 
-int quotactl(int, const char*, int, char*) __INTRODUCED_IN_FUTURE;
+int quotactl(int, const char*, int, char*) __INTRODUCED_IN(26);
 
 __END_DECLS
 
diff --git a/libc/include/sys/sem.h b/libc/include/sys/sem.h
index 99873c1..904c334 100644
--- a/libc/include/sys/sem.h
+++ b/libc/include/sys/sem.h
@@ -43,12 +43,12 @@
 
 __BEGIN_DECLS
 
-int semctl(int, int, int, ...) __INTRODUCED_IN_FUTURE;
-int semget(key_t, int, int) __INTRODUCED_IN_FUTURE;
-int semop(int, struct sembuf*, size_t) __INTRODUCED_IN_FUTURE;
+int semctl(int, int, int, ...) __INTRODUCED_IN(26);
+int semget(key_t, int, int) __INTRODUCED_IN(26);
+int semop(int, struct sembuf*, size_t) __INTRODUCED_IN(26);
 
 #if defined(__USE_GNU)
-int semtimedop(int, struct sembuf*, size_t, const struct timespec*) __INTRODUCED_IN_FUTURE;
+int semtimedop(int, struct sembuf*, size_t, const struct timespec*) __INTRODUCED_IN(26);
 #endif
 
 __END_DECLS
diff --git a/libc/include/sys/shm.h b/libc/include/sys/shm.h
index 7836460..ccd3b36 100644
--- a/libc/include/sys/shm.h
+++ b/libc/include/sys/shm.h
@@ -42,10 +42,10 @@
 
 typedef unsigned long shmatt_t;
 
-void* shmat(int, const void*, int) __INTRODUCED_IN_FUTURE;
-int shmctl(int, int, struct shmid_ds*) __INTRODUCED_IN_FUTURE;
-int shmdt(const void*) __INTRODUCED_IN_FUTURE;
-int shmget(key_t, size_t, int) __INTRODUCED_IN_FUTURE;
+void* shmat(int, const void*, int) __INTRODUCED_IN(26);
+int shmctl(int, int, struct shmid_ds*) __INTRODUCED_IN(26);
+int shmdt(const void*) __INTRODUCED_IN(26);
+int shmget(key_t, size_t, int) __INTRODUCED_IN(26);
 
 __END_DECLS
 
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index c87465f..2dc54aa 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -326,7 +326,7 @@
         socklen_t*) __overloadable __RENAME_CLANG(recvfrom);
 
 extern ssize_t __sendto_chk(int, const void*, size_t, size_t, int, const struct sockaddr*,
-        socklen_t) __INTRODUCED_IN_FUTURE;
+        socklen_t) __INTRODUCED_IN(26);
 ssize_t __recvfrom_chk(int, void*, size_t, size_t, int, struct sockaddr*,
         socklen_t*) __INTRODUCED_IN(21);
 
diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index c0bd445..d075859 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -58,7 +58,7 @@
  */
 void __system_property_read_callback(const prop_info *pi,
     void (*callback)(void* cookie, const char *name, const char *value, uint32_t serial),
-    void* cookie) __INTRODUCED_IN_FUTURE;
+    void* cookie) __INTRODUCED_IN(26);
 
 /*
  * Passes a `prop_info` for each system property to the provided
@@ -86,7 +86,7 @@
                             uint32_t old_serial,
                             uint32_t* new_serial_ptr,
                             const struct timespec* relative_timeout)
-    __INTRODUCED_IN_FUTURE;
+    __INTRODUCED_IN(26);
 
 /* Deprecated. In Android O and above, there's no limit on property name length. */
 #define PROP_NAME_MAX   32
diff --git a/libc/include/sys/time.h b/libc/include/sys/time.h
index ad5844a..4d477e1 100644
--- a/libc/include/sys/time.h
+++ b/libc/include/sys/time.h
@@ -47,12 +47,12 @@
 int utimes(const char*, const struct timeval*);
 
 #if defined(__USE_BSD)
-int futimes(int, const struct timeval[2]) __INTRODUCED_IN_FUTURE;
-int lutimes(const char*, const struct timeval[2]) __INTRODUCED_IN_FUTURE;
+int futimes(int, const struct timeval[2]) __INTRODUCED_IN(26);
+int lutimes(const char*, const struct timeval[2]) __INTRODUCED_IN(26);
 #endif
 
 #if defined(__USE_GNU)
-int futimesat(int, const char*, const struct timeval[2]) __INTRODUCED_IN_FUTURE;
+int futimesat(int, const char*, const struct timeval[2]) __INTRODUCED_IN(26);
 #endif
 
 #define timerclear(a)   \
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index 017d97a..ff2e9f6 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -262,8 +262,8 @@
 ssize_t __readlink_chk(const char*, char*, size_t, size_t) __INTRODUCED_IN(23);
 ssize_t __readlinkat_chk(int dirfd, const char*, char*, size_t, size_t) __INTRODUCED_IN(23);
 
-int getdomainname(char*, size_t) __INTRODUCED_IN_FUTURE;
-int setdomainname(const char*, size_t) __INTRODUCED_IN_FUTURE;
+int getdomainname(char*, size_t) __INTRODUCED_IN(26);
+int setdomainname(const char*, size_t) __INTRODUCED_IN(26);
 
 #if defined(__BIONIC_FORTIFY)
 
diff --git a/libc/include/wctype.h b/libc/include/wctype.h
index 9e22a8f..39e34f6 100644
--- a/libc/include/wctype.h
+++ b/libc/include/wctype.h
@@ -55,8 +55,8 @@
 // Implemented as static inlines before 21.
 #endif
 
-wint_t towctrans_l(wint_t, wctrans_t, locale_t) __INTRODUCED_IN_FUTURE;
-wctrans_t wctrans_l(const char*, locale_t) __INTRODUCED_IN_FUTURE;
+wint_t towctrans_l(wint_t, wctrans_t, locale_t) __INTRODUCED_IN(26);
+wctrans_t wctrans_l(const char*, locale_t) __INTRODUCED_IN(26);
 
 wctype_t wctype_l(const char*, locale_t) __INTRODUCED_IN(21);
 int iswctype_l(wint_t, wctype_t, locale_t) __INTRODUCED_IN(21);
diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py
index 620bb31..c22f684 100644
--- a/libc/kernel/tools/defaults.py
+++ b/libc/kernel/tools/defaults.py
@@ -26,6 +26,9 @@
     "CONFIG_64BIT": "__LP64__",
     "CONFIG_X86_32": "__i386__",
     "__EXPORTED_HEADERS__": "1",
+    "__HAVE_BUILTIN_BSWAP16__": "1",
+    "__HAVE_BUILTIN_BSWAP32__": "1",
+    "__HAVE_BUILTIN_BSWAP64__": "1",
     }
 
 # define to true if you want to remove all defined(CONFIG_FOO) tests
@@ -77,14 +80,14 @@
     "udphdr": "__kernel_udphdr",
     # The kernel's struct epoll_event just has __u64 for the data.
     "epoll_event": "__kernel_uapi_epoll_event",
+    # This causes problems when trying to export the headers for the ndk.
+    "__attribute_const__": "__attribute__((__const__))",
     }
 
-# this is the set of known static inline functions that we want to keep
-# in the final ARM headers. this is only used to keep optimized byteswapping
-# static functions and stuff like that.
-# TODO: this isn't working!
+# This is the set of known static inline functions that we want to keep
+# in the final kernel headers.
 kernel_known_arm_statics = set(
-        [ "___arch__swab32",    # asm-arm/byteorder.h
+        [
         ]
     )
 
@@ -99,8 +102,7 @@
     )
 
 kernel_known_x86_statics = set(
-        [ "___arch__swab32",  # asm-x86/byteorder.h
-          "___arch__swab64",  # asm-x86/byteorder.h
+        [
         ]
     )
 
@@ -108,6 +110,26 @@
         [
           "ipt_get_target",  # uapi/linux/netfilter_ipv4/ip_tables.h
           "ip6t_get_target", # uapi/linux/netfilter_ipv6/ip6_tables.h
+          # Byte swapping inlines from uapi/linux/swab.h
+          # The below functions are the ones we are guaranting we export.
+          "__swab16",
+          "__swab32",
+          "__swab64",
+          "__swab16p",
+          "__swab32p",
+          "__swab64p",
+          "__swab16s",
+          "__swab32s",
+          "__swab64s",
+          "__swahw32",
+          "__swahb32",
+          "__swahw32p",
+          "__swahb32p",
+          "__swahw32s",
+          "__swahb32s",
+          # These are required to support the above functions.
+          "__fswahw32",
+          "__fswahb32",
         ]
     )
 
diff --git a/libc/kernel/uapi/linux/swab.h b/libc/kernel/uapi/linux/swab.h
index a3387de..71aac11 100644
--- a/libc/kernel/uapi/linux/swab.h
+++ b/libc/kernel/uapi/linux/swab.h
@@ -41,70 +41,115 @@
 #else
 #endif
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) {
 #ifdef __arch_swahw32
+  return __arch_swahw32(val);
 #else
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  return ___constant_swahw32(val);
 #endif
+}
+static inline __attribute__((__const__)) __u32 __fswahb32(__u32 val) {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifdef __arch_swahb32
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  return __arch_swahb32(val);
 #else
+  return ___constant_swahb32(val);
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
-#ifdef __HAVE_BUILTIN_BSWAP16__
+}
 #define __swab16(x) (__u16) __builtin_bswap16((__u16) (x))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#else
-#define __swab16(x) (__builtin_constant_p((__u16) (x)) ? ___constant_swab16(x) : __fswab16(x))
-#endif
-#ifdef __HAVE_BUILTIN_BSWAP32__
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __swab32(x) (__u32) __builtin_bswap32((__u32) (x))
-#else
-#define __swab32(x) (__builtin_constant_p((__u32) (x)) ? ___constant_swab32(x) : __fswab32(x))
-#endif
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#ifdef __HAVE_BUILTIN_BSWAP64__
 #define __swab64(x) (__u64) __builtin_bswap64((__u64) (x))
-#else
-#define __swab64(x) (__builtin_constant_p((__u64) (x)) ? ___constant_swab64(x) : __fswab64(x))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#endif
 #define __swahw32(x) (__builtin_constant_p((__u32) (x)) ? ___constant_swahw32(x) : __fswahw32(x))
 #define __swahb32(x) (__builtin_constant_p((__u32) (x)) ? ___constant_swahb32(x) : __fswahb32(x))
+static __always_inline __u16 __swab16p(const __u16 * p) {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifdef __arch_swab16p
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  return __arch_swab16p(p);
 #else
+  return __swab16(* p);
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
+}
+static __always_inline __u32 __swab32p(const __u32 * p) {
 #ifdef __arch_swab32p
-#else
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  return __arch_swab32p(p);
+#else
+  return __swab32(* p);
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+}
+static __always_inline __u64 __swab64p(const __u64 * p) {
 #ifdef __arch_swab64p
-#else
-#endif
+  return __arch_swab64p(p);
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#else
+  return __swab64(* p);
+#endif
+}
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+static inline __u32 __swahw32p(const __u32 * p) {
 #ifdef __arch_swahw32p
+  return __arch_swahw32p(p);
 #else
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  return __swahw32(* p);
 #endif
+}
+static inline __u32 __swahb32p(const __u32 * p) {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifdef __arch_swahb32p
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  return __arch_swahb32p(p);
 #else
+  return __swahb32(* p);
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
+}
+static inline void __swab16s(__u16 * p) {
 #ifdef __arch_swab16s
-#else
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  __arch_swab16s(p);
+#else
+  * p = __swab16p(p);
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+}
+static __always_inline void __swab32s(__u32 * p) {
 #ifdef __arch_swab32s
-#else
-#endif
+  __arch_swab32s(p);
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#else
+  * p = __swab32p(p);
+#endif
+}
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+static __always_inline void __swab64s(__u64 * p) {
 #ifdef __arch_swab64s
+  __arch_swab64s(p);
 #else
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  * p = __swab64p(p);
 #endif
+}
+static inline void __swahw32s(__u32 * p) {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifdef __arch_swahw32s
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  __arch_swahw32s(p);
 #else
+  * p = __swahw32p(p);
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
+}
+static inline void __swahb32s(__u32 * p) {
 #ifdef __arch_swahb32s
-#else
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+  __arch_swahb32s(p);
+#else
+  * p = __swahb32p(p);
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+}
 #endif
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index b83baf6..c4bc262 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -1286,58 +1286,58 @@
 
 LIBC_O {
   global:
-    __sendto_chk; # future
-    __system_property_read_callback; # future
-    __system_property_wait; # future
+    __sendto_chk; # introduced=26
+    __system_property_read_callback; # introduced=26
+    __system_property_wait; # introduced=26
     bsd_signal; # arm x86 mips versioned=26
-    catclose; # future
-    catgets; # future
-    catopen; # future
-    ctermid; # future
-    endgrent; # future
-    endpwent; # future
-    futimes; # future
-    futimesat; # future
-    getdomainname; # future
-    getgrent; # future
-    getpwent; # future
-    getsubopt; # future
-    hasmntopt; # future
-    lutimes; # future
-    mblen; # future
-    msgctl; # future
-    msgget; # future
-    msgrcv; # future
-    msgsnd; # future
-    nl_langinfo; # future
-    nl_langinfo_l; # future
-    pthread_getname_np; # future
-    quotactl; # future
-    semctl; # future
-    semget; # future
-    semop; # future
-    semtimedop; # future
-    setdomainname; # future
-    setgrent; # future
-    setpwent; # future
-    shmat; # future
-    shmctl; # future
-    shmdt; # future
-    shmget; # future
-    sighold; # future
-    sigignore; # future
-    sigpause; # future
-    sigrelse; # future
-    sigset; # future
-    strtod_l; # future
-    strtof_l; # future
-    strtol_l; # future
-    strtoul_l; # future
-    sync_file_range; # future
-    towctrans; # future
-    towctrans_l; # future
-    wctrans; # future
-    wctrans_l; # future
+    catclose; # introduced=26
+    catgets; # introduced=26
+    catopen; # introduced=26
+    ctermid; # introduced=26
+    endgrent; # introduced=26
+    endpwent; # introduced=26
+    futimes; # introduced=26
+    futimesat; # introduced=26
+    getdomainname; # introduced=26
+    getgrent; # introduced=26
+    getpwent; # introduced=26
+    getsubopt; # introduced=26
+    hasmntopt; # introduced=26
+    lutimes; # introduced=26
+    mblen; # introduced=26
+    msgctl; # introduced=26
+    msgget; # introduced=26
+    msgrcv; # introduced=26
+    msgsnd; # introduced=26
+    nl_langinfo; # introduced=26
+    nl_langinfo_l; # introduced=26
+    pthread_getname_np; # introduced=26
+    quotactl; # introduced=26
+    semctl; # introduced=26
+    semget; # introduced=26
+    semop; # introduced=26
+    semtimedop; # introduced=26
+    setdomainname; # introduced=26
+    setgrent; # introduced=26
+    setpwent; # introduced=26
+    shmat; # introduced=26
+    shmctl; # introduced=26
+    shmdt; # introduced=26
+    shmget; # introduced=26
+    sighold; # introduced=26
+    sigignore; # introduced=26
+    sigpause; # introduced=26
+    sigrelse; # introduced=26
+    sigset; # introduced=26
+    strtod_l; # introduced=26
+    strtof_l; # introduced=26
+    strtol_l; # introduced=26
+    strtoul_l; # introduced=26
+    sync_file_range; # introduced=26
+    towctrans; # introduced=26
+    towctrans_l; # introduced=26
+    wctrans; # introduced=26
+    wctrans_l; # introduced=26
 } LIBC_N;
 
 LIBC_PRIVATE {
diff --git a/libc/seccomp/arm64_policy.cpp b/libc/seccomp/arm64_policy.cpp
index d40847d..28227f4 100644
--- a/libc/seccomp/arm64_policy.cpp
+++ b/libc/seccomp/arm64_policy.cpp
@@ -5,34 +5,38 @@
 
 #include "seccomp_bpfs.h"
 const sock_filter arm64_filter[] = {
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5, 0, 28),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 203, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5, 0, 32),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 220, 15, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 101, 7, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 43, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 19, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 18, 23, 22), //setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|getcwd
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 42, 22, 21), //eventfd2|epoll_create1|epoll_ctl|epoll_pwait|dup|dup3|fcntl|inotify_init1|inotify_add_watch|inotify_rm_watch|ioctl|ioprio_set|ioprio_get|flock|mknodat|mkdirat|unlinkat|symlinkat|linkat|renameat|umount2|mount|pivot_root
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 18, 27, 26), //setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|getcwd
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 42, 26, 25), //eventfd2|epoll_create1|epoll_ctl|epoll_pwait|dup|dup3|fcntl|inotify_init1|inotify_add_watch|inotify_rm_watch|ioctl|ioprio_set|ioprio_get|flock|mknodat|mkdirat|unlinkat|symlinkat|linkat|renameat|umount2|mount|pivot_root
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 59, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 20, 19), //statfs|fstatfs|truncate|ftruncate|fallocate|faccessat|chdir|fchdir|chroot|fchmod|fchmodat|fchownat|fchown|openat|close
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 99, 19, 18), //pipe2|quotactl|getdents64|lseek|read|write|readv|writev|pread64|pwrite64|preadv|pwritev|sendfile|pselect6|ppoll|signalfd4|vmsplice|splice|tee|readlinkat|newfstatat|fstat|sync|fsync|fdatasync|sync_file_range|timerfd_create|timerfd_settime|timerfd_gettime|utimensat|acct|capget|capset|personality|exit|exit_group|waitid|set_tid_address|unshare|futex
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 24, 23), //statfs|fstatfs|truncate|ftruncate|fallocate|faccessat|chdir|fchdir|chroot|fchmod|fchmodat|fchownat|fchown|openat|close
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 99, 23, 22), //pipe2|quotactl|getdents64|lseek|read|write|readv|writev|pread64|pwrite64|preadv|pwritev|sendfile|pselect6|ppoll|signalfd4|vmsplice|splice|tee|readlinkat|newfstatat|fstat|sync|fsync|fdatasync|sync_file_range|timerfd_create|timerfd_settime|timerfd_gettime|utimensat|acct|capget|capset|personality|exit|exit_group|waitid|set_tid_address|unshare|futex
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 198, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 105, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 104, 16, 15), //nanosleep|getitimer|setitimer
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 180, 15, 14), //init_module|delete_module|timer_create|timer_gettime|timer_getoverrun|timer_settime|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|syslog|ptrace|sched_setparam|sched_setscheduler|sched_getscheduler|sched_getparam|sched_setaffinity|sched_getaffinity|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|restart_syscall|kill|tkill|tgkill|sigaltstack|rt_sigsuspend|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigreturn|setpriority|getpriority|reboot|setregid|setgid|setreuid|setuid|setresuid|getresuid|setresgid|getresgid|setfsuid|setfsgid|times|setpgid|getpgid|getsid|setsid|getgroups|setgroups|uname|sethostname|setdomainname|getrlimit|setrlimit|getrusage|umask|prctl|getcpu|gettimeofday|settimeofday|adjtimex|getpid|getppid|getuid|geteuid|getgid|getegid|gettid|sysinfo
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 202, 14, 13), //socket|socketpair|bind|listen
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 260, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 226, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 220, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 217, 10, 9), //connect|getsockname|getpeername|sendto|recvfrom|setsockopt|getsockopt|shutdown|sendmsg|recvmsg|readahead|brk|munmap|mremap
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 224, 9, 8), //clone|execve|mmap|fadvise64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 240, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 234, 7, 6), //mprotect|msync|mlock|munlock|mlockall|munlockall|mincore|madvise
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 244, 6, 5), //rt_tgsigqueueinfo|perf_event_open|accept4|recvmmsg
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 277, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 266, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 262, 3, 2), //wait4|prlimit64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 272, 2, 1), //clock_adjtime|syncfs|setns|sendmmsg|process_vm_readv|process_vm_writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 279, 1, 0), //seccomp|getrandom
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 104, 20, 19), //nanosleep|getitimer|setitimer
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 180, 19, 18), //init_module|delete_module|timer_create|timer_gettime|timer_getoverrun|timer_settime|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|syslog|ptrace|sched_setparam|sched_setscheduler|sched_getscheduler|sched_getparam|sched_setaffinity|sched_getaffinity|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|restart_syscall|kill|tkill|tgkill|sigaltstack|rt_sigsuspend|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigreturn|setpriority|getpriority|reboot|setregid|setgid|setreuid|setuid|setresuid|getresuid|setresgid|getresgid|setfsuid|setfsgid|times|setpgid|getpgid|getsid|setsid|getgroups|setgroups|uname|sethostname|setdomainname|getrlimit|setrlimit|getrusage|umask|prctl|getcpu|gettimeofday|settimeofday|adjtimex|getpid|getppid|getuid|geteuid|getgid|getegid|gettid|sysinfo
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 203, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 202, 17, 16), //socket|socketpair|bind|listen
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 217, 16, 15), //connect|getsockname|getpeername|sendto|recvfrom|setsockopt|getsockopt|shutdown|sendmsg|recvmsg|readahead|brk|munmap|mremap
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 266, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 240, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 226, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 224, 12, 11), //clone|execve|mmap|fadvise64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 234, 11, 10), //mprotect|msync|mlock|munlock|mlockall|munlockall|mincore|madvise
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 260, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 244, 9, 8), //rt_tgsigqueueinfo|perf_event_open|accept4|recvmmsg
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 262, 8, 7), //wait4|prlimit64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 281, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 274, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 272, 5, 4), //clock_adjtime|syncfs|setns|sendmmsg|process_vm_readv|process_vm_writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 280, 4, 3), //sched_setattr|sched_getattr|renameat2|seccomp|getrandom|memfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 284, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 282, 2, 1), //execveat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 288, 1, 0), //mlock2|copy_file_range|preadv2|pwritev2
 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
 };
 
diff --git a/libc/seccomp/arm_policy.cpp b/libc/seccomp/arm_policy.cpp
index b0fd60f..f565d63 100644
--- a/libc/seccomp/arm_policy.cpp
+++ b/libc/seccomp/arm_policy.cpp
@@ -5,130 +5,134 @@
 
 #include "seccomp_bpfs.h"
 const sock_filter arm_filter[] = {
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 0, 0, 126),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 143, 63, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 74, 31, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 41, 15, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 24, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 0, 0, 130),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 150, 65, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 77, 33, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 45, 17, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 26, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 19, 5, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 10, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 8, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 7, 119, 118), //restart_syscall|exit|fork|read|write|open|close
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 9, 118, 117), //creat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 19, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 13, 116, 115), //unlink|execve|chdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 22, 115, 114), //lseek|getpid|mount
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 33, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 26, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 25, 112, 111), //getuid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 27, 111, 110), //ptrace
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 36, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 34, 109, 108), //access
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 39, 108, 107), //sync|kill|rename
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 57, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 51, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 45, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 44, 104, 103), //dup|pipe|times
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 46, 103, 102), //brk
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 54, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 53, 101, 100), //acct|umount2
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 56, 100, 99), //ioctl|fcntl
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 64, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 60, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 97, 96), //setpgid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 62, 96, 95), //umask|chroot
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 66, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 65, 94, 93), //getppid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 68, 93, 92), //setsid|sigaction
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 114, 15, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 91, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 85, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 77, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 76, 88, 87), //sethostname|setrlimit
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 80, 87, 86), //getrusage|gettimeofday|settimeofday
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 88, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 86, 85, 84), //readlink
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 89, 84, 83), //reboot
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 96, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 94, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 93, 81, 80), //munmap|truncate
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 95, 80, 79), //fchmod
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 103, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 98, 78, 77), //getpriority|setpriority
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 106, 77, 76), //syslog|setitimer|getitimer
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 128, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 118, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 116, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 115, 73, 72), //wait4
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 117, 72, 71), //sysinfo
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 124, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 123, 70, 69), //fsync|sigreturn|clone|setdomainname|uname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 126, 69, 68), //adjtimex|mprotect
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 136, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 131, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 130, 66, 65), //init_module|delete_module
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 134, 65, 64), //quotactl|getpgid|fchdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 138, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 137, 63, 62), //personality
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 142, 62, 61), //setfsuid|setfsgid|_llseek|getdents
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 286, 31, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 217, 15, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 183, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 168, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 150, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 149, 56, 55), //flock|msync|readv|writev|getsid|fdatasync
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 164, 55, 54), //mlock|munlock|mlockall|munlockall|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|nanosleep|mremap
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 172, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 169, 53, 52), //poll
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 182, 52, 51), //prctl|rt_sigreturn|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|pread64|pwrite64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 199, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 190, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 188, 49, 48), //getcwd|capget|capset|sigaltstack|sendfile
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 198, 48, 47), //vfork|ugetrlimit|mmap2|truncate64|ftruncate64|stat64|lstat64|fstat64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 213, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 212, 46, 45), //getuid32|getgid32|geteuid32|getegid32|setreuid32|setregid32|getgroups32|setgroups32|fchown32|setresuid32|getresuid32|setresgid32|getresgid32
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 215, 45, 44), //setuid32|setgid32
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 250, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 224, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 219, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 218, 41, 40), //getdents64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 222, 40, 39), //mincore|madvise|fcntl64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 248, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 243, 38, 37), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill|sendfile64|futex|sched_setaffinity|sched_getaffinity
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 249, 37, 36), //exit_group
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 270, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 256, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 254, 34, 33), //epoll_create|epoll_ctl|epoll_wait|remap_file_pages
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 269, 33, 32), //set_tid_address|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|statfs64|fstatfs64|tgkill
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 280, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 271, 31, 30), //arm_fadvise64_64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 285, 30, 29), //waitid|socket|bind|connect|listen
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 348, 15, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 322, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 292, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 290, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 289, 25, 24), //getsockname|getpeername|socketpair
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 291, 24, 23), //sendto
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 316, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 298, 22, 21), //recvfrom|shutdown|setsockopt|getsockopt|sendmsg|recvmsg
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 319, 21, 20), //inotify_init|inotify_add_watch|inotify_rm_watch
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 340, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 327, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 326, 18, 17), //openat|mkdirat|mknodat|fchownat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 338, 17, 16), //fstatat64|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 345, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 344, 15, 14), //splice|sync_file_range2|tee|vmsplice
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 347, 14, 13), //getcpu|epoll_pwait
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 383, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 369, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 350, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 349, 10, 9), //utimensat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 367, 9, 8), //timerfd_create|eventfd|fallocate|timerfd_settime|timerfd_gettime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|recvmmsg|accept4
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 372, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 370, 7, 6), //prlimit64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 378, 6, 5), //clock_adjtime|syncfs|sendmmsg|setns|process_vm_readv|process_vm_writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 983045, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 983042, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 385, 3, 2), //seccomp|getrandom
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 7, 122, 121), //restart_syscall|exit|fork|read|write|open|close
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 9, 121, 120), //creat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 13, 120, 119), //unlink|execve|chdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 24, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 22, 118, 117), //lseek|getpid|mount
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 25, 117, 116), //getuid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 36, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 33, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 27, 114, 113), //ptrace
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 34, 113, 112), //access
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 41, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 39, 111, 110), //sync|kill|rename
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 44, 110, 109), //dup|pipe|times
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 60, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 54, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 51, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 46, 106, 105), //brk
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 53, 105, 104), //acct|umount2
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 57, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 56, 103, 102), //ioctl|fcntl
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 102, 101), //setpgid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 66, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 64, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 62, 99, 98), //umask|chroot
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 65, 98, 97), //getppid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 74, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 68, 96, 95), //setsid|sigaction
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 76, 95, 94), //sethostname|setrlimit
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 116, 15, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 94, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 88, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 85, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 80, 90, 89), //getrusage|gettimeofday|settimeofday
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 86, 89, 88), //readlink
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 91, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 89, 87, 86), //reboot
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 93, 86, 85), //munmap|truncate
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 103, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 96, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 95, 83, 82), //fchmod
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 98, 82, 81), //getpriority|setpriority
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 114, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 106, 80, 79), //syslog|setitimer|getitimer
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 115, 79, 78), //wait4
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 131, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 124, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 118, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 117, 75, 74), //sysinfo
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 123, 74, 73), //fsync|sigreturn|clone|setdomainname|uname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 128, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 126, 72, 71), //adjtimex|mprotect
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 130, 71, 70), //init_module|delete_module
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 138, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 136, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 134, 68, 67), //quotactl|getpgid|fchdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 137, 67, 66), //personality
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 143, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 142, 65, 64), //setfsuid|setfsgid|_llseek|getdents
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 149, 64, 63), //flock|msync|readv|writev|getsid|fdatasync
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 290, 31, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 219, 15, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 190, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 172, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 168, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 164, 58, 57), //mlock|munlock|mlockall|munlockall|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|nanosleep|mremap
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 169, 57, 56), //poll
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 183, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 182, 55, 54), //prctl|rt_sigreturn|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|pread64|pwrite64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 188, 54, 53), //getcwd|capget|capset|sigaltstack|sendfile
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 213, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 199, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 198, 51, 50), //vfork|ugetrlimit|mmap2|truncate64|ftruncate64|stat64|lstat64|fstat64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 212, 50, 49), //getuid32|getgid32|geteuid32|getegid32|setreuid32|setregid32|getgroups32|setgroups32|fchown32|setresuid32|getresuid32|setresgid32|getresgid32
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 217, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 215, 48, 47), //setuid32|setgid32
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 218, 47, 46), //getdents64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 256, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 248, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 224, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 222, 43, 42), //mincore|madvise|fcntl64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 243, 42, 41), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill|sendfile64|futex|sched_setaffinity|sched_getaffinity
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 250, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 249, 40, 39), //exit_group
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 254, 39, 38), //epoll_create|epoll_ctl|epoll_wait|remap_file_pages
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 280, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 270, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 269, 36, 35), //set_tid_address|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|statfs64|fstatfs64|tgkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 271, 35, 34), //arm_fadvise64_64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 286, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 285, 33, 32), //waitid|socket|bind|connect|listen
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 289, 32, 31), //getsockname|getpeername|socketpair
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 350, 15, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 327, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 316, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 292, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 291, 27, 26), //sendto
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 298, 26, 25), //recvfrom|shutdown|setsockopt|getsockopt|sendmsg|recvmsg
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 322, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 319, 24, 23), //inotify_init|inotify_add_watch|inotify_rm_watch
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 326, 23, 22), //openat|mkdirat|mknodat|fchownat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 345, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 340, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 338, 20, 19), //fstatat64|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 344, 19, 18), //splice|sync_file_range2|tee|vmsplice
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 348, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 347, 17, 16), //getcpu|epoll_pwait
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 349, 16, 15), //utimensat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 387, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 372, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 369, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 367, 12, 11), //timerfd_create|eventfd|fallocate|timerfd_settime|timerfd_gettime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|recvmmsg|accept4
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 370, 11, 10), //prlimit64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 380, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 378, 9, 8), //clock_adjtime|syncfs|sendmmsg|setns|process_vm_readv|process_vm_writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 386, 8, 7), //sched_setattr|sched_getattr|renameat2|seccomp|getrandom|memfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 983042, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 390, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 388, 5, 4), //execveat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 394, 4, 3), //mlock2|copy_file_range|preadv2|pwritev2
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 983045, 1, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 983043, 2, 1), //__ARM_NR_cacheflush
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 983046, 1, 0), //__ARM_NR_set_tls
 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
diff --git a/libc/seccomp/mips64_policy.cpp b/libc/seccomp/mips64_policy.cpp
index 5133649..f073d01 100644
--- a/libc/seccomp/mips64_policy.cpp
+++ b/libc/seccomp/mips64_policy.cpp
@@ -5,86 +5,88 @@
 
 #include "seccomp_bpfs.h"
 const sock_filter mips64_filter[] = {
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5000, 0, 80),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5164, 39, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5077, 19, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5034, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5000, 0, 82),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5168, 41, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5089, 21, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5038, 11, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5023, 5, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5008, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5003, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5002, 73, 72), //read|write
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5004, 72, 71), //close
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5020, 71, 70), //lseek|mmap|mprotect|munmap|brk|rt_sigaction|rt_sigprocmask|ioctl|pread64|pwrite64|readv|writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5002, 75, 74), //read|write
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5004, 74, 73), //close
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5020, 73, 72), //lseek|mmap|mprotect|munmap|brk|rt_sigaction|rt_sigprocmask|ioctl|pread64|pwrite64|readv|writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5034, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5031, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5028, 69, 68), //sched_yield|mremap|msync|mincore|madvise
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5032, 68, 67), //dup
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5057, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5043, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5038, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5037, 64, 63), //nanosleep|getitimer|setitimer
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5042, 63, 62), //getpid|sendfile|socket|connect
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5056, 62, 61), //sendto|recvfrom|sendmsg|recvmsg|shutdown|bind|listen|getsockname|getpeername|socketpair|setsockopt|getsockopt|clone
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5070, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5062, 60, 59), //execve|exit|wait4|kill|uname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5076, 59, 58), //fcntl|flock|fsync|fdatasync|truncate|ftruncate
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5132, 9, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5093, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5091, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5089, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5080, 54, 53), //getcwd|chdir|fchdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5090, 53, 52), //fchmod
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5092, 52, 51), //fchown
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5110, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5109, 50, 49), //umask|gettimeofday|getrlimit|getrusage|sysinfo|times|ptrace|getuid|syslog|getgid|setuid|setgid|geteuid|getegid|setpgid|getppid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5130, 49, 48), //setsid|setreuid|setregid|getgroups|setgroups|setresuid|getresuid|setresgid|getresgid|getpgid|setfsuid|setfsgid|getsid|capget|capset|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|sigaltstack
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5151, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5137, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5134, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5133, 45, 44), //personality
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5136, 44, 43), //statfs|fstatfs
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5150, 43, 42), //getpriority|setpriority|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|mlock|munlock|mlockall|munlockall
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5153, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5152, 41, 40), //pivot_root
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5162, 40, 39), //prctl|adjtimex|setrlimit|chroot|sync|acct|settimeofday|mount|umount2
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5242, 19, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5205, 9, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5178, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5172, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5168, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5167, 34, 33), //reboot|sethostname|setdomainname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5170, 33, 32), //init_module|delete_module
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5173, 32, 31), //quotactl
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5194, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5193, 30, 29), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5197, 29, 28), //futex|sched_setaffinity|sched_getaffinity
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5215, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5211, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5208, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5206, 25, 24), //exit_group
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5209, 24, 23), //epoll_ctl
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5214, 23, 22), //rt_sigreturn|set_tid_address|restart_syscall
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5237, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5226, 21, 20), //fadvise64|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|tgkill
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5238, 20, 19), //waitid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5279, 9, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5253, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5247, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5244, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5243, 15, 14), //set_thread_area
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5246, 14, 13), //inotify_add_watch|inotify_rm_watch
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5251, 13, 12), //openat|mkdirat|mknodat|fchownat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5271, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5267, 11, 10), //unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare|splice|sync_file_range|tee|vmsplice
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5276, 10, 9), //getcpu|epoll_pwait|ioprio_set|ioprio_get|utimensat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5308, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5300, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5297, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5295, 6, 5), //fallocate|timerfd_create|timerfd_gettime|timerfd_settime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|accept4|recvmmsg
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5298, 5, 4), //prlimit64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5306, 4, 3), //clock_adjtime|syncfs|sendmmsg|setns|process_vm_readv|process_vm_writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5312, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5309, 2, 1), //getdents64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5314, 1, 0), //seccomp|getrandom
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5028, 70, 69), //sched_yield|mremap|msync|mincore|madvise
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5032, 69, 68), //dup
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5037, 68, 67), //nanosleep|getitimer|setitimer
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5070, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5057, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5043, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5042, 64, 63), //getpid|sendfile|socket|connect
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5056, 63, 62), //sendto|recvfrom|sendmsg|recvmsg|shutdown|bind|listen|getsockname|getpeername|socketpair|setsockopt|getsockopt|clone
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5062, 62, 61), //execve|exit|wait4|kill|uname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5077, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5076, 60, 59), //fcntl|flock|fsync|fdatasync|truncate|ftruncate
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5080, 59, 58), //getcwd|chdir|fchdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5134, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5110, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5093, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5091, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5090, 54, 53), //fchmod
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5092, 53, 52), //fchown
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5109, 52, 51), //umask|gettimeofday|getrlimit|getrusage|sysinfo|times|ptrace|getuid|syslog|getgid|setuid|setgid|geteuid|getegid|setpgid|getppid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5132, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5130, 50, 49), //setsid|setreuid|setregid|getgroups|setgroups|setresuid|getresuid|setresgid|getresgid|getpgid|setfsuid|setfsgid|getsid|capget|capset|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|sigaltstack
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5133, 49, 48), //personality
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5153, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5151, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5137, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5136, 45, 44), //statfs|fstatfs
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5150, 44, 43), //getpriority|setpriority|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|mlock|munlock|mlockall|munlockall
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5152, 43, 42), //pivot_root
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5164, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5162, 41, 40), //prctl|adjtimex|setrlimit|chroot|sync|acct|settimeofday|mount|umount2
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5167, 40, 39), //reboot|sethostname|setdomainname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5244, 19, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5208, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5194, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5178, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5172, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5170, 34, 33), //init_module|delete_module
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5173, 33, 32), //quotactl
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5193, 32, 31), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5205, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5197, 30, 29), //futex|sched_setaffinity|sched_getaffinity
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5206, 29, 28), //exit_group
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5237, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5215, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5211, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5209, 25, 24), //epoll_ctl
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5214, 24, 23), //rt_sigreturn|set_tid_address|restart_syscall
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5226, 23, 22), //fadvise64|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|tgkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5242, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5238, 21, 20), //waitid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5243, 20, 19), //set_thread_area
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5297, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5271, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5253, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5247, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5246, 15, 14), //inotify_add_watch|inotify_rm_watch
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5251, 14, 13), //openat|mkdirat|mknodat|fchownat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5267, 13, 12), //unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare|splice|sync_file_range|tee|vmsplice
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5279, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5276, 11, 10), //getcpu|epoll_pwait|ioprio_set|ioprio_get|utimensat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5295, 10, 9), //fallocate|timerfd_create|timerfd_gettime|timerfd_settime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|accept4|recvmmsg
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5316, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5308, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5300, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5298, 6, 5), //prlimit64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5306, 5, 4), //clock_adjtime|syncfs|sendmmsg|setns|process_vm_readv|process_vm_writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5315, 4, 3), //getdents64|sched_setattr|sched_getattr|renameat2|seccomp|getrandom|memfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5319, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5317, 2, 1), //execveat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5323, 1, 0), //mlock2|copy_file_range|preadv2|pwritev2
 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
 };
 
diff --git a/libc/seccomp/mips_policy.cpp b/libc/seccomp/mips_policy.cpp
index 61a63e4..57f3210 100644
--- a/libc/seccomp/mips_policy.cpp
+++ b/libc/seccomp/mips_policy.cpp
@@ -5,116 +5,120 @@
 
 #include "seccomp_bpfs.h"
 const sock_filter mips_filter[] = {
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4001, 0, 110),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4131, 55, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4064, 27, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4036, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4001, 0, 114),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4136, 57, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4066, 29, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4041, 15, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4023, 7, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4010, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4008, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4007, 103, 102), //exit|fork|read|write|open|close
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4009, 102, 101), //creat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4007, 107, 106), //exit|fork|read|write|open|close
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4009, 106, 105), //creat
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4019, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4013, 100, 99), //unlink|execve|chdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4022, 99, 98), //lseek|getpid|mount
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4013, 104, 103), //unlink|execve|chdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4022, 103, 102), //lseek|getpid|mount
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4033, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4026, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4025, 96, 95), //setuid|getuid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4027, 95, 94), //ptrace
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4034, 94, 93), //access
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4054, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4045, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4041, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4039, 90, 89), //sync|kill|rename
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4044, 89, 88), //dup|pipe|times
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4049, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4048, 87, 86), //brk|setgid|getgid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4053, 86, 85), //geteuid|getegid|acct|umount2
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4060, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4057, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4056, 83, 82), //ioctl|fcntl
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4058, 82, 81), //setpgid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4062, 81, 80), //umask|chroot
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4094, 13, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4085, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4070, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4066, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4065, 76, 75), //getppid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4068, 75, 74), //setsid|sigaction
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4074, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4072, 73, 72), //setreuid|setregid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4082, 72, 71), //sethostname|setrlimit|getrlimit|getrusage|gettimeofday|settimeofday|getgroups|setgroups
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4090, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4088, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4086, 69, 68), //readlink
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4089, 68, 67), //reboot
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4093, 67, 66), //mmap|munmap|truncate
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4118, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4114, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4103, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4098, 63, 62), //fchmod|fchown|getpriority|setpriority
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4106, 62, 61), //syslog|setitimer|getitimer
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4116, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4115, 60, 59), //wait4
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4117, 59, 58), //sysinfo
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4128, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4124, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4123, 56, 55), //fsync|sigreturn|clone|setdomainname|uname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4126, 55, 54), //adjtimex|mprotect
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4130, 54, 53), //init_module|delete_module
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4222, 27, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4176, 13, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4151, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4138, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4136, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4134, 48, 47), //quotactl|getpgid|fchdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4137, 47, 46), //personality
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4143, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4142, 45, 44), //setfsuid|setfsgid|_llseek|getdents
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4148, 44, 43), //flock|msync|readv|writev|cacheflush
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4169, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4154, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4153, 41, 40), //getsid|fdatasync
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4168, 40, 39), //mlock|munlock|mlockall|munlockall|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|nanosleep|mremap
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4175, 39, 38), //bind|connect|getpeername|getsockname|getsockopt|listen
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4203, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4188, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4179, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4178, 35, 34), //recvfrom|recvmsg
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4187, 34, 33), //sendmsg|sendto|setsockopt|shutdown|socket|socketpair|setresuid|getresuid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4190, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4189, 32, 31), //poll
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4202, 31, 30), //setresgid|getresgid|prctl|rt_sigreturn|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|pread64|pwrite64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4217, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4210, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4208, 28, 27), //getcwd|capget|capset|sigaltstack|sendfile
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4216, 27, 26), //mmap2|truncate64|ftruncate64|stat64|lstat64|fstat64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4221, 26, 25), //mincore|madvise|getdents64|fcntl64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4312, 13, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4283, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4248, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4246, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4241, 21, 20), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill|sendfile64|futex|sched_setaffinity|sched_getaffinity
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4247, 20, 19), //exit_group
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4278, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4267, 18, 17), //epoll_create|epoll_ctl|epoll_wait|remap_file_pages|set_tid_address|restart_syscall|fadvise64|statfs64|fstatfs64|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|tgkill
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4279, 17, 16), //waitid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4293, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4288, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4287, 14, 13), //set_thread_area|inotify_init|inotify_add_watch|inotify_rm_watch
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4292, 13, 12), //openat|mkdirat|mknodat|fchownat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4308, 12, 11), //fstatat64|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare|splice|sync_file_range|tee|vmsplice
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4338, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4319, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4316, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4314, 8, 7), //getcpu|epoll_pwait
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4317, 7, 6), //utimensat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4336, 6, 5), //eventfd|fallocate|timerfd_create|timerfd_gettime|timerfd_settime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|accept4|recvmmsg
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4352, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4025, 100, 99), //setuid|getuid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4027, 99, 98), //ptrace
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4036, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4034, 97, 96), //access
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4039, 96, 95), //sync|kill|rename
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4057, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4049, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4045, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4044, 92, 91), //dup|pipe|times
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4048, 91, 90), //brk|setgid|getgid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4054, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4053, 89, 88), //geteuid|getegid|acct|umount2
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4056, 88, 87), //ioctl|fcntl
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4064, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4060, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4058, 85, 84), //setpgid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4062, 84, 83), //umask|chroot
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4065, 83, 82), //getppid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4103, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4088, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4074, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4070, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4068, 78, 77), //setsid|sigaction
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4072, 77, 76), //setreuid|setregid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4085, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4082, 75, 74), //sethostname|setrlimit|getrlimit|getrusage|gettimeofday|settimeofday|getgroups|setgroups
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4086, 74, 73), //readlink
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4094, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4090, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4089, 71, 70), //reboot
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4093, 70, 69), //mmap|munmap|truncate
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4098, 69, 68), //fchmod|fchown|getpriority|setpriority
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4124, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4116, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4114, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4106, 65, 64), //syslog|setitimer|getitimer
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4115, 64, 63), //wait4
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4118, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4117, 62, 61), //sysinfo
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4123, 61, 60), //fsync|sigreturn|clone|setdomainname|uname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4131, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4128, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4126, 58, 57), //adjtimex|mprotect
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4130, 57, 56), //init_module|delete_module
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4134, 56, 55), //quotactl|getpgid|fchdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4246, 27, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4179, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4154, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4143, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4138, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4137, 50, 49), //personality
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4142, 49, 48), //setfsuid|setfsgid|_llseek|getdents
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4151, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4148, 47, 46), //flock|msync|readv|writev|cacheflush
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4153, 46, 45), //getsid|fdatasync
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4176, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4169, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4168, 43, 42), //mlock|munlock|mlockall|munlockall|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|nanosleep|mremap
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4175, 42, 41), //bind|connect|getpeername|getsockname|getsockopt|listen
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4178, 41, 40), //recvfrom|recvmsg
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4210, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4190, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4188, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4187, 37, 36), //sendmsg|sendto|setsockopt|shutdown|socket|socketpair|setresuid|getresuid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4189, 36, 35), //poll
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4203, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4202, 34, 33), //setresgid|getresgid|prctl|rt_sigreturn|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|pread64|pwrite64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4208, 33, 32), //getcwd|capget|capset|sigaltstack|sendfile
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4222, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4217, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4216, 30, 29), //mmap2|truncate64|ftruncate64|stat64|lstat64|fstat64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4221, 29, 28), //mincore|madvise|getdents64|fcntl64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4241, 28, 27), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill|sendfile64|futex|sched_setaffinity|sched_getaffinity
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4316, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4288, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4278, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4248, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4247, 23, 22), //exit_group
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4267, 22, 21), //epoll_create|epoll_ctl|epoll_wait|remap_file_pages|set_tid_address|restart_syscall|fadvise64|statfs64|fstatfs64|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|tgkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4283, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4279, 20, 19), //waitid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4287, 19, 18), //set_thread_area|inotify_init|inotify_add_watch|inotify_rm_watch
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4312, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4293, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4292, 16, 15), //openat|mkdirat|mknodat|fchownat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4308, 15, 14), //fstatat64|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare|splice|sync_file_range|tee|vmsplice
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4314, 14, 13), //getcpu|epoll_pwait
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4349, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4338, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4319, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4317, 10, 9), //utimensat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4336, 9, 8), //eventfd|fallocate|timerfd_create|timerfd_gettime|timerfd_settime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|accept4|recvmmsg
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4341, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4339, 3, 2), //prlimit64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4347, 2, 1), //clock_adjtime|syncfs|sendmmsg|setns|process_vm_readv|process_vm_writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4354, 1, 0), //seccomp|getrandom
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4339, 7, 6), //prlimit64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4347, 6, 5), //clock_adjtime|syncfs|sendmmsg|setns|process_vm_readv|process_vm_writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4359, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4356, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4355, 3, 2), //sched_setattr|sched_getattr|renameat2|seccomp|getrandom|memfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4357, 2, 1), //execveat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4363, 1, 0), //mlock2|copy_file_range|preadv2|pwritev2
 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
 };
 
diff --git a/libc/seccomp/x86_64_policy.cpp b/libc/seccomp/x86_64_policy.cpp
index 8c3873c..b385202 100644
--- a/libc/seccomp/x86_64_policy.cpp
+++ b/libc/seccomp/x86_64_policy.cpp
@@ -5,88 +5,92 @@
 
 #include "seccomp_bpfs.h"
 const sock_filter x86_64_filter[] = {
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 0, 0, 82),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 169, 41, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 0, 0, 86),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 175, 43, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 79, 21, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 35, 11, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 8, 5, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 5, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 3, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 2, 75, 74), //read|write
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4, 74, 73), //close
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 6, 73, 72), //fstat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 2, 79, 78), //read|write
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 4, 78, 77), //close
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 6, 77, 76), //fstat
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 32, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 24, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 21, 70, 69), //lseek|mmap|mprotect|munmap|brk|rt_sigaction|rt_sigprocmask|rt_sigreturn|ioctl|pread64|pwrite64|readv|writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 29, 69, 68), //sched_yield|mremap|msync|mincore|madvise
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 33, 68, 67), //dup
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 21, 74, 73), //lseek|mmap|mprotect|munmap|brk|rt_sigaction|rt_sigprocmask|rt_sigreturn|ioctl|pread64|pwrite64|readv|writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 29, 73, 72), //sched_yield|mremap|msync|mincore|madvise
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 33, 72, 71), //dup
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 5, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 44, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 38, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 37, 64, 63), //nanosleep|getitimer
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 43, 63, 62), //setitimer|getpid|sendfile|socket|connect
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 57, 62, 61), //sendto|recvfrom|sendmsg|recvmsg|shutdown|bind|listen|getsockname|getpeername|socketpair|setsockopt|getsockopt|clone
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 37, 68, 67), //nanosleep|getitimer
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 43, 67, 66), //setitimer|getpid|sendfile|socket|connect
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 57, 66, 65), //sendto|recvfrom|sendmsg|recvmsg|shutdown|bind|listen|getsockname|getpeername|socketpair|setsockopt|getsockopt|clone
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 72, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 64, 60, 59), //vfork|execve|exit|wait4|kill|uname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 78, 59, 58), //fcntl|flock|fsync|fdatasync|truncate|ftruncate
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 135, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 64, 64, 63), //vfork|execve|exit|wait4|kill|uname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 78, 63, 62), //fcntl|flock|fsync|fdatasync|truncate|ftruncate
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 137, 11, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 95, 5, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 93, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 91, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 82, 54, 53), //getcwd|chdir|fchdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 92, 53, 52), //fchmod
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 94, 52, 51), //fchown
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 82, 58, 57), //getcwd|chdir|fchdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 92, 57, 56), //fchmod
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 94, 56, 55), //fchown
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 135, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 112, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 111, 50, 49), //umask|gettimeofday|getrlimit|getrusage|sysinfo|times|ptrace|getuid|syslog|getgid|setuid|setgid|geteuid|getegid|setpgid|getppid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 132, 49, 48), //setsid|setreuid|setregid|getgroups|setgroups|setresuid|getresuid|setresgid|getresgid|getpgid|setfsuid|setfsgid|getsid|capget|capset|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|sigaltstack
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 155, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 140, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 137, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 136, 45, 44), //personality
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 139, 44, 43), //statfs|fstatfs
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 153, 43, 42), //getpriority|setpriority|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|mlock|munlock|mlockall|munlockall
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 157, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 156, 41, 40), //pivot_root
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 167, 40, 39), //prctl|arch_prctl|adjtimex|setrlimit|chroot|sync|acct|settimeofday|mount|umount2
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 254, 19, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 217, 9, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 186, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 179, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 175, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 172, 34, 33), //reboot|sethostname|setdomainname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 177, 33, 32), //init_module|delete_module
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 180, 32, 31), //quotactl
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 202, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 201, 30, 29), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 205, 29, 28), //futex|sched_setaffinity|sched_getaffinity
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 247, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 233, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 221, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 220, 25, 24), //getdents64|set_tid_address|restart_syscall
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 232, 24, 23), //fadvise64|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|exit_group
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 235, 23, 22), //epoll_ctl|tgkill
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 251, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 248, 21, 20), //waitid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 253, 20, 19), //ioprio_set|ioprio_get
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 283, 9, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 275, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 262, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 111, 53, 52), //umask|gettimeofday|getrlimit|getrusage|sysinfo|times|ptrace|getuid|syslog|getgid|setuid|setgid|geteuid|getegid|setpgid|getppid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 132, 52, 51), //setsid|setreuid|setregid|getgroups|setgroups|setresuid|getresuid|setresgid|getresgid|getpgid|setfsuid|setfsgid|getsid|capget|capset|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|sigaltstack
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 136, 51, 50), //personality
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 157, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 155, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 140, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 139, 47, 46), //statfs|fstatfs
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 153, 46, 45), //getpriority|setpriority|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|mlock|munlock|mlockall|munlockall
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 156, 45, 44), //pivot_root
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 169, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 167, 43, 42), //prctl|arch_prctl|adjtimex|setrlimit|chroot|sync|acct|settimeofday|mount|umount2
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 172, 42, 41), //reboot|sethostname|setdomainname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 262, 21, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 233, 11, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 202, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 186, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 179, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 177, 36, 35), //init_module|delete_module
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 180, 35, 34), //quotactl
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 201, 34, 33), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 221, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 217, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 205, 31, 30), //futex|sched_setaffinity|sched_getaffinity
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 220, 30, 29), //getdents64|set_tid_address|restart_syscall
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 232, 29, 28), //fadvise64|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|exit_group
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 254, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 251, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 247, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 235, 25, 24), //epoll_ctl|tgkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 248, 24, 23), //waitid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 253, 23, 22), //ioprio_set|ioprio_get
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 257, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 256, 15, 14), //inotify_add_watch|inotify_rm_watch
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 261, 14, 13), //openat|mkdirat|mknodat|fchownat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 273, 13, 12), //newfstatat|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 280, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 279, 11, 10), //splice|tee|sync_file_range|vmsplice
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 282, 10, 9), //utimensat|epoll_pwait
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 305, 5, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 302, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 256, 21, 20), //inotify_add_watch|inotify_rm_watch
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 261, 20, 19), //openat|mkdirat|mknodat|fchownat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 302, 9, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 283, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 280, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 275, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 273, 15, 14), //newfstatat|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 279, 14, 13), //splice|tee|sync_file_range|vmsplice
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 282, 13, 12), //utimensat|epoll_pwait
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 285, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 284, 6, 5), //timerfd_create
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 300, 5, 4), //fallocate|timerfd_settime|timerfd_gettime|accept4|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|recvmmsg
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 303, 4, 3), //prlimit64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 317, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 312, 2, 1), //clock_adjtime|syncfs|sendmmsg|setns|getcpu|process_vm_readv|process_vm_writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 319, 1, 0), //seccomp|getrandom
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 284, 11, 10), //timerfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 300, 10, 9), //fallocate|timerfd_settime|timerfd_gettime|accept4|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open|recvmmsg
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 322, 5, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 314, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 305, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 303, 6, 5), //prlimit64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 312, 5, 4), //clock_adjtime|syncfs|sendmmsg|setns|getcpu|process_vm_readv|process_vm_writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 320, 4, 3), //sched_setattr|sched_getattr|renameat2|seccomp|getrandom|memfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 325, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 323, 2, 1), //execveat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 329, 1, 0), //mlock2|copy_file_range|preadv2|pwritev2
 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
 };
 
diff --git a/libc/seccomp/x86_policy.cpp b/libc/seccomp/x86_policy.cpp
index 89df5ca..254db43 100644
--- a/libc/seccomp/x86_policy.cpp
+++ b/libc/seccomp/x86_policy.cpp
@@ -5,118 +5,122 @@
 
 #include "seccomp_bpfs.h"
 const sock_filter x86_filter[] = {
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 0, 0, 112),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 128, 55, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 64, 27, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 36, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 0, 0, 116),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 131, 57, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 66, 29, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 41, 15, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 24, 7, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 10, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 8, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 7, 105, 104), //restart_syscall|exit|fork|read|write|open|close
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 9, 104, 103), //creat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 7, 109, 108), //restart_syscall|exit|fork|read|write|open|close
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 9, 108, 107), //creat
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 19, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 13, 102, 101), //unlink|execve|chdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 22, 101, 100), //lseek|getpid|mount
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 13, 106, 105), //unlink|execve|chdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 22, 105, 104), //lseek|getpid|mount
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 33, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 26, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 25, 98, 97), //getuid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 27, 97, 96), //ptrace
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 34, 96, 95), //access
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 54, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 45, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 41, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 39, 92, 91), //sync|kill|rename
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 44, 91, 90), //dup|pipe|times
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 51, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 46, 89, 88), //brk
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 53, 88, 87), //acct|umount2
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 60, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 57, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 56, 85, 84), //ioctl|fcntl
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 84, 83), //setpgid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 62, 83, 82), //umask|chroot
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 94, 13, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 85, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 74, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 66, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 65, 78, 77), //getppid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 68, 77, 76), //setsid|sigaction
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 77, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 76, 75, 74), //sethostname|setrlimit
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 80, 74, 73), //getrusage|gettimeofday|settimeofday
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 90, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 88, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 86, 71, 70), //readlink
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 89, 70, 69), //reboot
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 93, 69, 68), //mmap|munmap|truncate
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 116, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 102, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 96, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 95, 65, 64), //fchmod
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 98, 64, 63), //getpriority|setpriority
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 114, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 106, 62, 61), //socketcall|syslog|setitimer|getitimer
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 115, 61, 60), //wait4
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 124, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 118, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 117, 58, 57), //sysinfo
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 123, 57, 56), //fsync|sigreturn|clone|setdomainname|uname
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 126, 56, 55), //adjtimex|mprotect
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 252, 27, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 172, 13, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 143, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 136, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 131, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 130, 50, 49), //init_module|delete_module
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 134, 49, 48), //quotactl|getpgid|fchdir
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 138, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 137, 47, 46), //personality
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 142, 46, 45), //setfsuid|setfsgid|_llseek|getdents
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 168, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 150, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 149, 43, 42), //flock|msync|readv|writev|getsid|fdatasync
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 164, 42, 41), //mlock|munlock|mlockall|munlockall|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|nanosleep|mremap
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 169, 41, 40), //poll
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 213, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 190, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 25, 102, 101), //getuid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 27, 101, 100), //ptrace
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 36, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 34, 99, 98), //access
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 39, 98, 97), //sync|kill|rename
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 57, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 51, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 45, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 44, 94, 93), //dup|pipe|times
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 46, 93, 92), //brk
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 54, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 53, 91, 90), //acct|umount2
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 56, 90, 89), //ioctl|fcntl
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 64, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 60, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 58, 87, 86), //setpgid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 62, 86, 85), //umask|chroot
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 65, 85, 84), //getppid
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 96, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 88, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 77, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 74, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 68, 80, 79), //setsid|sigaction
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 76, 79, 78), //sethostname|setrlimit
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 85, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 80, 77, 76), //getrusage|gettimeofday|settimeofday
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 86, 76, 75), //readlink
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 94, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 90, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 89, 73, 72), //reboot
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 93, 72, 71), //mmap|munmap|truncate
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 95, 71, 70), //fchmod
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 118, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 114, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 102, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 98, 67, 66), //getpriority|setpriority
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 106, 66, 65), //socketcall|syslog|setitimer|getitimer
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 116, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 115, 64, 63), //wait4
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 117, 63, 62), //sysinfo
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 128, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 124, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 123, 60, 59), //fsync|sigreturn|clone|setdomainname|uname
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 126, 59, 58), //adjtimex|mprotect
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 130, 58, 57), //init_module|delete_module
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 272, 29, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 190, 15, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 150, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 138, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 136, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 134, 52, 51), //quotactl|getpgid|fchdir
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 137, 51, 50), //personality
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 143, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 142, 49, 48), //setfsuid|setfsgid|_llseek|getdents
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 149, 48, 47), //flock|msync|readv|writev|getsid|fdatasync
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 172, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 168, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 164, 45, 44), //mlock|munlock|mlockall|munlockall|sched_setparam|sched_getparam|sched_setscheduler|sched_getscheduler|sched_yield|sched_get_priority_max|sched_get_priority_min|sched_rr_get_interval|nanosleep|mremap
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 169, 44, 43), //poll
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 183, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 182, 37, 36), //prctl|rt_sigreturn|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|pread64|pwrite64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 188, 36, 35), //getcwd|capget|capset|sigaltstack|sendfile
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 182, 42, 41), //prctl|rt_sigreturn|rt_sigaction|rt_sigprocmask|rt_sigpending|rt_sigtimedwait|rt_sigqueueinfo|rt_sigsuspend|pread64|pwrite64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 188, 41, 40), //getcwd|capget|capset|sigaltstack|sendfile
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 224, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 213, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 199, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 198, 34, 33), //vfork|ugetrlimit|mmap2|truncate64|ftruncate64|stat64|lstat64|fstat64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 212, 33, 32), //getuid32|getgid32|geteuid32|getegid32|setreuid32|setregid32|getgroups32|setgroups32|fchown32|setresuid32|getresuid32|setresgid32|getresgid32
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 224, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 198, 37, 36), //vfork|ugetrlimit|mmap2|truncate64|ftruncate64|stat64|lstat64|fstat64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 212, 36, 35), //getuid32|getgid32|geteuid32|getegid32|setreuid32|setregid32|getgroups32|setgroups32|fchown32|setresuid32|getresuid32|setresgid32|getresgid32
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 218, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 215, 30, 29), //setuid32|setgid32
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 222, 29, 28), //mincore|madvise|getdents64|fcntl64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 244, 28, 27), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill|sendfile64|futex|sched_setaffinity|sched_getaffinity|set_thread_area
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 313, 13, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 291, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 272, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 254, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 253, 23, 22), //exit_group
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 271, 22, 21), //epoll_create|epoll_ctl|epoll_wait|remap_file_pages|set_tid_address|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|statfs64|fstatfs64|tgkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 215, 34, 33), //setuid32|setgid32
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 222, 33, 32), //mincore|madvise|getdents64|fcntl64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 254, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 252, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 244, 30, 29), //gettid|readahead|setxattr|lsetxattr|fsetxattr|getxattr|lgetxattr|fgetxattr|listxattr|llistxattr|flistxattr|removexattr|lremovexattr|fremovexattr|tkill|sendfile64|futex|sched_setaffinity|sched_getaffinity|set_thread_area
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 253, 29, 28), //exit_group
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 271, 28, 27), //epoll_create|epoll_ctl|epoll_wait|remap_file_pages|set_tid_address|timer_create|timer_settime|timer_gettime|timer_getoverrun|timer_delete|clock_settime|clock_gettime|clock_getres|clock_nanosleep|statfs64|fstatfs64|tgkill
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 322, 13, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 300, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 291, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 284, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 273, 20, 19), //fadvise64_64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 285, 19, 18), //waitid
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 300, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 273, 23, 22), //fadvise64_64
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 285, 22, 21), //waitid
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 295, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 294, 16, 15), //inotify_init|inotify_add_watch|inotify_rm_watch
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 299, 15, 14), //openat|mkdirat|mknodat|fchownat
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 311, 14, 13), //fstatat64|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 343, 7, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 322, 3, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 318, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 317, 10, 9), //splice|sync_file_range|tee|vmsplice
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 321, 9, 8), //getcpu|epoll_pwait|utimensat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 294, 20, 19), //inotify_init|inotify_add_watch|inotify_rm_watch
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 299, 19, 18), //openat|mkdirat|mknodat|fchownat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 318, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 313, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 311, 16, 15), //fstatat64|unlinkat|renameat|linkat|symlinkat|readlinkat|fchmodat|faccessat|pselect6|ppoll|unshare
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 317, 15, 14), //splice|sync_file_range|tee|vmsplice
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 321, 14, 13), //getcpu|epoll_pwait|utimensat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 351, 7, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 343, 3, 0),
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 340, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 337, 7, 6), //timerfd_create|eventfd|fallocate|timerfd_settime|timerfd_gettime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 341, 6, 5), //prlimit64
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 354, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 337, 10, 9), //timerfd_create|eventfd|fallocate|timerfd_settime|timerfd_gettime|signalfd4|eventfd2|epoll_create1|dup3|pipe2|inotify_init1|preadv|pwritev|rt_tgsigqueueinfo|perf_event_open
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 341, 9, 8), //prlimit64
 BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 346, 1, 0),
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 345, 3, 2), //clock_adjtime|syncfs
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 349, 2, 1), //setns|process_vm_readv|process_vm_writev
-BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 356, 1, 0), //seccomp|getrandom
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 345, 7, 6), //clock_adjtime|syncfs
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 349, 6, 5), //setns|process_vm_readv|process_vm_writev
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 376, 3, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 358, 1, 0),
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 357, 3, 2), //sched_setattr|sched_getattr|renameat2|seccomp|getrandom|memfd_create
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 359, 2, 1), //execveat
+BPF_JUMP(BPF_JMP|BPF_JGE|BPF_K, 380, 1, 0), //mlock2|copy_file_range|preadv2|pwritev2
 BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW),
 };
 
diff --git a/libdl/libdl.c b/libdl/libdl.c
index 14e745b..1a65b67 100644
--- a/libdl/libdl.c
+++ b/libdl/libdl.c
@@ -131,6 +131,11 @@
 }
 #endif
 
+/*
+ * This needs to be defined as weak because it is also defined in libc.a.
+ * Without this, static executables will have a multiple definition error.
+ */
+__attribute__((__weak__))
 int dl_iterate_phdr(int (*cb)(struct dl_phdr_info* info, size_t size, void* data), void* data) {
   return __loader_dl_iterate_phdr(cb, data);
 }
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 681e6a3..afd990a 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <sys/mman.h>
 #include <sys/param.h>
+#include <sys/vfs.h>
 #include <unistd.h>
 
 #include <new>
@@ -362,16 +363,14 @@
 //
 // Intended to be called by libc's __gnu_Unwind_Find_exidx().
 _Unwind_Ptr do_dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
-  uintptr_t addr = reinterpret_cast<uintptr_t>(pc);
-
   for (soinfo* si = solist_get_head(); si != 0; si = si->next) {
-    if ((addr >= si->base) && (addr < (si->base + si->size))) {
+    if ((pc >= si->base) && (pc < (si->base + si->size))) {
         *pcount = si->ARM_exidx_count;
         return reinterpret_cast<_Unwind_Ptr>(si->ARM_exidx);
     }
   }
   *pcount = 0;
-  return nullptr;
+  return 0;
 }
 
 #endif
@@ -1192,7 +1191,15 @@
     return false;
   }
 
-  if (!ns->is_accessible(realpath)) {
+  struct statfs fs_stat;
+  if (TEMP_FAILURE_RETRY(fstatfs(task->get_fd(), &fs_stat)) != 0) {
+    DL_ERR("unable to fstatfs file for the library \"%s\": %s", name, strerror(errno));
+    return false;
+  }
+
+  // do not check accessibility using realpath if fd is located on tmpfs
+  // this enables use of memfd_create() for apps
+  if ((fs_stat.f_type != TMPFS_MAGIC) && (!ns->is_accessible(realpath))) {
     // TODO(dimitry): workaround for http://b/26394120 - the grey-list
 
     // TODO(dimitry) before O release: add a namespace attribute to have this enabled
diff --git a/tests/Android.bp b/tests/Android.bp
index ae8d7fc..d4e3800 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -58,6 +58,7 @@
         "complex_test.cpp",
         "ctype_test.cpp",
         "dirent_test.cpp",
+        "elf_test.cpp",
         "endian_test.cpp",
         "error_test.cpp",
         "eventfd_test.cpp",
@@ -74,6 +75,7 @@
         "libc_logging_test.cpp",
         "libgen_basename_test.cpp",
         "libgen_test.cpp",
+        "linux_swab_test.cpp",
         "locale_test.cpp",
         "malloc_test.cpp",
         "math_test.cpp",
@@ -256,6 +258,7 @@
         "dl_test.cpp",
         "dlfcn_symlink_support.cpp",
         "dlfcn_test.cpp",
+        "link_test.cpp",
         "pthread_dlfcn_test.cpp",
     ],
     static_libs: [
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index a0226a6..45a8b8b 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -24,9 +24,14 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+
 #include <android/dlext.h>
+#include <android-base/strings.h>
+
+#include <linux/memfd.h>
 #include <sys/mman.h>
 #include <sys/types.h>
+#include <sys/vfs.h>
 #include <sys/wait.h>
 
 #include <pagemap/pagemap.h>
@@ -460,7 +465,8 @@
     EXPECT_EQ(1729U, *taxicab_number);
   }
 
-  void SpawnChildrenAndMeasurePss(const char* lib, bool share_relro, size_t* pss_out);
+  void SpawnChildrenAndMeasurePss(const char* lib, const char* relro_file, bool share_relro,
+                                  size_t* pss_out);
 
   android_dlextinfo extinfo_;
 };
@@ -506,19 +512,23 @@
   ASSERT_NOERROR(pipe(pipefd));
 
   size_t without_sharing, with_sharing;
-  ASSERT_NO_FATAL_FAILURE(SpawnChildrenAndMeasurePss(kLibName, false, &without_sharing));
-  ASSERT_NO_FATAL_FAILURE(SpawnChildrenAndMeasurePss(kLibName, true, &with_sharing));
+  ASSERT_NO_FATAL_FAILURE(SpawnChildrenAndMeasurePss(kLibName, tf.filename, false, &without_sharing));
+  ASSERT_NO_FATAL_FAILURE(SpawnChildrenAndMeasurePss(kLibName, tf.filename, true, &with_sharing));
+  ASSERT_LT(with_sharing, without_sharing);
 
-  // We expect the sharing to save at least 10% of the total PSS. In practice
-  // it saves 40%+ for this test.
-  size_t expected_size = without_sharing - (without_sharing/10);
-  EXPECT_LT(with_sharing, expected_size);
+  // We expect the sharing to save at least 50% of the library's total PSS.
+  // In practice it saves 80%+ for this library in the test.
+  size_t pss_saved = without_sharing - with_sharing;
+  size_t expected_min_saved = without_sharing / 2;
+
+  EXPECT_LT(expected_min_saved, pss_saved);
 
   // Use destructor of tf to close and unlink the file.
   tf.fd = extinfo_.relro_fd;
 }
 
-void getPss(pid_t pid, size_t* pss_out) {
+void GetPss(bool shared_relro, const char* lib, const char* relro_file, pid_t pid,
+            size_t* total_pss) {
   pm_kernel_t* kernel;
   ASSERT_EQ(0, pm_kernel_create(&kernel));
 
@@ -529,21 +539,28 @@
   size_t num_maps;
   ASSERT_EQ(0, pm_process_maps(process, &maps, &num_maps));
 
-  size_t total_pss = 0;
-  for (size_t i = 0; i < num_maps; i++) {
-    pm_memusage_t usage;
-    ASSERT_EQ(0, pm_map_usage(maps[i], &usage));
-    total_pss += usage.pss;
+  // Calculate total PSS of the library.
+  *total_pss = 0;
+  bool saw_relro_file = false;
+  for (size_t i = 0; i < num_maps; ++i) {
+    if (android::base::EndsWith(maps[i]->name, lib) || strcmp(maps[i]->name, relro_file) == 0) {
+      if (strcmp(maps[i]->name, relro_file) == 0) saw_relro_file = true;
+
+      pm_memusage_t usage;
+      ASSERT_EQ(0, pm_map_usage(maps[i], &usage));
+      *total_pss += usage.pss;
+    }
   }
-  *pss_out = total_pss;
 
   free(maps);
   pm_process_destroy(process);
   pm_kernel_destroy(kernel);
+
+  if (shared_relro) ASSERT_TRUE(saw_relro_file);
 }
 
-void DlExtRelroSharingTest::SpawnChildrenAndMeasurePss(const char* lib, bool share_relro,
-                                                       size_t* pss_out) {
+void DlExtRelroSharingTest::SpawnChildrenAndMeasurePss(const char* lib, const char* relro_file,
+                                                       bool share_relro, size_t* pss_out) {
   const int CHILDREN = 20;
 
   // Create children
@@ -596,11 +613,11 @@
     childpipe[i] = parent_done_pipe[1];
   }
 
-  // Sum the PSS of all the children
+  // Sum the PSS of tested library of all the children
   size_t total_pss = 0;
   for (int i=0; i<CHILDREN; ++i) {
     size_t child_pss;
-    ASSERT_NO_FATAL_FAILURE(getPss(child_pids[i], &child_pss));
+    ASSERT_NO_FATAL_FAILURE(GetPss(share_relro, lib, relro_file, child_pids[i], &child_pss));
     total_pss += child_pss;
   }
   *pss_out = total_pss;
@@ -802,6 +819,98 @@
   dlclose(handle2);
 }
 
+TEST(dlext, dlopen_ext_use_o_tmpfile_fd) {
+  const std::string lib_path = get_testlib_root() + "/libtest_simple.so";
+
+  int tmpfd = TEMP_FAILURE_RETRY(
+        open(get_testlib_root().c_str(), O_TMPFILE | O_CLOEXEC | O_RDWR | O_EXCL));
+
+  // Ignore kernels without O_TMPFILE flag support
+  if (tmpfd == -1 && (errno == EISDIR || errno == EINVAL || errno == EOPNOTSUPP)) {
+    return;
+  }
+
+  ASSERT_TRUE(tmpfd != -1) << strerror(errno);
+
+  android_namespace_t* ns =
+          android_create_namespace("testing-o_tmpfile",
+                                   nullptr,
+                                   get_testlib_root().c_str(),
+                                   ANDROID_NAMESPACE_TYPE_ISOLATED,
+                                   nullptr,
+                                   nullptr);
+
+  ASSERT_DL_NOTNULL(ns);
+
+  ASSERT_TRUE(android_link_namespaces(ns, nullptr, g_core_shared_libs.c_str())) << dlerror();
+
+  std::string content;
+  ASSERT_TRUE(android::base::ReadFileToString(lib_path, &content)) << strerror(errno);
+  ASSERT_TRUE(android::base::WriteStringToFd(content, tmpfd)) << strerror(errno);
+
+  android_dlextinfo extinfo;
+  extinfo.flags = ANDROID_DLEXT_USE_LIBRARY_FD | ANDROID_DLEXT_USE_NAMESPACE;
+  extinfo.library_fd = tmpfd;
+  extinfo.library_namespace = ns;
+
+  void* handle = android_dlopen_ext("foobar", RTLD_NOW, &extinfo);
+
+  ASSERT_DL_NOTNULL(handle);
+
+  uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_testlib_taxicab_number"));
+  ASSERT_DL_NOTNULL(taxicab_number);
+  EXPECT_EQ(1729U, *taxicab_number);
+  dlclose(handle);
+}
+
+TEST(dlext, dlopen_ext_use_memfd) {
+  const std::string lib_path = get_testlib_root() + "/libtest_simple.so";
+
+  // create memfd
+  int memfd = syscall(__NR_memfd_create, "foobar", MFD_CLOEXEC);
+  if (memfd == -1 && errno == ENOSYS) {
+    return;
+  }
+
+  ASSERT_TRUE(memfd != -1) << strerror(errno);
+
+  // Check st.f_type is TMPFS_MAGIC for memfd
+  struct statfs st;
+  ASSERT_TRUE(TEMP_FAILURE_RETRY(fstatfs(memfd, &st)) == 0) << strerror(errno);
+  ASSERT_EQ(static_cast<decltype(st.f_type)>(TMPFS_MAGIC), st.f_type);
+
+  android_namespace_t* ns =
+          android_create_namespace("testing-memfd",
+                                   nullptr,
+                                   get_testlib_root().c_str(),
+                                   ANDROID_NAMESPACE_TYPE_ISOLATED,
+                                   nullptr,
+                                   nullptr);
+
+  ASSERT_DL_NOTNULL(ns);
+
+  ASSERT_TRUE(android_link_namespaces(ns, nullptr, g_core_shared_libs.c_str())) << dlerror();
+
+  // read file into memfd backed one.
+  std::string content;
+  ASSERT_TRUE(android::base::ReadFileToString(lib_path, &content)) << strerror(errno);
+  ASSERT_TRUE(android::base::WriteStringToFd(content, memfd)) << strerror(errno);
+
+  android_dlextinfo extinfo;
+  extinfo.flags = ANDROID_DLEXT_USE_LIBRARY_FD | ANDROID_DLEXT_USE_NAMESPACE;
+  extinfo.library_fd = memfd;
+  extinfo.library_namespace = ns;
+
+  void* handle = android_dlopen_ext("foobar", RTLD_NOW, &extinfo);
+
+  ASSERT_DL_NOTNULL(handle);
+
+  uint32_t* taxicab_number = reinterpret_cast<uint32_t*>(dlsym(handle, "dlopen_testlib_taxicab_number"));
+  ASSERT_DL_NOTNULL(taxicab_number);
+  EXPECT_EQ(1729U, *taxicab_number);
+  dlclose(handle);
+}
+
 TEST(dlext, ns_symbol_visibilty_one_namespace) {
   static const char* root_lib = "libnstest_root.so";
   ASSERT_TRUE(android_init_anonymous_namespace(g_core_shared_libs.c_str(), nullptr));
diff --git a/tests/elf_test.cpp b/tests/elf_test.cpp
new file mode 100644
index 0000000..ad7cdfa
--- /dev/null
+++ b/tests/elf_test.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#include <elf.h>
+
+#include <gtest/gtest.h>
+
+// https://github.com/android-ndk/ndk/issues/377
+TEST(elf, have_ELF_ST_INFO_macros) {
+  uint8_t info;
+
+  // 0x0f
+  info = ELF32_ST_INFO(STB_LOCAL, STT_HIPROC);
+  ASSERT_EQ(STB_LOCAL, ELF32_ST_BIND(info));
+  ASSERT_EQ(STT_HIPROC, ELF32_ST_TYPE(info));
+
+  // 0x0f
+  info = ELF64_ST_INFO(STB_LOCAL, STT_HIPROC);
+  ASSERT_EQ(STB_LOCAL, ELF64_ST_BIND(info));
+  ASSERT_EQ(STT_HIPROC, ELF64_ST_TYPE(info));
+
+  // 0xf0
+  info = ELF32_ST_INFO(STB_LOCAL, STT_HIPROC);
+  ASSERT_EQ(STB_LOCAL, ELF32_ST_BIND(info));
+  ASSERT_EQ(STT_HIPROC, ELF32_ST_TYPE(info));
+
+  // 0xf0
+  info = ELF64_ST_INFO(STB_LOCAL, STT_HIPROC);
+  ASSERT_EQ(STB_LOCAL, ELF64_ST_BIND(info));
+  ASSERT_EQ(STT_HIPROC, ELF64_ST_TYPE(info));
+}
diff --git a/tests/fortify_test.cpp b/tests/fortify_test.cpp
index 67103e1..2e0f822 100644
--- a/tests/fortify_test.cpp
+++ b/tests/fortify_test.cpp
@@ -219,7 +219,6 @@
 #endif // __BIONIC__
 }
 
-// this buffer overflow. TODO: Fix clang.
 TEST_F(DEATHTEST, strlcpy_fortified2) {
 #if defined(__BIONIC__)
   foo myfoo;
@@ -231,7 +230,6 @@
 #endif // __BIONIC__
 }
 
-// this buffer overflow. TODO: Fix clang.
 TEST_F(DEATHTEST, strlcat_fortified2) {
 #if defined(__BIONIC__)
   foo myfoo;
diff --git a/tests/link_test.cpp b/tests/link_test.cpp
new file mode 100644
index 0000000..ac3ccb9
--- /dev/null
+++ b/tests/link_test.cpp
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <gtest/gtest.h>
+
+#include <link.h>
+
+TEST(link, dl_iterate_phdr_early_exit) {
+  static size_t call_count = 0;
+  ASSERT_EQ(123, dl_iterate_phdr([](dl_phdr_info*, size_t, void*) { ++call_count; return 123; },
+                                 nullptr));
+  ASSERT_EQ(1u, call_count);
+}
+
+TEST(link, dl_iterate_phdr) {
+  struct Functor {
+    static int Callback(dl_phdr_info* i, size_t s, void* data) {
+      reinterpret_cast<Functor*>(data)->DoChecks(i, s);
+      return 0;
+    }
+    void DoChecks(dl_phdr_info* info, size_t s) {
+      ASSERT_EQ(sizeof(dl_phdr_info), s);
+
+      // TODO: why does the entry for the main executable have a null dlpi_addr and no name anyway?
+      if (++count == 1 && info->dlpi_addr == 0) return;
+
+      ASSERT_TRUE(info->dlpi_name != nullptr);
+
+      // Find the first PT_LOAD program header so we can find the ELF header.
+      for (ElfW(Half) i = 0; i < info->dlpi_phnum; ++i) {
+        const ElfW(Phdr)* phdr = reinterpret_cast<const ElfW(Phdr)*>(&info->dlpi_phdr[i]);
+        if (phdr->p_type == PT_LOAD) {
+          const ElfW(Ehdr)* ehdr = reinterpret_cast<const ElfW(Ehdr)*>(info->dlpi_addr +
+                                                                       phdr->p_vaddr);
+          // Does it look like an ELF file?
+          ASSERT_EQ(0, memcmp(ehdr, ELFMAG, SELFMAG));
+          // Does the e_phnum match what dl_iterate_phdr told us?
+          ASSERT_EQ(info->dlpi_phnum, ehdr->e_phnum);
+          break;
+        }
+      }
+    }
+    size_t count;
+  } f = {};
+  ASSERT_EQ(0, dl_iterate_phdr(Functor::Callback, &f));
+}
+
+#if __arm__
+static uintptr_t read_exidx_func(uintptr_t* entry) {
+  int32_t offset = *entry;
+  // Sign-extend from int31 to int32.
+  if ((offset & 0x40000000) != 0) {
+    offset += -0x7fffffff - 1;
+  }
+  return reinterpret_cast<uintptr_t>(entry) + offset;
+}
+__attribute__((__unused__)) static void another_function_in_same_ELF_file() {}
+#endif
+
+TEST(link, dl_unwind_find_exidx) {
+#if __arm__
+  int count = 0;
+  struct eit_entry_t {
+    uintptr_t one;
+    uintptr_t two;
+  };
+  eit_entry_t* entries = reinterpret_cast<eit_entry_t*>(dl_unwind_find_exidx(
+      reinterpret_cast<_Unwind_Ptr>(read_exidx_func), &count));
+  ASSERT_TRUE(entries != nullptr);
+  ASSERT_GT(count, 0);
+
+  // Sanity checks
+  uintptr_t func = reinterpret_cast<uintptr_t>(read_exidx_func);
+  bool found = false;
+  for (int i = 0; i < count; ++i) {
+    // Entries must have bit 31 clear.
+    ASSERT_TRUE((entries[i].one & (1<<31)) == 0);
+
+    uintptr_t exidx_func = read_exidx_func(&entries[i].one);
+
+    // If our function is compiled for thumb, exception table contains our address - 1.
+    if (func == exidx_func || func == exidx_func + 1) found = true;
+
+    // Entries must be sorted. Some addresses may appear twice if function
+    // is compiled for arm.
+    if (i > 0) {
+      EXPECT_GE(exidx_func, read_exidx_func(&entries[i - 1].one)) << i;
+    }
+  }
+  ASSERT_TRUE(found);
+#else
+  GTEST_LOG_(INFO) << "dl_unwind_find_exidx is an ARM-only API\n";
+#endif
+}
diff --git a/tests/linux_swab_test.cpp b/tests/linux_swab_test.cpp
new file mode 100644
index 0000000..6b964dc
--- /dev/null
+++ b/tests/linux_swab_test.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+#include <gtest/gtest.h>
+
+#include <linux/swab.h>
+
+// This test makes sure that references to all of the kernel swab
+// macros/inline functions that are exported work properly.
+// Verifies that any kernel header updates do not break these macros.
+TEST(swab, fswa) {
+  EXPECT_EQ(0x3412U, __swab16(0x1234));
+  EXPECT_EQ(0x78563412U, __swab32(0x12345678U));
+  EXPECT_EQ(0xbaefcdab78563412ULL, __swab64(0x12345678abcdefbaULL));
+
+  __u16 bval16 = 0x1234;
+  EXPECT_EQ(0x3412U, __swab16p(&bval16));
+  __u32 bval32 = 0x12345678U;
+  EXPECT_EQ(0x78563412U, __swab32p(&bval32));
+  __u64 bval64 = 0x12345678abcdefbaULL;
+  EXPECT_EQ(0xbaefcdab78563412ULL, __swab64p(&bval64));
+
+  __u16 sval16 = 0x1234;
+  __swab16s(&sval16);
+  EXPECT_EQ(0x3412U, sval16);
+  __u32 sval32 = 0x12345678U;
+  __swab32s(&sval32);
+  EXPECT_EQ(0x78563412U, sval32);
+  __u64 sval64 = 0x12345678abcdefbaULL;
+  __swab64s(&sval64);
+  EXPECT_EQ(0xbaefcdab78563412ULL, sval64);
+
+  EXPECT_EQ(0x56781234U, __swahw32(0x12345678U));
+  EXPECT_EQ(0x34127856U, __swahb32(0x12345678U));
+
+  __u32 hval32 = 0x12345678U;
+  EXPECT_EQ(0x56781234U, __swahw32p(&hval32));
+  hval32 = 0x12345678U;
+  EXPECT_EQ(0x34127856U, __swahb32p(&hval32));
+
+  __u32 hsval32 = 0x12345678U;
+  __swahw32s(&hsval32);
+  EXPECT_EQ(0x56781234U, hsval32);
+  hsval32 = 0x12345678U;
+  __swahb32s(&hsval32);
+  EXPECT_EQ(0x34127856U, hsval32);
+}
diff --git a/tests/sys_ptrace_test.cpp b/tests/sys_ptrace_test.cpp
index 69638be..00322ec 100644
--- a/tests/sys_ptrace_test.cpp
+++ b/tests/sys_ptrace_test.cpp
@@ -266,7 +266,7 @@
   ASSERT_EQ(0, sigaction(SIGALRM, &action, &oldaction)) << strerror(errno);
   alarm(5);
 
-  run_watchpoint_test<Uint128_t>(watchpoint_imprecise_child, 8, 8);
+  run_watchpoint_test<Uint128_t>(watchpoint_imprecise_child, 8, sizeof(void*));
 
   ASSERT_EQ(0, sigaction(SIGALRM, &oldaction, nullptr)) << strerror(errno);
 }
diff --git a/tools/versioner/src/Driver.cpp b/tools/versioner/src/Driver.cpp
index 215dc3c..1b631b6 100644
--- a/tools/versioner/src/Driver.cpp
+++ b/tools/versioner/src/Driver.cpp
@@ -42,6 +42,7 @@
 #include <llvm/ADT/IntrusiveRefCntPtr.h>
 #include <llvm/ADT/SmallVector.h>
 #include <llvm/ADT/StringRef.h>
+#include <llvm/Config/config.h>
 
 #include "Arch.h"
 #include "DeclarationDatabase.h"
@@ -237,7 +238,14 @@
   }
 
   clang::CompilerInstance Compiler;
+
+// Remove the workaround once b/35936936 is fixed.
+#if LLVM_VERSION_MAJOR >= 5
+  Compiler.setInvocation(std::move(invocation));
+#else
   Compiler.setInvocation(invocation.release());
+#endif
+
   Compiler.setDiagnostics(diags.get());
   Compiler.setVirtualFileSystem(vfs);
 
diff --git a/tools/versioner/src/versioner.cpp b/tools/versioner/src/versioner.cpp
index 194f276..59d41da 100644
--- a/tools/versioner/src/versioner.cpp
+++ b/tools/versioner/src/versioner.cpp
@@ -82,7 +82,7 @@
   std::vector<std::string> headers = collectHeaders(header_dir);
   std::vector<std::string> dependencies = { header_dir };
   if (!dependency_dir.empty()) {
-    auto collect_children = [&dependencies, &dependency_dir](const std::string& dir_path) {
+    auto collect_children = [&dependencies](const std::string& dir_path) {
       DIR* dir = opendir(dir_path.c_str());
       if (!dir) {
         err(1, "failed to open dependency directory '%s'", dir_path.c_str());
@@ -197,9 +197,8 @@
     }
   } else {
     // Spawn threads.
-    size_t cpu_count = getCpuCount();
     for (size_t i = 0; i < thread_count; ++i) {
-      threads.emplace_back([&jobs, &job_index, &result, &header_dir, vfs, cpu_count, i]() {
+      threads.emplace_back([&jobs, &job_index, &result, vfs]() {
         while (true) {
           size_t idx = job_index++;
           if (idx >= jobs.size()) {