private static IntPtr dlopen(string fileName, int flags) { try { return(LibDlSo2.dlopen(fileName, flags)); } catch (DllNotFoundException) { return(LibDl.dlopen(fileName, flags)); } }
private static IntPtr dlerror() { try { return(LibDlSo2.dlerror()); } catch (DllNotFoundException) { return(LibDl.dlerror()); } }
private static IntPtr dlsym(IntPtr handle, string symbol) { try { return(LibDlSo2.dlsym(handle, symbol)); } catch (DllNotFoundException) { return(LibDl.dlsym(handle, symbol)); } }
private static int dlclose(IntPtr handle) { try { return(LibDlSo2.dlclose(handle)); } catch (DllNotFoundException) { return(LibDl.dlclose(handle)); } }
public static bool IsLibCoreApiAlreadyLoaded() { var handle = LibDlSo2.dlopen(LibCoreApi.LibraryName + ".so", (int)(DlFlags.RTLD_GLOBAL | DlFlags.RTLD_LAZY | DlFlags.RTLD_NOLOAD)); if (handle == IntPtr.Zero) { return(false); } LibDlSo2.dlclose(handle); return(true); }