Beispiel #1
0
            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);
            }
Beispiel #2
0
 protected override IntPtr LoadFunction(string functionName)
 {
     return(Libdl.dlsym(NativeHandle, functionName));
 }
Beispiel #3
0
 protected override void FreeLibrary(IntPtr libraryHandle)
 {
     Libdl.dlclose(libraryHandle);
 }