1 //! This file defines the raw WASI bindings.
2 
3 #![allow(non_camel_case_types)]
4 
5 use core::ffi::c_void;
6 
7 pub type __wasi_advice_t = u8;
8 pub type __wasi_clockid_t = u32;
9 pub type __wasi_device_t = u64;
10 pub type __wasi_dircookie_t = u64;
11 pub type __wasi_errno_t = u16;
12 pub type __wasi_eventrwflags_t = u16;
13 pub type __wasi_eventtype_t = u8;
14 pub type __wasi_exitcode_t = u32;
15 pub type __wasi_fd_t = u32;
16 pub type __wasi_fdflags_t = u16;
17 pub type __wasi_filedelta_t = i64;
18 pub type __wasi_filesize_t = u64;
19 pub type __wasi_filetype_t = u8;
20 pub type __wasi_fstflags_t = u16;
21 pub type __wasi_inode_t = u64;
22 pub type __wasi_linkcount_t = u32;
23 pub type __wasi_lookupflags_t = u32;
24 pub type __wasi_oflags_t = u16;
25 pub type __wasi_riflags_t = u16;
26 pub type __wasi_rights_t = u64;
27 pub type __wasi_roflags_t = u16;
28 pub type __wasi_sdflags_t = u8;
29 pub type __wasi_siflags_t = u16;
30 pub type __wasi_signal_t = u8;
31 pub type __wasi_subclockflags_t = u16;
32 pub type __wasi_timestamp_t = u64;
33 pub type __wasi_userdata_t = u64;
34 pub type __wasi_whence_t = u8;
35 pub type __wasi_preopentype_t = u8;
36 
37 #[repr(C)]
38 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
39 pub struct __wasi_dirent_t {
40     pub d_next: __wasi_dircookie_t,
41     pub d_ino: __wasi_inode_t,
42     pub d_namlen: u32,
43     pub d_type: __wasi_filetype_t,
44 }
45 
46 #[repr(C)]
47 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
48 pub struct __wasi_event_u_fd_readwrite_t {
49     pub nbytes: __wasi_filesize_t,
50     pub flags: __wasi_eventrwflags_t,
51 }
52 
53 #[repr(C)]
54 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
55 pub struct __wasi_fdstat_t {
56     pub fs_filetype: __wasi_filetype_t,
57     pub fs_flags: __wasi_fdflags_t,
58     pub fs_rights_base: __wasi_rights_t,
59     pub fs_rights_inheriting: __wasi_rights_t,
60 }
61 
62 #[repr(C)]
63 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
64 pub struct __wasi_filestat_t {
65     pub st_dev: __wasi_device_t,
66     pub st_ino: __wasi_inode_t,
67     pub st_filetype: __wasi_filetype_t,
68     pub st_nlink: __wasi_linkcount_t,
69     pub st_size: __wasi_filesize_t,
70     pub st_atim: __wasi_timestamp_t,
71     pub st_mtim: __wasi_timestamp_t,
72     pub st_ctim: __wasi_timestamp_t,
73 }
74 
75 #[repr(C)]
76 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
77 pub struct __wasi_ciovec_t {
78     pub buf: *const c_void,
79     pub buf_len: usize,
80 }
81 
82 #[repr(C)]
83 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
84 pub struct __wasi_iovec_t {
85     pub buf: *mut c_void,
86     pub buf_len: usize,
87 }
88 
89 #[repr(C)]
90 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
91 pub struct __wasi_subscription_u_clock_t {
92     pub identifier: __wasi_userdata_t,
93     pub clock_id: __wasi_clockid_t,
94     pub timeout: __wasi_timestamp_t,
95     pub precision: __wasi_timestamp_t,
96     pub flags: __wasi_subclockflags_t,
97 }
98 
99 #[repr(C)]
100 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
101 pub struct __wasi_subscription_u_fd_readwrite_t {
102     pub fd: __wasi_fd_t,
103 }
104 
105 #[repr(C)]
106 #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
107 pub struct __wasi_prestat_u_dir_t {
108     pub pr_name_len: usize,
109 }
110 
111 #[repr(C)]
112 #[derive(Copy, Clone)]
113 #[allow(missing_debug_implementations)]
114 pub struct __wasi_subscription_t {
115     pub userdata: __wasi_userdata_t,
116     pub type_: __wasi_eventtype_t,
117     pub u: __wasi_subscription_u,
118 }
119 
120 #[repr(C)]
121 #[derive(Copy, Clone)]
122 #[allow(missing_debug_implementations)]
123 pub struct __wasi_event_t {
124     pub userdata: __wasi_userdata_t,
125     pub error: __wasi_errno_t,
126     pub type_: __wasi_eventtype_t,
127     pub u: __wasi_event_u,
128 }
129 
130 #[repr(C)]
131 #[derive(Copy, Clone)]
132 #[allow(missing_debug_implementations)]
133 pub union __wasi_event_u {
134     pub fd_readwrite: __wasi_event_u_fd_readwrite_t,
135     _bindgen_union_align: [u64; 2],
136 }
137 
138 #[repr(C)]
139 #[derive(Copy, Clone)]
140 #[allow(missing_debug_implementations)]
141 pub union __wasi_subscription_u {
142     pub clock: __wasi_subscription_u_clock_t,
143     pub fd_readwrite: __wasi_subscription_u_fd_readwrite_t,
144     _bindgen_union_align: [u64; 5],
145 }
146 
147 #[repr(C)]
148 #[derive(Copy, Clone)]
149 #[allow(missing_debug_implementations)]
150 pub struct __wasi_prestat_t {
151     pub pr_type: __wasi_preopentype_t,
152     pub u: __wasi_prestat_u,
153 }
154 
155 #[repr(C)]
156 #[derive(Copy, Clone)]
157 #[allow(missing_debug_implementations)]
158 pub union __wasi_prestat_u {
159     pub dir: __wasi_prestat_u_dir_t,
160 }
161 
162 pub const __WASI_ADVICE_NORMAL: u8 = 0;
163 pub const __WASI_ADVICE_SEQUENTIAL: u8 = 1;
164 pub const __WASI_ADVICE_RANDOM: u8 = 2;
165 pub const __WASI_ADVICE_WILLNEED: u8 = 3;
166 pub const __WASI_ADVICE_DONTNEED: u8 = 4;
167 pub const __WASI_ADVICE_NOREUSE: u8 = 5;
168 pub const __WASI_CLOCK_REALTIME: u32 = 0;
169 pub const __WASI_CLOCK_MONOTONIC: u32 = 1;
170 pub const __WASI_CLOCK_PROCESS_CPUTIME_ID: u32 = 2;
171 pub const __WASI_CLOCK_THREAD_CPUTIME_ID: u32 = 3;
172 pub const __WASI_DIRCOOKIE_START: u64 = 0;
173 pub const __WASI_ESUCCESS: u16 = 0;
174 pub const __WASI_E2BIG: u16 = 1;
175 pub const __WASI_EACCES: u16 = 2;
176 pub const __WASI_EADDRINUSE: u16 = 3;
177 pub const __WASI_EADDRNOTAVAIL: u16 = 4;
178 pub const __WASI_EAFNOSUPPORT: u16 = 5;
179 pub const __WASI_EAGAIN: u16 = 6;
180 pub const __WASI_EALREADY: u16 = 7;
181 pub const __WASI_EBADF: u16 = 8;
182 pub const __WASI_EBADMSG: u16 = 9;
183 pub const __WASI_EBUSY: u16 = 10;
184 pub const __WASI_ECANCELED: u16 = 11;
185 pub const __WASI_ECHILD: u16 = 12;
186 pub const __WASI_ECONNABORTED: u16 = 13;
187 pub const __WASI_ECONNREFUSED: u16 = 14;
188 pub const __WASI_ECONNRESET: u16 = 15;
189 pub const __WASI_EDEADLK: u16 = 16;
190 pub const __WASI_EDESTADDRREQ: u16 = 17;
191 pub const __WASI_EDOM: u16 = 18;
192 pub const __WASI_EDQUOT: u16 = 19;
193 pub const __WASI_EEXIST: u16 = 20;
194 pub const __WASI_EFAULT: u16 = 21;
195 pub const __WASI_EFBIG: u16 = 22;
196 pub const __WASI_EHOSTUNREACH: u16 = 23;
197 pub const __WASI_EIDRM: u16 = 24;
198 pub const __WASI_EILSEQ: u16 = 25;
199 pub const __WASI_EINPROGRESS: u16 = 26;
200 pub const __WASI_EINTR: u16 = 27;
201 pub const __WASI_EINVAL: u16 = 28;
202 pub const __WASI_EIO: u16 = 29;
203 pub const __WASI_EISCONN: u16 = 30;
204 pub const __WASI_EISDIR: u16 = 31;
205 pub const __WASI_ELOOP: u16 = 32;
206 pub const __WASI_EMFILE: u16 = 33;
207 pub const __WASI_EMLINK: u16 = 34;
208 pub const __WASI_EMSGSIZE: u16 = 35;
209 pub const __WASI_EMULTIHOP: u16 = 36;
210 pub const __WASI_ENAMETOOLONG: u16 = 37;
211 pub const __WASI_ENETDOWN: u16 = 38;
212 pub const __WASI_ENETRESET: u16 = 39;
213 pub const __WASI_ENETUNREACH: u16 = 40;
214 pub const __WASI_ENFILE: u16 = 41;
215 pub const __WASI_ENOBUFS: u16 = 42;
216 pub const __WASI_ENODEV: u16 = 43;
217 pub const __WASI_ENOENT: u16 = 44;
218 pub const __WASI_ENOEXEC: u16 = 45;
219 pub const __WASI_ENOLCK: u16 = 46;
220 pub const __WASI_ENOLINK: u16 = 47;
221 pub const __WASI_ENOMEM: u16 = 48;
222 pub const __WASI_ENOMSG: u16 = 49;
223 pub const __WASI_ENOPROTOOPT: u16 = 50;
224 pub const __WASI_ENOSPC: u16 = 51;
225 pub const __WASI_ENOSYS: u16 = 52;
226 pub const __WASI_ENOTCONN: u16 = 53;
227 pub const __WASI_ENOTDIR: u16 = 54;
228 pub const __WASI_ENOTEMPTY: u16 = 55;
229 pub const __WASI_ENOTRECOVERABLE: u16 = 56;
230 pub const __WASI_ENOTSOCK: u16 = 57;
231 pub const __WASI_ENOTSUP: u16 = 58;
232 pub const __WASI_ENOTTY: u16 = 59;
233 pub const __WASI_ENXIO: u16 = 60;
234 pub const __WASI_EOVERFLOW: u16 = 61;
235 pub const __WASI_EOWNERDEAD: u16 = 62;
236 pub const __WASI_EPERM: u16 = 63;
237 pub const __WASI_EPIPE: u16 = 64;
238 pub const __WASI_EPROTO: u16 = 65;
239 pub const __WASI_EPROTONOSUPPORT: u16 = 66;
240 pub const __WASI_EPROTOTYPE: u16 = 67;
241 pub const __WASI_ERANGE: u16 = 68;
242 pub const __WASI_EROFS: u16 = 69;
243 pub const __WASI_ESPIPE: u16 = 70;
244 pub const __WASI_ESRCH: u16 = 71;
245 pub const __WASI_ESTALE: u16 = 72;
246 pub const __WASI_ETIMEDOUT: u16 = 73;
247 pub const __WASI_ETXTBSY: u16 = 74;
248 pub const __WASI_EXDEV: u16 = 75;
249 pub const __WASI_ENOTCAPABLE: u16 = 76;
250 pub const __WASI_EVENT_FD_READWRITE_HANGUP: u16 = 0x0001;
251 pub const __WASI_EVENTTYPE_CLOCK: u8 = 0;
252 pub const __WASI_EVENTTYPE_FD_READ: u8 = 1;
253 pub const __WASI_EVENTTYPE_FD_WRITE: u8 = 2;
254 pub const __WASI_FDFLAG_APPEND: u16 = 0x0001;
255 pub const __WASI_FDFLAG_DSYNC: u16 = 0x0002;
256 pub const __WASI_FDFLAG_NONBLOCK: u16 = 0x0004;
257 pub const __WASI_FDFLAG_RSYNC: u16 = 0x0008;
258 pub const __WASI_FDFLAG_SYNC: u16 = 0x0010;
259 pub const __WASI_FILETYPE_UNKNOWN: u8 = 0;
260 pub const __WASI_FILETYPE_BLOCK_DEVICE: u8 = 1;
261 pub const __WASI_FILETYPE_CHARACTER_DEVICE: u8 = 2;
262 pub const __WASI_FILETYPE_DIRECTORY: u8 = 3;
263 pub const __WASI_FILETYPE_REGULAR_FILE: u8 = 4;
264 pub const __WASI_FILETYPE_SOCKET_DGRAM: u8 = 5;
265 pub const __WASI_FILETYPE_SOCKET_STREAM: u8 = 6;
266 pub const __WASI_FILETYPE_SYMBOLIC_LINK: u8 = 7;
267 pub const __WASI_FILESTAT_SET_ATIM: u16 = 0x0001;
268 pub const __WASI_FILESTAT_SET_ATIM_NOW: u16 = 0x0002;
269 pub const __WASI_FILESTAT_SET_MTIM: u16 = 0x0004;
270 pub const __WASI_FILESTAT_SET_MTIM_NOW: u16 = 0x0008;
271 pub const __WASI_LOOKUP_SYMLINK_FOLLOW: u32 = 0x0000_0001;
272 pub const __WASI_O_CREAT: u16 = 0x0001;
273 pub const __WASI_O_DIRECTORY: u16 = 0x0002;
274 pub const __WASI_O_EXCL: u16 = 0x0004;
275 pub const __WASI_O_TRUNC: u16 = 0x0008;
276 pub const __WASI_PREOPENTYPE_DIR: u8 = 0;
277 pub const __WASI_SOCK_RECV_PEEK: u16 = 0x0001;
278 pub const __WASI_SOCK_RECV_WAITALL: u16 = 0x0002;
279 pub const __WASI_RIGHT_FD_DATASYNC: u64 = 0x0000_0000_0000_0001;
280 pub const __WASI_RIGHT_FD_READ: u64 = 0x0000_0000_0000_0002;
281 pub const __WASI_RIGHT_FD_SEEK: u64 = 0x0000_0000_0000_0004;
282 pub const __WASI_RIGHT_FD_FDSTAT_SET_FLAGS: u64 = 0x0000_0000_0000_0008;
283 pub const __WASI_RIGHT_FD_SYNC: u64 = 0x0000_0000_0000_0010;
284 pub const __WASI_RIGHT_FD_TELL: u64 = 0x0000_0000_0000_0020;
285 pub const __WASI_RIGHT_FD_WRITE: u64 = 0x0000_0000_0000_0040;
286 pub const __WASI_RIGHT_FD_ADVISE: u64 = 0x0000_0000_0000_0080;
287 pub const __WASI_RIGHT_FD_ALLOCATE: u64 = 0x0000_0000_0000_0100;
288 pub const __WASI_RIGHT_PATH_CREATE_DIRECTORY: u64 = 0x0000_0000_0000_0200;
289 pub const __WASI_RIGHT_PATH_CREATE_FILE: u64 = 0x0000_0000_0000_0400;
290 pub const __WASI_RIGHT_PATH_LINK_SOURCE: u64 = 0x0000_0000_0000_0800;
291 pub const __WASI_RIGHT_PATH_LINK_TARGET: u64 = 0x0000_0000_0000_1000;
292 pub const __WASI_RIGHT_PATH_OPEN: u64 = 0x0000_0000_0000_2000;
293 pub const __WASI_RIGHT_FD_READDIR: u64 = 0x0000_0000_0000_4000;
294 pub const __WASI_RIGHT_PATH_READLINK: u64 = 0x0000_0000_0000_8000;
295 pub const __WASI_RIGHT_PATH_RENAME_SOURCE: u64 = 0x0000_0000_0001_0000;
296 pub const __WASI_RIGHT_PATH_RENAME_TARGET: u64 = 0x0000_0000_0002_0000;
297 pub const __WASI_RIGHT_PATH_FILESTAT_GET: u64 = 0x0000_0000_0004_0000;
298 pub const __WASI_RIGHT_PATH_FILESTAT_SET_SIZE: u64 = 0x0000_0000_0008_0000;
299 pub const __WASI_RIGHT_PATH_FILESTAT_SET_TIMES: u64 = 0x0000_0000_0010_0000;
300 pub const __WASI_RIGHT_FD_FILESTAT_GET: u64 = 0x0000_0000_0020_0000;
301 pub const __WASI_RIGHT_FD_FILESTAT_SET_SIZE: u64 = 0x0000_0000_0040_0000;
302 pub const __WASI_RIGHT_FD_FILESTAT_SET_TIMES: u64 = 0x0000_0000_0080_0000;
303 pub const __WASI_RIGHT_PATH_SYMLINK: u64 = 0x0000_0000_0100_0000;
304 pub const __WASI_RIGHT_PATH_REMOVE_DIRECTORY: u64 = 0x0000_0000_0200_0000;
305 pub const __WASI_RIGHT_PATH_UNLINK_FILE: u64 = 0x0000_0000_0400_0000;
306 pub const __WASI_RIGHT_POLL_FD_READWRITE: u64 = 0x0000_0000_0800_0000;
307 pub const __WASI_RIGHT_SOCK_SHUTDOWN: u64 = 0x0000_0000_1000_0000;
308 pub const __WASI_SOCK_RECV_DATA_TRUNCATED: u16 = 0x0001;
309 pub const __WASI_SHUT_RD: u8 = 0x01;
310 pub const __WASI_SHUT_WR: u8 = 0x02;
311 pub const __WASI_SIGHUP: u8 = 1;
312 pub const __WASI_SIGINT: u8 = 2;
313 pub const __WASI_SIGQUIT: u8 = 3;
314 pub const __WASI_SIGILL: u8 = 4;
315 pub const __WASI_SIGTRAP: u8 = 5;
316 pub const __WASI_SIGABRT: u8 = 6;
317 pub const __WASI_SIGBUS: u8 = 7;
318 pub const __WASI_SIGFPE: u8 = 8;
319 pub const __WASI_SIGKILL: u8 = 9;
320 pub const __WASI_SIGUSR1: u8 = 10;
321 pub const __WASI_SIGSEGV: u8 = 11;
322 pub const __WASI_SIGUSR2: u8 = 12;
323 pub const __WASI_SIGPIPE: u8 = 13;
324 pub const __WASI_SIGALRM: u8 = 14;
325 pub const __WASI_SIGTERM: u8 = 15;
326 pub const __WASI_SIGCHLD: u8 = 16;
327 pub const __WASI_SIGCONT: u8 = 17;
328 pub const __WASI_SIGSTOP: u8 = 18;
329 pub const __WASI_SIGTSTP: u8 = 19;
330 pub const __WASI_SIGTTIN: u8 = 20;
331 pub const __WASI_SIGTTOU: u8 = 21;
332 pub const __WASI_SIGURG: u8 = 22;
333 pub const __WASI_SIGXCPU: u8 = 23;
334 pub const __WASI_SIGXFSZ: u8 = 24;
335 pub const __WASI_SIGVTALRM: u8 = 25;
336 pub const __WASI_SIGPROF: u8 = 26;
337 pub const __WASI_SIGWINCH: u8 = 27;
338 pub const __WASI_SIGPOLL: u8 = 28;
339 pub const __WASI_SIGPWR: u8 = 29;
340 pub const __WASI_SIGSYS: u8 = 30;
341 pub const __WASI_SUBSCRIPTION_CLOCK_ABSTIME: u16 = 0x0001;
342 pub const __WASI_WHENCE_CUR: u8 = 0;
343 pub const __WASI_WHENCE_END: u8 = 1;
344 pub const __WASI_WHENCE_SET: u8 = 2;
345 pub const __WASI_STDIN_FD: u32 = 0;
346 pub const __WASI_STDOUT_FD: u32 = 1;
347 pub const __WASI_STDERR_FD: u32 = 2;
348 
349 #[link(wasm_import_module = "wasi_unstable")]
350 extern "C" {
351     #[link_name = "clock_res_get"]
__wasi_clock_res_get( clock_id: __wasi_clockid_t, resolution: *mut __wasi_timestamp_t, ) -> __wasi_errno_t352     pub fn __wasi_clock_res_get(
353         clock_id: __wasi_clockid_t,
354         resolution: *mut __wasi_timestamp_t,
355     ) -> __wasi_errno_t;
356 
357     #[link_name = "clock_time_get"]
__wasi_clock_time_get( clock_id: __wasi_clockid_t, precision: __wasi_timestamp_t, time: *mut __wasi_timestamp_t, ) -> __wasi_errno_t358     pub fn __wasi_clock_time_get(
359         clock_id: __wasi_clockid_t,
360         precision: __wasi_timestamp_t,
361         time: *mut __wasi_timestamp_t,
362     ) -> __wasi_errno_t;
363 
364     #[link_name = "fd_close"]
__wasi_fd_close(fd: __wasi_fd_t) -> __wasi_errno_t365     pub fn __wasi_fd_close(fd: __wasi_fd_t) -> __wasi_errno_t;
366 
367     #[link_name = "fd_datasync"]
__wasi_fd_datasync(fd: __wasi_fd_t) -> __wasi_errno_t368     pub fn __wasi_fd_datasync(fd: __wasi_fd_t) -> __wasi_errno_t;
369 
370     #[link_name = "fd_pread"]
__wasi_fd_pread( fd: __wasi_fd_t, iovs: *const __wasi_iovec_t, iovs_len: usize, offset: __wasi_filesize_t, nread: *mut usize, ) -> __wasi_errno_t371     pub fn __wasi_fd_pread(
372         fd: __wasi_fd_t,
373         iovs: *const __wasi_iovec_t,
374         iovs_len: usize,
375         offset: __wasi_filesize_t,
376         nread: *mut usize,
377     ) -> __wasi_errno_t;
378 
379     #[link_name = "fd_pwrite"]
__wasi_fd_pwrite( fd: __wasi_fd_t, iovs: *const __wasi_ciovec_t, iovs_len: usize, offset: __wasi_filesize_t, nwritten: *mut usize, ) -> __wasi_errno_t380     pub fn __wasi_fd_pwrite(
381         fd: __wasi_fd_t,
382         iovs: *const __wasi_ciovec_t,
383         iovs_len: usize,
384         offset: __wasi_filesize_t,
385         nwritten: *mut usize,
386     ) -> __wasi_errno_t;
387 
388     #[link_name = "fd_read"]
__wasi_fd_read( fd: __wasi_fd_t, iovs: *const __wasi_iovec_t, iovs_len: usize, nread: *mut usize, ) -> __wasi_errno_t389     pub fn __wasi_fd_read(
390         fd: __wasi_fd_t,
391         iovs: *const __wasi_iovec_t,
392         iovs_len: usize,
393         nread: *mut usize,
394     ) -> __wasi_errno_t;
395 
396     #[link_name = "fd_renumber"]
__wasi_fd_renumber(from: __wasi_fd_t, to: __wasi_fd_t) -> __wasi_errno_t397     pub fn __wasi_fd_renumber(from: __wasi_fd_t, to: __wasi_fd_t) -> __wasi_errno_t;
398 
399     #[link_name = "fd_seek"]
__wasi_fd_seek( fd: __wasi_fd_t, offset: __wasi_filedelta_t, whence: __wasi_whence_t, newoffset: *mut __wasi_filesize_t, ) -> __wasi_errno_t400     pub fn __wasi_fd_seek(
401         fd: __wasi_fd_t,
402         offset: __wasi_filedelta_t,
403         whence: __wasi_whence_t,
404         newoffset: *mut __wasi_filesize_t,
405     ) -> __wasi_errno_t;
406 
407     #[link_name = "fd_tell"]
__wasi_fd_tell(fd: __wasi_fd_t, newoffset: *mut __wasi_filesize_t) -> __wasi_errno_t408     pub fn __wasi_fd_tell(fd: __wasi_fd_t, newoffset: *mut __wasi_filesize_t) -> __wasi_errno_t;
409 
410     #[link_name = "fd_fdstat_get"]
__wasi_fd_fdstat_get(fd: __wasi_fd_t, buf: *mut __wasi_fdstat_t) -> __wasi_errno_t411     pub fn __wasi_fd_fdstat_get(fd: __wasi_fd_t, buf: *mut __wasi_fdstat_t) -> __wasi_errno_t;
412 
413     #[link_name = "fd_fdstat_set_flags"]
__wasi_fd_fdstat_set_flags(fd: __wasi_fd_t, flags: __wasi_fdflags_t) -> __wasi_errno_t414     pub fn __wasi_fd_fdstat_set_flags(fd: __wasi_fd_t, flags: __wasi_fdflags_t) -> __wasi_errno_t;
415 
416     #[link_name = "fd_fdstat_set_rights"]
__wasi_fd_fdstat_set_rights( fd: __wasi_fd_t, fs_rights_base: __wasi_rights_t, fs_rights_inheriting: __wasi_rights_t, ) -> __wasi_errno_t417     pub fn __wasi_fd_fdstat_set_rights(
418         fd: __wasi_fd_t,
419         fs_rights_base: __wasi_rights_t,
420         fs_rights_inheriting: __wasi_rights_t,
421     ) -> __wasi_errno_t;
422 
423     #[link_name = "fd_sync"]
__wasi_fd_sync(fd: __wasi_fd_t) -> __wasi_errno_t424     pub fn __wasi_fd_sync(fd: __wasi_fd_t) -> __wasi_errno_t;
425 
426     #[link_name = "fd_write"]
__wasi_fd_write( fd: __wasi_fd_t, iovs: *const __wasi_ciovec_t, iovs_len: usize, nwritten: *mut usize, ) -> __wasi_errno_t427     pub fn __wasi_fd_write(
428         fd: __wasi_fd_t,
429         iovs: *const __wasi_ciovec_t,
430         iovs_len: usize,
431         nwritten: *mut usize,
432     ) -> __wasi_errno_t;
433 
434     #[link_name = "fd_advise"]
__wasi_fd_advise( fd: __wasi_fd_t, offset: __wasi_filesize_t, len: __wasi_filesize_t, advice: __wasi_advice_t, ) -> __wasi_errno_t435     pub fn __wasi_fd_advise(
436         fd: __wasi_fd_t,
437         offset: __wasi_filesize_t,
438         len: __wasi_filesize_t,
439         advice: __wasi_advice_t,
440     ) -> __wasi_errno_t;
441 
442     #[link_name = "fd_allocate"]
__wasi_fd_allocate( fd: __wasi_fd_t, offset: __wasi_filesize_t, len: __wasi_filesize_t, ) -> __wasi_errno_t443     pub fn __wasi_fd_allocate(
444         fd: __wasi_fd_t,
445         offset: __wasi_filesize_t,
446         len: __wasi_filesize_t,
447     ) -> __wasi_errno_t;
448 
449     #[link_name = "path_create_directory"]
__wasi_path_create_directory( fd: __wasi_fd_t, path: *const u8, path_len: usize, ) -> __wasi_errno_t450     pub fn __wasi_path_create_directory(
451         fd: __wasi_fd_t,
452         path: *const u8,
453         path_len: usize,
454     ) -> __wasi_errno_t;
455 
456     #[link_name = "path_link"]
__wasi_path_link( old_fd: __wasi_fd_t, old_flags: __wasi_lookupflags_t, old_path: *const u8, old_path_len: usize, new_fd: __wasi_fd_t, new_path: *const u8, new_path_len: usize, ) -> __wasi_errno_t457     pub fn __wasi_path_link(
458         old_fd: __wasi_fd_t,
459         old_flags: __wasi_lookupflags_t,
460         old_path: *const u8,
461         old_path_len: usize,
462         new_fd: __wasi_fd_t,
463         new_path: *const u8,
464         new_path_len: usize,
465     ) -> __wasi_errno_t;
466 
467     #[link_name = "path_open"]
__wasi_path_open( dirfd: __wasi_fd_t, dirflags: __wasi_lookupflags_t, path: *const u8, path_len: usize, oflags: __wasi_oflags_t, fs_rights_base: __wasi_rights_t, fs_rights_inheriting: __wasi_rights_t, fs_flags: __wasi_fdflags_t, fd: *mut __wasi_fd_t, ) -> __wasi_errno_t468     pub fn __wasi_path_open(
469         dirfd: __wasi_fd_t,
470         dirflags: __wasi_lookupflags_t,
471         path: *const u8,
472         path_len: usize,
473         oflags: __wasi_oflags_t,
474         fs_rights_base: __wasi_rights_t,
475         fs_rights_inheriting: __wasi_rights_t,
476         fs_flags: __wasi_fdflags_t,
477         fd: *mut __wasi_fd_t,
478     ) -> __wasi_errno_t;
479 
480     #[link_name = "fd_readdir"]
__wasi_fd_readdir( fd: __wasi_fd_t, buf: *mut c_void, buf_len: usize, cookie: __wasi_dircookie_t, bufused: *mut usize, ) -> __wasi_errno_t481     pub fn __wasi_fd_readdir(
482         fd: __wasi_fd_t,
483         buf: *mut c_void,
484         buf_len: usize,
485         cookie: __wasi_dircookie_t,
486         bufused: *mut usize,
487     ) -> __wasi_errno_t;
488 
489     #[link_name = "path_readlink"]
__wasi_path_readlink( fd: __wasi_fd_t, path: *const u8, path_len: usize, buf: *mut u8, buf_len: usize, bufused: *mut usize, ) -> __wasi_errno_t490     pub fn __wasi_path_readlink(
491         fd: __wasi_fd_t,
492         path: *const u8,
493         path_len: usize,
494         buf: *mut u8,
495         buf_len: usize,
496         bufused: *mut usize,
497     ) -> __wasi_errno_t;
498 
499     #[link_name = "path_rename"]
__wasi_path_rename( old_fd: __wasi_fd_t, old_path: *const u8, old_path_len: usize, new_fd: __wasi_fd_t, new_path: *const u8, new_path_len: usize, ) -> __wasi_errno_t500     pub fn __wasi_path_rename(
501         old_fd: __wasi_fd_t,
502         old_path: *const u8,
503         old_path_len: usize,
504         new_fd: __wasi_fd_t,
505         new_path: *const u8,
506         new_path_len: usize,
507     ) -> __wasi_errno_t;
508 
509     #[link_name = "fd_filestat_get"]
__wasi_fd_filestat_get(fd: __wasi_fd_t, buf: *mut __wasi_filestat_t) -> __wasi_errno_t510     pub fn __wasi_fd_filestat_get(fd: __wasi_fd_t, buf: *mut __wasi_filestat_t) -> __wasi_errno_t;
511 
512     #[link_name = "fd_filestat_set_times"]
__wasi_fd_filestat_set_times( fd: __wasi_fd_t, st_atim: __wasi_timestamp_t, st_mtim: __wasi_timestamp_t, fstflags: __wasi_fstflags_t, ) -> __wasi_errno_t513     pub fn __wasi_fd_filestat_set_times(
514         fd: __wasi_fd_t,
515         st_atim: __wasi_timestamp_t,
516         st_mtim: __wasi_timestamp_t,
517         fstflags: __wasi_fstflags_t,
518     ) -> __wasi_errno_t;
519 
520     #[link_name = "fd_filestat_set_size"]
__wasi_fd_filestat_set_size( fd: __wasi_fd_t, st_size: __wasi_filesize_t, ) -> __wasi_errno_t521     pub fn __wasi_fd_filestat_set_size(
522         fd: __wasi_fd_t,
523         st_size: __wasi_filesize_t,
524     ) -> __wasi_errno_t;
525 
526     #[link_name = "path_filestat_get"]
__wasi_path_filestat_get( fd: __wasi_fd_t, flags: __wasi_lookupflags_t, path: *const u8, path_len: usize, buf: *mut __wasi_filestat_t, ) -> __wasi_errno_t527     pub fn __wasi_path_filestat_get(
528         fd: __wasi_fd_t,
529         flags: __wasi_lookupflags_t,
530         path: *const u8,
531         path_len: usize,
532         buf: *mut __wasi_filestat_t,
533     ) -> __wasi_errno_t;
534 
535     #[link_name = "path_filestat_set_times"]
__wasi_path_filestat_set_times( fd: __wasi_fd_t, flags: __wasi_lookupflags_t, path: *const u8, path_len: usize, st_atim: __wasi_timestamp_t, st_mtim: __wasi_timestamp_t, fstflags: __wasi_fstflags_t, ) -> __wasi_errno_t536     pub fn __wasi_path_filestat_set_times(
537         fd: __wasi_fd_t,
538         flags: __wasi_lookupflags_t,
539         path: *const u8,
540         path_len: usize,
541         st_atim: __wasi_timestamp_t,
542         st_mtim: __wasi_timestamp_t,
543         fstflags: __wasi_fstflags_t,
544     ) -> __wasi_errno_t;
545 
546     #[link_name = "path_symlink"]
__wasi_path_symlink( old_path: *const u8, old_path_len: usize, fd: __wasi_fd_t, new_path: *const u8, new_path_len: usize, ) -> __wasi_errno_t547     pub fn __wasi_path_symlink(
548         old_path: *const u8,
549         old_path_len: usize,
550         fd: __wasi_fd_t,
551         new_path: *const u8,
552         new_path_len: usize,
553     ) -> __wasi_errno_t;
554 
555     #[link_name = "path_unlink_file"]
__wasi_path_unlink_file( fd: __wasi_fd_t, path: *const u8, path_len: usize, ) -> __wasi_errno_t556     pub fn __wasi_path_unlink_file(
557         fd: __wasi_fd_t,
558         path: *const u8,
559         path_len: usize,
560     ) -> __wasi_errno_t;
561 
562     #[link_name = "path_remove_directory"]
__wasi_path_remove_directory( fd: __wasi_fd_t, path: *const u8, path_len: usize, ) -> __wasi_errno_t563     pub fn __wasi_path_remove_directory(
564         fd: __wasi_fd_t,
565         path: *const u8,
566         path_len: usize,
567     ) -> __wasi_errno_t;
568 
569     #[link_name = "poll_oneoff"]
__wasi_poll_oneoff( in_: *const __wasi_subscription_t, out: *mut __wasi_event_t, nsubscriptions: usize, nevents: *mut usize, ) -> __wasi_errno_t570     pub fn __wasi_poll_oneoff(
571         in_: *const __wasi_subscription_t,
572         out: *mut __wasi_event_t,
573         nsubscriptions: usize,
574         nevents: *mut usize,
575     ) -> __wasi_errno_t;
576 
577     #[link_name = "proc_exit"]
__wasi_proc_exit(rval: __wasi_exitcode_t) -> !578     pub fn __wasi_proc_exit(rval: __wasi_exitcode_t) -> !;
579 
580     #[link_name = "random_get"]
__wasi_random_get(buf: *mut c_void, buf_len: usize) -> __wasi_errno_t581     pub fn __wasi_random_get(buf: *mut c_void, buf_len: usize) -> __wasi_errno_t;
582 
583     #[link_name = "sock_recv"]
__wasi_sock_recv( sock: __wasi_fd_t, ri_data: *const __wasi_iovec_t, ri_data_len: usize, ri_flags: __wasi_riflags_t, ro_datalen: *mut usize, ro_flags: *mut __wasi_roflags_t, ) -> __wasi_errno_t584     pub fn __wasi_sock_recv(
585         sock: __wasi_fd_t,
586         ri_data: *const __wasi_iovec_t,
587         ri_data_len: usize,
588         ri_flags: __wasi_riflags_t,
589         ro_datalen: *mut usize,
590         ro_flags: *mut __wasi_roflags_t,
591     ) -> __wasi_errno_t;
592 
593     #[link_name = "sock_send"]
__wasi_sock_send( sock: __wasi_fd_t, si_data: *const __wasi_ciovec_t, si_data_len: usize, si_flags: __wasi_siflags_t, so_datalen: *mut usize, ) -> __wasi_errno_t594     pub fn __wasi_sock_send(
595         sock: __wasi_fd_t,
596         si_data: *const __wasi_ciovec_t,
597         si_data_len: usize,
598         si_flags: __wasi_siflags_t,
599         so_datalen: *mut usize,
600     ) -> __wasi_errno_t;
601 
602     #[link_name = "sock_shutdown"]
__wasi_sock_shutdown(sock: __wasi_fd_t, how: __wasi_sdflags_t) -> __wasi_errno_t603     pub fn __wasi_sock_shutdown(sock: __wasi_fd_t, how: __wasi_sdflags_t) -> __wasi_errno_t;
604 
605     #[link_name = "sched_yield"]
__wasi_sched_yield() -> __wasi_errno_t606     pub fn __wasi_sched_yield() -> __wasi_errno_t;
607 
608     #[link_name = "args_get"]
__wasi_args_get(argv: *mut *mut u8, argv_buf: *mut u8) -> __wasi_errno_t609     pub fn __wasi_args_get(argv: *mut *mut u8, argv_buf: *mut u8) -> __wasi_errno_t;
610 
611     #[link_name = "args_sizes_get"]
__wasi_args_sizes_get(argc: *mut usize, argv_buf_size: *mut usize) -> __wasi_errno_t612     pub fn __wasi_args_sizes_get(argc: *mut usize, argv_buf_size: *mut usize) -> __wasi_errno_t;
613 
614     #[link_name = "environ_get"]
__wasi_environ_get(environ: *mut *mut u8, environ_buf: *mut u8) -> __wasi_errno_t615     pub fn __wasi_environ_get(environ: *mut *mut u8, environ_buf: *mut u8) -> __wasi_errno_t;
616 
617     #[link_name = "environ_sizes_get"]
__wasi_environ_sizes_get( environ_count: *mut usize, environ_buf_size: *mut usize, ) -> __wasi_errno_t618     pub fn __wasi_environ_sizes_get(
619         environ_count: *mut usize,
620         environ_buf_size: *mut usize,
621     ) -> __wasi_errno_t;
622 
623     #[link_name = "fd_prestat_get"]
__wasi_fd_prestat_get(fd: __wasi_fd_t, buf: *mut __wasi_prestat_t) -> __wasi_errno_t624     pub fn __wasi_fd_prestat_get(fd: __wasi_fd_t, buf: *mut __wasi_prestat_t) -> __wasi_errno_t;
625 
626     #[link_name = "fd_prestat_dir_name"]
__wasi_fd_prestat_dir_name( fd: __wasi_fd_t, path: *mut u8, path_len: usize, ) -> __wasi_errno_t627     pub fn __wasi_fd_prestat_dir_name(
628         fd: __wasi_fd_t,
629         path: *mut u8,
630         path_len: usize,
631     ) -> __wasi_errno_t;
632 }
633