aboutsummaryrefslogtreecommitdiff
path: root/src/os/solaris/vm/os_solaris.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/solaris/vm/os_solaris.cpp')
-rw-r--r--src/os/solaris/vm/os_solaris.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/os/solaris/vm/os_solaris.cpp b/src/os/solaris/vm/os_solaris.cpp
index 014176321..f6f816cf3 100644
--- a/src/os/solaris/vm/os_solaris.cpp
+++ b/src/os/solaris/vm/os_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,6 +80,7 @@
// put OS-includes here
# include <dlfcn.h>
# include <errno.h>
+# include <exception>
# include <link.h>
# include <poll.h>
# include <pthread.h>
@@ -282,7 +283,7 @@ Thread* ThreadLocalStorage::get_thread_via_cache_slowly(uintptr_t raw_id,
is_error_reported(),
"sp must be inside of selected thread stack");
- thread->_self_raw_id = raw_id; // mark for quick retrieval
+ thread->set_self_raw_id(raw_id); // mark for quick retrieval
_get_thread_cache[ index ] = thread;
}
return thread;
@@ -1475,6 +1476,13 @@ sigset_t* os::Solaris::allowdebug_blocked_signals() {
return &allowdebug_blocked_sigs;
}
+
+void _handle_uncaught_cxx_exception() {
+ VMError err("An uncaught C++ exception");
+ err.report_and_die();
+}
+
+
// First crack at OS-specific initialization, from inside the new thread.
void os::initialize_thread() {
int r = thr_main() ;
@@ -1564,6 +1572,7 @@ void os::initialize_thread() {
// use the dynamic check for T2 libthread.
os::Solaris::init_thread_fpu_state();
+ std::set_terminate(_handle_uncaught_cxx_exception);
}
@@ -3081,7 +3090,7 @@ char* os::attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
if (addr == NULL) {
jio_snprintf(buf, sizeof(buf), ": %s", strerror(err));
}
- warning("attempt_reserve_memory_at: couldn't reserve %d bytes at "
+ warning("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at "
PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT
"%s", bytes, requested_addr, addr, buf);
}
@@ -5188,7 +5197,7 @@ int os::open(const char *path, int oflag, int mode) {
int o_delete = (oflag & O_DELETE);
oflag = oflag & ~O_DELETE;
- fd = ::open(path, oflag, mode);
+ fd = ::open64(path, oflag, mode);
if (fd == -1) return -1;
//If the open succeeded, the file might still be a directory