/** * Internal wrapper around dlopen. * * If the library open fails, then this stores the native error in a thread * local variable for later retrieval. * * @param name The name of the library to open * @param flags The flags to pass to dlopen * @return The native handle for the opened library, or 0 if it failed to open. */ private static long dlopen(Foreign foreign, String name, int flags) { try { return foreign.dlopen(name, flags); } catch (UnsatisfiedLinkError ex) { lastError.set(ex.getMessage()); return 0L; } }
/** * Internal wrapper around dlopen. * * If the library open fails, then this stores the native error in a thread * local variable for later retrieval. * * @param name The name of the library to open * @param flags The flags to pass to dlopen * @return The native handle for the opened library, or 0 if it failed to open. */ private static long dlopen(Foreign foreign, String name, int flags) { try { return foreign.dlopen(name, flags); } catch (UnsatisfiedLinkError ex) { lastError.set(ex.getMessage()); return 0L; } }
/** * Internal wrapper around dlopen. * * If the library open fails, then this stores the native error in a thread * local variable for later retrieval. * * @param name The name of the library to open * @param flags The flags to pass to dlopen * @return The native handle for the opened library, or 0 if it failed to open. */ private static long dlopen(Foreign foreign, String name, int flags) { try { return foreign.dlopen(name, flags); } catch (UnsatisfiedLinkError ex) { lastError.set(ex.getMessage()); return 0L; } }