| ... | ... | @@ -164,6 +164,7 @@ pub const mach_vm_address_t = usize; |
| 164 | 164 | pub const vm_offset_t = usize; |
| 165 | 165 | pub const mach_vm_size_t = u64; |
| 166 | 166 | pub const mach_msg_type_number_t = natural_t; |
| 167 | pub const mach_msg_type_name_t = u32; |
| 167 | 168 | pub const mach_port_right_t = natural_t; |
| 168 | 169 | pub const ipc_space_t = mach_port_t; |
| 169 | 170 | pub const ipc_space_port_t = ipc_space_t; |
| ... | ... | @@ -180,6 +181,38 @@ pub const MACH_PORT_RIGHT = enum(mach_port_right_t) { |
| 180 | 181 | NUMBER = 6, |
| 181 | 182 | }; |
| 182 | 183 | |
| 184 | pub const MACH_MSG_TYPE = enum(mach_msg_type_name_t) { |
| 185 | /// Must hold receive right |
| 186 | MOVE_RECEIVE = 16, |
| 187 | |
| 188 | /// Must hold send right(s) |
| 189 | MOVE_SEND = 17, |
| 190 | |
| 191 | /// Must hold sendonce right |
| 192 | MOVE_SEND_ONCE = 18, |
| 193 | |
| 194 | /// Must hold send right(s) |
| 195 | COPY_SEND = 19, |
| 196 | |
| 197 | /// Must hold receive right |
| 198 | MAKE_SEND = 20, |
| 199 | |
| 200 | /// Must hold receive right |
| 201 | MAKE_SEND_ONCE = 21, |
| 202 | |
| 203 | /// NOT VALID |
| 204 | COPY_RECEIVE = 22, |
| 205 | |
| 206 | /// Must hold receive right |
| 207 | DISPOSE_RECEIVE = 24, |
| 208 | |
| 209 | /// Must hold send right(s) |
| 210 | DISPOSE_SEND = 25, |
| 211 | |
| 212 | /// Must hold sendonce right |
| 213 | DISPOSE_SEND_ONCE = 26, |
| 214 | }; |
| 215 | |
| 183 | 216 | extern "c" var mach_task_self_: mach_port_t; |
| 184 | 217 | pub fn mach_task_self() callconv(.C) mach_port_t { |
| 185 | 218 | return mach_task_self_; |
| ... | ... | @@ -527,6 +560,12 @@ pub extern "c" fn mach_port_allocate( |
| 527 | 560 | name: *mach_port_name_t, |
| 528 | 561 | ) kern_return_t; |
| 529 | 562 | pub extern "c" fn mach_port_deallocate(task: ipc_space_t, name: mach_port_name_t) kern_return_t; |
| 563 | pub extern "c" fn mach_port_insert_right( |
| 564 | task: ipc_space_t, |
| 565 | name: mach_port_name_t, |
| 566 | poly: mach_port_t, |
| 567 | poly_poly: mach_msg_type_name_t, |
| 568 | ) kern_return_t; |
| 530 | 569 | |
| 531 | 570 | pub extern "c" fn task_info( |
| 532 | 571 | target_task: task_name_t, |