Andreas Wacknitz
2024-01-27 7fe9353e9c385beadc7196f539242540105d1c6f
commit | author | age
3981b6 1 --- a/src/java.base/share/classes/jdk/internal/util/OperatingSystem.java    Wed Mar 29 20:12:02 2023
NP 2 +++ b/src/java.base/share/classes/jdk/internal/util/OperatingSystem.java    Thu Mar 30 13:44:42 2023
7fe935 3 @@ -81,6 +81,10 @@
3981b6 4       * The AIX Operating system.
NP 5       */
6      AIX,
7 +    /**
8 +     * Operating systems based on Solaris or illumos.
9 +     */
10 +    SOLARIS,
11      ;
12  
13      // The current OperatingSystem
7fe935 14 @@ -118,6 +122,14 @@
3981b6 15          return PlatformProps.TARGET_OS_IS_AIX;
NP 16      }
17  
18 +    /**
19 +     * {@return {@code true} if built for Solaris or illumos operating systems}
20 +     */
21 +    @ForceInline
22 +    public static boolean isSolaris() {
23 +        return PlatformProps.TARGET_OS_IS_SOLARIS;
24 +    }
25 +
26      /**
27       * {@return the current operating system}
28       */
29 --- a/src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template    Wed Mar 29 20:12:02 2023
30 +++ b/src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template    Thu Mar 30 13:43:29 2023
7fe935 31 @@ -39,6 +39,7 @@
3981b6 32      static final boolean TARGET_OS_IS_MACOS   = "@@OPENJDK_TARGET_OS@@" == "macos";
NP 33      static final boolean TARGET_OS_IS_WINDOWS = "@@OPENJDK_TARGET_OS@@" == "windows";
34      static final boolean TARGET_OS_IS_AIX     = "@@OPENJDK_TARGET_OS@@" == "aix";
35 +    static final boolean TARGET_OS_IS_SOLARIS = "@@OPENJDK_TARGET_OS@@" == "solaris";
36  
37      // The Architecture value for the current architecture
38      static final String CURRENT_ARCH_STRING = "@@OPENJDK_TARGET_CPU@@";