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