jdk/src/solaris/native/sun/security/pkcs11/j2secmod_md.c
changeset 22597 7515a991bb37
parent 14414 f338be3ef659
child 22964 59c522d83ed9
equal deleted inserted replaced
22596:62542b8be764 22597:7515a991bb37
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    48 JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle
    48 JNIEXPORT jlong JNICALL Java_sun_security_pkcs11_Secmod_nssGetLibraryHandle
    49   (JNIEnv *env, jclass thisClass, jstring jLibName)
    49   (JNIEnv *env, jclass thisClass, jstring jLibName)
    50 {
    50 {
    51     const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL);
    51     const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL);
    52     // look up existing handle only, do not load
    52     // look up existing handle only, do not load
       
    53 #if defined(AIX)
       
    54     void *hModule = dlopen(libName, RTLD_LAZY);
       
    55 #else
    53     void *hModule = dlopen(libName, RTLD_NOLOAD);
    56     void *hModule = dlopen(libName, RTLD_NOLOAD);
       
    57 #endif
    54     dprintf2("-handle for %s: %u\n", libName, hModule);
    58     dprintf2("-handle for %s: %u\n", libName, hModule);
    55     (*env)->ReleaseStringUTFChars(env, jLibName, libName);
    59     (*env)->ReleaseStringUTFChars(env, jLibName, libName);
    56     return ptr_to_jlong(hModule);
    60     return ptr_to_jlong(hModule);
    57 }
    61 }
    58 
    62