Alex Crichton | 5d6cf05 | 2015-09-11 14:52:34 -0700 | [diff] [blame] | 1 | |
| 2 | #[cfg(target_os = "freebsd")] |
| 3 | pub mod os { |
| 4 | pub mod common { |
| 5 | pub mod posix01 { |
| 6 | use types::common::c95::{c_void}; |
| 7 | use types::os::arch::c95::{c_char, c_int, size_t, |
| 8 | time_t, suseconds_t, c_long}; |
| 9 | use types::os::arch::c99::{uintptr_t}; |
| 10 | |
| 11 | pub type pthread_t = uintptr_t; |
| 12 | pub type rlim_t = i64; |
| 13 | |
| 14 | #[repr(C)] |
| 15 | #[derive(Copy, Clone)] pub struct glob_t { |
| 16 | pub gl_pathc: size_t, |
| 17 | __unused1: size_t, |
| 18 | pub gl_offs: size_t, |
| 19 | __unused2: c_int, |
| 20 | pub gl_pathv: *mut *mut c_char, |
| 21 | |
| 22 | __unused3: *mut c_void, |
| 23 | |
| 24 | __unused4: *mut c_void, |
| 25 | __unused5: *mut c_void, |
| 26 | __unused6: *mut c_void, |
| 27 | __unused7: *mut c_void, |
| 28 | __unused8: *mut c_void, |
| 29 | } |
| 30 | |
| 31 | #[repr(C)] |
| 32 | #[derive(Copy, Clone)] pub struct timeval { |
| 33 | pub tv_sec: time_t, |
| 34 | pub tv_usec: suseconds_t, |
| 35 | } |
| 36 | |
| 37 | #[repr(C)] |
| 38 | #[derive(Copy, Clone)] pub struct timespec { |
| 39 | pub tv_sec: time_t, |
| 40 | pub tv_nsec: c_long, |
| 41 | } |
| 42 | |
| 43 | pub enum timezone {} |
| 44 | |
| 45 | pub type sighandler_t = size_t; |
| 46 | |
| 47 | #[repr(C)] |
| 48 | #[derive(Copy, Clone)] |
| 49 | pub struct rlimit { |
| 50 | pub rlim_cur: rlim_t, |
| 51 | pub rlim_max: rlim_t, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | pub mod bsd43 { |
| 56 | use types::os::common::posix01::timeval; |
| 57 | use types::os::arch::c95::c_long; |
| 58 | #[repr(C)] |
| 59 | #[derive(Copy, Clone)] |
| 60 | pub struct rusage { |
| 61 | pub ru_utime: timeval, |
| 62 | pub ru_stime: timeval, |
| 63 | pub ru_maxrss: c_long, |
| 64 | pub ru_ixrss: c_long, |
| 65 | pub ru_idrss: c_long, |
| 66 | pub ru_isrss: c_long, |
| 67 | pub ru_minflt: c_long, |
| 68 | pub ru_majflt: c_long, |
| 69 | pub ru_nswap: c_long, |
| 70 | pub ru_inblock: c_long, |
| 71 | pub ru_oublock: c_long, |
| 72 | pub ru_msgsnd: c_long, |
| 73 | pub ru_msgrcv: c_long, |
| 74 | pub ru_nsignals: c_long, |
| 75 | pub ru_nvcsw: c_long, |
| 76 | pub ru_nivcsw: c_long |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | pub mod bsd44 { |
| 81 | use types::common::c95::{c_void}; |
| 82 | use types::os::arch::c95::{c_char, c_int, c_uint}; |
| 83 | |
| 84 | pub type socklen_t = u32; |
| 85 | pub type sa_family_t = u8; |
| 86 | pub type in_port_t = u16; |
| 87 | pub type in_addr_t = u32; |
| 88 | #[repr(C)] |
| 89 | #[derive(Copy, Clone)] pub struct sockaddr { |
| 90 | pub sa_len: u8, |
| 91 | pub sa_family: sa_family_t, |
| 92 | pub sa_data: [u8; 14], |
| 93 | } |
| 94 | #[repr(C)] |
| 95 | #[derive(Copy)] pub struct sockaddr_storage { |
| 96 | pub ss_len: u8, |
| 97 | pub ss_family: sa_family_t, |
| 98 | __ss_pad1: [u8; 6], |
| 99 | __ss_align: i64, |
| 100 | __ss_pad2: [u8; 112], |
| 101 | } |
| 102 | impl Clone for sockaddr_storage { |
| 103 | fn clone(&self) -> sockaddr_storage { *self } |
| 104 | } |
| 105 | #[repr(C)] |
| 106 | #[derive(Copy, Clone)] pub struct sockaddr_in { |
| 107 | pub sin_len: u8, |
| 108 | pub sin_family: sa_family_t, |
| 109 | pub sin_port: in_port_t, |
| 110 | pub sin_addr: in_addr, |
| 111 | pub sin_zero: [u8; 8], |
| 112 | } |
| 113 | #[repr(C)] |
| 114 | #[derive(Copy, Clone)] pub struct in_addr { |
| 115 | pub s_addr: in_addr_t, |
| 116 | } |
| 117 | #[repr(C)] |
| 118 | #[derive(Copy, Clone)] pub struct sockaddr_in6 { |
| 119 | pub sin6_len: u8, |
| 120 | pub sin6_family: sa_family_t, |
| 121 | pub sin6_port: in_port_t, |
| 122 | pub sin6_flowinfo: u32, |
| 123 | pub sin6_addr: in6_addr, |
| 124 | pub sin6_scope_id: u32, |
| 125 | } |
| 126 | #[repr(C)] |
| 127 | #[derive(Copy, Clone)] pub struct in6_addr { |
| 128 | pub s6_addr: [u16; 8], |
| 129 | __align: [u32; 0], |
| 130 | } |
| 131 | #[repr(C)] |
| 132 | #[derive(Copy, Clone)] pub struct ip_mreq { |
| 133 | pub imr_multiaddr: in_addr, |
| 134 | pub imr_interface: in_addr, |
| 135 | } |
| 136 | #[repr(C)] |
| 137 | #[derive(Copy, Clone)] pub struct ipv6_mreq { |
| 138 | pub ipv6mr_multiaddr: in6_addr, |
| 139 | pub ipv6mr_interface: c_uint, |
| 140 | } |
| 141 | #[repr(C)] |
| 142 | #[derive(Copy, Clone)] pub struct addrinfo { |
| 143 | pub ai_flags: c_int, |
| 144 | pub ai_family: c_int, |
| 145 | pub ai_socktype: c_int, |
| 146 | pub ai_protocol: c_int, |
| 147 | pub ai_addrlen: socklen_t, |
| 148 | pub ai_canonname: *mut c_char, |
| 149 | pub ai_addr: *mut sockaddr, |
| 150 | pub ai_next: *mut addrinfo, |
| 151 | } |
| 152 | #[repr(C)] |
| 153 | #[derive(Copy)] pub struct sockaddr_un { |
| 154 | pub sun_len: u8, |
| 155 | pub sun_family: sa_family_t, |
| 156 | pub sun_path: [c_char; 104] |
| 157 | } |
| 158 | impl Clone for sockaddr_un { |
| 159 | fn clone(&self) -> sockaddr_un { *self } |
| 160 | } |
| 161 | #[repr(C)] |
| 162 | #[derive(Copy, Clone)] pub struct ifaddrs { |
| 163 | pub ifa_next: *mut ifaddrs, |
| 164 | pub ifa_name: *mut c_char, |
| 165 | pub ifa_flags: c_uint, |
| 166 | pub ifa_addr: *mut sockaddr, |
| 167 | pub ifa_netmask: *mut sockaddr, |
| 168 | pub ifa_dstaddr: *mut sockaddr, |
| 169 | pub ifa_data: *mut c_void |
| 170 | } |
| 171 | |
| 172 | |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | #[cfg(target_arch = "x86")] |
| 177 | pub mod arch { |
| 178 | pub mod c95 { |
| 179 | pub type c_char = i8; |
| 180 | pub type c_schar = i8; |
| 181 | pub type c_uchar = u8; |
| 182 | pub type c_short = i16; |
| 183 | pub type c_ushort = u16; |
| 184 | pub type c_int = i32; |
| 185 | pub type c_uint = u32; |
| 186 | pub type c_long = i32; |
| 187 | pub type c_ulong = u32; |
| 188 | pub type c_float = f32; |
| 189 | pub type c_double = f64; |
| 190 | pub type size_t = u32; |
| 191 | pub type ptrdiff_t = i32; |
| 192 | pub type clock_t = i32; |
| 193 | pub type time_t = i32; |
| 194 | pub type suseconds_t = i32; |
| 195 | pub type wchar_t = i32; |
| 196 | } |
| 197 | pub mod c99 { |
| 198 | pub type c_longlong = i64; |
| 199 | pub type c_ulonglong = u64; |
| 200 | pub type intptr_t = i32; |
| 201 | pub type uintptr_t = u32; |
| 202 | pub type intmax_t = i64; |
| 203 | pub type uintmax_t = u64; |
| 204 | } |
| 205 | pub mod posix88 { |
| 206 | pub type off_t = i64; |
| 207 | pub type dev_t = u32; |
| 208 | pub type ino_t = u32; |
| 209 | pub type pid_t = i32; |
| 210 | pub type uid_t = u32; |
| 211 | pub type gid_t = u32; |
| 212 | pub type useconds_t = u32; |
| 213 | pub type mode_t = u16; |
| 214 | pub type ssize_t = i32; |
| 215 | } |
| 216 | pub mod posix01 { |
| 217 | use types::common::c95::{c_void}; |
| 218 | use types::common::c99::{uint32_t, int32_t}; |
| 219 | use types::os::arch::c95::{c_long, time_t}; |
| 220 | use types::os::arch::posix88::{dev_t, gid_t, ino_t}; |
| 221 | use types::os::arch::posix88::{mode_t, off_t}; |
| 222 | use types::os::arch::posix88::{uid_t}; |
| 223 | |
| 224 | pub type nlink_t = u16; |
| 225 | pub type blksize_t = u32; |
| 226 | pub type blkcnt_t = i64; |
| 227 | pub type fflags_t = u32; |
| 228 | #[repr(C)] |
| 229 | #[derive(Copy, Clone)] pub struct stat { |
| 230 | pub st_dev: dev_t, |
| 231 | pub st_ino: ino_t, |
| 232 | pub st_mode: mode_t, |
| 233 | pub st_nlink: nlink_t, |
| 234 | pub st_uid: uid_t, |
| 235 | pub st_gid: gid_t, |
| 236 | pub st_rdev: dev_t, |
| 237 | pub st_atime: time_t, |
| 238 | pub st_atime_nsec: c_long, |
| 239 | pub st_mtime: time_t, |
| 240 | pub st_mtime_nsec: c_long, |
| 241 | pub st_ctime: time_t, |
| 242 | pub st_ctime_nsec: c_long, |
| 243 | pub st_size: off_t, |
| 244 | pub st_blocks: blkcnt_t, |
| 245 | pub st_blksize: blksize_t, |
| 246 | pub st_flags: fflags_t, |
| 247 | pub st_gen: uint32_t, |
| 248 | pub st_lspare: int32_t, |
| 249 | pub st_birthtime: time_t, |
| 250 | pub st_birthtime_nsec: c_long, |
| 251 | __unused: [u8; 8], |
| 252 | } |
| 253 | |
| 254 | #[repr(C)] |
| 255 | #[derive(Copy, Clone)] pub struct utimbuf { |
| 256 | pub actime: time_t, |
| 257 | pub modtime: time_t, |
| 258 | } |
| 259 | |
| 260 | pub type pthread_attr_t = *mut c_void; |
| 261 | } |
| 262 | pub mod posix08 { |
| 263 | } |
| 264 | pub mod bsd44 { |
| 265 | } |
| 266 | pub mod extra { |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | #[cfg(target_arch = "x86_64")] |
| 271 | pub mod arch { |
| 272 | pub mod c95 { |
| 273 | pub type c_char = i8; |
| 274 | pub type c_schar = i8; |
| 275 | pub type c_uchar = u8; |
| 276 | pub type c_short = i16; |
| 277 | pub type c_ushort = u16; |
| 278 | pub type c_int = i32; |
| 279 | pub type c_uint = u32; |
| 280 | pub type c_long = i64; |
| 281 | pub type c_ulong = u64; |
| 282 | pub type c_float = f32; |
| 283 | pub type c_double = f64; |
| 284 | pub type size_t = u64; |
| 285 | pub type ptrdiff_t = i64; |
| 286 | pub type clock_t = i32; |
| 287 | pub type time_t = i64; |
| 288 | pub type suseconds_t = i64; |
| 289 | pub type wchar_t = i32; |
| 290 | } |
| 291 | pub mod c99 { |
| 292 | pub type c_longlong = i64; |
| 293 | pub type c_ulonglong = u64; |
| 294 | pub type intptr_t = i64; |
| 295 | pub type uintptr_t = u64; |
| 296 | pub type intmax_t = i64; |
| 297 | pub type uintmax_t = u64; |
| 298 | } |
| 299 | pub mod posix88 { |
| 300 | pub type off_t = i64; |
| 301 | pub type dev_t = u32; |
| 302 | pub type ino_t = u32; |
| 303 | pub type pid_t = i32; |
| 304 | pub type uid_t = u32; |
| 305 | pub type gid_t = u32; |
| 306 | pub type useconds_t = u32; |
| 307 | pub type mode_t = u16; |
| 308 | pub type ssize_t = i64; |
| 309 | } |
| 310 | pub mod posix01 { |
| 311 | use types::common::c95::{c_void}; |
| 312 | use types::common::c99::{uint32_t, int32_t}; |
| 313 | use types::os::arch::c95::{c_long, time_t}; |
| 314 | use types::os::arch::posix88::{dev_t, gid_t, ino_t}; |
| 315 | use types::os::arch::posix88::{mode_t, off_t}; |
| 316 | use types::os::arch::posix88::{uid_t}; |
| 317 | |
| 318 | pub type nlink_t = u16; |
| 319 | pub type blksize_t = u32; |
| 320 | pub type blkcnt_t = i64; |
| 321 | pub type fflags_t = u32; |
| 322 | #[repr(C)] |
| 323 | #[derive(Copy, Clone)] pub struct stat { |
| 324 | pub st_dev: dev_t, |
| 325 | pub st_ino: ino_t, |
| 326 | pub st_mode: mode_t, |
| 327 | pub st_nlink: nlink_t, |
| 328 | pub st_uid: uid_t, |
| 329 | pub st_gid: gid_t, |
| 330 | pub st_rdev: dev_t, |
| 331 | pub st_atime: time_t, |
| 332 | pub st_atime_nsec: c_long, |
| 333 | pub st_mtime: time_t, |
| 334 | pub st_mtime_nsec: c_long, |
| 335 | pub st_ctime: time_t, |
| 336 | pub st_ctime_nsec: c_long, |
| 337 | pub st_size: off_t, |
| 338 | pub st_blocks: blkcnt_t, |
| 339 | pub st_blksize: blksize_t, |
| 340 | pub st_flags: fflags_t, |
| 341 | pub st_gen: uint32_t, |
| 342 | pub st_lspare: int32_t, |
| 343 | pub st_birthtime: time_t, |
| 344 | pub st_birthtime_nsec: c_long, |
| 345 | } |
| 346 | |
| 347 | #[repr(C)] |
| 348 | #[derive(Copy, Clone)] pub struct utimbuf { |
| 349 | pub actime: time_t, |
| 350 | pub modtime: time_t, |
| 351 | } |
| 352 | |
| 353 | pub type pthread_attr_t = *mut c_void; |
| 354 | } |
| 355 | pub mod posix08 { |
| 356 | } |
| 357 | pub mod bsd44 { |
| 358 | } |
| 359 | pub mod extra { |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | #[cfg(any(target_os = "freebsd", |
| 364 | target_os = "dragonfly"))] |
| 365 | pub mod os { |
| 366 | pub mod c95 { |
| 367 | use types::os::arch::c95::{c_int, c_uint}; |
| 368 | |
| 369 | pub const EXIT_FAILURE : c_int = 1; |
| 370 | pub const EXIT_SUCCESS : c_int = 0; |
| 371 | pub const RAND_MAX : c_int = 2147483647; |
| 372 | pub const EOF : c_int = -1; |
| 373 | pub const SEEK_SET : c_int = 0; |
| 374 | pub const SEEK_CUR : c_int = 1; |
| 375 | pub const SEEK_END : c_int = 2; |
| 376 | pub const _IOFBF : c_int = 0; |
| 377 | pub const _IONBF : c_int = 2; |
| 378 | pub const _IOLBF : c_int = 1; |
| 379 | pub const BUFSIZ : c_uint = 1024; |
| 380 | pub const FOPEN_MAX : c_uint = 20; |
| 381 | pub const FILENAME_MAX : c_uint = 1024; |
| 382 | pub const L_tmpnam : c_uint = 1024; |
| 383 | pub const TMP_MAX : c_uint = 308915776; |
| 384 | } |
| 385 | pub mod c99 { |
| 386 | } |
| 387 | pub mod posix88 { |
| 388 | use types::common::c95::c_void; |
| 389 | use types::os::arch::c95::c_int; |
| 390 | use types::os::arch::posix88::mode_t; |
| 391 | |
| 392 | pub const O_RDONLY : c_int = 0; |
| 393 | pub const O_WRONLY : c_int = 1; |
| 394 | pub const O_RDWR : c_int = 2; |
| 395 | pub const O_APPEND : c_int = 8; |
| 396 | pub const O_CREAT : c_int = 512; |
| 397 | pub const O_EXCL : c_int = 2048; |
| 398 | pub const O_NOCTTY : c_int = 32768; |
| 399 | pub const O_TRUNC : c_int = 1024; |
| 400 | pub const S_IFIFO : mode_t = 4096; |
| 401 | pub const S_IFCHR : mode_t = 8192; |
| 402 | pub const S_IFBLK : mode_t = 24576; |
| 403 | pub const S_IFDIR : mode_t = 16384; |
| 404 | pub const S_IFREG : mode_t = 32768; |
| 405 | pub const S_IFLNK : mode_t = 40960; |
| 406 | pub const S_IFSOCK : mode_t = 49152; |
| 407 | pub const S_IFMT : mode_t = 61440; |
| 408 | pub const S_IEXEC : mode_t = 64; |
| 409 | pub const S_IWRITE : mode_t = 128; |
| 410 | pub const S_IREAD : mode_t = 256; |
| 411 | pub const S_IRWXU : mode_t = 448; |
| 412 | pub const S_IXUSR : mode_t = 64; |
| 413 | pub const S_IWUSR : mode_t = 128; |
| 414 | pub const S_IRUSR : mode_t = 256; |
| 415 | pub const S_IRWXG : mode_t = 56; |
| 416 | pub const S_IXGRP : mode_t = 8; |
| 417 | pub const S_IWGRP : mode_t = 16; |
| 418 | pub const S_IRGRP : mode_t = 32; |
| 419 | pub const S_IRWXO : mode_t = 7; |
| 420 | pub const S_IXOTH : mode_t = 1; |
| 421 | pub const S_IWOTH : mode_t = 2; |
| 422 | pub const S_IROTH : mode_t = 4; |
| 423 | pub const F_OK : c_int = 0; |
| 424 | pub const R_OK : c_int = 4; |
| 425 | pub const W_OK : c_int = 2; |
| 426 | pub const X_OK : c_int = 1; |
| 427 | pub const STDIN_FILENO : c_int = 0; |
| 428 | pub const STDOUT_FILENO : c_int = 1; |
| 429 | pub const STDERR_FILENO : c_int = 2; |
| 430 | pub const F_LOCK : c_int = 1; |
| 431 | pub const F_TEST : c_int = 3; |
| 432 | pub const F_TLOCK : c_int = 2; |
| 433 | pub const F_ULOCK : c_int = 0; |
| 434 | pub const SIGHUP : c_int = 1; |
| 435 | pub const SIGINT : c_int = 2; |
| 436 | pub const SIGQUIT : c_int = 3; |
| 437 | pub const SIGILL : c_int = 4; |
| 438 | pub const SIGABRT : c_int = 6; |
| 439 | pub const SIGFPE : c_int = 8; |
| 440 | pub const SIGKILL : c_int = 9; |
| 441 | pub const SIGSEGV : c_int = 11; |
| 442 | pub const SIGPIPE : c_int = 13; |
| 443 | pub const SIGALRM : c_int = 14; |
| 444 | pub const SIGTERM : c_int = 15; |
| 445 | |
| 446 | pub const PROT_NONE : c_int = 0; |
| 447 | pub const PROT_READ : c_int = 1; |
| 448 | pub const PROT_WRITE : c_int = 2; |
| 449 | pub const PROT_EXEC : c_int = 4; |
| 450 | |
| 451 | pub const MAP_FILE : c_int = 0x0000; |
| 452 | pub const MAP_SHARED : c_int = 0x0001; |
| 453 | pub const MAP_PRIVATE : c_int = 0x0002; |
| 454 | pub const MAP_FIXED : c_int = 0x0010; |
| 455 | pub const MAP_ANON : c_int = 0x1000; |
| 456 | |
| 457 | pub const MAP_FAILED : *mut c_void = !0 as *mut c_void; |
| 458 | |
| 459 | pub const MCL_CURRENT : c_int = 0x0001; |
| 460 | pub const MCL_FUTURE : c_int = 0x0002; |
| 461 | |
| 462 | pub const MS_SYNC : c_int = 0x0000; |
| 463 | pub const MS_ASYNC : c_int = 0x0001; |
| 464 | pub const MS_INVALIDATE : c_int = 0x0002; |
| 465 | |
| 466 | pub const EPERM : c_int = 1; |
| 467 | pub const ENOENT : c_int = 2; |
| 468 | pub const ESRCH : c_int = 3; |
| 469 | pub const EINTR : c_int = 4; |
| 470 | pub const EIO : c_int = 5; |
| 471 | pub const ENXIO : c_int = 6; |
| 472 | pub const E2BIG : c_int = 7; |
| 473 | pub const ENOEXEC : c_int = 8; |
| 474 | pub const EBADF : c_int = 9; |
| 475 | pub const ECHILD : c_int = 10; |
| 476 | pub const EDEADLK : c_int = 11; |
| 477 | pub const ENOMEM : c_int = 12; |
| 478 | pub const EACCES : c_int = 13; |
| 479 | pub const EFAULT : c_int = 14; |
| 480 | pub const ENOTBLK : c_int = 15; |
| 481 | pub const EBUSY : c_int = 16; |
| 482 | pub const EEXIST : c_int = 17; |
| 483 | pub const EXDEV : c_int = 18; |
| 484 | pub const ENODEV : c_int = 19; |
| 485 | pub const ENOTDIR : c_int = 20; |
| 486 | pub const EISDIR : c_int = 21; |
| 487 | pub const EINVAL : c_int = 22; |
| 488 | pub const ENFILE : c_int = 23; |
| 489 | pub const EMFILE : c_int = 24; |
| 490 | pub const ENOTTY : c_int = 25; |
| 491 | pub const ETXTBSY : c_int = 26; |
| 492 | pub const EFBIG : c_int = 27; |
| 493 | pub const ENOSPC : c_int = 28; |
| 494 | pub const ESPIPE : c_int = 29; |
| 495 | pub const EROFS : c_int = 30; |
| 496 | pub const EMLINK : c_int = 31; |
| 497 | pub const EPIPE : c_int = 32; |
| 498 | pub const EDOM : c_int = 33; |
| 499 | pub const ERANGE : c_int = 34; |
| 500 | pub const EAGAIN : c_int = 35; |
| 501 | pub const EWOULDBLOCK : c_int = 35; |
| 502 | pub const EINPROGRESS : c_int = 36; |
| 503 | pub const EALREADY : c_int = 37; |
| 504 | pub const ENOTSOCK : c_int = 38; |
| 505 | pub const EDESTADDRREQ : c_int = 39; |
| 506 | pub const EMSGSIZE : c_int = 40; |
| 507 | pub const EPROTOTYPE : c_int = 41; |
| 508 | pub const ENOPROTOOPT : c_int = 42; |
| 509 | pub const EPROTONOSUPPORT : c_int = 43; |
| 510 | pub const ESOCKTNOSUPPORT : c_int = 44; |
| 511 | pub const EOPNOTSUPP : c_int = 45; |
| 512 | pub const EPFNOSUPPORT : c_int = 46; |
| 513 | pub const EAFNOSUPPORT : c_int = 47; |
| 514 | pub const EADDRINUSE : c_int = 48; |
| 515 | pub const EADDRNOTAVAIL : c_int = 49; |
| 516 | pub const ENETDOWN : c_int = 50; |
| 517 | pub const ENETUNREACH : c_int = 51; |
| 518 | pub const ENETRESET : c_int = 52; |
| 519 | pub const ECONNABORTED : c_int = 53; |
| 520 | pub const ECONNRESET : c_int = 54; |
| 521 | pub const ENOBUFS : c_int = 55; |
| 522 | pub const EISCONN : c_int = 56; |
| 523 | pub const ENOTCONN : c_int = 57; |
| 524 | pub const ESHUTDOWN : c_int = 58; |
| 525 | pub const ETOOMANYREFS : c_int = 59; |
| 526 | pub const ETIMEDOUT : c_int = 60; |
| 527 | pub const ECONNREFUSED : c_int = 61; |
| 528 | pub const ELOOP : c_int = 62; |
| 529 | pub const ENAMETOOLONG : c_int = 63; |
| 530 | pub const EHOSTDOWN : c_int = 64; |
| 531 | pub const EHOSTUNREACH : c_int = 65; |
| 532 | pub const ENOTEMPTY : c_int = 66; |
| 533 | pub const EPROCLIM : c_int = 67; |
| 534 | pub const EUSERS : c_int = 68; |
| 535 | pub const EDQUOT : c_int = 69; |
| 536 | pub const ESTALE : c_int = 70; |
| 537 | pub const EREMOTE : c_int = 71; |
| 538 | pub const EBADRPC : c_int = 72; |
| 539 | pub const ERPCMISMATCH : c_int = 73; |
| 540 | pub const EPROGUNAVAIL : c_int = 74; |
| 541 | pub const EPROGMISMATCH : c_int = 75; |
| 542 | pub const EPROCUNAVAIL : c_int = 76; |
| 543 | pub const ENOLCK : c_int = 77; |
| 544 | pub const ENOSYS : c_int = 78; |
| 545 | pub const EFTYPE : c_int = 79; |
| 546 | pub const EAUTH : c_int = 80; |
| 547 | pub const ENEEDAUTH : c_int = 81; |
| 548 | pub const EIDRM : c_int = 82; |
| 549 | pub const ENOMSG : c_int = 83; |
| 550 | pub const EOVERFLOW : c_int = 84; |
| 551 | pub const ECANCELED : c_int = 85; |
| 552 | pub const EILSEQ : c_int = 86; |
| 553 | pub const ENOATTR : c_int = 87; |
| 554 | pub const EDOOFUS : c_int = 88; |
| 555 | pub const EBADMSG : c_int = 89; |
| 556 | pub const EMULTIHOP : c_int = 90; |
| 557 | pub const ENOLINK : c_int = 91; |
| 558 | pub const EPROTO : c_int = 92; |
| 559 | pub const ENOMEDIUM : c_int = 93; |
| 560 | pub const EUNUSED94 : c_int = 94; |
| 561 | pub const EUNUSED95 : c_int = 95; |
| 562 | pub const EUNUSED96 : c_int = 96; |
| 563 | pub const EUNUSED97 : c_int = 97; |
| 564 | pub const EUNUSED98 : c_int = 98; |
| 565 | pub const EASYNC : c_int = 99; |
| 566 | pub const ELAST : c_int = 99; |
| 567 | } |
| 568 | pub mod posix01 { |
| 569 | use types::os::arch::c95::{c_int, size_t}; |
| 570 | use types::os::common::posix01::rlim_t; |
| 571 | |
| 572 | pub const F_DUPFD : c_int = 0; |
| 573 | pub const F_GETFD : c_int = 1; |
| 574 | pub const F_SETFD : c_int = 2; |
| 575 | pub const F_GETFL : c_int = 3; |
| 576 | pub const F_SETFL : c_int = 4; |
| 577 | |
| 578 | pub const SIGTRAP : c_int = 5; |
| 579 | pub const SIG_IGN: size_t = 1; |
| 580 | |
| 581 | pub const GLOB_APPEND : c_int = 0x0001; |
| 582 | pub const GLOB_DOOFFS : c_int = 0x0002; |
| 583 | pub const GLOB_ERR : c_int = 0x0004; |
| 584 | pub const GLOB_MARK : c_int = 0x0008; |
| 585 | pub const GLOB_NOCHECK : c_int = 0x0010; |
| 586 | pub const GLOB_NOSORT : c_int = 0x0020; |
| 587 | pub const GLOB_NOESCAPE : c_int = 0x2000; |
| 588 | |
| 589 | pub const GLOB_NOSPACE : c_int = -1; |
| 590 | pub const GLOB_ABORTED : c_int = -2; |
| 591 | pub const GLOB_NOMATCH : c_int = -3; |
| 592 | |
| 593 | pub const POSIX_MADV_NORMAL : c_int = 0; |
| 594 | pub const POSIX_MADV_RANDOM : c_int = 1; |
| 595 | pub const POSIX_MADV_SEQUENTIAL : c_int = 2; |
| 596 | pub const POSIX_MADV_WILLNEED : c_int = 3; |
| 597 | pub const POSIX_MADV_DONTNEED : c_int = 4; |
| 598 | |
| 599 | pub const _SC_IOV_MAX : c_int = 56; |
| 600 | pub const _SC_GETGR_R_SIZE_MAX : c_int = 70; |
| 601 | pub const _SC_GETPW_R_SIZE_MAX : c_int = 71; |
| 602 | pub const _SC_LOGIN_NAME_MAX : c_int = 73; |
| 603 | pub const _SC_MQ_PRIO_MAX : c_int = 75; |
| 604 | pub const _SC_THREAD_ATTR_STACKADDR : c_int = 82; |
| 605 | pub const _SC_THREAD_ATTR_STACKSIZE : c_int = 83; |
| 606 | pub const _SC_THREAD_DESTRUCTOR_ITERATIONS : c_int = 85; |
| 607 | pub const _SC_THREAD_KEYS_MAX : c_int = 86; |
| 608 | pub const _SC_THREAD_PRIO_INHERIT : c_int = 87; |
| 609 | pub const _SC_THREAD_PRIO_PROTECT : c_int = 88; |
| 610 | pub const _SC_THREAD_PRIORITY_SCHEDULING : c_int = 89; |
| 611 | pub const _SC_THREAD_PROCESS_SHARED : c_int = 90; |
| 612 | pub const _SC_THREAD_SAFE_FUNCTIONS : c_int = 91; |
| 613 | pub const _SC_THREAD_STACK_MIN : c_int = 93; |
| 614 | pub const _SC_THREAD_THREADS_MAX : c_int = 94; |
| 615 | pub const _SC_THREADS : c_int = 96; |
| 616 | pub const _SC_TTY_NAME_MAX : c_int = 101; |
| 617 | pub const _SC_ATEXIT_MAX : c_int = 107; |
| 618 | pub const _SC_XOPEN_CRYPT : c_int = 108; |
| 619 | pub const _SC_XOPEN_ENH_I18N : c_int = 109; |
| 620 | pub const _SC_XOPEN_LEGACY : c_int = 110; |
| 621 | pub const _SC_XOPEN_REALTIME : c_int = 111; |
| 622 | pub const _SC_XOPEN_REALTIME_THREADS : c_int = 112; |
| 623 | pub const _SC_XOPEN_SHM : c_int = 113; |
| 624 | pub const _SC_XOPEN_UNIX : c_int = 115; |
| 625 | pub const _SC_XOPEN_VERSION : c_int = 116; |
| 626 | pub const _SC_XOPEN_XCU_VERSION : c_int = 117; |
| 627 | |
| 628 | pub const PTHREAD_CREATE_JOINABLE: c_int = 0; |
| 629 | pub const PTHREAD_CREATE_DETACHED: c_int = 1; |
| 630 | |
| 631 | #[cfg(target_arch = "arm")] |
| 632 | pub const PTHREAD_STACK_MIN: size_t = 4096; |
| 633 | |
| 634 | #[cfg(all(target_os = "freebsd", |
| 635 | any(target_arch = "mips", |
| 636 | target_arch = "mipsel", |
| 637 | target_arch = "x86", |
| 638 | target_arch = "x86_64")))] |
| 639 | pub const PTHREAD_STACK_MIN: size_t = 2048; |
| 640 | |
| 641 | #[cfg(target_os = "dragonfly")] |
| 642 | pub const PTHREAD_STACK_MIN: size_t = 1024; |
| 643 | |
| 644 | pub const CLOCK_REALTIME: c_int = 0; |
| 645 | pub const CLOCK_MONOTONIC: c_int = 4; |
| 646 | |
| 647 | pub const RLIMIT_CPU: c_int = 0; |
| 648 | pub const RLIMIT_FSIZE: c_int = 1; |
| 649 | pub const RLIMIT_DATA: c_int = 2; |
| 650 | pub const RLIMIT_STACK: c_int = 3; |
| 651 | pub const RLIMIT_CORE: c_int = 4; |
| 652 | pub const RLIMIT_RSS: c_int = 5; |
| 653 | pub const RLIMIT_MEMLOCK: c_int = 6; |
| 654 | pub const RLIMIT_NPROC: c_int = 7; |
| 655 | pub const RLIMIT_NOFILE: c_int = 8; |
| 656 | pub const RLIMIT_SBSIZE: c_int = 9; |
| 657 | pub const RLIMIT_VMEM: c_int = 10; |
| 658 | pub const RLIMIT_AS: c_int = RLIMIT_VMEM; |
| 659 | pub const RLIMIT_NPTS: c_int = 11; |
| 660 | pub const RLIMIT_SWAP: c_int = 12; |
| 661 | pub const RLIMIT_KQUEUES: c_int = 13; |
| 662 | |
| 663 | pub const RLIM_NLIMITS: rlim_t = 14; |
| 664 | pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; |
| 665 | |
| 666 | pub const RUSAGE_SELF: c_int = 0; |
| 667 | pub const RUSAGE_CHILDREN: c_int = -1; |
| 668 | pub const RUSAGE_THREAD: c_int = 1; |
| 669 | } |
| 670 | pub mod posix08 { |
| 671 | } |
| 672 | pub mod bsd44 { |
| 673 | use types::os::arch::c95::c_int; |
| 674 | |
| 675 | pub const MADV_NORMAL : c_int = 0; |
| 676 | pub const MADV_RANDOM : c_int = 1; |
| 677 | pub const MADV_SEQUENTIAL : c_int = 2; |
| 678 | pub const MADV_WILLNEED : c_int = 3; |
| 679 | pub const MADV_DONTNEED : c_int = 4; |
| 680 | pub const MADV_FREE : c_int = 5; |
| 681 | pub const MADV_NOSYNC : c_int = 6; |
| 682 | pub const MADV_AUTOSYNC : c_int = 7; |
| 683 | pub const MADV_NOCORE : c_int = 8; |
| 684 | pub const MADV_CORE : c_int = 9; |
| 685 | pub const MADV_PROTECT : c_int = 10; |
| 686 | |
| 687 | pub const MINCORE_INCORE : c_int = 0x1; |
| 688 | pub const MINCORE_REFERENCED : c_int = 0x2; |
| 689 | pub const MINCORE_MODIFIED : c_int = 0x4; |
| 690 | pub const MINCORE_REFERENCED_OTHER : c_int = 0x8; |
| 691 | pub const MINCORE_MODIFIED_OTHER : c_int = 0x10; |
| 692 | pub const MINCORE_SUPER : c_int = 0x20; |
| 693 | |
| 694 | pub const AF_INET: c_int = 2; |
| 695 | pub const AF_INET6: c_int = 28; |
| 696 | pub const AF_UNIX: c_int = 1; |
| 697 | pub const SOCK_STREAM: c_int = 1; |
| 698 | pub const SOCK_DGRAM: c_int = 2; |
| 699 | pub const SOCK_RAW: c_int = 3; |
| 700 | pub const IPPROTO_TCP: c_int = 6; |
| 701 | pub const IPPROTO_IP: c_int = 0; |
| 702 | pub const IPPROTO_IPV6: c_int = 41; |
| 703 | pub const IP_MULTICAST_TTL: c_int = 10; |
| 704 | pub const IP_MULTICAST_LOOP: c_int = 11; |
| 705 | pub const IP_TTL: c_int = 4; |
| 706 | pub const IP_HDRINCL: c_int = 2; |
| 707 | pub const IP_ADD_MEMBERSHIP: c_int = 12; |
| 708 | pub const IP_DROP_MEMBERSHIP: c_int = 13; |
| 709 | pub const IPV6_ADD_MEMBERSHIP: c_int = 12; |
| 710 | pub const IPV6_DROP_MEMBERSHIP: c_int = 13; |
| 711 | |
| 712 | pub const TCP_NODELAY: c_int = 1; |
| 713 | pub const TCP_KEEPIDLE: c_int = 256; |
| 714 | pub const SOL_SOCKET: c_int = 0xffff; |
| 715 | pub const SO_DEBUG: c_int = 0x01; |
| 716 | pub const SO_ACCEPTCONN: c_int = 0x0002; |
| 717 | pub const SO_REUSEADDR: c_int = 0x0004; |
| 718 | pub const SO_KEEPALIVE: c_int = 0x0008; |
| 719 | pub const SO_DONTROUTE: c_int = 0x0010; |
| 720 | pub const SO_BROADCAST: c_int = 0x0020; |
| 721 | pub const SO_USELOOPBACK: c_int = 0x0040; |
| 722 | pub const SO_LINGER: c_int = 0x0080; |
| 723 | pub const SO_OOBINLINE: c_int = 0x0100; |
| 724 | pub const SO_REUSEPORT: c_int = 0x0200; |
| 725 | pub const SO_SNDBUF: c_int = 0x1001; |
| 726 | pub const SO_RCVBUF: c_int = 0x1002; |
| 727 | pub const SO_SNDLOWAT: c_int = 0x1003; |
| 728 | pub const SO_RCVLOWAT: c_int = 0x1004; |
| 729 | pub const SO_SNDTIMEO: c_int = 0x1005; |
| 730 | pub const SO_RCVTIMEO: c_int = 0x1006; |
| 731 | pub const SO_ERROR: c_int = 0x1007; |
| 732 | pub const SO_TYPE: c_int = 0x1008; |
| 733 | |
| 734 | pub const IFF_LOOPBACK: c_int = 0x8; |
| 735 | |
| 736 | pub const SHUT_RD: c_int = 0; |
| 737 | pub const SHUT_WR: c_int = 1; |
| 738 | pub const SHUT_RDWR: c_int = 2; |
| 739 | |
| 740 | pub const LOCK_SH: c_int = 1; |
| 741 | pub const LOCK_EX: c_int = 2; |
| 742 | pub const LOCK_NB: c_int = 4; |
| 743 | pub const LOCK_UN: c_int = 8; |
| 744 | } |
| 745 | pub mod extra { |
| 746 | use types::os::arch::c95::c_int; |
| 747 | |
| 748 | pub const O_SYNC : c_int = 128; |
| 749 | pub const O_NONBLOCK : c_int = 4; |
| 750 | pub const CTL_KERN: c_int = 1; |
| 751 | pub const KERN_PROC: c_int = 14; |
| 752 | #[cfg(target_os = "freebsd")] |
| 753 | pub const KERN_PROC_PATHNAME: c_int = 12; |
| 754 | #[cfg(target_os = "dragonfly")] |
| 755 | pub const KERN_PROC_PATHNAME: c_int = 9; |
| 756 | |
| 757 | pub const MAP_COPY : c_int = 0x0002; |
| 758 | pub const MAP_RENAME : c_int = 0x0020; |
| 759 | pub const MAP_NORESERVE : c_int = 0x0040; |
| 760 | pub const MAP_HASSEMAPHORE : c_int = 0x0200; |
| 761 | pub const MAP_STACK : c_int = 0x0400; |
| 762 | pub const MAP_NOSYNC : c_int = 0x0800; |
| 763 | pub const MAP_NOCORE : c_int = 0x020000; |
| 764 | |
| 765 | pub const IPPROTO_RAW : c_int = 255; |
| 766 | } |
| 767 | pub mod sysconf { |
| 768 | use types::os::arch::c95::c_int; |
| 769 | |
| 770 | pub const _SC_ARG_MAX : c_int = 1; |
| 771 | pub const _SC_CHILD_MAX : c_int = 2; |
| 772 | pub const _SC_CLK_TCK : c_int = 3; |
| 773 | pub const _SC_NGROUPS_MAX : c_int = 4; |
| 774 | pub const _SC_OPEN_MAX : c_int = 5; |
| 775 | pub const _SC_JOB_CONTROL : c_int = 6; |
| 776 | pub const _SC_SAVED_IDS : c_int = 7; |
| 777 | pub const _SC_VERSION : c_int = 8; |
| 778 | pub const _SC_BC_BASE_MAX : c_int = 9; |
| 779 | pub const _SC_BC_DIM_MAX : c_int = 10; |
| 780 | pub const _SC_BC_SCALE_MAX : c_int = 11; |
| 781 | pub const _SC_BC_STRING_MAX : c_int = 12; |
| 782 | pub const _SC_COLL_WEIGHTS_MAX : c_int = 13; |
| 783 | pub const _SC_EXPR_NEST_MAX : c_int = 14; |
| 784 | pub const _SC_LINE_MAX : c_int = 15; |
| 785 | pub const _SC_RE_DUP_MAX : c_int = 16; |
| 786 | pub const _SC_2_VERSION : c_int = 17; |
| 787 | pub const _SC_2_C_BIND : c_int = 18; |
| 788 | pub const _SC_2_C_DEV : c_int = 19; |
| 789 | pub const _SC_2_CHAR_TERM : c_int = 20; |
| 790 | pub const _SC_2_FORT_DEV : c_int = 21; |
| 791 | pub const _SC_2_FORT_RUN : c_int = 22; |
| 792 | pub const _SC_2_LOCALEDEF : c_int = 23; |
| 793 | pub const _SC_2_SW_DEV : c_int = 24; |
| 794 | pub const _SC_2_UPE : c_int = 25; |
| 795 | pub const _SC_STREAM_MAX : c_int = 26; |
| 796 | pub const _SC_TZNAME_MAX : c_int = 27; |
| 797 | pub const _SC_ASYNCHRONOUS_IO : c_int = 28; |
| 798 | pub const _SC_MAPPED_FILES : c_int = 29; |
| 799 | pub const _SC_MEMLOCK : c_int = 30; |
| 800 | pub const _SC_MEMLOCK_RANGE : c_int = 31; |
| 801 | pub const _SC_MEMORY_PROTECTION : c_int = 32; |
| 802 | pub const _SC_MESSAGE_PASSING : c_int = 33; |
| 803 | pub const _SC_PRIORITIZED_IO : c_int = 34; |
| 804 | pub const _SC_PRIORITY_SCHEDULING : c_int = 35; |
| 805 | pub const _SC_REALTIME_SIGNALS : c_int = 36; |
| 806 | pub const _SC_SEMAPHORES : c_int = 37; |
| 807 | pub const _SC_FSYNC : c_int = 38; |
| 808 | pub const _SC_SHARED_MEMORY_OBJECTS : c_int = 39; |
| 809 | pub const _SC_SYNCHRONIZED_IO : c_int = 40; |
| 810 | pub const _SC_TIMERS : c_int = 41; |
| 811 | pub const _SC_AIO_LISTIO_MAX : c_int = 42; |
| 812 | pub const _SC_AIO_MAX : c_int = 43; |
| 813 | pub const _SC_AIO_PRIO_DELTA_MAX : c_int = 44; |
| 814 | pub const _SC_DELAYTIMER_MAX : c_int = 45; |
| 815 | pub const _SC_MQ_OPEN_MAX : c_int = 46; |
| 816 | pub const _SC_PAGESIZE : c_int = 47; |
| 817 | pub const _SC_RTSIG_MAX : c_int = 48; |
| 818 | pub const _SC_SEM_NSEMS_MAX : c_int = 49; |
| 819 | pub const _SC_SEM_VALUE_MAX : c_int = 50; |
| 820 | pub const _SC_SIGQUEUE_MAX : c_int = 51; |
| 821 | pub const _SC_TIMER_MAX : c_int = 52; |
| 822 | } |
| 823 | } |