src/share/vm/runtime/os.hpp

Print this page




 476   static address current_stack_pointer();
 477   static address current_stack_base();
 478   static size_t current_stack_size();
 479 
 480   static void verify_stack_alignment() PRODUCT_RETURN;
 481 
 482   static int message_box(const char* title, const char* message);
 483   static char* do_you_want_to_debug(const char* message);
 484 
 485   // run cmd in a separate process and return its exit code; or -1 on failures
 486   static int fork_and_exec(char *cmd);
 487 
 488   // Call ::exit() on all platforms but Windows
 489   static void exit(int num);
 490 
 491   // Terminate the VM, but don't exit the process
 492   static void shutdown();
 493 
 494   // Terminate with an error.  Default is to generate a core file on platforms
 495   // that support such things.  This calls shutdown() and then aborts.
 496   static void abort(bool dump_core = true);
 497 
 498   // Die immediately, no exit hook, no abort hook, no cleanup.
 499   static void die();
 500 
 501   // File i/o operations
 502   static const int default_file_open_flags();
 503   static int open(const char *path, int oflag, int mode);
 504   static FILE* open(int fd, const char* mode);
 505   static int close(int fd);
 506   static jlong lseek(int fd, jlong offset, int whence);
 507   static char* native_path(char *path);
 508   static int ftruncate(int fd, jlong length);
 509   static int fsync(int fd);
 510   static int available(int fd, jlong *bytes);
 511 
 512   //File i/o operations
 513 
 514   static size_t read(int fd, void *buf, unsigned int nBytes);
 515   static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
 516   static size_t restartable_read(int fd, void *buf, unsigned int nBytes);


 701   // Support for signals (see JVM_RaiseSignal, JVM_RegisterSignal)
 702   static void  signal_init();
 703   static void  signal_init_pd();
 704   static void  signal_notify(int signal_number);
 705   static void* signal(int signal_number, void* handler);
 706   static void  signal_raise(int signal_number);
 707   static int   signal_wait();
 708   static int   signal_lookup();
 709   static void* user_handler();
 710   static void  terminate_signal_thread();
 711   static int   sigexitnum_pd();
 712 
 713   // random number generation
 714   static long random();                    // return 32bit pseudorandom number
 715   static void init_random(long initval);   // initialize random sequence
 716 
 717   // Structured OS Exception support
 718   static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
 719 
 720   // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits
 721   static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize);
 722 
 723   // Get the default path to the core file
 724   // Returns the length of the string
 725   static int get_core_path(char* buffer, size_t bufferSize);
 726 
 727   // JVMTI & JVM monitoring and management support
 728   // The thread_cpu_time() and current_thread_cpu_time() are only
 729   // supported if is_thread_cpu_time_supported() returns true.
 730   // They are not supported on Solaris T1.
 731 
 732   // Thread CPU Time - return the fast estimate on a platform
 733   // On Solaris - call gethrvtime (fast) - user time only
 734   // On Linux   - fast clock_gettime where available - user+sys
 735   //            - otherwise: very slow /proc fs - user+sys
 736   // On Windows - GetThreadTimes - user+sys
 737   static jlong current_thread_cpu_time();
 738   static jlong thread_cpu_time(Thread* t);
 739 
 740   // Thread CPU Time with user_sys_cpu_time parameter.
 741   //




 476   static address current_stack_pointer();
 477   static address current_stack_base();
 478   static size_t current_stack_size();
 479 
 480   static void verify_stack_alignment() PRODUCT_RETURN;
 481 
 482   static int message_box(const char* title, const char* message);
 483   static char* do_you_want_to_debug(const char* message);
 484 
 485   // run cmd in a separate process and return its exit code; or -1 on failures
 486   static int fork_and_exec(char *cmd);
 487 
 488   // Call ::exit() on all platforms but Windows
 489   static void exit(int num);
 490 
 491   // Terminate the VM, but don't exit the process
 492   static void shutdown();
 493 
 494   // Terminate with an error.  Default is to generate a core file on platforms
 495   // that support such things.  This calls shutdown() and then aborts.
 496   static void abort(bool dump_core = true, void *siginfo = NULL, void *context = NULL);
 497 
 498   // Die immediately, no exit hook, no abort hook, no cleanup.
 499   static void die();
 500 
 501   // File i/o operations
 502   static const int default_file_open_flags();
 503   static int open(const char *path, int oflag, int mode);
 504   static FILE* open(int fd, const char* mode);
 505   static int close(int fd);
 506   static jlong lseek(int fd, jlong offset, int whence);
 507   static char* native_path(char *path);
 508   static int ftruncate(int fd, jlong length);
 509   static int fsync(int fd);
 510   static int available(int fd, jlong *bytes);
 511 
 512   //File i/o operations
 513 
 514   static size_t read(int fd, void *buf, unsigned int nBytes);
 515   static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
 516   static size_t restartable_read(int fd, void *buf, unsigned int nBytes);


 701   // Support for signals (see JVM_RaiseSignal, JVM_RegisterSignal)
 702   static void  signal_init();
 703   static void  signal_init_pd();
 704   static void  signal_notify(int signal_number);
 705   static void* signal(int signal_number, void* handler);
 706   static void  signal_raise(int signal_number);
 707   static int   signal_wait();
 708   static int   signal_lookup();
 709   static void* user_handler();
 710   static void  terminate_signal_thread();
 711   static int   sigexitnum_pd();
 712 
 713   // random number generation
 714   static long random();                    // return 32bit pseudorandom number
 715   static void init_random(long initval);   // initialize random sequence
 716 
 717   // Structured OS Exception support
 718   static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
 719 
 720   // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits
 721   static void check_create_dump_limit(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize);
 722 
 723   // Get the default path to the core file
 724   // Returns the length of the string
 725   static int get_core_path(char* buffer, size_t bufferSize);
 726 
 727   // JVMTI & JVM monitoring and management support
 728   // The thread_cpu_time() and current_thread_cpu_time() are only
 729   // supported if is_thread_cpu_time_supported() returns true.
 730   // They are not supported on Solaris T1.
 731 
 732   // Thread CPU Time - return the fast estimate on a platform
 733   // On Solaris - call gethrvtime (fast) - user time only
 734   // On Linux   - fast clock_gettime where available - user+sys
 735   //            - otherwise: very slow /proc fs - user+sys
 736   // On Windows - GetThreadTimes - user+sys
 737   static jlong current_thread_cpu_time();
 738   static jlong thread_cpu_time(Thread* t);
 739 
 740   // Thread CPU Time with user_sys_cpu_time parameter.
 741   //