--- jdk8/hotspot/make/linux/makefiles/mapfile-vers-product 2014-06-23 13:56:33.000000000 -0400 +++ jdk8/hotspot/make/linux/makefiles/mapfile-vers-product 2014-07-02 05:11:08.566464756 -0400 @@ -163,6 +163,7 @@ JVM_GetStackTraceElement; JVM_GetSystemPackage; JVM_GetSystemPackages; + JVM_GetTemporaryDirectory; JVM_GetThreadStateNames; JVM_GetThreadStateValues; JVM_GetVersionInfo; --- jdk8/hotspot/make/linux/makefiles/mapfile-vers-debug 2014-06-23 13:56:33.000000000 -0400 +++ jdk8/hotspot/make/linux/makefiles/mapfile-vers-debug 2014-07-02 05:10:54.827654319 -0400 @@ -163,6 +163,7 @@ JVM_GetStackTraceElement; JVM_GetSystemPackage; JVM_GetSystemPackages; + JVM_GetTemporaryDirectory; JVM_GetThreadStateNames; JVM_GetThreadStateValues; JVM_GetVersionInfo; --- jdk8/hotspot/src/share/vm/prims/jvm.cpp 2014-06-23 13:56:33.000000000 -0400 +++ jdk8/hotspot/src/share/vm/prims/jvm.cpp 2014-07-02 05:09:22.335662279 -0400 @@ -391,6 +391,21 @@ return properties; JVM_END +/* + * Return the temporary directory that the VM uses for the attach + * and perf data files. + * + * It is important that this directory is well-known and the + * same for all VM instances. It cannot be affected by configuration + * variables such as java.io.tmpdir. + */ +JVM_ENTRY(jstring, JVM_GetTemporaryDirectory(JNIEnv *env)) + JVMWrapper("JVM_GetTemporaryDirectory"); + HandleMark hm(THREAD); + const char* temp_dir = os::get_temp_directory(); + Handle h = java_lang_String::create_from_platform_dependent_str(temp_dir, CHECK_NULL); + return (jstring) JNIHandles::make_local(env, h()); +JVM_END // java.lang.Runtime ///////////////////////////////////////////////////////////////////////// --- jdk8/hotspot/src/share/vm/prims/jvm.h 2014-06-23 13:56:33.000000000 -0400 +++ jdk8/hotspot/src/share/vm/prims/jvm.h 2014-07-02 05:07:41.524389758 -0400 @@ -1490,6 +1490,9 @@ JNIEXPORT jobject JNICALL JVM_InitAgentProperties(JNIEnv *env, jobject agent_props); +JNIEXPORT jstring JNICALL +JVM_GetTemporaryDirectory(JNIEnv *env); + /* Generics reflection support. * * Returns information about the given class's EnclosingMethod