Skip to content
Snippets Groups Projects
Commit 88d23e7e authored by Alex Crichton's avatar Alex Crichton
Browse files

Add dladdr bindings

parent 56f61049
No related branches found
No related tags found
No related merge requests found
......@@ -117,6 +117,7 @@ fn main() {
// Just pass all these through, no need for a "struct" prefix
"FILE" |
"fd_set" |
"Dl_info" |
"DIR" => ty.to_string(),
// Fixup a few types on windows that don't actually exist.
......@@ -229,6 +230,7 @@ fn main() {
"gettimeofday" if linux || android || freebsd => true,
"dlerror" if android => true, // const-ness is added
"dladdr" if musl => true, // const-ness only added recently
_ => false,
}
......
......@@ -76,6 +76,13 @@ s! {
#[cfg(not(target_os = "android"))]
pub ipv6mr_interface: ::c_uint,
}
pub struct Dl_info {
pub dli_fname: *const ::c_char,
pub dli_fbase: *mut ::c_void,
pub dli_sname: *const ::c_char,
pub dli_saddr: *mut ::c_void,
}
}
pub const WNOHANG: ::c_int = 1;
......@@ -432,6 +439,7 @@ extern {
pub fn dlsym(handle: *mut ::c_void,
symbol: *const ::c_char) -> *mut ::c_void;
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
}
// TODO: get rid of this #[cfg(not(...))]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment