| 140 | } |
| 141 | |
| 142 | void* load_lib(const std::string& name) override { |
| 143 | auto ret = dlopen(realpath(name).c_str(), RTLD_LAZY | RTLD_LOCAL); |
| 144 | mgb_throw_if( |
| 145 | !ret, SystemError, "failed to load library %s: %s", name.c_str(), |
| 146 | dlerror()); |
| 147 | return ret; |
| 148 | } |
| 149 | |
| 150 | void* resolve_func(void* handle, const std::string& func_name) override { |
| 151 | auto ret = dlsym(handle, func_name.c_str()); |