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