summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/ipc.h113
-rw-r--r--sys/mman.h107
-rw-r--r--sys/msg.h133
-rw-r--r--sys/resource.h112
-rw-r--r--sys/sem.h150
-rw-r--r--sys/shm.h131
-rw-r--r--sys/stat.h243
-rw-r--r--sys/statvfs.h89
-rw-r--r--sys/time.h105
-rw-r--r--sys/timeb.h59
-rw-r--r--sys/times.h75
-rw-r--r--sys/types.h179
-rw-r--r--sys/uio.h50
-rw-r--r--sys/utsname.h67
-rw-r--r--sys/wait.h158
15 files changed, 1771 insertions, 0 deletions
diff --git a/sys/ipc.h b/sys/ipc.h
new file mode 100644
index 0000000..e03bfce
--- /dev/null
+++ b/sys/ipc.h
@@ -0,0 +1,113 @@
+#ifndef __SYS_IPC_H__
+#define __SYS_IPC_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/ipc/IPC_CREAT.c */
+#define IPC_CREAT 1
+/* ./src/sys/ipc/IPC_EXCL.c */
+#define IPC_EXCL 2
+/* ./src/sys/ipc/IPC_NOWAIT.c */
+#define IPC_NOWAIT 3
+/* ./src/sys/ipc/IPC_PRIVATE.c */
+#define IPC_PRIVATE 4
+/* ./src/sys/ipc/IPC_RMID.c */
+#define IPC_RMID 5
+/* ./src/sys/ipc/IPC_SET.c */
+#define IPC_SET 6
+/* ./src/sys/ipc/IPC_STAT.c */
+#define IPC_STAT 7
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* src/sys/types/gid_t.c */
+#ifndef __TYPE_gid_t_DEFINED__
+#define __TYPE_gid_t_DEFINED__
+typedef unsigned long int
+ gid_t;
+#endif
+
+/* src/sys/types/key_t.c */
+#ifndef __TYPE_key_t_DEFINED__
+#define __TYPE_key_t_DEFINED__
+typedef unsigned long long int key_t;
+#endif
+
+/* src/sys/types/mode_t.c */
+#ifndef __TYPE_mode_t_DEFINED__
+#define __TYPE_mode_t_DEFINED__
+typedef unsigned long int mode_t;
+#endif
+
+/* src/sys/types/uid_t.c */
+#ifndef __TYPE_uid_t_DEFINED__
+#define __TYPE_uid_t_DEFINED__
+typedef unsigned long int
+ uid_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/ipc/struct_ipc_perm.c */
+#ifndef __TYPE_struct_ipc_perm_DEFINED__
+#define __TYPE_struct_ipc_perm_DEFINED__
+struct ipc_perm {
+ uid_t uid; /* Owner's user ID */
+ gid_t gid; /* Owner's group ID */
+ uid_t cuid; /* Creator's user ID */
+ uid_t cgid; /* Creator's group ID */
+ mode_t mode; /* Read/write permission */
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/ipc/ftok.c */
+key_t ftok(const char *__path, int __id);
+#endif
+
+
+#endif
diff --git a/sys/mman.h b/sys/mman.h
new file mode 100644
index 0000000..faad2c5
--- /dev/null
+++ b/sys/mman.h
@@ -0,0 +1,107 @@
+#ifndef __SYS_MMAN_H__
+#define __SYS_MMAN_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE)
+/* ./src/sys/mman/MAP_FAILED.c */
+#define MAP_FAILED ((void*)-1)
+/* ./src/sys/mman/MCL_CURRENT.c */
+#define MCL_CURRENT /* TODO */
+/* ./src/sys/mman/MCL_FUTURE.c */
+#define MCL_FUTURE /* TODO */
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/mman/MAP_FIXED.c */
+#define MAP_FIXED /* TODO */
+/* ./src/sys/mman/MAP_PRIVATE.c */
+#define MAP_PRIVATE /* TODO */
+/* ./src/sys/mman/MAP_SHARED.c */
+#define MAP_SHARED /* TODO */
+/* ./src/sys/mman/MS_ASYNC.c */
+#define MS_ASYNC /* TODO */
+/* ./src/sys/mman/MS_INVALIDATE.c */
+#define MS_INVALIDATE /* TODO */
+/* ./src/sys/mman/MS_SYNC.c */
+#define MS_SYNC /* TODO */
+/* ./src/sys/mman/PROT_EXEC.c */
+#define PROT_EXEC /* TODO */
+/* ./src/sys/mman/PROT_NONE.c */
+#define PROT_NONE /* TODO */
+/* ./src/sys/mman/PROT_READ.c */
+#define PROT_READ /* TODO */
+/* ./src/sys/mman/PROT_WRITE.c */
+#define PROT_WRITE /* TODO */
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE)
+/* ./src/sys/mman/mlock.c */
+int mlock(const void *__addr, size_t __len);
+/* ./src/sys/mman/mlockall.c */
+int mlockall(int __flags);
+/* ./src/sys/mman/munlock.c */
+int munlock(const void *__addr, size_t __len);
+/* ./src/sys/mman/munlockall.c */
+int munlockall(void);
+/* ./src/sys/mman/shm_open.c */
+int shm_open(const char *__name, int __oflag, mode_t __mode);
+/* ./src/sys/mman/shm_unlink.c */
+int shm_unlink(const char *__name);
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/mman/mmap.c */
+void *mmap(void *__addr, size_t __len, int __prot, int __flags, int __fildes, off_t __off);
+/* ./src/sys/mman/mprotect.c */
+int mprotect(void *__addr, size_t __len, int __prot);;
+/* ./src/sys/mman/msync.c */
+int msync(void * addr , size_t len , int flags );
+/* ./src/sys/mman/munmap.c */
+int munmap(void*__addr, size_t __len);
+#endif
+
+
+#endif
diff --git a/sys/msg.h b/sys/msg.h
new file mode 100644
index 0000000..79941ca
--- /dev/null
+++ b/sys/msg.h
@@ -0,0 +1,133 @@
+#ifndef __SYS_MSG_H__
+#define __SYS_MSG_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/msg/ipc.ref */
+#include <sys/ipc.h>
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/msg/MSG_NOERROR.c */
+#define MSG_NOERROR 1
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/msg/msglen_t.c */
+#ifndef __TYPE_msglen_t_DEFINED__
+#define __TYPE_msglen_t_DEFINED__
+typedef unsigned short msglen_t;
+#endif
+
+/* ./src/sys/msg/msgqnum_t.c */
+#ifndef __TYPE_msgqnum_t_DEFINED__
+#define __TYPE_msgqnum_t_DEFINED__
+typedef unsigned short msgqnum_t;
+#endif
+
+/* src/stddef/size_t.c */
+#ifndef __TYPE_size_t_DEFINED__
+#define __TYPE_size_t_DEFINED__
+#ifdef __LLP64__
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L
+typedef unsigned __int64 size_t;
+# else
+typedef unsigned long long int size_t;
+# endif
+#else
+typedef unsigned long int size_t;
+#endif
+#endif
+
+/* src/sys/types/key_t.c */
+#ifndef __TYPE_key_t_DEFINED__
+#define __TYPE_key_t_DEFINED__
+typedef unsigned long long int key_t;
+#endif
+
+/* src/sys/types/pid_t.c */
+#ifndef __TYPE_pid_t_DEFINED__
+#define __TYPE_pid_t_DEFINED__
+typedef long int pid_t;
+#endif
+
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/msg/struct_msqid_ds.c */
+#ifndef __TYPE_struct_msqid_ds_DEFINED__
+#define __TYPE_struct_msqid_ds_DEFINED__
+struct msqid_ds {
+ struct ipc_perm msg_perm; /* operation permissions */
+ msgqnum_t msg_qnum; /* # messages on queue */
+ msglen_t msg_qbytes; /* Max # bytes allowed on queue */
+ pid_t msg_lspid; /* PID of last msgsnd() */
+ pid_t msg_lrpid; /* PID of last msgrcg() */
+ time_t msg_stime; /* time of last msgsnd() */
+ time_t msg_rtime; /* time of last msgrcv() */
+ time_t msg_ctime; /* time of last change */
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/msg/msgctl.c */
+int msgctl(int __msqid, int __cmd, struct msqid_ds *__buf);
+/* ./src/sys/msg/msgget.c */
+int msgget(key_t __key, int __msgflg);
+/* ./src/sys/msg/msgrcv.c */
+ssize_t msgrcv(int __msqid, void *__msgp, size_t __msgsz, long __msgtyp, int __msgflg);
+/* ./src/sys/msg/msgsnd.c */
+int msgsnd(int __msqid, const void *__msgp, size_t __msgsz, int __msgflg);
+#endif
+
+
+#endif
diff --git a/sys/resource.h b/sys/resource.h
new file mode 100644
index 0000000..08c39ec
--- /dev/null
+++ b/sys/resource.h
@@ -0,0 +1,112 @@
+#ifndef __SYS_RESOURCE_H__
+#define __SYS_RESOURCE_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/resource/PRIO_PGRP.c */
+#define PRIO_PGRP /* TODO */
+/* ./src/sys/resource/PRIO_PROCESS.c */
+#define PRIO_PROCESS /* TODO */
+/* ./src/sys/resource/PRIO_USER.c */
+#define PRIO_USER /* TODO */
+/* ./src/sys/resource/RLIMIT_AS.c */
+#define RLIMIT_AS /* TODO */
+/* ./src/sys/resource/RLIMIT_CORE.c */
+#define RLIMIT_CORE /* TODO */
+/* ./src/sys/resource/RLIMIT_CPU.c */
+#define RLIMIT_CPU /* TODO */
+/* ./src/sys/resource/RLIMIT_DATA.c */
+#define RLIMIT_DATA /* TODO */
+/* ./src/sys/resource/RLIMIT_FSIZE.c */
+#define RLIMIT_FSIZE /* TODO */
+/* ./src/sys/resource/RLIMIT_NOFILE.c */
+#define RLIMIT_NOFILE /* TODO */
+/* ./src/sys/resource/RLIMIT_STACK.c */
+#define RLIMIT_STACK /* TODO */
+/* ./src/sys/resource/RLIM_INFINITY.c */
+#define RLIM_INFINITY /* TODO */
+/* ./src/sys/resource/RUSAGE_CHILDREN.c */
+#define RUSAGE_CHILDREN /* TODO */
+/* ./src/sys/resource/RUSAGE_SELF.c */
+#define RUSAGE_SELF /* TODO */
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/resource/rlim_t.c */
+#ifndef __TYPE_rlim_t_DEFINED__
+#define __TYPE_rlim_t_DEFINED__
+typedef unsigned long long int rlim_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/resource/struct_rlimit.c */
+#ifndef __TYPE_struct_rlimit_DEFINED__
+#define __TYPE_struct_rlimit_DEFINED__
+struct rlimit {
+ rlim_t rlim_cur;
+ rlim_t rlim_max;
+};
+#endif
+
+/* ./src/sys/resource/struct_rusage.c */
+#ifndef __TYPE_struct_rusage_DEFINED__
+#define __TYPE_struct_rusage_DEFINED__
+struct rusage {
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+};
+#endif
+
+/* src/sys/time/struct_timeval.c */
+#ifndef __TYPE_struct_timeval_DEFINED__
+#define __TYPE_struct_timeval_DEFINED__
+struct timeval {
+ time_t tv_sec;
+ suseconds_t tv_usec;
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/resource/getpriority.c */
+int getpriority(int __which, id_t __who);
+/* ./src/sys/resource/getrlimit.c */
+int getrlimit(int __resource, struct rlimit *__rlp);
+/* ./src/sys/resource/getrusage.c */
+int getrusage(int __who, struct rusage *__r_usage);
+/* ./src/sys/resource/setpriority.c */
+int setpriority(int __which, id_t __who, int __value);
+/* ./src/sys/resource/setrlimit.c */
+int setrlimit(int __resource, const struct rlimit *__rlp);
+#endif
+
+
+#endif
diff --git a/sys/sem.h b/sys/sem.h
new file mode 100644
index 0000000..d32215a
--- /dev/null
+++ b/sys/sem.h
@@ -0,0 +1,150 @@
+#ifndef __SYS_SEM_H__
+#define __SYS_SEM_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/sem/ipc.ref */
+#include <sys/ipc.h>
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/sem/GETALL.c */
+#define GETALL 4
+/* ./src/sys/sem/GETNCNT.c */
+#define GETNCNT 1
+/* ./src/sys/sem/GETPID.c */
+#define GETPID 2
+/* ./src/sys/sem/GETVAL.c */
+#define GETVAL 3
+/* ./src/sys/sem/GETZCNT.c */
+#define GETZCNT 5
+/* ./src/sys/sem/SEM_UNDO.c */
+#define SEM_UNDO 1
+/* ./src/sys/sem/SETALL.c */
+#define SETALL 12
+/* ./src/sys/sem/SETVAL.c */
+#define SETVAL 11
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* src/stddef/size_t.c */
+#ifndef __TYPE_size_t_DEFINED__
+#define __TYPE_size_t_DEFINED__
+#ifdef __LLP64__
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L
+typedef unsigned __int64 size_t;
+# else
+typedef unsigned long long int size_t;
+# endif
+#else
+typedef unsigned long int size_t;
+#endif
+#endif
+
+/* src/sys/types/key_t.c */
+#ifndef __TYPE_key_t_DEFINED__
+#define __TYPE_key_t_DEFINED__
+typedef unsigned long long int key_t;
+#endif
+
+/* src/sys/types/pid_t.c */
+#ifndef __TYPE_pid_t_DEFINED__
+#define __TYPE_pid_t_DEFINED__
+typedef long int pid_t;
+#endif
+
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/sem/struct_sem_anonymous.c */
+#ifndef __TYPE_struct_sem_anonymous_DEFINED__
+#define __TYPE_struct_sem_anonymous_DEFINED__
+struct __sem_anonymous {
+ unsigned short semval;
+ pid_t sempid;
+ unsigned short semncnt;
+ unsigned short semzcnt;
+};
+#endif
+
+/* ./src/sys/sem/struct_sembuf.c */
+#ifndef __TYPE_struct_sembuf_DEFINED__
+#define __TYPE_struct_sembuf_DEFINED__
+struct sembuf {
+ unsigned short sem_num;
+ short sem_op;
+ short sem_flg;
+};
+#endif
+
+/* ./src/sys/sem/struct_semid_ds.c */
+#ifndef __TYPE_struct_semid_ds_DEFINED__
+#define __TYPE_struct_semid_ds_DEFINED__
+struct semid_ds {
+ struct ipc_perm sem_perm;
+ unsigned short sem_nsems;
+ time_t sem_otime;
+ time_t sem_ctime;
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/sem/semctl.c */
+int semctl(int __semid, int __semnum, int __cmd, ...);
+/* ./src/sys/sem/semget.c */
+int semget(__key_t, int __nsems, int __semflg);
+/* ./src/sys/sem/semop.c */
+int semop(int __semid, struct sembuf *__sops, size_t __nsops);
+#endif
+
+
+#endif
diff --git a/sys/shm.h b/sys/shm.h
new file mode 100644
index 0000000..39de11b
--- /dev/null
+++ b/sys/shm.h
@@ -0,0 +1,131 @@
+#ifndef __SYS_SHM_H__
+#define __SYS_SHM_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/shm/ipc.ref */
+#include <sys/ipc.h>
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/shm/SHMLBA.c */
+#define SHMLBA 3
+/* ./src/sys/shm/SHM_RDONLY.c */
+#define SHM_RDONLY 1
+/* ./src/sys/shm/SHM_RND.c */
+#define SHM_RND 2
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/shm/shmatt_t.c */
+#ifndef __TYPE_shmatt_t_DEFINED__
+#define __TYPE_shmatt_t_DEFINED__
+typedef unsigned short shmatt_t;
+#endif
+
+/* src/stddef/size_t.c */
+#ifndef __TYPE_size_t_DEFINED__
+#define __TYPE_size_t_DEFINED__
+#ifdef __LLP64__
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L
+typedef unsigned __int64 size_t;
+# else
+typedef unsigned long long int size_t;
+# endif
+#else
+typedef unsigned long int size_t;
+#endif
+#endif
+
+/* src/sys/types/key_t.c */
+#ifndef __TYPE_key_t_DEFINED__
+#define __TYPE_key_t_DEFINED__
+typedef unsigned long long int key_t;
+#endif
+
+/* src/sys/types/pid_t.c */
+#ifndef __TYPE_pid_t_DEFINED__
+#define __TYPE_pid_t_DEFINED__
+typedef long int pid_t;
+#endif
+
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/shm/struct_shmid_ds.c */
+#ifndef __TYPE_struct_shmid_ds_DEFINED__
+#define __TYPE_struct_shmid_ds_DEFINED__
+struct shmid_ds {
+ struct ipc_perm shm_perm;
+ size_t shm_segsz;
+ pid_t shm_lpid;
+ pid_t shm_cpid;
+ shmatt_t shm_nattach;
+ time_t shm_atime;
+ time_t shm_dtime;
+ time_t shm_ctime;
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/shm/shmat.c */
+void * shmat(int __shmid, const void *__shmaddr, int __shmflg);
+/* ./src/sys/shm/shmctl.c */
+int shmctl(int __shmid, int __cmd, struct shmid_ds *__buf);
+/* ./src/sys/shm/shmdt.c */
+int shmdt(const void *__shmaddr);
+/* ./src/sys/shm/shmget.c */
+int shmget(key_t __key, size_t __size, int __shmflg);
+#endif
+
+
+#endif
diff --git a/sys/stat.h b/sys/stat.h
new file mode 100644
index 0000000..d0d6b17
--- /dev/null
+++ b/sys/stat.h
@@ -0,0 +1,243 @@
+#ifndef __SYS_STAT_H__
+#define __SYS_STAT_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/stat/S_IRGRP.c */
+#define S_IRGRP (040)
+/* ./src/sys/stat/S_IROTH.c */
+#define S_IROTH (04)
+/* ./src/sys/stat/S_IRUSR.c */
+#define S_IRUSR (0400)
+/* ./src/sys/stat/S_IRWXG.c */
+#define S_IRWXG (070)
+/* ./src/sys/stat/S_IRWXO.c */
+#define S_IRWXO (07)
+/* ./src/sys/stat/S_IRWXU.c */
+#define S_IRWXU (0700)
+/* ./src/sys/stat/S_ISBLK.c */
+#define S_ISBLK(__s) /* FIXME */
+/* ./src/sys/stat/S_ISCHR.c */
+#define S_ISCHR(__s) /* fixme */
+/* ./src/sys/stat/S_ISDIR.c */
+#define S_ISDIR(__s) (__s)
+/* ./src/sys/stat/S_ISFIFO.c */
+#define S_ISFIFO(__s) /* fixme */
+/* ./src/sys/stat/S_ISGID.c */
+#define S_ISGID (02000)
+/* ./src/sys/stat/S_ISREG.c */
+#define S_ISREG(__s) /* fixme */
+/* ./src/sys/stat/S_ISUID.c */
+#define S_ISUID (04000)
+/* ./src/sys/stat/S_IWGRP.c */
+#define S_IWGRP (020)
+/* ./src/sys/stat/S_IWOTH.c */
+#define S_IWOTH (02)
+/* ./src/sys/stat/S_IWUSR.c */
+#define S_IWUSR (0200)
+/* ./src/sys/stat/S_IXGRP.c */
+#define S_IXGRP (010)
+/* ./src/sys/stat/S_IXOTH.c */
+#define S_IXOTH (01)
+/* ./src/sys/stat/S_IXUSR.c */
+#define S_IXUSR (0100)
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE)
+/* ./src/sys/stat/S_TYPEISMQ.c */
+#define S_TYPEISMQ(__buf) /* TODO */
+/* ./src/sys/stat/S_TYPEISSEM.c */
+#define S_TYPEISSEM(__buf) /* TODO */
+/* ./src/sys/stat/S_TYPEISSHM.c */
+#define S_TYPEISSHM(__buf) /* TODO */
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/stat/S_ISLNK.c */
+#define S_ISLNK(__m) /* TODO */
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/stat/S_IFBLK.c */
+#define S_IFBLK /* TODO */
+/* ./src/sys/stat/S_IFCHR.c */
+#define S_IFCHR /* TODO */
+/* ./src/sys/stat/S_IFDIR.c */
+#define S_IFDIR /* TODO */
+/* ./src/sys/stat/S_IFIFO.c */
+#define S_IFIFO /* TODO */
+/* ./src/sys/stat/S_IFMT.c */
+#define S_IFMT /* TODO */
+/* ./src/sys/stat/S_IFREG.c */
+#define S_IFREG /* TODO */
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/stat/S_IFLNK.c */
+#define S_IFLNK /* TODO */
+/* ./src/sys/stat/S_ISVTX.c */
+#define S_ISVTX 01000
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* src/sys/types/dev_t.c */
+#ifndef __TYPE_dev_t_DEFINED__
+#define __TYPE_dev_t_DEFINED__
+typedef unsigned long int
+ dev_t;
+#endif
+
+/* src/sys/types/gid_t.c */
+#ifndef __TYPE_gid_t_DEFINED__
+#define __TYPE_gid_t_DEFINED__
+typedef unsigned long int
+ gid_t;
+#endif
+
+/* src/sys/types/ino_t.c */
+#ifndef __TYPE_ino_t_DEFINED__
+#define __TYPE_ino_t_DEFINED__
+typedef unsigned long int
+ ino_t;
+#endif
+
+/* src/sys/types/mode_t.c */
+#ifndef __TYPE_mode_t_DEFINED__
+#define __TYPE_mode_t_DEFINED__
+typedef unsigned long int mode_t;
+#endif
+
+/* src/sys/types/nlink_t.c */
+#ifndef __TYPE_nlink_t_DEFINED__
+#define __TYPE_nlink_t_DEFINED__
+typedef unsigned long int
+ nlink_t;
+#endif
+
+/* src/sys/types/off_t.c */
+#ifndef __TYPE_off_t_DEFINED__
+#define __TYPE_off_t_DEFINED__
+typedef long int
+ off_t;
+#endif
+
+/* src/sys/types/uid_t.c */
+#ifndef __TYPE_uid_t_DEFINED__
+#define __TYPE_uid_t_DEFINED__
+typedef unsigned long int
+ uid_t;
+#endif
+
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/stat/struct_stat.c */
+#ifndef __TYPE_struct_stat_DEFINED__
+#define __TYPE_struct_stat_DEFINED__
+struct stat {
+ dev_t st_dev;
+ ino_t st_ino;
+ mode_t st_mode;
+ nlink_t st_nlink;
+ uid_t st_uid;
+ gid_t st_gid;
+ dev_t st_rdev;
+ off_t st_size;
+ #if 0
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ blksize_t st_blksize;
+ blkcnt_t st_blocks;
+ #endif
+};
+#endif
+
+#endif
+
+#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+#define restrict
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/stat/chmod.c */
+int chmod(const char *__path, mode_t __mode);
+/* ./src/sys/stat/fstat.c */
+int fstat(int __fildes, struct stat *__buf);
+/* ./src/sys/stat/mkdir.c */
+int mkdir(const char *__path, mode_t __mode);
+/* ./src/sys/stat/mkfifo.c */
+int mkfifo(const char *__path, mode_t __mode);
+/* ./src/sys/stat/stat.c */
+int stat(const char * restrict __path, struct stat * restrict __buf);
+/* ./src/sys/stat/umask.c */
+mode_t umask(mode_t __cmask);
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE)
+/* ./src/sys/stat/fchmod.c */
+int fchmod(int __fildes, mode_t __mode);
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/stat/lstat.c */
+int lstat(const char * restrict __path, struct stat * restrict __buf);
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/stat/mknod.c */
+int mknod(const char *__path, mode_t __mode, dev_t __dev);
+#endif
+
+
+#endif
diff --git a/sys/statvfs.h b/sys/statvfs.h
new file mode 100644
index 0000000..7740afb
--- /dev/null
+++ b/sys/statvfs.h
@@ -0,0 +1,89 @@
+#ifndef __SYS_STATVFS_H__
+#define __SYS_STATVFS_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/statvfs/ST_NOSUID.c */
+#define ST_NOSUID (1<<1)
+/* ./src/sys/statvfs/ST_RDONLY.c */
+#define ST_RDONLY (1<<0)
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/statvfs/struct_statvfs.c */
+#ifndef __TYPE_struct_statvfs_DEFINED__
+#define __TYPE_struct_statvfs_DEFINED__
+struct statvfs {
+ unsigned long f_bsize;
+ unsigned long f_frsize;
+ fsblkcnt_t f_blocks;
+ fsblkcnt_t f_bfree;
+ fsblkcnt_t f_bavail;
+ fsfilcnt_t f_files;
+ fsfilcnt_t f_ffree;
+ fsfilcnt_t f_favail;
+ unsigned long f_fsid;
+ unsigned long f_flag;
+ unsigned long f_namemax;
+};
+#endif
+
+#endif
+
+#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+#define restrict
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/statvfs/fstatvfs.c */
+int fstatvfs(int __fildes, struct statvfs *__buf);
+/* ./src/sys/statvfs/statvfs.c */
+int statvfs(const char * restrict __path, struct statvfs * restrict __buf);
+#endif
+
+
+#endif
diff --git a/sys/time.h b/sys/time.h
new file mode 100644
index 0000000..de9c69d
--- /dev/null
+++ b/sys/time.h
@@ -0,0 +1,105 @@
+#ifndef __SYS_TIME_H__
+#define __SYS_TIME_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/time/FD_CLR.c */
+#define FD_CLR /* TODO */
+/* ./src/sys/time/FD_ISSET.c */
+#define FD_ISSET /* TODO */
+/* ./src/sys/time/FD_SET.c */
+#define FD_SET /* TODO */
+/* ./src/sys/time/FD_SETSIZE.c */
+#define FD_SETSIZE /* TODO */
+/* ./src/sys/time/FD_ZERO.c */
+#define FD_ZERO /* TIME */
+/* ./src/sys/time/ITIMER_PROF.c */
+#define ITIMER_PROF 2
+/* ./src/sys/time/ITIMER_REAL.c */
+#define ITIMER_REAL 0
+/* ./src/sys/time/ITIMER_VIRTUAL.c */
+#define ITIMER_VIRTUAL 1
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/time/fd_set.c */
+#ifndef __TYPE_fd_set_DEFINED__
+#define __TYPE_fd_set_DEFINED__
+typedef struct {
+ long fds_bits[];
+} fd_set;
+#endif
+
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/time/struct_itimerval.c */
+#ifndef __TYPE_struct_itimerval_DEFINED__
+#define __TYPE_struct_itimerval_DEFINED__
+struct itimerval {
+ struct timeval it_interval;
+ struct timeval it_value;
+};
+#endif
+
+/* ./src/sys/time/struct_timeval.c */
+#ifndef __TYPE_struct_timeval_DEFINED__
+#define __TYPE_struct_timeval_DEFINED__
+struct timeval {
+ time_t tv_sec;
+ suseconds_t tv_usec;
+};
+#endif
+
+#endif
+
+#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+#define restrict
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/time/getitimer.c */
+int getitimer(int __which, struct itimerval *__value);
+/* ./src/sys/time/gettimeofday.c */
+int gettimeofday(struct timeval *restrict __tp, void *restrict __tzp);
+/* ./src/sys/time/select.c */
+int select(int nfds , fd_set * readfds , fd_set * writefds , fd_set * errorfds , struct timeval * timeout );
+/* ./src/sys/time/setitimer.c */
+int setitimer(int __which, const struct itimerval *restrict __value, struct itimerval *restrict __ovalue);
+/* ./src/sys/time/utimes.c */
+int utimes(const char *__path, const struct timeval times[2]);
+#endif
+
+
+#endif
diff --git a/sys/timeb.h b/sys/timeb.h
new file mode 100644
index 0000000..52bbe13
--- /dev/null
+++ b/sys/timeb.h
@@ -0,0 +1,59 @@
+#ifndef __SYS_TIMEB_H__
+#define __SYS_TIMEB_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700)
+/* ./src/sys/timeb/struct_timeb.c */
+#ifndef __TYPE_struct_timeb_DEFINED__
+#define __TYPE_struct_timeb_DEFINED__
+struct timeb {
+ time_t time;
+ unsigned short millitm;
+ short timezone;
+ short dstflag;
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700)
+/* ./src/sys/timeb/ftime.c */
+int ftime(struct timeb *__tp);
+#endif
+
+
+#endif
diff --git a/sys/times.h b/sys/times.h
new file mode 100644
index 0000000..4aa29fa
--- /dev/null
+++ b/sys/times.h
@@ -0,0 +1,75 @@
+#ifndef __SYS_TIMES_H__
+#define __SYS_TIMES_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* src/time/clock_t.c */
+#ifndef __TYPE_clock_t_DEFINED__
+#define __TYPE_clock_t_DEFINED__
+typedef long int clock_t;
+#endif
+
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/times/struct_tms.c */
+#ifndef __TYPE_struct_tms_DEFINED__
+#define __TYPE_struct_tms_DEFINED__
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+#endif
+
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/times/times.c */
+clock_t times(struct tms *__buffer);
+#endif
+
+
+#endif
diff --git a/sys/types.h b/sys/types.h
new file mode 100644
index 0000000..b9976b7
--- /dev/null
+++ b/sys/types.h
@@ -0,0 +1,179 @@
+#ifndef __SYS_TYPES_H__
+#define __SYS_TYPES_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/types/dev_t.c */
+#ifndef __TYPE_dev_t_DEFINED__
+#define __TYPE_dev_t_DEFINED__
+typedef unsigned long int
+ dev_t;
+#endif
+
+/* ./src/sys/types/gid_t.c */
+#ifndef __TYPE_gid_t_DEFINED__
+#define __TYPE_gid_t_DEFINED__
+typedef unsigned long int
+ gid_t;
+#endif
+
+/* ./src/sys/types/ino_t.c */
+#ifndef __TYPE_ino_t_DEFINED__
+#define __TYPE_ino_t_DEFINED__
+typedef unsigned long int
+ ino_t;
+#endif
+
+/* ./src/sys/types/mode_t.c */
+#ifndef __TYPE_mode_t_DEFINED__
+#define __TYPE_mode_t_DEFINED__
+typedef unsigned long int mode_t;
+#endif
+
+/* ./src/sys/types/nlink_t.c */
+#ifndef __TYPE_nlink_t_DEFINED__
+#define __TYPE_nlink_t_DEFINED__
+typedef unsigned long int
+ nlink_t;
+#endif
+
+/* ./src/sys/types/off_t.c */
+#ifndef __TYPE_off_t_DEFINED__
+#define __TYPE_off_t_DEFINED__
+typedef long int
+ off_t;
+#endif
+
+/* ./src/sys/types/pid_t.c */
+#ifndef __TYPE_pid_t_DEFINED__
+#define __TYPE_pid_t_DEFINED__
+typedef long int pid_t;
+#endif
+
+/* ./src/sys/types/ssize_t.c */
+#ifndef __TYPE_ssize_t_DEFINED__
+#define __TYPE_ssize_t_DEFINED__
+typedef long int ssize_t;
+#endif
+
+/* ./src/sys/types/uid_t.c */
+#ifndef __TYPE_uid_t_DEFINED__
+#define __TYPE_uid_t_DEFINED__
+typedef unsigned long int
+ uid_t;
+#endif
+
+/* src/stddef/size_t.c */
+#ifndef __TYPE_size_t_DEFINED__
+#define __TYPE_size_t_DEFINED__
+#ifdef __LLP64__
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L
+typedef unsigned __int64 size_t;
+# else
+typedef unsigned long long int size_t;
+# endif
+#else
+typedef unsigned long int size_t;
+#endif
+#endif
+
+#endif
+
+#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE)
+/* ./src/sys/types/clockid_t.c */
+#ifndef __TYPE_clockid_t_DEFINED__
+#define __TYPE_clockid_t_DEFINED__
+typedef unsigned long int clockid_t;
+#endif
+
+/* ./src/sys/types/timer_t.c */
+#ifndef __TYPE_timer_t_DEFINED__
+#define __TYPE_timer_t_DEFINED__
+typedef unsigned long int timer_t;
+#endif
+
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/types/id_t.c */
+#ifndef __TYPE_id_t_DEFINED__
+#define __TYPE_id_t_DEFINED__
+typedef unsigned long long int id_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE)
+/* ./src/sys/types/key_t.c */
+#ifndef __TYPE_key_t_DEFINED__
+#define __TYPE_key_t_DEFINED__
+typedef unsigned long long int key_t;
+#endif
+
+/* src/time/clock_t.c */
+#ifndef __TYPE_clock_t_DEFINED__
+#define __TYPE_clock_t_DEFINED__
+typedef long int clock_t;
+#endif
+
+/* src/time/time_t.c */
+#ifndef __TYPE_time_t_DEFINED__
+#define __TYPE_time_t_DEFINED__
+typedef long int time_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700)
+/* ./src/sys/types/useconds_t.c */
+#ifndef __TYPE_useconds_t_DEFINED__
+#define __TYPE_useconds_t_DEFINED__
+typedef unsigned int useconds_t;
+#endif
+
+#endif
+
+
+#endif
diff --git a/sys/uio.h b/sys/uio.h
new file mode 100644
index 0000000..c511a82
--- /dev/null
+++ b/sys/uio.h
@@ -0,0 +1,50 @@
+#ifndef __SYS_UIO_H__
+#define __SYS_UIO_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/uio/struct_iovec.c */
+#ifndef __TYPE_struct_iovec_DEFINED__
+#define __TYPE_struct_iovec_DEFINED__
+struct iovec {
+ void * iov_base;
+ size_t iov_len;
+};
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/uio/readv.c */
+ssize_t readv(int __fildes, const struct iovec * __iov, int __iovcnt);
+/* ./src/sys/uio/writev.c */
+ssize_t writev(int __fildes, const struct iovec * __iov, int __iovcnt);
+#endif
+
+
+#endif
diff --git a/sys/utsname.h b/sys/utsname.h
new file mode 100644
index 0000000..6a43e44
--- /dev/null
+++ b/sys/utsname.h
@@ -0,0 +1,67 @@
+#ifndef __SYS_UTSNAME_H__
+#define __SYS_UTSNAME_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/utsname/struct_utsname.c */
+#ifndef __TYPE_struct_utsname_DEFINED__
+#define __TYPE_struct_utsname_DEFINED__
+struct utsname {
+ char sysname[100];
+ char nodename[100];
+ char release[100];
+ char version[100];
+ char machine[100];
+};
+#endif
+
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/utsname/uname.c */
+int uname(struct utsname *__name);
+#endif
+
+
+#endif
diff --git a/sys/wait.h b/sys/wait.h
new file mode 100644
index 0000000..1dd2779
--- /dev/null
+++ b/sys/wait.h
@@ -0,0 +1,158 @@
+#ifndef __SYS_WAIT_H__
+#define __SYS_WAIT_H__
+
+/*
+UNG's Not GNU
+
+MIT License
+
+Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
+# if (_XOPEN_SOURCE >= 700)
+# define _POSIX_C_SOURCE 200809L
+# elif (_XOPEN_SOURCE >= 600)
+# define _POSIX_C_SOURCE 200112L
+# elif (_XOPEN_SOURCE >= 500)
+# define _POSIX_C_SOURCE 199506L
+# else
+# define _POSIX_C_SOURCE 2
+# endif
+#endif
+
+#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/wait/WEXITSTATUS.c */
+#define WEXITSTATUS(__stat_val) (__stat_val & 0xff)
+/* ./src/sys/wait/WIFEXITED.c */
+#define WIFEXITED(__stat_val) (__stat_val <= 255)
+/* ./src/sys/wait/WIFSIGNALED.c */
+#define WIFSIGNALED(__stat_val) (__stat_val & 0x100)
+/* ./src/sys/wait/WIFSTOPPED.c */
+#define WIFSTOPPED(__stat_val) (__stat_val & 0x200)
+/* ./src/sys/wait/WNOHANG.c */
+#define WNOHANG (1<<0)
+/* ./src/sys/wait/WSTOPSIG.c */
+#define WSTOPSIG(__stat_val) (__stat_val & 0xff)
+/* ./src/sys/wait/WTERMSIG.c */
+#define WTERMSIG(__stat_val) (__stat_val & 0xff)
+/* ./src/sys/wait/WUNTRACED.c */
+#define WUNTRACED (1<<1)
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/wait/WEXITED.c */
+#define WEXITED (1<<3)
+/* ./src/sys/wait/WNOWAIT.c */
+#define WNOWAIT (1<<4)
+/* ./src/sys/wait/WSTOPPED.c */
+#define WSTOPPED (1<<5)
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/wait/WCONTINUED.c */
+#define WCONTINUED (1<<2)
+/* ./src/sys/wait/WIFCONTINUED.c */
+#define WIFCONTINUED(__stat_val) (__stat_val & 0x400)
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/wait/idtype_t.c */
+#ifndef __TYPE_idtype_t_DEFINED__
+#define __TYPE_idtype_t_DEFINED__
+typedef enum {
+ P_ALL,
+ P_PGID,
+ P_PID
+} idtype_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* src/signal/siginfo_t.c */
+#ifndef __TYPE_siginfo_t_DEFINED__
+#define __TYPE_siginfo_t_DEFINED__
+typedef struct {
+ int si_signo;
+ int si_code;
+ pid_t si_pid;
+ uid_t si_uid;
+ void *si_addr;
+ int si_status;
+ long si_band;
+ int si_errno;
+ union sigval si_value;
+} siginfo_t;
+#endif
+
+/* src/sys/types/id_t.c */
+#ifndef __TYPE_id_t_DEFINED__
+#define __TYPE_id_t_DEFINED__
+typedef unsigned long long int id_t;
+#endif
+
+/* src/sys/types/pid_t.c */
+#ifndef __TYPE_pid_t_DEFINED__
+#define __TYPE_pid_t_DEFINED__
+typedef long int pid_t;
+#endif
+
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* src/sys/resource/struct_rusage.c */
+#ifndef __TYPE_struct_rusage_DEFINED__
+#define __TYPE_struct_rusage_DEFINED__
+struct rusage {
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+};
+#endif
+
+#endif
+
+#if (defined _POSIX_SOURCE)
+/* ./src/sys/wait/wait.c */
+pid_t wait(int *__stat_loc);
+/* ./src/sys/wait/waitpid.c */
+pid_t waitpid(pid_t __pid, int *__stat_loc, int __options);
+#endif
+
+#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
+ (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
+/* ./src/sys/wait/waitid.c */
+int waitid(idtype_t __idtype, id_t __id, siginfo_t *__infop, int __options);
+#endif
+
+#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600)
+/* ./src/sys/wait/wait3.c */
+pid_t wait3(int *__state_loc, int __options, struct rusage *__resource_usage);
+#endif
+
+
+#endif