Skip to content

OS

Source: std/os.mw.

The thin layer between the standard library and the operating system. The functions sys_read, sys_write, sys_mmap_anon and so on come from the platform layer.

Raw Linux system calls, no libc involved. The numbers and the syscall stub are picked per target (--target, default: the host). Compile programs that use only this module with marrow --nostdlib.

fn os_strlen(s: *u8) -> u64
fn os_write_all(fd: i32, buf: *u8, len: i64) -> i64

Writes the whole buffer, retrying on partial writes. Returns 0 on success.

fn os_print(s: *u8)
fn os_println(s: *u8)
fn os_eprint(s: *u8)