Merge "Remove <stdlib.h> cruft."
diff --git a/libc/include/android/legacy_stdlib_inlines.h b/libc/include/android/legacy_stdlib_inlines.h
index 452bed5..e9b606a 100644
--- a/libc/include/android/legacy_stdlib_inlines.h
+++ b/libc/include/android/legacy_stdlib_inlines.h
@@ -31,45 +31,6 @@
 #include <sys/cdefs.h>
 
 
-
-#if __ANDROID_API__ < 21
-
-#include <errno.h>
-#include <float.h>
-#include <stdlib.h>
-
-__BEGIN_DECLS
-
-static __inline float strtof(const char* nptr, char** endptr) {
-  // N.B. Double-rounding makes this function incorrect for some inputs.
-  double d = strtod(nptr, endptr);
-  if (__builtin_isfinite(d) && __builtin_fabs(d) > FLT_MAX) {
-    errno = ERANGE;
-    return __builtin_copysign(__builtin_huge_valf(), d);
-  }
-  return __BIONIC_CAST(static_cast, float, d);
-}
-
-static __inline double atof(const char *nptr) { return (strtod(nptr, NULL)); }
-
-static __inline int rand(void) { return (int)lrand48(); }
-
-static __inline void srand(unsigned int __s) { srand48(__s); }
-
-static __inline long random(void) { return lrand48(); }
-
-static __inline void srandom(unsigned int __s) { srand48(__s); }
-
-static __inline int grantpt(int __fd __attribute((unused))) {
-  return 0; /* devpts does this all for us! */
-}
-
-__END_DECLS
-
-#endif
-
-
-
 #if __ANDROID_API__ < 26
 
 #include <stdlib.h>
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index c185ec7..b416f62 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -163,17 +163,8 @@
 
 size_t wcstombs(char* _Nullable __dst, const wchar_t* _Nullable __src, size_t __n) __INTRODUCED_IN_NO_GUARD_FOR_NDK(21);
 
-#if __ANDROID_API__ >= 21
 size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21);
 #define MB_CUR_MAX __ctype_get_mb_cur_max()
-#else
-/*
- * Pre-L we didn't have any locale support and so we were always the POSIX
- * locale. POSIX specifies that MB_CUR_MAX for the POSIX locale is 1:
- * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html
- */
-#define MB_CUR_MAX 1
-#endif
 
 #if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS)
 #include <bits/fortify/stdlib.h>
@@ -183,7 +174,6 @@
 long labs(long __x) __attribute_const__ __INTRODUCED_IN(19);
 long long llabs(long long __x) __attribute_const__ __INTRODUCED_IN(19);
 
-#if __ANDROID_API__ >= 21
 float strtof(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr) __INTRODUCED_IN(21);
 double atof(const char* _Nonnull __s) __attribute_pure__ __INTRODUCED_IN(21);
 int rand(void) __INTRODUCED_IN(21);
@@ -195,9 +185,6 @@
 long long strtoll_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(21);
 unsigned long long strtoull_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, int __base, locale_t _Nonnull __l) __INTRODUCED_IN(21);
 long double strtold_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(21);
-#else
-// Implemented as static inlines before 21.
-#endif
 
 #if __ANDROID_API__ >= 26
 double strtod_l(const char* _Nonnull __s, char* _Nullable * _Nullable __end_ptr, locale_t _Nonnull __l) __INTRODUCED_IN(26);