feature. See also
. The project being documented here (as the example) is the Zig library itself.
linux.SYS
pub const SYS = switch (native_arch)
File
Code
pub const SYS = switch (native_arch) {
.arc, .arceb => syscalls.Arc,
.aarch64, .aarch64_be => syscalls.Arm64,
.alpha => syscalls.Alpha,
.arm, .armeb, .thumb, .thumbeb => syscalls.Arm,
.csky => syscalls.CSky,
.hexagon => syscalls.Hexagon,
.hppa => syscalls.Hppa,
.hppa64 => syscalls.Hppa64,
.loongarch32 => syscalls.LoongArch32,
.loongarch64 => syscalls.LoongArch64,
.m68k => syscalls.M68k,
.microblaze, .microblazeel => syscalls.Microblaze,
.mips, .mipsel => syscalls.MipsO32,
.mips64, .mips64el => switch (builtin.abi) {
.gnuabin32, .muslabin32, .abin32 => syscalls.MipsN32,
else => syscalls.MipsN64,
},
.or1k => syscalls.OpenRisc,
.powerpc, .powerpcle => syscalls.PowerPC,
.powerpc64, .powerpc64le => syscalls.PowerPC64,
.riscv32 => syscalls.RiscV32,
.riscv64 => syscalls.RiscV64,
.s390x => syscalls.S390x,
.sh, .sheb => syscalls.Sh,
.sparc => syscalls.Sparc,
.sparc64 => syscalls.Sparc64,
.x86 => syscalls.X86,
.x86_64 => switch (builtin.abi) {
.gnux32, .muslx32, .x32 => syscalls.X32,
else => syscalls.X64,
},
.xtensa, .xtensaeb => syscalls.Xtensa,
else => @compileError("The Zig Standard Library is missing syscall definitions for the target CPU architecture"),
}