Module arch

Source
Expand description

Architecture-specific syscall code.

This module also has a choose submodule which chooses a scheme and is what most of the rustix syscalls use.

Compilers should really have intrinsics for making system calls. They’re much like regular calls, with custom calling conventions, and calling conventions are otherwise the compiler’s job. But for now, use inline asm.

The calling conventions for Linux syscalls are documented here.

§Safety

This contains the inline asm statements performing the syscall instructions.

Modules§

asm 🔒
x86-64 Linux system calls.

Macros§

syscall 🔒
syscall_always_asm 🔒
syscall_readonly 🔒
Like syscall, but adds the readonly attribute to the inline asm, which indicates that the syscall does not mutate any memory.