blob: 53871ee033fad18c493e21e472daee3d0697eae7 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#ifndef _DLFCN_H
2#define _DLFCN_H
3
Rich Felker230f1812011-06-27 01:02:28 -04004#ifdef __cplusplus
5extern "C" {
6#endif
7
Rich Felker400c5e52012-09-06 22:44:55 -04008#if __STDC_VERSION__ >= 199901L
9#define __restrict restrict
10#elif !defined(__GNUC__)
11#define __restrict
12#endif
13
Rich Felker87a30ce2011-06-27 01:01:19 -040014#define RTLD_LAZY 1
15#define RTLD_NOW 2
16#define RTLD_GLOBAL 256
17#define RTLD_LOCAL 0
Rich Felker0b44a032011-02-12 00:22:29 -050018
Rich Felker230f1812011-06-27 01:02:28 -040019#define RTLD_NEXT ((void *)-1)
20#define RTLD_DEFAULT ((void *)0)
Rich Felker0b44a032011-02-12 00:22:29 -050021
22int dlclose(void *);
23char *dlerror(void);
24void *dlopen(const char *, int);
Rich Felker400c5e52012-09-06 22:44:55 -040025void *dlsym(void *__restrict, const char *__restrict);
Rich Felker0b44a032011-02-12 00:22:29 -050026
Rich Felkerac5d0852012-09-06 22:58:34 -040027#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
Rich Felkerf419bcb2012-08-26 21:09:26 -040028typedef struct {
29 const char *dli_fname;
30 void *dli_fbase;
31 const char *dli_sname;
32 void *dli_saddr;
33} Dl_info;
34int dladdr(void *, Dl_info *);
35#endif
36
Rich Felker230f1812011-06-27 01:02:28 -040037#ifdef __cplusplus
38}
39#endif
40
Rich Felker0b44a032011-02-12 00:22:29 -050041#endif