1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 #![crate_id = "libc#0.11.0-pre"]
14 #![no_std] // we don't need std, and we can't have std, since it doesn't exist
15 // yet. std depends on us.
16 #![crate_type = "rlib"]
19 * Bindings for the C standard library and other platform libraries
21 * **NOTE:** These are *architecture and libc* specific. On Linux, these
22 * bindings are only correct for glibc.
24 * This module contains bindings to the C standard library, organized into
25 * modules by their defining standard. Additionally, it contains some assorted
26 * platform-specific definitions. For convenience, most functions and types
27 * are reexported, so `use libc::*` will import the available C bindings as
28 * appropriate for the target platform. The exact set of functions available
29 * are platform specific.
31 * *Note:* Because these definitions are platform-specific, some may not appear
32 * in the generated documentation.
34 * We consider the following specs reasonably normative with respect to
35 * interoperating with the C standard library (libc/msvcrt):
37 * * ISO 9899:1990 ('C95', 'ANSI C', 'Standard C'), NA1, 1995.
38 * * ISO 9899:1999 ('C99' or 'C9x').
39 * * ISO 9945:1988 / IEEE 1003.1-1988 ('POSIX.1').
40 * * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3').
41 * * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4').
43 * Note that any reference to the 1996 revision of POSIX, or any revs between
44 * 1990 (when '88 was approved at ISO) and 2001 (when the next actual
45 * revision-revision happened), are merely additions of other chapters (1b and
46 * 1c) outside the core interfaces.
48 * Despite having several names each, these are *reasonably* coherent
49 * point-in-time, list-of-definition sorts of specs. You can get each under a
50 * variety of names but will wind up with the same definition in each case.
52 * See standards(7) in linux-manpages for more details.
54 * Our interface to these libraries is complicated by the non-universality of
55 * conformance to any of them. About the only thing universally supported is
56 * the first (C95), beyond that definitions quickly become absent on various
59 * We therefore wind up dividing our module-space up (mostly for the sake of
60 * sanity while editing, filling-in-details and eliminating duplication) into
61 * definitions common-to-all (held in modules named c95, c99, posix88, posix01
62 * and posix08) and definitions that appear only on *some* platforms (named
63 * 'extra'). This would be things like significant OSX foundation kit, or win32
64 * library kernel32.dll, or various fancy glibc, linux or BSD extensions.
66 * In addition to the per-platform 'extra' modules, we define a module of
67 * 'common BSD' libc routines that never quite made it into POSIX but show up
68 * in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final
69 * one from Berkeley after the lawsuits died down and the CSRG dissolved.
72 #![allow(non_camel_case_types)]
73 #![allow(non_snake_case_functions)]
74 #![allow(non_uppercase_statics)]
75 #![allow(missing_doc)]
76 #![allow(uppercase_variables)]
78 #[cfg(test)] extern crate std;
79 #[cfg(test)] extern crate test;
80 #[cfg(test)] extern crate native;
82 // Explicit export lists for the intersection (provided here) mean that
83 // you can write more-platform-agnostic code if you stick to just these
86 pub use types::common::c95::{FILE, c_void, fpos_t};
87 pub use types::common::c99::{int8_t, int16_t, int32_t, int64_t};
88 pub use types::common::c99::{uint8_t, uint16_t, uint32_t, uint64_t};
89 pub use types::common::posix88::{DIR, dirent_t};
90 pub use types::os::common::posix01::{timeval};
91 pub use types::os::common::bsd44::{addrinfo, in_addr, in6_addr, sockaddr_storage};
92 pub use types::os::common::bsd44::{ip_mreq, ip6_mreq, sockaddr, sockaddr_un};
93 pub use types::os::common::bsd44::{sa_family_t, sockaddr_in, sockaddr_in6, socklen_t};
94 pub use types::os::arch::c95::{c_char, c_double, c_float, c_int, c_uint};
95 pub use types::os::arch::c95::{c_long, c_short, c_uchar, c_ulong, wchar_t};
96 pub use types::os::arch::c95::{c_ushort, clock_t, ptrdiff_t, c_schar};
97 pub use types::os::arch::c95::{size_t, time_t, suseconds_t};
98 pub use types::os::arch::c99::{c_longlong, c_ulonglong};
99 pub use types::os::arch::c99::{intptr_t, uintptr_t};
100 pub use types::os::arch::posix88::{dev_t, ino_t, mode_t};
101 pub use types::os::arch::posix88::{off_t, pid_t, ssize_t};
103 pub use consts::os::c95::{_IOFBF, _IOLBF, _IONBF, BUFSIZ, EOF};
104 pub use consts::os::c95::{EXIT_FAILURE, EXIT_SUCCESS};
105 pub use consts::os::c95::{FILENAME_MAX, FOPEN_MAX, L_tmpnam};
106 pub use consts::os::c95::{RAND_MAX, SEEK_CUR, SEEK_END};
107 pub use consts::os::c95::{SEEK_SET, TMP_MAX};
108 pub use consts::os::posix88::{F_OK, O_APPEND, O_CREAT, O_EXCL};
109 pub use consts::os::posix88::{O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY};
110 pub use consts::os::posix88::{R_OK, S_IEXEC, S_IFBLK, S_IFCHR};
111 pub use consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IFLNK};
112 pub use consts::os::posix88::{S_IREAD, S_IRUSR, S_IRWXU, S_IWUSR};
113 pub use consts::os::posix88::{STDERR_FILENO, STDIN_FILENO, S_IXUSR};
114 pub use consts::os::posix88::{STDOUT_FILENO, W_OK, X_OK};
115 pub use consts::os::bsd44::{AF_INET, AF_INET6, SOCK_STREAM, SOCK_DGRAM};
116 pub use consts::os::bsd44::{IPPROTO_IP, IPPROTO_IPV6, IPPROTO_TCP, TCP_NODELAY};
117 pub use consts::os::bsd44::{SOL_SOCKET, SO_KEEPALIVE, SO_ERROR};
118 pub use consts::os::bsd44::{SO_REUSEADDR, SO_BROADCAST, SHUT_WR, IP_MULTICAST_LOOP};
119 pub use consts::os::bsd44::{IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP};
120 pub use consts::os::bsd44::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP};
121 pub use consts::os::bsd44::{IP_MULTICAST_TTL, IP_TTL, SHUT_RD};
123 pub use funcs::c95::ctype::{isalnum, isalpha, iscntrl, isdigit};
124 pub use funcs::c95::ctype::{islower, isprint, ispunct, isspace};
125 pub use funcs::c95::ctype::{isupper, isxdigit, tolower, toupper};
127 pub use funcs::c95::stdio::{fclose, feof, ferror, fflush, fgetc};
128 pub use funcs::c95::stdio::{fgetpos, fgets, fopen, fputc, fputs};
129 pub use funcs::c95::stdio::{fread, freopen, fseek, fsetpos, ftell};
130 pub use funcs::c95::stdio::{fwrite, perror, puts, remove, rename, rewind};
131 pub use funcs::c95::stdio::{setbuf, setvbuf, tmpfile, ungetc};
133 pub use funcs::c95::stdlib::{abs, atof, atoi, calloc, exit, _exit};
134 pub use funcs::c95::stdlib::{free, getenv, labs, malloc, rand};
135 pub use funcs::c95::stdlib::{realloc, srand, strtod, strtol};
136 pub use funcs::c95::stdlib::{strtoul, system};
138 pub use funcs::c95::string::{memchr, memcmp};
139 pub use funcs::c95::string::{strcat, strchr, strcmp};
140 pub use funcs::c95::string::{strcoll, strcpy, strcspn, strerror};
141 pub use funcs::c95::string::{strlen, strncat, strncmp, strncpy};
142 pub use funcs::c95::string::{strpbrk, strrchr, strspn, strstr};
143 pub use funcs::c95::string::{strtok, strxfrm};
145 pub use funcs::posix88::fcntl::{open, creat};
146 pub use funcs::posix88::stat_::{chmod, fstat, mkdir, stat};
147 pub use funcs::posix88::stdio::{fdopen, fileno, pclose, popen};
148 pub use funcs::posix88::unistd::{access, chdir, close, dup, dup2};
149 pub use funcs::posix88::unistd::{execv, execve, execvp, getcwd};
150 pub use funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read};
151 pub use funcs::posix88::unistd::{rmdir, unlink, write};
153 pub use funcs::bsd43::{socket, setsockopt, bind, send, recv, recvfrom};
154 pub use funcs::bsd43::{listen, sendto, accept, connect, getpeername, getsockname};
155 pub use funcs::bsd43::{shutdown};
157 // But we also reexport most everything
158 // if you're interested in writing platform-specific code.
160 // FIXME: This is a mess, but the design of this entire module needs to be
161 // reconsidered, so I'm not inclined to do better right now. As part of
162 // #11870 I removed all the pub globs here, leaving explicit reexports
163 // of everything that is actually used in-tree.
165 // So the following exports don't follow any particular plan.
167 #[cfg(unix)] pub use consts::os::sysconf::{_SC_PAGESIZE};
168 #[cfg(unix)] pub use consts::os::posix88::{PROT_READ, PROT_WRITE, PROT_EXEC};
169 #[cfg(unix)] pub use consts::os::posix88::{MAP_FIXED, MAP_FILE, MAP_ANON, MAP_PRIVATE, MAP_FAILED};
170 #[cfg(unix)] pub use consts::os::posix88::{EACCES, EBADF, EINVAL, ENODEV, ENOMEM};
171 #[cfg(unix)] pub use consts::os::posix88::{ECONNREFUSED, ECONNRESET, EPERM, EPIPE};
172 #[cfg(unix)] pub use consts::os::posix88::{ENOTCONN, ECONNABORTED, EADDRNOTAVAIL, EINTR};
173 #[cfg(unix)] pub use consts::os::posix88::{EADDRINUSE, ENOENT, EISDIR, EAGAIN, EWOULDBLOCK};
174 #[cfg(unix)] pub use consts::os::posix88::{ECANCELED, SIGINT, EINPROGRESS};
175 #[cfg(unix)] pub use consts::os::posix88::{ENOSYS, ENOTTY, ETIMEDOUT, EMFILE};
176 #[cfg(unix)] pub use consts::os::posix88::{SIGTERM, SIGKILL, SIGPIPE, PROT_NONE};
177 #[cfg(unix)] pub use consts::os::posix01::{SIG_IGN};
178 #[cfg(unix)] pub use consts::os::bsd44::{AF_UNIX};
180 #[cfg(unix)] pub use types::os::common::posix01::{pthread_t, timespec, timezone};
182 #[cfg(unix)] pub use types::os::arch::posix88::{uid_t, gid_t};
183 #[cfg(unix)] pub use types::os::arch::posix01::{pthread_attr_t};
184 #[cfg(unix)] pub use types::os::arch::posix01::{stat, utimbuf};
185 #[cfg(unix)] pub use funcs::posix88::unistd::{sysconf, setgid, setsid, setuid, pread, pwrite};
186 #[cfg(unix)] pub use funcs::posix88::unistd::{getgid, getuid};
187 #[cfg(unix)] pub use funcs::posix88::unistd::{_PC_NAME_MAX, utime, nanosleep, pathconf, link};
188 #[cfg(unix)] pub use funcs::posix88::unistd::{chown};
189 #[cfg(unix)] pub use funcs::posix88::mman::{mmap, munmap, mprotect};
190 #[cfg(unix)] pub use funcs::posix88::dirent::{opendir, readdir_r, closedir};
191 #[cfg(unix)] pub use funcs::posix88::fcntl::{fcntl};
192 #[cfg(unix)] pub use funcs::posix01::stat_::{lstat};
193 #[cfg(unix)] pub use funcs::posix01::unistd::{fsync, ftruncate};
194 #[cfg(unix)] pub use funcs::posix01::unistd::{readlink, symlink};
196 #[cfg(windows)] pub use consts::os::c95::{WSAECONNREFUSED, WSAECONNRESET, WSAEACCES};
197 #[cfg(windows)] pub use consts::os::c95::{WSAEWOULDBLOCK, WSAENOTCONN, WSAECONNABORTED};
198 #[cfg(windows)] pub use consts::os::c95::{WSAEADDRNOTAVAIL, WSAEADDRINUSE, WSAEINTR};
199 #[cfg(windows)] pub use consts::os::c95::{WSAEINPROGRESS, WSAEINVAL, WSAEMFILE};
200 #[cfg(windows)] pub use consts::os::extra::{ERROR_INSUFFICIENT_BUFFER};
201 #[cfg(windows)] pub use consts::os::extra::{O_BINARY, O_NOINHERIT, PAGE_NOACCESS};
202 #[cfg(windows)] pub use consts::os::extra::{PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE};
203 #[cfg(windows)] pub use consts::os::extra::{PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE};
204 #[cfg(windows)] pub use consts::os::extra::{MEM_COMMIT, MEM_RESERVE, MEM_RELEASE};
205 #[cfg(windows)] pub use consts::os::extra::{FILE_MAP_READ, FILE_MAP_WRITE, FILE_MAP_EXECUTE};
206 #[cfg(windows)] pub use consts::os::extra::{ERROR_ALREADY_EXISTS, ERROR_NO_DATA};
207 #[cfg(windows)] pub use consts::os::extra::{ERROR_FILE_NOT_FOUND, ERROR_INVALID_NAME};
208 #[cfg(windows)] pub use consts::os::extra::{ERROR_BROKEN_PIPE, ERROR_INVALID_FUNCTION};
209 #[cfg(windows)] pub use consts::os::extra::{ERROR_CALL_NOT_IMPLEMENTED};
210 #[cfg(windows)] pub use consts::os::extra::{ERROR_NOTHING_TO_TERMINATE};
211 #[cfg(windows)] pub use consts::os::extra::{ERROR_INVALID_HANDLE};
212 #[cfg(windows)] pub use consts::os::extra::{TRUE, FALSE, INFINITE};
213 #[cfg(windows)] pub use consts::os::extra::{PROCESS_TERMINATE, PROCESS_QUERY_INFORMATION};
214 #[cfg(windows)] pub use consts::os::extra::{STILL_ACTIVE, DETACHED_PROCESS};
215 #[cfg(windows)] pub use consts::os::extra::{CREATE_NEW_PROCESS_GROUP, CREATE_UNICODE_ENVIRONMENT};
216 #[cfg(windows)] pub use consts::os::extra::{FILE_BEGIN, FILE_END, FILE_CURRENT};
217 #[cfg(windows)] pub use consts::os::extra::{FILE_GENERIC_READ, FILE_GENERIC_WRITE};
218 #[cfg(windows)] pub use consts::os::extra::{FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE};
219 #[cfg(windows)] pub use consts::os::extra::{TRUNCATE_EXISTING, CREATE_ALWAYS, OPEN_EXISTING};
220 #[cfg(windows)] pub use consts::os::extra::{CREATE_NEW, FILE_APPEND_DATA, FILE_WRITE_DATA};
221 #[cfg(windows)] pub use consts::os::extra::{OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL};
222 #[cfg(windows)] pub use consts::os::extra::{FILE_FLAG_BACKUP_SEMANTICS, INVALID_HANDLE_VALUE};
223 #[cfg(windows)] pub use consts::os::extra::{MOVEFILE_REPLACE_EXISTING};
224 #[cfg(windows)] pub use consts::os::extra::{GENERIC_READ, GENERIC_WRITE};
225 #[cfg(windows)] pub use consts::os::extra::{VOLUME_NAME_DOS, FILE_ATTRIBUTE_NORMAL};
226 #[cfg(windows)] pub use consts::os::extra::{PIPE_ACCESS_DUPLEX, FILE_FLAG_FIRST_PIPE_INSTANCE};
227 #[cfg(windows)] pub use consts::os::extra::{FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE};
228 #[cfg(windows)] pub use consts::os::extra::{PIPE_READMODE_BYTE, PIPE_WAIT};
229 #[cfg(windows)] pub use consts::os::extra::{PIPE_UNLIMITED_INSTANCES, ERROR_ACCESS_DENIED};
230 #[cfg(windows)] pub use consts::os::extra::{FILE_WRITE_ATTRIBUTES, FILE_READ_ATTRIBUTES};
231 #[cfg(windows)] pub use consts::os::extra::{ERROR_PIPE_BUSY, ERROR_IO_PENDING};
232 #[cfg(windows)] pub use consts::os::extra::{ERROR_PIPE_CONNECTED, WAIT_OBJECT_0};
233 #[cfg(windows)] pub use consts::os::extra::{ERROR_NOT_FOUND};
234 #[cfg(windows)] pub use consts::os::extra::{ERROR_OPERATION_ABORTED};
235 #[cfg(windows)] pub use types::os::common::bsd44::{SOCKET};
236 #[cfg(windows)] pub use types::os::common::posix01::{stat, utimbuf};
237 #[cfg(windows)] pub use types::os::arch::extra::{HANDLE, BOOL, LPSECURITY_ATTRIBUTES};
238 #[cfg(windows)] pub use types::os::arch::extra::{LPCSTR, WORD, DWORD, BYTE, FILETIME};
239 #[cfg(windows)] pub use types::os::arch::extra::{LARGE_INTEGER, LPVOID, LONG};
240 #[cfg(windows)] pub use types::os::arch::extra::{time64_t, OVERLAPPED, LPCWSTR};
241 #[cfg(windows)] pub use types::os::arch::extra::{LPOVERLAPPED, SIZE_T, LPDWORD};
242 #[cfg(windows)] pub use types::os::arch::extra::{SECURITY_ATTRIBUTES};
243 #[cfg(windows)] pub use funcs::c95::string::{wcslen};
244 #[cfg(windows)] pub use funcs::posix88::stat_::{wstat, wutime, wchmod, wrmdir};
245 #[cfg(windows)] pub use funcs::bsd43::{closesocket};
246 #[cfg(windows)] pub use funcs::extra::kernel32::{GetCurrentDirectoryW, GetLastError};
247 #[cfg(windows)] pub use funcs::extra::kernel32::{GetEnvironmentVariableW, SetEnvironmentVariableW};
248 #[cfg(windows)] pub use funcs::extra::kernel32::{GetModuleFileNameW, SetCurrentDirectoryW};
249 #[cfg(windows)] pub use funcs::extra::kernel32::{GetSystemInfo, VirtualAlloc, VirtualFree};
250 #[cfg(windows)] pub use funcs::extra::kernel32::{CreateFileMappingW, MapViewOfFile};
251 #[cfg(windows)] pub use funcs::extra::kernel32::{UnmapViewOfFile, CloseHandle};
252 #[cfg(windows)] pub use funcs::extra::kernel32::{WaitForSingleObject, GetSystemTimeAsFileTime};
253 #[cfg(windows)] pub use funcs::extra::kernel32::{QueryPerformanceCounter};
254 #[cfg(windows)] pub use funcs::extra::kernel32::{WaitForSingleObject, QueryPerformanceFrequency};
255 #[cfg(windows)] pub use funcs::extra::kernel32::{GetExitCodeProcess, TerminateProcess};
256 #[cfg(windows)] pub use funcs::extra::kernel32::{ReadFile, WriteFile, SetFilePointerEx};
257 #[cfg(windows)] pub use funcs::extra::kernel32::{FlushFileBuffers, SetEndOfFile, CreateFileW};
258 #[cfg(windows)] pub use funcs::extra::kernel32::{CreateDirectoryW, FindFirstFileW};
259 #[cfg(windows)] pub use funcs::extra::kernel32::{FindNextFileW, FindClose, DeleteFileW};
260 #[cfg(windows)] pub use funcs::extra::kernel32::{CreateHardLinkW, CreateEventW};
261 #[cfg(windows)] pub use funcs::extra::kernel32::{FlushFileBuffers, CreateNamedPipeW};
262 #[cfg(windows)] pub use funcs::extra::kernel32::{SetNamedPipeHandleState, WaitNamedPipeW};
263 #[cfg(windows)] pub use funcs::extra::kernel32::{GetOverlappedResult, ConnectNamedPipe};
264 #[cfg(windows)] pub use funcs::extra::kernel32::{DisconnectNamedPipe, OpenProcess};
265 #[cfg(windows)] pub use funcs::extra::kernel32::{MoveFileExW, VirtualProtect};
266 #[cfg(windows)] pub use funcs::extra::msvcrt::{get_osfhandle, open_osfhandle};
268 #[cfg(target_os = "linux")] #[cfg(target_os = "android")] #[cfg(target_os = "freebsd")]
269 pub use consts::os::posix01::{CLOCK_REALTIME, CLOCK_MONOTONIC};
271 #[cfg(target_os = "linux")] #[cfg(target_os = "android")]
272 pub use funcs::posix01::unistd::{fdatasync};
274 #[cfg(unix, not(target_os = "freebsd"))]
275 pub use consts::os::extra::{MAP_STACK};
277 #[cfg(target_os = "freebsd")]
278 pub use consts::os::bsd44::{TCP_KEEPIDLE};
280 #[cfg(target_os = "macos")]
281 #[cfg(target_os = "ios")]
282 pub use consts::os::bsd44::{TCP_KEEPALIVE};
283 #[cfg(target_os = "macos")]
284 #[cfg(target_os = "ios")]
285 pub use consts::os::extra::{F_FULLFSYNC};
286 #[cfg(target_os = "macos")]
287 #[cfg(target_os = "ios")]
288 pub use types::os::arch::extra::{mach_timebase_info};
296 /// A wrapper for a nullable pointer. Don't use this except for interacting
297 /// with libc. Basically Option, but without the dependence on libstd.
298 // If/when libprim happens, this can be removed in favor of that
299 pub enum Nullable<T> {
306 // Types tend to vary *per architecture* so we pull their definitions out
309 // Standard types that are opaque or common, so are not per-target.
313 Type used to construct void pointers for use with C.
315 This type is only useful as a pointer target. Do not use it as a
316 return type for FFI functions which have the `void` return type in
317 C. Use the unit type `()` or omit the return type instead.
319 For LLVM to recognize the void pointer type and by extension
320 functions like malloc(), we need to have it represented as i8* in
321 LLVM bitcode. The enum used here ensures this and prevents misuse
322 of the "raw" type by only having private variants.. We need two
323 variants, because the compiler complains about the repr attribute
335 pub type int8_t = i8;
336 pub type int16_t = i16;
337 pub type int32_t = i32;
338 pub type int64_t = i64;
339 pub type uint8_t = u8;
340 pub type uint16_t = u16;
341 pub type uint32_t = u32;
342 pub type uint64_t = u64;
353 // Standard types that are scalar but vary by OS and arch.
355 #[cfg(target_os = "linux")]
356 #[cfg(target_os = "android")]
360 use types::common::c95::{c_void};
361 use types::os::arch::c95::{c_char, c_ulong, size_t,
362 time_t, suseconds_t, c_long};
364 pub type pthread_t = c_ulong;
367 pub gl_pathc: size_t,
368 pub gl_pathv: **c_char,
371 pub __unused1: *c_void,
372 pub __unused2: *c_void,
373 pub __unused3: *c_void,
374 pub __unused4: *c_void,
375 pub __unused5: *c_void,
380 pub tv_usec: suseconds_t,
383 pub struct timespec {
390 pub type sighandler_t = size_t;
393 use types::os::arch::c95::{c_char, c_int, c_uint};
395 pub type socklen_t = u32;
396 pub type sa_family_t = u16;
397 pub type in_port_t = u16;
398 pub type in_addr_t = u32;
399 pub struct sockaddr {
400 pub sa_family: sa_family_t,
401 pub sa_data: [u8, ..14],
403 pub struct sockaddr_storage {
404 pub ss_family: sa_family_t,
406 pub __ss_pad2: [u8, ..112],
408 pub struct sockaddr_in {
409 pub sin_family: sa_family_t,
410 pub sin_port: in_port_t,
411 pub sin_addr: in_addr,
412 pub sin_zero: [u8, ..8],
415 pub s_addr: in_addr_t,
417 pub struct sockaddr_in6 {
418 pub sin6_family: sa_family_t,
419 pub sin6_port: in_port_t,
420 pub sin6_flowinfo: u32,
421 pub sin6_addr: in6_addr,
422 pub sin6_scope_id: u32,
424 pub struct in6_addr {
425 pub s6_addr: [u16, ..8]
428 pub imr_multiaddr: in_addr,
429 pub imr_interface: in_addr,
431 pub struct ip6_mreq {
432 pub ipv6mr_multiaddr: in6_addr,
433 pub ipv6mr_interface: c_uint,
435 pub struct addrinfo {
437 pub ai_family: c_int,
438 pub ai_socktype: c_int,
439 pub ai_protocol: c_int,
440 pub ai_addrlen: socklen_t,
442 #[cfg(target_os = "linux")]
443 pub ai_addr: *sockaddr,
445 #[cfg(target_os = "linux")]
446 pub ai_canonname: *c_char,
448 #[cfg(target_os = "android")]
449 pub ai_canonname: *c_char,
451 #[cfg(target_os = "android")]
452 pub ai_addr: *sockaddr,
454 pub ai_next: *addrinfo,
456 pub struct sockaddr_un {
457 pub sun_family: sa_family_t,
458 pub sun_path: [c_char, ..108]
463 #[cfg(target_arch = "x86")]
464 #[cfg(target_arch = "arm")]
465 #[cfg(target_arch = "mips")]
466 #[cfg(target_arch = "mipsel")]
469 pub type c_char = i8;
470 pub type c_schar = i8;
471 pub type c_uchar = u8;
472 pub type c_short = i16;
473 pub type c_ushort = u16;
474 pub type c_int = i32;
475 pub type c_uint = u32;
476 pub type c_long = i32;
477 pub type c_ulong = u32;
478 pub type c_float = f32;
479 pub type c_double = f64;
480 pub type size_t = u32;
481 pub type ptrdiff_t = i32;
482 pub type clock_t = i32;
483 pub type time_t = i32;
484 pub type suseconds_t = i32;
485 pub type wchar_t = i32;
488 pub type c_longlong = i64;
489 pub type c_ulonglong = u64;
490 pub type intptr_t = int;
491 pub type uintptr_t = uint;
493 #[cfg(target_arch = "x86")]
494 #[cfg(target_arch = "mips")]
495 #[cfg(target_arch = "mipsel")]
497 pub type off_t = i32;
498 pub type dev_t = u64;
499 pub type ino_t = u32;
500 pub type pid_t = i32;
501 pub type uid_t = u32;
502 pub type gid_t = u32;
503 pub type useconds_t = u32;
504 pub type mode_t = u32;
505 pub type ssize_t = i32;
507 #[cfg(target_arch = "arm")]
509 pub type off_t = i32;
510 pub type dev_t = u32;
511 pub type ino_t = u32;
512 pub type pid_t = i32;
513 pub type uid_t = u32;
514 pub type gid_t = u32;
515 pub type useconds_t = u32;
516 pub type mode_t = u16;
517 pub type ssize_t = i32;
519 #[cfg(target_arch = "x86")]
521 use types::os::arch::c95::{c_short, c_long, time_t};
522 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
523 use types::os::arch::posix88::{mode_t, off_t};
524 use types::os::arch::posix88::{uid_t};
526 pub type nlink_t = u32;
527 pub type blksize_t = i32;
528 pub type blkcnt_t = i32;
535 pub st_nlink: nlink_t,
541 pub st_blksize: blksize_t,
542 pub st_blocks: blkcnt_t,
543 pub st_atime: time_t,
544 pub st_atime_nsec: c_long,
545 pub st_mtime: time_t,
546 pub st_mtime_nsec: c_long,
547 pub st_ctime: time_t,
548 pub st_ctime_nsec: c_long,
549 pub __unused4: c_long,
550 pub __unused5: c_long,
558 pub struct pthread_attr_t {
559 pub __size: [u32, ..9]
562 #[cfg(target_arch = "arm")]
564 use types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
565 use types::os::arch::c99::{c_longlong, c_ulonglong};
566 use types::os::arch::posix88::{uid_t, gid_t, ino_t};
568 pub type nlink_t = u16;
569 pub type blksize_t = u32;
570 pub type blkcnt_t = u32;
573 pub st_dev: c_ulonglong,
574 pub __pad0: [c_uchar, ..4],
577 pub st_nlink: c_uint,
580 pub st_rdev: c_ulonglong,
581 pub __pad3: [c_uchar, ..4],
582 pub st_size: c_longlong,
583 pub st_blksize: blksize_t,
584 pub st_blocks: c_ulonglong,
585 pub st_atime: time_t,
586 pub st_atime_nsec: c_ulong,
587 pub st_mtime: time_t,
588 pub st_mtime_nsec: c_ulong,
589 pub st_ctime: time_t,
590 pub st_ctime_nsec: c_ulong,
591 pub st_ino: c_ulonglong,
599 pub struct pthread_attr_t {
600 pub __size: [u32, ..9]
603 #[cfg(target_arch = "mips")]
604 #[cfg(target_arch = "mipsel")]
606 use types::os::arch::c95::{c_long, c_ulong, time_t};
607 use types::os::arch::posix88::{gid_t, ino_t};
608 use types::os::arch::posix88::{mode_t, off_t};
609 use types::os::arch::posix88::{uid_t};
611 pub type nlink_t = u32;
612 pub type blksize_t = i32;
613 pub type blkcnt_t = i32;
617 pub st_pad1: [c_long, ..3],
620 pub st_nlink: nlink_t,
623 pub st_rdev: c_ulong,
624 pub st_pad2: [c_long, ..2],
627 pub st_atime: time_t,
628 pub st_atime_nsec: c_long,
629 pub st_mtime: time_t,
630 pub st_mtime_nsec: c_long,
631 pub st_ctime: time_t,
632 pub st_ctime_nsec: c_long,
633 pub st_blksize: blksize_t,
634 pub st_blocks: blkcnt_t,
635 pub st_pad5: [c_long, ..14],
643 pub struct pthread_attr_t {
644 pub __size: [u32, ..9]
652 #[cfg(target_arch = "x86_64")]
655 pub type c_char = i8;
656 pub type c_schar = i8;
657 pub type c_uchar = u8;
658 pub type c_short = i16;
659 pub type c_ushort = u16;
660 pub type c_int = i32;
661 pub type c_uint = u32;
662 pub type c_long = i64;
663 pub type c_ulong = u64;
664 pub type c_float = f32;
665 pub type c_double = f64;
666 pub type size_t = u64;
667 pub type ptrdiff_t = i64;
668 pub type clock_t = i64;
669 pub type time_t = i64;
670 pub type suseconds_t = i64;
671 pub type wchar_t = i32;
674 pub type c_longlong = i64;
675 pub type c_ulonglong = u64;
676 pub type intptr_t = int;
677 pub type uintptr_t = uint;
680 pub type off_t = i64;
681 pub type dev_t = u64;
682 pub type ino_t = u64;
683 pub type pid_t = i32;
684 pub type uid_t = u32;
685 pub type gid_t = u32;
686 pub type useconds_t = u32;
687 pub type mode_t = u32;
688 pub type ssize_t = i64;
691 use types::os::arch::c95::{c_int, c_long, time_t};
692 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
693 use types::os::arch::posix88::{mode_t, off_t};
694 use types::os::arch::posix88::{uid_t};
696 pub type nlink_t = u64;
697 pub type blksize_t = i64;
698 pub type blkcnt_t = i64;
702 pub st_nlink: nlink_t,
709 pub st_blksize: blksize_t,
710 pub st_blocks: blkcnt_t,
711 pub st_atime: time_t,
712 pub st_atime_nsec: c_long,
713 pub st_mtime: time_t,
714 pub st_mtime_nsec: c_long,
715 pub st_ctime: time_t,
716 pub st_ctime_nsec: c_long,
717 pub __unused: [c_long, ..3],
725 pub struct pthread_attr_t {
726 pub __size: [u64, ..7]
738 #[cfg(target_os = "freebsd")]
742 use types::common::c95::{c_void};
743 use types::os::arch::c95::{c_char, c_int, size_t,
744 time_t, suseconds_t, c_long};
745 use types::os::arch::c99::{uintptr_t};
747 pub type pthread_t = uintptr_t;
750 pub gl_pathc: size_t,
751 pub __unused1: size_t,
753 pub __unused2: c_int,
754 pub gl_pathv: **c_char,
756 pub __unused3: *c_void,
758 pub __unused4: *c_void,
759 pub __unused5: *c_void,
760 pub __unused6: *c_void,
761 pub __unused7: *c_void,
762 pub __unused8: *c_void,
767 pub tv_usec: suseconds_t,
770 pub struct timespec {
777 pub type sighandler_t = size_t;
780 use types::os::arch::c95::{c_char, c_int, c_uint};
782 pub type socklen_t = u32;
783 pub type sa_family_t = u8;
784 pub type in_port_t = u16;
785 pub type in_addr_t = u32;
786 pub struct sockaddr {
788 pub sa_family: sa_family_t,
789 pub sa_data: [u8, ..14],
791 pub struct sockaddr_storage {
793 pub ss_family: sa_family_t,
794 pub __ss_pad1: [u8, ..6],
796 pub __ss_pad2: [u8, ..112],
798 pub struct sockaddr_in {
800 pub sin_family: sa_family_t,
801 pub sin_port: in_port_t,
802 pub sin_addr: in_addr,
803 pub sin_zero: [u8, ..8],
806 pub s_addr: in_addr_t,
808 pub struct sockaddr_in6 {
810 pub sin6_family: sa_family_t,
811 pub sin6_port: in_port_t,
812 pub sin6_flowinfo: u32,
813 pub sin6_addr: in6_addr,
814 pub sin6_scope_id: u32,
816 pub struct in6_addr {
817 pub s6_addr: [u16, ..8]
820 pub imr_multiaddr: in_addr,
821 pub imr_interface: in_addr,
823 pub struct ip6_mreq {
824 pub ipv6mr_multiaddr: in6_addr,
825 pub ipv6mr_interface: c_uint,
827 pub struct addrinfo {
829 pub ai_family: c_int,
830 pub ai_socktype: c_int,
831 pub ai_protocol: c_int,
832 pub ai_addrlen: socklen_t,
833 pub ai_canonname: *c_char,
834 pub ai_addr: *sockaddr,
835 pub ai_next: *addrinfo,
837 pub struct sockaddr_un {
839 pub sun_family: sa_family_t,
840 pub sun_path: [c_char, ..104]
845 #[cfg(target_arch = "x86_64")]
848 pub type c_char = i8;
849 pub type c_schar = i8;
850 pub type c_uchar = u8;
851 pub type c_short = i16;
852 pub type c_ushort = u16;
853 pub type c_int = i32;
854 pub type c_uint = u32;
855 pub type c_long = i64;
856 pub type c_ulong = u64;
857 pub type c_float = f32;
858 pub type c_double = f64;
859 pub type size_t = u64;
860 pub type ptrdiff_t = i64;
861 pub type clock_t = i32;
862 pub type time_t = i64;
863 pub type suseconds_t = i64;
864 pub type wchar_t = i32;
867 pub type c_longlong = i64;
868 pub type c_ulonglong = u64;
869 pub type intptr_t = int;
870 pub type uintptr_t = uint;
873 pub type off_t = i64;
874 pub type dev_t = u32;
875 pub type ino_t = u32;
876 pub type pid_t = i32;
877 pub type uid_t = u32;
878 pub type gid_t = u32;
879 pub type useconds_t = u32;
880 pub type mode_t = u16;
881 pub type ssize_t = i64;
884 use types::common::c95::{c_void};
885 use types::common::c99::{uint8_t, uint32_t, int32_t};
886 use types::os::arch::c95::{c_long, time_t};
887 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
888 use types::os::arch::posix88::{mode_t, off_t};
889 use types::os::arch::posix88::{uid_t};
891 pub type nlink_t = u16;
892 pub type blksize_t = i64;
893 pub type blkcnt_t = i64;
894 pub type fflags_t = u32;
899 pub st_nlink: nlink_t,
903 pub st_atime: time_t,
904 pub st_atime_nsec: c_long,
905 pub st_mtime: time_t,
906 pub st_mtime_nsec: c_long,
907 pub st_ctime: time_t,
908 pub st_ctime_nsec: c_long,
910 pub st_blocks: blkcnt_t,
911 pub st_blksize: blksize_t,
912 pub st_flags: fflags_t,
913 pub st_gen: uint32_t,
914 pub st_lspare: int32_t,
915 pub st_birthtime: time_t,
916 pub st_birthtime_nsec: c_long,
917 pub __unused: [uint8_t, ..2],
925 pub type pthread_attr_t = *c_void;
936 #[cfg(target_os = "win32")]
940 use types::os::arch::c95::{c_short, time_t, suseconds_t,
942 use types::os::arch::extra::{int64, time64_t};
943 use types::os::arch::posix88::{dev_t, ino_t};
944 use types::os::arch::posix88::mode_t;
946 // pub Note: this is the struct called stat64 in win32. Not stat,
952 pub st_nlink: c_short,
957 pub st_atime: time64_t,
958 pub st_mtime: time64_t,
959 pub st_ctime: time64_t,
962 // note that this is called utimbuf64 in win32
964 pub actime: time64_t,
965 pub modtime: time64_t,
970 pub tv_usec: suseconds_t,
973 pub struct timespec {
982 use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
984 pub type SOCKET = c_uint;
985 pub type socklen_t = c_int;
986 pub type sa_family_t = u16;
987 pub type in_port_t = u16;
988 pub type in_addr_t = u32;
989 pub struct sockaddr {
990 pub sa_family: sa_family_t,
991 pub sa_data: [u8, ..14],
993 pub struct sockaddr_storage {
994 pub ss_family: sa_family_t,
996 pub __ss_pad2: [u8, ..112],
998 pub struct sockaddr_in {
999 pub sin_family: sa_family_t,
1000 pub sin_port: in_port_t,
1001 pub sin_addr: in_addr,
1002 pub sin_zero: [u8, ..8],
1004 pub struct in_addr {
1005 pub s_addr: in_addr_t,
1007 pub struct sockaddr_in6 {
1008 pub sin6_family: sa_family_t,
1009 pub sin6_port: in_port_t,
1010 pub sin6_flowinfo: u32,
1011 pub sin6_addr: in6_addr,
1012 pub sin6_scope_id: u32,
1014 pub struct in6_addr {
1015 pub s6_addr: [u16, ..8]
1017 pub struct ip_mreq {
1018 pub imr_multiaddr: in_addr,
1019 pub imr_interface: in_addr,
1021 pub struct ip6_mreq {
1022 pub ipv6mr_multiaddr: in6_addr,
1023 pub ipv6mr_interface: c_uint,
1025 pub struct addrinfo {
1026 pub ai_flags: c_int,
1027 pub ai_family: c_int,
1028 pub ai_socktype: c_int,
1029 pub ai_protocol: c_int,
1030 pub ai_addrlen: size_t,
1031 pub ai_canonname: *c_char,
1032 pub ai_addr: *sockaddr,
1033 pub ai_next: *addrinfo,
1035 pub struct sockaddr_un {
1036 pub sun_family: sa_family_t,
1037 pub sun_path: [c_char, ..108]
1044 pub type c_char = i8;
1045 pub type c_schar = i8;
1046 pub type c_uchar = u8;
1047 pub type c_short = i16;
1048 pub type c_ushort = u16;
1049 pub type c_int = i32;
1050 pub type c_uint = u32;
1051 pub type c_long = i32;
1052 pub type c_ulong = u32;
1053 pub type c_float = f32;
1054 pub type c_double = f64;
1056 #[cfg(target_arch = "x86")]
1057 pub type size_t = u32;
1058 #[cfg(target_arch = "x86_64")]
1059 pub type size_t = u64;
1061 #[cfg(target_arch = "x86")]
1062 pub type ptrdiff_t = i32;
1063 #[cfg(target_arch = "x86_64")]
1064 pub type ptrdiff_t = i64;
1066 pub type clock_t = i32;
1068 #[cfg(target_arch = "x86")]
1069 pub type time_t = i32;
1070 #[cfg(target_arch = "x86_64")]
1071 pub type time_t = i64;
1073 #[cfg(target_arch = "x86")]
1074 pub type suseconds_t = i32;
1075 #[cfg(target_arch = "x86_64")]
1076 pub type suseconds_t = i64;
1078 pub type wchar_t = u16;
1082 pub type c_longlong = i64;
1083 pub type c_ulonglong = u64;
1084 pub type intptr_t = int;
1085 pub type uintptr_t = uint;
1089 pub type off_t = i32;
1090 pub type dev_t = u32;
1091 pub type ino_t = i16;
1093 #[cfg(target_arch = "x86")]
1094 pub type pid_t = i32;
1095 #[cfg(target_arch = "x86_64")]
1096 pub type pid_t = i64;
1098 pub type useconds_t = u32;
1099 pub type mode_t = u16;
1101 #[cfg(target_arch = "x86")]
1102 pub type ssize_t = i32;
1103 #[cfg(target_arch = "x86_64")]
1104 pub type ssize_t = i64;
1114 use consts::os::extra::{MAX_PROTOCOL_CHAIN,
1116 use types::common::c95::c_void;
1117 use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1118 use types::os::arch::c95::{c_long, c_ulong};
1119 use types::os::arch::c95::{wchar_t};
1120 use types::os::arch::c99::{c_ulonglong, c_longlong};
1122 pub type BOOL = c_int;
1124 pub type BOOLEAN = BYTE;
1125 pub type CCHAR = c_char;
1126 pub type CHAR = c_char;
1128 pub type DWORD = c_ulong;
1129 pub type DWORDLONG = c_ulonglong;
1131 pub type HANDLE = LPVOID;
1132 pub type HMODULE = c_uint;
1134 pub type LONG = c_long;
1135 pub type PLONG = *mut c_long;
1137 #[cfg(target_arch = "x86")]
1138 pub type LONG_PTR = c_long;
1139 #[cfg(target_arch = "x86_64")]
1140 pub type LONG_PTR = i64;
1142 pub type LARGE_INTEGER = c_longlong;
1143 pub type PLARGE_INTEGER = *mut c_longlong;
1145 pub type LPCWSTR = *WCHAR;
1146 pub type LPCSTR = *CHAR;
1148 pub type LPWSTR = *mut WCHAR;
1149 pub type LPSTR = *mut CHAR;
1151 pub type LPWCH = *mut WCHAR;
1152 pub type LPCH = *mut CHAR;
1154 pub struct SECURITY_ATTRIBUTES {
1156 pub lpSecurityDescriptor: LPVOID,
1157 pub bInheritHandle: BOOL,
1159 pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES;
1161 pub type LPVOID = *mut c_void;
1162 pub type LPCVOID = *c_void;
1163 pub type LPBYTE = *mut BYTE;
1164 pub type LPWORD = *mut WORD;
1165 pub type LPDWORD = *mut DWORD;
1166 pub type LPHANDLE = *mut HANDLE;
1168 pub type LRESULT = LONG_PTR;
1169 pub type PBOOL = *mut BOOL;
1170 pub type WCHAR = wchar_t;
1171 pub type WORD = u16;
1172 pub type SIZE_T = size_t;
1174 pub type time64_t = i64;
1175 pub type int64 = i64;
1177 pub struct STARTUPINFO {
1179 pub lpReserved: LPWSTR,
1180 pub lpDesktop: LPWSTR,
1181 pub lpTitle: LPWSTR,
1186 pub dwXCountChars: DWORD,
1187 pub dwYCountCharts: DWORD,
1188 pub dwFillAttribute: DWORD,
1190 pub wShowWindow: WORD,
1191 pub cbReserved2: WORD,
1192 pub lpReserved2: LPBYTE,
1193 pub hStdInput: HANDLE,
1194 pub hStdOutput: HANDLE,
1195 pub hStdError: HANDLE,
1197 pub type LPSTARTUPINFO = *mut STARTUPINFO;
1199 pub struct PROCESS_INFORMATION {
1200 pub hProcess: HANDLE,
1201 pub hThread: HANDLE,
1202 pub dwProcessId: DWORD,
1203 pub dwThreadId: DWORD,
1205 pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
1207 pub struct SYSTEM_INFO {
1208 pub wProcessorArchitecture: WORD,
1209 pub wReserved: WORD,
1210 pub dwPageSize: DWORD,
1211 pub lpMinimumApplicationAddress: LPVOID,
1212 pub lpMaximumApplicationAddress: LPVOID,
1213 pub dwActiveProcessorMask: DWORD,
1214 pub dwNumberOfProcessors: DWORD,
1215 pub dwProcessorType: DWORD,
1216 pub dwAllocationGranularity: DWORD,
1217 pub wProcessorLevel: WORD,
1218 pub wProcessorRevision: WORD,
1220 pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
1222 pub struct MEMORY_BASIC_INFORMATION {
1223 pub BaseAddress: LPVOID,
1224 pub AllocationBase: LPVOID,
1225 pub AllocationProtect: DWORD,
1226 pub RegionSize: SIZE_T,
1231 pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
1233 pub struct OVERLAPPED {
1234 pub Internal: *c_ulong,
1235 pub InternalHigh: *c_ulong,
1237 pub OffsetHigh: DWORD,
1241 pub type LPOVERLAPPED = *mut OVERLAPPED;
1243 pub struct FILETIME {
1244 pub dwLowDateTime: DWORD,
1245 pub dwHighDateTime: DWORD,
1248 pub type LPFILETIME = *mut FILETIME;
1254 pub Data4: [BYTE, ..8],
1257 pub struct WSAPROTOCOLCHAIN {
1258 pub ChainLen: c_int,
1259 pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN],
1262 pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
1264 pub struct WSAPROTOCOL_INFO {
1265 pub dwServiceFlags1: DWORD,
1266 pub dwServiceFlags2: DWORD,
1267 pub dwServiceFlags3: DWORD,
1268 pub dwServiceFlags4: DWORD,
1269 pub dwProviderFlags: DWORD,
1270 pub ProviderId: GUID,
1271 pub dwCatalogEntryId: DWORD,
1272 pub ProtocolChain: WSAPROTOCOLCHAIN,
1273 pub iVersion: c_int,
1274 pub iAddressFamily: c_int,
1275 pub iMaxSockAddr: c_int,
1276 pub iMinSockAddr: c_int,
1277 pub iSocketType: c_int,
1278 pub iProtocol: c_int,
1279 pub iProtocolMaxOffset: c_int,
1280 pub iNetworkByteOrder: c_int,
1281 pub iSecurityScheme: c_int,
1282 pub dwMessageSize: DWORD,
1283 pub dwProviderReserved: DWORD,
1284 pub szProtocol: [u8, ..WSAPROTOCOL_LEN+1],
1287 pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
1289 pub type GROUP = c_uint;
1294 #[cfg(target_os = "macos")]
1295 #[cfg(target_os = "ios")]
1299 use types::common::c95::c_void;
1300 use types::os::arch::c95::{c_char, c_int, size_t,
1301 time_t, suseconds_t, c_long};
1302 use types::os::arch::c99::{uintptr_t};
1304 pub type pthread_t = uintptr_t;
1307 pub gl_pathc: size_t,
1308 pub __unused1: c_int,
1309 pub gl_offs: size_t,
1310 pub __unused2: c_int,
1311 pub gl_pathv: **c_char,
1313 pub __unused3: *c_void,
1315 pub __unused4: *c_void,
1316 pub __unused5: *c_void,
1317 pub __unused6: *c_void,
1318 pub __unused7: *c_void,
1319 pub __unused8: *c_void,
1322 pub struct timeval {
1324 pub tv_usec: suseconds_t,
1327 pub struct timespec {
1329 pub tv_nsec: c_long,
1332 pub enum timezone {}
1334 pub type sighandler_t = size_t;
1338 use types::os::arch::c95::{c_char, c_int, c_uint};
1340 pub type socklen_t = c_int;
1341 pub type sa_family_t = u8;
1342 pub type in_port_t = u16;
1343 pub type in_addr_t = u32;
1344 pub struct sockaddr {
1346 pub sa_family: sa_family_t,
1347 pub sa_data: [u8, ..14],
1349 pub struct sockaddr_storage {
1351 pub ss_family: sa_family_t,
1352 pub __ss_pad1: [u8, ..6],
1353 pub __ss_align: i64,
1354 pub __ss_pad2: [u8, ..112],
1356 pub struct sockaddr_in {
1358 pub sin_family: sa_family_t,
1359 pub sin_port: in_port_t,
1360 pub sin_addr: in_addr,
1361 pub sin_zero: [u8, ..8],
1363 pub struct in_addr {
1364 pub s_addr: in_addr_t,
1366 pub struct sockaddr_in6 {
1368 pub sin6_family: sa_family_t,
1369 pub sin6_port: in_port_t,
1370 pub sin6_flowinfo: u32,
1371 pub sin6_addr: in6_addr,
1372 pub sin6_scope_id: u32,
1374 pub struct in6_addr {
1375 pub s6_addr: [u16, ..8]
1377 pub struct ip_mreq {
1378 pub imr_multiaddr: in_addr,
1379 pub imr_interface: in_addr,
1381 pub struct ip6_mreq {
1382 pub ipv6mr_multiaddr: in6_addr,
1383 pub ipv6mr_interface: c_uint,
1385 pub struct addrinfo {
1386 pub ai_flags: c_int,
1387 pub ai_family: c_int,
1388 pub ai_socktype: c_int,
1389 pub ai_protocol: c_int,
1390 pub ai_addrlen: socklen_t,
1391 pub ai_canonname: *c_char,
1392 pub ai_addr: *sockaddr,
1393 pub ai_next: *addrinfo,
1395 pub struct sockaddr_un {
1397 pub sun_family: sa_family_t,
1398 pub sun_path: [c_char, ..104]
1403 #[cfg(target_arch = "arm")]
1404 #[cfg(target_arch = "x86")]
1407 pub type c_char = i8;
1408 pub type c_schar = i8;
1409 pub type c_uchar = u8;
1410 pub type c_short = i16;
1411 pub type c_ushort = u16;
1412 pub type c_int = i32;
1413 pub type c_uint = u32;
1414 pub type c_long = i32;
1415 pub type c_ulong = u32;
1416 pub type c_float = f32;
1417 pub type c_double = f64;
1418 pub type size_t = u32;
1419 pub type ptrdiff_t = i32;
1420 pub type clock_t = u32;
1421 pub type time_t = i32;
1422 pub type suseconds_t = i32;
1423 pub type wchar_t = i32;
1426 pub type c_longlong = i64;
1427 pub type c_ulonglong = u64;
1428 pub type intptr_t = int;
1429 pub type uintptr_t = uint;
1432 pub type off_t = i64;
1433 pub type dev_t = i32;
1434 pub type ino_t = u64;
1435 pub type pid_t = i32;
1436 pub type uid_t = u32;
1437 pub type gid_t = u32;
1438 pub type useconds_t = u32;
1439 pub type mode_t = u16;
1440 pub type ssize_t = i32;
1443 use types::common::c99::{int32_t, int64_t, uint32_t};
1444 use types::os::arch::c95::{c_char, c_long, time_t};
1445 use types::os::arch::posix88::{dev_t, gid_t, ino_t,
1446 mode_t, off_t, uid_t};
1448 pub type nlink_t = u16;
1449 pub type blksize_t = i64;
1450 pub type blkcnt_t = i32;
1454 pub st_mode: mode_t,
1455 pub st_nlink: nlink_t,
1460 pub st_atime: time_t,
1461 pub st_atime_nsec: c_long,
1462 pub st_mtime: time_t,
1463 pub st_mtime_nsec: c_long,
1464 pub st_ctime: time_t,
1465 pub st_ctime_nsec: c_long,
1466 pub st_birthtime: time_t,
1467 pub st_birthtime_nsec: c_long,
1469 pub st_blocks: blkcnt_t,
1470 pub st_blksize: blksize_t,
1471 pub st_flags: uint32_t,
1472 pub st_gen: uint32_t,
1473 pub st_lspare: int32_t,
1474 pub st_qspare: [int64_t, ..2],
1477 pub struct utimbuf {
1479 pub modtime: time_t,
1482 pub struct pthread_attr_t {
1484 pub __opaque: [c_char, ..36]
1492 pub struct mach_timebase_info {
1497 pub type mach_timebase_info_data_t = mach_timebase_info;
1501 #[cfg(target_arch = "x86_64")]
1504 pub type c_char = i8;
1505 pub type c_schar = i8;
1506 pub type c_uchar = u8;
1507 pub type c_short = i16;
1508 pub type c_ushort = u16;
1509 pub type c_int = i32;
1510 pub type c_uint = u32;
1511 pub type c_long = i64;
1512 pub type c_ulong = u64;
1513 pub type c_float = f32;
1514 pub type c_double = f64;
1515 pub type size_t = u64;
1516 pub type ptrdiff_t = i64;
1517 pub type clock_t = u64;
1518 pub type time_t = i64;
1519 pub type suseconds_t = i32;
1520 pub type wchar_t = i32;
1523 pub type c_longlong = i64;
1524 pub type c_ulonglong = u64;
1525 pub type intptr_t = int;
1526 pub type uintptr_t = uint;
1529 pub type off_t = i64;
1530 pub type dev_t = i32;
1531 pub type ino_t = u64;
1532 pub type pid_t = i32;
1533 pub type uid_t = u32;
1534 pub type gid_t = u32;
1535 pub type useconds_t = u32;
1536 pub type mode_t = u16;
1537 pub type ssize_t = i64;
1540 use types::common::c99::{int32_t, int64_t};
1541 use types::common::c99::{uint32_t};
1542 use types::os::arch::c95::{c_char, c_long, time_t};
1543 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
1544 use types::os::arch::posix88::{mode_t, off_t, uid_t};
1546 pub type nlink_t = u16;
1547 pub type blksize_t = i64;
1548 pub type blkcnt_t = i32;
1552 pub st_mode: mode_t,
1553 pub st_nlink: nlink_t,
1558 pub st_atime: time_t,
1559 pub st_atime_nsec: c_long,
1560 pub st_mtime: time_t,
1561 pub st_mtime_nsec: c_long,
1562 pub st_ctime: time_t,
1563 pub st_ctime_nsec: c_long,
1564 pub st_birthtime: time_t,
1565 pub st_birthtime_nsec: c_long,
1567 pub st_blocks: blkcnt_t,
1568 pub st_blksize: blksize_t,
1569 pub st_flags: uint32_t,
1570 pub st_gen: uint32_t,
1571 pub st_lspare: int32_t,
1572 pub st_qspare: [int64_t, ..2],
1575 pub struct utimbuf {
1577 pub modtime: time_t,
1580 pub struct pthread_attr_t {
1582 pub __opaque: [c_char, ..56]
1590 pub struct mach_timebase_info {
1595 pub type mach_timebase_info_data_t = mach_timebase_info;
1602 // Consts tend to vary per OS so we pull their definitions out
1603 // into this module.
1605 #[cfg(target_os = "win32")]
1608 use types::os::arch::c95::{c_int, c_uint};
1610 pub static EXIT_FAILURE : c_int = 1;
1611 pub static EXIT_SUCCESS : c_int = 0;
1612 pub static RAND_MAX : c_int = 32767;
1613 pub static EOF : c_int = -1;
1614 pub static SEEK_SET : c_int = 0;
1615 pub static SEEK_CUR : c_int = 1;
1616 pub static SEEK_END : c_int = 2;
1617 pub static _IOFBF : c_int = 0;
1618 pub static _IONBF : c_int = 4;
1619 pub static _IOLBF : c_int = 64;
1620 pub static BUFSIZ : c_uint = 512_u32;
1621 pub static FOPEN_MAX : c_uint = 20_u32;
1622 pub static FILENAME_MAX : c_uint = 260_u32;
1623 pub static L_tmpnam : c_uint = 16_u32;
1624 pub static TMP_MAX : c_uint = 32767_u32;
1626 pub static WSAEINTR: c_int = 10004;
1627 pub static WSAEBADF: c_int = 10009;
1628 pub static WSAEACCES: c_int = 10013;
1629 pub static WSAEFAULT: c_int = 10014;
1630 pub static WSAEINVAL: c_int = 10022;
1631 pub static WSAEMFILE: c_int = 10024;
1632 pub static WSAEWOULDBLOCK: c_int = 10035;
1633 pub static WSAEINPROGRESS: c_int = 10036;
1634 pub static WSAEALREADY: c_int = 10037;
1635 pub static WSAENOTSOCK: c_int = 10038;
1636 pub static WSAEDESTADDRREQ: c_int = 10039;
1637 pub static WSAEMSGSIZE: c_int = 10040;
1638 pub static WSAEPROTOTYPE: c_int = 10041;
1639 pub static WSAENOPROTOOPT: c_int = 10042;
1640 pub static WSAEPROTONOSUPPORT: c_int = 10043;
1641 pub static WSAESOCKTNOSUPPORT: c_int = 10044;
1642 pub static WSAEOPNOTSUPP: c_int = 10045;
1643 pub static WSAEPFNOSUPPORT: c_int = 10046;
1644 pub static WSAEAFNOSUPPORT: c_int = 10047;
1645 pub static WSAEADDRINUSE: c_int = 10048;
1646 pub static WSAEADDRNOTAVAIL: c_int = 10049;
1647 pub static WSAENETDOWN: c_int = 10050;
1648 pub static WSAENETUNREACH: c_int = 10051;
1649 pub static WSAENETRESET: c_int = 10052;
1650 pub static WSAECONNABORTED: c_int = 10053;
1651 pub static WSAECONNRESET: c_int = 10054;
1652 pub static WSAENOBUFS: c_int = 10055;
1653 pub static WSAEISCONN: c_int = 10056;
1654 pub static WSAENOTCONN: c_int = 10057;
1655 pub static WSAESHUTDOWN: c_int = 10058;
1656 pub static WSAETOOMANYREFS: c_int = 10059;
1657 pub static WSAETIMEDOUT: c_int = 10060;
1658 pub static WSAECONNREFUSED: c_int = 10061;
1659 pub static WSAELOOP: c_int = 10062;
1660 pub static WSAENAMETOOLONG: c_int = 10063;
1661 pub static WSAEHOSTDOWN: c_int = 10064;
1662 pub static WSAEHOSTUNREACH: c_int = 10065;
1663 pub static WSAENOTEMPTY: c_int = 10066;
1664 pub static WSAEPROCLIM: c_int = 10067;
1665 pub static WSAEUSERS: c_int = 10068;
1666 pub static WSAEDQUOT: c_int = 10069;
1667 pub static WSAESTALE: c_int = 10070;
1668 pub static WSAEREMOTE: c_int = 10071;
1669 pub static WSASYSNOTREADY: c_int = 10091;
1670 pub static WSAVERNOTSUPPORTED: c_int = 10092;
1671 pub static WSANOTINITIALISED: c_int = 10093;
1672 pub static WSAEDISCON: c_int = 10101;
1673 pub static WSAENOMORE: c_int = 10102;
1674 pub static WSAECANCELLED: c_int = 10103;
1675 pub static WSAEINVALIDPROCTABLE: c_int = 10104;
1676 pub static WSAEINVALIDPROVIDER: c_int = 10105;
1677 pub static WSAEPROVIDERFAILEDINIT: c_int = 10106;
1682 use types::os::arch::c95::c_int;
1684 pub static O_RDONLY : c_int = 0;
1685 pub static O_WRONLY : c_int = 1;
1686 pub static O_RDWR : c_int = 2;
1687 pub static O_APPEND : c_int = 8;
1688 pub static O_CREAT : c_int = 256;
1689 pub static O_EXCL : c_int = 1024;
1690 pub static O_TRUNC : c_int = 512;
1691 pub static S_IFIFO : c_int = 4096;
1692 pub static S_IFCHR : c_int = 8192;
1693 pub static S_IFBLK : c_int = 12288;
1694 pub static S_IFDIR : c_int = 16384;
1695 pub static S_IFREG : c_int = 32768;
1696 pub static S_IFLNK : c_int = 40960;
1697 pub static S_IFMT : c_int = 61440;
1698 pub static S_IEXEC : c_int = 64;
1699 pub static S_IWRITE : c_int = 128;
1700 pub static S_IREAD : c_int = 256;
1701 pub static S_IRWXU : c_int = 448;
1702 pub static S_IXUSR : c_int = 64;
1703 pub static S_IWUSR : c_int = 128;
1704 pub static S_IRUSR : c_int = 256;
1705 pub static F_OK : c_int = 0;
1706 pub static R_OK : c_int = 4;
1707 pub static W_OK : c_int = 2;
1708 pub static X_OK : c_int = 1;
1709 pub static STDIN_FILENO : c_int = 0;
1710 pub static STDOUT_FILENO : c_int = 1;
1711 pub static STDERR_FILENO : c_int = 2;
1718 use types::os::arch::c95::c_int;
1720 pub static AF_INET: c_int = 2;
1721 pub static AF_INET6: c_int = 23;
1722 pub static SOCK_STREAM: c_int = 1;
1723 pub static SOCK_DGRAM: c_int = 2;
1724 pub static IPPROTO_TCP: c_int = 6;
1725 pub static IPPROTO_IP: c_int = 0;
1726 pub static IPPROTO_IPV6: c_int = 41;
1727 pub static IP_MULTICAST_TTL: c_int = 3;
1728 pub static IP_MULTICAST_LOOP: c_int = 4;
1729 pub static IP_ADD_MEMBERSHIP: c_int = 5;
1730 pub static IP_DROP_MEMBERSHIP: c_int = 6;
1731 pub static IPV6_ADD_MEMBERSHIP: c_int = 5;
1732 pub static IPV6_DROP_MEMBERSHIP: c_int = 6;
1733 pub static IP_TTL: c_int = 4;
1735 pub static TCP_NODELAY: c_int = 0x0001;
1736 pub static SOL_SOCKET: c_int = 0xffff;
1737 pub static SO_KEEPALIVE: c_int = 8;
1738 pub static SO_BROADCAST: c_int = 32;
1739 pub static SO_REUSEADDR: c_int = 4;
1740 pub static SO_ERROR: c_int = 0x1007;
1742 pub static SHUT_RD: c_int = 0;
1743 pub static SHUT_WR: c_int = 1;
1744 pub static SHUT_RDWR: c_int = 2;
1747 use types::os::arch::c95::c_int;
1748 use types::os::arch::extra::{WORD, DWORD, BOOL};
1750 pub static TRUE : BOOL = 1;
1751 pub static FALSE : BOOL = 0;
1753 pub static O_TEXT : c_int = 16384;
1754 pub static O_BINARY : c_int = 32768;
1755 pub static O_NOINHERIT: c_int = 128;
1757 pub static ERROR_SUCCESS : c_int = 0;
1758 pub static ERROR_INVALID_FUNCTION: c_int = 1;
1759 pub static ERROR_FILE_NOT_FOUND: c_int = 2;
1760 pub static ERROR_ACCESS_DENIED: c_int = 5;
1761 pub static ERROR_INVALID_HANDLE : c_int = 6;
1762 pub static ERROR_BROKEN_PIPE: c_int = 109;
1763 pub static ERROR_DISK_FULL : c_int = 112;
1764 pub static ERROR_CALL_NOT_IMPLEMENTED : c_int = 120;
1765 pub static ERROR_INSUFFICIENT_BUFFER : c_int = 122;
1766 pub static ERROR_INVALID_NAME : c_int = 123;
1767 pub static ERROR_ALREADY_EXISTS : c_int = 183;
1768 pub static ERROR_PIPE_BUSY: c_int = 231;
1769 pub static ERROR_NO_DATA: c_int = 232;
1770 pub static ERROR_INVALID_ADDRESS : c_int = 487;
1771 pub static ERROR_PIPE_CONNECTED: c_int = 535;
1772 pub static ERROR_NOTHING_TO_TERMINATE: c_int = 758;
1773 pub static ERROR_OPERATION_ABORTED: c_int = 995;
1774 pub static ERROR_IO_PENDING: c_int = 997;
1775 pub static ERROR_FILE_INVALID : c_int = 1006;
1776 pub static ERROR_NOT_FOUND: c_int = 1168;
1777 pub static INVALID_HANDLE_VALUE : c_int = -1;
1779 pub static DELETE : DWORD = 0x00010000;
1780 pub static READ_CONTROL : DWORD = 0x00020000;
1781 pub static SYNCHRONIZE : DWORD = 0x00100000;
1782 pub static WRITE_DAC : DWORD = 0x00040000;
1783 pub static WRITE_OWNER : DWORD = 0x00080000;
1785 pub static PROCESS_CREATE_PROCESS : DWORD = 0x0080;
1786 pub static PROCESS_CREATE_THREAD : DWORD = 0x0002;
1787 pub static PROCESS_DUP_HANDLE : DWORD = 0x0040;
1788 pub static PROCESS_QUERY_INFORMATION : DWORD = 0x0400;
1789 pub static PROCESS_QUERY_LIMITED_INFORMATION : DWORD = 0x1000;
1790 pub static PROCESS_SET_INFORMATION : DWORD = 0x0200;
1791 pub static PROCESS_SET_QUOTA : DWORD = 0x0100;
1792 pub static PROCESS_SUSPEND_RESUME : DWORD = 0x0800;
1793 pub static PROCESS_TERMINATE : DWORD = 0x0001;
1794 pub static PROCESS_VM_OPERATION : DWORD = 0x0008;
1795 pub static PROCESS_VM_READ : DWORD = 0x0010;
1796 pub static PROCESS_VM_WRITE : DWORD = 0x0020;
1798 pub static STARTF_FORCEONFEEDBACK : DWORD = 0x00000040;
1799 pub static STARTF_FORCEOFFFEEDBACK : DWORD = 0x00000080;
1800 pub static STARTF_PREVENTPINNING : DWORD = 0x00002000;
1801 pub static STARTF_RUNFULLSCREEN : DWORD = 0x00000020;
1802 pub static STARTF_TITLEISAPPID : DWORD = 0x00001000;
1803 pub static STARTF_TITLEISLINKNAME : DWORD = 0x00000800;
1804 pub static STARTF_USECOUNTCHARS : DWORD = 0x00000008;
1805 pub static STARTF_USEFILLATTRIBUTE : DWORD = 0x00000010;
1806 pub static STARTF_USEHOTKEY : DWORD = 0x00000200;
1807 pub static STARTF_USEPOSITION : DWORD = 0x00000004;
1808 pub static STARTF_USESHOWWINDOW : DWORD = 0x00000001;
1809 pub static STARTF_USESIZE : DWORD = 0x00000002;
1810 pub static STARTF_USESTDHANDLES : DWORD = 0x00000100;
1812 pub static WAIT_ABANDONED : DWORD = 0x00000080;
1813 pub static WAIT_OBJECT_0 : DWORD = 0x00000000;
1814 pub static WAIT_TIMEOUT : DWORD = 0x00000102;
1815 pub static WAIT_FAILED : DWORD = -1;
1817 pub static DUPLICATE_CLOSE_SOURCE : DWORD = 0x00000001;
1818 pub static DUPLICATE_SAME_ACCESS : DWORD = 0x00000002;
1820 pub static INFINITE : DWORD = -1;
1821 pub static STILL_ACTIVE : DWORD = 259;
1823 pub static MEM_COMMIT : DWORD = 0x00001000;
1824 pub static MEM_RESERVE : DWORD = 0x00002000;
1825 pub static MEM_DECOMMIT : DWORD = 0x00004000;
1826 pub static MEM_RELEASE : DWORD = 0x00008000;
1827 pub static MEM_RESET : DWORD = 0x00080000;
1828 pub static MEM_RESET_UNDO : DWORD = 0x1000000;
1829 pub static MEM_LARGE_PAGES : DWORD = 0x20000000;
1830 pub static MEM_PHYSICAL : DWORD = 0x00400000;
1831 pub static MEM_TOP_DOWN : DWORD = 0x00100000;
1832 pub static MEM_WRITE_WATCH : DWORD = 0x00200000;
1834 pub static PAGE_EXECUTE : DWORD = 0x10;
1835 pub static PAGE_EXECUTE_READ : DWORD = 0x20;
1836 pub static PAGE_EXECUTE_READWRITE : DWORD = 0x40;
1837 pub static PAGE_EXECUTE_WRITECOPY : DWORD = 0x80;
1838 pub static PAGE_NOACCESS : DWORD = 0x01;
1839 pub static PAGE_READONLY : DWORD = 0x02;
1840 pub static PAGE_READWRITE : DWORD = 0x04;
1841 pub static PAGE_WRITECOPY : DWORD = 0x08;
1842 pub static PAGE_GUARD : DWORD = 0x100;
1843 pub static PAGE_NOCACHE : DWORD = 0x200;
1844 pub static PAGE_WRITECOMBINE : DWORD = 0x400;
1846 pub static SEC_COMMIT : DWORD = 0x8000000;
1847 pub static SEC_IMAGE : DWORD = 0x1000000;
1848 pub static SEC_IMAGE_NO_EXECUTE : DWORD = 0x11000000;
1849 pub static SEC_LARGE_PAGES : DWORD = 0x80000000;
1850 pub static SEC_NOCACHE : DWORD = 0x10000000;
1851 pub static SEC_RESERVE : DWORD = 0x4000000;
1852 pub static SEC_WRITECOMBINE : DWORD = 0x40000000;
1854 pub static FILE_MAP_ALL_ACCESS : DWORD = 0xf001f;
1855 pub static FILE_MAP_READ : DWORD = 0x4;
1856 pub static FILE_MAP_WRITE : DWORD = 0x2;
1857 pub static FILE_MAP_COPY : DWORD = 0x1;
1858 pub static FILE_MAP_EXECUTE : DWORD = 0x20;
1860 pub static PROCESSOR_ARCHITECTURE_INTEL : WORD = 0;
1861 pub static PROCESSOR_ARCHITECTURE_ARM : WORD = 5;
1862 pub static PROCESSOR_ARCHITECTURE_IA64 : WORD = 6;
1863 pub static PROCESSOR_ARCHITECTURE_AMD64 : WORD = 9;
1864 pub static PROCESSOR_ARCHITECTURE_UNKNOWN : WORD = 0xffff;
1866 pub static MOVEFILE_COPY_ALLOWED: DWORD = 2;
1867 pub static MOVEFILE_CREATE_HARDLINK: DWORD = 16;
1868 pub static MOVEFILE_DELAY_UNTIL_REBOOT: DWORD = 4;
1869 pub static MOVEFILE_FAIL_IF_NOT_TRACKABLE: DWORD = 32;
1870 pub static MOVEFILE_REPLACE_EXISTING: DWORD = 1;
1871 pub static MOVEFILE_WRITE_THROUGH: DWORD = 8;
1873 pub static SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 1;
1875 pub static FILE_SHARE_DELETE: DWORD = 0x4;
1876 pub static FILE_SHARE_READ: DWORD = 0x1;
1877 pub static FILE_SHARE_WRITE: DWORD = 0x2;
1879 pub static CREATE_ALWAYS: DWORD = 2;
1880 pub static CREATE_NEW: DWORD = 1;
1881 pub static OPEN_ALWAYS: DWORD = 4;
1882 pub static OPEN_EXISTING: DWORD = 3;
1883 pub static TRUNCATE_EXISTING: DWORD = 5;
1885 pub static FILE_APPEND_DATA: DWORD = 0x00000004;
1886 pub static FILE_READ_DATA: DWORD = 0x00000001;
1887 pub static FILE_WRITE_DATA: DWORD = 0x00000002;
1889 pub static FILE_ATTRIBUTE_ARCHIVE: DWORD = 0x20;
1890 pub static FILE_ATTRIBUTE_COMPRESSED: DWORD = 0x800;
1891 pub static FILE_ATTRIBUTE_DEVICE: DWORD = 0x40;
1892 pub static FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x10;
1893 pub static FILE_ATTRIBUTE_ENCRYPTED: DWORD = 0x4000;
1894 pub static FILE_ATTRIBUTE_HIDDEN: DWORD = 0x2;
1895 pub static FILE_ATTRIBUTE_INTEGRITY_STREAM: DWORD = 0x8000;
1896 pub static FILE_ATTRIBUTE_NORMAL: DWORD = 0x80;
1897 pub static FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: DWORD = 0x2000;
1898 pub static FILE_ATTRIBUTE_NO_SCRUB_DATA: DWORD = 0x20000;
1899 pub static FILE_ATTRIBUTE_OFFLINE: DWORD = 0x1000;
1900 pub static FILE_ATTRIBUTE_READONLY: DWORD = 0x1;
1901 pub static FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x400;
1902 pub static FILE_ATTRIBUTE_SPARSE_FILE: DWORD = 0x200;
1903 pub static FILE_ATTRIBUTE_SYSTEM: DWORD = 0x4;
1904 pub static FILE_ATTRIBUTE_TEMPORARY: DWORD = 0x100;
1905 pub static FILE_ATTRIBUTE_VIRTUAL: DWORD = 0x10000;
1907 pub static FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
1908 pub static FILE_FLAG_DELETE_ON_CLOSE: DWORD = 0x04000000;
1909 pub static FILE_FLAG_NO_BUFFERING: DWORD = 0x20000000;
1910 pub static FILE_FLAG_OPEN_NO_RECALL: DWORD = 0x00100000;
1911 pub static FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
1912 pub static FILE_FLAG_OVERLAPPED: DWORD = 0x40000000;
1913 pub static FILE_FLAG_POSIX_SEMANTICS: DWORD = 0x0100000;
1914 pub static FILE_FLAG_RANDOM_ACCESS: DWORD = 0x10000000;
1915 pub static FILE_FLAG_SESSION_AWARE: DWORD = 0x00800000;
1916 pub static FILE_FLAG_SEQUENTIAL_SCAN: DWORD = 0x08000000;
1917 pub static FILE_FLAG_WRITE_THROUGH: DWORD = 0x80000000;
1918 pub static FILE_FLAG_FIRST_PIPE_INSTANCE: DWORD = 0x00080000;
1920 pub static FILE_NAME_NORMALIZED: DWORD = 0x0;
1921 pub static FILE_NAME_OPENED: DWORD = 0x8;
1923 pub static VOLUME_NAME_DOS: DWORD = 0x0;
1924 pub static VOLUME_NAME_GUID: DWORD = 0x1;
1925 pub static VOLUME_NAME_NONE: DWORD = 0x4;
1926 pub static VOLUME_NAME_NT: DWORD = 0x2;
1928 pub static GENERIC_READ: DWORD = 0x80000000;
1929 pub static GENERIC_WRITE: DWORD = 0x40000000;
1930 pub static GENERIC_EXECUTE: DWORD = 0x20000000;
1931 pub static GENERIC_ALL: DWORD = 0x10000000;
1932 pub static FILE_WRITE_ATTRIBUTES: DWORD = 0x00000100;
1933 pub static FILE_READ_ATTRIBUTES: DWORD = 0x00000080;
1935 pub static STANDARD_RIGHTS_READ: DWORD = 0x20000;
1936 pub static STANDARD_RIGHTS_WRITE: DWORD = 0x20000;
1937 pub static FILE_WRITE_EA: DWORD = 0x00000010;
1938 pub static FILE_READ_EA: DWORD = 0x00000008;
1939 pub static FILE_GENERIC_READ: DWORD =
1940 STANDARD_RIGHTS_READ | FILE_READ_DATA |
1941 FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE;
1942 pub static FILE_GENERIC_WRITE: DWORD =
1943 STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA |
1944 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA |
1947 pub static FILE_BEGIN: DWORD = 0;
1948 pub static FILE_CURRENT: DWORD = 1;
1949 pub static FILE_END: DWORD = 2;
1951 pub static MAX_PROTOCOL_CHAIN: DWORD = 7;
1952 pub static WSAPROTOCOL_LEN: DWORD = 255;
1953 pub static INVALID_SOCKET: DWORD = !0;
1955 pub static DETACHED_PROCESS: DWORD = 0x00000008;
1956 pub static CREATE_NEW_PROCESS_GROUP: DWORD = 0x00000200;
1957 pub static CREATE_UNICODE_ENVIRONMENT: DWORD = 0x00000400;
1959 pub static PIPE_ACCESS_DUPLEX: DWORD = 0x00000003;
1960 pub static PIPE_ACCESS_INBOUND: DWORD = 0x00000001;
1961 pub static PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002;
1962 pub static PIPE_TYPE_BYTE: DWORD = 0x00000000;
1963 pub static PIPE_TYPE_MESSAGE: DWORD = 0x00000004;
1964 pub static PIPE_READMODE_BYTE: DWORD = 0x00000000;
1965 pub static PIPE_READMODE_MESSAGE: DWORD = 0x00000002;
1966 pub static PIPE_WAIT: DWORD = 0x00000000;
1967 pub static PIPE_NOWAIT: DWORD = 0x00000001;
1968 pub static PIPE_ACCEPT_REMOTE_CLIENTS: DWORD = 0x00000000;
1969 pub static PIPE_REJECT_REMOTE_CLIENTS: DWORD = 0x00000008;
1970 pub static PIPE_UNLIMITED_INSTANCES: DWORD = 255;
1977 #[cfg(target_os = "linux")]
1978 #[cfg(target_os = "android")]
1981 use types::os::arch::c95::{c_int, c_uint};
1983 pub static EXIT_FAILURE : c_int = 1;
1984 pub static EXIT_SUCCESS : c_int = 0;
1985 pub static RAND_MAX : c_int = 2147483647;
1986 pub static EOF : c_int = -1;
1987 pub static SEEK_SET : c_int = 0;
1988 pub static SEEK_CUR : c_int = 1;
1989 pub static SEEK_END : c_int = 2;
1990 pub static _IOFBF : c_int = 0;
1991 pub static _IONBF : c_int = 2;
1992 pub static _IOLBF : c_int = 1;
1993 pub static BUFSIZ : c_uint = 8192_u32;
1994 pub static FOPEN_MAX : c_uint = 16_u32;
1995 pub static FILENAME_MAX : c_uint = 4096_u32;
1996 pub static L_tmpnam : c_uint = 20_u32;
1997 pub static TMP_MAX : c_uint = 238328_u32;
2001 #[cfg(target_arch = "x86")]
2002 #[cfg(target_arch = "x86_64")]
2003 #[cfg(target_arch = "arm")]
2005 use types::os::arch::c95::c_int;
2006 use types::common::c95::c_void;
2008 pub static O_RDONLY : c_int = 0;
2009 pub static O_WRONLY : c_int = 1;
2010 pub static O_RDWR : c_int = 2;
2011 pub static O_APPEND : c_int = 1024;
2012 pub static O_CREAT : c_int = 64;
2013 pub static O_EXCL : c_int = 128;
2014 pub static O_TRUNC : c_int = 512;
2015 pub static S_IFIFO : c_int = 4096;
2016 pub static S_IFCHR : c_int = 8192;
2017 pub static S_IFBLK : c_int = 24576;
2018 pub static S_IFDIR : c_int = 16384;
2019 pub static S_IFREG : c_int = 32768;
2020 pub static S_IFLNK : c_int = 40960;
2021 pub static S_IFMT : c_int = 61440;
2022 pub static S_IEXEC : c_int = 64;
2023 pub static S_IWRITE : c_int = 128;
2024 pub static S_IREAD : c_int = 256;
2025 pub static S_IRWXU : c_int = 448;
2026 pub static S_IXUSR : c_int = 64;
2027 pub static S_IWUSR : c_int = 128;
2028 pub static S_IRUSR : c_int = 256;
2029 pub static F_OK : c_int = 0;
2030 pub static R_OK : c_int = 4;
2031 pub static W_OK : c_int = 2;
2032 pub static X_OK : c_int = 1;
2033 pub static STDIN_FILENO : c_int = 0;
2034 pub static STDOUT_FILENO : c_int = 1;
2035 pub static STDERR_FILENO : c_int = 2;
2036 pub static F_LOCK : c_int = 1;
2037 pub static F_TEST : c_int = 3;
2038 pub static F_TLOCK : c_int = 2;
2039 pub static F_ULOCK : c_int = 0;
2040 pub static SIGHUP : c_int = 1;
2041 pub static SIGINT : c_int = 2;
2042 pub static SIGQUIT : c_int = 3;
2043 pub static SIGILL : c_int = 4;
2044 pub static SIGABRT : c_int = 6;
2045 pub static SIGFPE : c_int = 8;
2046 pub static SIGKILL : c_int = 9;
2047 pub static SIGSEGV : c_int = 11;
2048 pub static SIGPIPE : c_int = 13;
2049 pub static SIGALRM : c_int = 14;
2050 pub static SIGTERM : c_int = 15;
2052 pub static PROT_NONE : c_int = 0;
2053 pub static PROT_READ : c_int = 1;
2054 pub static PROT_WRITE : c_int = 2;
2055 pub static PROT_EXEC : c_int = 4;
2057 pub static MAP_FILE : c_int = 0x0000;
2058 pub static MAP_SHARED : c_int = 0x0001;
2059 pub static MAP_PRIVATE : c_int = 0x0002;
2060 pub static MAP_FIXED : c_int = 0x0010;
2061 pub static MAP_ANON : c_int = 0x0020;
2063 pub static MAP_FAILED : *mut c_void = -1 as *mut c_void;
2065 pub static MCL_CURRENT : c_int = 0x0001;
2066 pub static MCL_FUTURE : c_int = 0x0002;
2068 pub static MS_ASYNC : c_int = 0x0001;
2069 pub static MS_INVALIDATE : c_int = 0x0002;
2070 pub static MS_SYNC : c_int = 0x0004;
2072 pub static EPERM : c_int = 1;
2073 pub static ENOENT : c_int = 2;
2074 pub static ESRCH : c_int = 3;
2075 pub static EINTR : c_int = 4;
2076 pub static EIO : c_int = 5;
2077 pub static ENXIO : c_int = 6;
2078 pub static E2BIG : c_int = 7;
2079 pub static ENOEXEC : c_int = 8;
2080 pub static EBADF : c_int = 9;
2081 pub static ECHILD : c_int = 10;
2082 pub static EAGAIN : c_int = 11;
2083 pub static ENOMEM : c_int = 12;
2084 pub static EACCES : c_int = 13;
2085 pub static EFAULT : c_int = 14;
2086 pub static ENOTBLK : c_int = 15;
2087 pub static EBUSY : c_int = 16;
2088 pub static EEXIST : c_int = 17;
2089 pub static EXDEV : c_int = 18;
2090 pub static ENODEV : c_int = 19;
2091 pub static ENOTDIR : c_int = 20;
2092 pub static EISDIR : c_int = 21;
2093 pub static EINVAL : c_int = 22;
2094 pub static ENFILE : c_int = 23;
2095 pub static EMFILE : c_int = 24;
2096 pub static ENOTTY : c_int = 25;
2097 pub static ETXTBSY : c_int = 26;
2098 pub static EFBIG : c_int = 27;
2099 pub static ENOSPC : c_int = 28;
2100 pub static ESPIPE : c_int = 29;
2101 pub static EROFS : c_int = 30;
2102 pub static EMLINK : c_int = 31;
2103 pub static EPIPE : c_int = 32;
2104 pub static EDOM : c_int = 33;
2105 pub static ERANGE : c_int = 34;
2107 pub static EDEADLK: c_int = 35;
2108 pub static ENAMETOOLONG: c_int = 36;
2109 pub static ENOLCK: c_int = 37;
2110 pub static ENOSYS: c_int = 38;
2111 pub static ENOTEMPTY: c_int = 39;
2112 pub static ELOOP: c_int = 40;
2113 pub static EWOULDBLOCK: c_int = EAGAIN;
2114 pub static ENOMSG: c_int = 42;
2115 pub static EIDRM: c_int = 43;
2116 pub static ECHRNG: c_int = 44;
2117 pub static EL2NSYNC: c_int = 45;
2118 pub static EL3HLT: c_int = 46;
2119 pub static EL3RST: c_int = 47;
2120 pub static ELNRNG: c_int = 48;
2121 pub static EUNATCH: c_int = 49;
2122 pub static ENOCSI: c_int = 50;
2123 pub static EL2HLT: c_int = 51;
2124 pub static EBADE: c_int = 52;
2125 pub static EBADR: c_int = 53;
2126 pub static EXFULL: c_int = 54;
2127 pub static ENOANO: c_int = 55;
2128 pub static EBADRQC: c_int = 56;
2129 pub static EBADSLT: c_int = 57;
2131 pub static EDEADLOCK: c_int = EDEADLK;
2133 pub static EBFONT: c_int = 59;
2134 pub static ENOSTR: c_int = 60;
2135 pub static ENODATA: c_int = 61;
2136 pub static ETIME: c_int = 62;
2137 pub static ENOSR: c_int = 63;
2138 pub static ENONET: c_int = 64;
2139 pub static ENOPKG: c_int = 65;
2140 pub static EREMOTE: c_int = 66;
2141 pub static ENOLINK: c_int = 67;
2142 pub static EADV: c_int = 68;
2143 pub static ESRMNT: c_int = 69;
2144 pub static ECOMM: c_int = 70;
2145 pub static EPROTO: c_int = 71;
2146 pub static EMULTIHOP: c_int = 72;
2147 pub static EDOTDOT: c_int = 73;
2148 pub static EBADMSG: c_int = 74;
2149 pub static EOVERFLOW: c_int = 75;
2150 pub static ENOTUNIQ: c_int = 76;
2151 pub static EBADFD: c_int = 77;
2152 pub static EREMCHG: c_int = 78;
2153 pub static ELIBACC: c_int = 79;
2154 pub static ELIBBAD: c_int = 80;
2155 pub static ELIBSCN: c_int = 81;
2156 pub static ELIBMAX: c_int = 82;
2157 pub static ELIBEXEC: c_int = 83;
2158 pub static EILSEQ: c_int = 84;
2159 pub static ERESTART: c_int = 85;
2160 pub static ESTRPIPE: c_int = 86;
2161 pub static EUSERS: c_int = 87;
2162 pub static ENOTSOCK: c_int = 88;
2163 pub static EDESTADDRREQ: c_int = 89;
2164 pub static EMSGSIZE: c_int = 90;
2165 pub static EPROTOTYPE: c_int = 91;
2166 pub static ENOPROTOOPT: c_int = 92;
2167 pub static EPROTONOSUPPORT: c_int = 93;
2168 pub static ESOCKTNOSUPPORT: c_int = 94;
2169 pub static EOPNOTSUPP: c_int = 95;
2170 pub static EPFNOSUPPORT: c_int = 96;
2171 pub static EAFNOSUPPORT: c_int = 97;
2172 pub static EADDRINUSE: c_int = 98;
2173 pub static EADDRNOTAVAIL: c_int = 99;
2174 pub static ENETDOWN: c_int = 100;
2175 pub static ENETUNREACH: c_int = 101;
2176 pub static ENETRESET: c_int = 102;
2177 pub static ECONNABORTED: c_int = 103;
2178 pub static ECONNRESET: c_int = 104;
2179 pub static ENOBUFS: c_int = 105;
2180 pub static EISCONN: c_int = 106;
2181 pub static ENOTCONN: c_int = 107;
2182 pub static ESHUTDOWN: c_int = 108;
2183 pub static ETOOMANYREFS: c_int = 109;
2184 pub static ETIMEDOUT: c_int = 110;
2185 pub static ECONNREFUSED: c_int = 111;
2186 pub static EHOSTDOWN: c_int = 112;
2187 pub static EHOSTUNREACH: c_int = 113;
2188 pub static EALREADY: c_int = 114;
2189 pub static EINPROGRESS: c_int = 115;
2190 pub static ESTALE: c_int = 116;
2191 pub static EUCLEAN: c_int = 117;
2192 pub static ENOTNAM: c_int = 118;
2193 pub static ENAVAIL: c_int = 119;
2194 pub static EISNAM: c_int = 120;
2195 pub static EREMOTEIO: c_int = 121;
2196 pub static EDQUOT: c_int = 122;
2198 pub static ENOMEDIUM: c_int = 123;
2199 pub static EMEDIUMTYPE: c_int = 124;
2200 pub static ECANCELED: c_int = 125;
2201 pub static ENOKEY: c_int = 126;
2202 pub static EKEYEXPIRED: c_int = 127;
2203 pub static EKEYREVOKED: c_int = 128;
2204 pub static EKEYREJECTED: c_int = 129;
2206 pub static EOWNERDEAD: c_int = 130;
2207 pub static ENOTRECOVERABLE: c_int = 131;
2209 pub static ERFKILL: c_int = 132;
2211 pub static EHWPOISON: c_int = 133;
2214 #[cfg(target_arch = "mips")]
2215 #[cfg(target_arch = "mipsel")]
2217 use types::os::arch::c95::c_int;
2218 use types::common::c95::c_void;
2220 pub static O_RDONLY : c_int = 0;
2221 pub static O_WRONLY : c_int = 1;
2222 pub static O_RDWR : c_int = 2;
2223 pub static O_APPEND : c_int = 8;
2224 pub static O_CREAT : c_int = 256;
2225 pub static O_EXCL : c_int = 1024;
2226 pub static O_TRUNC : c_int = 512;
2227 pub static S_IFIFO : c_int = 4096;
2228 pub static S_IFCHR : c_int = 8192;
2229 pub static S_IFBLK : c_int = 24576;
2230 pub static S_IFDIR : c_int = 16384;
2231 pub static S_IFREG : c_int = 32768;
2232 pub static S_IFLNK : c_int = 40960;
2233 pub static S_IFMT : c_int = 61440;
2234 pub static S_IEXEC : c_int = 64;
2235 pub static S_IWRITE : c_int = 128;
2236 pub static S_IREAD : c_int = 256;
2237 pub static S_IRWXU : c_int = 448;
2238 pub static S_IXUSR : c_int = 64;
2239 pub static S_IWUSR : c_int = 128;
2240 pub static S_IRUSR : c_int = 256;
2241 pub static F_OK : c_int = 0;
2242 pub static R_OK : c_int = 4;
2243 pub static W_OK : c_int = 2;
2244 pub static X_OK : c_int = 1;
2245 pub static STDIN_FILENO : c_int = 0;
2246 pub static STDOUT_FILENO : c_int = 1;
2247 pub static STDERR_FILENO : c_int = 2;
2248 pub static F_LOCK : c_int = 1;
2249 pub static F_TEST : c_int = 3;
2250 pub static F_TLOCK : c_int = 2;
2251 pub static F_ULOCK : c_int = 0;
2252 pub static SIGHUP : c_int = 1;
2253 pub static SIGINT : c_int = 2;
2254 pub static SIGQUIT : c_int = 3;
2255 pub static SIGILL : c_int = 4;
2256 pub static SIGABRT : c_int = 6;
2257 pub static SIGFPE : c_int = 8;
2258 pub static SIGKILL : c_int = 9;
2259 pub static SIGSEGV : c_int = 11;
2260 pub static SIGPIPE : c_int = 13;
2261 pub static SIGALRM : c_int = 14;
2262 pub static SIGTERM : c_int = 15;
2264 pub static PROT_NONE : c_int = 0;
2265 pub static PROT_READ : c_int = 1;
2266 pub static PROT_WRITE : c_int = 2;
2267 pub static PROT_EXEC : c_int = 4;
2269 pub static MAP_FILE : c_int = 0x0000;
2270 pub static MAP_SHARED : c_int = 0x0001;
2271 pub static MAP_PRIVATE : c_int = 0x0002;
2272 pub static MAP_FIXED : c_int = 0x0010;
2273 pub static MAP_ANON : c_int = 0x0800;
2275 pub static MAP_FAILED : *mut c_void = -1 as *mut c_void;
2277 pub static MCL_CURRENT : c_int = 0x0001;
2278 pub static MCL_FUTURE : c_int = 0x0002;
2280 pub static MS_ASYNC : c_int = 0x0001;
2281 pub static MS_INVALIDATE : c_int = 0x0002;
2282 pub static MS_SYNC : c_int = 0x0004;
2284 pub static EPERM : c_int = 1;
2285 pub static ENOENT : c_int = 2;
2286 pub static ESRCH : c_int = 3;
2287 pub static EINTR : c_int = 4;
2288 pub static EIO : c_int = 5;
2289 pub static ENXIO : c_int = 6;
2290 pub static E2BIG : c_int = 7;
2291 pub static ENOEXEC : c_int = 8;
2292 pub static EBADF : c_int = 9;
2293 pub static ECHILD : c_int = 10;
2294 pub static EAGAIN : c_int = 11;
2295 pub static ENOMEM : c_int = 12;
2296 pub static EACCES : c_int = 13;
2297 pub static EFAULT : c_int = 14;
2298 pub static ENOTBLK : c_int = 15;
2299 pub static EBUSY : c_int = 16;
2300 pub static EEXIST : c_int = 17;
2301 pub static EXDEV : c_int = 18;
2302 pub static ENODEV : c_int = 19;
2303 pub static ENOTDIR : c_int = 20;
2304 pub static EISDIR : c_int = 21;
2305 pub static EINVAL : c_int = 22;
2306 pub static ENFILE : c_int = 23;
2307 pub static EMFILE : c_int = 24;
2308 pub static ENOTTY : c_int = 25;
2309 pub static ETXTBSY : c_int = 26;
2310 pub static EFBIG : c_int = 27;
2311 pub static ENOSPC : c_int = 28;
2312 pub static ESPIPE : c_int = 29;
2313 pub static EROFS : c_int = 30;
2314 pub static EMLINK : c_int = 31;
2315 pub static EPIPE : c_int = 32;
2316 pub static EDOM : c_int = 33;
2317 pub static ERANGE : c_int = 34;
2319 pub static ENOMSG: c_int = 35;
2320 pub static EIDRM: c_int = 36;
2321 pub static ECHRNG: c_int = 37;
2322 pub static EL2NSYNC: c_int = 38;
2323 pub static EL3HLT: c_int = 39;
2324 pub static EL3RST: c_int = 40;
2325 pub static ELNRNG: c_int = 41;
2326 pub static EUNATCH: c_int = 42;
2327 pub static ENOCSI: c_int = 43;
2328 pub static EL2HLT: c_int = 44;
2329 pub static EDEADLK: c_int = 45;
2330 pub static ENOLCK: c_int = 46;
2331 pub static EBADE: c_int = 50;
2332 pub static EBADR: c_int = 51;
2333 pub static EXFULL: c_int = 52;
2334 pub static ENOANO: c_int = 53;
2335 pub static EBADRQC: c_int = 54;
2336 pub static EBADSLT: c_int = 55;
2337 pub static EDEADLOCK: c_int = 56;
2338 pub static EBFONT: c_int = 59;
2339 pub static ENOSTR: c_int = 60;
2340 pub static ENODATA: c_int = 61;
2341 pub static ETIME: c_int = 62;
2342 pub static ENOSR: c_int = 63;
2343 pub static ENONET: c_int = 64;
2344 pub static ENOPKG: c_int = 65;
2345 pub static EREMOTE: c_int = 66;
2346 pub static ENOLINK: c_int = 67;
2347 pub static EADV: c_int = 68;
2348 pub static ESRMNT: c_int = 69;
2349 pub static ECOMM: c_int = 70;
2350 pub static EPROTO: c_int = 71;
2351 pub static EDOTDOT: c_int = 73;
2352 pub static EMULTIHOP: c_int = 74;
2353 pub static EBADMSG: c_int = 77;
2354 pub static ENAMETOOLONG: c_int = 78;
2355 pub static EOVERFLOW: c_int = 79;
2356 pub static ENOTUNIQ: c_int = 80;
2357 pub static EBADFD: c_int = 81;
2358 pub static EREMCHG: c_int = 82;
2359 pub static ELIBACC: c_int = 83;
2360 pub static ELIBBAD: c_int = 84;
2361 pub static ELIBSCN: c_int = 95;
2362 pub static ELIBMAX: c_int = 86;
2363 pub static ELIBEXEC: c_int = 87;
2364 pub static EILSEQ: c_int = 88;
2365 pub static ENOSYS: c_int = 89;
2366 pub static ELOOP: c_int = 90;
2367 pub static ERESTART: c_int = 91;
2368 pub static ESTRPIPE: c_int = 92;
2369 pub static ENOTEMPTY: c_int = 93;
2370 pub static EUSERS: c_int = 94;
2371 pub static ENOTSOCK: c_int = 95;
2372 pub static EDESTADDRREQ: c_int = 96;
2373 pub static EMSGSIZE: c_int = 97;
2374 pub static EPROTOTYPE: c_int = 98;
2375 pub static ENOPROTOOPT: c_int = 99;
2376 pub static EPROTONOSUPPORT: c_int = 120;
2377 pub static ESOCKTNOSUPPORT: c_int = 121;
2378 pub static EOPNOTSUPP: c_int = 122;
2379 pub static EPFNOSUPPORT: c_int = 123;
2380 pub static EAFNOSUPPORT: c_int = 124;
2381 pub static EADDRINUSE: c_int = 125;
2382 pub static EADDRNOTAVAIL: c_int = 126;
2383 pub static ENETDOWN: c_int = 127;
2384 pub static ENETUNREACH: c_int = 128;
2385 pub static ENETRESET: c_int = 129;
2386 pub static ECONNABORTED: c_int = 130;
2387 pub static ECONNRESET: c_int = 131;
2388 pub static ENOBUFS: c_int = 132;
2389 pub static EISCONN: c_int = 133;
2390 pub static ENOTCONN: c_int = 134;
2391 pub static EUCLEAN: c_int = 135;
2392 pub static ENOTNAM: c_int = 137;
2393 pub static ENAVAIL: c_int = 138;
2394 pub static EISNAM: c_int = 139;
2395 pub static EREMOTEIO: c_int = 140;
2396 pub static ESHUTDOWN: c_int = 143;
2397 pub static ETOOMANYREFS: c_int = 144;
2398 pub static ETIMEDOUT: c_int = 145;
2399 pub static ECONNREFUSED: c_int = 146;
2400 pub static EHOSTDOWN: c_int = 147;
2401 pub static EHOSTUNREACH: c_int = 148;
2402 pub static EWOULDBLOCK: c_int = EAGAIN;
2403 pub static EALREADY: c_int = 149;
2404 pub static EINPROGRESS: c_int = 150;
2405 pub static ESTALE: c_int = 151;
2406 pub static ECANCELED: c_int = 158;
2408 pub static ENOMEDIUM: c_int = 159;
2409 pub static EMEDIUMTYPE: c_int = 160;
2410 pub static ENOKEY: c_int = 161;
2411 pub static EKEYEXPIRED: c_int = 162;
2412 pub static EKEYREVOKED: c_int = 163;
2413 pub static EKEYREJECTED: c_int = 164;
2415 pub static EOWNERDEAD: c_int = 165;
2416 pub static ENOTRECOVERABLE: c_int = 166;
2418 pub static ERFKILL: c_int = 167;
2420 pub static EHWPOISON: c_int = 168;
2422 pub static EDQUOT: c_int = 1133;
2425 use types::os::arch::c95::{c_int, size_t};
2427 pub static SIGTRAP : c_int = 5;
2428 pub static SIGPIPE: c_int = 13;
2429 pub static SIG_IGN: size_t = 1;
2431 pub static GLOB_ERR : c_int = 1 << 0;
2432 pub static GLOB_MARK : c_int = 1 << 1;
2433 pub static GLOB_NOSORT : c_int = 1 << 2;
2434 pub static GLOB_DOOFFS : c_int = 1 << 3;
2435 pub static GLOB_NOCHECK : c_int = 1 << 4;
2436 pub static GLOB_APPEND : c_int = 1 << 5;
2437 pub static GLOB_NOESCAPE : c_int = 1 << 6;
2439 pub static GLOB_NOSPACE : c_int = 1;
2440 pub static GLOB_ABORTED : c_int = 2;
2441 pub static GLOB_NOMATCH : c_int = 3;
2443 pub static POSIX_MADV_NORMAL : c_int = 0;
2444 pub static POSIX_MADV_RANDOM : c_int = 1;
2445 pub static POSIX_MADV_SEQUENTIAL : c_int = 2;
2446 pub static POSIX_MADV_WILLNEED : c_int = 3;
2447 pub static POSIX_MADV_DONTNEED : c_int = 4;
2449 pub static _SC_MQ_PRIO_MAX : c_int = 28;
2450 pub static _SC_IOV_MAX : c_int = 60;
2451 pub static _SC_GETGR_R_SIZE_MAX : c_int = 69;
2452 pub static _SC_GETPW_R_SIZE_MAX : c_int = 70;
2453 pub static _SC_LOGIN_NAME_MAX : c_int = 71;
2454 pub static _SC_TTY_NAME_MAX : c_int = 72;
2455 pub static _SC_THREADS : c_int = 67;
2456 pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 68;
2457 pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 73;
2458 pub static _SC_THREAD_KEYS_MAX : c_int = 74;
2459 pub static _SC_THREAD_STACK_MIN : c_int = 75;
2460 pub static _SC_THREAD_THREADS_MAX : c_int = 76;
2461 pub static _SC_THREAD_ATTR_STACKADDR : c_int = 77;
2462 pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 78;
2463 pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 79;
2464 pub static _SC_THREAD_PRIO_INHERIT : c_int = 80;
2465 pub static _SC_THREAD_PRIO_PROTECT : c_int = 81;
2466 pub static _SC_THREAD_PROCESS_SHARED : c_int = 82;
2467 pub static _SC_ATEXIT_MAX : c_int = 87;
2468 pub static _SC_XOPEN_VERSION : c_int = 89;
2469 pub static _SC_XOPEN_XCU_VERSION : c_int = 90;
2470 pub static _SC_XOPEN_UNIX : c_int = 91;
2471 pub static _SC_XOPEN_CRYPT : c_int = 92;
2472 pub static _SC_XOPEN_ENH_I18N : c_int = 93;
2473 pub static _SC_XOPEN_SHM : c_int = 94;
2474 pub static _SC_XOPEN_LEGACY : c_int = 129;
2475 pub static _SC_XOPEN_REALTIME : c_int = 130;
2476 pub static _SC_XOPEN_REALTIME_THREADS : c_int = 131;
2478 pub static PTHREAD_CREATE_JOINABLE: c_int = 0;
2479 pub static PTHREAD_CREATE_DETACHED: c_int = 1;
2481 #[cfg(target_os = "android")]
2482 pub static PTHREAD_STACK_MIN: size_t = 8192;
2484 #[cfg(target_arch = "arm", target_os = "linux")]
2485 #[cfg(target_arch = "x86", target_os = "linux")]
2486 #[cfg(target_arch = "x86_64", target_os = "linux")]
2487 pub static PTHREAD_STACK_MIN: size_t = 16384;
2489 #[cfg(target_arch = "mips", target_os = "linux")]
2490 #[cfg(target_arch = "mipsel", target_os = "linux")]
2491 pub static PTHREAD_STACK_MIN: size_t = 131072;
2493 pub static CLOCK_REALTIME: c_int = 0;
2494 pub static CLOCK_MONOTONIC: c_int = 1;
2498 #[cfg(target_arch = "arm")]
2499 #[cfg(target_arch = "x86")]
2500 #[cfg(target_arch = "x86_64")]
2502 use types::os::arch::c95::c_int;
2504 pub static MADV_NORMAL : c_int = 0;
2505 pub static MADV_RANDOM : c_int = 1;
2506 pub static MADV_SEQUENTIAL : c_int = 2;
2507 pub static MADV_WILLNEED : c_int = 3;
2508 pub static MADV_DONTNEED : c_int = 4;
2509 pub static MADV_REMOVE : c_int = 9;
2510 pub static MADV_DONTFORK : c_int = 10;
2511 pub static MADV_DOFORK : c_int = 11;
2512 pub static MADV_MERGEABLE : c_int = 12;
2513 pub static MADV_UNMERGEABLE : c_int = 13;
2514 pub static MADV_HWPOISON : c_int = 100;
2516 pub static AF_UNIX: c_int = 1;
2517 pub static AF_INET: c_int = 2;
2518 pub static AF_INET6: c_int = 10;
2519 pub static SOCK_STREAM: c_int = 1;
2520 pub static SOCK_DGRAM: c_int = 2;
2521 pub static IPPROTO_TCP: c_int = 6;
2522 pub static IPPROTO_IP: c_int = 0;
2523 pub static IPPROTO_IPV6: c_int = 41;
2524 pub static IP_MULTICAST_TTL: c_int = 33;
2525 pub static IP_MULTICAST_LOOP: c_int = 34;
2526 pub static IP_TTL: c_int = 2;
2527 pub static IP_ADD_MEMBERSHIP: c_int = 35;
2528 pub static IP_DROP_MEMBERSHIP: c_int = 36;
2529 pub static IPV6_ADD_MEMBERSHIP: c_int = 20;
2530 pub static IPV6_DROP_MEMBERSHIP: c_int = 21;
2532 pub static TCP_NODELAY: c_int = 1;
2533 pub static SOL_SOCKET: c_int = 1;
2534 pub static SO_KEEPALIVE: c_int = 9;
2535 pub static SO_BROADCAST: c_int = 6;
2536 pub static SO_REUSEADDR: c_int = 2;
2537 pub static SO_ERROR: c_int = 4;
2539 pub static SHUT_RD: c_int = 0;
2540 pub static SHUT_WR: c_int = 1;
2541 pub static SHUT_RDWR: c_int = 2;
2543 #[cfg(target_arch = "mips")]
2544 #[cfg(target_arch = "mipsel")]
2546 use types::os::arch::c95::c_int;
2548 pub static MADV_NORMAL : c_int = 0;
2549 pub static MADV_RANDOM : c_int = 1;
2550 pub static MADV_SEQUENTIAL : c_int = 2;
2551 pub static MADV_WILLNEED : c_int = 3;
2552 pub static MADV_DONTNEED : c_int = 4;
2553 pub static MADV_REMOVE : c_int = 9;
2554 pub static MADV_DONTFORK : c_int = 10;
2555 pub static MADV_DOFORK : c_int = 11;
2556 pub static MADV_MERGEABLE : c_int = 12;
2557 pub static MADV_UNMERGEABLE : c_int = 13;
2558 pub static MADV_HWPOISON : c_int = 100;
2560 pub static AF_UNIX: c_int = 1;
2561 pub static AF_INET: c_int = 2;
2562 pub static AF_INET6: c_int = 10;
2563 pub static SOCK_STREAM: c_int = 2;
2564 pub static SOCK_DGRAM: c_int = 1;
2565 pub static IPPROTO_TCP: c_int = 6;
2566 pub static IPPROTO_IP: c_int = 0;
2567 pub static IPPROTO_IPV6: c_int = 41;
2568 pub static IP_MULTICAST_TTL: c_int = 33;
2569 pub static IP_MULTICAST_LOOP: c_int = 34;
2570 pub static IP_TTL: c_int = 2;
2571 pub static IP_ADD_MEMBERSHIP: c_int = 35;
2572 pub static IP_DROP_MEMBERSHIP: c_int = 36;
2573 pub static IPV6_ADD_MEMBERSHIP: c_int = 20;
2574 pub static IPV6_DROP_MEMBERSHIP: c_int = 21;
2576 pub static TCP_NODELAY: c_int = 1;
2577 pub static SOL_SOCKET: c_int = 65535;
2578 pub static SO_KEEPALIVE: c_int = 8;
2579 pub static SO_BROADCAST: c_int = 32;
2580 pub static SO_REUSEADDR: c_int = 4;
2581 pub static SO_ERROR: c_int = 4103;
2583 pub static SHUT_RD: c_int = 0;
2584 pub static SHUT_WR: c_int = 1;
2585 pub static SHUT_RDWR: c_int = 2;
2587 #[cfg(target_arch = "x86")]
2588 #[cfg(target_arch = "x86_64")]
2589 #[cfg(target_arch = "arm")]
2591 use types::os::arch::c95::c_int;
2593 pub static O_RSYNC : c_int = 1052672;
2594 pub static O_DSYNC : c_int = 4096;
2595 pub static O_SYNC : c_int = 1052672;
2597 pub static PROT_GROWSDOWN : c_int = 0x010000000;
2598 pub static PROT_GROWSUP : c_int = 0x020000000;
2600 pub static MAP_TYPE : c_int = 0x000f;
2601 pub static MAP_ANONYMOUS : c_int = 0x0020;
2602 pub static MAP_32BIT : c_int = 0x0040;
2603 pub static MAP_GROWSDOWN : c_int = 0x0100;
2604 pub static MAP_DENYWRITE : c_int = 0x0800;
2605 pub static MAP_EXECUTABLE : c_int = 0x01000;
2606 pub static MAP_LOCKED : c_int = 0x02000;
2607 pub static MAP_NONRESERVE : c_int = 0x04000;
2608 pub static MAP_POPULATE : c_int = 0x08000;
2609 pub static MAP_NONBLOCK : c_int = 0x010000;
2610 pub static MAP_STACK : c_int = 0x020000;
2612 #[cfg(target_arch = "mips")]
2613 #[cfg(target_arch = "mipsel")]
2615 use types::os::arch::c95::c_int;
2617 pub static O_RSYNC : c_int = 16400;
2618 pub static O_DSYNC : c_int = 16;
2619 pub static O_SYNC : c_int = 16400;
2621 pub static PROT_GROWSDOWN : c_int = 0x01000000;
2622 pub static PROT_GROWSUP : c_int = 0x02000000;
2624 pub static MAP_TYPE : c_int = 0x000f;
2625 pub static MAP_ANONYMOUS : c_int = 0x0800;
2626 pub static MAP_GROWSDOWN : c_int = 0x01000;
2627 pub static MAP_DENYWRITE : c_int = 0x02000;
2628 pub static MAP_EXECUTABLE : c_int = 0x04000;
2629 pub static MAP_LOCKED : c_int = 0x08000;
2630 pub static MAP_NONRESERVE : c_int = 0x0400;
2631 pub static MAP_POPULATE : c_int = 0x010000;
2632 pub static MAP_NONBLOCK : c_int = 0x020000;
2633 pub static MAP_STACK : c_int = 0x040000;
2635 #[cfg(target_os = "linux")]
2637 use types::os::arch::c95::c_int;
2639 pub static _SC_ARG_MAX : c_int = 0;
2640 pub static _SC_CHILD_MAX : c_int = 1;
2641 pub static _SC_CLK_TCK : c_int = 2;
2642 pub static _SC_NGROUPS_MAX : c_int = 3;
2643 pub static _SC_OPEN_MAX : c_int = 4;
2644 pub static _SC_STREAM_MAX : c_int = 5;
2645 pub static _SC_TZNAME_MAX : c_int = 6;
2646 pub static _SC_JOB_CONTROL : c_int = 7;
2647 pub static _SC_SAVED_IDS : c_int = 8;
2648 pub static _SC_REALTIME_SIGNALS : c_int = 9;
2649 pub static _SC_PRIORITY_SCHEDULING : c_int = 10;
2650 pub static _SC_TIMERS : c_int = 11;
2651 pub static _SC_ASYNCHRONOUS_IO : c_int = 12;
2652 pub static _SC_PRIORITIZED_IO : c_int = 13;
2653 pub static _SC_SYNCHRONIZED_IO : c_int = 14;
2654 pub static _SC_FSYNC : c_int = 15;
2655 pub static _SC_MAPPED_FILES : c_int = 16;
2656 pub static _SC_MEMLOCK : c_int = 17;
2657 pub static _SC_MEMLOCK_RANGE : c_int = 18;
2658 pub static _SC_MEMORY_PROTECTION : c_int = 19;
2659 pub static _SC_MESSAGE_PASSING : c_int = 20;
2660 pub static _SC_SEMAPHORES : c_int = 21;
2661 pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 22;
2662 pub static _SC_AIO_LISTIO_MAX : c_int = 23;
2663 pub static _SC_AIO_MAX : c_int = 24;
2664 pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 25;
2665 pub static _SC_DELAYTIMER_MAX : c_int = 26;
2666 pub static _SC_MQ_OPEN_MAX : c_int = 27;
2667 pub static _SC_VERSION : c_int = 29;
2668 pub static _SC_PAGESIZE : c_int = 30;
2669 pub static _SC_RTSIG_MAX : c_int = 31;
2670 pub static _SC_SEM_NSEMS_MAX : c_int = 32;
2671 pub static _SC_SEM_VALUE_MAX : c_int = 33;
2672 pub static _SC_SIGQUEUE_MAX : c_int = 34;
2673 pub static _SC_TIMER_MAX : c_int = 35;
2674 pub static _SC_BC_BASE_MAX : c_int = 36;
2675 pub static _SC_BC_DIM_MAX : c_int = 37;
2676 pub static _SC_BC_SCALE_MAX : c_int = 38;
2677 pub static _SC_BC_STRING_MAX : c_int = 39;
2678 pub static _SC_COLL_WEIGHTS_MAX : c_int = 40;
2679 pub static _SC_EXPR_NEST_MAX : c_int = 42;
2680 pub static _SC_LINE_MAX : c_int = 43;
2681 pub static _SC_RE_DUP_MAX : c_int = 44;
2682 pub static _SC_2_VERSION : c_int = 46;
2683 pub static _SC_2_C_BIND : c_int = 47;
2684 pub static _SC_2_C_DEV : c_int = 48;
2685 pub static _SC_2_FORT_DEV : c_int = 49;
2686 pub static _SC_2_FORT_RUN : c_int = 50;
2687 pub static _SC_2_SW_DEV : c_int = 51;
2688 pub static _SC_2_LOCALEDEF : c_int = 52;
2689 pub static _SC_2_CHAR_TERM : c_int = 95;
2690 pub static _SC_2_C_VERSION : c_int = 96;
2691 pub static _SC_2_UPE : c_int = 97;
2692 pub static _SC_XBS5_ILP32_OFF32 : c_int = 125;
2693 pub static _SC_XBS5_ILP32_OFFBIG : c_int = 126;
2694 pub static _SC_XBS5_LPBIG_OFFBIG : c_int = 128;
2696 #[cfg(target_os = "android")]
2698 use types::os::arch::c95::c_int;
2700 pub static _SC_ARG_MAX : c_int = 0;
2701 pub static _SC_BC_BASE_MAX : c_int = 1;
2702 pub static _SC_BC_DIM_MAX : c_int = 2;
2703 pub static _SC_BC_SCALE_MAX : c_int = 3;
2704 pub static _SC_BC_STRING_MAX : c_int = 4;
2705 pub static _SC_CHILD_MAX : c_int = 5;
2706 pub static _SC_CLK_TCK : c_int = 6;
2707 pub static _SC_COLL_WEIGHTS_MAX : c_int = 7;
2708 pub static _SC_EXPR_NEST_MAX : c_int = 8;
2709 pub static _SC_LINE_MAX : c_int = 9;
2710 pub static _SC_NGROUPS_MAX : c_int = 10;
2711 pub static _SC_OPEN_MAX : c_int = 11;
2712 pub static _SC_2_C_BIND : c_int = 13;
2713 pub static _SC_2_C_DEV : c_int = 14;
2714 pub static _SC_2_C_VERSION : c_int = 15;
2715 pub static _SC_2_CHAR_TERM : c_int = 16;
2716 pub static _SC_2_FORT_DEV : c_int = 17;
2717 pub static _SC_2_FORT_RUN : c_int = 18;
2718 pub static _SC_2_LOCALEDEF : c_int = 19;
2719 pub static _SC_2_SW_DEV : c_int = 20;
2720 pub static _SC_2_UPE : c_int = 21;
2721 pub static _SC_2_VERSION : c_int = 22;
2722 pub static _SC_JOB_CONTROL : c_int = 23;
2723 pub static _SC_SAVED_IDS : c_int = 24;
2724 pub static _SC_VERSION : c_int = 25;
2725 pub static _SC_RE_DUP_MAX : c_int = 26;
2726 pub static _SC_STREAM_MAX : c_int = 27;
2727 pub static _SC_TZNAME_MAX : c_int = 28;
2728 pub static _SC_PAGESIZE : c_int = 39;
2732 #[cfg(target_os = "freebsd")]
2735 use types::os::arch::c95::{c_int, c_uint};
2737 pub static EXIT_FAILURE : c_int = 1;
2738 pub static EXIT_SUCCESS : c_int = 0;
2739 pub static RAND_MAX : c_int = 2147483647;
2740 pub static EOF : c_int = -1;
2741 pub static SEEK_SET : c_int = 0;
2742 pub static SEEK_CUR : c_int = 1;
2743 pub static SEEK_END : c_int = 2;
2744 pub static _IOFBF : c_int = 0;
2745 pub static _IONBF : c_int = 2;
2746 pub static _IOLBF : c_int = 1;
2747 pub static BUFSIZ : c_uint = 1024_u32;
2748 pub static FOPEN_MAX : c_uint = 20_u32;
2749 pub static FILENAME_MAX : c_uint = 1024_u32;
2750 pub static L_tmpnam : c_uint = 1024_u32;
2751 pub static TMP_MAX : c_uint = 308915776_u32;
2756 use types::common::c95::c_void;
2757 use types::os::arch::c95::c_int;
2759 pub static O_RDONLY : c_int = 0;
2760 pub static O_WRONLY : c_int = 1;
2761 pub static O_RDWR : c_int = 2;
2762 pub static O_APPEND : c_int = 8;
2763 pub static O_CREAT : c_int = 512;
2764 pub static O_EXCL : c_int = 2048;
2765 pub static O_TRUNC : c_int = 1024;
2766 pub static S_IFIFO : c_int = 4096;
2767 pub static S_IFCHR : c_int = 8192;
2768 pub static S_IFBLK : c_int = 24576;
2769 pub static S_IFDIR : c_int = 16384;
2770 pub static S_IFREG : c_int = 32768;
2771 pub static S_IFLNK : c_int = 40960;
2772 pub static S_IFMT : c_int = 61440;
2773 pub static S_IEXEC : c_int = 64;
2774 pub static S_IWRITE : c_int = 128;
2775 pub static S_IREAD : c_int = 256;
2776 pub static S_IRWXU : c_int = 448;
2777 pub static S_IXUSR : c_int = 64;
2778 pub static S_IWUSR : c_int = 128;
2779 pub static S_IRUSR : c_int = 256;
2780 pub static F_OK : c_int = 0;
2781 pub static R_OK : c_int = 4;
2782 pub static W_OK : c_int = 2;
2783 pub static X_OK : c_int = 1;
2784 pub static STDIN_FILENO : c_int = 0;
2785 pub static STDOUT_FILENO : c_int = 1;
2786 pub static STDERR_FILENO : c_int = 2;
2787 pub static F_LOCK : c_int = 1;
2788 pub static F_TEST : c_int = 3;
2789 pub static F_TLOCK : c_int = 2;
2790 pub static F_ULOCK : c_int = 0;
2791 pub static SIGHUP : c_int = 1;
2792 pub static SIGINT : c_int = 2;
2793 pub static SIGQUIT : c_int = 3;
2794 pub static SIGILL : c_int = 4;
2795 pub static SIGABRT : c_int = 6;
2796 pub static SIGFPE : c_int = 8;
2797 pub static SIGKILL : c_int = 9;
2798 pub static SIGSEGV : c_int = 11;
2799 pub static SIGPIPE : c_int = 13;
2800 pub static SIGALRM : c_int = 14;
2801 pub static SIGTERM : c_int = 15;
2803 pub static PROT_NONE : c_int = 0;
2804 pub static PROT_READ : c_int = 1;
2805 pub static PROT_WRITE : c_int = 2;
2806 pub static PROT_EXEC : c_int = 4;
2808 pub static MAP_FILE : c_int = 0x0000;
2809 pub static MAP_SHARED : c_int = 0x0001;
2810 pub static MAP_PRIVATE : c_int = 0x0002;
2811 pub static MAP_FIXED : c_int = 0x0010;
2812 pub static MAP_ANON : c_int = 0x1000;
2814 pub static MAP_FAILED : *mut c_void = -1 as *mut c_void;
2816 pub static MCL_CURRENT : c_int = 0x0001;
2817 pub static MCL_FUTURE : c_int = 0x0002;
2819 pub static MS_SYNC : c_int = 0x0000;
2820 pub static MS_ASYNC : c_int = 0x0001;
2821 pub static MS_INVALIDATE : c_int = 0x0002;
2823 pub static EPERM : c_int = 1;
2824 pub static ENOENT : c_int = 2;
2825 pub static ESRCH : c_int = 3;
2826 pub static EINTR : c_int = 4;
2827 pub static EIO : c_int = 5;
2828 pub static ENXIO : c_int = 6;
2829 pub static E2BIG : c_int = 7;
2830 pub static ENOEXEC : c_int = 8;
2831 pub static EBADF : c_int = 9;
2832 pub static ECHILD : c_int = 10;
2833 pub static EDEADLK : c_int = 11;
2834 pub static ENOMEM : c_int = 12;
2835 pub static EACCES : c_int = 13;
2836 pub static EFAULT : c_int = 14;
2837 pub static ENOTBLK : c_int = 15;
2838 pub static EBUSY : c_int = 16;
2839 pub static EEXIST : c_int = 17;
2840 pub static EXDEV : c_int = 18;
2841 pub static ENODEV : c_int = 19;
2842 pub static ENOTDIR : c_int = 20;
2843 pub static EISDIR : c_int = 21;
2844 pub static EINVAL : c_int = 22;
2845 pub static ENFILE : c_int = 23;
2846 pub static EMFILE : c_int = 24;
2847 pub static ENOTTY : c_int = 25;
2848 pub static ETXTBSY : c_int = 26;
2849 pub static EFBIG : c_int = 27;
2850 pub static ENOSPC : c_int = 28;
2851 pub static ESPIPE : c_int = 29;
2852 pub static EROFS : c_int = 30;
2853 pub static EMLINK : c_int = 31;
2854 pub static EPIPE : c_int = 32;
2855 pub static EDOM : c_int = 33;
2856 pub static ERANGE : c_int = 34;
2857 pub static EAGAIN : c_int = 35;
2858 pub static EWOULDBLOCK : c_int = 35;
2859 pub static EINPROGRESS : c_int = 36;
2860 pub static EALREADY : c_int = 37;
2861 pub static ENOTSOCK : c_int = 38;
2862 pub static EDESTADDRREQ : c_int = 39;
2863 pub static EMSGSIZE : c_int = 40;
2864 pub static EPROTOTYPE : c_int = 41;
2865 pub static ENOPROTOOPT : c_int = 42;
2866 pub static EPROTONOSUPPORT : c_int = 43;
2867 pub static ESOCKTNOSUPPORT : c_int = 44;
2868 pub static EOPNOTSUPP : c_int = 45;
2869 pub static EPFNOSUPPORT : c_int = 46;
2870 pub static EAFNOSUPPORT : c_int = 47;
2871 pub static EADDRINUSE : c_int = 48;
2872 pub static EADDRNOTAVAIL : c_int = 49;
2873 pub static ENETDOWN : c_int = 50;
2874 pub static ENETUNREACH : c_int = 51;
2875 pub static ENETRESET : c_int = 52;
2876 pub static ECONNABORTED : c_int = 53;
2877 pub static ECONNRESET : c_int = 54;
2878 pub static ENOBUFS : c_int = 55;
2879 pub static EISCONN : c_int = 56;
2880 pub static ENOTCONN : c_int = 57;
2881 pub static ESHUTDOWN : c_int = 58;
2882 pub static ETOOMANYREFS : c_int = 59;
2883 pub static ETIMEDOUT : c_int = 60;
2884 pub static ECONNREFUSED : c_int = 61;
2885 pub static ELOOP : c_int = 62;
2886 pub static ENAMETOOLONG : c_int = 63;
2887 pub static EHOSTDOWN : c_int = 64;
2888 pub static EHOSTUNREACH : c_int = 65;
2889 pub static ENOTEMPTY : c_int = 66;
2890 pub static EPROCLIM : c_int = 67;
2891 pub static EUSERS : c_int = 68;
2892 pub static EDQUOT : c_int = 69;
2893 pub static ESTALE : c_int = 70;
2894 pub static EREMOTE : c_int = 71;
2895 pub static EBADRPC : c_int = 72;
2896 pub static ERPCMISMATCH : c_int = 73;
2897 pub static EPROGUNAVAIL : c_int = 74;
2898 pub static EPROGMISMATCH : c_int = 75;
2899 pub static EPROCUNAVAIL : c_int = 76;
2900 pub static ENOLCK : c_int = 77;
2901 pub static ENOSYS : c_int = 78;
2902 pub static EFTYPE : c_int = 79;
2903 pub static EAUTH : c_int = 80;
2904 pub static ENEEDAUTH : c_int = 81;
2905 pub static EIDRM : c_int = 82;
2906 pub static ENOMSG : c_int = 83;
2907 pub static EOVERFLOW : c_int = 84;
2908 pub static ECANCELED : c_int = 85;
2909 pub static EILSEQ : c_int = 86;
2910 pub static ENOATTR : c_int = 87;
2911 pub static EDOOFUS : c_int = 88;
2912 pub static EBADMSG : c_int = 89;
2913 pub static EMULTIHOP : c_int = 90;
2914 pub static ENOLINK : c_int = 91;
2915 pub static EPROTO : c_int = 92;
2916 pub static ENOMEDIUM : c_int = 93;
2917 pub static EUNUSED94 : c_int = 94;
2918 pub static EUNUSED95 : c_int = 95;
2919 pub static EUNUSED96 : c_int = 96;
2920 pub static EUNUSED97 : c_int = 97;
2921 pub static EUNUSED98 : c_int = 98;
2922 pub static EASYNC : c_int = 99;
2923 pub static ELAST : c_int = 99;
2926 use types::os::arch::c95::{c_int, size_t};
2928 pub static SIGTRAP : c_int = 5;
2929 pub static SIGPIPE: c_int = 13;
2930 pub static SIG_IGN: size_t = 1;
2932 pub static GLOB_APPEND : c_int = 0x0001;
2933 pub static GLOB_DOOFFS : c_int = 0x0002;
2934 pub static GLOB_ERR : c_int = 0x0004;
2935 pub static GLOB_MARK : c_int = 0x0008;
2936 pub static GLOB_NOCHECK : c_int = 0x0010;
2937 pub static GLOB_NOSORT : c_int = 0x0020;
2938 pub static GLOB_NOESCAPE : c_int = 0x2000;
2940 pub static GLOB_NOSPACE : c_int = -1;
2941 pub static GLOB_ABORTED : c_int = -2;
2942 pub static GLOB_NOMATCH : c_int = -3;
2944 pub static POSIX_MADV_NORMAL : c_int = 0;
2945 pub static POSIX_MADV_RANDOM : c_int = 1;
2946 pub static POSIX_MADV_SEQUENTIAL : c_int = 2;
2947 pub static POSIX_MADV_WILLNEED : c_int = 3;
2948 pub static POSIX_MADV_DONTNEED : c_int = 4;
2950 pub static _SC_IOV_MAX : c_int = 56;
2951 pub static _SC_GETGR_R_SIZE_MAX : c_int = 70;
2952 pub static _SC_GETPW_R_SIZE_MAX : c_int = 71;
2953 pub static _SC_LOGIN_NAME_MAX : c_int = 73;
2954 pub static _SC_MQ_PRIO_MAX : c_int = 75;
2955 pub static _SC_THREAD_ATTR_STACKADDR : c_int = 82;
2956 pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
2957 pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
2958 pub static _SC_THREAD_KEYS_MAX : c_int = 86;
2959 pub static _SC_THREAD_PRIO_INHERIT : c_int = 87;
2960 pub static _SC_THREAD_PRIO_PROTECT : c_int = 88;
2961 pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
2962 pub static _SC_THREAD_PROCESS_SHARED : c_int = 90;
2963 pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
2964 pub static _SC_THREAD_STACK_MIN : c_int = 93;
2965 pub static _SC_THREAD_THREADS_MAX : c_int = 94;
2966 pub static _SC_THREADS : c_int = 96;
2967 pub static _SC_TTY_NAME_MAX : c_int = 101;
2968 pub static _SC_ATEXIT_MAX : c_int = 107;
2969 pub static _SC_XOPEN_CRYPT : c_int = 108;
2970 pub static _SC_XOPEN_ENH_I18N : c_int = 109;
2971 pub static _SC_XOPEN_LEGACY : c_int = 110;
2972 pub static _SC_XOPEN_REALTIME : c_int = 111;
2973 pub static _SC_XOPEN_REALTIME_THREADS : c_int = 112;
2974 pub static _SC_XOPEN_SHM : c_int = 113;
2975 pub static _SC_XOPEN_UNIX : c_int = 115;
2976 pub static _SC_XOPEN_VERSION : c_int = 116;
2977 pub static _SC_XOPEN_XCU_VERSION : c_int = 117;
2979 pub static PTHREAD_CREATE_JOINABLE: c_int = 0;
2980 pub static PTHREAD_CREATE_DETACHED: c_int = 1;
2982 #[cfg(target_arch = "arm")]
2983 pub static PTHREAD_STACK_MIN: size_t = 4096;
2985 #[cfg(target_arch = "mips")]
2986 #[cfg(target_arch = "mipsel")]
2987 #[cfg(target_arch = "x86")]
2988 #[cfg(target_arch = "x86_64")]
2989 pub static PTHREAD_STACK_MIN: size_t = 2048;
2991 pub static CLOCK_REALTIME: c_int = 0;
2992 pub static CLOCK_MONOTONIC: c_int = 4;
2997 use types::os::arch::c95::c_int;
2999 pub static MADV_NORMAL : c_int = 0;
3000 pub static MADV_RANDOM : c_int = 1;
3001 pub static MADV_SEQUENTIAL : c_int = 2;
3002 pub static MADV_WILLNEED : c_int = 3;
3003 pub static MADV_DONTNEED : c_int = 4;
3004 pub static MADV_FREE : c_int = 5;
3005 pub static MADV_NOSYNC : c_int = 6;
3006 pub static MADV_AUTOSYNC : c_int = 7;
3007 pub static MADV_NOCORE : c_int = 8;
3008 pub static MADV_CORE : c_int = 9;
3009 pub static MADV_PROTECT : c_int = 10;
3011 pub static MINCORE_INCORE : c_int = 0x1;
3012 pub static MINCORE_REFERENCED : c_int = 0x2;
3013 pub static MINCORE_MODIFIED : c_int = 0x4;
3014 pub static MINCORE_REFERENCED_OTHER : c_int = 0x8;
3015 pub static MINCORE_MODIFIED_OTHER : c_int = 0x10;
3016 pub static MINCORE_SUPER : c_int = 0x20;
3018 pub static AF_INET: c_int = 2;
3019 pub static AF_INET6: c_int = 28;
3020 pub static AF_UNIX: c_int = 1;
3021 pub static SOCK_STREAM: c_int = 1;
3022 pub static SOCK_DGRAM: c_int = 2;
3023 pub static IPPROTO_TCP: c_int = 6;
3024 pub static IPPROTO_IP: c_int = 0;
3025 pub static IPPROTO_IPV6: c_int = 41;
3026 pub static IP_MULTICAST_TTL: c_int = 10;
3027 pub static IP_MULTICAST_LOOP: c_int = 11;
3028 pub static IP_TTL: c_int = 4;
3029 pub static IP_ADD_MEMBERSHIP: c_int = 12;
3030 pub static IP_DROP_MEMBERSHIP: c_int = 13;
3031 pub static IPV6_ADD_MEMBERSHIP: c_int = 12;
3032 pub static IPV6_DROP_MEMBERSHIP: c_int = 13;
3034 pub static TCP_NODELAY: c_int = 1;
3035 pub static TCP_KEEPIDLE: c_int = 256;
3036 pub static SOL_SOCKET: c_int = 0xffff;
3037 pub static SO_KEEPALIVE: c_int = 0x0008;
3038 pub static SO_BROADCAST: c_int = 0x0020;
3039 pub static SO_REUSEADDR: c_int = 0x0004;
3040 pub static SO_ERROR: c_int = 0x1007;
3042 pub static SHUT_RD: c_int = 0;
3043 pub static SHUT_WR: c_int = 1;
3044 pub static SHUT_RDWR: c_int = 2;
3047 use types::os::arch::c95::c_int;
3049 pub static O_SYNC : c_int = 128;
3050 pub static CTL_KERN: c_int = 1;
3051 pub static KERN_PROC: c_int = 14;
3052 pub static KERN_PROC_PATHNAME: c_int = 12;
3054 pub static MAP_COPY : c_int = 0x0002;
3055 pub static MAP_RENAME : c_int = 0x0020;
3056 pub static MAP_NORESERVE : c_int = 0x0040;
3057 pub static MAP_HASSEMAPHORE : c_int = 0x0200;
3058 pub static MAP_STACK : c_int = 0x0400;
3059 pub static MAP_NOSYNC : c_int = 0x0800;
3060 pub static MAP_NOCORE : c_int = 0x020000;
3063 use types::os::arch::c95::c_int;
3065 pub static _SC_ARG_MAX : c_int = 1;
3066 pub static _SC_CHILD_MAX : c_int = 2;
3067 pub static _SC_CLK_TCK : c_int = 3;
3068 pub static _SC_NGROUPS_MAX : c_int = 4;
3069 pub static _SC_OPEN_MAX : c_int = 5;
3070 pub static _SC_JOB_CONTROL : c_int = 6;
3071 pub static _SC_SAVED_IDS : c_int = 7;
3072 pub static _SC_VERSION : c_int = 8;
3073 pub static _SC_BC_BASE_MAX : c_int = 9;
3074 pub static _SC_BC_DIM_MAX : c_int = 10;
3075 pub static _SC_BC_SCALE_MAX : c_int = 11;
3076 pub static _SC_BC_STRING_MAX : c_int = 12;
3077 pub static _SC_COLL_WEIGHTS_MAX : c_int = 13;
3078 pub static _SC_EXPR_NEST_MAX : c_int = 14;
3079 pub static _SC_LINE_MAX : c_int = 15;
3080 pub static _SC_RE_DUP_MAX : c_int = 16;
3081 pub static _SC_2_VERSION : c_int = 17;
3082 pub static _SC_2_C_BIND : c_int = 18;
3083 pub static _SC_2_C_DEV : c_int = 19;
3084 pub static _SC_2_CHAR_TERM : c_int = 20;
3085 pub static _SC_2_FORT_DEV : c_int = 21;
3086 pub static _SC_2_FORT_RUN : c_int = 22;
3087 pub static _SC_2_LOCALEDEF : c_int = 23;
3088 pub static _SC_2_SW_DEV : c_int = 24;
3089 pub static _SC_2_UPE : c_int = 25;
3090 pub static _SC_STREAM_MAX : c_int = 26;
3091 pub static _SC_TZNAME_MAX : c_int = 27;
3092 pub static _SC_ASYNCHRONOUS_IO : c_int = 28;
3093 pub static _SC_MAPPED_FILES : c_int = 29;
3094 pub static _SC_MEMLOCK : c_int = 30;
3095 pub static _SC_MEMLOCK_RANGE : c_int = 31;
3096 pub static _SC_MEMORY_PROTECTION : c_int = 32;
3097 pub static _SC_MESSAGE_PASSING : c_int = 33;
3098 pub static _SC_PRIORITIZED_IO : c_int = 34;
3099 pub static _SC_PRIORITY_SCHEDULING : c_int = 35;
3100 pub static _SC_REALTIME_SIGNALS : c_int = 36;
3101 pub static _SC_SEMAPHORES : c_int = 37;
3102 pub static _SC_FSYNC : c_int = 38;
3103 pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
3104 pub static _SC_SYNCHRONIZED_IO : c_int = 40;
3105 pub static _SC_TIMERS : c_int = 41;
3106 pub static _SC_AIO_LISTIO_MAX : c_int = 42;
3107 pub static _SC_AIO_MAX : c_int = 43;
3108 pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
3109 pub static _SC_DELAYTIMER_MAX : c_int = 45;
3110 pub static _SC_MQ_OPEN_MAX : c_int = 46;
3111 pub static _SC_PAGESIZE : c_int = 47;
3112 pub static _SC_RTSIG_MAX : c_int = 48;
3113 pub static _SC_SEM_NSEMS_MAX : c_int = 49;
3114 pub static _SC_SEM_VALUE_MAX : c_int = 50;
3115 pub static _SC_SIGQUEUE_MAX : c_int = 51;
3116 pub static _SC_TIMER_MAX : c_int = 52;
3120 #[cfg(target_os = "macos")]
3121 #[cfg(target_os = "ios")]
3124 use types::os::arch::c95::{c_int, c_uint};
3126 pub static EXIT_FAILURE : c_int = 1;
3127 pub static EXIT_SUCCESS : c_int = 0;
3128 pub static RAND_MAX : c_int = 2147483647;
3129 pub static EOF : c_int = -1;
3130 pub static SEEK_SET : c_int = 0;
3131 pub static SEEK_CUR : c_int = 1;
3132 pub static SEEK_END : c_int = 2;
3133 pub static _IOFBF : c_int = 0;
3134 pub static _IONBF : c_int = 2;
3135 pub static _IOLBF : c_int = 1;
3136 pub static BUFSIZ : c_uint = 1024_u32;
3137 pub static FOPEN_MAX : c_uint = 20_u32;
3138 pub static FILENAME_MAX : c_uint = 1024_u32;
3139 pub static L_tmpnam : c_uint = 1024_u32;
3140 pub static TMP_MAX : c_uint = 308915776_u32;
3145 use types::common::c95::c_void;
3146 use types::os::arch::c95::c_int;
3148 pub static O_RDONLY : c_int = 0;
3149 pub static O_WRONLY : c_int = 1;
3150 pub static O_RDWR : c_int = 2;
3151 pub static O_APPEND : c_int = 8;
3152 pub static O_CREAT : c_int = 512;
3153 pub static O_EXCL : c_int = 2048;
3154 pub static O_TRUNC : c_int = 1024;
3155 pub static S_IFIFO : c_int = 4096;
3156 pub static S_IFCHR : c_int = 8192;
3157 pub static S_IFBLK : c_int = 24576;
3158 pub static S_IFDIR : c_int = 16384;
3159 pub static S_IFREG : c_int = 32768;
3160 pub static S_IFLNK : c_int = 40960;
3161 pub static S_IFMT : c_int = 61440;
3162 pub static S_IEXEC : c_int = 64;
3163 pub static S_IWRITE : c_int = 128;
3164 pub static S_IREAD : c_int = 256;
3165 pub static S_IRWXU : c_int = 448;
3166 pub static S_IXUSR : c_int = 64;
3167 pub static S_IWUSR : c_int = 128;
3168 pub static S_IRUSR : c_int = 256;
3169 pub static F_OK : c_int = 0;
3170 pub static R_OK : c_int = 4;
3171 pub static W_OK : c_int = 2;
3172 pub static X_OK : c_int = 1;
3173 pub static STDIN_FILENO : c_int = 0;
3174 pub static STDOUT_FILENO : c_int = 1;
3175 pub static STDERR_FILENO : c_int = 2;
3176 pub static F_LOCK : c_int = 1;
3177 pub static F_TEST : c_int = 3;
3178 pub static F_TLOCK : c_int = 2;
3179 pub static F_ULOCK : c_int = 0;
3180 pub static SIGHUP : c_int = 1;
3181 pub static SIGINT : c_int = 2;
3182 pub static SIGQUIT : c_int = 3;
3183 pub static SIGILL : c_int = 4;
3184 pub static SIGABRT : c_int = 6;
3185 pub static SIGFPE : c_int = 8;
3186 pub static SIGKILL : c_int = 9;
3187 pub static SIGSEGV : c_int = 11;
3188 pub static SIGPIPE : c_int = 13;
3189 pub static SIGALRM : c_int = 14;
3190 pub static SIGTERM : c_int = 15;
3192 pub static PROT_NONE : c_int = 0;
3193 pub static PROT_READ : c_int = 1;
3194 pub static PROT_WRITE : c_int = 2;
3195 pub static PROT_EXEC : c_int = 4;
3197 pub static MAP_FILE : c_int = 0x0000;
3198 pub static MAP_SHARED : c_int = 0x0001;
3199 pub static MAP_PRIVATE : c_int = 0x0002;
3200 pub static MAP_FIXED : c_int = 0x0010;
3201 pub static MAP_ANON : c_int = 0x1000;
3203 pub static MAP_FAILED : *mut c_void = -1 as *mut c_void;
3205 pub static MCL_CURRENT : c_int = 0x0001;
3206 pub static MCL_FUTURE : c_int = 0x0002;
3208 pub static MS_ASYNC : c_int = 0x0001;
3209 pub static MS_INVALIDATE : c_int = 0x0002;
3210 pub static MS_SYNC : c_int = 0x0010;
3212 pub static MS_KILLPAGES : c_int = 0x0004;
3213 pub static MS_DEACTIVATE : c_int = 0x0008;
3215 pub static EPERM : c_int = 1;
3216 pub static ENOENT : c_int = 2;
3217 pub static ESRCH : c_int = 3;
3218 pub static EINTR : c_int = 4;
3219 pub static EIO : c_int = 5;
3220 pub static ENXIO : c_int = 6;
3221 pub static E2BIG : c_int = 7;
3222 pub static ENOEXEC : c_int = 8;
3223 pub static EBADF : c_int = 9;
3224 pub static ECHILD : c_int = 10;
3225 pub static EDEADLK : c_int = 11;
3226 pub static ENOMEM : c_int = 12;
3227 pub static EACCES : c_int = 13;
3228 pub static EFAULT : c_int = 14;
3229 pub static ENOTBLK : c_int = 15;
3230 pub static EBUSY : c_int = 16;
3231 pub static EEXIST : c_int = 17;
3232 pub static EXDEV : c_int = 18;
3233 pub static ENODEV : c_int = 19;
3234 pub static ENOTDIR : c_int = 20;
3235 pub static EISDIR : c_int = 21;
3236 pub static EINVAL : c_int = 22;
3237 pub static ENFILE : c_int = 23;
3238 pub static EMFILE : c_int = 24;
3239 pub static ENOTTY : c_int = 25;
3240 pub static ETXTBSY : c_int = 26;
3241 pub static EFBIG : c_int = 27;
3242 pub static ENOSPC : c_int = 28;
3243 pub static ESPIPE : c_int = 29;
3244 pub static EROFS : c_int = 30;
3245 pub static EMLINK : c_int = 31;
3246 pub static EPIPE : c_int = 32;
3247 pub static EDOM : c_int = 33;
3248 pub static ERANGE : c_int = 34;
3249 pub static EAGAIN : c_int = 35;
3250 pub static EWOULDBLOCK : c_int = EAGAIN;
3251 pub static EINPROGRESS : c_int = 36;
3252 pub static EALREADY : c_int = 37;
3253 pub static ENOTSOCK : c_int = 38;
3254 pub static EDESTADDRREQ : c_int = 39;
3255 pub static EMSGSIZE : c_int = 40;
3256 pub static EPROTOTYPE : c_int = 41;
3257 pub static ENOPROTOOPT : c_int = 42;
3258 pub static EPROTONOSUPPORT : c_int = 43;
3259 pub static ESOCKTNOSUPPORT : c_int = 44;
3260 pub static ENOTSUP : c_int = 45;
3261 pub static EPFNOSUPPORT : c_int = 46;
3262 pub static EAFNOSUPPORT : c_int = 47;
3263 pub static EADDRINUSE : c_int = 48;
3264 pub static EADDRNOTAVAIL : c_int = 49;
3265 pub static ENETDOWN : c_int = 50;
3266 pub static ENETUNREACH : c_int = 51;
3267 pub static ENETRESET : c_int = 52;
3268 pub static ECONNABORTED : c_int = 53;
3269 pub static ECONNRESET : c_int = 54;
3270 pub static ENOBUFS : c_int = 55;
3271 pub static EISCONN : c_int = 56;
3272 pub static ENOTCONN : c_int = 57;
3273 pub static ESHUTDOWN : c_int = 58;
3274 pub static ETOOMANYREFS : c_int = 59;
3275 pub static ETIMEDOUT : c_int = 60;
3276 pub static ECONNREFUSED : c_int = 61;
3277 pub static ELOOP : c_int = 62;
3278 pub static ENAMETOOLONG : c_int = 63;
3279 pub static EHOSTDOWN : c_int = 64;
3280 pub static EHOSTUNREACH : c_int = 65;
3281 pub static ENOTEMPTY : c_int = 66;
3282 pub static EPROCLIM : c_int = 67;
3283 pub static EUSERS : c_int = 68;
3284 pub static EDQUOT : c_int = 69;
3285 pub static ESTALE : c_int = 70;
3286 pub static EREMOTE : c_int = 71;
3287 pub static EBADRPC : c_int = 72;
3288 pub static ERPCMISMATCH : c_int = 73;
3289 pub static EPROGUNAVAIL : c_int = 74;
3290 pub static EPROGMISMATCH : c_int = 75;
3291 pub static EPROCUNAVAIL : c_int = 76;
3292 pub static ENOLCK : c_int = 77;
3293 pub static ENOSYS : c_int = 78;
3294 pub static EFTYPE : c_int = 79;
3295 pub static EAUTH : c_int = 80;
3296 pub static ENEEDAUTH : c_int = 81;
3297 pub static EPWROFF : c_int = 82;
3298 pub static EDEVERR : c_int = 83;
3299 pub static EOVERFLOW : c_int = 84;
3300 pub static EBADEXEC : c_int = 85;
3301 pub static EBADARCH : c_int = 86;
3302 pub static ESHLIBVERS : c_int = 87;
3303 pub static EBADMACHO : c_int = 88;
3304 pub static ECANCELED : c_int = 89;
3305 pub static EIDRM : c_int = 90;
3306 pub static ENOMSG : c_int = 91;
3307 pub static EILSEQ : c_int = 92;
3308 pub static ENOATTR : c_int = 93;
3309 pub static EBADMSG : c_int = 94;
3310 pub static EMULTIHOP : c_int = 95;
3311 pub static ENODATA : c_int = 96;
3312 pub static ENOLINK : c_int = 97;
3313 pub static ENOSR : c_int = 98;
3314 pub static ENOSTR : c_int = 99;
3315 pub static EPROTO : c_int = 100;
3316 pub static ETIME : c_int = 101;
3317 pub static EOPNOTSUPP : c_int = 102;
3318 pub static ENOPOLICY : c_int = 103;
3319 pub static ENOTRECOVERABLE : c_int = 104;
3320 pub static EOWNERDEAD : c_int = 105;
3321 pub static EQFULL : c_int = 106;
3322 pub static ELAST : c_int = 106;
3325 use types::os::arch::c95::{c_int, size_t};
3327 pub static SIGTRAP : c_int = 5;
3328 pub static SIGPIPE: c_int = 13;
3329 pub static SIG_IGN: size_t = 1;
3331 pub static GLOB_APPEND : c_int = 0x0001;
3332 pub static GLOB_DOOFFS : c_int = 0x0002;
3333 pub static GLOB_ERR : c_int = 0x0004;
3334 pub static GLOB_MARK : c_int = 0x0008;
3335 pub static GLOB_NOCHECK : c_int = 0x0010;
3336 pub static GLOB_NOSORT : c_int = 0x0020;
3337 pub static GLOB_NOESCAPE : c_int = 0x2000;
3339 pub static GLOB_NOSPACE : c_int = -1;
3340 pub static GLOB_ABORTED : c_int = -2;
3341 pub static GLOB_NOMATCH : c_int = -3;
3343 pub static POSIX_MADV_NORMAL : c_int = 0;
3344 pub static POSIX_MADV_RANDOM : c_int = 1;
3345 pub static POSIX_MADV_SEQUENTIAL : c_int = 2;
3346 pub static POSIX_MADV_WILLNEED : c_int = 3;
3347 pub static POSIX_MADV_DONTNEED : c_int = 4;
3349 pub static _SC_IOV_MAX : c_int = 56;
3350 pub static _SC_GETGR_R_SIZE_MAX : c_int = 70;
3351 pub static _SC_GETPW_R_SIZE_MAX : c_int = 71;
3352 pub static _SC_LOGIN_NAME_MAX : c_int = 73;
3353 pub static _SC_MQ_PRIO_MAX : c_int = 75;
3354 pub static _SC_THREAD_ATTR_STACKADDR : c_int = 82;
3355 pub static _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
3356 pub static _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
3357 pub static _SC_THREAD_KEYS_MAX : c_int = 86;
3358 pub static _SC_THREAD_PRIO_INHERIT : c_int = 87;
3359 pub static _SC_THREAD_PRIO_PROTECT : c_int = 88;
3360 pub static _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
3361 pub static _SC_THREAD_PROCESS_SHARED : c_int = 90;
3362 pub static _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
3363 pub static _SC_THREAD_STACK_MIN : c_int = 93;
3364 pub static _SC_THREAD_THREADS_MAX : c_int = 94;
3365 pub static _SC_THREADS : c_int = 96;
3366 pub static _SC_TTY_NAME_MAX : c_int = 101;
3367 pub static _SC_ATEXIT_MAX : c_int = 107;
3368 pub static _SC_XOPEN_CRYPT : c_int = 108;
3369 pub static _SC_XOPEN_ENH_I18N : c_int = 109;
3370 pub static _SC_XOPEN_LEGACY : c_int = 110;
3371 pub static _SC_XOPEN_REALTIME : c_int = 111;
3372 pub static _SC_XOPEN_REALTIME_THREADS : c_int = 112;
3373 pub static _SC_XOPEN_SHM : c_int = 113;
3374 pub static _SC_XOPEN_UNIX : c_int = 115;
3375 pub static _SC_XOPEN_VERSION : c_int = 116;
3376 pub static _SC_XOPEN_XCU_VERSION : c_int = 121;
3378 pub static PTHREAD_CREATE_JOINABLE: c_int = 1;
3379 pub static PTHREAD_CREATE_DETACHED: c_int = 2;
3380 pub static PTHREAD_STACK_MIN: size_t = 8192;
3385 use types::os::arch::c95::c_int;
3387 pub static MADV_NORMAL : c_int = 0;
3388 pub static MADV_RANDOM : c_int = 1;
3389 pub static MADV_SEQUENTIAL : c_int = 2;
3390 pub static MADV_WILLNEED : c_int = 3;
3391 pub static MADV_DONTNEED : c_int = 4;
3392 pub static MADV_FREE : c_int = 5;
3393 pub static MADV_ZERO_WIRED_PAGES : c_int = 6;
3394 pub static MADV_FREE_REUSABLE : c_int = 7;
3395 pub static MADV_FREE_REUSE : c_int = 8;
3396 pub static MADV_CAN_REUSE : c_int = 9;
3398 pub static MINCORE_INCORE : c_int = 0x1;
3399 pub static MINCORE_REFERENCED : c_int = 0x2;
3400 pub static MINCORE_MODIFIED : c_int = 0x4;
3401 pub static MINCORE_REFERENCED_OTHER : c_int = 0x8;
3402 pub static MINCORE_MODIFIED_OTHER : c_int = 0x10;
3404 pub static AF_UNIX: c_int = 1;
3405 pub static AF_INET: c_int = 2;
3406 pub static AF_INET6: c_int = 30;
3407 pub static SOCK_STREAM: c_int = 1;
3408 pub static SOCK_DGRAM: c_int = 2;
3409 pub static IPPROTO_TCP: c_int = 6;
3410 pub static IPPROTO_IP: c_int = 0;
3411 pub static IPPROTO_IPV6: c_int = 41;
3412 pub static IP_MULTICAST_TTL: c_int = 10;
3413 pub static IP_MULTICAST_LOOP: c_int = 11;
3414 pub static IP_TTL: c_int = 4;
3415 pub static IP_ADD_MEMBERSHIP: c_int = 12;
3416 pub static IP_DROP_MEMBERSHIP: c_int = 13;
3417 pub static IPV6_ADD_MEMBERSHIP: c_int = 12;
3418 pub static IPV6_DROP_MEMBERSHIP: c_int = 13;
3420 pub static TCP_NODELAY: c_int = 0x01;
3421 pub static TCP_KEEPALIVE: c_int = 0x10;
3422 pub static SOL_SOCKET: c_int = 0xffff;
3423 pub static SO_KEEPALIVE: c_int = 0x0008;
3424 pub static SO_BROADCAST: c_int = 0x0020;
3425 pub static SO_REUSEADDR: c_int = 0x0004;
3426 pub static SO_ERROR: c_int = 0x1007;
3428 pub static SHUT_RD: c_int = 0;
3429 pub static SHUT_WR: c_int = 1;
3430 pub static SHUT_RDWR: c_int = 2;
3433 use types::os::arch::c95::c_int;
3435 pub static O_DSYNC : c_int = 4194304;
3436 pub static O_SYNC : c_int = 128;
3437 pub static F_FULLFSYNC : c_int = 51;
3439 pub static MAP_COPY : c_int = 0x0002;
3440 pub static MAP_RENAME : c_int = 0x0020;
3441 pub static MAP_NORESERVE : c_int = 0x0040;
3442 pub static MAP_NOEXTEND : c_int = 0x0100;
3443 pub static MAP_HASSEMAPHORE : c_int = 0x0200;
3444 pub static MAP_NOCACHE : c_int = 0x0400;
3445 pub static MAP_JIT : c_int = 0x0800;
3446 pub static MAP_STACK : c_int = 0;
3449 use types::os::arch::c95::c_int;
3451 pub static _SC_ARG_MAX : c_int = 1;
3452 pub static _SC_CHILD_MAX : c_int = 2;
3453 pub static _SC_CLK_TCK : c_int = 3;
3454 pub static _SC_NGROUPS_MAX : c_int = 4;
3455 pub static _SC_OPEN_MAX : c_int = 5;
3456 pub static _SC_JOB_CONTROL : c_int = 6;
3457 pub static _SC_SAVED_IDS : c_int = 7;
3458 pub static _SC_VERSION : c_int = 8;
3459 pub static _SC_BC_BASE_MAX : c_int = 9;
3460 pub static _SC_BC_DIM_MAX : c_int = 10;
3461 pub static _SC_BC_SCALE_MAX : c_int = 11;
3462 pub static _SC_BC_STRING_MAX : c_int = 12;
3463 pub static _SC_COLL_WEIGHTS_MAX : c_int = 13;
3464 pub static _SC_EXPR_NEST_MAX : c_int = 14;
3465 pub static _SC_LINE_MAX : c_int = 15;
3466 pub static _SC_RE_DUP_MAX : c_int = 16;
3467 pub static _SC_2_VERSION : c_int = 17;
3468 pub static _SC_2_C_BIND : c_int = 18;
3469 pub static _SC_2_C_DEV : c_int = 19;
3470 pub static _SC_2_CHAR_TERM : c_int = 20;
3471 pub static _SC_2_FORT_DEV : c_int = 21;
3472 pub static _SC_2_FORT_RUN : c_int = 22;
3473 pub static _SC_2_LOCALEDEF : c_int = 23;
3474 pub static _SC_2_SW_DEV : c_int = 24;
3475 pub static _SC_2_UPE : c_int = 25;
3476 pub static _SC_STREAM_MAX : c_int = 26;
3477 pub static _SC_TZNAME_MAX : c_int = 27;
3478 pub static _SC_ASYNCHRONOUS_IO : c_int = 28;
3479 pub static _SC_PAGESIZE : c_int = 29;
3480 pub static _SC_MEMLOCK : c_int = 30;
3481 pub static _SC_MEMLOCK_RANGE : c_int = 31;
3482 pub static _SC_MEMORY_PROTECTION : c_int = 32;
3483 pub static _SC_MESSAGE_PASSING : c_int = 33;
3484 pub static _SC_PRIORITIZED_IO : c_int = 34;
3485 pub static _SC_PRIORITY_SCHEDULING : c_int = 35;
3486 pub static _SC_REALTIME_SIGNALS : c_int = 36;
3487 pub static _SC_SEMAPHORES : c_int = 37;
3488 pub static _SC_FSYNC : c_int = 38;
3489 pub static _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
3490 pub static _SC_SYNCHRONIZED_IO : c_int = 40;
3491 pub static _SC_TIMERS : c_int = 41;
3492 pub static _SC_AIO_LISTIO_MAX : c_int = 42;
3493 pub static _SC_AIO_MAX : c_int = 43;
3494 pub static _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
3495 pub static _SC_DELAYTIMER_MAX : c_int = 45;
3496 pub static _SC_MQ_OPEN_MAX : c_int = 46;
3497 pub static _SC_MAPPED_FILES : c_int = 47;
3498 pub static _SC_RTSIG_MAX : c_int = 48;
3499 pub static _SC_SEM_NSEMS_MAX : c_int = 49;
3500 pub static _SC_SEM_VALUE_MAX : c_int = 50;
3501 pub static _SC_SIGQUEUE_MAX : c_int = 51;
3502 pub static _SC_TIMER_MAX : c_int = 52;
3503 pub static _SC_XBS5_ILP32_OFF32 : c_int = 122;
3504 pub static _SC_XBS5_ILP32_OFFBIG : c_int = 123;
3505 pub static _SC_XBS5_LP64_OFF64 : c_int = 124;
3506 pub static _SC_XBS5_LPBIG_OFFBIG : c_int = 125;
3513 // Thankfully most of c95 is universally available and does not vary by OS
3514 // or anything. The same is not true of POSIX.
3518 use types::os::arch::c95::{c_char, c_int};
3521 pub fn isalnum(c: c_int) -> c_int;
3522 pub fn isalpha(c: c_int) -> c_int;
3523 pub fn iscntrl(c: c_int) -> c_int;
3524 pub fn isdigit(c: c_int) -> c_int;
3525 pub fn isgraph(c: c_int) -> c_int;
3526 pub fn islower(c: c_int) -> c_int;
3527 pub fn isprint(c: c_int) -> c_int;
3528 pub fn ispunct(c: c_int) -> c_int;
3529 pub fn isspace(c: c_int) -> c_int;
3530 pub fn isupper(c: c_int) -> c_int;
3531 pub fn isxdigit(c: c_int) -> c_int;
3532 pub fn tolower(c: c_char) -> c_char;
3533 pub fn toupper(c: c_char) -> c_char;
3538 use types::common::c95::{FILE, c_void, fpos_t};
3539 use types::os::arch::c95::{c_char, c_int, c_long, size_t};
3542 pub fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
3543 pub fn freopen(filename: *c_char, mode: *c_char, file: *FILE)
3545 pub fn fflush(file: *FILE) -> c_int;
3546 pub fn fclose(file: *FILE) -> c_int;
3547 pub fn remove(filename: *c_char) -> c_int;
3548 pub fn rename(oldname: *c_char, newname: *c_char) -> c_int;
3549 pub fn tmpfile() -> *FILE;
3550 pub fn setvbuf(stream: *FILE,
3555 pub fn setbuf(stream: *FILE, buf: *c_char);
3556 // Omitted: printf and scanf variants.
3557 pub fn fgetc(stream: *FILE) -> c_int;
3558 pub fn fgets(buf: *mut c_char, n: c_int, stream: *FILE)
3560 pub fn fputc(c: c_int, stream: *FILE) -> c_int;
3561 pub fn fputs(s: *c_char, stream: *FILE) -> *c_char;
3562 // Omitted: getc, getchar (might be macros).
3564 // Omitted: gets, so ridiculously unsafe that it should not
3567 // Omitted: putc, putchar (might be macros).
3568 pub fn puts(s: *c_char) -> c_int;
3569 pub fn ungetc(c: c_int, stream: *FILE) -> c_int;
3570 pub fn fread(ptr: *mut c_void,
3575 pub fn fwrite(ptr: *c_void,
3580 pub fn fseek(stream: *FILE, offset: c_long, whence: c_int)
3582 pub fn ftell(stream: *FILE) -> c_long;
3583 pub fn rewind(stream: *FILE);
3584 pub fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
3585 pub fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
3586 pub fn feof(stream: *FILE) -> c_int;
3587 pub fn ferror(stream: *FILE) -> c_int;
3588 pub fn perror(s: *c_char);
3593 use types::common::c95::c_void;
3594 use types::os::arch::c95::{c_char, c_double, c_int};
3595 use types::os::arch::c95::{c_long, c_uint, c_ulong};
3596 use types::os::arch::c95::{size_t};
3599 pub fn abs(i: c_int) -> c_int;
3600 pub fn labs(i: c_long) -> c_long;
3601 // Omitted: div, ldiv (return pub type incomplete).
3602 pub fn atof(s: *c_char) -> c_double;
3603 pub fn atoi(s: *c_char) -> c_int;
3604 pub fn strtod(s: *c_char, endp: **c_char) -> c_double;
3605 pub fn strtol(s: *c_char, endp: **c_char, base: c_int)
3607 pub fn strtoul(s: *c_char, endp: **c_char, base: c_int)
3609 pub fn calloc(nobj: size_t, size: size_t) -> *c_void;
3610 pub fn malloc(size: size_t) -> *mut c_void;
3611 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
3612 pub fn free(p: *mut c_void);
3613 pub fn exit(status: c_int) -> !;
3614 pub fn _exit(status: c_int) -> !;
3616 pub fn system(s: *c_char) -> c_int;
3617 pub fn getenv(s: *c_char) -> *c_char;
3618 // Omitted: bsearch, qsort
3619 pub fn rand() -> c_int;
3620 pub fn srand(seed: c_uint);
3625 use types::common::c95::c_void;
3626 use types::os::arch::c95::{c_char, c_int, size_t};
3627 use types::os::arch::c95::{wchar_t};
3630 pub fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
3631 pub fn strncpy(dst: *c_char, src: *c_char, n: size_t)
3633 pub fn strcat(s: *c_char, ct: *c_char) -> *c_char;
3634 pub fn strncat(s: *c_char, ct: *c_char, n: size_t) -> *c_char;
3635 pub fn strcmp(cs: *c_char, ct: *c_char) -> c_int;
3636 pub fn strncmp(cs: *c_char, ct: *c_char, n: size_t) -> c_int;
3637 pub fn strcoll(cs: *c_char, ct: *c_char) -> c_int;
3638 pub fn strchr(cs: *c_char, c: c_int) -> *c_char;
3639 pub fn strrchr(cs: *c_char, c: c_int) -> *c_char;
3640 pub fn strspn(cs: *c_char, ct: *c_char) -> size_t;
3641 pub fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
3642 pub fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char;
3643 pub fn strstr(cs: *c_char, ct: *c_char) -> *c_char;
3644 pub fn strlen(cs: *c_char) -> size_t;
3645 pub fn strerror(n: c_int) -> *c_char;
3646 pub fn strtok(s: *c_char, t: *c_char) -> *c_char;
3647 pub fn strxfrm(s: *c_char, ct: *c_char, n: size_t) -> size_t;
3648 pub fn wcslen(buf: *wchar_t) -> size_t;
3650 // Omitted: memcpy, memmove, memset (provided by LLVM)
3652 // These are fine to execute on the Rust stack. They must be,
3653 // in fact, because LLVM generates calls to them!
3654 pub fn memcmp(cx: *c_void, ct: *c_void, n: size_t) -> c_int;
3655 pub fn memchr(cx: *c_void, c: c_int, n: size_t) -> *c_void;
3660 // Microsoft helpfully underscore-qualifies all of its POSIX-like symbols
3661 // to make sure you don't use them accidentally. It also randomly deviates
3662 // from the exact signatures you might otherwise expect, and omits much,
3663 // so be careful when trying to write portable code; it won't always work
3664 // with the same POSIX functions and types as other platforms.
3666 #[cfg(target_os = "win32")]
3669 use types::os::common::posix01::{stat, utimbuf};
3670 use types::os::arch::c95::{c_int, c_char, wchar_t};
3673 #[link_name = "_chmod"]
3674 pub fn chmod(path: *c_char, mode: c_int) -> c_int;
3675 #[link_name = "_wchmod"]
3676 pub fn wchmod(path: *wchar_t, mode: c_int) -> c_int;
3677 #[link_name = "_mkdir"]
3678 pub fn mkdir(path: *c_char) -> c_int;
3679 #[link_name = "_wrmdir"]
3680 pub fn wrmdir(path: *wchar_t) -> c_int;
3681 #[link_name = "_fstat64"]
3682 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
3683 #[link_name = "_stat64"]
3684 pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
3685 #[link_name = "_wstat64"]
3686 pub fn wstat(path: *wchar_t, buf: *mut stat) -> c_int;
3687 #[link_name = "_wutime64"]
3688 pub fn wutime(file: *wchar_t, buf: *utimbuf) -> c_int;
3693 use types::common::c95::FILE;
3694 use types::os::arch::c95::{c_int, c_char};
3697 #[link_name = "_popen"]
3698 pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
3699 #[link_name = "_pclose"]
3700 pub fn pclose(stream: *FILE) -> c_int;
3701 #[link_name = "_fdopen"]
3702 pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
3703 #[link_name = "_fileno"]
3704 pub fn fileno(stream: *FILE) -> c_int;
3709 use types::os::arch::c95::{c_int, c_char, wchar_t};
3711 #[link_name = "_open"]
3712 pub fn open(path: *c_char, oflag: c_int, mode: c_int)
3714 #[link_name = "_wopen"]
3715 pub fn wopen(path: *wchar_t, oflag: c_int, mode: c_int)
3717 #[link_name = "_creat"]
3718 pub fn creat(path: *c_char, mode: c_int) -> c_int;
3723 // Not supplied at all.
3727 use types::common::c95::c_void;
3728 use types::os::arch::c95::{c_int, c_uint, c_char,
3730 use types::os::arch::c99::intptr_t;
3733 #[link_name = "_access"]
3734 pub fn access(path: *c_char, amode: c_int) -> c_int;
3735 #[link_name = "_chdir"]
3736 pub fn chdir(dir: *c_char) -> c_int;
3737 #[link_name = "_close"]
3738 pub fn close(fd: c_int) -> c_int;
3739 #[link_name = "_dup"]
3740 pub fn dup(fd: c_int) -> c_int;
3741 #[link_name = "_dup2"]
3742 pub fn dup2(src: c_int, dst: c_int) -> c_int;
3743 #[link_name = "_execv"]
3744 pub fn execv(prog: *c_char, argv: **c_char) -> intptr_t;
3745 #[link_name = "_execve"]
3746 pub fn execve(prog: *c_char, argv: **c_char, envp: **c_char)
3748 #[link_name = "_execvp"]
3749 pub fn execvp(c: *c_char, argv: **c_char) -> c_int;
3750 #[link_name = "_execvpe"]
3751 pub fn execvpe(c: *c_char, argv: **c_char, envp: **c_char)
3753 #[link_name = "_getcwd"]
3754 pub fn getcwd(buf: *mut c_char, size: size_t) -> *c_char;
3755 #[link_name = "_getpid"]
3756 pub fn getpid() -> c_int;
3757 #[link_name = "_isatty"]
3758 pub fn isatty(fd: c_int) -> c_int;
3759 #[link_name = "_lseek"]
3760 pub fn lseek(fd: c_int, offset: c_long, origin: c_int)
3762 #[link_name = "_pipe"]
3763 pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int)
3765 #[link_name = "_read"]
3766 pub fn read(fd: c_int, buf: *mut c_void, count: c_uint)
3768 #[link_name = "_rmdir"]
3769 pub fn rmdir(path: *c_char) -> c_int;
3770 #[link_name = "_unlink"]
3771 pub fn unlink(c: *c_char) -> c_int;
3772 #[link_name = "_write"]
3773 pub fn write(fd: c_int, buf: *c_void, count: c_uint) -> c_int;
3782 #[cfg(target_os = "linux")]
3783 #[cfg(target_os = "android")]
3784 #[cfg(target_os = "macos")]
3785 #[cfg(target_os = "ios")]
3786 #[cfg(target_os = "freebsd")]
3789 use types::os::arch::c95::{c_char, c_int};
3790 use types::os::arch::posix01::stat;
3791 use types::os::arch::posix88::mode_t;
3794 pub fn chmod(path: *c_char, mode: mode_t) -> c_int;
3795 pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
3797 #[cfg(target_os = "linux")]
3798 #[cfg(target_os = "freebsd")]
3799 #[cfg(target_os = "android")]
3800 #[cfg(target_os = "ios")]
3801 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
3803 #[cfg(target_os = "macos")]
3804 #[link_name = "fstat64"]
3805 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
3807 pub fn mkdir(path: *c_char, mode: mode_t) -> c_int;
3808 pub fn mkfifo(path: *c_char, mode: mode_t) -> c_int;
3810 #[cfg(target_os = "linux")]
3811 #[cfg(target_os = "freebsd")]
3812 #[cfg(target_os = "android")]
3813 #[cfg(target_os = "ios")]
3814 pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
3816 #[cfg(target_os = "macos")]
3817 #[link_name = "stat64"]
3818 pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
3823 use types::common::c95::FILE;
3824 use types::os::arch::c95::{c_char, c_int};
3827 pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
3828 pub fn pclose(stream: *FILE) -> c_int;
3829 pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
3830 pub fn fileno(stream: *FILE) -> c_int;
3835 use types::os::arch::c95::{c_char, c_int};
3836 use types::os::arch::posix88::mode_t;
3839 pub fn open(path: *c_char, oflag: c_int, mode: c_int)
3841 pub fn creat(path: *c_char, mode: mode_t) -> c_int;
3842 pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int;
3847 use types::common::posix88::{DIR, dirent_t};
3848 use types::os::arch::c95::{c_char, c_int, c_long};
3850 // NB: On OS X opendir and readdir have two versions,
3851 // one for 32-bit kernelspace and one for 64.
3852 // We should be linking to the 64-bit ones, called
3853 // opendir$INODE64, etc. but for some reason rustc
3854 // doesn't link it correctly on i686, so we're going
3855 // through a C function that mysteriously does work.
3858 #[link_name="rust_opendir"]
3859 pub fn opendir(dirname: *c_char) -> *DIR;
3860 #[link_name="rust_readdir_r"]
3861 pub fn readdir_r(dirp: *DIR, entry: *mut dirent_t,
3862 result: *mut *mut dirent_t) -> c_int;
3866 pub fn closedir(dirp: *DIR) -> c_int;
3867 pub fn rewinddir(dirp: *DIR);
3868 pub fn seekdir(dirp: *DIR, loc: c_long);
3869 pub fn telldir(dirp: *DIR) -> c_long;
3874 use types::common::c95::c_void;
3875 use types::os::arch::c95::{c_char, c_int, c_long, c_uint};
3876 use types::os::arch::c95::{size_t};
3877 use types::os::common::posix01::timespec;
3878 use types::os::arch::posix01::utimbuf;
3879 use types::os::arch::posix88::{gid_t, off_t, pid_t};
3880 use types::os::arch::posix88::{ssize_t, uid_t};
3882 pub static _PC_NAME_MAX: c_int = 4;
3885 pub fn access(path: *c_char, amode: c_int) -> c_int;
3886 pub fn alarm(seconds: c_uint) -> c_uint;
3887 pub fn chdir(dir: *c_char) -> c_int;
3888 pub fn chown(path: *c_char, uid: uid_t, gid: gid_t) -> c_int;
3889 pub fn close(fd: c_int) -> c_int;
3890 pub fn dup(fd: c_int) -> c_int;
3891 pub fn dup2(src: c_int, dst: c_int) -> c_int;
3892 pub fn execv(prog: *c_char, argv: **c_char) -> c_int;
3893 pub fn execve(prog: *c_char, argv: **c_char, envp: **c_char)
3895 pub fn execvp(c: *c_char, argv: **c_char) -> c_int;
3896 pub fn fork() -> pid_t;
3897 pub fn fpathconf(filedes: c_int, name: c_int) -> c_long;
3898 pub fn getcwd(buf: *mut c_char, size: size_t) -> *c_char;
3899 pub fn getegid() -> gid_t;
3900 pub fn geteuid() -> uid_t;
3901 pub fn getgid() -> gid_t ;
3902 pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t)
3904 pub fn getlogin() -> *c_char;
3905 pub fn getopt(argc: c_int, argv: **c_char, optstr: *c_char)
3907 pub fn getpgrp() -> pid_t;
3908 pub fn getpid() -> pid_t;
3909 pub fn getppid() -> pid_t;
3910 pub fn getuid() -> uid_t;
3911 pub fn isatty(fd: c_int) -> c_int;
3912 pub fn link(src: *c_char, dst: *c_char) -> c_int;
3913 pub fn lseek(fd: c_int, offset: off_t, whence: c_int)
3915 pub fn pathconf(path: *c_char, name: c_int) -> c_long;
3916 pub fn pause() -> c_int;
3917 pub fn pipe(fds: *mut c_int) -> c_int;
3918 pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
3920 pub fn rmdir(path: *c_char) -> c_int;
3921 pub fn setgid(gid: gid_t) -> c_int;
3922 pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
3923 pub fn setsid() -> pid_t;
3924 pub fn setuid(uid: uid_t) -> c_int;
3925 pub fn sleep(secs: c_uint) -> c_uint;
3926 pub fn usleep(secs: c_uint) -> c_int;
3927 pub fn nanosleep(rqtp: *timespec, rmtp: *mut timespec) -> c_int;
3928 pub fn sysconf(name: c_int) -> c_long;
3929 pub fn tcgetpgrp(fd: c_int) -> pid_t;
3930 pub fn ttyname(fd: c_int) -> *c_char;
3931 pub fn unlink(c: *c_char) -> c_int;
3932 pub fn write(fd: c_int, buf: *c_void, count: size_t)
3934 pub fn pread(fd: c_int, buf: *c_void, count: size_t,
3935 offset: off_t) -> ssize_t;
3936 pub fn pwrite(fd: c_int, buf: *c_void, count: size_t,
3937 offset: off_t) -> ssize_t;
3938 pub fn utime(file: *c_char, buf: *utimbuf) -> c_int;
3943 use types::os::arch::c95::{c_int};
3944 use types::os::arch::posix88::{pid_t};
3947 pub fn kill(pid: pid_t, sig: c_int) -> c_int;
3952 use types::common::c95::{c_void};
3953 use types::os::arch::c95::{size_t, c_int, c_char};
3954 use types::os::arch::posix88::{mode_t, off_t};
3957 pub fn mlock(addr: *c_void, len: size_t) -> c_int;
3958 pub fn munlock(addr: *c_void, len: size_t) -> c_int;
3959 pub fn mlockall(flags: c_int) -> c_int;
3960 pub fn munlockall() -> c_int;
3962 pub fn mmap(addr: *mut c_void,
3969 pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
3971 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int)
3974 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int)
3976 pub fn shm_open(name: *c_char, oflag: c_int, mode: mode_t)
3978 pub fn shm_unlink(name: *c_char) -> c_int;
3983 #[cfg(target_os = "linux")]
3984 #[cfg(target_os = "android")]
3985 #[cfg(target_os = "macos")]
3986 #[cfg(target_os = "ios")]
3987 #[cfg(target_os = "freebsd")]
3990 use types::os::arch::c95::{c_char, c_int};
3991 use types::os::arch::posix01::stat;
3994 #[cfg(target_os = "linux")]
3995 #[cfg(target_os = "freebsd")]
3996 #[cfg(target_os = "android")]
3997 #[cfg(target_os = "ios")]
3998 pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
4000 #[cfg(target_os = "macos")]
4001 #[link_name = "lstat64"]
4002 pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
4007 use types::os::arch::c95::{c_char, c_int, size_t};
4008 use types::os::arch::posix88::{ssize_t, off_t};
4011 pub fn readlink(path: *c_char,
4016 pub fn fsync(fd: c_int) -> c_int;
4018 #[cfg(target_os = "linux")]
4019 #[cfg(target_os = "android")]
4020 pub fn fdatasync(fd: c_int) -> c_int;
4022 pub fn setenv(name: *c_char, val: *c_char, overwrite: c_int)
4024 pub fn unsetenv(name: *c_char) -> c_int;
4025 pub fn putenv(string: *c_char) -> c_int;
4027 pub fn symlink(path1: *c_char, path2: *c_char) -> c_int;
4029 pub fn ftruncate(fd: c_int, length: off_t) -> c_int;
4034 use types::os::arch::c95::c_int;
4035 use types::os::common::posix01::sighandler_t;
4037 #[cfg(not(target_os = "android"))]
4039 pub fn signal(signum: c_int,
4040 handler: sighandler_t) -> sighandler_t;
4043 #[cfg(target_os = "android")]
4045 #[link_name = "bsd_signal"]
4046 pub fn signal(signum: c_int,
4047 handler: sighandler_t) -> sighandler_t;
4052 use types::os::arch::c95::{c_char, c_int};
4053 use types::os::common::posix01::{glob_t};
4056 pub fn glob(pattern: *c_char,
4058 errfunc: ::Nullable<extern "C" fn(epath: *c_char, errno: int) -> int>,
4059 pglob: *mut glob_t);
4060 pub fn globfree(pglob: *mut glob_t);
4065 use types::common::c95::{c_void};
4066 use types::os::arch::c95::{c_int, size_t};
4069 pub fn posix_madvise(addr: *c_void,
4077 #[cfg(target_os = "win32")]
4093 #[cfg(target_os = "win32")]
4094 #[cfg(target_os = "linux")]
4095 #[cfg(target_os = "android")]
4096 #[cfg(target_os = "macos")]
4097 #[cfg(target_os = "ios")]
4098 #[cfg(target_os = "freebsd")]
4104 #[cfg(not(windows))]
4106 use types::common::c95::{c_void};
4107 use types::os::common::bsd44::{socklen_t, sockaddr};
4108 use types::os::arch::c95::{c_int, size_t};
4109 use types::os::arch::posix88::ssize_t;
4112 pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> c_int;
4113 pub fn connect(socket: c_int, address: *sockaddr,
4114 len: socklen_t) -> c_int;
4115 pub fn bind(socket: c_int, address: *sockaddr,
4116 address_len: socklen_t) -> c_int;
4117 pub fn listen(socket: c_int, backlog: c_int) -> c_int;
4118 pub fn accept(socket: c_int, address: *mut sockaddr,
4119 address_len: *mut socklen_t) -> c_int;
4120 pub fn getpeername(socket: c_int, address: *mut sockaddr,
4121 address_len: *mut socklen_t) -> c_int;
4122 pub fn getsockname(socket: c_int, address: *mut sockaddr,
4123 address_len: *mut socklen_t) -> c_int;
4124 pub fn setsockopt(socket: c_int, level: c_int, name: c_int,
4125 value: *c_void, option_len: socklen_t) -> c_int;
4126 pub fn recv(socket: c_int, buf: *mut c_void, len: size_t,
4127 flags: c_int) -> ssize_t;
4128 pub fn send(socket: c_int, buf: *mut c_void, len: size_t,
4129 flags: c_int) -> ssize_t;
4130 pub fn recvfrom(socket: c_int, buf: *mut c_void, len: size_t,
4131 flags: c_int, addr: *mut sockaddr,
4132 addrlen: *mut socklen_t) -> ssize_t;
4133 pub fn sendto(socket: c_int, buf: *c_void, len: size_t,
4134 flags: c_int, addr: *sockaddr,
4135 addrlen: socklen_t) -> ssize_t;
4136 pub fn shutdown(socket: c_int, how: c_int) -> c_int;
4142 use types::common::c95::{c_void};
4143 use types::os::common::bsd44::{socklen_t, sockaddr, SOCKET};
4144 use types::os::arch::c95::c_int;
4145 use types::os::arch::posix88::ssize_t;
4148 pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> SOCKET;
4149 pub fn connect(socket: SOCKET, address: *sockaddr,
4150 len: socklen_t) -> c_int;
4151 pub fn bind(socket: SOCKET, address: *sockaddr,
4152 address_len: socklen_t) -> c_int;
4153 pub fn listen(socket: SOCKET, backlog: c_int) -> c_int;
4154 pub fn accept(socket: SOCKET, address: *mut sockaddr,
4155 address_len: *mut socklen_t) -> SOCKET;
4156 pub fn getpeername(socket: SOCKET, address: *mut sockaddr,
4157 address_len: *mut socklen_t) -> c_int;
4158 pub fn getsockname(socket: SOCKET, address: *mut sockaddr,
4159 address_len: *mut socklen_t) -> c_int;
4160 pub fn setsockopt(socket: SOCKET, level: c_int, name: c_int,
4161 value: *c_void, option_len: socklen_t) -> c_int;
4162 pub fn closesocket(socket: SOCKET) -> c_int;
4163 pub fn recv(socket: SOCKET, buf: *mut c_void, len: c_int,
4164 flags: c_int) -> c_int;
4165 pub fn send(socket: SOCKET, buf: *mut c_void, len: c_int,
4166 flags: c_int) -> c_int;
4167 pub fn recvfrom(socket: SOCKET, buf: *mut c_void, len: c_int,
4168 flags: c_int, addr: *mut sockaddr,
4169 addrlen: *mut c_int) -> ssize_t;
4170 pub fn sendto(socket: SOCKET, buf: *c_void, len: c_int,
4171 flags: c_int, addr: *sockaddr,
4172 addrlen: c_int) -> c_int;
4173 pub fn shutdown(socket: SOCKET, how: c_int) -> c_int;
4177 #[cfg(target_os = "macos")]
4178 #[cfg(target_os = "ios")]
4179 #[cfg(target_os = "freebsd")]
4181 use types::common::c95::{c_void};
4182 use types::os::arch::c95::{c_char, c_uchar, c_int, c_uint, size_t};
4185 pub fn sysctl(name: *c_int,
4188 oldlenp: *mut size_t,
4192 pub fn sysctlbyname(name: *c_char,
4194 oldlenp: *mut size_t,
4198 pub fn sysctlnametomib(name: *c_char,
4202 pub fn getdtablesize() -> c_int;
4203 pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
4205 pub fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
4211 #[cfg(target_os = "linux")]
4212 #[cfg(target_os = "android")]
4214 use types::common::c95::{c_void};
4215 use types::os::arch::c95::{c_uchar, c_int, size_t};
4218 pub fn getdtablesize() -> c_int;
4219 pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int)
4221 pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
4227 #[cfg(target_os = "win32")]
4231 #[cfg(target_os = "macos")]
4232 #[cfg(target_os = "ios")]
4234 use types::os::arch::c95::{c_char, c_int};
4237 pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32)
4242 #[cfg(target_os = "freebsd")]
4246 #[cfg(target_os = "linux")]
4247 #[cfg(target_os = "android")]
4252 #[cfg(target_os = "win32")]
4256 use types::os::arch::c95::{c_uint};
4257 use types::os::arch::extra::{BOOL, DWORD, SIZE_T, HMODULE,
4259 LPWCH, LPDWORD, LPVOID,
4260 LPCVOID, LPOVERLAPPED,
4261 LPSECURITY_ATTRIBUTES,
4263 LPPROCESS_INFORMATION,
4264 LPMEMORY_BASIC_INFORMATION,
4265 LPSYSTEM_INFO, HANDLE, LPHANDLE,
4266 LARGE_INTEGER, PLARGE_INTEGER,
4270 pub fn GetEnvironmentVariableW(n: LPCWSTR,
4274 pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
4276 pub fn GetEnvironmentStringsW() -> LPWCH;
4277 pub fn FreeEnvironmentStringsW(env_ptr: LPWCH) -> BOOL;
4278 pub fn GetModuleFileNameW(hModule: HMODULE,
4282 pub fn CreateDirectoryW(lpPathName: LPCWSTR,
4283 lpSecurityAttributes:
4284 LPSECURITY_ATTRIBUTES)
4286 pub fn CopyFileW(lpExistingFileName: LPCWSTR,
4287 lpNewFileName: LPCWSTR,
4288 bFailIfExists: BOOL)
4290 pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
4291 pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
4292 pub fn GetCurrentDirectoryW(nBufferLength: DWORD,
4295 pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
4296 pub fn GetLastError() -> DWORD;
4297 pub fn FindFirstFileW(fileName: *u16, findFileData: HANDLE)
4299 pub fn FindNextFileW(findFile: HANDLE, findFileData: HANDLE)
4301 pub fn FindClose(findFile: HANDLE) -> BOOL;
4302 pub fn DuplicateHandle(hSourceProcessHandle: HANDLE,
4303 hSourceHandle: HANDLE,
4304 hTargetProcessHandle: HANDLE,
4305 lpTargetHandle: LPHANDLE,
4306 dwDesiredAccess: DWORD,
4307 bInheritHandle: BOOL,
4310 pub fn CloseHandle(hObject: HANDLE) -> BOOL;
4311 pub fn OpenProcess(dwDesiredAccess: DWORD,
4312 bInheritHandle: BOOL,
4315 pub fn GetCurrentProcess() -> HANDLE;
4316 pub fn CreateProcessW(lpApplicationName: LPCWSTR,
4317 lpCommandLine: LPWSTR,
4318 lpProcessAttributes:
4319 LPSECURITY_ATTRIBUTES,
4321 LPSECURITY_ATTRIBUTES,
4322 bInheritHandles: BOOL,
4323 dwCreationFlags: DWORD,
4324 lpEnvironment: LPVOID,
4325 lpCurrentDirectory: LPCWSTR,
4326 lpStartupInfo: LPSTARTUPINFO,
4327 lpProcessInformation:
4328 LPPROCESS_INFORMATION)
4330 pub fn WaitForSingleObject(hHandle: HANDLE,
4331 dwMilliseconds: DWORD)
4333 pub fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint)
4335 pub fn GetExitCodeProcess(hProcess: HANDLE,
4336 lpExitCode: LPDWORD)
4338 pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
4339 pub fn VirtualAlloc(lpAddress: LPVOID,
4341 flAllocationType: DWORD,
4344 pub fn VirtualFree(lpAddress: LPVOID,
4348 pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
4349 pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
4351 pub fn VirtualProtect(lpAddress: LPVOID,
4353 flNewProtect: DWORD,
4354 lpflOldProtect: LPDWORD)
4356 pub fn VirtualQuery(lpAddress: LPCVOID,
4357 lpBuffer: LPMEMORY_BASIC_INFORMATION,
4360 pub fn CreateFileMappingW(hFile: HANDLE,
4361 lpAttributes: LPSECURITY_ATTRIBUTES,
4363 dwMaximumSizeHigh: DWORD,
4364 dwMaximumSizeLow: DWORD,
4367 pub fn MapViewOfFile(hFileMappingObject: HANDLE,
4368 dwDesiredAccess: DWORD,
4369 dwFileOffsetHigh: DWORD,
4370 dwFileOffsetLow: DWORD,
4371 dwNumberOfBytesToMap: SIZE_T)
4373 pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
4374 pub fn MoveFileExW(lpExistingFileName: LPCWSTR,
4375 lpNewFileName: LPCWSTR,
4376 dwFlags: DWORD) -> BOOL;
4377 pub fn CreateHardLinkW(lpSymlinkFileName: LPCWSTR,
4378 lpTargetFileName: LPCWSTR,
4379 lpSecurityAttributes: LPSECURITY_ATTRIBUTES)
4381 pub fn FlushFileBuffers(hFile: HANDLE) -> BOOL;
4382 pub fn CreateFileW(lpFileName: LPCWSTR,
4383 dwDesiredAccess: DWORD,
4385 lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
4386 dwCreationDisposition: DWORD,
4387 dwFlagsAndAttributes: DWORD,
4388 hTemplateFile: HANDLE) -> HANDLE;
4389 pub fn ReadFile(hFile: HANDLE,
4391 nNumberOfBytesToRead: DWORD,
4392 lpNumberOfBytesRead: LPDWORD,
4393 lpOverlapped: LPOVERLAPPED) -> BOOL;
4394 pub fn WriteFile(hFile: HANDLE,
4396 nNumberOfBytesToRead: DWORD,
4397 lpNumberOfBytesRead: LPDWORD,
4398 lpOverlapped: LPOVERLAPPED) -> BOOL;
4399 pub fn SetFilePointerEx(hFile: HANDLE,
4400 liDistanceToMove: LARGE_INTEGER,
4401 lpNewFilePointer: PLARGE_INTEGER,
4402 dwMoveMethod: DWORD) -> BOOL;
4403 pub fn SetEndOfFile(hFile: HANDLE) -> BOOL;
4405 pub fn GetSystemTimeAsFileTime(
4406 lpSystemTimeAsFileTime: LPFILETIME);
4408 pub fn QueryPerformanceFrequency(
4409 lpFrequency: *mut LARGE_INTEGER) -> BOOL;
4410 pub fn QueryPerformanceCounter(
4411 lpPerformanceCount: *mut LARGE_INTEGER) -> BOOL;
4413 pub fn GetCurrentProcessId() -> DWORD;
4414 pub fn CreateNamedPipeW(
4418 nMaxInstances: DWORD,
4419 nOutBufferSize: DWORD,
4420 nInBufferSize: DWORD,
4421 nDefaultTimeOut: DWORD,
4422 lpSecurityAttributes: LPSECURITY_ATTRIBUTES
4424 pub fn ConnectNamedPipe(hNamedPipe: HANDLE,
4425 lpOverlapped: LPOVERLAPPED) -> BOOL;
4426 pub fn WaitNamedPipeW(lpNamedPipeName: LPCWSTR,
4427 nTimeOut: DWORD) -> BOOL;
4428 pub fn SetNamedPipeHandleState(hNamedPipe: HANDLE,
4430 lpMaxCollectionCount: LPDWORD,
4431 lpCollectDataTimeout: LPDWORD)
4433 pub fn CreateEventW(lpEventAttributes: LPSECURITY_ATTRIBUTES,
4435 bInitialState: BOOL,
4436 lpName: LPCWSTR) -> HANDLE;
4437 pub fn GetOverlappedResult(hFile: HANDLE,
4438 lpOverlapped: LPOVERLAPPED,
4439 lpNumberOfBytesTransferred: LPDWORD,
4440 bWait: BOOL) -> BOOL;
4441 pub fn DisconnectNamedPipe(hNamedPipe: HANDLE) -> BOOL;
4446 use types::os::arch::c95::{c_int, c_long};
4447 use types::os::arch::c99::intptr_t;
4450 #[link_name = "_commit"]
4451 pub fn commit(fd: c_int) -> c_int;
4453 #[link_name = "_get_osfhandle"]
4454 pub fn get_osfhandle(fd: c_int) -> c_long;
4456 #[link_name = "_open_osfhandle"]
4457 pub fn open_osfhandle(osfhandle: intptr_t,
4458 flags: c_int) -> c_int;
4465 pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly
4467 #[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows