Skip to content

haku adding dl_iterate_phdr bsd extension #3153

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

Merged
merged 1 commit into from
Mar 29, 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 libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4231,6 +4231,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;
}

cfg_if! {
Expand Down