1 pub type int8_t = i8; 2 pub type int16_t = i16; 3 pub type int32_t = i32; 4 pub type int64_t = i64; 5 pub type uint8_t = u8; 6 pub type uint16_t = u16; 7 pub type uint32_t = u32; 8 pub type uint64_t = u64; 9 10 pub type c_schar = i8; 11 pub type c_uchar = u8; 12 pub type c_short = i16; 13 pub type c_ushort = u16; 14 pub type c_int = i32; 15 pub type c_uint = u32; 16 pub type c_float = f32; 17 pub type c_double = f64; 18 pub type c_longlong = i64; 19 pub type c_ulonglong = u64; 20 pub type intmax_t = i64; 21 pub type uintmax_t = u64; 22 23 pub type size_t = usize; 24 pub type ptrdiff_t = isize; 25 pub type intptr_t = isize; 26 pub type uintptr_t = usize; 27 pub type ssize_t = isize; 28 29 pub type c_char = i8; 30 pub type c_long = i64; 31 pub type c_ulong = u64; 32 33 pub type wchar_t = i32; 34 pub type wint_t = u32; 35 pub type wctype_t = i64; 36 37 pub type regoff_t = size_t; 38 pub type off_t = c_long; 39 pub type mode_t = c_int; 40 pub type time_t = c_long; 41 pub type pid_t = c_int; 42 pub type id_t = c_uint; 43 pub type gid_t = c_int; 44 pub type uid_t = c_int; 45 pub type dev_t = c_long; 46 pub type ino_t = c_ulong; 47 pub type nlink_t = c_ulong; 48 pub type blksize_t = c_long; 49 pub type blkcnt_t = c_ulong; 50 51 pub type fsblkcnt_t = c_ulong; 52 pub type fsfilcnt_t = c_ulong; 53 54 pub type useconds_t = c_uint; 55 pub type suseconds_t = c_int; 56 57 pub type clock_t = c_long; 58 pub type clockid_t = c_int; 59 pub type timer_t = *mut c_void; 60 61 pub type nfds_t = c_ulong; 62 63 s! { 64 pub struct fd_set { 65 fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE], 66 } 67 68 pub struct pollfd { 69 pub fd: ::c_int, 70 pub events: ::c_short, 71 pub revents: ::c_short, 72 } 73 74 pub struct stat { 75 pub st_dev: ::dev_t, 76 pub st_ino: ::ino_t, 77 pub st_nlink: ::nlink_t, 78 pub st_mode: ::mode_t, 79 pub st_uid: ::uid_t, 80 pub st_gid: ::gid_t, 81 pub st_rdev: ::dev_t, 82 pub st_size: ::off_t, 83 pub st_blksize: ::blksize_t, 84 pub st_blocks: ::blkcnt_t, 85 86 pub st_atime: ::timespec, 87 pub st_mtime: ::timespec, 88 pub st_ctime: ::timespec, 89 90 _pad: [c_char; 24], 91 } 92 93 pub struct timeval { 94 pub tv_sec: time_t, 95 pub tv_usec: suseconds_t, 96 } 97 98 pub struct timespec { 99 pub tv_sec: time_t, 100 pub tv_nsec: c_long, 101 } 102 } 103 104 pub const INT_MIN: c_int = -2147483648; 105 pub const INT_MAX: c_int = 2147483647; 106 107 pub const STDIN_FILENO: ::c_int = 0; 108 pub const STDOUT_FILENO: ::c_int = 1; 109 pub const STDERR_FILENO: ::c_int = 2; 110 111 pub const EXIT_FAILURE: ::c_int = 1; 112 pub const EXIT_SUCCESS: ::c_int = 0; 113 114 pub const FD_SETSIZE: usize = 1024; 115 116 pub const MAP_SHARED: ::c_int = 1; 117 pub const MAP_PRIVATE: ::c_int = 2; 118 pub const MAP_ANONYMOUS: ::c_int = 4; 119 pub const MAP_ANON: ::c_int = MAP_ANONYMOUS; 120 121 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; 122 123 pub const POLLIN: ::c_short = 0x001; 124 pub const POLLPRI: ::c_short = 0x002; 125 pub const POLLOUT: ::c_short = 0x004; 126 pub const POLLERR: ::c_short = 0x008; 127 pub const POLLHUP: ::c_short = 0x010; 128 pub const POLLNVAL: ::c_short = 0x020; 129 130 pub const PROT_NONE: ::c_int = 0; 131 pub const PROT_EXEC: ::c_int = 1; 132 pub const PROT_WRITE: ::c_int = 2; 133 pub const PROT_READ: ::c_int = 4; 134 135 pub const S_ISUID: ::c_int = 0x800; 136 pub const S_ISGID: ::c_int = 0x400; 137 pub const S_ISVTX: ::c_int = 0x200; 138 139 pub const S_IFIFO: mode_t = 0x1000; 140 pub const S_IFCHR: mode_t = 0x2000; 141 pub const S_IFBLK: mode_t = 0x6000; 142 pub const S_IFDIR: mode_t = 0x4000; 143 pub const S_IFREG: mode_t = 0x8000; 144 pub const S_IFLNK: mode_t = 0xA000; 145 pub const S_IFSOCK: mode_t = 0xC000; 146 pub const S_IFMT: mode_t = 0xF000; 147 pub const S_IEXEC: mode_t = 0x40; 148 pub const S_IWRITE: mode_t = 0x80; 149 pub const S_IREAD: mode_t = 0x100; 150 pub const S_IRWXU: mode_t = 0x1C0; 151 pub const S_IXUSR: mode_t = 0x40; 152 pub const S_IWUSR: mode_t = 0x80; 153 pub const S_IRUSR: mode_t = 0x100; 154 pub const S_IRWXG: mode_t = 0x38; 155 pub const S_IXGRP: mode_t = 0x8; 156 pub const S_IWGRP: mode_t = 0x10; 157 pub const S_IRGRP: mode_t = 0x20; 158 pub const S_IRWXO: mode_t = 0x7; 159 pub const S_IXOTH: mode_t = 0x1; 160 pub const S_IWOTH: mode_t = 0x2; 161 pub const S_IROTH: mode_t = 0x4; 162 163 pub const F_DUPFD: ::c_int = 0; 164 pub const F_GETFD: ::c_int = 1; 165 pub const F_SETFD: ::c_int = 2; 166 pub const F_GETFL: ::c_int = 3; 167 pub const F_SETFL: ::c_int = 4; 168 169 pub const FD_CLOEXEC: ::c_int = 0x0100_0000; 170 171 pub const O_RDONLY: ::c_int = 0x0001_0000; 172 pub const O_WRONLY: ::c_int = 0x0002_0000; 173 pub const O_RDWR: ::c_int = 0x0003_0000; 174 pub const O_NONBLOCK: ::c_int = 0x0004_0000; 175 pub const O_APPEND: ::c_int = 0x0008_0000; 176 pub const O_SHLOCK: ::c_int = 0x0010_0000; 177 pub const O_EXLOCK: ::c_int = 0x0020_0000; 178 pub const O_ASYNC: ::c_int = 0x0040_0000; 179 pub const O_FSYNC: ::c_int = 0x0080_0000; 180 pub const O_CLOEXEC: ::c_int = 0x0100_0000; 181 pub const O_CREAT: ::c_int = 0x0200_0000; 182 pub const O_TRUNC: ::c_int = 0x0400_0000; 183 pub const O_EXCL: ::c_int = 0x0800_0000; 184 pub const O_DIRECTORY: ::c_int = 0x1000_0000; 185 pub const O_STAT: ::c_int = 0x2000_0000; 186 pub const O_SYMLINK: ::c_int = 0x4000_0000; 187 pub const O_NOFOLLOW: ::c_int = 0x8000_0000; 188 pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR; 189 190 pub const SIGHUP: ::c_int = 1; 191 pub const SIGINT: ::c_int = 2; 192 pub const SIGQUIT: ::c_int = 3; 193 pub const SIGILL: ::c_int = 4; 194 pub const SIGTRAP: ::c_int = 5; 195 pub const SIGABRT: ::c_int = 6; 196 pub const SIGBUS: ::c_int = 7; 197 pub const SIGFPE: ::c_int = 8; 198 pub const SIGKILL: ::c_int = 9; 199 pub const SIGUSR1: ::c_int = 10; 200 pub const SIGSEGV: ::c_int = 11; 201 pub const SIGUSR2: ::c_int = 12; 202 pub const SIGPIPE: ::c_int = 13; 203 pub const SIGALRM: ::c_int = 14; 204 pub const SIGTERM: ::c_int = 15; 205 pub const SIGSTKFLT: ::c_int = 16; 206 pub const SIGCHLD: ::c_int = 17; 207 pub const SIGCONT: ::c_int = 18; 208 pub const SIGSTOP: ::c_int = 19; 209 pub const SIGTSTP: ::c_int = 20; 210 pub const SIGTTIN: ::c_int = 21; 211 pub const SIGTTOU: ::c_int = 22; 212 pub const SIGURG: ::c_int = 23; 213 pub const SIGXCPU: ::c_int = 24; 214 pub const SIGXFSZ: ::c_int = 25; 215 pub const SIGVTALRM: ::c_int = 26; 216 pub const SIGPROF: ::c_int = 27; 217 pub const SIGWINCH: ::c_int = 28; 218 pub const SIGIO: ::c_int = 29; 219 pub const SIGPWR: ::c_int = 30; 220 pub const SIGSYS: ::c_int = 31; 221 222 #[cfg_attr(feature = "extra_traits", derive(Debug))] 223 pub enum FILE {} 224 impl ::Copy for FILE {} 225 impl ::Clone for FILE { clone(&self) -> FILE226 fn clone(&self) -> FILE { *self } 227 } 228 #[cfg_attr(feature = "extra_traits", derive(Debug))] 229 pub enum fpos_t {} // TODO: fill this out with a struct 230 impl ::Copy for fpos_t {} 231 impl ::Clone for fpos_t { clone(&self) -> fpos_t232 fn clone(&self) -> fpos_t { *self } 233 } 234 235 // intentionally not public, only used for fd_set 236 cfg_if! { 237 if #[cfg(target_pointer_width = "32")] { 238 const ULONG_SIZE: usize = 32; 239 } else if #[cfg(target_pointer_width = "64")] { 240 const ULONG_SIZE: usize = 64; 241 } else { 242 // Unknown target_pointer_width 243 } 244 } 245 246 extern { isalnum(c: c_int) -> c_int247 pub fn isalnum(c: c_int) -> c_int; isalpha(c: c_int) -> c_int248 pub fn isalpha(c: c_int) -> c_int; iscntrl(c: c_int) -> c_int249 pub fn iscntrl(c: c_int) -> c_int; isdigit(c: c_int) -> c_int250 pub fn isdigit(c: c_int) -> c_int; isgraph(c: c_int) -> c_int251 pub fn isgraph(c: c_int) -> c_int; islower(c: c_int) -> c_int252 pub fn islower(c: c_int) -> c_int; isprint(c: c_int) -> c_int253 pub fn isprint(c: c_int) -> c_int; ispunct(c: c_int) -> c_int254 pub fn ispunct(c: c_int) -> c_int; isspace(c: c_int) -> c_int255 pub fn isspace(c: c_int) -> c_int; isupper(c: c_int) -> c_int256 pub fn isupper(c: c_int) -> c_int; isxdigit(c: c_int) -> c_int257 pub fn isxdigit(c: c_int) -> c_int; tolower(c: c_int) -> c_int258 pub fn tolower(c: c_int) -> c_int; toupper(c: c_int) -> c_int259 pub fn toupper(c: c_int) -> c_int; fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE260 pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE261 pub fn freopen(filename: *const c_char, mode: *const c_char, 262 file: *mut FILE) -> *mut FILE; fflush(file: *mut FILE) -> c_int263 pub fn fflush(file: *mut FILE) -> c_int; fclose(file: *mut FILE) -> c_int264 pub fn fclose(file: *mut FILE) -> c_int; remove(filename: *const c_char) -> c_int265 pub fn remove(filename: *const c_char) -> c_int; rename(oldname: *const c_char, newname: *const c_char) -> c_int266 pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; tmpfile() -> *mut FILE267 pub fn tmpfile() -> *mut FILE; setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int268 pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, 269 size: size_t) -> c_int; setbuf(stream: *mut FILE, buf: *mut c_char)270 pub fn setbuf(stream: *mut FILE, buf: *mut c_char); getchar() -> c_int271 pub fn getchar() -> c_int; putchar(c: c_int) -> c_int272 pub fn putchar(c: c_int) -> c_int; fgetc(stream: *mut FILE) -> c_int273 pub fn fgetc(stream: *mut FILE) -> c_int; fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char274 pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; fputc(c: c_int, stream: *mut FILE) -> c_int275 pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; fputs(s: *const c_char, stream: *mut FILE) -> c_int276 pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; puts(s: *const c_char) -> c_int277 pub fn puts(s: *const c_char) -> c_int; ungetc(c: c_int, stream: *mut FILE) -> c_int278 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_t279 pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, 280 stream: *mut FILE) -> size_t; fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t281 pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, 282 stream: *mut FILE) -> size_t; fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int283 pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; ftell(stream: *mut FILE) -> c_long284 pub fn ftell(stream: *mut FILE) -> c_long; rewind(stream: *mut FILE)285 pub fn rewind(stream: *mut FILE); fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int286 pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int287 pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; feof(stream: *mut FILE) -> c_int288 pub fn feof(stream: *mut FILE) -> c_int; ferror(stream: *mut FILE) -> c_int289 pub fn ferror(stream: *mut FILE) -> c_int; perror(s: *const c_char)290 pub fn perror(s: *const c_char); atoi(s: *const c_char) -> c_int291 pub fn atoi(s: *const c_char) -> c_int; strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double292 pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double; strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long293 pub fn strtol(s: *const c_char, endp: *mut *mut c_char, 294 base: c_int) -> c_long; strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong295 pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, 296 base: c_int) -> c_ulong; calloc(nobj: size_t, size: size_t) -> *mut c_void297 pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; malloc(size: size_t) -> *mut c_void298 pub fn malloc(size: size_t) -> *mut c_void; realloc(p: *mut c_void, size: size_t) -> *mut c_void299 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; free(p: *mut c_void)300 pub fn free(p: *mut c_void); abort() -> !301 pub fn abort() -> !; exit(status: c_int) -> !302 pub fn exit(status: c_int) -> !; _exit(status: c_int) -> !303 pub fn _exit(status: c_int) -> !; atexit(cb: extern fn()) -> c_int304 pub fn atexit(cb: extern fn()) -> c_int; system(s: *const c_char) -> c_int305 pub fn system(s: *const c_char) -> c_int; getenv(s: *const c_char) -> *mut c_char306 pub fn getenv(s: *const c_char) -> *mut c_char; 307 strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char308 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_char309 pub fn strncpy(dst: *mut c_char, src: *const c_char, 310 n: size_t) -> *mut c_char; strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char311 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_char312 pub fn strncat(s: *mut c_char, ct: *const c_char, 313 n: size_t) -> *mut c_char; strcmp(cs: *const c_char, ct: *const c_char) -> c_int314 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_int315 pub fn strncmp(cs: *const c_char, ct: *const c_char, 316 n: size_t) -> c_int; strcoll(cs: *const c_char, ct: *const c_char) -> c_int317 pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; strchr(cs: *const c_char, c: c_int) -> *mut c_char318 pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; strrchr(cs: *const c_char, c: c_int) -> *mut c_char319 pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; strspn(cs: *const c_char, ct: *const c_char) -> size_t320 pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; strcspn(cs: *const c_char, ct: *const c_char) -> size_t321 pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; strdup(cs: *const c_char) -> *mut c_char322 pub fn strdup(cs: *const c_char) -> *mut c_char; strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char323 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_char324 pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char325 pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int326 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_int327 pub fn strncasecmp(s1: *const c_char, s2: *const c_char, 328 n: size_t) -> c_int; strlen(cs: *const c_char) -> size_t329 pub fn strlen(cs: *const c_char) -> size_t; strnlen(cs: *const c_char, maxlen: size_t) -> size_t330 pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; strerror(n: c_int) -> *mut c_char331 pub fn strerror(n: c_int) -> *mut c_char; strtok(s: *mut c_char, t: *const c_char) -> *mut c_char332 pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t333 pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; wcslen(buf: *const wchar_t) -> size_t334 pub fn wcslen(buf: *const wchar_t) -> size_t; wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t335 pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, 336 n: size_t) -> ::size_t; 337 memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void338 pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int339 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_void340 pub fn memcpy(dest: *mut c_void, src: *const c_void, 341 n: size_t) -> *mut c_void; memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void342 pub fn memmove(dest: *mut c_void, src: *const c_void, 343 n: size_t) -> *mut c_void; memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void344 pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; 345 abs(i: c_int) -> c_int346 pub fn abs(i: c_int) -> c_int; atof(s: *const c_char) -> c_double347 pub fn atof(s: *const c_char) -> c_double; labs(i: c_long) -> c_long348 pub fn labs(i: c_long) -> c_long; rand() -> c_int349 pub fn rand() -> c_int; srand(seed: c_uint)350 pub fn srand(seed: c_uint); 351 chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int352 pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int; close(fd: ::c_int) -> ::c_int353 pub fn close(fd: ::c_int) -> ::c_int; fchown(fd: ::c_int, uid: ::uid_t, gid: ::gid_t) -> ::c_int354 pub fn fchown(fd: ::c_int, uid: ::uid_t, gid: ::gid_t) -> ::c_int; fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int355 pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int; fstat(fd: ::c_int, buf: *mut stat) -> ::c_int356 pub fn fstat(fd: ::c_int, buf: *mut stat) -> ::c_int; fsync(fd: ::c_int) -> ::c_int357 pub fn fsync(fd: ::c_int) -> ::c_int; gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int358 pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int; getpid() -> pid_t359 pub fn getpid() -> pid_t; memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void360 pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void; mmap(addr: *mut ::c_void, len: ::size_t, prot: ::c_int, flags: ::c_int, fd: ::c_int, offset: off_t) -> *mut ::c_void361 pub fn mmap(addr: *mut ::c_void, 362 len: ::size_t, 363 prot: ::c_int, 364 flags: ::c_int, 365 fd: ::c_int, 366 offset: off_t) 367 -> *mut ::c_void; mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int368 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) 369 -> ::c_int; munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int370 pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int; poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int371 pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int; read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t372 pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t; setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int373 pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) 374 -> ::c_int; unsetenv(name: *const c_char) -> ::c_int375 pub fn unsetenv(name: *const c_char) -> ::c_int; write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t376 pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) 377 -> ::ssize_t; 378 } 379 380 #[link(name = "c")] 381 #[link(name = "m")] 382 extern {} 383 384 pub use self::net::*; 385 386 mod net; 387 388 cfg_if! { 389 if #[cfg(libc_core_cvoid)] { 390 pub use ::ffi::c_void; 391 } else { 392 // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help 393 // enable more optimization opportunities around it recognizing things 394 // like malloc/free. 395 #[repr(u8)] 396 #[allow(missing_copy_implementations)] 397 #[allow(missing_debug_implementations)] 398 pub enum c_void { 399 // Two dummy variants so the #[repr] attribute can be used. 400 #[doc(hidden)] 401 __variant1, 402 #[doc(hidden)] 403 __variant2, 404 } 405 } 406 } 407 408 cfg_if! { 409 if #[cfg(libc_align)] { 410 mod align; 411 pub use self::align::*; 412 } else { 413 mod no_align; 414 pub use self::no_align::*; 415 } 416 } 417