authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-20 13:55:37-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-07-20 13:55:37-07:00
logff02bf403b546ffc91158e976a4e9567ab02582d
tree5447c319e889b481929f5be7e1c4dcb5164d822c
parent6d7bbab740a8c4790fe30c63d026d72fb7556984
parent5e82e90dbf2a28baa69c3f79c09407e3c2e78ceb
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #20402 from alexrp/target-cleanup

std.Target: Remove some obsolete/dead specifiers.

9 files changed, 87 insertions(+), 151 deletions(-)

lib/compiler/aro/aro/target.zig-11
...@@ -39,7 +39,6 @@ pub fn intMaxType(target: std.Target) Type {...@@ -39,7 +39,6 @@ pub fn intMaxType(target: std.Target) Type {
39pub fn intPtrType(target: std.Target) Type {39pub fn intPtrType(target: std.Target) Type {
40 switch (target.os.tag) {40 switch (target.os.tag) {
41 .haiku => return .{ .specifier = .long },41 .haiku => return .{ .specifier = .long },
42 .nacl => return .{ .specifier = .int },
43 else => {},42 else => {},
44 }43 }
4544
...@@ -467,7 +466,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {...@@ -467,7 +466,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
467 .csky,466 .csky,
468 .hexagon,467 .hexagon,
469 .m68k,468 .m68k,
470 .le32,
471 .mips,469 .mips,
472 .mipsel,470 .mipsel,
473 .powerpc,471 .powerpc,
...@@ -500,7 +498,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {...@@ -500,7 +498,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
500498
501 .aarch64 => copy.cpu.arch = .arm,499 .aarch64 => copy.cpu.arch = .arm,
502 .aarch64_be => copy.cpu.arch = .armeb,500 .aarch64_be => copy.cpu.arch = .armeb,
503 .le64 => copy.cpu.arch = .le32,
504 .amdil64 => copy.cpu.arch = .amdil,501 .amdil64 => copy.cpu.arch = .amdil,
505 .nvptx64 => copy.cpu.arch = .nvptx,502 .nvptx64 => copy.cpu.arch = .nvptx,
506 .wasm64 => copy.cpu.arch = .wasm32,503 .wasm64 => copy.cpu.arch = .wasm32,
...@@ -547,7 +544,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {...@@ -547,7 +544,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
547 .amdgcn,544 .amdgcn,
548 .bpfeb,545 .bpfeb,
549 .bpfel,546 .bpfel,
550 .le64,
551 .amdil64,547 .amdil64,
552 .nvptx64,548 .nvptx64,
553 .wasm64,549 .wasm64,
...@@ -572,7 +568,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {...@@ -572,7 +568,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
572 .arm => copy.cpu.arch = .aarch64,568 .arm => copy.cpu.arch = .aarch64,
573 .armeb => copy.cpu.arch = .aarch64_be,569 .armeb => copy.cpu.arch = .aarch64_be,
574 .hsail => copy.cpu.arch = .hsail64,570 .hsail => copy.cpu.arch = .hsail64,
575 .le32 => copy.cpu.arch = .le64,
576 .loongarch32 => copy.cpu.arch = .loongarch64,571 .loongarch32 => copy.cpu.arch = .loongarch64,
577 .mips => copy.cpu.arch = .mips64,572 .mips => copy.cpu.arch = .mips64,
578 .mipsel => copy.cpu.arch = .mips64el,573 .mipsel => copy.cpu.arch = .mips64el,
...@@ -643,8 +638,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -643,8 +638,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
643 .xtensa => "xtensa",638 .xtensa => "xtensa",
644 .nvptx => "nvptx",639 .nvptx => "nvptx",
645 .nvptx64 => "nvptx64",640 .nvptx64 => "nvptx64",
646 .le32 => "le32",
647 .le64 => "le64",
648 .amdil => "amdil",641 .amdil => "amdil",
649 .amdil64 => "amdil64",642 .amdil64 => "amdil64",
650 .hsail => "hsail",643 .hsail => "hsail",
...@@ -674,7 +667,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -674,7 +667,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
674 .dragonfly => "dragonfly",667 .dragonfly => "dragonfly",
675 .freebsd => "freebsd",668 .freebsd => "freebsd",
676 .fuchsia => "fuchsia",669 .fuchsia => "fuchsia",
677 .kfreebsd => "kfreebsd",
678 .linux => "linux",670 .linux => "linux",
679 .lv2 => "lv2",671 .lv2 => "lv2",
680 .netbsd => "netbsd",672 .netbsd => "netbsd",
...@@ -686,7 +678,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -686,7 +678,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
686 .haiku => "haiku",678 .haiku => "haiku",
687 .minix => "minix",679 .minix => "minix",
688 .rtems => "rtems",680 .rtems => "rtems",
689 .nacl => "nacl",
690 .aix => "aix",681 .aix => "aix",
691 .cuda => "cuda",682 .cuda => "cuda",
692 .nvcl => "nvcl",683 .nvcl => "nvcl",
...@@ -737,7 +728,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -737,7 +728,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
737 .gnueabi => "gnueabi",728 .gnueabi => "gnueabi",
738 .gnueabihf => "gnueabihf",729 .gnueabihf => "gnueabihf",
739 .gnuf32 => "gnuf32",730 .gnuf32 => "gnuf32",
740 .gnuf64 => "gnuf64",
741 .gnusf => "gnusf",731 .gnusf => "gnusf",
742 .gnux32 => "gnux32",732 .gnux32 => "gnux32",
743 .gnuilp32 => "gnuilp32",733 .gnuilp32 => "gnuilp32",
...@@ -752,7 +742,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -752,7 +742,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
752 .msvc => "msvc",742 .msvc => "msvc",
753 .itanium => "itanium",743 .itanium => "itanium",
754 .cygnus => "cygnus",744 .cygnus => "cygnus",
755 .coreclr => "coreclr",
756 .simulator => "simulator",745 .simulator => "simulator",
757 .macabi => "macabi",746 .macabi => "macabi",
758 .pixel => "pixel",747 .pixel => "pixel",
lib/std/Target.zig+1-33
...@@ -23,7 +23,6 @@ pub const Os = struct {...@@ -23,7 +23,6 @@ pub const Os = struct {
23 freebsd,23 freebsd,
24 fuchsia,24 fuchsia,
25 ios,25 ios,
26 kfreebsd,
27 linux,26 linux,
28 lv2,27 lv2,
29 macos,28 macos,
...@@ -36,7 +35,6 @@ pub const Os = struct {...@@ -36,7 +35,6 @@ pub const Os = struct {
36 haiku,35 haiku,
37 minix,36 minix,
38 rtems,37 rtems,
39 nacl,
40 aix,38 aix,
41 cuda,39 cuda,
42 nvcl,40 nvcl,
...@@ -74,7 +72,7 @@ pub const Os = struct {...@@ -74,7 +72,7 @@ pub const Os = struct {
7472
75 pub inline fn isBSD(tag: Tag) bool {73 pub inline fn isBSD(tag: Tag) bool {
76 return tag.isDarwin() or switch (tag) {74 return tag.isDarwin() or switch (tag) {
77 .kfreebsd, .freebsd, .openbsd, .netbsd, .dragonfly => true,75 .freebsd, .openbsd, .netbsd, .dragonfly => true,
78 else => false,76 else => false,
79 };77 };
80 }78 }
...@@ -140,13 +138,11 @@ pub const Os = struct {...@@ -140,13 +138,11 @@ pub const Os = struct {
140 .ananas,138 .ananas,
141 .cloudabi,139 .cloudabi,
142 .fuchsia,140 .fuchsia,
143 .kfreebsd,
144 .lv2,141 .lv2,
145 .zos,142 .zos,
146 .haiku,143 .haiku,
147 .minix,144 .minix,
148 .rtems,145 .rtems,
149 .nacl,
150 .aix,146 .aix,
151 .cuda,147 .cuda,
152 .nvcl,148 .nvcl,
...@@ -374,13 +370,11 @@ pub const Os = struct {...@@ -374,13 +370,11 @@ pub const Os = struct {
374 .ananas,370 .ananas,
375 .cloudabi,371 .cloudabi,
376 .fuchsia,372 .fuchsia,
377 .kfreebsd,
378 .lv2,373 .lv2,
379 .zos,374 .zos,
380 .haiku,375 .haiku,
381 .minix,376 .minix,
382 .rtems,377 .rtems,
383 .nacl,
384 .aix,378 .aix,
385 .cuda,379 .cuda,
386 .nvcl,380 .nvcl,
...@@ -563,12 +557,10 @@ pub const Os = struct {...@@ -563,12 +557,10 @@ pub const Os = struct {
563 .ananas,557 .ananas,
564 .cloudabi,558 .cloudabi,
565 .fuchsia,559 .fuchsia,
566 .kfreebsd,
567 .lv2,560 .lv2,
568 .zos,561 .zos,
569 .minix,562 .minix,
570 .rtems,563 .rtems,
571 .nacl,
572 .aix,564 .aix,
573 .cuda,565 .cuda,
574 .nvcl,566 .nvcl,
...@@ -628,7 +620,6 @@ pub const Abi = enum {...@@ -628,7 +620,6 @@ pub const Abi = enum {
628 gnueabi,620 gnueabi,
629 gnueabihf,621 gnueabihf,
630 gnuf32,622 gnuf32,
631 gnuf64,
632 gnusf,623 gnusf,
633 gnux32,624 gnux32,
634 gnuilp32,625 gnuilp32,
...@@ -643,7 +634,6 @@ pub const Abi = enum {...@@ -643,7 +634,6 @@ pub const Abi = enum {
643 msvc,634 msvc,
644 itanium,635 itanium,
645 cygnus,636 cygnus,
646 coreclr,
647 simulator,637 simulator,
648 macabi,638 macabi,
649 pixel,639 pixel,
...@@ -673,7 +663,6 @@ pub const Abi = enum {...@@ -673,7 +663,6 @@ pub const Abi = enum {
673 .zos,663 .zos,
674 .minix,664 .minix,
675 .rtems,665 .rtems,
676 .nacl,
677 .aix,666 .aix,
678 .cuda,667 .cuda,
679 .nvcl,668 .nvcl,
...@@ -690,7 +679,6 @@ pub const Abi = enum {...@@ -690,7 +679,6 @@ pub const Abi = enum {
690 .openbsd,679 .openbsd,
691 .freebsd,680 .freebsd,
692 .fuchsia,681 .fuchsia,
693 .kfreebsd,
694 .netbsd,682 .netbsd,
695 .hurd,683 .hurd,
696 .haiku,684 .haiku,
...@@ -1024,8 +1012,6 @@ pub const Cpu = struct {...@@ -1024,8 +1012,6 @@ pub const Cpu = struct {
1024 xtensa,1012 xtensa,
1025 nvptx,1013 nvptx,
1026 nvptx64,1014 nvptx64,
1027 le32,
1028 le64,
1029 amdil,1015 amdil,
1030 amdil64,1016 amdil64,
1031 hsail,1017 hsail,
...@@ -1159,7 +1145,6 @@ pub const Cpu = struct {...@@ -1159,7 +1145,6 @@ pub const Cpu = struct {
1159 .hexagon => .HEXAGON,1145 .hexagon => .HEXAGON,
1160 .dxil => .NONE,1146 .dxil => .NONE,
1161 .m68k => .@"68K",1147 .m68k => .@"68K",
1162 .le32 => .NONE,
1163 .mips => .MIPS,1148 .mips => .MIPS,
1164 .mipsel => .MIPS_RS3_LE,1149 .mipsel => .MIPS_RS3_LE,
1165 .powerpc, .powerpcle => .PPC,1150 .powerpc, .powerpcle => .PPC,
...@@ -1193,7 +1178,6 @@ pub const Cpu = struct {...@@ -1193,7 +1178,6 @@ pub const Cpu = struct {
1193 .riscv64 => .RISCV,1178 .riscv64 => .RISCV,
1194 .x86_64 => .X86_64,1179 .x86_64 => .X86_64,
1195 .nvptx64 => .NONE,1180 .nvptx64 => .NONE,
1196 .le64 => .NONE,
1197 .amdil64 => .NONE,1181 .amdil64 => .NONE,
1198 .hsail64 => .NONE,1182 .hsail64 => .NONE,
1199 .spir64 => .NONE,1183 .spir64 => .NONE,
...@@ -1225,7 +1209,6 @@ pub const Cpu = struct {...@@ -1225,7 +1209,6 @@ pub const Cpu = struct {
1225 .dxil => .Unknown,1209 .dxil => .Unknown,
1226 .hexagon => .Unknown,1210 .hexagon => .Unknown,
1227 .m68k => .Unknown,1211 .m68k => .Unknown,
1228 .le32 => .Unknown,
1229 .mips => .Unknown,1212 .mips => .Unknown,
1230 .mipsel => .Unknown,1213 .mipsel => .Unknown,
1231 .powerpc, .powerpcle => .POWERPC,1214 .powerpc, .powerpcle => .POWERPC,
...@@ -1259,7 +1242,6 @@ pub const Cpu = struct {...@@ -1259,7 +1242,6 @@ pub const Cpu = struct {
1259 .riscv64 => .RISCV64,1242 .riscv64 => .RISCV64,
1260 .x86_64 => .X64,1243 .x86_64 => .X64,
1261 .nvptx64 => .Unknown,1244 .nvptx64 => .Unknown,
1262 .le64 => .Unknown,
1263 .amdil64 => .Unknown,1245 .amdil64 => .Unknown,
1264 .hsail64 => .Unknown,1246 .hsail64 => .Unknown,
1265 .spir64 => .Unknown,1247 .spir64 => .Unknown,
...@@ -1297,8 +1279,6 @@ pub const Cpu = struct {...@@ -1297,8 +1279,6 @@ pub const Cpu = struct {
1297 .hsail,1279 .hsail,
1298 .hsail64,1280 .hsail64,
1299 .kalimba,1281 .kalimba,
1300 .le32,
1301 .le64,
1302 .mipsel,1282 .mipsel,
1303 .mips64el,1283 .mips64el,
1304 .msp430,1284 .msp430,
...@@ -1805,8 +1785,6 @@ pub const DynamicLinker = struct {...@@ -1805,8 +1785,6 @@ pub const DynamicLinker = struct {
1805 .tce,1785 .tce,
1806 .tcele,1786 .tcele,
1807 .xcore,1787 .xcore,
1808 .le32,
1809 .le64,
1810 .amdil,1788 .amdil,
1811 .amdil64,1789 .amdil64,
1812 .hsail,1790 .hsail,
...@@ -1856,12 +1834,10 @@ pub const DynamicLinker = struct {...@@ -1856,12 +1834,10 @@ pub const DynamicLinker = struct {
1856 .ananas,1834 .ananas,
1857 .cloudabi,1835 .cloudabi,
1858 .fuchsia,1836 .fuchsia,
1859 .kfreebsd,
1860 .lv2,1837 .lv2,
1861 .zos,1838 .zos,
1862 .minix,1839 .minix,
1863 .rtems,1840 .rtems,
1864 .nacl,
1865 .aix,1841 .aix,
1866 .cuda,1842 .cuda,
1867 .nvcl,1843 .nvcl,
...@@ -1904,7 +1880,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {...@@ -1904,7 +1880,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
1904 .csky,1880 .csky,
1905 .hexagon,1881 .hexagon,
1906 .m68k,1882 .m68k,
1907 .le32,
1908 .mips,1883 .mips,
1909 .mipsel,1884 .mipsel,
1910 .powerpc,1885 .powerpc,
...@@ -1943,7 +1918,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {...@@ -1943,7 +1918,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
1943 .riscv64,1918 .riscv64,
1944 .x86_64,1919 .x86_64,
1945 .nvptx64,1920 .nvptx64,
1946 .le64,
1947 .amdil64,1921 .amdil64,
1948 .hsail64,1922 .hsail64,
1949 .spir64,1923 .spir64,
...@@ -2376,11 +2350,9 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {...@@ -2376,11 +2350,9 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
2376 },2350 },
23772351
2378 .cloudabi,2352 .cloudabi,
2379 .kfreebsd,
2380 .lv2,2353 .lv2,
2381 .zos,2354 .zos,
2382 .rtems,2355 .rtems,
2383 .nacl,
2384 .aix,2356 .aix,
2385 .elfiamcu,2357 .elfiamcu,
2386 .mesa3d,2358 .mesa3d,
...@@ -2447,7 +2419,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {...@@ -2447,7 +2419,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
2447 .loongarch32,2419 .loongarch32,
2448 .tce,2420 .tce,
2449 .tcele,2421 .tcele,
2450 .le32,
2451 .amdil,2422 .amdil,
2452 .hsail,2423 .hsail,
2453 .spir,2424 .spir,
...@@ -2475,7 +2446,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {...@@ -2475,7 +2446,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
2475 .sparcel,2446 .sparcel,
2476 .sparc64,2447 .sparc64,
2477 .lanai,2448 .lanai,
2478 .le64,
2479 .nvptx,2449 .nvptx,
2480 .nvptx64,2450 .nvptx64,
2481 .r600,2451 .r600,
...@@ -2568,7 +2538,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {...@@ -2568,7 +2538,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
2568 .loongarch32,2538 .loongarch32,
2569 .tce,2539 .tce,
2570 .tcele,2540 .tcele,
2571 .le32,
2572 .amdil,2541 .amdil,
2573 .hsail,2542 .hsail,
2574 .spir,2543 .spir,
...@@ -2603,7 +2572,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {...@@ -2603,7 +2572,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
2603 .sparcel,2572 .sparcel,
2604 .sparc64,2573 .sparc64,
2605 .lanai,2574 .lanai,
2606 .le64,
2607 .nvptx,2575 .nvptx,
2608 .nvptx64,2576 .nvptx64,
2609 .r600,2577 .r600,
lib/std/c.zig+85-86
...@@ -106,7 +106,7 @@ pub const timespec = switch (native_os) {...@@ -106,7 +106,7 @@ pub const timespec = switch (native_os) {
106 sec: time_t,106 sec: time_t,
107 nsec: c_long,107 nsec: c_long,
108 },108 },
109 .dragonfly, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {109 .dragonfly, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
110 sec: isize,110 sec: isize,
111 nsec: isize,111 nsec: isize,
112 },112 },
...@@ -126,7 +126,7 @@ pub const dev_t = switch (native_os) {...@@ -126,7 +126,7 @@ pub const dev_t = switch (native_os) {
126 .emscripten => emscripten.dev_t,126 .emscripten => emscripten.dev_t,
127 .wasi => wasi.device_t,127 .wasi => wasi.device_t,
128 .openbsd, .haiku, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32,128 .openbsd, .haiku, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32,
129 .netbsd, .freebsd, .kfreebsd => u64,129 .netbsd, .freebsd => u64,
130 else => void,130 else => void,
131};131};
132132
...@@ -134,7 +134,7 @@ pub const mode_t = switch (native_os) {...@@ -134,7 +134,7 @@ pub const mode_t = switch (native_os) {
134 .linux => linux.mode_t,134 .linux => linux.mode_t,
135 .emscripten => emscripten.mode_t,135 .emscripten => emscripten.mode_t,
136 .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi => u32,136 .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi => u32,
137 .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => u16,137 .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u16,
138 else => u0,138 else => u0,
139};139};
140140
...@@ -142,7 +142,7 @@ pub const nlink_t = switch (native_os) {...@@ -142,7 +142,7 @@ pub const nlink_t = switch (native_os) {
142 .linux => linux.nlink_t,142 .linux => linux.nlink_t,
143 .emscripten => emscripten.nlink_t,143 .emscripten => emscripten.nlink_t,
144 .wasi => c_ulonglong,144 .wasi => c_ulonglong,
145 .freebsd, .kfreebsd => u64,145 .freebsd => u64,
146 .openbsd, .netbsd, .solaris, .illumos => u32,146 .openbsd, .netbsd, .solaris, .illumos => u32,
147 .haiku => i32,147 .haiku => i32,
148 else => void,148 else => void,
...@@ -235,7 +235,7 @@ pub const clockid_t = switch (native_os) {...@@ -235,7 +235,7 @@ pub const clockid_t = switch (native_os) {
235 /// clock measuring the used CPU time of the current thread235 /// clock measuring the used CPU time of the current thread
236 THREAD_CPUTIME_ID = -3,236 THREAD_CPUTIME_ID = -3,
237 },237 },
238 .freebsd, .kfreebsd => enum(u32) {238 .freebsd => enum(u32) {
239 REALTIME = 0,239 REALTIME = 0,
240 VIRTUAL = 1,240 VIRTUAL = 1,
241 PROF = 2,241 PROF = 2,
...@@ -389,7 +389,7 @@ pub const E = switch (native_os) {...@@ -389,7 +389,7 @@ pub const E = switch (native_os) {
389 _,389 _,
390 },390 },
391 .macos, .ios, .tvos, .watchos, .visionos => darwin.E,391 .macos, .ios, .tvos, .watchos, .visionos => darwin.E,
392 .freebsd, .kfreebsd => freebsd.E,392 .freebsd => freebsd.E,
393 .solaris, .illumos => enum(u16) {393 .solaris, .illumos => enum(u16) {
394 /// No error occurred.394 /// No error occurred.
395 SUCCESS = 0,395 SUCCESS = 0,
...@@ -781,7 +781,7 @@ pub const F = switch (native_os) {...@@ -781,7 +781,7 @@ pub const F = switch (native_os) {
781 /// exclusive or write lock781 /// exclusive or write lock
782 pub const WRLCK = 3;782 pub const WRLCK = 3;
783 },783 },
784 .freebsd, .kfreebsd => struct {784 .freebsd => struct {
785 /// Duplicate file descriptor.785 /// Duplicate file descriptor.
786 pub const DUPFD = 0;786 pub const DUPFD = 0;
787 /// Get file descriptor flags.787 /// Get file descriptor flags.
...@@ -1075,7 +1075,7 @@ pub const Flock = switch (native_os) {...@@ -1075,7 +1075,7 @@ pub const Flock = switch (native_os) {
1075 type: i16,1075 type: i16,
1076 whence: i16,1076 whence: i16,
1077 },1077 },
1078 .freebsd, .kfreebsd => extern struct {1078 .freebsd => extern struct {
1079 /// Starting offset.1079 /// Starting offset.
1080 start: off_t,1080 start: off_t,
1081 /// Number of consecutive bytes to be locked.1081 /// Number of consecutive bytes to be locked.
...@@ -1112,7 +1112,7 @@ pub const Flock = switch (native_os) {...@@ -1112,7 +1112,7 @@ pub const Flock = switch (native_os) {
1112pub const HOST_NAME_MAX = switch (native_os) {1112pub const HOST_NAME_MAX = switch (native_os) {
1113 .linux => linux.HOST_NAME_MAX,1113 .linux => linux.HOST_NAME_MAX,
1114 .macos, .ios, .tvos, .watchos, .visionos => 72,1114 .macos, .ios, .tvos, .watchos, .visionos => 72,
1115 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd => 255,1115 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => 255,
1116 else => {},1116 else => {},
1117};1117};
1118pub const IOV_MAX = switch (native_os) {1118pub const IOV_MAX = switch (native_os) {
...@@ -1120,11 +1120,11 @@ pub const IOV_MAX = switch (native_os) {...@@ -1120,11 +1120,11 @@ pub const IOV_MAX = switch (native_os) {
1120 .emscripten => emscripten.IOV_MAX,1120 .emscripten => emscripten.IOV_MAX,
1121 .openbsd, .haiku, .solaris, .illumos, .wasi => 1024,1121 .openbsd, .haiku, .solaris, .illumos, .wasi => 1024,
1122 .macos, .ios, .tvos, .watchos, .visionos => 16,1122 .macos, .ios, .tvos, .watchos, .visionos => 16,
1123 .dragonfly, .netbsd, .freebsd, .kfreebsd => KERN.IOV_MAX,1123 .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,
1124 else => {},1124 else => {},
1125};1125};
1126pub const CTL = switch (native_os) {1126pub const CTL = switch (native_os) {
1127 .freebsd, .kfreebsd => struct {1127 .freebsd => struct {
1128 pub const KERN = 1;1128 pub const KERN = 1;
1129 pub const DEBUG = 5;1129 pub const DEBUG = 5;
1130 },1130 },
...@@ -1162,7 +1162,7 @@ pub const CTL = switch (native_os) {...@@ -1162,7 +1162,7 @@ pub const CTL = switch (native_os) {
1162 else => void,1162 else => void,
1163};1163};
1164pub const KERN = switch (native_os) {1164pub const KERN = switch (native_os) {
1165 .freebsd, .kfreebsd => struct {1165 .freebsd => struct {
1166 /// struct: process entries1166 /// struct: process entries
1167 pub const PROC = 14;1167 pub const PROC = 14;
1168 /// path to executable1168 /// path to executable
...@@ -1338,7 +1338,7 @@ pub const KERN = switch (native_os) {...@@ -1338,7 +1338,7 @@ pub const KERN = switch (native_os) {
1338pub const MADV = switch (native_os) {1338pub const MADV = switch (native_os) {
1339 .linux => linux.MADV,1339 .linux => linux.MADV,
1340 .emscripten => emscripten.MADV,1340 .emscripten => emscripten.MADV,
1341 .freebsd, .kfreebsd => struct {1341 .freebsd => struct {
1342 pub const NORMAL = 0;1342 pub const NORMAL = 0;
1343 pub const RANDOM = 1;1343 pub const RANDOM = 1;
1344 pub const SEQUENTIAL = 2;1344 pub const SEQUENTIAL = 2;
...@@ -1403,7 +1403,7 @@ pub const MSF = switch (native_os) {...@@ -1403,7 +1403,7 @@ pub const MSF = switch (native_os) {
1403 pub const DEACTIVATE = 0x8;1403 pub const DEACTIVATE = 0x8;
1404 pub const SYNC = 0x10;1404 pub const SYNC = 0x10;
1405 },1405 },
1406 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd => struct {1406 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => struct {
1407 pub const ASYNC = 1;1407 pub const ASYNC = 1;
1408 pub const INVALIDATE = 2;1408 pub const INVALIDATE = 2;
1409 pub const SYNC = 4;1409 pub const SYNC = 4;
...@@ -1420,7 +1420,7 @@ pub const NAME_MAX = switch (native_os) {...@@ -1420,7 +1420,7 @@ pub const NAME_MAX = switch (native_os) {
1420 // Haiku's headers make this 256, to contain room for the terminating null1420 // Haiku's headers make this 256, to contain room for the terminating null
1421 // character, but POSIX definition says that NAME_MAX does not include the1421 // character, but POSIX definition says that NAME_MAX does not include the
1422 // terminating null.1422 // terminating null.
1423 .haiku, .openbsd, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => 255,1423 .haiku, .openbsd, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 255,
1424 else => {},1424 else => {},
1425};1425};
1426pub const PATH_MAX = switch (native_os) {1426pub const PATH_MAX = switch (native_os) {
...@@ -1428,7 +1428,7 @@ pub const PATH_MAX = switch (native_os) {...@@ -1428,7 +1428,7 @@ pub const PATH_MAX = switch (native_os) {
1428 .emscripten => emscripten.PATH_MAX,1428 .emscripten => emscripten.PATH_MAX,
1429 .wasi => 4096,1429 .wasi => 4096,
1430 .windows => 260,1430 .windows => 260,
1431 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => 1024,1431 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 1024,
1432 else => {},1432 else => {},
1433};1433};
14341434
...@@ -1465,7 +1465,7 @@ pub const POLL = switch (native_os) {...@@ -1465,7 +1465,7 @@ pub const POLL = switch (native_os) {
14651465
1466 pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;1466 pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
1467 },1467 },
1468 .freebsd, .kfreebsd => struct {1468 .freebsd => struct {
1469 /// any readable data available.1469 /// any readable data available.
1470 pub const IN = 0x0001;1470 pub const IN = 0x0001;
1471 /// OOB/Urgent readable data.1471 /// OOB/Urgent readable data.
...@@ -1568,7 +1568,7 @@ pub const POLL = switch (native_os) {...@@ -1568,7 +1568,7 @@ pub const POLL = switch (native_os) {
1568pub const PROT = switch (native_os) {1568pub const PROT = switch (native_os) {
1569 .linux => linux.PROT,1569 .linux => linux.PROT,
1570 .emscripten => emscripten.PROT,1570 .emscripten => emscripten.PROT,
1571 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd, .windows => struct {1571 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .windows => struct {
1572 /// page can not be accessed1572 /// page can not be accessed
1573 pub const NONE = 0x0;1573 pub const NONE = 0x0;
1574 /// page can be read1574 /// page can be read
...@@ -1600,7 +1600,7 @@ pub const PROT = switch (native_os) {...@@ -1600,7 +1600,7 @@ pub const PROT = switch (native_os) {
1600pub const REG = switch (native_os) {1600pub const REG = switch (native_os) {
1601 .linux => linux.REG,1601 .linux => linux.REG,
1602 .emscripten => emscripten.REG,1602 .emscripten => emscripten.REG,
1603 .freebsd, .kfreebsd => switch (builtin.cpu.arch) {1603 .freebsd => switch (builtin.cpu.arch) {
1604 .aarch64 => struct {1604 .aarch64 => struct {
1605 pub const FP = 29;1605 pub const FP = 29;
1606 pub const SP = 31;1606 pub const SP = 31;
...@@ -1683,7 +1683,7 @@ pub const REG = switch (native_os) {...@@ -1683,7 +1683,7 @@ pub const REG = switch (native_os) {
1683pub const RLIM = switch (native_os) {1683pub const RLIM = switch (native_os) {
1684 .linux => linux.RLIM,1684 .linux => linux.RLIM,
1685 .emscripten => emscripten.RLIM,1685 .emscripten => emscripten.RLIM,
1686 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {1686 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
1687 /// No limit1687 /// No limit
1688 pub const INFINITY: rlim_t = (1 << 63) - 1;1688 pub const INFINITY: rlim_t = (1 << 63) - 1;
16891689
...@@ -1774,7 +1774,7 @@ pub const S = switch (native_os) {...@@ -1774,7 +1774,7 @@ pub const S = switch (native_os) {
1774 return m & IFMT == IFWHT;1774 return m & IFMT == IFWHT;
1775 }1775 }
1776 },1776 },
1777 .freebsd, .kfreebsd => struct {1777 .freebsd => struct {
1778 pub const IFMT = 0o170000;1778 pub const IFMT = 0o170000;
17791779
1780 pub const IFIFO = 0o010000;1780 pub const IFIFO = 0o010000;
...@@ -2137,7 +2137,7 @@ pub const SA = switch (native_os) {...@@ -2137,7 +2137,7 @@ pub const SA = switch (native_os) {
2137 /// signal handler with SIGINFO args with 64bit regs information2137 /// signal handler with SIGINFO args with 64bit regs information
2138 pub const @"64REGSET" = 0x0200;2138 pub const @"64REGSET" = 0x0200;
2139 },2139 },
2140 .freebsd, .kfreebsd => struct {2140 .freebsd => struct {
2141 pub const ONSTACK = 0x0001;2141 pub const ONSTACK = 0x0001;
2142 pub const RESTART = 0x0002;2142 pub const RESTART = 0x0002;
2143 pub const RESETHAND = 0x0004;2143 pub const RESETHAND = 0x0004;
...@@ -2214,7 +2214,7 @@ pub const SEEK = switch (native_os) {...@@ -2214,7 +2214,7 @@ pub const SEEK = switch (native_os) {
2214 pub const CUR: wasi.whence_t = .CUR;2214 pub const CUR: wasi.whence_t = .CUR;
2215 pub const END: wasi.whence_t = .END;2215 pub const END: wasi.whence_t = .END;
2216 },2216 },
2217 .openbsd, .haiku, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos, .windows => struct {2217 .openbsd, .haiku, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .windows => struct {
2218 pub const SET = 0;2218 pub const SET = 0;
2219 pub const CUR = 1;2219 pub const CUR = 1;
2220 pub const END = 2;2220 pub const END = 2;
...@@ -2353,7 +2353,7 @@ pub const SIG = switch (native_os) {...@@ -2353,7 +2353,7 @@ pub const SIG = switch (native_os) {
2353 /// user defined signal 22353 /// user defined signal 2
2354 pub const USR2 = 31;2354 pub const USR2 = 31;
2355 },2355 },
2356 .freebsd, .kfreebsd => struct {2356 .freebsd => struct {
2357 pub const HUP = 1;2357 pub const HUP = 1;
2358 pub const INT = 2;2358 pub const INT = 2;
2359 pub const QUIT = 3;2359 pub const QUIT = 3;
...@@ -2735,7 +2735,7 @@ pub const Sigaction = switch (native_os) {...@@ -2735,7 +2735,7 @@ pub const Sigaction = switch (native_os) {
2735 mask: sigset_t,2735 mask: sigset_t,
2736 flags: c_uint,2736 flags: c_uint,
2737 },2737 },
2738 .dragonfly, .freebsd, .kfreebsd => extern struct {2738 .dragonfly, .freebsd => extern struct {
2739 pub const handler_fn = *align(1) const fn (i32) callconv(.C) void;2739 pub const handler_fn = *align(1) const fn (i32) callconv(.C) void;
2740 pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.C) void;2740 pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.C) void;
27412741
...@@ -2807,7 +2807,7 @@ pub const T = switch (native_os) {...@@ -2807,7 +2807,7 @@ pub const T = switch (native_os) {
2807 return (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num));2807 return (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num));
2808 }2808 }
2809 },2809 },
2810 .freebsd, .kfreebsd => struct {2810 .freebsd => struct {
2811 pub const IOCEXCL = 0x2000740d;2811 pub const IOCEXCL = 0x2000740d;
2812 pub const IOCNXCL = 0x2000740e;2812 pub const IOCNXCL = 0x2000740e;
2813 pub const IOCSCTTY = 0x20007461;2813 pub const IOCSCTTY = 0x20007461;
...@@ -3154,7 +3154,7 @@ pub const W = switch (native_os) {...@@ -3154,7 +3154,7 @@ pub const W = switch (native_os) {
3154 }3154 }
3155 const stopped = 0o177;3155 const stopped = 0o177;
3156 },3156 },
3157 .freebsd, .kfreebsd => struct {3157 .freebsd => struct {
3158 pub const NOHANG = 1;3158 pub const NOHANG = 1;
3159 pub const UNTRACED = 2;3159 pub const UNTRACED = 2;
3160 pub const STOPPED = UNTRACED;3160 pub const STOPPED = UNTRACED;
...@@ -3346,7 +3346,7 @@ pub const clock_t = switch (native_os) {...@@ -3346,7 +3346,7 @@ pub const clock_t = switch (native_os) {
3346 .linux => linux.clock_t,3346 .linux => linux.clock_t,
3347 .emscripten => emscripten.clock_t,3347 .emscripten => emscripten.clock_t,
3348 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,3348 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
3349 .freebsd, .kfreebsd => isize,3349 .freebsd => isize,
3350 .openbsd, .solaris, .illumos => i64,3350 .openbsd, .solaris, .illumos => i64,
3351 .netbsd => u32,3351 .netbsd => u32,
3352 .haiku => i32,3352 .haiku => i32,
...@@ -3360,7 +3360,7 @@ pub const cpu_set_t = switch (native_os) {...@@ -3360,7 +3360,7 @@ pub const cpu_set_t = switch (native_os) {
3360pub const dl_phdr_info = switch (native_os) {3360pub const dl_phdr_info = switch (native_os) {
3361 .linux => linux.dl_phdr_info,3361 .linux => linux.dl_phdr_info,
3362 .emscripten => emscripten.dl_phdr_info,3362 .emscripten => emscripten.dl_phdr_info,
3363 .freebsd, .kfreebsd => extern struct {3363 .freebsd => extern struct {
3364 /// Module relocation base.3364 /// Module relocation base.
3365 addr: if (builtin.target.ptrBitWidth() == 32) std.elf.Elf32_Addr else std.elf.Elf64_Addr,3365 addr: if (builtin.target.ptrBitWidth() == 32) std.elf.Elf32_Addr else std.elf.Elf64_Addr,
3366 /// Module name.3366 /// Module name.
...@@ -3414,7 +3414,7 @@ pub const itimerspec = switch (native_os) {...@@ -3414,7 +3414,7 @@ pub const itimerspec = switch (native_os) {
3414};3414};
3415pub const msghdr = switch (native_os) {3415pub const msghdr = switch (native_os) {
3416 .linux => linux.msghdr,3416 .linux => linux.msghdr,
3417 .openbsd, .emscripten, .dragonfly, .freebsd, .kfreebsd, .netbsd, .haiku, .solaris, .illumos => extern struct {3417 .openbsd, .emscripten, .dragonfly, .freebsd, .netbsd, .haiku, .solaris, .illumos => extern struct {
3418 /// optional address3418 /// optional address
3419 name: ?*sockaddr,3419 name: ?*sockaddr,
3420 /// size of address3420 /// size of address
...@@ -3434,7 +3434,7 @@ pub const msghdr = switch (native_os) {...@@ -3434,7 +3434,7 @@ pub const msghdr = switch (native_os) {
3434};3434};
3435pub const msghdr_const = switch (native_os) {3435pub const msghdr_const = switch (native_os) {
3436 .linux => linux.msghdr_const,3436 .linux => linux.msghdr_const,
3437 .openbsd, .emscripten, .dragonfly, .freebsd, .kfreebsd, .netbsd, .haiku, .solaris, .illumos => extern struct {3437 .openbsd, .emscripten, .dragonfly, .freebsd, .netbsd, .haiku, .solaris, .illumos => extern struct {
3438 /// optional address3438 /// optional address
3439 name: ?*const sockaddr,3439 name: ?*const sockaddr,
3440 /// size of address3440 /// size of address
...@@ -3457,7 +3457,7 @@ pub const nfds_t = switch (native_os) {...@@ -3457,7 +3457,7 @@ pub const nfds_t = switch (native_os) {
3457 .emscripten => emscripten.nfds_t,3457 .emscripten => emscripten.nfds_t,
3458 .haiku, .solaris, .illumos, .wasi => usize,3458 .haiku, .solaris, .illumos, .wasi => usize,
3459 .windows => c_ulong,3459 .windows => c_ulong,
3460 .openbsd, .dragonfly, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,3460 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
3461 else => void,3461 else => void,
3462};3462};
3463pub const perf_event_attr = switch (native_os) {3463pub const perf_event_attr = switch (native_os) {
...@@ -3484,7 +3484,7 @@ pub const rlim_t = switch (native_os) {...@@ -3484,7 +3484,7 @@ pub const rlim_t = switch (native_os) {
3484 .linux => linux.rlim_t,3484 .linux => linux.rlim_t,
3485 .emscripten => emscripten.rlim_t,3485 .emscripten => emscripten.rlim_t,
3486 .openbsd, .netbsd, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64,3486 .openbsd, .netbsd, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64,
3487 .haiku, .dragonfly, .freebsd, .kfreebsd => i64,3487 .haiku, .dragonfly, .freebsd => i64,
3488 else => void,3488 else => void,
3489};3489};
3490pub const rlimit = switch (native_os) {3490pub const rlimit = switch (native_os) {
...@@ -3514,7 +3514,7 @@ pub const rlimit_resource = switch (native_os) {...@@ -3514,7 +3514,7 @@ pub const rlimit_resource = switch (native_os) {
35143514
3515 pub const AS: rlimit_resource = .RSS;3515 pub const AS: rlimit_resource = .RSS;
3516 },3516 },
3517 .freebsd, .kfreebsd => enum(c_int) {3517 .freebsd => enum(c_int) {
3518 CPU = 0,3518 CPU = 0,
3519 FSIZE = 1,3519 FSIZE = 1,
3520 DATA = 2,3520 DATA = 2,
...@@ -3660,7 +3660,7 @@ pub const siginfo_t = switch (native_os) {...@@ -3660,7 +3660,7 @@ pub const siginfo_t = switch (native_os) {
3660 si_band: c_long,3660 si_band: c_long,
3661 _pad: [7]c_ulong,3661 _pad: [7]c_ulong,
3662 },3662 },
3663 .freebsd, .kfreebsd => extern struct {3663 .freebsd => extern struct {
3664 // Signal number.3664 // Signal number.
3665 signo: c_int,3665 signo: c_int,
3666 // Errno association.3666 // Errno association.
...@@ -3822,7 +3822,7 @@ pub const sigset_t = switch (native_os) {...@@ -3822,7 +3822,7 @@ pub const sigset_t = switch (native_os) {
3822 .linux => linux.sigset_t,3822 .linux => linux.sigset_t,
3823 .emscripten => emscripten.sigset_t,3823 .emscripten => emscripten.sigset_t,
3824 .openbsd, .macos, .ios, .tvos, .watchos, .visionos => u32,3824 .openbsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
3825 .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd => extern struct {3825 .dragonfly, .netbsd, .solaris, .illumos, .freebsd => extern struct {
3826 __bits: [SIG.WORDS]u32,3826 __bits: [SIG.WORDS]u32,
3827 },3827 },
3828 .haiku => u64,3828 .haiku => u64,
...@@ -3831,7 +3831,7 @@ pub const sigset_t = switch (native_os) {...@@ -3831,7 +3831,7 @@ pub const sigset_t = switch (native_os) {
3831pub const empty_sigset: sigset_t = switch (native_os) {3831pub const empty_sigset: sigset_t = switch (native_os) {
3832 .linux => linux.empty_sigset,3832 .linux => linux.empty_sigset,
3833 .emscripten => emscripten.empty_sigset,3833 .emscripten => emscripten.empty_sigset,
3834 .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .kfreebsd => .{ .__bits = [_]u32{0} ** SIG.WORDS },3834 .dragonfly, .netbsd, .solaris, .illumos, .freebsd => .{ .__bits = [_]u32{0} ** SIG.WORDS },
3835 else => 0,3835 else => 0,
3836};3836};
3837pub const filled_sigset = switch (native_os) {3837pub const filled_sigset = switch (native_os) {
...@@ -3841,7 +3841,7 @@ pub const filled_sigset = switch (native_os) {...@@ -3841,7 +3841,7 @@ pub const filled_sigset = switch (native_os) {
3841};3841};
3842pub const sigval = switch (native_os) {3842pub const sigval = switch (native_os) {
3843 .linux => linux.sigval,3843 .linux => linux.sigval,
3844 .openbsd, .dragonfly, .freebsd, .kfreebsd => extern union {3844 .openbsd, .dragonfly, .freebsd => extern union {
3845 int: c_int,3845 int: c_int,
3846 ptr: ?*anyopaque,3846 ptr: ?*anyopaque,
3847 },3847 },
...@@ -3851,7 +3851,7 @@ pub const sigval = switch (native_os) {...@@ -3851,7 +3851,7 @@ pub const sigval = switch (native_os) {
3851pub const addrinfo = switch (native_os) {3851pub const addrinfo = switch (native_os) {
3852 .linux, .emscripten => linux.addrinfo,3852 .linux, .emscripten => linux.addrinfo,
3853 .windows => ws2_32.addrinfo,3853 .windows => ws2_32.addrinfo,
3854 .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {3854 .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
3855 flags: AI,3855 flags: AI,
3856 family: i32,3856 family: i32,
3857 socktype: i32,3857 socktype: i32,
...@@ -3955,7 +3955,7 @@ pub const sockaddr = switch (native_os) {...@@ -3955,7 +3955,7 @@ pub const sockaddr = switch (native_os) {
3955 path: [104]u8,3955 path: [104]u8,
3956 };3956 };
3957 },3957 },
3958 .freebsd, .kfreebsd => extern struct {3958 .freebsd => extern struct {
3959 /// total length3959 /// total length
3960 len: u8,3960 len: u8,
3961 /// address family3961 /// address family
...@@ -4228,7 +4228,7 @@ pub const in_port_t = u16;...@@ -4228,7 +4228,7 @@ pub const in_port_t = u16;
4228pub const sa_family_t = switch (native_os) {4228pub const sa_family_t = switch (native_os) {
4229 .linux, .emscripten => linux.sa_family_t,4229 .linux, .emscripten => linux.sa_family_t,
4230 .windows => ws2_32.ADDRESS_FAMILY,4230 .windows => ws2_32.ADDRESS_FAMILY,
4231 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,4231 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,
4232 .solaris, .illumos => u16,4232 .solaris, .illumos => u16,
4233 else => void,4233 else => void,
4234};4234};
...@@ -4275,7 +4275,7 @@ pub const AF = switch (native_os) {...@@ -4275,7 +4275,7 @@ pub const AF = switch (native_os) {
4275 pub const PPP = 34;4275 pub const PPP = 34;
4276 pub const MAX = 40;4276 pub const MAX = 40;
4277 },4277 },
4278 .freebsd, .kfreebsd => struct {4278 .freebsd => struct {
4279 pub const UNSPEC = 0;4279 pub const UNSPEC = 0;
4280 pub const UNIX = 1;4280 pub const UNIX = 1;
4281 pub const LOCAL = UNIX;4281 pub const LOCAL = UNIX;
...@@ -4505,7 +4505,7 @@ pub const PF = switch (native_os) {...@@ -4505,7 +4505,7 @@ pub const PF = switch (native_os) {
4505 pub const PPP = AF.PPP;4505 pub const PPP = AF.PPP;
4506 pub const MAX = AF.MAX;4506 pub const MAX = AF.MAX;
4507 },4507 },
4508 .freebsd, .kfreebsd => struct {4508 .freebsd => struct {
4509 pub const UNSPEC = AF.UNSPEC;4509 pub const UNSPEC = AF.UNSPEC;
4510 pub const LOCAL = AF.LOCAL;4510 pub const LOCAL = AF.LOCAL;
4511 pub const UNIX = PF.LOCAL;4511 pub const UNIX = PF.LOCAL;
...@@ -4691,7 +4691,7 @@ pub const PF = switch (native_os) {...@@ -4691,7 +4691,7 @@ pub const PF = switch (native_os) {
4691};4691};
4692pub const DT = switch (native_os) {4692pub const DT = switch (native_os) {
4693 .linux => linux.DT,4693 .linux => linux.DT,
4694 .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {4694 .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
4695 pub const UNKNOWN = 0;4695 pub const UNKNOWN = 0;
4696 pub const FIFO = 1;4696 pub const FIFO = 1;
4697 pub const CHR = 2;4697 pub const CHR = 2;
...@@ -4768,7 +4768,7 @@ pub const SOCK = switch (native_os) {...@@ -4768,7 +4768,7 @@ pub const SOCK = switch (native_os) {
4768 /// with any other `SOCK` bits.4768 /// with any other `SOCK` bits.
4769 pub const NONBLOCK = 1 << 16;4769 pub const NONBLOCK = 1 << 16;
4770 },4770 },
4771 .freebsd, .kfreebsd => struct {4771 .freebsd => struct {
4772 pub const STREAM = 1;4772 pub const STREAM = 1;
4773 pub const DGRAM = 2;4773 pub const DGRAM = 2;
4774 pub const RAW = 3;4774 pub const RAW = 3;
...@@ -4854,7 +4854,7 @@ pub const IPPROTO = switch (native_os) {...@@ -4854,7 +4854,7 @@ pub const IPPROTO = switch (native_os) {
4854 pub const IP = 0;4854 pub const IP = 0;
4855 pub const IPV6 = 41;4855 pub const IPV6 = 41;
4856 },4856 },
4857 .freebsd, .kfreebsd => struct {4857 .freebsd => struct {
4858 /// dummy for IP4858 /// dummy for IP
4859 pub const IP = 0;4859 pub const IP = 0;
4860 /// control message protocol4860 /// control message protocol
...@@ -5431,7 +5431,7 @@ pub const SOL = switch (native_os) {...@@ -5431,7 +5431,7 @@ pub const SOL = switch (native_os) {
5431 .linux => linux.SOL,5431 .linux => linux.SOL,
5432 .emscripten => emscripten.SOL,5432 .emscripten => emscripten.SOL,
5433 .windows => ws2_32.SOL,5433 .windows => ws2_32.SOL,
5434 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {5434 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
5435 pub const SOCKET = 0xffff;5435 pub const SOCKET = 0xffff;
5436 },5436 },
5437 .solaris, .illumos => struct {5437 .solaris, .illumos => struct {
...@@ -5474,7 +5474,7 @@ pub const SO = switch (native_os) {...@@ -5474,7 +5474,7 @@ pub const SO = switch (native_os) {
5474 pub const NWRITE = 0x1024;5474 pub const NWRITE = 0x1024;
5475 pub const REUSESHAREUID = 0x1025;5475 pub const REUSESHAREUID = 0x1025;
5476 },5476 },
5477 .freebsd, .kfreebsd => struct {5477 .freebsd => struct {
5478 pub const DEBUG = 0x00000001;5478 pub const DEBUG = 0x00000001;
5479 pub const ACCEPTCONN = 0x00000002;5479 pub const ACCEPTCONN = 0x00000002;
5480 pub const REUSEADDR = 0x00000004;5480 pub const REUSEADDR = 0x00000004;
...@@ -5670,7 +5670,7 @@ pub const IFNAMESIZE = switch (native_os) {...@@ -5670,7 +5670,7 @@ pub const IFNAMESIZE = switch (native_os) {
5670 .linux => linux.IFNAMESIZE,5670 .linux => linux.IFNAMESIZE,
5671 .emscripten => emscripten.IFNAMESIZE,5671 .emscripten => emscripten.IFNAMESIZE,
5672 .windows => 30,5672 .windows => 30,
5673 .openbsd, .dragonfly, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => 16,5673 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 16,
5674 .solaris, .illumos => 32,5674 .solaris, .illumos => 32,
5675 else => void,5675 else => void,
5676};5676};
...@@ -5678,7 +5678,7 @@ pub const IFNAMESIZE = switch (native_os) {...@@ -5678,7 +5678,7 @@ pub const IFNAMESIZE = switch (native_os) {
5678pub const stack_t = switch (native_os) {5678pub const stack_t = switch (native_os) {
5679 .linux => linux.stack_t,5679 .linux => linux.stack_t,
5680 .emscripten => emscripten.stack_t,5680 .emscripten => emscripten.stack_t,
5681 .freebsd, .kfreebsd => extern struct {5681 .freebsd => extern struct {
5682 /// Signal stack base.5682 /// Signal stack base.
5683 sp: *anyopaque,5683 sp: *anyopaque,
5684 /// Signal stack length.5684 /// Signal stack length.
...@@ -5700,7 +5700,7 @@ pub const time_t = switch (native_os) {...@@ -5700,7 +5700,7 @@ pub const time_t = switch (native_os) {
5700};5700};
5701pub const suseconds_t = switch (native_os) {5701pub const suseconds_t = switch (native_os) {
5702 .solaris, .illumos => i64,5702 .solaris, .illumos => i64,
5703 .freebsd, .kfreebsd, .dragonfly => c_long,5703 .freebsd, .dragonfly => c_long,
5704 .netbsd => c_int,5704 .netbsd => c_int,
5705 .haiku => i32,5705 .haiku => i32,
5706 else => void,5706 else => void,
...@@ -5717,7 +5717,7 @@ pub const timeval = switch (native_os) {...@@ -5717,7 +5717,7 @@ pub const timeval = switch (native_os) {
5717 sec: c_long,5717 sec: c_long,
5718 usec: i32,5718 usec: i32,
5719 },5719 },
5720 .dragonfly, .netbsd, .freebsd, .kfreebsd, .solaris, .illumos => extern struct {5720 .dragonfly, .netbsd, .freebsd, .solaris, .illumos => extern struct {
5721 /// seconds5721 /// seconds
5722 sec: time_t,5722 sec: time_t,
5723 /// microseconds5723 /// microseconds
...@@ -5751,7 +5751,7 @@ pub const ucontext_t = switch (native_os) {...@@ -5751,7 +5751,7 @@ pub const ucontext_t = switch (native_os) {
5751 mcontext: *mcontext_t,5751 mcontext: *mcontext_t,
5752 __mcontext_data: mcontext_t,5752 __mcontext_data: mcontext_t,
5753 },5753 },
5754 .freebsd, .kfreebsd => extern struct {5754 .freebsd => extern struct {
5755 sigmask: sigset_t,5755 sigmask: sigset_t,
5756 mcontext: mcontext_t,5756 mcontext: mcontext_t,
5757 link: ?*ucontext_t,5757 link: ?*ucontext_t,
...@@ -5806,7 +5806,7 @@ pub const mcontext_t = switch (native_os) {...@@ -5806,7 +5806,7 @@ pub const mcontext_t = switch (native_os) {
5806 .linux => linux.mcontext_t,5806 .linux => linux.mcontext_t,
5807 .emscripten => emscripten.mcontext_t,5807 .emscripten => emscripten.mcontext_t,
5808 .macos, .ios, .tvos, .watchos, .visionos => darwin.mcontext_t,5808 .macos, .ios, .tvos, .watchos, .visionos => darwin.mcontext_t,
5809 .freebsd, .kfreebsd => switch (builtin.cpu.arch) {5809 .freebsd => switch (builtin.cpu.arch) {
5810 .x86_64 => extern struct {5810 .x86_64 => extern struct {
5811 onstack: u64,5811 onstack: u64,
5812 rdi: u64,5812 rdi: u64,
...@@ -5920,7 +5920,7 @@ pub const _errno = switch (native_os) {...@@ -5920,7 +5920,7 @@ pub const _errno = switch (native_os) {
5920 .emscripten => private.__errno_location,5920 .emscripten => private.__errno_location,
5921 .wasi, .dragonfly => private.errnoFromThreadLocal,5921 .wasi, .dragonfly => private.errnoFromThreadLocal,
5922 .windows => private._errno,5922 .windows => private._errno,
5923 .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .kfreebsd => private.__error,5923 .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error,
5924 .solaris, .illumos => private.___errno,5924 .solaris, .illumos => private.___errno,
5925 .openbsd, .netbsd => private.__errno,5925 .openbsd, .netbsd => private.__errno,
5926 .haiku => haiku._errnop,5926 .haiku => haiku._errnop,
...@@ -5938,7 +5938,7 @@ pub const RTLD = switch (native_os) {...@@ -5938,7 +5938,7 @@ pub const RTLD = switch (native_os) {
5938 NODELETE: bool = false,5938 NODELETE: bool = false,
5939 _: u19 = 0,5939 _: u19 = 0,
5940 },5940 },
5941 .dragonfly, .freebsd, .kfreebsd => packed struct(u32) {5941 .dragonfly, .freebsd => packed struct(u32) {
5942 LAZY: bool = false,5942 LAZY: bool = false,
5943 NOW: bool = false,5943 NOW: bool = false,
5944 _2: u6 = 0,5944 _2: u6 = 0,
...@@ -6018,7 +6018,7 @@ pub const dirent = switch (native_os) {...@@ -6018,7 +6018,7 @@ pub const dirent = switch (native_os) {
6018 type: u8,6018 type: u8,
6019 name: [1024]u8,6019 name: [1024]u8,
6020 },6020 },
6021 .freebsd, .kfreebsd => extern struct {6021 .freebsd => extern struct {
6022 /// File number of entry.6022 /// File number of entry.
6023 fileno: ino_t,6023 fileno: ino_t,
6024 /// Directory offset of entry.6024 /// Directory offset of entry.
...@@ -6093,7 +6093,7 @@ pub const dirent64 = switch (native_os) {...@@ -6093,7 +6093,7 @@ pub const dirent64 = switch (native_os) {
60936093
6094pub const AI = switch (native_os) {6094pub const AI = switch (native_os) {
6095 .linux, .emscripten => linux.AI,6095 .linux, .emscripten => linux.AI,
6096 .dragonfly, .haiku, .freebsd, .kfreebsd => packed struct(u32) {6096 .dragonfly, .haiku, .freebsd => packed struct(u32) {
6097 PASSIVE: bool = false,6097 PASSIVE: bool = false,
6098 CANONNAME: bool = false,6098 CANONNAME: bool = false,
6099 NUMERICHOST: bool = false,6099 NUMERICHOST: bool = false,
...@@ -6194,7 +6194,7 @@ pub const EAI = switch (native_os) {...@@ -6194,7 +6194,7 @@ pub const EAI = switch (native_os) {
61946194
6195 _,6195 _,
6196 },6196 },
6197 .haiku, .dragonfly, .netbsd, .freebsd, .kfreebsd, .macos, .ios, .tvos, .watchos, .visionos => enum(c_int) {6197 .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => enum(c_int) {
6198 /// address family for hostname not supported6198 /// address family for hostname not supported
6199 ADDRFAMILY = 1,6199 ADDRFAMILY = 1,
6200 /// temporary failure in name resolution6200 /// temporary failure in name resolution
...@@ -6455,7 +6455,7 @@ pub const Stat = switch (native_os) {...@@ -6455,7 +6455,7 @@ pub const Stat = switch (native_os) {
6455 return self.birthtimespec;6455 return self.birthtimespec;
6456 }6456 }
6457 },6457 },
6458 .freebsd, .kfreebsd => freebsd.Stat,6458 .freebsd => freebsd.Stat,
6459 .solaris, .illumos => extern struct {6459 .solaris, .illumos => extern struct {
6460 dev: dev_t,6460 dev: dev_t,
6461 ino: ino_t,6461 ino: ino_t,
...@@ -6640,7 +6640,7 @@ pub const pthread_mutex_t = switch (native_os) {...@@ -6640,7 +6640,7 @@ pub const pthread_mutex_t = switch (native_os) {
66406640
6641 const data_len = if (@sizeOf(usize) == 8) 56 else 40;6641 const data_len = if (@sizeOf(usize) == 8) 56 else 40;
6642 },6642 },
6643 .freebsd, .kfreebsd, .dragonfly, .openbsd => extern struct {6643 .freebsd, .dragonfly, .openbsd => extern struct {
6644 inner: ?*anyopaque = null,6644 inner: ?*anyopaque = null,
6645 },6645 },
6646 .hermit => extern struct {6646 .hermit => extern struct {
...@@ -6689,7 +6689,7 @@ pub const pthread_cond_t = switch (native_os) {...@@ -6689,7 +6689,7 @@ pub const pthread_cond_t = switch (native_os) {
6689 data: [data_len]u8 = [_]u8{0} ** data_len,6689 data: [data_len]u8 = [_]u8{0} ** data_len,
6690 const data_len = if (@sizeOf(usize) == 8) 40 else 24;6690 const data_len = if (@sizeOf(usize) == 8) 40 else 24;
6691 },6691 },
6692 .freebsd, .kfreebsd, .dragonfly, .openbsd => extern struct {6692 .freebsd, .dragonfly, .openbsd => extern struct {
6693 inner: ?*anyopaque = null,6693 inner: ?*anyopaque = null,
6694 },6694 },
6695 .hermit => extern struct {6695 .hermit => extern struct {
...@@ -6741,7 +6741,7 @@ pub const pthread_rwlock_t = switch (native_os) {...@@ -6741,7 +6741,7 @@ pub const pthread_rwlock_t = switch (native_os) {
6741 sig: c_long = 0x2DA8B3B4,6741 sig: c_long = 0x2DA8B3B4,
6742 data: [192]u8 = [_]u8{0} ** 192,6742 data: [192]u8 = [_]u8{0} ** 192,
6743 },6743 },
6744 .freebsd, .kfreebsd, .dragonfly, .openbsd => extern struct {6744 .freebsd, .dragonfly, .openbsd => extern struct {
6745 ptr: ?*anyopaque = null,6745 ptr: ?*anyopaque = null,
6746 },6746 },
6747 .hermit => extern struct {6747 .hermit => extern struct {
...@@ -6788,7 +6788,7 @@ pub const pthread_attr_t = switch (native_os) {...@@ -6788,7 +6788,7 @@ pub const pthread_attr_t = switch (native_os) {
6788 __sig: c_long,6788 __sig: c_long,
6789 __opaque: [56]u8,6789 __opaque: [56]u8,
6790 },6790 },
6791 .freebsd, .kfreebsd => extern struct {6791 .freebsd => extern struct {
6792 inner: ?*anyopaque = null,6792 inner: ?*anyopaque = null,
6793 },6793 },
6794 .solaris, .illumos => extern struct {6794 .solaris, .illumos => extern struct {
...@@ -6846,7 +6846,7 @@ pub const sem_t = switch (native_os) {...@@ -6846,7 +6846,7 @@ pub const sem_t = switch (native_os) {
6846 __size: [4 * @sizeOf(usize)]u8 align(@alignOf(usize)),6846 __size: [4 * @sizeOf(usize)]u8 align(@alignOf(usize)),
6847 },6847 },
6848 .macos, .ios, .tvos, .watchos, .visionos => c_int,6848 .macos, .ios, .tvos, .watchos, .visionos => c_int,
6849 .freebsd, .kfreebsd => extern struct {6849 .freebsd => extern struct {
6850 _magic: u32,6850 _magic: u32,
6851 _kern: extern struct {6851 _kern: extern struct {
6852 _count: u32,6852 _count: u32,
...@@ -6903,7 +6903,7 @@ pub const Kevent = switch (native_os) {...@@ -6903,7 +6903,7 @@ pub const Kevent = switch (native_os) {
6903 assert(@offsetOf(@This(), "udata") == 24);6903 assert(@offsetOf(@This(), "udata") == 24);
6904 }6904 }
6905 },6905 },
6906 .freebsd, .kfreebsd => extern struct {6906 .freebsd => extern struct {
6907 /// Identifier for this event.6907 /// Identifier for this event.
6908 ident: usize,6908 ident: usize,
6909 /// Filter for event.6909 /// Filter for event.
...@@ -6974,7 +6974,7 @@ pub const AT = switch (native_os) {...@@ -6974,7 +6974,7 @@ pub const AT = switch (native_os) {
6974 /// Path refers to directory6974 /// Path refers to directory
6975 pub const REMOVEDIR = 0x0080;6975 pub const REMOVEDIR = 0x0080;
6976 },6976 },
6977 .freebsd, .kfreebsd => struct {6977 .freebsd => struct {
6978 /// Magic value that specify the use of the current working directory6978 /// Magic value that specify the use of the current working directory
6979 /// to determine the target of relative file paths in the openat() and6979 /// to determine the target of relative file paths in the openat() and
6980 /// similar syscalls.6980 /// similar syscalls.
...@@ -7260,7 +7260,7 @@ pub const O = switch (native_os) {...@@ -7260,7 +7260,7 @@ pub const O = switch (native_os) {
7260 DIRECTORY: bool = false,7260 DIRECTORY: bool = false,
7261 _: u4 = 0,7261 _: u4 = 0,
7262 },7262 },
7263 .freebsd, .kfreebsd => packed struct(u32) {7263 .freebsd => packed struct(u32) {
7264 ACCMODE: std.posix.ACCMODE = .RDONLY,7264 ACCMODE: std.posix.ACCMODE = .RDONLY,
7265 NONBLOCK: bool = false,7265 NONBLOCK: bool = false,
7266 APPEND: bool = false,7266 APPEND: bool = false,
...@@ -7405,7 +7405,7 @@ pub const MAP = switch (native_os) {...@@ -7405,7 +7405,7 @@ pub const MAP = switch (native_os) {
7405 SIZEALIGN: bool = false,7405 SIZEALIGN: bool = false,
7406 _: u13 = 0,7406 _: u13 = 0,
7407 },7407 },
7408 .freebsd, .kfreebsd => packed struct(u32) {7408 .freebsd => packed struct(u32) {
7409 TYPE: enum(u4) {7409 TYPE: enum(u4) {
7410 SHARED = 0x01,7410 SHARED = 0x01,
7411 PRIVATE = 0x02,7411 PRIVATE = 0x02,
...@@ -7455,7 +7455,7 @@ pub const V = switch (native_os) {...@@ -7455,7 +7455,7 @@ pub const V = switch (native_os) {
7455 TIME,7455 TIME,
7456 STATUS,7456 STATUS,
7457 },7457 },
7458 .freebsd, .kfreebsd => enum {7458 .freebsd => enum {
7459 EOF,7459 EOF,
7460 EOL,7460 EOL,
7461 EOL2,7461 EOL2,
...@@ -7533,7 +7533,7 @@ pub const V = switch (native_os) {...@@ -7533,7 +7533,7 @@ pub const V = switch (native_os) {
75337533
7534pub const NCCS = switch (native_os) {7534pub const NCCS = switch (native_os) {
7535 .linux => linux.NCCS,7535 .linux => linux.NCCS,
7536 .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .kfreebsd, .netbsd, .openbsd, .dragonfly => 20,7536 .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,
7537 .haiku => 11,7537 .haiku => 11,
7538 .solaris, .illumos => 19,7538 .solaris, .illumos => 19,
7539 .emscripten, .wasi => 32,7539 .emscripten, .wasi => 32,
...@@ -7551,7 +7551,7 @@ pub const termios = switch (native_os) {...@@ -7551,7 +7551,7 @@ pub const termios = switch (native_os) {
7551 ispeed: speed_t align(8),7551 ispeed: speed_t align(8),
7552 ospeed: speed_t,7552 ospeed: speed_t,
7553 },7553 },
7554 .freebsd, .kfreebsd, .netbsd, .dragonfly, .openbsd => extern struct {7554 .freebsd, .netbsd, .dragonfly, .openbsd => extern struct {
7555 iflag: tc_iflag_t,7555 iflag: tc_iflag_t,
7556 oflag: tc_oflag_t,7556 oflag: tc_oflag_t,
7557 cflag: tc_cflag_t,7557 cflag: tc_cflag_t,
...@@ -7610,7 +7610,7 @@ pub const tc_iflag_t = switch (native_os) {...@@ -7610,7 +7610,7 @@ pub const tc_iflag_t = switch (native_os) {
7610 IUTF8: bool = false,7610 IUTF8: bool = false,
7611 _: u49 = 0,7611 _: u49 = 0,
7612 },7612 },
7613 .netbsd, .freebsd, .kfreebsd, .dragonfly => packed struct(u32) {7613 .netbsd, .freebsd, .dragonfly => packed struct(u32) {
7614 IGNBRK: bool = false,7614 IGNBRK: bool = false,
7615 BRKINT: bool = false,7615 BRKINT: bool = false,
7616 IGNPAR: bool = false,7616 IGNPAR: bool = false,
...@@ -7742,7 +7742,7 @@ pub const tc_oflag_t = switch (native_os) {...@@ -7742,7 +7742,7 @@ pub const tc_oflag_t = switch (native_os) {
7742 ONLRET: bool = false,7742 ONLRET: bool = false,
7743 _: u24 = 0,7743 _: u24 = 0,
7744 },7744 },
7745 .freebsd, .kfreebsd, .dragonfly => packed struct(u32) {7745 .freebsd, .dragonfly => packed struct(u32) {
7746 OPOST: bool = false,7746 OPOST: bool = false,
7747 ONLCR: bool = false,7747 ONLCR: bool = false,
7748 _2: u1 = 0,7748 _2: u1 = 0,
...@@ -7818,7 +7818,7 @@ pub const tc_cflag_t = switch (native_os) {...@@ -7818,7 +7818,7 @@ pub const tc_cflag_t = switch (native_os) {
7818 CCAR_OFLOW: bool = false,7818 CCAR_OFLOW: bool = false,
7819 _: u43 = 0,7819 _: u43 = 0,
7820 },7820 },
7821 .freebsd, .kfreebsd => packed struct(u32) {7821 .freebsd => packed struct(u32) {
7822 CIGNORE: bool = false,7822 CIGNORE: bool = false,
7823 _1: u7 = 0,7823 _1: u7 = 0,
7824 CSIZE: CSIZE = .CS5,7824 CSIZE: CSIZE = .CS5,
...@@ -7959,7 +7959,7 @@ pub const tc_lflag_t = switch (native_os) {...@@ -7959,7 +7959,7 @@ pub const tc_lflag_t = switch (native_os) {
7959 NOFLSH: bool = false,7959 NOFLSH: bool = false,
7960 _: u32 = 0,7960 _: u32 = 0,
7961 },7961 },
7962 .netbsd, .freebsd, .kfreebsd, .dragonfly => packed struct(u32) {7962 .netbsd, .freebsd, .dragonfly => packed struct(u32) {
7963 ECHOKE: bool = false,7963 ECHOKE: bool = false,
7964 ECHOE: bool = false,7964 ECHOE: bool = false,
7965 ECHOK: bool = false,7965 ECHOK: bool = false,
...@@ -8086,7 +8086,7 @@ pub const speed_t = switch (native_os) {...@@ -8086,7 +8086,7 @@ pub const speed_t = switch (native_os) {
8086 B115200 = 115200,8086 B115200 = 115200,
8087 B230400 = 230400,8087 B230400 = 230400,
8088 },8088 },
8089 .freebsd, .kfreebsd, .netbsd => enum(c_uint) {8089 .freebsd, .netbsd => enum(c_uint) {
8090 B0 = 0,8090 B0 = 0,
8091 B50 = 50,8091 B50 = 50,
8092 B75 = 75,8092 B75 = 75,
...@@ -8250,7 +8250,7 @@ pub const NSIG = switch (native_os) {...@@ -8250,7 +8250,7 @@ pub const NSIG = switch (native_os) {
8250 .linux => linux.NSIG,8250 .linux => linux.NSIG,
8251 .windows => 23,8251 .windows => 23,
8252 .haiku => 65,8252 .haiku => 65,
8253 .netbsd, .freebsd, .kfreebsd => 32,8253 .netbsd, .freebsd => 32,
8254 .solaris, .illumos => 75,8254 .solaris, .illumos => 75,
8255 .openbsd => 33,8255 .openbsd => 33,
8256 else => {},8256 else => {},
...@@ -8258,7 +8258,7 @@ pub const NSIG = switch (native_os) {...@@ -8258,7 +8258,7 @@ pub const NSIG = switch (native_os) {
82588258
8259pub const MINSIGSTKSZ = switch (native_os) {8259pub const MINSIGSTKSZ = switch (native_os) {
8260 .macos, .ios, .tvos, .watchos, .visionos => 32768,8260 .macos, .ios, .tvos, .watchos, .visionos => 32768,
8261 .freebsd, .kfreebsd => switch (builtin.cpu.arch) {8261 .freebsd => switch (builtin.cpu.arch) {
8262 .x86, .x86_64 => 2048,8262 .x86, .x86_64 => 2048,
8263 .arm, .aarch64 => 4096,8263 .arm, .aarch64 => 4096,
8264 else => @compileError("unsupported arch"),8264 else => @compileError("unsupported arch"),
...@@ -8270,7 +8270,7 @@ pub const MINSIGSTKSZ = switch (native_os) {...@@ -8270,7 +8270,7 @@ pub const MINSIGSTKSZ = switch (native_os) {
8270};8270};
8271pub const SIGSTKSZ = switch (native_os) {8271pub const SIGSTKSZ = switch (native_os) {
8272 .macos, .ios, .tvos, .watchos, .visionos => 131072,8272 .macos, .ios, .tvos, .watchos, .visionos => 131072,
8273 .netbsd, .freebsd, .kfreebsd => MINSIGSTKSZ + 32768,8273 .netbsd, .freebsd => MINSIGSTKSZ + 32768,
8274 .solaris, .illumos => 8192,8274 .solaris, .illumos => 8192,
8275 .haiku => 16384,8275 .haiku => 16384,
8276 .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,8276 .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,
...@@ -8278,7 +8278,7 @@ pub const SIGSTKSZ = switch (native_os) {...@@ -8278,7 +8278,7 @@ pub const SIGSTKSZ = switch (native_os) {
8278};8278};
8279pub const SS = switch (native_os) {8279pub const SS = switch (native_os) {
8280 .linux => linux.SS,8280 .linux => linux.SS,
8281 .openbsd, .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .freebsd, .kfreebsd => struct {8281 .openbsd, .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .freebsd => struct {
8282 pub const ONSTACK = 1;8282 pub const ONSTACK = 1;
8283 pub const DISABLE = 4;8283 pub const DISABLE = 4;
8284 },8284 },
...@@ -8882,7 +8882,7 @@ pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]c...@@ -8882,7 +8882,7 @@ pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]c
8882pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int;8882pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int;
8883pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;8883pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;
8884pub const sendfile = switch (native_os) {8884pub const sendfile = switch (native_os) {
8885 .freebsd, .kfreebsd => freebsd.sendfile,8885 .freebsd => freebsd.sendfile,
8886 .macos, .ios, .tvos, .watchos, .visionos => darwin.sendfile,8886 .macos, .ios, .tvos, .watchos, .visionos => darwin.sendfile,
8887 .linux => private.sendfile,8887 .linux => private.sendfile,
8888 else => {},8888 else => {},
...@@ -8899,12 +8899,12 @@ pub const sigaltstack = switch (native_os) {...@@ -8899,12 +8899,12 @@ pub const sigaltstack = switch (native_os) {
88998899
8900pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;8900pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
8901pub const pipe2 = switch (native_os) {8901pub const pipe2 = switch (native_os) {
8902 .dragonfly, .emscripten, .netbsd, .freebsd, .kfreebsd, .solaris, .illumos, .openbsd, .linux => private.pipe2,8902 .dragonfly, .emscripten, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .linux => private.pipe2,
8903 else => {},8903 else => {},
8904};8904};
8905pub const copy_file_range = switch (native_os) {8905pub const copy_file_range = switch (native_os) {
8906 .linux => private.copy_file_range,8906 .linux => private.copy_file_range,
8907 .freebsd, .kfreebsd => freebsd.copy_file_range,8907 .freebsd => freebsd.copy_file_range,
8908 else => {},8908 else => {},
8909};8909};
89108910
...@@ -9071,7 +9071,6 @@ pub const fork = switch (native_os) {...@@ -9071,7 +9071,6 @@ pub const fork = switch (native_os) {
9071 .dragonfly,9071 .dragonfly,
9072 .freebsd,9072 .freebsd,
9073 .ios,9073 .ios,
9074 .kfreebsd,
9075 .linux,9074 .linux,
9076 .macos,9075 .macos,
9077 .netbsd,9076 .netbsd,
...@@ -9683,7 +9682,7 @@ const private = struct {...@@ -9683,7 +9682,7 @@ const private = struct {
9683 extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int;9682 extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int;
9684 extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;9683 extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;
9685 extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {9684 extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {
9686 .freebsd, .kfreebsd => isize,9685 .freebsd => isize,
9687 .solaris, .illumos => usize,9686 .solaris, .illumos => usize,
9688 else => c_int,9687 else => c_int,
9689 };9688 };
lib/std/c/freebsd.zig+1-1
...@@ -22,7 +22,7 @@ const sf_hdtr = std.c.sf_hdtr;...@@ -22,7 +22,7 @@ const sf_hdtr = std.c.sf_hdtr;
22const clockid_t = std.c.clockid_t;22const clockid_t = std.c.clockid_t;
2323
24comptime {24comptime {
25 assert(builtin.os.tag == .freebsd or builtin.os.tag == .kfreebsd); // Prevent access of std.c symbols on wrong OS.25 assert(builtin.os.tag == .freebsd); // Prevent access of std.c symbols on wrong OS.
26}26}
2727
28pub extern "c" fn kinfo_getfile(pid: pid_t, cntp: *c_int) ?[*]kinfo_file;28pub extern "c" fn kinfo_getfile(pid: pid_t, cntp: *c_int) ?[*]kinfo_file;
lib/std/zig/LibCDirs.zig-2
...@@ -232,7 +232,6 @@ fn libCGenericName(target: std.Target) [:0]const u8 {...@@ -232,7 +232,6 @@ fn libCGenericName(target: std.Target) [:0]const u8 {
232 .gnueabi,232 .gnueabi,
233 .gnueabihf,233 .gnueabihf,
234 .gnuf32,234 .gnuf32,
235 .gnuf64,
236 .gnusf,235 .gnusf,
237 .gnux32,236 .gnux32,
238 .gnuilp32,237 .gnuilp32,
...@@ -251,7 +250,6 @@ fn libCGenericName(target: std.Target) [:0]const u8 {...@@ -251,7 +250,6 @@ fn libCGenericName(target: std.Target) [:0]const u8 {
251 .msvc,250 .msvc,
252 .itanium,251 .itanium,
253 .cygnus,252 .cygnus,
254 .coreclr,
255 .simulator,253 .simulator,
256 .macabi,254 .macabi,
257 => unreachable,255 => unreachable,
src/Type.zig-2
...@@ -1651,7 +1651,6 @@ pub fn maxIntAlignment(target: std.Target, use_llvm: bool) u16 {...@@ -1651,7 +1651,6 @@ pub fn maxIntAlignment(target: std.Target, use_llvm: bool) u16 {
1651 .m68k,1651 .m68k,
1652 .tce,1652 .tce,
1653 .tcele,1653 .tcele,
1654 .le32,
1655 .amdil,1654 .amdil,
1656 .hsail,1655 .hsail,
1657 .spir,1656 .spir,
...@@ -1660,7 +1659,6 @@ pub fn maxIntAlignment(target: std.Target, use_llvm: bool) u16 {...@@ -1660,7 +1659,6 @@ pub fn maxIntAlignment(target: std.Target, use_llvm: bool) u16 {
1660 .spirv,1659 .spirv,
1661 .spirv32,1660 .spirv32,
1662 .shave,1661 .shave,
1663 .le64,
1664 .amdil64,1662 .amdil64,
1665 .hsail64,1663 .hsail64,
1666 .spir64,1664 .spir64,
src/Zcu.zig-2
...@@ -3241,7 +3241,6 @@ pub fn atomicPtrAlignment(...@@ -3241,7 +3241,6 @@ pub fn atomicPtrAlignment(
3241 .armeb,3241 .armeb,
3242 .hexagon,3242 .hexagon,
3243 .m68k,3243 .m68k,
3244 .le32,
3245 .mips,3244 .mips,
3246 .mipsel,3245 .mipsel,
3247 .nvptx,3246 .nvptx,
...@@ -3275,7 +3274,6 @@ pub fn atomicPtrAlignment(...@@ -3275,7 +3274,6 @@ pub fn atomicPtrAlignment(
3275 .amdgcn,3274 .amdgcn,
3276 .bpfel,3275 .bpfel,
3277 .bpfeb,3276 .bpfeb,
3278 .le64,
3279 .mips64,3277 .mips64,
3280 .mips64el,3278 .mips64el,
3281 .nvptx64,3279 .nvptx64,
src/codegen/llvm.zig-12
...@@ -83,8 +83,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -83,8 +83,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
83 .xtensa => "xtensa",83 .xtensa => "xtensa",
84 .nvptx => "nvptx",84 .nvptx => "nvptx",
85 .nvptx64 => "nvptx64",85 .nvptx64 => "nvptx64",
86 .le32 => "le32",
87 .le64 => "le64",
88 .amdil => "amdil",86 .amdil => "amdil",
89 .amdil64 => "amdil64",87 .amdil64 => "amdil64",
90 .hsail => "hsail",88 .hsail => "hsail",
...@@ -112,7 +110,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -112,7 +110,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
112 .dragonfly => "dragonfly",110 .dragonfly => "dragonfly",
113 .freebsd => "freebsd",111 .freebsd => "freebsd",
114 .fuchsia => "fuchsia",112 .fuchsia => "fuchsia",
115 .kfreebsd => "kfreebsd",
116 .linux => "linux",113 .linux => "linux",
117 .lv2 => "lv2",114 .lv2 => "lv2",
118 .netbsd => "netbsd",115 .netbsd => "netbsd",
...@@ -122,7 +119,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -122,7 +119,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
122 .zos => "zos",119 .zos => "zos",
123 .haiku => "haiku",120 .haiku => "haiku",
124 .rtems => "rtems",121 .rtems => "rtems",
125 .nacl => "nacl",
126 .aix => "aix",122 .aix => "aix",
127 .cuda => "cuda",123 .cuda => "cuda",
128 .nvcl => "nvcl",124 .nvcl => "nvcl",
...@@ -178,7 +174,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -178,7 +174,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
178 .gnueabi => "gnueabi",174 .gnueabi => "gnueabi",
179 .gnueabihf => "gnueabihf",175 .gnueabihf => "gnueabihf",
180 .gnuf32 => "gnuf32",176 .gnuf32 => "gnuf32",
181 .gnuf64 => "gnuf64",
182 .gnusf => "gnusf",177 .gnusf => "gnusf",
183 .gnux32 => "gnux32",178 .gnux32 => "gnux32",
184 .gnuilp32 => "gnuilp32",179 .gnuilp32 => "gnuilp32",
...@@ -193,7 +188,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {...@@ -193,7 +188,6 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
193 .msvc => "msvc",188 .msvc => "msvc",
194 .itanium => "itanium",189 .itanium => "itanium",
195 .cygnus => "cygnus",190 .cygnus => "cygnus",
196 .coreclr => "coreclr",
197 .simulator => "simulator",191 .simulator => "simulator",
198 .macabi => "macabi",192 .macabi => "macabi",
199 .pixel => "pixel",193 .pixel => "pixel",
...@@ -236,7 +230,6 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {...@@ -236,7 +230,6 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
236 .freebsd => .FreeBSD,230 .freebsd => .FreeBSD,
237 .fuchsia => .Fuchsia,231 .fuchsia => .Fuchsia,
238 .ios => .IOS,232 .ios => .IOS,
239 .kfreebsd => .KFreeBSD,
240 .linux => .Linux,233 .linux => .Linux,
241 .lv2 => .Lv2,234 .lv2 => .Lv2,
242 .macos => .MacOSX,235 .macos => .MacOSX,
...@@ -246,7 +239,6 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {...@@ -246,7 +239,6 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
246 .zos => .ZOS,239 .zos => .ZOS,
247 .haiku => .Haiku,240 .haiku => .Haiku,
248 .rtems => .RTEMS,241 .rtems => .RTEMS,
249 .nacl => .NaCl,
250 .aix => .AIX,242 .aix => .AIX,
251 .cuda => .CUDA,243 .cuda => .CUDA,
252 .nvcl => .NVCL,244 .nvcl => .NVCL,
...@@ -315,8 +307,6 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {...@@ -315,8 +307,6 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
315 .xtensa => .xtensa,307 .xtensa => .xtensa,
316 .nvptx => .nvptx,308 .nvptx => .nvptx,
317 .nvptx64 => .nvptx64,309 .nvptx64 => .nvptx64,
318 .le32 => .le32,
319 .le64 => .le64,
320 .amdil => .amdil,310 .amdil => .amdil,
321 .amdil64 => .amdil64,311 .amdil64 => .amdil64,
322 .hsail => .hsail,312 .hsail => .hsail,
...@@ -12104,8 +12094,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {...@@ -12104,8 +12094,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
12104 .tce,12094 .tce,
12105 .tcele,12095 .tcele,
12106 .r600,12096 .r600,
12107 .le32,
12108 .le64,
12109 .amdil,12097 .amdil,
12110 .amdil64,12098 .amdil64,
12111 .hsail,12099 .hsail,
src/target.zig-2
...@@ -153,8 +153,6 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {...@@ -153,8 +153,6 @@ pub fn hasLlvmSupport(target: std.Target, ofmt: std.Target.ObjectFormat) bool {
153 .xtensa,153 .xtensa,
154 .nvptx,154 .nvptx,
155 .nvptx64,155 .nvptx64,
156 .le32,
157 .le64,
158 .amdil,156 .amdil,
159 .amdil64,157 .amdil64,
160 .hsail,158 .hsail,