blob: 78fb0733b2eb82be221e2e26fb5df369be7bb715 [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 Felkerc1a96582012-09-07 23:13:55 -04008#include <features.h>
Rich Felker400c5e52012-09-06 22:44:55 -04009
Rich Felker87a30ce2011-06-27 01:01:19 -040010#define RTLD_LAZY 1
11#define RTLD_NOW 2
Rich Felker4d07e552013-01-23 22:07:45 -050012#define RTLD_NOLOAD 4
Rich Felker55ddbc32013-01-23 22:18:45 -050013#define RTLD_NODELETE 4096
Rich Felker87a30ce2011-06-27 01:01:19 -040014#define RTLD_GLOBAL 256
15#define RTLD_LOCAL 0
Rich Felker0b44a032011-02-12 00:22:29 -050016
Rich Felker230f1812011-06-27 01:02:28 -040017#define RTLD_NEXT ((void *)-1)
18#define RTLD_DEFAULT ((void *)0)
Rich Felker0b44a032011-02-12 00:22:29 -050019
Rich Felker780cbbe2013-06-29 12:46:46 -040020#define RTLD_DI_LINKMAP 2
21
Rich Felker0b44a032011-02-12 00:22:29 -050022int 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;
Rich Felker839cc4e2014-01-06 22:03:38 -050034int dladdr(const void *, Dl_info *);
Rich Felker780cbbe2013-06-29 12:46:46 -040035int dlinfo(void *, int, void *);
Rich Felkerf419bcb2012-08-26 21:09:26 -040036#endif
37
Rich Felker230f1812011-06-27 01:02:28 -040038#ifdef __cplusplus
39}
40#endif
41
Rich Felker0b44a032011-02-12 00:22:29 -050042#endif