Merge "Update strip property format"
diff --git a/libc/bionic/fpclassify.cpp b/libc/bionic/fpclassify.cpp
index 21ff946..f8cea80 100644
--- a/libc/bionic/fpclassify.cpp
+++ b/libc/bionic/fpclassify.cpp
@@ -29,7 +29,8 @@
 #include <sys/types.h>
 
 #include <math.h>
-#include <machine/ieee.h>
+
+#include "private/bionic_ieee.h"
 
 // These aren't declared in our <math.h>.
 extern "C" int __isinf(double);
diff --git a/libc/include/nsswitch.h b/libc/dns/include/nsswitch.h
similarity index 100%
rename from libc/include/nsswitch.h
rename to libc/dns/include/nsswitch.h
diff --git a/libc/dns/nameser/ns_parse.c b/libc/dns/nameser/ns_parse.c
index 2d6d530..3a1901a 100644
--- a/libc/dns/nameser/ns_parse.c
+++ b/libc/dns/nameser/ns_parse.c
@@ -52,6 +52,8 @@
 
 /* Public. */
 
+struct _ns_flagdata {  int mask, shift;  };
+
 /* These need to be in the same order as the nres.h:ns_flag enum. */
 const struct _ns_flagdata _ns_flagdata[16] = {
 	{ 0x8000, 15 },		/* qr. */
diff --git a/libc/dns/net/getnameinfo.c b/libc/dns/net/getnameinfo.c
index 893e982..abd1a66 100644
--- a/libc/dns/net/getnameinfo.c
+++ b/libc/dns/net/getnameinfo.c
@@ -54,7 +54,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <net/if.h>
-#include <net/if_ieee1394.h>
 #include <net/if_types.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/libc/dns/resolv/res_send.c b/libc/dns/resolv/res_send.c
index 0e30b28..4c4b953 100644
--- a/libc/dns/resolv/res_send.c
+++ b/libc/dns/resolv/res_send.c
@@ -552,10 +552,17 @@
 			n = send_vc(statp, buf, buflen, ans, anssiz, &terrno,
 				    ns, &now, &rcode, &delay);
 
-			struct __res_sample sample;
-			_res_stats_set_sample(&sample, now, rcode, delay);
-			_resolv_cache_add_resolver_stats_sample(statp->netid, revision_id, ns,
-				&sample, params.max_samples);
+			/*
+			 * Only record stats the first time we try a query. This ensures that
+			 * queries that deterministically fail (e.g., a name that always returns
+			 * SERVFAIL or times out) do not unduly affect the stats.
+			 */
+			if (try == 0) {
+				struct __res_sample sample;
+				_res_stats_set_sample(&sample, now, rcode, delay);
+				_resolv_cache_add_resolver_stats_sample(statp->netid, revision_id,
+					ns, &sample, params.max_samples);
+			}
 
 			if (DBG) {
 				__libc_format_log(ANDROID_LOG_DEBUG, "libc",
@@ -576,10 +583,13 @@
 			n = send_dg(statp, buf, buflen, ans, anssiz, &terrno,
 				    ns, &v_circuit, &gotsomewhere, &now, &rcode, &delay);
 
-			struct __res_sample sample;
-			_res_stats_set_sample(&sample, now, rcode, delay);
-			_resolv_cache_add_resolver_stats_sample(statp->netid, revision_id, ns,
-				&sample, params.max_samples);
+			/* Only record stats the first time we try a query. See above. */
+			if (try == 0) {
+				struct __res_sample sample;
+				_res_stats_set_sample(&sample, now, rcode, delay);
+				_resolv_cache_add_resolver_stats_sample(statp->netid, revision_id,
+					ns, &sample, params.max_samples);
+			}
 
 			if (DBG) {
 				__libc_format_log(ANDROID_LOG_DEBUG, "libc", "used send_dg %d\n",n);
@@ -741,7 +751,7 @@
 	const u_char *buf, int buflen, u_char *ans, int anssiz,
 	int *terrno, int ns, time_t* at, int* rcode, int* delay)
 {
-	*at = 0;
+	*at = time(NULL);
 	*rcode = RCODE_INTERNAL_ERROR;
 	*delay = 0;
 	const HEADER *hp = (const HEADER *)(const void *)buf;
@@ -919,9 +929,6 @@
 		return (0);
 	}
 
-	struct timespec done = evNowTime();
-	*at = done.tv_sec;
-
 	if (truncating) {
 		/*
 		 * Flush rest of answer so connection stays in synch.
@@ -959,6 +966,7 @@
 	 * next nameserver ought not be tried.
 	 */
 	if (resplen > 0) {
+	    struct timespec done = evNowTime();
 	    *delay = _res_stats_calculate_rtt(&done, &now);
 	    *rcode = anhp->rcode;
 	}
@@ -1074,7 +1082,7 @@
 	int *terrno, int ns, int *v_circuit, int *gotsomewhere,
 	time_t *at, int *rcode, int* delay)
 {
-	*at = 0;
+	*at = time(NULL);
 	*rcode = RCODE_INTERNAL_ERROR;
 	*delay = 0;
 	const HEADER *hp = (const HEADER *)(const void *)buf;
@@ -1261,7 +1269,6 @@
 		goto retry;;
 	}
 	done = evNowTime();
-	*at = done.tv_sec;
 	*delay = _res_stats_calculate_rtt(&done, &now);
 	if (anhp->rcode == SERVFAIL ||
 	    anhp->rcode == NOTIMP ||
diff --git a/libc/include/android/dlext.h b/libc/include/android/dlext.h
index 6e32b68..05a27f3 100644
--- a/libc/include/android/dlext.h
+++ b/libc/include/android/dlext.h
@@ -129,7 +129,8 @@
   struct android_namespace_t* library_namespace;
 } android_dlextinfo;
 
-extern void* android_dlopen_ext(const char* filename, int flag, const android_dlextinfo* extinfo);
+extern void* android_dlopen_ext(const char* filename, int flag, const android_dlextinfo* extinfo)
+  __INTRODUCED_IN(21);
 
 /*
  * Initializes public and anonymous namespaces. The public_ns_sonames is the list of sonames
diff --git a/libc/include/android/set_abort_message.h b/libc/include/android/set_abort_message.h
index 4b3d82b..aebedba 100644
--- a/libc/include/android/set_abort_message.h
+++ b/libc/include/android/set_abort_message.h
@@ -33,7 +33,7 @@
 
 __BEGIN_DECLS
 
-void android_set_abort_message(const char* msg);
+void android_set_abort_message(const char* msg) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h
index 86265bf..e4f94ef 100644
--- a/libc/include/arpa/inet.h
+++ b/libc/include/arpa/inet.h
@@ -37,10 +37,10 @@
 
 in_addr_t inet_addr(const char*);
 int inet_aton(const char*, struct in_addr*);
-in_addr_t inet_lnaof(struct in_addr);
-struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
-in_addr_t inet_netof(struct in_addr);
-in_addr_t inet_network(const char*);
+in_addr_t inet_lnaof(struct in_addr) __INTRODUCED_IN(21);
+struct in_addr inet_makeaddr(in_addr_t, in_addr_t) __INTRODUCED_IN(21);
+in_addr_t inet_netof(struct in_addr) __INTRODUCED_IN(21);
+in_addr_t inet_network(const char*) __INTRODUCED_IN(21);
 char* inet_ntoa(struct in_addr);
 const char* inet_ntop(int, const void*, char*, socklen_t);
 unsigned int inet_nsap_addr(const char*, unsigned char*, int);
diff --git a/libc/include/arpa/nameser.h b/libc/include/arpa/nameser.h
index 3690f9c..a207eab 100644
--- a/libc/include/arpa/nameser.h
+++ b/libc/include/arpa/nameser.h
@@ -141,10 +141,6 @@
 };
 typedef struct ns_newmsg ns_newmsg;
 
-/* Private data structure - do not use from outside library. */
-struct _ns_flagdata {  int mask, shift;  };
-extern const struct _ns_flagdata _ns_flagdata[];
-
 /* Accessor macros - this is part of the public interface. */
 
 #define ns_msg_id(handle) ((handle)._id + 0)
@@ -566,30 +562,34 @@
 #endif
 
 __BEGIN_DECLS
-int ns_msg_getflag(ns_msg, int);
-uint16_t ns_get16(const u_char*);
-uint32_t ns_get32(const u_char*);
-void ns_put16(uint16_t, u_char*);
-void ns_put32(uint32_t, u_char*);
-int ns_initparse(const u_char*, int, ns_msg*);
-int ns_skiprr(const u_char*, const u_char*, ns_sect, int);
-int ns_parserr(ns_msg*, ns_sect, int, ns_rr*);
-int ns_sprintrr(const ns_msg*, const ns_rr*, const char*, const char*, char*, size_t);
+int ns_msg_getflag(ns_msg, int) __INTRODUCED_IN_64(23);
+uint16_t ns_get16(const u_char*) __INTRODUCED_IN_64(23);
+uint32_t ns_get32(const u_char*) __INTRODUCED_IN_64(23);
+void ns_put16(uint16_t, u_char*) __INTRODUCED_IN_64(23);
+void ns_put32(uint32_t, u_char*) __INTRODUCED_IN_64(23);
+int ns_initparse(const u_char*, int, ns_msg*) __INTRODUCED_IN_64(23);
+int ns_skiprr(const u_char*, const u_char*, ns_sect, int) __INTRODUCED_IN_64(23);
+int ns_parserr(ns_msg*, ns_sect, int, ns_rr*) __INTRODUCED_IN_64(23);
+int ns_sprintrr(const ns_msg*, const ns_rr*, const char*, const char*, char*, size_t)
+  __INTRODUCED_IN_64(23);
 int ns_sprintrrf(const u_char*, size_t, const char*, ns_class, ns_type, u_long, const u_char*,
-                 size_t, const char*, const char*, char*, size_t);
-int ns_format_ttl(u_long, char*, size_t);
-int ns_name_ntol(const u_char*, u_char*, size_t);
-int ns_name_ntop(const u_char*, char*, size_t);
-int ns_name_pton(const char*, u_char*, size_t);
-int ns_name_unpack(const u_char*, const u_char*, const u_char*, u_char*, size_t);
-int ns_name_pack(const u_char*, u_char*, int, const u_char**, const u_char**);
-int ns_name_uncompress(const u_char*, const u_char*, const u_char*, char*, size_t);
-int ns_name_compress(const char*, u_char*, size_t, const u_char**, const u_char**);
-int ns_name_skip(const u_char**, const u_char*);
-void ns_name_rollback(const u_char*, const u_char**, const u_char**);
+                 size_t, const char*, const char*, char*, size_t) __INTRODUCED_IN_64(23);
+int ns_format_ttl(u_long, char*, size_t) __INTRODUCED_IN_64(23);
+int ns_name_ntol(const u_char*, u_char*, size_t) __INTRODUCED_IN_64(23);
+int ns_name_ntop(const u_char*, char*, size_t) __INTRODUCED_IN_64(23);
+int ns_name_pton(const char*, u_char*, size_t) __INTRODUCED_IN_64(23);
+int ns_name_unpack(const u_char*, const u_char*, const u_char*, u_char*, size_t)
+  __INTRODUCED_IN_64(23);
+int ns_name_pack(const u_char*, u_char*, int, const u_char**, const u_char**) __INTRODUCED_IN_64(23);
+int ns_name_uncompress(const u_char*, const u_char*, const u_char*, char*, size_t)
+  __INTRODUCED_IN_64(23);
+int ns_name_compress(const char*, u_char*, size_t, const u_char**, const u_char**)
+  __INTRODUCED_IN_64(23);
+int ns_name_skip(const u_char**, const u_char*) __INTRODUCED_IN_64(23);
+void ns_name_rollback(const u_char*, const u_char**, const u_char**) __INTRODUCED_IN_64(23);
 
-int ns_makecanon(const char*, char*, size_t);
-int ns_samename(const char*, const char*);
+int ns_makecanon(const char*, char*, size_t) __INTRODUCED_IN_64(23);
+int ns_samename(const char*, const char*) __INTRODUCED_IN_64(23);
 __END_DECLS
 
 #ifdef BIND_4_COMPAT
diff --git a/libc/include/sys/glibc-syscalls.h b/libc/include/bits/glibc-syscalls.h
similarity index 100%
rename from libc/include/sys/glibc-syscalls.h
rename to libc/include/bits/glibc-syscalls.h
diff --git a/libc/include/bits/lockf.h b/libc/include/bits/lockf.h
index a0ba19d..655514d 100644
--- a/libc/include/bits/lockf.h
+++ b/libc/include/bits/lockf.h
@@ -42,9 +42,9 @@
 #if defined(__USE_FILE_OFFSET64)
 int lockf(int, int, off_t) __RENAME(lockf64);
 #else
-int lockf(int, int, off_t);
+int lockf(int, int, off_t) __INTRODUCED_IN(24);
 #endif
-int lockf64(int, int, off64_t);
+int lockf64(int, int, off64_t) __INTRODUCED_IN(24);
 
 __END_DECLS
 
diff --git a/libc/include/bits/strcasecmp.h b/libc/include/bits/strcasecmp.h
index 124f5cd..7cb713e 100644
--- a/libc/include/bits/strcasecmp.h
+++ b/libc/include/bits/strcasecmp.h
@@ -36,9 +36,9 @@
 __BEGIN_DECLS
 
 int strcasecmp(const char*, const char*) __purefunc;
-int strcasecmp_l(const char*, const char*, locale_t) __purefunc;
+int strcasecmp_l(const char*, const char*, locale_t) __purefunc __INTRODUCED_IN(23);
 int strncasecmp(const char*, const char*, size_t) __purefunc;
-int strncasecmp_l(const char*, const char*, size_t, locale_t) __purefunc;
+int strncasecmp_l(const char*, const char*, size_t, locale_t) __purefunc __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/bits/wctype.h b/libc/include/bits/wctype.h
index 8f32aba..fe7c80e 100644
--- a/libc/include/bits/wctype.h
+++ b/libc/include/bits/wctype.h
@@ -37,7 +37,7 @@
 
 int iswalnum(wint_t);
 int iswalpha(wint_t);
-int iswblank(wint_t);
+int iswblank(wint_t) __INTRODUCED_IN(21);
 int iswcntrl(wint_t);
 int iswdigit(wint_t);
 int iswgraph(wint_t);
@@ -56,8 +56,8 @@
 int iswctype(wint_t, wctype_t);
 
 typedef const void* wctrans_t;
-wint_t towctrans(wint_t, wctrans_t);
-wctrans_t wctrans(const char*);
+wint_t towctrans(wint_t, wctrans_t) __INTRODUCED_IN_FUTURE;
+wctrans_t wctrans(const char*) __INTRODUCED_IN_FUTURE;
 
 __END_DECLS
 
diff --git a/libc/include/complex.h b/libc/include/complex.h
index b54d2fc..66ea97e 100644
--- a/libc/include/complex.h
+++ b/libc/include/complex.h
@@ -60,101 +60,101 @@
 
 /* 7.3.5 Trigonometric functions */
 /* 7.3.5.1 The cacos functions */
-double complex cacos(double complex);
-float complex cacosf(float complex);
-long double complex cacosl(long double complex);
+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;
 /* 7.3.5.2 The casin functions */
-double complex casin(double complex);
-float complex casinf(float complex);
-long double complex casinl(long double complex);
+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;
 /* 7.3.5.1 The catan functions */
-double complex catan(double complex);
-float complex catanf(float complex);
-long double complex catanl(long double complex);
+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;
 /* 7.3.5.1 The ccos functions */
-double complex ccos(double complex);
-float complex ccosf(float complex);
-long double complex ccosl(long double complex);
+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;
 /* 7.3.5.1 The csin functions */
-double complex csin(double complex);
-float complex csinf(float complex);
-long double complex csinl(long double complex);
+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;
 /* 7.3.5.1 The ctan functions */
-double complex ctan(double complex);
-float complex ctanf(float complex);
-long double complex ctanl(long double complex);
+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;
 
 /* 7.3.6 Hyperbolic functions */
 /* 7.3.6.1 The cacosh functions */
-double complex cacosh(double complex);
-float complex cacoshf(float complex);
-long double complex cacoshl(long double complex);
+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;
 /* 7.3.6.2 The casinh functions */
-double complex casinh(double complex);
-float complex casinhf(float complex);
-long double complex casinhl(long double complex);
+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;
 /* 7.3.6.3 The catanh functions */
-double complex catanh(double complex);
-float complex catanhf(float complex);
-long double complex catanhl(long double complex);
+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;
 /* 7.3.6.4 The ccosh functions */
-double complex ccosh(double complex);
-float complex ccoshf(float complex);
-long double complex ccoshl(long double complex);
+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;
 /* 7.3.6.5 The csinh functions */
-double complex csinh(double complex);
-float complex csinhf(float complex);
-long double complex csinhl(long double complex);
+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;
 /* 7.3.6.6 The ctanh functions */
-double complex ctanh(double complex);
-float complex ctanhf(float complex);
-long double complex ctanhl(long double complex);
+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;
 
 /* 7.3.7 Exponential and logarithmic functions */
 /* 7.3.7.1 The cexp functions */
-double complex cexp(double complex);
-float complex cexpf(float complex);
-long double complex cexpl(long double complex);
+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;
 /* 7.3.7.2 The clog functions */
-double complex clog(double complex);
-float complex clogf(float complex);
-long double complex clogl(long double complex);
+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;
 
 /* 7.3.8 Power and absolute-value functions */
 /* 7.3.8.1 The cabs functions */
-double cabs(double complex);
-float cabsf(float complex);
-long double cabsl(long double complex);
+double cabs(double complex) __INTRODUCED_IN(23);
+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);
-float complex cpowf(float complex, float complex);
-long double complex cpowl(long double complex, long double complex);
+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;
 /* 7.3.8.3 The csqrt functions */
-double complex csqrt(double complex);
-float complex csqrtf(float complex);
-long double complex csqrtl(long double complex);
+double complex csqrt(double complex) __INTRODUCED_IN(23);
+float complex csqrtf(float complex) __INTRODUCED_IN(23);
+long double complex csqrtl(long double complex) __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(23);
 
 /* 7.3.9 Manipulation functions */
 /* 7.3.9.1 The carg functions */
-double carg(double complex);
-float cargf(float complex);
-long double cargl(long double complex);
+double carg(double complex) __INTRODUCED_IN(23);
+float cargf(float complex) __INTRODUCED_IN(23);
+long double cargl(long double complex) __INTRODUCED_IN(23);
 /* 7.3.9.2 The cimag functions */
-double cimag(double complex);
-float cimagf(float complex);
-long double cimagl(long double complex);
+double cimag(double complex) __INTRODUCED_IN(23);
+float cimagf(float complex) __INTRODUCED_IN(23);
+long double cimagl(long double complex) __INTRODUCED_IN(23);
 /* 7.3.9.3 The conj functions */
-double complex conj(double complex);
-float complex conjf(float complex);
-long double complex conjl(long double complex);
+double complex conj(double complex) __INTRODUCED_IN(23);
+float complex conjf(float complex) __INTRODUCED_IN(23);
+long double complex conjl(long double complex) __INTRODUCED_IN(23);
 /* 7.3.9.4 The cproj functions */
-double complex cproj(double complex);
-float complex cprojf(float complex);
-long double complex cprojl(long double complex);
+double complex cproj(double complex) __INTRODUCED_IN(23);
+float complex cprojf(float complex) __INTRODUCED_IN(23);
+long double complex cprojl(long double complex) __INTRODUCED_IN_32(21) __INTRODUCED_IN_64(23);
 /* 7.3.9.5 The creal functions */
-double creal(double complex);
-float crealf(float complex);
-long double creall(long double complex);
+double creal(double complex) __INTRODUCED_IN(23);
+float crealf(float complex) __INTRODUCED_IN(23);
+long double creall(long double complex) __INTRODUCED_IN(23);
 
 #pragma GCC visibility pop
 __END_DECLS
diff --git a/libc/include/ctype.h b/libc/include/ctype.h
index 83b5ba7..199f810 100644
--- a/libc/include/ctype.h
+++ b/libc/include/ctype.h
@@ -73,22 +73,20 @@
 int tolower(int);
 int toupper(int);
 
-#if __ANDROID_API__ >= 21
-int isalnum_l(int, locale_t);
-int isalpha_l(int, locale_t);
-int isblank_l(int, locale_t);
-int iscntrl_l(int, locale_t);
-int isdigit_l(int, locale_t);
-int isgraph_l(int, locale_t);
-int islower_l(int, locale_t);
-int isprint_l(int, locale_t);
-int ispunct_l(int, locale_t);
-int isspace_l(int, locale_t);
-int isupper_l(int, locale_t);
-int isxdigit_l(int, locale_t);
-int tolower_l(int, locale_t);
-int toupper_l(int, locale_t);
-#endif /* __ANDROID_API__ >= 21 */
+int isalnum_l(int, locale_t) __INTRODUCED_IN(21);
+int isalpha_l(int, locale_t) __INTRODUCED_IN(21);
+int isblank_l(int, locale_t) __INTRODUCED_IN(21);
+int iscntrl_l(int, locale_t) __INTRODUCED_IN(21);
+int isdigit_l(int, locale_t) __INTRODUCED_IN(21);
+int isgraph_l(int, locale_t) __INTRODUCED_IN(21);
+int islower_l(int, locale_t) __INTRODUCED_IN(21);
+int isprint_l(int, locale_t) __INTRODUCED_IN(21);
+int ispunct_l(int, locale_t) __INTRODUCED_IN(21);
+int isspace_l(int, locale_t) __INTRODUCED_IN(21);
+int isupper_l(int, locale_t) __INTRODUCED_IN(21);
+int isxdigit_l(int, locale_t) __INTRODUCED_IN(21);
+int tolower_l(int, locale_t) __INTRODUCED_IN(21);
+int toupper_l(int, locale_t) __INTRODUCED_IN(21);
 
 #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE > 200112 \
     || __XPG_VISIBLE > 600
@@ -98,8 +96,8 @@
 #if __BSD_VISIBLE || __XPG_VISIBLE
 int isascii(int);
 int toascii(int);
-int _tolower(int);
-int _toupper(int);
+int _tolower(int) __INTRODUCED_IN(21);
+int _toupper(int) __INTRODUCED_IN(21);
 #endif /* __BSD_VISIBLE || __XPG_VISIBLE */
 
 #endif /* __GNUC__ || _ANSI_LIBRARY || lint */
diff --git a/libc/include/dirent.h b/libc/include/dirent.h
index 3cdfa68..db8a520 100644
--- a/libc/include/dirent.h
+++ b/libc/include/dirent.h
@@ -71,22 +71,25 @@
 extern DIR* opendir(const char*);
 extern DIR* fdopendir(int);
 extern struct dirent* readdir(DIR*);
-extern struct dirent64* readdir64(DIR*);
+extern struct dirent64* readdir64(DIR*) __INTRODUCED_IN(21);
 extern int readdir_r(DIR*, struct dirent*, struct dirent**);
-extern int readdir64_r(DIR*, struct dirent64*, struct dirent64**);
+extern int readdir64_r(DIR*, struct dirent64*, struct dirent64**) __INTRODUCED_IN(21);
 extern int closedir(DIR*);
 extern void rewinddir(DIR*);
-extern void seekdir(DIR*, long);
-extern long telldir(DIR*);
+extern void seekdir(DIR*, long) __INTRODUCED_IN(23);
+extern long telldir(DIR*) __INTRODUCED_IN(23);
 extern int dirfd(DIR*);
 extern int alphasort(const struct dirent**, const struct dirent**);
-extern int alphasort64(const struct dirent64**, const struct dirent64**);
-extern int scandir64(const char*, struct dirent64***, int (*)(const struct dirent64*), int (*)(const struct dirent64**, const struct dirent64**));
+extern int alphasort64(const struct dirent64**, const struct dirent64**) __INTRODUCED_IN(21);
+extern int scandir64(const char*, struct dirent64***, int (*)(const struct dirent64*),
+                     int (*)(const struct dirent64**, const struct dirent64**)) __INTRODUCED_IN(21);
 extern int scandir(const char*, struct dirent***, int (*)(const struct dirent*), int (*)(const struct dirent**, const struct dirent**));
 
 #if defined(__USE_GNU)
-int scandirat64(int, const char*, struct dirent64***, int (*)(const struct dirent64*), int (*)(const struct dirent64**, const struct dirent64**));
-int scandirat(int, const char*, struct dirent***, int (*)(const struct dirent*), int (*)(const struct dirent**, const struct dirent**));
+int scandirat64(int, const char*, struct dirent64***, int (*)(const struct dirent64*),
+                int (*)(const struct dirent64**, const struct dirent64**)) __INTRODUCED_IN(24);
+int scandirat(int, const char*, struct dirent***, int (*)(const struct dirent*),
+              int (*)(const struct dirent**, const struct dirent**)) __INTRODUCED_IN(24);
 #endif
 
 __END_DECLS
diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h
index c2e8980..25a302f 100644
--- a/libc/include/dlfcn.h
+++ b/libc/include/dlfcn.h
@@ -47,7 +47,8 @@
 extern int dlclose(void*  handle);
 extern const char* dlerror(void);
 extern void* dlsym(void* handle, const char* symbol) __nonnull((2));
-extern void* dlvsym(void* handle, const char* symbol, const char* version) __nonnull((2, 3));
+extern void* dlvsym(void* handle, const char* symbol, const char* version) __nonnull((2, 3))
+  __INTRODUCED_IN(24);
 extern int dladdr(const void* addr, Dl_info *info);
 
 enum {
diff --git a/libc/include/error.h b/libc/include/error.h
index dd12884..205890f 100644
--- a/libc/include/error.h
+++ b/libc/include/error.h
@@ -33,12 +33,13 @@
 
 __BEGIN_DECLS
 
-void error(int, int, const char*, ...) __printflike(3, 4);
-void error_at_line(int, int, const char*, unsigned int, const char*, ...) __printflike(5, 6);
+void error(int, int, const char*, ...) __printflike(3, 4) __INTRODUCED_IN(23);
+void error_at_line(int, int, const char*, unsigned int, const char*, ...) __printflike(5, 6)
+  __INTRODUCED_IN(23);
 
-extern void (*error_print_progname)(void);
-extern unsigned int error_message_count;
-extern int error_one_per_line;
+extern void (*error_print_progname)(void) __INTRODUCED_IN(23);
+extern unsigned int error_message_count __INTRODUCED_IN(23);
+extern int error_one_per_line __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h
index 013d72c..c8030f1 100644
--- a/libc/include/fcntl.h
+++ b/libc/include/fcntl.h
@@ -64,36 +64,36 @@
 #define SYNC_FILE_RANGE_WAIT_AFTER 4
 
 extern int creat(const char*, mode_t);
-extern int creat64(const char*, mode_t);
+extern int creat64(const char*, mode_t) __INTRODUCED_IN(21);
 extern int openat(int, const char*, int, ...);
-extern int openat64(int, const char*, int, ...);
+extern int openat64(int, const char*, int, ...) __INTRODUCED_IN(21);
 extern int open(const char*, int, ...);
-extern int open64(const char*, int, ...);
-extern ssize_t splice(int, off64_t*, int, off64_t*, size_t, unsigned int);
-extern ssize_t tee(int, int, size_t, unsigned int);
-extern ssize_t vmsplice(int, const struct iovec*, size_t, unsigned int);
+extern int open64(const char*, int, ...) __INTRODUCED_IN(21);
+extern ssize_t splice(int, off64_t*, int, off64_t*, size_t, unsigned int) __INTRODUCED_IN(21);
+extern ssize_t tee(int, int, size_t, unsigned int) __INTRODUCED_IN(21);
+extern ssize_t vmsplice(int, const struct iovec*, size_t, unsigned int) __INTRODUCED_IN(21);
 
 #if defined(__USE_FILE_OFFSET64)
-extern int fallocate(int, int, off_t, off_t) __RENAME(fallocate64);
-extern int posix_fadvise(int, off_t, off_t, int) __RENAME(posix_fadvise64);
-extern int posix_fallocate(int, off_t, off_t) __RENAME(posix_fallocate);
+extern int fallocate(int, int, off_t, off_t) __RENAME(fallocate64) __INTRODUCED_IN(21);
+extern int posix_fadvise(int, off_t, off_t, int) __RENAME(posix_fadvise64) __INTRODUCED_IN(21);
+extern int posix_fallocate(int, off_t, off_t) __RENAME(posix_fallocate) __INTRODUCED_IN(21);
 #else
-extern int fallocate(int, int, off_t, off_t);
-extern int posix_fadvise(int, off_t, off_t, int);
-extern int posix_fallocate(int, off_t, off_t);
+extern int fallocate(int, int, off_t, off_t) __INTRODUCED_IN(21);
+extern int posix_fadvise(int, off_t, off_t, int) __INTRODUCED_IN(21);
+extern int posix_fallocate(int, off_t, off_t) __INTRODUCED_IN(21);
 #endif
-extern int fallocate64(int, int, off64_t, off64_t);
-extern int posix_fadvise64(int, off64_t, off64_t, int);
-extern int posix_fallocate64(int, off64_t, off64_t);
+extern int fallocate64(int, int, off64_t, off64_t) __INTRODUCED_IN(21);
+extern int posix_fadvise64(int, off64_t, off64_t, int) __INTRODUCED_IN(21);
+extern int posix_fallocate64(int, off64_t, off64_t) __INTRODUCED_IN(21);
 
 #if defined(__USE_GNU)
-ssize_t readahead(int, off64_t, size_t);
-int sync_file_range(int, off64_t, off64_t, unsigned int);
+ssize_t readahead(int, off64_t, size_t) __INTRODUCED_IN(21);
+int sync_file_range(int, off64_t, off64_t, unsigned int) __INTRODUCED_IN_FUTURE;
 #endif
 
-extern int __open_2(const char*, int);
+extern int __open_2(const char*, int) __INTRODUCED_IN(21);
 extern int __open_real(const char*, int, ...) __RENAME(open);
-extern int __openat_2(int, const char*, int);
+extern int __openat_2(int, const char*, int) __INTRODUCED_IN(21);
 extern int __openat_real(int, const char*, int, ...) __RENAME(openat);
 __errordecl(__creat_missing_mode, "called with O_CREAT, but missing mode");
 __errordecl(__creat_too_many_args, "too many arguments");
diff --git a/libc/include/fenv.h b/libc/include/fenv.h
index 73ecc80..e51f9b6 100644
--- a/libc/include/fenv.h
+++ b/libc/include/fenv.h
@@ -36,23 +36,23 @@
 __BEGIN_DECLS
 #pragma GCC visibility push(default)
 
-int feclearexcept(int);
-int fegetexceptflag(fexcept_t *, int);
-int feraiseexcept(int);
-int fesetexceptflag(const fexcept_t *, int);
-int fetestexcept(int);
+int feclearexcept(int) __INTRODUCED_IN(21);
+int fegetexceptflag(fexcept_t*, int) __INTRODUCED_IN(21);
+int feraiseexcept(int) __INTRODUCED_IN(21);
+int fesetexceptflag(const fexcept_t*, int) __INTRODUCED_IN(21);
+int fetestexcept(int) __INTRODUCED_IN(21);
 
-int fegetround(void);
-int fesetround(int);
+int fegetround(void) __INTRODUCED_IN(21);
+int fesetround(int) __INTRODUCED_IN(21);
 
-int fegetenv(fenv_t *);
-int feholdexcept(fenv_t *);
-int fesetenv(const fenv_t *);
-int feupdateenv(const fenv_t *);
+int fegetenv(fenv_t*) __INTRODUCED_IN(21);
+int feholdexcept(fenv_t*) __INTRODUCED_IN(21);
+int fesetenv(const fenv_t*) __INTRODUCED_IN(21);
+int feupdateenv(const fenv_t*) __INTRODUCED_IN(21);
 
-int feenableexcept(int);
-int fedisableexcept(int);
-int fegetexcept(void);
+int feenableexcept(int) __INTRODUCED_IN(21);
+int fedisableexcept(int) __INTRODUCED_IN(21);
+int fegetexcept(void) __INTRODUCED_IN(21);
 
 /*
  * The following constant represents the default floating-point environment
diff --git a/libc/include/ftw.h b/libc/include/ftw.h
index af524d0..ebd59f5 100644
--- a/libc/include/ftw.h
+++ b/libc/include/ftw.h
@@ -54,12 +54,12 @@
 };
 
 __BEGIN_DECLS
-int	ftw(const char *, int (*)(const char *, const struct stat *, int), int);
-int	nftw(const char *, int (*)(const char *, const struct stat *, int,
-	    struct FTW *), int, int);
-int	ftw64(const char *, int (*)(const char *, const struct stat64 *, int), int);
-int	nftw64(const char *, int (*)(const char *, const struct stat64 *, int,
-	    struct FTW *), int, int);
+int ftw(const char*, int (*)(const char*, const struct stat*, int), int) __INTRODUCED_IN(21);
+int nftw(const char*, int (*)(const char*, const struct stat*, int, struct FTW*), int, int)
+  __INTRODUCED_IN(21);
+int ftw64(const char*, int (*)(const char*, const struct stat64*, int), int) __INTRODUCED_IN(21);
+int nftw64(const char*, int (*)(const char*, const struct stat64*, int, struct FTW*), int, int)
+  __INTRODUCED_IN(21);
 __END_DECLS
 
 #endif	/* !_FTW_H */
diff --git a/libc/include/grp.h b/libc/include/grp.h
index 3ae0d6e..42cf223 100644
--- a/libc/include/grp.h
+++ b/libc/include/grp.h
@@ -55,11 +55,12 @@
 struct group* getgrnam(const char *);
 #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE
 /* Android has thousands and thousands of ids to iterate through */
-struct group* getgrent(void) __attribute__((warning("getgrent is inefficient on Android")));
-void setgrent(void);
-void endgrent(void);
-int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
-int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+struct group* getgrent(void)
+  __attribute__((warning("getgrent is inefficient on Android"))) __INTRODUCED_IN_FUTURE;
+void setgrent(void) __INTRODUCED_IN_FUTURE;
+void endgrent(void) __INTRODUCED_IN_FUTURE;
+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);
 #endif
 
 int getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups);
diff --git a/libc/include/ifaddrs.h b/libc/include/ifaddrs.h
index 54a5a2c..083b27a 100644
--- a/libc/include/ifaddrs.h
+++ b/libc/include/ifaddrs.h
@@ -51,8 +51,8 @@
 #define ifa_broadaddr ifa_ifu.ifu_broadaddr
 #define ifa_dstaddr ifa_ifu.ifu_dstaddr
 
-void freeifaddrs(struct ifaddrs*);
-int getifaddrs(struct ifaddrs**);
+void freeifaddrs(struct ifaddrs*) __INTRODUCED_IN(24);
+int getifaddrs(struct ifaddrs**) __INTRODUCED_IN(24);
 
 __END_DECLS
 
diff --git a/libc/include/inttypes.h b/libc/include/inttypes.h
index 8853c08..4752c52 100644
--- a/libc/include/inttypes.h
+++ b/libc/include/inttypes.h
@@ -254,14 +254,12 @@
 } imaxdiv_t;
 
 __BEGIN_DECLS
-intmax_t	imaxabs(intmax_t) __pure2;
-imaxdiv_t	imaxdiv(intmax_t, intmax_t) __pure2;
+intmax_t imaxabs(intmax_t) __pure2 __INTRODUCED_IN(21);
+imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2 __INTRODUCED_IN(21);
 intmax_t	strtoimax(const char *, char **, int);
 uintmax_t	strtoumax(const char *, char **, int);
-intmax_t	wcstoimax(const wchar_t * __restrict,
-		    wchar_t ** __restrict, int);
-uintmax_t	wcstoumax(const wchar_t * __restrict,
-		    wchar_t ** __restrict, int);
+intmax_t wcstoimax(const wchar_t* __restrict, wchar_t** __restrict, int) __INTRODUCED_IN(21);
+uintmax_t wcstoumax(const wchar_t* __restrict, wchar_t** __restrict, int) __INTRODUCED_IN(21);
 __END_DECLS
 
 #endif /* _INTTYPES_H_ */
diff --git a/libc/include/lastlog.h b/libc/include/lastlog.h
index e69de29..4f46106 100644
--- a/libc/include/lastlog.h
+++ b/libc/include/lastlog.h
@@ -0,0 +1,2 @@
+/* This is a BSD synonym for <utmp.h> that's also provided by glibc. */
+#include <utmp.h>
diff --git a/libc/include/limits.h b/libc/include/limits.h
index 342217b..01b7a49 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -52,10 +52,6 @@
 
 #include <sys/limits.h>
 
-#if __POSIX_VISIBLE
-#include <sys/syslimits.h>
-#endif
-
 /* GLibc compatibility definitions.
    Note that these are defined by GCC's <limits.h>
    only when __GNU_LIBRARY__ is defined, i.e. when
diff --git a/libc/include/link.h b/libc/include/link.h
index cb8e139..2d189f6 100644
--- a/libc/include/link.h
+++ b/libc/include/link.h
@@ -46,7 +46,11 @@
   ElfW(Half) dlpi_phnum;
 };
 
+#if defined(__arm__)
+int dl_iterate_phdr(int (*)(struct dl_phdr_info*, size_t, void*), void*) __INTRODUCED_IN(21);
+#else
 int dl_iterate_phdr(int (*)(struct dl_phdr_info*, size_t, void*), void*);
+#endif
 
 #ifdef __arm__
 typedef long unsigned int* _Unwind_Ptr;
diff --git a/libc/include/locale.h b/libc/include/locale.h
index 7fd8c2c..daef18f 100644
--- a/libc/include/locale.h
+++ b/libc/include/locale.h
@@ -92,13 +92,13 @@
     char  int_n_sign_posn;
 };
 
-struct lconv* localeconv(void);
+struct lconv* localeconv(void) __INTRODUCED_IN(21);
 
-locale_t duplocale(locale_t);
-void freelocale(locale_t);
-locale_t newlocale(int, const char*, locale_t);
+locale_t duplocale(locale_t) __INTRODUCED_IN(21);
+void freelocale(locale_t) __INTRODUCED_IN(21);
+locale_t newlocale(int, const char*, locale_t) __INTRODUCED_IN(21);
 char* setlocale(int, const char*);
-locale_t uselocale(locale_t);
+locale_t uselocale(locale_t) __INTRODUCED_IN(21);
 
 #define LC_GLOBAL_LOCALE ((locale_t) -1L)
 
diff --git a/libc/include/machine/endian.h b/libc/include/machine/endian.h
deleted file mode 100644
index ac89519..0000000
--- a/libc/include/machine/endian.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-#ifndef _MACHINE_ENDIAN_H_
-#define _MACHINE_ENDIAN_H_
-
-/* This file is for BSD source compatibility only. Use <endian.h> or <sys/endian.h> instead. */
-#include <sys/endian.h>
-
-#endif /* _MACHINE_ENDIAN_H_ */
diff --git a/libc/include/malloc.h b/libc/include/malloc.h
index 87555a9..02e2da7 100644
--- a/libc/include/malloc.h
+++ b/libc/include/malloc.h
@@ -29,7 +29,7 @@
 extern void free(void* p);
 
 extern void* memalign(size_t alignment, size_t byte_count) __mallocfunc __wur __attribute__((alloc_size(2)));
-extern size_t malloc_usable_size(const void* p);
+extern size_t malloc_usable_size(const void* p) __INTRODUCED_IN(21);
 
 #ifndef STRUCT_MALLINFO_DECLARED
 #define STRUCT_MALLINFO_DECLARED 1
@@ -68,7 +68,7 @@
  *   <!-- more heaps -->
  * </malloc>
  */
-extern int malloc_info(int, FILE *);
+extern int malloc_info(int, FILE*) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/math.h b/libc/include/math.h
index 203968a..97539d7 100644
--- a/libc/include/math.h
+++ b/libc/include/math.h
@@ -127,6 +127,13 @@
 #endif
 #endif /* __BSD_VISIBLE */
 
+/* scalbln, scalbnf, and scalblnl were unavailable on x86 until API level 18 */
+#if defined(__i386__)
+#define __INTRODUCED_IN_X86 __INTRODUCED_IN
+#else
+#define __INTRODUCED_IN_X86(x)
+#endif
+
 /*
  * Most of these functions depend on the rounding mode and have the side
  * effect of raising floating-point exceptions, so they are not declared
@@ -144,7 +151,7 @@
 int	__isfinitel(long double) __pure2;
 int	__isinff(float) __pure2;
 int	__isinfl(long double) __pure2;
-int	__isnanf(float) __pure2;
+int __isnanf(float) __pure2 __INTRODUCED_IN(21);
 int	__isnanl(long double) __pure2;
 int	__isnormalf(float) __pure2;
 int	__isnormal(double) __pure2;
@@ -195,17 +202,17 @@
 double	fma(double, double, double);
 double	hypot(double, double);
 int	ilogb(double) __pure2;
-int	(isinf)(double) __pure2;
+int(isinf)(double) __pure2 __INTRODUCED_IN(21);
 int	(isnan)(double) __pure2;
 double	lgamma(double);
 long long llrint(double);
 long long llround(double);
 double	log1p(double);
-double	log2(double);
+double log2(double) __INTRODUCED_IN(18);
 double	logb(double);
 long	lrint(double);
 long	lround(double);
-double	nan(const char *) __pure2;
+double nan(const char*) __pure2 __INTRODUCED_IN(13);
 double	nextafter(double, double);
 double	remainder(double, double);
 double	remquo(double, double, int *);
@@ -237,7 +244,7 @@
 double	nearbyint(double);
 double	round(double);
 double	scalbln(double, long);
-double	scalbn(double, int);
+double scalbn(double, int) __INTRODUCED_IN_X86(18);
 double	tgamma(double);
 double	trunc(double);
 #endif
@@ -249,7 +256,7 @@
 double	drem(double, double);
 int	finite(double) __pure2;
 int	isnanf(float) __pure2;
-long double significandl(long double);
+long double significandl(long double) __INTRODUCED_IN(21);
 
 /*
  * Reentrant version of gamma & lgamma; passes signgam back by reference
@@ -286,7 +293,7 @@
 float	ldexpf(float, int);
 float	log10f(float);
 float	log1pf(float);
-float	log2f(float);
+float log2f(float) __INTRODUCED_IN(18);
 float	logf(float);
 float	modff(float, float *);	/* fundamentally !__pure2 */
 
@@ -303,7 +310,7 @@
 float	erfcf(float);
 float	hypotf(float, float);
 float	lgammaf(float);
-float	tgammaf(float);
+float tgammaf(float) __INTRODUCED_IN(13);
 
 float	acoshf(float);
 float	asinhf(float);
@@ -315,14 +322,14 @@
 long long llroundf(float);
 long	lrintf(float);
 long	lroundf(float);
-float	nanf(const char *) __pure2;
+float nanf(const char*) __pure2 __INTRODUCED_IN(13);
 float	nearbyintf(float);
 float	nextafterf(float, float);
 float	remainderf(float, float);
 float	remquof(float, float, int *);
 float	rintf(float);
 float	scalblnf(float, long);
-float	scalbnf(float, int);
+float scalbnf(float, int) __INTRODUCED_IN_X86(18);
 float	truncf(float);
 
 float	fdimf(float, float);
@@ -364,69 +371,69 @@
  * long double versions of ISO/POSIX math functions
  */
 #if __ISO_C_VISIBLE >= 1999
-long double	acoshl(long double);
-long double	acosl(long double);
-long double	asinhl(long double);
-long double	asinl(long double);
-long double	atan2l(long double, long double);
-long double	atanhl(long double);
-long double	atanl(long double);
-long double	cbrtl(long double);
+long double acoshl(long double) __INTRODUCED_IN(21);
+long double acosl(long double) __INTRODUCED_IN(21);
+long double asinhl(long double) __INTRODUCED_IN(21);
+long double asinl(long double) __INTRODUCED_IN(21);
+long double atan2l(long double, long double) __INTRODUCED_IN(21);
+long double atanhl(long double) __INTRODUCED_IN(21);
+long double atanl(long double) __INTRODUCED_IN(21);
+long double cbrtl(long double) __INTRODUCED_IN(21);
 long double	ceill(long double);
 long double	copysignl(long double, long double) __pure2;
-long double	coshl(long double);
-long double	cosl(long double);
-long double	erfcl(long double);
-long double	erfl(long double);
-long double	exp2l(long double);
-long double	expl(long double);
-long double	expm1l(long double);
+long double coshl(long double) __INTRODUCED_IN(21);
+long double cosl(long double) __INTRODUCED_IN(21);
+long double erfcl(long double) __INTRODUCED_IN(21);
+long double erfl(long double) __INTRODUCED_IN(21);
+long double exp2l(long double) __INTRODUCED_IN(21);
+long double expl(long double) __INTRODUCED_IN(21);
+long double expm1l(long double) __INTRODUCED_IN(21);
 long double	fabsl(long double) __pure2;
 long double	fdiml(long double, long double);
 long double	floorl(long double);
-long double	fmal(long double, long double, long double);
+long double fmal(long double, long double, long double) __INTRODUCED_IN(21);
 long double	fmaxl(long double, long double) __pure2;
 long double	fminl(long double, long double) __pure2;
-long double	fmodl(long double, long double);
-long double	frexpl(long double value, int *); /* fundamentally !__pure2 */
-long double	hypotl(long double, long double);
+long double fmodl(long double, long double) __INTRODUCED_IN(21);
+long double frexpl(long double value, int*) __INTRODUCED_IN(21); /* fundamentally !__pure2 */
+long double hypotl(long double, long double) __INTRODUCED_IN(21);
 int		ilogbl(long double) __pure2;
 long double	ldexpl(long double, int);
-long double	lgammal(long double);
-long long	llrintl(long double);
+long double lgammal(long double) __INTRODUCED_IN(21);
+long long llrintl(long double) __INTRODUCED_IN(21);
 long long	llroundl(long double);
-long double	log10l(long double);
-long double	log1pl(long double);
-long double	log2l(long double);
-long double	logbl(long double);
-long double	logl(long double);
-long		lrintl(long double);
+long double log10l(long double) __INTRODUCED_IN(21);
+long double log1pl(long double) __INTRODUCED_IN(21);
+long double log2l(long double) __INTRODUCED_IN(18);
+long double logbl(long double) __INTRODUCED_IN(18);
+long double logl(long double) __INTRODUCED_IN(21);
+long lrintl(long double) __INTRODUCED_IN(21);
 long		lroundl(long double);
-long double	modfl(long double, long double *); /* fundamentally !__pure2 */
-long double	nanl(const char *) __pure2;
-long double	nearbyintl(long double);
-long double	nextafterl(long double, long double);
-double		nexttoward(double, long double);
+long double modfl(long double, long double*) __INTRODUCED_IN(21); /* fundamentally !__pure2 */
+long double nanl(const char*) __pure2 __INTRODUCED_IN(13);
+long double nearbyintl(long double) __INTRODUCED_IN(21);
+long double nextafterl(long double, long double) __INTRODUCED_IN(21);
+double nexttoward(double, long double) __INTRODUCED_IN(18);
 float		nexttowardf(float, long double);
-long double	nexttowardl(long double, long double);
-long double	powl(long double, long double);
-long double	remainderl(long double, long double);
-long double	remquol(long double, long double, int *);
-long double	rintl(long double);
+long double nexttowardl(long double, long double) __INTRODUCED_IN(18);
+long double powl(long double, long double) __INTRODUCED_IN(21);
+long double remainderl(long double, long double) __INTRODUCED_IN(21);
+long double remquol(long double, long double, int*) __INTRODUCED_IN(21);
+long double rintl(long double) __INTRODUCED_IN(21);
 long double	roundl(long double);
 long double	scalblnl(long double, long);
-long double	scalbnl(long double, int);
-long double	sinhl(long double);
-long double	sinl(long double);
-long double	sqrtl(long double);
-long double	tanhl(long double);
-long double	tanl(long double);
-long double	tgammal(long double);
+long double scalbnl(long double, int) __INTRODUCED_IN_X86(18);
+long double sinhl(long double) __INTRODUCED_IN(21);
+long double sinl(long double) __INTRODUCED_IN(21);
+long double sqrtl(long double) __INTRODUCED_IN(21);
+long double tanhl(long double) __INTRODUCED_IN(21);
+long double tanl(long double) __INTRODUCED_IN(21);
+long double tgammal(long double) __INTRODUCED_IN(21);
 long double	truncl(long double);
 #endif /* __ISO_C_VISIBLE >= 1999 */
 
 #if __BSD_VISIBLE
-long double	lgammal_r(long double, int *);
+long double lgammal_r(long double, int*) __INTRODUCED_IN(23);
 #endif
 
 #if defined(__USE_GNU)
diff --git a/libc/include/mntent.h b/libc/include/mntent.h
index ab40079..ad9d72f 100644
--- a/libc/include/mntent.h
+++ b/libc/include/mntent.h
@@ -57,11 +57,11 @@
 
 __BEGIN_DECLS
 
-int endmntent(FILE*);
+int endmntent(FILE*) __INTRODUCED_IN(21);
 struct mntent* getmntent(FILE*);
-struct mntent* getmntent_r(FILE*, struct mntent*, char*, int);
-FILE* setmntent(const char*, const char*);
-char* hasmntopt(const struct mntent*, const char*);
+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;
 
 __END_DECLS
 
diff --git a/libc/include/net/if.h b/libc/include/net/if.h
index aa4c19e..eac7699 100644
--- a/libc/include/net/if.h
+++ b/libc/include/net/if.h
@@ -46,8 +46,8 @@
 
 char* if_indextoname(unsigned, char*);
 unsigned if_nametoindex(const char*);
-struct if_nameindex* if_nameindex(void);
-void if_freenameindex(struct if_nameindex*);
+struct if_nameindex* if_nameindex(void) __INTRODUCED_IN(24);
+void if_freenameindex(struct if_nameindex*) __INTRODUCED_IN(24);
 
 __END_DECLS
 
diff --git a/libc/include/net/if_ether.h b/libc/include/net/if_ether.h
index 6da96e4..06cceb1 100644
--- a/libc/include/net/if_ether.h
+++ b/libc/include/net/if_ether.h
@@ -205,8 +205,8 @@
  */
 #include <sys/cdefs.h>
 __BEGIN_DECLS
-char* ether_ntoa __P((const struct ether_addr*));
-struct ether_addr* ether_aton __P((const char*));
+char* ether_ntoa __P((const struct ether_addr*)) __INTRODUCED_IN(21);
+struct ether_addr* ether_aton __P((const char*)) __INTRODUCED_IN(21);
 __END_DECLS
 #endif
 
diff --git a/libc/include/net/if_ieee1394.h b/libc/include/net/if_ieee1394.h
deleted file mode 100644
index 2f8a7c3..0000000
--- a/libc/include/net/if_ieee1394.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*	$NetBSD: if_ieee1394.h,v 1.6 2005/12/10 23:21:38 elad Exp $	*/
-
-/*
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Atsushi Onoe.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the NetBSD
- *	Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
- */
-
-#ifndef _NET_IF_IEEE1394_H_
-#define _NET_IF_IEEE1394_H_
-
-#include <sys/types.h>
-
-/* hardware address information for arp / nd */
-struct ieee1394_hwaddr {
-	u_int8_t	iha_uid[8];		/* node unique ID */
-	u_int8_t	iha_maxrec;		/* max_rec in the config ROM */
-	u_int8_t	iha_speed;		/* min of link/PHY speed */
-	u_int8_t	iha_offset[6];		/* unicast FIFO address */
-};
-
-/*
- * BPF wants to see one of these.
- */
-struct ieee1394_bpfhdr {
-	uint8_t		ibh_dhost[8];
-	uint8_t		ibh_shost[8];
-	uint16_t	ibh_type;
-};
-
-#ifdef _KERNEL
-
-/* pseudo header */
-struct ieee1394_header {
-	u_int8_t	ih_uid[8];		/* dst/src uid */
-	u_int8_t	ih_maxrec;		/* dst maxrec for tx */
-	u_int8_t	ih_speed;		/* speed */
-	u_int8_t	ih_offset[6];		/* dst offset */
-};
-
-/* unfragment encapsulation header */
-struct ieee1394_unfraghdr {
-	u_int16_t	iuh_ft;			/* fragment type == 0 */
-	u_int16_t	iuh_etype;		/* ether_type */
-};
-
-/* fragmented encapsulation header */
-struct ieee1394_fraghdr {
-	u_int16_t	ifh_ft_size;		/* fragment type, data size-1 */
-	u_int16_t	ifh_etype_off;		/* etype for first fragment */
-						/* offset for subseq frag */
-	u_int16_t	ifh_dgl;		/* datagram label */
-	u_int16_t	ifh_reserved;
-};
-
-#define	IEEE1394_FT_SUBSEQ	0x8000
-#define	IEEE1394_FT_MORE	0x4000
-
-#define	IEEE1394MTU		1500
-
-#define	IEEE1394_GASP_LEN	8		/* GASP header for Stream */
-#define	IEEE1394_ADDR_LEN	8
-#define	IEEE1394_CRC_LEN	4
-
-struct ieee1394_reass_pkt {
-	LIST_ENTRY(ieee1394_reass_pkt) rp_next;
-	struct mbuf	*rp_m;
-	u_int16_t	rp_size;
-	u_int16_t	rp_etype;
-	u_int16_t	rp_off;
-	u_int16_t	rp_dgl;
-	u_int16_t	rp_len;
-	u_int16_t	rp_ttl;
-};
-
-struct ieee1394_reassq {
-	LIST_ENTRY(ieee1394_reassq) rq_node;
-	LIST_HEAD(, ieee1394_reass_pkt) rq_pkt;
-	u_int32_t	fr_id;
-};
-
-struct ieee1394com {
-	struct ifnet	fc_if;
-	struct ieee1394_hwaddr ic_hwaddr;
-	u_int16_t	ic_dgl;
-	LIST_HEAD(, ieee1394_reassq) ic_reassq;
-};
-
-const char *ieee1394_sprintf(const u_int8_t *);
-void ieee1394_input(struct ifnet *, struct mbuf *, u_int16_t);
-void ieee1394_ifattach(struct ifnet *, const struct ieee1394_hwaddr *);
-void ieee1394_ifdetach(struct ifnet *);
-int  ieee1394_ioctl(struct ifnet *, u_long, caddr_t);
-struct mbuf * ieee1394_fragment(struct ifnet *, struct mbuf *, int, u_int16_t);
-void ieee1394_drain(struct ifnet *);
-void ieee1394_watchdog(struct ifnet *);
-#endif /* _KERNEL */
-
-#endif /* !_NET_IF_IEEE1394_H_ */
diff --git a/libc/include/netdb.h b/libc/include/netdb.h
index 339bac2..6bcfdcd 100644
--- a/libc/include/netdb.h
+++ b/libc/include/netdb.h
@@ -202,11 +202,12 @@
 void endservent(void);
 struct hostent* gethostbyaddr(const void*, socklen_t, int);
 int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**,
-                    int*);
+                    int*) __INTRODUCED_IN(23);
 struct hostent* gethostbyname(const char*);
 int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);
 struct hostent* gethostbyname2(const char*, int);
-int gethostbyname2_r(const char*, int, struct hostent*, char*, size_t, struct hostent**, int*);
+int gethostbyname2_r(const char*, int, struct hostent*, char*, size_t, struct hostent**, int*)
+  __INTRODUCED_IN(23);
 struct hostent* gethostent(void);
 struct netent* getnetbyaddr(uint32_t, int);
 struct netent* getnetbyname(const char*);
diff --git a/libc/include/netinet/in.h b/libc/include/netinet/in.h
index 5f3d11f..b524b05 100644
--- a/libc/include/netinet/in.h
+++ b/libc/include/netinet/in.h
@@ -49,8 +49,8 @@
 
 int bindresvport(int, struct sockaddr_in*);
 
-extern const struct in6_addr in6addr_any;
-extern const struct in6_addr in6addr_loopback;
+extern const struct in6_addr in6addr_any __INTRODUCED_IN(24);
+extern const struct in6_addr in6addr_loopback __INTRODUCED_IN(24);
 
 __END_DECLS
 
diff --git a/libc/include/nl_types.h b/libc/include/nl_types.h
index 84227bd..bcaab06 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);
-char* catgets(nl_catd, int, int, const char*);
-int catclose(nl_catd);
+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;
 
 __END_DECLS
 
diff --git a/libc/include/poll.h b/libc/include/poll.h
index 7c16d81..d75c2d0 100644
--- a/libc/include/poll.h
+++ b/libc/include/poll.h
@@ -39,14 +39,16 @@
 typedef unsigned int nfds_t;
 
 int poll(struct pollfd*, nfds_t, int);
-int ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*);
+int ppoll(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*) __INTRODUCED_IN(21);
 
-int __poll_chk(struct pollfd*, nfds_t, int, size_t);
+int __poll_chk(struct pollfd*, nfds_t, int, size_t) __INTRODUCED_IN(23);
 int __poll_real(struct pollfd*, nfds_t, int) __RENAME(poll);
 __errordecl(__poll_too_small_error, "poll: pollfd array smaller than fd count");
 
-int __ppoll_chk(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*, size_t);
-int __ppoll_real(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*) __RENAME(ppoll);
+int __ppoll_chk(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*, size_t)
+  __INTRODUCED_IN(23);
+int __ppoll_real(struct pollfd*, nfds_t, const struct timespec*, const sigset_t*) __RENAME(ppoll)
+  __INTRODUCED_IN(21);
 __errordecl(__ppoll_too_small_error, "ppoll: pollfd array smaller than fd count");
 
 #if defined(__BIONIC_FORTIFY)
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index a0fcc88..2df9b74 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -133,7 +133,7 @@
 
 __BEGIN_DECLS
 
-int pthread_atfork(void (*)(void), void (*)(void), void(*)(void));
+int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)) __INTRODUCED_IN(21);
 
 int pthread_attr_destroy(pthread_attr_t*) __nonnull((1));
 int pthread_attr_getdetachstate(const pthread_attr_t*, int*) __nonnull((1, 2));
@@ -153,10 +153,11 @@
 int pthread_attr_setstacksize(pthread_attr_t*, size_t) __nonnull((1));
 
 int pthread_condattr_destroy(pthread_condattr_t*) __nonnull((1));
-int pthread_condattr_getclock(const pthread_condattr_t*, clockid_t*) __nonnull((1, 2));
+int pthread_condattr_getclock(const pthread_condattr_t*, clockid_t*) __nonnull((1, 2))
+  __INTRODUCED_IN(21);
 int pthread_condattr_getpshared(const pthread_condattr_t*, int*) __nonnull((1, 2));
 int pthread_condattr_init(pthread_condattr_t*) __nonnull((1));
-int pthread_condattr_setclock(pthread_condattr_t*, clockid_t) __nonnull((1));
+int pthread_condattr_setclock(pthread_condattr_t*, clockid_t) __nonnull((1)) __INTRODUCED_IN(21);
 int pthread_condattr_setpshared(pthread_condattr_t*, int) __nonnull((1));
 
 int pthread_cond_broadcast(pthread_cond_t*) __nonnull((1));
@@ -180,7 +181,7 @@
 
 void* pthread_getspecific(pthread_key_t);
 
-pid_t pthread_gettid_np(pthread_t);
+pid_t pthread_gettid_np(pthread_t) __INTRODUCED_IN(21);
 
 int pthread_join(pthread_t, void**);
 
@@ -201,7 +202,8 @@
 #else
 int pthread_mutex_lock(pthread_mutex_t*) __nonnull((1));
 #endif
-int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec*) __nonnull((1, 2));
+int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec*) __nonnull((1, 2))
+  __INTRODUCED_IN(21);
 int pthread_mutex_trylock(pthread_mutex_t*) __nonnull((1));
 #if !defined(__LP4__)
 int pthread_mutex_unlock(pthread_mutex_t*) /* __nonnull((1)) */;
@@ -215,8 +217,9 @@
 int pthread_rwlockattr_destroy(pthread_rwlockattr_t*) __nonnull((1));
 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t*, int*) __nonnull((1, 2));
 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int) __nonnull((1));
-int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t*, int*) __nonnull((1, 2));
-int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t*, int) __nonnull((1));
+int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t*, int*) __nonnull((1, 2))
+  __INTRODUCED_IN(23);
+int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t*, int) __nonnull((1)) __INTRODUCED_IN(23);
 
 int pthread_rwlock_destroy(pthread_rwlock_t*) __nonnull((1));
 int pthread_rwlock_init(pthread_rwlock_t*, const pthread_rwlockattr_t*) __nonnull((1));
@@ -228,25 +231,28 @@
 int pthread_rwlock_unlock(pthread_rwlock_t *) __nonnull((1));
 int pthread_rwlock_wrlock(pthread_rwlock_t*) __nonnull((1));
 
-int pthread_barrierattr_init(pthread_barrierattr_t* attr) __nonnull((1));
-int pthread_barrierattr_destroy(pthread_barrierattr_t* attr) __nonnull((1));
-int pthread_barrierattr_getpshared(pthread_barrierattr_t* attr, int* pshared) __nonnull((1, 2));
-int pthread_barrierattr_setpshared(pthread_barrierattr_t* attr, int pshared) __nonnull((1));
+int pthread_barrierattr_init(pthread_barrierattr_t* attr) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_barrierattr_destroy(pthread_barrierattr_t* attr) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_barrierattr_getpshared(pthread_barrierattr_t* attr, int* pshared) __nonnull((1, 2))
+  __INTRODUCED_IN(24);
+int pthread_barrierattr_setpshared(pthread_barrierattr_t* attr, int pshared) __nonnull((1))
+  __INTRODUCED_IN(24);
 
-int pthread_barrier_init(pthread_barrier_t*, const pthread_barrierattr_t*, unsigned) __nonnull((1));
-int pthread_barrier_destroy(pthread_barrier_t*) __nonnull((1));
-int pthread_barrier_wait(pthread_barrier_t*) __nonnull((1));
+int pthread_barrier_init(pthread_barrier_t*, const pthread_barrierattr_t*, unsigned) __nonnull((1))
+  __INTRODUCED_IN(24);
+int pthread_barrier_destroy(pthread_barrier_t*) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_barrier_wait(pthread_barrier_t*) __nonnull((1)) __INTRODUCED_IN(24);
 
-int pthread_spin_destroy(pthread_spinlock_t*) __nonnull((1));
-int pthread_spin_init(pthread_spinlock_t*, int) __nonnull((1));
-int pthread_spin_lock(pthread_spinlock_t*) __nonnull((1));
-int pthread_spin_trylock(pthread_spinlock_t*) __nonnull((1));
-int pthread_spin_unlock(pthread_spinlock_t*) __nonnull((1));
+int pthread_spin_destroy(pthread_spinlock_t*) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_spin_init(pthread_spinlock_t*, int) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_spin_lock(pthread_spinlock_t*) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_spin_trylock(pthread_spinlock_t*) __nonnull((1)) __INTRODUCED_IN(24);
+int pthread_spin_unlock(pthread_spinlock_t*) __nonnull((1)) __INTRODUCED_IN(24);
 
 pthread_t pthread_self(void) __pure2;
 
 #if defined(__USE_GNU)
-int pthread_getname_np(pthread_t, char*, size_t) __nonnull((2));
+int pthread_getname_np(pthread_t, char*, size_t) __nonnull((2)) __INTRODUCED_IN_FUTURE;
 #endif
 /* TODO: this should be __USE_GNU too. */
 int pthread_setname_np(pthread_t, const char*) __nonnull((2));
diff --git a/libc/include/pty.h b/libc/include/pty.h
index bca1137..ec257a5 100644
--- a/libc/include/pty.h
+++ b/libc/include/pty.h
@@ -36,8 +36,8 @@
 
 __BEGIN_DECLS
 
-int openpty(int*, int*, char*, const struct termios*, const struct winsize*);
-int forkpty(int*, char*, const struct termios*, const struct winsize*);
+int openpty(int*, int*, char*, const struct termios*, const struct winsize*) __INTRODUCED_IN(23);
+int forkpty(int*, char*, const struct termios*, const struct winsize*) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/pwd.h b/libc/include/pwd.h
index e32825e..96a1cd4 100644
--- a/libc/include/pwd.h
+++ b/libc/include/pwd.h
@@ -119,12 +119,13 @@
 struct passwd* getpwnam(const char*);
 struct passwd* getpwuid(uid_t);
 /* Android has thousands and thousands of ids to iterate through */
-struct passwd* getpwent(void) __attribute__((warning("getpwent is inefficient on Android")));
-void setpwent(void);
-void endpwent(void);
+struct passwd* getpwent(void)
+  __attribute__((warning("getpwent is inefficient on Android"))) __INTRODUCED_IN_FUTURE;
+void setpwent(void) __INTRODUCED_IN_FUTURE;
+void endpwent(void) __INTRODUCED_IN_FUTURE;
 
-int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);
-int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);
+int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**) __INTRODUCED_IN(21);
+int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sched.h b/libc/include/sched.h
index 0b9235b..a1f1dfa 100644
--- a/libc/include/sched.h
+++ b/libc/include/sched.h
@@ -53,9 +53,9 @@
 #if defined(__USE_GNU)
 
 extern int clone(int (*)(void*), void*, int, void*, ...);
-extern int unshare(int);
-extern int sched_getcpu(void);
-extern int setns(int, int);
+extern int unshare(int) __INTRODUCED_IN(21);
+extern int sched_getcpu(void) __INTRODUCED_IN(21);
+extern int setns(int, int) __INTRODUCED_IN(21);
 
 #ifdef __LP64__
 #define CPU_SETSIZE 1024
@@ -72,9 +72,9 @@
   __CPU_BITTYPE  __bits[ CPU_SETSIZE / __CPU_BITS ];
 } cpu_set_t;
 
-extern int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set);
+extern int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) __INTRODUCED_IN(21);
 
-extern int sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set);
+extern int sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) __INTRODUCED_IN(21);
 
 #define CPU_ZERO(set)          CPU_ZERO_S(sizeof(cpu_set_t), set)
 #define CPU_SET(cpu, set)      CPU_SET_S(cpu, sizeof(cpu_set_t), set)
@@ -97,8 +97,8 @@
 #define CPU_ALLOC(count)  __sched_cpualloc((count))
 #define CPU_FREE(set)     __sched_cpufree((set))
 
-extern cpu_set_t* __sched_cpualloc(size_t count);
-extern void       __sched_cpufree(cpu_set_t* set);
+extern cpu_set_t* __sched_cpualloc(size_t count) __INTRODUCED_IN(21);
+extern void __sched_cpufree(cpu_set_t* set) __INTRODUCED_IN(21);
 
 #define CPU_ZERO_S(setsize, set)  __builtin_memset(set, 0, setsize)
 
@@ -142,7 +142,7 @@
 
 #define CPU_COUNT_S(setsize, set)  __sched_cpucount((setsize), (set))
 
-extern int __sched_cpucount(size_t setsize, cpu_set_t* set);
+extern int __sched_cpucount(size_t setsize, cpu_set_t* set) __INTRODUCED_IN(21);
 
 #endif /* __USE_GNU */
 
diff --git a/libc/include/search.h b/libc/include/search.h
index 9b01e12..1ac6d21 100644
--- a/libc/include/search.h
+++ b/libc/include/search.h
@@ -29,17 +29,20 @@
 
 __BEGIN_DECLS
 
-void insque(void*, void*);
-void remque(void*);
+void insque(void*, void*) __INTRODUCED_IN(21);
+void remque(void*) __INTRODUCED_IN(21);
 
-void* lfind(const void*, const void*, size_t*, size_t, int (*)(const void*, const void*));
-void* lsearch(const void*, void*, size_t*, size_t, int (*)(const void*, const void*));
+void* lfind(const void*, const void*, size_t*, size_t, int (*)(const void*, const void*))
+  __INTRODUCED_IN(21);
+void* lsearch(const void*, void*, size_t*, size_t, int (*)(const void*, const void*))
+  __INTRODUCED_IN(21);
 
-void* tdelete(const void* __restrict, void** __restrict, int (*)(const void*, const void*));
-void tdestroy(void*, void (*)(void*));
-void* tfind(const void*, void* const*, int (*)(const void*, const void*));
-void* tsearch(const void*, void**, int (*)(const void*, const void*));
-void twalk(const void*, void (*)(const void*, VISIT, int));
+void* tdelete(const void* __restrict, void** __restrict, int (*)(const void*, const void*))
+  __INTRODUCED_IN(21);
+void tdestroy(void*, void (*)(void*)) __INTRODUCED_IN(21);
+void* tfind(const void*, void* const*, int (*)(const void*, const void*)) __INTRODUCED_IN(21);
+void* tsearch(const void*, void**, int (*)(const void*, const void*)) __INTRODUCED_IN(21);
+void twalk(const void*, void (*)(const void*, VISIT, int)) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/signal.h b/libc/include/signal.h
index 5679402..4b5e4ac 100644
--- a/libc/include/signal.h
+++ b/libc/include/signal.h
@@ -72,8 +72,8 @@
 /* We take a few real-time signals for ourselves. May as well use the same names as glibc. */
 #define SIGRTMIN (__libc_current_sigrtmin())
 #define SIGRTMAX (__libc_current_sigrtmax())
-extern int __libc_current_sigrtmin(void);
-extern int __libc_current_sigrtmax(void);
+extern int __libc_current_sigrtmin(void) __INTRODUCED_IN(21);
+extern int __libc_current_sigrtmax(void) __INTRODUCED_IN(21);
 
 extern const char* const sys_siglist[];
 extern const char* const sys_signame[]; /* BSD compatibility. */
@@ -125,11 +125,18 @@
 extern int sigsuspend(const sigset_t*) __nonnull((1));
 extern int sigwait(const sigset_t*, int*) __nonnull((1, 2));
 
-extern int sighold(int) __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")));
-extern int sigignore(int) __attribute__((deprecated("use sigaction() instead")));
-extern int sigpause(int) __attribute__((deprecated("use sigsuspend() instead")));
-extern int sigrelse(int) __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")));
-extern sighandler_t sigset(int, sighandler_t) __attribute__((deprecated("use sigaction() instead")));
+extern int sighold(int)
+  __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
+  __INTRODUCED_IN_FUTURE;
+extern int sigignore(int)
+  __attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN_FUTURE;
+extern int sigpause(int)
+  __attribute__((deprecated("use sigsuspend() instead"))) __INTRODUCED_IN_FUTURE;
+extern int sigrelse(int)
+  __attribute__((deprecated("use sigprocmask() or pthread_sigmask() instead")))
+  __INTRODUCED_IN_FUTURE;
+extern sighandler_t sigset(int, sighandler_t)
+  __attribute__((deprecated("use sigaction() instead"))) __INTRODUCED_IN_FUTURE;
 
 extern int raise(int);
 extern int kill(pid_t, int);
@@ -137,15 +144,15 @@
 
 extern int sigaltstack(const stack_t*, stack_t*);
 
-extern void psiginfo(const siginfo_t*, const char*);
-extern void psignal(int, const char*);
+extern void psiginfo(const siginfo_t*, const char*) __INTRODUCED_IN(21);
+extern void psignal(int, const char*) __INTRODUCED_IN(21);
 
 extern int pthread_kill(pthread_t, int);
 extern int pthread_sigmask(int, const sigset_t*, sigset_t*);
 
-extern int sigqueue(pid_t, int, const union sigval);
-extern int sigtimedwait(const sigset_t*, siginfo_t*, const struct timespec*);
-extern int sigwaitinfo(const sigset_t*, siginfo_t*);
+extern int sigqueue(pid_t, int, const union sigval) __INTRODUCED_IN(23);
+extern int sigtimedwait(const sigset_t*, siginfo_t*, const struct timespec*) __INTRODUCED_IN(23);
+extern int sigwaitinfo(const sigset_t*, siginfo_t*) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 623995b..05f2d98 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -55,9 +55,9 @@
 struct __sFILE;
 typedef struct __sFILE FILE;
 
-extern FILE* stdin;
-extern FILE* stdout;
-extern FILE* stderr;
+extern FILE* stdin __INTRODUCED_IN(23);
+extern FILE* stdout __INTRODUCED_IN(23);
+extern FILE* stderr __INTRODUCED_IN(23);
 /* C99 and earlier plus current C++ standards say these must be macros. */
 #define stdin stdin
 #define stdout stdout
@@ -119,9 +119,8 @@
 size_t	 fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
 int	 getc(FILE *);
 int	 getchar(void);
-ssize_t	 getdelim(char ** __restrict, size_t * __restrict, int,
-	    FILE * __restrict);
-ssize_t	 getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
+ssize_t getdelim(char** __restrict, size_t* __restrict, int, FILE* __restrict) __INTRODUCED_IN(21);
+ssize_t getline(char** __restrict, size_t* __restrict, FILE* __restrict) __INTRODUCED_IN(21);
 
 void	 perror(const char *);
 int	 printf(const char * __restrict, ...)
@@ -143,8 +142,8 @@
 int	 vprintf(const char * __restrict, __va_list)
 		__printflike(1, 0);
 
-int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
-int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
+int dprintf(int, const char* __restrict, ...) __printflike(2, 3) __INTRODUCED_IN(21);
+int vdprintf(int, const char* __restrict, __va_list) __printflike(2, 0) __INTRODUCED_IN(21);
 
 #ifndef __AUDIT__
 #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
@@ -192,24 +191,22 @@
               int (*)(void*));
 #  endif
 #endif
-int fgetpos64(FILE*, fpos64_t*);
-int fsetpos64(FILE*, const fpos64_t*);
-int fseeko64(FILE*, off64_t, int);
-off64_t ftello64(FILE*);
+int fgetpos64(FILE*, fpos64_t*) __INTRODUCED_IN(24);
+int fsetpos64(FILE*, const fpos64_t*) __INTRODUCED_IN(24);
+int fseeko64(FILE*, off64_t, int) __INTRODUCED_IN(24);
+off64_t ftello64(FILE*) __INTRODUCED_IN(24);
 #if defined(__USE_BSD)
-FILE* funopen64(const void*,
-                int (*)(void*, char*, int),
-                int (*)(void*, const char*, int),
-                fpos64_t (*)(void*, fpos64_t, int),
-                int (*)(void*));
+FILE* funopen64(const void*, int (*)(void*, char*, int), int (*)(void*, const char*, int),
+                fpos64_t (*)(void*, fpos64_t, int), int (*)(void*)) __INTRODUCED_IN(24);
 #endif
 
 FILE* fopen(const char* __restrict, const char* __restrict);
-FILE* fopen64(const char* __restrict, const char* __restrict);
+FILE* fopen64(const char* __restrict, const char* __restrict) __INTRODUCED_IN(24);
 FILE* freopen(const char* __restrict, const char* __restrict, FILE* __restrict);
-FILE* freopen64(const char* __restrict, const char* __restrict, FILE* __restrict);
+FILE* freopen64(const char* __restrict, const char* __restrict, FILE* __restrict)
+  __INTRODUCED_IN(24);
 FILE* tmpfile(void);
-FILE* tmpfile64(void);
+FILE* tmpfile64(void) __INTRODUCED_IN(24);
 
 #if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE
 int	 snprintf(char * __restrict, size_t, const char * __restrict, ...)
@@ -254,8 +251,8 @@
 #endif /* __POSIX_VISIBLE >= 199506 */
 
 #if __POSIX_VISIBLE >= 200809
-FILE* fmemopen(void*, size_t, const char*);
-FILE* open_memstream(char**, size_t*);
+FILE* fmemopen(void*, size_t, const char*) __INTRODUCED_IN(23);
+FILE* open_memstream(char**, size_t*) __INTRODUCED_IN(23);
 #endif /* __POSIX_VISIBLE >= 200809 */
 
 #endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */
@@ -274,26 +271,28 @@
     __va_list)
 		__printflike(2, 0);
 
-void clearerr_unlocked(FILE*);
-int feof_unlocked(FILE*);
-int ferror_unlocked(FILE*);
-int fileno_unlocked(FILE*);
+void clearerr_unlocked(FILE*) __INTRODUCED_IN(23);
+int feof_unlocked(FILE*) __INTRODUCED_IN(23);
+int ferror_unlocked(FILE*) __INTRODUCED_IN(23);
+int fileno_unlocked(FILE*) __INTRODUCED_IN(24);
 
 #define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
 #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
 #endif /* __BSD_VISIBLE */
 
-extern char* __fgets_chk(char*, int, FILE*, size_t);
+extern char* __fgets_chk(char*, int, FILE*, size_t) __INTRODUCED_IN(21);
 extern char* __fgets_real(char*, int, FILE*) __RENAME(fgets);
 __errordecl(__fgets_too_big_error, "fgets called with size bigger than buffer");
 __errordecl(__fgets_too_small_error, "fgets called with size less than zero");
 
-extern size_t __fread_chk(void * __restrict, size_t, size_t, FILE * __restrict, size_t);
+extern size_t __fread_chk(void* __restrict, size_t, size_t, FILE* __restrict, size_t)
+  __INTRODUCED_IN(24);
 extern size_t __fread_real(void * __restrict, size_t, size_t, FILE * __restrict) __RENAME(fread);
 __errordecl(__fread_too_big_error, "fread called with size * count bigger than buffer");
 __errordecl(__fread_overflow, "fread called with overflowing size * count");
 
-extern size_t __fwrite_chk(const void * __restrict, size_t, size_t, FILE * __restrict, size_t);
+extern size_t __fwrite_chk(const void* __restrict, size_t, size_t, FILE* __restrict, size_t)
+  __INTRODUCED_IN(24);
 extern size_t __fwrite_real(const void * __restrict, size_t, size_t, FILE * __restrict) __RENAME(fwrite);
 __errordecl(__fwrite_too_big_error, "fwrite called with size * count bigger than buffer");
 __errordecl(__fwrite_overflow, "fwrite called with overflowing size * count");
diff --git a/libc/include/stdio_ext.h b/libc/include/stdio_ext.h
index de5d715..fdf6772 100644
--- a/libc/include/stdio_ext.h
+++ b/libc/include/stdio_ext.h
@@ -38,14 +38,14 @@
 
 __BEGIN_DECLS
 
-size_t __fbufsize(FILE*);
-int __freadable(FILE*);
-int __fwritable(FILE*);
-int __flbf(FILE*);
-void __fpurge(FILE*);
-size_t __fpending(FILE*);
-void _flushlbf(void);
-int __fsetlocking(FILE*, int);
+size_t __fbufsize(FILE*) __INTRODUCED_IN(23);
+int __freadable(FILE*) __INTRODUCED_IN(23);
+int __fwritable(FILE*) __INTRODUCED_IN(23);
+int __flbf(FILE*) __INTRODUCED_IN(23);
+void __fpurge(FILE*) __INTRODUCED_IN(23);
+size_t __fpending(FILE*) __INTRODUCED_IN(23);
+void _flushlbf(void) __INTRODUCED_IN(23);
+int __fsetlocking(FILE*, int) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index ba4b149..b3e52d5 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -43,7 +43,7 @@
 
 extern __noreturn void abort(void);
 extern __noreturn void exit(int);
-extern __noreturn void _Exit(int);
+extern __noreturn void _Exit(int) __INTRODUCED_IN(21);
 extern int atexit(void (*)(void));
 
 #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
@@ -60,13 +60,13 @@
 extern char* mkdtemp(char*);
 extern char* mktemp(char*) __attribute__((deprecated("mktemp is unsafe, use mkstemp or tmpfile instead")));
 
-extern int mkostemp64(char*, int);
-extern int mkostemp(char*, int);
-extern int mkostemps64(char*, int, int);
-extern int mkostemps(char*, int, int);
-extern int mkstemp64(char*);
+extern int mkostemp64(char*, int) __INTRODUCED_IN(23);
+extern int mkostemp(char*, int) __INTRODUCED_IN(23);
+extern int mkostemps64(char*, int, int) __INTRODUCED_IN(23);
+extern int mkostemps(char*, int, int) __INTRODUCED_IN(23);
+extern int mkstemp64(char*) __INTRODUCED_IN(21);
 extern int mkstemp(char*);
-extern int mkstemps64(char*, int);
+extern int mkstemps64(char*, int) __INTRODUCED_IN(23);
 extern int mkstemps(char*, int);
 
 extern long strtol(const char *, char **, int);
@@ -74,17 +74,19 @@
 extern unsigned long strtoul(const char *, char **, int);
 extern unsigned long long strtoull(const char *, char **, int);
 
-extern int posix_memalign(void **memptr, size_t alignment, size_t size);
+extern int posix_memalign(void** memptr, size_t alignment, size_t size) __INTRODUCED_IN(16);
 
 __BIONIC_LEGACY_INLINE double atof(const char*);
 
 extern double strtod(const char*, char**) __LIBC_ABI_PUBLIC__;
 __BIONIC_LEGACY_INLINE float strtof(const char*, char**) __LIBC_ABI_PUBLIC__;
-extern long double strtold(const char*, char**) __LIBC_ABI_PUBLIC__;
+extern long double strtold(const char*, char**) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(21);
 
-extern long double strtold_l(const char *, char **, locale_t) __LIBC_ABI_PUBLIC__;
-extern long long strtoll_l(const char *, char **, int, locale_t) __LIBC_ABI_PUBLIC__;
-extern unsigned long long strtoull_l(const char *, char **, int, locale_t) __LIBC_ABI_PUBLIC__;
+extern long double strtold_l(const char*, char**, locale_t) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(21);
+extern long long strtoll_l(const char*, char**, int, locale_t) __LIBC_ABI_PUBLIC__
+  __INTRODUCED_IN(21);
+extern unsigned long long strtoull_l(const char*, char**, int, locale_t) __LIBC_ABI_PUBLIC__
+  __INTRODUCED_IN(21);
 
 extern int atoi(const char*) __purefunc;
 extern long atol(const char*) __purefunc;
@@ -110,32 +112,32 @@
 #define RAND_MAX 0x7fffffff
 
 __BIONIC_LEGACY_INLINE int rand(void);
-int rand_r(unsigned int*);
+int rand_r(unsigned int*) __INTRODUCED_IN(21);
 __BIONIC_LEGACY_INLINE void srand(unsigned int);
 
 double drand48(void);
 double erand48(unsigned short[3]);
 long jrand48(unsigned short[3]);
-void lcong48(unsigned short[7]);
+void lcong48(unsigned short[7]) __INTRODUCED_IN(23);
 long lrand48(void);
 long mrand48(void);
 long nrand48(unsigned short[3]);
 unsigned short* seed48(unsigned short[3]);
 void srand48(long);
 
-char* initstate(unsigned int, char*, size_t);
+char* initstate(unsigned int, char*, size_t) __INTRODUCED_IN(21);
 __BIONIC_LEGACY_INLINE long random(void);
-char* setstate(char*);
+char* setstate(char*) __INTRODUCED_IN(21);
 __BIONIC_LEGACY_INLINE void srandom(unsigned int);
 
 int getpt(void);
 __BIONIC_LEGACY_INLINE int grantpt(int);
-int posix_openpt(int);
+int posix_openpt(int) __INTRODUCED_IN(21);
 char* ptsname(int);
 int ptsname_r(int, char*, size_t);
 int unlockpt(int);
 
-int getsubopt(char**, char* const*, char**);
+int getsubopt(char**, char* const*, char**) __INTRODUCED_IN_FUTURE;
 
 typedef struct {
     int  quot;
@@ -159,16 +161,16 @@
 extern lldiv_t   lldiv(long long, long long) __pure2;
 
 /* BSD compatibility. */
-extern const char* getprogname(void);
-extern void setprogname(const char*);
+extern const char* getprogname(void) __INTRODUCED_IN(21);
+extern void setprogname(const char*) __INTRODUCED_IN(21);
 
-int mblen(const char*, size_t);
+int mblen(const char*, size_t) __INTRODUCED_IN_FUTURE;
 size_t mbstowcs(wchar_t*, const char*, size_t);
-int mbtowc(wchar_t*, const char*, size_t);
-int wctomb(char*, wchar_t);
+int mbtowc(wchar_t*, const char*, size_t) __INTRODUCED_IN(21);
+int wctomb(char*, wchar_t) __INTRODUCED_IN(21);
 size_t wcstombs(char*, const wchar_t*, size_t);
 
-extern size_t __ctype_get_mb_cur_max(void);
+extern size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21);
 #define MB_CUR_MAX __ctype_get_mb_cur_max()
 
 #if defined(__BIONIC_FORTIFY)
diff --git a/libc/include/string.h b/libc/include/string.h
index dada52b..3f98af1 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -47,30 +47,30 @@
 extern int    memcmp(const void *, const void *, size_t) __purefunc;
 extern void*  memcpy(void* __restrict, const void* __restrict, size_t);
 #if defined(__USE_GNU)
-extern void*  mempcpy(void* __restrict, const void* __restrict, size_t);
+extern void* mempcpy(void* __restrict, const void* __restrict, size_t) __INTRODUCED_IN(23);
 #endif
 extern void*  memmove(void *, const void *, size_t);
 extern void*  memset(void *, int, size_t);
 extern void*  memmem(const void *, size_t, const void *, size_t) __purefunc;
 
 extern char*  strchr(const char *, int) __purefunc;
-extern char* __strchr_chk(const char *, int, size_t);
+extern char* __strchr_chk(const char*, int, size_t) __INTRODUCED_IN(21);
 #if defined(__USE_GNU)
 #if defined(__cplusplus)
 extern "C++" char* strchrnul(char*, int) __RENAME(strchrnul) __purefunc;
 extern "C++" const char* strchrnul(const char*, int) __RENAME(strchrnul) __purefunc;
 #else
-char* strchrnul(const char*, int) __purefunc;
+char* strchrnul(const char*, int) __purefunc __INTRODUCED_IN(24);
 #endif
 #endif
 
 extern char*  strrchr(const char *, int) __purefunc;
-extern char* __strrchr_chk(const char *, int, size_t);
+extern char* __strrchr_chk(const char*, int, size_t) __INTRODUCED_IN(21);
 
 extern size_t strlen(const char *) __purefunc;
-extern size_t __strlen_chk(const char *, size_t);
+extern size_t __strlen_chk(const char*, size_t) __INTRODUCED_IN(21);
 extern int    strcmp(const char *, const char *) __purefunc;
-extern char*  stpcpy(char* __restrict, const char* __restrict);
+extern char* stpcpy(char* __restrict, const char* __restrict) __INTRODUCED_IN(21);
 extern char*  strcpy(char* __restrict, const char* __restrict);
 extern char*  strcat(char* __restrict, const char* __restrict);
 
@@ -82,9 +82,9 @@
 extern char*  strtok_r(char* __restrict, const char* __restrict, char** __restrict);
 
 extern char* strerror(int);
-extern char* strerror_l(int, locale_t);
+extern char* strerror_l(int, locale_t) __INTRODUCED_IN(23);
 #if defined(__USE_GNU)
-extern char* strerror_r(int, char*, size_t) __RENAME(__gnu_strerror_r);
+extern char* strerror_r(int, char*, size_t) __RENAME(__gnu_strerror_r) __INTRODUCED_IN(23);
 #else /* POSIX */
 extern int strerror_r(int, char*, size_t);
 #endif
@@ -93,7 +93,7 @@
 extern char*  strncat(char* __restrict, const char* __restrict, size_t);
 extern char*  strndup(const char *, size_t);
 extern int    strncmp(const char *, const char *, size_t) __purefunc;
-extern char*  stpncpy(char* __restrict, const char* __restrict, size_t);
+extern char* stpncpy(char* __restrict, const char* __restrict, size_t) __INTRODUCED_IN(21);
 extern char*  strncpy(char* __restrict, const char* __restrict, size_t);
 
 extern size_t strlcat(char* __restrict, const char* __restrict, size_t);
@@ -109,8 +109,9 @@
 extern int    strcoll(const char *, const char *) __purefunc;
 extern size_t strxfrm(char* __restrict, const char* __restrict, size_t);
 
-extern int    strcoll_l(const char *, const char *, locale_t) __purefunc;
-extern size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale_t);
+extern int strcoll_l(const char*, const char*, locale_t) __purefunc __INTRODUCED_IN(21);
+extern size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale_t)
+  __INTRODUCED_IN(21);
 
 #if defined(__USE_GNU) && !defined(basename)
 /*
@@ -122,23 +123,26 @@
 extern "C++" char* basename(char*) __RENAME(__gnu_basename) __nonnull((1));
 extern "C++" const char* basename(const char*) __RENAME(__gnu_basename) __nonnull((1));
 #else
-extern char* basename(const char*) __RENAME(__gnu_basename) __nonnull((1));
+extern char* basename(const char*) __RENAME(__gnu_basename) __nonnull((1)) __INTRODUCED_IN(23);
 #endif
 #endif
 
-extern void* __memchr_chk(const void*, int, size_t, size_t);
+extern void* __memchr_chk(const void*, int, size_t, size_t) __INTRODUCED_IN(23);
 __errordecl(__memchr_buf_size_error, "memchr called with size bigger than buffer");
 
-extern void* __memrchr_chk(const void*, int, size_t, size_t);
+extern void* __memrchr_chk(const void*, int, size_t, size_t) __INTRODUCED_IN(23);
 __errordecl(__memrchr_buf_size_error, "memrchr called with size bigger than buffer");
 extern void* __memrchr_real(const void*, int, size_t) __RENAME(memrchr);
 
-extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t);
-extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t);
+extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t)
+  __INTRODUCED_IN(21);
+extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t)
+  __INTRODUCED_IN(21);
 extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcpy);
-extern size_t __strlcpy_chk(char *, const char *, size_t, size_t);
+extern size_t __strlcpy_chk(char*, const char*, size_t, size_t) __INTRODUCED_IN(21);
 extern size_t __strlcat_real(char* __restrict, const char* __restrict, size_t) __RENAME(strlcat);
-extern size_t __strlcat_chk(char* __restrict, const char* __restrict, size_t, size_t);
+extern size_t __strlcat_chk(char* __restrict, const char* __restrict, size_t, size_t)
+  __INTRODUCED_IN(21);
 
 #if defined(__BIONIC_FORTIFY)
 
diff --git a/libc/include/strings.h b/libc/include/strings.h
index 1200e77..ca9f658 100644
--- a/libc/include/strings.h
+++ b/libc/include/strings.h
@@ -54,7 +54,11 @@
 #define bzero(b, len) (void)(__builtin_memset((b), '\0', (len)))
 #endif
 
+#if defined(__i386__)
+int ffs(int) __INTRODUCED_IN(21);
+#else
 int ffs(int);
+#endif
 
 __END_DECLS
 
diff --git a/libc/include/sys/auxv.h b/libc/include/sys/auxv.h
index 0d753c3..4611fcc 100644
--- a/libc/include/sys/auxv.h
+++ b/libc/include/sys/auxv.h
@@ -33,7 +33,7 @@
 
 __BEGIN_DECLS
 
-unsigned long int getauxval(unsigned long int type);
+unsigned long int getauxval(unsigned long int type) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index b0e7b76..3fcf163 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -451,17 +451,23 @@
 
 #ifdef __clang__
 #define __AVAILABILITY(...) __attribute__((availability(android,__VA_ARGS__)))
+#else
+#define __AVAILABILITY(...)
+#endif // __clang__
+
 #define __INTRODUCED_IN(api_level) __AVAILABILITY(introduced=api_level)
 #define __DEPRECATED_IN(api_level) __AVAILABILITY(deprecated=api_level)
 #define __REMOVED_IN(api_level) __AVAILABILITY(obsoleted=api_level)
-#define __UNAVAILABLE __attribute__((unavailable))
+
+#define __INTRODUCED_IN_FUTURE __INTRODUCED_IN(10000)
+
+#if __LP64__
+#define __INTRODUCED_IN_32(api_level)
+#define __INTRODUCED_IN_64 __INTRODUCED_IN
 #else
-#define __AVAILABILITY(...)
-#define __INTRODUCED_IN(api_level)
-#define __DEPRECATED_IN(api_level)
-#define __REMOVED_IN(api_level)
-#define __UNAVAILABLE __attribute__((__error__("unavailable")))
-#endif // __clang__
+#define __INTRODUCED_IN_32 __INTRODUCED_IN
+#define __INTRODUCED_IN_64(api_level)
+#endif
 
 #if __has_builtin(__builtin_umul_overflow) || __GNUC__ >= 5
 #if __LP64__
diff --git a/libc/include/sys/endian.h b/libc/include/sys/endian.h
index 60cc030..449e0d7 100644
--- a/libc/include/sys/endian.h
+++ b/libc/include/sys/endian.h
@@ -49,10 +49,10 @@
 
 /* glibc compatibility. */
 __BEGIN_DECLS
-uint32_t htonl(uint32_t) __pure2;
-uint16_t htons(uint16_t) __pure2;
-uint32_t ntohl(uint32_t) __pure2;
-uint16_t ntohs(uint16_t) __pure2;
+uint32_t htonl(uint32_t) __pure2 __INTRODUCED_IN(21);
+uint16_t htons(uint16_t) __pure2 __INTRODUCED_IN(21);
+uint32_t ntohl(uint32_t) __pure2 __INTRODUCED_IN(21);
+uint16_t ntohs(uint16_t) __pure2 __INTRODUCED_IN(21);
 __END_DECLS
 
 #define htonl(x) __swap32(x)
diff --git a/libc/include/sys/epoll.h b/libc/include/sys/epoll.h
index 4a5a37c..4ec8969 100644
--- a/libc/include/sys/epoll.h
+++ b/libc/include/sys/epoll.h
@@ -74,10 +74,10 @@
 ;
 
 int epoll_create(int);
-int epoll_create1(int);
+int epoll_create1(int) __INTRODUCED_IN(21);
 int epoll_ctl(int, int, int, struct epoll_event*);
 int epoll_wait(int, struct epoll_event*, int, int);
-int epoll_pwait(int, struct epoll_event*, int, int, const sigset_t*);
+int epoll_pwait(int, struct epoll_event*, int, int, const sigset_t*) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/fsuid.h b/libc/include/sys/fsuid.h
index 03355b7..223db90 100644
--- a/libc/include/sys/fsuid.h
+++ b/libc/include/sys/fsuid.h
@@ -34,8 +34,8 @@
 
 __BEGIN_DECLS
 
-extern int setfsuid(uid_t);
-extern int setfsgid(gid_t);
+extern int setfsuid(uid_t) __INTRODUCED_IN(21);
+extern int setfsgid(gid_t) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/inotify.h b/libc/include/sys/inotify.h
index dcdd29a..dcf0e1d 100644
--- a/libc/include/sys/inotify.h
+++ b/libc/include/sys/inotify.h
@@ -41,7 +41,7 @@
 #define IN_NONBLOCK O_NONBLOCK
 
 extern int inotify_init(void);
-extern int inotify_init1(int);
+extern int inotify_init1(int) __INTRODUCED_IN(21);
 extern int inotify_add_watch(int, const char*, uint32_t);
 extern int inotify_rm_watch(int, uint32_t);
 
diff --git a/libc/include/sys/ioctl.h b/libc/include/sys/ioctl.h
index ed261f2..efbcb0c 100644
--- a/libc/include/sys/ioctl.h
+++ b/libc/include/sys/ioctl.h
@@ -37,7 +37,6 @@
 #include <linux/termios.h>
 #include <asm/ioctls.h>
 #include <asm/termbits.h>
-#include <sys/ioctl_compat.h>
 #include <linux/tty.h>
 
 #include <bits/ioctl.h>
diff --git a/libc/include/sys/ioctl_compat.h b/libc/include/sys/ioctl_compat.h
deleted file mode 100644
index d9ba4c7..0000000
--- a/libc/include/sys/ioctl_compat.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*	$NetBSD: ioctl_compat.h,v 1.15 2005/12/03 17:10:46 christos Exp $	*/
-
-/*
- * Copyright (c) 1990, 1993
- *	The Regents of the University of California.  All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
- *
- *	@(#)ioctl_compat.h	8.4 (Berkeley) 1/21/94
- */
-
-#ifndef _SYS_IOCTL_COMPAT_H_
-#define	_SYS_IOCTL_COMPAT_H_
-
-/*#include <sys/ttychars.h>*/
-/*#include <sys/ttydev.h>*/
-
-#if !defined(__mips__)
-struct tchars {
-	char	t_intrc;	/* interrupt */
-	char	t_quitc;	/* quit */
-	char	t_startc;	/* start output */
-	char	t_stopc;	/* stop output */
-	char	t_eofc;		/* end-of-file */
-	char	t_brkc;		/* input delimiter (like nl) */
-};
-
-struct ltchars {
-	char	t_suspc;	/* stop process signal */
-	char	t_dsuspc;	/* delayed stop process signal */
-	char	t_rprntc;	/* reprint line */
-	char	t_flushc;	/* flush output (toggles) */
-	char	t_werasc;	/* word erase */
-	char	t_lnextc;	/* literal next character */
-};
-
-/*
- * Structure for TIOCGETP and TIOCSETP ioctls.
- */
-#ifndef _SGTTYB_
-#define	_SGTTYB_
-struct sgttyb {
-	char	sg_ispeed;		/* input speed */
-	char	sg_ospeed;		/* output speed */
-	char	sg_erase;		/* erase character */
-	char	sg_kill;		/* kill character */
-	short	sg_flags;		/* mode flags */
-};
-#endif
-#endif
-
-#ifdef USE_OLD_TTY
-# undef  TIOCGETD
-# define TIOCGETD	_IOR('t', 0, int)	/* get line discipline */
-# undef  TIOCSETD
-# define TIOCSETD	_IOW('t', 1, int)	/* set line discipline */
-#else
-# define OTIOCGETD	_IOR('t', 0, int)	/* get line discipline */
-# define OTIOCSETD	_IOW('t', 1, int)	/* set line discipline */
-#endif
-#define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
-#if !defined(__mips__)
-#define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
-#define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
-#define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
-#endif
-#define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
-#define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
-#if 0
-/* BUG: a bunch of these conflict with #defines in asm/termbits.h */
-#define		TANDEM		0x00000001	/* send stopc on out q full */
-#define		CBREAK		0x00000002	/* half-cooked mode */
-#define		LCASE		0x00000004	/* simulate lower case */
-#define		ECHO		0x00000008	/* enable echoing */
-#define		CRMOD		0x00000010	/* map \r to \r\n on output */
-#define		RAW		0x00000020	/* no i/o processing */
-#define		ODDP		0x00000040	/* get/send odd parity */
-#define		EVENP		0x00000080	/* get/send even parity */
-#define		ANYP		0x000000c0	/* get any parity/send none */
-#define		NLDELAY		0x00000300	/* \n delay */
-#define			NL0	0x00000000
-#define			NL1	0x00000100	/* tty 37 */
-#define			NL2	0x00000200	/* vt05 */
-#define			NL3	0x00000300
-#define		TBDELAY		0x00000c00	/* horizontal tab delay */
-#define			TAB0	0x00000000
-#define			TAB1	0x00000400	/* tty 37 */
-#define			TAB2	0x00000800
-#define		XTABS		0x00000c00	/* expand tabs on output */
-#define		CRDELAY		0x00003000	/* \r delay */
-#define			CR0	0x00000000
-#define			CR1	0x00001000	/* tn 300 */
-#define			CR2	0x00002000	/* tty 37 */
-#define			CR3	0x00003000	/* concept 100 */
-#define		VTDELAY		0x00004000	/* vertical tab delay */
-#define			FF0	0x00000000
-#define			FF1	0x00004000	/* tty 37 */
-#define		BSDELAY		0x00008000	/* \b delay */
-#define			BS0	0x00000000
-#define			BS1	0x00008000
-#define		ALLDELAY	(NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
-#define		CRTBS		0x00010000	/* do backspacing for crt */
-#define		PRTERA		0x00020000	/* \ ... / erase */
-#define		CRTERA		0x00040000	/* " \b " to wipe out char */
-#define		TILDE		0x00080000	/* hazeltine tilde kludge */
-#define		MDMBUF		0x00100000	/* DTR/DCD hardware flow control */
-#define		LITOUT		0x00200000	/* literal output */
-#define		TOSTOP		0x00400000	/* stop background jobs on output */
-#define		FLUSHO		0x00800000	/* output being flushed (state) */
-#define		NOHANG		0x01000000	/* (no-op) was no SIGHUP on carrier drop */
-#define		L001000		0x02000000
-#define		CRTKIL		0x04000000	/* kill line with " \b " */
-#define		PASS8		0x08000000
-#define		CTLECH		0x10000000	/* echo control chars as ^X */
-#define		PENDIN		0x20000000	/* re-echo input buffer at next read */
-#define		DECCTQ		0x40000000	/* only ^Q starts after ^S */
-#define		NOFLSH		0x80000000	/* don't flush output on signal */
-#endif
-#define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
-#define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
-#define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
-#define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
-#define		LCRTBS		(CRTBS>>16)
-#define		LPRTERA		(PRTERA>>16)
-#define		LCRTERA		(CRTERA>>16)
-#define		LTILDE		(TILDE>>16)
-#define		LMDMBUF		(MDMBUF>>16)
-#define		LLITOUT		(LITOUT>>16)
-#define		LTOSTOP		(TOSTOP>>16)
-#define		LFLUSHO		(FLUSHO>>16)
-#define		LNOHANG		(NOHANG>>16)
-#define		LCRTKIL		(CRTKIL>>16)
-#define		LPASS8		(PASS8>>16)
-#define		LCTLECH		(CTLECH>>16)
-#define		LPENDIN		(PENDIN>>16)
-#define		LDECCTQ		(DECCTQ>>16)
-#define		LNOFLSH		(NOFLSH>>16)
-#if !defined(__mips__)
-#define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars*/
-#define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars*/
-#endif
-#define OTIOCCONS	_IO('t', 98)	/* for hp300 -- sans int arg */
-#define	OTTYDISC	0
-#define	NETLDISC	1
-#define	NTTYDISC	2
-
-#endif /* !_SYS_IOCTL_COMPAT_H_ */
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index 170300a..af96eff 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -50,26 +50,26 @@
 #define POSIX_MADV_DONTNEED   MADV_DONTNEED
 
 #if defined(__USE_FILE_OFFSET64)
-extern void* mmap(void*, size_t, int, int, int, off_t) __RENAME(mmap64);
+extern void* mmap(void*, size_t, int, int, int, off_t) __RENAME(mmap64) __INTRODUCED_IN(21);
 #else
 extern void* mmap(void*, size_t, int, int, int, off_t);
 #endif
-extern void* mmap64(void*, size_t, int, int, int, off64_t);
+extern void* mmap64(void*, size_t, int, int, int, off64_t) __INTRODUCED_IN(21);
 
 extern int munmap(void*, size_t);
 extern int msync(const void*, size_t, int);
 extern int mprotect(const void*, size_t, int);
 extern void* mremap(void*, size_t, size_t, int, ...);
 
-extern int mlockall(int);
-extern int munlockall(void);
+extern int mlockall(int) __INTRODUCED_IN(21);
+extern int munlockall(void) __INTRODUCED_IN(21);
 extern int mlock(const void*, size_t);
 extern int munlock(const void*, size_t);
 
 extern int mincore(void*, size_t, unsigned char*);
 
 extern int madvise(void*, size_t, int);
-extern int posix_madvise(void*, size_t, int);
+extern int posix_madvise(void*, size_t, int) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/sys/personality.h b/libc/include/sys/personality.h
index 7764468..68ae77c 100644
--- a/libc/include/sys/personality.h
+++ b/libc/include/sys/personality.h
@@ -34,7 +34,7 @@
 
 __BEGIN_DECLS
 
-extern int personality (unsigned int persona);
+extern int personality(unsigned int persona) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/quota.h b/libc/include/sys/quota.h
index f4f6447..08ca982 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*);
+int quotactl(int, const char*, int, char*) __INTRODUCED_IN_FUTURE;
 
 __END_DECLS
 
diff --git a/libc/include/sys/resource.h b/libc/include/sys/resource.h
index 8209dfb..3187420 100644
--- a/libc/include/sys/resource.h
+++ b/libc/include/sys/resource.h
@@ -45,16 +45,17 @@
 extern int getrlimit(int, struct rlimit*);
 extern int setrlimit(int, const struct rlimit*);
 
-extern int getrlimit64(int, struct rlimit64*);
-extern int setrlimit64(int, const struct rlimit64*);
+extern int getrlimit64(int, struct rlimit64*) __INTRODUCED_IN(21);
+extern int setrlimit64(int, const struct rlimit64*) __INTRODUCED_IN(21);
 
 extern int getpriority(int, int);
 extern int setpriority(int, int, int);
 
 extern int getrusage(int, struct rusage*);
 
-extern int prlimit(pid_t, int, const struct rlimit*, struct rlimit*);
-extern int prlimit64(pid_t, int, const struct rlimit64*, struct rlimit64*);
+extern int prlimit(pid_t, int, const struct rlimit*, struct rlimit*) __INTRODUCED_IN_32(24)
+  __INTRODUCED_IN_64(21);
+extern int prlimit64(pid_t, int, const struct rlimit64*, struct rlimit64*) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h
index 0c4a823..06c1c72 100644
--- a/libc/include/sys/select.h
+++ b/libc/include/sys/select.h
@@ -57,9 +57,9 @@
     } \
   } while (0)
 
-extern void __FD_CLR_chk(int, fd_set*, size_t);
-extern void __FD_SET_chk(int, fd_set*, size_t);
-extern int  __FD_ISSET_chk(int, fd_set*, size_t);
+extern void __FD_CLR_chk(int, fd_set*, size_t) __INTRODUCED_IN(21);
+extern void __FD_SET_chk(int, fd_set*, size_t) __INTRODUCED_IN(21);
+extern int __FD_ISSET_chk(int, fd_set*, size_t) __INTRODUCED_IN(21);
 
 #if defined(__BIONIC_FORTIFY)
 #define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set))
diff --git a/libc/include/sys/sendfile.h b/libc/include/sys/sendfile.h
index c588e68..f90498a 100644
--- a/libc/include/sys/sendfile.h
+++ b/libc/include/sys/sendfile.h
@@ -35,11 +35,12 @@
 __BEGIN_DECLS
 
 #if defined(__USE_FILE_OFFSET64)
-extern ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) __RENAME(sendfile64);
+extern ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) __RENAME(sendfile64)
+  __INTRODUCED_IN(21);
 #else
 extern ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count);
 #endif
-extern ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count);
+extern ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/signalfd.h b/libc/include/sys/signalfd.h
index 2537ab9..5b67822 100644
--- a/libc/include/sys/signalfd.h
+++ b/libc/include/sys/signalfd.h
@@ -35,7 +35,7 @@
 
 __BEGIN_DECLS
 
-extern int signalfd(int fd, const sigset_t* mask, int flags) __nonnull((2));
+extern int signalfd(int fd, const sigset_t* mask, int flags) __nonnull((2)) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index c7e9acc..85999f3 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -113,7 +113,7 @@
    ? (struct cmsghdr*) (msg)->msg_control : (struct cmsghdr*) NULL)
 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) &&   (cmsg)->cmsg_len <= (unsigned long)   ((mhdr)->msg_controllen -   ((char*)(cmsg) - (char*)(mhdr)->msg_control)))
 
-struct cmsghdr* __cmsg_nxthdr(struct msghdr*, struct cmsghdr*);
+struct cmsghdr* __cmsg_nxthdr(struct msghdr*, struct cmsghdr*) __INTRODUCED_IN(21);
 
 #define SCM_RIGHTS 0x01
 #define SCM_CREDENTIALS 0x02
@@ -269,16 +269,17 @@
 #endif
 
 __socketcall int accept(int, struct sockaddr*, socklen_t*);
-__socketcall int accept4(int, struct sockaddr*, socklen_t*, int);
+__socketcall int accept4(int, struct sockaddr*, socklen_t*, int) __INTRODUCED_IN(21);
 __socketcall int bind(int, const struct sockaddr*, int);
 __socketcall int connect(int, const struct sockaddr*, socklen_t);
 __socketcall int getpeername(int, struct sockaddr*, socklen_t*);
 __socketcall int getsockname(int, struct sockaddr*, socklen_t*);
 __socketcall int getsockopt(int, int, int, void*, socklen_t*);
 __socketcall int listen(int, int);
-__socketcall int recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*);
+__socketcall int recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*)
+  __INTRODUCED_IN(21);
 __socketcall int recvmsg(int, struct msghdr*, int);
-__socketcall int sendmmsg(int, const struct mmsghdr*, unsigned int, int);
+__socketcall int sendmmsg(int, const struct mmsghdr*, unsigned int, int) __INTRODUCED_IN(21);
 __socketcall int sendmsg(int, const struct msghdr*, int);
 __socketcall int setsockopt(int, int, int, const void*, socklen_t);
 __socketcall int shutdown(int, int);
@@ -292,7 +293,8 @@
 __socketcall ssize_t recvfrom(int, void*, size_t, int, const struct sockaddr*, socklen_t*);
 
 __errordecl(__recvfrom_error, "recvfrom called with size bigger than buffer");
-extern ssize_t __recvfrom_chk(int, void*, size_t, size_t, int, const struct sockaddr*, socklen_t*);
+extern ssize_t __recvfrom_chk(int, void*, size_t, size_t, int, const struct sockaddr*, socklen_t*)
+  __INTRODUCED_IN(21);
 extern ssize_t __recvfrom_real(int, void*, size_t, int, const struct sockaddr*, socklen_t*) __RENAME(recvfrom);
 
 #if defined(__BIONIC_FORTIFY)
diff --git a/libc/include/sys/socketcalls.h b/libc/include/sys/socketcalls.h
deleted file mode 100644
index 131e0bb..0000000
--- a/libc/include/sys/socketcalls.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-#ifndef _SYS_SOCKETCALLS_H_
-#define _SYS_SOCKETCALLS_H_
-
-/* socketcalls by number */
-
-#define SYS_SOCKET      1               /* sys_socket(2)                */
-#define SYS_BIND        2               /* sys_bind(2)                  */
-#define SYS_CONNECT     3               /* sys_connect(2)               */
-#define SYS_LISTEN      4               /* sys_listen(2)                */
-#define SYS_ACCEPT      5               /* sys_accept(2)                */
-#define SYS_GETSOCKNAME 6               /* sys_getsockname(2)           */
-#define SYS_GETPEERNAME 7               /* sys_getpeername(2)           */
-#define SYS_SOCKETPAIR  8               /* sys_socketpair(2)            */
-#define SYS_SEND        9               /* sys_send(2)                  */
-#define SYS_RECV        10              /* sys_recv(2)                  */
-#define SYS_SENDTO      11              /* sys_sendto(2)                */
-#define SYS_RECVFROM    12              /* sys_recvfrom(2)              */
-#define SYS_SHUTDOWN    13              /* sys_shutdown(2)              */
-#define SYS_SETSOCKOPT  14              /* sys_setsockopt(2)            */
-#define SYS_GETSOCKOPT  15              /* sys_getsockopt(2)            */
-#define SYS_SENDMSG     16              /* sys_sendmsg(2)               */
-#define SYS_RECVMSG     17              /* sys_recvmsg(2)               */
-#define SYS_ACCEPT4     18              /* sys_accept4(2)               */
-#define SYS_RECVMMSG    19              /* sys_recvmmsg(2)              */
-#define SYS_SENDMMSG    20              /* sys_sendmmsg(2)              */
-
-#endif /* _SYS_SOCKETCALLS_H_ */
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index ae85f62..46eec96 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -146,18 +146,18 @@
 extern int mkdir(const char*, mode_t);
 
 extern int fstat(int, struct stat*);
-extern int fstat64(int, struct stat64*);
+extern int fstat64(int, struct stat64*) __INTRODUCED_IN(21);
 extern int fstatat(int, const char*, struct stat*, int);
-extern int fstatat64(int, const char*, struct stat64*, int);
+extern int fstatat64(int, const char*, struct stat64*, int) __INTRODUCED_IN(21);
 extern int lstat(const char*, struct stat*);
-extern int lstat64(const char*, struct stat64*);
+extern int lstat64(const char*, struct stat64*) __INTRODUCED_IN(21);
 extern int stat(const char*, struct stat*);
-extern int stat64(const char*, struct stat64*);
+extern int stat64(const char*, struct stat64*) __INTRODUCED_IN(21);
 
 extern int mknod(const char*, mode_t, dev_t);
 extern mode_t umask(mode_t);
 
-extern mode_t __umask_chk(mode_t);
+extern mode_t __umask_chk(mode_t) __INTRODUCED_IN(21);
 extern mode_t __umask_real(mode_t) __RENAME(umask);
 __errordecl(__umask_invalid_mode, "umask called with invalid mode");
 
@@ -178,16 +178,17 @@
 #endif /* defined(__BIONIC_FORTIFY) */
 
 __BIONIC_LEGACY_INLINE int mkfifo(const char*, mode_t);
-extern int mkfifoat(int, const char*, mode_t);
+extern int mkfifoat(int, const char*, mode_t) __INTRODUCED_IN(23);
 
 extern int fchmodat(int, const char*, mode_t, int);
 extern int mkdirat(int, const char*, mode_t);
-extern int mknodat(int, const char*, mode_t, dev_t);
+extern int mknodat(int, const char*, mode_t, dev_t) __INTRODUCED_IN(21);
 
 #define UTIME_NOW  ((1L << 30) - 1L)
 #define UTIME_OMIT ((1L << 30) - 2L)
-extern int utimensat(int fd, const char *path, const struct timespec times[2], int flags);
-extern int futimens(int fd, const struct timespec times[2]);
+extern int utimensat(int fd, const char* path, const struct timespec times[2], int flags)
+  __INTRODUCED_IN(12);
+extern int futimens(int fd, const struct timespec times[2]) __INTRODUCED_IN(19);
 
 __END_DECLS
 
diff --git a/libc/include/sys/statvfs.h b/libc/include/sys/statvfs.h
index 3495546..e12f069 100644
--- a/libc/include/sys/statvfs.h
+++ b/libc/include/sys/statvfs.h
@@ -59,10 +59,12 @@
 #define ST_NODIRATIME  0x0800
 #define ST_RELATIME    0x1000
 
-extern int statvfs(const char* __restrict, struct statvfs* __restrict) __nonnull((1, 2));
-extern int statvfs64(const char* __restrict, struct statvfs64* __restrict) __nonnull((1, 2));
-extern int fstatvfs(int, struct statvfs*) __nonnull((2));
-extern int fstatvfs64(int, struct statvfs64*) __nonnull((2));
+extern int statvfs(const char* __restrict, struct statvfs* __restrict) __nonnull((1, 2))
+  __INTRODUCED_IN(21);
+extern int statvfs64(const char* __restrict, struct statvfs64* __restrict) __nonnull((1, 2))
+  __INTRODUCED_IN(21);
+extern int fstatvfs(int, struct statvfs*) __nonnull((2)) __INTRODUCED_IN(21);
+extern int fstatvfs64(int, struct statvfs64*) __nonnull((2)) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/swap.h b/libc/include/sys/swap.h
index e4c1819..b1f9295 100644
--- a/libc/include/sys/swap.h
+++ b/libc/include/sys/swap.h
@@ -38,8 +38,8 @@
 #define SWAP_FLAG_PRIO_MASK 0x7fff
 #define SWAP_FLAG_PRIO_SHIFT 0
 
-extern int swapon(const char*, int) __nonnull((1));
-extern int swapoff(const char*) __nonnull((1));
+extern int swapon(const char*, int) __nonnull((1)) __INTRODUCED_IN(21);
+extern int swapoff(const char*) __nonnull((1)) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/syscall.h b/libc/include/sys/syscall.h
index 21eaf33..87cddc9 100644
--- a/libc/include/sys/syscall.h
+++ b/libc/include/sys/syscall.h
@@ -30,7 +30,7 @@
 #define _SYS_SYSCALL_H_
 
 #include <asm/unistd.h> /* Linux kernel __NR_* names. */
-#include <sys/glibc-syscalls.h> /* glibc-compatible SYS_* aliases. */
+#include <bits/glibc-syscalls.h> /* glibc-compatible SYS_* aliases. */
 
 /* The syscall function itself is declared in <unistd.h>, not here. */
 
diff --git a/libc/include/sys/sysinfo.h b/libc/include/sys/sysinfo.h
index b66bc8e..9a10d64 100644
--- a/libc/include/sys/sysinfo.h
+++ b/libc/include/sys/sysinfo.h
@@ -35,13 +35,13 @@
 
 int sysinfo(struct sysinfo* info);
 
-int get_nprocs_conf(void);
+int get_nprocs_conf(void) __INTRODUCED_IN(23);
 
-int get_nprocs(void);
+int get_nprocs(void) __INTRODUCED_IN(23);
 
-long get_phys_pages(void);
+long get_phys_pages(void) __INTRODUCED_IN(23);
 
-long get_avphys_pages(void);
+long get_avphys_pages(void) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/sys/syslimits.h b/libc/include/sys/syslimits.h
deleted file mode 100644
index e69de29..0000000
--- a/libc/include/sys/syslimits.h
+++ /dev/null
diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index 01c3db3..99a6e59 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -48,7 +48,7 @@
 
 /* Set a system property by name.
 **/
-int __system_property_set(const char *key, const char *value);
+int __system_property_set(const char* key, const char* value) __INTRODUCED_IN(21);
 
 /* Return a pointer to the system property named name, if it
 ** exists, or NULL if there is no such property.  Use 
@@ -93,9 +93,8 @@
 ** Order of results may change from call to call.  This is
 ** not a bug.
 */
-int __system_property_foreach(
-        void (*propfn)(const prop_info *pi, void *cookie),
-        void *cookie);
+int __system_property_foreach(void (*propfn)(const prop_info* pi, void* cookie), void* cookie)
+  __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/timerfd.h b/libc/include/sys/timerfd.h
index 1aa97b4..a189742 100644
--- a/libc/include/sys/timerfd.h
+++ b/libc/include/sys/timerfd.h
@@ -41,10 +41,10 @@
 #define TFD_CLOEXEC O_CLOEXEC
 #define TFD_NONBLOCK O_NONBLOCK
 
-extern int timerfd_create(clockid_t, int);
-extern int timerfd_settime(int, int, const struct itimerspec*,
-                           struct itimerspec*);
-extern int timerfd_gettime(int, struct itimerspec*);
+extern int timerfd_create(clockid_t, int) __INTRODUCED_IN(21);
+extern int timerfd_settime(int, int, const struct itimerspec*, struct itimerspec*)
+  __INTRODUCED_IN(21);
+extern int timerfd_gettime(int, struct itimerspec*) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/timex.h b/libc/include/sys/timex.h
index fade5c3..f704ce8 100644
--- a/libc/include/sys/timex.h
+++ b/libc/include/sys/timex.h
@@ -35,8 +35,8 @@
 
 __BEGIN_DECLS
 
-int adjtimex(struct timex*);
-int clock_adjtime(clockid_t, struct timex*);
+int adjtimex(struct timex*) __INTRODUCED_IN(24);
+int clock_adjtime(clockid_t, struct timex*) __INTRODUCED_IN(24);
 
 __END_DECLS
 
diff --git a/libc/include/sys/ttychars.h b/libc/include/sys/ttychars.h
deleted file mode 100644
index e69de29..0000000
--- a/libc/include/sys/ttychars.h
+++ /dev/null
diff --git a/libc/include/sys/ttydev.h b/libc/include/sys/ttydev.h
deleted file mode 100644
index e69de29..0000000
--- a/libc/include/sys/ttydev.h
+++ /dev/null
diff --git a/libc/include/sys/uio.h b/libc/include/sys/uio.h
index 72675d1..7a009b4 100644
--- a/libc/include/sys/uio.h
+++ b/libc/include/sys/uio.h
@@ -42,16 +42,18 @@
 ssize_t preadv(int, const struct iovec*, int, off_t) __RENAME(preadv64);
 ssize_t pwritev(int, const struct iovec*, int, off_t) __RENAME(pwritev64);
 #else
-ssize_t preadv(int, const struct iovec*, int, off_t);
-ssize_t pwritev(int, const struct iovec*, int, off_t);
+ssize_t preadv(int, const struct iovec*, int, off_t) __INTRODUCED_IN(24);
+ssize_t pwritev(int, const struct iovec*, int, off_t) __INTRODUCED_IN(24);
 #endif
-ssize_t preadv64(int, const struct iovec*, int, off64_t);
-ssize_t pwritev64(int, const struct iovec*, int, off64_t);
+ssize_t preadv64(int, const struct iovec*, int, off64_t) __INTRODUCED_IN(24);
+ssize_t pwritev64(int, const struct iovec*, int, off64_t) __INTRODUCED_IN(24);
 #endif
 
 #if defined(__USE_GNU)
-ssize_t process_vm_readv(pid_t, const struct iovec*, unsigned long, const struct iovec*, unsigned long, unsigned long);
-ssize_t process_vm_writev(pid_t, const struct iovec*, unsigned long, const struct iovec*, unsigned long, unsigned long);
+ssize_t process_vm_readv(pid_t, const struct iovec*, unsigned long, const struct iovec*,
+                         unsigned long, unsigned long) __INTRODUCED_IN(23);
+ssize_t process_vm_writev(pid_t, const struct iovec*, unsigned long, const struct iovec*,
+                          unsigned long, unsigned long) __INTRODUCED_IN(23);
 #endif
 
 __END_DECLS
diff --git a/libc/include/sys/utime.h b/libc/include/sys/utime.h
deleted file mode 100644
index 9f8810e..0000000
--- a/libc/include/sys/utime.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2008 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.
- */
-#ifndef _SYS_UTIME_H_
-#define _SYS_UTIME_H_
-
-#include <linux/utime.h>
-
-#endif /* _SYS_UTIME_H_ */
diff --git a/libc/include/sys/vfs.h b/libc/include/sys/vfs.h
index 1fbc8be..9f04b28 100644
--- a/libc/include/sys/vfs.h
+++ b/libc/include/sys/vfs.h
@@ -138,9 +138,9 @@
 #define XFS_SUPER_MAGIC       0x58465342
 
 extern int statfs(const char*, struct statfs*) __nonnull((1, 2));
-extern int statfs64(const char*, struct statfs64*) __nonnull((1, 2));
+extern int statfs64(const char*, struct statfs64*) __nonnull((1, 2)) __INTRODUCED_IN(21);
 extern int fstatfs(int, struct statfs*) __nonnull((2));
-extern int fstatfs64(int, struct statfs64*) __nonnull((2));
+extern int fstatfs64(int, struct statfs64*) __nonnull((2)) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/sys/wait.h b/libc/include/sys/wait.h
index 2317b02..aba20e5 100644
--- a/libc/include/sys/wait.h
+++ b/libc/include/sys/wait.h
@@ -51,7 +51,7 @@
 
 extern pid_t  wait(int *);
 extern pid_t  waitpid(pid_t, int *, int);
-extern pid_t  wait4(pid_t, int *, int, struct rusage *);
+extern pid_t wait4(pid_t, int*, int, struct rusage*) __INTRODUCED_IN(19);
 
 /* Posix states that idtype_t should be an enumeration type, but
  * the kernel headers define P_ALL, P_PID and P_PGID as constant macros
diff --git a/libc/include/sys/xattr.h b/libc/include/sys/xattr.h
index 39b25b1..070913f 100644
--- a/libc/include/sys/xattr.h
+++ b/libc/include/sys/xattr.h
@@ -35,21 +35,26 @@
 #define XATTR_CREATE 1
 #define XATTR_REPLACE 2
 
-extern int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags);
-extern int setxattr(const char *path, const char *name, const void *value, size_t size, int flags);
-extern int lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags);
+extern int fsetxattr(int fd, const char* name, const void* value, size_t size, int flags)
+  __INTRODUCED_IN(21);
+extern int setxattr(const char* path, const char* name, const void* value, size_t size, int flags)
+  __INTRODUCED_IN(21);
+extern int lsetxattr(const char* path, const char* name, const void* value, size_t size, int flags)
+  __INTRODUCED_IN(21);
 
-extern ssize_t fgetxattr(int fd, const char *name, void *value, size_t size);
-extern ssize_t getxattr(const char *path, const char *name, void *value, size_t size);
-extern ssize_t lgetxattr(const char *path, const char *name, void *value, size_t size);
+extern ssize_t fgetxattr(int fd, const char* name, void* value, size_t size) __INTRODUCED_IN(21);
+extern ssize_t getxattr(const char* path, const char* name, void* value, size_t size)
+  __INTRODUCED_IN(21);
+extern ssize_t lgetxattr(const char* path, const char* name, void* value, size_t size)
+  __INTRODUCED_IN(21);
 
-extern ssize_t listxattr(const char *path, char *list, size_t size);
-extern ssize_t llistxattr(const char *path, char *list, size_t size);
-extern ssize_t flistxattr(int fd, char *list, size_t size);
+extern ssize_t listxattr(const char* path, char* list, size_t size) __INTRODUCED_IN(21);
+extern ssize_t llistxattr(const char* path, char* list, size_t size) __INTRODUCED_IN(21);
+extern ssize_t flistxattr(int fd, char* list, size_t size) __INTRODUCED_IN(21);
 
-extern int removexattr(const char *path, const char *name);
-extern int lremovexattr(const char *path, const char *name);
-extern int fremovexattr(int fd, const char *name);
+extern int removexattr(const char* path, const char* name) __INTRODUCED_IN(21);
+extern int lremovexattr(const char* path, const char* name) __INTRODUCED_IN(21);
+extern int fremovexattr(int fd, const char* name) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/termios.h b/libc/include/termios.h
index e604747..15a7b32 100644
--- a/libc/include/termios.h
+++ b/libc/include/termios.h
@@ -40,8 +40,8 @@
 __BIONIC_LEGACY_INLINE void cfmakeraw(struct termios*);
 __BIONIC_LEGACY_INLINE int cfsetispeed(struct termios*, speed_t);
 __BIONIC_LEGACY_INLINE int cfsetospeed(struct termios*, speed_t);
-__BIONIC_LEGACY_INLINE int cfsetspeed(struct termios*, speed_t);
-__BIONIC_LEGACY_INLINE int tcdrain(int);
+__BIONIC_LEGACY_INLINE int cfsetspeed(struct termios*, speed_t) __INTRODUCED_IN(21);
+__BIONIC_LEGACY_INLINE int tcdrain(int) __INTRODUCED_IN(21);
 __BIONIC_LEGACY_INLINE int tcflow(int, int);
 __BIONIC_LEGACY_INLINE int tcflush(int, int);
 __BIONIC_LEGACY_INLINE int tcgetattr(int, struct termios*);
diff --git a/libc/include/time.h b/libc/include/time.h
index 1b0f6a1..039608b 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -76,7 +76,8 @@
 
 extern char* strptime(const char*, const char*, struct tm*) __LIBC_ABI_PUBLIC__;
 extern size_t strftime(char*, size_t, const char*, const struct tm*) __LIBC_ABI_PUBLIC__;
-extern size_t strftime_l(char *, size_t, const char *, const struct tm *, locale_t) __LIBC_ABI_PUBLIC__;
+extern size_t strftime_l(char*, size_t, const char*, const struct tm*, locale_t) __LIBC_ABI_PUBLIC__
+  __INTRODUCED_IN(21);
 
 extern char* ctime(const time_t*) __LIBC_ABI_PUBLIC__;
 extern char* ctime_r(const time_t*, char*) __LIBC_ABI_PUBLIC__;
@@ -85,7 +86,7 @@
 
 extern clock_t clock(void) __LIBC_ABI_PUBLIC__;
 
-extern int clock_getcpuclockid(pid_t, clockid_t*) __LIBC_ABI_PUBLIC__;
+extern int clock_getcpuclockid(pid_t, clockid_t*) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(23);
 
 extern int clock_getres(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
 extern int clock_gettime(clockid_t, struct timespec*) __LIBC_ABI_PUBLIC__;
@@ -99,8 +100,8 @@
 extern int timer_getoverrun(timer_t) __LIBC_ABI_PUBLIC__;
 
 /* Non-standard extensions that are in the BSDs and glibc. */
-extern time_t timelocal(struct tm*) __LIBC_ABI_PUBLIC__;
-extern time_t timegm(struct tm*) __LIBC_ABI_PUBLIC__;
+extern time_t timelocal(struct tm*) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(21);
+extern time_t timegm(struct tm*) __LIBC_ABI_PUBLIC__ __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/uchar.h b/libc/include/uchar.h
index a5e72ea..9a0e2f8 100644
--- a/libc/include/uchar.h
+++ b/libc/include/uchar.h
@@ -42,16 +42,12 @@
 #define __STD_UTF_16__ 1
 #define __STD_UTF_32__ 1
 
-size_t c16rtomb(char* __restrict, char16_t, mbstate_t* __restrict);
-size_t c32rtomb(char* __restrict, char32_t, mbstate_t* __restrict);
-size_t mbrtoc16(char16_t* __restrict,
-                const char* __restrict,
-                size_t,
-                mbstate_t* __restrict);
-size_t mbrtoc32(char32_t* __restrict,
-                const char* __restrict,
-                size_t,
-                mbstate_t* __restrict);
+size_t c16rtomb(char* __restrict, char16_t, mbstate_t* __restrict) __INTRODUCED_IN(21);
+size_t c32rtomb(char* __restrict, char32_t, mbstate_t* __restrict) __INTRODUCED_IN(21);
+size_t mbrtoc16(char16_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict)
+  __INTRODUCED_IN(21);
+size_t mbrtoc32(char32_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict)
+  __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index ea6c8a1..6b5ef76 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -176,12 +176,12 @@
 extern off64_t lseek64(int __fd, off64_t __offset, int __whence);
 
 #if defined(__USE_FILE_OFFSET64) && __ANDROID_API__ >= 21
-extern int truncate(const char* __path, off_t __length) __RENAME(truncate64);
-extern ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset)
-  __RENAME(pread64);
-extern ssize_t pwrite(int __fd, const void* __buf, size_t __count,
-                      off_t __offset) __RENAME(pwrite64);
-extern int ftruncate(int __fd, off_t __length) __RENAME(ftruncate64);
+extern int truncate(const char* __path, off_t __length) __RENAME(truncate64) __INTRODUCED_IN(21);
+extern ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset) __RENAME(pread64)
+  __INTRODUCED_IN(12);
+extern ssize_t pwrite(int __fd, const void* __buf, size_t __count, off_t __offset)
+  __RENAME(pwrite64) __INTRODUCED_IN(12);
+extern int ftruncate(int __fd, off_t __length) __RENAME(ftruncate64) __INTRODUCED_IN(12);
 #else
 extern int truncate(const char* __path, off_t __length);
 extern ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset);
@@ -191,10 +191,10 @@
 #endif
 
 extern int truncate64(const char* __path, off64_t __length) __INTRODUCED_IN(21);
-extern ssize_t pread64(int __fd, void* __buf, size_t __count, off64_t __offset) __INTRODUCED_IN(21);
-extern ssize_t pwrite64(int __fd, const void* __buf, size_t __count,
-                        off64_t __offset) __INTRODUCED_IN(21);
-extern int ftruncate64(int __fd, off64_t __length) __INTRODUCED_IN(21);
+extern ssize_t pread64(int __fd, void* __buf, size_t __count, off64_t __offset) __INTRODUCED_IN(12);
+extern ssize_t pwrite64(int __fd, const void* __buf, size_t __count, off64_t __offset)
+  __INTRODUCED_IN(12);
+extern int ftruncate64(int __fd, off64_t __length) __INTRODUCED_IN(12);
 
 extern int pause(void);
 extern unsigned int alarm(unsigned int __seconds);
@@ -202,7 +202,7 @@
 extern int usleep(useconds_t __usec);
 
 int gethostname(char* __name, size_t __len);
-int sethostname(const char* __name, size_t __len);
+int sethostname(const char* __name, size_t __len) __INTRODUCED_IN(23);
 
 extern void* __brk(void* __addr);
 extern int brk(void* __addr);
@@ -243,52 +243,53 @@
     _rc; })
 
 /* TODO(unified-headers): Factor out all the FORTIFY features. */
-extern char* __getcwd_chk(char*, size_t, size_t);
+extern char* __getcwd_chk(char*, size_t, size_t) __INTRODUCED_IN(24);
 __errordecl(__getcwd_dest_size_error, "getcwd called with size bigger than destination");
 extern char* __getcwd_real(char*, size_t) __RENAME(getcwd);
 
-extern ssize_t __pread_chk(int, void*, size_t, off_t, size_t);
+extern ssize_t __pread_chk(int, void*, size_t, off_t, size_t) __INTRODUCED_IN(23);
 __errordecl(__pread_dest_size_error, "pread called with size bigger than destination");
 __errordecl(__pread_count_toobig_error, "pread called with count > SSIZE_MAX");
 extern ssize_t __pread_real(int, void*, size_t, off_t) __RENAME(pread);
 
-extern ssize_t __pread64_chk(int, void*, size_t, off64_t, size_t);
+extern ssize_t __pread64_chk(int, void*, size_t, off64_t, size_t) __INTRODUCED_IN(23);
 __errordecl(__pread64_dest_size_error, "pread64 called with size bigger than destination");
 __errordecl(__pread64_count_toobig_error, "pread64 called with count > SSIZE_MAX");
-extern ssize_t __pread64_real(int, void*, size_t, off64_t) __RENAME(pread64);
+extern ssize_t __pread64_real(int, void*, size_t, off64_t) __RENAME(pread64) __INTRODUCED_IN(12);
 
-extern ssize_t __pwrite_chk(int, const void*, size_t, off_t, size_t);
+extern ssize_t __pwrite_chk(int, const void*, size_t, off_t, size_t) __INTRODUCED_IN(24);
 __errordecl(__pwrite_dest_size_error, "pwrite called with size bigger than destination");
 __errordecl(__pwrite_count_toobig_error, "pwrite called with count > SSIZE_MAX");
 extern ssize_t __pwrite_real(int, const void*, size_t, off_t) __RENAME(pwrite);
 
-extern ssize_t __pwrite64_chk(int, const void*, size_t, off64_t, size_t);
+extern ssize_t __pwrite64_chk(int, const void*, size_t, off64_t, size_t) __INTRODUCED_IN(24);
 __errordecl(__pwrite64_dest_size_error, "pwrite64 called with size bigger than destination");
 __errordecl(__pwrite64_count_toobig_error, "pwrite64 called with count > SSIZE_MAX");
-extern ssize_t __pwrite64_real(int, const void*, size_t, off64_t) __RENAME(pwrite64);
+extern ssize_t __pwrite64_real(int, const void*, size_t, off64_t) __RENAME(pwrite64)
+  __INTRODUCED_IN(12);
 
-extern ssize_t __read_chk(int, void*, size_t, size_t);
+extern ssize_t __read_chk(int, void*, size_t, size_t) __INTRODUCED_IN(21);
 __errordecl(__read_dest_size_error, "read called with size bigger than destination");
 __errordecl(__read_count_toobig_error, "read called with count > SSIZE_MAX");
 extern ssize_t __read_real(int, void*, size_t) __RENAME(read);
 
-extern ssize_t __write_chk(int, const void*, size_t, size_t);
+extern ssize_t __write_chk(int, const void*, size_t, size_t) __INTRODUCED_IN(24);
 __errordecl(__write_dest_size_error, "write called with size bigger than destination");
 __errordecl(__write_count_toobig_error, "write called with count > SSIZE_MAX");
 extern ssize_t __write_real(int, const void*, size_t) __RENAME(write);
 
-extern ssize_t __readlink_chk(const char*, char*, size_t, size_t);
+extern ssize_t __readlink_chk(const char*, char*, size_t, size_t) __INTRODUCED_IN(23);
 __errordecl(__readlink_dest_size_error, "readlink called with size bigger than destination");
 __errordecl(__readlink_size_toobig_error, "readlink called with size > SSIZE_MAX");
 extern ssize_t __readlink_real(const char*, char*, size_t) __RENAME(readlink);
 
-extern ssize_t __readlinkat_chk(int dirfd, const char*, char*, size_t, size_t);
+extern ssize_t __readlinkat_chk(int dirfd, const char*, char*, size_t, size_t) __INTRODUCED_IN(23);
 __errordecl(__readlinkat_dest_size_error, "readlinkat called with size bigger than destination");
 __errordecl(__readlinkat_size_toobig_error, "readlinkat called with size > SSIZE_MAX");
 extern ssize_t __readlinkat_real(int dirfd, const char*, char*, size_t) __RENAME(readlinkat);
 
-extern int getdomainname(char*, size_t);
-extern int setdomainname(const char*, size_t);
+extern int getdomainname(char*, size_t) __INTRODUCED_IN_FUTURE;
+extern int setdomainname(const char*, size_t) __INTRODUCED_IN_FUTURE;
 
 #if defined(__BIONIC_FORTIFY)
 
diff --git a/libc/include/util.h b/libc/include/util.h
deleted file mode 100644
index e69de29..0000000
--- a/libc/include/util.h
+++ /dev/null
diff --git a/libc/include/utmp.h b/libc/include/utmp.h
index c6f22a5..62e8d59 100644
--- a/libc/include/utmp.h
+++ b/libc/include/utmp.h
@@ -101,7 +101,7 @@
 struct utmp* getutent(void);
 void endutent(void);
 
-int login_tty(int);
+int login_tty(int) __INTRODUCED_IN(23);
 
 __END_DECLS
 
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index 625097e..91d6f24 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -81,23 +81,23 @@
 extern size_t            mbrlen(const char *, size_t, mbstate_t *);
 extern size_t            mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
 extern size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
-extern size_t mbsnrtowcs(wchar_t*, const char**, size_t, size_t, mbstate_t*);
+extern size_t mbsnrtowcs(wchar_t*, const char**, size_t, size_t, mbstate_t*) __INTRODUCED_IN(21);
 extern wint_t            putwc(wchar_t, FILE *);
 extern wint_t            putwchar(wchar_t);
 extern int               swprintf(wchar_t *, size_t, const wchar_t *, ...);
 extern int               swscanf(const wchar_t *, const wchar_t *, ...);
 extern wint_t            ungetwc(wint_t, FILE *);
 extern int vfwprintf(FILE*, const wchar_t*, va_list);
-extern int vfwscanf(FILE*, const wchar_t*, va_list);
+extern int vfwscanf(FILE*, const wchar_t*, va_list) __INTRODUCED_IN(21);
 extern int vswprintf(wchar_t*, size_t, const wchar_t*, va_list);
-extern int vswscanf(const wchar_t*, const wchar_t*, va_list);
+extern int vswscanf(const wchar_t*, const wchar_t*, va_list) __INTRODUCED_IN(21);
 extern int vwprintf(const wchar_t*, va_list);
-extern int vwscanf(const wchar_t*, va_list);
+extern int vwscanf(const wchar_t*, va_list) __INTRODUCED_IN(21);
 extern wchar_t* wcpcpy (wchar_t*, const wchar_t *);
 extern wchar_t* wcpncpy (wchar_t*, const wchar_t *, size_t);
 extern size_t            wcrtomb(char *, wchar_t, mbstate_t *);
 extern int               wcscasecmp(const wchar_t *, const wchar_t *);
-extern int               wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
+extern int wcscasecmp_l(const wchar_t*, const wchar_t*, locale_t) __INTRODUCED_IN(23);
 extern wchar_t          *wcscat(wchar_t *, const wchar_t *);
 extern wchar_t          *wcschr(const wchar_t *, wchar_t);
 extern int               wcscmp(const wchar_t *, const wchar_t *);
@@ -107,24 +107,24 @@
 extern size_t            wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *) __LIBC_ABI_PUBLIC__;
 extern size_t            wcslen(const wchar_t *);
 extern int               wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
-extern int               wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
+extern int wcsncasecmp_l(const wchar_t*, const wchar_t*, size_t, locale_t) __INTRODUCED_IN(23);
 extern wchar_t          *wcsncat(wchar_t *, const wchar_t *, size_t);
 extern int               wcsncmp(const wchar_t *, const wchar_t *, size_t);
 extern wchar_t          *wcsncpy(wchar_t *, const wchar_t *, size_t);
-extern size_t wcsnrtombs(char*, const wchar_t**, size_t, size_t, mbstate_t*);
+extern size_t wcsnrtombs(char*, const wchar_t**, size_t, size_t, mbstate_t*) __INTRODUCED_IN(21);
 extern wchar_t          *wcspbrk(const wchar_t *, const wchar_t *);
 extern wchar_t          *wcsrchr(const wchar_t *, wchar_t);
 extern size_t wcsrtombs(char*, const wchar_t**, size_t, mbstate_t*);
 extern size_t            wcsspn(const wchar_t *, const wchar_t *);
 extern wchar_t          *wcsstr(const wchar_t *, const wchar_t *);
 extern double wcstod(const wchar_t*, wchar_t**);
-extern float wcstof(const wchar_t*, wchar_t**);
+extern float wcstof(const wchar_t*, wchar_t**) __INTRODUCED_IN(21);
 extern wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**);
 extern long wcstol(const wchar_t*, wchar_t**, int);
-extern long long wcstoll(const wchar_t*, wchar_t**, int);
-extern long double wcstold(const wchar_t*, wchar_t**);
+extern long long wcstoll(const wchar_t*, wchar_t**, int) __INTRODUCED_IN(21);
+extern long double wcstold(const wchar_t*, wchar_t**) __INTRODUCED_IN(21);
 extern unsigned long wcstoul(const wchar_t*, wchar_t**, int);
-extern unsigned long long wcstoull(const wchar_t*, wchar_t**, int);
+extern unsigned long long wcstoull(const wchar_t*, wchar_t**, int) __INTRODUCED_IN(21);
 extern int               wcswidth(const wchar_t *, size_t);
 extern size_t            wcsxfrm(wchar_t *, const wchar_t *, size_t);
 extern int               wctob(wint_t);
@@ -133,25 +133,25 @@
 extern int               wmemcmp(const wchar_t *, const wchar_t *, size_t);
 extern wchar_t          *wmemcpy(wchar_t *, const wchar_t *, size_t);
 #if defined(__USE_GNU)
-extern wchar_t          *wmempcpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t* wmempcpy(wchar_t*, const wchar_t*, size_t) __INTRODUCED_IN(23);
 #endif
 extern wchar_t          *wmemmove(wchar_t *, const wchar_t *, size_t);
 extern wchar_t          *wmemset(wchar_t *, wchar_t, size_t);
 extern int               wprintf(const wchar_t *, ...);
 extern int               wscanf(const wchar_t *, ...);
 
-extern long long          wcstoll_l(const wchar_t *, wchar_t **, int, locale_t);
-extern unsigned long long wcstoull_l(const wchar_t *, wchar_t **, int, locale_t);
-extern long double        wcstold_l(const wchar_t *, wchar_t **, locale_t );
+extern long long wcstoll_l(const wchar_t*, wchar_t**, int, locale_t) __INTRODUCED_IN(21);
+extern unsigned long long wcstoull_l(const wchar_t*, wchar_t**, int, locale_t) __INTRODUCED_IN(21);
+extern long double wcstold_l(const wchar_t*, wchar_t**, locale_t) __INTRODUCED_IN(21);
 
-extern int    wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
-extern size_t wcsxfrm_l(wchar_t *, const wchar_t *, size_t, locale_t);
+extern int wcscoll_l(const wchar_t*, const wchar_t*, locale_t) __INTRODUCED_IN(21);
+extern size_t wcsxfrm_l(wchar_t*, const wchar_t*, size_t, locale_t) __INTRODUCED_IN(21);
 
 extern size_t wcslcat(wchar_t*, const wchar_t*, size_t);
 extern size_t wcslcpy(wchar_t*, const wchar_t*, size_t);
 
 #if __POSIX_VISIBLE >= 200809
-FILE* open_wmemstream(wchar_t**, size_t*);
+FILE* open_wmemstream(wchar_t**, size_t*) __INTRODUCED_IN(23);
 wchar_t* wcsdup(const wchar_t*);
 size_t wcsnlen(const wchar_t*, size_t);
 #endif
diff --git a/libc/include/wctype.h b/libc/include/wctype.h
index 12ef7cd..41e0ec3 100644
--- a/libc/include/wctype.h
+++ b/libc/include/wctype.h
@@ -35,27 +35,27 @@
 
 __BEGIN_DECLS
 
-int iswalnum_l(wint_t, locale_t);
-int iswalpha_l(wint_t, locale_t);
-int iswblank_l(wint_t, locale_t);
-int iswcntrl_l(wint_t, locale_t);
-int iswdigit_l(wint_t, locale_t);
-int iswgraph_l(wint_t, locale_t);
-int iswlower_l(wint_t, locale_t);
-int iswprint_l(wint_t, locale_t);
-int iswpunct_l(wint_t, locale_t);
-int iswspace_l(wint_t, locale_t);
-int iswupper_l(wint_t, locale_t);
-int iswxdigit_l(wint_t, locale_t);
+int iswalnum_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswalpha_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswblank_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswcntrl_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswdigit_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswgraph_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswlower_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswprint_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswpunct_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswspace_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswupper_l(wint_t, locale_t) __INTRODUCED_IN(21);
+int iswxdigit_l(wint_t, locale_t) __INTRODUCED_IN(21);
 
-wint_t towlower_l(int, locale_t);
-wint_t towupper_l(int, locale_t);
+wint_t towlower_l(int, locale_t) __INTRODUCED_IN(21);
+wint_t towupper_l(int, locale_t) __INTRODUCED_IN(21);
 
-wint_t towctrans_l(wint_t, wctrans_t, locale_t);
-wctrans_t wctrans_l(const char*, locale_t);
+wint_t towctrans_l(wint_t, wctrans_t, locale_t) __INTRODUCED_IN_FUTURE;
+wctrans_t wctrans_l(const char*, locale_t) __INTRODUCED_IN_FUTURE;
 
-wctype_t wctype_l(const char*, locale_t);
-int iswctype_l(wint_t, wctype_t, locale_t);
+wctype_t wctype_l(const char*, locale_t) __INTRODUCED_IN(21);
+int iswctype_l(wint_t, wctype_t, locale_t) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/malloc_debug/README.md b/libc/malloc_debug/README.md
index 3fc2305..d9eb782 100644
--- a/libc/malloc_debug/README.md
+++ b/libc/malloc_debug/README.md
@@ -8,22 +8,18 @@
 by adding a shim layer that replaces the normal allocation calls. The replaced
 calls are:
 
-<pre>
-malloc
-free
-calloc
-realloc
-posix_memalign
-memalign
-malloc_usable_size
-</pre>
+* `malloc`
+* `free`
+* `calloc`
+* `realloc`
+* `posix_memalign`
+* `memalign`
+* `malloc_usable_size`
 
 On 32 bit systems, these two deprecated functions are also replaced:
 
-<pre>
-pvalloc
-valloc
-</pre>
+* `pvalloc`
+* `valloc`
 
 Any errors detected by the library are reported in the log.
 
@@ -57,11 +53,9 @@
 
 Example error:
 
-<pre>
-04-10 12:00:45.621  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 SIZE 100 HAS A CORRUPTED FRONT GUARD
-04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[-32] = 0x00 (expected 0xaa)
-04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[-15] = 0x02 (expected 0xaa)
-</pre>
+    04-10 12:00:45.621  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 SIZE 100 HAS A CORRUPTED FRONT GUARD
+    04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[-32] = 0x00 (expected 0xaa)
+    04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[-15] = 0x02 (expected 0xaa)
 
 ### rear\_guard[=SIZE\_BYTES]
 Enables a small buffer placed after the allocated data. This is an attempt
@@ -79,11 +73,9 @@
 
 Example error:
 
-<pre>
-04-10 12:00:45.621  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 SIZE 100 HAS A CORRUPTED REAR GUARD
-04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[130] = 0xbf (expected 0xbb)
-04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[131] = 0x00 (expected 0xbb)
-</pre>
+    04-10 12:00:45.621  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 SIZE 100 HAS A CORRUPTED REAR GUARD
+    04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[130] = 0xbf (expected 0xbb)
+    04-10 12:00:45.622  7412  7412 E malloc_debug:   allocation[131] = 0x00 (expected 0xbb)
 
 ### guard[=SIZE\_BYTES]
 Enables both a front guard and a rear guard on all allocations.
@@ -173,25 +165,21 @@
 
 Example error:
 
-<pre>
-04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 USED AFTER FREE
-04-15 12:00:31.305  7412  7412 E malloc_debug:   allocation[20] = 0xaf (expected 0xef)
-04-15 12:00:31.305  7412  7412 E malloc_debug:   allocation[99] = 0x12 (expected 0xef)
-04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace at time of free:
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
-</pre>
+    04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 USED AFTER FREE
+    04-15 12:00:31.305  7412  7412 E malloc_debug:   allocation[20] = 0xaf (expected 0xef)
+    04-15 12:00:31.305  7412  7412 E malloc_debug:   allocation[99] = 0x12 (expected 0xef)
+    04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace at time of free:
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
 
 In addition, there is another type of error message that can occur if
 an allocation has a special header applied, and the header is corrupted
 before the verification occurs. This is the error message that will be found
 in the log:
 
-<pre>
-+++ ALLOCATION 0x12345678 HAS CORRUPTED HEADER TAG 0x1cc7dc00 AFTER FREE
-</pre>
+    04-15 12:00:31.604  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 HAS CORRUPTED HEADER TAG 0x1cc7dc00 AFTER FREE
 
 ### free\_track\_backtrace\_num\_frames[=MAX\_FRAMES]
 This option only has meaning if free\_track is set. It indicates how many
@@ -214,62 +202,54 @@
 
 Example leak error found in the log:
 
-<pre>
-04-15 12:35:33.304  7412  7412 E malloc_debug: +++ APP leaked block of size 100 at 0x2be3b0b0 (leak 1 of 2)
-04-15 12:35:33.304  7412  7412 E malloc_debug: Backtrace at time of allocation:
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
-04-15 12:35:33.305  7412  7412 E malloc_debug: +++ APP leaked block of size 24 at 0x7be32380 (leak 2 of 2)
-04-15 12:35:33.305  7412  7412 E malloc_debug: Backtrace at time of allocation:
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
-04-15 12:35:33.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
-</pre>
+    04-15 12:35:33.304  7412  7412 E malloc_debug: +++ APP leaked block of size 100 at 0x2be3b0b0 (leak 1 of 2)
+    04-15 12:35:33.304  7412  7412 E malloc_debug: Backtrace at time of allocation:
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
+    04-15 12:35:33.305  7412  7412 E malloc_debug: +++ APP leaked block of size 24 at 0x7be32380 (leak 2 of 2)
+    04-15 12:35:33.305  7412  7412 E malloc_debug: Backtrace at time of allocation:
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
+    04-15 12:35:33.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
 
 Additional Errors
 -----------------
 There are a few other error messages that might appear in the log.
 
 ### Use After Free
-<pre>
-04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 USED AFTER FREE (free)
-04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace of original free:
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
-04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace at time of failure:
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
-</pre>
+    04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 USED AFTER FREE (free)
+    04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace of original free:
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace at time of failure:
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
 
 This indicates that code is attempting to free an already freed pointer. The
 name in parenthesis indicates that the application called the function
-<i>free</i> with the bad pointer.
+*free* with the bad pointer.
 
 For example, this message:
 
-<pre>
-04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 USED AFTER FREE (realloc)
-</pre>
+    04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 USED AFTER FREE (realloc)
 
-Would indicate that the application called the <i>realloc</i> function
+Would indicate that the application called the *realloc* function
 with an already freed pointer.
 
 ### Invalid Tag
-<pre>
-04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 HAS INVALID TAG 1ee7d000 (malloc_usable_size)
-04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace at time of failure:
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
-04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
-</pre>
+    04-15 12:00:31.304  7412  7412 E malloc_debug: +++ ALLOCATION 0x12345678 HAS INVALID TAG 1ee7d000 (malloc_usable_size)
+    04-15 12:00:31.305  7412  7412 E malloc_debug: Backtrace at time of failure:
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #00  pc 00029310  /system/lib/libc.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #01  pc 00021438  /system/lib/libc.so (newlocale+160)
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #02  pc 000a9e38  /system/lib/libc++.so
+    04-15 12:00:31.305  7412  7412 E malloc_debug:           #03  pc 000a28a8  /system/lib/libc++.so
 
 This indicates that a function (malloc\_usable\_size) was called with
 a pointer that is either not allocated memory, or that the memory of
@@ -282,36 +262,28 @@
 ========
 Enable backtrace tracking of all allocation for all processes:
 
-<pre>
-  adb shell stop
-  adb shell setprop libc.debug.malloc.options backtrace
-  adb shell start
-</pre>
+    adb shell stop
+    adb shell setprop libc.debug.malloc.options backtrace
+    adb shell start
 
 Enable backtrace tracking for a specific process (ls):
 
-<pre>
-  adb shell setprop libc.debug.malloc.options backtrace
-  adb shell setprop libc.debug.malloc.program ls
-  adb shell ls
-</pre>
+    adb shell setprop libc.debug.malloc.options backtrace
+    adb shell setprop libc.debug.malloc.program ls
+    adb shell ls
 
 Enable backtrace tracking for the zygote and zygote based processes:
 
-<pre>
-  adb shell stop
-  adb shell setprop libc.debug.malloc.program app_process
-  adb shell setprop libc.debug.malloc.options backtrace
-  adb shell start
-</pre>
+    adb shell stop
+    adb shell setprop libc.debug.malloc.program app_process
+    adb shell setprop libc.debug.malloc.options backtrace
+    adb shell start
 
 Enable multiple options (backtrace and guards):
 
-<pre>
-  adb shell stop
-  adb shell setprop libc.debug.malloc.options "\"backtrace guards\""
-  adb shell start
-</pre>
+    adb shell stop
+    adb shell setprop libc.debug.malloc.options "\"backtrace guards\""
+    adb shell start
 
 Enable malloc debug when multiple processes have the same name. This method
 can be used to enable malloc debug for only a very specific process if
@@ -321,10 +293,8 @@
 the setprop command will fail since the backtrace guards options will look
 like two arguments instead of one.
 
-<pre>
-  adb shell
-  # setprop libc.debug.malloc.env_enabled
-  # setprop libc.debug.malloc.options backtrace
-  # export LIBC_DEBUG_MALLOC_ENABLE 1
-  # ls
-</pre>
+    adb shell
+    # setprop libc.debug.malloc.env_enabled
+    # setprop libc.debug.malloc.options backtrace
+    # export LIBC_DEBUG_MALLOC_ENABLE 1
+    # ls
diff --git a/libc/malloc_debug/README_api.md b/libc/malloc_debug/README_api.md
index cd04c32..63ad42a 100644
--- a/libc/malloc_debug/README_api.md
+++ b/libc/malloc_debug/README_api.md
@@ -7,57 +7,47 @@
 
 The function to gather the data:
 
-<pre>
-<b>
-extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overall_size, size_t* info_size, size_t* total_memory, size_t* backtrace_size);
-</b>
-</pre>
+`extern "C" void get_malloc_leak_info(uint8_t** info, size_t* overall_size, size_t* info_size, size_t* total_memory, size_t* backtrace_size);`
 
-<i>info</i> is set to a buffer allocated by the call that contains all of
+*info* is set to a buffer allocated by the call that contains all of
 the allocation information.
-<i>overall\_size</i> is set to the total size of the buffer returned. If this
-<i>info\_size</i>
+*overall\_size* is set to the total size of the buffer returned. If this
+*info\_size*
 value is zero, then there are no allocation being tracked.
-<i>total\_memory</i> is set to the sum of all allocation sizes that are live at
+*total\_memory* is set to the sum of all allocation sizes that are live at
 the point of the function call. This does not include the memory allocated
 by the malloc debug library itself.
-<i>backtrace\_size</i> is set to the maximum number of backtrace entries
+*backtrace\_size* is set to the maximum number of backtrace entries
 that are present for each allocation.
 
 In order to free the buffer allocated by the function, call:
 
-<pre>
-<b>
-extern "C" void free_malloc_leak_info(uint8_t* info);
-</b>
-</pre>
+`extern "C" void free_malloc_leak_info(uint8_t* info);`
 
 ### Format of info Buffer
-<pre>
-size_t size_of_original_allocation
-size_t num_backtrace_frames
-uintptr_t pc1
-uintptr_t pc2
-uintptr_t pc3
-.
-.
-.
-</pre>
+    size_t size_of_original_allocation
+    size_t num_backtrace_frames
+    uintptr_t pc1
+    uintptr_t pc2
+    uintptr_t pc3
+    .
+    .
+    .
 
-The number of <i>uintptr\_t</i> values is determined by the value
-<i>backtrace\_size</i> as returned by the original call to
-<i>get\_malloc\_leak\_info</i>. This value is not variable, it is the same
+The number of *uintptr\_t* values is determined by the value
+*backtrace\_size* as returned by the original call to
+*get\_malloc\_leak\_info*. This value is not variable, it is the same
 for all the returned data. The value
-<i>num\_backtrace\_frames</i> contains the real number of frames found. The
-extra frames are set to zero. Each <i>uintptr\_t</i> is a pc of the callstack.
+*num\_backtrace\_frames* contains the real number of frames found. The
+extra frames are set to zero. Each *uintptr\_t* is a pc of the callstack.
 The calls from within the malloc debug library are automatically removed.
 
-For 32 bit systems, <i>size\_t</i> and <i>uintptr\_t</i> are both 4 byte values.
+For 32 bit systems, *size\_t* and *uintptr\_t* are both 4 byte values.
 
-For 64 bit systems, <i>size\_t</i> and <i>uintptr\_t</i> are both 8 byte values.
+For 64 bit systems, *size\_t* and *uintptr\_t* are both 8 byte values.
 
-The total number of these structures returned in <i>info</i> is
-<i>overall\_size</i> divided by <i>info\_size</i>.
+The total number of these structures returned in *info* is
+*overall\_size* divided by *info\_size*.
 
 Note, the size value in each allocation data structure will have bit 31 set
 if this allocation was created by the Zygote process. This helps to distinguish
diff --git a/libc/include/machine/ieee.h b/libc/private/bionic_ieee.h
similarity index 100%
rename from libc/include/machine/ieee.h
rename to libc/private/bionic_ieee.h
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index 04ccf39..de06a2f 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -570,7 +570,7 @@
 
     def gen_glibc_syscalls_h(self):
         # TODO: generate a separate file for each architecture, like glibc's bits/syscall.h.
-        glibc_syscalls_h_path = "include/sys/glibc-syscalls.h"
+        glibc_syscalls_h_path = "include/bits/glibc-syscalls.h"
         logging.info("generating " + glibc_syscalls_h_path)
         glibc_fp = create_file(glibc_syscalls_h_path)
         glibc_fp.write("/* %s */\n" % warning)
diff --git a/libc/upstream-freebsd/android/include/machine/endian.h b/libc/upstream-freebsd/android/include/machine/endian.h
new file mode 100644
index 0000000..2dc4d83
--- /dev/null
+++ b/libc/upstream-freebsd/android/include/machine/endian.h
@@ -0,0 +1 @@
+#include <endian.h>
diff --git a/libc/upstream-openbsd/android/include/machine/ieee.h b/libc/upstream-openbsd/android/include/machine/ieee.h
new file mode 100644
index 0000000..dac332a
--- /dev/null
+++ b/libc/upstream-openbsd/android/include/machine/ieee.h
@@ -0,0 +1 @@
+#include "private/bionic_ieee.h"
diff --git a/libm/Android.mk b/libm/Android.mk
index 7200e5f..b07e426 100644
--- a/libm/Android.mk
+++ b/libm/Android.mk
@@ -507,7 +507,10 @@
 
 LOCAL_C_INCLUDES_x86 += $(LOCAL_PATH)/i387
 
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/
+LOCAL_C_INCLUDES += \
+    $(LOCAL_PATH)/upstream-freebsd/android/include/ \
+    $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/ \
+
 LOCAL_C_INCLUDES_64 += $(LOCAL_PATH)/upstream-freebsd/lib/msun/ld128/
 
 LOCAL_ARM_MODE := arm
diff --git a/libm/upstream-freebsd/android/include/machine/endian.h b/libm/upstream-freebsd/android/include/machine/endian.h
new file mode 100644
index 0000000..2dc4d83
--- /dev/null
+++ b/libm/upstream-freebsd/android/include/machine/endian.h
@@ -0,0 +1 @@
+#include <endian.h>
diff --git a/tests/complex_test.cpp b/tests/complex_test.cpp
index 3b8e682..a8f6777 100644
--- a/tests/complex_test.cpp
+++ b/tests/complex_test.cpp
@@ -16,6 +16,16 @@
 
 #include <gtest/gtest.h>
 
+// This file is compiled against both glibc and bionic, and our complex.h
+// depends on bionic-specific macros, so hack around that.
+#include <sys/cdefs.h>
+#if !defined(__INTRODUCED_IN)
+#define __INTRODUCED_IN(x)
+#define __INTRODUCED_IN_32(x)
+#define __INTRODUCED_IN_64(x)
+#define __INTRODUCED_IN_FUTURE
+#endif
+
 // libc++ actively gets in the way of including <complex.h> from C++, so we
 // have to be naughty.
 #include <../libc/include/complex.h>