blob: 46c4e18555710eae3dde6fdc9f87f407cc0dc071 [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
12#define RTLD_GLOBAL 256
13#define RTLD_LOCAL 0
Rich Felker0b44a032011-02-12 00:22:29 -050014
Rich Felker230f1812011-06-27 01:02:28 -040015#define RTLD_NEXT ((void *)-1)
16#define RTLD_DEFAULT ((void *)0)
Rich Felker0b44a032011-02-12 00:22:29 -050017
18int dlclose(void *);
19char *dlerror(void);
20void *dlopen(const char *, int);
Rich Felker400c5e52012-09-06 22:44:55 -040021void *dlsym(void *__restrict, const char *__restrict);
Rich Felker0b44a032011-02-12 00:22:29 -050022
Rich Felkerac5d0852012-09-06 22:58:34 -040023#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
Rich Felkerf419bcb2012-08-26 21:09:26 -040024typedef struct {
25 const char *dli_fname;
26 void *dli_fbase;
27 const char *dli_sname;
28 void *dli_saddr;
29} Dl_info;
30int dladdr(void *, Dl_info *);
31#endif
32
Rich Felker230f1812011-06-27 01:02:28 -040033#ifdef __cplusplus
34}
35#endif
36
Rich Felker0b44a032011-02-12 00:22:29 -050037#endif