10 return dlopen(path.c_str(), RTLD_NOW);
13void*
FindExport(
void* module,
const char* name)
15 return dlsym(module, name);
20 const char* message = dlerror();
21 return message !=
nullptr ? message :
"no message";
27 static const char inThisModule = 0;
29 dladdr(&inThisModule, &info);
31 return std::filesystem::absolute(info.dli_fname).lexically_normal();
37 if (dladdr(address, &info) == 0)
41 void* module = dlopen(info.dli_fname, RTLD_NOW | RTLD_NOLOAD);
42 if (module ==
nullptr)
46 auto* factory =
reinterpret_cast<InterfaceFactory>(dlsym(module,
"CreateInterface"));
void *(*)(const char *name, int *returnCode) InterfaceFactory
static std::string LastError()
std::filesystem::path OwnPath()
InterfaceFactory FactoryAt(const void *address)
void * OpenModule(const std::filesystem::path &path)
static void * FindExport(void *handle, const char *name)