const system: type = if (@hasDecl(root, "os") and root.os != @This())
    root.os.system
else if (builtin.link_libc or is_windows)
    std.c
else switch (builtin.os.tag) {
    .linux => linux,
    .plan9 => plan9,
    .wasi => wasi,
    .uefi => uefi,
    else => struct {},
};

Applications can override the system API layer in their root source file. Otherwise, when linking libc, this is the C API. When not linking libc, it is the OS-specific system interface.