How to get name of dynamically loaded library in linux from within the library that has been opened using ::dlopen?

跟風遠走 提交于 2019-12-08 09:39:10

问题


in windows one can use GetModuleFileName. what about linux?


回答1:


dladdr() is a non-standard (not part of POSIX) function that works on most Linux boxes and in OSX. Since it is non standard there are no guarantees, but it should be there since you specified Linux.



来源:https://stackoverflow.com/questions/10305428/how-to-get-name-of-dynamically-loaded-library-in-linux-from-within-the-library-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!