Kernel Reference
Kernel related information
What it is #
Routines #
Signatures are reproduced from the documentation, including their declared return types. A routine listed here is part of the type's published interface; whether Raku++ implements it is a separate question, answered by the examples below.
method arch #
method arch
Instance method returning the "arch" (as in "architecture") information of the Kernel object. Dies if the "arch" could not be established.
method archname #
method archname
Instance method returning the concatenation of hardware and name.
method bits #
method bits
Instance method returning the number of bits used in the architecture of the processor. Usually 32 or 64.
method cpu-cores #
method cpu-cores(--> Int)
Returns Int.
Instance / Class method returning the number of CPU cores that are available.
method cpu-usage #
method cpu-usage(--> Int)
Returns Int.
Instance / Class method returning the amount of CPU uses since the start of the program (in microseconds).
method free-memory #
method free-memory(--> Int)
Returns Int.
Instance / Class method returning the available memory on the system. When using the JVM, this returns the available memory to the JVM instead. This method is only available in release v2019.06 and later.
method total-memory #
method total-memory(--> Int)
Returns Int.
Instance / Class method returning the total memory available to the system. When using the JVM, this returns the total memory available to the JVM instead. This method is only available in release v2019.06 and later.
method endian #
method endian(--> Endian:D)
Returns Endian:D.
Class method that returns the Endian object associated with the kernel architecture (either LittleEndian or BigEndian).
method hardware #
method hardware
Instance method returning the hardware information of the Kernel object. Dies if the hardware information could not be established.
method hostname #
method hostname
Instance method returning the hostname of the Kernel object.
method release #
method release
Instance method returning the release information of the Kernel object. Dies if the release information could not be established.
method signal #
multi method signal(Kernel:D: Str:D $signal --> Int:D)
multi method signal(Kernel:D: Signal:D \signal --> Int:D)
multi method signal(Kernel:D: Int:D \signal --> Int:D)
Returns Int:D.
Instance method returning the Signal numeric code for a given name for the Kernel object.
method signals #
Instance method returning a list of Signals that are supported by the kernel represented by the Kernel object.
Examples, run three ways #
Every example below comes from the official documentation, together with the output that documentation asserts. Each was then executed by Rakudo and by Raku++ when this page was built. Where the three agree, one result is shown; where they do not, all three are — because which of them is wrong is exactly the information worth having.
1 no-output · 1 ok · 2 rakupp-differs
class Kernel does Systemic { }Not executed: the documentation states no expected output for this example.
say $*KERNEL.cpu-cores; # OUTPUT: «8»
8
Documentation, Rakudo and Raku++ all agree.
say $*KERNEL.hardware; # OUTPUT: «x86_64»
x86_64
x86_64
arm64
Raku++ disagrees with both the documentation and Rakudo — a defect.
say $*KERNEL.signal("INT"); # OUTPUT: «2»2
2
darwin
Raku++ disagrees with both the documentation and Rakudo — a defect.