MCPcopy Create free account
hub / github.com/apache/arrow / LoadDynamicLibrary

Function LoadDynamicLibrary

cpp/src/arrow/util/io_util.cc:2261–2278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2259}
2260
2261Result<void*> LoadDynamicLibrary(const char* path) {
2262#ifdef _WIN32
2263 ARROW_ASSIGN_OR_RAISE(auto platform_path, PlatformFilename::FromString(path));
2264 return LoadDynamicLibrary(platform_path);
2265#else
2266 constexpr int kFlags =
2267 // All undefined symbols in the shared object are resolved before dlopen() returns.
2268 RTLD_NOW
2269 // Symbols defined in this shared object are not made available to
2270 // resolve references in subsequently loaded shared objects.
2271 | RTLD_LOCAL;
2272 if (void* handle = dlopen(path, kFlags)) return handle;
2273 // dlopen(3) man page: "If dlopen() fails for any reason, it returns NULL."
2274 // There is no null-returning non-error condition.
2275 auto* error = dlerror();
2276 return Status::IOError("dlopen(", path, ") failed: ", error ? error : "unknown error");
2277#endif
2278}
2279
2280Result<void*> LoadDynamicLibrary(const PlatformFilename& path) {
2281#ifdef _WIN32

Callers 1

try_dlopenFunction · 0.85

Calls 3

IOErrorFunction · 0.85
IOErrorFromWinErrorFunction · 0.85
ToStringMethod · 0.45

Tested by

no test coverage detected