< prev index next >

src/share/vm/runtime/os.hpp

Print this page




 539   // that support such things.  This calls shutdown() and then aborts.
 540   static void abort(bool dump_core = true);
 541 
 542   // Die immediately, no exit hook, no abort hook, no cleanup.
 543   static void die();
 544 
 545   // File i/o operations
 546   static const int default_file_open_flags();
 547   static int open(const char *path, int oflag, int mode);
 548   static FILE* open(int fd, const char* mode);
 549   static int close(int fd);
 550   static jlong lseek(int fd, jlong offset, int whence);
 551   static char* native_path(char *path);
 552   static int ftruncate(int fd, jlong length);
 553   static int fsync(int fd);
 554   static int available(int fd, jlong *bytes);
 555 
 556   //File i/o operations
 557 
 558   static size_t read(int fd, void *buf, unsigned int nBytes);

 559   static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
 560   static size_t write(int fd, const void *buf, unsigned int nBytes);
 561 
 562   // Reading directories.
 563   static DIR*           opendir(const char* dirname);
 564   static struct dirent* readdir(DIR* dirp);
 565   static int            closedir(DIR* dirp);
 566 
 567   // Dynamic library extension
 568   static const char*    dll_file_extension();
 569 
 570   static const char*    get_temp_directory();
 571   static const char*    get_current_directory(char *buf, size_t buflen);
 572 
 573   // Builds a platform-specific full library path given a ld path and lib name
 574   // Returns true if buffer contains full path to existing file, false otherwise
 575   static bool           dll_build_name(char* buffer, size_t size,
 576                                        const char* pathname, const char* fname);
 577 
 578   // Symbol lookup, find nearest function name; basically it implements


 586   // Locate DLL/DSO. On success, full path of the library is copied to
 587   // buf, and offset is optionally set to be the distance between addr
 588   // and the library's base address. On failure, buf[0] is set to '\0'
 589   // and offset is set to -1 (if offset is non-NULL).
 590   static bool dll_address_to_library_name(address addr, char* buf,
 591                                           int buflen, int* offset);
 592 
 593   // Find out whether the pc is in the static code for jvm.dll/libjvm.so.
 594   static bool address_is_in_vm(address addr);
 595 
 596   // Loads .dll/.so and
 597   // in case of error it checks if .dll/.so was built for the
 598   // same architecture as Hotspot is running on
 599   static void* dll_load(const char *name, char *ebuf, int ebuflen);
 600 
 601   // lookup symbol in a shared library
 602   static void* dll_lookup(void* handle, const char* name);
 603 
 604   // Unload library
 605   static void  dll_unload(void *lib);










 606 
 607   // Return the handle of this process
 608   static void* get_default_process_handle();
 609 
 610   // Check for static linked agent library
 611   static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
 612                                  size_t syms_len);
 613 
 614   // Find agent entry point
 615   static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
 616                                    const char *syms[], size_t syms_len);
 617 
 618   static int vsnprintf(char* buf, size_t len, const char* fmt, va_list args) ATTRIBUTE_PRINTF(3, 0);
 619   static int snprintf(char* buf, size_t len, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
 620 
 621   // Print out system information; they are called by fatal error handler.
 622   // Output format may be different on different platforms.
 623   static void print_os_info(outputStream* st);
 624   static void print_os_info_brief(outputStream* st);
 625   static void print_cpu_info(outputStream* st);




 539   // that support such things.  This calls shutdown() and then aborts.
 540   static void abort(bool dump_core = true);
 541 
 542   // Die immediately, no exit hook, no abort hook, no cleanup.
 543   static void die();
 544 
 545   // File i/o operations
 546   static const int default_file_open_flags();
 547   static int open(const char *path, int oflag, int mode);
 548   static FILE* open(int fd, const char* mode);
 549   static int close(int fd);
 550   static jlong lseek(int fd, jlong offset, int whence);
 551   static char* native_path(char *path);
 552   static int ftruncate(int fd, jlong length);
 553   static int fsync(int fd);
 554   static int available(int fd, jlong *bytes);
 555 
 556   //File i/o operations
 557 
 558   static size_t read(int fd, void *buf, unsigned int nBytes);
 559   static size_t read_at(int fd, void *buf, unsigned int nBytes, jlong offset);
 560   static size_t restartable_read(int fd, void *buf, unsigned int nBytes);
 561   static size_t write(int fd, const void *buf, unsigned int nBytes);
 562 
 563   // Reading directories.
 564   static DIR*           opendir(const char* dirname);
 565   static struct dirent* readdir(DIR* dirp);
 566   static int            closedir(DIR* dirp);
 567 
 568   // Dynamic library extension
 569   static const char*    dll_file_extension();
 570 
 571   static const char*    get_temp_directory();
 572   static const char*    get_current_directory(char *buf, size_t buflen);
 573 
 574   // Builds a platform-specific full library path given a ld path and lib name
 575   // Returns true if buffer contains full path to existing file, false otherwise
 576   static bool           dll_build_name(char* buffer, size_t size,
 577                                        const char* pathname, const char* fname);
 578 
 579   // Symbol lookup, find nearest function name; basically it implements


 587   // Locate DLL/DSO. On success, full path of the library is copied to
 588   // buf, and offset is optionally set to be the distance between addr
 589   // and the library's base address. On failure, buf[0] is set to '\0'
 590   // and offset is set to -1 (if offset is non-NULL).
 591   static bool dll_address_to_library_name(address addr, char* buf,
 592                                           int buflen, int* offset);
 593 
 594   // Find out whether the pc is in the static code for jvm.dll/libjvm.so.
 595   static bool address_is_in_vm(address addr);
 596 
 597   // Loads .dll/.so and
 598   // in case of error it checks if .dll/.so was built for the
 599   // same architecture as Hotspot is running on
 600   static void* dll_load(const char *name, char *ebuf, int ebuflen);
 601 
 602   // lookup symbol in a shared library
 603   static void* dll_lookup(void* handle, const char* name);
 604 
 605   // Unload library
 606   static void  dll_unload(void *lib);
 607 
 608   // Callback for loaded module information
 609   // Input parameters:
 610   //    char*     module_file_name,
 611   //    address   module_base_addr,
 612   //    address   module_top_addr,
 613   //    void*     param
 614   typedef int (*LoadedModulesCallbackFunc)(const char *, address, address, void *);
 615 
 616   static int get_loaded_modules_info(LoadedModulesCallbackFunc callback, void *param);
 617 
 618   // Return the handle of this process
 619   static void* get_default_process_handle();
 620 
 621   // Check for static linked agent library
 622   static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
 623                                  size_t syms_len);
 624 
 625   // Find agent entry point
 626   static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
 627                                    const char *syms[], size_t syms_len);
 628 
 629   static int vsnprintf(char* buf, size_t len, const char* fmt, va_list args) ATTRIBUTE_PRINTF(3, 0);
 630   static int snprintf(char* buf, size_t len, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);
 631 
 632   // Print out system information; they are called by fatal error handler.
 633   // Output format may be different on different platforms.
 634   static void print_os_info(outputStream* st);
 635   static void print_os_info_brief(outputStream* st);
 636   static void print_cpu_info(outputStream* st);


< prev index next >