2 * D header file for POSIX.
4 * Copyright: Copyright Sean Kelly 2005 - 2009.
5 * License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 * Authors: Sean Kelly, Alex Rønne Petersen
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
10 /* Copyright Sean Kelly 2005 - 2009.
11 * Distributed under the Boost Software License, Version 1.0.
12 * (See accompanying file LICENSE or copy at
13 * http://www.boost.org/LICENSE_1_0.txt)
15 module core
.sys
.posix
.dlfcn
;
17 import core
.sys
.posix
.config
;
25 else version (WatchOS
)
28 version (ARM
) version = ARM_Any
;
29 version (AArch64
) version = ARM_Any
;
30 version (HPPA
) version = HPPA_Any
;
31 version (MIPS32
) version = MIPS_Any
;
32 version (MIPS64
) version = MIPS_Any
;
33 version (PPC
) version = PPC_Any
;
34 version (PPC64
) version = PPC_Any
;
35 version (RISCV32
) version = RISCV_Any
;
36 version (RISCV64
) version = RISCV_Any
;
37 version (S390
) version = IBMZ_Any
;
38 version (SPARC
) version = SPARC_Any
;
39 version (SPARC64
) version = SPARC_Any
;
40 version (SystemZ
) version = IBMZ_Any
;
41 version (X86
) version = X86_Any
;
42 version (X86_64
) version = X86_Any
;
60 void* dlopen(const scope char*, int);
61 void* dlsym(void*, const scope char*);
64 version (CRuntime_Glibc
)
68 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
69 enum RTLD_LAZY
= 0x00001;
70 enum RTLD_NOW
= 0x00002;
71 enum RTLD_BINDING_MASK
= 0x3;
72 enum RTLD_NOLOAD
= 0x00004;
73 enum RTLD_DEEPBIND
= 0x00008;
74 enum RTLD_GLOBAL
= 0x00100;
75 enum RTLD_LOCAL
= 0x00000;
76 enum RTLD_NODELETE
= 0x01000;
78 else version (HPPA_Any
)
80 // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/hppa/bits/dlfcn.h
81 enum RTLD_LAZY
= 0x0001;
82 enum RTLD_NOW
= 0x0002;
83 enum RTLD_BINDING_MASK
= 0x3;
84 enum RTLD_NOLOAD
= 0x00004;
85 enum RTLD_DEEPBIND
= 0x00008;
86 enum RTLD_GLOBAL
= 0x0100;
88 enum RTLD_NODELETE
= 0x01000;
90 else version (MIPS_Any
)
92 // http://sourceware.org/git/?p=glibc.git;a=blob;f=ports/sysdeps/mips/bits/dlfcn.h
93 enum RTLD_LAZY
= 0x0001;
94 enum RTLD_NOW
= 0x0002;
95 enum RTLD_BINDING_MASK
= 0x3;
96 enum RTLD_NOLOAD
= 0x00008;
97 enum RTLD_DEEPBIND
= 0x00010;
98 enum RTLD_GLOBAL
= 0x0004;
100 enum RTLD_NODELETE
= 0x01000;
102 else version (PPC_Any
)
104 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
105 enum RTLD_LAZY
= 0x00001;
106 enum RTLD_NOW
= 0x00002;
107 enum RTLD_BINDING_MASK
= 0x3;
108 enum RTLD_NOLOAD
= 0x00004;
109 enum RTLD_DEEPBIND
= 0x00008;
110 enum RTLD_GLOBAL
= 0x00100;
112 enum RTLD_NODELETE
= 0x01000;
114 else version (ARM_Any
)
116 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
117 enum RTLD_LAZY
= 0x00001;
118 enum RTLD_NOW
= 0x00002;
119 enum RTLD_BINDING_MASK
= 0x3;
120 enum RTLD_NOLOAD
= 0x00004;
121 enum RTLD_DEEPBIND
= 0x00008;
122 enum RTLD_GLOBAL
= 0x00100;
124 enum RTLD_NODELETE
= 0x01000;
126 else version (RISCV_Any
)
128 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
129 enum RTLD_LAZY
= 0x00001;
130 enum RTLD_NOW
= 0x00002;
131 enum RTLD_BINDING_MASK
= 0x3;
132 enum RTLD_NOLOAD
= 0x00004;
133 enum RTLD_DEEPBIND
= 0x00008;
134 enum RTLD_GLOBAL
= 0x00100;
136 enum RTLD_NODELETE
= 0x01000;
138 else version (SPARC_Any
)
140 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
141 enum RTLD_LAZY
= 0x00001;
142 enum RTLD_NOW
= 0x00002;
143 enum RTLD_BINDING_MASK
= 0x3;
144 enum RTLD_NOLOAD
= 0x00004;
145 enum RTLD_DEEPBIND
= 0x00008;
146 enum RTLD_GLOBAL
= 0x00100;
148 enum RTLD_NODELETE
= 0x01000;
151 else version (IBMZ_Any
)
153 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
154 enum RTLD_LAZY
= 0x00001;
155 enum RTLD_NOW
= 0x00002;
156 enum RTLD_BINDING_MASK
= 0x3;
157 enum RTLD_NOLOAD
= 0x00004;
158 enum RTLD_DEEPBIND
= 0x00008;
159 enum RTLD_GLOBAL
= 0x00100;
161 enum RTLD_NODELETE
= 0x01000;
163 else version (LoongArch64
)
165 // http://sourceware.org/git/?p=glibc.git;a=blob;f=bits/dlfcn.h
166 enum RTLD_LAZY
= 0x00001;
167 enum RTLD_NOW
= 0x00002;
168 enum RTLD_BINDING_MASK
= 0x3;
169 enum RTLD_NOLOAD
= 0x00004;
170 enum RTLD_DEEPBIND
= 0x00008;
171 enum RTLD_GLOBAL
= 0x00100;
173 enum RTLD_NODELETE
= 0x01000;
176 static assert(0, "unimplemented");
180 void* dlopen(const scope char*, int);
181 void* dlsym(void*, const scope char*);
182 int dladdr(const scope void*, Dl_info
*);
186 const(char)* dli_fname
;
188 const(char)* dli_sname
;
193 version (CRuntime_Musl
)
197 enum RTLD_NOLOAD
= 4;
198 enum RTLD_NODELETE
= 4096;
199 enum RTLD_GLOBAL
= 256;
202 enum RTLD_NEXT
= cast(void *)-1;
203 enum RTLD_DEFAULT
= cast(void *)0;
205 enum RTLD_DI_LINKMAP
= 2;
209 void *dlopen(const(char) *, int);
211 pragma(mangle
, muslRedirTime64Mangle
!("dlsym", "__dlsym_time64"))
212 void *dlsym(void *__restrict
, const(char) *__restrict
);
216 const(char)* dli_fname
;
218 const(char)* dli_sname
;
221 int dladdr(const(void) *, Dl_info
*);
222 int dlinfo(void *, int, void *);
224 else version (Darwin
)
226 enum RTLD_LAZY
= 0x00001;
227 enum RTLD_NOW
= 0x00002;
228 enum RTLD_NOLOAD
= 0x10;
229 enum RTLD_NODELETE
= 0x80;
230 enum RTLD_GLOBAL
= 0x00100;
231 enum RTLD_LOCAL
= 0x00000;
232 enum RTLD_FIRST
= 0x100;
236 void* dlopen(const scope char*, int);
237 void* dlsym(void*, const scope char*);
238 int dladdr(scope const void* addr
, Dl_info
* info
);
242 const(char)* dli_fname
;
244 const(char)* dli_sname
;
248 else version (FreeBSD
)
252 enum RTLD_MODEMASK
= 0x3;
253 enum RTLD_GLOBAL
= 0x100;
255 enum RTLD_TRACE
= 0x200;
256 enum RTLD_NODELETE
= 0x01000;
257 enum RTLD_NOLOAD
= 0x02000;
261 void* dlopen(const scope char*, int);
262 void* dlsym(void*, const scope char*);
263 int dladdr(const(void)* addr
, Dl_info
* info
);
267 const(char)* dli_fname
;
269 const(char)* dli_sname
;
273 else version (NetBSD
)
277 enum RTLD_GLOBAL
= 0x100;
278 enum RTLD_LOCAL
= 0x200;
279 enum RTLD_NODELETE
= 0x01000; /* Do not remove members. */
280 enum RTLD_NOLOAD
= 0x02000;
284 void* dlopen(const scope char*, int);
285 void* dlsym(void*, const scope char*);
286 int dladdr(const(void)* addr
, Dl_info
* info
);
290 const(char)* dli_fname
;
292 const(char)* dli_sname
;
296 else version (OpenBSD
)
300 enum RTLD_GLOBAL
= 0x100;
302 enum RTLD_TRACE
= 0x200;
303 enum RTLD_NODELETE
= 0x400;
307 void* dlopen(const scope char*, int);
308 void* dlsym(void*, const scope char*);
309 int dladdr(const(void)* addr
, Dl_info
* info
);
313 const(char)* dli_fname
;
315 const(char)* dli_sname
;
319 else version (DragonFlyBSD
)
323 enum RTLD_MODEMASK
= 0x3;
324 enum RTLD_GLOBAL
= 0x100;
326 enum RTLD_TRACE
= 0x200;
327 enum RTLD_NODELETE
= 0x01000;
328 enum RTLD_NOLOAD
= 0x02000;
332 void* dlopen(const scope char*, int);
333 void* dlsym(void*, const scope char*);
334 int dladdr(const(void)* addr
, Dl_info
* info
);
338 const(char)* dli_fname
;
340 const(char)* dli_sname
;
344 else version (Solaris
)
348 enum RTLD_NOLOAD
= 0x00004;
349 enum RTLD_DEEPBIND
= 0x00008;
350 enum RTLD_GLOBAL
= 0x100;
352 enum RTLD_PARENT
= 0x00200;
353 enum RTLD_GROUP
= 0x00400;
354 enum RTLD_WORLD
= 0x00800;
355 enum RTLD_NODELETE
= 0x01000;
356 enum RTLD_FIRST
= 0x02000;
357 enum RTLD_CONFGEN
= 0x10000;
361 void* dlopen(const scope char*, int);
362 void* dlsym(void*, const scope char*);
363 int dladdr(const(void)* addr
, Dl_info
* info
);
367 const(char)* dli_fname
;
369 const(char)* dli_sname
;
373 else version (CRuntime_Bionic
)
383 int dladdr(const scope void*, Dl_info
*);
385 const(char)* dlerror();
386 void* dlopen(const scope char*, int);
387 void* dlsym(void*, const scope char*);
391 const(char)* dli_fname
;
393 const(char)* dli_sname
;
397 else version (CRuntime_Musl
)
403 RTLD_NODELETE
= 4096,
408 const(char)* dlerror();
409 void* dlopen(const scope char*, int);
410 void* dlsym(void*, const scope char*);
412 int dladdr(scope const void *addr
, Dl_info
*info
);
415 const(char)* dli_fname
;
417 const(char)* dli_sname
;
421 else version (CRuntime_UClibc
)
425 enum RTLD_LAZY
= 0x0001;
426 enum RTLD_NOW
= 0x0002;
427 enum RTLD_BINDING_MASK
= 0x3;
428 enum RTLD_NOLOAD
= 0x00004;
429 enum RTLD_GLOBAL
= 0x00100;
431 enum RTLD_NODELETE
= 0x01000;
433 else version (MIPS_Any
)
435 enum RTLD_LAZY
= 0x0001;
436 enum RTLD_NOW
= 0x0002;
437 enum RTLD_BINDING_MASK
= 0x3;
438 enum RTLD_NOLOAD
= 0x00008;
439 enum RTLD_GLOBAL
= 0x0004;
441 enum RTLD_NODELETE
= 0x01000;
445 enum RTLD_LAZY
= 0x0001;
446 enum RTLD_NOW
= 0x0002;
447 enum RTLD_BINDING_MASK
= 0x3;
448 enum RTLD_NOLOAD
= 0x00004;
449 enum RTLD_GLOBAL
= 0x00100;
451 enum RTLD_NODELETE
= 0x01000;
454 static assert(0, "unimplemented");
458 void* dlopen(const scope char*, int);
459 void* dlsym(void*, const scope char*);
460 int dladdr(const scope void*, Dl_info
*);
464 const(char)* dli_fname
;
466 const(char)* dli_sname
;