Skip to content

Commit a9cb77f

Browse files
committed
Add dlmopen dlinfo and related consts.
1 parent 4f11029 commit a9cb77f

File tree

1 file changed

+22
-0
lines changed
  • src/unix/linux_like/linux/gnu

1 file changed

+22
-0
lines changed

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type pthread_t = c_ulong;
22
pub type __priority_which_t = ::c_uint;
33
pub type __rlimit_resource_t = ::c_uint;
4+
pub type Lmid_t = ::c_long;
45

56
s! {
67
pub struct statx {
@@ -337,6 +338,21 @@ pub const USER_PROCESS: ::c_short = 7;
337338
pub const DEAD_PROCESS: ::c_short = 8;
338339
pub const ACCOUNTING: ::c_short = 9;
339340

341+
// dlfcn.h
342+
pub const LM_ID_BASE: ::c_long = 0;
343+
pub const LM_ID_NEWLM: ::c_long = -1;
344+
345+
pub const RTLD_DI_LMID: ::c_int = 1;
346+
pub const RTLD_DI_LINKMAP: ::c_int = 2;
347+
pub const RTLD_DI_CONFIGADDR: ::c_int = 3;
348+
pub const RTLD_DI_SERINFO: ::c_int = 4;
349+
pub const RTLD_DI_SERINFOSIZE: ::c_int = 5;
350+
pub const RTLD_DI_ORIGIN: ::c_int = 6;
351+
pub const RTLD_DI_PROFILENAME: ::c_int = 7;
352+
pub const RTLD_DI_PROFILEOUT: ::c_int = 8;
353+
pub const RTLD_DI_TLS_MODID: ::c_int = 9;
354+
pub const RTLD_DI_TLS_DATA: ::c_int = 10;
355+
340356
pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
341357

342358
pub const SOL_RXRPC: ::c_int = 272;
@@ -1024,6 +1040,12 @@ extern "C" {
10241040
) -> ::c_int;
10251041
}
10261042

1043+
#[link(name = "dl")]
1044+
extern "C" {
1045+
pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
1046+
pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
1047+
}
1048+
10271049
cfg_if! {
10281050
if #[cfg(any(target_arch = "x86",
10291051
target_arch = "arm",

0 commit comments

Comments
 (0)