问题
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