Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _DLFCN_H |
| 2 | #define _DLFCN_H |
| 3 | |
Rich Felker | 230f181 | 2011-06-27 01:02:28 -0400 | [diff] [blame] | 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 8 | #if __STDC_VERSION__ >= 199901L |
| 9 | #define __restrict restrict |
| 10 | #elif !defined(__GNUC__) |
| 11 | #define __restrict |
| 12 | #endif |
| 13 | |
Rich Felker | 87a30ce | 2011-06-27 01:01:19 -0400 | [diff] [blame] | 14 | #define RTLD_LAZY 1 |
| 15 | #define RTLD_NOW 2 |
| 16 | #define RTLD_GLOBAL 256 |
| 17 | #define RTLD_LOCAL 0 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 18 | |
Rich Felker | 230f181 | 2011-06-27 01:02:28 -0400 | [diff] [blame] | 19 | #define RTLD_NEXT ((void *)-1) |
| 20 | #define RTLD_DEFAULT ((void *)0) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 21 | |
| 22 | int dlclose(void *); |
| 23 | char *dlerror(void); |
| 24 | void *dlopen(const char *, int); |
Rich Felker | 400c5e5 | 2012-09-06 22:44:55 -0400 | [diff] [blame] | 25 | void *dlsym(void *__restrict, const char *__restrict); |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 26 | |
Rich Felker | ac5d085 | 2012-09-06 22:58:34 -0400 | [diff] [blame^] | 27 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
Rich Felker | f419bcb | 2012-08-26 21:09:26 -0400 | [diff] [blame] | 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 | |
Rich Felker | 230f181 | 2011-06-27 01:02:28 -0400 | [diff] [blame] | 37 | #ifdef __cplusplus |
| 38 | } |
| 39 | #endif |
| 40 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 41 | #endif |