< prev index next >

src/share/vm/runtime/os.hpp

Print this page
rev 10311 : 8148425: strerror() function is not thread-safe
Reviewed-by:


 600   // Print out system information; they are called by fatal error handler.
 601   // Output format may be different on different platforms.
 602   static void print_os_info(outputStream* st);
 603   static void print_os_info_brief(outputStream* st);
 604   static void print_cpu_info(outputStream* st, char* buf, size_t buflen);
 605   static void pd_print_cpu_info(outputStream* st, char* buf, size_t buflen);
 606   static void print_summary_info(outputStream* st, char* buf, size_t buflen);
 607   static void print_memory_info(outputStream* st);
 608   static void print_dll_info(outputStream* st);
 609   static void print_environment_variables(outputStream* st, const char** env_list);
 610   static void print_context(outputStream* st, const void* context);
 611   static void print_register_info(outputStream* st, const void* context);
 612   static void print_siginfo(outputStream* st, const void* siginfo);
 613   static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
 614   static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
 615 
 616   static void print_location(outputStream* st, intptr_t x, bool verbose = false);
 617   static size_t lasterror(char *buf, size_t len);
 618   static int get_last_error();
 619 









 620   // Determines whether the calling process is being debugged by a user-mode debugger.
 621   static bool is_debugger_attached();
 622 
 623   // wait for a key press if PauseAtExit is set
 624   static void wait_for_keypress_at_exit(void);
 625 
 626   // The following two functions are used by fatal error handler to trace
 627   // native (C) frames. They are not part of frame.hpp/frame.cpp because
 628   // frame.hpp/cpp assume thread is JavaThread, and also because different
 629   // OS/compiler may have different convention or provide different API to
 630   // walk C frames.
 631   //
 632   // We don't attempt to become a debugger, so we only follow frames if that
 633   // does not require a lookup in the unwind table, which is part of the binary
 634   // file but may be unsafe to read after a fatal error. So on x86, we can
 635   // only walk stack if %ebp is used as frame pointer; on ia64, it's not
 636   // possible to walk C stack without having the unwind table.
 637   static bool is_first_C_frame(frame *fr);
 638   static frame get_sender_for_C_frame(frame *fr);
 639 




 600   // Print out system information; they are called by fatal error handler.
 601   // Output format may be different on different platforms.
 602   static void print_os_info(outputStream* st);
 603   static void print_os_info_brief(outputStream* st);
 604   static void print_cpu_info(outputStream* st, char* buf, size_t buflen);
 605   static void pd_print_cpu_info(outputStream* st, char* buf, size_t buflen);
 606   static void print_summary_info(outputStream* st, char* buf, size_t buflen);
 607   static void print_memory_info(outputStream* st);
 608   static void print_dll_info(outputStream* st);
 609   static void print_environment_variables(outputStream* st, const char** env_list);
 610   static void print_context(outputStream* st, const void* context);
 611   static void print_register_info(outputStream* st, const void* context);
 612   static void print_siginfo(outputStream* st, const void* siginfo);
 613   static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
 614   static void print_date_and_time(outputStream* st, char* buf, size_t buflen);
 615 
 616   static void print_location(outputStream* st, intptr_t x, bool verbose = false);
 617   static size_t lasterror(char *buf, size_t len);
 618   static int get_last_error();
 619 
 620   // Replacement for strerror().
 621   // Will return the literalized version of the errno (e.g. "EINVAL" for EINVAL)
 622   // for short_text = true. Will return the english description of the error
 623   // (e.g. "File not found", as described in the POSIX standard, for
 624   //  short_text = false. Will return "unknown" for unknown errno values,
 625   //  regardless of the value of short_text.
 626   // All returned strings are static constants and always valid.
 627   static const char* strerror(int e, bool short_text = true);
 628 
 629   // Determines whether the calling process is being debugged by a user-mode debugger.
 630   static bool is_debugger_attached();
 631 
 632   // wait for a key press if PauseAtExit is set
 633   static void wait_for_keypress_at_exit(void);
 634 
 635   // The following two functions are used by fatal error handler to trace
 636   // native (C) frames. They are not part of frame.hpp/frame.cpp because
 637   // frame.hpp/cpp assume thread is JavaThread, and also because different
 638   // OS/compiler may have different convention or provide different API to
 639   // walk C frames.
 640   //
 641   // We don't attempt to become a debugger, so we only follow frames if that
 642   // does not require a lookup in the unwind table, which is part of the binary
 643   // file but may be unsafe to read after a fatal error. So on x86, we can
 644   // only walk stack if %ebp is used as frame pointer; on ia64, it's not
 645   // possible to walk C stack without having the unwind table.
 646   static bool is_first_C_frame(frame *fr);
 647   static frame get_sender_for_C_frame(frame *fr);
 648 


< prev index next >