1pub type c_schar = i8;
7pub type c_uchar = u8;
8pub type c_short = i16;
9pub type c_ushort = u16;
10pub type c_int = i32;
11pub type c_uint = u32;
12pub type c_float = f32;
13pub type c_double = f64;
14pub type c_longlong = i64;
15pub type c_ulonglong = u64;
16pub type intmax_t = i64;
17pub type uintmax_t = u64;
18
19pub type size_t = usize;
20pub type ptrdiff_t = isize;
21pub type intptr_t = isize;
22pub type uintptr_t = usize;
23pub type ssize_t = isize;
24
25pub type pid_t = i32;
26pub type in_addr_t = u32;
27pub type in_port_t = u16;
28pub type sighandler_t = ::size_t;
29pub type cc_t = ::c_uchar;
30
31cfg_if! {
32 if #[cfg(any(target_os = "espidf", target_os = "horizon", target_os = "vita"))] {
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
44missing! {
45 #[cfg_attr(feature = "extra_traits", derive(Debug))]
46 pub enum DIR {}
47}
48pub type locale_t = *mut ::c_void;
49
50s! {
51 pub struct group {
52 pub gr_name: *mut ::c_char,
53 pub gr_passwd: *mut ::c_char,
54 pub gr_gid: ::gid_t,
55 pub gr_mem: *mut *mut ::c_char,
56 }
57
58 pub struct utimbuf {
59 pub actime: time_t,
60 pub modtime: time_t,
61 }
62
63 pub struct timeval {
64 pub tv_sec: time_t,
65 pub tv_usec: suseconds_t,
66 }
67
68 pub struct timespec {
71 pub tv_sec: time_t,
72 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
73 pub tv_nsec: i64,
74 #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
75 pub tv_nsec: ::c_long,
76 }
77
78 pub struct rlimit {
79 pub rlim_cur: rlim_t,
80 pub rlim_max: rlim_t,
81 }
82
83 pub struct rusage {
84 pub ru_utime: timeval,
85 pub ru_stime: timeval,
86 pub ru_maxrss: c_long,
87 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
88 __pad1: u32,
89 pub ru_ixrss: c_long,
90 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
91 __pad2: u32,
92 pub ru_idrss: c_long,
93 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
94 __pad3: u32,
95 pub ru_isrss: c_long,
96 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
97 __pad4: u32,
98 pub ru_minflt: c_long,
99 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
100 __pad5: u32,
101 pub ru_majflt: c_long,
102 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
103 __pad6: u32,
104 pub ru_nswap: c_long,
105 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
106 __pad7: u32,
107 pub ru_inblock: c_long,
108 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
109 __pad8: u32,
110 pub ru_oublock: c_long,
111 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
112 __pad9: u32,
113 pub ru_msgsnd: c_long,
114 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
115 __pad10: u32,
116 pub ru_msgrcv: c_long,
117 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
118 __pad11: u32,
119 pub ru_nsignals: c_long,
120 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
121 __pad12: u32,
122 pub ru_nvcsw: c_long,
123 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
124 __pad13: u32,
125 pub ru_nivcsw: c_long,
126 #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
127 __pad14: u32,
128
129 #[cfg(any(target_env = "musl", target_env = "ohos", target_os = "emscripten"))]
130 __reserved: [c_long; 16],
131 }
132
133 pub struct ipv6_mreq {
134 pub ipv6mr_multiaddr: in6_addr,
135 #[cfg(target_os = "android")]
136 pub ipv6mr_interface: ::c_int,
137 #[cfg(not(target_os = "android"))]
138 pub ipv6mr_interface: ::c_uint,
139 }
140
141 pub struct hostent {
142 pub h_name: *mut ::c_char,
143 pub h_aliases: *mut *mut ::c_char,
144 pub h_addrtype: ::c_int,
145 pub h_length: ::c_int,
146 pub h_addr_list: *mut *mut ::c_char,
147 }
148
149 pub struct iovec {
150 pub iov_base: *mut ::c_void,
151 pub iov_len: ::size_t,
152 }
153
154 pub struct pollfd {
155 pub fd: ::c_int,
156 pub events: ::c_short,
157 pub revents: ::c_short,
158 }
159
160 pub struct winsize {
161 pub ws_row: ::c_ushort,
162 pub ws_col: ::c_ushort,
163 pub ws_xpixel: ::c_ushort,
164 pub ws_ypixel: ::c_ushort,
165 }
166
167 pub struct linger {
168 pub l_onoff: ::c_int,
169 pub l_linger: ::c_int,
170 }
171
172 pub struct sigval {
173 pub sival_ptr: *mut ::c_void
175 }
176
177 pub struct itimerval {
179 pub it_interval: ::timeval,
180 pub it_value: ::timeval,
181 }
182
183 pub struct tms {
185 pub tms_utime: ::clock_t,
186 pub tms_stime: ::clock_t,
187 pub tms_cutime: ::clock_t,
188 pub tms_cstime: ::clock_t,
189 }
190
191 pub struct servent {
192 pub s_name: *mut ::c_char,
193 pub s_aliases: *mut *mut ::c_char,
194 pub s_port: ::c_int,
195 pub s_proto: *mut ::c_char,
196 }
197
198 pub struct protoent {
199 pub p_name: *mut ::c_char,
200 pub p_aliases: *mut *mut ::c_char,
201 pub p_proto: ::c_int,
202 }
203}
204
205pub const INT_MIN: c_int = -2147483648;
206pub const INT_MAX: c_int = 2147483647;
207
208pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
209pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
210pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
211cfg_if! {
212 if #[cfg(not(target_os = "nto"))] {
213 pub const DT_UNKNOWN: u8 = 0;
214 pub const DT_FIFO: u8 = 1;
215 pub const DT_CHR: u8 = 2;
216 pub const DT_DIR: u8 = 4;
217 pub const DT_BLK: u8 = 6;
218 pub const DT_REG: u8 = 8;
219 pub const DT_LNK: u8 = 10;
220 pub const DT_SOCK: u8 = 12;
221 }
222}
223cfg_if! {
224 if #[cfg(not(target_os = "redox"))] {
225 pub const FD_CLOEXEC: ::c_int = 0x1;
226 }
227}
228
229cfg_if! {
230 if #[cfg(not(target_os = "nto"))]
231 {
232 pub const USRQUOTA: ::c_int = 0;
233 pub const GRPQUOTA: ::c_int = 1;
234 }
235}
236pub const SIGIOT: ::c_int = 6;
237
238pub const S_ISUID: ::mode_t = 0x800;
239pub const S_ISGID: ::mode_t = 0x400;
240pub const S_ISVTX: ::mode_t = 0x200;
241
242cfg_if! {
243 if #[cfg(not(any(target_os = "haiku", target_os = "illumos",
244 target_os = "solaris")))] {
245 pub const IF_NAMESIZE: ::size_t = 16;
246 pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
247 }
248}
249
250pub const LOG_EMERG: ::c_int = 0;
251pub const LOG_ALERT: ::c_int = 1;
252pub const LOG_CRIT: ::c_int = 2;
253pub const LOG_ERR: ::c_int = 3;
254pub const LOG_WARNING: ::c_int = 4;
255pub const LOG_NOTICE: ::c_int = 5;
256pub const LOG_INFO: ::c_int = 6;
257pub const LOG_DEBUG: ::c_int = 7;
258
259pub const LOG_KERN: ::c_int = 0;
260pub const LOG_USER: ::c_int = 1 << 3;
261pub const LOG_MAIL: ::c_int = 2 << 3;
262pub const LOG_DAEMON: ::c_int = 3 << 3;
263pub const LOG_AUTH: ::c_int = 4 << 3;
264pub const LOG_SYSLOG: ::c_int = 5 << 3;
265pub const LOG_LPR: ::c_int = 6 << 3;
266pub const LOG_NEWS: ::c_int = 7 << 3;
267pub const LOG_UUCP: ::c_int = 8 << 3;
268pub const LOG_LOCAL0: ::c_int = 16 << 3;
269pub const LOG_LOCAL1: ::c_int = 17 << 3;
270pub const LOG_LOCAL2: ::c_int = 18 << 3;
271pub const LOG_LOCAL3: ::c_int = 19 << 3;
272pub const LOG_LOCAL4: ::c_int = 20 << 3;
273pub const LOG_LOCAL5: ::c_int = 21 << 3;
274pub const LOG_LOCAL6: ::c_int = 22 << 3;
275pub const LOG_LOCAL7: ::c_int = 23 << 3;
276
277cfg_if! {
278 if #[cfg(not(target_os = "haiku"))] {
279 pub const LOG_PID: ::c_int = 0x01;
280 pub const LOG_CONS: ::c_int = 0x02;
281 pub const LOG_ODELAY: ::c_int = 0x04;
282 pub const LOG_NDELAY: ::c_int = 0x08;
283 pub const LOG_NOWAIT: ::c_int = 0x10;
284 }
285}
286pub const LOG_PRIMASK: ::c_int = 7;
287pub const LOG_FACMASK: ::c_int = 0x3f8;
288
289cfg_if! {
290 if #[cfg(not(target_os = "nto"))]
291 {
292 pub const PRIO_MIN: ::c_int = -20;
293 pub const PRIO_MAX: ::c_int = 20;
294 }
295}
296pub const IPPROTO_ICMP: ::c_int = 1;
297pub const IPPROTO_ICMPV6: ::c_int = 58;
298pub const IPPROTO_TCP: ::c_int = 6;
299pub const IPPROTO_UDP: ::c_int = 17;
300pub const IPPROTO_IP: ::c_int = 0;
301pub const IPPROTO_IPV6: ::c_int = 41;
302
303pub const INADDR_LOOPBACK: in_addr_t = 2130706433;
304pub const INADDR_ANY: in_addr_t = 0;
305pub const INADDR_BROADCAST: in_addr_t = 4294967295;
306pub const INADDR_NONE: in_addr_t = 4294967295;
307
308pub const ARPOP_REQUEST: u16 = 1;
309pub const ARPOP_REPLY: u16 = 2;
310
311pub const ATF_COM: ::c_int = 0x02;
312pub const ATF_PERM: ::c_int = 0x04;
313pub const ATF_PUBL: ::c_int = 0x08;
314pub const ATF_USETRAILERS: ::c_int = 0x10;
315
316pub const FNM_PERIOD: c_int = 1 << 2;
317pub const FNM_CASEFOLD: c_int = 1 << 4;
318pub const FNM_NOMATCH: c_int = 1;
319
320cfg_if! {
321 if #[cfg(any(
322 target_os = "macos",
323 target_os = "freebsd",
324 target_os = "android",
325 target_os = "openbsd",
326 ))] {
327 pub const FNM_PATHNAME: c_int = 1 << 1;
328 pub const FNM_NOESCAPE: c_int = 1 << 0;
329 } else {
330 pub const FNM_PATHNAME: c_int = 1 << 0;
331 pub const FNM_NOESCAPE: c_int = 1 << 1;
332 }
333}
334
335extern "C" {
336 pub static in6addr_loopback: in6_addr;
337 pub static in6addr_any: in6_addr;
338}
339
340cfg_if! {
341 if #[cfg(any(target_os = "l4re", target_os = "espidf", target_os = "nuttx"))] {
342 } else if #[cfg(feature = "std")] {
347 } else if #[cfg(all(target_os = "linux",
350 any(target_env = "gnu", target_env = "uclibc"),
351 feature = "rustc-dep-of-std"))] {
352 #[link(name = "util", kind = "static", modifiers = "-bundle",
353 cfg(target_feature = "crt-static"))]
354 #[link(name = "rt", kind = "static", modifiers = "-bundle",
355 cfg(target_feature = "crt-static"))]
356 #[link(name = "pthread", kind = "static", modifiers = "-bundle",
357 cfg(target_feature = "crt-static"))]
358 #[link(name = "m", kind = "static", modifiers = "-bundle",
359 cfg(target_feature = "crt-static"))]
360 #[link(name = "dl", kind = "static", modifiers = "-bundle",
361 cfg(target_feature = "crt-static"))]
362 #[link(name = "c", kind = "static", modifiers = "-bundle",
363 cfg(target_feature = "crt-static"))]
364 #[link(name = "gcc_eh", kind = "static", modifiers = "-bundle",
365 cfg(target_feature = "crt-static"))]
366 #[link(name = "gcc", kind = "static", modifiers = "-bundle",
367 cfg(target_feature = "crt-static"))]
368 #[link(name = "c", kind = "static", modifiers = "-bundle",
369 cfg(target_feature = "crt-static"))]
370 #[link(name = "util", cfg(not(target_feature = "crt-static")))]
371 #[link(name = "rt", cfg(not(target_feature = "crt-static")))]
372 #[link(name = "pthread", cfg(not(target_feature = "crt-static")))]
373 #[link(name = "m", cfg(not(target_feature = "crt-static")))]
374 #[link(name = "dl", cfg(not(target_feature = "crt-static")))]
375 #[link(name = "c", cfg(not(target_feature = "crt-static")))]
376 extern {}
377 } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
378 #[cfg_attr(feature = "rustc-dep-of-std",
379 link(name = "c", kind = "static", modifiers = "-bundle",
380 cfg(target_feature = "crt-static")))]
381 #[cfg_attr(feature = "rustc-dep-of-std",
382 link(name = "c", cfg(not(target_feature = "crt-static"))))]
383 extern {}
384 } else if #[cfg(target_os = "emscripten")] {
385 #[link(name = "c")]
386 extern {}
387 } else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {
388 #[link(name = "c", kind = "static", modifiers = "-bundle",
389 cfg(target_feature = "crt-static"))]
390 #[link(name = "m", kind = "static", modifiers = "-bundle",
391 cfg(target_feature = "crt-static"))]
392 #[link(name = "m", cfg(not(target_feature = "crt-static")))]
393 #[link(name = "c", cfg(not(target_feature = "crt-static")))]
394 extern {}
395 } else if #[cfg(any(target_os = "macos",
396 target_os = "ios",
397 target_os = "tvos",
398 target_os = "watchos",
399 target_os = "visionos",
400 target_os = "android",
401 target_os = "openbsd",
402 target_os = "nto",
403 ))] {
404 #[link(name = "c")]
405 #[link(name = "m")]
406 extern {}
407 } else if #[cfg(target_os = "haiku")] {
408 #[link(name = "root")]
409 #[link(name = "network")]
410 extern {}
411 } else if #[cfg(target_env = "newlib")] {
412 #[link(name = "c")]
413 #[link(name = "m")]
414 extern {}
415 } else if #[cfg(target_env = "illumos")] {
416 #[link(name = "c")]
417 #[link(name = "m")]
418 extern {}
419 } else if #[cfg(target_os = "redox")] {
420 #[cfg_attr(feature = "rustc-dep-of-std",
421 link(name = "c", kind = "static", modifiers = "-bundle",
422 cfg(target_feature = "crt-static")))]
423 #[cfg_attr(feature = "rustc-dep-of-std",
424 link(name = "c", cfg(not(target_feature = "crt-static"))))]
425 extern {}
426 } else if #[cfg(target_os = "aix")] {
427 #[link(name = "c")]
428 #[link(name = "m")]
429 #[link(name = "bsd")]
430 #[link(name = "pthread")]
431 extern {}
432 } else {
433 #[link(name = "c")]
434 #[link(name = "m")]
435 #[link(name = "rt")]
436 #[link(name = "pthread")]
437 extern {}
438 }
439}
440
441missing! {
442 #[cfg_attr(feature = "extra_traits", derive(Debug))]
443 pub enum FILE {}
444 #[cfg_attr(feature = "extra_traits", derive(Debug))]
445 pub enum fpos_t {} }
447
448extern "C" {
449 pub fn isalnum(c: c_int) -> c_int;
450 pub fn isalpha(c: c_int) -> c_int;
451 pub fn iscntrl(c: c_int) -> c_int;
452 pub fn isdigit(c: c_int) -> c_int;
453 pub fn isgraph(c: c_int) -> c_int;
454 pub fn islower(c: c_int) -> c_int;
455 pub fn isprint(c: c_int) -> c_int;
456 pub fn ispunct(c: c_int) -> c_int;
457 pub fn isspace(c: c_int) -> c_int;
458 pub fn isupper(c: c_int) -> c_int;
459 pub fn isxdigit(c: c_int) -> c_int;
460 pub fn isblank(c: c_int) -> c_int;
461 pub fn tolower(c: c_int) -> c_int;
462 pub fn toupper(c: c_int) -> c_int;
463 pub fn qsort(
464 base: *mut c_void,
465 num: size_t,
466 size: size_t,
467 compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
468 );
469 pub fn bsearch(
470 key: *const c_void,
471 base: *const c_void,
472 num: size_t,
473 size: size_t,
474 compar: ::Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>,
475 ) -> *mut c_void;
476 #[cfg_attr(
477 all(target_os = "macos", target_arch = "x86"),
478 link_name = "fopen$UNIX2003"
479 )]
480 pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
481 #[cfg_attr(
482 all(target_os = "macos", target_arch = "x86"),
483 link_name = "freopen$UNIX2003"
484 )]
485 pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
486
487 pub fn fflush(file: *mut FILE) -> c_int;
488 pub fn fclose(file: *mut FILE) -> c_int;
489 pub fn remove(filename: *const c_char) -> c_int;
490 pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
491 pub fn tmpfile() -> *mut FILE;
492 pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
493 pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
494 pub fn getchar() -> c_int;
495 pub fn putchar(c: c_int) -> c_int;
496 pub fn fgetc(stream: *mut FILE) -> c_int;
497 pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
498 pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
499 #[cfg_attr(
500 all(target_os = "macos", target_arch = "x86"),
501 link_name = "fputs$UNIX2003"
502 )]
503 pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
504 pub fn puts(s: *const c_char) -> c_int;
505 pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
506 pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
507 #[cfg_attr(
508 all(target_os = "macos", target_arch = "x86"),
509 link_name = "fwrite$UNIX2003"
510 )]
511 pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
512 pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
513 pub fn ftell(stream: *mut FILE) -> c_long;
514 pub fn rewind(stream: *mut FILE);
515 #[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")]
516 pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
517 #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")]
518 pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
519 pub fn feof(stream: *mut FILE) -> c_int;
520 pub fn ferror(stream: *mut FILE) -> c_int;
521 pub fn clearerr(stream: *mut FILE);
522 pub fn perror(s: *const c_char);
523 pub fn atof(s: *const c_char) -> c_double;
524 pub fn atoi(s: *const c_char) -> c_int;
525 pub fn atol(s: *const c_char) -> c_long;
526 pub fn atoll(s: *const c_char) -> c_longlong;
527 #[cfg_attr(
528 all(target_os = "macos", target_arch = "x86"),
529 link_name = "strtod$UNIX2003"
530 )]
531 pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
532 pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
533 pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
534 pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
535 pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
536 pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
537 pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
538 pub fn malloc(size: size_t) -> *mut c_void;
539 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
540 pub fn free(p: *mut c_void);
541 pub fn abort() -> !;
542 pub fn exit(status: c_int) -> !;
543 pub fn _exit(status: c_int) -> !;
544 #[cfg_attr(
545 all(target_os = "macos", target_arch = "x86"),
546 link_name = "system$UNIX2003"
547 )]
548 pub fn system(s: *const c_char) -> c_int;
549 pub fn getenv(s: *const c_char) -> *mut c_char;
550
551 pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
552 pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
553 pub fn stpcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
554 pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
555 pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
556 pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
557 pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
558 pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
559 pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
560 pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
561 pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
562 pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
563 pub fn strdup(cs: *const c_char) -> *mut c_char;
564 pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char;
565 pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
566 pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
567 pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
568 pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
569 pub fn strlen(cs: *const c_char) -> size_t;
570 pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
571 #[cfg_attr(
572 all(target_os = "macos", target_arch = "x86"),
573 link_name = "strerror$UNIX2003"
574 )]
575 pub fn strerror(n: c_int) -> *mut c_char;
576 pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
577 pub fn strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char;
578 pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
579 pub fn strsignal(sig: c_int) -> *mut c_char;
580 pub fn wcslen(buf: *const wchar_t) -> size_t;
581 pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
582
583 pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
584 pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
585 pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
586 pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
587 pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
588 pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
589}
590
591extern "C" {
592 #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam50")]
593 pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
594 #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")]
595 pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
596
597 pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
598 pub fn printf(format: *const ::c_char, ...) -> ::c_int;
599 pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
600 pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
601 #[cfg_attr(
602 all(target_os = "linux", not(target_env = "uclibc")),
603 link_name = "__isoc99_fscanf"
604 )]
605 pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
606 #[cfg_attr(
607 all(target_os = "linux", not(target_env = "uclibc")),
608 link_name = "__isoc99_scanf"
609 )]
610 pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
611 #[cfg_attr(
612 all(target_os = "linux", not(target_env = "uclibc")),
613 link_name = "__isoc99_sscanf"
614 )]
615 pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
616 pub fn getchar_unlocked() -> ::c_int;
617 pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
618
619 #[cfg(not(all(
620 libc_cfg_target_vendor,
621 target_arch = "powerpc",
622 target_vendor = "nintendo"
623 )))]
624 #[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
625 #[cfg_attr(
626 any(target_os = "illumos", target_os = "solaris"),
627 link_name = "__xnet_socket"
628 )]
629 #[cfg_attr(target_os = "espidf", link_name = "lwip_socket")]
630 pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::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 = "connect$UNIX2003"
639 )]
640 #[cfg_attr(
641 any(target_os = "illumos", target_os = "solaris"),
642 link_name = "__xnet_connect"
643 )]
644 #[cfg_attr(target_os = "espidf", link_name = "lwip_connect")]
645 pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
646 #[cfg_attr(
647 all(target_os = "macos", target_arch = "x86"),
648 link_name = "listen$UNIX2003"
649 )]
650 #[cfg_attr(target_os = "espidf", link_name = "lwip_listen")]
651 pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
652 #[cfg(not(all(
653 libc_cfg_target_vendor,
654 target_arch = "powerpc",
655 target_vendor = "nintendo"
656 )))]
657 #[cfg_attr(
658 all(target_os = "macos", target_arch = "x86"),
659 link_name = "accept$UNIX2003"
660 )]
661 #[cfg_attr(target_os = "espidf", link_name = "lwip_accept")]
662 pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
663 #[cfg(not(all(
664 libc_cfg_target_vendor,
665 target_arch = "powerpc",
666 target_vendor = "nintendo"
667 )))]
668 #[cfg_attr(
669 all(target_os = "macos", target_arch = "x86"),
670 link_name = "getpeername$UNIX2003"
671 )]
672 #[cfg_attr(target_os = "espidf", link_name = "lwip_getpeername")]
673 pub fn getpeername(
674 socket: ::c_int,
675 address: *mut sockaddr,
676 address_len: *mut socklen_t,
677 ) -> ::c_int;
678 #[cfg(not(all(
679 libc_cfg_target_vendor,
680 target_arch = "powerpc",
681 target_vendor = "nintendo"
682 )))]
683 #[cfg_attr(
684 all(target_os = "macos", target_arch = "x86"),
685 link_name = "getsockname$UNIX2003"
686 )]
687 #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockname")]
688 pub fn getsockname(
689 socket: ::c_int,
690 address: *mut sockaddr,
691 address_len: *mut socklen_t,
692 ) -> ::c_int;
693 #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")]
694 pub fn setsockopt(
695 socket: ::c_int,
696 level: ::c_int,
697 name: ::c_int,
698 value: *const ::c_void,
699 option_len: socklen_t,
700 ) -> ::c_int;
701 #[cfg_attr(
702 all(target_os = "macos", target_arch = "x86"),
703 link_name = "socketpair$UNIX2003"
704 )]
705 #[cfg_attr(
706 any(target_os = "illumos", target_os = "solaris"),
707 link_name = "__xnet_socketpair"
708 )]
709 pub fn socketpair(
710 domain: ::c_int,
711 type_: ::c_int,
712 protocol: ::c_int,
713 socket_vector: *mut ::c_int,
714 ) -> ::c_int;
715 #[cfg(not(all(
716 libc_cfg_target_vendor,
717 target_arch = "powerpc",
718 target_vendor = "nintendo"
719 )))]
720 #[cfg_attr(
721 all(target_os = "macos", target_arch = "x86"),
722 link_name = "sendto$UNIX2003"
723 )]
724 #[cfg_attr(
725 any(target_os = "illumos", target_os = "solaris"),
726 link_name = "__xnet_sendto"
727 )]
728 #[cfg_attr(target_os = "espidf", link_name = "lwip_sendto")]
729 pub fn sendto(
730 socket: ::c_int,
731 buf: *const ::c_void,
732 len: ::size_t,
733 flags: ::c_int,
734 addr: *const sockaddr,
735 addrlen: socklen_t,
736 ) -> ::ssize_t;
737 #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")]
738 pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
739
740 #[cfg_attr(
741 all(target_os = "macos", target_arch = "x86"),
742 link_name = "chmod$UNIX2003"
743 )]
744 pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int;
745 #[cfg_attr(
746 all(target_os = "macos", target_arch = "x86"),
747 link_name = "fchmod$UNIX2003"
748 )]
749 pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int;
750
751 #[cfg_attr(
752 all(target_os = "macos", not(target_arch = "aarch64")),
753 link_name = "fstat$INODE64"
754 )]
755 #[cfg_attr(target_os = "netbsd", link_name = "__fstat50")]
756 #[cfg_attr(
757 all(target_os = "freebsd", any(freebsd11, freebsd10)),
758 link_name = "fstat@FBSD_1.0"
759 )]
760 pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
761
762 pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
763
764 #[cfg_attr(
765 all(target_os = "macos", not(target_arch = "aarch64")),
766 link_name = "stat$INODE64"
767 )]
768 #[cfg_attr(target_os = "netbsd", link_name = "__stat50")]
769 #[cfg_attr(
770 all(target_os = "freebsd", any(freebsd11, freebsd10)),
771 link_name = "stat@FBSD_1.0"
772 )]
773 pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
774
775 pub fn pclose(stream: *mut ::FILE) -> ::c_int;
776 #[cfg_attr(
777 all(target_os = "macos", target_arch = "x86"),
778 link_name = "fdopen$UNIX2003"
779 )]
780 pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
781 pub fn fileno(stream: *mut ::FILE) -> ::c_int;
782
783 #[cfg_attr(
784 all(target_os = "macos", target_arch = "x86"),
785 link_name = "open$UNIX2003"
786 )]
787 pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
788 #[cfg_attr(
789 all(target_os = "macos", target_arch = "x86"),
790 link_name = "creat$UNIX2003"
791 )]
792 pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
793 #[cfg_attr(
794 all(target_os = "macos", target_arch = "x86"),
795 link_name = "fcntl$UNIX2003"
796 )]
797 pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
798
799 #[cfg_attr(
800 all(target_os = "macos", target_arch = "x86_64"),
801 link_name = "opendir$INODE64"
802 )]
803 #[cfg_attr(
804 all(target_os = "macos", target_arch = "x86"),
805 link_name = "opendir$INODE64$UNIX2003"
806 )]
807 #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")]
808 pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
809
810 #[cfg_attr(
811 all(target_os = "macos", not(target_arch = "aarch64")),
812 link_name = "readdir$INODE64"
813 )]
814 #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")]
815 #[cfg_attr(
816 all(target_os = "freebsd", any(freebsd11, freebsd10)),
817 link_name = "readdir@FBSD_1.0"
818 )]
819 pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
820 #[cfg_attr(
821 all(target_os = "macos", target_arch = "x86"),
822 link_name = "closedir$UNIX2003"
823 )]
824 pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
825 #[cfg_attr(
826 all(target_os = "macos", target_arch = "x86_64"),
827 link_name = "rewinddir$INODE64"
828 )]
829 #[cfg_attr(
830 all(target_os = "macos", target_arch = "x86"),
831 link_name = "rewinddir$INODE64$UNIX2003"
832 )]
833 pub fn rewinddir(dirp: *mut ::DIR);
834
835 pub fn fchmodat(
836 dirfd: ::c_int,
837 pathname: *const ::c_char,
838 mode: ::mode_t,
839 flags: ::c_int,
840 ) -> ::c_int;
841 pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
842 pub fn fchownat(
843 dirfd: ::c_int,
844 pathname: *const ::c_char,
845 owner: ::uid_t,
846 group: ::gid_t,
847 flags: ::c_int,
848 ) -> ::c_int;
849 #[cfg_attr(
850 all(target_os = "macos", not(target_arch = "aarch64")),
851 link_name = "fstatat$INODE64"
852 )]
853 #[cfg_attr(
854 all(target_os = "freebsd", any(freebsd11, freebsd10)),
855 link_name = "fstatat@FBSD_1.1"
856 )]
857 pub fn fstatat(
858 dirfd: ::c_int,
859 pathname: *const ::c_char,
860 buf: *mut stat,
861 flags: ::c_int,
862 ) -> ::c_int;
863 pub fn linkat(
864 olddirfd: ::c_int,
865 oldpath: *const ::c_char,
866 newdirfd: ::c_int,
867 newpath: *const ::c_char,
868 flags: ::c_int,
869 ) -> ::c_int;
870 pub fn renameat(
871 olddirfd: ::c_int,
872 oldpath: *const ::c_char,
873 newdirfd: ::c_int,
874 newpath: *const ::c_char,
875 ) -> ::c_int;
876 pub fn symlinkat(
877 target: *const ::c_char,
878 newdirfd: ::c_int,
879 linkpath: *const ::c_char,
880 ) -> ::c_int;
881 pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
882
883 pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
884 pub fn alarm(seconds: ::c_uint) -> ::c_uint;
885 pub fn chdir(dir: *const c_char) -> ::c_int;
886 pub fn fchdir(dirfd: ::c_int) -> ::c_int;
887 pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
888 #[cfg_attr(
889 all(target_os = "macos", target_arch = "x86"),
890 link_name = "lchown$UNIX2003"
891 )]
892 pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
893 #[cfg_attr(
894 all(target_os = "macos", target_arch = "x86"),
895 link_name = "close$NOCANCEL$UNIX2003"
896 )]
897 #[cfg_attr(
898 all(target_os = "macos", target_arch = "x86_64"),
899 link_name = "close$NOCANCEL"
900 )]
901 pub fn close(fd: ::c_int) -> ::c_int;
902 pub fn dup(fd: ::c_int) -> ::c_int;
903 pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
904 pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
905 pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
906 pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
907 pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
908 pub fn execve(
909 prog: *const c_char,
910 argv: *const *const c_char,
911 envp: *const *const c_char,
912 ) -> ::c_int;
913 pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
914 pub fn fork() -> pid_t;
915 pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
916 pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
917 pub fn getegid() -> gid_t;
918 pub fn geteuid() -> uid_t;
919 pub fn getgid() -> gid_t;
920 pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
921 #[cfg_attr(target_os = "illumos", link_name = "getloginx")]
922 pub fn getlogin() -> *mut c_char;
923 #[cfg_attr(
924 all(target_os = "macos", target_arch = "x86"),
925 link_name = "getopt$UNIX2003"
926 )]
927 pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
928 pub fn getpgid(pid: pid_t) -> pid_t;
929 pub fn getpgrp() -> pid_t;
930 pub fn getpid() -> pid_t;
931 pub fn getppid() -> pid_t;
932 pub fn getuid() -> uid_t;
933 pub fn isatty(fd: ::c_int) -> ::c_int;
934 pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
935 pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
936 pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
937 pub fn pipe(fds: *mut ::c_int) -> ::c_int;
938 pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
939 #[cfg_attr(
940 all(target_os = "macos", target_arch = "x86"),
941 link_name = "read$UNIX2003"
942 )]
943 pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
944 pub fn rmdir(path: *const c_char) -> ::c_int;
945 pub fn seteuid(uid: uid_t) -> ::c_int;
946 pub fn setegid(gid: gid_t) -> ::c_int;
947 pub fn setgid(gid: gid_t) -> ::c_int;
948 pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
949 pub fn setsid() -> pid_t;
950 pub fn setuid(uid: uid_t) -> ::c_int;
951 pub fn setreuid(ruid: uid_t, euid: uid_t) -> ::c_int;
952 pub fn setregid(rgid: gid_t, egid: gid_t) -> ::c_int;
953 #[cfg_attr(
954 all(target_os = "macos", target_arch = "x86"),
955 link_name = "sleep$UNIX2003"
956 )]
957 pub fn sleep(secs: ::c_uint) -> ::c_uint;
958 #[cfg_attr(
959 all(target_os = "macos", target_arch = "x86"),
960 link_name = "nanosleep$UNIX2003"
961 )]
962 #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")]
963 pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int;
964 pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
965 pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
966 pub fn ttyname(fd: ::c_int) -> *mut c_char;
967 #[cfg_attr(
968 all(target_os = "macos", target_arch = "x86"),
969 link_name = "ttyname_r$UNIX2003"
970 )]
971 #[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")]
972 pub fn ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
973 pub fn unlink(c: *const c_char) -> ::c_int;
974 #[cfg_attr(
975 all(target_os = "macos", target_arch = "x86"),
976 link_name = "wait$UNIX2003"
977 )]
978 pub fn wait(status: *mut ::c_int) -> pid_t;
979 #[cfg_attr(
980 all(target_os = "macos", target_arch = "x86"),
981 link_name = "waitpid$UNIX2003"
982 )]
983 pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
984 #[cfg_attr(
985 all(target_os = "macos", target_arch = "x86"),
986 link_name = "write$UNIX2003"
987 )]
988 pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
989 #[cfg_attr(
990 all(target_os = "macos", target_arch = "x86"),
991 link_name = "pread$UNIX2003"
992 )]
993 pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
994 #[cfg_attr(
995 all(target_os = "macos", target_arch = "x86"),
996 link_name = "pwrite$UNIX2003"
997 )]
998 pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
999 pub fn umask(mask: mode_t) -> mode_t;
1000
1001 #[cfg_attr(target_os = "netbsd", link_name = "__utime50")]
1002 pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
1003
1004 #[cfg_attr(
1005 all(target_os = "macos", target_arch = "x86"),
1006 link_name = "kill$UNIX2003"
1007 )]
1008 pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
1009 #[cfg_attr(
1010 all(target_os = "macos", target_arch = "x86"),
1011 link_name = "killpg$UNIX2003"
1012 )]
1013 pub fn killpg(pgrp: pid_t, sig: ::c_int) -> ::c_int;
1014
1015 pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
1016 pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
1017 pub fn mlockall(flags: ::c_int) -> ::c_int;
1018 pub fn munlockall() -> ::c_int;
1019
1020 #[cfg_attr(
1021 all(target_os = "macos", target_arch = "x86"),
1022 link_name = "mmap$UNIX2003"
1023 )]
1024 pub fn mmap(
1025 addr: *mut ::c_void,
1026 len: ::size_t,
1027 prot: ::c_int,
1028 flags: ::c_int,
1029 fd: ::c_int,
1030 offset: off_t,
1031 ) -> *mut ::c_void;
1032 #[cfg_attr(
1033 all(target_os = "macos", target_arch = "x86"),
1034 link_name = "munmap$UNIX2003"
1035 )]
1036 pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
1037
1038 pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
1039 pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
1040
1041 #[cfg_attr(
1042 all(target_os = "macos", not(target_arch = "aarch64")),
1043 link_name = "lstat$INODE64"
1044 )]
1045 #[cfg_attr(target_os = "netbsd", link_name = "__lstat50")]
1046 #[cfg_attr(
1047 all(target_os = "freebsd", any(freebsd11, freebsd10)),
1048 link_name = "lstat@FBSD_1.0"
1049 )]
1050 pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
1051
1052 #[cfg_attr(
1053 all(target_os = "macos", target_arch = "x86"),
1054 link_name = "fsync$UNIX2003"
1055 )]
1056 pub fn fsync(fd: ::c_int) -> ::c_int;
1057
1058 #[cfg_attr(
1059 all(target_os = "macos", target_arch = "x86"),
1060 link_name = "setenv$UNIX2003"
1061 )]
1062 pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
1063 #[cfg_attr(
1064 all(target_os = "macos", target_arch = "x86"),
1065 link_name = "unsetenv$UNIX2003"
1066 )]
1067 #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")]
1068 pub fn unsetenv(name: *const c_char) -> ::c_int;
1069
1070 pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
1071
1072 pub fn truncate(path: *const c_char, length: off_t) -> ::c_int;
1073 pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
1074
1075 pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
1076
1077 #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")]
1078 pub fn getrusage(resource: ::c_int, usage: *mut rusage) -> ::c_int;
1079
1080 #[cfg_attr(
1081 any(
1082 target_os = "macos",
1083 target_os = "ios",
1084 target_os = "tvos",
1085 target_os = "watchos",
1086 target_os = "visionos"
1087 ),
1088 link_name = "realpath$DARWIN_EXTSN"
1089 )]
1090 pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
1091
1092 pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
1093
1094 #[cfg_attr(target_os = "netbsd", link_name = "__times13")]
1095 pub fn times(buf: *mut ::tms) -> ::clock_t;
1096
1097 pub fn pthread_self() -> ::pthread_t;
1098 pub fn pthread_equal(t1: ::pthread_t, t2: ::pthread_t) -> ::c_int;
1099 #[cfg_attr(
1100 all(target_os = "macos", target_arch = "x86"),
1101 link_name = "pthread_join$UNIX2003"
1102 )]
1103 pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
1104 pub fn pthread_exit(value: *mut ::c_void) -> !;
1105 pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
1106 pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
1107 pub fn pthread_attr_getstacksize(
1108 attr: *const ::pthread_attr_t,
1109 stacksize: *mut ::size_t,
1110 ) -> ::c_int;
1111 pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
1112 pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
1113 pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
1114 #[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")]
1115 pub fn sched_yield() -> ::c_int;
1116 pub fn pthread_key_create(
1117 key: *mut pthread_key_t,
1118 dtor: ::Option<unsafe extern "C" fn(*mut ::c_void)>,
1119 ) -> ::c_int;
1120 pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
1121 pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
1122 pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
1123 pub fn pthread_mutex_init(
1124 lock: *mut pthread_mutex_t,
1125 attr: *const pthread_mutexattr_t,
1126 ) -> ::c_int;
1127 pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int;
1128 pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int;
1129 pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int;
1130 pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
1131
1132 pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
1133 #[cfg_attr(
1134 all(target_os = "macos", target_arch = "x86"),
1135 link_name = "pthread_mutexattr_destroy$UNIX2003"
1136 )]
1137 pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
1138 pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
1139
1140 #[cfg_attr(
1141 all(target_os = "macos", target_arch = "x86"),
1142 link_name = "pthread_cond_init$UNIX2003"
1143 )]
1144 pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
1145 -> ::c_int;
1146 #[cfg_attr(
1147 all(target_os = "macos", target_arch = "x86"),
1148 link_name = "pthread_cond_wait$UNIX2003"
1149 )]
1150 pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
1151 #[cfg_attr(
1152 all(target_os = "macos", target_arch = "x86"),
1153 link_name = "pthread_cond_timedwait$UNIX2003"
1154 )]
1155 pub fn pthread_cond_timedwait(
1156 cond: *mut pthread_cond_t,
1157 lock: *mut pthread_mutex_t,
1158 abstime: *const ::timespec,
1159 ) -> ::c_int;
1160 pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int;
1161 pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int;
1162 pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
1163 pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int;
1164 pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int;
1165 #[cfg_attr(
1166 all(target_os = "macos", target_arch = "x86"),
1167 link_name = "pthread_rwlock_init$UNIX2003"
1168 )]
1169 pub fn pthread_rwlock_init(
1170 lock: *mut pthread_rwlock_t,
1171 attr: *const pthread_rwlockattr_t,
1172 ) -> ::c_int;
1173 #[cfg_attr(
1174 all(target_os = "macos", target_arch = "x86"),
1175 link_name = "pthread_rwlock_destroy$UNIX2003"
1176 )]
1177 pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int;
1178 #[cfg_attr(
1179 all(target_os = "macos", target_arch = "x86"),
1180 link_name = "pthread_rwlock_rdlock$UNIX2003"
1181 )]
1182 pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1183 #[cfg_attr(
1184 all(target_os = "macos", target_arch = "x86"),
1185 link_name = "pthread_rwlock_tryrdlock$UNIX2003"
1186 )]
1187 pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1188 #[cfg_attr(
1189 all(target_os = "macos", target_arch = "x86"),
1190 link_name = "pthread_rwlock_wrlock$UNIX2003"
1191 )]
1192 pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1193 #[cfg_attr(
1194 all(target_os = "macos", target_arch = "x86"),
1195 link_name = "pthread_rwlock_trywrlock$UNIX2003"
1196 )]
1197 pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1198 #[cfg_attr(
1199 all(target_os = "macos", target_arch = "x86"),
1200 link_name = "pthread_rwlock_unlock$UNIX2003"
1201 )]
1202 pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
1203 pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
1204 pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
1205
1206 #[cfg_attr(
1207 any(target_os = "illumos", target_os = "solaris"),
1208 link_name = "__xnet_getsockopt"
1209 )]
1210 #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")]
1211 pub fn getsockopt(
1212 sockfd: ::c_int,
1213 level: ::c_int,
1214 optname: ::c_int,
1215 optval: *mut ::c_void,
1216 optlen: *mut ::socklen_t,
1217 ) -> ::c_int;
1218 pub fn raise(signum: ::c_int) -> ::c_int;
1219
1220 #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
1221 pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
1222 pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
1223 pub fn dlerror() -> *mut ::c_char;
1224 pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
1225 pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
1226
1227 #[cfg(not(all(
1228 libc_cfg_target_vendor,
1229 target_arch = "powerpc",
1230 target_vendor = "nintendo"
1231 )))]
1232 #[cfg_attr(
1233 any(target_os = "illumos", target_os = "solaris"),
1234 link_name = "__xnet_getaddrinfo"
1235 )]
1236 #[cfg_attr(target_os = "espidf", link_name = "lwip_getaddrinfo")]
1237 pub fn getaddrinfo(
1238 node: *const c_char,
1239 service: *const c_char,
1240 hints: *const addrinfo,
1241 res: *mut *mut addrinfo,
1242 ) -> ::c_int;
1243 #[cfg(not(all(
1244 libc_cfg_target_vendor,
1245 target_arch = "powerpc",
1246 target_vendor = "nintendo"
1247 )))]
1248 #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")]
1249 pub fn freeaddrinfo(res: *mut addrinfo);
1250 pub fn hstrerror(errcode: ::c_int) -> *const ::c_char;
1251 pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
1252 #[cfg_attr(
1253 any(
1254 all(
1255 target_os = "linux",
1256 not(any(target_env = "musl", target_env = "ohos"))
1257 ),
1258 target_os = "freebsd",
1259 target_os = "dragonfly",
1260 target_os = "haiku"
1261 ),
1262 link_name = "__res_init"
1263 )]
1264 #[cfg_attr(
1265 any(
1266 target_os = "macos",
1267 target_os = "ios",
1268 target_os = "tvos",
1269 target_os = "watchos",
1270 target_os = "visionos"
1271 ),
1272 link_name = "res_9_init"
1273 )]
1274 pub fn res_init() -> ::c_int;
1275
1276 #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")]
1277 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1278 pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
1280 #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")]
1281 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1282 pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
1284 #[cfg_attr(
1285 all(target_os = "macos", target_arch = "x86"),
1286 link_name = "mktime$UNIX2003"
1287 )]
1288 #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")]
1289 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1290 pub fn mktime(tm: *mut tm) -> time_t;
1292 #[cfg_attr(target_os = "netbsd", link_name = "__time50")]
1293 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1294 pub fn time(time: *mut time_t) -> time_t;
1296 #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")]
1297 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1298 pub fn gmtime(time_p: *const time_t) -> *mut tm;
1300 #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")]
1301 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1302 pub fn localtime(time_p: *const time_t) -> *mut tm;
1304 #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")]
1305 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1306 pub fn difftime(time1: time_t, time0: time_t) -> ::c_double;
1308 #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")]
1309 #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))]
1310 pub fn timegm(tm: *mut ::tm) -> time_t;
1312
1313 #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")]
1314 #[cfg_attr(
1315 all(target_os = "freebsd", any(freebsd11, freebsd10)),
1316 link_name = "mknod@FBSD_1.0"
1317 )]
1318 pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
1319 pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
1320 pub fn endservent();
1321 pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
1322 pub fn getservbyport(port: ::c_int, proto: *const ::c_char) -> *mut servent;
1323 pub fn getservent() -> *mut servent;
1324 pub fn setservent(stayopen: ::c_int);
1325 pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
1326 pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
1327 pub fn chroot(name: *const ::c_char) -> ::c_int;
1328 #[cfg_attr(
1329 all(target_os = "macos", target_arch = "x86"),
1330 link_name = "usleep$UNIX2003"
1331 )]
1332 pub fn usleep(secs: ::c_uint) -> ::c_int;
1333 #[cfg_attr(
1334 all(target_os = "macos", target_arch = "x86"),
1335 link_name = "send$UNIX2003"
1336 )]
1337 #[cfg_attr(target_os = "espidf", link_name = "lwip_send")]
1338 pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
1339 #[cfg_attr(
1340 all(target_os = "macos", target_arch = "x86"),
1341 link_name = "recv$UNIX2003"
1342 )]
1343 #[cfg_attr(target_os = "espidf", link_name = "lwip_recv")]
1344 pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
1345 #[cfg_attr(
1346 all(target_os = "macos", target_arch = "x86"),
1347 link_name = "putenv$UNIX2003"
1348 )]
1349 #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")]
1350 pub fn putenv(string: *mut c_char) -> ::c_int;
1351 #[cfg_attr(
1352 all(target_os = "macos", target_arch = "x86"),
1353 link_name = "poll$UNIX2003"
1354 )]
1355 pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
1356 #[cfg_attr(
1357 all(target_os = "macos", target_arch = "x86_64"),
1358 link_name = "select$1050"
1359 )]
1360 #[cfg_attr(
1361 all(target_os = "macos", target_arch = "x86"),
1362 link_name = "select$UNIX2003"
1363 )]
1364 #[cfg_attr(target_os = "netbsd", link_name = "__select50")]
1365 pub fn select(
1366 nfds: ::c_int,
1367 readfds: *mut fd_set,
1368 writefds: *mut fd_set,
1369 errorfds: *mut fd_set,
1370 timeout: *mut timeval,
1371 ) -> ::c_int;
1372 #[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")]
1373 pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
1374 pub fn localeconv() -> *mut lconv;
1375
1376 #[cfg_attr(
1377 all(target_os = "macos", target_arch = "x86"),
1378 link_name = "sem_wait$UNIX2003"
1379 )]
1380 pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
1381 pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
1382 pub fn sem_post(sem: *mut sem_t) -> ::c_int;
1383 pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
1384 pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
1385
1386 #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
1387 pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
1388 #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
1389 pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
1390 #[cfg_attr(target_os = "netbsd", link_name = "__sigfillset14")]
1391 pub fn sigfillset(set: *mut sigset_t) -> ::c_int;
1392 #[cfg_attr(target_os = "netbsd", link_name = "__sigdelset14")]
1393 pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
1394 #[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")]
1395 pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
1396
1397 #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")]
1398 pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
1399 #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")]
1400 pub fn sigpending(set: *mut sigset_t) -> ::c_int;
1401
1402 pub fn sysconf(name: ::c_int) -> ::c_long;
1403
1404 pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
1405
1406 pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
1407 pub fn ftello(stream: *mut ::FILE) -> ::off_t;
1408 #[cfg_attr(
1409 all(target_os = "macos", target_arch = "x86"),
1410 link_name = "tcdrain$UNIX2003"
1411 )]
1412 pub fn tcdrain(fd: ::c_int) -> ::c_int;
1413 pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
1414 pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
1415 pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
1416 pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
1417 pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
1418 pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
1419 pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
1420 pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
1421 pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
1422 pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
1423 pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
1424 pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
1425
1426 pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
1427
1428 pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
1429 pub fn closelog();
1430 pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
1431 #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")]
1432 pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
1433 #[cfg_attr(
1434 all(target_os = "macos", target_arch = "x86"),
1435 link_name = "nice$UNIX2003"
1436 )]
1437 pub fn nice(incr: ::c_int) -> ::c_int;
1438
1439 pub fn grantpt(fd: ::c_int) -> ::c_int;
1440 pub fn posix_openpt(flags: ::c_int) -> ::c_int;
1441 pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
1442 pub fn unlockpt(fd: ::c_int) -> ::c_int;
1443
1444 pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
1445 pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
1446
1447 pub fn lockf(fd: ::c_int, cmd: ::c_int, len: ::off_t) -> ::c_int;
1448
1449}
1450
1451cfg_if! {
1452 if #[cfg(not(any(target_os = "emscripten",
1453 target_os = "android",
1454 target_os = "haiku",
1455 target_os = "nto")))] {
1456 extern "C" {
1457 pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
1458 }
1459 }
1460}
1461
1462cfg_if! {
1463 if #[cfg(not(any(target_os = "emscripten",
1464 target_os = "android",
1465 target_os = "nto")))] {
1466 extern "C" {
1467 pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
1468 }
1469 }
1470}
1471
1472cfg_if! {
1473 if #[cfg(not(target_os = "aix"))] {
1474 extern "C" {
1475 pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
1476 }
1477 }
1478}
1479
1480cfg_if! {
1481 if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {
1482 extern "C" {
1483 pub fn open_wmemstream(
1484 ptr: *mut *mut wchar_t,
1485 sizeloc: *mut size_t,
1486 ) -> *mut FILE;
1487 }
1488 }
1489}
1490
1491cfg_if! {
1492 if #[cfg(not(target_os = "redox"))] {
1493 extern {
1494 pub fn getsid(pid: pid_t) -> pid_t;
1495 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1496 link_name = "pause$UNIX2003")]
1497 pub fn pause() -> ::c_int;
1498
1499 pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char,
1500 mode: ::mode_t) -> ::c_int;
1501 pub fn openat(dirfd: ::c_int, pathname: *const ::c_char,
1502 flags: ::c_int, ...) -> ::c_int;
1503
1504 #[cfg_attr(all(target_os = "macos", target_arch = "x86_64"),
1505 link_name = "fdopendir$INODE64")]
1506 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1507 link_name = "fdopendir$INODE64$UNIX2003")]
1508 pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
1509
1510 #[cfg_attr(all(target_os = "macos", not(target_arch = "aarch64")),
1511 link_name = "readdir_r$INODE64")]
1512 #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")]
1513 #[cfg_attr(
1514 all(target_os = "freebsd", any(freebsd11, freebsd10)),
1515 link_name = "readdir_r@FBSD_1.0"
1516 )]
1517 #[allow(non_autolinks)] pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent,
1525 result: *mut *mut ::dirent) -> ::c_int;
1526 }
1527 }
1528}
1529
1530cfg_if! {
1531 if #[cfg(target_os = "nto")] {
1532 extern {
1533 pub fn readlinkat(dirfd: ::c_int,
1534 pathname: *const ::c_char,
1535 buf: *mut ::c_char,
1536 bufsiz: ::size_t) -> ::c_int;
1537 pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::c_int;
1538 pub fn pselect(
1539 nfds: ::c_int,
1540 readfds: *mut fd_set,
1541 writefds: *mut fd_set,
1542 errorfds: *mut fd_set,
1543 timeout: *mut timespec,
1544 sigmask: *const sigset_t,
1545 ) -> ::c_int;
1546 pub fn sigaction(
1547 signum: ::c_int,
1548 act: *const sigaction,
1549 oldact: *mut sigaction
1550 ) -> ::c_int;
1551 }
1552 } else {
1553 extern {
1554 pub fn readlinkat(dirfd: ::c_int,
1555 pathname: *const ::c_char,
1556 buf: *mut ::c_char,
1557 bufsiz: ::size_t) -> ::ssize_t;
1558 pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE;
1559 pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE;
1560 pub fn atexit(cb: extern "C" fn()) -> c_int;
1561 #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
1562 pub fn sigaction(
1563 signum: ::c_int,
1564 act: *const sigaction,
1565 oldact: *mut sigaction
1566 ) -> ::c_int;
1567 pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
1568 #[cfg_attr(
1569 all(target_os = "macos", target_arch = "x86_64"),
1570 link_name = "pselect$1050"
1571 )]
1572 #[cfg_attr(
1573 all(target_os = "macos", target_arch = "x86"),
1574 link_name = "pselect$UNIX2003"
1575 )]
1576 #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")]
1577 pub fn pselect(
1578 nfds: ::c_int,
1579 readfds: *mut fd_set,
1580 writefds: *mut fd_set,
1581 errorfds: *mut fd_set,
1582 timeout: *const timespec,
1583 sigmask: *const sigset_t,
1584 ) -> ::c_int;
1585 }
1586 }
1587}
1588
1589cfg_if! {
1590 if #[cfg(not(any(target_os = "solaris",
1591 target_os = "illumos",
1592 target_os = "nto",
1593 )))] {
1594 extern {
1595 pub fn cfmakeraw(termios: *mut ::termios);
1596 pub fn cfsetspeed(termios: *mut ::termios,
1597 speed: ::speed_t) -> ::c_int;
1598 }
1599 }
1600}
1601
1602extern "C" {
1603 pub fn fnmatch(pattern: *const c_char, name: *const c_char, flags: c_int) -> c_int;
1604}
1605
1606cfg_if! {
1607 if #[cfg(target_env = "newlib")] {
1608 mod newlib;
1609 pub use self::newlib::*;
1610 } else if #[cfg(any(target_os = "linux",
1611 target_os = "l4re",
1612 target_os = "android",
1613 target_os = "emscripten"))] {
1614 mod linux_like;
1615 pub use self::linux_like::*;
1616 } else if #[cfg(any(target_os = "macos",
1617 target_os = "ios",
1618 target_os = "tvos",
1619 target_os = "watchos",
1620 target_os = "visionos",
1621 target_os = "freebsd",
1622 target_os = "dragonfly",
1623 target_os = "openbsd",
1624 target_os = "netbsd"))] {
1625 mod bsd;
1626 pub use self::bsd::*;
1627 } else if #[cfg(any(target_os = "solaris",
1628 target_os = "illumos"))] {
1629 mod solarish;
1630 pub use self::solarish::*;
1631 } else if #[cfg(target_os = "haiku")] {
1632 mod haiku;
1633 pub use self::haiku::*;
1634 } else if #[cfg(target_os = "redox")] {
1635 mod redox;
1636 pub use self::redox::*;
1637 } else if #[cfg(target_os = "nto")] {
1638 mod nto;
1639 pub use self::nto::*;
1640 } else if #[cfg(target_os = "aix")] {
1641 mod aix;
1642 pub use self::aix::*;
1643 } else if #[cfg(target_os = "hurd")] {
1644 mod hurd;
1645 pub use self::hurd::*;
1646 } else if #[cfg(target_os = "nuttx")] {
1647 mod nuttx;
1648 pub use self::nuttx::*;
1649 } else {
1650 }
1652}
1653
1654cfg_if! {
1655 if #[cfg(libc_core_cvoid)] {
1656 pub use ::ffi::c_void;
1657 } else {
1658 #[repr(u8)]
1662 #[allow(missing_copy_implementations)]
1663 #[allow(missing_debug_implementations)]
1664 pub enum c_void {
1665 #[doc(hidden)]
1667 __variant1,
1668 #[doc(hidden)]
1669 __variant2,
1670 }
1671 }
1672}
1673
1674cfg_if! {
1675 if #[cfg(libc_align)] {
1676 mod align;
1677 pub use self::align::*;
1678 } else {
1679 mod no_align;
1680 pub use self::no_align::*;
1681 }
1682}