]> git.proxmox.com Git - rustc.git/blob - src/vendor/libc/src/unix/bsd/apple/mod.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / vendor / libc / src / unix / bsd / apple / mod.rs
1 //! Apple (ios/darwin)-specific definitions
2 //!
3 //! This covers *-apple-* triples currently
4
5 pub type clock_t = c_ulong;
6 pub type time_t = c_long;
7 pub type suseconds_t = i32;
8 pub type dev_t = i32;
9 pub type ino_t = u64;
10 pub type mode_t = u16;
11 pub type nlink_t = u16;
12 pub type blksize_t = i32;
13 pub type rlim_t = u64;
14 pub type mach_timebase_info_data_t = mach_timebase_info;
15 pub type pthread_key_t = c_ulong;
16 pub type sigset_t = u32;
17 pub type clockid_t = ::c_uint;
18 pub type fsblkcnt_t = ::c_uint;
19 pub type fsfilcnt_t = ::c_uint;
20 pub type speed_t = ::c_ulong;
21 pub type tcflag_t = ::c_ulong;
22 pub type nl_item = ::c_int;
23 pub type id_t = ::c_uint;
24 pub type sem_t = ::c_int;
25 pub type idtype_t = ::c_uint;
26
27 pub enum timezone {}
28
29 s! {
30 pub struct aiocb {
31 pub aio_fildes: ::c_int,
32 pub aio_offset: ::off_t,
33 pub aio_buf: *mut ::c_void,
34 pub aio_nbytes: ::size_t,
35 pub aio_reqprio: ::c_int,
36 pub aio_sigevent: sigevent,
37 pub aio_lio_opcode: ::c_int
38 }
39
40 pub struct utmpx {
41 pub ut_user: [::c_char; _UTX_USERSIZE],
42 pub ut_id: [::c_char; _UTX_IDSIZE],
43 pub ut_line: [::c_char; _UTX_LINESIZE],
44 pub ut_pid: ::pid_t,
45 pub ut_type: ::c_short,
46 pub ut_tv: ::timeval,
47 pub ut_host: [::c_char; _UTX_HOSTSIZE],
48 ut_pad: [::uint32_t; 16],
49 }
50
51 pub struct glob_t {
52 pub gl_pathc: ::size_t,
53 __unused1: ::c_int,
54 pub gl_offs: ::size_t,
55 __unused2: ::c_int,
56 pub gl_pathv: *mut *mut ::c_char,
57
58 __unused3: *mut ::c_void,
59
60 __unused4: *mut ::c_void,
61 __unused5: *mut ::c_void,
62 __unused6: *mut ::c_void,
63 __unused7: *mut ::c_void,
64 __unused8: *mut ::c_void,
65 }
66
67 pub struct sockaddr_storage {
68 pub ss_len: u8,
69 pub ss_family: ::sa_family_t,
70 __ss_pad1: [u8; 6],
71 __ss_align: i64,
72 __ss_pad2: [u8; 112],
73 }
74
75 pub struct addrinfo {
76 pub ai_flags: ::c_int,
77 pub ai_family: ::c_int,
78 pub ai_socktype: ::c_int,
79 pub ai_protocol: ::c_int,
80 pub ai_addrlen: ::socklen_t,
81 pub ai_canonname: *mut ::c_char,
82 pub ai_addr: *mut ::sockaddr,
83 pub ai_next: *mut addrinfo,
84 }
85
86 pub struct mach_timebase_info {
87 pub numer: u32,
88 pub denom: u32,
89 }
90
91 pub struct stat {
92 pub st_dev: dev_t,
93 pub st_mode: mode_t,
94 pub st_nlink: nlink_t,
95 pub st_ino: ino_t,
96 pub st_uid: ::uid_t,
97 pub st_gid: ::gid_t,
98 pub st_rdev: dev_t,
99 pub st_atime: time_t,
100 pub st_atime_nsec: c_long,
101 pub st_mtime: time_t,
102 pub st_mtime_nsec: c_long,
103 pub st_ctime: time_t,
104 pub st_ctime_nsec: c_long,
105 pub st_birthtime: time_t,
106 pub st_birthtime_nsec: c_long,
107 pub st_size: ::off_t,
108 pub st_blocks: ::blkcnt_t,
109 pub st_blksize: blksize_t,
110 pub st_flags: ::uint32_t,
111 pub st_gen: ::uint32_t,
112 pub st_lspare: ::int32_t,
113 pub st_qspare: [::int64_t; 2],
114 }
115
116 pub struct dirent {
117 pub d_ino: u64,
118 pub d_seekoff: u64,
119 pub d_reclen: u16,
120 pub d_namlen: u16,
121 pub d_type: u8,
122 pub d_name: [::c_char; 1024],
123 }
124
125 pub struct pthread_mutex_t {
126 __sig: ::c_long,
127 __opaque: [u8; __PTHREAD_MUTEX_SIZE__],
128 }
129
130 pub struct pthread_mutexattr_t {
131 __sig: ::c_long,
132 __opaque: [u8; 8],
133 }
134
135 pub struct pthread_cond_t {
136 __sig: ::c_long,
137 __opaque: [u8; __PTHREAD_COND_SIZE__],
138 }
139
140 pub struct pthread_condattr_t {
141 __sig: ::c_long,
142 __opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
143 }
144
145 pub struct pthread_rwlock_t {
146 __sig: ::c_long,
147 __opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
148 }
149
150 pub struct pthread_rwlockattr_t {
151 __sig: ::c_long,
152 __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
153 }
154
155 pub struct siginfo_t {
156 pub si_signo: ::c_int,
157 pub si_errno: ::c_int,
158 pub si_code: ::c_int,
159 pub si_pid: ::pid_t,
160 pub si_uid: ::uid_t,
161 pub si_status: ::c_int,
162 pub si_addr: *mut ::c_void,
163 _pad: [usize; 9],
164 }
165
166 pub struct sigaction {
167 pub sa_sigaction: ::sighandler_t,
168 pub sa_mask: sigset_t,
169 pub sa_flags: ::c_int,
170 }
171
172 pub struct stack_t {
173 pub ss_sp: *mut ::c_void,
174 pub ss_size: ::size_t,
175 pub ss_flags: ::c_int,
176 }
177
178 pub struct fstore_t {
179 pub fst_flags: ::c_uint,
180 pub fst_posmode: ::c_int,
181 pub fst_offset: ::off_t,
182 pub fst_length: ::off_t,
183 pub fst_bytesalloc: ::off_t,
184 }
185
186 pub struct radvisory {
187 pub ra_offset: ::off_t,
188 pub ra_count: ::c_int,
189 }
190
191 pub struct statvfs {
192 pub f_bsize: ::c_ulong,
193 pub f_frsize: ::c_ulong,
194 pub f_blocks: ::fsblkcnt_t,
195 pub f_bfree: ::fsblkcnt_t,
196 pub f_bavail: ::fsblkcnt_t,
197 pub f_files: ::fsfilcnt_t,
198 pub f_ffree: ::fsfilcnt_t,
199 pub f_favail: ::fsfilcnt_t,
200 pub f_fsid: ::c_ulong,
201 pub f_flag: ::c_ulong,
202 pub f_namemax: ::c_ulong,
203 }
204
205 pub struct Dl_info {
206 pub dli_fname: *const ::c_char,
207 pub dli_fbase: *mut ::c_void,
208 pub dli_sname: *const ::c_char,
209 pub dli_saddr: *mut ::c_void,
210 }
211
212 pub struct sockaddr_in {
213 pub sin_len: u8,
214 pub sin_family: ::sa_family_t,
215 pub sin_port: ::in_port_t,
216 pub sin_addr: ::in_addr,
217 pub sin_zero: [::c_char; 8],
218 }
219
220 pub struct statfs {
221 pub f_bsize: ::uint32_t,
222 pub f_iosize: ::int32_t,
223 pub f_blocks: ::uint64_t,
224 pub f_bfree: ::uint64_t,
225 pub f_bavail: ::uint64_t,
226 pub f_files: ::uint64_t,
227 pub f_ffree: ::uint64_t,
228 pub f_fsid: ::fsid_t,
229 pub f_owner: ::uid_t,
230 pub f_type: ::uint32_t,
231 pub f_flags: ::uint32_t,
232 pub f_fssubtype: ::uint32_t,
233 pub f_fstypename: [::c_char; 16],
234 pub f_mntonname: [::c_char; 1024],
235 pub f_mntfromname: [::c_char; 1024],
236 pub f_reserved: [::uint32_t; 8],
237 }
238
239 // FIXME: this should have align 4 but it's got align 8 on 64-bit
240 pub struct kevent {
241 pub ident: ::uintptr_t,
242 pub filter: ::int16_t,
243 pub flags: ::uint16_t,
244 pub fflags: ::uint32_t,
245 pub data: ::intptr_t,
246 pub udata: *mut ::c_void,
247 }
248
249 pub struct kevent64_s {
250 pub ident: ::uint64_t,
251 pub filter: ::int16_t,
252 pub flags: ::uint16_t,
253 pub fflags: ::uint32_t,
254 pub data: ::int64_t,
255 pub udata: ::uint64_t,
256 pub ext: [::uint64_t; 2],
257 }
258
259 pub struct dqblk {
260 pub dqb_bhardlimit: ::uint64_t,
261 pub dqb_bsoftlimit: ::uint64_t,
262 pub dqb_curbytes: ::uint64_t,
263 pub dqb_ihardlimit: ::uint32_t,
264 pub dqb_isoftlimit: ::uint32_t,
265 pub dqb_curinodes: ::uint32_t,
266 pub dqb_btime: ::uint32_t,
267 pub dqb_itime: ::uint32_t,
268 pub dqb_id: ::uint32_t,
269 pub dqb_spare: [::uint32_t; 4],
270 }
271
272 pub struct if_msghdr {
273 pub ifm_msglen: ::c_ushort,
274 pub ifm_version: ::c_uchar,
275 pub ifm_type: ::c_uchar,
276 pub ifm_addrs: ::c_int,
277 pub ifm_flags: ::c_int,
278 pub ifm_index: ::c_ushort,
279 pub ifm_data: if_data,
280 }
281
282 pub struct termios {
283 pub c_iflag: ::tcflag_t,
284 pub c_oflag: ::tcflag_t,
285 pub c_cflag: ::tcflag_t,
286 pub c_lflag: ::tcflag_t,
287 pub c_cc: [::cc_t; ::NCCS],
288 pub c_ispeed: ::speed_t,
289 pub c_ospeed: ::speed_t,
290 }
291
292 pub struct flock {
293 pub l_start: ::off_t,
294 pub l_len: ::off_t,
295 pub l_pid: ::pid_t,
296 pub l_type: ::c_short,
297 pub l_whence: ::c_short,
298 }
299
300 pub struct sf_hdtr {
301 pub headers: *mut ::iovec,
302 pub hdr_cnt: ::c_int,
303 pub trailers: *mut ::iovec,
304 pub trl_cnt: ::c_int,
305 }
306
307 pub struct lconv {
308 pub decimal_point: *mut ::c_char,
309 pub thousands_sep: *mut ::c_char,
310 pub grouping: *mut ::c_char,
311 pub int_curr_symbol: *mut ::c_char,
312 pub currency_symbol: *mut ::c_char,
313 pub mon_decimal_point: *mut ::c_char,
314 pub mon_thousands_sep: *mut ::c_char,
315 pub mon_grouping: *mut ::c_char,
316 pub positive_sign: *mut ::c_char,
317 pub negative_sign: *mut ::c_char,
318 pub int_frac_digits: ::c_char,
319 pub frac_digits: ::c_char,
320 pub p_cs_precedes: ::c_char,
321 pub p_sep_by_space: ::c_char,
322 pub n_cs_precedes: ::c_char,
323 pub n_sep_by_space: ::c_char,
324 pub p_sign_posn: ::c_char,
325 pub n_sign_posn: ::c_char,
326 pub int_p_cs_precedes: ::c_char,
327 pub int_n_cs_precedes: ::c_char,
328 pub int_p_sep_by_space: ::c_char,
329 pub int_n_sep_by_space: ::c_char,
330 pub int_p_sign_posn: ::c_char,
331 pub int_n_sign_posn: ::c_char,
332 }
333
334 pub struct sigevent {
335 pub sigev_notify: ::c_int,
336 pub sigev_signo: ::c_int,
337 pub sigev_value: ::sigval,
338 __unused1: *mut ::c_void, //actually a function pointer
339 pub sigev_notify_attributes: *mut ::pthread_attr_t
340 }
341
342 pub struct proc_taskinfo {
343 pub pti_virtual_size: u64,
344 pub pti_resident_size: u64,
345 pub pti_total_user: u64,
346 pub pti_total_system: u64,
347 pub pti_threads_user: u64,
348 pub pti_threads_system: u64,
349 pub pti_policy: i32,
350 pub pti_faults: i32,
351 pub pti_pageins: i32,
352 pub pti_cow_faults: i32,
353 pub pti_messages_sent: i32,
354 pub pti_messages_received: i32,
355 pub pti_syscalls_mach: i32,
356 pub pti_syscalls_unix: i32,
357 pub pti_csw: i32,
358 pub pti_threadnum: i32,
359 pub pti_numrunning: i32,
360 pub pti_priority: i32,
361 }
362
363 pub struct proc_bsdinfo {
364 pub pbi_flags: u32,
365 pub pbi_status: u32,
366 pub pbi_xstatus: u32,
367 pub pbi_pid: u32,
368 pub pbi_ppid: u32,
369 pub pbi_uid: ::uid_t,
370 pub pbi_gid: ::gid_t,
371 pub pbi_ruid: ::uid_t,
372 pub pbi_rgid: ::gid_t,
373 pub pbi_svuid: ::uid_t,
374 pub pbi_svgid: ::gid_t,
375 pub rfu_1: u32,
376 pub pbi_comm: [::c_char; MAXCOMLEN],
377 pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy...
378 pub pbi_nfiles: u32,
379 pub pbi_pgid: u32,
380 pub pbi_pjobc: u32,
381 pub e_tdev: u32,
382 pub e_tpgid: u32,
383 pub pbi_nice: i32,
384 pub pbi_start_tvsec: u64,
385 pub pbi_start_tvusec: u64,
386 }
387
388 pub struct proc_taskallinfo {
389 pub pbsd: proc_bsdinfo,
390 pub ptinfo: proc_taskinfo,
391 }
392
393 pub struct proc_threadinfo {
394 pub pth_user_time: u64,
395 pub pth_system_time: u64,
396 pub pth_cpu_usage: i32,
397 pub pth_policy: i32,
398 pub pth_run_state: i32,
399 pub pth_flags: i32,
400 pub pth_sleep_time: i32,
401 pub pth_curpri: i32,
402 pub pth_priority: i32,
403 pub pth_maxpriority: i32,
404 pub pth_name: [::c_char; MAXTHREADNAMESIZE],
405 }
406
407 pub struct xsw_usage {
408 pub xsu_total: u64,
409 pub xsu_avail: u64,
410 pub xsu_used: u64,
411 pub xsu_pagesize: u32,
412 pub xsu_encrypted: ::boolean_t,
413 }
414
415 pub struct xucred {
416 pub cr_version: ::c_uint,
417 pub cr_uid: ::uid_t,
418 pub cr_ngroups: ::c_short,
419 pub cr_groups: [::gid_t;16]
420 }
421 }
422
423 pub const _UTX_USERSIZE: usize = 256;
424 pub const _UTX_LINESIZE: usize = 32;
425 pub const _UTX_IDSIZE: usize = 4;
426 pub const _UTX_HOSTSIZE: usize = 256;
427
428 pub const EMPTY: ::c_short = 0;
429 pub const RUN_LVL: ::c_short = 1;
430 pub const BOOT_TIME: ::c_short = 2;
431 pub const OLD_TIME: ::c_short = 3;
432 pub const NEW_TIME: ::c_short = 4;
433 pub const INIT_PROCESS: ::c_short = 5;
434 pub const LOGIN_PROCESS: ::c_short = 6;
435 pub const USER_PROCESS: ::c_short = 7;
436 pub const DEAD_PROCESS: ::c_short = 8;
437 pub const ACCOUNTING: ::c_short = 9;
438 pub const SIGNATURE: ::c_short = 10;
439 pub const SHUTDOWN_TIME: ::c_short = 11;
440
441 pub const LC_COLLATE_MASK: ::c_int = (1 << 0);
442 pub const LC_CTYPE_MASK: ::c_int = (1 << 1);
443 pub const LC_MESSAGES_MASK: ::c_int = (1 << 2);
444 pub const LC_MONETARY_MASK: ::c_int = (1 << 3);
445 pub const LC_NUMERIC_MASK: ::c_int = (1 << 4);
446 pub const LC_TIME_MASK: ::c_int = (1 << 5);
447 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
448 | LC_CTYPE_MASK
449 | LC_MESSAGES_MASK
450 | LC_MONETARY_MASK
451 | LC_NUMERIC_MASK
452 | LC_TIME_MASK;
453
454 pub const CODESET: ::nl_item = 0;
455 pub const D_T_FMT: ::nl_item = 1;
456 pub const D_FMT: ::nl_item = 2;
457 pub const T_FMT: ::nl_item = 3;
458 pub const T_FMT_AMPM: ::nl_item = 4;
459 pub const AM_STR: ::nl_item = 5;
460 pub const PM_STR: ::nl_item = 6;
461
462 pub const DAY_1: ::nl_item = 7;
463 pub const DAY_2: ::nl_item = 8;
464 pub const DAY_3: ::nl_item = 9;
465 pub const DAY_4: ::nl_item = 10;
466 pub const DAY_5: ::nl_item = 11;
467 pub const DAY_6: ::nl_item = 12;
468 pub const DAY_7: ::nl_item = 13;
469
470 pub const ABDAY_1: ::nl_item = 14;
471 pub const ABDAY_2: ::nl_item = 15;
472 pub const ABDAY_3: ::nl_item = 16;
473 pub const ABDAY_4: ::nl_item = 17;
474 pub const ABDAY_5: ::nl_item = 18;
475 pub const ABDAY_6: ::nl_item = 19;
476 pub const ABDAY_7: ::nl_item = 20;
477
478 pub const MON_1: ::nl_item = 21;
479 pub const MON_2: ::nl_item = 22;
480 pub const MON_3: ::nl_item = 23;
481 pub const MON_4: ::nl_item = 24;
482 pub const MON_5: ::nl_item = 25;
483 pub const MON_6: ::nl_item = 26;
484 pub const MON_7: ::nl_item = 27;
485 pub const MON_8: ::nl_item = 28;
486 pub const MON_9: ::nl_item = 29;
487 pub const MON_10: ::nl_item = 30;
488 pub const MON_11: ::nl_item = 31;
489 pub const MON_12: ::nl_item = 32;
490
491 pub const ABMON_1: ::nl_item = 33;
492 pub const ABMON_2: ::nl_item = 34;
493 pub const ABMON_3: ::nl_item = 35;
494 pub const ABMON_4: ::nl_item = 36;
495 pub const ABMON_5: ::nl_item = 37;
496 pub const ABMON_6: ::nl_item = 38;
497 pub const ABMON_7: ::nl_item = 39;
498 pub const ABMON_8: ::nl_item = 40;
499 pub const ABMON_9: ::nl_item = 41;
500 pub const ABMON_10: ::nl_item = 42;
501 pub const ABMON_11: ::nl_item = 43;
502 pub const ABMON_12: ::nl_item = 44;
503
504 pub const CLOCK_REALTIME: ::clockid_t = 0;
505 pub const CLOCK_MONOTONIC: ::clockid_t = 6;
506 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
507 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
508
509 pub const ERA: ::nl_item = 45;
510 pub const ERA_D_FMT: ::nl_item = 46;
511 pub const ERA_D_T_FMT: ::nl_item = 47;
512 pub const ERA_T_FMT: ::nl_item = 48;
513 pub const ALT_DIGITS: ::nl_item = 49;
514
515 pub const RADIXCHAR: ::nl_item = 50;
516 pub const THOUSEP: ::nl_item = 51;
517
518 pub const YESEXPR: ::nl_item = 52;
519 pub const NOEXPR: ::nl_item = 53;
520
521 pub const YESSTR: ::nl_item = 54;
522 pub const NOSTR: ::nl_item = 55;
523
524 pub const CRNCYSTR: ::nl_item = 56;
525
526 pub const D_MD_ORDER: ::nl_item = 57;
527
528 pub const EXIT_FAILURE: ::c_int = 1;
529 pub const EXIT_SUCCESS: ::c_int = 0;
530 pub const RAND_MAX: ::c_int = 2147483647;
531 pub const EOF: ::c_int = -1;
532 pub const SEEK_SET: ::c_int = 0;
533 pub const SEEK_CUR: ::c_int = 1;
534 pub const SEEK_END: ::c_int = 2;
535 pub const _IOFBF: ::c_int = 0;
536 pub const _IONBF: ::c_int = 2;
537 pub const _IOLBF: ::c_int = 1;
538 pub const BUFSIZ: ::c_uint = 1024;
539 pub const FOPEN_MAX: ::c_uint = 20;
540 pub const FILENAME_MAX: ::c_uint = 1024;
541 pub const L_tmpnam: ::c_uint = 1024;
542 pub const TMP_MAX: ::c_uint = 308915776;
543 pub const _PC_LINK_MAX: ::c_int = 1;
544 pub const _PC_MAX_CANON: ::c_int = 2;
545 pub const _PC_MAX_INPUT: ::c_int = 3;
546 pub const _PC_NAME_MAX: ::c_int = 4;
547 pub const _PC_PATH_MAX: ::c_int = 5;
548 pub const _PC_PIPE_BUF: ::c_int = 6;
549 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
550 pub const _PC_NO_TRUNC: ::c_int = 8;
551 pub const _PC_VDISABLE: ::c_int = 9;
552 pub const O_DSYNC: ::c_int = 0x400000;
553 pub const O_NOCTTY: ::c_int = 0x20000;
554 pub const O_CLOEXEC: ::c_int = 0x1000000;
555 pub const O_DIRECTORY: ::c_int = 0x100000;
556 pub const S_IFIFO: mode_t = 4096;
557 pub const S_IFCHR: mode_t = 8192;
558 pub const S_IFBLK: mode_t = 24576;
559 pub const S_IFDIR: mode_t = 16384;
560 pub const S_IFREG: mode_t = 32768;
561 pub const S_IFLNK: mode_t = 40960;
562 pub const S_IFSOCK: mode_t = 49152;
563 pub const S_IFMT: mode_t = 61440;
564 pub const S_IEXEC: mode_t = 64;
565 pub const S_IWRITE: mode_t = 128;
566 pub const S_IREAD: mode_t = 256;
567 pub const S_IRWXU: mode_t = 448;
568 pub const S_IXUSR: mode_t = 64;
569 pub const S_IWUSR: mode_t = 128;
570 pub const S_IRUSR: mode_t = 256;
571 pub const S_IRWXG: mode_t = 56;
572 pub const S_IXGRP: mode_t = 8;
573 pub const S_IWGRP: mode_t = 16;
574 pub const S_IRGRP: mode_t = 32;
575 pub const S_IRWXO: mode_t = 7;
576 pub const S_IXOTH: mode_t = 1;
577 pub const S_IWOTH: mode_t = 2;
578 pub const S_IROTH: mode_t = 4;
579 pub const F_OK: ::c_int = 0;
580 pub const R_OK: ::c_int = 4;
581 pub const W_OK: ::c_int = 2;
582 pub const X_OK: ::c_int = 1;
583 pub const STDIN_FILENO: ::c_int = 0;
584 pub const STDOUT_FILENO: ::c_int = 1;
585 pub const STDERR_FILENO: ::c_int = 2;
586 pub const F_LOCK: ::c_int = 1;
587 pub const F_TEST: ::c_int = 3;
588 pub const F_TLOCK: ::c_int = 2;
589 pub const F_ULOCK: ::c_int = 0;
590 pub const F_GETLK: ::c_int = 7;
591 pub const F_SETLK: ::c_int = 8;
592 pub const F_SETLKW: ::c_int = 9;
593 pub const SIGHUP: ::c_int = 1;
594 pub const SIGINT: ::c_int = 2;
595 pub const SIGQUIT: ::c_int = 3;
596 pub const SIGILL: ::c_int = 4;
597 pub const SIGABRT: ::c_int = 6;
598 pub const SIGEMT: ::c_int = 7;
599 pub const SIGFPE: ::c_int = 8;
600 pub const SIGKILL: ::c_int = 9;
601 pub const SIGSEGV: ::c_int = 11;
602 pub const SIGPIPE: ::c_int = 13;
603 pub const SIGALRM: ::c_int = 14;
604 pub const SIGTERM: ::c_int = 15;
605
606 pub const PROT_NONE: ::c_int = 0;
607 pub const PROT_READ: ::c_int = 1;
608 pub const PROT_WRITE: ::c_int = 2;
609 pub const PROT_EXEC: ::c_int = 4;
610
611 pub const MAP_FILE: ::c_int = 0x0000;
612 pub const MAP_SHARED: ::c_int = 0x0001;
613 pub const MAP_PRIVATE: ::c_int = 0x0002;
614 pub const MAP_FIXED: ::c_int = 0x0010;
615 pub const MAP_ANON: ::c_int = 0x1000;
616
617 pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
618 pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
619 pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
620 pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
621 pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
622 pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
623 pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
624 pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
625 pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
626 pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
627 pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
628 pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
629 pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
630 VM_FLAGS_PURGABLE |
631 VM_FLAGS_RANDOM_ADDR |
632 VM_FLAGS_NO_CACHE |
633 VM_FLAGS_OVERWRITE |
634 VM_FLAGS_SUPERPAGE_MASK |
635 VM_FLAGS_ALIAS_MASK;
636 pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE |
637 VM_FLAGS_RETURN_4K_DATA_ADDR |
638 VM_FLAGS_RETURN_DATA_ADDR;
639 pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE |
640 VM_FLAGS_RANDOM_ADDR |
641 VM_FLAGS_OVERWRITE |
642 VM_FLAGS_RETURN_DATA_ADDR |
643 VM_FLAGS_RESILIENT_CODESIGN;
644
645 pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
646 pub const SUPERPAGE_NONE: ::c_int = 0;
647 pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
648 pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
649 VM_FLAGS_SUPERPAGE_SHIFT;
650 pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
651 VM_FLAGS_SUPERPAGE_SHIFT;
652 pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
653 pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
654 VM_FLAGS_SUPERPAGE_SHIFT;
655
656 pub const VM_MEMORY_MALLOC: ::c_int = 1;
657 pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
658 pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
659 pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
660 pub const VM_MEMORY_SBRK: ::c_int = 5;
661 pub const VM_MEMORY_REALLOC: ::c_int = 6;
662 pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
663 pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
664 pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
665 pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
666 pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
667 pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
668 pub const VM_MEMORY_IOKIT: ::c_int = 21;
669 pub const VM_MEMORY_STACK: ::c_int = 30;
670 pub const VM_MEMORY_GUARD: ::c_int = 31;
671 pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
672 pub const VM_MEMORY_DYLIB: ::c_int = 33;
673 pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
674 pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
675 pub const VM_MEMORY_APPKIT: ::c_int = 40;
676 pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
677 pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
678 pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
679 pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
680 pub const VM_MEMORY_JAVA: ::c_int = 44;
681 pub const VM_MEMORY_COREDATA: ::c_int = 45;
682 pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
683 pub const VM_MEMORY_ATS: ::c_int = 50;
684 pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
685 pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
686 pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
687 pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
688 pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
689 pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
690 pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
691 pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
692 pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
693 pub const VM_MEMORY_DYLD: ::c_int = 60;
694 pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
695 pub const VM_MEMORY_SQLITE: ::c_int = 62;
696 pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
697 pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
698 pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
699 pub const VM_MEMORY_GLSL: ::c_int = 66;
700 pub const VM_MEMORY_OPENCL: ::c_int = 67;
701 pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
702 pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
703 pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
704 pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
705 pub const VM_MEMORY_ASSETSD: ::c_int = 72;
706 pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
707 pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
708 pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
709 pub const VM_MEMORY_COREUI: ::c_int = 76;
710 pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
711 pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
712 pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
713 pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
714 pub const VM_MEMORY_ASL: ::c_int = 81;
715 pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
716 pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
717 pub const VM_MEMORY_DHMM: ::c_int = 84;
718 pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
719 pub const VM_MEMORY_SKYWALK: ::c_int = 87;
720 pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
721 pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
722
723 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
724
725 pub const MCL_CURRENT: ::c_int = 0x0001;
726 pub const MCL_FUTURE: ::c_int = 0x0002;
727
728 pub const MS_ASYNC: ::c_int = 0x0001;
729 pub const MS_INVALIDATE: ::c_int = 0x0002;
730 pub const MS_SYNC: ::c_int = 0x0010;
731
732 pub const MS_KILLPAGES: ::c_int = 0x0004;
733 pub const MS_DEACTIVATE: ::c_int = 0x0008;
734
735 pub const EPERM: ::c_int = 1;
736 pub const ENOENT: ::c_int = 2;
737 pub const ESRCH: ::c_int = 3;
738 pub const EINTR: ::c_int = 4;
739 pub const EIO: ::c_int = 5;
740 pub const ENXIO: ::c_int = 6;
741 pub const E2BIG: ::c_int = 7;
742 pub const ENOEXEC: ::c_int = 8;
743 pub const EBADF: ::c_int = 9;
744 pub const ECHILD: ::c_int = 10;
745 pub const EDEADLK: ::c_int = 11;
746 pub const ENOMEM: ::c_int = 12;
747 pub const EACCES: ::c_int = 13;
748 pub const EFAULT: ::c_int = 14;
749 pub const ENOTBLK: ::c_int = 15;
750 pub const EBUSY: ::c_int = 16;
751 pub const EEXIST: ::c_int = 17;
752 pub const EXDEV: ::c_int = 18;
753 pub const ENODEV: ::c_int = 19;
754 pub const ENOTDIR: ::c_int = 20;
755 pub const EISDIR: ::c_int = 21;
756 pub const EINVAL: ::c_int = 22;
757 pub const ENFILE: ::c_int = 23;
758 pub const EMFILE: ::c_int = 24;
759 pub const ENOTTY: ::c_int = 25;
760 pub const ETXTBSY: ::c_int = 26;
761 pub const EFBIG: ::c_int = 27;
762 pub const ENOSPC: ::c_int = 28;
763 pub const ESPIPE: ::c_int = 29;
764 pub const EROFS: ::c_int = 30;
765 pub const EMLINK: ::c_int = 31;
766 pub const EPIPE: ::c_int = 32;
767 pub const EDOM: ::c_int = 33;
768 pub const ERANGE: ::c_int = 34;
769 pub const EAGAIN: ::c_int = 35;
770 pub const EWOULDBLOCK: ::c_int = EAGAIN;
771 pub const EINPROGRESS: ::c_int = 36;
772 pub const EALREADY: ::c_int = 37;
773 pub const ENOTSOCK: ::c_int = 38;
774 pub const EDESTADDRREQ: ::c_int = 39;
775 pub const EMSGSIZE: ::c_int = 40;
776 pub const EPROTOTYPE: ::c_int = 41;
777 pub const ENOPROTOOPT: ::c_int = 42;
778 pub const EPROTONOSUPPORT: ::c_int = 43;
779 pub const ESOCKTNOSUPPORT: ::c_int = 44;
780 pub const ENOTSUP: ::c_int = 45;
781 pub const EPFNOSUPPORT: ::c_int = 46;
782 pub const EAFNOSUPPORT: ::c_int = 47;
783 pub const EADDRINUSE: ::c_int = 48;
784 pub const EADDRNOTAVAIL: ::c_int = 49;
785 pub const ENETDOWN: ::c_int = 50;
786 pub const ENETUNREACH: ::c_int = 51;
787 pub const ENETRESET: ::c_int = 52;
788 pub const ECONNABORTED: ::c_int = 53;
789 pub const ECONNRESET: ::c_int = 54;
790 pub const ENOBUFS: ::c_int = 55;
791 pub const EISCONN: ::c_int = 56;
792 pub const ENOTCONN: ::c_int = 57;
793 pub const ESHUTDOWN: ::c_int = 58;
794 pub const ETOOMANYREFS: ::c_int = 59;
795 pub const ETIMEDOUT: ::c_int = 60;
796 pub const ECONNREFUSED: ::c_int = 61;
797 pub const ELOOP: ::c_int = 62;
798 pub const ENAMETOOLONG: ::c_int = 63;
799 pub const EHOSTDOWN: ::c_int = 64;
800 pub const EHOSTUNREACH: ::c_int = 65;
801 pub const ENOTEMPTY: ::c_int = 66;
802 pub const EPROCLIM: ::c_int = 67;
803 pub const EUSERS: ::c_int = 68;
804 pub const EDQUOT: ::c_int = 69;
805 pub const ESTALE: ::c_int = 70;
806 pub const EREMOTE: ::c_int = 71;
807 pub const EBADRPC: ::c_int = 72;
808 pub const ERPCMISMATCH: ::c_int = 73;
809 pub const EPROGUNAVAIL: ::c_int = 74;
810 pub const EPROGMISMATCH: ::c_int = 75;
811 pub const EPROCUNAVAIL: ::c_int = 76;
812 pub const ENOLCK: ::c_int = 77;
813 pub const ENOSYS: ::c_int = 78;
814 pub const EFTYPE: ::c_int = 79;
815 pub const EAUTH: ::c_int = 80;
816 pub const ENEEDAUTH: ::c_int = 81;
817 pub const EPWROFF: ::c_int = 82;
818 pub const EDEVERR: ::c_int = 83;
819 pub const EOVERFLOW: ::c_int = 84;
820 pub const EBADEXEC: ::c_int = 85;
821 pub const EBADARCH: ::c_int = 86;
822 pub const ESHLIBVERS: ::c_int = 87;
823 pub const EBADMACHO: ::c_int = 88;
824 pub const ECANCELED: ::c_int = 89;
825 pub const EIDRM: ::c_int = 90;
826 pub const ENOMSG: ::c_int = 91;
827 pub const EILSEQ: ::c_int = 92;
828 pub const ENOATTR: ::c_int = 93;
829 pub const EBADMSG: ::c_int = 94;
830 pub const EMULTIHOP: ::c_int = 95;
831 pub const ENODATA: ::c_int = 96;
832 pub const ENOLINK: ::c_int = 97;
833 pub const ENOSR: ::c_int = 98;
834 pub const ENOSTR: ::c_int = 99;
835 pub const EPROTO: ::c_int = 100;
836 pub const ETIME: ::c_int = 101;
837 pub const EOPNOTSUPP: ::c_int = 102;
838 pub const ENOPOLICY: ::c_int = 103;
839 pub const ENOTRECOVERABLE: ::c_int = 104;
840 pub const EOWNERDEAD: ::c_int = 105;
841 pub const EQFULL: ::c_int = 106;
842 pub const ELAST: ::c_int = 106;
843
844 pub const EAI_SYSTEM: ::c_int = 11;
845
846 pub const F_DUPFD: ::c_int = 0;
847 pub const F_DUPFD_CLOEXEC: ::c_int = 67;
848 pub const F_GETFD: ::c_int = 1;
849 pub const F_SETFD: ::c_int = 2;
850 pub const F_GETFL: ::c_int = 3;
851 pub const F_SETFL: ::c_int = 4;
852 pub const F_PREALLOCATE: ::c_int = 42;
853 pub const F_RDADVISE: ::c_int = 44;
854 pub const F_RDAHEAD: ::c_int = 45;
855 pub const F_NOCACHE: ::c_int = 48;
856 pub const F_GETPATH: ::c_int = 50;
857 pub const F_FULLFSYNC: ::c_int = 51;
858 pub const F_FREEZE_FS: ::c_int = 53;
859 pub const F_THAW_FS: ::c_int = 54;
860 pub const F_GLOBAL_NOCACHE: ::c_int = 55;
861 pub const F_NODIRECT: ::c_int = 62;
862
863 pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
864 pub const F_ALLOCATEALL: ::c_uint = 0x04;
865
866 pub const F_PEOFPOSMODE: ::c_int = 3;
867 pub const F_VOLPOSMODE: ::c_int = 4;
868
869 pub const AT_FDCWD: ::c_int = -2;
870 pub const AT_EACCESS: ::c_int = 0x0010;
871 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
872 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
873 pub const AT_REMOVEDIR: ::c_int = 0x0080;
874
875 pub const TIOCMODG: ::c_ulong = 0x40047403;
876 pub const TIOCMODS: ::c_ulong = 0x80047404;
877 pub const TIOCM_LE: ::c_int = 0x1;
878 pub const TIOCM_DTR: ::c_int = 0x2;
879 pub const TIOCM_RTS: ::c_int = 0x4;
880 pub const TIOCM_ST: ::c_int = 0x8;
881 pub const TIOCM_SR: ::c_int = 0x10;
882 pub const TIOCM_CTS: ::c_int = 0x20;
883 pub const TIOCM_CAR: ::c_int = 0x40;
884 pub const TIOCM_CD: ::c_int = 0x40;
885 pub const TIOCM_RNG: ::c_int = 0x80;
886 pub const TIOCM_RI: ::c_int = 0x80;
887 pub const TIOCM_DSR: ::c_int = 0x100;
888 pub const TIOCEXCL: ::c_int = 0x2000740d;
889 pub const TIOCNXCL: ::c_int = 0x2000740e;
890 pub const TIOCFLUSH: ::c_ulong = 0x80047410;
891 pub const TIOCGETD: ::c_ulong = 0x4004741a;
892 pub const TIOCSETD: ::c_ulong = 0x8004741b;
893 pub const TIOCIXON: ::c_uint = 0x20007481;
894 pub const TIOCIXOFF: ::c_uint = 0x20007480;
895 pub const TIOCSBRK: ::c_uint = 0x2000747b;
896 pub const TIOCCBRK: ::c_uint = 0x2000747a;
897 pub const TIOCSDTR: ::c_uint = 0x20007479;
898 pub const TIOCCDTR: ::c_uint = 0x20007478;
899 pub const TIOCGPGRP: ::c_ulong = 0x40047477;
900 pub const TIOCSPGRP: ::c_ulong = 0x80047476;
901 pub const TIOCOUTQ: ::c_ulong = 0x40047473;
902 pub const TIOCSTI: ::c_ulong = 0x80017472;
903 pub const TIOCNOTTY: ::c_uint = 0x20007471;
904 pub const TIOCPKT: ::c_ulong = 0x80047470;
905 pub const TIOCPKT_DATA: ::c_int = 0x0;
906 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
907 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
908 pub const TIOCPKT_STOP: ::c_int = 0x4;
909 pub const TIOCPKT_START: ::c_int = 0x8;
910 pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
911 pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
912 pub const TIOCPKT_IOCTL: ::c_int = 0x40;
913 pub const TIOCSTOP: ::c_uint = 0x2000746f;
914 pub const TIOCSTART: ::c_uint = 0x2000746e;
915 pub const TIOCMSET: ::c_ulong = 0x8004746d;
916 pub const TIOCMBIS: ::c_ulong = 0x8004746c;
917 pub const TIOCMBIC: ::c_ulong = 0x8004746b;
918 pub const TIOCMGET: ::c_ulong = 0x4004746a;
919 pub const TIOCREMOTE: ::c_ulong = 0x80047469;
920 pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
921 pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
922 pub const TIOCUCNTL: ::c_ulong = 0x80047466;
923 pub const TIOCSTAT: ::c_uint = 0x20007465;
924 pub const TIOCSCONS: ::c_uint = 0x20007463;
925 pub const TIOCCONS: ::c_ulong = 0x80047462;
926 pub const TIOCSCTTY: ::c_uint = 0x20007461;
927 pub const TIOCEXT: ::c_ulong = 0x80047460;
928 pub const TIOCSIG: ::c_uint = 0x2000745f;
929 pub const TIOCDRAIN: ::c_uint = 0x2000745e;
930 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
931 pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
932 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
933 pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
934 pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455;
935 pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
936 pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
937 pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
938
939 pub const B0: speed_t = 0;
940 pub const B50: speed_t = 50;
941 pub const B75: speed_t = 75;
942 pub const B110: speed_t = 110;
943 pub const B134: speed_t = 134;
944 pub const B150: speed_t = 150;
945 pub const B200: speed_t = 200;
946 pub const B300: speed_t = 300;
947 pub const B600: speed_t = 600;
948 pub const B1200: speed_t = 1200;
949 pub const B1800: speed_t = 1800;
950 pub const B2400: speed_t = 2400;
951 pub const B4800: speed_t = 4800;
952 pub const B9600: speed_t = 9600;
953 pub const B19200: speed_t = 19200;
954 pub const B38400: speed_t = 38400;
955 pub const B7200: speed_t = 7200;
956 pub const B14400: speed_t = 14400;
957 pub const B28800: speed_t = 28800;
958 pub const B57600: speed_t = 57600;
959 pub const B76800: speed_t = 76800;
960 pub const B115200: speed_t = 115200;
961 pub const B230400: speed_t = 230400;
962 pub const EXTA: speed_t = 19200;
963 pub const EXTB: speed_t = 38400;
964
965 pub const SIGTRAP: ::c_int = 5;
966
967 pub const GLOB_APPEND : ::c_int = 0x0001;
968 pub const GLOB_DOOFFS : ::c_int = 0x0002;
969 pub const GLOB_ERR : ::c_int = 0x0004;
970 pub const GLOB_MARK : ::c_int = 0x0008;
971 pub const GLOB_NOCHECK : ::c_int = 0x0010;
972 pub const GLOB_NOSORT : ::c_int = 0x0020;
973 pub const GLOB_NOESCAPE: ::c_int = 0x2000;
974
975 pub const GLOB_NOSPACE : ::c_int = -1;
976 pub const GLOB_ABORTED : ::c_int = -2;
977 pub const GLOB_NOMATCH : ::c_int = -3;
978
979 pub const POSIX_MADV_NORMAL: ::c_int = 0;
980 pub const POSIX_MADV_RANDOM: ::c_int = 1;
981 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
982 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
983 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
984
985 pub const _SC_IOV_MAX: ::c_int = 56;
986 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
987 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
988 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
989 pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
990 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
991 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
992 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
993 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
994 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
995 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
996 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
997 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
998 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
999 pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
1000 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
1001 pub const _SC_THREADS: ::c_int = 96;
1002 pub const _SC_TTY_NAME_MAX: ::c_int = 101;
1003 pub const _SC_ATEXIT_MAX: ::c_int = 107;
1004 pub const _SC_XOPEN_CRYPT: ::c_int = 108;
1005 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
1006 pub const _SC_XOPEN_LEGACY: ::c_int = 110;
1007 pub const _SC_XOPEN_REALTIME: ::c_int = 111;
1008 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
1009 pub const _SC_XOPEN_SHM: ::c_int = 113;
1010 pub const _SC_XOPEN_UNIX: ::c_int = 115;
1011 pub const _SC_XOPEN_VERSION: ::c_int = 116;
1012 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121;
1013
1014 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
1015 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
1016 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
1017 pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
1018 pub const PTHREAD_STACK_MIN: ::size_t = 8192;
1019
1020 pub const RLIMIT_CPU: ::c_int = 0;
1021 pub const RLIMIT_FSIZE: ::c_int = 1;
1022 pub const RLIMIT_DATA: ::c_int = 2;
1023 pub const RLIMIT_STACK: ::c_int = 3;
1024 pub const RLIMIT_CORE: ::c_int = 4;
1025 pub const RLIMIT_AS: ::c_int = 5;
1026 pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
1027 pub const RLIMIT_MEMLOCK: ::c_int = 6;
1028 pub const RLIMIT_NPROC: ::c_int = 7;
1029 pub const RLIMIT_NOFILE: ::c_int = 8;
1030 pub const RLIM_NLIMITS: ::c_int = 9;
1031 pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
1032
1033 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
1034
1035 pub const RUSAGE_SELF: ::c_int = 0;
1036 pub const RUSAGE_CHILDREN: ::c_int = -1;
1037
1038 pub const MADV_NORMAL: ::c_int = 0;
1039 pub const MADV_RANDOM: ::c_int = 1;
1040 pub const MADV_SEQUENTIAL: ::c_int = 2;
1041 pub const MADV_WILLNEED: ::c_int = 3;
1042 pub const MADV_DONTNEED: ::c_int = 4;
1043 pub const MADV_FREE: ::c_int = 5;
1044 pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6;
1045 pub const MADV_FREE_REUSABLE: ::c_int = 7;
1046 pub const MADV_FREE_REUSE: ::c_int = 8;
1047 pub const MADV_CAN_REUSE: ::c_int = 9;
1048
1049 pub const MINCORE_INCORE: ::c_int = 0x1;
1050 pub const MINCORE_REFERENCED: ::c_int = 0x2;
1051 pub const MINCORE_MODIFIED: ::c_int = 0x4;
1052 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
1053 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
1054
1055 //
1056 // sys/netinet/in.h
1057 // Protocols (RFC 1700)
1058 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
1059
1060 // IPPROTO_IP defined in src/unix/mod.rs
1061 /// IP6 hop-by-hop options
1062 pub const IPPROTO_HOPOPTS: ::c_int = 0;
1063 // IPPROTO_ICMP defined in src/unix/mod.rs
1064 /// group mgmt protocol
1065 pub const IPPROTO_IGMP: ::c_int = 2;
1066 /// gateway^2 (deprecated)
1067 pub const IPPROTO_GGP: ::c_int = 3;
1068 /// for compatibility
1069 pub const IPPROTO_IPIP: ::c_int = 4;
1070 // IPPROTO_TCP defined in src/unix/mod.rs
1071 /// Stream protocol II.
1072 pub const IPPROTO_ST: ::c_int = 7;
1073 /// exterior gateway protocol
1074 pub const IPPROTO_EGP: ::c_int = 8;
1075 /// private interior gateway
1076 pub const IPPROTO_PIGP: ::c_int = 9;
1077 /// BBN RCC Monitoring
1078 pub const IPPROTO_RCCMON: ::c_int = 10;
1079 /// network voice protocol
1080 pub const IPPROTO_NVPII: ::c_int = 11;
1081 /// pup
1082 pub const IPPROTO_PUP: ::c_int = 12;
1083 /// Argus
1084 pub const IPPROTO_ARGUS: ::c_int = 13;
1085 /// EMCON
1086 pub const IPPROTO_EMCON: ::c_int = 14;
1087 /// Cross Net Debugger
1088 pub const IPPROTO_XNET: ::c_int = 15;
1089 /// Chaos
1090 pub const IPPROTO_CHAOS: ::c_int = 16;
1091 // IPPROTO_UDP defined in src/unix/mod.rs
1092 /// Multiplexing
1093 pub const IPPROTO_MUX: ::c_int = 18;
1094 /// DCN Measurement Subsystems
1095 pub const IPPROTO_MEAS: ::c_int = 19;
1096 /// Host Monitoring
1097 pub const IPPROTO_HMP: ::c_int = 20;
1098 /// Packet Radio Measurement
1099 pub const IPPROTO_PRM: ::c_int = 21;
1100 /// xns idp
1101 pub const IPPROTO_IDP: ::c_int = 22;
1102 /// Trunk-1
1103 pub const IPPROTO_TRUNK1: ::c_int = 23;
1104 /// Trunk-2
1105 pub const IPPROTO_TRUNK2: ::c_int = 24;
1106 /// Leaf-1
1107 pub const IPPROTO_LEAF1: ::c_int = 25;
1108 /// Leaf-2
1109 pub const IPPROTO_LEAF2: ::c_int = 26;
1110 /// Reliable Data
1111 pub const IPPROTO_RDP: ::c_int = 27;
1112 /// Reliable Transaction
1113 pub const IPPROTO_IRTP: ::c_int = 28;
1114 /// tp-4 w/ class negotiation
1115 pub const IPPROTO_TP: ::c_int = 29;
1116 /// Bulk Data Transfer
1117 pub const IPPROTO_BLT: ::c_int = 30;
1118 /// Network Services
1119 pub const IPPROTO_NSP: ::c_int = 31;
1120 /// Merit Internodal
1121 pub const IPPROTO_INP: ::c_int = 32;
1122 /// Sequential Exchange
1123 pub const IPPROTO_SEP: ::c_int = 33;
1124 /// Third Party Connect
1125 pub const IPPROTO_3PC: ::c_int = 34;
1126 /// InterDomain Policy Routing
1127 pub const IPPROTO_IDPR: ::c_int = 35;
1128 /// XTP
1129 pub const IPPROTO_XTP: ::c_int = 36;
1130 /// Datagram Delivery
1131 pub const IPPROTO_DDP: ::c_int = 37;
1132 /// Control Message Transport
1133 pub const IPPROTO_CMTP: ::c_int = 38;
1134 /// TP++ Transport
1135 pub const IPPROTO_TPXX: ::c_int = 39;
1136 /// IL transport protocol
1137 pub const IPPROTO_IL: ::c_int = 40;
1138 // IPPROTO_IPV6 defined in src/unix/mod.rs
1139 /// Source Demand Routing
1140 pub const IPPROTO_SDRP: ::c_int = 42;
1141 /// IP6 routing header
1142 pub const IPPROTO_ROUTING: ::c_int = 43;
1143 /// IP6 fragmentation header
1144 pub const IPPROTO_FRAGMENT: ::c_int = 44;
1145 /// InterDomain Routing
1146 pub const IPPROTO_IDRP: ::c_int = 45;
1147 /// resource reservation
1148 pub const IPPROTO_RSVP: ::c_int = 46;
1149 /// General Routing Encap.
1150 pub const IPPROTO_GRE: ::c_int = 47;
1151 /// Mobile Host Routing
1152 pub const IPPROTO_MHRP: ::c_int = 48;
1153 /// BHA
1154 pub const IPPROTO_BHA: ::c_int = 49;
1155 /// IP6 Encap Sec. Payload
1156 pub const IPPROTO_ESP: ::c_int = 50;
1157 /// IP6 Auth Header
1158 pub const IPPROTO_AH: ::c_int = 51;
1159 /// Integ. Net Layer Security
1160 pub const IPPROTO_INLSP: ::c_int = 52;
1161 /// IP with encryption
1162 pub const IPPROTO_SWIPE: ::c_int = 53;
1163 /// Next Hop Resolution
1164 pub const IPPROTO_NHRP: ::c_int = 54;
1165 /* 55-57: Unassigned */
1166 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
1167 /// IP6 no next header
1168 pub const IPPROTO_NONE: ::c_int = 59;
1169 /// IP6 destination option
1170 pub const IPPROTO_DSTOPTS: ::c_int = 60;
1171 /// any host internal protocol
1172 pub const IPPROTO_AHIP: ::c_int = 61;
1173 /// CFTP
1174 pub const IPPROTO_CFTP: ::c_int = 62;
1175 /// "hello" routing protocol
1176 pub const IPPROTO_HELLO: ::c_int = 63;
1177 /// SATNET/Backroom EXPAK
1178 pub const IPPROTO_SATEXPAK: ::c_int = 64;
1179 /// Kryptolan
1180 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
1181 /// Remote Virtual Disk
1182 pub const IPPROTO_RVD: ::c_int = 66;
1183 /// Pluribus Packet Core
1184 pub const IPPROTO_IPPC: ::c_int = 67;
1185 /// Any distributed FS
1186 pub const IPPROTO_ADFS: ::c_int = 68;
1187 /// Satnet Monitoring
1188 pub const IPPROTO_SATMON: ::c_int = 69;
1189 /// VISA Protocol
1190 pub const IPPROTO_VISA: ::c_int = 70;
1191 /// Packet Core Utility
1192 pub const IPPROTO_IPCV: ::c_int = 71;
1193 /// Comp. Prot. Net. Executive
1194 pub const IPPROTO_CPNX: ::c_int = 72;
1195 /// Comp. Prot. HeartBeat
1196 pub const IPPROTO_CPHB: ::c_int = 73;
1197 /// Wang Span Network
1198 pub const IPPROTO_WSN: ::c_int = 74;
1199 /// Packet Video Protocol
1200 pub const IPPROTO_PVP: ::c_int = 75;
1201 /// BackRoom SATNET Monitoring
1202 pub const IPPROTO_BRSATMON: ::c_int = 76;
1203 /// Sun net disk proto (temp.)
1204 pub const IPPROTO_ND: ::c_int = 77;
1205 /// WIDEBAND Monitoring
1206 pub const IPPROTO_WBMON: ::c_int = 78;
1207 /// WIDEBAND EXPAK
1208 pub const IPPROTO_WBEXPAK: ::c_int = 79;
1209 /// ISO cnlp
1210 pub const IPPROTO_EON: ::c_int = 80;
1211 /// VMTP
1212 pub const IPPROTO_VMTP: ::c_int = 81;
1213 /// Secure VMTP
1214 pub const IPPROTO_SVMTP: ::c_int = 82;
1215 /// Banyon VINES
1216 pub const IPPROTO_VINES: ::c_int = 83;
1217 /// TTP
1218 pub const IPPROTO_TTP: ::c_int = 84;
1219 /// NSFNET-IGP
1220 pub const IPPROTO_IGP: ::c_int = 85;
1221 /// dissimilar gateway prot.
1222 pub const IPPROTO_DGP: ::c_int = 86;
1223 /// TCF
1224 pub const IPPROTO_TCF: ::c_int = 87;
1225 /// Cisco/GXS IGRP
1226 pub const IPPROTO_IGRP: ::c_int = 88;
1227 /// OSPFIGP
1228 pub const IPPROTO_OSPFIGP: ::c_int = 89;
1229 /// Strite RPC protocol
1230 pub const IPPROTO_SRPC: ::c_int = 90;
1231 /// Locus Address Resoloution
1232 pub const IPPROTO_LARP: ::c_int = 91;
1233 /// Multicast Transport
1234 pub const IPPROTO_MTP: ::c_int = 92;
1235 /// AX.25 Frames
1236 pub const IPPROTO_AX25: ::c_int = 93;
1237 /// IP encapsulated in IP
1238 pub const IPPROTO_IPEIP: ::c_int = 94;
1239 /// Mobile Int.ing control
1240 pub const IPPROTO_MICP: ::c_int = 95;
1241 /// Semaphore Comm. security
1242 pub const IPPROTO_SCCSP: ::c_int = 96;
1243 /// Ethernet IP encapsulation
1244 pub const IPPROTO_ETHERIP: ::c_int = 97;
1245 /// encapsulation header
1246 pub const IPPROTO_ENCAP: ::c_int = 98;
1247 /// any private encr. scheme
1248 pub const IPPROTO_APES: ::c_int = 99;
1249 /// GMTP
1250 pub const IPPROTO_GMTP: ::c_int = 100;
1251
1252 /* 101-254: Partly Unassigned */
1253 /// Protocol Independent Mcast
1254 pub const IPPROTO_PIM: ::c_int = 103;
1255 /// payload compression (IPComp)
1256 pub const IPPROTO_IPCOMP: ::c_int = 108;
1257 /// PGM
1258 pub const IPPROTO_PGM: ::c_int = 113;
1259 /// SCTP
1260 pub const IPPROTO_SCTP: ::c_int = 132;
1261
1262 /* 255: Reserved */
1263 /* BSD Private, local use, namespace incursion */
1264 /// divert pseudo-protocol
1265 pub const IPPROTO_DIVERT: ::c_int = 254;
1266 /// raw IP packet
1267 pub const IPPROTO_RAW: ::c_int = 255;
1268 pub const IPPROTO_MAX: ::c_int = 256;
1269 /// last return value of *_input(), meaning "all job for this pkt is done".
1270 pub const IPPROTO_DONE: ::c_int = 257;
1271
1272 pub const AF_UNSPEC: ::c_int = 0;
1273 pub const AF_LOCAL: ::c_int = 1;
1274 pub const AF_UNIX: ::c_int = AF_LOCAL;
1275 pub const AF_INET: ::c_int = 2;
1276 pub const AF_IMPLINK: ::c_int = 3;
1277 pub const AF_PUP: ::c_int = 4;
1278 pub const AF_CHAOS: ::c_int = 5;
1279 pub const AF_NS: ::c_int = 6;
1280 pub const AF_ISO: ::c_int = 7;
1281 pub const AF_OSI: ::c_int = AF_ISO;
1282 pub const AF_ECMA: ::c_int = 8;
1283 pub const AF_DATAKIT: ::c_int = 9;
1284 pub const AF_CCITT: ::c_int = 10;
1285 pub const AF_SNA: ::c_int = 11;
1286 pub const AF_DECnet: ::c_int = 12;
1287 pub const AF_DLI: ::c_int = 13;
1288 pub const AF_LAT: ::c_int = 14;
1289 pub const AF_HYLINK: ::c_int = 15;
1290 pub const AF_APPLETALK: ::c_int = 16;
1291 pub const AF_ROUTE: ::c_int = 17;
1292 pub const AF_LINK: ::c_int = 18;
1293 pub const pseudo_AF_XTP: ::c_int = 19;
1294 pub const AF_COIP: ::c_int = 20;
1295 pub const AF_CNT: ::c_int = 21;
1296 pub const pseudo_AF_RTIP: ::c_int = 22;
1297 pub const AF_IPX: ::c_int = 23;
1298 pub const AF_SIP: ::c_int = 24;
1299 pub const pseudo_AF_PIP: ::c_int = 25;
1300 pub const AF_ISDN: ::c_int = 28;
1301 pub const AF_E164: ::c_int = AF_ISDN;
1302 pub const pseudo_AF_KEY: ::c_int = 29;
1303 pub const AF_INET6: ::c_int = 30;
1304 pub const AF_NATM: ::c_int = 31;
1305 pub const AF_SYSTEM: ::c_int = 32;
1306 pub const AF_NETBIOS: ::c_int = 33;
1307 pub const AF_PPP: ::c_int = 34;
1308 pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
1309 #[doc(hidden)]
1310 pub const AF_MAX: ::c_int = 40;
1311 pub const AF_SYS_CONTROL: ::c_int = 2;
1312
1313 pub const SYSPROTO_EVENT: ::c_int = 1;
1314 pub const SYSPROTO_CONTROL: ::c_int = 2;
1315
1316 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
1317 pub const PF_LOCAL: ::c_int = AF_LOCAL;
1318 pub const PF_UNIX: ::c_int = PF_LOCAL;
1319 pub const PF_INET: ::c_int = AF_INET;
1320 pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
1321 pub const PF_PUP: ::c_int = AF_PUP;
1322 pub const PF_CHAOS: ::c_int = AF_CHAOS;
1323 pub const PF_NS: ::c_int = AF_NS;
1324 pub const PF_ISO: ::c_int = AF_ISO;
1325 pub const PF_OSI: ::c_int = AF_ISO;
1326 pub const PF_ECMA: ::c_int = AF_ECMA;
1327 pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
1328 pub const PF_CCITT: ::c_int = AF_CCITT;
1329 pub const PF_SNA: ::c_int = AF_SNA;
1330 pub const PF_DECnet: ::c_int = AF_DECnet;
1331 pub const PF_DLI: ::c_int = AF_DLI;
1332 pub const PF_LAT: ::c_int = AF_LAT;
1333 pub const PF_HYLINK: ::c_int = AF_HYLINK;
1334 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
1335 pub const PF_ROUTE: ::c_int = AF_ROUTE;
1336 pub const PF_LINK: ::c_int = AF_LINK;
1337 pub const PF_XTP: ::c_int = pseudo_AF_XTP;
1338 pub const PF_COIP: ::c_int = AF_COIP;
1339 pub const PF_CNT: ::c_int = AF_CNT;
1340 pub const PF_SIP: ::c_int = AF_SIP;
1341 pub const PF_IPX: ::c_int = AF_IPX;
1342 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
1343 pub const PF_PIP: ::c_int = pseudo_AF_PIP;
1344 pub const PF_ISDN: ::c_int = AF_ISDN;
1345 pub const PF_KEY: ::c_int = pseudo_AF_KEY;
1346 pub const PF_INET6: ::c_int = AF_INET6;
1347 pub const PF_NATM: ::c_int = AF_NATM;
1348 pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
1349 pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
1350 pub const PF_PPP: ::c_int = AF_PPP;
1351 #[doc(hidden)]
1352 pub const PF_MAX: ::c_int = AF_MAX;
1353
1354 #[doc(hidden)]
1355 pub const NET_MAXID: ::c_int = AF_MAX;
1356
1357 pub const NET_RT_DUMP: ::c_int = 1;
1358 pub const NET_RT_FLAGS: ::c_int = 2;
1359 pub const NET_RT_IFLIST: ::c_int = 3;
1360 #[doc(hidden)]
1361 pub const NET_RT_MAXID: ::c_int = 10;
1362
1363 pub const SOMAXCONN: ::c_int = 128;
1364
1365 pub const SOCK_MAXADDRLEN: ::c_int = 255;
1366
1367 pub const SOCK_STREAM: ::c_int = 1;
1368 pub const SOCK_DGRAM: ::c_int = 2;
1369 pub const SOCK_RAW: ::c_int = 3;
1370 pub const SOCK_RDM: ::c_int = 4;
1371 pub const SOCK_SEQPACKET: ::c_int = 5;
1372 pub const IP_TTL: ::c_int = 4;
1373 pub const IP_HDRINCL: ::c_int = 2;
1374 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
1375 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
1376 pub const IPV6_JOIN_GROUP: ::c_int = 12;
1377 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
1378
1379 pub const TCP_NODELAY: ::c_int = 0x01;
1380 pub const TCP_KEEPALIVE: ::c_int = 0x10;
1381
1382 pub const SOL_LOCAL: ::c_int = 0;
1383
1384 pub const LOCAL_PEERCRED: ::c_int = 0x001;
1385 pub const LOCAL_PEERPID: ::c_int = 0x002;
1386 pub const LOCAL_PEEREPID: ::c_int = 0x003;
1387 pub const LOCAL_PEERUUID: ::c_int = 0x004;
1388 pub const LOCAL_PEEREUUID: ::c_int = 0x005;
1389
1390 pub const SOL_SOCKET: ::c_int = 0xffff;
1391
1392 pub const SO_DEBUG: ::c_int = 0x01;
1393 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
1394 pub const SO_REUSEADDR: ::c_int = 0x0004;
1395 pub const SO_KEEPALIVE: ::c_int = 0x0008;
1396 pub const SO_DONTROUTE: ::c_int = 0x0010;
1397 pub const SO_BROADCAST: ::c_int = 0x0020;
1398 pub const SO_USELOOPBACK: ::c_int = 0x0040;
1399 pub const SO_LINGER: ::c_int = 0x0080;
1400 pub const SO_OOBINLINE: ::c_int = 0x0100;
1401 pub const SO_REUSEPORT: ::c_int = 0x0200;
1402 pub const SO_TIMESTAMP: ::c_int = 0x0400;
1403 pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800;
1404 pub const SO_DONTTRUNC: ::c_int = 0x2000;
1405 pub const SO_WANTMORE: ::c_int = 0x4000;
1406 pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
1407 pub const SO_SNDBUF: ::c_int = 0x1001;
1408 pub const SO_RCVBUF: ::c_int = 0x1002;
1409 pub const SO_SNDLOWAT: ::c_int = 0x1003;
1410 pub const SO_RCVLOWAT: ::c_int = 0x1004;
1411 pub const SO_SNDTIMEO: ::c_int = 0x1005;
1412 pub const SO_RCVTIMEO: ::c_int = 0x1006;
1413 pub const SO_ERROR: ::c_int = 0x1007;
1414 pub const SO_TYPE: ::c_int = 0x1008;
1415 pub const SO_LABEL: ::c_int = 0x1010;
1416 pub const SO_PEERLABEL: ::c_int = 0x1011;
1417 pub const SO_NREAD: ::c_int = 0x1020;
1418 pub const SO_NKE: ::c_int = 0x1021;
1419 pub const SO_NOSIGPIPE: ::c_int = 0x1022;
1420 pub const SO_NOADDRERR: ::c_int = 0x1023;
1421 pub const SO_NWRITE: ::c_int = 0x1024;
1422 pub const SO_REUSESHAREUID: ::c_int = 0x1025;
1423 pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026;
1424 pub const SO_RANDOMPORT: ::c_int = 0x1082;
1425 pub const SO_NP_EXTENSIONS: ::c_int = 0x1083;
1426
1427 pub const MSG_OOB: ::c_int = 0x1;
1428 pub const MSG_PEEK: ::c_int = 0x2;
1429 pub const MSG_DONTROUTE: ::c_int = 0x4;
1430 pub const MSG_EOR: ::c_int = 0x8;
1431 pub const MSG_TRUNC: ::c_int = 0x10;
1432 pub const MSG_CTRUNC: ::c_int = 0x20;
1433 pub const MSG_WAITALL: ::c_int = 0x40;
1434 pub const MSG_DONTWAIT: ::c_int = 0x80;
1435 pub const MSG_EOF: ::c_int = 0x100;
1436 pub const MSG_FLUSH: ::c_int = 0x400;
1437 pub const MSG_HOLD: ::c_int = 0x800;
1438 pub const MSG_SEND: ::c_int = 0x1000;
1439 pub const MSG_HAVEMORE: ::c_int = 0x2000;
1440 pub const MSG_RCVMORE: ::c_int = 0x4000;
1441 // pub const MSG_COMPAT: ::c_int = 0x8000;
1442
1443 pub const SCM_TIMESTAMP: ::c_int = 0x02;
1444 pub const SCM_CREDS: ::c_int = 0x03;
1445
1446 pub const IFF_LOOPBACK: ::c_int = 0x8;
1447
1448 pub const SHUT_RD: ::c_int = 0;
1449 pub const SHUT_WR: ::c_int = 1;
1450 pub const SHUT_RDWR: ::c_int = 2;
1451
1452 pub const LOCK_SH: ::c_int = 1;
1453 pub const LOCK_EX: ::c_int = 2;
1454 pub const LOCK_NB: ::c_int = 4;
1455 pub const LOCK_UN: ::c_int = 8;
1456
1457 pub const MAP_COPY: ::c_int = 0x0002;
1458 pub const MAP_RENAME: ::c_int = 0x0020;
1459 pub const MAP_NORESERVE: ::c_int = 0x0040;
1460 pub const MAP_NOEXTEND: ::c_int = 0x0100;
1461 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
1462 pub const MAP_NOCACHE: ::c_int = 0x0400;
1463 pub const MAP_JIT: ::c_int = 0x0800;
1464
1465 pub const _SC_ARG_MAX: ::c_int = 1;
1466 pub const _SC_CHILD_MAX: ::c_int = 2;
1467 pub const _SC_CLK_TCK: ::c_int = 3;
1468 pub const _SC_NGROUPS_MAX: ::c_int = 4;
1469 pub const _SC_OPEN_MAX: ::c_int = 5;
1470 pub const _SC_JOB_CONTROL: ::c_int = 6;
1471 pub const _SC_SAVED_IDS: ::c_int = 7;
1472 pub const _SC_VERSION: ::c_int = 8;
1473 pub const _SC_BC_BASE_MAX: ::c_int = 9;
1474 pub const _SC_BC_DIM_MAX: ::c_int = 10;
1475 pub const _SC_BC_SCALE_MAX: ::c_int = 11;
1476 pub const _SC_BC_STRING_MAX: ::c_int = 12;
1477 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
1478 pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
1479 pub const _SC_LINE_MAX: ::c_int = 15;
1480 pub const _SC_RE_DUP_MAX: ::c_int = 16;
1481 pub const _SC_2_VERSION: ::c_int = 17;
1482 pub const _SC_2_C_BIND: ::c_int = 18;
1483 pub const _SC_2_C_DEV: ::c_int = 19;
1484 pub const _SC_2_CHAR_TERM: ::c_int = 20;
1485 pub const _SC_2_FORT_DEV: ::c_int = 21;
1486 pub const _SC_2_FORT_RUN: ::c_int = 22;
1487 pub const _SC_2_LOCALEDEF: ::c_int = 23;
1488 pub const _SC_2_SW_DEV: ::c_int = 24;
1489 pub const _SC_2_UPE: ::c_int = 25;
1490 pub const _SC_STREAM_MAX: ::c_int = 26;
1491 pub const _SC_TZNAME_MAX: ::c_int = 27;
1492 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
1493 pub const _SC_PAGESIZE: ::c_int = 29;
1494 pub const _SC_MEMLOCK: ::c_int = 30;
1495 pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
1496 pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
1497 pub const _SC_MESSAGE_PASSING: ::c_int = 33;
1498 pub const _SC_PRIORITIZED_IO: ::c_int = 34;
1499 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
1500 pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
1501 pub const _SC_SEMAPHORES: ::c_int = 37;
1502 pub const _SC_FSYNC: ::c_int = 38;
1503 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
1504 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
1505 pub const _SC_TIMERS: ::c_int = 41;
1506 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
1507 pub const _SC_AIO_MAX: ::c_int = 43;
1508 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
1509 pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
1510 pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
1511 pub const _SC_MAPPED_FILES: ::c_int = 47;
1512 pub const _SC_RTSIG_MAX: ::c_int = 48;
1513 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
1514 pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
1515 pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
1516 pub const _SC_TIMER_MAX: ::c_int = 52;
1517 pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
1518 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
1519 pub const _SC_2_PBS: ::c_int = 59;
1520 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
1521 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
1522 pub const _SC_2_PBS_LOCATE: ::c_int = 62;
1523 pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
1524 pub const _SC_2_PBS_TRACK: ::c_int = 64;
1525 pub const _SC_ADVISORY_INFO: ::c_int = 65;
1526 pub const _SC_BARRIERS: ::c_int = 66;
1527 pub const _SC_CLOCK_SELECTION: ::c_int = 67;
1528 pub const _SC_CPUTIME: ::c_int = 68;
1529 pub const _SC_FILE_LOCKING: ::c_int = 69;
1530 pub const _SC_HOST_NAME_MAX: ::c_int = 72;
1531 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
1532 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
1533 pub const _SC_REGEXP: ::c_int = 77;
1534 pub const _SC_SHELL: ::c_int = 78;
1535 pub const _SC_SPAWN: ::c_int = 79;
1536 pub const _SC_SPIN_LOCKS: ::c_int = 80;
1537 pub const _SC_SPORADIC_SERVER: ::c_int = 81;
1538 pub const _SC_THREAD_CPUTIME: ::c_int = 84;
1539 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
1540 pub const _SC_TIMEOUTS: ::c_int = 95;
1541 pub const _SC_TRACE: ::c_int = 97;
1542 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
1543 pub const _SC_TRACE_INHERIT: ::c_int = 99;
1544 pub const _SC_TRACE_LOG: ::c_int = 100;
1545 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
1546 pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
1547 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
1548 pub const _SC_V6_LP64_OFF64: ::c_int = 105;
1549 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
1550 pub const _SC_IPV6: ::c_int = 118;
1551 pub const _SC_RAW_SOCKETS: ::c_int = 119;
1552 pub const _SC_SYMLOOP_MAX: ::c_int = 120;
1553 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
1554 pub const _SC_XOPEN_STREAMS: ::c_int = 114;
1555 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122;
1556 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123;
1557 pub const _SC_XBS5_LP64_OFF64: ::c_int = 124;
1558 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125;
1559 pub const _SC_SS_REPL_MAX: ::c_int = 126;
1560 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127;
1561 pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
1562 pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
1563 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
1564 pub const _SC_PASS_MAX: ::c_int = 131;
1565
1566 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
1567 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
1568 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
1569 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
1570 pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7;
1571 pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB;
1572 pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4;
1573 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
1574 __sig: _PTHREAD_MUTEX_SIG_init,
1575 __opaque: [0; __PTHREAD_MUTEX_SIZE__],
1576 };
1577 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
1578 __sig: _PTHREAD_COND_SIG_init,
1579 __opaque: [0; __PTHREAD_COND_SIZE__],
1580 };
1581 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
1582 __sig: _PTHREAD_RWLOCK_SIG_init,
1583 __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
1584 };
1585
1586 pub const SIGSTKSZ: ::size_t = 131072;
1587
1588 pub const FD_SETSIZE: usize = 1024;
1589
1590 pub const ST_NOSUID: ::c_ulong = 2;
1591
1592 pub const EVFILT_READ: ::int16_t = -1;
1593 pub const EVFILT_WRITE: ::int16_t = -2;
1594 pub const EVFILT_AIO: ::int16_t = -3;
1595 pub const EVFILT_VNODE: ::int16_t = -4;
1596 pub const EVFILT_PROC: ::int16_t = -5;
1597 pub const EVFILT_SIGNAL: ::int16_t = -6;
1598 pub const EVFILT_TIMER: ::int16_t = -7;
1599 pub const EVFILT_MACHPORT: ::int16_t = -8;
1600 pub const EVFILT_FS: ::int16_t = -9;
1601 pub const EVFILT_USER: ::int16_t = -10;
1602 pub const EVFILT_VM: ::int16_t = -12;
1603
1604 pub const EV_ADD: ::uint16_t = 0x1;
1605 pub const EV_DELETE: ::uint16_t = 0x2;
1606 pub const EV_ENABLE: ::uint16_t = 0x4;
1607 pub const EV_DISABLE: ::uint16_t = 0x8;
1608 pub const EV_ONESHOT: ::uint16_t = 0x10;
1609 pub const EV_CLEAR: ::uint16_t = 0x20;
1610 pub const EV_RECEIPT: ::uint16_t = 0x40;
1611 pub const EV_DISPATCH: ::uint16_t = 0x80;
1612 pub const EV_FLAG0: ::uint16_t = 0x1000;
1613 pub const EV_POLL: ::uint16_t = 0x1000;
1614 pub const EV_FLAG1: ::uint16_t = 0x2000;
1615 pub const EV_OOBAND: ::uint16_t = 0x2000;
1616 pub const EV_ERROR: ::uint16_t = 0x4000;
1617 pub const EV_EOF: ::uint16_t = 0x8000;
1618 pub const EV_SYSFLAGS: ::uint16_t = 0xf000;
1619
1620 pub const NOTE_TRIGGER: ::uint32_t = 0x01000000;
1621 pub const NOTE_FFNOP: ::uint32_t = 0x00000000;
1622 pub const NOTE_FFAND: ::uint32_t = 0x40000000;
1623 pub const NOTE_FFOR: ::uint32_t = 0x80000000;
1624 pub const NOTE_FFCOPY: ::uint32_t = 0xc0000000;
1625 pub const NOTE_FFCTRLMASK: ::uint32_t = 0xc0000000;
1626 pub const NOTE_FFLAGSMASK: ::uint32_t = 0x00ffffff;
1627 pub const NOTE_LOWAT: ::uint32_t = 0x00000001;
1628 pub const NOTE_DELETE: ::uint32_t = 0x00000001;
1629 pub const NOTE_WRITE: ::uint32_t = 0x00000002;
1630 pub const NOTE_EXTEND: ::uint32_t = 0x00000004;
1631 pub const NOTE_ATTRIB: ::uint32_t = 0x00000008;
1632 pub const NOTE_LINK: ::uint32_t = 0x00000010;
1633 pub const NOTE_RENAME: ::uint32_t = 0x00000020;
1634 pub const NOTE_REVOKE: ::uint32_t = 0x00000040;
1635 pub const NOTE_NONE: ::uint32_t = 0x00000080;
1636 pub const NOTE_EXIT: ::uint32_t = 0x80000000;
1637 pub const NOTE_FORK: ::uint32_t = 0x40000000;
1638 pub const NOTE_EXEC: ::uint32_t = 0x20000000;
1639 pub const NOTE_REAP: ::uint32_t = 0x10000000;
1640 pub const NOTE_SIGNAL: ::uint32_t = 0x08000000;
1641 pub const NOTE_EXITSTATUS: ::uint32_t = 0x04000000;
1642 pub const NOTE_EXIT_DETAIL: ::uint32_t = 0x02000000;
1643 pub const NOTE_PDATAMASK: ::uint32_t = 0x000fffff;
1644 pub const NOTE_PCTRLMASK: ::uint32_t = 0xfff00000;
1645 pub const NOTE_EXIT_REPARENTED: ::uint32_t = 0x00080000;
1646 pub const NOTE_EXIT_DETAIL_MASK: ::uint32_t = 0x00070000;
1647 pub const NOTE_EXIT_DECRYPTFAIL: ::uint32_t = 0x00010000;
1648 pub const NOTE_EXIT_MEMORY: ::uint32_t = 0x00020000;
1649 pub const NOTE_EXIT_CSERROR: ::uint32_t = 0x00040000;
1650 pub const NOTE_VM_PRESSURE: ::uint32_t = 0x80000000;
1651 pub const NOTE_VM_PRESSURE_TERMINATE: ::uint32_t = 0x40000000;
1652 pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: ::uint32_t = 0x20000000;
1653 pub const NOTE_VM_ERROR: ::uint32_t = 0x10000000;
1654 pub const NOTE_SECONDS: ::uint32_t = 0x00000001;
1655 pub const NOTE_USECONDS: ::uint32_t = 0x00000002;
1656 pub const NOTE_NSECONDS: ::uint32_t = 0x00000004;
1657 pub const NOTE_ABSOLUTE: ::uint32_t = 0x00000008;
1658 pub const NOTE_LEEWAY: ::uint32_t = 0x00000010;
1659 pub const NOTE_CRITICAL: ::uint32_t = 0x00000020;
1660 pub const NOTE_BACKGROUND: ::uint32_t = 0x00000040;
1661 pub const NOTE_TRACK: ::uint32_t = 0x00000001;
1662 pub const NOTE_TRACKERR: ::uint32_t = 0x00000002;
1663 pub const NOTE_CHILD: ::uint32_t = 0x00000004;
1664
1665 pub const OCRNL: ::c_int = 0x00000010;
1666 pub const ONOCR: ::c_int = 0x00000020;
1667 pub const ONLRET: ::c_int = 0x00000040;
1668 pub const OFILL: ::c_int = 0x00000080;
1669 pub const NLDLY: ::c_int = 0x00000300;
1670 pub const TABDLY: ::c_int = 0x00000c04;
1671 pub const CRDLY: ::c_int = 0x00003000;
1672 pub const FFDLY: ::c_int = 0x00004000;
1673 pub const BSDLY: ::c_int = 0x00008000;
1674 pub const VTDLY: ::c_int = 0x00010000;
1675 pub const OFDEL: ::c_int = 0x00020000;
1676
1677 pub const NL0: ::c_int = 0x00000000;
1678 pub const NL1: ::c_int = 0x00000100;
1679 pub const TAB0: ::c_int = 0x00000000;
1680 pub const TAB1: ::c_int = 0x00000400;
1681 pub const TAB2: ::c_int = 0x00000800;
1682 pub const CR0: ::c_int = 0x00000000;
1683 pub const CR1: ::c_int = 0x00001000;
1684 pub const CR2: ::c_int = 0x00002000;
1685 pub const CR3: ::c_int = 0x00003000;
1686 pub const FF0: ::c_int = 0x00000000;
1687 pub const FF1: ::c_int = 0x00004000;
1688 pub const BS0: ::c_int = 0x00000000;
1689 pub const BS1: ::c_int = 0x00008000;
1690 pub const TAB3: ::c_int = 0x00000004;
1691 pub const VT0: ::c_int = 0x00000000;
1692 pub const VT1: ::c_int = 0x00010000;
1693 pub const IUTF8: ::tcflag_t = 0x00004000;
1694 pub const CRTSCTS: ::tcflag_t = 0x00030000;
1695
1696 pub const NI_MAXHOST: ::socklen_t = 1025;
1697
1698 pub const Q_GETQUOTA: ::c_int = 0x300;
1699 pub const Q_SETQUOTA: ::c_int = 0x400;
1700
1701 pub const RTLD_LOCAL: ::c_int = 0x4;
1702 pub const RTLD_FIRST: ::c_int = 0x100;
1703 pub const RTLD_NODELETE: ::c_int = 0x80;
1704 pub const RTLD_NOLOAD: ::c_int = 0x10;
1705 pub const RTLD_GLOBAL: ::c_int = 0x8;
1706
1707 pub const _WSTOPPED: ::c_int = 0o177;
1708
1709 pub const LOG_NETINFO: ::c_int = 12 << 3;
1710 pub const LOG_REMOTEAUTH: ::c_int = 13 << 3;
1711 pub const LOG_INSTALL: ::c_int = 14 << 3;
1712 pub const LOG_RAS: ::c_int = 15 << 3;
1713 pub const LOG_LAUNCHD: ::c_int = 24 << 3;
1714 pub const LOG_NFACILITIES: ::c_int = 25;
1715
1716 pub const CTLTYPE: ::c_int = 0xf;
1717 pub const CTLTYPE_NODE: ::c_int = 1;
1718 pub const CTLTYPE_INT: ::c_int = 2;
1719 pub const CTLTYPE_STRING: ::c_int = 3;
1720 pub const CTLTYPE_QUAD: ::c_int = 4;
1721 pub const CTLTYPE_OPAQUE: ::c_int = 5;
1722 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
1723 pub const CTLFLAG_RD: ::c_int = 0x80000000;
1724 pub const CTLFLAG_WR: ::c_int = 0x40000000;
1725 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
1726 pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000;
1727 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
1728 pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
1729 pub const CTLFLAG_MASKED: ::c_int = 0x04000000;
1730 pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000;
1731 pub const CTLFLAG_KERN: ::c_int = 0x01000000;
1732 pub const CTLFLAG_LOCKED: ::c_int = 0x00800000;
1733 pub const CTLFLAG_OID2: ::c_int = 0x00400000;
1734 pub const CTL_UNSPEC: ::c_int = 0;
1735 pub const CTL_KERN: ::c_int = 1;
1736 pub const CTL_VM: ::c_int = 2;
1737 pub const CTL_VFS: ::c_int = 3;
1738 pub const CTL_NET: ::c_int = 4;
1739 pub const CTL_DEBUG: ::c_int = 5;
1740 pub const CTL_HW: ::c_int = 6;
1741 pub const CTL_MACHDEP: ::c_int = 7;
1742 pub const CTL_USER: ::c_int = 8;
1743 pub const CTL_MAXID: ::c_int = 9;
1744 pub const KERN_OSTYPE: ::c_int = 1;
1745 pub const KERN_OSRELEASE: ::c_int = 2;
1746 pub const KERN_OSREV: ::c_int = 3;
1747 pub const KERN_VERSION: ::c_int = 4;
1748 pub const KERN_MAXVNODES: ::c_int = 5;
1749 pub const KERN_MAXPROC: ::c_int = 6;
1750 pub const KERN_MAXFILES: ::c_int = 7;
1751 pub const KERN_ARGMAX: ::c_int = 8;
1752 pub const KERN_SECURELVL: ::c_int = 9;
1753 pub const KERN_HOSTNAME: ::c_int = 10;
1754 pub const KERN_HOSTID: ::c_int = 11;
1755 pub const KERN_CLOCKRATE: ::c_int = 12;
1756 pub const KERN_VNODE: ::c_int = 13;
1757 pub const KERN_PROC: ::c_int = 14;
1758 pub const KERN_FILE: ::c_int = 15;
1759 pub const KERN_PROF: ::c_int = 16;
1760 pub const KERN_POSIX1: ::c_int = 17;
1761 pub const KERN_NGROUPS: ::c_int = 18;
1762 pub const KERN_JOB_CONTROL: ::c_int = 19;
1763 pub const KERN_SAVED_IDS: ::c_int = 20;
1764 pub const KERN_BOOTTIME: ::c_int = 21;
1765 pub const KERN_NISDOMAINNAME: ::c_int = 22;
1766 pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME;
1767 pub const KERN_MAXPARTITIONS: ::c_int = 23;
1768 pub const KERN_KDEBUG: ::c_int = 24;
1769 pub const KERN_UPDATEINTERVAL: ::c_int = 25;
1770 pub const KERN_OSRELDATE: ::c_int = 26;
1771 pub const KERN_NTP_PLL: ::c_int = 27;
1772 pub const KERN_BOOTFILE: ::c_int = 28;
1773 pub const KERN_MAXFILESPERPROC: ::c_int = 29;
1774 pub const KERN_MAXPROCPERUID: ::c_int = 30;
1775 pub const KERN_DUMPDEV: ::c_int = 31;
1776 pub const KERN_IPC: ::c_int = 32;
1777 pub const KERN_DUMMY: ::c_int = 33;
1778 pub const KERN_PS_STRINGS: ::c_int = 34;
1779 pub const KERN_USRSTACK32: ::c_int = 35;
1780 pub const KERN_LOGSIGEXIT: ::c_int = 36;
1781 pub const KERN_SYMFILE: ::c_int = 37;
1782 pub const KERN_PROCARGS: ::c_int = 38;
1783 pub const KERN_NETBOOT: ::c_int = 40;
1784 pub const KERN_SYSV: ::c_int = 42;
1785 pub const KERN_AFFINITY: ::c_int = 43;
1786 pub const KERN_TRANSLATE: ::c_int = 44;
1787 pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE;
1788 pub const KERN_EXEC: ::c_int = 45;
1789 pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC;
1790 pub const KERN_AIOMAX: ::c_int = 46;
1791 pub const KERN_AIOPROCMAX: ::c_int = 47;
1792 pub const KERN_AIOTHREADS: ::c_int = 48;
1793 pub const KERN_COREFILE: ::c_int = 50;
1794 pub const KERN_COREDUMP: ::c_int = 51;
1795 pub const KERN_SUGID_COREDUMP: ::c_int = 52;
1796 pub const KERN_PROCDELAYTERM: ::c_int = 53;
1797 pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54;
1798 pub const KERN_LOW_PRI_WINDOW: ::c_int = 56;
1799 pub const KERN_LOW_PRI_DELAY: ::c_int = 57;
1800 pub const KERN_POSIX: ::c_int = 58;
1801 pub const KERN_USRSTACK64: ::c_int = 59;
1802 pub const KERN_NX_PROTECTION: ::c_int = 60;
1803 pub const KERN_TFP: ::c_int = 61;
1804 pub const KERN_PROCNAME: ::c_int = 62;
1805 pub const KERN_THALTSTACK: ::c_int = 63;
1806 pub const KERN_SPECULATIVE_READS: ::c_int = 64;
1807 pub const KERN_OSVERSION: ::c_int = 65;
1808 pub const KERN_SAFEBOOT: ::c_int = 66;
1809 pub const KERN_RAGEVNODE: ::c_int = 68;
1810 pub const KERN_TTY: ::c_int = 69;
1811 pub const KERN_CHECKOPENEVT: ::c_int = 70;
1812 pub const KERN_THREADNAME: ::c_int = 71;
1813 pub const KERN_MAXID: ::c_int = 72;
1814 pub const KERN_RAGE_PROC: ::c_int = 1;
1815 pub const KERN_RAGE_THREAD: ::c_int = 2;
1816 pub const KERN_UNRAGE_PROC: ::c_int = 3;
1817 pub const KERN_UNRAGE_THREAD: ::c_int = 4;
1818 pub const KERN_OPENEVT_PROC: ::c_int = 1;
1819 pub const KERN_UNOPENEVT_PROC: ::c_int = 2;
1820 pub const KERN_TFP_POLICY: ::c_int = 1;
1821 pub const KERN_TFP_POLICY_DENY: ::c_int = 0;
1822 pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2;
1823 pub const KERN_KDEFLAGS: ::c_int = 1;
1824 pub const KERN_KDDFLAGS: ::c_int = 2;
1825 pub const KERN_KDENABLE: ::c_int = 3;
1826 pub const KERN_KDSETBUF: ::c_int = 4;
1827 pub const KERN_KDGETBUF: ::c_int = 5;
1828 pub const KERN_KDSETUP: ::c_int = 6;
1829 pub const KERN_KDREMOVE: ::c_int = 7;
1830 pub const KERN_KDSETREG: ::c_int = 8;
1831 pub const KERN_KDGETREG: ::c_int = 9;
1832 pub const KERN_KDREADTR: ::c_int = 10;
1833 pub const KERN_KDPIDTR: ::c_int = 11;
1834 pub const KERN_KDTHRMAP: ::c_int = 12;
1835 pub const KERN_KDPIDEX: ::c_int = 14;
1836 pub const KERN_KDSETRTCDEC: ::c_int = 15;
1837 pub const KERN_KDGETENTROPY: ::c_int = 16;
1838 pub const KERN_KDWRITETR: ::c_int = 17;
1839 pub const KERN_KDWRITEMAP: ::c_int = 18;
1840 pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
1841 pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
1842 pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
1843 pub const KERN_KDSET_TYPEFILTER: ::c_int = 22;
1844 pub const KERN_KDBUFWAIT: ::c_int = 23;
1845 pub const KERN_KDCPUMAP: ::c_int = 24;
1846 pub const KERN_PROC_ALL: ::c_int = 0;
1847 pub const KERN_PROC_PID: ::c_int = 1;
1848 pub const KERN_PROC_PGRP: ::c_int = 2;
1849 pub const KERN_PROC_SESSION: ::c_int = 3;
1850 pub const KERN_PROC_TTY: ::c_int = 4;
1851 pub const KERN_PROC_UID: ::c_int = 5;
1852 pub const KERN_PROC_RUID: ::c_int = 6;
1853 pub const KERN_PROC_LCID: ::c_int = 7;
1854 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
1855 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
1856 pub const KIPC_SOMAXCONN: ::c_int = 3;
1857 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
1858 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
1859 pub const KIPC_MAX_HDR: ::c_int = 6;
1860 pub const KIPC_MAX_DATALEN: ::c_int = 7;
1861 pub const KIPC_MBSTAT: ::c_int = 8;
1862 pub const KIPC_NMBCLUSTERS: ::c_int = 9;
1863 pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10;
1864 pub const VM_METER: ::c_int = 1;
1865 pub const VM_LOADAVG: ::c_int = 2;
1866 pub const VM_MACHFACTOR: ::c_int = 4;
1867 pub const VM_SWAPUSAGE: ::c_int = 5;
1868 pub const VM_MAXID: ::c_int = 6;
1869 pub const HW_MACHINE: ::c_int = 1;
1870 pub const HW_MODEL: ::c_int = 2;
1871 pub const HW_NCPU: ::c_int = 3;
1872 pub const HW_BYTEORDER: ::c_int = 4;
1873 pub const HW_PHYSMEM: ::c_int = 5;
1874 pub const HW_USERMEM: ::c_int = 6;
1875 pub const HW_PAGESIZE: ::c_int = 7;
1876 pub const HW_DISKNAMES: ::c_int = 8;
1877 pub const HW_DISKSTATS: ::c_int = 9;
1878 pub const HW_EPOCH: ::c_int = 10;
1879 pub const HW_FLOATINGPT: ::c_int = 11;
1880 pub const HW_MACHINE_ARCH: ::c_int = 12;
1881 pub const HW_VECTORUNIT: ::c_int = 13;
1882 pub const HW_BUS_FREQ: ::c_int = 14;
1883 pub const HW_CPU_FREQ: ::c_int = 15;
1884 pub const HW_CACHELINE: ::c_int = 16;
1885 pub const HW_L1ICACHESIZE: ::c_int = 17;
1886 pub const HW_L1DCACHESIZE: ::c_int = 18;
1887 pub const HW_L2SETTINGS: ::c_int = 19;
1888 pub const HW_L2CACHESIZE: ::c_int = 20;
1889 pub const HW_L3SETTINGS: ::c_int = 21;
1890 pub const HW_L3CACHESIZE: ::c_int = 22;
1891 pub const HW_TB_FREQ: ::c_int = 23;
1892 pub const HW_MEMSIZE: ::c_int = 24;
1893 pub const HW_AVAILCPU: ::c_int = 25;
1894 pub const HW_MAXID: ::c_int = 26;
1895 pub const USER_CS_PATH: ::c_int = 1;
1896 pub const USER_BC_BASE_MAX: ::c_int = 2;
1897 pub const USER_BC_DIM_MAX: ::c_int = 3;
1898 pub const USER_BC_SCALE_MAX: ::c_int = 4;
1899 pub const USER_BC_STRING_MAX: ::c_int = 5;
1900 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
1901 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
1902 pub const USER_LINE_MAX: ::c_int = 8;
1903 pub const USER_RE_DUP_MAX: ::c_int = 9;
1904 pub const USER_POSIX2_VERSION: ::c_int = 10;
1905 pub const USER_POSIX2_C_BIND: ::c_int = 11;
1906 pub const USER_POSIX2_C_DEV: ::c_int = 12;
1907 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
1908 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
1909 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
1910 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
1911 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
1912 pub const USER_POSIX2_UPE: ::c_int = 18;
1913 pub const USER_STREAM_MAX: ::c_int = 19;
1914 pub const USER_TZNAME_MAX: ::c_int = 20;
1915 pub const USER_MAXID: ::c_int = 21;
1916 pub const CTL_DEBUG_NAME: ::c_int = 0;
1917 pub const CTL_DEBUG_VALUE: ::c_int = 1;
1918 pub const CTL_DEBUG_MAXID: ::c_int = 20;
1919
1920 pub const PRIO_DARWIN_THREAD: ::c_int = 3;
1921 pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
1922 pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
1923 pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
1924
1925 pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
1926
1927 pub const SIGEV_NONE: ::c_int = 0;
1928 pub const SIGEV_SIGNAL: ::c_int = 1;
1929 pub const SIGEV_THREAD: ::c_int = 3;
1930
1931 pub const AIO_CANCELED: ::c_int = 2;
1932 pub const AIO_NOTCANCELED: ::c_int = 4;
1933 pub const AIO_ALLDONE: ::c_int = 1;
1934 pub const AIO_LISTIO_MAX: ::c_int = 16;
1935 pub const LIO_NOP: ::c_int = 0;
1936 pub const LIO_WRITE: ::c_int = 2;
1937 pub const LIO_READ: ::c_int = 1;
1938 pub const LIO_WAIT: ::c_int = 2;
1939 pub const LIO_NOWAIT: ::c_int = 1;
1940
1941 pub const WEXITED: ::c_int = 0x00000004;
1942 pub const WSTOPPED: ::c_int = 0x00000008;
1943 pub const WCONTINUED: ::c_int = 0x00000010;
1944 pub const WNOWAIT: ::c_int = 0x00000020;
1945
1946 pub const P_ALL: idtype_t = 0;
1947 pub const P_PID: idtype_t = 1;
1948 pub const P_PGID: idtype_t = 2;
1949
1950 pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
1951 pub const XATTR_CREATE: ::c_int = 0x0002;
1952 pub const XATTR_REPLACE: ::c_int = 0x0004;
1953 pub const XATTR_NOSECURITY: ::c_int = 0x0008;
1954 pub const XATTR_NODEFAULT: ::c_int = 0x0010;
1955 pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
1956
1957 pub const NET_RT_IFLIST2: ::c_int = 0x0006;
1958 pub const RTM_IFINFO2: ::c_int = 0x0012;
1959
1960 pub const KERN_PROCARGS2: ::c_int = 49;
1961
1962 pub const PROC_PIDTASKALLINFO: ::c_int = 2;
1963 pub const PROC_PIDTASKINFO: ::c_int = 4;
1964 pub const PROC_PIDTHREADINFO: ::c_int = 5;
1965 pub const MAXCOMLEN: usize = 16;
1966 pub const MAXTHREADNAMESIZE: usize = 64;
1967
1968 pub const XUCRED_VERSION: ::c_uint = 0;
1969
1970 f! {
1971 pub fn WSTOPSIG(status: ::c_int) -> ::c_int {
1972 status >> 8
1973 }
1974
1975 pub fn _WSTATUS(status: ::c_int) -> ::c_int {
1976 status & 0x7f
1977 }
1978
1979 pub fn WIFCONTINUED(status: ::c_int) -> bool {
1980 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
1981 }
1982
1983 pub fn WIFSIGNALED(status: ::c_int) -> bool {
1984 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
1985 }
1986
1987 pub fn WIFSTOPPED(status: ::c_int) -> bool {
1988 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
1989 }
1990 }
1991
1992 extern {
1993 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
1994 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
1995 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
1996 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
1997 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
1998 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
1999 link_name = "aio_suspend$UNIX2003")]
2000 pub fn aio_suspend(aiocb_list: *const *const aiocb, nitems: ::c_int,
2001 timeout: *const ::timespec) -> ::c_int;
2002 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
2003 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
2004 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
2005 pub fn lio_listio(mode: ::c_int, aiocb_list: *const *mut aiocb,
2006 nitems: ::c_int, sevp: *mut sigevent) -> ::c_int;
2007
2008 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
2009
2010 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
2011
2012 pub fn getutxent() -> *mut utmpx;
2013 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
2014 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
2015 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
2016 pub fn setutxent();
2017 pub fn endutxent();
2018 pub fn utmpxname(file: *const ::c_char) -> ::c_int;
2019
2020 pub fn getnameinfo(sa: *const ::sockaddr,
2021 salen: ::socklen_t,
2022 host: *mut ::c_char,
2023 hostlen: ::socklen_t,
2024 serv: *mut ::c_char,
2025 sevlen: ::socklen_t,
2026 flags: ::c_int) -> ::c_int;
2027 pub fn mincore(addr: *const ::c_void, len: ::size_t,
2028 vec: *mut ::c_char) -> ::c_int;
2029 pub fn sysctlnametomib(name: *const ::c_char,
2030 mibp: *mut ::c_int,
2031 sizep: *mut ::size_t)
2032 -> ::c_int;
2033 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2034 link_name = "mprotect$UNIX2003")]
2035 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int)
2036 -> ::c_int;
2037 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
2038 pub fn sysctl(name: *mut ::c_int,
2039 namelen: ::c_uint,
2040 oldp: *mut ::c_void,
2041 oldlenp: *mut ::size_t,
2042 newp: *mut ::c_void,
2043 newlen: ::size_t)
2044 -> ::c_int;
2045 pub fn sysctlbyname(name: *const ::c_char,
2046 oldp: *mut ::c_void,
2047 oldlenp: *mut ::size_t,
2048 newp: *mut ::c_void,
2049 newlen: ::size_t)
2050 -> ::c_int;
2051 pub fn mach_absolute_time() -> u64;
2052 pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
2053 pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
2054 pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
2055 pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
2056 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t,
2057 pshared: ::c_int) -> ::c_int;
2058 pub fn pthread_condattr_getpshared(attr: *const pthread_condattr_t,
2059 pshared: *mut ::c_int) -> ::c_int;
2060 pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t,
2061 pshared: ::c_int) -> ::c_int;
2062 pub fn pthread_mutexattr_getpshared(attr: *const pthread_mutexattr_t,
2063 pshared: *mut ::c_int) -> ::c_int;
2064 pub fn pthread_rwlockattr_getpshared(attr: *const pthread_rwlockattr_t,
2065 val: *mut ::c_int) -> ::c_int;
2066 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t,
2067 val: ::c_int) -> ::c_int;
2068 pub fn __error() -> *mut ::c_int;
2069 pub fn backtrace(buf: *mut *mut ::c_void,
2070 sz: ::c_int) -> ::c_int;
2071 #[cfg_attr(target_os = "macos", link_name = "statfs$INODE64")]
2072 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
2073 #[cfg_attr(target_os = "macos", link_name = "fstatfs$INODE64")]
2074 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
2075 pub fn kevent(kq: ::c_int,
2076 changelist: *const ::kevent,
2077 nchanges: ::c_int,
2078 eventlist: *mut ::kevent,
2079 nevents: ::c_int,
2080 timeout: *const ::timespec) -> ::c_int;
2081 pub fn kevent64(kq: ::c_int,
2082 changelist: *const ::kevent64_s,
2083 nchanges: ::c_int,
2084 eventlist: *mut ::kevent64_s,
2085 nevents: ::c_int,
2086 flags: ::c_uint,
2087 timeout: *const ::timespec) -> ::c_int;
2088 pub fn mount(src: *const ::c_char,
2089 target: *const ::c_char,
2090 flags: ::c_int,
2091 data: *mut ::c_void) -> ::c_int;
2092 pub fn ptrace(request: ::c_int,
2093 pid: ::pid_t,
2094 addr: *mut ::c_char,
2095 data: ::c_int) -> ::c_int;
2096 pub fn quotactl(special: *const ::c_char,
2097 cmd: ::c_int,
2098 id: ::c_int,
2099 data: *mut ::c_char) -> ::c_int;
2100 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
2101 pub fn sendfile(fd: ::c_int,
2102 s: ::c_int,
2103 offset: ::off_t,
2104 len: *mut ::off_t,
2105 hdtr: *mut ::sf_hdtr,
2106 flags: ::c_int) -> ::c_int;
2107 pub fn openpty(amaster: *mut ::c_int,
2108 aslave: *mut ::c_int,
2109 name: *mut ::c_char,
2110 termp: *mut termios,
2111 winp: *mut ::winsize) -> ::c_int;
2112 pub fn forkpty(amaster: *mut ::c_int,
2113 name: *mut ::c_char,
2114 termp: *mut termios,
2115 winp: *mut ::winsize) -> ::pid_t;
2116 pub fn duplocale(base: ::locale_t) -> ::locale_t;
2117 pub fn freelocale(loc: ::locale_t) -> ::c_int;
2118 pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
2119 pub fn newlocale(mask: ::c_int,
2120 locale: *const ::c_char,
2121 base: ::locale_t) -> ::locale_t;
2122 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
2123 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
2124 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
2125 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
2126
2127 pub fn getxattr(path: *const ::c_char, name: *const ::c_char,
2128 value: *mut ::c_void, size: ::size_t, position: u32,
2129 flags: ::c_int) -> ::ssize_t;
2130 pub fn fgetxattr(filedes: ::c_int, name: *const ::c_char,
2131 value: *mut ::c_void, size: ::size_t, position: u32,
2132 flags: ::c_int) -> ::ssize_t;
2133 pub fn setxattr(path: *const ::c_char, name: *const ::c_char,
2134 value: *const ::c_void, size: ::size_t, position: u32,
2135 flags: ::c_int) -> ::c_int;
2136 pub fn fsetxattr(filedes: ::c_int, name: *const ::c_char,
2137 value: *const ::c_void, size: ::size_t, position: u32,
2138 flags: ::c_int) -> ::c_int;
2139 pub fn listxattr(path: *const ::c_char, list: *mut ::c_char,
2140 size: ::size_t, flags: ::c_int) -> ::ssize_t;
2141 pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char,
2142 size: ::size_t, flags: ::c_int) -> ::ssize_t;
2143 pub fn removexattr(path: *const ::c_char, name: *const ::c_char,
2144 flags: ::c_int) -> ::c_int;
2145 pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char,
2146 flags: ::c_int) -> ::c_int;
2147
2148 pub fn getgrouplist(name: *const ::c_char,
2149 basegid: ::c_int,
2150 groups: *mut ::c_int,
2151 ngroups: *mut ::c_int) -> ::c_int;
2152 pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
2153
2154 #[cfg_attr(all(target_os = "macos", target_arch = "x86"),
2155 link_name = "waitid$UNIX2003")]
2156 pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t,
2157 options: ::c_int) -> ::c_int;
2158 pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
2159 pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
2160 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
2161 }
2162
2163 cfg_if! {
2164 if #[cfg(any(target_arch = "arm", target_arch = "x86"))] {
2165 mod b32;
2166 pub use self::b32::*;
2167 } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
2168 mod b64;
2169 pub use self::b64::*;
2170 } else {
2171 // Unknown target_arch
2172 }
2173 }