hotspot/src/os/solaris/vm/os_solaris.cpp
changeset 11161 ec855b5a23c2
parent 10739 91935236600e
child 11256 025cd1741566
child 11251 e29da6b5622b
equal deleted inserted replaced
10991:e12451ab43c4 11161:ec855b5a23c2
  6309   }
  6309   }
  6310 }
  6310 }
  6311 
  6311 
  6312 // is_headless_jre()
  6312 // is_headless_jre()
  6313 //
  6313 //
  6314 // Test for the existence of libmawt in motif21 or xawt directories
  6314 // Test for the existence of xawt/libmawt.so or libawt_xawt.so
  6315 // in order to report if we are running in a headless jre
  6315 // in order to report if we are running in a headless jre
       
  6316 //
       
  6317 // Since JDK8 xawt/libmawt.so was moved into the same directory
       
  6318 // as libawt.so, and renamed libawt_xawt.so
  6316 //
  6319 //
  6317 bool os::is_headless_jre() {
  6320 bool os::is_headless_jre() {
  6318     struct stat statbuf;
  6321     struct stat statbuf;
  6319     char buf[MAXPATHLEN];
  6322     char buf[MAXPATHLEN];
  6320     char libmawtpath[MAXPATHLEN];
  6323     char libmawtpath[MAXPATHLEN];
  6321     const char *xawtstr  = "/xawt/libmawt.so";
  6324     const char *xawtstr  = "/xawt/libmawt.so";
  6322     const char *motifstr = "/motif21/libmawt.so";
  6325     const char *new_xawtstr = "/libawt_xawt.so";
  6323     char *p;
  6326     char *p;
  6324 
  6327 
  6325     // Get path to libjvm.so
  6328     // Get path to libjvm.so
  6326     os::jvm_path(buf, sizeof(buf));
  6329     os::jvm_path(buf, sizeof(buf));
  6327 
  6330 
  6338     // check xawt/libmawt.so
  6341     // check xawt/libmawt.so
  6339     strcpy(libmawtpath, buf);
  6342     strcpy(libmawtpath, buf);
  6340     strcat(libmawtpath, xawtstr);
  6343     strcat(libmawtpath, xawtstr);
  6341     if (::stat(libmawtpath, &statbuf) == 0) return false;
  6344     if (::stat(libmawtpath, &statbuf) == 0) return false;
  6342 
  6345 
  6343     // check motif21/libmawt.so
  6346     // check libawt_xawt.so
  6344     strcpy(libmawtpath, buf);
  6347     strcpy(libmawtpath, buf);
  6345     strcat(libmawtpath, motifstr);
  6348     strcat(libmawtpath, new_xawtstr);
  6346     if (::stat(libmawtpath, &statbuf) == 0) return false;
  6349     if (::stat(libmawtpath, &statbuf) == 0) return false;
  6347 
  6350 
  6348     return true;
  6351     return true;
  6349 }
  6352 }
  6350 
  6353