diff src/share/vm/prims/jvm.cpp @ 17962:a103c376459a

8041980: (hotspot) sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms Reviewed-by: mgronlun, kamg
author sla
date Mon, 28 Apr 2014 09:27:47 +0200
parents 78bbf4d43a14
children 52b4284cb496 1e657b902392 ce8f6bb717c9
line wrap: on
line diff
--- a/src/share/vm/prims/jvm.cpp	Fri May 30 13:30:07 2014 -0700
+++ b/src/share/vm/prims/jvm.cpp	Mon Apr 28 09:27:47 2014 +0200
@@ -392,6 +392,23 @@
 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 /////////////////////////////////////////////////////////////////////////
 
 extern volatile jint vm_created;