Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mach_ports_lookup #28

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct ipc_port;
pub type ipc_port_t = *mut ipc_port;

pub type mach_port_t = ::libc::c_uint;
pub type mach_port_array_t = *mut mach_port_t;

pub const MACH_PORT_NULL: mach_port_t = 0;
pub const MACH_PORT_DEAD: mach_port_t = !0;
Expand Down
7 changes: 6 additions & 1 deletion src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use kern_return::kern_return_t;
use mach_types::{task_name_t, task_t, thread_act_array_t};
use message::mach_msg_type_number_t;
use port::mach_port_t;
use port::{mach_port_array_t, mach_port_t};
use task_info::{task_flavor_t, task_info_t};

pub type task_special_port_t = ::libc::c_int;
Expand Down Expand Up @@ -38,4 +38,9 @@ extern "C" {
task_info_in: task_info_t,
task_info_inCnt: mach_msg_type_number_t,
) -> kern_return_t;
pub fn mach_ports_lookup(
target_task: task_t,
init_port_set: *mut mach_port_array_t,
init_port_setCnt: *mut mach_msg_type_number_t,
) -> kern_return_t;
}