Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/misc/VMSupport.c
38829 views
/*1* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include "jni.h"26#include "jni_util.h"27#include "jlong.h"28#include "jvm.h"29#include "jdk_util.h"3031#include "sun_misc_VMSupport.h"3233typedef jobject (JNICALL *INIT_AGENT_PROPERTIES_FN)(JNIEnv *, jobject);3435static INIT_AGENT_PROPERTIES_FN InitAgentProperties_fp = NULL;3637JNIEXPORT jobject JNICALL38Java_sun_misc_VMSupport_initAgentProperties(JNIEnv *env, jclass cls, jobject props)39{40if (InitAgentProperties_fp == NULL) {41if (!JDK_InitJvmHandle()) {42JNU_ThrowInternalError(env,43"Handle for JVM not found for symbol lookup");44return NULL;45}46InitAgentProperties_fp = (INIT_AGENT_PROPERTIES_FN)47JDK_FindJvmEntry("JVM_InitAgentProperties");48if (InitAgentProperties_fp == NULL) {49JNU_ThrowInternalError(env,50"Mismatched VM version: JVM_InitAgentProperties not found");51return NULL;52}53}54return (*InitAgentProperties_fp)(env, props);55}5657JNIEXPORT jstring JNICALL58Java_sun_misc_VMSupport_getVMTemporaryDirectory(JNIEnv *env, jclass cls)59{60return JVM_GetTemporaryDirectory(env);61}626364