authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-26 05:45:38+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-27 07:35:38-07:00
logdba1bf935390ddb0184a4dc72245454de6c06fd2
treebd1d1477665e24af8d331ff2852bd23c0160ccea
parent9161923405d1048dd6932d933b14feeb1d7c2849

remove all Oracle Solaris support

There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.

38 files changed, 665 insertions(+), 764 deletions(-)

CMakeLists.txt+2-7
...@@ -738,17 +738,12 @@ string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" ZIG_HOST_TARGET_OS)...@@ -738,17 +738,12 @@ string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" ZIG_HOST_TARGET_OS)
738if(ZIG_HOST_TARGET_OS STREQUAL "darwin")738if(ZIG_HOST_TARGET_OS STREQUAL "darwin")
739 set(ZIG_HOST_TARGET_OS "macos")739 set(ZIG_HOST_TARGET_OS "macos")
740elseif(ZIG_HOST_TARGET_OS STREQUAL "sunos")740elseif(ZIG_HOST_TARGET_OS STREQUAL "sunos")
741 check_symbol_exists(__illumos__ "" ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO)741 set(ZIG_HOST_TARGET_OS "illumos")
742 if (ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO)
743 set(ZIG_HOST_TARGET_OS "illumos")
744 else()
745 set(ZIG_HOST_TARGET_OS "solaris")
746 endif()
747endif()742endif()
748743
749string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ZIG_HOST_TARGET_ARCH)744string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ZIG_HOST_TARGET_ARCH)
750if(ZIG_HOST_TARGET_ARCH MATCHES "^i[3-9]86$")745if(ZIG_HOST_TARGET_ARCH MATCHES "^i[3-9]86$")
751 if (ZIG_HOST_TARGET_OS MATCHES "(solaris|illumos)")746 if (ZIG_HOST_TARGET_OS STREQUAL "illumos")
752 set(ZIG_HOST_TARGET_ARCH "x86_64")747 set(ZIG_HOST_TARGET_ARCH "x86_64")
753 else()748 else()
754 set(ZIG_HOST_TARGET_ARCH "x86")749 set(ZIG_HOST_TARGET_ARCH "x86")
build.zig+1-1
...@@ -818,7 +818,7 @@ fn addCmakeCfgOptionsToExe(...@@ -818,7 +818,7 @@ fn addCmakeCfgOptionsToExe(
818 try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);818 try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
819 if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);819 if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
820 },820 },
821 .solaris, .illumos => {821 .illumos => {
822 try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);822 try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
823 try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);823 try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
824 },824 },
lib/compiler/aro/aro/Compilation.zig+4-4
...@@ -337,7 +337,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {...@@ -337,7 +337,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
337 .netbsd => try define(w, "__NetBSD__"),337 .netbsd => try define(w, "__NetBSD__"),
338 .openbsd => try define(w, "__OpenBSD__"),338 .openbsd => try define(w, "__OpenBSD__"),
339 .dragonfly => try define(w, "__DragonFly__"),339 .dragonfly => try define(w, "__DragonFly__"),
340 .solaris => try defineStd(w, "sun", is_gnu),340 .illumos => try defineStd(w, "sun", is_gnu),
341 .macos,341 .macos,
342 .tvos,342 .tvos,
343 .ios,343 .ios,
...@@ -361,7 +361,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {...@@ -361,7 +361,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
361 .linux,361 .linux,
362 .haiku,362 .haiku,
363 .hurd,363 .hurd,
364 .solaris,364 .illumos,
365 .aix,365 .aix,
366 .emscripten,366 .emscripten,
367 .ps4,367 .ps4,
...@@ -618,7 +618,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {...@@ -618,7 +618,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
618 try defineStd(w, "sparc", is_gnu);618 try defineStd(w, "sparc", is_gnu);
619 try define(w, "__sparc_v9__");619 try define(w, "__sparc_v9__");
620 try define(w, "__arch64__");620 try define(w, "__arch64__");
621 if (comp.target.os.tag != .solaris) {621 if (comp.target.os.tag != .illumos) {
622 try define(w, "__sparc64__");622 try define(w, "__sparc64__");
623 try define(w, "__sparc_v9__");623 try define(w, "__sparc_v9__");
624 try define(w, "__sparcv9__");624 try define(w, "__sparcv9__");
...@@ -626,7 +626,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {...@@ -626,7 +626,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
626 },626 },
627 .sparc => {627 .sparc => {
628 try defineStd(w, "sparc", is_gnu);628 try defineStd(w, "sparc", is_gnu);
629 if (comp.target.os.tag == .solaris) {629 if (comp.target.os.tag == .illumos) {
630 try define(w, "__sparcv8");630 try define(w, "__sparcv8");
631 }631 }
632 },632 },
lib/compiler/aro/aro/Toolchain.zig+4-4
...@@ -391,8 +391,8 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind {...@@ -391,8 +391,8 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind {
391 }391 }
392}392}
393393
394fn getAsNeededOption(is_solaris: bool, needed: bool) []const u8 {394fn getAsNeededOption(is_illumos: bool, needed: bool) []const u8 {
395 if (is_solaris) {395 if (is_illumos) {
396 return if (needed) "-zignore" else "-zrecord";396 return if (needed) "-zignore" else "-zrecord";
397 } else {397 } else {
398 return if (needed) "--as-needed" else "--no-as-needed";398 return if (needed) "--as-needed" else "--no-as-needed";
...@@ -412,7 +412,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi...@@ -412,7 +412,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi
412412
413 try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3);413 try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3);
414 if (as_needed) {414 if (as_needed) {
415 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, true));415 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, true));
416 }416 }
417 switch (unw) {417 switch (unw) {
418 .none => return,418 .none => return,
...@@ -435,7 +435,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi...@@ -435,7 +435,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi
435 }435 }
436436
437 if (as_needed) {437 if (as_needed) {
438 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, false));438 argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, false));
439 }439 }
440}440}
441441
lib/compiler/aro/aro/target.zig+6-7
...@@ -252,7 +252,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler {...@@ -252,7 +252,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler {
252 target.abi.isAndroid() or252 target.abi.isAndroid() or
253 target.os.tag.isBSD() or253 target.os.tag.isBSD() or
254 target.os.tag == .fuchsia or254 target.os.tag == .fuchsia or
255 target.os.tag == .solaris or255 target.os.tag == .illumos or
256 target.os.tag == .haiku or256 target.os.tag == .haiku or
257 target.cpu.arch == .hexagon)257 target.cpu.arch == .hexagon)
258 {258 {
...@@ -281,7 +281,7 @@ pub fn hasFloat128(target: std.Target) bool {...@@ -281,7 +281,7 @@ pub fn hasFloat128(target: std.Target) bool {
281 .haiku,281 .haiku,
282 .linux,282 .linux,
283 .openbsd,283 .openbsd,
284 .solaris,284 .illumos,
285 => target.cpu.arch.isX86(),285 => target.cpu.arch.isX86(),
286 else => false,286 else => false,
287 };287 };
...@@ -654,8 +654,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {...@@ -654,8 +654,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
654 .ps3 => "lv2",654 .ps3 => "lv2",
655 .netbsd => "netbsd",655 .netbsd => "netbsd",
656 .openbsd => "openbsd",656 .openbsd => "openbsd",
657 .solaris => "solaris",657 .illumos => "solaris",
658 .illumos => "illumos",
659 .windows => "windows",658 .windows => "windows",
660 .zos => "zos",659 .zos => "zos",
661 .haiku => "haiku",660 .haiku => "haiku",
...@@ -755,7 +754,7 @@ pub fn isPIEDefault(target: std.Target) DefaultPIStatus {...@@ -755,7 +754,7 @@ pub fn isPIEDefault(target: std.Target) DefaultPIStatus {
755 .dragonfly,754 .dragonfly,
756 .netbsd,755 .netbsd,
757 .freebsd,756 .freebsd,
758 .solaris,757 .illumos,
759758
760 .cuda,759 .cuda,
761 .amdhsa,760 .amdhsa,
...@@ -838,7 +837,7 @@ pub fn isPICdefault(target: std.Target) DefaultPIStatus {...@@ -838,7 +837,7 @@ pub fn isPICdefault(target: std.Target) DefaultPIStatus {
838 .openbsd,837 .openbsd,
839 .netbsd,838 .netbsd,
840 .freebsd,839 .freebsd,
841 .solaris,840 .illumos,
842 .hurd,841 .hurd,
843 => {842 => {
844 return switch (target.cpu.arch) {843 return switch (target.cpu.arch) {
...@@ -897,7 +896,7 @@ pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus {...@@ -897,7 +896,7 @@ pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus {
897 .openbsd,896 .openbsd,
898 .netbsd,897 .netbsd,
899 .freebsd,898 .freebsd,
900 .solaris,899 .illumos,
901 .cuda,900 .cuda,
902 .ps4,901 .ps4,
903 .ps5,902 .ps5,
lib/std/Progress.zig+1-1
...@@ -1547,7 +1547,7 @@ fn handleSigWinch(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopaque)...@@ -1547,7 +1547,7 @@ fn handleSigWinch(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopaque)
1547const have_sigwinch = switch (builtin.os.tag) {1547const have_sigwinch = switch (builtin.os.tag) {
1548 .linux,1548 .linux,
1549 .plan9,1549 .plan9,
1550 .solaris,1550 .illumos,
1551 .netbsd,1551 .netbsd,
1552 .openbsd,1552 .openbsd,
1553 .haiku,1553 .haiku,
lib/std/Target.zig+15-50
...@@ -27,6 +27,7 @@ pub const Os = struct {...@@ -27,6 +27,7 @@ pub const Os = struct {
27 aix,27 aix,
28 haiku,28 haiku,
29 hurd,29 hurd,
30 illumos,
30 linux,31 linux,
31 plan9,32 plan9,
32 rtems,33 rtems,
...@@ -45,9 +46,6 @@ pub const Os = struct {...@@ -45,9 +46,6 @@ pub const Os = struct {
45 visionos,46 visionos,
46 watchos,47 watchos,
4748
48 illumos,
49 solaris,
50
51 windows,49 windows,
52 uefi,50 uefi,
5351
...@@ -98,10 +96,6 @@ pub const Os = struct {...@@ -98,10 +96,6 @@ pub const Os = struct {
98 };96 };
99 }97 }
10098
101 pub inline fn isSolarish(tag: Tag) bool {
102 return tag == .solaris or tag == .illumos;
103 }
104
105 pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 {99 pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 {
106 return switch (tag) {100 return switch (tag) {
107 .windows => ".exe",101 .windows => ".exe",
...@@ -163,11 +157,10 @@ pub const Os = struct {...@@ -163,11 +157,10 @@ pub const Os = struct {
163 .managarm,157 .managarm,
164158
165 .haiku,159 .haiku,
160 .illumos,
166 .plan9,161 .plan9,
167 .serenity,162 .serenity,
168163
169 .illumos,
170
171 .ps3,164 .ps3,
172 .ps4,165 .ps4,
173 .ps5,166 .ps5,
...@@ -197,8 +190,6 @@ pub const Os = struct {...@@ -197,8 +190,6 @@ pub const Os = struct {
197 .visionos,190 .visionos,
198 .watchos,191 .watchos,
199192
200 .solaris,
201
202 .uefi,193 .uefi,
203194
204 .@"3ds",195 .@"3ds",
...@@ -395,11 +386,10 @@ pub const Os = struct {...@@ -395,11 +386,10 @@ pub const Os = struct {
395 .managarm,386 .managarm,
396387
397 .haiku,388 .haiku,
389 .illumos,
398 .plan9,390 .plan9,
399 .serenity,391 .serenity,
400392
401 .illumos,
402
403 .ps3,393 .ps3,
404 .ps4,394 .ps4,
405 .ps5,395 .ps5,
...@@ -597,13 +587,6 @@ pub const Os = struct {...@@ -597,13 +587,6 @@ pub const Os = struct {
597 },587 },
598 },588 },
599589
600 .solaris => .{
601 .semver = .{
602 .min = .{ .major = 11, .minor = 0, .patch = 0 },
603 .max = .{ .major = 11, .minor = 4, .patch = 0 },
604 },
605 },
606
607 .windows => .{590 .windows => .{
608 .windows = .{591 .windows = .{
609 .min = .win10,592 .min = .win10,
...@@ -930,6 +913,7 @@ pub const Abi = enum {...@@ -930,6 +913,7 @@ pub const Abi = enum {
930 .contiki,913 .contiki,
931 .fuchsia,914 .fuchsia,
932 .hermit,915 .hermit,
916 .illumos,
933 .managarm,917 .managarm,
934 .plan9,918 .plan9,
935 .serenity,919 .serenity,
...@@ -937,8 +921,6 @@ pub const Abi = enum {...@@ -937,8 +921,6 @@ pub const Abi = enum {
937 .dragonfly,921 .dragonfly,
938 .driverkit,922 .driverkit,
939 .macos,923 .macos,
940 .illumos,
941 .solaris,
942 .ps3,924 .ps3,
943 .ps4,925 .ps4,
944 .ps5,926 .ps5,
...@@ -2043,10 +2025,6 @@ pub const Cpu = struct {...@@ -2043,10 +2025,6 @@ pub const Cpu = struct {
2043 else => &s390x.cpu.arch8,2025 else => &s390x.cpu.arch8,
2044 },2026 },
2045 .sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8.2027 .sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8.
2046 .sparc64 => switch (os.tag) {
2047 .solaris => &sparc.cpu.ultrasparc3,
2048 else => generic(arch),
2049 },
2050 .x86 => &x86.cpu.pentium4,2028 .x86 => &x86.cpu.pentium4,
2051 .x86_64 => switch (os.tag) {2029 .x86_64 => switch (os.tag) {
2052 .driverkit => &x86.cpu.nehalem,2030 .driverkit => &x86.cpu.nehalem,
...@@ -2175,6 +2153,7 @@ pub inline fn isWasiLibC(target: *const Target) bool {...@@ -2175,6 +2153,7 @@ pub inline fn isWasiLibC(target: *const Target) bool {
2175pub fn requiresLibC(target: *const Target) bool {2153pub fn requiresLibC(target: *const Target) bool {
2176 return switch (target.os.tag) {2154 return switch (target.os.tag) {
2177 .aix,2155 .aix,
2156 .illumos,
2178 .driverkit,2157 .driverkit,
2179 .macos,2158 .macos,
2180 .ios,2159 .ios,
...@@ -2184,8 +2163,6 @@ pub fn requiresLibC(target: *const Target) bool {...@@ -2184,8 +2163,6 @@ pub fn requiresLibC(target: *const Target) bool {
2184 .dragonfly,2163 .dragonfly,
2185 .openbsd,2164 .openbsd,
2186 .haiku,2165 .haiku,
2187 .solaris,
2188 .illumos,
2189 .serenity,2166 .serenity,
2190 => true,2167 => true,
21912168
...@@ -2332,6 +2309,7 @@ pub const DynamicLinker = struct {...@@ -2332,6 +2309,7 @@ pub const DynamicLinker = struct {
2332 .fuchsia,2309 .fuchsia,
23332310
2334 .haiku,2311 .haiku,
2312 .illumos,
2335 .serenity,2313 .serenity,
23362314
2337 .dragonfly,2315 .dragonfly,
...@@ -2345,9 +2323,6 @@ pub const DynamicLinker = struct {...@@ -2345,9 +2323,6 @@ pub const DynamicLinker = struct {
2345 .tvos,2323 .tvos,
2346 .visionos,2324 .visionos,
2347 .watchos,2325 .watchos,
2348
2349 .illumos,
2350 .solaris,
2351 => .arch_os,2326 => .arch_os,
2352 .hurd,2327 .hurd,
2353 .linux,2328 .linux,
...@@ -2439,6 +2414,14 @@ pub const DynamicLinker = struct {...@@ -2439,6 +2414,14 @@ pub const DynamicLinker = struct {
2439 else => none,2414 else => none,
2440 },2415 },
24412416
2417 .illumos,
2418 => switch (cpu.arch) {
2419 .x86,
2420 .x86_64,
2421 => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}),
2422 else => none,
2423 },
2424
2442 .linux => if (abi.isAndroid())2425 .linux => if (abi.isAndroid())
2443 switch (cpu.arch) {2426 switch (cpu.arch) {
2444 .arm => if (abi == .androideabi) init("/system/bin/linker") else none,2427 .arm => if (abi == .androideabi) init("/system/bin/linker") else none,
...@@ -2755,22 +2738,6 @@ pub const DynamicLinker = struct {...@@ -2755,22 +2738,6 @@ pub const DynamicLinker = struct {
2755 else => none,2738 else => none,
2756 },2739 },
27572740
2758 .illumos,
2759 => switch (cpu.arch) {
2760 .x86,
2761 .x86_64,
2762 => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}),
2763 else => none,
2764 },
2765
2766 .solaris,
2767 => switch (cpu.arch) {
2768 .sparc64,
2769 .x86_64,
2770 => initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}),
2771 else => none,
2772 },
2773
2774 // Operating systems in this list have been verified as not having a standard2741 // Operating systems in this list have been verified as not having a standard
2775 // dynamic linker path.2742 // dynamic linker path.
2776 .freestanding,2743 .freestanding,
...@@ -3134,6 +3101,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3134,6 +3101,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3134 .aix,3101 .aix,
3135 .haiku,3102 .haiku,
3136 .hurd,3103 .hurd,
3104 .illumos,
3137 .linux,3105 .linux,
3138 .plan9,3106 .plan9,
3139 .rtems,3107 .rtems,
...@@ -3145,9 +3113,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {...@@ -3145,9 +3113,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
3145 .netbsd,3113 .netbsd,
3146 .openbsd,3114 .openbsd,
31473115
3148 .illumos,
3149 .solaris,
3150
3151 .wasi,3116 .wasi,
3152 .emscripten,3117 .emscripten,
3153 => switch (target.cpu.arch) {3118 => switch (target.cpu.arch) {
lib/std/Thread.zig+5-5
...@@ -120,7 +120,7 @@ pub const max_name_len = switch (native_os) {...@@ -120,7 +120,7 @@ pub const max_name_len = switch (native_os) {
120 .freebsd => 15,120 .freebsd => 15,
121 .openbsd => 23,121 .openbsd => 23,
122 .dragonfly => 1023,122 .dragonfly => 1023,
123 .solaris, .illumos => 31,123 .illumos => 31,
124 // https://github.com/SerenityOS/serenity/blob/6b4c300353da49d3508b5442cf61da70bd04d757/Kernel/Tasks/Thread.h#L102124 // https://github.com/SerenityOS/serenity/blob/6b4c300353da49d3508b5442cf61da70bd04d757/Kernel/Tasks/Thread.h#L102
125 .serenity => 63,125 .serenity => 63,
126 else => 0,126 else => 0,
...@@ -211,7 +211,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void {...@@ -211,7 +211,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void {
211 else => |e| return posix.unexpectedErrno(e),211 else => |e| return posix.unexpectedErrno(e),
212 }212 }
213 },213 },
214 .netbsd, .solaris, .illumos => if (use_pthreads) {214 .netbsd, .illumos => if (use_pthreads) {
215 const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null);215 const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null);
216 switch (@as(posix.E, @enumFromInt(err))) {216 switch (@as(posix.E, @enumFromInt(err))) {
217 .SUCCESS => return,217 .SUCCESS => return,
...@@ -324,7 +324,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co...@@ -324,7 +324,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co
324 else => |e| return posix.unexpectedErrno(e),324 else => |e| return posix.unexpectedErrno(e),
325 }325 }
326 },326 },
327 .netbsd, .solaris, .illumos => if (use_pthreads) {327 .netbsd, .illumos => if (use_pthreads) {
328 const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1);328 const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1);
329 switch (@as(posix.E, @enumFromInt(err))) {329 switch (@as(posix.E, @enumFromInt(err))) {
330 .SUCCESS => return std.mem.sliceTo(buffer, 0),330 .SUCCESS => return std.mem.sliceTo(buffer, 0),
...@@ -739,10 +739,10 @@ const PosixThreadImpl = struct {...@@ -739,10 +739,10 @@ const PosixThreadImpl = struct {
739 };739 };
740 return @as(usize, @intCast(count));740 return @as(usize, @intCast(count));
741 },741 },
742 .solaris, .illumos, .serenity => {742 .illumos, .serenity => {
743 // The "proper" way to get the cpu count would be to query743 // The "proper" way to get the cpu count would be to query
744 // /dev/kstat via ioctls, and traverse a linked list for each744 // /dev/kstat via ioctls, and traverse a linked list for each
745 // cpu. (solaris, illumos)745 // cpu. (illumos)
746 const rc = c.sysconf(@intFromEnum(std.c._SC.NPROCESSORS_ONLN));746 const rc = c.sysconf(@intFromEnum(std.c._SC.NPROCESSORS_ONLN));
747 return switch (posix.errno(rc)) {747 return switch (posix.errno(rc)) {
748 .SUCCESS => @as(usize, @intCast(rc)),748 .SUCCESS => @as(usize, @intCast(rc)),
lib/std/c.zig+129-140
...@@ -14,7 +14,7 @@ const windows = std.os.windows;...@@ -14,7 +14,7 @@ const windows = std.os.windows;
14const ws2_32 = std.os.windows.ws2_32;14const ws2_32 = std.os.windows.ws2_32;
15const darwin = @import("c/darwin.zig");15const darwin = @import("c/darwin.zig");
16const freebsd = @import("c/freebsd.zig");16const freebsd = @import("c/freebsd.zig");
17const solaris = @import("c/solaris.zig");17const illumos = @import("c/illumos.zig");
18const netbsd = @import("c/netbsd.zig");18const netbsd = @import("c/netbsd.zig");
19const dragonfly = @import("c/dragonfly.zig");19const dragonfly = @import("c/dragonfly.zig");
20const haiku = @import("c/haiku.zig");20const haiku = @import("c/haiku.zig");
...@@ -117,7 +117,7 @@ pub const timespec = switch (native_os) {...@@ -117,7 +117,7 @@ pub const timespec = switch (native_os) {
117 sec: isize,117 sec: isize,
118 nsec: isize,118 nsec: isize,
119 },119 },
120 .netbsd, .solaris, .illumos => extern struct {120 .netbsd, .illumos => extern struct {
121 sec: i64,121 sec: i64,
122 nsec: isize,122 nsec: isize,
123 },123 },
...@@ -132,7 +132,7 @@ pub const dev_t = switch (native_os) {...@@ -132,7 +132,7 @@ pub const dev_t = switch (native_os) {
132 .linux => linux.dev_t,132 .linux => linux.dev_t,
133 .emscripten => emscripten.dev_t,133 .emscripten => emscripten.dev_t,
134 .wasi => wasi.device_t,134 .wasi => wasi.device_t,
135 .openbsd, .haiku, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32,135 .openbsd, .haiku, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32,
136 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L43136 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L43
137 .netbsd, .freebsd, .serenity => u64,137 .netbsd, .freebsd, .serenity => u64,
138 else => void,138 else => void,
...@@ -141,7 +141,7 @@ pub const dev_t = switch (native_os) {...@@ -141,7 +141,7 @@ pub const dev_t = switch (native_os) {
141pub const mode_t = switch (native_os) {141pub const mode_t = switch (native_os) {
142 .linux => linux.mode_t,142 .linux => linux.mode_t,
143 .emscripten => emscripten.mode_t,143 .emscripten => emscripten.mode_t,
144 .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi, .windows => u32,144 .openbsd, .haiku, .netbsd, .illumos, .wasi, .windows => u32,
145 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L44145 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L44
146 .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly, .serenity => u16,146 .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly, .serenity => u16,
147 else => u0,147 else => u0,
...@@ -153,7 +153,7 @@ pub const nlink_t = switch (native_os) {...@@ -153,7 +153,7 @@ pub const nlink_t = switch (native_os) {
153 .wasi => c_ulonglong,153 .wasi => c_ulonglong,
154 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L45154 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L45
155 .freebsd, .serenity => u64,155 .freebsd, .serenity => u64,
156 .openbsd, .netbsd, .solaris, .illumos => u32,156 .openbsd, .netbsd, .illumos => u32,
157 .haiku => i32,157 .haiku => i32,
158 else => void,158 else => void,
159};159};
...@@ -310,7 +310,7 @@ pub const clockid_t = switch (native_os) {...@@ -310,7 +310,7 @@ pub const clockid_t = switch (native_os) {
310 THREAD_CPUTIME_ID = 14,310 THREAD_CPUTIME_ID = 14,
311 PROCESS_CPUTIME_ID = 15,311 PROCESS_CPUTIME_ID = 15,
312 },312 },
313 .solaris, .illumos => enum(u32) {313 .illumos => enum(u32) {
314 VIRTUAL = 1,314 VIRTUAL = 1,
315 THREAD_CPUTIME_ID = 2,315 THREAD_CPUTIME_ID = 2,
316 REALTIME = 3,316 REALTIME = 3,
...@@ -457,7 +457,7 @@ pub const E = switch (native_os) {...@@ -457,7 +457,7 @@ pub const E = switch (native_os) {
457 },457 },
458 .macos, .ios, .tvos, .watchos, .visionos => darwin.E,458 .macos, .ios, .tvos, .watchos, .visionos => darwin.E,
459 .freebsd => freebsd.E,459 .freebsd => freebsd.E,
460 .solaris, .illumos => enum(u16) {460 .illumos => enum(u16) {
461 /// No error occurred.461 /// No error occurred.
462 SUCCESS = 0,462 SUCCESS = 0,
463 /// Not super-user463 /// Not super-user
...@@ -1002,7 +1002,7 @@ pub const F = switch (native_os) {...@@ -1002,7 +1002,7 @@ pub const F = switch (native_os) {
10021002
1003 pub const GETOWNER_UIDS = 17;1003 pub const GETOWNER_UIDS = 17;
1004 },1004 },
1005 .solaris, .illumos => struct {1005 .illumos => struct {
1006 /// Unlock a previously locked region1006 /// Unlock a previously locked region
1007 pub const ULOCK = 0;1007 pub const ULOCK = 0;
1008 /// Lock a region for exclusive use1008 /// Lock a region for exclusive use
...@@ -1263,7 +1263,7 @@ pub const Flock = switch (native_os) {...@@ -1263,7 +1263,7 @@ pub const Flock = switch (native_os) {
1263 /// Remote system id or zero for local.1263 /// Remote system id or zero for local.
1264 sysid: i32,1264 sysid: i32,
1265 },1265 },
1266 .solaris, .illumos => extern struct {1266 .illumos => extern struct {
1267 type: c_short,1267 type: c_short,
1268 whence: c_short,1268 whence: c_short,
1269 start: off_t,1269 start: off_t,
...@@ -1293,7 +1293,7 @@ pub const Flock = switch (native_os) {...@@ -1293,7 +1293,7 @@ pub const Flock = switch (native_os) {
1293pub const HOST_NAME_MAX = switch (native_os) {1293pub const HOST_NAME_MAX = switch (native_os) {
1294 .linux => linux.HOST_NAME_MAX,1294 .linux => linux.HOST_NAME_MAX,
1295 .macos, .ios, .tvos, .watchos, .visionos => 72,1295 .macos, .ios, .tvos, .watchos, .visionos => 72,
1296 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => 255,1296 .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => 255,
1297 // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L221297 // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L22
1298 .serenity => 64,1298 .serenity => 64,
1299 else => {},1299 else => {},
...@@ -1302,7 +1302,7 @@ pub const IOV_MAX = switch (native_os) {...@@ -1302,7 +1302,7 @@ pub const IOV_MAX = switch (native_os) {
1302 .linux => linux.IOV_MAX,1302 .linux => linux.IOV_MAX,
1303 .emscripten => emscripten.IOV_MAX,1303 .emscripten => emscripten.IOV_MAX,
1304 // https://github.com/SerenityOS/serenity/blob/098af0f846a87b651731780ff48420205fd33754/Kernel/API/POSIX/sys/uio.h#L161304 // https://github.com/SerenityOS/serenity/blob/098af0f846a87b651731780ff48420205fd33754/Kernel/API/POSIX/sys/uio.h#L16
1305 .openbsd, .haiku, .solaris, .illumos, .wasi, .serenity => 1024,1305 .openbsd, .haiku, .illumos, .wasi, .serenity => 1024,
1306 .macos, .ios, .tvos, .watchos, .visionos => 16,1306 .macos, .ios, .tvos, .watchos, .visionos => 16,
1307 .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,1307 .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,
1308 else => {},1308 else => {},
...@@ -1549,7 +1549,7 @@ pub const MADV = switch (native_os) {...@@ -1549,7 +1549,7 @@ pub const MADV = switch (native_os) {
1549 pub const CORE = 9;1549 pub const CORE = 9;
1550 pub const PROTECT = 10;1550 pub const PROTECT = 10;
1551 },1551 },
1552 .solaris, .illumos => struct {1552 .illumos => struct {
1553 /// no further special treatment1553 /// no further special treatment
1554 pub const NORMAL = 0;1554 pub const NORMAL = 0;
1555 /// expect random page references1555 /// expect random page references
...@@ -1605,9 +1605,8 @@ pub const MCL = switch (native_os) {...@@ -1605,9 +1605,8 @@ pub const MCL = switch (native_os) {
1605 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/088552723935447397400336f5ddb7aa5f5de660/sys/sys/mman.h#L1181605 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/088552723935447397400336f5ddb7aa5f5de660/sys/sys/mman.h#L118
1606 // https://github.com/NetBSD/src/blob/fd2741deca927c18e3ba15acdf78b8b14b2abe36/sys/sys/mman.h#L1791606 // https://github.com/NetBSD/src/blob/fd2741deca927c18e3ba15acdf78b8b14b2abe36/sys/sys/mman.h#L179
1607 // https://github.com/openbsd/src/blob/39404228f6d36c0ca4be5f04ab5385568ebd6aa3/sys/sys/mman.h#L1291607 // https://github.com/openbsd/src/blob/39404228f6d36c0ca4be5f04ab5385568ebd6aa3/sys/sys/mman.h#L129
1608 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/mman.h#L379
1609 // https://github.com/illumos/illumos-gate/blob/5280477614f83fea20fc938729df6adb3e44340d/usr/src/uts/common/sys/mman.h#L3431608 // https://github.com/illumos/illumos-gate/blob/5280477614f83fea20fc938729df6adb3e44340d/usr/src/uts/common/sys/mman.h#L343
1610 .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => packed struct(c_int) {1609 .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => packed struct(c_int) {
1611 CURRENT: bool = 0,1610 CURRENT: bool = 0,
1612 FUTURE: bool = 0,1611 FUTURE: bool = 0,
1613 _: std.meta.Int(.unsigned, @bitSizeOf(c_int) - 2) = 0,1612 _: std.meta.Int(.unsigned, @bitSizeOf(c_int) - 2) = 0,
...@@ -1630,7 +1629,7 @@ pub const MSF = switch (native_os) {...@@ -1630,7 +1629,7 @@ pub const MSF = switch (native_os) {
1630 pub const DEACTIVATE = 0x8;1629 pub const DEACTIVATE = 0x8;
1631 pub const SYNC = 0x10;1630 pub const SYNC = 0x10;
1632 },1631 },
1633 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => struct {1632 .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd => struct {
1634 pub const ASYNC = 1;1633 pub const ASYNC = 1;
1635 pub const INVALIDATE = 2;1634 pub const INVALIDATE = 2;
1636 pub const SYNC = 4;1635 pub const SYNC = 4;
...@@ -1650,7 +1649,7 @@ pub const NAME_MAX = switch (native_os) {...@@ -1650,7 +1649,7 @@ pub const NAME_MAX = switch (native_os) {
1650 // character, but POSIX definition says that NAME_MAX does not include the1649 // character, but POSIX definition says that NAME_MAX does not include the
1651 // terminating null.1650 // terminating null.
1652 // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L201651 // https://github.com/SerenityOS/serenity/blob/c87557e9c1865fa1a6440de34ff6ce6fc858a2b7/Kernel/API/POSIX/sys/limits.h#L20
1653 .haiku, .openbsd, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 255,1652 .haiku, .openbsd, .dragonfly, .netbsd, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 255,
1654 else => {},1653 else => {},
1655};1654};
1656pub const PATH_MAX = switch (native_os) {1655pub const PATH_MAX = switch (native_os) {
...@@ -1658,7 +1657,7 @@ pub const PATH_MAX = switch (native_os) {...@@ -1658,7 +1657,7 @@ pub const PATH_MAX = switch (native_os) {
1658 .emscripten => emscripten.PATH_MAX,1657 .emscripten => emscripten.PATH_MAX,
1659 .wasi => 4096,1658 .wasi => 4096,
1660 .windows => 260,1659 .windows => 260,
1661 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 1024,1660 .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 1024,
1662 else => {},1661 else => {},
1663};1662};
16641663
...@@ -1721,7 +1720,7 @@ pub const POLL = switch (native_os) {...@@ -1721,7 +1720,7 @@ pub const POLL = switch (native_os) {
17211720
1722 pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;1721 pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
1723 },1722 },
1724 .solaris, .illumos => struct {1723 .illumos => struct {
1725 pub const IN = 0x0001;1724 pub const IN = 0x0001;
1726 pub const PRI = 0x0002;1725 pub const PRI = 0x0002;
1727 pub const OUT = 0x0004;1726 pub const OUT = 0x0004;
...@@ -1812,7 +1811,7 @@ pub const PROT = switch (native_os) {...@@ -1812,7 +1811,7 @@ pub const PROT = switch (native_os) {
1812 .linux => linux.PROT,1811 .linux => linux.PROT,
1813 .emscripten => emscripten.PROT,1812 .emscripten => emscripten.PROT,
1814 // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L28-L311813 // https://github.com/SerenityOS/serenity/blob/6d59d4d3d9e76e39112842ec487840828f1c9bfe/Kernel/API/POSIX/sys/mman.h#L28-L31
1815 .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .windows, .serenity => struct {1814 .openbsd, .haiku, .dragonfly, .netbsd, .illumos, .freebsd, .windows, .serenity => struct {
1816 /// page can not be accessed1815 /// page can not be accessed
1817 pub const NONE = 0x0;1816 pub const NONE = 0x0;
1818 /// page can be read1817 /// page can be read
...@@ -1852,7 +1851,7 @@ pub const RLIM = switch (native_os) {...@@ -1852,7 +1851,7 @@ pub const RLIM = switch (native_os) {
1852 pub const SAVED_MAX = INFINITY;1851 pub const SAVED_MAX = INFINITY;
1853 pub const SAVED_CUR = INFINITY;1852 pub const SAVED_CUR = INFINITY;
1854 },1853 },
1855 .solaris, .illumos => struct {1854 .illumos => struct {
1856 /// No limit1855 /// No limit
1857 pub const INFINITY: rlim_t = (1 << 63) - 3;1856 pub const INFINITY: rlim_t = (1 << 63) - 3;
1858 pub const SAVED_MAX: rlim_t = (1 << 63) - 2;1857 pub const SAVED_MAX: rlim_t = (1 << 63) - 2;
...@@ -2022,7 +2021,7 @@ pub const S = switch (native_os) {...@@ -2022,7 +2021,7 @@ pub const S = switch (native_os) {
2022 return m & IFMT == IFWHT;2021 return m & IFMT == IFWHT;
2023 }2022 }
2024 },2023 },
2025 .solaris, .illumos => struct {2024 .illumos => struct {
2026 pub const IFMT = 0o170000;2025 pub const IFMT = 0o170000;
20272026
2028 pub const IFIFO = 0o010000;2027 pub const IFIFO = 0o010000;
...@@ -2424,7 +2423,7 @@ pub const SA = switch (native_os) {...@@ -2424,7 +2423,7 @@ pub const SA = switch (native_os) {
2424 pub const NOCLDWAIT = 0x0020;2423 pub const NOCLDWAIT = 0x0020;
2425 pub const SIGINFO = 0x0040;2424 pub const SIGINFO = 0x0040;
2426 },2425 },
2427 .solaris, .illumos => struct {2426 .illumos => struct {
2428 pub const ONSTACK = 0x00000001;2427 pub const ONSTACK = 0x00000001;
2429 pub const RESETHAND = 0x00000002;2428 pub const RESETHAND = 0x00000002;
2430 pub const RESTART = 0x00000004;2429 pub const RESTART = 0x00000004;
...@@ -2485,7 +2484,7 @@ pub const SA = switch (native_os) {...@@ -2485,7 +2484,7 @@ pub const SA = switch (native_os) {
2485 else => void,2484 else => void,
2486};2485};
2487pub const sigval_t = switch (native_os) {2486pub const sigval_t = switch (native_os) {
2488 .netbsd, .solaris, .illumos => extern union {2487 .netbsd, .illumos => extern union {
2489 int: i32,2488 int: i32,
2490 ptr: ?*anyopaque,2489 ptr: ?*anyopaque,
2491 },2490 },
...@@ -2525,7 +2524,7 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {...@@ -2525,7 +2524,7 @@ pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
2525 .openbsd => enum(c_int) {2524 .openbsd => enum(c_int) {
2526 PAGESIZE = 28,2525 PAGESIZE = 28,
2527 },2526 },
2528 .solaris, .illumos => enum(c_int) {2527 .illumos => enum(c_int) {
2529 PAGESIZE = 11,2528 PAGESIZE = 11,
2530 NPROCESSORS_ONLN = 15,2529 NPROCESSORS_ONLN = 15,
2531 SIGRT_MIN = 40,2530 SIGRT_MIN = 40,
...@@ -2566,7 +2565,7 @@ pub const SEEK = switch (native_os) {...@@ -2566,7 +2565,7 @@ pub const SEEK = switch (native_os) {
2566 pub const CUR = 1;2565 pub const CUR = 1;
2567 pub const END = 2;2566 pub const END = 2;
2568 },2567 },
2569 .dragonfly, .solaris, .illumos => struct {2568 .dragonfly, .illumos => struct {
2570 pub const SET = 0;2569 pub const SET = 0;
2571 pub const CUR = 1;2570 pub const CUR = 1;
2572 pub const END = 2;2571 pub const END = 2;
...@@ -2765,7 +2764,7 @@ pub const SIG = switch (native_os) {...@@ -2765,7 +2764,7 @@ pub const SIG = switch (native_os) {
2765 return sig <= MAXSIG and sig > 0;2764 return sig <= MAXSIG and sig > 0;
2766 }2765 }
2767 },2766 },
2768 .solaris, .illumos => struct {2767 .illumos => struct {
2769 pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);2768 pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
2770 pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));2769 pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
2771 pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);2770 pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
...@@ -3089,7 +3088,7 @@ pub const SIG = switch (native_os) {...@@ -3089,7 +3088,7 @@ pub const SIG = switch (native_os) {
3089pub const SIOCGIFINDEX = switch (native_os) {3088pub const SIOCGIFINDEX = switch (native_os) {
3090 .linux => linux.SIOCGIFINDEX,3089 .linux => linux.SIOCGIFINDEX,
3091 .emscripten => emscripten.SIOCGIFINDEX,3090 .emscripten => emscripten.SIOCGIFINDEX,
3092 .solaris, .illumos => solaris.SIOCGLIFINDEX,3091 .illumos => illumos.SIOCGLIFINDEX,
3093 // https://github.com/SerenityOS/serenity/blob/cb10f70394fb7e9cfc77f827adb2e46d199bc3a5/Kernel/API/Ioctl.h#L1183092 // https://github.com/SerenityOS/serenity/blob/cb10f70394fb7e9cfc77f827adb2e46d199bc3a5/Kernel/API/Ioctl.h#L118
3094 .serenity => 34,3093 .serenity => 34,
3095 else => void,3094 else => void,
...@@ -3204,7 +3203,7 @@ pub const Sigaction = switch (native_os) {...@@ -3204,7 +3203,7 @@ pub const Sigaction = switch (native_os) {
3204 /// signal mask to apply3203 /// signal mask to apply
3205 mask: sigset_t,3204 mask: sigset_t,
3206 },3205 },
3207 .solaris, .illumos => extern struct {3206 .illumos => extern struct {
3208 pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;3207 pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
3209 pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;3208 pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;
32103209
...@@ -3301,7 +3300,7 @@ pub const T = switch (native_os) {...@@ -3301,7 +3300,7 @@ pub const T = switch (native_os) {
3301 pub const IOCGPTN = 0x4004740f;3300 pub const IOCGPTN = 0x4004740f;
3302 pub const IOCSIG = 0x2004745f;3301 pub const IOCSIG = 0x2004745f;
3303 },3302 },
3304 .solaris, .illumos => struct {3303 .illumos => struct {
3305 pub const CGETA = tioc('T', 1);3304 pub const CGETA = tioc('T', 1);
3306 pub const CSETA = tioc('T', 2);3305 pub const CSETA = tioc('T', 2);
3307 pub const CSETAW = tioc('T', 3);3306 pub const CSETAW = tioc('T', 3);
...@@ -3731,7 +3730,7 @@ pub const W = switch (native_os) {...@@ -3731,7 +3730,7 @@ pub const W = switch (native_os) {
3731 return (s & 0xffff) -% 1 < 0xff;3730 return (s & 0xffff) -% 1 < 0xff;
3732 }3731 }
3733 },3732 },
3734 .solaris, .illumos => struct {3733 .illumos => struct {
3735 pub const EXITED = 0o001;3734 pub const EXITED = 0o001;
3736 pub const TRAPPED = 0o002;3735 pub const TRAPPED = 0o002;
3737 pub const UNTRACED = 0o004;3736 pub const UNTRACED = 0o004;
...@@ -3944,7 +3943,7 @@ pub const clock_t = switch (native_os) {...@@ -3944,7 +3943,7 @@ pub const clock_t = switch (native_os) {
3944 .emscripten => emscripten.clock_t,3943 .emscripten => emscripten.clock_t,
3945 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,3944 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
3946 .freebsd => isize,3945 .freebsd => isize,
3947 .openbsd, .solaris, .illumos => i64,3946 .openbsd, .illumos => i64,
3948 .netbsd => u32,3947 .netbsd => u32,
3949 .haiku => i32,3948 .haiku => i32,
3950 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L503949 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L50
...@@ -3975,7 +3974,7 @@ pub const dl_phdr_info = switch (native_os) {...@@ -3975,7 +3974,7 @@ pub const dl_phdr_info = switch (native_os) {
3975 tls_modid: usize,3974 tls_modid: usize,
3976 tls_data: ?*anyopaque,3975 tls_data: ?*anyopaque,
3977 },3976 },
3978 .solaris, .illumos => extern struct {3977 .illumos => extern struct {
3979 addr: std.elf.Addr,3978 addr: std.elf.Addr,
3980 name: ?[*:0]const u8,3979 name: ?[*:0]const u8,
3981 phdr: [*]std.elf.Phdr,3980 phdr: [*]std.elf.Phdr,
...@@ -4001,7 +4000,7 @@ pub const epoll_event = switch (native_os) {...@@ -4001,7 +4000,7 @@ pub const epoll_event = switch (native_os) {
4001pub const ifreq = switch (native_os) {4000pub const ifreq = switch (native_os) {
4002 .linux => linux.ifreq,4001 .linux => linux.ifreq,
4003 .emscripten => emscripten.ifreq,4002 .emscripten => emscripten.ifreq,
4004 .solaris, .illumos => lifreq,4003 .illumos => lifreq,
4005 // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L49-L824004 // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L49-L82
4006 .serenity => extern struct {4005 .serenity => extern struct {
4007 // Not actually in a union, but the stdlib expects one for ifreq4006 // Not actually in a union, but the stdlib expects one for ifreq
...@@ -4026,10 +4025,9 @@ pub const ifreq = switch (native_os) {...@@ -4026,10 +4025,9 @@ pub const ifreq = switch (native_os) {
4026};4025};
4027pub const in_pktinfo = switch (native_os) {4026pub const in_pktinfo = switch (native_os) {
4028 .linux => linux.in_pktinfo,4027 .linux => linux.in_pktinfo,
4029 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/netinet/in.h#L1084
4030 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L11324028 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1132
4031 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet/in.h#L6964029 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet/in.h#L696
4032 .solaris, .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos => extern struct {4030 .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos => extern struct {
4033 ifindex: u32,4031 ifindex: u32,
4034 spec_dst: u32,4032 spec_dst: u32,
4035 addr: u32,4033 addr: u32,
...@@ -4042,12 +4040,11 @@ pub const in6_pktinfo = switch (native_os) {...@@ -4042,12 +4040,11 @@ pub const in6_pktinfo = switch (native_os) {
4042 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/netinet6/in6.h#L5754040 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/netinet6/in6.h#L575
4043 // https://github.com/NetBSD/src/blob/80bf25a5691072d4755e84567ccbdf0729370dea/sys/netinet6/in6.h#L4684041 // https://github.com/NetBSD/src/blob/80bf25a5691072d4755e84567ccbdf0729370dea/sys/netinet6/in6.h#L468
4044 // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/netinet6/in6.h#L3654042 // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/netinet6/in6.h#L365
4045 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/netinet/in.h#L1093
4046 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L114IP14043 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L114IP1
4047 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet6/in6.h#L7374044 // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet6/in6.h#L737
4048 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/netinet6/in6.h#L634045 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/netinet6/in6.h#L63
4049 // https://github.com/SerenityOS/serenity/blob/5bd8af99be0bc4b2e14f361fd7d7590e6bcfa4d6/Kernel/API/POSIX/sys/socket.h#L1224046 // https://github.com/SerenityOS/serenity/blob/5bd8af99be0bc4b2e14f361fd7d7590e6bcfa4d6/Kernel/API/POSIX/sys/socket.h#L122
4050 .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos, .haiku, .serenity => extern struct {4047 .freebsd, .dragonfly, .netbsd, .openbsd, .illumos, .driverkit, .ios, .macos, .tvos, .watchos, .visionos, .haiku, .serenity => extern struct {
4051 addr: [16]u8,4048 addr: [16]u8,
4052 ifindex: u32,4049 ifindex: u32,
4053 },4050 },
...@@ -4071,8 +4068,6 @@ pub const linger = switch (native_os) {...@@ -4071,8 +4068,6 @@ pub const linger = switch (native_os) {
4071 .netbsd,4068 .netbsd,
4072 // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/sys/socket.h#L1264069 // https://github.com/openbsd/src/blob/718a31b40d39fc6064de6355eb144e74633133fc/sys/sys/socket.h#L126
4073 .openbsd,4070 .openbsd,
4074 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L214
4075 .solaris,
4076 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/sys/socket.h#L2504071 // https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/sys/socket.h#L250
4077 .illumos,4072 .illumos,
4078 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/sys/socket.h#L874073 // https://github.com/haiku/haiku/blob/2aab5f5f14aeb3f34c3a3d9a9064cc3c0d914bea/headers/posix/sys/socket.h#L87
...@@ -4100,7 +4095,6 @@ pub const msghdr = switch (native_os) {...@@ -4100,7 +4095,6 @@ pub const msghdr = switch (native_os) {
4100 .freebsd,4095 .freebsd,
4101 .netbsd,4096 .netbsd,
4102 .haiku,4097 .haiku,
4103 .solaris,
4104 .illumos,4098 .illumos,
4105 .macos,4099 .macos,
4106 .driverkit,4100 .driverkit,
...@@ -4144,7 +4138,6 @@ pub const msghdr_const = switch (native_os) {...@@ -4144,7 +4138,6 @@ pub const msghdr_const = switch (native_os) {
4144 .freebsd,4138 .freebsd,
4145 .netbsd,4139 .netbsd,
4146 .haiku,4140 .haiku,
4147 .solaris,
4148 .illumos,4141 .illumos,
4149 .macos,4142 .macos,
4150 .driverkit,4143 .driverkit,
...@@ -4190,8 +4183,6 @@ pub const cmsghdr = switch (native_os) {...@@ -4190,8 +4183,6 @@ pub const cmsghdr = switch (native_os) {
4190 .netbsd,4183 .netbsd,
4191 // https://github.com/openbsd/src/blob/master/sys/sys/socket.h#L5274184 // https://github.com/openbsd/src/blob/master/sys/sys/socket.h#L527
4192 .openbsd,4185 .openbsd,
4193 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L416
4194 .solaris,
4195 // https://github.com/illumos/illumos-gate/blob/afdf2e523873cb523df379676067bf9785a0f456/usr/src/uts/common/sys/socket.h#L4604186 // https://github.com/illumos/illumos-gate/blob/afdf2e523873cb523df379676067bf9785a0f456/usr/src/uts/common/sys/socket.h#L460
4196 .illumos,4187 .illumos,
4197 // https://github.com/SerenityOS/serenity/blob/4ee360a348a5e2490eeaeeabb3eb19e70dd450eb/Kernel/API/POSIX/sys/socket.h#L684188 // https://github.com/SerenityOS/serenity/blob/4ee360a348a5e2490eeaeeabb3eb19e70dd450eb/Kernel/API/POSIX/sys/socket.h#L68
...@@ -4215,7 +4206,7 @@ pub const cmsghdr = switch (native_os) {...@@ -4215,7 +4206,7 @@ pub const cmsghdr = switch (native_os) {
4215pub const nfds_t = switch (native_os) {4206pub const nfds_t = switch (native_os) {
4216 .linux => linux.nfds_t,4207 .linux => linux.nfds_t,
4217 .emscripten => emscripten.nfds_t,4208 .emscripten => emscripten.nfds_t,
4218 .haiku, .solaris, .illumos, .wasi => usize,4209 .haiku, .illumos, .wasi => usize,
4219 .windows => c_ulong,4210 .windows => c_ulong,
4220 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,4211 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
4221 // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L324212 // https://github.com/SerenityOS/serenity/blob/265764ff2fec038855193296588a887fc322d76a/Kernel/API/POSIX/poll.h#L32
...@@ -4253,7 +4244,7 @@ pub const pollfd = switch (native_os) {...@@ -4253,7 +4244,7 @@ pub const pollfd = switch (native_os) {
4253pub const rlim_t = switch (native_os) {4244pub const rlim_t = switch (native_os) {
4254 .linux => linux.rlim_t,4245 .linux => linux.rlim_t,
4255 .emscripten => emscripten.rlim_t,4246 .emscripten => emscripten.rlim_t,
4256 .openbsd, .netbsd, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64,4247 .openbsd, .netbsd, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64,
4257 .haiku, .dragonfly, .freebsd => i64,4248 .haiku, .dragonfly, .freebsd => i64,
4258 // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L544249 // https://github.com/SerenityOS/serenity/blob/aae106e37b48f2158e68902293df1e4bf7b80c0f/Userland/Libraries/LibC/sys/resource.h#L54
4259 .serenity => usize,4250 .serenity => usize,
...@@ -4307,7 +4298,7 @@ pub const rlimit_resource = switch (native_os) {...@@ -4307,7 +4298,7 @@ pub const rlimit_resource = switch (native_os) {
43074298
4308 pub const AS: rlimit_resource = .VMEM;4299 pub const AS: rlimit_resource = .VMEM;
4309 },4300 },
4310 .solaris, .illumos => enum(c_int) {4301 .illumos => enum(c_int) {
4311 CPU = 0,4302 CPU = 0,
4312 FSIZE = 1,4303 FSIZE = 1,
4313 DATA = 2,4304 DATA = 2,
...@@ -4401,7 +4392,7 @@ pub const rusage = switch (native_os) {...@@ -4401,7 +4392,7 @@ pub const rusage = switch (native_os) {
4401 pub const SELF = 0;4392 pub const SELF = 0;
4402 pub const CHILDREN = -1;4393 pub const CHILDREN = -1;
4403 },4394 },
4404 .solaris, .illumos => extern struct {4395 .illumos => extern struct {
4405 utime: timeval,4396 utime: timeval,
4406 stime: timeval,4397 stime: timeval,
4407 maxrss: isize,4398 maxrss: isize,
...@@ -4510,7 +4501,7 @@ pub const siginfo_t = switch (native_os) {...@@ -4510,7 +4501,7 @@ pub const siginfo_t = switch (native_os) {
4510 },4501 },
4511 },4502 },
4512 },4503 },
4513 .solaris, .illumos => extern struct {4504 .illumos => extern struct {
4514 signo: c_int,4505 signo: c_int,
4515 code: c_int,4506 code: c_int,
4516 errno: c_int,4507 errno: c_int,
...@@ -4530,8 +4521,8 @@ pub const siginfo_t = switch (native_os) {...@@ -4530,8 +4521,8 @@ pub const siginfo_t = switch (native_os) {
4530 stime: clock_t,4521 stime: clock_t,
4531 },4522 },
4532 },4523 },
4533 contract: solaris.ctid_t,4524 contract: illumos.ctid_t,
4534 zone: solaris.zoneid_t,4525 zone: illumos.zoneid_t,
4535 },4526 },
4536 fault: extern struct {4527 fault: extern struct {
4537 addr: *allowzero anyopaque,4528 addr: *allowzero anyopaque,
...@@ -4642,7 +4633,7 @@ pub const sigset_t = switch (native_os) {...@@ -4642,7 +4633,7 @@ pub const sigset_t = switch (native_os) {
4642 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L194633 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L19
4643 .openbsd, .serenity => u32,4634 .openbsd, .serenity => u32,
4644 .macos, .ios, .tvos, .watchos, .visionos => darwin.sigset_t,4635 .macos, .ios, .tvos, .watchos, .visionos => darwin.sigset_t,
4645 .dragonfly, .netbsd, .solaris, .illumos, .freebsd => extern struct {4636 .dragonfly, .netbsd, .illumos, .freebsd => extern struct {
4646 __bits: [SIG.WORDS]u32,4637 __bits: [SIG.WORDS]u32,
4647 },4638 },
4648 .haiku => u64,4639 .haiku => u64,
...@@ -4681,7 +4672,7 @@ pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {...@@ -4681,7 +4672,7 @@ pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {
4681 addr: ?*sockaddr,4672 addr: ?*sockaddr,
4682 next: ?*addrinfo,4673 next: ?*addrinfo,
4683 },4674 },
4684 .solaris, .illumos => extern struct {4675 .illumos => extern struct {
4685 flags: AI,4676 flags: AI,
4686 family: i32,4677 family: i32,
4687 socktype: i32,4678 socktype: i32,
...@@ -4819,7 +4810,7 @@ pub const sockaddr = switch (native_os) {...@@ -4819,7 +4810,7 @@ pub const sockaddr = switch (native_os) {
4819 path: [104]u8,4810 path: [104]u8,
4820 };4811 };
4821 },4812 },
4822 .solaris, .illumos => extern struct {4813 .illumos => extern struct {
4823 /// address family4814 /// address family
4824 family: sa_family_t,4815 family: sa_family_t,
48254816
...@@ -5081,7 +5072,7 @@ pub const sa_family_t = switch (native_os) {...@@ -5081,7 +5072,7 @@ pub const sa_family_t = switch (native_os) {
5081 .windows => ws2_32.ADDRESS_FAMILY,5072 .windows => ws2_32.ADDRESS_FAMILY,
5082 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,5073 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,
5083 // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L665074 // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L66
5084 .solaris, .illumos, .serenity => u16,5075 .illumos, .serenity => u16,
5085 else => void,5076 else => void,
5086};5077};
5087pub const AF = if (builtin.abi.isAndroid()) struct {5078pub const AF = if (builtin.abi.isAndroid()) struct {
...@@ -5219,7 +5210,7 @@ pub const AF = if (builtin.abi.isAndroid()) struct {...@@ -5219,7 +5210,7 @@ pub const AF = if (builtin.abi.isAndroid()) struct {
5219 pub const INET6_SDP = 42;5210 pub const INET6_SDP = 42;
5220 pub const MAX = 42;5211 pub const MAX = 42;
5221 },5212 },
5222 .solaris, .illumos => struct {5213 .illumos => struct {
5223 pub const UNSPEC = 0;5214 pub const UNSPEC = 0;
5224 pub const UNIX = 1;5215 pub const UNIX = 1;
5225 pub const LOCAL = UNIX;5216 pub const LOCAL = UNIX;
...@@ -5499,7 +5490,7 @@ pub const PF = if (builtin.abi.isAndroid()) struct {...@@ -5499,7 +5490,7 @@ pub const PF = if (builtin.abi.isAndroid()) struct {
5499 pub const INET6_SDP = AF.INET6_SDP;5490 pub const INET6_SDP = AF.INET6_SDP;
5500 pub const MAX = AF.MAX;5491 pub const MAX = AF.MAX;
5501 },5492 },
5502 .solaris, .illumos => struct {5493 .illumos => struct {
5503 pub const UNSPEC = AF.UNSPEC;5494 pub const UNSPEC = AF.UNSPEC;
5504 pub const UNIX = AF.UNIX;5495 pub const UNIX = AF.UNIX;
5505 pub const LOCAL = UNIX;5496 pub const LOCAL = UNIX;
...@@ -5778,7 +5769,7 @@ pub const MSG = switch (native_os) {...@@ -5778,7 +5769,7 @@ pub const MSG = switch (native_os) {
5778 pub const FBLOCKING = 0x10000;5769 pub const FBLOCKING = 0x10000;
5779 pub const FNONBLOCKING = 0x20000;5770 pub const FNONBLOCKING = 0x20000;
5780 },5771 },
5781 .solaris, .illumos => struct {5772 .illumos => struct {
5782 pub const OOB = 0x0001;5773 pub const OOB = 0x0001;
5783 pub const PEEK = 0x0002;5774 pub const PEEK = 0x0002;
5784 pub const DONTROUTE = 0x0004;5775 pub const DONTROUTE = 0x0004;
...@@ -5825,7 +5816,7 @@ pub const SOCK = switch (native_os) {...@@ -5825,7 +5816,7 @@ pub const SOCK = switch (native_os) {
5825 pub const CLOEXEC = 0x10000000;5816 pub const CLOEXEC = 0x10000000;
5826 pub const NONBLOCK = 0x20000000;5817 pub const NONBLOCK = 0x20000000;
5827 },5818 },
5828 .solaris, .illumos => struct {5819 .illumos => struct {
5829 /// Datagram.5820 /// Datagram.
5830 pub const DGRAM = 1;5821 pub const DGRAM = 1;
5831 /// STREAM.5822 /// STREAM.
...@@ -6155,7 +6146,7 @@ pub const IPPROTO = switch (native_os) {...@@ -6155,7 +6146,7 @@ pub const IPPROTO = switch (native_os) {
6155 /// Reserved6146 /// Reserved
6156 pub const RESERVED_254 = 254;6147 pub const RESERVED_254 = 254;
6157 },6148 },
6158 .solaris, .illumos => struct {6149 .illumos => struct {
6159 /// dummy for IP6150 /// dummy for IP
6160 pub const IP = 0;6151 pub const IP = 0;
6161 /// Hop by hop header for IPv66152 /// Hop by hop header for IPv6
...@@ -6514,7 +6505,7 @@ pub const IP = switch (native_os) {...@@ -6514,7 +6505,7 @@ pub const IP = switch (native_os) {
6514 .dragonfly => dragonfly.IP,6505 .dragonfly => dragonfly.IP,
6515 .netbsd => netbsd.IP,6506 .netbsd => netbsd.IP,
6516 .openbsd => openbsd.IP,6507 .openbsd => openbsd.IP,
6517 .solaris, .illumos => solaris.IP,6508 .illumos => illumos.IP,
6518 .haiku => haiku.IP,6509 .haiku => haiku.IP,
6519 .serenity => serenity.IP,6510 .serenity => serenity.IP,
6520 else => void,6511 else => void,
...@@ -6525,7 +6516,7 @@ pub const IPV6 = switch (native_os) {...@@ -6525,7 +6516,7 @@ pub const IPV6 = switch (native_os) {
6525 .dragonfly => dragonfly.IPV6,6516 .dragonfly => dragonfly.IPV6,
6526 .netbsd => netbsd.IPV6,6517 .netbsd => netbsd.IPV6,
6527 .openbsd => openbsd.IPV6,6518 .openbsd => openbsd.IPV6,
6528 .solaris, .illumos => solaris.IPV6,6519 .illumos => illumos.IPV6,
6529 .haiku => haiku.IPV6,6520 .haiku => haiku.IPV6,
6530 .serenity => serenity.IPV6,6521 .serenity => serenity.IPV6,
6531 else => void,6522 else => void,
...@@ -6536,7 +6527,7 @@ pub const IPTOS = switch (native_os) {...@@ -6536,7 +6527,7 @@ pub const IPTOS = switch (native_os) {
6536 .dragonfly => dragonfly.IPTOS,6527 .dragonfly => dragonfly.IPTOS,
6537 .netbsd => netbsd.IPTOS,6528 .netbsd => netbsd.IPTOS,
6538 .openbsd => openbsd.IPTOS,6529 .openbsd => openbsd.IPTOS,
6539 .solaris, .illumos => solaris.IPTOS,6530 .illumos => illumos.IPTOS,
6540 .haiku => haiku.IPTOS,6531 .haiku => haiku.IPTOS,
6541 .serenity => serenity.IPTOS,6532 .serenity => serenity.IPTOS,
6542 else => void,6533 else => void,
...@@ -6548,7 +6539,7 @@ pub const SOL = switch (native_os) {...@@ -6548,7 +6539,7 @@ pub const SOL = switch (native_os) {
6548 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {6539 .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
6549 pub const SOCKET = 0xffff;6540 pub const SOCKET = 0xffff;
6550 },6541 },
6551 .solaris, .illumos => struct {6542 .illumos => struct {
6552 pub const SOCKET = 0xffff;6543 pub const SOCKET = 0xffff;
6553 pub const ROUTE = 0xfffe;6544 pub const ROUTE = 0xfffe;
6554 pub const PACKET = 0xfffd;6545 pub const PACKET = 0xfffd;
...@@ -6632,7 +6623,7 @@ pub const SO = switch (native_os) {...@@ -6632,7 +6623,7 @@ pub const SO = switch (native_os) {
6632 pub const MAX_PACING_RATE = 0x1018;6623 pub const MAX_PACING_RATE = 0x1018;
6633 pub const DOMAIN = 0x1019;6624 pub const DOMAIN = 0x1019;
6634 },6625 },
6635 .solaris, .illumos => struct {6626 .illumos => struct {
6636 pub const DEBUG = 0x0001;6627 pub const DEBUG = 0x0001;
6637 pub const ACCEPTCONN = 0x0002;6628 pub const ACCEPTCONN = 0x0002;
6638 pub const REUSEADDR = 0x0004;6629 pub const REUSEADDR = 0x0004;
...@@ -6803,7 +6794,7 @@ pub const SOMAXCONN = switch (native_os) {...@@ -6803,7 +6794,7 @@ pub const SOMAXCONN = switch (native_os) {
6803 .linux => linux.SOMAXCONN,6794 .linux => linux.SOMAXCONN,
6804 .windows => ws2_32.SOMAXCONN,6795 .windows => ws2_32.SOMAXCONN,
6805 // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L1286796 // https://github.com/SerenityOS/serenity/blob/ac44ec5ebc707f9dd0c3d4759a1e17e91db5d74f/Kernel/API/POSIX/sys/socket.h#L128
6806 .solaris, .illumos, .serenity => 128,6797 .illumos, .serenity => 128,
6807 // https://github.com/freebsd/freebsd-src/blob/9ab31f821ad1c6bad474510447387c50bef2c24c/sys/sys/socket.h#L4346798 // https://github.com/freebsd/freebsd-src/blob/9ab31f821ad1c6bad474510447387c50bef2c24c/sys/sys/socket.h#L434
6808 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/fd3d1949d526ffa646e57037770acd6f2f3bb617/sys/sys/socket.h#L3936799 // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/fd3d1949d526ffa646e57037770acd6f2f3bb617/sys/sys/socket.h#L393
6809 // https://github.com/NetBSD/src/blob/a673fb3f8487e974c669216064f7588207229fea/sys/sys/socket.h#L4726800 // https://github.com/NetBSD/src/blob/a673fb3f8487e974c669216064f7588207229fea/sys/sys/socket.h#L472
...@@ -6814,9 +6805,8 @@ pub const SOMAXCONN = switch (native_os) {...@@ -6814,9 +6805,8 @@ pub const SOMAXCONN = switch (native_os) {
6814};6805};
6815pub const SCM = switch (native_os) {6806pub const SCM = switch (native_os) {
6816 .linux, .emscripten => linux.SCM,6807 .linux, .emscripten => linux.SCM,
6817 // https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/uts/common/sys/socket.h#L172
6818 // https://github.com/illumos/illumos-gate/blob/489f6310fe8952e87fc1dce8af87990fcfd90f18/usr/src/uts/common/sys/socket.h#L1966808 // https://github.com/illumos/illumos-gate/blob/489f6310fe8952e87fc1dce8af87990fcfd90f18/usr/src/uts/common/sys/socket.h#L196
6819 .solaris, .illumos => struct {6809 .illumos => struct {
6820 pub const RIGHTS = 0x1010;6810 pub const RIGHTS = 0x1010;
6821 pub const UCRED = 0x1012;6811 pub const UCRED = 0x1012;
6822 pub const TIMESTAMP = SO.TIMESTAMP;6812 pub const TIMESTAMP = SO.TIMESTAMP;
...@@ -6874,7 +6864,7 @@ pub const IFNAMESIZE = switch (native_os) {...@@ -6874,7 +6864,7 @@ pub const IFNAMESIZE = switch (native_os) {
6874 .windows => 30,6864 .windows => 30,
6875 // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L506865 // https://github.com/SerenityOS/serenity/blob/9882848e0bf783dfc8e8a6d887a848d70d9c58f4/Kernel/API/POSIX/net/if.h#L50
6876 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 16,6866 .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .serenity => 16,
6877 .solaris, .illumos => 32,6867 .illumos => 32,
6878 else => void,6868 else => void,
6879};6869};
68806870
...@@ -6910,7 +6900,7 @@ pub const time_t = switch (native_os) {...@@ -6910,7 +6900,7 @@ pub const time_t = switch (native_os) {
6910};6900};
6911pub const suseconds_t = switch (native_os) {6901pub const suseconds_t = switch (native_os) {
6912 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L496902 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L49
6913 .solaris, .illumos, .serenity => i64,6903 .illumos, .serenity => i64,
6914 .freebsd, .dragonfly => c_long,6904 .freebsd, .dragonfly => c_long,
6915 .netbsd => c_int,6905 .netbsd => c_int,
6916 .haiku => i32,6906 .haiku => i32,
...@@ -6929,7 +6919,7 @@ pub const timeval = switch (native_os) {...@@ -6929,7 +6919,7 @@ pub const timeval = switch (native_os) {
6929 usec: i32,6919 usec: i32,
6930 },6920 },
6931 // https://github.com/SerenityOS/serenity/blob/6b6eca0631c893c5f8cfb8274cdfe18e2d0637c0/Kernel/API/POSIX/sys/time.h#L15-L186921 // https://github.com/SerenityOS/serenity/blob/6b6eca0631c893c5f8cfb8274cdfe18e2d0637c0/Kernel/API/POSIX/sys/time.h#L15-L18
6932 .dragonfly, .netbsd, .freebsd, .solaris, .illumos, .serenity => extern struct {6922 .dragonfly, .netbsd, .freebsd, .illumos, .serenity => extern struct {
6933 /// seconds6923 /// seconds
6934 sec: time_t,6924 sec: time_t,
6935 /// microseconds6925 /// microseconds
...@@ -6963,7 +6953,7 @@ pub const user_desc = switch (native_os) {...@@ -6963,7 +6953,7 @@ pub const user_desc = switch (native_os) {
6963pub const utsname = switch (native_os) {6953pub const utsname = switch (native_os) {
6964 .linux => linux.utsname,6954 .linux => linux.utsname,
6965 .emscripten => emscripten.utsname,6955 .emscripten => emscripten.utsname,
6966 .solaris, .illumos => extern struct {6956 .illumos => extern struct {
6967 sysname: [256:0]u8,6957 sysname: [256:0]u8,
6968 nodename: [256:0]u8,6958 nodename: [256:0]u8,
6969 release: [256:0]u8,6959 release: [256:0]u8,
...@@ -7003,7 +6993,7 @@ pub const _errno = switch (native_os) {...@@ -7003,7 +6993,7 @@ pub const _errno = switch (native_os) {
7003 .wasi, .dragonfly => private.errnoFromThreadLocal,6993 .wasi, .dragonfly => private.errnoFromThreadLocal,
7004 .windows => private._errno,6994 .windows => private._errno,
7005 .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error,6995 .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error,
7006 .solaris, .illumos => private.___errno,6996 .illumos => private.___errno,
7007 .openbsd, .netbsd => private.__errno,6997 .openbsd, .netbsd => private.__errno,
7008 .haiku => haiku._errnop,6998 .haiku => haiku._errnop,
7009 // https://github.com/SerenityOS/serenity/blob/a353ceecf13b6f156a078e32f1ddf1d21366934c/Userland/Libraries/LibC/errno.h#L336999 // https://github.com/SerenityOS/serenity/blob/a353ceecf13b6f156a078e32f1ddf1d21366934c/Userland/Libraries/LibC/errno.h#L33
...@@ -7049,7 +7039,7 @@ pub const RTLD = switch (native_os) {...@@ -7049,7 +7039,7 @@ pub const RTLD = switch (native_os) {
7049 NOLOAD: bool = false,7039 NOLOAD: bool = false,
7050 _: u18 = 0,7040 _: u18 = 0,
7051 },7041 },
7052 .solaris, .illumos => packed struct(u32) {7042 .illumos => packed struct(u32) {
7053 LAZY: bool = false,7043 LAZY: bool = false,
7054 NOW: bool = false,7044 NOW: bool = false,
7055 NOLOAD: bool = false,7045 NOLOAD: bool = false,
...@@ -7128,7 +7118,7 @@ pub const dirent = switch (native_os) {...@@ -7128,7 +7118,7 @@ pub const dirent = switch (native_os) {
7128 /// Name of entry.7118 /// Name of entry.
7129 name: [255:0]u8,7119 name: [255:0]u8,
7130 },7120 },
7131 .solaris, .illumos => extern struct {7121 .illumos => extern struct {
7132 /// Inode number of entry.7122 /// Inode number of entry.
7133 ino: ino_t,7123 ino: ino_t,
7134 /// Offset of this entry on disk.7124 /// Offset of this entry on disk.
...@@ -7177,7 +7167,7 @@ pub const dirent = switch (native_os) {...@@ -7177,7 +7167,7 @@ pub const dirent = switch (native_os) {
7177 else => void,7167 else => void,
7178};7168};
7179pub const MAXNAMLEN = switch (native_os) {7169pub const MAXNAMLEN = switch (native_os) {
7180 .netbsd, .solaris, .illumos => 511,7170 .netbsd, .illumos => 511,
7181 // https://github.com/SerenityOS/serenity/blob/1262a7d1424d0d2e89d80644409721cbf056ab17/Kernel/API/POSIX/dirent.h#L377171 // https://github.com/SerenityOS/serenity/blob/1262a7d1424d0d2e89d80644409721cbf056ab17/Kernel/API/POSIX/dirent.h#L37
7182 .haiku, .serenity => NAME_MAX,7172 .haiku, .serenity => NAME_MAX,
7183 .openbsd => 255,7173 .openbsd => 255,
...@@ -7228,7 +7218,7 @@ pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {...@@ -7228,7 +7218,7 @@ pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
7228 ADDRCONFIG: bool = false,7218 ADDRCONFIG: bool = false,
7229 _: u21 = 0,7219 _: u21 = 0,
7230 },7220 },
7231 .solaris, .illumos => packed struct(u32) {7221 .illumos => packed struct(u32) {
7232 V4MAPPED: bool = false,7222 V4MAPPED: bool = false,
7233 ALL: bool = false,7223 ALL: bool = false,
7234 ADDRCONFIG: bool = false,7224 ADDRCONFIG: bool = false,
...@@ -7286,7 +7276,7 @@ pub const NI = switch (native_os) {...@@ -7286,7 +7276,7 @@ pub const NI = switch (native_os) {
7286 NUMERICSCOPE: bool = false,7276 NUMERICSCOPE: bool = false,
7287 _: u23 = 0,7277 _: u23 = 0,
7288 },7278 },
7289 .solaris, .illumos => packed struct(u32) {7279 .illumos => packed struct(u32) {
7290 NOFQDN: bool = false,7280 NOFQDN: bool = false,
7291 NUMERICHOST: bool = false,7281 NUMERICHOST: bool = false,
7292 NAMEREQD: bool = false,7282 NAMEREQD: bool = false,
...@@ -7396,7 +7386,7 @@ pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) {...@@ -7396,7 +7386,7 @@ pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) {
7396 OVERFLOW = 14,7386 OVERFLOW = 14,
7397 _,7387 _,
7398 },7388 },
7399 .solaris, .illumos => enum(c_int) {7389 .illumos => enum(c_int) {
7400 /// address family for hostname not supported7390 /// address family for hostname not supported
7401 ADDRFAMILY = 1,7391 ADDRFAMILY = 1,
7402 /// name could not be resolved at this time7392 /// name could not be resolved at this time
...@@ -7736,7 +7726,7 @@ pub const Stat = switch (native_os) {...@@ -7736,7 +7726,7 @@ pub const Stat = switch (native_os) {
7736 }7726 }
7737 },7727 },
7738 .freebsd => freebsd.Stat,7728 .freebsd => freebsd.Stat,
7739 .solaris, .illumos => extern struct {7729 .illumos => extern struct {
7740 dev: dev_t,7730 dev: dev_t,
7741 ino: ino_t,7731 ino: ino_t,
7742 mode: mode_t,7732 mode: mode_t,
...@@ -7970,7 +7960,7 @@ pub const pthread_mutex_t = switch (native_os) {...@@ -7970,7 +7960,7 @@ pub const pthread_mutex_t = switch (native_os) {
7970 owner: i32 = -1,7960 owner: i32 = -1,
7971 owner_count: i32 = 0,7961 owner_count: i32 = 0,
7972 },7962 },
7973 .solaris, .illumos => extern struct {7963 .illumos => extern struct {
7974 flag1: u16 = 0,7964 flag1: u16 = 0,
7975 flag2: u8 = 0,7965 flag2: u8 = 0,
7976 ceiling: u8 = 0,7966 ceiling: u8 = 0,
...@@ -8025,7 +8015,7 @@ pub const pthread_cond_t = switch (native_os) {...@@ -8025,7 +8015,7 @@ pub const pthread_cond_t = switch (native_os) {
8025 waiter_count: i32 = 0,8015 waiter_count: i32 = 0,
8026 lock: i32 = 0,8016 lock: i32 = 0,
8027 },8017 },
8028 .solaris, .illumos => extern struct {8018 .illumos => extern struct {
8029 flag: [4]u8 = [_]u8{0} ** 4,8019 flag: [4]u8 = [_]u8{0} ** 4,
8030 type: u16 = 0,8020 type: u16 = 0,
8031 magic: u16 = 0x4356,8021 magic: u16 = 0x4356,
...@@ -8084,7 +8074,7 @@ pub const pthread_rwlock_t = switch (native_os) {...@@ -8084,7 +8074,7 @@ pub const pthread_rwlock_t = switch (native_os) {
8084 owner: ?pthread_t = null,8074 owner: ?pthread_t = null,
8085 private: ?*anyopaque = null,8075 private: ?*anyopaque = null,
8086 },8076 },
8087 .solaris, .illumos => extern struct {8077 .illumos => extern struct {
8088 readers: i32 = 0,8078 readers: i32 = 0,
8089 type: u16 = 0,8079 type: u16 = 0,
8090 magic: u16 = 0x5257,8080 magic: u16 = 0x5257,
...@@ -8118,7 +8108,7 @@ pub const pthread_attr_t = switch (native_os) {...@@ -8118,7 +8108,7 @@ pub const pthread_attr_t = switch (native_os) {
8118 .freebsd, .openbsd, .serenity => extern struct {8108 .freebsd, .openbsd, .serenity => extern struct {
8119 inner: ?*anyopaque = null,8109 inner: ?*anyopaque = null,
8120 },8110 },
8121 .solaris, .illumos => extern struct {8111 .illumos => extern struct {
8122 mutexattr: ?*anyopaque = null,8112 mutexattr: ?*anyopaque = null,
8123 },8113 },
8124 .netbsd => extern struct {8114 .netbsd => extern struct {
...@@ -8140,7 +8130,7 @@ pub const pthread_key_t = switch (native_os) {...@@ -8140,7 +8130,7 @@ pub const pthread_key_t = switch (native_os) {
8140 .linux, .emscripten => c_uint,8130 .linux, .emscripten => c_uint,
8141 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,8131 .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
8142 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L658132 // https://github.com/SerenityOS/serenity/blob/b98f537f117b341788023ab82e0c11ca9ae29a57/Kernel/API/POSIX/sys/types.h#L65
8143 .openbsd, .solaris, .illumos, .serenity => c_int,8133 .openbsd, .illumos, .serenity => c_int,
8144 else => void,8134 else => void,
8145};8135};
81468136
...@@ -8180,7 +8170,7 @@ pub const sem_t = switch (native_os) {...@@ -8180,7 +8170,7 @@ pub const sem_t = switch (native_os) {
8180 },8170 },
8181 _padding: u32,8171 _padding: u32,
8182 },8172 },
8183 .solaris, .illumos => extern struct {8173 .illumos => extern struct {
8184 count: u32 = 0,8174 count: u32 = 0,
8185 type: u16 = 0,8175 type: u16 = 0,
8186 magic: u16 = 0x534d,8176 magic: u16 = 0x534d,
...@@ -8271,12 +8261,12 @@ pub const Kevent = switch (native_os) {...@@ -8271,12 +8261,12 @@ pub const Kevent = switch (native_os) {
8271};8261};
82728262
8273pub const port_t = switch (native_os) {8263pub const port_t = switch (native_os) {
8274 .solaris, .illumos => c_int,8264 .illumos => c_int,
8275 else => void,8265 else => void,
8276};8266};
82778267
8278pub const port_event = switch (native_os) {8268pub const port_event = switch (native_os) {
8279 .solaris, .illumos => extern struct {8269 .illumos => extern struct {
8280 events: u32,8270 events: u32,
8281 /// Event source.8271 /// Event source.
8282 source: u16,8272 source: u16,
...@@ -8364,7 +8354,7 @@ pub const AT = switch (native_os) {...@@ -8364,7 +8354,7 @@ pub const AT = switch (native_os) {
8364 pub const REMOVEDIR = 0x04;8354 pub const REMOVEDIR = 0x04;
8365 pub const EACCESS = 0x08;8355 pub const EACCESS = 0x08;
8366 },8356 },
8367 .solaris, .illumos => struct {8357 .illumos => struct {
8368 /// Magic value that specify the use of the current working directory8358 /// Magic value that specify the use of the current working directory
8369 /// to determine the target of relative file paths in the openat() and8359 /// to determine the target of relative file paths in the openat() and
8370 /// similar syscalls.8360 /// similar syscalls.
...@@ -8461,7 +8451,7 @@ pub const O = switch (native_os) {...@@ -8461,7 +8451,7 @@ pub const O = switch (native_os) {
8461 // ignored in C code. Thus no mapping in Zig.8451 // ignored in C code. Thus no mapping in Zig.
8462 _: u3 = 0,8452 _: u3 = 0,
8463 },8453 },
8464 .solaris, .illumos => packed struct(u32) {8454 .illumos => packed struct(u32) {
8465 ACCMODE: std.posix.ACCMODE = .RDONLY,8455 ACCMODE: std.posix.ACCMODE = .RDONLY,
8466 NDELAY: bool = false,8456 NDELAY: bool = false,
8467 APPEND: bool = false,8457 APPEND: bool = false,
...@@ -8672,7 +8662,7 @@ pub const MAP = switch (native_os) {...@@ -8672,7 +8662,7 @@ pub const MAP = switch (native_os) {
8672 FIXED_NOREPLACE: bool = false,8662 FIXED_NOREPLACE: bool = false,
8673 _: u11 = 0,8663 _: u11 = 0,
8674 },8664 },
8675 .solaris, .illumos => packed struct(u32) {8665 .illumos => packed struct(u32) {
8676 TYPE: enum(u4) {8666 TYPE: enum(u4) {
8677 SHARED = 0x01,8667 SHARED = 0x01,
8678 PRIVATE = 0x02,8668 PRIVATE = 0x02,
...@@ -8869,7 +8859,7 @@ pub const V = switch (native_os) {...@@ -8869,7 +8859,7 @@ pub const V = switch (native_os) {
8869 STOP,8859 STOP,
8870 SUSP,8860 SUSP,
8871 },8861 },
8872 .solaris, .illumos => enum {8862 .illumos => enum {
8873 INTR,8863 INTR,
8874 QUIT,8864 QUIT,
8875 ERASE,8865 ERASE,
...@@ -8936,7 +8926,7 @@ pub const NCCS = switch (native_os) {...@@ -8936,7 +8926,7 @@ pub const NCCS = switch (native_os) {
8936 .linux => linux.NCCS,8926 .linux => linux.NCCS,
8937 .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,8927 .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,
8938 .haiku => 11,8928 .haiku => 11,
8939 .solaris, .illumos => 19,8929 .illumos => 19,
8940 // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L158930 // https://github.com/SerenityOS/serenity/blob/d277cdfd4c7ed21d5248a83217ae03b9f890c3c8/Kernel/API/POSIX/termios.h#L15
8941 .emscripten, .wasi, .serenity => 32,8931 .emscripten, .wasi, .serenity => 32,
8942 else => void,8932 else => void,
...@@ -8973,7 +8963,7 @@ pub const termios = switch (native_os) {...@@ -8973,7 +8963,7 @@ pub const termios = switch (native_os) {
8973 ospeed: speed_t,8963 ospeed: speed_t,
8974 cc: [NCCS]cc_t,8964 cc: [NCCS]cc_t,
8975 },8965 },
8976 .solaris, .illumos => extern struct {8966 .illumos => extern struct {
8977 iflag: tc_iflag_t,8967 iflag: tc_iflag_t,
8978 oflag: tc_oflag_t,8968 oflag: tc_oflag_t,
8979 cflag: tc_cflag_t,8969 cflag: tc_cflag_t,
...@@ -9063,7 +9053,7 @@ pub const tc_iflag_t = switch (native_os) {...@@ -9063,7 +9053,7 @@ pub const tc_iflag_t = switch (native_os) {
9063 IXOFF: bool = false,9053 IXOFF: bool = false,
9064 _: u19 = 0,9054 _: u19 = 0,
9065 },9055 },
9066 .solaris, .illumos => packed struct(u32) {9056 .illumos => packed struct(u32) {
9067 IGNBRK: bool = false,9057 IGNBRK: bool = false,
9068 BRKINT: bool = false,9058 BRKINT: bool = false,
9069 IGNPAR: bool = false,9059 IGNPAR: bool = false,
...@@ -9156,7 +9146,7 @@ pub const tc_oflag_t = switch (native_os) {...@@ -9156,7 +9146,7 @@ pub const tc_oflag_t = switch (native_os) {
9156 ONLRET: bool = false,9146 ONLRET: bool = false,
9157 _: u25 = 0,9147 _: u25 = 0,
9158 },9148 },
9159 .solaris, .illumos => packed struct(u32) {9149 .illumos => packed struct(u32) {
9160 OPOST: bool = false,9150 OPOST: bool = false,
9161 OLCUC: bool = false,9151 OLCUC: bool = false,
9162 ONLCR: bool = false,9152 ONLCR: bool = false,
...@@ -9303,7 +9293,7 @@ pub const tc_cflag_t = switch (native_os) {...@@ -9303,7 +9293,7 @@ pub const tc_cflag_t = switch (native_os) {
9303 RTSFLOW: bool = false,9293 RTSFLOW: bool = false,
9304 _: u17 = 0,9294 _: u17 = 0,
9305 },9295 },
9306 .solaris, .illumos => packed struct(u32) {9296 .illumos => packed struct(u32) {
9307 _0: u4 = 0,9297 _0: u4 = 0,
9308 CSIZE: CSIZE = .CS5,9298 CSIZE: CSIZE = .CS5,
9309 CSTOPB: bool = false,9299 CSTOPB: bool = false,
...@@ -9441,7 +9431,7 @@ pub const tc_lflag_t = switch (native_os) {...@@ -9441,7 +9431,7 @@ pub const tc_lflag_t = switch (native_os) {
9441 PENDIN: bool = false,9431 PENDIN: bool = false,
9442 _: u17 = 0,9432 _: u17 = 0,
9443 },9433 },
9444 .solaris, .illumos => packed struct(u32) {9434 .illumos => packed struct(u32) {
9445 ISIG: bool = false,9435 ISIG: bool = false,
9446 ICANON: bool = false,9436 ICANON: bool = false,
9447 XCASE: bool = false,9437 XCASE: bool = false,
...@@ -9609,7 +9599,7 @@ pub const speed_t = switch (native_os) {...@@ -9609,7 +9599,7 @@ pub const speed_t = switch (native_os) {
9609 B230400 = 0x12,9599 B230400 = 0x12,
9610 B31250 = 0x13,9600 B31250 = 0x13,
9611 },9601 },
9612 .solaris, .illumos => enum(c_uint) {9602 .illumos => enum(c_uint) {
9613 B0 = 0,9603 B0 = 0,
9614 B50 = 1,9604 B50 = 1,
9615 B75 = 2,9605 B75 = 2,
...@@ -9696,7 +9686,7 @@ pub const NSIG = switch (native_os) {...@@ -9696,7 +9686,7 @@ pub const NSIG = switch (native_os) {
9696 .haiku => 65,9686 .haiku => 65,
9697 .netbsd, .freebsd => 32,9687 .netbsd, .freebsd => 32,
9698 .macos => darwin.NSIG,9688 .macos => darwin.NSIG,
9699 .solaris, .illumos => 75,9689 .illumos => 75,
9700 // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal_numbers.h#L429690 // https://github.com/SerenityOS/serenity/blob/046c23f567a17758d762a33bdf04bacbfd088f9f/Kernel/API/POSIX/signal_numbers.h#L42
9701 .openbsd, .serenity => 33,9691 .openbsd, .serenity => 33,
9702 else => {},9692 else => {},
...@@ -9709,7 +9699,7 @@ pub const MINSIGSTKSZ = switch (native_os) {...@@ -9709,7 +9699,7 @@ pub const MINSIGSTKSZ = switch (native_os) {
9709 .arm, .aarch64 => 4096,9699 .arm, .aarch64 => 4096,
9710 else => @compileError("unsupported arch"),9700 else => @compileError("unsupported arch"),
9711 },9701 },
9712 .solaris, .illumos => 2048,9702 .illumos => 2048,
9713 .haiku, .netbsd => 8192,9703 .haiku, .netbsd => 8192,
9714 .openbsd => 1 << openbsd.MAX_PAGE_SHIFT,9704 .openbsd => 1 << openbsd.MAX_PAGE_SHIFT,
9715 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L589705 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L58
...@@ -9719,7 +9709,7 @@ pub const MINSIGSTKSZ = switch (native_os) {...@@ -9719,7 +9709,7 @@ pub const MINSIGSTKSZ = switch (native_os) {
9719pub const SIGSTKSZ = switch (native_os) {9709pub const SIGSTKSZ = switch (native_os) {
9720 .macos, .ios, .tvos, .watchos, .visionos => 131072,9710 .macos, .ios, .tvos, .watchos, .visionos => 131072,
9721 .netbsd, .freebsd => MINSIGSTKSZ + 32768,9711 .netbsd, .freebsd => MINSIGSTKSZ + 32768,
9722 .solaris, .illumos => 8192,9712 .illumos => 8192,
9723 .haiku => 16384,9713 .haiku => 16384,
9724 .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,9714 .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,
9725 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L599715 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L59
...@@ -9733,7 +9723,7 @@ pub const SS = switch (native_os) {...@@ -9733,7 +9723,7 @@ pub const SS = switch (native_os) {
9733 pub const DISABLE = 4;9723 pub const DISABLE = 4;
9734 },9724 },
9735 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L54-L559725 // https://github.com/SerenityOS/serenity/blob/ec492a1a0819e6239ea44156825c4ee7234ca3db/Kernel/API/POSIX/signal.h#L54-L55
9736 .haiku, .solaris, .illumos, .serenity => struct {9726 .haiku, .illumos, .serenity => struct {
9737 pub const ONSTACK = 0x1;9727 pub const ONSTACK = 0x1;
9738 pub const DISABLE = 0x2;9728 pub const DISABLE = 0x2;
9739 },9729 },
...@@ -10314,7 +10304,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_...@@ -10314,7 +10304,7 @@ pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_
1031410304
10315pub const arc4random_buf = switch (native_os) {10305pub const arc4random_buf = switch (native_os) {
10316 .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},10306 .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},
10317 .dragonfly, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .serenity, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf,10307 .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .serenity, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf,
10318 else => {},10308 else => {},
10319};10309};
10320pub const getentropy = switch (native_os) {10310pub const getentropy = switch (native_os) {
...@@ -10383,7 +10373,7 @@ pub const sigaltstack = switch (native_os) {...@@ -10383,7 +10373,7 @@ pub const sigaltstack = switch (native_os) {
1038310373
10384pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;10374pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
10385pub const pipe2 = switch (native_os) {10375pub const pipe2 = switch (native_os) {
10386 .dragonfly, .emscripten, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .linux, .serenity => private.pipe2,10376 .dragonfly, .emscripten, .netbsd, .freebsd, .illumos, .openbsd, .linux, .serenity => private.pipe2,
10387 else => {},10377 else => {},
10388};10378};
10389pub const copy_file_range = switch (native_os) {10379pub const copy_file_range = switch (native_os) {
...@@ -10443,12 +10433,12 @@ pub const munlock = switch (native_os) {...@@ -10443,12 +10433,12 @@ pub const munlock = switch (native_os) {
10443};10433};
1044410434
10445pub const mlockall = switch (native_os) {10435pub const mlockall = switch (native_os) {
10446 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => private.mlockall,10436 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.mlockall,
10447 else => {},10437 else => {},
10448};10438};
1044910439
10450pub const munlockall = switch (native_os) {10440pub const munlockall = switch (native_os) {
10451 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .solaris, .illumos => private.munlockall,10441 .linux, .freebsd, .dragonfly, .netbsd, .openbsd, .illumos => private.munlockall,
10452 else => {},10442 else => {},
10453};10443};
1045410444
...@@ -10491,7 +10481,7 @@ pub fn sigrtmin() u8 {...@@ -10491,7 +10481,7 @@ pub fn sigrtmin() u8 {
10491 return switch (native_os) {10481 return switch (native_os) {
10492 .freebsd => 65,10482 .freebsd => 65,
10493 .netbsd => 33,10483 .netbsd => 33,
10494 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),10484 .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MIN))),
10495 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),10485 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmin()))),
10496 };10486 };
10497}10487}
...@@ -10501,7 +10491,7 @@ pub fn sigrtmax() u8 {...@@ -10501,7 +10491,7 @@ pub fn sigrtmax() u8 {
10501 return switch (native_os) {10491 return switch (native_os) {
10502 .freebsd => 126,10492 .freebsd => 126,
10503 .netbsd => 63,10493 .netbsd => 63,
10504 .solaris, .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),10494 .illumos => @truncate(sysconf(@intFromEnum(_SC.SIGRT_MAX))),
10505 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),10495 else => @truncate(@as(c_uint, @bitCast(private.__libc_current_sigrtmax()))),
10506 };10496 };
10507}10497}
...@@ -10556,11 +10546,11 @@ pub const malloc_usable_size = switch (native_os) {...@@ -10556,11 +10546,11 @@ pub const malloc_usable_size = switch (native_os) {
10556 else => {},10546 else => {},
10557};10547};
10558pub const posix_memalign = switch (native_os) {10548pub const posix_memalign = switch (native_os) {
10559 .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => private.posix_memalign,10549 .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => private.posix_memalign,
10560 else => {},10550 else => {},
10561};10551};
10562pub const sysconf = switch (native_os) {10552pub const sysconf = switch (native_os) {
10563 .solaris => solaris.sysconf,10553 .illumos => illumos.sysconf,
10564 else => private.sysconf,10554 else => private.sysconf,
10565};10555};
1056610556
...@@ -10629,7 +10619,6 @@ pub const fork = switch (native_os) {...@@ -10629,7 +10619,6 @@ pub const fork = switch (native_os) {
10629 .macos,10619 .macos,
10630 .netbsd,10620 .netbsd,
10631 .openbsd,10621 .openbsd,
10632 .solaris,
10633 .illumos,10622 .illumos,
10634 .tvos,10623 .tvos,
10635 .watchos,10624 .watchos,
...@@ -10777,7 +10766,7 @@ pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_...@@ -10777,7 +10766,7 @@ pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_
10777pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int;10766pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int;
10778pub const pthread_setname_np = switch (native_os) {10767pub const pthread_setname_np = switch (native_os) {
10779 .macos, .ios, .tvos, .watchos, .visionos => darwin.pthread_setname_np,10768 .macos, .ios, .tvos, .watchos, .visionos => darwin.pthread_setname_np,
10780 .solaris, .illumos => solaris.pthread_setname_np,10769 .illumos => illumos.pthread_setname_np,
10781 .netbsd => netbsd.pthread_setname_np,10770 .netbsd => netbsd.pthread_setname_np,
10782 else => private.pthread_setname_np,10771 else => private.pthread_setname_np,
10783};10772};
...@@ -10987,33 +10976,33 @@ pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usi...@@ -10987,33 +10976,33 @@ pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usi
10987// OS-specific bits. These are protected from being used on the wrong OS by10976// OS-specific bits. These are protected from being used on the wrong OS by
10988// comptime assertions inside each OS-specific file.10977// comptime assertions inside each OS-specific file.
1098910978
10990pub const AF_SUN = solaris.AF_SUN;10979pub const AF_SUN = illumos.AF_SUN;
10991pub const AT_SUN = solaris.AT_SUN;10980pub const AT_SUN = illumos.AT_SUN;
10992pub const FILE_EVENT = solaris.FILE_EVENT;10981pub const FILE_EVENT = illumos.FILE_EVENT;
10993pub const GETCONTEXT = solaris.GETCONTEXT;10982pub const GETCONTEXT = illumos.GETCONTEXT;
10994pub const GETUSTACK = solaris.GETUSTACK;10983pub const GETUSTACK = illumos.GETUSTACK;
10995pub const PORT_ALERT = solaris.PORT_ALERT;10984pub const PORT_ALERT = illumos.PORT_ALERT;
10996pub const PORT_SOURCE = solaris.PORT_SOURCE;10985pub const PORT_SOURCE = illumos.PORT_SOURCE;
10997pub const POSIX_FADV = solaris.POSIX_FADV;10986pub const POSIX_FADV = illumos.POSIX_FADV;
10998pub const SETCONTEXT = solaris.SETCONTEXT;10987pub const SETCONTEXT = illumos.SETCONTEXT;
10999pub const SETUSTACK = solaris.GETUSTACK;10988pub const SETUSTACK = illumos.GETUSTACK;
11000pub const SFD = solaris.SFD;10989pub const SFD = illumos.SFD;
11001pub const ctid_t = solaris.ctid_t;10990pub const ctid_t = illumos.ctid_t;
11002pub const file_obj = solaris.file_obj;10991pub const file_obj = illumos.file_obj;
11003pub const id_t = solaris.id_t;10992pub const id_t = illumos.id_t;
11004pub const lif_ifinfo_req = solaris.lif_ifinfo_req;10993pub const lif_ifinfo_req = illumos.lif_ifinfo_req;
11005pub const lif_nd_req = solaris.lif_nd_req;10994pub const lif_nd_req = illumos.lif_nd_req;
11006pub const lifreq = solaris.lifreq;10995pub const lifreq = illumos.lifreq;
11007pub const major_t = solaris.major_t;10996pub const major_t = illumos.major_t;
11008pub const minor_t = solaris.minor_t;10997pub const minor_t = illumos.minor_t;
11009pub const poolid_t = solaris.poolid_t;10998pub const poolid_t = illumos.poolid_t;
11010pub const port_notify = solaris.port_notify;10999pub const port_notify = illumos.port_notify;
11011pub const priority = solaris.priority;11000pub const priority = illumos.priority;
11012pub const procfs = solaris.procfs;11001pub const procfs = illumos.procfs;
11013pub const projid_t = solaris.projid_t;11002pub const projid_t = illumos.projid_t;
11014pub const signalfd_siginfo = solaris.signalfd_siginfo;11003pub const signalfd_siginfo = illumos.signalfd_siginfo;
11015pub const taskid_t = solaris.taskid_t;11004pub const taskid_t = illumos.taskid_t;
11016pub const zoneid_t = solaris.zoneid_t;11005pub const zoneid_t = illumos.zoneid_t;
1101711006
11018pub const DirEnt = haiku.DirEnt;11007pub const DirEnt = haiku.DirEnt;
11019pub const _get_next_area_info = haiku._get_next_area_info;11008pub const _get_next_area_info = haiku._get_next_area_info;
...@@ -11361,7 +11350,7 @@ const private = struct {...@@ -11361,7 +11350,7 @@ const private = struct {
11361 extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;11350 extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;
11362 extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {11351 extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {
11363 .freebsd => isize,11352 .freebsd => isize,
11364 .solaris, .illumos => usize,11353 .illumos => usize,
11365 else => c_int,11354 else => c_int,
11366 };11355 };
11367 extern "c" fn getrusage(who: c_int, usage: *rusage) c_int;11356 extern "c" fn getrusage(who: c_int, usage: *rusage) c_int;
lib/std/c/illumos.zig created+457
...@@ -0,0 +1,457 @@
1const builtin = @import("builtin");
2const std = @import("../std.zig");
3const assert = std.debug.assert;
4const SO = std.c.SO;
5const fd_t = std.c.fd_t;
6const gid_t = std.c.gid_t;
7const ino_t = std.c.ino_t;
8const mode_t = std.c.mode_t;
9const off_t = std.c.off_t;
10const pid_t = std.c.pid_t;
11const pthread_t = std.c.pthread_t;
12const sockaddr = std.c.sockaddr;
13const socklen_t = std.c.socklen_t;
14const timespec = std.c.timespec;
15const uid_t = std.c.uid_t;
16const IFNAMESIZE = std.c.IFNAMESIZE;
17
18comptime {
19 assert(builtin.os.tag == .illumos); // Prevent access of std.c symbols on wrong OS.
20}
21
22pub extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8, arg: ?*anyopaque) c_int;
23pub extern "c" fn sysconf(sc: c_int) i64;
24
25pub const major_t = u32;
26pub const minor_t = u32;
27pub const id_t = i32;
28pub const taskid_t = id_t;
29pub const projid_t = id_t;
30pub const poolid_t = id_t;
31pub const zoneid_t = id_t;
32pub const ctid_t = id_t;
33
34pub const GETCONTEXT = 0;
35pub const SETCONTEXT = 1;
36pub const GETUSTACK = 2;
37pub const SETUSTACK = 3;
38
39pub const POSIX_FADV = struct {
40 pub const NORMAL = 0;
41 pub const RANDOM = 1;
42 pub const SEQUENTIAL = 2;
43 pub const WILLNEED = 3;
44 pub const DONTNEED = 4;
45 pub const NOREUSE = 5;
46};
47
48pub const priority = enum(c_int) {
49 PROCESS = 0,
50 PGRP = 1,
51 USER = 2,
52 GROUP = 3,
53 SESSION = 4,
54 LWP = 5,
55 TASK = 6,
56 PROJECT = 7,
57 ZONE = 8,
58 CONTRACT = 9,
59};
60
61/// Extensions to the ELF auxiliary vector.
62pub const AT_SUN = struct {
63 /// effective user id
64 pub const UID = 2000;
65 /// real user id
66 pub const RUID = 2001;
67 /// effective group id
68 pub const GID = 2002;
69 /// real group id
70 pub const RGID = 2003;
71 /// dynamic linker's ELF header
72 pub const LDELF = 2004;
73 /// dynamic linker's section headers
74 pub const LDSHDR = 2005;
75 /// name of dynamic linker
76 pub const LDNAME = 2006;
77 /// large pagesize
78 pub const LPAGESZ = 2007;
79 /// platform name
80 pub const PLATFORM = 2008;
81 /// hints about hardware capabilities.
82 pub const HWCAP = 2009;
83 pub const HWCAP2 = 2023;
84 /// flush icache?
85 pub const IFLUSH = 2010;
86 /// cpu name
87 pub const CPU = 2011;
88 /// exec() path name in the auxv, null terminated.
89 pub const EXECNAME = 2014;
90 /// mmu module name
91 pub const MMU = 2015;
92 /// dynamic linkers data segment
93 pub const LDDATA = 2016;
94 /// AF_SUN_ flags passed from the kernel
95 pub const AUXFLAGS = 2017;
96 /// name of the emulation binary for the linker
97 pub const EMULATOR = 2018;
98 /// name of the brand library for the linker
99 pub const BRANDNAME = 2019;
100 /// vectors for brand modules.
101 pub const BRAND_AUX1 = 2020;
102 pub const BRAND_AUX2 = 2021;
103 pub const BRAND_AUX3 = 2022;
104 pub const BRAND_AUX4 = 2025;
105 pub const BRAND_NROOT = 2024;
106 /// vector for comm page.
107 pub const COMMPAGE = 2026;
108 /// information about the x86 FPU.
109 pub const FPTYPE = 2027;
110 pub const FPSIZE = 2028;
111};
112
113/// ELF auxiliary vector flags.
114pub const AF_SUN = struct {
115 /// tell ld.so.1 to run "secure" and ignore the environment.
116 pub const SETUGID = 0x00000001;
117 /// hardware capabilities can be verified against AT_SUN_HWCAP
118 pub const HWCAPVERIFY = 0x00000002;
119 pub const NOPLM = 0x00000004;
120};
121
122pub const procfs = struct {
123 pub const misc_header = extern struct {
124 size: u32,
125 type: enum(u32) {
126 Pathname,
127 Socketname,
128 Peersockname,
129 SockoptsBoolOpts,
130 SockoptLinger,
131 SockoptSndbuf,
132 SockoptRcvbuf,
133 SockoptIpNexthop,
134 SockoptIpv6Nexthop,
135 SockoptType,
136 SockoptTcpCongestion,
137 SockfiltersPriv = 14,
138 },
139 };
140
141 pub const fdinfo = extern struct {
142 fd: fd_t,
143 mode: mode_t,
144 ino: ino_t,
145 size: off_t,
146 offset: off_t,
147 uid: uid_t,
148 gid: gid_t,
149 dev_major: major_t,
150 dev_minor: minor_t,
151 special_major: major_t,
152 special_minor: minor_t,
153 fileflags: i32,
154 fdflags: i32,
155 locktype: i16,
156 lockpid: pid_t,
157 locksysid: i32,
158 peerpid: pid_t,
159 __filler: [25]c_int,
160 peername: [15:0]u8,
161 misc: [1]u8,
162 };
163};
164
165pub const SFD = struct {
166 pub const CLOEXEC = 0o2000000;
167 pub const NONBLOCK = 0o4000;
168};
169
170pub const signalfd_siginfo = extern struct {
171 signo: u32,
172 errno: i32,
173 code: i32,
174 pid: u32,
175 uid: uid_t,
176 fd: i32,
177 tid: u32, // unused
178 band: u32,
179 overrun: u32, // unused
180 trapno: u32,
181 status: i32,
182 int: i32, // unused
183 ptr: u64, // unused
184 utime: u64,
185 stime: u64,
186 addr: u64,
187 __pad: [48]u8,
188};
189
190pub const PORT_SOURCE = struct {
191 pub const AIO = 1;
192 pub const TIMER = 2;
193 pub const USER = 3;
194 pub const FD = 4;
195 pub const ALERT = 5;
196 pub const MQ = 6;
197 pub const FILE = 7;
198};
199
200pub const PORT_ALERT = struct {
201 pub const SET = 0x01;
202 pub const UPDATE = 0x02;
203};
204
205/// User watchable file events.
206pub const FILE_EVENT = struct {
207 pub const ACCESS = 0x00000001;
208 pub const MODIFIED = 0x00000002;
209 pub const ATTRIB = 0x00000004;
210 pub const DELETE = 0x00000010;
211 pub const RENAME_TO = 0x00000020;
212 pub const RENAME_FROM = 0x00000040;
213 pub const TRUNC = 0x00100000;
214 pub const NOFOLLOW = 0x10000000;
215 /// The filesystem holding the watched file was unmounted.
216 pub const UNMOUNTED = 0x20000000;
217 /// Some other file/filesystem got mounted over the watched file/directory.
218 pub const MOUNTEDOVER = 0x40000000;
219
220 pub fn isException(event: u32) bool {
221 return event & (UNMOUNTED | DELETE | RENAME_TO | RENAME_FROM | MOUNTEDOVER) > 0;
222 }
223};
224
225pub const port_notify = extern struct {
226 /// Bind request(s) to port.
227 port: u32,
228 /// User defined variable.
229 user: ?*void,
230};
231
232pub const file_obj = extern struct {
233 /// Access time.
234 atim: timespec,
235 /// Modification time
236 mtim: timespec,
237 /// Change time
238 ctim: timespec,
239 __pad: [3]usize,
240 name: [*:0]u8,
241};
242
243// struct ifreq is marked obsolete, with struct lifreq preferred for interface requests.
244// Here we alias lifreq to ifreq to avoid chainging existing code in os and x.os.IPv6.
245pub const SIOCGLIFINDEX = IOWR('i', 133, lifreq);
246
247pub const lif_nd_req = extern struct {
248 addr: sockaddr.storage,
249 state_create: u8,
250 state_same_lla: u8,
251 state_diff_lla: u8,
252 hdw_len: i32,
253 flags: i32,
254 __pad: i32,
255 hdw_addr: [64]u8,
256};
257
258pub const lif_ifinfo_req = extern struct {
259 maxhops: u8,
260 reachtime: u32,
261 reachretrans: u32,
262 maxmtu: u32,
263};
264
265/// IP interface request. See if_tcp(7p) for more info.
266pub const lifreq = extern struct {
267 // Not actually in a union, but the stdlib expects one for ifreq
268 ifrn: extern union {
269 /// Interface name, e.g. "lo0", "en0".
270 name: [IFNAMESIZE]u8,
271 },
272 ru1: extern union {
273 /// For subnet/token etc.
274 addrlen: i32,
275 /// Driver's PPA (physical point of attachment).
276 ppa: u32,
277 },
278 /// One of the IFT types, e.g. IFT_ETHER.
279 type: u32,
280 ifru: extern union {
281 /// Address.
282 addr: sockaddr.storage,
283 /// Other end of a peer-to-peer link.
284 dstaddr: sockaddr.storage,
285 /// Broadcast address.
286 broadaddr: sockaddr.storage,
287 /// Address token.
288 token: sockaddr.storage,
289 /// Subnet prefix.
290 subnet: sockaddr.storage,
291 /// Interface index.
292 ivalue: i32,
293 /// Flags for SIOC?LIFFLAGS.
294 flags: u64,
295 /// Hop count metric
296 metric: i32,
297 /// Maximum transmission unit
298 mtu: u32,
299 // Technically [2]i32
300 muxid: packed struct { ip: i32, arp: i32 },
301 /// Neighbor reachability determination entries
302 nd_req: lif_nd_req,
303 /// Link info
304 ifinfo_req: lif_ifinfo_req,
305 /// Name of the multipath interface group
306 groupname: [IFNAMESIZE]u8,
307 binding: [IFNAMESIZE]u8,
308 /// Zone id associated with this interface.
309 zoneid: zoneid_t,
310 /// Duplicate address detection state. Either in progress or completed.
311 dadstate: u32,
312 },
313};
314
315const IoCtlCommand = enum(u32) {
316 none = 0x20000000, // no parameters
317 write = 0x40000000, // copy out parameters
318 read = 0x80000000, // copy in parameters
319 read_write = 0xc0000000,
320};
321
322fn ioImpl(cmd: IoCtlCommand, io_type: u8, nr: u8, comptime IOT: type) i32 {
323 const size = @as(u32, @intCast(@as(u8, @truncate(@sizeOf(IOT))))) << 16;
324 const t = @as(u32, @intCast(io_type)) << 8;
325 return @as(i32, @bitCast(@intFromEnum(cmd) | size | t | nr));
326}
327
328pub fn IO(io_type: u8, nr: u8) i32 {
329 return ioImpl(.none, io_type, nr, void);
330}
331
332pub fn IOR(io_type: u8, nr: u8, comptime IOT: type) i32 {
333 return ioImpl(.write, io_type, nr, IOT);
334}
335
336pub fn IOW(io_type: u8, nr: u8, comptime IOT: type) i32 {
337 return ioImpl(.read, io_type, nr, IOT);
338}
339
340pub fn IOWR(io_type: u8, nr: u8, comptime IOT: type) i32 {
341 return ioImpl(.read_write, io_type, nr, IOT);
342}
343
344// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1141
345// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those)
346pub const IP = struct {
347 pub const OPTIONS = 1;
348 pub const HDRINCL = 2;
349 pub const TOS = 3;
350 pub const TTL = 4;
351 pub const RECVOPTS = 0x5;
352 pub const RECVRETOPTS = 0x6;
353 pub const RECVDSTADDR = 0x7;
354 pub const RETOPTS = 0x8;
355 pub const RECVIF = 0x9;
356 pub const RECVSLLA = 0xa;
357 pub const RECVTTL = 0xb;
358 pub const RECVTOS = 0xc;
359 pub const MULTICAST_IF = 0x10;
360 pub const MULTICAST_TTL = 0x11;
361 pub const MULTICAST_LOOP = 0x12;
362 pub const ADD_MEMBERSHIP = 0x13;
363 pub const DROP_MEMBERSHIP = 0x14;
364 pub const BLOCK_SOURCE = 0x15;
365 pub const UNBLOCK_SOURCE = 0x16;
366 pub const ADD_SOURCE_MEMBERSHIP = 0x17;
367 pub const DROP_SOURCE_MEMBERSHIP = 0x18;
368 pub const NEXTHOP = 0x19;
369 pub const PKTINFO = 0x1a;
370 pub const RECVPKTINFO = 0x1a;
371 pub const DONTFRAG = 0x1b;
372 pub const MINTTL = 0x1c;
373 pub const SEC_OPT = 0x22;
374 pub const BOUND_IF = 0x41;
375 pub const UNSPEC_SRC = 0x42;
376 pub const BROADCAST_TTL = 0x43;
377 pub const DHCPINIT_IF = 0x45;
378 pub const REUSEADDR = 0x104;
379 pub const DONTROUTE = 0x105;
380 pub const BROADCAST = 0x106;
381 // Same namespace, but these are arguments rather than option names
382 pub const DEFAULT_MULTICAST_TTL = 1;
383 pub const DEFAULT_MULTICAST_LOOP = 1;
384};
385
386// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1192
387// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those)
388pub const IPV6 = struct {
389 pub const UNICAST_HOPS = 0x5;
390 pub const MULTICAST_IF = 0x6;
391 pub const MULTICAST_HOPS = 0x7;
392 pub const MULTICAST_LOOP = 0x8;
393 pub const JOIN_GROUP = 0x9;
394 pub const LEAVE_GROUP = 0xa;
395 pub const ADD_MEMBERSHIP = 0x9;
396 pub const DROP_MEMBERSHIP = 0xa;
397 pub const PKTINFO = 0xb;
398 pub const HOPLIMIT = 0xc;
399 pub const NEXTHOP = 0xd;
400 pub const HOPOPTS = 0xe;
401 pub const DSTOPTS = 0xf;
402 pub const RTHDR = 0x10;
403 pub const RTHDRDSTOPTS = 0x11;
404 pub const RECVPKTINFO = 0x12;
405 pub const RECVHOPLIMIT = 0x13;
406 pub const RECVHOPOPTS = 0x14;
407 pub const OLD_RECVDSTOPTS = 0x15;
408 pub const RECVRTHDR = 0x16;
409 pub const RECVRTHDRDSTOPTS = 0x17;
410 pub const CHECKSUM = 0x18;
411 pub const RECVTCLASS = 0x19;
412 pub const USE_MIN_MTU = 0x20;
413 pub const DONTFRAG = 0x21;
414 pub const SEC_OPT = 0x22;
415 pub const SRC_PREFERENCES = 0x23;
416 pub const RECVPATHMTU = 0x24;
417 pub const PATHMTU = 0x25;
418 pub const TCLASS = 0x26;
419 pub const V6ONLY = 0x27;
420 pub const RECVDSTOPTS = 0x28;
421 pub const MINHOPCOUNT = 0x2f;
422 pub const BOUND_IF = 0x41;
423 pub const UNSPEC_SRC = 0x42;
424 // Same namespace, but these are arguments rather than option names
425 pub const RTHDR_TYPE_0 = 0;
426 pub const PREFER_SRC_HOME = 0x01;
427 pub const PREFER_SRC_COA = 0x02;
428 pub const PREFER_SRC_PUBLIC = 0x04;
429 pub const PREFER_SRC_TMP = 0x08;
430 pub const PREFER_SRC_NONCGA = 0x10;
431 pub const PREFER_SRC_CGA = 0x20;
432 pub const PREFER_SRC_MIPMASK = PREFER_SRC_HOME | PREFER_SRC_COA;
433 pub const PREFER_SRC_MIPDEFAULT = PREFER_SRC_HOME;
434 pub const PREFER_SRC_TMPMASK = PREFER_SRC_PUBLIC | PREFER_SRC_TMP;
435 pub const PREFER_SRC_TMPDEFAULT = PREFER_SRC_PUBLIC;
436 pub const PREFER_SRC_CGAMASK = PREFER_SRC_NONCGA | PREFER_SRC_CGA;
437 pub const PREFER_SRC_CGADEFAULT = PREFER_SRC_NONCGA;
438 pub const PREFER_SRC_MASK = PREFER_SRC_MIPMASK | PREFER_SRC_TMPMASK | PREFER_SRC_CGAMASK;
439 pub const PREFER_SRC_DEFAULT = PREFER_SRC_MIPDEFAULT | PREFER_SRC_TMPDEFAULT | PREFER_SRC_CGADEFAULT;
440};
441
442// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/ip.h#L64
443pub const IPTOS = struct {
444 pub const LOWDELAY = 0x10;
445 pub const THROUGHPUT = 0x08;
446 pub const RELIABILITY = 0x04;
447 pub const ECT = 0x02;
448 pub const CE = 0x01;
449 pub const PREC_NETCONTROL = 0xe0;
450 pub const PREC_INTERNETCONTROL = 0xc0;
451 pub const PREC_CRITIC_ECP = 0xa0;
452 pub const PREC_FLASHOVERRIDE = 0x80;
453 pub const PREC_FLASH = 0x60;
454 pub const PREC_IMMEDIATE = 0x40;
455 pub const PREC_PRIORITY = 0x20;
456 pub const PREC_ROUTINE = 0x00;
457};
lib/std/c/solaris.zig deleted-457
...@@ -1,457 +0,0 @@
1const builtin = @import("builtin");
2const std = @import("../std.zig");
3const assert = std.debug.assert;
4const SO = std.c.SO;
5const fd_t = std.c.fd_t;
6const gid_t = std.c.gid_t;
7const ino_t = std.c.ino_t;
8const mode_t = std.c.mode_t;
9const off_t = std.c.off_t;
10const pid_t = std.c.pid_t;
11const pthread_t = std.c.pthread_t;
12const sockaddr = std.c.sockaddr;
13const socklen_t = std.c.socklen_t;
14const timespec = std.c.timespec;
15const uid_t = std.c.uid_t;
16const IFNAMESIZE = std.c.IFNAMESIZE;
17
18comptime {
19 assert(builtin.os.tag == .solaris or builtin.os.tag == .illumos); // Prevent access of std.c symbols on wrong OS.
20}
21
22pub extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8, arg: ?*anyopaque) c_int;
23pub extern "c" fn sysconf(sc: c_int) i64;
24
25pub const major_t = u32;
26pub const minor_t = u32;
27pub const id_t = i32;
28pub const taskid_t = id_t;
29pub const projid_t = id_t;
30pub const poolid_t = id_t;
31pub const zoneid_t = id_t;
32pub const ctid_t = id_t;
33
34pub const GETCONTEXT = 0;
35pub const SETCONTEXT = 1;
36pub const GETUSTACK = 2;
37pub const SETUSTACK = 3;
38
39pub const POSIX_FADV = struct {
40 pub const NORMAL = 0;
41 pub const RANDOM = 1;
42 pub const SEQUENTIAL = 2;
43 pub const WILLNEED = 3;
44 pub const DONTNEED = 4;
45 pub const NOREUSE = 5;
46};
47
48pub const priority = enum(c_int) {
49 PROCESS = 0,
50 PGRP = 1,
51 USER = 2,
52 GROUP = 3,
53 SESSION = 4,
54 LWP = 5,
55 TASK = 6,
56 PROJECT = 7,
57 ZONE = 8,
58 CONTRACT = 9,
59};
60
61/// Extensions to the ELF auxiliary vector.
62pub const AT_SUN = struct {
63 /// effective user id
64 pub const UID = 2000;
65 /// real user id
66 pub const RUID = 2001;
67 /// effective group id
68 pub const GID = 2002;
69 /// real group id
70 pub const RGID = 2003;
71 /// dynamic linker's ELF header
72 pub const LDELF = 2004;
73 /// dynamic linker's section headers
74 pub const LDSHDR = 2005;
75 /// name of dynamic linker
76 pub const LDNAME = 2006;
77 /// large pagesize
78 pub const LPAGESZ = 2007;
79 /// platform name
80 pub const PLATFORM = 2008;
81 /// hints about hardware capabilities.
82 pub const HWCAP = 2009;
83 pub const HWCAP2 = 2023;
84 /// flush icache?
85 pub const IFLUSH = 2010;
86 /// cpu name
87 pub const CPU = 2011;
88 /// exec() path name in the auxv, null terminated.
89 pub const EXECNAME = 2014;
90 /// mmu module name
91 pub const MMU = 2015;
92 /// dynamic linkers data segment
93 pub const LDDATA = 2016;
94 /// AF_SUN_ flags passed from the kernel
95 pub const AUXFLAGS = 2017;
96 /// name of the emulation binary for the linker
97 pub const EMULATOR = 2018;
98 /// name of the brand library for the linker
99 pub const BRANDNAME = 2019;
100 /// vectors for brand modules.
101 pub const BRAND_AUX1 = 2020;
102 pub const BRAND_AUX2 = 2021;
103 pub const BRAND_AUX3 = 2022;
104 pub const BRAND_AUX4 = 2025;
105 pub const BRAND_NROOT = 2024;
106 /// vector for comm page.
107 pub const COMMPAGE = 2026;
108 /// information about the x86 FPU.
109 pub const FPTYPE = 2027;
110 pub const FPSIZE = 2028;
111};
112
113/// ELF auxiliary vector flags.
114pub const AF_SUN = struct {
115 /// tell ld.so.1 to run "secure" and ignore the environment.
116 pub const SETUGID = 0x00000001;
117 /// hardware capabilities can be verified against AT_SUN_HWCAP
118 pub const HWCAPVERIFY = 0x00000002;
119 pub const NOPLM = 0x00000004;
120};
121
122pub const procfs = struct {
123 pub const misc_header = extern struct {
124 size: u32,
125 type: enum(u32) {
126 Pathname,
127 Socketname,
128 Peersockname,
129 SockoptsBoolOpts,
130 SockoptLinger,
131 SockoptSndbuf,
132 SockoptRcvbuf,
133 SockoptIpNexthop,
134 SockoptIpv6Nexthop,
135 SockoptType,
136 SockoptTcpCongestion,
137 SockfiltersPriv = 14,
138 },
139 };
140
141 pub const fdinfo = extern struct {
142 fd: fd_t,
143 mode: mode_t,
144 ino: ino_t,
145 size: off_t,
146 offset: off_t,
147 uid: uid_t,
148 gid: gid_t,
149 dev_major: major_t,
150 dev_minor: minor_t,
151 special_major: major_t,
152 special_minor: minor_t,
153 fileflags: i32,
154 fdflags: i32,
155 locktype: i16,
156 lockpid: pid_t,
157 locksysid: i32,
158 peerpid: pid_t,
159 __filler: [25]c_int,
160 peername: [15:0]u8,
161 misc: [1]u8,
162 };
163};
164
165pub const SFD = struct {
166 pub const CLOEXEC = 0o2000000;
167 pub const NONBLOCK = 0o4000;
168};
169
170pub const signalfd_siginfo = extern struct {
171 signo: u32,
172 errno: i32,
173 code: i32,
174 pid: u32,
175 uid: uid_t,
176 fd: i32,
177 tid: u32, // unused
178 band: u32,
179 overrun: u32, // unused
180 trapno: u32,
181 status: i32,
182 int: i32, // unused
183 ptr: u64, // unused
184 utime: u64,
185 stime: u64,
186 addr: u64,
187 __pad: [48]u8,
188};
189
190pub const PORT_SOURCE = struct {
191 pub const AIO = 1;
192 pub const TIMER = 2;
193 pub const USER = 3;
194 pub const FD = 4;
195 pub const ALERT = 5;
196 pub const MQ = 6;
197 pub const FILE = 7;
198};
199
200pub const PORT_ALERT = struct {
201 pub const SET = 0x01;
202 pub const UPDATE = 0x02;
203};
204
205/// User watchable file events.
206pub const FILE_EVENT = struct {
207 pub const ACCESS = 0x00000001;
208 pub const MODIFIED = 0x00000002;
209 pub const ATTRIB = 0x00000004;
210 pub const DELETE = 0x00000010;
211 pub const RENAME_TO = 0x00000020;
212 pub const RENAME_FROM = 0x00000040;
213 pub const TRUNC = 0x00100000;
214 pub const NOFOLLOW = 0x10000000;
215 /// The filesystem holding the watched file was unmounted.
216 pub const UNMOUNTED = 0x20000000;
217 /// Some other file/filesystem got mounted over the watched file/directory.
218 pub const MOUNTEDOVER = 0x40000000;
219
220 pub fn isException(event: u32) bool {
221 return event & (UNMOUNTED | DELETE | RENAME_TO | RENAME_FROM | MOUNTEDOVER) > 0;
222 }
223};
224
225pub const port_notify = extern struct {
226 /// Bind request(s) to port.
227 port: u32,
228 /// User defined variable.
229 user: ?*void,
230};
231
232pub const file_obj = extern struct {
233 /// Access time.
234 atim: timespec,
235 /// Modification time
236 mtim: timespec,
237 /// Change time
238 ctim: timespec,
239 __pad: [3]usize,
240 name: [*:0]u8,
241};
242
243// struct ifreq is marked obsolete, with struct lifreq preferred for interface requests.
244// Here we alias lifreq to ifreq to avoid chainging existing code in os and x.os.IPv6.
245pub const SIOCGLIFINDEX = IOWR('i', 133, lifreq);
246
247pub const lif_nd_req = extern struct {
248 addr: sockaddr.storage,
249 state_create: u8,
250 state_same_lla: u8,
251 state_diff_lla: u8,
252 hdw_len: i32,
253 flags: i32,
254 __pad: i32,
255 hdw_addr: [64]u8,
256};
257
258pub const lif_ifinfo_req = extern struct {
259 maxhops: u8,
260 reachtime: u32,
261 reachretrans: u32,
262 maxmtu: u32,
263};
264
265/// IP interface request. See if_tcp(7p) for more info.
266pub const lifreq = extern struct {
267 // Not actually in a union, but the stdlib expects one for ifreq
268 ifrn: extern union {
269 /// Interface name, e.g. "lo0", "en0".
270 name: [IFNAMESIZE]u8,
271 },
272 ru1: extern union {
273 /// For subnet/token etc.
274 addrlen: i32,
275 /// Driver's PPA (physical point of attachment).
276 ppa: u32,
277 },
278 /// One of the IFT types, e.g. IFT_ETHER.
279 type: u32,
280 ifru: extern union {
281 /// Address.
282 addr: sockaddr.storage,
283 /// Other end of a peer-to-peer link.
284 dstaddr: sockaddr.storage,
285 /// Broadcast address.
286 broadaddr: sockaddr.storage,
287 /// Address token.
288 token: sockaddr.storage,
289 /// Subnet prefix.
290 subnet: sockaddr.storage,
291 /// Interface index.
292 ivalue: i32,
293 /// Flags for SIOC?LIFFLAGS.
294 flags: u64,
295 /// Hop count metric
296 metric: i32,
297 /// Maximum transmission unit
298 mtu: u32,
299 // Technically [2]i32
300 muxid: packed struct { ip: i32, arp: i32 },
301 /// Neighbor reachability determination entries
302 nd_req: lif_nd_req,
303 /// Link info
304 ifinfo_req: lif_ifinfo_req,
305 /// Name of the multipath interface group
306 groupname: [IFNAMESIZE]u8,
307 binding: [IFNAMESIZE]u8,
308 /// Zone id associated with this interface.
309 zoneid: zoneid_t,
310 /// Duplicate address detection state. Either in progress or completed.
311 dadstate: u32,
312 },
313};
314
315const IoCtlCommand = enum(u32) {
316 none = 0x20000000, // no parameters
317 write = 0x40000000, // copy out parameters
318 read = 0x80000000, // copy in parameters
319 read_write = 0xc0000000,
320};
321
322fn ioImpl(cmd: IoCtlCommand, io_type: u8, nr: u8, comptime IOT: type) i32 {
323 const size = @as(u32, @intCast(@as(u8, @truncate(@sizeOf(IOT))))) << 16;
324 const t = @as(u32, @intCast(io_type)) << 8;
325 return @as(i32, @bitCast(@intFromEnum(cmd) | size | t | nr));
326}
327
328pub fn IO(io_type: u8, nr: u8) i32 {
329 return ioImpl(.none, io_type, nr, void);
330}
331
332pub fn IOR(io_type: u8, nr: u8, comptime IOT: type) i32 {
333 return ioImpl(.write, io_type, nr, IOT);
334}
335
336pub fn IOW(io_type: u8, nr: u8, comptime IOT: type) i32 {
337 return ioImpl(.read, io_type, nr, IOT);
338}
339
340pub fn IOWR(io_type: u8, nr: u8, comptime IOT: type) i32 {
341 return ioImpl(.read_write, io_type, nr, IOT);
342}
343
344// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1141
345// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those)
346pub const IP = struct {
347 pub const OPTIONS = 1;
348 pub const HDRINCL = 2;
349 pub const TOS = 3;
350 pub const TTL = 4;
351 pub const RECVOPTS = 0x5;
352 pub const RECVRETOPTS = 0x6;
353 pub const RECVDSTADDR = 0x7;
354 pub const RETOPTS = 0x8;
355 pub const RECVIF = 0x9;
356 pub const RECVSLLA = 0xa;
357 pub const RECVTTL = 0xb;
358 pub const RECVTOS = 0xc;
359 pub const MULTICAST_IF = 0x10;
360 pub const MULTICAST_TTL = 0x11;
361 pub const MULTICAST_LOOP = 0x12;
362 pub const ADD_MEMBERSHIP = 0x13;
363 pub const DROP_MEMBERSHIP = 0x14;
364 pub const BLOCK_SOURCE = 0x15;
365 pub const UNBLOCK_SOURCE = 0x16;
366 pub const ADD_SOURCE_MEMBERSHIP = 0x17;
367 pub const DROP_SOURCE_MEMBERSHIP = 0x18;
368 pub const NEXTHOP = 0x19;
369 pub const PKTINFO = 0x1a;
370 pub const RECVPKTINFO = 0x1a;
371 pub const DONTFRAG = 0x1b;
372 pub const MINTTL = 0x1c;
373 pub const SEC_OPT = 0x22;
374 pub const BOUND_IF = 0x41;
375 pub const UNSPEC_SRC = 0x42;
376 pub const BROADCAST_TTL = 0x43;
377 pub const DHCPINIT_IF = 0x45;
378 pub const REUSEADDR = 0x104;
379 pub const DONTROUTE = 0x105;
380 pub const BROADCAST = 0x106;
381 // Same namespace, but these are arguments rather than option names
382 pub const DEFAULT_MULTICAST_TTL = 1;
383 pub const DEFAULT_MULTICAST_LOOP = 1;
384};
385
386// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/in.h#L1192
387// (old OpenSolaris is very similar, it's just missing a few more-modern ones, and probably modern Solaris has those)
388pub const IPV6 = struct {
389 pub const UNICAST_HOPS = 0x5;
390 pub const MULTICAST_IF = 0x6;
391 pub const MULTICAST_HOPS = 0x7;
392 pub const MULTICAST_LOOP = 0x8;
393 pub const JOIN_GROUP = 0x9;
394 pub const LEAVE_GROUP = 0xa;
395 pub const ADD_MEMBERSHIP = 0x9;
396 pub const DROP_MEMBERSHIP = 0xa;
397 pub const PKTINFO = 0xb;
398 pub const HOPLIMIT = 0xc;
399 pub const NEXTHOP = 0xd;
400 pub const HOPOPTS = 0xe;
401 pub const DSTOPTS = 0xf;
402 pub const RTHDR = 0x10;
403 pub const RTHDRDSTOPTS = 0x11;
404 pub const RECVPKTINFO = 0x12;
405 pub const RECVHOPLIMIT = 0x13;
406 pub const RECVHOPOPTS = 0x14;
407 pub const OLD_RECVDSTOPTS = 0x15;
408 pub const RECVRTHDR = 0x16;
409 pub const RECVRTHDRDSTOPTS = 0x17;
410 pub const CHECKSUM = 0x18;
411 pub const RECVTCLASS = 0x19;
412 pub const USE_MIN_MTU = 0x20;
413 pub const DONTFRAG = 0x21;
414 pub const SEC_OPT = 0x22;
415 pub const SRC_PREFERENCES = 0x23;
416 pub const RECVPATHMTU = 0x24;
417 pub const PATHMTU = 0x25;
418 pub const TCLASS = 0x26;
419 pub const V6ONLY = 0x27;
420 pub const RECVDSTOPTS = 0x28;
421 pub const MINHOPCOUNT = 0x2f;
422 pub const BOUND_IF = 0x41;
423 pub const UNSPEC_SRC = 0x42;
424 // Same namespace, but these are arguments rather than option names
425 pub const RTHDR_TYPE_0 = 0;
426 pub const PREFER_SRC_HOME = 0x01;
427 pub const PREFER_SRC_COA = 0x02;
428 pub const PREFER_SRC_PUBLIC = 0x04;
429 pub const PREFER_SRC_TMP = 0x08;
430 pub const PREFER_SRC_NONCGA = 0x10;
431 pub const PREFER_SRC_CGA = 0x20;
432 pub const PREFER_SRC_MIPMASK = PREFER_SRC_HOME | PREFER_SRC_COA;
433 pub const PREFER_SRC_MIPDEFAULT = PREFER_SRC_HOME;
434 pub const PREFER_SRC_TMPMASK = PREFER_SRC_PUBLIC | PREFER_SRC_TMP;
435 pub const PREFER_SRC_TMPDEFAULT = PREFER_SRC_PUBLIC;
436 pub const PREFER_SRC_CGAMASK = PREFER_SRC_NONCGA | PREFER_SRC_CGA;
437 pub const PREFER_SRC_CGADEFAULT = PREFER_SRC_NONCGA;
438 pub const PREFER_SRC_MASK = PREFER_SRC_MIPMASK | PREFER_SRC_TMPMASK | PREFER_SRC_CGAMASK;
439 pub const PREFER_SRC_DEFAULT = PREFER_SRC_MIPDEFAULT | PREFER_SRC_TMPDEFAULT | PREFER_SRC_CGADEFAULT;
440};
441
442// https://github.com/illumos/illumos-gate/blob/608eb926e14f4ba4736b2d59e891335f1cba9e1e/usr/src/uts/common/netinet/ip.h#L64
443pub const IPTOS = struct {
444 pub const LOWDELAY = 0x10;
445 pub const THROUGHPUT = 0x08;
446 pub const RELIABILITY = 0x04;
447 pub const ECT = 0x02;
448 pub const CE = 0x01;
449 pub const PREC_NETCONTROL = 0xe0;
450 pub const PREC_INTERNETCONTROL = 0xc0;
451 pub const PREC_CRITIC_ECP = 0xa0;
452 pub const PREC_FLASHOVERRIDE = 0x80;
453 pub const PREC_FLASH = 0x60;
454 pub const PREC_IMMEDIATE = 0x40;
455 pub const PREC_PRIORITY = 0x20;
456 pub const PREC_ROUTINE = 0x00;
457};
lib/std/crypto/Certificate/Bundle.zig+1-1
...@@ -63,7 +63,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {...@@ -63,7 +63,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {
63 .freebsd, .openbsd => return rescanWithPath(cb, gpa, "/etc/ssl/cert.pem"),63 .freebsd, .openbsd => return rescanWithPath(cb, gpa, "/etc/ssl/cert.pem"),
64 .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),64 .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),
65 .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"),65 .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"),
66 .solaris, .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"),66 .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"),
67 .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"),67 .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"),
68 // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L1968 // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L19
69 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"),69 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"),
lib/std/debug.zig-2
...@@ -1368,7 +1368,6 @@ pub const have_segfault_handling_support = switch (native_os) {...@@ -1368,7 +1368,6 @@ pub const have_segfault_handling_support = switch (native_os) {
1368 .watchos,1368 .watchos,
13691369
1370 .illumos,1370 .illumos,
1371 .solaris,
13721371
1373 .windows,1372 .windows,
1374 => true,1373 => true,
...@@ -1471,7 +1470,6 @@ fn handleSegfaultPosix(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopa...@@ -1471,7 +1470,6 @@ fn handleSegfaultPosix(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopa
1471 .openbsd,1470 .openbsd,
1472 => @intFromPtr(info.data.fault.addr),1471 => @intFromPtr(info.data.fault.addr),
1473 .illumos,1472 .illumos,
1474 .solaris,
1475 => @intFromPtr(info.reason.fault.addr),1473 => @intFromPtr(info.reason.fault.addr),
1476 else => comptime unreachable,1474 else => comptime unreachable,
1477 };1475 };
lib/std/debug/SelfInfo/Elf.zig-3
...@@ -160,9 +160,6 @@ pub const can_unwind: bool = s: {...@@ -160,9 +160,6 @@ pub const can_unwind: bool = s: {
160 .x86,160 .x86,
161 .x86_64,161 .x86_64,
162 },162 },
163 .solaris => &.{
164 .x86_64,
165 },
166163
167 else => unreachable,164 else => unreachable,
168 };165 };
lib/std/debug/cpu_context.zig-35
...@@ -961,7 +961,6 @@ const Powerpc = extern struct {...@@ -961,7 +961,6 @@ const Powerpc = extern struct {
961 // * System V Application Binary Interface - PowerPC Processor Supplement §3-46961 // * System V Application Binary Interface - PowerPC Processor Supplement §3-46
962 // * Power Architecture 32-bit Application Binary Interface Supplement 1.0 - Linux & Embedded §3.4962 // * Power Architecture 32-bit Application Binary Interface Supplement 1.0 - Linux & Embedded §3.4
963 // * 64-bit ELF V2 ABI Specification - Power Architecture Revision 1.5 §2.4963 // * 64-bit ELF V2 ABI Specification - Power Architecture Revision 1.5 §2.4
964 // * ??? AIX?
965 //964 //
966 // Are we having fun yet?965 // Are we having fun yet?
967966
...@@ -1936,40 +1935,6 @@ const signal_ucontext_t = switch (native_os) {...@@ -1936,40 +1935,6 @@ const signal_ucontext_t = switch (native_os) {
1936 else => unreachable,1935 else => unreachable,
1937 },1936 },
1938 },1937 },
1939 // This needs to be audited by someone with access to the Solaris headers.
1940 .solaris => switch (native_arch) {
1941 .sparc64 => @compileError("sparc64-solaris ucontext_t missing"),
1942 .x86_64 => extern struct {
1943 _flags: u64,
1944 _link: ?*signal_ucontext_t,
1945 _sigmask: std.c.sigset_t,
1946 _stack: std.c.stack_t,
1947 mcontext: extern struct {
1948 r15: u64,
1949 r14: u64,
1950 r13: u64,
1951 r12: u64,
1952 r11: u64,
1953 r10: u64,
1954 r9: u64,
1955 r8: u64,
1956 rdi: u64,
1957 rsi: u64,
1958 rbp: u64,
1959 rbx: u64,
1960 rdx: u64,
1961 rcx: u64,
1962 rax: u64,
1963 _trapno: i64,
1964 _err: i64,
1965 rip: u64,
1966 _cs: i64,
1967 _rflags: i64,
1968 rsp: u64,
1969 },
1970 },
1971 else => unreachable,
1972 },
1973 // https://github.com/illumos/illumos-gate/blob/d4ce137bba3bd16823db6374d9e9a643264ce245/usr/src/uts/intel/sys/ucontext.h1938 // https://github.com/illumos/illumos-gate/blob/d4ce137bba3bd16823db6374d9e9a643264ce245/usr/src/uts/intel/sys/ucontext.h
1974 .illumos => extern struct {1939 .illumos => extern struct {
1975 _flags: usize,1940 _flags: usize,
lib/std/dynamic_library.zig+2-2
...@@ -16,7 +16,7 @@ pub const DynLib = struct {...@@ -16,7 +16,7 @@ pub const DynLib = struct {
16 else16 else
17 DlDynLib,17 DlDynLib,
18 .windows => WindowsDynLib,18 .windows => WindowsDynLib,
19 .macos, .tvos, .watchos, .ios, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly, .solaris, .illumos => DlDynLib,19 .macos, .tvos, .watchos, .ios, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly, .illumos => DlDynLib,
20 else => struct {20 else => struct {
21 const open = @compileError("unsupported platform");21 const open = @compileError("unsupported platform");
22 const openZ = @compileError("unsupported platform");22 const openZ = @compileError("unsupported platform");
...@@ -672,7 +672,7 @@ pub const DlDynLib = struct {...@@ -672,7 +672,7 @@ pub const DlDynLib = struct {
672672
673test "dynamic_library" {673test "dynamic_library" {
674 const libname = switch (native_os) {674 const libname = switch (native_os) {
675 .linux, .freebsd, .openbsd, .solaris, .illumos => "invalid_so.so",675 .linux, .freebsd, .openbsd, .illumos => "invalid_so.so",
676 .windows => "invalid_dll.dll",676 .windows => "invalid_dll.dll",
677 .macos, .tvos, .watchos, .ios, .visionos => "invalid_dylib.dylib",677 .macos, .tvos, .watchos, .ios, .visionos => "invalid_dylib.dylib",
678 else => return error.SkipZigTest,678 else => return error.SkipZigTest,
lib/std/fs.zig+3-3
...@@ -51,7 +51,7 @@ pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirE...@@ -51,7 +51,7 @@ pub const GetAppDataDirError = @import("fs/get_app_data_dir.zig").GetAppDataDirE
51/// * On other platforms, `[]u8` file paths are opaque sequences of bytes with51/// * On other platforms, `[]u8` file paths are opaque sequences of bytes with
52/// no particular encoding.52/// no particular encoding.
53pub const max_path_bytes = switch (native_os) {53pub const max_path_bytes = switch (native_os) {
54 .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .solaris, .illumos, .plan9, .emscripten, .wasi, .serenity => posix.PATH_MAX,54 .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .illumos, .plan9, .emscripten, .wasi, .serenity => posix.PATH_MAX,
55 // Each WTF-16LE code unit may be expanded to 3 WTF-8 bytes.55 // Each WTF-16LE code unit may be expanded to 3 WTF-8 bytes.
56 // If it would require 4 WTF-8 bytes, then there would be a surrogate56 // If it would require 4 WTF-8 bytes, then there would be a surrogate
57 // pair in the WTF-16LE, and we (over)account 3 bytes for it that way.57 // pair in the WTF-16LE, and we (over)account 3 bytes for it that way.
...@@ -72,7 +72,7 @@ pub const max_path_bytes = switch (native_os) {...@@ -72,7 +72,7 @@ pub const max_path_bytes = switch (native_os) {
72/// On WASI, file name components are encoded as valid UTF-8.72/// On WASI, file name components are encoded as valid UTF-8.
73/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.73/// On other platforms, `[]u8` components are an opaque sequence of bytes with no particular encoding.
74pub const max_name_bytes = switch (native_os) {74pub const max_name_bytes = switch (native_os) {
75 .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .solaris, .illumos, .serenity => posix.NAME_MAX,75 .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .illumos, .serenity => posix.NAME_MAX,
76 // Haiku's NAME_MAX includes the null terminator, so subtract one.76 // Haiku's NAME_MAX includes the null terminator, so subtract one.
77 .haiku => posix.NAME_MAX - 1,77 .haiku => posix.NAME_MAX - 1,
78 // Each WTF-16LE character may be expanded to 3 WTF-8 bytes.78 // Each WTF-16LE character may be expanded to 3 WTF-8 bytes.
...@@ -571,7 +571,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {...@@ -571,7 +571,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
571 error.NetworkNotFound => unreachable, // Windows-only571 error.NetworkNotFound => unreachable, // Windows-only
572 else => |e| return e,572 else => |e| return e,
573 },573 },
574 .solaris, .illumos => return posix.readlinkZ("/proc/self/path/a.out", out_buffer) catch |err| switch (err) {574 .illumos => return posix.readlinkZ("/proc/self/path/a.out", out_buffer) catch |err| switch (err) {
575 error.InvalidUtf8 => unreachable, // WASI-only575 error.InvalidUtf8 => unreachable, // WASI-only
576 error.InvalidWtf8 => unreachable, // Windows-only576 error.InvalidWtf8 => unreachable, // Windows-only
577 error.UnsupportedReparsePointType => unreachable, // Windows-only577 error.UnsupportedReparsePointType => unreachable, // Windows-only
lib/std/fs/Dir.zig+5-6
...@@ -39,7 +39,7 @@ const IteratorError = error{...@@ -39,7 +39,7 @@ const IteratorError = error{
39} || posix.UnexpectedError;39} || posix.UnexpectedError;
4040
41pub const Iterator = switch (native_os) {41pub const Iterator = switch (native_os) {
42 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct {42 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos => struct {
43 dir: Dir,43 dir: Dir,
44 seek: i64,44 seek: i64,
45 buf: [1024]u8 align(@alignOf(posix.system.dirent)),45 buf: [1024]u8 align(@alignOf(posix.system.dirent)),
...@@ -57,7 +57,7 @@ pub const Iterator = switch (native_os) {...@@ -57,7 +57,7 @@ pub const Iterator = switch (native_os) {
57 switch (native_os) {57 switch (native_os) {
58 .macos, .ios => return self.nextDarwin(),58 .macos, .ios => return self.nextDarwin(),
59 .freebsd, .netbsd, .dragonfly, .openbsd => return self.nextBsd(),59 .freebsd, .netbsd, .dragonfly, .openbsd => return self.nextBsd(),
60 .solaris, .illumos => return self.nextSolaris(),60 .illumos => return self.nextIllumos(),
61 else => @compileError("unimplemented"),61 else => @compileError("unimplemented"),
62 }62 }
63 }63 }
...@@ -116,7 +116,7 @@ pub const Iterator = switch (native_os) {...@@ -116,7 +116,7 @@ pub const Iterator = switch (native_os) {
116 }116 }
117 }117 }
118118
119 fn nextSolaris(self: *Self) !?Entry {119 fn nextIllumos(self: *Self) !?Entry {
120 start_over: while (true) {120 start_over: while (true) {
121 if (self.index >= self.end_index) {121 if (self.index >= self.end_index) {
122 if (self.first_iter) {122 if (self.first_iter) {
...@@ -144,7 +144,7 @@ pub const Iterator = switch (native_os) {...@@ -144,7 +144,7 @@ pub const Iterator = switch (native_os) {
144 if (mem.eql(u8, name, ".") or mem.eql(u8, name, ".."))144 if (mem.eql(u8, name, ".") or mem.eql(u8, name, ".."))
145 continue :start_over;145 continue :start_over;
146146
147 // Solaris dirent doesn't expose type, so we have to call stat to get it.147 // illumos dirent doesn't expose type, so we have to call stat to get it.
148 const stat_info = posix.fstatat(148 const stat_info = posix.fstatat(
149 self.dir.fd,149 self.dir.fd,
150 name,150 name,
...@@ -619,7 +619,6 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator {...@@ -619,7 +619,6 @@ fn iterateImpl(self: Dir, first_iter_start_value: bool) Iterator {
619 .netbsd,619 .netbsd,
620 .dragonfly,620 .dragonfly,
621 .openbsd,621 .openbsd,
622 .solaris,
623 .illumos,622 .illumos,
624 => return Iterator{623 => return Iterator{
625 .dir = self,624 .dir = self,
...@@ -1770,7 +1769,7 @@ pub fn deleteFileZ(self: Dir, sub_path_c: [*:0]const u8) DeleteFileError!void {...@@ -1770,7 +1769,7 @@ pub fn deleteFileZ(self: Dir, sub_path_c: [*:0]const u8) DeleteFileError!void {
1770 error.AccessDenied, error.PermissionDenied => |e| switch (native_os) {1769 error.AccessDenied, error.PermissionDenied => |e| switch (native_os) {
1771 // non-Linux POSIX systems return permission errors when trying to delete a1770 // non-Linux POSIX systems return permission errors when trying to delete a
1772 // directory, so we need to handle that case specifically and translate the error1771 // directory, so we need to handle that case specifically and translate the error
1773 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => {1772 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos => {
1774 // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them)1773 // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them)
1775 const fstat = posix.fstatatZ(self.fd, sub_path_c, posix.AT.SYMLINK_NOFOLLOW) catch return e;1774 const fstat = posix.fstatatZ(self.fd, sub_path_c, posix.AT.SYMLINK_NOFOLLOW) catch return e;
1776 const is_dir = fstat.mode & posix.S.IFMT == posix.S.IFDIR;1775 const is_dir = fstat.mode & posix.S.IFMT == posix.S.IFDIR;
lib/std/fs/File.zig+1-1
...@@ -444,7 +444,7 @@ pub const Stat = struct {...@@ -444,7 +444,7 @@ pub const Stat = struct {
444 posix.S.IFSOCK => break :k .unix_domain_socket,444 posix.S.IFSOCK => break :k .unix_domain_socket,
445 else => {},445 else => {},
446 }446 }
447 if (builtin.os.tag.isSolarish()) switch (m) {447 if (builtin.os.tag == .illumos) switch (m) {
448 posix.S.IFDOOR => break :k .door,448 posix.S.IFDOOR => break :k .door,
449 posix.S.IFPORT => break :k .event_port,449 posix.S.IFPORT => break :k .event_port,
450 else => {},450 else => {},
lib/std/fs/get_app_data_dir.zig+1-1
...@@ -30,7 +30,7 @@ pub fn getAppDataDir(allocator: mem.Allocator, appname: []const u8) GetAppDataDi...@@ -30,7 +30,7 @@ pub fn getAppDataDir(allocator: mem.Allocator, appname: []const u8) GetAppDataDi
30 };30 };
31 return fs.path.join(allocator, &[_][]const u8{ home_dir, "Library", "Application Support", appname });31 return fs.path.join(allocator, &[_][]const u8{ home_dir, "Library", "Application Support", appname });
32 },32 },
33 .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos, .serenity => {33 .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .illumos, .serenity => {
34 if (posix.getenv("XDG_DATA_HOME")) |xdg| {34 if (posix.getenv("XDG_DATA_HOME")) |xdg| {
35 if (xdg.len > 0) {35 if (xdg.len > 0) {
36 return fs.path.join(allocator, &[_][]const u8{ xdg, appname });36 return fs.path.join(allocator, &[_][]const u8{ xdg, appname });
lib/std/heap.zig+3-3
...@@ -155,7 +155,7 @@ const CAllocator = struct {...@@ -155,7 +155,7 @@ const CAllocator = struct {
155 else {};155 else {};
156156
157 pub const supports_posix_memalign = switch (builtin.os.tag) {157 pub const supports_posix_memalign = switch (builtin.os.tag) {
158 .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => true,158 .dragonfly, .netbsd, .freebsd, .illumos, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => true,
159 else => false,159 else => false,
160 };160 };
161161
...@@ -768,7 +768,7 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) {...@@ -768,7 +768,7 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) {
768 .sparc64 => 8 << 10,768 .sparc64 => 8 << 10,
769 else => null,769 else => null,
770 },770 },
771 .solaris, .illumos => switch (builtin.cpu.arch) {771 .illumos => switch (builtin.cpu.arch) {
772 // src/uts/*/sys/machparam.h772 // src/uts/*/sys/machparam.h
773 .x86, .x86_64 => 4 << 10,773 .x86, .x86_64 => 4 << 10,
774 .sparc, .sparc64 => 8 << 10,774 .sparc, .sparc64 => 8 << 10,
...@@ -926,7 +926,7 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) {...@@ -926,7 +926,7 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) {
926 .sparc64 => 8 << 10,926 .sparc64 => 8 << 10,
927 else => null,927 else => null,
928 },928 },
929 .solaris, .illumos => switch (builtin.cpu.arch) {929 .illumos => switch (builtin.cpu.arch) {
930 // src/uts/*/sys/machparam.h930 // src/uts/*/sys/machparam.h
931 .x86, .x86_64 => 4 << 10,931 .x86, .x86_64 => 4 << 10,
932 .sparc, .sparc64 => 8 << 10,932 .sparc, .sparc64 => 8 << 10,
lib/std/os.zig+1-2
...@@ -80,7 +80,6 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool {...@@ -80,7 +80,6 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool {
80 .tvos,80 .tvos,
81 .visionos,81 .visionos,
82 .linux,82 .linux,
83 .solaris,
84 .illumos,83 .illumos,
85 .freebsd,84 .freebsd,
86 .serenity,85 .serenity,
...@@ -147,7 +146,7 @@ pub fn getFdPath(fd: std.posix.fd_t, out_buffer: *[max_path_bytes]u8) std.posix....@@ -147,7 +146,7 @@ pub fn getFdPath(fd: std.posix.fd_t, out_buffer: *[max_path_bytes]u8) std.posix.
147 };146 };
148 return target;147 return target;
149 },148 },
150 .solaris, .illumos => {149 .illumos => {
151 var procfs_buf: ["/proc/self/path/-2147483648\x00".len]u8 = undefined;150 var procfs_buf: ["/proc/self/path/-2147483648\x00".len]u8 = undefined;
152 const proc_path = std.fmt.bufPrintSentinel(procfs_buf[0..], "/proc/self/path/{d}", .{fd}, 0) catch unreachable;151 const proc_path = std.fmt.bufPrintSentinel(procfs_buf[0..], "/proc/self/path/{d}", .{fd}, 0) catch unreachable;
153152
lib/std/posix.zig+1-2
...@@ -6035,7 +6035,7 @@ pub fn sigaction(sig: u8, noalias act: ?*const Sigaction, noalias oact: ?*Sigact...@@ -6035,7 +6035,7 @@ pub fn sigaction(sig: u8, noalias act: ?*const Sigaction, noalias oact: ?*Sigact
6035 switch (errno(system.sigaction(sig, act, oact))) {6035 switch (errno(system.sigaction(sig, act, oact))) {
6036 .SUCCESS => return,6036 .SUCCESS => return,
6037 // EINVAL means the signal is either invalid or some signal that cannot have its action6037 // EINVAL means the signal is either invalid or some signal that cannot have its action
6038 // changed. For POSIX, this means SIGKILL/SIGSTOP. For e.g. Solaris, this also includes the6038 // changed. For POSIX, this means SIGKILL/SIGSTOP. For e.g. illumos, this also includes the
6039 // non-standard SIGWAITING, SIGCANCEL, and SIGLWP. Either way, programmer error.6039 // non-standard SIGWAITING, SIGCANCEL, and SIGLWP. Either way, programmer error.
6040 .INVAL => unreachable,6040 .INVAL => unreachable,
6041 else => unreachable,6041 else => unreachable,
...@@ -7414,7 +7414,6 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, data: usize) PtraceError!vo...@@ -7414,7 +7414,6 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, data: usize) PtraceError!vo
7414 .wasi,7414 .wasi,
7415 .emscripten,7415 .emscripten,
7416 .haiku,7416 .haiku,
7417 .solaris,
7418 .illumos,7417 .illumos,
7419 .plan9,7418 .plan9,
7420 => @compileError("ptrace unsupported by target OS"),7419 => @compileError("ptrace unsupported by target OS"),
lib/std/posix/test.zig+4-4
...@@ -186,7 +186,7 @@ test "linkat with different directories" {...@@ -186,7 +186,7 @@ test "linkat with different directories" {
186 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // `nstat.nlink` assertion is failing with LLVM 20+ for unclear reasons.186 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // `nstat.nlink` assertion is failing with LLVM 20+ for unclear reasons.
187187
188 switch (native_os) {188 switch (native_os) {
189 .wasi, .linux, .solaris, .illumos => {},189 .wasi, .linux, .illumos => {},
190 else => return error.SkipZigTest,190 else => return error.SkipZigTest,
191 }191 }
192192
...@@ -558,7 +558,7 @@ test "fcntl" {...@@ -558,7 +558,7 @@ test "fcntl" {
558558
559test "signalfd" {559test "signalfd" {
560 switch (native_os) {560 switch (native_os) {
561 .linux, .solaris, .illumos => {},561 .linux, .illumos => {},
562 else => return error.SkipZigTest,562 else => return error.SkipZigTest,
563 }563 }
564 _ = &posix.signalfd;564 _ = &posix.signalfd;
...@@ -577,7 +577,7 @@ test "sync" {...@@ -577,7 +577,7 @@ test "sync" {
577577
578test "fsync" {578test "fsync" {
579 switch (native_os) {579 switch (native_os) {
580 .linux, .windows, .solaris, .illumos => {},580 .linux, .windows, .illumos => {},
581 else => return error.SkipZigTest,581 else => return error.SkipZigTest,
582 }582 }
583583
...@@ -708,7 +708,7 @@ test "sigset add/del" {...@@ -708,7 +708,7 @@ test "sigset add/del" {
708708
709test "dup & dup2" {709test "dup & dup2" {
710 switch (native_os) {710 switch (native_os) {
711 .linux, .solaris, .illumos => {},711 .linux, .illumos => {},
712 else => return error.SkipZigTest,712 else => return error.SkipZigTest,
713 }713 }
714714
lib/std/process.zig-1
...@@ -1539,7 +1539,6 @@ pub fn getUserInfo(name: []const u8) !UserInfo {...@@ -1539,7 +1539,6 @@ pub fn getUserInfo(name: []const u8) !UserInfo {
1539 .netbsd,1539 .netbsd,
1540 .openbsd,1540 .openbsd,
1541 .haiku,1541 .haiku,
1542 .solaris,
1543 .illumos,1542 .illumos,
1544 .serenity,1543 .serenity,
1545 => posixGetUserInfo(name),1544 => posixGetUserInfo(name),
lib/std/start.zig+1-1
...@@ -761,7 +761,7 @@ fn maybeIgnoreSigpipe() void {...@@ -761,7 +761,7 @@ fn maybeIgnoreSigpipe() void {
761 const have_sigpipe_support = switch (builtin.os.tag) {761 const have_sigpipe_support = switch (builtin.os.tag) {
762 .linux,762 .linux,
763 .plan9,763 .plan9,
764 .solaris,764 .illumos,
765 .netbsd,765 .netbsd,
766 .openbsd,766 .openbsd,
767 .haiku,767 .haiku,
lib/std/zig/LibCInstallation.zig+2-2
...@@ -198,7 +198,7 @@ pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation {...@@ -198,7 +198,7 @@ pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation {
198 try self.findNativeIncludeDirPosix(args);198 try self.findNativeIncludeDirPosix(args);
199 try self.findNativeGccDirHaiku(args);199 try self.findNativeGccDirHaiku(args);
200 self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib");200 self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib");
201 } else if (builtin.target.os.tag.isSolarish()) {201 } else if (builtin.target.os.tag == .illumos) {
202 // There is only one libc, and its headers/libraries are always in the same spot.202 // There is only one libc, and its headers/libraries are always in the same spot.
203 self.include_dir = try args.allocator.dupeZ(u8, "/usr/include");203 self.include_dir = try args.allocator.dupeZ(u8, "/usr/include");
204 self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include");204 self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include");
...@@ -935,7 +935,7 @@ pub const CrtBasenames = struct {...@@ -935,7 +935,7 @@ pub const CrtBasenames = struct {
935 .crtn = "crtn.o",935 .crtn = "crtn.o",
936 },936 },
937 },937 },
938 .solaris, .illumos => switch (mode) {938 .illumos => switch (mode) {
939 .dynamic_lib => .{939 .dynamic_lib => .{
940 .crti = "crti.o",940 .crti = "crti.o",
941 .crtn = "crtn.o",941 .crtn = "crtn.o",
lib/std/zig/system.zig+4-4
...@@ -228,7 +228,7 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target {...@@ -228,7 +228,7 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target {
228 error.InvalidVersion => {},228 error.InvalidVersion => {},
229 }229 }
230 },230 },
231 .solaris, .illumos => {231 .illumos => {
232 const uts = posix.uname();232 const uts = posix.uname();
233 const release = mem.sliceTo(&uts.release, 0);233 const release = mem.sliceTo(&uts.release, 0);
234 if (std.SemanticVersion.parse(release)) |ver| {234 if (std.SemanticVersion.parse(release)) |ver| {
...@@ -1058,13 +1058,13 @@ fn detectAbiAndDynamicLinker(...@@ -1058,13 +1058,13 @@ fn detectAbiAndDynamicLinker(
1058) DetectError!Target {1058) DetectError!Target {
1059 const native_target_has_ld = comptime Target.DynamicLinker.kind(builtin.os.tag) != .none;1059 const native_target_has_ld = comptime Target.DynamicLinker.kind(builtin.os.tag) != .none;
1060 const is_linux = builtin.target.os.tag == .linux;1060 const is_linux = builtin.target.os.tag == .linux;
1061 const is_solarish = builtin.target.os.tag.isSolarish();1061 const is_illumos = builtin.target.os.tag == .illumos;
1062 const is_darwin = builtin.target.os.tag.isDarwin();1062 const is_darwin = builtin.target.os.tag.isDarwin();
1063 const have_all_info = query.dynamic_linker.get() != null and1063 const have_all_info = query.dynamic_linker.get() != null and
1064 query.abi != null and (!is_linux or query.abi.?.isGnu());1064 query.abi != null and (!is_linux or query.abi.?.isGnu());
1065 const os_is_non_native = query.os_tag != null;1065 const os_is_non_native = query.os_tag != null;
1066 // The Solaris/illumos environment is always the same.1066 // The illumos environment is always the same.
1067 if (!native_target_has_ld or have_all_info or os_is_non_native or is_solarish or is_darwin) {1067 if (!native_target_has_ld or have_all_info or os_is_non_native or is_illumos or is_darwin) {
1068 return defaultAbiAndDynamicLinker(cpu, os, query);1068 return defaultAbiAndDynamicLinker(cpu, os, query);
1069 }1069 }
1070 if (query.abi) |abi| {1070 if (query.abi) |abi| {
lib/std/zig/system/NativePaths.zig+1-1
...@@ -99,7 +99,7 @@ pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths {...@@ -99,7 +99,7 @@ pub fn detect(arena: Allocator, native_target: *const std.Target) !NativePaths {
99 return self;99 return self;
100 }100 }
101101
102 if (builtin.os.tag.isSolarish()) {102 if (builtin.os.tag == .illumos) {
103 try self.addLibDir("/usr/lib/64");103 try self.addLibDir("/usr/lib/64");
104 try self.addLibDir("/usr/local/lib/64");104 try self.addLibDir("/usr/local/lib/64");
105 try self.addLibDir("/lib/64");105 try self.addLibDir("/lib/64");
src/codegen/llvm.zig+1-1
...@@ -211,7 +211,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8...@@ -211,7 +211,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
211 .linux => "linux",211 .linux => "linux",
212 .netbsd => "netbsd",212 .netbsd => "netbsd",
213 .openbsd => "openbsd",213 .openbsd => "openbsd",
214 .solaris, .illumos => "solaris",214 .illumos => "solaris",
215 .windows, .uefi => "windows",215 .windows, .uefi => "windows",
216 .zos => "zos",216 .zos => "zos",
217 .haiku => "haiku",217 .haiku => "haiku",
src/link/Elf.zig+1-1
...@@ -1561,7 +1561,7 @@ pub fn writeElfHeader(self: *Elf) !void {...@@ -1561,7 +1561,7 @@ pub fn writeElfHeader(self: *Elf) !void {
1561 else => switch (target.os.tag) {1561 else => switch (target.os.tag) {
1562 .freebsd, .ps4 => .FREEBSD,1562 .freebsd, .ps4 => .FREEBSD,
1563 .hermit => .STANDALONE,1563 .hermit => .STANDALONE,
1564 .illumos, .solaris => .SOLARIS,1564 .illumos => .SOLARIS,
1565 .openbsd => .OPENBSD,1565 .openbsd => .OPENBSD,
1566 else => .NONE,1566 else => .NONE,
1567 },1567 },
src/link/Elf2.zig+1-1
...@@ -417,7 +417,7 @@ fn create(...@@ -417,7 +417,7 @@ fn create(
417 else => .NONE,417 else => .NONE,
418 .freestanding, .other => .STANDALONE,418 .freestanding, .other => .STANDALONE,
419 .netbsd => .NETBSD,419 .netbsd => .NETBSD,
420 .solaris => .SOLARIS,420 .illumos => .SOLARIS,
421 .aix => .AIX,421 .aix => .AIX,
422 .freebsd => .FREEBSD,422 .freebsd => .FREEBSD,
423 .cuda => .CUDA,423 .cuda => .CUDA,
src/target.zig+4-5
...@@ -129,13 +129,13 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.builtin.Compil...@@ -129,13 +129,13 @@ pub fn hasValgrindSupport(target: *const std.Target, backend: std.builtin.Compil
129 else => false,129 else => false,
130 },130 },
131 .x86 => switch (target.os.tag) {131 .x86 => switch (target.os.tag) {
132 .linux, .freebsd, .solaris, .illumos => true,132 .linux, .freebsd, .illumos => true,
133 .windows => !ofmt_c_msvc,133 .windows => !ofmt_c_msvc,
134 else => false,134 else => false,
135 },135 },
136 .x86_64 => switch (target.os.tag) {136 .x86_64 => switch (target.os.tag) {
137 .linux => target.abi != .gnux32 and target.abi != .muslx32,137 .linux => target.abi != .gnux32 and target.abi != .muslx32,
138 .freebsd, .solaris, .illumos => true,138 .freebsd, .illumos => true,
139 .windows => !ofmt_c_msvc,139 .windows => !ofmt_c_msvc,
140 else => false,140 else => false,
141 },141 },
...@@ -257,7 +257,7 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.C...@@ -257,7 +257,7 @@ pub fn hasNewLinkerSupport(ofmt: std.Target.ObjectFormat, backend: std.builtin.C
257pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {257pub fn selfHostedBackendIsAsRobustAsLlvm(target: *const std.Target) bool {
258 if (target.cpu.arch.isSpirV()) return true;258 if (target.cpu.arch.isSpirV()) return true;
259 if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {259 if (target.cpu.arch == .x86_64 and target.ptrBitWidth() == 64) {
260 if (target.os.tag.isSolarish()) {260 if (target.os.tag == .illumos) {
261 // https://github.com/ziglang/zig/issues/25699261 // https://github.com/ziglang/zig/issues/25699
262 return false;262 return false;
263 }263 }
...@@ -428,8 +428,7 @@ pub fn libcFullLinkFlags(target: *const std.Target) []const []const u8 {...@@ -428,8 +428,7 @@ pub fn libcFullLinkFlags(target: *const std.Target) []const []const u8 {
428 // c compilers such as gcc or clang use.428 // c compilers such as gcc or clang use.
429 const result: []const []const u8 = switch (target.os.tag) {429 const result: []const []const u8 = switch (target.os.tag) {
430 .dragonfly, .freebsd, .netbsd, .openbsd => &.{ "-lm", "-lpthread", "-lc", "-lutil" },430 .dragonfly, .freebsd, .netbsd, .openbsd => &.{ "-lm", "-lpthread", "-lc", "-lutil" },
431 // Solaris releases after 10 merged the threading libraries into libc.431 .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" },
432 .solaris, .illumos => &.{ "-lm", "-lsocket", "-lnsl", "-lc" },
433 .haiku => &.{ "-lm", "-lroot", "-lpthread", "-lc", "-lnetwork" },432 .haiku => &.{ "-lm", "-lroot", "-lpthread", "-lc", "-lnetwork" },
434 .linux => switch (target.abi) {433 .linux => switch (target.abi) {
435 .android, .androideabi, .ohos, .ohoseabi => &.{ "-lm", "-lc", "-ldl" },434 .android, .androideabi, .ohos, .ohoseabi => &.{ "-lm", "-lc", "-ldl" },
test/llvm_targets.zig-2
...@@ -254,7 +254,6 @@ const targets = [_]std.Target.Query{...@@ -254,7 +254,6 @@ const targets = [_]std.Target.Query{
254 .{ .cpu_arch = .sparc64, .os_tag = .netbsd, .abi = .none },254 .{ .cpu_arch = .sparc64, .os_tag = .netbsd, .abi = .none },
255 .{ .cpu_arch = .sparc64, .os_tag = .openbsd, .abi = .none },255 .{ .cpu_arch = .sparc64, .os_tag = .openbsd, .abi = .none },
256 .{ .cpu_arch = .sparc64, .os_tag = .rtems, .abi = .none },256 .{ .cpu_arch = .sparc64, .os_tag = .rtems, .abi = .none },
257 .{ .cpu_arch = .sparc64, .os_tag = .solaris, .abi = .none },
258257
259 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi },258 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi },
260 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf },259 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf },
...@@ -338,7 +337,6 @@ const targets = [_]std.Target.Query{...@@ -338,7 +337,6 @@ const targets = [_]std.Target.Query{
338 .{ .cpu_arch = .x86_64, .os_tag = .openbsd, .abi = .none },337 .{ .cpu_arch = .x86_64, .os_tag = .openbsd, .abi = .none },
339 .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none },338 .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none },
340 .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none },339 .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none },
341 .{ .cpu_arch = .x86_64, .os_tag = .solaris, .abi = .none },
342 .{ .cpu_arch = .x86_64, .os_tag = .tvos, .abi = .simulator },340 .{ .cpu_arch = .x86_64, .os_tag = .tvos, .abi = .simulator },
343 .{ .cpu_arch = .x86_64, .os_tag = .uefi, .abi = .none },341 .{ .cpu_arch = .x86_64, .os_tag = .uefi, .abi = .none },
344 .{ .cpu_arch = .x86_64, .os_tag = .visionos, .abi = .simulator },342 .{ .cpu_arch = .x86_64, .os_tag = .visionos, .abi = .simulator },
test/src/ErrorTrace.zig+1-1
...@@ -41,7 +41,7 @@ pub fn addCase(self: *ErrorTrace, case: Case) void {...@@ -41,7 +41,7 @@ pub fn addCase(self: *ErrorTrace, case: Case) void {
41fn shouldTestNonLlvm(target: *const std.Target) bool {41fn shouldTestNonLlvm(target: *const std.Target) bool {
42 return switch (target.cpu.arch) {42 return switch (target.cpu.arch) {
43 .x86_64 => switch (target.ofmt) {43 .x86_64 => switch (target.ofmt) {
44 .elf => !target.os.tag.isBSD() and !target.os.tag.isSolarish(),44 .elf => !target.os.tag.isBSD() and target.os.tag != .illumos,
45 else => false,45 else => false,
46 },46 },
47 else => false,47 else => false,
test/src/StackTrace.zig+1-1
...@@ -46,7 +46,7 @@ fn addCaseTarget(...@@ -46,7 +46,7 @@ fn addCaseTarget(
46) void {46) void {
47 const both_backends = switch (target.result.cpu.arch) {47 const both_backends = switch (target.result.cpu.arch) {
48 .x86_64 => switch (target.result.ofmt) {48 .x86_64 => switch (target.result.ofmt) {
49 .elf => !target.result.os.tag.isBSD() and !target.result.os.tag.isSolarish(),49 .elf => !target.result.os.tag.isBSD() and target.result.os.tag != .illumos,
50 else => false,50 else => false,
51 },51 },
52 else => false,52 else => false,
test/standalone/posix/relpaths.zig+1-1
...@@ -50,7 +50,7 @@ fn test_symlink(a: std.mem.Allocator, tmp: std.testing.TmpDir) !void {...@@ -50,7 +50,7 @@ fn test_symlink(a: std.mem.Allocator, tmp: std.testing.TmpDir) !void {
5050
51fn test_link(tmp: std.testing.TmpDir) !void {51fn test_link(tmp: std.testing.TmpDir) !void {
52 switch (builtin.target.os.tag) {52 switch (builtin.target.os.tag) {
53 .linux, .solaris, .illumos => {},53 .linux, .illumos => {},
54 else => return,54 else => return,
55 }55 }
5656
test/tests.zig+1-1
...@@ -2493,7 +2493,7 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt...@@ -2493,7 +2493,7 @@ pub fn wouldUseLlvm(use_llvm: ?bool, query: std.Target.Query, optimize_mode: Opt
2493 const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;2493 const cpu_arch = query.cpu_arch orelse builtin.cpu.arch;
2494 const os_tag = query.os_tag orelse builtin.os.tag;2494 const os_tag = query.os_tag orelse builtin.os.tag;
2495 switch (cpu_arch) {2495 switch (cpu_arch) {
2496 .x86_64 => if (os_tag.isBSD() or os_tag.isSolarish() or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,2496 .x86_64 => if (os_tag.isBSD() or os_tag == .illumos or std.Target.ptrBitWidth_arch_abi(cpu_arch, query.abi orelse .none) != 64) return true,
2497 .spirv32, .spirv64 => return false,2497 .spirv32, .spirv64 => return false,
2498 else => return true,2498 else => return true,
2499 }2499 }