dladdr should be available under _BSD_SOURCE as well as _GNU_SOURCE
[musl] / include / dlfcn.h
1 #ifndef _DLFCN_H
2 #define _DLFCN_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #if __STDC_VERSION__ >= 199901L
9 #define __restrict restrict
10 #elif !defined(__GNUC__)
11 #define __restrict
12 #endif
13
14 #define RTLD_LAZY   1
15 #define RTLD_NOW    2
16 #define RTLD_GLOBAL 256
17 #define RTLD_LOCAL  0
18
19 #define RTLD_NEXT    ((void *)-1)
20 #define RTLD_DEFAULT ((void *)0)
21
22 int    dlclose(void *);
23 char  *dlerror(void);
24 void  *dlopen(const char *, int);
25 void  *dlsym(void *__restrict, const char *__restrict);
26
27 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
28 typedef struct {
29         const char *dli_fname;
30         void *dli_fbase;
31         const char *dli_sname;
32         void *dli_saddr;
33 } Dl_info;
34 int dladdr(void *, Dl_info *);
35 #endif
36
37 #ifdef __cplusplus
38 }
39 #endif
40
41 #endif