Class Platform

java.lang.Object
org.jruby.ext.ffi.Platform

public class Platform extends Object
  • Field Details

    • CPU

      public static final Platform.CPU_TYPE CPU
    • OS

      public static final Platform.OS_TYPE OS
    • NAME

      public static final String NAME
    • LIBPREFIX

      public static final String LIBPREFIX
    • LIBSUFFIX

      public static final String LIBSUFFIX
    • LIBC

      public static final String LIBC
    • BIG_ENDIAN

      public static final int BIG_ENDIAN
      See Also:
    • LITTLE_ENDIAN

      public static final int LITTLE_ENDIAN
      See Also:
    • BYTE_ORDER

      public static final int BYTE_ORDER
    • addressSize

      protected final int addressSize
    • longSize

      protected final int longSize
    • libPattern

      protected final Pattern libPattern
  • Constructor Details

  • Method Details

    • getPlatform

      public static final Platform getPlatform()
      Gets the current Platform
      Returns:
      The current platform.
    • getOS

      public final Platform.OS_TYPE getOS()
      Gets the current Operating System.
      Returns:
      A OS value representing the current Operating System.
    • getCPU

      public final Platform.CPU_TYPE getCPU()
      Gets the current processor architecture the JVM is running on.
      Returns:
      A CPU value representing the current processor architecture.
    • getJavaMajorVersion

      @Deprecated public final int getJavaMajorVersion()
      Deprecated.
    • isBSD

      public final boolean isBSD()
    • isUnix

      public final boolean isUnix()
    • isSupported

      public final boolean isSupported()
    • createPlatformModule

      public static void createPlatformModule(ThreadContext context, RubyModule FFI)
    • windows_p

      public static IRubyObject windows_p(ThreadContext context, IRubyObject recv)
    • mac_p

      public static IRubyObject mac_p(ThreadContext context, IRubyObject recv)
    • unix_p

      public static IRubyObject unix_p(ThreadContext context, IRubyObject recv)
    • bsd_p

      public static IRubyObject bsd_p(ThreadContext context, IRubyObject recv)
    • linux_p

      public static IRubyObject linux_p(ThreadContext context, IRubyObject recv)
    • solaris_p

      public static IRubyObject solaris_p(ThreadContext context, IRubyObject recv)
    • getProperty

      public static String getProperty(String property, String defValue)
      An extension over System.getProperty method. Handles security restrictions, and returns the default value if the access to the property is restricted.
      Parameters:
      property - The system property name.
      defValue - The default value.
      Returns:
      The value of the system property, or the default value.
    • longSize

      public final int longSize()
      Gets the size of a C 'long' on the native platform.
      Returns:
      the size of a long in bits
    • addressSize

      public final int addressSize()
      Gets the size of a C address/pointer on the native platform.
      Returns:
      the size of a pointer in bits
    • addressMask

      public final long addressMask()
      Gets the 32/64bit mask of a C address/pointer on the native platform.
      Returns:
      the size of a pointer in bits
    • getName

      public String getName()
      Gets the name of this Platform.
      Returns:
      The name of this platform.
    • mapLibraryName

      public String mapLibraryName(String libName)