1.1 --- a/src/os/aix/vm/os_aix.cpp Thu Dec 11 18:53:50 2014 -0500 1.2 +++ b/src/os/aix/vm/os_aix.cpp Fri Dec 12 08:48:56 2014 +0100 1.3 @@ -114,12 +114,6 @@ 1.4 } 1.5 #endif 1.6 1.7 -// Excerpts from systemcfg.h definitions newer than AIX 5.3 1.8 -#ifndef PV_7 1.9 -# define PV_7 0x200000 // Power PC 7 1.10 -# define PV_7_Compat 0x208000 // Power PC 7 1.11 -#endif 1.12 - 1.13 #define MAX_PATH (2 * K) 1.14 1.15 // for timer info max values which include all bits 1.16 @@ -130,17 +124,40 @@ 1.17 #define ERROR_MP_VMGETINFO_FAILED 102 1.18 #define ERROR_MP_VMGETINFO_CLAIMS_NO_SUPPORT_FOR_64K 103 1.19 1.20 -// the semantics in this file are thus that codeptr_t is a *real code ptr* 1.21 +// The semantics in this file are thus that codeptr_t is a *real code ptr*. 1.22 // This means that any function taking codeptr_t as arguments will assume 1.23 // a real codeptr and won't handle function descriptors (eg getFuncName), 1.24 // whereas functions taking address as args will deal with function 1.25 -// descriptors (eg os::dll_address_to_library_name) 1.26 +// descriptors (eg os::dll_address_to_library_name). 1.27 typedef unsigned int* codeptr_t; 1.28 1.29 -// typedefs for stackslots, stack pointers, pointers to op codes 1.30 +// Typedefs for stackslots, stack pointers, pointers to op codes. 1.31 typedef unsigned long stackslot_t; 1.32 typedef stackslot_t* stackptr_t; 1.33 1.34 +// Excerpts from systemcfg.h definitions newer than AIX 5.3. 1.35 +#ifndef PV_7 1.36 +#define PV_7 0x200000 /* Power PC 7 */ 1.37 +#define PV_7_Compat 0x208000 /* Power PC 7 */ 1.38 +#endif 1.39 +#ifndef PV_8 1.40 +#define PV_8 0x300000 /* Power PC 8 */ 1.41 +#define PV_8_Compat 0x308000 /* Power PC 8 */ 1.42 +#endif 1.43 + 1.44 +#define trcVerbose(fmt, ...) { /* PPC port */ \ 1.45 + if (Verbose) { \ 1.46 + fprintf(stderr, fmt, ##__VA_ARGS__); \ 1.47 + fputc('\n', stderr); fflush(stderr); \ 1.48 + } \ 1.49 +} 1.50 +#define trc(fmt, ...) /* PPC port */ 1.51 + 1.52 +#define ERRBYE(s) { \ 1.53 + trcVerbose(s); \ 1.54 + return -1; \ 1.55 +} 1.56 + 1.57 // query dimensions of the stack of the calling thread 1.58 static void query_stack_dimensions(address* p_stack_base, size_t* p_stack_size); 1.59 1.60 @@ -172,12 +189,12 @@ 1.61 return true; 1.62 } 1.63 1.64 -// macro to check a given stack pointer against given stack limits and to die if test fails 1.65 +// Macro to check a given stack pointer against given stack limits and to die if test fails. 1.66 #define CHECK_STACK_PTR(sp, stack_base, stack_size) { \ 1.67 guarantee(is_valid_stackpointer((stackptr_t)(sp), (stackptr_t)(stack_base), stack_size), "Stack Pointer Invalid"); \ 1.68 } 1.69 1.70 -// macro to check the current stack pointer against given stacklimits 1.71 +// Macro to check the current stack pointer against given stacklimits. 1.72 #define CHECK_CURRENT_STACK_PTR(stack_base, stack_size) { \ 1.73 address sp; \ 1.74 sp = os::current_stack_pointer(); \ 1.75 @@ -211,7 +228,7 @@ 1.76 static pid_t _initial_pid = 0; 1.77 static int SR_signum = SIGUSR2; // Signal used to suspend/resume a thread (must be > SIGSEGV, see 4355769) 1.78 static sigset_t SR_sigset; 1.79 -static pthread_mutex_t dl_mutex; // Used to protect dlsym() calls */ 1.80 +static pthread_mutex_t dl_mutex; // Used to protect dlsym() calls. 1.81 1.82 julong os::available_memory() { 1.83 return Aix::available_memory(); 1.84 @@ -243,7 +260,6 @@ 1.85 return false; 1.86 } 1.87 1.88 - 1.89 // Return true if user is running as root. 1.90 1.91 bool os::have_special_privileges() { 1.92 @@ -274,8 +290,7 @@ 1.93 1.94 for (int i = 0; i < numFullDisclaimsNeeded; i ++) { 1.95 if (::disclaim(p, maxDisclaimSize, DISCLAIM_ZEROMEM) != 0) { 1.96 - //if (Verbose) 1.97 - fprintf(stderr, "Cannot disclaim %p - %p (errno %d)\n", p, p + maxDisclaimSize, errno); 1.98 + trc("Cannot disclaim %p - %p (errno %d)\n", p, p + maxDisclaimSize, errno); 1.99 return false; 1.100 } 1.101 p += maxDisclaimSize; 1.102 @@ -283,8 +298,7 @@ 1.103 1.104 if (lastDisclaimSize > 0) { 1.105 if (::disclaim(p, lastDisclaimSize, DISCLAIM_ZEROMEM) != 0) { 1.106 - //if (Verbose) 1.107 - fprintf(stderr, "Cannot disclaim %p - %p (errno %d)\n", p, p + lastDisclaimSize, errno); 1.108 + trc("Cannot disclaim %p - %p (errno %d)\n", p, p + lastDisclaimSize, errno); 1.109 return false; 1.110 } 1.111 } 1.112 @@ -324,11 +338,11 @@ 1.113 1.114 void os::Aix::initialize_system_info() { 1.115 1.116 - // get the number of online(logical) cpus instead of configured 1.117 + // Get the number of online(logical) cpus instead of configured. 1.118 os::_processor_count = sysconf(_SC_NPROCESSORS_ONLN); 1.119 assert(_processor_count > 0, "_processor_count must be > 0"); 1.120 1.121 - // retrieve total physical storage 1.122 + // Retrieve total physical storage. 1.123 os::Aix::meminfo_t mi; 1.124 if (!os::Aix::get_meminfo(&mi)) { 1.125 fprintf(stderr, "os::Aix::get_meminfo failed.\n"); fflush(stderr); 1.126 @@ -503,7 +517,6 @@ 1.127 1.128 } // end os::Aix::query_multipage_support() 1.129 1.130 -// The code for this method was initially derived from the version in os_linux.cpp. 1.131 void os::init_system_properties_values() { 1.132 1.133 #define DEFAULT_LIBPATH "/usr/lib:/lib" 1.134 @@ -600,10 +613,11 @@ 1.135 sigaction(sig, (struct sigaction*)NULL, &oact); 1.136 void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction) 1.137 : CAST_FROM_FN_PTR(void*, oact.sa_handler); 1.138 - if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) 1.139 + if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) { 1.140 return true; 1.141 - else 1.142 + } else { 1.143 return false; 1.144 + } 1.145 } 1.146 1.147 void os::Aix::signal_sets_init() { 1.148 @@ -777,6 +791,9 @@ 1.149 1.150 // get the processor version from _system_configuration 1.151 switch (_system_configuration.version) { 1.152 + case PV_8: 1.153 + strcpy(pci->version, "Power PC 8"); 1.154 + break; 1.155 case PV_7: 1.156 strcpy(pci->version, "Power PC 7"); 1.157 break; 1.158 @@ -804,6 +821,9 @@ 1.159 case PV_7_Compat: 1.160 strcpy(pci->version, "PV_7_Compat"); 1.161 break; 1.162 + case PV_8_Compat: 1.163 + strcpy(pci->version, "PV_8_Compat"); 1.164 + break; 1.165 default: 1.166 strcpy(pci->version, "unknown"); 1.167 } 1.168 @@ -939,7 +959,9 @@ 1.169 1.170 pthread_attr_destroy(&attr); 1.171 1.172 - if (ret != 0) { 1.173 + if (ret == 0) { 1.174 + // PPC port traceOsMisc(("Created New Thread : pthread-id %u", tid)); 1.175 + } else { 1.176 if (PrintMiscellaneous && (Verbose || WizardMode)) { 1.177 perror("pthread_create()"); 1.178 } 1.179 @@ -1096,8 +1118,7 @@ 1.180 if (os::Aix::on_pase()) { 1.181 Unimplemented(); 1.182 return 0; 1.183 - } 1.184 - else { 1.185 + } else { 1.186 // On AIX use the precision of processors real time clock 1.187 // or time base registers. 1.188 timebasestruct_t time; 1.189 @@ -1150,7 +1171,6 @@ 1.190 } 1.191 } 1.192 1.193 - 1.194 char * os::local_time_string(char *buf, size_t buflen) { 1.195 struct tm t; 1.196 time_t long_time; 1.197 @@ -1188,7 +1208,6 @@ 1.198 if (abort_hook != NULL) { 1.199 abort_hook(); 1.200 } 1.201 - 1.202 } 1.203 1.204 // Note: os::abort() might be called very early during initialization, or 1.205 @@ -1220,8 +1239,7 @@ 1.206 // from src/solaris/hpi/src/system_md.c 1.207 1.208 size_t os::lasterror(char *buf, size_t len) { 1.209 - 1.210 - if (errno == 0) return 0; 1.211 + if (errno == 0) return 0; 1.212 1.213 const char *s = ::strerror(errno); 1.214 size_t n = ::strlen(s); 1.215 @@ -1234,6 +1252,7 @@ 1.216 } 1.217 1.218 intx os::current_thread_id() { return (intx)pthread_self(); } 1.219 + 1.220 int os::current_process_id() { 1.221 1.222 // This implementation returns a unique pid, the pid of the 1.223 @@ -1370,9 +1389,9 @@ 1.224 if (offset) { 1.225 *offset = -1; 1.226 } 1.227 - if (buf) { 1.228 - buf[0] = '\0'; 1.229 - } 1.230 + // Buf is not optional, but offset is optional. 1.231 + assert(buf != NULL, "sanity check"); 1.232 + buf[0] = '\0'; 1.233 1.234 // Resolve function ptr literals first. 1.235 addr = resolve_function_descriptor_to_code_pointer(addr); 1.236 @@ -1405,12 +1424,9 @@ 1.237 return 0; 1.238 } 1.239 1.240 - if (Verbose) { 1.241 - fprintf(stderr, "pc outside any module"); 1.242 - } 1.243 + trcVerbose("pc outside any module"); 1.244 1.245 return -1; 1.246 - 1.247 } 1.248 1.249 bool os::dll_address_to_library_name(address addr, char* buf, 1.250 @@ -1418,9 +1434,9 @@ 1.251 if (offset) { 1.252 *offset = -1; 1.253 } 1.254 - if (buf) { 1.255 - buf[0] = '\0'; 1.256 - } 1.257 + // Buf is not optional, but offset is optional. 1.258 + assert(buf != NULL, "sanity check"); 1.259 + buf[0] = '\0'; 1.260 1.261 // Resolve function ptr literals first. 1.262 addr = resolve_function_descriptor_to_code_pointer(addr); 1.263 @@ -1435,7 +1451,7 @@ 1.264 } 1.265 1.266 // Loads .dll/.so and in case of error it checks if .dll/.so was built 1.267 -// for the same architecture as Hotspot is running on 1.268 +// for the same architecture as Hotspot is running on. 1.269 void *os::dll_load(const char *filename, char *ebuf, int ebuflen) { 1.270 1.271 if (ebuf && ebuflen > 0) { 1.272 @@ -1598,7 +1614,6 @@ 1.273 st->cr(); 1.274 } 1.275 1.276 - 1.277 static void print_signal_handler(outputStream* st, int sig, 1.278 char* buf, size_t buflen); 1.279 1.280 @@ -1622,7 +1637,7 @@ 1.281 1.282 static char saved_jvm_path[MAXPATHLEN] = {0}; 1.283 1.284 -// Find the full path to the current module, libjvm.so or libjvm_g.so 1.285 +// Find the full path to the current module, libjvm.so. 1.286 void os::jvm_path(char *buf, jint buflen) { 1.287 // Error checking. 1.288 if (buflen < MAXPATHLEN) { 1.289 @@ -1692,7 +1707,7 @@ 1.290 // Do not block out synchronous signals in the signal handler. 1.291 // Blocking synchronous signals only makes sense if you can really 1.292 // be sure that those signals won't happen during signal handling, 1.293 - // when the blocking applies. Normal signal handlers are lean and 1.294 + // when the blocking applies. Normal signal handlers are lean and 1.295 // do not cause signals. But our signal handlers tend to be "risky" 1.296 // - secondary SIGSEGV, SIGILL, SIGBUS' may and do happen. 1.297 // On AIX, PASE there was a case where a SIGSEGV happened, followed 1.298 @@ -2967,13 +2982,9 @@ 1.299 param.sched_priority = newpri; 1.300 int ret = pthread_setschedparam(thr, policy, ¶m); 1.301 1.302 - if (Verbose) { 1.303 - if (ret == 0) { 1.304 - fprintf(stderr, "changed priority of thread %d to %d\n", (int)thr, newpri); 1.305 - } else { 1.306 - fprintf(stderr, "Could not changed priority for thread %d to %d (error %d, %s)\n", 1.307 - (int)thr, newpri, ret, strerror(ret)); 1.308 - } 1.309 + if (ret != 0) { 1.310 + trcVerbose("Could not change priority for thread %d to %d (error %d, %s)", 1.311 + (int)thr, newpri, ret, strerror(ret)); 1.312 } 1.313 return (ret == 0) ? OS_OK : OS_ERR; 1.314 } 1.315 @@ -3094,7 +3105,6 @@ 1.316 errno = old_errno; 1.317 } 1.318 1.319 - 1.320 static int SR_initialize() { 1.321 struct sigaction act; 1.322 char *s; 1.323 @@ -3337,7 +3347,6 @@ 1.324 JVM_handle_aix_signal(sig, info, uc, true); 1.325 } 1.326 1.327 - 1.328 // This boolean allows users to forward their own non-matching signals 1.329 // to JVM_handle_aix_signal, harmlessly. 1.330 bool os::Aix::signal_handlers_are_installed = false; 1.331 @@ -3531,7 +3540,7 @@ 1.332 set_signal_handler(SIGDANGER, true); 1.333 1.334 if (libjsig_is_loaded) { 1.335 - // Tell libjsig jvm finishes setting signal handlers 1.336 + // Tell libjsig jvm finishes setting signal handlers. 1.337 (*end_signal_setting)(); 1.338 } 1.339 1.340 @@ -3547,7 +3556,7 @@ 1.341 tty->print_cr("Info: AllowUserSignalHandlers is activated, all active signal checking is disabled"); 1.342 check_signals = false; 1.343 } 1.344 - // need to initialize check_signal_done 1.345 + // Need to initialize check_signal_done. 1.346 ::sigemptyset(&check_signal_done); 1.347 } 1.348 } 1.349 @@ -3621,7 +3630,6 @@ 1.350 st->cr(); 1.351 } 1.352 1.353 - 1.354 #define DO_SIGNAL_CHECK(sig) \ 1.355 if (!sigismember(&check_signal_done, sig)) \ 1.356 os::Aix::check_signal_handler(sig) 1.357 @@ -3682,7 +3690,6 @@ 1.358 ? CAST_FROM_FN_PTR(address, act.sa_sigaction) 1.359 : CAST_FROM_FN_PTR(address, act.sa_handler); 1.360 1.361 - 1.362 switch(sig) { 1.363 case SIGSEGV: 1.364 case SIGBUS: 1.365 @@ -3830,15 +3837,13 @@ 1.366 pthread_mutex_init(&dl_mutex, NULL); 1.367 } 1.368 1.369 -// this is called _after_ the global arguments have been parsed 1.370 +// This is called _after_ the global arguments have been parsed. 1.371 jint os::init_2(void) { 1.372 1.373 - if (Verbose) { 1.374 - fprintf(stderr, "processor count: %d\n", os::_processor_count); 1.375 - fprintf(stderr, "physical memory: %lu\n", Aix::_physical_memory); 1.376 - } 1.377 - 1.378 - // initially build up the loaded dll map 1.379 + trcVerbose("processor count: %d", os::_processor_count); 1.380 + trcVerbose("physical memory: %lu", Aix::_physical_memory); 1.381 + 1.382 + // Initially build up the loaded dll map. 1.383 LoadedLibraries::reload(); 1.384 1.385 const int page_size = Aix::page_size(); 1.386 @@ -3888,7 +3893,7 @@ 1.387 } 1.388 1.389 if (map_address != (address) MAP_FAILED) { 1.390 - // map succeeded, but polling_page is not at wished address, unmap and continue. 1.391 + // Map succeeded, but polling_page is not at wished address, unmap and continue. 1.392 ::munmap(map_address, map_size); 1.393 map_address = (address) MAP_FAILED; 1.394 } 1.395 @@ -3942,7 +3947,7 @@ 1.396 1.397 // Make the stack size a multiple of the page size so that 1.398 // the yellow/red zones can be guarded. 1.399 - // note that this can be 0, if no default stacksize was set 1.400 + // Note that this can be 0, if no default stacksize was set. 1.401 JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes, vm_page_size())); 1.402 1.403 Aix::libpthread_init(); 1.404 @@ -4255,7 +4260,6 @@ 1.405 return fd; 1.406 } 1.407 1.408 - 1.409 // create binary file, rewriting existing file if required 1.410 int os::create_binary_file(const char* path, bool rewrite_existing) { 1.411 int oflags = O_WRONLY | O_CREAT; 1.412 @@ -4324,7 +4328,6 @@ 1.413 return NULL; 1.414 } 1.415 1.416 - 1.417 // Remap a block of memory. 1.418 char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset, 1.419 char *addr, size_t bytes, bool read_only, 1.420 @@ -4372,14 +4375,14 @@ 1.421 jlong sys_time = 0; 1.422 jlong user_time = 0; 1.423 1.424 - // reimplemented using getthrds64(). 1.425 + // Reimplemented using getthrds64(). 1.426 // 1.427 - // goes like this: 1.428 + // Works like this: 1.429 // For the thread in question, get the kernel thread id. Then get the 1.430 // kernel thread statistics using that id. 1.431 // 1.432 // This only works of course when no pthread scheduling is used, 1.433 - // ie there is a 1:1 relationship to kernel threads. 1.434 + // i.e. there is a 1:1 relationship to kernel threads. 1.435 // On AIX, see AIXTHREAD_SCOPE variable. 1.436 1.437 pthread_t pthtid = thread->osthread()->pthread_id(); 1.438 @@ -4526,14 +4529,12 @@ 1.439 memset(&uts, 0, sizeof(uts)); 1.440 strcpy(uts.sysname, "?"); 1.441 if (::uname(&uts) == -1) { 1.442 - fprintf(stderr, "uname failed (%d)\n", errno); 1.443 + trc("uname failed (%d)", errno); 1.444 guarantee(0, "Could not determine whether we run on AIX or PASE"); 1.445 } else { 1.446 - if (Verbose) { 1.447 - fprintf(stderr,"uname says: sysname \"%s\" version \"%s\" release \"%s\" " 1.448 - "node \"%s\" machine \"%s\"\n", 1.449 - uts.sysname, uts.version, uts.release, uts.nodename, uts.machine); 1.450 - } 1.451 + trcVerbose("uname says: sysname \"%s\" version \"%s\" release \"%s\" " 1.452 + "node \"%s\" machine \"%s\"\n", 1.453 + uts.sysname, uts.version, uts.release, uts.nodename, uts.machine); 1.454 const int major = atoi(uts.version); 1.455 assert(major > 0, "invalid OS version"); 1.456 const int minor = atoi(uts.release); 1.457 @@ -4545,12 +4546,10 @@ 1.458 // We run on AIX. We do not support versions older than AIX 5.3. 1.459 _on_pase = 0; 1.460 if (_os_version < 0x0503) { 1.461 - fprintf(stderr, "AIX release older than AIX 5.3 not supported.\n"); 1.462 + trc("AIX release older than AIX 5.3 not supported."); 1.463 assert(false, "AIX release too old."); 1.464 } else { 1.465 - if (Verbose) { 1.466 - fprintf(stderr, "We run on AIX %d.%d\n", major, minor); 1.467 - } 1.468 + trcVerbose("We run on AIX %d.%d\n", major, minor); 1.469 } 1.470 } else { 1.471 assert(false, "unknown OS"); 1.472 @@ -4558,7 +4557,6 @@ 1.473 } 1.474 1.475 guarantee(_on_pase != -1 && _os_version, "Could not determine AIX/OS400 release"); 1.476 - 1.477 } // end: os::Aix::initialize_os_info() 1.478 1.479 // Scan environment for important settings which might effect the VM. 1.480 @@ -4596,12 +4594,10 @@ 1.481 // Note: Setting XPG_SUS_ENV in the process is too late. Must be set earlier (before 1.482 // exec() ? before loading the libjvm ? ....) 1.483 p = ::getenv("XPG_SUS_ENV"); 1.484 - if (Verbose) { 1.485 - fprintf(stderr, "XPG_SUS_ENV=%s.\n", p ? p : "<unset>"); 1.486 - } 1.487 + trcVerbose("XPG_SUS_ENV=%s.", p ? p : "<unset>"); 1.488 if (p && strcmp(p, "ON") == 0) { 1.489 _xpg_sus_mode = 1; 1.490 - fprintf(stderr, "Unsupported setting: XPG_SUS_ENV=ON\n"); 1.491 + trc("Unsupported setting: XPG_SUS_ENV=ON"); 1.492 // This is not supported. Worst of all, it changes behaviour of mmap MAP_FIXED to 1.493 // clobber address ranges. If we ever want to support that, we have to do some 1.494 // testing first. 1.495 @@ -4613,10 +4609,7 @@ 1.496 // Switch off AIX internal (pthread) guard pages. This has 1.497 // immediate effect for any pthread_create calls which follow. 1.498 p = ::getenv("AIXTHREAD_GUARDPAGES"); 1.499 - if (Verbose) { 1.500 - fprintf(stderr, "AIXTHREAD_GUARDPAGES=%s.\n", p ? p : "<unset>"); 1.501 - fprintf(stderr, "setting AIXTHREAD_GUARDPAGES=0.\n"); 1.502 - } 1.503 + trcVerbose("AIXTHREAD_GUARDPAGES=%s.", p ? p : "<unset>"); 1.504 rc = ::putenv("AIXTHREAD_GUARDPAGES=0"); 1.505 guarantee(rc == 0, ""); 1.506 1.507 @@ -4634,7 +4627,7 @@ 1.508 assert(os::Aix::on_aix(), "AIX only"); 1.509 1.510 if (!libperfstat::init()) { 1.511 - fprintf(stderr, "libperfstat initialization failed.\n"); 1.512 + trc("libperfstat initialization failed."); 1.513 assert(false, "libperfstat initialization failed"); 1.514 } else { 1.515 if (Verbose) { 1.516 @@ -4806,7 +4799,6 @@ 1.517 return abstime; 1.518 } 1.519 1.520 - 1.521 // Test-and-clear _Event, always leaves _Event set to 0, returns immediately. 1.522 // Conceptually TryPark() should be equivalent to park(0). 1.523 1.524 @@ -4889,7 +4881,7 @@ 1.525 while (_Event < 0) { 1.526 status = pthread_cond_timedwait(_cond, _mutex, &abst); 1.527 assert_status(status == 0 || status == ETIMEDOUT, 1.528 - status, "cond_timedwait"); 1.529 + status, "cond_timedwait"); 1.530 if (!FilterSpuriousWakeups) break; // previous semantics 1.531 if (status == ETIMEDOUT) break; 1.532 // We consume and ignore EINTR and spurious wakeups. 1.533 @@ -5023,9 +5015,9 @@ 1.534 // Optional fast-path check: 1.535 // Return immediately if a permit is available. 1.536 if (_counter > 0) { 1.537 - _counter = 0; 1.538 - OrderAccess::fence(); 1.539 - return; 1.540 + _counter = 0; 1.541 + OrderAccess::fence(); 1.542 + return; 1.543 } 1.544 1.545 Thread* thread = Thread::current(); 1.546 @@ -5047,7 +5039,6 @@ 1.547 unpackTime(&absTime, isAbsolute, time); 1.548 } 1.549 1.550 - 1.551 // Enter safepoint region 1.552 // Beware of deadlocks such as 6317397. 1.553 // The per-thread Parker:: mutex is a classic leaf-lock. 1.554 @@ -5135,7 +5126,6 @@ 1.555 } 1.556 } 1.557 1.558 - 1.559 extern char** environ; 1.560 1.561 // Run the specified command in a separate process. Return its exit value, 1.562 @@ -5154,44 +5144,43 @@ 1.563 } else if (pid == 0) { 1.564 // child process 1.565 1.566 - // try to be consistent with system(), which uses "/usr/bin/sh" on AIX 1.567 + // Try to be consistent with system(), which uses "/usr/bin/sh" on AIX. 1.568 execve("/usr/bin/sh", argv, environ); 1.569 1.570 // execve failed 1.571 _exit(-1); 1.572 1.573 - } else { 1.574 + } else { 1.575 // copied from J2SE ..._waitForProcessExit() in UNIXProcess_md.c; we don't 1.576 // care about the actual exit code, for now. 1.577 1.578 int status; 1.579 1.580 - // Wait for the child process to exit. This returns immediately if 1.581 + // Wait for the child process to exit. This returns immediately if 1.582 // the child has already exited. */ 1.583 while (waitpid(pid, &status, 0) < 0) { 1.584 - switch (errno) { 1.585 + switch (errno) { 1.586 case ECHILD: return 0; 1.587 case EINTR: break; 1.588 default: return -1; 1.589 - } 1.590 + } 1.591 } 1.592 1.593 if (WIFEXITED(status)) { 1.594 - // The child exited normally; get its exit code. 1.595 - return WEXITSTATUS(status); 1.596 + // The child exited normally; get its exit code. 1.597 + return WEXITSTATUS(status); 1.598 } else if (WIFSIGNALED(status)) { 1.599 - // The child exited because of a signal 1.600 - // The best value to return is 0x80 + signal number, 1.601 - // because that is what all Unix shells do, and because 1.602 - // it allows callers to distinguish between process exit and 1.603 - // process death by signal. 1.604 - return 0x80 + WTERMSIG(status); 1.605 + // The child exited because of a signal. 1.606 + // The best value to return is 0x80 + signal number, 1.607 + // because that is what all Unix shells do, and because 1.608 + // it allows callers to distinguish between process exit and 1.609 + // process death by signal. 1.610 + return 0x80 + WTERMSIG(status); 1.611 } else { 1.612 - // Unknown exit code; pass it through 1.613 - return status; 1.614 + // Unknown exit code; pass it through. 1.615 + return status; 1.616 } 1.617 } 1.618 - // Remove warning. 1.619 return -1; 1.620 } 1.621 1.622 @@ -5206,7 +5195,7 @@ 1.623 struct stat statbuf; 1.624 char buf[MAXPATHLEN]; 1.625 char libmawtpath[MAXPATHLEN]; 1.626 - const char *xawtstr = "/xawt/libmawt.so"; 1.627 + const char *xawtstr = "/xawt/libmawt.so"; 1.628 const char *new_xawtstr = "/libawt_xawt.so"; 1.629 1.630 char *p;