hotspot/src/os/posix/vm/os_posix.cpp
changeset 24424 2658d7834c6e
parent 22894 870fbe165d06
child 25946 1572c9f03fb9
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
    34 #include <sys/resource.h>
    34 #include <sys/resource.h>
    35 #include <sys/utsname.h>
    35 #include <sys/utsname.h>
    36 #include <pthread.h>
    36 #include <pthread.h>
    37 #include <signal.h>
    37 #include <signal.h>
    38 
    38 
       
    39 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
       
    40 
    39 // Todo: provide a os::get_max_process_id() or similar. Number of processes
    41 // Todo: provide a os::get_max_process_id() or similar. Number of processes
    40 // may have been configured, can be read more accurately from proc fs etc.
    42 // may have been configured, can be read more accurately from proc fs etc.
    41 #ifndef MAX_PID
    43 #ifndef MAX_PID
    42 #define MAX_PID INT_MAX
    44 #define MAX_PID INT_MAX
    43 #endif
    45 #endif
   190 void os::Posix::print_uname_info(outputStream* st) {
   192 void os::Posix::print_uname_info(outputStream* st) {
   191   // kernel
   193   // kernel
   192   st->print("uname:");
   194   st->print("uname:");
   193   struct utsname name;
   195   struct utsname name;
   194   uname(&name);
   196   uname(&name);
   195   st->print(name.sysname); st->print(" ");
   197   st->print("%s ", name.sysname);
   196   st->print(name.release); st->print(" ");
   198   st->print("%s ", name.release);
   197   st->print(name.version); st->print(" ");
   199   st->print("%s ", name.version);
   198   st->print(name.machine);
   200   st->print("%s", name.machine);
   199   st->cr();
   201   st->cr();
   200 }
   202 }
   201 
   203 
   202 bool os::has_allocatable_memory_limit(julong* limit) {
   204 bool os::has_allocatable_memory_limit(julong* limit) {
   203   struct rlimit rlim;
   205   struct rlimit rlim;
   680 
   682 
   681 // Prints one-line description of a signal set.
   683 // Prints one-line description of a signal set.
   682 void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
   684 void os::Posix::print_signal_set_short(outputStream* st, const sigset_t* set) {
   683   char buf[NUM_IMPORTANT_SIGS + 1];
   685   char buf[NUM_IMPORTANT_SIGS + 1];
   684   os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
   686   os::Posix::describe_signal_set_short(set, buf, sizeof(buf));
   685   st->print(buf);
   687   st->print("%s", buf);
   686 }
   688 }
   687 
   689 
   688 // Writes one-line description of a combination of sigaction.sa_flags into a user
   690 // Writes one-line description of a combination of sigaction.sa_flags into a user
   689 // provided buffer. Returns that buffer.
   691 // provided buffer. Returns that buffer.
   690 const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) {
   692 const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) {
   740 
   742 
   741 // Prints one-line description of a combination of sigaction.sa_flags.
   743 // Prints one-line description of a combination of sigaction.sa_flags.
   742 void os::Posix::print_sa_flags(outputStream* st, int flags) {
   744 void os::Posix::print_sa_flags(outputStream* st, int flags) {
   743   char buffer[0x100];
   745   char buffer[0x100];
   744   os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
   746   os::Posix::describe_sa_flags(flags, buffer, sizeof(buffer));
   745   st->print(buffer);
   747   st->print("%s", buffer);
   746 }
   748 }
   747 
   749 
   748 // Helper function for os::Posix::print_siginfo_...():
   750 // Helper function for os::Posix::print_siginfo_...():
   749 // return a textual description for signal code.
   751 // return a textual description for signal code.
   750 struct enum_sigcode_desc_t {
   752 struct enum_sigcode_desc_t {