]> git.proxmox.com Git - rustc.git/blob - vendor/libc/src/unix/bsd/apple/mod.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / vendor / libc / src / unix / bsd / apple / mod.rs
1 //! Apple (ios/darwin)-specific definitions
2 //!
3 //! This covers *-apple-* triples currently
4 pub type c_char = i8;
5 pub type wchar_t = i32;
6 pub type clock_t = c_ulong;
7 pub type time_t = c_long;
8 pub type suseconds_t = i32;
9 pub type dev_t = i32;
10 pub type ino_t = u64;
11 pub type mode_t = u16;
12 pub type nlink_t = u16;
13 pub type blksize_t = i32;
14 pub type rlim_t = u64;
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 pub type integer_t = ::c_int;
27 pub type cpu_type_t = integer_t;
28 pub type cpu_subtype_t = integer_t;
29 pub type natural_t = u32;
30 pub type mach_msg_type_number_t = natural_t;
31 pub type kern_return_t = ::c_int;
32 pub type uuid_t = [u8; 16];
33
34 pub type posix_spawnattr_t = *mut ::c_void;
35 pub type posix_spawn_file_actions_t = *mut ::c_void;
36 pub type key_t = ::c_int;
37 pub type shmatt_t = ::c_ushort;
38
39 pub type sae_associd_t = u32;
40 pub type sae_connid_t = u32;
41
42 pub type mach_port_t = ::c_uint;
43 pub type processor_flavor_t = ::c_int;
44 pub type thread_flavor_t = natural_t;
45 pub type thread_inspect_t = mach_port_t;
46 pub type policy_t = ::c_int;
47 pub type mach_vm_address_t = u64;
48 pub type mach_vm_offset_t = u64;
49 pub type mach_vm_size_t = u64;
50 pub type vm_map_t = ::mach_port_t;
51 pub type mem_entry_name_port_t = ::mach_port_t;
52 pub type memory_object_t = ::mach_port_t;
53 pub type memory_object_offset_t = ::c_ulonglong;
54 pub type vm_inherit_t = ::c_uint;
55 pub type vm_prot_t = ::c_int;
56
57 pub type iconv_t = *mut ::c_void;
58
59 pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
60 pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
61 pub type processor_basic_info_t = *mut processor_basic_info;
62 pub type processor_basic_info_data_t = processor_basic_info;
63 pub type processor_set_basic_info_data_t = processor_set_basic_info;
64 pub type processor_set_basic_info_t = *mut processor_set_basic_info;
65 pub type processor_set_load_info_data_t = processor_set_load_info;
66 pub type processor_set_load_info_t = *mut processor_set_load_info;
67 pub type processor_info_t = *mut integer_t;
68 pub type processor_info_array_t = *mut integer_t;
69
70 pub type thread_info_t = *mut integer_t;
71 pub type thread_basic_info_t = *mut thread_basic_info;
72 pub type thread_basic_info_data_t = thread_basic_info;
73 pub type thread_identifier_info_t = *mut thread_identifier_info;
74 pub type thread_identifier_info_data_t = thread_identifier_info;
75 pub type thread_extended_info_t = *mut thread_extended_info;
76 pub type thread_extended_info_data_t = thread_extended_info;
77
78 pub type thread_t = mach_port_t;
79 pub type thread_policy_flavor_t = natural_t;
80 pub type thread_policy_t = *mut integer_t;
81 pub type thread_latency_qos_t = integer_t;
82 pub type thread_throughput_qos_t = integer_t;
83 pub type thread_standard_policy_data_t = thread_standard_policy;
84 pub type thread_standard_policy_t = *mut thread_standard_policy;
85 pub type thread_extended_policy_data_t = thread_extended_policy;
86 pub type thread_extended_policy_t = *mut thread_extended_policy;
87 pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
88 pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
89 pub type thread_precedence_policy_data_t = thread_precedence_policy;
90 pub type thread_precedence_policy_t = *mut thread_precedence_policy;
91 pub type thread_affinity_policy_data_t = thread_affinity_policy;
92 pub type thread_affinity_policy_t = *mut thread_affinity_policy;
93 pub type thread_background_policy_data_t = thread_background_policy;
94 pub type thread_background_policy_t = *mut thread_background_policy;
95 pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
96 pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
97 pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
98 pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
99
100 pub type CCStatus = i32;
101 pub type CCCryptorStatus = i32;
102 pub type CCRNGStatus = ::CCCryptorStatus;
103
104 deprecated_mach! {
105 pub type vm_size_t = ::uintptr_t;
106 pub type mach_timebase_info_data_t = mach_timebase_info;
107 }
108
109 #[cfg_attr(feature = "extra_traits", derive(Debug))]
110 pub enum timezone {}
111 impl ::Copy for timezone {}
112 impl ::Clone for timezone {
113 fn clone(&self) -> timezone {
114 *self
115 }
116 }
117
118 #[cfg_attr(feature = "extra_traits", derive(Debug))]
119 #[repr(u32)]
120 pub enum qos_class_t {
121 QOS_CLASS_USER_INTERACTIVE = 0x21,
122 QOS_CLASS_USER_INITIATED = 0x19,
123 QOS_CLASS_DEFAULT = 0x15,
124 QOS_CLASS_UTILITY = 0x11,
125 QOS_CLASS_BACKGROUND = 0x09,
126 QOS_CLASS_UNSPECIFIED = 0x00,
127 }
128 impl ::Copy for qos_class_t {}
129 impl ::Clone for qos_class_t {
130 fn clone(&self) -> qos_class_t {
131 *self
132 }
133 }
134
135 s! {
136 pub struct ip_mreq {
137 pub imr_multiaddr: in_addr,
138 pub imr_interface: in_addr,
139 }
140
141 pub struct aiocb {
142 pub aio_fildes: ::c_int,
143 pub aio_offset: ::off_t,
144 pub aio_buf: *mut ::c_void,
145 pub aio_nbytes: ::size_t,
146 pub aio_reqprio: ::c_int,
147 pub aio_sigevent: sigevent,
148 pub aio_lio_opcode: ::c_int
149 }
150
151 pub struct glob_t {
152 pub gl_pathc: ::size_t,
153 __unused1: ::c_int,
154 pub gl_offs: ::size_t,
155 __unused2: ::c_int,
156 pub gl_pathv: *mut *mut ::c_char,
157
158 __unused3: *mut ::c_void,
159
160 __unused4: *mut ::c_void,
161 __unused5: *mut ::c_void,
162 __unused6: *mut ::c_void,
163 __unused7: *mut ::c_void,
164 __unused8: *mut ::c_void,
165 }
166
167 pub struct addrinfo {
168 pub ai_flags: ::c_int,
169 pub ai_family: ::c_int,
170 pub ai_socktype: ::c_int,
171 pub ai_protocol: ::c_int,
172 pub ai_addrlen: ::socklen_t,
173 pub ai_canonname: *mut ::c_char,
174 pub ai_addr: *mut ::sockaddr,
175 pub ai_next: *mut addrinfo,
176 }
177
178 #[deprecated(
179 since = "0.2.55",
180 note = "Use the `mach` crate instead",
181 )]
182 pub struct mach_timebase_info {
183 pub numer: u32,
184 pub denom: u32,
185 }
186
187 pub struct stat {
188 pub st_dev: dev_t,
189 pub st_mode: mode_t,
190 pub st_nlink: nlink_t,
191 pub st_ino: ino_t,
192 pub st_uid: ::uid_t,
193 pub st_gid: ::gid_t,
194 pub st_rdev: dev_t,
195 pub st_atime: time_t,
196 pub st_atime_nsec: c_long,
197 pub st_mtime: time_t,
198 pub st_mtime_nsec: c_long,
199 pub st_ctime: time_t,
200 pub st_ctime_nsec: c_long,
201 pub st_birthtime: time_t,
202 pub st_birthtime_nsec: c_long,
203 pub st_size: ::off_t,
204 pub st_blocks: ::blkcnt_t,
205 pub st_blksize: blksize_t,
206 pub st_flags: u32,
207 pub st_gen: u32,
208 pub st_lspare: i32,
209 pub st_qspare: [i64; 2],
210 }
211
212 pub struct pthread_mutexattr_t {
213 __sig: ::c_long,
214 __opaque: [u8; 8],
215 }
216
217 pub struct pthread_condattr_t {
218 __sig: ::c_long,
219 __opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
220 }
221
222 pub struct pthread_rwlockattr_t {
223 __sig: ::c_long,
224 __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
225 }
226
227 pub struct siginfo_t {
228 pub si_signo: ::c_int,
229 pub si_errno: ::c_int,
230 pub si_code: ::c_int,
231 pub si_pid: ::pid_t,
232 pub si_uid: ::uid_t,
233 pub si_status: ::c_int,
234 pub si_addr: *mut ::c_void,
235 //Requires it to be union for tests
236 //pub si_value: ::sigval,
237 _pad: [usize; 9],
238 }
239
240 pub struct sigaction {
241 // FIXME: this field is actually a union
242 pub sa_sigaction: ::sighandler_t,
243 pub sa_mask: sigset_t,
244 pub sa_flags: ::c_int,
245 }
246
247 pub struct stack_t {
248 pub ss_sp: *mut ::c_void,
249 pub ss_size: ::size_t,
250 pub ss_flags: ::c_int,
251 }
252
253 pub struct fstore_t {
254 pub fst_flags: ::c_uint,
255 pub fst_posmode: ::c_int,
256 pub fst_offset: ::off_t,
257 pub fst_length: ::off_t,
258 pub fst_bytesalloc: ::off_t,
259 }
260
261 pub struct radvisory {
262 pub ra_offset: ::off_t,
263 pub ra_count: ::c_int,
264 }
265
266 pub struct statvfs {
267 pub f_bsize: ::c_ulong,
268 pub f_frsize: ::c_ulong,
269 pub f_blocks: ::fsblkcnt_t,
270 pub f_bfree: ::fsblkcnt_t,
271 pub f_bavail: ::fsblkcnt_t,
272 pub f_files: ::fsfilcnt_t,
273 pub f_ffree: ::fsfilcnt_t,
274 pub f_favail: ::fsfilcnt_t,
275 pub f_fsid: ::c_ulong,
276 pub f_flag: ::c_ulong,
277 pub f_namemax: ::c_ulong,
278 }
279
280 pub struct Dl_info {
281 pub dli_fname: *const ::c_char,
282 pub dli_fbase: *mut ::c_void,
283 pub dli_sname: *const ::c_char,
284 pub dli_saddr: *mut ::c_void,
285 }
286
287 pub struct sockaddr_in {
288 pub sin_len: u8,
289 pub sin_family: ::sa_family_t,
290 pub sin_port: ::in_port_t,
291 pub sin_addr: ::in_addr,
292 pub sin_zero: [::c_char; 8],
293 }
294
295 pub struct kevent64_s {
296 pub ident: u64,
297 pub filter: i16,
298 pub flags: u16,
299 pub fflags: u32,
300 pub data: i64,
301 pub udata: u64,
302 pub ext: [u64; 2],
303 }
304
305 pub struct dqblk {
306 pub dqb_bhardlimit: u64,
307 pub dqb_bsoftlimit: u64,
308 pub dqb_curbytes: u64,
309 pub dqb_ihardlimit: u32,
310 pub dqb_isoftlimit: u32,
311 pub dqb_curinodes: u32,
312 pub dqb_btime: u32,
313 pub dqb_itime: u32,
314 pub dqb_id: u32,
315 pub dqb_spare: [u32; 4],
316 }
317
318 pub struct if_msghdr {
319 pub ifm_msglen: ::c_ushort,
320 pub ifm_version: ::c_uchar,
321 pub ifm_type: ::c_uchar,
322 pub ifm_addrs: ::c_int,
323 pub ifm_flags: ::c_int,
324 pub ifm_index: ::c_ushort,
325 pub ifm_data: if_data,
326 }
327
328 pub struct termios {
329 pub c_iflag: ::tcflag_t,
330 pub c_oflag: ::tcflag_t,
331 pub c_cflag: ::tcflag_t,
332 pub c_lflag: ::tcflag_t,
333 pub c_cc: [::cc_t; ::NCCS],
334 pub c_ispeed: ::speed_t,
335 pub c_ospeed: ::speed_t,
336 }
337
338 pub struct flock {
339 pub l_start: ::off_t,
340 pub l_len: ::off_t,
341 pub l_pid: ::pid_t,
342 pub l_type: ::c_short,
343 pub l_whence: ::c_short,
344 }
345
346 pub struct sf_hdtr {
347 pub headers: *mut ::iovec,
348 pub hdr_cnt: ::c_int,
349 pub trailers: *mut ::iovec,
350 pub trl_cnt: ::c_int,
351 }
352
353 pub struct lconv {
354 pub decimal_point: *mut ::c_char,
355 pub thousands_sep: *mut ::c_char,
356 pub grouping: *mut ::c_char,
357 pub int_curr_symbol: *mut ::c_char,
358 pub currency_symbol: *mut ::c_char,
359 pub mon_decimal_point: *mut ::c_char,
360 pub mon_thousands_sep: *mut ::c_char,
361 pub mon_grouping: *mut ::c_char,
362 pub positive_sign: *mut ::c_char,
363 pub negative_sign: *mut ::c_char,
364 pub int_frac_digits: ::c_char,
365 pub frac_digits: ::c_char,
366 pub p_cs_precedes: ::c_char,
367 pub p_sep_by_space: ::c_char,
368 pub n_cs_precedes: ::c_char,
369 pub n_sep_by_space: ::c_char,
370 pub p_sign_posn: ::c_char,
371 pub n_sign_posn: ::c_char,
372 pub int_p_cs_precedes: ::c_char,
373 pub int_n_cs_precedes: ::c_char,
374 pub int_p_sep_by_space: ::c_char,
375 pub int_n_sep_by_space: ::c_char,
376 pub int_p_sign_posn: ::c_char,
377 pub int_n_sign_posn: ::c_char,
378 }
379
380 pub struct proc_taskinfo {
381 pub pti_virtual_size: u64,
382 pub pti_resident_size: u64,
383 pub pti_total_user: u64,
384 pub pti_total_system: u64,
385 pub pti_threads_user: u64,
386 pub pti_threads_system: u64,
387 pub pti_policy: i32,
388 pub pti_faults: i32,
389 pub pti_pageins: i32,
390 pub pti_cow_faults: i32,
391 pub pti_messages_sent: i32,
392 pub pti_messages_received: i32,
393 pub pti_syscalls_mach: i32,
394 pub pti_syscalls_unix: i32,
395 pub pti_csw: i32,
396 pub pti_threadnum: i32,
397 pub pti_numrunning: i32,
398 pub pti_priority: i32,
399 }
400
401 pub struct proc_bsdinfo {
402 pub pbi_flags: u32,
403 pub pbi_status: u32,
404 pub pbi_xstatus: u32,
405 pub pbi_pid: u32,
406 pub pbi_ppid: u32,
407 pub pbi_uid: ::uid_t,
408 pub pbi_gid: ::gid_t,
409 pub pbi_ruid: ::uid_t,
410 pub pbi_rgid: ::gid_t,
411 pub pbi_svuid: ::uid_t,
412 pub pbi_svgid: ::gid_t,
413 pub rfu_1: u32,
414 pub pbi_comm: [::c_char; MAXCOMLEN],
415 pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy...
416 pub pbi_nfiles: u32,
417 pub pbi_pgid: u32,
418 pub pbi_pjobc: u32,
419 pub e_tdev: u32,
420 pub e_tpgid: u32,
421 pub pbi_nice: i32,
422 pub pbi_start_tvsec: u64,
423 pub pbi_start_tvusec: u64,
424 }
425
426 pub struct proc_taskallinfo {
427 pub pbsd: proc_bsdinfo,
428 pub ptinfo: proc_taskinfo,
429 }
430
431 pub struct xsw_usage {
432 pub xsu_total: u64,
433 pub xsu_avail: u64,
434 pub xsu_used: u64,
435 pub xsu_pagesize: u32,
436 pub xsu_encrypted: ::boolean_t,
437 }
438
439 pub struct xucred {
440 pub cr_version: ::c_uint,
441 pub cr_uid: ::uid_t,
442 pub cr_ngroups: ::c_short,
443 pub cr_groups: [::gid_t;16]
444 }
445
446 #[deprecated(
447 since = "0.2.55",
448 note = "Use the `mach` crate instead",
449 )]
450 pub struct mach_header {
451 pub magic: u32,
452 pub cputype: cpu_type_t,
453 pub cpusubtype: cpu_subtype_t,
454 pub filetype: u32,
455 pub ncmds: u32,
456 pub sizeofcmds: u32,
457 pub flags: u32,
458 }
459
460 #[deprecated(
461 since = "0.2.55",
462 note = "Use the `mach` crate instead",
463 )]
464 pub struct mach_header_64 {
465 pub magic: u32,
466 pub cputype: cpu_type_t,
467 pub cpusubtype: cpu_subtype_t,
468 pub filetype: u32,
469 pub ncmds: u32,
470 pub sizeofcmds: u32,
471 pub flags: u32,
472 pub reserved: u32,
473 }
474
475 pub struct segment_command {
476 pub cmd: u32,
477 pub cmdsize: u32,
478 pub segname: [::c_char; 16],
479 pub vmaddr: u32,
480 pub vmsize: u32,
481 pub fileoff: u32,
482 pub filesize: u32,
483 pub maxprot: vm_prot_t,
484 pub initprot: vm_prot_t,
485 pub nsects: u32,
486 pub flags: u32,
487 }
488
489 pub struct segment_command_64 {
490 pub cmd: u32,
491 pub cmdsize: u32,
492 pub segname: [::c_char; 16],
493 pub vmaddr: u64,
494 pub vmsize: u64,
495 pub fileoff: u64,
496 pub filesize: u64,
497 pub maxprot: vm_prot_t,
498 pub initprot: vm_prot_t,
499 pub nsects: u32,
500 pub flags: u32,
501 }
502
503 pub struct load_command {
504 pub cmd: u32,
505 pub cmdsize: u32,
506 }
507
508 pub struct sockaddr_dl {
509 pub sdl_len: ::c_uchar,
510 pub sdl_family: ::c_uchar,
511 pub sdl_index: ::c_ushort,
512 pub sdl_type: ::c_uchar,
513 pub sdl_nlen: ::c_uchar,
514 pub sdl_alen: ::c_uchar,
515 pub sdl_slen: ::c_uchar,
516 pub sdl_data: [::c_char; 12],
517 }
518
519 pub struct sockaddr_inarp {
520 pub sin_len: ::c_uchar,
521 pub sin_family: ::c_uchar,
522 pub sin_port: ::c_ushort,
523 pub sin_addr: ::in_addr,
524 pub sin_srcaddr: ::in_addr,
525 pub sin_tos: ::c_ushort,
526 pub sin_other: ::c_ushort,
527 }
528
529 pub struct sockaddr_ctl {
530 pub sc_len: ::c_uchar,
531 pub sc_family: ::c_uchar,
532 pub ss_sysaddr: u16,
533 pub sc_id: u32,
534 pub sc_unit: u32,
535 pub sc_reserved: [u32; 5],
536 }
537
538 pub struct in_pktinfo {
539 pub ipi_ifindex: ::c_uint,
540 pub ipi_spec_dst: ::in_addr,
541 pub ipi_addr: ::in_addr,
542 }
543
544 pub struct in6_pktinfo {
545 pub ipi6_addr: ::in6_addr,
546 pub ipi6_ifindex: ::c_uint,
547 }
548
549 // sys/ipc.h:
550
551 pub struct ipc_perm {
552 pub uid: ::uid_t,
553 pub gid: ::gid_t,
554 pub cuid: ::uid_t,
555 pub cgid: ::gid_t,
556 pub mode: ::mode_t,
557 pub _seq: ::c_ushort,
558 pub _key: ::key_t,
559 }
560
561 // sys/sem.h
562
563 pub struct sembuf {
564 pub sem_num: ::c_ushort,
565 pub sem_op: ::c_short,
566 pub sem_flg: ::c_short,
567 }
568
569 // sys/shm.h
570
571 pub struct arphdr {
572 pub ar_hrd: u16,
573 pub ar_pro: u16,
574 pub ar_hln: u8,
575 pub ar_pln: u8,
576 pub ar_op: u16,
577 }
578
579 pub struct in_addr {
580 pub s_addr: ::in_addr_t,
581 }
582
583 // sys/socket.h
584
585 pub struct sa_endpoints_t {
586 pub sae_srcif: ::c_uint, // optional source interface
587 pub sae_srcaddr: *const ::sockaddr, // optional source address
588 pub sae_srcaddrlen: ::socklen_t, // size of source address
589 pub sae_dstaddr: *const ::sockaddr, // destination address
590 pub sae_dstaddrlen: ::socklen_t, // size of destination address
591 }
592
593 pub struct timex {
594 pub modes: ::c_uint,
595 pub offset: ::c_long,
596 pub freq: ::c_long,
597 pub maxerror: ::c_long,
598 pub esterror: ::c_long,
599 pub status: ::c_int,
600 pub constant: ::c_long,
601 pub precision: ::c_long,
602 pub tolerance: ::c_long,
603 pub ppsfreq: ::c_long,
604 pub jitter: ::c_long,
605 pub shift: ::c_int,
606 pub stabil: ::c_long,
607 pub jitcnt: ::c_long,
608 pub calcnt: ::c_long,
609 pub errcnt: ::c_long,
610 pub stbcnt: ::c_long,
611 }
612
613 pub struct ntptimeval {
614 pub time: ::timespec,
615 pub maxerror: ::c_long,
616 pub esterror: ::c_long,
617 pub tai: ::c_long,
618 pub time_state: ::c_int,
619 }
620
621 pub struct thread_standard_policy {
622 pub no_data: natural_t,
623 }
624
625 pub struct thread_extended_policy {
626 pub timeshare: boolean_t,
627 }
628
629 pub struct thread_time_constraint_policy {
630 pub period: u32,
631 pub computation: u32,
632 pub constraint: u32,
633 pub preemptible: boolean_t,
634 }
635
636 pub struct thread_precedence_policy {
637 pub importance: integer_t,
638 }
639
640 pub struct thread_affinity_policy {
641 pub affinity_tag: integer_t,
642 }
643
644 pub struct thread_background_policy {
645 pub priority: integer_t,
646 }
647
648 pub struct thread_latency_qos_policy {
649 pub thread_latency_qos_tier: thread_latency_qos_t,
650 }
651
652 pub struct thread_throughput_qos_policy {
653 pub thread_throughput_qos_tier: thread_throughput_qos_t,
654 }
655
656 // malloc/malloc.h
657 pub struct malloc_statistics_t {
658 pub blocks_in_use: ::c_uint,
659 pub size_in_use: ::size_t,
660 pub max_size_in_use: ::size_t,
661 pub size_allocated: ::size_t,
662 }
663
664 pub struct mstats {
665 pub bytes_total: ::size_t,
666 pub chunks_used: ::size_t,
667 pub bytes_used: ::size_t,
668 pub chunks_free: ::size_t,
669 pub bytes_free: ::size_t,
670 }
671
672 pub struct malloc_zone_t {
673 __private: [::uintptr_t; 18], // FIXME: keeping private for now
674 }
675
676 // sched.h
677 pub struct sched_param {
678 pub sched_priority: ::c_int,
679 __opaque: [::c_char; 4],
680 }
681 }
682
683 s_no_extra_traits! {
684 #[cfg_attr(libc_packedN, repr(packed(4)))]
685 pub struct kevent {
686 pub ident: ::uintptr_t,
687 pub filter: i16,
688 pub flags: u16,
689 pub fflags: u32,
690 pub data: ::intptr_t,
691 pub udata: *mut ::c_void,
692 }
693
694 #[cfg_attr(libc_packedN, repr(packed(4)))]
695 pub struct semid_ds {
696 // Note the manpage shows different types than the system header.
697 pub sem_perm: ipc_perm,
698 pub sem_base: i32,
699 pub sem_nsems: ::c_ushort,
700 pub sem_otime: ::time_t,
701 pub sem_pad1: i32,
702 pub sem_ctime: ::time_t,
703 pub sem_pad2: i32,
704 pub sem_pad3: [i32; 4],
705 }
706
707 #[cfg_attr(libc_packedN, repr(packed(4)))]
708 pub struct shmid_ds {
709 pub shm_perm: ipc_perm,
710 pub shm_segsz: ::size_t,
711 pub shm_lpid: ::pid_t,
712 pub shm_cpid: ::pid_t,
713 pub shm_nattch: ::shmatt_t,
714 pub shm_atime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
715 pub shm_dtime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
716 pub shm_ctime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
717 // FIXME: 64-bit wrong align => wrong offset:
718 pub shm_internal: *mut ::c_void,
719 }
720
721 pub struct proc_threadinfo {
722 pub pth_user_time: u64,
723 pub pth_system_time: u64,
724 pub pth_cpu_usage: i32,
725 pub pth_policy: i32,
726 pub pth_run_state: i32,
727 pub pth_flags: i32,
728 pub pth_sleep_time: i32,
729 pub pth_curpri: i32,
730 pub pth_priority: i32,
731 pub pth_maxpriority: i32,
732 pub pth_name: [::c_char; MAXTHREADNAMESIZE],
733 }
734
735 pub struct statfs {
736 pub f_bsize: u32,
737 pub f_iosize: i32,
738 pub f_blocks: u64,
739 pub f_bfree: u64,
740 pub f_bavail: u64,
741 pub f_files: u64,
742 pub f_ffree: u64,
743 pub f_fsid: ::fsid_t,
744 pub f_owner: ::uid_t,
745 pub f_type: u32,
746 pub f_flags: u32,
747 pub f_fssubtype: u32,
748 pub f_fstypename: [::c_char; 16],
749 pub f_mntonname: [::c_char; 1024],
750 pub f_mntfromname: [::c_char; 1024],
751 pub f_reserved: [u32; 8],
752 }
753
754 pub struct dirent {
755 pub d_ino: u64,
756 pub d_seekoff: u64,
757 pub d_reclen: u16,
758 pub d_namlen: u16,
759 pub d_type: u8,
760 pub d_name: [::c_char; 1024],
761 }
762
763 pub struct pthread_rwlock_t {
764 __sig: ::c_long,
765 __opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
766 }
767
768 pub struct pthread_mutex_t {
769 __sig: ::c_long,
770 __opaque: [u8; __PTHREAD_MUTEX_SIZE__],
771 }
772
773 pub struct pthread_cond_t {
774 __sig: ::c_long,
775 __opaque: [u8; __PTHREAD_COND_SIZE__],
776 }
777
778 pub struct sockaddr_storage {
779 pub ss_len: u8,
780 pub ss_family: ::sa_family_t,
781 __ss_pad1: [u8; 6],
782 __ss_align: i64,
783 __ss_pad2: [u8; 112],
784 }
785
786 pub struct utmpx {
787 pub ut_user: [::c_char; _UTX_USERSIZE],
788 pub ut_id: [::c_char; _UTX_IDSIZE],
789 pub ut_line: [::c_char; _UTX_LINESIZE],
790 pub ut_pid: ::pid_t,
791 pub ut_type: ::c_short,
792 pub ut_tv: ::timeval,
793 pub ut_host: [::c_char; _UTX_HOSTSIZE],
794 ut_pad: [u32; 16],
795 }
796
797 pub struct sigevent {
798 pub sigev_notify: ::c_int,
799 pub sigev_signo: ::c_int,
800 pub sigev_value: ::sigval,
801 __unused1: *mut ::c_void, //actually a function pointer
802 pub sigev_notify_attributes: *mut ::pthread_attr_t
803 }
804
805 pub struct processor_cpu_load_info {
806 pub cpu_ticks: [::c_uint; CPU_STATE_MAX as usize],
807 }
808
809 pub struct processor_basic_info {
810 pub cpu_type: cpu_type_t,
811 pub cpu_subtype: cpu_subtype_t,
812 pub running: ::boolean_t,
813 pub slot_num: ::c_int,
814 pub is_master: ::boolean_t,
815 }
816
817 pub struct processor_set_basic_info {
818 pub processor_count: ::c_int,
819 pub default_policy: ::c_int,
820 }
821
822 pub struct processor_set_load_info {
823 pub task_count: ::c_int,
824 pub thread_count: ::c_int,
825 pub load_average: integer_t,
826 pub mach_factor: integer_t,
827 }
828
829 pub struct time_value_t {
830 pub seconds: integer_t,
831 pub microseconds: integer_t,
832 }
833
834 pub struct thread_basic_info {
835 pub user_time: time_value_t,
836 pub system_time: time_value_t,
837 pub cpu_usage: ::integer_t,
838 pub policy: ::policy_t,
839 pub run_state: ::integer_t,
840 pub flags: ::integer_t,
841 pub suspend_count: ::integer_t,
842 pub sleep_time: ::integer_t,
843 }
844
845 pub struct thread_identifier_info {
846 pub thread_id: u64,
847 pub thread_handle: u64,
848 pub dispatch_qaddr: u64,
849 }
850
851 pub struct thread_extended_info {
852 pub pth_user_time: u64,
853 pub pth_system_time: u64,
854 pub pth_cpu_usage: i32,
855 pub pth_policy: i32,
856 pub pth_run_state: i32,
857 pub pth_flags: i32,
858 pub pth_sleep_time: i32,
859 pub pth_curpri: i32,
860 pub pth_priority: i32,
861 pub pth_maxpriority: i32,
862 pub pth_name: [::c_char; MAXTHREADNAMESIZE],
863 }
864 }
865
866 impl siginfo_t {
867 pub unsafe fn si_addr(&self) -> *mut ::c_void {
868 self.si_addr
869 }
870
871 pub unsafe fn si_value(&self) -> ::sigval {
872 #[repr(C)]
873 struct siginfo_timer {
874 _si_signo: ::c_int,
875 _si_errno: ::c_int,
876 _si_code: ::c_int,
877 _si_pid: ::pid_t,
878 _si_uid: ::uid_t,
879 _si_status: ::c_int,
880 _si_addr: *mut ::c_void,
881 si_value: ::sigval,
882 }
883
884 (*(self as *const siginfo_t as *const siginfo_timer)).si_value
885 }
886
887 pub unsafe fn si_pid(&self) -> ::pid_t {
888 self.si_pid
889 }
890
891 pub unsafe fn si_uid(&self) -> ::uid_t {
892 self.si_uid
893 }
894
895 pub unsafe fn si_status(&self) -> ::c_int {
896 self.si_status
897 }
898 }
899
900 cfg_if! {
901 if #[cfg(libc_union)] {
902 s_no_extra_traits! {
903 pub union semun {
904 pub val: ::c_int,
905 pub buf: *mut semid_ds,
906 pub array: *mut ::c_ushort,
907 }
908 }
909
910 cfg_if! {
911 if #[cfg(feature = "extra_traits")] {
912 impl PartialEq for semun {
913 fn eq(&self, other: &semun) -> bool {
914 unsafe { self.val == other.val }
915 }
916 }
917 impl Eq for semun {}
918 impl ::fmt::Debug for semun {
919 fn fmt(&self, f: &mut ::fmt::Formatter)
920 -> ::fmt::Result {
921 f.debug_struct("semun")
922 .field("val", unsafe { &self.val })
923 .finish()
924 }
925 }
926 impl ::hash::Hash for semun {
927 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
928 unsafe { self.val.hash(state) };
929 }
930 }
931 }
932 }
933 }
934 }
935
936 cfg_if! {
937 if #[cfg(feature = "extra_traits")] {
938 impl PartialEq for kevent {
939 fn eq(&self, other: &kevent) -> bool {
940 self.ident == other.ident
941 && self.filter == other.filter
942 && self.flags == other.flags
943 && self.fflags == other.fflags
944 && self.data == other.data
945 && self.udata == other.udata
946 }
947 }
948 impl Eq for kevent {}
949 impl ::fmt::Debug for kevent {
950 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
951 let ident = self.ident;
952 let filter = self.filter;
953 let flags = self.flags;
954 let fflags = self.fflags;
955 let data = self.data;
956 let udata = self.udata;
957 f.debug_struct("kevent")
958 .field("ident", &ident)
959 .field("filter", &filter)
960 .field("flags", &flags)
961 .field("fflags", &fflags)
962 .field("data", &data)
963 .field("udata", &udata)
964 .finish()
965 }
966 }
967 impl ::hash::Hash for kevent {
968 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
969 let ident = self.ident;
970 let filter = self.filter;
971 let flags = self.flags;
972 let fflags = self.fflags;
973 let data = self.data;
974 let udata = self.udata;
975 ident.hash(state);
976 filter.hash(state);
977 flags.hash(state);
978 fflags.hash(state);
979 data.hash(state);
980 udata.hash(state);
981 }
982 }
983
984 impl PartialEq for semid_ds {
985 fn eq(&self, other: &semid_ds) -> bool {
986 let sem_perm = self.sem_perm;
987 let sem_pad3 = self.sem_pad3;
988 let other_sem_perm = other.sem_perm;
989 let other_sem_pad3 = other.sem_pad3;
990 sem_perm == other_sem_perm
991 && self.sem_base == other.sem_base
992 && self.sem_nsems == other.sem_nsems
993 && self.sem_otime == other.sem_otime
994 && self.sem_pad1 == other.sem_pad1
995 && self.sem_ctime == other.sem_ctime
996 && self.sem_pad2 == other.sem_pad2
997 && sem_pad3 == other_sem_pad3
998 }
999 }
1000 impl Eq for semid_ds {}
1001 impl ::fmt::Debug for semid_ds {
1002 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1003 let sem_perm = self.sem_perm;
1004 let sem_base = self.sem_base;
1005 let sem_nsems = self.sem_nsems;
1006 let sem_otime = self.sem_otime;
1007 let sem_pad1 = self.sem_pad1;
1008 let sem_ctime = self.sem_ctime;
1009 let sem_pad2 = self.sem_pad2;
1010 let sem_pad3 = self.sem_pad3;
1011 f.debug_struct("semid_ds")
1012 .field("sem_perm", &sem_perm)
1013 .field("sem_base", &sem_base)
1014 .field("sem_nsems", &sem_nsems)
1015 .field("sem_otime", &sem_otime)
1016 .field("sem_pad1", &sem_pad1)
1017 .field("sem_ctime", &sem_ctime)
1018 .field("sem_pad2", &sem_pad2)
1019 .field("sem_pad3", &sem_pad3)
1020 .finish()
1021 }
1022 }
1023 impl ::hash::Hash for semid_ds {
1024 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1025 let sem_perm = self.sem_perm;
1026 let sem_base = self.sem_base;
1027 let sem_nsems = self.sem_nsems;
1028 let sem_otime = self.sem_otime;
1029 let sem_pad1 = self.sem_pad1;
1030 let sem_ctime = self.sem_ctime;
1031 let sem_pad2 = self.sem_pad2;
1032 let sem_pad3 = self.sem_pad3;
1033 sem_perm.hash(state);
1034 sem_base.hash(state);
1035 sem_nsems.hash(state);
1036 sem_otime.hash(state);
1037 sem_pad1.hash(state);
1038 sem_ctime.hash(state);
1039 sem_pad2.hash(state);
1040 sem_pad3.hash(state);
1041 }
1042 }
1043
1044 impl PartialEq for shmid_ds {
1045 fn eq(&self, other: &shmid_ds) -> bool {
1046 let shm_perm = self.shm_perm;
1047 let other_shm_perm = other.shm_perm;
1048 shm_perm == other_shm_perm
1049 && self.shm_segsz == other.shm_segsz
1050 && self.shm_lpid == other.shm_lpid
1051 && self.shm_cpid == other.shm_cpid
1052 && self.shm_nattch == other.shm_nattch
1053 && self.shm_atime == other.shm_atime
1054 && self.shm_dtime == other.shm_dtime
1055 && self.shm_ctime == other.shm_ctime
1056 && self.shm_internal == other.shm_internal
1057 }
1058 }
1059 impl Eq for shmid_ds {}
1060 impl ::fmt::Debug for shmid_ds {
1061 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1062 let shm_perm = self.shm_perm;
1063 let shm_segsz = self.shm_segsz;
1064 let shm_lpid = self.shm_lpid;
1065 let shm_cpid = self.shm_cpid;
1066 let shm_nattch = self.shm_nattch;
1067 let shm_atime = self.shm_atime;
1068 let shm_dtime = self.shm_dtime;
1069 let shm_ctime = self.shm_ctime;
1070 let shm_internal = self.shm_internal;
1071 f.debug_struct("shmid_ds")
1072 .field("shm_perm", &shm_perm)
1073 .field("shm_segsz", &shm_segsz)
1074 .field("shm_lpid", &shm_lpid)
1075 .field("shm_cpid", &shm_cpid)
1076 .field("shm_nattch", &shm_nattch)
1077 .field("shm_atime", &shm_atime)
1078 .field("shm_dtime", &shm_dtime)
1079 .field("shm_ctime", &shm_ctime)
1080 .field("shm_internal", &shm_internal)
1081 .finish()
1082 }
1083 }
1084 impl ::hash::Hash for shmid_ds {
1085 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1086 let shm_perm = self.shm_perm;
1087 let shm_segsz = self.shm_segsz;
1088 let shm_lpid = self.shm_lpid;
1089 let shm_cpid = self.shm_cpid;
1090 let shm_nattch = self.shm_nattch;
1091 let shm_atime = self.shm_atime;
1092 let shm_dtime = self.shm_dtime;
1093 let shm_ctime = self.shm_ctime;
1094 let shm_internal = self.shm_internal;
1095 shm_perm.hash(state);
1096 shm_segsz.hash(state);
1097 shm_lpid.hash(state);
1098 shm_cpid.hash(state);
1099 shm_nattch.hash(state);
1100 shm_atime.hash(state);
1101 shm_dtime.hash(state);
1102 shm_ctime.hash(state);
1103 shm_internal.hash(state);
1104 }
1105 }
1106
1107 impl PartialEq for proc_threadinfo {
1108 fn eq(&self, other: &proc_threadinfo) -> bool {
1109 self.pth_user_time == other.pth_user_time
1110 && self.pth_system_time == other.pth_system_time
1111 && self.pth_cpu_usage == other.pth_cpu_usage
1112 && self.pth_policy == other.pth_policy
1113 && self.pth_run_state == other.pth_run_state
1114 && self.pth_flags == other.pth_flags
1115 && self.pth_sleep_time == other.pth_sleep_time
1116 && self.pth_curpri == other.pth_curpri
1117 && self.pth_priority == other.pth_priority
1118 && self.pth_maxpriority == other.pth_maxpriority
1119 && self.pth_name
1120 .iter()
1121 .zip(other.pth_name.iter())
1122 .all(|(a,b)| a == b)
1123 }
1124 }
1125 impl Eq for proc_threadinfo {}
1126 impl ::fmt::Debug for proc_threadinfo {
1127 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1128 f.debug_struct("proc_threadinfo")
1129 .field("pth_user_time", &self.pth_user_time)
1130 .field("pth_system_time", &self.pth_system_time)
1131 .field("pth_cpu_usage", &self.pth_cpu_usage)
1132 .field("pth_policy", &self.pth_policy)
1133 .field("pth_run_state", &self.pth_run_state)
1134 .field("pth_flags", &self.pth_flags)
1135 .field("pth_sleep_time", &self.pth_sleep_time)
1136 .field("pth_curpri", &self.pth_curpri)
1137 .field("pth_priority", &self.pth_priority)
1138 .field("pth_maxpriority", &self.pth_maxpriority)
1139 // FIXME: .field("pth_name", &self.pth_name)
1140 .finish()
1141 }
1142 }
1143 impl ::hash::Hash for proc_threadinfo {
1144 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1145 self.pth_user_time.hash(state);
1146 self.pth_system_time.hash(state);
1147 self.pth_cpu_usage.hash(state);
1148 self.pth_policy.hash(state);
1149 self.pth_run_state.hash(state);
1150 self.pth_flags.hash(state);
1151 self.pth_sleep_time.hash(state);
1152 self.pth_curpri.hash(state);
1153 self.pth_priority.hash(state);
1154 self.pth_maxpriority.hash(state);
1155 self.pth_name.hash(state);
1156 }
1157 }
1158
1159 impl PartialEq for statfs {
1160 fn eq(&self, other: &statfs) -> bool {
1161 self.f_bsize == other.f_bsize
1162 && self.f_iosize == other.f_iosize
1163 && self.f_blocks == other.f_blocks
1164 && self.f_bfree == other.f_bfree
1165 && self.f_bavail == other.f_bavail
1166 && self.f_files == other.f_files
1167 && self.f_ffree == other.f_ffree
1168 && self.f_fsid == other.f_fsid
1169 && self.f_owner == other.f_owner
1170 && self.f_flags == other.f_flags
1171 && self.f_fssubtype == other.f_fssubtype
1172 && self.f_fstypename == other.f_fstypename
1173 && self.f_type == other.f_type
1174 && self
1175 .f_mntonname
1176 .iter()
1177 .zip(other.f_mntonname.iter())
1178 .all(|(a,b)| a == b)
1179 && self
1180 .f_mntfromname
1181 .iter()
1182 .zip(other.f_mntfromname.iter())
1183 .all(|(a,b)| a == b)
1184 && self.f_reserved == other.f_reserved
1185 }
1186 }
1187
1188 impl Eq for statfs {}
1189 impl ::fmt::Debug for statfs {
1190 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1191 f.debug_struct("statfs")
1192 .field("f_bsize", &self.f_bsize)
1193 .field("f_iosize", &self.f_iosize)
1194 .field("f_blocks", &self.f_blocks)
1195 .field("f_bfree", &self.f_bfree)
1196 .field("f_bavail", &self.f_bavail)
1197 .field("f_files", &self.f_files)
1198 .field("f_ffree", &self.f_ffree)
1199 .field("f_fsid", &self.f_fsid)
1200 .field("f_owner", &self.f_owner)
1201 .field("f_flags", &self.f_flags)
1202 .field("f_fssubtype", &self.f_fssubtype)
1203 .field("f_fstypename", &self.f_fstypename)
1204 .field("f_type", &self.f_type)
1205 // FIXME: .field("f_mntonname", &self.f_mntonname)
1206 // FIXME: .field("f_mntfromname", &self.f_mntfromname)
1207 .field("f_reserved", &self.f_reserved)
1208 .finish()
1209 }
1210 }
1211
1212 impl ::hash::Hash for statfs {
1213 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1214 self.f_bsize.hash(state);
1215 self.f_iosize.hash(state);
1216 self.f_blocks.hash(state);
1217 self.f_bfree.hash(state);
1218 self.f_bavail.hash(state);
1219 self.f_files.hash(state);
1220 self.f_ffree.hash(state);
1221 self.f_fsid.hash(state);
1222 self.f_owner.hash(state);
1223 self.f_flags.hash(state);
1224 self.f_fssubtype.hash(state);
1225 self.f_fstypename.hash(state);
1226 self.f_type.hash(state);
1227 self.f_mntonname.hash(state);
1228 self.f_mntfromname.hash(state);
1229 self.f_reserved.hash(state);
1230 }
1231 }
1232
1233 impl PartialEq for dirent {
1234 fn eq(&self, other: &dirent) -> bool {
1235 self.d_ino == other.d_ino
1236 && self.d_seekoff == other.d_seekoff
1237 && self.d_reclen == other.d_reclen
1238 && self.d_namlen == other.d_namlen
1239 && self.d_type == other.d_type
1240 && self
1241 .d_name
1242 .iter()
1243 .zip(other.d_name.iter())
1244 .all(|(a,b)| a == b)
1245 }
1246 }
1247 impl Eq for dirent {}
1248 impl ::fmt::Debug for dirent {
1249 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1250 f.debug_struct("dirent")
1251 .field("d_ino", &self.d_ino)
1252 .field("d_seekoff", &self.d_seekoff)
1253 .field("d_reclen", &self.d_reclen)
1254 .field("d_namlen", &self.d_namlen)
1255 .field("d_type", &self.d_type)
1256 // FIXME: .field("d_name", &self.d_name)
1257 .finish()
1258 }
1259 }
1260 impl ::hash::Hash for dirent {
1261 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1262 self.d_ino.hash(state);
1263 self.d_seekoff.hash(state);
1264 self.d_reclen.hash(state);
1265 self.d_namlen.hash(state);
1266 self.d_type.hash(state);
1267 self.d_name.hash(state);
1268 }
1269 }
1270 impl PartialEq for pthread_rwlock_t {
1271 fn eq(&self, other: &pthread_rwlock_t) -> bool {
1272 self.__sig == other.__sig
1273 && self.
1274 __opaque
1275 .iter()
1276 .zip(other.__opaque.iter())
1277 .all(|(a,b)| a == b)
1278 }
1279 }
1280 impl Eq for pthread_rwlock_t {}
1281 impl ::fmt::Debug for pthread_rwlock_t {
1282 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1283 f.debug_struct("pthread_rwlock_t")
1284 .field("__sig", &self.__sig)
1285 // FIXME: .field("__opaque", &self.__opaque)
1286 .finish()
1287 }
1288 }
1289 impl ::hash::Hash for pthread_rwlock_t {
1290 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1291 self.__sig.hash(state);
1292 self.__opaque.hash(state);
1293 }
1294 }
1295
1296 impl PartialEq for pthread_mutex_t {
1297 fn eq(&self, other: &pthread_mutex_t) -> bool {
1298 self.__sig == other.__sig
1299 && self.
1300 __opaque
1301 .iter()
1302 .zip(other.__opaque.iter())
1303 .all(|(a,b)| a == b)
1304 }
1305 }
1306
1307 impl Eq for pthread_mutex_t {}
1308
1309 impl ::fmt::Debug for pthread_mutex_t {
1310 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1311 f.debug_struct("pthread_mutex_t")
1312 .field("__sig", &self.__sig)
1313 // FIXME: .field("__opaque", &self.__opaque)
1314 .finish()
1315 }
1316 }
1317
1318 impl ::hash::Hash for pthread_mutex_t {
1319 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1320 self.__sig.hash(state);
1321 self.__opaque.hash(state);
1322 }
1323 }
1324
1325 impl PartialEq for pthread_cond_t {
1326 fn eq(&self, other: &pthread_cond_t) -> bool {
1327 self.__sig == other.__sig
1328 && self.
1329 __opaque
1330 .iter()
1331 .zip(other.__opaque.iter())
1332 .all(|(a,b)| a == b)
1333 }
1334 }
1335
1336 impl Eq for pthread_cond_t {}
1337
1338 impl ::fmt::Debug for pthread_cond_t {
1339 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1340 f.debug_struct("pthread_cond_t")
1341 .field("__sig", &self.__sig)
1342 // FIXME: .field("__opaque", &self.__opaque)
1343 .finish()
1344 }
1345 }
1346
1347 impl ::hash::Hash for pthread_cond_t {
1348 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1349 self.__sig.hash(state);
1350 self.__opaque.hash(state);
1351 }
1352 }
1353
1354 impl PartialEq for sockaddr_storage {
1355 fn eq(&self, other: &sockaddr_storage) -> bool {
1356 self.ss_len == other.ss_len
1357 && self.ss_family == other.ss_family
1358 && self
1359 .__ss_pad1
1360 .iter()
1361 .zip(other.__ss_pad1.iter())
1362 .all(|(a, b)| a == b)
1363 && self.__ss_align == other.__ss_align
1364 && self
1365 .__ss_pad2
1366 .iter()
1367 .zip(other.__ss_pad2.iter())
1368 .all(|(a, b)| a == b)
1369 }
1370 }
1371
1372 impl Eq for sockaddr_storage {}
1373
1374 impl ::fmt::Debug for sockaddr_storage {
1375 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1376 f.debug_struct("sockaddr_storage")
1377 .field("ss_len", &self.ss_len)
1378 .field("ss_family", &self.ss_family)
1379 .field("__ss_pad1", &self.__ss_pad1)
1380 .field("__ss_align", &self.__ss_align)
1381 // FIXME: .field("__ss_pad2", &self.__ss_pad2)
1382 .finish()
1383 }
1384 }
1385
1386 impl ::hash::Hash for sockaddr_storage {
1387 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1388 self.ss_len.hash(state);
1389 self.ss_family.hash(state);
1390 self.__ss_pad1.hash(state);
1391 self.__ss_align.hash(state);
1392 self.__ss_pad2.hash(state);
1393 }
1394 }
1395
1396 impl PartialEq for utmpx {
1397 fn eq(&self, other: &utmpx) -> bool {
1398 self.ut_user
1399 .iter()
1400 .zip(other.ut_user.iter())
1401 .all(|(a,b)| a == b)
1402 && self.ut_id == other.ut_id
1403 && self.ut_line == other.ut_line
1404 && self.ut_pid == other.ut_pid
1405 && self.ut_type == other.ut_type
1406 && self.ut_tv == other.ut_tv
1407 && self
1408 .ut_host
1409 .iter()
1410 .zip(other.ut_host.iter())
1411 .all(|(a,b)| a == b)
1412 && self.ut_pad == other.ut_pad
1413 }
1414 }
1415
1416 impl Eq for utmpx {}
1417
1418 impl ::fmt::Debug for utmpx {
1419 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1420 f.debug_struct("utmpx")
1421 // FIXME: .field("ut_user", &self.ut_user)
1422 .field("ut_id", &self.ut_id)
1423 .field("ut_line", &self.ut_line)
1424 .field("ut_pid", &self.ut_pid)
1425 .field("ut_type", &self.ut_type)
1426 .field("ut_tv", &self.ut_tv)
1427 // FIXME: .field("ut_host", &self.ut_host)
1428 .field("ut_pad", &self.ut_pad)
1429 .finish()
1430 }
1431 }
1432
1433 impl ::hash::Hash for utmpx {
1434 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1435 self.ut_user.hash(state);
1436 self.ut_id.hash(state);
1437 self.ut_line.hash(state);
1438 self.ut_pid.hash(state);
1439 self.ut_type.hash(state);
1440 self.ut_tv.hash(state);
1441 self.ut_host.hash(state);
1442 self.ut_pad.hash(state);
1443 }
1444 }
1445
1446 impl PartialEq for sigevent {
1447 fn eq(&self, other: &sigevent) -> bool {
1448 self.sigev_notify == other.sigev_notify
1449 && self.sigev_signo == other.sigev_signo
1450 && self.sigev_value == other.sigev_value
1451 && self.sigev_notify_attributes
1452 == other.sigev_notify_attributes
1453 }
1454 }
1455
1456 impl Eq for sigevent {}
1457
1458 impl ::fmt::Debug for sigevent {
1459 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1460 f.debug_struct("sigevent")
1461 .field("sigev_notify", &self.sigev_notify)
1462 .field("sigev_signo", &self.sigev_signo)
1463 .field("sigev_value", &self.sigev_value)
1464 .field("sigev_notify_attributes",
1465 &self.sigev_notify_attributes)
1466 .finish()
1467 }
1468 }
1469
1470 impl ::hash::Hash for sigevent {
1471 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1472 self.sigev_notify.hash(state);
1473 self.sigev_signo.hash(state);
1474 self.sigev_value.hash(state);
1475 self.sigev_notify_attributes.hash(state);
1476 }
1477 }
1478
1479 impl PartialEq for processor_cpu_load_info {
1480 fn eq(&self, other: &processor_cpu_load_info) -> bool {
1481 self.cpu_ticks == other.cpu_ticks
1482 }
1483 }
1484 impl Eq for processor_cpu_load_info {}
1485 impl ::fmt::Debug for processor_cpu_load_info {
1486 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1487 f.debug_struct("processor_cpu_load_info")
1488 .field("cpu_ticks", &self.cpu_ticks)
1489 .finish()
1490 }
1491 }
1492 impl ::hash::Hash for processor_cpu_load_info {
1493 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1494 self.cpu_ticks.hash(state);
1495 }
1496 }
1497
1498 impl PartialEq for processor_basic_info {
1499 fn eq(&self, other: &processor_basic_info) -> bool {
1500 self.cpu_type == other.cpu_type
1501 && self.cpu_subtype == other.cpu_subtype
1502 && self.running == other.running
1503 && self.slot_num == other.slot_num
1504 && self.is_master == other.is_master
1505 }
1506 }
1507 impl Eq for processor_basic_info {}
1508 impl ::fmt::Debug for processor_basic_info {
1509 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1510 f.debug_struct("processor_basic_info")
1511 .field("cpu_type", &self.cpu_type)
1512 .field("cpu_subtype", &self.cpu_subtype)
1513 .field("running", &self.running)
1514 .field("slot_num", &self.slot_num)
1515 .field("is_master", &self.is_master)
1516 .finish()
1517 }
1518 }
1519 impl ::hash::Hash for processor_basic_info {
1520 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1521 self.cpu_type.hash(state);
1522 self.cpu_subtype.hash(state);
1523 self.running.hash(state);
1524 self.slot_num.hash(state);
1525 self.is_master.hash(state);
1526 }
1527 }
1528
1529 impl PartialEq for processor_set_basic_info {
1530 fn eq(&self, other: &processor_set_basic_info) -> bool {
1531 self.processor_count == other.processor_count
1532 && self.default_policy == other.default_policy
1533 }
1534 }
1535 impl Eq for processor_set_basic_info {}
1536 impl ::fmt::Debug for processor_set_basic_info {
1537 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1538 f.debug_struct("processor_set_basic_info")
1539 .field("processor_count", &self.processor_count)
1540 .field("default_policy", &self.default_policy)
1541 .finish()
1542 }
1543 }
1544 impl ::hash::Hash for processor_set_basic_info {
1545 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1546 self.processor_count.hash(state);
1547 self.default_policy.hash(state);
1548 }
1549 }
1550
1551 impl PartialEq for processor_set_load_info {
1552 fn eq(&self, other: &processor_set_load_info) -> bool {
1553 self.task_count == other.task_count
1554 && self.thread_count == other.thread_count
1555 && self.load_average == other.load_average
1556 && self.mach_factor == other.mach_factor
1557 }
1558 }
1559 impl Eq for processor_set_load_info {}
1560 impl ::fmt::Debug for processor_set_load_info {
1561 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1562 f.debug_struct("processor_set_load_info")
1563 .field("task_count", &self.task_count)
1564 .field("thread_count", &self.thread_count)
1565 .field("load_average", &self.load_average)
1566 .field("mach_factor", &self.mach_factor)
1567 .finish()
1568 }
1569 }
1570 impl ::hash::Hash for processor_set_load_info {
1571 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1572 self.task_count.hash(state);
1573 self.thread_count.hash(state);
1574 self.load_average.hash(state);
1575 self.mach_factor.hash(state);
1576 }
1577 }
1578
1579 impl PartialEq for time_value_t {
1580 fn eq(&self, other: &time_value_t) -> bool {
1581 self.seconds == other.seconds
1582 && self.microseconds == other.microseconds
1583 }
1584 }
1585 impl Eq for time_value_t {}
1586 impl ::fmt::Debug for time_value_t {
1587 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1588 f.debug_struct("time_value_t")
1589 .field("seconds", &self.seconds)
1590 .field("microseconds", &self.seconds)
1591 .finish()
1592 }
1593 }
1594 impl ::hash::Hash for time_value_t {
1595 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1596 self.seconds.hash(state);
1597 self.microseconds.hash(state);
1598 }
1599 }
1600 impl PartialEq for thread_basic_info {
1601 fn eq(&self, other: &thread_basic_info) -> bool {
1602 self.user_time == other.user_time
1603 && self.system_time == other.system_time
1604 && self.cpu_usage == other.cpu_usage
1605 && self.policy == other.policy
1606 && self.run_state == other.run_state
1607 && self.flags == other.flags
1608 && self.suspend_count == other.suspend_count
1609 && self.sleep_time == other.sleep_time
1610 }
1611 }
1612 impl Eq for thread_basic_info {}
1613 impl ::fmt::Debug for thread_basic_info {
1614 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1615 f.debug_struct("thread_basic_info")
1616 .field("user_time", &self.user_time)
1617 .field("system_time", &self.system_time)
1618 .field("cpu_usage", &self.cpu_usage)
1619 .field("policy", &self.policy)
1620 .field("run_state", &self.run_state)
1621 .field("flags", &self.flags)
1622 .field("suspend_count", &self.suspend_count)
1623 .field("sleep_time", &self.sleep_time)
1624 .finish()
1625 }
1626 }
1627 impl ::hash::Hash for thread_basic_info {
1628 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1629 self.user_time.hash(state);
1630 self.system_time.hash(state);
1631 self.cpu_usage.hash(state);
1632 self.policy.hash(state);
1633 self.run_state.hash(state);
1634 self.flags.hash(state);
1635 self.suspend_count.hash(state);
1636 self.sleep_time.hash(state);
1637 }
1638 }
1639 impl PartialEq for thread_extended_info {
1640 fn eq(&self, other: &thread_extended_info) -> bool {
1641 self.pth_user_time == other.pth_user_time
1642 && self.pth_system_time == other.pth_system_time
1643 && self.pth_cpu_usage == other.pth_cpu_usage
1644 && self.pth_policy == other.pth_policy
1645 && self.pth_run_state == other.pth_run_state
1646 && self.pth_flags == other.pth_flags
1647 && self.pth_sleep_time == other.pth_sleep_time
1648 && self.pth_curpri == other.pth_curpri
1649 && self.pth_priority == other.pth_priority
1650 && self.pth_maxpriority == other.pth_maxpriority
1651 && self.pth_name
1652 .iter()
1653 .zip(other.pth_name.iter())
1654 .all(|(a,b)| a == b)
1655 }
1656 }
1657 impl Eq for thread_extended_info {}
1658 impl ::fmt::Debug for thread_extended_info {
1659 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1660 f.debug_struct("proc_threadinfo")
1661 .field("pth_user_time", &self.pth_user_time)
1662 .field("pth_system_time", &self.pth_system_time)
1663 .field("pth_cpu_usage", &self.pth_cpu_usage)
1664 .field("pth_policy", &self.pth_policy)
1665 .field("pth_run_state", &self.pth_run_state)
1666 .field("pth_flags", &self.pth_flags)
1667 .field("pth_sleep_time", &self.pth_sleep_time)
1668 .field("pth_curpri", &self.pth_curpri)
1669 .field("pth_priority", &self.pth_priority)
1670 .field("pth_maxpriority", &self.pth_maxpriority)
1671 // FIXME: .field("pth_name", &self.pth_name)
1672 .finish()
1673 }
1674 }
1675 impl ::hash::Hash for thread_extended_info {
1676 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1677 self.pth_user_time.hash(state);
1678 self.pth_system_time.hash(state);
1679 self.pth_cpu_usage.hash(state);
1680 self.pth_policy.hash(state);
1681 self.pth_run_state.hash(state);
1682 self.pth_flags.hash(state);
1683 self.pth_sleep_time.hash(state);
1684 self.pth_curpri.hash(state);
1685 self.pth_priority.hash(state);
1686 self.pth_maxpriority.hash(state);
1687 self.pth_name.hash(state);
1688 }
1689 }
1690 impl PartialEq for thread_identifier_info {
1691 fn eq(&self, other: &thread_identifier_info) -> bool {
1692 self.thread_id == other.thread_id
1693 && self.thread_handle == other.thread_handle
1694 && self.dispatch_qaddr == other.dispatch_qaddr
1695 }
1696 }
1697 impl Eq for thread_identifier_info {}
1698 impl ::fmt::Debug for thread_identifier_info {
1699 fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
1700 f.debug_struct("thread_identifier_info")
1701 .field("thread_id", &self.thread_id)
1702 .field("thread_handlee", &self.thread_handle)
1703 .field("dispatch_qaddr", &self.dispatch_qaddr)
1704 .finish()
1705 }
1706 }
1707 impl ::hash::Hash for thread_identifier_info {
1708 fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
1709 self.thread_id.hash(state);
1710 self.thread_handle.hash(state);
1711 self.dispatch_qaddr.hash(state);
1712 }
1713 }
1714 }
1715 }
1716
1717 pub const _UTX_USERSIZE: usize = 256;
1718 pub const _UTX_LINESIZE: usize = 32;
1719 pub const _UTX_IDSIZE: usize = 4;
1720 pub const _UTX_HOSTSIZE: usize = 256;
1721
1722 pub const EMPTY: ::c_short = 0;
1723 pub const RUN_LVL: ::c_short = 1;
1724 pub const BOOT_TIME: ::c_short = 2;
1725 pub const OLD_TIME: ::c_short = 3;
1726 pub const NEW_TIME: ::c_short = 4;
1727 pub const INIT_PROCESS: ::c_short = 5;
1728 pub const LOGIN_PROCESS: ::c_short = 6;
1729 pub const USER_PROCESS: ::c_short = 7;
1730 pub const DEAD_PROCESS: ::c_short = 8;
1731 pub const ACCOUNTING: ::c_short = 9;
1732 pub const SIGNATURE: ::c_short = 10;
1733 pub const SHUTDOWN_TIME: ::c_short = 11;
1734
1735 pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
1736 pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
1737 pub const LC_MESSAGES_MASK: ::c_int = 1 << 2;
1738 pub const LC_MONETARY_MASK: ::c_int = 1 << 3;
1739 pub const LC_NUMERIC_MASK: ::c_int = 1 << 4;
1740 pub const LC_TIME_MASK: ::c_int = 1 << 5;
1741 pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
1742 | LC_CTYPE_MASK
1743 | LC_MESSAGES_MASK
1744 | LC_MONETARY_MASK
1745 | LC_NUMERIC_MASK
1746 | LC_TIME_MASK;
1747
1748 pub const CODESET: ::nl_item = 0;
1749 pub const D_T_FMT: ::nl_item = 1;
1750 pub const D_FMT: ::nl_item = 2;
1751 pub const T_FMT: ::nl_item = 3;
1752 pub const T_FMT_AMPM: ::nl_item = 4;
1753 pub const AM_STR: ::nl_item = 5;
1754 pub const PM_STR: ::nl_item = 6;
1755
1756 pub const DAY_1: ::nl_item = 7;
1757 pub const DAY_2: ::nl_item = 8;
1758 pub const DAY_3: ::nl_item = 9;
1759 pub const DAY_4: ::nl_item = 10;
1760 pub const DAY_5: ::nl_item = 11;
1761 pub const DAY_6: ::nl_item = 12;
1762 pub const DAY_7: ::nl_item = 13;
1763
1764 pub const ABDAY_1: ::nl_item = 14;
1765 pub const ABDAY_2: ::nl_item = 15;
1766 pub const ABDAY_3: ::nl_item = 16;
1767 pub const ABDAY_4: ::nl_item = 17;
1768 pub const ABDAY_5: ::nl_item = 18;
1769 pub const ABDAY_6: ::nl_item = 19;
1770 pub const ABDAY_7: ::nl_item = 20;
1771
1772 pub const MON_1: ::nl_item = 21;
1773 pub const MON_2: ::nl_item = 22;
1774 pub const MON_3: ::nl_item = 23;
1775 pub const MON_4: ::nl_item = 24;
1776 pub const MON_5: ::nl_item = 25;
1777 pub const MON_6: ::nl_item = 26;
1778 pub const MON_7: ::nl_item = 27;
1779 pub const MON_8: ::nl_item = 28;
1780 pub const MON_9: ::nl_item = 29;
1781 pub const MON_10: ::nl_item = 30;
1782 pub const MON_11: ::nl_item = 31;
1783 pub const MON_12: ::nl_item = 32;
1784
1785 pub const ABMON_1: ::nl_item = 33;
1786 pub const ABMON_2: ::nl_item = 34;
1787 pub const ABMON_3: ::nl_item = 35;
1788 pub const ABMON_4: ::nl_item = 36;
1789 pub const ABMON_5: ::nl_item = 37;
1790 pub const ABMON_6: ::nl_item = 38;
1791 pub const ABMON_7: ::nl_item = 39;
1792 pub const ABMON_8: ::nl_item = 40;
1793 pub const ABMON_9: ::nl_item = 41;
1794 pub const ABMON_10: ::nl_item = 42;
1795 pub const ABMON_11: ::nl_item = 43;
1796 pub const ABMON_12: ::nl_item = 44;
1797
1798 pub const CLOCK_REALTIME: ::clockid_t = 0;
1799 pub const CLOCK_MONOTONIC: ::clockid_t = 6;
1800 pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
1801 pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
1802
1803 pub const ERA: ::nl_item = 45;
1804 pub const ERA_D_FMT: ::nl_item = 46;
1805 pub const ERA_D_T_FMT: ::nl_item = 47;
1806 pub const ERA_T_FMT: ::nl_item = 48;
1807 pub const ALT_DIGITS: ::nl_item = 49;
1808
1809 pub const RADIXCHAR: ::nl_item = 50;
1810 pub const THOUSEP: ::nl_item = 51;
1811
1812 pub const YESEXPR: ::nl_item = 52;
1813 pub const NOEXPR: ::nl_item = 53;
1814
1815 pub const YESSTR: ::nl_item = 54;
1816 pub const NOSTR: ::nl_item = 55;
1817
1818 pub const CRNCYSTR: ::nl_item = 56;
1819
1820 pub const D_MD_ORDER: ::nl_item = 57;
1821
1822 pub const EXIT_FAILURE: ::c_int = 1;
1823 pub const EXIT_SUCCESS: ::c_int = 0;
1824 pub const RAND_MAX: ::c_int = 2147483647;
1825 pub const EOF: ::c_int = -1;
1826 pub const SEEK_SET: ::c_int = 0;
1827 pub const SEEK_CUR: ::c_int = 1;
1828 pub const SEEK_END: ::c_int = 2;
1829 pub const _IOFBF: ::c_int = 0;
1830 pub const _IONBF: ::c_int = 2;
1831 pub const _IOLBF: ::c_int = 1;
1832 pub const BUFSIZ: ::c_uint = 1024;
1833 pub const FOPEN_MAX: ::c_uint = 20;
1834 pub const FILENAME_MAX: ::c_uint = 1024;
1835 pub const L_tmpnam: ::c_uint = 1024;
1836 pub const TMP_MAX: ::c_uint = 308915776;
1837 pub const _PC_LINK_MAX: ::c_int = 1;
1838 pub const _PC_MAX_CANON: ::c_int = 2;
1839 pub const _PC_MAX_INPUT: ::c_int = 3;
1840 pub const _PC_NAME_MAX: ::c_int = 4;
1841 pub const _PC_PATH_MAX: ::c_int = 5;
1842 pub const _PC_PIPE_BUF: ::c_int = 6;
1843 pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
1844 pub const _PC_NO_TRUNC: ::c_int = 8;
1845 pub const _PC_VDISABLE: ::c_int = 9;
1846 pub const O_DSYNC: ::c_int = 0x400000;
1847 pub const O_NOCTTY: ::c_int = 0x20000;
1848 pub const O_CLOEXEC: ::c_int = 0x1000000;
1849 pub const O_DIRECTORY: ::c_int = 0x100000;
1850 pub const O_SYMLINK: ::c_int = 0x200000;
1851 pub const S_IFIFO: mode_t = 4096;
1852 pub const S_IFCHR: mode_t = 8192;
1853 pub const S_IFBLK: mode_t = 24576;
1854 pub const S_IFDIR: mode_t = 16384;
1855 pub const S_IFREG: mode_t = 32768;
1856 pub const S_IFLNK: mode_t = 40960;
1857 pub const S_IFSOCK: mode_t = 49152;
1858 pub const S_IFMT: mode_t = 61440;
1859 pub const S_IEXEC: mode_t = 64;
1860 pub const S_IWRITE: mode_t = 128;
1861 pub const S_IREAD: mode_t = 256;
1862 pub const S_IRWXU: mode_t = 448;
1863 pub const S_IXUSR: mode_t = 64;
1864 pub const S_IWUSR: mode_t = 128;
1865 pub const S_IRUSR: mode_t = 256;
1866 pub const S_IRWXG: mode_t = 56;
1867 pub const S_IXGRP: mode_t = 8;
1868 pub const S_IWGRP: mode_t = 16;
1869 pub const S_IRGRP: mode_t = 32;
1870 pub const S_IRWXO: mode_t = 7;
1871 pub const S_IXOTH: mode_t = 1;
1872 pub const S_IWOTH: mode_t = 2;
1873 pub const S_IROTH: mode_t = 4;
1874 pub const F_OK: ::c_int = 0;
1875 pub const R_OK: ::c_int = 4;
1876 pub const W_OK: ::c_int = 2;
1877 pub const X_OK: ::c_int = 1;
1878 pub const STDIN_FILENO: ::c_int = 0;
1879 pub const STDOUT_FILENO: ::c_int = 1;
1880 pub const STDERR_FILENO: ::c_int = 2;
1881 pub const F_LOCK: ::c_int = 1;
1882 pub const F_TEST: ::c_int = 3;
1883 pub const F_TLOCK: ::c_int = 2;
1884 pub const F_ULOCK: ::c_int = 0;
1885 pub const F_GETLK: ::c_int = 7;
1886 pub const F_SETLK: ::c_int = 8;
1887 pub const F_SETLKW: ::c_int = 9;
1888 pub const SIGHUP: ::c_int = 1;
1889 pub const SIGINT: ::c_int = 2;
1890 pub const SIGQUIT: ::c_int = 3;
1891 pub const SIGILL: ::c_int = 4;
1892 pub const SIGABRT: ::c_int = 6;
1893 pub const SIGEMT: ::c_int = 7;
1894 pub const SIGFPE: ::c_int = 8;
1895 pub const SIGKILL: ::c_int = 9;
1896 pub const SIGSEGV: ::c_int = 11;
1897 pub const SIGPIPE: ::c_int = 13;
1898 pub const SIGALRM: ::c_int = 14;
1899 pub const SIGTERM: ::c_int = 15;
1900
1901 pub const PROT_NONE: ::c_int = 0;
1902 pub const PROT_READ: ::c_int = 1;
1903 pub const PROT_WRITE: ::c_int = 2;
1904 pub const PROT_EXEC: ::c_int = 4;
1905
1906 pub const PT_TRACE_ME: ::c_int = 0;
1907 pub const PT_READ_I: ::c_int = 1;
1908 pub const PT_READ_D: ::c_int = 2;
1909 pub const PT_READ_U: ::c_int = 3;
1910 pub const PT_WRITE_I: ::c_int = 4;
1911 pub const PT_WRITE_D: ::c_int = 5;
1912 pub const PT_WRITE_U: ::c_int = 6;
1913 pub const PT_CONTINUE: ::c_int = 7;
1914 pub const PT_KILL: ::c_int = 8;
1915 pub const PT_STEP: ::c_int = 9;
1916 pub const PT_ATTACH: ::c_int = 10;
1917 pub const PT_DETACH: ::c_int = 11;
1918 pub const PT_SIGEXC: ::c_int = 12;
1919 pub const PT_THUPDATE: ::c_int = 13;
1920 pub const PT_ATTACHEXC: ::c_int = 14;
1921
1922 pub const PT_FORCEQUOTA: ::c_int = 30;
1923 pub const PT_DENY_ATTACH: ::c_int = 31;
1924 pub const PT_FIRSTMACH: ::c_int = 32;
1925
1926 pub const MAP_FILE: ::c_int = 0x0000;
1927 pub const MAP_SHARED: ::c_int = 0x0001;
1928 pub const MAP_PRIVATE: ::c_int = 0x0002;
1929 pub const MAP_FIXED: ::c_int = 0x0010;
1930 pub const MAP_ANON: ::c_int = 0x1000;
1931 pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
1932
1933 pub const CPU_STATE_USER: ::c_int = 0;
1934 pub const CPU_STATE_SYSTEM: ::c_int = 1;
1935 pub const CPU_STATE_IDLE: ::c_int = 2;
1936 pub const CPU_STATE_NICE: ::c_int = 3;
1937 pub const CPU_STATE_MAX: ::c_int = 4;
1938
1939 pub const PROCESSOR_BASIC_INFO: ::c_int = 1;
1940 pub const PROCESSOR_CPU_LOAD_INFO: ::c_int = 2;
1941 pub const PROCESSOR_PM_REGS_INFO: ::c_int = 0x10000001;
1942 pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002;
1943 pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4;
1944 pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5;
1945
1946 deprecated_mach! {
1947 pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
1948 pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
1949 pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
1950 pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
1951 pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
1952 pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
1953 pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
1954 pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
1955 pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
1956 pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
1957 pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
1958 pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
1959 pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f;
1960 pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f;
1961 pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED |
1962 VM_FLAGS_ANYWHERE |
1963 VM_FLAGS_RANDOM_ADDR |
1964 VM_FLAGS_OVERWRITE |
1965 VM_FLAGS_RETURN_DATA_ADDR |
1966 VM_FLAGS_RESILIENT_CODESIGN;
1967
1968 pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
1969 pub const SUPERPAGE_NONE: ::c_int = 0;
1970 pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
1971 pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
1972 VM_FLAGS_SUPERPAGE_SHIFT;
1973 pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
1974 VM_FLAGS_SUPERPAGE_SHIFT;
1975 pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
1976 pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
1977 VM_FLAGS_SUPERPAGE_SHIFT;
1978
1979 pub const VM_MEMORY_MALLOC: ::c_int = 1;
1980 pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
1981 pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
1982 pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
1983 pub const VM_MEMORY_SBRK: ::c_int = 5;
1984 pub const VM_MEMORY_REALLOC: ::c_int = 6;
1985 pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
1986 pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
1987 pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
1988 pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
1989 pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
1990 pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
1991 pub const VM_MEMORY_IOKIT: ::c_int = 21;
1992 pub const VM_MEMORY_STACK: ::c_int = 30;
1993 pub const VM_MEMORY_GUARD: ::c_int = 31;
1994 pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
1995 pub const VM_MEMORY_DYLIB: ::c_int = 33;
1996 pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
1997 pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
1998 pub const VM_MEMORY_APPKIT: ::c_int = 40;
1999 pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
2000 pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
2001 pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
2002 pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
2003 pub const VM_MEMORY_JAVA: ::c_int = 44;
2004 pub const VM_MEMORY_COREDATA: ::c_int = 45;
2005 pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
2006 pub const VM_MEMORY_ATS: ::c_int = 50;
2007 pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
2008 pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
2009 pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
2010 pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
2011 pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
2012 pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
2013 pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
2014 pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
2015 pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
2016 pub const VM_MEMORY_DYLD: ::c_int = 60;
2017 pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
2018 pub const VM_MEMORY_SQLITE: ::c_int = 62;
2019 pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
2020 pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
2021 pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
2022 pub const VM_MEMORY_GLSL: ::c_int = 66;
2023 pub const VM_MEMORY_OPENCL: ::c_int = 67;
2024 pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
2025 pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
2026 pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
2027 pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
2028 pub const VM_MEMORY_ASSETSD: ::c_int = 72;
2029 pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
2030 pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
2031 pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
2032 pub const VM_MEMORY_COREUI: ::c_int = 76;
2033 pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
2034 pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
2035 pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
2036 pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
2037 pub const VM_MEMORY_ASL: ::c_int = 81;
2038 pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
2039 pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
2040 pub const VM_MEMORY_DHMM: ::c_int = 84;
2041 pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
2042 pub const VM_MEMORY_SKYWALK: ::c_int = 87;
2043 pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
2044 pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
2045 }
2046
2047 pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
2048
2049 pub const MCL_CURRENT: ::c_int = 0x0001;
2050 pub const MCL_FUTURE: ::c_int = 0x0002;
2051
2052 pub const MS_ASYNC: ::c_int = 0x0001;
2053 pub const MS_INVALIDATE: ::c_int = 0x0002;
2054 pub const MS_SYNC: ::c_int = 0x0010;
2055
2056 pub const MS_KILLPAGES: ::c_int = 0x0004;
2057 pub const MS_DEACTIVATE: ::c_int = 0x0008;
2058
2059 pub const EPERM: ::c_int = 1;
2060 pub const ENOENT: ::c_int = 2;
2061 pub const ESRCH: ::c_int = 3;
2062 pub const EINTR: ::c_int = 4;
2063 pub const EIO: ::c_int = 5;
2064 pub const ENXIO: ::c_int = 6;
2065 pub const E2BIG: ::c_int = 7;
2066 pub const ENOEXEC: ::c_int = 8;
2067 pub const EBADF: ::c_int = 9;
2068 pub const ECHILD: ::c_int = 10;
2069 pub const EDEADLK: ::c_int = 11;
2070 pub const ENOMEM: ::c_int = 12;
2071 pub const EACCES: ::c_int = 13;
2072 pub const EFAULT: ::c_int = 14;
2073 pub const ENOTBLK: ::c_int = 15;
2074 pub const EBUSY: ::c_int = 16;
2075 pub const EEXIST: ::c_int = 17;
2076 pub const EXDEV: ::c_int = 18;
2077 pub const ENODEV: ::c_int = 19;
2078 pub const ENOTDIR: ::c_int = 20;
2079 pub const EISDIR: ::c_int = 21;
2080 pub const EINVAL: ::c_int = 22;
2081 pub const ENFILE: ::c_int = 23;
2082 pub const EMFILE: ::c_int = 24;
2083 pub const ENOTTY: ::c_int = 25;
2084 pub const ETXTBSY: ::c_int = 26;
2085 pub const EFBIG: ::c_int = 27;
2086 pub const ENOSPC: ::c_int = 28;
2087 pub const ESPIPE: ::c_int = 29;
2088 pub const EROFS: ::c_int = 30;
2089 pub const EMLINK: ::c_int = 31;
2090 pub const EPIPE: ::c_int = 32;
2091 pub const EDOM: ::c_int = 33;
2092 pub const ERANGE: ::c_int = 34;
2093 pub const EAGAIN: ::c_int = 35;
2094 pub const EWOULDBLOCK: ::c_int = EAGAIN;
2095 pub const EINPROGRESS: ::c_int = 36;
2096 pub const EALREADY: ::c_int = 37;
2097 pub const ENOTSOCK: ::c_int = 38;
2098 pub const EDESTADDRREQ: ::c_int = 39;
2099 pub const EMSGSIZE: ::c_int = 40;
2100 pub const EPROTOTYPE: ::c_int = 41;
2101 pub const ENOPROTOOPT: ::c_int = 42;
2102 pub const EPROTONOSUPPORT: ::c_int = 43;
2103 pub const ESOCKTNOSUPPORT: ::c_int = 44;
2104 pub const ENOTSUP: ::c_int = 45;
2105 pub const EPFNOSUPPORT: ::c_int = 46;
2106 pub const EAFNOSUPPORT: ::c_int = 47;
2107 pub const EADDRINUSE: ::c_int = 48;
2108 pub const EADDRNOTAVAIL: ::c_int = 49;
2109 pub const ENETDOWN: ::c_int = 50;
2110 pub const ENETUNREACH: ::c_int = 51;
2111 pub const ENETRESET: ::c_int = 52;
2112 pub const ECONNABORTED: ::c_int = 53;
2113 pub const ECONNRESET: ::c_int = 54;
2114 pub const ENOBUFS: ::c_int = 55;
2115 pub const EISCONN: ::c_int = 56;
2116 pub const ENOTCONN: ::c_int = 57;
2117 pub const ESHUTDOWN: ::c_int = 58;
2118 pub const ETOOMANYREFS: ::c_int = 59;
2119 pub const ETIMEDOUT: ::c_int = 60;
2120 pub const ECONNREFUSED: ::c_int = 61;
2121 pub const ELOOP: ::c_int = 62;
2122 pub const ENAMETOOLONG: ::c_int = 63;
2123 pub const EHOSTDOWN: ::c_int = 64;
2124 pub const EHOSTUNREACH: ::c_int = 65;
2125 pub const ENOTEMPTY: ::c_int = 66;
2126 pub const EPROCLIM: ::c_int = 67;
2127 pub const EUSERS: ::c_int = 68;
2128 pub const EDQUOT: ::c_int = 69;
2129 pub const ESTALE: ::c_int = 70;
2130 pub const EREMOTE: ::c_int = 71;
2131 pub const EBADRPC: ::c_int = 72;
2132 pub const ERPCMISMATCH: ::c_int = 73;
2133 pub const EPROGUNAVAIL: ::c_int = 74;
2134 pub const EPROGMISMATCH: ::c_int = 75;
2135 pub const EPROCUNAVAIL: ::c_int = 76;
2136 pub const ENOLCK: ::c_int = 77;
2137 pub const ENOSYS: ::c_int = 78;
2138 pub const EFTYPE: ::c_int = 79;
2139 pub const EAUTH: ::c_int = 80;
2140 pub const ENEEDAUTH: ::c_int = 81;
2141 pub const EPWROFF: ::c_int = 82;
2142 pub const EDEVERR: ::c_int = 83;
2143 pub const EOVERFLOW: ::c_int = 84;
2144 pub const EBADEXEC: ::c_int = 85;
2145 pub const EBADARCH: ::c_int = 86;
2146 pub const ESHLIBVERS: ::c_int = 87;
2147 pub const EBADMACHO: ::c_int = 88;
2148 pub const ECANCELED: ::c_int = 89;
2149 pub const EIDRM: ::c_int = 90;
2150 pub const ENOMSG: ::c_int = 91;
2151 pub const EILSEQ: ::c_int = 92;
2152 pub const ENOATTR: ::c_int = 93;
2153 pub const EBADMSG: ::c_int = 94;
2154 pub const EMULTIHOP: ::c_int = 95;
2155 pub const ENODATA: ::c_int = 96;
2156 pub const ENOLINK: ::c_int = 97;
2157 pub const ENOSR: ::c_int = 98;
2158 pub const ENOSTR: ::c_int = 99;
2159 pub const EPROTO: ::c_int = 100;
2160 pub const ETIME: ::c_int = 101;
2161 pub const EOPNOTSUPP: ::c_int = 102;
2162 pub const ENOPOLICY: ::c_int = 103;
2163 pub const ENOTRECOVERABLE: ::c_int = 104;
2164 pub const EOWNERDEAD: ::c_int = 105;
2165 pub const EQFULL: ::c_int = 106;
2166 pub const ELAST: ::c_int = 106;
2167
2168 pub const EAI_AGAIN: ::c_int = 2;
2169 pub const EAI_BADFLAGS: ::c_int = 3;
2170 pub const EAI_FAIL: ::c_int = 4;
2171 pub const EAI_FAMILY: ::c_int = 5;
2172 pub const EAI_MEMORY: ::c_int = 6;
2173 pub const EAI_NODATA: ::c_int = 7;
2174 pub const EAI_NONAME: ::c_int = 8;
2175 pub const EAI_SERVICE: ::c_int = 9;
2176 pub const EAI_SOCKTYPE: ::c_int = 10;
2177 pub const EAI_SYSTEM: ::c_int = 11;
2178 pub const EAI_OVERFLOW: ::c_int = 14;
2179
2180 pub const F_DUPFD: ::c_int = 0;
2181 pub const F_DUPFD_CLOEXEC: ::c_int = 67;
2182 pub const F_GETFD: ::c_int = 1;
2183 pub const F_SETFD: ::c_int = 2;
2184 pub const F_GETFL: ::c_int = 3;
2185 pub const F_SETFL: ::c_int = 4;
2186 pub const F_PREALLOCATE: ::c_int = 42;
2187 pub const F_RDADVISE: ::c_int = 44;
2188 pub const F_RDAHEAD: ::c_int = 45;
2189 pub const F_NOCACHE: ::c_int = 48;
2190 pub const F_GETPATH: ::c_int = 50;
2191 pub const F_FULLFSYNC: ::c_int = 51;
2192 pub const F_FREEZE_FS: ::c_int = 53;
2193 pub const F_THAW_FS: ::c_int = 54;
2194 pub const F_GLOBAL_NOCACHE: ::c_int = 55;
2195 pub const F_NODIRECT: ::c_int = 62;
2196
2197 pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
2198 pub const F_ALLOCATEALL: ::c_uint = 0x04;
2199
2200 pub const F_PEOFPOSMODE: ::c_int = 3;
2201 pub const F_VOLPOSMODE: ::c_int = 4;
2202
2203 pub const AT_FDCWD: ::c_int = -2;
2204 pub const AT_EACCESS: ::c_int = 0x0010;
2205 pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
2206 pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
2207 pub const AT_REMOVEDIR: ::c_int = 0x0080;
2208
2209 pub const TIOCMODG: ::c_ulong = 0x40047403;
2210 pub const TIOCMODS: ::c_ulong = 0x80047404;
2211 pub const TIOCM_LE: ::c_int = 0x1;
2212 pub const TIOCM_DTR: ::c_int = 0x2;
2213 pub const TIOCM_RTS: ::c_int = 0x4;
2214 pub const TIOCM_ST: ::c_int = 0x8;
2215 pub const TIOCM_SR: ::c_int = 0x10;
2216 pub const TIOCM_CTS: ::c_int = 0x20;
2217 pub const TIOCM_CAR: ::c_int = 0x40;
2218 pub const TIOCM_CD: ::c_int = 0x40;
2219 pub const TIOCM_RNG: ::c_int = 0x80;
2220 pub const TIOCM_RI: ::c_int = 0x80;
2221 pub const TIOCM_DSR: ::c_int = 0x100;
2222 pub const TIOCEXCL: ::c_int = 0x2000740d;
2223 pub const TIOCNXCL: ::c_int = 0x2000740e;
2224 pub const TIOCFLUSH: ::c_ulong = 0x80047410;
2225 pub const TIOCGETD: ::c_ulong = 0x4004741a;
2226 pub const TIOCSETD: ::c_ulong = 0x8004741b;
2227 pub const TIOCIXON: ::c_uint = 0x20007481;
2228 pub const TIOCIXOFF: ::c_uint = 0x20007480;
2229 pub const TIOCSDTR: ::c_uint = 0x20007479;
2230 pub const TIOCCDTR: ::c_uint = 0x20007478;
2231 pub const TIOCGPGRP: ::c_ulong = 0x40047477;
2232 pub const TIOCSPGRP: ::c_ulong = 0x80047476;
2233 pub const TIOCOUTQ: ::c_ulong = 0x40047473;
2234 pub const TIOCSTI: ::c_ulong = 0x80017472;
2235 pub const TIOCNOTTY: ::c_uint = 0x20007471;
2236 pub const TIOCPKT: ::c_ulong = 0x80047470;
2237 pub const TIOCPKT_DATA: ::c_int = 0x0;
2238 pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
2239 pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
2240 pub const TIOCPKT_STOP: ::c_int = 0x4;
2241 pub const TIOCPKT_START: ::c_int = 0x8;
2242 pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
2243 pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
2244 pub const TIOCPKT_IOCTL: ::c_int = 0x40;
2245 pub const TIOCSTOP: ::c_uint = 0x2000746f;
2246 pub const TIOCSTART: ::c_uint = 0x2000746e;
2247 pub const TIOCMSET: ::c_ulong = 0x8004746d;
2248 pub const TIOCMBIS: ::c_ulong = 0x8004746c;
2249 pub const TIOCMBIC: ::c_ulong = 0x8004746b;
2250 pub const TIOCMGET: ::c_ulong = 0x4004746a;
2251 pub const TIOCREMOTE: ::c_ulong = 0x80047469;
2252 pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
2253 pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
2254 pub const TIOCUCNTL: ::c_ulong = 0x80047466;
2255 pub const TIOCSTAT: ::c_uint = 0x20007465;
2256 pub const TIOCSCONS: ::c_uint = 0x20007463;
2257 pub const TIOCCONS: ::c_ulong = 0x80047462;
2258 pub const TIOCSCTTY: ::c_uint = 0x20007461;
2259 pub const TIOCEXT: ::c_ulong = 0x80047460;
2260 pub const TIOCSIG: ::c_uint = 0x2000745f;
2261 pub const TIOCDRAIN: ::c_uint = 0x2000745e;
2262 pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
2263 pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
2264 pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
2265 pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
2266 pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455;
2267 pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
2268 pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
2269 pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
2270
2271 pub const BIOCGRSIG: ::c_ulong = 0x40044272;
2272 pub const BIOCSRSIG: ::c_ulong = 0x80044273;
2273 pub const BIOCSDLT: ::c_ulong = 0x80044278;
2274 pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
2275 pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
2276 pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279;
2277
2278 pub const FIODTYPE: ::c_ulong = 0x4004667a;
2279
2280 pub const B0: speed_t = 0;
2281 pub const B50: speed_t = 50;
2282 pub const B75: speed_t = 75;
2283 pub const B110: speed_t = 110;
2284 pub const B134: speed_t = 134;
2285 pub const B150: speed_t = 150;
2286 pub const B200: speed_t = 200;
2287 pub const B300: speed_t = 300;
2288 pub const B600: speed_t = 600;
2289 pub const B1200: speed_t = 1200;
2290 pub const B1800: speed_t = 1800;
2291 pub const B2400: speed_t = 2400;
2292 pub const B4800: speed_t = 4800;
2293 pub const B9600: speed_t = 9600;
2294 pub const B19200: speed_t = 19200;
2295 pub const B38400: speed_t = 38400;
2296 pub const B7200: speed_t = 7200;
2297 pub const B14400: speed_t = 14400;
2298 pub const B28800: speed_t = 28800;
2299 pub const B57600: speed_t = 57600;
2300 pub const B76800: speed_t = 76800;
2301 pub const B115200: speed_t = 115200;
2302 pub const B230400: speed_t = 230400;
2303 pub const EXTA: speed_t = 19200;
2304 pub const EXTB: speed_t = 38400;
2305
2306 pub const SIGTRAP: ::c_int = 5;
2307
2308 pub const GLOB_APPEND: ::c_int = 0x0001;
2309 pub const GLOB_DOOFFS: ::c_int = 0x0002;
2310 pub const GLOB_ERR: ::c_int = 0x0004;
2311 pub const GLOB_MARK: ::c_int = 0x0008;
2312 pub const GLOB_NOCHECK: ::c_int = 0x0010;
2313 pub const GLOB_NOSORT: ::c_int = 0x0020;
2314 pub const GLOB_NOESCAPE: ::c_int = 0x2000;
2315
2316 pub const GLOB_NOSPACE: ::c_int = -1;
2317 pub const GLOB_ABORTED: ::c_int = -2;
2318 pub const GLOB_NOMATCH: ::c_int = -3;
2319
2320 pub const POSIX_MADV_NORMAL: ::c_int = 0;
2321 pub const POSIX_MADV_RANDOM: ::c_int = 1;
2322 pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
2323 pub const POSIX_MADV_WILLNEED: ::c_int = 3;
2324 pub const POSIX_MADV_DONTNEED: ::c_int = 4;
2325
2326 pub const _SC_IOV_MAX: ::c_int = 56;
2327 pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
2328 pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
2329 pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
2330 pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
2331 pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
2332 pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
2333 pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
2334 pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
2335 pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
2336 pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
2337 pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
2338 pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
2339 pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
2340 pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
2341 pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
2342 pub const _SC_THREADS: ::c_int = 96;
2343 pub const _SC_TTY_NAME_MAX: ::c_int = 101;
2344 pub const _SC_ATEXIT_MAX: ::c_int = 107;
2345 pub const _SC_XOPEN_CRYPT: ::c_int = 108;
2346 pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
2347 pub const _SC_XOPEN_LEGACY: ::c_int = 110;
2348 pub const _SC_XOPEN_REALTIME: ::c_int = 111;
2349 pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
2350 pub const _SC_XOPEN_SHM: ::c_int = 113;
2351 pub const _SC_XOPEN_UNIX: ::c_int = 115;
2352 pub const _SC_XOPEN_VERSION: ::c_int = 116;
2353 pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121;
2354 pub const _SC_PHYS_PAGES: ::c_int = 200;
2355
2356 pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
2357 pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
2358 pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
2359 pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
2360 #[cfg(target_arch = "aarch64")]
2361 pub const PTHREAD_STACK_MIN: ::size_t = 16384;
2362 #[cfg(not(target_arch = "aarch64"))]
2363 pub const PTHREAD_STACK_MIN: ::size_t = 8192;
2364
2365 pub const RLIMIT_CPU: ::c_int = 0;
2366 pub const RLIMIT_FSIZE: ::c_int = 1;
2367 pub const RLIMIT_DATA: ::c_int = 2;
2368 pub const RLIMIT_STACK: ::c_int = 3;
2369 pub const RLIMIT_CORE: ::c_int = 4;
2370 pub const RLIMIT_AS: ::c_int = 5;
2371 pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
2372 pub const RLIMIT_MEMLOCK: ::c_int = 6;
2373 pub const RLIMIT_NPROC: ::c_int = 7;
2374 pub const RLIMIT_NOFILE: ::c_int = 8;
2375 #[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
2376 pub const RLIM_NLIMITS: ::c_int = 9;
2377 pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
2378
2379 pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
2380
2381 pub const RUSAGE_SELF: ::c_int = 0;
2382 pub const RUSAGE_CHILDREN: ::c_int = -1;
2383
2384 pub const MADV_NORMAL: ::c_int = 0;
2385 pub const MADV_RANDOM: ::c_int = 1;
2386 pub const MADV_SEQUENTIAL: ::c_int = 2;
2387 pub const MADV_WILLNEED: ::c_int = 3;
2388 pub const MADV_DONTNEED: ::c_int = 4;
2389 pub const MADV_FREE: ::c_int = 5;
2390 pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6;
2391 pub const MADV_FREE_REUSABLE: ::c_int = 7;
2392 pub const MADV_FREE_REUSE: ::c_int = 8;
2393 pub const MADV_CAN_REUSE: ::c_int = 9;
2394
2395 pub const MINCORE_INCORE: ::c_int = 0x1;
2396 pub const MINCORE_REFERENCED: ::c_int = 0x2;
2397 pub const MINCORE_MODIFIED: ::c_int = 0x4;
2398 pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
2399 pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
2400
2401 //
2402 // sys/netinet/in.h
2403 // Protocols (RFC 1700)
2404 // NOTE: These are in addition to the constants defined in src/unix/mod.rs
2405
2406 // IPPROTO_IP defined in src/unix/mod.rs
2407 /// IP6 hop-by-hop options
2408 pub const IPPROTO_HOPOPTS: ::c_int = 0;
2409 // IPPROTO_ICMP defined in src/unix/mod.rs
2410 /// group mgmt protocol
2411 pub const IPPROTO_IGMP: ::c_int = 2;
2412 /// gateway<sup>2</sup> (deprecated)
2413 pub const IPPROTO_GGP: ::c_int = 3;
2414 /// for compatibility
2415 pub const IPPROTO_IPIP: ::c_int = 4;
2416 // IPPROTO_TCP defined in src/unix/mod.rs
2417 /// Stream protocol II.
2418 pub const IPPROTO_ST: ::c_int = 7;
2419 /// exterior gateway protocol
2420 pub const IPPROTO_EGP: ::c_int = 8;
2421 /// private interior gateway
2422 pub const IPPROTO_PIGP: ::c_int = 9;
2423 /// BBN RCC Monitoring
2424 pub const IPPROTO_RCCMON: ::c_int = 10;
2425 /// network voice protocol
2426 pub const IPPROTO_NVPII: ::c_int = 11;
2427 /// pup
2428 pub const IPPROTO_PUP: ::c_int = 12;
2429 /// Argus
2430 pub const IPPROTO_ARGUS: ::c_int = 13;
2431 /// EMCON
2432 pub const IPPROTO_EMCON: ::c_int = 14;
2433 /// Cross Net Debugger
2434 pub const IPPROTO_XNET: ::c_int = 15;
2435 /// Chaos
2436 pub const IPPROTO_CHAOS: ::c_int = 16;
2437 // IPPROTO_UDP defined in src/unix/mod.rs
2438 /// Multiplexing
2439 pub const IPPROTO_MUX: ::c_int = 18;
2440 /// DCN Measurement Subsystems
2441 pub const IPPROTO_MEAS: ::c_int = 19;
2442 /// Host Monitoring
2443 pub const IPPROTO_HMP: ::c_int = 20;
2444 /// Packet Radio Measurement
2445 pub const IPPROTO_PRM: ::c_int = 21;
2446 /// xns idp
2447 pub const IPPROTO_IDP: ::c_int = 22;
2448 /// Trunk-1
2449 pub const IPPROTO_TRUNK1: ::c_int = 23;
2450 /// Trunk-2
2451 pub const IPPROTO_TRUNK2: ::c_int = 24;
2452 /// Leaf-1
2453 pub const IPPROTO_LEAF1: ::c_int = 25;
2454 /// Leaf-2
2455 pub const IPPROTO_LEAF2: ::c_int = 26;
2456 /// Reliable Data
2457 pub const IPPROTO_RDP: ::c_int = 27;
2458 /// Reliable Transaction
2459 pub const IPPROTO_IRTP: ::c_int = 28;
2460 /// tp-4 w/ class negotiation
2461 pub const IPPROTO_TP: ::c_int = 29;
2462 /// Bulk Data Transfer
2463 pub const IPPROTO_BLT: ::c_int = 30;
2464 /// Network Services
2465 pub const IPPROTO_NSP: ::c_int = 31;
2466 /// Merit Internodal
2467 pub const IPPROTO_INP: ::c_int = 32;
2468 /// Sequential Exchange
2469 pub const IPPROTO_SEP: ::c_int = 33;
2470 /// Third Party Connect
2471 pub const IPPROTO_3PC: ::c_int = 34;
2472 /// InterDomain Policy Routing
2473 pub const IPPROTO_IDPR: ::c_int = 35;
2474 /// XTP
2475 pub const IPPROTO_XTP: ::c_int = 36;
2476 /// Datagram Delivery
2477 pub const IPPROTO_DDP: ::c_int = 37;
2478 /// Control Message Transport
2479 pub const IPPROTO_CMTP: ::c_int = 38;
2480 /// TP++ Transport
2481 pub const IPPROTO_TPXX: ::c_int = 39;
2482 /// IL transport protocol
2483 pub const IPPROTO_IL: ::c_int = 40;
2484 // IPPROTO_IPV6 defined in src/unix/mod.rs
2485 /// Source Demand Routing
2486 pub const IPPROTO_SDRP: ::c_int = 42;
2487 /// IP6 routing header
2488 pub const IPPROTO_ROUTING: ::c_int = 43;
2489 /// IP6 fragmentation header
2490 pub const IPPROTO_FRAGMENT: ::c_int = 44;
2491 /// InterDomain Routing
2492 pub const IPPROTO_IDRP: ::c_int = 45;
2493 /// resource reservation
2494 pub const IPPROTO_RSVP: ::c_int = 46;
2495 /// General Routing Encap.
2496 pub const IPPROTO_GRE: ::c_int = 47;
2497 /// Mobile Host Routing
2498 pub const IPPROTO_MHRP: ::c_int = 48;
2499 /// BHA
2500 pub const IPPROTO_BHA: ::c_int = 49;
2501 /// IP6 Encap Sec. Payload
2502 pub const IPPROTO_ESP: ::c_int = 50;
2503 /// IP6 Auth Header
2504 pub const IPPROTO_AH: ::c_int = 51;
2505 /// Integ. Net Layer Security
2506 pub const IPPROTO_INLSP: ::c_int = 52;
2507 /// IP with encryption
2508 pub const IPPROTO_SWIPE: ::c_int = 53;
2509 /// Next Hop Resolution
2510 pub const IPPROTO_NHRP: ::c_int = 54;
2511 /* 55-57: Unassigned */
2512 // IPPROTO_ICMPV6 defined in src/unix/mod.rs
2513 /// IP6 no next header
2514 pub const IPPROTO_NONE: ::c_int = 59;
2515 /// IP6 destination option
2516 pub const IPPROTO_DSTOPTS: ::c_int = 60;
2517 /// any host internal protocol
2518 pub const IPPROTO_AHIP: ::c_int = 61;
2519 /// CFTP
2520 pub const IPPROTO_CFTP: ::c_int = 62;
2521 /// "hello" routing protocol
2522 pub const IPPROTO_HELLO: ::c_int = 63;
2523 /// SATNET/Backroom EXPAK
2524 pub const IPPROTO_SATEXPAK: ::c_int = 64;
2525 /// Kryptolan
2526 pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
2527 /// Remote Virtual Disk
2528 pub const IPPROTO_RVD: ::c_int = 66;
2529 /// Pluribus Packet Core
2530 pub const IPPROTO_IPPC: ::c_int = 67;
2531 /// Any distributed FS
2532 pub const IPPROTO_ADFS: ::c_int = 68;
2533 /// Satnet Monitoring
2534 pub const IPPROTO_SATMON: ::c_int = 69;
2535 /// VISA Protocol
2536 pub const IPPROTO_VISA: ::c_int = 70;
2537 /// Packet Core Utility
2538 pub const IPPROTO_IPCV: ::c_int = 71;
2539 /// Comp. Prot. Net. Executive
2540 pub const IPPROTO_CPNX: ::c_int = 72;
2541 /// Comp. Prot. HeartBeat
2542 pub const IPPROTO_CPHB: ::c_int = 73;
2543 /// Wang Span Network
2544 pub const IPPROTO_WSN: ::c_int = 74;
2545 /// Packet Video Protocol
2546 pub const IPPROTO_PVP: ::c_int = 75;
2547 /// BackRoom SATNET Monitoring
2548 pub const IPPROTO_BRSATMON: ::c_int = 76;
2549 /// Sun net disk proto (temp.)
2550 pub const IPPROTO_ND: ::c_int = 77;
2551 /// WIDEBAND Monitoring
2552 pub const IPPROTO_WBMON: ::c_int = 78;
2553 /// WIDEBAND EXPAK
2554 pub const IPPROTO_WBEXPAK: ::c_int = 79;
2555 /// ISO cnlp
2556 pub const IPPROTO_EON: ::c_int = 80;
2557 /// VMTP
2558 pub const IPPROTO_VMTP: ::c_int = 81;
2559 /// Secure VMTP
2560 pub const IPPROTO_SVMTP: ::c_int = 82;
2561 /// Banyon VINES
2562 pub const IPPROTO_VINES: ::c_int = 83;
2563 /// TTP
2564 pub const IPPROTO_TTP: ::c_int = 84;
2565 /// NSFNET-IGP
2566 pub const IPPROTO_IGP: ::c_int = 85;
2567 /// dissimilar gateway prot.
2568 pub const IPPROTO_DGP: ::c_int = 86;
2569 /// TCF
2570 pub const IPPROTO_TCF: ::c_int = 87;
2571 /// Cisco/GXS IGRP
2572 pub const IPPROTO_IGRP: ::c_int = 88;
2573 /// OSPFIGP
2574 pub const IPPROTO_OSPFIGP: ::c_int = 89;
2575 /// Strite RPC protocol
2576 pub const IPPROTO_SRPC: ::c_int = 90;
2577 /// Locus Address Resoloution
2578 pub const IPPROTO_LARP: ::c_int = 91;
2579 /// Multicast Transport
2580 pub const IPPROTO_MTP: ::c_int = 92;
2581 /// AX.25 Frames
2582 pub const IPPROTO_AX25: ::c_int = 93;
2583 /// IP encapsulated in IP
2584 pub const IPPROTO_IPEIP: ::c_int = 94;
2585 /// Mobile Int.ing control
2586 pub const IPPROTO_MICP: ::c_int = 95;
2587 /// Semaphore Comm. security
2588 pub const IPPROTO_SCCSP: ::c_int = 96;
2589 /// Ethernet IP encapsulation
2590 pub const IPPROTO_ETHERIP: ::c_int = 97;
2591 /// encapsulation header
2592 pub const IPPROTO_ENCAP: ::c_int = 98;
2593 /// any private encr. scheme
2594 pub const IPPROTO_APES: ::c_int = 99;
2595 /// GMTP
2596 pub const IPPROTO_GMTP: ::c_int = 100;
2597
2598 /* 101-254: Partly Unassigned */
2599 /// Protocol Independent Mcast
2600 pub const IPPROTO_PIM: ::c_int = 103;
2601 /// payload compression (IPComp)
2602 pub const IPPROTO_IPCOMP: ::c_int = 108;
2603 /// PGM
2604 pub const IPPROTO_PGM: ::c_int = 113;
2605 /// SCTP
2606 pub const IPPROTO_SCTP: ::c_int = 132;
2607
2608 /* 255: Reserved */
2609 /* BSD Private, local use, namespace incursion */
2610 /// divert pseudo-protocol
2611 pub const IPPROTO_DIVERT: ::c_int = 254;
2612 /// raw IP packet
2613 pub const IPPROTO_RAW: ::c_int = 255;
2614 pub const IPPROTO_MAX: ::c_int = 256;
2615 /// last return value of *_input(), meaning "all job for this pkt is done".
2616 pub const IPPROTO_DONE: ::c_int = 257;
2617
2618 pub const AF_UNSPEC: ::c_int = 0;
2619 pub const AF_LOCAL: ::c_int = 1;
2620 pub const AF_UNIX: ::c_int = AF_LOCAL;
2621 pub const AF_INET: ::c_int = 2;
2622 pub const AF_IMPLINK: ::c_int = 3;
2623 pub const AF_PUP: ::c_int = 4;
2624 pub const AF_CHAOS: ::c_int = 5;
2625 pub const AF_NS: ::c_int = 6;
2626 pub const AF_ISO: ::c_int = 7;
2627 pub const AF_OSI: ::c_int = AF_ISO;
2628 pub const AF_ECMA: ::c_int = 8;
2629 pub const AF_DATAKIT: ::c_int = 9;
2630 pub const AF_CCITT: ::c_int = 10;
2631 pub const AF_SNA: ::c_int = 11;
2632 pub const AF_DECnet: ::c_int = 12;
2633 pub const AF_DLI: ::c_int = 13;
2634 pub const AF_LAT: ::c_int = 14;
2635 pub const AF_HYLINK: ::c_int = 15;
2636 pub const AF_APPLETALK: ::c_int = 16;
2637 pub const AF_ROUTE: ::c_int = 17;
2638 pub const AF_LINK: ::c_int = 18;
2639 pub const pseudo_AF_XTP: ::c_int = 19;
2640 pub const AF_COIP: ::c_int = 20;
2641 pub const AF_CNT: ::c_int = 21;
2642 pub const pseudo_AF_RTIP: ::c_int = 22;
2643 pub const AF_IPX: ::c_int = 23;
2644 pub const AF_SIP: ::c_int = 24;
2645 pub const pseudo_AF_PIP: ::c_int = 25;
2646 pub const AF_ISDN: ::c_int = 28;
2647 pub const AF_E164: ::c_int = AF_ISDN;
2648 pub const pseudo_AF_KEY: ::c_int = 29;
2649 pub const AF_INET6: ::c_int = 30;
2650 pub const AF_NATM: ::c_int = 31;
2651 pub const AF_SYSTEM: ::c_int = 32;
2652 pub const AF_NETBIOS: ::c_int = 33;
2653 pub const AF_PPP: ::c_int = 34;
2654 pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
2655 pub const AF_SYS_CONTROL: ::c_int = 2;
2656
2657 pub const SYSPROTO_EVENT: ::c_int = 1;
2658 pub const SYSPROTO_CONTROL: ::c_int = 2;
2659
2660 pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
2661 pub const PF_LOCAL: ::c_int = AF_LOCAL;
2662 pub const PF_UNIX: ::c_int = PF_LOCAL;
2663 pub const PF_INET: ::c_int = AF_INET;
2664 pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
2665 pub const PF_PUP: ::c_int = AF_PUP;
2666 pub const PF_CHAOS: ::c_int = AF_CHAOS;
2667 pub const PF_NS: ::c_int = AF_NS;
2668 pub const PF_ISO: ::c_int = AF_ISO;
2669 pub const PF_OSI: ::c_int = AF_ISO;
2670 pub const PF_ECMA: ::c_int = AF_ECMA;
2671 pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
2672 pub const PF_CCITT: ::c_int = AF_CCITT;
2673 pub const PF_SNA: ::c_int = AF_SNA;
2674 pub const PF_DECnet: ::c_int = AF_DECnet;
2675 pub const PF_DLI: ::c_int = AF_DLI;
2676 pub const PF_LAT: ::c_int = AF_LAT;
2677 pub const PF_HYLINK: ::c_int = AF_HYLINK;
2678 pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
2679 pub const PF_ROUTE: ::c_int = AF_ROUTE;
2680 pub const PF_LINK: ::c_int = AF_LINK;
2681 pub const PF_XTP: ::c_int = pseudo_AF_XTP;
2682 pub const PF_COIP: ::c_int = AF_COIP;
2683 pub const PF_CNT: ::c_int = AF_CNT;
2684 pub const PF_SIP: ::c_int = AF_SIP;
2685 pub const PF_IPX: ::c_int = AF_IPX;
2686 pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
2687 pub const PF_PIP: ::c_int = pseudo_AF_PIP;
2688 pub const PF_ISDN: ::c_int = AF_ISDN;
2689 pub const PF_KEY: ::c_int = pseudo_AF_KEY;
2690 pub const PF_INET6: ::c_int = AF_INET6;
2691 pub const PF_NATM: ::c_int = AF_NATM;
2692 pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
2693 pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
2694 pub const PF_PPP: ::c_int = AF_PPP;
2695
2696 pub const NET_RT_DUMP: ::c_int = 1;
2697 pub const NET_RT_FLAGS: ::c_int = 2;
2698 pub const NET_RT_IFLIST: ::c_int = 3;
2699
2700 pub const SOMAXCONN: ::c_int = 128;
2701
2702 pub const SOCK_MAXADDRLEN: ::c_int = 255;
2703
2704 pub const SOCK_STREAM: ::c_int = 1;
2705 pub const SOCK_DGRAM: ::c_int = 2;
2706 pub const SOCK_RAW: ::c_int = 3;
2707 pub const SOCK_RDM: ::c_int = 4;
2708 pub const SOCK_SEQPACKET: ::c_int = 5;
2709 pub const IP_TTL: ::c_int = 4;
2710 pub const IP_HDRINCL: ::c_int = 2;
2711 pub const IP_RECVDSTADDR: ::c_int = 7;
2712 pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
2713 pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
2714 pub const IP_RECVIF: ::c_int = 20;
2715 pub const IP_BOUND_IF: ::c_int = 25;
2716 pub const IP_PKTINFO: ::c_int = 26;
2717 pub const IP_RECVTOS: ::c_int = 27;
2718 pub const IPV6_JOIN_GROUP: ::c_int = 12;
2719 pub const IPV6_LEAVE_GROUP: ::c_int = 13;
2720 pub const IPV6_CHECKSUM: ::c_int = 26;
2721 pub const IPV6_RECVTCLASS: ::c_int = 35;
2722 pub const IPV6_TCLASS: ::c_int = 36;
2723 pub const IPV6_PKTINFO: ::c_int = 46;
2724 pub const IPV6_HOPLIMIT: ::c_int = 47;
2725 pub const IPV6_RECVPKTINFO: ::c_int = 61;
2726
2727 pub const TCP_NOPUSH: ::c_int = 4;
2728 pub const TCP_NOOPT: ::c_int = 8;
2729 pub const TCP_KEEPALIVE: ::c_int = 0x10;
2730 pub const TCP_KEEPINTVL: ::c_int = 0x101;
2731 pub const TCP_KEEPCNT: ::c_int = 0x102;
2732 /// Enable/Disable TCP Fastopen on this socket
2733 pub const TCP_FASTOPEN: ::c_int = 0x105;
2734
2735 pub const SOL_LOCAL: ::c_int = 0;
2736
2737 pub const LOCAL_PEERCRED: ::c_int = 0x001;
2738 pub const LOCAL_PEERPID: ::c_int = 0x002;
2739 pub const LOCAL_PEEREPID: ::c_int = 0x003;
2740 pub const LOCAL_PEERUUID: ::c_int = 0x004;
2741 pub const LOCAL_PEEREUUID: ::c_int = 0x005;
2742
2743 pub const SOL_SOCKET: ::c_int = 0xffff;
2744
2745 pub const SO_DEBUG: ::c_int = 0x01;
2746 pub const SO_ACCEPTCONN: ::c_int = 0x0002;
2747 pub const SO_REUSEADDR: ::c_int = 0x0004;
2748 pub const SO_KEEPALIVE: ::c_int = 0x0008;
2749 pub const SO_DONTROUTE: ::c_int = 0x0010;
2750 pub const SO_BROADCAST: ::c_int = 0x0020;
2751 pub const SO_USELOOPBACK: ::c_int = 0x0040;
2752 pub const SO_LINGER: ::c_int = 0x0080;
2753 pub const SO_OOBINLINE: ::c_int = 0x0100;
2754 pub const SO_REUSEPORT: ::c_int = 0x0200;
2755 pub const SO_TIMESTAMP: ::c_int = 0x0400;
2756 pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800;
2757 pub const SO_DONTTRUNC: ::c_int = 0x2000;
2758 pub const SO_WANTMORE: ::c_int = 0x4000;
2759 pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
2760 pub const SO_SNDBUF: ::c_int = 0x1001;
2761 pub const SO_RCVBUF: ::c_int = 0x1002;
2762 pub const SO_SNDLOWAT: ::c_int = 0x1003;
2763 pub const SO_RCVLOWAT: ::c_int = 0x1004;
2764 pub const SO_SNDTIMEO: ::c_int = 0x1005;
2765 pub const SO_RCVTIMEO: ::c_int = 0x1006;
2766 pub const SO_ERROR: ::c_int = 0x1007;
2767 pub const SO_TYPE: ::c_int = 0x1008;
2768 pub const SO_LABEL: ::c_int = 0x1010;
2769 pub const SO_PEERLABEL: ::c_int = 0x1011;
2770 pub const SO_NREAD: ::c_int = 0x1020;
2771 pub const SO_NKE: ::c_int = 0x1021;
2772 pub const SO_NOSIGPIPE: ::c_int = 0x1022;
2773 pub const SO_NOADDRERR: ::c_int = 0x1023;
2774 pub const SO_NWRITE: ::c_int = 0x1024;
2775 pub const SO_REUSESHAREUID: ::c_int = 0x1025;
2776 pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026;
2777 pub const SO_LINGER_SEC: ::c_int = 0x1080;
2778 pub const SO_RANDOMPORT: ::c_int = 0x1082;
2779 pub const SO_NP_EXTENSIONS: ::c_int = 0x1083;
2780
2781 pub const MSG_OOB: ::c_int = 0x1;
2782 pub const MSG_PEEK: ::c_int = 0x2;
2783 pub const MSG_DONTROUTE: ::c_int = 0x4;
2784 pub const MSG_EOR: ::c_int = 0x8;
2785 pub const MSG_TRUNC: ::c_int = 0x10;
2786 pub const MSG_CTRUNC: ::c_int = 0x20;
2787 pub const MSG_WAITALL: ::c_int = 0x40;
2788 pub const MSG_DONTWAIT: ::c_int = 0x80;
2789 pub const MSG_EOF: ::c_int = 0x100;
2790 pub const MSG_FLUSH: ::c_int = 0x400;
2791 pub const MSG_HOLD: ::c_int = 0x800;
2792 pub const MSG_SEND: ::c_int = 0x1000;
2793 pub const MSG_HAVEMORE: ::c_int = 0x2000;
2794 pub const MSG_RCVMORE: ::c_int = 0x4000;
2795 // pub const MSG_COMPAT: ::c_int = 0x8000;
2796
2797 pub const SCM_TIMESTAMP: ::c_int = 0x02;
2798 pub const SCM_CREDS: ::c_int = 0x03;
2799
2800 // https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156
2801 pub const IFF_UP: ::c_int = 0x1; // interface is up
2802 pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
2803 pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
2804 pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
2805 pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
2806 pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers
2807 pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
2808 pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
2809 pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
2810 pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
2811 pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
2812 pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
2813 pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
2814 pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
2815 pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
2816 pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
2817 pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
2818
2819 pub const SHUT_RD: ::c_int = 0;
2820 pub const SHUT_WR: ::c_int = 1;
2821 pub const SHUT_RDWR: ::c_int = 2;
2822
2823 pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0;
2824 /// ((sae_associd_t)(-1ULL))
2825 pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff;
2826
2827 pub const SAE_CONNID_ANY: ::sae_connid_t = 0;
2828 /// ((sae_connid_t)(-1ULL))
2829 pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff;
2830
2831 // connectx() flag parameters
2832
2833 /// resume connect() on read/write
2834 pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1;
2835 /// data is idempotent
2836 pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2;
2837 /// data includes security that replaces the TFO-cookie
2838 pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4;
2839
2840 pub const LOCK_SH: ::c_int = 1;
2841 pub const LOCK_EX: ::c_int = 2;
2842 pub const LOCK_NB: ::c_int = 4;
2843 pub const LOCK_UN: ::c_int = 8;
2844
2845 pub const MAP_COPY: ::c_int = 0x0002;
2846 pub const MAP_RENAME: ::c_int = 0x0020;
2847 pub const MAP_NORESERVE: ::c_int = 0x0040;
2848 pub const MAP_NOEXTEND: ::c_int = 0x0100;
2849 pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
2850 pub const MAP_NOCACHE: ::c_int = 0x0400;
2851 pub const MAP_JIT: ::c_int = 0x0800;
2852
2853 pub const _SC_ARG_MAX: ::c_int = 1;
2854 pub const _SC_CHILD_MAX: ::c_int = 2;
2855 pub const _SC_CLK_TCK: ::c_int = 3;
2856 pub const _SC_NGROUPS_MAX: ::c_int = 4;
2857 pub const _SC_OPEN_MAX: ::c_int = 5;
2858 pub const _SC_JOB_CONTROL: ::c_int = 6;
2859 pub const _SC_SAVED_IDS: ::c_int = 7;
2860 pub const _SC_VERSION: ::c_int = 8;
2861 pub const _SC_BC_BASE_MAX: ::c_int = 9;
2862 pub const _SC_BC_DIM_MAX: ::c_int = 10;
2863 pub const _SC_BC_SCALE_MAX: ::c_int = 11;
2864 pub const _SC_BC_STRING_MAX: ::c_int = 12;
2865 pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
2866 pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
2867 pub const _SC_LINE_MAX: ::c_int = 15;
2868 pub const _SC_RE_DUP_MAX: ::c_int = 16;
2869 pub const _SC_2_VERSION: ::c_int = 17;
2870 pub const _SC_2_C_BIND: ::c_int = 18;
2871 pub const _SC_2_C_DEV: ::c_int = 19;
2872 pub const _SC_2_CHAR_TERM: ::c_int = 20;
2873 pub const _SC_2_FORT_DEV: ::c_int = 21;
2874 pub const _SC_2_FORT_RUN: ::c_int = 22;
2875 pub const _SC_2_LOCALEDEF: ::c_int = 23;
2876 pub const _SC_2_SW_DEV: ::c_int = 24;
2877 pub const _SC_2_UPE: ::c_int = 25;
2878 pub const _SC_STREAM_MAX: ::c_int = 26;
2879 pub const _SC_TZNAME_MAX: ::c_int = 27;
2880 pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
2881 pub const _SC_PAGESIZE: ::c_int = 29;
2882 pub const _SC_MEMLOCK: ::c_int = 30;
2883 pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
2884 pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
2885 pub const _SC_MESSAGE_PASSING: ::c_int = 33;
2886 pub const _SC_PRIORITIZED_IO: ::c_int = 34;
2887 pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
2888 pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
2889 pub const _SC_SEMAPHORES: ::c_int = 37;
2890 pub const _SC_FSYNC: ::c_int = 38;
2891 pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
2892 pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
2893 pub const _SC_TIMERS: ::c_int = 41;
2894 pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
2895 pub const _SC_AIO_MAX: ::c_int = 43;
2896 pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
2897 pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
2898 pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
2899 pub const _SC_MAPPED_FILES: ::c_int = 47;
2900 pub const _SC_RTSIG_MAX: ::c_int = 48;
2901 pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
2902 pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
2903 pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
2904 pub const _SC_TIMER_MAX: ::c_int = 52;
2905 pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
2906 pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
2907 pub const _SC_2_PBS: ::c_int = 59;
2908 pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
2909 pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
2910 pub const _SC_2_PBS_LOCATE: ::c_int = 62;
2911 pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
2912 pub const _SC_2_PBS_TRACK: ::c_int = 64;
2913 pub const _SC_ADVISORY_INFO: ::c_int = 65;
2914 pub const _SC_BARRIERS: ::c_int = 66;
2915 pub const _SC_CLOCK_SELECTION: ::c_int = 67;
2916 pub const _SC_CPUTIME: ::c_int = 68;
2917 pub const _SC_FILE_LOCKING: ::c_int = 69;
2918 pub const _SC_HOST_NAME_MAX: ::c_int = 72;
2919 pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
2920 pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
2921 pub const _SC_REGEXP: ::c_int = 77;
2922 pub const _SC_SHELL: ::c_int = 78;
2923 pub const _SC_SPAWN: ::c_int = 79;
2924 pub const _SC_SPIN_LOCKS: ::c_int = 80;
2925 pub const _SC_SPORADIC_SERVER: ::c_int = 81;
2926 pub const _SC_THREAD_CPUTIME: ::c_int = 84;
2927 pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
2928 pub const _SC_TIMEOUTS: ::c_int = 95;
2929 pub const _SC_TRACE: ::c_int = 97;
2930 pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
2931 pub const _SC_TRACE_INHERIT: ::c_int = 99;
2932 pub const _SC_TRACE_LOG: ::c_int = 100;
2933 pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
2934 pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
2935 pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
2936 pub const _SC_V6_LP64_OFF64: ::c_int = 105;
2937 pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
2938 pub const _SC_IPV6: ::c_int = 118;
2939 pub const _SC_RAW_SOCKETS: ::c_int = 119;
2940 pub const _SC_SYMLOOP_MAX: ::c_int = 120;
2941 pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
2942 pub const _SC_XOPEN_STREAMS: ::c_int = 114;
2943 pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122;
2944 pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123;
2945 pub const _SC_XBS5_LP64_OFF64: ::c_int = 124;
2946 pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125;
2947 pub const _SC_SS_REPL_MAX: ::c_int = 126;
2948 pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127;
2949 pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
2950 pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
2951 pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
2952 pub const _SC_PASS_MAX: ::c_int = 131;
2953
2954 pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
2955 pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
2956 pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
2957 pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
2958 pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7;
2959 pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB;
2960 pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4;
2961 pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
2962 __sig: _PTHREAD_MUTEX_SIG_init,
2963 __opaque: [0; __PTHREAD_MUTEX_SIZE__],
2964 };
2965 pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
2966 __sig: _PTHREAD_COND_SIG_init,
2967 __opaque: [0; __PTHREAD_COND_SIZE__],
2968 };
2969 pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
2970 __sig: _PTHREAD_RWLOCK_SIG_init,
2971 __opaque: [0; __PTHREAD_RWLOCK_SIZE__],
2972 };
2973
2974 pub const MINSIGSTKSZ: ::size_t = 32768;
2975 pub const SIGSTKSZ: ::size_t = 131072;
2976
2977 pub const FD_SETSIZE: usize = 1024;
2978
2979 pub const ST_NOSUID: ::c_ulong = 2;
2980
2981 pub const EVFILT_READ: i16 = -1;
2982 pub const EVFILT_WRITE: i16 = -2;
2983 pub const EVFILT_AIO: i16 = -3;
2984 pub const EVFILT_VNODE: i16 = -4;
2985 pub const EVFILT_PROC: i16 = -5;
2986 pub const EVFILT_SIGNAL: i16 = -6;
2987 pub const EVFILT_TIMER: i16 = -7;
2988 pub const EVFILT_MACHPORT: i16 = -8;
2989 pub const EVFILT_FS: i16 = -9;
2990 pub const EVFILT_USER: i16 = -10;
2991 pub const EVFILT_VM: i16 = -12;
2992
2993 pub const EV_ADD: u16 = 0x1;
2994 pub const EV_DELETE: u16 = 0x2;
2995 pub const EV_ENABLE: u16 = 0x4;
2996 pub const EV_DISABLE: u16 = 0x8;
2997 pub const EV_ONESHOT: u16 = 0x10;
2998 pub const EV_CLEAR: u16 = 0x20;
2999 pub const EV_RECEIPT: u16 = 0x40;
3000 pub const EV_DISPATCH: u16 = 0x80;
3001 pub const EV_FLAG0: u16 = 0x1000;
3002 pub const EV_POLL: u16 = 0x1000;
3003 pub const EV_FLAG1: u16 = 0x2000;
3004 pub const EV_OOBAND: u16 = 0x2000;
3005 pub const EV_ERROR: u16 = 0x4000;
3006 pub const EV_EOF: u16 = 0x8000;
3007 pub const EV_SYSFLAGS: u16 = 0xf000;
3008
3009 pub const NOTE_TRIGGER: u32 = 0x01000000;
3010 pub const NOTE_FFNOP: u32 = 0x00000000;
3011 pub const NOTE_FFAND: u32 = 0x40000000;
3012 pub const NOTE_FFOR: u32 = 0x80000000;
3013 pub const NOTE_FFCOPY: u32 = 0xc0000000;
3014 pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
3015 pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
3016 pub const NOTE_LOWAT: u32 = 0x00000001;
3017 pub const NOTE_DELETE: u32 = 0x00000001;
3018 pub const NOTE_WRITE: u32 = 0x00000002;
3019 pub const NOTE_EXTEND: u32 = 0x00000004;
3020 pub const NOTE_ATTRIB: u32 = 0x00000008;
3021 pub const NOTE_LINK: u32 = 0x00000010;
3022 pub const NOTE_RENAME: u32 = 0x00000020;
3023 pub const NOTE_REVOKE: u32 = 0x00000040;
3024 pub const NOTE_NONE: u32 = 0x00000080;
3025 pub const NOTE_EXIT: u32 = 0x80000000;
3026 pub const NOTE_FORK: u32 = 0x40000000;
3027 pub const NOTE_EXEC: u32 = 0x20000000;
3028 #[doc(hidden)]
3029 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
3030 pub const NOTE_REAP: u32 = 0x10000000;
3031 pub const NOTE_SIGNAL: u32 = 0x08000000;
3032 pub const NOTE_EXITSTATUS: u32 = 0x04000000;
3033 pub const NOTE_EXIT_DETAIL: u32 = 0x02000000;
3034 pub const NOTE_PDATAMASK: u32 = 0x000fffff;
3035 pub const NOTE_PCTRLMASK: u32 = 0xfff00000;
3036 #[doc(hidden)]
3037 #[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
3038 pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000;
3039 pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000;
3040 pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000;
3041 pub const NOTE_EXIT_MEMORY: u32 = 0x00020000;
3042 pub const NOTE_EXIT_CSERROR: u32 = 0x00040000;
3043 pub const NOTE_VM_PRESSURE: u32 = 0x80000000;
3044 pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000;
3045 pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000;
3046 pub const NOTE_VM_ERROR: u32 = 0x10000000;
3047 pub const NOTE_SECONDS: u32 = 0x00000001;
3048 pub const NOTE_USECONDS: u32 = 0x00000002;
3049 pub const NOTE_NSECONDS: u32 = 0x00000004;
3050 pub const NOTE_ABSOLUTE: u32 = 0x00000008;
3051 pub const NOTE_LEEWAY: u32 = 0x00000010;
3052 pub const NOTE_CRITICAL: u32 = 0x00000020;
3053 pub const NOTE_BACKGROUND: u32 = 0x00000040;
3054 pub const NOTE_TRACK: u32 = 0x00000001;
3055 pub const NOTE_TRACKERR: u32 = 0x00000002;
3056 pub const NOTE_CHILD: u32 = 0x00000004;
3057
3058 pub const OCRNL: ::tcflag_t = 0x00000010;
3059 pub const ONOCR: ::tcflag_t = 0x00000020;
3060 pub const ONLRET: ::tcflag_t = 0x00000040;
3061 pub const OFILL: ::tcflag_t = 0x00000080;
3062 pub const NLDLY: ::tcflag_t = 0x00000300;
3063 pub const TABDLY: ::tcflag_t = 0x00000c04;
3064 pub const CRDLY: ::tcflag_t = 0x00003000;
3065 pub const FFDLY: ::tcflag_t = 0x00004000;
3066 pub const BSDLY: ::tcflag_t = 0x00008000;
3067 pub const VTDLY: ::tcflag_t = 0x00010000;
3068 pub const OFDEL: ::tcflag_t = 0x00020000;
3069
3070 pub const NL0: ::tcflag_t = 0x00000000;
3071 pub const NL1: ::tcflag_t = 0x00000100;
3072 pub const TAB0: ::tcflag_t = 0x00000000;
3073 pub const TAB1: ::tcflag_t = 0x00000400;
3074 pub const TAB2: ::tcflag_t = 0x00000800;
3075 pub const CR0: ::tcflag_t = 0x00000000;
3076 pub const CR1: ::tcflag_t = 0x00001000;
3077 pub const CR2: ::tcflag_t = 0x00002000;
3078 pub const CR3: ::tcflag_t = 0x00003000;
3079 pub const FF0: ::tcflag_t = 0x00000000;
3080 pub const FF1: ::tcflag_t = 0x00004000;
3081 pub const BS0: ::tcflag_t = 0x00000000;
3082 pub const BS1: ::tcflag_t = 0x00008000;
3083 pub const TAB3: ::tcflag_t = 0x00000004;
3084 pub const VT0: ::tcflag_t = 0x00000000;
3085 pub const VT1: ::tcflag_t = 0x00010000;
3086 pub const IUTF8: ::tcflag_t = 0x00004000;
3087 pub const CRTSCTS: ::tcflag_t = 0x00030000;
3088
3089 pub const NI_MAXHOST: ::socklen_t = 1025;
3090 pub const NI_MAXSERV: ::socklen_t = 32;
3091 pub const NI_NOFQDN: ::c_int = 0x00000001;
3092 pub const NI_NUMERICHOST: ::c_int = 0x00000002;
3093 pub const NI_NAMEREQD: ::c_int = 0x00000004;
3094 pub const NI_NUMERICSERV: ::c_int = 0x00000008;
3095 pub const NI_NUMERICSCOPE: ::c_int = 0x00000100;
3096 pub const NI_DGRAM: ::c_int = 0x00000010;
3097
3098 pub const Q_GETQUOTA: ::c_int = 0x300;
3099 pub const Q_SETQUOTA: ::c_int = 0x400;
3100
3101 pub const RENAME_SWAP: ::c_uint = 0x00000002;
3102 pub const RENAME_EXCL: ::c_uint = 0x00000004;
3103
3104 pub const RTLD_LOCAL: ::c_int = 0x4;
3105 pub const RTLD_FIRST: ::c_int = 0x100;
3106 pub const RTLD_NODELETE: ::c_int = 0x80;
3107 pub const RTLD_NOLOAD: ::c_int = 0x10;
3108 pub const RTLD_GLOBAL: ::c_int = 0x8;
3109
3110 pub const _WSTOPPED: ::c_int = 0o177;
3111
3112 pub const LOG_NETINFO: ::c_int = 12 << 3;
3113 pub const LOG_REMOTEAUTH: ::c_int = 13 << 3;
3114 pub const LOG_INSTALL: ::c_int = 14 << 3;
3115 pub const LOG_RAS: ::c_int = 15 << 3;
3116 pub const LOG_LAUNCHD: ::c_int = 24 << 3;
3117 pub const LOG_NFACILITIES: ::c_int = 25;
3118
3119 pub const CTLTYPE: ::c_int = 0xf;
3120 pub const CTLTYPE_NODE: ::c_int = 1;
3121 pub const CTLTYPE_INT: ::c_int = 2;
3122 pub const CTLTYPE_STRING: ::c_int = 3;
3123 pub const CTLTYPE_QUAD: ::c_int = 4;
3124 pub const CTLTYPE_OPAQUE: ::c_int = 5;
3125 pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
3126 pub const CTLFLAG_RD: ::c_int = 0x80000000;
3127 pub const CTLFLAG_WR: ::c_int = 0x40000000;
3128 pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
3129 pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000;
3130 pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
3131 pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
3132 pub const CTLFLAG_MASKED: ::c_int = 0x04000000;
3133 pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000;
3134 pub const CTLFLAG_KERN: ::c_int = 0x01000000;
3135 pub const CTLFLAG_LOCKED: ::c_int = 0x00800000;
3136 pub const CTLFLAG_OID2: ::c_int = 0x00400000;
3137 pub const CTL_UNSPEC: ::c_int = 0;
3138 pub const CTL_KERN: ::c_int = 1;
3139 pub const CTL_VM: ::c_int = 2;
3140 pub const CTL_VFS: ::c_int = 3;
3141 pub const CTL_NET: ::c_int = 4;
3142 pub const CTL_DEBUG: ::c_int = 5;
3143 pub const CTL_HW: ::c_int = 6;
3144 pub const CTL_MACHDEP: ::c_int = 7;
3145 pub const CTL_USER: ::c_int = 8;
3146 pub const CTL_MAXID: ::c_int = 9;
3147 pub const KERN_OSTYPE: ::c_int = 1;
3148 pub const KERN_OSRELEASE: ::c_int = 2;
3149 pub const KERN_OSREV: ::c_int = 3;
3150 pub const KERN_VERSION: ::c_int = 4;
3151 pub const KERN_MAXVNODES: ::c_int = 5;
3152 pub const KERN_MAXPROC: ::c_int = 6;
3153 pub const KERN_MAXFILES: ::c_int = 7;
3154 pub const KERN_ARGMAX: ::c_int = 8;
3155 pub const KERN_SECURELVL: ::c_int = 9;
3156 pub const KERN_HOSTNAME: ::c_int = 10;
3157 pub const KERN_HOSTID: ::c_int = 11;
3158 pub const KERN_CLOCKRATE: ::c_int = 12;
3159 pub const KERN_VNODE: ::c_int = 13;
3160 pub const KERN_PROC: ::c_int = 14;
3161 pub const KERN_FILE: ::c_int = 15;
3162 pub const KERN_PROF: ::c_int = 16;
3163 pub const KERN_POSIX1: ::c_int = 17;
3164 pub const KERN_NGROUPS: ::c_int = 18;
3165 pub const KERN_JOB_CONTROL: ::c_int = 19;
3166 pub const KERN_SAVED_IDS: ::c_int = 20;
3167 pub const KERN_BOOTTIME: ::c_int = 21;
3168 pub const KERN_NISDOMAINNAME: ::c_int = 22;
3169 pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME;
3170 pub const KERN_MAXPARTITIONS: ::c_int = 23;
3171 pub const KERN_KDEBUG: ::c_int = 24;
3172 pub const KERN_UPDATEINTERVAL: ::c_int = 25;
3173 pub const KERN_OSRELDATE: ::c_int = 26;
3174 pub const KERN_NTP_PLL: ::c_int = 27;
3175 pub const KERN_BOOTFILE: ::c_int = 28;
3176 pub const KERN_MAXFILESPERPROC: ::c_int = 29;
3177 pub const KERN_MAXPROCPERUID: ::c_int = 30;
3178 pub const KERN_DUMPDEV: ::c_int = 31;
3179 pub const KERN_IPC: ::c_int = 32;
3180 pub const KERN_DUMMY: ::c_int = 33;
3181 pub const KERN_PS_STRINGS: ::c_int = 34;
3182 pub const KERN_USRSTACK32: ::c_int = 35;
3183 pub const KERN_LOGSIGEXIT: ::c_int = 36;
3184 pub const KERN_SYMFILE: ::c_int = 37;
3185 pub const KERN_PROCARGS: ::c_int = 38;
3186 pub const KERN_NETBOOT: ::c_int = 40;
3187 pub const KERN_SYSV: ::c_int = 42;
3188 pub const KERN_AFFINITY: ::c_int = 43;
3189 pub const KERN_TRANSLATE: ::c_int = 44;
3190 pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE;
3191 pub const KERN_EXEC: ::c_int = 45;
3192 pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC;
3193 pub const KERN_AIOMAX: ::c_int = 46;
3194 pub const KERN_AIOPROCMAX: ::c_int = 47;
3195 pub const KERN_AIOTHREADS: ::c_int = 48;
3196 pub const KERN_COREFILE: ::c_int = 50;
3197 pub const KERN_COREDUMP: ::c_int = 51;
3198 pub const KERN_SUGID_COREDUMP: ::c_int = 52;
3199 pub const KERN_PROCDELAYTERM: ::c_int = 53;
3200 pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54;
3201 pub const KERN_LOW_PRI_WINDOW: ::c_int = 56;
3202 pub const KERN_LOW_PRI_DELAY: ::c_int = 57;
3203 pub const KERN_POSIX: ::c_int = 58;
3204 pub const KERN_USRSTACK64: ::c_int = 59;
3205 pub const KERN_NX_PROTECTION: ::c_int = 60;
3206 pub const KERN_TFP: ::c_int = 61;
3207 pub const KERN_PROCNAME: ::c_int = 62;
3208 pub const KERN_THALTSTACK: ::c_int = 63;
3209 pub const KERN_SPECULATIVE_READS: ::c_int = 64;
3210 pub const KERN_OSVERSION: ::c_int = 65;
3211 pub const KERN_SAFEBOOT: ::c_int = 66;
3212 pub const KERN_RAGEVNODE: ::c_int = 68;
3213 pub const KERN_TTY: ::c_int = 69;
3214 pub const KERN_CHECKOPENEVT: ::c_int = 70;
3215 pub const KERN_THREADNAME: ::c_int = 71;
3216 pub const KERN_MAXID: ::c_int = 72;
3217 pub const KERN_RAGE_PROC: ::c_int = 1;
3218 pub const KERN_RAGE_THREAD: ::c_int = 2;
3219 pub const KERN_UNRAGE_PROC: ::c_int = 3;
3220 pub const KERN_UNRAGE_THREAD: ::c_int = 4;
3221 pub const KERN_OPENEVT_PROC: ::c_int = 1;
3222 pub const KERN_UNOPENEVT_PROC: ::c_int = 2;
3223 pub const KERN_TFP_POLICY: ::c_int = 1;
3224 pub const KERN_TFP_POLICY_DENY: ::c_int = 0;
3225 pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2;
3226 pub const KERN_KDEFLAGS: ::c_int = 1;
3227 pub const KERN_KDDFLAGS: ::c_int = 2;
3228 pub const KERN_KDENABLE: ::c_int = 3;
3229 pub const KERN_KDSETBUF: ::c_int = 4;
3230 pub const KERN_KDGETBUF: ::c_int = 5;
3231 pub const KERN_KDSETUP: ::c_int = 6;
3232 pub const KERN_KDREMOVE: ::c_int = 7;
3233 pub const KERN_KDSETREG: ::c_int = 8;
3234 pub const KERN_KDGETREG: ::c_int = 9;
3235 pub const KERN_KDREADTR: ::c_int = 10;
3236 pub const KERN_KDPIDTR: ::c_int = 11;
3237 pub const KERN_KDTHRMAP: ::c_int = 12;
3238 pub const KERN_KDPIDEX: ::c_int = 14;
3239 pub const KERN_KDSETRTCDEC: ::c_int = 15;
3240 pub const KERN_KDGETENTROPY: ::c_int = 16;
3241 pub const KERN_KDWRITETR: ::c_int = 17;
3242 pub const KERN_KDWRITEMAP: ::c_int = 18;
3243 #[doc(hidden)]
3244 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
3245 pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
3246 #[doc(hidden)]
3247 #[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
3248 pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
3249 pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
3250 pub const KERN_KDSET_TYPEFILTER: ::c_int = 22;
3251 pub const KERN_KDBUFWAIT: ::c_int = 23;
3252 pub const KERN_KDCPUMAP: ::c_int = 24;
3253 pub const KERN_PROC_ALL: ::c_int = 0;
3254 pub const KERN_PROC_PID: ::c_int = 1;
3255 pub const KERN_PROC_PGRP: ::c_int = 2;
3256 pub const KERN_PROC_SESSION: ::c_int = 3;
3257 pub const KERN_PROC_TTY: ::c_int = 4;
3258 pub const KERN_PROC_UID: ::c_int = 5;
3259 pub const KERN_PROC_RUID: ::c_int = 6;
3260 pub const KERN_PROC_LCID: ::c_int = 7;
3261 pub const KERN_SUCCESS: ::c_int = 0;
3262 pub const KERN_INVALID_ADDRESS: ::c_int = 1;
3263 pub const KERN_PROTECTION_FAILURE: ::c_int = 2;
3264 pub const KERN_NO_SPACE: ::c_int = 3;
3265 pub const KERN_INVALID_ARGUMENT: ::c_int = 4;
3266 pub const KERN_FAILURE: ::c_int = 5;
3267 pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6;
3268 pub const KERN_NOT_RECEIVER: ::c_int = 7;
3269 pub const KERN_NO_ACCESS: ::c_int = 8;
3270 pub const KERN_MEMORY_FAILURE: ::c_int = 9;
3271 pub const KERN_MEMORY_ERROR: ::c_int = 10;
3272 pub const KERN_ALREADY_IN_SET: ::c_int = 11;
3273 pub const KERN_NOT_IN_SET: ::c_int = 12;
3274 pub const KERN_NAME_EXISTS: ::c_int = 13;
3275 pub const KERN_ABORTED: ::c_int = 14;
3276 pub const KERN_INVALID_NAME: ::c_int = 15;
3277 pub const KERN_INVALID_TASK: ::c_int = 16;
3278 pub const KERN_INVALID_RIGHT: ::c_int = 17;
3279 pub const KERN_INVALID_VALUE: ::c_int = 18;
3280 pub const KERN_UREFS_OVERFLOW: ::c_int = 19;
3281 pub const KERN_INVALID_CAPABILITY: ::c_int = 20;
3282 pub const KERN_RIGHT_EXISTS: ::c_int = 21;
3283 pub const KERN_INVALID_HOST: ::c_int = 22;
3284 pub const KERN_MEMORY_PRESENT: ::c_int = 23;
3285 pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24;
3286 pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25;
3287 pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26;
3288 pub const KERN_POLICY_LIMIT: ::c_int = 27;
3289 pub const KERN_INVALID_POLICY: ::c_int = 28;
3290 pub const KERN_INVALID_OBJECT: ::c_int = 29;
3291 pub const KERN_ALREADY_WAITING: ::c_int = 30;
3292 pub const KERN_DEFAULT_SET: ::c_int = 31;
3293 pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32;
3294 pub const KERN_INVALID_LEDGER: ::c_int = 33;
3295 pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34;
3296 pub const KERN_INVALID_SECURITY: ::c_int = 35;
3297 pub const KERN_NOT_DEPRESSED: ::c_int = 36;
3298 pub const KERN_TERMINATED: ::c_int = 37;
3299 pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38;
3300 pub const KERN_LOCK_UNSTABLE: ::c_int = 39;
3301 pub const KERN_LOCK_OWNED: ::c_int = 40;
3302 pub const KERN_LOCK_OWNED_SELF: ::c_int = 41;
3303 pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42;
3304 pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43;
3305 pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44;
3306 pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45;
3307 pub const KERN_NOT_SUPPORTED: ::c_int = 46;
3308 pub const KERN_NODE_DOWN: ::c_int = 47;
3309 pub const KERN_NOT_WAITING: ::c_int = 48;
3310 pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49;
3311 pub const KERN_CODESIGN_ERROR: ::c_int = 50;
3312 pub const KERN_POLICY_STATIC: ::c_int = 51;
3313 pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52;
3314 pub const KIPC_MAXSOCKBUF: ::c_int = 1;
3315 pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
3316 pub const KIPC_SOMAXCONN: ::c_int = 3;
3317 pub const KIPC_MAX_LINKHDR: ::c_int = 4;
3318 pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
3319 pub const KIPC_MAX_HDR: ::c_int = 6;
3320 pub const KIPC_MAX_DATALEN: ::c_int = 7;
3321 pub const KIPC_MBSTAT: ::c_int = 8;
3322 pub const KIPC_NMBCLUSTERS: ::c_int = 9;
3323 pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10;
3324 pub const VM_METER: ::c_int = 1;
3325 pub const VM_LOADAVG: ::c_int = 2;
3326 pub const VM_MACHFACTOR: ::c_int = 4;
3327 pub const VM_SWAPUSAGE: ::c_int = 5;
3328 pub const VM_MAXID: ::c_int = 6;
3329 pub const VM_PROT_NONE: ::vm_prot_t = 0x00;
3330 pub const VM_PROT_READ: ::vm_prot_t = 0x01;
3331 pub const VM_PROT_WRITE: ::vm_prot_t = 0x02;
3332 pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04;
3333 pub const MEMORY_OBJECT_NULL: ::memory_object_t = 0;
3334 pub const HW_MACHINE: ::c_int = 1;
3335 pub const HW_MODEL: ::c_int = 2;
3336 pub const HW_NCPU: ::c_int = 3;
3337 pub const HW_BYTEORDER: ::c_int = 4;
3338 pub const HW_PHYSMEM: ::c_int = 5;
3339 pub const HW_USERMEM: ::c_int = 6;
3340 pub const HW_PAGESIZE: ::c_int = 7;
3341 pub const HW_DISKNAMES: ::c_int = 8;
3342 pub const HW_DISKSTATS: ::c_int = 9;
3343 pub const HW_EPOCH: ::c_int = 10;
3344 pub const HW_FLOATINGPT: ::c_int = 11;
3345 pub const HW_MACHINE_ARCH: ::c_int = 12;
3346 pub const HW_VECTORUNIT: ::c_int = 13;
3347 pub const HW_BUS_FREQ: ::c_int = 14;
3348 pub const HW_CPU_FREQ: ::c_int = 15;
3349 pub const HW_CACHELINE: ::c_int = 16;
3350 pub const HW_L1ICACHESIZE: ::c_int = 17;
3351 pub const HW_L1DCACHESIZE: ::c_int = 18;
3352 pub const HW_L2SETTINGS: ::c_int = 19;
3353 pub const HW_L2CACHESIZE: ::c_int = 20;
3354 pub const HW_L3SETTINGS: ::c_int = 21;
3355 pub const HW_L3CACHESIZE: ::c_int = 22;
3356 pub const HW_TB_FREQ: ::c_int = 23;
3357 pub const HW_MEMSIZE: ::c_int = 24;
3358 pub const HW_AVAILCPU: ::c_int = 25;
3359 pub const HW_TARGET: ::c_int = 26;
3360 pub const HW_PRODUCT: ::c_int = 27;
3361 pub const HW_MAXID: ::c_int = 28;
3362 pub const USER_CS_PATH: ::c_int = 1;
3363 pub const USER_BC_BASE_MAX: ::c_int = 2;
3364 pub const USER_BC_DIM_MAX: ::c_int = 3;
3365 pub const USER_BC_SCALE_MAX: ::c_int = 4;
3366 pub const USER_BC_STRING_MAX: ::c_int = 5;
3367 pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
3368 pub const USER_EXPR_NEST_MAX: ::c_int = 7;
3369 pub const USER_LINE_MAX: ::c_int = 8;
3370 pub const USER_RE_DUP_MAX: ::c_int = 9;
3371 pub const USER_POSIX2_VERSION: ::c_int = 10;
3372 pub const USER_POSIX2_C_BIND: ::c_int = 11;
3373 pub const USER_POSIX2_C_DEV: ::c_int = 12;
3374 pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
3375 pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
3376 pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
3377 pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
3378 pub const USER_POSIX2_SW_DEV: ::c_int = 17;
3379 pub const USER_POSIX2_UPE: ::c_int = 18;
3380 pub const USER_STREAM_MAX: ::c_int = 19;
3381 pub const USER_TZNAME_MAX: ::c_int = 20;
3382 pub const USER_MAXID: ::c_int = 21;
3383 pub const CTL_DEBUG_NAME: ::c_int = 0;
3384 pub const CTL_DEBUG_VALUE: ::c_int = 1;
3385 pub const CTL_DEBUG_MAXID: ::c_int = 20;
3386
3387 pub const PRIO_DARWIN_THREAD: ::c_int = 3;
3388 pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
3389 pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
3390 pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
3391
3392 pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
3393
3394 pub const AI_PASSIVE: ::c_int = 0x00000001;
3395 pub const AI_CANONNAME: ::c_int = 0x00000002;
3396 pub const AI_NUMERICHOST: ::c_int = 0x00000004;
3397 pub const AI_NUMERICSERV: ::c_int = 0x00001000;
3398 pub const AI_MASK: ::c_int =
3399 AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
3400 pub const AI_ALL: ::c_int = 0x00000100;
3401 pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
3402 pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
3403 pub const AI_V4MAPPED: ::c_int = 0x00000800;
3404 pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
3405 pub const AI_UNUSABLE: ::c_int = 0x10000000;
3406
3407 pub const SIGEV_NONE: ::c_int = 0;
3408 pub const SIGEV_SIGNAL: ::c_int = 1;
3409 pub const SIGEV_THREAD: ::c_int = 3;
3410
3411 pub const AIO_CANCELED: ::c_int = 2;
3412 pub const AIO_NOTCANCELED: ::c_int = 4;
3413 pub const AIO_ALLDONE: ::c_int = 1;
3414 #[deprecated(
3415 since = "0.2.64",
3416 note = "Can vary at runtime. Use sysconf(3) instead"
3417 )]
3418 pub const AIO_LISTIO_MAX: ::c_int = 16;
3419 pub const LIO_NOP: ::c_int = 0;
3420 pub const LIO_WRITE: ::c_int = 2;
3421 pub const LIO_READ: ::c_int = 1;
3422 pub const LIO_WAIT: ::c_int = 2;
3423 pub const LIO_NOWAIT: ::c_int = 1;
3424
3425 pub const WEXITED: ::c_int = 0x00000004;
3426 pub const WSTOPPED: ::c_int = 0x00000008;
3427 pub const WCONTINUED: ::c_int = 0x00000010;
3428 pub const WNOWAIT: ::c_int = 0x00000020;
3429
3430 pub const P_ALL: idtype_t = 0;
3431 pub const P_PID: idtype_t = 1;
3432 pub const P_PGID: idtype_t = 2;
3433
3434 pub const UTIME_OMIT: c_long = -2;
3435 pub const UTIME_NOW: c_long = -1;
3436
3437 pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
3438 pub const XATTR_CREATE: ::c_int = 0x0002;
3439 pub const XATTR_REPLACE: ::c_int = 0x0004;
3440 pub const XATTR_NOSECURITY: ::c_int = 0x0008;
3441 pub const XATTR_NODEFAULT: ::c_int = 0x0010;
3442 pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
3443
3444 pub const NET_RT_IFLIST2: ::c_int = 0x0006;
3445
3446 // net/route.h
3447 pub const RTF_UP: ::c_int = 0x1;
3448 pub const RTF_GATEWAY: ::c_int = 0x2;
3449 pub const RTF_HOST: ::c_int = 0x4;
3450 pub const RTF_REJECT: ::c_int = 0x8;
3451 pub const RTF_DYNAMIC: ::c_int = 0x10;
3452 pub const RTF_MODIFIED: ::c_int = 0x20;
3453 pub const RTF_DONE: ::c_int = 0x40;
3454 pub const RTF_DELCLONE: ::c_int = 0x80;
3455 pub const RTF_CLONING: ::c_int = 0x100;
3456 pub const RTF_XRESOLVE: ::c_int = 0x200;
3457 pub const RTF_LLINFO: ::c_int = 0x400;
3458 pub const RTF_STATIC: ::c_int = 0x800;
3459 pub const RTF_BLACKHOLE: ::c_int = 0x1000;
3460 pub const RTF_NOIFREF: ::c_int = 0x2000;
3461 pub const RTF_PROTO2: ::c_int = 0x4000;
3462 pub const RTF_PROTO1: ::c_int = 0x8000;
3463 pub const RTF_PRCLONING: ::c_int = 0x10000;
3464 pub const RTF_WASCLONED: ::c_int = 0x20000;
3465 pub const RTF_PROTO3: ::c_int = 0x40000;
3466 pub const RTF_PINNED: ::c_int = 0x100000;
3467 pub const RTF_LOCAL: ::c_int = 0x200000;
3468 pub const RTF_BROADCAST: ::c_int = 0x400000;
3469 pub const RTF_MULTICAST: ::c_int = 0x800000;
3470 pub const RTF_IFSCOPE: ::c_int = 0x1000000;
3471 pub const RTF_CONDEMNED: ::c_int = 0x2000000;
3472 pub const RTF_IFREF: ::c_int = 0x4000000;
3473 pub const RTF_PROXY: ::c_int = 0x8000000;
3474 pub const RTF_ROUTER: ::c_int = 0x10000000;
3475
3476 pub const RTM_VERSION: ::c_int = 5;
3477
3478 // Message types
3479 pub const RTM_ADD: ::c_int = 0x1;
3480 pub const RTM_DELETE: ::c_int = 0x2;
3481 pub const RTM_CHANGE: ::c_int = 0x3;
3482 pub const RTM_GET: ::c_int = 0x4;
3483 pub const RTM_LOSING: ::c_int = 0x5;
3484 pub const RTM_REDIRECT: ::c_int = 0x6;
3485 pub const RTM_MISS: ::c_int = 0x7;
3486 pub const RTM_LOCK: ::c_int = 0x8;
3487 pub const RTM_OLDADD: ::c_int = 0x9;
3488 pub const RTM_OLDDEL: ::c_int = 0xa;
3489 pub const RTM_RESOLVE: ::c_int = 0xb;
3490 pub const RTM_NEWADDR: ::c_int = 0xc;
3491 pub const RTM_DELADDR: ::c_int = 0xd;
3492 pub const RTM_IFINFO: ::c_int = 0xe;
3493 pub const RTM_NEWMADDR: ::c_int = 0xf;
3494 pub const RTM_DELMADDR: ::c_int = 0x10;
3495 pub const RTM_IFINFO2: ::c_int = 0x12;
3496 pub const RTM_NEWMADDR2: ::c_int = 0x13;
3497 pub const RTM_GET2: ::c_int = 0x14;
3498
3499 // Bitmask values for rtm_inits and rmx_locks.
3500 pub const RTV_MTU: ::c_int = 0x1;
3501 pub const RTV_HOPCOUNT: ::c_int = 0x2;
3502 pub const RTV_EXPIRE: ::c_int = 0x4;
3503 pub const RTV_RPIPE: ::c_int = 0x8;
3504 pub const RTV_SPIPE: ::c_int = 0x10;
3505 pub const RTV_SSTHRESH: ::c_int = 0x20;
3506 pub const RTV_RTT: ::c_int = 0x40;
3507 pub const RTV_RTTVAR: ::c_int = 0x80;
3508
3509 // Bitmask values for rtm_addrs.
3510 pub const RTA_DST: ::c_int = 0x1;
3511 pub const RTA_GATEWAY: ::c_int = 0x2;
3512 pub const RTA_NETMASK: ::c_int = 0x4;
3513 pub const RTA_GENMASK: ::c_int = 0x8;
3514 pub const RTA_IFP: ::c_int = 0x10;
3515 pub const RTA_IFA: ::c_int = 0x20;
3516 pub const RTA_AUTHOR: ::c_int = 0x40;
3517 pub const RTA_BRD: ::c_int = 0x80;
3518
3519 // Index offsets for sockaddr array for alternate internal encoding.
3520 pub const RTAX_DST: ::c_int = 0;
3521 pub const RTAX_GATEWAY: ::c_int = 1;
3522 pub const RTAX_NETMASK: ::c_int = 2;
3523 pub const RTAX_GENMASK: ::c_int = 3;
3524 pub const RTAX_IFP: ::c_int = 4;
3525 pub const RTAX_IFA: ::c_int = 5;
3526 pub const RTAX_AUTHOR: ::c_int = 6;
3527 pub const RTAX_BRD: ::c_int = 7;
3528 pub const RTAX_MAX: ::c_int = 8;
3529
3530 pub const KERN_PROCARGS2: ::c_int = 49;
3531
3532 pub const PROC_PIDTASKALLINFO: ::c_int = 2;
3533 pub const PROC_PIDTASKINFO: ::c_int = 4;
3534 pub const PROC_PIDTHREADINFO: ::c_int = 5;
3535 pub const MAXCOMLEN: usize = 16;
3536 pub const MAXTHREADNAMESIZE: usize = 64;
3537
3538 pub const XUCRED_VERSION: ::c_uint = 0;
3539
3540 pub const LC_SEGMENT: u32 = 0x1;
3541 pub const LC_SEGMENT_64: u32 = 0x19;
3542
3543 pub const MH_MAGIC: u32 = 0xfeedface;
3544 pub const MH_MAGIC_64: u32 = 0xfeedfacf;
3545
3546 // net/if_utun.h
3547 pub const UTUN_OPT_FLAGS: ::c_int = 1;
3548 pub const UTUN_OPT_IFNAME: ::c_int = 2;
3549
3550 // net/bpf.h
3551 pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation
3552 pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb)
3553 pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb)
3554 pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25
3555 pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring
3556 pub const DLT_CHAOS: ::c_uint = 5; // Chaos
3557 pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks
3558 pub const DLT_ARCNET: ::c_uint = 7; // ARCNET
3559 pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP
3560 pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol
3561 pub const DLT_FDDI: ::c_uint = 10; // FDDI
3562 pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm
3563 pub const DLT_RAW: ::c_uint = 12; // raw IP
3564 pub const DLT_LOOP: ::c_uint = 108;
3565
3566 // https://github.com/apple/darwin-xnu/blob/master/bsd/net/bpf.h#L100
3567 // sizeof(i32)
3568 pub const BPF_ALIGNMENT: ::c_int = 4;
3569
3570 // sys/mount.h
3571 pub const MNT_NODEV: ::c_int = 0x00000010;
3572 pub const MNT_UNION: ::c_int = 0x00000020;
3573 pub const MNT_CPROTECT: ::c_int = 0x00000080;
3574
3575 // MAC labeled / "quarantined" flag
3576 pub const MNT_QUARANTINE: ::c_int = 0x00000400;
3577
3578 // Flags set by internal operations.
3579 pub const MNT_LOCAL: ::c_int = 0x00001000;
3580 pub const MNT_QUOTA: ::c_int = 0x00002000;
3581 pub const MNT_ROOTFS: ::c_int = 0x00004000;
3582 pub const MNT_DOVOLFS: ::c_int = 0x00008000;
3583
3584 pub const MNT_DONTBROWSE: ::c_int = 0x00100000;
3585 pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000;
3586 pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000;
3587 pub const MNT_JOURNALED: ::c_int = 0x00800000;
3588 pub const MNT_NOUSERXATTR: ::c_int = 0x01000000;
3589 pub const MNT_DEFWRITE: ::c_int = 0x02000000;
3590 pub const MNT_MULTILABEL: ::c_int = 0x04000000;
3591 pub const MNT_NOATIME: ::c_int = 0x10000000;
3592 pub const MNT_SNAPSHOT: ::c_int = 0x40000000;
3593
3594 // External filesystem command modifier flags.
3595 pub const MNT_NOBLOCK: ::c_int = 0x00020000;
3596
3597 // sys/spawn.h:
3598 pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
3599 pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
3600 pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x04;
3601 pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x08;
3602 pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x40;
3603 pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x80;
3604 pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000;
3605
3606 // sys/ipc.h:
3607 pub const IPC_CREAT: ::c_int = 0x200;
3608 pub const IPC_EXCL: ::c_int = 0x400;
3609 pub const IPC_NOWAIT: ::c_int = 0x800;
3610 pub const IPC_PRIVATE: key_t = 0;
3611
3612 pub const IPC_RMID: ::c_int = 0;
3613 pub const IPC_SET: ::c_int = 1;
3614 pub const IPC_STAT: ::c_int = 2;
3615
3616 pub const IPC_R: ::c_int = 0x100;
3617 pub const IPC_W: ::c_int = 0x80;
3618 pub const IPC_M: ::c_int = 0x1000;
3619
3620 // sys/sem.h
3621 pub const SEM_UNDO: ::c_int = 0o10000;
3622
3623 pub const GETNCNT: ::c_int = 3;
3624 pub const GETPID: ::c_int = 4;
3625 pub const GETVAL: ::c_int = 5;
3626 pub const GETALL: ::c_int = 6;
3627 pub const GETZCNT: ::c_int = 7;
3628 pub const SETVAL: ::c_int = 8;
3629 pub const SETALL: ::c_int = 9;
3630
3631 // sys/shm.h
3632 pub const SHM_RDONLY: ::c_int = 0x1000;
3633 pub const SHM_RND: ::c_int = 0x2000;
3634 #[cfg(target_arch = "aarch64")]
3635 pub const SHMLBA: ::c_int = 16 * 1024;
3636 #[cfg(not(target_arch = "aarch64"))]
3637 pub const SHMLBA: ::c_int = 4096;
3638 pub const SHM_R: ::c_int = IPC_R;
3639 pub const SHM_W: ::c_int = IPC_W;
3640
3641 // Flags for chflags(2)
3642 pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
3643 pub const UF_NODUMP: ::c_uint = 0x00000001;
3644 pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
3645 pub const UF_APPEND: ::c_uint = 0x00000004;
3646 pub const UF_OPAQUE: ::c_uint = 0x00000008;
3647 pub const UF_COMPRESSED: ::c_uint = 0x00000020;
3648 pub const UF_TRACKED: ::c_uint = 0x00000040;
3649 pub const SF_SETTABLE: ::c_uint = 0xffff0000;
3650 pub const SF_ARCHIVED: ::c_uint = 0x00010000;
3651 pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
3652 pub const SF_APPEND: ::c_uint = 0x00040000;
3653 pub const UF_HIDDEN: ::c_uint = 0x00008000;
3654
3655 //<sys/timex.h>
3656 pub const NTP_API: ::c_int = 4;
3657 pub const MAXPHASE: ::c_long = 500000000;
3658 pub const MAXFREQ: ::c_long = 500000;
3659 pub const MINSEC: ::c_int = 256;
3660 pub const MAXSEC: ::c_int = 2048;
3661 pub const NANOSECOND: ::c_long = 1000000000;
3662 pub const SCALE_PPM: ::c_int = 65;
3663 pub const MAXTC: ::c_int = 10;
3664 pub const MOD_OFFSET: ::c_uint = 0x0001;
3665 pub const MOD_FREQUENCY: ::c_uint = 0x0002;
3666 pub const MOD_MAXERROR: ::c_uint = 0x0004;
3667 pub const MOD_ESTERROR: ::c_uint = 0x0008;
3668 pub const MOD_STATUS: ::c_uint = 0x0010;
3669 pub const MOD_TIMECONST: ::c_uint = 0x0020;
3670 pub const MOD_PPSMAX: ::c_uint = 0x0040;
3671 pub const MOD_TAI: ::c_uint = 0x0080;
3672 pub const MOD_MICRO: ::c_uint = 0x1000;
3673 pub const MOD_NANO: ::c_uint = 0x2000;
3674 pub const MOD_CLKB: ::c_uint = 0x4000;
3675 pub const MOD_CLKA: ::c_uint = 0x8000;
3676 pub const STA_PLL: ::c_int = 0x0001;
3677 pub const STA_PPSFREQ: ::c_int = 0x0002;
3678 pub const STA_PPSTIME: ::c_int = 0x0004;
3679 pub const STA_FLL: ::c_int = 0x0008;
3680 pub const STA_INS: ::c_int = 0x0010;
3681 pub const STA_DEL: ::c_int = 0x0020;
3682 pub const STA_UNSYNC: ::c_int = 0x0040;
3683 pub const STA_FREQHOLD: ::c_int = 0x0080;
3684 pub const STA_PPSSIGNAL: ::c_int = 0x0100;
3685 pub const STA_PPSJITTER: ::c_int = 0x0200;
3686 pub const STA_PPSWANDER: ::c_int = 0x0400;
3687 pub const STA_PPSERROR: ::c_int = 0x0800;
3688 pub const STA_CLOCKERR: ::c_int = 0x1000;
3689 pub const STA_NANO: ::c_int = 0x2000;
3690 pub const STA_MODE: ::c_int = 0x4000;
3691 pub const STA_CLK: ::c_int = 0x8000;
3692 pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
3693 | STA_PPSJITTER
3694 | STA_PPSWANDER
3695 | STA_PPSERROR
3696 | STA_CLOCKERR
3697 | STA_NANO
3698 | STA_MODE
3699 | STA_CLK;
3700 pub const TIME_OK: ::c_int = 0;
3701 pub const TIME_INS: ::c_int = 1;
3702 pub const TIME_DEL: ::c_int = 2;
3703 pub const TIME_OOP: ::c_int = 3;
3704 pub const TIME_WAIT: ::c_int = 4;
3705 pub const TIME_ERROR: ::c_int = 5;
3706
3707 // <sys/mount.h>
3708 pub const MNT_WAIT: ::c_int = 1;
3709 pub const MNT_NOWAIT: ::c_int = 2;
3710
3711 // <mach/thread_policy.h>
3712 pub const THREAD_STANDARD_POLICY: ::c_int = 1;
3713 pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0;
3714 pub const THREAD_EXTENDED_POLICY: ::c_int = 1;
3715 pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2;
3716 pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3;
3717 pub const THREAD_AFFINITY_POLICY: ::c_int = 4;
3718 pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0;
3719 pub const THREAD_BACKGROUND_POLICY: ::c_int = 5;
3720 pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000;
3721 pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7;
3722 pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8;
3723
3724 // <mach/thread_info.h>
3725 pub const TH_STATE_RUNNING: ::c_int = 1;
3726 pub const TH_STATE_STOPPED: ::c_int = 2;
3727 pub const TH_STATE_WAITING: ::c_int = 3;
3728 pub const TH_STATE_UNINTERRUPTIBLE: ::c_int = 4;
3729 pub const TH_STATE_HALTED: ::c_int = 5;
3730 pub const TH_FLAGS_SWAPPED: ::c_int = 0x1;
3731 pub const TH_FLAGS_IDLE: ::c_int = 0x2;
3732 pub const TH_FLAGS_GLOBAL_FORCED_IDLE: ::c_int = 0x4;
3733 pub const THREAD_BASIC_INFO: ::c_int = 3;
3734 pub const THREAD_IDENTIFIER_INFO: ::c_int = 4;
3735 pub const THREAD_EXTENDED_INFO: ::c_int = 5;
3736
3737 // CommonCrypto/CommonCryptoError.h
3738 pub const kCCSuccess: i32 = 0;
3739 pub const kCCParamError: i32 = -4300;
3740 pub const kCCBufferTooSmall: i32 = -4301;
3741 pub const kCCMemoryFailure: i32 = -4302;
3742 pub const kCCAlignmentError: i32 = -4303;
3743 pub const kCCDecodeError: i32 = -4304;
3744 pub const kCCUnimplemented: i32 = -4305;
3745 pub const kCCOverflow: i32 = -4306;
3746 pub const kCCRNGFailure: i32 = -4307;
3747 pub const kCCUnspecifiedError: i32 = -4308;
3748 pub const kCCCallSequenceError: i32 = -4309;
3749 pub const kCCKeySizeError: i32 = -4310;
3750 pub const kCCInvalidKey: i32 = -4311;
3751
3752 cfg_if! {
3753 if #[cfg(libc_const_extern_fn)] {
3754 const fn __DARWIN_ALIGN32(p: usize) -> usize {
3755 const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
3756 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
3757 }
3758 } else if #[cfg(libc_const_size_of)] {
3759 fn __DARWIN_ALIGN32(p: usize) -> usize {
3760 const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
3761 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
3762 }
3763 pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
3764 (::mem::size_of::<thread_extended_policy_data_t>() / ::mem::size_of::<integer_t>())
3765 as mach_msg_type_number_t;
3766 pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
3767 (::mem::size_of::<thread_time_constraint_policy_data_t>() /
3768 ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
3769 pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
3770 (::mem::size_of::<thread_precedence_policy_data_t>() / ::mem::size_of::<integer_t>())
3771 as mach_msg_type_number_t;
3772 pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
3773 (::mem::size_of::<thread_affinity_policy_data_t>() / ::mem::size_of::<integer_t>())
3774 as mach_msg_type_number_t;
3775 pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
3776 (::mem::size_of::<thread_background_policy_data_t>() / ::mem::size_of::<integer_t>())
3777 as mach_msg_type_number_t;
3778 pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
3779 (::mem::size_of::<thread_latency_qos_policy_data_t>() / ::mem::size_of::<integer_t>())
3780 as mach_msg_type_number_t;
3781 pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
3782 (::mem::size_of::<thread_throughput_qos_policy_data_t>() /
3783 ::mem::size_of::<integer_t>()) as mach_msg_type_number_t;
3784 pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
3785 (::mem::size_of::<thread_basic_info_data_t>() / ::mem::size_of::<integer_t>())
3786 as mach_msg_type_number_t;
3787 pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
3788 (::mem::size_of::<thread_identifier_info_data_t>() / ::mem::size_of::<integer_t>())
3789 as mach_msg_type_number_t;
3790 pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
3791 (::mem::size_of::<thread_extended_info_data_t>() / ::mem::size_of::<integer_t>())
3792 as mach_msg_type_number_t;
3793 } else {
3794 fn __DARWIN_ALIGN32(p: usize) -> usize {
3795 let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::<u32>() - 1;
3796 p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
3797 }
3798 pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1;
3799 pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4;
3800 pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1;
3801 pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1;
3802 pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1;
3803 pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
3804 pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
3805 pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10;
3806 pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6;
3807 pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28;
3808 }
3809 }
3810
3811 f! {
3812 pub fn CMSG_NXTHDR(mhdr: *const ::msghdr,
3813 cmsg: *const ::cmsghdr) -> *mut ::cmsghdr {
3814 if cmsg.is_null() {
3815 return ::CMSG_FIRSTHDR(mhdr);
3816 };
3817 let cmsg_len = (*cmsg).cmsg_len as usize;
3818 let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
3819 let max = (*mhdr).msg_control as usize
3820 + (*mhdr).msg_controllen as usize;
3821 if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
3822 0 as *mut ::cmsghdr
3823 } else {
3824 next as *mut ::cmsghdr
3825 }
3826 }
3827
3828 pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
3829 (cmsg as *mut ::c_uchar)
3830 .offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize)
3831 }
3832
3833 pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
3834 (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>())
3835 + __DARWIN_ALIGN32(length as usize))
3836 as ::c_uint
3837 }
3838
3839 pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
3840 (__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
3841 as ::c_uint
3842 }
3843
3844 pub {const} fn VM_MAKE_TAG(id: u8) -> u32 {
3845 (id as u32) << 24u32
3846 }
3847 }
3848
3849 safe_f! {
3850 pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
3851 status >> 8
3852 }
3853
3854 pub {const} fn _WSTATUS(status: ::c_int) -> ::c_int {
3855 status & 0x7f
3856 }
3857
3858 pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
3859 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
3860 }
3861
3862 pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
3863 _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
3864 }
3865
3866 pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
3867 _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
3868 }
3869 }
3870
3871 extern "C" {
3872 pub fn setgrent();
3873 #[doc(hidden)]
3874 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")]
3875 #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")]
3876 pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
3877 #[doc(hidden)]
3878 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
3879 pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
3880 #[doc(hidden)]
3881 #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
3882 pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
3883 pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
3884 pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
3885 pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
3886 pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
3887 pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
3888 #[cfg_attr(
3889 all(target_os = "macos", target_arch = "x86"),
3890 link_name = "aio_suspend$UNIX2003"
3891 )]
3892 pub fn aio_suspend(
3893 aiocb_list: *const *const aiocb,
3894 nitems: ::c_int,
3895 timeout: *const ::timespec,
3896 ) -> ::c_int;
3897 pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
3898 pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
3899 pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
3900 pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
3901 pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
3902 pub fn lio_listio(
3903 mode: ::c_int,
3904 aiocb_list: *const *mut aiocb,
3905 nitems: ::c_int,
3906 sevp: *mut sigevent,
3907 ) -> ::c_int;
3908
3909 pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
3910
3911 pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
3912
3913 pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
3914 pub fn getutxent() -> *mut utmpx;
3915 pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
3916 pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
3917 pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
3918 pub fn setutxent();
3919 pub fn endutxent();
3920 pub fn utmpxname(file: *const ::c_char) -> ::c_int;
3921
3922 pub fn getnameinfo(
3923 sa: *const ::sockaddr,
3924 salen: ::socklen_t,
3925 host: *mut ::c_char,
3926 hostlen: ::socklen_t,
3927 serv: *mut ::c_char,
3928 sevlen: ::socklen_t,
3929 flags: ::c_int,
3930 ) -> ::c_int;
3931 pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
3932 pub fn sysctlnametomib(
3933 name: *const ::c_char,
3934 mibp: *mut ::c_int,
3935 sizep: *mut ::size_t,
3936 ) -> ::c_int;
3937 #[cfg_attr(
3938 all(target_os = "macos", target_arch = "x86"),
3939 link_name = "mprotect$UNIX2003"
3940 )]
3941 pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
3942 pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
3943 #[cfg_attr(
3944 all(target_os = "macos", target_arch = "x86"),
3945 link_name = "semctl$UNIX2003"
3946 )]
3947 pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
3948 pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
3949 pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
3950 pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t;
3951 pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
3952 pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
3953 #[cfg_attr(
3954 all(target_os = "macos", target_arch = "x86"),
3955 link_name = "shmctl$UNIX2003"
3956 )]
3957 pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
3958 pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
3959 pub fn sysctl(
3960 name: *mut ::c_int,
3961 namelen: ::c_uint,
3962 oldp: *mut ::c_void,
3963 oldlenp: *mut ::size_t,
3964 newp: *mut ::c_void,
3965 newlen: ::size_t,
3966 ) -> ::c_int;
3967 pub fn sysctlbyname(
3968 name: *const ::c_char,
3969 oldp: *mut ::c_void,
3970 oldlenp: *mut ::size_t,
3971 newp: *mut ::c_void,
3972 newlen: ::size_t,
3973 ) -> ::c_int;
3974 #[deprecated(since = "0.2.55", note = "Use the mach crate")]
3975 pub fn mach_absolute_time() -> u64;
3976 #[deprecated(since = "0.2.55", note = "Use the mach crate")]
3977 #[allow(deprecated)]
3978 pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
3979 pub fn mach_host_self() -> mach_port_t;
3980 pub fn mach_thread_self() -> mach_port_t;
3981 pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
3982 pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
3983 pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
3984 pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
3985 pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
3986 pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
3987 pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
3988 pub fn pthread_condattr_getpshared(
3989 attr: *const pthread_condattr_t,
3990 pshared: *mut ::c_int,
3991 ) -> ::c_int;
3992 pub fn pthread_mutexattr_setpshared(
3993 attr: *mut pthread_mutexattr_t,
3994 pshared: ::c_int,
3995 ) -> ::c_int;
3996 pub fn pthread_mutexattr_getpshared(
3997 attr: *const pthread_mutexattr_t,
3998 pshared: *mut ::c_int,
3999 ) -> ::c_int;
4000 pub fn pthread_rwlockattr_getpshared(
4001 attr: *const pthread_rwlockattr_t,
4002 val: *mut ::c_int,
4003 ) -> ::c_int;
4004 pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
4005 pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int;
4006 pub fn pthread_attr_set_qos_class_np(
4007 attr: *mut pthread_attr_t,
4008 class: qos_class_t,
4009 priority: ::c_int,
4010 ) -> ::c_int;
4011 pub fn pthread_attr_get_qos_class_np(
4012 attr: *mut pthread_attr_t,
4013 class: *mut qos_class_t,
4014 priority: *mut ::c_int,
4015 ) -> ::c_int;
4016 pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int;
4017 pub fn pthread_get_qos_class_np(
4018 thread: ::pthread_t,
4019 class: *mut qos_class_t,
4020 priority: *mut ::c_int,
4021 ) -> ::c_int;
4022 pub fn pthread_attr_getschedparam(
4023 attr: *const ::pthread_attr_t,
4024 param: *mut sched_param,
4025 ) -> ::c_int;
4026 pub fn pthread_attr_setschedparam(
4027 attr: *mut ::pthread_attr_t,
4028 param: *const sched_param,
4029 ) -> ::c_int;
4030 pub fn pthread_getschedparam(
4031 thread: ::pthread_t,
4032 policy: *mut ::c_int,
4033 param: *mut sched_param,
4034 ) -> ::c_int;
4035 pub fn pthread_setschedparam(
4036 thread: ::pthread_t,
4037 policy: ::c_int,
4038 param: *const sched_param,
4039 ) -> ::c_int;
4040 pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
4041 pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
4042 pub fn thread_policy_set(
4043 thread: thread_t,
4044 flavor: thread_policy_flavor_t,
4045 policy_info: thread_policy_t,
4046 count: mach_msg_type_number_t,
4047 ) -> kern_return_t;
4048 pub fn thread_policy_get(
4049 thread: thread_t,
4050 flavor: thread_policy_flavor_t,
4051 policy_info: thread_policy_t,
4052 count: *mut mach_msg_type_number_t,
4053 get_default: *mut boolean_t,
4054 ) -> kern_return_t;
4055 pub fn thread_info(
4056 target_act: thread_inspect_t,
4057 flavor: thread_flavor_t,
4058 thread_info_out: thread_info_t,
4059 thread_info_outCnt: *mut mach_msg_type_number_t,
4060 ) -> kern_return_t;
4061 pub fn __error() -> *mut ::c_int;
4062 pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
4063 #[cfg_attr(
4064 all(target_os = "macos", not(target_arch = "aarch64")),
4065 link_name = "statfs$INODE64"
4066 )]
4067 pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
4068 #[cfg_attr(
4069 all(target_os = "macos", not(target_arch = "aarch64")),
4070 link_name = "fstatfs$INODE64"
4071 )]
4072 pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
4073 pub fn kevent(
4074 kq: ::c_int,
4075 changelist: *const ::kevent,
4076 nchanges: ::c_int,
4077 eventlist: *mut ::kevent,
4078 nevents: ::c_int,
4079 timeout: *const ::timespec,
4080 ) -> ::c_int;
4081 pub fn kevent64(
4082 kq: ::c_int,
4083 changelist: *const ::kevent64_s,
4084 nchanges: ::c_int,
4085 eventlist: *mut ::kevent64_s,
4086 nevents: ::c_int,
4087 flags: ::c_uint,
4088 timeout: *const ::timespec,
4089 ) -> ::c_int;
4090 pub fn mount(
4091 src: *const ::c_char,
4092 target: *const ::c_char,
4093 flags: ::c_int,
4094 data: *mut ::c_void,
4095 ) -> ::c_int;
4096 pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
4097 pub fn quotactl(
4098 special: *const ::c_char,
4099 cmd: ::c_int,
4100 id: ::c_int,
4101 data: *mut ::c_char,
4102 ) -> ::c_int;
4103 pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
4104 pub fn sendfile(
4105 fd: ::c_int,
4106 s: ::c_int,
4107 offset: ::off_t,
4108 len: *mut ::off_t,
4109 hdtr: *mut ::sf_hdtr,
4110 flags: ::c_int,
4111 ) -> ::c_int;
4112 pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
4113 pub fn utimensat(
4114 dirfd: ::c_int,
4115 path: *const ::c_char,
4116 times: *const ::timespec,
4117 flag: ::c_int,
4118 ) -> ::c_int;
4119 pub fn openpty(
4120 amaster: *mut ::c_int,
4121 aslave: *mut ::c_int,
4122 name: *mut ::c_char,
4123 termp: *mut termios,
4124 winp: *mut ::winsize,
4125 ) -> ::c_int;
4126 pub fn forkpty(
4127 amaster: *mut ::c_int,
4128 name: *mut ::c_char,
4129 termp: *mut termios,
4130 winp: *mut ::winsize,
4131 ) -> ::pid_t;
4132 pub fn login_tty(fd: ::c_int) -> ::c_int;
4133 pub fn duplocale(base: ::locale_t) -> ::locale_t;
4134 pub fn freelocale(loc: ::locale_t) -> ::c_int;
4135 pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
4136 pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
4137 pub fn uselocale(loc: ::locale_t) -> ::locale_t;
4138 pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
4139 pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
4140 pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
4141 pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
4142 pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
4143 pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
4144 pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
4145 -> ::ssize_t;
4146 pub fn getxattr(
4147 path: *const ::c_char,
4148 name: *const ::c_char,
4149 value: *mut ::c_void,
4150 size: ::size_t,
4151 position: u32,
4152 flags: ::c_int,
4153 ) -> ::ssize_t;
4154 pub fn fgetxattr(
4155 filedes: ::c_int,
4156 name: *const ::c_char,
4157 value: *mut ::c_void,
4158 size: ::size_t,
4159 position: u32,
4160 flags: ::c_int,
4161 ) -> ::ssize_t;
4162 pub fn setxattr(
4163 path: *const ::c_char,
4164 name: *const ::c_char,
4165 value: *const ::c_void,
4166 size: ::size_t,
4167 position: u32,
4168 flags: ::c_int,
4169 ) -> ::c_int;
4170 pub fn fsetxattr(
4171 filedes: ::c_int,
4172 name: *const ::c_char,
4173 value: *const ::c_void,
4174 size: ::size_t,
4175 position: u32,
4176 flags: ::c_int,
4177 ) -> ::c_int;
4178 pub fn listxattr(
4179 path: *const ::c_char,
4180 list: *mut ::c_char,
4181 size: ::size_t,
4182 flags: ::c_int,
4183 ) -> ::ssize_t;
4184 pub fn flistxattr(
4185 filedes: ::c_int,
4186 list: *mut ::c_char,
4187 size: ::size_t,
4188 flags: ::c_int,
4189 ) -> ::ssize_t;
4190 pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int;
4191 pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int;
4192 pub fn renameatx_np(
4193 fromfd: ::c_int,
4194 from: *const ::c_char,
4195 tofd: ::c_int,
4196 to: *const ::c_char,
4197 flags: ::c_uint,
4198 ) -> ::c_int;
4199 pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int;
4200
4201 pub fn getgrouplist(
4202 name: *const ::c_char,
4203 basegid: ::c_int,
4204 groups: *mut ::c_int,
4205 ngroups: *mut ::c_int,
4206 ) -> ::c_int;
4207 pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
4208
4209 #[cfg_attr(
4210 all(target_os = "macos", target_arch = "x86"),
4211 link_name = "waitid$UNIX2003"
4212 )]
4213 pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
4214 -> ::c_int;
4215 pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
4216 pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
4217 pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
4218 #[deprecated(since = "0.2.55", note = "Use the mach crate")]
4219 pub fn _dyld_image_count() -> u32;
4220 #[deprecated(since = "0.2.55", note = "Use the mach crate")]
4221 #[allow(deprecated)]
4222 pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
4223 #[deprecated(since = "0.2.55", note = "Use the mach crate")]
4224 pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t;
4225 #[deprecated(since = "0.2.55", note = "Use the mach crate")]
4226 pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char;
4227
4228 pub fn posix_spawn(
4229 pid: *mut ::pid_t,
4230 path: *const ::c_char,
4231 file_actions: *const ::posix_spawn_file_actions_t,
4232 attrp: *const ::posix_spawnattr_t,
4233 argv: *const *mut ::c_char,
4234 envp: *const *mut ::c_char,
4235 ) -> ::c_int;
4236 pub fn posix_spawnp(
4237 pid: *mut ::pid_t,
4238 file: *const ::c_char,
4239 file_actions: *const ::posix_spawn_file_actions_t,
4240 attrp: *const ::posix_spawnattr_t,
4241 argv: *const *mut ::c_char,
4242 envp: *const *mut ::c_char,
4243 ) -> ::c_int;
4244 pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
4245 pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
4246 pub fn posix_spawnattr_getsigdefault(
4247 attr: *const posix_spawnattr_t,
4248 default: *mut ::sigset_t,
4249 ) -> ::c_int;
4250 pub fn posix_spawnattr_setsigdefault(
4251 attr: *mut posix_spawnattr_t,
4252 default: *const ::sigset_t,
4253 ) -> ::c_int;
4254 pub fn posix_spawnattr_getsigmask(
4255 attr: *const posix_spawnattr_t,
4256 default: *mut ::sigset_t,
4257 ) -> ::c_int;
4258 pub fn posix_spawnattr_setsigmask(
4259 attr: *mut posix_spawnattr_t,
4260 default: *const ::sigset_t,
4261 ) -> ::c_int;
4262 pub fn posix_spawnattr_getflags(
4263 attr: *const posix_spawnattr_t,
4264 flags: *mut ::c_short,
4265 ) -> ::c_int;
4266 pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
4267 pub fn posix_spawnattr_getpgroup(
4268 attr: *const posix_spawnattr_t,
4269 flags: *mut ::pid_t,
4270 ) -> ::c_int;
4271 pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
4272
4273 pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
4274 pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
4275 pub fn posix_spawn_file_actions_addopen(
4276 actions: *mut posix_spawn_file_actions_t,
4277 fd: ::c_int,
4278 path: *const ::c_char,
4279 oflag: ::c_int,
4280 mode: ::mode_t,
4281 ) -> ::c_int;
4282 pub fn posix_spawn_file_actions_addclose(
4283 actions: *mut posix_spawn_file_actions_t,
4284 fd: ::c_int,
4285 ) -> ::c_int;
4286 pub fn posix_spawn_file_actions_adddup2(
4287 actions: *mut posix_spawn_file_actions_t,
4288 fd: ::c_int,
4289 newfd: ::c_int,
4290 ) -> ::c_int;
4291 pub fn uname(buf: *mut ::utsname) -> ::c_int;
4292
4293 pub fn connectx(
4294 socket: ::c_int,
4295 endpoints: *const sa_endpoints_t,
4296 associd: sae_associd_t,
4297 flags: ::c_uint,
4298 iov: *const ::iovec,
4299 iovcnt: ::c_uint,
4300 len: *mut ::size_t,
4301 connid: *mut sae_connid_t,
4302 ) -> ::c_int;
4303 pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int;
4304
4305 pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
4306 pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
4307
4308 #[cfg_attr(
4309 all(target_os = "macos", not(target_arch = "aarch64")),
4310 link_name = "getmntinfo$INODE64"
4311 )]
4312 pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int;
4313 #[cfg_attr(
4314 all(target_os = "macos", not(target_arch = "aarch64")),
4315 link_name = "getfsstat$INODE64"
4316 )]
4317 pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int;
4318
4319 // Copy-on-write functions.
4320 // According to the man page `flags` is an `int` but in the header
4321 // this is a `uint32_t`.
4322 pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int;
4323 pub fn clonefileat(
4324 src_dirfd: ::c_int,
4325 src: *const ::c_char,
4326 dst_dirfd: ::c_int,
4327 dst: *const ::c_char,
4328 flags: u32,
4329 ) -> ::c_int;
4330 pub fn fclonefileat(
4331 srcfd: ::c_int,
4332 dst_dirfd: ::c_int,
4333 dst: *const ::c_char,
4334 flags: u32,
4335 ) -> ::c_int;
4336
4337 // Added in macOS 10.13
4338 // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
4339 pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
4340 // Added in macOS 10.5
4341 pub fn memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t);
4342 pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t);
4343 pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
4344
4345 pub fn mstats() -> mstats;
4346 pub fn malloc_printf(format: *const ::c_char, ...);
4347 pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t;
4348 pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
4349 pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
4350 pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
4351 pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
4352 pub fn malloc_default_zone() -> *mut ::malloc_zone_t;
4353 pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t;
4354 pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
4355 pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
4356 pub fn malloc_zone_calloc(
4357 zone: *mut ::malloc_zone_t,
4358 num_items: ::size_t,
4359 size: ::size_t,
4360 ) -> *mut ::c_void;
4361 pub fn malloc_zone_realloc(
4362 zone: *mut ::malloc_zone_t,
4363 ptr: *mut ::c_void,
4364 size: ::size_t,
4365 ) -> *mut ::c_void;
4366 pub fn malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void);
4367
4368 pub fn proc_listpids(
4369 t: u32,
4370 typeinfo: u32,
4371 buffer: *mut ::c_void,
4372 buffersize: ::c_int,
4373 ) -> ::c_int;
4374 pub fn proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int;
4375 pub fn proc_listpgrppids(
4376 pgrpid: ::pid_t,
4377 buffer: *mut ::c_void,
4378 buffersize: ::c_int,
4379 ) -> ::c_int;
4380 pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int)
4381 -> ::c_int;
4382 pub fn proc_pidinfo(
4383 pid: ::c_int,
4384 flavor: ::c_int,
4385 arg: u64,
4386 buffer: *mut ::c_void,
4387 buffersize: ::c_int,
4388 ) -> ::c_int;
4389 pub fn proc_pidfdinfo(
4390 pid: ::c_int,
4391 fd: ::c_int,
4392 flavor: ::c_int,
4393 buffer: *mut ::c_void,
4394 buffersize: ::c_int,
4395 ) -> ::c_int;
4396 pub fn proc_pidfileportinfo(
4397 pid: ::c_int,
4398 fileport: u32,
4399 flavor: ::c_int,
4400 buffer: *mut ::c_void,
4401 buffersize: ::c_int,
4402 ) -> ::c_int;
4403 pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
4404 pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
4405 pub fn proc_regionfilename(
4406 pid: ::c_int,
4407 address: u64,
4408 buffer: *mut ::c_void,
4409 buffersize: u32,
4410 ) -> ::c_int;
4411 pub fn proc_libversion(major: *mut ::c_int, mintor: *mut ::c_int) -> ::c_int;
4412 /// # Notes
4413 ///
4414 /// `id` is of type [`uuid_t`].
4415 pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int;
4416
4417 pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
4418
4419 pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int;
4420 pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char;
4421
4422 pub fn mach_vm_map(
4423 target_task: ::vm_map_t,
4424 address: *mut ::mach_vm_address_t,
4425 size: ::mach_vm_size_t,
4426 mask: ::mach_vm_offset_t,
4427 flags: ::c_int,
4428 object: ::mem_entry_name_port_t,
4429 offset: ::memory_object_offset_t,
4430 copy: ::boolean_t,
4431 cur_protection: ::vm_prot_t,
4432 max_protection: ::vm_prot_t,
4433 inheritance: ::vm_inherit_t,
4434 ) -> ::kern_return_t;
4435 }
4436
4437 cfg_if! {
4438 if #[cfg(target_os = "macos")] {
4439 extern "C" {
4440 pub fn memmem(
4441 haystack: *const ::c_void,
4442 haystacklen: ::size_t,
4443 needle: *const ::c_void,
4444 needlelen: ::size_t,
4445 ) -> *mut ::c_void;
4446 }
4447 }
4448 }
4449
4450 #[link(name = "iconv")]
4451 extern "C" {
4452 pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
4453 pub fn iconv(
4454 cd: iconv_t,
4455 inbuf: *mut *mut ::c_char,
4456 inbytesleft: *mut ::size_t,
4457 outbuf: *mut *mut ::c_char,
4458 outbytesleft: *mut ::size_t,
4459 ) -> ::size_t;
4460 pub fn iconv_close(cd: iconv_t) -> ::c_int;
4461 }
4462
4463 cfg_if! {
4464 if #[cfg(any(target_arch = "arm", target_arch = "x86"))] {
4465 mod b32;
4466 pub use self::b32::*;
4467 } else if #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] {
4468 mod b64;
4469 pub use self::b64::*;
4470 } else {
4471 // Unknown target_arch
4472 }
4473 }