Reputation: 797
When writing a windows application I can check if the current process has a specific dll loaded by using:
GetModuleHandle(TEXT("Dll Name"));
How can I obtain the same functionality in unix systems? That is, are there any common system calls that can give me some information regarding the shared objects the current process has (dynamically) loaded?
Upvotes: 1
Views: 242
Reputation: 2350
Look for dlopen
with RLTD_NOLOAD
:
RTLD_NOLOAD
(since glibc 2.2)This doesn't load the library. This can be used to test if the library is already resident (
dlopen()
returnsNULL
if it is not, or the library's handle if it is resident).
Upvotes: 4