Skip to content

Commit

Permalink
Auto merge of #3153 - devnexen:dl_iterate_phdr_haiku, r=JohnTitor
Browse files Browse the repository at this point in the history
haku adding dl_iterate_phdr bsd extension
  • Loading branch information
bors committed Mar 29, 2023
2 parents 3a6c1c4 + 47b56cd commit 68e06ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4234,6 +4234,7 @@ fn test_haiku(target: &str) {
"link.h",
"pty.h",
"stringlist.h",
"sys/link_elf.h",
}

// Native API
Expand Down
17 changes: 17 additions & 0 deletions src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,13 @@ s! {
pub sl_max: ::size_t,
pub sl_cur: ::size_t,
}

pub struct dl_phdr_info {
pub dlpi_addr: ::Elf_Addr,
pub dlpi_name: *const ::c_char,
pub dlpi_phdr: *const ::Elf_Phdr,
pub dlpi_phnum: ::Elf_Half,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -2033,6 +2040,16 @@ extern "C" {

pub fn getprogname() -> *const ::c_char;
pub fn setprogname(progname: *const ::c_char);
pub fn dl_iterate_phdr(
callback: ::Option<
unsafe extern "C" fn(
info: *mut dl_phdr_info,
size: usize,
data: *mut ::c_void,
) -> ::c_int,
>,
data: *mut ::c_void,
) -> ::c_int;
}

#[link(name = "unix")]
Expand Down

0 comments on commit 68e06ad

Please sign in to comment.