/* automatically generated by clay-bindgen */

alias __u_char = CUChar;

alias __u_short = UShort;

alias __u_int = UInt;

alias __u_long = CULong;

alias __int8_t = CChar;

alias __uint8_t = CUChar;

alias __int16_t = Short;

alias __uint16_t = UShort;

alias __int32_t = Int;

alias __uint32_t = UInt;

alias __int64_t = CLong;

alias __uint64_t = CULong;

alias __quad_t = CLong;

alias __u_quad_t = CULong;

alias __dev_t = CULong;

alias __uid_t = UInt;

alias __gid_t = UInt;

alias __ino_t = CULong;

alias __ino64_t = CULong;

alias __mode_t = UInt;

alias __nlink_t = CULong;

alias __off_t = CLong;

alias __off64_t = CLong;

alias __pid_t = Int;

record Struct_Unnamed1 (
    __val : Array[Int, 2],
);

alias __fsid_t = Struct_Unnamed1;

alias __clock_t = CLong;

alias __rlim_t = CULong;

alias __rlim64_t = CULong;

alias __id_t = UInt;

alias __time_t = CLong;

alias __useconds_t = UInt;

alias __suseconds_t = CLong;

alias __daddr_t = Int;

alias __swblk_t = CLong;

alias __key_t = Int;

alias __clockid_t = Int;

alias __timer_t = OpaquePointer;

alias __blksize_t = CLong;

alias __blkcnt_t = CLong;

alias __blkcnt64_t = CLong;

alias __fsblkcnt_t = CULong;

alias __fsblkcnt64_t = CULong;

alias __fsfilcnt_t = CULong;

alias __fsfilcnt64_t = CULong;

alias __ssize_t = CLong;

alias __loff_t = __off64_t;

alias __qaddr_t = Pointer[__quad_t];

alias __caddr_t = Pointer[CChar];

alias __intptr_t = CLong;

alias __socklen_t = UInt;

alias ssize_t = __ssize_t;

alias size_t = CULong;

alias gid_t = __gid_t;

alias uid_t = __uid_t;

alias off_t = __off_t;

alias useconds_t = __useconds_t;

alias pid_t = __pid_t;

alias intptr_t = __intptr_t;

alias socklen_t = __socklen_t;

external (cdecl) access(arg0:Pointer[CChar], arg1:Int) : Int;

external (cdecl) faccessat(arg0:Int, arg1:Pointer[CChar], arg2:Int, arg3:Int) : Int;

external (cdecl) lseek(arg0:Int, arg1:__off_t, arg2:Int) : __off_t;

external (cdecl) close(arg0:Int) : Int;

external (cdecl) read(arg0:Int, arg1:OpaquePointer, arg2:size_t) : ssize_t;

external (cdecl) write(arg0:Int, arg1:OpaquePointer, arg2:size_t) : ssize_t;

external (cdecl) pread(arg0:Int, arg1:OpaquePointer, arg2:size_t, arg3:__off_t) : ssize_t;

external (cdecl) pwrite(arg0:Int, arg1:OpaquePointer, arg2:size_t, arg3:__off_t) : ssize_t;

external (cdecl) pipe(arg0:Pointer[Int]) : Int;

external (cdecl) alarm(arg0:UInt) : UInt;

external (cdecl) sleep(arg0:UInt) : UInt;

external (cdecl) ualarm(arg0:__useconds_t, arg1:__useconds_t) : __useconds_t;

external (cdecl) usleep(arg0:__useconds_t) : Int;

external (cdecl) pause() : Int;

external (cdecl) chown(arg0:Pointer[CChar], arg1:__uid_t, arg2:__gid_t) : Int;

external (cdecl) fchown(arg0:Int, arg1:__uid_t, arg2:__gid_t) : Int;

external (cdecl) lchown(arg0:Pointer[CChar], arg1:__uid_t, arg2:__gid_t) : Int;

external (cdecl) fchownat(arg0:Int, arg1:Pointer[CChar], arg2:__uid_t, arg3:__gid_t, arg4:Int) : Int;

external (cdecl) chdir(arg0:Pointer[CChar]) : Int;

external (cdecl) fchdir(arg0:Int) : Int;

external (cdecl) getcwd(arg0:Pointer[CChar], arg1:size_t) : Pointer[CChar];

external (cdecl) getwd(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) dup(arg0:Int) : Int;

external (cdecl) dup2(arg0:Int, arg1:Int) : Int;

external __environ : Pointer[Pointer[CChar]];

external (cdecl) execve(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Pointer[Pointer[CChar]]) : Int;

external (cdecl) fexecve(arg0:Int, arg1:Pointer[Pointer[CChar]], arg2:Pointer[Pointer[CChar]]) : Int;

external (cdecl) execv(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]]) : Int;

external (cdecl) execle(arg0:Pointer[CChar], arg1:Pointer[CChar], ..) : Int;

external (cdecl) execl(arg0:Pointer[CChar], arg1:Pointer[CChar], ..) : Int;

external (cdecl) execvp(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]]) : Int;

external (cdecl) execlp(arg0:Pointer[CChar], arg1:Pointer[CChar], ..) : Int;

external (cdecl) nice(arg0:Int) : Int;

external (cdecl) _exit(arg0:Int) : ;

alias Enum_Unnamed2 = UInt;
alias _PC_LINK_MAX = 0;
alias _PC_MAX_CANON = 1;
alias _PC_MAX_INPUT = 2;
alias _PC_NAME_MAX = 3;
alias _PC_PATH_MAX = 4;
alias _PC_PIPE_BUF = 5;
alias _PC_CHOWN_RESTRICTED = 6;
alias _PC_NO_TRUNC = 7;
alias _PC_VDISABLE = 8;
alias _PC_SYNC_IO = 9;
alias _PC_ASYNC_IO = 10;
alias _PC_PRIO_IO = 11;
alias _PC_SOCK_MAXBUF = 12;
alias _PC_FILESIZEBITS = 13;
alias _PC_REC_INCR_XFER_SIZE = 14;
alias _PC_REC_MAX_XFER_SIZE = 15;
alias _PC_REC_MIN_XFER_SIZE = 16;
alias _PC_REC_XFER_ALIGN = 17;
alias _PC_ALLOC_SIZE_MIN = 18;
alias _PC_SYMLINK_MAX = 19;
alias _PC_2_SYMLINKS = 20;

alias Enum_Unnamed3 = UInt;
alias _SC_ARG_MAX = 0;
alias _SC_CHILD_MAX = 1;
alias _SC_CLK_TCK = 2;
alias _SC_NGROUPS_MAX = 3;
alias _SC_OPEN_MAX = 4;
alias _SC_STREAM_MAX = 5;
alias _SC_TZNAME_MAX = 6;
alias _SC_JOB_CONTROL = 7;
alias _SC_SAVED_IDS = 8;
alias _SC_REALTIME_SIGNALS = 9;
alias _SC_PRIORITY_SCHEDULING = 10;
alias _SC_TIMERS = 11;
alias _SC_ASYNCHRONOUS_IO = 12;
alias _SC_PRIORITIZED_IO = 13;
alias _SC_SYNCHRONIZED_IO = 14;
alias _SC_FSYNC = 15;
alias _SC_MAPPED_FILES = 16;
alias _SC_MEMLOCK = 17;
alias _SC_MEMLOCK_RANGE = 18;
alias _SC_MEMORY_PROTECTION = 19;
alias _SC_MESSAGE_PASSING = 20;
alias _SC_SEMAPHORES = 21;
alias _SC_SHARED_MEMORY_OBJECTS = 22;
alias _SC_AIO_LISTIO_MAX = 23;
alias _SC_AIO_MAX = 24;
alias _SC_AIO_PRIO_DELTA_MAX = 25;
alias _SC_DELAYTIMER_MAX = 26;
alias _SC_MQ_OPEN_MAX = 27;
alias _SC_MQ_PRIO_MAX = 28;
alias _SC_VERSION = 29;
alias _SC_PAGESIZE = 30;
alias _SC_RTSIG_MAX = 31;
alias _SC_SEM_NSEMS_MAX = 32;
alias _SC_SEM_VALUE_MAX = 33;
alias _SC_SIGQUEUE_MAX = 34;
alias _SC_TIMER_MAX = 35;
alias _SC_BC_BASE_MAX = 36;
alias _SC_BC_DIM_MAX = 37;
alias _SC_BC_SCALE_MAX = 38;
alias _SC_BC_STRING_MAX = 39;
alias _SC_COLL_WEIGHTS_MAX = 40;
alias _SC_EQUIV_CLASS_MAX = 41;
alias _SC_EXPR_NEST_MAX = 42;
alias _SC_LINE_MAX = 43;
alias _SC_RE_DUP_MAX = 44;
alias _SC_CHARCLASS_NAME_MAX = 45;
alias _SC_2_VERSION = 46;
alias _SC_2_C_BIND = 47;
alias _SC_2_C_DEV = 48;
alias _SC_2_FORT_DEV = 49;
alias _SC_2_FORT_RUN = 50;
alias _SC_2_SW_DEV = 51;
alias _SC_2_LOCALEDEF = 52;
alias _SC_PII = 53;
alias _SC_PII_XTI = 54;
alias _SC_PII_SOCKET = 55;
alias _SC_PII_INTERNET = 56;
alias _SC_PII_OSI = 57;
alias _SC_POLL = 58;
alias _SC_SELECT = 59;
alias _SC_UIO_MAXIOV = 60;
alias _SC_IOV_MAX = 60;
alias _SC_PII_INTERNET_STREAM = 61;
alias _SC_PII_INTERNET_DGRAM = 62;
alias _SC_PII_OSI_COTS = 63;
alias _SC_PII_OSI_CLTS = 64;
alias _SC_PII_OSI_M = 65;
alias _SC_T_IOV_MAX = 66;
alias _SC_THREADS = 67;
alias _SC_THREAD_SAFE_FUNCTIONS = 68;
alias _SC_GETGR_R_SIZE_MAX = 69;
alias _SC_GETPW_R_SIZE_MAX = 70;
alias _SC_LOGIN_NAME_MAX = 71;
alias _SC_TTY_NAME_MAX = 72;
alias _SC_THREAD_DESTRUCTOR_ITERATIONS = 73;
alias _SC_THREAD_KEYS_MAX = 74;
alias _SC_THREAD_STACK_MIN = 75;
alias _SC_THREAD_THREADS_MAX = 76;
alias _SC_THREAD_ATTR_STACKADDR = 77;
alias _SC_THREAD_ATTR_STACKSIZE = 78;
alias _SC_THREAD_PRIORITY_SCHEDULING = 79;
alias _SC_THREAD_PRIO_INHERIT = 80;
alias _SC_THREAD_PRIO_PROTECT = 81;
alias _SC_THREAD_PROCESS_SHARED = 82;
alias _SC_NPROCESSORS_CONF = 83;
alias _SC_NPROCESSORS_ONLN = 84;
alias _SC_PHYS_PAGES = 85;
alias _SC_AVPHYS_PAGES = 86;
alias _SC_ATEXIT_MAX = 87;
alias _SC_PASS_MAX = 88;
alias _SC_XOPEN_VERSION = 89;
alias _SC_XOPEN_XCU_VERSION = 90;
alias _SC_XOPEN_UNIX = 91;
alias _SC_XOPEN_CRYPT = 92;
alias _SC_XOPEN_ENH_I18N = 93;
alias _SC_XOPEN_SHM = 94;
alias _SC_2_CHAR_TERM = 95;
alias _SC_2_C_VERSION = 96;
alias _SC_2_UPE = 97;
alias _SC_XOPEN_XPG2 = 98;
alias _SC_XOPEN_XPG3 = 99;
alias _SC_XOPEN_XPG4 = 100;
alias _SC_CHAR_BIT = 101;
alias _SC_CHAR_MAX = 102;
alias _SC_CHAR_MIN = 103;
alias _SC_INT_MAX = 104;
alias _SC_INT_MIN = 105;
alias _SC_LONG_BIT = 106;
alias _SC_WORD_BIT = 107;
alias _SC_MB_LEN_MAX = 108;
alias _SC_NZERO = 109;
alias _SC_SSIZE_MAX = 110;
alias _SC_SCHAR_MAX = 111;
alias _SC_SCHAR_MIN = 112;
alias _SC_SHRT_MAX = 113;
alias _SC_SHRT_MIN = 114;
alias _SC_UCHAR_MAX = 115;
alias _SC_UINT_MAX = 116;
alias _SC_ULONG_MAX = 117;
alias _SC_USHRT_MAX = 118;
alias _SC_NL_ARGMAX = 119;
alias _SC_NL_LANGMAX = 120;
alias _SC_NL_MSGMAX = 121;
alias _SC_NL_NMAX = 122;
alias _SC_NL_SETMAX = 123;
alias _SC_NL_TEXTMAX = 124;
alias _SC_XBS5_ILP32_OFF32 = 125;
alias _SC_XBS5_ILP32_OFFBIG = 126;
alias _SC_XBS5_LP64_OFF64 = 127;
alias _SC_XBS5_LPBIG_OFFBIG = 128;
alias _SC_XOPEN_LEGACY = 129;
alias _SC_XOPEN_REALTIME = 130;
alias _SC_XOPEN_REALTIME_THREADS = 131;
alias _SC_ADVISORY_INFO = 132;
alias _SC_BARRIERS = 133;
alias _SC_BASE = 134;
alias _SC_C_LANG_SUPPORT = 135;
alias _SC_C_LANG_SUPPORT_R = 136;
alias _SC_CLOCK_SELECTION = 137;
alias _SC_CPUTIME = 138;
alias _SC_THREAD_CPUTIME = 139;
alias _SC_DEVICE_IO = 140;
alias _SC_DEVICE_SPECIFIC = 141;
alias _SC_DEVICE_SPECIFIC_R = 142;
alias _SC_FD_MGMT = 143;
alias _SC_FIFO = 144;
alias _SC_PIPE = 145;
alias _SC_FILE_ATTRIBUTES = 146;
alias _SC_FILE_LOCKING = 147;
alias _SC_FILE_SYSTEM = 148;
alias _SC_MONOTONIC_CLOCK = 149;
alias _SC_MULTI_PROCESS = 150;
alias _SC_SINGLE_PROCESS = 151;
alias _SC_NETWORKING = 152;
alias _SC_READER_WRITER_LOCKS = 153;
alias _SC_SPIN_LOCKS = 154;
alias _SC_REGEXP = 155;
alias _SC_REGEX_VERSION = 156;
alias _SC_SHELL = 157;
alias _SC_SIGNALS = 158;
alias _SC_SPAWN = 159;
alias _SC_SPORADIC_SERVER = 160;
alias _SC_THREAD_SPORADIC_SERVER = 161;
alias _SC_SYSTEM_DATABASE = 162;
alias _SC_SYSTEM_DATABASE_R = 163;
alias _SC_TIMEOUTS = 164;
alias _SC_TYPED_MEMORY_OBJECTS = 165;
alias _SC_USER_GROUPS = 166;
alias _SC_USER_GROUPS_R = 167;
alias _SC_2_PBS = 168;
alias _SC_2_PBS_ACCOUNTING = 169;
alias _SC_2_PBS_LOCATE = 170;
alias _SC_2_PBS_MESSAGE = 171;
alias _SC_2_PBS_TRACK = 172;
alias _SC_SYMLOOP_MAX = 173;
alias _SC_STREAMS = 174;
alias _SC_2_PBS_CHECKPOINT = 175;
alias _SC_V6_ILP32_OFF32 = 176;
alias _SC_V6_ILP32_OFFBIG = 177;
alias _SC_V6_LP64_OFF64 = 178;
alias _SC_V6_LPBIG_OFFBIG = 179;
alias _SC_HOST_NAME_MAX = 180;
alias _SC_TRACE = 181;
alias _SC_TRACE_EVENT_FILTER = 182;
alias _SC_TRACE_INHERIT = 183;
alias _SC_TRACE_LOG = 184;
alias _SC_LEVEL1_ICACHE_SIZE = 185;
alias _SC_LEVEL1_ICACHE_ASSOC = 186;
alias _SC_LEVEL1_ICACHE_LINESIZE = 187;
alias _SC_LEVEL1_DCACHE_SIZE = 188;
alias _SC_LEVEL1_DCACHE_ASSOC = 189;
alias _SC_LEVEL1_DCACHE_LINESIZE = 190;
alias _SC_LEVEL2_CACHE_SIZE = 191;
alias _SC_LEVEL2_CACHE_ASSOC = 192;
alias _SC_LEVEL2_CACHE_LINESIZE = 193;
alias _SC_LEVEL3_CACHE_SIZE = 194;
alias _SC_LEVEL3_CACHE_ASSOC = 195;
alias _SC_LEVEL3_CACHE_LINESIZE = 196;
alias _SC_LEVEL4_CACHE_SIZE = 197;
alias _SC_LEVEL4_CACHE_ASSOC = 198;
alias _SC_LEVEL4_CACHE_LINESIZE = 199;
alias _SC_IPV6 = 235;
alias _SC_RAW_SOCKETS = 236;
alias _SC_V7_ILP32_OFF32 = 237;
alias _SC_V7_ILP32_OFFBIG = 238;
alias _SC_V7_LP64_OFF64 = 239;
alias _SC_V7_LPBIG_OFFBIG = 240;
alias _SC_SS_REPL_MAX = 241;
alias _SC_TRACE_EVENT_NAME_MAX = 242;
alias _SC_TRACE_NAME_MAX = 243;
alias _SC_TRACE_SYS_MAX = 244;
alias _SC_TRACE_USER_EVENT_MAX = 245;
alias _SC_XOPEN_STREAMS = 246;
alias _SC_THREAD_ROBUST_PRIO_INHERIT = 247;
alias _SC_THREAD_ROBUST_PRIO_PROTECT = 248;

alias Enum_Unnamed4 = UInt;
alias _CS_PATH = 0;
alias _CS_V6_WIDTH_RESTRICTED_ENVS = 1;
alias _CS_GNU_LIBC_VERSION = 2;
alias _CS_GNU_LIBPTHREAD_VERSION = 3;
alias _CS_V5_WIDTH_RESTRICTED_ENVS = 4;
alias _CS_V7_WIDTH_RESTRICTED_ENVS = 5;
alias _CS_LFS_CFLAGS = 1000;
alias _CS_LFS_LDFLAGS = 1001;
alias _CS_LFS_LIBS = 1002;
alias _CS_LFS_LINTFLAGS = 1003;
alias _CS_LFS64_CFLAGS = 1004;
alias _CS_LFS64_LDFLAGS = 1005;
alias _CS_LFS64_LIBS = 1006;
alias _CS_LFS64_LINTFLAGS = 1007;
alias _CS_XBS5_ILP32_OFF32_CFLAGS = 1100;
alias _CS_XBS5_ILP32_OFF32_LDFLAGS = 1101;
alias _CS_XBS5_ILP32_OFF32_LIBS = 1102;
alias _CS_XBS5_ILP32_OFF32_LINTFLAGS = 1103;
alias _CS_XBS5_ILP32_OFFBIG_CFLAGS = 1104;
alias _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 1105;
alias _CS_XBS5_ILP32_OFFBIG_LIBS = 1106;
alias _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107;
alias _CS_XBS5_LP64_OFF64_CFLAGS = 1108;
alias _CS_XBS5_LP64_OFF64_LDFLAGS = 1109;
alias _CS_XBS5_LP64_OFF64_LIBS = 1110;
alias _CS_XBS5_LP64_OFF64_LINTFLAGS = 1111;
alias _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 1112;
alias _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 1113;
alias _CS_XBS5_LPBIG_OFFBIG_LIBS = 1114;
alias _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115;
alias _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116;
alias _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117;
alias _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118;
alias _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119;
alias _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120;
alias _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121;
alias _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122;
alias _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123;
alias _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124;
alias _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125;
alias _CS_POSIX_V6_LP64_OFF64_LIBS = 1126;
alias _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127;
alias _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128;
alias _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129;
alias _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130;
alias _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131;
alias _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132;
alias _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133;
alias _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134;
alias _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135;
alias _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136;
alias _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137;
alias _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138;
alias _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139;
alias _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140;
alias _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141;
alias _CS_POSIX_V7_LP64_OFF64_LIBS = 1142;
alias _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143;
alias _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144;
alias _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145;
alias _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146;
alias _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147;
alias _CS_V6_ENV = 1148;
alias _CS_V7_ENV = 1149;

external (cdecl) pathconf(arg0:Pointer[CChar], arg1:Int) : CLong;

external (cdecl) fpathconf(arg0:Int, arg1:Int) : CLong;

external (cdecl) sysconf(arg0:Int) : CLong;

external (cdecl) confstr(arg0:Int, arg1:Pointer[CChar], arg2:size_t) : size_t;

external (cdecl) getpid() : __pid_t;

external (cdecl) getppid() : __pid_t;

external (cdecl) getpgrp() : __pid_t;

external (cdecl) __getpgid(arg0:__pid_t) : __pid_t;

external (cdecl) getpgid(arg0:__pid_t) : __pid_t;

external (cdecl) setpgid(arg0:__pid_t, arg1:__pid_t) : Int;

external (cdecl) setpgrp() : Int;

external (cdecl) setsid() : __pid_t;

external (cdecl) getsid(arg0:__pid_t) : __pid_t;

external (cdecl) getuid() : __uid_t;

external (cdecl) geteuid() : __uid_t;

external (cdecl) getgid() : __gid_t;

external (cdecl) getegid() : __gid_t;

external (cdecl) getgroups(arg0:Int, arg1:Pointer[__gid_t]) : Int;

external (cdecl) setuid(arg0:__uid_t) : Int;

external (cdecl) setreuid(arg0:__uid_t, arg1:__uid_t) : Int;

external (cdecl) seteuid(arg0:__uid_t) : Int;

external (cdecl) setgid(arg0:__gid_t) : Int;

external (cdecl) setregid(arg0:__gid_t, arg1:__gid_t) : Int;

external (cdecl) setegid(arg0:__gid_t) : Int;

external (cdecl) fork() : __pid_t;

external (cdecl) vfork() : __pid_t;

external (cdecl) ttyname(arg0:Int) : Pointer[CChar];

external (cdecl) ttyname_r(arg0:Int, arg1:Pointer[CChar], arg2:size_t) : Int;

external (cdecl) isatty(arg0:Int) : Int;

external (cdecl) ttyslot() : Int;

external (cdecl) link(arg0:Pointer[CChar], arg1:Pointer[CChar]) : Int;

external (cdecl) linkat(arg0:Int, arg1:Pointer[CChar], arg2:Int, arg3:Pointer[CChar], arg4:Int) : Int;

external (cdecl) symlink(arg0:Pointer[CChar], arg1:Pointer[CChar]) : Int;

external (cdecl) readlink(arg0:Pointer[CChar], arg1:Pointer[CChar], arg2:size_t) : ssize_t;

external (cdecl) symlinkat(arg0:Pointer[CChar], arg1:Int, arg2:Pointer[CChar]) : Int;

external (cdecl) readlinkat(arg0:Int, arg1:Pointer[CChar], arg2:Pointer[CChar], arg3:size_t) : ssize_t;

external (cdecl) unlink(arg0:Pointer[CChar]) : Int;

external (cdecl) unlinkat(arg0:Int, arg1:Pointer[CChar], arg2:Int) : Int;

external (cdecl) rmdir(arg0:Pointer[CChar]) : Int;

external (cdecl) tcgetpgrp(arg0:Int) : __pid_t;

external (cdecl) tcsetpgrp(arg0:Int, arg1:__pid_t) : Int;

external (cdecl) getlogin() : Pointer[CChar];

external (cdecl) getlogin_r(arg0:Pointer[CChar], arg1:size_t) : Int;

external (cdecl) setlogin(arg0:Pointer[CChar]) : Int;

external optarg : Pointer[CChar];

external optind : Int;

external opterr : Int;

external optopt : Int;

external (cdecl) getopt(arg0:Int, arg1:Pointer[Pointer[CChar]], arg2:Pointer[CChar]) : Int;

external (cdecl) gethostname(arg0:Pointer[CChar], arg1:size_t) : Int;

external (cdecl) sethostname(arg0:Pointer[CChar], arg1:size_t) : Int;

external (cdecl) sethostid(arg0:CLong) : Int;

external (cdecl) getdomainname(arg0:Pointer[CChar], arg1:size_t) : Int;

external (cdecl) setdomainname(arg0:Pointer[CChar], arg1:size_t) : Int;

external (cdecl) vhangup() : Int;

external (cdecl) revoke(arg0:Pointer[CChar]) : Int;

external (cdecl) profil(arg0:Pointer[UShort], arg1:size_t, arg2:size_t, arg3:UInt) : Int;

external (cdecl) acct(arg0:Pointer[CChar]) : Int;

external (cdecl) getusershell() : Pointer[CChar];

external (cdecl) endusershell() : ;

external (cdecl) setusershell() : ;

external (cdecl) daemon(arg0:Int, arg1:Int) : Int;

external (cdecl) chroot(arg0:Pointer[CChar]) : Int;

external (cdecl) getpass(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) fsync(arg0:Int) : Int;

external (cdecl) gethostid() : CLong;

external (cdecl) sync() : ;

external (cdecl) getpagesize() : Int;

external (cdecl) getdtablesize() : Int;

external (cdecl) truncate(arg0:Pointer[CChar], arg1:__off_t) : Int;

external (cdecl) ftruncate(arg0:Int, arg1:__off_t) : Int;

external (cdecl) brk(arg0:OpaquePointer) : Int;

external (cdecl) sbrk(arg0:intptr_t) : OpaquePointer;

external (cdecl) syscall(arg0:CLong, ..) : CLong;

external (cdecl) lockf(arg0:Int, arg1:Int, arg2:__off_t) : Int;

external (cdecl) fdatasync(arg0:Int) : Int;

external (cdecl) ctermid(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) __errno_location() : Pointer[Int];

alias time_t = __time_t;

record Struct_timespec (
    tv_sec : __time_t,
    tv_nsec : CLong,
);

record Struct_sched_param (
    __sched_priority : Int,
);

record Struct___sched_param (
    __sched_priority : Int,
);

alias __cpu_mask = CULong;

record Struct_Unnamed5 (
    __bits : Array[__cpu_mask, 16],
);

alias cpu_set_t = Struct_Unnamed5;

external (cdecl) __sched_cpucount(arg0:size_t, arg1:Pointer[cpu_set_t]) : Int;

external (cdecl) __sched_cpualloc(arg0:size_t) : Pointer[cpu_set_t];

external (cdecl) __sched_cpufree(arg0:Pointer[cpu_set_t]) : ;

external (cdecl) sched_setparam(arg0:__pid_t, arg1:Pointer[Struct_sched_param]) : Int;

external (cdecl) sched_getparam(arg0:__pid_t, arg1:Pointer[Struct_sched_param]) : Int;

external (cdecl) sched_setscheduler(arg0:__pid_t, arg1:Int, arg2:Pointer[Struct_sched_param]) : Int;

external (cdecl) sched_getscheduler(arg0:__pid_t) : Int;

external (cdecl) sched_yield() : Int;

external (cdecl) sched_get_priority_max(arg0:Int) : Int;

external (cdecl) sched_get_priority_min(arg0:Int) : Int;

external (cdecl) sched_rr_get_interval(arg0:__pid_t, arg1:Pointer[Struct_timespec]) : Int;

alias clock_t = __clock_t;

alias clockid_t = __clockid_t;

alias timer_t = __timer_t;

record Struct_tm (
    tm_sec : Int,
    tm_min : Int,
    tm_hour : Int,
    tm_mday : Int,
    tm_mon : Int,
    tm_year : Int,
    tm_wday : Int,
    tm_yday : Int,
    tm_isdst : Int,
    tm_gmtoff : CLong,
    tm_zone : Pointer[CChar],
);

record Struct_itimerspec (
    it_interval : Struct_timespec,
    it_value : Struct_timespec,
);

external (cdecl) clock() : clock_t;

external (cdecl) time(arg0:Pointer[time_t]) : time_t;

external (cdecl) difftime(arg0:time_t, arg1:time_t) : Double;

external (cdecl) mktime(arg0:Pointer[Struct_tm]) : time_t;

external (cdecl) strftime(arg0:Pointer[CChar], arg1:size_t, arg2:Pointer[CChar], arg3:Pointer[Struct_tm]) : size_t;

record Struct___locale_struct (
    __locales : Array[Pointer[Struct___locale_data], 13],
    __ctype_b : Pointer[UShort],
    __ctype_tolower : Pointer[Int],
    __ctype_toupper : Pointer[Int],
    __names : Array[Pointer[CChar], 13],
);

alias __locale_t = Pointer[Struct___locale_struct];

alias locale_t = __locale_t;

external (cdecl) strftime_l(arg0:Pointer[CChar], arg1:size_t, arg2:Pointer[CChar], arg3:Pointer[Struct_tm], arg4:__locale_t) : size_t;

external (cdecl) gmtime(arg0:Pointer[time_t]) : Pointer[Struct_tm];

external (cdecl) localtime(arg0:Pointer[time_t]) : Pointer[Struct_tm];

external (cdecl) gmtime_r(arg0:Pointer[time_t], arg1:Pointer[Struct_tm]) : Pointer[Struct_tm];

external (cdecl) localtime_r(arg0:Pointer[time_t], arg1:Pointer[Struct_tm]) : Pointer[Struct_tm];

external (cdecl) asctime(arg0:Pointer[Struct_tm]) : Pointer[CChar];

external (cdecl) ctime(arg0:Pointer[time_t]) : Pointer[CChar];

external (cdecl) asctime_r(arg0:Pointer[Struct_tm], arg1:Pointer[CChar]) : Pointer[CChar];

external (cdecl) ctime_r(arg0:Pointer[time_t], arg1:Pointer[CChar]) : Pointer[CChar];

external __tzname : Array[Pointer[CChar], 2];

external __daylight : Int;

external __timezone : CLong;

external tzname : Array[Pointer[CChar], 2];

external (cdecl) tzset() : ;

external daylight : Int;

external timezone : CLong;

external (cdecl) stime(arg0:Pointer[time_t]) : Int;

external (cdecl) timegm(arg0:Pointer[Struct_tm]) : time_t;

external (cdecl) timelocal(arg0:Pointer[Struct_tm]) : time_t;

external (cdecl) dysize(arg0:Int) : Int;

external (cdecl) nanosleep(arg0:Pointer[Struct_timespec], arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) clock_getres(arg0:clockid_t, arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) clock_gettime(arg0:clockid_t, arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) clock_settime(arg0:clockid_t, arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) clock_nanosleep(arg0:clockid_t, arg1:Int, arg2:Pointer[Struct_timespec], arg3:Pointer[Struct_timespec]) : Int;

external (cdecl) clock_getcpuclockid(arg0:pid_t, arg1:Pointer[clockid_t]) : Int;

external (cdecl) timer_create(arg0:clockid_t, arg1:Pointer[Struct_sigevent], arg2:Pointer[timer_t]) : Int;

external (cdecl) timer_delete(arg0:timer_t) : Int;

external (cdecl) timer_settime(arg0:timer_t, arg1:Int, arg2:Pointer[Struct_itimerspec], arg3:Pointer[Struct_itimerspec]) : Int;

external (cdecl) timer_gettime(arg0:timer_t, arg1:Pointer[Struct_itimerspec]) : Int;

external (cdecl) timer_getoverrun(arg0:timer_t) : Int;

alias pthread_t = CULong;

alias Union_Unnamed6 = Union[
    /* __size */ Array[CChar, 56],
    /* __align */ CLong,
];

alias pthread_attr_t = Union_Unnamed6;

record Struct___pthread_internal_list (
    __prev : Pointer[Struct___pthread_internal_list],
    __next : Pointer[Struct___pthread_internal_list],
);

alias __pthread_list_t = Struct___pthread_internal_list;

alias Union_Unnamed7 = Union[
    /* __data */ Struct___pthread_mutex_s,
    /* __size */ Array[CChar, 40],
    /* __align */ CLong,
];

alias pthread_mutex_t = Union_Unnamed7;

alias Union_Unnamed8 = Union[
    /* __size */ Array[CChar, 4],
    /* __align */ Int,
];

alias pthread_mutexattr_t = Union_Unnamed8;

alias Union_Unnamed9 = Union[
    /* __data */ Struct_Unnamed10,
    /* __size */ Array[CChar, 48],
    /* __align */ Int64,
];

alias pthread_cond_t = Union_Unnamed9;

alias Union_Unnamed11 = Union[
    /* __size */ Array[CChar, 4],
    /* __align */ Int,
];

alias pthread_condattr_t = Union_Unnamed11;

alias pthread_key_t = UInt;

alias pthread_once_t = Int;

alias Union_Unnamed12 = Union[
    /* __data */ Struct_Unnamed13,
    /* __size */ Array[CChar, 56],
    /* __align */ CLong,
];

alias pthread_rwlock_t = Union_Unnamed12;

alias Union_Unnamed14 = Union[
    /* __size */ Array[CChar, 8],
    /* __align */ CLong,
];

alias pthread_rwlockattr_t = Union_Unnamed14;

alias pthread_spinlock_t = Int;

alias Union_Unnamed15 = Union[
    /* __size */ Array[CChar, 32],
    /* __align */ CLong,
];

alias pthread_barrier_t = Union_Unnamed15;

alias Union_Unnamed16 = Union[
    /* __size */ Array[CChar, 4],
    /* __align */ Int,
];

alias pthread_barrierattr_t = Union_Unnamed16;

alias __jmp_buf = Array[CLong, 8];

alias Enum_Unnamed17 = UInt;
alias PTHREAD_CREATE_JOINABLE = 0;
alias PTHREAD_CREATE_DETACHED = 1;

alias Enum_Unnamed18 = UInt;
alias PTHREAD_MUTEX_TIMED_NP = 0;
alias PTHREAD_MUTEX_RECURSIVE_NP = 1;
alias PTHREAD_MUTEX_ERRORCHECK_NP = 2;
alias PTHREAD_MUTEX_ADAPTIVE_NP = 3;
alias PTHREAD_MUTEX_NORMAL = 0;
alias PTHREAD_MUTEX_RECURSIVE = 1;
alias PTHREAD_MUTEX_ERRORCHECK = 2;
alias PTHREAD_MUTEX_DEFAULT = 0;

alias Enum_Unnamed19 = UInt;
alias PTHREAD_MUTEX_STALLED = 0;
alias PTHREAD_MUTEX_STALLED_NP = 0;
alias PTHREAD_MUTEX_ROBUST = 1;
alias PTHREAD_MUTEX_ROBUST_NP = 1;

alias Enum_Unnamed20 = UInt;
alias PTHREAD_RWLOCK_PREFER_READER_NP = 0;
alias PTHREAD_RWLOCK_PREFER_WRITER_NP = 1;
alias PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP = 2;
alias PTHREAD_RWLOCK_DEFAULT_NP = 0;

alias Enum_Unnamed21 = UInt;
alias PTHREAD_INHERIT_SCHED = 0;
alias PTHREAD_EXPLICIT_SCHED = 1;

alias Enum_Unnamed22 = UInt;
alias PTHREAD_SCOPE_SYSTEM = 0;
alias PTHREAD_SCOPE_PROCESS = 1;

alias Enum_Unnamed23 = UInt;
alias PTHREAD_PROCESS_PRIVATE = 0;
alias PTHREAD_PROCESS_SHARED = 1;

record Struct__pthread_cleanup_buffer (
    __routine : CCodePointer[[OpaquePointer],[]],
    __arg : OpaquePointer,
    __canceltype : Int,
    __prev : Pointer[Struct__pthread_cleanup_buffer],
);

alias Enum_Unnamed24 = UInt;
alias PTHREAD_CANCEL_ENABLE = 0;
alias PTHREAD_CANCEL_DISABLE = 1;

alias Enum_Unnamed25 = UInt;
alias PTHREAD_CANCEL_DEFERRED = 0;
alias PTHREAD_CANCEL_ASYNCHRONOUS = 1;

external (cdecl) pthread_create(arg0:Pointer[pthread_t], arg1:Pointer[pthread_attr_t], arg2:CCodePointer[[OpaquePointer],[OpaquePointer]], arg3:OpaquePointer) : Int;

external (cdecl) pthread_exit(arg0:OpaquePointer) : ;

external (cdecl) pthread_join(arg0:pthread_t, arg1:Pointer[OpaquePointer]) : Int;

external (cdecl) pthread_detach(arg0:pthread_t) : Int;

external (cdecl) pthread_self() : pthread_t;

external (cdecl) pthread_equal(arg0:pthread_t, arg1:pthread_t) : Int;

external (cdecl) pthread_attr_init(arg0:Pointer[pthread_attr_t]) : Int;

external (cdecl) pthread_attr_destroy(arg0:Pointer[pthread_attr_t]) : Int;

external (cdecl) pthread_attr_getdetachstate(arg0:Pointer[pthread_attr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_attr_setdetachstate(arg0:Pointer[pthread_attr_t], arg1:Int) : Int;

external (cdecl) pthread_attr_getguardsize(arg0:Pointer[pthread_attr_t], arg1:Pointer[size_t]) : Int;

external (cdecl) pthread_attr_setguardsize(arg0:Pointer[pthread_attr_t], arg1:size_t) : Int;

external (cdecl) pthread_attr_getschedparam(arg0:Pointer[pthread_attr_t], arg1:Pointer[Struct_sched_param]) : Int;

external (cdecl) pthread_attr_setschedparam(arg0:Pointer[pthread_attr_t], arg1:Pointer[Struct_sched_param]) : Int;

external (cdecl) pthread_attr_getschedpolicy(arg0:Pointer[pthread_attr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_attr_setschedpolicy(arg0:Pointer[pthread_attr_t], arg1:Int) : Int;

external (cdecl) pthread_attr_getinheritsched(arg0:Pointer[pthread_attr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_attr_setinheritsched(arg0:Pointer[pthread_attr_t], arg1:Int) : Int;

external (cdecl) pthread_attr_getscope(arg0:Pointer[pthread_attr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_attr_setscope(arg0:Pointer[pthread_attr_t], arg1:Int) : Int;

external (cdecl) pthread_attr_getstackaddr(arg0:Pointer[pthread_attr_t], arg1:Pointer[OpaquePointer]) : Int;

external (cdecl) pthread_attr_setstackaddr(arg0:Pointer[pthread_attr_t], arg1:OpaquePointer) : Int;

external (cdecl) pthread_attr_getstacksize(arg0:Pointer[pthread_attr_t], arg1:Pointer[size_t]) : Int;

external (cdecl) pthread_attr_setstacksize(arg0:Pointer[pthread_attr_t], arg1:size_t) : Int;

external (cdecl) pthread_attr_getstack(arg0:Pointer[pthread_attr_t], arg1:Pointer[OpaquePointer], arg2:Pointer[size_t]) : Int;

external (cdecl) pthread_attr_setstack(arg0:Pointer[pthread_attr_t], arg1:OpaquePointer, arg2:size_t) : Int;

external (cdecl) pthread_setschedparam(arg0:pthread_t, arg1:Int, arg2:Pointer[Struct_sched_param]) : Int;

external (cdecl) pthread_getschedparam(arg0:pthread_t, arg1:Pointer[Int], arg2:Pointer[Struct_sched_param]) : Int;

external (cdecl) pthread_setschedprio(arg0:pthread_t, arg1:Int) : Int;

external (cdecl) pthread_once(arg0:Pointer[pthread_once_t], arg1:CCodePointer[[],[]]) : Int;

external (cdecl) pthread_setcancelstate(arg0:Int, arg1:Pointer[Int]) : Int;

external (cdecl) pthread_setcanceltype(arg0:Int, arg1:Pointer[Int]) : Int;

external (cdecl) pthread_cancel(arg0:pthread_t) : Int;

external (cdecl) pthread_testcancel() : ;

record Struct_Unnamed26 (
    __cancel_jmp_buf : Array[Struct_Unnamed27, 1],
    __pad : Array[OpaquePointer, 4],
);

alias __pthread_unwind_buf_t = Struct_Unnamed26;

record Struct___pthread_cleanup_frame (
    __cancel_routine : CCodePointer[[OpaquePointer],[]],
    __cancel_arg : OpaquePointer,
    __do_it : Int,
    __cancel_type : Int,
);

external (cdecl) __pthread_register_cancel(arg0:Pointer[__pthread_unwind_buf_t]) : ;

external (cdecl) __pthread_unregister_cancel(arg0:Pointer[__pthread_unwind_buf_t]) : ;

external (cdecl) __pthread_unwind_next(arg0:Pointer[__pthread_unwind_buf_t]) : ;

alias Struct___jmp_buf_tag = Opaque;

external (cdecl) __sigsetjmp(arg0:Pointer[Struct___jmp_buf_tag], arg1:Int) : Int;

external (cdecl) pthread_mutex_init(arg0:Pointer[pthread_mutex_t], arg1:Pointer[pthread_mutexattr_t]) : Int;

external (cdecl) pthread_mutex_destroy(arg0:Pointer[pthread_mutex_t]) : Int;

external (cdecl) pthread_mutex_trylock(arg0:Pointer[pthread_mutex_t]) : Int;

external (cdecl) pthread_mutex_lock(arg0:Pointer[pthread_mutex_t]) : Int;

external (cdecl) pthread_mutex_timedlock(arg0:Pointer[pthread_mutex_t], arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) pthread_mutex_unlock(arg0:Pointer[pthread_mutex_t]) : Int;

external (cdecl) pthread_mutex_getprioceiling(arg0:Pointer[pthread_mutex_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_mutex_setprioceiling(arg0:Pointer[pthread_mutex_t], arg1:Int, arg2:Pointer[Int]) : Int;

external (cdecl) pthread_mutex_consistent(arg0:Pointer[pthread_mutex_t]) : Int;

external (cdecl) pthread_mutexattr_init(arg0:Pointer[pthread_mutexattr_t]) : Int;

external (cdecl) pthread_mutexattr_destroy(arg0:Pointer[pthread_mutexattr_t]) : Int;

external (cdecl) pthread_mutexattr_getpshared(arg0:Pointer[pthread_mutexattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_mutexattr_setpshared(arg0:Pointer[pthread_mutexattr_t], arg1:Int) : Int;

external (cdecl) pthread_mutexattr_gettype(arg0:Pointer[pthread_mutexattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_mutexattr_settype(arg0:Pointer[pthread_mutexattr_t], arg1:Int) : Int;

external (cdecl) pthread_mutexattr_getprotocol(arg0:Pointer[pthread_mutexattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_mutexattr_setprotocol(arg0:Pointer[pthread_mutexattr_t], arg1:Int) : Int;

external (cdecl) pthread_mutexattr_getprioceiling(arg0:Pointer[pthread_mutexattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_mutexattr_setprioceiling(arg0:Pointer[pthread_mutexattr_t], arg1:Int) : Int;

external (cdecl) pthread_mutexattr_getrobust(arg0:Pointer[pthread_mutexattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_mutexattr_setrobust(arg0:Pointer[pthread_mutexattr_t], arg1:Int) : Int;

external (cdecl) pthread_rwlock_init(arg0:Pointer[pthread_rwlock_t], arg1:Pointer[pthread_rwlockattr_t]) : Int;

external (cdecl) pthread_rwlock_destroy(arg0:Pointer[pthread_rwlock_t]) : Int;

external (cdecl) pthread_rwlock_rdlock(arg0:Pointer[pthread_rwlock_t]) : Int;

external (cdecl) pthread_rwlock_tryrdlock(arg0:Pointer[pthread_rwlock_t]) : Int;

external (cdecl) pthread_rwlock_timedrdlock(arg0:Pointer[pthread_rwlock_t], arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) pthread_rwlock_wrlock(arg0:Pointer[pthread_rwlock_t]) : Int;

external (cdecl) pthread_rwlock_trywrlock(arg0:Pointer[pthread_rwlock_t]) : Int;

external (cdecl) pthread_rwlock_timedwrlock(arg0:Pointer[pthread_rwlock_t], arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) pthread_rwlock_unlock(arg0:Pointer[pthread_rwlock_t]) : Int;

external (cdecl) pthread_rwlockattr_init(arg0:Pointer[pthread_rwlockattr_t]) : Int;

external (cdecl) pthread_rwlockattr_destroy(arg0:Pointer[pthread_rwlockattr_t]) : Int;

external (cdecl) pthread_rwlockattr_getpshared(arg0:Pointer[pthread_rwlockattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_rwlockattr_setpshared(arg0:Pointer[pthread_rwlockattr_t], arg1:Int) : Int;

external (cdecl) pthread_rwlockattr_getkind_np(arg0:Pointer[pthread_rwlockattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_rwlockattr_setkind_np(arg0:Pointer[pthread_rwlockattr_t], arg1:Int) : Int;

external (cdecl) pthread_cond_init(arg0:Pointer[pthread_cond_t], arg1:Pointer[pthread_condattr_t]) : Int;

external (cdecl) pthread_cond_destroy(arg0:Pointer[pthread_cond_t]) : Int;

external (cdecl) pthread_cond_signal(arg0:Pointer[pthread_cond_t]) : Int;

external (cdecl) pthread_cond_broadcast(arg0:Pointer[pthread_cond_t]) : Int;

external (cdecl) pthread_cond_wait(arg0:Pointer[pthread_cond_t], arg1:Pointer[pthread_mutex_t]) : Int;

external (cdecl) pthread_cond_timedwait(arg0:Pointer[pthread_cond_t], arg1:Pointer[pthread_mutex_t], arg2:Pointer[Struct_timespec]) : Int;

external (cdecl) pthread_condattr_init(arg0:Pointer[pthread_condattr_t]) : Int;

external (cdecl) pthread_condattr_destroy(arg0:Pointer[pthread_condattr_t]) : Int;

external (cdecl) pthread_condattr_getpshared(arg0:Pointer[pthread_condattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_condattr_setpshared(arg0:Pointer[pthread_condattr_t], arg1:Int) : Int;

external (cdecl) pthread_condattr_getclock(arg0:Pointer[pthread_condattr_t], arg1:Pointer[__clockid_t]) : Int;

external (cdecl) pthread_condattr_setclock(arg0:Pointer[pthread_condattr_t], arg1:__clockid_t) : Int;

external (cdecl) pthread_spin_init(arg0:Pointer[pthread_spinlock_t], arg1:Int) : Int;

external (cdecl) pthread_spin_destroy(arg0:Pointer[pthread_spinlock_t]) : Int;

external (cdecl) pthread_spin_lock(arg0:Pointer[pthread_spinlock_t]) : Int;

external (cdecl) pthread_spin_trylock(arg0:Pointer[pthread_spinlock_t]) : Int;

external (cdecl) pthread_spin_unlock(arg0:Pointer[pthread_spinlock_t]) : Int;

external (cdecl) pthread_barrier_init(arg0:Pointer[pthread_barrier_t], arg1:Pointer[pthread_barrierattr_t], arg2:UInt) : Int;

external (cdecl) pthread_barrier_destroy(arg0:Pointer[pthread_barrier_t]) : Int;

external (cdecl) pthread_barrier_wait(arg0:Pointer[pthread_barrier_t]) : Int;

external (cdecl) pthread_barrierattr_init(arg0:Pointer[pthread_barrierattr_t]) : Int;

external (cdecl) pthread_barrierattr_destroy(arg0:Pointer[pthread_barrierattr_t]) : Int;

external (cdecl) pthread_barrierattr_getpshared(arg0:Pointer[pthread_barrierattr_t], arg1:Pointer[Int]) : Int;

external (cdecl) pthread_barrierattr_setpshared(arg0:Pointer[pthread_barrierattr_t], arg1:Int) : Int;

external (cdecl) pthread_key_create(arg0:Pointer[pthread_key_t], arg1:CCodePointer[[OpaquePointer],[]]) : Int;

external (cdecl) pthread_key_delete(arg0:pthread_key_t) : Int;

external (cdecl) pthread_getspecific(arg0:pthread_key_t) : OpaquePointer;

external (cdecl) pthread_setspecific(arg0:pthread_key_t, arg1:OpaquePointer) : Int;

external (cdecl) pthread_getcpuclockid(arg0:pthread_t, arg1:Pointer[__clockid_t]) : Int;

external (cdecl) pthread_atfork(arg0:CCodePointer[[],[]], arg1:CCodePointer[[],[]], arg2:CCodePointer[[],[]]) : Int;

alias u_char = __u_char;

alias u_short = __u_short;

alias u_int = __u_int;

alias u_long = __u_long;

alias quad_t = __quad_t;

alias u_quad_t = __u_quad_t;

alias fsid_t = __fsid_t;

alias loff_t = __loff_t;

alias ino_t = __ino_t;

alias dev_t = __dev_t;

alias mode_t = __mode_t;

alias nlink_t = __nlink_t;

alias id_t = __id_t;

alias daddr_t = __daddr_t;

alias caddr_t = __caddr_t;

alias key_t = __key_t;

alias ulong = CULong;

alias ushort = UShort;

alias uint = UInt;

alias int8_t = CChar;

alias int16_t = Short;

alias int32_t = Int;

alias int64_t = CLong;

alias u_int8_t = CUChar;

alias u_int16_t = UShort;

alias u_int32_t = UInt;

alias u_int64_t = CULong;

alias register_t = CLong;

alias __sig_atomic_t = Int;

record Struct_Unnamed28 (
    __val : Array[CULong, 16],
);

alias __sigset_t = Struct_Unnamed28;

alias sigset_t = __sigset_t;

record Struct_timeval (
    tv_sec : __time_t,
    tv_usec : __suseconds_t,
);

alias suseconds_t = __suseconds_t;

alias __fd_mask = CLong;

record Struct_Unnamed29 (
    __fds_bits : Array[__fd_mask, 16],
);

alias fd_set = Struct_Unnamed29;

alias fd_mask = __fd_mask;

external (cdecl) select(arg0:Int, arg1:Pointer[fd_set], arg2:Pointer[fd_set], arg3:Pointer[fd_set], arg4:Pointer[Struct_timeval]) : Int;

external (cdecl) pselect(arg0:Int, arg1:Pointer[fd_set], arg2:Pointer[fd_set], arg3:Pointer[fd_set], arg4:Pointer[Struct_timespec], arg5:Pointer[__sigset_t]) : Int;

external (cdecl) gnu_dev_major(arg0:UInt64) : UInt;

external (cdecl) gnu_dev_minor(arg0:UInt64) : UInt;

external (cdecl) gnu_dev_makedev(arg0:UInt, arg1:UInt) : UInt64;

alias blksize_t = __blksize_t;

alias blkcnt_t = __blkcnt_t;

alias fsblkcnt_t = __fsblkcnt_t;

alias fsfilcnt_t = __fsfilcnt_t;

record Struct_flock (
    l_type : Short,
    l_whence : Short,
    l_start : __off_t,
    l_len : __off_t,
    l_pid : __pid_t,
);

record Struct_stat (
    st_dev : __dev_t,
    st_ino : __ino_t,
    st_nlink : __nlink_t,
    st_mode : __mode_t,
    st_uid : __uid_t,
    st_gid : __gid_t,
    __pad0 : Int,
    st_rdev : __dev_t,
    st_size : __off_t,
    st_blksize : __blksize_t,
    st_blocks : __blkcnt_t,
    st_atim : Struct_timespec,
    st_mtim : Struct_timespec,
    st_ctim : Struct_timespec,
    __unused : Array[CLong, 3],
);

external (cdecl) fcntl(arg0:Int, arg1:Int, ..) : Int;

external (cdecl) open(arg0:Pointer[CChar], arg1:Int, ..) : Int;

external (cdecl) openat(arg0:Int, arg1:Pointer[CChar], arg2:Int, ..) : Int;

external (cdecl) creat(arg0:Pointer[CChar], arg1:__mode_t) : Int;

external (cdecl) posix_fadvise(arg0:Int, arg1:__off_t, arg2:__off_t, arg3:Int) : Int;

external (cdecl) posix_fallocate(arg0:Int, arg1:__off_t, arg2:__off_t) : Int;

record Struct_timezone (
    tz_minuteswest : Int,
    tz_dsttime : Int,
);

alias __timezone_ptr_t = Pointer[Struct_timezone];

external (cdecl) gettimeofday(arg0:Pointer[Struct_timeval], arg1:__timezone_ptr_t) : Int;

external (cdecl) settimeofday(arg0:Pointer[Struct_timeval], arg1:Pointer[Struct_timezone]) : Int;

external (cdecl) adjtime(arg0:Pointer[Struct_timeval], arg1:Pointer[Struct_timeval]) : Int;

alias Enum___itimer_which = UInt;
alias ITIMER_REAL = 0;
alias ITIMER_VIRTUAL = 1;
alias ITIMER_PROF = 2;

record Struct_itimerval (
    it_interval : Struct_timeval,
    it_value : Struct_timeval,
);

alias __itimer_which_t = Int;

external (cdecl) getitimer(arg0:__itimer_which_t, arg1:Pointer[Struct_itimerval]) : Int;

external (cdecl) setitimer(arg0:__itimer_which_t, arg1:Pointer[Struct_itimerval], arg2:Pointer[Struct_itimerval]) : Int;

external (cdecl) utimes(arg0:Pointer[CChar], arg1:Pointer[Struct_timeval]) : Int;

external (cdecl) lutimes(arg0:Pointer[CChar], arg1:Pointer[Struct_timeval]) : Int;

external (cdecl) futimes(arg0:Int, arg1:Pointer[Struct_timeval]) : Int;

external (cdecl) stat(arg0:Pointer[CChar], arg1:Pointer[Struct_stat]) : Int;

external (cdecl) fstat(arg0:Int, arg1:Pointer[Struct_stat]) : Int;

external (cdecl) fstatat(arg0:Int, arg1:Pointer[CChar], arg2:Pointer[Struct_stat], arg3:Int) : Int;

external (cdecl) lstat(arg0:Pointer[CChar], arg1:Pointer[Struct_stat]) : Int;

external (cdecl) chmod(arg0:Pointer[CChar], arg1:__mode_t) : Int;

external (cdecl) lchmod(arg0:Pointer[CChar], arg1:__mode_t) : Int;

external (cdecl) fchmod(arg0:Int, arg1:__mode_t) : Int;

external (cdecl) fchmodat(arg0:Int, arg1:Pointer[CChar], arg2:__mode_t, arg3:Int) : Int;

external (cdecl) umask(arg0:__mode_t) : __mode_t;

external (cdecl) mkdir(arg0:Pointer[CChar], arg1:__mode_t) : Int;

external (cdecl) mkdirat(arg0:Int, arg1:Pointer[CChar], arg2:__mode_t) : Int;

external (cdecl) mknod(arg0:Pointer[CChar], arg1:__mode_t, arg2:__dev_t) : Int;

external (cdecl) mknodat(arg0:Int, arg1:Pointer[CChar], arg2:__mode_t, arg3:__dev_t) : Int;

external (cdecl) mkfifo(arg0:Pointer[CChar], arg1:__mode_t) : Int;

external (cdecl) mkfifoat(arg0:Int, arg1:Pointer[CChar], arg2:__mode_t) : Int;

external (cdecl) utimensat(arg0:Int, arg1:Pointer[CChar], arg2:Pointer[Struct_timespec], arg3:Int) : Int;

external (cdecl) futimens(arg0:Int, arg1:Pointer[Struct_timespec]) : Int;

external (cdecl) __fxstat(arg0:Int, arg1:Int, arg2:Pointer[Struct_stat]) : Int;

external (cdecl) __xstat(arg0:Int, arg1:Pointer[CChar], arg2:Pointer[Struct_stat]) : Int;

external (cdecl) __lxstat(arg0:Int, arg1:Pointer[CChar], arg2:Pointer[Struct_stat]) : Int;

external (cdecl) __fxstatat(arg0:Int, arg1:Int, arg2:Pointer[CChar], arg3:Pointer[Struct_stat], arg4:Int) : Int;

external (cdecl) __xmknod(arg0:Int, arg1:Pointer[CChar], arg2:__mode_t, arg3:Pointer[__dev_t]) : Int;

external (cdecl) __xmknodat(arg0:Int, arg1:Int, arg2:Pointer[CChar], arg3:__mode_t, arg4:Pointer[__dev_t]) : Int;

external (cdecl) mmap(arg0:OpaquePointer, arg1:size_t, arg2:Int, arg3:Int, arg4:Int, arg5:__off_t) : OpaquePointer;

external (cdecl) munmap(arg0:OpaquePointer, arg1:size_t) : Int;

external (cdecl) mprotect(arg0:OpaquePointer, arg1:size_t, arg2:Int) : Int;

external (cdecl) msync(arg0:OpaquePointer, arg1:size_t, arg2:Int) : Int;

external (cdecl) madvise(arg0:OpaquePointer, arg1:size_t, arg2:Int) : Int;

external (cdecl) posix_madvise(arg0:OpaquePointer, arg1:size_t, arg2:Int) : Int;

external (cdecl) mlock(arg0:OpaquePointer, arg1:size_t) : Int;

external (cdecl) munlock(arg0:OpaquePointer, arg1:size_t) : Int;

external (cdecl) mlockall(arg0:Int) : Int;

external (cdecl) munlockall() : Int;

external (cdecl) mincore(arg0:OpaquePointer, arg1:size_t, arg2:Pointer[CUChar]) : Int;

external (cdecl) shm_open(arg0:Pointer[CChar], arg1:Int, arg2:mode_t) : Int;

external (cdecl) shm_unlink(arg0:Pointer[CChar]) : Int;

record Struct_iovec (
    iov_base : OpaquePointer,
    iov_len : size_t,
);

external (cdecl) readv(arg0:Int, arg1:Pointer[Struct_iovec], arg2:Int) : ssize_t;

external (cdecl) writev(arg0:Int, arg1:Pointer[Struct_iovec], arg2:Int) : ssize_t;

external (cdecl) preadv(arg0:Int, arg1:Pointer[Struct_iovec], arg2:Int, arg3:__off_t) : ssize_t;

external (cdecl) pwritev(arg0:Int, arg1:Pointer[Struct_iovec], arg2:Int, arg3:__off_t) : ssize_t;

alias Enum___socket_type = UInt;
alias SOCK_STREAM = 1;
alias SOCK_DGRAM = 2;
alias SOCK_RAW = 3;
alias SOCK_RDM = 4;
alias SOCK_SEQPACKET = 5;
alias SOCK_DCCP = 6;
alias SOCK_PACKET = 10;
alias SOCK_CLOEXEC = 524288;
alias SOCK_NONBLOCK = 2048;

alias sa_family_t = UShort;

record Struct_sockaddr (
    sa_family : sa_family_t,
    sa_data : Array[CChar, 14],
);

record Struct_sockaddr_storage (
    ss_family : sa_family_t,
    __ss_align : CULong,
    __ss_padding : Array[CChar, 112],
);

alias Enum_Unnamed30 = UInt;
alias MSG_OOB = 1;
alias MSG_PEEK = 2;
alias MSG_DONTROUTE = 4;
alias MSG_CTRUNC = 8;
alias MSG_PROXY = 16;
alias MSG_TRUNC = 32;
alias MSG_DONTWAIT = 64;
alias MSG_EOR = 128;
alias MSG_WAITALL = 256;
alias MSG_FIN = 512;
alias MSG_SYN = 1024;
alias MSG_CONFIRM = 2048;
alias MSG_RST = 4096;
alias MSG_ERRQUEUE = 8192;
alias MSG_NOSIGNAL = 16384;
alias MSG_MORE = 32768;
alias MSG_WAITFORONE = 65536;
alias MSG_CMSG_CLOEXEC = 1073741824;

record Struct_msghdr (
    msg_name : OpaquePointer,
    msg_namelen : socklen_t,
    msg_iov : Pointer[Struct_iovec],
    msg_iovlen : size_t,
    msg_control : OpaquePointer,
    msg_controllen : size_t,
    msg_flags : Int,
);

record Struct_cmsghdr (
    cmsg_len : size_t,
    cmsg_level : Int,
    cmsg_type : Int,
    __cmsg_data : Opaque /* unknown NoDeclFound  */,
);

external (cdecl) __cmsg_nxthdr(arg0:Pointer[Struct_msghdr], arg1:Pointer[Struct_cmsghdr]) : Pointer[Struct_cmsghdr];

alias Enum_Unnamed31 = UInt;
alias SCM_RIGHTS = 1;

record Struct_linger (
    l_onoff : Int,
    l_linger : Int,
);

alias Struct_mmsghdr = Opaque;

external (cdecl) recvmmsg(arg0:Int, arg1:Pointer[Struct_mmsghdr], arg2:UInt, arg3:Int, arg4:Pointer[Struct_timespec]) : Int;

external (cdecl) sendmmsg(arg0:Int, arg1:Pointer[Struct_mmsghdr], arg2:UInt, arg3:Int) : Int;

record Struct_osockaddr (
    sa_family : UShort,
    sa_data : Array[CUChar, 14],
);

alias Enum_Unnamed32 = UInt;
alias SHUT_RD = 0;
alias SHUT_WR = 1;
alias SHUT_RDWR = 2;

external (cdecl) socket(arg0:Int, arg1:Int, arg2:Int) : Int;

external (cdecl) socketpair(arg0:Int, arg1:Int, arg2:Int, arg3:Pointer[Int]) : Int;

external (cdecl) bind(arg0:Int, arg1:Pointer[Struct_sockaddr], arg2:socklen_t) : Int;

external (cdecl) getsockname(arg0:Int, arg1:Pointer[Struct_sockaddr], arg2:Pointer[socklen_t]) : Int;

external (cdecl) connect(arg0:Int, arg1:Pointer[Struct_sockaddr], arg2:socklen_t) : Int;

external (cdecl) getpeername(arg0:Int, arg1:Pointer[Struct_sockaddr], arg2:Pointer[socklen_t]) : Int;

external (cdecl) send(arg0:Int, arg1:OpaquePointer, arg2:size_t, arg3:Int) : ssize_t;

external (cdecl) recv(arg0:Int, arg1:OpaquePointer, arg2:size_t, arg3:Int) : ssize_t;

external (cdecl) sendto(arg0:Int, arg1:OpaquePointer, arg2:size_t, arg3:Int, arg4:Pointer[Struct_sockaddr], arg5:socklen_t) : ssize_t;

external (cdecl) recvfrom(arg0:Int, arg1:OpaquePointer, arg2:size_t, arg3:Int, arg4:Pointer[Struct_sockaddr], arg5:Pointer[socklen_t]) : ssize_t;

external (cdecl) sendmsg(arg0:Int, arg1:Pointer[Struct_msghdr], arg2:Int) : ssize_t;

external (cdecl) recvmsg(arg0:Int, arg1:Pointer[Struct_msghdr], arg2:Int) : ssize_t;

external (cdecl) getsockopt(arg0:Int, arg1:Int, arg2:Int, arg3:OpaquePointer, arg4:Pointer[socklen_t]) : Int;

external (cdecl) setsockopt(arg0:Int, arg1:Int, arg2:Int, arg3:OpaquePointer, arg4:socklen_t) : Int;

external (cdecl) listen(arg0:Int, arg1:Int) : Int;

external (cdecl) accept(arg0:Int, arg1:Pointer[Struct_sockaddr], arg2:Pointer[socklen_t]) : Int;

external (cdecl) shutdown(arg0:Int, arg1:Int) : Int;

external (cdecl) sockatmark(arg0:Int) : Int;

external (cdecl) isfdtype(arg0:Int, arg1:Int) : Int;

external (cdecl) __sigismember(arg0:Pointer[__sigset_t], arg1:Int) : Int;

external (cdecl) __sigaddset(arg0:Pointer[__sigset_t], arg1:Int) : Int;

external (cdecl) __sigdelset(arg0:Pointer[__sigset_t], arg1:Int) : Int;

alias sig_atomic_t = __sig_atomic_t;

alias Union_sigval = Union[
    /* sival_int */ Int,
    /* sival_ptr */ OpaquePointer,
];

alias sigval_t = Union_sigval;

record Struct_siginfo (
    si_signo : Int,
    si_errno : Int,
    si_code : Int,
    _sifields : Union_Unnamed33,
);

alias siginfo_t = Struct_siginfo;

alias Enum_Unnamed34 = Int;
alias SI_ASYNCNL = -60;
alias SI_TKILL = -6;
alias SI_SIGIO = -5;
alias SI_ASYNCIO = -4;
alias SI_MESGQ = -3;
alias SI_TIMER = -2;
alias SI_QUEUE = -1;
alias SI_USER = 0;
alias SI_KERNEL = 128;

alias Enum_Unnamed35 = UInt;
alias ILL_ILLOPC = 1;
alias ILL_ILLOPN = 2;
alias ILL_ILLADR = 3;
alias ILL_ILLTRP = 4;
alias ILL_PRVOPC = 5;
alias ILL_PRVREG = 6;
alias ILL_COPROC = 7;
alias ILL_BADSTK = 8;

alias Enum_Unnamed36 = UInt;
alias FPE_INTDIV = 1;
alias FPE_INTOVF = 2;
alias FPE_FLTDIV = 3;
alias FPE_FLTOVF = 4;
alias FPE_FLTUND = 5;
alias FPE_FLTRES = 6;
alias FPE_FLTINV = 7;
alias FPE_FLTSUB = 8;

alias Enum_Unnamed37 = UInt;
alias SEGV_MAPERR = 1;
alias SEGV_ACCERR = 2;

alias Enum_Unnamed38 = UInt;
alias BUS_ADRALN = 1;
alias BUS_ADRERR = 2;
alias BUS_OBJERR = 3;

alias Enum_Unnamed39 = UInt;
alias TRAP_BRKPT = 1;
alias TRAP_TRACE = 2;

alias Enum_Unnamed40 = UInt;
alias CLD_EXITED = 1;
alias CLD_KILLED = 2;
alias CLD_DUMPED = 3;
alias CLD_TRAPPED = 4;
alias CLD_STOPPED = 5;
alias CLD_CONTINUED = 6;

alias Enum_Unnamed41 = UInt;
alias POLL_IN = 1;
alias POLL_OUT = 2;
alias POLL_MSG = 3;
alias POLL_ERR = 4;
alias POLL_PRI = 5;
alias POLL_HUP = 6;

record Struct_sigevent (
    sigev_value : sigval_t,
    sigev_signo : Int,
    sigev_notify : Int,
    _sigev_un : Union_Unnamed42,
);

alias sigevent_t = Struct_sigevent;

alias Enum_Unnamed43 = UInt;
alias SIGEV_SIGNAL = 0;
alias SIGEV_NONE = 1;
alias SIGEV_THREAD = 2;
alias SIGEV_THREAD_ID = 4;

alias __sighandler_t = CCodePointer[[Int],[]];

external (cdecl) __sysv_signal(arg0:Int, arg1:__sighandler_t) : __sighandler_t;

external (cdecl) signal(arg0:Int, arg1:__sighandler_t) : __sighandler_t;

external (cdecl) kill(arg0:__pid_t, arg1:Int) : Int;

external (cdecl) killpg(arg0:__pid_t, arg1:Int) : Int;

external (cdecl) raise(arg0:Int) : Int;

external (cdecl) ssignal(arg0:Int, arg1:__sighandler_t) : __sighandler_t;

external (cdecl) gsignal(arg0:Int) : Int;

external (cdecl) psignal(arg0:Int, arg1:Pointer[CChar]) : ;

external (cdecl) psiginfo(arg0:Pointer[siginfo_t], arg1:Pointer[CChar]) : ;

external (cdecl) __sigpause(arg0:Int, arg1:Int) : Int;

external (cdecl) sigblock(arg0:Int) : Int;

external (cdecl) sigsetmask(arg0:Int) : Int;

external (cdecl) siggetmask() : Int;

alias sig_t = __sighandler_t;

external (cdecl) sigemptyset(arg0:Pointer[sigset_t]) : Int;

external (cdecl) sigfillset(arg0:Pointer[sigset_t]) : Int;

external (cdecl) sigaddset(arg0:Pointer[sigset_t], arg1:Int) : Int;

external (cdecl) sigdelset(arg0:Pointer[sigset_t], arg1:Int) : Int;

external (cdecl) sigismember(arg0:Pointer[sigset_t], arg1:Int) : Int;

record Struct_sigaction (
    __sigaction_handler : Union_Unnamed44,
    sa_mask : __sigset_t,
    sa_flags : Int,
    sa_restorer : CCodePointer[[],[]],
);

external (cdecl) sigprocmask(arg0:Int, arg1:Pointer[sigset_t], arg2:Pointer[sigset_t]) : Int;

external (cdecl) sigsuspend(arg0:Pointer[sigset_t]) : Int;

external (cdecl) sigaction(arg0:Int, arg1:Pointer[Struct_sigaction], arg2:Pointer[Struct_sigaction]) : Int;

external (cdecl) sigpending(arg0:Pointer[sigset_t]) : Int;

external (cdecl) sigwait(arg0:Pointer[sigset_t], arg1:Pointer[Int]) : Int;

external (cdecl) sigwaitinfo(arg0:Pointer[sigset_t], arg1:Pointer[siginfo_t]) : Int;

external (cdecl) sigtimedwait(arg0:Pointer[sigset_t], arg1:Pointer[siginfo_t], arg2:Pointer[Struct_timespec]) : Int;

external (cdecl) sigqueue(arg0:__pid_t, arg1:Int, arg2:Union_sigval) : Int;

external _sys_siglist : Array[Pointer[CChar], 65];

external sys_siglist : Array[Pointer[CChar], 65];

record Struct_sigvec (
    sv_handler : __sighandler_t,
    sv_mask : Int,
    sv_flags : Int,
);

external (cdecl) sigvec(arg0:Int, arg1:Pointer[Struct_sigvec], arg2:Pointer[Struct_sigvec]) : Int;

record Struct__fpreg (
    significand : Array[UShort, 4],
    exponent : UShort,
);

record Struct__fpxreg (
    significand : Array[UShort, 4],
    exponent : UShort,
    padding : Array[UShort, 3],
);

record Struct__xmmreg (
    element : Array[__uint32_t, 4],
);

record Struct__fpstate (
    cwd : __uint16_t,
    swd : __uint16_t,
    ftw : __uint16_t,
    fop : __uint16_t,
    rip : __uint64_t,
    rdp : __uint64_t,
    mxcsr : __uint32_t,
    mxcr_mask : __uint32_t,
    _st : Array[Struct__fpxreg, 8],
    _xmm : Array[Struct__xmmreg, 16],
    padding : Array[__uint32_t, 24],
);

record Struct_sigcontext (
    r8 : CULong,
    r9 : CULong,
    r10 : CULong,
    r11 : CULong,
    r12 : CULong,
    r13 : CULong,
    r14 : CULong,
    r15 : CULong,
    rdi : CULong,
    rsi : CULong,
    rbp : CULong,
    rbx : CULong,
    rdx : CULong,
    rax : CULong,
    rcx : CULong,
    rsp : CULong,
    rip : CULong,
    eflags : CULong,
    cs : UShort,
    gs : UShort,
    fs : UShort,
    __pad0 : UShort,
    err : CULong,
    trapno : CULong,
    oldmask : CULong,
    cr2 : CULong,
    fpstate : Pointer[Struct__fpstate],
    __reserved1 : Array[CULong, 8],
);

external (cdecl) sigreturn(arg0:Pointer[Struct_sigcontext]) : Int;

external (cdecl) siginterrupt(arg0:Int, arg1:Int) : Int;

record Struct_sigstack (
    ss_sp : OpaquePointer,
    ss_onstack : Int,
);

alias Enum_Unnamed45 = UInt;
alias SS_ONSTACK = 1;
alias SS_DISABLE = 2;

record Struct_sigaltstack (
    ss_sp : OpaquePointer,
    ss_flags : Int,
    ss_size : size_t,
);

alias stack_t = Struct_sigaltstack;

alias greg_t = CLong;

alias gregset_t = Array[greg_t, 23];

record Struct__libc_fpxreg (
    significand : Array[UShort, 4],
    exponent : UShort,
    padding : Array[UShort, 3],
);

record Struct__libc_xmmreg (
    element : Array[__uint32_t, 4],
);

record Struct__libc_fpstate (
    cwd : __uint16_t,
    swd : __uint16_t,
    ftw : __uint16_t,
    fop : __uint16_t,
    rip : __uint64_t,
    rdp : __uint64_t,
    mxcsr : __uint32_t,
    mxcr_mask : __uint32_t,
    _st : Array[Struct__libc_fpxreg, 8],
    _xmm : Array[Struct__libc_xmmreg, 16],
    padding : Array[__uint32_t, 24],
);

alias fpregset_t = Pointer[Struct__libc_fpstate];

record Struct_Unnamed46 (
    gregs : gregset_t,
    fpregs : fpregset_t,
    __reserved1 : Array[CULong, 8],
);

alias mcontext_t = Struct_Unnamed46;

record Struct_ucontext (
    uc_flags : CULong,
    uc_link : Pointer[Struct_ucontext],
    uc_stack : stack_t,
    uc_mcontext : mcontext_t,
    uc_sigmask : __sigset_t,
    __fpregs_mem : Struct__libc_fpstate,
);

alias ucontext_t = Struct_ucontext;

external (cdecl) sigstack(arg0:Pointer[Struct_sigstack], arg1:Pointer[Struct_sigstack]) : Int;

external (cdecl) sigaltstack(arg0:Pointer[Struct_sigaltstack], arg1:Pointer[Struct_sigaltstack]) : Int;

external (cdecl) pthread_sigmask(arg0:Int, arg1:Pointer[__sigset_t], arg2:Pointer[__sigset_t]) : Int;

external (cdecl) pthread_kill(arg0:pthread_t, arg1:Int) : Int;

external (cdecl) __libc_current_sigrtmin() : Int;

external (cdecl) __libc_current_sigrtmax() : Int;

alias Enum___rlimit_resource = UInt;
alias RLIMIT_CPU = 0;
alias RLIMIT_FSIZE = 1;
alias RLIMIT_DATA = 2;
alias RLIMIT_STACK = 3;
alias RLIMIT_CORE = 4;
alias __RLIMIT_RSS = 5;
alias RLIMIT_NOFILE = 7;
alias __RLIMIT_OFILE = 7;
alias RLIMIT_AS = 9;
alias __RLIMIT_NPROC = 6;
alias __RLIMIT_MEMLOCK = 8;
alias __RLIMIT_LOCKS = 10;
alias __RLIMIT_SIGPENDING = 11;
alias __RLIMIT_MSGQUEUE = 12;
alias __RLIMIT_NICE = 13;
alias __RLIMIT_RTPRIO = 14;
alias __RLIMIT_RTTIME = 15;
alias __RLIMIT_NLIMITS = 16;
alias __RLIM_NLIMITS = 16;

alias rlim_t = __rlim_t;

record Struct_rlimit (
    rlim_cur : rlim_t,
    rlim_max : rlim_t,
);

alias Enum___rusage_who = Int;
alias RUSAGE_SELF = 0;
alias RUSAGE_CHILDREN = -1;

record Struct_rusage (
    ru_utime : Struct_timeval,
    ru_stime : Struct_timeval,
    ru_maxrss : CLong,
    ru_ixrss : CLong,
    ru_idrss : CLong,
    ru_isrss : CLong,
    ru_minflt : CLong,
    ru_majflt : CLong,
    ru_nswap : CLong,
    ru_inblock : CLong,
    ru_oublock : CLong,
    ru_msgsnd : CLong,
    ru_msgrcv : CLong,
    ru_nsignals : CLong,
    ru_nvcsw : CLong,
    ru_nivcsw : CLong,
);

alias Enum___priority_which = UInt;
alias PRIO_PROCESS = 0;
alias PRIO_PGRP = 1;
alias PRIO_USER = 2;

alias __rlimit_resource_t = Int;

alias __rusage_who_t = Int;

alias __priority_which_t = Int;

external (cdecl) getrlimit(arg0:__rlimit_resource_t, arg1:Pointer[Struct_rlimit]) : Int;

external (cdecl) setrlimit(arg0:__rlimit_resource_t, arg1:Pointer[Struct_rlimit]) : Int;

external (cdecl) getrusage(arg0:__rusage_who_t, arg1:Pointer[Struct_rusage]) : Int;

external (cdecl) getpriority(arg0:__priority_which_t, arg1:id_t) : Int;

external (cdecl) setpriority(arg0:__priority_which_t, arg1:id_t, arg2:Int) : Int;

alias Union_Unnamed47 = Union[
    /* __uptr */ Pointer[Union_wait],
    /* __iptr */ Pointer[Int],
];

alias __WAIT_STATUS = Union_Unnamed47;

alias Union_wait = Union[
    /* w_status */ Int,
    /* __wait_terminated */ Struct_Unnamed48,
    /* __wait_stopped */ Struct_Unnamed49,
];

alias Enum_Unnamed50 = UInt;
alias P_ALL = 0;
alias P_PID = 1;
alias P_PGID = 2;

alias idtype_t = Opaque /* unknown EnumDecl  */;

external (cdecl) wait(arg0:__WAIT_STATUS) : __pid_t;

external (cdecl) waitpid(arg0:__pid_t, arg1:Pointer[Int], arg2:Int) : __pid_t;

external (cdecl) waitid(arg0:idtype_t, arg1:__id_t, arg2:Pointer[siginfo_t], arg3:Int) : Int;

external (cdecl) wait3(arg0:__WAIT_STATUS, arg1:Int, arg2:Pointer[Struct_rusage]) : __pid_t;

external (cdecl) wait4(arg0:__pid_t, arg1:__WAIT_STATUS, arg2:Int, arg3:Pointer[Struct_rusage]) : __pid_t;

alias uint8_t = CUChar;

alias uint16_t = UShort;

alias uint32_t = UInt;

alias uint64_t = CULong;

alias int_least8_t = CChar;

alias int_least16_t = Short;

alias int_least32_t = Int;

alias int_least64_t = CLong;

alias uint_least8_t = CUChar;

alias uint_least16_t = UShort;

alias uint_least32_t = UInt;

alias uint_least64_t = CULong;

alias int_fast8_t = CChar;

alias int_fast16_t = CLong;

alias int_fast32_t = CLong;

alias int_fast64_t = CLong;

alias uint_fast8_t = CUChar;

alias uint_fast16_t = CULong;

alias uint_fast32_t = CULong;

alias uint_fast64_t = CULong;

alias uintptr_t = CULong;

alias intmax_t = CLong;

alias uintmax_t = CULong;

alias Enum_Unnamed51 = UInt;
alias EPOLL_CLOEXEC = 524288;
alias EPOLL_NONBLOCK = 2048;

alias Enum_EPOLL_EVENTS = Int;
alias EPOLLIN = 1;
alias EPOLLPRI = 2;
alias EPOLLOUT = 4;
alias EPOLLRDNORM = 64;
alias EPOLLRDBAND = 128;
alias EPOLLWRNORM = 256;
alias EPOLLWRBAND = 512;
alias EPOLLMSG = 1024;
alias EPOLLERR = 8;
alias EPOLLHUP = 16;
alias EPOLLRDHUP = 8192;
alias EPOLLONESHOT = 1073741824;
alias EPOLLET = -2147483648;

alias Union_epoll_data = Union[
    /* ptr */ OpaquePointer,
    /* fd */ Int,
    /* u32 */ uint32_t,
    /* u64 */ uint64_t,
];

alias epoll_data_t = Union_epoll_data;

record Struct_epoll_event (
    events : uint32_t,
    data : epoll_data_t,
);

external (cdecl) epoll_create(arg0:Int) : Int;

external (cdecl) epoll_create1(arg0:Int) : Int;

external (cdecl) epoll_ctl(arg0:Int, arg1:Int, arg2:Int, arg3:Pointer[Struct_epoll_event]) : Int;

external (cdecl) epoll_wait(arg0:Int, arg1:Pointer[Struct_epoll_event], arg2:Int, arg3:Int) : Int;

external (cdecl) epoll_pwait(arg0:Int, arg1:Pointer[Struct_epoll_event], arg2:Int, arg3:Int, arg4:Pointer[__sigset_t]) : Int;

record Struct_dirent (
    d_ino : __ino_t,
    d_off : __off_t,
    d_reclen : UShort,
    d_type : CUChar,
    d_name : Array[CChar, 256],
);

alias Enum_Unnamed52 = UInt;
alias DT_UNKNOWN = 0;
alias DT_FIFO = 1;
alias DT_CHR = 2;
alias DT_DIR = 4;
alias DT_BLK = 6;
alias DT_REG = 8;
alias DT_LNK = 10;
alias DT_SOCK = 12;
alias DT_WHT = 14;

alias Struct___dirstream = Opaque;

alias DIR = Struct___dirstream;

external (cdecl) opendir(arg0:Pointer[CChar]) : Pointer[DIR];

external (cdecl) fdopendir(arg0:Int) : Pointer[DIR];

external (cdecl) closedir(arg0:Pointer[DIR]) : Int;

external (cdecl) readdir(arg0:Pointer[DIR]) : Pointer[Struct_dirent];

external (cdecl) readdir_r(arg0:Pointer[DIR], arg1:Pointer[Struct_dirent], arg2:Pointer[Pointer[Struct_dirent]]) : Int;

external (cdecl) rewinddir(arg0:Pointer[DIR]) : ;

external (cdecl) seekdir(arg0:Pointer[DIR], arg1:CLong) : ;

external (cdecl) telldir(arg0:Pointer[DIR]) : CLong;

external (cdecl) dirfd(arg0:Pointer[DIR]) : Int;

external (cdecl) scandir(arg0:Pointer[CChar], arg1:Pointer[Pointer[Pointer[Struct_dirent]]], arg2:CCodePointer[[Pointer[Struct_dirent]],[Int]], arg3:CCodePointer[[Pointer[Pointer[Struct_dirent]], Pointer[Pointer[Struct_dirent]]],[Int]]) : Int;

external (cdecl) alphasort(arg0:Pointer[Pointer[Struct_dirent]], arg1:Pointer[Pointer[Struct_dirent]]) : Int;

external (cdecl) getdirentries(arg0:Int, arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[__off_t]) : __ssize_t;

alias wchar_t = Int;

record Struct_Unnamed53 (
    quot : Int,
    rem : Int,
);

alias div_t = Struct_Unnamed53;

record Struct_Unnamed54 (
    quot : CLong,
    rem : CLong,
);

alias ldiv_t = Struct_Unnamed54;

record Struct_Unnamed55 (
    quot : Int64,
    rem : Int64,
);

alias lldiv_t = Struct_Unnamed55;

external (cdecl) __ctype_get_mb_cur_max() : size_t;

external (cdecl) atof(arg0:Pointer[CChar]) : Double;

external (cdecl) atoi(arg0:Pointer[CChar]) : Int;

external (cdecl) atol(arg0:Pointer[CChar]) : CLong;

external (cdecl) atoll(arg0:Pointer[CChar]) : Int64;

external (cdecl) strtod(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]]) : Double;

external (cdecl) strtof(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]]) : Float;

external (cdecl) strtold(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]]) : LongDouble;

external (cdecl) strtol(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Int) : CLong;

external (cdecl) strtoul(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Int) : CULong;

external (cdecl) strtoq(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Int) : Int64;

external (cdecl) strtouq(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Int) : UInt64;

external (cdecl) strtoll(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Int) : Int64;

external (cdecl) strtoull(arg0:Pointer[CChar], arg1:Pointer[Pointer[CChar]], arg2:Int) : UInt64;

external (cdecl) l64a(arg0:CLong) : Pointer[CChar];

external (cdecl) a64l(arg0:Pointer[CChar]) : CLong;

external (cdecl) random() : CLong;

external (cdecl) srandom(arg0:UInt) : ;

external (cdecl) initstate(arg0:UInt, arg1:Pointer[CChar], arg2:size_t) : Pointer[CChar];

external (cdecl) setstate(arg0:Pointer[CChar]) : Pointer[CChar];

record Struct_random_data (
    fptr : Pointer[int32_t],
    rptr : Pointer[int32_t],
    state : Pointer[int32_t],
    rand_type : Int,
    rand_deg : Int,
    rand_sep : Int,
    end_ptr : Pointer[int32_t],
);

external (cdecl) random_r(arg0:Pointer[Struct_random_data], arg1:Pointer[int32_t]) : Int;

external (cdecl) srandom_r(arg0:UInt, arg1:Pointer[Struct_random_data]) : Int;

external (cdecl) initstate_r(arg0:UInt, arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[Struct_random_data]) : Int;

external (cdecl) setstate_r(arg0:Pointer[CChar], arg1:Pointer[Struct_random_data]) : Int;

external (cdecl) rand() : Int;

external (cdecl) srand(arg0:UInt) : ;

external (cdecl) rand_r(arg0:Pointer[UInt]) : Int;

external (cdecl) drand48() : Double;

external (cdecl) erand48(arg0:Pointer[UShort]) : Double;

external (cdecl) lrand48() : CLong;

external (cdecl) nrand48(arg0:Pointer[UShort]) : CLong;

external (cdecl) mrand48() : CLong;

external (cdecl) jrand48(arg0:Pointer[UShort]) : CLong;

external (cdecl) srand48(arg0:CLong) : ;

external (cdecl) seed48(arg0:Pointer[UShort]) : Pointer[UShort];

external (cdecl) lcong48(arg0:Pointer[UShort]) : ;

record Struct_drand48_data (
    __x : Array[UShort, 3],
    __old_x : Array[UShort, 3],
    __c : UShort,
    __init : UShort,
    __a : UInt64,
);

external (cdecl) drand48_r(arg0:Pointer[Struct_drand48_data], arg1:Pointer[Double]) : Int;

external (cdecl) erand48_r(arg0:Pointer[UShort], arg1:Pointer[Struct_drand48_data], arg2:Pointer[Double]) : Int;

external (cdecl) lrand48_r(arg0:Pointer[Struct_drand48_data], arg1:Pointer[CLong]) : Int;

external (cdecl) nrand48_r(arg0:Pointer[UShort], arg1:Pointer[Struct_drand48_data], arg2:Pointer[CLong]) : Int;

external (cdecl) mrand48_r(arg0:Pointer[Struct_drand48_data], arg1:Pointer[CLong]) : Int;

external (cdecl) jrand48_r(arg0:Pointer[UShort], arg1:Pointer[Struct_drand48_data], arg2:Pointer[CLong]) : Int;

external (cdecl) srand48_r(arg0:CLong, arg1:Pointer[Struct_drand48_data]) : Int;

external (cdecl) seed48_r(arg0:Pointer[UShort], arg1:Pointer[Struct_drand48_data]) : Int;

external (cdecl) lcong48_r(arg0:Pointer[UShort], arg1:Pointer[Struct_drand48_data]) : Int;

external (cdecl) malloc(arg0:size_t) : OpaquePointer;

external (cdecl) calloc(arg0:size_t, arg1:size_t) : OpaquePointer;

external (cdecl) realloc(arg0:OpaquePointer, arg1:size_t) : OpaquePointer;

external (cdecl) free(arg0:OpaquePointer) : ;

external (cdecl) cfree(arg0:OpaquePointer) : ;

external (cdecl) alloca(arg0:size_t) : OpaquePointer;

external (cdecl) valloc(arg0:size_t) : OpaquePointer;

external (cdecl) posix_memalign(arg0:Pointer[OpaquePointer], arg1:size_t, arg2:size_t) : Int;

external (cdecl) abort() : ;

external (cdecl) atexit(arg0:CCodePointer[[],[]]) : Int;

external (cdecl) on_exit(arg0:CCodePointer[[Int, OpaquePointer],[]], arg1:OpaquePointer) : Int;

external (cdecl) exit(arg0:Int) : ;

external (cdecl) _Exit(arg0:Int) : ;

external (cdecl) getenv(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) __secure_getenv(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) putenv(arg0:Pointer[CChar]) : Int;

external (cdecl) setenv(arg0:Pointer[CChar], arg1:Pointer[CChar], arg2:Int) : Int;

external (cdecl) unsetenv(arg0:Pointer[CChar]) : Int;

external (cdecl) clearenv() : Int;

external (cdecl) mktemp(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) mkstemp(arg0:Pointer[CChar]) : Int;

external (cdecl) mkstemps(arg0:Pointer[CChar], arg1:Int) : Int;

external (cdecl) mkdtemp(arg0:Pointer[CChar]) : Pointer[CChar];

external (cdecl) system(arg0:Pointer[CChar]) : Int;

external (cdecl) realpath(arg0:Pointer[CChar], arg1:Pointer[CChar]) : Pointer[CChar];

alias __compar_fn_t = CCodePointer[[OpaquePointer, OpaquePointer],[Int]];

external (cdecl) bsearch(arg0:OpaquePointer, arg1:OpaquePointer, arg2:size_t, arg3:size_t, arg4:__compar_fn_t) : OpaquePointer;

external (cdecl) qsort(arg0:OpaquePointer, arg1:size_t, arg2:size_t, arg3:__compar_fn_t) : ;

external (cdecl) abs(arg0:Int) : Int;

external (cdecl) labs(arg0:CLong) : CLong;

external (cdecl) llabs(arg0:Int64) : Int64;

external (cdecl) div(arg0:Int, arg1:Int) : div_t;

external (cdecl) ldiv(arg0:CLong, arg1:CLong) : ldiv_t;

external (cdecl) lldiv(arg0:Int64, arg1:Int64) : lldiv_t;

external (cdecl) ecvt(arg0:Double, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int]) : Pointer[CChar];

external (cdecl) fcvt(arg0:Double, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int]) : Pointer[CChar];

external (cdecl) gcvt(arg0:Double, arg1:Int, arg2:Pointer[CChar]) : Pointer[CChar];

external (cdecl) qecvt(arg0:LongDouble, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int]) : Pointer[CChar];

external (cdecl) qfcvt(arg0:LongDouble, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int]) : Pointer[CChar];

external (cdecl) qgcvt(arg0:LongDouble, arg1:Int, arg2:Pointer[CChar]) : Pointer[CChar];

external (cdecl) ecvt_r(arg0:Double, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int], arg4:Pointer[CChar], arg5:size_t) : Int;

external (cdecl) fcvt_r(arg0:Double, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int], arg4:Pointer[CChar], arg5:size_t) : Int;

external (cdecl) qecvt_r(arg0:LongDouble, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int], arg4:Pointer[CChar], arg5:size_t) : Int;

external (cdecl) qfcvt_r(arg0:LongDouble, arg1:Int, arg2:Pointer[Int], arg3:Pointer[Int], arg4:Pointer[CChar], arg5:size_t) : Int;

external (cdecl) mblen(arg0:Pointer[CChar], arg1:size_t) : Int;

external (cdecl) mbtowc(arg0:Pointer[wchar_t], arg1:Pointer[CChar], arg2:size_t) : Int;

external (cdecl) wctomb(arg0:Pointer[CChar], arg1:wchar_t) : Int;

external (cdecl) mbstowcs(arg0:Pointer[wchar_t], arg1:Pointer[CChar], arg2:size_t) : size_t;

external (cdecl) wcstombs(arg0:Pointer[CChar], arg1:Pointer[wchar_t], arg2:size_t) : size_t;

external (cdecl) rpmatch(arg0:Pointer[CChar]) : Int;

external (cdecl) getsubopt(arg0:Pointer[Pointer[CChar]], arg1:Pointer[Pointer[CChar]], arg2:Pointer[Pointer[CChar]]) : Int;

external (cdecl) getloadavg(arg0:Pointer[Double], arg1:Int) : Int;

alias Enum_Unnamed56 = UInt;
alias IPPROTO_IP = 0;
alias IPPROTO_HOPOPTS = 0;
alias IPPROTO_ICMP = 1;
alias IPPROTO_IGMP = 2;
alias IPPROTO_IPIP = 4;
alias IPPROTO_TCP = 6;
alias IPPROTO_EGP = 8;
alias IPPROTO_PUP = 12;
alias IPPROTO_UDP = 17;
alias IPPROTO_IDP = 22;
alias IPPROTO_TP = 29;
alias IPPROTO_DCCP = 33;
alias IPPROTO_IPV6 = 41;
alias IPPROTO_ROUTING = 43;
alias IPPROTO_FRAGMENT = 44;
alias IPPROTO_RSVP = 46;
alias IPPROTO_GRE = 47;
alias IPPROTO_ESP = 50;
alias IPPROTO_AH = 51;
alias IPPROTO_ICMPV6 = 58;
alias IPPROTO_NONE = 59;
alias IPPROTO_DSTOPTS = 60;
alias IPPROTO_MTP = 92;
alias IPPROTO_ENCAP = 98;
alias IPPROTO_PIM = 103;
alias IPPROTO_COMP = 108;
alias IPPROTO_SCTP = 132;
alias IPPROTO_UDPLITE = 136;
alias IPPROTO_RAW = 255;
alias IPPROTO_MAX = 256;

alias in_port_t = uint16_t;

alias Enum_Unnamed57 = UInt;
alias IPPORT_ECHO = 7;
alias IPPORT_DISCARD = 9;
alias IPPORT_SYSTAT = 11;
alias IPPORT_DAYTIME = 13;
alias IPPORT_NETSTAT = 15;
alias IPPORT_FTP = 21;
alias IPPORT_TELNET = 23;
alias IPPORT_SMTP = 25;
alias IPPORT_TIMESERVER = 37;
alias IPPORT_NAMESERVER = 42;
alias IPPORT_WHOIS = 43;
alias IPPORT_MTP = 57;
alias IPPORT_TFTP = 69;
alias IPPORT_RJE = 77;
alias IPPORT_FINGER = 79;
alias IPPORT_TTYLINK = 87;
alias IPPORT_SUPDUP = 95;
alias IPPORT_EXECSERVER = 512;
alias IPPORT_LOGINSERVER = 513;
alias IPPORT_CMDSERVER = 514;
alias IPPORT_EFSSERVER = 520;
alias IPPORT_BIFFUDP = 512;
alias IPPORT_WHOSERVER = 513;
alias IPPORT_ROUTESERVER = 520;
alias IPPORT_RESERVED = 1024;
alias IPPORT_USERRESERVED = 5000;

alias in_addr_t = uint32_t;

record Struct_in_addr (
    s_addr : in_addr_t,
);

record Struct_in6_addr (
    __in6_u : Union_Unnamed58,
);

external in6addr_any : Struct_in6_addr;

external in6addr_loopback : Struct_in6_addr;

record Struct_sockaddr_in (
    sin_family : sa_family_t,
    sin_port : in_port_t,
    sin_addr : Struct_in_addr,
    sin_zero : Array[CUChar, 8],
);

record Struct_sockaddr_in6 (
    sin6_family : sa_family_t,
    sin6_port : in_port_t,
    sin6_flowinfo : uint32_t,
    sin6_addr : Struct_in6_addr,
    sin6_scope_id : uint32_t,
);

record Struct_ip_mreq (
    imr_multiaddr : Struct_in_addr,
    imr_interface : Struct_in_addr,
);

record Struct_ip_mreq_source (
    imr_multiaddr : Struct_in_addr,
    imr_interface : Struct_in_addr,
    imr_sourceaddr : Struct_in_addr,
);

record Struct_ipv6_mreq (
    ipv6mr_multiaddr : Struct_in6_addr,
    ipv6mr_interface : UInt,
);

record Struct_group_req (
    gr_interface : uint32_t,
    gr_group : Struct_sockaddr_storage,
);

record Struct_group_source_req (
    gsr_interface : uint32_t,
    gsr_group : Struct_sockaddr_storage,
    gsr_source : Struct_sockaddr_storage,
);

record Struct_ip_msfilter (
    imsf_multiaddr : Struct_in_addr,
    imsf_interface : Struct_in_addr,
    imsf_fmode : uint32_t,
    imsf_numsrc : uint32_t,
    imsf_slist : Array[Struct_in_addr, 1],
);

record Struct_group_filter (
    gf_interface : uint32_t,
    gf_group : Struct_sockaddr_storage,
    gf_fmode : uint32_t,
    gf_numsrc : uint32_t,
    gf_slist : Array[Struct_sockaddr_storage, 1],
);

record Struct_ip_opts (
    ip_dst : Struct_in_addr,
    ip_opts : Array[CChar, 40],
);

record Struct_ip_mreqn (
    imr_multiaddr : Struct_in_addr,
    imr_address : Struct_in_addr,
    imr_ifindex : Int,
);

record Struct_in_pktinfo (
    ipi_ifindex : Int,
    ipi_spec_dst : Struct_in_addr,
    ipi_addr : Struct_in_addr,
);

external (cdecl) ntohl(arg0:uint32_t) : uint32_t;

external (cdecl) ntohs(arg0:uint16_t) : uint16_t;

external (cdecl) htonl(arg0:uint32_t) : uint32_t;

external (cdecl) htons(arg0:uint16_t) : uint16_t;

external (cdecl) bindresvport(arg0:Int, arg1:Pointer[Struct_sockaddr_in]) : Int;

external (cdecl) bindresvport6(arg0:Int, arg1:Pointer[Struct_sockaddr_in6]) : Int;

record Struct_rpcent (
    r_name : Pointer[CChar],
    r_aliases : Pointer[Pointer[CChar]],
    r_number : Int,
);

external (cdecl) setrpcent(arg0:Int) : ;

external (cdecl) endrpcent() : ;

external (cdecl) getrpcbyname(arg0:Pointer[CChar]) : Pointer[Struct_rpcent];

external (cdecl) getrpcbynumber(arg0:Int) : Pointer[Struct_rpcent];

external (cdecl) getrpcent() : Pointer[Struct_rpcent];

external (cdecl) getrpcbyname_r(arg0:Pointer[CChar], arg1:Pointer[Struct_rpcent], arg2:Pointer[CChar], arg3:size_t, arg4:Pointer[Pointer[Struct_rpcent]]) : Int;

external (cdecl) getrpcbynumber_r(arg0:Int, arg1:Pointer[Struct_rpcent], arg2:Pointer[CChar], arg3:size_t, arg4:Pointer[Pointer[Struct_rpcent]]) : Int;

external (cdecl) getrpcent_r(arg0:Pointer[Struct_rpcent], arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[Pointer[Struct_rpcent]]) : Int;

record Struct_netent (
    n_name : Pointer[CChar],
    n_aliases : Pointer[Pointer[CChar]],
    n_addrtype : Int,
    n_net : uint32_t,
);

external (cdecl) __h_errno_location() : Pointer[Int];

external (cdecl) herror(arg0:Pointer[CChar]) : ;

external (cdecl) hstrerror(arg0:Int) : Pointer[CChar];

record Struct_hostent (
    h_name : Pointer[CChar],
    h_aliases : Pointer[Pointer[CChar]],
    h_addrtype : Int,
    h_length : Int,
    h_addr_list : Pointer[Pointer[CChar]],
);

external (cdecl) sethostent(arg0:Int) : ;

external (cdecl) endhostent() : ;

external (cdecl) gethostent() : Pointer[Struct_hostent];

external (cdecl) gethostbyaddr(arg0:OpaquePointer, arg1:__socklen_t, arg2:Int) : Pointer[Struct_hostent];

external (cdecl) gethostbyname(arg0:Pointer[CChar]) : Pointer[Struct_hostent];

external (cdecl) gethostbyname2(arg0:Pointer[CChar], arg1:Int) : Pointer[Struct_hostent];

external (cdecl) gethostent_r(arg0:Pointer[Struct_hostent], arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[Pointer[Struct_hostent]], arg4:Pointer[Int]) : Int;

external (cdecl) gethostbyaddr_r(arg0:OpaquePointer, arg1:__socklen_t, arg2:Int, arg3:Pointer[Struct_hostent], arg4:Pointer[CChar], arg5:size_t, arg6:Pointer[Pointer[Struct_hostent]], arg7:Pointer[Int]) : Int;

external (cdecl) gethostbyname_r(arg0:Pointer[CChar], arg1:Pointer[Struct_hostent], arg2:Pointer[CChar], arg3:size_t, arg4:Pointer[Pointer[Struct_hostent]], arg5:Pointer[Int]) : Int;

external (cdecl) gethostbyname2_r(arg0:Pointer[CChar], arg1:Int, arg2:Pointer[Struct_hostent], arg3:Pointer[CChar], arg4:size_t, arg5:Pointer[Pointer[Struct_hostent]], arg6:Pointer[Int]) : Int;

external (cdecl) setnetent(arg0:Int) : ;

external (cdecl) endnetent() : ;

external (cdecl) getnetent() : Pointer[Struct_netent];

external (cdecl) getnetbyaddr(arg0:uint32_t, arg1:Int) : Pointer[Struct_netent];

external (cdecl) getnetbyname(arg0:Pointer[CChar]) : Pointer[Struct_netent];

external (cdecl) getnetent_r(arg0:Pointer[Struct_netent], arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[Pointer[Struct_netent]], arg4:Pointer[Int]) : Int;

external (cdecl) getnetbyaddr_r(arg0:uint32_t, arg1:Int, arg2:Pointer[Struct_netent], arg3:Pointer[CChar], arg4:size_t, arg5:Pointer[Pointer[Struct_netent]], arg6:Pointer[Int]) : Int;

external (cdecl) getnetbyname_r(arg0:Pointer[CChar], arg1:Pointer[Struct_netent], arg2:Pointer[CChar], arg3:size_t, arg4:Pointer[Pointer[Struct_netent]], arg5:Pointer[Int]) : Int;

record Struct_servent (
    s_name : Pointer[CChar],
    s_aliases : Pointer[Pointer[CChar]],
    s_port : Int,
    s_proto : Pointer[CChar],
);

external (cdecl) setservent(arg0:Int) : ;

external (cdecl) endservent() : ;

external (cdecl) getservent() : Pointer[Struct_servent];

external (cdecl) getservbyname(arg0:Pointer[CChar], arg1:Pointer[CChar]) : Pointer[Struct_servent];

external (cdecl) getservbyport(arg0:Int, arg1:Pointer[CChar]) : Pointer[Struct_servent];

external (cdecl) getservent_r(arg0:Pointer[Struct_servent], arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[Pointer[Struct_servent]]) : Int;

external (cdecl) getservbyname_r(arg0:Pointer[CChar], arg1:Pointer[CChar], arg2:Pointer[Struct_servent], arg3:Pointer[CChar], arg4:size_t, arg5:Pointer[Pointer[Struct_servent]]) : Int;

external (cdecl) getservbyport_r(arg0:Int, arg1:Pointer[CChar], arg2:Pointer[Struct_servent], arg3:Pointer[CChar], arg4:size_t, arg5:Pointer[Pointer[Struct_servent]]) : Int;

record Struct_protoent (
    p_name : Pointer[CChar],
    p_aliases : Pointer[Pointer[CChar]],
    p_proto : Int,
);

external (cdecl) setprotoent(arg0:Int) : ;

external (cdecl) endprotoent() : ;

external (cdecl) getprotoent() : Pointer[Struct_protoent];

external (cdecl) getprotobyname(arg0:Pointer[CChar]) : Pointer[Struct_protoent];

external (cdecl) getprotobynumber(arg0:Int) : Pointer[Struct_protoent];

external (cdecl) getprotoent_r(arg0:Pointer[Struct_protoent], arg1:Pointer[CChar], arg2:size_t, arg3:Pointer[Pointer[Struct_protoent]]) : Int;

external (cdecl) getprotobyname_r(arg0:Pointer[CChar], arg1:Pointer[Struct_protoent], arg2:Pointer[CChar], arg3:size_t, arg4:Pointer[Pointer[Struct_protoent]]) : Int;

external (cdecl) getprotobynumber_r(arg0:Int, arg1:Pointer[Struct_protoent], arg2:Pointer[CChar], arg3:size_t, arg4:Pointer[Pointer[Struct_protoent]]) : Int;

external (cdecl) setnetgrent(arg0:Pointer[CChar]) : Int;

external (cdecl) endnetgrent() : ;

external (cdecl) getnetgrent(arg0:Pointer[Pointer[CChar]], arg1:Pointer[Pointer[CChar]], arg2:Pointer[Pointer[CChar]]) : Int;

external (cdecl) innetgr(arg0:Pointer[CChar], arg1:Pointer[CChar], arg2:Pointer[CChar], arg3:Pointer[CChar]) : Int;

external (cdecl) getnetgrent_r(arg0:Pointer[Pointer[CChar]], arg1:Pointer[Pointer[CChar]], arg2:Pointer[Pointer[CChar]], arg3:Pointer[CChar], arg4:size_t) : Int;

external (cdecl) rcmd(arg0:Pointer[Pointer[CChar]], arg1:UShort, arg2:Pointer[CChar], arg3:Pointer[CChar], arg4:Pointer[CChar], arg5:Pointer[Int]) : Int;

external (cdecl) rcmd_af(arg0:Pointer[Pointer[CChar]], arg1:UShort, arg2:Pointer[CChar], arg3:Pointer[CChar], arg4:Pointer[CChar], arg5:Pointer[Int], arg6:sa_family_t) : Int;

external (cdecl) rexec(arg0:Pointer[Pointer[CChar]], arg1:Int, arg2:Pointer[CChar], arg3:Pointer[CChar], arg4:Pointer[CChar], arg5:Pointer[Int]) : Int;

external (cdecl) rexec_af(arg0:Pointer[Pointer[CChar]], arg1:Int, arg2:Pointer[CChar], arg3:Pointer[CChar], arg4:Pointer[CChar], arg5:Pointer[Int], arg6:sa_family_t) : Int;

external (cdecl) ruserok(arg0:Pointer[CChar], arg1:Int, arg2:Pointer[CChar], arg3:Pointer[CChar]) : Int;

external (cdecl) ruserok_af(arg0:Pointer[CChar], arg1:Int, arg2:Pointer[CChar], arg3:Pointer[CChar], arg4:sa_family_t) : Int;

external (cdecl) iruserok(arg0:uint32_t, arg1:Int, arg2:Pointer[CChar], arg3:Pointer[CChar]) : Int;

external (cdecl) iruserok_af(arg0:OpaquePointer, arg1:Int, arg2:Pointer[CChar], arg3:Pointer[CChar], arg4:sa_family_t) : Int;

external (cdecl) rresvport(arg0:Pointer[Int]) : Int;

external (cdecl) rresvport_af(arg0:Pointer[Int], arg1:sa_family_t) : Int;

record Struct_addrinfo (
    ai_flags : Int,
    ai_family : Int,
    ai_socktype : Int,
    ai_protocol : Int,
    ai_addrlen : socklen_t,
    ai_addr : Pointer[Struct_sockaddr],
    ai_canonname : Pointer[CChar],
    ai_next : Pointer[Struct_addrinfo],
);

external (cdecl) getaddrinfo(arg0:Pointer[CChar], arg1:Pointer[CChar], arg2:Pointer[Struct_addrinfo], arg3:Pointer[Pointer[Struct_addrinfo]]) : Int;

external (cdecl) freeaddrinfo(arg0:Pointer[Struct_addrinfo]) : ;

external (cdecl) gai_strerror(arg0:Int) : Pointer[CChar];

external (cdecl) getnameinfo(arg0:Pointer[Struct_sockaddr], arg1:socklen_t, arg2:Pointer[CChar], arg3:socklen_t, arg4:Pointer[CChar], arg5:socklen_t, arg6:Int) : Int;

external (cdecl) _dl_mcount_wrapper_check(arg0:OpaquePointer) : ;

alias Lmid_t = CLong;

external (cdecl) dlopen(arg0:Pointer[CChar], arg1:Int) : OpaquePointer;

external (cdecl) dlclose(arg0:OpaquePointer) : Int;

external (cdecl) dlsym(arg0:OpaquePointer, arg1:Pointer[CChar]) : OpaquePointer;

external (cdecl) dlmopen(arg0:Lmid_t, arg1:Pointer[CChar], arg2:Int) : OpaquePointer;

external (cdecl) dlvsym(arg0:OpaquePointer, arg1:Pointer[CChar], arg2:Pointer[CChar]) : OpaquePointer;

external (cdecl) dlerror() : Pointer[CChar];

record Struct_Unnamed59 (
    dli_fname : Pointer[CChar],
    dli_fbase : OpaquePointer,
    dli_sname : Pointer[CChar],
    dli_saddr : OpaquePointer,
);

alias Dl_info = Struct_Unnamed59;

external (cdecl) dladdr(arg0:OpaquePointer, arg1:Pointer[Dl_info]) : Int;

external (cdecl) dladdr1(arg0:OpaquePointer, arg1:Pointer[Dl_info], arg2:Pointer[OpaquePointer], arg3:Int) : Int;

alias Enum_Unnamed60 = UInt;
alias RTLD_DL_SYMENT = 1;
alias RTLD_DL_LINKMAP = 2;

external (cdecl) dlinfo(arg0:OpaquePointer, arg1:Int, arg2:OpaquePointer) : Int;

alias Enum_Unnamed61 = UInt;
alias RTLD_DI_LMID = 1;
alias RTLD_DI_LINKMAP = 2;
alias RTLD_DI_CONFIGADDR = 3;
alias RTLD_DI_SERINFO = 4;
alias RTLD_DI_SERINFOSIZE = 5;
alias RTLD_DI_ORIGIN = 6;
alias RTLD_DI_PROFILENAME = 7;
alias RTLD_DI_PROFILEOUT = 8;
alias RTLD_DI_TLS_MODID = 9;
alias RTLD_DI_TLS_DATA = 10;
alias RTLD_DI_MAX = 10;

record Struct_Unnamed62 (
    dls_name : Pointer[CChar],
    dls_flags : UInt,
);

alias Dl_serpath = Struct_Unnamed62;

record Struct_Unnamed63 (
    dls_size : size_t,
    dls_cnt : UInt,
    dls_serpath : Array[Dl_serpath, 1],
);

alias Dl_serinfo = Struct_Unnamed63;

