• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! Definitions found commonly among almost all Unix derivatives
2 //!
3 //! More functions and definitions can be found in the more specific modules
4 //! according to the platform in question.
5 
6 pub type c_schar = i8;
7 pub type c_uchar = u8;
8 pub type c_short = i16;
9 pub type c_ushort = u16;
10 pub type c_int = i32;
11 pub type c_uint = u32;
12 pub type c_float = f32;
13 pub type c_double = f64;
14 pub type c_longlong = i64;
15 pub type c_ulonglong = u64;
16 pub type intmax_t = i64;
17 pub type uintmax_t = u64;
18 
19 pub type size_t = usize;
20 pub type ptrdiff_t = isize;
21 pub type intptr_t = isize;
22 pub type uintptr_t = usize;
23 pub type ssize_t = isize;
24 
25 pub type pid_t = i32;
26 pub type in_addr_t = u32;
27 pub type in_port_t = u16;
28 pub type sighandler_t = ::size_t;
29 pub type cc_t = ::c_uchar;
30 
31 cfg_if! {
32     if #[cfg(any(target_os = "espidf", target_os = "horizon"))] {
33         pub type uid_t = ::c_ushort;
34         pub type gid_t = ::c_ushort;
35     } else if #[cfg(target_os = "nto")] {
36         pub type uid_t = i32;
37         pub type gid_t = i32;
38     } else {
39         pub type uid_t = u32;
40         pub type gid_t = u32;
41     }
42 }
43 
44 #[cfg_attr(feature = "extra_traits", derive(Debug))]
45 pub enum DIR {}
46 impl ::Copy for DIR {}
47 impl ::Clone for DIR {
clone(&self) -> DIR48     fn clone(&self) -> DIR {
49         *self
50     }
51 }
52 pub type locale_t = *mut ::c_void;
53 
54 s! {
55     pub struct group {
56         pub gr_name: *mut ::c_char,
57         pub gr_passwd: *mut ::c_char,
58         pub gr_gid: ::gid_t,
59         pub gr_mem: *mut *mut ::c_char,
60     }
61 
62     pub struct utimbuf {
63         pub actime: time_t,
64         pub modtime: time_t,
65     }
66 
67     pub struct timeval {
68         pub tv_sec: time_t,
69         pub tv_usec: suseconds_t,
70     }
71 
72     // linux x32 compatibility
73     // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
74     pub struct timespec {
75         pub tv_sec: time_t,
76         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
77         pub tv_nsec: i64,
78         #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
79         pub tv_nsec: ::c_long,
80     }
81 
82     pub struct rlimit {
83         pub rlim_cur: rlim_t,
84         pub rlim_max: rlim_t,
85     }
86 
87     pub struct rusage {
88         pub ru_utime: timeval,
89         pub ru_stime: timeval,
90         pub ru_maxrss: c_long,
91         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
92         __pad1: u32,
93         pub ru_ixrss: c_long,
94         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
95         __pad2: u32,
96         pub ru_idrss: c_long,
97         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
98         __pad3: u32,
99         pub ru_isrss: c_long,
100         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
101         __pad4: u32,
102         pub ru_minflt: c_long,
103         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
104         __pad5: u32,
105         pub ru_majflt: c_long,
106         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
107         __pad6: u32,
108         pub ru_nswap: c_long,
109         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
110         __pad7: u32,
111         pub ru_inblock: c_long,
112         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
113         __pad8: u32,
114         pub ru_oublock: c_long,
115         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
116         __pad9: u32,
117         pub ru_msgsnd: c_long,
118         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
119         __pad10: u32,
120         pub ru_msgrcv: c_long,
121         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
122         __pad11: u32,
123         pub ru_nsignals: c_long,
124         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
125         __pad12: u32,
126         pub ru_nvcsw: c_long,
127         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
128         __pad13: u32,
129         pub ru_nivcsw: c_long,
130         #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
131         __pad14: u32,
132 
133         #[cfg(any(target_env = "musl", target_env = "ohos", target_os = "emscripten"))]
134         __reserved: [c_long; 16],
135     }
136 
137     pub struct ipv6_mreq {
138         pub ipv6mr_multiaddr: in6_addr,
139         #[cfg(target_os = "android")]
140         pub ipv6mr_interface: ::c_int,
141         #[cfg(not(target_os = "android"))]
142         pub ipv6mr_interface: ::c_uint,
143     }
144 
145     pub struct hostent {
146         pub h_name: *mut ::c_char,
147         pub h_aliases: *mut *mut ::c_char,
148         pub h_addrtype: ::c_int,
149         pub h_length: ::c_int,
150         pub h_addr_list: *mut *mut ::c_char,
151     }
152 
153     pub struct iovec {
154         pub iov_base: *mut ::c_void,
155         pub iov_len: ::size_t,
156     }
157 
158     pub struct pollfd {
159         pub fd: ::c_int,
160         pub events: ::c_short,
161         pub revents: ::c_short,
162     }
163 
164     pub struct winsize {
165         pub ws_row: ::c_ushort,
166         pub ws_col: ::c_ushort,
167         pub ws_xpixel: ::c_ushort,
168         pub ws_ypixel: ::c_ushort,
169     }
170 
171     pub struct linger {
172         pub l_onoff: ::c_int,
173         pub l_linger: ::c_int,
174     }
175 
176     pub struct sigval {
177         // Actually a union of an int and a void*
178         pub sival_ptr: *mut ::c_void
179     }
180 
181     // <sys/time.h>
182     pub struct itimerval {
183         pub it_interval: ::timeval,
184         pub it_value: ::timeval,
185     }
186 
187     // <sys/times.h>
188     pub struct tms {
189         pub tms_utime: ::clock_t,
190         pub tms_stime: ::clock_t,
191         pub tms_cutime: ::clock_t,
192         pub tms_cstime: ::clock_t,
193     }
194 
195     pub struct servent {
196         pub s_name: *mut ::c_char,
197         pub s_aliases: *mut *mut ::c_char,
198         pub s_port: ::c_int,
199         pub s_proto: *mut ::c_char,
200     }
201 
202     pub struct protoent {
203         pub p_name: *mut ::c_char,
204         pub p_aliases: *mut *mut ::c_char,
205         pub p_proto: ::c_int,
206     }
207 }
208 
209 pub const INT_MIN: c_int = -2147483648;
210 pub const INT_MAX: c_int = 2147483647;
211 
212 pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
213 pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
214 pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
215 cfg_if! {
216     if #[cfg(not(target_os = "nto"))] {
217         pub const DT_UNKNOWN: u8 = 0;
218         pub const DT_FIFO: u8 = 1;
219         pub const DT_CHR: u8 = 2;
220         pub const DT_DIR: u8 = 4;
221         pub const DT_BLK: u8 = 6;
222         pub const DT_REG: u8 = 8;
223         pub const DT_LNK: u8 = 10;
224         pub const DT_SOCK: u8 = 12;
225     }
226 }
227 cfg_if! {
228     if #[cfg(not(target_os = "redox"))] {
229         pub const FD_CLOEXEC: ::c_int = 0x1;
230     }
231 }
232 
233 cfg_if! {
234     if #[cfg(not(target_os = "nto"))]
235     {
236         pub const USRQUOTA: ::c_int = 0;
237         pub const GRPQUOTA: ::c_int = 1;
238     }
239 }
240 pub const SIGIOT: ::c_int = 6;
241 
242 pub const S_ISUID: ::mode_t = 0x800;
243 pub const S_ISGID: ::mode_t = 0x400;
244 pub const S_ISVTX: ::mode_t = 0x200;
245 
246 cfg_if! {
247     if #[cfg(not(any(target_os = "haiku", target_os = "illumos",
248                      target_os = "solaris")))] {
249         pub const IF_NAMESIZE: ::size_t = 16;
250         pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
251     }
252 }
253 
254 pub const LOG_EMERG: ::c_int = 0;
255 pub const LOG_ALERT: ::c_int = 1;
256 pub const LOG_CRIT: ::c_int = 2;
257 pub const LOG_ERR: ::c_int = 3;
258 pub const LOG_WARNING: ::c_int = 4;
259 pub const LOG_NOTICE: ::c_int = 5;
260 pub const LOG_INFO: ::c_int = 6;
261 pub const LOG_DEBUG: ::c_int = 7;
262 
263 pub const LOG_KERN: ::c_int = 0;
264 pub const LOG_USER: ::c_int = 1 << 3;
265 pub const LOG_MAIL: ::c_int = 2 << 3;
266 pub const LOG_DAEMON: ::c_int = 3 << 3;
267 pub const LOG_AUTH: ::c_int = 4 << 3;
268 pub const LOG_SYSLOG: ::c_int = 5 << 3;
269 pub const LOG_LPR: ::c_int = 6 << 3;
270 pub const LOG_NEWS: ::c_int = 7 << 3;
271 pub const LOG_UUCP: ::c_int = 8 << 3;
272 pub const LOG_LOCAL0: ::c_int = 16 << 3;
273 pub const LOG_LOCAL1: ::c_int = 17 << 3;
274 pub const LOG_LOCAL2: ::c_int = 18 << 3;
275 pub const LOG_LOCAL3: ::c_int = 19 << 3;
276 pub const LOG_LOCAL4: ::c_int = 20 << 3;
277 pub const LOG_LOCAL5: ::c_int = 21 << 3;
278 pub const LOG_LOCAL6: ::c_int = 22 << 3;
279 pub const LOG_LOCAL7: ::c_int = 23 << 3;
280 
281 cfg_if! {
282     if #[cfg(not(target_os = "haiku"))] {
283         pub const LOG_PID: ::c_int = 0x01;
284         pub const LOG_CONS: ::c_int = 0x02;
285         pub const LOG_ODELAY: ::c_int = 0x04;
286         pub const LOG_NDELAY: ::c_int = 0x08;
287         pub const LOG_NOWAIT: ::c_int = 0x10;
288     }
289 }
290 pub const LOG_PRIMASK: ::c_int = 7;
291 pub const LOG_FACMASK: ::c_int = 0x3f8;
292 
293 cfg_if! {
294     if #[cfg(not(target_os = "nto"))]
295     {
296         pub const PRIO_MIN: ::c_int = -20;
297         pub const PRIO_MAX: ::c_int = 20;
298     }
299 }
300 pub const IPPROTO_ICMP: ::c_int = 1;
301 pub const IPPROTO_ICMPV6: ::c_int = 58;
302 pub const IPPROTO_TCP: ::c_int = 6;
303 pub const IPPROTO_UDP: ::c_int = 17;
304 pub const IPPROTO_IP: ::c_int = 0;
305 pub const IPPROTO_IPV6: ::c_int = 41;
306 
307 pub const INADDR_LOOPBACK: in_addr_t = 2130706433;
308 pub const INADDR_ANY: in_addr_t = 0;
309 pub const INADDR_BROADCAST: in_addr_t = 4294967295;
310 pub const INADDR_NONE: in_addr_t = 4294967295;
311 
312 pub const ARPOP_REQUEST: u16 = 1;
313 pub const ARPOP_REPLY: u16 = 2;
314 
315 pub const ATF_COM: ::c_int = 0x02;
316 pub const ATF_PERM: ::c_int = 0x04;
317 pub const ATF_PUBL: ::c_int = 0x08;
318 pub const ATF_USETRAILERS: ::c_int = 0x10;
319 
320 cfg_if! {
321     if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
322         // required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
323     } else if #[cfg(feature = "std")] {
324         // cargo build, don't pull in anything extra as the libstd dep
325         // already pulls in all libs.
326     } else if #[cfg(all(target_os = "linux",
327                         any(target_env = "gnu", target_env = "uclibc"),
328                         feature = "rustc-dep-of-std"))] {
329         #[link(name = "util", kind = "static", modifiers = "-bundle",
330             cfg(target_feature = "crt-static"))]
331         #[link(name = "rt", kind = "static", modifiers = "-bundle",
332             cfg(target_feature = "crt-static"))]
333         #[link(name = "pthread", kind = "static", modifiers = "-bundle",
334             cfg(target_feature = "crt-static"))]
335         #[link(name = "m", kind = "static", modifiers = "-bundle",
336             cfg(target_feature = "crt-static"))]
337         #[link(name = "dl", kind = "static", modifiers = "-bundle",
338             cfg(target_feature = "crt-static"))]
339         #[link(name = "c", kind = "static", modifiers = "-bundle",
340             cfg(target_feature = "crt-static"))]
341         #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle",
342             cfg(target_feature = "crt-static"))]
343         #[link(name = "gcc", kind = "static", modifiers = "-bundle",
344             cfg(target_feature = "crt-static"))]
345         #[link(name = "c", kind = "static", modifiers = "-bundle",
346             cfg(target_feature = "crt-static"))]
347         #[link(name = "util", cfg(not(target_feature = "crt-static")))]
348         #[link(name = "rt", cfg(not(target_feature = "crt-static")))]
349         #[link(name = "pthread", cfg(not(target_feature = "crt-static")))]
350         #[link(name = "m", cfg(not(target_feature = "crt-static")))]
351         #[link(name = "dl", cfg(not(target_feature = "crt-static")))]
352         #[link(name = "c", cfg(not(target_feature = "crt-static")))]
353         extern {}
354     } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
355         #[cfg_attr(feature = "rustc-dep-of-std",
356                    link(name = "c", kind = "static", modifiers = "-bundle",
357                         cfg(target_feature = "crt-static")))]
358         #[cfg_attr(feature = "rustc-dep-of-std",
359                    link(name = "c", cfg(not(target_feature = "crt-static"))))]
360         extern {}
361     } else if #[cfg(target_os = "emscripten")] {
362         #[link(name = "c")]
363         extern {}
364     } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
365         #[link(name = "c", kind = "static", modifiers = "-bundle",
366             cfg(target_feature = "crt-static"))]
367         #[link(name = "m", kind = "static", modifiers = "-bundle",
368             cfg(target_feature = "crt-static"))]
369         #[link(name = "m", cfg(not(target_feature = "crt-static")))]
370         #[link(name = "c", cfg(not(target_feature = "crt-static")))]
371         extern {}
372     } else if #[cfg(any(target_os = "macos",
373                         target_os = "ios",
374                         target_os = "tvos",
375                         target_os = "watchos",
376                         target_os = "android",
377                         target_os = "openbsd",
378                         target_os = "nto",
379                     ))] {
380         #[link(name = "c")]
381         #[link(name = "m")]
382         extern {}
383     } else if #[cfg(target_os = "haiku")] {
384         #[link(name = "root")]
385         #[link(name = "network")]
386         extern {}
387     } else if #[cfg(target_env = "newlib")] {
388         #[link(name = "c")]
389         #[link(name = "m")]
390         extern {}
391     } else if #[cfg(target_os = "hermit")] {
392         // no_default_libraries is set to false for HermitCore, so only a link
393         // to "pthread" needs to be added.
394         #[link(name = "pthread")]
395         extern {}
396     } else if #[cfg(target_env = "illumos")] {
397         #[link(name = "c")]
398         #[link(name = "m")]
399         extern {}
400     } else if #[cfg(target_os = "redox")] {
401         #[cfg_attr(feature = "rustc-dep-of-std",
402                    link(name = "c", kind = "static", modifiers = "-bundle",
403                         cfg(target_feature = "crt-static")))]
404         #[cfg_attr(feature = "rustc-dep-of-std",
405                    link(name = "c", cfg(not(target_feature = "crt-static"))))]
406         extern {}
407     } else {
408         #[link(name = "c")]
409         #[link(name = "m")]
410         #[link(name = "rt")]
411         #[link(name = "pthread")]
412         extern {}
413     }
414 }
415 
416 #[cfg_attr(feature = "extra_traits", derive(Debug))]
417 pub enum FILE {}
418 impl ::Copy for FILE {}
419 impl ::Clone for FILE {
clone(&self) -> FILE420     fn clone(&self) -> FILE {
421         *self
422     }
423 }
424 #[cfg_attr(feature = "extra_traits", derive(Debug))]
425 pub enum fpos_t {} // FIXME: fill this out with a struct
426 impl ::Copy for fpos_t {}
427 impl ::Clone for fpos_t {
clone(&self) -> fpos_t428     fn clone(&self) -> fpos_t {
429         *self
430     }
431 }
432 
433 extern "C" {
isalnum(c: c_int) -> c_int434     pub fn isalnum(c: c_int) -> c_int;
isalpha(c: c_int) -> c_int435     pub fn isalpha(c: c_int) -> c_int;
iscntrl(c: c_int) -> c_int436     pub fn iscntrl(c: c_int) -> c_int;
isdigit(c: c_int) -> c_int437     pub fn isdigit(c: c_int) -> c_int;
isgraph(c: c_int) -> c_int438     pub fn isgraph(c: c_int) -> c_int;
islower(c: c_int) -> c_int439     pub fn islower(c: c_int) -> c_int;
isprint(c: c_int) -> c_int440     pub fn isprint(c: c_int) -> c_int;
ispunct(c: c_int) -> c_int441     pub fn ispunct(c: c_int) -> c_int;
isspace(c: c_int) -> c_int442     pub fn isspace(c: c_int) -> c_int;
isupper(c: c_int) -> c_int443     pub fn isupper(c: c_int) -> c_int;
isxdigit(c: c_int) -> c_int444     pub fn isxdigit(c: c_int) -> c_int;
isblank(c: c_int) -> c_int445     pub fn isblank(c: c_int) -> c_int;
tolower(c: c_int) -> c_int446     pub fn tolower(c: c_int) -> c_int;
toupper(c: c_int) -> c_int447     pub fn toupper(c: c_int) -> c_int;
qsort( base: *mut c_void, num: size_t, size: size_t, compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>, )448     pub fn qsort(
449         base: *mut c_void,
450         num: size_t,
451         size: size_t,
452         compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
453     );
bsearch( key: *const c_void, base: *const c_void, num: size_t, size: size_t, compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>, ) -> *mut c_void454     pub fn bsearch(
455         key: *const c_void,
456         base: *const c_void,
457         num: size_t,
458         size: size_t,
459         compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
460     ) -> *mut c_void;
461     #[cfg_attr(
462         all(target_os = "macos", target_arch = "x86"),
463         link_name = "fopen$UNIX2003"
464     )]
fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE465     pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
466     #[cfg_attr(
467         all(target_os = "macos", target_arch = "x86"),
468         link_name = "freopen$UNIX2003"
469     )]
freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE470     pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
471 
fflush(file: *mut FILE) -> c_int472     pub fn fflush(file: *mut FILE) -> c_int;
fclose(file: *mut FILE) -> c_int473     pub fn fclose(file: *mut FILE) -> c_int;
remove(filename: *const c_char) -> c_int474     pub fn remove(filename: *const c_char) -> c_int;
rename(oldname: *const c_char, newname: *const c_char) -> c_int475     pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
tmpfile() -> *mut FILE476     pub fn tmpfile() -> *mut FILE;
setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int477     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)478     pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
getchar() -> c_int479     pub fn getchar() -> c_int;
putchar(c: c_int) -> c_int480     pub fn putchar(c: c_int) -> c_int;
fgetc(stream: *mut FILE) -> c_int481     pub fn fgetc(stream: *mut FILE) -> c_int;
fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char482     pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
fputc(c: c_int, stream: *mut FILE) -> c_int483     pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
484     #[cfg_attr(
485         all(target_os = "macos", target_arch = "x86"),
486         link_name = "fputs$UNIX2003"
487     )]
fputs(s: *const c_char, stream: *mut FILE) -> c_int488     pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
puts(s: *const c_char) -> c_int489     pub fn puts(s: *const c_char) -> c_int;
ungetc(c: c_int, stream: *mut FILE) -> c_int490     pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t491     pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
492     #[cfg_attr(
493         all(target_os = "macos", target_arch = "x86"),
494         link_name = "fwrite$UNIX2003"
495     )]
fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t496     pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int497     pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
ftell(stream: *mut FILE) -> c_long498     pub fn ftell(stream: *mut FILE) -> c_long;
rewind(stream: *mut FILE)499     pub fn rewind(stream: *mut FILE);
500     #[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")]
fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int501     pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
502     #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int503     pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
feof(stream: *mut FILE) -> c_int504     pub fn feof(stream: *mut FILE) -> c_int;
ferror(stream: *mut FILE) -> c_int505     pub fn ferror(stream: *mut FILE) -> c_int;
clearerr(stream: *mut FILE)506     pub fn clearerr(stream: *mut FILE);
perror(s: *const c_char)507     pub fn perror(s: *const c_char);
atof(s: *const c_char) -> c_double508     pub fn atof(s: *const c_char) -> c_double;
atoi(s: *const c_char) -> c_int509     pub fn atoi(s: *const c_char) -> c_int;
atol(s: *const c_char) -> c_long510     pub fn atol(s: *const c_char) -> c_long;
atoll(s: *const c_char) -> c_longlong511     pub fn atoll(s: *const c_char) -> c_longlong;
512     #[cfg_attr(
513         all(target_os = "macos", target_arch = "x86"),
514         link_name = "strtod$UNIX2003"
515     )]
strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double516     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_float517     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_long518     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_longlong519     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_ulong520     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_ulonglong521     pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
calloc(nobj: size_t, size: size_t) -> *mut c_void522     pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
malloc(size: size_t) -> *mut c_void523     pub fn malloc(size: size_t) -> *mut c_void;
realloc(p: *mut c_void, size: size_t) -> *mut c_void524     pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
free(p: *mut c_void)525     pub fn free(p: *mut c_void);
abort() -> !526     pub fn abort() -> !;
exit(status: c_int) -> !527     pub fn exit(status: c_int) -> !;
_exit(status: c_int) -> !528     pub fn _exit(status: c_int) -> !;
529     #[cfg_attr(
530         all(target_os = "macos", target_arch = "x86"),
531         link_name = "system$UNIX2003"
532     )]
system(s: *const c_char) -> c_int533     pub fn system(s: *const c_char) -> c_int;
getenv(s: *const c_char) -> *mut c_char534     pub fn getenv(s: *const c_char) -> *mut c_char;
535 
strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char536     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_char537     pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
stpcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char538     pub fn stpcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char539     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_char540     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_int541     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_int542     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_int543     pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
strchr(cs: *const c_char, c: c_int) -> *mut c_char544     pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
strrchr(cs: *const c_char, c: c_int) -> *mut c_char545     pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
strspn(cs: *const c_char, ct: *const c_char) -> size_t546     pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
strcspn(cs: *const c_char, ct: *const c_char) -> size_t547     pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
strdup(cs: *const c_char) -> *mut c_char548     pub fn strdup(cs: *const c_char) -> *mut c_char;
strndup(cs: *const c_char, n: size_t) -> *mut c_char549     pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char;
strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char550     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_char551     pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int552     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_int553     pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
strlen(cs: *const c_char) -> size_t554     pub fn strlen(cs: *const c_char) -> size_t;
strnlen(cs: *const c_char, maxlen: size_t) -> size_t555     pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
556     #[cfg_attr(
557         all(target_os = "macos", target_arch = "x86"),
558         link_name = "strerror$UNIX2003"
559     )]
strerror(n: c_int) -> *mut c_char560     pub fn strerror(n: c_int) -> *mut c_char;
strtok(s: *mut c_char, t: *const c_char) -> *mut c_char561     pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char562     pub fn strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char;
strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t563     pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
strsignal(sig: c_int) -> *mut c_char564     pub fn strsignal(sig: c_int) -> *mut c_char;
wcslen(buf: *const wchar_t) -> size_t565     pub fn wcslen(buf: *const wchar_t) -> size_t;
wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t566     pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
567 
memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void568     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t569     pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int570     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_void571     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_void572     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_void573     pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
574 }
575 
576 extern "C" {
577     #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam50")]
getpwnam(name: *const ::c_char) -> *mut passwd578     pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
579     #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")]
getpwuid(uid: ::uid_t) -> *mut passwd580     pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
581 
fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int582     pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
printf(format: *const ::c_char, ...) -> ::c_int583     pub fn printf(format: *const ::c_char, ...) -> ::c_int;
snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int584     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_int585     pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
586     #[cfg_attr(
587         all(target_os = "linux", not(target_env = "uclibc")),
588         link_name = "__isoc99_fscanf"
589     )]
fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int590     pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
591     #[cfg_attr(
592         all(target_os = "linux", not(target_env = "uclibc")),
593         link_name = "__isoc99_scanf"
594     )]
scanf(format: *const ::c_char, ...) -> ::c_int595     pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
596     #[cfg_attr(
597         all(target_os = "linux", not(target_env = "uclibc")),
598         link_name = "__isoc99_sscanf"
599     )]
sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int600     pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
getchar_unlocked() -> ::c_int601     pub fn getchar_unlocked() -> ::c_int;
putchar_unlocked(c: ::c_int) -> ::c_int602     pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
603 
604     #[cfg(not(all(
605         libc_cfg_target_vendor,
606         target_arch = "powerpc",
607         target_vendor = "nintendo"
608     )))]
609     #[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
610     #[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")]
611     #[cfg_attr(target_os = "espidf", link_name = "lwip_socket")]
socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int612     pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
613     #[cfg(not(all(
614         libc_cfg_target_vendor,
615         target_arch = "powerpc",
616         target_vendor = "nintendo"
617     )))]
618     #[cfg_attr(
619         all(target_os = "macos", target_arch = "x86"),
620         link_name = "connect$UNIX2003"
621     )]
622     #[cfg_attr(target_os = "illumos", link_name = "__xnet_connect")]
623     #[cfg_attr(target_os = "espidf", link_name = "lwip_connect")]
connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int624     pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
625     #[cfg_attr(
626         all(target_os = "macos", target_arch = "x86"),
627         link_name = "listen$UNIX2003"
628     )]
629     #[cfg_attr(target_os = "espidf", link_name = "lwip_listen")]
listen(socket: ::c_int, backlog: ::c_int) -> ::c_int630     pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
631     #[cfg(not(all(
632         libc_cfg_target_vendor,
633         target_arch = "powerpc",
634         target_vendor = "nintendo"
635     )))]
636     #[cfg_attr(
637         all(target_os = "macos", target_arch = "x86"),
638         link_name = "accept$UNIX2003"
639     )]
640     #[cfg_attr(target_os = "espidf", link_name = "lwip_accept")]
accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int641     pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
642     #[cfg(not(all(
643         libc_cfg_target_vendor,
644         target_arch = "powerpc",
645         target_vendor = "nintendo"
646     )))]
647     #[cfg_attr(
648         all(target_os = "macos", target_arch = "x86"),
649         link_name = "getpeername$UNIX2003"
650     )]
651     #[cfg_attr(target_os = "espidf", link_name = "lwip_getpeername")]
getpeername( socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t, ) -> ::c_int652     pub fn getpeername(
653         socket: ::c_int,
654         address: *mut sockaddr,
655         address_len: *mut socklen_t,
656     ) -> ::c_int;
657     #[cfg(not(all(
658         libc_cfg_target_vendor,
659         target_arch = "powerpc",
660         target_vendor = "nintendo"
661     )))]
662     #[cfg_attr(
663         all(target_os = "macos", target_arch = "x86"),
664         link_name = "getsockname$UNIX2003"
665     )]
666     #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockname")]
getsockname( socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t, ) -> ::c_int667     pub fn getsockname(
668         socket: ::c_int,
669         address: *mut sockaddr,
670         address_len: *mut socklen_t,
671     ) -> ::c_int;
672     #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")]
setsockopt( socket: ::c_int, level: ::c_int, name: ::c_int, value: *const ::c_void, option_len: socklen_t, ) -> ::c_int673     pub fn setsockopt(
674         socket: ::c_int,
675         level: ::c_int,
676         name: ::c_int,
677         value: *const ::c_void,
678         option_len: socklen_t,
679     ) -> ::c_int;
680     #[cfg_attr(
681         all(target_os = "macos", target_arch = "x86"),
682         link_name = "socketpair$UNIX2003"
683     )]
684     #[cfg_attr(target_os = "illumos", link_name = "__xnet_socketpair")]
socketpair( domain: ::c_int, type_: ::c_int, protocol: ::c_int, socket_vector: *mut ::c_int, ) -> ::c_int685     pub fn socketpair(
686         domain: ::c_int,
687         type_: ::c_int,
688         protocol: ::c_int,
689         socket_vector: *mut ::c_int,
690     ) -> ::c_int;
691     #[cfg(not(all(
692         libc_cfg_target_vendor,
693         target_arch = "powerpc",
694         target_vendor = "nintendo"
695     )))]
696     #[cfg_attr(
697         all(target_os = "macos", target_arch = "x86"),
698         link_name = "sendto$UNIX2003"
699     )]
700     #[cfg_attr(target_os = "illumos", link_name = "__xnet_sendto")]
701     #[cfg_attr(target_os = "espidf", link_name = "lwip_sendto")]
sendto( socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int, addr: *const sockaddr, addrlen: socklen_t, ) -> ::ssize_t702     pub fn sendto(
703         socket: ::c_int,
704         buf: *const ::c_void,
705         len: ::size_t,
706         flags: ::c_int,
707         addr: *const sockaddr,
708         addrlen: socklen_t,
709     ) -> ::ssize_t;
710     #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")]
shutdown(socket: ::c_int, how: ::c_int) -> ::c_int711     pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
712 
713     #[cfg_attr(
714         all(target_os = "macos", target_arch = "x86"),
715         link_name = "chmod$UNIX2003"
716     )]
chmod(path: *const c_char, mode: mode_t) -> ::c_int717     pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int;
718     #[cfg_attr(
719         all(target_os = "macos", target_arch = "x86"),
720         link_name = "fchmod$UNIX2003"
721     )]
fchmod(fd: ::c_int, mode: mode_t) -> ::c_int722     pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int;
723 
724     #[cfg_attr(
725         all(target_os = "macos", not(target_arch = "aarch64")),
726         link_name = "fstat$INODE64"
727     )]
728     #[cfg_attr(target_os = "netbsd", link_name = "__fstat50")]
729     #[cfg_attr(
730         all(target_os = "freebsd", any(freebsd11, freebsd10)),
731         link_name = "fstat@FBSD_1.0"
732     )]
fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int733     pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
734 
mkdir(path: *const c_char, mode: mode_t) -> ::c_int735     pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
736 
737     #[cfg_attr(
738         all(target_os = "macos", not(target_arch = "aarch64")),
739         link_name = "stat$INODE64"
740     )]
741     #[cfg_attr(target_os = "netbsd", link_name = "__stat50")]
742     #[cfg_attr(
743         all(target_os = "freebsd", any(freebsd11, freebsd10)),
744         link_name = "stat@FBSD_1.0"
745     )]
stat(path: *const c_char, buf: *mut stat) -> ::c_int746     pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
747 
pclose(stream: *mut ::FILE) -> ::c_int748     pub fn pclose(stream: *mut ::FILE) -> ::c_int;
749     #[cfg_attr(
750         all(target_os = "macos", target_arch = "x86"),
751         link_name = "fdopen$UNIX2003"
752     )]
fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE753     pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
fileno(stream: *mut ::FILE) -> ::c_int754     pub fn fileno(stream: *mut ::FILE) -> ::c_int;
755 
756     #[cfg_attr(
757         all(target_os = "macos", target_arch = "x86"),
758         link_name = "open$UNIX2003"
759     )]
open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int760     pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
761     #[cfg_attr(
762         all(target_os = "macos", target_arch = "x86"),
763         link_name = "creat$UNIX2003"
764     )]
creat(path: *const c_char, mode: mode_t) -> ::c_int765     pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
766     #[cfg_attr(
767         all(target_os = "macos", target_arch = "x86"),
768         link_name = "fcntl$UNIX2003"
769     )]
fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int770     pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
771 
772     #[cfg_attr(
773         all(target_os = "macos", target_arch = "x86_64"),
774         link_name = "opendir$INODE64"
775     )]
776     #[cfg_attr(
777         all(target_os = "macos", target_arch = "x86"),
778         link_name = "opendir$INODE64$UNIX2003"
779     )]
780     #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")]
opendir(dirname: *const c_char) -> *mut ::DIR781     pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
782 
783     #[cfg_attr(
784         all(target_os = "macos", not(target_arch = "aarch64")),
785         link_name = "readdir$INODE64"
786     )]
787     #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
788     #[cfg_attr(
789         all(target_os = "freebsd", any(freebsd11, freebsd10)),
790         link_name = "readdir@FBSD_1.0"
791     )]
readdir(dirp: *mut ::DIR) -> *mut ::dirent792     pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
793     #[cfg_attr(
794         all(target_os = "macos", target_arch = "x86"),
795         link_name = "closedir$UNIX2003"
796     )]
closedir(dirp: *mut ::DIR) -> ::c_int797     pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
798     #[cfg_attr(
799         all(target_os = "macos", target_arch = "x86_64"),
800         link_name = "rewinddir$INODE64"
801     )]
802     #[cfg_attr(
803         all(target_os = "macos", target_arch = "x86"),
804         link_name = "rewinddir$INODE64$UNIX2003"
805     )]
rewinddir(dirp: *mut ::DIR)806     pub fn rewinddir(dirp: *mut ::DIR);
807 
fchmodat( dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t, flags: ::c_int, ) -> ::c_int808     pub fn fchmodat(
809         dirfd: ::c_int,
810         pathname: *const ::c_char,
811         mode: ::mode_t,
812         flags: ::c_int,
813     ) -> ::c_int;
fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int814     pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
fchownat( dirfd: ::c_int, pathname: *const ::c_char, owner: ::uid_t, group: ::gid_t, flags: ::c_int, ) -> ::c_int815     pub fn fchownat(
816         dirfd: ::c_int,
817         pathname: *const ::c_char,
818         owner: ::uid_t,
819         group: ::gid_t,
820         flags: ::c_int,
821     ) -> ::c_int;
822     #[cfg_attr(
823         all(target_os = "macos", not(target_arch = "aarch64")),
824         link_name = "fstatat$INODE64"
825     )]
826     #[cfg_attr(
827         all(target_os = "freebsd", any(freebsd11, freebsd10)),
828         link_name = "fstatat@FBSD_1.1"
829     )]
fstatat( dirfd: ::c_int, pathname: *const ::c_char, buf: *mut stat, flags: ::c_int, ) -> ::c_int830     pub fn fstatat(
831         dirfd: ::c_int,
832         pathname: *const ::c_char,
833         buf: *mut stat,
834         flags: ::c_int,
835     ) -> ::c_int;
linkat( olddirfd: ::c_int, oldpath: *const ::c_char, newdirfd: ::c_int, newpath: *const ::c_char, flags: ::c_int, ) -> ::c_int836     pub fn linkat(
837         olddirfd: ::c_int,
838         oldpath: *const ::c_char,
839         newdirfd: ::c_int,
840         newpath: *const ::c_char,
841         flags: ::c_int,
842     ) -> ::c_int;
renameat( olddirfd: ::c_int, oldpath: *const ::c_char, newdirfd: ::c_int, newpath: *const ::c_char, ) -> ::c_int843     pub fn renameat(
844         olddirfd: ::c_int,
845         oldpath: *const ::c_char,
846         newdirfd: ::c_int,
847         newpath: *const ::c_char,
848     ) -> ::c_int;
symlinkat( target: *const ::c_char, newdirfd: ::c_int, linkpath: *const ::c_char, ) -> ::c_int849     pub fn symlinkat(
850         target: *const ::c_char,
851         newdirfd: ::c_int,
852         linkpath: *const ::c_char,
853     ) -> ::c_int;
unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int854     pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
855 
access(path: *const c_char, amode: ::c_int) -> ::c_int856     pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
alarm(seconds: ::c_uint) -> ::c_uint857     pub fn alarm(seconds: ::c_uint) -> ::c_uint;
chdir(dir: *const c_char) -> ::c_int858     pub fn chdir(dir: *const c_char) -> ::c_int;
fchdir(dirfd: ::c_int) -> ::c_int859     pub fn fchdir(dirfd: ::c_int) -> ::c_int;
chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int860     pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
861     #[cfg_attr(
862         all(target_os = "macos", target_arch = "x86"),
863         link_name = "lchown$UNIX2003"
864     )]
lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int865     pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
866     #[cfg_attr(
867         all(target_os = "macos", target_arch = "x86"),
868         link_name = "close$NOCANCEL$UNIX2003"
869     )]
870     #[cfg_attr(
871         all(target_os = "macos", target_arch = "x86_64"),
872         link_name = "close$NOCANCEL"
873     )]
close(fd: ::c_int) -> ::c_int874     pub fn close(fd: ::c_int) -> ::c_int;
dup(fd: ::c_int) -> ::c_int875     pub fn dup(fd: ::c_int) -> ::c_int;
dup2(src: ::c_int, dst: ::c_int) -> ::c_int876     pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int877     pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int878     pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int879     pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int880     pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
execve( prog: *const c_char, argv: *const *const c_char, envp: *const *const c_char, ) -> ::c_int881     pub fn execve(
882         prog: *const c_char,
883         argv: *const *const c_char,
884         envp: *const *const c_char,
885     ) -> ::c_int;
execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int886     pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
fork() -> pid_t887     pub fn fork() -> pid_t;
fpathconf(filedes: ::c_int, name: ::c_int) -> c_long888     pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char889     pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
getegid() -> gid_t890     pub fn getegid() -> gid_t;
geteuid() -> uid_t891     pub fn geteuid() -> uid_t;
getgid() -> gid_t892     pub fn getgid() -> gid_t;
getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int893     pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
894     #[cfg_attr(target_os = "illumos", link_name = "getloginx")]
getlogin() -> *mut c_char895     pub fn getlogin() -> *mut c_char;
896     #[cfg_attr(
897         all(target_os = "macos", target_arch = "x86"),
898         link_name = "getopt$UNIX2003"
899     )]
getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int900     pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
getpgid(pid: pid_t) -> pid_t901     pub fn getpgid(pid: pid_t) -> pid_t;
getpgrp() -> pid_t902     pub fn getpgrp() -> pid_t;
getpid() -> pid_t903     pub fn getpid() -> pid_t;
getppid() -> pid_t904     pub fn getppid() -> pid_t;
getuid() -> uid_t905     pub fn getuid() -> uid_t;
isatty(fd: ::c_int) -> ::c_int906     pub fn isatty(fd: ::c_int) -> ::c_int;
link(src: *const c_char, dst: *const c_char) -> ::c_int907     pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t908     pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
pathconf(path: *const c_char, name: ::c_int) -> c_long909     pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pipe(fds: *mut ::c_int) -> ::c_int910     pub fn pipe(fds: *mut ::c_int) -> ::c_int;
posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int911     pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
912     #[cfg_attr(
913         all(target_os = "macos", target_arch = "x86"),
914         link_name = "read$UNIX2003"
915     )]
read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t916     pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
rmdir(path: *const c_char) -> ::c_int917     pub fn rmdir(path: *const c_char) -> ::c_int;
seteuid(uid: uid_t) -> ::c_int918     pub fn seteuid(uid: uid_t) -> ::c_int;
setegid(gid: gid_t) -> ::c_int919     pub fn setegid(gid: gid_t) -> ::c_int;
setgid(gid: gid_t) -> ::c_int920     pub fn setgid(gid: gid_t) -> ::c_int;
setpgid(pid: pid_t, pgid: pid_t) -> ::c_int921     pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
setsid() -> pid_t922     pub fn setsid() -> pid_t;
setuid(uid: uid_t) -> ::c_int923     pub fn setuid(uid: uid_t) -> ::c_int;
setreuid(ruid: uid_t, euid: uid_t) -> ::c_int924     pub fn setreuid(ruid: uid_t, euid: uid_t) -> ::c_int;
setregid(rgid: gid_t, egid: gid_t) -> ::c_int925     pub fn setregid(rgid: gid_t, egid: gid_t) -> ::c_int;
926     #[cfg_attr(
927         all(target_os = "macos", target_arch = "x86"),
928         link_name = "sleep$UNIX2003"
929     )]
sleep(secs: ::c_uint) -> ::c_uint930     pub fn sleep(secs: ::c_uint) -> ::c_uint;
931     #[cfg_attr(
932         all(target_os = "macos", target_arch = "x86"),
933         link_name = "nanosleep$UNIX2003"
934     )]
935     #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")]
nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int936     pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int;
tcgetpgrp(fd: ::c_int) -> pid_t937     pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int938     pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
ttyname(fd: ::c_int) -> *mut c_char939     pub fn ttyname(fd: ::c_int) -> *mut c_char;
940     #[cfg_attr(
941         all(target_os = "macos", target_arch = "x86"),
942         link_name = "ttyname_r$UNIX2003"
943     )]
944     #[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")]
ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int945     pub fn ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
unlink(c: *const c_char) -> ::c_int946     pub fn unlink(c: *const c_char) -> ::c_int;
947     #[cfg_attr(
948         all(target_os = "macos", target_arch = "x86"),
949         link_name = "wait$UNIX2003"
950     )]
wait(status: *mut ::c_int) -> pid_t951     pub fn wait(status: *mut ::c_int) -> pid_t;
952     #[cfg_attr(
953         all(target_os = "macos", target_arch = "x86"),
954         link_name = "waitpid$UNIX2003"
955     )]
waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t956     pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
957     #[cfg_attr(
958         all(target_os = "macos", target_arch = "x86"),
959         link_name = "write$UNIX2003"
960     )]
write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t961     pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
962     #[cfg_attr(
963         all(target_os = "macos", target_arch = "x86"),
964         link_name = "pread$UNIX2003"
965     )]
pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t966     pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
967     #[cfg_attr(
968         all(target_os = "macos", target_arch = "x86"),
969         link_name = "pwrite$UNIX2003"
970     )]
pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t971     pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
umask(mask: mode_t) -> mode_t972     pub fn umask(mask: mode_t) -> mode_t;
973 
974     #[cfg_attr(target_os = "netbsd", link_name = "__utime50")]
utime(file: *const c_char, buf: *const utimbuf) -> ::c_int975     pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
976 
977     #[cfg_attr(
978         all(target_os = "macos", target_arch = "x86"),
979         link_name = "kill$UNIX2003"
980     )]
kill(pid: pid_t, sig: ::c_int) -> ::c_int981     pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
982     #[cfg_attr(
983         all(target_os = "macos", target_arch = "x86"),
984         link_name = "killpg$UNIX2003"
985     )]
killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int986     pub fn killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int;
987 
mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int988     pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int989     pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
mlockall(flags: ::c_int) -> ::c_int990     pub fn mlockall(flags: ::c_int) -> ::c_int;
munlockall() -> ::c_int991     pub fn munlockall() -> ::c_int;
992 
993     #[cfg_attr(
994         all(target_os = "macos", target_arch = "x86"),
995         link_name = "mmap$UNIX2003"
996     )]
mmap( addr: *mut ::c_void, len: ::size_t, prot: ::c_int, flags: ::c_int, fd: ::c_int, offset: off_t, ) -> *mut ::c_void997     pub fn mmap(
998         addr: *mut ::c_void,
999         len: ::size_t,
1000         prot: ::c_int,
1001         flags: ::c_int,
1002         fd: ::c_int,
1003         offset: off_t,
1004     ) -> *mut ::c_void;
1005     #[cfg_attr(
1006         all(target_os = "macos", target_arch = "x86"),
1007         link_name = "munmap$UNIX2003"
1008     )]
munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int1009     pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
1010 
if_nametoindex(ifname: *const c_char) -> ::c_uint1011     pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char1012     pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
1013 
1014     #[cfg_attr(
1015         all(target_os = "macos", not(target_arch = "aarch64")),
1016         link_name = "lstat$INODE64"
1017     )]
1018     #[cfg_attr(target_os = "netbsd", link_name = "__lstat50")]
1019     #[cfg_attr(
1020         all(target_os = "freebsd", any(freebsd11, freebsd10)),
1021         link_name = "lstat@FBSD_1.0"
1022     )]
lstat(path: *const c_char, buf: *mut stat) -> ::c_int1023     pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
1024 
1025     #[cfg_attr(
1026         all(target_os = "macos", target_arch = "x86"),
1027         link_name = "fsync$UNIX2003"
1028     )]
fsync(fd: ::c_int) -> ::c_int1029     pub fn fsync(fd: ::c_int) -> ::c_int;
1030 
1031     #[cfg_attr(
1032         all(target_os = "macos", target_arch = "x86"),
1033         link_name = "setenv$UNIX2003"
1034     )]
setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int1035     pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
1036     #[cfg_attr(
1037         all(target_os = "macos", target_arch = "x86"),
1038         link_name = "unsetenv$UNIX2003"
1039     )]
1040     #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")]
unsetenv(name: *const c_char) -> ::c_int1041     pub fn unsetenv(name: *const c_char) -> ::c_int;
1042 
symlink(path1: *const c_char, path2: *const c_char) -> ::c_int1043     pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
1044 
ftruncate(fd: ::c_int, length: off_t) -> ::c_int1045     pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
1046 
signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t1047     pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
1048 
1049     #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")]
getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int1050     pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
1051 
1052     #[cfg_attr(
1053         any(
1054             target_os = "macos",
1055             target_os = "ios",
1056             target_os = "tvos",
1057             target_os = "watchos"
1058         ),
1059         link_name = "realpath$DARWIN_EXTSN"
1060     )]
realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char1061     pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
1062 
flock(fd: ::c_int, operation: ::c_int) -> ::c_int1063     pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
1064 
1065     #[cfg_attr(target_os = "netbsd", link_name = "__times13")]
times(buf: *mut ::tms) -> ::clock_t1066     pub fn times(buf: *mut ::tms) -> ::clock_t;
1067 
pthread_self() -> ::pthread_t1068     pub fn pthread_self() -> ::pthread_t;
1069     #[cfg_attr(
1070         all(target_os = "macos", target_arch = "x86"),
1071         link_name = "pthread_join$UNIX2003"
1072     )]
pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int1073     pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
pthread_exit(value: *mut ::c_void) -> !1074     pub fn pthread_exit(value: *mut ::c_void) -> !;
pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int1075     pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int1076     pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int1077     pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int1078     pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
pthread_detach(thread: ::pthread_t) -> ::c_int1079     pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
1080     #[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")]
sched_yield() -> ::c_int1081     pub fn sched_yield() -> ::c_int;
pthread_key_create( key: *mut pthread_key_t, dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>, ) -> ::c_int1082     pub fn pthread_key_create(
1083         key: *mut pthread_key_t,
1084         dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
1085     ) -> ::c_int;
pthread_key_delete(key: pthread_key_t) -> ::c_int1086     pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
pthread_getspecific(key: pthread_key_t) -> *mut ::c_void1087     pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int1088     pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
pthread_mutex_init( lock: *mut pthread_mutex_t, attr: *const pthread_mutexattr_t, ) -> ::c_int1089     pub fn pthread_mutex_init(
1090         lock: *mut pthread_mutex_t,
1091         attr: *const pthread_mutexattr_t,
1092     ) -> ::c_int;
pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int1093     pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int;
pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int1094     pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int;
pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int1095     pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int;
pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int1096     pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
1097 
pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int1098     pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
1099     #[cfg_attr(
1100         all(target_os = "macos", target_arch = "x86"),
1101         link_name = "pthread_mutexattr_destroy$UNIX2003"
1102     )]
pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int1103     pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int1104     pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
1105 
1106     #[cfg_attr(
1107         all(target_os = "macos", target_arch = "x86"),
1108         link_name = "pthread_cond_init$UNIX2003"
1109     )]
pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> ::c_int1110     pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
1111         -> ::c_int;
1112     #[cfg_attr(
1113         all(target_os = "macos", target_arch = "x86"),
1114         link_name = "pthread_cond_wait$UNIX2003"
1115     )]
pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int1116     pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
1117     #[cfg_attr(
1118         all(target_os = "macos", target_arch = "x86"),
1119         link_name = "pthread_cond_timedwait$UNIX2003"
1120     )]
pthread_cond_timedwait( cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t, abstime: *const ::timespec, ) -> ::c_int1121     pub fn pthread_cond_timedwait(
1122         cond: *mut pthread_cond_t,
1123         lock: *mut pthread_mutex_t,
1124         abstime: *const ::timespec,
1125     ) -> ::c_int;
pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int1126     pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int;
pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int1127     pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int;
pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int1128     pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int1129     pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int;
pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int1130     pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int;
1131     #[cfg_attr(
1132         all(target_os = "macos", target_arch = "x86"),
1133         link_name = "pthread_rwlock_init$UNIX2003"
1134     )]
pthread_rwlock_init( lock: *mut pthread_rwlock_t, attr: *const pthread_rwlockattr_t, ) -> ::c_int1135     pub fn pthread_rwlock_init(
1136         lock: *mut pthread_rwlock_t,
1137         attr: *const pthread_rwlockattr_t,
1138     ) -> ::c_int;
1139     #[cfg_attr(
1140         all(target_os = "macos", target_arch = "x86"),
1141         link_name = "pthread_rwlock_destroy$UNIX2003"
1142     )]
pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int1143     pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int;
1144     #[cfg_attr(
1145         all(target_os = "macos", target_arch = "x86"),
1146         link_name = "pthread_rwlock_rdlock$UNIX2003"
1147     )]
pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int1148     pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1149     #[cfg_attr(
1150         all(target_os = "macos", target_arch = "x86"),
1151         link_name = "pthread_rwlock_tryrdlock$UNIX2003"
1152     )]
pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int1153     pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1154     #[cfg_attr(
1155         all(target_os = "macos", target_arch = "x86"),
1156         link_name = "pthread_rwlock_wrlock$UNIX2003"
1157     )]
pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int1158     pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1159     #[cfg_attr(
1160         all(target_os = "macos", target_arch = "x86"),
1161         link_name = "pthread_rwlock_trywrlock$UNIX2003"
1162     )]
pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int1163     pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1164     #[cfg_attr(
1165         all(target_os = "macos", target_arch = "x86"),
1166         link_name = "pthread_rwlock_unlock$UNIX2003"
1167     )]
pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int1168     pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int1169     pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int1170     pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
1171 
1172     #[cfg_attr(target_os = "illumos", link_name = "__xnet_getsockopt")]
1173     #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")]
getsockopt( sockfd: ::c_int, level: ::c_int, optname: ::c_int, optval: *mut ::c_void, optlen: *mut ::socklen_t, ) -> ::c_int1174     pub fn getsockopt(
1175         sockfd: ::c_int,
1176         level: ::c_int,
1177         optname: ::c_int,
1178         optval: *mut ::c_void,
1179         optlen: *mut ::socklen_t,
1180     ) -> ::c_int;
raise(signum: ::c_int) -> ::c_int1181     pub fn raise(signum: ::c_int) -> ::c_int;
1182 
1183     #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int1184     pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void1185     pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
dlerror() -> *mut ::c_char1186     pub fn dlerror() -> *mut ::c_char;
dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void1187     pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
dlclose(handle: *mut ::c_void) -> ::c_int1188     pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int1189     pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
1190 
1191     #[cfg(not(all(
1192         libc_cfg_target_vendor,
1193         target_arch = "powerpc",
1194         target_vendor = "nintendo"
1195     )))]
1196     #[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")]
1197     #[cfg_attr(target_os = "espidf", link_name = "lwip_getaddrinfo")]
getaddrinfo( node: *const c_char, service: *const c_char, hints: *const addrinfo, res: *mut *mut addrinfo, ) -> ::c_int1198     pub fn getaddrinfo(
1199         node: *const c_char,
1200         service: *const c_char,
1201         hints: *const addrinfo,
1202         res: *mut *mut addrinfo,
1203     ) -> ::c_int;
1204     #[cfg(not(all(
1205         libc_cfg_target_vendor,
1206         target_arch = "powerpc",
1207         target_vendor = "nintendo"
1208     )))]
1209     #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")]
freeaddrinfo(res: *mut addrinfo)1210     pub fn freeaddrinfo(res: *mut addrinfo);
hstrerror(errcode: ::c_int) -> *const ::c_char1211     pub fn hstrerror(errcode: ::c_int) -> *const ::c_char;
gai_strerror(errcode: ::c_int) -> *const ::c_char1212     pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
1213     #[cfg_attr(
1214         any(
1215             all(
1216                 target_os = "linux",
1217                 not(any(target_env = "musl", target_env = "ohos"))
1218             ),
1219             target_os = "freebsd",
1220             target_os = "dragonfly",
1221             target_os = "haiku"
1222         ),
1223         link_name = "__res_init"
1224     )]
1225     #[cfg_attr(
1226         any(
1227             target_os = "macos",
1228             target_os = "ios",
1229             target_os = "tvos",
1230             target_os = "watchos"
1231         ),
1232         link_name = "res_9_init"
1233     )]
res_init() -> ::c_int1234     pub fn res_init() -> ::c_int;
1235 
1236     #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
1237     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1238     // FIXME: for `time_t`
gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm1239     pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
1240     #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
1241     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1242     // FIXME: for `time_t`
localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm1243     pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
1244     #[cfg_attr(
1245         all(target_os = "macos", target_arch = "x86"),
1246         link_name = "mktime$UNIX2003"
1247     )]
1248     #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
1249     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1250     // FIXME: for `time_t`
mktime(tm: *mut tm) -> time_t1251     pub fn mktime(tm: *mut tm) -> time_t;
1252     #[cfg_attr(target_os = "netbsd", link_name = "__time50")]
1253     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1254     // FIXME: for `time_t`
time(time: *mut time_t) -> time_t1255     pub fn time(time: *mut time_t) -> time_t;
1256     #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
1257     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1258     // FIXME: for `time_t`
gmtime(time_p: *const time_t) -> *mut tm1259     pub fn gmtime(time_p: *const time_t) -> *mut tm;
1260     #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
1261     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1262     // FIXME: for `time_t`
localtime(time_p: *const time_t) -> *mut tm1263     pub fn localtime(time_p: *const time_t) -> *mut tm;
1264     #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")]
1265     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1266     // FIXME: for `time_t`
difftime(time1: time_t, time0: time_t) -> ::c_double1267     pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
1268     #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
1269     #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1270     // FIXME: for `time_t`
timegm(tm: *mut ::tm) -> time_t1271     pub fn timegm(tm: *mut ::tm) -> time_t;
1272 
1273     #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
1274     #[cfg_attr(
1275         all(target_os = "freebsd", any(freebsd11, freebsd10)),
1276         link_name = "mknod@FBSD_1.0"
1277     )]
mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int1278     pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int1279     pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
endservent()1280     pub fn endservent();
getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent1281     pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
getservbyport(port: ::c_int, proto: *const ::c_char) -> *mut servent1282     pub fn getservbyport(port: ::c_int, proto: *const ::c_char) -> *mut servent;
getservent() -> *mut servent1283     pub fn getservent() -> *mut servent;
setservent(stayopen: ::c_int)1284     pub fn setservent(stayopen: ::c_int);
getprotobyname(name: *const ::c_char) -> *mut protoent1285     pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
getprotobynumber(proto: ::c_int) -> *mut protoent1286     pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
chroot(name: *const ::c_char) -> ::c_int1287     pub fn chroot(name: *const ::c_char) -> ::c_int;
1288     #[cfg_attr(
1289         all(target_os = "macos", target_arch = "x86"),
1290         link_name = "usleep$UNIX2003"
1291     )]
usleep(secs: ::c_uint) -> ::c_int1292     pub fn usleep(secs: ::c_uint) -> ::c_int;
1293     #[cfg_attr(
1294         all(target_os = "macos", target_arch = "x86"),
1295         link_name = "send$UNIX2003"
1296     )]
1297     #[cfg_attr(target_os = "espidf", link_name = "lwip_send")]
send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t1298     pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
1299     #[cfg_attr(
1300         all(target_os = "macos", target_arch = "x86"),
1301         link_name = "recv$UNIX2003"
1302     )]
1303     #[cfg_attr(target_os = "espidf", link_name = "lwip_recv")]
recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t1304     pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
1305     #[cfg_attr(
1306         all(target_os = "macos", target_arch = "x86"),
1307         link_name = "putenv$UNIX2003"
1308     )]
1309     #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")]
putenv(string: *mut c_char) -> ::c_int1310     pub fn putenv(string: *mut c_char) -> ::c_int;
1311     #[cfg_attr(
1312         all(target_os = "macos", target_arch = "x86"),
1313         link_name = "poll$UNIX2003"
1314     )]
poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int1315     pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
1316     #[cfg_attr(
1317         all(target_os = "macos", target_arch = "x86_64"),
1318         link_name = "select$1050"
1319     )]
1320     #[cfg_attr(
1321         all(target_os = "macos", target_arch = "x86"),
1322         link_name = "select$UNIX2003"
1323     )]
1324     #[cfg_attr(target_os = "netbsd", link_name = "__select50")]
select( nfds: ::c_int, readfds: *mut fd_set, writefds: *mut fd_set, errorfds: *mut fd_set, timeout: *mut timeval, ) -> ::c_int1325     pub fn select(
1326         nfds: ::c_int,
1327         readfds: *mut fd_set,
1328         writefds: *mut fd_set,
1329         errorfds: *mut fd_set,
1330         timeout: *mut timeval,
1331     ) -> ::c_int;
1332     #[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")]
setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char1333     pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
localeconv() -> *mut lconv1334     pub fn localeconv() -> *mut lconv;
1335 
1336     #[cfg_attr(
1337         all(target_os = "macos", target_arch = "x86"),
1338         link_name = "sem_wait$UNIX2003"
1339     )]
sem_wait(sem: *mut sem_t) -> ::c_int1340     pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
sem_trywait(sem: *mut sem_t) -> ::c_int1341     pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
sem_post(sem: *mut sem_t) -> ::c_int1342     pub fn sem_post(sem: *mut sem_t) -> ::c_int;
statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int1343     pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int1344     pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
1345 
1346     #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
sigemptyset(set: *mut sigset_t) -> ::c_int1347     pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
1348     #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int1349     pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
1350     #[cfg_attr(target_os = "netbsd", link_name = "__sigfillset14")]
sigfillset(set: *mut sigset_t) -> ::c_int1351     pub fn sigfillset(set: *mut sigset_t) -> ::c_int;
1352     #[cfg_attr(target_os = "netbsd", link_name = "__sigdelset14")]
sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int1353     pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
1354     #[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")]
sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int1355     pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
1356 
1357     #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")]
sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int1358     pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
1359     #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
sigpending(set: *mut sigset_t) -> ::c_int1360     pub fn sigpending(set: *mut sigset_t) -> ::c_int;
1361 
sysconf(name: ::c_int) -> ::c_long1362     pub fn sysconf(name: ::c_int) -> ::c_long;
1363 
mkfifo(path: *const c_char, mode: mode_t) -> ::c_int1364     pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
1365 
fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int1366     pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
ftello(stream: *mut ::FILE) -> ::off_t1367     pub fn ftello(stream: *mut ::FILE) -> ::off_t;
1368     #[cfg_attr(
1369         all(target_os = "macos", target_arch = "x86"),
1370         link_name = "tcdrain$UNIX2003"
1371     )]
tcdrain(fd: ::c_int) -> ::c_int1372     pub fn tcdrain(fd: ::c_int) -> ::c_int;
cfgetispeed(termios: *const ::termios) -> ::speed_t1373     pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
cfgetospeed(termios: *const ::termios) -> ::speed_t1374     pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int1375     pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int1376     pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int1377     pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int1378     pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
tcflow(fd: ::c_int, action: ::c_int) -> ::c_int1379     pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
tcflush(fd: ::c_int, action: ::c_int) -> ::c_int1380     pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
tcgetsid(fd: ::c_int) -> ::pid_t1381     pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int1382     pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
mkstemp(template: *mut ::c_char) -> ::c_int1383     pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
mkdtemp(template: *mut ::c_char) -> *mut ::c_char1384     pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
1385 
tmpnam(ptr: *mut ::c_char) -> *mut ::c_char1386     pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
1387 
openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int)1388     pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
closelog()1389     pub fn closelog();
setlogmask(maskpri: ::c_int) -> ::c_int1390     pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
1391     #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")]
syslog(priority: ::c_int, message: *const ::c_char, ...)1392     pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
1393     #[cfg_attr(
1394         all(target_os = "macos", target_arch = "x86"),
1395         link_name = "nice$UNIX2003"
1396     )]
nice(incr: ::c_int) -> ::c_int1397     pub fn nice(incr: ::c_int) -> ::c_int;
1398 
grantpt(fd: ::c_int) -> ::c_int1399     pub fn grantpt(fd: ::c_int) -> ::c_int;
posix_openpt(flags: ::c_int) -> ::c_int1400     pub fn posix_openpt(flags: ::c_int) -> ::c_int;
ptsname(fd: ::c_int) -> *mut ::c_char1401     pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
unlockpt(fd: ::c_int) -> ::c_int1402     pub fn unlockpt(fd: ::c_int) -> ::c_int;
1403 
strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char1404     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_t1405     pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
1406 
lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int1407     pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int;
1408 
1409 }
1410 cfg_if! {
1411     if #[cfg(not(any(target_os = "emscripten",
1412                      target_os = "android",
1413                      target_os = "haiku",
1414                      target_os = "nto")))] {
1415         extern "C" {
1416             pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
1417             pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
1418         }
1419     }
1420 }
1421 
1422 cfg_if! {
1423     if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {
1424         extern "C" {
1425             pub fn open_wmemstream(
1426                 ptr: *mut *mut wchar_t,
1427                 sizeloc: *mut size_t,
1428             ) -> *mut FILE;
1429         }
1430     }
1431 }
1432 
1433 cfg_if! {
1434     if #[cfg(not(target_os = "redox"))] {
1435         extern {
1436             pub fn getsid(pid: pid_t) -> pid_t;
1437             pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
1438             #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1439                        link_name = "pause$UNIX2003")]
1440             pub fn pause() -> ::c_int;
1441 
1442             pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
1443                           mode: ::mode_t) -> ::c_int;
1444             pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
1445                           flags: ::c_int, ...) -> ::c_int;
1446 
1447             #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
1448                        link_name = "fdopendir$INODE64")]
1449             #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1450                        link_name = "fdopendir$INODE64$UNIX2003")]
1451             pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
1452 
1453             #[cfg_attr(all(target_os = "macos", not(target_arch = "aarch64")),
1454                        link_name = "readdir_r$INODE64")]
1455             #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
1456             #[cfg_attr(
1457                 all(target_os = "freebsd", any(freebsd11, freebsd10)),
1458                 link_name = "readdir_r@FBSD_1.0"
1459             )]
1460             #[allow(non_autolinks)] // FIXME: `<>` breaks line length limit.
1461             /// The 64-bit libc on Solaris and illumos only has readdir_r. If a
1462             /// 32-bit Solaris or illumos target is ever created, it should use
1463             /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos:
1464             /// https://illumos.org/man/3lib/libc
1465             /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html
1466             /// https://www.unix.com/man-page/opensolaris/3LIB/libc/
1467             pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
1468                              result: *mut *mut ::dirent) -> ::c_int;
1469         }
1470     }
1471 }
1472 
1473 cfg_if! {
1474     if #[cfg(target_os = "nto")] {
1475         extern {
1476             pub fn readlinkat(dirfd: ::c_int,
1477                 pathname: *const ::c_char,
1478                 buf: *mut ::c_char,
1479                 bufsiz: ::size_t) -> ::c_int;
1480             pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::c_int;
1481             pub fn pselect(
1482                 nfds: ::c_int,
1483                 readfds: *mut fd_set,
1484                 writefds: *mut fd_set,
1485                 errorfds: *mut fd_set,
1486                 timeout: *mut timespec,
1487                 sigmask: *const sigset_t,
1488             ) -> ::c_int;
1489         }
1490     } else {
1491         extern {
1492             pub fn readlinkat(dirfd: ::c_int,
1493                 pathname: *const ::c_char,
1494                 buf: *mut ::c_char,
1495                 bufsiz: ::size_t) -> ::ssize_t;
1496             pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE;
1497             pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE;
1498             pub fn atexit(cb: extern "C" fn()) -> c_int;
1499             #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
1500             pub fn sigaction(
1501                 signum: ::c_int,
1502                 act: *const sigaction,
1503                 oldact: *mut sigaction
1504             ) -> ::c_int;
1505             pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
1506             #[cfg_attr(
1507                 all(target_os = "macos", target_arch = "x86_64"),
1508                 link_name = "pselect$1050"
1509             )]
1510             #[cfg_attr(
1511                 all(target_os = "macos", target_arch = "x86"),
1512                 link_name = "pselect$UNIX2003"
1513             )]
1514             #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
1515             pub fn pselect(
1516                 nfds: ::c_int,
1517                 readfds: *mut fd_set,
1518                 writefds: *mut fd_set,
1519                 errorfds: *mut fd_set,
1520                 timeout: *const timespec,
1521                 sigmask: *const sigset_t,
1522             ) -> ::c_int;
1523         }
1524     }
1525 }
1526 
1527 cfg_if! {
1528    if #[cfg(not(any(target_os = "solaris",
1529                     target_os = "illumos",
1530                     target_os = "nto",
1531                 )))] {
1532         extern {
1533             pub fn cfmakeraw(termios: *mut ::termios);
1534             pub fn cfsetspeed(termios: *mut ::termios,
1535                               speed: ::speed_t) -> ::c_int;
1536         }
1537    }
1538 }
1539 
1540 cfg_if! {
1541     if #[cfg(target_env = "newlib")] {
1542         mod newlib;
1543         pub use self::newlib::*;
1544     } else if #[cfg(any(target_os = "linux",
1545                         target_os = "l4re",
1546                         target_os = "android",
1547                         target_os = "emscripten"))] {
1548         mod linux_like;
1549         pub use self::linux_like::*;
1550     } else if #[cfg(any(target_os = "macos",
1551                         target_os = "ios",
1552                         target_os = "tvos",
1553                         target_os = "watchos",
1554                         target_os = "freebsd",
1555                         target_os = "dragonfly",
1556                         target_os = "openbsd",
1557                         target_os = "netbsd"))] {
1558         mod bsd;
1559         pub use self::bsd::*;
1560     } else if #[cfg(any(target_os = "solaris",
1561                         target_os = "illumos"))] {
1562         mod solarish;
1563         pub use self::solarish::*;
1564     } else if #[cfg(target_os = "haiku")] {
1565         mod haiku;
1566         pub use self::haiku::*;
1567     } else if #[cfg(target_os = "hermit")] {
1568         mod hermit;
1569         pub use self::hermit::*;
1570     } else if #[cfg(target_os = "redox")] {
1571         mod redox;
1572         pub use self::redox::*;
1573     } else if #[cfg(target_os = "nto")] {
1574         mod nto;
1575         pub use self::nto::*;
1576     } else {
1577         // Unknown target_os
1578     }
1579 }
1580 
1581 cfg_if! {
1582     if #[cfg(libc_core_cvoid)] {
1583         pub use ::ffi::c_void;
1584     } else {
1585         // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
1586         // enable more optimization opportunities around it recognizing things
1587         // like malloc/free.
1588         #[repr(u8)]
1589         #[allow(missing_copy_implementations)]
1590         #[allow(missing_debug_implementations)]
1591         pub enum c_void {
1592             // Two dummy variants so the #[repr] attribute can be used.
1593             #[doc(hidden)]
1594             __variant1,
1595             #[doc(hidden)]
1596             __variant2,
1597         }
1598     }
1599 }
1600 
1601 cfg_if! {
1602     if #[cfg(libc_align)] {
1603         mod align;
1604         pub use self::align::*;
1605     } else {
1606         mod no_align;
1607         pub use self::no_align::*;
1608     }
1609 }
1610