protected override IntPtr LoadLibrary(string libraryName) { Libdl.dlerror(); IntPtr handle = Libdl.dlopen(libraryName, Libdl.RTLD_NOW); if (handle == IntPtr.Zero && !Path.IsPathRooted(libraryName)) { string localPath = Path.Combine(AppContext.BaseDirectory, libraryName); handle = Libdl.dlopen(localPath, Libdl.RTLD_NOW); } return(handle); }
protected override IntPtr LoadFunction(string functionName) { return(Libdl.dlsym(NativeHandle, functionName)); }
protected override void FreeLibrary(IntPtr libraryHandle) { Libdl.dlclose(libraryHandle); }