aboutsummaryrefslogtreecommitdiff
path: root/REORG.TODO/include
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/include')
-rw-r--r--REORG.TODO/include/aio.h14
-rw-r--r--REORG.TODO/include/aliases.h40
-rw-r--r--REORG.TODO/include/alloca.h80
-rw-r--r--REORG.TODO/include/argp.h1
-rw-r--r--REORG.TODO/include/argz.h12
-rw-r--r--REORG.TODO/include/arpa/ftp.h1
-rw-r--r--REORG.TODO/include/arpa/inet.h15
-rw-r--r--REORG.TODO/include/arpa/nameser.h83
-rw-r--r--REORG.TODO/include/arpa/nameser_compat.h11
-rw-r--r--REORG.TODO/include/arpa/telnet.h1
-rw-r--r--REORG.TODO/include/arpa/tftp.h1
-rw-r--r--REORG.TODO/include/assert.h27
-rw-r--r--REORG.TODO/include/atomic.h829
-rw-r--r--REORG.TODO/include/bits/cmathcalls.h1
-rw-r--r--REORG.TODO/include/bits/dlfcn.h5
-rw-r--r--REORG.TODO/include/bits/error.h1
-rw-r--r--REORG.TODO/include/bits/fcntl2.h1
-rw-r--r--REORG.TODO/include/bits/getopt_core.h1
-rw-r--r--REORG.TODO/include/bits/getopt_ext.h1
-rw-r--r--REORG.TODO/include/bits/getopt_posix.h1
-rw-r--r--REORG.TODO/include/bits/locale.h1
-rw-r--r--REORG.TODO/include/bits/mathcalls-helper-functions.h1
-rw-r--r--REORG.TODO/include/bits/mathcalls.h1
-rw-r--r--REORG.TODO/include/bits/poll2.h1
-rw-r--r--REORG.TODO/include/bits/posix1_lim.h1
-rw-r--r--REORG.TODO/include/bits/posix2_lim.h1
-rw-r--r--REORG.TODO/include/bits/select2.h1
-rw-r--r--REORG.TODO/include/bits/setjmp2.h1
-rw-r--r--REORG.TODO/include/bits/socket2.h1
-rw-r--r--REORG.TODO/include/bits/stab.def1
-rw-r--r--REORG.TODO/include/bits/stdlib-float.h8
-rw-r--r--REORG.TODO/include/bits/stdlib.h1
-rw-r--r--REORG.TODO/include/bits/string2.h1
-rw-r--r--REORG.TODO/include/bits/string3.h1
-rw-r--r--REORG.TODO/include/bits/strings_fortified.h1
-rw-r--r--REORG.TODO/include/bits/syslog.h1
-rw-r--r--REORG.TODO/include/bits/types.h1
-rw-r--r--REORG.TODO/include/bits/types/FILE.h1
-rw-r--r--REORG.TODO/include/bits/types/__FILE.h1
-rw-r--r--REORG.TODO/include/bits/types/__mbstate_t.h1
-rw-r--r--REORG.TODO/include/bits/types/clock_t.h1
-rw-r--r--REORG.TODO/include/bits/types/clockid_t.h1
-rw-r--r--REORG.TODO/include/bits/types/mbstate_t.h1
-rw-r--r--REORG.TODO/include/bits/types/res_state.h1
-rw-r--r--REORG.TODO/include/bits/types/sig_atomic_t.h1
-rw-r--r--REORG.TODO/include/bits/types/sigset_t.h1
-rw-r--r--REORG.TODO/include/bits/types/sigval_t.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_iovec.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_itimerspec.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_osockaddr.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_sigstack.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_timespec.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_timeval.h1
-rw-r--r--REORG.TODO/include/bits/types/struct_tm.h1
-rw-r--r--REORG.TODO/include/bits/types/time_t.h1
-rw-r--r--REORG.TODO/include/bits/types/timer_t.h1
-rw-r--r--REORG.TODO/include/bits/types/wint_t.h1
-rw-r--r--REORG.TODO/include/bits/unistd.h1
-rw-r--r--REORG.TODO/include/bits/wchar2.h1
-rw-r--r--REORG.TODO/include/bits/wctype-wchar.h1
-rw-r--r--REORG.TODO/include/bits/xopen_lim.h145
-rw-r--r--REORG.TODO/include/byteswap.h1
-rw-r--r--REORG.TODO/include/caller.h31
-rw-r--r--REORG.TODO/include/complex.h16
-rw-r--r--REORG.TODO/include/cpio.h1
-rw-r--r--REORG.TODO/include/crypt.h3
-rw-r--r--REORG.TODO/include/ctype.h67
-rw-r--r--REORG.TODO/include/des.h1
-rw-r--r--REORG.TODO/include/dirent.h88
-rw-r--r--REORG.TODO/include/dlfcn.h140
-rw-r--r--REORG.TODO/include/elf.h17
-rw-r--r--REORG.TODO/include/endian.h17
-rw-r--r--REORG.TODO/include/envz.h11
-rw-r--r--REORG.TODO/include/err.h14
-rw-r--r--REORG.TODO/include/errno.h52
-rw-r--r--REORG.TODO/include/error.h1
-rw-r--r--REORG.TODO/include/execinfo.h16
-rw-r--r--REORG.TODO/include/fcntl.h41
-rw-r--r--REORG.TODO/include/features.h450
-rw-r--r--REORG.TODO/include/fenv.h47
-rw-r--r--REORG.TODO/include/float.h31
-rw-r--r--REORG.TODO/include/fmtmsg.h1
-rw-r--r--REORG.TODO/include/fnmatch.h9
-rw-r--r--REORG.TODO/include/fpu_control.h10
-rw-r--r--REORG.TODO/include/ftw.h1
-rw-r--r--REORG.TODO/include/gconv.h1
-rw-r--r--REORG.TODO/include/getopt.h1
-rw-r--r--REORG.TODO/include/getopt_int.h1
-rw-r--r--REORG.TODO/include/glob.h17
-rw-r--r--REORG.TODO/include/gmp.h35
-rw-r--r--REORG.TODO/include/gnu-versions.h52
-rw-r--r--REORG.TODO/include/gnu/libc-version.h34
-rw-r--r--REORG.TODO/include/gnu/stubs.h2
-rw-r--r--REORG.TODO/include/grp-merge.h7
-rw-r--r--REORG.TODO/include/grp.h64
-rw-r--r--REORG.TODO/include/gshadow.h18
-rw-r--r--REORG.TODO/include/iconv.h1
-rw-r--r--REORG.TODO/include/ifaddrs.h37
-rw-r--r--REORG.TODO/include/ifunc-impl-list.h56
-rw-r--r--REORG.TODO/include/inline-hashtab.h234
-rw-r--r--REORG.TODO/include/langinfo.h12
-rw-r--r--REORG.TODO/include/libc-diag.h74
-rw-r--r--REORG.TODO/include/libc-internal.h56
-rw-r--r--REORG.TODO/include/libc-pointer-arith.h60
-rw-r--r--REORG.TODO/include/libc-symbols.h969
-rw-r--r--REORG.TODO/include/libgen.h1
-rw-r--r--REORG.TODO/include/libintl.h53
-rw-r--r--REORG.TODO/include/libio.h45
-rw-r--r--REORG.TODO/include/limits.h192
-rw-r--r--REORG.TODO/include/link.h351
-rw-r--r--REORG.TODO/include/list.h99
-rw-r--r--REORG.TODO/include/list_t.h31
-rw-r--r--REORG.TODO/include/locale.h26
-rw-r--r--REORG.TODO/include/malloc.h16
-rw-r--r--REORG.TODO/include/math.h60
-rw-r--r--REORG.TODO/include/mcheck.h11
-rw-r--r--REORG.TODO/include/memory.h1
-rw-r--r--REORG.TODO/include/mntent.h20
-rw-r--r--REORG.TODO/include/monetary.h7
-rw-r--r--REORG.TODO/include/mqueue.h13
-rw-r--r--REORG.TODO/include/net/if.h16
-rw-r--r--REORG.TODO/include/netdb.h284
-rw-r--r--REORG.TODO/include/netgroup.h1
-rw-r--r--REORG.TODO/include/netinet/ether.h45
-rw-r--r--REORG.TODO/include/netinet/in.h15
-rw-r--r--REORG.TODO/include/nl_types.h1
-rw-r--r--REORG.TODO/include/nss.h17
-rw-r--r--REORG.TODO/include/nsswitch.h1
-rw-r--r--REORG.TODO/include/obstack.h9
-rw-r--r--REORG.TODO/include/poll.h1
-rw-r--r--REORG.TODO/include/printf.h20
-rw-r--r--REORG.TODO/include/programs/xmalloc.h33
-rw-r--r--REORG.TODO/include/protocols/routed.h1
-rw-r--r--REORG.TODO/include/protocols/rwhod.h1
-rw-r--r--REORG.TODO/include/protocols/talkd.h1
-rw-r--r--REORG.TODO/include/protocols/timed.h1
-rw-r--r--REORG.TODO/include/pthread.h16
-rw-r--r--REORG.TODO/include/pty.h9
-rw-r--r--REORG.TODO/include/pwd.h57
-rw-r--r--REORG.TODO/include/regex.h45
-rw-r--r--REORG.TODO/include/resolv.h99
-rw-r--r--REORG.TODO/include/rounding-mode.h65
-rw-r--r--REORG.TODO/include/rpc/auth.h47
-rw-r--r--REORG.TODO/include/rpc/auth_des.h38
-rw-r--r--REORG.TODO/include/rpc/auth_unix.h9
-rw-r--r--REORG.TODO/include/rpc/clnt.h33
-rw-r--r--REORG.TODO/include/rpc/des_crypt.h18
-rw-r--r--REORG.TODO/include/rpc/key_prot.h18
-rw-r--r--REORG.TODO/include/rpc/netdb.h54
-rw-r--r--REORG.TODO/include/rpc/pmap_clnt.h24
-rw-r--r--REORG.TODO/include/rpc/pmap_prot.h10
-rw-r--r--REORG.TODO/include/rpc/pmap_rmt.h10
-rw-r--r--REORG.TODO/include/rpc/rpc.h69
-rw-r--r--REORG.TODO/include/rpc/rpc_msg.h20
-rw-r--r--REORG.TODO/include/rpc/svc.h43
-rw-r--r--REORG.TODO/include/rpc/svc_auth.h15
-rw-r--r--REORG.TODO/include/rpc/types.h1
-rw-r--r--REORG.TODO/include/rpc/xdr.h53
-rw-r--r--REORG.TODO/include/rpcsvc/nis.h1
-rw-r--r--REORG.TODO/include/rpcsvc/nis_callback.h10
-rw-r--r--REORG.TODO/include/rpcsvc/nis_tags.h1
-rw-r--r--REORG.TODO/include/rpcsvc/nislib.h83
-rw-r--r--REORG.TODO/include/rpcsvc/yp.h33
-rw-r--r--REORG.TODO/include/rpcsvc/ypclnt.h22
-rw-r--r--REORG.TODO/include/rpcsvc/ypupd.h11
-rw-r--r--REORG.TODO/include/sched.h27
-rw-r--r--REORG.TODO/include/scratch_buffer.h136
-rw-r--r--REORG.TODO/include/search.h28
-rw-r--r--REORG.TODO/include/set-hooks.h70
-rw-r--r--REORG.TODO/include/setjmp.h33
-rw-r--r--REORG.TODO/include/sgtty.h1
-rw-r--r--REORG.TODO/include/shadow.h53
-rw-r--r--REORG.TODO/include/shlib-compat.h100
-rw-r--r--REORG.TODO/include/signal.h62
-rw-r--r--REORG.TODO/include/spawn.h1
-rw-r--r--REORG.TODO/include/stab.h1
-rw-r--r--REORG.TODO/include/stackinfo.h42
-rw-r--r--REORG.TODO/include/stap-probe.h77
-rw-r--r--REORG.TODO/include/stdc-predef.h62
-rw-r--r--REORG.TODO/include/stdio.h185
-rw-r--r--REORG.TODO/include/stdio_ext.h23
-rw-r--r--REORG.TODO/include/stdlib.h268
-rw-r--r--REORG.TODO/include/string.h192
-rw-r--r--REORG.TODO/include/strings.h1
-rw-r--r--REORG.TODO/include/stropts.h1
-rw-r--r--REORG.TODO/include/stubs-prologue.h14
-rw-r--r--REORG.TODO/include/sys/auxv.h1
-rw-r--r--REORG.TODO/include/sys/bitypes.h1
-rw-r--r--REORG.TODO/include/sys/cdefs.h18
-rw-r--r--REORG.TODO/include/sys/dir.h1
-rw-r--r--REORG.TODO/include/sys/epoll.h9
-rw-r--r--REORG.TODO/include/sys/errno.h1
-rw-r--r--REORG.TODO/include/sys/fcntl.h1
-rw-r--r--REORG.TODO/include/sys/file.h10
-rw-r--r--REORG.TODO/include/sys/gmon.h19
-rw-r--r--REORG.TODO/include/sys/gmon_out.h1
-rw-r--r--REORG.TODO/include/sys/ioctl.h10
-rw-r--r--REORG.TODO/include/sys/ipc.h1
-rw-r--r--REORG.TODO/include/sys/mman.h25
-rw-r--r--REORG.TODO/include/sys/msg.h11
-rw-r--r--REORG.TODO/include/sys/param.h1
-rw-r--r--REORG.TODO/include/sys/poll.h11
-rw-r--r--REORG.TODO/include/sys/prctl.h9
-rw-r--r--REORG.TODO/include/sys/profil.h12
-rw-r--r--REORG.TODO/include/sys/queue.h1
-rw-r--r--REORG.TODO/include/sys/resource.h27
-rw-r--r--REORG.TODO/include/sys/select.h18
-rw-r--r--REORG.TODO/include/sys/sem.h1
-rw-r--r--REORG.TODO/include/sys/sendfile.h1
-rw-r--r--REORG.TODO/include/sys/shm.h1
-rw-r--r--REORG.TODO/include/sys/signal.h1
-rw-r--r--REORG.TODO/include/sys/socket.h158
-rw-r--r--REORG.TODO/include/sys/stat.h62
-rw-r--r--REORG.TODO/include/sys/statfs.h14
-rw-r--r--REORG.TODO/include/sys/statvfs.h12
-rw-r--r--REORG.TODO/include/sys/sysctl.h13
-rw-r--r--REORG.TODO/include/sys/sysinfo.h24
-rw-r--r--REORG.TODO/include/sys/syslog.h11
-rw-r--r--REORG.TODO/include/sys/sysmacros.h1
-rw-r--r--REORG.TODO/include/sys/termios.h1
-rw-r--r--REORG.TODO/include/sys/time.h43
-rw-r--r--REORG.TODO/include/sys/timeb.h1
-rw-r--r--REORG.TODO/include/sys/times.h8
-rw-r--r--REORG.TODO/include/sys/types.h1
-rw-r--r--REORG.TODO/include/sys/uio.h17
-rw-r--r--REORG.TODO/include/sys/un.h1
-rw-r--r--REORG.TODO/include/sys/unistd.h1
-rw-r--r--REORG.TODO/include/sys/utsname.h14
-rw-r--r--REORG.TODO/include/sys/vlimit.h1
-rw-r--r--REORG.TODO/include/sys/vtimes.h1
-rw-r--r--REORG.TODO/include/sys/wait.h19
-rw-r--r--REORG.TODO/include/sys/xattr.h1
-rw-r--r--REORG.TODO/include/syscall.h1
-rw-r--r--REORG.TODO/include/sysexits.h1
-rw-r--r--REORG.TODO/include/syslog.h1
-rw-r--r--REORG.TODO/include/tar.h1
-rw-r--r--REORG.TODO/include/termios.h15
-rw-r--r--REORG.TODO/include/tgmath.h1
-rw-r--r--REORG.TODO/include/time.h106
-rw-r--r--REORG.TODO/include/ttyent.h14
-rw-r--r--REORG.TODO/include/uchar.h1
-rw-r--r--REORG.TODO/include/ucontext.h1
-rw-r--r--REORG.TODO/include/ulimit.h8
-rw-r--r--REORG.TODO/include/unistd.h193
-rw-r--r--REORG.TODO/include/utime.h9
-rw-r--r--REORG.TODO/include/utmp.h24
-rw-r--r--REORG.TODO/include/values.h68
-rw-r--r--REORG.TODO/include/wchar.h220
-rw-r--r--REORG.TODO/include/wctype.h74
-rw-r--r--REORG.TODO/include/wordexp.h9
-rw-r--r--REORG.TODO/include/xlocale.h1
251 files changed, 9123 insertions, 0 deletions
diff --git a/REORG.TODO/include/aio.h b/REORG.TODO/include/aio.h
new file mode 100644
index 0000000000..90c74f9951
--- /dev/null
+++ b/REORG.TODO/include/aio.h
@@ -0,0 +1,14 @@
+#ifndef _AIO_H
+#include <rt/aio.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern void __aio_init (const struct aioinit *__init);
+
+/* Flag to signal we need to be compatible with glibc < 2.4 in
+ lio_listio and we do not issue events for each individual list
+ element. */
+#define LIO_NO_INDIVIDUAL_EVENT 128
+#endif
+
+#endif
diff --git a/REORG.TODO/include/aliases.h b/REORG.TODO/include/aliases.h
new file mode 100644
index 0000000000..ece69ebe43
--- /dev/null
+++ b/REORG.TODO/include/aliases.h
@@ -0,0 +1,40 @@
+#ifndef _ALIASES_H
+#include <inet/aliases.h>
+
+# ifndef _ISOMAC
+
+extern int __getaliasent_r (struct aliasent *__restrict __result_buf,
+ char *__restrict __buffer, size_t __buflen,
+ struct aliasent **__restrict __result)
+ attribute_hidden;
+extern int __old_getaliasent_r (struct aliasent *__restrict __result_buf,
+ char *__restrict __buffer, size_t __buflen,
+ struct aliasent **__restrict __result);
+
+extern int __getaliasbyname_r (const char *__restrict __name,
+ struct aliasent *__restrict __result_buf,
+ char *__restrict __buffer, size_t __buflen,
+ struct aliasent **__restrict __result);
+extern int __old_getaliasbyname_r (const char *__restrict __name,
+ struct aliasent *__restrict __result_buf,
+ char *__restrict __buffer, size_t __buflen,
+ struct aliasent **__restrict __result);
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setaliasent (void); \
+extern enum nss_status _nss_ ## service ## _endaliasent (void); \
+extern enum nss_status _nss_ ## service ## _getaliasent_r \
+ (struct aliasent *alias, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ## _getaliasbyname_r \
+ (const char *name, struct aliasent *alias, \
+ char *buffer, size_t buflen, int *errnop);
+
+
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+#undef DECLARE_NSS_PROTOTYPES
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/alloca.h b/REORG.TODO/include/alloca.h
new file mode 100644
index 0000000000..fd90664f0a
--- /dev/null
+++ b/REORG.TODO/include/alloca.h
@@ -0,0 +1,80 @@
+#ifndef _ALLOCA_H
+
+#include <stdlib/alloca.h>
+
+# ifndef _ISOMAC
+
+#include <stackinfo.h>
+
+#undef __alloca
+
+/* Now define the internal interfaces. */
+extern void *__alloca (size_t __size);
+
+#ifdef __GNUC__
+# define __alloca(size) __builtin_alloca (size)
+#endif /* GCC. */
+
+extern int __libc_use_alloca (size_t size) __attribute__ ((const));
+extern int __libc_alloca_cutoff (size_t size) __attribute__ ((const));
+libc_hidden_proto (__libc_alloca_cutoff)
+
+#define __MAX_ALLOCA_CUTOFF 65536
+
+#include <allocalim.h>
+
+#ifndef stackinfo_alloca_round
+# define stackinfo_alloca_round(l) (((l) + 15) & -16)
+#endif
+
+#if _STACK_GROWS_DOWN
+# define extend_alloca(buf, len, newlen) \
+ (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \
+ char *__newbuf = __alloca (__newlen); \
+ if (__newbuf + __newlen == (char *) (buf)) \
+ len += __newlen; \
+ else \
+ len = __newlen; \
+ __newbuf; })
+#elif _STACK_GROWS_UP
+# define extend_alloca(buf, len, newlen) \
+ (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \
+ char *__newbuf = __alloca (__newlen); \
+ char *__buf = (char *) (buf); \
+ if (__buf + len == __newbuf) \
+ { \
+ len += __newlen; \
+ __newbuf = __buf; \
+ } \
+ else \
+ len = __newlen; \
+ __newbuf; })
+#else
+# define extend_alloca(buf, len, newlen) \
+ __alloca (((len) = (newlen)))
+#endif
+
+#if defined stackinfo_get_sp && defined stackinfo_sub_sp
+# define alloca_account(size, avar) \
+ ({ void *old__ = stackinfo_get_sp (); \
+ void *m__ = __alloca (size); \
+ avar += stackinfo_sub_sp (old__); \
+ m__; })
+# define extend_alloca_account(buf, len, newlen, avar) \
+ ({ void *old__ = stackinfo_get_sp (); \
+ void *m__ = extend_alloca (buf, len, newlen); \
+ avar += stackinfo_sub_sp (old__); \
+ m__; })
+#else
+# define alloca_account(size, avar) \
+ ({ size_t s__ = (size); \
+ avar += s__; \
+ __alloca (s__); })
+# define extend_alloca_account(buf, len, newlen, avar) \
+ ({ size_t s__ = (newlen); \
+ avar += s__; \
+ extend_alloca (buf, len, s__); })
+#endif
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/argp.h b/REORG.TODO/include/argp.h
new file mode 100644
index 0000000000..92be5f90f1
--- /dev/null
+++ b/REORG.TODO/include/argp.h
@@ -0,0 +1 @@
+#include <argp/argp.h>
diff --git a/REORG.TODO/include/argz.h b/REORG.TODO/include/argz.h
new file mode 100644
index 0000000000..0388c23277
--- /dev/null
+++ b/REORG.TODO/include/argz.h
@@ -0,0 +1,12 @@
+#ifndef _ARGZ_H
+
+#include <string/argz.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (argz_delete)
+libc_hidden_proto (__argz_count)
+libc_hidden_proto (__argz_stringify)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/arpa/ftp.h b/REORG.TODO/include/arpa/ftp.h
new file mode 100644
index 0000000000..c716d68156
--- /dev/null
+++ b/REORG.TODO/include/arpa/ftp.h
@@ -0,0 +1 @@
+#include <inet/arpa/ftp.h>
diff --git a/REORG.TODO/include/arpa/inet.h b/REORG.TODO/include/arpa/inet.h
new file mode 100644
index 0000000000..c3f28f2baa
--- /dev/null
+++ b/REORG.TODO/include/arpa/inet.h
@@ -0,0 +1,15 @@
+#include <inet/arpa/inet.h>
+
+#ifndef _ISOMAC
+extern int __inet_aton (const char *__cp, struct in_addr *__inp);
+libc_hidden_proto (__inet_aton)
+
+libc_hidden_proto (inet_aton)
+libc_hidden_proto (inet_ntop)
+libc_hidden_proto (inet_pton)
+extern __typeof (inet_pton) __inet_pton;
+libc_hidden_proto (__inet_pton)
+extern __typeof (inet_makeaddr) __inet_makeaddr;
+libc_hidden_proto (__inet_makeaddr)
+libc_hidden_proto (inet_netof)
+#endif
diff --git a/REORG.TODO/include/arpa/nameser.h b/REORG.TODO/include/arpa/nameser.h
new file mode 100644
index 0000000000..7a8290e1f2
--- /dev/null
+++ b/REORG.TODO/include/arpa/nameser.h
@@ -0,0 +1,83 @@
+#ifndef _ARPA_NAMESER_H_
+
+#include <resolv/arpa/nameser.h>
+
+# ifndef _ISOMAC
+
+/* If the machine allows unaligned access we can do better than using
+ the NS_GET16, NS_GET32, NS_PUT16, and NS_PUT32 macros from the
+ installed header. */
+#include <string.h>
+#include <stdint.h>
+#include <netinet/in.h>
+
+extern const struct _ns_flagdata _ns_flagdata[] attribute_hidden;
+
+#if _STRING_ARCH_unaligned
+
+# undef NS_GET16
+# define NS_GET16(s, cp) \
+ do { \
+ const uint16_t *t_cp = (const uint16_t *) (cp); \
+ (s) = ntohs (*t_cp); \
+ (cp) += NS_INT16SZ; \
+ } while (0)
+
+# undef NS_GET32
+# define NS_GET32(l, cp) \
+ do { \
+ const uint32_t *t_cp = (const uint32_t *) (cp); \
+ (l) = ntohl (*t_cp); \
+ (cp) += NS_INT32SZ; \
+ } while (0)
+
+# undef NS_PUT16
+# define NS_PUT16(s, cp) \
+ do { \
+ uint16_t *t_cp = (uint16_t *) (cp); \
+ *t_cp = htons (s); \
+ (cp) += NS_INT16SZ; \
+ } while (0)
+
+# undef NS_PUT32
+# define NS_PUT32(l, cp) \
+ do { \
+ uint32_t *t_cp = (uint32_t *) (cp); \
+ *t_cp = htonl (l); \
+ (cp) += NS_INT32SZ; \
+ } while (0)
+
+#endif
+
+extern unsigned int __ns_get16 (const unsigned char *) __THROW;
+extern unsigned long __ns_get32 (const unsigned char *) __THROW;
+int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+int __ns_name_unpack (const unsigned char *, const unsigned char *,
+ const unsigned char *, unsigned char *, size_t) __THROW;
+
+#define ns_msg_getflag(handle, flag) \
+ (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
+
+libresolv_hidden_proto (ns_get16)
+libresolv_hidden_proto (ns_get32)
+libresolv_hidden_proto (ns_put16)
+libresolv_hidden_proto (ns_put32)
+libresolv_hidden_proto (ns_initparse)
+libresolv_hidden_proto (ns_skiprr)
+libresolv_hidden_proto (ns_parserr)
+libresolv_hidden_proto (ns_name_ntop)
+libresolv_hidden_proto (ns_name_pton)
+libresolv_hidden_proto (ns_name_pack)
+libresolv_hidden_proto (ns_name_skip)
+libresolv_hidden_proto (ns_name_unpack)
+libresolv_hidden_proto (ns_name_compress)
+libresolv_hidden_proto (ns_name_uncompress)
+libresolv_hidden_proto (ns_sprintrr)
+libresolv_hidden_proto (ns_sprintrrf)
+libresolv_hidden_proto (ns_samedomain)
+libresolv_hidden_proto (ns_samename)
+libresolv_hidden_proto (ns_makecanon)
+libresolv_hidden_proto (ns_format_ttl)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/arpa/nameser_compat.h b/REORG.TODO/include/arpa/nameser_compat.h
new file mode 100644
index 0000000000..f7d0e043c6
--- /dev/null
+++ b/REORG.TODO/include/arpa/nameser_compat.h
@@ -0,0 +1,11 @@
+#ifndef _ARPA_NAMESER_COMPAT_
+#include <resolv/arpa/nameser_compat.h>
+
+# ifndef _ISOMAC
+
+/* The number is outside the 16-bit RR type range and is used
+ internally by the implementation. */
+#define T_QUERY_A_AND_AAAA 439963904
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/arpa/telnet.h b/REORG.TODO/include/arpa/telnet.h
new file mode 100644
index 0000000000..742c04cfe3
--- /dev/null
+++ b/REORG.TODO/include/arpa/telnet.h
@@ -0,0 +1 @@
+#include <inet/arpa/telnet.h>
diff --git a/REORG.TODO/include/arpa/tftp.h b/REORG.TODO/include/arpa/tftp.h
new file mode 100644
index 0000000000..21d5197f24
--- /dev/null
+++ b/REORG.TODO/include/arpa/tftp.h
@@ -0,0 +1 @@
+#include <inet/arpa/tftp.h>
diff --git a/REORG.TODO/include/assert.h b/REORG.TODO/include/assert.h
new file mode 100644
index 0000000000..c452667956
--- /dev/null
+++ b/REORG.TODO/include/assert.h
@@ -0,0 +1,27 @@
+#include <assert/assert.h>
+
+#ifndef _ISOMAC
+/* This prints an "Assertion failed" message and aborts.
+ In installed assert.h this is only conditionally declared,
+ so it has to be repeated here. */
+extern void __assert_fail (const char *__assertion, const char *__file,
+ unsigned int __line, const char *__function)
+ __THROW __attribute__ ((__noreturn__));
+
+/* Likewise, but prints the error text for ERRNUM. */
+extern void __assert_perror_fail (int __errnum, const char *__file,
+ unsigned int __line,
+ const char *__function)
+ __THROW __attribute__ ((__noreturn__));
+
+/* The real implementation of the two functions above. */
+extern void __assert_fail_base (const char *fmt, const char *assertion,
+ const char *file, unsigned int line,
+ const char *function)
+ __THROW __attribute__ ((__noreturn__));
+
+# if IS_IN (libc) || IS_IN (rtld)
+hidden_proto (__assert_fail)
+hidden_proto (__assert_perror_fail)
+# endif
+#endif
diff --git a/REORG.TODO/include/atomic.h b/REORG.TODO/include/atomic.h
new file mode 100644
index 0000000000..d002b117bf
--- /dev/null
+++ b/REORG.TODO/include/atomic.h
@@ -0,0 +1,829 @@
+/* Internal macros for atomic operations for GNU C Library.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _ATOMIC_H
+#define _ATOMIC_H 1
+
+/* This header defines three types of macros:
+
+ - atomic arithmetic and logic operation on memory. They all
+ have the prefix "atomic_".
+
+ - conditionally atomic operations of the same kinds. These
+ always behave identical but can be faster when atomicity
+ is not really needed since only one thread has access to
+ the memory location. In that case the code is slower in
+ the multi-thread case. The interfaces have the prefix
+ "catomic_".
+
+ - support functions like barriers. They also have the prefix
+ "atomic_".
+
+ Architectures must provide a few lowlevel macros (the compare
+ and exchange definitions). All others are optional. They
+ should only be provided if the architecture has specific
+ support for the operation.
+
+ As <atomic.h> macros are usually heavily nested and often use local
+ variables to make sure side-effects are evaluated properly, use for
+ macro local variables a per-macro unique prefix. This file uses
+ __atgN_ prefix where N is different in each macro. */
+
+#include <stdlib.h>
+
+#include <atomic-machine.h>
+
+/* Wrapper macros to call pre_NN_post (mem, ...) where NN is the
+ bit width of *MEM. The calling macro puts parens around MEM
+ and following args. */
+#define __atomic_val_bysize(pre, post, mem, ...) \
+ ({ \
+ __typeof ((__typeof (*(mem))) *(mem)) __atg1_result; \
+ if (sizeof (*mem) == 1) \
+ __atg1_result = pre##_8_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 2) \
+ __atg1_result = pre##_16_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 4) \
+ __atg1_result = pre##_32_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 8) \
+ __atg1_result = pre##_64_##post (mem, __VA_ARGS__); \
+ else \
+ abort (); \
+ __atg1_result; \
+ })
+#define __atomic_bool_bysize(pre, post, mem, ...) \
+ ({ \
+ int __atg2_result; \
+ if (sizeof (*mem) == 1) \
+ __atg2_result = pre##_8_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 2) \
+ __atg2_result = pre##_16_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 4) \
+ __atg2_result = pre##_32_##post (mem, __VA_ARGS__); \
+ else if (sizeof (*mem) == 8) \
+ __atg2_result = pre##_64_##post (mem, __VA_ARGS__); \
+ else \
+ abort (); \
+ __atg2_result; \
+ })
+
+
+/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
+ Return the old *MEM value. */
+#if !defined atomic_compare_and_exchange_val_acq \
+ && defined __arch_compare_and_exchange_val_32_acq
+# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __atomic_val_bysize (__arch_compare_and_exchange_val,acq, \
+ mem, newval, oldval)
+#endif
+
+
+#ifndef catomic_compare_and_exchange_val_acq
+# ifdef __arch_c_compare_and_exchange_val_32_acq
+# define catomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ __atomic_val_bysize (__arch_c_compare_and_exchange_val,acq, \
+ mem, newval, oldval)
+# else
+# define catomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+ atomic_compare_and_exchange_val_acq (mem, newval, oldval)
+# endif
+#endif
+
+
+#ifndef catomic_compare_and_exchange_val_rel
+# ifndef atomic_compare_and_exchange_val_rel
+# define catomic_compare_and_exchange_val_rel(mem, newval, oldval) \
+ catomic_compare_and_exchange_val_acq (mem, newval, oldval)
+# else
+# define catomic_compare_and_exchange_val_rel(mem, newval, oldval) \
+ atomic_compare_and_exchange_val_rel (mem, newval, oldval)
+# endif
+#endif
+
+
+#ifndef atomic_compare_and_exchange_val_rel
+# define atomic_compare_and_exchange_val_rel(mem, newval, oldval) \
+ atomic_compare_and_exchange_val_acq (mem, newval, oldval)
+#endif
+
+
+/* Atomically store NEWVAL in *MEM if *MEM is equal to OLDVAL.
+ Return zero if *MEM was changed or non-zero if no exchange happened. */
+#ifndef atomic_compare_and_exchange_bool_acq
+# ifdef __arch_compare_and_exchange_bool_32_acq
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool,acq, \
+ mem, newval, oldval)
+# else
+# define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ ({ /* Cannot use __oldval here, because macros later in this file might \
+ call this macro with __oldval argument. */ \
+ __typeof (oldval) __atg3_old = (oldval); \
+ atomic_compare_and_exchange_val_acq (mem, newval, __atg3_old) \
+ != __atg3_old; \
+ })
+# endif
+#endif
+
+
+#ifndef catomic_compare_and_exchange_bool_acq
+# ifdef __arch_c_compare_and_exchange_bool_32_acq
+# define catomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ __atomic_bool_bysize (__arch_c_compare_and_exchange_bool,acq, \
+ mem, newval, oldval)
+# else
+# define catomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+ ({ /* Cannot use __oldval here, because macros later in this file might \
+ call this macro with __oldval argument. */ \
+ __typeof (oldval) __atg4_old = (oldval); \
+ catomic_compare_and_exchange_val_acq (mem, newval, __atg4_old) \
+ != __atg4_old; \
+ })
+# endif
+#endif
+
+
+/* Store NEWVALUE in *MEM and return the old value. */
+#ifndef atomic_exchange_acq
+# define atomic_exchange_acq(mem, newvalue) \
+ ({ __typeof ((__typeof (*(mem))) *(mem)) __atg5_oldval; \
+ __typeof (mem) __atg5_memp = (mem); \
+ __typeof ((__typeof (*(mem))) *(mem)) __atg5_value = (newvalue); \
+ \
+ do \
+ __atg5_oldval = *__atg5_memp; \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
+ __atg5_oldval), 0)); \
+ \
+ __atg5_oldval; })
+#endif
+
+#ifndef atomic_exchange_rel
+# define atomic_exchange_rel(mem, newvalue) atomic_exchange_acq (mem, newvalue)
+#endif
+
+
+/* Add VALUE to *MEM and return the old value of *MEM. */
+#ifndef atomic_exchange_and_add_acq
+# ifdef atomic_exchange_and_add
+# define atomic_exchange_and_add_acq(mem, value) \
+ atomic_exchange_and_add (mem, value)
+# else
+# define atomic_exchange_and_add_acq(mem, value) \
+ ({ __typeof (*(mem)) __atg6_oldval; \
+ __typeof (mem) __atg6_memp = (mem); \
+ __typeof (*(mem)) __atg6_value = (value); \
+ \
+ do \
+ __atg6_oldval = *__atg6_memp; \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg6_memp, \
+ __atg6_oldval \
+ + __atg6_value, \
+ __atg6_oldval), 0)); \
+ \
+ __atg6_oldval; })
+# endif
+#endif
+
+#ifndef atomic_exchange_and_add_rel
+# define atomic_exchange_and_add_rel(mem, value) \
+ atomic_exchange_and_add_acq(mem, value)
+#endif
+
+#ifndef atomic_exchange_and_add
+# define atomic_exchange_and_add(mem, value) \
+ atomic_exchange_and_add_acq(mem, value)
+#endif
+
+#ifndef catomic_exchange_and_add
+# define catomic_exchange_and_add(mem, value) \
+ ({ __typeof (*(mem)) __atg7_oldv; \
+ __typeof (mem) __atg7_memp = (mem); \
+ __typeof (*(mem)) __atg7_value = (value); \
+ \
+ do \
+ __atg7_oldv = *__atg7_memp; \
+ while (__builtin_expect \
+ (catomic_compare_and_exchange_bool_acq (__atg7_memp, \
+ __atg7_oldv \
+ + __atg7_value, \
+ __atg7_oldv), 0)); \
+ \
+ __atg7_oldv; })
+#endif
+
+
+#ifndef atomic_max
+# define atomic_max(mem, value) \
+ do { \
+ __typeof (*(mem)) __atg8_oldval; \
+ __typeof (mem) __atg8_memp = (mem); \
+ __typeof (*(mem)) __atg8_value = (value); \
+ do { \
+ __atg8_oldval = *__atg8_memp; \
+ if (__atg8_oldval >= __atg8_value) \
+ break; \
+ } while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg8_memp, __atg8_value,\
+ __atg8_oldval), 0)); \
+ } while (0)
+#endif
+
+
+#ifndef catomic_max
+# define catomic_max(mem, value) \
+ do { \
+ __typeof (*(mem)) __atg9_oldv; \
+ __typeof (mem) __atg9_memp = (mem); \
+ __typeof (*(mem)) __atg9_value = (value); \
+ do { \
+ __atg9_oldv = *__atg9_memp; \
+ if (__atg9_oldv >= __atg9_value) \
+ break; \
+ } while (__builtin_expect \
+ (catomic_compare_and_exchange_bool_acq (__atg9_memp, \
+ __atg9_value, \
+ __atg9_oldv), 0)); \
+ } while (0)
+#endif
+
+
+#ifndef atomic_min
+# define atomic_min(mem, value) \
+ do { \
+ __typeof (*(mem)) __atg10_oldval; \
+ __typeof (mem) __atg10_memp = (mem); \
+ __typeof (*(mem)) __atg10_value = (value); \
+ do { \
+ __atg10_oldval = *__atg10_memp; \
+ if (__atg10_oldval <= __atg10_value) \
+ break; \
+ } while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg10_memp, \
+ __atg10_value, \
+ __atg10_oldval), 0)); \
+ } while (0)
+#endif
+
+
+#ifndef atomic_add
+# define atomic_add(mem, value) (void) atomic_exchange_and_add ((mem), (value))
+#endif
+
+
+#ifndef catomic_add
+# define catomic_add(mem, value) \
+ (void) catomic_exchange_and_add ((mem), (value))
+#endif
+
+
+#ifndef atomic_increment
+# define atomic_increment(mem) atomic_add ((mem), 1)
+#endif
+
+
+#ifndef catomic_increment
+# define catomic_increment(mem) catomic_add ((mem), 1)
+#endif
+
+
+#ifndef atomic_increment_val
+# define atomic_increment_val(mem) (atomic_exchange_and_add ((mem), 1) + 1)
+#endif
+
+
+#ifndef catomic_increment_val
+# define catomic_increment_val(mem) (catomic_exchange_and_add ((mem), 1) + 1)
+#endif
+
+
+/* Add one to *MEM and return true iff it's now zero. */
+#ifndef atomic_increment_and_test
+# define atomic_increment_and_test(mem) \
+ (atomic_exchange_and_add ((mem), 1) + 1 == 0)
+#endif
+
+
+#ifndef atomic_decrement
+# define atomic_decrement(mem) atomic_add ((mem), -1)
+#endif
+
+
+#ifndef catomic_decrement
+# define catomic_decrement(mem) catomic_add ((mem), -1)
+#endif
+
+
+#ifndef atomic_decrement_val
+# define atomic_decrement_val(mem) (atomic_exchange_and_add ((mem), -1) - 1)
+#endif
+
+
+#ifndef catomic_decrement_val
+# define catomic_decrement_val(mem) (catomic_exchange_and_add ((mem), -1) - 1)
+#endif
+
+
+/* Subtract 1 from *MEM and return true iff it's now zero. */
+#ifndef atomic_decrement_and_test
+# define atomic_decrement_and_test(mem) \
+ (atomic_exchange_and_add ((mem), -1) == 1)
+#endif
+
+
+/* Decrement *MEM if it is > 0, and return the old value. */
+#ifndef atomic_decrement_if_positive
+# define atomic_decrement_if_positive(mem) \
+ ({ __typeof (*(mem)) __atg11_oldval; \
+ __typeof (mem) __atg11_memp = (mem); \
+ \
+ do \
+ { \
+ __atg11_oldval = *__atg11_memp; \
+ if (__glibc_unlikely (__atg11_oldval <= 0)) \
+ break; \
+ } \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg11_memp, \
+ __atg11_oldval - 1, \
+ __atg11_oldval), 0)); \
+ __atg11_oldval; })
+#endif
+
+
+#ifndef atomic_add_negative
+# define atomic_add_negative(mem, value) \
+ ({ __typeof (value) __atg12_value = (value); \
+ atomic_exchange_and_add (mem, __atg12_value) < -__atg12_value; })
+#endif
+
+
+#ifndef atomic_add_zero
+# define atomic_add_zero(mem, value) \
+ ({ __typeof (value) __atg13_value = (value); \
+ atomic_exchange_and_add (mem, __atg13_value) == -__atg13_value; })
+#endif
+
+
+#ifndef atomic_bit_set
+# define atomic_bit_set(mem, bit) \
+ (void) atomic_bit_test_set(mem, bit)
+#endif
+
+
+#ifndef atomic_bit_test_set
+# define atomic_bit_test_set(mem, bit) \
+ ({ __typeof (*(mem)) __atg14_old; \
+ __typeof (mem) __atg14_memp = (mem); \
+ __typeof (*(mem)) __atg14_mask = ((__typeof (*(mem))) 1 << (bit)); \
+ \
+ do \
+ __atg14_old = (*__atg14_memp); \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg14_memp, \
+ __atg14_old | __atg14_mask,\
+ __atg14_old), 0)); \
+ \
+ __atg14_old & __atg14_mask; })
+#endif
+
+/* Atomically *mem &= mask. */
+#ifndef atomic_and
+# define atomic_and(mem, mask) \
+ do { \
+ __typeof (*(mem)) __atg15_old; \
+ __typeof (mem) __atg15_memp = (mem); \
+ __typeof (*(mem)) __atg15_mask = (mask); \
+ \
+ do \
+ __atg15_old = (*__atg15_memp); \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg15_memp, \
+ __atg15_old & __atg15_mask, \
+ __atg15_old), 0)); \
+ } while (0)
+#endif
+
+#ifndef catomic_and
+# define catomic_and(mem, mask) \
+ do { \
+ __typeof (*(mem)) __atg20_old; \
+ __typeof (mem) __atg20_memp = (mem); \
+ __typeof (*(mem)) __atg20_mask = (mask); \
+ \
+ do \
+ __atg20_old = (*__atg20_memp); \
+ while (__builtin_expect \
+ (catomic_compare_and_exchange_bool_acq (__atg20_memp, \
+ __atg20_old & __atg20_mask,\
+ __atg20_old), 0)); \
+ } while (0)
+#endif
+
+/* Atomically *mem &= mask and return the old value of *mem. */
+#ifndef atomic_and_val
+# define atomic_and_val(mem, mask) \
+ ({ __typeof (*(mem)) __atg16_old; \
+ __typeof (mem) __atg16_memp = (mem); \
+ __typeof (*(mem)) __atg16_mask = (mask); \
+ \
+ do \
+ __atg16_old = (*__atg16_memp); \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg16_memp, \
+ __atg16_old & __atg16_mask,\
+ __atg16_old), 0)); \
+ \
+ __atg16_old; })
+#endif
+
+/* Atomically *mem |= mask and return the old value of *mem. */
+#ifndef atomic_or
+# define atomic_or(mem, mask) \
+ do { \
+ __typeof (*(mem)) __atg17_old; \
+ __typeof (mem) __atg17_memp = (mem); \
+ __typeof (*(mem)) __atg17_mask = (mask); \
+ \
+ do \
+ __atg17_old = (*__atg17_memp); \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg17_memp, \
+ __atg17_old | __atg17_mask, \
+ __atg17_old), 0)); \
+ } while (0)
+#endif
+
+#ifndef catomic_or
+# define catomic_or(mem, mask) \
+ do { \
+ __typeof (*(mem)) __atg18_old; \
+ __typeof (mem) __atg18_memp = (mem); \
+ __typeof (*(mem)) __atg18_mask = (mask); \
+ \
+ do \
+ __atg18_old = (*__atg18_memp); \
+ while (__builtin_expect \
+ (catomic_compare_and_exchange_bool_acq (__atg18_memp, \
+ __atg18_old | __atg18_mask,\
+ __atg18_old), 0)); \
+ } while (0)
+#endif
+
+/* Atomically *mem |= mask and return the old value of *mem. */
+#ifndef atomic_or_val
+# define atomic_or_val(mem, mask) \
+ ({ __typeof (*(mem)) __atg19_old; \
+ __typeof (mem) __atg19_memp = (mem); \
+ __typeof (*(mem)) __atg19_mask = (mask); \
+ \
+ do \
+ __atg19_old = (*__atg19_memp); \
+ while (__builtin_expect \
+ (atomic_compare_and_exchange_bool_acq (__atg19_memp, \
+ __atg19_old | __atg19_mask,\
+ __atg19_old), 0)); \
+ \
+ __atg19_old; })
+#endif
+
+#ifndef atomic_full_barrier
+# define atomic_full_barrier() __asm ("" ::: "memory")
+#endif
+
+
+#ifndef atomic_read_barrier
+# define atomic_read_barrier() atomic_full_barrier ()
+#endif
+
+
+#ifndef atomic_write_barrier
+# define atomic_write_barrier() atomic_full_barrier ()
+#endif
+
+
+#ifndef atomic_forced_read
+# define atomic_forced_read(x) \
+ ({ __typeof (x) __x; __asm ("" : "=r" (__x) : "0" (x)); __x; })
+#endif
+
+/* This is equal to 1 iff the architecture supports 64b atomic operations. */
+#ifndef __HAVE_64B_ATOMICS
+#error Unable to determine if 64-bit atomics are present.
+#endif
+
+/* The following functions are a subset of the atomic operations provided by
+ C11. Usually, a function named atomic_OP_MO(args) is equivalent to C11's
+ atomic_OP_explicit(args, memory_order_MO); exceptions noted below. */
+
+/* Each arch can request to use compiler built-ins for C11 atomics. If it
+ does, all atomics will be based on these. */
+#if USE_ATOMIC_COMPILER_BUILTINS
+
+/* We require 32b atomic operations; some archs also support 64b atomic
+ operations. */
+void __atomic_link_error (void);
+# if __HAVE_64B_ATOMICS == 1
+# define __atomic_check_size(mem) \
+ if ((sizeof (*mem) != 4) && (sizeof (*mem) != 8)) \
+ __atomic_link_error ();
+# else
+# define __atomic_check_size(mem) \
+ if (sizeof (*mem) != 4) \
+ __atomic_link_error ();
+# endif
+/* We additionally provide 8b and 16b atomic loads and stores; we do not yet
+ need other atomic operations of such sizes, and restricting the support to
+ loads and stores makes this easier for archs that do not have native
+ support for atomic operations to less-than-word-sized data. */
+# if __HAVE_64B_ATOMICS == 1
+# define __atomic_check_size_ls(mem) \
+ if ((sizeof (*mem) != 1) && (sizeof (*mem) != 2) && (sizeof (*mem) != 4) \
+ && (sizeof (*mem) != 8)) \
+ __atomic_link_error ();
+# else
+# define __atomic_check_size_ls(mem) \
+ if ((sizeof (*mem) != 1) && (sizeof (*mem) != 2) && sizeof (*mem) != 4) \
+ __atomic_link_error ();
+# endif
+
+# define atomic_thread_fence_acquire() \
+ __atomic_thread_fence (__ATOMIC_ACQUIRE)
+# define atomic_thread_fence_release() \
+ __atomic_thread_fence (__ATOMIC_RELEASE)
+# define atomic_thread_fence_seq_cst() \
+ __atomic_thread_fence (__ATOMIC_SEQ_CST)
+
+# define atomic_load_relaxed(mem) \
+ ({ __atomic_check_size_ls((mem)); \
+ __atomic_load_n ((mem), __ATOMIC_RELAXED); })
+# define atomic_load_acquire(mem) \
+ ({ __atomic_check_size_ls((mem)); \
+ __atomic_load_n ((mem), __ATOMIC_ACQUIRE); })
+
+# define atomic_store_relaxed(mem, val) \
+ do { \
+ __atomic_check_size_ls((mem)); \
+ __atomic_store_n ((mem), (val), __ATOMIC_RELAXED); \
+ } while (0)
+# define atomic_store_release(mem, val) \
+ do { \
+ __atomic_check_size_ls((mem)); \
+ __atomic_store_n ((mem), (val), __ATOMIC_RELEASE); \
+ } while (0)
+
+/* On failure, this CAS has memory_order_relaxed semantics. */
+# define atomic_compare_exchange_weak_relaxed(mem, expected, desired) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_compare_exchange_n ((mem), (expected), (desired), 1, \
+ __ATOMIC_RELAXED, __ATOMIC_RELAXED); })
+# define atomic_compare_exchange_weak_acquire(mem, expected, desired) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_compare_exchange_n ((mem), (expected), (desired), 1, \
+ __ATOMIC_ACQUIRE, __ATOMIC_RELAXED); })
+# define atomic_compare_exchange_weak_release(mem, expected, desired) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_compare_exchange_n ((mem), (expected), (desired), 1, \
+ __ATOMIC_RELEASE, __ATOMIC_RELAXED); })
+
+# define atomic_exchange_relaxed(mem, desired) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_exchange_n ((mem), (desired), __ATOMIC_RELAXED); })
+# define atomic_exchange_acquire(mem, desired) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_exchange_n ((mem), (desired), __ATOMIC_ACQUIRE); })
+# define atomic_exchange_release(mem, desired) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_exchange_n ((mem), (desired), __ATOMIC_RELEASE); })
+
+# define atomic_fetch_add_relaxed(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_add ((mem), (operand), __ATOMIC_RELAXED); })
+# define atomic_fetch_add_acquire(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_add ((mem), (operand), __ATOMIC_ACQUIRE); })
+# define atomic_fetch_add_release(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_add ((mem), (operand), __ATOMIC_RELEASE); })
+# define atomic_fetch_add_acq_rel(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_add ((mem), (operand), __ATOMIC_ACQ_REL); })
+
+# define atomic_fetch_and_relaxed(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_and ((mem), (operand), __ATOMIC_RELAXED); })
+# define atomic_fetch_and_acquire(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_and ((mem), (operand), __ATOMIC_ACQUIRE); })
+# define atomic_fetch_and_release(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_and ((mem), (operand), __ATOMIC_RELEASE); })
+
+# define atomic_fetch_or_relaxed(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_or ((mem), (operand), __ATOMIC_RELAXED); })
+# define atomic_fetch_or_acquire(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_or ((mem), (operand), __ATOMIC_ACQUIRE); })
+# define atomic_fetch_or_release(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_or ((mem), (operand), __ATOMIC_RELEASE); })
+
+# define atomic_fetch_xor_release(mem, operand) \
+ ({ __atomic_check_size((mem)); \
+ __atomic_fetch_xor ((mem), (operand), __ATOMIC_RELEASE); })
+
+#else /* !USE_ATOMIC_COMPILER_BUILTINS */
+
+/* By default, we assume that read, write, and full barriers are equivalent
+ to acquire, release, and seq_cst barriers. Archs for which this does not
+ hold have to provide custom definitions of the fences. */
+# ifndef atomic_thread_fence_acquire
+# define atomic_thread_fence_acquire() atomic_read_barrier ()
+# endif
+# ifndef atomic_thread_fence_release
+# define atomic_thread_fence_release() atomic_write_barrier ()
+# endif
+# ifndef atomic_thread_fence_seq_cst
+# define atomic_thread_fence_seq_cst() atomic_full_barrier ()
+# endif
+
+# ifndef atomic_load_relaxed
+# define atomic_load_relaxed(mem) \
+ ({ __typeof ((__typeof (*(mem))) *(mem)) __atg100_val; \
+ __asm ("" : "=r" (__atg100_val) : "0" (*(mem))); \
+ __atg100_val; })
+# endif
+# ifndef atomic_load_acquire
+# define atomic_load_acquire(mem) \
+ ({ __typeof (*(mem)) __atg101_val = atomic_load_relaxed (mem); \
+ atomic_thread_fence_acquire (); \
+ __atg101_val; })
+# endif
+
+# ifndef atomic_store_relaxed
+/* XXX Use inline asm here? */
+# define atomic_store_relaxed(mem, val) do { *(mem) = (val); } while (0)
+# endif
+# ifndef atomic_store_release
+# define atomic_store_release(mem, val) \
+ do { \
+ atomic_thread_fence_release (); \
+ atomic_store_relaxed ((mem), (val)); \
+ } while (0)
+# endif
+
+/* On failure, this CAS has memory_order_relaxed semantics. */
+/* XXX This potentially has one branch more than necessary, but archs
+ currently do not define a CAS that returns both the previous value and
+ the success flag. */
+# ifndef atomic_compare_exchange_weak_acquire
+# define atomic_compare_exchange_weak_acquire(mem, expected, desired) \
+ ({ typeof (*(expected)) __atg102_expected = *(expected); \
+ *(expected) = \
+ atomic_compare_and_exchange_val_acq ((mem), (desired), *(expected)); \
+ *(expected) == __atg102_expected; })
+# endif
+# ifndef atomic_compare_exchange_weak_relaxed
+/* XXX Fall back to CAS with acquire MO because archs do not define a weaker
+ CAS. */
+# define atomic_compare_exchange_weak_relaxed(mem, expected, desired) \
+ atomic_compare_exchange_weak_acquire ((mem), (expected), (desired))
+# endif
+# ifndef atomic_compare_exchange_weak_release
+# define atomic_compare_exchange_weak_release(mem, expected, desired) \
+ ({ typeof (*(expected)) __atg103_expected = *(expected); \
+ *(expected) = \
+ atomic_compare_and_exchange_val_rel ((mem), (desired), *(expected)); \
+ *(expected) == __atg103_expected; })
+# endif
+
+/* XXX Fall back to acquire MO because archs do not define a weaker
+ atomic_exchange. */
+# ifndef atomic_exchange_relaxed
+# define atomic_exchange_relaxed(mem, val) \
+ atomic_exchange_acq ((mem), (val))
+# endif
+# ifndef atomic_exchange_acquire
+# define atomic_exchange_acquire(mem, val) \
+ atomic_exchange_acq ((mem), (val))
+# endif
+# ifndef atomic_exchange_release
+# define atomic_exchange_release(mem, val) \
+ atomic_exchange_rel ((mem), (val))
+# endif
+
+# ifndef atomic_fetch_add_acquire
+# define atomic_fetch_add_acquire(mem, operand) \
+ atomic_exchange_and_add_acq ((mem), (operand))
+# endif
+# ifndef atomic_fetch_add_relaxed
+/* XXX Fall back to acquire MO because the MO semantics of
+ atomic_exchange_and_add are not documented; the generic version falls back
+ to atomic_exchange_and_add_acq if atomic_exchange_and_add is not defined,
+ and vice versa. */
+# define atomic_fetch_add_relaxed(mem, operand) \
+ atomic_fetch_add_acquire ((mem), (operand))
+# endif
+# ifndef atomic_fetch_add_release
+# define atomic_fetch_add_release(mem, operand) \
+ atomic_exchange_and_add_rel ((mem), (operand))
+# endif
+# ifndef atomic_fetch_add_acq_rel
+# define atomic_fetch_add_acq_rel(mem, operand) \
+ ({ atomic_thread_fence_release (); \
+ atomic_exchange_and_add_acq ((mem), (operand)); })
+# endif
+
+/* XXX Fall back to acquire MO because archs do not define a weaker
+ atomic_and_val. */
+# ifndef atomic_fetch_and_relaxed
+# define atomic_fetch_and_relaxed(mem, operand) \
+ atomic_fetch_and_acquire ((mem), (operand))
+# endif
+/* XXX The default for atomic_and_val has acquire semantics, but this is not
+ documented. */
+# ifndef atomic_fetch_and_acquire
+# define atomic_fetch_and_acquire(mem, operand) \
+ atomic_and_val ((mem), (operand))
+# endif
+# ifndef atomic_fetch_and_release
+/* XXX This unnecessarily has acquire MO. */
+# define atomic_fetch_and_release(mem, operand) \
+ ({ atomic_thread_fence_release (); \
+ atomic_and_val ((mem), (operand)); })
+# endif
+
+/* XXX The default for atomic_or_val has acquire semantics, but this is not
+ documented. */
+# ifndef atomic_fetch_or_acquire
+# define atomic_fetch_or_acquire(mem, operand) \
+ atomic_or_val ((mem), (operand))
+# endif
+/* XXX Fall back to acquire MO because archs do not define a weaker
+ atomic_or_val. */
+# ifndef atomic_fetch_or_relaxed
+# define atomic_fetch_or_relaxed(mem, operand) \
+ atomic_fetch_or_acquire ((mem), (operand))
+# endif
+/* XXX Contains an unnecessary acquire MO because archs do not define a weaker
+ atomic_or_val. */
+# ifndef atomic_fetch_or_release
+# define atomic_fetch_or_release(mem, operand) \
+ ({ atomic_thread_fence_release (); \
+ atomic_fetch_or_acquire ((mem), (operand)); })
+# endif
+
+# ifndef atomic_fetch_xor_release
+/* Failing the atomic_compare_exchange_weak_release reloads the value in
+ __atg104_expected, so we need only do the XOR again and retry. */
+# define atomic_fetch_xor_release(mem, operand) \
+ ({ __typeof (mem) __atg104_memp = (mem); \
+ __typeof (*(mem)) __atg104_expected = (*__atg104_memp); \
+ __typeof (*(mem)) __atg104_desired; \
+ __typeof (*(mem)) __atg104_op = (operand); \
+ \
+ do \
+ __atg104_desired = __atg104_expected ^ __atg104_op; \
+ while (__glibc_unlikely \
+ (atomic_compare_exchange_weak_release ( \
+ __atg104_memp, &__atg104_expected, __atg104_desired) \
+ == 0)); \
+ __atg104_expected; })
+#endif
+
+#endif /* !USE_ATOMIC_COMPILER_BUILTINS */
+
+/* This operation does not affect synchronization semantics but can be used
+ in the body of a spin loop to potentially improve its efficiency. */
+#ifndef atomic_spin_nop
+# define atomic_spin_nop() do { /* nothing */ } while (0)
+#endif
+
+/* ATOMIC_EXCHANGE_USES_CAS is non-zero if atomic_exchange operations
+ are implemented based on a CAS loop; otherwise, this is zero and we assume
+ that the atomic_exchange operations could provide better performance
+ than a CAS loop. */
+#ifndef ATOMIC_EXCHANGE_USES_CAS
+# error ATOMIC_EXCHANGE_USES_CAS has to be defined.
+#endif
+
+#endif /* atomic.h */
diff --git a/REORG.TODO/include/bits/cmathcalls.h b/REORG.TODO/include/bits/cmathcalls.h
new file mode 100644
index 0000000000..dd029602f9
--- /dev/null
+++ b/REORG.TODO/include/bits/cmathcalls.h
@@ -0,0 +1 @@
+#include <math/bits/cmathcalls.h>
diff --git a/REORG.TODO/include/bits/dlfcn.h b/REORG.TODO/include/bits/dlfcn.h
new file mode 100644
index 0000000000..47652a11a2
--- /dev/null
+++ b/REORG.TODO/include/bits/dlfcn.h
@@ -0,0 +1,5 @@
+#include_next <bits/dlfcn.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (_dl_mcount_wrapper_check)
+#endif
diff --git a/REORG.TODO/include/bits/error.h b/REORG.TODO/include/bits/error.h
new file mode 100644
index 0000000000..c2c7c9b710
--- /dev/null
+++ b/REORG.TODO/include/bits/error.h
@@ -0,0 +1 @@
+#include "../../misc/bits/error.h"
diff --git a/REORG.TODO/include/bits/fcntl2.h b/REORG.TODO/include/bits/fcntl2.h
new file mode 100644
index 0000000000..832b2c9abb
--- /dev/null
+++ b/REORG.TODO/include/bits/fcntl2.h
@@ -0,0 +1 @@
+#include "../../io/bits/fcntl2.h"
diff --git a/REORG.TODO/include/bits/getopt_core.h b/REORG.TODO/include/bits/getopt_core.h
new file mode 100644
index 0000000000..1200de81b6
--- /dev/null
+++ b/REORG.TODO/include/bits/getopt_core.h
@@ -0,0 +1 @@
+#include <posix/bits/getopt_core.h>
diff --git a/REORG.TODO/include/bits/getopt_ext.h b/REORG.TODO/include/bits/getopt_ext.h
new file mode 100644
index 0000000000..31b99834ea
--- /dev/null
+++ b/REORG.TODO/include/bits/getopt_ext.h
@@ -0,0 +1 @@
+#include <posix/bits/getopt_ext.h>
diff --git a/REORG.TODO/include/bits/getopt_posix.h b/REORG.TODO/include/bits/getopt_posix.h
new file mode 100644
index 0000000000..e3b70c816c
--- /dev/null
+++ b/REORG.TODO/include/bits/getopt_posix.h
@@ -0,0 +1 @@
+#include <posix/bits/getopt_posix.h>
diff --git a/REORG.TODO/include/bits/locale.h b/REORG.TODO/include/bits/locale.h
new file mode 100644
index 0000000000..1f1557a1b8
--- /dev/null
+++ b/REORG.TODO/include/bits/locale.h
@@ -0,0 +1 @@
+#include <locale/bits/locale.h>
diff --git a/REORG.TODO/include/bits/mathcalls-helper-functions.h b/REORG.TODO/include/bits/mathcalls-helper-functions.h
new file mode 100644
index 0000000000..bb71f7fb18
--- /dev/null
+++ b/REORG.TODO/include/bits/mathcalls-helper-functions.h
@@ -0,0 +1 @@
+#include <math/bits/mathcalls-helper-functions.h>
diff --git a/REORG.TODO/include/bits/mathcalls.h b/REORG.TODO/include/bits/mathcalls.h
new file mode 100644
index 0000000000..d75b598cc7
--- /dev/null
+++ b/REORG.TODO/include/bits/mathcalls.h
@@ -0,0 +1 @@
+#include <math/bits/mathcalls.h>
diff --git a/REORG.TODO/include/bits/poll2.h b/REORG.TODO/include/bits/poll2.h
new file mode 100644
index 0000000000..51a0812c1e
--- /dev/null
+++ b/REORG.TODO/include/bits/poll2.h
@@ -0,0 +1 @@
+#include "../../io/bits/poll2.h"
diff --git a/REORG.TODO/include/bits/posix1_lim.h b/REORG.TODO/include/bits/posix1_lim.h
new file mode 100644
index 0000000000..c3c67d1c84
--- /dev/null
+++ b/REORG.TODO/include/bits/posix1_lim.h
@@ -0,0 +1 @@
+#include <posix/bits/posix1_lim.h>
diff --git a/REORG.TODO/include/bits/posix2_lim.h b/REORG.TODO/include/bits/posix2_lim.h
new file mode 100644
index 0000000000..49a539438c
--- /dev/null
+++ b/REORG.TODO/include/bits/posix2_lim.h
@@ -0,0 +1 @@
+#include <posix/bits/posix2_lim.h>
diff --git a/REORG.TODO/include/bits/select2.h b/REORG.TODO/include/bits/select2.h
new file mode 100644
index 0000000000..08f7259647
--- /dev/null
+++ b/REORG.TODO/include/bits/select2.h
@@ -0,0 +1 @@
+#include "../../misc/bits/select2.h"
diff --git a/REORG.TODO/include/bits/setjmp2.h b/REORG.TODO/include/bits/setjmp2.h
new file mode 100644
index 0000000000..bdb222cd2c
--- /dev/null
+++ b/REORG.TODO/include/bits/setjmp2.h
@@ -0,0 +1 @@
+#include <setjmp/bits/setjmp2.h>
diff --git a/REORG.TODO/include/bits/socket2.h b/REORG.TODO/include/bits/socket2.h
new file mode 100644
index 0000000000..a81fd9fa78
--- /dev/null
+++ b/REORG.TODO/include/bits/socket2.h
@@ -0,0 +1 @@
+#include <socket/bits/socket2.h>
diff --git a/REORG.TODO/include/bits/stab.def b/REORG.TODO/include/bits/stab.def
new file mode 100644
index 0000000000..d153eba4de
--- /dev/null
+++ b/REORG.TODO/include/bits/stab.def
@@ -0,0 +1 @@
+#include <misc/bits/stab.def>
diff --git a/REORG.TODO/include/bits/stdlib-float.h b/REORG.TODO/include/bits/stdlib-float.h
new file mode 100644
index 0000000000..54ab571981
--- /dev/null
+++ b/REORG.TODO/include/bits/stdlib-float.h
@@ -0,0 +1,8 @@
+/* No floating-point inline functions in rtld and for the conform tests. */
+#ifdef _ISOMAC
+# include <stdlib/bits/stdlib-float.h>
+#else
+# if !IS_IN (rtld)
+# include <stdlib/bits/stdlib-float.h>
+# endif
+#endif
diff --git a/REORG.TODO/include/bits/stdlib.h b/REORG.TODO/include/bits/stdlib.h
new file mode 100644
index 0000000000..8541e278c7
--- /dev/null
+++ b/REORG.TODO/include/bits/stdlib.h
@@ -0,0 +1 @@
+#include <stdlib/bits/stdlib.h>
diff --git a/REORG.TODO/include/bits/string2.h b/REORG.TODO/include/bits/string2.h
new file mode 100644
index 0000000000..e4c4c709b5
--- /dev/null
+++ b/REORG.TODO/include/bits/string2.h
@@ -0,0 +1 @@
+#include <string/bits/string2.h>
diff --git a/REORG.TODO/include/bits/string3.h b/REORG.TODO/include/bits/string3.h
new file mode 100644
index 0000000000..1ddd981a90
--- /dev/null
+++ b/REORG.TODO/include/bits/string3.h
@@ -0,0 +1 @@
+#include <string/bits/string3.h>
diff --git a/REORG.TODO/include/bits/strings_fortified.h b/REORG.TODO/include/bits/strings_fortified.h
new file mode 100644
index 0000000000..77219c162c
--- /dev/null
+++ b/REORG.TODO/include/bits/strings_fortified.h
@@ -0,0 +1 @@
+#include <string/bits/strings_fortified.h>
diff --git a/REORG.TODO/include/bits/syslog.h b/REORG.TODO/include/bits/syslog.h
new file mode 100644
index 0000000000..060b893482
--- /dev/null
+++ b/REORG.TODO/include/bits/syslog.h
@@ -0,0 +1 @@
+#include <misc/bits/syslog.h>
diff --git a/REORG.TODO/include/bits/types.h b/REORG.TODO/include/bits/types.h
new file mode 100644
index 0000000000..1c47910607
--- /dev/null
+++ b/REORG.TODO/include/bits/types.h
@@ -0,0 +1 @@
+#include <posix/bits/types.h>
diff --git a/REORG.TODO/include/bits/types/FILE.h b/REORG.TODO/include/bits/types/FILE.h
new file mode 100644
index 0000000000..09b599baa0
--- /dev/null
+++ b/REORG.TODO/include/bits/types/FILE.h
@@ -0,0 +1 @@
+#include <libio/bits/types/FILE.h>
diff --git a/REORG.TODO/include/bits/types/__FILE.h b/REORG.TODO/include/bits/types/__FILE.h
new file mode 100644
index 0000000000..236f60bacd
--- /dev/null
+++ b/REORG.TODO/include/bits/types/__FILE.h
@@ -0,0 +1 @@
+#include <libio/bits/types/__FILE.h>
diff --git a/REORG.TODO/include/bits/types/__mbstate_t.h b/REORG.TODO/include/bits/types/__mbstate_t.h
new file mode 100644
index 0000000000..13e764e8c9
--- /dev/null
+++ b/REORG.TODO/include/bits/types/__mbstate_t.h
@@ -0,0 +1 @@
+#include <wcsmbs/bits/types/__mbstate_t.h>
diff --git a/REORG.TODO/include/bits/types/clock_t.h b/REORG.TODO/include/bits/types/clock_t.h
new file mode 100644
index 0000000000..4cfe8e7e8b
--- /dev/null
+++ b/REORG.TODO/include/bits/types/clock_t.h
@@ -0,0 +1 @@
+#include <time/bits/types/clock_t.h>
diff --git a/REORG.TODO/include/bits/types/clockid_t.h b/REORG.TODO/include/bits/types/clockid_t.h
new file mode 100644
index 0000000000..ff7290bb1d
--- /dev/null
+++ b/REORG.TODO/include/bits/types/clockid_t.h
@@ -0,0 +1 @@
+#include <time/bits/types/clockid_t.h>
diff --git a/REORG.TODO/include/bits/types/mbstate_t.h b/REORG.TODO/include/bits/types/mbstate_t.h
new file mode 100644
index 0000000000..99ec08a91a
--- /dev/null
+++ b/REORG.TODO/include/bits/types/mbstate_t.h
@@ -0,0 +1 @@
+#include <wcsmbs/bits/types/mbstate_t.h>
diff --git a/REORG.TODO/include/bits/types/res_state.h b/REORG.TODO/include/bits/types/res_state.h
new file mode 100644
index 0000000000..4b99b68da9
--- /dev/null
+++ b/REORG.TODO/include/bits/types/res_state.h
@@ -0,0 +1 @@
+#include <resolv/bits/types/res_state.h>
diff --git a/REORG.TODO/include/bits/types/sig_atomic_t.h b/REORG.TODO/include/bits/types/sig_atomic_t.h
new file mode 100644
index 0000000000..783693f71c
--- /dev/null
+++ b/REORG.TODO/include/bits/types/sig_atomic_t.h
@@ -0,0 +1 @@
+#include <signal/bits/types/sig_atomic_t.h>
diff --git a/REORG.TODO/include/bits/types/sigset_t.h b/REORG.TODO/include/bits/types/sigset_t.h
new file mode 100644
index 0000000000..20c3dc2095
--- /dev/null
+++ b/REORG.TODO/include/bits/types/sigset_t.h
@@ -0,0 +1 @@
+#include <signal/bits/types/sigset_t.h>
diff --git a/REORG.TODO/include/bits/types/sigval_t.h b/REORG.TODO/include/bits/types/sigval_t.h
new file mode 100644
index 0000000000..296734e827
--- /dev/null
+++ b/REORG.TODO/include/bits/types/sigval_t.h
@@ -0,0 +1 @@
+#include <signal/bits/types/sigval_t.h>
diff --git a/REORG.TODO/include/bits/types/struct_iovec.h b/REORG.TODO/include/bits/types/struct_iovec.h
new file mode 100644
index 0000000000..f8f163f648
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_iovec.h
@@ -0,0 +1 @@
+#include <misc/bits/types/struct_iovec.h>
diff --git a/REORG.TODO/include/bits/types/struct_itimerspec.h b/REORG.TODO/include/bits/types/struct_itimerspec.h
new file mode 100644
index 0000000000..19a3fa3cb8
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_itimerspec.h
@@ -0,0 +1 @@
+#include <time/bits/types/struct_itimerspec.h>
diff --git a/REORG.TODO/include/bits/types/struct_osockaddr.h b/REORG.TODO/include/bits/types/struct_osockaddr.h
new file mode 100644
index 0000000000..fe2561bb1f
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_osockaddr.h
@@ -0,0 +1 @@
+#include <socket/bits/types/struct_osockaddr.h>
diff --git a/REORG.TODO/include/bits/types/struct_sigstack.h b/REORG.TODO/include/bits/types/struct_sigstack.h
new file mode 100644
index 0000000000..2b23fb2837
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_sigstack.h
@@ -0,0 +1 @@
+#include <signal/bits/types/struct_sigstack.h>
diff --git a/REORG.TODO/include/bits/types/struct_timespec.h b/REORG.TODO/include/bits/types/struct_timespec.h
new file mode 100644
index 0000000000..c27417cfd5
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_timespec.h
@@ -0,0 +1 @@
+#include <time/bits/types/struct_timespec.h>
diff --git a/REORG.TODO/include/bits/types/struct_timeval.h b/REORG.TODO/include/bits/types/struct_timeval.h
new file mode 100644
index 0000000000..a5549cbae3
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_timeval.h
@@ -0,0 +1 @@
+#include <time/bits/types/struct_timeval.h>
diff --git a/REORG.TODO/include/bits/types/struct_tm.h b/REORG.TODO/include/bits/types/struct_tm.h
new file mode 100644
index 0000000000..412dd8683a
--- /dev/null
+++ b/REORG.TODO/include/bits/types/struct_tm.h
@@ -0,0 +1 @@
+#include <time/bits/types/struct_tm.h>
diff --git a/REORG.TODO/include/bits/types/time_t.h b/REORG.TODO/include/bits/types/time_t.h
new file mode 100644
index 0000000000..70490c6d05
--- /dev/null
+++ b/REORG.TODO/include/bits/types/time_t.h
@@ -0,0 +1 @@
+#include <time/bits/types/time_t.h>
diff --git a/REORG.TODO/include/bits/types/timer_t.h b/REORG.TODO/include/bits/types/timer_t.h
new file mode 100644
index 0000000000..5a33fa40a4
--- /dev/null
+++ b/REORG.TODO/include/bits/types/timer_t.h
@@ -0,0 +1 @@
+#include <time/bits/types/timer_t.h>
diff --git a/REORG.TODO/include/bits/types/wint_t.h b/REORG.TODO/include/bits/types/wint_t.h
new file mode 100644
index 0000000000..f1e373d294
--- /dev/null
+++ b/REORG.TODO/include/bits/types/wint_t.h
@@ -0,0 +1 @@
+#include <wcsmbs/bits/types/wint_t.h>
diff --git a/REORG.TODO/include/bits/unistd.h b/REORG.TODO/include/bits/unistd.h
new file mode 100644
index 0000000000..1a91dcc72e
--- /dev/null
+++ b/REORG.TODO/include/bits/unistd.h
@@ -0,0 +1 @@
+#include <posix/bits/unistd.h>
diff --git a/REORG.TODO/include/bits/wchar2.h b/REORG.TODO/include/bits/wchar2.h
new file mode 100644
index 0000000000..a18dccfc55
--- /dev/null
+++ b/REORG.TODO/include/bits/wchar2.h
@@ -0,0 +1 @@
+#include <wcsmbs/bits/wchar2.h>
diff --git a/REORG.TODO/include/bits/wctype-wchar.h b/REORG.TODO/include/bits/wctype-wchar.h
new file mode 100644
index 0000000000..8273cd743e
--- /dev/null
+++ b/REORG.TODO/include/bits/wctype-wchar.h
@@ -0,0 +1 @@
+#include <wctype/bits/wctype-wchar.h>
diff --git a/REORG.TODO/include/bits/xopen_lim.h b/REORG.TODO/include/bits/xopen_lim.h
new file mode 100644
index 0000000000..2ae7cb3652
--- /dev/null
+++ b/REORG.TODO/include/bits/xopen_lim.h
@@ -0,0 +1,145 @@
+/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/*
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+/* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
+ System Interfaces and Headers, 4.16 <limits.h>
+
+ Please note only the values which are not greater than the minimum
+ stated in the standard document are listed. The `sysconf' functions
+ should be used to obtain the actual value. */
+
+#ifndef _XOPEN_LIM_H
+#define _XOPEN_LIM_H 1
+
+#define __need_IOV_MAX
+#include <bits/stdio_lim.h>
+
+/* We do not provide fixed values for
+
+ ARG_MAX Maximum length of argument to the `exec' function
+ including environment data.
+
+ ATEXIT_MAX Maximum number of functions that may be registered
+ with `atexit'.
+
+ CHILD_MAX Maximum number of simultaneous processes per real
+ user ID.
+
+ OPEN_MAX Maximum number of files that one process can have open
+ at anyone time.
+
+ PAGESIZE
+ PAGE_SIZE Size of bytes of a page.
+
+ PASS_MAX Maximum number of significant bytes in a password.
+
+ We only provide a fixed limit for
+
+ IOV_MAX Maximum number of `iovec' structures that one process has
+ available for use with `readv' or writev'.
+
+ if this is indeed fixed by the underlying system.
+*/
+
+
+/* Maximum number of `iovec' structures that one process has available
+ for use with `readv' or writev'. */
+#define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
+
+
+/* Maximum value of `digit' in calls to the `printf' and `scanf'
+ functions. We have no limit, so return a reasonable value. */
+#define NL_ARGMAX _POSIX_ARG_MAX
+
+/* Maximum number of bytes in a `LANG' name. We have no limit. */
+#define NL_LANGMAX _POSIX2_LINE_MAX
+
+/* Maximum message number. We have no limit. */
+#define NL_MSGMAX INT_MAX
+
+/* Maximum number of bytes in N-to-1 collation mapping. We have no
+ limit. */
+#if defined __USE_GNU || !defined __USE_XOPEN2K8
+# define NL_NMAX INT_MAX
+#endif
+
+/* Maximum set number. We have no limit. */
+#define NL_SETMAX INT_MAX
+
+/* Maximum number of bytes in a message. We have no limit. */
+#define NL_TEXTMAX INT_MAX
+
+/* Default process priority. */
+#define NZERO 20
+
+
+/* Number of bits in a word of type `int'. */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+# define WORD_BIT 16
+# else
+# if INT_MAX == 2147483647
+# define WORD_BIT 32
+# else
+/* Safe assumption. */
+# define WORD_BIT 64
+# endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+# define WORD_BIT 16
+# else
+# if __INT_MAX__ == 2147483647
+# define WORD_BIT 32
+# else
+/* Safe assumption. */
+# define WORD_BIT 64
+# endif
+# endif
+#else
+# define WORD_BIT 32
+#endif
+
+/* Number of bits in a word of type `long int'. */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+# define LONG_BIT 32
+# else
+/* Safe assumption. */
+# define LONG_BIT 64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+# define LONG_BIT 32
+# else
+/* Safe assumption. */
+# define LONG_BIT 64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+# define LONG_BIT 64
+# else
+# define LONG_BIT 32
+# endif
+#endif
+
+#endif /* bits/xopen_lim.h */
diff --git a/REORG.TODO/include/byteswap.h b/REORG.TODO/include/byteswap.h
new file mode 100644
index 0000000000..44507de954
--- /dev/null
+++ b/REORG.TODO/include/byteswap.h
@@ -0,0 +1 @@
+#include <string/byteswap.h>
diff --git a/REORG.TODO/include/caller.h b/REORG.TODO/include/caller.h
new file mode 100644
index 0000000000..64715e0487
--- /dev/null
+++ b/REORG.TODO/include/caller.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 2004-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _CALLER_H
+#define _CALLER_H 1
+
+#include <ldsodefs.h>
+
+/* _dl_check_caller only works in DSOs. */
+#ifdef SHARED
+# define __check_caller(caller, mask) \
+ GLRO(dl_check_caller) (caller, mask)
+#else
+# define __check_caller(caller, mask) (0)
+#endif
+
+#endif /* caller.h */
diff --git a/REORG.TODO/include/complex.h b/REORG.TODO/include/complex.h
new file mode 100644
index 0000000000..2c86709ced
--- /dev/null
+++ b/REORG.TODO/include/complex.h
@@ -0,0 +1,16 @@
+#ifndef _COMPLEX_H
+# include <math/complex.h>
+
+# ifndef _ISOMAC
+/* Return the complex inverse hyperbolic sine of finite nonzero Z,
+ with the imaginary part of the result subtracted from pi/2 if ADJ
+ is nonzero. */
+extern complex float __kernel_casinhf (complex float z, int adj);
+extern complex double __kernel_casinh (complex double z, int adj);
+extern complex long double __kernel_casinhl (complex long double z, int adj);
+# if __HAVE_DISTINCT_FLOAT128
+extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
+# endif
+# endif
+
+#endif
diff --git a/REORG.TODO/include/cpio.h b/REORG.TODO/include/cpio.h
new file mode 100644
index 0000000000..38e2ed1b62
--- /dev/null
+++ b/REORG.TODO/include/cpio.h
@@ -0,0 +1 @@
+#include <posix/cpio.h>
diff --git a/REORG.TODO/include/crypt.h b/REORG.TODO/include/crypt.h
new file mode 100644
index 0000000000..544551da21
--- /dev/null
+++ b/REORG.TODO/include/crypt.h
@@ -0,0 +1,3 @@
+#ifndef _CRYPT_H
+# include <crypt/crypt.h>
+#endif /* _CRYPT_H */
diff --git a/REORG.TODO/include/ctype.h b/REORG.TODO/include/ctype.h
new file mode 100644
index 0000000000..ac6db790b7
--- /dev/null
+++ b/REORG.TODO/include/ctype.h
@@ -0,0 +1,67 @@
+#ifndef _CTYPE_H
+
+#include <ctype/ctype.h>
+
+#ifndef _ISOMAC
+/* Initialize ctype locale data. */
+extern void __ctype_init (void);
+libc_hidden_proto (__ctype_init)
+
+/* ctype/ctype.h defined this as a macro and we don't want to #undef it.
+ So defeat macro expansion with parens for this declaration. */
+extern int (__isctype) (int __c, int __mask);
+
+# if IS_IN (libc)
+
+/* These accessors are used by the optimized macros to find the
+ thread-local cache of ctype information from the current thread's
+ locale. For inside libc, define them as inlines using the _NL_CURRENT
+ accessors. We don't use _NL_CURRENT_LOCALE->__ctype_b here because we
+ want to cause a link-time ref to _nl_current_LC_CTYPE under
+ NL_CURRENT_INDIRECT. */
+
+# include "../locale/localeinfo.h"
+# include <libc-tsd.h>
+
+# ifndef CTYPE_EXTERN_INLINE /* Used by ctype/ctype-info.c, which see. */
+# define CTYPE_EXTERN_INLINE extern inline
+# endif
+
+__libc_tsd_define (extern, const uint16_t *, CTYPE_B)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOUPPER)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOLOWER)
+
+
+CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
+__ctype_b_loc (void)
+{
+ return __libc_tsd_address (const uint16_t *, CTYPE_B);
+}
+
+CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
+__ctype_toupper_loc (void)
+{
+ return __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+}
+
+CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
+__ctype_tolower_loc (void)
+{
+ return __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+}
+
+# ifndef __NO_CTYPE
+/* The spec says that isdigit must only match the decimal digits. We
+ can check this without a memory access. */
+# undef isdigit
+# define isdigit(c) ({ int __c = (c); __c >= '0' && __c <= '9'; })
+# undef isdigit_l
+# define isdigit_l(c, l) ({ int __c = (c); __c >= '0' && __c <= '9'; })
+# undef __isdigit_l
+# define __isdigit_l(c, l) ({ int __c = (c); __c >= '0' && __c <= '9'; })
+# endif /* Not __NO_CTYPE. */
+
+# endif /* IS_IN (libc). */
+#endif /* Not _ISOMAC. */
+
+#endif /* ctype.h */
diff --git a/REORG.TODO/include/des.h b/REORG.TODO/include/des.h
new file mode 100644
index 0000000000..a519b6f681
--- /dev/null
+++ b/REORG.TODO/include/des.h
@@ -0,0 +1 @@
+#include <sunrpc/rpc/rpc_des.h>
diff --git a/REORG.TODO/include/dirent.h b/REORG.TODO/include/dirent.h
new file mode 100644
index 0000000000..c792e53c96
--- /dev/null
+++ b/REORG.TODO/include/dirent.h
@@ -0,0 +1,88 @@
+#ifndef _DIRENT_H
+# ifndef _ISOMAC
+# include <dirstream.h>
+# endif
+# include <dirent/dirent.h>
+# ifndef _ISOMAC
+# include <sys/stat.h>
+# include <stdbool.h>
+
+struct scandir_cancel_struct
+{
+ DIR *dp;
+ void *v;
+ size_t cnt;
+};
+
+/* Now define the internal interfaces. */
+extern DIR *__opendir (const char *__name);
+extern DIR *__opendirat (int dfd, const char *__name)
+ internal_function attribute_hidden;
+extern DIR *__fdopendir (int __fd);
+extern int __closedir (DIR *__dirp);
+extern struct dirent *__readdir (DIR *__dirp);
+extern struct dirent64 *__readdir64 (DIR *__dirp);
+extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
+ struct dirent **__result);
+extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
+ struct dirent64 **__result);
+extern int __scandir64 (const char * __dir,
+ struct dirent64 *** __namelist,
+ int (*__selector) (const struct dirent64 *),
+ int (*__cmp) (const struct dirent64 **,
+ const struct dirent64 **));
+extern __ssize_t __getdirentries (int __fd, char *__restrict __buf,
+ size_t __nbytes,
+ __off_t *__restrict __basep)
+ __THROW __nonnull ((2, 4));
+extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
+ internal_function attribute_hidden;
+extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
+ internal_function attribute_hidden;
+extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
+ __attribute_pure__;
+extern int __versionsort64 (const struct dirent64 **a,
+ const struct dirent64 **b)
+ __attribute_pure__;
+extern DIR *__alloc_dir (int fd, bool close_fd, int flags,
+ const struct stat64 *statp)
+ internal_function attribute_hidden;
+extern __typeof (rewinddir) __rewinddir;
+
+extern void __scandir_cancel_handler (void *arg) attribute_hidden;
+extern int __scandir_tail (DIR *dp,
+ struct dirent ***namelist,
+ int (*select) (const struct dirent *),
+ int (*cmp) (const struct dirent **,
+ const struct dirent **))
+ internal_function attribute_hidden;
+# ifdef _DIRENT_MATCHES_DIRENT64
+# define __scandir64_tail (dp, namelist, select, cmp) \
+ __scandir_tail (dp, (struct dirent ***) (namelist), \
+ (int (*) (const struct dirent *)) (select), \
+ (int (*) (const struct dirent **, \
+ const struct dirent **)) (cmp))
+# else
+extern int __scandir64_tail (DIR *dp,
+ struct dirent64 ***namelist,
+ int (*select) (const struct dirent64 *),
+ int (*cmp) (const struct dirent64 **,
+ const struct dirent64 **))
+ internal_function attribute_hidden;
+# endif
+
+libc_hidden_proto (__rewinddir)
+extern __typeof (scandirat) __scandirat;
+libc_hidden_proto (__scandirat)
+libc_hidden_proto (scandirat64)
+
+# if IS_IN (rtld)
+extern __typeof (__closedir) __closedir attribute_hidden;
+extern __typeof (__fdopendir) __fdopendir attribute_hidden;
+extern __typeof (__readdir) __readdir attribute_hidden;
+extern __typeof (__readdir64) __readdir64 attribute_hidden;
+extern __typeof (__rewinddir) __rewinddir attribute_hidden;
+# endif
+# endif
+
+#endif
diff --git a/REORG.TODO/include/dlfcn.h b/REORG.TODO/include/dlfcn.h
new file mode 100644
index 0000000000..2524292ebc
--- /dev/null
+++ b/REORG.TODO/include/dlfcn.h
@@ -0,0 +1,140 @@
+#ifndef _DLFCN_H
+#include <dlfcn/dlfcn.h>
+#ifndef _ISOMAC
+#include <link.h> /* For ElfW. */
+#include <stdbool.h>
+
+/* Internally used flag. */
+#define __RTLD_DLOPEN 0x80000000
+#define __RTLD_SPROF 0x40000000
+#define __RTLD_OPENEXEC 0x20000000
+#define __RTLD_CALLMAP 0x10000000
+#define __RTLD_AUDIT 0x08000000
+#define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */
+#define __RTLD_NOIFUNC 0x02000000 /* Suppress calling ifunc functions. */
+
+#define __LM_ID_CALLER -2
+
+#ifdef SHARED
+/* Locally stored program arguments. */
+extern int __dlfcn_argc attribute_hidden;
+extern char **__dlfcn_argv attribute_hidden;
+#else
+/* These variables are defined and initialized in the startup code. */
+extern int __libc_argc attribute_hidden;
+extern char **__libc_argv attribute_hidden;
+
+# define __dlfcn_argc __libc_argc
+# define __dlfcn_argv __libc_argv
+#endif
+
+
+/* Now define the internal interfaces. */
+
+#define __libc_dlopen(name) \
+ __libc_dlopen_mode (name, RTLD_LAZY | __RTLD_DLOPEN)
+extern void *__libc_dlopen_mode (const char *__name, int __mode);
+extern void *__libc_dlsym (void *__map, const char *__name);
+extern int __libc_dlclose (void *__map);
+libc_hidden_proto (__libc_dlopen_mode)
+libc_hidden_proto (__libc_dlsym)
+libc_hidden_proto (__libc_dlclose)
+
+/* Locate shared object containing the given address. */
+#ifdef ElfW
+extern int _dl_addr (const void *address, Dl_info *info,
+ struct link_map **mapp, const ElfW(Sym) **symbolp)
+ internal_function;
+libc_hidden_proto (_dl_addr)
+#endif
+
+struct link_map;
+
+/* Close an object previously opened by _dl_open. */
+extern void _dl_close (void *map) attribute_hidden;
+/* Same as above, but without locking and safety checks for user
+ provided map arguments. */
+extern void _dl_close_worker (struct link_map *map, bool force)
+ attribute_hidden;
+
+/* Look up NAME in shared object HANDLE (which may be RTLD_DEFAULT or
+ RTLD_NEXT). WHO is the calling function, for RTLD_NEXT. Returns
+ the symbol value, which may be NULL. */
+extern void *_dl_sym (void *handle, const char *name, void *who)
+ internal_function;
+
+/* Look up version VERSION of symbol NAME in shared object HANDLE
+ (which may be RTLD_DEFAULT or RTLD_NEXT). WHO is the calling
+ function, for RTLD_NEXT. Returns the symbol value, which may be
+ NULL. */
+extern void *_dl_vsym (void *handle, const char *name, const char *version,
+ void *who)
+ internal_function;
+
+/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
+ _dl_catch_error. Returns zero for success, nonzero for failure; and
+ arranges for `dlerror' to return the error details.
+ ARGS is passed as argument to OPERATE. */
+extern int _dlerror_run (void (*operate) (void *), void *args)
+ internal_function;
+
+#ifdef SHARED
+# define DL_CALLER_DECL /* Nothing */
+# define DL_CALLER RETURN_ADDRESS (0)
+#else
+# define DL_CALLER_DECL , void *dl_caller
+# define DL_CALLER dl_caller
+#endif
+
+struct dlfcn_hook
+{
+ void *(*dlopen) (const char *file, int mode, void *dl_caller);
+ int (*dlclose) (void *handle);
+ void *(*dlsym) (void *handle, const char *name, void *dl_caller);
+ void *(*dlvsym) (void *handle, const char *name, const char *version,
+ void *dl_caller);
+ char *(*dlerror) (void);
+ int (*dladdr) (const void *address, Dl_info *info);
+ int (*dladdr1) (const void *address, Dl_info *info,
+ void **extra_info, int flags);
+ int (*dlinfo) (void *handle, int request, void *arg, void *dl_caller);
+ void *(*dlmopen) (Lmid_t nsid, const char *file, int mode, void *dl_caller);
+ void *pad[4];
+};
+
+extern struct dlfcn_hook *_dlfcn_hook;
+libdl_hidden_proto (_dlfcn_hook)
+
+extern void *__dlopen (const char *file, int mode DL_CALLER_DECL)
+ attribute_hidden;
+extern void *__dlmopen (Lmid_t nsid, const char *file, int mode DL_CALLER_DECL)
+ attribute_hidden;
+extern int __dlclose (void *handle)
+ attribute_hidden;
+extern void *__dlsym (void *handle, const char *name DL_CALLER_DECL)
+ attribute_hidden;
+extern void *__dlvsym (void *handle, const char *name, const char *version
+ DL_CALLER_DECL)
+ attribute_hidden;
+extern char *__dlerror (void)
+ attribute_hidden;
+extern int __dladdr (const void *address, Dl_info *info)
+ attribute_hidden;
+extern int __dladdr1 (const void *address, Dl_info *info,
+ void **extra_info, int flags)
+ attribute_hidden;
+extern int __dlinfo (void *handle, int request, void *arg DL_CALLER_DECL)
+ attribute_hidden;
+
+#ifndef SHARED
+struct link_map;
+extern void * __libc_dlsym_private (struct link_map *map, const char *name)
+ attribute_hidden;
+extern void __libc_register_dl_open_hook (struct link_map *map)
+ attribute_hidden;
+extern void __libc_register_dlfcn_hook (struct link_map *map)
+ attribute_hidden;
+#endif
+#endif
+
+#endif
diff --git a/REORG.TODO/include/elf.h b/REORG.TODO/include/elf.h
new file mode 100644
index 0000000000..f06a33f256
--- /dev/null
+++ b/REORG.TODO/include/elf.h
@@ -0,0 +1,17 @@
+#ifndef _ELF_H
+#include <elf/elf.h>
+
+# ifndef _ISOMAC
+
+/* Some information which is not meant for the public and therefore not
+ in <elf.h>. */
+# include <dl-dtprocnum.h>
+# ifdef DT_1_SUPPORTED_MASK
+# error DT_1_SUPPORTED_MASK is defined!
+# endif
+# define DT_1_SUPPORTED_MASK \
+ (DF_1_NOW | DF_1_NODELETE | DF_1_INITFIRST | DF_1_NOOPEN \
+ | DF_1_ORIGIN | DF_1_NODEFLIB)
+
+# endif /* !_ISOMAC */
+#endif /* elf.h */
diff --git a/REORG.TODO/include/endian.h b/REORG.TODO/include/endian.h
new file mode 100644
index 0000000000..e6313ba994
--- /dev/null
+++ b/REORG.TODO/include/endian.h
@@ -0,0 +1,17 @@
+#include <string/endian.h>
+
+#if defined _LIBC && !defined _ISOMAC
+# if __FLOAT_WORD_ORDER == __BIG_ENDIAN
+# define BIG_ENDI 1
+# undef LITTLE_ENDI
+# define HIGH_HALF 0
+# define LOW_HALF 1
+# else
+# if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
+# undef BIG_ENDI
+# define LITTLE_ENDI 1
+# define HIGH_HALF 1
+# define LOW_HALF 0
+# endif
+# endif
+#endif
diff --git a/REORG.TODO/include/envz.h b/REORG.TODO/include/envz.h
new file mode 100644
index 0000000000..633fcc6f40
--- /dev/null
+++ b/REORG.TODO/include/envz.h
@@ -0,0 +1,11 @@
+#ifndef _ENVZ_H
+
+#include <string/envz.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (envz_entry)
+libc_hidden_proto (envz_remove)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/err.h b/REORG.TODO/include/err.h
new file mode 100644
index 0000000000..382855938e
--- /dev/null
+++ b/REORG.TODO/include/err.h
@@ -0,0 +1,14 @@
+#ifndef _ERR_H
+#include <misc/err.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (warn)
+libc_hidden_proto (warnx)
+libc_hidden_proto (vwarn)
+libc_hidden_proto (vwarnx)
+libc_hidden_proto (verr)
+libc_hidden_proto (verrx)
+
+# endif /* !_ISOMAC */
+#endif /* err.h */
diff --git a/REORG.TODO/include/errno.h b/REORG.TODO/include/errno.h
new file mode 100644
index 0000000000..73fc32e5e0
--- /dev/null
+++ b/REORG.TODO/include/errno.h
@@ -0,0 +1,52 @@
+#ifndef _ERRNO_H
+
+#include <stdlib/errno.h>
+
+#if defined _ERRNO_H && !defined _ISOMAC
+
+# if IS_IN (rtld)
+# include <dl-sysdep.h>
+# ifndef RTLD_PRIVATE_ERRNO
+# error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
+# endif
+# else
+# define RTLD_PRIVATE_ERRNO 0
+# endif
+
+# if RTLD_PRIVATE_ERRNO
+/* The dynamic linker uses its own private errno variable.
+ All access to errno inside the dynamic linker is serialized,
+ so a single (hidden) global variable is all it needs. */
+
+# undef errno
+# define errno rtld_errno
+extern int rtld_errno attribute_hidden;
+
+# elif IS_IN_LIB
+
+# include <tls.h>
+
+# undef errno
+# if IS_IN (libc)
+# define errno __libc_errno
+# else
+# define errno errno /* For #ifndef errno tests. */
+# endif
+extern __thread int errno attribute_tls_model_ie;
+
+# endif /* IS_IN_LIB */
+
+# define __set_errno(val) (errno = (val))
+
+# ifndef __ASSEMBLER__
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+# if RTLD_PRIVATE_ERRNO
+ attribute_hidden
+# endif
+;
+libc_hidden_proto (__errno_location)
+# endif
+
+#endif /* _ERRNO_H */
+
+#endif /* ! _ERRNO_H */
diff --git a/REORG.TODO/include/error.h b/REORG.TODO/include/error.h
new file mode 100644
index 0000000000..70f3192fa6
--- /dev/null
+++ b/REORG.TODO/include/error.h
@@ -0,0 +1 @@
+#include <misc/error.h>
diff --git a/REORG.TODO/include/execinfo.h b/REORG.TODO/include/execinfo.h
new file mode 100644
index 0000000000..0b132b089f
--- /dev/null
+++ b/REORG.TODO/include/execinfo.h
@@ -0,0 +1,16 @@
+#ifndef _EXECINFO_H
+#include <debug/execinfo.h>
+
+# ifndef _ISOMAC
+
+extern int __backtrace (void **__array, int __size);
+libc_hidden_proto (__backtrace)
+
+extern char **__backtrace_symbols (void *const *__array, int __size);
+
+extern void __backtrace_symbols_fd (void *const *__array, int __size,
+ int __fd);
+libc_hidden_proto (__backtrace_symbols_fd)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/fcntl.h b/REORG.TODO/include/fcntl.h
new file mode 100644
index 0000000000..9a007c358c
--- /dev/null
+++ b/REORG.TODO/include/fcntl.h
@@ -0,0 +1,41 @@
+#ifndef _FCNTL_H
+#include <io/fcntl.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __open64 (const char *__file, int __oflag, ...);
+libc_hidden_proto (__open64)
+extern int __libc_open64 (const char *file, int oflag, ...);
+extern int __libc_open (const char *file, int oflag, ...);
+libc_hidden_proto (__libc_open)
+extern int __libc_fcntl (int fd, int cmd, ...) attribute_hidden;
+#ifndef NO_CANCELLATION
+extern int __fcntl_nocancel (int fd, int cmd, ...) attribute_hidden;
+libc_hidden_proto (__libc_fcntl)
+#endif
+extern int __open (const char *__file, int __oflag, ...);
+libc_hidden_proto (__open)
+extern int __fcntl (int __fd, int __cmd, ...);
+libc_hidden_proto (__fcntl)
+extern int __openat (int __fd, const char *__file, int __oflag, ...)
+ __nonnull ((2));
+libc_hidden_proto (__openat)
+extern int __openat64 (int __fd, const char *__file, int __oflag, ...)
+ __nonnull ((2));
+libc_hidden_proto (__openat64)
+
+extern int __open_2 (const char *__path, int __oflag);
+extern int __open64_2 (const char *__path, int __oflag);
+extern int __openat_2 (int __fd, const char *__path, int __oflag);
+extern int __openat64_2 (int __fd, const char *__path, int __oflag);
+
+
+#if IS_IN (rtld)
+# include <dl-fcntl.h>
+#endif
+
+/* Flag determining whether the *at system calls are available. */
+extern int __have_atfcts attribute_hidden;
+#endif
+
+#endif
diff --git a/REORG.TODO/include/features.h b/REORG.TODO/include/features.h
new file mode 100644
index 0000000000..972cbd2b5d
--- /dev/null
+++ b/REORG.TODO/include/features.h
@@ -0,0 +1,450 @@
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _FEATURES_H
+#define _FEATURES_H 1
+
+/* These are defined by the user (or the compiler)
+ to specify the desired environment:
+
+ __STRICT_ANSI__ ISO Standard C.
+ _ISOC99_SOURCE Extensions to ISO C89 from ISO C99.
+ _ISOC11_SOURCE Extensions to ISO C99 from ISO C11.
+ __STDC_WANT_LIB_EXT2__
+ Extensions to ISO C99 from TR 27431-2:2010.
+ __STDC_WANT_IEC_60559_BFP_EXT__
+ Extensions to ISO C11 from TS 18661-1:2014.
+ __STDC_WANT_IEC_60559_FUNCS_EXT__
+ Extensions to ISO C11 from TS 18661-4:2015.
+ __STDC_WANT_IEC_60559_TYPES_EXT__
+ Extensions to ISO C11 from TS 18661-3:2015.
+
+ _POSIX_SOURCE IEEE Std 1003.1.
+ _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
+ if >=199309L, add IEEE Std 1003.1b-1993;
+ if >=199506L, add IEEE Std 1003.1c-1995;
+ if >=200112L, all of IEEE 1003.1-2004
+ if >=200809L, all of IEEE 1003.1-2008
+ _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
+ Single Unix conformance is wanted, to 600 for the
+ sixth revision, to 700 for the seventh revision.
+ _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
+ _LARGEFILE_SOURCE Some more functions for correct standard I/O.
+ _LARGEFILE64_SOURCE Additional functionality from LFS for large files.
+ _FILE_OFFSET_BITS=N Select default filesystem interface.
+ _ATFILE_SOURCE Additional *at interfaces.
+ _GNU_SOURCE All of the above, plus GNU extensions.
+ _DEFAULT_SOURCE The default set of features (taking precedence over
+ __STRICT_ANSI__).
+
+ _FORTIFY_SOURCE Add security hardening to many library functions.
+ Set to 1 or 2; 2 performs stricter checks than 1.
+
+ _REENTRANT, _THREAD_SAFE
+ Obsolete; equivalent to _POSIX_C_SOURCE=199506L.
+
+ The `-ansi' switch to the GNU C compiler, and standards conformance
+ options such as `-std=c99', define __STRICT_ANSI__. If none of
+ these are defined, or if _DEFAULT_SOURCE is defined, the default is
+ to have _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
+ 200809L, as well as enabling miscellaneous functions from BSD and
+ SVID. If more than one of these are defined, they accumulate. For
+ example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE together
+ give you ISO C, 1003.1, and 1003.2, but nothing else.
+
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
+ __GLIBC_USE (F) Define things from feature set F. This is defined
+ to 1 or 0; the subsequent macros are either defined
+ or undefined, and those tests should be moved to
+ __GLIBC_USE.
+ __USE_ISOC11 Define ISO C11 things.
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+ __USE_POSIX2 Define IEEE Std 1003.2 things.
+ __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things.
+ __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things.
+ __USE_XOPEN Define XPG things.
+ __USE_XOPEN_EXTENDED Define X/Open Unix things.
+ __USE_UNIX98 Define Single Unix V2 things.
+ __USE_XOPEN2K Define XPG6 things.
+ __USE_XOPEN2KXSI Define XPG6 XSI things.
+ __USE_XOPEN2K8 Define XPG7 things.
+ __USE_XOPEN2K8XSI Define XPG7 XSI things.
+ __USE_LARGEFILE Define correct standard I/O things.
+ __USE_LARGEFILE64 Define LFS things with separate names.
+ __USE_FILE_OFFSET64 Define 64bit interface as default.
+ __USE_MISC Define things from 4.3BSD or System V Unix.
+ __USE_ATFILE Define *at interfaces and AT_* constants for them.
+ __USE_GNU Define GNU extensions.
+ __USE_FORTIFY_LEVEL Additional security measures used, according to level.
+
+ The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
+ defined by this file unconditionally. `__GNU_LIBRARY__' is provided
+ only for compatibility. All new code should use the other symbols
+ to test for features.
+
+ All macros listed above as possibly being defined by this file are
+ explicitly undefined if they are not explicitly defined.
+ Feature-test macros that are not defined by the user or compiler
+ but are implied by the other feature-test macros defined (or by the
+ lack of any definitions) are defined by the file.
+
+ ISO C feature test macros depend on the definition of the macro
+ when an affected header is included, not when the first system
+ header is included, and so they are handled in
+ <bits/libc-header-start.h>, which does not have a multiple include
+ guard. Feature test macros that can be handled from the first
+ system header included are handled here. */
+
+
+/* Undefine everything, so we get a clean slate. */
+#undef __USE_ISOC11
+#undef __USE_ISOC99
+#undef __USE_ISOC95
+#undef __USE_ISOCXX11
+#undef __USE_POSIX
+#undef __USE_POSIX2
+#undef __USE_POSIX199309
+#undef __USE_POSIX199506
+#undef __USE_XOPEN
+#undef __USE_XOPEN_EXTENDED
+#undef __USE_UNIX98
+#undef __USE_XOPEN2K
+#undef __USE_XOPEN2KXSI
+#undef __USE_XOPEN2K8
+#undef __USE_XOPEN2K8XSI
+#undef __USE_LARGEFILE
+#undef __USE_LARGEFILE64
+#undef __USE_FILE_OFFSET64
+#undef __USE_MISC
+#undef __USE_ATFILE
+#undef __USE_GNU
+#undef __USE_FORTIFY_LEVEL
+#undef __KERNEL_STRICT_NAMES
+#undef __GLIBC_USE_DEPRECATED_GETS
+
+/* Suppress kernel-name space pollution unless user expressedly asks
+ for it. */
+#ifndef _LOOSE_KERNEL_NAMES
+# define __KERNEL_STRICT_NAMES
+#endif
+
+/* Convenience macro to test the version of gcc.
+ Use like this:
+ #if __GNUC_PREREQ (2,8)
+ ... code requiring gcc 2.8 or later ...
+ #endif
+ Note: only works for GCC 2.0 and later, because __GNUC_MINOR__ was
+ added in 2.0. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
+
+/* Similarly for clang. Features added to GCC after version 4.2 may
+ or may not also be available in clang, and clang's definitions of
+ __GNUC(_MINOR)__ are fixed at 4 and 2 respectively. Not all such
+ features can be queried via __has_extension/__has_feature. */
+#if defined __clang_major__ && defined __clang_minor__
+# define __glibc_clang_prereq(maj, min) \
+ ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
+#else
+# define __glibc_clang_prereq(maj, min) 0
+#endif
+
+/* Whether to use feature set F. */
+#define __GLIBC_USE(F) __GLIBC_USE_ ## F
+
+/* _BSD_SOURCE and _SVID_SOURCE are deprecated aliases for
+ _DEFAULT_SOURCE. If _DEFAULT_SOURCE is present we do not
+ issue a warning; the expectation is that the source is being
+ transitioned to use the new macro. */
+#if (defined _BSD_SOURCE || defined _SVID_SOURCE) \
+ && !defined _DEFAULT_SOURCE
+# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+# undef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
+/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
+#ifdef _GNU_SOURCE
+# undef _ISOC95_SOURCE
+# define _ISOC95_SOURCE 1
+# undef _ISOC99_SOURCE
+# define _ISOC99_SOURCE 1
+# undef _ISOC11_SOURCE
+# define _ISOC11_SOURCE 1
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+# undef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 700
+# undef _XOPEN_SOURCE_EXTENDED
+# define _XOPEN_SOURCE_EXTENDED 1
+# undef _LARGEFILE64_SOURCE
+# define _LARGEFILE64_SOURCE 1
+# undef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
+#endif
+
+/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
+ define _DEFAULT_SOURCE. */
+#if (defined _DEFAULT_SOURCE \
+ || (!defined __STRICT_ANSI__ \
+ && !defined _ISOC99_SOURCE \
+ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \
+ && !defined _XOPEN_SOURCE))
+# undef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE 1
+#endif
+
+/* This is to enable the ISO C11 extension. */
+#if (defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
+# define __USE_ISOC11 1
+#endif
+
+/* This is to enable the ISO C99 extension. */
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+# define __USE_ISOC99 1
+#endif
+
+/* This is to enable the ISO C90 Amendment 1:1995 extension. */
+#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L))
+# define __USE_ISOC95 1
+#endif
+
+/* This is to enable compatibility for ISO C++11.
+
+ So far g++ does not provide a macro. Check the temporary macro for
+ now, too. */
+#if ((defined __cplusplus && __cplusplus >= 201103L) \
+ || defined __GXX_EXPERIMENTAL_CXX0X__)
+# define __USE_ISOCXX11 1
+#endif
+
+/* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE
+ is defined, use POSIX.1-2008 (or another version depending on
+ _XOPEN_SOURCE). */
+#ifdef _DEFAULT_SOURCE
+# if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE
+# define __USE_POSIX_IMPLICITLY 1
+# endif
+# undef _POSIX_SOURCE
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200809L
+#endif
+
+#if ((!defined __STRICT_ANSI__ \
+ || (defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 500)) \
+ && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE)
+# define _POSIX_SOURCE 1
+# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
+# define _POSIX_C_SOURCE 2
+# elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600
+# define _POSIX_C_SOURCE 199506L
+# elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700
+# define _POSIX_C_SOURCE 200112L
+# else
+# define _POSIX_C_SOURCE 200809L
+# endif
+# define __USE_POSIX_IMPLICITLY 1
+#endif
+
+/* Some C libraries once required _REENTRANT and/or _THREAD_SAFE to be
+ defined in all multithreaded code. GNU libc has not required this
+ for many years. We now treat them as compatibility synonyms for
+ _POSIX_C_SOURCE=199506L, which is the earliest level of POSIX with
+ comprehensive support for multithreaded code. Using them never
+ lowers the selected level of POSIX conformance, only raises it. */
+#if ((!defined _POSIX_C_SOURCE || (_POSIX_C_SOURCE - 0) < 199506L) \
+ && (defined _REENTRANT || defined _THREAD_SAFE))
+# define _POSIX_SOURCE 1
+# undef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 199506L
+#endif
+
+#if (defined _POSIX_SOURCE \
+ || (defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 1) \
+ || defined _XOPEN_SOURCE)
+# define __USE_POSIX 1
+#endif
+
+#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
+# define __USE_POSIX2 1
+#endif
+
+#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199309L
+# define __USE_POSIX199309 1
+#endif
+
+#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 199506L
+# define __USE_POSIX199506 1
+#endif
+
+#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200112L
+# define __USE_XOPEN2K 1
+# undef __USE_ISOC95
+# define __USE_ISOC95 1
+# undef __USE_ISOC99
+# define __USE_ISOC99 1
+#endif
+
+#if defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) >= 200809L
+# define __USE_XOPEN2K8 1
+# undef _ATFILE_SOURCE
+# define _ATFILE_SOURCE 1
+#endif
+
+#ifdef _XOPEN_SOURCE
+# define __USE_XOPEN 1
+# if (_XOPEN_SOURCE - 0) >= 500
+# define __USE_XOPEN_EXTENDED 1
+# define __USE_UNIX98 1
+# undef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# if (_XOPEN_SOURCE - 0) >= 600
+# if (_XOPEN_SOURCE - 0) >= 700
+# define __USE_XOPEN2K8 1
+# define __USE_XOPEN2K8XSI 1
+# endif
+# define __USE_XOPEN2K 1
+# define __USE_XOPEN2KXSI 1
+# undef __USE_ISOC95
+# define __USE_ISOC95 1
+# undef __USE_ISOC99
+# define __USE_ISOC99 1
+# endif
+# else
+# ifdef _XOPEN_SOURCE_EXTENDED
+# define __USE_XOPEN_EXTENDED 1
+# endif
+# endif
+#endif
+
+#ifdef _LARGEFILE_SOURCE
+# define __USE_LARGEFILE 1
+#endif
+
+#ifdef _LARGEFILE64_SOURCE
+# define __USE_LARGEFILE64 1
+#endif
+
+#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
+# define __USE_FILE_OFFSET64 1
+#endif
+
+#if defined _DEFAULT_SOURCE
+# define __USE_MISC 1
+#endif
+
+#ifdef _ATFILE_SOURCE
+# define __USE_ATFILE 1
+#endif
+
+#ifdef _GNU_SOURCE
+# define __USE_GNU 1
+#endif
+
+#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0
+# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0
+# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
+# elif !__GNUC_PREREQ (4, 1)
+# warning _FORTIFY_SOURCE requires GCC 4.1 or later
+# elif _FORTIFY_SOURCE > 1
+# define __USE_FORTIFY_LEVEL 2
+# else
+# define __USE_FORTIFY_LEVEL 1
+# endif
+#endif
+#ifndef __USE_FORTIFY_LEVEL
+# define __USE_FORTIFY_LEVEL 0
+#endif
+
+/* The function 'gets' existed in C89, but is impossible to use
+ safely. It has been removed from ISO C11 and ISO C++14. Note: for
+ compatibility with various implementations of <cstdio>, this test
+ must consider only the value of __cplusplus when compiling C++. */
+#if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11
+# define __GLIBC_USE_DEPRECATED_GETS 0
+#else
+# define __GLIBC_USE_DEPRECATED_GETS 1
+#endif
+
+/* Get definitions of __STDC_* predefined macros, if the compiler has
+ not preincluded this header automatically. */
+#include <stdc-predef.h>
+
+/* This macro indicates that the installed library is the GNU C Library.
+ For historic reasons the value now is 6 and this will stay from now
+ on. The use of this variable is deprecated. Use __GLIBC__ and
+ __GLIBC_MINOR__ now (see below) when you want to test for a specific
+ GNU C library version and use the values in <gnu/lib-names.h> to get
+ the sonames of the shared libraries. */
+#undef __GNU_LIBRARY__
+#define __GNU_LIBRARY__ 6
+
+/* Major and minor version number of the GNU C library package. Use
+ these macros to test for features in specific releases. */
+#define __GLIBC__ 2
+#define __GLIBC_MINOR__ 25
+
+#define __GLIBC_PREREQ(maj, min) \
+ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+
+/* This is here only because every header file already includes this one. */
+#ifndef __ASSEMBLER__
+# ifndef _SYS_CDEFS_H
+# include <sys/cdefs.h>
+# endif
+
+/* If we don't have __REDIRECT, prototypes will be missing if
+ __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */
+# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
+# define __USE_LARGEFILE 1
+# define __USE_LARGEFILE64 1
+# endif
+
+#endif /* !ASSEMBLER */
+
+/* Decide whether we can define 'extern inline' functions in headers. */
+#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
+ && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
+ && defined __extern_inline
+# define __USE_EXTERN_INLINES 1
+#endif
+
+
+/* This is here only because every header file already includes this one.
+ Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
+ <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
+ that will always return failure (and set errno to ENOSYS). */
+#include <gnu/stubs.h>
+
+
+#endif /* features.h */
diff --git a/REORG.TODO/include/fenv.h b/REORG.TODO/include/fenv.h
new file mode 100644
index 0000000000..de4d46f8b7
--- /dev/null
+++ b/REORG.TODO/include/fenv.h
@@ -0,0 +1,47 @@
+#ifndef _FENV_H
+#include <math/fenv.h>
+
+#ifndef _ISOMAC
+# include <stdbool.h>
+/* Now define the internal interfaces. */
+
+extern int __feclearexcept (int __excepts);
+extern int __fegetexcept (void);
+extern int __fegetexceptflag (fexcept_t *__flagp, int __excepts);
+extern int __feraiseexcept (int __excepts);
+extern int __fesetexceptflag (const fexcept_t *__flagp, int __excepts);
+extern int __fegetenv (fenv_t *__envp);
+extern int __fesetenv (const fenv_t *__envp);
+extern int __feupdateenv (const fenv_t *__envp);
+extern __typeof (fegetround) __fegetround __attribute_pure__;
+extern __typeof (feholdexcept) __feholdexcept;
+extern __typeof (fesetround) __fesetround;
+
+libm_hidden_proto (feraiseexcept)
+libm_hidden_proto (__feraiseexcept)
+libm_hidden_proto (fegetenv)
+libm_hidden_proto (__fegetenv)
+libm_hidden_proto (fegetround)
+libm_hidden_proto (__fegetround)
+libm_hidden_proto (fesetenv)
+libm_hidden_proto (__fesetenv)
+libm_hidden_proto (fesetround)
+libm_hidden_proto (__fesetround)
+libm_hidden_proto (feholdexcept)
+libm_hidden_proto (__feholdexcept)
+libm_hidden_proto (feupdateenv)
+libm_hidden_proto (__feupdateenv)
+libm_hidden_proto (fetestexcept)
+libm_hidden_proto (feclearexcept)
+
+/* Rounding mode context. This allows functions to set/restore rounding mode
+ only when the desired rounding mode is different from the current rounding
+ mode. */
+struct rm_ctx
+{
+ fenv_t env;
+ bool updated_status;
+};
+#endif
+
+#endif
diff --git a/REORG.TODO/include/float.h b/REORG.TODO/include/float.h
new file mode 100644
index 0000000000..20c4acbf78
--- /dev/null
+++ b/REORG.TODO/include/float.h
@@ -0,0 +1,31 @@
+#ifndef _LIBC_FLOAT_H
+#define _LIBC_FLOAT_H
+
+#ifndef _ISOMAC
+# define __STDC_WANT_IEC_60559_TYPES_EXT__
+#endif
+
+#include_next <float.h>
+
+/* Supplement float.h macros for _Float128 for older compilers
+ which do not yet support the type. These are described in
+ TS 18661-3. */
+#ifndef _ISOMAC
+# include <features.h>
+# include <bits/floatn.h>
+# if !__GNUC_PREREQ (7, 0) && __HAVE_DISTINCT_FLOAT128
+# define FLT128_MANT_DIG 113
+# define FLT128_DECIMAL_DIG 36
+# define FLT128_DIG 33
+# define FLT128_MIN_EXP (-16381)
+# define FLT128_MIN_10_EXP (-4931)
+# define FLT128_MAX_EXP 16384
+# define FLT128_MAX_10_EXP 4932
+# define FLT128_MAX 1.18973149535723176508575932662800702e+4932Q
+# define FLT128_EPSILON 1.92592994438723585305597794258492732e-34Q
+# define FLT128_MIN 3.36210314311209350626267781732175260e-4932Q
+# define FLT128_TRUE_MIN 6.47517511943802511092443895822764655e-4966Q
+# endif
+#endif
+
+#endif /* _LIBC_FLOAT_H */
diff --git a/REORG.TODO/include/fmtmsg.h b/REORG.TODO/include/fmtmsg.h
new file mode 100644
index 0000000000..6ac606df2b
--- /dev/null
+++ b/REORG.TODO/include/fmtmsg.h
@@ -0,0 +1 @@
+#include <stdlib/fmtmsg.h>
diff --git a/REORG.TODO/include/fnmatch.h b/REORG.TODO/include/fnmatch.h
new file mode 100644
index 0000000000..9ef8150eda
--- /dev/null
+++ b/REORG.TODO/include/fnmatch.h
@@ -0,0 +1,9 @@
+#ifndef _FNMATCH_H
+
+#include <posix/fnmatch.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (fnmatch)
+#endif
+
+#endif
diff --git a/REORG.TODO/include/fpu_control.h b/REORG.TODO/include/fpu_control.h
new file mode 100644
index 0000000000..4498a83b87
--- /dev/null
+++ b/REORG.TODO/include/fpu_control.h
@@ -0,0 +1,10 @@
+#ifndef _FPU_CONTROL_H
+#include_next <fpu_control.h>
+
+# ifndef _ISOMAC
+
+/* Called at startup. It can be used to manipulate fpu control register. */
+extern void __setfpucw (fpu_control_t);
+
+# endif /* !_ISOMAC */
+#endif /* fpu_control.h */
diff --git a/REORG.TODO/include/ftw.h b/REORG.TODO/include/ftw.h
new file mode 100644
index 0000000000..4fb654cf22
--- /dev/null
+++ b/REORG.TODO/include/ftw.h
@@ -0,0 +1 @@
+#include <io/ftw.h>
diff --git a/REORG.TODO/include/gconv.h b/REORG.TODO/include/gconv.h
new file mode 100644
index 0000000000..2bcf6c6821
--- /dev/null
+++ b/REORG.TODO/include/gconv.h
@@ -0,0 +1 @@
+#include <iconv/gconv.h>
diff --git a/REORG.TODO/include/getopt.h b/REORG.TODO/include/getopt.h
new file mode 100644
index 0000000000..74ca6d453a
--- /dev/null
+++ b/REORG.TODO/include/getopt.h
@@ -0,0 +1 @@
+#include <posix/getopt.h>
diff --git a/REORG.TODO/include/getopt_int.h b/REORG.TODO/include/getopt_int.h
new file mode 100644
index 0000000000..9f7ced8519
--- /dev/null
+++ b/REORG.TODO/include/getopt_int.h
@@ -0,0 +1 @@
+#include <posix/getopt_int.h>
diff --git a/REORG.TODO/include/glob.h b/REORG.TODO/include/glob.h
new file mode 100644
index 0000000000..228fe30ca8
--- /dev/null
+++ b/REORG.TODO/include/glob.h
@@ -0,0 +1,17 @@
+#ifndef _GLOB_H
+#include <posix/glob.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (glob)
+libc_hidden_proto (glob64)
+libc_hidden_proto (globfree)
+libc_hidden_proto (globfree64)
+
+/* Now define the internal interfaces. */
+extern int __glob_pattern_p (const char *__pattern, int __quote);
+extern int __glob64 (const char *__pattern, int __flags,
+ int (*__errfunc) (const char *, int),
+ glob64_t *__pglob);
+#endif
+
+#endif
diff --git a/REORG.TODO/include/gmp.h b/REORG.TODO/include/gmp.h
new file mode 100644
index 0000000000..e6f635e8d5
--- /dev/null
+++ b/REORG.TODO/include/gmp.h
@@ -0,0 +1,35 @@
+/* Include gmp-mparam.h first, such that definitions of _SHORT_LIMB
+ and _LONG_LONG_LIMB in it can take effect into gmp.h. */
+#include <gmp-mparam.h>
+
+#ifndef __GMP_H__
+
+#include <stdlib/gmp.h>
+
+#include <bits/floatn.h>
+
+/* Now define the internal interfaces. */
+extern mp_size_t __mpn_extract_double (mp_ptr res_ptr, mp_size_t size,
+ int *expt, int *is_neg,
+ double value);
+
+extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
+ int *expt, int *is_neg,
+ long double value);
+
+#if __HAVE_DISTINCT_FLOAT128
+extern mp_size_t __mpn_extract_float128 (mp_ptr res_ptr, mp_size_t size,
+ int *expt, int *is_neg,
+ _Float128 value);
+#endif
+
+extern float __mpn_construct_float (mp_srcptr frac_ptr, int expt, int sign);
+
+extern double __mpn_construct_double (mp_srcptr frac_ptr, int expt,
+ int negative);
+
+extern long double __mpn_construct_long_double (mp_srcptr frac_ptr, int expt,
+ int sign);
+
+
+#endif
diff --git a/REORG.TODO/include/gnu-versions.h b/REORG.TODO/include/gnu-versions.h
new file mode 100644
index 0000000000..40f2bfcc79
--- /dev/null
+++ b/REORG.TODO/include/gnu-versions.h
@@ -0,0 +1,52 @@
+/* Header with interface version macros for library pieces copied elsewhere.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _GNU_VERSIONS_H
+#define _GNU_VERSIONS_H 1
+
+/* This file exists to define these few macros. Each specifies a version
+ number associated with the library interface of a piece of the C library
+ which is also distributed with other GNU packages. These pieces are
+ both part of the GNU C library and also distributed with other GNU
+ packages so those packages may use their facilities on systems lacking
+ the GNU C library. The source files for each piece surround all their
+ code with `#ifndef ELIDE_CODE' after defining it with this:
+
+ #define OBSTACK_INTERFACE_VERSION 1
+ #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+ #include <gnu-versions.h>
+ #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
+ #define ELIDE_CODE
+ #endif
+ #endif
+
+ This allows those one to avoid compiling those files when part of a GNU
+ package not libc, on a system using a GNU C library that supports the
+ same interface.
+
+ Please preserve the format of the comments after each macro. And
+ remember, if any of these versions change, the libc.so major version
+ number must change too (so avoid it)! */
+
+#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
+#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
+#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
+#define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and
+ posix/getopt1.c */
+
+#endif /* gnu-versions.h */
diff --git a/REORG.TODO/include/gnu/libc-version.h b/REORG.TODO/include/gnu/libc-version.h
new file mode 100644
index 0000000000..02e02884f1
--- /dev/null
+++ b/REORG.TODO/include/gnu/libc-version.h
@@ -0,0 +1,34 @@
+/* Interface to GNU libc specific functions for version information.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _GNU_LIBC_VERSION_H
+#define _GNU_LIBC_VERSION_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Return string describing release status of currently running GNU libc. */
+extern const char *gnu_get_libc_release (void) __THROW;
+
+/* Return string describing version of currently running GNU libc. */
+extern const char *gnu_get_libc_version (void) __THROW;
+
+__END_DECLS
+
+#endif /* gnu/libc-version.h */
diff --git a/REORG.TODO/include/gnu/stubs.h b/REORG.TODO/include/gnu/stubs.h
new file mode 100644
index 0000000000..6308e4e0e0
--- /dev/null
+++ b/REORG.TODO/include/gnu/stubs.h
@@ -0,0 +1,2 @@
+/* This is a placeholder used only while compiling libc.
+ The installed gnu/stubs.h file is created by make install. */
diff --git a/REORG.TODO/include/grp-merge.h b/REORG.TODO/include/grp-merge.h
new file mode 100644
index 0000000000..331ac20ea9
--- /dev/null
+++ b/REORG.TODO/include/grp-merge.h
@@ -0,0 +1,7 @@
+#ifndef _GRP_MERGE_H
+#include <grp/grp-merge.h>
+
+libc_hidden_proto (__copy_grp)
+libc_hidden_proto (__merge_grp)
+
+#endif /* _GRP_MERGE_H */
diff --git a/REORG.TODO/include/grp.h b/REORG.TODO/include/grp.h
new file mode 100644
index 0000000000..0fb5c9a574
--- /dev/null
+++ b/REORG.TODO/include/grp.h
@@ -0,0 +1,64 @@
+#ifndef _GRP_H
+#include <grp/grp.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (setgroups)
+
+/* Now define the internal interfaces. */
+extern int __getgrent_r (struct group *__resultbuf, char *buffer,
+ size_t __buflen, struct group **__result)
+ attribute_hidden;
+extern int __old_getgrent_r (struct group *__resultbuf, char *buffer,
+ size_t __buflen, struct group **__result);
+extern int __fgetgrent_r (FILE * __stream, struct group *__resultbuf,
+ char *buffer, size_t __buflen,
+ struct group **__result);
+
+/* Search for an entry with a matching group ID. */
+extern int __getgrgid_r (__gid_t __gid, struct group *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct group **__result);
+extern int __old_getgrgid_r (__gid_t __gid, struct group *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct group **__result);
+
+/* Search for an entry with a matching group name. */
+extern int __getgrnam_r (const char *__name, struct group *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct group **__result);
+extern int __old_getgrnam_r (const char *__name, struct group *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct group **__result);
+
+struct parser_data;
+extern int _nss_files_parse_grent (char *line, struct group *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+libc_hidden_proto (_nss_files_parse_grent)
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setgrent (int); \
+extern enum nss_status _nss_ ## service ## _endgrent (void); \
+extern enum nss_status _nss_ ## service ## _getgrgid_r \
+ (gid_t gid, struct group *grp, char *buffer, \
+ size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _getgrnam_r \
+ (const char *name, struct group *grp, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ##_getgrent_r \
+ (struct group *result, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ##_initgroups_dyn \
+ (const char *user, gid_t group, long int *start, \
+ long int *size, gid_t **groupsp, long int limit, \
+ int *errnop);
+
+DECLARE_NSS_PROTOTYPES (compat)
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (hesiod)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+#endif
+#endif
diff --git a/REORG.TODO/include/gshadow.h b/REORG.TODO/include/gshadow.h
new file mode 100644
index 0000000000..532801afd0
--- /dev/null
+++ b/REORG.TODO/include/gshadow.h
@@ -0,0 +1,18 @@
+#ifndef _GSHADOW_H
+#include <gshadow/gshadow.h>
+
+# ifndef _ISOMAC
+
+extern int __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer,
+ size_t buflen, struct sgrp **result);
+extern int __sgetsgent_r (const char *string, struct sgrp *resbuf,
+ char *buffer, size_t buflen, struct sgrp **result);
+
+struct parser_data;
+extern int _nss_files_parse_sgent (char *line, struct sgrp *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+libc_hidden_proto (_nss_files_parse_sgent)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/iconv.h b/REORG.TODO/include/iconv.h
new file mode 100644
index 0000000000..9091fa5904
--- /dev/null
+++ b/REORG.TODO/include/iconv.h
@@ -0,0 +1 @@
+#include <iconv/iconv.h>
diff --git a/REORG.TODO/include/ifaddrs.h b/REORG.TODO/include/ifaddrs.h
new file mode 100644
index 0000000000..54f4b7a3ce
--- /dev/null
+++ b/REORG.TODO/include/ifaddrs.h
@@ -0,0 +1,37 @@
+#ifndef _IFADDRS_H
+#include <inet/ifaddrs.h>
+
+# ifndef _ISOMAC
+
+#include <stdbool.h>
+#include <stdint.h>
+
+libc_hidden_proto (getifaddrs)
+libc_hidden_proto (freeifaddrs)
+
+struct in6addrinfo
+{
+ enum {
+ in6ai_deprecated = 1,
+ in6ai_homeaddress = 2
+ } flags:8;
+ uint8_t prefixlen;
+ uint16_t :16;
+ uint32_t index;
+ uint32_t addr[4];
+};
+
+extern void __check_pf (bool *seen_ipv4, bool *seen_ipv6,
+ struct in6addrinfo **in6ai, size_t *in6ailen)
+ attribute_hidden;
+extern void __free_in6ai (struct in6addrinfo *in6ai) attribute_hidden;
+extern void __check_native (uint32_t a1_index, int *a1_native,
+ uint32_t a2_index, int *a2_native)
+ attribute_hidden;
+
+#if IS_IN (nscd)
+extern uint32_t __bump_nl_timestamp (void) attribute_hidden;
+#endif
+
+# endif /* !_ISOMAC */
+#endif /* ifaddrs.h */
diff --git a/REORG.TODO/include/ifunc-impl-list.h b/REORG.TODO/include/ifunc-impl-list.h
new file mode 100644
index 0000000000..22ca05f495
--- /dev/null
+++ b/REORG.TODO/include/ifunc-impl-list.h
@@ -0,0 +1,56 @@
+/* Internal header file for __libc_supported_implementations.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _IFUNC_IMPL_LIST_H
+#define _IFUNC_IMPL_LIST_H 1
+
+#include <stdbool.h>
+#include <stddef.h>
+
+struct libc_ifunc_impl
+{
+ /* The name of function to be tested. */
+ const char *name;
+ /* The address of function to be tested. */
+ void (*fn) (void);
+ /* True if this implementation is usable on this machine. */
+ bool usable;
+};
+
+/* Add an IFUNC implementation, IMPL, for function FUNC, to ARRAY with
+ USABLE at index I and advance I by one. */
+#define IFUNC_IMPL_ADD(array, i, func, usable, impl) \
+ extern __typeof (func) impl attribute_hidden; \
+ (array)[i++] = (struct libc_ifunc_impl) { #impl, (void (*) (void)) impl, (usable) };
+
+/* Return the number of IFUNC implementations, N, for function FUNC if
+ string NAME matches FUNC. */
+#define IFUNC_IMPL(n, name, func, ...) \
+ if (strcmp (name, #func) == 0) \
+ { \
+ __VA_ARGS__; \
+ return n; \
+ }
+
+/* Fill ARRAY of MAX elements with IFUNC implementations for function
+ NAME and return the number of valid entries. */
+extern size_t __libc_ifunc_impl_list (const char *name,
+ struct libc_ifunc_impl *array,
+ size_t max);
+
+#endif /* ifunc-impl-list.h */
diff --git a/REORG.TODO/include/inline-hashtab.h b/REORG.TODO/include/inline-hashtab.h
new file mode 100644
index 0000000000..b0f5982a44
--- /dev/null
+++ b/REORG.TODO/include/inline-hashtab.h
@@ -0,0 +1,234 @@
+/* Fully-inline hash table, used mainly for managing TLS descriptors.
+ Copyright (C) 1999-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Alexandre Oliva <aoliva@redhat.com>
+
+ This file is derived from a 2003's version of libiberty's
+ hashtab.c, contributed by Vladimir Makarov (vmakarov@cygnus.com),
+ but with most adaptation points and support for deleting elements
+ removed.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef INLINE_HASHTAB_H
+# define INLINE_HASHTAB_H 1
+
+extern void weak_function free (void *ptr);
+
+struct hashtab
+{
+ /* Table itself. */
+ void **entries;
+
+ /* Current size (in entries) of the hash table */
+ size_t size;
+
+ /* Current number of elements. */
+ size_t n_elements;
+
+ /* Free function for the entries array. This may vary depending on
+ how early the array was allocated. If it is NULL, then the array
+ can't be freed. */
+ void (*free) (void *ptr);
+};
+
+inline static struct hashtab *
+htab_create (void)
+{
+ struct hashtab *ht = malloc (sizeof (struct hashtab));
+
+ if (! ht)
+ return NULL;
+ ht->size = 3;
+ ht->entries = malloc (sizeof (void *) * ht->size);
+ ht->free = free;
+ if (! ht->entries)
+ {
+ if (ht->free)
+ ht->free (ht);
+ return NULL;
+ }
+
+ ht->n_elements = 0;
+
+ memset (ht->entries, 0, sizeof (void *) * ht->size);
+
+ return ht;
+}
+
+/* This is only called from _dl_unmap, so it's safe to call
+ free(). */
+inline static void
+htab_delete (struct hashtab *htab)
+{
+ int i;
+
+ for (i = htab->size - 1; i >= 0; i--)
+ free (htab->entries[i]);
+
+ if (htab->free)
+ htab->free (htab->entries);
+ free (htab);
+}
+
+/* Similar to htab_find_slot, but without several unwanted side effects:
+ - Does not call htab->eq_f when it finds an existing entry.
+ - Does not change the count of elements/searches/collisions in the
+ hash table.
+ This function also assumes there are no deleted entries in the table.
+ HASH is the hash value for the element to be inserted. */
+
+inline static void **
+find_empty_slot_for_expand (struct hashtab *htab, int hash)
+{
+ size_t size = htab->size;
+ unsigned int index = hash % size;
+ void **slot = htab->entries + index;
+ int hash2;
+
+ if (! *slot)
+ return slot;
+
+ hash2 = 1 + hash % (size - 2);
+ for (;;)
+ {
+ index += hash2;
+ if (index >= size)
+ index -= size;
+
+ slot = htab->entries + index;
+ if (! *slot)
+ return slot;
+ }
+}
+
+/* The following function changes size of memory allocated for the
+ entries and repeatedly inserts the table elements. The occupancy
+ of the table after the call will be about 50%. Naturally the hash
+ table must already exist. Remember also that the place of the
+ table entries is changed. If memory allocation failures are allowed,
+ this function will return zero, indicating that the table could not be
+ expanded. If all goes well, it will return a non-zero value. */
+
+inline static int
+htab_expand (struct hashtab *htab, int (*hash_fn) (void *))
+{
+ void **oentries;
+ void **olimit;
+ void **p;
+ void **nentries;
+ size_t nsize;
+
+ oentries = htab->entries;
+ olimit = oentries + htab->size;
+
+ /* Resize only when table after removal of unused elements is either
+ too full or too empty. */
+ if (htab->n_elements * 2 > htab->size)
+ nsize = _dl_higher_prime_number (htab->n_elements * 2);
+ else
+ nsize = htab->size;
+
+ nentries = calloc (sizeof (void *), nsize);
+ if (nentries == NULL)
+ return 0;
+ htab->entries = nentries;
+ htab->size = nsize;
+
+ p = oentries;
+ do
+ {
+ if (*p)
+ *find_empty_slot_for_expand (htab, hash_fn (*p))
+ = *p;
+
+ p++;
+ }
+ while (p < olimit);
+
+ /* Without recording the free corresponding to the malloc used to
+ allocate the table, we couldn't tell whether this was allocated
+ by the malloc() built into ld.so or the one in the main
+ executable or libc. Calling free() for something that was
+ allocated by the early malloc(), rather than the final run-time
+ malloc() could do Very Bad Things (TM). We will waste memory
+ allocated early as long as there's no corresponding free(), but
+ this isn't so much memory as to be significant. */
+
+ if (htab->free)
+ htab->free (oentries);
+
+ /* Use the free() corresponding to the malloc() above to free this
+ up. */
+ htab->free = free;
+
+ return 1;
+}
+
+/* This function searches for a hash table slot containing an entry
+ equal to the given element. To delete an entry, call this with
+ INSERT = 0, then call htab_clear_slot on the slot returned (possibly
+ after doing some checks). To insert an entry, call this with
+ INSERT = 1, then write the value you want into the returned slot.
+ When inserting an entry, NULL may be returned if memory allocation
+ fails. */
+
+inline static void **
+htab_find_slot (struct hashtab *htab, void *ptr, int insert,
+ int (*hash_fn)(void *), int (*eq_fn)(void *, void *))
+{
+ unsigned int index;
+ int hash, hash2;
+ size_t size;
+ void **entry;
+
+ if (htab->size * 3 <= htab->n_elements * 4
+ && htab_expand (htab, hash_fn) == 0)
+ return NULL;
+
+ hash = hash_fn (ptr);
+
+ size = htab->size;
+ index = hash % size;
+
+ entry = &htab->entries[index];
+ if (!*entry)
+ goto empty_entry;
+ else if (eq_fn (*entry, ptr))
+ return entry;
+
+ hash2 = 1 + hash % (size - 2);
+ for (;;)
+ {
+ index += hash2;
+ if (index >= size)
+ index -= size;
+
+ entry = &htab->entries[index];
+ if (!*entry)
+ goto empty_entry;
+ else if (eq_fn (*entry, ptr))
+ return entry;
+ }
+
+ empty_entry:
+ if (!insert)
+ return NULL;
+
+ htab->n_elements++;
+ return entry;
+}
+
+#endif /* INLINE_HASHTAB_H */
diff --git a/REORG.TODO/include/langinfo.h b/REORG.TODO/include/langinfo.h
new file mode 100644
index 0000000000..d60d7f6382
--- /dev/null
+++ b/REORG.TODO/include/langinfo.h
@@ -0,0 +1,12 @@
+#ifndef _LANGINFO_H
+
+#include <locale/langinfo.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (nl_langinfo)
+
+extern __typeof (nl_langinfo_l) __nl_langinfo_l;
+libc_hidden_proto (__nl_langinfo_l)
+#endif
+
+#endif
diff --git a/REORG.TODO/include/libc-diag.h b/REORG.TODO/include/libc-diag.h
new file mode 100644
index 0000000000..db138c63b1
--- /dev/null
+++ b/REORG.TODO/include/libc-diag.h
@@ -0,0 +1,74 @@
+/* Macros for controlling diagnostic output from the compiler.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC_DIAG_H
+#define _LIBC_DIAG_H 1
+
+/* Ignore the value of an expression when a cast to void does not
+ suffice (in particular, for a call to a function declared with
+ attribute warn_unused_result). */
+#define ignore_value(x) \
+ ({ __typeof__ (x) __ignored_value = (x); (void) __ignored_value; })
+
+/* The macros to control diagnostics are structured like this, rather
+ than a single macro that both pushes and pops diagnostic state and
+ takes the affected code as an argument, because the GCC pragmas
+ work by disabling the diagnostic for a range of source locations
+ and do not work when all the pragmas and the affected code are in a
+ single macro expansion. */
+
+/* Push diagnostic state. */
+#define DIAG_PUSH_NEEDS_COMMENT _Pragma ("GCC diagnostic push")
+
+/* Pop diagnostic state. */
+#define DIAG_POP_NEEDS_COMMENT _Pragma ("GCC diagnostic pop")
+
+#define _DIAG_STR1(s) #s
+#define _DIAG_STR(s) _DIAG_STR1(s)
+
+/* Ignore the diagnostic OPTION. VERSION is the most recent GCC
+ version for which the diagnostic has been confirmed to appear in
+ the absence of the pragma (in the form MAJOR.MINOR for GCC 4.x,
+ just MAJOR for GCC 5 and later). Uses of this pragma should be
+ reviewed when the GCC version given is no longer supported for
+ building glibc; the version number should always be on the same
+ source line as the macro name, so such uses can be found with grep.
+ Uses should come with a comment giving more details of the
+ diagnostic, and an architecture on which it is seen if possibly
+ optimization-related and not in architecture-specific code. This
+ macro should only be used if the diagnostic seems hard to fix (for
+ example, optimization-related false positives). */
+#define DIAG_IGNORE_NEEDS_COMMENT(version, option) \
+ _Pragma (_DIAG_STR (GCC diagnostic ignored option))
+
+/* Similar to DIAG_IGNORE_NEEDS_COMMENT the following macro ignores the
+ diagnostic OPTION but only if optimizations for size are enabled.
+ This is required because different warnings may be generated for
+ different optimization levels. For example a key piece of code may
+ only generate a warning when compiled at -Os, but at -O2 you could
+ still want the warning to be enabled to catch errors. In this case
+ you would use DIAG_IGNORE_Os_NEEDS_COMMENT to disable the warning
+ only for -Os. */
+#ifdef __OPTIMIZE_SIZE__
+# define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option) \
+ _Pragma (_DIAG_STR (GCC diagnostic ignored option))
+#else
+# define DIAG_IGNORE_Os_NEEDS_COMMENT(version, option)
+#endif
+
+#endif /* libc-diag.h */
diff --git a/REORG.TODO/include/libc-internal.h b/REORG.TODO/include/libc-internal.h
new file mode 100644
index 0000000000..cd2f2622ed
--- /dev/null
+++ b/REORG.TODO/include/libc-internal.h
@@ -0,0 +1,56 @@
+/* Internal prototype declarations that don't fit anywhere else.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC_INTERNAL
+# define _LIBC_INTERNAL 1
+
+#include <hp-timing.h>
+
+/* Initialize the `__libc_enable_secure' flag. */
+extern void __libc_init_secure (void);
+
+/* This function will be called from _init in init-first.c. */
+extern void __libc_global_ctors (void);
+
+/* Discover the tick frequency of the machine if something goes wrong,
+ we return 0, an impossible hertz. */
+extern int __profile_frequency (void);
+libc_hidden_proto (__profile_frequency)
+
+/* Hooks for the instrumenting functions. */
+extern void __cyg_profile_func_enter (void *this_fn, void *call_site);
+extern void __cyg_profile_func_exit (void *this_fn, void *call_site);
+
+/* Get frequency of the system processor. */
+extern hp_timing_t __get_clockfreq (void);
+
+/* Free all allocated resources. */
+extern void __libc_freeres (void);
+libc_hidden_proto (__libc_freeres)
+
+/* Free resources stored in thread-local variables on thread exit. */
+extern void __libc_thread_freeres (void);
+
+/* Define and initialize `__progname' et. al. */
+extern void __init_misc (int, char **, char **);
+
+# if IS_IN (rtld)
+extern __typeof (__profile_frequency) __profile_frequency attribute_hidden;
+# endif
+
+#endif /* _LIBC_INTERNAL */
diff --git a/REORG.TODO/include/libc-pointer-arith.h b/REORG.TODO/include/libc-pointer-arith.h
new file mode 100644
index 0000000000..715cbc1bbe
--- /dev/null
+++ b/REORG.TODO/include/libc-pointer-arith.h
@@ -0,0 +1,60 @@
+/* Helper macros for pointer arithmetic.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC_POINTER_ARITH_H
+#define _LIBC_POINTER_ARITH_H 1
+
+#include <stdint.h>
+
+/* 1 if 'type' is a pointer type, 0 otherwise. */
+# define __pointer_type(type) (__builtin_classify_type ((type) 0) == 5)
+
+/* intptr_t if P is true, or T if P is false. */
+# define __integer_if_pointer_type_sub(T, P) \
+ __typeof__ (*(0 ? (__typeof__ (0 ? (T *) 0 : (void *) (P))) 0 \
+ : (__typeof__ (0 ? (intptr_t *) 0 : (void *) (!(P)))) 0))
+
+/* intptr_t if EXPR has a pointer type, or the type of EXPR otherwise. */
+# define __integer_if_pointer_type(expr) \
+ __integer_if_pointer_type_sub(__typeof__ ((__typeof__ (expr)) 0), \
+ __pointer_type (__typeof__ (expr)))
+
+/* Cast an integer or a pointer VAL to integer with proper type. */
+# define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val))
+
+/* Align a value by rounding down to closest size.
+ e.g. Using size of 4096, we get this behavior:
+ {4095, 4096, 4097} = {0, 4096, 4096}. */
+#define ALIGN_DOWN(base, size) ((base) & -((__typeof__ (base)) (size)))
+
+/* Align a value by rounding up to closest size.
+ e.g. Using size of 4096, we get this behavior:
+ {4095, 4096, 4097} = {4096, 4096, 8192}.
+
+ Note: The size argument has side effects (expanded multiple times). */
+#define ALIGN_UP(base, size) ALIGN_DOWN ((base) + (size) - 1, (size))
+
+/* Same as ALIGN_DOWN(), but automatically casts when base is a pointer. */
+#define PTR_ALIGN_DOWN(base, size) \
+ ((__typeof__ (base)) ALIGN_DOWN ((uintptr_t) (base), (size)))
+
+/* Same as ALIGN_UP(), but automatically casts when base is a pointer. */
+#define PTR_ALIGN_UP(base, size) \
+ ((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size)))
+
+#endif
diff --git a/REORG.TODO/include/libc-symbols.h b/REORG.TODO/include/libc-symbols.h
new file mode 100644
index 0000000000..3310e3a678
--- /dev/null
+++ b/REORG.TODO/include/libc-symbols.h
@@ -0,0 +1,969 @@
+/* Support macros for making weak and strong aliases for symbols,
+ and for using symbol sets and linker warnings with GNU ld.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIBC_SYMBOLS_H
+#define _LIBC_SYMBOLS_H 1
+
+/* This file is included implicitly in the compilation of every source file,
+ using -include. It includes config.h. */
+
+/* Enable declarations of GNU extensions, since we are compiling them. */
+#define _GNU_SOURCE 1
+
+#ifdef MODULE_NAME
+
+/* Use `#if IS_IN (module)` to detect what component is being compiled. */
+#define PASTE_NAME1(a,b) a##b
+#define PASTE_NAME(a,b) PASTE_NAME1 (a,b)
+#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
+#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+
+/* True if the current module is a versioned library. Versioned
+ library names culled from shlib-versions files are assigned a
+ MODULE_* value greater than MODULE_LIBS_BEGIN. */
+#define IS_IN_LIB (IN_MODULE > MODULE_LIBS_BEGIN)
+
+/* The testsuite, and some other ancillary code, should be compiled against
+ as close an approximation to the installed headers as possible.
+ Defining this symbol disables most internal-use-only declarations
+ provided by this header, and all those provided by other internal
+ wrapper headers. */
+#if IS_IN (testsuite) || defined IS_IN_build || defined __cplusplus
+# define _ISOMAC 1
+#endif
+
+#else
+/* The generation process for a few files created very early in the
+ build (notably libc-modules.h itself) involves preprocessing this
+ header without defining MODULE_NAME. Under these conditions,
+ internal declarations (especially from config.h) must be visible,
+ but IS_IN should always evaluate as false. */
+# define IS_IN(lib) 0
+# define IS_IN_LIB 0
+# define IN_MODULE (-1)
+#endif
+
+#ifndef _ISOMAC
+
+/* This is defined for the compilation of all C library code. features.h
+ tests this to avoid inclusion of stubs.h while compiling the library,
+ before stubs.h has been generated. Some library code that is shared
+ with other packages also tests this symbol to see if it is being
+ compiled as part of the C library. We must define this before including
+ config.h, because it makes some definitions conditional on whether libc
+ itself is being compiled, or just some generator program. */
+#define _LIBC 1
+
+/* Some files must be compiled with optimization on. */
+#if !defined __ASSEMBLER__ && !defined __OPTIMIZE__
+# error "glibc cannot be compiled without optimization"
+#endif
+
+/* -ffast-math cannot be applied to the C library, as it alters the ABI.
+ Some test components that use -ffast-math are currently not part of
+ IS_IN (testsuite) for technical reasons, so we have a secondary override. */
+#if defined __FAST_MATH__ && !defined TEST_FAST_MATH
+# error "glibc must not be compiled with -ffast-math"
+#endif
+
+#include <config.h>
+
+/* Define this for the benefit of portable GNU code that wants to check it.
+ Code that checks with #if will not #include <config.h> again, since we've
+ already done it (and this file is implicitly included in every compile,
+ via -include). Code that checks with #ifdef will #include <config.h>,
+ but that file should always be idempotent (i.e., it's just #define/#undef
+ and nothing else anywhere should be changing the macro state it touches),
+ so it's harmless. */
+#define HAVE_CONFIG_H 0
+
+/* Define these macros for the benefit of portable GNU code that wants to check
+ them. Of course, STDC_HEADERS is never false when building libc! */
+#define STDC_HEADERS 1
+#define HAVE_MBSTATE_T 1
+#define HAVE_MBSRTOWCS 1
+#define HAVE_LIBINTL_H 1
+#define HAVE_WCTYPE_H 1
+#define HAVE_ISWCTYPE 1
+#define ENABLE_NLS 1
+
+/* The symbols in all the user (non-_) macros are C symbols. */
+
+#ifndef __SYMBOL_PREFIX
+# define __SYMBOL_PREFIX
+#endif
+
+#ifndef C_SYMBOL_NAME
+# define C_SYMBOL_NAME(name) name
+#endif
+
+#ifndef ASM_LINE_SEP
+# define ASM_LINE_SEP ;
+#endif
+
+#ifndef __ASSEMBLER__
+/* GCC understands weak symbols and aliases; use its interface where
+ possible, instead of embedded assembly language. */
+
+/* Define ALIASNAME as a strong alias for NAME. */
+# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+# define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+
+/* This comes between the return type and function name in
+ a function definition to make that definition weak. */
+# define weak_function __attribute__ ((weak))
+# define weak_const_function __attribute__ ((weak, __const__))
+
+/* Define ALIASNAME as a weak alias for NAME.
+ If weak aliases are not available, this defines a strong alias. */
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# define _weak_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+
+/* Same as WEAK_ALIAS, but mark symbol as hidden. */
+# define weak_hidden_alias(name, aliasname) \
+ _weak_hidden_alias (name, aliasname)
+# define _weak_hidden_alias(name, aliasname) \
+ extern __typeof (name) aliasname \
+ __attribute__ ((weak, alias (#name), __visibility__ ("hidden")));
+
+/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
+# define weak_extern(symbol) _weak_extern (weak symbol)
+# define _weak_extern(expr) _Pragma (#expr)
+
+/* In shared builds, the expression call_function_static_weak
+ (FUNCTION-SYMBOL, ARGUMENTS) invokes FUNCTION-SYMBOL (an
+ identifier) unconditionally, with the (potentially empty) argument
+ list ARGUMENTS. In static builds, if FUNCTION-SYMBOL has a
+ definition, the function is invoked as before; if FUNCTION-SYMBOL
+ is NULL, no call is performed. */
+# ifdef SHARED
+# define call_function_static_weak(func, ...) func (__VA_ARGS__)
+# else /* !SHARED */
+# define call_function_static_weak(func, ...) \
+ ({ \
+ extern __typeof__ (func) func weak_function; \
+ (func != NULL ? func (__VA_ARGS__) : (void)0); \
+ })
+# endif
+
+#else /* __ASSEMBLER__ */
+
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# define strong_alias(original, alias) \
+ .globl C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
+# define strong_data_alias(original, alias) strong_alias(original, alias)
+# else
+# define strong_alias(original, alias) \
+ .globl C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+# define strong_data_alias(original, alias) strong_alias(original, alias)
+# endif
+
+# define weak_alias(original, alias) \
+ .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP \
+ C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
+
+# define weak_extern(symbol) \
+ .weak C_SYMBOL_NAME (symbol)
+
+#endif /* __ASSEMBLER__ */
+
+/* On some platforms we can make internal function calls (i.e., calls of
+ functions not exported) a bit faster by using a different calling
+ convention. */
+#ifndef internal_function
+# define internal_function /* empty */
+#endif
+
+/* Determine the return address. */
+#define RETURN_ADDRESS(nr) \
+ __builtin_extract_return_addr (__builtin_return_address (nr))
+
+/* When a reference to SYMBOL is encountered, the linker will emit a
+ warning message MSG. */
+/* We want the .gnu.warning.SYMBOL section to be unallocated. */
+#define __make_section_unallocated(section_string) \
+ asm (".section " section_string "\n\t.previous");
+
+/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
+ section attributes on what looks like a comment to the assembler. */
+#ifdef HAVE_SECTION_QUOTES
+# define __sec_comment "\"\n\t#\""
+#else
+# define __sec_comment "\n\t#"
+#endif
+#define link_warning(symbol, msg) \
+ __make_section_unallocated (".gnu.warning." #symbol) \
+ static const char __evoke_link_warning_##symbol[] \
+ __attribute__ ((used, section (".gnu.warning." #symbol __sec_comment))) \
+ = msg;
+#define libc_freeres_ptr(decl) \
+ __make_section_unallocated ("__libc_freeres_ptrs, \"aw\", %nobits") \
+ decl __attribute__ ((section ("__libc_freeres_ptrs" __sec_comment)))
+#define __libc_freeres_fn_section \
+ __attribute__ ((section ("__libc_freeres_fn")))
+
+#define libc_freeres_fn(name) \
+ static void name (void) __attribute_used__ __libc_freeres_fn_section; \
+ text_set_element (__libc_subfreeres, name); \
+ static void name (void)
+
+/* A canned warning for sysdeps/stub functions. */
+#define stub_warning(name) \
+ __make_section_unallocated (".gnu.glibc-stub." #name) \
+ link_warning (name, #name " is not implemented and will always fail")
+
+/* Warning for linking functions calling dlopen into static binaries. */
+#ifdef SHARED
+#define static_link_warning(name)
+#else
+#define static_link_warning(name) static_link_warning1(name)
+#define static_link_warning1(name) \
+ link_warning(name, "Using '" #name "' in statically linked applications \
+requires at runtime the shared libraries from the glibc version used \
+for linking")
+#endif
+
+/* Declare SYMBOL to be TYPE (`function' or `object') of SIZE bytes
+ alias to ORIGINAL, when the assembler supports such declarations
+ (such as in ELF).
+ This is only necessary when defining something in assembly, or playing
+ funny alias games where the size should be other than what the compiler
+ thinks it is. */
+#define declare_symbol_alias(symbol, original, type, size) \
+ declare_symbol_alias_1 (symbol, original, type, size)
+#ifdef __ASSEMBLER__
+# define declare_symbol_alias_1(symbol, original, type, size) \
+ strong_alias (original, symbol); \
+ .type C_SYMBOL_NAME (symbol), %##type; \
+ .size C_SYMBOL_NAME (symbol), size
+#else /* Not __ASSEMBLER__. */
+# define declare_symbol_alias_1(symbol, original, type, size) \
+ asm (".globl " __SYMBOL_PREFIX #symbol \
+ "\n\t" declare_symbol_alias_1_alias (symbol, original) \
+ "\n\t.type " __SYMBOL_PREFIX #symbol ", " \
+ "%" #type \
+ "\n\t.size " __SYMBOL_PREFIX #symbol ", " #size);
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# define declare_symbol_alias_1_alias(symbol, original) \
+ ".set " __SYMBOL_PREFIX #symbol ", " __SYMBOL_PREFIX #original
+# else
+# define declare_symbol_alias_1_alias(symbol, original) \
+ __SYMBOL_PREFIX #symbol " = " __SYMBOL_PREFIX #original
+# endif /* HAVE_ASM_SET_DIRECTIVE */
+#endif /* __ASSEMBLER__ */
+
+
+/*
+
+*/
+
+/* Symbol set support macros. */
+
+/* Make SYMBOL, which is in the text segment, an element of SET. */
+#define text_set_element(set, symbol) _elf_set_element(set, symbol)
+/* Make SYMBOL, which is in the data segment, an element of SET. */
+#define data_set_element(set, symbol) _elf_set_element(set, symbol)
+/* Make SYMBOL, which is in the bss segment, an element of SET. */
+#define bss_set_element(set, symbol) _elf_set_element(set, symbol)
+
+/* These are all done the same way in ELF.
+ There is a new section created for each set. */
+#ifdef SHARED
+/* When building a shared library, make the set section writable,
+ because it will need to be relocated at run time anyway. */
+# define _elf_set_element(set, symbol) \
+ static const void *__elf_set_##set##_element_##symbol##__ \
+ __attribute__ ((used, section (#set))) = &(symbol)
+#else
+# define _elf_set_element(set, symbol) \
+ static const void *const __elf_set_##set##_element_##symbol##__ \
+ __attribute__ ((used, section (#set))) = &(symbol)
+#endif
+
+/* Define SET as a symbol set. This may be required (it is in a.out) to
+ be able to use the set's contents. */
+#define symbol_set_define(set) symbol_set_declare(set)
+
+/* Declare SET for use in this module, if defined in another module.
+ In a shared library, this is always local to that shared object.
+ For static linking, the set might be wholly absent and so we use
+ weak references. */
+#define symbol_set_declare(set) \
+ extern char const __start_##set[] __symbol_set_attribute; \
+ extern char const __stop_##set[] __symbol_set_attribute;
+#ifdef SHARED
+# define __symbol_set_attribute attribute_hidden
+#else
+# define __symbol_set_attribute __attribute__ ((weak))
+#endif
+
+/* Return a pointer (void *const *) to the first element of SET. */
+#define symbol_set_first_element(set) ((void *const *) (&__start_##set))
+
+/* Return true iff PTR (a void *const *) has been incremented
+ past the last element in SET. */
+#define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set)
+
+/* Use symbol_version_reference to specify the version a symbol
+ reference should link to. Use symbol_version or
+ default_symbol_version for the definition of a versioned symbol.
+ The difference is that the latter is a no-op in non-shared
+ builds. */
+#ifdef __ASSEMBLER__
+# define symbol_version_reference(real, name, version) \
+ .symver real, name##@##version
+#else /* !__ASSEMBLER__ */
+# define symbol_version_reference(real, name, version) \
+ __asm__ (".symver " #real "," #name "@" #version)
+#endif
+
+#ifdef SHARED
+# define symbol_version(real, name, version) \
+ symbol_version_reference(real, name, version)
+# define default_symbol_version(real, name, version) \
+ _default_symbol_version(real, name, version)
+# ifdef __ASSEMBLER__
+# define _default_symbol_version(real, name, version) \
+ .symver real, name##@##@##version
+# else
+# define _default_symbol_version(real, name, version) \
+ __asm__ (".symver " #real "," #name "@@" #version)
+# endif
+#else
+# define symbol_version(real, name, version)
+# define default_symbol_version(real, name, version) \
+ strong_alias(real, name)
+#endif
+
+#if defined SHARED || defined LIBC_NONSHARED
+# define attribute_hidden __attribute__ ((visibility ("hidden")))
+#else
+# define attribute_hidden
+#endif
+
+#define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
+
+#define attribute_relro __attribute__ ((section (".data.rel.ro")))
+
+
+/* Used to disable stack protection in sensitive places, like ifunc
+ resolvers and early static TLS init. */
+#ifdef HAVE_CC_NO_STACK_PROTECTOR
+# define inhibit_stack_protector \
+ __attribute__ ((__optimize__ ("-fno-stack-protector")))
+#else
+# define inhibit_stack_protector
+#endif
+
+/* The following macros are used for PLT bypassing within libc.so
+ (and if needed other libraries similarly).
+ First of all, you need to have the function prototyped somewhere,
+ say in foo/foo.h:
+
+ int foo (int __bar);
+
+ If calls to foo within libc.so should always go to foo defined in libc.so,
+ then in include/foo.h you add:
+
+ libc_hidden_proto (foo)
+
+ line and after the foo function definition:
+
+ int foo (int __bar)
+ {
+ return __bar;
+ }
+ libc_hidden_def (foo)
+
+ or
+
+ int foo (int __bar)
+ {
+ return __bar;
+ }
+ libc_hidden_weak (foo)
+
+ Similarly for global data. If references to foo within libc.so should
+ always go to foo defined in libc.so, then in include/foo.h you add:
+
+ libc_hidden_proto (foo)
+
+ line and after foo's definition:
+
+ int foo = INITIAL_FOO_VALUE;
+ libc_hidden_data_def (foo)
+
+ or
+
+ int foo = INITIAL_FOO_VALUE;
+ libc_hidden_data_weak (foo)
+
+ If foo is normally just an alias (strong or weak) to some other function,
+ you should use the normal strong_alias first, then add libc_hidden_def
+ or libc_hidden_weak:
+
+ int baz (int __bar)
+ {
+ return __bar;
+ }
+ strong_alias (baz, foo)
+ libc_hidden_weak (foo)
+
+ If the function should be internal to multiple objects, say ld.so and
+ libc.so, the best way is to use:
+
+ #if IS_IN (libc) || IS_IN (rtld)
+ hidden_proto (foo)
+ #endif
+
+ in include/foo.h and the normal macros at all function definitions
+ depending on what DSO they belong to.
+
+ If versioned_symbol macro is used to define foo,
+ libc_hidden_ver macro should be used, as in:
+
+ int __real_foo (int __bar)
+ {
+ return __bar;
+ }
+ versioned_symbol (libc, __real_foo, foo, GLIBC_2_1);
+ libc_hidden_ver (__real_foo, foo) */
+
+#if defined SHARED && !defined NO_HIDDEN
+# ifndef __ASSEMBLER__
+# define __hidden_proto_hiddenattr(attrs...) \
+ __attribute__ ((visibility ("hidden"), ##attrs))
+# define hidden_proto(name, attrs...) \
+ __hidden_proto (name, , __GI_##name, ##attrs)
+# define hidden_tls_proto(name, attrs...) \
+ __hidden_proto (name, __thread, __GI_##name, ##attrs)
+# define __hidden_proto(name, thread, internal, attrs...) \
+ extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
+ __hidden_proto_hiddenattr (attrs);
+# define __hidden_asmname(name) \
+ __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
+# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
+# define __hidden_asmname2(prefix, name) #prefix name
+# define __hidden_ver1(local, internal, name) \
+ extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
+ extern __typeof (name) __EI_##name \
+ __attribute__((alias (__hidden_asmname (#local))))
+# define hidden_ver(local, name) __hidden_ver1(local, __GI_##name, name);
+# define hidden_data_ver(local, name) hidden_ver(local, name)
+# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
+# define hidden_data_def(name) hidden_def(name)
+# define hidden_weak(name) \
+ __hidden_ver1(__GI_##name, name, name) __attribute__((weak));
+# define hidden_data_weak(name) hidden_weak(name)
+# define hidden_nolink(name, lib, version) \
+ __hidden_nolink1 (__GI_##name, __EI_##name, name, VERSION_##lib##_##version)
+# define __hidden_nolink1(local, internal, name, version) \
+ __hidden_nolink2 (local, internal, name, version)
+# define __hidden_nolink2(local, internal, name, version) \
+ extern __typeof (name) internal __attribute__ ((alias (#local))); \
+ __hidden_nolink3 (local, internal, #name "@" #version)
+# define __hidden_nolink3(local, internal, vername) \
+ __asm__ (".symver " #internal ", " vername);
+# else
+/* For assembly, we need to do the opposite of what we do in C:
+ in assembly gcc __REDIRECT stuff is not in place, so functions
+ are defined by its normal name and we need to create the
+ __GI_* alias to it, in C __REDIRECT causes the function definition
+ to use __GI_* name and we need to add alias to the real name.
+ There is no reason to use hidden_weak over hidden_def in assembly,
+ but we provide it for consistency with the C usage.
+ hidden_proto doesn't make sense for assembly but the equivalent
+ is to call via the HIDDEN_JUMPTARGET macro instead of JUMPTARGET. */
+# define hidden_def(name) strong_alias (name, __GI_##name)
+# define hidden_weak(name) hidden_def (name)
+# define hidden_ver(local, name) strong_alias (local, __GI_##name)
+# define hidden_data_def(name) strong_data_alias (name, __GI_##name)
+# define hidden_data_weak(name) hidden_data_def (name)
+# define hidden_data_ver(local, name) strong_data_alias (local, __GI_##name)
+# define HIDDEN_JUMPTARGET(name) __GI_##name
+# endif
+#else
+# ifndef __ASSEMBLER__
+# define hidden_proto(name, attrs...)
+# define hidden_tls_proto(name, attrs...)
+# else
+# define HIDDEN_JUMPTARGET(name) JUMPTARGET(name)
+# endif /* Not __ASSEMBLER__ */
+# define hidden_weak(name)
+# define hidden_def(name)
+# define hidden_ver(local, name)
+# define hidden_data_weak(name)
+# define hidden_data_def(name)
+# define hidden_data_ver(local, name)
+# define hidden_nolink(name, lib, version)
+#endif
+
+#if IS_IN (libc)
+# define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
+# define libc_hidden_def(name) hidden_def (name)
+# define libc_hidden_weak(name) hidden_weak (name)
+# ifdef LINK_OBSOLETE_RPC
+ /* libc_hidden_nolink_sunrpc should only get used in sunrpc code. */
+# define libc_hidden_nolink_sunrpc(name, version) hidden_def (name)
+# else
+# define libc_hidden_nolink_sunrpc(name, version) hidden_nolink (name, libc, version)
+# endif
+# define libc_hidden_ver(local, name) hidden_ver (local, name)
+# define libc_hidden_data_def(name) hidden_data_def (name)
+# define libc_hidden_data_weak(name) hidden_data_weak (name)
+# define libc_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libc_hidden_proto(name, attrs...)
+# define libc_hidden_tls_proto(name, attrs...)
+# define libc_hidden_def(name)
+# define libc_hidden_weak(name)
+# define libc_hidden_ver(local, name)
+# define libc_hidden_data_def(name)
+# define libc_hidden_data_weak(name)
+# define libc_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (rtld)
+# define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
+# define rtld_hidden_def(name) hidden_def (name)
+# define rtld_hidden_weak(name) hidden_weak (name)
+# define rtld_hidden_ver(local, name) hidden_ver (local, name)
+# define rtld_hidden_data_def(name) hidden_data_def (name)
+# define rtld_hidden_data_weak(name) hidden_data_weak (name)
+# define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define rtld_hidden_proto(name, attrs...)
+# define rtld_hidden_tls_proto(name, attrs...)
+# define rtld_hidden_def(name)
+# define rtld_hidden_weak(name)
+# define rtld_hidden_ver(local, name)
+# define rtld_hidden_data_def(name)
+# define rtld_hidden_data_weak(name)
+# define rtld_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libm)
+# define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
+# define libm_hidden_def(name) hidden_def (name)
+# define libm_hidden_weak(name) hidden_weak (name)
+# define libm_hidden_ver(local, name) hidden_ver (local, name)
+# define libm_hidden_data_def(name) hidden_data_def (name)
+# define libm_hidden_data_weak(name) hidden_data_weak (name)
+# define libm_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libm_hidden_proto(name, attrs...)
+# define libm_hidden_tls_proto(name, attrs...)
+# define libm_hidden_def(name)
+# define libm_hidden_weak(name)
+# define libm_hidden_ver(local, name)
+# define libm_hidden_data_def(name)
+# define libm_hidden_data_weak(name)
+# define libm_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libmvec)
+# define libmvec_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libmvec_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs)
+# define libmvec_hidden_def(name) hidden_def (name)
+# define libmvec_hidden_weak(name) hidden_weak (name)
+# define libmvec_hidden_ver(local, name) hidden_ver (local, name)
+# define libmvec_hidden_data_def(name) hidden_data_def (name)
+# define libmvec_hidden_data_weak(name) hidden_data_weak (name)
+# define libmvec_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libmvec_hidden_proto(name, attrs...)
+# define libmvec_hidden_tls_proto(name, attrs...)
+# define libmvec_hidden_def(name)
+# define libmvec_hidden_weak(name)
+# define libmvec_hidden_ver(local, name)
+# define libmvec_hidden_data_def(name)
+# define libmvec_hidden_data_weak(name)
+# define libmvec_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libresolv)
+# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libresolv_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# define libresolv_hidden_def(name) hidden_def (name)
+# define libresolv_hidden_weak(name) hidden_weak (name)
+# define libresolv_hidden_ver(local, name) hidden_ver (local, name)
+# define libresolv_hidden_data_def(name) hidden_data_def (name)
+# define libresolv_hidden_data_weak(name) hidden_data_weak (name)
+# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libresolv_hidden_proto(name, attrs...)
+# define libresolv_hidden_tls_proto(name, attrs...)
+# define libresolv_hidden_def(name)
+# define libresolv_hidden_weak(name)
+# define libresolv_hidden_ver(local, name)
+# define libresolv_hidden_data_def(name)
+# define libresolv_hidden_data_weak(name)
+# define libresolv_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (librt)
+# define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define librt_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# define librt_hidden_def(name) hidden_def (name)
+# define librt_hidden_weak(name) hidden_weak (name)
+# define librt_hidden_ver(local, name) hidden_ver (local, name)
+# define librt_hidden_data_def(name) hidden_data_def (name)
+# define librt_hidden_data_weak(name) hidden_data_weak (name)
+# define librt_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define librt_hidden_proto(name, attrs...)
+# define librt_hidden_tls_proto(name, attrs...)
+# define librt_hidden_def(name)
+# define librt_hidden_weak(name)
+# define librt_hidden_ver(local, name)
+# define librt_hidden_data_def(name)
+# define librt_hidden_data_weak(name)
+# define librt_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libdl)
+# define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libdl_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# define libdl_hidden_def(name) hidden_def (name)
+# define libdl_hidden_weak(name) hidden_weak (name)
+# define libdl_hidden_ver(local, name) hidden_ver (local, name)
+# define libdl_hidden_data_def(name) hidden_data_def (name)
+# define libdl_hidden_data_weak(name) hidden_data_weak (name)
+# define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libdl_hidden_proto(name, attrs...)
+# define libdl_hidden_tls_proto(name, attrs...)
+# define libdl_hidden_def(name)
+# define libdl_hidden_weak(name)
+# define libdl_hidden_ver(local, name)
+# define libdl_hidden_data_def(name)
+# define libdl_hidden_data_weak(name)
+# define libdl_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libnss_files)
+# define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libnss_files_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# define libnss_files_hidden_def(name) hidden_def (name)
+# define libnss_files_hidden_weak(name) hidden_weak (name)
+# define libnss_files_hidden_ver(local, name) hidden_ver (local, name)
+# define libnss_files_hidden_data_def(name) hidden_data_def (name)
+# define libnss_files_hidden_data_weak(name) hidden_data_weak (name)
+# define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name)
+#else
+# define libnss_files_hidden_proto(name, attrs...)
+# define libnss_files_hidden_tls_proto(name, attrs...)
+# define libnss_files_hidden_def(name)
+# define libnss_files_hidden_weak(name)
+# define libnss_files_hidden_ver(local, name)
+# define libnss_files_hidden_data_def(name)
+# define libnss_files_hidden_data_weak(name)
+# define libnss_files_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libnsl)
+# define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libnsl_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# ifdef LINK_OBSOLETE_NSL
+ /* libnsl_hidden_nolink should only get used in libnsl code. */
+# define libnsl_hidden_nolink_def(name, version) libnsl_hidden_def (name)
+# else
+# define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version)
+# endif
+# define libnsl_hidden_def(name) hidden_def (name)
+# define libnsl_hidden_weak(name) hidden_weak (name)
+# define libnsl_hidden_ver(local, name) hidden_ver (local, name)
+# define libnsl_hidden_data_def(name) hidden_data_def (name)
+# define libnsl_hidden_data_weak(name) hidden_data_weak (name)
+# define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libnsl_hidden_proto(name, attrs...)
+# define libnsl_hidden_tls_proto(name, attrs...)
+# define libnsl_hidden_def(name)
+# define libnsl_hidden_weak(name)
+# define libnsl_hidden_ver(local, name)
+# define libnsl_hidden_data_def(name)
+# define libnsl_hidden_data_weak(name)
+# define libnsl_hidden_data_ver(local, name)
+#endif
+
+#if IS_IN (libnss_nisplus)
+# define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libnss_nisplus_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# define libnss_nisplus_hidden_def(name) hidden_def (name)
+# define libnss_nisplus_hidden_weak(name) hidden_weak (name)
+# define libnss_nisplus_hidden_ver(local, name) hidden_ver (local, name)
+# define libnss_nisplus_hidden_data_def(name) hidden_data_def (name)
+# define libnss_nisplus_hidden_data_weak(name) hidden_data_weak (name)
+# define libnss_nisplus_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libnss_nisplus_hidden_proto(name, attrs...)
+# define libnss_nisplus_hidden_tls_proto(name, attrs...)
+# define libnss_nisplus_hidden_def(name)
+# define libnss_nisplus_hidden_weak(name)
+# define libnss_nisplus_hidden_ver(local, name)
+# define libnss_nisplus_hidden_data_def(name)
+# define libnss_nisplus_hidden_data_weak(name)
+# define libnss_nisplus_hidden_data_ver(local, name)
+#endif
+
+#define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
+#define libc_hidden_builtin_def(name) libc_hidden_def (name)
+#define libc_hidden_builtin_weak(name) libc_hidden_weak (name)
+#define libc_hidden_builtin_ver(local, name) libc_hidden_ver (local, name)
+#ifdef __ASSEMBLER__
+# define HIDDEN_BUILTIN_JUMPTARGET(name) HIDDEN_JUMPTARGET(name)
+#endif
+
+#if IS_IN (libutil)
+# define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
+# define libutil_hidden_tls_proto(name, attrs...) \
+ hidden_tls_proto (name, ##attrs)
+# define libutil_hidden_def(name) hidden_def (name)
+# define libutil_hidden_weak(name) hidden_weak (name)
+# define libutil_hidden_ver(local, name) hidden_ver (local, name)
+# define libutil_hidden_data_def(name) hidden_data_def (name)
+# define libutil_hidden_data_weak(name) hidden_data_weak (name)
+# define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name)
+#else
+# define libutil_hidden_proto(name, attrs...)
+# define libutil_hidden_tls_proto(name, attrs...)
+# define libutil_hidden_def(name)
+# define libutil_hidden_weak(name)
+# define libutil_hidden_ver(local, name)
+# define libutil_hidden_data_def(name)
+# define libutil_hidden_data_weak(name)
+# define libutil_hidden_data_ver(local, name)
+#endif
+
+/* Get some dirty hacks. */
+#include <symbol-hacks.h>
+
+/* Move compatibility symbols out of the way by placing them all in a
+ special section. */
+#ifndef __ASSEMBLER__
+# define attribute_compat_text_section \
+ __attribute__ ((section (".text.compat")))
+# define attribute_compat_data_section \
+ __attribute__ ((section (".data.compat")))
+#else
+# define compat_text_section .section ".text.compat", "ax";
+# define compat_data_section .section ".data.compat", "aw";
+#endif
+
+/* Helper / base macros for indirect function symbols. */
+#define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
+ classifier inhibit_stack_protector void *name##_ifunc (arg) \
+ { \
+ init (); \
+ __typeof (type_name) *res = expr; \
+ return res; \
+ }
+
+#ifdef HAVE_GCC_IFUNC
+# define __ifunc(type_name, name, expr, arg, init) \
+ extern __typeof (type_name) name __attribute__ \
+ ((ifunc (#name "_ifunc"))); \
+ __ifunc_resolver (type_name, name, expr, arg, init, static)
+
+# define __ifunc_hidden(type_name, name, expr, arg, init) \
+ __ifunc (type_name, name, expr, arg, init)
+#else
+/* Gcc does not support __attribute__ ((ifunc (...))). Use the old behaviour
+ as fallback. But keep in mind that the debug information for the ifunc
+ resolver functions is not correct. It contains the ifunc'ed function as
+ DW_AT_linkage_name. E.g. lldb uses this field and an inferior function
+ call of the ifunc'ed function will fail due to "no matching function for
+ call to ..." because the ifunc'ed function and the resolver function have
+ different signatures. (Gcc support is disabled at least on a ppc64le
+ Ubuntu 14.04 system.) */
+
+# define __ifunc(type_name, name, expr, arg, init) \
+ extern __typeof (type_name) name; \
+ void *name##_ifunc (arg) __asm__ (#name); \
+ __ifunc_resolver (type_name, name, expr, arg, init,) \
+ __asm__ (".type " #name ", %gnu_indirect_function");
+
+# define __ifunc_hidden(type_name, name, expr, arg, init) \
+ extern __typeof (type_name) __libc_##name; \
+ __ifunc (type_name, __libc_##name, expr, arg, init) \
+ strong_alias (__libc_##name, name);
+#endif /* !HAVE_GCC_IFUNC */
+
+/* The following macros are used for indirect function symbols in libc.so.
+ First of all, you need to have the function prototyped somewhere,
+ say in foo.h:
+
+ int foo (int __bar);
+
+ If you have an implementation for foo which e.g. uses a special hardware
+ feature which isn't available on all machines where this libc.so will be
+ used but decideable if available at runtime e.g. via hwcaps, you can provide
+ two or multiple implementations of foo:
+
+ int __foo_default (int __bar)
+ {
+ return __bar;
+ }
+
+ int __foo_special (int __bar)
+ {
+ return __bar;
+ }
+
+ If your function foo has no libc_hidden_proto (foo) defined for PLT
+ bypassing, you can use:
+
+ #define INIT_ARCH() unsigned long int hwcap = __GLRO(dl_hwcap);
+
+ libc_ifunc (foo, (hwcap & HWCAP_SPECIAL) ? __foo_special : __foo_default);
+
+ This will define a resolver function for foo which returns __foo_special or
+ __foo_default depending on your specified expression. Please note that you
+ have to define a macro function INIT_ARCH before using libc_ifunc macro as
+ it is called by the resolver function before evaluating the specified
+ expression. In this example it is used to prepare the hwcap variable.
+ The resolver function is assigned to an ifunc'ed symbol foo. Calls to foo
+ from inside or outside of libc.so will be indirected by a PLT call.
+
+ If your function foo has a libc_hidden_proto (foo) defined for PLT bypassing
+ and calls to foo within libc.so should always go to one specific
+ implementation of foo e.g. __foo_default then you have to add:
+
+ __hidden_ver1 (__foo_default, __GI_foo, __foo_default);
+
+ or a tweaked definition of libc_hidden_def macro after the __foo_default
+ function definition. Calls to foo within libc.so will always go directly to
+ __foo_default. Calls to foo from outside libc.so will be indirected by a
+ PLT call to ifunc'ed symbol foo which you have to define in a separate
+ compile unit:
+
+ #define foo __redirect_foo
+ #include <foo.h>
+ #undef foo
+
+ extern __typeof (__redirect_foo) __foo_default attribute_hidden;
+ extern __typeof (__redirect_foo) __foo_special attribute_hidden;
+
+ libc_ifunc_redirected (__redirect_foo, foo,
+ (hwcap & HWCAP_SPECIAL)
+ ? __foo_special
+ : __foo_default);
+
+ This will define the ifunc'ed symbol foo like above. The redirection of foo
+ in header file is needed to omit an additional defintion of __GI_foo which
+ would end in a linker error while linking libc.so. You have to specify
+ __redirect_foo as first parameter which is used within libc_ifunc_redirected
+ macro in conjunction with typeof to define the ifunc'ed symbol foo.
+
+ If your function foo has a libc_hidden_proto (foo) defined and calls to foo
+ within or from outside libc.so should go via ifunc'ed symbol, then you have
+ to use:
+
+ libc_ifunc_hidden (foo, foo,
+ (hwcap & HWCAP_SPECIAL)
+ ? __foo_special
+ : __foo_default);
+ libc_hidden_def (foo)
+
+ The first parameter foo of libc_ifunc_hidden macro is used in the same way
+ as for libc_ifunc_redirected macro. */
+
+#define libc_ifunc(name, expr) __ifunc (name, name, expr, void, INIT_ARCH)
+
+#define libc_ifunc_redirected(redirected_name, name, expr) \
+ __ifunc (redirected_name, name, expr, void, INIT_ARCH)
+
+#define libc_ifunc_hidden(redirected_name, name, expr) \
+ __ifunc_hidden (redirected_name, name, expr, void, INIT_ARCH)
+
+/* The body of the function is supposed to use __get_cpu_features
+ which will, if necessary, initialize the data first. */
+#define libm_ifunc_init()
+#define libm_ifunc(name, expr) \
+ __ifunc (name, name, expr, void, libm_ifunc_init)
+
+/* Add the compiler optimization to inhibit loop transformation to library
+ calls. This is used to avoid recursive calls in memset and memmove
+ default implementations. */
+#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
+# define inhibit_loop_to_libcall \
+ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
+#else
+# define inhibit_loop_to_libcall
+#endif
+
+/* These macros facilitate sharing source files with gnulib.
+
+ They are here instead of sys/cdefs.h because they should not be
+ used in public header files.
+
+ Their definitions should be kept consistent with the definitions in
+ gnulib-common.m4, but it is not necessary to cater to old non-GCC
+ compilers, since they will only be used while building glibc itself.
+ (Note that _GNUC_PREREQ cannot be used in this file.) */
+
+/* Define as a marker that can be attached to declarations that might not
+ be used. This helps to reduce warnings, such as from
+ GCC -Wunused-parameter. */
+#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_UNUSED
+#endif
+
+/* gcc supports the "unused" attribute on possibly unused labels, and
+ g++ has since version 4.5. Note to support C++ as well as C,
+ _GL_UNUSED_LABEL should be used with a trailing ; */
+#if !defined __cplusplus || __GNUC__ > 4 \
+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define _GL_UNUSED_LABEL _GL_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
+
+#endif /* !_ISOMAC */
+#endif /* libc-symbols.h */
diff --git a/REORG.TODO/include/libgen.h b/REORG.TODO/include/libgen.h
new file mode 100644
index 0000000000..4795d8e561
--- /dev/null
+++ b/REORG.TODO/include/libgen.h
@@ -0,0 +1 @@
+#include <misc/libgen.h>
diff --git a/REORG.TODO/include/libintl.h b/REORG.TODO/include/libintl.h
new file mode 100644
index 0000000000..9a11367ec6
--- /dev/null
+++ b/REORG.TODO/include/libintl.h
@@ -0,0 +1,53 @@
+#ifndef _LIBINTL_H
+#include <intl/libintl.h>
+
+# ifndef _ISOMAC
+
+#include <locale.h>
+
+/* Now define the internal interfaces. */
+extern char *__gettext (const char *__msgid)
+ __attribute_format_arg__ (1);
+extern char *__dgettext (const char *__domainname,
+ const char *__msgid)
+ __attribute_format_arg__ (2);
+extern char *__dcgettext (const char *__domainname,
+ const char *__msgid, int __category)
+ __attribute_format_arg__ (2);
+libc_hidden_proto (__dcgettext)
+
+extern char *__ngettext (const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
+ __attribute_format_arg__ (1) __attribute_format_arg__ (2);
+extern char *__dngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
+ __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+extern char *__dcngettext (const char *__domainname,
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
+ __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+
+extern char *__textdomain (const char *__domainname);
+extern char *__bindtextdomain (const char *__domainname,
+ const char *__dirname);
+extern char *__bind_textdomain_codeset (const char *__domainname,
+ const char *__codeset);
+
+extern const char _libc_intl_domainname[];
+libc_hidden_proto (_libc_intl_domainname)
+
+/* Define the macros `_' and `N_' for conveniently marking translatable
+ strings in the libc source code. We have to make sure we get the
+ correct definitions so we undefine the macros first. */
+
+# undef N_
+# define N_(msgid) msgid
+
+# undef _
+/* This is defined as an optimizing macro, so use it. */
+# define _(msgid) \
+ __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/libio.h b/REORG.TODO/include/libio.h
new file mode 100644
index 0000000000..d2fa796758
--- /dev/null
+++ b/REORG.TODO/include/libio.h
@@ -0,0 +1,45 @@
+#if !defined _ISOMAC && defined _IO_MTSAFE_IO
+# include <stdio-lock.h>
+#endif
+#include <libio/libio.h>
+
+#ifndef _ISOMAC
+#ifndef _LIBC_LIBIO_H
+#define _LIBC_LIBIO_H
+
+libc_hidden_proto (__overflow)
+libc_hidden_proto (__underflow)
+libc_hidden_proto (__uflow)
+libc_hidden_proto (__woverflow)
+libc_hidden_proto (__wunderflow)
+libc_hidden_proto (__wuflow)
+libc_hidden_proto (_IO_free_backup_area)
+libc_hidden_proto (_IO_free_wbackup_area)
+libc_hidden_proto (_IO_padn)
+libc_hidden_proto (_IO_putc)
+libc_hidden_proto (_IO_sgetn)
+libc_hidden_proto (_IO_vfprintf)
+libc_hidden_proto (_IO_vfscanf)
+
+#ifdef _IO_MTSAFE_IO
+# undef _IO_peekc
+# undef _IO_flockfile
+# undef _IO_funlockfile
+# undef _IO_ftrylockfile
+
+# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
+# if _IO_lock_inexpensive
+# define _IO_flockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock)
+# define _IO_funlockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock)
+# else
+# define _IO_flockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp)
+# define _IO_funlockfile(_fp) \
+ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp)
+# endif
+#endif /* _IO_MTSAFE_IO */
+
+#endif
+#endif
diff --git a/REORG.TODO/include/limits.h b/REORG.TODO/include/limits.h
new file mode 100644
index 0000000000..f2868b4d2f
--- /dev/null
+++ b/REORG.TODO/include/limits.h
@@ -0,0 +1,192 @@
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/*
+ * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h>
+ */
+
+#ifndef _LIBC_LIMITS_H_
+#define _LIBC_LIMITS_H_ 1
+
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
+
+
+/* Maximum length of any multibyte character in any locale.
+ We define this value here since the gcc header does not define
+ the correct value. */
+#define MB_LEN_MAX 16
+
+
+/* If we are not using GNU CC we have to define all the symbols ourself.
+ Otherwise use gcc's definitions (see below). */
+#if !defined __GNUC__ || __GNUC__ < 2
+
+/* We only protect from multiple inclusion here, because all the other
+ #include's protect themselves, and in GCC 2 we may #include_next through
+ multiple copies of this file before we get to GCC's. */
+# ifndef _LIMITS_H
+# define _LIMITS_H 1
+
+#include <bits/wordsize.h>
+
+/* We don't have #include_next.
+ Define ANSI <limits.h> for standard 32-bit words. */
+
+/* These assume 8-bit `char's, 16-bit `short int's,
+ and 32-bit `int's and `long int's. */
+
+/* Number of bits in a `char'. */
+# define CHAR_BIT 8
+
+/* Minimum and maximum values a `signed char' can hold. */
+# define SCHAR_MIN (-128)
+# define SCHAR_MAX 127
+
+/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
+# define UCHAR_MAX 255
+
+/* Minimum and maximum values a `char' can hold. */
+# ifdef __CHAR_UNSIGNED__
+# define CHAR_MIN 0
+# define CHAR_MAX UCHAR_MAX
+# else
+# define CHAR_MIN SCHAR_MIN
+# define CHAR_MAX SCHAR_MAX
+# endif
+
+/* Minimum and maximum values a `signed short int' can hold. */
+# define SHRT_MIN (-32768)
+# define SHRT_MAX 32767
+
+/* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
+# define USHRT_MAX 65535
+
+/* Minimum and maximum values a `signed int' can hold. */
+# define INT_MIN (-INT_MAX - 1)
+# define INT_MAX 2147483647
+
+/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
+# define UINT_MAX 4294967295U
+
+/* Minimum and maximum values a `signed long int' can hold. */
+# if __WORDSIZE == 64
+# define LONG_MAX 9223372036854775807L
+# else
+# define LONG_MAX 2147483647L
+# endif
+# define LONG_MIN (-LONG_MAX - 1L)
+
+/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
+# if __WORDSIZE == 64
+# define ULONG_MAX 18446744073709551615UL
+# else
+# define ULONG_MAX 4294967295UL
+# endif
+
+# ifdef __USE_ISOC99
+
+/* Minimum and maximum values a `signed long long int' can hold. */
+# define LLONG_MAX 9223372036854775807LL
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
+# define ULLONG_MAX 18446744073709551615ULL
+
+# endif /* ISO C99 */
+
+# endif /* limits.h */
+#endif /* GCC 2. */
+
+#endif /* !_LIBC_LIMITS_H_ */
+
+ /* Get the compiler's limits.h, which defines almost all the ISO constants.
+
+ We put this #include_next outside the double inclusion check because
+ it should be possible to include this file more than once and still get
+ the definitions from gcc's header. */
+#if defined __GNUC__ && !defined _GCC_LIMITS_H_
+/* `_GCC_LIMITS_H_' is what GCC's file defines. */
+# include_next <limits.h>
+#endif
+
+/* The <limits.h> files in some gcc versions don't define LLONG_MIN,
+ LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for
+ ages are available. */
+#if defined __USE_ISOC99 && defined __GNUC__
+# ifndef LLONG_MIN
+# define LLONG_MIN (-LLONG_MAX-1)
+# endif
+# ifndef LLONG_MAX
+# define LLONG_MAX __LONG_LONG_MAX__
+# endif
+# ifndef ULLONG_MAX
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
+# endif
+#endif
+
+/* The integer width macros are not defined by GCC's <limits.h> before
+ GCC 7, or if _GNU_SOURCE rather than
+ __STDC_WANT_IEC_60559_BFP_EXT__ is used to enable this feature. */
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+# ifndef CHAR_WIDTH
+# define CHAR_WIDTH 8
+# endif
+# ifndef SCHAR_WIDTH
+# define SCHAR_WIDTH 8
+# endif
+# ifndef UCHAR_WIDTH
+# define UCHAR_WIDTH 8
+# endif
+# ifndef SHRT_WIDTH
+# define SHRT_WIDTH 16
+# endif
+# ifndef USHRT_WIDTH
+# define USHRT_WIDTH 16
+# endif
+# ifndef INT_WIDTH
+# define INT_WIDTH 32
+# endif
+# ifndef UINT_WIDTH
+# define UINT_WIDTH 32
+# endif
+# ifndef LONG_WIDTH
+# define LONG_WIDTH __WORDSIZE
+# endif
+# ifndef ULONG_WIDTH
+# define ULONG_WIDTH __WORDSIZE
+# endif
+# ifndef LLONG_WIDTH
+# define LLONG_WIDTH 64
+# endif
+# ifndef ULLONG_WIDTH
+# define ULLONG_WIDTH 64
+# endif
+#endif /* Use IEC_60559_BFP_EXT. */
+
+#ifdef __USE_POSIX
+/* POSIX adds things to <limits.h>. */
+# include <bits/posix1_lim.h>
+#endif
+
+#ifdef __USE_POSIX2
+# include <bits/posix2_lim.h>
+#endif
+
+#ifdef __USE_XOPEN
+# include <bits/xopen_lim.h>
+#endif
diff --git a/REORG.TODO/include/link.h b/REORG.TODO/include/link.h
new file mode 100644
index 0000000000..eeb5f4d53b
--- /dev/null
+++ b/REORG.TODO/include/link.h
@@ -0,0 +1,351 @@
+/* Data structure for communication from the run-time dynamic linker for
+ loaded ELF shared objects.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _PRIVATE_LINK_H
+#define _PRIVATE_LINK_H 1
+
+#ifdef _LINK_H
+# error this should be impossible
+#endif
+
+# ifndef _ISOMAC
+/* Get most of the contents from the public header, but we define a
+ different `struct link_map' type for private use. The la_objopen
+ prototype uses the type, so we have to declare it separately. */
+# define link_map link_map_public
+# define la_objopen la_objopen_wrongproto
+# endif
+
+#include <elf/link.h>
+
+# ifndef _ISOMAC
+
+#undef link_map
+#undef la_objopen
+
+struct link_map;
+extern unsigned int la_objopen (struct link_map *__map, Lmid_t __lmid,
+ uintptr_t *__cookie);
+
+#include <stdint.h>
+#include <stddef.h>
+#include <linkmap.h>
+#include <dl-fileid.h>
+#include <dl-lookupcfg.h>
+#include <tls.h>
+#include <libc-lock.h>
+
+
+/* Some internal data structures of the dynamic linker used in the
+ linker map. We only provide forward declarations. */
+struct libname_list;
+struct r_found_version;
+struct r_search_path_elem;
+
+/* Forward declaration. */
+struct link_map;
+
+/* Structure to describe a single list of scope elements. The lookup
+ functions get passed an array of pointers to such structures. */
+struct r_scope_elem
+{
+ /* Array of maps for the scope. */
+ struct link_map **r_list;
+ /* Number of entries in the scope. */
+ unsigned int r_nlist;
+};
+
+
+/* Structure to record search path and allocation mechanism. */
+struct r_search_path_struct
+ {
+ struct r_search_path_elem **dirs;
+ int malloced;
+ };
+
+
+/* Structure describing a loaded shared object. The `l_next' and `l_prev'
+ members form a chain of all the shared objects loaded at startup.
+
+ These data structures exist in space used by the run-time dynamic linker;
+ modifying them may have disastrous results.
+
+ This data structure might change in future, if necessary. User-level
+ programs must avoid defining objects of this type. */
+
+struct link_map
+ {
+ /* These first few members are part of the protocol with the debugger.
+ This is the same format used in SVR4. */
+
+ ElfW(Addr) l_addr; /* Difference between the address in the ELF
+ file and the addresses in memory. */
+ char *l_name; /* Absolute file name object was found in. */
+ ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
+ struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
+
+ /* All following members are internal to the dynamic linker.
+ They may change without notice. */
+
+ /* This is an element which is only ever different from a pointer to
+ the very same copy of this type for ld.so when it is used in more
+ than one namespace. */
+ struct link_map *l_real;
+
+ /* Number of the namespace this link map belongs to. */
+ Lmid_t l_ns;
+
+ struct libname_list *l_libname;
+ /* Indexed pointers to dynamic section.
+ [0,DT_NUM) are indexed by the processor-independent tags.
+ [DT_NUM,DT_NUM+DT_THISPROCNUM) are indexed by the tag minus DT_LOPROC.
+ [DT_NUM+DT_THISPROCNUM,DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM) are
+ indexed by DT_VERSIONTAGIDX(tagvalue).
+ [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM,
+ DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM) are indexed by
+ DT_EXTRATAGIDX(tagvalue).
+ [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM,
+ DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM) are
+ indexed by DT_VALTAGIDX(tagvalue) and
+ [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM,
+ DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM+DT_VALNUM+DT_ADDRNUM)
+ are indexed by DT_ADDRTAGIDX(tagvalue), see <elf.h>. */
+
+ ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ + DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM];
+ const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
+ ElfW(Addr) l_entry; /* Entry point location. */
+ ElfW(Half) l_phnum; /* Number of program header entries. */
+ ElfW(Half) l_ldnum; /* Number of dynamic segment entries. */
+
+ /* Array of DT_NEEDED dependencies and their dependencies, in
+ dependency order for symbol lookup (with and without
+ duplicates). There is no entry before the dependencies have
+ been loaded. */
+ struct r_scope_elem l_searchlist;
+
+ /* We need a special searchlist to process objects marked with
+ DT_SYMBOLIC. */
+ struct r_scope_elem l_symbolic_searchlist;
+
+ /* Dependent object that first caused this object to be loaded. */
+ struct link_map *l_loader;
+
+ /* Array with version names. */
+ struct r_found_version *l_versions;
+ unsigned int l_nversions;
+
+ /* Symbol hash table. */
+ Elf_Symndx l_nbuckets;
+ Elf32_Word l_gnu_bitmask_idxbits;
+ Elf32_Word l_gnu_shift;
+ const ElfW(Addr) *l_gnu_bitmask;
+ union
+ {
+ const Elf32_Word *l_gnu_buckets;
+ const Elf_Symndx *l_chain;
+ };
+ union
+ {
+ const Elf32_Word *l_gnu_chain_zero;
+ const Elf_Symndx *l_buckets;
+ };
+
+ unsigned int l_direct_opencount; /* Reference count for dlopen/dlclose. */
+ enum /* Where this object came from. */
+ {
+ lt_executable, /* The main executable program. */
+ lt_library, /* Library needed by main executable. */
+ lt_loaded /* Extra run-time loaded shared object. */
+ } l_type:2;
+ unsigned int l_relocated:1; /* Nonzero if object's relocations done. */
+ unsigned int l_init_called:1; /* Nonzero if DT_INIT function called. */
+ unsigned int l_global:1; /* Nonzero if object in _dl_global_scope. */
+ unsigned int l_reserved:2; /* Reserved for internal use. */
+ unsigned int l_phdr_allocated:1; /* Nonzero if the data structure pointed
+ to by `l_phdr' is allocated. */
+ unsigned int l_soname_added:1; /* Nonzero if the SONAME is for sure in
+ the l_libname list. */
+ unsigned int l_faked:1; /* Nonzero if this is a faked descriptor
+ without associated file. */
+ unsigned int l_need_tls_init:1; /* Nonzero if GL(dl_init_static_tls)
+ should be called on this link map
+ when relocation finishes. */
+ unsigned int l_auditing:1; /* Nonzero if the DSO is used in auditing. */
+ unsigned int l_audit_any_plt:1; /* Nonzero if at least one audit module
+ is interested in the PLT interception.*/
+ unsigned int l_removed:1; /* Nozero if the object cannot be used anymore
+ since it is removed. */
+ unsigned int l_contiguous:1; /* Nonzero if inter-segment holes are
+ mprotected or if no holes are present at
+ all. */
+ unsigned int l_symbolic_in_local_scope:1; /* Nonzero if l_local_scope
+ during LD_TRACE_PRELINKING=1
+ contains any DT_SYMBOLIC
+ libraries. */
+ unsigned int l_free_initfini:1; /* Nonzero if l_initfini can be
+ freed, ie. not allocated with
+ the dummy malloc in ld.so. */
+
+ /* Collected information about own RPATH directories. */
+ struct r_search_path_struct l_rpath_dirs;
+
+ /* Collected results of relocation while profiling. */
+ struct reloc_result
+ {
+ DL_FIXUP_VALUE_TYPE addr;
+ struct link_map *bound;
+ unsigned int boundndx;
+ uint32_t enterexit;
+ unsigned int flags;
+ } *l_reloc_result;
+
+ /* Pointer to the version information if available. */
+ ElfW(Versym) *l_versyms;
+
+ /* String specifying the path where this object was found. */
+ const char *l_origin;
+
+ /* Start and finish of memory map for this object. l_map_start
+ need not be the same as l_addr. */
+ ElfW(Addr) l_map_start, l_map_end;
+ /* End of the executable part of the mapping. */
+ ElfW(Addr) l_text_end;
+
+ /* Default array for 'l_scope'. */
+ struct r_scope_elem *l_scope_mem[4];
+ /* Size of array allocated for 'l_scope'. */
+ size_t l_scope_max;
+ /* This is an array defining the lookup scope for this link map.
+ There are initially at most three different scope lists. */
+ struct r_scope_elem **l_scope;
+
+ /* A similar array, this time only with the local scope. This is
+ used occasionally. */
+ struct r_scope_elem *l_local_scope[2];
+
+ /* This information is kept to check for sure whether a shared
+ object is the same as one already loaded. */
+ struct r_file_id l_file_id;
+
+ /* Collected information about own RUNPATH directories. */
+ struct r_search_path_struct l_runpath_dirs;
+
+ /* List of object in order of the init and fini calls. */
+ struct link_map **l_initfini;
+
+ /* List of the dependencies introduced through symbol binding. */
+ struct link_map_reldeps
+ {
+ unsigned int act;
+ struct link_map *list[];
+ } *l_reldeps;
+ unsigned int l_reldepsmax;
+
+ /* Nonzero if the DSO is used. */
+ unsigned int l_used;
+
+ /* Various flag words. */
+ ElfW(Word) l_feature_1;
+ ElfW(Word) l_flags_1;
+ ElfW(Word) l_flags;
+
+ /* Temporarily used in `dl_close'. */
+ int l_idx;
+
+ struct link_map_machine l_mach;
+
+ struct
+ {
+ const ElfW(Sym) *sym;
+ int type_class;
+ struct link_map *value;
+ const ElfW(Sym) *ret;
+ } l_lookup_cache;
+
+ /* Thread-local storage related info. */
+
+ /* Start of the initialization image. */
+ void *l_tls_initimage;
+ /* Size of the initialization image. */
+ size_t l_tls_initimage_size;
+ /* Size of the TLS block. */
+ size_t l_tls_blocksize;
+ /* Alignment requirement of the TLS block. */
+ size_t l_tls_align;
+ /* Offset of first byte module alignment. */
+ size_t l_tls_firstbyte_offset;
+#ifndef NO_TLS_OFFSET
+# define NO_TLS_OFFSET 0
+#endif
+#ifndef FORCED_DYNAMIC_TLS_OFFSET
+# if NO_TLS_OFFSET == 0
+# define FORCED_DYNAMIC_TLS_OFFSET -1
+# elif NO_TLS_OFFSET == -1
+# define FORCED_DYNAMIC_TLS_OFFSET -2
+# else
+# error "FORCED_DYNAMIC_TLS_OFFSET is not defined"
+# endif
+#endif
+ /* For objects present at startup time: offset in the static TLS block. */
+ ptrdiff_t l_tls_offset;
+ /* Index of the module in the dtv array. */
+ size_t l_tls_modid;
+
+ /* Number of thread_local objects constructed by this DSO. This is
+ atomically accessed and modified and is not always protected by the load
+ lock. See also: CONCURRENCY NOTES in cxa_thread_atexit_impl.c. */
+ size_t l_tls_dtor_count;
+
+ /* Information used to change permission after the relocations are
+ done. */
+ ElfW(Addr) l_relro_addr;
+ size_t l_relro_size;
+
+ unsigned long long int l_serial;
+
+ /* Audit information. This array apparent must be the last in the
+ structure. Never add something after it. */
+ struct auditstate
+ {
+ uintptr_t cookie;
+ unsigned int bindflags;
+ } l_audit[0];
+ };
+
+
+#if __ELF_NATIVE_CLASS == 32
+# define symbind symbind32
+#elif __ELF_NATIVE_CLASS == 64
+# define symbind symbind64
+#else
+# error "__ELF_NATIVE_CLASS must be defined"
+#endif
+
+extern int __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
+ size_t size, void *data),
+ void *data);
+
+/* We use this macro to refer to ELF macros independent of the native
+ wordsize. `ELFW(R_TYPE)' is used in place of `ELF32_R_TYPE' or
+ `ELF64_R_TYPE'. */
+#define ELFW(type) _ElfW (ELF, __ELF_NATIVE_CLASS, type)
+
+# endif /* !_ISOMAC */
+#endif /* include/link.h */
diff --git a/REORG.TODO/include/list.h b/REORG.TODO/include/list.h
new file mode 100644
index 0000000000..dec5deef8e
--- /dev/null
+++ b/REORG.TODO/include/list.h
@@ -0,0 +1,99 @@
+/* Copyright (C) 2002-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIST_H
+#define _LIST_H 1
+
+/* Internal: doubly linked lists. */
+
+/* The definitions of this file are adopted from those which can be
+ found in the Linux kernel headers to enable people familiar with
+ the latter find their way in these sources as well. */
+
+#include <list_t.h>
+#include <atomic.h>
+
+/* Define a variable with the head and tail of the list. */
+#define LIST_HEAD(name) \
+ list_t name = { &(name), &(name) }
+
+/* Initialize a new list head. */
+#define INIT_LIST_HEAD(ptr) \
+ (ptr)->next = (ptr)->prev = (ptr)
+
+
+/* Add new element at the head of the list. */
+static inline void
+list_add (list_t *newp, list_t *head)
+{
+ newp->next = head->next;
+ newp->prev = head;
+ head->next->prev = newp;
+ atomic_write_barrier ();
+ head->next = newp;
+}
+
+
+/* Remove element from list. */
+static inline void
+list_del (list_t *elem)
+{
+ elem->next->prev = elem->prev;
+ elem->prev->next = elem->next;
+}
+
+
+/* Join two lists. */
+static inline void
+list_splice (list_t *add, list_t *head)
+{
+ /* Do nothing if the list which gets added is empty. */
+ if (add != add->next)
+ {
+ add->next->prev = head;
+ add->prev->next = head->next;
+ head->next->prev = add->prev;
+ head->next = add->next;
+ }
+}
+
+
+/* Get typed element from list at a given position. */
+#define list_entry(ptr, type, member) \
+ ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
+
+
+
+/* Iterate forward over the elements of the list. */
+#define list_for_each(pos, head) \
+ for (pos = (head)->next; pos != (head); pos = pos->next)
+
+
+/* Iterate forward over the elements of the list. */
+#define list_for_each_prev(pos, head) \
+ for (pos = (head)->prev; pos != (head); pos = pos->prev)
+
+
+/* Iterate backwards over the elements list. The list elements can be
+ removed from the list while doing this. */
+#define list_for_each_prev_safe(pos, p, head) \
+ for (pos = (head)->prev, p = pos->prev; \
+ pos != (head); \
+ pos = p, p = pos->prev)
+
+#endif /* list.h */
diff --git a/REORG.TODO/include/list_t.h b/REORG.TODO/include/list_t.h
new file mode 100644
index 0000000000..d737e2e214
--- /dev/null
+++ b/REORG.TODO/include/list_t.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 2002-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LIST_T_H
+#define _LIST_T_H 1
+
+/* Internal: doubly linked lists. */
+
+/* Basic type for the double-link list. */
+typedef struct list_head
+{
+ struct list_head *next;
+ struct list_head *prev;
+} list_t;
+
+#endif /* list_t.h */
diff --git a/REORG.TODO/include/locale.h b/REORG.TODO/include/locale.h
new file mode 100644
index 0000000000..8091e1dc80
--- /dev/null
+++ b/REORG.TODO/include/locale.h
@@ -0,0 +1,26 @@
+#ifndef _LOCALE_H
+#include <locale/locale.h>
+
+#ifndef _ISOMAC
+extern __typeof (uselocale) __uselocale;
+
+libc_hidden_proto (setlocale)
+libc_hidden_proto (__uselocale)
+
+/* This has to be changed whenever a new locale is defined. */
+#define __LC_LAST 13
+
+extern struct loaded_l10nfile *_nl_locale_file_list[] attribute_hidden;
+
+/* Locale object for C locale. */
+extern const struct __locale_struct _nl_C_locobj attribute_hidden;
+#define _nl_C_locobj_ptr ((struct __locale_struct *) &_nl_C_locobj)
+
+/* Now define the internal interfaces. */
+extern struct lconv *__localeconv (void);
+
+/* Fetch the name of the current locale set in the given category. */
+extern const char *__current_locale_name (int category) attribute_hidden;
+
+#endif
+#endif
diff --git a/REORG.TODO/include/malloc.h b/REORG.TODO/include/malloc.h
new file mode 100644
index 0000000000..70d32c7c84
--- /dev/null
+++ b/REORG.TODO/include/malloc.h
@@ -0,0 +1,16 @@
+#ifndef _MALLOC_H
+#include <malloc/malloc.h>
+
+# ifndef _ISOMAC
+
+/* In the GNU libc we rename the global variable
+ `__malloc_initialized' to `__libc_malloc_initialized'. */
+#define __malloc_initialized __libc_malloc_initialized
+/* Nonzero if the malloc is already initialized. */
+extern int __malloc_initialized attribute_hidden;
+
+struct malloc_state;
+typedef struct malloc_state *mstate;
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/math.h b/REORG.TODO/include/math.h
new file mode 100644
index 0000000000..a069680233
--- /dev/null
+++ b/REORG.TODO/include/math.h
@@ -0,0 +1,60 @@
+#ifndef _MATH_H
+
+#ifdef _ISOMAC
+# undef NO_LONG_DOUBLE
+# undef _Mlong_double_
+#endif
+
+#include <math/math.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __matherr (struct exception *__exc);
+
+extern int __signgam;
+
+# if IS_IN (libc) || IS_IN (libm)
+hidden_proto (__finite)
+hidden_proto (__isinf)
+hidden_proto (__isnan)
+hidden_proto (__finitef)
+hidden_proto (__isinff)
+hidden_proto (__isnanf)
+
+# ifndef __NO_LONG_DOUBLE_MATH
+hidden_proto (__finitel)
+hidden_proto (__isinfl)
+hidden_proto (__isnanl)
+# endif
+
+# if __HAVE_DISTINCT_FLOAT128
+hidden_proto (__finitef128)
+hidden_proto (__isinff128)
+hidden_proto (__isnanf128)
+# endif
+# endif
+
+libm_hidden_proto (__fpclassify)
+libm_hidden_proto (__fpclassifyf)
+libm_hidden_proto (__issignaling)
+libm_hidden_proto (__issignalingf)
+libm_hidden_proto (__exp)
+libm_hidden_proto (__expf)
+libm_hidden_proto (roundeven)
+
+# ifndef __NO_LONG_DOUBLE_MATH
+libm_hidden_proto (__fpclassifyl)
+libm_hidden_proto (__issignalingl)
+libm_hidden_proto (__expl)
+libm_hidden_proto (__expm1l)
+# endif
+
+# if __HAVE_DISTINCT_FLOAT128
+libm_hidden_proto (__fpclassifyf128)
+libm_hidden_proto (__issignalingf128)
+libm_hidden_proto (__expf128)
+libm_hidden_proto (__expm1f128)
+# endif
+
+#endif
+#endif
diff --git a/REORG.TODO/include/mcheck.h b/REORG.TODO/include/mcheck.h
new file mode 100644
index 0000000000..8883c3d53e
--- /dev/null
+++ b/REORG.TODO/include/mcheck.h
@@ -0,0 +1,11 @@
+#ifndef _MCHECK_H
+
+#include <malloc/mcheck.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (mcheck)
+libc_hidden_proto (mcheck_check_all)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/memory.h b/REORG.TODO/include/memory.h
new file mode 100644
index 0000000000..1ec3e63fc9
--- /dev/null
+++ b/REORG.TODO/include/memory.h
@@ -0,0 +1 @@
+#include <string/memory.h>
diff --git a/REORG.TODO/include/mntent.h b/REORG.TODO/include/mntent.h
new file mode 100644
index 0000000000..169210fc66
--- /dev/null
+++ b/REORG.TODO/include/mntent.h
@@ -0,0 +1,20 @@
+#ifndef _MNTENT_H
+#include <misc/mntent.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern FILE *__setmntent (const char *__file, const char *__mode);
+extern struct mntent *__getmntent_r (FILE *__stream,
+ struct mntent *__result,
+ char *__buffer, int __bufsize);
+extern int __addmntent (FILE *__stream, const struct mntent *__mnt);
+extern int __endmntent (FILE *__stream);
+extern char *__hasmntopt (const struct mntent *__mnt, const char *__opt);
+
+libc_hidden_proto (__setmntent)
+libc_hidden_proto (__getmntent_r)
+libc_hidden_proto (__endmntent)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/monetary.h b/REORG.TODO/include/monetary.h
new file mode 100644
index 0000000000..e6870138f8
--- /dev/null
+++ b/REORG.TODO/include/monetary.h
@@ -0,0 +1,7 @@
+#include <stdlib/monetary.h>
+#ifndef _ISOMAC
+#include <stdarg.h>
+
+extern ssize_t __vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
+ const char *format, va_list ap);
+#endif
diff --git a/REORG.TODO/include/mqueue.h b/REORG.TODO/include/mqueue.h
new file mode 100644
index 0000000000..3c66f1711e
--- /dev/null
+++ b/REORG.TODO/include/mqueue.h
@@ -0,0 +1,13 @@
+#include <rt/mqueue.h>
+
+#ifndef _ISOMAC
+# if IS_IN (librt)
+hidden_proto (mq_timedsend)
+extern __typeof (mq_timedsend) __mq_timedsend __nonnull ((2, 5));
+hidden_proto (__mq_timedsend)
+hidden_proto (mq_timedreceive)
+extern __typeof (mq_timedreceive) __mq_timedreceive __nonnull ((2, 5));
+hidden_proto (__mq_timedreceive)
+hidden_proto (mq_setattr)
+# endif
+#endif
diff --git a/REORG.TODO/include/net/if.h b/REORG.TODO/include/net/if.h
new file mode 100644
index 0000000000..6c4cbc96c3
--- /dev/null
+++ b/REORG.TODO/include/net/if.h
@@ -0,0 +1,16 @@
+#ifndef _NET_IF_H
+
+# include_next <net/if.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (if_nametoindex)
+extern __typeof (if_nametoindex) __if_nametoindex;
+libc_hidden_proto (__if_nametoindex)
+libc_hidden_proto (if_indextoname)
+libc_hidden_proto (if_nameindex)
+libc_hidden_proto (if_freenameindex)
+extern __typeof (if_freenameindex) __if_freenameindex;
+libc_hidden_proto (__if_freenameindex)
+#endif
+
+#endif
diff --git a/REORG.TODO/include/netdb.h b/REORG.TODO/include/netdb.h
new file mode 100644
index 0000000000..d425a64506
--- /dev/null
+++ b/REORG.TODO/include/netdb.h
@@ -0,0 +1,284 @@
+#ifndef _NETDB_H
+#include <resolv/netdb.h>
+
+#ifndef _ISOMAC
+# include <stdint.h>
+/* Macros for accessing h_errno from inside libc. */
+# if IS_IN_LIB
+# undef h_errno
+# if IS_IN (libc)
+# define h_errno __libc_h_errno
+# else
+# define h_errno __h_errno
+# endif
+extern __thread int h_errno attribute_tls_model_ie;
+# endif /* IS_IN_LIB */
+# define __set_h_errno(x) (h_errno = (x))
+
+libc_hidden_proto (hstrerror)
+libc_hidden_proto (innetgr)
+libc_hidden_proto (rcmd_af)
+libc_hidden_proto (rexec_af)
+libc_hidden_proto (rresvport_af)
+libc_hidden_proto (ruserok_af)
+
+libc_hidden_proto (getaddrinfo)
+libc_hidden_proto (getnameinfo)
+libc_hidden_proto (freeaddrinfo)
+libc_hidden_proto (gai_strerror)
+libc_hidden_proto (__h_errno_location)
+
+/* Document internal interfaces. */
+extern int __gethostent_r (struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop) attribute_hidden;
+extern int __old_gethostent_r (struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __gethostbyaddr_r (const void *__restrict __addr,
+ socklen_t __len, int __type,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+extern int __old_gethostbyaddr_r (const void *__restrict __addr,
+ socklen_t __len, int __type,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __gethostbyaddr2_r (const void *__restrict __addr,
+ socklen_t __len, int __type,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop,
+ int32_t *ttlp);
+
+extern int __gethostbyname_r (const char *__restrict __name,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+extern int __old_gethostbyname_r (const char *__restrict __name,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __gethostbyname2_r (const char *__restrict __name, int __af,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+extern int __old_gethostbyname2_r (const char *__restrict __name, int __af,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __gethostbyname3_r (const char *__restrict __name, int __af,
+ struct hostent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct hostent **__restrict __result,
+ int *__restrict __h_errnop,
+ int32_t *ttlp, char **canonp);
+
+extern int __getnetent_r (struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop) attribute_hidden;
+extern int __old_getnetent_r (struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __getnetbyaddr_r (uint32_t __net, int __type,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+extern int __old_getnetbyaddr_r (uint32_t __net, int __type,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __getnetbyname_r (const char *__restrict __name,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+extern int __old_getnetbyname_r (const char *__restrict __name,
+ struct netent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct netent **__restrict __result,
+ int *__restrict __h_errnop);
+
+extern int __getservent_r (struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result)
+ attribute_hidden;
+extern int __old_getservent_r (struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int __getservbyname_r (const char *__restrict __name,
+ const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+extern int __old_getservbyname_r (const char *__restrict __name,
+ const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int __getservbyport_r (int __port,
+ const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+extern int __old_getservbyport_r (int __port,
+ const char *__restrict __proto,
+ struct servent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct servent **__restrict __result);
+
+extern int __getprotoent_r (struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result)
+ attribute_hidden;
+extern int __old_getprotoent_r (struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int __getprotobyname_r (const char *__restrict __name,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+extern int __old_getprotobyname_r (const char *__restrict __name,
+ struct protoent *__restrict __result_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int __getprotobynumber_r (int __proto,
+ struct protoent *__restrict __res_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+extern int __old_getprotobynumber_r (int __proto,
+ struct protoent *__restrict __res_buf,
+ char *__restrict __buf, size_t __buflen,
+ struct protoent **__restrict __result);
+
+extern int __getnetgrent_r (char **__restrict __hostp,
+ char **__restrict __userp,
+ char **__restrict __domainp,
+ char *__restrict __buffer, size_t __buflen);
+
+extern int ruserpass (const char *host, const char **aname,
+ const char **apass);
+libc_hidden_proto (ruserpass)
+
+
+/* The following definition has been removed from the public header
+ since we don't want people to use them. */
+
+#define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG)
+
+#include <inet/netgroup.h>
+
+struct parser_data;
+extern int _nss_files_parse_protoent (char *line, struct protoent *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+extern int _nss_files_parse_servent (char *line, struct servent *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+extern int _nss_files_parse_netent (char *line, struct netent *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+extern enum nss_status _nss_netgroup_parseline (char **cursor,
+ struct __netgrent *result,
+ char *buffer, size_t buflen,
+ int *errnop);
+libnss_files_hidden_proto (_nss_files_parse_protoent)
+libnss_files_hidden_proto (_nss_files_parse_servent)
+libnss_files_hidden_proto (_nss_files_parse_netent)
+libnss_files_hidden_proto (_nss_netgroup_parseline)
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setprotoent (int); \
+extern enum nss_status _nss_ ## service ## _endprotoent (void); \
+extern enum nss_status _nss_ ## service ## _getprotoent_r \
+ (struct protoent *proto, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ## _getprotobyname_r \
+ (const char *name, struct protoent *proto, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _getprotobynumber_r \
+ (int number, struct protoent *proto, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _sethostent (int); \
+extern enum nss_status _nss_ ## service ## _endhostent (void); \
+extern enum nss_status _nss_ ## service ## _gethostent_r \
+ (struct hostent *host, char *buffer, size_t buflen, \
+ int *errnop, int *h_errnop); \
+extern enum nss_status _nss_ ## service ## _gethostbyname2_r \
+ (const char *name, int af, struct hostent *host, \
+ char *buffer, size_t buflen, int *errnop, \
+ int *h_errnop); \
+extern enum nss_status _nss_ ## service ## _gethostbyname_r \
+ (const char *name, struct hostent *host, char *buffer, \
+ size_t buflen, int *errnop, int *h_errnop); \
+extern enum nss_status _nss_ ## service ## _gethostbyaddr_r \
+ (const void *addr, socklen_t addrlen, int af, \
+ struct hostent *host, char *buffer, size_t buflen, \
+ int *errnop, int *h_errnop); \
+extern enum nss_status _nss_ ## service ## _setservent (int); \
+extern enum nss_status _nss_ ## service ## _endservent (void); \
+extern enum nss_status _nss_ ## service ## _getservent_r \
+ (struct servent *serv, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ## _getservbyname_r \
+ (const char *name, const char *protocol, \
+ struct servent *serv, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ## _getservbyport_r \
+ (int port, const char *protocol, struct servent *serv, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _setnetgrent \
+ (const char *group, struct __netgrent *result); \
+extern enum nss_status _nss_ ## service ## _endnetgrent \
+ (struct __netgrent *result); \
+extern enum nss_status _nss_ ## service ## _getnetgrent_r \
+ (struct __netgrent *result, char *buffer, \
+ size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _setnetent (int stayopen); \
+extern enum nss_status _nss_ ## service ## _endnetent (void); \
+extern enum nss_status _nss_ ## service ## _getnetent_r \
+ (struct netent *net, char *buffer, size_t buflen, \
+ int *errnop, int *herrnop); \
+extern enum nss_status _nss_ ## service ## _getnetbyname_r \
+ (const char *name, struct netent *net, char *buffer, \
+ size_t buflen, int *errnop, int *herrnop); \
+extern enum nss_status _nss_ ## service ## _getnetbyaddr_r \
+ (uint32_t addr, int type, struct netent *net, \
+ char *buffer, size_t buflen, int *errnop, \
+ int *herrnop);
+
+DECLARE_NSS_PROTOTYPES (compat)
+DECLARE_NSS_PROTOTYPES (dns)
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (hesiod)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+#endif
+
+#endif /* !_NETDB_H */
diff --git a/REORG.TODO/include/netgroup.h b/REORG.TODO/include/netgroup.h
new file mode 100644
index 0000000000..4b2b284cdb
--- /dev/null
+++ b/REORG.TODO/include/netgroup.h
@@ -0,0 +1 @@
+#include <inet/netgroup.h>
diff --git a/REORG.TODO/include/netinet/ether.h b/REORG.TODO/include/netinet/ether.h
new file mode 100644
index 0000000000..8bfe7e03ad
--- /dev/null
+++ b/REORG.TODO/include/netinet/ether.h
@@ -0,0 +1,45 @@
+#ifndef _NETINET_ETHER_H
+#include <inet/netinet/ether.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (ether_aton_r)
+libc_hidden_proto (ether_ntoa_r)
+
+/* Because the `ethers' lookup does not fit so well in the scheme we
+ define a dummy struct here which helps us to use the available
+ functions. */
+struct etherent
+{
+ const char *e_name;
+ struct ether_addr e_addr;
+};
+
+struct parser_data;
+extern int _nss_files_parse_etherent (char *line, struct etherent *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+libnss_files_hidden_proto (_nss_files_parse_etherent)
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setetherent (int __stayopen); \
+extern enum nss_status _nss_ ## service ## _endetherent (void); \
+extern enum nss_status _nss_ ## service ## _getetherent_r \
+ (struct etherent *result, char *buffer, \
+ size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _gethostton_r \
+ (const char *name, struct etherent *eth, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _getntohost_r \
+ (const struct ether_addr *addr, \
+ struct etherent *eth, \
+ char *buffer, size_t buflen, int *errnop);
+
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/netinet/in.h b/REORG.TODO/include/netinet/in.h
new file mode 100644
index 0000000000..5e377469e7
--- /dev/null
+++ b/REORG.TODO/include/netinet/in.h
@@ -0,0 +1,15 @@
+#ifndef _NETINET_IN_H
+
+#include <inet/netinet/in.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (bindresvport)
+libc_hidden_proto (in6addr_loopback)
+extern __typeof (in6addr_loopback) __in6addr_loopback;
+libc_hidden_proto (__in6addr_loopback)
+libc_hidden_proto (in6addr_any)
+extern __typeof (in6addr_any) __in6addr_any;
+libc_hidden_proto (__in6addr_any)
+#endif
+
+#endif
diff --git a/REORG.TODO/include/nl_types.h b/REORG.TODO/include/nl_types.h
new file mode 100644
index 0000000000..71cb425995
--- /dev/null
+++ b/REORG.TODO/include/nl_types.h
@@ -0,0 +1 @@
+#include <catgets/nl_types.h>
diff --git a/REORG.TODO/include/nss.h b/REORG.TODO/include/nss.h
new file mode 100644
index 0000000000..6358a10fd3
--- /dev/null
+++ b/REORG.TODO/include/nss.h
@@ -0,0 +1,17 @@
+#ifndef _NSS_H
+#include <nss/nss.h>
+
+# ifndef _ISOMAC
+
+#define NSS_INVALID_FIELD_CHARACTERS ":\n"
+extern const char __nss_invalid_field_characters[] attribute_hidden;
+
+_Bool __nss_valid_field (const char *value)
+ attribute_hidden internal_function;
+_Bool __nss_valid_list_field (char **list)
+ attribute_hidden internal_function;
+const char *__nss_rewrite_field (const char *value, char **to_be_freed)
+ attribute_hidden internal_function;
+
+# endif /* !_ISOMAC */
+#endif /* _NSS_H */
diff --git a/REORG.TODO/include/nsswitch.h b/REORG.TODO/include/nsswitch.h
new file mode 100644
index 0000000000..a876d23185
--- /dev/null
+++ b/REORG.TODO/include/nsswitch.h
@@ -0,0 +1 @@
+#include <nss/nsswitch.h>
diff --git a/REORG.TODO/include/obstack.h b/REORG.TODO/include/obstack.h
new file mode 100644
index 0000000000..fe2e595381
--- /dev/null
+++ b/REORG.TODO/include/obstack.h
@@ -0,0 +1,9 @@
+#ifndef _OBSTACK_H
+#include <malloc/obstack.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (_obstack_newchunk)
+
+# endif /* !_ISOMAC */
+#endif /* obstack.h */
diff --git a/REORG.TODO/include/poll.h b/REORG.TODO/include/poll.h
new file mode 100644
index 0000000000..75181925aa
--- /dev/null
+++ b/REORG.TODO/include/poll.h
@@ -0,0 +1 @@
+#include <include/sys/poll.h>
diff --git a/REORG.TODO/include/printf.h b/REORG.TODO/include/printf.h
new file mode 100644
index 0000000000..984f263167
--- /dev/null
+++ b/REORG.TODO/include/printf.h
@@ -0,0 +1,20 @@
+#ifndef _PRINTF_H
+
+#include <stdio-common/printf.h>
+
+# ifndef _ISOMAC
+
+#include <xlocale.h>
+
+/* Now define the internal interfaces. */
+extern int __printf_fphex (FILE *, const struct printf_info *,
+ const void *const *);
+extern int __printf_fp (FILE *, const struct printf_info *,
+ const void *const *);
+libc_hidden_proto (__printf_fp)
+extern int __printf_fp_l (FILE *, locale_t, const struct printf_info *,
+ const void *const *);
+libc_hidden_proto (__printf_fp_l)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/programs/xmalloc.h b/REORG.TODO/include/programs/xmalloc.h
new file mode 100644
index 0000000000..203adaefc6
--- /dev/null
+++ b/REORG.TODO/include/programs/xmalloc.h
@@ -0,0 +1,33 @@
+/* Memory related definitions for program modules.
+ Copyright (C) 1998-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef _XMALLOC_H
+#define _XMALLOC_H 1
+
+#include <sys/cdefs.h>
+#include <stddef.h>
+
+/* Prototypes for a few program-wide used functions. */
+extern void *xmalloc (size_t n)
+ __attribute_malloc__ __attribute_alloc_size__ ((1));
+extern void *xcalloc (size_t n, size_t s)
+ __attribute_malloc__ __attribute_alloc_size__ ((1, 2));
+extern void *xrealloc (void *o, size_t n)
+ __attribute_malloc__ __attribute_alloc_size__ ((2));
+extern char *xstrdup (const char *) __attribute_malloc__;
+
+#endif /* xmalloc.h */
diff --git a/REORG.TODO/include/protocols/routed.h b/REORG.TODO/include/protocols/routed.h
new file mode 100644
index 0000000000..7257b41eeb
--- /dev/null
+++ b/REORG.TODO/include/protocols/routed.h
@@ -0,0 +1 @@
+#include <inet/protocols/routed.h>
diff --git a/REORG.TODO/include/protocols/rwhod.h b/REORG.TODO/include/protocols/rwhod.h
new file mode 100644
index 0000000000..92afa469ad
--- /dev/null
+++ b/REORG.TODO/include/protocols/rwhod.h
@@ -0,0 +1 @@
+#include <inet/protocols/rwhod.h>
diff --git a/REORG.TODO/include/protocols/talkd.h b/REORG.TODO/include/protocols/talkd.h
new file mode 100644
index 0000000000..1513ca7ae9
--- /dev/null
+++ b/REORG.TODO/include/protocols/talkd.h
@@ -0,0 +1 @@
+#include <inet/protocols/talkd.h>
diff --git a/REORG.TODO/include/protocols/timed.h b/REORG.TODO/include/protocols/timed.h
new file mode 100644
index 0000000000..ac01bd3590
--- /dev/null
+++ b/REORG.TODO/include/protocols/timed.h
@@ -0,0 +1 @@
+#include <inet/protocols/timed.h>
diff --git a/REORG.TODO/include/pthread.h b/REORG.TODO/include/pthread.h
new file mode 100644
index 0000000000..858c869a16
--- /dev/null
+++ b/REORG.TODO/include/pthread.h
@@ -0,0 +1,16 @@
+#include_next <pthread.h>
+
+#ifndef _ISOMAC
+/* Prototypes repeated instead of using __typeof because pthread.h is
+ included in C++ tests, and declaring functions with __typeof and
+ __THROW doesn't work for C++. */
+extern int __pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
+ const pthread_barrierattr_t *__restrict
+ __attr, unsigned int __count)
+ __THROW __nonnull ((1));
+extern int __pthread_barrier_wait (pthread_barrier_t *__barrier)
+ __THROWNL __nonnull ((1));
+
+/* This function is called to initialize the pthread library. */
+extern void __pthread_initialize (void) __attribute__ ((weak));
+#endif
diff --git a/REORG.TODO/include/pty.h b/REORG.TODO/include/pty.h
new file mode 100644
index 0000000000..4979bb765f
--- /dev/null
+++ b/REORG.TODO/include/pty.h
@@ -0,0 +1,9 @@
+#ifndef _PTY_H
+#include <login/pty.h>
+
+# ifndef _ISOMAC
+
+libutil_hidden_proto (openpty)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/pwd.h b/REORG.TODO/include/pwd.h
new file mode 100644
index 0000000000..3b0f72540c
--- /dev/null
+++ b/REORG.TODO/include/pwd.h
@@ -0,0 +1,57 @@
+#ifndef _PWD_H
+#include <pwd/pwd.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __getpwent_r (struct passwd *__resultbuf, char *__buffer,
+ size_t __buflen, struct passwd **__result)
+ attribute_hidden;
+extern int __old_getpwent_r (struct passwd *__resultbuf, char *__buffer,
+ size_t __buflen, struct passwd **__result);
+extern int __getpwuid_r (__uid_t __uid, struct passwd *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct passwd **__result);
+extern int __old_getpwuid_r (__uid_t __uid, struct passwd *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct passwd **__result);
+extern int __getpwnam_r (const char *__name, struct passwd *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct passwd **__result);
+extern int __old_getpwnam_r (const char *__name, struct passwd *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct passwd **__result);
+extern int __fgetpwent_r (FILE * __stream, struct passwd *__resultbuf,
+ char *__buffer, size_t __buflen,
+ struct passwd **__result);
+
+#include <nss.h>
+
+struct parser_data;
+extern int _nss_files_parse_pwent (char *line, struct passwd *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+libc_hidden_proto (_nss_files_parse_pwent)
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setpwent (int); \
+extern enum nss_status _nss_ ## service ## _endpwent (void); \
+extern enum nss_status _nss_ ## service ## _getpwnam_r \
+ (const char *name, struct passwd *pwd, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _getpwuid_r \
+ (uid_t uid, struct passwd *pwd, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ##_getpwent_r \
+ (struct passwd *result, char *buffer, \
+ size_t buflen, int *errnop);
+
+DECLARE_NSS_PROTOTYPES (compat)
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (hesiod)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+#endif
+
+#endif
diff --git a/REORG.TODO/include/regex.h b/REORG.TODO/include/regex.h
new file mode 100644
index 0000000000..fd4beeff3d
--- /dev/null
+++ b/REORG.TODO/include/regex.h
@@ -0,0 +1,45 @@
+#ifndef _REGEX_H
+#include <posix/regex.h>
+
+#ifndef _ISOMAC
+/* Document internal interfaces. */
+extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax);
+
+extern const char *__re_compile_pattern (const char *pattern, size_t length,
+ struct re_pattern_buffer *buffer);
+
+extern int __re_compile_fastmap (struct re_pattern_buffer *buffer);
+
+extern int __re_search (struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, int range,
+ struct re_registers *regs);
+
+extern int __re_search_2
+ (struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, int range, struct re_registers *regs, int stop);
+
+extern int __re_match
+ (struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, struct re_registers *regs);
+
+extern int __re_match_2
+ (struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, struct re_registers *regs, int stop);
+
+extern void __re_set_registers
+ (struct re_pattern_buffer *buffer, struct re_registers *regs,
+ unsigned num_regs, regoff_t *starts, regoff_t *ends);
+
+extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags);
+
+extern int __regexec (const regex_t *__preg, const char *__string,
+ size_t __nmatch, regmatch_t __pmatch[], int __eflags);
+
+extern size_t __regerror (int __errcode, const regex_t *__preg,
+ char *__errbuf, size_t __errbuf_size);
+
+extern void __regfree (regex_t *__preg);
+#endif
+#endif
diff --git a/REORG.TODO/include/resolv.h b/REORG.TODO/include/resolv.h
new file mode 100644
index 0000000000..e8f477cd86
--- /dev/null
+++ b/REORG.TODO/include/resolv.h
@@ -0,0 +1,99 @@
+#ifndef _RESOLV_H_
+
+# ifndef _ISOMAC
+# include <stdbool.h>
+# define RES_SET_H_ERRNO(r,x) \
+ do \
+ { \
+ (r)->res_h_errno = x; \
+ __set_h_errno(x); \
+ } \
+ while (0)
+# endif
+
+#include <resolv/resolv.h>
+
+# if defined _RESOLV_H_ && !defined _ISOMAC
+
+# if IS_IN (libc)
+# define __resp __libc_resp
+# endif
+extern __thread struct __res_state *__resp attribute_tls_model_ie;
+# undef _res
+# define _res (*__resp)
+
+/* Now define the internal interfaces. */
+extern int __res_vinit (res_state, int);
+extern int __res_maybe_init (res_state, int);
+extern void _sethtent (int);
+extern struct hostent *_gethtent (void);
+extern struct hostent *_gethtbyname (const char *__name);
+extern struct hostent *_gethtbyname2 (const char *__name, int __af);
+struct hostent *_gethtbyaddr (const char *addr, size_t __len, int __af);
+extern uint32_t _getlong (const unsigned char *__src);
+extern uint16_t _getshort (const unsigned char *__src);
+extern void res_pquery (const res_state __statp, const unsigned char *__msg,
+ int __len, FILE *__file);
+extern int res_ourserver_p (const res_state __statp,
+ const struct sockaddr_in6 *__inp);
+extern void __res_iclose (res_state statp, bool free_addr);
+libc_hidden_proto (__res_ninit)
+libc_hidden_proto (__res_maybe_init)
+libc_hidden_proto (__res_nclose)
+libc_hidden_proto (__res_iclose)
+libc_hidden_proto (__res_randomid)
+libc_hidden_proto (__res_state)
+
+int __libc_res_nquery (res_state, const char *, int, int,
+ unsigned char *, int, unsigned char **,
+ unsigned char **, int *, int *, int *);
+int __libc_res_nsearch (res_state, const char *, int, int,
+ unsigned char *, int, unsigned char **,
+ unsigned char **, int *, int *, int *);
+int __libc_res_nsend (res_state, const unsigned char *, int,
+ const unsigned char *, int, unsigned char *,
+ int, unsigned char **, unsigned char **,
+ int *, int *, int *)
+ attribute_hidden;
+
+libresolv_hidden_proto (_sethtent)
+libresolv_hidden_proto (_gethtent)
+libresolv_hidden_proto (_gethtbyaddr)
+libresolv_hidden_proto (_gethtbyname2)
+libresolv_hidden_proto (__dn_expand)
+libresolv_hidden_proto (__dn_comp)
+libresolv_hidden_proto (__dn_skipname)
+libresolv_hidden_proto (__res_hnok)
+libresolv_hidden_proto (__res_dnok)
+libresolv_hidden_proto (__putlong)
+libresolv_hidden_proto (__putshort)
+libresolv_hidden_proto (__p_cdnname)
+libresolv_hidden_proto (__p_fqnname)
+libresolv_hidden_proto (__p_option)
+libresolv_hidden_proto (__sym_ntos)
+libresolv_hidden_proto (__p_rcode)
+libresolv_hidden_proto (__p_class)
+libresolv_hidden_proto (__p_type)
+libresolv_hidden_proto (__loc_ntoa)
+libresolv_hidden_proto (__fp_nquery)
+libresolv_hidden_proto (__fp_query)
+libresolv_hidden_proto (__hostalias)
+libresolv_hidden_proto (__res_nmkquery)
+libresolv_hidden_proto (__libc_res_nquery)
+libresolv_hidden_proto (__res_nquery)
+libresolv_hidden_proto (__res_nquerydomain)
+libresolv_hidden_proto (__res_hostalias)
+libresolv_hidden_proto (__libc_res_nsearch)
+libresolv_hidden_proto (__res_nsearch)
+libresolv_hidden_proto (__res_nameinquery)
+libresolv_hidden_proto (__res_queriesmatch)
+libresolv_hidden_proto (__res_nsend)
+libresolv_hidden_proto (__b64_ntop)
+libresolv_hidden_proto (__dn_count_labels)
+libresolv_hidden_proto (__p_secstodate)
+
+extern const char *_res_opcodes[];
+libresolv_hidden_proto (_res_opcodes)
+
+# endif /* _RESOLV_H_ && !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rounding-mode.h b/REORG.TODO/include/rounding-mode.h
new file mode 100644
index 0000000000..5d5cfe5f10
--- /dev/null
+++ b/REORG.TODO/include/rounding-mode.h
@@ -0,0 +1,65 @@
+/* Handle floating-point rounding mode within libc.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _ROUNDING_MODE_H
+#define _ROUNDING_MODE_H 1
+
+#include <fenv.h>
+#include <stdbool.h>
+#include <stdlib.h>
+
+/* Get the architecture-specific definition of how to determine the
+ rounding mode in libc. This header must also define the FE_*
+ macros for any standard rounding modes the architecture does not
+ have in <fenv.h>, to arbitrary distinct values. */
+#include <get-rounding-mode.h>
+
+/* Return true if a number should be rounded away from zero in
+ rounding mode MODE, false otherwise. NEGATIVE is true if the
+ number is negative, false otherwise. LAST_DIGIT_ODD is true if the
+ last digit of the truncated value (last bit for binary) is odd,
+ false otherwise. HALF_BIT is true if the number is at least half
+ way from the truncated value to the next value with the
+ least-significant digit in the same place, false otherwise.
+ MORE_BITS is true if the number is not exactly equal to the
+ truncated value or the half-way value, false otherwise. */
+
+static bool
+round_away (bool negative, bool last_digit_odd, bool half_bit, bool more_bits,
+ int mode)
+{
+ switch (mode)
+ {
+ case FE_DOWNWARD:
+ return negative && (half_bit || more_bits);
+
+ case FE_TONEAREST:
+ return half_bit && (last_digit_odd || more_bits);
+
+ case FE_TOWARDZERO:
+ return false;
+
+ case FE_UPWARD:
+ return !negative && (half_bit || more_bits);
+
+ default:
+ abort ();
+ }
+}
+
+#endif /* rounding-mode.h */
diff --git a/REORG.TODO/include/rpc/auth.h b/REORG.TODO/include/rpc/auth.h
new file mode 100644
index 0000000000..2e55cce11d
--- /dev/null
+++ b/REORG.TODO/include/rpc/auth.h
@@ -0,0 +1,47 @@
+#ifndef _RPC_AUTH_H
+#include <sunrpc/rpc/auth.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (getnetname)
+libc_hidden_proto (netname2user)
+libc_hidden_proto (host2netname)
+libc_hidden_proto (user2netname)
+libc_hidden_proto (key_gendes)
+
+/* Now define the internal interfaces. */
+struct key_netstarg;
+extern int key_setnet (struct key_netstarg *arg);
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ##service ## _netname2user \
+ (char netname[MAXNETNAMELEN + 1], uid_t *uidp, \
+ gid_t *gidp, int *gidlenp, gid_t *gidlist, \
+ int *errnop);
+
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+
+libc_hidden_proto (key_encryptsession_pk)
+libc_hidden_proto (key_decryptsession_pk)
+
+libc_hidden_proto (_null_auth)
+libc_hidden_proto (authnone_create)
+libc_hidden_proto (authunix_create)
+libc_hidden_proto (authunix_create_default)
+libc_hidden_proto (xdr_des_block)
+libc_hidden_proto (xdr_opaque_auth)
+libc_hidden_proto (authdes_create)
+libc_hidden_proto (authdes_pk_create)
+libc_hidden_proto (key_decryptsession)
+libc_hidden_proto (key_encryptsession)
+libc_hidden_proto (key_get_conv)
+libc_hidden_proto (key_secretkey_is_set)
+libc_hidden_proto (key_setnet)
+libc_hidden_proto (key_setsecret)
+libc_hidden_proto (netname2host)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/auth_des.h b/REORG.TODO/include/rpc/auth_des.h
new file mode 100644
index 0000000000..6afed56b71
--- /dev/null
+++ b/REORG.TODO/include/rpc/auth_des.h
@@ -0,0 +1,38 @@
+#ifndef _RPC_AUTH_DES_H
+
+#include <sunrpc/rpc/auth_des.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (getpublickey)
+libc_hidden_proto (getsecretkey)
+libc_hidden_proto (rtime)
+
+extern bool_t xdr_authdes_cred (XDR *xdrs, struct authdes_cred *cred);
+extern bool_t xdr_authdes_verf (XDR *xdrs,
+ struct authdes_verf *verf);
+struct svc_req;
+struct rpc_msg;
+extern enum auth_stat _svcauth_des (struct svc_req *rqst,
+ struct rpc_msg *msg);
+
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _getpublickey \
+ (const char *netname, char *pkey, int *errnop); \
+extern enum nss_status _nss_ ## service ## _getsecretkey \
+ (const char *netname, char *skey, char *passwd, \
+ int *errnop);
+
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+
+libc_hidden_proto (authdes_getucred)
+libc_hidden_proto (xdr_authdes_cred)
+libc_hidden_proto (xdr_authdes_verf)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/auth_unix.h b/REORG.TODO/include/rpc/auth_unix.h
new file mode 100644
index 0000000000..019efa275a
--- /dev/null
+++ b/REORG.TODO/include/rpc/auth_unix.h
@@ -0,0 +1,9 @@
+#ifndef _RPC_AUTH_UNIX_H
+#include <sunrpc/rpc/auth_unix.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (xdr_authunix_parms)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/auth_unix.h */
diff --git a/REORG.TODO/include/rpc/clnt.h b/REORG.TODO/include/rpc/clnt.h
new file mode 100644
index 0000000000..a397023a93
--- /dev/null
+++ b/REORG.TODO/include/rpc/clnt.h
@@ -0,0 +1,33 @@
+#ifndef _RPC_CLNT_H
+#include <sunrpc/rpc/clnt.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern int _openchild (const char *command, FILE **fto, FILE **ffrom);
+
+extern CLIENT *__libc_clntudp_bufcreate (struct sockaddr_in *__raddr,
+ u_long __program, u_long __version,
+ struct timeval __wait_resend,
+ int *__sockp, u_int __sendsz,
+ u_int __recvsz, int __flags);
+
+libc_hidden_proto (clnt_sperrno)
+libc_hidden_proto (clnt_spcreateerror)
+libc_hidden_proto (clnt_perror)
+libc_hidden_proto (clnt_sperror)
+libc_hidden_proto (_rpc_dtablesize)
+libc_hidden_proto (callrpc)
+libc_hidden_proto (clnt_create)
+libc_hidden_proto (clnt_pcreateerror)
+libc_hidden_proto (clnt_perrno)
+libc_hidden_proto (clntraw_create)
+libc_hidden_proto (clnttcp_create)
+libc_hidden_proto (clntudp_bufcreate)
+libc_hidden_proto (clntudp_create)
+libc_hidden_proto (get_myaddress)
+libc_hidden_proto (clntunix_create)
+libc_hidden_proto (__libc_clntudp_bufcreate)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/des_crypt.h b/REORG.TODO/include/rpc/des_crypt.h
new file mode 100644
index 0000000000..7a34957df8
--- /dev/null
+++ b/REORG.TODO/include/rpc/des_crypt.h
@@ -0,0 +1,18 @@
+#ifndef __DES_CRYPT_H__
+#include <sunrpc/rpc/des_crypt.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+
+extern int xencrypt (char *secret, char *passwd);
+extern int xdecrypt (char *secret, char *passwd);
+
+libc_hidden_proto (des_setparity)
+libc_hidden_proto (ecb_crypt)
+libc_hidden_proto (cbc_crypt)
+libc_hidden_proto (xencrypt)
+libc_hidden_proto (xdecrypt)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/key_prot.h b/REORG.TODO/include/rpc/key_prot.h
new file mode 100644
index 0000000000..4711a94edf
--- /dev/null
+++ b/REORG.TODO/include/rpc/key_prot.h
@@ -0,0 +1,18 @@
+#ifndef _KEY_PROT_H_RPCGEN
+#include <sunrpc/rpc/key_prot.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (xdr_cryptkeyarg)
+libc_hidden_proto (xdr_cryptkeyarg2)
+libc_hidden_proto (xdr_cryptkeyres)
+libc_hidden_proto (xdr_key_netstarg)
+libc_hidden_proto (xdr_key_netstres)
+libc_hidden_proto (xdr_keybuf)
+libc_hidden_proto (xdr_keystatus)
+libc_hidden_proto (xdr_getcredres)
+libc_hidden_proto (xdr_netnamestr)
+libc_hidden_proto (xdr_unixcred)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/key_prot.h */
diff --git a/REORG.TODO/include/rpc/netdb.h b/REORG.TODO/include/rpc/netdb.h
new file mode 100644
index 0000000000..9b84668be7
--- /dev/null
+++ b/REORG.TODO/include/rpc/netdb.h
@@ -0,0 +1,54 @@
+#ifndef _RPC_NETDB_H
+#include <sunrpc/rpc/netdb.h>
+
+# ifndef _ISOMAC
+
+extern int __getrpcbyname_r (const char *__name, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result);
+extern int __old_getrpcbyname_r (const char *__name,
+ struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result);
+
+extern int __getrpcbynumber_r (int __number, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result);
+extern int __old_getrpcbynumber_r (int __number, struct rpcent *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct rpcent **__result);
+
+extern int __getrpcent_r (struct rpcent *__result_buf, char *__buffer,
+ size_t __buflen, struct rpcent **__result)
+ attribute_hidden;
+extern int __old_getrpcent_r (struct rpcent *__result_buf, char *__buffer,
+ size_t __buflen, struct rpcent **__result);
+
+struct parser_data;
+extern int _nss_files_parse_rpcent (char *line, struct rpcent *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+libnss_files_hidden_proto (_nss_files_parse_rpcent)
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setrpcent (int); \
+extern enum nss_status _nss_ ## service ## _endrpcent (void); \
+extern enum nss_status _nss_ ## service ## _getrpcent_r \
+ (struct rpcent *rpc, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ## _getrpcbyname_r \
+ (const char *name, struct rpcent *rpc, \
+ char *buffer, size_t buflen, int *errnop); \
+extern enum nss_status _nss_ ## service ## _getrpcbynumber_r \
+ (int number, struct rpcent *rpc, \
+ char *buffer, size_t buflen, int *errnop);
+
+
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/pmap_clnt.h b/REORG.TODO/include/rpc/pmap_clnt.h
new file mode 100644
index 0000000000..ec907c28cc
--- /dev/null
+++ b/REORG.TODO/include/rpc/pmap_clnt.h
@@ -0,0 +1,24 @@
+#ifndef _RPC_PMAP_CLNT_H
+#include <sunrpc/rpc/pmap_clnt.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (pmap_getport)
+libc_hidden_proto (pmap_set)
+libc_hidden_proto (pmap_unset)
+
+/* Defined in pm_getport.c. */
+extern int __get_socket (struct sockaddr_in *saddr)
+ attribute_hidden internal_function;
+extern u_short __libc_rpc_getport (struct sockaddr_in *address, u_long program,
+ u_long version, u_int protocol,
+ time_t timeout_sec, time_t tottimeout_sec)
+ internal_function;
+libc_hidden_proto (__libc_rpc_getport)
+
+libc_hidden_proto (clnt_broadcast)
+libc_hidden_proto (pmap_getmaps)
+libc_hidden_proto (pmap_rmtcall)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/pmap_clnt.h */
diff --git a/REORG.TODO/include/rpc/pmap_prot.h b/REORG.TODO/include/rpc/pmap_prot.h
new file mode 100644
index 0000000000..a2573d106f
--- /dev/null
+++ b/REORG.TODO/include/rpc/pmap_prot.h
@@ -0,0 +1,10 @@
+#ifndef _RPC_PMAP_PROT_H
+#include <sunrpc/rpc/pmap_prot.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (xdr_pmap)
+libc_hidden_proto (xdr_pmaplist)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/pmap_prot.h */
diff --git a/REORG.TODO/include/rpc/pmap_rmt.h b/REORG.TODO/include/rpc/pmap_rmt.h
new file mode 100644
index 0000000000..ae53a02652
--- /dev/null
+++ b/REORG.TODO/include/rpc/pmap_rmt.h
@@ -0,0 +1,10 @@
+#ifndef _RPC_PMAP_RMT_H
+#include <sunrpc/rpc/pmap_rmt.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (xdr_rmtcall_args)
+libc_hidden_proto (xdr_rmtcallres)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/pmap_rmt.h */
diff --git a/REORG.TODO/include/rpc/rpc.h b/REORG.TODO/include/rpc/rpc.h
new file mode 100644
index 0000000000..60c78968de
--- /dev/null
+++ b/REORG.TODO/include/rpc/rpc.h
@@ -0,0 +1,69 @@
+#ifndef _RPC_RPC_H
+#include <sunrpc/rpc/rpc.h>
+
+# ifndef _ISOMAC
+
+#include <libc-tsd.h>
+
+/* Now define the internal interfaces. */
+extern unsigned long _create_xid (void);
+
+/*
+ * Multi-threaded support
+ * Group all global and static variables into a single spot.
+ * This area is allocated on a per-thread basis
+ */
+#ifdef _RPC_THREAD_SAFE_
+struct rpc_thread_variables {
+ fd_set svc_fdset_s; /* Global, rpc_common.c */
+ struct rpc_createerr rpc_createerr_s; /* Global, rpc_common.c */
+ struct pollfd *svc_pollfd_s; /* Global, rpc_common.c */
+ int svc_max_pollfd_s; /* Global, rpc_common.c */
+
+ char *clnt_perr_buf_s; /* clnt_perr.c */
+
+ struct clntraw_private_s *clntraw_private_s; /* clnt_raw.c */
+
+ struct callrpc_private_s *callrpc_private_s; /* clnt_simp.c */
+
+ struct key_call_private *key_call_private_s; /* key_call.c */
+
+ struct cache_entry *authdes_cache_s; /* svcauth_des.c */
+ int *authdes_lru_s; /* svcauth_des.c */
+
+ SVCXPRT **svc_xports_s; /* svc.c */
+ struct svc_callout *svc_head_s; /* svc.c */
+
+ struct svcraw_private_s *svcraw_private_s; /* svc_raw.c */
+
+ struct proglst_ *svcsimple_proglst_s; /* svc_simple.c */
+ SVCXPRT *svcsimple_transp_s; /* svc_simple.c */
+};
+
+extern struct rpc_thread_variables *__rpc_thread_variables(void)
+ __attribute__ ((const));
+extern void __rpc_thread_svc_cleanup (void);
+extern void __rpc_thread_clnt_cleanup (void);
+extern void __rpc_thread_key_cleanup (void);
+
+extern void __rpc_thread_destroy (void);
+
+__libc_tsd_define (extern, struct rpc_thread_variables *, RPC_VARS)
+
+#define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)
+
+libc_hidden_proto (__rpc_thread_svc_max_pollfd)
+libc_hidden_proto (__rpc_thread_svc_pollfd)
+libc_hidden_proto (__rpc_thread_svc_fdset)
+libc_hidden_proto (__rpc_thread_createerr)
+
+/* Perform a host name lookup for NAME and return the first IPv4
+ address in *ADDR. Return 0 on success and -1 on error (and set an
+ RPC error). */
+int __libc_rpc_gethostbyname (const char *host, struct sockaddr_in *addr)
+ attribute_hidden;
+
+#endif /* _RPC_THREAD_SAFE_ */
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/rpc_msg.h b/REORG.TODO/include/rpc/rpc_msg.h
new file mode 100644
index 0000000000..93c5ab8764
--- /dev/null
+++ b/REORG.TODO/include/rpc/rpc_msg.h
@@ -0,0 +1,20 @@
+#ifndef _RPC_MSG_H
+#include <sunrpc/rpc/rpc_msg.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (_seterr_reply)
+
+/* Now define the internal interfaces. */
+
+extern bool_t xdr_rejected_reply (XDR *xdrs, struct rejected_reply *rr);
+extern bool_t xdr_accepted_reply (XDR *xdrs, struct accepted_reply *ar);
+
+libc_hidden_proto (xdr_accepted_reply)
+libc_hidden_proto (xdr_callhdr)
+libc_hidden_proto (xdr_callmsg)
+libc_hidden_proto (xdr_rejected_reply)
+libc_hidden_proto (xdr_replymsg)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/svc.h b/REORG.TODO/include/rpc/svc.h
new file mode 100644
index 0000000000..465bf4427d
--- /dev/null
+++ b/REORG.TODO/include/rpc/svc.h
@@ -0,0 +1,43 @@
+#ifndef _RPC_SVC_H
+#include <sunrpc/rpc/svc.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (xprt_register)
+libc_hidden_proto (xprt_unregister)
+libc_hidden_proto (svc_register)
+libc_hidden_proto (svc_unregister)
+libc_hidden_proto (svcerr_auth)
+libc_hidden_proto (svcerr_noprog)
+libc_hidden_proto (svcerr_progvers)
+
+/* Now define the internal interfaces. */
+extern SVCXPRT *svcfd_create (int fd, u_int sendsize, u_int recvsize);
+
+extern int svcudp_enablecache (SVCXPRT *transp, u_long size);
+extern SVCXPRT *svcunixfd_create (int fd, u_int sendsize, u_int recvsize);
+
+libc_hidden_proto (svc_exit)
+libc_hidden_proto (svc_getreq)
+libc_hidden_proto (svc_getreqset)
+libc_hidden_proto (svc_run)
+libc_hidden_proto (svc_sendreply)
+libc_hidden_proto (svcerr_decode)
+libc_hidden_proto (svcerr_noproc)
+libc_hidden_proto (svcerr_systemerr)
+libc_hidden_proto (svcerr_weakauth)
+libc_hidden_proto (svcfd_create)
+libc_hidden_proto (svcraw_create)
+libc_hidden_proto (svctcp_create)
+libc_hidden_proto (svcudp_bufcreate)
+libc_hidden_proto (svcudp_create)
+libc_hidden_proto (svcudp_enablecache)
+libc_hidden_proto (svcunix_create)
+libc_hidden_proto (svcunixfd_create)
+libc_hidden_proto (svc_getreq_common)
+libc_hidden_proto (svc_getreq_poll)
+
+extern void __svc_accept_failed (void) attribute_hidden;
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/svc_auth.h b/REORG.TODO/include/rpc/svc_auth.h
new file mode 100644
index 0000000000..2609d19544
--- /dev/null
+++ b/REORG.TODO/include/rpc/svc_auth.h
@@ -0,0 +1,15 @@
+#ifndef _RPC_SVC_AUTH_H
+#include <sunrpc/rpc/svc_auth.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern enum auth_stat _svcauth_unix (struct svc_req *rqst,
+ struct rpc_msg *msg);
+extern enum auth_stat _svcauth_short (struct svc_req *rqst,
+ struct rpc_msg *msg);
+
+libc_hidden_proto (_authenticate)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpc/types.h b/REORG.TODO/include/rpc/types.h
new file mode 100644
index 0000000000..53df7e666b
--- /dev/null
+++ b/REORG.TODO/include/rpc/types.h
@@ -0,0 +1 @@
+#include <sunrpc/rpc/types.h>
diff --git a/REORG.TODO/include/rpc/xdr.h b/REORG.TODO/include/rpc/xdr.h
new file mode 100644
index 0000000000..e1bff1cd1c
--- /dev/null
+++ b/REORG.TODO/include/rpc/xdr.h
@@ -0,0 +1,53 @@
+#ifndef _RPC_XDR_H
+#include <sunrpc/rpc/xdr.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (xdrstdio_create)
+libc_hidden_proto (xdr_array)
+libc_hidden_proto (xdr_bool)
+libc_hidden_proto (xdr_bytes)
+libc_hidden_proto (xdr_char)
+libc_hidden_proto (xdr_double)
+libc_hidden_proto (xdr_enum)
+libc_hidden_proto (xdr_float)
+libc_hidden_proto (xdr_free)
+libc_hidden_proto (xdr_int)
+libc_hidden_proto (xdr_long)
+libc_hidden_proto (xdr_netobj)
+libc_hidden_proto (xdr_opaque)
+libc_hidden_proto (xdr_pointer)
+libc_hidden_proto (xdr_reference)
+libc_hidden_proto (xdr_short)
+libc_hidden_proto (xdr_string)
+libc_hidden_proto (xdr_u_char)
+libc_hidden_proto (xdr_u_int)
+libc_hidden_proto (xdr_u_long)
+libc_hidden_proto (xdr_u_short)
+libc_hidden_proto (xdr_union)
+libc_hidden_proto (xdr_vector)
+libc_hidden_proto (xdr_void)
+libc_hidden_proto (xdr_wrapstring)
+libc_hidden_proto (xdrmem_create)
+libc_hidden_proto (xdrrec_create)
+libc_hidden_proto (xdrrec_endofrecord)
+libc_hidden_proto (xdrrec_eof)
+libc_hidden_proto (xdrrec_skiprecord)
+libc_hidden_proto (xdr_int16_t)
+libc_hidden_proto (xdr_int32_t)
+libc_hidden_proto (xdr_int8_t)
+libc_hidden_proto (xdr_sizeof)
+libc_hidden_proto (xdr_uint16_t)
+libc_hidden_proto (xdr_uint32_t)
+libc_hidden_proto (xdr_uint8_t)
+libc_hidden_proto (xdr_hyper)
+libc_hidden_proto (xdr_u_hyper)
+libc_hidden_proto (xdr_longlong_t)
+libc_hidden_proto (xdr_u_longlong_t)
+libc_hidden_proto (xdr_int64_t)
+libc_hidden_proto (xdr_uint64_t)
+libc_hidden_proto (xdr_quad_t)
+libc_hidden_proto (xdr_u_quad_t)
+
+# endif /* !_ISOMAC */
+#endif /* rpc/xdr.h */
diff --git a/REORG.TODO/include/rpcsvc/nis.h b/REORG.TODO/include/rpcsvc/nis.h
new file mode 100644
index 0000000000..2943573aa9
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/nis.h
@@ -0,0 +1 @@
+#include <nis/rpcsvc/nis.h>
diff --git a/REORG.TODO/include/rpcsvc/nis_callback.h b/REORG.TODO/include/rpcsvc/nis_callback.h
new file mode 100644
index 0000000000..0515d07887
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/nis_callback.h
@@ -0,0 +1,10 @@
+#ifndef _RPCSVC_NIS_CALLBACK_H
+#include <nis/rpcsvc/nis_callback.h>
+
+# ifndef _ISOMAC
+
+libnsl_hidden_proto (xdr_obj_p)
+libnsl_hidden_proto (xdr_cback_data)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpcsvc/nis_tags.h b/REORG.TODO/include/rpcsvc/nis_tags.h
new file mode 100644
index 0000000000..ea79f74da3
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/nis_tags.h
@@ -0,0 +1 @@
+#include <nis/rpcsvc/nis_tags.h>
diff --git a/REORG.TODO/include/rpcsvc/nislib.h b/REORG.TODO/include/rpcsvc/nislib.h
new file mode 100644
index 0000000000..91dab1d171
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/nislib.h
@@ -0,0 +1,83 @@
+#ifndef __RPCSVC_NISLIB_H__
+#include <nis/rpcsvc/nislib.h>
+
+# ifndef _ISOMAC
+
+libnsl_hidden_proto (nis_leaf_of_r)
+libnsl_hidden_proto (nis_name_of_r)
+libnsl_hidden_proto (nis_getnames)
+libnsl_hidden_proto (nis_freenames)
+libnsl_hidden_proto (nis_dir_cmp)
+libnsl_hidden_proto (nis_destroy_object)
+libnsl_hidden_proto (nis_local_directory)
+libnsl_hidden_proto (nis_local_group)
+libnsl_hidden_proto (nis_local_host)
+libnsl_hidden_proto (nis_local_principal)
+libnsl_hidden_proto (__free_fdresult)
+libnsl_hidden_proto (nis_free_request)
+libnsl_hidden_proto (nis_free_directory)
+libnsl_hidden_proto (nis_free_object)
+libnsl_hidden_proto (nis_freeresult)
+libnsl_hidden_proto (readColdStartFile)
+libnsl_hidden_proto (writeColdStartFile)
+libnsl_hidden_proto (nis_print_rights)
+libnsl_hidden_proto (nis_print_directory)
+libnsl_hidden_proto (nis_print_group)
+libnsl_hidden_proto (nis_print_table)
+libnsl_hidden_proto (nis_print_link)
+libnsl_hidden_proto (nis_print_entry)
+libnsl_hidden_proto (nis_print_object)
+libnsl_hidden_proto (nis_sperrno)
+libnsl_hidden_proto (nis_sperror_r)
+libnsl_hidden_proto (__nisbind_destroy)
+libnsl_hidden_proto (__nisbind_next)
+libnsl_hidden_proto (__nisbind_connect)
+libnsl_hidden_proto (__nisbind_create)
+libnsl_hidden_proto (nis_lookup)
+libnsl_hidden_proto (nis_list)
+libnsl_hidden_proto (__nis_finddirectory)
+libnsl_hidden_proto (nis_domain_of_r)
+libnsl_hidden_proto (nis_modify)
+libnsl_hidden_proto (nis_remove)
+libnsl_hidden_proto (nis_add)
+libnsl_hidden_proto (__nis_default_owner)
+libnsl_hidden_proto (__nis_default_group)
+libnsl_hidden_proto (__nis_default_access)
+libnsl_hidden_proto (nis_clone_object)
+libnsl_hidden_proto (nis_clone_result)
+libnsl_hidden_proto (nis_print_group_entry)
+libnsl_hidden_proto (nis_verifygroup)
+libnsl_hidden_proto (nis_leaf_of)
+libnsl_hidden_proto (nis_read_obj)
+libnsl_hidden_proto (nis_print_result)
+libnsl_hidden_proto (nis_sperror)
+libnsl_hidden_proto (nis_add_entry)
+libnsl_hidden_proto (nis_mkdir)
+libnsl_hidden_proto (nis_getservlist)
+libnsl_hidden_proto (nis_stats)
+libnsl_hidden_proto (nis_write_obj)
+libnsl_hidden_proto (nis_servstate)
+libnsl_hidden_proto (nis_freetags)
+libnsl_hidden_proto (nis_modify_entry)
+libnsl_hidden_proto (nis_remove_entry)
+libnsl_hidden_proto (nis_first_entry)
+libnsl_hidden_proto (nis_next_entry)
+libnsl_hidden_proto (nis_checkpoint)
+libnsl_hidden_proto (nis_perror)
+libnsl_hidden_proto (nis_lerror)
+libnsl_hidden_proto (nis_freeservlist)
+libnsl_hidden_proto (nis_ismember)
+libnsl_hidden_proto (nis_creategroup)
+libnsl_hidden_proto (nis_destroygroup)
+libnsl_hidden_proto (nis_name_of)
+libnsl_hidden_proto (nis_ping)
+libnsl_hidden_proto (nis_rmdir)
+libnsl_hidden_proto (nis_addmember)
+libnsl_hidden_proto (nis_removemember)
+libnsl_hidden_proto (nis_domain_of)
+libnsl_hidden_proto (nis_clone_directory)
+
+extern const_nis_name __nis_domain_of (const_nis_name) __THROW;
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpcsvc/yp.h b/REORG.TODO/include/rpcsvc/yp.h
new file mode 100644
index 0000000000..9078854d40
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/yp.h
@@ -0,0 +1,33 @@
+#ifndef __RPCSVC_YP_H__
+#include <nis/rpcsvc/yp.h>
+
+# ifndef _ISOMAC
+
+libnsl_hidden_proto (xdr_ypstat)
+libnsl_hidden_proto (xdr_ypxfrstat)
+libnsl_hidden_proto (xdr_domainname)
+libnsl_hidden_proto (xdr_mapname)
+libnsl_hidden_proto (xdr_peername)
+libnsl_hidden_proto (xdr_keydat)
+libnsl_hidden_proto (xdr_valdat)
+libnsl_hidden_proto (xdr_ypmap_parms)
+libnsl_hidden_proto (xdr_ypresp_key_val)
+libnsl_hidden_proto (xdr_ypresp_all)
+libnsl_hidden_proto (xdr_yppush_status)
+libnsl_hidden_proto (xdr_ypbind_resptype)
+libnsl_hidden_proto (xdr_ypbind_binding)
+libnsl_hidden_proto (xdr_ypreq_nokey)
+libnsl_hidden_proto (xdr_ypmaplist)
+libnsl_hidden_proto (xdr_ypreq_key)
+libnsl_hidden_proto (xdr_ypresp_val)
+libnsl_hidden_proto (xdr_ypresp_maplist)
+libnsl_hidden_proto (xdr_ypresp_order)
+libnsl_hidden_proto (xdr_ypbind_resp)
+libnsl_hidden_proto (xdr_ypresp_master)
+libnsl_hidden_proto (xdr_ypreq_xfr)
+libnsl_hidden_proto (xdr_ypresp_xfr)
+libnsl_hidden_proto (xdr_yppushresp_xfr)
+libnsl_hidden_proto (xdr_ypbind_setdom)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpcsvc/ypclnt.h b/REORG.TODO/include/rpcsvc/ypclnt.h
new file mode 100644
index 0000000000..df2a03d9c5
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/ypclnt.h
@@ -0,0 +1,22 @@
+#ifndef __RPCSVC_YPCLNT_H__
+#include <nis/rpcsvc/ypclnt.h>
+
+# ifndef _ISOMAC
+
+libnsl_hidden_proto (ypbinderr_string)
+libnsl_hidden_proto (yp_bind)
+libnsl_hidden_proto (yp_get_default_domain)
+libnsl_hidden_proto (ypprot_err)
+libnsl_hidden_proto (yp_master)
+libnsl_hidden_proto (yp_update)
+libnsl_hidden_proto (yperr_string)
+libnsl_hidden_proto (yp_unbind)
+libnsl_hidden_proto (yp_order)
+libnsl_hidden_proto (yp_first)
+libnsl_hidden_proto (yp_next)
+libnsl_hidden_proto (yp_match)
+libnsl_hidden_proto (yp_all)
+libnsl_hidden_proto (__yp_check)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/rpcsvc/ypupd.h b/REORG.TODO/include/rpcsvc/ypupd.h
new file mode 100644
index 0000000000..6d179dd306
--- /dev/null
+++ b/REORG.TODO/include/rpcsvc/ypupd.h
@@ -0,0 +1,11 @@
+#ifndef __RPCSVC_YPUPD_H__
+#include <nis/rpcsvc/ypupd.h>
+
+# ifndef _ISOMAC
+
+libnsl_hidden_proto (xdr_yp_buf)
+libnsl_hidden_proto (xdr_ypdelete_args)
+libnsl_hidden_proto (xdr_ypupdate_args)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sched.h b/REORG.TODO/include/sched.h
new file mode 100644
index 0000000000..b4d74064de
--- /dev/null
+++ b/REORG.TODO/include/sched.h
@@ -0,0 +1,27 @@
+#ifndef _SCHED_H
+#include <posix/sched.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __sched_setparam (__pid_t __pid,
+ const struct sched_param *__param);
+extern int __sched_getparam (__pid_t __pid, struct sched_param *__param);
+extern int __sched_setscheduler (__pid_t __pid, int __policy,
+ const struct sched_param *__param);
+libc_hidden_proto (__sched_setscheduler)
+extern int __sched_getscheduler (__pid_t __pid);
+extern int __sched_yield (void);
+libc_hidden_proto (__sched_yield)
+extern int __sched_get_priority_max (int __algorithm);
+extern int __sched_get_priority_min (int __algorithm);
+extern int __sched_rr_get_interval (__pid_t __pid, struct timespec *__t);
+
+/* These are Linux specific. */
+extern int __clone (int (*__fn) (void *__arg), void *__child_stack,
+ int __flags, void *__arg, ...);
+libc_hidden_proto (__clone)
+extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base,
+ size_t __child_stack_size, int __flags, void *__arg, ...);
+libc_hidden_proto (__clone2)
+#endif
+#endif
diff --git a/REORG.TODO/include/scratch_buffer.h b/REORG.TODO/include/scratch_buffer.h
new file mode 100644
index 0000000000..dd17a4a7e1
--- /dev/null
+++ b/REORG.TODO/include/scratch_buffer.h
@@ -0,0 +1,136 @@
+/* Variable-sized buffer with on-stack default allocation.
+ Copyright (C) 2015-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SCRATCH_BUFFER_H
+#define _SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+ heap allocation. It is expected that this function is used in this
+ way:
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+
+ while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+ if (!scratch_buffer_grow (&tmpbuf))
+ return -1;
+
+ scratch_buffer_free (&tmpbuf);
+ return 0;
+
+ The allocation functions (scratch_buffer_grow,
+ scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+ sure that the heap allocation, if any, is freed, so that the code
+ above does not have a memory leak. The buffer still remains in a
+ state that can be deallocated using scratch_buffer_free, so a loop
+ like this is valid as well:
+
+ struct scratch_buffer tmpbuf;
+ scratch_buffer_init (&tmpbuf);
+
+ while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+ if (!scratch_buffer_grow (&tmpbuf))
+ break;
+
+ scratch_buffer_free (&tmpbuf);
+
+ scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+ to grow the buffer by at least 512 bytes. This means that when
+ using the scratch buffer as a backing store for a non-character
+ array whose element size, in bytes, is 512 or smaller, the scratch
+ buffer only has to grow once to make room for at least one more
+ element.
+*/
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+/* Scratch buffer. Must be initialized with scratch_buffer_init
+ before its use. */
+struct scratch_buffer {
+ void *data; /* Pointer to the beginning of the scratch area. */
+ size_t length; /* Allocated space at the data pointer, in bytes. */
+ char __space[1024]
+ __attribute__ ((aligned (__alignof__ (max_align_t))));
+};
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+ and BUFFER->length reflects the available space. */
+static inline void
+scratch_buffer_init (struct scratch_buffer *buffer)
+{
+ buffer->data = buffer->__space;
+ buffer->length = sizeof (buffer->__space);
+}
+
+/* Deallocates *BUFFER (if it was heap-allocated). */
+static inline void
+scratch_buffer_free (struct scratch_buffer *buffer)
+{
+ if (buffer->data != buffer->__space)
+ free (buffer->data);
+}
+
+/* Grow *BUFFER by some arbitrary amount. The buffer contents is NOT
+ preserved. Return true on success, false on allocation failure (in
+ which case the old buffer is freed). On success, the new buffer is
+ larger than the previous size. On failure, *BUFFER is deallocated,
+ but remains in a free-able state, and errno is set. */
+bool __libc_scratch_buffer_grow (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow)
+
+/* Alias for __libc_scratch_buffer_grow. */
+static __always_inline bool
+scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+ return __glibc_likely (__libc_scratch_buffer_grow (buffer));
+}
+
+/* Like __libc_scratch_buffer_grow, but preserve the old buffer
+ contents on success, as a prefix of the new buffer. */
+bool __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow_preserve)
+
+/* Alias for __libc_scratch_buffer_grow_preserve. */
+static __always_inline bool
+scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+ return __glibc_likely (__libc_scratch_buffer_grow_preserve (buffer));
+}
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+ bytes. The buffer contents are NOT preserved. Both NELEM and SIZE
+ can be zero. Return true on success, false on allocation failure
+ (in which case the old buffer is freed, but *BUFFER remains in a
+ free-able state, and errno is set). It is unspecified whether this
+ function can reduce the array size. */
+bool __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+ size_t nelem, size_t size);
+libc_hidden_proto (__libc_scratch_buffer_set_array_size)
+
+/* Alias for __libc_scratch_set_array_size. */
+static __always_inline bool
+scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+ size_t nelem, size_t size)
+{
+ return __glibc_likely (__libc_scratch_buffer_set_array_size
+ (buffer, nelem, size));
+}
+
+#endif /* _SCRATCH_BUFFER_H */
diff --git a/REORG.TODO/include/search.h b/REORG.TODO/include/search.h
new file mode 100644
index 0000000000..a941959dbe
--- /dev/null
+++ b/REORG.TODO/include/search.h
@@ -0,0 +1,28 @@
+#ifndef _SEARCH_H
+#include <misc/search.h>
+
+#ifndef _ISOMAC
+extern __typeof (hcreate_r) __hcreate_r;
+libc_hidden_proto (__hcreate_r)
+extern __typeof (hdestroy_r) __hdestroy_r;
+libc_hidden_proto (__hdestroy_r)
+extern __typeof (hsearch_r) __hsearch_r;
+libc_hidden_proto (__hsearch_r)
+libc_hidden_proto (lfind)
+
+/* Now define the internal interfaces. */
+extern void __hdestroy (void);
+extern void *__tsearch (const void *__key, void **__rootp,
+ __compar_fn_t compar);
+libc_hidden_proto (__tsearch)
+extern void *__tfind (const void *__key, void *const *__rootp,
+ __compar_fn_t compar);
+libc_hidden_proto (__tfind)
+extern void *__tdelete (const void *__key, void **__rootp,
+ __compar_fn_t compar);
+libc_hidden_proto (__tdelete)
+extern void __twalk (const void *__root, __action_fn_t action);
+libc_hidden_proto (__twalk)
+extern void __tdestroy (void *__root, __free_fn_t freefct);
+#endif
+#endif
diff --git a/REORG.TODO/include/set-hooks.h b/REORG.TODO/include/set-hooks.h
new file mode 100644
index 0000000000..4a711e1fbd
--- /dev/null
+++ b/REORG.TODO/include/set-hooks.h
@@ -0,0 +1,70 @@
+/* Macros for using symbol sets for running lists of functions.
+ Copyright (C) 1994-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SET_HOOKS_H
+#define _SET_HOOKS_H 1
+
+#define __need_size_t
+#include <stddef.h>
+#include <sys/cdefs.h>
+
+#ifdef symbol_set_define
+/* Define a hook variable called NAME. Functions put on this hook take
+ arguments described by PROTO. Use `text_set_element (NAME, FUNCTION)'
+ from gnu-stabs.h to add a function to the hook. */
+
+# define DEFINE_HOOK(NAME, PROTO) \
+ typedef void __##NAME##_hook_function_t PROTO; \
+ symbol_set_define (NAME)
+
+# define DECLARE_HOOK(NAME, PROTO) \
+ typedef void __##NAME##_hook_function_t PROTO;\
+ symbol_set_declare (NAME)
+
+/* Run all the functions hooked on the set called NAME.
+ Each function is called like this: `function ARGS'. */
+
+# define RUN_HOOK(NAME, ARGS) \
+do { \
+ void *const *ptr; \
+ for (ptr = (void *const *) symbol_set_first_element (NAME); \
+ ! symbol_set_end_p (NAME, ptr); ++ptr) \
+ (*(__##NAME##_hook_function_t *) *ptr) ARGS; \
+} while (0)
+
+/* Define a hook variable with NAME and PROTO, and a function called RUNNER
+ which calls each function on the hook in turn, with ARGS. */
+
+# define DEFINE_HOOK_RUNNER(name, runner, proto, args) \
+DEFINE_HOOK (name, proto); \
+extern void runner proto; void runner proto { RUN_HOOK (name, args); }
+
+#else
+
+/* The system does not provide necessary support for this. */
+# define DEFINE_HOOK(NAME, PROTO)
+
+# define DECLARE_HOOK(NAME, PROTO)
+
+# define RUN_HOOK(NAME, ARGS)
+
+# define DEFINE_HOOK_RUNNER(name, runner, proto, args)
+
+#endif
+
+#endif /* set-hooks.h */
diff --git a/REORG.TODO/include/setjmp.h b/REORG.TODO/include/setjmp.h
new file mode 100644
index 0000000000..90f46976e3
--- /dev/null
+++ b/REORG.TODO/include/setjmp.h
@@ -0,0 +1,33 @@
+#ifndef _SETJMP_H
+#include <setjmp/setjmp.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+
+/* Internal machine-dependent function to restore context sans signal mask. */
+extern void __longjmp (__jmp_buf __env, int __val)
+ __attribute__ ((__noreturn__)) attribute_hidden;
+
+/* Internal function to possibly save the current mask of blocked signals
+ in ENV, and always set the flag saying whether or not it was saved.
+ This is used by the machine-dependent definition of `__sigsetjmp'.
+ Always returns zero, for convenience. */
+extern int __sigjmp_save (jmp_buf __env, int __savemask);
+
+extern void _longjmp_unwind (jmp_buf env, int val);
+
+extern void __libc_siglongjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+extern void __libc_longjmp (sigjmp_buf env, int val)
+ __attribute__ ((noreturn));
+libc_hidden_proto (__libc_longjmp)
+
+libc_hidden_proto (_setjmp)
+libc_hidden_proto (__sigsetjmp)
+
+# if IS_IN (rtld)
+extern __typeof (__sigsetjmp) __sigsetjmp attribute_hidden;
+# endif
+#endif
+
+#endif
diff --git a/REORG.TODO/include/sgtty.h b/REORG.TODO/include/sgtty.h
new file mode 100644
index 0000000000..ffb62401cb
--- /dev/null
+++ b/REORG.TODO/include/sgtty.h
@@ -0,0 +1 @@
+#include <misc/sgtty.h>
diff --git a/REORG.TODO/include/shadow.h b/REORG.TODO/include/shadow.h
new file mode 100644
index 0000000000..124a1ab50a
--- /dev/null
+++ b/REORG.TODO/include/shadow.h
@@ -0,0 +1,53 @@
+#ifndef _SHADOW_H
+#include <shadow/shadow.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern int __getspent_r (struct spwd *__result_buf, char *__buffer,
+ size_t __buflen, struct spwd **__result)
+ attribute_hidden;
+extern int __old_getspent_r (struct spwd *__result_buf, char *__buffer,
+ size_t __buflen, struct spwd **__result);
+extern int __getspnam_r (const char *__name, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+extern int __old_getspnam_r (const char *__name, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+extern int __sgetspent_r (const char *__string,
+ struct spwd *__result_buf, char *__buffer,
+ size_t __buflen, struct spwd **__result);
+extern int __fgetspent_r (FILE *__stream, struct spwd *__result_buf,
+ char *__buffer, size_t __buflen,
+ struct spwd **__result);
+extern int __lckpwdf (void);
+extern int __ulckpwdf (void);
+
+struct parser_data;
+extern int _nss_files_parse_spent (char *line, struct spwd *result,
+ struct parser_data *data,
+ size_t datalen, int *errnop);
+libc_hidden_proto (_nss_files_parse_spent)
+
+#define DECLARE_NSS_PROTOTYPES(service) \
+extern enum nss_status _nss_ ## service ## _setspent (int); \
+extern enum nss_status _nss_ ## service ## _endspent (void); \
+extern enum nss_status _nss_ ## service ## _getspent_r \
+ (struct spwd *pwd, char *buffer, size_t buflen, \
+ int *errnop); \
+extern enum nss_status _nss_ ## service ## _getspnam_r \
+ (const char *name, struct spwd *pwd, \
+ char *buffer, size_t buflen, int *errnop);
+
+DECLARE_NSS_PROTOTYPES (compat)
+DECLARE_NSS_PROTOTYPES (files)
+DECLARE_NSS_PROTOTYPES (hesiod)
+DECLARE_NSS_PROTOTYPES (nis)
+DECLARE_NSS_PROTOTYPES (nisplus)
+
+#undef DECLARE_NSS_PROTOTYPES
+
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/shlib-compat.h b/REORG.TODO/include/shlib-compat.h
new file mode 100644
index 0000000000..41eb362f1d
--- /dev/null
+++ b/REORG.TODO/include/shlib-compat.h
@@ -0,0 +1,100 @@
+/* Macros for managing ABI-compatibility definitions using ELF symbol versions.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SHLIB_COMPAT_H
+#define _SHLIB_COMPAT_H 1
+
+# include <abi-versions.h>
+
+#ifdef SHARED
+
+/* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
+ symbols like `ABI_libm_GLIBC_2_0' for each version set in the source
+ code for each library. For a version set that is subsumed by a later
+ version set, the definition gives the subsuming set, i.e. if GLIBC_2_0
+ is subsumed by GLIBC_2_1, then ABI_libm_GLIBC_2_0 == ABI_libm_GLIBC_2_1.
+ Each version set that is to be distinctly defined in the output has an
+ unique positive integer value, increasing with newer versions. Thus,
+ evaluating two ABI_* symbols reduces to integer values that differ only
+ when the two version sets named are in fact two different ABIs we are
+ supporting. If these do not differ, then there is no need to compile in
+ extra code to support this version set where it has been superseded by a
+ newer version. The compatibility code should be conditionalized with
+ e.g. `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
+ in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version. */
+
+# define SHLIB_COMPAT(lib, introduced, obsoleted) \
+ _SHLIB_COMPAT (lib, introduced, obsoleted)
+# define _SHLIB_COMPAT(lib, introduced, obsoleted) \
+ (IS_IN (lib) \
+ && (!(ABI_##lib##_##obsoleted - 0) \
+ || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
+
+/* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
+ the version set name to use for e.g. symbols first introduced into
+ libm in the GLIBC_2.1 version. Definitions of symbols with explicit
+ versions should look like:
+ versioned_symbol (libm, new_foo, foo, GLIBC_2_1);
+ This will define the symbol `foo' with the appropriate default version,
+ i.e. either GLIBC_2.1 or the "earliest version" specified in
+ shlib-versions if that is newer. */
+
+# define versioned_symbol(lib, local, symbol, version) \
+ versioned_symbol_1 (lib, local, symbol, version)
+# define versioned_symbol_1(lib, local, symbol, version) \
+ versioned_symbol_2 (local, symbol, VERSION_##lib##_##version)
+# define versioned_symbol_2(local, symbol, name) \
+ default_symbol_version (local, symbol, name)
+
+# define compat_symbol(lib, local, symbol, version) \
+ compat_symbol_reference (lib, local, symbol, version)
+
+#else
+
+/* Not compiling ELF shared libraries at all, so never any old versions. */
+# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+
+/* No versions to worry about, just make this the global definition. */
+# define versioned_symbol(lib, local, symbol, version) \
+ weak_alias (local, symbol)
+
+/* This should not appear outside `#if SHLIB_COMPAT (...)'. */
+# define compat_symbol(lib, local, symbol, version) ...
+
+#endif
+
+/* Use compat_symbol_reference for a reference to a specific version
+ of a symbol. Use compat_symbol to define such a symbol. */
+#define compat_symbol_reference(lib, local, symbol, version) \
+ compat_symbol_reference_1 (lib, local, symbol, version)
+#define compat_symbol_reference_1(lib, local, symbol, version) \
+ compat_symbol_reference_2 (local, symbol, VERSION_##lib##_##version)
+#define compat_symbol_reference_2(local, symbol, name) \
+ symbol_version_reference (local, symbol, name)
+
+# ifdef LINK_OBSOLETE_RPC
+/* Export the symbol for both static and dynamic linking. */
+# define libc_sunrpc_symbol(name, aliasname, version) \
+ strong_alias (name, aliasname)
+# else
+/* Export the symbol only for shared-library compatibility. */
+# define libc_sunrpc_symbol(name, aliasname, version) \
+ compat_symbol (libc, name, aliasname, version);
+# endif
+
+#endif /* shlib-compat.h */
diff --git a/REORG.TODO/include/signal.h b/REORG.TODO/include/signal.h
new file mode 100644
index 0000000000..bcf1455ae7
--- /dev/null
+++ b/REORG.TODO/include/signal.h
@@ -0,0 +1,62 @@
+#ifndef _SIGNAL_H
+# include <signal/signal.h>
+
+# ifndef _ISOMAC
+libc_hidden_proto (sigemptyset)
+libc_hidden_proto (sigfillset)
+libc_hidden_proto (sigaddset)
+libc_hidden_proto (sigdelset)
+libc_hidden_proto (sigismember)
+extern int __sigpause (int sig_or_mask, int is_sig);
+libc_hidden_proto (__sigpause)
+libc_hidden_proto (raise)
+libc_hidden_proto (__libc_current_sigrtmin)
+libc_hidden_proto (__libc_current_sigrtmax)
+libc_hidden_proto (_sys_siglist)
+
+/* Now define the internal interfaces. */
+extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler);
+extern int __kill (__pid_t __pid, int __sig);
+extern int __sigaction (int __sig, const struct sigaction *__restrict __act,
+ struct sigaction *__restrict __oact);
+libc_hidden_proto (__sigaction)
+extern int __sigblock (int __mask);
+extern int __sigsetmask (int __mask);
+extern int __sigprocmask (int __how,
+ const sigset_t *__set, sigset_t *__oset);
+extern int __sigsuspend (const sigset_t *__set);
+libc_hidden_proto (__sigsuspend)
+#ifndef NO_CANCELLATION
+extern int __sigsuspend_nocancel (const sigset_t *__set) attribute_hidden;
+#endif
+extern int __sigwait (const sigset_t *__set, int *__sig);
+libc_hidden_proto (__sigwait)
+extern int __sigwaitinfo (const sigset_t *__set, siginfo_t *__info);
+libc_hidden_proto (__sigwaitinfo)
+extern int __sigtimedwait (const sigset_t *__set, siginfo_t *__info,
+ const struct timespec *__timeout);
+libc_hidden_proto (__sigtimedwait)
+extern int __sigqueue (__pid_t __pid, int __sig,
+ const union sigval __val);
+#ifdef __USE_MISC
+extern int __sigreturn (struct sigcontext *__scp);
+#endif
+extern int __sigaltstack (const stack_t *__ss,
+ stack_t *__oss);
+extern int __libc_sigaction (int sig, const struct sigaction *act,
+ struct sigaction *oact);
+libc_hidden_proto (__libc_sigaction)
+
+extern int __default_sigpause (int mask);
+extern int __xpg_sigpause (int sig);
+
+/* Allocate real-time signal with highest/lowest available priority. */
+extern int __libc_allocate_rtsig (int __high);
+
+# if IS_IN (rtld)
+extern __typeof (__sigaction) __sigaction attribute_hidden;
+extern __typeof (__libc_sigaction) __libc_sigaction attribute_hidden;
+# endif
+
+# endif /* _ISOMAC */
+#endif /* signal.h */
diff --git a/REORG.TODO/include/spawn.h b/REORG.TODO/include/spawn.h
new file mode 100644
index 0000000000..a6c7a8adc3
--- /dev/null
+++ b/REORG.TODO/include/spawn.h
@@ -0,0 +1 @@
+#include <posix/spawn.h>
diff --git a/REORG.TODO/include/stab.h b/REORG.TODO/include/stab.h
new file mode 100644
index 0000000000..2e278fc778
--- /dev/null
+++ b/REORG.TODO/include/stab.h
@@ -0,0 +1 @@
+#include <misc/stab.h>
diff --git a/REORG.TODO/include/stackinfo.h b/REORG.TODO/include/stackinfo.h
new file mode 100644
index 0000000000..e359f95e2c
--- /dev/null
+++ b/REORG.TODO/include/stackinfo.h
@@ -0,0 +1,42 @@
+/* Details about the machine's stack: wrapper header.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _INCLUDE_STACKINFO_H
+#define _INCLUDE_STACKINFO_H 1
+
+/* A sysdeps/.../stackinfo.h file defines details for the CPU.
+ It is obliged to define either _STACK_GROWS_DOWN or _STACK_GROWS_UP. */
+#include_next <stackinfo.h>
+
+#if defined _STACK_GROWS_DOWN && _STACK_GROWS_DOWN
+# ifdef _STACK_GROWS_UP
+# error "stackinfo.h should not define both!"
+# else
+# define _STACK_GROWS_UP 0
+# endif
+#elif defined _STACK_GROWS_UP && _STACK_GROWS_UP
+# ifdef _STACK_GROWS_DOWN
+# error "stackinfo.h should not define both!"
+# else
+# define _STACK_GROWS_DOWN 0
+# endif
+#else
+# error "stackinfo.h must define _STACK_GROWS_UP or _STACK_GROWS_DOWN!"
+#endif
+
+#endif /* include/stackinfo.h */
diff --git a/REORG.TODO/include/stap-probe.h b/REORG.TODO/include/stap-probe.h
new file mode 100644
index 0000000000..d45b0466bc
--- /dev/null
+++ b/REORG.TODO/include/stap-probe.h
@@ -0,0 +1,77 @@
+/* Macros for defining Systemtap <sys/sdt.h> static probe points.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _STAP_PROBE_H
+#define _STAP_PROBE_H 1
+
+#ifdef USE_STAP_PROBE
+
+# include <sys/sdt.h>
+
+/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
+
+ Without USE_STAP_PROBE, that does nothing but evaluates all
+ its arguments (to prevent bit rot, unlike e.g. assert).
+
+ Systemtap's header defines the macros STAP_PROBE (provider, name) and
+ STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
+ in MODULE_NAME (libc, libpthread, etc.) automagically.
+
+ The format of the arg parameters is discussed here:
+
+ https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
+
+ The precise details of how register names are specified is
+ architecture specific and can be found in the gdb and SystemTap
+ source code. */
+
+# define LIBC_PROBE(name, n, ...) \
+ LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)
+
+# define LIBC_PROBE_1(lib, name, n, ...) \
+ STAP_PROBE##n (lib, name, ## __VA_ARGS__)
+
+# define STAP_PROBE0 STAP_PROBE
+
+# define LIBC_PROBE_ASM(name, template) \
+ STAP_PROBE_ASM (MODULE_NAME, name, template)
+
+# define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
+
+#else /* Not USE_STAP_PROBE. */
+
+# ifndef __ASSEMBLER__
+/* Evaluate all the arguments and verify that N matches their number. */
+# define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__)
+
+# define STAP_PROBE0()
+# define STAP_PROBE1(a1)
+# define STAP_PROBE2(a1, a2)
+# define STAP_PROBE3(a1, a2, a3)
+# define STAP_PROBE4(a1, a2, a3, a4)
+
+# else
+# define LIBC_PROBE(name, n, ...) /* Nothing. */
+# endif
+
+# define LIBC_PROBE_ASM(name, template) /* Nothing. */
+# define LIBC_PROBE_ASM_OPERANDS(n, ...) /* Nothing. */
+
+#endif /* USE_STAP_PROBE. */
+
+#endif /* stap-probe.h */
diff --git a/REORG.TODO/include/stdc-predef.h b/REORG.TODO/include/stdc-predef.h
new file mode 100644
index 0000000000..a2e148cd2f
--- /dev/null
+++ b/REORG.TODO/include/stdc-predef.h
@@ -0,0 +1,62 @@
+/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _STDC_PREDEF_H
+#define _STDC_PREDEF_H 1
+
+/* This header is separate from features.h so that the compiler can
+ include it implicitly at the start of every compilation. It must
+ not itself include <features.h> or any other header that includes
+ <features.h> because the implicit include comes before any feature
+ test macros that may be defined in a source file before it first
+ explicitly includes a system header. GCC knows the name of this
+ header in order to preinclude it. */
+
+/* glibc's intent is to support the IEC 559 math functionality, real
+ and complex. If the GCC (4.9 and later) predefined macros
+ specifying compiler intent are available, use them to determine
+ whether the overall intent is to support these features; otherwise,
+ presume an older compiler has intent to support these features and
+ define these macros by default. */
+
+#ifdef __GCC_IEC_559
+# if __GCC_IEC_559 > 0
+# define __STDC_IEC_559__ 1
+# endif
+#else
+# define __STDC_IEC_559__ 1
+#endif
+
+#ifdef __GCC_IEC_559_COMPLEX
+# if __GCC_IEC_559_COMPLEX > 0
+# define __STDC_IEC_559_COMPLEX__ 1
+# endif
+#else
+# define __STDC_IEC_559_COMPLEX__ 1
+#endif
+
+/* wchar_t uses Unicode 9.0.0. Version 9.0 of the Unicode Standard is
+ synchronized with ISO/IEC 10646:2014, fourth edition, plus
+ Amd. 1 and Amd. 2 and 273 characters from forthcoming 10646, fifth edition.
+ (Amd. 2 was published 2016-05-01,
+ see https://www.iso.org/obp/ui/#iso:std:iso-iec:10646:ed-4:v1:amd:2:v1:en) */
+#define __STDC_ISO_10646__ 201605L
+
+/* We do not support C11 <threads.h>. */
+#define __STDC_NO_THREADS__ 1
+
+#endif
diff --git a/REORG.TODO/include/stdio.h b/REORG.TODO/include/stdio.h
new file mode 100644
index 0000000000..f68f633bd6
--- /dev/null
+++ b/REORG.TODO/include/stdio.h
@@ -0,0 +1,185 @@
+#ifndef _STDIO_H
+# include <libio/stdio.h>
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+
+extern int __fcloseall (void);
+extern int __snprintf (char *__restrict __s, size_t __maxlen,
+ const char *__restrict __format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+libc_hidden_proto (__snprintf)
+extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
+ const char *__restrict __format, _G_va_list __arg)
+ __attribute__ ((__format__ (__printf__, 3, 0)));
+extern int __vfscanf (FILE *__restrict __s,
+ const char *__restrict __format,
+ _G_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 2, 0)));
+libc_hidden_proto (__vfscanf)
+extern int __vscanf (const char *__restrict __format,
+ _G_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 1, 0)));
+extern _IO_ssize_t __getline (char **__lineptr, size_t *__n,
+ FILE *__stream);
+extern int __vsscanf (const char *__restrict __s,
+ const char *__restrict __format,
+ _G_va_list __arg)
+ __attribute__ ((__format__ (__scanf__, 2, 0)));
+
+extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW;
+extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...)
+ __THROW;
+extern int __vsprintf_chk (char *, int, size_t, const char *,
+ _G_va_list) __THROW;
+extern int __vsnprintf_chk (char *, size_t, int, size_t, const char *,
+ _G_va_list) __THROW;
+extern int __printf_chk (int, const char *, ...);
+extern int __fprintf_chk (FILE *, int, const char *, ...);
+extern int __vprintf_chk (int, const char *, _G_va_list);
+extern int __vfprintf_chk (FILE *, int, const char *, _G_va_list);
+extern char *__fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp);
+extern char *__fgets_chk (char *buf, size_t size, int n, FILE *fp);
+extern int __asprintf_chk (char **, int, const char *, ...) __THROW;
+extern int __vasprintf_chk (char **, int, const char *, _G_va_list) __THROW;
+extern int __dprintf_chk (int, int, const char *, ...);
+extern int __vdprintf_chk (int, int, const char *, _G_va_list);
+extern int __obstack_printf_chk (struct obstack *, int, const char *, ...)
+ __THROW;
+extern int __obstack_vprintf_chk (struct obstack *, int, const char *,
+ _G_va_list) __THROW;
+
+extern int __isoc99_fscanf (FILE *__restrict __stream,
+ const char *__restrict __format, ...) __wur;
+extern int __isoc99_scanf (const char *__restrict __format, ...) __wur;
+extern int __isoc99_sscanf (const char *__restrict __s,
+ const char *__restrict __format, ...) __THROW;
+extern int __isoc99_vfscanf (FILE *__restrict __s,
+ const char *__restrict __format,
+ _G_va_list __arg) __wur;
+extern int __isoc99_vscanf (const char *__restrict __format,
+ _G_va_list __arg) __wur;
+extern int __isoc99_vsscanf (const char *__restrict __s,
+ const char *__restrict __format,
+ _G_va_list __arg) __THROW;
+libc_hidden_proto (__isoc99_vsscanf)
+libc_hidden_proto (__isoc99_vfscanf)
+
+/* Prototypes for compatibility functions. */
+extern FILE *__new_tmpfile (void);
+extern FILE *__old_tmpfile (void);
+
+# define __need_size_t
+# include <stddef.h>
+
+# include <bits/types/wint_t.h>
+
+/* Generate a unique file name (and possibly open it). */
+extern int __path_search (char *__tmpl, size_t __tmpl_len,
+ const char *__dir, const char *__pfx,
+ int __try_tempdir);
+
+extern int __gen_tempname (char *__tmpl, int __suffixlen, int __flags,
+ int __kind);
+/* The __kind argument to __gen_tempname may be one of: */
+# define __GT_FILE 0 /* create a file */
+# define __GT_DIR 1 /* create a directory */
+# define __GT_NOCREATE 2 /* just find a name not currently in use */
+
+/* Print out MESSAGE on the error output and abort. */
+extern void __libc_fatal (const char *__message)
+ __attribute__ ((__noreturn__));
+extern void __libc_message (int do_abort, const char *__fnt, ...);
+extern void __fortify_fail (const char *msg)
+ __attribute__ ((__noreturn__)) internal_function;
+libc_hidden_proto (__fortify_fail)
+
+/* Acquire ownership of STREAM. */
+extern void __flockfile (FILE *__stream);
+
+/* Relinquish the ownership granted for STREAM. */
+extern void __funlockfile (FILE *__stream);
+
+/* Try to acquire ownership of STREAM but do not block if it is not
+ possible. */
+extern int __ftrylockfile (FILE *__stream);
+
+extern int __getc_unlocked (FILE *__fp);
+extern wint_t __getwc_unlocked (FILE *__fp);
+
+extern int __fxprintf (FILE *__fp, const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern int __fxprintf_nocancel (FILE *__fp, const char *__fmt, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+
+extern const char *const _sys_errlist_internal[] attribute_hidden;
+extern int _sys_nerr_internal attribute_hidden;
+
+libc_hidden_proto (__asprintf)
+# if IS_IN (libc)
+extern _IO_FILE *_IO_new_fopen (const char*, const char*);
+# define fopen(fname, mode) _IO_new_fopen (fname, mode)
+extern _IO_FILE *_IO_new_fdopen (int, const char*);
+# define fdopen(fd, mode) _IO_new_fdopen (fd, mode)
+extern int _IO_new_fclose (_IO_FILE*);
+# define fclose(fp) _IO_new_fclose (fp)
+extern int _IO_fputs (const char*, _IO_FILE*);
+libc_hidden_proto (_IO_fputs)
+# define fputs(str, fp) _IO_fputs (str, fp)
+extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);
+# define fsetpos(fp, posp) _IO_new_fsetpos (fp, posp)
+extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);
+# define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp)
+# endif
+
+libc_hidden_proto (dprintf)
+extern __typeof (dprintf) __dprintf
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+libc_hidden_proto (__dprintf)
+libc_hidden_proto (fprintf)
+libc_hidden_proto (vfprintf)
+libc_hidden_proto (sprintf)
+libc_hidden_proto (sscanf)
+libc_hidden_proto (fwrite)
+libc_hidden_proto (perror)
+libc_hidden_proto (remove)
+libc_hidden_proto (rewind)
+libc_hidden_proto (fileno)
+extern __typeof (fileno) __fileno;
+libc_hidden_proto (__fileno)
+libc_hidden_proto (fwrite)
+libc_hidden_proto (fseek)
+extern __typeof (ftello) __ftello;
+libc_hidden_proto (__ftello)
+libc_hidden_proto (fflush)
+libc_hidden_proto (fflush_unlocked)
+extern __typeof (fflush_unlocked) __fflush_unlocked;
+libc_hidden_proto (__fflush_unlocked)
+extern __typeof (fread_unlocked) __fread_unlocked;
+libc_hidden_proto (__fread_unlocked)
+libc_hidden_proto (fwrite_unlocked)
+libc_hidden_proto (fgets_unlocked)
+extern __typeof (fgets_unlocked) __fgets_unlocked;
+libc_hidden_proto (__fgets_unlocked)
+libc_hidden_proto (fputs_unlocked)
+extern __typeof (fputs_unlocked) __fputs_unlocked;
+libc_hidden_proto (__fputs_unlocked)
+libc_hidden_proto (fmemopen)
+/* The prototype needs repeating instead of using __typeof to use
+ __THROW in C++ tests. */
+extern FILE *__open_memstream (char **, size_t *) __THROW __wur;
+libc_hidden_proto (__open_memstream)
+libc_hidden_proto (__libc_fatal)
+rtld_hidden_proto (__libc_fatal)
+libc_hidden_proto (__vsprintf_chk)
+libc_hidden_proto (__vsnprintf_chk)
+libc_hidden_proto (__vfprintf_chk)
+libc_hidden_proto (__vasprintf_chk)
+libc_hidden_proto (__vdprintf_chk)
+libc_hidden_proto (__obstack_vprintf_chk)
+
+extern FILE * __fmemopen (void *buf, size_t len, const char *mode);
+libc_hidden_proto (__fmemopen)
+
+# endif /* not _ISOMAC */
+#endif /* stdio.h */
diff --git a/REORG.TODO/include/stdio_ext.h b/REORG.TODO/include/stdio_ext.h
new file mode 100644
index 0000000000..29c6e68cdb
--- /dev/null
+++ b/REORG.TODO/include/stdio_ext.h
@@ -0,0 +1,23 @@
+#ifndef _STDIO_EXT_H
+#include <stdio-common/stdio_ext.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (__fsetlocking)
+
+#define __fsetlocking(fp, type) \
+ ({ int __result = ((fp->_flags & _IO_USER_LOCK) \
+ ? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL); \
+ \
+ if (type != FSETLOCKING_QUERY) \
+ { \
+ fp->_flags &= ~_IO_USER_LOCK; \
+ if (type == FSETLOCKING_BYCALLER) \
+ fp->_flags |= _IO_USER_LOCK; \
+ } \
+ \
+ __result; \
+ })
+
+# endif /* !_ISOMAC */
+#endif /* stdio_ext.h */
diff --git a/REORG.TODO/include/stdlib.h b/REORG.TODO/include/stdlib.h
new file mode 100644
index 0000000000..5847445fd3
--- /dev/null
+++ b/REORG.TODO/include/stdlib.h
@@ -0,0 +1,268 @@
+#ifndef _STDLIB_H
+
+#ifndef _ISOMAC
+# include <stddef.h>
+#endif
+#include <stdlib/stdlib.h>
+
+/* Now define the internal interfaces. */
+#if !defined _ISOMAC
+# include <sys/stat.h>
+
+extern __typeof (strtol_l) __strtol_l;
+extern __typeof (strtoul_l) __strtoul_l;
+extern __typeof (strtoll_l) __strtoll_l;
+extern __typeof (strtoull_l) __strtoull_l;
+extern __typeof (strtod_l) __strtod_l;
+extern __typeof (strtof_l) __strtof_l;
+extern __typeof (strtold_l) __strtold_l;
+libc_hidden_proto (__strtol_l)
+libc_hidden_proto (__strtoul_l)
+libc_hidden_proto (__strtoll_l)
+libc_hidden_proto (__strtoull_l)
+libc_hidden_proto (__strtod_l)
+libc_hidden_proto (__strtof_l)
+libc_hidden_proto (__strtold_l)
+
+libc_hidden_proto (exit)
+libc_hidden_proto (abort)
+libc_hidden_proto (getenv)
+extern __typeof (secure_getenv) __libc_secure_getenv;
+libc_hidden_proto (__libc_secure_getenv)
+libc_hidden_proto (bsearch)
+libc_hidden_proto (qsort)
+extern __typeof (qsort_r) __qsort_r;
+libc_hidden_proto (__qsort_r)
+libc_hidden_proto (lrand48_r)
+libc_hidden_proto (wctomb)
+
+extern long int __random (void);
+extern void __srandom (unsigned int __seed);
+extern char *__initstate (unsigned int __seed, char *__statebuf,
+ size_t __statelen);
+extern char *__setstate (char *__statebuf);
+extern int __random_r (struct random_data *__buf, int32_t *__result);
+extern int __srandom_r (unsigned int __seed, struct random_data *__buf);
+extern int __initstate_r (unsigned int __seed, char *__statebuf,
+ size_t __statelen, struct random_data *__buf);
+extern int __setstate_r (char *__statebuf, struct random_data *__buf);
+extern int __rand_r (unsigned int *__seed);
+extern int __erand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__buffer, double *__result);
+extern int __nrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__buffer,
+ long int *__result);
+extern int __jrand48_r (unsigned short int __xsubi[3],
+ struct drand48_data *__buffer,
+ long int *__result);
+extern int __srand48_r (long int __seedval,
+ struct drand48_data *__buffer);
+extern int __seed48_r (unsigned short int __seed16v[3],
+ struct drand48_data *__buffer);
+extern int __lcong48_r (unsigned short int __param[7],
+ struct drand48_data *__buffer);
+
+/* Internal function to compute next state of the generator. */
+extern int __drand48_iterate (unsigned short int __xsubi[3],
+ struct drand48_data *__buffer);
+
+/* Global state for non-reentrant functions. Defined in drand48-iter.c. */
+extern struct drand48_data __libc_drand48_data attribute_hidden;
+
+extern int __setenv (const char *__name, const char *__value, int __replace);
+extern int __unsetenv (const char *__name);
+extern int __clearenv (void);
+extern char *__mktemp (char *__template) __THROW __nonnull ((1));
+extern char *__canonicalize_file_name (const char *__name);
+extern char *__realpath (const char *__name, char *__resolved);
+extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
+# ifndef _ISOMAC
+extern int __ptsname_internal (int fd, char *buf, size_t buflen,
+ struct stat64 *stp);
+# endif
+extern int __getpt (void);
+extern int __posix_openpt (int __oflag);
+
+extern int __add_to_environ (const char *name, const char *value,
+ const char *combines, int replace);
+
+extern void _quicksort (void *const pbase, size_t total_elems,
+ size_t size, __compar_d_fn_t cmp, void *arg);
+
+extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg);
+
+extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
+libc_hidden_proto (__cxa_atexit);
+
+extern int __cxa_thread_atexit_impl (void (*func) (void *), void *arg,
+ void *d);
+extern void __call_tls_dtors (void)
+#ifndef SHARED
+ __attribute__ ((weak))
+#endif
+ ;
+libc_hidden_proto (__call_tls_dtors)
+
+extern void __cxa_finalize (void *d);
+
+extern int __posix_memalign (void **memptr, size_t alignment, size_t size);
+
+extern void *__libc_memalign (size_t alignment, size_t size)
+ __attribute_malloc__;
+
+extern void *__libc_reallocarray (void *__ptr, size_t __nmemb, size_t __size)
+ __THROW __attribute_warn_unused_result__;
+libc_hidden_proto (__libc_reallocarray)
+
+extern int __libc_system (const char *line);
+
+
+extern double __strtod_internal (const char *__restrict __nptr,
+ char **__restrict __endptr, int __group)
+ __THROW __nonnull ((1)) __wur;
+extern float __strtof_internal (const char *__restrict __nptr,
+ char **__restrict __endptr, int __group)
+ __THROW __nonnull ((1)) __wur;
+extern long double __strtold_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __group)
+ __THROW __nonnull ((1)) __wur;
+extern long int __strtol_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+extern unsigned long int __strtoul_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+__extension__
+extern long long int __strtoll_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+__extension__
+extern unsigned long long int __strtoull_internal (const char *
+ __restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group)
+ __THROW __nonnull ((1)) __wur;
+libc_hidden_proto (__strtof_internal)
+libc_hidden_proto (__strtod_internal)
+libc_hidden_proto (__strtold_internal)
+libc_hidden_proto (__strtol_internal)
+libc_hidden_proto (__strtoll_internal)
+libc_hidden_proto (__strtoul_internal)
+libc_hidden_proto (__strtoull_internal)
+
+extern double ____strtod_l_internal (const char *__restrict __nptr,
+ char **__restrict __endptr, int __group,
+ __locale_t __loc);
+extern float ____strtof_l_internal (const char *__restrict __nptr,
+ char **__restrict __endptr, int __group,
+ __locale_t __loc);
+extern long double ____strtold_l_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __group, __locale_t __loc);
+extern long int ____strtol_l_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group,
+ __locale_t __loc);
+extern unsigned long int ____strtoul_l_internal (const char *
+ __restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group,
+ __locale_t __loc);
+__extension__
+extern long long int ____strtoll_l_internal (const char *__restrict __nptr,
+ char **__restrict __endptr,
+ int __base, int __group,
+ __locale_t __loc);
+__extension__
+extern unsigned long long int ____strtoull_l_internal (const char *
+ __restrict __nptr,
+ char **
+ __restrict __endptr,
+ int __base, int __group,
+ __locale_t __loc);
+
+libc_hidden_proto (____strtof_l_internal)
+libc_hidden_proto (____strtod_l_internal)
+libc_hidden_proto (____strtold_l_internal)
+libc_hidden_proto (____strtol_l_internal)
+libc_hidden_proto (____strtoll_l_internal)
+libc_hidden_proto (____strtoul_l_internal)
+libc_hidden_proto (____strtoull_l_internal)
+
+libc_hidden_proto (strtof)
+libc_hidden_proto (strtod)
+libc_hidden_proto (strtold)
+libc_hidden_proto (strtol)
+libc_hidden_proto (strtoll)
+libc_hidden_proto (strtoul)
+libc_hidden_proto (strtoull)
+
+extern float __strtof_nan (const char *, char **, char) internal_function;
+extern double __strtod_nan (const char *, char **, char) internal_function;
+extern long double __strtold_nan (const char *, char **, char)
+ internal_function;
+extern float __wcstof_nan (const wchar_t *, wchar_t **, wchar_t)
+ internal_function;
+extern double __wcstod_nan (const wchar_t *, wchar_t **, wchar_t)
+ internal_function;
+extern long double __wcstold_nan (const wchar_t *, wchar_t **, wchar_t)
+ internal_function;
+
+libc_hidden_proto (__strtof_nan)
+libc_hidden_proto (__strtod_nan)
+libc_hidden_proto (__strtold_nan)
+libc_hidden_proto (__wcstof_nan)
+libc_hidden_proto (__wcstod_nan)
+libc_hidden_proto (__wcstold_nan)
+
+extern char *__ecvt (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign);
+extern char *__fcvt (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign);
+extern char *__gcvt (double __value, int __ndigit, char *__buf);
+extern int __ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign, char *__restrict __buf,
+ size_t __len);
+extern int __fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
+ int *__restrict __sign, char *__restrict __buf,
+ size_t __len);
+extern char *__qecvt (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign);
+extern char *__qfcvt (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign);
+extern char *__qgcvt (long double __value, int __ndigit, char *__buf);
+extern int __qecvt_r (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign,
+ char *__restrict __buf, size_t __len);
+extern int __qfcvt_r (long double __value, int __ndigit,
+ int *__restrict __decpt, int *__restrict __sign,
+ char *__restrict __buf, size_t __len);
+
+# if IS_IN (libc)
+# undef MB_CUR_MAX
+# define MB_CUR_MAX (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX))
+# endif
+
+extern void *__default_morecore (ptrdiff_t) __THROW;
+libc_hidden_proto (__default_morecore)
+
+struct abort_msg_s
+{
+ unsigned int size;
+ char msg[0];
+};
+extern struct abort_msg_s *__abort_msg;
+libc_hidden_proto (__abort_msg)
+
+# if IS_IN (rtld)
+extern __typeof (unsetenv) unsetenv attribute_hidden;
+extern __typeof (__strtoul_internal) __strtoul_internal attribute_hidden;
+# endif
+
+#endif
+
+#endif /* include/stdlib.h */
diff --git a/REORG.TODO/include/string.h b/REORG.TODO/include/string.h
new file mode 100644
index 0000000000..ce71674086
--- /dev/null
+++ b/REORG.TODO/include/string.h
@@ -0,0 +1,192 @@
+#ifndef _STRING_H
+
+#ifndef _ISOMAC
+/* Some of these are defined as macros in the real string.h, so we must
+ prototype them before including it. */
+#include <sys/types.h>
+
+extern void *__memccpy (void *__dest, const void *__src,
+ int __c, size_t __n);
+
+extern size_t __strnlen (const char *__string, size_t __maxlen)
+ __attribute_pure__;
+
+extern char *__strsep (char **__stringp, const char *__delim);
+
+extern int __strverscmp (const char *__s1, const char *__s2)
+ __attribute_pure__;
+
+extern int __strncasecmp (const char *__s1, const char *__s2,
+ size_t __n)
+ __attribute_pure__;
+
+extern int __strcasecmp (const char *__s1, const char *__s2)
+ __attribute_pure__;
+
+extern char *__strcasestr (const char *__haystack, const char *__needle)
+ __attribute_pure__;
+
+extern char *__strdup (const char *__string)
+ __attribute_malloc__;
+extern char *__strndup (const char *__string, size_t __n)
+ __attribute_malloc__;
+
+extern void *__rawmemchr (const void *__s, int __c)
+ __attribute_pure__;
+
+extern char *__strchrnul (const char *__s, int __c)
+ __attribute_pure__;
+
+extern void *__memrchr (const void *__s, int __c, size_t __n)
+ __attribute_pure__;
+
+extern void *__memchr (const void *__s, int __c, size_t __n)
+ __attribute_pure__;
+
+extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+
+extern int __ffs (int __i) __attribute__ ((const));
+
+extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
+
+/* Get _STRING_ARCH_unaligned. */
+#include <string_private.h>
+#endif
+
+#include <string/string.h>
+
+#ifndef _ISOMAC
+extern __typeof (strcoll_l) __strcoll_l;
+extern __typeof (strxfrm_l) __strxfrm_l;
+extern __typeof (strcasecmp_l) __strcasecmp_l;
+extern __typeof (strncasecmp_l) __strncasecmp_l;
+
+/* Alternative version which doesn't pollute glibc's namespace. */
+#if IS_IN (libc)
+# undef strndupa
+# define strndupa(s, n) \
+ (__extension__ \
+ ({ \
+ const char *__old = (s); \
+ size_t __len = __strnlen (__old, (n)); \
+ char *__new = (char *) __builtin_alloca (__len + 1); \
+ __new[__len] = '\0'; \
+ (char *) memcpy (__new, __old, __len); \
+ }))
+#endif
+
+libc_hidden_proto (__mempcpy)
+libc_hidden_proto (__stpcpy)
+libc_hidden_proto (__stpncpy)
+libc_hidden_proto (__rawmemchr)
+libc_hidden_proto (__strcasecmp)
+libc_hidden_proto (__strcasecmp_l)
+libc_hidden_proto (__strncasecmp_l)
+libc_hidden_proto (__strdup)
+libc_hidden_proto (__strndup)
+libc_hidden_proto (__strerror_r)
+libc_hidden_proto (__strverscmp)
+libc_hidden_proto (basename)
+extern char *__basename (const char *__filename) __THROW __nonnull ((1));
+libc_hidden_proto (__basename)
+libc_hidden_proto (strcoll)
+libc_hidden_proto (__strcoll_l)
+libc_hidden_proto (__strxfrm_l)
+libc_hidden_proto (__strtok_r)
+extern char *__strsep_g (char **__stringp, const char *__delim);
+libc_hidden_proto (__strsep_g)
+libc_hidden_proto (strnlen)
+libc_hidden_proto (__strnlen)
+libc_hidden_proto (memmem)
+extern __typeof (memmem) __memmem;
+libc_hidden_proto (__memmem)
+libc_hidden_proto (__ffs)
+
+#if IS_IN (libc)
+/* Avoid hidden reference to IFUNC symbol __explicit_bzero_chk. */
+void __explicit_bzero_chk_internal (void *, size_t, size_t)
+ __THROW __nonnull ((1)) attribute_hidden;
+# define explicit_bzero(buf, len) \
+ __explicit_bzero_chk_internal (buf, len, __bos0 (buf))
+#elif !IS_IN (nonlib)
+void __explicit_bzero_chk (void *, size_t, size_t) __THROW __nonnull ((1));
+# define explicit_bzero(buf, len) __explicit_bzero_chk (buf, len, __bos0 (buf))
+#endif
+
+libc_hidden_builtin_proto (memchr)
+libc_hidden_builtin_proto (memcpy)
+libc_hidden_builtin_proto (mempcpy)
+libc_hidden_builtin_proto (memcmp)
+libc_hidden_builtin_proto (memmove)
+libc_hidden_builtin_proto (memset)
+libc_hidden_builtin_proto (strcat)
+libc_hidden_builtin_proto (strchr)
+libc_hidden_builtin_proto (strcmp)
+libc_hidden_builtin_proto (strcpy)
+libc_hidden_builtin_proto (strcspn)
+libc_hidden_builtin_proto (strlen)
+libc_hidden_builtin_proto (strncmp)
+libc_hidden_builtin_proto (strncpy)
+libc_hidden_builtin_proto (strpbrk)
+libc_hidden_builtin_proto (stpcpy)
+libc_hidden_builtin_proto (strrchr)
+libc_hidden_builtin_proto (strspn)
+libc_hidden_builtin_proto (strstr)
+libc_hidden_builtin_proto (ffs)
+
+#if IS_IN (rtld)
+extern __typeof (__stpcpy) __stpcpy attribute_hidden;
+extern __typeof (__strdup) __strdup attribute_hidden;
+extern __typeof (__strerror_r) __strerror_r attribute_hidden;
+extern __typeof (__strsep_g) __strsep_g attribute_hidden;
+
+extern __typeof (memchr) memchr attribute_hidden;
+extern __typeof (memcmp) memcmp attribute_hidden;
+extern __typeof (memcpy) memcpy attribute_hidden;
+extern __typeof (memmove) memmove attribute_hidden;
+extern __typeof (memset) memset attribute_hidden;
+extern __typeof (rawmemchr) rawmemchr attribute_hidden;
+extern __typeof (stpcpy) stpcpy attribute_hidden;
+extern __typeof (strchr) strchr attribute_hidden;
+extern __typeof (strcmp) strcmp attribute_hidden;
+extern __typeof (strlen) strlen attribute_hidden;
+extern __typeof (strnlen) strnlen attribute_hidden;
+extern __typeof (strsep) strsep attribute_hidden;
+#endif
+
+#if (!IS_IN (libc) || !defined SHARED) \
+ && !defined NO_MEMPCPY_STPCPY_REDIRECT
+/* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
+ __mempcpy and __stpcpy if not inlined. */
+extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");
+extern __typeof (stpcpy) stpcpy __asm__ ("__stpcpy");
+#endif
+
+extern void *__memcpy_chk (void *__restrict __dest,
+ const void *__restrict __src, size_t __len,
+ size_t __destlen) __THROW;
+extern void *__memmove_chk (void *__dest, const void *__src, size_t __len,
+ size_t __destlen) __THROW;
+extern void *__mempcpy_chk (void *__restrict __dest,
+ const void *__restrict __src, size_t __len,
+ size_t __destlen) __THROW;
+extern void *__memset_chk (void *__dest, int __ch, size_t __len,
+ size_t __destlen) __THROW;
+extern char *__strcpy_chk (char *__restrict __dest,
+ const char *__restrict __src,
+ size_t __destlen) __THROW;
+extern char *__stpcpy_chk (char *__restrict __dest,
+ const char *__restrict __src,
+ size_t __destlen) __THROW;
+extern char *__strncpy_chk (char *__restrict __dest,
+ const char *__restrict __src,
+ size_t __len, size_t __destlen) __THROW;
+extern char *__strcat_chk (char *__restrict __dest,
+ const char *__restrict __src,
+ size_t __destlen) __THROW;
+extern char *__strncat_chk (char *__restrict __dest,
+ const char *__restrict __src,
+ size_t __len, size_t __destlen) __THROW;
+#endif
+
+#endif
diff --git a/REORG.TODO/include/strings.h b/REORG.TODO/include/strings.h
new file mode 100644
index 0000000000..b1bb339d3d
--- /dev/null
+++ b/REORG.TODO/include/strings.h
@@ -0,0 +1 @@
+#include <string/strings.h>
diff --git a/REORG.TODO/include/stropts.h b/REORG.TODO/include/stropts.h
new file mode 100644
index 0000000000..27ab60ac7f
--- /dev/null
+++ b/REORG.TODO/include/stropts.h
@@ -0,0 +1 @@
+#include <streams/stropts.h>
diff --git a/REORG.TODO/include/stubs-prologue.h b/REORG.TODO/include/stubs-prologue.h
new file mode 100644
index 0000000000..0577bc6a5f
--- /dev/null
+++ b/REORG.TODO/include/stubs-prologue.h
@@ -0,0 +1,14 @@
+@ These lines with @ are omitted from the generated output.
+@ This file gives the initial contents of gnu/stubs.h, to which
+@ all the #define __stub_foo lines get appended by the makefile rule.
+@
+/* This file is automatically generated.
+ It defines a symbol `__stub_FUNCTION' for each function
+ in the C library which is a stub, meaning it will fail
+ every time called, usually setting errno to ENOSYS. */
+
+#ifdef _LIBC
+ #error Applications may not define the macro _LIBC
+#endif
+
+@ Placeholder line so we remember to keep the preceding blank line here.
diff --git a/REORG.TODO/include/sys/auxv.h b/REORG.TODO/include/sys/auxv.h
new file mode 100644
index 0000000000..dede2c36ac
--- /dev/null
+++ b/REORG.TODO/include/sys/auxv.h
@@ -0,0 +1 @@
+#include <misc/sys/auxv.h>
diff --git a/REORG.TODO/include/sys/bitypes.h b/REORG.TODO/include/sys/bitypes.h
new file mode 100644
index 0000000000..137945172d
--- /dev/null
+++ b/REORG.TODO/include/sys/bitypes.h
@@ -0,0 +1 @@
+#include <resolv/sys/bitypes.h>
diff --git a/REORG.TODO/include/sys/cdefs.h b/REORG.TODO/include/sys/cdefs.h
new file mode 100644
index 0000000000..524fe57a25
--- /dev/null
+++ b/REORG.TODO/include/sys/cdefs.h
@@ -0,0 +1,18 @@
+#ifndef _SYS_CDEFS_H
+
+#include <misc/sys/cdefs.h>
+
+#ifndef _ISOMAC
+/* The compiler will optimize based on the knowledge the parameter is
+ not NULL. This will omit tests. A robust implementation cannot allow
+ this so when compiling glibc itself we ignore this attribute. */
+# undef __nonnull
+# define __nonnull(params)
+
+extern void __chk_fail (void) __attribute__ ((__noreturn__));
+libc_hidden_proto (__chk_fail)
+rtld_hidden_proto (__chk_fail)
+
+#endif
+
+#endif
diff --git a/REORG.TODO/include/sys/dir.h b/REORG.TODO/include/sys/dir.h
new file mode 100644
index 0000000000..5453e743fc
--- /dev/null
+++ b/REORG.TODO/include/sys/dir.h
@@ -0,0 +1 @@
+#include <misc/sys/dir.h>
diff --git a/REORG.TODO/include/sys/epoll.h b/REORG.TODO/include/sys/epoll.h
new file mode 100644
index 0000000000..86e0a54e62
--- /dev/null
+++ b/REORG.TODO/include/sys/epoll.h
@@ -0,0 +1,9 @@
+#ifndef _SYS_EPOLL_H
+#include_next <sys/epoll.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (epoll_pwait)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sys/errno.h b/REORG.TODO/include/sys/errno.h
new file mode 100644
index 0000000000..1b29efe138
--- /dev/null
+++ b/REORG.TODO/include/sys/errno.h
@@ -0,0 +1 @@
+#include <stdlib/sys/errno.h>
diff --git a/REORG.TODO/include/sys/fcntl.h b/REORG.TODO/include/sys/fcntl.h
new file mode 100644
index 0000000000..dec2157be6
--- /dev/null
+++ b/REORG.TODO/include/sys/fcntl.h
@@ -0,0 +1 @@
+#include <io/sys/fcntl.h>
diff --git a/REORG.TODO/include/sys/file.h b/REORG.TODO/include/sys/file.h
new file mode 100644
index 0000000000..d0cd1f9e15
--- /dev/null
+++ b/REORG.TODO/include/sys/file.h
@@ -0,0 +1,10 @@
+#ifndef _SYS_FILE_H
+#include <misc/sys/file.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern int __flock (int __fd, int __operation);
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sys/gmon.h b/REORG.TODO/include/sys/gmon.h
new file mode 100644
index 0000000000..30889d8bc3
--- /dev/null
+++ b/REORG.TODO/include/sys/gmon.h
@@ -0,0 +1,19 @@
+#ifndef _SYS_GMON_H
+#include <gmon/sys/gmon.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+
+/* Write current profiling data to file. */
+extern void __write_profiling (void);
+extern void write_profiling (void);
+
+struct __bb;
+extern void __bb_init_func (struct __bb *bb);
+extern void __bb_exit_func (void);
+
+extern struct gmonparam _gmonparam attribute_hidden;
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sys/gmon_out.h b/REORG.TODO/include/sys/gmon_out.h
new file mode 100644
index 0000000000..249f834ba3
--- /dev/null
+++ b/REORG.TODO/include/sys/gmon_out.h
@@ -0,0 +1 @@
+#include <gmon/sys/gmon_out.h>
diff --git a/REORG.TODO/include/sys/ioctl.h b/REORG.TODO/include/sys/ioctl.h
new file mode 100644
index 0000000000..bfc6909dbc
--- /dev/null
+++ b/REORG.TODO/include/sys/ioctl.h
@@ -0,0 +1,10 @@
+#ifndef _SYS_IOCTL_H
+#include <misc/sys/ioctl.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern int __ioctl (int __fd, unsigned long int __request, ...);
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sys/ipc.h b/REORG.TODO/include/sys/ipc.h
new file mode 100644
index 0000000000..7bd257684b
--- /dev/null
+++ b/REORG.TODO/include/sys/ipc.h
@@ -0,0 +1 @@
+#include <sysvipc/sys/ipc.h>
diff --git a/REORG.TODO/include/sys/mman.h b/REORG.TODO/include/sys/mman.h
new file mode 100644
index 0000000000..7026f69f42
--- /dev/null
+++ b/REORG.TODO/include/sys/mman.h
@@ -0,0 +1,25 @@
+#ifndef _SYS_MMAN_H
+#include <misc/sys/mman.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern void *__mmap (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off_t __offset);
+extern void *__mmap64 (void *__addr, size_t __len, int __prot,
+ int __flags, int __fd, __off64_t __offset);
+extern int __munmap (void *__addr, size_t __len);
+extern int __mprotect (void *__addr, size_t __len, int __prot);
+
+extern int __madvise (void *__addr, size_t __len, int __advice);
+libc_hidden_proto (__madvise)
+
+/* This one is Linux specific. */
+extern void *__mremap (void *__addr, size_t __old_len,
+ size_t __new_len, int __flags, ...);
+
+# if IS_IN (rtld)
+# include <dl-mman.h>
+# endif
+#endif
+
+#endif
diff --git a/REORG.TODO/include/sys/msg.h b/REORG.TODO/include/sys/msg.h
new file mode 100644
index 0000000000..43ec5b9472
--- /dev/null
+++ b/REORG.TODO/include/sys/msg.h
@@ -0,0 +1,11 @@
+#ifndef _SYS_MSG_H
+#include <sysvipc/sys/msg.h>
+
+#ifndef _ISOMAC
+extern ssize_t __libc_msgrcv (int msqid, void *msgp, size_t msgsz,
+ long int msgtyp, int msgflg);
+extern int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz,
+ int msgflg);
+#endif
+
+#endif
diff --git a/REORG.TODO/include/sys/param.h b/REORG.TODO/include/sys/param.h
new file mode 100644
index 0000000000..7a0cfb1f24
--- /dev/null
+++ b/REORG.TODO/include/sys/param.h
@@ -0,0 +1 @@
+#include <misc/sys/param.h>
diff --git a/REORG.TODO/include/sys/poll.h b/REORG.TODO/include/sys/poll.h
new file mode 100644
index 0000000000..a42bc93873
--- /dev/null
+++ b/REORG.TODO/include/sys/poll.h
@@ -0,0 +1,11 @@
+#ifndef _SYS_POLL_H
+# include <io/sys/poll.h>
+
+#ifndef _ISOMAC
+extern int __poll (struct pollfd *__fds, unsigned long int __nfds,
+ int __timeout);
+libc_hidden_proto (__poll)
+libc_hidden_proto (ppoll)
+#endif
+
+#endif
diff --git a/REORG.TODO/include/sys/prctl.h b/REORG.TODO/include/sys/prctl.h
new file mode 100644
index 0000000000..0920ed642b
--- /dev/null
+++ b/REORG.TODO/include/sys/prctl.h
@@ -0,0 +1,9 @@
+#ifndef _SYS_PRCTL_H
+#include_next <sys/prctl.h>
+
+# ifndef _ISOMAC
+
+extern int __prctl (int __option, ...);
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sys/profil.h b/REORG.TODO/include/sys/profil.h
new file mode 100644
index 0000000000..2b1133073e
--- /dev/null
+++ b/REORG.TODO/include/sys/profil.h
@@ -0,0 +1,12 @@
+#ifndef _PROFIL_H
+#include <gmon/sys/profil.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+
+extern int __sprofil (struct prof *__profp, int __profcnt,
+ struct timeval *__tvp, unsigned int __flags);
+
+# endif /* !_ISOMAC */
+#endif /* _PROFIL_H */
diff --git a/REORG.TODO/include/sys/queue.h b/REORG.TODO/include/sys/queue.h
new file mode 100644
index 0000000000..5c9823b7eb
--- /dev/null
+++ b/REORG.TODO/include/sys/queue.h
@@ -0,0 +1 @@
+#include <misc/sys/queue.h>
diff --git a/REORG.TODO/include/sys/resource.h b/REORG.TODO/include/sys/resource.h
new file mode 100644
index 0000000000..688c46c4ae
--- /dev/null
+++ b/REORG.TODO/include/sys/resource.h
@@ -0,0 +1,27 @@
+#ifndef _SYS_RESOURCE_H
+#include <resource/sys/resource.h>
+
+#ifndef _ISOMAC
+/* Prototypes repeated instead of using __typeof because
+ sys/resource.h is included in C++ tests, and declaring functions
+ with __typeof and __THROW doesn't work for C++. */
+extern int __getpriority (__priority_which_t __which, id_t __who) __THROW;
+libc_hidden_proto (__getpriority)
+extern int __setpriority (__priority_which_t __which, id_t __who, int __prio)
+ __THROW;
+libc_hidden_proto (__setpriority)
+libc_hidden_proto (getrlimit64)
+extern __typeof (getrlimit64) __getrlimit64;
+libc_hidden_proto (__getrlimit64);
+
+/* Now define the internal interfaces. */
+extern int __getrlimit (enum __rlimit_resource __resource,
+ struct rlimit *__rlimits);
+libc_hidden_proto (__getrlimit)
+extern int __getrusage (enum __rusage_who __who, struct rusage *__usage)
+ attribute_hidden;
+
+extern int __setrlimit (enum __rlimit_resource __resource,
+ const struct rlimit *__rlimits);
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/select.h b/REORG.TODO/include/sys/select.h
new file mode 100644
index 0000000000..07bb49b994
--- /dev/null
+++ b/REORG.TODO/include/sys/select.h
@@ -0,0 +1,18 @@
+#ifndef _SYS_SELECT_H
+#include <misc/sys/select.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __pselect (int __nfds, fd_set *__readfds,
+ fd_set *__writefds, fd_set *__exceptfds,
+ const struct timespec *__timeout,
+ const __sigset_t *__sigmask);
+
+extern int __select (int __nfds, fd_set *__restrict __readfds,
+ fd_set *__restrict __writefds,
+ fd_set *__restrict __exceptfds,
+ struct timeval *__restrict __timeout);
+libc_hidden_proto (__select)
+
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/sem.h b/REORG.TODO/include/sys/sem.h
new file mode 100644
index 0000000000..b0fb201bd0
--- /dev/null
+++ b/REORG.TODO/include/sys/sem.h
@@ -0,0 +1 @@
+#include <sysvipc/sys/sem.h>
diff --git a/REORG.TODO/include/sys/sendfile.h b/REORG.TODO/include/sys/sendfile.h
new file mode 100644
index 0000000000..abe09769cc
--- /dev/null
+++ b/REORG.TODO/include/sys/sendfile.h
@@ -0,0 +1 @@
+#include <io/sys/sendfile.h>
diff --git a/REORG.TODO/include/sys/shm.h b/REORG.TODO/include/sys/shm.h
new file mode 100644
index 0000000000..1878fcc5be
--- /dev/null
+++ b/REORG.TODO/include/sys/shm.h
@@ -0,0 +1 @@
+#include <sysvipc/sys/shm.h>
diff --git a/REORG.TODO/include/sys/signal.h b/REORG.TODO/include/sys/signal.h
new file mode 100644
index 0000000000..b2110df1ae
--- /dev/null
+++ b/REORG.TODO/include/sys/signal.h
@@ -0,0 +1 @@
+#include <signal/sys/signal.h>
diff --git a/REORG.TODO/include/sys/socket.h b/REORG.TODO/include/sys/socket.h
new file mode 100644
index 0000000000..a00ab3cf93
--- /dev/null
+++ b/REORG.TODO/include/sys/socket.h
@@ -0,0 +1,158 @@
+#ifndef _SYS_SOCKET_H
+#include <socket/sys/socket.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+
+/* Create a new socket of type TYPE in domain DOMAIN, using
+ protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
+ Returns a file descriptor for the new socket, or -1 for errors. */
+extern int __socket (int __domain, int __type,
+ int __protocol);
+libc_hidden_proto (__socket)
+
+/* Create two new sockets, of type TYPE in domain DOMAIN and using
+ protocol PROTOCOL, which are connected to each other, and put file
+ descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
+ one will be chosen automatically. Returns 0 on success, -1 for errors. */
+extern int __socketpair (int __domain, int __type, int __protocol,
+ int __fds[2]) attribute_hidden;
+
+/* Return a socket of any type. The socket can be used in subsequent
+ ioctl calls to talk to the kernel. */
+extern int __opensock (void) internal_function attribute_hidden;
+
+/* Put the address of the peer connected to socket FD into *ADDR
+ (which is *LEN bytes long), and its actual length into *LEN. */
+extern int __getpeername (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__len) attribute_hidden;
+
+/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */
+extern ssize_t __libc_send (int __fd, const void *__buf, size_t __n,
+ int __flags);
+extern ssize_t __send (int __fd, const void *__buf, size_t __n, int __flags);
+libc_hidden_proto (__send)
+
+/* Read N bytes into BUF from socket FD.
+ Returns the number read or -1 for errors. */
+extern ssize_t __libc_recv (int __fd, void *__buf, size_t __n, int __flags);
+
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+ ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
+extern ssize_t __libc_sendto (int __fd, const void *__buf, size_t __n,
+ int __flags, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __addr_len);
+
+/* Read N bytes into BUF through socket FD.
+ If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
+ the sender, and store the actual size of the address in *ADDR_LEN.
+ Returns the number of bytes read or -1 for errors. */
+extern ssize_t __libc_recvfrom (int __fd, void *__restrict __buf, size_t __n,
+ int __flags, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len);
+
+/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
+ For connectionless socket types, just set the default address to send to
+ and the only address from which to accept transmissions.
+ Return 0 on success, -1 for errors. */
+extern int __libc_connect (int __fd, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __len);
+extern int __connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
+libc_hidden_proto (__connect)
+
+/* Read N bytes into BUF from socket FD.
+ Returns the number read or -1 for errors.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern ssize_t __recv (int __fd, void *__buf, size_t __n, int __flags);
+libc_hidden_proto (__recv)
+
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+ ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
+extern ssize_t __libc_sendto (int __fd, const void *__buf, size_t __n,
+ int __flags, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __addr_len);
+extern ssize_t __sendto (int __fd, const void *__buf, size_t __n,
+ int __flags, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __addr_len) attribute_hidden;
+
+/* Read N bytes into BUF through socket FD.
+ If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
+ the sender, and store the actual size of the address in *ADDR_LEN.
+ Returns the number of bytes read or -1 for errors. */
+extern ssize_t __recvfrom (int __fd, void *__restrict __buf, size_t __n,
+ int __flags, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len) attribute_hidden;
+
+/* Send a message described MESSAGE on socket FD.
+ Returns the number of bytes sent, or -1 for errors. */
+extern ssize_t __libc_sendmsg (int __fd, const struct msghdr *__message,
+ int __flags);
+extern ssize_t __sendmsg (int __fd, const struct msghdr *__message,
+ int __flags) attribute_hidden;
+
+#ifdef __USE_GNU
+extern int __sendmmsg (int __fd, struct mmsghdr *__vmessages,
+ unsigned int __vlen, int __flags);
+libc_hidden_proto (__sendmmsg)
+#endif
+
+/* Receive a message as described by MESSAGE from socket FD.
+ Returns the number of bytes read or -1 for errors. */
+extern ssize_t __libc_recvmsg (int __fd, struct msghdr *__message,
+ int __flags);
+extern ssize_t __recvmsg (int __fd, struct msghdr *__message,
+ int __flags) attribute_hidden;
+
+/* Set socket FD's option OPTNAME at protocol level LEVEL
+ to *OPTVAL (which is OPTLEN bytes long).
+ Returns 0 on success, -1 for errors. */
+extern int __setsockopt (int __fd, int __level, int __optname,
+ const void *__optval,
+ socklen_t __optlen) attribute_hidden;
+
+/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
+ into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
+ actual length. Returns 0 on success, -1 for errors. */
+extern int __getsockopt (int __fd, int __level, int __optname,
+ void *__restrict __optval,
+ socklen_t *__restrict __optlen) attribute_hidden;
+
+/* Put the local address of FD into *ADDR and its length in *LEN. */
+extern int __getsockname (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __len) attribute_hidden;
+
+/* Give the socket FD the local address ADDR (which is LEN bytes long). */
+extern int __bind (int __fd, __CONST_SOCKADDR_ARG __addr,
+ socklen_t __len) attribute_hidden;
+
+/* Prepare to accept connections on socket FD.
+ N connection requests will be queued before further requests are refused.
+ Returns 0 on success, -1 for errors. */
+extern int __listen (int __fd, int __n) attribute_hidden;
+
+/* Await a connection on socket FD.
+ When a connection arrives, open a new socket to communicate with it,
+ set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
+ peer and *ADDR_LEN to the address's actual length, and return the
+ new socket's descriptor, or -1 for errors. */
+extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len)
+ __THROW attribute_hidden;
+libc_hidden_proto (accept)
+extern int __libc_accept4 (int __fd, __SOCKADDR_ARG __addr,
+ socklen_t *__restrict __addr_len, int __flags)
+ __THROW attribute_hidden;
+
+/* Return the length of a `sockaddr' structure. */
+#ifdef _HAVE_SA_LEN
+# define SA_LEN(_x) (_x)->sa_len
+#else
+extern int __libc_sa_len (sa_family_t __af);
+libc_hidden_proto (__libc_sa_len)
+# define SA_LEN(_x) __libc_sa_len((_x)->sa_family)
+#endif
+
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/stat.h b/REORG.TODO/include/sys/stat.h
new file mode 100644
index 0000000000..4f31c00eca
--- /dev/null
+++ b/REORG.TODO/include/sys/stat.h
@@ -0,0 +1,62 @@
+#ifndef _SYS_STAT_H
+#include <io/sys/stat.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __stat (const char *__file, struct stat *__buf);
+extern int __fstat (int __fd, struct stat *__buf);
+extern int __lstat (const char *__file, struct stat *__buf);
+extern int __chmod (const char *__file, __mode_t __mode);
+extern int __fchmod (int __fd, __mode_t __mode);
+extern __mode_t __umask (__mode_t __mask);
+extern int __mkdir (const char *__path, __mode_t __mode);
+extern int __mknod (const char *__path,
+ __mode_t __mode, __dev_t __dev);
+#if IS_IN (libc) || IS_IN (rtld)
+hidden_proto (__fxstat)
+hidden_proto (__fxstat64)
+hidden_proto (__lxstat)
+hidden_proto (__lxstat64)
+hidden_proto (__xstat)
+hidden_proto (__xstat64)
+#endif
+extern __inline__ int __stat (const char *__path, struct stat *__statbuf)
+{
+ return __xstat (_STAT_VER, __path, __statbuf);
+}
+libc_hidden_proto (__xmknod)
+extern __inline__ int __mknod (const char *__path, __mode_t __mode,
+ __dev_t __dev)
+{
+ return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
+}
+libc_hidden_proto (__xmknodat)
+
+libc_hidden_proto (__fxstatat)
+libc_hidden_proto (__fxstatat64)
+
+# if IS_IN (rtld)
+extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden;
+# endif
+
+/* The `stat', `fstat', `lstat' functions have to be handled special since
+ even while not compiling the library with optimization calls to these
+ functions in the shared library must reference the `xstat' etc functions.
+ We have to use macros but we cannot define them in the normal headers
+ since on user level we must use real functions. */
+#define stat(fname, buf) __xstat (_STAT_VER, fname, buf)
+#define lstat(fname, buf) __lxstat (_STAT_VER, fname, buf)
+#define __lstat(fname, buf) __lxstat (_STAT_VER, fname, buf)
+#define lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf)
+#define __lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf)
+#define stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf)
+#define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
+#define __fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
+#define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
+#define __fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
+#define __fstatat(dfd, fname, buf, flag) \
+ __fxstatat (_STAT_VER, dfd, fname, buf, flag)
+#define __fstatat64(dfd, fname, buf, flag) \
+ __fxstatat64 (_STAT_VER, dfd, fname, buf, flag)
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/statfs.h b/REORG.TODO/include/sys/statfs.h
new file mode 100644
index 0000000000..3fac4a3490
--- /dev/null
+++ b/REORG.TODO/include/sys/statfs.h
@@ -0,0 +1,14 @@
+#ifndef _SYS_STATFS_H
+#include <io/sys/statfs.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern int __statfs (const char *__file, struct statfs *__buf);
+libc_hidden_proto (__statfs)
+extern int __fstatfs (int __fildes, struct statfs *__buf);
+extern int __statfs64 (const char *__file, struct statfs64 *__buf);
+extern int __fstatfs64 (int __fildes, struct statfs64 *__buf);
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/sys/statvfs.h b/REORG.TODO/include/sys/statvfs.h
new file mode 100644
index 0000000000..fa3045386d
--- /dev/null
+++ b/REORG.TODO/include/sys/statvfs.h
@@ -0,0 +1,12 @@
+#ifndef _SYS_STATVFS_H
+#include <io/sys/statvfs.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __statvfs64 (const char *__file, struct statvfs64 *__buf);
+extern int __fstatvfs64 (int __fildes, struct statvfs64 *__buf);
+
+libc_hidden_proto (statvfs)
+libc_hidden_proto (fstatvfs)
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/sysctl.h b/REORG.TODO/include/sys/sysctl.h
new file mode 100644
index 0000000000..2a15e91354
--- /dev/null
+++ b/REORG.TODO/include/sys/sysctl.h
@@ -0,0 +1,13 @@
+#ifndef _SYS_SYSCTL_H
+#include_next <sys/sysctl.h>
+
+# ifndef _ISOMAC
+
+/* Read or write system parameters (Linux, FreeBSD specific). */
+extern int __sysctl (int *__name, int __nlen, void *__oldval,
+ size_t *__oldlenp, void *__newval, size_t __newlen);
+libc_hidden_proto (__sysctl)
+
+
+# endif /* !_ISOMAC */
+#endif /* _SYS_SYSCTL_H */
diff --git a/REORG.TODO/include/sys/sysinfo.h b/REORG.TODO/include/sys/sysinfo.h
new file mode 100644
index 0000000000..c33eae2883
--- /dev/null
+++ b/REORG.TODO/include/sys/sysinfo.h
@@ -0,0 +1,24 @@
+#ifndef _SYS_SYSINFO_H
+#include_next <sys/sysinfo.h>
+
+# ifndef _ISOMAC
+
+/* Now we define the internal interface. */
+
+/* Return number of configured processors. */
+extern int __get_nprocs_conf (void);
+
+/* Return number of available processors. */
+extern int __get_nprocs (void);
+
+/* Return number of physical pages of memory in the system. */
+extern long int __get_phys_pages (void);
+
+/* Return number of available physical pages of memory in the system. */
+extern long int __get_avphys_pages (void);
+
+/* Return maximum number of processes this real user ID can have. */
+extern long int __get_child_max (void);
+
+# endif /* !_ISOMAC */
+#endif /* sys/sysinfo.h */
diff --git a/REORG.TODO/include/sys/syslog.h b/REORG.TODO/include/sys/syslog.h
new file mode 100644
index 0000000000..3be3189ed1
--- /dev/null
+++ b/REORG.TODO/include/sys/syslog.h
@@ -0,0 +1,11 @@
+#include <misc/sys/syslog.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (syslog)
+libc_hidden_proto (vsyslog)
+
+extern void __vsyslog_chk (int __pri, int __flag, const char *__fmt,
+ __gnuc_va_list __ap)
+ __attribute__ ((__format__ (__printf__, 3, 0)));
+libc_hidden_proto (__vsyslog_chk)
+#endif
diff --git a/REORG.TODO/include/sys/sysmacros.h b/REORG.TODO/include/sys/sysmacros.h
new file mode 100644
index 0000000000..87813c5b53
--- /dev/null
+++ b/REORG.TODO/include/sys/sysmacros.h
@@ -0,0 +1 @@
+#include <misc/sys/sysmacros.h>
diff --git a/REORG.TODO/include/sys/termios.h b/REORG.TODO/include/sys/termios.h
new file mode 100644
index 0000000000..27e4de5f4b
--- /dev/null
+++ b/REORG.TODO/include/sys/termios.h
@@ -0,0 +1 @@
+#include <termios/sys/termios.h>
diff --git a/REORG.TODO/include/sys/time.h b/REORG.TODO/include/sys/time.h
new file mode 100644
index 0000000000..95c431f7b3
--- /dev/null
+++ b/REORG.TODO/include/sys/time.h
@@ -0,0 +1,43 @@
+/* Time function internal interfaces.
+ Copyright (C) 1997-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_TIME_H
+# include <time/sys/time.h>
+
+# ifndef _ISOMAC
+extern int __gettimeofday (struct timeval *__tv,
+ struct timezone *__tz);
+libc_hidden_proto (__gettimeofday)
+libc_hidden_proto (gettimeofday)
+extern int __settimeofday (const struct timeval *__tv,
+ const struct timezone *__tz)
+ attribute_hidden;
+extern int __adjtime (const struct timeval *__delta,
+ struct timeval *__olddelta);
+extern int __getitimer (enum __itimer_which __which,
+ struct itimerval *__value);
+extern int __setitimer (enum __itimer_which __which,
+ const struct itimerval *__restrict __new,
+ struct itimerval *__restrict __old)
+ attribute_hidden;
+extern int __utimes (const char *__file, const struct timeval __tvp[2])
+ attribute_hidden;
+extern int __futimes (int fd, const struct timeval tvp[2]) attribute_hidden;
+
+# endif
+#endif
diff --git a/REORG.TODO/include/sys/timeb.h b/REORG.TODO/include/sys/timeb.h
new file mode 100644
index 0000000000..9f4509c35e
--- /dev/null
+++ b/REORG.TODO/include/sys/timeb.h
@@ -0,0 +1 @@
+#include <time/sys/timeb.h>
diff --git a/REORG.TODO/include/sys/times.h b/REORG.TODO/include/sys/times.h
new file mode 100644
index 0000000000..026d140fe1
--- /dev/null
+++ b/REORG.TODO/include/sys/times.h
@@ -0,0 +1,8 @@
+#ifndef _SYS_TIMES_H
+#include <posix/sys/times.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern clock_t __times (struct tms *__buffer);
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/types.h b/REORG.TODO/include/sys/types.h
new file mode 100644
index 0000000000..716732f4d4
--- /dev/null
+++ b/REORG.TODO/include/sys/types.h
@@ -0,0 +1 @@
+#include <posix/sys/types.h>
diff --git a/REORG.TODO/include/sys/uio.h b/REORG.TODO/include/sys/uio.h
new file mode 100644
index 0000000000..20860bfd82
--- /dev/null
+++ b/REORG.TODO/include/sys/uio.h
@@ -0,0 +1,17 @@
+#ifndef _SYS_UIO_H
+#include <misc/sys/uio.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern ssize_t __readv (int __fd, const struct iovec *__iovec,
+ int __count);
+extern ssize_t __writev (int __fd, const struct iovec *__iovec,
+ int __count);
+
+/* Used for p{read,write}{v64}v2 implementation. */
+libc_hidden_proto (preadv)
+libc_hidden_proto (preadv64)
+libc_hidden_proto (pwritev)
+libc_hidden_proto (pwritev64)
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/un.h b/REORG.TODO/include/sys/un.h
new file mode 100644
index 0000000000..bdbee99980
--- /dev/null
+++ b/REORG.TODO/include/sys/un.h
@@ -0,0 +1 @@
+#include <socket/sys/un.h>
diff --git a/REORG.TODO/include/sys/unistd.h b/REORG.TODO/include/sys/unistd.h
new file mode 100644
index 0000000000..8ca19e5516
--- /dev/null
+++ b/REORG.TODO/include/sys/unistd.h
@@ -0,0 +1 @@
+#include <posix/sys/unistd.h>
diff --git a/REORG.TODO/include/sys/utsname.h b/REORG.TODO/include/sys/utsname.h
new file mode 100644
index 0000000000..14f4247dd4
--- /dev/null
+++ b/REORG.TODO/include/sys/utsname.h
@@ -0,0 +1,14 @@
+#ifndef _SYS_UTSNAME_H
+#include <posix/sys/utsname.h>
+
+#ifndef _ISOMAC
+extern int __uname (struct utsname *__name);
+
+libc_hidden_proto (uname)
+libc_hidden_proto (__uname)
+
+# if IS_IN (rtld)
+extern __typeof (__uname) __uname attribute_hidden;
+# endif
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/vlimit.h b/REORG.TODO/include/sys/vlimit.h
new file mode 100644
index 0000000000..8a76d2fd00
--- /dev/null
+++ b/REORG.TODO/include/sys/vlimit.h
@@ -0,0 +1 @@
+#include <resource/sys/vlimit.h>
diff --git a/REORG.TODO/include/sys/vtimes.h b/REORG.TODO/include/sys/vtimes.h
new file mode 100644
index 0000000000..dd666ca443
--- /dev/null
+++ b/REORG.TODO/include/sys/vtimes.h
@@ -0,0 +1 @@
+#include <resource/sys/vtimes.h>
diff --git a/REORG.TODO/include/sys/wait.h b/REORG.TODO/include/sys/wait.h
new file mode 100644
index 0000000000..5ac9cd6ca6
--- /dev/null
+++ b/REORG.TODO/include/sys/wait.h
@@ -0,0 +1,19 @@
+#ifndef _SYS_WAIT_H
+#include <posix/sys/wait.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern __pid_t __waitpid (__pid_t __pid, int *__stat_loc,
+ int __options);
+libc_hidden_proto (__waitpid)
+extern int __waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options);
+
+extern __pid_t __libc_wait (int *__stat_loc);
+extern __pid_t __wait (int *__stat_loc);
+extern __pid_t __wait3 (int *__stat_loc,
+ int __options, struct rusage * __usage);
+extern __pid_t __wait4 (__pid_t __pid, int *__stat_loc,
+ int __options, struct rusage *__usage)
+ attribute_hidden;
+#endif
+#endif
diff --git a/REORG.TODO/include/sys/xattr.h b/REORG.TODO/include/sys/xattr.h
new file mode 100644
index 0000000000..64f8f56809
--- /dev/null
+++ b/REORG.TODO/include/sys/xattr.h
@@ -0,0 +1 @@
+#include <misc/sys/xattr.h>
diff --git a/REORG.TODO/include/syscall.h b/REORG.TODO/include/syscall.h
new file mode 100644
index 0000000000..8c53cfb204
--- /dev/null
+++ b/REORG.TODO/include/syscall.h
@@ -0,0 +1 @@
+#include <misc/syscall.h>
diff --git a/REORG.TODO/include/sysexits.h b/REORG.TODO/include/sysexits.h
new file mode 100644
index 0000000000..139e3cfa13
--- /dev/null
+++ b/REORG.TODO/include/sysexits.h
@@ -0,0 +1 @@
+#include <misc/sysexits.h>
diff --git a/REORG.TODO/include/syslog.h b/REORG.TODO/include/syslog.h
new file mode 100644
index 0000000000..4cfb7723bb
--- /dev/null
+++ b/REORG.TODO/include/syslog.h
@@ -0,0 +1 @@
+#include <misc/syslog.h>
diff --git a/REORG.TODO/include/tar.h b/REORG.TODO/include/tar.h
new file mode 100644
index 0000000000..05efa1fc0e
--- /dev/null
+++ b/REORG.TODO/include/tar.h
@@ -0,0 +1 @@
+#include <posix/tar.h>
diff --git a/REORG.TODO/include/termios.h b/REORG.TODO/include/termios.h
new file mode 100644
index 0000000000..fad51f8385
--- /dev/null
+++ b/REORG.TODO/include/termios.h
@@ -0,0 +1,15 @@
+#ifndef _TERMIOS_H
+#include <termios/termios.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern int __tcgetattr (int __fd, struct termios *__termios_p);
+
+extern int __libc_tcdrain (int __fd);
+
+libc_hidden_proto (tcsetattr)
+libc_hidden_proto (cfsetispeed)
+libc_hidden_proto (cfsetospeed)
+
+#endif
+#endif
diff --git a/REORG.TODO/include/tgmath.h b/REORG.TODO/include/tgmath.h
new file mode 100644
index 0000000000..3a2c4a2b2d
--- /dev/null
+++ b/REORG.TODO/include/tgmath.h
@@ -0,0 +1 @@
+#include <math/tgmath.h>
diff --git a/REORG.TODO/include/time.h b/REORG.TODO/include/time.h
new file mode 100644
index 0000000000..3a828e0420
--- /dev/null
+++ b/REORG.TODO/include/time.h
@@ -0,0 +1,106 @@
+#ifndef _TIME_H
+#include <time/time.h>
+
+#ifndef _ISOMAC
+# include <xlocale.h>
+
+extern __typeof (strftime_l) __strftime_l;
+libc_hidden_proto (__strftime_l)
+extern __typeof (strptime_l) __strptime_l;
+
+libc_hidden_proto (time)
+libc_hidden_proto (asctime)
+libc_hidden_proto (mktime)
+libc_hidden_proto (timelocal)
+libc_hidden_proto (localtime)
+libc_hidden_proto (strftime)
+libc_hidden_proto (strptime)
+
+extern __typeof (clock_getres) __clock_getres;
+extern __typeof (clock_gettime) __clock_gettime;
+libc_hidden_proto (__clock_gettime)
+extern __typeof (clock_settime) __clock_settime;
+extern __typeof (clock_nanosleep) __clock_nanosleep;
+extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
+
+/* Now define the internal interfaces. */
+struct tm;
+
+/* Defined in mktime.c. */
+extern const unsigned short int __mon_yday[2][13] attribute_hidden;
+
+/* Defined in localtime.c. */
+extern struct tm _tmbuf attribute_hidden;
+
+/* Defined in tzset.c. */
+extern char *__tzstring (const char *string);
+
+extern int __use_tzfile attribute_hidden;
+
+extern void __tzfile_read (const char *file, size_t extra,
+ char **extrap);
+extern void __tzfile_compute (time_t timer, int use_localtime,
+ long int *leap_correct, int *leap_hit,
+ struct tm *tp);
+extern void __tzfile_default (const char *std, const char *dst,
+ long int stdoff, long int dstoff);
+extern void __tzset_parse_tz (const char *tz);
+extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
+ __THROW internal_function;
+
+/* Subroutine of `mktime'. Return the `time_t' representation of TP and
+ normalize TP, given that a `struct tm *' maps to a `time_t' as performed
+ by FUNC. Keep track of next guess for time_t offset in *OFFSET. */
+extern time_t __mktime_internal (struct tm *__tp,
+ struct tm *(*__func) (const time_t *,
+ struct tm *),
+ time_t *__offset);
+extern struct tm *__localtime_r (const time_t *__timer,
+ struct tm *__tp) attribute_hidden;
+
+extern struct tm *__gmtime_r (const time_t *__restrict __timer,
+ struct tm *__restrict __tp);
+libc_hidden_proto (__gmtime_r)
+
+/* Compute the `struct tm' representation of *T,
+ offset OFFSET seconds east of UTC,
+ and store year, yday, mon, mday, wday, hour, min, sec into *TP.
+ Return nonzero if successful. */
+extern int __offtime (const time_t *__timer,
+ long int __offset,
+ struct tm *__tp);
+
+extern char *__asctime_r (const struct tm *__tp, char *__buf);
+extern void __tzset (void);
+
+/* Prototype for the internal function to get information based on TZ. */
+extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
+
+extern int __nanosleep (const struct timespec *__requested_time,
+ struct timespec *__remaining);
+libc_hidden_proto (__nanosleep)
+extern int __nanosleep_nocancel (const struct timespec *__requested_time,
+ struct timespec *__remaining)
+ attribute_hidden;
+extern int __getdate_r (const char *__string, struct tm *__resbufp);
+
+
+/* Determine CLK_TCK value. */
+extern int __getclktck (void);
+
+
+/* strptime support. */
+extern char * __strptime_internal (const char *rp, const char *fmt,
+ struct tm *tm, void *statep,
+ __locale_t locparam)
+ internal_function;
+
+extern double __difftime (time_t time1, time_t time0);
+
+
+/* Use in the clock_* functions. Size of the field representing the
+ actual clock ID. */
+#define CLOCK_IDFIELD_SIZE 3
+
+#endif
+#endif
diff --git a/REORG.TODO/include/ttyent.h b/REORG.TODO/include/ttyent.h
new file mode 100644
index 0000000000..53a66681d2
--- /dev/null
+++ b/REORG.TODO/include/ttyent.h
@@ -0,0 +1,14 @@
+#ifndef _TTYENT_H
+#include <misc/ttyent.h>
+
+# ifndef _ISOMAC
+
+extern __typeof (getttyent) __getttyent __THROW;
+libc_hidden_proto (__getttyent)
+extern __typeof (setttyent) __setttyent __THROW;
+libc_hidden_proto (__setttyent)
+extern __typeof (endttyent) __endttyent __THROW;
+libc_hidden_proto (__endttyent)
+
+# endif /* !_ISOMAC */
+#endif /* ttyent.h */
diff --git a/REORG.TODO/include/uchar.h b/REORG.TODO/include/uchar.h
new file mode 100644
index 0000000000..f456684706
--- /dev/null
+++ b/REORG.TODO/include/uchar.h
@@ -0,0 +1 @@
+#include <wcsmbs/uchar.h>
diff --git a/REORG.TODO/include/ucontext.h b/REORG.TODO/include/ucontext.h
new file mode 100644
index 0000000000..1b24661c94
--- /dev/null
+++ b/REORG.TODO/include/ucontext.h
@@ -0,0 +1 @@
+#include <stdlib/ucontext.h>
diff --git a/REORG.TODO/include/ulimit.h b/REORG.TODO/include/ulimit.h
new file mode 100644
index 0000000000..dd83faa049
--- /dev/null
+++ b/REORG.TODO/include/ulimit.h
@@ -0,0 +1,8 @@
+#ifndef _ULIMIT_H
+#include <resource/ulimit.h>
+
+#ifndef _ISOMAC
+/* Now define the internal interfaces. */
+extern long int __ulimit (int __cmd, ...);
+#endif
+#endif
diff --git a/REORG.TODO/include/unistd.h b/REORG.TODO/include/unistd.h
new file mode 100644
index 0000000000..5b2a4147dc
--- /dev/null
+++ b/REORG.TODO/include/unistd.h
@@ -0,0 +1,193 @@
+#ifndef _UNISTD_H
+# include <posix/unistd.h>
+
+# ifndef _ISOMAC
+
+libc_hidden_proto (_exit, __noreturn__)
+rtld_hidden_proto (_exit, __noreturn__)
+libc_hidden_proto (alarm)
+libc_hidden_proto (confstr)
+libc_hidden_proto (execl)
+libc_hidden_proto (execle)
+libc_hidden_proto (execlp)
+libc_hidden_proto (execvp)
+libc_hidden_proto (getpid)
+libc_hidden_proto (getsid)
+libc_hidden_proto (getdomainname)
+extern __typeof (getlogin_r) __getlogin_r __nonnull ((1));
+libc_hidden_proto (__getlogin_r)
+libc_hidden_proto (getlogin_r)
+libc_hidden_proto (seteuid)
+libc_hidden_proto (setegid)
+libc_hidden_proto (tcgetpgrp)
+libc_hidden_proto (readlinkat)
+
+/* Now define the internal interfaces. */
+extern int __access (const char *__name, int __type);
+extern int __euidaccess (const char *__name, int __type);
+extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence);
+extern __off_t __lseek (int __fd, __off_t __offset, int __whence);
+libc_hidden_proto (__lseek)
+extern __off_t __libc_lseek (int __fd, __off_t __offset, int __whence);
+extern __off64_t __libc_lseek64 (int __fd, __off64_t __offset, int __whence);
+extern ssize_t __pread (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset);
+libc_hidden_proto (__pread);
+extern ssize_t __libc_pread (int __fd, void *__buf, size_t __nbytes,
+ __off_t __offset);
+extern ssize_t __pread64 (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset);
+libc_hidden_proto (__pread64);
+extern ssize_t __libc_pread64 (int __fd, void *__buf, size_t __nbytes,
+ __off64_t __offset);
+extern ssize_t __pwrite (int __fd, const void *__buf, size_t __n,
+ __off_t __offset);
+libc_hidden_proto (__pwrite)
+extern ssize_t __libc_pwrite (int __fd, const void *__buf, size_t __n,
+ __off_t __offset);
+extern ssize_t __pwrite64 (int __fd, const void *__buf, size_t __n,
+ __off64_t __offset);
+libc_hidden_proto (__pwrite64)
+extern ssize_t __libc_pwrite64 (int __fd, const void *__buf, size_t __n,
+ __off64_t __offset) attribute_hidden;
+extern ssize_t __libc_read (int __fd, void *__buf, size_t __n);
+libc_hidden_proto (__libc_read)
+libc_hidden_proto (read)
+extern ssize_t __libc_write (int __fd, const void *__buf, size_t __n);
+libc_hidden_proto (__libc_write)
+libc_hidden_proto (write)
+extern int __pipe (int __pipedes[2]);
+libc_hidden_proto (__pipe)
+extern int __pipe2 (int __pipedes[2], int __flags);
+extern unsigned int __sleep (unsigned int __seconds);
+extern int __chown (const char *__file,
+ __uid_t __owner, __gid_t __group);
+libc_hidden_proto (__chown)
+extern int __fchown (int __fd,
+ __uid_t __owner, __gid_t __group);
+extern int __lchown (const char *__file, __uid_t __owner,
+ __gid_t __group);
+extern int __chdir (const char *__path);
+extern int __fchdir (int __fd);
+extern char *__getcwd (char *__buf, size_t __size);
+extern int __rmdir (const char *__path);
+extern int __execvpe (const char *file, char *const argv[],
+ char *const envp[]);
+
+/* Get the canonical absolute name of the named directory, and put it in SIZE
+ bytes of BUF. Returns NULL if the directory couldn't be determined or
+ SIZE was too small. If successful, returns BUF. In GNU, if BUF is
+ NULL, an array is allocated with `malloc'; the array is SIZE bytes long,
+ unless SIZE <= 0, in which case it is as big as necessary. */
+
+char *__canonicalize_directory_name_internal (const char *__thisdir,
+ char *__buf,
+ size_t __size) attribute_hidden;
+
+extern int __dup (int __fd);
+libc_hidden_proto (__dup)
+extern int __dup2 (int __fd, int __fd2);
+libc_hidden_proto (__dup2)
+extern int __dup3 (int __fd, int __fd2, int flags);
+libc_hidden_proto (__dup3)
+extern int __execve (const char *__path, char *const __argv[],
+ char *const __envp[]);
+extern long int __pathconf (const char *__path, int __name);
+extern long int __fpathconf (int __fd, int __name);
+extern long int __sysconf (int __name);
+libc_hidden_proto (__sysconf)
+extern __pid_t __getpid (void);
+libc_hidden_proto (__getpid)
+extern __pid_t __getppid (void);
+extern __pid_t __setsid (void);
+extern __uid_t __getuid (void);
+extern __uid_t __geteuid (void);
+extern __gid_t __getgid (void);
+extern __gid_t __getegid (void);
+extern int __getgroups (int __size, __gid_t __list[]);
+libc_hidden_proto (__getpgid)
+extern int __group_member (__gid_t __gid);
+extern int __setuid (__uid_t __uid);
+extern int __setreuid (__uid_t __ruid, __uid_t __euid);
+extern int __setgid (__gid_t __gid);
+extern int __setpgid (__pid_t __pid, __pid_t __pgid);
+libc_hidden_proto (__setpgid)
+extern int __setregid (__gid_t __rgid, __gid_t __egid);
+extern int __getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid);
+extern int __getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid);
+extern int __setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid);
+extern int __setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid);
+libc_hidden_proto (__getresuid)
+libc_hidden_proto (__getresgid)
+libc_hidden_proto (__setresuid)
+libc_hidden_proto (__setresgid)
+extern __pid_t __vfork (void);
+libc_hidden_proto (__vfork)
+extern int __ttyname_r (int __fd, char *__buf, size_t __buflen);
+extern int __isatty (int __fd);
+extern int __link (const char *__from, const char *__to);
+extern int __symlink (const char *__from, const char *__to);
+extern ssize_t __readlink (const char *__path, char *__buf, size_t __len);
+extern int __unlink (const char *__name);
+extern int __gethostname (char *__name, size_t __len);
+extern int __profil (unsigned short int *__sample_buffer, size_t __size,
+ size_t __offset, unsigned int __scale);
+extern int __getdtablesize (void);
+extern int __brk (void *__addr);
+extern int __close (int __fd);
+libc_hidden_proto (__close)
+extern int __libc_close (int __fd);
+extern ssize_t __read (int __fd, void *__buf, size_t __nbytes);
+libc_hidden_proto (__read)
+extern ssize_t __write (int __fd, const void *__buf, size_t __n);
+libc_hidden_proto (__write)
+extern __pid_t __fork (void);
+libc_hidden_proto (__fork)
+extern int __getpagesize (void) __attribute__ ((__const__));
+libc_hidden_proto (__getpagesize)
+extern int __ftruncate (int __fd, __off_t __length);
+extern int __ftruncate64 (int __fd, __off64_t __length);
+extern int __truncate (const char *path, __off_t __length);
+extern void *__sbrk (intptr_t __delta);
+libc_hidden_proto (__sbrk)
+
+
+/* This variable is set nonzero at startup if the process's effective
+ IDs differ from its real IDs, or it is otherwise indicated that
+ extra security should be used. When this is set the dynamic linker
+ and some functions contained in the C library ignore various
+ environment variables that normally affect them. */
+extern int __libc_enable_secure attribute_relro;
+extern int __libc_enable_secure_decided;
+rtld_hidden_proto (__libc_enable_secure)
+
+
+/* Various internal function. */
+extern void __libc_check_standard_fds (void) attribute_hidden;
+
+
+/* Internal name for fork function. */
+extern __pid_t __libc_fork (void);
+
+/* Suspend the process until a signal arrives.
+ This always returns -1 and sets `errno' to EINTR. */
+extern int __libc_pause (void);
+/* Not cancelable variant. */
+extern int __pause_nocancel (void) attribute_hidden;
+
+extern int __getlogin_r_loginuid (char *name, size_t namesize)
+ attribute_hidden;
+
+# if IS_IN (rtld)
+# include <dl-unistd.h>
+# endif
+
+# if IS_IN (rtld) || !defined SHARED
+/* __access variant that does not set errno. Used in very early initialization
+ code in libc.a and ld.so. It follows access return semantics (zero for
+ sucess otherwise a value different than 0). */
+extern __typeof (__access) __access_noerrno attribute_hidden;
+# endif
+
+# endif
+#endif
diff --git a/REORG.TODO/include/utime.h b/REORG.TODO/include/utime.h
new file mode 100644
index 0000000000..5049251311
--- /dev/null
+++ b/REORG.TODO/include/utime.h
@@ -0,0 +1,9 @@
+#ifndef _UTIME_H
+
+#include <io/utime.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (utime)
+#endif
+
+#endif /* utime.h */
diff --git a/REORG.TODO/include/utmp.h b/REORG.TODO/include/utmp.h
new file mode 100644
index 0000000000..6b2e262362
--- /dev/null
+++ b/REORG.TODO/include/utmp.h
@@ -0,0 +1,24 @@
+#ifndef _UTMP_H
+#include <login/utmp.h>
+
+# ifndef _ISOMAC
+
+/* Now define the internal interfaces. */
+extern void __updwtmp (const char *__wtmp_file, const struct utmp *__utmp);
+extern int __utmpname (const char *__file);
+extern struct utmp *__getutent (void);
+extern void __setutent (void);
+extern void __endutent (void);
+extern struct utmp *__getutid (const struct utmp *__id);
+extern struct utmp *__getutline (const struct utmp *__line);
+extern struct utmp *__pututline (const struct utmp *__utmp_ptr);
+extern int __getutent_r (struct utmp *__buffer, struct utmp **__result);
+extern int __getutid_r (const struct utmp *__id, struct utmp *__buffer,
+ struct utmp **__result);
+extern int __getutline_r (const struct utmp *__line,
+ struct utmp *__buffer, struct utmp **__result);
+
+libutil_hidden_proto (login_tty)
+
+# endif /* !_ISOMAC */
+#endif
diff --git a/REORG.TODO/include/values.h b/REORG.TODO/include/values.h
new file mode 100644
index 0000000000..44cb5a0e62
--- /dev/null
+++ b/REORG.TODO/include/values.h
@@ -0,0 +1,68 @@
+/* Old compatibility names for <limits.h> and <float.h> constants.
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This interface is obsolete. New programs should use
+ <limits.h> and/or <float.h> instead of <values.h>. */
+
+#ifndef _VALUES_H
+#define _VALUES_H 1
+
+#include <features.h>
+
+#include <limits.h>
+
+#define _TYPEBITS(type) (sizeof (type) * CHAR_BIT)
+
+#define CHARBITS _TYPEBITS (char)
+#define SHORTBITS _TYPEBITS (short int)
+#define INTBITS _TYPEBITS (int)
+#define LONGBITS _TYPEBITS (long int)
+#define PTRBITS _TYPEBITS (char *)
+#define DOUBLEBITS _TYPEBITS (double)
+#define FLOATBITS _TYPEBITS (float)
+
+#define MINSHORT SHRT_MIN
+#define MININT INT_MIN
+#define MINLONG LONG_MIN
+
+#define MAXSHORT SHRT_MAX
+#define MAXINT INT_MAX
+#define MAXLONG LONG_MAX
+
+#define HIBITS MINSHORT
+#define HIBITL MINLONG
+
+
+#include <float.h>
+
+#define MAXDOUBLE DBL_MAX
+#define MAXFLOAT FLT_MAX
+#define MINDOUBLE DBL_MIN
+#define MINFLOAT FLT_MIN
+#define DMINEXP DBL_MIN_EXP
+#define FMINEXP FLT_MIN_EXP
+#define DMAXEXP DBL_MAX_EXP
+#define FMAXEXP FLT_MAX_EXP
+
+
+#ifdef __USE_MISC
+/* Some systems define this name instead of CHAR_BIT or CHARBITS. */
+# define BITSPERBYTE CHAR_BIT
+#endif
+
+#endif /* values.h */
diff --git a/REORG.TODO/include/wchar.h b/REORG.TODO/include/wchar.h
new file mode 100644
index 0000000000..cf76709901
--- /dev/null
+++ b/REORG.TODO/include/wchar.h
@@ -0,0 +1,220 @@
+#ifndef _WCHAR_H
+# include <wcsmbs/wchar.h>
+# ifndef _ISOMAC
+
+extern __typeof (wcscasecmp_l) __wcscasecmp_l;
+extern __typeof (wcsncasecmp_l) __wcsncasecmp_l;
+extern __typeof (wcscoll_l) __wcscoll_l;
+extern __typeof (wcsxfrm_l) __wcsxfrm_l;
+extern __typeof (wcstol_l) __wcstol_l;
+extern __typeof (wcstoul_l) __wcstoul_l;
+extern __typeof (wcstoll_l) __wcstoll_l;
+extern __typeof (wcstoull_l) __wcstoull_l;
+extern __typeof (wcstod_l) __wcstod_l;
+extern __typeof (wcstof_l) __wcstof_l;
+extern __typeof (wcstold_l) __wcstold_l;
+extern __typeof (wcsftime_l) __wcsftime_l;
+libc_hidden_proto (__wcstol_l)
+libc_hidden_proto (__wcstoul_l)
+libc_hidden_proto (__wcstoll_l)
+libc_hidden_proto (__wcstoull_l)
+libc_hidden_proto (__wcstod_l)
+libc_hidden_proto (__wcstof_l)
+libc_hidden_proto (__wcstold_l)
+libc_hidden_proto (__wcsftime_l)
+
+
+extern double __wcstod_internal (const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __group)
+ __THROW;
+extern float __wcstof_internal (const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr, int __group)
+ __THROW;
+extern long double __wcstold_internal (const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __group) __THROW;
+extern long int __wcstol_internal (const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, int __group) __THROW;
+extern unsigned long int __wcstoul_internal (const wchar_t *__restrict __npt,
+ wchar_t **__restrict __endptr,
+ int __base, int __group) __THROW;
+__extension__
+extern long long int __wcstoll_internal (const wchar_t *__restrict __nptr,
+ wchar_t **__restrict __endptr,
+ int __base, int __group) __THROW;
+__extension__
+extern unsigned long long int __wcstoull_internal (const wchar_t *
+ __restrict __nptr,
+ wchar_t **
+ __restrict __endptr,
+ int __base,
+ int __group) __THROW;
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+ wchar_t **, int, int,
+ __locale_t);
+libc_hidden_proto (__wcstof_internal)
+libc_hidden_proto (__wcstod_internal)
+libc_hidden_proto (__wcstold_internal)
+libc_hidden_proto (__wcstol_internal)
+libc_hidden_proto (__wcstoll_internal)
+libc_hidden_proto (__wcstoul_internal)
+libc_hidden_proto (__wcstoull_internal)
+libc_hidden_proto (wcstof)
+libc_hidden_proto (wcstod)
+libc_hidden_proto (wcstold)
+libc_hidden_proto (wcstol)
+libc_hidden_proto (wcstoll)
+libc_hidden_proto (wcstoul)
+libc_hidden_proto (wcstoull)
+
+libc_hidden_proto (__wcscasecmp_l)
+libc_hidden_proto (__wcsncasecmp_l)
+
+libc_hidden_proto (__wcscoll_l)
+libc_hidden_proto (__wcsxfrm_l)
+
+libc_hidden_proto (fputws_unlocked)
+libc_hidden_proto (putwc_unlocked)
+libc_hidden_proto (putwc)
+
+libc_hidden_proto (vswscanf)
+
+libc_hidden_proto (mbrtowc)
+libc_hidden_proto (wcrtomb)
+extern int __wcscmp (const wchar_t *__s1, const wchar_t *__s2)
+ __THROW __attribute_pure__;
+libc_hidden_proto (__wcscmp)
+libc_hidden_proto (wcsftime)
+libc_hidden_proto (wcsspn)
+libc_hidden_proto (wcschr)
+/* The C++ overloading of wcschr means we have to repeat the type to
+ declare __wcschr instead of using typeof, to avoid errors in C++
+ tests; in addition, __THROW cannot be used with a function type
+ from typeof in C++. The same applies to __wmemchr and, as regards
+ __THROW, to __wcscmp and __wcscoll. */
+extern wchar_t *__wcschr (const wchar_t *__wcs, wchar_t __wc)
+ __THROW __attribute_pure__;
+libc_hidden_proto (__wcschr)
+extern int __wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW;
+libc_hidden_proto (__wcscoll)
+libc_hidden_proto (wcspbrk)
+
+extern __typeof (wmemset) __wmemset;
+extern wchar_t *__wmemchr (const wchar_t *__s, wchar_t __c, size_t __n)
+ __THROW __attribute_pure__;
+libc_hidden_proto (wmemchr)
+libc_hidden_proto (__wmemchr)
+libc_hidden_proto (wmemset)
+libc_hidden_proto (__wmemset)
+
+/* Now define the internal interfaces. */
+extern int __wcscasecmp (const wchar_t *__s1, const wchar_t *__s2)
+ __attribute_pure__;
+extern int __wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
+ size_t __n)
+ __attribute_pure__;
+extern size_t __wcslen (const wchar_t *__s) __attribute_pure__;
+extern size_t __wcsnlen (const wchar_t *__s, size_t __maxlen)
+ __attribute_pure__;
+extern wchar_t *__wcscat (wchar_t *dest, const wchar_t *src);
+extern wint_t __btowc (int __c);
+extern int __mbsinit (const __mbstate_t *__ps);
+extern size_t __mbrtowc (wchar_t *__restrict __pwc,
+ const char *__restrict __s, size_t __n,
+ __mbstate_t *__restrict __p);
+libc_hidden_proto (__mbrtowc)
+libc_hidden_proto (__mbrlen)
+extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
+ __mbstate_t *__restrict __ps);
+extern size_t __mbsrtowcs (wchar_t *__restrict __dst,
+ const char **__restrict __src,
+ size_t __len, __mbstate_t *__restrict __ps);
+extern size_t __wcsrtombs (char *__restrict __dst,
+ const wchar_t **__restrict __src,
+ size_t __len, __mbstate_t *__restrict __ps);
+extern size_t __mbsnrtowcs (wchar_t *__restrict __dst,
+ const char **__restrict __src, size_t __nmc,
+ size_t __len, __mbstate_t *__restrict __ps);
+extern size_t __wcsnrtombs (char *__restrict __dst,
+ const wchar_t **__restrict __src,
+ size_t __nwc, size_t __len,
+ __mbstate_t *__restrict __ps);
+extern wchar_t *__wcsncpy (wchar_t *__restrict __dest,
+ const wchar_t *__restrict __src, size_t __n);
+extern wchar_t *__wcpcpy (wchar_t *__dest, const wchar_t *__src);
+extern wchar_t *__wcpncpy (wchar_t *__dest, const wchar_t *__src,
+ size_t __n);
+extern wchar_t *__wmemcpy (wchar_t *__s1, const wchar_t *s2,
+ size_t __n);
+extern wchar_t *__wmempcpy (wchar_t *__restrict __s1,
+ const wchar_t *__restrict __s2,
+ size_t __n);
+extern wchar_t *__wmemmove (wchar_t *__s1, const wchar_t *__s2,
+ size_t __n);
+extern wchar_t *__wcschrnul (const wchar_t *__s, wchar_t __wc)
+ __attribute_pure__;
+
+extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+ size_t __ns) __THROW;
+
+extern int __vfwscanf (__FILE *__restrict __s,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 0)) */;
+extern int __vswprintf (wchar_t *__restrict __s, size_t __n,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
+extern int __fwprintf (__FILE *__restrict __s,
+ const wchar_t *__restrict __format, ...)
+ /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
+extern int __vfwprintf (__FILE *__restrict __s,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
+extern int __vfwprintf_chk (FILE *__restrict __s, int __flag,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
+extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+ int __flag, size_t __s_len,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg)
+ /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+libc_hidden_proto (__vfwprintf_chk)
+libc_hidden_proto (__vswprintf_chk)
+
+extern int __isoc99_fwscanf (__FILE *__restrict __stream,
+ const wchar_t *__restrict __format, ...);
+extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...);
+extern int __isoc99_swscanf (const wchar_t *__restrict __s,
+ const wchar_t *__restrict __format, ...)
+ __THROW;
+extern int __isoc99_vfwscanf (__FILE *__restrict __s,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg);
+extern int __isoc99_vwscanf (const wchar_t *__restrict __format,
+ __gnuc_va_list __arg);
+extern int __isoc99_vswscanf (const wchar_t *__restrict __s,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg) __THROW;
+extern int __vswscanf (const wchar_t *__restrict __s,
+ const wchar_t *__restrict __format,
+ __gnuc_va_list __arg) __THROW;
+libc_hidden_proto (__isoc99_vswscanf)
+libc_hidden_proto (__vswscanf)
+libc_hidden_proto (__isoc99_vfwscanf)
+
+/* Internal functions. */
+extern size_t __mbsrtowcs_l (wchar_t *dst, const char **src, size_t len,
+ mbstate_t *ps, __locale_t l) attribute_hidden;
+
+/* Special version. We know that all uses of mbsinit inside the libc
+ have a non-NULL parameter. And certainly we can access the
+ internals of the data structure directly. */
+# define mbsinit(state) ((state)->__count == 0)
+# define __mbsinit(state) ((state)->__count == 0)
+
+# endif
+#endif
diff --git a/REORG.TODO/include/wctype.h b/REORG.TODO/include/wctype.h
new file mode 100644
index 0000000000..5fd3f863ae
--- /dev/null
+++ b/REORG.TODO/include/wctype.h
@@ -0,0 +1,74 @@
+#ifndef _WCTYPE_H
+#include <wctype/wctype.h>
+
+#ifndef _ISOMAC
+
+libc_hidden_proto (iswalpha)
+libc_hidden_proto (iswalnum)
+libc_hidden_proto (iswdigit)
+libc_hidden_proto (iswlower)
+libc_hidden_proto (iswspace)
+libc_hidden_proto (iswxdigit)
+libc_hidden_proto (towlower)
+libc_hidden_proto (towupper)
+
+/* Internal interfaces. */
+extern int __iswspace (wint_t __wc);
+extern int __iswctype (wint_t __wc, wctype_t __desc);
+extern wctype_t __wctype (const char *__property);
+extern wctrans_t __wctrans (const char *__property);
+extern wint_t __towctrans (wint_t __wc, wctrans_t __desc);
+
+extern __typeof (iswalnum) __iswalnum __THROW __attribute_pure__;
+extern __typeof (iswalnum_l) __iswalnum_l;
+extern __typeof (iswalpha_l) __iswalpha_l;
+extern __typeof (iswblank_l) __iswblank_l;
+extern __typeof (iswcntrl_l) __iswcntrl_l;
+extern __typeof (iswdigit_l) __iswdigit_l;
+extern __typeof (iswlower) __iswlower __THROW __attribute_pure__;
+extern __typeof (iswlower_l) __iswlower_l;
+extern __typeof (iswgraph_l) __iswgraph_l;
+extern __typeof (iswprint_l) __iswprint_l;
+extern __typeof (iswpunct_l) __iswpunct_l;
+extern __typeof (iswspace_l) __iswspace_l;
+extern __typeof (iswupper_l) __iswupper_l;
+extern __typeof (iswxdigit_l) __iswxdigit_l;
+extern __typeof (towlower_l) __towlower_l;
+extern __typeof (towupper_l) __towupper_l;
+extern __typeof (towlower) __towlower __THROW __attribute_pure__;
+extern __typeof (towupper) __towupper __THROW __attribute_pure__;
+
+libc_hidden_proto (__towctrans)
+libc_hidden_proto (__iswctype)
+libc_hidden_proto (__iswalnum)
+libc_hidden_proto (__iswalnum_l)
+libc_hidden_proto (__iswalpha_l)
+libc_hidden_proto (__iswblank_l)
+libc_hidden_proto (__iswcntrl_l)
+libc_hidden_proto (__iswdigit_l)
+libc_hidden_proto (__iswlower)
+libc_hidden_proto (__iswlower_l)
+libc_hidden_proto (__iswgraph_l)
+libc_hidden_proto (__iswprint_l)
+libc_hidden_proto (__iswpunct_l)
+libc_hidden_proto (__iswspace_l)
+libc_hidden_proto (__iswupper_l)
+libc_hidden_proto (__iswxdigit_l)
+libc_hidden_proto (__towlower_l)
+libc_hidden_proto (__towupper_l)
+libc_hidden_proto (__towlower)
+libc_hidden_proto (__towupper)
+
+/* The spec says that isdigit must only match the decimal digits. We
+ can check this without a memory access. */
+# if IS_IN (libc)
+# undef iswdigit
+# define iswdigit(c) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
+# undef iswdigit_l
+# define iswdigit_l(c, l) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
+# undef __iswdigit_l
+# define __iswdigit_l(c, l) ({ wint_t __c = (c); __c >= L'0' && __c <= L'9'; })
+# endif
+
+#endif
+#endif
diff --git a/REORG.TODO/include/wordexp.h b/REORG.TODO/include/wordexp.h
new file mode 100644
index 0000000000..33c90c15c0
--- /dev/null
+++ b/REORG.TODO/include/wordexp.h
@@ -0,0 +1,9 @@
+#ifndef _WORDEXP_H
+
+#include <posix/wordexp.h>
+
+#ifndef _ISOMAC
+libc_hidden_proto (wordfree)
+#endif
+
+#endif
diff --git a/REORG.TODO/include/xlocale.h b/REORG.TODO/include/xlocale.h
new file mode 100644
index 0000000000..5280ef0bc4
--- /dev/null
+++ b/REORG.TODO/include/xlocale.h
@@ -0,0 +1 @@
+#include <locale/xlocale.h>