论坛首页 编程语言技术论坛

C: Linux C 编程 - dynamic linking loader

浏览 278 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2020-09-27  

dynamic linking loader

 

dlopen

函数原型

void *dlopen(const char *filename, int flag);

 

dlerror

函数原型

char *dlerror(void);

 

dlsym

函数原型

void *dlsym(void *handle, const char *symbol);

 

dlclose

函数原型

int dlclose(void *handle);

写道
Since the value of the symbol could actually be NULL (so that a NULL return from dlsym() need not indicate an error), the correct way to test for an error is to call dlerror() to clear any old error conditions, then call dlsym(), and then call dlerror() again, saving its return value into a variable, and check whether this saved value is not NULL.

 

论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics