We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fe691e commit 3d799c6Copy full SHA for 3d799c6
runtime/j9vm/javanextvmi.cpp
@@ -793,10 +793,23 @@ JVM_GetCDSConfigStatus()
793
#endif /* JAVA_SPEC_VERSION >= 23 */
794
795
#if JAVA_SPEC_VERSION >= 24
796
+/**
797
+ * @brief Determine if the JVM is running inside a container.
798
+ *
799
+ * @return JNI_TRUE if running inside a container; otherwise, JNI_FALSE
800
+ */
801
JNIEXPORT jboolean JNICALL
802
JVM_IsContainerized(void)
803
{
- return JNI_FALSE;
804
+ J9JavaVM *vm = BFUjavaVM;
805
+ jboolean isContainerized = JNI_FALSE;
806
+ if (NULL != vm) {
807
+ OMRPORT_ACCESS_FROM_J9PORT(vm->portLibrary);
808
+ if (omrsysinfo_is_running_in_container()) {
809
+ isContainerized = JNI_TRUE;
810
+ }
811
812
+ return isContainerized;
813
}
814
#endif /* JAVA_SPEC_VERSION >= 24 */
815
0 commit comments