Skip to main content

init

Function init 

Source
pub fn init()
Available on ((32-bit and ARM, or 32-bit and little-endian and x86, or 64-bit and AArch64, or 64-bit and little-endian and x86-64) and (Android or Linux), or Linux and (32-bit and big-endian and PowerPC, or 32-bit and little-endian and RISC-V RV32, or 32-bit and little-endian and x86-64, or 32-bit and MIPS, or 64-bit and big-endian and s390x, or 64-bit and little-endian and LoongArch64, or 64-bit and little-endian and RISC-V RV64, or 64-bit and MIPS-64, or 64-bit and PowerPC64)) and (non-crate feature bare) only.
Expand description

Initialize the environment for the library. It’s recommended to call it before anything else in the main function.

Examples found in repository?
examples/kernel_exit.rs (line 6)
5fn main() {
6    init();
7    print_arch();
8    println!("{}", env::kernel_version());
9    unsafe { syscall!([!] Sysno::exit, 69) }
10}