1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
const std = @import("../std.zig");
const maxInt = std.math.maxInt;
const emscripten = std.os.emscripten;
pub const AF = emscripten.AF;
pub const CLOCK = emscripten.CLOCK;
pub const CPU_COUNT = emscripten.CPU_COUNT;
pub const E = emscripten.E;
pub const F = emscripten.F;
pub const FD_CLOEXEC = emscripten.FD_CLOEXEC;
pub const F_OK = emscripten.F_OK;
pub const Flock = emscripten.Flock;
pub const IFNAMESIZE = emscripten.IFNAMESIZE;
pub const IOV_MAX = emscripten.IOV_MAX;
pub const IPPROTO = emscripten.IPPROTO;
pub const LOCK = emscripten.LOCK;
pub const MADV = emscripten.MADV;
pub const MSF = emscripten.MSF;
pub const MSG = emscripten.MSG;
pub const NAME_MAX = emscripten.NAME_MAX;
pub const PATH_MAX = emscripten.PATH_MAX;
pub const POLL = emscripten.POLL;
pub const PROT = emscripten.PROT;
pub const REG = emscripten.REG;
pub const RLIM = emscripten.RLIM;
pub const R_OK = emscripten.R_OK;
pub const S = emscripten.S;
pub const SA = emscripten.SA;
pub const SEEK = emscripten.SEEK;
pub const SHUT = emscripten.SHUT;
pub const SIG = emscripten.SIG;
pub const SIOCGIFINDEX = emscripten.SIOCGIFINDEX;
pub const SO = emscripten.SO;
pub const SOCK = emscripten.SOCK;
pub const SOL = emscripten.SOL;
pub const STDERR_FILENO = emscripten.STDERR_FILENO;
pub const STDIN_FILENO = emscripten.STDIN_FILENO;
pub const STDOUT_FILENO = emscripten.STDOUT_FILENO;
pub const Sigaction = emscripten.Sigaction;
pub const TCP = emscripten.TCP;
pub const TCSA = emscripten.TCSA;
pub const W = emscripten.W;
pub const W_OK = emscripten.W_OK;
pub const X_OK = emscripten.X_OK;
pub const addrinfo = emscripten.addrinfo;
pub const blkcnt_t = emscripten.blkcnt_t;
pub const blksize_t = emscripten.blksize_t;
pub const clock_t = emscripten.clock_t;
pub const cpu_set_t = emscripten.cpu_set_t;
pub const dev_t = emscripten.dev_t;
pub const dl_phdr_info = emscripten.dl_phdr_info;
pub const empty_sigset = emscripten.empty_sigset;
pub const fd_t = emscripten.fd_t;
pub const gid_t = emscripten.gid_t;
pub const ifreq = emscripten.ifreq;
pub const ino_t = emscripten.ino_t;
pub const mcontext_t = emscripten.mcontext_t;
pub const mode_t = emscripten.mode_t;
pub const msghdr = emscripten.msghdr;
pub const msghdr_const = emscripten.msghdr_const;
pub const nfds_t = emscripten.nfds_t;
pub const nlink_t = emscripten.nlink_t;
pub const off_t = emscripten.off_t;
pub const pid_t = emscripten.pid_t;
pub const pollfd = emscripten.pollfd;
pub const rlim_t = emscripten.rlim_t;
pub const rlimit = emscripten.rlimit;
pub const rlimit_resource = emscripten.rlimit_resource;
pub const rusage = emscripten.rusage;
pub const siginfo_t = emscripten.siginfo_t;
pub const sigset_t = emscripten.sigset_t;
pub const sockaddr = emscripten.sockaddr;
pub const socklen_t = emscripten.socklen_t;
pub const stack_t = emscripten.stack_t;
pub const time_t = emscripten.time_t;
pub const timespec = emscripten.timespec;
pub const timeval = emscripten.timeval;
pub const timezone = emscripten.timezone;
pub const ucontext_t = emscripten.ucontext_t;
pub const uid_t = emscripten.uid_t;
pub const utsname = emscripten.utsname;
pub const _errno = struct {
extern "c" fn __errno_location() *c_int;
}.__errno_location;
pub const Stat = emscripten.Stat;
pub const AI = struct {
pub const PASSIVE = 0x01;
pub const CANONNAME = 0x02;
pub const NUMERICHOST = 0x04;
pub const V4MAPPED = 0x08;
pub const ALL = 0x10;
pub const ADDRCONFIG = 0x20;
pub const NUMERICSERV = 0x400;
};
pub const NI = struct {
pub const NUMERICHOST = 0x01;
pub const NUMERICSERV = 0x02;
pub const NOFQDN = 0x04;
pub const NAMEREQD = 0x08;
pub const DGRAM = 0x10;
pub const NUMERICSCOPE = 0x100;
pub const MAXHOST = 255;
pub const MAXSERV = 32;
};
pub const EAI = enum(c_int) {
BADFLAGS = -1,
NONAME = -2,
AGAIN = -3,
FAIL = -4,
FAMILY = -6,
SOCKTYPE = -7,
SERVICE = -8,
MEMORY = -10,
SYSTEM = -11,
OVERFLOW = -12,
NODATA = -5,
ADDRFAMILY = -9,
INPROGRESS = -100,
CANCELED = -101,
NOTCANCELED = -102,
ALLDONE = -103,
INTR = -104,
IDN_ENCODE = -105,
_,
};
pub const fopen64 = std.c.fopen;
pub const fstat64 = std.c.fstat;
pub const fstatat64 = std.c.fstatat;
pub const ftruncate64 = std.c.ftruncate;
pub const getrlimit64 = std.c.getrlimit;
pub const lseek64 = std.c.lseek;
pub const mmap64 = std.c.mmap;
pub const open64 = std.c.open;
pub const openat64 = std.c.openat;
pub const pread64 = std.c.pread;
pub const preadv64 = std.c.preadv;
pub const pwrite64 = std.c.pwrite;
pub const pwritev64 = std.c.pwritev;
pub const setrlimit64 = std.c.setrlimit;
pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
pub extern "c" fn pipe2(fds: *[2]fd_t, flags: std.c.O) c_int;
pub extern "c" fn getentropy(buffer: [*]u8, size: usize) c_int;
pub const pthread_attr_t = extern struct {
__size: [56]u8,
__align: c_long,
};
pub const pthread_key_t = c_uint;
pub const sem_t = extern struct {
__size: [__SIZEOF_SEM_T]u8 align(@alignOf(usize)),
};
const __SIZEOF_SEM_T = 4 * @sizeOf(usize);
pub const RTLD = struct {
pub const LAZY = 1;
pub const NOW = 2;
pub const NOLOAD = 4;
pub const NODELETE = 4096;
pub const GLOBAL = 256;
pub const LOCAL = 0;
};
pub const dirent = struct {
ino: c_uint,
off: c_uint,
reclen: c_ushort,
type: u8,
name: [256]u8,
};
|