platform

Platform Detection and System Information

Functions

FunctionDescription
_platform_unameInternal: uname syscall wrapper (syscall 63). struct utsname: 5 fields of 65 …
_plat_byte_atInternal byte reader helper.
_plat_copy_fieldInternal: copy string from utsname field to output.
_plat_copy_litInternal: copy literal bytes.
platform_systemGet OS name. Returns length written.
platform_releaseGet kernel release string. Returns length written.
platform_machineGet machine architecture. Returns length written.
platform_nodeGet hostname. Returns length written.
platform_infoGet combined platform info: “Linux x86_64 ”. Returns length.
platform_is_x86_64Check if platform is x86_64. Always returns 1 (Jda only targets x86-64).
platform_page_sizeGet system page size. Always 4096 on Linux x86-64.

Details

_platform_uname

fn _platform_uname(buf: &i8) -> i64

Internal: uname syscall wrapper (syscall 63). struct utsname: 5 fields of 65 bytes each = 325 bytes total. [0..64] = sysname, [65..129] = nodename, [130..194] = release, [195..259] = version, [260..324] = machine

_plat_byte_at

fn _plat_byte_at(buf: &i8, idx: i64) -> i64

Internal byte reader helper.

_plat_copy_field

fn _plat_copy_field(dst: &i8, src: &i8, offset: i64, max: i64) -> i64

Internal: copy string from utsname field to output.

_plat_copy_lit

fn _plat_copy_lit(dst: &i8, doff: i64, src: &i8, len: i64) -> i64

Internal: copy literal bytes.

platform_system

fn platform_system(out: &i8, max: i64) -> i64

Get OS name. Returns length written.

platform_release

fn platform_release(out: &i8, max: i64) -> i64

Get kernel release string. Returns length written.

platform_machine

fn platform_machine(out: &i8, max: i64) -> i64

Get machine architecture. Returns length written.

platform_node

fn platform_node(out: &i8, max: i64) -> i64

Get hostname. Returns length written.

platform_info

fn platform_info(out: &i8, max: i64) -> i64

Get combined platform info: “Linux x86_64 ”. Returns length.

platform_is_x86_64

fn platform_is_x86_64() -> i64

Check if platform is x86_64. Always returns 1 (Jda only targets x86-64).

platform_page_size

fn platform_page_size() -> i64

Get system page size. Always 4096 on Linux x86-64.