--- old/src/os/solaris/vm/os_solaris.cpp 2012-06-26 17:29:44.593061530 -0700 +++ new/src/os/solaris/vm/os_solaris.cpp 2012-06-26 17:29:44.261227539 -0700 @@ -6537,3 +6537,19 @@ INTERRUPTIBLE_RETURN_INT_NORESTART(::bind(fd, him, len),\ os::Solaris::clear_interrupted); } + +// Generate the candidate core paths into the supplied buffer +// Return the number of characters actually generated +int os::get_core_paths(char* buffer, size_t bufferSize) { + static char cwd[O_BUFLEN]; + int n; + + get_current_directory(cwd, sizeof(cwd)); + + n = jio_snprintf(buffer, bufferSize, "%s/core or core.%d", cwd, current_process_id()); + + // Truncate if theoretical string was longer than bufferSize + n = MIN2(n, (int)bufferSize); + + return n; +}