ModuleLoader::Module* ModuleLoader::loadModule(ISC_STATUS* status, const Firebird::PathName& modPath) { void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE); if (module == NULL) { if (status) { status[0] = isc_arg_gds; status[1] = isc_random; status[2] = isc_arg_string; status[3] = (ISC_STATUS) dlerror(); status[4] = isc_arg_end; } return 0; } #ifdef DEBUG_THREAD_IN_UNLOADED_LIBRARY Firebird::string command; command.printf("echo +++ %s +++ >>/tmp/fbmaps;date >> /tmp/fbmaps;cat /proc/%d/maps >>/tmp/fbmaps", modPath.c_str(), getpid()); system(command.c_str()); #endif return FB_NEW_POOL(*getDefaultMemoryPool()) DlfcnModule(*getDefaultMemoryPool(), modPath, module); }
ModuleLoader::Module* ModuleLoader::loadModule(const Firebird::PathName& modPath) { void* module = dlopen(modPath.c_str(), FB_RTLD_MODE); if (module == NULL) { #ifdef DEBUG_LOADER fprintf(stderr, "load error: %s: %s\n", modPath.c_str(), dlerror()); #endif // DEBUG_LOADER return 0; } return FB_NEW_POOL(*getDefaultMemoryPool()) DlfcnModule(module); }
ModuleLoader::Module* ModuleLoader::loadModule(const Firebird::PathName& modPath) { void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE); if (module == NULL) { #ifdef DEV_BUILD // gds__log("loadModule failed loading %s: %s", modPath.c_str(), dlerror()); #endif return 0; } #ifdef DEBUG_THREAD_IN_UNLOADED_LIBRARY Firebird::string command; command.printf("echo +++ %s +++ >>/tmp/fbmaps;date >> /tmp/fbmaps;cat /proc/%d/maps >>/tmp/fbmaps", modPath.c_str(), getpid()); system(command.c_str()); #endif return FB_NEW_POOL(*getDefaultMemoryPool()) DlfcnModule(module); }