diff options
Diffstat (limited to 'dlfcn/dlfcn.h')
-rw-r--r-- | dlfcn/dlfcn.h | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/dlfcn/dlfcn.h b/dlfcn/dlfcn.h index 6c8e4abcc4..9d8ee0d6d1 100644 --- a/dlfcn/dlfcn.h +++ b/dlfcn/dlfcn.h @@ -21,6 +21,8 @@ #define _DLFCN_H 1 #include <features.h> +#define __need_size_t +#include <stddef.h> /* Collect various system dependent definitions and declarations. */ #include <bits/dlfcn.h> @@ -100,7 +102,57 @@ enum RTLD_DL_LINKMAP = 2 }; -#endif + +/* Get information about the shared object HANDLE refers to. + REQUEST is from among the values below, and determines the use of ARG. + + On success, returns zero. On failure, returns -1 and records an error + message to be fetched with `dlerror'. */ +extern int dlinfo (void *__restrict __handle, + int __request, void *__restrict __arg); + +/* These are the possible values for the REQUEST argument to `dlinfo'. */ +enum + { + /* Treat ARG as `struct link_map **'; + store the `struct link_map *' for HANDLE there. */ + RTLD_DI_LINKMAP = 2, + + /* Treat ARG as `Dl_serinfo *' (see below), and fill in to describe the + directories that will be searched for dependencies of this object. + RTLD_DI_SERINFOSIZE fills in just the `dls_cnt' and `dls_size' + entries to indicate the size of the buffer that must be passed to + RTLD_DI_SERINFO to fill in the full information. */ + RTLD_DI_SERINFO = 4, + RTLD_DI_SERINFOSIZE = 5, + + /* Treat ARG as `char *', and store there the directory name used to + expand $ORIGIN in this shared object's dependency file names. */ + RTLD_DI_ORIGIN = 6, + + RTLD_DI_LMID = 1, /* Unsupported, defined by Solaris. */ + RTLD_DI_CONFIGADDR = 3 /* Unsupported, defined by Solaris. */ + }; + + +/* This is the type of elements in `Dl_serinfo', below. + The `dls_name' member points to space in the buffer passed to `dlinfo'. */ +typedef struct +{ + char *dls_name; /* Name of library search path directory. */ + unsigned int dls_flags; /* Indicates where this directory came from. */ +} Dl_serpath; + +/* This is the structure that must be passed (by reference) to `dlinfo' for + the RTLD_DI_SERINFO and RTLD_DI_SERINFOSIZE requests. */ +typedef struct +{ + size_t dls_size; /* Size in bytes of the whole buffer. */ + unsigned int dls_cnt; /* Number of elements in `dls_serpath'. */ + Dl_serpath dls_serpath[1]; /* Actually longer, dls_cnt elements. */ +} Dl_serinfo; +#endif /* __USE_GNU */ + __END_DECLS |