Skip to content

Commit 68e06ad

Browse files
committed
Auto merge of rust-lang#3153 - devnexen:dl_iterate_phdr_haiku, r=JohnTitor
haku adding dl_iterate_phdr bsd extension
2 parents 3a6c1c4 + 47b56cd commit 68e06ad

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

libc-test/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4234,6 +4234,7 @@ fn test_haiku(target: &str) {
42344234
"link.h",
42354235
"pty.h",
42364236
"stringlist.h",
4237+
"sys/link_elf.h",
42374238
}
42384239

42394240
// Native API

src/unix/haiku/mod.rs

+17
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,13 @@ s! {
445445
pub sl_max: ::size_t,
446446
pub sl_cur: ::size_t,
447447
}
448+
449+
pub struct dl_phdr_info {
450+
pub dlpi_addr: ::Elf_Addr,
451+
pub dlpi_name: *const ::c_char,
452+
pub dlpi_phdr: *const ::Elf_Phdr,
453+
pub dlpi_phnum: ::Elf_Half,
454+
}
448455
}
449456

450457
s_no_extra_traits! {
@@ -2033,6 +2040,16 @@ extern "C" {
20332040

20342041
pub fn getprogname() -> *const ::c_char;
20352042
pub fn setprogname(progname: *const ::c_char);
2043+
pub fn dl_iterate_phdr(
2044+
callback: ::Option<
2045+
unsafe extern "C" fn(
2046+
info: *mut dl_phdr_info,
2047+
size: usize,
2048+
data: *mut ::c_void,
2049+
) -> ::c_int,
2050+
>,
2051+
data: *mut ::c_void,
2052+
) -> ::c_int;
20362053
}
20372054

20382055
#[link(name = "unix")]

0 commit comments

Comments
 (0)