about summary refs log tree commit diff
path: root/REORG.TODO/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/include/sys')
-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
46 files changed, 596 insertions, 0 deletions
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>