diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index a4f4148d06bfe..c63f4df5f874b 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -36,10 +36,14 @@ cfg_if! { type Elf_Addr = Elf64_Addr; type Elf_Half = Elf64_Half; type Elf_Phdr = Elf64_Phdr; + // Mainly code consumer is _dlauxinfo + type AuxInfo = Aux64Info; } else if #[cfg(target_pointer_width = "32")] { type Elf_Addr = Elf32_Addr; type Elf_Half = Elf32_Half; type Elf_Phdr = Elf32_Phdr; + // Mainly code consumer is _dlauxinfo + type AuxInfo = Aux32Info; } } @@ -403,6 +407,16 @@ s! { pub p_align: Elf64_Xword, } + pub struct Aux32Info { + pub a_type: Elf32_Word, + pub a_v: Elf32_Word, + } + + pub struct Aux64Info { + pub a_type: Elf64_Word, + pub a_v: Elf64_Xword, + } + // link.h pub struct dl_phdr_info { @@ -2074,6 +2088,10 @@ extern "C" { data: *mut ::c_void, ) -> ::c_int; + // dlfcn.h + + pub fn _dlauxinfo() -> *mut ::c_void; + pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t; pub fn iconv( cd: iconv_t,