Skip to content
Merged
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
21 changes: 20 additions & 1 deletion src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl mach_msg_ool_descriptor_t {
address: *mut ::libc::c_void,
deallocate: bool,
copy: mach_msg_copy_options_t,
size: u32,
size: mach_msg_size_t,
) -> Self {
Self {
address,
Expand All @@ -231,6 +231,25 @@ pub struct mach_msg_ool_ports_descriptor_t {
pub count: mach_msg_size_t,
}

impl mach_msg_ool_ports_descriptor_t {
pub fn new(
address: *mut ::libc::c_void,
deallocate: bool,
copy: mach_msg_copy_options_t,
disposition: mach_msg_type_name_t,
count: mach_msg_size_t,
) -> Self {
Self {
address,
deallocate: if deallocate { 1 } else { 0 },
copy: copy as u8,
disposition: disposition as u8,
type_: MACH_MSG_OOL_PORTS_DESCRIPTOR as u8,
count,
}
}
}

extern "C" {
pub fn mach_msg(
msg: *mut mach_msg_header_t,
Expand Down