src/hotspot/os/aix/os_aix.cpp
changeset 57651 ddae2da329ed
parent 57599 98dfaf0f9442
child 57804 9b7b9f16dfd9
equal deleted inserted replaced
57650:8f067351c370 57651:ddae2da329ed
  1311 
  1311 
  1312 // Loads .dll/.so and in case of error it checks if .dll/.so was built
  1312 // Loads .dll/.so and in case of error it checks if .dll/.so was built
  1313 // for the same architecture as Hotspot is running on.
  1313 // for the same architecture as Hotspot is running on.
  1314 void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
  1314 void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
  1315 
  1315 
       
  1316   log_info(os)("attempting shared library load of %s", filename);
       
  1317 
  1316   if (ebuf && ebuflen > 0) {
  1318   if (ebuf && ebuflen > 0) {
  1317     ebuf[0] = '\0';
  1319     ebuf[0] = '\0';
  1318     ebuf[ebuflen - 1] = '\0';
  1320     ebuf[ebuflen - 1] = '\0';
  1319   }
  1321   }
  1320 
  1322 
  1327   void * result= ::dlopen(filename, RTLD_LAZY);
  1329   void * result= ::dlopen(filename, RTLD_LAZY);
  1328   if (result != NULL) {
  1330   if (result != NULL) {
  1329     Events::log(NULL, "Loaded shared library %s", filename);
  1331     Events::log(NULL, "Loaded shared library %s", filename);
  1330     // Reload dll cache. Don't do this in signal handling.
  1332     // Reload dll cache. Don't do this in signal handling.
  1331     LoadedLibraries::reload();
  1333     LoadedLibraries::reload();
       
  1334     log_info(os)("shared library load of %s was successful", filename);
  1332     return result;
  1335     return result;
  1333   } else {
  1336   } else {
  1334     // error analysis when dlopen fails
  1337     // error analysis when dlopen fails
  1335     const char* error_report = ::dlerror();
  1338     const char* error_report = ::dlerror();
  1336     if (error_report == NULL) {
  1339     if (error_report == NULL) {
  1339     if (ebuf != NULL && ebuflen > 0) {
  1342     if (ebuf != NULL && ebuflen > 0) {
  1340       snprintf(ebuf, ebuflen - 1, "%s, LIBPATH=%s, LD_LIBRARY_PATH=%s : %s",
  1343       snprintf(ebuf, ebuflen - 1, "%s, LIBPATH=%s, LD_LIBRARY_PATH=%s : %s",
  1341                filename, ::getenv("LIBPATH"), ::getenv("LD_LIBRARY_PATH"), error_report);
  1344                filename, ::getenv("LIBPATH"), ::getenv("LD_LIBRARY_PATH"), error_report);
  1342     }
  1345     }
  1343     Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
  1346     Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
       
  1347     log_info(os)("shared library load of %s failed, %s", filename, error_report);
  1344   }
  1348   }
  1345   return NULL;
  1349   return NULL;
  1346 }
  1350 }
  1347 
  1351 
  1348 void* os::dll_lookup(void* handle, const char* name) {
  1352 void* os::dll_lookup(void* handle, const char* name) {