diff options
author | bors <bors@rust-lang.org> | 2023-03-29 11:22:02 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2023-03-29 11:22:02 +0000 |
commit | 68e06adafa8f793b094a23b210d39b27c813600c (patch) | |
tree | 23dfa2e1ba9c89338557c0fac16d399899ccefe9 | |
parent | 3a6c1c429096afda8ec585b1f30149bef5329f66 (diff) | |
parent | 47b56cd35b98b6d840452bf0ff70b00ff41461e5 (diff) | |
download | rust-libc-68e06adafa8f793b094a23b210d39b27c813600c.tar.gz |
Auto merge of #3153 - devnexen:dl_iterate_phdr_haiku, r=JohnTitor
haku adding dl_iterate_phdr bsd extension
-rw-r--r-- | libc-test/build.rs | 1 | ||||
-rw-r--r-- | src/unix/haiku/mod.rs | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index 7df612655e..9536668f2f 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4234,6 +4234,7 @@ fn test_haiku(target: &str) { "link.h", "pty.h", "stringlist.h", + "sys/link_elf.h", } // Native API diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index e484ac4f49..8af90b0de3 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -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! { @@ -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")] |