MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / loadModule

Method loadModule

src/common/os/posix/mod_loader.cpp:130–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128#endif
129
130ModuleLoader::Module* ModuleLoader::loadModule(ISC_STATUS* status, const Firebird::PathName& modPath)
131{
132 void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE);
133 if (module == NULL)
134 {
135 makeErrorStatus(status, dlerror());
136 return 0;
137 }
138
139#ifdef DEBUG_THREAD_IN_UNLOADED_LIBRARY
140 Firebird::string command;
141 command.printf("echo +++ %s +++ >>/tmp/fbmaps;date >> /tmp/fbmaps;cat /proc/%d/maps >>/tmp/fbmaps",
142 modPath.c_str(), getpid());
143 system(command.c_str());
144#endif
145
146 Firebird::PathName linkPath = modPath;
147 char b[PATH_MAX];
148 const char* newPath = realpath(modPath.c_str(), b);
149 if (newPath)
150 linkPath = newPath;
151
152 return FB_NEW_POOL(*getDefaultMemoryPool()) DlfcnModule(*getDefaultMemoryPool(), linkPath, module);
153}
154
155DlfcnModule::DlfcnModule(MemoryPool& pool, const Firebird::PathName& aFileName, void* m)
156 : ModuleLoader::Module(pool, aFileName),

Callers

nothing calls this directly

Calls 6

makeErrorStatusFunction · 0.85
getDefaultMemoryPoolFunction · 0.85
DlfcnModuleClass · 0.70
nullStrMethod · 0.45
printfMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected