gpt4 book ai didi

linux - 在 dlopen(NULL) 返回的句柄上调用 dlclose

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:22:37 24 4
gpt4 key购买 nike

我正在使用 dlopen(NULL) 获取我的可执行文件的主模块的句柄,如下所示。

void *handle = dlopen(NULL, RTLD_NOW);

我应该调用 dlclose(handle) 来减少主模块的引用计数吗?

最佳答案

来自手册页:

   dlclose()
The function dlclose() decrements the reference count on the dynamic
library handle handle. If the reference count drops to zero and no
other loaded libraries use symbols in it, then the dynamic library is
unloaded.

我敢打赌,当您将它称为“主”句柄时它是空的

关于linux - 在 dlopen(NULL) 返回的句柄上调用 dlclose,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40676660/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com