--- jdk23u-jdk-23.0.1-ga/src/java.base/share/classes/jdk/internal/util/OperatingSystem.java.orig +++ jdk23u-jdk-23.0.1-ga/src/java.base/share/classes/jdk/internal/util/OperatingSystem.java @@ -81,6 +81,10 @@ * The AIX Operating system. */ AIX, + /** + * Operating systems based on Solaris or illumos. + */ + SOLARIS, ; // The current OperatingSystem @@ -119,6 +123,14 @@ } /** + * {@return {@code true} if built for Solaris or illumos operating systems} + */ + @ForceInline + public static boolean isSolaris() { + return PlatformProps.TARGET_OS_IS_SOLARIS; + } + + /** * {@return the current operating system} */ public static OperatingSystem current() { --- jdk23u-jdk-23.0.1-ga/src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template.orig +++ jdk23u-jdk-23.0.1-ga/src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template @@ -39,6 +39,7 @@ static final boolean TARGET_OS_IS_MACOS = "@@OPENJDK_TARGET_OS@@" == "macos"; static final boolean TARGET_OS_IS_WINDOWS = "@@OPENJDK_TARGET_OS@@" == "windows"; static final boolean TARGET_OS_IS_AIX = "@@OPENJDK_TARGET_OS@@" == "aix"; + static final boolean TARGET_OS_IS_SOLARIS = "@@OPENJDK_TARGET_OS@@" == "solaris"; // The Architecture value for the current architecture static final String CURRENT_ARCH_STRING = "@@OPENJDK_TARGET_CPU@@";