diff options
| author | Alexander Kabaev <kan@FreeBSD.org> | 2003-02-20 20:42:46 +0000 |
|---|---|---|
| committer | Alexander Kabaev <kan@FreeBSD.org> | 2003-02-20 20:42:46 +0000 |
| commit | f864ae268ecf8afbe72747597635fd2624509cf8 (patch) | |
| tree | 9ec7318ce1d41b5210f77de60d3e305880cf1a0a /include | |
| parent | 75c7c718637e845322503bcf6e0cacf84b55f640 (diff) | |
Notes
Diffstat (limited to 'include')
| -rw-r--r-- | include/dlfcn.h | 36 | ||||
| -rw-r--r-- | include/link.h | 15 |
2 files changed, 48 insertions, 3 deletions
diff --git a/include/dlfcn.h b/include/dlfcn.h index 5034a36b072c..045792853238 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -35,7 +35,9 @@ #ifndef _DLFCN_H_ #define _DLFCN_H_ + #include <sys/cdefs.h> +#include <machine/ansi.h> /* * Modes and flags for dlopen(). @@ -48,10 +50,19 @@ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit */ /* - * Special handle arguments for dlsym(). + * Request arguments for dlinfo(). + */ +#define RTLD_DI_LINKMAP 2 +#define RTLD_DI_SERINFO 4 +#define RTLD_DI_SERINFOSIZE 5 +#define RTLD_DI_ORIGIN 6 + +/* + * Special handle arguments for dlsym()/dlinfo(). */ #define RTLD_NEXT ((void *) -1) /* Search subsequent objects */ #define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm */ +#define RTLD_SELF ((void *) -3) /* Search the caller itself. */ /* * Structure filled in by dladdr(). @@ -63,10 +74,33 @@ typedef struct dl_info { void *dli_saddr; /* Address of nearest symbol */ } Dl_info; +/* + * Avoid sys/types.h namespace pollution. + */ +#ifdef _BSD_SIZE_T_ +typedef _BSD_SIZE_T_ size_t; +#undef _BSD_SIZE_T_ +#endif + +/* + * Structures, returned by the RTLD_DI_SERINFO dlinfo() request. + */ +typedef struct dl_serpath { + char * dls_name; /* single search path entry */ + unsigned int dls_flags; /* path information */ +} Dl_serpath; + +typedef struct dl_serinfo { + size_t dls_size; /* total buffer size */ + unsigned int dls_cnt; /* number of path entries */ + Dl_serpath dls_serpath[1]; /* there may be more than one */ +} Dl_serinfo; + __BEGIN_DECLS int dladdr __P((const void *, Dl_info *)); int dlclose __P((void *)); const char *dlerror __P((void)); +int dlinfo __P((void *, int, void *)); void dllockinit __P((void *_context, void *(*_lock_create)(void *_context), void (*_rlock_acquire)(void *_lock), diff --git a/include/link.h b/include/link.h index 2339aeeade36..1afaedad1fbf 100644 --- a/include/link.h +++ b/include/link.h @@ -45,7 +45,18 @@ #include <sys/types.h> -struct link_map { +/* + * Flags that describe the origin of the entries in Dl_serinfo. + * SunOS has these in <sys/link.h>, we follow the suit. + */ +#define LA_SER_ORIG 0x01 /* original (needed) name */ +#define LA_SER_LIBPATH 0x02 /* LD_LIBRARY_PATH entry prepended */ +#define LA_SER_RUNPATH 0x04 /* runpath entry prepended */ +#define LA_SER_CONFIG 0x08 /* configuration entry prepended */ +#define LA_SER_DEFAULT 0x40 /* default path prepended */ +#define LA_SER_SECURE 0x80 /* default (secure) path prepended */ + +typedef struct link_map { caddr_t l_addr; /* Base Address of library */ #ifdef __mips__ caddr_t l_offs; /* Load Offset of library */ @@ -53,7 +64,7 @@ struct link_map { const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, *l_prev; /* linked list of of mapped libs */ -}; +} Link_map; struct r_debug { int r_version; /* not used */ |
