< prev index next >

src/os/linux/vm/os_linux.cpp

Print this page
rev 9462 : 8143291: Remove redundant coding around os::exception_name
Reviewed-By: dholmes


4568       tty->print_cr("Running in non-interactive shell, %s handler is replaced by shell",
4569                     exception_name(sig, buf, O_BUFLEN));
4570     }
4571   } else if(os::Linux::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Linux::get_our_sigflags(sig)) {
4572     tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
4573     tty->print("expected:" PTR32_FORMAT, os::Linux::get_our_sigflags(sig));
4574     tty->print_cr("  found:" PTR32_FORMAT, act.sa_flags);
4575     // No need to check this sig any longer
4576     sigaddset(&check_signal_done, sig);
4577   }
4578 
4579   // Dump all the signal
4580   if (sigismember(&check_signal_done, sig)) {
4581     print_signal_handlers(tty, buf, O_BUFLEN);
4582   }
4583 }
4584 
4585 extern void report_error(char* file_name, int line_no, char* title,
4586                          char* format, ...);
4587 
4588 extern bool signal_name(int signo, char* buf, size_t len);
4589 
4590 const char* os::exception_name(int exception_code, char* buf, size_t size) {
4591   if (0 < exception_code && exception_code <= SIGRTMAX) {
4592     // signal
4593     if (!signal_name(exception_code, buf, size)) {
4594       jio_snprintf(buf, size, "SIG%d", exception_code);
4595     }
4596     return buf;
4597   } else {
4598     return NULL;
4599   }
4600 }
4601 
4602 // this is called _before_ the most of global arguments have been parsed
4603 void os::init(void) {
4604   char dummy;   // used to get a guess on initial stack address
4605 //  first_hrtime = gethrtime();
4606 
4607   clock_tics_per_sec = sysconf(_SC_CLK_TCK);
4608 
4609   init_random(1234567);
4610 
4611   ThreadCritical::initialize();
4612 
4613   Linux::set_page_size(sysconf(_SC_PAGESIZE));
4614   if (Linux::page_size() == -1) {
4615     fatal("os_linux.cpp: os::init: sysconf failed (%s)",
4616           strerror(errno));
4617   }
4618   init_page_sizes((size_t) Linux::page_size());
4619 
4620   Linux::initialize_system_info();
4621 




4568       tty->print_cr("Running in non-interactive shell, %s handler is replaced by shell",
4569                     exception_name(sig, buf, O_BUFLEN));
4570     }
4571   } else if(os::Linux::get_our_sigflags(sig) != 0 && (int)act.sa_flags != os::Linux::get_our_sigflags(sig)) {
4572     tty->print("Warning: %s handler flags ", exception_name(sig, buf, O_BUFLEN));
4573     tty->print("expected:" PTR32_FORMAT, os::Linux::get_our_sigflags(sig));
4574     tty->print_cr("  found:" PTR32_FORMAT, act.sa_flags);
4575     // No need to check this sig any longer
4576     sigaddset(&check_signal_done, sig);
4577   }
4578 
4579   // Dump all the signal
4580   if (sigismember(&check_signal_done, sig)) {
4581     print_signal_handlers(tty, buf, O_BUFLEN);
4582   }
4583 }
4584 
4585 extern void report_error(char* file_name, int line_no, char* title,
4586                          char* format, ...);
4587 














4588 // this is called _before_ the most of global arguments have been parsed
4589 void os::init(void) {
4590   char dummy;   // used to get a guess on initial stack address
4591 //  first_hrtime = gethrtime();
4592 
4593   clock_tics_per_sec = sysconf(_SC_CLK_TCK);
4594 
4595   init_random(1234567);
4596 
4597   ThreadCritical::initialize();
4598 
4599   Linux::set_page_size(sysconf(_SC_PAGESIZE));
4600   if (Linux::page_size() == -1) {
4601     fatal("os_linux.cpp: os::init: sysconf failed (%s)",
4602           strerror(errno));
4603   }
4604   init_page_sizes((size_t) Linux::page_size());
4605 
4606   Linux::initialize_system_info();
4607 


< prev index next >