diff src/share/vm/prims/jvm.cpp @ 18067:1e657b902392

Merge
author asaha
date Tue, 10 Jun 2014 14:52:20 -0700
parents 54bc75c144b0 a103c376459a
children eaf39a954227 8cb56c8cb30d
line wrap: on
line diff
--- a/src/share/vm/prims/jvm.cpp	Mon Jun 09 22:21:12 2014 -0700
+++ b/src/share/vm/prims/jvm.cpp	Tue Jun 10 14:52:20 2014 -0700
@@ -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;