summaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/jogamp/common/os/UnixDynamicLinkerImpl.java')
-rw-r--r--src/java/jogamp/common/os/UnixDynamicLinkerImpl.java41
1 files changed, 5 insertions, 36 deletions
diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
index 59be76c..5e8ba9d 100644
--- a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
@@ -27,8 +27,6 @@
*/
package jogamp.common.os;
-import com.jogamp.common.util.SecurityUtil;
-
/* pp */ abstract class UnixDynamicLinkerImpl extends DynamicLinkerImpl {
//
@@ -49,46 +47,17 @@ import com.jogamp.common.util.SecurityUtil;
/** Interface to C language function: <br> <code> void * dlsym(void * , const char * ); </code> */
protected static native long dlsym(long arg0, java.lang.String arg1);
- protected final long openLibraryImpl(final String pathname, final int dlSymFlags, final boolean debug) throws SecurityException {
- SecurityUtil.checkLinkPermission(pathname);
- final long handle = dlopen(pathname, dlSymFlags);
- if( 0 != handle ) {
- incrLibRefCount(handle, pathname);
- } else if ( DEBUG || debug ) {
- System.err.println("dlopen \""+pathname+"\" failed, error: "+dlerror());
- }
- return handle;
- }
-
- protected final long lookupSymbolGlobalImpl(final long dlSymGlobalFlag, final String symbolName) throws SecurityException {
- SecurityUtil.checkAllLinkPermission();
- final long addr = dlsym(dlSymGlobalFlag, symbolName);
- if(DEBUG_LOOKUP) {
- System.err.println("DynamicLinkerImpl.lookupSymbolGlobal("+symbolName+") -> 0x"+Long.toHexString(addr));
- }
- return addr;
- }
-
@Override
- public final long lookupSymbol(final long libraryHandle, final String symbolName) throws IllegalArgumentException {
- if( null == getLibRef( libraryHandle ) ) {
- throw new IllegalArgumentException("Library handle 0x"+Long.toHexString(libraryHandle)+" unknown.");
- }
- final long addr = dlsym(libraryHandle, symbolName);
- if(DEBUG_LOOKUP) {
- System.err.println("DynamicLinkerImpl.lookupSymbol(0x"+Long.toHexString(libraryHandle)+", "+symbolName+") -> 0x"+Long.toHexString(addr));
- }
- return addr;
+ protected final long lookupSymbolLocalImpl(final long libraryHandle, final String symbolName) throws SecurityException {
+ return dlsym(libraryHandle, symbolName);
}
@Override
- public final void closeLibrary(final long libraryHandle) throws IllegalArgumentException {
- if( null == decrLibRefCount( libraryHandle ) ) {
- throw new IllegalArgumentException("Library handle 0x"+Long.toHexString(libraryHandle)+" unknown.");
- }
- dlclose(libraryHandle);
+ protected final void closeLibraryImpl(final long libraryHandle) throws SecurityException {
+ dlclose(libraryHandle);
}
+
@Override
public final String getLastError() {
return dlerror();