|
@ -1,4 +1,4 @@ |
|
|
/* $OpenBSD: dlfcn.h,v 1.11 2007/05/29 04:47:17 jason Exp $ */ |
|
|
|
|
|
|
|
|
/* $OpenBSD: dlfcn.h,v 1.12 2012/10/01 00:21:19 guenther Exp $ */ |
|
|
/* $NetBSD: dlfcn.h,v 1.2 1995/06/05 19:38:00 pk Exp $ */ |
|
|
/* $NetBSD: dlfcn.h,v 1.2 1995/06/05 19:38:00 pk Exp $ */ |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
@ -36,34 +36,11 @@ |
|
|
|
|
|
|
|
|
#include <sys/cdefs.h> |
|
|
#include <sys/cdefs.h> |
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* Structure filled in by dladdr(). |
|
|
|
|
|
*/ |
|
|
|
|
|
typedef struct dl_info { |
|
|
|
|
|
const char *dli_fname; /* Pathname of shared object. */ |
|
|
|
|
|
void *dli_fbase; /* Base address of shared object. */ |
|
|
|
|
|
const char *dli_sname; /* Name of nearest symbol. */ |
|
|
|
|
|
void *dli_saddr; /* Address of nearest symbol. */ |
|
|
|
|
|
} Dl_info; |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* User interface to the run-time linker. |
|
|
|
|
|
*/ |
|
|
|
|
|
__BEGIN_DECLS |
|
|
|
|
|
extern void *dlopen(const char *, int); |
|
|
|
|
|
extern int dlclose(void *); |
|
|
|
|
|
extern void *dlsym(void *, const char *); |
|
|
|
|
|
extern int dlctl(void *, int, void *); |
|
|
|
|
|
extern const char *dlerror(void); |
|
|
|
|
|
extern int dladdr(const void *, Dl_info *); |
|
|
|
|
|
__END_DECLS |
|
|
|
|
|
|
|
|
|
|
|
/* Values for dlopen `mode'. */ |
|
|
/* Values for dlopen `mode'. */ |
|
|
#define RTLD_LAZY 1 |
|
|
#define RTLD_LAZY 1 |
|
|
#define RTLD_NOW 2 |
|
|
#define RTLD_NOW 2 |
|
|
#define RTLD_GLOBAL 0x100 |
|
|
#define RTLD_GLOBAL 0x100 |
|
|
#define RTLD_LOCAL 0x000 |
|
|
#define RTLD_LOCAL 0x000 |
|
|
#define DL_LAZY RTLD_LAZY /* Compat */ |
|
|
|
|
|
#define RTLD_TRACE 0x200 |
|
|
#define RTLD_TRACE 0x200 |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
@ -73,6 +50,18 @@ __END_DECLS |
|
|
#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */ |
|
|
#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */ |
|
|
#define RTLD_SELF ((void *) -3) /* Search the caller itself. */ |
|
|
#define RTLD_SELF ((void *) -3) /* Search the caller itself. */ |
|
|
|
|
|
|
|
|
|
|
|
#if __BSD_VISIBLE |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* Structure filled in by dladdr(). |
|
|
|
|
|
*/ |
|
|
|
|
|
typedef struct dl_info { |
|
|
|
|
|
const char *dli_fname; /* Pathname of shared object. */ |
|
|
|
|
|
void *dli_fbase; /* Base address of shared object. */ |
|
|
|
|
|
const char *dli_sname; /* Name of nearest symbol. */ |
|
|
|
|
|
void *dli_saddr; /* Address of nearest symbol. */ |
|
|
|
|
|
} Dl_info; |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* dlctl() commands |
|
|
* dlctl() commands |
|
|
*/ |
|
|
*/ |
|
@ -84,4 +73,25 @@ __END_DECLS |
|
|
#define DL_SETTHREADLCK 2 |
|
|
#define DL_SETTHREADLCK 2 |
|
|
#define DL_SETBINDLCK 3 |
|
|
#define DL_SETBINDLCK 3 |
|
|
|
|
|
|
|
|
|
|
|
#define DL_LAZY RTLD_LAZY /* Compat */ |
|
|
|
|
|
|
|
|
|
|
|
#endif /* __BSD_VISIBLE */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* User interface to the run-time linker. |
|
|
|
|
|
*/ |
|
|
|
|
|
__BEGIN_DECLS |
|
|
|
|
|
void *dlopen(const char *, int); |
|
|
|
|
|
int dlclose(void *); |
|
|
|
|
|
void *dlsym(void *__restrict, const char *__restrict); |
|
|
|
|
|
const char *dlerror(void); |
|
|
|
|
|
|
|
|
|
|
|
#if __BSD_VISIBLE |
|
|
|
|
|
int dladdr(const void *, Dl_info *); |
|
|
|
|
|
int dlctl(void *, int, void *); |
|
|
|
|
|
#endif /* __BSD_VISIBLE */ |
|
|
|
|
|
|
|
|
|
|
|
__END_DECLS |
|
|
|
|
|
|
|
|
#endif /* _DLFCN_H_ */ |
|
|
#endif /* _DLFCN_H_ */ |