Sync libc/stdlib with FreeBSD (ignoring jemalloc, pts, and gdtoa):
-Add a64l(), l64a(), and l64a_r() XSI extentions. These functions
convert between a 32-bit integer and a radix-64 ASCII string.
-Replace some syscalls with libc version.
-Remove advertising clause.
-alloca() cannot check if the allocation is valid; mention the
consequences.
-Include some verbage about not calling exit() from functions registered
by atexit().
-Use pthread mutexes where possible instead of libc spinlocks.
-Significantly reduce the memory leak as noted in the BUGS section of
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.
-Prefer setenv() instead of putenv().
-Convert *env() calls to POSIX:
-unsetenv returns an int.
-putenv takes a char * instead of const char *.
-putenv no longer makes a copy of the input string.
-errno is set appropriately. Exceptions involve bad environ
variable and internal initialization code. These both set errno
to EFAULT.
-Make getopt_long() more GNU compatible and sync up with OpenBSD's
version.
-POSIX clearly states that getsubopt() should be declared in <stdlib.h>
not in <unistd.h>
-Use size_t to avoid overflow when sorting arrays larger than 2 GB in
heapsort() and qsort().
-Add new implementations of insque() and remque() which conform to
IEEE Std 1003.1-2001.
-Add qsort_r() for functions that need to be reentrant.
-Improve radixsort()'s preformance when sorting strings with common
prefixes.
-Use 'uint32_t' instead of 'long' when a 32-bit integer is intended in
random(3).
-Rearrange <stdlib.h> in a more logical order based on visibility.
-Move getsubopt()'s prototype to <stdlib.h> (standards).
-Make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.
- [DB] lib/libc/stdlib/getopt_long.c