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