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 int
static final int
static final int
static final Platform.CPU_TYPE
static final String
protected final Pattern
static final String
static final String
static final int
protected final int
static final String
static final Platform.OS_TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal long
Gets the 32/64bit mask of a C address/pointer on the native platform.final int
Gets the size of a C address/pointer on the native platform.static IRubyObject
bsd_p
(ThreadContext context, IRubyObject recv) static void
createPlatformModule
(ThreadContext context, RubyModule FFI) final Platform.CPU_TYPE
getCPU()
Gets the current processor architecture the JVM is running on.final int
Deprecated.getName()
Gets the name of thisPlatform
.final Platform.OS_TYPE
getOS()
Gets the current Operating System.static final Platform
Gets the currentPlatform
static String
getProperty
(String property, String defValue) An extension overSystem.getProperty
method.final boolean
isBSD()
final boolean
final boolean
isUnix()
static IRubyObject
linux_p
(ThreadContext context, IRubyObject recv) final int
longSize()
Gets the size of a C 'long' on the native platform.static IRubyObject
mac_p
(ThreadContext context, IRubyObject recv) mapLibraryName
(String libName) static IRubyObject
solaris_p
(ThreadContext context, IRubyObject recv) static IRubyObject
unix_p
(ThreadContext context, IRubyObject recv) static IRubyObject
windows_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
OS
value representing the current Operating System.
-
getCPU
Gets the current processor architecture the JVM is running on.- Returns:
- A
CPU
value 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.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
Gets the name of thisPlatform
.- Returns:
- The name of this platform.
-
mapLibraryName
-