名称
dladdr, dlclose, dlerror, dlopen, dlsym, dlvsym - programming interface to dynamic linking loader dladdr,dlclose,dlerror,dlopen的,则dlsym,dlvsym - 编程接口以动态连接装载机
Synopsis简介
#include <dlfcn.h >#包括< dlfcn.h时 >
void *dlopen(const char *filename , int flag );*无效使用dlopen(常量字符* 文件名 ,INT 标志);
char *dlerror(void);的char * dlerror(无效);
void *dlsym(void *handle , const char * symbol );无效*对dlsym(无效* 手柄 ,常量字符* 符号 );
int dlclose(void *handle ); dlclose(* 句柄无效);
Link with-ldl .与低密度脂蛋白的链接。
Description描述
The four functionsdlopen (), dlsym (), dlclose (),dlerror () implement the interface to the dynamic linking loader.四大功能使用dlopen(),则dlsym(),dlclose(),dlerror()实现该接口的动态链接装载机。
dlerror()dlerror()
-
The functiondlerror () returns a human readable string describing the most recent error that occurred fromdlopen (), dlsym () or dlclose () since the last call todlerror ().
dlerror()函数返回一个人类可读的字符串描述最近错误的,自上次调用
dlerror()dlopen()的
,则dlsym()
或 dlclose()发生。
It returns NULL if no errors have occurred since initialization or since it was last called.如果没有错误发生自初始化,因为它是上次调用,它返回NULL。
dlopen()dlopen()的
-
The functiondlopen () loads the dynamic library file named by the null-terminated stringfilename and returns an opaque "handle" for the dynamic library.
dlopen()的函数加载动态库文件,以空结尾的字符串
文件名 命名为动态库,并返回一个不透明的“把手”。
If filename is NULL, then the returned handle is for the main program.如果
文件名 是NULL,那么返回的句柄是主程序。
If filename contains a slash ("/"), then it is interpreted as a (relative or absolute) pathname.如果
文件名 中包含斜线(“/”),然后它被解释为路径(相对或绝对)。
Otherwise, the dynamic linker searches for the library as follows (seeld.so (8) for further details):否则,如下(见库的动态链接器
ld.so (8)为进一步的细节):
o Ø
(ELF only) If the executable file for the calling program contains a DT_RPATH tag, and does not contain a DT_RUNPATH tag, then the directories listed in the DT_RPATH tag are searched. (低频),如果调用程序的可执行文件包含DT_RPATH标签,不包含DT_RUNPATH的标签,然后在DT_RPATH标签中列出的目录搜索。
o Ø
If, at the time that the program was started, the environment variableLD_LIBRARY_PATH was defined to contain a colon-separated list of directories, then these are searched.在该计划的启动时间,如果环境变量LD_LIBRARY_PATH定义包含一个冒号分隔的目录列表,那么这些搜索。(As a security measure this variable is ignored for set-user-ID and set-group-ID programs.) (此变量,作为一项安全措施被忽略的set-user-ID和设置组ID方案。)
o Ø
(ELF only) If the executable file for the calling program contains a DT_RUNPATH tag, then the directories listed in that tag are searched. (低频)如果调用程序的可执行文件包含一个DT_RUNPATH标签,然后在该标签中列出的目录搜索。
o Ø
The cache file/etc/ld.so.cache (maintained by ldconfig (8)) is checked to see whether it contains an entry forfilename .缓存文件/ etc / ld.so.cache的 (保持LDCONFIG (8))进行检查,看它是否包含一个文件名 的条目。
o Ø
The directories/lib and /usr/lib are searched (in that order).搜索目录/ lib和/ usr / lib目录 (按顺序)。
If the library has dependencies on other shared libraries, then these are also automatically loaded by the dynamic linker using the same rules.如果库有依赖于其他共享库,那么这些也自动加载动态连接器使用相同的规则。 (This process may occur recursively, if those libraries in turn have dep