Package org.jruby.ext.ffi
Class Platform
java.lang.Object
org.jruby.ext.ffi.Platform
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intstatic final intstatic final intstatic final Platform.CPU_TYPEstatic final Stringprotected final Patternstatic final Stringstatic final Stringstatic final intprotected final intstatic final Stringstatic final Platform.OS_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal longGets the 32/64bit mask of a C address/pointer on the native platform.final intGets the size of a C address/pointer on the native platform.static IRubyObjectbsd_p(ThreadContext context, IRubyObject recv) static voidcreatePlatformModule(ThreadContext context, RubyModule FFI) final Platform.CPU_TYPEgetCPU()Gets the current processor architecture the JVM is running on.final intDeprecated.getName()Gets the name of thisPlatform.final Platform.OS_TYPEgetOS()Gets the current Operating System.static final PlatformGets the currentPlatformstatic StringgetProperty(String property, String defValue) An extension overSystem.getPropertymethod.final booleanisBSD()final booleanfinal booleanisUnix()static IRubyObjectlinux_p(ThreadContext context, IRubyObject recv) final intlongSize()Gets the size of a C 'long' on the native platform.static IRubyObjectmac_p(ThreadContext context, IRubyObject recv) mapLibraryName(String libName) static IRubyObjectsolaris_p(ThreadContext context, IRubyObject recv) static IRubyObjectunix_p(ThreadContext context, IRubyObject recv) static IRubyObjectwindows_p(ThreadContext context, IRubyObject recv)
-
Field Details
-
CPU
-
OS
-
NAME
-
LIBPREFIX
-
LIBSUFFIX
-
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
-
-
Constructor Details
-
Platform
-
-
Method Details
-
getPlatform
Gets the currentPlatform- Returns:
- The current platform.
-
getOS
Gets the current Operating System.- Returns:
- A
OSvalue representing the current Operating System.
-
getCPU
Gets the current processor architecture the JVM is running on.- Returns:
- A
CPUvalue representing the current processor architecture.
-
getJavaMajorVersion
Deprecated. -
isBSD
public final boolean isBSD() -
isUnix
public final boolean isUnix() -
isSupported
public final boolean isSupported() -
createPlatformModule
-
windows_p
-
mac_p
-
unix_p
-
bsd_p
-
linux_p
-
solaris_p
-
getProperty
An extension overSystem.getPropertymethod. 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
Gets the name of thisPlatform.- Returns:
- The name of this platform.
-
mapLibraryName
-