@@ -44,6 +44,15 @@ pub type processor_flavor_t = ::c_int;
44
44
pub type thread_flavor_t = natural_t ;
45
45
pub type thread_inspect_t = mach_port_t ;
46
46
pub type policy_t = :: c_int ;
47
+ pub type mach_vm_address_t = u64 ;
48
+ pub type mach_vm_offset_t = u64 ;
49
+ pub type mach_vm_size_t = u64 ;
50
+ pub type vm_map_t = :: mach_port_t ;
51
+ pub type mem_entry_name_port_t = :: mach_port_t ;
52
+ pub type memory_object_t = :: mach_port_t ;
53
+ pub type memory_object_offset_t = :: c_ulonglong ;
54
+ pub type vm_inherit_t = :: c_uint ;
55
+ pub type vm_prot_t = :: c_int ;
47
56
48
57
pub type iconv_t = * mut :: c_void ;
49
58
@@ -88,7 +97,6 @@ pub type CCCryptorStatus = i32;
88
97
pub type CCRNGStatus = :: CCCryptorStatus ;
89
98
90
99
deprecated_mach ! {
91
- pub type vm_prot_t = :: c_int;
92
100
pub type vm_size_t = :: uintptr_t;
93
101
pub type mach_timebase_info_data_t = mach_timebase_info;
94
102
}
@@ -3218,6 +3226,11 @@ pub const VM_LOADAVG: ::c_int = 2;
3218
3226
pub const VM_MACHFACTOR : :: c_int = 4 ;
3219
3227
pub const VM_SWAPUSAGE : :: c_int = 5 ;
3220
3228
pub const VM_MAXID : :: c_int = 6 ;
3229
+ pub const VM_PROT_NONE : :: vm_prot_t = 0x00 ;
3230
+ pub const VM_PROT_READ : :: vm_prot_t = 0x01 ;
3231
+ pub const VM_PROT_WRITE : :: vm_prot_t = 0x02 ;
3232
+ pub const VM_PROT_EXECUTE : :: vm_prot_t = 0x04 ;
3233
+ pub const MEMORY_OBJECT_NULL : :: memory_object_t = 0 ;
3221
3234
pub const HW_MACHINE : :: c_int = 1 ;
3222
3235
pub const HW_MODEL : :: c_int = 2 ;
3223
3236
pub const HW_NCPU : :: c_int = 3 ;
@@ -4289,6 +4302,20 @@ extern "C" {
4289
4302
pub fn CCRandomGenerateBytes ( bytes : * mut :: c_void , size : :: size_t ) -> :: CCRNGStatus ;
4290
4303
4291
4304
pub fn _NSGetExecutablePath ( buf : * mut :: c_char , bufsize : * mut u32 ) -> :: c_int ;
4305
+
4306
+ pub fn mach_vm_map (
4307
+ target_task : :: vm_map_t ,
4308
+ address : * mut :: mach_vm_address_t ,
4309
+ size : :: mach_vm_size_t ,
4310
+ mask : :: mach_vm_offset_t ,
4311
+ flags : :: c_int ,
4312
+ object : :: mem_entry_name_port_t ,
4313
+ offset : :: memory_object_offset_t ,
4314
+ copy : :: boolean_t ,
4315
+ cur_protection : :: vm_prot_t ,
4316
+ max_protection : :: vm_prot_t ,
4317
+ inheritance : :: vm_inherit_t ,
4318
+ ) -> :: kern_return_t ;
4292
4319
}
4293
4320
4294
4321
cfg_if ! {
0 commit comments