Mercurial > hg > truffle
comparison src/os/solaris/vm/os_solaris.cpp @ 1490:f03d0a26bf83
6888954: argument formatting for assert() and friends
Reviewed-by: kvn, twisti, apetrusenko, never, dcubed
author | jcoomes |
---|---|
date | Thu, 22 Apr 2010 13:23:15 -0700 |
parents | a2ea687fdc7c |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1489:cff162798819 | 1490:f03d0a26bf83 |
---|---|
1565 // maintain the invariant that %g2 always contains the | 1565 // maintain the invariant that %g2 always contains the |
1566 // JavaThread in Java code, and have stubs simply | 1566 // JavaThread in Java code, and have stubs simply |
1567 // treat %g2 as a caller-save register, preserving it in a %lN. | 1567 // treat %g2 as a caller-save register, preserving it in a %lN. |
1568 thread_key_t tk; | 1568 thread_key_t tk; |
1569 if (thr_keycreate( &tk, NULL ) ) | 1569 if (thr_keycreate( &tk, NULL ) ) |
1570 fatal1("os::allocate_thread_local_storage: thr_keycreate failed (%s)", strerror(errno)); | 1570 fatal(err_msg("os::allocate_thread_local_storage: thr_keycreate failed " |
1571 "(%s)", strerror(errno))); | |
1571 return int(tk); | 1572 return int(tk); |
1572 } | 1573 } |
1573 | 1574 |
1574 void os::free_thread_local_storage(int index) { | 1575 void os::free_thread_local_storage(int index) { |
1575 // %%% don't think we need anything here | 1576 // %%% don't think we need anything here |
1583 // %%% this is used only in threadLocalStorage.cpp | 1584 // %%% this is used only in threadLocalStorage.cpp |
1584 if (thr_setspecific((thread_key_t)index, value)) { | 1585 if (thr_setspecific((thread_key_t)index, value)) { |
1585 if (errno == ENOMEM) { | 1586 if (errno == ENOMEM) { |
1586 vm_exit_out_of_memory(SMALLINT, "thr_setspecific: out of swap space"); | 1587 vm_exit_out_of_memory(SMALLINT, "thr_setspecific: out of swap space"); |
1587 } else { | 1588 } else { |
1588 fatal1("os::thread_local_storage_at_put: thr_setspecific failed (%s)", strerror(errno)); | 1589 fatal(err_msg("os::thread_local_storage_at_put: thr_setspecific failed " |
1590 "(%s)", strerror(errno))); | |
1589 } | 1591 } |
1590 } else { | 1592 } else { |
1591 ThreadLocalStorage::set_thread_in_slot ((Thread *) value) ; | 1593 ThreadLocalStorage::set_thread_in_slot ((Thread *) value) ; |
1592 } | 1594 } |
1593 } | 1595 } |
1736 | 1738 |
1737 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis | 1739 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis |
1738 jlong os::javaTimeMillis() { | 1740 jlong os::javaTimeMillis() { |
1739 timeval t; | 1741 timeval t; |
1740 if (gettimeofday( &t, NULL) == -1) | 1742 if (gettimeofday( &t, NULL) == -1) |
1741 fatal1("os::javaTimeMillis: gettimeofday (%s)", strerror(errno)); | 1743 fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno))); |
1742 return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; | 1744 return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; |
1743 } | 1745 } |
1744 | 1746 |
1745 jlong os::javaTimeNanos() { | 1747 jlong os::javaTimeNanos() { |
1746 return (jlong)getTimeNanos(); | 1748 return (jlong)getTimeNanos(); |
4231 vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal, try -XX:+UseAltSigs."); | 4233 vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal, try -XX:+UseAltSigs."); |
4232 } | 4234 } |
4233 // libjsig also interposes the sigaction() call below and saves the | 4235 // libjsig also interposes the sigaction() call below and saves the |
4234 // old sigaction on it own. | 4236 // old sigaction on it own. |
4235 } else { | 4237 } else { |
4236 fatal2("Encountered unexpected pre-existing sigaction handler %#lx for signal %d.", (long)oldhand, sig); | 4238 fatal(err_msg("Encountered unexpected pre-existing sigaction handler " |
4239 "%#lx for signal %d.", (long)oldhand, sig)); | |
4237 } | 4240 } |
4238 } | 4241 } |
4239 | 4242 |
4240 struct sigaction sigAct; | 4243 struct sigaction sigAct; |
4241 sigfillset(&(sigAct.sa_mask)); | 4244 sigfillset(&(sigAct.sa_mask)); |
4762 | 4765 |
4763 init_random(1234567); | 4766 init_random(1234567); |
4764 | 4767 |
4765 page_size = sysconf(_SC_PAGESIZE); | 4768 page_size = sysconf(_SC_PAGESIZE); |
4766 if (page_size == -1) | 4769 if (page_size == -1) |
4767 fatal1("os_solaris.cpp: os::init: sysconf failed (%s)", strerror(errno)); | 4770 fatal(err_msg("os_solaris.cpp: os::init: sysconf failed (%s)", |
4771 strerror(errno))); | |
4768 init_page_sizes((size_t) page_size); | 4772 init_page_sizes((size_t) page_size); |
4769 | 4773 |
4770 Solaris::initialize_system_info(); | 4774 Solaris::initialize_system_info(); |
4771 | 4775 |
4772 // Initialize misc. symbols as soon as possible, so we can use them | 4776 // Initialize misc. symbols as soon as possible, so we can use them |
4773 // if we need them. | 4777 // if we need them. |
4774 Solaris::misc_sym_init(); | 4778 Solaris::misc_sym_init(); |
4775 | 4779 |
4776 int fd = open("/dev/zero", O_RDWR); | 4780 int fd = open("/dev/zero", O_RDWR); |
4777 if (fd < 0) { | 4781 if (fd < 0) { |
4778 fatal1("os::init: cannot open /dev/zero (%s)", strerror(errno)); | 4782 fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno))); |
4779 } else { | 4783 } else { |
4780 Solaris::set_dev_zero_fd(fd); | 4784 Solaris::set_dev_zero_fd(fd); |
4781 | 4785 |
4782 // Close on exec, child won't inherit. | 4786 // Close on exec, child won't inherit. |
4783 fcntl(fd, F_SETFD, FD_CLOEXEC); | 4787 fcntl(fd, F_SETFD, FD_CLOEXEC); |