3745 }
3746 }
3747
3748 if (WIFEXITED(status)) {
3749 // The child exited normally; get its exit code.
3750 return WEXITSTATUS(status);
3751 } else if (WIFSIGNALED(status)) {
3752 // The child exited because of a signal
3753 // The best value to return is 0x80 + signal number,
3754 // because that is what all Unix shells do, and because
3755 // it allows callers to distinguish between process exit and
3756 // process death by signal.
3757 return 0x80 + WTERMSIG(status);
3758 } else {
3759 // Unknown exit code; pass it through
3760 return status;
3761 }
3762 }
3763 }
3764
3765 // Get the default path to the core file
3766 // Returns the length of the string
3767 int os::get_core_path(char* buffer, size_t bufferSize) {
3768 int n = jio_snprintf(buffer, bufferSize, "/cores/core.%d", current_process_id());
3769
3770 // Truncate if theoretical string was longer than bufferSize
3771 n = MIN2(n, (int)bufferSize);
3772
3773 return n;
3774 }
3775
3776 bool os::supports_map_sync() {
3777 return false;
3778 }
3779
3780 #ifndef PRODUCT
3781 void TestReserveMemorySpecial_test() {
3782 // No tests available for this platform
3783 }
3784 #endif
3785
3786 bool os::start_debugging(char *buf, int buflen) {
3787 int len = (int)strlen(buf);
3788 char *p = &buf[len];
3789
|
3745 }
3746 }
3747
3748 if (WIFEXITED(status)) {
3749 // The child exited normally; get its exit code.
3750 return WEXITSTATUS(status);
3751 } else if (WIFSIGNALED(status)) {
3752 // The child exited because of a signal
3753 // The best value to return is 0x80 + signal number,
3754 // because that is what all Unix shells do, and because
3755 // it allows callers to distinguish between process exit and
3756 // process death by signal.
3757 return 0x80 + WTERMSIG(status);
3758 } else {
3759 // Unknown exit code; pass it through
3760 return status;
3761 }
3762 }
3763 }
3764
3765 // Get the kern.corefile setting, or otherwise the default path to the core file
3766 // Returns the length of the string
3767 int os::get_core_path(char* buffer, size_t bufferSize) {
3768 int n = 0;
3769 #ifdef __APPLE__
3770 char coreinfo[MAX_PATH];
3771 size_t sz = sizeof(coreinfo);
3772 int ret = sysctlbyname("kern.corefile", coreinfo, &sz, NULL, 0);
3773 if (ret == 0) {
3774 char *pid_pos = strstr(coreinfo, "%P");
3775 const char* tail = (pid_pos != NULL) ? (pid_pos + 2) : ""; // skip over the "%P"
3776 int mypid = current_process_id();
3777
3778 if (pid_pos != NULL) {
3779 *pid_pos = '\0';
3780 n = jio_snprintf(buffer, bufferSize, "%s%d%s", coreinfo, mypid, tail);
3781 } else {
3782 n = jio_snprintf(buffer, bufferSize, "%s", coreinfo);
3783 }
3784 } else
3785 #endif
3786 {
3787 n = jio_snprintf(buffer, bufferSize, "/cores/core.%d", current_process_id());
3788 }
3789 // Truncate if theoretical string was longer than bufferSize
3790 n = MIN2(n, (int)bufferSize);
3791
3792 return n;
3793 }
3794
3795 bool os::supports_map_sync() {
3796 return false;
3797 }
3798
3799 #ifndef PRODUCT
3800 void TestReserveMemorySpecial_test() {
3801 // No tests available for this platform
3802 }
3803 #endif
3804
3805 bool os::start_debugging(char *buf, int buflen) {
3806 int len = (int)strlen(buf);
3807 char *p = &buf[len];
3808
|