SomeStrangeUser
SomeStrangeUser

Reputation: 797

Checking whether a shared object was loaded in unix

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

Answers (1)

Icarus3
Icarus3

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() returns NULL if it is not, or the library's handle if it is resident).

Upvotes: 4

Related Questions