1 use super::{Send, Sync};
2 use core::iter::Iterator;
3 
4 pub use ffi::c_void;
5 
6 pub type c_char = i8;
7 pub type c_uchar = u8;
8 pub type c_schar = i8;
9 pub type c_int = i32;
10 pub type c_uint = u32;
11 pub type c_short = i16;
12 pub type c_ushort = u16;
13 pub type c_long = i32;
14 pub type c_ulong = u32;
15 pub type c_longlong = i64;
16 pub type c_ulonglong = u64;
17 pub type intmax_t = i64;
18 pub type uintmax_t = u64;
19 pub type size_t = usize;
20 pub type ssize_t = isize;
21 pub type ptrdiff_t = isize;
22 pub type intptr_t = isize;
23 pub type uintptr_t = usize;
24 pub type off_t = i64;
25 pub type pid_t = i32;
26 pub type clock_t = c_longlong;
27 pub type time_t = c_longlong;
28 pub type c_double = f64;
29 pub type c_float = f32;
30 pub type ino_t = u64;
31 pub type sigset_t = c_uchar;
32 pub type suseconds_t = c_longlong;
33 pub type mode_t = u32;
34 pub type dev_t = u64;
35 pub type uid_t = u32;
36 pub type gid_t = u32;
37 pub type nlink_t = u64;
38 pub type blksize_t = c_long;
39 pub type blkcnt_t = i64;
40 pub type nfds_t = c_ulong;
41 pub type wchar_t = i32;
42 pub type nl_item = c_int;
43 pub type __wasi_rights_t = u64;
44 
45 s_no_extra_traits! {
46     #[repr(align(16))]
47     #[allow(missing_debug_implementations)]
48     pub struct max_align_t {
49         priv_: [f64; 4]
50     }
51 }
52 
53 #[allow(missing_copy_implementations)]
54 #[cfg_attr(feature = "extra_traits", derive(Debug))]
55 pub enum FILE {}
56 #[allow(missing_copy_implementations)]
57 #[cfg_attr(feature = "extra_traits", derive(Debug))]
58 pub enum DIR {}
59 #[allow(missing_copy_implementations)]
60 #[cfg_attr(feature = "extra_traits", derive(Debug))]
61 pub enum __locale_struct {}
62 
63 pub type locale_t = *mut __locale_struct;
64 
65 s_paren! {
66     // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct),
67     // but that's an implementation detail that we don't want to have to deal with
68     #[repr(transparent)]
69     #[allow(dead_code)]
70     pub struct clockid_t(*const u8);
71 }
72 
73 unsafe impl Send for clockid_t {}
74 unsafe impl Sync for clockid_t {}
75 
76 s! {
77     #[repr(align(8))]
78     pub struct fpos_t {
79         data: [u8; 16],
80     }
81 
82     pub struct tm {
83         pub tm_sec: c_int,
84         pub tm_min: c_int,
85         pub tm_hour: c_int,
86         pub tm_mday: c_int,
87         pub tm_mon: c_int,
88         pub tm_year: c_int,
89         pub tm_wday: c_int,
90         pub tm_yday: c_int,
91         pub tm_isdst: c_int,
92         pub __tm_gmtoff: c_int,
93         pub __tm_zone: *const c_char,
94         pub __tm_nsec: c_int,
95     }
96 
97     pub struct timeval {
98         pub tv_sec: time_t,
99         pub tv_usec: suseconds_t,
100     }
101 
102     pub struct timespec {
103         pub tv_sec: time_t,
104         pub tv_nsec: c_long,
105     }
106 
107     pub struct tms {
108         pub tms_utime: clock_t,
109         pub tms_stime: clock_t,
110         pub tms_cutime: clock_t,
111         pub tms_cstime: clock_t,
112     }
113 
114     pub struct itimerspec {
115         pub it_interval: timespec,
116         pub it_value: timespec,
117     }
118 
119     pub struct iovec {
120         pub iov_base: *mut c_void,
121         pub iov_len: size_t,
122     }
123 
124     pub struct lconv {
125         pub decimal_point: *mut c_char,
126         pub thousands_sep: *mut c_char,
127         pub grouping: *mut c_char,
128         pub int_curr_symbol: *mut c_char,
129         pub currency_symbol: *mut c_char,
130         pub mon_decimal_point: *mut c_char,
131         pub mon_thousands_sep: *mut c_char,
132         pub mon_grouping: *mut c_char,
133         pub positive_sign: *mut c_char,
134         pub negative_sign: *mut c_char,
135         pub int_frac_digits: c_char,
136         pub frac_digits: c_char,
137         pub p_cs_precedes: c_char,
138         pub p_sep_by_space: c_char,
139         pub n_cs_precedes: c_char,
140         pub n_sep_by_space: c_char,
141         pub p_sign_posn: c_char,
142         pub n_sign_posn: c_char,
143         pub int_p_cs_precedes: c_char,
144         pub int_p_sep_by_space: c_char,
145         pub int_n_cs_precedes: c_char,
146         pub int_n_sep_by_space: c_char,
147         pub int_p_sign_posn: c_char,
148         pub int_n_sign_posn: c_char,
149     }
150 
151     pub struct pollfd {
152         pub fd: c_int,
153         pub events: c_short,
154         pub revents: c_short,
155     }
156 
157     pub struct rusage {
158         pub ru_utime: timeval,
159         pub ru_stime: timeval,
160     }
161 
162     pub struct stat {
163         pub st_dev: dev_t,
164         pub st_ino: ino_t,
165         pub st_nlink: nlink_t,
166         pub st_mode: mode_t,
167         pub st_uid: uid_t,
168         pub st_gid: gid_t,
169         __pad0: c_uint,
170         pub st_rdev: dev_t,
171         pub st_size: off_t,
172         pub st_blksize: blksize_t,
173         pub st_blocks: blkcnt_t,
174         pub st_atim: timespec,
175         pub st_mtim: timespec,
176         pub st_ctim: timespec,
177         __reserved: [c_longlong; 3],
178     }
179 
180     pub struct fd_set {
181         __nfds: usize,
182         __fds: [c_int; FD_SETSIZE as usize],
183     }
184 }
185 
186 // Declare dirent outside of s! so that it doesn't implement Copy, Eq, Hash,
187 // etc., since it contains a flexible array member with a dynamic size.
188 #[repr(C)]
189 #[allow(missing_copy_implementations)]
190 #[cfg_attr(feature = "extra_traits", derive(Debug))]
191 pub struct dirent {
192     pub d_ino: ino_t,
193     pub d_type: c_uchar,
194     /// d_name is declared in WASI libc as a flexible array member, which
195     /// can't be directly expressed in Rust. As an imperfect workaround,
196     /// declare it as a zero-length array instead.
197     pub d_name: [c_char; 0],
198 }
199 
200 pub const EXIT_SUCCESS: c_int = 0;
201 pub const EXIT_FAILURE: c_int = 1;
202 pub const STDIN_FILENO: c_int = 0;
203 pub const STDOUT_FILENO: c_int = 1;
204 pub const STDERR_FILENO: c_int = 2;
205 pub const SEEK_SET: c_int = 0;
206 pub const SEEK_CUR: c_int = 1;
207 pub const SEEK_END: c_int = 2;
208 pub const _IOFBF: c_int = 0;
209 pub const _IONBF: c_int = 2;
210 pub const _IOLBF: c_int = 1;
211 pub const F_GETFD: c_int = 1;
212 pub const F_SETFD: c_int = 2;
213 pub const F_GETFL: c_int = 3;
214 pub const F_SETFL: c_int = 4;
215 pub const FD_CLOEXEC: c_int = 1;
216 pub const FD_SETSIZE: size_t = 1024;
217 pub const O_APPEND: c_int = 0x0001;
218 pub const O_DSYNC: c_int = 0x0002;
219 pub const O_NONBLOCK: c_int = 0x0004;
220 pub const O_RSYNC: c_int = 0x0008;
221 pub const O_SYNC: c_int = 0x0010;
222 pub const O_CREAT: c_int = 0x0001 << 12;
223 pub const O_DIRECTORY: c_int = 0x0002 << 12;
224 pub const O_EXCL: c_int = 0x0004 << 12;
225 pub const O_TRUNC: c_int = 0x0008 << 12;
226 pub const O_NOFOLLOW: c_int = 0x01000000;
227 pub const O_EXEC: c_int = 0x02000000;
228 pub const O_RDONLY: c_int = 0x04000000;
229 pub const O_SEARCH: c_int = 0x08000000;
230 pub const O_WRONLY: c_int = 0x10000000;
231 pub const O_CLOEXEC: c_int = 0x0;
232 pub const O_RDWR: c_int = O_WRONLY | O_RDONLY;
233 pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH;
234 pub const O_NOCTTY: c_int = 0x0;
235 pub const POSIX_FADV_DONTNEED: c_int = 4;
236 pub const POSIX_FADV_NOREUSE: c_int = 5;
237 pub const POSIX_FADV_NORMAL: c_int = 0;
238 pub const POSIX_FADV_RANDOM: c_int = 2;
239 pub const POSIX_FADV_SEQUENTIAL: c_int = 1;
240 pub const POSIX_FADV_WILLNEED: c_int = 3;
241 pub const AT_FDCWD: ::c_int = -2;
242 pub const AT_EACCESS: c_int = 0x0;
243 pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1;
244 pub const AT_SYMLINK_FOLLOW: c_int = 0x2;
245 pub const AT_REMOVEDIR: c_int = 0x4;
246 pub const UTIME_OMIT: c_long = 0xfffffffe;
247 pub const UTIME_NOW: c_long = 0xffffffff;
248 pub const S_IFIFO: mode_t = 0o1_0000;
249 pub const S_IFCHR: mode_t = 8192;
250 pub const S_IFBLK: mode_t = 24576;
251 pub const S_IFDIR: mode_t = 16384;
252 pub const S_IFREG: mode_t = 32768;
253 pub const S_IFLNK: mode_t = 40960;
254 pub const S_IFSOCK: mode_t = 49152;
255 pub const S_IFMT: mode_t = 0o17_0000;
256 pub const S_IRWXO: mode_t = 0x7;
257 pub const S_IXOTH: mode_t = 0x1;
258 pub const S_IWOTH: mode_t = 0x2;
259 pub const S_IROTH: mode_t = 0x4;
260 pub const S_IRWXG: mode_t = 0x38;
261 pub const S_IXGRP: mode_t = 0x8;
262 pub const S_IWGRP: mode_t = 0x10;
263 pub const S_IRGRP: mode_t = 0x20;
264 pub const S_IRWXU: mode_t = 0x1c0;
265 pub const S_IXUSR: mode_t = 0x40;
266 pub const S_IWUSR: mode_t = 0x80;
267 pub const S_IRUSR: mode_t = 0x100;
268 pub const S_ISVTX: mode_t = 0x200;
269 pub const S_ISGID: mode_t = 0x400;
270 pub const S_ISUID: mode_t = 0x800;
271 pub const DT_UNKNOWN: u8 = 0;
272 pub const DT_BLK: u8 = 1;
273 pub const DT_CHR: u8 = 2;
274 pub const DT_DIR: u8 = 3;
275 pub const DT_REG: u8 = 4;
276 pub const DT_LNK: u8 = 7;
277 pub const FIONREAD: c_int = 1;
278 pub const FIONBIO: c_int = 2;
279 pub const F_OK: ::c_int = 0;
280 pub const R_OK: ::c_int = 4;
281 pub const W_OK: ::c_int = 2;
282 pub const X_OK: ::c_int = 1;
283 pub const POLLIN: ::c_short = 0x1;
284 pub const POLLOUT: ::c_short = 0x2;
285 pub const POLLERR: ::c_short = 0x1000;
286 pub const POLLHUP: ::c_short = 0x2000;
287 pub const POLLNVAL: ::c_short = 0x4000;
288 pub const POLLRDNORM: ::c_short = 0x1;
289 pub const POLLWRNORM: ::c_short = 0x2;
290 
291 pub const E2BIG: c_int = 1;
292 pub const EACCES: c_int = 2;
293 pub const EADDRINUSE: c_int = 3;
294 pub const EADDRNOTAVAIL: c_int = 4;
295 pub const EAFNOSUPPORT: c_int = 5;
296 pub const EAGAIN: c_int = 6;
297 pub const EALREADY: c_int = 7;
298 pub const EBADF: c_int = 8;
299 pub const EBADMSG: c_int = 9;
300 pub const EBUSY: c_int = 10;
301 pub const ECANCELED: c_int = 11;
302 pub const ECHILD: c_int = 12;
303 pub const ECONNABORTED: c_int = 13;
304 pub const ECONNREFUSED: c_int = 14;
305 pub const ECONNRESET: c_int = 15;
306 pub const EDEADLK: c_int = 16;
307 pub const EDESTADDRREQ: c_int = 17;
308 pub const EDOM: c_int = 18;
309 pub const EDQUOT: c_int = 19;
310 pub const EEXIST: c_int = 20;
311 pub const EFAULT: c_int = 21;
312 pub const EFBIG: c_int = 22;
313 pub const EHOSTUNREACH: c_int = 23;
314 pub const EIDRM: c_int = 24;
315 pub const EILSEQ: c_int = 25;
316 pub const EINPROGRESS: c_int = 26;
317 pub const EINTR: c_int = 27;
318 pub const EINVAL: c_int = 28;
319 pub const EIO: c_int = 29;
320 pub const EISCONN: c_int = 30;
321 pub const EISDIR: c_int = 31;
322 pub const ELOOP: c_int = 32;
323 pub const EMFILE: c_int = 33;
324 pub const EMLINK: c_int = 34;
325 pub const EMSGSIZE: c_int = 35;
326 pub const EMULTIHOP: c_int = 36;
327 pub const ENAMETOOLONG: c_int = 37;
328 pub const ENETDOWN: c_int = 38;
329 pub const ENETRESET: c_int = 39;
330 pub const ENETUNREACH: c_int = 40;
331 pub const ENFILE: c_int = 41;
332 pub const ENOBUFS: c_int = 42;
333 pub const ENODEV: c_int = 43;
334 pub const ENOENT: c_int = 44;
335 pub const ENOEXEC: c_int = 45;
336 pub const ENOLCK: c_int = 46;
337 pub const ENOLINK: c_int = 47;
338 pub const ENOMEM: c_int = 48;
339 pub const ENOMSG: c_int = 49;
340 pub const ENOPROTOOPT: c_int = 50;
341 pub const ENOSPC: c_int = 51;
342 pub const ENOSYS: c_int = 52;
343 pub const ENOTCONN: c_int = 53;
344 pub const ENOTDIR: c_int = 54;
345 pub const ENOTEMPTY: c_int = 55;
346 pub const ENOTRECOVERABLE: c_int = 56;
347 pub const ENOTSOCK: c_int = 57;
348 pub const ENOTSUP: c_int = 58;
349 pub const ENOTTY: c_int = 59;
350 pub const ENXIO: c_int = 60;
351 pub const EOVERFLOW: c_int = 61;
352 pub const EOWNERDEAD: c_int = 62;
353 pub const EPERM: c_int = 63;
354 pub const EPIPE: c_int = 64;
355 pub const EPROTO: c_int = 65;
356 pub const EPROTONOSUPPORT: c_int = 66;
357 pub const EPROTOTYPE: c_int = 67;
358 pub const ERANGE: c_int = 68;
359 pub const EROFS: c_int = 69;
360 pub const ESPIPE: c_int = 70;
361 pub const ESRCH: c_int = 71;
362 pub const ESTALE: c_int = 72;
363 pub const ETIMEDOUT: c_int = 73;
364 pub const ETXTBSY: c_int = 74;
365 pub const EXDEV: c_int = 75;
366 pub const ENOTCAPABLE: c_int = 76;
367 pub const EOPNOTSUPP: c_int = ENOTSUP;
368 pub const EWOULDBLOCK: c_int = EAGAIN;
369 
370 pub const _SC_PAGESIZE: c_int = 30;
371 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
372 pub const _SC_IOV_MAX: c_int = 60;
373 pub const _SC_SYMLOOP_MAX: c_int = 173;
374 
375 cfg_if! {
376     if #[cfg(libc_ctest)] {
377         // skip these constants when this is active because `ctest` currently
378         // panics on parsing the constants below
379     } else {
380         // `addr_of!(EXTERN_STATIC)` is now safe; remove `unsafe` when MSRV >= 1.82
381         #[allow(unused_unsafe)]
382         pub static CLOCK_MONOTONIC: clockid_t =
383             unsafe { clockid_t(ptr_addr_of!(_CLOCK_MONOTONIC)) };
384         #[allow(unused_unsafe)]
385         pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t =
386             unsafe { clockid_t(ptr_addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) };
387         #[allow(unused_unsafe)]
388         pub static CLOCK_REALTIME: clockid_t =
389             unsafe { clockid_t(ptr_addr_of!(_CLOCK_REALTIME)) };
390         #[allow(unused_unsafe)]
391         pub static CLOCK_THREAD_CPUTIME_ID: clockid_t =
392             unsafe { clockid_t(ptr_addr_of!(_CLOCK_THREAD_CPUTIME_ID)) };
393     }
394 }
395 
396 pub const ABDAY_1: ::nl_item = 0x20000;
397 pub const ABDAY_2: ::nl_item = 0x20001;
398 pub const ABDAY_3: ::nl_item = 0x20002;
399 pub const ABDAY_4: ::nl_item = 0x20003;
400 pub const ABDAY_5: ::nl_item = 0x20004;
401 pub const ABDAY_6: ::nl_item = 0x20005;
402 pub const ABDAY_7: ::nl_item = 0x20006;
403 
404 pub const DAY_1: ::nl_item = 0x20007;
405 pub const DAY_2: ::nl_item = 0x20008;
406 pub const DAY_3: ::nl_item = 0x20009;
407 pub const DAY_4: ::nl_item = 0x2000A;
408 pub const DAY_5: ::nl_item = 0x2000B;
409 pub const DAY_6: ::nl_item = 0x2000C;
410 pub const DAY_7: ::nl_item = 0x2000D;
411 
412 pub const ABMON_1: ::nl_item = 0x2000E;
413 pub const ABMON_2: ::nl_item = 0x2000F;
414 pub const ABMON_3: ::nl_item = 0x20010;
415 pub const ABMON_4: ::nl_item = 0x20011;
416 pub const ABMON_5: ::nl_item = 0x20012;
417 pub const ABMON_6: ::nl_item = 0x20013;
418 pub const ABMON_7: ::nl_item = 0x20014;
419 pub const ABMON_8: ::nl_item = 0x20015;
420 pub const ABMON_9: ::nl_item = 0x20016;
421 pub const ABMON_10: ::nl_item = 0x20017;
422 pub const ABMON_11: ::nl_item = 0x20018;
423 pub const ABMON_12: ::nl_item = 0x20019;
424 
425 pub const MON_1: ::nl_item = 0x2001A;
426 pub const MON_2: ::nl_item = 0x2001B;
427 pub const MON_3: ::nl_item = 0x2001C;
428 pub const MON_4: ::nl_item = 0x2001D;
429 pub const MON_5: ::nl_item = 0x2001E;
430 pub const MON_6: ::nl_item = 0x2001F;
431 pub const MON_7: ::nl_item = 0x20020;
432 pub const MON_8: ::nl_item = 0x20021;
433 pub const MON_9: ::nl_item = 0x20022;
434 pub const MON_10: ::nl_item = 0x20023;
435 pub const MON_11: ::nl_item = 0x20024;
436 pub const MON_12: ::nl_item = 0x20025;
437 
438 pub const AM_STR: ::nl_item = 0x20026;
439 pub const PM_STR: ::nl_item = 0x20027;
440 
441 pub const D_T_FMT: ::nl_item = 0x20028;
442 pub const D_FMT: ::nl_item = 0x20029;
443 pub const T_FMT: ::nl_item = 0x2002A;
444 pub const T_FMT_AMPM: ::nl_item = 0x2002B;
445 
446 pub const ERA: ::nl_item = 0x2002C;
447 pub const ERA_D_FMT: ::nl_item = 0x2002E;
448 pub const ALT_DIGITS: ::nl_item = 0x2002F;
449 pub const ERA_D_T_FMT: ::nl_item = 0x20030;
450 pub const ERA_T_FMT: ::nl_item = 0x20031;
451 
452 pub const CODESET: ::nl_item = 14;
453 pub const CRNCYSTR: ::nl_item = 0x4000F;
454 pub const RADIXCHAR: ::nl_item = 0x10000;
455 pub const THOUSEP: ::nl_item = 0x10001;
456 pub const YESEXPR: ::nl_item = 0x50000;
457 pub const NOEXPR: ::nl_item = 0x50001;
458 pub const YESSTR: ::nl_item = 0x50002;
459 pub const NOSTR: ::nl_item = 0x50003;
460 
461 f! {
462     pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
463         let set = &*set;
464         let n = set.__nfds;
465         return set.__fds[..n].iter().any(|p| *p == fd)
466     }
467 
468     pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
469         let set = &mut *set;
470         let n = set.__nfds;
471         if !set.__fds[..n].iter().any(|p| *p == fd) {
472             set.__nfds = n + 1;
473             set.__fds[n] = fd;
474         }
475     }
476 
477     pub fn FD_ZERO(set: *mut fd_set) -> () {
478         (*set).__nfds = 0;
479         return
480     }
481 }
482 
483 #[cfg_attr(
484     feature = "rustc-dep-of-std",
485     link(
486         name = "c",
487         kind = "static",
488         modifiers = "-bundle",
489         cfg(target_feature = "crt-static")
490     )
491 )]
492 #[cfg_attr(
493     feature = "rustc-dep-of-std",
494     link(name = "c", cfg(not(target_feature = "crt-static")))
495 )]
496 extern "C" {
_Exit(code: c_int) -> !497     pub fn _Exit(code: c_int) -> !;
_exit(code: c_int) -> !498     pub fn _exit(code: c_int) -> !;
abort() -> !499     pub fn abort() -> !;
aligned_alloc(a: size_t, b: size_t) -> *mut c_void500     pub fn aligned_alloc(a: size_t, b: size_t) -> *mut c_void;
calloc(amt: size_t, amt2: size_t) -> *mut c_void501     pub fn calloc(amt: size_t, amt2: size_t) -> *mut c_void;
exit(code: c_int) -> !502     pub fn exit(code: c_int) -> !;
free(ptr: *mut c_void)503     pub fn free(ptr: *mut c_void);
getenv(s: *const c_char) -> *mut c_char504     pub fn getenv(s: *const c_char) -> *mut c_char;
malloc(amt: size_t) -> *mut c_void505     pub fn malloc(amt: size_t) -> *mut c_void;
malloc_usable_size(ptr: *mut c_void) -> size_t506     pub fn malloc_usable_size(ptr: *mut c_void) -> size_t;
sbrk(increment: ::intptr_t) -> *mut ::c_void507     pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
rand() -> c_int508     pub fn rand() -> c_int;
read(fd: c_int, ptr: *mut c_void, size: size_t) -> ssize_t509     pub fn read(fd: c_int, ptr: *mut c_void, size: size_t) -> ssize_t;
realloc(ptr: *mut c_void, amt: size_t) -> *mut c_void510     pub fn realloc(ptr: *mut c_void, amt: size_t) -> *mut c_void;
setenv(k: *const c_char, v: *const c_char, a: c_int) -> c_int511     pub fn setenv(k: *const c_char, v: *const c_char, a: c_int) -> c_int;
unsetenv(k: *const c_char) -> c_int512     pub fn unsetenv(k: *const c_char) -> c_int;
clearenv() -> ::c_int513     pub fn clearenv() -> ::c_int;
write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t514     pub fn write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t;
515     pub static mut environ: *mut *mut c_char;
fopen(a: *const c_char, b: *const c_char) -> *mut FILE516     pub fn fopen(a: *const c_char, b: *const c_char) -> *mut FILE;
freopen(a: *const c_char, b: *const c_char, f: *mut FILE) -> *mut FILE517     pub fn freopen(a: *const c_char, b: *const c_char, f: *mut FILE) -> *mut FILE;
fclose(f: *mut FILE) -> c_int518     pub fn fclose(f: *mut FILE) -> c_int;
remove(a: *const c_char) -> c_int519     pub fn remove(a: *const c_char) -> c_int;
rename(a: *const c_char, b: *const c_char) -> c_int520     pub fn rename(a: *const c_char, b: *const c_char) -> c_int;
feof(f: *mut FILE) -> c_int521     pub fn feof(f: *mut FILE) -> c_int;
ferror(f: *mut FILE) -> c_int522     pub fn ferror(f: *mut FILE) -> c_int;
fflush(f: *mut FILE) -> c_int523     pub fn fflush(f: *mut FILE) -> c_int;
clearerr(f: *mut FILE)524     pub fn clearerr(f: *mut FILE);
fseek(f: *mut FILE, b: c_long, c: c_int) -> c_int525     pub fn fseek(f: *mut FILE, b: c_long, c: c_int) -> c_int;
ftell(f: *mut FILE) -> c_long526     pub fn ftell(f: *mut FILE) -> c_long;
rewind(f: *mut FILE)527     pub fn rewind(f: *mut FILE);
fgetpos(f: *mut FILE, pos: *mut fpos_t) -> c_int528     pub fn fgetpos(f: *mut FILE, pos: *mut fpos_t) -> c_int;
fsetpos(f: *mut FILE, pos: *const fpos_t) -> c_int529     pub fn fsetpos(f: *mut FILE, pos: *const fpos_t) -> c_int;
fread(buf: *mut c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t530     pub fn fread(buf: *mut c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t;
fwrite(buf: *const c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t531     pub fn fwrite(buf: *const c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t;
fgetc(f: *mut FILE) -> c_int532     pub fn fgetc(f: *mut FILE) -> c_int;
getc(f: *mut FILE) -> c_int533     pub fn getc(f: *mut FILE) -> c_int;
getchar() -> c_int534     pub fn getchar() -> c_int;
ungetc(a: c_int, f: *mut FILE) -> c_int535     pub fn ungetc(a: c_int, f: *mut FILE) -> c_int;
fputc(a: c_int, f: *mut FILE) -> c_int536     pub fn fputc(a: c_int, f: *mut FILE) -> c_int;
putc(a: c_int, f: *mut FILE) -> c_int537     pub fn putc(a: c_int, f: *mut FILE) -> c_int;
putchar(a: c_int) -> c_int538     pub fn putchar(a: c_int) -> c_int;
fputs(a: *const c_char, f: *mut FILE) -> c_int539     pub fn fputs(a: *const c_char, f: *mut FILE) -> c_int;
puts(a: *const c_char) -> c_int540     pub fn puts(a: *const c_char) -> c_int;
perror(a: *const c_char)541     pub fn perror(a: *const c_char);
srand(a: c_uint)542     pub fn srand(a: c_uint);
atexit(a: extern "C" fn()) -> c_int543     pub fn atexit(a: extern "C" fn()) -> c_int;
at_quick_exit(a: extern "C" fn()) -> c_int544     pub fn at_quick_exit(a: extern "C" fn()) -> c_int;
quick_exit(a: c_int) -> !545     pub fn quick_exit(a: c_int) -> !;
posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int546     pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int;
rand_r(a: *mut c_uint) -> c_int547     pub fn rand_r(a: *mut c_uint) -> c_int;
random() -> c_long548     pub fn random() -> c_long;
srandom(a: c_uint)549     pub fn srandom(a: c_uint);
putenv(a: *mut c_char) -> c_int550     pub fn putenv(a: *mut c_char) -> c_int;
clock() -> clock_t551     pub fn clock() -> clock_t;
time(a: *mut time_t) -> time_t552     pub fn time(a: *mut time_t) -> time_t;
difftime(a: time_t, b: time_t) -> c_double553     pub fn difftime(a: time_t, b: time_t) -> c_double;
mktime(a: *mut tm) -> time_t554     pub fn mktime(a: *mut tm) -> time_t;
strftime(a: *mut c_char, b: size_t, c: *const c_char, d: *const tm) -> size_t555     pub fn strftime(a: *mut c_char, b: size_t, c: *const c_char, d: *const tm) -> size_t;
gmtime(a: *const time_t) -> *mut tm556     pub fn gmtime(a: *const time_t) -> *mut tm;
gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm557     pub fn gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm;
localtime(a: *const time_t) -> *mut tm558     pub fn localtime(a: *const time_t) -> *mut tm;
localtime_r(a: *const time_t, b: *mut tm) -> *mut tm559     pub fn localtime_r(a: *const time_t, b: *mut tm) -> *mut tm;
asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char560     pub fn asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char;
ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char561     pub fn ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char;
562 
563     static _CLOCK_MONOTONIC: u8;
564     static _CLOCK_PROCESS_CPUTIME_ID: u8;
565     static _CLOCK_REALTIME: u8;
566     static _CLOCK_THREAD_CPUTIME_ID: u8;
nanosleep(a: *const timespec, b: *mut timespec) -> c_int567     pub fn nanosleep(a: *const timespec, b: *mut timespec) -> c_int;
clock_getres(a: clockid_t, b: *mut timespec) -> c_int568     pub fn clock_getres(a: clockid_t, b: *mut timespec) -> c_int;
clock_gettime(a: clockid_t, b: *mut timespec) -> c_int569     pub fn clock_gettime(a: clockid_t, b: *mut timespec) -> c_int;
clock_nanosleep(a: clockid_t, a2: c_int, b: *const timespec, c: *mut timespec) -> c_int570     pub fn clock_nanosleep(a: clockid_t, a2: c_int, b: *const timespec, c: *mut timespec) -> c_int;
571 
isalnum(c: c_int) -> c_int572     pub fn isalnum(c: c_int) -> c_int;
isalpha(c: c_int) -> c_int573     pub fn isalpha(c: c_int) -> c_int;
iscntrl(c: c_int) -> c_int574     pub fn iscntrl(c: c_int) -> c_int;
isdigit(c: c_int) -> c_int575     pub fn isdigit(c: c_int) -> c_int;
isgraph(c: c_int) -> c_int576     pub fn isgraph(c: c_int) -> c_int;
islower(c: c_int) -> c_int577     pub fn islower(c: c_int) -> c_int;
isprint(c: c_int) -> c_int578     pub fn isprint(c: c_int) -> c_int;
ispunct(c: c_int) -> c_int579     pub fn ispunct(c: c_int) -> c_int;
isspace(c: c_int) -> c_int580     pub fn isspace(c: c_int) -> c_int;
isupper(c: c_int) -> c_int581     pub fn isupper(c: c_int) -> c_int;
isxdigit(c: c_int) -> c_int582     pub fn isxdigit(c: c_int) -> c_int;
isblank(c: c_int) -> c_int583     pub fn isblank(c: c_int) -> c_int;
tolower(c: c_int) -> c_int584     pub fn tolower(c: c_int) -> c_int;
toupper(c: c_int) -> c_int585     pub fn toupper(c: c_int) -> c_int;
setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int586     pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
setbuf(stream: *mut FILE, buf: *mut c_char)587     pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char588     pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
atof(s: *const c_char) -> c_double589     pub fn atof(s: *const c_char) -> c_double;
atoi(s: *const c_char) -> c_int590     pub fn atoi(s: *const c_char) -> c_int;
atol(s: *const c_char) -> c_long591     pub fn atol(s: *const c_char) -> c_long;
atoll(s: *const c_char) -> c_longlong592     pub fn atoll(s: *const c_char) -> c_longlong;
strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double593     pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float594     pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long595     pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong596     pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong597     pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong598     pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
599 
strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char600     pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char601     pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char602     pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char603     pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
strcmp(cs: *const c_char, ct: *const c_char) -> c_int604     pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int605     pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
strcoll(cs: *const c_char, ct: *const c_char) -> c_int606     pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
strchr(cs: *const c_char, c: c_int) -> *mut c_char607     pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
strrchr(cs: *const c_char, c: c_int) -> *mut c_char608     pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
strspn(cs: *const c_char, ct: *const c_char) -> size_t609     pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
strcspn(cs: *const c_char, ct: *const c_char) -> size_t610     pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
strdup(cs: *const c_char) -> *mut c_char611     pub fn strdup(cs: *const c_char) -> *mut c_char;
strndup(cs: *const c_char, n: size_t) -> *mut c_char612     pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char;
strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char613     pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char614     pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int615     pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int616     pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
strlen(cs: *const c_char) -> size_t617     pub fn strlen(cs: *const c_char) -> size_t;
strnlen(cs: *const c_char, maxlen: size_t) -> size_t618     pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
strerror(n: c_int) -> *mut c_char619     pub fn strerror(n: c_int) -> *mut c_char;
strtok(s: *mut c_char, t: *const c_char) -> *mut c_char620     pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t621     pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
622 
memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void623     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int624     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void625     pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void626     pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void627     pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
628 
fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int629     pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
printf(format: *const ::c_char, ...) -> ::c_int630     pub fn printf(format: *const ::c_char, ...) -> ::c_int;
snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int631     pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int632     pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int633     pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
scanf(format: *const ::c_char, ...) -> ::c_int634     pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int635     pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
getchar_unlocked() -> ::c_int636     pub fn getchar_unlocked() -> ::c_int;
putchar_unlocked(c: ::c_int) -> ::c_int637     pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
638 
shutdown(socket: ::c_int, how: ::c_int) -> ::c_int639     pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int640     pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
mkdir(path: *const c_char, mode: mode_t) -> ::c_int641     pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
stat(path: *const c_char, buf: *mut stat) -> ::c_int642     pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE643     pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
fileno(stream: *mut ::FILE) -> ::c_int644     pub fn fileno(stream: *mut ::FILE) -> ::c_int;
open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int645     pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
creat(path: *const c_char, mode: mode_t) -> ::c_int646     pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int647     pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
opendir(dirname: *const c_char) -> *mut ::DIR648     pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
fdopendir(fd: ::c_int) -> *mut ::DIR649     pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
readdir(dirp: *mut ::DIR) -> *mut ::dirent650     pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
closedir(dirp: *mut ::DIR) -> ::c_int651     pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
rewinddir(dirp: *mut ::DIR)652     pub fn rewinddir(dirp: *mut ::DIR);
dirfd(dirp: *mut ::DIR) -> ::c_int653     pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
seekdir(dirp: *mut ::DIR, loc: ::c_long)654     pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
telldir(dirp: *mut ::DIR) -> ::c_long655     pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
656 
openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int657     pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
fstatat( dirfd: ::c_int, pathname: *const ::c_char, buf: *mut stat, flags: ::c_int, ) -> ::c_int658     pub fn fstatat(
659         dirfd: ::c_int,
660         pathname: *const ::c_char,
661         buf: *mut stat,
662         flags: ::c_int,
663     ) -> ::c_int;
linkat( olddirfd: ::c_int, oldpath: *const ::c_char, newdirfd: ::c_int, newpath: *const ::c_char, flags: ::c_int, ) -> ::c_int664     pub fn linkat(
665         olddirfd: ::c_int,
666         oldpath: *const ::c_char,
667         newdirfd: ::c_int,
668         newpath: *const ::c_char,
669         flags: ::c_int,
670     ) -> ::c_int;
mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int671     pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
readlinkat( dirfd: ::c_int, pathname: *const ::c_char, buf: *mut ::c_char, bufsiz: ::size_t, ) -> ::ssize_t672     pub fn readlinkat(
673         dirfd: ::c_int,
674         pathname: *const ::c_char,
675         buf: *mut ::c_char,
676         bufsiz: ::size_t,
677     ) -> ::ssize_t;
renameat( olddirfd: ::c_int, oldpath: *const ::c_char, newdirfd: ::c_int, newpath: *const ::c_char, ) -> ::c_int678     pub fn renameat(
679         olddirfd: ::c_int,
680         oldpath: *const ::c_char,
681         newdirfd: ::c_int,
682         newpath: *const ::c_char,
683     ) -> ::c_int;
symlinkat( target: *const ::c_char, newdirfd: ::c_int, linkpath: *const ::c_char, ) -> ::c_int684     pub fn symlinkat(
685         target: *const ::c_char,
686         newdirfd: ::c_int,
687         linkpath: *const ::c_char,
688     ) -> ::c_int;
unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int689     pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
690 
access(path: *const c_char, amode: ::c_int) -> ::c_int691     pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
close(fd: ::c_int) -> ::c_int692     pub fn close(fd: ::c_int) -> ::c_int;
fpathconf(filedes: ::c_int, name: ::c_int) -> c_long693     pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int694     pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
isatty(fd: ::c_int) -> ::c_int695     pub fn isatty(fd: ::c_int) -> ::c_int;
link(src: *const c_char, dst: *const c_char) -> ::c_int696     pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t697     pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
pathconf(path: *const c_char, name: ::c_int) -> c_long698     pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
rmdir(path: *const c_char) -> ::c_int699     pub fn rmdir(path: *const c_char) -> ::c_int;
sleep(secs: ::c_uint) -> ::c_uint700     pub fn sleep(secs: ::c_uint) -> ::c_uint;
unlink(c: *const c_char) -> ::c_int701     pub fn unlink(c: *const c_char) -> ::c_int;
pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t702     pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t703     pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
704 
lstat(path: *const c_char, buf: *mut stat) -> ::c_int705     pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
706 
fsync(fd: ::c_int) -> ::c_int707     pub fn fsync(fd: ::c_int) -> ::c_int;
fdatasync(fd: ::c_int) -> ::c_int708     pub fn fdatasync(fd: ::c_int) -> ::c_int;
709 
symlink(path1: *const c_char, path2: *const c_char) -> ::c_int710     pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
711 
truncate(path: *const c_char, length: off_t) -> ::c_int712     pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
ftruncate(fd: ::c_int, length: off_t) -> ::c_int713     pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
714 
getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int715     pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
716 
gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int717     pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
times(buf: *mut ::tms) -> ::clock_t718     pub fn times(buf: *mut ::tms) -> ::clock_t;
719 
strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int720     pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
721 
usleep(secs: ::c_uint) -> ::c_int722     pub fn usleep(secs: ::c_uint) -> ::c_int;
send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t723     pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t724     pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int725     pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char726     pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
localeconv() -> *mut lconv727     pub fn localeconv() -> *mut lconv;
728 
readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t729     pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
730 
timegm(tm: *mut ::tm) -> time_t731     pub fn timegm(tm: *mut ::tm) -> time_t;
732 
sysconf(name: ::c_int) -> ::c_long733     pub fn sysconf(name: ::c_int) -> ::c_long;
734 
ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int735     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
736 
fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int737     pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
ftello(stream: *mut ::FILE) -> ::off_t738     pub fn ftello(stream: *mut ::FILE) -> ::off_t;
posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int739     pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
740 
strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char741     pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t742     pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
743 
faccessat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::c_int, flags: ::c_int, ) -> ::c_int744     pub fn faccessat(
745         dirfd: ::c_int,
746         pathname: *const ::c_char,
747         mode: ::c_int,
748         flags: ::c_int,
749     ) -> ::c_int;
writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t750     pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t751     pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t752     pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
753         -> ::ssize_t;
preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t754     pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int755     pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int756     pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
utimensat( dirfd: ::c_int, path: *const ::c_char, times: *const ::timespec, flag: ::c_int, ) -> ::c_int757     pub fn utimensat(
758         dirfd: ::c_int,
759         path: *const ::c_char,
760         times: *const ::timespec,
761         flag: ::c_int,
762     ) -> ::c_int;
getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int763     pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void764     pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
abs(i: c_int) -> c_int765     pub fn abs(i: c_int) -> c_int;
labs(i: c_long) -> c_long766     pub fn labs(i: c_long) -> c_long;
duplocale(base: ::locale_t) -> ::locale_t767     pub fn duplocale(base: ::locale_t) -> ::locale_t;
freelocale(loc: ::locale_t)768     pub fn freelocale(loc: ::locale_t);
newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t769     pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
uselocale(loc: ::locale_t) -> ::locale_t770     pub fn uselocale(loc: ::locale_t) -> ::locale_t;
sched_yield() -> ::c_int771     pub fn sched_yield() -> ::c_int;
getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char772     pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
chdir(dir: *const c_char) -> ::c_int773     pub fn chdir(dir: *const c_char) -> ::c_int;
774 
nl_langinfo(item: ::nl_item) -> *mut ::c_char775     pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char776     pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
777 
select( nfds: c_int, readfds: *mut fd_set, writefds: *mut fd_set, errorfds: *mut fd_set, timeout: *const timeval, ) -> c_int778     pub fn select(
779         nfds: c_int,
780         readfds: *mut fd_set,
781         writefds: *mut fd_set,
782         errorfds: *mut fd_set,
783         timeout: *const timeval,
784     ) -> c_int;
785 
__wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int786     pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int;
__wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int787     pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int;
__wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int788     pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int;
__wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int789     pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int;
__wasilibc_find_relpath( path: *const c_char, abs_prefix: *mut *const c_char, relative_path: *mut *mut c_char, relative_path_len: usize, ) -> c_int790     pub fn __wasilibc_find_relpath(
791         path: *const c_char,
792         abs_prefix: *mut *const c_char,
793         relative_path: *mut *mut c_char,
794         relative_path_len: usize,
795     ) -> c_int;
__wasilibc_tell(fd: c_int) -> ::off_t796     pub fn __wasilibc_tell(fd: c_int) -> ::off_t;
__wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int797     pub fn __wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int;
__wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int798     pub fn __wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int;
__wasilibc_nocwd_linkat( olddirfd: c_int, oldpath: *const c_char, newdirfd: c_int, newpath: *const c_char, flags: c_int, ) -> c_int799     pub fn __wasilibc_nocwd_linkat(
800         olddirfd: c_int,
801         oldpath: *const c_char,
802         newdirfd: c_int,
803         newpath: *const c_char,
804         flags: c_int,
805     ) -> c_int;
__wasilibc_nocwd_symlinkat( target: *const c_char, dirfd: c_int, path: *const c_char, ) -> c_int806     pub fn __wasilibc_nocwd_symlinkat(
807         target: *const c_char,
808         dirfd: c_int,
809         path: *const c_char,
810     ) -> c_int;
__wasilibc_nocwd_readlinkat( dirfd: c_int, path: *const c_char, buf: *mut c_char, bufsize: usize, ) -> isize811     pub fn __wasilibc_nocwd_readlinkat(
812         dirfd: c_int,
813         path: *const c_char,
814         buf: *mut c_char,
815         bufsize: usize,
816     ) -> isize;
__wasilibc_nocwd_faccessat( dirfd: c_int, path: *const c_char, mode: c_int, flags: c_int, ) -> c_int817     pub fn __wasilibc_nocwd_faccessat(
818         dirfd: c_int,
819         path: *const c_char,
820         mode: c_int,
821         flags: c_int,
822     ) -> c_int;
__wasilibc_nocwd_renameat( olddirfd: c_int, oldpath: *const c_char, newdirfd: c_int, newpath: *const c_char, ) -> c_int823     pub fn __wasilibc_nocwd_renameat(
824         olddirfd: c_int,
825         oldpath: *const c_char,
826         newdirfd: c_int,
827         newpath: *const c_char,
828     ) -> c_int;
__wasilibc_nocwd_openat_nomode(dirfd: c_int, path: *const c_char, flags: c_int) -> c_int829     pub fn __wasilibc_nocwd_openat_nomode(dirfd: c_int, path: *const c_char, flags: c_int)
830         -> c_int;
__wasilibc_nocwd_fstatat( dirfd: c_int, path: *const c_char, buf: *mut stat, flags: c_int, ) -> c_int831     pub fn __wasilibc_nocwd_fstatat(
832         dirfd: c_int,
833         path: *const c_char,
834         buf: *mut stat,
835         flags: c_int,
836     ) -> c_int;
__wasilibc_nocwd_mkdirat_nomode(dirfd: c_int, path: *const c_char) -> c_int837     pub fn __wasilibc_nocwd_mkdirat_nomode(dirfd: c_int, path: *const c_char) -> c_int;
__wasilibc_nocwd_utimensat( dirfd: c_int, path: *const c_char, times: *const ::timespec, flags: c_int, ) -> c_int838     pub fn __wasilibc_nocwd_utimensat(
839         dirfd: c_int,
840         path: *const c_char,
841         times: *const ::timespec,
842         flags: c_int,
843     ) -> c_int;
__wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut ::DIR844     pub fn __wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut ::DIR;
__wasilibc_access(pathname: *const c_char, mode: c_int, flags: c_int) -> c_int845     pub fn __wasilibc_access(pathname: *const c_char, mode: c_int, flags: c_int) -> c_int;
__wasilibc_stat(pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int846     pub fn __wasilibc_stat(pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int;
__wasilibc_utimens( pathname: *const c_char, times: *const ::timespec, flags: c_int, ) -> c_int847     pub fn __wasilibc_utimens(
848         pathname: *const c_char,
849         times: *const ::timespec,
850         flags: c_int,
851     ) -> c_int;
__wasilibc_link(oldpath: *const c_char, newpath: *const c_char, flags: c_int) -> c_int852     pub fn __wasilibc_link(oldpath: *const c_char, newpath: *const c_char, flags: c_int) -> c_int;
__wasilibc_link_oldat( olddirfd: c_int, oldpath: *const c_char, newpath: *const c_char, flags: c_int, ) -> c_int853     pub fn __wasilibc_link_oldat(
854         olddirfd: c_int,
855         oldpath: *const c_char,
856         newpath: *const c_char,
857         flags: c_int,
858     ) -> c_int;
__wasilibc_link_newat( oldpath: *const c_char, newdirfd: c_int, newpath: *const c_char, flags: c_int, ) -> c_int859     pub fn __wasilibc_link_newat(
860         oldpath: *const c_char,
861         newdirfd: c_int,
862         newpath: *const c_char,
863         flags: c_int,
864     ) -> c_int;
__wasilibc_rename_oldat( olddirfd: c_int, oldpath: *const c_char, newpath: *const c_char, ) -> c_int865     pub fn __wasilibc_rename_oldat(
866         olddirfd: c_int,
867         oldpath: *const c_char,
868         newpath: *const c_char,
869     ) -> c_int;
__wasilibc_rename_newat( oldpath: *const c_char, newdirfd: c_int, newpath: *const c_char, ) -> c_int870     pub fn __wasilibc_rename_newat(
871         oldpath: *const c_char,
872         newdirfd: c_int,
873         newpath: *const c_char,
874     ) -> c_int;
875 
arc4random() -> u32876     pub fn arc4random() -> u32;
arc4random_buf(a: *mut c_void, b: size_t)877     pub fn arc4random_buf(a: *mut c_void, b: size_t);
arc4random_uniform(a: u32) -> u32878     pub fn arc4random_uniform(a: u32) -> u32;
879 
__errno_location() -> *mut ::c_int880     pub fn __errno_location() -> *mut ::c_int;
881 }
882 
883 cfg_if! {
884     if #[cfg(target_env = "p2")] {
885         mod p2;
886         pub use self::p2::*;
887     }
888 }
889