| ... | @@ -164,6 +164,21 @@ pub const mach_vm_address_t = usize; | ... | @@ -164,6 +164,21 @@ pub const mach_vm_address_t = usize; |
| 164 | pub const vm_offset_t = usize; | 164 | pub const vm_offset_t = usize; |
| 165 | pub const mach_vm_size_t = u64; | 165 | pub const mach_vm_size_t = u64; |
| 166 | pub const mach_msg_type_number_t = natural_t; | 166 | pub const mach_msg_type_number_t = natural_t; |
| | 167 | pub const mach_port_right_t = natural_t; |
| | 168 | pub const ipc_space_t = mach_port_t; |
| | 169 | pub const ipc_space_port_t = ipc_space_t; |
| | 170 | |
| | 171 | pub const MACH_PORT_RIGHT = enum(mach_port_right_t) { |
| | 172 | SEND = 0, |
| | 173 | RECEIVE = 1, |
| | 174 | SEND_ONCE = 2, |
| | 175 | PORT_SET = 3, |
| | 176 | DEAD_NAME = 4, |
| | 177 | /// Obsolete right |
| | 178 | LABELH = 5, |
| | 179 | /// Right not implemented |
| | 180 | NUMBER = 6, |
| | 181 | }; |
| 167 | | 182 | |
| 168 | extern "c" var mach_task_self_: mach_port_t; | 183 | extern "c" var mach_task_self_: mach_port_t; |
| 169 | pub fn mach_task_self() callconv(.C) mach_port_t { | 184 | pub fn mach_task_self() callconv(.C) mach_port_t { |
| ... | @@ -506,7 +521,12 @@ pub extern "c" fn mach_vm_protect( | ... | @@ -506,7 +521,12 @@ pub extern "c" fn mach_vm_protect( |
| 506 | new_protection: vm_prot_t, | 521 | new_protection: vm_prot_t, |
| 507 | ) kern_return_t; | 522 | ) kern_return_t; |
| 508 | | 523 | |
| 509 | pub extern "c" fn mach_port_deallocate(target_tport: mach_port_name_t, task: mach_port_name_t) kern_return_t; | 524 | pub extern "c" fn mach_port_allocate( |
| | 525 | task: ipc_space_t, |
| | 526 | right: mach_port_right_t, |
| | 527 | name: *mach_port_name_t, |
| | 528 | ) kern_return_t; |
| | 529 | pub extern "c" fn mach_port_deallocate(task: ipc_space_t, name: mach_port_name_t) kern_return_t; |
| 510 | | 530 | |
| 511 | pub extern "c" fn task_info( | 531 | pub extern "c" fn task_info( |
| 512 | target_task: task_name_t, | 532 | target_task: task_name_t, |