Migrated from: https://github.com/ziglang/zig/issues/16590
This should basically follow the std.os.linux example. Note that, unlike Linux's libc and UAPI separation, the BSDs share most (if not all) C types and constants between libc and kernel. This means that many such types and constants which are currently in std.c will need to move into std.os.freebsd, with the decls in std.c just becoming aliases.
For this issue to be closed, zig build test should pass with this removed:
switch(target.os.tag){// These targets don't require libc, but we don't yet have a syscall layer for them,// so we default to linking libc for now..freebsd,.netbsd,=>break:btrue,else=>{},}