1 // Copyright 2012-2015 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.
11 #![crate_name = "libc"]
12 #![crate_type = "rlib"]
13 #![cfg_attr(not(feature = "cargo-build"), unstable)]
14 #![cfg_attr(not(feature = "cargo-build"), staged_api)]
15 #![allow(unknown_features)] #![feature(int_uint)]
18 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
19 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
20 html_root_url = "http://doc.rust-lang.org/nightly/",
21 html_playground_url = "http://play.rust-lang.org/")]
23 //! Bindings for the C standard library and other platform libraries
25 //! **NOTE:** These are *architecture and libc* specific. On Linux, these
26 //! bindings are only correct for glibc.
28 //! This module contains bindings to the C standard library, organized into
29 //! modules by their defining standard. Additionally, it contains some assorted
30 //! platform-specific definitions. For convenience, most functions and types
31 //! are reexported, so `use libc::*` will import the available C bindings as
32 //! appropriate for the target platform. The exact set of functions available
33 //! are platform specific.
35 //! *Note:* Because these definitions are platform-specific, some may not appear
36 //! in the generated documentation.
38 //! We consider the following specs reasonably normative with respect to
39 //! interoperating with the C standard library (libc/msvcrt):
41 //! * ISO 9899:1990 ('C95', 'ANSI C', 'Standard C'), NA1, 1995.
42 //! * ISO 9899:1999 ('C99' or 'C9x').
43 //! * ISO 9945:1988 / IEEE 1003.1-1988 ('POSIX.1').
44 //! * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3').
45 //! * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4').
47 //! Note that any reference to the 1996 revision of POSIX, or any revs between
48 //! 1990 (when '88 was approved at ISO) and 2001 (when the next actual
49 //! revision-revision happened), are merely additions of other chapters (1b and
50 //! 1c) outside the core interfaces.
52 //! Despite having several names each, these are *reasonably* coherent
53 //! point-in-time, list-of-definition sorts of specs. You can get each under a
54 //! variety of names but will wind up with the same definition in each case.
56 //! See standards(7) in linux-manpages for more details.
58 //! Our interface to these libraries is complicated by the non-universality of
59 //! conformance to any of them. About the only thing universally supported is
60 //! the first (C95), beyond that definitions quickly become absent on various
63 //! We therefore wind up dividing our module-space up (mostly for the sake of
64 //! sanity while editing, filling-in-details and eliminating duplication) into
65 //! definitions common-to-all (held in modules named c95, c99, posix88, posix01
66 //! and posix08) and definitions that appear only on *some* platforms (named
67 //! 'extra'). This would be things like significant OSX foundation kit, or Windows
68 //! library kernel32.dll, or various fancy glibc, Linux or BSD extensions.
70 //! In addition to the per-platform 'extra' modules, we define a module of
71 //! 'common BSD' libc routines that never quite made it into POSIX but show up
72 //! in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final
73 //! one from Berkeley after the lawsuits died down and the CSRG dissolved.
75 #![allow(bad_style, raw_pointer_derive)]
77 #[cfg(feature = "cargo-build")] extern crate "std" as core;
78 #[cfg(not(feature = "cargo-build"))] extern crate core;
80 #[cfg(test)] extern crate std;
81 #[cfg(test)] extern crate test;
83 // Explicit export lists for the intersection (provided here) mean that
84 // you can write more-platform-agnostic code if you stick to just these
87 pub use types::common::c95::{FILE, c_void, fpos_t};
88 pub use types::common::c99::{int8_t, int16_t, int32_t, int64_t};
89 pub use types::common::c99::{uint8_t, uint16_t, uint32_t, uint64_t};
90 pub use types::common::posix88::{DIR, dirent_t};
91 pub use types::os::common::posix01::{timeval};
92 pub use types::os::common::bsd44::{addrinfo, in_addr, in6_addr, sockaddr_storage};
93 pub use types::os::common::bsd44::{ip_mreq, ip6_mreq, sockaddr, sockaddr_un};
94 pub use types::os::common::bsd44::{sa_family_t, sockaddr_in, sockaddr_in6, socklen_t};
95 pub use types::os::arch::c95::{c_char, c_double, c_float, c_int, c_uint};
96 pub use types::os::arch::c95::{c_long, c_short, c_uchar, c_ulong, wchar_t};
97 pub use types::os::arch::c95::{c_ushort, clock_t, ptrdiff_t, c_schar};
98 pub use types::os::arch::c95::{size_t, time_t, suseconds_t};
99 pub use types::os::arch::c99::{c_longlong, c_ulonglong};
100 pub use types::os::arch::c99::{intptr_t, uintptr_t};
101 pub use types::os::arch::c99::{intmax_t, uintmax_t};
102 pub use types::os::arch::posix88::{dev_t, ino_t, mode_t};
103 pub use types::os::arch::posix88::{off_t, pid_t, ssize_t};
105 pub use consts::os::c95::{_IOFBF, _IOLBF, _IONBF, BUFSIZ, EOF};
106 pub use consts::os::c95::{EXIT_FAILURE, EXIT_SUCCESS};
107 pub use consts::os::c95::{FILENAME_MAX, FOPEN_MAX, L_tmpnam};
108 pub use consts::os::c95::{RAND_MAX, SEEK_CUR, SEEK_END};
109 pub use consts::os::c95::{SEEK_SET, TMP_MAX};
110 pub use consts::os::posix88::{F_OK, O_APPEND, O_CREAT, O_EXCL};
111 pub use consts::os::posix88::{O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY};
112 pub use consts::os::posix88::{R_OK, S_IEXEC, S_IFBLK, S_IFCHR};
113 pub use consts::os::posix88::{S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IFLNK};
114 pub use consts::os::posix88::{S_IREAD, S_IRUSR, S_IRWXU, S_IWUSR};
115 pub use consts::os::posix88::{STDERR_FILENO, STDIN_FILENO, S_IXUSR};
116 pub use consts::os::posix88::{STDOUT_FILENO, W_OK, X_OK};
117 pub use consts::os::bsd44::{AF_INET, AF_INET6, SOCK_STREAM, SOCK_DGRAM, SOCK_RAW};
118 pub use consts::os::bsd44::{IPPROTO_IP, IPPROTO_IPV6, IPPROTO_TCP, TCP_NODELAY};
119 pub use consts::os::bsd44::{SOL_SOCKET, SO_KEEPALIVE, SO_ERROR};
120 pub use consts::os::bsd44::{SO_REUSEADDR, SO_BROADCAST, SHUT_WR, IP_MULTICAST_LOOP};
121 pub use consts::os::bsd44::{IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP};
122 pub use consts::os::bsd44::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP};
123 pub use consts::os::bsd44::{IP_MULTICAST_TTL, IP_TTL, IP_HDRINCL, SHUT_RD};
124 pub use consts::os::extra::{IPPROTO_RAW};
126 pub use funcs::c95::ctype::{isalnum, isalpha, iscntrl, isdigit};
127 pub use funcs::c95::ctype::{islower, isprint, ispunct, isspace};
128 pub use funcs::c95::ctype::{isupper, isxdigit, tolower, toupper};
130 pub use funcs::c95::stdio::{fclose, feof, ferror, fflush, fgetc};
131 pub use funcs::c95::stdio::{fgetpos, fgets, fopen, fputc, fputs};
132 pub use funcs::c95::stdio::{fread, freopen, fseek, fsetpos, ftell};
133 pub use funcs::c95::stdio::{fwrite, perror, puts, remove, rename, rewind};
134 pub use funcs::c95::stdio::{setbuf, setvbuf, tmpfile, ungetc};
136 pub use funcs::c95::stdlib::{abs, atof, atoi, calloc, exit, _exit, atexit};
137 pub use funcs::c95::stdlib::{free, getenv, labs, malloc, rand};
138 pub use funcs::c95::stdlib::{realloc, srand, strtod, strtol};
139 pub use funcs::c95::stdlib::{strtoul, system};
141 pub use funcs::c95::string::{memchr, memcmp};
142 pub use funcs::c95::string::{strcat, strchr, strcmp};
143 pub use funcs::c95::string::{strcoll, strcpy, strcspn, strerror};
144 pub use funcs::c95::string::{strlen, strncat, strncmp, strncpy};
145 pub use funcs::c95::string::{strpbrk, strrchr, strspn, strstr};
146 pub use funcs::c95::string::{strtok, strxfrm};
148 pub use funcs::posix88::fcntl::{open, creat};
149 pub use funcs::posix88::stat_::{chmod, fstat, mkdir, stat};
150 pub use funcs::posix88::stdio::{fdopen, fileno, pclose, popen};
151 pub use funcs::posix88::unistd::{access, chdir, close, dup, dup2};
152 pub use funcs::posix88::unistd::{execv, execve, execvp, getcwd};
153 pub use funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read};
154 pub use funcs::posix88::unistd::{rmdir, unlink, write};
156 pub use funcs::bsd43::{socket, setsockopt, bind, send, recv, recvfrom};
157 pub use funcs::bsd43::{listen, sendto, accept, connect, getpeername, getsockname};
158 pub use funcs::bsd43::{shutdown};
160 // But we also reexport most everything
161 // if you're interested in writing platform-specific code.
163 // FIXME: This is a mess, but the design of this entire module needs to be
164 // reconsidered, so I'm not inclined to do better right now. As part of
165 // #11870 I removed all the pub globs here, leaving explicit reexports
166 // of everything that is actually used in-tree.
168 // So the following exports don't follow any particular plan.
170 #[cfg(unix)] pub use consts::os::sysconf::{_SC_PAGESIZE};
171 #[cfg(unix)] pub use consts::os::posix88::{PROT_READ, PROT_WRITE, PROT_EXEC};
172 #[cfg(unix)] pub use consts::os::posix88::{MAP_FIXED, MAP_FILE, MAP_ANON, MAP_PRIVATE, MAP_FAILED};
173 #[cfg(unix)] pub use consts::os::posix88::{EACCES, EBADF, EINVAL, ENODEV, ENOMEM};
174 #[cfg(unix)] pub use consts::os::posix88::{ECONNREFUSED, ECONNRESET, EPERM, EPIPE};
175 #[cfg(unix)] pub use consts::os::posix88::{ENOTCONN, ECONNABORTED, EADDRNOTAVAIL, EINTR};
176 #[cfg(unix)] pub use consts::os::posix88::{EADDRINUSE, ENOENT, EISDIR, EAGAIN, EWOULDBLOCK};
177 #[cfg(unix)] pub use consts::os::posix88::{ECANCELED, SIGINT, EINPROGRESS};
178 #[cfg(unix)] pub use consts::os::posix88::{ENOSYS, ENOTTY, ETIMEDOUT, EMFILE};
179 #[cfg(unix)] pub use consts::os::posix88::{SIGTERM, SIGKILL, SIGPIPE, PROT_NONE};
180 #[cfg(unix)] pub use consts::os::posix01::{SIG_IGN, F_GETFL, F_SETFL};
181 #[cfg(unix)] pub use consts::os::bsd44::{AF_UNIX};
182 #[cfg(unix)] pub use consts::os::extra::{O_NONBLOCK};
184 #[cfg(unix)] pub use types::os::common::posix01::{pthread_t, timespec, timezone};
186 #[cfg(unix)] pub use types::os::arch::posix88::{uid_t, gid_t};
187 #[cfg(unix)] pub use types::os::arch::posix01::{pthread_attr_t};
188 #[cfg(unix)] pub use types::os::arch::posix01::{stat, utimbuf};
189 #[cfg(unix)] pub use types::os::common::bsd44::{ifaddrs};
190 #[cfg(unix)] pub use funcs::posix88::unistd::{sysconf, setgid, setsid, setuid, pread, pwrite};
191 #[cfg(unix)] pub use funcs::posix88::unistd::{getgid, getuid, getsid};
192 #[cfg(unix)] pub use funcs::posix88::unistd::{_PC_NAME_MAX, utime, nanosleep, pathconf, link};
193 #[cfg(unix)] pub use funcs::posix88::unistd::{chown};
194 #[cfg(unix)] pub use funcs::posix88::mman::{mmap, munmap, mprotect};
195 #[cfg(unix)] pub use funcs::posix88::dirent::{opendir, readdir_r, closedir};
196 #[cfg(unix)] pub use funcs::posix88::fcntl::{fcntl};
197 #[cfg(unix)] pub use funcs::posix88::net::{if_nametoindex};
198 #[cfg(unix)] pub use funcs::posix01::stat_::{lstat};
199 #[cfg(unix)] pub use funcs::posix01::unistd::{fsync, ftruncate};
200 #[cfg(unix)] pub use funcs::posix01::unistd::{readlink, symlink};
201 #[cfg(unix)] pub use funcs::bsd43::{getifaddrs, freeifaddrs};
203 #[cfg(windows)] pub use consts::os::c95::{WSAECONNREFUSED, WSAECONNRESET, WSAEACCES};
204 #[cfg(windows)] pub use consts::os::c95::{WSAEWOULDBLOCK, WSAENOTCONN, WSAECONNABORTED};
205 #[cfg(windows)] pub use consts::os::c95::{WSAEADDRNOTAVAIL, WSAEADDRINUSE, WSAEINTR};
206 #[cfg(windows)] pub use consts::os::c95::{WSAEINPROGRESS, WSAEINVAL, WSAEMFILE};
207 #[cfg(windows)] pub use consts::os::extra::{ERROR_INSUFFICIENT_BUFFER};
208 #[cfg(windows)] pub use consts::os::extra::{O_BINARY, O_NOINHERIT, PAGE_NOACCESS};
209 #[cfg(windows)] pub use consts::os::extra::{PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE};
210 #[cfg(windows)] pub use consts::os::extra::{PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE};
211 #[cfg(windows)] pub use consts::os::extra::{MEM_COMMIT, MEM_RESERVE, MEM_RELEASE};
212 #[cfg(windows)] pub use consts::os::extra::{FILE_MAP_READ, FILE_MAP_WRITE, FILE_MAP_EXECUTE};
213 #[cfg(windows)] pub use consts::os::extra::{ERROR_ALREADY_EXISTS, ERROR_NO_DATA};
214 #[cfg(windows)] pub use consts::os::extra::{ERROR_FILE_NOT_FOUND, ERROR_INVALID_NAME};
215 #[cfg(windows)] pub use consts::os::extra::{ERROR_BROKEN_PIPE, ERROR_INVALID_FUNCTION};
216 #[cfg(windows)] pub use consts::os::extra::{ERROR_CALL_NOT_IMPLEMENTED};
217 #[cfg(windows)] pub use consts::os::extra::{ERROR_NOTHING_TO_TERMINATE};
218 #[cfg(windows)] pub use consts::os::extra::{ERROR_INVALID_HANDLE};
219 #[cfg(windows)] pub use consts::os::extra::{TRUE, FALSE, INFINITE};
220 #[cfg(windows)] pub use consts::os::extra::{PROCESS_TERMINATE, PROCESS_QUERY_INFORMATION};
221 #[cfg(windows)] pub use consts::os::extra::{STILL_ACTIVE, DETACHED_PROCESS};
222 #[cfg(windows)] pub use consts::os::extra::{CREATE_NEW_PROCESS_GROUP, CREATE_UNICODE_ENVIRONMENT};
223 #[cfg(windows)] pub use consts::os::extra::{FILE_BEGIN, FILE_END, FILE_CURRENT};
224 #[cfg(windows)] pub use consts::os::extra::{FILE_GENERIC_READ, FILE_GENERIC_WRITE};
225 #[cfg(windows)] pub use consts::os::extra::{FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE};
226 #[cfg(windows)] pub use consts::os::extra::{TRUNCATE_EXISTING, CREATE_ALWAYS, OPEN_EXISTING};
227 #[cfg(windows)] pub use consts::os::extra::{CREATE_NEW, FILE_APPEND_DATA, FILE_WRITE_DATA};
228 #[cfg(windows)] pub use consts::os::extra::{OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL};
229 #[cfg(windows)] pub use consts::os::extra::{FILE_FLAG_BACKUP_SEMANTICS, INVALID_HANDLE_VALUE};
230 #[cfg(windows)] pub use consts::os::extra::{MOVEFILE_REPLACE_EXISTING};
231 #[cfg(windows)] pub use consts::os::extra::{GENERIC_READ, GENERIC_WRITE};
232 #[cfg(windows)] pub use consts::os::extra::{VOLUME_NAME_DOS};
233 #[cfg(windows)] pub use consts::os::extra::{PIPE_ACCESS_DUPLEX, FILE_FLAG_FIRST_PIPE_INSTANCE};
234 #[cfg(windows)] pub use consts::os::extra::{FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE};
235 #[cfg(windows)] pub use consts::os::extra::{PIPE_READMODE_BYTE, PIPE_WAIT};
236 #[cfg(windows)] pub use consts::os::extra::{PIPE_UNLIMITED_INSTANCES, ERROR_ACCESS_DENIED};
237 #[cfg(windows)] pub use consts::os::extra::{FILE_WRITE_ATTRIBUTES, FILE_READ_ATTRIBUTES};
238 #[cfg(windows)] pub use consts::os::extra::{ERROR_PIPE_BUSY, ERROR_IO_PENDING};
239 #[cfg(windows)] pub use consts::os::extra::{ERROR_PIPE_CONNECTED, WAIT_OBJECT_0};
240 #[cfg(windows)] pub use consts::os::extra::{ERROR_NOT_FOUND};
241 #[cfg(windows)] pub use consts::os::extra::{ERROR_OPERATION_ABORTED};
242 #[cfg(windows)] pub use consts::os::extra::{FIONBIO};
243 #[cfg(windows)] pub use types::os::common::bsd44::{SOCKET};
244 #[cfg(windows)] pub use types::os::common::posix01::{stat, utimbuf};
245 #[cfg(windows)] pub use types::os::arch::extra::{HANDLE, BOOL, LPSECURITY_ATTRIBUTES};
246 #[cfg(windows)] pub use types::os::arch::extra::{LPCSTR, WORD, DWORD, BYTE, FILETIME};
247 #[cfg(windows)] pub use types::os::arch::extra::{LARGE_INTEGER, LPVOID, LONG};
248 #[cfg(windows)] pub use types::os::arch::extra::{time64_t, OVERLAPPED, LPCWSTR};
249 #[cfg(windows)] pub use types::os::arch::extra::{LPOVERLAPPED, SIZE_T, LPDWORD};
250 #[cfg(windows)] pub use types::os::arch::extra::{SECURITY_ATTRIBUTES, WIN32_FIND_DATAW};
251 #[cfg(windows)] pub use funcs::c95::string::{wcslen};
252 #[cfg(windows)] pub use funcs::posix88::stat_::{wstat, wutime, wchmod, wrmdir};
253 #[cfg(windows)] pub use funcs::bsd43::{closesocket};
254 #[cfg(windows)] pub use funcs::extra::kernel32::{GetCurrentDirectoryW, GetLastError};
255 #[cfg(windows)] pub use funcs::extra::kernel32::{GetEnvironmentVariableW, SetEnvironmentVariableW};
256 #[cfg(windows)] pub use funcs::extra::kernel32::{GetModuleFileNameW, SetCurrentDirectoryW};
257 #[cfg(windows)] pub use funcs::extra::kernel32::{GetSystemInfo, VirtualAlloc, VirtualFree};
258 #[cfg(windows)] pub use funcs::extra::kernel32::{CreateFileMappingW, MapViewOfFile};
259 #[cfg(windows)] pub use funcs::extra::kernel32::{UnmapViewOfFile, CloseHandle};
260 #[cfg(windows)] pub use funcs::extra::kernel32::{WaitForSingleObject, GetSystemTimeAsFileTime};
261 #[cfg(windows)] pub use funcs::extra::kernel32::{QueryPerformanceCounter};
262 #[cfg(windows)] pub use funcs::extra::kernel32::{QueryPerformanceFrequency};
263 #[cfg(windows)] pub use funcs::extra::kernel32::{GetExitCodeProcess, TerminateProcess};
264 #[cfg(windows)] pub use funcs::extra::kernel32::{ReadFile, WriteFile, SetFilePointerEx};
265 #[cfg(windows)] pub use funcs::extra::kernel32::{SetEndOfFile, CreateFileW};
266 #[cfg(windows)] pub use funcs::extra::kernel32::{CreateDirectoryW, FindFirstFileW};
267 #[cfg(windows)] pub use funcs::extra::kernel32::{FindNextFileW, FindClose, DeleteFileW};
268 #[cfg(windows)] pub use funcs::extra::kernel32::{CreateHardLinkW, CreateEventW};
269 #[cfg(windows)] pub use funcs::extra::kernel32::{FlushFileBuffers, CreateNamedPipeW};
270 #[cfg(windows)] pub use funcs::extra::kernel32::{SetNamedPipeHandleState, WaitNamedPipeW};
271 #[cfg(windows)] pub use funcs::extra::kernel32::{GetOverlappedResult, ConnectNamedPipe};
272 #[cfg(windows)] pub use funcs::extra::kernel32::{DisconnectNamedPipe, OpenProcess};
273 #[cfg(windows)] pub use funcs::extra::kernel32::{MoveFileExW, VirtualProtect};
274 #[cfg(windows)] pub use funcs::extra::msvcrt::{get_osfhandle, open_osfhandle};
275 #[cfg(windows)] pub use funcs::extra::winsock::{ioctlsocket};
277 #[cfg(any(target_os = "linux",
278 target_os = "android",
279 target_os = "freebsd",
280 target_os = "dragonfly"))]
281 pub use consts::os::posix01::{CLOCK_REALTIME, CLOCK_MONOTONIC};
283 #[cfg(any(target_os = "linux", target_os = "android"))]
284 pub use funcs::posix01::unistd::{fdatasync};
285 #[cfg(any(target_os = "linux", target_os = "android"))]
286 pub use types::os::arch::extra::{sockaddr_ll};
287 #[cfg(any(target_os = "linux", target_os = "android"))]
288 pub use consts::os::extra::{AF_PACKET};
290 #[cfg(all(unix, not(target_os = "freebsd")))]
291 pub use consts::os::extra::{MAP_STACK};
293 #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
294 pub use consts::os::bsd44::{TCP_KEEPIDLE};
296 #[cfg(any(target_os = "macos", target_os = "ios"))]
297 pub use consts::os::bsd44::{TCP_KEEPALIVE};
298 #[cfg(any(target_os = "macos", target_os = "ios"))]
299 pub use consts::os::extra::{F_FULLFSYNC};
301 #[cfg(any(target_os = "macos", target_os = "ios"))]
302 pub use types::os::arch::extra::{mach_timebase_info};
312 // Types tend to vary *per architecture* so we pull their definitions out
315 // Standard types that are opaque or common, so are not per-target.
318 /// Type used to construct void pointers for use with C.
320 /// This type is only useful as a pointer target. Do not use it as a
321 /// return type for FFI functions which have the `void` return type in
322 /// C. Use the unit type `()` or omit the return type instead.
324 /// For LLVM to recognize the void pointer type and by extension
325 /// functions like malloc(), we need to have it represented as i8* in
326 /// LLVM bitcode. The enum used here ensures this and prevents misuse
327 /// of the "raw" type by only having private variants.. We need two
328 /// variants, because the compiler complains about the repr attribute
331 #[allow(missing_copy_implementations)]
337 #[allow(missing_copy_implementations)]
339 #[allow(missing_copy_implementations)]
343 pub type int8_t = i8;
344 pub type int16_t = i16;
345 pub type int32_t = i32;
346 pub type int64_t = i64;
347 pub type uint8_t = u8;
348 pub type uint16_t = u16;
349 pub type uint32_t = u32;
350 pub type uint64_t = u64;
353 #[allow(missing_copy_implementations)]
355 #[allow(missing_copy_implementations)]
363 // Standard types that are scalar but vary by OS and arch.
365 #[cfg(any(target_os = "linux", target_os = "android"))]
369 use types::common::c95::{c_void};
370 use types::os::arch::c95::{c_char, c_ulong, size_t,
371 time_t, suseconds_t, c_long};
373 pub type pthread_t = c_ulong;
376 #[derive(Copy)] pub struct glob_t {
377 pub gl_pathc: size_t,
378 pub gl_pathv: *mut *mut c_char,
381 pub __unused1: *mut c_void,
382 pub __unused2: *mut c_void,
383 pub __unused3: *mut c_void,
384 pub __unused4: *mut c_void,
385 pub __unused5: *mut c_void,
389 #[derive(Copy)] pub struct timeval {
391 pub tv_usec: suseconds_t,
395 #[derive(Copy)] pub struct timespec {
400 #[derive(Copy)] pub enum timezone {}
402 pub type sighandler_t = size_t;
405 use types::common::c95::{c_void};
406 use types::os::arch::c95::{c_char, c_int, c_uint};
408 pub type socklen_t = u32;
409 pub type sa_family_t = u16;
410 pub type in_port_t = u16;
411 pub type in_addr_t = u32;
413 #[derive(Copy)] pub struct sockaddr {
414 pub sa_family: sa_family_t,
415 pub sa_data: [u8; 14],
418 #[derive(Copy)] pub struct sockaddr_storage {
419 pub ss_family: sa_family_t,
421 pub __ss_pad2: [u8; 112],
424 #[derive(Copy)] pub struct sockaddr_in {
425 pub sin_family: sa_family_t,
426 pub sin_port: in_port_t,
427 pub sin_addr: in_addr,
428 pub sin_zero: [u8; 8],
431 #[derive(Copy)] pub struct in_addr {
432 pub s_addr: in_addr_t,
435 #[derive(Copy)] pub struct sockaddr_in6 {
436 pub sin6_family: sa_family_t,
437 pub sin6_port: in_port_t,
438 pub sin6_flowinfo: u32,
439 pub sin6_addr: in6_addr,
440 pub sin6_scope_id: u32,
443 #[derive(Copy)] pub struct in6_addr {
444 pub s6_addr: [u16; 8]
447 #[derive(Copy)] pub struct ip_mreq {
448 pub imr_multiaddr: in_addr,
449 pub imr_interface: in_addr,
452 #[derive(Copy)] pub struct ip6_mreq {
453 pub ipv6mr_multiaddr: in6_addr,
454 pub ipv6mr_interface: c_uint,
457 #[derive(Copy)] pub struct addrinfo {
459 pub ai_family: c_int,
460 pub ai_socktype: c_int,
461 pub ai_protocol: c_int,
462 pub ai_addrlen: socklen_t,
464 #[cfg(target_os = "linux")]
465 pub ai_addr: *mut sockaddr,
467 #[cfg(target_os = "linux")]
468 pub ai_canonname: *mut c_char,
470 #[cfg(target_os = "android")]
471 pub ai_canonname: *mut c_char,
473 #[cfg(target_os = "android")]
474 pub ai_addr: *mut sockaddr,
476 pub ai_next: *mut addrinfo,
479 #[derive(Copy)] pub struct sockaddr_un {
480 pub sun_family: sa_family_t,
481 pub sun_path: [c_char; 108]
485 #[derive(Copy)] pub struct ifaddrs {
486 pub ifa_next: *mut ifaddrs,
487 pub ifa_name: *mut c_char,
488 pub ifa_flags: c_uint,
489 pub ifa_addr: *mut sockaddr,
490 pub ifa_netmask: *mut sockaddr,
491 pub ifa_ifu: *mut sockaddr, // FIXME This should be a union
492 pub ifa_data: *mut c_void
498 #[cfg(any(target_arch = "x86",
500 target_arch = "mips",
501 target_arch = "mipsel",
502 target_arch = "powerpc"))]
505 pub type c_char = i8;
506 pub type c_schar = i8;
507 pub type c_uchar = u8;
508 pub type c_short = i16;
509 pub type c_ushort = u16;
510 pub type c_int = i32;
511 pub type c_uint = u32;
512 pub type c_long = i32;
513 pub type c_ulong = u32;
514 pub type c_float = f32;
515 pub type c_double = f64;
516 pub type size_t = u32;
517 pub type ptrdiff_t = i32;
518 pub type clock_t = i32;
519 pub type time_t = i32;
520 pub type suseconds_t = i32;
521 pub type wchar_t = i32;
524 pub type c_longlong = i64;
525 pub type c_ulonglong = u64;
526 pub type intptr_t = i32;
527 pub type uintptr_t = u32;
528 pub type intmax_t = i64;
529 pub type uintmax_t = u64;
531 #[cfg(any(target_arch = "x86",
532 target_arch = "mips",
533 target_arch = "mipsel",
534 target_arch = "powerpc"))]
536 pub type off_t = i32;
537 pub type dev_t = u64;
538 pub type ino_t = u32;
539 pub type pid_t = i32;
540 pub type uid_t = u32;
541 pub type gid_t = u32;
542 pub type useconds_t = u32;
543 pub type mode_t = u32;
544 pub type ssize_t = i32;
546 #[cfg(target_arch = "arm")]
548 pub type off_t = i32;
549 pub type dev_t = u32;
550 pub type ino_t = u32;
551 pub type pid_t = i32;
552 pub type uid_t = u32;
553 pub type gid_t = u32;
554 pub type useconds_t = u32;
555 pub type mode_t = u16;
556 pub type ssize_t = i32;
558 #[cfg(any(target_arch = "x86",
559 target_arch = "powerpc"))]
561 use types::os::arch::c95::{c_short, c_long, time_t};
562 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
563 use types::os::arch::posix88::{mode_t, off_t};
564 use types::os::arch::posix88::{uid_t};
566 pub type nlink_t = u32;
567 pub type blksize_t = i32;
568 pub type blkcnt_t = i32;
571 #[derive(Copy)] pub struct stat {
576 pub st_nlink: nlink_t,
582 pub st_blksize: blksize_t,
583 pub st_blocks: blkcnt_t,
584 pub st_atime: time_t,
585 pub st_atime_nsec: c_long,
586 pub st_mtime: time_t,
587 pub st_mtime_nsec: c_long,
588 pub st_ctime: time_t,
589 pub st_ctime_nsec: c_long,
590 pub __unused4: c_long,
591 pub __unused5: c_long,
595 #[derive(Copy)] pub struct utimbuf {
601 #[derive(Copy)] pub struct pthread_attr_t {
605 #[cfg(target_arch = "arm")]
607 use types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
608 use types::os::arch::c99::{c_longlong, c_ulonglong};
609 use types::os::arch::posix88::{uid_t, gid_t, ino_t};
611 pub type nlink_t = u16;
612 pub type blksize_t = u32;
613 pub type blkcnt_t = u32;
616 #[derive(Copy)] pub struct stat {
617 pub st_dev: c_ulonglong,
618 pub __pad0: [c_uchar; 4],
621 pub st_nlink: c_uint,
624 pub st_rdev: c_ulonglong,
625 pub __pad3: [c_uchar; 4],
626 pub st_size: c_longlong,
627 pub st_blksize: blksize_t,
628 pub st_blocks: c_ulonglong,
629 pub st_atime: time_t,
630 pub st_atime_nsec: c_ulong,
631 pub st_mtime: time_t,
632 pub st_mtime_nsec: c_ulong,
633 pub st_ctime: time_t,
634 pub st_ctime_nsec: c_ulong,
635 pub st_ino: c_ulonglong,
639 #[derive(Copy)] pub struct utimbuf {
645 #[derive(Copy)] pub struct pthread_attr_t {
649 #[cfg(any(target_arch = "mips",
650 target_arch = "mipsel"))]
652 use types::os::arch::c95::{c_long, c_ulong, time_t};
653 use types::os::arch::posix88::{gid_t, ino_t};
654 use types::os::arch::posix88::{mode_t, off_t};
655 use types::os::arch::posix88::{uid_t};
657 pub type nlink_t = u32;
658 pub type blksize_t = i32;
659 pub type blkcnt_t = i32;
662 #[derive(Copy)] pub struct stat {
664 pub st_pad1: [c_long; 3],
667 pub st_nlink: nlink_t,
670 pub st_rdev: c_ulong,
671 pub st_pad2: [c_long; 2],
674 pub st_atime: time_t,
675 pub st_atime_nsec: c_long,
676 pub st_mtime: time_t,
677 pub st_mtime_nsec: c_long,
678 pub st_ctime: time_t,
679 pub st_ctime_nsec: c_long,
680 pub st_blksize: blksize_t,
681 pub st_blocks: blkcnt_t,
682 pub st_pad5: [c_long; 14],
686 #[derive(Copy)] pub struct utimbuf {
692 #[derive(Copy)] pub struct pthread_attr_t {
699 use types::os::arch::c95::{c_ushort, c_int, c_uchar};
701 #[derive(Copy)] pub struct sockaddr_ll {
702 pub sll_family: c_ushort,
703 pub sll_protocol: c_ushort,
704 pub sll_ifindex: c_int,
705 pub sll_hatype: c_ushort,
706 pub sll_pkttype: c_uchar,
707 pub sll_halen: c_uchar,
708 pub sll_addr: [c_uchar; 8]
714 #[cfg(any(target_arch = "x86_64",
715 target_arch = "aarch64"))]
718 #[cfg(not(target_arch = "aarch64"))]
719 pub type c_char = i8;
720 #[cfg(target_arch = "aarch64")]
721 pub type c_char = u8;
722 pub type c_schar = i8;
723 pub type c_uchar = u8;
724 pub type c_short = i16;
725 pub type c_ushort = u16;
726 pub type c_int = i32;
727 pub type c_uint = u32;
728 pub type c_long = i64;
729 pub type c_ulong = u64;
730 pub type c_float = f32;
731 pub type c_double = f64;
732 pub type size_t = u64;
733 pub type ptrdiff_t = i64;
734 pub type clock_t = i64;
735 pub type time_t = i64;
736 pub type suseconds_t = i64;
737 #[cfg(not(target_arch = "aarch64"))]
738 pub type wchar_t = i32;
739 #[cfg(target_arch = "aarch64")]
740 pub type wchar_t = u32;
743 pub type c_longlong = i64;
744 pub type c_ulonglong = u64;
745 pub type intptr_t = i64;
746 pub type uintptr_t = u64;
747 pub type intmax_t = i64;
748 pub type uintmax_t = u64;
751 pub type off_t = i64;
752 pub type dev_t = u64;
753 pub type ino_t = u64;
754 pub type pid_t = i32;
755 pub type uid_t = u32;
756 pub type gid_t = u32;
757 pub type useconds_t = u32;
758 pub type mode_t = u32;
759 pub type ssize_t = i64;
761 #[cfg(not(target_arch = "aarch64"))]
763 use types::os::arch::c95::{c_int, c_long, time_t};
764 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
765 use types::os::arch::posix88::{mode_t, off_t};
766 use types::os::arch::posix88::{uid_t};
768 pub type nlink_t = u64;
769 pub type blksize_t = i64;
770 pub type blkcnt_t = i64;
773 #[derive(Copy)] pub struct stat {
776 pub st_nlink: nlink_t,
783 pub st_blksize: blksize_t,
784 pub st_blocks: blkcnt_t,
785 pub st_atime: time_t,
786 pub st_atime_nsec: c_long,
787 pub st_mtime: time_t,
788 pub st_mtime_nsec: c_long,
789 pub st_ctime: time_t,
790 pub st_ctime_nsec: c_long,
791 pub __unused: [c_long; 3],
795 #[derive(Copy)] pub struct utimbuf {
801 #[derive(Copy)] pub struct pthread_attr_t {
805 #[cfg(target_arch = "aarch64")]
807 use types::os::arch::c95::{c_int, c_long, time_t};
808 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
809 use types::os::arch::posix88::{mode_t, off_t};
810 use types::os::arch::posix88::{uid_t};
812 pub type nlink_t = u32;
813 pub type blksize_t = i32;
814 pub type blkcnt_t = i64;
817 #[derive(Copy)] pub struct stat {
821 pub st_nlink: nlink_t,
827 pub st_blksize: blksize_t,
829 pub st_blocks: blkcnt_t,
830 pub st_atime: time_t,
831 pub st_atime_nsec: c_long,
832 pub st_mtime: time_t,
833 pub st_mtime_nsec: c_long,
834 pub st_ctime: time_t,
835 pub st_ctime_nsec: c_long,
836 pub __unused: [c_int; 2],
840 #[derive(Copy)] pub struct utimbuf {
846 #[derive(Copy)] pub struct pthread_attr_t {
855 use types::os::arch::c95::{c_ushort, c_int, c_uchar};
856 #[derive(Copy)] pub struct sockaddr_ll {
857 pub sll_family: c_ushort,
858 pub sll_protocol: c_ushort,
859 pub sll_ifindex: c_int,
860 pub sll_hatype: c_ushort,
861 pub sll_pkttype: c_uchar,
862 pub sll_halen: c_uchar,
863 pub sll_addr: [c_uchar; 8]
870 #[cfg(target_os = "freebsd")]
874 use types::common::c95::{c_void};
875 use types::os::arch::c95::{c_char, c_int, size_t,
876 time_t, suseconds_t, c_long};
877 use types::os::arch::c99::{uintptr_t};
879 pub type pthread_t = uintptr_t;
882 #[derive(Copy)] pub struct glob_t {
883 pub gl_pathc: size_t,
884 pub __unused1: size_t,
886 pub __unused2: c_int,
887 pub gl_pathv: *mut *mut c_char,
889 pub __unused3: *mut c_void,
891 pub __unused4: *mut c_void,
892 pub __unused5: *mut c_void,
893 pub __unused6: *mut c_void,
894 pub __unused7: *mut c_void,
895 pub __unused8: *mut c_void,
899 #[derive(Copy)] pub struct timeval {
901 pub tv_usec: suseconds_t,
905 #[derive(Copy)] pub struct timespec {
910 #[derive(Copy)] pub enum timezone {}
912 pub type sighandler_t = size_t;
915 use types::common::c95::{c_void};
916 use types::os::arch::c95::{c_char, c_int, c_uint};
918 pub type socklen_t = u32;
919 pub type sa_family_t = u8;
920 pub type in_port_t = u16;
921 pub type in_addr_t = u32;
923 #[derive(Copy)] pub struct sockaddr {
925 pub sa_family: sa_family_t,
926 pub sa_data: [u8; 14],
929 #[derive(Copy)] pub struct sockaddr_storage {
931 pub ss_family: sa_family_t,
932 pub __ss_pad1: [u8; 6],
934 pub __ss_pad2: [u8; 112],
937 #[derive(Copy)] pub struct sockaddr_in {
939 pub sin_family: sa_family_t,
940 pub sin_port: in_port_t,
941 pub sin_addr: in_addr,
942 pub sin_zero: [u8; 8],
945 #[derive(Copy)] pub struct in_addr {
946 pub s_addr: in_addr_t,
949 #[derive(Copy)] pub struct sockaddr_in6 {
951 pub sin6_family: sa_family_t,
952 pub sin6_port: in_port_t,
953 pub sin6_flowinfo: u32,
954 pub sin6_addr: in6_addr,
955 pub sin6_scope_id: u32,
958 #[derive(Copy)] pub struct in6_addr {
959 pub s6_addr: [u16; 8]
962 #[derive(Copy)] pub struct ip_mreq {
963 pub imr_multiaddr: in_addr,
964 pub imr_interface: in_addr,
967 #[derive(Copy)] pub struct ip6_mreq {
968 pub ipv6mr_multiaddr: in6_addr,
969 pub ipv6mr_interface: c_uint,
972 #[derive(Copy)] pub struct addrinfo {
974 pub ai_family: c_int,
975 pub ai_socktype: c_int,
976 pub ai_protocol: c_int,
977 pub ai_addrlen: socklen_t,
978 pub ai_canonname: *mut c_char,
979 pub ai_addr: *mut sockaddr,
980 pub ai_next: *mut addrinfo,
983 #[derive(Copy)] pub struct sockaddr_un {
985 pub sun_family: sa_family_t,
986 pub sun_path: [c_char; 104]
989 #[derive(Copy)] pub struct ifaddrs {
990 pub ifa_next: *mut ifaddrs,
991 pub ifa_name: *mut c_char,
992 pub ifa_flags: c_uint,
993 pub ifa_addr: *mut sockaddr,
994 pub ifa_netmask: *mut sockaddr,
995 pub ifa_dstaddr: *mut sockaddr,
996 pub ifa_data: *mut c_void
1003 #[cfg(target_arch = "x86_64")]
1006 pub type c_char = i8;
1007 pub type c_schar = i8;
1008 pub type c_uchar = u8;
1009 pub type c_short = i16;
1010 pub type c_ushort = u16;
1011 pub type c_int = i32;
1012 pub type c_uint = u32;
1013 pub type c_long = i64;
1014 pub type c_ulong = u64;
1015 pub type c_float = f32;
1016 pub type c_double = f64;
1017 pub type size_t = u64;
1018 pub type ptrdiff_t = i64;
1019 pub type clock_t = i32;
1020 pub type time_t = i64;
1021 pub type suseconds_t = i64;
1022 pub type wchar_t = i32;
1025 pub type c_longlong = i64;
1026 pub type c_ulonglong = u64;
1027 pub type intptr_t = i64;
1028 pub type uintptr_t = u64;
1029 pub type intmax_t = i64;
1030 pub type uintmax_t = u64;
1033 pub type off_t = i64;
1034 pub type dev_t = u32;
1035 pub type ino_t = u32;
1036 pub type pid_t = i32;
1037 pub type uid_t = u32;
1038 pub type gid_t = u32;
1039 pub type useconds_t = u32;
1040 pub type mode_t = u16;
1041 pub type ssize_t = i64;
1044 use types::common::c95::{c_void};
1045 use types::common::c99::{uint8_t, uint32_t, int32_t};
1046 use types::os::arch::c95::{c_long, time_t};
1047 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
1048 use types::os::arch::posix88::{mode_t, off_t};
1049 use types::os::arch::posix88::{uid_t};
1051 pub type nlink_t = u16;
1052 pub type blksize_t = i64;
1053 pub type blkcnt_t = i64;
1054 pub type fflags_t = u32;
1056 #[derive(Copy)] pub struct stat {
1059 pub st_mode: mode_t,
1060 pub st_nlink: nlink_t,
1064 pub st_atime: time_t,
1065 pub st_atime_nsec: c_long,
1066 pub st_mtime: time_t,
1067 pub st_mtime_nsec: c_long,
1068 pub st_ctime: time_t,
1069 pub st_ctime_nsec: c_long,
1071 pub st_blocks: blkcnt_t,
1072 pub st_blksize: blksize_t,
1073 pub st_flags: fflags_t,
1074 pub st_gen: uint32_t,
1075 pub st_lspare: int32_t,
1076 pub st_birthtime: time_t,
1077 pub st_birthtime_nsec: c_long,
1078 pub __unused: [uint8_t; 2],
1082 #[derive(Copy)] pub struct utimbuf {
1084 pub modtime: time_t,
1087 pub type pthread_attr_t = *mut c_void;
1098 #[cfg(target_os = "dragonfly")]
1102 use types::common::c95::{c_void};
1103 use types::os::arch::c95::{c_char, c_int, size_t,
1104 time_t, suseconds_t, c_long};
1105 use types::os::arch::c99::{uintptr_t};
1107 pub type pthread_t = uintptr_t;
1110 #[derive(Copy)] pub struct glob_t {
1111 pub gl_pathc: size_t,
1112 pub __unused1: size_t,
1113 pub gl_offs: size_t,
1114 pub __unused2: c_int,
1115 pub gl_pathv: *mut *mut c_char,
1117 pub __unused3: *mut c_void,
1119 pub __unused4: *mut c_void,
1120 pub __unused5: *mut c_void,
1121 pub __unused6: *mut c_void,
1122 pub __unused7: *mut c_void,
1123 pub __unused8: *mut c_void,
1127 #[derive(Copy)] pub struct timeval {
1129 pub tv_usec: suseconds_t,
1133 #[derive(Copy)] pub struct timespec {
1135 pub tv_nsec: c_long,
1138 #[derive(Copy)] pub enum timezone {}
1140 pub type sighandler_t = size_t;
1143 use types::common::c95::{c_void};
1144 use types::os::arch::c95::{c_char, c_int, c_uint};
1146 pub type socklen_t = u32;
1147 pub type sa_family_t = u8;
1148 pub type in_port_t = u16;
1149 pub type in_addr_t = u32;
1151 #[derive(Copy)] pub struct sockaddr {
1153 pub sa_family: sa_family_t,
1154 pub sa_data: [u8; 14],
1157 #[derive(Copy)] pub struct sockaddr_storage {
1159 pub ss_family: sa_family_t,
1160 pub __ss_pad1: [u8; 6],
1161 pub __ss_align: i64,
1162 pub __ss_pad2: [u8; 112],
1165 #[derive(Copy)] pub struct sockaddr_in {
1167 pub sin_family: sa_family_t,
1168 pub sin_port: in_port_t,
1169 pub sin_addr: in_addr,
1170 pub sin_zero: [u8; 8],
1173 #[derive(Copy)] pub struct in_addr {
1174 pub s_addr: in_addr_t,
1177 #[derive(Copy)] pub struct sockaddr_in6 {
1179 pub sin6_family: sa_family_t,
1180 pub sin6_port: in_port_t,
1181 pub sin6_flowinfo: u32,
1182 pub sin6_addr: in6_addr,
1183 pub sin6_scope_id: u32,
1186 #[derive(Copy)] pub struct in6_addr {
1187 pub s6_addr: [u16; 8]
1190 #[derive(Copy)] pub struct ip_mreq {
1191 pub imr_multiaddr: in_addr,
1192 pub imr_interface: in_addr,
1195 #[derive(Copy)] pub struct ip6_mreq {
1196 pub ipv6mr_multiaddr: in6_addr,
1197 pub ipv6mr_interface: c_uint,
1200 #[derive(Copy)] pub struct addrinfo {
1201 pub ai_flags: c_int,
1202 pub ai_family: c_int,
1203 pub ai_socktype: c_int,
1204 pub ai_protocol: c_int,
1205 pub ai_addrlen: socklen_t,
1206 pub ai_canonname: *mut c_char,
1207 pub ai_addr: *mut sockaddr,
1208 pub ai_next: *mut addrinfo,
1211 #[derive(Copy)] pub struct sockaddr_un {
1213 pub sun_family: sa_family_t,
1214 pub sun_path: [c_char; 104]
1217 #[derive(Copy)] pub struct ifaddrs {
1218 pub ifa_next: *mut ifaddrs,
1219 pub ifa_name: *mut c_char,
1220 pub ifa_flags: c_uint,
1221 pub ifa_addr: *mut sockaddr,
1222 pub ifa_netmask: *mut sockaddr,
1223 pub ifa_dstaddr: *mut sockaddr,
1224 pub ifa_data: *mut c_void
1230 #[cfg(target_arch = "x86_64")]
1233 pub type c_char = i8;
1234 pub type c_schar = i8;
1235 pub type c_uchar = u8;
1236 pub type c_short = i16;
1237 pub type c_ushort = u16;
1238 pub type c_int = i32;
1239 pub type c_uint = u32;
1240 pub type c_long = i64;
1241 pub type c_ulong = u64;
1242 pub type c_float = f32;
1243 pub type c_double = f64;
1244 pub type size_t = u64;
1245 pub type ptrdiff_t = i64;
1246 pub type clock_t = i32;
1247 pub type time_t = i64;
1248 pub type suseconds_t = i64;
1249 pub type wchar_t = i32;
1252 pub type c_longlong = i64;
1253 pub type c_ulonglong = u64;
1254 pub type intptr_t = i64;
1255 pub type uintptr_t = u64;
1256 pub type intmax_t = i64;
1257 pub type uintmax_t = u64;
1260 pub type off_t = i64;
1261 pub type dev_t = u32;
1262 pub type ino_t = u32;
1263 pub type pid_t = i32;
1264 pub type uid_t = u32;
1265 pub type gid_t = u32;
1266 pub type useconds_t = u32;
1267 pub type mode_t = u16;
1268 pub type ssize_t = i64;
1271 use types::common::c95::{c_void};
1272 use types::common::c99::{uint16_t, uint32_t, int32_t, uint64_t, int64_t};
1273 use types::os::arch::c95::{c_long, time_t};
1274 use types::os::arch::posix88::{dev_t, gid_t};
1275 use types::os::arch::posix88::{mode_t, off_t};
1276 use types::os::arch::posix88::{uid_t};
1278 pub type nlink_t = u16;
1279 pub type blksize_t = uint32_t;
1280 pub type ino_t = uint64_t;
1281 pub type blkcnt_t = i64;
1282 pub type fflags_t = u32;
1285 #[derive(Copy)] pub struct stat {
1287 pub st_nlink: nlink_t,
1289 pub st_mode: mode_t,
1290 pub st_padding1: uint16_t,
1294 pub st_atime: time_t,
1295 pub st_atime_nsec: c_long,
1296 pub st_mtime: time_t,
1297 pub st_mtime_nsec: c_long,
1298 pub st_ctime: time_t,
1299 pub st_ctime_nsec: c_long,
1301 pub st_blocks: blkcnt_t,
1302 pub st_blksize: blksize_t,
1303 pub st_flags: fflags_t,
1304 pub st_gen: uint32_t,
1305 pub st_lspare: int32_t,
1306 pub st_qspare1: int64_t,
1307 pub st_qspare2: int64_t,
1310 #[derive(Copy)] pub struct utimbuf {
1312 pub modtime: time_t,
1315 pub type pthread_attr_t = *mut c_void;
1326 #[cfg(target_os = "windows")]
1330 use types::os::arch::c95::{c_short, time_t, c_long};
1331 use types::os::arch::extra::{int64, time64_t};
1332 use types::os::arch::posix88::{dev_t, ino_t};
1334 // pub Note: this is the struct called stat64 in Windows. Not stat,
1337 #[derive(Copy)] pub struct stat {
1341 pub st_nlink: c_short,
1342 pub st_uid: c_short,
1343 pub st_gid: c_short,
1346 pub st_atime: time64_t,
1347 pub st_mtime: time64_t,
1348 pub st_ctime: time64_t,
1351 // note that this is called utimbuf64 in Windows
1353 #[derive(Copy)] pub struct utimbuf {
1354 pub actime: time64_t,
1355 pub modtime: time64_t,
1359 #[derive(Copy)] pub struct timeval {
1361 pub tv_usec: c_long,
1365 #[derive(Copy)] pub struct timespec {
1367 pub tv_nsec: c_long,
1370 #[derive(Copy)] pub enum timezone {}
1374 use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1375 use types::os::arch::c99::uintptr_t;
1377 pub type SOCKET = uintptr_t;
1378 pub type socklen_t = c_int;
1379 pub type sa_family_t = u16;
1380 pub type in_port_t = u16;
1381 pub type in_addr_t = u32;
1383 #[derive(Copy)] pub struct sockaddr {
1384 pub sa_family: sa_family_t,
1385 pub sa_data: [u8; 14],
1388 #[derive(Copy)] pub struct sockaddr_storage {
1389 pub ss_family: sa_family_t,
1390 pub __ss_pad1: [u8; 6],
1391 pub __ss_align: i64,
1392 pub __ss_pad2: [u8; 112],
1395 #[derive(Copy)] pub struct sockaddr_in {
1396 pub sin_family: sa_family_t,
1397 pub sin_port: in_port_t,
1398 pub sin_addr: in_addr,
1399 pub sin_zero: [u8; 8],
1402 #[derive(Copy)] pub struct in_addr {
1403 pub s_addr: in_addr_t,
1406 #[derive(Copy)] pub struct sockaddr_in6 {
1407 pub sin6_family: sa_family_t,
1408 pub sin6_port: in_port_t,
1409 pub sin6_flowinfo: u32,
1410 pub sin6_addr: in6_addr,
1411 pub sin6_scope_id: u32,
1414 #[derive(Copy)] pub struct in6_addr {
1415 pub s6_addr: [u16; 8]
1418 #[derive(Copy)] pub struct ip_mreq {
1419 pub imr_multiaddr: in_addr,
1420 pub imr_interface: in_addr,
1423 #[derive(Copy)] pub struct ip6_mreq {
1424 pub ipv6mr_multiaddr: in6_addr,
1425 pub ipv6mr_interface: c_uint,
1428 #[derive(Copy)] pub struct addrinfo {
1429 pub ai_flags: c_int,
1430 pub ai_family: c_int,
1431 pub ai_socktype: c_int,
1432 pub ai_protocol: c_int,
1433 pub ai_addrlen: size_t,
1434 pub ai_canonname: *mut c_char,
1435 pub ai_addr: *mut sockaddr,
1436 pub ai_next: *mut addrinfo,
1439 #[derive(Copy)] pub struct sockaddr_un {
1440 pub sun_family: sa_family_t,
1441 pub sun_path: [c_char; 108]
1448 pub type c_char = i8;
1449 pub type c_schar = i8;
1450 pub type c_uchar = u8;
1451 pub type c_short = i16;
1452 pub type c_ushort = u16;
1453 pub type c_int = i32;
1454 pub type c_uint = u32;
1455 pub type c_long = i32;
1456 pub type c_ulong = u32;
1457 pub type c_float = f32;
1458 pub type c_double = f64;
1460 #[cfg(target_arch = "x86")]
1461 pub type size_t = u32;
1462 #[cfg(target_arch = "x86_64")]
1463 pub type size_t = u64;
1465 #[cfg(target_arch = "x86")]
1466 pub type ptrdiff_t = i32;
1467 #[cfg(target_arch = "x86_64")]
1468 pub type ptrdiff_t = i64;
1470 pub type clock_t = i32;
1472 #[cfg(target_arch = "x86")]
1473 pub type time_t = i32;
1474 #[cfg(target_arch = "x86_64")]
1475 pub type time_t = i64;
1477 #[cfg(target_arch = "x86")]
1478 pub type suseconds_t = i32;
1479 #[cfg(target_arch = "x86_64")]
1480 pub type suseconds_t = i64;
1482 pub type wchar_t = u16;
1486 pub type c_longlong = i64;
1487 pub type c_ulonglong = u64;
1489 #[cfg(target_arch = "x86")]
1490 pub type intptr_t = i32;
1491 #[cfg(target_arch = "x86_64")]
1492 pub type intptr_t = i64;
1494 #[cfg(target_arch = "x86")]
1495 pub type uintptr_t = u32;
1496 #[cfg(target_arch = "x86_64")]
1497 pub type uintptr_t = u64;
1499 pub type intmax_t = i64;
1500 pub type uintmax_t = u64;
1504 pub type off_t = i32;
1505 pub type dev_t = u32;
1506 pub type ino_t = u16;
1508 pub type pid_t = u32;
1510 pub type useconds_t = u32;
1511 pub type mode_t = u16;
1513 #[cfg(target_arch = "x86")]
1514 pub type ssize_t = i32;
1515 #[cfg(target_arch = "x86_64")]
1516 pub type ssize_t = i64;
1526 use consts::os::extra::{MAX_PROTOCOL_CHAIN,
1528 use types::common::c95::c_void;
1529 use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1530 use types::os::arch::c95::{c_long, c_ulong};
1531 use types::os::arch::c95::{wchar_t};
1532 use types::os::arch::c99::{c_ulonglong, c_longlong, uintptr_t};
1534 pub type BOOL = c_int;
1536 pub type BOOLEAN = BYTE;
1537 pub type CCHAR = c_char;
1538 pub type CHAR = c_char;
1540 pub type DWORD = c_ulong;
1541 pub type DWORDLONG = c_ulonglong;
1543 pub type HANDLE = LPVOID;
1544 pub type HINSTANCE = HANDLE;
1545 pub type HMODULE = HINSTANCE;
1547 pub type LONG = c_long;
1548 pub type PLONG = *mut c_long;
1550 #[cfg(target_arch = "x86")]
1551 pub type LONG_PTR = c_long;
1552 #[cfg(target_arch = "x86_64")]
1553 pub type LONG_PTR = i64;
1555 pub type LARGE_INTEGER = c_longlong;
1556 pub type PLARGE_INTEGER = *mut c_longlong;
1558 pub type LPCWSTR = *const WCHAR;
1559 pub type LPCSTR = *const CHAR;
1561 pub type LPWSTR = *mut WCHAR;
1562 pub type LPSTR = *mut CHAR;
1564 pub type LPWCH = *mut WCHAR;
1565 pub type LPCH = *mut CHAR;
1568 #[derive(Copy)] pub struct SECURITY_ATTRIBUTES {
1570 pub lpSecurityDescriptor: LPVOID,
1571 pub bInheritHandle: BOOL,
1573 pub type LPSECURITY_ATTRIBUTES = *mut SECURITY_ATTRIBUTES;
1575 pub type LPVOID = *mut c_void;
1576 pub type LPCVOID = *const c_void;
1577 pub type LPBYTE = *mut BYTE;
1578 pub type LPWORD = *mut WORD;
1579 pub type LPDWORD = *mut DWORD;
1580 pub type LPHANDLE = *mut HANDLE;
1582 pub type LRESULT = LONG_PTR;
1583 pub type PBOOL = *mut BOOL;
1584 pub type WCHAR = wchar_t;
1585 pub type WORD = u16;
1586 pub type SIZE_T = size_t;
1588 pub type time64_t = i64;
1589 pub type int64 = i64;
1592 #[derive(Copy)] pub struct STARTUPINFO {
1594 pub lpReserved: LPWSTR,
1595 pub lpDesktop: LPWSTR,
1596 pub lpTitle: LPWSTR,
1601 pub dwXCountChars: DWORD,
1602 pub dwYCountCharts: DWORD,
1603 pub dwFillAttribute: DWORD,
1605 pub wShowWindow: WORD,
1606 pub cbReserved2: WORD,
1607 pub lpReserved2: LPBYTE,
1608 pub hStdInput: HANDLE,
1609 pub hStdOutput: HANDLE,
1610 pub hStdError: HANDLE,
1612 pub type LPSTARTUPINFO = *mut STARTUPINFO;
1615 #[derive(Copy)] pub struct PROCESS_INFORMATION {
1616 pub hProcess: HANDLE,
1617 pub hThread: HANDLE,
1618 pub dwProcessId: DWORD,
1619 pub dwThreadId: DWORD,
1621 pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
1624 #[derive(Copy)] pub struct SYSTEM_INFO {
1625 pub wProcessorArchitecture: WORD,
1626 pub wReserved: WORD,
1627 pub dwPageSize: DWORD,
1628 pub lpMinimumApplicationAddress: LPVOID,
1629 pub lpMaximumApplicationAddress: LPVOID,
1630 pub dwActiveProcessorMask: uintptr_t,
1631 pub dwNumberOfProcessors: DWORD,
1632 pub dwProcessorType: DWORD,
1633 pub dwAllocationGranularity: DWORD,
1634 pub wProcessorLevel: WORD,
1635 pub wProcessorRevision: WORD,
1637 pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
1640 #[derive(Copy)] pub struct MEMORY_BASIC_INFORMATION {
1641 pub BaseAddress: LPVOID,
1642 pub AllocationBase: LPVOID,
1643 pub AllocationProtect: DWORD,
1644 pub RegionSize: SIZE_T,
1649 pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
1652 #[derive(Copy)] pub struct OVERLAPPED {
1653 pub Internal: *mut c_ulong,
1654 pub InternalHigh: *mut c_ulong,
1656 pub OffsetHigh: DWORD,
1660 pub type LPOVERLAPPED = *mut OVERLAPPED;
1663 #[derive(Copy)] pub struct FILETIME {
1664 pub dwLowDateTime: DWORD,
1665 pub dwHighDateTime: DWORD,
1668 pub type LPFILETIME = *mut FILETIME;
1671 #[derive(Copy)] pub struct GUID {
1675 pub Data4: [BYTE; 8],
1679 #[derive(Copy)] pub struct WSAPROTOCOLCHAIN {
1680 pub ChainLen: c_int,
1681 pub ChainEntries: [DWORD; MAX_PROTOCOL_CHAIN as uint],
1684 pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
1687 #[derive(Copy)] pub struct WSAPROTOCOL_INFO {
1688 pub dwServiceFlags1: DWORD,
1689 pub dwServiceFlags2: DWORD,
1690 pub dwServiceFlags3: DWORD,
1691 pub dwServiceFlags4: DWORD,
1692 pub dwProviderFlags: DWORD,
1693 pub ProviderId: GUID,
1694 pub dwCatalogEntryId: DWORD,
1695 pub ProtocolChain: WSAPROTOCOLCHAIN,
1696 pub iVersion: c_int,
1697 pub iAddressFamily: c_int,
1698 pub iMaxSockAddr: c_int,
1699 pub iMinSockAddr: c_int,
1700 pub iSocketType: c_int,
1701 pub iProtocol: c_int,
1702 pub iProtocolMaxOffset: c_int,
1703 pub iNetworkByteOrder: c_int,
1704 pub iSecurityScheme: c_int,
1705 pub dwMessageSize: DWORD,
1706 pub dwProviderReserved: DWORD,
1707 pub szProtocol: [u8; (WSAPROTOCOL_LEN as uint) + 1u],
1710 pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
1712 pub type GROUP = c_uint;
1715 #[derive(Copy)] pub struct WIN32_FIND_DATAW {
1716 pub dwFileAttributes: DWORD,
1717 pub ftCreationTime: FILETIME,
1718 pub ftLastAccessTime: FILETIME,
1719 pub ftLastWriteTime: FILETIME,
1720 pub nFileSizeHigh: DWORD,
1721 pub nFileSizeLow: DWORD,
1722 pub dwReserved0: DWORD,
1723 pub dwReserved1: DWORD,
1724 pub cFileName: [wchar_t; 260], // #define MAX_PATH 260
1725 pub cAlternateFileName: [wchar_t; 14],
1728 pub type LPWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW;
1733 #[cfg(any(target_os = "macos", target_os = "ios"))]
1737 use types::common::c95::c_void;
1738 use types::os::arch::c95::{c_char, c_int, size_t, time_t};
1739 use types::os::arch::c95::{suseconds_t, c_long};
1740 use types::os::arch::c99::{uintptr_t};
1742 pub type pthread_t = uintptr_t;
1745 #[derive(Copy)] pub struct glob_t {
1746 pub gl_pathc: size_t,
1747 pub __unused1: c_int,
1748 pub gl_offs: size_t,
1749 pub __unused2: c_int,
1750 pub gl_pathv: *mut *mut c_char,
1752 pub __unused3: *mut c_void,
1754 pub __unused4: *mut c_void,
1755 pub __unused5: *mut c_void,
1756 pub __unused6: *mut c_void,
1757 pub __unused7: *mut c_void,
1758 pub __unused8: *mut c_void,
1762 #[derive(Copy)] pub struct timeval {
1764 pub tv_usec: suseconds_t,
1768 #[derive(Copy)] pub struct timespec {
1770 pub tv_nsec: c_long,
1773 #[derive(Copy)] pub enum timezone {}
1775 pub type sighandler_t = size_t;
1779 use types::common::c95::{c_void};
1780 use types::os::arch::c95::{c_char, c_int, c_uint};
1782 pub type socklen_t = c_int;
1783 pub type sa_family_t = u8;
1784 pub type in_port_t = u16;
1785 pub type in_addr_t = u32;
1787 #[derive(Copy)] pub struct sockaddr {
1789 pub sa_family: sa_family_t,
1790 pub sa_data: [u8; 14],
1794 #[derive(Copy)] pub struct sockaddr_storage {
1796 pub ss_family: sa_family_t,
1797 pub __ss_pad1: [u8; 6],
1798 pub __ss_align: i64,
1799 pub __ss_pad2: [u8; 112],
1803 #[derive(Copy)] pub struct sockaddr_in {
1805 pub sin_family: sa_family_t,
1806 pub sin_port: in_port_t,
1807 pub sin_addr: in_addr,
1808 pub sin_zero: [u8; 8],
1812 #[derive(Copy)] pub struct in_addr {
1813 pub s_addr: in_addr_t,
1817 #[derive(Copy)] pub struct sockaddr_in6 {
1819 pub sin6_family: sa_family_t,
1820 pub sin6_port: in_port_t,
1821 pub sin6_flowinfo: u32,
1822 pub sin6_addr: in6_addr,
1823 pub sin6_scope_id: u32,
1827 #[derive(Copy)] pub struct in6_addr {
1828 pub s6_addr: [u16; 8]
1832 #[derive(Copy)] pub struct ip_mreq {
1833 pub imr_multiaddr: in_addr,
1834 pub imr_interface: in_addr,
1838 #[derive(Copy)] pub struct ip6_mreq {
1839 pub ipv6mr_multiaddr: in6_addr,
1840 pub ipv6mr_interface: c_uint,
1844 #[derive(Copy)] pub struct addrinfo {
1845 pub ai_flags: c_int,
1846 pub ai_family: c_int,
1847 pub ai_socktype: c_int,
1848 pub ai_protocol: c_int,
1849 pub ai_addrlen: socklen_t,
1850 pub ai_canonname: *mut c_char,
1851 pub ai_addr: *mut sockaddr,
1852 pub ai_next: *mut addrinfo,
1856 #[derive(Copy)] pub struct sockaddr_un {
1858 pub sun_family: sa_family_t,
1859 pub sun_path: [c_char; 104]
1863 #[derive(Copy)] pub struct ifaddrs {
1864 pub ifa_next: *mut ifaddrs,
1865 pub ifa_name: *mut c_char,
1866 pub ifa_flags: c_uint,
1867 pub ifa_addr: *mut sockaddr,
1868 pub ifa_netmask: *mut sockaddr,
1869 pub ifa_dstaddr: *mut sockaddr,
1870 pub ifa_data: *mut c_void
1875 #[cfg(any(target_arch = "arm", target_arch = "x86"))]
1878 pub type c_char = i8;
1879 pub type c_schar = i8;
1880 pub type c_uchar = u8;
1881 pub type c_short = i16;
1882 pub type c_ushort = u16;
1883 pub type c_int = i32;
1884 pub type c_uint = u32;
1885 pub type c_long = i32;
1886 pub type c_ulong = u32;
1887 pub type c_float = f32;
1888 pub type c_double = f64;
1889 pub type size_t = u32;
1890 pub type ptrdiff_t = i32;
1891 pub type clock_t = u32;
1892 pub type time_t = i32;
1893 pub type suseconds_t = i32;
1894 pub type wchar_t = i32;
1897 pub type c_longlong = i64;
1898 pub type c_ulonglong = u64;
1899 pub type intptr_t = i32;
1900 pub type uintptr_t = u32;
1901 pub type intmax_t = i64;
1902 pub type uintmax_t = u64;
1905 pub type off_t = i64;
1906 pub type dev_t = i32;
1907 pub type ino_t = u64;
1908 pub type pid_t = i32;
1909 pub type uid_t = u32;
1910 pub type gid_t = u32;
1911 pub type useconds_t = u32;
1912 pub type mode_t = u16;
1913 pub type ssize_t = i32;
1916 use types::common::c99::{int32_t, int64_t, uint32_t};
1917 use types::os::arch::c95::{c_char, c_long, time_t};
1918 use types::os::arch::posix88::{dev_t, gid_t, ino_t,
1919 mode_t, off_t, uid_t};
1921 pub type nlink_t = u16;
1922 pub type blksize_t = i64;
1923 pub type blkcnt_t = i32;
1926 #[derive(Copy)] pub struct stat {
1928 pub st_mode: mode_t,
1929 pub st_nlink: nlink_t,
1934 pub st_atime: time_t,
1935 pub st_atime_nsec: c_long,
1936 pub st_mtime: time_t,
1937 pub st_mtime_nsec: c_long,
1938 pub st_ctime: time_t,
1939 pub st_ctime_nsec: c_long,
1940 pub st_birthtime: time_t,
1941 pub st_birthtime_nsec: c_long,
1943 pub st_blocks: blkcnt_t,
1944 pub st_blksize: blksize_t,
1945 pub st_flags: uint32_t,
1946 pub st_gen: uint32_t,
1947 pub st_lspare: int32_t,
1948 pub st_qspare: [int64_t; 2],
1952 #[derive(Copy)] pub struct utimbuf {
1954 pub modtime: time_t,
1958 #[derive(Copy)] pub struct pthread_attr_t {
1960 pub __opaque: [c_char; 36]
1969 #[derive(Copy)] pub struct mach_timebase_info {
1974 pub type mach_timebase_info_data_t = mach_timebase_info;
1978 #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
1981 pub type c_char = i8;
1982 pub type c_schar = i8;
1983 pub type c_uchar = u8;
1984 pub type c_short = i16;
1985 pub type c_ushort = u16;
1986 pub type c_int = i32;
1987 pub type c_uint = u32;
1988 pub type c_long = i64;
1989 pub type c_ulong = u64;
1990 pub type c_float = f32;
1991 pub type c_double = f64;
1992 pub type size_t = u64;
1993 pub type ptrdiff_t = i64;
1994 pub type clock_t = u64;
1995 pub type time_t = i64;
1996 pub type suseconds_t = i32;
1997 pub type wchar_t = i32;
2000 pub type c_longlong = i64;
2001 pub type c_ulonglong = u64;
2002 pub type intptr_t = i64;
2003 pub type uintptr_t = u64;
2004 pub type intmax_t = i64;
2005 pub type uintmax_t = u64;
2008 pub type off_t = i64;
2009 pub type dev_t = i32;
2010 pub type ino_t = u64;
2011 pub type pid_t = i32;
2012 pub type uid_t = u32;
2013 pub type gid_t = u32;
2014 pub type useconds_t = u32;
2015 pub type mode_t = u16;
2016 pub type ssize_t = i64;
2019 use types::common::c99::{int32_t, int64_t};
2020 use types::common::c99::{uint32_t};
2021 use types::os::arch::c95::{c_char, c_long, time_t};
2022 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
2023 use types::os::arch::posix88::{mode_t, off_t, uid_t};
2025 pub type nlink_t = u16;
2026 pub type blksize_t = i64;
2027 pub type blkcnt_t = i32;
2030 #[derive(Copy)] pub struct stat {
2032 pub st_mode: mode_t,
2033 pub st_nlink: nlink_t,
2038 pub st_atime: time_t,
2039 pub st_atime_nsec: c_long,
2040 pub st_mtime: time_t,
2041 pub st_mtime_nsec: c_long,
2042 pub st_ctime: time_t,
2043 pub st_ctime_nsec: c_long,
2044 pub st_birthtime: time_t,
2045 pub st_birthtime_nsec: c_long,
2047 pub st_blocks: blkcnt_t,
2048 pub st_blksize: blksize_t,
2049 pub st_flags: uint32_t,
2050 pub st_gen: uint32_t,
2051 pub st_lspare: int32_t,
2052 pub st_qspare: [int64_t; 2],
2056 #[derive(Copy)] pub struct utimbuf {
2058 pub modtime: time_t,
2062 #[derive(Copy)] pub struct pthread_attr_t {
2064 pub __opaque: [c_char; 56]
2073 #[derive(Copy)] pub struct mach_timebase_info {
2078 pub type mach_timebase_info_data_t = mach_timebase_info;
2085 // Consts tend to vary per OS so we pull their definitions out
2086 // into this module.
2088 #[cfg(target_os = "windows")]
2091 use types::os::arch::c95::{c_int, c_uint};
2093 pub const EXIT_FAILURE : c_int = 1;
2094 pub const EXIT_SUCCESS : c_int = 0;
2095 pub const RAND_MAX : c_int = 32767;
2096 pub const EOF : c_int = -1;
2097 pub const SEEK_SET : c_int = 0;
2098 pub const SEEK_CUR : c_int = 1;
2099 pub const SEEK_END : c_int = 2;
2100 pub const _IOFBF : c_int = 0;
2101 pub const _IONBF : c_int = 4;
2102 pub const _IOLBF : c_int = 64;
2103 pub const BUFSIZ : c_uint = 512_u32;
2104 pub const FOPEN_MAX : c_uint = 20_u32;
2105 pub const FILENAME_MAX : c_uint = 260_u32;
2106 pub const L_tmpnam : c_uint = 16_u32;
2107 pub const TMP_MAX : c_uint = 32767_u32;
2109 pub const WSAEINTR: c_int = 10004;
2110 pub const WSAEBADF: c_int = 10009;
2111 pub const WSAEACCES: c_int = 10013;
2112 pub const WSAEFAULT: c_int = 10014;
2113 pub const WSAEINVAL: c_int = 10022;
2114 pub const WSAEMFILE: c_int = 10024;
2115 pub const WSAEWOULDBLOCK: c_int = 10035;
2116 pub const WSAEINPROGRESS: c_int = 10036;
2117 pub const WSAEALREADY: c_int = 10037;
2118 pub const WSAENOTSOCK: c_int = 10038;
2119 pub const WSAEDESTADDRREQ: c_int = 10039;
2120 pub const WSAEMSGSIZE: c_int = 10040;
2121 pub const WSAEPROTOTYPE: c_int = 10041;
2122 pub const WSAENOPROTOOPT: c_int = 10042;
2123 pub const WSAEPROTONOSUPPORT: c_int = 10043;
2124 pub const WSAESOCKTNOSUPPORT: c_int = 10044;
2125 pub const WSAEOPNOTSUPP: c_int = 10045;
2126 pub const WSAEPFNOSUPPORT: c_int = 10046;
2127 pub const WSAEAFNOSUPPORT: c_int = 10047;
2128 pub const WSAEADDRINUSE: c_int = 10048;
2129 pub const WSAEADDRNOTAVAIL: c_int = 10049;
2130 pub const WSAENETDOWN: c_int = 10050;
2131 pub const WSAENETUNREACH: c_int = 10051;
2132 pub const WSAENETRESET: c_int = 10052;
2133 pub const WSAECONNABORTED: c_int = 10053;
2134 pub const WSAECONNRESET: c_int = 10054;
2135 pub const WSAENOBUFS: c_int = 10055;
2136 pub const WSAEISCONN: c_int = 10056;
2137 pub const WSAENOTCONN: c_int = 10057;
2138 pub const WSAESHUTDOWN: c_int = 10058;
2139 pub const WSAETOOMANYREFS: c_int = 10059;
2140 pub const WSAETIMEDOUT: c_int = 10060;
2141 pub const WSAECONNREFUSED: c_int = 10061;
2142 pub const WSAELOOP: c_int = 10062;
2143 pub const WSAENAMETOOLONG: c_int = 10063;
2144 pub const WSAEHOSTDOWN: c_int = 10064;
2145 pub const WSAEHOSTUNREACH: c_int = 10065;
2146 pub const WSAENOTEMPTY: c_int = 10066;
2147 pub const WSAEPROCLIM: c_int = 10067;
2148 pub const WSAEUSERS: c_int = 10068;
2149 pub const WSAEDQUOT: c_int = 10069;
2150 pub const WSAESTALE: c_int = 10070;
2151 pub const WSAEREMOTE: c_int = 10071;
2152 pub const WSASYSNOTREADY: c_int = 10091;
2153 pub const WSAVERNOTSUPPORTED: c_int = 10092;
2154 pub const WSANOTINITIALISED: c_int = 10093;
2155 pub const WSAEDISCON: c_int = 10101;
2156 pub const WSAENOMORE: c_int = 10102;
2157 pub const WSAECANCELLED: c_int = 10103;
2158 pub const WSAEINVALIDPROCTABLE: c_int = 10104;
2159 pub const WSAEINVALIDPROVIDER: c_int = 10105;
2160 pub const WSAEPROVIDERFAILEDINIT: c_int = 10106;
2165 use types::os::arch::c95::c_int;
2167 pub const O_RDONLY : c_int = 0;
2168 pub const O_WRONLY : c_int = 1;
2169 pub const O_RDWR : c_int = 2;
2170 pub const O_APPEND : c_int = 8;
2171 pub const O_CREAT : c_int = 256;
2172 pub const O_EXCL : c_int = 1024;
2173 pub const O_TRUNC : c_int = 512;
2174 pub const S_IFIFO : c_int = 4096;
2175 pub const S_IFCHR : c_int = 8192;
2176 pub const S_IFBLK : c_int = 12288;
2177 pub const S_IFDIR : c_int = 16384;
2178 pub const S_IFREG : c_int = 32768;
2179 pub const S_IFLNK : c_int = 40960;
2180 pub const S_IFMT : c_int = 61440;
2181 pub const S_IEXEC : c_int = 64;
2182 pub const S_IWRITE : c_int = 128;
2183 pub const S_IREAD : c_int = 256;
2184 pub const S_IRWXU : c_int = 448;
2185 pub const S_IXUSR : c_int = 64;
2186 pub const S_IWUSR : c_int = 128;
2187 pub const S_IRUSR : c_int = 256;
2188 pub const F_OK : c_int = 0;
2189 pub const R_OK : c_int = 4;
2190 pub const W_OK : c_int = 2;
2191 pub const X_OK : c_int = 1;
2192 pub const STDIN_FILENO : c_int = 0;
2193 pub const STDOUT_FILENO : c_int = 1;
2194 pub const STDERR_FILENO : c_int = 2;
2201 use types::os::arch::c95::c_int;
2203 pub const AF_INET: c_int = 2;
2204 pub const AF_INET6: c_int = 23;
2205 pub const SOCK_STREAM: c_int = 1;
2206 pub const SOCK_DGRAM: c_int = 2;
2207 pub const SOCK_RAW: c_int = 3;
2208 pub const IPPROTO_TCP: c_int = 6;
2209 pub const IPPROTO_IP: c_int = 0;
2210 pub const IPPROTO_IPV6: c_int = 41;
2211 pub const IP_MULTICAST_TTL: c_int = 10;
2212 pub const IP_MULTICAST_LOOP: c_int = 11;
2213 pub const IP_ADD_MEMBERSHIP: c_int = 12;
2214 pub const IP_DROP_MEMBERSHIP: c_int = 13;
2215 pub const IPV6_ADD_MEMBERSHIP: c_int = 5;
2216 pub const IPV6_DROP_MEMBERSHIP: c_int = 6;
2217 pub const IP_TTL: c_int = 4;
2218 pub const IP_HDRINCL: c_int = 2;
2220 pub const TCP_NODELAY: c_int = 0x0001;
2221 pub const SOL_SOCKET: c_int = 0xffff;
2222 pub const SO_KEEPALIVE: c_int = 8;
2223 pub const SO_BROADCAST: c_int = 32;
2224 pub const SO_REUSEADDR: c_int = 4;
2225 pub const SO_ERROR: c_int = 0x1007;
2227 pub const IFF_LOOPBACK: c_int = 4;
2229 pub const SHUT_RD: c_int = 0;
2230 pub const SHUT_WR: c_int = 1;
2231 pub const SHUT_RDWR: c_int = 2;
2234 use types::os::arch::c95::{c_int, c_long};
2235 use types::os::arch::extra::{WORD, DWORD, BOOL, HANDLE};
2237 pub const TRUE : BOOL = 1;
2238 pub const FALSE : BOOL = 0;
2240 pub const O_TEXT : c_int = 16384;
2241 pub const O_BINARY : c_int = 32768;
2242 pub const O_NOINHERIT: c_int = 128;
2244 pub const ERROR_SUCCESS : c_int = 0;
2245 pub const ERROR_INVALID_FUNCTION: c_int = 1;
2246 pub const ERROR_FILE_NOT_FOUND: c_int = 2;
2247 pub const ERROR_ACCESS_DENIED: c_int = 5;
2248 pub const ERROR_INVALID_HANDLE : c_int = 6;
2249 pub const ERROR_BROKEN_PIPE: c_int = 109;
2250 pub const ERROR_DISK_FULL : c_int = 112;
2251 pub const ERROR_CALL_NOT_IMPLEMENTED : c_int = 120;
2252 pub const ERROR_INSUFFICIENT_BUFFER : c_int = 122;
2253 pub const ERROR_INVALID_NAME : c_int = 123;
2254 pub const ERROR_ALREADY_EXISTS : c_int = 183;
2255 pub const ERROR_PIPE_BUSY: c_int = 231;
2256 pub const ERROR_NO_DATA: c_int = 232;
2257 pub const ERROR_INVALID_ADDRESS : c_int = 487;
2258 pub const ERROR_PIPE_CONNECTED: c_int = 535;
2259 pub const ERROR_NOTHING_TO_TERMINATE: c_int = 758;
2260 pub const ERROR_OPERATION_ABORTED: c_int = 995;
2261 pub const ERROR_IO_PENDING: c_int = 997;
2262 pub const ERROR_FILE_INVALID : c_int = 1006;
2263 pub const ERROR_NOT_FOUND: c_int = 1168;
2264 pub const INVALID_HANDLE_VALUE: HANDLE = -1 as HANDLE;
2266 pub const DELETE : DWORD = 0x00010000;
2267 pub const READ_CONTROL : DWORD = 0x00020000;
2268 pub const SYNCHRONIZE : DWORD = 0x00100000;
2269 pub const WRITE_DAC : DWORD = 0x00040000;
2270 pub const WRITE_OWNER : DWORD = 0x00080000;
2272 pub const PROCESS_CREATE_PROCESS : DWORD = 0x0080;
2273 pub const PROCESS_CREATE_THREAD : DWORD = 0x0002;
2274 pub const PROCESS_DUP_HANDLE : DWORD = 0x0040;
2275 pub const PROCESS_QUERY_INFORMATION : DWORD = 0x0400;
2276 pub const PROCESS_QUERY_LIMITED_INFORMATION : DWORD = 0x1000;
2277 pub const PROCESS_SET_INFORMATION : DWORD = 0x0200;
2278 pub const PROCESS_SET_QUOTA : DWORD = 0x0100;
2279 pub const PROCESS_SUSPEND_RESUME : DWORD = 0x0800;
2280 pub const PROCESS_TERMINATE : DWORD = 0x0001;
2281 pub const PROCESS_VM_OPERATION : DWORD = 0x0008;
2282 pub const PROCESS_VM_READ : DWORD = 0x0010;
2283 pub const PROCESS_VM_WRITE : DWORD = 0x0020;
2285 pub const STARTF_FORCEONFEEDBACK : DWORD = 0x00000040;
2286 pub const STARTF_FORCEOFFFEEDBACK : DWORD = 0x00000080;
2287 pub const STARTF_PREVENTPINNING : DWORD = 0x00002000;
2288 pub const STARTF_RUNFULLSCREEN : DWORD = 0x00000020;
2289 pub const STARTF_TITLEISAPPID : DWORD = 0x00001000;
2290 pub const STARTF_TITLEISLINKNAME : DWORD = 0x00000800;
2291 pub const STARTF_USECOUNTCHARS : DWORD = 0x00000008;
2292 pub const STARTF_USEFILLATTRIBUTE : DWORD = 0x00000010;
2293 pub const STARTF_USEHOTKEY : DWORD = 0x00000200;
2294 pub const STARTF_USEPOSITION : DWORD = 0x00000004;
2295 pub const STARTF_USESHOWWINDOW : DWORD = 0x00000001;
2296 pub const STARTF_USESIZE : DWORD = 0x00000002;
2297 pub const STARTF_USESTDHANDLES : DWORD = 0x00000100;
2299 pub const WAIT_ABANDONED : DWORD = 0x00000080;
2300 pub const WAIT_OBJECT_0 : DWORD = 0x00000000;
2301 pub const WAIT_TIMEOUT : DWORD = 0x00000102;
2302 pub const WAIT_FAILED : DWORD = -1;
2304 pub const DUPLICATE_CLOSE_SOURCE : DWORD = 0x00000001;
2305 pub const DUPLICATE_SAME_ACCESS : DWORD = 0x00000002;
2307 pub const INFINITE : DWORD = -1;
2308 pub const STILL_ACTIVE : DWORD = 259;
2310 pub const MEM_COMMIT : DWORD = 0x00001000;
2311 pub const MEM_RESERVE : DWORD = 0x00002000;
2312 pub const MEM_DECOMMIT : DWORD = 0x00004000;
2313 pub const MEM_RELEASE : DWORD = 0x00008000;
2314 pub const MEM_RESET : DWORD = 0x00080000;
2315 pub const MEM_RESET_UNDO : DWORD = 0x1000000;
2316 pub const MEM_LARGE_PAGES : DWORD = 0x20000000;
2317 pub const MEM_PHYSICAL : DWORD = 0x00400000;
2318 pub const MEM_TOP_DOWN : DWORD = 0x00100000;
2319 pub const MEM_WRITE_WATCH : DWORD = 0x00200000;
2321 pub const PAGE_EXECUTE : DWORD = 0x10;
2322 pub const PAGE_EXECUTE_READ : DWORD = 0x20;
2323 pub const PAGE_EXECUTE_READWRITE : DWORD = 0x40;
2324 pub const PAGE_EXECUTE_WRITECOPY : DWORD = 0x80;
2325 pub const PAGE_NOACCESS : DWORD = 0x01;
2326 pub const PAGE_READONLY : DWORD = 0x02;
2327 pub const PAGE_READWRITE : DWORD = 0x04;
2328 pub const PAGE_WRITECOPY : DWORD = 0x08;
2329 pub const PAGE_GUARD : DWORD = 0x100;
2330 pub const PAGE_NOCACHE : DWORD = 0x200;
2331 pub const PAGE_WRITECOMBINE : DWORD = 0x400;
2333 pub const SEC_COMMIT : DWORD = 0x8000000;
2334 pub const SEC_IMAGE : DWORD = 0x1000000;
2335 pub const SEC_IMAGE_NO_EXECUTE : DWORD = 0x11000000;
2336 pub const SEC_LARGE_PAGES : DWORD = 0x80000000;
2337 pub const SEC_NOCACHE : DWORD = 0x10000000;
2338 pub const SEC_RESERVE : DWORD = 0x4000000;
2339 pub const SEC_WRITECOMBINE : DWORD = 0x40000000;
2341 pub const FILE_MAP_ALL_ACCESS : DWORD = 0xf001f;
2342 pub const FILE_MAP_READ : DWORD = 0x4;
2343 pub const FILE_MAP_WRITE : DWORD = 0x2;
2344 pub const FILE_MAP_COPY : DWORD = 0x1;
2345 pub const FILE_MAP_EXECUTE : DWORD = 0x20;
2347 pub const PROCESSOR_ARCHITECTURE_INTEL : WORD = 0;
2348 pub const PROCESSOR_ARCHITECTURE_ARM : WORD = 5;
2349 pub const PROCESSOR_ARCHITECTURE_IA64 : WORD = 6;
2350 pub const PROCESSOR_ARCHITECTURE_AMD64 : WORD = 9;
2351 pub const PROCESSOR_ARCHITECTURE_UNKNOWN : WORD = 0xffff;
2353 pub const MOVEFILE_COPY_ALLOWED: DWORD = 2;
2354 pub const MOVEFILE_CREATE_HARDLINK: DWORD = 16;
2355 pub const MOVEFILE_DELAY_UNTIL_REBOOT: DWORD = 4;
2356 pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE: DWORD = 32;
2357 pub const MOVEFILE_REPLACE_EXISTING: DWORD = 1;
2358 pub const MOVEFILE_WRITE_THROUGH: DWORD = 8;
2360 pub const SYMBOLIC_LINK_FLAG_DIRECTORY: DWORD = 1;
2362 pub const FILE_SHARE_DELETE: DWORD = 0x4;
2363 pub const FILE_SHARE_READ: DWORD = 0x1;
2364 pub const FILE_SHARE_WRITE: DWORD = 0x2;
2366 pub const CREATE_ALWAYS: DWORD = 2;
2367 pub const CREATE_NEW: DWORD = 1;
2368 pub const OPEN_ALWAYS: DWORD = 4;
2369 pub const OPEN_EXISTING: DWORD = 3;
2370 pub const TRUNCATE_EXISTING: DWORD = 5;
2372 pub const FILE_APPEND_DATA: DWORD = 0x00000004;
2373 pub const FILE_READ_DATA: DWORD = 0x00000001;
2374 pub const FILE_WRITE_DATA: DWORD = 0x00000002;
2376 pub const FILE_ATTRIBUTE_ARCHIVE: DWORD = 0x20;
2377 pub const FILE_ATTRIBUTE_COMPRESSED: DWORD = 0x800;
2378 pub const FILE_ATTRIBUTE_DEVICE: DWORD = 0x40;
2379 pub const FILE_ATTRIBUTE_DIRECTORY: DWORD = 0x10;
2380 pub const FILE_ATTRIBUTE_ENCRYPTED: DWORD = 0x4000;
2381 pub const FILE_ATTRIBUTE_HIDDEN: DWORD = 0x2;
2382 pub const FILE_ATTRIBUTE_INTEGRITY_STREAM: DWORD = 0x8000;
2383 pub const FILE_ATTRIBUTE_NORMAL: DWORD = 0x80;
2384 pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: DWORD = 0x2000;
2385 pub const FILE_ATTRIBUTE_NO_SCRUB_DATA: DWORD = 0x20000;
2386 pub const FILE_ATTRIBUTE_OFFLINE: DWORD = 0x1000;
2387 pub const FILE_ATTRIBUTE_READONLY: DWORD = 0x1;
2388 pub const FILE_ATTRIBUTE_REPARSE_POINT: DWORD = 0x400;
2389 pub const FILE_ATTRIBUTE_SPARSE_FILE: DWORD = 0x200;
2390 pub const FILE_ATTRIBUTE_SYSTEM: DWORD = 0x4;
2391 pub const FILE_ATTRIBUTE_TEMPORARY: DWORD = 0x100;
2392 pub const FILE_ATTRIBUTE_VIRTUAL: DWORD = 0x10000;
2394 pub const FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
2395 pub const FILE_FLAG_DELETE_ON_CLOSE: DWORD = 0x04000000;
2396 pub const FILE_FLAG_NO_BUFFERING: DWORD = 0x20000000;
2397 pub const FILE_FLAG_OPEN_NO_RECALL: DWORD = 0x00100000;
2398 pub const FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
2399 pub const FILE_FLAG_OVERLAPPED: DWORD = 0x40000000;
2400 pub const FILE_FLAG_POSIX_SEMANTICS: DWORD = 0x0100000;
2401 pub const FILE_FLAG_RANDOM_ACCESS: DWORD = 0x10000000;
2402 pub const FILE_FLAG_SESSION_AWARE: DWORD = 0x00800000;
2403 pub const FILE_FLAG_SEQUENTIAL_SCAN: DWORD = 0x08000000;
2404 pub const FILE_FLAG_WRITE_THROUGH: DWORD = 0x80000000;
2405 pub const FILE_FLAG_FIRST_PIPE_INSTANCE: DWORD = 0x00080000;
2407 pub const FILE_NAME_NORMALIZED: DWORD = 0x0;
2408 pub const FILE_NAME_OPENED: DWORD = 0x8;
2410 pub const VOLUME_NAME_DOS: DWORD = 0x0;
2411 pub const VOLUME_NAME_GUID: DWORD = 0x1;
2412 pub const VOLUME_NAME_NONE: DWORD = 0x4;
2413 pub const VOLUME_NAME_NT: DWORD = 0x2;
2415 pub const GENERIC_READ: DWORD = 0x80000000;
2416 pub const GENERIC_WRITE: DWORD = 0x40000000;
2417 pub const GENERIC_EXECUTE: DWORD = 0x20000000;
2418 pub const GENERIC_ALL: DWORD = 0x10000000;
2419 pub const FILE_WRITE_ATTRIBUTES: DWORD = 0x00000100;
2420 pub const FILE_READ_ATTRIBUTES: DWORD = 0x00000080;
2422 pub const STANDARD_RIGHTS_READ: DWORD = 0x20000;
2423 pub const STANDARD_RIGHTS_WRITE: DWORD = 0x20000;
2424 pub const FILE_WRITE_EA: DWORD = 0x00000010;
2425 pub const FILE_READ_EA: DWORD = 0x00000008;
2426 pub const FILE_GENERIC_READ: DWORD =
2427 STANDARD_RIGHTS_READ | FILE_READ_DATA |
2428 FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE;
2429 pub const FILE_GENERIC_WRITE: DWORD =
2430 STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA |
2431 FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA |
2434 pub const FILE_BEGIN: DWORD = 0;
2435 pub const FILE_CURRENT: DWORD = 1;
2436 pub const FILE_END: DWORD = 2;
2438 pub const MAX_PROTOCOL_CHAIN: DWORD = 7;
2439 pub const WSAPROTOCOL_LEN: DWORD = 255;
2440 pub const INVALID_SOCKET: DWORD = !0;
2442 pub const DETACHED_PROCESS: DWORD = 0x00000008;
2443 pub const CREATE_NEW_PROCESS_GROUP: DWORD = 0x00000200;
2444 pub const CREATE_UNICODE_ENVIRONMENT: DWORD = 0x00000400;
2446 pub const PIPE_ACCESS_DUPLEX: DWORD = 0x00000003;
2447 pub const PIPE_ACCESS_INBOUND: DWORD = 0x00000001;
2448 pub const PIPE_ACCESS_OUTBOUND: DWORD = 0x00000002;
2449 pub const PIPE_TYPE_BYTE: DWORD = 0x00000000;
2450 pub const PIPE_TYPE_MESSAGE: DWORD = 0x00000004;
2451 pub const PIPE_READMODE_BYTE: DWORD = 0x00000000;
2452 pub const PIPE_READMODE_MESSAGE: DWORD = 0x00000002;
2453 pub const PIPE_WAIT: DWORD = 0x00000000;
2454 pub const PIPE_NOWAIT: DWORD = 0x00000001;
2455 pub const PIPE_ACCEPT_REMOTE_CLIENTS: DWORD = 0x00000000;
2456 pub const PIPE_REJECT_REMOTE_CLIENTS: DWORD = 0x00000008;
2457 pub const PIPE_UNLIMITED_INSTANCES: DWORD = 255;
2459 pub const IPPROTO_RAW: c_int = 255;
2461 pub const FIONBIO: c_long = -0x7FFB9982;
2468 #[cfg(any(target_os = "linux", target_os = "android"))]
2471 use types::os::arch::c95::{c_int, c_uint};
2473 pub const EXIT_FAILURE : c_int = 1;
2474 pub const EXIT_SUCCESS : c_int = 0;
2475 pub const RAND_MAX : c_int = 2147483647;
2476 pub const EOF : c_int = -1;
2477 pub const SEEK_SET : c_int = 0;
2478 pub const SEEK_CUR : c_int = 1;
2479 pub const SEEK_END : c_int = 2;
2480 pub const _IOFBF : c_int = 0;
2481 pub const _IONBF : c_int = 2;
2482 pub const _IOLBF : c_int = 1;
2483 pub const BUFSIZ : c_uint = 8192_u32;
2484 pub const FOPEN_MAX : c_uint = 16_u32;
2485 pub const FILENAME_MAX : c_uint = 4096_u32;
2486 pub const L_tmpnam : c_uint = 20_u32;
2487 pub const TMP_MAX : c_uint = 238328_u32;
2491 #[cfg(any(target_arch = "x86",
2492 target_arch = "x86_64",
2493 target_arch = "arm",
2494 target_arch = "aarch64",
2495 target_arch = "powerpc"))]
2497 use types::os::arch::c95::c_int;
2498 use types::common::c95::c_void;
2499 use types::os::arch::posix88::mode_t;
2501 pub const O_RDONLY : c_int = 0;
2502 pub const O_WRONLY : c_int = 1;
2503 pub const O_RDWR : c_int = 2;
2504 pub const O_APPEND : c_int = 1024;
2505 pub const O_CREAT : c_int = 64;
2506 pub const O_EXCL : c_int = 128;
2507 pub const O_TRUNC : c_int = 512;
2508 pub const S_IFIFO : mode_t = 4096;
2509 pub const S_IFCHR : mode_t = 8192;
2510 pub const S_IFBLK : mode_t = 24576;
2511 pub const S_IFDIR : mode_t = 16384;
2512 pub const S_IFREG : mode_t = 32768;
2513 pub const S_IFLNK : mode_t = 40960;
2514 pub const S_IFMT : mode_t = 61440;
2515 pub const S_IEXEC : mode_t = 64;
2516 pub const S_IWRITE : mode_t = 128;
2517 pub const S_IREAD : mode_t = 256;
2518 pub const S_IRWXU : mode_t = 448;
2519 pub const S_IXUSR : mode_t = 64;
2520 pub const S_IWUSR : mode_t = 128;
2521 pub const S_IRUSR : mode_t = 256;
2522 pub const F_OK : c_int = 0;
2523 pub const R_OK : c_int = 4;
2524 pub const W_OK : c_int = 2;
2525 pub const X_OK : c_int = 1;
2526 pub const STDIN_FILENO : c_int = 0;
2527 pub const STDOUT_FILENO : c_int = 1;
2528 pub const STDERR_FILENO : c_int = 2;
2529 pub const F_LOCK : c_int = 1;
2530 pub const F_TEST : c_int = 3;
2531 pub const F_TLOCK : c_int = 2;
2532 pub const F_ULOCK : c_int = 0;
2533 pub const SIGHUP : c_int = 1;
2534 pub const SIGINT : c_int = 2;
2535 pub const SIGQUIT : c_int = 3;
2536 pub const SIGILL : c_int = 4;
2537 pub const SIGABRT : c_int = 6;
2538 pub const SIGFPE : c_int = 8;
2539 pub const SIGKILL : c_int = 9;
2540 pub const SIGSEGV : c_int = 11;
2541 pub const SIGPIPE : c_int = 13;
2542 pub const SIGALRM : c_int = 14;
2543 pub const SIGTERM : c_int = 15;
2545 pub const PROT_NONE : c_int = 0;
2546 pub const PROT_READ : c_int = 1;
2547 pub const PROT_WRITE : c_int = 2;
2548 pub const PROT_EXEC : c_int = 4;
2550 pub const MAP_FILE : c_int = 0x0000;
2551 pub const MAP_SHARED : c_int = 0x0001;
2552 pub const MAP_PRIVATE : c_int = 0x0002;
2553 pub const MAP_FIXED : c_int = 0x0010;
2554 pub const MAP_ANON : c_int = 0x0020;
2556 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
2558 pub const MCL_CURRENT : c_int = 0x0001;
2559 pub const MCL_FUTURE : c_int = 0x0002;
2561 pub const MS_ASYNC : c_int = 0x0001;
2562 pub const MS_INVALIDATE : c_int = 0x0002;
2563 pub const MS_SYNC : c_int = 0x0004;
2565 pub const EPERM : c_int = 1;
2566 pub const ENOENT : c_int = 2;
2567 pub const ESRCH : c_int = 3;
2568 pub const EINTR : c_int = 4;
2569 pub const EIO : c_int = 5;
2570 pub const ENXIO : c_int = 6;
2571 pub const E2BIG : c_int = 7;
2572 pub const ENOEXEC : c_int = 8;
2573 pub const EBADF : c_int = 9;
2574 pub const ECHILD : c_int = 10;
2575 pub const EAGAIN : c_int = 11;
2576 pub const ENOMEM : c_int = 12;
2577 pub const EACCES : c_int = 13;
2578 pub const EFAULT : c_int = 14;
2579 pub const ENOTBLK : c_int = 15;
2580 pub const EBUSY : c_int = 16;
2581 pub const EEXIST : c_int = 17;
2582 pub const EXDEV : c_int = 18;
2583 pub const ENODEV : c_int = 19;
2584 pub const ENOTDIR : c_int = 20;
2585 pub const EISDIR : c_int = 21;
2586 pub const EINVAL : c_int = 22;
2587 pub const ENFILE : c_int = 23;
2588 pub const EMFILE : c_int = 24;
2589 pub const ENOTTY : c_int = 25;
2590 pub const ETXTBSY : c_int = 26;
2591 pub const EFBIG : c_int = 27;
2592 pub const ENOSPC : c_int = 28;
2593 pub const ESPIPE : c_int = 29;
2594 pub const EROFS : c_int = 30;
2595 pub const EMLINK : c_int = 31;
2596 pub const EPIPE : c_int = 32;
2597 pub const EDOM : c_int = 33;
2598 pub const ERANGE : c_int = 34;
2600 pub const EDEADLK: c_int = 35;
2601 pub const ENAMETOOLONG: c_int = 36;
2602 pub const ENOLCK: c_int = 37;
2603 pub const ENOSYS: c_int = 38;
2604 pub const ENOTEMPTY: c_int = 39;
2605 pub const ELOOP: c_int = 40;
2606 pub const EWOULDBLOCK: c_int = EAGAIN;
2607 pub const ENOMSG: c_int = 42;
2608 pub const EIDRM: c_int = 43;
2609 pub const ECHRNG: c_int = 44;
2610 pub const EL2NSYNC: c_int = 45;
2611 pub const EL3HLT: c_int = 46;
2612 pub const EL3RST: c_int = 47;
2613 pub const ELNRNG: c_int = 48;
2614 pub const EUNATCH: c_int = 49;
2615 pub const ENOCSI: c_int = 50;
2616 pub const EL2HLT: c_int = 51;
2617 pub const EBADE: c_int = 52;
2618 pub const EBADR: c_int = 53;
2619 pub const EXFULL: c_int = 54;
2620 pub const ENOANO: c_int = 55;
2621 pub const EBADRQC: c_int = 56;
2622 pub const EBADSLT: c_int = 57;
2624 pub const EDEADLOCK: c_int = EDEADLK;
2626 pub const EBFONT: c_int = 59;
2627 pub const ENOSTR: c_int = 60;
2628 pub const ENODATA: c_int = 61;
2629 pub const ETIME: c_int = 62;
2630 pub const ENOSR: c_int = 63;
2631 pub const ENONET: c_int = 64;
2632 pub const ENOPKG: c_int = 65;
2633 pub const EREMOTE: c_int = 66;
2634 pub const ENOLINK: c_int = 67;
2635 pub const EADV: c_int = 68;
2636 pub const ESRMNT: c_int = 69;
2637 pub const ECOMM: c_int = 70;
2638 pub const EPROTO: c_int = 71;
2639 pub const EMULTIHOP: c_int = 72;
2640 pub const EDOTDOT: c_int = 73;
2641 pub const EBADMSG: c_int = 74;
2642 pub const EOVERFLOW: c_int = 75;
2643 pub const ENOTUNIQ: c_int = 76;
2644 pub const EBADFD: c_int = 77;
2645 pub const EREMCHG: c_int = 78;
2646 pub const ELIBACC: c_int = 79;
2647 pub const ELIBBAD: c_int = 80;
2648 pub const ELIBSCN: c_int = 81;
2649 pub const ELIBMAX: c_int = 82;
2650 pub const ELIBEXEC: c_int = 83;
2651 pub const EILSEQ: c_int = 84;
2652 pub const ERESTART: c_int = 85;
2653 pub const ESTRPIPE: c_int = 86;
2654 pub const EUSERS: c_int = 87;
2655 pub const ENOTSOCK: c_int = 88;
2656 pub const EDESTADDRREQ: c_int = 89;
2657 pub const EMSGSIZE: c_int = 90;
2658 pub const EPROTOTYPE: c_int = 91;
2659 pub const ENOPROTOOPT: c_int = 92;
2660 pub const EPROTONOSUPPORT: c_int = 93;
2661 pub const ESOCKTNOSUPPORT: c_int = 94;
2662 pub const EOPNOTSUPP: c_int = 95;
2663 pub const EPFNOSUPPORT: c_int = 96;
2664 pub const EAFNOSUPPORT: c_int = 97;
2665 pub const EADDRINUSE: c_int = 98;
2666 pub const EADDRNOTAVAIL: c_int = 99;
2667 pub const ENETDOWN: c_int = 100;
2668 pub const ENETUNREACH: c_int = 101;
2669 pub const ENETRESET: c_int = 102;
2670 pub const ECONNABORTED: c_int = 103;
2671 pub const ECONNRESET: c_int = 104;
2672 pub const ENOBUFS: c_int = 105;
2673 pub const EISCONN: c_int = 106;
2674 pub const ENOTCONN: c_int = 107;
2675 pub const ESHUTDOWN: c_int = 108;
2676 pub const ETOOMANYREFS: c_int = 109;
2677 pub const ETIMEDOUT: c_int = 110;
2678 pub const ECONNREFUSED: c_int = 111;
2679 pub const EHOSTDOWN: c_int = 112;
2680 pub const EHOSTUNREACH: c_int = 113;
2681 pub const EALREADY: c_int = 114;
2682 pub const EINPROGRESS: c_int = 115;
2683 pub const ESTALE: c_int = 116;
2684 pub const EUCLEAN: c_int = 117;
2685 pub const ENOTNAM: c_int = 118;
2686 pub const ENAVAIL: c_int = 119;
2687 pub const EISNAM: c_int = 120;
2688 pub const EREMOTEIO: c_int = 121;
2689 pub const EDQUOT: c_int = 122;
2691 pub const ENOMEDIUM: c_int = 123;
2692 pub const EMEDIUMTYPE: c_int = 124;
2693 pub const ECANCELED: c_int = 125;
2694 pub const ENOKEY: c_int = 126;
2695 pub const EKEYEXPIRED: c_int = 127;
2696 pub const EKEYREVOKED: c_int = 128;
2697 pub const EKEYREJECTED: c_int = 129;
2699 pub const EOWNERDEAD: c_int = 130;
2700 pub const ENOTRECOVERABLE: c_int = 131;
2702 pub const ERFKILL: c_int = 132;
2704 pub const EHWPOISON: c_int = 133;
2707 #[cfg(any(target_arch = "mips",
2708 target_arch = "mipsel"))]
2710 use types::os::arch::c95::c_int;
2711 use types::common::c95::c_void;
2712 use types::os::arch::posix88::mode_t;
2714 pub const O_RDONLY : c_int = 0;
2715 pub const O_WRONLY : c_int = 1;
2716 pub const O_RDWR : c_int = 2;
2717 pub const O_APPEND : c_int = 8;
2718 pub const O_CREAT : c_int = 256;
2719 pub const O_EXCL : c_int = 1024;
2720 pub const O_TRUNC : c_int = 512;
2721 pub const S_IFIFO : mode_t = 4096;
2722 pub const S_IFCHR : mode_t = 8192;
2723 pub const S_IFBLK : mode_t = 24576;
2724 pub const S_IFDIR : mode_t = 16384;
2725 pub const S_IFREG : mode_t = 32768;
2726 pub const S_IFLNK : mode_t = 40960;
2727 pub const S_IFMT : mode_t = 61440;
2728 pub const S_IEXEC : mode_t = 64;
2729 pub const S_IWRITE : mode_t = 128;
2730 pub const S_IREAD : mode_t = 256;
2731 pub const S_IRWXU : mode_t = 448;
2732 pub const S_IXUSR : mode_t = 64;
2733 pub const S_IWUSR : mode_t = 128;
2734 pub const S_IRUSR : mode_t = 256;
2735 pub const F_OK : c_int = 0;
2736 pub const R_OK : c_int = 4;
2737 pub const W_OK : c_int = 2;
2738 pub const X_OK : c_int = 1;
2739 pub const STDIN_FILENO : c_int = 0;
2740 pub const STDOUT_FILENO : c_int = 1;
2741 pub const STDERR_FILENO : c_int = 2;
2742 pub const F_LOCK : c_int = 1;
2743 pub const F_TEST : c_int = 3;
2744 pub const F_TLOCK : c_int = 2;
2745 pub const F_ULOCK : c_int = 0;
2746 pub const SIGHUP : c_int = 1;
2747 pub const SIGINT : c_int = 2;
2748 pub const SIGQUIT : c_int = 3;
2749 pub const SIGILL : c_int = 4;
2750 pub const SIGABRT : c_int = 6;
2751 pub const SIGFPE : c_int = 8;
2752 pub const SIGKILL : c_int = 9;
2753 pub const SIGSEGV : c_int = 11;
2754 pub const SIGPIPE : c_int = 13;
2755 pub const SIGALRM : c_int = 14;
2756 pub const SIGTERM : c_int = 15;
2758 pub const PROT_NONE : c_int = 0;
2759 pub const PROT_READ : c_int = 1;
2760 pub const PROT_WRITE : c_int = 2;
2761 pub const PROT_EXEC : c_int = 4;
2763 pub const MAP_FILE : c_int = 0x0000;
2764 pub const MAP_SHARED : c_int = 0x0001;
2765 pub const MAP_PRIVATE : c_int = 0x0002;
2766 pub const MAP_FIXED : c_int = 0x0010;
2767 pub const MAP_ANON : c_int = 0x0800;
2769 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
2771 pub const MCL_CURRENT : c_int = 0x0001;
2772 pub const MCL_FUTURE : c_int = 0x0002;
2774 pub const MS_ASYNC : c_int = 0x0001;
2775 pub const MS_INVALIDATE : c_int = 0x0002;
2776 pub const MS_SYNC : c_int = 0x0004;
2778 pub const EPERM : c_int = 1;
2779 pub const ENOENT : c_int = 2;
2780 pub const ESRCH : c_int = 3;
2781 pub const EINTR : c_int = 4;
2782 pub const EIO : c_int = 5;
2783 pub const ENXIO : c_int = 6;
2784 pub const E2BIG : c_int = 7;
2785 pub const ENOEXEC : c_int = 8;
2786 pub const EBADF : c_int = 9;
2787 pub const ECHILD : c_int = 10;
2788 pub const EAGAIN : c_int = 11;
2789 pub const ENOMEM : c_int = 12;
2790 pub const EACCES : c_int = 13;
2791 pub const EFAULT : c_int = 14;
2792 pub const ENOTBLK : c_int = 15;
2793 pub const EBUSY : c_int = 16;
2794 pub const EEXIST : c_int = 17;
2795 pub const EXDEV : c_int = 18;
2796 pub const ENODEV : c_int = 19;
2797 pub const ENOTDIR : c_int = 20;
2798 pub const EISDIR : c_int = 21;
2799 pub const EINVAL : c_int = 22;
2800 pub const ENFILE : c_int = 23;
2801 pub const EMFILE : c_int = 24;
2802 pub const ENOTTY : c_int = 25;
2803 pub const ETXTBSY : c_int = 26;
2804 pub const EFBIG : c_int = 27;
2805 pub const ENOSPC : c_int = 28;
2806 pub const ESPIPE : c_int = 29;
2807 pub const EROFS : c_int = 30;
2808 pub const EMLINK : c_int = 31;
2809 pub const EPIPE : c_int = 32;
2810 pub const EDOM : c_int = 33;
2811 pub const ERANGE : c_int = 34;
2813 pub const ENOMSG: c_int = 35;
2814 pub const EIDRM: c_int = 36;
2815 pub const ECHRNG: c_int = 37;
2816 pub const EL2NSYNC: c_int = 38;
2817 pub const EL3HLT: c_int = 39;
2818 pub const EL3RST: c_int = 40;
2819 pub const ELNRNG: c_int = 41;
2820 pub const EUNATCH: c_int = 42;
2821 pub const ENOCSI: c_int = 43;
2822 pub const EL2HLT: c_int = 44;
2823 pub const EDEADLK: c_int = 45;
2824 pub const ENOLCK: c_int = 46;
2825 pub const EBADE: c_int = 50;
2826 pub const EBADR: c_int = 51;
2827 pub const EXFULL: c_int = 52;
2828 pub const ENOANO: c_int = 53;
2829 pub const EBADRQC: c_int = 54;
2830 pub const EBADSLT: c_int = 55;
2831 pub const EDEADLOCK: c_int = 56;
2832 pub const EBFONT: c_int = 59;
2833 pub const ENOSTR: c_int = 60;
2834 pub const ENODATA: c_int = 61;
2835 pub const ETIME: c_int = 62;
2836 pub const ENOSR: c_int = 63;
2837 pub const ENONET: c_int = 64;
2838 pub const ENOPKG: c_int = 65;
2839 pub const EREMOTE: c_int = 66;
2840 pub const ENOLINK: c_int = 67;
2841 pub const EADV: c_int = 68;
2842 pub const ESRMNT: c_int = 69;
2843 pub const ECOMM: c_int = 70;
2844 pub const EPROTO: c_int = 71;
2845 pub const EDOTDOT: c_int = 73;
2846 pub const EMULTIHOP: c_int = 74;
2847 pub const EBADMSG: c_int = 77;
2848 pub const ENAMETOOLONG: c_int = 78;
2849 pub const EOVERFLOW: c_int = 79;
2850 pub const ENOTUNIQ: c_int = 80;
2851 pub const EBADFD: c_int = 81;
2852 pub const EREMCHG: c_int = 82;
2853 pub const ELIBACC: c_int = 83;
2854 pub const ELIBBAD: c_int = 84;
2855 pub const ELIBSCN: c_int = 95;
2856 pub const ELIBMAX: c_int = 86;
2857 pub const ELIBEXEC: c_int = 87;
2858 pub const EILSEQ: c_int = 88;
2859 pub const ENOSYS: c_int = 89;
2860 pub const ELOOP: c_int = 90;
2861 pub const ERESTART: c_int = 91;
2862 pub const ESTRPIPE: c_int = 92;
2863 pub const ENOTEMPTY: c_int = 93;
2864 pub const EUSERS: c_int = 94;
2865 pub const ENOTSOCK: c_int = 95;
2866 pub const EDESTADDRREQ: c_int = 96;
2867 pub const EMSGSIZE: c_int = 97;
2868 pub const EPROTOTYPE: c_int = 98;
2869 pub const ENOPROTOOPT: c_int = 99;
2870 pub const EPROTONOSUPPORT: c_int = 120;
2871 pub const ESOCKTNOSUPPORT: c_int = 121;
2872 pub const EOPNOTSUPP: c_int = 122;
2873 pub const EPFNOSUPPORT: c_int = 123;
2874 pub const EAFNOSUPPORT: c_int = 124;
2875 pub const EADDRINUSE: c_int = 125;
2876 pub const EADDRNOTAVAIL: c_int = 126;
2877 pub const ENETDOWN: c_int = 127;
2878 pub const ENETUNREACH: c_int = 128;
2879 pub const ENETRESET: c_int = 129;
2880 pub const ECONNABORTED: c_int = 130;
2881 pub const ECONNRESET: c_int = 131;
2882 pub const ENOBUFS: c_int = 132;
2883 pub const EISCONN: c_int = 133;
2884 pub const ENOTCONN: c_int = 134;
2885 pub const EUCLEAN: c_int = 135;
2886 pub const ENOTNAM: c_int = 137;
2887 pub const ENAVAIL: c_int = 138;
2888 pub const EISNAM: c_int = 139;
2889 pub const EREMOTEIO: c_int = 140;
2890 pub const ESHUTDOWN: c_int = 143;
2891 pub const ETOOMANYREFS: c_int = 144;
2892 pub const ETIMEDOUT: c_int = 145;
2893 pub const ECONNREFUSED: c_int = 146;
2894 pub const EHOSTDOWN: c_int = 147;
2895 pub const EHOSTUNREACH: c_int = 148;
2896 pub const EWOULDBLOCK: c_int = EAGAIN;
2897 pub const EALREADY: c_int = 149;
2898 pub const EINPROGRESS: c_int = 150;
2899 pub const ESTALE: c_int = 151;
2900 pub const ECANCELED: c_int = 158;
2902 pub const ENOMEDIUM: c_int = 159;
2903 pub const EMEDIUMTYPE: c_int = 160;
2904 pub const ENOKEY: c_int = 161;
2905 pub const EKEYEXPIRED: c_int = 162;
2906 pub const EKEYREVOKED: c_int = 163;
2907 pub const EKEYREJECTED: c_int = 164;
2909 pub const EOWNERDEAD: c_int = 165;
2910 pub const ENOTRECOVERABLE: c_int = 166;
2912 pub const ERFKILL: c_int = 167;
2914 pub const EHWPOISON: c_int = 168;
2916 pub const EDQUOT: c_int = 1133;
2919 use types::os::arch::c95::{c_int, size_t};
2921 pub const F_DUPFD : c_int = 0;
2922 pub const F_GETFD : c_int = 1;
2923 pub const F_SETFD : c_int = 2;
2924 pub const F_GETFL : c_int = 3;
2925 pub const F_SETFL : c_int = 4;
2927 pub const SIGTRAP : c_int = 5;
2928 pub const SIGPIPE: c_int = 13;
2929 pub const SIG_IGN: size_t = 1;
2931 pub const GLOB_ERR : c_int = 1 << 0;
2932 pub const GLOB_MARK : c_int = 1 << 1;
2933 pub const GLOB_NOSORT : c_int = 1 << 2;
2934 pub const GLOB_DOOFFS : c_int = 1 << 3;
2935 pub const GLOB_NOCHECK : c_int = 1 << 4;
2936 pub const GLOB_APPEND : c_int = 1 << 5;
2937 pub const GLOB_NOESCAPE : c_int = 1 << 6;
2939 pub const GLOB_NOSPACE : c_int = 1;
2940 pub const GLOB_ABORTED : c_int = 2;
2941 pub const GLOB_NOMATCH : c_int = 3;
2943 pub const POSIX_MADV_NORMAL : c_int = 0;
2944 pub const POSIX_MADV_RANDOM : c_int = 1;
2945 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
2946 pub const POSIX_MADV_WILLNEED : c_int = 3;
2947 pub const POSIX_MADV_DONTNEED : c_int = 4;
2949 pub const _SC_MQ_PRIO_MAX : c_int = 28;
2950 pub const _SC_IOV_MAX : c_int = 60;
2951 pub const _SC_GETGR_R_SIZE_MAX : c_int = 69;
2952 pub const _SC_GETPW_R_SIZE_MAX : c_int = 70;
2953 pub const _SC_LOGIN_NAME_MAX : c_int = 71;
2954 pub const _SC_TTY_NAME_MAX : c_int = 72;
2955 pub const _SC_THREADS : c_int = 67;
2956 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 68;
2957 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 73;
2958 pub const _SC_THREAD_KEYS_MAX : c_int = 74;
2959 pub const _SC_THREAD_STACK_MIN : c_int = 75;
2960 pub const _SC_THREAD_THREADS_MAX : c_int = 76;
2961 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 77;
2962 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 78;
2963 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 79;
2964 pub const _SC_THREAD_PRIO_INHERIT : c_int = 80;
2965 pub const _SC_THREAD_PRIO_PROTECT : c_int = 81;
2966 pub const _SC_THREAD_PROCESS_SHARED : c_int = 82;
2967 pub const _SC_ATEXIT_MAX : c_int = 87;
2968 pub const _SC_XOPEN_VERSION : c_int = 89;
2969 pub const _SC_XOPEN_XCU_VERSION : c_int = 90;
2970 pub const _SC_XOPEN_UNIX : c_int = 91;
2971 pub const _SC_XOPEN_CRYPT : c_int = 92;
2972 pub const _SC_XOPEN_ENH_I18N : c_int = 93;
2973 pub const _SC_XOPEN_SHM : c_int = 94;
2974 pub const _SC_XOPEN_LEGACY : c_int = 129;
2975 pub const _SC_XOPEN_REALTIME : c_int = 130;
2976 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 131;
2978 pub const PTHREAD_CREATE_JOINABLE: c_int = 0;
2979 pub const PTHREAD_CREATE_DETACHED: c_int = 1;
2981 #[cfg(target_os = "android")]
2982 pub const PTHREAD_STACK_MIN: size_t = 8192;
2984 #[cfg(all(target_os = "linux",
2985 any(target_arch = "arm",
2986 target_arch = "x86",
2987 target_arch = "x86_64")))]
2988 pub const PTHREAD_STACK_MIN: size_t = 16384;
2990 #[cfg(all(target_os = "linux",
2991 any(target_arch = "mips",
2992 target_arch = "mipsel",
2993 target_arch = "aarch64",
2994 target_arch = "powerpc")))]
2995 pub const PTHREAD_STACK_MIN: size_t = 131072;
2997 pub const CLOCK_REALTIME: c_int = 0;
2998 pub const CLOCK_MONOTONIC: c_int = 1;
3002 #[cfg(any(target_arch = "arm",
3003 target_arch = "aarch64",
3004 target_arch = "x86",
3005 target_arch = "x86_64",
3006 target_arch = "powerpc"))]
3008 use types::os::arch::c95::c_int;
3010 pub const MADV_NORMAL : c_int = 0;
3011 pub const MADV_RANDOM : c_int = 1;
3012 pub const MADV_SEQUENTIAL : c_int = 2;
3013 pub const MADV_WILLNEED : c_int = 3;
3014 pub const MADV_DONTNEED : c_int = 4;
3015 pub const MADV_REMOVE : c_int = 9;
3016 pub const MADV_DONTFORK : c_int = 10;
3017 pub const MADV_DOFORK : c_int = 11;
3018 pub const MADV_MERGEABLE : c_int = 12;
3019 pub const MADV_UNMERGEABLE : c_int = 13;
3020 pub const MADV_HWPOISON : c_int = 100;
3022 pub const IFF_LOOPBACK: c_int = 0x8;
3024 pub const AF_UNIX: c_int = 1;
3025 pub const AF_INET: c_int = 2;
3026 pub const AF_INET6: c_int = 10;
3027 pub const SOCK_STREAM: c_int = 1;
3028 pub const SOCK_DGRAM: c_int = 2;
3029 pub const SOCK_RAW: c_int = 3;
3030 pub const IPPROTO_TCP: c_int = 6;
3031 pub const IPPROTO_IP: c_int = 0;
3032 pub const IPPROTO_IPV6: c_int = 41;
3033 pub const IP_MULTICAST_TTL: c_int = 33;
3034 pub const IP_MULTICAST_LOOP: c_int = 34;
3035 pub const IP_TTL: c_int = 2;
3036 pub const IP_HDRINCL: c_int = 3;
3037 pub const IP_ADD_MEMBERSHIP: c_int = 35;
3038 pub const IP_DROP_MEMBERSHIP: c_int = 36;
3039 pub const IPV6_ADD_MEMBERSHIP: c_int = 20;
3040 pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
3042 pub const TCP_NODELAY: c_int = 1;
3043 pub const SOL_SOCKET: c_int = 1;
3044 pub const SO_KEEPALIVE: c_int = 9;
3045 pub const SO_BROADCAST: c_int = 6;
3046 pub const SO_REUSEADDR: c_int = 2;
3047 pub const SO_ERROR: c_int = 4;
3049 pub const SHUT_RD: c_int = 0;
3050 pub const SHUT_WR: c_int = 1;
3051 pub const SHUT_RDWR: c_int = 2;
3053 #[cfg(any(target_arch = "mips",
3054 target_arch = "mipsel"))]
3056 use types::os::arch::c95::c_int;
3058 pub const MADV_NORMAL : c_int = 0;
3059 pub const MADV_RANDOM : c_int = 1;
3060 pub const MADV_SEQUENTIAL : c_int = 2;
3061 pub const MADV_WILLNEED : c_int = 3;
3062 pub const MADV_DONTNEED : c_int = 4;
3063 pub const MADV_REMOVE : c_int = 9;
3064 pub const MADV_DONTFORK : c_int = 10;
3065 pub const MADV_DOFORK : c_int = 11;
3066 pub const MADV_MERGEABLE : c_int = 12;
3067 pub const MADV_UNMERGEABLE : c_int = 13;
3068 pub const MADV_HWPOISON : c_int = 100;
3070 pub const AF_UNIX: c_int = 1;
3071 pub const AF_INET: c_int = 2;
3072 pub const AF_INET6: c_int = 10;
3073 pub const SOCK_STREAM: c_int = 2;
3074 pub const SOCK_DGRAM: c_int = 1;
3075 pub const SOCK_RAW: c_int = 3;
3076 pub const IPPROTO_TCP: c_int = 6;
3077 pub const IPPROTO_IP: c_int = 0;
3078 pub const IPPROTO_IPV6: c_int = 41;
3079 pub const IP_MULTICAST_TTL: c_int = 33;
3080 pub const IP_MULTICAST_LOOP: c_int = 34;
3081 pub const IP_TTL: c_int = 2;
3082 pub const IP_HDRINCL: c_int = 3;
3083 pub const IP_ADD_MEMBERSHIP: c_int = 35;
3084 pub const IP_DROP_MEMBERSHIP: c_int = 36;
3085 pub const IPV6_ADD_MEMBERSHIP: c_int = 20;
3086 pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
3088 pub const TCP_NODELAY: c_int = 1;
3089 pub const SOL_SOCKET: c_int = 65535;
3090 pub const SO_KEEPALIVE: c_int = 8;
3091 pub const SO_BROADCAST: c_int = 32;
3092 pub const SO_REUSEADDR: c_int = 4;
3093 pub const SO_ERROR: c_int = 4103;
3095 pub const SHUT_RD: c_int = 0;
3096 pub const SHUT_WR: c_int = 1;
3097 pub const SHUT_RDWR: c_int = 2;
3099 #[cfg(any(target_arch = "x86",
3100 target_arch = "x86_64",
3101 target_arch = "arm",
3102 target_arch = "aarch64",
3103 target_arch = "powerpc"))]
3105 use types::os::arch::c95::c_int;
3107 pub const AF_PACKET : c_int = 17;
3108 pub const IPPROTO_RAW : c_int = 255;
3110 pub const O_RSYNC : c_int = 1052672;
3111 pub const O_DSYNC : c_int = 4096;
3112 pub const O_NONBLOCK : c_int = 2048;
3113 pub const O_SYNC : c_int = 1052672;
3115 pub const PROT_GROWSDOWN : c_int = 0x010000000;
3116 pub const PROT_GROWSUP : c_int = 0x020000000;
3118 pub const MAP_TYPE : c_int = 0x000f;
3119 pub const MAP_ANONYMOUS : c_int = 0x0020;
3120 pub const MAP_32BIT : c_int = 0x0040;
3121 pub const MAP_GROWSDOWN : c_int = 0x0100;
3122 pub const MAP_DENYWRITE : c_int = 0x0800;
3123 pub const MAP_EXECUTABLE : c_int = 0x01000;
3124 pub const MAP_LOCKED : c_int = 0x02000;
3125 pub const MAP_NONRESERVE : c_int = 0x04000;
3126 pub const MAP_POPULATE : c_int = 0x08000;
3127 pub const MAP_NONBLOCK : c_int = 0x010000;
3128 pub const MAP_STACK : c_int = 0x020000;
3130 #[cfg(any(target_arch = "mips",
3131 target_arch = "mipsel"))]
3133 use types::os::arch::c95::c_int;
3135 pub const AF_PACKET : c_int = 17;
3136 pub const IPPROTO_RAW : c_int = 255;
3138 pub const O_RSYNC : c_int = 16400;
3139 pub const O_DSYNC : c_int = 16;
3140 pub const O_NONBLOCK : c_int = 128;
3141 pub const O_SYNC : c_int = 16400;
3143 pub const PROT_GROWSDOWN : c_int = 0x01000000;
3144 pub const PROT_GROWSUP : c_int = 0x02000000;
3146 pub const MAP_TYPE : c_int = 0x000f;
3147 pub const MAP_ANONYMOUS : c_int = 0x0800;
3148 pub const MAP_GROWSDOWN : c_int = 0x01000;
3149 pub const MAP_DENYWRITE : c_int = 0x02000;
3150 pub const MAP_EXECUTABLE : c_int = 0x04000;
3151 pub const MAP_LOCKED : c_int = 0x08000;
3152 pub const MAP_NONRESERVE : c_int = 0x0400;
3153 pub const MAP_POPULATE : c_int = 0x010000;
3154 pub const MAP_NONBLOCK : c_int = 0x020000;
3155 pub const MAP_STACK : c_int = 0x040000;
3157 #[cfg(target_os = "linux")]
3159 use types::os::arch::c95::c_int;
3161 pub const _SC_ARG_MAX : c_int = 0;
3162 pub const _SC_CHILD_MAX : c_int = 1;
3163 pub const _SC_CLK_TCK : c_int = 2;
3164 pub const _SC_NGROUPS_MAX : c_int = 3;
3165 pub const _SC_OPEN_MAX : c_int = 4;
3166 pub const _SC_STREAM_MAX : c_int = 5;
3167 pub const _SC_TZNAME_MAX : c_int = 6;
3168 pub const _SC_JOB_CONTROL : c_int = 7;
3169 pub const _SC_SAVED_IDS : c_int = 8;
3170 pub const _SC_REALTIME_SIGNALS : c_int = 9;
3171 pub const _SC_PRIORITY_SCHEDULING : c_int = 10;
3172 pub const _SC_TIMERS : c_int = 11;
3173 pub const _SC_ASYNCHRONOUS_IO : c_int = 12;
3174 pub const _SC_PRIORITIZED_IO : c_int = 13;
3175 pub const _SC_SYNCHRONIZED_IO : c_int = 14;
3176 pub const _SC_FSYNC : c_int = 15;
3177 pub const _SC_MAPPED_FILES : c_int = 16;
3178 pub const _SC_MEMLOCK : c_int = 17;
3179 pub const _SC_MEMLOCK_RANGE : c_int = 18;
3180 pub const _SC_MEMORY_PROTECTION : c_int = 19;
3181 pub const _SC_MESSAGE_PASSING : c_int = 20;
3182 pub const _SC_SEMAPHORES : c_int = 21;
3183 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 22;
3184 pub const _SC_AIO_LISTIO_MAX : c_int = 23;
3185 pub const _SC_AIO_MAX : c_int = 24;
3186 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 25;
3187 pub const _SC_DELAYTIMER_MAX : c_int = 26;
3188 pub const _SC_MQ_OPEN_MAX : c_int = 27;
3189 pub const _SC_VERSION : c_int = 29;
3190 pub const _SC_PAGESIZE : c_int = 30;
3191 pub const _SC_RTSIG_MAX : c_int = 31;
3192 pub const _SC_SEM_NSEMS_MAX : c_int = 32;
3193 pub const _SC_SEM_VALUE_MAX : c_int = 33;
3194 pub const _SC_SIGQUEUE_MAX : c_int = 34;
3195 pub const _SC_TIMER_MAX : c_int = 35;
3196 pub const _SC_BC_BASE_MAX : c_int = 36;
3197 pub const _SC_BC_DIM_MAX : c_int = 37;
3198 pub const _SC_BC_SCALE_MAX : c_int = 38;
3199 pub const _SC_BC_STRING_MAX : c_int = 39;
3200 pub const _SC_COLL_WEIGHTS_MAX : c_int = 40;
3201 pub const _SC_EXPR_NEST_MAX : c_int = 42;
3202 pub const _SC_LINE_MAX : c_int = 43;
3203 pub const _SC_RE_DUP_MAX : c_int = 44;
3204 pub const _SC_2_VERSION : c_int = 46;
3205 pub const _SC_2_C_BIND : c_int = 47;
3206 pub const _SC_2_C_DEV : c_int = 48;
3207 pub const _SC_2_FORT_DEV : c_int = 49;
3208 pub const _SC_2_FORT_RUN : c_int = 50;
3209 pub const _SC_2_SW_DEV : c_int = 51;
3210 pub const _SC_2_LOCALEDEF : c_int = 52;
3211 pub const _SC_2_CHAR_TERM : c_int = 95;
3212 pub const _SC_2_C_VERSION : c_int = 96;
3213 pub const _SC_2_UPE : c_int = 97;
3214 pub const _SC_XBS5_ILP32_OFF32 : c_int = 125;
3215 pub const _SC_XBS5_ILP32_OFFBIG : c_int = 126;
3216 pub const _SC_XBS5_LPBIG_OFFBIG : c_int = 128;
3218 #[cfg(target_os = "android")]
3220 use types::os::arch::c95::c_int;
3222 pub const _SC_ARG_MAX : c_int = 0;
3223 pub const _SC_BC_BASE_MAX : c_int = 1;
3224 pub const _SC_BC_DIM_MAX : c_int = 2;
3225 pub const _SC_BC_SCALE_MAX : c_int = 3;
3226 pub const _SC_BC_STRING_MAX : c_int = 4;
3227 pub const _SC_CHILD_MAX : c_int = 5;
3228 pub const _SC_CLK_TCK : c_int = 6;
3229 pub const _SC_COLL_WEIGHTS_MAX : c_int = 7;
3230 pub const _SC_EXPR_NEST_MAX : c_int = 8;
3231 pub const _SC_LINE_MAX : c_int = 9;
3232 pub const _SC_NGROUPS_MAX : c_int = 10;
3233 pub const _SC_OPEN_MAX : c_int = 11;
3234 pub const _SC_2_C_BIND : c_int = 13;
3235 pub const _SC_2_C_DEV : c_int = 14;
3236 pub const _SC_2_C_VERSION : c_int = 15;
3237 pub const _SC_2_CHAR_TERM : c_int = 16;
3238 pub const _SC_2_FORT_DEV : c_int = 17;
3239 pub const _SC_2_FORT_RUN : c_int = 18;
3240 pub const _SC_2_LOCALEDEF : c_int = 19;
3241 pub const _SC_2_SW_DEV : c_int = 20;
3242 pub const _SC_2_UPE : c_int = 21;
3243 pub const _SC_2_VERSION : c_int = 22;
3244 pub const _SC_JOB_CONTROL : c_int = 23;
3245 pub const _SC_SAVED_IDS : c_int = 24;
3246 pub const _SC_VERSION : c_int = 25;
3247 pub const _SC_RE_DUP_MAX : c_int = 26;
3248 pub const _SC_STREAM_MAX : c_int = 27;
3249 pub const _SC_TZNAME_MAX : c_int = 28;
3250 pub const _SC_PAGESIZE : c_int = 39;
3254 #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
3257 use types::os::arch::c95::{c_int, c_uint};
3259 pub const EXIT_FAILURE : c_int = 1;
3260 pub const EXIT_SUCCESS : c_int = 0;
3261 pub const RAND_MAX : c_int = 2147483647;
3262 pub const EOF : c_int = -1;
3263 pub const SEEK_SET : c_int = 0;
3264 pub const SEEK_CUR : c_int = 1;
3265 pub const SEEK_END : c_int = 2;
3266 pub const _IOFBF : c_int = 0;
3267 pub const _IONBF : c_int = 2;
3268 pub const _IOLBF : c_int = 1;
3269 pub const BUFSIZ : c_uint = 1024_u32;
3270 pub const FOPEN_MAX : c_uint = 20_u32;
3271 pub const FILENAME_MAX : c_uint = 1024_u32;
3272 pub const L_tmpnam : c_uint = 1024_u32;
3273 pub const TMP_MAX : c_uint = 308915776_u32;
3278 use types::common::c95::c_void;
3279 use types::os::arch::c95::c_int;
3280 use types::os::arch::posix88::mode_t;
3282 pub const O_RDONLY : c_int = 0;
3283 pub const O_WRONLY : c_int = 1;
3284 pub const O_RDWR : c_int = 2;
3285 pub const O_APPEND : c_int = 8;
3286 pub const O_CREAT : c_int = 512;
3287 pub const O_EXCL : c_int = 2048;
3288 pub const O_TRUNC : c_int = 1024;
3289 pub const S_IFIFO : mode_t = 4096;
3290 pub const S_IFCHR : mode_t = 8192;
3291 pub const S_IFBLK : mode_t = 24576;
3292 pub const S_IFDIR : mode_t = 16384;
3293 pub const S_IFREG : mode_t = 32768;
3294 pub const S_IFLNK : mode_t = 40960;
3295 pub const S_IFMT : mode_t = 61440;
3296 pub const S_IEXEC : mode_t = 64;
3297 pub const S_IWRITE : mode_t = 128;
3298 pub const S_IREAD : mode_t = 256;
3299 pub const S_IRWXU : mode_t = 448;
3300 pub const S_IXUSR : mode_t = 64;
3301 pub const S_IWUSR : mode_t = 128;
3302 pub const S_IRUSR : mode_t = 256;
3303 pub const F_OK : c_int = 0;
3304 pub const R_OK : c_int = 4;
3305 pub const W_OK : c_int = 2;
3306 pub const X_OK : c_int = 1;
3307 pub const STDIN_FILENO : c_int = 0;
3308 pub const STDOUT_FILENO : c_int = 1;
3309 pub const STDERR_FILENO : c_int = 2;
3310 pub const F_LOCK : c_int = 1;
3311 pub const F_TEST : c_int = 3;
3312 pub const F_TLOCK : c_int = 2;
3313 pub const F_ULOCK : c_int = 0;
3314 pub const SIGHUP : c_int = 1;
3315 pub const SIGINT : c_int = 2;
3316 pub const SIGQUIT : c_int = 3;
3317 pub const SIGILL : c_int = 4;
3318 pub const SIGABRT : c_int = 6;
3319 pub const SIGFPE : c_int = 8;
3320 pub const SIGKILL : c_int = 9;
3321 pub const SIGSEGV : c_int = 11;
3322 pub const SIGPIPE : c_int = 13;
3323 pub const SIGALRM : c_int = 14;
3324 pub const SIGTERM : c_int = 15;
3326 pub const PROT_NONE : c_int = 0;
3327 pub const PROT_READ : c_int = 1;
3328 pub const PROT_WRITE : c_int = 2;
3329 pub const PROT_EXEC : c_int = 4;
3331 pub const MAP_FILE : c_int = 0x0000;
3332 pub const MAP_SHARED : c_int = 0x0001;
3333 pub const MAP_PRIVATE : c_int = 0x0002;
3334 pub const MAP_FIXED : c_int = 0x0010;
3335 pub const MAP_ANON : c_int = 0x1000;
3337 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
3339 pub const MCL_CURRENT : c_int = 0x0001;
3340 pub const MCL_FUTURE : c_int = 0x0002;
3342 pub const MS_SYNC : c_int = 0x0000;
3343 pub const MS_ASYNC : c_int = 0x0001;
3344 pub const MS_INVALIDATE : c_int = 0x0002;
3346 pub const EPERM : c_int = 1;
3347 pub const ENOENT : c_int = 2;
3348 pub const ESRCH : c_int = 3;
3349 pub const EINTR : c_int = 4;
3350 pub const EIO : c_int = 5;
3351 pub const ENXIO : c_int = 6;
3352 pub const E2BIG : c_int = 7;
3353 pub const ENOEXEC : c_int = 8;
3354 pub const EBADF : c_int = 9;
3355 pub const ECHILD : c_int = 10;
3356 pub const EDEADLK : c_int = 11;
3357 pub const ENOMEM : c_int = 12;
3358 pub const EACCES : c_int = 13;
3359 pub const EFAULT : c_int = 14;
3360 pub const ENOTBLK : c_int = 15;
3361 pub const EBUSY : c_int = 16;
3362 pub const EEXIST : c_int = 17;
3363 pub const EXDEV : c_int = 18;
3364 pub const ENODEV : c_int = 19;
3365 pub const ENOTDIR : c_int = 20;
3366 pub const EISDIR : c_int = 21;
3367 pub const EINVAL : c_int = 22;
3368 pub const ENFILE : c_int = 23;
3369 pub const EMFILE : c_int = 24;
3370 pub const ENOTTY : c_int = 25;
3371 pub const ETXTBSY : c_int = 26;
3372 pub const EFBIG : c_int = 27;
3373 pub const ENOSPC : c_int = 28;
3374 pub const ESPIPE : c_int = 29;
3375 pub const EROFS : c_int = 30;
3376 pub const EMLINK : c_int = 31;
3377 pub const EPIPE : c_int = 32;
3378 pub const EDOM : c_int = 33;
3379 pub const ERANGE : c_int = 34;
3380 pub const EAGAIN : c_int = 35;
3381 pub const EWOULDBLOCK : c_int = 35;
3382 pub const EINPROGRESS : c_int = 36;
3383 pub const EALREADY : c_int = 37;
3384 pub const ENOTSOCK : c_int = 38;
3385 pub const EDESTADDRREQ : c_int = 39;
3386 pub const EMSGSIZE : c_int = 40;
3387 pub const EPROTOTYPE : c_int = 41;
3388 pub const ENOPROTOOPT : c_int = 42;
3389 pub const EPROTONOSUPPORT : c_int = 43;
3390 pub const ESOCKTNOSUPPORT : c_int = 44;
3391 pub const EOPNOTSUPP : c_int = 45;
3392 pub const EPFNOSUPPORT : c_int = 46;
3393 pub const EAFNOSUPPORT : c_int = 47;
3394 pub const EADDRINUSE : c_int = 48;
3395 pub const EADDRNOTAVAIL : c_int = 49;
3396 pub const ENETDOWN : c_int = 50;
3397 pub const ENETUNREACH : c_int = 51;
3398 pub const ENETRESET : c_int = 52;
3399 pub const ECONNABORTED : c_int = 53;
3400 pub const ECONNRESET : c_int = 54;
3401 pub const ENOBUFS : c_int = 55;
3402 pub const EISCONN : c_int = 56;
3403 pub const ENOTCONN : c_int = 57;
3404 pub const ESHUTDOWN : c_int = 58;
3405 pub const ETOOMANYREFS : c_int = 59;
3406 pub const ETIMEDOUT : c_int = 60;
3407 pub const ECONNREFUSED : c_int = 61;
3408 pub const ELOOP : c_int = 62;
3409 pub const ENAMETOOLONG : c_int = 63;
3410 pub const EHOSTDOWN : c_int = 64;
3411 pub const EHOSTUNREACH : c_int = 65;
3412 pub const ENOTEMPTY : c_int = 66;
3413 pub const EPROCLIM : c_int = 67;
3414 pub const EUSERS : c_int = 68;
3415 pub const EDQUOT : c_int = 69;
3416 pub const ESTALE : c_int = 70;
3417 pub const EREMOTE : c_int = 71;
3418 pub const EBADRPC : c_int = 72;
3419 pub const ERPCMISMATCH : c_int = 73;
3420 pub const EPROGUNAVAIL : c_int = 74;
3421 pub const EPROGMISMATCH : c_int = 75;
3422 pub const EPROCUNAVAIL : c_int = 76;
3423 pub const ENOLCK : c_int = 77;
3424 pub const ENOSYS : c_int = 78;
3425 pub const EFTYPE : c_int = 79;
3426 pub const EAUTH : c_int = 80;
3427 pub const ENEEDAUTH : c_int = 81;
3428 pub const EIDRM : c_int = 82;
3429 pub const ENOMSG : c_int = 83;
3430 pub const EOVERFLOW : c_int = 84;
3431 pub const ECANCELED : c_int = 85;
3432 pub const EILSEQ : c_int = 86;
3433 pub const ENOATTR : c_int = 87;
3434 pub const EDOOFUS : c_int = 88;
3435 pub const EBADMSG : c_int = 89;
3436 pub const EMULTIHOP : c_int = 90;
3437 pub const ENOLINK : c_int = 91;
3438 pub const EPROTO : c_int = 92;
3439 pub const ENOMEDIUM : c_int = 93;
3440 pub const EUNUSED94 : c_int = 94;
3441 pub const EUNUSED95 : c_int = 95;
3442 pub const EUNUSED96 : c_int = 96;
3443 pub const EUNUSED97 : c_int = 97;
3444 pub const EUNUSED98 : c_int = 98;
3445 pub const EASYNC : c_int = 99;
3446 pub const ELAST : c_int = 99;
3449 use types::os::arch::c95::{c_int, size_t};
3451 pub const F_DUPFD : c_int = 0;
3452 pub const F_GETFD : c_int = 1;
3453 pub const F_SETFD : c_int = 2;
3454 pub const F_GETFL : c_int = 3;
3455 pub const F_SETFL : c_int = 4;
3457 pub const SIGTRAP : c_int = 5;
3458 pub const SIGPIPE: c_int = 13;
3459 pub const SIG_IGN: size_t = 1;
3461 pub const GLOB_APPEND : c_int = 0x0001;
3462 pub const GLOB_DOOFFS : c_int = 0x0002;
3463 pub const GLOB_ERR : c_int = 0x0004;
3464 pub const GLOB_MARK : c_int = 0x0008;
3465 pub const GLOB_NOCHECK : c_int = 0x0010;
3466 pub const GLOB_NOSORT : c_int = 0x0020;
3467 pub const GLOB_NOESCAPE : c_int = 0x2000;
3469 pub const GLOB_NOSPACE : c_int = -1;
3470 pub const GLOB_ABORTED : c_int = -2;
3471 pub const GLOB_NOMATCH : c_int = -3;
3473 pub const POSIX_MADV_NORMAL : c_int = 0;
3474 pub const POSIX_MADV_RANDOM : c_int = 1;
3475 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
3476 pub const POSIX_MADV_WILLNEED : c_int = 3;
3477 pub const POSIX_MADV_DONTNEED : c_int = 4;
3479 pub const _SC_IOV_MAX : c_int = 56;
3480 pub const _SC_GETGR_R_SIZE_MAX : c_int = 70;
3481 pub const _SC_GETPW_R_SIZE_MAX : c_int = 71;
3482 pub const _SC_LOGIN_NAME_MAX : c_int = 73;
3483 pub const _SC_MQ_PRIO_MAX : c_int = 75;
3484 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 82;
3485 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
3486 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
3487 pub const _SC_THREAD_KEYS_MAX : c_int = 86;
3488 pub const _SC_THREAD_PRIO_INHERIT : c_int = 87;
3489 pub const _SC_THREAD_PRIO_PROTECT : c_int = 88;
3490 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
3491 pub const _SC_THREAD_PROCESS_SHARED : c_int = 90;
3492 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
3493 pub const _SC_THREAD_STACK_MIN : c_int = 93;
3494 pub const _SC_THREAD_THREADS_MAX : c_int = 94;
3495 pub const _SC_THREADS : c_int = 96;
3496 pub const _SC_TTY_NAME_MAX : c_int = 101;
3497 pub const _SC_ATEXIT_MAX : c_int = 107;
3498 pub const _SC_XOPEN_CRYPT : c_int = 108;
3499 pub const _SC_XOPEN_ENH_I18N : c_int = 109;
3500 pub const _SC_XOPEN_LEGACY : c_int = 110;
3501 pub const _SC_XOPEN_REALTIME : c_int = 111;
3502 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 112;
3503 pub const _SC_XOPEN_SHM : c_int = 113;
3504 pub const _SC_XOPEN_UNIX : c_int = 115;
3505 pub const _SC_XOPEN_VERSION : c_int = 116;
3506 pub const _SC_XOPEN_XCU_VERSION : c_int = 117;
3508 pub const PTHREAD_CREATE_JOINABLE: c_int = 0;
3509 pub const PTHREAD_CREATE_DETACHED: c_int = 1;
3511 #[cfg(target_arch = "arm")]
3512 pub const PTHREAD_STACK_MIN: size_t = 4096;
3514 #[cfg(all(target_os = "freebsd",
3515 any(target_arch = "mips",
3516 target_arch = "mipsel",
3517 target_arch = "x86",
3518 target_arch = "x86_64")))]
3519 pub const PTHREAD_STACK_MIN: size_t = 2048;
3521 #[cfg(target_os = "dragonfly")]
3522 pub const PTHREAD_STACK_MIN: size_t = 1024;
3524 pub const CLOCK_REALTIME: c_int = 0;
3525 pub const CLOCK_MONOTONIC: c_int = 4;
3530 use types::os::arch::c95::c_int;
3532 pub const MADV_NORMAL : c_int = 0;
3533 pub const MADV_RANDOM : c_int = 1;
3534 pub const MADV_SEQUENTIAL : c_int = 2;
3535 pub const MADV_WILLNEED : c_int = 3;
3536 pub const MADV_DONTNEED : c_int = 4;
3537 pub const MADV_FREE : c_int = 5;
3538 pub const MADV_NOSYNC : c_int = 6;
3539 pub const MADV_AUTOSYNC : c_int = 7;
3540 pub const MADV_NOCORE : c_int = 8;
3541 pub const MADV_CORE : c_int = 9;
3542 pub const MADV_PROTECT : c_int = 10;
3544 pub const MINCORE_INCORE : c_int = 0x1;
3545 pub const MINCORE_REFERENCED : c_int = 0x2;
3546 pub const MINCORE_MODIFIED : c_int = 0x4;
3547 pub const MINCORE_REFERENCED_OTHER : c_int = 0x8;
3548 pub const MINCORE_MODIFIED_OTHER : c_int = 0x10;
3549 pub const MINCORE_SUPER : c_int = 0x20;
3551 pub const AF_INET: c_int = 2;
3552 pub const AF_INET6: c_int = 28;
3553 pub const AF_UNIX: c_int = 1;
3554 pub const SOCK_STREAM: c_int = 1;
3555 pub const SOCK_DGRAM: c_int = 2;
3556 pub const SOCK_RAW: c_int = 3;
3557 pub const IPPROTO_TCP: c_int = 6;
3558 pub const IPPROTO_IP: c_int = 0;
3559 pub const IPPROTO_IPV6: c_int = 41;
3560 pub const IP_MULTICAST_TTL: c_int = 10;
3561 pub const IP_MULTICAST_LOOP: c_int = 11;
3562 pub const IP_TTL: c_int = 4;
3563 pub const IP_HDRINCL: c_int = 2;
3564 pub const IP_ADD_MEMBERSHIP: c_int = 12;
3565 pub const IP_DROP_MEMBERSHIP: c_int = 13;
3566 pub const IPV6_ADD_MEMBERSHIP: c_int = 12;
3567 pub const IPV6_DROP_MEMBERSHIP: c_int = 13;
3569 pub const TCP_NODELAY: c_int = 1;
3570 pub const TCP_KEEPIDLE: c_int = 256;
3571 pub const SOL_SOCKET: c_int = 0xffff;
3572 pub const SO_KEEPALIVE: c_int = 0x0008;
3573 pub const SO_BROADCAST: c_int = 0x0020;
3574 pub const SO_REUSEADDR: c_int = 0x0004;
3575 pub const SO_ERROR: c_int = 0x1007;
3577 pub const IFF_LOOPBACK: c_int = 0x8;
3579 pub const SHUT_RD: c_int = 0;
3580 pub const SHUT_WR: c_int = 1;
3581 pub const SHUT_RDWR: c_int = 2;
3584 use types::os::arch::c95::c_int;
3586 pub const O_SYNC : c_int = 128;
3587 pub const O_NONBLOCK : c_int = 4;
3588 pub const CTL_KERN: c_int = 1;
3589 pub const KERN_PROC: c_int = 14;
3590 #[cfg(target_os = "freebsd")]
3591 pub const KERN_PROC_PATHNAME: c_int = 12;
3592 #[cfg(target_os = "dragonfly")]
3593 pub const KERN_PROC_PATHNAME: c_int = 9;
3595 pub const MAP_COPY : c_int = 0x0002;
3596 pub const MAP_RENAME : c_int = 0x0020;
3597 pub const MAP_NORESERVE : c_int = 0x0040;
3598 pub const MAP_HASSEMAPHORE : c_int = 0x0200;
3599 pub const MAP_STACK : c_int = 0x0400;
3600 pub const MAP_NOSYNC : c_int = 0x0800;
3601 pub const MAP_NOCORE : c_int = 0x020000;
3603 pub const IPPROTO_RAW : c_int = 255;
3606 use types::os::arch::c95::c_int;
3608 pub const _SC_ARG_MAX : c_int = 1;
3609 pub const _SC_CHILD_MAX : c_int = 2;
3610 pub const _SC_CLK_TCK : c_int = 3;
3611 pub const _SC_NGROUPS_MAX : c_int = 4;
3612 pub const _SC_OPEN_MAX : c_int = 5;
3613 pub const _SC_JOB_CONTROL : c_int = 6;
3614 pub const _SC_SAVED_IDS : c_int = 7;
3615 pub const _SC_VERSION : c_int = 8;
3616 pub const _SC_BC_BASE_MAX : c_int = 9;
3617 pub const _SC_BC_DIM_MAX : c_int = 10;
3618 pub const _SC_BC_SCALE_MAX : c_int = 11;
3619 pub const _SC_BC_STRING_MAX : c_int = 12;
3620 pub const _SC_COLL_WEIGHTS_MAX : c_int = 13;
3621 pub const _SC_EXPR_NEST_MAX : c_int = 14;
3622 pub const _SC_LINE_MAX : c_int = 15;
3623 pub const _SC_RE_DUP_MAX : c_int = 16;
3624 pub const _SC_2_VERSION : c_int = 17;
3625 pub const _SC_2_C_BIND : c_int = 18;
3626 pub const _SC_2_C_DEV : c_int = 19;
3627 pub const _SC_2_CHAR_TERM : c_int = 20;
3628 pub const _SC_2_FORT_DEV : c_int = 21;
3629 pub const _SC_2_FORT_RUN : c_int = 22;
3630 pub const _SC_2_LOCALEDEF : c_int = 23;
3631 pub const _SC_2_SW_DEV : c_int = 24;
3632 pub const _SC_2_UPE : c_int = 25;
3633 pub const _SC_STREAM_MAX : c_int = 26;
3634 pub const _SC_TZNAME_MAX : c_int = 27;
3635 pub const _SC_ASYNCHRONOUS_IO : c_int = 28;
3636 pub const _SC_MAPPED_FILES : c_int = 29;
3637 pub const _SC_MEMLOCK : c_int = 30;
3638 pub const _SC_MEMLOCK_RANGE : c_int = 31;
3639 pub const _SC_MEMORY_PROTECTION : c_int = 32;
3640 pub const _SC_MESSAGE_PASSING : c_int = 33;
3641 pub const _SC_PRIORITIZED_IO : c_int = 34;
3642 pub const _SC_PRIORITY_SCHEDULING : c_int = 35;
3643 pub const _SC_REALTIME_SIGNALS : c_int = 36;
3644 pub const _SC_SEMAPHORES : c_int = 37;
3645 pub const _SC_FSYNC : c_int = 38;
3646 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
3647 pub const _SC_SYNCHRONIZED_IO : c_int = 40;
3648 pub const _SC_TIMERS : c_int = 41;
3649 pub const _SC_AIO_LISTIO_MAX : c_int = 42;
3650 pub const _SC_AIO_MAX : c_int = 43;
3651 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
3652 pub const _SC_DELAYTIMER_MAX : c_int = 45;
3653 pub const _SC_MQ_OPEN_MAX : c_int = 46;
3654 pub const _SC_PAGESIZE : c_int = 47;
3655 pub const _SC_RTSIG_MAX : c_int = 48;
3656 pub const _SC_SEM_NSEMS_MAX : c_int = 49;
3657 pub const _SC_SEM_VALUE_MAX : c_int = 50;
3658 pub const _SC_SIGQUEUE_MAX : c_int = 51;
3659 pub const _SC_TIMER_MAX : c_int = 52;
3663 #[cfg(any(target_os = "macos", target_os = "ios"))]
3666 use types::os::arch::c95::{c_int, c_uint};
3668 pub const EXIT_FAILURE : c_int = 1;
3669 pub const EXIT_SUCCESS : c_int = 0;
3670 pub const RAND_MAX : c_int = 2147483647;
3671 pub const EOF : c_int = -1;
3672 pub const SEEK_SET : c_int = 0;
3673 pub const SEEK_CUR : c_int = 1;
3674 pub const SEEK_END : c_int = 2;
3675 pub const _IOFBF : c_int = 0;
3676 pub const _IONBF : c_int = 2;
3677 pub const _IOLBF : c_int = 1;
3678 pub const BUFSIZ : c_uint = 1024_u32;
3679 pub const FOPEN_MAX : c_uint = 20_u32;
3680 pub const FILENAME_MAX : c_uint = 1024_u32;
3681 pub const L_tmpnam : c_uint = 1024_u32;
3682 pub const TMP_MAX : c_uint = 308915776_u32;
3687 use types::common::c95::c_void;
3688 use types::os::arch::c95::c_int;
3689 use types::os::arch::posix88::mode_t;
3691 pub const O_RDONLY : c_int = 0;
3692 pub const O_WRONLY : c_int = 1;
3693 pub const O_RDWR : c_int = 2;
3694 pub const O_APPEND : c_int = 8;
3695 pub const O_CREAT : c_int = 512;
3696 pub const O_EXCL : c_int = 2048;
3697 pub const O_TRUNC : c_int = 1024;
3698 pub const S_IFIFO : mode_t = 4096;
3699 pub const S_IFCHR : mode_t = 8192;
3700 pub const S_IFBLK : mode_t = 24576;
3701 pub const S_IFDIR : mode_t = 16384;
3702 pub const S_IFREG : mode_t = 32768;
3703 pub const S_IFLNK : mode_t = 40960;
3704 pub const S_IFMT : mode_t = 61440;
3705 pub const S_IEXEC : mode_t = 64;
3706 pub const S_IWRITE : mode_t = 128;
3707 pub const S_IREAD : mode_t = 256;
3708 pub const S_IRWXU : mode_t = 448;
3709 pub const S_IXUSR : mode_t = 64;
3710 pub const S_IWUSR : mode_t = 128;
3711 pub const S_IRUSR : mode_t = 256;
3712 pub const F_OK : c_int = 0;
3713 pub const R_OK : c_int = 4;
3714 pub const W_OK : c_int = 2;
3715 pub const X_OK : c_int = 1;
3716 pub const STDIN_FILENO : c_int = 0;
3717 pub const STDOUT_FILENO : c_int = 1;
3718 pub const STDERR_FILENO : c_int = 2;
3719 pub const F_LOCK : c_int = 1;
3720 pub const F_TEST : c_int = 3;
3721 pub const F_TLOCK : c_int = 2;
3722 pub const F_ULOCK : c_int = 0;
3723 pub const SIGHUP : c_int = 1;
3724 pub const SIGINT : c_int = 2;
3725 pub const SIGQUIT : c_int = 3;
3726 pub const SIGILL : c_int = 4;
3727 pub const SIGABRT : c_int = 6;
3728 pub const SIGFPE : c_int = 8;
3729 pub const SIGKILL : c_int = 9;
3730 pub const SIGSEGV : c_int = 11;
3731 pub const SIGPIPE : c_int = 13;
3732 pub const SIGALRM : c_int = 14;
3733 pub const SIGTERM : c_int = 15;
3735 pub const PROT_NONE : c_int = 0;
3736 pub const PROT_READ : c_int = 1;
3737 pub const PROT_WRITE : c_int = 2;
3738 pub const PROT_EXEC : c_int = 4;
3740 pub const MAP_FILE : c_int = 0x0000;
3741 pub const MAP_SHARED : c_int = 0x0001;
3742 pub const MAP_PRIVATE : c_int = 0x0002;
3743 pub const MAP_FIXED : c_int = 0x0010;
3744 pub const MAP_ANON : c_int = 0x1000;
3746 pub const MAP_FAILED : *mut c_void = -1 as *mut c_void;
3748 pub const MCL_CURRENT : c_int = 0x0001;
3749 pub const MCL_FUTURE : c_int = 0x0002;
3751 pub const MS_ASYNC : c_int = 0x0001;
3752 pub const MS_INVALIDATE : c_int = 0x0002;
3753 pub const MS_SYNC : c_int = 0x0010;
3755 pub const MS_KILLPAGES : c_int = 0x0004;
3756 pub const MS_DEACTIVATE : c_int = 0x0008;
3758 pub const EPERM : c_int = 1;
3759 pub const ENOENT : c_int = 2;
3760 pub const ESRCH : c_int = 3;
3761 pub const EINTR : c_int = 4;
3762 pub const EIO : c_int = 5;
3763 pub const ENXIO : c_int = 6;
3764 pub const E2BIG : c_int = 7;
3765 pub const ENOEXEC : c_int = 8;
3766 pub const EBADF : c_int = 9;
3767 pub const ECHILD : c_int = 10;
3768 pub const EDEADLK : c_int = 11;
3769 pub const ENOMEM : c_int = 12;
3770 pub const EACCES : c_int = 13;
3771 pub const EFAULT : c_int = 14;
3772 pub const ENOTBLK : c_int = 15;
3773 pub const EBUSY : c_int = 16;
3774 pub const EEXIST : c_int = 17;
3775 pub const EXDEV : c_int = 18;
3776 pub const ENODEV : c_int = 19;
3777 pub const ENOTDIR : c_int = 20;
3778 pub const EISDIR : c_int = 21;
3779 pub const EINVAL : c_int = 22;
3780 pub const ENFILE : c_int = 23;
3781 pub const EMFILE : c_int = 24;
3782 pub const ENOTTY : c_int = 25;
3783 pub const ETXTBSY : c_int = 26;
3784 pub const EFBIG : c_int = 27;
3785 pub const ENOSPC : c_int = 28;
3786 pub const ESPIPE : c_int = 29;
3787 pub const EROFS : c_int = 30;
3788 pub const EMLINK : c_int = 31;
3789 pub const EPIPE : c_int = 32;
3790 pub const EDOM : c_int = 33;
3791 pub const ERANGE : c_int = 34;
3792 pub const EAGAIN : c_int = 35;
3793 pub const EWOULDBLOCK : c_int = EAGAIN;
3794 pub const EINPROGRESS : c_int = 36;
3795 pub const EALREADY : c_int = 37;
3796 pub const ENOTSOCK : c_int = 38;
3797 pub const EDESTADDRREQ : c_int = 39;
3798 pub const EMSGSIZE : c_int = 40;
3799 pub const EPROTOTYPE : c_int = 41;
3800 pub const ENOPROTOOPT : c_int = 42;
3801 pub const EPROTONOSUPPORT : c_int = 43;
3802 pub const ESOCKTNOSUPPORT : c_int = 44;
3803 pub const ENOTSUP : c_int = 45;
3804 pub const EPFNOSUPPORT : c_int = 46;
3805 pub const EAFNOSUPPORT : c_int = 47;
3806 pub const EADDRINUSE : c_int = 48;
3807 pub const EADDRNOTAVAIL : c_int = 49;
3808 pub const ENETDOWN : c_int = 50;
3809 pub const ENETUNREACH : c_int = 51;
3810 pub const ENETRESET : c_int = 52;
3811 pub const ECONNABORTED : c_int = 53;
3812 pub const ECONNRESET : c_int = 54;
3813 pub const ENOBUFS : c_int = 55;
3814 pub const EISCONN : c_int = 56;
3815 pub const ENOTCONN : c_int = 57;
3816 pub const ESHUTDOWN : c_int = 58;
3817 pub const ETOOMANYREFS : c_int = 59;
3818 pub const ETIMEDOUT : c_int = 60;
3819 pub const ECONNREFUSED : c_int = 61;
3820 pub const ELOOP : c_int = 62;
3821 pub const ENAMETOOLONG : c_int = 63;
3822 pub const EHOSTDOWN : c_int = 64;
3823 pub const EHOSTUNREACH : c_int = 65;
3824 pub const ENOTEMPTY : c_int = 66;
3825 pub const EPROCLIM : c_int = 67;
3826 pub const EUSERS : c_int = 68;
3827 pub const EDQUOT : c_int = 69;
3828 pub const ESTALE : c_int = 70;
3829 pub const EREMOTE : c_int = 71;
3830 pub const EBADRPC : c_int = 72;
3831 pub const ERPCMISMATCH : c_int = 73;
3832 pub const EPROGUNAVAIL : c_int = 74;
3833 pub const EPROGMISMATCH : c_int = 75;
3834 pub const EPROCUNAVAIL : c_int = 76;
3835 pub const ENOLCK : c_int = 77;
3836 pub const ENOSYS : c_int = 78;
3837 pub const EFTYPE : c_int = 79;
3838 pub const EAUTH : c_int = 80;
3839 pub const ENEEDAUTH : c_int = 81;
3840 pub const EPWROFF : c_int = 82;
3841 pub const EDEVERR : c_int = 83;
3842 pub const EOVERFLOW : c_int = 84;
3843 pub const EBADEXEC : c_int = 85;
3844 pub const EBADARCH : c_int = 86;
3845 pub const ESHLIBVERS : c_int = 87;
3846 pub const EBADMACHO : c_int = 88;
3847 pub const ECANCELED : c_int = 89;
3848 pub const EIDRM : c_int = 90;
3849 pub const ENOMSG : c_int = 91;
3850 pub const EILSEQ : c_int = 92;
3851 pub const ENOATTR : c_int = 93;
3852 pub const EBADMSG : c_int = 94;
3853 pub const EMULTIHOP : c_int = 95;
3854 pub const ENODATA : c_int = 96;
3855 pub const ENOLINK : c_int = 97;
3856 pub const ENOSR : c_int = 98;
3857 pub const ENOSTR : c_int = 99;
3858 pub const EPROTO : c_int = 100;
3859 pub const ETIME : c_int = 101;
3860 pub const EOPNOTSUPP : c_int = 102;
3861 pub const ENOPOLICY : c_int = 103;
3862 pub const ENOTRECOVERABLE : c_int = 104;
3863 pub const EOWNERDEAD : c_int = 105;
3864 pub const EQFULL : c_int = 106;
3865 pub const ELAST : c_int = 106;
3868 use types::os::arch::c95::{c_int, size_t};
3870 pub const F_DUPFD : c_int = 0;
3871 pub const F_GETFD : c_int = 1;
3872 pub const F_SETFD : c_int = 2;
3873 pub const F_GETFL : c_int = 3;
3874 pub const F_SETFL : c_int = 4;
3876 pub const SIGTRAP : c_int = 5;
3877 pub const SIGPIPE: c_int = 13;
3878 pub const SIG_IGN: size_t = 1;
3880 pub const GLOB_APPEND : c_int = 0x0001;
3881 pub const GLOB_DOOFFS : c_int = 0x0002;
3882 pub const GLOB_ERR : c_int = 0x0004;
3883 pub const GLOB_MARK : c_int = 0x0008;
3884 pub const GLOB_NOCHECK : c_int = 0x0010;
3885 pub const GLOB_NOSORT : c_int = 0x0020;
3886 pub const GLOB_NOESCAPE : c_int = 0x2000;
3888 pub const GLOB_NOSPACE : c_int = -1;
3889 pub const GLOB_ABORTED : c_int = -2;
3890 pub const GLOB_NOMATCH : c_int = -3;
3892 pub const POSIX_MADV_NORMAL : c_int = 0;
3893 pub const POSIX_MADV_RANDOM : c_int = 1;
3894 pub const POSIX_MADV_SEQUENTIAL : c_int = 2;
3895 pub const POSIX_MADV_WILLNEED : c_int = 3;
3896 pub const POSIX_MADV_DONTNEED : c_int = 4;
3898 pub const _SC_IOV_MAX : c_int = 56;
3899 pub const _SC_GETGR_R_SIZE_MAX : c_int = 70;
3900 pub const _SC_GETPW_R_SIZE_MAX : c_int = 71;
3901 pub const _SC_LOGIN_NAME_MAX : c_int = 73;
3902 pub const _SC_MQ_PRIO_MAX : c_int = 75;
3903 pub const _SC_THREAD_ATTR_STACKADDR : c_int = 82;
3904 pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 83;
3905 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85;
3906 pub const _SC_THREAD_KEYS_MAX : c_int = 86;
3907 pub const _SC_THREAD_PRIO_INHERIT : c_int = 87;
3908 pub const _SC_THREAD_PRIO_PROTECT : c_int = 88;
3909 pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89;
3910 pub const _SC_THREAD_PROCESS_SHARED : c_int = 90;
3911 pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 91;
3912 pub const _SC_THREAD_STACK_MIN : c_int = 93;
3913 pub const _SC_THREAD_THREADS_MAX : c_int = 94;
3914 pub const _SC_THREADS : c_int = 96;
3915 pub const _SC_TTY_NAME_MAX : c_int = 101;
3916 pub const _SC_ATEXIT_MAX : c_int = 107;
3917 pub const _SC_XOPEN_CRYPT : c_int = 108;
3918 pub const _SC_XOPEN_ENH_I18N : c_int = 109;
3919 pub const _SC_XOPEN_LEGACY : c_int = 110;
3920 pub const _SC_XOPEN_REALTIME : c_int = 111;
3921 pub const _SC_XOPEN_REALTIME_THREADS : c_int = 112;
3922 pub const _SC_XOPEN_SHM : c_int = 113;
3923 pub const _SC_XOPEN_UNIX : c_int = 115;
3924 pub const _SC_XOPEN_VERSION : c_int = 116;
3925 pub const _SC_XOPEN_XCU_VERSION : c_int = 121;
3927 pub const PTHREAD_CREATE_JOINABLE: c_int = 1;
3928 pub const PTHREAD_CREATE_DETACHED: c_int = 2;
3929 pub const PTHREAD_STACK_MIN: size_t = 8192;
3934 use types::os::arch::c95::c_int;
3936 pub const MADV_NORMAL : c_int = 0;
3937 pub const MADV_RANDOM : c_int = 1;
3938 pub const MADV_SEQUENTIAL : c_int = 2;
3939 pub const MADV_WILLNEED : c_int = 3;
3940 pub const MADV_DONTNEED : c_int = 4;
3941 pub const MADV_FREE : c_int = 5;
3942 pub const MADV_ZERO_WIRED_PAGES : c_int = 6;
3943 pub const MADV_FREE_REUSABLE : c_int = 7;
3944 pub const MADV_FREE_REUSE : c_int = 8;
3945 pub const MADV_CAN_REUSE : c_int = 9;
3947 pub const MINCORE_INCORE : c_int = 0x1;
3948 pub const MINCORE_REFERENCED : c_int = 0x2;
3949 pub const MINCORE_MODIFIED : c_int = 0x4;
3950 pub const MINCORE_REFERENCED_OTHER : c_int = 0x8;
3951 pub const MINCORE_MODIFIED_OTHER : c_int = 0x10;
3953 pub const AF_UNIX: c_int = 1;
3954 pub const AF_INET: c_int = 2;
3955 pub const AF_INET6: c_int = 30;
3956 pub const SOCK_STREAM: c_int = 1;
3957 pub const SOCK_DGRAM: c_int = 2;
3958 pub const SOCK_RAW: c_int = 3;
3959 pub const IPPROTO_TCP: c_int = 6;
3960 pub const IPPROTO_IP: c_int = 0;
3961 pub const IPPROTO_IPV6: c_int = 41;
3962 pub const IP_MULTICAST_TTL: c_int = 10;
3963 pub const IP_MULTICAST_LOOP: c_int = 11;
3964 pub const IP_TTL: c_int = 4;
3965 pub const IP_HDRINCL: c_int = 2;
3966 pub const IP_ADD_MEMBERSHIP: c_int = 12;
3967 pub const IP_DROP_MEMBERSHIP: c_int = 13;
3968 pub const IPV6_ADD_MEMBERSHIP: c_int = 12;
3969 pub const IPV6_DROP_MEMBERSHIP: c_int = 13;
3971 pub const TCP_NODELAY: c_int = 0x01;
3972 pub const TCP_KEEPALIVE: c_int = 0x10;
3973 pub const SOL_SOCKET: c_int = 0xffff;
3974 pub const SO_KEEPALIVE: c_int = 0x0008;
3975 pub const SO_BROADCAST: c_int = 0x0020;
3976 pub const SO_REUSEADDR: c_int = 0x0004;
3977 pub const SO_ERROR: c_int = 0x1007;
3979 pub const IFF_LOOPBACK: c_int = 0x8;
3981 pub const SHUT_RD: c_int = 0;
3982 pub const SHUT_WR: c_int = 1;
3983 pub const SHUT_RDWR: c_int = 2;
3986 use types::os::arch::c95::c_int;
3988 pub const O_DSYNC : c_int = 4194304;
3989 pub const O_SYNC : c_int = 128;
3990 pub const O_NONBLOCK : c_int = 4;
3991 pub const F_FULLFSYNC : c_int = 51;
3993 pub const MAP_COPY : c_int = 0x0002;
3994 pub const MAP_RENAME : c_int = 0x0020;
3995 pub const MAP_NORESERVE : c_int = 0x0040;
3996 pub const MAP_NOEXTEND : c_int = 0x0100;
3997 pub const MAP_HASSEMAPHORE : c_int = 0x0200;
3998 pub const MAP_NOCACHE : c_int = 0x0400;
3999 pub const MAP_JIT : c_int = 0x0800;
4000 pub const MAP_STACK : c_int = 0;
4002 pub const IPPROTO_RAW : c_int = 255;
4005 use types::os::arch::c95::c_int;
4007 pub const _SC_ARG_MAX : c_int = 1;
4008 pub const _SC_CHILD_MAX : c_int = 2;
4009 pub const _SC_CLK_TCK : c_int = 3;
4010 pub const _SC_NGROUPS_MAX : c_int = 4;
4011 pub const _SC_OPEN_MAX : c_int = 5;
4012 pub const _SC_JOB_CONTROL : c_int = 6;
4013 pub const _SC_SAVED_IDS : c_int = 7;
4014 pub const _SC_VERSION : c_int = 8;
4015 pub const _SC_BC_BASE_MAX : c_int = 9;
4016 pub const _SC_BC_DIM_MAX : c_int = 10;
4017 pub const _SC_BC_SCALE_MAX : c_int = 11;
4018 pub const _SC_BC_STRING_MAX : c_int = 12;
4019 pub const _SC_COLL_WEIGHTS_MAX : c_int = 13;
4020 pub const _SC_EXPR_NEST_MAX : c_int = 14;
4021 pub const _SC_LINE_MAX : c_int = 15;
4022 pub const _SC_RE_DUP_MAX : c_int = 16;
4023 pub const _SC_2_VERSION : c_int = 17;
4024 pub const _SC_2_C_BIND : c_int = 18;
4025 pub const _SC_2_C_DEV : c_int = 19;
4026 pub const _SC_2_CHAR_TERM : c_int = 20;
4027 pub const _SC_2_FORT_DEV : c_int = 21;
4028 pub const _SC_2_FORT_RUN : c_int = 22;
4029 pub const _SC_2_LOCALEDEF : c_int = 23;
4030 pub const _SC_2_SW_DEV : c_int = 24;
4031 pub const _SC_2_UPE : c_int = 25;
4032 pub const _SC_STREAM_MAX : c_int = 26;
4033 pub const _SC_TZNAME_MAX : c_int = 27;
4034 pub const _SC_ASYNCHRONOUS_IO : c_int = 28;
4035 pub const _SC_PAGESIZE : c_int = 29;
4036 pub const _SC_MEMLOCK : c_int = 30;
4037 pub const _SC_MEMLOCK_RANGE : c_int = 31;
4038 pub const _SC_MEMORY_PROTECTION : c_int = 32;
4039 pub const _SC_MESSAGE_PASSING : c_int = 33;
4040 pub const _SC_PRIORITIZED_IO : c_int = 34;
4041 pub const _SC_PRIORITY_SCHEDULING : c_int = 35;
4042 pub const _SC_REALTIME_SIGNALS : c_int = 36;
4043 pub const _SC_SEMAPHORES : c_int = 37;
4044 pub const _SC_FSYNC : c_int = 38;
4045 pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 39;
4046 pub const _SC_SYNCHRONIZED_IO : c_int = 40;
4047 pub const _SC_TIMERS : c_int = 41;
4048 pub const _SC_AIO_LISTIO_MAX : c_int = 42;
4049 pub const _SC_AIO_MAX : c_int = 43;
4050 pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 44;
4051 pub const _SC_DELAYTIMER_MAX : c_int = 45;
4052 pub const _SC_MQ_OPEN_MAX : c_int = 46;
4053 pub const _SC_MAPPED_FILES : c_int = 47;
4054 pub const _SC_RTSIG_MAX : c_int = 48;
4055 pub const _SC_SEM_NSEMS_MAX : c_int = 49;
4056 pub const _SC_SEM_VALUE_MAX : c_int = 50;
4057 pub const _SC_SIGQUEUE_MAX : c_int = 51;
4058 pub const _SC_TIMER_MAX : c_int = 52;
4059 pub const _SC_XBS5_ILP32_OFF32 : c_int = 122;
4060 pub const _SC_XBS5_ILP32_OFFBIG : c_int = 123;
4061 pub const _SC_XBS5_LP64_OFF64 : c_int = 124;
4062 pub const _SC_XBS5_LPBIG_OFFBIG : c_int = 125;
4069 // Thankfully most of c95 is universally available and does not vary by OS
4070 // or anything. The same is not true of POSIX.
4074 use types::os::arch::c95::{c_char, c_int};
4077 pub fn isalnum(c: c_int) -> c_int;
4078 pub fn isalpha(c: c_int) -> c_int;
4079 pub fn iscntrl(c: c_int) -> c_int;
4080 pub fn isdigit(c: c_int) -> c_int;
4081 pub fn isgraph(c: c_int) -> c_int;
4082 pub fn islower(c: c_int) -> c_int;
4083 pub fn isprint(c: c_int) -> c_int;
4084 pub fn ispunct(c: c_int) -> c_int;
4085 pub fn isspace(c: c_int) -> c_int;
4086 pub fn isupper(c: c_int) -> c_int;
4087 pub fn isxdigit(c: c_int) -> c_int;
4088 pub fn tolower(c: c_char) -> c_char;
4089 pub fn toupper(c: c_char) -> c_char;
4094 use types::common::c95::{FILE, c_void, fpos_t};
4095 use types::os::arch::c95::{c_char, c_int, c_long, size_t};
4098 pub fn fopen(filename: *const c_char,
4099 mode: *const c_char) -> *mut FILE;
4100 pub fn freopen(filename: *const c_char, mode: *const c_char,
4103 pub fn fflush(file: *mut FILE) -> c_int;
4104 pub fn fclose(file: *mut FILE) -> c_int;
4105 pub fn remove(filename: *const c_char) -> c_int;
4106 pub fn rename(oldname: *const c_char,
4107 newname: *const c_char) -> c_int;
4108 pub fn tmpfile() -> *mut FILE;
4109 pub fn setvbuf(stream: *mut FILE,
4110 buffer: *mut c_char,
4114 pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
4115 // Omitted: printf and scanf variants.
4116 pub fn fgetc(stream: *mut FILE) -> c_int;
4117 pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE)
4119 pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
4120 pub fn fputs(s: *const c_char, stream: *mut FILE)-> c_int;
4121 // Omitted: getc, getchar (might be macros).
4123 // Omitted: gets, so ridiculously unsafe that it should not
4126 // Omitted: putc, putchar (might be macros).
4127 pub fn puts(s: *const c_char) -> c_int;
4128 pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
4129 pub fn fread(ptr: *mut c_void,
4134 pub fn fwrite(ptr: *const c_void,
4139 pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int)
4141 pub fn ftell(stream: *mut FILE) -> c_long;
4142 pub fn rewind(stream: *mut FILE);
4143 pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
4144 pub fn fsetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
4145 pub fn feof(stream: *mut FILE) -> c_int;
4146 pub fn ferror(stream: *mut FILE) -> c_int;
4147 pub fn perror(s: *const c_char);
4152 use types::common::c95::c_void;
4153 use types::os::arch::c95::{c_char, c_double, c_int};
4154 use types::os::arch::c95::{c_long, c_uint, c_ulong};
4155 use types::os::arch::c95::{size_t};
4158 pub fn abs(i: c_int) -> c_int;
4159 pub fn labs(i: c_long) -> c_long;
4160 // Omitted: div, ldiv (return pub type incomplete).
4161 pub fn atof(s: *const c_char) -> c_double;
4162 pub fn atoi(s: *const c_char) -> c_int;
4163 pub fn strtod(s: *const c_char,
4164 endp: *mut *mut c_char) -> c_double;
4165 pub fn strtol(s: *const c_char,
4166 endp: *mut *mut c_char, base: c_int) -> c_long;
4167 pub fn strtoul(s: *const c_char, endp: *mut *mut c_char,
4168 base: c_int) -> c_ulong;
4169 pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
4170 pub fn malloc(size: size_t) -> *mut c_void;
4171 pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
4172 pub fn free(p: *mut c_void);
4174 /// Exits the running program in a possibly dangerous manner.
4178 /// While this forces your program to exit, it does so in a way that has
4179 /// consequences. This will skip all unwinding code, which means that anything
4180 /// relying on unwinding for cleanup (such as flushing and closing a buffer to a
4181 /// file) may act in an unexpected way.
4186 /// extern crate libc;
4194 pub fn exit(status: c_int) -> !;
4195 pub fn _exit(status: c_int) -> !;
4196 pub fn atexit(cb: extern fn()) -> c_int;
4197 pub fn system(s: *const c_char) -> c_int;
4198 pub fn getenv(s: *const c_char) -> *mut c_char;
4199 // Omitted: bsearch, qsort
4200 pub fn rand() -> c_int;
4201 pub fn srand(seed: c_uint);
4206 use types::common::c95::c_void;
4207 use types::os::arch::c95::{c_char, c_int, size_t};
4208 use types::os::arch::c95::{wchar_t};
4211 pub fn strcpy(dst: *mut c_char,
4212 src: *const c_char) -> *mut c_char;
4213 pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t)
4215 pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
4216 pub fn strncat(s: *mut c_char, ct: *const c_char,
4217 n: size_t) -> *mut c_char;
4218 pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
4219 pub fn strncmp(cs: *const c_char, ct: *const c_char,
4220 n: size_t) -> c_int;
4221 pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
4222 pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
4223 pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
4224 pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
4225 pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
4226 pub fn strpbrk(cs: *const c_char,
4227 ct: *const c_char) -> *mut c_char;
4228 pub fn strstr(cs: *const c_char,
4229 ct: *const c_char) -> *mut c_char;
4230 pub fn strlen(cs: *const c_char) -> size_t;
4231 pub fn strerror(n: c_int) -> *mut c_char;
4232 pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
4233 pub fn strxfrm(s: *mut c_char, ct: *const c_char,
4234 n: size_t) -> size_t;
4235 pub fn wcslen(buf: *const wchar_t) -> size_t;
4237 // Omitted: memcpy, memmove, memset (provided by LLVM)
4239 // These are fine to execute on the Rust stack. They must be,
4240 // in fact, because LLVM generates calls to them!
4241 pub fn memcmp(cx: *const c_void, ct: *const c_void,
4242 n: size_t) -> c_int;
4243 pub fn memchr(cx: *const c_void, c: c_int,
4244 n: size_t) -> *mut c_void;
4249 // Microsoft helpfully underscore-qualifies all of its POSIX-like symbols
4250 // to make sure you don't use them accidentally. It also randomly deviates
4251 // from the exact signatures you might otherwise expect, and omits much,
4252 // so be careful when trying to write portable code; it won't always work
4253 // with the same POSIX functions and types as other platforms.
4255 #[cfg(target_os = "windows")]
4258 use types::os::common::posix01::{stat, utimbuf};
4259 use types::os::arch::c95::{c_int, c_char, wchar_t};
4262 #[link_name = "_chmod"]
4263 pub fn chmod(path: *const c_char, mode: c_int) -> c_int;
4264 #[link_name = "_wchmod"]
4265 pub fn wchmod(path: *const wchar_t, mode: c_int) -> c_int;
4266 #[link_name = "_mkdir"]
4267 pub fn mkdir(path: *const c_char) -> c_int;
4268 #[link_name = "_wrmdir"]
4269 pub fn wrmdir(path: *const wchar_t) -> c_int;
4270 #[link_name = "_fstat64"]
4271 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
4272 #[link_name = "_stat64"]
4273 pub fn stat(path: *const c_char, buf: *mut stat) -> c_int;
4274 #[link_name = "_wstat64"]
4275 pub fn wstat(path: *const wchar_t, buf: *mut stat) -> c_int;
4276 #[link_name = "_wutime64"]
4277 pub fn wutime(file: *const wchar_t, buf: *mut utimbuf) -> c_int;
4282 use types::common::c95::FILE;
4283 use types::os::arch::c95::{c_int, c_char};
4286 #[link_name = "_popen"]
4287 pub fn popen(command: *const c_char,
4288 mode: *const c_char) -> *mut FILE;
4289 #[link_name = "_pclose"]
4290 pub fn pclose(stream: *mut FILE) -> c_int;
4291 #[link_name = "_fdopen"]
4292 pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut FILE;
4293 #[link_name = "_fileno"]
4294 pub fn fileno(stream: *mut FILE) -> c_int;
4299 use types::os::arch::c95::{c_int, c_char, wchar_t};
4301 #[link_name = "_open"]
4302 pub fn open(path: *const c_char, oflag: c_int, mode: c_int)
4304 #[link_name = "_wopen"]
4305 pub fn wopen(path: *const wchar_t, oflag: c_int, mode: c_int)
4307 #[link_name = "_creat"]
4308 pub fn creat(path: *const c_char, mode: c_int) -> c_int;
4313 // Not supplied at all.
4317 use types::common::c95::c_void;
4318 use types::os::arch::c95::{c_int, c_uint, c_char,
4320 use types::os::arch::c99::intptr_t;
4323 #[link_name = "_access"]
4324 pub fn access(path: *const c_char, amode: c_int) -> c_int;
4325 #[link_name = "_chdir"]
4326 pub fn chdir(dir: *const c_char) -> c_int;
4327 #[link_name = "_close"]
4328 pub fn close(fd: c_int) -> c_int;
4329 #[link_name = "_dup"]
4330 pub fn dup(fd: c_int) -> c_int;
4331 #[link_name = "_dup2"]
4332 pub fn dup2(src: c_int, dst: c_int) -> c_int;
4333 #[link_name = "_execv"]
4334 pub fn execv(prog: *const c_char,
4335 argv: *mut *const c_char) -> intptr_t;
4336 #[link_name = "_execve"]
4337 pub fn execve(prog: *const c_char, argv: *mut *const c_char,
4338 envp: *mut *const c_char)
4340 #[link_name = "_execvp"]
4341 pub fn execvp(c: *const c_char,
4342 argv: *mut *const c_char) -> c_int;
4343 #[link_name = "_execvpe"]
4344 pub fn execvpe(c: *const c_char, argv: *mut *const c_char,
4345 envp: *mut *const c_char) -> c_int;
4346 #[link_name = "_getcwd"]
4347 pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char;
4348 #[link_name = "_getpid"]
4349 pub fn getpid() -> c_int;
4350 #[link_name = "_isatty"]
4351 pub fn isatty(fd: c_int) -> c_int;
4352 #[link_name = "_lseek"]
4353 pub fn lseek(fd: c_int, offset: c_long, origin: c_int)
4355 #[link_name = "_pipe"]
4356 pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int)
4358 #[link_name = "_read"]
4359 pub fn read(fd: c_int, buf: *mut c_void, count: c_uint)
4361 #[link_name = "_rmdir"]
4362 pub fn rmdir(path: *const c_char) -> c_int;
4363 #[link_name = "_unlink"]
4364 pub fn unlink(c: *const c_char) -> c_int;
4365 #[link_name = "_write"]
4366 pub fn write(fd: c_int, buf: *const c_void,
4367 count: c_uint) -> c_int;
4375 #[cfg(any(target_os = "linux",
4376 target_os = "android",
4377 target_os = "macos",
4379 target_os = "freebsd",
4380 target_os = "dragonfly"))]
4383 use types::os::arch::c95::{c_char, c_int};
4384 use types::os::arch::posix01::stat;
4385 use types::os::arch::posix88::mode_t;
4388 pub fn chmod(path: *const c_char, mode: mode_t) -> c_int;
4389 pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
4391 #[cfg(any(target_os = "linux",
4392 target_os = "freebsd",
4393 target_os = "dragonfly",
4394 target_os = "android",
4395 target_os = "ios"))]
4396 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
4398 #[cfg(target_os = "macos")]
4399 #[link_name = "fstat64"]
4400 pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
4402 pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int;
4403 pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int;
4405 #[cfg(any(target_os = "linux",
4406 target_os = "freebsd",
4407 target_os = "dragonfly",
4408 target_os = "android",
4409 target_os = "ios"))]
4410 pub fn stat(path: *const c_char, buf: *mut stat) -> c_int;
4412 #[cfg(target_os = "macos")]
4413 #[link_name = "stat64"]
4414 pub fn stat(path: *const c_char, buf: *mut stat) -> c_int;
4419 use types::common::c95::FILE;
4420 use types::os::arch::c95::{c_char, c_int};
4423 pub fn popen(command: *const c_char,
4424 mode: *const c_char) -> *mut FILE;
4425 pub fn pclose(stream: *mut FILE) -> c_int;
4426 pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut FILE;
4427 pub fn fileno(stream: *mut FILE) -> c_int;
4432 use types::os::arch::c95::{c_char, c_int};
4433 use types::os::arch::posix88::mode_t;
4436 pub fn open(path: *const c_char, oflag: c_int, mode: mode_t)
4438 pub fn creat(path: *const c_char, mode: mode_t) -> c_int;
4439 pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int;
4444 use types::common::posix88::{DIR, dirent_t};
4445 use types::os::arch::c95::{c_char, c_int, c_long};
4447 // NB: On OS X opendir and readdir have two versions,
4448 // one for 32-bit kernelspace and one for 64.
4449 // We should be linking to the 64-bit ones, called
4450 // opendir$INODE64, etc. but for some reason rustc
4451 // doesn't link it correctly on i686, so we're going
4452 // through a C function that mysteriously does work.
4455 #[link_name="rust_opendir"]
4456 pub fn opendir(dirname: *const c_char) -> *mut DIR;
4457 #[link_name="rust_readdir_r"]
4458 pub fn readdir_r(dirp: *mut DIR, entry: *mut dirent_t,
4459 result: *mut *mut dirent_t) -> c_int;
4463 pub fn closedir(dirp: *mut DIR) -> c_int;
4464 pub fn rewinddir(dirp: *mut DIR);
4465 pub fn seekdir(dirp: *mut DIR, loc: c_long);
4466 pub fn telldir(dirp: *mut DIR) -> c_long;
4471 use types::common::c95::c_void;
4472 use types::os::arch::c95::{c_char, c_int, c_long, c_uint};
4473 use types::os::arch::c95::{size_t};
4474 use types::os::common::posix01::timespec;
4475 use types::os::arch::posix01::utimbuf;
4476 use types::os::arch::posix88::{gid_t, off_t, pid_t};
4477 use types::os::arch::posix88::{ssize_t, uid_t};
4479 pub const _PC_NAME_MAX: c_int = 4;
4482 pub fn access(path: *const c_char, amode: c_int) -> c_int;
4483 pub fn alarm(seconds: c_uint) -> c_uint;
4484 pub fn chdir(dir: *const c_char) -> c_int;
4485 pub fn chown(path: *const c_char, uid: uid_t,
4486 gid: gid_t) -> c_int;
4487 pub fn close(fd: c_int) -> c_int;
4488 pub fn dup(fd: c_int) -> c_int;
4489 pub fn dup2(src: c_int, dst: c_int) -> c_int;
4490 pub fn execv(prog: *const c_char,
4491 argv: *mut *const c_char) -> c_int;
4492 pub fn execve(prog: *const c_char, argv: *mut *const c_char,
4493 envp: *mut *const c_char)
4495 pub fn execvp(c: *const c_char,
4496 argv: *mut *const c_char) -> c_int;
4497 pub fn fork() -> pid_t;
4498 pub fn fpathconf(filedes: c_int, name: c_int) -> c_long;
4499 pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char;
4500 pub fn getegid() -> gid_t;
4501 pub fn geteuid() -> uid_t;
4502 pub fn getgid() -> gid_t ;
4503 pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t)
4505 pub fn getlogin() -> *mut c_char;
4506 pub fn getopt(argc: c_int, argv: *mut *const c_char,
4507 optstr: *const c_char) -> c_int;
4508 pub fn getpgrp() -> pid_t;
4509 pub fn getpid() -> pid_t;
4510 pub fn getppid() -> pid_t;
4511 pub fn getuid() -> uid_t;
4512 pub fn getsid(pid: pid_t) -> pid_t;
4513 pub fn isatty(fd: c_int) -> c_int;
4514 pub fn link(src: *const c_char, dst: *const c_char) -> c_int;
4515 pub fn lseek(fd: c_int, offset: off_t, whence: c_int)
4517 pub fn pathconf(path: *mut c_char, name: c_int) -> c_long;
4518 pub fn pause() -> c_int;
4519 pub fn pipe(fds: *mut c_int) -> c_int;
4520 pub fn read(fd: c_int, buf: *mut c_void, count: size_t)
4522 pub fn rmdir(path: *const c_char) -> c_int;
4523 pub fn setgid(gid: gid_t) -> c_int;
4524 pub fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
4525 pub fn setsid() -> pid_t;
4526 pub fn setuid(uid: uid_t) -> c_int;
4527 pub fn sleep(secs: c_uint) -> c_uint;
4528 pub fn usleep(secs: c_uint) -> c_int;
4529 pub fn nanosleep(rqtp: *const timespec,
4530 rmtp: *mut timespec) -> c_int;
4531 pub fn sysconf(name: c_int) -> c_long;
4532 pub fn tcgetpgrp(fd: c_int) -> pid_t;
4533 pub fn ttyname(fd: c_int) -> *mut c_char;
4534 pub fn unlink(c: *const c_char) -> c_int;
4535 pub fn write(fd: c_int, buf: *const c_void, count: size_t)
4537 pub fn pread(fd: c_int, buf: *mut c_void, count: size_t,
4538 offset: off_t) -> ssize_t;
4539 pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t,
4540 offset: off_t) -> ssize_t;
4541 pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int;
4546 use types::os::arch::c95::{c_int};
4547 use types::os::arch::posix88::{pid_t};
4550 pub fn kill(pid: pid_t, sig: c_int) -> c_int;
4555 use types::common::c95::{c_void};
4556 use types::os::arch::c95::{size_t, c_int, c_char};
4557 use types::os::arch::posix88::{mode_t, off_t};
4560 pub fn mlock(addr: *const c_void, len: size_t) -> c_int;
4561 pub fn munlock(addr: *const c_void, len: size_t) -> c_int;
4562 pub fn mlockall(flags: c_int) -> c_int;
4563 pub fn munlockall() -> c_int;
4565 pub fn mmap(addr: *mut c_void,
4572 pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
4574 pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int)
4577 pub fn msync(addr: *mut c_void, len: size_t, flags: c_int)
4579 pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t)
4581 pub fn shm_unlink(name: *const c_char) -> c_int;
4586 use types::os::arch::c95::{c_char, c_uint};
4589 pub fn if_nametoindex(ifname: *const c_char) -> c_uint;
4595 #[cfg(any(target_os = "linux",
4596 target_os = "android",
4597 target_os = "macos",
4599 target_os = "freebsd",
4600 target_os = "dragonfly"))]
4603 use types::os::arch::c95::{c_char, c_int};
4604 use types::os::arch::posix01::stat;
4607 #[cfg(any(target_os = "linux",
4608 target_os = "freebsd",
4609 target_os = "dragonfly",
4610 target_os = "android",
4611 target_os = "ios"))]
4612 pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int;
4614 #[cfg(target_os = "macos")]
4615 #[link_name = "lstat64"]
4616 pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int;
4621 use types::os::arch::c95::{c_char, c_int, size_t};
4622 use types::os::arch::posix88::{ssize_t, off_t};
4625 pub fn readlink(path: *const c_char,
4630 pub fn fsync(fd: c_int) -> c_int;
4632 #[cfg(any(target_os = "linux", target_os = "android"))]
4633 pub fn fdatasync(fd: c_int) -> c_int;
4635 pub fn setenv(name: *const c_char, val: *const c_char,
4636 overwrite: c_int) -> c_int;
4637 pub fn unsetenv(name: *const c_char) -> c_int;
4638 pub fn putenv(string: *mut c_char) -> c_int;
4640 pub fn symlink(path1: *const c_char,
4641 path2: *const c_char) -> c_int;
4643 pub fn ftruncate(fd: c_int, length: off_t) -> c_int;
4648 use types::os::arch::c95::c_int;
4649 use types::os::common::posix01::sighandler_t;
4651 #[cfg(not(target_os = "android"))]
4653 pub fn signal(signum: c_int,
4654 handler: sighandler_t) -> sighandler_t;
4657 #[cfg(target_os = "android")]
4659 #[link_name = "bsd_signal"]
4660 pub fn signal(signum: c_int,
4661 handler: sighandler_t) -> sighandler_t;
4666 use types::os::arch::c95::{c_char, c_int};
4667 use types::os::common::posix01::{glob_t};
4670 pub fn glob(pattern: *const c_char,
4672 errfunc: ::core::option::Option<extern "C" fn(epath: *const c_char,
4673 errno: c_int) -> c_int>,
4674 pglob: *mut glob_t);
4675 pub fn globfree(pglob: *mut glob_t);
4680 use types::common::c95::{c_void};
4681 use types::os::arch::c95::{c_int, size_t};
4684 pub fn posix_madvise(addr: *mut c_void,
4692 #[cfg(target_os = "windows")]
4711 #[cfg(any(target_os = "windows",
4712 target_os = "linux",
4713 target_os = "android",
4714 target_os = "macos",
4716 target_os = "freebsd",
4717 target_os = "dragonfly"))]
4723 #[cfg(not(windows))]
4725 use types::common::c95::{c_void};
4726 use types::os::common::bsd44::{socklen_t, sockaddr, ifaddrs};
4727 use types::os::arch::c95::{c_int, size_t};
4728 use types::os::arch::posix88::ssize_t;
4731 pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> c_int;
4732 pub fn connect(socket: c_int, address: *const sockaddr,
4733 len: socklen_t) -> c_int;
4734 pub fn bind(socket: c_int, address: *const sockaddr,
4735 address_len: socklen_t) -> c_int;
4736 pub fn listen(socket: c_int, backlog: c_int) -> c_int;
4737 pub fn accept(socket: c_int, address: *mut sockaddr,
4738 address_len: *mut socklen_t) -> c_int;
4739 pub fn getpeername(socket: c_int, address: *mut sockaddr,
4740 address_len: *mut socklen_t) -> c_int;
4741 pub fn getsockname(socket: c_int, address: *mut sockaddr,
4742 address_len: *mut socklen_t) -> c_int;
4743 pub fn setsockopt(socket: c_int, level: c_int, name: c_int,
4744 value: *const c_void,
4745 option_len: socklen_t) -> c_int;
4746 pub fn recv(socket: c_int, buf: *mut c_void, len: size_t,
4747 flags: c_int) -> ssize_t;
4748 pub fn send(socket: c_int, buf: *const c_void, len: size_t,
4749 flags: c_int) -> ssize_t;
4750 pub fn recvfrom(socket: c_int, buf: *mut c_void, len: size_t,
4751 flags: c_int, addr: *mut sockaddr,
4752 addrlen: *mut socklen_t) -> ssize_t;
4753 pub fn sendto(socket: c_int, buf: *const c_void, len: size_t,
4754 flags: c_int, addr: *const sockaddr,
4755 addrlen: socklen_t) -> ssize_t;
4756 pub fn getifaddrs(ifap: *mut *mut ifaddrs) -> c_int;
4757 pub fn freeifaddrs(ifa: *mut ifaddrs);
4758 pub fn shutdown(socket: c_int, how: c_int) -> c_int;
4764 use types::common::c95::{c_void};
4765 use types::os::common::bsd44::{socklen_t, sockaddr, SOCKET};
4766 use types::os::arch::c95::c_int;
4767 use types::os::arch::posix88::ssize_t;
4770 pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> SOCKET;
4771 pub fn connect(socket: SOCKET, address: *const sockaddr,
4772 len: socklen_t) -> c_int;
4773 pub fn bind(socket: SOCKET, address: *const sockaddr,
4774 address_len: socklen_t) -> c_int;
4775 pub fn listen(socket: SOCKET, backlog: c_int) -> c_int;
4776 pub fn accept(socket: SOCKET, address: *mut sockaddr,
4777 address_len: *mut socklen_t) -> SOCKET;
4778 pub fn getpeername(socket: SOCKET, address: *mut sockaddr,
4779 address_len: *mut socklen_t) -> c_int;
4780 pub fn getsockname(socket: SOCKET, address: *mut sockaddr,
4781 address_len: *mut socklen_t) -> c_int;
4782 pub fn setsockopt(socket: SOCKET, level: c_int, name: c_int,
4783 value: *const c_void,
4784 option_len: socklen_t) -> c_int;
4785 pub fn closesocket(socket: SOCKET) -> c_int;
4786 pub fn recv(socket: SOCKET, buf: *mut c_void, len: c_int,
4787 flags: c_int) -> c_int;
4788 pub fn send(socket: SOCKET, buf: *const c_void, len: c_int,
4789 flags: c_int) -> c_int;
4790 pub fn recvfrom(socket: SOCKET, buf: *mut c_void, len: c_int,
4791 flags: c_int, addr: *mut sockaddr,
4792 addrlen: *mut c_int) -> ssize_t;
4793 pub fn sendto(socket: SOCKET, buf: *const c_void, len: c_int,
4794 flags: c_int, addr: *const sockaddr,
4795 addrlen: c_int) -> c_int;
4796 pub fn shutdown(socket: SOCKET, how: c_int) -> c_int;
4800 #[cfg(any(target_os = "macos",
4802 target_os = "freebsd",
4803 target_os = "dragonfly"))]
4805 use types::common::c95::{c_void};
4806 use types::os::arch::c95::{c_char, c_uchar, c_int, c_uint, c_ulong, size_t};
4809 pub fn ioctl(d: c_int, request: c_ulong, ...) -> c_int;
4810 pub fn sysctl(name: *mut c_int,
4813 oldlenp: *mut size_t,
4817 pub fn sysctlbyname(name: *const c_char,
4819 oldlenp: *mut size_t,
4823 pub fn sysctlnametomib(name: *const c_char,
4827 pub fn getdtablesize() -> c_int;
4828 pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int)
4830 pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
4836 #[cfg(any(target_os = "linux", target_os = "android"))]
4838 use types::common::c95::{c_void};
4839 use types::os::arch::c95::{c_uchar, c_int, size_t};
4842 pub fn getdtablesize() -> c_int;
4843 pub fn ioctl(d: c_int, request: c_int, ...) -> c_int;
4844 pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int)
4846 pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
4852 #[cfg(target_os = "windows")]
4856 #[cfg(any(target_os = "macos", target_os = "ios"))]
4858 use types::os::arch::c95::{c_char, c_int};
4861 pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32)
4866 #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
4870 #[cfg(any(target_os = "linux", target_os = "android"))]
4875 #[cfg(target_os = "windows")]
4879 use types::os::arch::c95::{c_uint};
4880 use types::os::arch::extra::{BOOL, DWORD, SIZE_T, HMODULE,
4882 LPWCH, LPDWORD, LPVOID,
4883 LPCVOID, LPOVERLAPPED,
4884 LPSECURITY_ATTRIBUTES,
4886 LPPROCESS_INFORMATION,
4887 LPMEMORY_BASIC_INFORMATION,
4888 LPSYSTEM_INFO, HANDLE, LPHANDLE,
4889 LARGE_INTEGER, PLARGE_INTEGER,
4890 LPFILETIME, LPWIN32_FIND_DATAW};
4893 pub fn GetEnvironmentVariableW(n: LPCWSTR,
4897 pub fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
4899 pub fn GetEnvironmentStringsW() -> LPWCH;
4900 pub fn FreeEnvironmentStringsW(env_ptr: LPWCH) -> BOOL;
4901 pub fn GetModuleFileNameW(hModule: HMODULE,
4905 pub fn CreateDirectoryW(lpPathName: LPCWSTR,
4906 lpSecurityAttributes:
4907 LPSECURITY_ATTRIBUTES)
4909 pub fn CopyFileW(lpExistingFileName: LPCWSTR,
4910 lpNewFileName: LPCWSTR,
4911 bFailIfExists: BOOL)
4913 pub fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
4914 pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
4915 pub fn GetCurrentDirectoryW(nBufferLength: DWORD,
4918 pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
4919 pub fn GetLastError() -> DWORD;
4920 pub fn FindFirstFileW(fileName: LPCWSTR, findFileData: LPWIN32_FIND_DATAW)
4922 pub fn FindNextFileW(findFile: HANDLE, findFileData: LPWIN32_FIND_DATAW)
4924 pub fn FindClose(findFile: HANDLE) -> BOOL;
4925 pub fn DuplicateHandle(hSourceProcessHandle: HANDLE,
4926 hSourceHandle: HANDLE,
4927 hTargetProcessHandle: HANDLE,
4928 lpTargetHandle: LPHANDLE,
4929 dwDesiredAccess: DWORD,
4930 bInheritHandle: BOOL,
4933 pub fn CloseHandle(hObject: HANDLE) -> BOOL;
4934 pub fn OpenProcess(dwDesiredAccess: DWORD,
4935 bInheritHandle: BOOL,
4938 pub fn GetCurrentProcess() -> HANDLE;
4939 pub fn CreateProcessW(lpApplicationName: LPCWSTR,
4940 lpCommandLine: LPWSTR,
4941 lpProcessAttributes:
4942 LPSECURITY_ATTRIBUTES,
4944 LPSECURITY_ATTRIBUTES,
4945 bInheritHandles: BOOL,
4946 dwCreationFlags: DWORD,
4947 lpEnvironment: LPVOID,
4948 lpCurrentDirectory: LPCWSTR,
4949 lpStartupInfo: LPSTARTUPINFO,
4950 lpProcessInformation:
4951 LPPROCESS_INFORMATION)
4953 pub fn WaitForSingleObject(hHandle: HANDLE,
4954 dwMilliseconds: DWORD)
4956 pub fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint)
4958 pub fn GetExitCodeProcess(hProcess: HANDLE,
4959 lpExitCode: LPDWORD)
4961 pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
4962 pub fn VirtualAlloc(lpAddress: LPVOID,
4964 flAllocationType: DWORD,
4967 pub fn VirtualFree(lpAddress: LPVOID,
4971 pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
4972 pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
4974 pub fn VirtualProtect(lpAddress: LPVOID,
4976 flNewProtect: DWORD,
4977 lpflOldProtect: LPDWORD)
4979 pub fn VirtualQuery(lpAddress: LPCVOID,
4980 lpBuffer: LPMEMORY_BASIC_INFORMATION,
4983 pub fn CreateFileMappingW(hFile: HANDLE,
4984 lpAttributes: LPSECURITY_ATTRIBUTES,
4986 dwMaximumSizeHigh: DWORD,
4987 dwMaximumSizeLow: DWORD,
4990 pub fn MapViewOfFile(hFileMappingObject: HANDLE,
4991 dwDesiredAccess: DWORD,
4992 dwFileOffsetHigh: DWORD,
4993 dwFileOffsetLow: DWORD,
4994 dwNumberOfBytesToMap: SIZE_T)
4996 pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
4997 pub fn MoveFileExW(lpExistingFileName: LPCWSTR,
4998 lpNewFileName: LPCWSTR,
4999 dwFlags: DWORD) -> BOOL;
5000 pub fn CreateHardLinkW(lpSymlinkFileName: LPCWSTR,
5001 lpTargetFileName: LPCWSTR,
5002 lpSecurityAttributes: LPSECURITY_ATTRIBUTES)
5004 pub fn FlushFileBuffers(hFile: HANDLE) -> BOOL;
5005 pub fn CreateFileW(lpFileName: LPCWSTR,
5006 dwDesiredAccess: DWORD,
5008 lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
5009 dwCreationDisposition: DWORD,
5010 dwFlagsAndAttributes: DWORD,
5011 hTemplateFile: HANDLE) -> HANDLE;
5012 pub fn ReadFile(hFile: HANDLE,
5014 nNumberOfBytesToRead: DWORD,
5015 lpNumberOfBytesRead: LPDWORD,
5016 lpOverlapped: LPOVERLAPPED) -> BOOL;
5017 pub fn WriteFile(hFile: HANDLE,
5019 nNumberOfBytesToRead: DWORD,
5020 lpNumberOfBytesRead: LPDWORD,
5021 lpOverlapped: LPOVERLAPPED) -> BOOL;
5022 pub fn SetFilePointerEx(hFile: HANDLE,
5023 liDistanceToMove: LARGE_INTEGER,
5024 lpNewFilePointer: PLARGE_INTEGER,
5025 dwMoveMethod: DWORD) -> BOOL;
5026 pub fn SetEndOfFile(hFile: HANDLE) -> BOOL;
5028 pub fn GetSystemTimeAsFileTime(
5029 lpSystemTimeAsFileTime: LPFILETIME);
5031 pub fn QueryPerformanceFrequency(
5032 lpFrequency: *mut LARGE_INTEGER) -> BOOL;
5033 pub fn QueryPerformanceCounter(
5034 lpPerformanceCount: *mut LARGE_INTEGER) -> BOOL;
5036 pub fn GetCurrentProcessId() -> DWORD;
5037 pub fn CreateNamedPipeW(
5041 nMaxInstances: DWORD,
5042 nOutBufferSize: DWORD,
5043 nInBufferSize: DWORD,
5044 nDefaultTimeOut: DWORD,
5045 lpSecurityAttributes: LPSECURITY_ATTRIBUTES
5047 pub fn ConnectNamedPipe(hNamedPipe: HANDLE,
5048 lpOverlapped: LPOVERLAPPED) -> BOOL;
5049 pub fn WaitNamedPipeW(lpNamedPipeName: LPCWSTR,
5050 nTimeOut: DWORD) -> BOOL;
5051 pub fn SetNamedPipeHandleState(hNamedPipe: HANDLE,
5053 lpMaxCollectionCount: LPDWORD,
5054 lpCollectDataTimeout: LPDWORD)
5056 pub fn CreateEventW(lpEventAttributes: LPSECURITY_ATTRIBUTES,
5058 bInitialState: BOOL,
5059 lpName: LPCWSTR) -> HANDLE;
5060 pub fn GetOverlappedResult(hFile: HANDLE,
5061 lpOverlapped: LPOVERLAPPED,
5062 lpNumberOfBytesTransferred: LPDWORD,
5063 bWait: BOOL) -> BOOL;
5064 pub fn DisconnectNamedPipe(hNamedPipe: HANDLE) -> BOOL;
5069 use types::os::arch::c95::{c_int, c_long};
5070 use types::os::arch::c99::intptr_t;
5073 #[link_name = "_commit"]
5074 pub fn commit(fd: c_int) -> c_int;
5076 #[link_name = "_get_osfhandle"]
5077 pub fn get_osfhandle(fd: c_int) -> c_long;
5079 #[link_name = "_open_osfhandle"]
5080 pub fn open_osfhandle(osfhandle: intptr_t,
5081 flags: c_int) -> c_int;
5086 use types::os::arch::c95::{c_int, c_long, c_ulong};
5087 use types::os::common::bsd44::SOCKET;
5090 pub fn ioctlsocket(s: SOCKET, cmd: c_long, argp: *mut c_ulong) -> c_int;
5097 pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly
5099 #[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows
5104 pub use core::marker;