2 * D header file for GNU/Linux
4 * $(LINK2 http://sourceware.org/git/?p=glibc.git;a=blob;f=dlfcn/dlfcn.h, glibc dlfcn/dlfcn.h)
6 module core
.sys
.linux
.dlfcn
;
13 version (ARM
) version = ARM_Any
;
14 version (AArch64
) version = ARM_Any
;
15 version (HPPA
) version = HPPA_Any
;
16 version (MIPS32
) version = MIPS_Any
;
17 version (MIPS64
) version = MIPS_Any
;
18 version (PPC
) version = PPC_Any
;
19 version (PPC64
) version = PPC_Any
;
20 version (RISCV32
) version = RISCV_Any
;
21 version (RISCV64
) version = RISCV_Any
;
22 version (S390
) version = IBMZ_Any
;
23 version (SPARC
) version = SPARC_Any
;
24 version (SPARC64
) version = SPARC_Any
;
25 version (SystemZ
) version = IBMZ_Any
;
26 version (X86
) version = X86_Any
;
27 version (X86_64
) version = X86_Any
;
29 public import core
.sys
.posix
.dlfcn
;
30 import core
.sys
.linux
.config
;
35 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
36 static if (_GNU_SOURCE
)
38 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
40 _dl_mcount_wrapper_check(cast(void*)fctp
);
44 void _dl_mcount_wrapper_check(void* __selfpc
);
47 else version (HPPA_Any
)
49 // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/hppa/bits/dlfcn.h
50 static if (_GNU_SOURCE
)
52 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
54 _dl_mcount_wrapper_check(cast(void*)fctp
);
58 void _dl_mcount_wrapper_check(void* __selfpc
);
61 else version (MIPS_Any
)
63 // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/mips/bits/dlfcn.h
64 static if (_GNU_SOURCE
)
66 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
68 _dl_mcount_wrapper_check(cast(void*)fctp
);
72 void _dl_mcount_wrapper_check(void* __selfpc
);
75 else version (PPC_Any
)
77 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
78 static if (_GNU_SOURCE
)
80 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
82 _dl_mcount_wrapper_check(cast(void*)fctp
);
86 void _dl_mcount_wrapper_check(void* __selfpc
);
89 else version (ARM_Any
)
91 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
92 static if (_GNU_SOURCE
)
94 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
96 _dl_mcount_wrapper_check(cast(void*)fctp
);
100 void _dl_mcount_wrapper_check(void* __selfpc
);
103 else version (RISCV_Any
)
105 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
106 static if (_GNU_SOURCE
)
108 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
110 _dl_mcount_wrapper_check(cast(void*)fctp
);
114 void _dl_mcount_wrapper_check(void* __selfpc
);
117 else version (SPARC_Any
)
119 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
120 static if (_GNU_SOURCE
)
122 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
124 _dl_mcount_wrapper_check(cast(void*)fctp
);
128 void _dl_mcount_wrapper_check(void* __selfpc
);
131 else version (IBMZ_Any
)
133 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
134 static if (_GNU_SOURCE
)
136 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
138 _dl_mcount_wrapper_check(cast(void*)fctp
);
142 void _dl_mcount_wrapper_check(void* __selfpc
);
145 else version (LoongArch64
)
147 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
148 static if (_GNU_SOURCE
)
150 RT
DL_CALL_FCT(RT
, Args
...)(RT
function(Args
) fctp
, auto ref Args args
)
152 _dl_mcount_wrapper_check(cast(void*)fctp
);
156 void _dl_mcount_wrapper_check(void* __selfpc
);
160 static assert(0, "unimplemented");
164 static if (_GNU_SOURCE
)
166 enum RTLD_NEXT
= cast(void *)-1L;
167 enum RTLD_DEFAULT
= cast(void *)0;
170 enum LM_ID_NEWLM
= -1;
173 // void* dlopen(const scope char* __file, int __mode); // POSIX
174 // int dlclose(void* __handle); // POSIX
175 // void* dlsym(void* __handle, const scope char* __name); // POSIX
177 static if (_GNU_SOURCE
)
179 void* dlmopen(Lmid_t __nsid
, const scope char* __file
, int __mode
);
180 void* dlvsym(void* __handle
, const scope char* __name
, const scope char* __version
);
183 // char* dlerror(); // POSIX
185 static if (_GNU_SOURCE
)
187 int dladdr1(void* __address
, Dl_info
* __info
, void** __extra_info
, int __flags
);
195 int dlinfo(void* __handle
, int __request
, void* __arg
);
201 RTLD_DI_CONFIGADDR
= 3,
203 RTLD_DI_SERINFOSIZE
= 5,
205 RTLD_DI_PROFILENAME
= 7,
206 RTLD_DI_PROFILEOUT
= 8,
207 RTLD_DI_TLS_MODID
= 9,
208 RTLD_DI_TLS_DATA
= 10,
222 Dl_serpath
[1] dls_serpath
;