未验证 提交 c5d919c8 编写于 作者: O openharmony_ci 提交者: Gitee

!794 add interface dlopen_ns_ext

Merge pull request !794 from XUBO/monthly_20221018
......@@ -55,6 +55,25 @@ typedef struct {
*/
void *dlopen_ext(const char *file, int mode, const dl_extinfo *extinfo);
/**
* @brief open dso in given namespace which has own lib search paths,
* when namespace is null, it's same to dlopen_ext().
* avoid using "default" as namespace, which is the default namespace.
* @param Dl_namespace * Carry the naming information of the namespace.
* @param char * the name of the so file you want to open.
* @param int open file mode.
* -- RTLD_LAZY.
* -- RTLD_NOW.
* -- RTLD_NOLOAD.
* -- RTLD_NODELETE.
* -- RTLD_GLOBAL.
* -- RTLD_LOCAL.
* @param dl_extinfo * indicates the dl_extinfo struct,include flag and relro_fd.
* @return success: dynamic library handleoid,failed: NULL.
* @retval none.
*/
void *dlopen_ns_ext(Dl_namespace *, const char *, int, const dl_extinfo *);
#ifdef __cplusplus
}
#endif
......
......@@ -3322,6 +3322,21 @@ void *dlopen_ns(Dl_namespace *dlns, const char *file, int mode)
return dlopen_impl(file, mode, dlns->name, caller_addr, NULL);
}
void *dlopen_ns_ext(Dl_namespace *dlns, const char *file, int mode, const dl_extinfo *extinfo)
{
const void *caller_addr = __builtin_return_address(0);
musl_log_reset();
ld_log_reset();
LD_LOGI("dlopen_ns_ext file:%{public}s, mode:%{public}x , caller_addr:%{public}p , "
"dlns->name:%{public}s. , extinfo->flag:%{public}x",
file,
mode,
caller_addr,
dlns->name,
extinfo ? extinfo->flag : 0);
return dlopen_impl(file, mode, dlns->name, caller_addr, extinfo);
}
int dlns_create2(Dl_namespace *dlns, const char *lib_path, int flags)
{
if (!dlns) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册