Mercurial > hg > truffle
diff src/share/vm/prims/jvm.cpp @ 17016:3482684330ee
cherry-pick: 8041980: (hotspot) sun/jvmstat/monitor/MonitoredVm/CR6672135.java failing on all platforms
Reviewed-by: mgronlun, kamg
Contributed-by: sla
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 02 Sep 2014 22:19:44 +0200 |
parents | 5c0f2b338874 |
children | 52b4284cb496 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvm.cpp Tue Sep 02 14:47:10 2014 +0200 +++ b/src/share/vm/prims/jvm.cpp Tue Sep 02 22:19:44 2014 +0200 @@ -391,6 +391,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;