Skip to content

Commit 80c6c64

Browse files
committed
Auto merge of #1624 - noam93k:master, r=gnzlbg
Add dlmopen dlinfo and related consts. I actually have no idea if the constants I copied from my computer are cross-platform.
2 parents 4c41ef0 + 41b09a1 commit 80c6c64

File tree

1 file changed

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

1 file changed

+30
-0
lines changed

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

Lines changed: 30 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,20 @@ extern "C" {
10241040
) -> ::c_int;
10251041
}
10261042

1043+
#[link(name = "dl")]
1044+
extern "C" {
1045+
pub fn dlmopen(
1046+
lmid: Lmid_t,
1047+
filename: *const ::c_char,
1048+
flag: ::c_int,
1049+
) -> *mut ::c_void;
1050+
pub fn dlinfo(
1051+
handle: *mut ::c_void,
1052+
request: ::c_int,
1053+
info: *mut ::c_void,
1054+
) -> ::c_int;
1055+
}
1056+
10271057
cfg_if! {
10281058
if #[cfg(any(target_arch = "x86",
10291059
target_arch = "arm",

0 commit comments

Comments
 (0)