private static IntPtr dlopen(string fileName, int flags)
 {
     try
     {
         return(LibDlSo2.dlopen(fileName, flags));
     }
     catch (DllNotFoundException)
     {
         return(LibDl.dlopen(fileName, flags));
     }
 }
Ejemplo n.º 2
0
        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);
        }